@jasonshimmy/custom-elements-runtime 2.8.1 → 3.0.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/README.md +159 -46
- package/dist/css-utils-Cg4o1MqY.js +643 -0
- package/dist/css-utils-Cg4o1MqY.js.map +1 -0
- package/dist/css-utils-RqkyBWft.cjs +576 -0
- package/dist/css-utils-RqkyBWft.cjs.map +1 -0
- package/dist/custom-elements-runtime.cjs.js +3 -3
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js +7 -0
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js.map +1 -0
- package/dist/custom-elements-runtime.dom-jit-css.es.js +136 -0
- package/dist/custom-elements-runtime.dom-jit-css.es.js.map +1 -0
- package/dist/custom-elements-runtime.es.js +70 -67
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.cjs.js +1 -1
- package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.es.js +62 -46
- package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
- package/dist/custom-elements-runtime.jit-css.cjs.js +2 -0
- package/dist/custom-elements-runtime.jit-css.cjs.js.map +1 -0
- package/dist/custom-elements-runtime.jit-css.es.js +38 -0
- package/dist/custom-elements-runtime.jit-css.es.js.map +1 -0
- package/dist/custom-elements-runtime.router.cjs.js +20 -20
- package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.router.es.js +448 -434
- package/dist/custom-elements-runtime.router.es.js.map +1 -1
- package/dist/custom-elements-runtime.ssr.cjs.js +1 -1
- package/dist/custom-elements-runtime.ssr.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.ssr.es.js +33 -18
- package/dist/custom-elements-runtime.ssr.es.js.map +1 -1
- package/dist/custom-elements-runtime.store.cjs.js +1 -1
- package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.store.es.js +21 -16
- package/dist/custom-elements-runtime.store.es.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.cjs.js +1 -1
- package/dist/custom-elements-runtime.transitions.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.es.js +279 -7
- package/dist/custom-elements-runtime.transitions.es.js.map +1 -1
- package/dist/custom-elements-runtime.vite-plugin.cjs.js +2 -0
- package/dist/custom-elements-runtime.vite-plugin.cjs.js.map +1 -0
- package/dist/custom-elements-runtime.vite-plugin.es.js +73 -0
- package/dist/custom-elements-runtime.vite-plugin.es.js.map +1 -0
- package/dist/dom-jit-css.d.ts +66 -0
- package/dist/event-bus.d.ts +3 -1
- package/dist/{namespace-helpers-DhLBqt-7.js → helpers-CweFZFWU.js} +265 -287
- package/dist/helpers-CweFZFWU.js.map +1 -0
- package/dist/helpers-DeWjSmOl.cjs +5 -0
- package/dist/helpers-DeWjSmOl.cjs.map +1 -0
- package/dist/hooks-BrrLKSub.cjs +3 -0
- package/dist/hooks-BrrLKSub.cjs.map +1 -0
- package/dist/hooks-DyShDHKo.js +403 -0
- package/dist/hooks-DyShDHKo.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/jit-css.d.ts +30 -0
- package/dist/namespace-helpers-CnpZ5__p.js +45 -0
- package/dist/namespace-helpers-CnpZ5__p.js.map +1 -0
- package/dist/namespace-helpers-CyIDtI97.cjs +2 -0
- package/dist/namespace-helpers-CyIDtI97.cjs.map +1 -0
- package/dist/router/types.d.ts +4 -2
- package/dist/runtime/css-utils.d.ts +33 -0
- package/dist/runtime/discovery-state.d.ts +3 -0
- package/dist/runtime/hooks.d.ts +78 -0
- package/dist/runtime/jit-hooks.d.ts +28 -0
- package/dist/runtime/render-bridge.d.ts +37 -0
- package/dist/runtime/scheduler.d.ts +3 -4
- package/dist/runtime/secure-expression-evaluator.d.ts +0 -1
- package/dist/runtime/style.d.ts +84 -26
- package/dist/runtime/template-compiler/lru-cache.d.ts +0 -3
- package/dist/runtime/vdom-helpers.d.ts +0 -1
- package/dist/ssr.d.ts +42 -0
- package/dist/{transitions-DMJXs_tY.js → style-BmyOIMcU.js} +904 -1344
- package/dist/style-BmyOIMcU.js.map +1 -0
- package/dist/style-D40DsIqJ.cjs +55 -0
- package/dist/style-D40DsIqJ.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/template-compiler-B5uN1EQw.js +3731 -0
- package/dist/template-compiler-B5uN1EQw.js.map +1 -0
- package/dist/template-compiler-Cx623BSB.cjs +23 -0
- package/dist/template-compiler-Cx623BSB.cjs.map +1 -0
- package/dist/variables.css +1 -1
- package/dist/vite-plugin.d.ts +52 -0
- package/package.json +55 -6
- package/dist/namespace-helpers-Ctd_h7j2.cjs +0 -5
- package/dist/namespace-helpers-Ctd_h7j2.cjs.map +0 -1
- package/dist/namespace-helpers-DhLBqt-7.js.map +0 -1
- package/dist/template-compiler-CVBKYu3j.js +0 -3991
- package/dist/template-compiler-CVBKYu3j.js.map +0 -1
- package/dist/template-compiler-G8h2OJbA.cjs +0 -23
- package/dist/template-compiler-G8h2OJbA.cjs.map +0 -1
- package/dist/transitions-DMJXs_tY.js.map +0 -1
- package/dist/transitions-f4KfN29T.cjs +0 -330
- package/dist/transitions-f4KfN29T.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { a as d, d as w } from "./logger-BvkEbVM4.js";
|
|
2
|
+
function N() {
|
|
3
3
|
const s = (() => {
|
|
4
4
|
try {
|
|
5
5
|
return globalThis.process?.env?.NODE_ENV;
|
|
@@ -10,10 +10,10 @@ function x() {
|
|
|
10
10
|
try {
|
|
11
11
|
if (typeof window > "u")
|
|
12
12
|
return { vitest: !1, cypress: !1 };
|
|
13
|
-
const
|
|
13
|
+
const t = window;
|
|
14
14
|
return {
|
|
15
|
-
vitest: !!
|
|
16
|
-
cypress: !!
|
|
15
|
+
vitest: !!t.__vitest__,
|
|
16
|
+
cypress: !!t.Cypress
|
|
17
17
|
};
|
|
18
18
|
} catch {
|
|
19
19
|
return { vitest: !1, cypress: !1 };
|
|
@@ -25,7 +25,7 @@ function x() {
|
|
|
25
25
|
isCypress: e.cypress
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
class
|
|
28
|
+
class L {
|
|
29
29
|
pendingUpdates = /* @__PURE__ */ new Map();
|
|
30
30
|
isFlushScheduled = !1;
|
|
31
31
|
isFlushing = !1;
|
|
@@ -39,15 +39,15 @@ class H {
|
|
|
39
39
|
pendingIdleUpdates = /* @__PURE__ */ new Map();
|
|
40
40
|
idleCallbackHandle = null;
|
|
41
41
|
constructor() {
|
|
42
|
-
this.testEnv =
|
|
42
|
+
this.testEnv = N(), this.schedulePeriodicCleanup();
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Schedule an update to be executed in the next microtask
|
|
46
46
|
* Uses component identity to deduplicate multiple render requests for the same component
|
|
47
47
|
*/
|
|
48
|
-
schedule(e,
|
|
49
|
-
const
|
|
50
|
-
this.pendingUpdates.size >= this.MAX_PENDING_SIZE && this.performEmergencyCleanup(), this.pendingUpdates.set(
|
|
48
|
+
schedule(e, n) {
|
|
49
|
+
const t = n || e;
|
|
50
|
+
this.pendingUpdates.size >= this.MAX_PENDING_SIZE && this.performEmergencyCleanup(), this.pendingUpdates.set(t, e), this.isFlushScheduled || this.scheduleFlush();
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Schedule the flush operation based on environment
|
|
@@ -56,7 +56,6 @@ class H {
|
|
|
56
56
|
this.isFlushScheduled = !0, this.testEnv.isTest && !this.isFlushing ? this.flush() : queueMicrotask(() => this.flush());
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Execute all pending updates with priority ordering
|
|
60
59
|
* Execute all pending updates with priority ordering
|
|
61
60
|
*/
|
|
62
61
|
flush() {
|
|
@@ -66,11 +65,11 @@ class H {
|
|
|
66
65
|
const e = this.pendingUpdates;
|
|
67
66
|
this.pendingUpdates = /* @__PURE__ */ new Map(), this.isFlushScheduled = !1;
|
|
68
67
|
try {
|
|
69
|
-
for (const
|
|
68
|
+
for (const n of e.values())
|
|
70
69
|
try {
|
|
71
|
-
|
|
72
|
-
} catch (
|
|
73
|
-
|
|
70
|
+
n();
|
|
71
|
+
} catch (t) {
|
|
72
|
+
w("Error in batched update:", t);
|
|
74
73
|
}
|
|
75
74
|
} finally {
|
|
76
75
|
this.isFlushing = !1;
|
|
@@ -119,20 +118,21 @@ class H {
|
|
|
119
118
|
*/
|
|
120
119
|
performPeriodicCleanup() {
|
|
121
120
|
const e = Date.now();
|
|
122
|
-
e - this.lastCleanup < this.CLEANUP_INTERVAL || (this.pendingUpdates.size > 100 &&
|
|
121
|
+
e - this.lastCleanup < this.CLEANUP_INTERVAL || (this.pendingUpdates.size > 100 && d(
|
|
123
122
|
`Scheduler has ${this.pendingUpdates.size} pending updates. Consider investigating.`
|
|
124
123
|
), this.lastCleanup = e);
|
|
125
124
|
}
|
|
126
125
|
/**
|
|
127
|
-
* Emergency cleanup when pending updates exceed safe limits
|
|
126
|
+
* Emergency cleanup when pending updates exceed safe limits.
|
|
127
|
+
* @param queue - The specific map to trim; defaults to the normal queue.
|
|
128
128
|
*/
|
|
129
|
-
performEmergencyCleanup() {
|
|
130
|
-
|
|
129
|
+
performEmergencyCleanup(e = this.pendingUpdates) {
|
|
130
|
+
d(
|
|
131
131
|
"Scheduler emergency cleanup: too many pending updates, clearing oldest entries"
|
|
132
132
|
);
|
|
133
|
-
const
|
|
134
|
-
for (let
|
|
135
|
-
|
|
133
|
+
const n = Array.from(e.entries()), t = Math.floor(n.length / 2);
|
|
134
|
+
for (let r = 0; r < t; r++)
|
|
135
|
+
e.delete(n[r][0]);
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* Schedule an update with an explicit priority level.
|
|
@@ -149,21 +149,21 @@ class H {
|
|
|
149
149
|
* scheduleWithPriority(() => flushAnalytics(), 'idle');
|
|
150
150
|
* ```
|
|
151
151
|
*/
|
|
152
|
-
scheduleWithPriority(e,
|
|
153
|
-
if (
|
|
152
|
+
scheduleWithPriority(e, n = "normal", t) {
|
|
153
|
+
if (n === "immediate") {
|
|
154
154
|
try {
|
|
155
155
|
e();
|
|
156
156
|
} catch (i) {
|
|
157
|
-
|
|
157
|
+
w("Error in immediate update:", i);
|
|
158
158
|
}
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
-
if (
|
|
162
|
-
const i =
|
|
163
|
-
this.pendingIdleUpdates.size >= this.MAX_PENDING_SIZE && this.performEmergencyCleanup(), this.pendingIdleUpdates.set(i, e), this.scheduleIdleFlush();
|
|
161
|
+
if (n === "idle") {
|
|
162
|
+
const i = t ?? e;
|
|
163
|
+
this.pendingIdleUpdates.size >= this.MAX_PENDING_SIZE && this.performEmergencyCleanup(this.pendingIdleUpdates), this.pendingIdleUpdates.set(i, e), this.scheduleIdleFlush();
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
const r =
|
|
166
|
+
const r = t ?? e;
|
|
167
167
|
this.pendingUpdates.size >= this.MAX_PENDING_SIZE && this.performEmergencyCleanup(), this.pendingUpdates.set(r, e), this.isFlushScheduled || (this.isFlushScheduled = !0, queueMicrotask(() => this.flush()));
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
@@ -180,8 +180,8 @@ class H {
|
|
|
180
180
|
}
|
|
181
181
|
if (typeof requestIdleCallback < "u") {
|
|
182
182
|
const e = requestIdleCallback(
|
|
183
|
-
(
|
|
184
|
-
this.idleCallbackHandle = null, this.flushIdleUpdates(
|
|
183
|
+
(n) => {
|
|
184
|
+
this.idleCallbackHandle = null, this.flushIdleUpdates(n);
|
|
185
185
|
},
|
|
186
186
|
{ timeout: 2e3 }
|
|
187
187
|
);
|
|
@@ -203,53 +203,58 @@ class H {
|
|
|
203
203
|
* zero and reschedules any unprocessed work.
|
|
204
204
|
*/
|
|
205
205
|
flushIdleUpdates(e) {
|
|
206
|
-
const
|
|
206
|
+
const n = Array.from(this.pendingIdleUpdates.entries());
|
|
207
207
|
this.pendingIdleUpdates = /* @__PURE__ */ new Map();
|
|
208
|
-
for (let
|
|
208
|
+
for (let t = 0; t < n.length; t++) {
|
|
209
209
|
if (e && !e.didTimeout && e.timeRemaining() <= 0) {
|
|
210
|
-
for (let r =
|
|
211
|
-
this.pendingIdleUpdates.set(
|
|
210
|
+
for (let r = t; r < n.length; r++)
|
|
211
|
+
this.pendingIdleUpdates.set(n[r][0], n[r][1]);
|
|
212
212
|
this.scheduleIdleFlush();
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
215
|
try {
|
|
216
|
-
t
|
|
216
|
+
n[t][1]();
|
|
217
217
|
} catch (r) {
|
|
218
|
-
|
|
218
|
+
w("Error in idle update:", r);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
const
|
|
224
|
-
function
|
|
225
|
-
|
|
223
|
+
const p = new L();
|
|
224
|
+
function x(s, e) {
|
|
225
|
+
p.schedule(s, e);
|
|
226
226
|
}
|
|
227
|
-
function V(s, e = "normal",
|
|
228
|
-
|
|
227
|
+
function V(s, e = "normal", n) {
|
|
228
|
+
p.scheduleWithPriority(s, e, n);
|
|
229
229
|
}
|
|
230
230
|
function q() {
|
|
231
|
-
|
|
231
|
+
p.flushImmediately();
|
|
232
232
|
}
|
|
233
233
|
function $() {
|
|
234
234
|
return new Promise((s) => {
|
|
235
|
-
|
|
235
|
+
let n = 0;
|
|
236
|
+
for (; p.hasPendingUpdates && n < 100; )
|
|
237
|
+
p.flushImmediately(), n++;
|
|
238
|
+
n >= 100 && d(
|
|
239
|
+
"[nextTick] Maximum flush iterations reached — possible circular update loop. Check for watchers or computed values that unconditionally mutate reactive state."
|
|
240
|
+
), queueMicrotask(s);
|
|
236
241
|
});
|
|
237
242
|
}
|
|
238
|
-
const
|
|
239
|
-
class
|
|
243
|
+
const T = /* @__PURE__ */ new WeakSet();
|
|
244
|
+
class P {
|
|
240
245
|
static cache = /* @__PURE__ */ new WeakMap();
|
|
241
246
|
static arrayHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
242
247
|
static objectHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
243
248
|
/**
|
|
244
249
|
* Get or create a reactive proxy for an object
|
|
245
250
|
*/
|
|
246
|
-
static getOrCreateProxy(e,
|
|
251
|
+
static getOrCreateProxy(e, n, t = !1) {
|
|
247
252
|
const r = this.cache.get(e);
|
|
248
253
|
if (r)
|
|
249
254
|
return r;
|
|
250
|
-
const i =
|
|
255
|
+
const i = t ? this.getOrCreateArrayHandler(n) : this.getOrCreateObjectHandler(n), a = new Proxy(e, i);
|
|
251
256
|
try {
|
|
252
|
-
|
|
257
|
+
A.markAsProxy(a);
|
|
253
258
|
} catch {
|
|
254
259
|
}
|
|
255
260
|
return this.cache.set(e, a), a;
|
|
@@ -259,9 +264,9 @@ class L {
|
|
|
259
264
|
*/
|
|
260
265
|
static getOrCreateArrayHandler(e) {
|
|
261
266
|
if (!this.arrayHandlerCache.has(e)) {
|
|
262
|
-
const
|
|
263
|
-
get: (
|
|
264
|
-
const a = Reflect.get(
|
|
267
|
+
const n = {
|
|
268
|
+
get: (t, r, i) => {
|
|
269
|
+
const a = Reflect.get(t, r, i);
|
|
265
270
|
return typeof a == "function" && typeof r == "string" && [
|
|
266
271
|
"push",
|
|
267
272
|
"pop",
|
|
@@ -272,15 +277,15 @@ class L {
|
|
|
272
277
|
"reverse",
|
|
273
278
|
"fill",
|
|
274
279
|
"copyWithin"
|
|
275
|
-
].includes(r) ? function(...
|
|
276
|
-
const
|
|
277
|
-
return e.triggerUpdate(),
|
|
280
|
+
].includes(r) ? function(...l) {
|
|
281
|
+
const h = a.apply(t, l);
|
|
282
|
+
return e.triggerUpdate(), h;
|
|
278
283
|
} : a !== null && typeof a == "object" && typeof r == "string" ? e.makeReactiveValue(a) : a;
|
|
279
284
|
},
|
|
280
|
-
set: (
|
|
281
|
-
deleteProperty: (
|
|
285
|
+
set: (t, r, i) => (t[r] = e.makeReactiveValue(i), e.triggerUpdate(), !0),
|
|
286
|
+
deleteProperty: (t, r) => (delete t[r], e.triggerUpdate(), !0)
|
|
282
287
|
};
|
|
283
|
-
this.arrayHandlerCache.set(e,
|
|
288
|
+
this.arrayHandlerCache.set(e, n);
|
|
284
289
|
}
|
|
285
290
|
return this.arrayHandlerCache.get(e);
|
|
286
291
|
}
|
|
@@ -289,15 +294,15 @@ class L {
|
|
|
289
294
|
*/
|
|
290
295
|
static getOrCreateObjectHandler(e) {
|
|
291
296
|
if (!this.objectHandlerCache.has(e)) {
|
|
292
|
-
const
|
|
293
|
-
get: (
|
|
294
|
-
const a = Reflect.get(
|
|
297
|
+
const n = {
|
|
298
|
+
get: (t, r, i) => {
|
|
299
|
+
const a = Reflect.get(t, r, i);
|
|
295
300
|
return a !== null && typeof a == "object" && typeof r == "string" ? e.makeReactiveValue(a) : a;
|
|
296
301
|
},
|
|
297
|
-
set: (
|
|
298
|
-
deleteProperty: (
|
|
302
|
+
set: (t, r, i) => (t[r] = e.makeReactiveValue(i), e.triggerUpdate(), !0),
|
|
303
|
+
deleteProperty: (t, r) => (delete t[r], e.triggerUpdate(), !0)
|
|
299
304
|
};
|
|
300
|
-
this.objectHandlerCache.set(e,
|
|
305
|
+
this.objectHandlerCache.set(e, n);
|
|
301
306
|
}
|
|
302
307
|
return this.objectHandlerCache.get(e);
|
|
303
308
|
}
|
|
@@ -323,7 +328,7 @@ class L {
|
|
|
323
328
|
};
|
|
324
329
|
}
|
|
325
330
|
}
|
|
326
|
-
class
|
|
331
|
+
class A {
|
|
327
332
|
// Cache a stable reactiveContext object keyed by onUpdate -> makeReactive
|
|
328
333
|
// This allows handler caches in ReactiveProxyCache to reuse handlers
|
|
329
334
|
// for identical reactive contexts instead of creating a new context object
|
|
@@ -332,19 +337,19 @@ class v {
|
|
|
332
337
|
/**
|
|
333
338
|
* Create an optimized reactive proxy with minimal overhead
|
|
334
339
|
*/
|
|
335
|
-
static createReactiveProxy(e,
|
|
340
|
+
static createReactiveProxy(e, n, t) {
|
|
336
341
|
try {
|
|
337
|
-
if (
|
|
342
|
+
if (T.has(e)) return e;
|
|
338
343
|
} catch {
|
|
339
344
|
}
|
|
340
345
|
const r = Array.isArray(e);
|
|
341
|
-
let i = this.contextCache.get(
|
|
342
|
-
i || (i = /* @__PURE__ */ new WeakMap(), this.contextCache.set(
|
|
343
|
-
let a = i.get(
|
|
346
|
+
let i = this.contextCache.get(n);
|
|
347
|
+
i || (i = /* @__PURE__ */ new WeakMap(), this.contextCache.set(n, i));
|
|
348
|
+
let a = i.get(t);
|
|
344
349
|
return a || (a = {
|
|
345
|
-
triggerUpdate:
|
|
346
|
-
makeReactiveValue:
|
|
347
|
-
}, i.set(
|
|
350
|
+
triggerUpdate: n,
|
|
351
|
+
makeReactiveValue: t
|
|
352
|
+
}, i.set(t, a)), P.getOrCreateProxy(e, a, r);
|
|
348
353
|
}
|
|
349
354
|
/**
|
|
350
355
|
* Mark an object as a proxy (for optimization)
|
|
@@ -352,22 +357,28 @@ class v {
|
|
|
352
357
|
static markAsProxy(e) {
|
|
353
358
|
if (e)
|
|
354
359
|
try {
|
|
355
|
-
|
|
360
|
+
T.add(e);
|
|
356
361
|
} catch {
|
|
357
362
|
}
|
|
358
363
|
}
|
|
359
364
|
}
|
|
360
|
-
let
|
|
361
|
-
function
|
|
362
|
-
return
|
|
365
|
+
let C = !1;
|
|
366
|
+
function R() {
|
|
367
|
+
return C;
|
|
368
|
+
}
|
|
369
|
+
function X() {
|
|
370
|
+
C && d(
|
|
371
|
+
"[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."
|
|
372
|
+
), C = !0;
|
|
363
373
|
}
|
|
364
374
|
function G() {
|
|
365
|
-
|
|
375
|
+
C = !1;
|
|
366
376
|
}
|
|
367
|
-
|
|
368
|
-
|
|
377
|
+
let F = 0;
|
|
378
|
+
function S(s) {
|
|
379
|
+
return `${s}-${++F}`;
|
|
369
380
|
}
|
|
370
|
-
class
|
|
381
|
+
class W {
|
|
371
382
|
// Use a stack to support nested callers (component render -> watcher)
|
|
372
383
|
// so that watchers can temporarily become the "current component" while
|
|
373
384
|
// establishing dependencies without clobbering the outer component id.
|
|
@@ -380,26 +391,26 @@ class P {
|
|
|
380
391
|
/**
|
|
381
392
|
* Set the current component being rendered for dependency tracking
|
|
382
393
|
*/
|
|
383
|
-
setCurrentComponent(e,
|
|
394
|
+
setCurrentComponent(e, n) {
|
|
384
395
|
if (this.currentComponentStack.push(e), !this.componentData.has(e))
|
|
385
396
|
this.componentData.set(e, {
|
|
386
397
|
dependencies: /* @__PURE__ */ new Set(),
|
|
387
|
-
renderFn:
|
|
398
|
+
renderFn: n,
|
|
388
399
|
stateIndex: 0,
|
|
389
400
|
lastWarnTime: 0,
|
|
390
401
|
watchers: /* @__PURE__ */ new Map()
|
|
391
402
|
});
|
|
392
403
|
else {
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
395
|
-
for (const r of
|
|
404
|
+
const t = this.componentData.get(e);
|
|
405
|
+
if (t.watchers && t.watchers.size) {
|
|
406
|
+
for (const r of t.watchers.values())
|
|
396
407
|
try {
|
|
397
408
|
this.cleanup(r);
|
|
398
409
|
} catch {
|
|
399
410
|
}
|
|
400
|
-
|
|
411
|
+
t.watchers.clear();
|
|
401
412
|
}
|
|
402
|
-
|
|
413
|
+
t.renderFn = n, t.stateIndex = 0;
|
|
403
414
|
}
|
|
404
415
|
}
|
|
405
416
|
/**
|
|
@@ -417,9 +428,9 @@ class P {
|
|
|
417
428
|
/**
|
|
418
429
|
* Register a watcher id under a component so it can be cleaned up on re-render
|
|
419
430
|
*/
|
|
420
|
-
registerWatcher(e,
|
|
421
|
-
const
|
|
422
|
-
|
|
431
|
+
registerWatcher(e, n) {
|
|
432
|
+
const t = this.componentData.get(e);
|
|
433
|
+
t && t.watchers.set(n, n);
|
|
423
434
|
}
|
|
424
435
|
/**
|
|
425
436
|
* Temporarily disable dependency tracking
|
|
@@ -446,46 +457,46 @@ class P {
|
|
|
446
457
|
shouldEmitRenderWarning() {
|
|
447
458
|
const e = this.currentComponentStack.length ? this.currentComponentStack[this.currentComponentStack.length - 1] : null;
|
|
448
459
|
if (!e) return !0;
|
|
449
|
-
const
|
|
450
|
-
if (!
|
|
451
|
-
const
|
|
452
|
-
return
|
|
460
|
+
const n = this.componentData.get(e);
|
|
461
|
+
if (!n) return !0;
|
|
462
|
+
const t = Date.now();
|
|
463
|
+
return t - n.lastWarnTime < 1e3 ? !1 : (n.lastWarnTime = t, !0);
|
|
453
464
|
}
|
|
454
465
|
/**
|
|
455
466
|
* Execute a function with tracking disabled
|
|
456
467
|
*/
|
|
457
468
|
withoutTracking(e) {
|
|
458
|
-
const
|
|
469
|
+
const n = this.trackingDisabled;
|
|
459
470
|
this.trackingDisabled = !0;
|
|
460
471
|
try {
|
|
461
472
|
return e();
|
|
462
473
|
} finally {
|
|
463
|
-
this.trackingDisabled =
|
|
474
|
+
this.trackingDisabled = n;
|
|
464
475
|
}
|
|
465
476
|
}
|
|
466
477
|
/**
|
|
467
478
|
* Get or create a state instance for the current component
|
|
468
479
|
*/
|
|
469
480
|
getOrCreateState(e) {
|
|
470
|
-
const
|
|
471
|
-
if (!t)
|
|
472
|
-
return new k(e);
|
|
473
|
-
const n = this.componentData.get(t);
|
|
481
|
+
const n = this.currentComponentStack.length ? this.currentComponentStack[this.currentComponentStack.length - 1] : null;
|
|
474
482
|
if (!n)
|
|
475
|
-
return new
|
|
476
|
-
const
|
|
483
|
+
return new _(e);
|
|
484
|
+
const t = this.componentData.get(n);
|
|
485
|
+
if (!t)
|
|
486
|
+
return new _(e);
|
|
487
|
+
const r = `${n}:${t.stateIndex++}`;
|
|
477
488
|
let i = this.stateStorage.get(r);
|
|
478
|
-
return i || (i = new
|
|
489
|
+
return i || (i = new _(e), this.stateStorage.set(r, i)), i;
|
|
479
490
|
}
|
|
480
491
|
/**
|
|
481
492
|
* Track a dependency for the current component
|
|
482
493
|
*/
|
|
483
494
|
trackDependency(e) {
|
|
484
495
|
if (this.trackingDisabled) return;
|
|
485
|
-
const
|
|
486
|
-
if (!
|
|
487
|
-
const
|
|
488
|
-
|
|
496
|
+
const n = this.currentComponentStack.length ? this.currentComponentStack[this.currentComponentStack.length - 1] : null;
|
|
497
|
+
if (!n) return;
|
|
498
|
+
const t = this.componentData.get(n);
|
|
499
|
+
t && (t.dependencies.add(e), e.addDependent(n));
|
|
489
500
|
}
|
|
490
501
|
/**
|
|
491
502
|
* Re-register all reactive dependencies that `fromId` tracks into the
|
|
@@ -496,42 +507,42 @@ class P {
|
|
|
496
507
|
*/
|
|
497
508
|
propagateDependencies(e) {
|
|
498
509
|
if (this.trackingDisabled) return;
|
|
499
|
-
const
|
|
500
|
-
if (!
|
|
501
|
-
const
|
|
502
|
-
if (!
|
|
503
|
-
const r = this.componentData.get(
|
|
510
|
+
const n = this.currentComponentStack.length ? this.currentComponentStack[this.currentComponentStack.length - 1] : null;
|
|
511
|
+
if (!n || n === e) return;
|
|
512
|
+
const t = this.componentData.get(e);
|
|
513
|
+
if (!t) return;
|
|
514
|
+
const r = this.componentData.get(n);
|
|
504
515
|
if (r)
|
|
505
|
-
for (const i of
|
|
506
|
-
r.dependencies.add(i), i.addDependent(
|
|
516
|
+
for (const i of t.dependencies)
|
|
517
|
+
r.dependencies.add(i), i.addDependent(n);
|
|
507
518
|
}
|
|
508
519
|
/**
|
|
509
520
|
* Trigger updates for all components that depend on a state
|
|
510
521
|
*/
|
|
511
522
|
triggerUpdate(e) {
|
|
512
|
-
const
|
|
513
|
-
for (const
|
|
514
|
-
const r = this.componentData.get(
|
|
515
|
-
r &&
|
|
523
|
+
const n = e.getDependents();
|
|
524
|
+
for (const t of n) {
|
|
525
|
+
const r = this.componentData.get(t);
|
|
526
|
+
r && x(r.renderFn, t);
|
|
516
527
|
}
|
|
517
528
|
}
|
|
518
529
|
/**
|
|
519
530
|
* Clean up component dependencies when component is destroyed
|
|
520
531
|
*/
|
|
521
532
|
cleanup(e) {
|
|
522
|
-
const
|
|
523
|
-
if (
|
|
524
|
-
for (const r of
|
|
533
|
+
const n = this.componentData.get(e);
|
|
534
|
+
if (n) {
|
|
535
|
+
for (const r of n.dependencies)
|
|
525
536
|
r.removeDependent(e);
|
|
526
537
|
this.componentData.delete(e);
|
|
527
538
|
}
|
|
528
|
-
const
|
|
539
|
+
const t = e + ":";
|
|
529
540
|
for (const r of this.stateStorage.keys())
|
|
530
|
-
r.startsWith(
|
|
541
|
+
r.startsWith(t) && this.stateStorage.delete(r);
|
|
531
542
|
}
|
|
532
543
|
}
|
|
533
|
-
const c = new
|
|
534
|
-
class
|
|
544
|
+
const c = new W();
|
|
545
|
+
class _ {
|
|
535
546
|
_value;
|
|
536
547
|
/** The unwrapped value last assigned — used for Object.is equality checks. */
|
|
537
548
|
_rawValue;
|
|
@@ -551,7 +562,7 @@ class k {
|
|
|
551
562
|
return c.trackDependency(this), this._value;
|
|
552
563
|
}
|
|
553
564
|
set value(e) {
|
|
554
|
-
Object.is(e, this._rawValue) || (c.isRenderingComponent() && c.shouldEmitRenderWarning() &&
|
|
565
|
+
Object.is(e, this._rawValue) || (c.isRenderingComponent() && c.shouldEmitRenderWarning() && d(
|
|
555
566
|
`🚨 State modification detected during render! This can cause infinite loops.
|
|
556
567
|
• Move state updates to event handlers
|
|
557
568
|
• Use watchEffect/watch for side effects
|
|
@@ -588,19 +599,19 @@ class k {
|
|
|
588
599
|
return this.dependents;
|
|
589
600
|
}
|
|
590
601
|
makeReactive(e) {
|
|
591
|
-
return e === null || typeof e != "object" || e instanceof Node || e instanceof Element || e instanceof HTMLElement ? e :
|
|
602
|
+
return e === null || typeof e != "object" || e instanceof Node || e instanceof Element || e instanceof HTMLElement ? e : A.createReactiveProxy(
|
|
592
603
|
e,
|
|
593
604
|
() => c.triggerUpdate(this),
|
|
594
|
-
(
|
|
605
|
+
(n) => this.makeReactive(n)
|
|
595
606
|
);
|
|
596
607
|
}
|
|
597
608
|
}
|
|
598
|
-
function
|
|
609
|
+
function Z(s) {
|
|
599
610
|
return c.getOrCreateState(
|
|
600
611
|
s === void 0 ? null : s
|
|
601
612
|
);
|
|
602
613
|
}
|
|
603
|
-
function
|
|
614
|
+
function E(s) {
|
|
604
615
|
if (!s || typeof s != "object") return !1;
|
|
605
616
|
try {
|
|
606
617
|
const e = /* @__PURE__ */ Symbol.for("@cer/ReactiveState");
|
|
@@ -610,69 +621,78 @@ function w(s) {
|
|
|
610
621
|
}
|
|
611
622
|
}
|
|
612
623
|
function B(s) {
|
|
613
|
-
let e,
|
|
614
|
-
const
|
|
615
|
-
|
|
624
|
+
let e, n = !0;
|
|
625
|
+
const t = S("computed"), r = () => {
|
|
626
|
+
n = !0;
|
|
616
627
|
};
|
|
617
628
|
try {
|
|
618
629
|
const i = c.getCurrentComponentId();
|
|
619
|
-
i && c.registerWatcher(i,
|
|
630
|
+
i && c.registerWatcher(i, t);
|
|
620
631
|
} catch {
|
|
621
632
|
}
|
|
622
|
-
return c.setCurrentComponent(
|
|
633
|
+
return c.setCurrentComponent(t, r), e = s(), c.clearCurrentComponent(), n = !1, {
|
|
623
634
|
get value() {
|
|
624
|
-
return
|
|
635
|
+
return n && (c.setCurrentComponent(t, r), e = s(), c.clearCurrentComponent(), n = !1), c.propagateDependencies(t), e;
|
|
625
636
|
}
|
|
626
637
|
};
|
|
627
638
|
}
|
|
628
639
|
function K(s) {
|
|
629
|
-
if (
|
|
640
|
+
if (R()) return () => {
|
|
630
641
|
};
|
|
631
|
-
const e =
|
|
642
|
+
const e = S("effect");
|
|
632
643
|
try {
|
|
633
|
-
const
|
|
634
|
-
|
|
644
|
+
const t = c.getCurrentComponentId();
|
|
645
|
+
t && c.registerWatcher(t, e);
|
|
635
646
|
} catch {
|
|
636
647
|
}
|
|
637
|
-
const
|
|
638
|
-
c.setCurrentComponent(e,
|
|
648
|
+
const n = () => {
|
|
649
|
+
c.setCurrentComponent(e, n);
|
|
639
650
|
try {
|
|
640
651
|
s();
|
|
641
652
|
} finally {
|
|
642
653
|
c.clearCurrentComponent();
|
|
643
654
|
}
|
|
644
655
|
};
|
|
645
|
-
return
|
|
656
|
+
return n(), () => {
|
|
646
657
|
c.cleanup(e);
|
|
647
658
|
};
|
|
648
659
|
}
|
|
649
|
-
|
|
660
|
+
const b = 50;
|
|
661
|
+
function k(s, e = /* @__PURE__ */ new WeakMap(), n = 0) {
|
|
650
662
|
if (s === null || typeof s != "object") return s;
|
|
651
663
|
const t = s;
|
|
652
664
|
if (e.has(t)) return e.get(t);
|
|
665
|
+
if (n > b)
|
|
666
|
+
return d(
|
|
667
|
+
`[watch] Deep clone exceeded ${b} nesting levels. Returning a reference at this depth instead of cloning further. Consider restructuring your state or switching to a shallow watch.`
|
|
668
|
+
), s;
|
|
653
669
|
if (typeof Node < "u" && t instanceof Node) return s;
|
|
654
670
|
if (t instanceof Date) return new Date(t.getTime());
|
|
655
671
|
if (Array.isArray(t)) {
|
|
656
|
-
const
|
|
657
|
-
e.set(t,
|
|
658
|
-
for (let
|
|
659
|
-
|
|
660
|
-
return
|
|
661
|
-
}
|
|
662
|
-
const
|
|
663
|
-
e.set(t,
|
|
664
|
-
for (const
|
|
672
|
+
const i = [];
|
|
673
|
+
e.set(t, i);
|
|
674
|
+
for (let a = 0; a < t.length; a++)
|
|
675
|
+
i.push(k(t[a], e, n + 1));
|
|
676
|
+
return i;
|
|
677
|
+
}
|
|
678
|
+
const r = {};
|
|
679
|
+
e.set(t, r);
|
|
680
|
+
for (const i of Object.keys(t))
|
|
665
681
|
try {
|
|
666
|
-
|
|
682
|
+
r[i] = k(
|
|
683
|
+
t[i],
|
|
684
|
+
e,
|
|
685
|
+
n + 1
|
|
686
|
+
);
|
|
667
687
|
} catch {
|
|
668
688
|
}
|
|
669
|
-
return
|
|
689
|
+
return r;
|
|
670
690
|
}
|
|
671
|
-
function J(s, e,
|
|
672
|
-
if (
|
|
691
|
+
function J(s, e, n) {
|
|
692
|
+
if (R()) return () => {
|
|
673
693
|
};
|
|
674
|
-
let
|
|
675
|
-
const r =
|
|
694
|
+
let t;
|
|
695
|
+
const r = E(s) ? () => s.value : s, i = S("watch");
|
|
676
696
|
try {
|
|
677
697
|
const o = c.getCurrentComponentId();
|
|
678
698
|
o && c.registerWatcher(o, i);
|
|
@@ -681,14 +701,14 @@ function J(s, e, t) {
|
|
|
681
701
|
const a = () => {
|
|
682
702
|
c.setCurrentComponent(i, a);
|
|
683
703
|
const o = r();
|
|
684
|
-
if (c.clearCurrentComponent(),
|
|
685
|
-
const
|
|
686
|
-
() =>
|
|
704
|
+
if (c.clearCurrentComponent(), n?.deep) {
|
|
705
|
+
const l = c.withoutTracking(
|
|
706
|
+
() => k(o)
|
|
687
707
|
);
|
|
688
|
-
e(
|
|
689
|
-
} else o !==
|
|
708
|
+
e(l, t), t = l;
|
|
709
|
+
} else o !== t && (e(o, t), t = o);
|
|
690
710
|
};
|
|
691
|
-
return c.setCurrentComponent(i, a),
|
|
711
|
+
return c.setCurrentComponent(i, a), t = r(), c.clearCurrentComponent(), n?.deep && (t = c.withoutTracking(() => k(t))), n && n.immediate && e(t, void 0), () => {
|
|
692
712
|
c.cleanup(i);
|
|
693
713
|
};
|
|
694
714
|
}
|
|
@@ -697,60 +717,60 @@ const Q = (s) => {
|
|
|
697
717
|
s();
|
|
698
718
|
} catch {
|
|
699
719
|
}
|
|
700
|
-
},
|
|
701
|
-
let
|
|
702
|
-
const
|
|
720
|
+
}, g = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), M = 500;
|
|
721
|
+
let f, U, v = !1, D = !1, I;
|
|
722
|
+
const O = !!globalThis.process?.versions?.node;
|
|
703
723
|
function Y(s) {
|
|
704
|
-
if (
|
|
705
|
-
return
|
|
724
|
+
if (g.has(s))
|
|
725
|
+
return g.get(s);
|
|
706
726
|
const e = s.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
707
|
-
return
|
|
727
|
+
return g.size < M && g.set(s, e), e;
|
|
708
728
|
}
|
|
709
729
|
function ee(s) {
|
|
710
|
-
if (
|
|
711
|
-
return
|
|
712
|
-
const e = s.replace(/-([a-z])/g, (
|
|
713
|
-
return
|
|
730
|
+
if (m.has(s))
|
|
731
|
+
return m.get(s);
|
|
732
|
+
const e = s.replace(/-([a-z])/g, (n, t) => t.toUpperCase());
|
|
733
|
+
return m.size < M && m.set(s, e), e;
|
|
714
734
|
}
|
|
715
735
|
function te(s) {
|
|
716
736
|
if (typeof s == "string") {
|
|
717
|
-
if (
|
|
718
|
-
return
|
|
737
|
+
if (y.has(s))
|
|
738
|
+
return y.get(s);
|
|
719
739
|
const e = s.replace(
|
|
720
740
|
/[&<>"']/g,
|
|
721
|
-
(
|
|
741
|
+
(n) => ({
|
|
722
742
|
"&": "&",
|
|
723
743
|
"<": "<",
|
|
724
744
|
">": ">",
|
|
725
745
|
'"': """,
|
|
726
746
|
"'": "'"
|
|
727
|
-
})[
|
|
747
|
+
})[n]
|
|
728
748
|
);
|
|
729
|
-
return e !== s &&
|
|
749
|
+
return e !== s && y.size < M && y.set(s, e), e;
|
|
730
750
|
}
|
|
731
751
|
return s;
|
|
732
752
|
}
|
|
733
|
-
function
|
|
753
|
+
function u(s) {
|
|
734
754
|
if (!s) return "";
|
|
735
755
|
const e = String(s);
|
|
736
756
|
if (typeof document < "u" && typeof document.createElement == "function") {
|
|
737
|
-
const o = e.replace(/</g, "").replace(/>/g, ""),
|
|
757
|
+
const o = e.replace(/</g, "").replace(/>/g, ""), l = I || (I = document.createElement("div"));
|
|
738
758
|
try {
|
|
739
|
-
|
|
759
|
+
u._el = l;
|
|
740
760
|
} catch {
|
|
741
761
|
}
|
|
742
|
-
return
|
|
762
|
+
return l.innerHTML = o, (l.textContent || "").replace(new RegExp("", "g"), "<").replace(new RegExp("", "g"), ">");
|
|
743
763
|
}
|
|
744
|
-
const
|
|
764
|
+
const n = {
|
|
745
765
|
lt: "<",
|
|
746
766
|
gt: ">",
|
|
747
767
|
amp: "&",
|
|
748
768
|
quot: '"',
|
|
749
769
|
apos: "'",
|
|
750
770
|
nbsp: " "
|
|
751
|
-
},
|
|
752
|
-
let r =
|
|
753
|
-
if (!r &&
|
|
771
|
+
}, t = f ?? u._namedMap;
|
|
772
|
+
let r = t;
|
|
773
|
+
if (!r && O)
|
|
754
774
|
try {
|
|
755
775
|
const i = globalThis.require;
|
|
756
776
|
if (typeof i == "function") {
|
|
@@ -766,9 +786,9 @@ function l(s) {
|
|
|
766
786
|
];
|
|
767
787
|
for (const o of a)
|
|
768
788
|
try {
|
|
769
|
-
const
|
|
770
|
-
if (
|
|
771
|
-
r =
|
|
789
|
+
const l = i(o);
|
|
790
|
+
if (l && typeof l == "object") {
|
|
791
|
+
r = l;
|
|
772
792
|
break;
|
|
773
793
|
}
|
|
774
794
|
} catch {
|
|
@@ -777,29 +797,29 @@ function l(s) {
|
|
|
777
797
|
} catch {
|
|
778
798
|
}
|
|
779
799
|
if (!r) {
|
|
780
|
-
r =
|
|
800
|
+
r = n, v = !0;
|
|
781
801
|
try {
|
|
782
|
-
|
|
802
|
+
u._usedFallback = !0;
|
|
783
803
|
} catch {
|
|
784
804
|
}
|
|
785
|
-
const i =
|
|
805
|
+
const i = u._namedMapLoader ?? U;
|
|
786
806
|
i && i().then((a) => {
|
|
787
|
-
|
|
807
|
+
f = a;
|
|
788
808
|
try {
|
|
789
|
-
|
|
809
|
+
u._namedMap = a;
|
|
790
810
|
} catch {
|
|
791
811
|
}
|
|
792
812
|
}).catch(() => {
|
|
793
813
|
});
|
|
794
814
|
}
|
|
795
|
-
if ((
|
|
796
|
-
|
|
815
|
+
if ((v || u._usedFallback) && !(D || u._warnedFallback)) {
|
|
816
|
+
D = !0;
|
|
797
817
|
try {
|
|
798
|
-
|
|
818
|
+
u._warnedFallback = !0;
|
|
799
819
|
} catch {
|
|
800
820
|
}
|
|
801
821
|
try {
|
|
802
|
-
|
|
822
|
+
d(
|
|
803
823
|
"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."
|
|
804
824
|
);
|
|
805
825
|
} catch {
|
|
@@ -807,14 +827,14 @@ function l(s) {
|
|
|
807
827
|
}
|
|
808
828
|
return e.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g, (i, a) => {
|
|
809
829
|
if (a.charCodeAt(0) === 35) {
|
|
810
|
-
const
|
|
811
|
-
return Number.isNaN(
|
|
830
|
+
const h = (a.charAt(1) || "").toLowerCase() === "x" ? parseInt(a.slice(2), 16) : parseInt(a.slice(1), 10);
|
|
831
|
+
return Number.isNaN(h) ? `&${a};` : String.fromCodePoint(h);
|
|
812
832
|
}
|
|
813
|
-
const o = r[a] ?? (
|
|
833
|
+
const o = r[a] ?? (t && t[a]);
|
|
814
834
|
return o !== void 0 ? o : `&${a};`;
|
|
815
835
|
});
|
|
816
836
|
}
|
|
817
|
-
async function
|
|
837
|
+
async function H() {
|
|
818
838
|
const s = [
|
|
819
839
|
"@jasonshimmy",
|
|
820
840
|
"custom-elements-runtime",
|
|
@@ -835,14 +855,14 @@ async function I() {
|
|
|
835
855
|
"../../entities.json",
|
|
836
856
|
"../../../entities.json"
|
|
837
857
|
];
|
|
838
|
-
for (const
|
|
858
|
+
for (const n of e)
|
|
839
859
|
try {
|
|
840
|
-
const
|
|
860
|
+
const t = await import(
|
|
841
861
|
/* @vite-ignore */
|
|
842
|
-
|
|
862
|
+
n
|
|
843
863
|
);
|
|
844
|
-
if (
|
|
845
|
-
return
|
|
864
|
+
if (t)
|
|
865
|
+
return t && (t.default || t);
|
|
846
866
|
} catch {
|
|
847
867
|
}
|
|
848
868
|
return {
|
|
@@ -865,13 +885,13 @@ async function I() {
|
|
|
865
885
|
}
|
|
866
886
|
}
|
|
867
887
|
}
|
|
868
|
-
U =
|
|
869
|
-
|
|
888
|
+
U = H;
|
|
889
|
+
u._namedMapLoader = H;
|
|
870
890
|
function ne(s, e) {
|
|
871
|
-
!s || typeof s != "object" ||
|
|
891
|
+
!s || typeof s != "object" || f && !e?.overwrite || (f = s);
|
|
872
892
|
}
|
|
873
893
|
function se() {
|
|
874
|
-
|
|
894
|
+
f = void 0;
|
|
875
895
|
}
|
|
876
896
|
function re(s) {
|
|
877
897
|
const e = String(s);
|
|
@@ -883,32 +903,32 @@ function ie(s) {
|
|
|
883
903
|
function ae(s, e) {
|
|
884
904
|
if (typeof e == "string") {
|
|
885
905
|
if (e === "") return;
|
|
886
|
-
const
|
|
887
|
-
let
|
|
888
|
-
for (const r of
|
|
889
|
-
if (
|
|
890
|
-
|
|
906
|
+
const n = e.split(".");
|
|
907
|
+
let t = s;
|
|
908
|
+
for (const r of n) {
|
|
909
|
+
if (t == null || typeof t != "object") {
|
|
910
|
+
t = void 0;
|
|
891
911
|
break;
|
|
892
912
|
}
|
|
893
|
-
|
|
913
|
+
t = t[r];
|
|
894
914
|
}
|
|
895
|
-
return
|
|
915
|
+
return E(t) ? t.value : t;
|
|
896
916
|
}
|
|
897
917
|
return e;
|
|
898
918
|
}
|
|
899
|
-
function ce(s, e,
|
|
900
|
-
const
|
|
919
|
+
function ce(s, e, n) {
|
|
920
|
+
const t = String(e).split("."), r = t.pop();
|
|
901
921
|
if (!r) return;
|
|
902
|
-
const i =
|
|
922
|
+
const i = t.reduce(
|
|
903
923
|
(a, o) => (a[o] == null && (a[o] = {}), a[o]),
|
|
904
924
|
s
|
|
905
925
|
);
|
|
906
|
-
|
|
926
|
+
E(i[r]) ? i[r].value = n : i[r] = n;
|
|
907
927
|
}
|
|
908
|
-
function
|
|
928
|
+
function j(s) {
|
|
909
929
|
try {
|
|
910
930
|
if (s && typeof s == "object") {
|
|
911
|
-
if (
|
|
931
|
+
if (E(s)) return s.value;
|
|
912
932
|
if ("value" in s) {
|
|
913
933
|
const e = s.value;
|
|
914
934
|
return e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : s;
|
|
@@ -919,91 +939,49 @@ function F(s) {
|
|
|
919
939
|
return s;
|
|
920
940
|
}
|
|
921
941
|
function oe(s) {
|
|
922
|
-
const e =
|
|
942
|
+
const e = j(s);
|
|
923
943
|
if (e == null) return null;
|
|
924
|
-
const
|
|
925
|
-
return
|
|
944
|
+
const n = typeof e;
|
|
945
|
+
return n === "string" || n === "number" || n === "boolean" ? String(e) : null;
|
|
926
946
|
}
|
|
927
|
-
function
|
|
947
|
+
function le(s) {
|
|
928
948
|
if (!s || typeof s != "string") return !1;
|
|
929
949
|
if (s === "class" || s.endsWith("Class")) return !0;
|
|
930
950
|
if (s.includes("-"))
|
|
931
951
|
try {
|
|
932
|
-
if (s.split("-").some((
|
|
952
|
+
if (s.split("-").some((n) => n === "class")) return !0;
|
|
933
953
|
} catch {
|
|
934
954
|
}
|
|
935
955
|
return !1;
|
|
936
956
|
}
|
|
937
|
-
const N = {
|
|
938
|
-
xlink: "http://www.w3.org/1999/xlink",
|
|
939
|
-
xml: "http://www.w3.org/XML/1998/namespace"
|
|
940
|
-
};
|
|
941
|
-
function le(s, e, t) {
|
|
942
|
-
try {
|
|
943
|
-
if (!e || !e.includes(":")) {
|
|
944
|
-
s.setAttribute(e, t);
|
|
945
|
-
return;
|
|
946
|
-
}
|
|
947
|
-
const n = e.indexOf(":"), r = e.substring(0, n), i = e.substring(n + 1), a = N[r];
|
|
948
|
-
a ? s.setAttributeNS(a, i, t) : s.setAttribute(e, t);
|
|
949
|
-
} catch {
|
|
950
|
-
try {
|
|
951
|
-
s.setAttribute(e, t);
|
|
952
|
-
} catch {
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
function de(s, e) {
|
|
957
|
-
try {
|
|
958
|
-
if (!e || !e.includes(":")) {
|
|
959
|
-
s.removeAttribute(e);
|
|
960
|
-
return;
|
|
961
|
-
}
|
|
962
|
-
const t = e.indexOf(":"), n = e.substring(0, t), r = e.substring(t + 1), i = N[n];
|
|
963
|
-
i ? s.removeAttributeNS(i, r) : s.removeAttribute(e);
|
|
964
|
-
} catch {
|
|
965
|
-
try {
|
|
966
|
-
s.removeAttribute(e);
|
|
967
|
-
} catch {
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
const j = "http://www.w3.org/2000/svg", O = "http://www.w3.org/1998/Math/MathML", he = {
|
|
972
|
-
svg: j,
|
|
973
|
-
math: O
|
|
974
|
-
};
|
|
975
957
|
export {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
ie as C,
|
|
979
|
-
k as R,
|
|
980
|
-
j as S,
|
|
981
|
-
he as T,
|
|
958
|
+
R as A,
|
|
959
|
+
_ as R,
|
|
982
960
|
c as a,
|
|
983
961
|
K as b,
|
|
984
962
|
B as c,
|
|
985
|
-
|
|
963
|
+
u as d,
|
|
986
964
|
te as e,
|
|
987
965
|
q as f,
|
|
988
966
|
se as g,
|
|
989
967
|
ne as h,
|
|
990
|
-
|
|
968
|
+
E as i,
|
|
991
969
|
ae as j,
|
|
992
970
|
ce as k,
|
|
993
|
-
|
|
971
|
+
H as l,
|
|
994
972
|
Q as m,
|
|
995
973
|
$ as n,
|
|
996
974
|
oe as o,
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
975
|
+
ee as p,
|
|
976
|
+
le as q,
|
|
977
|
+
Z as r,
|
|
1000
978
|
V as s,
|
|
1001
979
|
Y as t,
|
|
1002
980
|
re as u,
|
|
1003
|
-
|
|
981
|
+
x as v,
|
|
1004
982
|
J as w,
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
983
|
+
X as x,
|
|
984
|
+
G as y,
|
|
985
|
+
ie as z
|
|
1008
986
|
};
|
|
1009
|
-
//# sourceMappingURL=
|
|
987
|
+
//# sourceMappingURL=helpers-CweFZFWU.js.map
|