@hot-page/fun 0.0.1 → 0.0.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/README.md +375 -9
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +322 -277
- package/package.json +1 -1
- package/src/index.ts +111 -37
package/dist/index.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
const
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
4
|
-
function
|
|
5
|
-
if (!
|
|
6
|
-
return
|
|
1
|
+
const ee = globalThis, q = ee.trustedTypes, ie = q ? q.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, pe = "$lit$", N = `lit$${Math.random().toFixed(9).slice(2)}$`, fe = "?" + N, Se = `<${fe}>`, E = document, W = () => E.createComment(""), H = (e) => e === null || typeof e != "object" && typeof e != "function", te = Array.isArray, be = (e) => te(e) || typeof e?.[Symbol.iterator] == "function", z = `[
|
|
2
|
+
\f\r]`, O = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ne = /-->/g, ue = />/g, x = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ce = /'/g, ae = /"/g, me = /^(?:script|style|textarea|title)$/i, ve = (e) => (t, ...r) => ({ _$litType$: e, strings: t, values: r }), nt = ve(1), ut = ve(2), R = Symbol.for("lit-noChange"), $ = Symbol.for("lit-nothing"), le = /* @__PURE__ */ new WeakMap(), T = E.createTreeWalker(E, 129);
|
|
4
|
+
function we(e, t) {
|
|
5
|
+
if (!te(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
6
|
+
return ie !== void 0 ? ie.createHTML(t) : t;
|
|
7
7
|
}
|
|
8
8
|
const Ie = (e, t) => {
|
|
9
9
|
const r = e.length - 1, s = [];
|
|
10
|
-
let o,
|
|
11
|
-
for (let
|
|
12
|
-
const
|
|
13
|
-
let
|
|
14
|
-
for (;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
return [
|
|
10
|
+
let o, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = O;
|
|
11
|
+
for (let l = 0; l < r; l++) {
|
|
12
|
+
const u = e[l];
|
|
13
|
+
let i, h, c = -1, p = 0;
|
|
14
|
+
for (; p < u.length && (a.lastIndex = p, h = a.exec(u), h !== null); ) p = a.lastIndex, a === O ? h[1] === "!--" ? a = ne : h[1] !== void 0 ? a = ue : h[2] !== void 0 ? (me.test(h[2]) && (o = RegExp("</" + h[2], "g")), a = x) : h[3] !== void 0 && (a = x) : a === x ? h[0] === ">" ? (a = o ?? O, c = -1) : h[1] === void 0 ? c = -2 : (c = a.lastIndex - h[2].length, i = h[1], a = h[3] === void 0 ? x : h[3] === '"' ? ae : ce) : a === ae || a === ce ? a = x : a === ne || a === ue ? a = O : (a = x, o = void 0);
|
|
15
|
+
const f = a === x && e[l + 1].startsWith("/>") ? " " : "";
|
|
16
|
+
n += a === O ? u + Se : c >= 0 ? (s.push(i), u.slice(0, c) + pe + u.slice(c) + N + f) : u + N + (c === -2 ? l : f);
|
|
17
|
+
}
|
|
18
|
+
return [we(e, n + (e[r] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
19
19
|
};
|
|
20
|
-
class
|
|
20
|
+
class P {
|
|
21
21
|
constructor({ strings: t, _$litType$: r }, s) {
|
|
22
22
|
let o;
|
|
23
23
|
this.parts = [];
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
if (this.el =
|
|
24
|
+
let n = 0, a = 0;
|
|
25
|
+
const l = t.length - 1, u = this.parts, [i, h] = Ie(t, r);
|
|
26
|
+
if (this.el = P.createElement(i, s), T.currentNode = this.el.content, r === 2 || r === 3) {
|
|
27
27
|
const c = this.el.content.firstChild;
|
|
28
28
|
c.replaceWith(...c.childNodes);
|
|
29
29
|
}
|
|
30
|
-
for (; (o = T.nextNode()) !== null &&
|
|
30
|
+
for (; (o = T.nextNode()) !== null && u.length < l; ) {
|
|
31
31
|
if (o.nodeType === 1) {
|
|
32
32
|
if (o.hasAttributes()) for (const c of o.getAttributeNames()) if (c.endsWith(pe)) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
} else c.startsWith(
|
|
33
|
+
const p = h[a++], f = o.getAttribute(c).split(N), y = /([.?@])?(.*)/.exec(p);
|
|
34
|
+
u.push({ type: 1, index: n, name: y[2], strings: f, ctor: y[1] === "." ? Me : y[1] === "?" ? We : y[1] === "@" ? He : j }), o.removeAttribute(c);
|
|
35
|
+
} else c.startsWith(N) && (u.push({ type: 6, index: n }), o.removeAttribute(c));
|
|
36
36
|
if (me.test(o.tagName)) {
|
|
37
|
-
const c = o.textContent.split(
|
|
38
|
-
if (
|
|
39
|
-
o.textContent =
|
|
40
|
-
for (let
|
|
41
|
-
o.append(c[
|
|
37
|
+
const c = o.textContent.split(N), p = c.length - 1;
|
|
38
|
+
if (p > 0) {
|
|
39
|
+
o.textContent = q ? q.emptyScript : "";
|
|
40
|
+
for (let f = 0; f < p; f++) o.append(c[f], W()), T.nextNode(), u.push({ type: 2, index: ++n });
|
|
41
|
+
o.append(c[p], W());
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
} else if (o.nodeType === 8) if (o.data === fe)
|
|
44
|
+
} else if (o.nodeType === 8) if (o.data === fe) u.push({ type: 2, index: n });
|
|
45
45
|
else {
|
|
46
46
|
let c = -1;
|
|
47
|
-
for (; (c = o.data.indexOf(
|
|
47
|
+
for (; (c = o.data.indexOf(N, c + 1)) !== -1; ) u.push({ type: 7, index: n }), c += N.length - 1;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
n++;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
static createElement(t, r) {
|
|
@@ -55,12 +55,12 @@ class k {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
function b(e, t, r = e, s) {
|
|
58
|
-
if (t ===
|
|
58
|
+
if (t === R) return t;
|
|
59
59
|
let o = s !== void 0 ? r._$Co?.[s] : r._$Cl;
|
|
60
|
-
const
|
|
61
|
-
return o?.constructor !==
|
|
60
|
+
const n = H(t) ? void 0 : t._$litDirective$;
|
|
61
|
+
return o?.constructor !== n && (o?._$AO?.(!1), n === void 0 ? o = void 0 : (o = new n(e), o._$AT(e, r, s)), s !== void 0 ? (r._$Co ??= [])[s] = o : r._$Cl = o), o !== void 0 && (t = b(e, o._$AS(e, t.values), o, s)), t;
|
|
62
62
|
}
|
|
63
|
-
class
|
|
63
|
+
class Oe {
|
|
64
64
|
constructor(t, r) {
|
|
65
65
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = r;
|
|
66
66
|
}
|
|
@@ -73,13 +73,13 @@ class be {
|
|
|
73
73
|
u(t) {
|
|
74
74
|
const { el: { content: r }, parts: s } = this._$AD, o = (t?.creationScope ?? E).importNode(r, !0);
|
|
75
75
|
T.currentNode = o;
|
|
76
|
-
let
|
|
77
|
-
for (;
|
|
78
|
-
if (a ===
|
|
79
|
-
let
|
|
80
|
-
|
|
76
|
+
let n = T.nextNode(), a = 0, l = 0, u = s[0];
|
|
77
|
+
for (; u !== void 0; ) {
|
|
78
|
+
if (a === u.index) {
|
|
79
|
+
let i;
|
|
80
|
+
u.type === 2 ? i = new k(n, n.nextSibling, this, t) : u.type === 1 ? i = new u.ctor(n, u.name, u.strings, this, t) : u.type === 6 && (i = new Re(n, this, t)), this._$AV.push(i), u = s[++l];
|
|
81
81
|
}
|
|
82
|
-
a !==
|
|
82
|
+
a !== u?.index && (n = T.nextNode(), a++);
|
|
83
83
|
}
|
|
84
84
|
return T.currentNode = E, o;
|
|
85
85
|
}
|
|
@@ -88,12 +88,12 @@ class be {
|
|
|
88
88
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, r), r += s.strings.length - 2) : s._$AI(t[r])), r++;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
class
|
|
91
|
+
class k {
|
|
92
92
|
get _$AU() {
|
|
93
93
|
return this._$AM?._$AU ?? this._$Cv;
|
|
94
94
|
}
|
|
95
95
|
constructor(t, r, s, o) {
|
|
96
|
-
this.type = 2, this._$AH =
|
|
96
|
+
this.type = 2, this._$AH = $, this._$AN = void 0, this._$AA = t, this._$AB = r, this._$AM = s, this.options = o, this._$Cv = o?.isConnected ?? !0;
|
|
97
97
|
}
|
|
98
98
|
get parentNode() {
|
|
99
99
|
let t = this._$AA.parentNode;
|
|
@@ -107,7 +107,7 @@ class L {
|
|
|
107
107
|
return this._$AB;
|
|
108
108
|
}
|
|
109
109
|
_$AI(t, r = this) {
|
|
110
|
-
t = b(this, t, r),
|
|
110
|
+
t = b(this, t, r), H(t) ? t === $ || t == null || t === "" ? (this._$AH !== $ && this._$AR(), this._$AH = $) : t !== this._$AH && t !== R && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : be(t) ? this.k(t) : this._(t);
|
|
111
111
|
}
|
|
112
112
|
O(t) {
|
|
113
113
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -116,25 +116,25 @@ class L {
|
|
|
116
116
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
117
117
|
}
|
|
118
118
|
_(t) {
|
|
119
|
-
this._$AH !==
|
|
119
|
+
this._$AH !== $ && H(this._$AH) ? this._$AA.nextSibling.data = t : this.T(E.createTextNode(t)), this._$AH = t;
|
|
120
120
|
}
|
|
121
121
|
$(t) {
|
|
122
|
-
const { values: r, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el =
|
|
122
|
+
const { values: r, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = P.createElement(we(s.h, s.h[0]), this.options)), s);
|
|
123
123
|
if (this._$AH?._$AD === o) this._$AH.p(r);
|
|
124
124
|
else {
|
|
125
|
-
const
|
|
126
|
-
|
|
125
|
+
const n = new Oe(o, this), a = n.u(this.options);
|
|
126
|
+
n.p(r), this.T(a), this._$AH = n;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
_$AC(t) {
|
|
130
|
-
let r =
|
|
131
|
-
return r === void 0 &&
|
|
130
|
+
let r = le.get(t.strings);
|
|
131
|
+
return r === void 0 && le.set(t.strings, r = new P(t)), r;
|
|
132
132
|
}
|
|
133
133
|
k(t) {
|
|
134
|
-
|
|
134
|
+
te(this._$AH) || (this._$AH = [], this._$AR());
|
|
135
135
|
const r = this._$AH;
|
|
136
136
|
let s, o = 0;
|
|
137
|
-
for (const
|
|
137
|
+
for (const n of t) o === r.length ? r.push(s = new k(this.O(W()), this.O(W()), this, this.options)) : s = r[o], s._$AI(n), o++;
|
|
138
138
|
o < r.length && (this._$AR(s && s._$AB.nextSibling, o), r.length = o);
|
|
139
139
|
}
|
|
140
140
|
_$AR(t = this._$AA.nextSibling, r) {
|
|
@@ -147,61 +147,61 @@ class L {
|
|
|
147
147
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
class
|
|
150
|
+
class j {
|
|
151
151
|
get tagName() {
|
|
152
152
|
return this.element.tagName;
|
|
153
153
|
}
|
|
154
154
|
get _$AU() {
|
|
155
155
|
return this._$AM._$AU;
|
|
156
156
|
}
|
|
157
|
-
constructor(t, r, s, o,
|
|
158
|
-
this.type = 1, this._$AH =
|
|
157
|
+
constructor(t, r, s, o, n) {
|
|
158
|
+
this.type = 1, this._$AH = $, this._$AN = void 0, this.element = t, this.name = r, this._$AM = o, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = $;
|
|
159
159
|
}
|
|
160
160
|
_$AI(t, r = this, s, o) {
|
|
161
|
-
const
|
|
161
|
+
const n = this.strings;
|
|
162
162
|
let a = !1;
|
|
163
|
-
if (
|
|
163
|
+
if (n === void 0) t = b(this, t, r, 0), a = !H(t) || t !== this._$AH && t !== R, a && (this._$AH = t);
|
|
164
164
|
else {
|
|
165
|
-
const
|
|
166
|
-
let
|
|
167
|
-
for (t =
|
|
165
|
+
const l = t;
|
|
166
|
+
let u, i;
|
|
167
|
+
for (t = n[0], u = 0; u < n.length - 1; u++) i = b(this, l[s + u], r, u), i === R && (i = this._$AH[u]), a ||= !H(i) || i !== this._$AH[u], i === $ ? t = $ : t !== $ && (t += (i ?? "") + n[u + 1]), this._$AH[u] = i;
|
|
168
168
|
}
|
|
169
169
|
a && !o && this.j(t);
|
|
170
170
|
}
|
|
171
171
|
j(t) {
|
|
172
|
-
t ===
|
|
172
|
+
t === $ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
class
|
|
175
|
+
class Me extends j {
|
|
176
176
|
constructor() {
|
|
177
177
|
super(...arguments), this.type = 3;
|
|
178
178
|
}
|
|
179
179
|
j(t) {
|
|
180
|
-
this.element[this.name] = t ===
|
|
180
|
+
this.element[this.name] = t === $ ? void 0 : t;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
class We extends
|
|
183
|
+
class We extends j {
|
|
184
184
|
constructor() {
|
|
185
185
|
super(...arguments), this.type = 4;
|
|
186
186
|
}
|
|
187
187
|
j(t) {
|
|
188
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
188
|
+
this.element.toggleAttribute(this.name, !!t && t !== $);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
class
|
|
192
|
-
constructor(t, r, s, o,
|
|
193
|
-
super(t, r, s, o,
|
|
191
|
+
class He extends j {
|
|
192
|
+
constructor(t, r, s, o, n) {
|
|
193
|
+
super(t, r, s, o, n), this.type = 5;
|
|
194
194
|
}
|
|
195
195
|
_$AI(t, r = this) {
|
|
196
|
-
if ((t = b(this, t, r, 0) ??
|
|
197
|
-
const s = this._$AH, o = t ===
|
|
198
|
-
o && this.element.removeEventListener(this.name, this, s),
|
|
196
|
+
if ((t = b(this, t, r, 0) ?? $) === R) return;
|
|
197
|
+
const s = this._$AH, o = t === $ && s !== $ || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== $ && (s === $ || o);
|
|
198
|
+
o && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
199
199
|
}
|
|
200
200
|
handleEvent(t) {
|
|
201
201
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
class
|
|
204
|
+
class Re {
|
|
205
205
|
constructor(t, r, s) {
|
|
206
206
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = r, this.options = s;
|
|
207
207
|
}
|
|
@@ -212,41 +212,41 @@ class Pe {
|
|
|
212
212
|
b(this, t);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
const
|
|
215
|
+
const Pe = ee.litHtmlPolyfillSupport;
|
|
216
|
+
Pe?.(P, k), (ee.litHtmlVersions ??= []).push("3.3.1");
|
|
217
|
+
const he = (e, t, r) => {
|
|
218
218
|
const s = t;
|
|
219
219
|
let o = s._$litPart$;
|
|
220
|
-
return o === void 0 && (s._$litPart$ = o = new
|
|
220
|
+
return o === void 0 && (s._$litPart$ = o = new k(t.insertBefore(W(), null), null, void 0, {})), o._$AI(e), o;
|
|
221
221
|
};
|
|
222
|
-
var ke = Object.defineProperty, Le = (e, t, r) => t in e ? ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r,
|
|
222
|
+
var ke = Object.defineProperty, Le = (e, t, r) => t in e ? ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, F = (e, t, r) => (Le(e, typeof t != "symbol" ? t + "" : t, r), r), Ve = (e, t, r) => {
|
|
223
223
|
if (!t.has(e))
|
|
224
224
|
throw TypeError("Cannot " + r);
|
|
225
|
-
},
|
|
225
|
+
}, K = (e, t) => {
|
|
226
226
|
if (Object(t) !== t)
|
|
227
227
|
throw TypeError('Cannot use the "in" operator on this value');
|
|
228
228
|
return e.has(t);
|
|
229
|
-
},
|
|
229
|
+
}, V = (e, t, r) => {
|
|
230
230
|
if (t.has(e))
|
|
231
231
|
throw TypeError("Cannot add the same private member more than once");
|
|
232
232
|
t instanceof WeakSet ? t.add(e) : t.set(e, r);
|
|
233
233
|
}, de = (e, t, r) => (Ve(e, t, "access private method"), r);
|
|
234
|
-
function
|
|
234
|
+
function $e(e, t) {
|
|
235
235
|
return Object.is(e, t);
|
|
236
236
|
}
|
|
237
|
-
let
|
|
238
|
-
const
|
|
239
|
-
function
|
|
240
|
-
const t =
|
|
241
|
-
return
|
|
237
|
+
let w = null, M = !1, D = 1;
|
|
238
|
+
const U = /* @__PURE__ */ Symbol("SIGNAL");
|
|
239
|
+
function S(e) {
|
|
240
|
+
const t = w;
|
|
241
|
+
return w = e, t;
|
|
242
242
|
}
|
|
243
243
|
function De() {
|
|
244
|
-
return
|
|
244
|
+
return w;
|
|
245
245
|
}
|
|
246
246
|
function qe() {
|
|
247
247
|
return M;
|
|
248
248
|
}
|
|
249
|
-
const
|
|
249
|
+
const re = {
|
|
250
250
|
version: 0,
|
|
251
251
|
lastCleanEpoch: 0,
|
|
252
252
|
dirty: !1,
|
|
@@ -266,31 +266,31 @@ const se = {
|
|
|
266
266
|
consumerOnSignalRead: () => {
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
|
-
function
|
|
269
|
+
function B(e) {
|
|
270
270
|
if (M)
|
|
271
271
|
throw new Error(
|
|
272
272
|
typeof ngDevMode < "u" && ngDevMode ? "Assertion error: signal read during notification phase" : ""
|
|
273
273
|
);
|
|
274
|
-
if (
|
|
274
|
+
if (w === null)
|
|
275
275
|
return;
|
|
276
|
-
|
|
277
|
-
const t =
|
|
278
|
-
if (
|
|
279
|
-
const r =
|
|
280
|
-
|
|
276
|
+
w.consumerOnSignalRead(e);
|
|
277
|
+
const t = w.nextProducerIndex++;
|
|
278
|
+
if (I(w), t < w.producerNode.length && w.producerNode[t] !== e && Q(w)) {
|
|
279
|
+
const r = w.producerNode[t];
|
|
280
|
+
G(r, w.producerIndexOfThis[t]);
|
|
281
281
|
}
|
|
282
|
-
|
|
282
|
+
w.producerNode[t] !== e && (w.producerNode[t] = e, w.producerIndexOfThis[t] = Q(w) ? ge(e, w, t) : 0), w.producerLastReadVersion[t] = e.version;
|
|
283
283
|
}
|
|
284
284
|
function Ue() {
|
|
285
|
-
|
|
285
|
+
D++;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
if (!(!e.dirty && e.lastCleanEpoch ===
|
|
287
|
+
function Ae(e) {
|
|
288
|
+
if (!(!e.dirty && e.lastCleanEpoch === D)) {
|
|
289
289
|
if (!e.producerMustRecompute(e) && !ze(e)) {
|
|
290
|
-
e.dirty = !1, e.lastCleanEpoch =
|
|
290
|
+
e.dirty = !1, e.lastCleanEpoch = D;
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
e.producerRecomputeValue(e), e.dirty = !1, e.lastCleanEpoch =
|
|
293
|
+
e.producerRecomputeValue(e), e.dirty = !1, e.lastCleanEpoch = D;
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
function _e(e) {
|
|
@@ -306,100 +306,100 @@ function _e(e) {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
function je() {
|
|
309
|
-
return
|
|
309
|
+
return w?.consumerAllowSignalWrites !== !1;
|
|
310
310
|
}
|
|
311
311
|
function Be(e) {
|
|
312
312
|
var t;
|
|
313
313
|
e.dirty = !0, _e(e), (t = e.consumerMarkedDirty) == null || t.call(e.wrapper ?? e);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
return e && (e.nextProducerIndex = 0),
|
|
315
|
+
function Ge(e) {
|
|
316
|
+
return e && (e.nextProducerIndex = 0), S(e);
|
|
317
317
|
}
|
|
318
318
|
function Ze(e, t) {
|
|
319
|
-
if (
|
|
320
|
-
if (
|
|
319
|
+
if (S(t), !(!e || e.producerNode === void 0 || e.producerIndexOfThis === void 0 || e.producerLastReadVersion === void 0)) {
|
|
320
|
+
if (Q(e))
|
|
321
321
|
for (let r = e.nextProducerIndex; r < e.producerNode.length; r++)
|
|
322
|
-
|
|
322
|
+
G(e.producerNode[r], e.producerIndexOfThis[r]);
|
|
323
323
|
for (; e.producerNode.length > e.nextProducerIndex; )
|
|
324
324
|
e.producerNode.pop(), e.producerLastReadVersion.pop(), e.producerIndexOfThis.pop();
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
function ze(e) {
|
|
328
|
-
|
|
328
|
+
I(e);
|
|
329
329
|
for (let t = 0; t < e.producerNode.length; t++) {
|
|
330
330
|
const r = e.producerNode[t], s = e.producerLastReadVersion[t];
|
|
331
|
-
if (s !== r.version || (
|
|
331
|
+
if (s !== r.version || (Ae(r), s !== r.version))
|
|
332
332
|
return !0;
|
|
333
333
|
}
|
|
334
334
|
return !1;
|
|
335
335
|
}
|
|
336
336
|
function ge(e, t, r) {
|
|
337
337
|
var s;
|
|
338
|
-
if (
|
|
338
|
+
if (se(e), I(e), e.liveConsumerNode.length === 0) {
|
|
339
339
|
(s = e.watched) == null || s.call(e.wrapper);
|
|
340
340
|
for (let o = 0; o < e.producerNode.length; o++)
|
|
341
341
|
e.producerIndexOfThis[o] = ge(e.producerNode[o], e, o);
|
|
342
342
|
}
|
|
343
343
|
return e.liveConsumerIndexOfThis.push(r), e.liveConsumerNode.push(t) - 1;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function G(e, t) {
|
|
346
346
|
var r;
|
|
347
|
-
if (
|
|
347
|
+
if (se(e), I(e), typeof ngDevMode < "u" && ngDevMode && t >= e.liveConsumerNode.length)
|
|
348
348
|
throw new Error(
|
|
349
349
|
`Assertion error: active consumer index ${t} is out of bounds of ${e.liveConsumerNode.length} consumers)`
|
|
350
350
|
);
|
|
351
351
|
if (e.liveConsumerNode.length === 1) {
|
|
352
352
|
(r = e.unwatched) == null || r.call(e.wrapper);
|
|
353
353
|
for (let o = 0; o < e.producerNode.length; o++)
|
|
354
|
-
|
|
354
|
+
G(e.producerNode[o], e.producerIndexOfThis[o]);
|
|
355
355
|
}
|
|
356
356
|
const s = e.liveConsumerNode.length - 1;
|
|
357
357
|
if (e.liveConsumerNode[t] = e.liveConsumerNode[s], e.liveConsumerIndexOfThis[t] = e.liveConsumerIndexOfThis[s], e.liveConsumerNode.length--, e.liveConsumerIndexOfThis.length--, t < e.liveConsumerNode.length) {
|
|
358
|
-
const o = e.liveConsumerIndexOfThis[t],
|
|
359
|
-
|
|
358
|
+
const o = e.liveConsumerIndexOfThis[t], n = e.liveConsumerNode[t];
|
|
359
|
+
I(n), n.producerIndexOfThis[o] = t;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Q(e) {
|
|
363
363
|
var t;
|
|
364
364
|
return e.consumerIsAlwaysLive || (((t = e?.liveConsumerNode) == null ? void 0 : t.length) ?? 0) > 0;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function I(e) {
|
|
367
367
|
e.producerNode ?? (e.producerNode = []), e.producerIndexOfThis ?? (e.producerIndexOfThis = []), e.producerLastReadVersion ?? (e.producerLastReadVersion = []);
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function se(e) {
|
|
370
370
|
e.liveConsumerNode ?? (e.liveConsumerNode = []), e.liveConsumerIndexOfThis ?? (e.liveConsumerIndexOfThis = []);
|
|
371
371
|
}
|
|
372
372
|
function ye(e) {
|
|
373
|
-
if (
|
|
373
|
+
if (Ae(e), B(e), e.value === X)
|
|
374
374
|
throw e.error;
|
|
375
375
|
return e.value;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function Fe(e) {
|
|
378
378
|
const t = Object.create(Ke);
|
|
379
379
|
t.computation = e;
|
|
380
380
|
const r = () => ye(t);
|
|
381
|
-
return r[
|
|
381
|
+
return r[U] = t, r;
|
|
382
382
|
}
|
|
383
|
-
const
|
|
384
|
-
...
|
|
385
|
-
value:
|
|
383
|
+
const Y = /* @__PURE__ */ Symbol("UNSET"), J = /* @__PURE__ */ Symbol("COMPUTING"), X = /* @__PURE__ */ Symbol("ERRORED"), Ke = {
|
|
384
|
+
...re,
|
|
385
|
+
value: Y,
|
|
386
386
|
dirty: !0,
|
|
387
387
|
error: null,
|
|
388
|
-
equal:
|
|
388
|
+
equal: $e,
|
|
389
389
|
producerMustRecompute(e) {
|
|
390
|
-
return e.value ===
|
|
390
|
+
return e.value === Y || e.value === J;
|
|
391
391
|
},
|
|
392
392
|
producerRecomputeValue(e) {
|
|
393
|
-
if (e.value ===
|
|
393
|
+
if (e.value === J)
|
|
394
394
|
throw new Error("Detected cycle in computations.");
|
|
395
395
|
const t = e.value;
|
|
396
|
-
e.value =
|
|
397
|
-
const r =
|
|
396
|
+
e.value = J;
|
|
397
|
+
const r = Ge(e);
|
|
398
398
|
let s, o = !1;
|
|
399
399
|
try {
|
|
400
|
-
s = e.computation.call(e.wrapper), o = t !==
|
|
401
|
-
} catch (
|
|
402
|
-
s =
|
|
400
|
+
s = e.computation.call(e.wrapper), o = t !== Y && t !== X && e.equal.call(e.wrapper, t, s);
|
|
401
|
+
} catch (n) {
|
|
402
|
+
s = X, e.error = n;
|
|
403
403
|
} finally {
|
|
404
404
|
Ze(e, r);
|
|
405
405
|
}
|
|
@@ -420,146 +420,146 @@ function Qe() {
|
|
|
420
420
|
function Xe(e) {
|
|
421
421
|
const t = Object.create(rt);
|
|
422
422
|
t.value = e;
|
|
423
|
-
const r = () => (
|
|
424
|
-
return r[
|
|
423
|
+
const r = () => (B(t), t.value);
|
|
424
|
+
return r[U] = t, r;
|
|
425
425
|
}
|
|
426
426
|
function et() {
|
|
427
|
-
return
|
|
427
|
+
return B(this), this.value;
|
|
428
428
|
}
|
|
429
429
|
function tt(e, t) {
|
|
430
430
|
je() || Qe(), e.equal.call(e.wrapper, e.value, t) || (e.value = t, st(e));
|
|
431
431
|
}
|
|
432
432
|
const rt = {
|
|
433
|
-
...
|
|
434
|
-
equal:
|
|
433
|
+
...re,
|
|
434
|
+
equal: $e,
|
|
435
435
|
value: void 0
|
|
436
436
|
};
|
|
437
437
|
function st(e) {
|
|
438
438
|
e.version++, Ue(), _e(e);
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
var
|
|
440
|
+
const A = Symbol("node");
|
|
441
|
+
var C;
|
|
442
442
|
((e) => {
|
|
443
443
|
var t, r, s, o;
|
|
444
|
-
class
|
|
445
|
-
constructor(
|
|
446
|
-
|
|
447
|
-
const c = Xe(
|
|
448
|
-
if (this[
|
|
449
|
-
const
|
|
450
|
-
|
|
444
|
+
class n {
|
|
445
|
+
constructor(u, i = {}) {
|
|
446
|
+
V(this, r), F(this, t);
|
|
447
|
+
const c = Xe(u)[U];
|
|
448
|
+
if (this[A] = c, c.wrapper = this, i) {
|
|
449
|
+
const p = i.equals;
|
|
450
|
+
p && (c.equal = p), c.watched = i[e.subtle.watched], c.unwatched = i[e.subtle.unwatched];
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
get() {
|
|
454
454
|
if (!(0, e.isState)(this))
|
|
455
455
|
throw new TypeError("Wrong receiver type for Signal.State.prototype.get");
|
|
456
|
-
return et.call(this[
|
|
456
|
+
return et.call(this[A]);
|
|
457
457
|
}
|
|
458
|
-
set(
|
|
458
|
+
set(u) {
|
|
459
459
|
if (!(0, e.isState)(this))
|
|
460
460
|
throw new TypeError("Wrong receiver type for Signal.State.prototype.set");
|
|
461
461
|
if (qe())
|
|
462
462
|
throw new Error("Writes to signals not permitted during Watcher callback");
|
|
463
|
-
const
|
|
464
|
-
tt(
|
|
463
|
+
const i = this[A];
|
|
464
|
+
tt(i, u);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
t =
|
|
467
|
+
t = A, r = /* @__PURE__ */ new WeakSet(), e.isState = (l) => typeof l == "object" && K(r, l), e.State = n;
|
|
468
468
|
class a {
|
|
469
469
|
// Create a Signal which evaluates to the value returned by the callback.
|
|
470
470
|
// Callback is called with this signal as the parameter.
|
|
471
|
-
constructor(
|
|
472
|
-
|
|
473
|
-
const c =
|
|
474
|
-
if (c.consumerAllowSignalWrites = !0, this[
|
|
475
|
-
const
|
|
476
|
-
|
|
471
|
+
constructor(u, i) {
|
|
472
|
+
V(this, o), F(this, s);
|
|
473
|
+
const c = Fe(u)[U];
|
|
474
|
+
if (c.consumerAllowSignalWrites = !0, this[A] = c, c.wrapper = this, i) {
|
|
475
|
+
const p = i.equals;
|
|
476
|
+
p && (c.equal = p), c.watched = i[e.subtle.watched], c.unwatched = i[e.subtle.unwatched];
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
get() {
|
|
480
480
|
if (!(0, e.isComputed)(this))
|
|
481
481
|
throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");
|
|
482
|
-
return ye(this[
|
|
482
|
+
return ye(this[A]);
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
s =
|
|
486
|
-
var
|
|
487
|
-
function v
|
|
488
|
-
let
|
|
485
|
+
s = A, o = /* @__PURE__ */ new WeakSet(), e.isComputed = (l) => typeof l == "object" && K(o, l), e.Computed = a, ((l) => {
|
|
486
|
+
var u, i, h, c;
|
|
487
|
+
function p(v) {
|
|
488
|
+
let m, d = null;
|
|
489
489
|
try {
|
|
490
|
-
|
|
490
|
+
d = S(null), m = v();
|
|
491
491
|
} finally {
|
|
492
|
-
|
|
492
|
+
S(d);
|
|
493
493
|
}
|
|
494
|
-
return
|
|
494
|
+
return m;
|
|
495
495
|
}
|
|
496
|
-
|
|
497
|
-
function
|
|
498
|
-
var
|
|
499
|
-
if (!(0, e.isComputed)(
|
|
496
|
+
l.untrack = p;
|
|
497
|
+
function f(v) {
|
|
498
|
+
var m;
|
|
499
|
+
if (!(0, e.isComputed)(v) && !(0, e.isWatcher)(v))
|
|
500
500
|
throw new TypeError("Called introspectSources without a Computed or Watcher argument");
|
|
501
|
-
return ((
|
|
501
|
+
return ((m = v[A].producerNode) == null ? void 0 : m.map((d) => d.wrapper)) ?? [];
|
|
502
502
|
}
|
|
503
|
-
|
|
504
|
-
function
|
|
505
|
-
var
|
|
506
|
-
if (!(0, e.isComputed)(
|
|
503
|
+
l.introspectSources = f;
|
|
504
|
+
function y(v) {
|
|
505
|
+
var m;
|
|
506
|
+
if (!(0, e.isComputed)(v) && !(0, e.isState)(v))
|
|
507
507
|
throw new TypeError("Called introspectSinks without a Signal argument");
|
|
508
|
-
return ((
|
|
508
|
+
return ((m = v[A].liveConsumerNode) == null ? void 0 : m.map((d) => d.wrapper)) ?? [];
|
|
509
509
|
}
|
|
510
|
-
|
|
511
|
-
function
|
|
512
|
-
if (!(0, e.isComputed)(
|
|
510
|
+
l.introspectSinks = y;
|
|
511
|
+
function _(v) {
|
|
512
|
+
if (!(0, e.isComputed)(v) && !(0, e.isState)(v))
|
|
513
513
|
throw new TypeError("Called hasSinks without a Signal argument");
|
|
514
|
-
const
|
|
515
|
-
return
|
|
514
|
+
const m = v[A].liveConsumerNode;
|
|
515
|
+
return m ? m.length > 0 : !1;
|
|
516
516
|
}
|
|
517
|
-
|
|
518
|
-
function
|
|
519
|
-
if (!(0, e.isComputed)(
|
|
517
|
+
l.hasSinks = _;
|
|
518
|
+
function Z(v) {
|
|
519
|
+
if (!(0, e.isComputed)(v) && !(0, e.isWatcher)(v))
|
|
520
520
|
throw new TypeError("Called hasSources without a Computed or Watcher argument");
|
|
521
|
-
const
|
|
522
|
-
return
|
|
521
|
+
const m = v[A].producerNode;
|
|
522
|
+
return m ? m.length > 0 : !1;
|
|
523
523
|
}
|
|
524
|
-
|
|
525
|
-
class
|
|
524
|
+
l.hasSources = Z;
|
|
525
|
+
class xe {
|
|
526
526
|
// When a (recursive) source of Watcher is written to, call this callback,
|
|
527
527
|
// if it hasn't already been called since the last `watch` call.
|
|
528
528
|
// No signals may be read or written during the notify.
|
|
529
|
-
constructor(
|
|
530
|
-
|
|
531
|
-
let
|
|
532
|
-
|
|
529
|
+
constructor(m) {
|
|
530
|
+
V(this, i), V(this, h), F(this, u);
|
|
531
|
+
let d = Object.create(re);
|
|
532
|
+
d.wrapper = this, d.consumerMarkedDirty = m, d.consumerIsAlwaysLive = !0, d.consumerAllowSignalWrites = !1, d.producerNode = [], this[A] = d;
|
|
533
533
|
}
|
|
534
534
|
// Add these signals to the Watcher's set, and set the watcher to run its
|
|
535
535
|
// notify callback next time any signal in the set (or one of its dependencies) changes.
|
|
536
536
|
// Can be called with no arguments just to reset the "notified" state, so that
|
|
537
537
|
// the notify callback will be invoked again.
|
|
538
|
-
watch(...
|
|
538
|
+
watch(...m) {
|
|
539
539
|
if (!(0, e.isWatcher)(this))
|
|
540
540
|
throw new TypeError("Called unwatch without Watcher receiver");
|
|
541
|
-
de(this,
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
const
|
|
545
|
-
for (const
|
|
546
|
-
|
|
547
|
-
|
|
541
|
+
de(this, h, c).call(this, m);
|
|
542
|
+
const d = this[A];
|
|
543
|
+
d.dirty = !1;
|
|
544
|
+
const g = S(d);
|
|
545
|
+
for (const L of m)
|
|
546
|
+
B(L[A]);
|
|
547
|
+
S(g);
|
|
548
548
|
}
|
|
549
549
|
// Remove these signals from the watched set (e.g., for an effect which is disposed)
|
|
550
|
-
unwatch(...
|
|
550
|
+
unwatch(...m) {
|
|
551
551
|
if (!(0, e.isWatcher)(this))
|
|
552
552
|
throw new TypeError("Called unwatch without Watcher receiver");
|
|
553
|
-
de(this,
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
for (let
|
|
557
|
-
if (
|
|
558
|
-
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
-
const
|
|
562
|
-
oe
|
|
553
|
+
de(this, h, c).call(this, m);
|
|
554
|
+
const d = this[A];
|
|
555
|
+
I(d);
|
|
556
|
+
for (let g = d.producerNode.length - 1; g >= 0; g--)
|
|
557
|
+
if (m.includes(d.producerNode[g].wrapper)) {
|
|
558
|
+
G(d.producerNode[g], d.producerIndexOfThis[g]);
|
|
559
|
+
const L = d.producerNode.length - 1;
|
|
560
|
+
if (d.producerNode[g] = d.producerNode[L], d.producerIndexOfThis[g] = d.producerIndexOfThis[L], d.producerNode.length--, d.producerIndexOfThis.length--, d.nextProducerIndex--, g < d.producerNode.length) {
|
|
561
|
+
const Ee = d.producerIndexOfThis[g], oe = d.producerNode[g];
|
|
562
|
+
se(oe), oe.liveConsumerIndexOfThis[Ee] = g;
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
}
|
|
@@ -568,134 +568,179 @@ var S;
|
|
|
568
568
|
getPending() {
|
|
569
569
|
if (!(0, e.isWatcher)(this))
|
|
570
570
|
throw new TypeError("Called getPending without Watcher receiver");
|
|
571
|
-
return this[
|
|
571
|
+
return this[A].producerNode.filter((d) => d.dirty).map((d) => d.wrapper);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
|
|
575
|
-
for (const
|
|
576
|
-
if (!(0, e.isComputed)(
|
|
574
|
+
u = A, i = /* @__PURE__ */ new WeakSet(), h = /* @__PURE__ */ new WeakSet(), c = function(v) {
|
|
575
|
+
for (const m of v)
|
|
576
|
+
if (!(0, e.isComputed)(m) && !(0, e.isState)(m))
|
|
577
577
|
throw new TypeError("Called watch/unwatch without a Computed or State argument");
|
|
578
|
-
}, e.isWatcher = (
|
|
579
|
-
function
|
|
580
|
-
var
|
|
581
|
-
return (
|
|
578
|
+
}, e.isWatcher = (v) => K(i, v), l.Watcher = xe;
|
|
579
|
+
function Te() {
|
|
580
|
+
var v;
|
|
581
|
+
return (v = De()) == null ? void 0 : v.wrapper;
|
|
582
582
|
}
|
|
583
|
-
|
|
583
|
+
l.currentComputed = Te, l.watched = Symbol("watched"), l.unwatched = Symbol("unwatched");
|
|
584
584
|
})(e.subtle || (e.subtle = {}));
|
|
585
|
-
})(
|
|
585
|
+
})(C || (C = {}));
|
|
586
586
|
const ot = /* @__PURE__ */ new Set(["internals", "effect", "styleProps"]);
|
|
587
587
|
function it(e) {
|
|
588
588
|
return `--${e.replaceAll(/([a-z0-9])([A-Z])/g, "$1-$2").replaceAll(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase()}`;
|
|
589
589
|
}
|
|
590
590
|
function ct(e, t, r) {
|
|
591
|
-
const { setup: s, attributes: o, styles:
|
|
592
|
-
Ne({ setup: s, attributes: o, styles:
|
|
591
|
+
const { setup: s, attributes: o, styles: n } = Ce(e, t, r);
|
|
592
|
+
Ne({ setup: s, attributes: o, styles: n, useShadow: !1 });
|
|
593
593
|
}
|
|
594
594
|
function at(e, t, r) {
|
|
595
|
-
const { setup: s, attributes: o, styles:
|
|
596
|
-
Ne({ setup: s, attributes: o, styles:
|
|
595
|
+
const { setup: s, attributes: o, styles: n } = Ce(e, t, r);
|
|
596
|
+
Ne({ setup: s, attributes: o, styles: n, useShadow: !0 });
|
|
597
597
|
}
|
|
598
598
|
function Ce(e, t, r) {
|
|
599
599
|
return typeof e == "function" ? { setup: e } : typeof e == "string" ? { styles: e, setup: t } : typeof t == "function" ? { attributes: e, setup: t } : { attributes: e, styles: t, setup: r };
|
|
600
600
|
}
|
|
601
|
-
const lt = (e) => new
|
|
601
|
+
const lt = (e) => new C.State(e), ht = (e) => new C.Computed(e);
|
|
602
602
|
function Ne(e) {
|
|
603
603
|
const {
|
|
604
604
|
setup: t,
|
|
605
605
|
tagName: r,
|
|
606
606
|
attributes: s = [],
|
|
607
607
|
useShadow: o = !0,
|
|
608
|
-
formAssociated:
|
|
608
|
+
formAssociated: n = !1,
|
|
609
609
|
styles: a
|
|
610
|
-
} = e,
|
|
611
|
-
if (!
|
|
610
|
+
} = e, l = r ?? t.name.replaceAll(/([a-z0-9])([A-Z])/g, "$1-$2").replaceAll(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
611
|
+
if (!l.includes("-"))
|
|
612
612
|
throw new Error(`Function ${t.name} must include at least one capital letter to be converted to a valid custom element name`);
|
|
613
|
-
if (customElements.get(
|
|
614
|
-
throw new Error(`Custom element with name ${
|
|
615
|
-
|
|
616
|
-
if (ot.has(
|
|
617
|
-
throw new Error(`Attribute name "${
|
|
618
|
-
|
|
619
|
-
|
|
613
|
+
if (customElements.get(l))
|
|
614
|
+
throw new Error(`Custom element with name ${l} already defined`);
|
|
615
|
+
s.forEach((i) => {
|
|
616
|
+
if (ot.has(i))
|
|
617
|
+
throw new Error(`Attribute name "${i}" conflicts with a reserved context property.`);
|
|
618
|
+
});
|
|
619
|
+
let u;
|
|
620
|
+
a !== void 0 && (u = new CSSStyleSheet(), o ? u.replaceSync(a) : (u.replaceSync(`@scope (${l}) { ${a} }`), document.adoptedStyleSheets = [
|
|
620
621
|
...document.adoptedStyleSheets,
|
|
621
|
-
|
|
622
|
-
])), customElements.define(
|
|
622
|
+
u
|
|
623
|
+
])), customElements.define(l, class extends HTMLElement {
|
|
623
624
|
#e;
|
|
624
625
|
#t;
|
|
626
|
+
#r;
|
|
625
627
|
#s = [];
|
|
626
|
-
#r = [];
|
|
627
628
|
#o = /* @__PURE__ */ new Map();
|
|
628
629
|
static get observedAttributes() {
|
|
629
630
|
return s;
|
|
630
631
|
}
|
|
631
632
|
static get formAssociated() {
|
|
632
|
-
return
|
|
633
|
+
return n;
|
|
633
634
|
}
|
|
634
635
|
constructor() {
|
|
635
|
-
super(), o && this.attachShadow({ mode: "open" }),
|
|
636
|
+
super(), o && this.attachShadow({ mode: "open" }), u && this.shadowRoot && (this.shadowRoot.adoptedStyleSheets = [
|
|
636
637
|
...this.shadowRoot.adoptedStyleSheets,
|
|
637
|
-
|
|
638
|
+
u
|
|
638
639
|
]);
|
|
639
|
-
const
|
|
640
|
+
const i = {
|
|
640
641
|
internals: this.attachInternals(),
|
|
641
|
-
effect: (
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
N === null ? this.style.removeProperty(g) : this.style.setProperty(g, String(N));
|
|
648
|
-
}
|
|
642
|
+
effect: (p) => this.#s.push({ fn: p }),
|
|
643
|
+
styleProps: (p) => {
|
|
644
|
+
Object.keys(p).forEach((f) => {
|
|
645
|
+
const y = p[f], _ = it(f);
|
|
646
|
+
y === null ? this.style.removeProperty(_) : this.style.setProperty(_, String(y));
|
|
647
|
+
});
|
|
649
648
|
}
|
|
650
649
|
};
|
|
651
|
-
s.forEach((
|
|
652
|
-
const
|
|
653
|
-
equals: (
|
|
650
|
+
s.forEach((p) => {
|
|
651
|
+
const f = new C.State(this.getAttribute(p), {
|
|
652
|
+
equals: (_, Z) => _ === Z
|
|
654
653
|
});
|
|
655
|
-
this.#o.set(
|
|
654
|
+
this.#o.set(p, f), i[p] = f, Object.defineProperty(this, p, {
|
|
656
655
|
get() {
|
|
657
|
-
return
|
|
656
|
+
return f.get();
|
|
658
657
|
},
|
|
659
|
-
set(
|
|
660
|
-
if (
|
|
661
|
-
throw new TypeError(`Attribute "${
|
|
662
|
-
|
|
658
|
+
set(_) {
|
|
659
|
+
if (_ !== null && typeof _ != "string")
|
|
660
|
+
throw new TypeError(`Attribute "${p}" only accepts strings or null, got ${typeof _}.`);
|
|
661
|
+
f.set(_);
|
|
663
662
|
},
|
|
664
663
|
enumerable: !0,
|
|
665
664
|
configurable: !0
|
|
666
665
|
});
|
|
667
|
-
const
|
|
666
|
+
const y = new C.subtle.Watcher(() => {
|
|
668
667
|
queueMicrotask(() => {
|
|
669
|
-
const
|
|
670
|
-
|
|
668
|
+
const _ = f.get();
|
|
669
|
+
_ === null ? this.removeAttribute(p) : this.setAttribute(p, _), y.watch();
|
|
671
670
|
});
|
|
672
671
|
});
|
|
673
|
-
|
|
672
|
+
y.watch(f);
|
|
674
673
|
});
|
|
675
|
-
const
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
674
|
+
const h = t.call(this, i), c = o ? this.shadowRoot : this;
|
|
675
|
+
if (typeof h == "function") {
|
|
676
|
+
this.#e = new C.Computed(() => h()), this.#r = () => {
|
|
677
|
+
const f = this.#e.get();
|
|
678
|
+
typeof f == "string" ? c.innerHTML = f : he(f, c);
|
|
679
|
+
};
|
|
680
|
+
let p = !1;
|
|
681
|
+
this.#t = new C.subtle.Watcher(() => {
|
|
682
|
+
p || (p = !0, queueMicrotask(() => {
|
|
683
|
+
p = !1;
|
|
684
|
+
try {
|
|
685
|
+
this.#r();
|
|
686
|
+
} catch (f) {
|
|
687
|
+
console.error(
|
|
688
|
+
`Error in render function for <${l}> fun element: `,
|
|
689
|
+
f
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
this.#t.watch();
|
|
693
|
+
}));
|
|
694
|
+
});
|
|
695
|
+
} else if (typeof h == "string")
|
|
696
|
+
c.innerHTML = h;
|
|
697
|
+
else if (typeof h == "object" && "_$litType$" in h)
|
|
698
|
+
he(h, c);
|
|
699
|
+
else {
|
|
700
|
+
if (h === void 0)
|
|
701
|
+
return;
|
|
702
|
+
console.error(
|
|
703
|
+
`Setup function for <${l}> returned an unexpected value. Expected a render function, a template (html\`...\`), a string, or nothing. Got: ${typeof h}`
|
|
704
|
+
);
|
|
705
|
+
}
|
|
684
706
|
}
|
|
685
707
|
connectedCallback() {
|
|
686
|
-
this.#t.watch(this.#e), this.#r
|
|
687
|
-
|
|
688
|
-
|
|
708
|
+
this.#t && this.#e && (this.#t.watch(this.#e), this.#r?.()), this.#s.forEach((i) => {
|
|
709
|
+
try {
|
|
710
|
+
i.computed = new C.Computed(() => i.fn()), i.watcher = new C.subtle.Watcher(() => {
|
|
711
|
+
queueMicrotask(() => {
|
|
712
|
+
typeof i.cleanup == "function" && i.cleanup(), i.computed = new C.Computed(() => i.fn());
|
|
713
|
+
try {
|
|
714
|
+
i.cleanup = i.computed.get();
|
|
715
|
+
} catch (h) {
|
|
716
|
+
console.error(
|
|
717
|
+
`Error in effect for <${l}> fun element: `,
|
|
718
|
+
h
|
|
719
|
+
);
|
|
720
|
+
}
|
|
721
|
+
i.watcher.watch(i.computed);
|
|
722
|
+
});
|
|
723
|
+
}), i.cleanup = i.computed.get(), i.watcher.watch(i.computed);
|
|
724
|
+
} catch (h) {
|
|
725
|
+
console.error(
|
|
726
|
+
`Error in effect for <${l}> fun element: `,
|
|
727
|
+
h
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
});
|
|
689
731
|
}
|
|
690
732
|
disconnectedCallback() {
|
|
691
|
-
this.#t.unwatch(this.#e), this.#
|
|
733
|
+
this.#t && this.#e && this.#t.unwatch(this.#e), this.#s.forEach((i) => {
|
|
734
|
+
i.watcher.unwatch(i.computed), typeof i.cleanup == "function" && i.cleanup(), i.cleanup = void 0;
|
|
735
|
+
});
|
|
692
736
|
}
|
|
693
|
-
attributeChangedCallback(
|
|
694
|
-
this.#o.get(
|
|
737
|
+
attributeChangedCallback(i, h, c) {
|
|
738
|
+
this.#o.get(i)?.set(c);
|
|
695
739
|
}
|
|
696
740
|
});
|
|
697
741
|
}
|
|
698
742
|
export {
|
|
743
|
+
ht as computed,
|
|
699
744
|
Ne as define,
|
|
700
745
|
nt as html,
|
|
701
746
|
ct as lightElement,
|