@jasonshimmy/custom-elements-runtime 0.2.2 → 0.2.4
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 +14 -14
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +1012 -957
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +14 -14
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/runtime/component.d.ts +8 -0
- package/dist/runtime/helpers.d.ts +8 -0
- package/dist/runtime/template-compiler.d.ts +1 -0
- package/dist/runtime/types.d.ts +7 -4
- package/dist/runtime/vdom.d.ts +2 -16
- package/dist/runtime/watchers.d.ts +0 -4
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function vt(e, t) {
|
|
2
|
+
return fe(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function xt(e, t) {
|
|
5
5
|
return e.map((r, o) => {
|
|
6
6
|
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${o}` : String(r);
|
|
7
|
-
return
|
|
7
|
+
return fe(t(r, o), `each-${n}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Oe() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,18 +17,18 @@ function Re() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return Pe(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Pe(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
26
|
const [r, o] = e[t];
|
|
27
|
-
if (r) return [
|
|
27
|
+
if (r) return [fe(o, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
|
-
return [
|
|
29
|
+
return [fe([], "whenChain-empty")];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function fe(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 te(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class G extends EventTarget {
|
|
40
40
|
handlers = {};
|
|
41
41
|
static instance;
|
|
42
42
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,9 +44,8 @@ class K extends EventTarget {
|
|
|
44
44
|
* Returns the singleton instance of GlobalEventBus
|
|
45
45
|
*/
|
|
46
46
|
static getInstance() {
|
|
47
|
-
return
|
|
47
|
+
return G.instance || (G.instance = new G()), G.instance;
|
|
48
48
|
}
|
|
49
|
-
// Enhanced emit method with better typing and event storm protection
|
|
50
49
|
/**
|
|
51
50
|
* Emit a global event with optional data. Includes event storm protection.
|
|
52
51
|
* @param eventName - Name of the event
|
|
@@ -56,20 +55,18 @@ class K extends EventTarget {
|
|
|
56
55
|
const o = Date.now(), n = this.eventCounters.get(t);
|
|
57
56
|
if (!n || o - n.window > 1e3)
|
|
58
57
|
this.eventCounters.set(t, { count: 1, window: o });
|
|
59
|
-
else if (n.count++, n.count > 50 &&
|
|
60
|
-
console.warn(`Blocking further "${t}" events to prevent infinite loop`);
|
|
58
|
+
else if (n.count++, n.count > 50 && n.count > 100)
|
|
61
59
|
return;
|
|
62
|
-
}
|
|
63
60
|
this.dispatchEvent(new CustomEvent(t, {
|
|
64
61
|
detail: r,
|
|
65
62
|
bubbles: !1,
|
|
66
63
|
// Global events don't need to bubble
|
|
67
64
|
cancelable: !0
|
|
68
65
|
}));
|
|
69
|
-
const
|
|
70
|
-
|
|
66
|
+
const i = this.handlers[t];
|
|
67
|
+
i && i.forEach((s) => {
|
|
71
68
|
try {
|
|
72
|
-
|
|
69
|
+
s(r);
|
|
73
70
|
} catch (a) {
|
|
74
71
|
console.error(`Error in global event handler for "${t}":`, a);
|
|
75
72
|
}
|
|
@@ -115,8 +112,8 @@ class K extends EventTarget {
|
|
|
115
112
|
*/
|
|
116
113
|
once(t, r) {
|
|
117
114
|
return new Promise((o) => {
|
|
118
|
-
const n = this.on(t, (
|
|
119
|
-
n(), r(
|
|
115
|
+
const n = this.on(t, (i) => {
|
|
116
|
+
n(), r(i), o(i);
|
|
120
117
|
});
|
|
121
118
|
});
|
|
122
119
|
}
|
|
@@ -160,8 +157,8 @@ class K extends EventTarget {
|
|
|
160
157
|
this.eventCounters.clear();
|
|
161
158
|
}
|
|
162
159
|
}
|
|
163
|
-
const
|
|
164
|
-
function
|
|
160
|
+
const re = G.getInstance(), wt = (e, t) => re.emit(e, t), kt = (e, t) => re.on(e, t), $t = (e, t) => re.off(e, t), _t = (e, t) => re.once(e, t), St = (e, t, r) => re.listen(e, t, r);
|
|
161
|
+
function $e(e) {
|
|
165
162
|
let t = { ...e };
|
|
166
163
|
const r = [];
|
|
167
164
|
function o(a) {
|
|
@@ -170,19 +167,19 @@ function xe(e) {
|
|
|
170
167
|
function n() {
|
|
171
168
|
return t;
|
|
172
169
|
}
|
|
173
|
-
function
|
|
174
|
-
const
|
|
175
|
-
t = { ...t, ...
|
|
170
|
+
function i(a) {
|
|
171
|
+
const f = typeof a == "function" ? a(t) : a;
|
|
172
|
+
t = { ...t, ...f }, s();
|
|
176
173
|
}
|
|
177
|
-
function
|
|
174
|
+
function s() {
|
|
178
175
|
r.forEach((a) => a(t));
|
|
179
176
|
}
|
|
180
|
-
return { subscribe: o, getState: n, setState:
|
|
177
|
+
return { subscribe: o, getState: n, setState: i };
|
|
181
178
|
}
|
|
182
|
-
function
|
|
179
|
+
function J(e) {
|
|
183
180
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
184
181
|
}
|
|
185
|
-
function
|
|
182
|
+
function H(e) {
|
|
186
183
|
return typeof e == "string" ? e.replace(
|
|
187
184
|
/[&<>"']/g,
|
|
188
185
|
(t) => ({
|
|
@@ -194,247 +191,242 @@ function pe(e) {
|
|
|
194
191
|
})[t]
|
|
195
192
|
) : e;
|
|
196
193
|
}
|
|
197
|
-
function
|
|
194
|
+
function N(e, t) {
|
|
195
|
+
return typeof t == "string" ? t.split(".").reduce((r, o) => r?.[o], e) : t;
|
|
196
|
+
}
|
|
197
|
+
function se(e, t, r) {
|
|
198
|
+
const o = String(t).split("."), n = o.pop();
|
|
199
|
+
if (!n) return;
|
|
200
|
+
const i = o.reduce((s, a) => (s[a] == null && (s[a] = {}), s[a]), e);
|
|
201
|
+
i[n] = r;
|
|
202
|
+
}
|
|
203
|
+
function Ne(e, t, r) {
|
|
198
204
|
if (r)
|
|
199
205
|
for (const [o, n] of Object.entries(r)) {
|
|
200
|
-
let
|
|
201
|
-
if (Array.isArray(n) ? (
|
|
202
|
-
callback:
|
|
203
|
-
options:
|
|
204
|
-
oldValue:
|
|
205
|
-
}),
|
|
206
|
+
let i, s = {};
|
|
207
|
+
if (Array.isArray(n) ? (i = n[0], s = n[1] || {}) : i = n, t.set(o, {
|
|
208
|
+
callback: i,
|
|
209
|
+
options: s,
|
|
210
|
+
oldValue: N(e, o)
|
|
211
|
+
}), s.immediate)
|
|
206
212
|
try {
|
|
207
|
-
const a =
|
|
208
|
-
|
|
213
|
+
const a = N(e, o);
|
|
214
|
+
i(a, void 0, e);
|
|
209
215
|
} catch (a) {
|
|
210
216
|
console.error(`Error in immediate watcher for "${o}":`, a);
|
|
211
217
|
}
|
|
212
218
|
}
|
|
213
219
|
}
|
|
214
|
-
function
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return l.length !== f.length ? !1 : l.every((p) => n(i[p], a[p]));
|
|
225
|
-
}, s = t.get(r);
|
|
226
|
-
if (s && !n(o, s.oldValue))
|
|
220
|
+
function Me(e, t, r, o) {
|
|
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((d, m) => n(d, a[m]));
|
|
226
|
+
const f = Object.keys(s), u = Object.keys(a);
|
|
227
|
+
return f.length !== u.length ? !1 : f.every((d) => n(s[d], a[d]));
|
|
228
|
+
}, i = t.get(r);
|
|
229
|
+
if (i && !n(o, i.oldValue))
|
|
227
230
|
try {
|
|
228
|
-
|
|
229
|
-
} catch (
|
|
230
|
-
console.error(`Error in watcher for "${r}":`,
|
|
231
|
+
i.callback(o, i.oldValue, e), i.oldValue = o;
|
|
232
|
+
} catch (s) {
|
|
233
|
+
console.error(`Error in watcher for "${r}":`, s);
|
|
231
234
|
}
|
|
232
|
-
for (const [
|
|
233
|
-
if (a.options.deep && r.startsWith(
|
|
235
|
+
for (const [s, a] of t.entries())
|
|
236
|
+
if (a.options.deep && r.startsWith(s + "."))
|
|
234
237
|
try {
|
|
235
|
-
const
|
|
236
|
-
n(
|
|
237
|
-
} catch (
|
|
238
|
-
console.error(`Error in deep watcher for "${
|
|
238
|
+
const f = N(e, s);
|
|
239
|
+
n(f, a.oldValue) || (a.callback(f, a.oldValue, e), a.oldValue = f);
|
|
240
|
+
} catch (f) {
|
|
241
|
+
console.error(`Error in deep watcher for "${s}":`, f);
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
|
-
function
|
|
244
|
+
function We(e, t, r) {
|
|
242
245
|
if (!t.props) return;
|
|
243
|
-
function o(n,
|
|
244
|
-
return
|
|
246
|
+
function o(n, i) {
|
|
247
|
+
return i === Boolean ? n === "true" : i === Number ? Number(n) : n;
|
|
245
248
|
}
|
|
246
|
-
Object.entries(t.props).forEach(([n,
|
|
247
|
-
if (
|
|
249
|
+
Object.entries(t.props).forEach(([n, i]) => {
|
|
250
|
+
if (i.type === Function && typeof e[n] == "function")
|
|
248
251
|
r[n] = e[n];
|
|
249
252
|
else {
|
|
250
|
-
const
|
|
251
|
-
|
|
253
|
+
const s = e.getAttribute(J(n));
|
|
254
|
+
s !== null ? r[n] = H(o(s, i.type)) : "default" in i && i.default !== void 0 && (r[n] = H(i.default));
|
|
252
255
|
}
|
|
253
256
|
});
|
|
254
257
|
}
|
|
255
|
-
function
|
|
258
|
+
function qe(e, t, r, o) {
|
|
256
259
|
e.onConnected && !r && (e.onConnected(t), o(!0));
|
|
257
260
|
}
|
|
258
|
-
function
|
|
259
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((
|
|
261
|
+
function De(e, t, r, o, n, i, s, a) {
|
|
262
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()), o(), n(), i(!1), s(null), a(!1);
|
|
260
263
|
}
|
|
261
|
-
function
|
|
264
|
+
function Ie(e, t, r, o, n) {
|
|
262
265
|
e.onAttributeChanged && e.onAttributeChanged(t, r, o, n);
|
|
263
266
|
}
|
|
264
|
-
function
|
|
267
|
+
function V(e, t) {
|
|
265
268
|
if (t && e instanceof HTMLElement) {
|
|
266
269
|
for (const r in t)
|
|
267
270
|
t[r] === e && delete t[r];
|
|
268
271
|
for (const r of Array.from(e.childNodes))
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
function
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
const h = s._state || s;
|
|
285
|
-
return I(h, e);
|
|
286
|
-
}, y = p();
|
|
287
|
-
let c = "text";
|
|
288
|
-
const w = o?.type;
|
|
289
|
-
if (i instanceof HTMLInputElement ? c = w || i.type || "text" : i instanceof HTMLSelectElement ? c = "select" : i instanceof HTMLTextAreaElement && (c = "textarea"), c === "checkbox")
|
|
290
|
-
if (Array.isArray(y)) {
|
|
291
|
-
const h = i?.getAttribute("value") || o?.value || "", u = y.includes(h);
|
|
292
|
-
i && i.checked !== u && (r.checked = u);
|
|
293
|
-
} else {
|
|
294
|
-
const h = i?.getAttribute("true-value") || !0, u = y === h;
|
|
295
|
-
i && i.checked !== u && (r.checked = u);
|
|
272
|
+
V(r, t);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function He(e, t, r, o, n, i, s, a) {
|
|
276
|
+
if (!i) return;
|
|
277
|
+
const f = t.includes("lazy"), u = t.includes("trim"), d = t.includes("number"), m = () => N(i._state || i, e), l = m();
|
|
278
|
+
let h = "text";
|
|
279
|
+
s instanceof HTMLInputElement ? h = o?.type || s.type || "text" : s instanceof HTMLSelectElement ? h = "select" : s instanceof HTMLTextAreaElement && (h = "textarea");
|
|
280
|
+
const w = s instanceof HTMLInputElement || s instanceof HTMLTextAreaElement || s instanceof HTMLSelectElement, v = w ? h === "checkbox" || h === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
281
|
+
if (h === "checkbox")
|
|
282
|
+
if (Array.isArray(l))
|
|
283
|
+
r[v] = l.includes(String(s?.getAttribute("value") ?? o?.value ?? ""));
|
|
284
|
+
else {
|
|
285
|
+
const x = s?.getAttribute("true-value") ?? !0;
|
|
286
|
+
r[v] = l === x;
|
|
296
287
|
}
|
|
297
|
-
else if (
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
const h = i, u = Array.isArray(y) ? y : [];
|
|
288
|
+
else if (h === "radio")
|
|
289
|
+
r[v] = l === (o?.value ?? "");
|
|
290
|
+
else if (h === "select")
|
|
291
|
+
if (s && s.hasAttribute("multiple") && s instanceof HTMLSelectElement) {
|
|
292
|
+
const x = Array.isArray(l) ? l.map(String) : [];
|
|
303
293
|
setTimeout(() => {
|
|
304
|
-
Array.from(
|
|
305
|
-
|
|
306
|
-
g.selected !== b && (g.selected = b);
|
|
294
|
+
Array.from(s.options).forEach((c) => {
|
|
295
|
+
c.selected = x.includes(c.value);
|
|
307
296
|
});
|
|
308
|
-
}, 0);
|
|
297
|
+
}, 0), r[v] = Array.isArray(l) ? l : [];
|
|
309
298
|
} else
|
|
310
|
-
|
|
311
|
-
i instanceof HTMLSelectElement && i.value !== String(y) && (i.value = String(y));
|
|
312
|
-
}, 0);
|
|
299
|
+
r[v] = l;
|
|
313
300
|
else {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
301
|
+
r[v] = l;
|
|
302
|
+
try {
|
|
303
|
+
const x = J(v);
|
|
304
|
+
o && (o[x] = l);
|
|
305
|
+
} catch {
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
const b = f || h === "checkbox" || h === "radio" || h === "select" ? "change" : "input", y = (x) => {
|
|
309
|
+
if (x.isComposing || n._isComposing || x.isTrusted === !1) return;
|
|
310
|
+
const c = x.target;
|
|
311
|
+
if (!c || c._modelUpdating) return;
|
|
312
|
+
let g = c.value;
|
|
313
|
+
if (h === "checkbox") {
|
|
314
|
+
const C = m();
|
|
315
|
+
if (Array.isArray(C)) {
|
|
316
|
+
const S = c.getAttribute("value") ?? "", A = Array.from(C);
|
|
317
|
+
if (c.checked)
|
|
318
|
+
A.includes(S) || A.push(S);
|
|
328
319
|
else {
|
|
329
|
-
const
|
|
330
|
-
|
|
320
|
+
const T = A.indexOf(S);
|
|
321
|
+
T > -1 && A.splice(T, 1);
|
|
331
322
|
}
|
|
332
|
-
|
|
323
|
+
g = A;
|
|
333
324
|
} else {
|
|
334
|
-
const
|
|
335
|
-
|
|
325
|
+
const S = c.getAttribute("true-value") ?? !0, A = c.getAttribute("false-value") ?? !1;
|
|
326
|
+
g = c.checked ? S : A;
|
|
336
327
|
}
|
|
337
|
-
else if (
|
|
338
|
-
|
|
339
|
-
else if (
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
);
|
|
344
|
-
} else if (l && (b = b.trim()), f) {
|
|
345
|
-
const $ = Number(b);
|
|
346
|
-
isNaN($) || (b = $);
|
|
328
|
+
} else if (h === "radio")
|
|
329
|
+
g = c.getAttribute("value") ?? c.value;
|
|
330
|
+
else if (h === "select" && c.multiple)
|
|
331
|
+
g = Array.from(c.selectedOptions).map((C) => C.value);
|
|
332
|
+
else if (u && typeof g == "string" && (g = g.trim()), d) {
|
|
333
|
+
const C = Number(g);
|
|
334
|
+
isNaN(C) || (g = C);
|
|
347
335
|
}
|
|
348
|
-
const
|
|
349
|
-
if (Array.isArray(
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
336
|
+
const p = i._state || i, _ = N(p, e);
|
|
337
|
+
if (Array.isArray(g) && Array.isArray(_) ? JSON.stringify([...g].sort()) !== JSON.stringify([..._].sort()) : g !== _) {
|
|
338
|
+
c._modelUpdating = !0;
|
|
339
|
+
try {
|
|
340
|
+
se(p, e, g), i._requestRender && i._requestRender();
|
|
341
|
+
} finally {
|
|
342
|
+
setTimeout(() => c._modelUpdating = !1, 0);
|
|
343
|
+
}
|
|
354
344
|
}
|
|
355
345
|
};
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
346
|
+
w ? n[b] = y : n[`update:${J(v)}`] = (x) => {
|
|
347
|
+
const c = i._state || i, g = x.detail !== void 0 ? x.detail : x.target?.value, p = N(c, e);
|
|
348
|
+
(Array.isArray(g) && Array.isArray(p) ? JSON.stringify([...g].sort()) !== JSON.stringify([...p].sort()) : g !== p) && (se(c, e, g), i._requestRender && i._requestRender());
|
|
349
|
+
}, (h === "text" || h === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
|
|
350
|
+
n._isComposing = !1;
|
|
351
|
+
const c = x.target;
|
|
352
|
+
c && setTimeout(() => {
|
|
353
|
+
const g = c.value, p = i._state || i, _ = N(p, e);
|
|
354
|
+
let E = g;
|
|
355
|
+
if (u && (E = E.trim()), d) {
|
|
356
|
+
const S = Number(E);
|
|
357
|
+
isNaN(S) || (E = S);
|
|
358
|
+
}
|
|
359
|
+
if (Array.isArray(E) && Array.isArray(_) ? JSON.stringify([...E].sort()) !== JSON.stringify([..._].sort()) : E !== _) {
|
|
360
|
+
c._modelUpdating = !0;
|
|
361
|
+
try {
|
|
362
|
+
se(p, e, E), i._requestRender && i._requestRender();
|
|
363
|
+
} finally {
|
|
364
|
+
setTimeout(() => c._modelUpdating = !1, 0);
|
|
373
365
|
}
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
}
|
|
366
|
+
}
|
|
367
|
+
}, 0);
|
|
368
|
+
});
|
|
378
369
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
370
|
+
function Le(e) {
|
|
371
|
+
const t = e.slice(2);
|
|
372
|
+
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
381
373
|
}
|
|
382
|
-
function
|
|
374
|
+
function Fe(e, t, r, o) {
|
|
383
375
|
if (o) {
|
|
384
376
|
if (typeof e == "object" && e !== null)
|
|
385
|
-
for (const [n,
|
|
386
|
-
t[n] =
|
|
377
|
+
for (const [n, i] of Object.entries(e))
|
|
378
|
+
t[n] = i;
|
|
387
379
|
else if (typeof e == "string")
|
|
388
380
|
try {
|
|
389
381
|
const n = JSON.parse(e);
|
|
390
382
|
if (typeof n == "object" && n !== null) {
|
|
391
|
-
for (const [
|
|
392
|
-
t[
|
|
383
|
+
for (const [i, s] of Object.entries(n))
|
|
384
|
+
t[i] = s;
|
|
393
385
|
return;
|
|
394
386
|
}
|
|
395
387
|
} catch {
|
|
396
|
-
const n =
|
|
388
|
+
const n = N(o, e);
|
|
397
389
|
r[e] = n;
|
|
398
390
|
}
|
|
399
391
|
}
|
|
400
392
|
}
|
|
401
|
-
function
|
|
393
|
+
function Ke(e, t, r) {
|
|
402
394
|
if (!r) return;
|
|
403
|
-
const o =
|
|
395
|
+
const o = N(r, e), n = t.style || "", i = o ? "" : "none";
|
|
404
396
|
if (n) {
|
|
405
|
-
const
|
|
406
|
-
(
|
|
397
|
+
const s = n.split(";").filter(Boolean), a = s.findIndex(
|
|
398
|
+
(f) => f.trim().startsWith("display:")
|
|
407
399
|
);
|
|
408
|
-
a >= 0 ?
|
|
400
|
+
a >= 0 ? s[a] = `display: ${i}` : s.push(`display: ${i}`), t.style = s.join("; ");
|
|
409
401
|
} else
|
|
410
|
-
t.style = `display: ${
|
|
402
|
+
t.style = `display: ${i}`;
|
|
411
403
|
}
|
|
412
|
-
function
|
|
404
|
+
function Ue(e, t, r) {
|
|
413
405
|
if (!r) return;
|
|
414
|
-
const o =
|
|
406
|
+
const o = N(r, e);
|
|
415
407
|
let n = [];
|
|
416
408
|
typeof o == "string" ? n = [o] : Array.isArray(o) ? n = o.filter(Boolean) : typeof o == "object" && (n = Object.entries(o).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
417
|
-
const
|
|
418
|
-
|
|
409
|
+
const i = t.class || "", s = i ? `${i} ${n.join(" ")}`.trim() : n.join(" ");
|
|
410
|
+
s && (t.class = s);
|
|
419
411
|
}
|
|
420
|
-
function
|
|
412
|
+
function Ve(e, t, r) {
|
|
421
413
|
let o;
|
|
422
414
|
if (typeof e == "string") {
|
|
423
415
|
if (!r) return;
|
|
424
|
-
o =
|
|
416
|
+
o = N(r, e);
|
|
425
417
|
} else
|
|
426
418
|
o = e;
|
|
427
419
|
let n = "";
|
|
428
420
|
if (typeof o == "string")
|
|
429
421
|
n = o;
|
|
430
422
|
else if (o && typeof o == "object") {
|
|
431
|
-
const
|
|
432
|
-
for (const [a,
|
|
433
|
-
if (
|
|
434
|
-
const
|
|
423
|
+
const s = [];
|
|
424
|
+
for (const [a, f] of Object.entries(o))
|
|
425
|
+
if (f != null && f !== "") {
|
|
426
|
+
const u = a.replace(
|
|
435
427
|
/[A-Z]/g,
|
|
436
|
-
(
|
|
437
|
-
),
|
|
428
|
+
(l) => `-${l.toLowerCase()}`
|
|
429
|
+
), d = [
|
|
438
430
|
"width",
|
|
439
431
|
"height",
|
|
440
432
|
"top",
|
|
@@ -460,359 +452,391 @@ function Ke(e, t, r) {
|
|
|
460
452
|
"min-height",
|
|
461
453
|
"max-height"
|
|
462
454
|
];
|
|
463
|
-
let
|
|
464
|
-
typeof
|
|
455
|
+
let m = String(f);
|
|
456
|
+
typeof f == "number" && d.includes(u) && (m = `${f}px`), s.push(`${u}: ${m}`);
|
|
465
457
|
}
|
|
466
|
-
n =
|
|
467
|
-
}
|
|
468
|
-
const
|
|
469
|
-
t.style =
|
|
470
|
-
}
|
|
471
|
-
function
|
|
472
|
-
const n = {},
|
|
473
|
-
for (const [a,
|
|
474
|
-
const { value:
|
|
458
|
+
n = s.join("; ") + (s.length > 0 ? ";" : "");
|
|
459
|
+
}
|
|
460
|
+
const i = t.style || "";
|
|
461
|
+
t.style = i + (i && !i.endsWith(";") ? "; " : "") + n;
|
|
462
|
+
}
|
|
463
|
+
function Re(e, t, r, o) {
|
|
464
|
+
const n = {}, i = { ...o || {} }, s = {};
|
|
465
|
+
for (const [a, f] of Object.entries(e)) {
|
|
466
|
+
const { value: u, modifiers: d, arg: m } = f;
|
|
467
|
+
if (a === "model" || a.startsWith("model:")) {
|
|
468
|
+
const l = a.split(":"), h = l.length > 1 ? l[1] : m;
|
|
469
|
+
He(
|
|
470
|
+
typeof u == "string" ? u : String(u),
|
|
471
|
+
d,
|
|
472
|
+
n,
|
|
473
|
+
i,
|
|
474
|
+
s,
|
|
475
|
+
t,
|
|
476
|
+
r,
|
|
477
|
+
h
|
|
478
|
+
);
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
475
481
|
switch (a) {
|
|
476
|
-
case "model":
|
|
477
|
-
qe(
|
|
478
|
-
typeof f == "string" ? f : String(f),
|
|
479
|
-
p,
|
|
480
|
-
n,
|
|
481
|
-
s,
|
|
482
|
-
i,
|
|
483
|
-
t,
|
|
484
|
-
r
|
|
485
|
-
);
|
|
486
|
-
break;
|
|
487
482
|
case "bind":
|
|
488
|
-
|
|
483
|
+
Fe(u, n, i, t);
|
|
489
484
|
break;
|
|
490
485
|
case "show":
|
|
491
|
-
|
|
486
|
+
Ke(u, i, t);
|
|
492
487
|
break;
|
|
493
488
|
case "class":
|
|
494
|
-
|
|
489
|
+
Ue(u, i, t);
|
|
495
490
|
break;
|
|
496
491
|
case "style":
|
|
497
|
-
|
|
492
|
+
Ve(u, i, t);
|
|
498
493
|
break;
|
|
499
494
|
}
|
|
500
495
|
}
|
|
501
|
-
return { props: n, attrs:
|
|
496
|
+
return { props: n, attrs: i, listeners: s };
|
|
502
497
|
}
|
|
503
|
-
function
|
|
498
|
+
function ke(e, t) {
|
|
504
499
|
if (Array.isArray(e)) {
|
|
505
|
-
const
|
|
506
|
-
return e.map((
|
|
507
|
-
if (!
|
|
508
|
-
let a =
|
|
500
|
+
const i = /* @__PURE__ */ new Set();
|
|
501
|
+
return e.map((s) => {
|
|
502
|
+
if (!s || typeof s != "object") return s;
|
|
503
|
+
let a = s.props?.key ?? s.key;
|
|
509
504
|
if (!a) {
|
|
510
|
-
const
|
|
511
|
-
a =
|
|
505
|
+
const m = s.tag || "node", l = s.props?.attrs?.id ?? s.props?.attrs?.name ?? s.props?.attrs?.["data-key"] ?? "";
|
|
506
|
+
a = l ? `${t}:${m}:${l}` : `${t}:${m}`;
|
|
512
507
|
}
|
|
513
|
-
let
|
|
514
|
-
for (;
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
let
|
|
518
|
-
return Array.isArray(
|
|
508
|
+
let f = a, u = 1;
|
|
509
|
+
for (; i.has(f); )
|
|
510
|
+
f = `${a}#${u++}`;
|
|
511
|
+
i.add(f);
|
|
512
|
+
let d = s.children;
|
|
513
|
+
return Array.isArray(d) && (d = ke(d, f)), { ...s, key: f, children: d };
|
|
519
514
|
});
|
|
520
515
|
}
|
|
521
516
|
const r = e;
|
|
522
517
|
let o = r.props?.key ?? r.key ?? t, n = r.children;
|
|
523
|
-
return Array.isArray(n) && (n =
|
|
518
|
+
return Array.isArray(n) && (n = ke(n, o)), { ...r, key: o, children: n };
|
|
524
519
|
}
|
|
525
|
-
function
|
|
526
|
-
const n = r.directives ?? {},
|
|
520
|
+
function Je(e, t, r, o) {
|
|
521
|
+
const n = r.directives ?? {}, i = Re(
|
|
527
522
|
n,
|
|
528
523
|
o,
|
|
529
524
|
e,
|
|
530
525
|
r.attrs
|
|
531
|
-
),
|
|
526
|
+
), s = {
|
|
532
527
|
...t.props,
|
|
533
528
|
...r.props,
|
|
534
|
-
...
|
|
529
|
+
...i.props
|
|
535
530
|
}, a = {
|
|
536
531
|
...t.attrs,
|
|
537
532
|
...r.attrs,
|
|
538
|
-
...
|
|
539
|
-
},
|
|
540
|
-
for (const
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
543
|
-
if (
|
|
544
|
-
e.value !==
|
|
545
|
-
else if (
|
|
546
|
-
e.checked = !!
|
|
547
|
-
else if (
|
|
548
|
-
const
|
|
549
|
-
typeof
|
|
550
|
-
} else
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
533
|
+
...i.attrs
|
|
534
|
+
}, f = t.props ?? {}, u = s;
|
|
535
|
+
for (const l in { ...f, ...u }) {
|
|
536
|
+
const h = f[l], w = u[l];
|
|
537
|
+
if (h !== w) {
|
|
538
|
+
if (l === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
539
|
+
e.value !== w && (e.value = w ?? "");
|
|
540
|
+
else if (l === "checked" && e instanceof HTMLInputElement)
|
|
541
|
+
e.checked = !!w;
|
|
542
|
+
else if (l.startsWith("on") && typeof w == "function") {
|
|
543
|
+
const $ = Le(l);
|
|
544
|
+
typeof h == "function" && e.removeEventListener($, h), e.addEventListener($, w);
|
|
545
|
+
} else if (w == null || w === !1)
|
|
546
|
+
e.removeAttribute(l);
|
|
547
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || l in e)
|
|
548
|
+
try {
|
|
549
|
+
e[l] = w;
|
|
550
|
+
} catch {
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
for (const [l, h] of Object.entries(
|
|
555
|
+
i.listeners || {}
|
|
554
556
|
))
|
|
555
|
-
e.addEventListener(
|
|
556
|
-
const
|
|
557
|
-
for (const
|
|
558
|
-
const
|
|
559
|
-
|
|
557
|
+
e.addEventListener(l, h);
|
|
558
|
+
const d = t.attrs ?? {}, m = a;
|
|
559
|
+
for (const l in { ...d, ...m }) {
|
|
560
|
+
const h = d[l], w = m[l];
|
|
561
|
+
h !== w && (w == null || w === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(w)));
|
|
560
562
|
}
|
|
561
563
|
}
|
|
562
|
-
function
|
|
564
|
+
function M(e, t, r) {
|
|
563
565
|
if (typeof e == "string")
|
|
564
566
|
return document.createTextNode(e);
|
|
565
567
|
if (e.tag === "#text") {
|
|
566
|
-
const
|
|
568
|
+
const m = document.createTextNode(
|
|
567
569
|
typeof e.children == "string" ? e.children : ""
|
|
568
570
|
);
|
|
569
|
-
return e.key != null && (
|
|
571
|
+
return e.key != null && (m.key = e.key), m;
|
|
570
572
|
}
|
|
571
573
|
if (e.tag === "#anchor") {
|
|
572
|
-
const
|
|
573
|
-
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
for (const
|
|
577
|
-
const
|
|
578
|
-
|
|
574
|
+
const m = e, l = Array.isArray(m.children) ? m.children : [], h = document.createTextNode(""), w = document.createTextNode("");
|
|
575
|
+
m.key != null && (h.key = `${m.key}:start`, w.key = `${m.key}:end`), m._startNode = h, m._endNode = w;
|
|
576
|
+
const $ = document.createDocumentFragment();
|
|
577
|
+
$.appendChild(h);
|
|
578
|
+
for (const v of l) {
|
|
579
|
+
const b = M(v, t);
|
|
580
|
+
$.appendChild(b);
|
|
579
581
|
}
|
|
580
|
-
return
|
|
582
|
+
return $.appendChild(w), $;
|
|
581
583
|
}
|
|
582
584
|
const o = document.createElement(e.tag);
|
|
583
585
|
e.key != null && (o.key = e.key);
|
|
584
|
-
const { props: n = {}, attrs:
|
|
586
|
+
const { props: n = {}, attrs: i = {}, directives: s = {} } = e.props ?? {}, a = Re(s, t, o, i), f = {
|
|
585
587
|
...n,
|
|
586
588
|
...a.props
|
|
587
|
-
},
|
|
588
|
-
...
|
|
589
|
+
}, u = {
|
|
590
|
+
...i,
|
|
589
591
|
...a.attrs
|
|
590
592
|
};
|
|
591
|
-
for (const
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
typeof
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}
|
|
593
|
+
for (const m in u) {
|
|
594
|
+
const l = u[m];
|
|
595
|
+
typeof m != "string" || /\[object Object\]/.test(m) || (typeof l == "boolean" ? l && o.setAttribute(m, "") : l != null && o.setAttribute(m, l));
|
|
596
|
+
}
|
|
597
|
+
for (const m in f) {
|
|
598
|
+
const l = f[m];
|
|
599
|
+
if (!(typeof m != "string" || /\[object Object\]/.test(m)))
|
|
600
|
+
if (m === "value" && (o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement))
|
|
601
|
+
o.value = l ?? "";
|
|
602
|
+
else if (m === "checked" && o instanceof HTMLInputElement)
|
|
603
|
+
o.checked = !!l;
|
|
604
|
+
else if (m.startsWith("on") && typeof l == "function")
|
|
605
|
+
o.addEventListener(Le(m), l);
|
|
606
|
+
else {
|
|
607
|
+
if (m.startsWith("on") && l === void 0)
|
|
608
|
+
continue;
|
|
609
|
+
if (l == null || l === !1)
|
|
610
|
+
o.removeAttribute(m);
|
|
611
|
+
else if ((e.props?.isCustomElement ?? !1) || m in o)
|
|
612
|
+
try {
|
|
613
|
+
o[m] = l;
|
|
614
|
+
} catch {
|
|
615
|
+
}
|
|
616
|
+
}
|
|
616
617
|
}
|
|
617
|
-
for (const [
|
|
618
|
+
for (const [m, l] of Object.entries(
|
|
618
619
|
a.listeners || {}
|
|
619
620
|
))
|
|
620
|
-
o.addEventListener(
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
621
|
+
o.addEventListener(m, l);
|
|
622
|
+
const d = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
623
|
+
typeof e != "string" && d && r && (r[d] = o);
|
|
624
|
+
try {
|
|
625
|
+
if (typeof o._applyProps == "function")
|
|
626
|
+
try {
|
|
627
|
+
o._applyProps(o._cfg);
|
|
628
|
+
} catch {
|
|
629
|
+
}
|
|
630
|
+
typeof o.requestRender == "function" ? o.requestRender() : typeof o._render == "function" && o._render(o._cfg);
|
|
631
|
+
} catch {
|
|
632
|
+
}
|
|
633
|
+
if (Array.isArray(e.children))
|
|
634
|
+
for (const m of e.children)
|
|
635
|
+
o.appendChild(M(m, t, r));
|
|
625
636
|
else typeof e.children == "string" && (o.textContent = e.children);
|
|
626
637
|
return o;
|
|
627
638
|
}
|
|
628
|
-
function
|
|
639
|
+
function Ze(e, t, r, o, n) {
|
|
629
640
|
if (typeof r == "string") {
|
|
630
641
|
e.textContent !== r && (e.textContent = r);
|
|
631
642
|
return;
|
|
632
643
|
}
|
|
633
644
|
if (!Array.isArray(r)) return;
|
|
634
|
-
const
|
|
635
|
-
for (const
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
for (const
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
}
|
|
642
|
-
const
|
|
643
|
-
let
|
|
644
|
-
function
|
|
645
|
-
let
|
|
646
|
-
for (;
|
|
647
|
-
|
|
648
|
-
}
|
|
649
|
-
function
|
|
650
|
-
const
|
|
651
|
-
let
|
|
652
|
-
for (;
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
if (
|
|
656
|
-
const
|
|
657
|
-
for (const C of
|
|
658
|
-
C && C.key != null &&
|
|
659
|
-
for (const C of
|
|
660
|
-
const
|
|
661
|
-
|
|
645
|
+
const i = Array.from(e.childNodes), s = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
646
|
+
for (const h of s)
|
|
647
|
+
h && h.key != null && a.set(h.key, h);
|
|
648
|
+
const f = /* @__PURE__ */ new Map();
|
|
649
|
+
for (const h of i) {
|
|
650
|
+
const w = h.key;
|
|
651
|
+
w != null && f.set(w, h);
|
|
652
|
+
}
|
|
653
|
+
const u = /* @__PURE__ */ new Set();
|
|
654
|
+
let d = e.firstChild;
|
|
655
|
+
function m(h, w) {
|
|
656
|
+
let $ = h;
|
|
657
|
+
for (; $ && (u.add($), $ !== w); )
|
|
658
|
+
$ = $.nextSibling;
|
|
659
|
+
}
|
|
660
|
+
function l(h, w, $, v) {
|
|
661
|
+
const b = [];
|
|
662
|
+
let y = h.nextSibling;
|
|
663
|
+
for (; y && y !== w; )
|
|
664
|
+
b.push(y), y = y.nextSibling;
|
|
665
|
+
const x = Array.isArray($) ? $ : [];
|
|
666
|
+
if (v.some((g) => g && g.key != null) || x.some((g) => g && g.key != null)) {
|
|
667
|
+
const g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
668
|
+
for (const C of x)
|
|
669
|
+
C && C.key != null && g.set(C.key, C);
|
|
670
|
+
for (const C of b) {
|
|
671
|
+
const S = C.key;
|
|
672
|
+
S != null && p.set(S, C);
|
|
662
673
|
}
|
|
663
|
-
const
|
|
664
|
-
let
|
|
665
|
-
for (const C of
|
|
666
|
-
let
|
|
667
|
-
if (C.key != null &&
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
674
|
+
const _ = /* @__PURE__ */ new Set();
|
|
675
|
+
let E = h.nextSibling;
|
|
676
|
+
for (const C of v) {
|
|
677
|
+
let S;
|
|
678
|
+
if (C.key != null && p.has(C.key)) {
|
|
679
|
+
const A = g.get(C.key);
|
|
680
|
+
S = ae(
|
|
681
|
+
p.get(C.key),
|
|
682
|
+
A,
|
|
672
683
|
C,
|
|
673
684
|
o
|
|
674
|
-
),
|
|
685
|
+
), _.add(S), S !== E && e.contains(S) && e.insertBefore(S, E);
|
|
675
686
|
} else
|
|
676
|
-
|
|
677
|
-
|
|
687
|
+
S = M(C, o), e.insertBefore(S, E), _.add(S);
|
|
688
|
+
E = S.nextSibling;
|
|
678
689
|
}
|
|
679
|
-
for (const C of
|
|
680
|
-
|
|
690
|
+
for (const C of b)
|
|
691
|
+
!_.has(C) && e.contains(C) && e.removeChild(C);
|
|
681
692
|
} else {
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
|
|
693
|
+
const g = Math.min(
|
|
694
|
+
x.length,
|
|
695
|
+
v.length
|
|
685
696
|
);
|
|
686
|
-
for (let
|
|
687
|
-
const
|
|
688
|
-
C !==
|
|
697
|
+
for (let p = 0; p < g; p++) {
|
|
698
|
+
const _ = x[p], E = v[p], C = ae(b[p], _, E, o);
|
|
699
|
+
C !== b[p] && (e.insertBefore(C, b[p]), e.removeChild(b[p]));
|
|
689
700
|
}
|
|
690
|
-
for (let
|
|
691
|
-
e.insertBefore(
|
|
692
|
-
for (let
|
|
693
|
-
e.removeChild(
|
|
701
|
+
for (let p = g; p < v.length; p++)
|
|
702
|
+
e.insertBefore(M(v[p], o), w);
|
|
703
|
+
for (let p = g; p < b.length; p++)
|
|
704
|
+
e.removeChild(b[p]);
|
|
694
705
|
}
|
|
695
706
|
}
|
|
696
|
-
for (const
|
|
697
|
-
let
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
700
|
-
let
|
|
701
|
-
const
|
|
702
|
-
if (
|
|
703
|
-
e.insertBefore(
|
|
704
|
-
for (const
|
|
705
|
-
e.insertBefore(
|
|
706
|
-
e.insertBefore(
|
|
707
|
+
for (const h of r) {
|
|
708
|
+
let w;
|
|
709
|
+
if (h.tag === "#anchor") {
|
|
710
|
+
const $ = h.key, v = `${$}:start`, b = `${$}:end`;
|
|
711
|
+
let y = f.get(v), x = f.get(b);
|
|
712
|
+
const c = Array.isArray(h.children) ? h.children : [];
|
|
713
|
+
if (y || (y = document.createTextNode(""), y.key = v), x || (x = document.createTextNode(""), x.key = b), h._startNode = y, h._endNode = x, !e.contains(y) || !e.contains(x)) {
|
|
714
|
+
e.insertBefore(y, d);
|
|
715
|
+
for (const g of c)
|
|
716
|
+
e.insertBefore(M(g, o), d);
|
|
717
|
+
e.insertBefore(x, d);
|
|
707
718
|
} else
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
a.get(
|
|
712
|
-
|
|
719
|
+
l(
|
|
720
|
+
y,
|
|
721
|
+
x,
|
|
722
|
+
a.get($)?.children,
|
|
723
|
+
c
|
|
713
724
|
);
|
|
714
|
-
y
|
|
725
|
+
m(y, x), d = x.nextSibling;
|
|
715
726
|
continue;
|
|
716
727
|
}
|
|
717
|
-
if (
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
728
|
+
if (h.key != null && f.has(h.key)) {
|
|
729
|
+
const $ = a.get(h.key);
|
|
730
|
+
w = ae(
|
|
731
|
+
f.get(h.key),
|
|
732
|
+
$,
|
|
733
|
+
h,
|
|
723
734
|
o,
|
|
724
735
|
n
|
|
725
|
-
),
|
|
736
|
+
), u.add(w), w !== d && e.contains(w) && (d && !e.contains(d) && (d = null), e.insertBefore(w, d));
|
|
726
737
|
} else
|
|
727
|
-
|
|
728
|
-
|
|
738
|
+
w = M(h, o, n), d && !e.contains(d) && (d = null), e.insertBefore(w, d), u.add(w);
|
|
739
|
+
d = w.nextSibling;
|
|
729
740
|
}
|
|
730
|
-
for (const
|
|
731
|
-
!
|
|
741
|
+
for (const h of i)
|
|
742
|
+
!u.has(h) && e.contains(h) && (V(h, n), e.removeChild(h));
|
|
732
743
|
}
|
|
733
|
-
function
|
|
734
|
-
if (t && typeof t != "string" && t.props?.ref && n &&
|
|
744
|
+
function ae(e, t, r, o, n) {
|
|
745
|
+
if (t && typeof t != "string" && t.props?.ref && n && V(e, n), t === r) return e;
|
|
735
746
|
if (typeof r == "string") {
|
|
736
747
|
if (e.nodeType === Node.TEXT_NODE)
|
|
737
748
|
return e.textContent !== r && (e.textContent = r), e;
|
|
738
749
|
{
|
|
739
|
-
const
|
|
740
|
-
return e.parentNode?.replaceChild(
|
|
750
|
+
const s = document.createTextNode(r);
|
|
751
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
741
752
|
}
|
|
742
753
|
}
|
|
743
754
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
for (const
|
|
749
|
-
const
|
|
750
|
-
|
|
755
|
+
const s = r, a = Array.isArray(s.children) ? s.children : [], f = s._startNode ?? document.createTextNode(""), u = s._endNode ?? document.createTextNode("");
|
|
756
|
+
s.key != null && (f.key = `${s.key}:start`, u.key = `${s.key}:end`), s._startNode = f, s._endNode = u;
|
|
757
|
+
const d = document.createDocumentFragment();
|
|
758
|
+
d.appendChild(f);
|
|
759
|
+
for (const m of a) {
|
|
760
|
+
const l = M(m, o);
|
|
761
|
+
d.appendChild(l);
|
|
751
762
|
}
|
|
752
|
-
return
|
|
763
|
+
return d.appendChild(u), e.parentNode?.replaceChild(d, e), f;
|
|
753
764
|
}
|
|
754
765
|
if (!r) {
|
|
755
|
-
|
|
756
|
-
const
|
|
757
|
-
return e.parentNode?.replaceChild(
|
|
766
|
+
V(e, n);
|
|
767
|
+
const s = document.createComment("removed");
|
|
768
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
758
769
|
}
|
|
759
770
|
if (!t || typeof t == "string") {
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
771
|
+
V(e, n);
|
|
772
|
+
const s = M(r, o, n);
|
|
773
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
763
774
|
}
|
|
764
775
|
if (r.tag === "#anchor") {
|
|
765
|
-
const
|
|
766
|
-
r.key != null && (a.key = `${r.key}:start`,
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
for (const
|
|
770
|
-
|
|
771
|
-
return
|
|
776
|
+
const s = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), f = r._endNode ?? document.createTextNode("");
|
|
777
|
+
r.key != null && (a.key = `${r.key}:start`, f.key = `${r.key}:end`), r._startNode = a, r._endNode = f;
|
|
778
|
+
const u = document.createDocumentFragment();
|
|
779
|
+
u.appendChild(a);
|
|
780
|
+
for (const d of s)
|
|
781
|
+
u.appendChild(M(d, o));
|
|
782
|
+
return u.appendChild(f), e.parentNode?.replaceChild(u, e), a;
|
|
772
783
|
}
|
|
773
784
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
774
|
-
const
|
|
775
|
-
return
|
|
785
|
+
const s = e;
|
|
786
|
+
return Je(s, t.props || {}, r.props || {}, o), Ze(s, t.children, r.children, o, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), s;
|
|
776
787
|
}
|
|
777
|
-
|
|
778
|
-
const
|
|
779
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
788
|
+
V(e, n);
|
|
789
|
+
const i = M(r, o, n);
|
|
790
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = i), e.parentNode?.replaceChild(i, e), i;
|
|
780
791
|
}
|
|
781
|
-
function
|
|
792
|
+
function Ye(e, t, r, o) {
|
|
782
793
|
let n;
|
|
783
794
|
Array.isArray(t) ? t.length === 1 ? (n = t[0], n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })) : n = { tag: "div", key: "__root__", children: t } : (n = t, n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })), n && typeof n == "object" && n.tag === "#anchor" && (n = {
|
|
784
795
|
tag: "div",
|
|
785
796
|
key: "__anchor_root__",
|
|
786
797
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
787
798
|
children: [n]
|
|
788
|
-
}), n =
|
|
789
|
-
const
|
|
799
|
+
}), n = ke(n, String(n.key ?? "root"));
|
|
800
|
+
const i = e._prevVNode ?? null, s = e._prevDom ?? e.firstChild ?? null;
|
|
790
801
|
let a;
|
|
791
|
-
|
|
792
|
-
const
|
|
793
|
-
for (let
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
}
|
|
797
|
-
|
|
802
|
+
i && s ? typeof i != "string" && typeof n != "string" && i.tag === n.tag && i.key === n.key ? a = ae(s, i, n, r, o) : (a = M(n, r, o), e.replaceChild(a, s)) : (a = M(n, r, o), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
803
|
+
const f = [];
|
|
804
|
+
for (let u = 0; u < e.childNodes.length; u++) {
|
|
805
|
+
const d = e.childNodes[u];
|
|
806
|
+
d !== a && d.nodeName !== "STYLE" && (V(d, o), f.push(d));
|
|
807
|
+
}
|
|
808
|
+
f.forEach((u) => e.removeChild(u)), e._prevVNode = n, e._prevDom = a;
|
|
809
|
+
}
|
|
810
|
+
function he(e) {
|
|
811
|
+
if (typeof e == "string") return H(e);
|
|
812
|
+
if (e.tag === "#text")
|
|
813
|
+
return typeof e.children == "string" ? H(e.children) : "";
|
|
814
|
+
if (e.tag === "#anchor")
|
|
815
|
+
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(he).join("");
|
|
816
|
+
let t = "";
|
|
817
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, i]) => ` ${n}="${H(String(i))}"`).join(""));
|
|
818
|
+
let r = "";
|
|
819
|
+
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, i]) => ` ${n}="${H(String(i))}"`).join(""));
|
|
820
|
+
const o = Array.isArray(e.children) ? e.children.filter(Boolean).map(he).join("") : typeof e.children == "string" ? H(e.children) : e.children ? he(e.children) : "";
|
|
821
|
+
return `<${e.tag}${t}${r}>${o}</${e.tag}>`;
|
|
798
822
|
}
|
|
799
|
-
function
|
|
823
|
+
function ze(e, ...t) {
|
|
800
824
|
let r = "";
|
|
801
825
|
for (let o = 0; o < e.length; o++)
|
|
802
826
|
r += e[o], o < t.length && (r += t[o]);
|
|
803
827
|
return r;
|
|
804
828
|
}
|
|
805
|
-
function
|
|
829
|
+
function Be(e) {
|
|
806
830
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
807
831
|
}
|
|
808
|
-
let
|
|
809
|
-
function
|
|
810
|
-
return
|
|
832
|
+
let oe = null;
|
|
833
|
+
function _e() {
|
|
834
|
+
return oe || (oe = new CSSStyleSheet(), oe.replaceSync(Be(Qe))), oe;
|
|
811
835
|
}
|
|
812
|
-
function
|
|
836
|
+
function Ge(e) {
|
|
813
837
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
814
838
|
}
|
|
815
|
-
const
|
|
839
|
+
const Qe = ze`
|
|
816
840
|
:host, *, ::before, ::after {
|
|
817
841
|
all: isolate;
|
|
818
842
|
box-sizing: border-box;
|
|
@@ -870,7 +894,7 @@ const Ye = je`
|
|
|
870
894
|
sup { top: -.5em }
|
|
871
895
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
872
896
|
[hidden] { display: none }
|
|
873
|
-
`,
|
|
897
|
+
`, Xe = {
|
|
874
898
|
gray: {
|
|
875
899
|
50: "var(--color-gray-50, #f9fafb)",
|
|
876
900
|
100: "var(--color-gray-100, #f3f4f6)",
|
|
@@ -1004,8 +1028,10 @@ const Ye = je`
|
|
|
1004
1028
|
900: "var(--color-rose-900, #881337)"
|
|
1005
1029
|
},
|
|
1006
1030
|
white: { DEFAULT: "var(--color-white, #ffffff)" },
|
|
1007
|
-
black: { DEFAULT: "var(--color-black, #000000)" }
|
|
1008
|
-
|
|
1031
|
+
black: { DEFAULT: "var(--color-black, #000000)" },
|
|
1032
|
+
transparent: { DEFAULT: "var(--color-transparent, transparent)" },
|
|
1033
|
+
current: { DEFAULT: "var(--color-current, currentColor)" }
|
|
1034
|
+
}, ge = {
|
|
1009
1035
|
/* Display */
|
|
1010
1036
|
block: "display:block;",
|
|
1011
1037
|
inline: "display:inline;",
|
|
@@ -1109,12 +1135,6 @@ const Ye = je`
|
|
|
1109
1135
|
"rounded-md": "border-radius:0.375rem;",
|
|
1110
1136
|
"rounded-lg": "border-radius:0.5rem;",
|
|
1111
1137
|
"rounded-full": "border-radius:9999px;",
|
|
1112
|
-
/* Ring (box-shadow for focus) */
|
|
1113
|
-
"ring-0": "box-shadow:none;",
|
|
1114
|
-
"ring-1": "box-shadow:0 0 0 1px rgba(59,130,246,0.5);",
|
|
1115
|
-
"ring-2": "box-shadow:0 0 0 2px rgba(59,130,246,0.5);",
|
|
1116
|
-
"ring-4": "box-shadow:0 0 0 4px rgba(59,130,246,0.5);",
|
|
1117
|
-
"ring-8": "box-shadow:0 0 0 8px rgba(59,130,246,0.5);",
|
|
1118
1138
|
/* Shadow and effects */
|
|
1119
1139
|
"shadow-none": "box-shadow:0 0 #0000;",
|
|
1120
1140
|
"shadow-xs": "box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);",
|
|
@@ -1123,8 +1143,6 @@ const Ye = je`
|
|
|
1123
1143
|
"shadow-lg": "box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);",
|
|
1124
1144
|
"shadow-xl": "box-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);",
|
|
1125
1145
|
"shadow-2xl": "box-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);",
|
|
1126
|
-
/* Transitions */
|
|
1127
|
-
transition: "transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4,0,0.2,1);",
|
|
1128
1146
|
/* Text Overflow & Whitespace */
|
|
1129
1147
|
truncate: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",
|
|
1130
1148
|
/* Visibility */
|
|
@@ -1175,10 +1193,14 @@ const Ye = je`
|
|
|
1175
1193
|
"line-clamp-2": "display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1176
1194
|
"line-clamp-3": "display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1177
1195
|
"line-clamp-4": "display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1178
|
-
/*
|
|
1196
|
+
/* Transitions */
|
|
1197
|
+
transition: "transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;",
|
|
1198
|
+
"transition-all": "transition-property:all;",
|
|
1179
1199
|
"transition-colors": "transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;",
|
|
1200
|
+
"transition-shadow": "transition-property:box-shadow;",
|
|
1180
1201
|
"transition-opacity": "transition-property:opacity;",
|
|
1181
1202
|
"transition-transform": "transition-property:transform;",
|
|
1203
|
+
"transition-none": "transition-property:none;",
|
|
1182
1204
|
/* Z-index */
|
|
1183
1205
|
"z-0": "z-index:0;",
|
|
1184
1206
|
"z-10": "z-index:10;",
|
|
@@ -1186,7 +1208,7 @@ const Ye = je`
|
|
|
1186
1208
|
"z-30": "z-index:30;",
|
|
1187
1209
|
"z-40": "z-index:40;",
|
|
1188
1210
|
"z-50": "z-index:50;"
|
|
1189
|
-
},
|
|
1211
|
+
}, et = "0.25rem", Se = {
|
|
1190
1212
|
m: ["margin"],
|
|
1191
1213
|
mx: ["margin-inline"],
|
|
1192
1214
|
my: ["margin-block"],
|
|
@@ -1218,34 +1240,34 @@ const Ye = je`
|
|
|
1218
1240
|
"gap-x": ["column-gap"],
|
|
1219
1241
|
"gap-y": ["row-gap"]
|
|
1220
1242
|
};
|
|
1221
|
-
function
|
|
1243
|
+
function P(e, t) {
|
|
1222
1244
|
let r = 0, o = 0;
|
|
1223
1245
|
for (let n = 0; n < e.length; n++) {
|
|
1224
|
-
const
|
|
1225
|
-
if (
|
|
1226
|
-
else if (
|
|
1227
|
-
else if (
|
|
1228
|
-
else if (
|
|
1229
|
-
else if (r === 0 && o === 0 && (
|
|
1246
|
+
const i = e[n];
|
|
1247
|
+
if (i === "[") r++;
|
|
1248
|
+
else if (i === "]" && r > 0) r--;
|
|
1249
|
+
else if (i === "(") o++;
|
|
1250
|
+
else if (i === ")" && o > 0) o--;
|
|
1251
|
+
else if (r === 0 && o === 0 && (i === ">" || i === "+" || i === "~" || i === " "))
|
|
1230
1252
|
return e.slice(0, n) + t + e.slice(n);
|
|
1231
1253
|
}
|
|
1232
1254
|
return e + t;
|
|
1233
1255
|
}
|
|
1234
|
-
const
|
|
1256
|
+
const tt = {
|
|
1235
1257
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1236
1258
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1237
|
-
hover: (e, t) => `${
|
|
1238
|
-
focus: (e, t) => `${
|
|
1239
|
-
active: (e, t) => `${
|
|
1240
|
-
disabled: (e, t) => `${
|
|
1241
|
-
visited: (e, t) => `${
|
|
1242
|
-
checked: (e, t) => `${
|
|
1243
|
-
first: (e, t) => `${
|
|
1244
|
-
last: (e, t) => `${
|
|
1245
|
-
odd: (e, t) => `${
|
|
1246
|
-
even: (e, t) => `${
|
|
1247
|
-
"focus-within": (e, t) => `${
|
|
1248
|
-
"focus-visible": (e, t) => `${
|
|
1259
|
+
hover: (e, t) => `${P(e, ":hover")}{${t}}`,
|
|
1260
|
+
focus: (e, t) => `${P(e, ":focus")}{${t}}`,
|
|
1261
|
+
active: (e, t) => `${P(e, ":active")}{${t}}`,
|
|
1262
|
+
disabled: (e, t) => `${P(e, ":disabled")}{${t}}`,
|
|
1263
|
+
visited: (e, t) => `${P(e, ":visited")}{${t}}`,
|
|
1264
|
+
checked: (e, t) => `${P(e, ":checked")}{${t}}`,
|
|
1265
|
+
first: (e, t) => `${P(e, ":first-child")}{${t}}`,
|
|
1266
|
+
last: (e, t) => `${P(e, ":last-child")}{${t}}`,
|
|
1267
|
+
odd: (e, t) => `${P(e, ":nth-child(odd)")}{${t}}`,
|
|
1268
|
+
even: (e, t) => `${P(e, ":nth-child(even)")}{${t}}`,
|
|
1269
|
+
"focus-within": (e, t) => `${P(e, ":focus-within")}{${t}}`,
|
|
1270
|
+
"focus-visible": (e, t) => `${P(e, ":focus-visible")}{${t}}`,
|
|
1249
1271
|
"group-hover": (e, t) => `.group:hover ${e}{${t}}`,
|
|
1250
1272
|
"group-focus": (e, t) => `.group:focus ${e}{${t}}`,
|
|
1251
1273
|
"group-active": (e, t) => `.group:active ${e}{${t}}`,
|
|
@@ -1254,7 +1276,7 @@ const Ge = {
|
|
|
1254
1276
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1255
1277
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1256
1278
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1257
|
-
},
|
|
1279
|
+
}, ye = {
|
|
1258
1280
|
// Responsive
|
|
1259
1281
|
sm: "(min-width:640px)",
|
|
1260
1282
|
md: "(min-width:768px)",
|
|
@@ -1263,24 +1285,24 @@ const Ge = {
|
|
|
1263
1285
|
"2xl": "(min-width:1536px)",
|
|
1264
1286
|
// Dark mode (now plain string)
|
|
1265
1287
|
dark: "(prefers-color-scheme: dark)"
|
|
1266
|
-
},
|
|
1267
|
-
function
|
|
1288
|
+
}, me = ["sm", "md", "lg", "xl", "2xl"];
|
|
1289
|
+
function be(e) {
|
|
1268
1290
|
const t = e.startsWith("-"), o = (t ? e.slice(1) : e).split("-");
|
|
1269
1291
|
if (o.length < 2) return null;
|
|
1270
|
-
const n = o.slice(0, -1).join("-"),
|
|
1271
|
-
if (Number.isNaN(
|
|
1292
|
+
const n = o.slice(0, -1).join("-"), i = o[o.length - 1], s = parseFloat(i);
|
|
1293
|
+
if (Number.isNaN(s) || !Se[n]) return null;
|
|
1272
1294
|
const a = t ? "-" : "";
|
|
1273
|
-
return
|
|
1295
|
+
return Se[n].map((f) => `${f}:calc(${a}${et} * ${s});`).join("");
|
|
1274
1296
|
}
|
|
1275
|
-
function
|
|
1276
|
-
const t = e.replace("#", ""), r = parseInt(t, 16), o = r >> 16 & 255, n = r >> 8 & 255,
|
|
1277
|
-
return `${o} ${n} ${
|
|
1297
|
+
function Ce(e) {
|
|
1298
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), o = r >> 16 & 255, n = r >> 8 & 255, i = r & 255;
|
|
1299
|
+
return `${o} ${n} ${i}`;
|
|
1278
1300
|
}
|
|
1279
|
-
function
|
|
1301
|
+
function rt(e) {
|
|
1280
1302
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1281
1303
|
if (!t) return null;
|
|
1282
|
-
const [, r, o, n = "DEFAULT"] = t,
|
|
1283
|
-
return
|
|
1304
|
+
const [, r, o, n = "DEFAULT"] = t, i = Xe[o]?.[n];
|
|
1305
|
+
return i ? `${{
|
|
1284
1306
|
bg: "background-color",
|
|
1285
1307
|
decoration: "text-decoration-color",
|
|
1286
1308
|
text: "color",
|
|
@@ -1292,49 +1314,49 @@ function et(e) {
|
|
|
1292
1314
|
placeholder: "placeholder-color",
|
|
1293
1315
|
fill: "fill-color",
|
|
1294
1316
|
stroke: "stroke-color"
|
|
1295
|
-
}[r]}:${
|
|
1317
|
+
}[r]}:${i};` : null;
|
|
1296
1318
|
}
|
|
1297
|
-
function
|
|
1319
|
+
function nt(e) {
|
|
1298
1320
|
const [t, r] = e.split("/");
|
|
1299
1321
|
if (!r) return { base: t };
|
|
1300
1322
|
const o = parseInt(r, 10);
|
|
1301
1323
|
return isNaN(o) || o < 0 || o > 100 ? { base: t } : { base: t, opacity: o / 100 };
|
|
1302
1324
|
}
|
|
1303
|
-
function
|
|
1304
|
-
const { base: t, opacity: r } =
|
|
1325
|
+
function ve(e) {
|
|
1326
|
+
const { base: t, opacity: r } = nt(e), o = rt(t);
|
|
1305
1327
|
if (o) {
|
|
1306
1328
|
if (r !== void 0) {
|
|
1307
|
-
const
|
|
1308
|
-
if (
|
|
1309
|
-
const
|
|
1310
|
-
return o.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1329
|
+
const i = /#([0-9a-f]{6})/i.exec(o);
|
|
1330
|
+
if (i) {
|
|
1331
|
+
const s = Ce(i[0]);
|
|
1332
|
+
return o.replace(/#([0-9a-f]{6})/i, `rgb(${s} / ${r})`);
|
|
1311
1333
|
}
|
|
1312
1334
|
}
|
|
1313
1335
|
return o;
|
|
1314
1336
|
}
|
|
1315
|
-
const n =
|
|
1337
|
+
const n = le(t);
|
|
1316
1338
|
if (n && r !== void 0) {
|
|
1317
|
-
const
|
|
1318
|
-
if (
|
|
1319
|
-
const
|
|
1320
|
-
return n.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1339
|
+
const i = /#([0-9a-f]{6})/i.exec(n);
|
|
1340
|
+
if (i) {
|
|
1341
|
+
const s = Ce(i[0]);
|
|
1342
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${s} / ${r})`);
|
|
1321
1343
|
}
|
|
1322
1344
|
}
|
|
1323
1345
|
return n;
|
|
1324
1346
|
}
|
|
1325
|
-
function
|
|
1347
|
+
function xe(e) {
|
|
1326
1348
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
1327
1349
|
if (!t) return null;
|
|
1328
1350
|
const r = parseInt(t[1], 10);
|
|
1329
1351
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1330
1352
|
}
|
|
1331
|
-
function
|
|
1353
|
+
function le(e) {
|
|
1332
1354
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1333
1355
|
const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1334
1356
|
if (n) {
|
|
1335
|
-
const
|
|
1336
|
-
let
|
|
1337
|
-
return
|
|
1357
|
+
const i = n[1].trim();
|
|
1358
|
+
let s = n[2].trim();
|
|
1359
|
+
return s = s.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), s = s.replace(/^'([^']*)'$/g, '"$1"'), `${i}:${s};`;
|
|
1338
1360
|
}
|
|
1339
1361
|
return null;
|
|
1340
1362
|
}
|
|
@@ -1343,9 +1365,10 @@ function G(e) {
|
|
|
1343
1365
|
const o = e.slice(0, t);
|
|
1344
1366
|
let n = e.slice(t + 2, -1);
|
|
1345
1367
|
n = n.replace(/_/g, " ");
|
|
1346
|
-
const
|
|
1368
|
+
const i = {
|
|
1347
1369
|
bg: "background-color",
|
|
1348
1370
|
text: "color",
|
|
1371
|
+
shadow: "box-shadow",
|
|
1349
1372
|
p: "padding",
|
|
1350
1373
|
px: "padding-inline",
|
|
1351
1374
|
py: "padding-block",
|
|
@@ -1364,7 +1387,9 @@ function G(e) {
|
|
|
1364
1387
|
"border-r": "border-right",
|
|
1365
1388
|
"border-x": "border-inline",
|
|
1366
1389
|
"border-y": "border-block",
|
|
1367
|
-
|
|
1390
|
+
transition: "transition-property",
|
|
1391
|
+
ease: "transition-timing-function",
|
|
1392
|
+
delay: "transition-delay",
|
|
1368
1393
|
duration: "transition-duration",
|
|
1369
1394
|
list: "list-style",
|
|
1370
1395
|
break: "word-break",
|
|
@@ -1378,19 +1403,18 @@ function G(e) {
|
|
|
1378
1403
|
basis: "flex-basis",
|
|
1379
1404
|
tracking: "letter-spacing",
|
|
1380
1405
|
scroll: "scroll-behavior",
|
|
1381
|
-
delay: "transition-delay",
|
|
1382
1406
|
weight: "font-weight",
|
|
1383
1407
|
leading: "line-height",
|
|
1384
1408
|
z: "z-index"
|
|
1385
1409
|
};
|
|
1386
1410
|
if (o === "rotate")
|
|
1387
1411
|
return `transform:rotate(${n});`;
|
|
1388
|
-
const
|
|
1389
|
-
if (
|
|
1412
|
+
const s = i[o] ?? o.replace(/_/g, "-");
|
|
1413
|
+
if (s && n) return `${s}:${n};`;
|
|
1390
1414
|
}
|
|
1391
1415
|
return null;
|
|
1392
1416
|
}
|
|
1393
|
-
function
|
|
1417
|
+
function ot(e) {
|
|
1394
1418
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1395
1419
|
const r = e.slice(1, -1);
|
|
1396
1420
|
return r.includes("&") ? r : e;
|
|
@@ -1402,10 +1426,10 @@ function rt(e) {
|
|
|
1402
1426
|
}
|
|
1403
1427
|
return null;
|
|
1404
1428
|
}
|
|
1405
|
-
function
|
|
1429
|
+
function it(e) {
|
|
1406
1430
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1407
1431
|
}
|
|
1408
|
-
function
|
|
1432
|
+
function st(e) {
|
|
1409
1433
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1410
1434
|
let o;
|
|
1411
1435
|
for (; o = t.exec(e); ) {
|
|
@@ -1414,32 +1438,32 @@ function ot(e) {
|
|
|
1414
1438
|
}
|
|
1415
1439
|
return r.filter(Boolean);
|
|
1416
1440
|
}
|
|
1417
|
-
const
|
|
1418
|
-
function
|
|
1419
|
-
const t = Date.now(), r =
|
|
1420
|
-
if (r && t - r.timestamp <
|
|
1421
|
-
const o =
|
|
1422
|
-
function
|
|
1423
|
-
const
|
|
1424
|
-
if (
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1427
|
-
}
|
|
1428
|
-
function
|
|
1429
|
-
const
|
|
1430
|
-
return
|
|
1431
|
-
}
|
|
1432
|
-
function
|
|
1433
|
-
const
|
|
1434
|
-
let
|
|
1435
|
-
for (let
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1441
|
+
const Ee = /* @__PURE__ */ new Map(), at = 16;
|
|
1442
|
+
function lt(e) {
|
|
1443
|
+
const t = Date.now(), r = Ee.get(e);
|
|
1444
|
+
if (r && t - r.timestamp < at) return r.css;
|
|
1445
|
+
const o = st(e), n = new Set(o), i = [], s = [], a = [], f = [], u = {};
|
|
1446
|
+
function d(v, b = !1) {
|
|
1447
|
+
const y = (b ? "dark|" : "") + v;
|
|
1448
|
+
if (y in u) return u[y];
|
|
1449
|
+
const x = w(v, b);
|
|
1450
|
+
return u[y] = x, x;
|
|
1451
|
+
}
|
|
1452
|
+
function m(v) {
|
|
1453
|
+
const b = v.some((x) => me.includes(x)), y = v.includes("dark");
|
|
1454
|
+
return v.length === 0 ? 1 : !b && !y ? 2 : b && !y ? 3 : 4;
|
|
1455
|
+
}
|
|
1456
|
+
function l(v) {
|
|
1457
|
+
const b = [];
|
|
1458
|
+
let y = "", x = 0, c = 0;
|
|
1459
|
+
for (let g = 0; g < v.length; g++) {
|
|
1460
|
+
const p = v[g];
|
|
1461
|
+
p === "[" ? x++ : p === "]" && x > 0 ? x-- : p === "(" ? c++ : p === ")" && c > 0 && c--, p === ":" && x === 0 && c === 0 ? (b.push(y), y = "") : y += p;
|
|
1438
1462
|
}
|
|
1439
|
-
return
|
|
1463
|
+
return y && b.push(y), b;
|
|
1440
1464
|
}
|
|
1441
|
-
function
|
|
1442
|
-
switch (
|
|
1465
|
+
function h(v) {
|
|
1466
|
+
switch (v) {
|
|
1443
1467
|
case "hover":
|
|
1444
1468
|
return ":hover";
|
|
1445
1469
|
case "focus":
|
|
@@ -1468,206 +1492,210 @@ function st(e) {
|
|
|
1468
1492
|
return null;
|
|
1469
1493
|
}
|
|
1470
1494
|
}
|
|
1471
|
-
function
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
if (!
|
|
1476
|
-
const
|
|
1477
|
-
if (!
|
|
1478
|
-
const
|
|
1479
|
-
let
|
|
1480
|
-
|
|
1481
|
-
const C = `.${
|
|
1482
|
-
let
|
|
1483
|
-
const
|
|
1484
|
-
for (const
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
const
|
|
1488
|
-
let
|
|
1489
|
-
for (const
|
|
1490
|
-
if (
|
|
1491
|
-
const
|
|
1492
|
-
if (
|
|
1493
|
-
|
|
1495
|
+
function w(v, b = !1) {
|
|
1496
|
+
const y = l(v);
|
|
1497
|
+
let x = !1;
|
|
1498
|
+
const c = y.find((k) => (k.startsWith("!") && (x = !0, k = k.slice(1)), ge[k] || be(k) || xe(k) || ve(k) || le(k)));
|
|
1499
|
+
if (!c) return null;
|
|
1500
|
+
const g = c.replace(/^!/, ""), p = ge[g] ?? be(g) ?? xe(g) ?? ve(g) ?? le(g);
|
|
1501
|
+
if (!p) return null;
|
|
1502
|
+
const _ = y.indexOf(c);
|
|
1503
|
+
let E = _ >= 0 ? y.slice(0, _) : [];
|
|
1504
|
+
b && (E = E.filter((k) => k !== "dark"));
|
|
1505
|
+
const C = `.${it(v)}`, S = "__SUBJECT__", A = x ? p.replace(/;$/, " !important;") : p;
|
|
1506
|
+
let T = S;
|
|
1507
|
+
const Q = [];
|
|
1508
|
+
for (const k of E)
|
|
1509
|
+
k.startsWith("group-") ? (T = `.group:${k.slice(6)} ${T}`, Q.push(k)) : k.startsWith("peer-") && (T = T.replace(S, `.peer:${k.slice(5)}~${S}`), Q.push(k));
|
|
1510
|
+
E = E.filter((k) => !Q.includes(k));
|
|
1511
|
+
const X = [], de = [];
|
|
1512
|
+
let q = null;
|
|
1513
|
+
for (const k of E) {
|
|
1514
|
+
if (k === "dark" || me.includes(k)) continue;
|
|
1515
|
+
const B = ot(k);
|
|
1516
|
+
if (B) {
|
|
1517
|
+
q = B;
|
|
1494
1518
|
continue;
|
|
1495
1519
|
}
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1498
|
-
|
|
1520
|
+
const z = h(k);
|
|
1521
|
+
if (z) {
|
|
1522
|
+
q ? de.push(z) : X.push(z);
|
|
1499
1523
|
continue;
|
|
1500
1524
|
}
|
|
1501
|
-
const
|
|
1502
|
-
typeof
|
|
1525
|
+
const O = tt[k];
|
|
1526
|
+
typeof O == "function" && (T = O(T, A).split("{")[0]);
|
|
1503
1527
|
}
|
|
1504
|
-
function
|
|
1505
|
-
if (!
|
|
1506
|
-
let
|
|
1507
|
-
if (
|
|
1508
|
-
let
|
|
1509
|
-
for (;
|
|
1510
|
-
for (;
|
|
1511
|
-
const
|
|
1512
|
-
if (
|
|
1513
|
-
return
|
|
1528
|
+
function I(k, B) {
|
|
1529
|
+
if (!B) return k;
|
|
1530
|
+
let z = 0, O = 0;
|
|
1531
|
+
if (k.length && (k[0] === ">" || k[0] === "+" || k[0] === "~" || k[0] === " ")) {
|
|
1532
|
+
let j = 1;
|
|
1533
|
+
for (; j < k.length && k[j] === " "; ) j++;
|
|
1534
|
+
for (; j < k.length; j++) {
|
|
1535
|
+
const R = k[j];
|
|
1536
|
+
if (R === "[" ? z++ : R === "]" && z > 0 ? z-- : R === "(" ? O++ : R === ")" && O > 0 && O--, z === 0 && O === 0 && (k[j] === ">" || k[j] === "+" || k[j] === "~" || k[j] === " "))
|
|
1537
|
+
return k.slice(0, j) + B + k.slice(j);
|
|
1514
1538
|
}
|
|
1515
|
-
return
|
|
1539
|
+
return k + B;
|
|
1516
1540
|
}
|
|
1517
|
-
for (let
|
|
1518
|
-
const
|
|
1519
|
-
if (
|
|
1520
|
-
return
|
|
1541
|
+
for (let j = 0; j < k.length; j++) {
|
|
1542
|
+
const R = k[j];
|
|
1543
|
+
if (R === "[" ? z++ : R === "]" && z > 0 ? z-- : R === "(" ? O++ : R === ")" && O > 0 && O--, z === 0 && O === 0 && (R === ">" || R === "+" || R === "~" || R === " "))
|
|
1544
|
+
return k.slice(0, j) + B + k.slice(j);
|
|
1521
1545
|
}
|
|
1522
|
-
return
|
|
1546
|
+
return k + B;
|
|
1523
1547
|
}
|
|
1524
|
-
const
|
|
1525
|
-
if (
|
|
1526
|
-
if (
|
|
1527
|
-
const
|
|
1528
|
-
if (
|
|
1529
|
-
|
|
1548
|
+
const Z = X.join(""), F = de.join("");
|
|
1549
|
+
if (q)
|
|
1550
|
+
if (q.includes("&")) {
|
|
1551
|
+
const k = q.indexOf("&"), B = q.slice(0, k), z = q.slice(k + 1), O = S + Z, j = T;
|
|
1552
|
+
if (X.length === 0)
|
|
1553
|
+
T = j.replace(S, B + O + F + z);
|
|
1530
1554
|
else {
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1555
|
+
const R = I(z, F);
|
|
1556
|
+
T = j.replace(S, B + O + R);
|
|
1533
1557
|
}
|
|
1534
1558
|
} else
|
|
1535
|
-
|
|
1559
|
+
T = T.replace(S, `${q}${S + Z}`), F && (T = T.replace(S, `${S}${F}`));
|
|
1536
1560
|
else
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
let
|
|
1540
|
-
const
|
|
1541
|
-
return
|
|
1542
|
-
}
|
|
1543
|
-
for (const
|
|
1544
|
-
const
|
|
1545
|
-
(
|
|
1561
|
+
T = S + Z + F;
|
|
1562
|
+
T = T.replace(new RegExp(S, "g"), C);
|
|
1563
|
+
let L = `${T}{${A}}`;
|
|
1564
|
+
const K = E.filter((k) => me.includes(k)), D = K.length ? K[K.length - 1] : null, ne = E.includes("dark");
|
|
1565
|
+
return b && D ? L = `@media (prefers-color-scheme: dark) and ${ye[D]}{${L}}` : b ? L = `@media (prefers-color-scheme: dark){${L}}` : ne && D ? L = `@media (prefers-color-scheme: dark) and ${ye[D]}{${L}}` : ne ? L = `@media (prefers-color-scheme: dark){${L}}` : D && (L = `@media ${ye[D]}{${L}}`), L;
|
|
1566
|
+
}
|
|
1567
|
+
for (const v of n) {
|
|
1568
|
+
const b = l(v), y = b.find(
|
|
1569
|
+
(p) => ge[p] || be(p) || xe(p) || ve(p) || le(p)
|
|
1546
1570
|
);
|
|
1547
|
-
if (!
|
|
1548
|
-
const
|
|
1549
|
-
if (
|
|
1550
|
-
const
|
|
1551
|
-
|
|
1571
|
+
if (!y) continue;
|
|
1572
|
+
const x = b.indexOf(y), c = x >= 0 ? b.slice(0, x) : [], g = m(c);
|
|
1573
|
+
if (g === 4) {
|
|
1574
|
+
const p = d(v, !0);
|
|
1575
|
+
p && f.push(p);
|
|
1552
1576
|
} else {
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1577
|
+
const p = d(v);
|
|
1578
|
+
p && (g === 1 ? i.push(p) : g === 2 ? s.push(p) : g === 3 && a.push(p));
|
|
1555
1579
|
}
|
|
1556
1580
|
}
|
|
1557
|
-
const
|
|
1558
|
-
return
|
|
1581
|
+
const $ = [...i, ...s, ...a, ...f].join("");
|
|
1582
|
+
return Ee.set(e, { css: $, timestamp: t }), $;
|
|
1559
1583
|
}
|
|
1560
|
-
const
|
|
1561
|
-
function
|
|
1584
|
+
const te = [];
|
|
1585
|
+
function ct(e, t, r, o, n, i, s, a) {
|
|
1562
1586
|
if (e) {
|
|
1563
|
-
|
|
1587
|
+
te.push(r);
|
|
1564
1588
|
try {
|
|
1565
1589
|
if (t.loadingTemplate && r.isLoading) {
|
|
1566
|
-
|
|
1590
|
+
Y(e, t.loadingTemplate(r), r, o, n);
|
|
1567
1591
|
return;
|
|
1568
1592
|
}
|
|
1569
1593
|
if (t.errorTemplate && r.hasError) {
|
|
1570
|
-
r.error instanceof Error &&
|
|
1594
|
+
r.error instanceof Error && Y(e, t.errorTemplate(r.error, r), r, o, n);
|
|
1571
1595
|
return;
|
|
1572
1596
|
}
|
|
1573
|
-
const
|
|
1574
|
-
if (
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
}).catch((
|
|
1578
|
-
|
|
1579
|
-
}), t.loadingTemplate &&
|
|
1597
|
+
const f = t.render(r);
|
|
1598
|
+
if (f instanceof Promise) {
|
|
1599
|
+
i(!0), f.then((u) => {
|
|
1600
|
+
i(!1), s(null), Y(e, u, r, o, n), a(e.innerHTML);
|
|
1601
|
+
}).catch((u) => {
|
|
1602
|
+
i(!1), s(u), t.errorTemplate && Y(e, t.errorTemplate(u, r), r, o, n);
|
|
1603
|
+
}), t.loadingTemplate && Y(e, t.loadingTemplate(r), r, o, n);
|
|
1580
1604
|
return;
|
|
1581
1605
|
}
|
|
1582
|
-
|
|
1606
|
+
Y(e, f, r, o, n), a(e.innerHTML);
|
|
1583
1607
|
} finally {
|
|
1584
|
-
|
|
1608
|
+
te.pop();
|
|
1585
1609
|
}
|
|
1586
1610
|
}
|
|
1587
1611
|
}
|
|
1588
|
-
function
|
|
1589
|
-
e && (
|
|
1612
|
+
function Y(e, t, r, o, n) {
|
|
1613
|
+
e && (Ye(
|
|
1590
1614
|
e,
|
|
1591
1615
|
Array.isArray(t) ? t : [t],
|
|
1592
1616
|
r,
|
|
1593
1617
|
o
|
|
1594
1618
|
), n(e.innerHTML));
|
|
1595
1619
|
}
|
|
1596
|
-
function
|
|
1597
|
-
if (
|
|
1620
|
+
function ft(e, t, r, o, n, i, s) {
|
|
1621
|
+
if (i !== null && clearTimeout(i), Date.now() - t < 16) {
|
|
1598
1622
|
if (n(r + 1), r > 10) {
|
|
1599
|
-
|
|
1623
|
+
s(null);
|
|
1600
1624
|
return;
|
|
1601
1625
|
}
|
|
1602
1626
|
} else
|
|
1603
1627
|
n(0);
|
|
1604
|
-
const
|
|
1605
|
-
o(Date.now()), e(),
|
|
1628
|
+
const f = setTimeout(() => {
|
|
1629
|
+
o(Date.now()), e(), s(null);
|
|
1606
1630
|
}, 0);
|
|
1607
|
-
|
|
1631
|
+
s(f);
|
|
1608
1632
|
}
|
|
1609
|
-
function
|
|
1633
|
+
function ut(e, t, r, o, n, i) {
|
|
1610
1634
|
if (!e) return;
|
|
1611
|
-
const
|
|
1612
|
-
if (!t.style && (!
|
|
1613
|
-
|
|
1635
|
+
const s = lt(o);
|
|
1636
|
+
if (!t.style && (!s || s.trim() === "")) {
|
|
1637
|
+
i(null), e.adoptedStyleSheets = [_e()];
|
|
1614
1638
|
return;
|
|
1615
1639
|
}
|
|
1616
1640
|
let a = "";
|
|
1617
1641
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1618
|
-
let
|
|
1619
|
-
${
|
|
1642
|
+
let f = Ge(`${a}
|
|
1643
|
+
${s}
|
|
1620
1644
|
`);
|
|
1621
|
-
|
|
1622
|
-
let
|
|
1623
|
-
|
|
1645
|
+
f = Be(f);
|
|
1646
|
+
let u = n;
|
|
1647
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== f) && u.replaceSync(f), e.adoptedStyleSheets = [_e(), u], i(u);
|
|
1624
1648
|
}
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
|
|
1649
|
+
const ue = /* @__PURE__ */ new Map(), Ae = Symbol.for("cer.registry");
|
|
1650
|
+
if (typeof window < "u") {
|
|
1651
|
+
const e = globalThis;
|
|
1652
|
+
e[Ae] || (e[Ae] = ue);
|
|
1653
|
+
}
|
|
1654
|
+
function Te(e, t, r) {
|
|
1655
|
+
let o = J(e);
|
|
1628
1656
|
o.includes("-") || (o = `cer-${o}`);
|
|
1629
1657
|
let n;
|
|
1630
|
-
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (
|
|
1631
|
-
console.error(`[${o}] Error:`,
|
|
1658
|
+
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (i, s) => {
|
|
1659
|
+
console.error(`[${o}] Error:`, i, s);
|
|
1632
1660
|
});
|
|
1633
1661
|
try {
|
|
1634
|
-
const
|
|
1662
|
+
const i = /* @__PURE__ */ new Set([
|
|
1635
1663
|
"refs",
|
|
1636
1664
|
"requestRender",
|
|
1637
1665
|
"error",
|
|
1638
1666
|
"hasError",
|
|
1639
1667
|
"isLoading",
|
|
1640
1668
|
"emit"
|
|
1641
|
-
]),
|
|
1669
|
+
]), s = [];
|
|
1642
1670
|
if (n.state && typeof n.state == "object" && Object.keys(n.state).forEach((a) => {
|
|
1643
|
-
|
|
1671
|
+
i.has(a) && s.push(a);
|
|
1644
1672
|
}), n.props && typeof n.props == "object" && Object.keys(n.props).forEach((a) => {
|
|
1645
|
-
|
|
1673
|
+
i.has(a) && s.push(a);
|
|
1646
1674
|
}), n.computed && typeof n.computed == "object" && Object.keys(n.computed).forEach((a) => {
|
|
1647
|
-
|
|
1648
|
-
}),
|
|
1649
|
-
const a = Array.from(new Set(
|
|
1675
|
+
i.has(a) && s.push(a);
|
|
1676
|
+
}), s.length > 0) {
|
|
1677
|
+
const a = Array.from(new Set(s));
|
|
1650
1678
|
console.warn(
|
|
1651
1679
|
`[${o}] 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.`
|
|
1652
1680
|
);
|
|
1653
1681
|
}
|
|
1654
1682
|
} catch {
|
|
1655
1683
|
}
|
|
1656
|
-
if (
|
|
1684
|
+
if (ue.set(o, n), typeof window < "u")
|
|
1657
1685
|
if (!customElements.get(o))
|
|
1658
|
-
customElements.define(o,
|
|
1686
|
+
customElements.define(o, dt(o, n));
|
|
1659
1687
|
else
|
|
1660
1688
|
try {
|
|
1661
|
-
document.querySelectorAll(o).forEach((
|
|
1689
|
+
document.querySelectorAll(o).forEach((i) => {
|
|
1662
1690
|
try {
|
|
1663
|
-
typeof
|
|
1691
|
+
typeof i._cfg < "u" && (i._cfg = n), typeof i._render == "function" && i._render(n);
|
|
1664
1692
|
} catch {
|
|
1665
1693
|
}
|
|
1666
1694
|
});
|
|
1667
1695
|
} catch {
|
|
1668
1696
|
}
|
|
1669
1697
|
}
|
|
1670
|
-
function
|
|
1698
|
+
function dt(e, t) {
|
|
1671
1699
|
if (!t.render)
|
|
1672
1700
|
throw new Error(
|
|
1673
1701
|
"Component must have a render function"
|
|
@@ -1711,7 +1739,7 @@ function ft(e, t) {
|
|
|
1711
1739
|
_templateLoading = !1;
|
|
1712
1740
|
_templateError = null;
|
|
1713
1741
|
constructor() {
|
|
1714
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
1742
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = ue.get(e) || t;
|
|
1715
1743
|
const r = this._initContext(t);
|
|
1716
1744
|
Object.defineProperty(r, "refs", {
|
|
1717
1745
|
value: this._refs,
|
|
@@ -1723,13 +1751,13 @@ function ft(e, t) {
|
|
|
1723
1751
|
writable: !1,
|
|
1724
1752
|
enumerable: !1,
|
|
1725
1753
|
configurable: !1
|
|
1726
|
-
}), this.context = r,
|
|
1727
|
-
value: (n,
|
|
1754
|
+
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
1755
|
+
value: (n, i, s) => {
|
|
1728
1756
|
const a = new CustomEvent(n, {
|
|
1729
|
-
detail:
|
|
1757
|
+
detail: i,
|
|
1730
1758
|
bubbles: !0,
|
|
1731
1759
|
composed: !0,
|
|
1732
|
-
...
|
|
1760
|
+
...s || {}
|
|
1733
1761
|
});
|
|
1734
1762
|
return this.dispatchEvent(a), !a.defaultPrevented;
|
|
1735
1763
|
},
|
|
@@ -1737,15 +1765,15 @@ function ft(e, t) {
|
|
|
1737
1765
|
enumerable: !1,
|
|
1738
1766
|
configurable: !1
|
|
1739
1767
|
});
|
|
1740
|
-
const o =
|
|
1768
|
+
const o = ue.get(e) || t;
|
|
1741
1769
|
Object.keys(o).forEach((n) => {
|
|
1742
|
-
const
|
|
1743
|
-
typeof
|
|
1770
|
+
const i = o[n];
|
|
1771
|
+
typeof i == "function" && (this.context[n] = (...s) => i(...s, this.context));
|
|
1744
1772
|
}), this._applyComputed(o), this._initializing = !1, this._initWatchers(o), this._render(o);
|
|
1745
1773
|
}
|
|
1746
1774
|
connectedCallback() {
|
|
1747
1775
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1748
|
-
|
|
1776
|
+
this._applyProps(t), qe(
|
|
1749
1777
|
t,
|
|
1750
1778
|
this.context,
|
|
1751
1779
|
this._mounted,
|
|
@@ -1757,7 +1785,7 @@ function ft(e, t) {
|
|
|
1757
1785
|
}
|
|
1758
1786
|
disconnectedCallback() {
|
|
1759
1787
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1760
|
-
|
|
1788
|
+
De(
|
|
1761
1789
|
t,
|
|
1762
1790
|
this.context,
|
|
1763
1791
|
this._listeners,
|
|
@@ -1781,7 +1809,7 @@ function ft(e, t) {
|
|
|
1781
1809
|
}
|
|
1782
1810
|
attributeChangedCallback(r, o, n) {
|
|
1783
1811
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1784
|
-
this._applyProps(t),
|
|
1812
|
+
this._applyProps(t), Ie(
|
|
1785
1813
|
t,
|
|
1786
1814
|
r,
|
|
1787
1815
|
o,
|
|
@@ -1791,15 +1819,15 @@ function ft(e, t) {
|
|
|
1791
1819
|
});
|
|
1792
1820
|
}
|
|
1793
1821
|
static get observedAttributes() {
|
|
1794
|
-
return t.props ? Object.keys(t.props).map(
|
|
1822
|
+
return t.props ? Object.keys(t.props).map(J) : [];
|
|
1795
1823
|
}
|
|
1796
1824
|
_applyComputed(r) {
|
|
1797
1825
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1798
1826
|
r.computed && Object.entries(r.computed).forEach(([o, n]) => {
|
|
1799
1827
|
Object.defineProperty(this.context, o, {
|
|
1800
1828
|
get: () => {
|
|
1801
|
-
const
|
|
1802
|
-
return
|
|
1829
|
+
const i = n(this.context);
|
|
1830
|
+
return H(i);
|
|
1803
1831
|
},
|
|
1804
1832
|
enumerable: !0
|
|
1805
1833
|
});
|
|
@@ -1809,7 +1837,7 @@ function ft(e, t) {
|
|
|
1809
1837
|
// --- Render ---
|
|
1810
1838
|
_render(r) {
|
|
1811
1839
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1812
|
-
|
|
1840
|
+
ct(
|
|
1813
1841
|
this.shadowRoot,
|
|
1814
1842
|
r,
|
|
1815
1843
|
this.context,
|
|
@@ -1832,7 +1860,7 @@ function ft(e, t) {
|
|
|
1832
1860
|
}
|
|
1833
1861
|
_requestRender() {
|
|
1834
1862
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1835
|
-
|
|
1863
|
+
ft(
|
|
1836
1864
|
() => this._render(this._cfg),
|
|
1837
1865
|
this._lastRenderTime,
|
|
1838
1866
|
this._renderCount,
|
|
@@ -1852,7 +1880,7 @@ function ft(e, t) {
|
|
|
1852
1880
|
// --- Style ---
|
|
1853
1881
|
_applyStyle(r, o) {
|
|
1854
1882
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1855
|
-
|
|
1883
|
+
ut(
|
|
1856
1884
|
this.shadowRoot,
|
|
1857
1885
|
r,
|
|
1858
1886
|
this.context,
|
|
@@ -1879,11 +1907,11 @@ function ft(e, t) {
|
|
|
1879
1907
|
// --- State, props, computed ---
|
|
1880
1908
|
_initContext(r) {
|
|
1881
1909
|
try {
|
|
1882
|
-
let o = function(
|
|
1883
|
-
return Array.isArray(
|
|
1884
|
-
get(a,
|
|
1885
|
-
const
|
|
1886
|
-
return typeof
|
|
1910
|
+
let o = function(i, s = "") {
|
|
1911
|
+
return Array.isArray(i) ? new Proxy(i, {
|
|
1912
|
+
get(a, f, u) {
|
|
1913
|
+
const d = Reflect.get(a, f, u);
|
|
1914
|
+
return typeof d == "function" && typeof f == "string" && [
|
|
1887
1915
|
"push",
|
|
1888
1916
|
"pop",
|
|
1889
1917
|
"shift",
|
|
@@ -1891,44 +1919,44 @@ function ft(e, t) {
|
|
|
1891
1919
|
"splice",
|
|
1892
1920
|
"sort",
|
|
1893
1921
|
"reverse"
|
|
1894
|
-
].includes(
|
|
1895
|
-
const
|
|
1922
|
+
].includes(f) ? function(...l) {
|
|
1923
|
+
const h = d.apply(a, l);
|
|
1896
1924
|
if (!n._initializing) {
|
|
1897
|
-
const
|
|
1898
|
-
n._triggerWatchers(
|
|
1925
|
+
const w = s || "root";
|
|
1926
|
+
n._triggerWatchers(w, a), n._render(r);
|
|
1899
1927
|
}
|
|
1900
|
-
return
|
|
1901
|
-
} :
|
|
1928
|
+
return h;
|
|
1929
|
+
} : d;
|
|
1902
1930
|
},
|
|
1903
|
-
set(a,
|
|
1904
|
-
if (a[
|
|
1905
|
-
const
|
|
1906
|
-
n._triggerWatchers(
|
|
1931
|
+
set(a, f, u) {
|
|
1932
|
+
if (a[f] = u, !n._initializing) {
|
|
1933
|
+
const d = s ? `${s}.${String(f)}` : String(f);
|
|
1934
|
+
n._triggerWatchers(d, u), n._render(r);
|
|
1907
1935
|
}
|
|
1908
1936
|
return !0;
|
|
1909
1937
|
},
|
|
1910
|
-
deleteProperty(a,
|
|
1911
|
-
if (delete a[
|
|
1912
|
-
const
|
|
1913
|
-
n._triggerWatchers(
|
|
1938
|
+
deleteProperty(a, f) {
|
|
1939
|
+
if (delete a[f], !n._initializing) {
|
|
1940
|
+
const u = s ? `${s}.${String(f)}` : String(f);
|
|
1941
|
+
n._triggerWatchers(u, void 0), n._render(r);
|
|
1914
1942
|
}
|
|
1915
1943
|
return !0;
|
|
1916
1944
|
}
|
|
1917
|
-
}) :
|
|
1918
|
-
const
|
|
1919
|
-
|
|
1920
|
-
}), new Proxy(
|
|
1921
|
-
set(a,
|
|
1922
|
-
const
|
|
1923
|
-
return a[
|
|
1924
|
-
|
|
1925
|
-
a[
|
|
1945
|
+
}) : i && typeof i == "object" ? (Object.keys(i).forEach((a) => {
|
|
1946
|
+
const f = s ? `${s}.${a}` : a;
|
|
1947
|
+
i[a] = o(i[a], f);
|
|
1948
|
+
}), new Proxy(i, {
|
|
1949
|
+
set(a, f, u) {
|
|
1950
|
+
const d = s ? `${s}.${String(f)}` : String(f);
|
|
1951
|
+
return a[f] = o(u, d), n._initializing || (n._triggerWatchers(
|
|
1952
|
+
d,
|
|
1953
|
+
a[f]
|
|
1926
1954
|
), n._render(r)), !0;
|
|
1927
1955
|
},
|
|
1928
|
-
get(a,
|
|
1929
|
-
return Reflect.get(a,
|
|
1956
|
+
get(a, f, u) {
|
|
1957
|
+
return Reflect.get(a, f, u);
|
|
1930
1958
|
}
|
|
1931
|
-
})) :
|
|
1959
|
+
})) : i;
|
|
1932
1960
|
};
|
|
1933
1961
|
const n = this;
|
|
1934
1962
|
return o({ ...r.state });
|
|
@@ -1938,7 +1966,7 @@ function ft(e, t) {
|
|
|
1938
1966
|
}
|
|
1939
1967
|
_initWatchers(r) {
|
|
1940
1968
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1941
|
-
|
|
1969
|
+
Ne(
|
|
1942
1970
|
this.context,
|
|
1943
1971
|
this._watchers,
|
|
1944
1972
|
r.watch || {}
|
|
@@ -1946,12 +1974,12 @@ function ft(e, t) {
|
|
|
1946
1974
|
});
|
|
1947
1975
|
}
|
|
1948
1976
|
_triggerWatchers(r, o) {
|
|
1949
|
-
|
|
1977
|
+
Me(this.context, this._watchers, r, o);
|
|
1950
1978
|
}
|
|
1951
1979
|
_applyProps(r) {
|
|
1952
1980
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1953
1981
|
try {
|
|
1954
|
-
|
|
1982
|
+
We(this, r, this.context);
|
|
1955
1983
|
} catch (o) {
|
|
1956
1984
|
this._hasError = !0, r.onError && r.onError(o, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(o, this.context));
|
|
1957
1985
|
}
|
|
@@ -1959,102 +1987,103 @@ function ft(e, t) {
|
|
|
1959
1987
|
}
|
|
1960
1988
|
};
|
|
1961
1989
|
}
|
|
1962
|
-
function
|
|
1990
|
+
function ee(e, t = {}, r, o) {
|
|
1963
1991
|
const n = o ?? t.key;
|
|
1964
1992
|
return { tag: e, key: n, props: t, children: r };
|
|
1965
1993
|
}
|
|
1966
|
-
function
|
|
1994
|
+
function ce(e) {
|
|
1967
1995
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
1968
1996
|
}
|
|
1969
|
-
function
|
|
1970
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
1997
|
+
function ie(e) {
|
|
1998
|
+
return typeof e == "object" && e !== null && "tag" in e && !ce(e);
|
|
1971
1999
|
}
|
|
1972
|
-
function
|
|
2000
|
+
function pt(e, t) {
|
|
1973
2001
|
return e.key != null ? e : { ...e, key: t };
|
|
1974
2002
|
}
|
|
1975
|
-
function
|
|
1976
|
-
const o = {}, n = {},
|
|
2003
|
+
function ht(e, t = [], r = {}) {
|
|
2004
|
+
const o = {}, n = {}, i = {}, s = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
1977
2005
|
let a;
|
|
1978
|
-
for (; a =
|
|
1979
|
-
const
|
|
1980
|
-
let
|
|
1981
|
-
|
|
1982
|
-
const
|
|
1983
|
-
if (
|
|
1984
|
-
const [
|
|
1985
|
-
if (
|
|
1986
|
-
const
|
|
1987
|
-
|
|
1988
|
-
value:
|
|
1989
|
-
modifiers:
|
|
2006
|
+
for (; a = s.exec(e); ) {
|
|
2007
|
+
const f = a[1], u = a[2], d = (a[4] || a[6]) ?? "", m = d.match(/^{{(\d+)}}$/);
|
|
2008
|
+
let l = m ? t[Number(m[1])] ?? null : d;
|
|
2009
|
+
m || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
2010
|
+
const h = ["model", "bind", "show", "class", "style"];
|
|
2011
|
+
if (f === ":") {
|
|
2012
|
+
const [w, $] = u.split(":"), [v, ...b] = w.split(".");
|
|
2013
|
+
if (h.includes(v)) {
|
|
2014
|
+
const y = [...b], x = v === "model" && $ ? `model:${$}` : v;
|
|
2015
|
+
i[x] = {
|
|
2016
|
+
value: l,
|
|
2017
|
+
modifiers: y,
|
|
2018
|
+
arg: $
|
|
1990
2019
|
};
|
|
1991
2020
|
} else
|
|
1992
|
-
n[
|
|
1993
|
-
} else if (
|
|
1994
|
-
const
|
|
1995
|
-
o[
|
|
1996
|
-
} else
|
|
1997
|
-
}
|
|
1998
|
-
return { props: o, attrs: n, directives:
|
|
1999
|
-
}
|
|
2000
|
-
function
|
|
2001
|
-
const o =
|
|
2002
|
-
function
|
|
2003
|
-
return
|
|
2004
|
-
}
|
|
2005
|
-
let
|
|
2006
|
-
for (let
|
|
2007
|
-
|
|
2008
|
-
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,
|
|
2009
|
-
let
|
|
2010
|
-
function
|
|
2011
|
-
!
|
|
2012
|
-
if (
|
|
2013
|
-
const
|
|
2021
|
+
n[u] = l;
|
|
2022
|
+
} else if (f === "@") {
|
|
2023
|
+
const w = "on" + u.charAt(0).toUpperCase() + u.slice(1);
|
|
2024
|
+
o[w] = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
2025
|
+
} else u === "ref" ? o.ref = l : n[u] = l;
|
|
2026
|
+
}
|
|
2027
|
+
return { props: o, attrs: n, directives: i };
|
|
2028
|
+
}
|
|
2029
|
+
function gt(e, t, r) {
|
|
2030
|
+
const o = te.length > 0 ? te[te.length - 1] : void 0, n = r ?? o;
|
|
2031
|
+
function i(c, g) {
|
|
2032
|
+
return ee("#text", {}, c, g);
|
|
2033
|
+
}
|
|
2034
|
+
let s = "";
|
|
2035
|
+
for (let c = 0; c < e.length; c++)
|
|
2036
|
+
s += e[c], c < t.length && (s += `{{${c}}}`);
|
|
2037
|
+
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, f = [];
|
|
2038
|
+
let u, d = [], m = null, l = {}, h, w = 0, $ = [];
|
|
2039
|
+
function v(c) {
|
|
2040
|
+
!c || typeof c != "object" || ce(c) || (c.props || c.attrs ? (c.props && (l.props || (l.props = {}), Object.assign(l.props, c.props)), c.attrs && (l.attrs || (l.attrs = {}), Object.keys(c.attrs).forEach((g) => {
|
|
2041
|
+
if (g === "style" && l.attrs.style) {
|
|
2042
|
+
const p = l.attrs.style.replace(
|
|
2014
2043
|
/;?\s*$/,
|
|
2015
2044
|
""
|
|
2016
|
-
),
|
|
2017
|
-
|
|
2018
|
-
} else if (
|
|
2019
|
-
const
|
|
2020
|
-
.../* @__PURE__ */ new Set([...
|
|
2045
|
+
), _ = c.attrs.style.replace(/^;?\s*/, "");
|
|
2046
|
+
l.attrs.style = p + "; " + _;
|
|
2047
|
+
} else if (g === "class" && l.attrs.class) {
|
|
2048
|
+
const p = l.attrs.class.trim().split(/\s+/).filter(Boolean), _ = c.attrs.class.trim().split(/\s+/).filter(Boolean), E = [
|
|
2049
|
+
.../* @__PURE__ */ new Set([...p, ..._])
|
|
2021
2050
|
];
|
|
2022
|
-
|
|
2051
|
+
l.attrs.class = E.join(" ");
|
|
2023
2052
|
} else
|
|
2024
|
-
|
|
2025
|
-
}))) : (
|
|
2026
|
-
}
|
|
2027
|
-
function
|
|
2028
|
-
const
|
|
2029
|
-
if (
|
|
2030
|
-
const
|
|
2031
|
-
let
|
|
2032
|
-
|
|
2033
|
-
...
|
|
2034
|
-
key:
|
|
2035
|
-
children:
|
|
2053
|
+
l.attrs[g] = c.attrs[g];
|
|
2054
|
+
}))) : (l.props || (l.props = {}), Object.assign(l.props, c)));
|
|
2055
|
+
}
|
|
2056
|
+
function b(c, g) {
|
|
2057
|
+
const p = m ? d : $;
|
|
2058
|
+
if (ce(c)) {
|
|
2059
|
+
const _ = c.key ?? g;
|
|
2060
|
+
let E = c.children;
|
|
2061
|
+
p.push({
|
|
2062
|
+
...c,
|
|
2063
|
+
key: _,
|
|
2064
|
+
children: E
|
|
2036
2065
|
});
|
|
2037
2066
|
return;
|
|
2038
2067
|
}
|
|
2039
|
-
if (
|
|
2040
|
-
|
|
2068
|
+
if (ie(c)) {
|
|
2069
|
+
p.push(pt(c, void 0));
|
|
2041
2070
|
return;
|
|
2042
2071
|
}
|
|
2043
|
-
if (Array.isArray(
|
|
2044
|
-
if (
|
|
2045
|
-
for (let
|
|
2046
|
-
const
|
|
2047
|
-
|
|
2072
|
+
if (Array.isArray(c)) {
|
|
2073
|
+
if (c.length === 0) return;
|
|
2074
|
+
for (let _ = 0; _ < c.length; _++) {
|
|
2075
|
+
const E = c[_];
|
|
2076
|
+
ce(E) || ie(E) || Array.isArray(E) ? b(E, `${g}-${_}`) : E !== null && typeof E == "object" ? v(E) : p.push(i(String(E), `${g}-${_}`));
|
|
2048
2077
|
}
|
|
2049
2078
|
return;
|
|
2050
2079
|
}
|
|
2051
|
-
if (
|
|
2052
|
-
|
|
2080
|
+
if (c !== null && typeof c == "object") {
|
|
2081
|
+
v(c);
|
|
2053
2082
|
return;
|
|
2054
2083
|
}
|
|
2055
|
-
|
|
2084
|
+
p.push(i(String(c), g));
|
|
2056
2085
|
}
|
|
2057
|
-
const
|
|
2086
|
+
const y = /* @__PURE__ */ new Set([
|
|
2058
2087
|
"area",
|
|
2059
2088
|
"base",
|
|
2060
2089
|
"br",
|
|
@@ -2070,232 +2099,257 @@ function pt(e, t, r) {
|
|
|
2070
2099
|
"track",
|
|
2071
2100
|
"wbr"
|
|
2072
2101
|
]);
|
|
2073
|
-
for (;
|
|
2074
|
-
if (
|
|
2075
|
-
const
|
|
2076
|
-
props:
|
|
2077
|
-
attrs:
|
|
2102
|
+
for (; u = a.exec(s); )
|
|
2103
|
+
if (u[1]) {
|
|
2104
|
+
const c = u[1], g = u[0][1] === "/", p = u[0][u[0].length - 2] === "/" || y.has(c), {
|
|
2105
|
+
props: _,
|
|
2106
|
+
attrs: E,
|
|
2078
2107
|
directives: C
|
|
2079
|
-
} =
|
|
2080
|
-
for (const
|
|
2081
|
-
for (const
|
|
2082
|
-
if (Object.keys(C).
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
c
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2108
|
+
} = ht(u[2] || "", t, n), S = { props: {}, attrs: {} };
|
|
2109
|
+
for (const A in _) S.props[A] = _[A];
|
|
2110
|
+
for (const A in E) S.attrs[A] = E[A];
|
|
2111
|
+
if (C && Object.keys(C).some((A) => A === "model" || A.startsWith("model:")))
|
|
2112
|
+
try {
|
|
2113
|
+
const A = Symbol.for("cer.registry"), T = globalThis[A], Q = !!(T && typeof T.has == "function" && T.has(c)), X = !!(n && (n.__customElements instanceof Set && n.__customElements.has(c) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(c)));
|
|
2114
|
+
if (!!(c.includes("-") || X || Q))
|
|
2115
|
+
for (const I of Object.keys(C)) {
|
|
2116
|
+
if (I !== "model" && !I.startsWith("model:")) continue;
|
|
2117
|
+
const Z = C[I], F = Z.arg ?? (I.includes(":") ? I.split(":", 2)[1] : void 0), L = Z.value, K = F ?? "modelValue", D = N, ne = se, k = n ? n._state || n : void 0;
|
|
2118
|
+
let B;
|
|
2119
|
+
typeof L == "string" && n ? B = D(k, L) : B = L, S.props[K] = B;
|
|
2120
|
+
try {
|
|
2121
|
+
const j = J(K);
|
|
2122
|
+
S.attrs || (S.attrs = {}), B !== void 0 && (S.attrs[j] = B);
|
|
2123
|
+
} catch {
|
|
2124
|
+
}
|
|
2125
|
+
S.isCustomElement = !0;
|
|
2126
|
+
const z = `update:${J(K)}`, O = "on" + z.charAt(0).toUpperCase() + z.slice(1);
|
|
2127
|
+
S.props[O] = function(j) {
|
|
2128
|
+
const R = j.detail !== void 0 ? j.detail : j.target ? j.target.value : void 0;
|
|
2129
|
+
if (!k) return;
|
|
2130
|
+
const pe = D(k, typeof L == "string" ? L : String(L));
|
|
2131
|
+
(Array.isArray(R) && Array.isArray(pe) ? JSON.stringify([...R].sort()) !== JSON.stringify([...pe].sort()) : R !== pe) && (ne(k, typeof L == "string" ? L : String(L), R), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
2132
|
+
}, delete C[I];
|
|
2133
|
+
}
|
|
2134
|
+
} catch {
|
|
2135
|
+
}
|
|
2136
|
+
if (Object.keys(C).length > 0 && (S.directives = { ...C }), g) {
|
|
2137
|
+
const A = ee(
|
|
2138
|
+
m,
|
|
2139
|
+
l,
|
|
2140
|
+
d.length === 1 && ie(d[0]) && d[0].tag === "#text" ? typeof d[0].children == "string" ? d[0].children : "" : d.length ? d : void 0,
|
|
2141
|
+
h
|
|
2142
|
+
), T = f.pop();
|
|
2143
|
+
T ? (m = T.tag, l = T.props, h = T.key, d = T.children, d.push(A)) : ($.push(A), m = null, l = {}, h = void 0, d = []);
|
|
2144
|
+
} else p ? m ? d.push(ee(c, S, void 0, void 0)) : $.push(ee(c, S, void 0, void 0)) : (m && f.push({
|
|
2145
|
+
tag: m,
|
|
2146
|
+
props: l,
|
|
2147
|
+
children: d,
|
|
2148
|
+
key: h
|
|
2149
|
+
}), m = c, l = S, d = []);
|
|
2150
|
+
} else if (typeof u[3] < "u") {
|
|
2151
|
+
const c = Number(u[3]), g = t[c], p = `interp-${c}`;
|
|
2152
|
+
b(g, p);
|
|
2153
|
+
} else if (u[4]) {
|
|
2154
|
+
const c = u[4], g = m ? d : $, p = c.split(/({{\d+}})/);
|
|
2155
|
+
for (const _ of p) {
|
|
2156
|
+
if (!_) continue;
|
|
2157
|
+
const E = _.match(/^{{(\d+)}}$/);
|
|
2158
|
+
if (E) {
|
|
2159
|
+
const C = Number(E[1]), S = t[C], A = `interp-${C}`;
|
|
2160
|
+
b(S, A);
|
|
2107
2161
|
} else {
|
|
2108
|
-
const C = `text-${
|
|
2109
|
-
|
|
2162
|
+
const C = `text-${w++}`;
|
|
2163
|
+
g.push(i(_, C));
|
|
2110
2164
|
}
|
|
2111
2165
|
}
|
|
2112
2166
|
}
|
|
2113
|
-
const
|
|
2114
|
-
return
|
|
2167
|
+
const x = $.filter((c) => ie(c) && c.tag === "#text" ? typeof c.children == "string" && c.children.trim() !== "" : !0);
|
|
2168
|
+
return x.length === 1 ? x[0] : x.length > 1 ? x : ee("div", {}, "", "fallback-root");
|
|
2115
2169
|
}
|
|
2116
|
-
function
|
|
2170
|
+
function U(e, ...t) {
|
|
2117
2171
|
const r = t[t.length - 1], o = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2118
|
-
return
|
|
2172
|
+
return gt(e, t, o);
|
|
2119
2173
|
}
|
|
2120
|
-
const
|
|
2174
|
+
const je = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, W = (e, t) => {
|
|
2121
2175
|
for (const r of e) {
|
|
2122
|
-
const o = [], n = r.path.replace(/:[^/]+/g, (a) => (o.push(a.slice(1)), "([^/]+)")),
|
|
2123
|
-
if (
|
|
2176
|
+
const o = [], n = r.path.replace(/:[^/]+/g, (a) => (o.push(a.slice(1)), "([^/]+)")), i = new RegExp(`^${n}$`), s = t.match(i);
|
|
2177
|
+
if (s) {
|
|
2124
2178
|
const a = {};
|
|
2125
|
-
return o.forEach((
|
|
2126
|
-
a[
|
|
2179
|
+
return o.forEach((f, u) => {
|
|
2180
|
+
a[f] = s[u + 1];
|
|
2127
2181
|
}), { route: r, params: a };
|
|
2128
2182
|
}
|
|
2129
2183
|
}
|
|
2130
2184
|
return { route: null, params: {} };
|
|
2131
|
-
},
|
|
2132
|
-
async function
|
|
2185
|
+
}, we = {};
|
|
2186
|
+
async function yt(e) {
|
|
2133
2187
|
if (e.component) return e.component;
|
|
2134
2188
|
if (e.load) {
|
|
2135
|
-
if (
|
|
2189
|
+
if (we[e.path]) return we[e.path];
|
|
2136
2190
|
try {
|
|
2137
2191
|
const t = await e.load();
|
|
2138
|
-
return
|
|
2192
|
+
return we[e.path] = t.default, t.default;
|
|
2139
2193
|
} catch {
|
|
2140
2194
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2141
2195
|
}
|
|
2142
2196
|
}
|
|
2143
2197
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2144
2198
|
}
|
|
2145
|
-
function
|
|
2199
|
+
function mt(e) {
|
|
2146
2200
|
const { routes: t, base: r = "", initialUrl: o } = e;
|
|
2147
|
-
let n,
|
|
2148
|
-
const
|
|
2149
|
-
const
|
|
2150
|
-
if (
|
|
2201
|
+
let n, i, s, a, f, u, d;
|
|
2202
|
+
const m = async ($, v) => {
|
|
2203
|
+
const b = t.find((y) => W([y], $.path).route !== null);
|
|
2204
|
+
if (b?.beforeEnter)
|
|
2151
2205
|
try {
|
|
2152
|
-
const
|
|
2153
|
-
return typeof
|
|
2154
|
-
} catch (
|
|
2155
|
-
return console.error("beforeEnter error",
|
|
2206
|
+
const y = await b.beforeEnter($, v);
|
|
2207
|
+
return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
|
|
2208
|
+
} catch (y) {
|
|
2209
|
+
return console.error("beforeEnter error", y), !1;
|
|
2156
2210
|
}
|
|
2157
2211
|
return !0;
|
|
2158
|
-
},
|
|
2159
|
-
const
|
|
2160
|
-
if (
|
|
2212
|
+
}, l = async ($, v) => {
|
|
2213
|
+
const b = t.find((y) => W([y], $.path).route !== null);
|
|
2214
|
+
if (b?.onEnter)
|
|
2161
2215
|
try {
|
|
2162
|
-
const
|
|
2163
|
-
return typeof
|
|
2164
|
-
} catch (
|
|
2165
|
-
return console.error("onEnter error",
|
|
2216
|
+
const y = await b.onEnter($, v);
|
|
2217
|
+
return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
|
|
2218
|
+
} catch (y) {
|
|
2219
|
+
return console.error("onEnter error", y), !1;
|
|
2166
2220
|
}
|
|
2167
2221
|
return !0;
|
|
2168
|
-
},
|
|
2169
|
-
const
|
|
2170
|
-
if (
|
|
2222
|
+
}, h = ($, v) => {
|
|
2223
|
+
const b = t.find((y) => W([y], $.path).route !== null);
|
|
2224
|
+
if (b?.afterEnter)
|
|
2171
2225
|
try {
|
|
2172
|
-
|
|
2173
|
-
} catch (
|
|
2174
|
-
console.error("afterEnter error",
|
|
2226
|
+
b.afterEnter($, v);
|
|
2227
|
+
} catch (y) {
|
|
2228
|
+
console.error("afterEnter error", y);
|
|
2175
2229
|
}
|
|
2176
|
-
},
|
|
2230
|
+
}, w = async ($, v = !1) => {
|
|
2177
2231
|
try {
|
|
2178
|
-
const
|
|
2179
|
-
path:
|
|
2232
|
+
const b = {
|
|
2233
|
+
path: $.replace(r, "") || "/",
|
|
2180
2234
|
query: {}
|
|
2181
|
-
},
|
|
2182
|
-
if (!
|
|
2183
|
-
const
|
|
2184
|
-
path:
|
|
2185
|
-
params:
|
|
2186
|
-
query:
|
|
2235
|
+
}, y = W(t, b.path);
|
|
2236
|
+
if (!y) throw new Error(`No route found for ${b.path}`);
|
|
2237
|
+
const x = s.getState(), c = {
|
|
2238
|
+
path: b.path,
|
|
2239
|
+
params: y.params,
|
|
2240
|
+
query: b.query
|
|
2187
2241
|
};
|
|
2188
|
-
if (!await
|
|
2189
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2190
|
-
} catch (
|
|
2191
|
-
console.error("Navigation error:",
|
|
2242
|
+
if (!await m(c, x) || !await l(c, x)) return;
|
|
2243
|
+
typeof window < "u" && typeof document < "u" && (v ? window.history.replaceState({}, "", r + $) : window.history.pushState({}, "", r + $)), s.setState(c), h(c, x);
|
|
2244
|
+
} catch (b) {
|
|
2245
|
+
console.error("Navigation error:", b);
|
|
2192
2246
|
}
|
|
2193
2247
|
};
|
|
2194
2248
|
if (typeof window < "u" && typeof document < "u") {
|
|
2195
2249
|
n = () => {
|
|
2196
|
-
const
|
|
2197
|
-
return { path:
|
|
2198
|
-
},
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2201
|
-
path:
|
|
2202
|
-
params:
|
|
2203
|
-
query:
|
|
2204
|
-
}), a = async (
|
|
2205
|
-
const
|
|
2206
|
-
await
|
|
2207
|
-
}, window.addEventListener("popstate", () => a(!0)),
|
|
2250
|
+
const v = new URL(window.location.href), b = v.pathname.replace(r, "") || "/", y = je(v.search);
|
|
2251
|
+
return { path: b, query: y };
|
|
2252
|
+
}, i = n();
|
|
2253
|
+
const $ = W(t, i.path);
|
|
2254
|
+
s = $e({
|
|
2255
|
+
path: i.path,
|
|
2256
|
+
params: $.params,
|
|
2257
|
+
query: i.query
|
|
2258
|
+
}), a = async (v = !1) => {
|
|
2259
|
+
const b = n();
|
|
2260
|
+
await w(b.path, v);
|
|
2261
|
+
}, window.addEventListener("popstate", () => a(!0)), f = (v) => w(v, !1), u = (v) => w(v, !0), d = () => window.history.back();
|
|
2208
2262
|
} else {
|
|
2209
2263
|
n = () => {
|
|
2210
|
-
const
|
|
2211
|
-
return { path:
|
|
2212
|
-
},
|
|
2213
|
-
const
|
|
2214
|
-
|
|
2215
|
-
path:
|
|
2216
|
-
params:
|
|
2217
|
-
query:
|
|
2264
|
+
const b = new URL(o || "/", "http://localhost"), y = b.pathname.replace(r, "") || "/", x = je(b.search);
|
|
2265
|
+
return { path: y, query: x };
|
|
2266
|
+
}, i = n();
|
|
2267
|
+
const $ = W(t, i.path);
|
|
2268
|
+
s = $e({
|
|
2269
|
+
path: i.path,
|
|
2270
|
+
params: $.params,
|
|
2271
|
+
query: i.query
|
|
2218
2272
|
}), a = async () => {
|
|
2219
|
-
const
|
|
2220
|
-
await
|
|
2273
|
+
const b = n();
|
|
2274
|
+
await v(b.path);
|
|
2221
2275
|
};
|
|
2222
|
-
const
|
|
2276
|
+
const v = async (b) => {
|
|
2223
2277
|
try {
|
|
2224
|
-
const
|
|
2225
|
-
path:
|
|
2278
|
+
const y = {
|
|
2279
|
+
path: b.replace(r, "") || "/",
|
|
2226
2280
|
query: {}
|
|
2227
|
-
},
|
|
2228
|
-
if (!
|
|
2229
|
-
const
|
|
2230
|
-
path:
|
|
2231
|
-
params:
|
|
2232
|
-
query:
|
|
2233
|
-
},
|
|
2234
|
-
if (
|
|
2281
|
+
}, x = W(t, y.path);
|
|
2282
|
+
if (!x) throw new Error(`No route found for ${y.path}`);
|
|
2283
|
+
const c = s.getState(), g = {
|
|
2284
|
+
path: y.path,
|
|
2285
|
+
params: x.params,
|
|
2286
|
+
query: y.query
|
|
2287
|
+
}, p = t.find((_) => W([_], g.path).route !== null);
|
|
2288
|
+
if (p?.beforeEnter)
|
|
2235
2289
|
try {
|
|
2236
|
-
const
|
|
2237
|
-
if (typeof
|
|
2238
|
-
await
|
|
2290
|
+
const _ = await p.beforeEnter(g, c);
|
|
2291
|
+
if (typeof _ == "string") {
|
|
2292
|
+
await v(_);
|
|
2239
2293
|
return;
|
|
2240
2294
|
}
|
|
2241
|
-
if (
|
|
2295
|
+
if (_ === !1) return;
|
|
2242
2296
|
} catch {
|
|
2243
2297
|
return;
|
|
2244
2298
|
}
|
|
2245
|
-
if (
|
|
2299
|
+
if (p?.onEnter)
|
|
2246
2300
|
try {
|
|
2247
|
-
const
|
|
2248
|
-
if (typeof
|
|
2249
|
-
await
|
|
2301
|
+
const _ = await p.onEnter(g, c);
|
|
2302
|
+
if (typeof _ == "string") {
|
|
2303
|
+
await v(_);
|
|
2250
2304
|
return;
|
|
2251
2305
|
}
|
|
2252
|
-
if (
|
|
2306
|
+
if (_ === !1) return;
|
|
2253
2307
|
} catch {
|
|
2254
2308
|
return;
|
|
2255
2309
|
}
|
|
2256
|
-
if (
|
|
2310
|
+
if (s.setState(g), p?.afterEnter)
|
|
2257
2311
|
try {
|
|
2258
|
-
|
|
2312
|
+
p.afterEnter(g, c);
|
|
2259
2313
|
} catch {
|
|
2260
2314
|
}
|
|
2261
2315
|
} catch {
|
|
2262
2316
|
}
|
|
2263
2317
|
};
|
|
2264
|
-
|
|
2318
|
+
f = async (b) => v(b), u = async (b) => v(b), d = () => {
|
|
2265
2319
|
};
|
|
2266
2320
|
}
|
|
2267
2321
|
return {
|
|
2268
|
-
store:
|
|
2269
|
-
push:
|
|
2270
|
-
replace:
|
|
2271
|
-
back:
|
|
2272
|
-
subscribe:
|
|
2273
|
-
matchRoute: (
|
|
2274
|
-
getCurrent: () =>
|
|
2275
|
-
resolveRouteComponent:
|
|
2322
|
+
store: s,
|
|
2323
|
+
push: f,
|
|
2324
|
+
replace: u,
|
|
2325
|
+
back: d,
|
|
2326
|
+
subscribe: s.subscribe,
|
|
2327
|
+
matchRoute: ($) => W(t, $),
|
|
2328
|
+
getCurrent: () => s.getState(),
|
|
2329
|
+
resolveRouteComponent: yt
|
|
2276
2330
|
};
|
|
2277
2331
|
}
|
|
2278
|
-
function
|
|
2279
|
-
return
|
|
2332
|
+
function Ct(e, t) {
|
|
2333
|
+
return W(e, t);
|
|
2280
2334
|
}
|
|
2281
|
-
function
|
|
2282
|
-
const t =
|
|
2283
|
-
return
|
|
2335
|
+
function Et(e) {
|
|
2336
|
+
const t = mt(e);
|
|
2337
|
+
return Te("router-view", {
|
|
2284
2338
|
async render() {
|
|
2285
|
-
if (!t) return
|
|
2339
|
+
if (!t) return U`<div>Router not initialized.</div>`;
|
|
2286
2340
|
const r = t.getCurrent(), { path: o } = r, n = t.matchRoute(o);
|
|
2287
|
-
if (!n.route) return
|
|
2341
|
+
if (!n.route) return U`<div>Not found</div>`;
|
|
2288
2342
|
try {
|
|
2289
|
-
const
|
|
2290
|
-
if (typeof
|
|
2291
|
-
return { tag:
|
|
2292
|
-
if (typeof
|
|
2293
|
-
const
|
|
2343
|
+
const i = await t.resolveRouteComponent(n.route);
|
|
2344
|
+
if (typeof i == "string")
|
|
2345
|
+
return { tag: i, props: {}, children: [] };
|
|
2346
|
+
if (typeof i == "function") {
|
|
2347
|
+
const s = i(), a = s instanceof Promise ? await s : s;
|
|
2294
2348
|
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2295
2349
|
}
|
|
2296
|
-
return
|
|
2350
|
+
return U`<div>Invalid route component</div>`;
|
|
2297
2351
|
} catch {
|
|
2298
|
-
return
|
|
2352
|
+
return U`<div>Invalid route component</div>`;
|
|
2299
2353
|
}
|
|
2300
2354
|
},
|
|
2301
2355
|
onConnected(r) {
|
|
@@ -2303,7 +2357,7 @@ function St(e) {
|
|
|
2303
2357
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2304
2358
|
});
|
|
2305
2359
|
}
|
|
2306
|
-
}),
|
|
2360
|
+
}), Te("router-link", {
|
|
2307
2361
|
state: {},
|
|
2308
2362
|
props: {
|
|
2309
2363
|
to: { type: String, default: "" },
|
|
@@ -2316,7 +2370,7 @@ function St(e) {
|
|
|
2316
2370
|
disabled: { type: Boolean, default: !1 },
|
|
2317
2371
|
external: { type: Boolean, default: !1 },
|
|
2318
2372
|
class: { type: String, default: "" },
|
|
2319
|
-
style: { type: String, default:
|
|
2373
|
+
style: { type: String, default: ze`
|
|
2320
2374
|
[aria-disabled="true"] {
|
|
2321
2375
|
pointer-events: none;
|
|
2322
2376
|
opacity: 0.5;
|
|
@@ -2325,32 +2379,32 @@ function St(e) {
|
|
|
2325
2379
|
},
|
|
2326
2380
|
style: (r) => r.style,
|
|
2327
2381
|
render: (r) => {
|
|
2328
|
-
const o = t.getCurrent(), n = r.to,
|
|
2329
|
-
for (const
|
|
2330
|
-
const
|
|
2331
|
-
...
|
|
2382
|
+
const o = t.getCurrent(), n = r.to, i = r.exact, s = r.exactActiveClass, a = r.activeClass, f = r.ariaCurrentValue, u = r.tag, d = r.disabled, m = r.external, l = o.path === n, h = i ? l : o && typeof o.path == "string" ? o.path.startsWith(n) : !1, w = l ? `aria-current="${f}"` : "", $ = (r.class || "").split(/\s+/).filter(Boolean), v = {};
|
|
2383
|
+
for (const g of $) v[g] = !0;
|
|
2384
|
+
const b = {
|
|
2385
|
+
...v,
|
|
2332
2386
|
// Also include the configurable names (may duplicate the above)
|
|
2333
|
-
[a]:
|
|
2334
|
-
[
|
|
2335
|
-
},
|
|
2336
|
-
return
|
|
2337
|
-
${
|
|
2387
|
+
[a]: h,
|
|
2388
|
+
[s]: l
|
|
2389
|
+
}, y = u === "button", x = d ? y ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", c = m && (u === "a" || !u) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2390
|
+
return U`
|
|
2391
|
+
${Oe().when(y, U`
|
|
2338
2392
|
<button
|
|
2339
2393
|
part="button"
|
|
2340
|
-
:class="${
|
|
2394
|
+
:class="${b}"
|
|
2395
|
+
${w}
|
|
2341
2396
|
${x}
|
|
2342
|
-
${
|
|
2343
|
-
${d}
|
|
2397
|
+
${c}
|
|
2344
2398
|
@click="navigate"
|
|
2345
2399
|
><slot></slot></button>
|
|
2346
|
-
`).otherwise(
|
|
2400
|
+
`).otherwise(U`
|
|
2347
2401
|
<a
|
|
2348
2402
|
part="link"
|
|
2349
2403
|
href="${n}"
|
|
2350
|
-
:class="${
|
|
2404
|
+
:class="${b}"
|
|
2405
|
+
${w}
|
|
2351
2406
|
${x}
|
|
2352
|
-
${
|
|
2353
|
-
${d}
|
|
2407
|
+
${c}
|
|
2354
2408
|
@click="navigate"
|
|
2355
2409
|
><slot></slot></a>
|
|
2356
2410
|
`).done()}
|
|
@@ -2366,25 +2420,26 @@ function St(e) {
|
|
|
2366
2420
|
}), t;
|
|
2367
2421
|
}
|
|
2368
2422
|
export {
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2423
|
+
G as GlobalEventBus,
|
|
2424
|
+
Te as component,
|
|
2425
|
+
$e as createStore,
|
|
2426
|
+
ze as css,
|
|
2427
|
+
xt as each,
|
|
2428
|
+
wt as emit,
|
|
2429
|
+
re as eventBus,
|
|
2430
|
+
U as html,
|
|
2431
|
+
Et as initRouter,
|
|
2432
|
+
St as listen,
|
|
2433
|
+
Oe as match,
|
|
2434
|
+
W as matchRoute,
|
|
2435
|
+
Ct as matchRouteSSR,
|
|
2436
|
+
$t as off,
|
|
2437
|
+
kt as on,
|
|
2438
|
+
_t as once,
|
|
2439
|
+
je as parseQuery,
|
|
2440
|
+
he as renderToString,
|
|
2441
|
+
yt as resolveRouteComponent,
|
|
2442
|
+
mt as useRouter,
|
|
2443
|
+
vt as when
|
|
2389
2444
|
};
|
|
2390
2445
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|