@jasonshimmy/custom-elements-runtime 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{css-utils-Cg4o1MqY.js → css-utils-CC43BbEy.js} +20 -21
- package/dist/css-utils-CC43BbEy.js.map +1 -0
- package/dist/{css-utils-RqkyBWft.cjs → css-utils-mgjmH8qX.cjs} +5 -4
- package/dist/css-utils-mgjmH8qX.cjs.map +1 -0
- package/dist/custom-elements-runtime.cjs.js +4 -3
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.colors.cjs.js +3 -2
- package/dist/custom-elements-runtime.colors.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.colors.es.js +3 -2
- package/dist/custom-elements-runtime.colors.es.js.map +1 -1
- package/dist/custom-elements-runtime.directive-enhancements.cjs.js +3 -2
- package/dist/custom-elements-runtime.directive-enhancements.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.directive-enhancements.es.js +86 -100
- package/dist/custom-elements-runtime.directive-enhancements.es.js.map +1 -1
- package/dist/custom-elements-runtime.directives.cjs.js +3 -2
- package/dist/custom-elements-runtime.directives.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.directives.es.js +40 -43
- package/dist/custom-elements-runtime.directives.es.js.map +1 -1
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js +7 -6
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.dom-jit-css.es.js +58 -76
- package/dist/custom-elements-runtime.dom-jit-css.es.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +162 -186
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.cjs.js +3 -2
- package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.es.js +48 -103
- package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
- package/dist/custom-elements-runtime.jit-css.cjs.js +3 -2
- package/dist/custom-elements-runtime.jit-css.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.jit-css.es.js +29 -30
- package/dist/custom-elements-runtime.jit-css.es.js.map +1 -1
- package/dist/custom-elements-runtime.router.cjs.js +20 -19
- package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.router.es.js +579 -582
- package/dist/custom-elements-runtime.router.es.js.map +1 -1
- package/dist/custom-elements-runtime.ssr-middleware.cjs.js +5 -4
- package/dist/custom-elements-runtime.ssr-middleware.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.ssr-middleware.es.js +44 -37
- package/dist/custom-elements-runtime.ssr-middleware.es.js.map +1 -1
- package/dist/custom-elements-runtime.ssr.cjs.js +1 -4
- package/dist/custom-elements-runtime.ssr.es.js +11 -176
- package/dist/custom-elements-runtime.store.cjs.js +3 -2
- package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.store.es.js +17 -11
- package/dist/custom-elements-runtime.store.es.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.cjs.js +3 -2
- package/dist/custom-elements-runtime.transitions.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.es.js +55 -120
- package/dist/custom-elements-runtime.transitions.es.js.map +1 -1
- package/dist/custom-elements-runtime.vite-plugin.cjs.js +3 -2
- package/dist/custom-elements-runtime.vite-plugin.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.vite-plugin.es.js +54 -75
- package/dist/custom-elements-runtime.vite-plugin.es.js.map +1 -1
- package/dist/hooks-_3xP4G2N.js +1189 -0
- package/dist/hooks-_3xP4G2N.js.map +1 -0
- package/dist/hooks-fYQgZk2g.cjs +7 -0
- package/dist/hooks-fYQgZk2g.cjs.map +1 -0
- package/dist/logger-BYIN7ysT.cjs +3 -0
- package/dist/logger-BYIN7ysT.cjs.map +1 -0
- package/dist/logger-L25axmB-.js +41 -0
- package/dist/logger-L25axmB-.js.map +1 -0
- package/dist/namespace-helpers-Bf7rm9JV.cjs +3 -0
- package/dist/namespace-helpers-Bf7rm9JV.cjs.map +1 -0
- package/dist/namespace-helpers-BucDdgz_.js +61 -0
- package/dist/namespace-helpers-BucDdgz_.js.map +1 -0
- package/dist/reset.css +1 -1
- package/dist/ssr-B3lxl1vr.js +165 -0
- package/dist/ssr-B3lxl1vr.js.map +1 -0
- package/dist/ssr-DtD9e5iA.cjs +5 -0
- package/dist/ssr-DtD9e5iA.cjs.map +1 -0
- package/dist/style-Bjn8zDiZ.cjs +56 -0
- package/dist/style-Bjn8zDiZ.cjs.map +1 -0
- package/dist/{style-BmyOIMcU.js → style-DuDoj_xK.js} +724 -876
- package/dist/style-DuDoj_xK.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/template-compiler-BB4JJdqk.cjs +23 -0
- package/dist/template-compiler-BB4JJdqk.cjs.map +1 -0
- package/dist/template-compiler-Cs5axmn4.js +3236 -0
- package/dist/template-compiler-Cs5axmn4.js.map +1 -0
- package/dist/variables.css +1 -1
- package/package.json +7 -7
- package/dist/css-utils-Cg4o1MqY.js.map +0 -1
- package/dist/css-utils-RqkyBWft.cjs.map +0 -1
- package/dist/custom-elements-runtime.ssr.cjs.js.map +0 -1
- package/dist/custom-elements-runtime.ssr.es.js.map +0 -1
- package/dist/hooks-BH-CpUun.js +0 -1474
- package/dist/hooks-BH-CpUun.js.map +0 -1
- package/dist/hooks-NOFG9QRQ.cjs +0 -6
- package/dist/hooks-NOFG9QRQ.cjs.map +0 -1
- package/dist/logger-BvkEbVM4.js +0 -48
- package/dist/logger-BvkEbVM4.js.map +0 -1
- package/dist/logger-CSALKaYm.cjs +0 -2
- package/dist/logger-CSALKaYm.cjs.map +0 -1
- package/dist/namespace-helpers-D4wC2-qA.js +0 -61
- package/dist/namespace-helpers-D4wC2-qA.js.map +0 -1
- package/dist/namespace-helpers-ckeEOxpR.cjs +0 -2
- package/dist/namespace-helpers-ckeEOxpR.cjs.map +0 -1
- package/dist/style-BmyOIMcU.js.map +0 -1
- package/dist/style-D40DsIqJ.cjs +0 -55
- package/dist/style-D40DsIqJ.cjs.map +0 -1
- package/dist/template-compiler-CDvhsHia.cjs +0 -22
- package/dist/template-compiler-CDvhsHia.cjs.map +0 -1
- package/dist/template-compiler-DiE69FLO.js +0 -3724
- package/dist/template-compiler-DiE69FLO.js.map +0 -1
|
@@ -0,0 +1,1189 @@
|
|
|
1
|
+
import { r as p, t as M } from "./logger-L25axmB-.js";
|
|
2
|
+
import { d as q, f as G } from "./css-utils-CC43BbEy.js";
|
|
3
|
+
function X() {
|
|
4
|
+
const e = (() => {
|
|
5
|
+
try {
|
|
6
|
+
return globalThis.process?.env?.NODE_ENV;
|
|
7
|
+
} catch {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
})(), t = (() => {
|
|
11
|
+
try {
|
|
12
|
+
if (typeof window > "u") return {
|
|
13
|
+
vitest: !1,
|
|
14
|
+
cypress: !1
|
|
15
|
+
};
|
|
16
|
+
const n = window;
|
|
17
|
+
return {
|
|
18
|
+
vitest: !!n.__vitest__,
|
|
19
|
+
cypress: !!n.Cypress
|
|
20
|
+
};
|
|
21
|
+
} catch {
|
|
22
|
+
return {
|
|
23
|
+
vitest: !1,
|
|
24
|
+
cypress: !1
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
})();
|
|
28
|
+
return {
|
|
29
|
+
isTest: e === "test" || t.vitest || t.cypress,
|
|
30
|
+
isVitest: t.vitest,
|
|
31
|
+
isCypress: t.cypress
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
var K = class {
|
|
35
|
+
pendingUpdates = /* @__PURE__ */ new Map();
|
|
36
|
+
isFlushScheduled = !1;
|
|
37
|
+
isFlushing = !1;
|
|
38
|
+
testEnv;
|
|
39
|
+
lastCleanup = 0;
|
|
40
|
+
CLEANUP_INTERVAL = 300 * 1e3;
|
|
41
|
+
MAX_PENDING_SIZE = 1e4;
|
|
42
|
+
pendingIdleUpdates = /* @__PURE__ */ new Map();
|
|
43
|
+
idleCallbackHandle = null;
|
|
44
|
+
constructor() {
|
|
45
|
+
this.testEnv = X(), this.schedulePeriodicCleanup();
|
|
46
|
+
}
|
|
47
|
+
schedule(e, t) {
|
|
48
|
+
const n = t || e;
|
|
49
|
+
this.pendingUpdates.size >= this.MAX_PENDING_SIZE && this.performEmergencyCleanup(), this.pendingUpdates.set(n, e), this.isFlushScheduled || this.scheduleFlush();
|
|
50
|
+
}
|
|
51
|
+
scheduleFlush() {
|
|
52
|
+
this.isFlushScheduled = !0, this.testEnv.isTest && !this.isFlushing ? this.flush() : queueMicrotask(() => this.flush());
|
|
53
|
+
}
|
|
54
|
+
flush() {
|
|
55
|
+
if (this.isFlushing) return;
|
|
56
|
+
this.isFlushing = !0;
|
|
57
|
+
const e = this.pendingUpdates;
|
|
58
|
+
this.pendingUpdates = /* @__PURE__ */ new Map(), this.isFlushScheduled = !1;
|
|
59
|
+
try {
|
|
60
|
+
for (const t of e.values()) try {
|
|
61
|
+
t();
|
|
62
|
+
} catch (n) {
|
|
63
|
+
M("Error in batched update:", n);
|
|
64
|
+
}
|
|
65
|
+
} finally {
|
|
66
|
+
this.isFlushing = !1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
flushImmediately() {
|
|
70
|
+
this.pendingUpdates.size !== 0 && (this.isFlushScheduled = !1, this.flush());
|
|
71
|
+
}
|
|
72
|
+
get pendingCount() {
|
|
73
|
+
return this.pendingUpdates.size;
|
|
74
|
+
}
|
|
75
|
+
get hasPendingUpdates() {
|
|
76
|
+
return this.pendingUpdates.size > 0;
|
|
77
|
+
}
|
|
78
|
+
get isFlushingUpdates() {
|
|
79
|
+
return this.isFlushing;
|
|
80
|
+
}
|
|
81
|
+
schedulePeriodicCleanup() {
|
|
82
|
+
if (this.testEnv.isTest) return;
|
|
83
|
+
const e = () => {
|
|
84
|
+
this.performPeriodicCleanup(), this.testEnv.isTest || setTimeout(e, this.CLEANUP_INTERVAL);
|
|
85
|
+
};
|
|
86
|
+
setTimeout(e, this.CLEANUP_INTERVAL);
|
|
87
|
+
}
|
|
88
|
+
performPeriodicCleanup() {
|
|
89
|
+
const e = Date.now();
|
|
90
|
+
e - this.lastCleanup < this.CLEANUP_INTERVAL || (this.pendingUpdates.size > 100 && p(`Scheduler has ${this.pendingUpdates.size} pending updates. Consider investigating.`), this.lastCleanup = e);
|
|
91
|
+
}
|
|
92
|
+
performEmergencyCleanup(e = this.pendingUpdates) {
|
|
93
|
+
p("Scheduler emergency cleanup: too many pending updates, clearing oldest entries");
|
|
94
|
+
const t = Array.from(e.entries()), n = Math.floor(t.length / 2);
|
|
95
|
+
for (let r = 0; r < n; r++) e.delete(t[r][0]);
|
|
96
|
+
}
|
|
97
|
+
scheduleWithPriority(e, t = "normal", n) {
|
|
98
|
+
if (t === "immediate") {
|
|
99
|
+
try {
|
|
100
|
+
e();
|
|
101
|
+
} catch (s) {
|
|
102
|
+
M("Error in immediate update:", s);
|
|
103
|
+
}
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (t === "idle") {
|
|
107
|
+
const s = n ?? e;
|
|
108
|
+
this.pendingIdleUpdates.size >= this.MAX_PENDING_SIZE && this.performEmergencyCleanup(this.pendingIdleUpdates), this.pendingIdleUpdates.set(s, e), this.scheduleIdleFlush();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const r = n ?? e;
|
|
112
|
+
this.pendingUpdates.size >= this.MAX_PENDING_SIZE && this.performEmergencyCleanup(), this.pendingUpdates.set(r, e), this.isFlushScheduled || (this.isFlushScheduled = !0, queueMicrotask(() => this.flush()));
|
|
113
|
+
}
|
|
114
|
+
scheduleIdleFlush() {
|
|
115
|
+
if (this.idleCallbackHandle === null) {
|
|
116
|
+
if (this.testEnv.isTest) {
|
|
117
|
+
this.idleCallbackHandle = setTimeout(() => {
|
|
118
|
+
this.idleCallbackHandle = null, this.flushIdleUpdates(null);
|
|
119
|
+
}, 0);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
typeof requestIdleCallback < "u" ? this.idleCallbackHandle = requestIdleCallback((e) => {
|
|
123
|
+
this.idleCallbackHandle = null, this.flushIdleUpdates(e);
|
|
124
|
+
}, { timeout: 2e3 }) : this.idleCallbackHandle = setTimeout(() => {
|
|
125
|
+
this.idleCallbackHandle = null;
|
|
126
|
+
const e = Date.now();
|
|
127
|
+
this.flushIdleUpdates({
|
|
128
|
+
timeRemaining: () => Math.max(0, 50 - (Date.now() - e)),
|
|
129
|
+
didTimeout: !1
|
|
130
|
+
});
|
|
131
|
+
}, 5);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
flushIdleUpdates(e) {
|
|
135
|
+
const t = Array.from(this.pendingIdleUpdates.entries());
|
|
136
|
+
this.pendingIdleUpdates = /* @__PURE__ */ new Map();
|
|
137
|
+
for (let n = 0; n < t.length; n++) {
|
|
138
|
+
if (e && !e.didTimeout && e.timeRemaining() <= 0) {
|
|
139
|
+
for (let r = n; r < t.length; r++) this.pendingIdleUpdates.set(t[r][0], t[r][1]);
|
|
140
|
+
this.scheduleIdleFlush();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
t[n][1]();
|
|
145
|
+
} catch (r) {
|
|
146
|
+
M("Error in idle update:", r);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}, k = new K();
|
|
151
|
+
function Z(e, t) {
|
|
152
|
+
k.schedule(e, t);
|
|
153
|
+
}
|
|
154
|
+
function ae(e, t = "normal", n) {
|
|
155
|
+
k.scheduleWithPriority(e, t, n);
|
|
156
|
+
}
|
|
157
|
+
function ce() {
|
|
158
|
+
k.flushImmediately();
|
|
159
|
+
}
|
|
160
|
+
function ue() {
|
|
161
|
+
return new Promise((e) => {
|
|
162
|
+
let n = 0;
|
|
163
|
+
for (; k.hasPendingUpdates && n < 100; )
|
|
164
|
+
k.flushImmediately(), n++;
|
|
165
|
+
n >= 100 && p("[nextTick] Maximum flush iterations reached — possible circular update loop. Check for watchers or computed values that unconditionally mutate reactive state."), queueMicrotask(e);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
var O = /* @__PURE__ */ new WeakSet(), B = class {
|
|
169
|
+
static cache = /* @__PURE__ */ new WeakMap();
|
|
170
|
+
static arrayHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
171
|
+
static objectHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
172
|
+
static getOrCreateProxy(e, t, n = !1) {
|
|
173
|
+
const r = this.cache.get(e);
|
|
174
|
+
if (r) return r;
|
|
175
|
+
const s = n ? this.getOrCreateArrayHandler(t) : this.getOrCreateObjectHandler(t), o = new Proxy(e, s);
|
|
176
|
+
try {
|
|
177
|
+
W.markAsProxy(o);
|
|
178
|
+
} catch {
|
|
179
|
+
}
|
|
180
|
+
return this.cache.set(e, o), o;
|
|
181
|
+
}
|
|
182
|
+
static getOrCreateArrayHandler(e) {
|
|
183
|
+
return this.arrayHandlerCache.has(e) || this.arrayHandlerCache.set(e, {
|
|
184
|
+
get: (t, n, r) => {
|
|
185
|
+
const s = Reflect.get(t, n, r);
|
|
186
|
+
return typeof s == "function" && typeof n == "string" && [
|
|
187
|
+
"push",
|
|
188
|
+
"pop",
|
|
189
|
+
"shift",
|
|
190
|
+
"unshift",
|
|
191
|
+
"splice",
|
|
192
|
+
"sort",
|
|
193
|
+
"reverse",
|
|
194
|
+
"fill",
|
|
195
|
+
"copyWithin"
|
|
196
|
+
].includes(n) ? function(...o) {
|
|
197
|
+
const i = s.apply(t, o);
|
|
198
|
+
return e.triggerUpdate(), i;
|
|
199
|
+
} : s !== null && typeof s == "object" && typeof n == "string" ? e.makeReactiveValue(s) : s;
|
|
200
|
+
},
|
|
201
|
+
set: (t, n, r) => (t[n] = e.makeReactiveValue(r), e.triggerUpdate(), !0),
|
|
202
|
+
deleteProperty: (t, n) => (delete t[n], e.triggerUpdate(), !0)
|
|
203
|
+
}), this.arrayHandlerCache.get(e);
|
|
204
|
+
}
|
|
205
|
+
static getOrCreateObjectHandler(e) {
|
|
206
|
+
return this.objectHandlerCache.has(e) || this.objectHandlerCache.set(e, {
|
|
207
|
+
get: (t, n, r) => {
|
|
208
|
+
const s = Reflect.get(t, n, r);
|
|
209
|
+
return s !== null && typeof s == "object" && typeof n == "string" ? e.makeReactiveValue(s) : s;
|
|
210
|
+
},
|
|
211
|
+
set: (t, n, r) => (t[n] = e.makeReactiveValue(r), e.triggerUpdate(), !0),
|
|
212
|
+
deleteProperty: (t, n) => (delete t[n], e.triggerUpdate(), !0)
|
|
213
|
+
}), this.objectHandlerCache.get(e);
|
|
214
|
+
}
|
|
215
|
+
static hasProxy(e) {
|
|
216
|
+
return this.cache.has(e);
|
|
217
|
+
}
|
|
218
|
+
static clear() {
|
|
219
|
+
this.cache = /* @__PURE__ */ new WeakMap(), this.arrayHandlerCache = /* @__PURE__ */ new WeakMap(), this.objectHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
220
|
+
}
|
|
221
|
+
static getStats() {
|
|
222
|
+
return { hasCachedProxies: this.cache instanceof WeakMap };
|
|
223
|
+
}
|
|
224
|
+
}, W = class {
|
|
225
|
+
static contextCache = /* @__PURE__ */ new WeakMap();
|
|
226
|
+
static createReactiveProxy(e, t, n) {
|
|
227
|
+
try {
|
|
228
|
+
if (O.has(e)) return e;
|
|
229
|
+
} catch {
|
|
230
|
+
}
|
|
231
|
+
const r = Array.isArray(e);
|
|
232
|
+
let s = this.contextCache.get(t);
|
|
233
|
+
s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(t, s));
|
|
234
|
+
let o = s.get(n);
|
|
235
|
+
return o || (o = {
|
|
236
|
+
triggerUpdate: t,
|
|
237
|
+
makeReactiveValue: n
|
|
238
|
+
}, s.set(n, o)), B.getOrCreateProxy(e, o, r);
|
|
239
|
+
}
|
|
240
|
+
static markAsProxy(e) {
|
|
241
|
+
if (e)
|
|
242
|
+
try {
|
|
243
|
+
O.add(e);
|
|
244
|
+
} catch {
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}, N = !1;
|
|
248
|
+
function d() {
|
|
249
|
+
return N;
|
|
250
|
+
}
|
|
251
|
+
function le() {
|
|
252
|
+
N && p("[CER] beginDiscoveryRender() called while a discovery render is already active. This usually means a component was registered inside another component's render function. Ensure component() calls are at module top-level."), N = !0;
|
|
253
|
+
}
|
|
254
|
+
function fe() {
|
|
255
|
+
N = !1;
|
|
256
|
+
}
|
|
257
|
+
var Y = 0;
|
|
258
|
+
function x(e) {
|
|
259
|
+
return `${e}-${++Y}`;
|
|
260
|
+
}
|
|
261
|
+
var J = class {
|
|
262
|
+
currentComponentStack = [];
|
|
263
|
+
componentData = /* @__PURE__ */ new Map();
|
|
264
|
+
stateStorage = /* @__PURE__ */ new Map();
|
|
265
|
+
trackingDisabled = !1;
|
|
266
|
+
setCurrentComponent(e, t) {
|
|
267
|
+
if (this.currentComponentStack.push(e), !this.componentData.has(e)) this.componentData.set(e, {
|
|
268
|
+
dependencies: /* @__PURE__ */ new Set(),
|
|
269
|
+
renderFn: t,
|
|
270
|
+
stateIndex: 0,
|
|
271
|
+
lastWarnTime: 0,
|
|
272
|
+
watchers: /* @__PURE__ */ new Map()
|
|
273
|
+
});
|
|
274
|
+
else {
|
|
275
|
+
const n = this.componentData.get(e);
|
|
276
|
+
if (n.watchers && n.watchers.size) {
|
|
277
|
+
for (const r of n.watchers.values()) try {
|
|
278
|
+
this.cleanup(r);
|
|
279
|
+
} catch {
|
|
280
|
+
}
|
|
281
|
+
n.watchers.clear();
|
|
282
|
+
}
|
|
283
|
+
n.renderFn = t, n.stateIndex = 0;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
clearCurrentComponent() {
|
|
287
|
+
this.currentComponentStack.pop();
|
|
288
|
+
}
|
|
289
|
+
getCurrentComponentId() {
|
|
290
|
+
return this.currentComponentStack.length ? this.currentComponentStack[this.currentComponentStack.length - 1] : null;
|
|
291
|
+
}
|
|
292
|
+
registerWatcher(e, t) {
|
|
293
|
+
const n = this.componentData.get(e);
|
|
294
|
+
n && n.watchers.set(t, t);
|
|
295
|
+
}
|
|
296
|
+
disableTracking() {
|
|
297
|
+
this.trackingDisabled = !0;
|
|
298
|
+
}
|
|
299
|
+
enableTracking() {
|
|
300
|
+
this.trackingDisabled = !1;
|
|
301
|
+
}
|
|
302
|
+
isRenderingComponent() {
|
|
303
|
+
return this.currentComponentStack.length > 0;
|
|
304
|
+
}
|
|
305
|
+
shouldEmitRenderWarning() {
|
|
306
|
+
const e = this.currentComponentStack.length ? this.currentComponentStack[this.currentComponentStack.length - 1] : null;
|
|
307
|
+
if (!e) return !0;
|
|
308
|
+
const t = this.componentData.get(e);
|
|
309
|
+
if (!t) return !0;
|
|
310
|
+
const n = Date.now();
|
|
311
|
+
return n - t.lastWarnTime < 1e3 ? !1 : (t.lastWarnTime = n, !0);
|
|
312
|
+
}
|
|
313
|
+
withoutTracking(e) {
|
|
314
|
+
const t = this.trackingDisabled;
|
|
315
|
+
this.trackingDisabled = !0;
|
|
316
|
+
try {
|
|
317
|
+
return e();
|
|
318
|
+
} finally {
|
|
319
|
+
this.trackingDisabled = t;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
getOrCreateState(e) {
|
|
323
|
+
const t = this.currentComponentStack.length ? this.currentComponentStack[this.currentComponentStack.length - 1] : null;
|
|
324
|
+
if (!t) return new A(e);
|
|
325
|
+
const n = this.componentData.get(t);
|
|
326
|
+
if (!n) return new A(e);
|
|
327
|
+
const r = `${t}:${n.stateIndex++}`;
|
|
328
|
+
let s = this.stateStorage.get(r);
|
|
329
|
+
return s || (s = new A(e), this.stateStorage.set(r, s)), s;
|
|
330
|
+
}
|
|
331
|
+
trackDependency(e) {
|
|
332
|
+
if (this.trackingDisabled) return;
|
|
333
|
+
const t = this.currentComponentStack.length ? this.currentComponentStack[this.currentComponentStack.length - 1] : null;
|
|
334
|
+
if (!t) return;
|
|
335
|
+
const n = this.componentData.get(t);
|
|
336
|
+
n && (n.dependencies.add(e), e.addDependent(t));
|
|
337
|
+
}
|
|
338
|
+
propagateDependencies(e) {
|
|
339
|
+
if (this.trackingDisabled) return;
|
|
340
|
+
const t = this.currentComponentStack.length ? this.currentComponentStack[this.currentComponentStack.length - 1] : null;
|
|
341
|
+
if (!t || t === e) return;
|
|
342
|
+
const n = this.componentData.get(e);
|
|
343
|
+
if (!n) return;
|
|
344
|
+
const r = this.componentData.get(t);
|
|
345
|
+
if (r)
|
|
346
|
+
for (const s of n.dependencies)
|
|
347
|
+
r.dependencies.add(s), s.addDependent(t);
|
|
348
|
+
}
|
|
349
|
+
triggerUpdate(e) {
|
|
350
|
+
const t = e.getDependents();
|
|
351
|
+
for (const n of t) {
|
|
352
|
+
const r = this.componentData.get(n);
|
|
353
|
+
r && Z(r.renderFn, n);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
cleanup(e) {
|
|
357
|
+
const t = this.componentData.get(e);
|
|
358
|
+
if (t) {
|
|
359
|
+
for (const r of t.dependencies) r.removeDependent(e);
|
|
360
|
+
this.componentData.delete(e);
|
|
361
|
+
}
|
|
362
|
+
const n = e + ":";
|
|
363
|
+
for (const r of this.stateStorage.keys()) r.startsWith(n) && this.stateStorage.delete(r);
|
|
364
|
+
}
|
|
365
|
+
}, f = new J(), A = class {
|
|
366
|
+
_value;
|
|
367
|
+
_rawValue;
|
|
368
|
+
dependents = /* @__PURE__ */ new Set();
|
|
369
|
+
constructor(e) {
|
|
370
|
+
this._rawValue = e, this._value = this.makeReactive(e);
|
|
371
|
+
try {
|
|
372
|
+
Object.defineProperty(this, /* @__PURE__ */ Symbol.for("@cer/ReactiveState"), {
|
|
373
|
+
value: !0,
|
|
374
|
+
enumerable: !1,
|
|
375
|
+
configurable: !1
|
|
376
|
+
});
|
|
377
|
+
} catch {
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
get value() {
|
|
381
|
+
return f.trackDependency(this), this._value;
|
|
382
|
+
}
|
|
383
|
+
set value(e) {
|
|
384
|
+
Object.is(e, this._rawValue) || (f.isRenderingComponent() && f.shouldEmitRenderWarning() && p(`🚨 State modification detected during render! This can cause infinite loops.
|
|
385
|
+
• Move state updates to event handlers
|
|
386
|
+
• Use watchEffect/watch for side effects
|
|
387
|
+
• Ensure computed properties don't modify state`), this._rawValue = e, this._value = this.makeReactive(e), f.triggerUpdate(this));
|
|
388
|
+
}
|
|
389
|
+
peek() {
|
|
390
|
+
return this._value;
|
|
391
|
+
}
|
|
392
|
+
initSilent(e) {
|
|
393
|
+
this._rawValue = e, this._value = e;
|
|
394
|
+
}
|
|
395
|
+
addDependent(e) {
|
|
396
|
+
this.dependents.add(e);
|
|
397
|
+
}
|
|
398
|
+
removeDependent(e) {
|
|
399
|
+
this.dependents.delete(e);
|
|
400
|
+
}
|
|
401
|
+
getDependents() {
|
|
402
|
+
return this.dependents;
|
|
403
|
+
}
|
|
404
|
+
makeReactive(e) {
|
|
405
|
+
return e === null || typeof e != "object" || typeof Node < "u" && e instanceof Node || typeof Element < "u" && e instanceof Element || typeof HTMLElement < "u" && e instanceof HTMLElement ? e : W.createReactiveProxy(e, () => f.triggerUpdate(this), (t) => this.makeReactive(t));
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
function de(e) {
|
|
409
|
+
return f.getOrCreateState(e === void 0 ? null : e);
|
|
410
|
+
}
|
|
411
|
+
function y(e) {
|
|
412
|
+
if (!e || typeof e != "object") return !1;
|
|
413
|
+
try {
|
|
414
|
+
const t = /* @__PURE__ */ Symbol.for("@cer/ReactiveState");
|
|
415
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
416
|
+
} catch {
|
|
417
|
+
return !1;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function he(e) {
|
|
421
|
+
let t, n = !0;
|
|
422
|
+
const r = x("computed"), s = () => {
|
|
423
|
+
n = !0;
|
|
424
|
+
};
|
|
425
|
+
try {
|
|
426
|
+
const o = f.getCurrentComponentId();
|
|
427
|
+
o && f.registerWatcher(o, r);
|
|
428
|
+
} catch {
|
|
429
|
+
}
|
|
430
|
+
return f.setCurrentComponent(r, s), t = e(), f.clearCurrentComponent(), n = !1, { get value() {
|
|
431
|
+
return n && (f.setCurrentComponent(r, s), t = e(), f.clearCurrentComponent(), n = !1), f.propagateDependencies(r), t;
|
|
432
|
+
} };
|
|
433
|
+
}
|
|
434
|
+
function pe(e) {
|
|
435
|
+
if (d()) return () => {
|
|
436
|
+
};
|
|
437
|
+
const t = x("effect");
|
|
438
|
+
try {
|
|
439
|
+
const r = f.getCurrentComponentId();
|
|
440
|
+
r && f.registerWatcher(r, t);
|
|
441
|
+
} catch {
|
|
442
|
+
}
|
|
443
|
+
const n = () => {
|
|
444
|
+
f.setCurrentComponent(t, n);
|
|
445
|
+
try {
|
|
446
|
+
e();
|
|
447
|
+
} finally {
|
|
448
|
+
f.clearCurrentComponent();
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
return n(), () => {
|
|
452
|
+
f.cleanup(t);
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
var I = 50;
|
|
456
|
+
function D(e, t = /* @__PURE__ */ new WeakMap(), n = 0) {
|
|
457
|
+
if (e === null || typeof e != "object") return e;
|
|
458
|
+
const r = e;
|
|
459
|
+
if (t.has(r)) return t.get(r);
|
|
460
|
+
if (n > I)
|
|
461
|
+
return p(`[watch] Deep clone exceeded ${I} nesting levels. Returning a reference at this depth instead of cloning further. Consider restructuring your state or switching to a shallow watch.`), e;
|
|
462
|
+
if (typeof Node < "u" && r instanceof Node) return e;
|
|
463
|
+
if (r instanceof Date) return new Date(r.getTime());
|
|
464
|
+
if (Array.isArray(r)) {
|
|
465
|
+
const o = [];
|
|
466
|
+
t.set(r, o);
|
|
467
|
+
for (let i = 0; i < r.length; i++) o.push(D(r[i], t, n + 1));
|
|
468
|
+
return o;
|
|
469
|
+
}
|
|
470
|
+
const s = {};
|
|
471
|
+
t.set(r, s);
|
|
472
|
+
for (const o of Object.keys(r)) try {
|
|
473
|
+
s[o] = D(r[o], t, n + 1);
|
|
474
|
+
} catch {
|
|
475
|
+
}
|
|
476
|
+
return s;
|
|
477
|
+
}
|
|
478
|
+
function ge(e, t, n) {
|
|
479
|
+
if (d()) return () => {
|
|
480
|
+
};
|
|
481
|
+
let r;
|
|
482
|
+
const s = y(e) ? () => e.value : e, o = x("watch");
|
|
483
|
+
try {
|
|
484
|
+
const a = f.getCurrentComponentId();
|
|
485
|
+
a && f.registerWatcher(a, o);
|
|
486
|
+
} catch {
|
|
487
|
+
}
|
|
488
|
+
const i = () => {
|
|
489
|
+
f.setCurrentComponent(o, i);
|
|
490
|
+
const a = s();
|
|
491
|
+
if (f.clearCurrentComponent(), n?.deep) {
|
|
492
|
+
const c = f.withoutTracking(() => D(a));
|
|
493
|
+
t(c, r), r = c;
|
|
494
|
+
} else a !== r && (t(a, r), r = a);
|
|
495
|
+
};
|
|
496
|
+
return f.setCurrentComponent(o, i), r = s(), f.clearCurrentComponent(), n?.deep && (r = f.withoutTracking(() => D(r))), n && n.immediate && t(r, void 0), () => {
|
|
497
|
+
f.cleanup(o);
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
var me = (e) => {
|
|
501
|
+
try {
|
|
502
|
+
e();
|
|
503
|
+
} catch {
|
|
504
|
+
}
|
|
505
|
+
}, E = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), P = 500, S, $, j = !1, H = !1, U, Q = !!globalThis.process?.versions?.node;
|
|
506
|
+
function ee(e) {
|
|
507
|
+
if (E.has(e)) return E.get(e);
|
|
508
|
+
const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
509
|
+
return E.size < P && E.set(e, t), t;
|
|
510
|
+
}
|
|
511
|
+
function L(e) {
|
|
512
|
+
if (v.has(e)) return v.get(e);
|
|
513
|
+
const t = e.replace(/-([a-z])/g, (n, r) => r.toUpperCase());
|
|
514
|
+
return v.size < P && v.set(e, t), t;
|
|
515
|
+
}
|
|
516
|
+
function ye(e) {
|
|
517
|
+
if (typeof e == "string") {
|
|
518
|
+
if (_.has(e)) return _.get(e);
|
|
519
|
+
const t = e.replace(/[&<>"']/g, (n) => ({
|
|
520
|
+
"&": "&",
|
|
521
|
+
"<": "<",
|
|
522
|
+
">": ">",
|
|
523
|
+
'"': """,
|
|
524
|
+
"'": "'"
|
|
525
|
+
})[n]);
|
|
526
|
+
return t !== e && _.size < P && _.set(e, t), t;
|
|
527
|
+
}
|
|
528
|
+
return e;
|
|
529
|
+
}
|
|
530
|
+
function g(e) {
|
|
531
|
+
if (!e) return "";
|
|
532
|
+
const t = String(e);
|
|
533
|
+
if (typeof document < "u" && typeof document.createElement == "function") {
|
|
534
|
+
const a = t.replace(/</g, "").replace(/>/g, ""), c = U || (U = document.createElement("div"));
|
|
535
|
+
try {
|
|
536
|
+
g._el = c;
|
|
537
|
+
} catch {
|
|
538
|
+
}
|
|
539
|
+
return c.innerHTML = a, (c.textContent || "").replace(new RegExp("", "g"), "<").replace(new RegExp("", "g"), ">");
|
|
540
|
+
}
|
|
541
|
+
const n = {
|
|
542
|
+
lt: "<",
|
|
543
|
+
gt: ">",
|
|
544
|
+
amp: "&",
|
|
545
|
+
quot: '"',
|
|
546
|
+
apos: "'",
|
|
547
|
+
nbsp: " "
|
|
548
|
+
}, r = S ?? g._namedMap;
|
|
549
|
+
let s = r;
|
|
550
|
+
if (!s && Q) try {
|
|
551
|
+
const o = globalThis.require;
|
|
552
|
+
if (typeof o == "function") for (const i of [
|
|
553
|
+
"@jasonshimmy/custom-elements-runtime/entities.json",
|
|
554
|
+
"../../entities.json",
|
|
555
|
+
"../../../entities.json",
|
|
556
|
+
"../entities.json",
|
|
557
|
+
"./entities.json"
|
|
558
|
+
]) try {
|
|
559
|
+
const a = o(i);
|
|
560
|
+
if (a && typeof a == "object") {
|
|
561
|
+
s = a;
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
} catch {
|
|
565
|
+
}
|
|
566
|
+
} catch {
|
|
567
|
+
}
|
|
568
|
+
if (!s) {
|
|
569
|
+
s = n, j = !0;
|
|
570
|
+
try {
|
|
571
|
+
g._usedFallback = !0;
|
|
572
|
+
} catch {
|
|
573
|
+
}
|
|
574
|
+
const o = g._namedMapLoader ?? $;
|
|
575
|
+
o && o().then((i) => {
|
|
576
|
+
S = i;
|
|
577
|
+
try {
|
|
578
|
+
g._namedMap = i;
|
|
579
|
+
} catch {
|
|
580
|
+
}
|
|
581
|
+
}).catch(() => {
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
if ((j || g._usedFallback) && !(H || g._warnedFallback)) {
|
|
585
|
+
H = !0;
|
|
586
|
+
try {
|
|
587
|
+
g._warnedFallback = !0;
|
|
588
|
+
} catch {
|
|
589
|
+
}
|
|
590
|
+
try {
|
|
591
|
+
p("decodeEntities: using small SSR fallback entity map. Register the full entities.json via registerEntityMap(entities) on the server to enable full HTML5 named-entity decoding.");
|
|
592
|
+
} catch {
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g, (o, i) => {
|
|
596
|
+
if (i.charCodeAt(0) === 35) {
|
|
597
|
+
const c = (i.charAt(1) || "").toLowerCase() === "x" ? parseInt(i.slice(2), 16) : parseInt(i.slice(1), 10);
|
|
598
|
+
return Number.isNaN(c) ? `&${i};` : String.fromCodePoint(c);
|
|
599
|
+
}
|
|
600
|
+
const a = s[i] ?? (r && r[i]);
|
|
601
|
+
return a !== void 0 ? a : `&${i};`;
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
async function V() {
|
|
605
|
+
const e = [
|
|
606
|
+
"@jasonshimmy",
|
|
607
|
+
"custom-elements-runtime",
|
|
608
|
+
"entities.json"
|
|
609
|
+
].join("/");
|
|
610
|
+
try {
|
|
611
|
+
const t = await import(
|
|
612
|
+
/* @vite-ignore */
|
|
613
|
+
e
|
|
614
|
+
);
|
|
615
|
+
return t && (t.default || t);
|
|
616
|
+
} catch {
|
|
617
|
+
try {
|
|
618
|
+
const t = [
|
|
619
|
+
e,
|
|
620
|
+
"./entities.json",
|
|
621
|
+
"../../entities.json",
|
|
622
|
+
"../../../entities.json"
|
|
623
|
+
];
|
|
624
|
+
for (const n of t) try {
|
|
625
|
+
const r = await import(
|
|
626
|
+
/* @vite-ignore */
|
|
627
|
+
n
|
|
628
|
+
);
|
|
629
|
+
if (r) return r && (r.default || r);
|
|
630
|
+
} catch {
|
|
631
|
+
}
|
|
632
|
+
return {
|
|
633
|
+
lt: "<",
|
|
634
|
+
gt: ">",
|
|
635
|
+
amp: "&",
|
|
636
|
+
quot: '"',
|
|
637
|
+
apos: "'",
|
|
638
|
+
nbsp: " "
|
|
639
|
+
};
|
|
640
|
+
} catch {
|
|
641
|
+
return {
|
|
642
|
+
lt: "<",
|
|
643
|
+
gt: ">",
|
|
644
|
+
amp: "&",
|
|
645
|
+
quot: '"',
|
|
646
|
+
apos: "'",
|
|
647
|
+
nbsp: " "
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
$ = V;
|
|
653
|
+
g._namedMapLoader = V;
|
|
654
|
+
function be(e, t) {
|
|
655
|
+
!e || typeof e != "object" || S && !t?.overwrite || (S = e);
|
|
656
|
+
}
|
|
657
|
+
function Ce() {
|
|
658
|
+
S = void 0;
|
|
659
|
+
}
|
|
660
|
+
function we(e) {
|
|
661
|
+
const t = String(e);
|
|
662
|
+
return {
|
|
663
|
+
__unsafeHTML: t,
|
|
664
|
+
__rawHTML: t
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
function ke(e) {
|
|
668
|
+
return !!e && (typeof e.__unsafeHTML == "string" || typeof e.__rawHTML == "string");
|
|
669
|
+
}
|
|
670
|
+
function Se(e, t) {
|
|
671
|
+
if (typeof t == "string") {
|
|
672
|
+
if (t === "") return;
|
|
673
|
+
const n = t.split(".");
|
|
674
|
+
let r = e;
|
|
675
|
+
for (const s of n) {
|
|
676
|
+
if (r == null || typeof r != "object") {
|
|
677
|
+
r = void 0;
|
|
678
|
+
break;
|
|
679
|
+
}
|
|
680
|
+
r = r[s];
|
|
681
|
+
}
|
|
682
|
+
return y(r) ? r.value : r;
|
|
683
|
+
}
|
|
684
|
+
return t;
|
|
685
|
+
}
|
|
686
|
+
function Ee(e, t, n) {
|
|
687
|
+
const r = String(t).split("."), s = r.pop();
|
|
688
|
+
if (!s) return;
|
|
689
|
+
const o = r.reduce((i, a) => (i[a] == null && (i[a] = {}), i[a]), e);
|
|
690
|
+
y(o[s]) ? o[s].value = n : o[s] = n;
|
|
691
|
+
}
|
|
692
|
+
function te(e) {
|
|
693
|
+
try {
|
|
694
|
+
if (e && typeof e == "object") {
|
|
695
|
+
if (y(e)) return e.value;
|
|
696
|
+
if ("value" in e) {
|
|
697
|
+
const t = e.value;
|
|
698
|
+
return t == null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? t : e;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
} catch {
|
|
702
|
+
}
|
|
703
|
+
return e;
|
|
704
|
+
}
|
|
705
|
+
function ve(e) {
|
|
706
|
+
const t = te(e);
|
|
707
|
+
if (t == null) return null;
|
|
708
|
+
const n = typeof t;
|
|
709
|
+
return n === "string" || n === "number" || n === "boolean" ? String(t) : null;
|
|
710
|
+
}
|
|
711
|
+
function _e(e) {
|
|
712
|
+
if (!e || typeof e != "string") return !1;
|
|
713
|
+
if (e === "class" || e.endsWith("Class")) return !0;
|
|
714
|
+
if (e.includes("-")) try {
|
|
715
|
+
if (e.split("-").some((t) => t === "class")) return !0;
|
|
716
|
+
} catch {
|
|
717
|
+
}
|
|
718
|
+
return !1;
|
|
719
|
+
}
|
|
720
|
+
var b = null;
|
|
721
|
+
function Me() {
|
|
722
|
+
if (b !== null) throw new Error("[CER] Concurrent SSR render detected: beginSSRGlobalStyleCollection() called while a collection is already active. For concurrent request handling, use worker threads or multiple Node.js processes.");
|
|
723
|
+
b = [];
|
|
724
|
+
}
|
|
725
|
+
function Ne() {
|
|
726
|
+
const e = b ?? [];
|
|
727
|
+
return b = null, e;
|
|
728
|
+
}
|
|
729
|
+
function ne(e) {
|
|
730
|
+
return b !== null ? (e && !b.includes(e) && b.push(e), !0) : !1;
|
|
731
|
+
}
|
|
732
|
+
var re = 0;
|
|
733
|
+
function De(e, t, n = "unknown", r) {
|
|
734
|
+
const s = {};
|
|
735
|
+
for (const [l, m] of Object.entries(t ?? {})) s[L(l)] = m;
|
|
736
|
+
const o = {
|
|
737
|
+
getAttribute(l) {
|
|
738
|
+
const m = L(l);
|
|
739
|
+
if (s[m] !== void 0 && s[m] !== null) return String(s[m]);
|
|
740
|
+
const T = (t ?? {})[l];
|
|
741
|
+
return T != null ? String(T) : null;
|
|
742
|
+
},
|
|
743
|
+
hasAttribute(l) {
|
|
744
|
+
return this.getAttribute(l) !== null;
|
|
745
|
+
},
|
|
746
|
+
shadowRoot: null,
|
|
747
|
+
tagName: "",
|
|
748
|
+
parentElement: null
|
|
749
|
+
}, i = {
|
|
750
|
+
...s,
|
|
751
|
+
_componentId: `cer-ssr-${Object.keys(s).join("-") || "root"}-${++re}`,
|
|
752
|
+
requestRender: () => {
|
|
753
|
+
},
|
|
754
|
+
_requestRender: () => {
|
|
755
|
+
},
|
|
756
|
+
emit: () => !0,
|
|
757
|
+
refs: {}
|
|
758
|
+
};
|
|
759
|
+
Object.defineProperty(i, "_host", {
|
|
760
|
+
value: o,
|
|
761
|
+
writable: !0,
|
|
762
|
+
enumerable: !1,
|
|
763
|
+
configurable: !0
|
|
764
|
+
}), r !== void 0 && Object.defineProperty(i, "_router", {
|
|
765
|
+
value: r,
|
|
766
|
+
writable: !1,
|
|
767
|
+
enumerable: !1,
|
|
768
|
+
configurable: !0
|
|
769
|
+
}), R(i);
|
|
770
|
+
let a = null, c;
|
|
771
|
+
try {
|
|
772
|
+
const l = e.render(i);
|
|
773
|
+
l instanceof Promise ? c = l : a = l;
|
|
774
|
+
} catch (l) {
|
|
775
|
+
p(`[SSR] Component "${n}" threw during SSR render. The shadow DOM will be empty. Error:`, l);
|
|
776
|
+
} finally {
|
|
777
|
+
z();
|
|
778
|
+
}
|
|
779
|
+
const h = String(i._computedStyle ?? "");
|
|
780
|
+
return {
|
|
781
|
+
shadowVNode: a,
|
|
782
|
+
useStyleCSS: h,
|
|
783
|
+
asyncPromise: c
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
function Te() {
|
|
787
|
+
return d();
|
|
788
|
+
}
|
|
789
|
+
var u = null, w = /* @__PURE__ */ Symbol("cer:provides");
|
|
790
|
+
function R(e) {
|
|
791
|
+
u = e;
|
|
792
|
+
}
|
|
793
|
+
function z() {
|
|
794
|
+
u = null;
|
|
795
|
+
}
|
|
796
|
+
function Ae() {
|
|
797
|
+
return u;
|
|
798
|
+
}
|
|
799
|
+
function Re() {
|
|
800
|
+
if (!u) throw new Error("useEmit must be called during component render");
|
|
801
|
+
if (d()) return () => !1;
|
|
802
|
+
const e = u.emit;
|
|
803
|
+
if (typeof e != "function") throw new Error("useEmit requires an emit function on the component context");
|
|
804
|
+
const t = e;
|
|
805
|
+
return (n, r, s) => t(n, r, s);
|
|
806
|
+
}
|
|
807
|
+
function C(e) {
|
|
808
|
+
e._hookCallbacks || Object.defineProperty(e, "_hookCallbacks", {
|
|
809
|
+
value: {},
|
|
810
|
+
writable: !0,
|
|
811
|
+
enumerable: !1,
|
|
812
|
+
configurable: !0
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
function xe(e) {
|
|
816
|
+
if (!u) throw new Error("useOnConnected must be called during component render");
|
|
817
|
+
if (d()) return;
|
|
818
|
+
C(u);
|
|
819
|
+
const t = u._hookCallbacks;
|
|
820
|
+
t.onConnected || (t.onConnected = []), t.onConnected.push(e);
|
|
821
|
+
}
|
|
822
|
+
function Pe(e) {
|
|
823
|
+
if (!u) throw new Error("useOnDisconnected must be called during component render");
|
|
824
|
+
if (d()) return;
|
|
825
|
+
C(u);
|
|
826
|
+
const t = u._hookCallbacks;
|
|
827
|
+
t.onDisconnected || (t.onDisconnected = []), t.onDisconnected.push(e);
|
|
828
|
+
}
|
|
829
|
+
function Oe(e) {
|
|
830
|
+
if (!u) throw new Error("useOnAttributeChanged must be called during component render");
|
|
831
|
+
if (d()) return;
|
|
832
|
+
C(u);
|
|
833
|
+
const t = u._hookCallbacks;
|
|
834
|
+
t.onAttributeChanged || (t.onAttributeChanged = []), t.onAttributeChanged.push(e);
|
|
835
|
+
}
|
|
836
|
+
function Ie(e) {
|
|
837
|
+
if (!u) throw new Error("useOnError must be called during component render");
|
|
838
|
+
if (d()) return;
|
|
839
|
+
C(u);
|
|
840
|
+
const t = u._hookCallbacks;
|
|
841
|
+
t.onError || (t.onError = []), t.onError.push((n) => {
|
|
842
|
+
try {
|
|
843
|
+
n instanceof Error ? e(n) : e(new Error(String(n)));
|
|
844
|
+
} catch (r) {
|
|
845
|
+
M("[useOnError] The error handler itself threw an exception:", r);
|
|
846
|
+
}
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
function se(e) {
|
|
850
|
+
if (!u) throw new Error("useProps must be called during component render");
|
|
851
|
+
C(u);
|
|
852
|
+
const t = u._hookCallbacks;
|
|
853
|
+
t.props = {
|
|
854
|
+
...t.props || {},
|
|
855
|
+
...e
|
|
856
|
+
};
|
|
857
|
+
const n = u;
|
|
858
|
+
try {
|
|
859
|
+
const r = Object.keys(e || {});
|
|
860
|
+
for (const s of r) {
|
|
861
|
+
if (typeof s != "string" || s.startsWith("_")) continue;
|
|
862
|
+
const o = Object.getOwnPropertyDescriptor(n, s);
|
|
863
|
+
if (!(o && !o.configurable))
|
|
864
|
+
try {
|
|
865
|
+
let i = Object.prototype.hasOwnProperty.call(n, s) ? n[s] : void 0;
|
|
866
|
+
Object.defineProperty(n, s, {
|
|
867
|
+
configurable: !0,
|
|
868
|
+
enumerable: !0,
|
|
869
|
+
get() {
|
|
870
|
+
try {
|
|
871
|
+
const a = n && n._host;
|
|
872
|
+
if (a) {
|
|
873
|
+
const c = ee(s), h = a.getAttribute(c);
|
|
874
|
+
if (h !== null) {
|
|
875
|
+
const l = typeof e[s];
|
|
876
|
+
return l === "boolean" ? h === "" || h === "true" : l === "number" ? Number(h) : h;
|
|
877
|
+
}
|
|
878
|
+
if (typeof a[s] < "u") {
|
|
879
|
+
const l = a[s];
|
|
880
|
+
if (y(l) || l && typeof l == "object" && "value" in l && !(typeof Node < "u" && l instanceof Node)) return l.value;
|
|
881
|
+
const m = typeof e[s];
|
|
882
|
+
if (!(m === "string" && l && typeof l == "object"))
|
|
883
|
+
return m === "boolean" && typeof l == "string" ? l === "" || l === "true" : l;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
} catch {
|
|
887
|
+
}
|
|
888
|
+
return i;
|
|
889
|
+
},
|
|
890
|
+
set(a) {
|
|
891
|
+
i = a;
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
} catch {
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
} catch {
|
|
898
|
+
}
|
|
899
|
+
return new Proxy({}, {
|
|
900
|
+
get(r, s) {
|
|
901
|
+
if (typeof s != "string") return;
|
|
902
|
+
const o = e[s];
|
|
903
|
+
try {
|
|
904
|
+
const a = n && n._host;
|
|
905
|
+
if (a) {
|
|
906
|
+
if (typeof HTMLElement < "u" && a instanceof HTMLElement || typeof a.getAttribute == "function" && typeof a.hasAttribute == "function") {
|
|
907
|
+
const h = s.replace(/([A-Z])/g, "-$1").toLowerCase(), l = a.getAttribute(h);
|
|
908
|
+
if (l !== null)
|
|
909
|
+
return typeof o == "boolean" ? l === "" || l === "true" : typeof o == "number" ? Number(l) : l;
|
|
910
|
+
}
|
|
911
|
+
const c = a[s];
|
|
912
|
+
if (typeof c < "u" && c !== "") {
|
|
913
|
+
const h = c && typeof c == "object" && "value" in c && !(typeof Node < "u" && c instanceof Node);
|
|
914
|
+
if (!(typeof o == "string" && c && typeof c == "object" && !h && !y(c)))
|
|
915
|
+
return typeof o == "boolean" && o === !1 && c === "" ? o : y(c) || h ? c.value : typeof o == "boolean" && typeof c == "string" ? c === "" || c === "true" : typeof o == "number" && typeof c == "string" && !Number.isNaN(Number(c)) ? Number(c) : c;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
} catch {
|
|
919
|
+
}
|
|
920
|
+
const i = n[s];
|
|
921
|
+
return typeof o == "boolean" && i === "" ? o === !1 ? o : !0 : y(i) || i && typeof i == "object" && "value" in i && !(typeof Node < "u" && i instanceof Node) ? i.value : i != null && i !== "" ? typeof o == "boolean" && typeof i == "string" ? i === "true" : typeof o == "number" && typeof i == "string" && !Number.isNaN(Number(i)) ? Number(i) : i : o;
|
|
922
|
+
},
|
|
923
|
+
has(r, s) {
|
|
924
|
+
return typeof s == "string" && (s in n || s in e);
|
|
925
|
+
},
|
|
926
|
+
ownKeys() {
|
|
927
|
+
return Array.from(/* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(n || {})]));
|
|
928
|
+
},
|
|
929
|
+
getOwnPropertyDescriptor() {
|
|
930
|
+
return {
|
|
931
|
+
configurable: !0,
|
|
932
|
+
enumerable: !0
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
function je(e) {
|
|
938
|
+
if (!u) throw new Error("useStyle must be called during component render");
|
|
939
|
+
if (!d()) {
|
|
940
|
+
C(u);
|
|
941
|
+
try {
|
|
942
|
+
const t = e();
|
|
943
|
+
Object.defineProperty(u, "_computedStyle", {
|
|
944
|
+
value: t,
|
|
945
|
+
writable: !0,
|
|
946
|
+
enumerable: !1,
|
|
947
|
+
configurable: !0
|
|
948
|
+
});
|
|
949
|
+
} catch (t) {
|
|
950
|
+
p("Error in useStyle callback:", t), Object.defineProperty(u, "_computedStyle", {
|
|
951
|
+
value: "",
|
|
952
|
+
writable: !0,
|
|
953
|
+
enumerable: !1,
|
|
954
|
+
configurable: !0
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
var F = /* @__PURE__ */ new Map();
|
|
960
|
+
function He(e) {
|
|
961
|
+
let t;
|
|
962
|
+
try {
|
|
963
|
+
t = e();
|
|
964
|
+
} catch {
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
if (ne(t) || typeof document > "u" || typeof CSSStyleSheet > "u") return;
|
|
968
|
+
p("[useGlobalStyle] Injecting global styles from a component. This escapes Shadow DOM encapsulation — use sparingly.");
|
|
969
|
+
const n = q(G(t));
|
|
970
|
+
if (!(!n || F.has(n)))
|
|
971
|
+
try {
|
|
972
|
+
const r = new CSSStyleSheet();
|
|
973
|
+
r.replaceSync(n), document.adoptedStyleSheets = [...document.adoptedStyleSheets, r], F.set(n, r);
|
|
974
|
+
} catch {
|
|
975
|
+
const r = document.createElement("style");
|
|
976
|
+
r.textContent = n, (document.head ?? document.documentElement).appendChild(r);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
function Ue(e) {
|
|
980
|
+
if (!u) throw new Error("useDesignTokens must be called during component render");
|
|
981
|
+
if (d()) return;
|
|
982
|
+
const t = [], n = {
|
|
983
|
+
primary: "--cer-color-primary-500",
|
|
984
|
+
secondary: "--cer-color-secondary-500",
|
|
985
|
+
neutral: "--cer-color-neutral-500",
|
|
986
|
+
success: "--cer-color-success-500",
|
|
987
|
+
info: "--cer-color-info-500",
|
|
988
|
+
warning: "--cer-color-warning-500",
|
|
989
|
+
error: "--cer-color-error-500"
|
|
990
|
+
}, r = {
|
|
991
|
+
fontSans: "--cer-font-sans",
|
|
992
|
+
fontSerif: "--cer-font-serif",
|
|
993
|
+
fontMono: "--cer-font-mono"
|
|
994
|
+
};
|
|
995
|
+
for (const [a, c] of Object.entries(e))
|
|
996
|
+
c !== void 0 && (a in n ? t.push(`${n[a]}:${c}`) : a in r ? t.push(`${r[a]}:${c}`) : a.startsWith("--") && t.push(`${a}:${c}`));
|
|
997
|
+
if (t.length === 0) return;
|
|
998
|
+
const s = `:host{${t.join(";")}}`, o = u._computedStyle ?? "", i = o ? `${o}
|
|
999
|
+
${s}` : s;
|
|
1000
|
+
Object.defineProperty(u, "_computedStyle", {
|
|
1001
|
+
value: i,
|
|
1002
|
+
writable: !0,
|
|
1003
|
+
enumerable: !1,
|
|
1004
|
+
configurable: !0
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
function Le(e, t) {
|
|
1008
|
+
if (!u) throw new Error("provide must be called during component render");
|
|
1009
|
+
if (d()) return;
|
|
1010
|
+
const n = u;
|
|
1011
|
+
n[w] || Object.defineProperty(n, w, {
|
|
1012
|
+
value: /* @__PURE__ */ new Map(),
|
|
1013
|
+
writable: !1,
|
|
1014
|
+
enumerable: !1,
|
|
1015
|
+
configurable: !0
|
|
1016
|
+
}), n[w].set(e, t);
|
|
1017
|
+
}
|
|
1018
|
+
function Fe(e, t) {
|
|
1019
|
+
if (!u) throw new Error("inject must be called during component render");
|
|
1020
|
+
if (d()) return t;
|
|
1021
|
+
try {
|
|
1022
|
+
const n = u._host;
|
|
1023
|
+
if (n) {
|
|
1024
|
+
let r = n.parentNode;
|
|
1025
|
+
r || (r = n.getRootNode());
|
|
1026
|
+
let s = 0;
|
|
1027
|
+
const o = 50;
|
|
1028
|
+
for (; r && s < o; )
|
|
1029
|
+
if (s++, typeof ShadowRoot < "u" && r instanceof ShadowRoot) {
|
|
1030
|
+
const i = r.host, a = i.context;
|
|
1031
|
+
if (a) {
|
|
1032
|
+
const c = a[w];
|
|
1033
|
+
if (c?.has(e)) return c.get(e);
|
|
1034
|
+
}
|
|
1035
|
+
if (r = i.parentNode ?? i.getRootNode(), r === document || r === i) break;
|
|
1036
|
+
} else {
|
|
1037
|
+
if (typeof Element < "u" && r instanceof Element) {
|
|
1038
|
+
const a = r.context;
|
|
1039
|
+
if (a) {
|
|
1040
|
+
const c = a[w];
|
|
1041
|
+
if (c?.has(e)) return c.get(e);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
const i = r;
|
|
1045
|
+
if (r = r.parentNode ?? r.getRootNode?.(), r === document || r === i) break;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
} catch {
|
|
1049
|
+
}
|
|
1050
|
+
return t;
|
|
1051
|
+
}
|
|
1052
|
+
function We(e) {
|
|
1053
|
+
return (t) => {
|
|
1054
|
+
const n = t ?? u;
|
|
1055
|
+
if (!n) throw new Error("createComposable: no component context available. Pass a context explicitly or call inside a render function.");
|
|
1056
|
+
const r = u;
|
|
1057
|
+
R(n);
|
|
1058
|
+
try {
|
|
1059
|
+
return e();
|
|
1060
|
+
} finally {
|
|
1061
|
+
r ? R(r) : z();
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
function $e(e) {
|
|
1066
|
+
if (!u) throw new Error("useExpose must be called during component render");
|
|
1067
|
+
if (d()) return;
|
|
1068
|
+
C(u);
|
|
1069
|
+
const t = u._hookCallbacks;
|
|
1070
|
+
t.expose = {
|
|
1071
|
+
...t.expose ?? {},
|
|
1072
|
+
...e
|
|
1073
|
+
};
|
|
1074
|
+
const n = u._host;
|
|
1075
|
+
if (n) for (const [r, s] of Object.entries(e)) try {
|
|
1076
|
+
n[r] = s;
|
|
1077
|
+
} catch {
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function Ve() {
|
|
1081
|
+
if (!u) throw new Error("useSlots must be called during component render");
|
|
1082
|
+
if (d()) return {
|
|
1083
|
+
has: () => !1,
|
|
1084
|
+
getNodes: () => [],
|
|
1085
|
+
names: () => []
|
|
1086
|
+
};
|
|
1087
|
+
const e = u._host, t = () => {
|
|
1088
|
+
const n = /* @__PURE__ */ new Map();
|
|
1089
|
+
if (!e) return n;
|
|
1090
|
+
for (const r of e.children) {
|
|
1091
|
+
const s = r.getAttribute("slot") ?? "default", o = n.get(s);
|
|
1092
|
+
o ? o.push(r) : n.set(s, [r]);
|
|
1093
|
+
}
|
|
1094
|
+
return n;
|
|
1095
|
+
};
|
|
1096
|
+
return {
|
|
1097
|
+
has(n) {
|
|
1098
|
+
if (!e) return !1;
|
|
1099
|
+
const r = !n || n === "default" ? "default" : n, s = t().get(r);
|
|
1100
|
+
return s !== void 0 && s.length > 0;
|
|
1101
|
+
},
|
|
1102
|
+
getNodes(n) {
|
|
1103
|
+
if (!e) return [];
|
|
1104
|
+
const r = !n || n === "default" ? "default" : n;
|
|
1105
|
+
return t().get(r) ?? [];
|
|
1106
|
+
},
|
|
1107
|
+
names() {
|
|
1108
|
+
return e ? Array.from(t().keys()) : [];
|
|
1109
|
+
}
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
function ze(...e) {
|
|
1113
|
+
if (!u) throw new Error("defineModel must be called during component render");
|
|
1114
|
+
const t = e.length === 2 ? e[0] : "modelValue", n = e.length === 2 ? e[1] : e.length === 1 ? e[0] : void 0, r = se({ [t]: n }), s = d() ? null : (() => {
|
|
1115
|
+
const i = u.emit;
|
|
1116
|
+
return typeof i != "function" ? null : i;
|
|
1117
|
+
})(), o = {
|
|
1118
|
+
get value() {
|
|
1119
|
+
return r[t];
|
|
1120
|
+
},
|
|
1121
|
+
set value(i) {
|
|
1122
|
+
s && s(`update:${t}`, i);
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1125
|
+
try {
|
|
1126
|
+
Object.defineProperty(o, /* @__PURE__ */ Symbol.for("@cer/ReactiveState"), {
|
|
1127
|
+
value: !0,
|
|
1128
|
+
enumerable: !1,
|
|
1129
|
+
configurable: !1
|
|
1130
|
+
});
|
|
1131
|
+
} catch {
|
|
1132
|
+
}
|
|
1133
|
+
return o;
|
|
1134
|
+
}
|
|
1135
|
+
export {
|
|
1136
|
+
be as A,
|
|
1137
|
+
f as B,
|
|
1138
|
+
Ce as C,
|
|
1139
|
+
_e as D,
|
|
1140
|
+
Se as E,
|
|
1141
|
+
ee as F,
|
|
1142
|
+
fe as G,
|
|
1143
|
+
ge as H,
|
|
1144
|
+
we as I,
|
|
1145
|
+
ce as J,
|
|
1146
|
+
d as K,
|
|
1147
|
+
A as L,
|
|
1148
|
+
ve as M,
|
|
1149
|
+
Ee as N,
|
|
1150
|
+
ke as O,
|
|
1151
|
+
L as P,
|
|
1152
|
+
he as R,
|
|
1153
|
+
De as S,
|
|
1154
|
+
ye as T,
|
|
1155
|
+
pe as U,
|
|
1156
|
+
de as V,
|
|
1157
|
+
le as W,
|
|
1158
|
+
Z as X,
|
|
1159
|
+
ue as Y,
|
|
1160
|
+
ae as Z,
|
|
1161
|
+
se as _,
|
|
1162
|
+
Fe as a,
|
|
1163
|
+
Me as b,
|
|
1164
|
+
R as c,
|
|
1165
|
+
$e as d,
|
|
1166
|
+
He as f,
|
|
1167
|
+
Ie as g,
|
|
1168
|
+
Pe as h,
|
|
1169
|
+
Ae as i,
|
|
1170
|
+
me as j,
|
|
1171
|
+
V as k,
|
|
1172
|
+
Ue as l,
|
|
1173
|
+
xe as m,
|
|
1174
|
+
We as n,
|
|
1175
|
+
Te as o,
|
|
1176
|
+
Oe as p,
|
|
1177
|
+
X as q,
|
|
1178
|
+
ze as r,
|
|
1179
|
+
Le as s,
|
|
1180
|
+
z as t,
|
|
1181
|
+
Re as u,
|
|
1182
|
+
Ve as v,
|
|
1183
|
+
g as w,
|
|
1184
|
+
Ne as x,
|
|
1185
|
+
je as y,
|
|
1186
|
+
y as z
|
|
1187
|
+
};
|
|
1188
|
+
|
|
1189
|
+
//# sourceMappingURL=hooks-_3xP4G2N.js.map
|