@jasonshimmy/custom-elements-runtime 0.2.7 → 0.3.0
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/dist/custom-elements-runtime.cjs.js +12 -12
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +987 -824
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +12 -12
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/runtime/template-compiler.d.ts +5 -3
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function vt(e, t) {
|
|
2
|
+
return pe(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
4
|
function kt(e, t) {
|
|
5
5
|
return e.map((r, i) => {
|
|
6
6
|
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${i}` : String(r);
|
|
7
|
-
return
|
|
7
|
+
return pe(t(r, i), `each-${n}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function ze() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,18 +17,18 @@ function Pe() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return He(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function He(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
26
|
const [r, i] = e[t];
|
|
27
|
-
if (r) return [
|
|
27
|
+
if (r) return [pe(i, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
|
-
return [
|
|
29
|
+
return [pe([], "whenChain-empty")];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function pe(e, t) {
|
|
32
32
|
const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
33
33
|
return {
|
|
34
34
|
tag: "#anchor",
|
|
@@ -36,7 +36,7 @@ function fe(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class X extends EventTarget {
|
|
40
40
|
handlers = {};
|
|
41
41
|
static instance;
|
|
42
42
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,7 +44,7 @@ class G extends EventTarget {
|
|
|
44
44
|
* Returns the singleton instance of GlobalEventBus
|
|
45
45
|
*/
|
|
46
46
|
static getInstance() {
|
|
47
|
-
return
|
|
47
|
+
return X.instance || (X.instance = new X()), X.instance;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Emit a global event with optional data. Includes event storm protection.
|
|
@@ -63,10 +63,10 @@ class G extends EventTarget {
|
|
|
63
63
|
// Global events don't need to bubble
|
|
64
64
|
cancelable: !0
|
|
65
65
|
}));
|
|
66
|
-
const
|
|
67
|
-
|
|
66
|
+
const o = this.handlers[t];
|
|
67
|
+
o && o.forEach((s) => {
|
|
68
68
|
try {
|
|
69
|
-
|
|
69
|
+
s(r);
|
|
70
70
|
} catch (a) {
|
|
71
71
|
console.error(`Error in global event handler for "${t}":`, a);
|
|
72
72
|
}
|
|
@@ -112,8 +112,8 @@ class G extends EventTarget {
|
|
|
112
112
|
*/
|
|
113
113
|
once(t, r) {
|
|
114
114
|
return new Promise((i) => {
|
|
115
|
-
const n = this.on(t, (
|
|
116
|
-
n(), r(
|
|
115
|
+
const n = this.on(t, (o) => {
|
|
116
|
+
n(), r(o), i(o);
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -157,7 +157,7 @@ class G extends EventTarget {
|
|
|
157
157
|
this.eventCounters.clear();
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
const
|
|
160
|
+
const ie = X.getInstance(), _t = (e, t) => ie.emit(e, t), $t = (e, t) => ie.on(e, t), St = (e, t) => ie.off(e, t), Et = (e, t) => ie.once(e, t), Ct = (e, t, r) => ie.listen(e, t, r);
|
|
161
161
|
function $e(e) {
|
|
162
162
|
let t = { ...e };
|
|
163
163
|
const r = [];
|
|
@@ -167,19 +167,19 @@ function $e(e) {
|
|
|
167
167
|
function n() {
|
|
168
168
|
return t;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function o(a) {
|
|
171
171
|
const f = typeof a == "function" ? a(t) : a;
|
|
172
|
-
t = { ...t, ...f },
|
|
172
|
+
t = { ...t, ...f }, s();
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function s() {
|
|
175
175
|
r.forEach((a) => a(t));
|
|
176
176
|
}
|
|
177
|
-
return { subscribe: i, getState: n, setState:
|
|
177
|
+
return { subscribe: i, getState: n, setState: o };
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Y(e) {
|
|
180
180
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function J(e) {
|
|
183
183
|
return typeof e == "string" ? e.replace(
|
|
184
184
|
/[&<>"']/g,
|
|
185
185
|
(t) => ({
|
|
@@ -191,77 +191,83 @@ function H(e) {
|
|
|
191
191
|
})[t]
|
|
192
192
|
) : e;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function W(e, t) {
|
|
195
195
|
return typeof t == "string" ? t.split(".").reduce((r, i) => r?.[i], e) : t;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function ce(e, t, r) {
|
|
198
198
|
const i = String(t).split("."), n = i.pop();
|
|
199
199
|
if (!n) return;
|
|
200
|
-
const
|
|
201
|
-
|
|
200
|
+
const o = i.reduce((s, a) => (s[a] == null && (s[a] = {}), s[a]), e);
|
|
201
|
+
o[n] = r;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function qe(e, t, r) {
|
|
204
204
|
if (r)
|
|
205
205
|
for (const [i, n] of Object.entries(r)) {
|
|
206
|
-
let
|
|
207
|
-
if (Array.isArray(n) ? (
|
|
208
|
-
callback:
|
|
209
|
-
options:
|
|
210
|
-
oldValue:
|
|
211
|
-
}),
|
|
206
|
+
let o, s = {};
|
|
207
|
+
if (Array.isArray(n) ? (o = n[0], s = n[1] || {}) : o = n, t.set(i, {
|
|
208
|
+
callback: o,
|
|
209
|
+
options: s,
|
|
210
|
+
oldValue: W(e, i)
|
|
211
|
+
}), s.immediate)
|
|
212
212
|
try {
|
|
213
|
-
const a =
|
|
214
|
-
|
|
213
|
+
const a = W(e, i);
|
|
214
|
+
o(a, void 0, e);
|
|
215
215
|
} catch (a) {
|
|
216
216
|
console.error(`Error in immediate watcher for "${i}":`, a);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
const n = (
|
|
222
|
-
if (
|
|
223
|
-
if (typeof
|
|
224
|
-
if (Array.isArray(
|
|
225
|
-
return
|
|
226
|
-
const f = Object.keys(
|
|
227
|
-
return f.length !==
|
|
228
|
-
},
|
|
229
|
-
if (
|
|
220
|
+
function Ie(e, t, r, i) {
|
|
221
|
+
const n = (s, a) => {
|
|
222
|
+
if (s === a) return !0;
|
|
223
|
+
if (typeof s != typeof a || typeof s != "object" || s === null || a === null) return !1;
|
|
224
|
+
if (Array.isArray(s) && Array.isArray(a))
|
|
225
|
+
return s.length !== a.length ? !1 : s.every((h, C) => n(h, a[C]));
|
|
226
|
+
const f = Object.keys(s), p = Object.keys(a);
|
|
227
|
+
return f.length !== p.length ? !1 : f.every((h) => n(s[h], a[h]));
|
|
228
|
+
}, o = t.get(r);
|
|
229
|
+
if (o && !n(i, o.oldValue))
|
|
230
230
|
try {
|
|
231
|
-
|
|
232
|
-
} catch (
|
|
233
|
-
console.error(`Error in watcher for "${r}":`,
|
|
231
|
+
o.callback(i, o.oldValue, e), o.oldValue = i;
|
|
232
|
+
} catch (s) {
|
|
233
|
+
console.error(`Error in watcher for "${r}":`, s);
|
|
234
234
|
}
|
|
235
|
-
for (const [
|
|
236
|
-
if (a.options.deep && r.startsWith(
|
|
235
|
+
for (const [s, a] of t.entries())
|
|
236
|
+
if (a.options.deep && r.startsWith(s + "."))
|
|
237
237
|
try {
|
|
238
|
-
const f =
|
|
238
|
+
const f = W(e, s);
|
|
239
239
|
n(f, a.oldValue) || (a.callback(f, a.oldValue, e), a.oldValue = f);
|
|
240
240
|
} catch (f) {
|
|
241
|
-
console.error(`Error in deep watcher for "${
|
|
241
|
+
console.error(`Error in deep watcher for "${s}":`, f);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Ne(e, t, r) {
|
|
245
245
|
if (!t.props) return;
|
|
246
|
-
function i(n,
|
|
247
|
-
return
|
|
246
|
+
function i(n, o) {
|
|
247
|
+
return o === Boolean ? n === "true" : o === Number ? Number(n) : n;
|
|
248
248
|
}
|
|
249
|
-
Object.entries(t.props).forEach(([n,
|
|
250
|
-
if (
|
|
249
|
+
Object.entries(t.props).forEach(([n, o]) => {
|
|
250
|
+
if (o.type === Function && typeof e[n] == "function")
|
|
251
251
|
r[n] = e[n];
|
|
252
252
|
else {
|
|
253
|
-
const
|
|
254
|
-
|
|
253
|
+
const s = Y(n), a = e.getAttribute(s);
|
|
254
|
+
if (typeof e[n] < "u")
|
|
255
|
+
try {
|
|
256
|
+
r[n] = J(i(e[n], o.type));
|
|
257
|
+
} catch {
|
|
258
|
+
r[n] = e[n];
|
|
259
|
+
}
|
|
260
|
+
else a !== null ? r[n] = J(i(a, o.type)) : "default" in o && o.default !== void 0 && (r[n] = J(o.default));
|
|
255
261
|
}
|
|
256
262
|
});
|
|
257
263
|
}
|
|
258
|
-
function
|
|
264
|
+
function We(e, t, r, i) {
|
|
259
265
|
e.onConnected && !r && (e.onConnected(t), i(!0));
|
|
260
266
|
}
|
|
261
|
-
function De(e, t, r, i, n,
|
|
262
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()), i(), n(),
|
|
267
|
+
function De(e, t, r, i, n, o, s, a) {
|
|
268
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()), i(), n(), o(!1), s(null), a(!1);
|
|
263
269
|
}
|
|
264
|
-
function
|
|
270
|
+
function Ue(e, t, r, i, n) {
|
|
265
271
|
e.onAttributeChanged && e.onAttributeChanged(t, r, i, n);
|
|
266
272
|
}
|
|
267
273
|
function V(e, t) {
|
|
@@ -272,94 +278,94 @@ function V(e, t) {
|
|
|
272
278
|
V(r, t);
|
|
273
279
|
}
|
|
274
280
|
}
|
|
275
|
-
function
|
|
276
|
-
if (!
|
|
277
|
-
const f = t.includes("lazy"),
|
|
278
|
-
let
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
if (
|
|
282
|
-
if (Array.isArray(
|
|
283
|
-
r[
|
|
281
|
+
function Fe(e, t, r, i, n, o, s, a) {
|
|
282
|
+
if (!o) return;
|
|
283
|
+
const f = t.includes("lazy"), p = t.includes("trim"), h = t.includes("number"), C = () => W(o._state || o, e), u = C();
|
|
284
|
+
let c = "text";
|
|
285
|
+
s instanceof HTMLInputElement ? c = i?.type || s.type || "text" : s instanceof HTMLSelectElement ? c = "select" : s instanceof HTMLTextAreaElement && (c = "textarea");
|
|
286
|
+
const w = s instanceof HTMLInputElement || s instanceof HTMLTextAreaElement || s instanceof HTMLSelectElement, d = w ? c === "checkbox" || c === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
287
|
+
if (c === "checkbox")
|
|
288
|
+
if (Array.isArray(u))
|
|
289
|
+
r[d] = u.includes(String(s?.getAttribute("value") ?? i?.value ?? ""));
|
|
284
290
|
else {
|
|
285
|
-
const x =
|
|
286
|
-
r[
|
|
291
|
+
const x = s?.getAttribute("true-value") ?? !0;
|
|
292
|
+
r[d] = u === x;
|
|
287
293
|
}
|
|
288
|
-
else if (
|
|
289
|
-
r[
|
|
290
|
-
else if (
|
|
291
|
-
if (
|
|
292
|
-
const x = Array.isArray(
|
|
294
|
+
else if (c === "radio")
|
|
295
|
+
r[d] = u === (i?.value ?? "");
|
|
296
|
+
else if (c === "select")
|
|
297
|
+
if (s && s.hasAttribute("multiple") && s instanceof HTMLSelectElement) {
|
|
298
|
+
const x = Array.isArray(u) ? u.map(String) : [];
|
|
293
299
|
setTimeout(() => {
|
|
294
|
-
Array.from(
|
|
300
|
+
Array.from(s.options).forEach((l) => {
|
|
295
301
|
l.selected = x.includes(l.value);
|
|
296
302
|
});
|
|
297
|
-
}, 0), r[
|
|
303
|
+
}, 0), r[d] = Array.isArray(u) ? u : [];
|
|
298
304
|
} else
|
|
299
|
-
r[
|
|
305
|
+
r[d] = u;
|
|
300
306
|
else {
|
|
301
|
-
r[
|
|
307
|
+
r[d] = u;
|
|
302
308
|
try {
|
|
303
|
-
const x =
|
|
304
|
-
i && (i[x] =
|
|
309
|
+
const x = Y(d);
|
|
310
|
+
i && (i[x] = u);
|
|
305
311
|
} catch {
|
|
306
312
|
}
|
|
307
313
|
}
|
|
308
|
-
const
|
|
314
|
+
const g = f || c === "checkbox" || c === "radio" || c === "select" ? "change" : "input", m = (x) => {
|
|
309
315
|
if (x.isComposing || n._isComposing || x.isTrusted === !1) return;
|
|
310
316
|
const l = x.target;
|
|
311
317
|
if (!l || l._modelUpdating) return;
|
|
312
|
-
let
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
if (Array.isArray(
|
|
316
|
-
const
|
|
318
|
+
let b = l.value;
|
|
319
|
+
if (c === "checkbox") {
|
|
320
|
+
const S = C();
|
|
321
|
+
if (Array.isArray(S)) {
|
|
322
|
+
const A = l.getAttribute("value") ?? "", $ = Array.from(S);
|
|
317
323
|
if (l.checked)
|
|
318
|
-
|
|
324
|
+
$.includes(A) || $.push(A);
|
|
319
325
|
else {
|
|
320
|
-
const
|
|
321
|
-
|
|
326
|
+
const T = $.indexOf(A);
|
|
327
|
+
T > -1 && $.splice(T, 1);
|
|
322
328
|
}
|
|
323
|
-
|
|
329
|
+
b = $;
|
|
324
330
|
} else {
|
|
325
|
-
const
|
|
326
|
-
|
|
331
|
+
const A = l.getAttribute("true-value") ?? !0, $ = l.getAttribute("false-value") ?? !1;
|
|
332
|
+
b = l.checked ? A : $;
|
|
327
333
|
}
|
|
328
|
-
} else if (
|
|
329
|
-
|
|
330
|
-
else if (
|
|
331
|
-
|
|
332
|
-
else if (
|
|
333
|
-
const
|
|
334
|
-
isNaN(
|
|
334
|
+
} else if (c === "radio")
|
|
335
|
+
b = l.getAttribute("value") ?? l.value;
|
|
336
|
+
else if (c === "select" && l.multiple)
|
|
337
|
+
b = Array.from(l.selectedOptions).map((S) => S.value);
|
|
338
|
+
else if (p && typeof b == "string" && (b = b.trim()), h) {
|
|
339
|
+
const S = Number(b);
|
|
340
|
+
isNaN(S) || (b = S);
|
|
335
341
|
}
|
|
336
|
-
const
|
|
337
|
-
if (Array.isArray(
|
|
342
|
+
const y = o._state || o, _ = W(y, e);
|
|
343
|
+
if (Array.isArray(b) && Array.isArray(_) ? JSON.stringify([...b].sort()) !== JSON.stringify([..._].sort()) : b !== _) {
|
|
338
344
|
l._modelUpdating = !0;
|
|
339
345
|
try {
|
|
340
|
-
|
|
346
|
+
ce(y, e, b), o._requestRender && o._requestRender();
|
|
341
347
|
} finally {
|
|
342
348
|
setTimeout(() => l._modelUpdating = !1, 0);
|
|
343
349
|
}
|
|
344
350
|
}
|
|
345
351
|
};
|
|
346
|
-
|
|
347
|
-
const l =
|
|
348
|
-
(Array.isArray(
|
|
349
|
-
}, (
|
|
352
|
+
w ? n[g] = m : n[`update:${Y(d)}`] = (x) => {
|
|
353
|
+
const l = o._state || o, b = x.detail !== void 0 ? x.detail : x.target?.value, y = W(l, e);
|
|
354
|
+
(Array.isArray(b) && Array.isArray(y) ? JSON.stringify([...b].sort()) !== JSON.stringify([...y].sort()) : b !== y) && (ce(l, e, b), o._requestRender && o._requestRender());
|
|
355
|
+
}, (c === "text" || c === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
|
|
350
356
|
n._isComposing = !1;
|
|
351
357
|
const l = x.target;
|
|
352
358
|
l && setTimeout(() => {
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
if (
|
|
356
|
-
const
|
|
357
|
-
isNaN(
|
|
359
|
+
const b = l.value, y = o._state || o, _ = W(y, e);
|
|
360
|
+
let E = b;
|
|
361
|
+
if (p && (E = E.trim()), h) {
|
|
362
|
+
const A = Number(E);
|
|
363
|
+
isNaN(A) || (E = A);
|
|
358
364
|
}
|
|
359
|
-
if (Array.isArray(
|
|
365
|
+
if (Array.isArray(E) && Array.isArray(_) ? JSON.stringify([...E].sort()) !== JSON.stringify([..._].sort()) : E !== _) {
|
|
360
366
|
l._modelUpdating = !0;
|
|
361
367
|
try {
|
|
362
|
-
|
|
368
|
+
ce(y, e, E), o._requestRender && o._requestRender();
|
|
363
369
|
} finally {
|
|
364
370
|
setTimeout(() => l._modelUpdating = !1, 0);
|
|
365
371
|
}
|
|
@@ -367,66 +373,66 @@ function He(e, t, r, i, n, s, o, a) {
|
|
|
367
373
|
}, 0);
|
|
368
374
|
});
|
|
369
375
|
}
|
|
370
|
-
function
|
|
376
|
+
function Me(e) {
|
|
371
377
|
const t = e.slice(2);
|
|
372
378
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
373
379
|
}
|
|
374
|
-
function
|
|
380
|
+
function Ke(e, t, r, i) {
|
|
375
381
|
if (i) {
|
|
376
382
|
if (typeof e == "object" && e !== null)
|
|
377
|
-
for (const [n,
|
|
378
|
-
t[n] =
|
|
383
|
+
for (const [n, o] of Object.entries(e))
|
|
384
|
+
t[n] = o;
|
|
379
385
|
else if (typeof e == "string")
|
|
380
386
|
try {
|
|
381
387
|
const n = JSON.parse(e);
|
|
382
388
|
if (typeof n == "object" && n !== null) {
|
|
383
|
-
for (const [
|
|
384
|
-
t[
|
|
389
|
+
for (const [o, s] of Object.entries(n))
|
|
390
|
+
t[o] = s;
|
|
385
391
|
return;
|
|
386
392
|
}
|
|
387
393
|
} catch {
|
|
388
|
-
const n =
|
|
394
|
+
const n = W(i, e);
|
|
389
395
|
r[e] = n;
|
|
390
396
|
}
|
|
391
397
|
}
|
|
392
398
|
}
|
|
393
|
-
function
|
|
399
|
+
function Je(e, t, r) {
|
|
394
400
|
if (!r) return;
|
|
395
|
-
const i =
|
|
401
|
+
const i = W(r, e), n = t.style || "", o = i ? "" : "none";
|
|
396
402
|
if (n) {
|
|
397
|
-
const
|
|
403
|
+
const s = n.split(";").filter(Boolean), a = s.findIndex(
|
|
398
404
|
(f) => f.trim().startsWith("display:")
|
|
399
405
|
);
|
|
400
|
-
a >= 0 ?
|
|
406
|
+
a >= 0 ? s[a] = `display: ${o}` : s.push(`display: ${o}`), t.style = s.join("; ");
|
|
401
407
|
} else
|
|
402
|
-
t.style = `display: ${
|
|
408
|
+
t.style = `display: ${o}`;
|
|
403
409
|
}
|
|
404
|
-
function
|
|
410
|
+
function Ge(e, t, r) {
|
|
405
411
|
if (!r) return;
|
|
406
|
-
const i =
|
|
412
|
+
const i = W(r, e);
|
|
407
413
|
let n = [];
|
|
408
414
|
typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
409
|
-
const
|
|
410
|
-
|
|
415
|
+
const o = t.class || "", s = o ? `${o} ${n.join(" ")}`.trim() : n.join(" ");
|
|
416
|
+
s && (t.class = s);
|
|
411
417
|
}
|
|
412
|
-
function
|
|
418
|
+
function Ze(e, t, r) {
|
|
413
419
|
let i;
|
|
414
420
|
if (typeof e == "string") {
|
|
415
421
|
if (!r) return;
|
|
416
|
-
i =
|
|
422
|
+
i = W(r, e);
|
|
417
423
|
} else
|
|
418
424
|
i = e;
|
|
419
425
|
let n = "";
|
|
420
426
|
if (typeof i == "string")
|
|
421
427
|
n = i;
|
|
422
428
|
else if (i && typeof i == "object") {
|
|
423
|
-
const
|
|
429
|
+
const s = [];
|
|
424
430
|
for (const [a, f] of Object.entries(i))
|
|
425
431
|
if (f != null && f !== "") {
|
|
426
|
-
const
|
|
432
|
+
const p = a.replace(
|
|
427
433
|
/[A-Z]/g,
|
|
428
|
-
(
|
|
429
|
-
),
|
|
434
|
+
(u) => `-${u.toLowerCase()}`
|
|
435
|
+
), h = [
|
|
430
436
|
"width",
|
|
431
437
|
"height",
|
|
432
438
|
"top",
|
|
@@ -452,175 +458,287 @@ function Ve(e, t, r) {
|
|
|
452
458
|
"min-height",
|
|
453
459
|
"max-height"
|
|
454
460
|
];
|
|
455
|
-
let
|
|
456
|
-
typeof f == "number" &&
|
|
461
|
+
let C = String(f);
|
|
462
|
+
typeof f == "number" && h.includes(p) && (C = `${f}px`), s.push(`${p}: ${C}`);
|
|
457
463
|
}
|
|
458
|
-
n =
|
|
464
|
+
n = s.join("; ") + (s.length > 0 ? ";" : "");
|
|
459
465
|
}
|
|
460
|
-
const
|
|
461
|
-
t.style =
|
|
466
|
+
const o = t.style || "";
|
|
467
|
+
t.style = o + (o && !o.endsWith(";") ? "; " : "") + n;
|
|
462
468
|
}
|
|
463
|
-
function
|
|
464
|
-
const n = {},
|
|
469
|
+
function Oe(e, t, r, i) {
|
|
470
|
+
const n = {}, o = { ...i || {} }, s = {};
|
|
465
471
|
for (const [a, f] of Object.entries(e)) {
|
|
466
|
-
const { value:
|
|
472
|
+
const { value: p, modifiers: h, arg: C } = f;
|
|
467
473
|
if (a === "model" || a.startsWith("model:")) {
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
typeof
|
|
471
|
-
|
|
474
|
+
const u = a.split(":"), c = u.length > 1 ? u[1] : C;
|
|
475
|
+
Fe(
|
|
476
|
+
typeof p == "string" ? p : String(p),
|
|
477
|
+
h,
|
|
472
478
|
n,
|
|
473
|
-
s,
|
|
474
479
|
o,
|
|
480
|
+
s,
|
|
475
481
|
t,
|
|
476
482
|
r,
|
|
477
|
-
|
|
483
|
+
c
|
|
478
484
|
);
|
|
479
485
|
continue;
|
|
480
486
|
}
|
|
481
487
|
switch (a) {
|
|
482
488
|
case "bind":
|
|
483
|
-
|
|
489
|
+
Ke(p, n, o, t);
|
|
484
490
|
break;
|
|
485
491
|
case "show":
|
|
486
|
-
|
|
492
|
+
Je(p, o, t);
|
|
487
493
|
break;
|
|
488
494
|
case "class":
|
|
489
|
-
|
|
495
|
+
Ge(p, o, t);
|
|
490
496
|
break;
|
|
491
497
|
case "style":
|
|
492
|
-
|
|
498
|
+
Ze(p, o, t);
|
|
493
499
|
break;
|
|
494
500
|
}
|
|
495
501
|
}
|
|
496
|
-
return { props: n, attrs:
|
|
502
|
+
return { props: n, attrs: o, listeners: s };
|
|
497
503
|
}
|
|
498
|
-
function
|
|
504
|
+
function _e(e, t) {
|
|
499
505
|
if (Array.isArray(e)) {
|
|
500
|
-
const
|
|
501
|
-
return e.map((
|
|
502
|
-
if (!
|
|
503
|
-
let a =
|
|
506
|
+
const o = /* @__PURE__ */ new Set();
|
|
507
|
+
return e.map((s) => {
|
|
508
|
+
if (!s || typeof s != "object") return s;
|
|
509
|
+
let a = s.props?.key ?? s.key;
|
|
504
510
|
if (!a) {
|
|
505
|
-
const
|
|
506
|
-
|
|
511
|
+
const C = s.tag || "node", c = [
|
|
512
|
+
// attrs (kebab-case)
|
|
513
|
+
s.props?.attrs?.id,
|
|
514
|
+
s.props?.attrs?.name,
|
|
515
|
+
s.props?.attrs?.["data-key"],
|
|
516
|
+
// promoted JS props (camelCase or original)
|
|
517
|
+
s.props?.props?.id,
|
|
518
|
+
s.props?.props?.name,
|
|
519
|
+
s.props?.props?.dataKey,
|
|
520
|
+
s.props?.props?.["data-key"]
|
|
521
|
+
].find((w) => w != null) ?? "";
|
|
522
|
+
a = c ? `${t}:${C}:${c}` : `${t}:${C}`;
|
|
507
523
|
}
|
|
508
|
-
let f = a,
|
|
509
|
-
for (;
|
|
510
|
-
f = `${a}#${
|
|
511
|
-
|
|
512
|
-
let
|
|
513
|
-
return Array.isArray(
|
|
524
|
+
let f = a, p = 1;
|
|
525
|
+
for (; o.has(f); )
|
|
526
|
+
f = `${a}#${p++}`;
|
|
527
|
+
o.add(f);
|
|
528
|
+
let h = s.children;
|
|
529
|
+
return Array.isArray(h) && (h = _e(h, f)), { ...s, key: f, children: h };
|
|
514
530
|
});
|
|
515
531
|
}
|
|
516
532
|
const r = e;
|
|
517
533
|
let i = r.props?.key ?? r.key ?? t, n = r.children;
|
|
518
|
-
return Array.isArray(n) && (n =
|
|
534
|
+
return Array.isArray(n) && (n = _e(n, i)), { ...r, key: i, children: n };
|
|
519
535
|
}
|
|
520
|
-
function
|
|
521
|
-
const n = r.directives ?? {},
|
|
536
|
+
function Se(e, t, r, i) {
|
|
537
|
+
const n = r.directives ?? {}, o = Oe(
|
|
522
538
|
n,
|
|
523
539
|
i,
|
|
524
540
|
e,
|
|
525
541
|
r.attrs
|
|
526
|
-
),
|
|
542
|
+
), s = {
|
|
527
543
|
...t.props,
|
|
528
544
|
...r.props,
|
|
529
|
-
...
|
|
545
|
+
...o.props
|
|
530
546
|
}, a = {
|
|
531
547
|
...t.attrs,
|
|
532
548
|
...r.attrs,
|
|
533
|
-
...
|
|
534
|
-
}, f = t.props ?? {},
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
549
|
+
...o.attrs
|
|
550
|
+
}, f = t.props ?? {}, p = s, h = r?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
551
|
+
let C = !1;
|
|
552
|
+
for (const w in { ...f, ...p }) {
|
|
553
|
+
const v = f[w], d = p[w];
|
|
554
|
+
if (v !== d) {
|
|
555
|
+
if (C = !0, w === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
556
|
+
e.value !== d && (e.value = d ?? "");
|
|
557
|
+
else if (w === "checked" && e instanceof HTMLInputElement)
|
|
558
|
+
e.checked = !!d;
|
|
559
|
+
else if (w.startsWith("on") && typeof d == "function") {
|
|
560
|
+
const g = Me(w);
|
|
561
|
+
typeof v == "function" && e.removeEventListener(g, v), e.addEventListener(g, d);
|
|
562
|
+
} else if (d == null || d === !1)
|
|
563
|
+
e.removeAttribute(w);
|
|
564
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || w in e)
|
|
548
565
|
try {
|
|
549
|
-
e[
|
|
566
|
+
e[w] = d;
|
|
550
567
|
} catch {
|
|
551
568
|
}
|
|
552
569
|
}
|
|
553
570
|
}
|
|
554
|
-
for (const [
|
|
555
|
-
|
|
571
|
+
for (const [w, v] of Object.entries(
|
|
572
|
+
o.listeners || {}
|
|
556
573
|
))
|
|
557
|
-
e.addEventListener(
|
|
558
|
-
const
|
|
559
|
-
for (const
|
|
560
|
-
const
|
|
561
|
-
|
|
574
|
+
e.addEventListener(w, v);
|
|
575
|
+
const u = t.attrs ?? {}, c = a;
|
|
576
|
+
for (const w in { ...u, ...c }) {
|
|
577
|
+
const v = u[w], d = c[w];
|
|
578
|
+
if (v !== d)
|
|
579
|
+
if (C = !0, d == null || d === !1) {
|
|
580
|
+
if (e.removeAttribute(w), w === "value") {
|
|
581
|
+
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
582
|
+
try {
|
|
583
|
+
e.value = "";
|
|
584
|
+
} catch {
|
|
585
|
+
}
|
|
586
|
+
else if (e instanceof HTMLSelectElement)
|
|
587
|
+
try {
|
|
588
|
+
e.value = "";
|
|
589
|
+
} catch {
|
|
590
|
+
}
|
|
591
|
+
else if (e instanceof HTMLProgressElement)
|
|
592
|
+
try {
|
|
593
|
+
e.value = 0;
|
|
594
|
+
} catch {
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (w === "checked" && e instanceof HTMLInputElement)
|
|
598
|
+
try {
|
|
599
|
+
e.checked = !1;
|
|
600
|
+
} catch {
|
|
601
|
+
}
|
|
602
|
+
if (w === "disabled")
|
|
603
|
+
try {
|
|
604
|
+
e.disabled = !1;
|
|
605
|
+
} catch {
|
|
606
|
+
}
|
|
607
|
+
} else {
|
|
608
|
+
if (w === "value") {
|
|
609
|
+
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) {
|
|
610
|
+
try {
|
|
611
|
+
e.value = d ?? "";
|
|
612
|
+
} catch {
|
|
613
|
+
e.setAttribute(w, String(d));
|
|
614
|
+
}
|
|
615
|
+
continue;
|
|
616
|
+
} else if (e instanceof HTMLSelectElement) {
|
|
617
|
+
try {
|
|
618
|
+
e.value = d ?? "";
|
|
619
|
+
} catch {
|
|
620
|
+
}
|
|
621
|
+
continue;
|
|
622
|
+
} else if (e instanceof HTMLProgressElement) {
|
|
623
|
+
try {
|
|
624
|
+
e.value = Number(d);
|
|
625
|
+
} catch {
|
|
626
|
+
}
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (w === "checked" && e instanceof HTMLInputElement) {
|
|
631
|
+
try {
|
|
632
|
+
e.checked = !!d;
|
|
633
|
+
} catch {
|
|
634
|
+
}
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
if (!(e.namespaceURI === "http://www.w3.org/2000/svg") && w in e)
|
|
638
|
+
try {
|
|
639
|
+
e[w] = d;
|
|
640
|
+
} catch {
|
|
641
|
+
e.setAttribute(w, String(d));
|
|
642
|
+
}
|
|
643
|
+
else
|
|
644
|
+
e.setAttribute(w, String(d));
|
|
645
|
+
}
|
|
562
646
|
}
|
|
647
|
+
if (h && C)
|
|
648
|
+
try {
|
|
649
|
+
if (typeof e._applyProps == "function")
|
|
650
|
+
try {
|
|
651
|
+
e._applyProps(e._cfg);
|
|
652
|
+
} catch {
|
|
653
|
+
}
|
|
654
|
+
typeof e.requestRender == "function" ? e.requestRender() : typeof e._render == "function" && e._render(e._cfg);
|
|
655
|
+
} catch {
|
|
656
|
+
}
|
|
563
657
|
}
|
|
564
|
-
function
|
|
658
|
+
function D(e, t, r) {
|
|
565
659
|
if (typeof e == "string")
|
|
566
660
|
return document.createTextNode(e);
|
|
567
661
|
if (e.tag === "#text") {
|
|
568
|
-
const
|
|
662
|
+
const u = document.createTextNode(
|
|
569
663
|
typeof e.children == "string" ? e.children : ""
|
|
570
664
|
);
|
|
571
|
-
return e.key != null && (
|
|
665
|
+
return e.key != null && (u.key = e.key), u;
|
|
572
666
|
}
|
|
573
667
|
if (e.tag === "#anchor") {
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
for (const
|
|
579
|
-
const
|
|
580
|
-
|
|
668
|
+
const u = e, c = Array.isArray(u.children) ? u.children : [], w = document.createTextNode(""), v = document.createTextNode("");
|
|
669
|
+
u.key != null && (w.key = `${u.key}:start`, v.key = `${u.key}:end`), u._startNode = w, u._endNode = v;
|
|
670
|
+
const d = document.createDocumentFragment();
|
|
671
|
+
d.appendChild(w);
|
|
672
|
+
for (const g of c) {
|
|
673
|
+
const m = D(g, t);
|
|
674
|
+
d.appendChild(m);
|
|
581
675
|
}
|
|
582
|
-
return
|
|
676
|
+
return d.appendChild(v), d;
|
|
583
677
|
}
|
|
584
678
|
const i = document.createElement(e.tag);
|
|
585
679
|
e.key != null && (i.key = e.key);
|
|
586
|
-
const { props: n = {}, attrs:
|
|
680
|
+
const { props: n = {}, attrs: o = {}, directives: s = {} } = e.props ?? {}, a = Oe(s, t, i, o), f = {
|
|
587
681
|
...n,
|
|
588
682
|
...a.props
|
|
589
|
-
},
|
|
590
|
-
...
|
|
683
|
+
}, p = {
|
|
684
|
+
...o,
|
|
591
685
|
...a.attrs
|
|
592
|
-
};
|
|
593
|
-
for (const
|
|
594
|
-
const c = u
|
|
595
|
-
typeof
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
686
|
+
}, h = i.namespaceURI === "http://www.w3.org/2000/svg";
|
|
687
|
+
for (const u in p) {
|
|
688
|
+
const c = p[u];
|
|
689
|
+
if (!(typeof u != "string" || /\[object Object\]/.test(u))) {
|
|
690
|
+
if (typeof c == "boolean")
|
|
691
|
+
c && i.setAttribute(u, "");
|
|
692
|
+
else if (c != null)
|
|
693
|
+
if (!h && u === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement || i instanceof HTMLProgressElement))
|
|
694
|
+
try {
|
|
695
|
+
i instanceof HTMLProgressElement ? i.value = Number(c) : i.value = c ?? "";
|
|
696
|
+
} catch {
|
|
697
|
+
i.setAttribute(u, String(c));
|
|
698
|
+
}
|
|
699
|
+
else if (!h && u === "checked" && i instanceof HTMLInputElement)
|
|
700
|
+
try {
|
|
701
|
+
i.checked = !!c;
|
|
702
|
+
} catch {
|
|
703
|
+
i.setAttribute(u, String(c));
|
|
704
|
+
}
|
|
705
|
+
else if (!h && u in i)
|
|
706
|
+
try {
|
|
707
|
+
i[u] = c;
|
|
708
|
+
} catch {
|
|
709
|
+
i.setAttribute(u, String(c));
|
|
710
|
+
}
|
|
711
|
+
else
|
|
712
|
+
i.setAttribute(u, String(c));
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
for (const u in f) {
|
|
716
|
+
const c = f[u];
|
|
717
|
+
if (!(typeof u != "string" || /\[object Object\]/.test(u)))
|
|
718
|
+
if (u === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement))
|
|
601
719
|
i.value = c ?? "";
|
|
602
|
-
else if (
|
|
720
|
+
else if (u === "checked" && i instanceof HTMLInputElement)
|
|
603
721
|
i.checked = !!c;
|
|
604
|
-
else if (
|
|
605
|
-
i.addEventListener(
|
|
722
|
+
else if (u.startsWith("on") && typeof c == "function")
|
|
723
|
+
i.addEventListener(Me(u), c);
|
|
606
724
|
else {
|
|
607
|
-
if (
|
|
725
|
+
if (u.startsWith("on") && c === void 0)
|
|
608
726
|
continue;
|
|
609
727
|
if (c == null || c === !1)
|
|
610
|
-
i.removeAttribute(
|
|
611
|
-
else if ((e.props?.isCustomElement ?? !1) ||
|
|
728
|
+
i.removeAttribute(u);
|
|
729
|
+
else if ((e.props?.isCustomElement ?? !1) || u in i)
|
|
612
730
|
try {
|
|
613
|
-
i[
|
|
731
|
+
i[u] = c;
|
|
614
732
|
} catch {
|
|
615
733
|
}
|
|
616
734
|
}
|
|
617
735
|
}
|
|
618
|
-
for (const [
|
|
736
|
+
for (const [u, c] of Object.entries(
|
|
619
737
|
a.listeners || {}
|
|
620
738
|
))
|
|
621
|
-
i.addEventListener(
|
|
622
|
-
const
|
|
623
|
-
typeof e != "string" &&
|
|
739
|
+
i.addEventListener(u, c);
|
|
740
|
+
const C = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
741
|
+
typeof e != "string" && C && r && (r[C] = i);
|
|
624
742
|
try {
|
|
625
743
|
if (typeof i._applyProps == "function")
|
|
626
744
|
try {
|
|
@@ -631,163 +749,177 @@ function M(e, t, r) {
|
|
|
631
749
|
} catch {
|
|
632
750
|
}
|
|
633
751
|
if (Array.isArray(e.children))
|
|
634
|
-
for (const
|
|
635
|
-
i.appendChild(
|
|
752
|
+
for (const u of e.children)
|
|
753
|
+
i.appendChild(D(u, t, r));
|
|
636
754
|
else typeof e.children == "string" && (i.textContent = e.children);
|
|
755
|
+
try {
|
|
756
|
+
if (i instanceof HTMLSelectElement && p && p.hasOwnProperty("value"))
|
|
757
|
+
try {
|
|
758
|
+
i.value = p.value ?? "";
|
|
759
|
+
} catch {
|
|
760
|
+
}
|
|
761
|
+
} catch {
|
|
762
|
+
}
|
|
637
763
|
return i;
|
|
638
764
|
}
|
|
639
|
-
function
|
|
765
|
+
function Ve(e, t, r, i, n) {
|
|
640
766
|
if (typeof r == "string") {
|
|
641
767
|
e.textContent !== r && (e.textContent = r);
|
|
642
768
|
return;
|
|
643
769
|
}
|
|
644
770
|
if (!Array.isArray(r)) return;
|
|
645
|
-
const
|
|
646
|
-
for (const
|
|
647
|
-
|
|
771
|
+
const o = Array.from(e.childNodes), s = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
772
|
+
for (const c of s)
|
|
773
|
+
c && c.key != null && a.set(c.key, c);
|
|
648
774
|
const f = /* @__PURE__ */ new Map();
|
|
649
|
-
for (const
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
}
|
|
653
|
-
const
|
|
654
|
-
let
|
|
655
|
-
function
|
|
656
|
-
let
|
|
657
|
-
for (;
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
function c
|
|
661
|
-
const
|
|
662
|
-
let m =
|
|
663
|
-
for (; m && m !==
|
|
664
|
-
|
|
665
|
-
const x = Array.isArray(
|
|
666
|
-
if (
|
|
667
|
-
const
|
|
668
|
-
for (const
|
|
669
|
-
|
|
670
|
-
for (const
|
|
671
|
-
const
|
|
672
|
-
|
|
775
|
+
for (const c of o) {
|
|
776
|
+
const w = c.key;
|
|
777
|
+
w != null && f.set(w, c);
|
|
778
|
+
}
|
|
779
|
+
const p = /* @__PURE__ */ new Set();
|
|
780
|
+
let h = e.firstChild;
|
|
781
|
+
function C(c, w) {
|
|
782
|
+
let v = c;
|
|
783
|
+
for (; v && (p.add(v), v !== w); )
|
|
784
|
+
v = v.nextSibling;
|
|
785
|
+
}
|
|
786
|
+
function u(c, w, v, d) {
|
|
787
|
+
const g = [];
|
|
788
|
+
let m = c.nextSibling;
|
|
789
|
+
for (; m && m !== w; )
|
|
790
|
+
g.push(m), m = m.nextSibling;
|
|
791
|
+
const x = Array.isArray(v) ? v : [];
|
|
792
|
+
if (d.some((b) => b && b.key != null) || x.some((b) => b && b.key != null)) {
|
|
793
|
+
const b = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
|
|
794
|
+
for (const S of x)
|
|
795
|
+
S && S.key != null && b.set(S.key, S);
|
|
796
|
+
for (const S of g) {
|
|
797
|
+
const A = S.key;
|
|
798
|
+
A != null && y.set(A, S);
|
|
673
799
|
}
|
|
674
800
|
const _ = /* @__PURE__ */ new Set();
|
|
675
|
-
let
|
|
676
|
-
for (const
|
|
677
|
-
let
|
|
678
|
-
if (
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
801
|
+
let E = c.nextSibling;
|
|
802
|
+
for (const S of d) {
|
|
803
|
+
let A;
|
|
804
|
+
if (S.key != null && y.has(S.key)) {
|
|
805
|
+
const $ = b.get(S.key);
|
|
806
|
+
A = le(
|
|
807
|
+
y.get(S.key),
|
|
808
|
+
$,
|
|
809
|
+
S,
|
|
684
810
|
i
|
|
685
|
-
), _.add(
|
|
811
|
+
), _.add(A), A !== E && e.contains(A) && e.insertBefore(A, E);
|
|
686
812
|
} else
|
|
687
|
-
|
|
688
|
-
|
|
813
|
+
A = D(S, i), e.insertBefore(A, E), _.add(A);
|
|
814
|
+
E = A.nextSibling;
|
|
689
815
|
}
|
|
690
|
-
for (const
|
|
691
|
-
!_.has(
|
|
816
|
+
for (const S of g)
|
|
817
|
+
!_.has(S) && e.contains(S) && e.removeChild(S);
|
|
692
818
|
} else {
|
|
693
|
-
const
|
|
819
|
+
const b = Math.min(
|
|
694
820
|
x.length,
|
|
695
|
-
|
|
821
|
+
d.length
|
|
696
822
|
);
|
|
697
|
-
for (let
|
|
698
|
-
const _ = x[
|
|
699
|
-
|
|
823
|
+
for (let y = 0; y < b; y++) {
|
|
824
|
+
const _ = x[y], E = d[y], S = le(g[y], _, E, i);
|
|
825
|
+
S !== g[y] && (e.insertBefore(S, g[y]), e.removeChild(g[y]));
|
|
700
826
|
}
|
|
701
|
-
for (let
|
|
702
|
-
e.insertBefore(
|
|
703
|
-
for (let
|
|
704
|
-
e.removeChild(
|
|
827
|
+
for (let y = b; y < d.length; y++)
|
|
828
|
+
e.insertBefore(D(d[y], i), w);
|
|
829
|
+
for (let y = b; y < g.length; y++)
|
|
830
|
+
e.removeChild(g[y]);
|
|
705
831
|
}
|
|
706
832
|
}
|
|
707
|
-
for (const
|
|
708
|
-
let
|
|
709
|
-
if (
|
|
710
|
-
const
|
|
711
|
-
let m = f.get(
|
|
712
|
-
const l = Array.isArray(
|
|
713
|
-
if (m || (m = document.createTextNode(""), m.key =
|
|
714
|
-
e.insertBefore(m,
|
|
715
|
-
for (const
|
|
716
|
-
e.insertBefore(
|
|
717
|
-
e.insertBefore(x,
|
|
833
|
+
for (const c of r) {
|
|
834
|
+
let w;
|
|
835
|
+
if (c.tag === "#anchor") {
|
|
836
|
+
const v = c.key, d = `${v}:start`, g = `${v}:end`;
|
|
837
|
+
let m = f.get(d), x = f.get(g);
|
|
838
|
+
const l = Array.isArray(c.children) ? c.children : [];
|
|
839
|
+
if (m || (m = document.createTextNode(""), m.key = d), x || (x = document.createTextNode(""), x.key = g), c._startNode = m, c._endNode = x, !e.contains(m) || !e.contains(x)) {
|
|
840
|
+
e.insertBefore(m, h);
|
|
841
|
+
for (const b of l)
|
|
842
|
+
e.insertBefore(D(b, i), h);
|
|
843
|
+
e.insertBefore(x, h);
|
|
718
844
|
} else
|
|
719
|
-
|
|
845
|
+
u(
|
|
720
846
|
m,
|
|
721
847
|
x,
|
|
722
|
-
a.get(
|
|
848
|
+
a.get(v)?.children,
|
|
723
849
|
l
|
|
724
850
|
);
|
|
725
|
-
|
|
851
|
+
C(m, x), h = x.nextSibling;
|
|
726
852
|
continue;
|
|
727
853
|
}
|
|
728
|
-
if (
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
f.get(
|
|
732
|
-
|
|
733
|
-
|
|
854
|
+
if (c.key != null && f.has(c.key)) {
|
|
855
|
+
const v = a.get(c.key);
|
|
856
|
+
w = le(
|
|
857
|
+
f.get(c.key),
|
|
858
|
+
v,
|
|
859
|
+
c,
|
|
734
860
|
i,
|
|
735
861
|
n
|
|
736
|
-
),
|
|
862
|
+
), p.add(w), w !== h && e.contains(w) && (h && !e.contains(h) && (h = null), e.insertBefore(w, h));
|
|
737
863
|
} else
|
|
738
|
-
|
|
739
|
-
|
|
864
|
+
w = D(c, i, n), h && !e.contains(h) && (h = null), e.insertBefore(w, h), p.add(w);
|
|
865
|
+
h = w.nextSibling;
|
|
740
866
|
}
|
|
741
|
-
for (const
|
|
742
|
-
!
|
|
867
|
+
for (const c of o)
|
|
868
|
+
!p.has(c) && e.contains(c) && (V(c, n), e.removeChild(c));
|
|
743
869
|
}
|
|
744
|
-
function
|
|
870
|
+
function le(e, t, r, i, n) {
|
|
745
871
|
if (t && typeof t != "string" && t.props?.ref && n && V(e, n), t === r) return e;
|
|
746
872
|
if (typeof r == "string") {
|
|
747
873
|
if (e.nodeType === Node.TEXT_NODE)
|
|
748
874
|
return e.textContent !== r && (e.textContent = r), e;
|
|
749
875
|
{
|
|
750
|
-
const
|
|
751
|
-
return e.parentNode?.replaceChild(
|
|
876
|
+
const s = document.createTextNode(r);
|
|
877
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
752
878
|
}
|
|
753
879
|
}
|
|
754
880
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
for (const
|
|
760
|
-
const
|
|
761
|
-
|
|
881
|
+
const s = r, a = Array.isArray(s.children) ? s.children : [], f = s._startNode ?? document.createTextNode(""), p = s._endNode ?? document.createTextNode("");
|
|
882
|
+
s.key != null && (f.key = `${s.key}:start`, p.key = `${s.key}:end`), s._startNode = f, s._endNode = p;
|
|
883
|
+
const h = document.createDocumentFragment();
|
|
884
|
+
h.appendChild(f);
|
|
885
|
+
for (const C of a) {
|
|
886
|
+
const u = D(C, i);
|
|
887
|
+
h.appendChild(u);
|
|
762
888
|
}
|
|
763
|
-
return
|
|
889
|
+
return h.appendChild(p), e.parentNode?.replaceChild(h, e), f;
|
|
764
890
|
}
|
|
765
891
|
if (!r) {
|
|
766
892
|
V(e, n);
|
|
767
|
-
const
|
|
768
|
-
return e.parentNode?.replaceChild(
|
|
893
|
+
const s = document.createComment("removed");
|
|
894
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
769
895
|
}
|
|
770
896
|
if (!t || typeof t == "string") {
|
|
771
897
|
V(e, n);
|
|
772
|
-
const
|
|
773
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
898
|
+
const s = D(r, i, n);
|
|
899
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
774
900
|
}
|
|
775
901
|
if (r.tag === "#anchor") {
|
|
776
|
-
const
|
|
902
|
+
const s = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), f = r._endNode ?? document.createTextNode("");
|
|
777
903
|
r.key != null && (a.key = `${r.key}:start`, f.key = `${r.key}:end`), r._startNode = a, r._endNode = f;
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
for (const
|
|
781
|
-
|
|
782
|
-
return
|
|
904
|
+
const p = document.createDocumentFragment();
|
|
905
|
+
p.appendChild(a);
|
|
906
|
+
for (const h of s)
|
|
907
|
+
p.appendChild(D(h, i));
|
|
908
|
+
return p.appendChild(f), e.parentNode?.replaceChild(p, e), a;
|
|
783
909
|
}
|
|
784
910
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
785
|
-
const
|
|
786
|
-
return
|
|
911
|
+
const s = e;
|
|
912
|
+
return Se(s, t.props || {}, r.props || {}, i), Ve(s, t.children, r.children, i, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), s;
|
|
787
913
|
}
|
|
914
|
+
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && (t.tag && String(t.tag).includes("-") || r.props && r.props.isCustomElement || t.props && t.props.isCustomElement))
|
|
915
|
+
try {
|
|
916
|
+
const a = e;
|
|
917
|
+
return Se(a, t.props || {}, r.props || {}, i), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = a), a;
|
|
918
|
+
} catch {
|
|
919
|
+
}
|
|
788
920
|
V(e, n);
|
|
789
|
-
const
|
|
790
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
921
|
+
const o = D(r, i, n);
|
|
922
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), e.parentNode?.replaceChild(o, e), o;
|
|
791
923
|
}
|
|
792
924
|
function Ye(e, t, r, i) {
|
|
793
925
|
let n;
|
|
@@ -796,31 +928,31 @@ function Ye(e, t, r, i) {
|
|
|
796
928
|
key: "__anchor_root__",
|
|
797
929
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
798
930
|
children: [n]
|
|
799
|
-
}), n =
|
|
800
|
-
const
|
|
931
|
+
}), n = _e(n, String(n.key ?? "root"));
|
|
932
|
+
const o = e._prevVNode ?? null, s = e._prevDom ?? e.firstChild ?? null;
|
|
801
933
|
let a;
|
|
802
|
-
|
|
934
|
+
o && s ? typeof o != "string" && typeof n != "string" && o.tag === n.tag && o.key === n.key ? a = le(s, o, n, r, i) : (a = D(n, r, i), e.replaceChild(a, s)) : (a = D(n, r, i), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
803
935
|
const f = [];
|
|
804
|
-
for (let
|
|
805
|
-
const
|
|
806
|
-
|
|
936
|
+
for (let p = 0; p < e.childNodes.length; p++) {
|
|
937
|
+
const h = e.childNodes[p];
|
|
938
|
+
h !== a && h.nodeName !== "STYLE" && (V(h, i), f.push(h));
|
|
807
939
|
}
|
|
808
|
-
f.forEach((
|
|
940
|
+
f.forEach((p) => e.removeChild(p)), e._prevVNode = n, e._prevDom = a;
|
|
809
941
|
}
|
|
810
|
-
function
|
|
811
|
-
if (typeof e == "string") return
|
|
942
|
+
function ge(e) {
|
|
943
|
+
if (typeof e == "string") return J(e);
|
|
812
944
|
if (e.tag === "#text")
|
|
813
|
-
return typeof e.children == "string" ?
|
|
945
|
+
return typeof e.children == "string" ? J(e.children) : "";
|
|
814
946
|
if (e.tag === "#anchor")
|
|
815
|
-
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(
|
|
947
|
+
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(ge).join("");
|
|
816
948
|
let t = "";
|
|
817
|
-
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n,
|
|
949
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, o]) => ` ${n}="${J(String(o))}"`).join(""));
|
|
818
950
|
let r = "";
|
|
819
|
-
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n,
|
|
820
|
-
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(
|
|
951
|
+
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, o]) => ` ${n}="${J(String(o))}"`).join(""));
|
|
952
|
+
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(ge).join("") : typeof e.children == "string" ? J(e.children) : e.children ? ge(e.children) : "";
|
|
821
953
|
return `<${e.tag}${t}${r}>${i}</${e.tag}>`;
|
|
822
954
|
}
|
|
823
|
-
function
|
|
955
|
+
function Pe(e, ...t) {
|
|
824
956
|
let r = "";
|
|
825
957
|
for (let i = 0; i < e.length; i++)
|
|
826
958
|
r += e[i], i < t.length && (r += t[i]);
|
|
@@ -829,14 +961,14 @@ function Oe(e, ...t) {
|
|
|
829
961
|
function Be(e) {
|
|
830
962
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
831
963
|
}
|
|
832
|
-
let
|
|
833
|
-
function
|
|
834
|
-
return
|
|
964
|
+
let oe = null;
|
|
965
|
+
function Ee() {
|
|
966
|
+
return oe || (oe = new CSSStyleSheet(), oe.replaceSync(Be(Xe))), oe;
|
|
835
967
|
}
|
|
836
|
-
function
|
|
968
|
+
function Qe(e) {
|
|
837
969
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
838
970
|
}
|
|
839
|
-
const
|
|
971
|
+
const Xe = Pe`
|
|
840
972
|
:host, *, ::before, ::after {
|
|
841
973
|
all: isolate;
|
|
842
974
|
box-sizing: border-box;
|
|
@@ -894,7 +1026,7 @@ const Qe = Oe`
|
|
|
894
1026
|
sup { top: -.5em }
|
|
895
1027
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
896
1028
|
[hidden] { display: none }
|
|
897
|
-
`,
|
|
1029
|
+
`, et = {
|
|
898
1030
|
neutral: {
|
|
899
1031
|
50: "#fafafa",
|
|
900
1032
|
100: "#f4f4f5",
|
|
@@ -990,8 +1122,8 @@ const Qe = Oe`
|
|
|
990
1122
|
black: { DEFAULT: "#000000" },
|
|
991
1123
|
transparent: { DEFAULT: "transparent" },
|
|
992
1124
|
current: { DEFAULT: "currentColor" }
|
|
993
|
-
},
|
|
994
|
-
Object.entries(
|
|
1125
|
+
}, tt = Object.fromEntries(
|
|
1126
|
+
Object.entries(et).map(([e, t]) => [
|
|
995
1127
|
e,
|
|
996
1128
|
Object.fromEntries(
|
|
997
1129
|
Object.entries(t).map(([r, i]) => [
|
|
@@ -1000,7 +1132,7 @@ const Qe = Oe`
|
|
|
1000
1132
|
])
|
|
1001
1133
|
)
|
|
1002
1134
|
])
|
|
1003
|
-
),
|
|
1135
|
+
), me = {
|
|
1004
1136
|
/* Display */
|
|
1005
1137
|
block: "display:block;",
|
|
1006
1138
|
inline: "display:inline;",
|
|
@@ -1215,7 +1347,7 @@ const Qe = Oe`
|
|
|
1215
1347
|
"z-30": "z-index:30;",
|
|
1216
1348
|
"z-40": "z-index:40;",
|
|
1217
1349
|
"z-50": "z-index:50;"
|
|
1218
|
-
},
|
|
1350
|
+
}, rt = "0.25rem", Ce = {
|
|
1219
1351
|
m: ["margin"],
|
|
1220
1352
|
mx: ["margin-inline"],
|
|
1221
1353
|
my: ["margin-block"],
|
|
@@ -1250,17 +1382,17 @@ const Qe = Oe`
|
|
|
1250
1382
|
function N(e, t) {
|
|
1251
1383
|
let r = 0, i = 0;
|
|
1252
1384
|
for (let n = 0; n < e.length; n++) {
|
|
1253
|
-
const
|
|
1254
|
-
if (
|
|
1255
|
-
else if (
|
|
1256
|
-
else if (
|
|
1257
|
-
else if (
|
|
1258
|
-
else if (r === 0 && i === 0 && (
|
|
1385
|
+
const o = e[n];
|
|
1386
|
+
if (o === "[") r++;
|
|
1387
|
+
else if (o === "]" && r > 0) r--;
|
|
1388
|
+
else if (o === "(") i++;
|
|
1389
|
+
else if (o === ")" && i > 0) i--;
|
|
1390
|
+
else if (r === 0 && i === 0 && (o === ">" || o === "+" || o === "~" || o === " "))
|
|
1259
1391
|
return e.slice(0, n) + t + e.slice(n);
|
|
1260
1392
|
}
|
|
1261
1393
|
return e + t;
|
|
1262
1394
|
}
|
|
1263
|
-
const
|
|
1395
|
+
const nt = {
|
|
1264
1396
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1265
1397
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1266
1398
|
hover: (e, t) => `${N(e, ":hover")}{${t}}`,
|
|
@@ -1283,7 +1415,7 @@ const rt = {
|
|
|
1283
1415
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1284
1416
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1285
1417
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1286
|
-
},
|
|
1418
|
+
}, ye = {
|
|
1287
1419
|
// Responsive
|
|
1288
1420
|
sm: "(min-width:640px)",
|
|
1289
1421
|
md: "(min-width:768px)",
|
|
@@ -1292,25 +1424,25 @@ const rt = {
|
|
|
1292
1424
|
"2xl": "(min-width:1536px)",
|
|
1293
1425
|
// Dark mode (now plain string)
|
|
1294
1426
|
dark: "(prefers-color-scheme: dark)"
|
|
1295
|
-
},
|
|
1296
|
-
function
|
|
1427
|
+
}, be = ["sm", "md", "lg", "xl", "2xl"];
|
|
1428
|
+
function we(e) {
|
|
1297
1429
|
const t = e.startsWith("-"), i = (t ? e.slice(1) : e).split("-");
|
|
1298
1430
|
if (i.length < 2) return null;
|
|
1299
|
-
const n = i.slice(0, -1).join("-"),
|
|
1300
|
-
if (Number.isNaN(
|
|
1431
|
+
const n = i.slice(0, -1).join("-"), o = i[i.length - 1], s = parseFloat(o);
|
|
1432
|
+
if (Number.isNaN(s) || !Ce[n]) return null;
|
|
1301
1433
|
const a = t ? "-" : "";
|
|
1302
|
-
return
|
|
1434
|
+
return Ce[n].map((f) => `${f}:calc(${a}${rt} * ${s});`).join("");
|
|
1303
1435
|
}
|
|
1304
|
-
function
|
|
1305
|
-
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255,
|
|
1306
|
-
return `${i} ${n} ${
|
|
1436
|
+
function Ae(e) {
|
|
1437
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255, o = r & 255;
|
|
1438
|
+
return `${i} ${n} ${o}`;
|
|
1307
1439
|
}
|
|
1308
|
-
function
|
|
1440
|
+
function it(e) {
|
|
1309
1441
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1310
1442
|
if (!t) return null;
|
|
1311
|
-
const [, r, i, n = "DEFAULT"] = t,
|
|
1312
|
-
if (!
|
|
1313
|
-
if (r === "shadow") return `--ce-shadow-color:${
|
|
1443
|
+
const [, r, i, n = "DEFAULT"] = t, o = tt[i]?.[n];
|
|
1444
|
+
if (!o) return null;
|
|
1445
|
+
if (r === "shadow") return `--ce-shadow-color:${o};`;
|
|
1314
1446
|
const a = {
|
|
1315
1447
|
bg: "background-color",
|
|
1316
1448
|
decoration: "text-decoration-color",
|
|
@@ -1322,49 +1454,49 @@ function nt(e) {
|
|
|
1322
1454
|
fill: "fill",
|
|
1323
1455
|
stroke: "stroke"
|
|
1324
1456
|
}[r];
|
|
1325
|
-
return a ? `${a}:${
|
|
1457
|
+
return a ? `${a}:${o};` : null;
|
|
1326
1458
|
}
|
|
1327
|
-
function
|
|
1459
|
+
function st(e) {
|
|
1328
1460
|
const [t, r] = e.split("/");
|
|
1329
1461
|
if (!r) return { base: t };
|
|
1330
1462
|
const i = parseInt(r, 10);
|
|
1331
1463
|
return isNaN(i) || i < 0 || i > 100 ? { base: t } : { base: t, opacity: i / 100 };
|
|
1332
1464
|
}
|
|
1333
|
-
function
|
|
1334
|
-
const { base: t, opacity: r } =
|
|
1465
|
+
function xe(e) {
|
|
1466
|
+
const { base: t, opacity: r } = st(e), i = it(t);
|
|
1335
1467
|
if (i) {
|
|
1336
1468
|
if (r !== void 0) {
|
|
1337
|
-
const
|
|
1338
|
-
if (
|
|
1339
|
-
const
|
|
1340
|
-
return i.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1469
|
+
const o = /#([0-9a-f]{6})/i.exec(i);
|
|
1470
|
+
if (o) {
|
|
1471
|
+
const s = Ae(o[0]);
|
|
1472
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${s} / ${r})`);
|
|
1341
1473
|
}
|
|
1342
1474
|
}
|
|
1343
1475
|
return i;
|
|
1344
1476
|
}
|
|
1345
|
-
const n =
|
|
1477
|
+
const n = fe(t);
|
|
1346
1478
|
if (n && r !== void 0) {
|
|
1347
|
-
const
|
|
1348
|
-
if (
|
|
1349
|
-
const
|
|
1350
|
-
return n.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1479
|
+
const o = /#([0-9a-f]{6})/i.exec(n);
|
|
1480
|
+
if (o) {
|
|
1481
|
+
const s = Ae(o[0]);
|
|
1482
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${s} / ${r})`);
|
|
1351
1483
|
}
|
|
1352
1484
|
}
|
|
1353
1485
|
return n;
|
|
1354
1486
|
}
|
|
1355
|
-
function
|
|
1487
|
+
function ve(e) {
|
|
1356
1488
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
1357
1489
|
if (!t) return null;
|
|
1358
1490
|
const r = parseInt(t[1], 10);
|
|
1359
1491
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1360
1492
|
}
|
|
1361
|
-
function
|
|
1493
|
+
function fe(e) {
|
|
1362
1494
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1363
1495
|
const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1364
1496
|
if (n) {
|
|
1365
|
-
const
|
|
1366
|
-
let
|
|
1367
|
-
return
|
|
1497
|
+
const o = n[1].trim();
|
|
1498
|
+
let s = n[2].trim();
|
|
1499
|
+
return s = s.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), s = s.replace(/^'([^']*)'$/g, '"$1"'), `${o}:${s};`;
|
|
1368
1500
|
}
|
|
1369
1501
|
return null;
|
|
1370
1502
|
}
|
|
@@ -1373,7 +1505,7 @@ function ce(e) {
|
|
|
1373
1505
|
const i = e.slice(0, t);
|
|
1374
1506
|
let n = e.slice(t + 2, -1);
|
|
1375
1507
|
n = n.replace(/_/g, " ");
|
|
1376
|
-
const
|
|
1508
|
+
const o = {
|
|
1377
1509
|
bg: "background-color",
|
|
1378
1510
|
text: "color",
|
|
1379
1511
|
shadow: "box-shadow",
|
|
@@ -1417,12 +1549,12 @@ function ce(e) {
|
|
|
1417
1549
|
};
|
|
1418
1550
|
if (i === "rotate")
|
|
1419
1551
|
return `transform:rotate(${n});`;
|
|
1420
|
-
const
|
|
1421
|
-
if (
|
|
1552
|
+
const s = o[i] ?? i.replace(/_/g, "-");
|
|
1553
|
+
if (s && n) return `${s}:${n};`;
|
|
1422
1554
|
}
|
|
1423
1555
|
return null;
|
|
1424
1556
|
}
|
|
1425
|
-
function
|
|
1557
|
+
function ot(e) {
|
|
1426
1558
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1427
1559
|
const r = e.slice(1, -1);
|
|
1428
1560
|
return r.includes("&") ? r : e;
|
|
@@ -1434,10 +1566,10 @@ function st(e) {
|
|
|
1434
1566
|
}
|
|
1435
1567
|
return null;
|
|
1436
1568
|
}
|
|
1437
|
-
function
|
|
1569
|
+
function at(e) {
|
|
1438
1570
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1439
1571
|
}
|
|
1440
|
-
function
|
|
1572
|
+
function ct(e) {
|
|
1441
1573
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1442
1574
|
let i;
|
|
1443
1575
|
for (; i = t.exec(e); ) {
|
|
@@ -1446,32 +1578,32 @@ function at(e) {
|
|
|
1446
1578
|
}
|
|
1447
1579
|
return r.filter(Boolean);
|
|
1448
1580
|
}
|
|
1449
|
-
const
|
|
1450
|
-
function
|
|
1451
|
-
const t = Date.now(), r =
|
|
1452
|
-
if (r && t - r.timestamp <
|
|
1453
|
-
const i =
|
|
1454
|
-
function d
|
|
1455
|
-
const m = (
|
|
1456
|
-
if (m in
|
|
1457
|
-
const x =
|
|
1458
|
-
return
|
|
1459
|
-
}
|
|
1460
|
-
function
|
|
1461
|
-
const
|
|
1462
|
-
return
|
|
1463
|
-
}
|
|
1464
|
-
function
|
|
1465
|
-
const
|
|
1581
|
+
const Te = /* @__PURE__ */ new Map(), lt = 16;
|
|
1582
|
+
function ft(e) {
|
|
1583
|
+
const t = Date.now(), r = Te.get(e);
|
|
1584
|
+
if (r && t - r.timestamp < lt) return r.css;
|
|
1585
|
+
const i = ct(e), n = new Set(i), o = [], s = [], a = [], f = [], p = {};
|
|
1586
|
+
function h(d, g = !1) {
|
|
1587
|
+
const m = (g ? "dark|" : "") + d;
|
|
1588
|
+
if (m in p) return p[m];
|
|
1589
|
+
const x = w(d, g);
|
|
1590
|
+
return p[m] = x, x;
|
|
1591
|
+
}
|
|
1592
|
+
function C(d) {
|
|
1593
|
+
const g = d.some((x) => be.includes(x)), m = d.includes("dark");
|
|
1594
|
+
return d.length === 0 ? 1 : !g && !m ? 2 : g && !m ? 3 : 4;
|
|
1595
|
+
}
|
|
1596
|
+
function u(d) {
|
|
1597
|
+
const g = [];
|
|
1466
1598
|
let m = "", x = 0, l = 0;
|
|
1467
|
-
for (let
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1599
|
+
for (let b = 0; b < d.length; b++) {
|
|
1600
|
+
const y = d[b];
|
|
1601
|
+
y === "[" ? x++ : y === "]" && x > 0 ? x-- : y === "(" ? l++ : y === ")" && l > 0 && l--, y === ":" && x === 0 && l === 0 ? (g.push(m), m = "") : m += y;
|
|
1470
1602
|
}
|
|
1471
|
-
return m &&
|
|
1603
|
+
return m && g.push(m), g;
|
|
1472
1604
|
}
|
|
1473
|
-
function
|
|
1474
|
-
switch (
|
|
1605
|
+
function c(d) {
|
|
1606
|
+
switch (d) {
|
|
1475
1607
|
case "hover":
|
|
1476
1608
|
return ":hover";
|
|
1477
1609
|
case "focus":
|
|
@@ -1500,124 +1632,124 @@ function lt(e) {
|
|
|
1500
1632
|
return null;
|
|
1501
1633
|
}
|
|
1502
1634
|
}
|
|
1503
|
-
function
|
|
1504
|
-
const m =
|
|
1635
|
+
function w(d, g = !1) {
|
|
1636
|
+
const m = u(d);
|
|
1505
1637
|
let x = !1;
|
|
1506
|
-
const l = m.find((
|
|
1638
|
+
const l = m.find((k) => (k.startsWith("!") && (x = !0, k = k.slice(1)), me[k] || we(k) || ve(k) || xe(k) || fe(k)));
|
|
1507
1639
|
if (!l) return null;
|
|
1508
|
-
const
|
|
1509
|
-
if (!
|
|
1640
|
+
const b = l.replace(/^!/, ""), y = me[b] ?? we(b) ?? ve(b) ?? xe(b) ?? fe(b);
|
|
1641
|
+
if (!y) return null;
|
|
1510
1642
|
const _ = m.indexOf(l);
|
|
1511
|
-
let
|
|
1512
|
-
|
|
1513
|
-
const
|
|
1514
|
-
let
|
|
1515
|
-
const
|
|
1516
|
-
for (const
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
const
|
|
1520
|
-
let
|
|
1521
|
-
for (const
|
|
1522
|
-
if (
|
|
1523
|
-
const
|
|
1524
|
-
if (
|
|
1525
|
-
|
|
1643
|
+
let E = _ >= 0 ? m.slice(0, _) : [];
|
|
1644
|
+
g && (E = E.filter((k) => k !== "dark"));
|
|
1645
|
+
const S = `.${at(d)}`, A = "__SUBJECT__", $ = x ? y.replace(/;$/, " !important;") : y;
|
|
1646
|
+
let T = A;
|
|
1647
|
+
const B = [];
|
|
1648
|
+
for (const k of E)
|
|
1649
|
+
k.startsWith("group-") ? (T = `.group:${k.slice(6)} ${T}`, B.push(k)) : k.startsWith("peer-") && (T = T.replace(A, `.peer:${k.slice(5)}~${A}`), B.push(k));
|
|
1650
|
+
E = E.filter((k) => !B.includes(k));
|
|
1651
|
+
const G = [], ee = [];
|
|
1652
|
+
let M = null;
|
|
1653
|
+
for (const k of E) {
|
|
1654
|
+
if (k === "dark" || be.includes(k)) continue;
|
|
1655
|
+
const P = ot(k);
|
|
1656
|
+
if (P) {
|
|
1657
|
+
M = P;
|
|
1526
1658
|
continue;
|
|
1527
1659
|
}
|
|
1528
|
-
const
|
|
1529
|
-
if (
|
|
1530
|
-
|
|
1660
|
+
const R = c(k);
|
|
1661
|
+
if (R) {
|
|
1662
|
+
M ? ee.push(R) : G.push(R);
|
|
1531
1663
|
continue;
|
|
1532
1664
|
}
|
|
1533
|
-
const
|
|
1534
|
-
typeof
|
|
1665
|
+
const O = nt[k];
|
|
1666
|
+
typeof O == "function" && (T = O(T, $).split("{")[0]);
|
|
1535
1667
|
}
|
|
1536
|
-
function
|
|
1537
|
-
if (!
|
|
1538
|
-
let
|
|
1539
|
-
if (
|
|
1540
|
-
let
|
|
1541
|
-
for (;
|
|
1542
|
-
for (;
|
|
1543
|
-
const
|
|
1544
|
-
if (
|
|
1545
|
-
return
|
|
1668
|
+
function U(k, P) {
|
|
1669
|
+
if (!P) return k;
|
|
1670
|
+
let R = 0, O = 0;
|
|
1671
|
+
if (k.length && (k[0] === ">" || k[0] === "+" || k[0] === "~" || k[0] === " ")) {
|
|
1672
|
+
let j = 1;
|
|
1673
|
+
for (; j < k.length && k[j] === " "; ) j++;
|
|
1674
|
+
for (; j < k.length; j++) {
|
|
1675
|
+
const L = k[j];
|
|
1676
|
+
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? O++ : L === ")" && O > 0 && O--, R === 0 && O === 0 && (k[j] === ">" || k[j] === "+" || k[j] === "~" || k[j] === " "))
|
|
1677
|
+
return k.slice(0, j) + P + k.slice(j);
|
|
1546
1678
|
}
|
|
1547
|
-
return
|
|
1679
|
+
return k + P;
|
|
1548
1680
|
}
|
|
1549
|
-
for (let
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
return
|
|
1681
|
+
for (let j = 0; j < k.length; j++) {
|
|
1682
|
+
const L = k[j];
|
|
1683
|
+
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? O++ : L === ")" && O > 0 && O--, R === 0 && O === 0 && (L === ">" || L === "+" || L === "~" || L === " "))
|
|
1684
|
+
return k.slice(0, j) + P + k.slice(j);
|
|
1553
1685
|
}
|
|
1554
|
-
return
|
|
1686
|
+
return k + P;
|
|
1555
1687
|
}
|
|
1556
|
-
const
|
|
1557
|
-
if (
|
|
1558
|
-
if (
|
|
1559
|
-
const
|
|
1560
|
-
if (
|
|
1561
|
-
|
|
1688
|
+
const q = G.join(""), I = ee.join("");
|
|
1689
|
+
if (M)
|
|
1690
|
+
if (M.includes("&")) {
|
|
1691
|
+
const k = M.indexOf("&"), P = M.slice(0, k), R = M.slice(k + 1), O = A + q, j = T;
|
|
1692
|
+
if (G.length === 0)
|
|
1693
|
+
T = j.replace(A, P + O + I + R);
|
|
1562
1694
|
else {
|
|
1563
|
-
const
|
|
1564
|
-
|
|
1695
|
+
const L = U(R, I);
|
|
1696
|
+
T = j.replace(A, P + O + L);
|
|
1565
1697
|
}
|
|
1566
1698
|
} else
|
|
1567
|
-
|
|
1699
|
+
T = T.replace(A, `${M}${A + q}`), I && (T = T.replace(A, `${A}${I}`));
|
|
1568
1700
|
else
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
let
|
|
1572
|
-
const
|
|
1573
|
-
return
|
|
1574
|
-
}
|
|
1575
|
-
for (const
|
|
1576
|
-
const
|
|
1577
|
-
(
|
|
1701
|
+
T = A + q + I;
|
|
1702
|
+
T = T.replace(new RegExp(A, "g"), S);
|
|
1703
|
+
let z = `${T}{${$}}`;
|
|
1704
|
+
const H = E.filter((k) => be.includes(k)), F = H.length ? H[H.length - 1] : null, te = E.includes("dark");
|
|
1705
|
+
return g && F ? z = `@media (prefers-color-scheme: dark) and ${ye[F]}{${z}}` : g ? z = `@media (prefers-color-scheme: dark){${z}}` : te && F ? z = `@media (prefers-color-scheme: dark) and ${ye[F]}{${z}}` : te ? z = `@media (prefers-color-scheme: dark){${z}}` : F && (z = `@media ${ye[F]}{${z}}`), z;
|
|
1706
|
+
}
|
|
1707
|
+
for (const d of n) {
|
|
1708
|
+
const g = u(d), m = g.find(
|
|
1709
|
+
(y) => me[y] || we(y) || ve(y) || xe(y) || fe(y)
|
|
1578
1710
|
);
|
|
1579
1711
|
if (!m) continue;
|
|
1580
|
-
const x =
|
|
1581
|
-
if (
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1712
|
+
const x = g.indexOf(m), l = x >= 0 ? g.slice(0, x) : [], b = C(l);
|
|
1713
|
+
if (b === 4) {
|
|
1714
|
+
const y = h(d, !0);
|
|
1715
|
+
y && f.push(y);
|
|
1584
1716
|
} else {
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1717
|
+
const y = h(d);
|
|
1718
|
+
y && (b === 1 ? o.push(y) : b === 2 ? s.push(y) : b === 3 && a.push(y));
|
|
1587
1719
|
}
|
|
1588
1720
|
}
|
|
1589
|
-
const
|
|
1590
|
-
return
|
|
1721
|
+
const v = [...o, ...s, ...a, ...f].join("");
|
|
1722
|
+
return Te.set(e, { css: v, timestamp: t }), v;
|
|
1591
1723
|
}
|
|
1592
|
-
const
|
|
1593
|
-
function
|
|
1724
|
+
const ne = [];
|
|
1725
|
+
function ut(e, t, r, i, n, o, s, a) {
|
|
1594
1726
|
if (e) {
|
|
1595
|
-
|
|
1727
|
+
ne.push(r);
|
|
1596
1728
|
try {
|
|
1597
1729
|
if (t.loadingTemplate && r.isLoading) {
|
|
1598
|
-
|
|
1730
|
+
Q(e, t.loadingTemplate(r), r, i, n);
|
|
1599
1731
|
return;
|
|
1600
1732
|
}
|
|
1601
1733
|
if (t.errorTemplate && r.hasError) {
|
|
1602
|
-
r.error instanceof Error &&
|
|
1734
|
+
r.error instanceof Error && Q(e, t.errorTemplate(r.error, r), r, i, n);
|
|
1603
1735
|
return;
|
|
1604
1736
|
}
|
|
1605
1737
|
const f = t.render(r);
|
|
1606
1738
|
if (f instanceof Promise) {
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
}).catch((
|
|
1610
|
-
|
|
1611
|
-
}), t.loadingTemplate &&
|
|
1739
|
+
o(!0), f.then((p) => {
|
|
1740
|
+
o(!1), s(null), Q(e, p, r, i, n), a(e.innerHTML);
|
|
1741
|
+
}).catch((p) => {
|
|
1742
|
+
o(!1), s(p), t.errorTemplate && Q(e, t.errorTemplate(p, r), r, i, n);
|
|
1743
|
+
}), t.loadingTemplate && Q(e, t.loadingTemplate(r), r, i, n);
|
|
1612
1744
|
return;
|
|
1613
1745
|
}
|
|
1614
|
-
|
|
1746
|
+
Q(e, f, r, i, n), a(e.innerHTML);
|
|
1615
1747
|
} finally {
|
|
1616
|
-
|
|
1748
|
+
ne.pop();
|
|
1617
1749
|
}
|
|
1618
1750
|
}
|
|
1619
1751
|
}
|
|
1620
|
-
function
|
|
1752
|
+
function Q(e, t, r, i, n) {
|
|
1621
1753
|
e && (Ye(
|
|
1622
1754
|
e,
|
|
1623
1755
|
Array.isArray(t) ? t : [t],
|
|
@@ -1625,85 +1757,85 @@ function Y(e, t, r, i, n) {
|
|
|
1625
1757
|
i
|
|
1626
1758
|
), n(e.innerHTML));
|
|
1627
1759
|
}
|
|
1628
|
-
function
|
|
1629
|
-
if (
|
|
1760
|
+
function pt(e, t, r, i, n, o, s) {
|
|
1761
|
+
if (o !== null && clearTimeout(o), Date.now() - t < 16) {
|
|
1630
1762
|
if (n(r + 1), r > 10) {
|
|
1631
|
-
|
|
1763
|
+
s(null);
|
|
1632
1764
|
return;
|
|
1633
1765
|
}
|
|
1634
1766
|
} else
|
|
1635
1767
|
n(0);
|
|
1636
1768
|
const f = setTimeout(() => {
|
|
1637
|
-
i(Date.now()), e(),
|
|
1769
|
+
i(Date.now()), e(), s(null);
|
|
1638
1770
|
}, 0);
|
|
1639
|
-
|
|
1771
|
+
s(f);
|
|
1640
1772
|
}
|
|
1641
|
-
function dt(e, t, r, i, n,
|
|
1773
|
+
function dt(e, t, r, i, n, o) {
|
|
1642
1774
|
if (!e) return;
|
|
1643
|
-
const
|
|
1644
|
-
if (!t.style && (!
|
|
1645
|
-
|
|
1775
|
+
const s = ft(i);
|
|
1776
|
+
if (!t.style && (!s || s.trim() === "")) {
|
|
1777
|
+
o(null), e.adoptedStyleSheets = [Ee()];
|
|
1646
1778
|
return;
|
|
1647
1779
|
}
|
|
1648
1780
|
let a = "";
|
|
1649
1781
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1650
|
-
let f =
|
|
1651
|
-
${
|
|
1782
|
+
let f = Qe(`${a}
|
|
1783
|
+
${s}
|
|
1652
1784
|
`);
|
|
1653
1785
|
f = Be(f);
|
|
1654
|
-
let
|
|
1655
|
-
|
|
1786
|
+
let p = n;
|
|
1787
|
+
p || (p = new CSSStyleSheet()), (p.cssRules.length === 0 || p.toString() !== f) && p.replaceSync(f), e.adoptedStyleSheets = [Ee(), p], o(p);
|
|
1656
1788
|
}
|
|
1657
|
-
const
|
|
1789
|
+
const de = /* @__PURE__ */ new Map(), je = Symbol.for("cer.registry");
|
|
1658
1790
|
if (typeof window < "u") {
|
|
1659
1791
|
const e = globalThis;
|
|
1660
|
-
e[
|
|
1792
|
+
e[je] || (e[je] = de);
|
|
1661
1793
|
}
|
|
1662
|
-
function
|
|
1663
|
-
let i =
|
|
1794
|
+
function Le(e, t, r) {
|
|
1795
|
+
let i = Y(e);
|
|
1664
1796
|
i.includes("-") || (i = `cer-${i}`);
|
|
1665
1797
|
let n;
|
|
1666
|
-
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (
|
|
1667
|
-
console.error(`[${i}] Error:`,
|
|
1798
|
+
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (o, s) => {
|
|
1799
|
+
console.error(`[${i}] Error:`, o, s);
|
|
1668
1800
|
});
|
|
1669
1801
|
try {
|
|
1670
|
-
const
|
|
1802
|
+
const o = /* @__PURE__ */ new Set([
|
|
1671
1803
|
"refs",
|
|
1672
1804
|
"requestRender",
|
|
1673
1805
|
"error",
|
|
1674
1806
|
"hasError",
|
|
1675
1807
|
"isLoading",
|
|
1676
1808
|
"emit"
|
|
1677
|
-
]),
|
|
1809
|
+
]), s = [];
|
|
1678
1810
|
if (n.state && typeof n.state == "object" && Object.keys(n.state).forEach((a) => {
|
|
1679
|
-
|
|
1811
|
+
o.has(a) && s.push(a);
|
|
1680
1812
|
}), n.props && typeof n.props == "object" && Object.keys(n.props).forEach((a) => {
|
|
1681
|
-
|
|
1813
|
+
o.has(a) && s.push(a);
|
|
1682
1814
|
}), n.computed && typeof n.computed == "object" && Object.keys(n.computed).forEach((a) => {
|
|
1683
|
-
|
|
1684
|
-
}),
|
|
1685
|
-
const a = Array.from(new Set(
|
|
1815
|
+
o.has(a) && s.push(a);
|
|
1816
|
+
}), s.length > 0) {
|
|
1817
|
+
const a = Array.from(new Set(s));
|
|
1686
1818
|
console.warn(
|
|
1687
1819
|
`[${i}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`
|
|
1688
1820
|
);
|
|
1689
1821
|
}
|
|
1690
1822
|
} catch {
|
|
1691
1823
|
}
|
|
1692
|
-
if (
|
|
1824
|
+
if (de.set(i, n), typeof window < "u")
|
|
1693
1825
|
if (!customElements.get(i))
|
|
1694
|
-
customElements.define(i,
|
|
1826
|
+
customElements.define(i, ht(i, n));
|
|
1695
1827
|
else
|
|
1696
1828
|
try {
|
|
1697
|
-
document.querySelectorAll(i).forEach((
|
|
1829
|
+
document.querySelectorAll(i).forEach((o) => {
|
|
1698
1830
|
try {
|
|
1699
|
-
typeof
|
|
1831
|
+
typeof o._cfg < "u" && (o._cfg = n), typeof o._render == "function" && o._render(n);
|
|
1700
1832
|
} catch {
|
|
1701
1833
|
}
|
|
1702
1834
|
});
|
|
1703
1835
|
} catch {
|
|
1704
1836
|
}
|
|
1705
1837
|
}
|
|
1706
|
-
function
|
|
1838
|
+
function ht(e, t) {
|
|
1707
1839
|
if (!t.render)
|
|
1708
1840
|
throw new Error(
|
|
1709
1841
|
"Component must have a render function"
|
|
@@ -1747,7 +1879,7 @@ function pt(e, t) {
|
|
|
1747
1879
|
_templateLoading = !1;
|
|
1748
1880
|
_templateError = null;
|
|
1749
1881
|
constructor() {
|
|
1750
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
1882
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = de.get(e) || t;
|
|
1751
1883
|
const r = this._initContext(t);
|
|
1752
1884
|
Object.defineProperty(r, "refs", {
|
|
1753
1885
|
value: this._refs,
|
|
@@ -1760,12 +1892,12 @@ function pt(e, t) {
|
|
|
1760
1892
|
enumerable: !1,
|
|
1761
1893
|
configurable: !1
|
|
1762
1894
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
1763
|
-
value: (n,
|
|
1895
|
+
value: (n, o, s) => {
|
|
1764
1896
|
const a = new CustomEvent(n, {
|
|
1765
|
-
detail:
|
|
1897
|
+
detail: o,
|
|
1766
1898
|
bubbles: !0,
|
|
1767
1899
|
composed: !0,
|
|
1768
|
-
...
|
|
1900
|
+
...s || {}
|
|
1769
1901
|
});
|
|
1770
1902
|
return this.dispatchEvent(a), !a.defaultPrevented;
|
|
1771
1903
|
},
|
|
@@ -1773,15 +1905,15 @@ function pt(e, t) {
|
|
|
1773
1905
|
enumerable: !1,
|
|
1774
1906
|
configurable: !1
|
|
1775
1907
|
});
|
|
1776
|
-
const i =
|
|
1908
|
+
const i = de.get(e) || t;
|
|
1777
1909
|
Object.keys(i).forEach((n) => {
|
|
1778
|
-
const
|
|
1779
|
-
typeof
|
|
1910
|
+
const o = i[n];
|
|
1911
|
+
typeof o == "function" && (this.context[n] = (...s) => o(...s, this.context));
|
|
1780
1912
|
}), this._applyComputed(i), this._initializing = !1, this._initWatchers(i), this._render(i);
|
|
1781
1913
|
}
|
|
1782
1914
|
connectedCallback() {
|
|
1783
1915
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1784
|
-
this._applyProps(t),
|
|
1916
|
+
this._applyProps(t), We(
|
|
1785
1917
|
t,
|
|
1786
1918
|
this.context,
|
|
1787
1919
|
this._mounted,
|
|
@@ -1817,7 +1949,7 @@ function pt(e, t) {
|
|
|
1817
1949
|
}
|
|
1818
1950
|
attributeChangedCallback(r, i, n) {
|
|
1819
1951
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1820
|
-
this._applyProps(t),
|
|
1952
|
+
this._applyProps(t), Ue(
|
|
1821
1953
|
t,
|
|
1822
1954
|
r,
|
|
1823
1955
|
i,
|
|
@@ -1827,15 +1959,15 @@ function pt(e, t) {
|
|
|
1827
1959
|
});
|
|
1828
1960
|
}
|
|
1829
1961
|
static get observedAttributes() {
|
|
1830
|
-
return t.props ? Object.keys(t.props).map(
|
|
1962
|
+
return t.props ? Object.keys(t.props).map(Y) : [];
|
|
1831
1963
|
}
|
|
1832
1964
|
_applyComputed(r) {
|
|
1833
1965
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1834
1966
|
r.computed && Object.entries(r.computed).forEach(([i, n]) => {
|
|
1835
1967
|
Object.defineProperty(this.context, i, {
|
|
1836
1968
|
get: () => {
|
|
1837
|
-
const
|
|
1838
|
-
return
|
|
1969
|
+
const o = n(this.context);
|
|
1970
|
+
return J(o);
|
|
1839
1971
|
},
|
|
1840
1972
|
enumerable: !0
|
|
1841
1973
|
});
|
|
@@ -1845,7 +1977,7 @@ function pt(e, t) {
|
|
|
1845
1977
|
// --- Render ---
|
|
1846
1978
|
_render(r) {
|
|
1847
1979
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1848
|
-
|
|
1980
|
+
ut(
|
|
1849
1981
|
this.shadowRoot,
|
|
1850
1982
|
r,
|
|
1851
1983
|
this.context,
|
|
@@ -1868,7 +2000,7 @@ function pt(e, t) {
|
|
|
1868
2000
|
}
|
|
1869
2001
|
_requestRender() {
|
|
1870
2002
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1871
|
-
|
|
2003
|
+
pt(
|
|
1872
2004
|
() => this._render(this._cfg),
|
|
1873
2005
|
this._lastRenderTime,
|
|
1874
2006
|
this._renderCount,
|
|
@@ -1915,11 +2047,11 @@ function pt(e, t) {
|
|
|
1915
2047
|
// --- State, props, computed ---
|
|
1916
2048
|
_initContext(r) {
|
|
1917
2049
|
try {
|
|
1918
|
-
let i = function(
|
|
1919
|
-
return Array.isArray(
|
|
1920
|
-
get(a, f,
|
|
1921
|
-
const
|
|
1922
|
-
return typeof
|
|
2050
|
+
let i = function(o, s = "") {
|
|
2051
|
+
return Array.isArray(o) ? new Proxy(o, {
|
|
2052
|
+
get(a, f, p) {
|
|
2053
|
+
const h = Reflect.get(a, f, p);
|
|
2054
|
+
return typeof h == "function" && typeof f == "string" && [
|
|
1923
2055
|
"push",
|
|
1924
2056
|
"pop",
|
|
1925
2057
|
"shift",
|
|
@@ -1927,44 +2059,44 @@ function pt(e, t) {
|
|
|
1927
2059
|
"splice",
|
|
1928
2060
|
"sort",
|
|
1929
2061
|
"reverse"
|
|
1930
|
-
].includes(f) ? function(...
|
|
1931
|
-
const
|
|
2062
|
+
].includes(f) ? function(...u) {
|
|
2063
|
+
const c = h.apply(a, u);
|
|
1932
2064
|
if (!n._initializing) {
|
|
1933
|
-
const
|
|
1934
|
-
n._triggerWatchers(
|
|
2065
|
+
const w = s || "root";
|
|
2066
|
+
n._triggerWatchers(w, a), n._render(r);
|
|
1935
2067
|
}
|
|
1936
|
-
return
|
|
1937
|
-
} :
|
|
2068
|
+
return c;
|
|
2069
|
+
} : h;
|
|
1938
2070
|
},
|
|
1939
|
-
set(a, f,
|
|
1940
|
-
if (a[f] =
|
|
1941
|
-
const
|
|
1942
|
-
n._triggerWatchers(
|
|
2071
|
+
set(a, f, p) {
|
|
2072
|
+
if (a[f] = p, !n._initializing) {
|
|
2073
|
+
const h = s ? `${s}.${String(f)}` : String(f);
|
|
2074
|
+
n._triggerWatchers(h, p), n._render(r);
|
|
1943
2075
|
}
|
|
1944
2076
|
return !0;
|
|
1945
2077
|
},
|
|
1946
2078
|
deleteProperty(a, f) {
|
|
1947
2079
|
if (delete a[f], !n._initializing) {
|
|
1948
|
-
const
|
|
1949
|
-
n._triggerWatchers(
|
|
2080
|
+
const p = s ? `${s}.${String(f)}` : String(f);
|
|
2081
|
+
n._triggerWatchers(p, void 0), n._render(r);
|
|
1950
2082
|
}
|
|
1951
2083
|
return !0;
|
|
1952
2084
|
}
|
|
1953
|
-
}) :
|
|
1954
|
-
const f =
|
|
1955
|
-
|
|
1956
|
-
}), new Proxy(
|
|
1957
|
-
set(a, f,
|
|
1958
|
-
const
|
|
1959
|
-
return a[f] = i(
|
|
1960
|
-
|
|
2085
|
+
}) : o && typeof o == "object" ? (Object.keys(o).forEach((a) => {
|
|
2086
|
+
const f = s ? `${s}.${a}` : a;
|
|
2087
|
+
o[a] = i(o[a], f);
|
|
2088
|
+
}), new Proxy(o, {
|
|
2089
|
+
set(a, f, p) {
|
|
2090
|
+
const h = s ? `${s}.${String(f)}` : String(f);
|
|
2091
|
+
return a[f] = i(p, h), n._initializing || (n._triggerWatchers(
|
|
2092
|
+
h,
|
|
1961
2093
|
a[f]
|
|
1962
2094
|
), n._render(r)), !0;
|
|
1963
2095
|
},
|
|
1964
|
-
get(a, f,
|
|
1965
|
-
return Reflect.get(a, f,
|
|
2096
|
+
get(a, f, p) {
|
|
2097
|
+
return Reflect.get(a, f, p);
|
|
1966
2098
|
}
|
|
1967
|
-
})) :
|
|
2099
|
+
})) : o;
|
|
1968
2100
|
};
|
|
1969
2101
|
const n = this;
|
|
1970
2102
|
return i({ ...r.state });
|
|
@@ -1974,7 +2106,7 @@ function pt(e, t) {
|
|
|
1974
2106
|
}
|
|
1975
2107
|
_initWatchers(r) {
|
|
1976
2108
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1977
|
-
|
|
2109
|
+
qe(
|
|
1978
2110
|
this.context,
|
|
1979
2111
|
this._watchers,
|
|
1980
2112
|
r.watch || {}
|
|
@@ -1982,12 +2114,12 @@ function pt(e, t) {
|
|
|
1982
2114
|
});
|
|
1983
2115
|
}
|
|
1984
2116
|
_triggerWatchers(r, i) {
|
|
1985
|
-
|
|
2117
|
+
Ie(this.context, this._watchers, r, i);
|
|
1986
2118
|
}
|
|
1987
2119
|
_applyProps(r) {
|
|
1988
2120
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1989
2121
|
try {
|
|
1990
|
-
|
|
2122
|
+
Ne(this, r, this.context);
|
|
1991
2123
|
} catch (i) {
|
|
1992
2124
|
this._hasError = !0, r.onError && r.onError(i, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(i, this.context));
|
|
1993
2125
|
}
|
|
@@ -1995,101 +2127,101 @@ function pt(e, t) {
|
|
|
1995
2127
|
}
|
|
1996
2128
|
};
|
|
1997
2129
|
}
|
|
1998
|
-
function
|
|
2130
|
+
function re(e, t = {}, r, i) {
|
|
1999
2131
|
const n = i ?? t.key;
|
|
2000
2132
|
return { tag: e, key: n, props: t, children: r };
|
|
2001
2133
|
}
|
|
2002
|
-
function
|
|
2134
|
+
function ue(e) {
|
|
2003
2135
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
2004
2136
|
}
|
|
2005
|
-
function
|
|
2006
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
2137
|
+
function ae(e) {
|
|
2138
|
+
return typeof e == "object" && e !== null && "tag" in e && !ue(e);
|
|
2007
2139
|
}
|
|
2008
|
-
function
|
|
2140
|
+
function gt(e, t) {
|
|
2009
2141
|
return e.key != null ? e : { ...e, key: t };
|
|
2010
2142
|
}
|
|
2011
|
-
function
|
|
2012
|
-
const i = {}, n = {},
|
|
2013
|
-
let
|
|
2014
|
-
for (;
|
|
2015
|
-
const
|
|
2016
|
-
let c =
|
|
2017
|
-
|
|
2018
|
-
const
|
|
2019
|
-
if (
|
|
2020
|
-
const [
|
|
2021
|
-
if (
|
|
2022
|
-
const
|
|
2023
|
-
|
|
2143
|
+
function mt(e, t = [], r = {}) {
|
|
2144
|
+
const i = {}, n = {}, o = {}, s = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2145
|
+
let f;
|
|
2146
|
+
for (; f = a.exec(e); ) {
|
|
2147
|
+
const p = f[1], h = f[2], C = (f[4] || f[6]) ?? "", u = C.match(/^{{(\d+)}}$/);
|
|
2148
|
+
let c = u ? t[Number(u[1])] ?? null : C;
|
|
2149
|
+
u || (c === "true" ? c = !0 : c === "false" ? c = !1 : c === "null" ? c = null : isNaN(Number(c)) || (c = Number(c)));
|
|
2150
|
+
const w = ["model", "bind", "show", "class", "style"];
|
|
2151
|
+
if (p === ":") {
|
|
2152
|
+
const [v, d] = h.split(":"), [g, ...m] = v.split(".");
|
|
2153
|
+
if (w.includes(g)) {
|
|
2154
|
+
const x = [...m], l = g === "model" && d ? `model:${d}` : g;
|
|
2155
|
+
o[l] = {
|
|
2024
2156
|
value: c,
|
|
2025
|
-
modifiers:
|
|
2026
|
-
arg:
|
|
2157
|
+
modifiers: x,
|
|
2158
|
+
arg: d
|
|
2027
2159
|
};
|
|
2028
2160
|
} else
|
|
2029
|
-
n[
|
|
2030
|
-
} else if (
|
|
2031
|
-
const
|
|
2032
|
-
i[
|
|
2033
|
-
} else
|
|
2161
|
+
n[h] = c, s.push(h);
|
|
2162
|
+
} else if (p === "@") {
|
|
2163
|
+
const v = "on" + h.charAt(0).toUpperCase() + h.slice(1);
|
|
2164
|
+
i[v] = typeof c == "function" ? c : typeof r[c] == "function" ? r[c] : void 0;
|
|
2165
|
+
} else h === "ref" ? i.ref = c : n[h] = c;
|
|
2034
2166
|
}
|
|
2035
|
-
return { props: i, attrs: n, directives: s };
|
|
2167
|
+
return { props: i, attrs: n, directives: o, bound: s };
|
|
2036
2168
|
}
|
|
2037
|
-
function
|
|
2038
|
-
const i =
|
|
2039
|
-
function
|
|
2040
|
-
return
|
|
2169
|
+
function yt(e, t, r) {
|
|
2170
|
+
const i = ne.length > 0 ? ne[ne.length - 1] : void 0, n = r ?? i;
|
|
2171
|
+
function o(l, b) {
|
|
2172
|
+
return re("#text", {}, l, b);
|
|
2041
2173
|
}
|
|
2042
|
-
let
|
|
2174
|
+
let s = "";
|
|
2043
2175
|
for (let l = 0; l < e.length; l++)
|
|
2044
|
-
|
|
2176
|
+
s += e[l], l < t.length && (s += `{{${l}}}`);
|
|
2045
2177
|
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, f = [];
|
|
2046
|
-
let
|
|
2047
|
-
function
|
|
2048
|
-
!l || typeof l != "object" ||
|
|
2049
|
-
if (
|
|
2050
|
-
const
|
|
2178
|
+
let p, h = [], C = null, u = {}, c, w = 0, v = [];
|
|
2179
|
+
function d(l) {
|
|
2180
|
+
!l || typeof l != "object" || ue(l) || (l.props || l.attrs ? (l.props && (u.props || (u.props = {}), Object.assign(u.props, l.props)), l.attrs && (u.attrs || (u.attrs = {}), Object.keys(l.attrs).forEach((b) => {
|
|
2181
|
+
if (b === "style" && u.attrs.style) {
|
|
2182
|
+
const y = u.attrs.style.replace(
|
|
2051
2183
|
/;?\s*$/,
|
|
2052
2184
|
""
|
|
2053
2185
|
), _ = l.attrs.style.replace(/^;?\s*/, "");
|
|
2054
|
-
|
|
2055
|
-
} else if (
|
|
2056
|
-
const
|
|
2057
|
-
.../* @__PURE__ */ new Set([...
|
|
2186
|
+
u.attrs.style = y + "; " + _;
|
|
2187
|
+
} else if (b === "class" && u.attrs.class) {
|
|
2188
|
+
const y = u.attrs.class.trim().split(/\s+/).filter(Boolean), _ = l.attrs.class.trim().split(/\s+/).filter(Boolean), E = [
|
|
2189
|
+
.../* @__PURE__ */ new Set([...y, ..._])
|
|
2058
2190
|
];
|
|
2059
|
-
|
|
2191
|
+
u.attrs.class = E.join(" ");
|
|
2060
2192
|
} else
|
|
2061
|
-
|
|
2062
|
-
}))) : (
|
|
2063
|
-
}
|
|
2064
|
-
function
|
|
2065
|
-
const
|
|
2066
|
-
if (
|
|
2067
|
-
const _ = l.key ??
|
|
2068
|
-
let
|
|
2069
|
-
|
|
2193
|
+
u.attrs[b] = l.attrs[b];
|
|
2194
|
+
}))) : (u.props || (u.props = {}), Object.assign(u.props, l)));
|
|
2195
|
+
}
|
|
2196
|
+
function g(l, b) {
|
|
2197
|
+
const y = C ? h : v;
|
|
2198
|
+
if (ue(l)) {
|
|
2199
|
+
const _ = l.key ?? b;
|
|
2200
|
+
let E = l.children;
|
|
2201
|
+
y.push({
|
|
2070
2202
|
...l,
|
|
2071
2203
|
key: _,
|
|
2072
|
-
children:
|
|
2204
|
+
children: E
|
|
2073
2205
|
});
|
|
2074
2206
|
return;
|
|
2075
2207
|
}
|
|
2076
|
-
if (
|
|
2077
|
-
|
|
2208
|
+
if (ae(l)) {
|
|
2209
|
+
y.push(gt(l, void 0));
|
|
2078
2210
|
return;
|
|
2079
2211
|
}
|
|
2080
2212
|
if (Array.isArray(l)) {
|
|
2081
2213
|
if (l.length === 0) return;
|
|
2082
2214
|
for (let _ = 0; _ < l.length; _++) {
|
|
2083
|
-
const
|
|
2084
|
-
|
|
2215
|
+
const E = l[_];
|
|
2216
|
+
ue(E) || ae(E) || Array.isArray(E) ? g(E, `${b}-${_}`) : E !== null && typeof E == "object" ? d(E) : y.push(o(String(E), `${b}-${_}`));
|
|
2085
2217
|
}
|
|
2086
2218
|
return;
|
|
2087
2219
|
}
|
|
2088
2220
|
if (l !== null && typeof l == "object") {
|
|
2089
|
-
|
|
2221
|
+
d(l);
|
|
2090
2222
|
return;
|
|
2091
2223
|
}
|
|
2092
|
-
|
|
2224
|
+
y.push(o(String(l), b));
|
|
2093
2225
|
}
|
|
2094
2226
|
const m = /* @__PURE__ */ new Set([
|
|
2095
2227
|
"area",
|
|
@@ -2107,91 +2239,122 @@ function mt(e, t, r) {
|
|
|
2107
2239
|
"track",
|
|
2108
2240
|
"wbr"
|
|
2109
2241
|
]);
|
|
2110
|
-
for (;
|
|
2111
|
-
if (
|
|
2112
|
-
const l =
|
|
2242
|
+
for (; p = a.exec(s); )
|
|
2243
|
+
if (p[1]) {
|
|
2244
|
+
const l = p[1], b = p[0][1] === "/", y = p[0][p[0].length - 2] === "/" || m.has(l), {
|
|
2113
2245
|
props: _,
|
|
2114
|
-
attrs:
|
|
2115
|
-
directives:
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
for (const
|
|
2119
|
-
|
|
2246
|
+
attrs: E,
|
|
2247
|
+
directives: S,
|
|
2248
|
+
bound: A
|
|
2249
|
+
} = mt(p[2] || "", t, n), $ = { props: {}, attrs: {} };
|
|
2250
|
+
for (const T in _) $.props[T] = _[T];
|
|
2251
|
+
for (const T in E) $.attrs[T] = E[T];
|
|
2252
|
+
if ($.attrs && Object.prototype.hasOwnProperty.call($.attrs, "key") && !($.props && Object.prototype.hasOwnProperty.call($.props, "key")))
|
|
2120
2253
|
try {
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2254
|
+
$.props.key = $.attrs.key;
|
|
2255
|
+
} catch {
|
|
2256
|
+
}
|
|
2257
|
+
try {
|
|
2258
|
+
const T = {
|
|
2259
|
+
input: ["value", "checked", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2260
|
+
textarea: ["value", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2261
|
+
select: ["value", "disabled", "required", "multiple"],
|
|
2262
|
+
option: ["selected", "disabled", "value"],
|
|
2263
|
+
video: ["muted", "autoplay", "controls", "loop", "playsinline"],
|
|
2264
|
+
audio: ["muted", "autoplay", "controls", "loop"],
|
|
2265
|
+
img: ["src", "alt", "width", "height"],
|
|
2266
|
+
button: ["type", "name", "value", "disabled", "autofocus", "form"]
|
|
2267
|
+
}, B = l.toLowerCase(), G = T[B] ?? [];
|
|
2268
|
+
if ($.attrs)
|
|
2269
|
+
for (const M of G)
|
|
2270
|
+
A && A.includes(M) && M in $.attrs && !($.props && M in $.props) && ($.props[M] = $.attrs[M], delete $.attrs[M]);
|
|
2271
|
+
if ((l.includes("-") || !!n?.__customElements?.has?.(l)) && A && $.attrs) {
|
|
2272
|
+
const M = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
|
|
2273
|
+
for (const U of A)
|
|
2274
|
+
if (U in $.attrs && !($.props && U in $.props)) {
|
|
2275
|
+
const q = U.includes("-") ? U.split("-").map((I, z) => z === 0 ? I : I.charAt(0).toUpperCase() + I.slice(1)).join("") : U;
|
|
2276
|
+
$.props[q] = $.attrs[U], M.has(U) || delete $.attrs[U];
|
|
2277
|
+
}
|
|
2278
|
+
$.isCustomElement = !0;
|
|
2279
|
+
}
|
|
2280
|
+
} catch {
|
|
2281
|
+
}
|
|
2282
|
+
if (S && Object.keys(S).some((T) => T === "model" || T.startsWith("model:")))
|
|
2283
|
+
try {
|
|
2284
|
+
const T = Symbol.for("cer.registry"), B = globalThis[T], G = !!(B && typeof B.has == "function" && B.has(l)), ee = !!(n && (n.__customElements instanceof Set && n.__customElements.has(l) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(l)));
|
|
2285
|
+
if (!!(l.includes("-") || ee || G))
|
|
2286
|
+
for (const q of Object.keys(S)) {
|
|
2287
|
+
if (q !== "model" && !q.startsWith("model:")) continue;
|
|
2288
|
+
const I = S[q], z = I.arg ?? (q.includes(":") ? q.split(":", 2)[1] : void 0), H = I.value, F = z ?? "modelValue", te = W, k = ce, P = n ? n._state || n : void 0;
|
|
2289
|
+
let R;
|
|
2290
|
+
typeof H == "string" && n ? R = te(P, H) : R = H, $.props[F] = R;
|
|
2128
2291
|
try {
|
|
2129
|
-
const
|
|
2130
|
-
|
|
2292
|
+
const L = Y(F);
|
|
2293
|
+
$.attrs || ($.attrs = {}), R !== void 0 && ($.attrs[L] = R);
|
|
2131
2294
|
} catch {
|
|
2132
2295
|
}
|
|
2133
|
-
|
|
2134
|
-
const O = `update:${
|
|
2135
|
-
|
|
2136
|
-
const
|
|
2137
|
-
if (!
|
|
2138
|
-
const
|
|
2139
|
-
(Array.isArray(
|
|
2140
|
-
}, delete
|
|
2296
|
+
$.isCustomElement = !0;
|
|
2297
|
+
const O = `update:${Y(F)}`, j = "on" + O.charAt(0).toUpperCase() + O.slice(1);
|
|
2298
|
+
$.props[j] = function(L) {
|
|
2299
|
+
const se = L.detail !== void 0 ? L.detail : L.target ? L.target.value : void 0;
|
|
2300
|
+
if (!P) return;
|
|
2301
|
+
const he = te(P, typeof H == "string" ? H : String(H));
|
|
2302
|
+
(Array.isArray(se) && Array.isArray(he) ? JSON.stringify([...se].sort()) !== JSON.stringify([...he].sort()) : se !== he) && (k(P, typeof H == "string" ? H : String(H), se), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
2303
|
+
}, delete S[q];
|
|
2141
2304
|
}
|
|
2142
2305
|
} catch {
|
|
2143
2306
|
}
|
|
2144
|
-
if (Object.keys(
|
|
2145
|
-
const
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
),
|
|
2151
|
-
|
|
2152
|
-
} else
|
|
2153
|
-
tag:
|
|
2154
|
-
props:
|
|
2155
|
-
children:
|
|
2156
|
-
key:
|
|
2157
|
-
}),
|
|
2158
|
-
} else if (typeof
|
|
2159
|
-
const l = Number(
|
|
2160
|
-
b
|
|
2161
|
-
} else if (
|
|
2162
|
-
const l =
|
|
2163
|
-
for (const _ of
|
|
2307
|
+
if (Object.keys(S).length > 0 && ($.directives = { ...S }), b) {
|
|
2308
|
+
const T = re(
|
|
2309
|
+
C,
|
|
2310
|
+
u,
|
|
2311
|
+
h.length === 1 && ae(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
|
|
2312
|
+
c
|
|
2313
|
+
), B = f.pop();
|
|
2314
|
+
B ? (C = B.tag, u = B.props, c = B.key, h = B.children, h.push(T)) : (v.push(T), C = null, u = {}, c = void 0, h = []);
|
|
2315
|
+
} else y ? C ? h.push(re(l, $, void 0, void 0)) : v.push(re(l, $, void 0, void 0)) : (C && f.push({
|
|
2316
|
+
tag: C,
|
|
2317
|
+
props: u,
|
|
2318
|
+
children: h,
|
|
2319
|
+
key: c
|
|
2320
|
+
}), C = l, u = $, h = []);
|
|
2321
|
+
} else if (typeof p[3] < "u") {
|
|
2322
|
+
const l = Number(p[3]), b = t[l], y = `interp-${l}`;
|
|
2323
|
+
g(b, y);
|
|
2324
|
+
} else if (p[4]) {
|
|
2325
|
+
const l = p[4], b = C ? h : v, y = l.split(/({{\d+}})/);
|
|
2326
|
+
for (const _ of y) {
|
|
2164
2327
|
if (!_) continue;
|
|
2165
|
-
const
|
|
2166
|
-
if (
|
|
2167
|
-
const
|
|
2168
|
-
|
|
2328
|
+
const E = _.match(/^{{(\d+)}}$/);
|
|
2329
|
+
if (E) {
|
|
2330
|
+
const S = Number(E[1]), A = t[S], $ = `interp-${S}`;
|
|
2331
|
+
g(A, $);
|
|
2169
2332
|
} else {
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2333
|
+
const S = `text-${w++}`;
|
|
2334
|
+
b.push(o(_, S));
|
|
2172
2335
|
}
|
|
2173
2336
|
}
|
|
2174
2337
|
}
|
|
2175
|
-
const x =
|
|
2176
|
-
return x.length === 1 ? x[0] : x.length > 1 ? x :
|
|
2338
|
+
const x = v.filter((l) => ae(l) && l.tag === "#text" ? typeof l.children == "string" && l.children.trim() !== "" : !0);
|
|
2339
|
+
return x.length === 1 ? x[0] : x.length > 1 ? x : re("div", {}, "", "fallback-root");
|
|
2177
2340
|
}
|
|
2178
|
-
function
|
|
2341
|
+
function Z(e, ...t) {
|
|
2179
2342
|
const r = t[t.length - 1], i = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2180
|
-
return
|
|
2343
|
+
return yt(e, t, i);
|
|
2181
2344
|
}
|
|
2182
|
-
const
|
|
2345
|
+
const Re = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, K = (e, t) => {
|
|
2183
2346
|
for (const r of e) {
|
|
2184
|
-
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")),
|
|
2185
|
-
if (
|
|
2347
|
+
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")), o = new RegExp(`^${n}$`), s = t.match(o);
|
|
2348
|
+
if (s) {
|
|
2186
2349
|
const a = {};
|
|
2187
|
-
return i.forEach((f,
|
|
2188
|
-
a[f] =
|
|
2350
|
+
return i.forEach((f, p) => {
|
|
2351
|
+
a[f] = s[p + 1];
|
|
2189
2352
|
}), { route: r, params: a };
|
|
2190
2353
|
}
|
|
2191
2354
|
}
|
|
2192
2355
|
return { route: null, params: {} };
|
|
2193
2356
|
}, ke = {};
|
|
2194
|
-
async function
|
|
2357
|
+
async function bt(e) {
|
|
2195
2358
|
if (e.component) return e.component;
|
|
2196
2359
|
if (e.load) {
|
|
2197
2360
|
if (ke[e.path]) return ke[e.path];
|
|
@@ -2204,160 +2367,160 @@ async function yt(e) {
|
|
|
2204
2367
|
}
|
|
2205
2368
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2206
2369
|
}
|
|
2207
|
-
function
|
|
2370
|
+
function wt(e) {
|
|
2208
2371
|
const { routes: t, base: r = "", initialUrl: i } = e;
|
|
2209
|
-
let n,
|
|
2210
|
-
const
|
|
2211
|
-
const
|
|
2212
|
-
if (
|
|
2372
|
+
let n, o, s, a, f, p, h;
|
|
2373
|
+
const C = async (v, d) => {
|
|
2374
|
+
const g = t.find((m) => K([m], v.path).route !== null);
|
|
2375
|
+
if (g?.beforeEnter)
|
|
2213
2376
|
try {
|
|
2214
|
-
const m = await
|
|
2215
|
-
return typeof m == "string" ? (await
|
|
2377
|
+
const m = await g.beforeEnter(v, d);
|
|
2378
|
+
return typeof m == "string" ? (await w(m, !0), !1) : m !== !1;
|
|
2216
2379
|
} catch (m) {
|
|
2217
2380
|
return console.error("beforeEnter error", m), !1;
|
|
2218
2381
|
}
|
|
2219
2382
|
return !0;
|
|
2220
|
-
},
|
|
2221
|
-
const
|
|
2222
|
-
if (
|
|
2383
|
+
}, u = async (v, d) => {
|
|
2384
|
+
const g = t.find((m) => K([m], v.path).route !== null);
|
|
2385
|
+
if (g?.onEnter)
|
|
2223
2386
|
try {
|
|
2224
|
-
const m = await
|
|
2225
|
-
return typeof m == "string" ? (await
|
|
2387
|
+
const m = await g.onEnter(v, d);
|
|
2388
|
+
return typeof m == "string" ? (await w(m, !0), !1) : m !== !1;
|
|
2226
2389
|
} catch (m) {
|
|
2227
2390
|
return console.error("onEnter error", m), !1;
|
|
2228
2391
|
}
|
|
2229
2392
|
return !0;
|
|
2230
|
-
},
|
|
2231
|
-
const
|
|
2232
|
-
if (
|
|
2393
|
+
}, c = (v, d) => {
|
|
2394
|
+
const g = t.find((m) => K([m], v.path).route !== null);
|
|
2395
|
+
if (g?.afterEnter)
|
|
2233
2396
|
try {
|
|
2234
|
-
|
|
2397
|
+
g.afterEnter(v, d);
|
|
2235
2398
|
} catch (m) {
|
|
2236
2399
|
console.error("afterEnter error", m);
|
|
2237
2400
|
}
|
|
2238
|
-
},
|
|
2401
|
+
}, w = async (v, d = !1) => {
|
|
2239
2402
|
try {
|
|
2240
|
-
const
|
|
2241
|
-
path:
|
|
2403
|
+
const g = {
|
|
2404
|
+
path: v.replace(r, "") || "/",
|
|
2242
2405
|
query: {}
|
|
2243
|
-
}, m =
|
|
2244
|
-
if (!m) throw new Error(`No route found for ${
|
|
2245
|
-
const x =
|
|
2246
|
-
path:
|
|
2406
|
+
}, m = K(t, g.path);
|
|
2407
|
+
if (!m) throw new Error(`No route found for ${g.path}`);
|
|
2408
|
+
const x = s.getState(), l = {
|
|
2409
|
+
path: g.path,
|
|
2247
2410
|
params: m.params,
|
|
2248
|
-
query:
|
|
2411
|
+
query: g.query
|
|
2249
2412
|
};
|
|
2250
|
-
if (!await
|
|
2251
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2252
|
-
} catch (
|
|
2253
|
-
console.error("Navigation error:",
|
|
2413
|
+
if (!await C(l, x) || !await u(l, x)) return;
|
|
2414
|
+
typeof window < "u" && typeof document < "u" && (d ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), s.setState(l), c(l, x);
|
|
2415
|
+
} catch (g) {
|
|
2416
|
+
console.error("Navigation error:", g);
|
|
2254
2417
|
}
|
|
2255
2418
|
};
|
|
2256
2419
|
if (typeof window < "u" && typeof document < "u") {
|
|
2257
2420
|
n = () => {
|
|
2258
|
-
const
|
|
2259
|
-
return { path:
|
|
2260
|
-
},
|
|
2261
|
-
const
|
|
2262
|
-
|
|
2263
|
-
path:
|
|
2264
|
-
params:
|
|
2265
|
-
query:
|
|
2266
|
-
}), a = async (
|
|
2267
|
-
const
|
|
2268
|
-
await
|
|
2269
|
-
}, window.addEventListener("popstate", () => a(!0)), f = (
|
|
2421
|
+
const d = new URL(window.location.href), g = d.pathname.replace(r, "") || "/", m = Re(d.search);
|
|
2422
|
+
return { path: g, query: m };
|
|
2423
|
+
}, o = n();
|
|
2424
|
+
const v = K(t, o.path);
|
|
2425
|
+
s = $e({
|
|
2426
|
+
path: o.path,
|
|
2427
|
+
params: v.params,
|
|
2428
|
+
query: o.query
|
|
2429
|
+
}), a = async (d = !1) => {
|
|
2430
|
+
const g = n();
|
|
2431
|
+
await w(g.path, d);
|
|
2432
|
+
}, window.addEventListener("popstate", () => a(!0)), f = (d) => w(d, !1), p = (d) => w(d, !0), h = () => window.history.back();
|
|
2270
2433
|
} else {
|
|
2271
2434
|
n = () => {
|
|
2272
|
-
const
|
|
2435
|
+
const g = new URL(i || "/", "http://localhost"), m = g.pathname.replace(r, "") || "/", x = Re(g.search);
|
|
2273
2436
|
return { path: m, query: x };
|
|
2274
|
-
},
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
path:
|
|
2278
|
-
params:
|
|
2279
|
-
query:
|
|
2437
|
+
}, o = n();
|
|
2438
|
+
const v = K(t, o.path);
|
|
2439
|
+
s = $e({
|
|
2440
|
+
path: o.path,
|
|
2441
|
+
params: v.params,
|
|
2442
|
+
query: o.query
|
|
2280
2443
|
}), a = async () => {
|
|
2281
|
-
const
|
|
2282
|
-
await
|
|
2444
|
+
const g = n();
|
|
2445
|
+
await d(g.path);
|
|
2283
2446
|
};
|
|
2284
|
-
const
|
|
2447
|
+
const d = async (g) => {
|
|
2285
2448
|
try {
|
|
2286
2449
|
const m = {
|
|
2287
|
-
path:
|
|
2450
|
+
path: g.replace(r, "") || "/",
|
|
2288
2451
|
query: {}
|
|
2289
|
-
}, x =
|
|
2452
|
+
}, x = K(t, m.path);
|
|
2290
2453
|
if (!x) throw new Error(`No route found for ${m.path}`);
|
|
2291
|
-
const l =
|
|
2454
|
+
const l = s.getState(), b = {
|
|
2292
2455
|
path: m.path,
|
|
2293
2456
|
params: x.params,
|
|
2294
2457
|
query: m.query
|
|
2295
|
-
},
|
|
2296
|
-
if (
|
|
2458
|
+
}, y = t.find((_) => K([_], b.path).route !== null);
|
|
2459
|
+
if (y?.beforeEnter)
|
|
2297
2460
|
try {
|
|
2298
|
-
const _ = await
|
|
2461
|
+
const _ = await y.beforeEnter(b, l);
|
|
2299
2462
|
if (typeof _ == "string") {
|
|
2300
|
-
await
|
|
2463
|
+
await d(_);
|
|
2301
2464
|
return;
|
|
2302
2465
|
}
|
|
2303
2466
|
if (_ === !1) return;
|
|
2304
2467
|
} catch {
|
|
2305
2468
|
return;
|
|
2306
2469
|
}
|
|
2307
|
-
if (
|
|
2470
|
+
if (y?.onEnter)
|
|
2308
2471
|
try {
|
|
2309
|
-
const _ = await
|
|
2472
|
+
const _ = await y.onEnter(b, l);
|
|
2310
2473
|
if (typeof _ == "string") {
|
|
2311
|
-
await
|
|
2474
|
+
await d(_);
|
|
2312
2475
|
return;
|
|
2313
2476
|
}
|
|
2314
2477
|
if (_ === !1) return;
|
|
2315
2478
|
} catch {
|
|
2316
2479
|
return;
|
|
2317
2480
|
}
|
|
2318
|
-
if (
|
|
2481
|
+
if (s.setState(b), y?.afterEnter)
|
|
2319
2482
|
try {
|
|
2320
|
-
|
|
2483
|
+
y.afterEnter(b, l);
|
|
2321
2484
|
} catch {
|
|
2322
2485
|
}
|
|
2323
2486
|
} catch {
|
|
2324
2487
|
}
|
|
2325
2488
|
};
|
|
2326
|
-
f = async (
|
|
2489
|
+
f = async (g) => d(g), p = async (g) => d(g), h = () => {
|
|
2327
2490
|
};
|
|
2328
2491
|
}
|
|
2329
2492
|
return {
|
|
2330
|
-
store:
|
|
2493
|
+
store: s,
|
|
2331
2494
|
push: f,
|
|
2332
|
-
replace:
|
|
2333
|
-
back:
|
|
2334
|
-
subscribe:
|
|
2335
|
-
matchRoute: (
|
|
2336
|
-
getCurrent: () =>
|
|
2337
|
-
resolveRouteComponent:
|
|
2495
|
+
replace: p,
|
|
2496
|
+
back: h,
|
|
2497
|
+
subscribe: s.subscribe,
|
|
2498
|
+
matchRoute: (v) => K(t, v),
|
|
2499
|
+
getCurrent: () => s.getState(),
|
|
2500
|
+
resolveRouteComponent: bt
|
|
2338
2501
|
};
|
|
2339
2502
|
}
|
|
2340
|
-
function
|
|
2341
|
-
return
|
|
2503
|
+
function At(e, t) {
|
|
2504
|
+
return K(e, t);
|
|
2342
2505
|
}
|
|
2343
|
-
function
|
|
2344
|
-
const t =
|
|
2345
|
-
return
|
|
2506
|
+
function Tt(e) {
|
|
2507
|
+
const t = wt(e);
|
|
2508
|
+
return Le("router-view", {
|
|
2346
2509
|
async render() {
|
|
2347
|
-
if (!t) return
|
|
2510
|
+
if (!t) return Z`<div>Router not initialized.</div>`;
|
|
2348
2511
|
const r = t.getCurrent(), { path: i } = r, n = t.matchRoute(i);
|
|
2349
|
-
if (!n.route) return
|
|
2512
|
+
if (!n.route) return Z`<div>Not found</div>`;
|
|
2350
2513
|
try {
|
|
2351
|
-
const
|
|
2352
|
-
if (typeof
|
|
2353
|
-
return { tag:
|
|
2354
|
-
if (typeof
|
|
2355
|
-
const
|
|
2514
|
+
const o = await t.resolveRouteComponent(n.route);
|
|
2515
|
+
if (typeof o == "string")
|
|
2516
|
+
return { tag: o, props: {}, children: [] };
|
|
2517
|
+
if (typeof o == "function") {
|
|
2518
|
+
const s = o(), a = s instanceof Promise ? await s : s;
|
|
2356
2519
|
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2357
2520
|
}
|
|
2358
|
-
return
|
|
2521
|
+
return Z`<div>Invalid route component</div>`;
|
|
2359
2522
|
} catch {
|
|
2360
|
-
return
|
|
2523
|
+
return Z`<div>Invalid route component</div>`;
|
|
2361
2524
|
}
|
|
2362
2525
|
},
|
|
2363
2526
|
onConnected(r) {
|
|
@@ -2365,7 +2528,7 @@ function At(e) {
|
|
|
2365
2528
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2366
2529
|
});
|
|
2367
2530
|
}
|
|
2368
|
-
}),
|
|
2531
|
+
}), Le("router-link", {
|
|
2369
2532
|
state: {},
|
|
2370
2533
|
props: {
|
|
2371
2534
|
to: { type: String, default: "" },
|
|
@@ -2378,7 +2541,7 @@ function At(e) {
|
|
|
2378
2541
|
disabled: { type: Boolean, default: !1 },
|
|
2379
2542
|
external: { type: Boolean, default: !1 },
|
|
2380
2543
|
class: { type: String, default: "" },
|
|
2381
|
-
style: { type: String, default:
|
|
2544
|
+
style: { type: String, default: Pe`
|
|
2382
2545
|
[aria-disabled="true"] {
|
|
2383
2546
|
pointer-events: none;
|
|
2384
2547
|
opacity: 0.5;
|
|
@@ -2387,30 +2550,30 @@ function At(e) {
|
|
|
2387
2550
|
},
|
|
2388
2551
|
style: (r) => r.style,
|
|
2389
2552
|
render: (r) => {
|
|
2390
|
-
const i = t.getCurrent(), n = r.to,
|
|
2391
|
-
for (const
|
|
2392
|
-
const
|
|
2393
|
-
...
|
|
2553
|
+
const i = t.getCurrent(), n = r.to, o = r.exact, s = r.exactActiveClass, a = r.activeClass, f = r.ariaCurrentValue, p = r.tag, h = r.disabled, C = r.external, u = i.path === n, c = o ? u : i && typeof i.path == "string" ? i.path.startsWith(n) : !1, w = u ? `aria-current="${f}"` : "", v = (r.class || "").split(/\s+/).filter(Boolean), d = {};
|
|
2554
|
+
for (const b of v) d[b] = !0;
|
|
2555
|
+
const g = {
|
|
2556
|
+
...d,
|
|
2394
2557
|
// Also include the configurable names (may duplicate the above)
|
|
2395
|
-
[a]:
|
|
2396
|
-
[
|
|
2397
|
-
}, m =
|
|
2398
|
-
return
|
|
2399
|
-
${
|
|
2558
|
+
[a]: c,
|
|
2559
|
+
[s]: u
|
|
2560
|
+
}, m = p === "button", x = h ? m ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", l = C && (p === "a" || !p) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2561
|
+
return Z`
|
|
2562
|
+
${ze().when(m, Z`
|
|
2400
2563
|
<button
|
|
2401
2564
|
part="button"
|
|
2402
|
-
:class="${
|
|
2403
|
-
${
|
|
2565
|
+
:class="${g}"
|
|
2566
|
+
${w}
|
|
2404
2567
|
${x}
|
|
2405
2568
|
${l}
|
|
2406
2569
|
@click="navigate"
|
|
2407
2570
|
><slot></slot></button>
|
|
2408
|
-
`).otherwise(
|
|
2571
|
+
`).otherwise(Z`
|
|
2409
2572
|
<a
|
|
2410
2573
|
part="link"
|
|
2411
2574
|
href="${n}"
|
|
2412
|
-
:class="${
|
|
2413
|
-
${
|
|
2575
|
+
:class="${g}"
|
|
2576
|
+
${w}
|
|
2414
2577
|
${x}
|
|
2415
2578
|
${l}
|
|
2416
2579
|
@click="navigate"
|
|
@@ -2428,26 +2591,26 @@ function At(e) {
|
|
|
2428
2591
|
}), t;
|
|
2429
2592
|
}
|
|
2430
2593
|
export {
|
|
2431
|
-
|
|
2432
|
-
|
|
2594
|
+
X as GlobalEventBus,
|
|
2595
|
+
Le as component,
|
|
2433
2596
|
$e as createStore,
|
|
2434
|
-
|
|
2597
|
+
Pe as css,
|
|
2435
2598
|
kt as each,
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2599
|
+
_t as emit,
|
|
2600
|
+
ie as eventBus,
|
|
2601
|
+
Z as html,
|
|
2602
|
+
Tt as initRouter,
|
|
2603
|
+
Ct as listen,
|
|
2604
|
+
ze as match,
|
|
2605
|
+
K as matchRoute,
|
|
2606
|
+
At as matchRouteSSR,
|
|
2607
|
+
St as off,
|
|
2445
2608
|
$t as on,
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2609
|
+
Et as once,
|
|
2610
|
+
Re as parseQuery,
|
|
2611
|
+
ge as renderToString,
|
|
2612
|
+
bt as resolveRouteComponent,
|
|
2613
|
+
wt as useRouter,
|
|
2614
|
+
vt as when
|
|
2452
2615
|
};
|
|
2453
2616
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|