@jasonshimmy/custom-elements-runtime 0.2.5 → 0.2.7
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 +13 -13
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +933 -925
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +13 -13
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
1
|
+
function xt(e, t) {
|
|
2
2
|
return fe(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return e.map((r,
|
|
6
|
-
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${
|
|
7
|
-
return fe(t(r,
|
|
4
|
+
function kt(e, t) {
|
|
5
|
+
return e.map((r, i) => {
|
|
6
|
+
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${i}` : String(r);
|
|
7
|
+
return fe(t(r, i), `each-${n}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Pe() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,14 +17,14 @@ function Oe() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return Ne(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Ne(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
|
-
const [r,
|
|
27
|
-
if (r) return [fe(
|
|
26
|
+
const [r, i] = e[t];
|
|
27
|
+
if (r) return [fe(i, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
29
|
return [fe([], "whenChain-empty")];
|
|
30
30
|
}
|
|
@@ -52,9 +52,9 @@ class G extends EventTarget {
|
|
|
52
52
|
* @param data - Optional event payload
|
|
53
53
|
*/
|
|
54
54
|
emit(t, r) {
|
|
55
|
-
const
|
|
56
|
-
if (!n ||
|
|
57
|
-
this.eventCounters.set(t, { count: 1, window:
|
|
55
|
+
const i = Date.now(), n = this.eventCounters.get(t);
|
|
56
|
+
if (!n || i - n.window > 1e3)
|
|
57
|
+
this.eventCounters.set(t, { count: 1, window: i });
|
|
58
58
|
else if (n.count++, n.count > 50 && n.count > 100)
|
|
59
59
|
return;
|
|
60
60
|
this.dispatchEvent(new CustomEvent(t, {
|
|
@@ -63,10 +63,10 @@ class G extends EventTarget {
|
|
|
63
63
|
// Global events don't need to bubble
|
|
64
64
|
cancelable: !0
|
|
65
65
|
}));
|
|
66
|
-
const
|
|
67
|
-
|
|
66
|
+
const s = this.handlers[t];
|
|
67
|
+
s && s.forEach((o) => {
|
|
68
68
|
try {
|
|
69
|
-
|
|
69
|
+
o(r);
|
|
70
70
|
} catch (a) {
|
|
71
71
|
console.error(`Error in global event handler for "${t}":`, a);
|
|
72
72
|
}
|
|
@@ -86,8 +86,8 @@ class G extends EventTarget {
|
|
|
86
86
|
* @param handler - Handler function to remove
|
|
87
87
|
*/
|
|
88
88
|
off(t, r) {
|
|
89
|
-
const
|
|
90
|
-
|
|
89
|
+
const i = this.handlers[t];
|
|
90
|
+
i && i.delete(r);
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Remove all handlers for a specific event.
|
|
@@ -102,8 +102,8 @@ class G extends EventTarget {
|
|
|
102
102
|
* @param handler - CustomEvent handler
|
|
103
103
|
* @param options - AddEventListener options
|
|
104
104
|
*/
|
|
105
|
-
listen(t, r,
|
|
106
|
-
return this.addEventListener(t, r,
|
|
105
|
+
listen(t, r, i) {
|
|
106
|
+
return this.addEventListener(t, r, i), () => this.removeEventListener(t, r);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
@@ -111,9 +111,9 @@ class G extends EventTarget {
|
|
|
111
111
|
* @param handler - Handler function
|
|
112
112
|
*/
|
|
113
113
|
once(t, r) {
|
|
114
|
-
return new Promise((
|
|
115
|
-
const n = this.on(t, (
|
|
116
|
-
n(), r(
|
|
114
|
+
return new Promise((i) => {
|
|
115
|
+
const n = this.on(t, (s) => {
|
|
116
|
+
n(), r(s), i(s);
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -143,9 +143,9 @@ class G extends EventTarget {
|
|
|
143
143
|
*/
|
|
144
144
|
getEventStats() {
|
|
145
145
|
const t = {};
|
|
146
|
-
for (const [r,
|
|
146
|
+
for (const [r, i] of this.eventCounters.entries())
|
|
147
147
|
t[r] = {
|
|
148
|
-
count:
|
|
148
|
+
count: i.count,
|
|
149
149
|
handlersCount: this.getHandlerCount(r)
|
|
150
150
|
};
|
|
151
151
|
return t;
|
|
@@ -157,24 +157,24 @@ class G extends EventTarget {
|
|
|
157
157
|
this.eventCounters.clear();
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
const re = G.getInstance(),
|
|
160
|
+
const re = G.getInstance(), vt = (e, t) => re.emit(e, t), $t = (e, t) => re.on(e, t), _t = (e, t) => re.off(e, t), St = (e, t) => re.once(e, t), Et = (e, t, r) => re.listen(e, t, r);
|
|
161
161
|
function $e(e) {
|
|
162
162
|
let t = { ...e };
|
|
163
163
|
const r = [];
|
|
164
|
-
function
|
|
164
|
+
function i(a) {
|
|
165
165
|
r.push(a), a(t);
|
|
166
166
|
}
|
|
167
167
|
function n() {
|
|
168
168
|
return t;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function s(a) {
|
|
171
171
|
const f = typeof a == "function" ? a(t) : a;
|
|
172
|
-
t = { ...t, ...f },
|
|
172
|
+
t = { ...t, ...f }, o();
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function o() {
|
|
175
175
|
r.forEach((a) => a(t));
|
|
176
176
|
}
|
|
177
|
-
return { subscribe:
|
|
177
|
+
return { subscribe: i, getState: n, setState: s };
|
|
178
178
|
}
|
|
179
179
|
function J(e) {
|
|
180
180
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -191,78 +191,78 @@ function H(e) {
|
|
|
191
191
|
})[t]
|
|
192
192
|
) : e;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
return typeof t == "string" ? t.split(".").reduce((r,
|
|
194
|
+
function z(e, t) {
|
|
195
|
+
return typeof t == "string" ? t.split(".").reduce((r, i) => r?.[i], e) : t;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
const
|
|
197
|
+
function oe(e, t, r) {
|
|
198
|
+
const i = String(t).split("."), n = i.pop();
|
|
199
199
|
if (!n) return;
|
|
200
|
-
const
|
|
201
|
-
|
|
200
|
+
const s = i.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
201
|
+
s[n] = r;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function ze(e, t, r) {
|
|
204
204
|
if (r)
|
|
205
|
-
for (const [
|
|
206
|
-
let
|
|
207
|
-
if (Array.isArray(n) ? (
|
|
208
|
-
callback:
|
|
209
|
-
options:
|
|
210
|
-
oldValue:
|
|
211
|
-
}),
|
|
205
|
+
for (const [i, n] of Object.entries(r)) {
|
|
206
|
+
let s, o = {};
|
|
207
|
+
if (Array.isArray(n) ? (s = n[0], o = n[1] || {}) : s = n, t.set(i, {
|
|
208
|
+
callback: s,
|
|
209
|
+
options: o,
|
|
210
|
+
oldValue: z(e, i)
|
|
211
|
+
}), o.immediate)
|
|
212
212
|
try {
|
|
213
|
-
const a =
|
|
214
|
-
|
|
213
|
+
const a = z(e, i);
|
|
214
|
+
s(a, void 0, e);
|
|
215
215
|
} catch (a) {
|
|
216
|
-
console.error(`Error in immediate watcher for "${
|
|
216
|
+
console.error(`Error in immediate watcher for "${i}":`, a);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
function Me(e, t, r,
|
|
221
|
-
const n = (
|
|
222
|
-
if (
|
|
223
|
-
if (typeof
|
|
224
|
-
if (Array.isArray(
|
|
225
|
-
return
|
|
226
|
-
const f = Object.keys(
|
|
227
|
-
return f.length !== u.length ? !1 : f.every((d) => n(
|
|
228
|
-
},
|
|
229
|
-
if (
|
|
220
|
+
function Me(e, t, r, i) {
|
|
221
|
+
const n = (o, a) => {
|
|
222
|
+
if (o === a) return !0;
|
|
223
|
+
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
224
|
+
if (Array.isArray(o) && Array.isArray(a))
|
|
225
|
+
return o.length !== a.length ? !1 : o.every((d, y) => n(d, a[y]));
|
|
226
|
+
const f = Object.keys(o), u = Object.keys(a);
|
|
227
|
+
return f.length !== u.length ? !1 : f.every((d) => n(o[d], a[d]));
|
|
228
|
+
}, s = t.get(r);
|
|
229
|
+
if (s && !n(i, s.oldValue))
|
|
230
230
|
try {
|
|
231
|
-
|
|
232
|
-
} catch (
|
|
233
|
-
console.error(`Error in watcher for "${r}":`,
|
|
231
|
+
s.callback(i, s.oldValue, e), s.oldValue = i;
|
|
232
|
+
} catch (o) {
|
|
233
|
+
console.error(`Error in watcher for "${r}":`, o);
|
|
234
234
|
}
|
|
235
|
-
for (const [
|
|
236
|
-
if (a.options.deep && r.startsWith(
|
|
235
|
+
for (const [o, a] of t.entries())
|
|
236
|
+
if (a.options.deep && r.startsWith(o + "."))
|
|
237
237
|
try {
|
|
238
|
-
const f =
|
|
238
|
+
const f = z(e, o);
|
|
239
239
|
n(f, a.oldValue) || (a.callback(f, a.oldValue, e), a.oldValue = f);
|
|
240
240
|
} catch (f) {
|
|
241
|
-
console.error(`Error in deep watcher for "${
|
|
241
|
+
console.error(`Error in deep watcher for "${o}":`, f);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
function We(e, t, r) {
|
|
245
245
|
if (!t.props) return;
|
|
246
|
-
function
|
|
247
|
-
return
|
|
246
|
+
function i(n, s) {
|
|
247
|
+
return s === Boolean ? n === "true" : s === Number ? Number(n) : n;
|
|
248
248
|
}
|
|
249
|
-
Object.entries(t.props).forEach(([n,
|
|
250
|
-
if (
|
|
249
|
+
Object.entries(t.props).forEach(([n, s]) => {
|
|
250
|
+
if (s.type === Function && typeof e[n] == "function")
|
|
251
251
|
r[n] = e[n];
|
|
252
252
|
else {
|
|
253
|
-
const
|
|
254
|
-
|
|
253
|
+
const o = e.getAttribute(J(n));
|
|
254
|
+
o !== null ? r[n] = H(i(o, s.type)) : "default" in s && s.default !== void 0 && (r[n] = H(s.default));
|
|
255
255
|
}
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
function qe(e, t, r,
|
|
259
|
-
e.onConnected && !r && (e.onConnected(t),
|
|
258
|
+
function qe(e, t, r, i) {
|
|
259
|
+
e.onConnected && !r && (e.onConnected(t), i(!0));
|
|
260
260
|
}
|
|
261
|
-
function De(e, t, r,
|
|
262
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()),
|
|
261
|
+
function De(e, t, r, i, n, s, o, a) {
|
|
262
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()), i(), n(), s(!1), o(null), a(!1);
|
|
263
263
|
}
|
|
264
|
-
function Ie(e, t, r,
|
|
265
|
-
e.onAttributeChanged && e.onAttributeChanged(t, r,
|
|
264
|
+
function Ie(e, t, r, i, n) {
|
|
265
|
+
e.onAttributeChanged && e.onAttributeChanged(t, r, i, n);
|
|
266
266
|
}
|
|
267
267
|
function V(e, t) {
|
|
268
268
|
if (t && e instanceof HTMLElement) {
|
|
@@ -272,96 +272,96 @@ function V(e, t) {
|
|
|
272
272
|
V(r, t);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
function He(e, t, r,
|
|
276
|
-
if (!
|
|
277
|
-
const f = t.includes("lazy"), u = t.includes("trim"), d = t.includes("number"),
|
|
275
|
+
function He(e, t, r, i, n, s, o, a) {
|
|
276
|
+
if (!s) return;
|
|
277
|
+
const f = t.includes("lazy"), u = t.includes("trim"), d = t.includes("number"), y = () => z(s._state || s, e), c = y();
|
|
278
278
|
let h = "text";
|
|
279
|
-
|
|
280
|
-
const
|
|
279
|
+
o instanceof HTMLInputElement ? h = i?.type || o.type || "text" : o instanceof HTMLSelectElement ? h = "select" : o instanceof HTMLTextAreaElement && (h = "textarea");
|
|
280
|
+
const k = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, w = k ? h === "checkbox" || h === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
281
281
|
if (h === "checkbox")
|
|
282
|
-
if (Array.isArray(
|
|
283
|
-
r[
|
|
282
|
+
if (Array.isArray(c))
|
|
283
|
+
r[w] = c.includes(String(o?.getAttribute("value") ?? i?.value ?? ""));
|
|
284
284
|
else {
|
|
285
|
-
const x =
|
|
286
|
-
r[
|
|
285
|
+
const x = o?.getAttribute("true-value") ?? !0;
|
|
286
|
+
r[w] = c === x;
|
|
287
287
|
}
|
|
288
288
|
else if (h === "radio")
|
|
289
|
-
r[
|
|
289
|
+
r[w] = c === (i?.value ?? "");
|
|
290
290
|
else if (h === "select")
|
|
291
|
-
if (
|
|
292
|
-
const x = Array.isArray(
|
|
291
|
+
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
292
|
+
const x = Array.isArray(c) ? c.map(String) : [];
|
|
293
293
|
setTimeout(() => {
|
|
294
|
-
Array.from(
|
|
295
|
-
|
|
294
|
+
Array.from(o.options).forEach((l) => {
|
|
295
|
+
l.selected = x.includes(l.value);
|
|
296
296
|
});
|
|
297
|
-
}, 0), r[
|
|
297
|
+
}, 0), r[w] = Array.isArray(c) ? c : [];
|
|
298
298
|
} else
|
|
299
|
-
r[
|
|
299
|
+
r[w] = c;
|
|
300
300
|
else {
|
|
301
|
-
r[
|
|
301
|
+
r[w] = c;
|
|
302
302
|
try {
|
|
303
|
-
const x = J(
|
|
304
|
-
|
|
303
|
+
const x = J(w);
|
|
304
|
+
i && (i[x] = c);
|
|
305
305
|
} catch {
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
const b = f || h === "checkbox" || h === "radio" || h === "select" ? "change" : "input",
|
|
308
|
+
const b = f || h === "checkbox" || h === "radio" || h === "select" ? "change" : "input", m = (x) => {
|
|
309
309
|
if (x.isComposing || n._isComposing || x.isTrusted === !1) return;
|
|
310
|
-
const
|
|
311
|
-
if (!
|
|
312
|
-
let g =
|
|
310
|
+
const l = x.target;
|
|
311
|
+
if (!l || l._modelUpdating) return;
|
|
312
|
+
let g = l.value;
|
|
313
313
|
if (h === "checkbox") {
|
|
314
|
-
const
|
|
315
|
-
if (Array.isArray(
|
|
316
|
-
const S =
|
|
317
|
-
if (
|
|
314
|
+
const E = y();
|
|
315
|
+
if (Array.isArray(E)) {
|
|
316
|
+
const S = l.getAttribute("value") ?? "", A = Array.from(E);
|
|
317
|
+
if (l.checked)
|
|
318
318
|
A.includes(S) || A.push(S);
|
|
319
319
|
else {
|
|
320
|
-
const
|
|
321
|
-
|
|
320
|
+
const j = A.indexOf(S);
|
|
321
|
+
j > -1 && A.splice(j, 1);
|
|
322
322
|
}
|
|
323
323
|
g = A;
|
|
324
324
|
} else {
|
|
325
|
-
const S =
|
|
326
|
-
g =
|
|
325
|
+
const S = l.getAttribute("true-value") ?? !0, A = l.getAttribute("false-value") ?? !1;
|
|
326
|
+
g = l.checked ? S : A;
|
|
327
327
|
}
|
|
328
328
|
} else if (h === "radio")
|
|
329
|
-
g =
|
|
330
|
-
else if (h === "select" &&
|
|
331
|
-
g = Array.from(
|
|
329
|
+
g = l.getAttribute("value") ?? l.value;
|
|
330
|
+
else if (h === "select" && l.multiple)
|
|
331
|
+
g = Array.from(l.selectedOptions).map((E) => E.value);
|
|
332
332
|
else if (u && typeof g == "string" && (g = g.trim()), d) {
|
|
333
|
-
const
|
|
334
|
-
isNaN(
|
|
333
|
+
const E = Number(g);
|
|
334
|
+
isNaN(E) || (g = E);
|
|
335
335
|
}
|
|
336
|
-
const p =
|
|
336
|
+
const p = s._state || s, _ = z(p, e);
|
|
337
337
|
if (Array.isArray(g) && Array.isArray(_) ? JSON.stringify([...g].sort()) !== JSON.stringify([..._].sort()) : g !== _) {
|
|
338
|
-
|
|
338
|
+
l._modelUpdating = !0;
|
|
339
339
|
try {
|
|
340
|
-
|
|
340
|
+
oe(p, e, g), s._requestRender && s._requestRender();
|
|
341
341
|
} finally {
|
|
342
|
-
setTimeout(() =>
|
|
342
|
+
setTimeout(() => l._modelUpdating = !1, 0);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
};
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
(Array.isArray(g) && Array.isArray(p) ? JSON.stringify([...g].sort()) !== JSON.stringify([...p].sort()) : g !== p) && (
|
|
346
|
+
k ? n[b] = m : n[`update:${J(w)}`] = (x) => {
|
|
347
|
+
const l = s._state || s, g = x.detail !== void 0 ? x.detail : x.target?.value, p = z(l, e);
|
|
348
|
+
(Array.isArray(g) && Array.isArray(p) ? JSON.stringify([...g].sort()) !== JSON.stringify([...p].sort()) : g !== p) && (oe(l, e, g), s._requestRender && s._requestRender());
|
|
349
349
|
}, (h === "text" || h === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
|
|
350
350
|
n._isComposing = !1;
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
const g =
|
|
354
|
-
let
|
|
355
|
-
if (u && (
|
|
356
|
-
const S = Number(
|
|
357
|
-
isNaN(S) || (
|
|
351
|
+
const l = x.target;
|
|
352
|
+
l && setTimeout(() => {
|
|
353
|
+
const g = l.value, p = s._state || s, _ = z(p, e);
|
|
354
|
+
let C = g;
|
|
355
|
+
if (u && (C = C.trim()), d) {
|
|
356
|
+
const S = Number(C);
|
|
357
|
+
isNaN(S) || (C = S);
|
|
358
358
|
}
|
|
359
|
-
if (Array.isArray(
|
|
360
|
-
|
|
359
|
+
if (Array.isArray(C) && Array.isArray(_) ? JSON.stringify([...C].sort()) !== JSON.stringify([..._].sort()) : C !== _) {
|
|
360
|
+
l._modelUpdating = !0;
|
|
361
361
|
try {
|
|
362
|
-
|
|
362
|
+
oe(p, e, C), s._requestRender && s._requestRender();
|
|
363
363
|
} finally {
|
|
364
|
-
setTimeout(() =>
|
|
364
|
+
setTimeout(() => l._modelUpdating = !1, 0);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
}, 0);
|
|
@@ -371,61 +371,61 @@ function Le(e) {
|
|
|
371
371
|
const t = e.slice(2);
|
|
372
372
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
373
373
|
}
|
|
374
|
-
function Fe(e, t, r,
|
|
375
|
-
if (
|
|
374
|
+
function Fe(e, t, r, i) {
|
|
375
|
+
if (i) {
|
|
376
376
|
if (typeof e == "object" && e !== null)
|
|
377
|
-
for (const [n,
|
|
378
|
-
t[n] =
|
|
377
|
+
for (const [n, s] of Object.entries(e))
|
|
378
|
+
t[n] = s;
|
|
379
379
|
else if (typeof e == "string")
|
|
380
380
|
try {
|
|
381
381
|
const n = JSON.parse(e);
|
|
382
382
|
if (typeof n == "object" && n !== null) {
|
|
383
|
-
for (const [
|
|
384
|
-
t[
|
|
383
|
+
for (const [s, o] of Object.entries(n))
|
|
384
|
+
t[s] = o;
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
387
|
} catch {
|
|
388
|
-
const n =
|
|
388
|
+
const n = z(i, e);
|
|
389
389
|
r[e] = n;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
function Ke(e, t, r) {
|
|
394
394
|
if (!r) return;
|
|
395
|
-
const
|
|
395
|
+
const i = z(r, e), n = t.style || "", s = i ? "" : "none";
|
|
396
396
|
if (n) {
|
|
397
|
-
const
|
|
397
|
+
const o = n.split(";").filter(Boolean), a = o.findIndex(
|
|
398
398
|
(f) => f.trim().startsWith("display:")
|
|
399
399
|
);
|
|
400
|
-
a >= 0 ?
|
|
400
|
+
a >= 0 ? o[a] = `display: ${s}` : o.push(`display: ${s}`), t.style = o.join("; ");
|
|
401
401
|
} else
|
|
402
|
-
t.style = `display: ${
|
|
402
|
+
t.style = `display: ${s}`;
|
|
403
403
|
}
|
|
404
404
|
function Ue(e, t, r) {
|
|
405
405
|
if (!r) return;
|
|
406
|
-
const
|
|
406
|
+
const i = z(r, e);
|
|
407
407
|
let n = [];
|
|
408
|
-
typeof
|
|
409
|
-
const
|
|
410
|
-
|
|
408
|
+
typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
409
|
+
const s = t.class || "", o = s ? `${s} ${n.join(" ")}`.trim() : n.join(" ");
|
|
410
|
+
o && (t.class = o);
|
|
411
411
|
}
|
|
412
412
|
function Ve(e, t, r) {
|
|
413
|
-
let
|
|
413
|
+
let i;
|
|
414
414
|
if (typeof e == "string") {
|
|
415
415
|
if (!r) return;
|
|
416
|
-
|
|
416
|
+
i = z(r, e);
|
|
417
417
|
} else
|
|
418
|
-
|
|
418
|
+
i = e;
|
|
419
419
|
let n = "";
|
|
420
|
-
if (typeof
|
|
421
|
-
n =
|
|
422
|
-
else if (
|
|
423
|
-
const
|
|
424
|
-
for (const [a, f] of Object.entries(
|
|
420
|
+
if (typeof i == "string")
|
|
421
|
+
n = i;
|
|
422
|
+
else if (i && typeof i == "object") {
|
|
423
|
+
const o = [];
|
|
424
|
+
for (const [a, f] of Object.entries(i))
|
|
425
425
|
if (f != null && f !== "") {
|
|
426
426
|
const u = a.replace(
|
|
427
427
|
/[A-Z]/g,
|
|
428
|
-
(
|
|
428
|
+
(c) => `-${c.toLowerCase()}`
|
|
429
429
|
), d = [
|
|
430
430
|
"width",
|
|
431
431
|
"height",
|
|
@@ -452,26 +452,26 @@ function Ve(e, t, r) {
|
|
|
452
452
|
"min-height",
|
|
453
453
|
"max-height"
|
|
454
454
|
];
|
|
455
|
-
let
|
|
456
|
-
typeof f == "number" && d.includes(u) && (
|
|
455
|
+
let y = String(f);
|
|
456
|
+
typeof f == "number" && d.includes(u) && (y = `${f}px`), o.push(`${u}: ${y}`);
|
|
457
457
|
}
|
|
458
|
-
n =
|
|
458
|
+
n = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
459
459
|
}
|
|
460
|
-
const
|
|
461
|
-
t.style =
|
|
460
|
+
const s = t.style || "";
|
|
461
|
+
t.style = s + (s && !s.endsWith(";") ? "; " : "") + n;
|
|
462
462
|
}
|
|
463
|
-
function Re(e, t, r,
|
|
464
|
-
const n = {},
|
|
463
|
+
function Re(e, t, r, i) {
|
|
464
|
+
const n = {}, s = { ...i || {} }, o = {};
|
|
465
465
|
for (const [a, f] of Object.entries(e)) {
|
|
466
|
-
const { value: u, modifiers: d, arg:
|
|
466
|
+
const { value: u, modifiers: d, arg: y } = f;
|
|
467
467
|
if (a === "model" || a.startsWith("model:")) {
|
|
468
|
-
const
|
|
468
|
+
const c = a.split(":"), h = c.length > 1 ? c[1] : y;
|
|
469
469
|
He(
|
|
470
470
|
typeof u == "string" ? u : String(u),
|
|
471
471
|
d,
|
|
472
472
|
n,
|
|
473
|
-
i,
|
|
474
473
|
s,
|
|
474
|
+
o,
|
|
475
475
|
t,
|
|
476
476
|
r,
|
|
477
477
|
h
|
|
@@ -480,330 +480,330 @@ function Re(e, t, r, o) {
|
|
|
480
480
|
}
|
|
481
481
|
switch (a) {
|
|
482
482
|
case "bind":
|
|
483
|
-
Fe(u, n,
|
|
483
|
+
Fe(u, n, s, t);
|
|
484
484
|
break;
|
|
485
485
|
case "show":
|
|
486
|
-
Ke(u,
|
|
486
|
+
Ke(u, s, t);
|
|
487
487
|
break;
|
|
488
488
|
case "class":
|
|
489
|
-
Ue(u,
|
|
489
|
+
Ue(u, s, t);
|
|
490
490
|
break;
|
|
491
491
|
case "style":
|
|
492
|
-
Ve(u,
|
|
492
|
+
Ve(u, s, t);
|
|
493
493
|
break;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
return { props: n, attrs:
|
|
496
|
+
return { props: n, attrs: s, listeners: o };
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function ve(e, t) {
|
|
499
499
|
if (Array.isArray(e)) {
|
|
500
|
-
const
|
|
501
|
-
return e.map((
|
|
502
|
-
if (!
|
|
503
|
-
let a =
|
|
500
|
+
const s = /* @__PURE__ */ new Set();
|
|
501
|
+
return e.map((o) => {
|
|
502
|
+
if (!o || typeof o != "object") return o;
|
|
503
|
+
let a = o.props?.key ?? o.key;
|
|
504
504
|
if (!a) {
|
|
505
|
-
const
|
|
506
|
-
a =
|
|
505
|
+
const y = o.tag || "node", c = o.props?.attrs?.id ?? o.props?.attrs?.name ?? o.props?.attrs?.["data-key"] ?? "";
|
|
506
|
+
a = c ? `${t}:${y}:${c}` : `${t}:${y}`;
|
|
507
507
|
}
|
|
508
508
|
let f = a, u = 1;
|
|
509
|
-
for (;
|
|
509
|
+
for (; s.has(f); )
|
|
510
510
|
f = `${a}#${u++}`;
|
|
511
|
-
|
|
512
|
-
let d =
|
|
513
|
-
return Array.isArray(d) && (d =
|
|
511
|
+
s.add(f);
|
|
512
|
+
let d = o.children;
|
|
513
|
+
return Array.isArray(d) && (d = ve(d, f)), { ...o, key: f, children: d };
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
const r = e;
|
|
517
|
-
let
|
|
518
|
-
return Array.isArray(n) && (n =
|
|
517
|
+
let i = r.props?.key ?? r.key ?? t, n = r.children;
|
|
518
|
+
return Array.isArray(n) && (n = ve(n, i)), { ...r, key: i, children: n };
|
|
519
519
|
}
|
|
520
|
-
function Je(e, t, r,
|
|
521
|
-
const n = r.directives ?? {},
|
|
520
|
+
function Je(e, t, r, i) {
|
|
521
|
+
const n = r.directives ?? {}, s = Re(
|
|
522
522
|
n,
|
|
523
|
-
|
|
523
|
+
i,
|
|
524
524
|
e,
|
|
525
525
|
r.attrs
|
|
526
|
-
),
|
|
526
|
+
), o = {
|
|
527
527
|
...t.props,
|
|
528
528
|
...r.props,
|
|
529
|
-
...
|
|
529
|
+
...s.props
|
|
530
530
|
}, a = {
|
|
531
531
|
...t.attrs,
|
|
532
532
|
...r.attrs,
|
|
533
|
-
...
|
|
534
|
-
}, f = t.props ?? {}, u =
|
|
535
|
-
for (const
|
|
536
|
-
const h = f[
|
|
537
|
-
if (h !==
|
|
538
|
-
if (
|
|
539
|
-
e.value !==
|
|
540
|
-
else if (
|
|
541
|
-
e.checked = !!
|
|
542
|
-
else if (
|
|
543
|
-
const $ = Le(
|
|
544
|
-
typeof h == "function" && e.removeEventListener($, h), e.addEventListener($,
|
|
545
|
-
} else if (
|
|
546
|
-
e.removeAttribute(
|
|
547
|
-
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) ||
|
|
533
|
+
...s.attrs
|
|
534
|
+
}, f = t.props ?? {}, u = o;
|
|
535
|
+
for (const c in { ...f, ...u }) {
|
|
536
|
+
const h = f[c], k = u[c];
|
|
537
|
+
if (h !== k) {
|
|
538
|
+
if (c === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
539
|
+
e.value !== k && (e.value = k ?? "");
|
|
540
|
+
else if (c === "checked" && e instanceof HTMLInputElement)
|
|
541
|
+
e.checked = !!k;
|
|
542
|
+
else if (c.startsWith("on") && typeof k == "function") {
|
|
543
|
+
const $ = Le(c);
|
|
544
|
+
typeof h == "function" && e.removeEventListener($, h), e.addEventListener($, k);
|
|
545
|
+
} else if (k == null || k === !1)
|
|
546
|
+
e.removeAttribute(c);
|
|
547
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || c in e)
|
|
548
548
|
try {
|
|
549
|
-
e[
|
|
549
|
+
e[c] = k;
|
|
550
550
|
} catch {
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
for (const [
|
|
555
|
-
|
|
554
|
+
for (const [c, h] of Object.entries(
|
|
555
|
+
s.listeners || {}
|
|
556
556
|
))
|
|
557
|
-
e.addEventListener(
|
|
558
|
-
const d = t.attrs ?? {},
|
|
559
|
-
for (const
|
|
560
|
-
const h = d[
|
|
561
|
-
h !==
|
|
557
|
+
e.addEventListener(c, h);
|
|
558
|
+
const d = t.attrs ?? {}, y = a;
|
|
559
|
+
for (const c in { ...d, ...y }) {
|
|
560
|
+
const h = d[c], k = y[c];
|
|
561
|
+
h !== k && (k == null || k === !1 ? e.removeAttribute(c) : e.setAttribute(c, String(k)));
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
function M(e, t, r) {
|
|
565
565
|
if (typeof e == "string")
|
|
566
566
|
return document.createTextNode(e);
|
|
567
567
|
if (e.tag === "#text") {
|
|
568
|
-
const
|
|
568
|
+
const y = document.createTextNode(
|
|
569
569
|
typeof e.children == "string" ? e.children : ""
|
|
570
570
|
);
|
|
571
|
-
return e.key != null && (
|
|
571
|
+
return e.key != null && (y.key = e.key), y;
|
|
572
572
|
}
|
|
573
573
|
if (e.tag === "#anchor") {
|
|
574
|
-
const
|
|
575
|
-
|
|
574
|
+
const y = e, c = Array.isArray(y.children) ? y.children : [], h = document.createTextNode(""), k = document.createTextNode("");
|
|
575
|
+
y.key != null && (h.key = `${y.key}:start`, k.key = `${y.key}:end`), y._startNode = h, y._endNode = k;
|
|
576
576
|
const $ = document.createDocumentFragment();
|
|
577
577
|
$.appendChild(h);
|
|
578
|
-
for (const
|
|
579
|
-
const b = M(
|
|
578
|
+
for (const w of c) {
|
|
579
|
+
const b = M(w, t);
|
|
580
580
|
$.appendChild(b);
|
|
581
581
|
}
|
|
582
|
-
return $.appendChild(
|
|
582
|
+
return $.appendChild(k), $;
|
|
583
583
|
}
|
|
584
|
-
const
|
|
585
|
-
e.key != null && (
|
|
586
|
-
const { props: n = {}, attrs:
|
|
584
|
+
const i = document.createElement(e.tag);
|
|
585
|
+
e.key != null && (i.key = e.key);
|
|
586
|
+
const { props: n = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = Re(o, t, i, s), f = {
|
|
587
587
|
...n,
|
|
588
588
|
...a.props
|
|
589
589
|
}, u = {
|
|
590
|
-
...
|
|
590
|
+
...s,
|
|
591
591
|
...a.attrs
|
|
592
592
|
};
|
|
593
|
-
for (const
|
|
594
|
-
const
|
|
595
|
-
typeof
|
|
596
|
-
}
|
|
597
|
-
for (const
|
|
598
|
-
const
|
|
599
|
-
if (!(typeof
|
|
600
|
-
if (
|
|
601
|
-
|
|
602
|
-
else if (
|
|
603
|
-
|
|
604
|
-
else if (
|
|
605
|
-
|
|
593
|
+
for (const y in u) {
|
|
594
|
+
const c = u[y];
|
|
595
|
+
typeof y != "string" || /\[object Object\]/.test(y) || (typeof c == "boolean" ? c && i.setAttribute(y, "") : c != null && i.setAttribute(y, c));
|
|
596
|
+
}
|
|
597
|
+
for (const y in f) {
|
|
598
|
+
const c = f[y];
|
|
599
|
+
if (!(typeof y != "string" || /\[object Object\]/.test(y)))
|
|
600
|
+
if (y === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement))
|
|
601
|
+
i.value = c ?? "";
|
|
602
|
+
else if (y === "checked" && i instanceof HTMLInputElement)
|
|
603
|
+
i.checked = !!c;
|
|
604
|
+
else if (y.startsWith("on") && typeof c == "function")
|
|
605
|
+
i.addEventListener(Le(y), c);
|
|
606
606
|
else {
|
|
607
|
-
if (
|
|
607
|
+
if (y.startsWith("on") && c === void 0)
|
|
608
608
|
continue;
|
|
609
|
-
if (
|
|
610
|
-
|
|
611
|
-
else if ((e.props?.isCustomElement ?? !1) ||
|
|
609
|
+
if (c == null || c === !1)
|
|
610
|
+
i.removeAttribute(y);
|
|
611
|
+
else if ((e.props?.isCustomElement ?? !1) || y in i)
|
|
612
612
|
try {
|
|
613
|
-
|
|
613
|
+
i[y] = c;
|
|
614
614
|
} catch {
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
for (const [
|
|
618
|
+
for (const [y, c] of Object.entries(
|
|
619
619
|
a.listeners || {}
|
|
620
620
|
))
|
|
621
|
-
|
|
621
|
+
i.addEventListener(y, c);
|
|
622
622
|
const d = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
623
|
-
typeof e != "string" && d && r && (r[d] =
|
|
623
|
+
typeof e != "string" && d && r && (r[d] = i);
|
|
624
624
|
try {
|
|
625
|
-
if (typeof
|
|
625
|
+
if (typeof i._applyProps == "function")
|
|
626
626
|
try {
|
|
627
|
-
|
|
627
|
+
i._applyProps(i._cfg);
|
|
628
628
|
} catch {
|
|
629
629
|
}
|
|
630
|
-
typeof
|
|
630
|
+
typeof i.requestRender == "function" ? i.requestRender() : typeof i._render == "function" && i._render(i._cfg);
|
|
631
631
|
} catch {
|
|
632
632
|
}
|
|
633
633
|
if (Array.isArray(e.children))
|
|
634
|
-
for (const
|
|
635
|
-
|
|
636
|
-
else typeof e.children == "string" && (
|
|
637
|
-
return
|
|
634
|
+
for (const y of e.children)
|
|
635
|
+
i.appendChild(M(y, t, r));
|
|
636
|
+
else typeof e.children == "string" && (i.textContent = e.children);
|
|
637
|
+
return i;
|
|
638
638
|
}
|
|
639
|
-
function Ze(e, t, r,
|
|
639
|
+
function Ze(e, t, r, i, n) {
|
|
640
640
|
if (typeof r == "string") {
|
|
641
641
|
e.textContent !== r && (e.textContent = r);
|
|
642
642
|
return;
|
|
643
643
|
}
|
|
644
644
|
if (!Array.isArray(r)) return;
|
|
645
|
-
const
|
|
646
|
-
for (const h of
|
|
645
|
+
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
646
|
+
for (const h of o)
|
|
647
647
|
h && h.key != null && a.set(h.key, h);
|
|
648
648
|
const f = /* @__PURE__ */ new Map();
|
|
649
|
-
for (const h of
|
|
650
|
-
const
|
|
651
|
-
|
|
649
|
+
for (const h of s) {
|
|
650
|
+
const k = h.key;
|
|
651
|
+
k != null && f.set(k, h);
|
|
652
652
|
}
|
|
653
653
|
const u = /* @__PURE__ */ new Set();
|
|
654
654
|
let d = e.firstChild;
|
|
655
|
-
function
|
|
655
|
+
function y(h, k) {
|
|
656
656
|
let $ = h;
|
|
657
|
-
for (; $ && (u.add($), $ !==
|
|
657
|
+
for (; $ && (u.add($), $ !== k); )
|
|
658
658
|
$ = $.nextSibling;
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function c(h, k, $, w) {
|
|
661
661
|
const b = [];
|
|
662
|
-
let
|
|
663
|
-
for (;
|
|
664
|
-
b.push(
|
|
662
|
+
let m = h.nextSibling;
|
|
663
|
+
for (; m && m !== k; )
|
|
664
|
+
b.push(m), m = m.nextSibling;
|
|
665
665
|
const x = Array.isArray($) ? $ : [];
|
|
666
|
-
if (
|
|
666
|
+
if (w.some((g) => g && g.key != null) || x.some((g) => g && g.key != null)) {
|
|
667
667
|
const g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
668
|
-
for (const
|
|
669
|
-
|
|
670
|
-
for (const
|
|
671
|
-
const S =
|
|
672
|
-
S != null && p.set(S,
|
|
668
|
+
for (const E of x)
|
|
669
|
+
E && E.key != null && g.set(E.key, E);
|
|
670
|
+
for (const E of b) {
|
|
671
|
+
const S = E.key;
|
|
672
|
+
S != null && p.set(S, E);
|
|
673
673
|
}
|
|
674
674
|
const _ = /* @__PURE__ */ new Set();
|
|
675
|
-
let
|
|
676
|
-
for (const
|
|
675
|
+
let C = h.nextSibling;
|
|
676
|
+
for (const E of w) {
|
|
677
677
|
let S;
|
|
678
|
-
if (
|
|
679
|
-
const A = g.get(
|
|
678
|
+
if (E.key != null && p.has(E.key)) {
|
|
679
|
+
const A = g.get(E.key);
|
|
680
680
|
S = ae(
|
|
681
|
-
p.get(
|
|
681
|
+
p.get(E.key),
|
|
682
682
|
A,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
), _.add(S), S !==
|
|
683
|
+
E,
|
|
684
|
+
i
|
|
685
|
+
), _.add(S), S !== C && e.contains(S) && e.insertBefore(S, C);
|
|
686
686
|
} else
|
|
687
|
-
S = M(
|
|
688
|
-
|
|
687
|
+
S = M(E, i), e.insertBefore(S, C), _.add(S);
|
|
688
|
+
C = S.nextSibling;
|
|
689
689
|
}
|
|
690
|
-
for (const
|
|
691
|
-
!_.has(
|
|
690
|
+
for (const E of b)
|
|
691
|
+
!_.has(E) && e.contains(E) && e.removeChild(E);
|
|
692
692
|
} else {
|
|
693
693
|
const g = Math.min(
|
|
694
694
|
x.length,
|
|
695
|
-
|
|
695
|
+
w.length
|
|
696
696
|
);
|
|
697
697
|
for (let p = 0; p < g; p++) {
|
|
698
|
-
const _ = x[p],
|
|
699
|
-
|
|
698
|
+
const _ = x[p], C = w[p], E = ae(b[p], _, C, i);
|
|
699
|
+
E !== b[p] && (e.insertBefore(E, b[p]), e.removeChild(b[p]));
|
|
700
700
|
}
|
|
701
|
-
for (let p = g; p <
|
|
702
|
-
e.insertBefore(M(
|
|
701
|
+
for (let p = g; p < w.length; p++)
|
|
702
|
+
e.insertBefore(M(w[p], i), k);
|
|
703
703
|
for (let p = g; p < b.length; p++)
|
|
704
704
|
e.removeChild(b[p]);
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
for (const h of r) {
|
|
708
|
-
let
|
|
708
|
+
let k;
|
|
709
709
|
if (h.tag === "#anchor") {
|
|
710
|
-
const $ = h.key,
|
|
711
|
-
let
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
e.insertBefore(
|
|
715
|
-
for (const g of
|
|
716
|
-
e.insertBefore(M(g,
|
|
710
|
+
const $ = h.key, w = `${$}:start`, b = `${$}:end`;
|
|
711
|
+
let m = f.get(w), x = f.get(b);
|
|
712
|
+
const l = Array.isArray(h.children) ? h.children : [];
|
|
713
|
+
if (m || (m = document.createTextNode(""), m.key = w), x || (x = document.createTextNode(""), x.key = b), h._startNode = m, h._endNode = x, !e.contains(m) || !e.contains(x)) {
|
|
714
|
+
e.insertBefore(m, d);
|
|
715
|
+
for (const g of l)
|
|
716
|
+
e.insertBefore(M(g, i), d);
|
|
717
717
|
e.insertBefore(x, d);
|
|
718
718
|
} else
|
|
719
|
-
|
|
720
|
-
|
|
719
|
+
c(
|
|
720
|
+
m,
|
|
721
721
|
x,
|
|
722
722
|
a.get($)?.children,
|
|
723
|
-
|
|
723
|
+
l
|
|
724
724
|
);
|
|
725
|
-
m
|
|
725
|
+
y(m, x), d = x.nextSibling;
|
|
726
726
|
continue;
|
|
727
727
|
}
|
|
728
728
|
if (h.key != null && f.has(h.key)) {
|
|
729
729
|
const $ = a.get(h.key);
|
|
730
|
-
|
|
730
|
+
k = ae(
|
|
731
731
|
f.get(h.key),
|
|
732
732
|
$,
|
|
733
733
|
h,
|
|
734
|
-
|
|
734
|
+
i,
|
|
735
735
|
n
|
|
736
|
-
), u.add(
|
|
736
|
+
), u.add(k), k !== d && e.contains(k) && (d && !e.contains(d) && (d = null), e.insertBefore(k, d));
|
|
737
737
|
} else
|
|
738
|
-
|
|
739
|
-
d =
|
|
738
|
+
k = M(h, i, n), d && !e.contains(d) && (d = null), e.insertBefore(k, d), u.add(k);
|
|
739
|
+
d = k.nextSibling;
|
|
740
740
|
}
|
|
741
|
-
for (const h of
|
|
741
|
+
for (const h of s)
|
|
742
742
|
!u.has(h) && e.contains(h) && (V(h, n), e.removeChild(h));
|
|
743
743
|
}
|
|
744
|
-
function ae(e, t, r,
|
|
744
|
+
function ae(e, t, r, i, n) {
|
|
745
745
|
if (t && typeof t != "string" && t.props?.ref && n && V(e, n), t === r) return e;
|
|
746
746
|
if (typeof r == "string") {
|
|
747
747
|
if (e.nodeType === Node.TEXT_NODE)
|
|
748
748
|
return e.textContent !== r && (e.textContent = r), e;
|
|
749
749
|
{
|
|
750
|
-
const
|
|
751
|
-
return e.parentNode?.replaceChild(
|
|
750
|
+
const o = document.createTextNode(r);
|
|
751
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
755
|
-
const
|
|
756
|
-
|
|
755
|
+
const o = r, a = Array.isArray(o.children) ? o.children : [], f = o._startNode ?? document.createTextNode(""), u = o._endNode ?? document.createTextNode("");
|
|
756
|
+
o.key != null && (f.key = `${o.key}:start`, u.key = `${o.key}:end`), o._startNode = f, o._endNode = u;
|
|
757
757
|
const d = document.createDocumentFragment();
|
|
758
758
|
d.appendChild(f);
|
|
759
|
-
for (const
|
|
760
|
-
const
|
|
761
|
-
d.appendChild(
|
|
759
|
+
for (const y of a) {
|
|
760
|
+
const c = M(y, i);
|
|
761
|
+
d.appendChild(c);
|
|
762
762
|
}
|
|
763
763
|
return d.appendChild(u), e.parentNode?.replaceChild(d, e), f;
|
|
764
764
|
}
|
|
765
765
|
if (!r) {
|
|
766
766
|
V(e, n);
|
|
767
|
-
const
|
|
768
|
-
return e.parentNode?.replaceChild(
|
|
767
|
+
const o = document.createComment("removed");
|
|
768
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
769
769
|
}
|
|
770
770
|
if (!t || typeof t == "string") {
|
|
771
771
|
V(e, n);
|
|
772
|
-
const
|
|
773
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
772
|
+
const o = M(r, i, n);
|
|
773
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), e.parentNode?.replaceChild(o, e), o;
|
|
774
774
|
}
|
|
775
775
|
if (r.tag === "#anchor") {
|
|
776
|
-
const
|
|
776
|
+
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), f = r._endNode ?? document.createTextNode("");
|
|
777
777
|
r.key != null && (a.key = `${r.key}:start`, f.key = `${r.key}:end`), r._startNode = a, r._endNode = f;
|
|
778
778
|
const u = document.createDocumentFragment();
|
|
779
779
|
u.appendChild(a);
|
|
780
|
-
for (const d of
|
|
781
|
-
u.appendChild(M(d,
|
|
780
|
+
for (const d of o)
|
|
781
|
+
u.appendChild(M(d, i));
|
|
782
782
|
return u.appendChild(f), e.parentNode?.replaceChild(u, e), a;
|
|
783
783
|
}
|
|
784
784
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
785
|
-
const
|
|
786
|
-
return Je(
|
|
785
|
+
const o = e;
|
|
786
|
+
return Je(o, t.props || {}, r.props || {}, i), Ze(o, t.children, r.children, i, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), o;
|
|
787
787
|
}
|
|
788
788
|
V(e, n);
|
|
789
|
-
const
|
|
790
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
789
|
+
const s = M(r, i, n);
|
|
790
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
791
791
|
}
|
|
792
|
-
function Ye(e, t, r,
|
|
792
|
+
function Ye(e, t, r, i) {
|
|
793
793
|
let n;
|
|
794
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 = {
|
|
795
795
|
tag: "div",
|
|
796
796
|
key: "__anchor_root__",
|
|
797
797
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
798
798
|
children: [n]
|
|
799
|
-
}), n =
|
|
800
|
-
const
|
|
799
|
+
}), n = ve(n, String(n.key ?? "root"));
|
|
800
|
+
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
801
801
|
let a;
|
|
802
|
-
|
|
802
|
+
s && o ? typeof s != "string" && typeof n != "string" && s.tag === n.tag && s.key === n.key ? a = ae(o, s, n, r, i) : (a = M(n, r, i), e.replaceChild(a, o)) : (a = M(n, r, i), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
803
803
|
const f = [];
|
|
804
804
|
for (let u = 0; u < e.childNodes.length; u++) {
|
|
805
805
|
const d = e.childNodes[u];
|
|
806
|
-
d !== a && d.nodeName !== "STYLE" && (V(d,
|
|
806
|
+
d !== a && d.nodeName !== "STYLE" && (V(d, i), f.push(d));
|
|
807
807
|
}
|
|
808
808
|
f.forEach((u) => e.removeChild(u)), e._prevVNode = n, e._prevDom = a;
|
|
809
809
|
}
|
|
@@ -814,29 +814,29 @@ function he(e) {
|
|
|
814
814
|
if (e.tag === "#anchor")
|
|
815
815
|
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(he).join("");
|
|
816
816
|
let t = "";
|
|
817
|
-
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n,
|
|
817
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, s]) => ` ${n}="${H(String(s))}"`).join(""));
|
|
818
818
|
let r = "";
|
|
819
|
-
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n,
|
|
820
|
-
const
|
|
821
|
-
return `<${e.tag}${t}${r}>${
|
|
819
|
+
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, s]) => ` ${n}="${H(String(s))}"`).join(""));
|
|
820
|
+
const i = 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}>${i}</${e.tag}>`;
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function Oe(e, ...t) {
|
|
824
824
|
let r = "";
|
|
825
|
-
for (let
|
|
826
|
-
r += e[
|
|
825
|
+
for (let i = 0; i < e.length; i++)
|
|
826
|
+
r += e[i], i < t.length && (r += t[i]);
|
|
827
827
|
return r;
|
|
828
828
|
}
|
|
829
829
|
function Be(e) {
|
|
830
830
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
831
831
|
}
|
|
832
|
-
let
|
|
832
|
+
let ie = null;
|
|
833
833
|
function _e() {
|
|
834
|
-
return
|
|
834
|
+
return ie || (ie = new CSSStyleSheet(), ie.replaceSync(Be(Qe))), ie;
|
|
835
835
|
}
|
|
836
836
|
function Ge(e) {
|
|
837
837
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
838
838
|
}
|
|
839
|
-
const Qe =
|
|
839
|
+
const Qe = Oe`
|
|
840
840
|
:host, *, ::before, ::after {
|
|
841
841
|
all: isolate;
|
|
842
842
|
box-sizing: border-box;
|
|
@@ -879,8 +879,8 @@ const Qe = ze`
|
|
|
879
879
|
::-webkit-input-placeholder, ::placeholder {
|
|
880
880
|
color: inherit; opacity: .5;
|
|
881
881
|
}
|
|
882
|
-
*:focus {
|
|
883
|
-
outline: 2px solid var(--color-
|
|
882
|
+
*:focus-visible {
|
|
883
|
+
outline: 2px solid var(--color-primary-500, #3b82f6);
|
|
884
884
|
outline-offset: 2px;
|
|
885
885
|
}
|
|
886
886
|
ol, ul { list-style: none }
|
|
@@ -895,143 +895,112 @@ const Qe = ze`
|
|
|
895
895
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
896
896
|
[hidden] { display: none }
|
|
897
897
|
`, Xe = {
|
|
898
|
-
gray: {
|
|
899
|
-
50: "var(--color-gray-50, #f9fafb)",
|
|
900
|
-
100: "var(--color-gray-100, #f3f4f6)",
|
|
901
|
-
200: "var(--color-gray-200, #e5e7eb)",
|
|
902
|
-
300: "var(--color-gray-300, #d1d5db)",
|
|
903
|
-
400: "var(--color-gray-400, #9ca3af)",
|
|
904
|
-
500: "var(--color-gray-500, #6b7280)",
|
|
905
|
-
600: "var(--color-gray-600, #4b5563)",
|
|
906
|
-
700: "var(--color-gray-700, #374151)",
|
|
907
|
-
800: "var(--color-gray-800, #1f2937)",
|
|
908
|
-
900: "var(--color-gray-900, #111827)"
|
|
909
|
-
},
|
|
910
898
|
neutral: {
|
|
911
|
-
50: "
|
|
912
|
-
100: "
|
|
913
|
-
200: "
|
|
914
|
-
300: "
|
|
915
|
-
400: "
|
|
916
|
-
500: "
|
|
917
|
-
600: "
|
|
918
|
-
700: "
|
|
919
|
-
800: "
|
|
920
|
-
900: "
|
|
921
|
-
|
|
922
|
-
slate: {
|
|
923
|
-
50: "var(--color-slate-50, #f8fafc)",
|
|
924
|
-
100: "var(--color-slate-100, #f1f5f9)",
|
|
925
|
-
200: "var(--color-slate-200, #e2e8f0)",
|
|
926
|
-
300: "var(--color-slate-300, #cbd5e1)",
|
|
927
|
-
400: "var(--color-slate-400, #94a3b8)",
|
|
928
|
-
500: "var(--color-slate-500, #64748b)",
|
|
929
|
-
600: "var(--color-slate-600, #475569)",
|
|
930
|
-
700: "var(--color-slate-700, #334155)",
|
|
931
|
-
800: "var(--color-slate-800, #1e293b)",
|
|
932
|
-
900: "var(--color-slate-900, #0f172a)"
|
|
899
|
+
50: "#fafafa",
|
|
900
|
+
100: "#f4f4f5",
|
|
901
|
+
200: "#e4e4e7",
|
|
902
|
+
300: "#d4d4d8",
|
|
903
|
+
400: "#9f9fa9",
|
|
904
|
+
500: "#71717b",
|
|
905
|
+
600: "#52525c",
|
|
906
|
+
700: "#3f3f46",
|
|
907
|
+
800: "#27272a",
|
|
908
|
+
900: "#18181b",
|
|
909
|
+
950: "#09090b"
|
|
933
910
|
},
|
|
934
|
-
|
|
935
|
-
50: "
|
|
936
|
-
100: "
|
|
937
|
-
200: "
|
|
938
|
-
300: "
|
|
939
|
-
400: "
|
|
940
|
-
500: "
|
|
941
|
-
600: "
|
|
942
|
-
700: "
|
|
943
|
-
800: "
|
|
944
|
-
900: "
|
|
911
|
+
primary: {
|
|
912
|
+
50: "#eff6ff",
|
|
913
|
+
100: "#dbeafe",
|
|
914
|
+
200: "#bfdbfe",
|
|
915
|
+
300: "#93c5fd",
|
|
916
|
+
400: "#60a5fa",
|
|
917
|
+
500: "#3b82f6",
|
|
918
|
+
600: "#2563eb",
|
|
919
|
+
700: "#1d4ed8",
|
|
920
|
+
800: "#1e40af",
|
|
921
|
+
900: "#1e3a8a",
|
|
922
|
+
950: "#172554"
|
|
945
923
|
},
|
|
946
|
-
|
|
947
|
-
50: "
|
|
948
|
-
100: "
|
|
949
|
-
200: "
|
|
950
|
-
300: "
|
|
951
|
-
400: "
|
|
952
|
-
500: "
|
|
953
|
-
600: "
|
|
954
|
-
700: "
|
|
955
|
-
800: "
|
|
956
|
-
900: "
|
|
924
|
+
secondary: {
|
|
925
|
+
50: "#eef2ff",
|
|
926
|
+
100: "#e0e7ff",
|
|
927
|
+
200: "#c7d2fe",
|
|
928
|
+
300: "#a5b4fc",
|
|
929
|
+
400: "#818cf8",
|
|
930
|
+
500: "#6366f1",
|
|
931
|
+
600: "#4f46e5",
|
|
932
|
+
700: "#4338ca",
|
|
933
|
+
800: "#3730a3",
|
|
934
|
+
900: "#312e81",
|
|
935
|
+
950: "#1e1b4b"
|
|
957
936
|
},
|
|
958
|
-
|
|
959
|
-
50: "
|
|
960
|
-
100: "
|
|
961
|
-
200: "
|
|
962
|
-
300: "
|
|
963
|
-
400: "
|
|
964
|
-
500: "
|
|
965
|
-
600: "
|
|
966
|
-
700: "
|
|
967
|
-
800: "
|
|
968
|
-
900: "
|
|
937
|
+
success: {
|
|
938
|
+
50: "#f0fdf4",
|
|
939
|
+
100: "#dcfce7",
|
|
940
|
+
200: "#bbf7d0",
|
|
941
|
+
300: "#86efac",
|
|
942
|
+
400: "#4ade80",
|
|
943
|
+
500: "#22c55e",
|
|
944
|
+
600: "#16a34a",
|
|
945
|
+
700: "#15803d",
|
|
946
|
+
800: "#166534",
|
|
947
|
+
900: "#14532d",
|
|
948
|
+
950: "#052e16"
|
|
969
949
|
},
|
|
970
|
-
|
|
971
|
-
50: "
|
|
972
|
-
100: "
|
|
973
|
-
200: "
|
|
974
|
-
300: "
|
|
975
|
-
400: "
|
|
976
|
-
500: "
|
|
977
|
-
600: "
|
|
978
|
-
700: "
|
|
979
|
-
800: "
|
|
980
|
-
900: "
|
|
950
|
+
info: {
|
|
951
|
+
50: "#f0f9ff",
|
|
952
|
+
100: "#e0f2fe",
|
|
953
|
+
200: "#bae6fd",
|
|
954
|
+
300: "#7dd3fc",
|
|
955
|
+
400: "#38bdf8",
|
|
956
|
+
500: "#0ea5e9",
|
|
957
|
+
600: "#0284c7",
|
|
958
|
+
700: "#0369a1",
|
|
959
|
+
800: "#075985",
|
|
960
|
+
900: "#0c4a6e",
|
|
961
|
+
950: "#082f49"
|
|
981
962
|
},
|
|
982
|
-
|
|
983
|
-
50: "
|
|
984
|
-
100: "
|
|
985
|
-
200: "
|
|
986
|
-
300: "
|
|
987
|
-
400: "
|
|
988
|
-
500: "
|
|
989
|
-
600: "
|
|
990
|
-
700: "
|
|
991
|
-
800: "
|
|
992
|
-
900: "
|
|
963
|
+
warning: {
|
|
964
|
+
50: "#fffbeb",
|
|
965
|
+
100: "#fef3c7",
|
|
966
|
+
200: "#fde68a",
|
|
967
|
+
300: "#fcd34d",
|
|
968
|
+
400: "#fbbf24",
|
|
969
|
+
500: "#f59e0b",
|
|
970
|
+
600: "#d97706",
|
|
971
|
+
700: "#b45309",
|
|
972
|
+
800: "#92400e",
|
|
973
|
+
900: "#78350f",
|
|
974
|
+
950: "#451a03"
|
|
993
975
|
},
|
|
994
|
-
|
|
995
|
-
50: "
|
|
996
|
-
100: "
|
|
997
|
-
200: "
|
|
998
|
-
300: "
|
|
999
|
-
400: "
|
|
1000
|
-
500: "
|
|
1001
|
-
600: "
|
|
1002
|
-
700: "
|
|
1003
|
-
800: "
|
|
1004
|
-
900: "
|
|
976
|
+
error: {
|
|
977
|
+
50: "#fef2f2",
|
|
978
|
+
100: "#fee2e2",
|
|
979
|
+
200: "#fecaca",
|
|
980
|
+
300: "#fca5a5",
|
|
981
|
+
400: "#f87171",
|
|
982
|
+
500: "#ef4444",
|
|
983
|
+
600: "#dc2626",
|
|
984
|
+
700: "#b91c1c",
|
|
985
|
+
800: "#991b1b",
|
|
986
|
+
900: "#7f1d1d",
|
|
987
|
+
950: "#450a0a"
|
|
1005
988
|
},
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
200: "var(--color-rose-200, #fecdd3)",
|
|
1022
|
-
300: "var(--color-rose-300, #fda4af)",
|
|
1023
|
-
400: "var(--color-rose-400, #fb7185)",
|
|
1024
|
-
500: "var(--color-rose-500, #f43f5e)",
|
|
1025
|
-
600: "var(--color-rose-600, #e11d48)",
|
|
1026
|
-
700: "var(--color-rose-700, #be123c)",
|
|
1027
|
-
800: "var(--color-rose-800, #9f1239)",
|
|
1028
|
-
900: "var(--color-rose-900, #881337)"
|
|
1029
|
-
},
|
|
1030
|
-
white: { DEFAULT: "var(--color-white, #ffffff)" },
|
|
1031
|
-
black: { DEFAULT: "var(--color-black, #000000)" },
|
|
1032
|
-
transparent: { DEFAULT: "var(--color-transparent, transparent)" },
|
|
1033
|
-
current: { DEFAULT: "var(--color-current, currentColor)" }
|
|
1034
|
-
}, ge = {
|
|
989
|
+
white: { DEFAULT: "#ffffff" },
|
|
990
|
+
black: { DEFAULT: "#000000" },
|
|
991
|
+
transparent: { DEFAULT: "transparent" },
|
|
992
|
+
current: { DEFAULT: "currentColor" }
|
|
993
|
+
}, et = Object.fromEntries(
|
|
994
|
+
Object.entries(Xe).map(([e, t]) => [
|
|
995
|
+
e,
|
|
996
|
+
Object.fromEntries(
|
|
997
|
+
Object.entries(t).map(([r, i]) => [
|
|
998
|
+
r,
|
|
999
|
+
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${i})`
|
|
1000
|
+
])
|
|
1001
|
+
)
|
|
1002
|
+
])
|
|
1003
|
+
), ge = {
|
|
1035
1004
|
/* Display */
|
|
1036
1005
|
block: "display:block;",
|
|
1037
1006
|
inline: "display:inline;",
|
|
@@ -1070,12 +1039,23 @@ const Qe = ze`
|
|
|
1070
1039
|
"grid-cols-4": "grid-template-columns:repeat(4,minmax(0,1fr));",
|
|
1071
1040
|
"grid-cols-5": "grid-template-columns:repeat(5,minmax(0,1fr));",
|
|
1072
1041
|
"grid-cols-6": "grid-template-columns:repeat(6,minmax(0,1fr));",
|
|
1042
|
+
"grid-cols-7": "grid-template-columns:repeat(7,minmax(0,1fr));",
|
|
1043
|
+
"grid-cols-8": "grid-template-columns:repeat(8,minmax(0,1fr));",
|
|
1044
|
+
"grid-cols-9": "grid-template-columns:repeat(9,minmax(0,1fr));",
|
|
1045
|
+
"grid-cols-10": "grid-template-columns:repeat(10,minmax(0,1fr));",
|
|
1046
|
+
"grid-cols-11": "grid-template-columns:repeat(11,minmax(0,1fr));",
|
|
1073
1047
|
"grid-cols-12": "grid-template-columns:repeat(12,minmax(0,1fr));",
|
|
1074
1048
|
"grid-rows-1": "grid-template-rows:repeat(1,minmax(0,1fr));",
|
|
1075
1049
|
"grid-rows-2": "grid-template-rows:repeat(2,minmax(0,1fr));",
|
|
1076
1050
|
"grid-rows-3": "grid-template-rows:repeat(3,minmax(0,1fr));",
|
|
1077
1051
|
"grid-rows-4": "grid-template-rows:repeat(4,minmax(0,1fr));",
|
|
1052
|
+
"grid-rows-5": "grid-template-rows:repeat(5,minmax(0,1fr));",
|
|
1078
1053
|
"grid-rows-6": "grid-template-rows:repeat(6,minmax(0,1fr));",
|
|
1054
|
+
"grid-rows-7": "grid-template-rows:repeat(7,minmax(0,1fr));",
|
|
1055
|
+
"grid-rows-8": "grid-template-rows:repeat(8,minmax(0,1fr));",
|
|
1056
|
+
"grid-rows-9": "grid-template-rows:repeat(9,minmax(0,1fr));",
|
|
1057
|
+
"grid-rows-10": "grid-template-rows:repeat(10,minmax(0,1fr));",
|
|
1058
|
+
"grid-rows-11": "grid-template-rows:repeat(11,minmax(0,1fr));",
|
|
1079
1059
|
"grid-rows-12": "grid-template-rows:repeat(12,minmax(0,1fr));",
|
|
1080
1060
|
/* Grid Placement */
|
|
1081
1061
|
"col-span-1": "grid-column:span 1 / span 1;",
|
|
@@ -1084,12 +1064,22 @@ const Qe = ze`
|
|
|
1084
1064
|
"col-span-4": "grid-column:span 4 / span 4;",
|
|
1085
1065
|
"col-span-5": "grid-column:span 5 / span 5;",
|
|
1086
1066
|
"col-span-6": "grid-column:span 6 / span 6;",
|
|
1067
|
+
"col-span-7": "grid-column:span 7 / span 7;",
|
|
1068
|
+
"col-span-8": "grid-column:span 8 / span 8;",
|
|
1069
|
+
"col-span-9": "grid-column:span 9 / span 9;",
|
|
1070
|
+
"col-span-10": "grid-column:span 10 / span 10;",
|
|
1071
|
+
"col-span-11": "grid-column:span 11 / span 11;",
|
|
1087
1072
|
"col-span-12": "grid-column:span 12 / span 12;",
|
|
1088
1073
|
"row-span-1": "grid-row:span 1 / span 1;",
|
|
1089
1074
|
"row-span-2": "grid-row:span 2 / span 2;",
|
|
1090
1075
|
"row-span-3": "grid-row:span 3 / span 3;",
|
|
1091
1076
|
"row-span-4": "grid-row:span 4 / span 4;",
|
|
1092
1077
|
"row-span-6": "grid-row:span 6 / span 6;",
|
|
1078
|
+
"row-span-7": "grid-row:span 7 / span 7;",
|
|
1079
|
+
"row-span-8": "grid-row:span 8 / span 8;",
|
|
1080
|
+
"row-span-9": "grid-row:span 9 / span 9;",
|
|
1081
|
+
"row-span-10": "grid-row:span 10 / span 10;",
|
|
1082
|
+
"row-span-11": "grid-row:span 11 / span 11;",
|
|
1093
1083
|
"row-span-12": "grid-row:span 12 / span 12;",
|
|
1094
1084
|
/* Positioning */
|
|
1095
1085
|
absolute: "position:absolute;",
|
|
@@ -1128,21 +1118,29 @@ const Qe = ze`
|
|
|
1128
1118
|
"text-8xl": "font-size:6rem;line-height:1",
|
|
1129
1119
|
/* Borders */
|
|
1130
1120
|
border: "border-width:1px;",
|
|
1121
|
+
"border-2": "border-width:2px;",
|
|
1122
|
+
"border-4": "border-width:4px;",
|
|
1123
|
+
"border-6": "border-width:6px;",
|
|
1124
|
+
"border-8": "border-width:8px;",
|
|
1131
1125
|
"rounded-none": "border-radius:0;",
|
|
1132
1126
|
"rounded-xs": "border-radius:0.125rem;",
|
|
1133
|
-
rounded: "border-radius:0.25rem;",
|
|
1134
1127
|
"rounded-sm": "border-radius:0.25rem;",
|
|
1135
1128
|
"rounded-md": "border-radius:0.375rem;",
|
|
1136
1129
|
"rounded-lg": "border-radius:0.5rem;",
|
|
1130
|
+
"rounded-xl": "border-radius:0.75rem;",
|
|
1131
|
+
"rounded-2xl": "border-radius:1rem;",
|
|
1132
|
+
"rounded-3xl": "border-radius:1.5rem;",
|
|
1133
|
+
"rounded-4xl": "border-radius:2rem;",
|
|
1137
1134
|
"rounded-full": "border-radius:9999px;",
|
|
1138
1135
|
/* Shadow and effects */
|
|
1139
|
-
|
|
1140
|
-
"shadow-
|
|
1141
|
-
"shadow-
|
|
1142
|
-
"shadow-
|
|
1143
|
-
"shadow-
|
|
1144
|
-
"shadow-
|
|
1145
|
-
"shadow-
|
|
1136
|
+
// Shadows use a CSS variable for color so color utilities can modify --ce-shadow-color
|
|
1137
|
+
"shadow-none": "--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);",
|
|
1138
|
+
"shadow-xs": "--ce-shadow-color: rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));",
|
|
1139
|
+
"shadow-sm": "--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));",
|
|
1140
|
+
"shadow-md": "--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));",
|
|
1141
|
+
"shadow-lg": "--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));",
|
|
1142
|
+
"shadow-xl": "--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));",
|
|
1143
|
+
"shadow-2xl": "--ce-shadow-color: rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, rgb(0 0 0 / 0.25));",
|
|
1146
1144
|
/* Text Overflow & Whitespace */
|
|
1147
1145
|
truncate: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",
|
|
1148
1146
|
/* Visibility */
|
|
@@ -1201,6 +1199,15 @@ const Qe = ze`
|
|
|
1201
1199
|
"transition-opacity": "transition-property:opacity;",
|
|
1202
1200
|
"transition-transform": "transition-property:transform;",
|
|
1203
1201
|
"transition-none": "transition-property:none;",
|
|
1202
|
+
/* Cursor */
|
|
1203
|
+
"cursor-auto": "cursor:auto;",
|
|
1204
|
+
"cursor-default": "cursor:default;",
|
|
1205
|
+
"cursor-pointer": "cursor:pointer;",
|
|
1206
|
+
"cursor-wait": "cursor:wait;",
|
|
1207
|
+
"cursor-text": "cursor:text;",
|
|
1208
|
+
"cursor-move": "cursor:move;",
|
|
1209
|
+
"cursor-help": "cursor:help;",
|
|
1210
|
+
"cursor-not-allowed": "cursor:not-allowed;",
|
|
1204
1211
|
/* Z-index */
|
|
1205
1212
|
"z-0": "z-index:0;",
|
|
1206
1213
|
"z-10": "z-index:10;",
|
|
@@ -1208,7 +1215,7 @@ const Qe = ze`
|
|
|
1208
1215
|
"z-30": "z-index:30;",
|
|
1209
1216
|
"z-40": "z-index:40;",
|
|
1210
1217
|
"z-50": "z-index:50;"
|
|
1211
|
-
},
|
|
1218
|
+
}, tt = "0.25rem", Se = {
|
|
1212
1219
|
m: ["margin"],
|
|
1213
1220
|
mx: ["margin-inline"],
|
|
1214
1221
|
my: ["margin-block"],
|
|
@@ -1240,34 +1247,34 @@ const Qe = ze`
|
|
|
1240
1247
|
"gap-x": ["column-gap"],
|
|
1241
1248
|
"gap-y": ["row-gap"]
|
|
1242
1249
|
};
|
|
1243
|
-
function
|
|
1244
|
-
let r = 0,
|
|
1250
|
+
function N(e, t) {
|
|
1251
|
+
let r = 0, i = 0;
|
|
1245
1252
|
for (let n = 0; n < e.length; n++) {
|
|
1246
|
-
const
|
|
1247
|
-
if (
|
|
1248
|
-
else if (
|
|
1249
|
-
else if (
|
|
1250
|
-
else if (
|
|
1251
|
-
else if (r === 0 &&
|
|
1253
|
+
const s = e[n];
|
|
1254
|
+
if (s === "[") r++;
|
|
1255
|
+
else if (s === "]" && r > 0) r--;
|
|
1256
|
+
else if (s === "(") i++;
|
|
1257
|
+
else if (s === ")" && i > 0) i--;
|
|
1258
|
+
else if (r === 0 && i === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
1252
1259
|
return e.slice(0, n) + t + e.slice(n);
|
|
1253
1260
|
}
|
|
1254
1261
|
return e + t;
|
|
1255
1262
|
}
|
|
1256
|
-
const
|
|
1263
|
+
const rt = {
|
|
1257
1264
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1258
1265
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1259
|
-
hover: (e, t) => `${
|
|
1260
|
-
focus: (e, t) => `${
|
|
1261
|
-
active: (e, t) => `${
|
|
1262
|
-
disabled: (e, t) => `${
|
|
1263
|
-
visited: (e, t) => `${
|
|
1264
|
-
checked: (e, t) => `${
|
|
1265
|
-
first: (e, t) => `${
|
|
1266
|
-
last: (e, t) => `${
|
|
1267
|
-
odd: (e, t) => `${
|
|
1268
|
-
even: (e, t) => `${
|
|
1269
|
-
"focus-within": (e, t) => `${
|
|
1270
|
-
"focus-visible": (e, t) => `${
|
|
1266
|
+
hover: (e, t) => `${N(e, ":hover")}{${t}}`,
|
|
1267
|
+
focus: (e, t) => `${N(e, ":focus")}{${t}}`,
|
|
1268
|
+
active: (e, t) => `${N(e, ":active")}{${t}}`,
|
|
1269
|
+
disabled: (e, t) => `${N(e, ":disabled")}{${t}}`,
|
|
1270
|
+
visited: (e, t) => `${N(e, ":visited")}{${t}}`,
|
|
1271
|
+
checked: (e, t) => `${N(e, ":checked")}{${t}}`,
|
|
1272
|
+
first: (e, t) => `${N(e, ":first-child")}{${t}}`,
|
|
1273
|
+
last: (e, t) => `${N(e, ":last-child")}{${t}}`,
|
|
1274
|
+
odd: (e, t) => `${N(e, ":nth-child(odd)")}{${t}}`,
|
|
1275
|
+
even: (e, t) => `${N(e, ":nth-child(even)")}{${t}}`,
|
|
1276
|
+
"focus-within": (e, t) => `${N(e, ":focus-within")}{${t}}`,
|
|
1277
|
+
"focus-visible": (e, t) => `${N(e, ":focus-visible")}{${t}}`,
|
|
1271
1278
|
"group-hover": (e, t) => `.group:hover ${e}{${t}}`,
|
|
1272
1279
|
"group-focus": (e, t) => `.group:focus ${e}{${t}}`,
|
|
1273
1280
|
"group-active": (e, t) => `.group:active ${e}{${t}}`,
|
|
@@ -1276,7 +1283,7 @@ const tt = {
|
|
|
1276
1283
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1277
1284
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1278
1285
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1279
|
-
},
|
|
1286
|
+
}, me = {
|
|
1280
1287
|
// Responsive
|
|
1281
1288
|
sm: "(min-width:640px)",
|
|
1282
1289
|
md: "(min-width:768px)",
|
|
@@ -1285,61 +1292,62 @@ const tt = {
|
|
|
1285
1292
|
"2xl": "(min-width:1536px)",
|
|
1286
1293
|
// Dark mode (now plain string)
|
|
1287
1294
|
dark: "(prefers-color-scheme: dark)"
|
|
1288
|
-
},
|
|
1295
|
+
}, ye = ["sm", "md", "lg", "xl", "2xl"];
|
|
1289
1296
|
function be(e) {
|
|
1290
|
-
const t = e.startsWith("-"),
|
|
1291
|
-
if (
|
|
1292
|
-
const n =
|
|
1293
|
-
if (Number.isNaN(
|
|
1297
|
+
const t = e.startsWith("-"), i = (t ? e.slice(1) : e).split("-");
|
|
1298
|
+
if (i.length < 2) return null;
|
|
1299
|
+
const n = i.slice(0, -1).join("-"), s = i[i.length - 1], o = parseFloat(s);
|
|
1300
|
+
if (Number.isNaN(o) || !Se[n]) return null;
|
|
1294
1301
|
const a = t ? "-" : "";
|
|
1295
|
-
return Se[n].map((f) => `${f}:calc(${a}${
|
|
1302
|
+
return Se[n].map((f) => `${f}:calc(${a}${tt} * ${o});`).join("");
|
|
1296
1303
|
}
|
|
1297
|
-
function
|
|
1298
|
-
const t = e.replace("#", ""), r = parseInt(t, 16),
|
|
1299
|
-
return `${
|
|
1304
|
+
function Ee(e) {
|
|
1305
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255, s = r & 255;
|
|
1306
|
+
return `${i} ${n} ${s}`;
|
|
1300
1307
|
}
|
|
1301
|
-
function
|
|
1308
|
+
function nt(e) {
|
|
1302
1309
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1303
1310
|
if (!t) return null;
|
|
1304
|
-
const [, r,
|
|
1305
|
-
|
|
1311
|
+
const [, r, i, n = "DEFAULT"] = t, s = et[i]?.[n];
|
|
1312
|
+
if (!s) return null;
|
|
1313
|
+
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
1314
|
+
const a = {
|
|
1306
1315
|
bg: "background-color",
|
|
1307
1316
|
decoration: "text-decoration-color",
|
|
1308
1317
|
text: "color",
|
|
1309
1318
|
border: "border-color",
|
|
1310
|
-
shadow: "box-shadow",
|
|
1311
1319
|
outline: "outline-color",
|
|
1312
1320
|
caret: "caret-color",
|
|
1313
1321
|
accent: "accent-color",
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
}
|
|
1322
|
+
fill: "fill",
|
|
1323
|
+
stroke: "stroke"
|
|
1324
|
+
}[r];
|
|
1325
|
+
return a ? `${a}:${s};` : null;
|
|
1318
1326
|
}
|
|
1319
|
-
function
|
|
1327
|
+
function it(e) {
|
|
1320
1328
|
const [t, r] = e.split("/");
|
|
1321
1329
|
if (!r) return { base: t };
|
|
1322
|
-
const
|
|
1323
|
-
return isNaN(
|
|
1330
|
+
const i = parseInt(r, 10);
|
|
1331
|
+
return isNaN(i) || i < 0 || i > 100 ? { base: t } : { base: t, opacity: i / 100 };
|
|
1324
1332
|
}
|
|
1325
|
-
function
|
|
1326
|
-
const { base: t, opacity: r } =
|
|
1327
|
-
if (
|
|
1333
|
+
function we(e) {
|
|
1334
|
+
const { base: t, opacity: r } = it(e), i = nt(t);
|
|
1335
|
+
if (i) {
|
|
1328
1336
|
if (r !== void 0) {
|
|
1329
|
-
const
|
|
1330
|
-
if (
|
|
1331
|
-
const
|
|
1332
|
-
return
|
|
1337
|
+
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
1338
|
+
if (s) {
|
|
1339
|
+
const o = Ee(s[0]);
|
|
1340
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1333
1341
|
}
|
|
1334
1342
|
}
|
|
1335
|
-
return
|
|
1343
|
+
return i;
|
|
1336
1344
|
}
|
|
1337
|
-
const n =
|
|
1345
|
+
const n = ce(t);
|
|
1338
1346
|
if (n && r !== void 0) {
|
|
1339
|
-
const
|
|
1340
|
-
if (
|
|
1341
|
-
const
|
|
1342
|
-
return n.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1347
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1348
|
+
if (s) {
|
|
1349
|
+
const o = Ee(s[0]);
|
|
1350
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1343
1351
|
}
|
|
1344
1352
|
}
|
|
1345
1353
|
return n;
|
|
@@ -1350,22 +1358,22 @@ function xe(e) {
|
|
|
1350
1358
|
const r = parseInt(t[1], 10);
|
|
1351
1359
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1352
1360
|
}
|
|
1353
|
-
function
|
|
1361
|
+
function ce(e) {
|
|
1354
1362
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1355
1363
|
const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1356
1364
|
if (n) {
|
|
1357
|
-
const
|
|
1358
|
-
let
|
|
1359
|
-
return
|
|
1365
|
+
const s = n[1].trim();
|
|
1366
|
+
let o = n[2].trim();
|
|
1367
|
+
return o = o.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), o = o.replace(/^'([^']*)'$/g, '"$1"'), `${s}:${o};`;
|
|
1360
1368
|
}
|
|
1361
1369
|
return null;
|
|
1362
1370
|
}
|
|
1363
1371
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
1364
1372
|
if (t > 0 && r) {
|
|
1365
|
-
const
|
|
1373
|
+
const i = e.slice(0, t);
|
|
1366
1374
|
let n = e.slice(t + 2, -1);
|
|
1367
1375
|
n = n.replace(/_/g, " ");
|
|
1368
|
-
const
|
|
1376
|
+
const s = {
|
|
1369
1377
|
bg: "background-color",
|
|
1370
1378
|
text: "color",
|
|
1371
1379
|
shadow: "box-shadow",
|
|
@@ -1407,14 +1415,14 @@ function le(e) {
|
|
|
1407
1415
|
leading: "line-height",
|
|
1408
1416
|
z: "z-index"
|
|
1409
1417
|
};
|
|
1410
|
-
if (
|
|
1418
|
+
if (i === "rotate")
|
|
1411
1419
|
return `transform:rotate(${n});`;
|
|
1412
|
-
const
|
|
1413
|
-
if (
|
|
1420
|
+
const o = s[i] ?? i.replace(/_/g, "-");
|
|
1421
|
+
if (o && n) return `${o}:${n};`;
|
|
1414
1422
|
}
|
|
1415
1423
|
return null;
|
|
1416
1424
|
}
|
|
1417
|
-
function
|
|
1425
|
+
function st(e) {
|
|
1418
1426
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1419
1427
|
const r = e.slice(1, -1);
|
|
1420
1428
|
return r.includes("&") ? r : e;
|
|
@@ -1426,44 +1434,44 @@ function ot(e) {
|
|
|
1426
1434
|
}
|
|
1427
1435
|
return null;
|
|
1428
1436
|
}
|
|
1429
|
-
function
|
|
1437
|
+
function ot(e) {
|
|
1430
1438
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1431
1439
|
}
|
|
1432
|
-
function
|
|
1440
|
+
function at(e) {
|
|
1433
1441
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1434
|
-
let
|
|
1435
|
-
for (;
|
|
1436
|
-
const n =
|
|
1442
|
+
let i;
|
|
1443
|
+
for (; i = t.exec(e); ) {
|
|
1444
|
+
const n = i[2].split(/\s+/).filter(Boolean);
|
|
1437
1445
|
n.length && r.push(...n);
|
|
1438
1446
|
}
|
|
1439
1447
|
return r.filter(Boolean);
|
|
1440
1448
|
}
|
|
1441
|
-
const
|
|
1449
|
+
const Ce = /* @__PURE__ */ new Map(), ct = 16;
|
|
1442
1450
|
function lt(e) {
|
|
1443
|
-
const t = Date.now(), r =
|
|
1444
|
-
if (r && t - r.timestamp <
|
|
1445
|
-
const
|
|
1446
|
-
function d(
|
|
1447
|
-
const
|
|
1448
|
-
if (
|
|
1449
|
-
const x = w
|
|
1450
|
-
return u[
|
|
1451
|
-
}
|
|
1452
|
-
function
|
|
1453
|
-
const b =
|
|
1454
|
-
return
|
|
1455
|
-
}
|
|
1456
|
-
function
|
|
1451
|
+
const t = Date.now(), r = Ce.get(e);
|
|
1452
|
+
if (r && t - r.timestamp < ct) return r.css;
|
|
1453
|
+
const i = at(e), n = new Set(i), s = [], o = [], a = [], f = [], u = {};
|
|
1454
|
+
function d(w, b = !1) {
|
|
1455
|
+
const m = (b ? "dark|" : "") + w;
|
|
1456
|
+
if (m in u) return u[m];
|
|
1457
|
+
const x = k(w, b);
|
|
1458
|
+
return u[m] = x, x;
|
|
1459
|
+
}
|
|
1460
|
+
function y(w) {
|
|
1461
|
+
const b = w.some((x) => ye.includes(x)), m = w.includes("dark");
|
|
1462
|
+
return w.length === 0 ? 1 : !b && !m ? 2 : b && !m ? 3 : 4;
|
|
1463
|
+
}
|
|
1464
|
+
function c(w) {
|
|
1457
1465
|
const b = [];
|
|
1458
|
-
let
|
|
1459
|
-
for (let g = 0; g <
|
|
1460
|
-
const p =
|
|
1461
|
-
p === "[" ? x++ : p === "]" && x > 0 ? x-- : p === "(" ?
|
|
1466
|
+
let m = "", x = 0, l = 0;
|
|
1467
|
+
for (let g = 0; g < w.length; g++) {
|
|
1468
|
+
const p = w[g];
|
|
1469
|
+
p === "[" ? x++ : p === "]" && x > 0 ? x-- : p === "(" ? l++ : p === ")" && l > 0 && l--, p === ":" && x === 0 && l === 0 ? (b.push(m), m = "") : m += p;
|
|
1462
1470
|
}
|
|
1463
|
-
return
|
|
1471
|
+
return m && b.push(m), b;
|
|
1464
1472
|
}
|
|
1465
|
-
function h(
|
|
1466
|
-
switch (
|
|
1473
|
+
function h(w) {
|
|
1474
|
+
switch (w) {
|
|
1467
1475
|
case "hover":
|
|
1468
1476
|
return ":hover";
|
|
1469
1477
|
case "focus":
|
|
@@ -1492,210 +1500,210 @@ function lt(e) {
|
|
|
1492
1500
|
return null;
|
|
1493
1501
|
}
|
|
1494
1502
|
}
|
|
1495
|
-
function w
|
|
1496
|
-
const
|
|
1503
|
+
function k(w, b = !1) {
|
|
1504
|
+
const m = c(w);
|
|
1497
1505
|
let x = !1;
|
|
1498
|
-
const
|
|
1499
|
-
if (!
|
|
1500
|
-
const g =
|
|
1506
|
+
const l = m.find((v) => (v.startsWith("!") && (x = !0, v = v.slice(1)), ge[v] || be(v) || xe(v) || we(v) || ce(v)));
|
|
1507
|
+
if (!l) return null;
|
|
1508
|
+
const g = l.replace(/^!/, ""), p = ge[g] ?? be(g) ?? xe(g) ?? we(g) ?? ce(g);
|
|
1501
1509
|
if (!p) return null;
|
|
1502
|
-
const _ =
|
|
1503
|
-
let
|
|
1504
|
-
b && (
|
|
1505
|
-
const
|
|
1506
|
-
let
|
|
1510
|
+
const _ = m.indexOf(l);
|
|
1511
|
+
let C = _ >= 0 ? m.slice(0, _) : [];
|
|
1512
|
+
b && (C = C.filter((v) => v !== "dark"));
|
|
1513
|
+
const E = `.${ot(w)}`, S = "__SUBJECT__", A = x ? p.replace(/;$/, " !important;") : p;
|
|
1514
|
+
let j = S;
|
|
1507
1515
|
const Q = [];
|
|
1508
|
-
for (const
|
|
1509
|
-
|
|
1510
|
-
|
|
1516
|
+
for (const v of C)
|
|
1517
|
+
v.startsWith("group-") ? (j = `.group:${v.slice(6)} ${j}`, Q.push(v)) : v.startsWith("peer-") && (j = j.replace(S, `.peer:${v.slice(5)}~${S}`), Q.push(v));
|
|
1518
|
+
C = C.filter((v) => !Q.includes(v));
|
|
1511
1519
|
const X = [], de = [];
|
|
1512
1520
|
let q = null;
|
|
1513
|
-
for (const
|
|
1514
|
-
if (
|
|
1515
|
-
const B =
|
|
1521
|
+
for (const v of C) {
|
|
1522
|
+
if (v === "dark" || ye.includes(v)) continue;
|
|
1523
|
+
const B = st(v);
|
|
1516
1524
|
if (B) {
|
|
1517
1525
|
q = B;
|
|
1518
1526
|
continue;
|
|
1519
1527
|
}
|
|
1520
|
-
const
|
|
1521
|
-
if (
|
|
1522
|
-
q ? de.push(
|
|
1528
|
+
const O = h(v);
|
|
1529
|
+
if (O) {
|
|
1530
|
+
q ? de.push(O) : X.push(O);
|
|
1523
1531
|
continue;
|
|
1524
1532
|
}
|
|
1525
|
-
const
|
|
1526
|
-
typeof
|
|
1533
|
+
const P = rt[v];
|
|
1534
|
+
typeof P == "function" && (j = P(j, A).split("{")[0]);
|
|
1527
1535
|
}
|
|
1528
|
-
function I(
|
|
1529
|
-
if (!B) return
|
|
1530
|
-
let
|
|
1531
|
-
if (
|
|
1532
|
-
let
|
|
1533
|
-
for (;
|
|
1534
|
-
for (;
|
|
1535
|
-
const R =
|
|
1536
|
-
if (R === "[" ?
|
|
1537
|
-
return
|
|
1536
|
+
function I(v, B) {
|
|
1537
|
+
if (!B) return v;
|
|
1538
|
+
let O = 0, P = 0;
|
|
1539
|
+
if (v.length && (v[0] === ">" || v[0] === "+" || v[0] === "~" || v[0] === " ")) {
|
|
1540
|
+
let T = 1;
|
|
1541
|
+
for (; T < v.length && v[T] === " "; ) T++;
|
|
1542
|
+
for (; T < v.length; T++) {
|
|
1543
|
+
const R = v[T];
|
|
1544
|
+
if (R === "[" ? O++ : R === "]" && O > 0 ? O-- : R === "(" ? P++ : R === ")" && P > 0 && P--, O === 0 && P === 0 && (v[T] === ">" || v[T] === "+" || v[T] === "~" || v[T] === " "))
|
|
1545
|
+
return v.slice(0, T) + B + v.slice(T);
|
|
1538
1546
|
}
|
|
1539
|
-
return
|
|
1547
|
+
return v + B;
|
|
1540
1548
|
}
|
|
1541
|
-
for (let
|
|
1542
|
-
const R =
|
|
1543
|
-
if (R === "[" ?
|
|
1544
|
-
return
|
|
1549
|
+
for (let T = 0; T < v.length; T++) {
|
|
1550
|
+
const R = v[T];
|
|
1551
|
+
if (R === "[" ? O++ : R === "]" && O > 0 ? O-- : R === "(" ? P++ : R === ")" && P > 0 && P--, O === 0 && P === 0 && (R === ">" || R === "+" || R === "~" || R === " "))
|
|
1552
|
+
return v.slice(0, T) + B + v.slice(T);
|
|
1545
1553
|
}
|
|
1546
|
-
return
|
|
1554
|
+
return v + B;
|
|
1547
1555
|
}
|
|
1548
1556
|
const Z = X.join(""), F = de.join("");
|
|
1549
1557
|
if (q)
|
|
1550
1558
|
if (q.includes("&")) {
|
|
1551
|
-
const
|
|
1559
|
+
const v = q.indexOf("&"), B = q.slice(0, v), O = q.slice(v + 1), P = S + Z, T = j;
|
|
1552
1560
|
if (X.length === 0)
|
|
1553
|
-
|
|
1561
|
+
j = T.replace(S, B + P + F + O);
|
|
1554
1562
|
else {
|
|
1555
|
-
const R = I(
|
|
1556
|
-
|
|
1563
|
+
const R = I(O, F);
|
|
1564
|
+
j = T.replace(S, B + P + R);
|
|
1557
1565
|
}
|
|
1558
1566
|
} else
|
|
1559
|
-
|
|
1567
|
+
j = j.replace(S, `${q}${S + Z}`), F && (j = j.replace(S, `${S}${F}`));
|
|
1560
1568
|
else
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
let L = `${
|
|
1564
|
-
const K =
|
|
1565
|
-
return b && D ? L = `@media (prefers-color-scheme: dark) and ${
|
|
1566
|
-
}
|
|
1567
|
-
for (const
|
|
1568
|
-
const b =
|
|
1569
|
-
(p) => ge[p] || be(p) || xe(p) ||
|
|
1569
|
+
j = S + Z + F;
|
|
1570
|
+
j = j.replace(new RegExp(S, "g"), E);
|
|
1571
|
+
let L = `${j}{${A}}`;
|
|
1572
|
+
const K = C.filter((v) => ye.includes(v)), D = K.length ? K[K.length - 1] : null, ne = C.includes("dark");
|
|
1573
|
+
return b && D ? L = `@media (prefers-color-scheme: dark) and ${me[D]}{${L}}` : b ? L = `@media (prefers-color-scheme: dark){${L}}` : ne && D ? L = `@media (prefers-color-scheme: dark) and ${me[D]}{${L}}` : ne ? L = `@media (prefers-color-scheme: dark){${L}}` : D && (L = `@media ${me[D]}{${L}}`), L;
|
|
1574
|
+
}
|
|
1575
|
+
for (const w of n) {
|
|
1576
|
+
const b = c(w), m = b.find(
|
|
1577
|
+
(p) => ge[p] || be(p) || xe(p) || we(p) || ce(p)
|
|
1570
1578
|
);
|
|
1571
|
-
if (!
|
|
1572
|
-
const x = b.indexOf(
|
|
1579
|
+
if (!m) continue;
|
|
1580
|
+
const x = b.indexOf(m), l = x >= 0 ? b.slice(0, x) : [], g = y(l);
|
|
1573
1581
|
if (g === 4) {
|
|
1574
|
-
const p = d(
|
|
1582
|
+
const p = d(w, !0);
|
|
1575
1583
|
p && f.push(p);
|
|
1576
1584
|
} else {
|
|
1577
|
-
const p = d(
|
|
1578
|
-
p && (g === 1 ?
|
|
1585
|
+
const p = d(w);
|
|
1586
|
+
p && (g === 1 ? s.push(p) : g === 2 ? o.push(p) : g === 3 && a.push(p));
|
|
1579
1587
|
}
|
|
1580
1588
|
}
|
|
1581
|
-
const $ = [...
|
|
1582
|
-
return
|
|
1589
|
+
const $ = [...s, ...o, ...a, ...f].join("");
|
|
1590
|
+
return Ce.set(e, { css: $, timestamp: t }), $;
|
|
1583
1591
|
}
|
|
1584
1592
|
const te = [];
|
|
1585
|
-
function
|
|
1593
|
+
function ft(e, t, r, i, n, s, o, a) {
|
|
1586
1594
|
if (e) {
|
|
1587
1595
|
te.push(r);
|
|
1588
1596
|
try {
|
|
1589
1597
|
if (t.loadingTemplate && r.isLoading) {
|
|
1590
|
-
Y(e, t.loadingTemplate(r), r,
|
|
1598
|
+
Y(e, t.loadingTemplate(r), r, i, n);
|
|
1591
1599
|
return;
|
|
1592
1600
|
}
|
|
1593
1601
|
if (t.errorTemplate && r.hasError) {
|
|
1594
|
-
r.error instanceof Error && Y(e, t.errorTemplate(r.error, r), r,
|
|
1602
|
+
r.error instanceof Error && Y(e, t.errorTemplate(r.error, r), r, i, n);
|
|
1595
1603
|
return;
|
|
1596
1604
|
}
|
|
1597
1605
|
const f = t.render(r);
|
|
1598
1606
|
if (f instanceof Promise) {
|
|
1599
|
-
|
|
1600
|
-
|
|
1607
|
+
s(!0), f.then((u) => {
|
|
1608
|
+
s(!1), o(null), Y(e, u, r, i, n), a(e.innerHTML);
|
|
1601
1609
|
}).catch((u) => {
|
|
1602
|
-
|
|
1603
|
-
}), t.loadingTemplate && Y(e, t.loadingTemplate(r), r,
|
|
1610
|
+
s(!1), o(u), t.errorTemplate && Y(e, t.errorTemplate(u, r), r, i, n);
|
|
1611
|
+
}), t.loadingTemplate && Y(e, t.loadingTemplate(r), r, i, n);
|
|
1604
1612
|
return;
|
|
1605
1613
|
}
|
|
1606
|
-
Y(e, f, r,
|
|
1614
|
+
Y(e, f, r, i, n), a(e.innerHTML);
|
|
1607
1615
|
} finally {
|
|
1608
1616
|
te.pop();
|
|
1609
1617
|
}
|
|
1610
1618
|
}
|
|
1611
1619
|
}
|
|
1612
|
-
function Y(e, t, r,
|
|
1620
|
+
function Y(e, t, r, i, n) {
|
|
1613
1621
|
e && (Ye(
|
|
1614
1622
|
e,
|
|
1615
1623
|
Array.isArray(t) ? t : [t],
|
|
1616
1624
|
r,
|
|
1617
|
-
|
|
1625
|
+
i
|
|
1618
1626
|
), n(e.innerHTML));
|
|
1619
1627
|
}
|
|
1620
|
-
function
|
|
1621
|
-
if (
|
|
1628
|
+
function ut(e, t, r, i, n, s, o) {
|
|
1629
|
+
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1622
1630
|
if (n(r + 1), r > 10) {
|
|
1623
|
-
|
|
1631
|
+
o(null);
|
|
1624
1632
|
return;
|
|
1625
1633
|
}
|
|
1626
1634
|
} else
|
|
1627
1635
|
n(0);
|
|
1628
1636
|
const f = setTimeout(() => {
|
|
1629
|
-
|
|
1637
|
+
i(Date.now()), e(), o(null);
|
|
1630
1638
|
}, 0);
|
|
1631
|
-
|
|
1639
|
+
o(f);
|
|
1632
1640
|
}
|
|
1633
|
-
function
|
|
1641
|
+
function dt(e, t, r, i, n, s) {
|
|
1634
1642
|
if (!e) return;
|
|
1635
|
-
const
|
|
1636
|
-
if (!t.style && (!
|
|
1637
|
-
|
|
1643
|
+
const o = lt(i);
|
|
1644
|
+
if (!t.style && (!o || o.trim() === "")) {
|
|
1645
|
+
s(null), e.adoptedStyleSheets = [_e()];
|
|
1638
1646
|
return;
|
|
1639
1647
|
}
|
|
1640
1648
|
let a = "";
|
|
1641
1649
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1642
1650
|
let f = Ge(`${a}
|
|
1643
|
-
${
|
|
1651
|
+
${o}
|
|
1644
1652
|
`);
|
|
1645
1653
|
f = Be(f);
|
|
1646
1654
|
let u = n;
|
|
1647
|
-
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== f) && u.replaceSync(f), e.adoptedStyleSheets = [_e(), u],
|
|
1655
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== f) && u.replaceSync(f), e.adoptedStyleSheets = [_e(), u], s(u);
|
|
1648
1656
|
}
|
|
1649
1657
|
const ue = /* @__PURE__ */ new Map(), Ae = Symbol.for("cer.registry");
|
|
1650
1658
|
if (typeof window < "u") {
|
|
1651
1659
|
const e = globalThis;
|
|
1652
1660
|
e[Ae] || (e[Ae] = ue);
|
|
1653
1661
|
}
|
|
1654
|
-
function
|
|
1655
|
-
let
|
|
1656
|
-
|
|
1662
|
+
function je(e, t, r) {
|
|
1663
|
+
let i = J(e);
|
|
1664
|
+
i.includes("-") || (i = `cer-${i}`);
|
|
1657
1665
|
let n;
|
|
1658
|
-
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (
|
|
1659
|
-
console.error(`[${
|
|
1666
|
+
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (s, o) => {
|
|
1667
|
+
console.error(`[${i}] Error:`, s, o);
|
|
1660
1668
|
});
|
|
1661
1669
|
try {
|
|
1662
|
-
const
|
|
1670
|
+
const s = /* @__PURE__ */ new Set([
|
|
1663
1671
|
"refs",
|
|
1664
1672
|
"requestRender",
|
|
1665
1673
|
"error",
|
|
1666
1674
|
"hasError",
|
|
1667
1675
|
"isLoading",
|
|
1668
1676
|
"emit"
|
|
1669
|
-
]),
|
|
1677
|
+
]), o = [];
|
|
1670
1678
|
if (n.state && typeof n.state == "object" && Object.keys(n.state).forEach((a) => {
|
|
1671
|
-
|
|
1679
|
+
s.has(a) && o.push(a);
|
|
1672
1680
|
}), n.props && typeof n.props == "object" && Object.keys(n.props).forEach((a) => {
|
|
1673
|
-
|
|
1681
|
+
s.has(a) && o.push(a);
|
|
1674
1682
|
}), n.computed && typeof n.computed == "object" && Object.keys(n.computed).forEach((a) => {
|
|
1675
|
-
|
|
1676
|
-
}),
|
|
1677
|
-
const a = Array.from(new Set(
|
|
1683
|
+
s.has(a) && o.push(a);
|
|
1684
|
+
}), o.length > 0) {
|
|
1685
|
+
const a = Array.from(new Set(o));
|
|
1678
1686
|
console.warn(
|
|
1679
|
-
`[${
|
|
1687
|
+
`[${i}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`
|
|
1680
1688
|
);
|
|
1681
1689
|
}
|
|
1682
1690
|
} catch {
|
|
1683
1691
|
}
|
|
1684
|
-
if (ue.set(
|
|
1685
|
-
if (!customElements.get(
|
|
1686
|
-
customElements.define(
|
|
1692
|
+
if (ue.set(i, n), typeof window < "u")
|
|
1693
|
+
if (!customElements.get(i))
|
|
1694
|
+
customElements.define(i, pt(i, n));
|
|
1687
1695
|
else
|
|
1688
1696
|
try {
|
|
1689
|
-
document.querySelectorAll(
|
|
1697
|
+
document.querySelectorAll(i).forEach((s) => {
|
|
1690
1698
|
try {
|
|
1691
|
-
typeof
|
|
1699
|
+
typeof s._cfg < "u" && (s._cfg = n), typeof s._render == "function" && s._render(n);
|
|
1692
1700
|
} catch {
|
|
1693
1701
|
}
|
|
1694
1702
|
});
|
|
1695
1703
|
} catch {
|
|
1696
1704
|
}
|
|
1697
1705
|
}
|
|
1698
|
-
function
|
|
1706
|
+
function pt(e, t) {
|
|
1699
1707
|
if (!t.render)
|
|
1700
1708
|
throw new Error(
|
|
1701
1709
|
"Component must have a render function"
|
|
@@ -1752,12 +1760,12 @@ function dt(e, t) {
|
|
|
1752
1760
|
enumerable: !1,
|
|
1753
1761
|
configurable: !1
|
|
1754
1762
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
1755
|
-
value: (n,
|
|
1763
|
+
value: (n, s, o) => {
|
|
1756
1764
|
const a = new CustomEvent(n, {
|
|
1757
|
-
detail:
|
|
1765
|
+
detail: s,
|
|
1758
1766
|
bubbles: !0,
|
|
1759
1767
|
composed: !0,
|
|
1760
|
-
...
|
|
1768
|
+
...o || {}
|
|
1761
1769
|
});
|
|
1762
1770
|
return this.dispatchEvent(a), !a.defaultPrevented;
|
|
1763
1771
|
},
|
|
@@ -1765,11 +1773,11 @@ function dt(e, t) {
|
|
|
1765
1773
|
enumerable: !1,
|
|
1766
1774
|
configurable: !1
|
|
1767
1775
|
});
|
|
1768
|
-
const
|
|
1769
|
-
Object.keys(
|
|
1770
|
-
const
|
|
1771
|
-
typeof
|
|
1772
|
-
}), this._applyComputed(
|
|
1776
|
+
const i = ue.get(e) || t;
|
|
1777
|
+
Object.keys(i).forEach((n) => {
|
|
1778
|
+
const s = i[n];
|
|
1779
|
+
typeof s == "function" && (this.context[n] = (...o) => s(...o, this.context));
|
|
1780
|
+
}), this._applyComputed(i), this._initializing = !1, this._initWatchers(i), this._render(i);
|
|
1773
1781
|
}
|
|
1774
1782
|
connectedCallback() {
|
|
1775
1783
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
@@ -1807,12 +1815,12 @@ function dt(e, t) {
|
|
|
1807
1815
|
);
|
|
1808
1816
|
});
|
|
1809
1817
|
}
|
|
1810
|
-
attributeChangedCallback(r,
|
|
1818
|
+
attributeChangedCallback(r, i, n) {
|
|
1811
1819
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1812
1820
|
this._applyProps(t), Ie(
|
|
1813
1821
|
t,
|
|
1814
1822
|
r,
|
|
1815
|
-
|
|
1823
|
+
i,
|
|
1816
1824
|
n,
|
|
1817
1825
|
this.context
|
|
1818
1826
|
);
|
|
@@ -1823,11 +1831,11 @@ function dt(e, t) {
|
|
|
1823
1831
|
}
|
|
1824
1832
|
_applyComputed(r) {
|
|
1825
1833
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1826
|
-
r.computed && Object.entries(r.computed).forEach(([
|
|
1827
|
-
Object.defineProperty(this.context,
|
|
1834
|
+
r.computed && Object.entries(r.computed).forEach(([i, n]) => {
|
|
1835
|
+
Object.defineProperty(this.context, i, {
|
|
1828
1836
|
get: () => {
|
|
1829
|
-
const
|
|
1830
|
-
return H(
|
|
1837
|
+
const s = n(this.context);
|
|
1838
|
+
return H(s);
|
|
1831
1839
|
},
|
|
1832
1840
|
enumerable: !0
|
|
1833
1841
|
});
|
|
@@ -1837,21 +1845,21 @@ function dt(e, t) {
|
|
|
1837
1845
|
// --- Render ---
|
|
1838
1846
|
_render(r) {
|
|
1839
1847
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1840
|
-
|
|
1848
|
+
ft(
|
|
1841
1849
|
this.shadowRoot,
|
|
1842
1850
|
r,
|
|
1843
1851
|
this.context,
|
|
1844
1852
|
this._refs,
|
|
1845
|
-
(
|
|
1846
|
-
this._lastHtmlStringForJitCSS =
|
|
1853
|
+
(i) => {
|
|
1854
|
+
this._lastHtmlStringForJitCSS = i, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(i);
|
|
1847
1855
|
},
|
|
1848
|
-
(
|
|
1849
|
-
this._templateLoading =
|
|
1856
|
+
(i) => {
|
|
1857
|
+
this._templateLoading = i, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(i);
|
|
1850
1858
|
},
|
|
1851
|
-
(
|
|
1852
|
-
this._templateError =
|
|
1859
|
+
(i) => {
|
|
1860
|
+
this._templateError = i, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(i);
|
|
1853
1861
|
},
|
|
1854
|
-
(
|
|
1862
|
+
(i) => this._applyStyle(r, i)
|
|
1855
1863
|
);
|
|
1856
1864
|
});
|
|
1857
1865
|
}
|
|
@@ -1860,7 +1868,7 @@ function dt(e, t) {
|
|
|
1860
1868
|
}
|
|
1861
1869
|
_requestRender() {
|
|
1862
1870
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1863
|
-
|
|
1871
|
+
ut(
|
|
1864
1872
|
() => this._render(this._cfg),
|
|
1865
1873
|
this._lastRenderTime,
|
|
1866
1874
|
this._renderCount,
|
|
@@ -1878,13 +1886,13 @@ function dt(e, t) {
|
|
|
1878
1886
|
});
|
|
1879
1887
|
}
|
|
1880
1888
|
// --- Style ---
|
|
1881
|
-
_applyStyle(r,
|
|
1889
|
+
_applyStyle(r, i) {
|
|
1882
1890
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1883
|
-
|
|
1891
|
+
dt(
|
|
1884
1892
|
this.shadowRoot,
|
|
1885
1893
|
r,
|
|
1886
1894
|
this.context,
|
|
1887
|
-
|
|
1895
|
+
i,
|
|
1888
1896
|
this._styleSheet,
|
|
1889
1897
|
(n) => {
|
|
1890
1898
|
this._styleSheet = n;
|
|
@@ -1893,10 +1901,10 @@ function dt(e, t) {
|
|
|
1893
1901
|
});
|
|
1894
1902
|
}
|
|
1895
1903
|
// --- Error Boundary function ---
|
|
1896
|
-
_runLogicWithinErrorBoundary(r,
|
|
1904
|
+
_runLogicWithinErrorBoundary(r, i) {
|
|
1897
1905
|
this._hasError && (this._hasError = !1);
|
|
1898
1906
|
try {
|
|
1899
|
-
|
|
1907
|
+
i();
|
|
1900
1908
|
} catch (n) {
|
|
1901
1909
|
this._hasError = !0, r.onError && r.onError(n, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(
|
|
1902
1910
|
n,
|
|
@@ -1907,8 +1915,8 @@ function dt(e, t) {
|
|
|
1907
1915
|
// --- State, props, computed ---
|
|
1908
1916
|
_initContext(r) {
|
|
1909
1917
|
try {
|
|
1910
|
-
let
|
|
1911
|
-
return Array.isArray(
|
|
1918
|
+
let i = function(s, o = "") {
|
|
1919
|
+
return Array.isArray(s) ? new Proxy(s, {
|
|
1912
1920
|
get(a, f, u) {
|
|
1913
1921
|
const d = Reflect.get(a, f, u);
|
|
1914
1922
|
return typeof d == "function" && typeof f == "string" && [
|
|
@@ -1919,36 +1927,36 @@ function dt(e, t) {
|
|
|
1919
1927
|
"splice",
|
|
1920
1928
|
"sort",
|
|
1921
1929
|
"reverse"
|
|
1922
|
-
].includes(f) ? function(...
|
|
1923
|
-
const h = d.apply(a,
|
|
1930
|
+
].includes(f) ? function(...c) {
|
|
1931
|
+
const h = d.apply(a, c);
|
|
1924
1932
|
if (!n._initializing) {
|
|
1925
|
-
const
|
|
1926
|
-
n._triggerWatchers(
|
|
1933
|
+
const k = o || "root";
|
|
1934
|
+
n._triggerWatchers(k, a), n._render(r);
|
|
1927
1935
|
}
|
|
1928
1936
|
return h;
|
|
1929
1937
|
} : d;
|
|
1930
1938
|
},
|
|
1931
1939
|
set(a, f, u) {
|
|
1932
1940
|
if (a[f] = u, !n._initializing) {
|
|
1933
|
-
const d =
|
|
1941
|
+
const d = o ? `${o}.${String(f)}` : String(f);
|
|
1934
1942
|
n._triggerWatchers(d, u), n._render(r);
|
|
1935
1943
|
}
|
|
1936
1944
|
return !0;
|
|
1937
1945
|
},
|
|
1938
1946
|
deleteProperty(a, f) {
|
|
1939
1947
|
if (delete a[f], !n._initializing) {
|
|
1940
|
-
const u =
|
|
1948
|
+
const u = o ? `${o}.${String(f)}` : String(f);
|
|
1941
1949
|
n._triggerWatchers(u, void 0), n._render(r);
|
|
1942
1950
|
}
|
|
1943
1951
|
return !0;
|
|
1944
1952
|
}
|
|
1945
|
-
}) :
|
|
1946
|
-
const f =
|
|
1947
|
-
|
|
1948
|
-
}), new Proxy(
|
|
1953
|
+
}) : s && typeof s == "object" ? (Object.keys(s).forEach((a) => {
|
|
1954
|
+
const f = o ? `${o}.${a}` : a;
|
|
1955
|
+
s[a] = i(s[a], f);
|
|
1956
|
+
}), new Proxy(s, {
|
|
1949
1957
|
set(a, f, u) {
|
|
1950
|
-
const d =
|
|
1951
|
-
return a[f] =
|
|
1958
|
+
const d = o ? `${o}.${String(f)}` : String(f);
|
|
1959
|
+
return a[f] = i(u, d), n._initializing || (n._triggerWatchers(
|
|
1952
1960
|
d,
|
|
1953
1961
|
a[f]
|
|
1954
1962
|
), n._render(r)), !0;
|
|
@@ -1956,134 +1964,134 @@ function dt(e, t) {
|
|
|
1956
1964
|
get(a, f, u) {
|
|
1957
1965
|
return Reflect.get(a, f, u);
|
|
1958
1966
|
}
|
|
1959
|
-
})) :
|
|
1967
|
+
})) : s;
|
|
1960
1968
|
};
|
|
1961
1969
|
const n = this;
|
|
1962
|
-
return
|
|
1970
|
+
return i({ ...r.state });
|
|
1963
1971
|
} catch {
|
|
1964
1972
|
return {};
|
|
1965
1973
|
}
|
|
1966
1974
|
}
|
|
1967
1975
|
_initWatchers(r) {
|
|
1968
1976
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1969
|
-
|
|
1977
|
+
ze(
|
|
1970
1978
|
this.context,
|
|
1971
1979
|
this._watchers,
|
|
1972
1980
|
r.watch || {}
|
|
1973
1981
|
);
|
|
1974
1982
|
});
|
|
1975
1983
|
}
|
|
1976
|
-
_triggerWatchers(r,
|
|
1977
|
-
Me(this.context, this._watchers, r,
|
|
1984
|
+
_triggerWatchers(r, i) {
|
|
1985
|
+
Me(this.context, this._watchers, r, i);
|
|
1978
1986
|
}
|
|
1979
1987
|
_applyProps(r) {
|
|
1980
1988
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1981
1989
|
try {
|
|
1982
1990
|
We(this, r, this.context);
|
|
1983
|
-
} catch (
|
|
1984
|
-
this._hasError = !0, r.onError && r.onError(
|
|
1991
|
+
} catch (i) {
|
|
1992
|
+
this._hasError = !0, r.onError && r.onError(i, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(i, this.context));
|
|
1985
1993
|
}
|
|
1986
1994
|
});
|
|
1987
1995
|
}
|
|
1988
1996
|
};
|
|
1989
1997
|
}
|
|
1990
|
-
function ee(e, t = {}, r,
|
|
1991
|
-
const n =
|
|
1998
|
+
function ee(e, t = {}, r, i) {
|
|
1999
|
+
const n = i ?? t.key;
|
|
1992
2000
|
return { tag: e, key: n, props: t, children: r };
|
|
1993
2001
|
}
|
|
1994
|
-
function
|
|
2002
|
+
function le(e) {
|
|
1995
2003
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
1996
2004
|
}
|
|
1997
|
-
function
|
|
1998
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
2005
|
+
function se(e) {
|
|
2006
|
+
return typeof e == "object" && e !== null && "tag" in e && !le(e);
|
|
1999
2007
|
}
|
|
2000
|
-
function
|
|
2008
|
+
function ht(e, t) {
|
|
2001
2009
|
return e.key != null ? e : { ...e, key: t };
|
|
2002
2010
|
}
|
|
2003
|
-
function
|
|
2004
|
-
const
|
|
2011
|
+
function gt(e, t = [], r = {}) {
|
|
2012
|
+
const i = {}, n = {}, s = {}, o = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2005
2013
|
let a;
|
|
2006
|
-
for (; a =
|
|
2007
|
-
const f = a[1], u = a[2], d = (a[4] || a[6]) ?? "",
|
|
2008
|
-
let
|
|
2009
|
-
|
|
2014
|
+
for (; a = o.exec(e); ) {
|
|
2015
|
+
const f = a[1], u = a[2], d = (a[4] || a[6]) ?? "", y = d.match(/^{{(\d+)}}$/);
|
|
2016
|
+
let c = y ? t[Number(y[1])] ?? null : d;
|
|
2017
|
+
y || (c === "true" ? c = !0 : c === "false" ? c = !1 : c === "null" ? c = null : isNaN(Number(c)) || (c = Number(c)));
|
|
2010
2018
|
const h = ["model", "bind", "show", "class", "style"];
|
|
2011
2019
|
if (f === ":") {
|
|
2012
|
-
const [
|
|
2013
|
-
if (h.includes(
|
|
2014
|
-
const
|
|
2015
|
-
|
|
2016
|
-
value:
|
|
2017
|
-
modifiers:
|
|
2020
|
+
const [k, $] = u.split(":"), [w, ...b] = k.split(".");
|
|
2021
|
+
if (h.includes(w)) {
|
|
2022
|
+
const m = [...b], x = w === "model" && $ ? `model:${$}` : w;
|
|
2023
|
+
s[x] = {
|
|
2024
|
+
value: c,
|
|
2025
|
+
modifiers: m,
|
|
2018
2026
|
arg: $
|
|
2019
2027
|
};
|
|
2020
2028
|
} else
|
|
2021
|
-
n[u] =
|
|
2029
|
+
n[u] = c;
|
|
2022
2030
|
} else if (f === "@") {
|
|
2023
|
-
const
|
|
2024
|
-
|
|
2025
|
-
} else u === "ref" ?
|
|
2031
|
+
const k = "on" + u.charAt(0).toUpperCase() + u.slice(1);
|
|
2032
|
+
i[k] = typeof c == "function" ? c : typeof r[c] == "function" ? r[c] : void 0;
|
|
2033
|
+
} else u === "ref" ? i.ref = c : n[u] = c;
|
|
2026
2034
|
}
|
|
2027
|
-
return { props:
|
|
2035
|
+
return { props: i, attrs: n, directives: s };
|
|
2028
2036
|
}
|
|
2029
|
-
function
|
|
2030
|
-
const
|
|
2031
|
-
function
|
|
2032
|
-
return ee("#text", {},
|
|
2037
|
+
function mt(e, t, r) {
|
|
2038
|
+
const i = te.length > 0 ? te[te.length - 1] : void 0, n = r ?? i;
|
|
2039
|
+
function s(l, g) {
|
|
2040
|
+
return ee("#text", {}, l, g);
|
|
2033
2041
|
}
|
|
2034
|
-
let
|
|
2035
|
-
for (let
|
|
2036
|
-
|
|
2042
|
+
let o = "";
|
|
2043
|
+
for (let l = 0; l < e.length; l++)
|
|
2044
|
+
o += e[l], l < t.length && (o += `{{${l}}}`);
|
|
2037
2045
|
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, f = [];
|
|
2038
|
-
let u, d = [],
|
|
2039
|
-
function
|
|
2040
|
-
!
|
|
2041
|
-
if (g === "style" &&
|
|
2042
|
-
const p =
|
|
2046
|
+
let u, d = [], y = null, c = {}, h, k = 0, $ = [];
|
|
2047
|
+
function w(l) {
|
|
2048
|
+
!l || typeof l != "object" || le(l) || (l.props || l.attrs ? (l.props && (c.props || (c.props = {}), Object.assign(c.props, l.props)), l.attrs && (c.attrs || (c.attrs = {}), Object.keys(l.attrs).forEach((g) => {
|
|
2049
|
+
if (g === "style" && c.attrs.style) {
|
|
2050
|
+
const p = c.attrs.style.replace(
|
|
2043
2051
|
/;?\s*$/,
|
|
2044
2052
|
""
|
|
2045
|
-
), _ =
|
|
2046
|
-
|
|
2047
|
-
} else if (g === "class" &&
|
|
2048
|
-
const p =
|
|
2053
|
+
), _ = l.attrs.style.replace(/^;?\s*/, "");
|
|
2054
|
+
c.attrs.style = p + "; " + _;
|
|
2055
|
+
} else if (g === "class" && c.attrs.class) {
|
|
2056
|
+
const p = c.attrs.class.trim().split(/\s+/).filter(Boolean), _ = l.attrs.class.trim().split(/\s+/).filter(Boolean), C = [
|
|
2049
2057
|
.../* @__PURE__ */ new Set([...p, ..._])
|
|
2050
2058
|
];
|
|
2051
|
-
|
|
2059
|
+
c.attrs.class = C.join(" ");
|
|
2052
2060
|
} else
|
|
2053
|
-
|
|
2054
|
-
}))) : (
|
|
2055
|
-
}
|
|
2056
|
-
function b(
|
|
2057
|
-
const p =
|
|
2058
|
-
if (
|
|
2059
|
-
const _ =
|
|
2060
|
-
let
|
|
2061
|
+
c.attrs[g] = l.attrs[g];
|
|
2062
|
+
}))) : (c.props || (c.props = {}), Object.assign(c.props, l)));
|
|
2063
|
+
}
|
|
2064
|
+
function b(l, g) {
|
|
2065
|
+
const p = y ? d : $;
|
|
2066
|
+
if (le(l)) {
|
|
2067
|
+
const _ = l.key ?? g;
|
|
2068
|
+
let C = l.children;
|
|
2061
2069
|
p.push({
|
|
2062
|
-
...
|
|
2070
|
+
...l,
|
|
2063
2071
|
key: _,
|
|
2064
|
-
children:
|
|
2072
|
+
children: C
|
|
2065
2073
|
});
|
|
2066
2074
|
return;
|
|
2067
2075
|
}
|
|
2068
|
-
if (
|
|
2069
|
-
p.push(
|
|
2076
|
+
if (se(l)) {
|
|
2077
|
+
p.push(ht(l, void 0));
|
|
2070
2078
|
return;
|
|
2071
2079
|
}
|
|
2072
|
-
if (Array.isArray(
|
|
2073
|
-
if (
|
|
2074
|
-
for (let _ = 0; _ <
|
|
2075
|
-
const
|
|
2076
|
-
|
|
2080
|
+
if (Array.isArray(l)) {
|
|
2081
|
+
if (l.length === 0) return;
|
|
2082
|
+
for (let _ = 0; _ < l.length; _++) {
|
|
2083
|
+
const C = l[_];
|
|
2084
|
+
le(C) || se(C) || Array.isArray(C) ? b(C, `${g}-${_}`) : C !== null && typeof C == "object" ? w(C) : p.push(s(String(C), `${g}-${_}`));
|
|
2077
2085
|
}
|
|
2078
2086
|
return;
|
|
2079
2087
|
}
|
|
2080
|
-
if (
|
|
2081
|
-
|
|
2088
|
+
if (l !== null && typeof l == "object") {
|
|
2089
|
+
w(l);
|
|
2082
2090
|
return;
|
|
2083
2091
|
}
|
|
2084
|
-
p.push(
|
|
2092
|
+
p.push(s(String(l), g));
|
|
2085
2093
|
}
|
|
2086
|
-
const
|
|
2094
|
+
const m = /* @__PURE__ */ new Set([
|
|
2087
2095
|
"area",
|
|
2088
2096
|
"base",
|
|
2089
2097
|
"br",
|
|
@@ -2099,197 +2107,197 @@ function gt(e, t, r) {
|
|
|
2099
2107
|
"track",
|
|
2100
2108
|
"wbr"
|
|
2101
2109
|
]);
|
|
2102
|
-
for (; u = a.exec(
|
|
2110
|
+
for (; u = a.exec(o); )
|
|
2103
2111
|
if (u[1]) {
|
|
2104
|
-
const
|
|
2112
|
+
const l = u[1], g = u[0][1] === "/", p = u[0][u[0].length - 2] === "/" || m.has(l), {
|
|
2105
2113
|
props: _,
|
|
2106
|
-
attrs:
|
|
2107
|
-
directives:
|
|
2108
|
-
} =
|
|
2114
|
+
attrs: C,
|
|
2115
|
+
directives: E
|
|
2116
|
+
} = gt(u[2] || "", t, n), S = { props: {}, attrs: {} };
|
|
2109
2117
|
for (const A in _) S.props[A] = _[A];
|
|
2110
|
-
for (const A in
|
|
2111
|
-
if (
|
|
2118
|
+
for (const A in C) S.attrs[A] = C[A];
|
|
2119
|
+
if (E && Object.keys(E).some((A) => A === "model" || A.startsWith("model:")))
|
|
2112
2120
|
try {
|
|
2113
|
-
const A = Symbol.for("cer.registry"),
|
|
2114
|
-
if (!!(
|
|
2115
|
-
for (const I of Object.keys(
|
|
2121
|
+
const A = Symbol.for("cer.registry"), j = globalThis[A], Q = !!(j && typeof j.has == "function" && j.has(l)), X = !!(n && (n.__customElements instanceof Set && n.__customElements.has(l) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(l)));
|
|
2122
|
+
if (!!(l.includes("-") || X || Q))
|
|
2123
|
+
for (const I of Object.keys(E)) {
|
|
2116
2124
|
if (I !== "model" && !I.startsWith("model:")) continue;
|
|
2117
|
-
const Z =
|
|
2125
|
+
const Z = E[I], F = Z.arg ?? (I.includes(":") ? I.split(":", 2)[1] : void 0), L = Z.value, K = F ?? "modelValue", D = z, ne = oe, v = n ? n._state || n : void 0;
|
|
2118
2126
|
let B;
|
|
2119
|
-
typeof L == "string" && n ? B = D(
|
|
2127
|
+
typeof L == "string" && n ? B = D(v, L) : B = L, S.props[K] = B;
|
|
2120
2128
|
try {
|
|
2121
|
-
const
|
|
2122
|
-
S.attrs || (S.attrs = {}), B !== void 0 && (S.attrs[
|
|
2129
|
+
const T = J(K);
|
|
2130
|
+
S.attrs || (S.attrs = {}), B !== void 0 && (S.attrs[T] = B);
|
|
2123
2131
|
} catch {
|
|
2124
2132
|
}
|
|
2125
2133
|
S.isCustomElement = !0;
|
|
2126
|
-
const
|
|
2127
|
-
S.props[
|
|
2128
|
-
const R =
|
|
2129
|
-
if (!
|
|
2130
|
-
const pe = D(
|
|
2131
|
-
(Array.isArray(R) && Array.isArray(pe) ? JSON.stringify([...R].sort()) !== JSON.stringify([...pe].sort()) : R !== pe) && (ne(
|
|
2132
|
-
}, delete
|
|
2134
|
+
const O = `update:${J(K)}`, P = "on" + O.charAt(0).toUpperCase() + O.slice(1);
|
|
2135
|
+
S.props[P] = function(T) {
|
|
2136
|
+
const R = T.detail !== void 0 ? T.detail : T.target ? T.target.value : void 0;
|
|
2137
|
+
if (!v) return;
|
|
2138
|
+
const pe = D(v, typeof L == "string" ? L : String(L));
|
|
2139
|
+
(Array.isArray(R) && Array.isArray(pe) ? JSON.stringify([...R].sort()) !== JSON.stringify([...pe].sort()) : R !== pe) && (ne(v, typeof L == "string" ? L : String(L), R), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
2140
|
+
}, delete E[I];
|
|
2133
2141
|
}
|
|
2134
2142
|
} catch {
|
|
2135
2143
|
}
|
|
2136
|
-
if (Object.keys(
|
|
2144
|
+
if (Object.keys(E).length > 0 && (S.directives = { ...E }), g) {
|
|
2137
2145
|
const A = ee(
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
d.length === 1 &&
|
|
2146
|
+
y,
|
|
2147
|
+
c,
|
|
2148
|
+
d.length === 1 && se(d[0]) && d[0].tag === "#text" ? typeof d[0].children == "string" ? d[0].children : "" : d.length ? d : void 0,
|
|
2141
2149
|
h
|
|
2142
|
-
),
|
|
2143
|
-
|
|
2144
|
-
} else p ?
|
|
2145
|
-
tag:
|
|
2146
|
-
props:
|
|
2150
|
+
), j = f.pop();
|
|
2151
|
+
j ? (y = j.tag, c = j.props, h = j.key, d = j.children, d.push(A)) : ($.push(A), y = null, c = {}, h = void 0, d = []);
|
|
2152
|
+
} else p ? y ? d.push(ee(l, S, void 0, void 0)) : $.push(ee(l, S, void 0, void 0)) : (y && f.push({
|
|
2153
|
+
tag: y,
|
|
2154
|
+
props: c,
|
|
2147
2155
|
children: d,
|
|
2148
2156
|
key: h
|
|
2149
|
-
}),
|
|
2157
|
+
}), y = l, c = S, d = []);
|
|
2150
2158
|
} else if (typeof u[3] < "u") {
|
|
2151
|
-
const
|
|
2159
|
+
const l = Number(u[3]), g = t[l], p = `interp-${l}`;
|
|
2152
2160
|
b(g, p);
|
|
2153
2161
|
} else if (u[4]) {
|
|
2154
|
-
const
|
|
2162
|
+
const l = u[4], g = y ? d : $, p = l.split(/({{\d+}})/);
|
|
2155
2163
|
for (const _ of p) {
|
|
2156
2164
|
if (!_) continue;
|
|
2157
|
-
const
|
|
2158
|
-
if (
|
|
2159
|
-
const
|
|
2165
|
+
const C = _.match(/^{{(\d+)}}$/);
|
|
2166
|
+
if (C) {
|
|
2167
|
+
const E = Number(C[1]), S = t[E], A = `interp-${E}`;
|
|
2160
2168
|
b(S, A);
|
|
2161
2169
|
} else {
|
|
2162
|
-
const
|
|
2163
|
-
g.push(
|
|
2170
|
+
const E = `text-${k++}`;
|
|
2171
|
+
g.push(s(_, E));
|
|
2164
2172
|
}
|
|
2165
2173
|
}
|
|
2166
2174
|
}
|
|
2167
|
-
const x = $.filter((
|
|
2175
|
+
const x = $.filter((l) => se(l) && l.tag === "#text" ? typeof l.children == "string" && l.children.trim() !== "" : !0);
|
|
2168
2176
|
return x.length === 1 ? x[0] : x.length > 1 ? x : ee("div", {}, "", "fallback-root");
|
|
2169
2177
|
}
|
|
2170
2178
|
function U(e, ...t) {
|
|
2171
|
-
const r = t[t.length - 1],
|
|
2172
|
-
return
|
|
2179
|
+
const r = t[t.length - 1], i = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2180
|
+
return mt(e, t, i);
|
|
2173
2181
|
}
|
|
2174
|
-
const
|
|
2182
|
+
const Te = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, W = (e, t) => {
|
|
2175
2183
|
for (const r of e) {
|
|
2176
|
-
const
|
|
2177
|
-
if (
|
|
2184
|
+
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${n}$`), o = t.match(s);
|
|
2185
|
+
if (o) {
|
|
2178
2186
|
const a = {};
|
|
2179
|
-
return
|
|
2180
|
-
a[f] =
|
|
2187
|
+
return i.forEach((f, u) => {
|
|
2188
|
+
a[f] = o[u + 1];
|
|
2181
2189
|
}), { route: r, params: a };
|
|
2182
2190
|
}
|
|
2183
2191
|
}
|
|
2184
2192
|
return { route: null, params: {} };
|
|
2185
|
-
},
|
|
2193
|
+
}, ke = {};
|
|
2186
2194
|
async function yt(e) {
|
|
2187
2195
|
if (e.component) return e.component;
|
|
2188
2196
|
if (e.load) {
|
|
2189
|
-
if (
|
|
2197
|
+
if (ke[e.path]) return ke[e.path];
|
|
2190
2198
|
try {
|
|
2191
2199
|
const t = await e.load();
|
|
2192
|
-
return
|
|
2200
|
+
return ke[e.path] = t.default, t.default;
|
|
2193
2201
|
} catch {
|
|
2194
2202
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2195
2203
|
}
|
|
2196
2204
|
}
|
|
2197
2205
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2198
2206
|
}
|
|
2199
|
-
function
|
|
2200
|
-
const { routes: t, base: r = "", initialUrl:
|
|
2201
|
-
let n,
|
|
2202
|
-
const
|
|
2203
|
-
const b = t.find((
|
|
2207
|
+
function bt(e) {
|
|
2208
|
+
const { routes: t, base: r = "", initialUrl: i } = e;
|
|
2209
|
+
let n, s, o, a, f, u, d;
|
|
2210
|
+
const y = async ($, w) => {
|
|
2211
|
+
const b = t.find((m) => W([m], $.path).route !== null);
|
|
2204
2212
|
if (b?.beforeEnter)
|
|
2205
2213
|
try {
|
|
2206
|
-
const
|
|
2207
|
-
return typeof
|
|
2208
|
-
} catch (
|
|
2209
|
-
return console.error("beforeEnter error",
|
|
2214
|
+
const m = await b.beforeEnter($, w);
|
|
2215
|
+
return typeof m == "string" ? (await k(m, !0), !1) : m !== !1;
|
|
2216
|
+
} catch (m) {
|
|
2217
|
+
return console.error("beforeEnter error", m), !1;
|
|
2210
2218
|
}
|
|
2211
2219
|
return !0;
|
|
2212
|
-
},
|
|
2213
|
-
const b = t.find((
|
|
2220
|
+
}, c = async ($, w) => {
|
|
2221
|
+
const b = t.find((m) => W([m], $.path).route !== null);
|
|
2214
2222
|
if (b?.onEnter)
|
|
2215
2223
|
try {
|
|
2216
|
-
const
|
|
2217
|
-
return typeof
|
|
2218
|
-
} catch (
|
|
2219
|
-
return console.error("onEnter error",
|
|
2224
|
+
const m = await b.onEnter($, w);
|
|
2225
|
+
return typeof m == "string" ? (await k(m, !0), !1) : m !== !1;
|
|
2226
|
+
} catch (m) {
|
|
2227
|
+
return console.error("onEnter error", m), !1;
|
|
2220
2228
|
}
|
|
2221
2229
|
return !0;
|
|
2222
|
-
}, h = ($,
|
|
2223
|
-
const b = t.find((
|
|
2230
|
+
}, h = ($, w) => {
|
|
2231
|
+
const b = t.find((m) => W([m], $.path).route !== null);
|
|
2224
2232
|
if (b?.afterEnter)
|
|
2225
2233
|
try {
|
|
2226
|
-
b.afterEnter($,
|
|
2227
|
-
} catch (
|
|
2228
|
-
console.error("afterEnter error",
|
|
2234
|
+
b.afterEnter($, w);
|
|
2235
|
+
} catch (m) {
|
|
2236
|
+
console.error("afterEnter error", m);
|
|
2229
2237
|
}
|
|
2230
|
-
},
|
|
2238
|
+
}, k = async ($, w = !1) => {
|
|
2231
2239
|
try {
|
|
2232
2240
|
const b = {
|
|
2233
2241
|
path: $.replace(r, "") || "/",
|
|
2234
2242
|
query: {}
|
|
2235
|
-
},
|
|
2236
|
-
if (!
|
|
2237
|
-
const x =
|
|
2243
|
+
}, m = W(t, b.path);
|
|
2244
|
+
if (!m) throw new Error(`No route found for ${b.path}`);
|
|
2245
|
+
const x = o.getState(), l = {
|
|
2238
2246
|
path: b.path,
|
|
2239
|
-
params:
|
|
2247
|
+
params: m.params,
|
|
2240
2248
|
query: b.query
|
|
2241
2249
|
};
|
|
2242
|
-
if (!await
|
|
2243
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2250
|
+
if (!await y(l, x) || !await c(l, x)) return;
|
|
2251
|
+
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + $) : window.history.pushState({}, "", r + $)), o.setState(l), h(l, x);
|
|
2244
2252
|
} catch (b) {
|
|
2245
2253
|
console.error("Navigation error:", b);
|
|
2246
2254
|
}
|
|
2247
2255
|
};
|
|
2248
2256
|
if (typeof window < "u" && typeof document < "u") {
|
|
2249
2257
|
n = () => {
|
|
2250
|
-
const
|
|
2251
|
-
return { path: b, query:
|
|
2252
|
-
},
|
|
2253
|
-
const $ = W(t,
|
|
2254
|
-
|
|
2255
|
-
path:
|
|
2258
|
+
const w = new URL(window.location.href), b = w.pathname.replace(r, "") || "/", m = Te(w.search);
|
|
2259
|
+
return { path: b, query: m };
|
|
2260
|
+
}, s = n();
|
|
2261
|
+
const $ = W(t, s.path);
|
|
2262
|
+
o = $e({
|
|
2263
|
+
path: s.path,
|
|
2256
2264
|
params: $.params,
|
|
2257
|
-
query:
|
|
2258
|
-
}), a = async (
|
|
2265
|
+
query: s.query
|
|
2266
|
+
}), a = async (w = !1) => {
|
|
2259
2267
|
const b = n();
|
|
2260
|
-
await
|
|
2261
|
-
}, window.addEventListener("popstate", () => a(!0)), f = (
|
|
2268
|
+
await k(b.path, w);
|
|
2269
|
+
}, window.addEventListener("popstate", () => a(!0)), f = (w) => k(w, !1), u = (w) => k(w, !0), d = () => window.history.back();
|
|
2262
2270
|
} else {
|
|
2263
2271
|
n = () => {
|
|
2264
|
-
const b = new URL(
|
|
2265
|
-
return { path:
|
|
2266
|
-
},
|
|
2267
|
-
const $ = W(t,
|
|
2268
|
-
|
|
2269
|
-
path:
|
|
2272
|
+
const b = new URL(i || "/", "http://localhost"), m = b.pathname.replace(r, "") || "/", x = Te(b.search);
|
|
2273
|
+
return { path: m, query: x };
|
|
2274
|
+
}, s = n();
|
|
2275
|
+
const $ = W(t, s.path);
|
|
2276
|
+
o = $e({
|
|
2277
|
+
path: s.path,
|
|
2270
2278
|
params: $.params,
|
|
2271
|
-
query:
|
|
2279
|
+
query: s.query
|
|
2272
2280
|
}), a = async () => {
|
|
2273
2281
|
const b = n();
|
|
2274
|
-
await
|
|
2282
|
+
await w(b.path);
|
|
2275
2283
|
};
|
|
2276
|
-
const
|
|
2284
|
+
const w = async (b) => {
|
|
2277
2285
|
try {
|
|
2278
|
-
const
|
|
2286
|
+
const m = {
|
|
2279
2287
|
path: b.replace(r, "") || "/",
|
|
2280
2288
|
query: {}
|
|
2281
|
-
}, x = W(t,
|
|
2282
|
-
if (!x) throw new Error(`No route found for ${
|
|
2283
|
-
const
|
|
2284
|
-
path:
|
|
2289
|
+
}, x = W(t, m.path);
|
|
2290
|
+
if (!x) throw new Error(`No route found for ${m.path}`);
|
|
2291
|
+
const l = o.getState(), g = {
|
|
2292
|
+
path: m.path,
|
|
2285
2293
|
params: x.params,
|
|
2286
|
-
query:
|
|
2294
|
+
query: m.query
|
|
2287
2295
|
}, p = t.find((_) => W([_], g.path).route !== null);
|
|
2288
2296
|
if (p?.beforeEnter)
|
|
2289
2297
|
try {
|
|
2290
|
-
const _ = await p.beforeEnter(g,
|
|
2298
|
+
const _ = await p.beforeEnter(g, l);
|
|
2291
2299
|
if (typeof _ == "string") {
|
|
2292
|
-
await
|
|
2300
|
+
await w(_);
|
|
2293
2301
|
return;
|
|
2294
2302
|
}
|
|
2295
2303
|
if (_ === !1) return;
|
|
@@ -2298,53 +2306,53 @@ function mt(e) {
|
|
|
2298
2306
|
}
|
|
2299
2307
|
if (p?.onEnter)
|
|
2300
2308
|
try {
|
|
2301
|
-
const _ = await p.onEnter(g,
|
|
2309
|
+
const _ = await p.onEnter(g, l);
|
|
2302
2310
|
if (typeof _ == "string") {
|
|
2303
|
-
await
|
|
2311
|
+
await w(_);
|
|
2304
2312
|
return;
|
|
2305
2313
|
}
|
|
2306
2314
|
if (_ === !1) return;
|
|
2307
2315
|
} catch {
|
|
2308
2316
|
return;
|
|
2309
2317
|
}
|
|
2310
|
-
if (
|
|
2318
|
+
if (o.setState(g), p?.afterEnter)
|
|
2311
2319
|
try {
|
|
2312
|
-
p.afterEnter(g,
|
|
2320
|
+
p.afterEnter(g, l);
|
|
2313
2321
|
} catch {
|
|
2314
2322
|
}
|
|
2315
2323
|
} catch {
|
|
2316
2324
|
}
|
|
2317
2325
|
};
|
|
2318
|
-
f = async (b) =>
|
|
2326
|
+
f = async (b) => w(b), u = async (b) => w(b), d = () => {
|
|
2319
2327
|
};
|
|
2320
2328
|
}
|
|
2321
2329
|
return {
|
|
2322
|
-
store:
|
|
2330
|
+
store: o,
|
|
2323
2331
|
push: f,
|
|
2324
2332
|
replace: u,
|
|
2325
2333
|
back: d,
|
|
2326
|
-
subscribe:
|
|
2334
|
+
subscribe: o.subscribe,
|
|
2327
2335
|
matchRoute: ($) => W(t, $),
|
|
2328
|
-
getCurrent: () =>
|
|
2336
|
+
getCurrent: () => o.getState(),
|
|
2329
2337
|
resolveRouteComponent: yt
|
|
2330
2338
|
};
|
|
2331
2339
|
}
|
|
2332
2340
|
function Ct(e, t) {
|
|
2333
2341
|
return W(e, t);
|
|
2334
2342
|
}
|
|
2335
|
-
function
|
|
2336
|
-
const t =
|
|
2337
|
-
return
|
|
2343
|
+
function At(e) {
|
|
2344
|
+
const t = bt(e);
|
|
2345
|
+
return je("router-view", {
|
|
2338
2346
|
async render() {
|
|
2339
2347
|
if (!t) return U`<div>Router not initialized.</div>`;
|
|
2340
|
-
const r = t.getCurrent(), { path:
|
|
2348
|
+
const r = t.getCurrent(), { path: i } = r, n = t.matchRoute(i);
|
|
2341
2349
|
if (!n.route) return U`<div>Not found</div>`;
|
|
2342
2350
|
try {
|
|
2343
|
-
const
|
|
2344
|
-
if (typeof
|
|
2345
|
-
return { tag:
|
|
2346
|
-
if (typeof
|
|
2347
|
-
const
|
|
2351
|
+
const s = await t.resolveRouteComponent(n.route);
|
|
2352
|
+
if (typeof s == "string")
|
|
2353
|
+
return { tag: s, props: {}, children: [] };
|
|
2354
|
+
if (typeof s == "function") {
|
|
2355
|
+
const o = s(), a = o instanceof Promise ? await o : o;
|
|
2348
2356
|
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2349
2357
|
}
|
|
2350
2358
|
return U`<div>Invalid route component</div>`;
|
|
@@ -2357,7 +2365,7 @@ function Et(e) {
|
|
|
2357
2365
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2358
2366
|
});
|
|
2359
2367
|
}
|
|
2360
|
-
}),
|
|
2368
|
+
}), je("router-link", {
|
|
2361
2369
|
state: {},
|
|
2362
2370
|
props: {
|
|
2363
2371
|
to: { type: String, default: "" },
|
|
@@ -2370,7 +2378,7 @@ function Et(e) {
|
|
|
2370
2378
|
disabled: { type: Boolean, default: !1 },
|
|
2371
2379
|
external: { type: Boolean, default: !1 },
|
|
2372
2380
|
class: { type: String, default: "" },
|
|
2373
|
-
style: { type: String, default:
|
|
2381
|
+
style: { type: String, default: Oe`
|
|
2374
2382
|
[aria-disabled="true"] {
|
|
2375
2383
|
pointer-events: none;
|
|
2376
2384
|
opacity: 0.5;
|
|
@@ -2379,22 +2387,22 @@ function Et(e) {
|
|
|
2379
2387
|
},
|
|
2380
2388
|
style: (r) => r.style,
|
|
2381
2389
|
render: (r) => {
|
|
2382
|
-
const
|
|
2383
|
-
for (const g of $)
|
|
2390
|
+
const i = t.getCurrent(), n = r.to, s = r.exact, o = r.exactActiveClass, a = r.activeClass, f = r.ariaCurrentValue, u = r.tag, d = r.disabled, y = r.external, c = i.path === n, h = s ? c : i && typeof i.path == "string" ? i.path.startsWith(n) : !1, k = c ? `aria-current="${f}"` : "", $ = (r.class || "").split(/\s+/).filter(Boolean), w = {};
|
|
2391
|
+
for (const g of $) w[g] = !0;
|
|
2384
2392
|
const b = {
|
|
2385
|
-
...
|
|
2393
|
+
...w,
|
|
2386
2394
|
// Also include the configurable names (may duplicate the above)
|
|
2387
2395
|
[a]: h,
|
|
2388
|
-
[
|
|
2389
|
-
},
|
|
2396
|
+
[o]: c
|
|
2397
|
+
}, m = u === "button", x = d ? m ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", l = y && (u === "a" || !u) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2390
2398
|
return U`
|
|
2391
|
-
${
|
|
2399
|
+
${Pe().when(m, U`
|
|
2392
2400
|
<button
|
|
2393
2401
|
part="button"
|
|
2394
2402
|
:class="${b}"
|
|
2395
|
-
${
|
|
2403
|
+
${k}
|
|
2396
2404
|
${x}
|
|
2397
|
-
${
|
|
2405
|
+
${l}
|
|
2398
2406
|
@click="navigate"
|
|
2399
2407
|
><slot></slot></button>
|
|
2400
2408
|
`).otherwise(U`
|
|
@@ -2402,44 +2410,44 @@ function Et(e) {
|
|
|
2402
2410
|
part="link"
|
|
2403
2411
|
href="${n}"
|
|
2404
2412
|
:class="${b}"
|
|
2405
|
-
${
|
|
2413
|
+
${k}
|
|
2406
2414
|
${x}
|
|
2407
|
-
${
|
|
2415
|
+
${l}
|
|
2408
2416
|
@click="navigate"
|
|
2409
2417
|
><slot></slot></a>
|
|
2410
2418
|
`).done()}
|
|
2411
2419
|
`;
|
|
2412
2420
|
},
|
|
2413
|
-
navigate: (r,
|
|
2414
|
-
if (
|
|
2421
|
+
navigate: (r, i) => {
|
|
2422
|
+
if (i.disabled) {
|
|
2415
2423
|
r.preventDefault();
|
|
2416
2424
|
return;
|
|
2417
2425
|
}
|
|
2418
|
-
|
|
2426
|
+
i.external && (i.tag === "a" || !i.tag) || (r.preventDefault(), i.replace ? t.replace(i.to) : t.push(i.to));
|
|
2419
2427
|
}
|
|
2420
2428
|
}), t;
|
|
2421
2429
|
}
|
|
2422
2430
|
export {
|
|
2423
2431
|
G as GlobalEventBus,
|
|
2424
|
-
|
|
2432
|
+
je as component,
|
|
2425
2433
|
$e as createStore,
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2434
|
+
Oe as css,
|
|
2435
|
+
kt as each,
|
|
2436
|
+
vt as emit,
|
|
2429
2437
|
re as eventBus,
|
|
2430
2438
|
U as html,
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2439
|
+
At as initRouter,
|
|
2440
|
+
Et as listen,
|
|
2441
|
+
Pe as match,
|
|
2434
2442
|
W as matchRoute,
|
|
2435
2443
|
Ct as matchRouteSSR,
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2444
|
+
_t as off,
|
|
2445
|
+
$t as on,
|
|
2446
|
+
St as once,
|
|
2447
|
+
Te as parseQuery,
|
|
2440
2448
|
he as renderToString,
|
|
2441
2449
|
yt as resolveRouteComponent,
|
|
2442
|
-
|
|
2443
|
-
|
|
2450
|
+
bt as useRouter,
|
|
2451
|
+
xt as when
|
|
2444
2452
|
};
|
|
2445
2453
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|