@reactive-web-components/rwc 2.54.2 → 2.54.3
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,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactive-web-components/rwc",
|
|
3
|
-
"version": "2.54.
|
|
3
|
+
"version": "2.54.3",
|
|
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.
|
|
10
|
-
"require": "./reactive-web-component.
|
|
9
|
+
"import": "./reactive-web-component.D0Ecujpb.js",
|
|
10
|
+
"require": "./reactive-web-component.Do5weOHn.umd.cjs"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"author": "tamazyanarsen",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"ui",
|
|
35
35
|
"frontend"
|
|
36
36
|
],
|
|
37
|
-
"module": "./reactive-web-component.
|
|
38
|
-
"main": "./reactive-web-component.
|
|
37
|
+
"module": "./reactive-web-component.D0Ecujpb.js",
|
|
38
|
+
"main": "./reactive-web-component.Do5weOHn.umd.cjs"
|
|
39
39
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var C = (t, e, s) =>
|
|
1
|
+
var Y = Object.defineProperty;
|
|
2
|
+
var K = (t, e, s) => e in t ? Y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var C = (t, e, s) => K(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
4
|
const x = (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),
|
|
6
|
+
)) && !("hostElement" in t), tt = (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, _ = (t, e, ...s) => {
|
|
7
7
|
e && e.apply(t, s);
|
|
8
8
|
};
|
|
9
9
|
let F = !0;
|
|
@@ -12,7 +12,7 @@ const u = (...t) => {
|
|
|
12
12
|
["[rwc]", ...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()}`),
|
|
15
|
+
}, $ = (t) => t.replace(/([A-Z])/gm, (e) => `-${e.toLowerCase()}`), et = (t) => t.replace(/-(\w)/gm, (e, s) => s.toUpperCase()), g = (t, ...e) => {
|
|
16
16
|
if (!F) return;
|
|
17
17
|
const s = {
|
|
18
18
|
r: "color: #ff0000",
|
|
@@ -31,37 +31,40 @@ const u = (...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((
|
|
35
|
-
const a =
|
|
34
|
+
}, n = t.match(/@[rgbpycow]/g) || [], o = n.map((l) => {
|
|
35
|
+
const a = l.slice(1);
|
|
36
36
|
return s[a] || "color: inherit";
|
|
37
37
|
});
|
|
38
38
|
let r = t;
|
|
39
|
-
n.forEach((
|
|
40
|
-
const a = new RegExp(`\\${
|
|
39
|
+
n.forEach((l) => {
|
|
40
|
+
const a = new RegExp(`\\${l}([^\\s,]+)`, "g");
|
|
41
41
|
r = r.replace(a, "%c$1");
|
|
42
42
|
}), console.log(r, ...o, ...e);
|
|
43
|
-
},
|
|
43
|
+
}, At = () => {
|
|
44
44
|
F = !0;
|
|
45
|
-
},
|
|
45
|
+
}, st = () => {
|
|
46
46
|
F = !1;
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
let
|
|
50
|
-
const
|
|
48
|
+
st();
|
|
49
|
+
let B = !1;
|
|
50
|
+
const gt = (t) => {
|
|
51
|
+
B = t;
|
|
52
|
+
}, V = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new WeakMap(), I = [], L = [];
|
|
51
53
|
function A(t, e) {
|
|
52
54
|
const s = /* @__PURE__ */ new Set();
|
|
53
55
|
let n = (e == null ? void 0 : e.signalCompareFn) || (() => !0);
|
|
54
56
|
function o() {
|
|
57
|
+
var l;
|
|
55
58
|
const r = I[I.length - 1];
|
|
56
59
|
if (r && !("fake" in r && r.fake)) {
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
|
|
60
|
+
const a = R.get(r), c = a == null ? void 0 : a.parent;
|
|
61
|
+
if (c) {
|
|
62
|
+
const d = R.get(c);
|
|
63
|
+
d == null || d.cleanupFns.add(() => {
|
|
61
64
|
s.delete(r);
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
|
-
s.add(r);
|
|
67
|
+
s.add(r), B && ((l = V.get(r.effectId)) == null || l.signals.push(o));
|
|
65
68
|
}
|
|
66
69
|
return t;
|
|
67
70
|
}
|
|
@@ -73,23 +76,23 @@ function A(t, e) {
|
|
|
73
76
|
return Object.freeze(t);
|
|
74
77
|
}, o.initValue = Object.freeze(t), o.oldValue = Object.freeze(t), o.forceSet = function(r) {
|
|
75
78
|
o.oldValue = Object.freeze(t), t = r, s.forEach(
|
|
76
|
-
(
|
|
77
|
-
const c =
|
|
78
|
-
c && c.cleanupFns.size > 0 && (c.cleanupFns.forEach((d) => d()), c.cleanupFns.clear()),
|
|
79
|
+
(l) => Promise.resolve(l).then((a) => {
|
|
80
|
+
const c = R.get(a);
|
|
81
|
+
c && c.cleanupFns.size > 0 && (c.cleanupFns.forEach((d) => d()), c.cleanupFns.clear()), L.push(a), a(), L.pop();
|
|
79
82
|
})
|
|
80
83
|
);
|
|
81
|
-
}, o.set = function(r,
|
|
82
|
-
t !== r &&
|
|
84
|
+
}, o.set = function(r, l = n) {
|
|
85
|
+
t !== r && l(t, r) && o.forceSet(r);
|
|
83
86
|
}, o.update = function(r) {
|
|
84
87
|
o.set(r(t));
|
|
85
|
-
}, o.pipe = (r,
|
|
88
|
+
}, o.pipe = (r, l) => {
|
|
86
89
|
const a = A(null);
|
|
87
90
|
return m(() => {
|
|
88
91
|
const c = o();
|
|
89
92
|
m(() => {
|
|
90
93
|
const d = r(c);
|
|
91
94
|
d instanceof Promise ? d.then((f) => a.set(f)) : y(d) ? m(() => a.set(d())) : a.set(d);
|
|
92
|
-
},
|
|
95
|
+
}, l);
|
|
93
96
|
}), a;
|
|
94
97
|
}, o;
|
|
95
98
|
}
|
|
@@ -98,10 +101,13 @@ function m(t, e) {
|
|
|
98
101
|
u("current effect", `%c${s}%c`);
|
|
99
102
|
const n = t;
|
|
100
103
|
t = () => (u("current effect callback", `%c${s}%c`), n()), "fake" in n && n.fake && (t.fake = !0), t.effectId = s;
|
|
101
|
-
const o =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
const o = L[L.length - 1];
|
|
105
|
+
B && V.set(s, {
|
|
106
|
+
signals: [],
|
|
107
|
+
parent: (o == null ? void 0 : o.effectId) || null
|
|
108
|
+
}), R.has(t) || R.set(t, { cleanupFns: /* @__PURE__ */ new Set() });
|
|
109
|
+
const r = R.get(t);
|
|
110
|
+
o ? r.parent = o : delete r.parent, L.push(t), I.push(t), t(), I.pop(), L.pop();
|
|
105
111
|
}
|
|
106
112
|
const y = (t) => !!t && ["object", "function"].includes(typeof t) && "set" in t && "oldValue" in t && "update" in t && "forceSet" in t;
|
|
107
113
|
function Lt(t, ...e) {
|
|
@@ -110,8 +116,8 @@ function Lt(t, ...e) {
|
|
|
110
116
|
const n = e.map(
|
|
111
117
|
(r) => y(r) ? String(r()) : String(r)
|
|
112
118
|
), o = [t[0]];
|
|
113
|
-
n.forEach((r,
|
|
114
|
-
o.push(r, t[
|
|
119
|
+
n.forEach((r, l) => {
|
|
120
|
+
o.push(r, t[l + 1]);
|
|
115
121
|
}), s.set(o.join(""));
|
|
116
122
|
}), s;
|
|
117
123
|
}
|
|
@@ -122,24 +128,24 @@ function Rt(t, e) {
|
|
|
122
128
|
o instanceof Promise ? o.then(n) : y(o) ? m(() => n(o())) : n(o);
|
|
123
129
|
}), s;
|
|
124
130
|
}
|
|
125
|
-
function
|
|
131
|
+
function Ot(t, e) {
|
|
126
132
|
let s = t(), n = e();
|
|
127
133
|
m(() => {
|
|
128
134
|
const o = t(), r = e();
|
|
129
135
|
o !== r && (o !== s ? e.set(o) : r !== n && t.set(r)), s = o, n = r;
|
|
130
136
|
});
|
|
131
137
|
}
|
|
132
|
-
function
|
|
138
|
+
function jt(...t) {
|
|
133
139
|
let e = t.map((n) => n());
|
|
134
140
|
const s = A(e);
|
|
135
141
|
return t.forEach((n, o) => {
|
|
136
142
|
m(() => {
|
|
137
|
-
const r = () => e.filter((
|
|
143
|
+
const r = () => e.filter((l) => l !== void 0).length;
|
|
138
144
|
r() === t.length && (e = Array.from(e).fill(void 0)), e[o] = n(), r() === t.length && s.set([...e]);
|
|
139
145
|
});
|
|
140
146
|
}), s;
|
|
141
147
|
}
|
|
142
|
-
const
|
|
148
|
+
const Tt = (...t) => {
|
|
143
149
|
const e = A([]);
|
|
144
150
|
return m(() => {
|
|
145
151
|
e.set(t.map((s) => s()));
|
|
@@ -204,20 +210,20 @@ class O extends HTMLElement {
|
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
212
|
C(O, "observedAttributes", []), C(O, "renderTagName", ""), C(O, "styles");
|
|
207
|
-
const
|
|
208
|
-
},
|
|
213
|
+
const xt = (t) => "render" in t && "setReactiveValue" in t, nt = "handleSlotContext", q = "onConnected", wt = () => () => {
|
|
214
|
+
}, G = (t) => typeof t == "string" ? t : JSON.stringify(t), U = (t) => {
|
|
209
215
|
const e = document.createElement("span");
|
|
210
|
-
return e.textContent =
|
|
211
|
-
},
|
|
216
|
+
return e.textContent = G(t), e;
|
|
217
|
+
}, X = (t, e) => (t.appendChild(U(e)), t), ot = (t, e) => (t.innerHTML = "", X(t, e)), z = (t) => {
|
|
212
218
|
const e = document.createElement("span");
|
|
213
219
|
return m(() => {
|
|
214
220
|
const s = t();
|
|
215
|
-
e.textContent =
|
|
221
|
+
e.textContent = G(s);
|
|
216
222
|
}), e;
|
|
217
223
|
}, P = (t) => ({
|
|
218
224
|
append(...e) {
|
|
219
225
|
return e.forEach((s) => {
|
|
220
|
-
t.appendChild(s.hostElement),
|
|
226
|
+
t.appendChild(s.hostElement), q in s.hostElement && setTimeout(() => {
|
|
221
227
|
var n, o;
|
|
222
228
|
(o = (n = s.hostElement).onConnected) == null || o.call(
|
|
223
229
|
n,
|
|
@@ -242,10 +248,10 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
242
248
|
}), this;
|
|
243
249
|
},
|
|
244
250
|
addHtmlContent(e) {
|
|
245
|
-
return
|
|
251
|
+
return X(t, e), this;
|
|
246
252
|
},
|
|
247
253
|
setHtmlContent(e) {
|
|
248
|
-
return
|
|
254
|
+
return ot(t, e), this;
|
|
249
255
|
},
|
|
250
256
|
addEventlistener(e, s, n = !1) {
|
|
251
257
|
return t.addEventListener(e, (o) => s(o, this, t), n), this;
|
|
@@ -293,7 +299,7 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
293
299
|
}), this;
|
|
294
300
|
},
|
|
295
301
|
onConnected(e) {
|
|
296
|
-
return Reflect.defineProperty(t,
|
|
302
|
+
return Reflect.defineProperty(t, q, {
|
|
297
303
|
get() {
|
|
298
304
|
return e;
|
|
299
305
|
}
|
|
@@ -342,9 +348,9 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
342
348
|
return t.innerHTML = "", this;
|
|
343
349
|
},
|
|
344
350
|
hostElement: t
|
|
345
|
-
}),
|
|
351
|
+
}), rt = (t, ...e) => ({
|
|
346
352
|
classList: [...t.map((s) => s.trim()).filter(Boolean), ...e]
|
|
347
|
-
}),
|
|
353
|
+
}), $t = (t, ...e) => rt(t, ...e), Z = (t, e) => {
|
|
348
354
|
if (!e) return t;
|
|
349
355
|
const s = Object.keys(e || {}).filter(
|
|
350
356
|
(n) => n.startsWith(".") || n.startsWith("@") || n.startsWith("$")
|
|
@@ -357,19 +363,19 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
357
363
|
e.listeners[o] = e[n];
|
|
358
364
|
}), s.filter((n) => n.startsWith("$")).forEach((n) => {
|
|
359
365
|
e != null && e.effects || (e.effects = []), e.effects.push(e[n]);
|
|
360
|
-
}),
|
|
361
|
-
},
|
|
366
|
+
}), at(t, e.classList), ht(t, e.style), ut(t, e.attributes), dt(t, e.reactiveClassList), ct(t, e.customAttributes), it(t, e.children), lt(t, e.effects), D(t, e.listeners), D(t, e.customListeners), t;
|
|
367
|
+
}, D = (t, e) => {
|
|
362
368
|
e && Object.entries(e).forEach(([s, n]) => {
|
|
363
369
|
typeof n == "function" && t.addEventlistener(s, n);
|
|
364
370
|
});
|
|
365
|
-
},
|
|
371
|
+
}, lt = (t, e) => e == null ? void 0 : e.forEach((s) => t.addEffect(s)), it = (t, e) => W(t, ...e || []), ct = (t, e) => {
|
|
366
372
|
const s = e;
|
|
367
373
|
s && Object.keys(s).forEach((n) => {
|
|
368
374
|
y(s[n]) ? t.setReactiveCustomAttribute(n, s[n]) : typeof s[n] == "function" ? t.addEffect(() => {
|
|
369
375
|
t.setCustomAttribute(n, s[n]());
|
|
370
376
|
}) : t.setCustomAttribute(n, s[n]);
|
|
371
377
|
});
|
|
372
|
-
},
|
|
378
|
+
}, at = (t, e) => t.addClass(...e || []), dt = (t, e) => t.addReactiveClass(e || {}), ht = (t, e) => t.addStyle(e || {}), ut = (t, e) => {
|
|
373
379
|
const s = e, n = (o, r) => {
|
|
374
380
|
r && (y(r) ? t.setReactiveAttribute(o, r) : typeof r == "function" ? t.addEffect(() => {
|
|
375
381
|
t.setAttribute(o, r());
|
|
@@ -384,27 +390,27 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
384
390
|
const s = document.createElement(t), n = {
|
|
385
391
|
...P(s)
|
|
386
392
|
};
|
|
387
|
-
return
|
|
393
|
+
return Z(n, e);
|
|
388
394
|
}, H = (t, e) => {
|
|
389
395
|
const [s, ...n] = t.split(" ").map((r) => r.trim()), o = w(s, e);
|
|
390
396
|
return n.length > 0 && o.addClass(...n), (...r) => W(
|
|
391
397
|
o,
|
|
392
398
|
...r.filter(Boolean).flat().flatMap(
|
|
393
|
-
(
|
|
399
|
+
(l) => typeof l == "function" && !y(l) ? v(() => l(o)) : l
|
|
394
400
|
)
|
|
395
401
|
);
|
|
396
402
|
}, v = (t) => w("div").addStyle({ display: "contents" }).addEffect((e) => {
|
|
397
403
|
const s = t(), n = [];
|
|
398
404
|
Array.isArray(s) ? n.push(...s) : n.push(s), e.clear(), W(e, ...n);
|
|
399
|
-
}),
|
|
400
|
-
const e = (n) => typeof n == "string" ? n.trim().length > 0 ? P(
|
|
401
|
-
return
|
|
405
|
+
}), kt = (t) => {
|
|
406
|
+
const e = (n) => typeof n == "string" ? n.trim().length > 0 ? P(U(n)) : H("div")() : y(n) ? P(z(n)) : n;
|
|
407
|
+
return ft(() => {
|
|
402
408
|
const n = t();
|
|
403
409
|
return n instanceof Array && Array.isArray(n) ? n.map(e) : e(n);
|
|
404
410
|
});
|
|
405
|
-
},
|
|
411
|
+
}, Mt = (t, e, s) => {
|
|
406
412
|
const n = w("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
407
|
-
let
|
|
413
|
+
let l = [];
|
|
408
414
|
const a = /* @__PURE__ */ new Set();
|
|
409
415
|
let c = t.peek();
|
|
410
416
|
const d = (f) => {
|
|
@@ -412,17 +418,17 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
412
418
|
};
|
|
413
419
|
return m(() => {
|
|
414
420
|
const f = t();
|
|
415
|
-
|
|
421
|
+
l = f.map(e).map((h) => typeof h == "string" ? h : h.toString());
|
|
416
422
|
const p = Array.from(n.hostElement.children);
|
|
417
|
-
u("containerChildren", p,
|
|
423
|
+
u("containerChildren", p, l), p.forEach((h) => {
|
|
418
424
|
const E = h.dataset.key;
|
|
419
|
-
|
|
420
|
-
}),
|
|
425
|
+
l.includes(E) || (u("remove element", E, h), h.remove(), d(E));
|
|
426
|
+
}), l.forEach((h) => {
|
|
421
427
|
var j, S;
|
|
422
|
-
const E = f[
|
|
423
|
-
o.has(h) ? JSON.stringify(E) !== JSON.stringify(c[
|
|
428
|
+
const E = f[l.indexOf(h)];
|
|
429
|
+
o.has(h) ? JSON.stringify(E) !== JSON.stringify(c[l.indexOf(h)]) && ((j = n.hostElement.querySelector(`[data-key="${h}"]`)) == null || j.remove(), (S = o.get(h)) == null || S.set(Math.random().toString(36).substring(2, 15)), r.set(
|
|
424
430
|
h,
|
|
425
|
-
() => s(E,
|
|
431
|
+
() => s(E, l.indexOf(h), f).setCustomAttribute(
|
|
426
432
|
"data-key",
|
|
427
433
|
h
|
|
428
434
|
)
|
|
@@ -431,7 +437,7 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
431
437
|
A(Math.random().toString(36).substring(2, 15))
|
|
432
438
|
), r.set(
|
|
433
439
|
h,
|
|
434
|
-
() => s(E,
|
|
440
|
+
() => s(E, l.indexOf(h), f).setCustomAttribute(
|
|
435
441
|
"data-key",
|
|
436
442
|
h
|
|
437
443
|
)
|
|
@@ -440,9 +446,9 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
440
446
|
const b = () => {
|
|
441
447
|
o.forEach((h, E) => {
|
|
442
448
|
u("key from setTimeout foreach currItemSignalMap", E), a.has(E) || (a.add(E), m(() => {
|
|
443
|
-
var
|
|
449
|
+
var J;
|
|
444
450
|
h();
|
|
445
|
-
const j =
|
|
451
|
+
const j = l.indexOf(E), S = (J = r.get(E)) == null ? void 0 : J();
|
|
446
452
|
S && (u(
|
|
447
453
|
"call effect from setTimeout",
|
|
448
454
|
E,
|
|
@@ -456,10 +462,10 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
456
462
|
};
|
|
457
463
|
Promise.resolve().then(() => b());
|
|
458
464
|
}), n;
|
|
459
|
-
},
|
|
465
|
+
}, ft = (t) => {
|
|
460
466
|
let e = [w("div")], s = !1;
|
|
461
467
|
return m(() => {
|
|
462
|
-
var r,
|
|
468
|
+
var r, l;
|
|
463
469
|
const n = t();
|
|
464
470
|
s = Array.isArray(n);
|
|
465
471
|
const o = [];
|
|
@@ -470,7 +476,7 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
470
476
|
u("newReactiveComponent.map", o.map((a) => {
|
|
471
477
|
var c;
|
|
472
478
|
return u("newReactiveComponent hostElement", a.hostElement), (c = a.hostElement) == null ? void 0 : c.id;
|
|
473
|
-
})), u("currComponent[0].hostElement?.id", (r = e[0].hostElement) == null ? void 0 : r.id, e), (
|
|
479
|
+
})), u("currComponent[0].hostElement?.id", (r = e[0].hostElement) == null ? void 0 : r.id, e), (l = e[0].hostElement) == null || l.replaceWith(
|
|
474
480
|
...o.map((a) => a.hostElement)
|
|
475
481
|
), e.slice(1).forEach((a) => {
|
|
476
482
|
var c;
|
|
@@ -480,26 +486,26 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
480
486
|
console.error(a);
|
|
481
487
|
}
|
|
482
488
|
}), s ? e : e[0];
|
|
483
|
-
},
|
|
489
|
+
}, It = (t) => nt in t, Pt = (t) => {
|
|
484
490
|
const e = H("div")().addStyle({ display: "contents" }), s = (n) => (e.hostElement.innerHTML = n, e);
|
|
485
491
|
return typeof t == "string" ? s(t) : e.addEffect(() => {
|
|
486
492
|
s(t());
|
|
487
493
|
}), e;
|
|
488
|
-
},
|
|
494
|
+
}, Q = (t, e, s) => t ? v(e) : s ? v(s) : H("div")().setAttribute("id", "empty_div_renderIf").addStyle({ display: "none" }), pt = (t, e, s) => v(() => Q(!!t(), e, s)), Ft = (t, e, s) => typeof t == "boolean" ? Q(t, e, s) : pt(t, e, s), N = (t, e) => {
|
|
489
495
|
const s = v(e);
|
|
490
496
|
return typeof t == "boolean" ? [s].flat().forEach((n) => n.hostElement.style.display = t ? "block" : "none") : m(() => {
|
|
491
497
|
const n = t() ? "block" : "none";
|
|
492
498
|
[s].flat().forEach((o) => o.hostElement.style.display = n);
|
|
493
499
|
}), s;
|
|
494
|
-
},
|
|
495
|
-
const n = [
|
|
500
|
+
}, Wt = (t, e, s) => {
|
|
501
|
+
const n = [N(t, e)].flat();
|
|
496
502
|
return s && n.push(
|
|
497
|
-
...[
|
|
503
|
+
...[N(
|
|
498
504
|
() => typeof t == "boolean" ? !t : !t(),
|
|
499
505
|
s
|
|
500
506
|
)].flat()
|
|
501
507
|
), v(() => n);
|
|
502
|
-
},
|
|
508
|
+
}, mt = (t, e) => {
|
|
503
509
|
u("createCustomElement", t);
|
|
504
510
|
const s = document.createElement(t), n = {
|
|
505
511
|
...P(s),
|
|
@@ -508,41 +514,41 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
508
514
|
},
|
|
509
515
|
setSlotTemplate(o) {
|
|
510
516
|
const r = s.slotTemplate;
|
|
511
|
-
return r && Object.entries(o).forEach(([
|
|
512
|
-
r[
|
|
517
|
+
return r && Object.entries(o).forEach(([l, a]) => {
|
|
518
|
+
r[l] = a;
|
|
513
519
|
}), this;
|
|
514
520
|
}
|
|
515
521
|
};
|
|
516
|
-
return
|
|
517
|
-
},
|
|
518
|
-
const s = t.split(" ").slice(1).map((o) => o.trim()), n =
|
|
522
|
+
return Z(n, e);
|
|
523
|
+
}, Ct = (t, e) => {
|
|
524
|
+
const s = t.split(" ").slice(1).map((o) => o.trim()), n = mt(t.split(" ")[0], e);
|
|
519
525
|
return Array.isArray(s) && s.length > 0 && n.addClass(...s), (...o) => {
|
|
520
|
-
|
|
526
|
+
g("@rcreateCustomEl content", t, o);
|
|
521
527
|
const r = o.filter(Boolean).flat().flatMap(
|
|
522
|
-
(
|
|
528
|
+
(l) => typeof l == "function" && !y(l) ? v(() => l(n)) : l
|
|
523
529
|
);
|
|
524
|
-
return n.hostElement.allSlotContent = r, n.hostElement.slotContent = r.filter(
|
|
525
|
-
(
|
|
530
|
+
return n.hostElement.allSlotContent = r, n.hostElement.slotContent = r.filter(tt).reduce(
|
|
531
|
+
(l, a) => {
|
|
526
532
|
const c = a.hostElement.getAttribute("slot") || "default";
|
|
527
|
-
return
|
|
533
|
+
return l[c] || (l[c] = []), l[c].push(a), l;
|
|
528
534
|
},
|
|
529
535
|
{}
|
|
530
536
|
), n.hostElement.appendAllSlotContent = () => W(n, ...r), n;
|
|
531
537
|
};
|
|
532
|
-
},
|
|
538
|
+
}, bt = (t, e, s) => Ct(
|
|
533
539
|
`${t.renderTagName}${e && typeof e == "string" ? " " + e : ""}`,
|
|
534
540
|
x(e) ? e : e && typeof e == "string" ? s : void 0
|
|
535
|
-
),
|
|
541
|
+
), Ht = () => {
|
|
536
542
|
const t = () => {
|
|
537
543
|
};
|
|
538
544
|
return t.oldValue = null, t;
|
|
539
|
-
},
|
|
540
|
-
const n = e ?
|
|
545
|
+
}, _t = () => ({}), zt = (t, e, s) => {
|
|
546
|
+
const n = e ? St(e, s)(t) : t;
|
|
541
547
|
return (o, ...r) => {
|
|
542
|
-
const
|
|
543
|
-
return o && !x(o) &&
|
|
548
|
+
const l = [...r];
|
|
549
|
+
return o && !x(o) && l.unshift(o), bt(n, x(o) ? o : {})(...l);
|
|
544
550
|
};
|
|
545
|
-
},
|
|
551
|
+
}, i = {}, Et = [
|
|
546
552
|
"div",
|
|
547
553
|
"span",
|
|
548
554
|
"section",
|
|
@@ -604,19 +610,19 @@ const Tt = (t) => "render" in t && "setReactiveValue" in t, et = "handleSlotCont
|
|
|
604
610
|
"canvas",
|
|
605
611
|
"slot"
|
|
606
612
|
];
|
|
607
|
-
|
|
608
|
-
|
|
613
|
+
Et.forEach((t) => {
|
|
614
|
+
i[t] = (e, ...s) => {
|
|
609
615
|
let n = [...s];
|
|
610
616
|
return e && !x(e) && (n = [e].concat(n)), H(t, x(e) ? e : {})(...n);
|
|
611
617
|
};
|
|
612
618
|
});
|
|
613
|
-
const
|
|
619
|
+
const yt = i.div, Bt = i.span, Jt = i.section, qt = i.input, Dt = i.button, Nt = i.table, Vt = i.tr, Gt = i.td, Ut = i.th, Xt = i.ul, Zt = i.li, Qt = i.ol, Yt = i.form, Kt = i.label, te = i.select, ee = i.option, se = i.textarea, ne = i.img, oe = i.a, re = i.p, le = i.h1, ie = i.h2, ce = i.h3, ae = i.h4, de = i.h5, he = i.h6, ue = i.br, fe = i.hr, pe = i.pre, me = i.code, Ce = i.nav, be = i.header, Ee = i.footer, ye = i.main, Se = i.aside, ve = i.article, Ae = i.figure, ge = i.figcaption, Le = i.blockquote, Re = i.cite, Oe = i.small, je = i.strong, Te = i.em, xe = i.b, we = i.i, $e = i.u, ke = i.s, Me = i.sub, Ie = i.sup, Pe = i.mark, Fe = i.del, We = i.ins, He = i.details, _e = i.summary, ze = i.progress, Be = i.meter, Je = i.audio, qe = i.video, De = i.canvas, Ne = i.slot, Ve = (t) => (e) => t(e).addClass(...e.classList ?? []).addReactiveClass(e.reactiveClassList ?? {}), k = "eventProps", M = "EVENT_CONFIG", T = "observedAttributes", Ge = () => (t, e) => {
|
|
614
620
|
Reflect.get(t, T) || Reflect.defineProperty(t, T, {
|
|
615
621
|
value: []
|
|
616
622
|
}), Reflect.get(t, T).push(
|
|
617
623
|
$(e)
|
|
618
624
|
);
|
|
619
|
-
},
|
|
625
|
+
}, Ue = (t) => (e, s) => {
|
|
620
626
|
Reflect.get(e, k) || Reflect.defineProperty(e, k, {
|
|
621
627
|
value: []
|
|
622
628
|
}), Reflect.get(e, M) || Reflect.defineProperty(e, M, {
|
|
@@ -625,7 +631,7 @@ const bt = l.div, zt = l.span, Bt = l.section, Jt = l.input, qt = l.button, Dt =
|
|
|
625
631
|
bubbles: (t == null ? void 0 : t.bubbles) ?? !1,
|
|
626
632
|
composed: (t == null ? void 0 : t.composed) ?? !1
|
|
627
633
|
}, Reflect.get(e, k).push(s);
|
|
628
|
-
},
|
|
634
|
+
}, St = (t, e = !1) => (s) => {
|
|
629
635
|
u(
|
|
630
636
|
t,
|
|
631
637
|
"start register static attr",
|
|
@@ -633,8 +639,8 @@ const bt = l.div, zt = l.span, Bt = l.section, Jt = l.input, qt = l.button, Dt =
|
|
|
633
639
|
);
|
|
634
640
|
const n = [];
|
|
635
641
|
if (s.styles) {
|
|
636
|
-
const r = s.styles,
|
|
637
|
-
Array.isArray(r) ?
|
|
642
|
+
const r = s.styles, l = [];
|
|
643
|
+
Array.isArray(r) ? l.push(...r) : l.push(r), l.forEach((a) => {
|
|
638
644
|
const c = new CSSStyleSheet();
|
|
639
645
|
c.replaceSync(a), n.push(c);
|
|
640
646
|
const d = new CSSStyleSheet();
|
|
@@ -642,21 +648,21 @@ const bt = l.div, zt = l.span, Bt = l.section, Jt = l.input, qt = l.button, Dt =
|
|
|
642
648
|
});
|
|
643
649
|
}
|
|
644
650
|
class o extends s {
|
|
645
|
-
constructor(...
|
|
646
|
-
u("constructor", `%c${t}%c`), super(e, ...
|
|
651
|
+
constructor(...l) {
|
|
652
|
+
u("constructor", `%c${t}%c`), super(e, ...l), g("@osheet", n), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
|
|
647
653
|
}
|
|
648
654
|
render() {
|
|
649
655
|
u("rwc: render from new class");
|
|
650
|
-
let
|
|
656
|
+
let l = yt();
|
|
651
657
|
const a = () => {
|
|
652
|
-
u("wrapperEffectCallback"),
|
|
658
|
+
u("wrapperEffectCallback"), l = s.prototype.render.call(this);
|
|
653
659
|
};
|
|
654
|
-
return a.fake = !0, m(a),
|
|
660
|
+
return a.fake = !0, m(a), l;
|
|
655
661
|
}
|
|
656
|
-
attributeChangedCallback(
|
|
662
|
+
attributeChangedCallback(l, a, c) {
|
|
657
663
|
u(
|
|
658
664
|
"%cAttribute has changed.%c",
|
|
659
|
-
`%c${
|
|
665
|
+
`%c${l}%c`,
|
|
660
666
|
`oldValue: ${a}, newValue: ${c}`,
|
|
661
667
|
`%c${t}%c`
|
|
662
668
|
);
|
|
@@ -664,15 +670,15 @@ const bt = l.div, zt = l.span, Bt = l.section, Jt = l.input, qt = l.button, Dt =
|
|
|
664
670
|
c = JSON.parse(c);
|
|
665
671
|
} catch {
|
|
666
672
|
}
|
|
667
|
-
const d =
|
|
673
|
+
const d = et(l);
|
|
668
674
|
if (d in this && y(this[d])) {
|
|
669
675
|
const f = this[d];
|
|
670
|
-
c === null ? (f.set(f.initValue), this.removeAttribute(
|
|
676
|
+
c === null ? (f.set(f.initValue), this.removeAttribute(l)) : f.set(c);
|
|
671
677
|
}
|
|
672
678
|
_(
|
|
673
679
|
this,
|
|
674
680
|
s.prototype.attributeChangedCallback,
|
|
675
|
-
|
|
681
|
+
l,
|
|
676
682
|
a,
|
|
677
683
|
c
|
|
678
684
|
);
|
|
@@ -693,14 +699,14 @@ const bt = l.div, zt = l.span, Bt = l.section, Jt = l.input, qt = l.button, Dt =
|
|
|
693
699
|
this[c] = (d) => {
|
|
694
700
|
const f = s.prototype[M][c], { bubbles: p, composed: b } = f;
|
|
695
701
|
y(d) ? m(() => {
|
|
696
|
-
|
|
702
|
+
g("@oemit reactive value", d()), this.dispatchEvent(
|
|
697
703
|
new CustomEvent(c, {
|
|
698
704
|
detail: d(),
|
|
699
705
|
bubbles: p,
|
|
700
706
|
composed: b
|
|
701
707
|
})
|
|
702
708
|
);
|
|
703
|
-
}) : (
|
|
709
|
+
}) : (g("@oemit value", d), this.dispatchEvent(
|
|
704
710
|
new CustomEvent(c, {
|
|
705
711
|
detail: d,
|
|
706
712
|
bubbles: p,
|
|
@@ -710,7 +716,7 @@ const bt = l.div, zt = l.span, Bt = l.section, Jt = l.input, qt = l.button, Dt =
|
|
|
710
716
|
};
|
|
711
717
|
}
|
|
712
718
|
), u("start render", `%c${t}%c`, t);
|
|
713
|
-
const
|
|
719
|
+
const l = () => {
|
|
714
720
|
u("rwc: insertRenderTemplate");
|
|
715
721
|
const c = this.render();
|
|
716
722
|
this.shadow.appendChild(c.hostElement), _(this, s.prototype.connectedCallback), this.appendSlotContent();
|
|
@@ -724,25 +730,25 @@ const bt = l.div, zt = l.span, Bt = l.section, Jt = l.input, qt = l.button, Dt =
|
|
|
724
730
|
};
|
|
725
731
|
if (c(d)) {
|
|
726
732
|
const p = [];
|
|
727
|
-
Array.isArray(d) ? p.push(...d) : p.push(d), Promise.all(p).then((b) => b.forEach((h) => f(h.default))).then(() =>
|
|
733
|
+
Array.isArray(d) ? p.push(...d) : p.push(d), Promise.all(p).then((b) => b.forEach((h) => f(h.default))).then(() => l());
|
|
728
734
|
} else {
|
|
729
735
|
const p = [];
|
|
730
|
-
Array.isArray(d) ? p.push(...d) : p.push(d), p.forEach((b) => f(b)),
|
|
736
|
+
Array.isArray(d) ? p.push(...d) : p.push(d), p.forEach((b) => f(b)), l();
|
|
731
737
|
}
|
|
732
738
|
} else
|
|
733
|
-
|
|
739
|
+
l();
|
|
734
740
|
this.slotContext && Object.keys(this.slotContext).length > 0 && this.shadow.querySelectorAll("slot").forEach((c) => {
|
|
735
741
|
u(
|
|
736
742
|
this.slotContext,
|
|
737
743
|
this.slotContext && this.slotContext[c.name]
|
|
738
|
-
),
|
|
744
|
+
), g(
|
|
739
745
|
"@bslot element",
|
|
740
746
|
c,
|
|
741
747
|
`name:${c.name};`,
|
|
742
748
|
c.assignedElements()
|
|
743
749
|
), c.assignedElements().forEach((d) => {
|
|
744
750
|
const f = this.slotContext[c.name];
|
|
745
|
-
this.slotContext && y(f) && (
|
|
751
|
+
this.slotContext && y(f) && (g(
|
|
746
752
|
"@oslot element",
|
|
747
753
|
c,
|
|
748
754
|
`name:${c.name};`,
|
|
@@ -767,126 +773,126 @@ const bt = l.div, zt = l.span, Bt = l.section, Jt = l.input, qt = l.button, Dt =
|
|
|
767
773
|
};
|
|
768
774
|
export {
|
|
769
775
|
O as BaseElement,
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
776
|
+
oe as a,
|
|
777
|
+
ut as addAttributeList,
|
|
778
|
+
at as addClassList,
|
|
779
|
+
ct as addCustomAttributes,
|
|
780
|
+
X as addHtmlContent,
|
|
781
|
+
dt as addReactiveClassList,
|
|
782
|
+
ht as addStyleList,
|
|
777
783
|
W as appendContentItem,
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
784
|
+
ve as article,
|
|
785
|
+
Se as aside,
|
|
786
|
+
Je as audio,
|
|
787
|
+
xe as b,
|
|
788
|
+
Ot as bindReactiveSignals,
|
|
783
789
|
Le as blockquote,
|
|
784
|
-
|
|
785
|
-
|
|
790
|
+
ue as br,
|
|
791
|
+
Dt as button,
|
|
786
792
|
$ as camelToKebab,
|
|
787
|
-
|
|
793
|
+
De as canvas,
|
|
788
794
|
_ as checkCall,
|
|
789
795
|
Re as cite,
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
796
|
+
rt as classList,
|
|
797
|
+
$t as cls,
|
|
798
|
+
me as code,
|
|
799
|
+
g as colorLog,
|
|
800
|
+
Tt as combineLatest,
|
|
801
|
+
St as component,
|
|
802
|
+
Ve as createComponent,
|
|
803
|
+
bt as createCustom,
|
|
804
|
+
Ct as createCustomEl,
|
|
805
|
+
mt as createCustomElement,
|
|
800
806
|
H as createEl,
|
|
801
807
|
w as createElement,
|
|
802
808
|
Rt as createSignal,
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
809
|
+
_t as defineSlotTemplate,
|
|
810
|
+
Fe as del,
|
|
811
|
+
He as details,
|
|
812
|
+
st as disableLogs,
|
|
813
|
+
yt as div,
|
|
808
814
|
m as effect,
|
|
809
|
-
|
|
815
|
+
V as effectMap,
|
|
810
816
|
P as elementHelpers,
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
817
|
+
Te as em,
|
|
818
|
+
At as enableLogs,
|
|
819
|
+
Ue as event,
|
|
820
|
+
wt as eventEmitter,
|
|
821
|
+
ge as figcaption,
|
|
822
|
+
Ae as figure,
|
|
823
|
+
Ee as footer,
|
|
824
|
+
jt as forkJoin,
|
|
825
|
+
Yt as form,
|
|
826
|
+
Mt as getList,
|
|
827
|
+
kt as getReactiveTemplate,
|
|
822
828
|
v as getSignalContent,
|
|
823
|
-
|
|
824
|
-
|
|
829
|
+
G as getTextContent,
|
|
830
|
+
le as h1,
|
|
825
831
|
ie as h2,
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
+
ce as h3,
|
|
833
|
+
ae as h4,
|
|
834
|
+
de as h5,
|
|
835
|
+
he as h6,
|
|
836
|
+
be as header,
|
|
837
|
+
fe as hr,
|
|
832
838
|
z as htmlEffectWrapper,
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
839
|
+
we as i,
|
|
840
|
+
ne as img,
|
|
841
|
+
Z as initComponent,
|
|
842
|
+
qt as input,
|
|
843
|
+
We as ins,
|
|
844
|
+
xt as isBaseElement,
|
|
845
|
+
tt as isComponentConfig,
|
|
840
846
|
x as isComponentInitConfig,
|
|
841
|
-
vt as isEffectDebugEnabled,
|
|
842
847
|
y as isReactiveSignal,
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
848
|
+
It as isSlotTemplate,
|
|
849
|
+
et as kebabToCamel,
|
|
850
|
+
Kt as label,
|
|
851
|
+
Zt as li,
|
|
852
|
+
ye as main,
|
|
853
|
+
Pe as mark,
|
|
854
|
+
Be as meter,
|
|
855
|
+
Ce as nav,
|
|
856
|
+
Ht as newEventEmitter,
|
|
857
|
+
Qt as ol,
|
|
858
|
+
ee as option,
|
|
859
|
+
re as p,
|
|
860
|
+
pe as pre,
|
|
861
|
+
ze as progress,
|
|
857
862
|
u as projectLog,
|
|
858
|
-
|
|
859
|
-
|
|
863
|
+
Ge as property,
|
|
864
|
+
Q as renderIf,
|
|
860
865
|
Lt as rs,
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
866
|
+
pt as rxRenderIf,
|
|
867
|
+
ke as s,
|
|
868
|
+
Jt as section,
|
|
869
|
+
te as select,
|
|
870
|
+
it as setChildren,
|
|
871
|
+
gt as setEffectDebugEnabled,
|
|
872
|
+
lt as setEffects,
|
|
873
|
+
ot as setHtmlContent,
|
|
874
|
+
D as setListeners,
|
|
875
|
+
Wt as show,
|
|
876
|
+
N as showIf,
|
|
871
877
|
A as signal,
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
878
|
+
ft as signalComponent,
|
|
879
|
+
Ne as slot,
|
|
880
|
+
Oe as small,
|
|
881
|
+
Bt as span,
|
|
882
|
+
je as strong,
|
|
883
|
+
Me as sub,
|
|
884
|
+
_e as summary,
|
|
885
|
+
Ie as sup,
|
|
886
|
+
Nt as table,
|
|
887
|
+
Gt as td,
|
|
888
|
+
U as textContentWrapper,
|
|
889
|
+
se as textarea,
|
|
890
|
+
Ut as th,
|
|
891
|
+
Vt as tr,
|
|
892
|
+
$e as u,
|
|
893
|
+
Xt as ul,
|
|
894
|
+
Pt as unsafeHtml,
|
|
895
|
+
zt as useCustomComponent,
|
|
896
|
+
qe as video,
|
|
897
|
+
Ft as when
|
|
892
898
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(o,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(o=typeof globalThis<"u"?globalThis:o||self,p(o.ReactiveComponent={}))})(this,function(o){"use strict";var Ve=Object.defineProperty;var Ue=(o,p,L)=>p in o?Ve(o,p,{enumerable:!0,configurable:!0,writable:!0,value:L}):o[p]=L;var E=(o,p,L)=>Ue(o,typeof p!="symbol"?p+"":p,L);const p=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),L=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,...n)=>{e&&e.apply(t,n)};let _=!0;const f=(...t)=>{_&&console.debug(["[rwc]",...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()}`),K=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),R=(t,...e)=>{if(!_)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)},Et=()=>{_=!0},x=()=>{_=!1};x();let D=!1;const yt=t=>{D=t},G=new Map,O=new WeakMap,B=[],w=[];function g(t,e){const n=new Set;let s=(e==null?void 0:e.signalCompareFn)||(()=>!0);function i(){var c;const l=B[B.length-1];if(l&&!("fake"in l&&l.fake)){const d=O.get(l),r=d==null?void 0:d.parent;if(r){const h=O.get(r);h==null||h.cleanupFns.add(()=>{n.delete(l)})}n.add(l),D&&((c=G.get(l.effectId))==null||c.signals.push(i))}return t}return i.signalId=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`,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 r=O.get(d);r&&r.cleanupFns.size>0&&(r.cleanupFns.forEach(h=>h()),r.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,c)=>{const d=g(null);return b(()=>{const r=i();b(()=>{const h=l(r);h instanceof Promise?h.then(m=>d.set(m)):v(h)?b(()=>d.set(h())):d.set(h)},c)}),d},i}function b(t,e){const n=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`;f("current effect",`%c${n}%c`);const s=t;t=()=>(f("current effect callback",`%c${n}%c`),s()),"fake"in s&&s.fake&&(t.fake=!0),t.effectId=n;const i=w[w.length-1];D&&G.set(n,{signals:[],parent:(i==null?void 0:i.effectId)||null}),O.has(t)||O.set(t,{cleanupFns:new Set});const l=O.get(t);i?l.parent=i:delete l.parent,w.push(t),B.push(t),t(),B.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 St(t,...e){const n=g("");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 vt(t,e){const n=g(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 gt(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 At(...t){let e=t.map(s=>s());const n=g(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}const Lt=(...t)=>{const e=g([]);return b(()=>{e.set(t.map(n=>n()))}),e};class T extends HTMLElement{constructor(n=!1){super();E(this,"isSlotLazyLoading",!1);E(this,"slotTemplate");E(this,"slotContext");E(this,"rootStyle");E(this,"modelValue");E(this,"providers");E(this,"appendAllSlotContent");E(this,"allSlotContent",[]);E(this,"slotContent",{});E(this,"htmlSlotContent",{});E(this,"shadow");E(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 f("%cinject%c",n),this.injects[n]||(this.injects[n]=g(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{f("%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}}E(T,"observedAttributes",[]),E(T,"renderTagName",""),E(T,"styles");const Rt=t=>"render"in t&&"setReactiveValue"in t,Tt="handleSlotContext",tt="onConnected",jt=()=>()=>{},N=t=>typeof t=="string"?t:JSON.stringify(t),V=t=>{const e=document.createElement("span");return e.textContent=N(t),e},U=(t,e)=>(t.appendChild(V(e)),t),et=(t,e)=>(t.innerHTML="",U(t,e)),J=t=>{const e=document.createElement("span");return b(()=>{const n=t();e.textContent=N(n)}),e},M=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),tt 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 U(t,e),this},setHtmlContent(e){return et(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 T))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 T)){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,tt,{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(J(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(J(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),nt=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),Ot=(t,...e)=>nt(t,...e),X=(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])}),lt(t,e.classList),at(t,e.style),rt(t,e.attributes),ct(t,e.reactiveClassList),it(t,e.customAttributes),ot(t,e.children),st(t,e.effects),Z(t,e.listeners),Z(t,e.customListeners),t},Z=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},st=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),ot=(t,e)=>$(t,...e||[]),it=(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])})},lt=(t,e)=>t.addClass(...e||[]),ct=(t,e)=>t.addReactiveClass(e||{}),at=(t,e)=>t.addStyle(e||{}),rt=(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),k=(t,e)=>{const n=document.createElement(t),s={...M(n)};return X(s,e)},P=(t,e)=>{const[n,...s]=t.split(" ").map(l=>l.trim()),i=k(n,e);return s.length>0&&i.addClass(...s),(...l)=>$(i,...l.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?A(()=>c(i)):c))},A=t=>k("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),$(e,...s)}),wt=t=>{const e=s=>typeof s=="string"?s.trim().length>0?M(V(s)):P("div")():v(s)?M(J(s)):s;return dt(()=>{const s=t();return s instanceof Array&&Array.isArray(s)?s.map(e):e(s)})},kt=(t,e,n)=>{const s=k("div").addStyle({display:"contents"}),i=new Map,l=new Map;let c=[];const d=new Set;let r=t.peek();const h=m=>{d.delete(m),i.delete(m),l.delete(m)};return b(()=>{const m=t();c=m.map(e).map(u=>typeof u=="string"?u:u.toString());const C=Array.from(s.hostElement.children);f("containerChildren",C,c),C.forEach(u=>{const S=u.dataset.key;c.includes(S)||(f("remove element",S,u),u.remove(),h(S))}),c.forEach(u=>{var H,j;const S=m[c.indexOf(u)];i.has(u)?JSON.stringify(S)!==JSON.stringify(r[c.indexOf(u)])&&((H=s.hostElement.querySelector(`[data-key="${u}"]`))==null||H.remove(),(j=i.get(u))==null||j.set(Math.random().toString(36).substring(2,15)),l.set(u,()=>n(S,c.indexOf(u),m).setCustomAttribute("data-key",u))):(f("create new element",u,S),i.set(u,g(Math.random().toString(36).substring(2,15))),l.set(u,()=>n(S,c.indexOf(u),m).setCustomAttribute("data-key",u)))}),r=[...m.map(u=>({...u}))];const y=()=>{i.forEach((u,S)=>{f("key from setTimeout foreach currItemSignalMap",S),d.has(S)||(d.add(S),b(()=>{var pt;u();const H=c.indexOf(S),j=(pt=l.get(S))==null?void 0:pt();j&&(f("call effect from setTimeout",S,j.hostElement),H<=s.hostElement.children.length-1?s.hostElement.insertBefore(j.hostElement,s.hostElement.children[H]):s.hostElement.append(j.hostElement))}))})};Promise.resolve().then(()=>y())}),s},dt=t=>{let e=[k("div")],n=!1;return b(()=>{var l,c;const s=t();n=Array.isArray(s);const i=[];i.push(...[s].flat()),i.length===0&&i.push(k("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{f("newReactiveComponent.map",i.map(d=>{var r;return f("newReactiveComponent hostElement",d.hostElement),(r=d.hostElement)==null?void 0:r.id})),f("currComponent[0].hostElement?.id",(l=e[0].hostElement)==null?void 0:l.id,e),(c=e[0].hostElement)==null||c.replaceWith(...i.map(d=>d.hostElement)),e.slice(1).forEach(d=>{var r;return(r=d.hostElement)==null?void 0:r.remove()}),e=i}catch(d){console.error(d)}}),n?e:e[0]},It=t=>Tt in t,Mt=t=>{const e=P("div")().addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},Q=(t,e,n)=>t?A(e):n?A(n):P("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),ht=(t,e,n)=>A(()=>Q(!!t(),e,n)),$t=(t,e,n)=>typeof t=="boolean"?Q(t,e,n):ht(t,e,n),Y=(t,e)=>{const n=A(e);return typeof t=="boolean"?[n].flat().forEach(s=>s.hostElement.style.display=t?"block":"none"):b(()=>{const s=t()?"block":"none";[n].flat().forEach(i=>i.hostElement.style.display=s)}),n},Pt=(t,e,n)=>{const s=[Y(t,e)].flat();return n&&s.push(...[Y(()=>typeof t=="boolean"?!t:!t(),n)].flat()),A(()=>s)},ut=(t,e)=>{f("createCustomElement",t);const n=document.createElement(t),s={...M(n),setReactiveValue(i){return n instanceof T&&n.setReactiveValue(i),this},setSlotTemplate(i){const l=n.slotTemplate;return l&&Object.entries(i).forEach(([c,d])=>{l[c]=d}),this}};return X(s,e)},ft=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=ut(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{R("@rcreateCustomEl content",t,i);const l=i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?A(()=>c(s)):c);return s.hostElement.allSlotContent=l,s.hostElement.slotContent=l.filter(L).reduce((c,d)=>{const r=d.hostElement.getAttribute("slot")||"default";return c[r]||(c[r]=[]),c[r].push(d),c},{}),s.hostElement.appendAllSlotContent=()=>$(s,...l),s}},mt=(t,e,n)=>ft(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,p(e)?e:e&&typeof e=="string"?n:void 0),Ft=()=>{const t=()=>{};return t.oldValue=null,t},Ht=()=>({}),Wt=(t,e,n)=>{const s=e?bt(e,n)(t):t;return(i,...l)=>{const c=[...l];return i&&!p(i)&&c.unshift(i),mt(s,p(i)?i:{})(...c)}},a={};["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=>{a[t]=(e,...n)=>{let s=[...n];return e&&!p(e)&&(s=[e].concat(s)),P(t,p(e)?e:{})(...s)}});const Ct=a.div,_t=a.span,Bt=a.section,Jt=a.input,zt=a.button,qt=a.table,Dt=a.tr,Gt=a.td,Nt=a.th,Vt=a.ul,Ut=a.li,Xt=a.ol,Zt=a.form,Qt=a.label,Yt=a.select,Kt=a.option,xt=a.textarea,te=a.img,ee=a.a,ne=a.p,se=a.h1,oe=a.h2,ie=a.h3,le=a.h4,ce=a.h5,ae=a.h6,re=a.br,de=a.hr,he=a.pre,ue=a.code,fe=a.nav,me=a.header,Ce=a.footer,be=a.main,pe=a.aside,Ee=a.article,ye=a.figure,Se=a.figcaption,ve=a.blockquote,ge=a.cite,Ae=a.small,Le=a.strong,Re=a.em,Te=a.b,je=a.i,Oe=a.u,we=a.s,ke=a.sub,Ie=a.sup,Me=a.mark,$e=a.del,Pe=a.ins,Fe=a.details,He=a.summary,We=a.progress,_e=a.meter,Be=a.audio,Je=a.video,ze=a.canvas,qe=a.slot,De=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),z="eventProps",q="EVENT_CONFIG",F="observedAttributes",Ge=()=>(t,e)=>{Reflect.get(t,F)||Reflect.defineProperty(t,F,{value:[]}),Reflect.get(t,F).push(I(e))},Ne=t=>(e,n)=>{Reflect.get(e,z)||Reflect.defineProperty(e,z,{value:[]}),Reflect.get(e,q)||Reflect.defineProperty(e,q,{value:{}}),Reflect.get(e,q)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,z).push(n)},bt=(t,e=!1)=>n=>{f(t,"start register static attr",n.prototype[F]);const s=[];if(n.styles){const l=n.styles,c=[];Array.isArray(l)?c.push(...l):c.push(l),c.forEach(d=>{const r=new CSSStyleSheet;r.replaceSync(d),s.push(r);const h=new CSSStyleSheet;h.replaceSync(d.slice(d.indexOf("@property"))),document.adoptedStyleSheets.push(h)})}class i extends n{constructor(...c){f("constructor",`%c${t}%c`),super(e,...c),R("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){f("rwc: render from new class");let c=Ct();const d=()=>{f("wrapperEffectCallback"),c=n.prototype.render.call(this)};return d.fake=!0,b(d),c}attributeChangedCallback(c,d,r){f("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${d}, newValue: ${r}`,`%c${t}%c`);try{r=JSON.parse(r)}catch{}const h=K(c);if(h in this&&v(this[h])){const m=this[h];r===null?(m.set(m.initValue),this.removeAttribute(c)):m.set(r)}W(this,n.prototype.attributeChangedCallback,c,d,r)}connectedCallback(){var d;f("rwc: connectedCallback"),f("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(f("WRAPPER for providers",t),Object.entries(this.providers).forEach(([r,h])=>{f("register provider",r,h()),this.addEventListener(r,m=>{var y;f("send provider",r,h());const C=m;((y=C.detail)==null?void 0:y.context)===r&&(C.stopPropagation(),C.detail.callback(h))})})),this.checkInjects(),(d=n.prototype[z])==null||d.forEach(r=>{this[r]=h=>{const m=n.prototype[q][r],{bubbles:C,composed:y}=m;v(h)?b(()=>{R("@oemit reactive value",h()),this.dispatchEvent(new CustomEvent(r,{detail:h(),bubbles:C,composed:y}))}):(R("@oemit value",h),this.dispatchEvent(new CustomEvent(r,{detail:h,bubbles:C,composed:y})))}}),f("start render",`%c${t}%c`,t);const c=()=>{f("rwc: insertRenderTemplate");const r=this.render();this.shadow.appendChild(r.hostElement),W(this,n.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!n.styles){const r=C=>C instanceof Promise||Array.isArray(C)&&C.every(y=>y instanceof Promise),h=this.rootStyle,m=C=>{const y=new CSSStyleSheet;y.replaceSync(C),this.shadow.adoptedStyleSheets.push(y);const u=new CSSStyleSheet;u.replaceSync(C.slice(C.indexOf("@property"))),document.adoptedStyleSheets.push(u)};if(r(h)){const C=[];Array.isArray(h)?C.push(...h):C.push(h),Promise.all(C).then(y=>y.forEach(u=>m(u.default))).then(()=>c())}else{const C=[];Array.isArray(h)?C.push(...h):C.push(h),C.forEach(y=>m(y)),c()}}else c();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(r=>{f(this.slotContext,this.slotContext&&this.slotContext[r.name]),R("@bslot element",r,`name:${r.name};`,r.assignedElements()),r.assignedElements().forEach(h=>{const m=this.slotContext[r.name];this.slotContext&&v(m)&&(R("@oslot element",r,`name:${r.name};`,r.assignedElements()),b(()=>{h.dispatchEvent(new CustomEvent("handleSlotContext",{detail:m()}))}))})})}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),W(this,n.prototype.disconnectedCallback)}}return E(i,"observedAttributes",n.prototype[F]??[]),E(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),n.renderTagName=t,n};o.BaseElement=T,o.a=ee,o.addAttributeList=rt,o.addClassList=lt,o.addCustomAttributes=it,o.addHtmlContent=U,o.addReactiveClassList=ct,o.addStyleList=at,o.appendContentItem=$,o.article=Ee,o.aside=pe,o.audio=Be,o.b=Te,o.bindReactiveSignals=gt,o.blockquote=ve,o.br=re,o.button=zt,o.camelToKebab=I,o.canvas=ze,o.checkCall=W,o.cite=ge,o.classList=nt,o.cls=Ot,o.code=ue,o.colorLog=R,o.combineLatest=Lt,o.component=bt,o.createComponent=De,o.createCustom=mt,o.createCustomEl=ft,o.createCustomElement=ut,o.createEl=P,o.createElement=k,o.createSignal=vt,o.defineSlotTemplate=Ht,o.del=$e,o.details=Fe,o.disableLogs=x,o.div=Ct,o.effect=b,o.effectMap=G,o.elementHelpers=M,o.em=Re,o.enableLogs=Et,o.event=Ne,o.eventEmitter=jt,o.figcaption=Se,o.figure=ye,o.footer=Ce,o.forkJoin=At,o.form=Zt,o.getList=kt,o.getReactiveTemplate=wt,o.getSignalContent=A,o.getTextContent=N,o.h1=se,o.h2=oe,o.h3=ie,o.h4=le,o.h5=ce,o.h6=ae,o.header=me,o.hr=de,o.htmlEffectWrapper=J,o.i=je,o.img=te,o.initComponent=X,o.input=Jt,o.ins=Pe,o.isBaseElement=Rt,o.isComponentConfig=L,o.isComponentInitConfig=p,o.isReactiveSignal=v,o.isSlotTemplate=It,o.kebabToCamel=K,o.label=Qt,o.li=Ut,o.main=be,o.mark=Me,o.meter=_e,o.nav=fe,o.newEventEmitter=Ft,o.ol=Xt,o.option=Kt,o.p=ne,o.pre=he,o.progress=We,o.projectLog=f,o.property=Ge,o.renderIf=Q,o.rs=St,o.rxRenderIf=ht,o.s=we,o.section=Bt,o.select=Yt,o.setChildren=ot,o.setEffectDebugEnabled=yt,o.setEffects=st,o.setHtmlContent=et,o.setListeners=Z,o.show=Pt,o.showIf=Y,o.signal=g,o.signalComponent=dt,o.slot=qe,o.small=Ae,o.span=_t,o.strong=Le,o.sub=ke,o.summary=He,o.sup=Ie,o.table=qt,o.td=Gt,o.textContentWrapper=V,o.textarea=xt,o.th=Nt,o.tr=Dt,o.u=Oe,o.ul=Vt,o.unsafeHtml=Mt,o.useCustomComponent=Wt,o.video=Je,o.when=$t,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IsPromise, IsPromiseFunction, UnwrapPromise } from './helpers.types';
|
|
2
2
|
import { CompareFn, ReactiveSignal, UnwrapSignal } from './signal.type';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const setEffectDebugEnabled: (enabled: boolean) => void;
|
|
4
4
|
export declare const effectMap: Map<string, {
|
|
5
5
|
signals: Array<ReactiveSignal<any>>;
|
|
6
6
|
parent: string | null;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(o,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(o=typeof globalThis<"u"?globalThis:o||self,p(o.ReactiveComponent={}))})(this,function(o){"use strict";var Ne=Object.defineProperty;var Ve=(o,p,L)=>p in o?Ne(o,p,{enumerable:!0,configurable:!0,writable:!0,value:L}):o[p]=L;var E=(o,p,L)=>Ve(o,typeof p!="symbol"?p+"":p,L);const p=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),L=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,...n)=>{e&&e.apply(t,n)};let _=!0;const f=(...t)=>{_&&console.debug(["[rwc]",...t].join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,n)=>n%2===0?"color:red":"color:inherit"))},M=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),Q=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),R=(t,...e)=>{if(!_)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)},bt=()=>{_=!0},Y=()=>{_=!1};Y();let pt=!1;const Et=new Map,O=new WeakMap,B=[],w=[];function A(t,e){const n=new Set;let s=(e==null?void 0:e.signalCompareFn)||(()=>!0);function i(){const l=B[B.length-1];if(l&&!("fake"in l&&l.fake)){const c=O.get(l),d=c==null?void 0:c.parent;if(d){const r=O.get(d);r==null||r.cleanupFns.add(()=>{n.delete(l)})}n.add(l)}return t}return i.signalId=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`,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 r=O.get(d);r&&r.cleanupFns.size>0&&(r.cleanupFns.forEach(h=>h()),r.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,c)=>{const d=A(null);return b(()=>{const r=i();b(()=>{const h=l(r);h instanceof Promise?h.then(m=>d.set(m)):v(h)?b(()=>d.set(h())):d.set(h)},c)}),d},i}function b(t,e){const n=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`;f("current effect",`%c${n}%c`);const s=t;t=()=>(f("current effect callback",`%c${n}%c`),s()),"fake"in s&&s.fake&&(t.fake=!0),t.effectId=n;const i=w[w.length-1];O.has(t)||O.set(t,{cleanupFns:new Set});const l=O.get(t);i?l.parent=i:delete l.parent,w.push(t),B.push(t),t(),B.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 yt(t,...e){const n=A("");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 St(t,e){const n=A(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 vt(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 At(...t){let e=t.map(s=>s());const n=A(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}const gt=(...t)=>{const e=A([]);return b(()=>{e.set(t.map(n=>n()))}),e};class T extends HTMLElement{constructor(n=!1){super();E(this,"isSlotLazyLoading",!1);E(this,"slotTemplate");E(this,"slotContext");E(this,"rootStyle");E(this,"modelValue");E(this,"providers");E(this,"appendAllSlotContent");E(this,"allSlotContent",[]);E(this,"slotContent",{});E(this,"htmlSlotContent",{});E(this,"shadow");E(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 f("%cinject%c",n),this.injects[n]||(this.injects[n]=A(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{f("%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}}E(T,"observedAttributes",[]),E(T,"renderTagName",""),E(T,"styles");const Lt=t=>"render"in t&&"setReactiveValue"in t,Rt="handleSlotContext",K="onConnected",Tt=()=>()=>{},D=t=>typeof t=="string"?t:JSON.stringify(t),G=t=>{const e=document.createElement("span");return e.textContent=D(t),e},N=(t,e)=>(t.appendChild(G(e)),t),x=(t,e)=>(t.innerHTML="",N(t,e)),J=t=>{const e=document.createElement("span");return b(()=>{const n=t();e.textContent=D(n)}),e},$=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),K 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 N(t,e),this},setHtmlContent(e){return x(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 T))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(M(e),s),!(t instanceof T)){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(M(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(M(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,K,{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(J(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(J(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),tt=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),jt=(t,...e)=>tt(t,...e),V=(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])}),ot(t,e.classList),lt(t,e.style),ct(t,e.attributes),it(t,e.reactiveClassList),st(t,e.customAttributes),nt(t,e.children),et(t,e.effects),U(t,e.listeners),U(t,e.customListeners),t},U=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},et=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),nt=(t,e)=>I(t,...e||[]),st=(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])})},ot=(t,e)=>t.addClass(...e||[]),it=(t,e)=>t.addReactiveClass(e||{}),lt=(t,e)=>t.addStyle(e||{}),ct=(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])})},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),k=(t,e)=>{const n=document.createElement(t),s={...$(n)};return V(s,e)},P=(t,e)=>{const[n,...s]=t.split(" ").map(l=>l.trim()),i=k(n,e);return s.length>0&&i.addClass(...s),(...l)=>I(i,...l.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?g(()=>c(i)):c))},g=t=>k("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),I(e,...s)}),Ot=t=>{const e=s=>typeof s=="string"?s.trim().length>0?$(G(s)):P("div")():v(s)?$(J(s)):s;return at(()=>{const s=t();return s instanceof Array&&Array.isArray(s)?s.map(e):e(s)})},wt=(t,e,n)=>{const s=k("div").addStyle({display:"contents"}),i=new Map,l=new Map;let c=[];const d=new Set;let r=t.peek();const h=m=>{d.delete(m),i.delete(m),l.delete(m)};return b(()=>{const m=t();c=m.map(e).map(u=>typeof u=="string"?u:u.toString());const C=Array.from(s.hostElement.children);f("containerChildren",C,c),C.forEach(u=>{const S=u.dataset.key;c.includes(S)||(f("remove element",S,u),u.remove(),h(S))}),c.forEach(u=>{var H,j;const S=m[c.indexOf(u)];i.has(u)?JSON.stringify(S)!==JSON.stringify(r[c.indexOf(u)])&&((H=s.hostElement.querySelector(`[data-key="${u}"]`))==null||H.remove(),(j=i.get(u))==null||j.set(Math.random().toString(36).substring(2,15)),l.set(u,()=>n(S,c.indexOf(u),m).setCustomAttribute("data-key",u))):(f("create new element",u,S),i.set(u,A(Math.random().toString(36).substring(2,15))),l.set(u,()=>n(S,c.indexOf(u),m).setCustomAttribute("data-key",u)))}),r=[...m.map(u=>({...u}))];const y=()=>{i.forEach((u,S)=>{f("key from setTimeout foreach currItemSignalMap",S),d.has(S)||(d.add(S),b(()=>{var Ct;u();const H=c.indexOf(S),j=(Ct=l.get(S))==null?void 0:Ct();j&&(f("call effect from setTimeout",S,j.hostElement),H<=s.hostElement.children.length-1?s.hostElement.insertBefore(j.hostElement,s.hostElement.children[H]):s.hostElement.append(j.hostElement))}))})};Promise.resolve().then(()=>y())}),s},at=t=>{let e=[k("div")],n=!1;return b(()=>{var l,c;const s=t();n=Array.isArray(s);const i=[];i.push(...[s].flat()),i.length===0&&i.push(k("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{f("newReactiveComponent.map",i.map(d=>{var r;return f("newReactiveComponent hostElement",d.hostElement),(r=d.hostElement)==null?void 0:r.id})),f("currComponent[0].hostElement?.id",(l=e[0].hostElement)==null?void 0:l.id,e),(c=e[0].hostElement)==null||c.replaceWith(...i.map(d=>d.hostElement)),e.slice(1).forEach(d=>{var r;return(r=d.hostElement)==null?void 0:r.remove()}),e=i}catch(d){console.error(d)}}),n?e:e[0]},kt=t=>Rt in t,Mt=t=>{const e=P("div")().addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},X=(t,e,n)=>t?g(e):n?g(n):P("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),rt=(t,e,n)=>g(()=>X(!!t(),e,n)),$t=(t,e,n)=>typeof t=="boolean"?X(t,e,n):rt(t,e,n),Z=(t,e)=>{const n=g(e);return typeof t=="boolean"?[n].flat().forEach(s=>s.hostElement.style.display=t?"block":"none"):b(()=>{const s=t()?"block":"none";[n].flat().forEach(i=>i.hostElement.style.display=s)}),n},It=(t,e,n)=>{const s=[Z(t,e)].flat();return n&&s.push(...[Z(()=>typeof t=="boolean"?!t:!t(),n)].flat()),g(()=>s)},dt=(t,e)=>{f("createCustomElement",t);const n=document.createElement(t),s={...$(n),setReactiveValue(i){return n instanceof T&&n.setReactiveValue(i),this},setSlotTemplate(i){const l=n.slotTemplate;return l&&Object.entries(i).forEach(([c,d])=>{l[c]=d}),this}};return V(s,e)},ht=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=dt(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{R("@rcreateCustomEl content",t,i);const l=i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?g(()=>c(s)):c);return s.hostElement.allSlotContent=l,s.hostElement.slotContent=l.filter(L).reduce((c,d)=>{const r=d.hostElement.getAttribute("slot")||"default";return c[r]||(c[r]=[]),c[r].push(d),c},{}),s.hostElement.appendAllSlotContent=()=>I(s,...l),s}},ut=(t,e,n)=>ht(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,p(e)?e:e&&typeof e=="string"?n:void 0),Pt=()=>{const t=()=>{};return t.oldValue=null,t},Ft=()=>({}),Ht=(t,e,n)=>{const s=e?mt(e,n)(t):t;return(i,...l)=>{const c=[...l];return i&&!p(i)&&c.unshift(i),ut(s,p(i)?i:{})(...c)}},a={};["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=>{a[t]=(e,...n)=>{let s=[...n];return e&&!p(e)&&(s=[e].concat(s)),P(t,p(e)?e:{})(...s)}});const ft=a.div,Wt=a.span,_t=a.section,Bt=a.input,Jt=a.button,zt=a.table,qt=a.tr,Dt=a.td,Gt=a.th,Nt=a.ul,Vt=a.li,Ut=a.ol,Xt=a.form,Zt=a.label,Qt=a.select,Yt=a.option,Kt=a.textarea,xt=a.img,te=a.a,ee=a.p,ne=a.h1,se=a.h2,oe=a.h3,ie=a.h4,le=a.h5,ce=a.h6,ae=a.br,re=a.hr,de=a.pre,he=a.code,ue=a.nav,fe=a.header,me=a.footer,Ce=a.main,be=a.aside,pe=a.article,Ee=a.figure,ye=a.figcaption,Se=a.blockquote,ve=a.cite,Ae=a.small,ge=a.strong,Le=a.em,Re=a.b,Te=a.i,je=a.u,Oe=a.s,we=a.sub,ke=a.sup,Me=a.mark,$e=a.del,Ie=a.ins,Pe=a.details,Fe=a.summary,He=a.progress,We=a.meter,_e=a.audio,Be=a.video,Je=a.canvas,ze=a.slot,qe=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),z="eventProps",q="EVENT_CONFIG",F="observedAttributes",De=()=>(t,e)=>{Reflect.get(t,F)||Reflect.defineProperty(t,F,{value:[]}),Reflect.get(t,F).push(M(e))},Ge=t=>(e,n)=>{Reflect.get(e,z)||Reflect.defineProperty(e,z,{value:[]}),Reflect.get(e,q)||Reflect.defineProperty(e,q,{value:{}}),Reflect.get(e,q)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,z).push(n)},mt=(t,e=!1)=>n=>{f(t,"start register static attr",n.prototype[F]);const s=[];if(n.styles){const l=n.styles,c=[];Array.isArray(l)?c.push(...l):c.push(l),c.forEach(d=>{const r=new CSSStyleSheet;r.replaceSync(d),s.push(r);const h=new CSSStyleSheet;h.replaceSync(d.slice(d.indexOf("@property"))),document.adoptedStyleSheets.push(h)})}class i extends n{constructor(...c){f("constructor",`%c${t}%c`),super(e,...c),R("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){f("rwc: render from new class");let c=ft();const d=()=>{f("wrapperEffectCallback"),c=n.prototype.render.call(this)};return d.fake=!0,b(d),c}attributeChangedCallback(c,d,r){f("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${d}, newValue: ${r}`,`%c${t}%c`);try{r=JSON.parse(r)}catch{}const h=Q(c);if(h in this&&v(this[h])){const m=this[h];r===null?(m.set(m.initValue),this.removeAttribute(c)):m.set(r)}W(this,n.prototype.attributeChangedCallback,c,d,r)}connectedCallback(){var d;f("rwc: connectedCallback"),f("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(f("WRAPPER for providers",t),Object.entries(this.providers).forEach(([r,h])=>{f("register provider",r,h()),this.addEventListener(r,m=>{var y;f("send provider",r,h());const C=m;((y=C.detail)==null?void 0:y.context)===r&&(C.stopPropagation(),C.detail.callback(h))})})),this.checkInjects(),(d=n.prototype[z])==null||d.forEach(r=>{this[r]=h=>{const m=n.prototype[q][r],{bubbles:C,composed:y}=m;v(h)?b(()=>{R("@oemit reactive value",h()),this.dispatchEvent(new CustomEvent(r,{detail:h(),bubbles:C,composed:y}))}):(R("@oemit value",h),this.dispatchEvent(new CustomEvent(r,{detail:h,bubbles:C,composed:y})))}}),f("start render",`%c${t}%c`,t);const c=()=>{f("rwc: insertRenderTemplate");const r=this.render();this.shadow.appendChild(r.hostElement),W(this,n.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!n.styles){const r=C=>C instanceof Promise||Array.isArray(C)&&C.every(y=>y instanceof Promise),h=this.rootStyle,m=C=>{const y=new CSSStyleSheet;y.replaceSync(C),this.shadow.adoptedStyleSheets.push(y);const u=new CSSStyleSheet;u.replaceSync(C.slice(C.indexOf("@property"))),document.adoptedStyleSheets.push(u)};if(r(h)){const C=[];Array.isArray(h)?C.push(...h):C.push(h),Promise.all(C).then(y=>y.forEach(u=>m(u.default))).then(()=>c())}else{const C=[];Array.isArray(h)?C.push(...h):C.push(h),C.forEach(y=>m(y)),c()}}else c();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(r=>{f(this.slotContext,this.slotContext&&this.slotContext[r.name]),R("@bslot element",r,`name:${r.name};`,r.assignedElements()),r.assignedElements().forEach(h=>{const m=this.slotContext[r.name];this.slotContext&&v(m)&&(R("@oslot element",r,`name:${r.name};`,r.assignedElements()),b(()=>{h.dispatchEvent(new CustomEvent("handleSlotContext",{detail:m()}))}))})})}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),W(this,n.prototype.disconnectedCallback)}}return E(i,"observedAttributes",n.prototype[F]??[]),E(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),n.renderTagName=t,n};o.BaseElement=T,o.a=te,o.addAttributeList=ct,o.addClassList=ot,o.addCustomAttributes=st,o.addHtmlContent=N,o.addReactiveClassList=it,o.addStyleList=lt,o.appendContentItem=I,o.article=pe,o.aside=be,o.audio=_e,o.b=Re,o.bindReactiveSignals=vt,o.blockquote=Se,o.br=ae,o.button=Jt,o.camelToKebab=M,o.canvas=Je,o.checkCall=W,o.cite=ve,o.classList=tt,o.cls=jt,o.code=he,o.colorLog=R,o.combineLatest=gt,o.component=mt,o.createComponent=qe,o.createCustom=ut,o.createCustomEl=ht,o.createCustomElement=dt,o.createEl=P,o.createElement=k,o.createSignal=St,o.defineSlotTemplate=Ft,o.del=$e,o.details=Pe,o.disableLogs=Y,o.div=ft,o.effect=b,o.effectMap=Et,o.elementHelpers=$,o.em=Le,o.enableLogs=bt,o.event=Ge,o.eventEmitter=Tt,o.figcaption=ye,o.figure=Ee,o.footer=me,o.forkJoin=At,o.form=Xt,o.getList=wt,o.getReactiveTemplate=Ot,o.getSignalContent=g,o.getTextContent=D,o.h1=ne,o.h2=se,o.h3=oe,o.h4=ie,o.h5=le,o.h6=ce,o.header=fe,o.hr=re,o.htmlEffectWrapper=J,o.i=Te,o.img=xt,o.initComponent=V,o.input=Bt,o.ins=Ie,o.isBaseElement=Lt,o.isComponentConfig=L,o.isComponentInitConfig=p,o.isEffectDebugEnabled=pt,o.isReactiveSignal=v,o.isSlotTemplate=kt,o.kebabToCamel=Q,o.label=Zt,o.li=Vt,o.main=Ce,o.mark=Me,o.meter=We,o.nav=ue,o.newEventEmitter=Pt,o.ol=Ut,o.option=Yt,o.p=ee,o.pre=de,o.progress=He,o.projectLog=f,o.property=De,o.renderIf=X,o.rs=yt,o.rxRenderIf=rt,o.s=Oe,o.section=_t,o.select=Qt,o.setChildren=nt,o.setEffects=et,o.setHtmlContent=x,o.setListeners=U,o.show=It,o.showIf=Z,o.signal=A,o.signalComponent=at,o.slot=ze,o.small=Ae,o.span=Wt,o.strong=ge,o.sub=we,o.summary=Fe,o.sup=ke,o.table=zt,o.td=Dt,o.textContentWrapper=G,o.textarea=Kt,o.th=Gt,o.tr=qt,o.u=je,o.ul=Nt,o.unsafeHtml=Mt,o.useCustomComponent=Ht,o.video=Be,o.when=$t,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|