@fest-lib/object 0.1.6 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +1729 -0
  2. package/package.json +4 -2
package/dist/index.js ADDED
@@ -0,0 +1,1729 @@
1
+ var Ze = /* @__PURE__ */ Symbol.for("@fix"), m = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" || typeof e > "u" || e == null, E = (e, t) => m(e) ? t == "number" ? Number(e) || 0 : t == "string" ? String(e) || "" : t == "boolean" ? !!e : e : null, ke = (e, t = "value") => (typeof e == "object" || typeof e == "function") && e != null && (t in e || e?.[t] != null), I = (e) => ke(e, "value"), He = (e) => m(e) ? e : I(e) ? e?.value : e, S = (e, t) => e?.[Ze] ?? e ?? t ?? t, yt = (e) => {
2
+ if (typeof e == "function" || e == null) return e;
3
+ const t = function() {
4
+ };
5
+ return t[Ze] = e, t;
6
+ }, Q = /* @__PURE__ */ Symbol.for("@trigger-lock"), ye = (e, t, r = "value") => {
7
+ ke(e, r) && (e[Q] = !0);
8
+ let n;
9
+ try {
10
+ n = t?.();
11
+ } finally {
12
+ ke(e, r) && delete e[Q];
13
+ }
14
+ return n;
15
+ }, at = (e, t) => e instanceof Promise || typeof e?.then == "function" ? e?.then?.(t) : t?.(e), ht = (e, t) => e instanceof Promise || typeof e?.then == "function" ? e?.then?.(t) : t?.(e), pe = function(e) {
16
+ return (t) => {
17
+ e[Q] = !0;
18
+ let r;
19
+ try {
20
+ r = t?.();
21
+ } finally {
22
+ e[Q] = !1;
23
+ }
24
+ return r;
25
+ };
26
+ }, dt = (e) => {
27
+ switch (typeof e) {
28
+ case "number":
29
+ return 0;
30
+ case "string":
31
+ return "";
32
+ case "boolean":
33
+ return !1;
34
+ case "object":
35
+ return null;
36
+ case "function":
37
+ return null;
38
+ case "symbol":
39
+ return null;
40
+ case "bigint":
41
+ return 0n;
42
+ }
43
+ }, j = (e) => typeof e?.[Symbol.iterator] == "function", C = (e) => [
44
+ "symbol",
45
+ "string",
46
+ "number"
47
+ ].indexOf(typeof e) >= 0, vt = (e, t, r = null) => {
48
+ const n = r != null && (typeof e == "object" || typeof e == "function") ? e?.[r] ?? e : e;
49
+ let i = [];
50
+ t instanceof Set || t instanceof Map || Array.isArray(t) || j(t) ? i = (n instanceof Set || n instanceof WeakSet ? t?.values?.() : t?.entries?.()) || (Array.isArray(t) || j(t) ? t : []) : (typeof t == "object" || typeof t == "function") && (i = n instanceof Set || n instanceof WeakSet ? Object.values(t) : Object.entries(t));
51
+ let s = [];
52
+ Array.isArray(n) ? s = n.entries() : n instanceof Map || n instanceof WeakMap ? s = n?.entries?.() : n instanceof Set || n instanceof WeakSet ? s = n?.values?.() : (typeof n == "object" || typeof n == "function") && (s = Object.entries(n));
53
+ const u = new Set(Array.from(i).map((o) => o?.[0])), l = new Set(Array.from(s).map((o) => o?.[0])), f = u?.difference?.(l);
54
+ if (Array.isArray(n)) {
55
+ const o = n.filter((y, a) => !f.has(a));
56
+ n.splice(0, n.length), n.push(...o);
57
+ } else if (n instanceof Map || n instanceof Set || n instanceof WeakMap || n instanceof WeakSet) for (const o of f) n.delete(o);
58
+ else if (typeof n == "function" || typeof n == "object") for (const o of f) delete n[o];
59
+ return n;
60
+ }, ie = (e, t, r = null, n = !0, i = "id") => {
61
+ const s = r != null && (typeof e == "object" || typeof e == "function") ? e?.[r] ?? e : e;
62
+ let u = null;
63
+ if (n && vt(s, t), t instanceof Set || t instanceof Map || Array.isArray(t) || j(t) ? u = (s instanceof Set || s instanceof WeakSet ? t?.values?.() : t?.entries?.()) || (Array.isArray(t) || j(t) ? t : []) : (typeof t == "object" || typeof t == "function") && (u = s instanceof Set || s instanceof WeakSet ? Object.values(t) : Object.entries(t)), s && u && (typeof u == "object" || typeof u == "function")) {
64
+ if (s instanceof Map || s instanceof WeakMap) {
65
+ for (const l of u) s.set(...l);
66
+ return s;
67
+ }
68
+ if (s instanceof Set || s instanceof WeakSet) {
69
+ for (const l of u) {
70
+ const f = l?.[i] ? Array.from(s?.values?.() || []).find((o) => !x?.(o?.[i], l?.[i])) : null;
71
+ f != null ? ie(f, l, null, n, i) : s.add(l);
72
+ }
73
+ return s;
74
+ }
75
+ if (typeof s == "object" || typeof s == "function") {
76
+ if (Array.isArray(s) || j(s)) {
77
+ let l = 0;
78
+ for (const f of u) l < s.length ? s[l++] = f?.[1] : s?.push?.(f?.[1]);
79
+ return s;
80
+ }
81
+ return Object.assign(s, Object.fromEntries([...u || []].filter((l) => typeof l != "symbol")));
82
+ }
83
+ }
84
+ return r != null ? (Reflect.set(e, r, t), e) : typeof t == "object" || typeof t == "function" ? Object.assign(e, t) : t;
85
+ }, bt = (e, t) => pt.getOrInsert(e, /* @__PURE__ */ new WeakMap()).getOrInsert(t, t?.bind?.(e)), H = (e, t) => (typeof t == "function" ? bt(e, t) : t) ?? t, ae = (e, t, r, n) => {
86
+ if (t == Symbol.iterator) return Ve(e, r, n);
87
+ if (t == null || typeof t == "symbol" || typeof t == "object" || typeof t == "function") return;
88
+ const i = (s, ...u) => {
89
+ if (s != null) return r?.(s, ...u);
90
+ };
91
+ if (e instanceof Map || e instanceof WeakMap) {
92
+ if (e.has(t)) return i?.(e.get(t), t, null, "@set");
93
+ } else if (e instanceof Set || e instanceof WeakSet) {
94
+ if (e.has(t)) return i?.(t, t, null, "@add");
95
+ } else if (Array.isArray(e) && typeof t == "string" && [...t?.matchAll?.(/^\d+$/g)].length == 1 && Number.isInteger(typeof t == "string" ? parseInt(t) : t)) {
96
+ const s = typeof t == "string" ? parseInt(t) : t;
97
+ return i?.(e?.[s], s, null, "@add");
98
+ } else if (typeof e == "function" || typeof e == "object") return i?.(e?.[t], t, null, "@set");
99
+ }, St = (e, t = {}) => (Object.entries(t)?.forEach?.(([r, n]) => {
100
+ x(n, e[r]) && (e[r] = n);
101
+ }), e), Ve = (e, t, r) => {
102
+ if (e == null) return;
103
+ let n = [];
104
+ if (e instanceof Set || e instanceof Map || typeof e?.keys == "function") return [...e?.keys?.() || n].forEach?.((i) => ae(e, i, t, r));
105
+ if (Array.isArray(e) || j(e)) return [...e].forEach?.((i, s) => ae(e, s, t, r));
106
+ if (typeof e == "object" || typeof e == "function") return [...Object.keys(e) || n].forEach?.((i) => ae(e, i, t, r));
107
+ }, x = (e, t) => e == null && t == null ? !1 : e == null || t == null ? !0 : typeof e == "boolean" && typeof t == "boolean" ? e != t : typeof e == "number" && typeof t == "number" ? !(e == t || Math.abs(e - t) < 1e-9) : typeof e == "string" && typeof t == "string" ? e != "" && t != "" && e != t || e !== t : typeof e != typeof t ? e !== t : e && t && e != t || e !== t, pt = /* @__PURE__ */ new WeakMap(), le = (e, t) => {
108
+ const r = e == null || e < 0 || typeof e != "number" || e == Symbol.iterator || (t != null ? e >= (t?.length || 0) : !1);
109
+ return t != null ? Array.isArray(t) && r : !1;
110
+ }, $ = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), P = (e, t) => e instanceof Promise || typeof e?.then == "function" ? $?.has?.(e) ? t($?.get?.(e)) : Promise.try?.(async () => {
111
+ const r = await e;
112
+ return $?.set?.(e, r), r;
113
+ })?.then?.(t) : t(e), mt = class {
114
+ #t;
115
+ #e;
116
+ constructor(e, t) {
117
+ this.#t = e, this.#e = t;
118
+ }
119
+ defineProperty(e, t, r) {
120
+ return S(e) instanceof Promise ? Reflect.defineProperty(e, t, r) : P(S(e), (n) => Reflect.defineProperty(n, t, r));
121
+ }
122
+ deleteProperty(e, t) {
123
+ return S(e) instanceof Promise ? Reflect.deleteProperty(e, t) : P(S(e), (r) => Reflect.deleteProperty(r, t));
124
+ }
125
+ getPrototypeOf(e) {
126
+ return S(e) instanceof Promise ? Reflect.getPrototypeOf(e) : P(S(e), (t) => Reflect.getPrototypeOf(t));
127
+ }
128
+ setPrototypeOf(e, t) {
129
+ return S(e) instanceof Promise ? Reflect.setPrototypeOf(e, t) : P(S(e), (r) => Reflect.setPrototypeOf(r, t));
130
+ }
131
+ isExtensible(e) {
132
+ return S(e) instanceof Promise ? Reflect.isExtensible(e) : P(S(e), (t) => Reflect.isExtensible(t));
133
+ }
134
+ preventExtensions(e) {
135
+ return S(e) instanceof Promise ? Reflect.ownKeys(e) : P(S(e), (t) => Reflect.preventExtensions(t));
136
+ }
137
+ ownKeys(e) {
138
+ const t = S(e);
139
+ return t instanceof Promise ? Object.keys(t) : P(t, (r) => (typeof r == "object" || typeof r == "function") && r != null ? Object.keys(r) : []) ?? [];
140
+ }
141
+ getOwnPropertyDescriptor(e, t) {
142
+ return S(e) instanceof Promise ? Reflect.getOwnPropertyDescriptor(e, t) : P(S(e), (r) => Reflect.getOwnPropertyDescriptor(r, t));
143
+ }
144
+ construct(e, t, r) {
145
+ return P(S(e), (n) => Reflect.construct(n, t, r));
146
+ }
147
+ has(e, t) {
148
+ return S(e) instanceof Promise ? Reflect.has(e, t) : P(S(e), (r) => Reflect.has(r, t));
149
+ }
150
+ get(e, t, r) {
151
+ if (e = S(e), t == "promise") return e;
152
+ if (t == "resolve" && this.#t) return (...i) => {
153
+ const s = this.#t?.(...i);
154
+ return this.#t = null, s;
155
+ };
156
+ if (t == "reject" && this.#e) return (...i) => {
157
+ const s = this.#e?.(...i);
158
+ return this.#e = null, s;
159
+ };
160
+ if (t == "then" || t == "catch" || t == "finally") {
161
+ if (e instanceof Promise) return e?.[t]?.bind?.(e);
162
+ {
163
+ const i = Promise.try(() => e);
164
+ return i?.[t]?.bind?.(i);
165
+ }
166
+ }
167
+ let n;
168
+ return $?.has?.(e) && (n = $?.get?.(e))?.[t] != null ? n = $?.get?.(e)?.[t] : n = Ee(P(e, async (i) => {
169
+ if (S(i) instanceof Promise) return Reflect.get(i, t, r);
170
+ if (m(i)) return t == Symbol.toPrimitive || t == Symbol.toStringTag ? i : void 0;
171
+ let s;
172
+ try {
173
+ s = Reflect.get(i, t, r);
174
+ } catch {
175
+ s = e?.[t];
176
+ }
177
+ return typeof s == "function" ? s?.bind?.(i) : s;
178
+ })), t == Symbol.toStringTag ? m(n) ? String(n ?? "") || "" : n?.[Symbol.toStringTag]?.() || String(n ?? "") || "" : t == Symbol.toPrimitive ? (i) => {
179
+ if (m(n)) return E(n, i);
180
+ } : n;
181
+ }
182
+ set(e, t, r) {
183
+ return P(S(e), (n) => Reflect.set(n, t, r));
184
+ }
185
+ apply(e, t, r) {
186
+ if (this.#t) {
187
+ const n = this.#t?.(...r);
188
+ return this.#t = null, n;
189
+ }
190
+ return P(S(e, this.#t), (n) => {
191
+ if (typeof n == "function")
192
+ return S(n) instanceof Promise, Reflect.apply(n, t, r);
193
+ });
194
+ }
195
+ };
196
+ function Ee(e, t, r) {
197
+ return e instanceof Promise || typeof e?.then == "function" ? $?.has?.(e) ? $?.get?.(e) : (Ke?.has?.(e) || e?.then?.((n) => $?.set?.(e, n)), Ke?.getOrInsertComputed?.(e, () => new Proxy(yt(e), new mt(t, r)))) : e;
198
+ }
199
+ Symbol.observable ||= /* @__PURE__ */ Symbol.for("observable");
200
+ Symbol.subscribe ||= /* @__PURE__ */ Symbol.for("subscribe");
201
+ Symbol.unsubscribe ||= /* @__PURE__ */ Symbol.for("unsubscribe");
202
+ var d = /* @__PURE__ */ Symbol.for("@value"), g = /* @__PURE__ */ Symbol.for("@extract"), _ = /* @__PURE__ */ Symbol.for("@origin"), se = /* @__PURE__ */ Symbol.for("@registry"), K = /* @__PURE__ */ Symbol.for("@behavior"), oe = /* @__PURE__ */ Symbol.for("@promise"), me = /* @__PURE__ */ Symbol.for("@trigger-less"), h = /* @__PURE__ */ Symbol.for("@trigger-lock"), gt = /* @__PURE__ */ Symbol.for("@trigger-control"), D = /* @__PURE__ */ Symbol.for("@trigger"), ue = /* @__PURE__ */ Symbol.for("@subscribe"), At = /* @__PURE__ */ Symbol.for("@isNotEqual"), de = /* @__PURE__ */ Symbol.for("@realProp"), qe = /* @__PURE__ */ new WeakMap(), he = (e) => {
203
+ const t = typeof e == "object" || typeof e == "function" ? e?.[g] ?? e : e, r = (n) => he(n);
204
+ return Array.isArray(t) ? t?.map?.(r) || Array.from(t || [])?.map?.(r) || [] : t instanceof Map || t instanceof WeakMap ? new Map(Array.from(t?.entries?.() || [])?.map?.(([n, i]) => [n, he(i)])) : t instanceof Set || t instanceof WeakSet ? new Set(Array.from(t?.values?.() || [])?.map?.(r)) : t != null && typeof t == "function" || typeof t == "object" ? Object.fromEntries(Array.from(Object.entries(t || {}) || [])?.filter?.(([n]) => n != g && n != _ && n != se)?.map?.(([n, i]) => [n, he(i)])) : t;
205
+ }, Ot = (e) => e?.[g] ?? e?.["@target"] ?? e, V = (e, t = !1) => {
206
+ const r = e;
207
+ if (m(e) || typeof e == "symbol") return e;
208
+ if (e != null && (e instanceof WeakRef || "deref" in e && typeof e?.deref == "function") && (e = e?.deref?.()), e != null && (typeof e == "object" || typeof e == "function")) {
209
+ e = Ot(e);
210
+ const n = t && I(e) && e?.value;
211
+ if (n != null && (typeof n == "object" || typeof n == "function") && (e = n), r != e) return V(e, t);
212
+ }
213
+ return e;
214
+ }, We = (e) => e != null && typeof e.then == "function", xt = (e, t) => m(e) || typeof e == "function" ? t?.(e) : We(e) ? e.then(t) : e?.promise && We(e.promise) ? e.promise.then(t) : t?.(e), Ue = /* @__PURE__ */ new WeakMap(), wt = new FinalizationRegistry((e) => {
215
+ e?.forEach?.((t) => t?.());
216
+ });
217
+ function M(e, t, r) {
218
+ if (!(!r || typeof r != "function" || typeof e != "object" && typeof e != "function"))
219
+ if (t == Symbol.dispose) {
220
+ const n = e?.[g] ?? e;
221
+ Ue?.getOrInsertComputed?.(n, () => {
222
+ const i = /* @__PURE__ */ new Set();
223
+ return (typeof n == "object" || typeof n == "function") && (wt.register(n, i), Ue.set(n, i), n[Symbol.dispose] ??= () => i.forEach((s) => {
224
+ s?.();
225
+ })), i;
226
+ })?.add?.(r);
227
+ } else e[t] = function(...n) {
228
+ const i = e?.[t];
229
+ typeof i == "function" && i.apply(this, n), r.apply(this, n);
230
+ };
231
+ }
232
+ var ee = (e) => {
233
+ if (typeof e != "string" || e === "") return !1;
234
+ const t = Number(e);
235
+ return Number.isInteger(t) && t >= 0 && String(t) === e;
236
+ };
237
+ function Sr(e = [], t = {}) {
238
+ let r = /* @__PURE__ */ new Set();
239
+ const n = (l, f, o) => {
240
+ t.onDuplicate?.({
241
+ value: l,
242
+ via: f,
243
+ index: o
244
+ });
245
+ };
246
+ if (e instanceof Set) r = e;
247
+ else for (const l of e) {
248
+ if (r.has(l)) {
249
+ n(l, "push");
250
+ continue;
251
+ }
252
+ r.add(l);
253
+ }
254
+ const i = () => Array.from(r), s = (l) => {
255
+ r.clear();
256
+ for (const f of l) r.add(f);
257
+ }, u = {
258
+ push: (...l) => {
259
+ let f = r.size;
260
+ for (const o of l) {
261
+ if (r.has(o)) {
262
+ n(o, "push");
263
+ continue;
264
+ }
265
+ r.add(o), f++;
266
+ }
267
+ return f;
268
+ },
269
+ pop: () => {
270
+ const l = i();
271
+ if (!l.length) return;
272
+ const f = l[l.length - 1];
273
+ return r.delete(f), f;
274
+ },
275
+ shift: () => {
276
+ const l = r.values().next();
277
+ if (l.done) return;
278
+ const f = l.value;
279
+ return r.delete(f), f;
280
+ },
281
+ unshift: (...l) => {
282
+ if (!l.length) return r.size;
283
+ const f = i(), o = [];
284
+ for (const a of l) {
285
+ if (f.includes(a) || o.includes(a)) {
286
+ n(a, "unshift", 0);
287
+ continue;
288
+ }
289
+ o.push(a);
290
+ }
291
+ if (!o.length) return f.length;
292
+ const y = [...o, ...f];
293
+ return s(y), y.length;
294
+ },
295
+ splice: (l, f, ...o) => {
296
+ const y = i(), a = Math.min(Math.max(l, 0), y.length), v = f === void 0 ? y.length - a : Math.max(0, Math.min(f, y.length - a)), A = y.splice(a, v);
297
+ let w = a;
298
+ for (const O of o) {
299
+ if (y.includes(O)) {
300
+ n(O, "splice", w);
301
+ continue;
302
+ }
303
+ y.splice(w++, 0, O);
304
+ }
305
+ return s(y), A;
306
+ },
307
+ includes: (l) => r.has(l),
308
+ indexOf: (l) => i().indexOf(l),
309
+ clear: () => {
310
+ r.clear();
311
+ },
312
+ delete: (l) => r.delete(l),
313
+ toArray: () => i(),
314
+ toSet: () => new Set(r),
315
+ [Symbol.iterator]: () => r[Symbol.iterator]()
316
+ };
317
+ return new Proxy(u, {
318
+ get: (l, f) => {
319
+ if (f === "length") return r.size;
320
+ if (ee(f)) return i()[Number(f)];
321
+ const o = u[f];
322
+ return o;
323
+ },
324
+ set: (l, f, o) => {
325
+ if (f === "length") {
326
+ if (typeof o != "number" || !Number.isFinite(o) || o < 0) throw new RangeError("length must be a finite non-negative number");
327
+ const y = Math.floor(o);
328
+ if (y >= r.size) return !0;
329
+ const a = i().slice(0, y);
330
+ return s(a), !0;
331
+ }
332
+ if (ee(f)) {
333
+ const y = i(), a = Number(f);
334
+ if (a > y.length) return !0;
335
+ const v = o;
336
+ if (a < y.length) {
337
+ const A = y[a];
338
+ if (Object.is(A, v)) return !0;
339
+ if (y.some((w, O) => O !== a && Object.is(w, v)))
340
+ return n(v, "set", a), !0;
341
+ y[a] = v;
342
+ } else {
343
+ if (y.includes(v))
344
+ return n(v, "set", a), !0;
345
+ y.push(v);
346
+ }
347
+ return s(y), !0;
348
+ }
349
+ return Reflect.set(u, f, o);
350
+ },
351
+ deleteProperty: (l, f) => {
352
+ if (f === "length") return !1;
353
+ if (ee(f)) {
354
+ const o = i(), y = Number(f);
355
+ return y >= o.length || (o.splice(y, 1), s(o)), !0;
356
+ }
357
+ return Reflect.deleteProperty(u, f);
358
+ },
359
+ ownKeys: () => {
360
+ const l = [];
361
+ let f = 0;
362
+ for (const o of r) l.push(String(f++));
363
+ return l.push("length"), l;
364
+ },
365
+ getOwnPropertyDescriptor: (l, f) => {
366
+ if (f === "length") return {
367
+ configurable: !1,
368
+ enumerable: !1,
369
+ writable: !0,
370
+ value: r.size
371
+ };
372
+ if (ee(f)) {
373
+ const o = i(), y = Number(f);
374
+ return y >= o.length ? void 0 : {
375
+ configurable: !0,
376
+ enumerable: !0,
377
+ writable: !0,
378
+ value: o[y]
379
+ };
380
+ }
381
+ return Reflect.getOwnPropertyDescriptor(u, f);
382
+ },
383
+ has: (l, f) => {
384
+ if (f === "length") return !0;
385
+ if (ee(f)) {
386
+ const o = Number(f);
387
+ return o >= 0 && o < r.size;
388
+ }
389
+ return f in u;
390
+ }
391
+ });
392
+ }
393
+ var Rt = class {
394
+ constructor() {
395
+ }
396
+ deleteProperty(e, t) {
397
+ return Reflect.deleteProperty(e, t);
398
+ }
399
+ construct(e, t, r) {
400
+ return Reflect.construct(e, t, r);
401
+ }
402
+ apply(e, t, r) {
403
+ return Reflect.apply(e, t, r);
404
+ }
405
+ has(e, t) {
406
+ return Reflect.has(e, t);
407
+ }
408
+ set(e, t, r) {
409
+ return ie(e, r, t), !0;
410
+ }
411
+ get(e, t, r) {
412
+ return typeof t == "symbol" ? e?.[t] ?? e : Reflect.get(e, t, r);
413
+ }
414
+ }, pr = (e) => {
415
+ if (e?.[_] || qe.has(e)) return e;
416
+ const t = new Proxy(e, new Rt());
417
+ return qe.set(t, e), t;
418
+ }, Le = /* @__PURE__ */ Symbol.for("object.ts@withUnsub");
419
+ globalThis[Le] ??= /* @__PURE__ */ new WeakMap();
420
+ var Tt = globalThis[Le], Pt = (e, t, r) => Tt.getOrInsert(e, () => {
421
+ const n = t?.deref?.();
422
+ n?.affected?.(r);
423
+ const i = e?.complete?.bind?.(e), s = () => {
424
+ const u = i?.();
425
+ return n?.unaffected?.(r), u;
426
+ };
427
+ return e.complete = s, {
428
+ unaffected: s,
429
+ [Symbol.dispose]: s,
430
+ [Symbol.asyncDispose]: s
431
+ };
432
+ }), et = /* @__PURE__ */ Symbol.for("object.ts@subscriptRegistry");
433
+ globalThis[et] ??= /* @__PURE__ */ new WeakMap();
434
+ var p = globalThis[et] ??= /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ Symbol.for("object.ts@globalEffectListeners");
435
+ globalThis[tt] ??= /* @__PURE__ */ new Map();
436
+ var ve = globalThis[tt], je = (e, t = ["*"]) => {
437
+ if (e == null || typeof e != "function") return;
438
+ const r = ut(t);
439
+ return ve.set(e, r.affectTypes), () => ve.delete(e);
440
+ }, rt = /* @__PURE__ */ Symbol.for("object.ts@wrapped");
441
+ globalThis[rt] ??= /* @__PURE__ */ new WeakMap();
442
+ var Mt = globalThis[rt], It = (e, t) => {
443
+ const r = e?.[g] ?? e;
444
+ let n = p.get(r);
445
+ return n ? n.bindSource(r) : (n = new Et(r), p.set(r, n)), t;
446
+ }, ce = (e, t) => (e = V(e?.[g] ?? e), typeof e == "symbol" || !(typeof e == "object" || typeof e == "function") || e == null ? e : Mt.getOrInsertComputed(e, () => new Proxy(e, It(e, t)))), te = /* @__PURE__ */ Symbol.for("@allProps"), nt = /* @__PURE__ */ new Set(["*", "all"]), ze = /* @__PURE__ */ new Map([
447
+ ["set", ["setter", "@set"]],
448
+ ["add", ["@add"]],
449
+ ["delete", ["@delete"]],
450
+ ["invalidate", ["@invalidate"]],
451
+ ["manual", ["@manual"]],
452
+ ["custom", ["@custom"]],
453
+ ["setAll", ["@setAll"]],
454
+ ["addAll", ["@addAll"]],
455
+ ["deleteAll", ["@deleteAll", "@clear"]]
456
+ ]), it = /* @__PURE__ */ Symbol.for("object.ts@triggerCanonicalNames");
457
+ globalThis[it] ??= new Map(Array.from(ze.entries()).flatMap(([e, t]) => t.map((r) => [r, e])));
458
+ var kt = globalThis[it], fe = (e = "set") => {
459
+ if (e == null) return e;
460
+ const t = String(e || "set");
461
+ return kt.get(t) ?? t;
462
+ }, lt = (e) => {
463
+ const t = e == null ? "all" : String(fe(e) ?? "all");
464
+ return [t, ...ze.get(t) ?? []];
465
+ }, Je = (e = ["*"]) => new Set([...X(e)].flatMap((t) => [t, ...ze.get(t) ?? []])), X = (e = ["*"]) => {
466
+ const t = typeof e == "string" ? [e] : Array.from(e ?? ["*"]), r = new Set(t.map((n) => {
467
+ const i = String(n || "*");
468
+ return nt.has(i) ? i : String(fe(i) ?? i);
469
+ }));
470
+ return r.size ? r : /* @__PURE__ */ new Set(["*"]);
471
+ }, J = (e, t) => {
472
+ const r = e instanceof Set ? e : X(e);
473
+ return [...nt].some((n) => r.has(n)) || lt(t).some((n) => r.has(n));
474
+ }, st = (e) => !!e && typeof e == "object" && !Array.isArray(e) && ("affectTypes" in e || "triggers" in e || "triggerImmediately" in e), ge = (e = ["*"]) => {
475
+ if (st(e)) return {
476
+ affectTypes: X(e.affectTypes ?? e.triggers ?? ["*"]),
477
+ triggerImmediately: e.triggerImmediately !== !1
478
+ };
479
+ const t = X(e);
480
+ return {
481
+ affectTypes: t,
482
+ triggerImmediately: J(t, "initial")
483
+ };
484
+ }, ut = (e = ["*"]) => st(e) ? {
485
+ affectTypes: X(e.affectTypes ?? e.triggers ?? ["*"]),
486
+ triggerImmediately: e.triggerImmediately === !0
487
+ } : {
488
+ affectTypes: X(e),
489
+ triggerImmediately: !1
490
+ }, ft = /* @__PURE__ */ Symbol.for("object.ts@Subscript");
491
+ globalThis[ft] ??= class {
492
+ compatible;
493
+ #t;
494
+ #e;
495
+ #r = /* @__PURE__ */ new WeakSet();
496
+ #f;
497
+ #o;
498
+ #l = /* @__PURE__ */ new Set();
499
+ #n = /* @__PURE__ */ new Set();
500
+ #c;
501
+ #y = /* @__PURE__ */ new Map();
502
+ #i = /* @__PURE__ */ new Map();
503
+ #s = !1;
504
+ constructor(t) {
505
+ this.#t = t, this.#e = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new WeakSet(), this.#c = {
506
+ enable: (i = ["*"], s) => s ? this.withTriggers(i, !0, s) : this.setTriggersEnabled(i, !0),
507
+ disable: (i = ["*"], s) => s ? this.withTriggers(i, !1, s) : this.setTriggersEnabled(i, !1),
508
+ set: (i, s) => this.setTriggersEnabled(i, s),
509
+ with: (i, s) => this.withTriggers(i, !0, s),
510
+ without: (i, s) => this.withTriggers(i, !1, s),
511
+ isEnabled: (i) => this.isTriggerEnabled(i)
512
+ }, this.#o = { next: (i) => {
513
+ i && (Array.isArray(i) ? this.#u(...i) : this.#u(i));
514
+ } };
515
+ const r = new WeakRef(this), n = function(i) {
516
+ const s = i?.next?.bind?.(i);
517
+ return Pt(i, r, s);
518
+ };
519
+ this.#f = typeof Observable < "u" ? new Observable(n) : null, this.compatible = () => this.#f;
520
+ }
521
+ bindSource(t) {
522
+ return this.#t ??= t, this;
523
+ }
524
+ $safeExec(t, ...r) {
525
+ if (!(!t || this.#r.has(t))) {
526
+ this.#r.add(t);
527
+ try {
528
+ const n = t(...r);
529
+ if (n && typeof n.then == "function") {
530
+ n.catch(console.warn);
531
+ return;
532
+ }
533
+ return n;
534
+ } catch (n) {
535
+ console.warn(n);
536
+ } finally {
537
+ this.#r.delete(t);
538
+ }
539
+ }
540
+ }
541
+ #u(t, r = null, n, i = "all", ...s) {
542
+ i = fe(i) ?? i;
543
+ const u = this.#e;
544
+ if (u?.size)
545
+ for (const [l, f] of u.entries()) (f.prop === t || f.prop === te || f.prop === null) && J(f.triggers, i) && this.$safeExec(l, r, t, n, i, ...s);
546
+ if (ve.size) {
547
+ const l = {
548
+ source: this.#t,
549
+ target: this.#t,
550
+ value: r,
551
+ prop: t,
552
+ name: t,
553
+ oldValue: n,
554
+ trigger: i,
555
+ args: s
556
+ };
557
+ for (const [f, o] of ve.entries()) J(o, i) && this.$safeExec(f, l);
558
+ }
559
+ }
560
+ wrap(t) {
561
+ return Array.isArray(t) ? ce(t, this) : t;
562
+ }
563
+ get triggerControl() {
564
+ return this.#c;
565
+ }
566
+ isTriggerEnabled(t) {
567
+ return !J(this.#n, "all") && !lt(t).some((r) => this.#n.has(r));
568
+ }
569
+ setTriggersEnabled(t = ["*"], r = !0) {
570
+ const n = Je(t);
571
+ for (const i of n) r ? this.#n.delete(i) : this.#n.add(i);
572
+ }
573
+ withTriggers(t, r, n) {
574
+ const i = [...Je(t)], s = new Map(i.map((l) => [l, this.#n.has(l)])), u = () => {
575
+ s.forEach((l, f) => {
576
+ l ? this.#n.add(f) : this.#n.delete(f);
577
+ });
578
+ };
579
+ this.setTriggersEnabled(i, r);
580
+ try {
581
+ const l = n?.();
582
+ return l && typeof l.finally == "function" ? l.finally(u) : (u(), l);
583
+ } catch (l) {
584
+ throw u(), l;
585
+ }
586
+ }
587
+ affected(t, r, n = ["*"]) {
588
+ if (t == null || typeof t != "function") return;
589
+ const i = ge(n);
590
+ return this.#e.set(t, {
591
+ prop: r || te,
592
+ triggers: i.affectTypes
593
+ }), () => this.unaffected(t, r || te);
594
+ }
595
+ unaffected(t, r) {
596
+ if (t != null && typeof t == "function") {
597
+ const n = this.#e, i = n?.get(t);
598
+ if (i && (i.prop == r || r == null || r == te))
599
+ return n.delete(t), () => this.affected(t, r || te, i.triggers);
600
+ }
601
+ return this.#e.clear();
602
+ }
603
+ trigger(t, r, n, i = "set", ...s) {
604
+ if (typeof t == "symbol" || (i === void 0 && (i = "set"), i = fe(i) ?? i, !this.isTriggerEnabled(i))) return;
605
+ const u = `${i ?? "all"}`;
606
+ let l = this.#i.get(t);
607
+ l || (l = /* @__PURE__ */ new Map(), this.#i.set(t, l)), l.set(u, [
608
+ t,
609
+ r,
610
+ n,
611
+ i,
612
+ s
613
+ ]), !this.#s && (this.#s = !0, queueMicrotask(() => {
614
+ this.#s = !1;
615
+ const f = this.#i;
616
+ this.#i = /* @__PURE__ */ new Map();
617
+ for (const [o, y] of f)
618
+ if (!(o != null && this.#l.has(o))) {
619
+ o != null && this.#l.add(o);
620
+ try {
621
+ for (const [, a] of y) {
622
+ const [v, A, w, O, k] = a;
623
+ try {
624
+ this.#u(v, A, w, O, ...k ?? []);
625
+ } catch (q) {
626
+ console.warn(q);
627
+ }
628
+ }
629
+ } finally {
630
+ o != null && this.#l.delete(o);
631
+ }
632
+ }
633
+ }));
634
+ }
635
+ get iterator() {
636
+ return this.#o;
637
+ }
638
+ };
639
+ var Et = globalThis[ft], Wt = /* @__PURE__ */ Symbol.for("object.ts@__safeGetGuard"), _t = /* @__PURE__ */ new Set([
640
+ Symbol.toStringTag,
641
+ Symbol.iterator,
642
+ Symbol.asyncIterator,
643
+ Symbol.toPrimitive,
644
+ "toString",
645
+ "valueOf",
646
+ "inspect",
647
+ "constructor",
648
+ "__proto__",
649
+ "prototype",
650
+ "then",
651
+ "catch",
652
+ "finally",
653
+ "next"
654
+ ]), re = (e, t) => {
655
+ if (!_t.has(t)) return null;
656
+ const r = c(e, t);
657
+ return typeof r == "function" ? H(e, r) : r;
658
+ }, R = globalThis[Wt] ??= /* @__PURE__ */ new WeakMap();
659
+ function $t(e, t) {
660
+ let r = !0;
661
+ try {
662
+ R?.getOrInsert?.(e, /* @__PURE__ */ new Set())?.add?.(t), R?.get?.(e)?.has?.(t) && (r = !0), r = typeof Reflect.getOwnPropertyDescriptor(e, t)?.get == "function";
663
+ } catch {
664
+ r = !0;
665
+ } finally {
666
+ R?.get?.(e)?.delete?.(t);
667
+ }
668
+ return r;
669
+ }
670
+ var G = (e, t) => {
671
+ if (m(e)) return e;
672
+ const r = c(e, t);
673
+ if (r == null && t != "value") {
674
+ const n = c(e, "value");
675
+ return n != null && !m(n) ? G(n, t) : r;
676
+ } else if (t == "value" && r != null && !m(r) && typeof r != "function") return G(r, t) ?? r ?? e;
677
+ return r ?? e;
678
+ }, Vt = (e, t, r) => {
679
+ if (e == null) return !1;
680
+ let n = __safeSetGuard?.getOrInsert?.(e, /* @__PURE__ */ new Set());
681
+ return n?.has?.(t) ? !1 : (n?.add?.(t), Reflect.set(e, t, r));
682
+ }, c = (e, t, r) => {
683
+ let n;
684
+ if (e == null) return e;
685
+ let i = R?.getOrInsert?.(e, /* @__PURE__ */ new Set());
686
+ if (i?.has?.(t)) return null;
687
+ if (!$t(e, t)) n ??= Reflect.get(e, t, r ?? e);
688
+ else {
689
+ i?.add?.(t);
690
+ try {
691
+ n = Reflect.get(e, t, r ?? e);
692
+ } catch {
693
+ n = void 0;
694
+ } finally {
695
+ i.delete(t), i?.size === 0 && R?.delete?.(e);
696
+ }
697
+ }
698
+ return typeof n == "function" ? H(e, n) : n;
699
+ }, W = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Te = (e, t = !1) => !!e && typeof e == "object" && !Array.isArray(e) && (W(e, "key") || W(e, "name") || W(e, "oldValue") || W(e, "old") || W(e, "op") || W(e, "trigger") || t && W(e, "value")), N = (e, t, r) => W(e, t) ? e[t] : t == "oldValue" && W(e, "old") ? e.old : r(), Ae = (e, t = "manual") => fe(e.trigger ?? e.op ?? t), zt = (e) => typeof e == "string" || typeof e == "number" || typeof e == "symbol", be = (e) => {
700
+ const t = c(e, de) ?? c(e, "realProp");
701
+ return zt(t) ? t : null;
702
+ }, Qe = (e, t) => t == "value" ? be(e) ?? t : t, Ct = (e, t) => {
703
+ const r = be(e);
704
+ return r != null && t == r ? c(e, "value") ?? c(e, d) ?? c(e, t) : t == null ? void 0 : c(e, t);
705
+ }, Oe = (e, t) => {
706
+ const r = (i, s, u) => (Te(s) || (u ??= s), t(Te(i) ? i : Te(s, !0) ? {
707
+ key: i,
708
+ trigger: u,
709
+ ...s
710
+ } : {
711
+ key: i,
712
+ trigger: u ?? s
713
+ })), n = e?.triggerControl;
714
+ return n && Object.assign(r, n), r.custom = (i, s, u, l) => r({
715
+ key: s,
716
+ trigger: i,
717
+ value: u,
718
+ oldValue: l
719
+ }), r;
720
+ }, xe = (e, t, r) => {
721
+ if (e == null || m(e)) return e;
722
+ if (([
723
+ "deref",
724
+ "bind",
725
+ "@target",
726
+ _,
727
+ g,
728
+ se
729
+ ].indexOf(t) < 0 ? c(e, t)?.bind?.(e) : null) != null) return null;
730
+ if ([g, _].indexOf(t) >= 0) return c(e, t) ?? e;
731
+ if (t == d) return c(e, t) ?? c(e, "value");
732
+ if (t == se) return r;
733
+ if (t == gt) return r?.triggerControl;
734
+ if (t == Symbol.observable) return r?.compatible;
735
+ if (t == Symbol.subscribe) return (n, i, s) => b(i != null ? [e, i] : e, n, s);
736
+ if (t == Symbol.iterator || t == Symbol.asyncIterator) return c(e, t);
737
+ if (t == Symbol.dispose) return (n) => {
738
+ c(e, Symbol.dispose)?.(n), Ie(n != null ? [e, n] : e);
739
+ };
740
+ if (t == Symbol.asyncDispose) return (n) => {
741
+ c(e, Symbol.asyncDispose)?.(n), Ie(n != null ? [e, n] : e);
742
+ };
743
+ if (t == Symbol.unsubscribe) return (n) => Ie(n != null ? [e, n] : e);
744
+ if (typeof t == "symbol" && (t in e || c(e, t) != null)) return c(e, t);
745
+ }, we = (e, t, r) => {
746
+ if (t == "subscribe") return r?.compatible?.[t] ?? ((n) => {
747
+ if (typeof n == "function") return b(e, n);
748
+ if ("next" in n && n?.next != null) {
749
+ const i = b(e, n?.next), s = n?.complete;
750
+ return n.complete = (...u) => (i?.(), s?.(...u)), n.complete;
751
+ }
752
+ });
753
+ }, Nt = class {
754
+ #t;
755
+ #e;
756
+ #r;
757
+ constructor(e, t, r) {
758
+ this.#t = e, this.#e = t, this.#r = r;
759
+ }
760
+ get(e, t, r) {
761
+ const n = re(e, t);
762
+ return n ?? Reflect.get(e, t, r);
763
+ }
764
+ apply(e, t, r) {
765
+ let n = [], i = [], s = [], u = [...this.#e], l = -1;
766
+ const f = Reflect.apply(e, t || this.#e, r);
767
+ if (this.#r?.[h])
768
+ return Array.isArray(f) ? _e(f) : f;
769
+ switch (this.#t) {
770
+ case "push":
771
+ l = u?.length, n = r;
772
+ break;
773
+ case "unshift":
774
+ l = 0, n = r;
775
+ break;
776
+ case "pop":
777
+ l = u?.length - 1, u.length > 0 && (i = [u[l]]);
778
+ break;
779
+ case "shift":
780
+ l = 0, u.length > 0 && (i = [u[l]]);
781
+ break;
782
+ case "splice":
783
+ l = r[0];
784
+ for (let y = 0; y < Math.max(u.length, this.#e.length); y++) {
785
+ const a = u[y], v = this.#e[y];
786
+ v === void 0 && y >= this.#e.length ? i.push(a) : a === void 0 && y >= u.length ? s.push([
787
+ y,
788
+ v,
789
+ void 0,
790
+ !1
791
+ ]) : x(a, v) && s.push([
792
+ y,
793
+ v,
794
+ a,
795
+ !0
796
+ ]);
797
+ }
798
+ break;
799
+ case "sort":
800
+ case "fill":
801
+ case "reverse":
802
+ case "copyWithin":
803
+ l = 0;
804
+ for (let y = 0; y < u.length; y++) x(u[y], this.#e[y]) && s.push([
805
+ l + y,
806
+ this.#e[y],
807
+ u[y],
808
+ !0
809
+ ]);
810
+ break;
811
+ case "set":
812
+ l = r[1], s.push([
813
+ l,
814
+ r[0],
815
+ u?.[l],
816
+ l in u
817
+ ]);
818
+ break;
819
+ }
820
+ const o = p.get(this.#e);
821
+ return n?.length == 1 ? o?.trigger?.(l, n[0], null, "add") : n?.length > 1 && (o?.trigger?.(l, n, null, "addAll"), n.forEach((y, a) => o?.trigger?.(l + a, y, null, "add"))), s?.length == 1 ? o?.trigger?.(s[0]?.[0] ?? l, s[0]?.[1], s[0]?.[2], s[0]?.[3] === !1 ? "add" : "set") : s?.length > 1 && (o?.trigger?.(l, s, u, "setAll"), s.forEach((y, a) => o?.trigger?.(y?.[0] ?? l + a, y?.[1], y?.[2], y?.[3] === !1 ? "add" : "set"))), i?.length == 1 ? o?.trigger?.(l, null, i[0], "delete") : i?.length > 1 && (o?.trigger?.(l, null, i, "deleteAll"), i.forEach((y, a) => o?.trigger?.(l + a, null, y, "delete"))), f == e ? new Proxy(f, this.#r) : Array.isArray(f) ? _e(f) : f;
822
+ }
823
+ }, Dt = (e, t, r, n) => {
824
+ const i = Number.isInteger(r) && Number.isInteger(n) && n < r ? t.slice(n, r) : [];
825
+ if (!e[h] && r !== n) {
826
+ const s = p.get(t);
827
+ i.length === 1 ? s?.trigger?.(n, null, i[0], "delete") : i.length > 1 && (s?.trigger?.(n, null, i, "deleteAll"), i.forEach((l, f) => s?.trigger?.(n + f, null, l, "delete")));
828
+ const u = Number.isInteger(r) && Number.isInteger(n) && n > r ? n - r : 0;
829
+ if (u === 1) s?.trigger?.(r, void 0, null, "add");
830
+ else if (u > 1) {
831
+ const l = Array(u).fill(void 0);
832
+ s?.trigger?.(r, l, null, "addAll"), l.forEach((f, o) => s?.trigger?.(r + o, void 0, null, "add"));
833
+ }
834
+ }
835
+ }, Bt = class {
836
+ [h];
837
+ constructor() {
838
+ }
839
+ has(e, t) {
840
+ return Reflect.has(e, t);
841
+ }
842
+ get(e, t, r) {
843
+ const n = re(e, t);
844
+ if (n != null) return n;
845
+ if ([
846
+ g,
847
+ _,
848
+ "@target",
849
+ "deref"
850
+ ].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ? c(e, t)?.bind?.(e) : c(e, t);
851
+ const i = p?.get?.(e), s = xe(e, t, i);
852
+ if (s != null) return s;
853
+ const u = we(e, t, i);
854
+ if (u != null) return u;
855
+ if (t == me) return pe.call(this, this);
856
+ if (t == D) return Oe(i, (f) => {
857
+ const o = f.key ?? f.name ?? 0, y = N(f, "value", () => c(e, o)), a = N(f, "oldValue", () => {
858
+ });
859
+ return i?.trigger?.(o, y, a, Ae(f, "manual"));
860
+ });
861
+ if (t == "@target" || t == g) return e;
862
+ if (t == "x") return () => e?.x ?? e?.[0];
863
+ if (t == "y") return () => e?.y ?? e?.[1];
864
+ if (t == "z") return () => e?.z ?? e?.[2];
865
+ if (t == "w") return () => e?.w ?? e?.[3];
866
+ if (t == "r") return () => e?.r ?? e?.[0];
867
+ if (t == "g") return () => e?.g ?? e?.[1];
868
+ if (t == "b") return () => e?.b ?? e?.[2];
869
+ if (t == "a") return () => e?.a ?? e?.[3];
870
+ const l = c(e, t) ?? (t == "value" ? c(e, d) : null);
871
+ return typeof l == "function" ? new Proxy(typeof l == "function" ? l?.bind?.(e) : l, new Nt(t, e, this)) : l;
872
+ }
873
+ set(e, t, r) {
874
+ if (typeof t != "symbol" && Number.isInteger(parseInt(t)) && (t = parseInt(t) ?? t), t == h && r)
875
+ return this[h] = !!r, !0;
876
+ if (t == h && !r)
877
+ return delete this[h], !0;
878
+ const n = c(e, t), i = [
879
+ "x",
880
+ "y",
881
+ "z",
882
+ "w"
883
+ ], s = [
884
+ "r",
885
+ "g",
886
+ "b",
887
+ "a"
888
+ ], u = i.indexOf(t), l = s.indexOf(t);
889
+ let f = !1;
890
+ return u >= 0 ? f = Reflect.set(e, u, r) : l >= 0 ? f = Reflect.set(e, l, r) : f = Reflect.set(e, t, r), t == "length" && x(n, r) && Dt(this, e, n, r), !this[h] && typeof t != "symbol" && x(n, r) && p?.get?.(e)?.trigger?.(t, r, n, "set"), f;
891
+ }
892
+ deleteProperty(e, t) {
893
+ if (typeof t != "symbol" && Number.isInteger(parseInt(t)) && (t = parseInt(t) ?? t), t == h)
894
+ return delete this[h], !0;
895
+ const r = c(e, t), n = Reflect.deleteProperty(e, t);
896
+ return !this[h] && t != "length" && t != h && typeof t != "symbol" && r != null && p.get(e)?.trigger?.(t, t, r, "delete"), n;
897
+ }
898
+ }, Ft = class {
899
+ [h];
900
+ constructor() {
901
+ }
902
+ get(e, t, r) {
903
+ if ([
904
+ g,
905
+ _,
906
+ "@target",
907
+ "deref",
908
+ "then",
909
+ "catch",
910
+ "finally"
911
+ ].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ? H(e, c(e, t)) : c(e, t);
912
+ const n = p.get(e) ?? p.get(c(e, "value") ?? e), i = xe(e, t, n);
913
+ if (i != null) return i;
914
+ c(e, t) == null && t != "value" && I(e) && c(e, "value") != null && (typeof c(e, "value") == "object" || typeof c(e, "value") == "function") && c(c(e, "value"), t) != null && (e = c(e, "value") ?? e);
915
+ const s = we(e, t, n);
916
+ return s ?? (t == me ? pe.call(this, this) : t == D ? Oe(n, (u) => {
917
+ const l = Qe(e, u.key ?? u.name ?? be(e) ?? "value"), f = N(u, "oldValue", () => l == "value" || l == be(e) ? c(e, d) : void 0), o = N(u, "value", () => Ct(e, l));
918
+ return n?.trigger?.(l, o, f, Ae(u, "manual"));
919
+ }) : t == Symbol.toPrimitive ? (u) => {
920
+ const l = G(e, t);
921
+ return c(l, t) ? c(l, t)?.(u) : m(l) ? E(l, u) : m(c(l, "value")) ? E(c(l, "value"), u) : E(c(l, "value") ?? l, u);
922
+ } : t == Symbol.toStringTag ? () => {
923
+ const u = G(e, t);
924
+ return c(u, t) ? c(u, t)?.() : m(u) ? String(u ?? "") || "" : m(c(u, "value")) ? String(c(u, "value") ?? "") || "" : String(c(u, "value") ?? u ?? "") || "";
925
+ } : t == "toString" ? () => {
926
+ const u = G(e, t);
927
+ return c(u, t) ? c(u, t)?.() : c(u, Symbol.toStringTag) ? c(u, Symbol.toStringTag)?.() : m(u) ? String(u ?? "") || "" : m(c(u, "value")) ? String(c(u, "value") ?? "") || "" : String(c(u, "value") ?? u ?? "") || "";
928
+ } : t == "valueOf" ? () => {
929
+ const u = G(e, t);
930
+ return c(u, t) ? c(u, t)?.() : c(u, Symbol.toPrimitive) ? c(u, Symbol.toPrimitive)?.() : m(u) ? u : m(c(u, "value")) ? c(u, "value") : c(u, "value") ?? u;
931
+ } : typeof t == "symbol" && (t in e || c(e, t) != null) ? c(e, t) : G(e, t));
932
+ }
933
+ apply(e, t, r) {
934
+ return Reflect.apply(e, t, r);
935
+ }
936
+ ownKeys(e) {
937
+ return Reflect.ownKeys(e);
938
+ }
939
+ construct(e, t, r) {
940
+ return Reflect.construct(e, t, r);
941
+ }
942
+ isExtensible(e) {
943
+ return Reflect.isExtensible(e);
944
+ }
945
+ getOwnPropertyDescriptor(e, t) {
946
+ let r;
947
+ try {
948
+ R?.getOrInsert?.(e, /* @__PURE__ */ new Set())?.add?.(t), R?.get?.(e)?.has?.(t) && (r = void 0), r = Reflect.getOwnPropertyDescriptor(e, t);
949
+ } catch {
950
+ r = void 0;
951
+ } finally {
952
+ R?.get?.(e)?.delete?.(t);
953
+ }
954
+ return r;
955
+ }
956
+ has(e, t) {
957
+ return t in e;
958
+ }
959
+ set(e, t, r) {
960
+ const n = re(e, t);
961
+ return n ?? at(r, (i) => {
962
+ const s = re(i, t);
963
+ if (s != null) return s;
964
+ if (t == h && r)
965
+ return this[h] = !!r, !0;
966
+ if (t == h && !r)
967
+ return delete this[h], !0;
968
+ const u = e;
969
+ if (c(e, t) == null && t != "value" && I(e) && c(e, "value") != null && (typeof c(e, "value") == "object" || typeof c(e, "value") == "function") && c(c(e, "value"), t) != null && (e = c(e, "value") ?? e), typeof t == "symbol" && !(c(e, t) != null && t in e)) return;
970
+ const l = Qe(e, t), f = t == "value" ? c(e, d) ?? c(e, t) : c(e, t);
971
+ e[t] = i;
972
+ const o = c(e, t) ?? i;
973
+ return !this[h] && typeof t != "symbol" && (c(e, At) ?? x)?.(f, o) && (p.get(e) ?? p.get(u))?.trigger?.(l, i, f), !0;
974
+ });
975
+ }
976
+ defineProperty(e, t, r) {
977
+ const n = re(e, t);
978
+ if (n != null) return n;
979
+ if (t == h && r.value)
980
+ return this[h] = !!r.value, !0;
981
+ if (t == h && !r.value)
982
+ return delete this[h], !0;
983
+ if (c(e, t) == null && t != "value" && I(e) && c(e, "value") != null && (typeof c(e, "value") == "object" || typeof c(e, "value") == "function") && c(c(e, "value"), t) != null && (e = c(e, "value") ?? e), r.get == null && r.set == null) return Reflect.defineProperty(e, t, r);
984
+ const i = c(e, t), s = Reflect.defineProperty(e, t, {
985
+ get: r.get,
986
+ set: r.set,
987
+ enumerable: r.enumerable ?? !0,
988
+ configurable: r.configurable ?? !0
989
+ });
990
+ return Vt(e, t, i), s;
991
+ }
992
+ deleteProperty(e, t) {
993
+ if (t == h)
994
+ return delete this[h], !0;
995
+ c(e, t) == null && t != "value" && I(e) && c(e, "value") != null && (typeof c(e, "value") == "object" || typeof c(e, "value") == "function") && c(c(e, "value"), t) != null && (e = c(e, "value") ?? e);
996
+ const r = c(e, t), n = Reflect.deleteProperty(e, t);
997
+ return !this[h] && t != h && typeof t != "symbol" && p.get(e)?.trigger?.(t, null, r, "delete"), n;
998
+ }
999
+ }, Gt = class {
1000
+ [h];
1001
+ constructor() {
1002
+ }
1003
+ get(e, t, r) {
1004
+ if ([
1005
+ g,
1006
+ _,
1007
+ "@target",
1008
+ "deref"
1009
+ ].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ? H(e, c(e, t)) : c(e, t);
1010
+ const n = p.get(e), i = xe(e, t, n);
1011
+ if (i != null) return i;
1012
+ const s = we(e, t, n);
1013
+ if (s != null) return s;
1014
+ e = c(e, g) ?? c(e, _) ?? e;
1015
+ const u = H(e, c(e, t));
1016
+ return typeof t == "symbol" && (t in e || c(e, t) != null) ? u : t == me ? pe.call(this, this) : t == D ? Oe(n, (l) => {
1017
+ const f = l.key ?? l.name;
1018
+ if (f == null) return;
1019
+ const o = N(l, "value", () => e.get(f));
1020
+ if (o == null && !W(l, "value")) return;
1021
+ const y = N(l, "oldValue", () => {
1022
+ });
1023
+ return n?.trigger?.(f, o, y, Ae(l, "manual"));
1024
+ }) : t == "clear" ? () => {
1025
+ const l = Array.from(e?.entries?.() || []), f = u();
1026
+ return l.forEach(([o, y]) => {
1027
+ this[h] || p.get(e)?.trigger?.(o, null, y, "delete");
1028
+ }), f;
1029
+ } : t == "delete" ? (l, f = null) => {
1030
+ const o = e.has(l), y = e.get(l), a = u(l);
1031
+ return !this[h] && o && p.get(e)?.trigger?.(l, null, y, "delete"), a;
1032
+ } : t == "set" ? (l, f) => ht(f, (o) => {
1033
+ const y = e.has(l), a = e.get(l), v = u(l, o);
1034
+ return (!y || x(a, o)) && (this[h] || p.get(e)?.trigger?.(l, o, y ? a : null, y ? "set" : "add")), v;
1035
+ }) : u;
1036
+ }
1037
+ set(e, t, r) {
1038
+ return t == h ? (this[h] = !!r, !0) : t == h && !r ? (delete this[h], !0) : Reflect.set(e, t, r);
1039
+ }
1040
+ has(e, t) {
1041
+ return Reflect.has(e, t);
1042
+ }
1043
+ apply(e, t, r) {
1044
+ return Reflect.apply(e, t, r);
1045
+ }
1046
+ construct(e, t, r) {
1047
+ return Reflect.construct(e, t, r);
1048
+ }
1049
+ ownKeys(e) {
1050
+ return Reflect.ownKeys(e);
1051
+ }
1052
+ isExtensible(e) {
1053
+ return Reflect.isExtensible(e);
1054
+ }
1055
+ getOwnPropertyDescriptor(e, t) {
1056
+ let r;
1057
+ try {
1058
+ R?.getOrInsert?.(e, /* @__PURE__ */ new Set())?.add?.(t), R?.get?.(e)?.has?.(t) && (r = void 0), r = Reflect.getOwnPropertyDescriptor(e, t);
1059
+ } catch {
1060
+ r = void 0;
1061
+ } finally {
1062
+ R?.get?.(e)?.delete?.(t);
1063
+ }
1064
+ return r;
1065
+ }
1066
+ deleteProperty(e, t) {
1067
+ return t == h ? (delete this[h], !0) : Reflect.deleteProperty(e, t);
1068
+ }
1069
+ }, Ht = class {
1070
+ [h] = !1;
1071
+ constructor() {
1072
+ }
1073
+ get(e, t, r) {
1074
+ if ([
1075
+ g,
1076
+ _,
1077
+ "@target",
1078
+ "deref"
1079
+ ].indexOf(t) >= 0 && c(e, t) != null && c(e, t) != e) return typeof c(e, t) == "function" ? H(e, c(e, t)) : c(e, t);
1080
+ const n = p.get(e), i = xe(e, t, n);
1081
+ if (i != null) return i;
1082
+ const s = we(e, t, n);
1083
+ if (s != null) return s;
1084
+ e = c(e, g) ?? c(e, _) ?? e;
1085
+ const u = H(e, c(e, t));
1086
+ return typeof t == "symbol" && (t in e || c(e, t) != null) ? u : t == me ? pe.call(this, this) : t == D ? Oe(n, (l) => {
1087
+ const f = l.key ?? l.name;
1088
+ if (f == null) return;
1089
+ const o = N(l, "value", () => e.has(f)), y = N(l, "oldValue", () => {
1090
+ });
1091
+ return n?.trigger?.(f, o, y, Ae(l, "manual"));
1092
+ }) : t == "clear" ? () => {
1093
+ const l = Array.from(e?.values?.() || []), f = u();
1094
+ return l.forEach((o) => {
1095
+ this[h] || p.get(e)?.trigger?.(null, null, o, "delete");
1096
+ }), f;
1097
+ } : t == "delete" ? (l) => {
1098
+ const f = e.has(l), o = f ? l : null, y = u(l);
1099
+ return !this[h] && f && p.get(e)?.trigger?.(l, null, o, "delete"), y;
1100
+ } : t == "add" ? (l) => {
1101
+ const f = e.has(l), o = f ? l : null, y = u(l);
1102
+ return f || this[h] || p.get(e)?.trigger?.(l, l, o, "add"), y;
1103
+ } : u;
1104
+ }
1105
+ set(e, t, r) {
1106
+ return t == h && r ? (this[h] = !!r, !0) : t == h && !r ? (delete this[h], !0) : Reflect.set(e, t, r);
1107
+ }
1108
+ has(e, t) {
1109
+ return Reflect.has(e, t);
1110
+ }
1111
+ apply(e, t, r) {
1112
+ return Reflect.apply(e, t, r);
1113
+ }
1114
+ construct(e, t, r) {
1115
+ return Reflect.construct(e, t, r);
1116
+ }
1117
+ ownKeys(e) {
1118
+ return Reflect.ownKeys(e);
1119
+ }
1120
+ isExtensible(e) {
1121
+ return Reflect.isExtensible(e);
1122
+ }
1123
+ getOwnPropertyDescriptor(e, t) {
1124
+ let r;
1125
+ try {
1126
+ R?.getOrInsert?.(e, /* @__PURE__ */ new Set())?.add?.(t), R?.get?.(e)?.has?.(t) && (r = void 0), r = Reflect.getOwnPropertyDescriptor(e, t);
1127
+ } catch {
1128
+ r = void 0;
1129
+ } finally {
1130
+ R?.get?.(e)?.delete?.(t);
1131
+ }
1132
+ return r;
1133
+ }
1134
+ deleteProperty(e, t) {
1135
+ return t == h ? (delete this[h], !0) : Reflect.deleteProperty(e, t);
1136
+ }
1137
+ }, Y = (e) => !!((typeof e == "object" || typeof e == "function") && e != null && (e?.[g] || e?.[ue])), _e = (e) => Y(e) ? e : ce(e, new Bt()), Kt = (e) => Y(e) ? e : ce(e, new Ft()), qt = (e) => Y(e) ? e : ce(e, new Gt()), Ut = (e) => Y(e) ? e : ce(e, new Ht()), jt = (e, t) => {
1138
+ const r = e instanceof Promise || typeof e?.then == "function", n = T({
1139
+ [oe]: r ? e : null,
1140
+ [d]: r ? 0 : Number(V(e) || 0) || 0,
1141
+ [K]: t,
1142
+ [Symbol?.toStringTag]() {
1143
+ return String(this?.[d] ?? "") || "";
1144
+ },
1145
+ [Symbol?.toPrimitive](i) {
1146
+ return E((typeof this?.[d] != "object" ? this?.[d] : this?.[d]?.value || 0) ?? 0, i);
1147
+ },
1148
+ set value(i) {
1149
+ this[d] = (i != null && !Number.isNaN(i) ? Number(i) : this[d]) || 0;
1150
+ },
1151
+ get value() {
1152
+ return Number(this[d] || 0) || 0;
1153
+ }
1154
+ });
1155
+ return e?.then?.((i) => n.value = i), n;
1156
+ }, Jt = (e, t) => {
1157
+ const r = e instanceof Promise || typeof e?.then == "function", n = T({
1158
+ [oe]: r ? e : null,
1159
+ [d]: (r ? "" : String(V(typeof e == "number" ? String(e) : e || ""))) ?? "",
1160
+ [K]: t,
1161
+ [Symbol?.toStringTag]() {
1162
+ return String(this?.[d] ?? "") ?? "";
1163
+ },
1164
+ [Symbol?.toPrimitive](i) {
1165
+ return E(this?.[d] ?? "", i);
1166
+ },
1167
+ set value(i) {
1168
+ this[d] = String(typeof i == "number" ? String(i) : i || "") ?? "";
1169
+ },
1170
+ get value() {
1171
+ return String(this[d] ?? "") ?? "";
1172
+ }
1173
+ });
1174
+ return e?.then?.((i) => n.value = i), n;
1175
+ }, Qt = (e, t) => {
1176
+ const r = e instanceof Promise || typeof e?.then == "function", n = T({
1177
+ [oe]: r ? e : null,
1178
+ [d]: (r ? !1 : (V(e) != null ? typeof V(e) == "string" ? !0 : !!V(e) : !1) || !1) || !1,
1179
+ [K]: t,
1180
+ [Symbol?.toStringTag]() {
1181
+ return String(this?.[d] ?? "") || "";
1182
+ },
1183
+ [Symbol?.toPrimitive](i) {
1184
+ return E(!!this?.[d] || !1, i);
1185
+ },
1186
+ set value(i) {
1187
+ this[d] = (i != null ? typeof i == "string" ? !0 : !!i : this[d]) || !1;
1188
+ },
1189
+ get value() {
1190
+ return this[d] || !1;
1191
+ }
1192
+ });
1193
+ return e?.then?.((i) => n.value = i), n;
1194
+ }, Xe = (e, t) => {
1195
+ const r = e instanceof Promise || typeof e?.then == "function", n = T({
1196
+ [oe]: r ? e : null,
1197
+ [K]: t,
1198
+ [Symbol?.toStringTag]() {
1199
+ return String(this.value ?? "") || "";
1200
+ },
1201
+ [Symbol?.toPrimitive](i) {
1202
+ return E(this.value, i);
1203
+ },
1204
+ value: r ? null : V(e)
1205
+ });
1206
+ return e?.then?.((i) => n.value = i), b(e, (i) => {
1207
+ n?.[D]?.();
1208
+ }), n;
1209
+ }, Pe = (e, t) => {
1210
+ if (e == null || typeof e != "object" && typeof e != "function") return e;
1211
+ try {
1212
+ Object.defineProperty(e, de, {
1213
+ value: t,
1214
+ writable: !0,
1215
+ configurable: !0
1216
+ });
1217
+ } catch {
1218
+ try {
1219
+ e[de] = t;
1220
+ } catch {
1221
+ }
1222
+ }
1223
+ try {
1224
+ Object.defineProperty(e, "realProp", {
1225
+ value: t,
1226
+ writable: !0,
1227
+ configurable: !0
1228
+ });
1229
+ } catch {
1230
+ try {
1231
+ e.realProp = t;
1232
+ } catch {
1233
+ }
1234
+ }
1235
+ return e;
1236
+ }, Xt = (e, t = "value", r, n) => {
1237
+ if (m(e) || !e) return e;
1238
+ Array.isArray(e) && e.length == 2 && e[0] != null && (e[0] instanceof Map || e[0] instanceof WeakMap || e[0] instanceof Set || e[0] instanceof WeakSet) ? ((t == null || t === "value") && (t = e[1]), e = e[0]) : Array.isArray(e) && !le(e?.[1], e) && (Array.isArray(e?.[0]) || typeof e?.[0] == "object" || typeof e?.[0] == "function") && (e = e?.[0]);
1239
+ const i = e instanceof Map || e instanceof WeakMap, s = e instanceof Set || e instanceof WeakSet;
1240
+ if (i || s) {
1241
+ if (t == null) return;
1242
+ } else if ((t ??= Array.isArray(e) ? null : "value") == null || le(t, e)) return;
1243
+ const u = () => i ? e.get(t) : s ? e.has(t) : e?.[t], l = (a) => i ? (e.set(t, a), a) : s ? (a ? e.add(t) : e.delete(t), e.has(t)) : e[t] = a;
1244
+ i && r !== void 0 && !e.has(t) ? e.set(t, r) : s && r && !e.has(t) && e.add(t);
1245
+ const f = u();
1246
+ if (!s && t != null && I(f) && z(f)) return Pe(Lt(f), t);
1247
+ if (!i && !s && t && typeof e?.getProperty == "function" && z(e?.getProperty?.(t))) return Pe(e?.getProperty?.(t), t);
1248
+ !i && !s && (e[t] ??= r ?? e[t]);
1249
+ const o = T({
1250
+ [d]: s ? !!u() : u() ?? r,
1251
+ [K]: n,
1252
+ [Symbol?.toStringTag]() {
1253
+ return String(u() ?? this[d] ?? "") || "";
1254
+ },
1255
+ [Symbol?.toPrimitive](a) {
1256
+ return E(u(), a);
1257
+ },
1258
+ set value(a) {
1259
+ if (o[Q] = !0, s) this[d] = l(a);
1260
+ else {
1261
+ const v = a ?? dt(u());
1262
+ this[d] = l(v);
1263
+ }
1264
+ o[Q] = !1;
1265
+ },
1266
+ get value() {
1267
+ const a = u();
1268
+ return this[d] = s ? !!a : a ?? this[d];
1269
+ }
1270
+ });
1271
+ Pe(o, t);
1272
+ const y = b(e, (a, v, A, w) => {
1273
+ if (v === t) {
1274
+ const O = s ? a != null : a, k = s ? A != null : A;
1275
+ o?.[D]?.({
1276
+ key: t,
1277
+ value: O,
1278
+ oldValue: k,
1279
+ trigger: w
1280
+ });
1281
+ }
1282
+ });
1283
+ return M(o, Symbol.dispose, y), o;
1284
+ }, Yt = (e, t) => {
1285
+ switch (typeof e) {
1286
+ case "boolean":
1287
+ return Qt(e, t);
1288
+ case "number":
1289
+ return jt(e, t);
1290
+ case "string":
1291
+ return Jt(e, t);
1292
+ case "object":
1293
+ if (e != null) return Xe(T(e), t);
1294
+ default:
1295
+ return Xe(e, t);
1296
+ }
1297
+ }, Zt = (e, t = "value", r) => {
1298
+ const n = z(e) ? e : Yt(e, r);
1299
+ return t != null ? Xt(n, t, r) : n;
1300
+ }, gr = (e, t) => Zt(e, t), Ce = (e, t, r = 100) => {
1301
+ if (e?.value ?? e) return setTimeout(() => {
1302
+ e.value && t?.();
1303
+ }, r);
1304
+ }, Ar = (e = 100) => (t, [r], [n]) => {
1305
+ let i = Ce(r, t, e);
1306
+ n?.addEventListener?.("abort", () => {
1307
+ i && clearTimeout(i);
1308
+ }, { once: !0 });
1309
+ }, Or = (e = 100) => (t, [r], [n]) => {
1310
+ let i = Ce(r, t, e);
1311
+ n?.addEventListener?.("abort", () => {
1312
+ i && clearTimeout(i);
1313
+ }, { once: !0 }), i || t?.();
1314
+ };
1315
+ function T(e, t) {
1316
+ if (e == null || typeof e == "symbol" || !(typeof e == "object" || typeof e == "function") || Y(e) || (e = V?.(e)) == null || e instanceof Promise || e instanceof WeakRef || Y(e)) return e;
1317
+ const r = e;
1318
+ if (r == null || typeof r == "symbol" || !(typeof r == "object" || typeof r == "function") || r instanceof Promise || r instanceof WeakRef) return r;
1319
+ let n = r;
1320
+ return Array.isArray(r) ? (n = _e(r), n) : r instanceof Map ? (n = qt(r), n) : r instanceof Set ? (n = Ut(r), n) : ((typeof r == "function" || typeof r == "object") && (n = Kt(r)), n);
1321
+ }
1322
+ var z = (e) => typeof HTMLInputElement < "u" && e instanceof HTMLInputElement ? !0 : !!((typeof e == "object" || typeof e == "function") && e != null && (e?.[g] || e?.[ue] || p?.has?.(e))), Lt = (e) => z(e) ? T(e) : null, xr = (e) => {
1323
+ if (e == null || typeof e != "object" && typeof e != "function" || e?.[Symbol.observable] != null) return e;
1324
+ try {
1325
+ e[Symbol.observable] = self?.compatible;
1326
+ } catch {
1327
+ console.warn("Unable to assign <[Symbol.observable]>, object will not observable by other frameworks");
1328
+ }
1329
+ return e[ue] = (t, r, n) => {
1330
+ const i = e?.[Symbol?.observable];
1331
+ return i?.()?.affected?.(t, r, n), () => i?.()?.unaffected?.(t, r);
1332
+ }, e;
1333
+ }, er = /* @__PURE__ */ Symbol.for("object.ts@specializedSubscribe"), U = globalThis[er] ??= /* @__PURE__ */ new WeakMap(), Ne = (e) => {
1334
+ if (!(typeof e == "symbol" || e == null || !(typeof e == "object" || typeof e == "function")))
1335
+ return e;
1336
+ }, Se = "initial", De = (e) => {
1337
+ const t = e?.[de] ?? e?.realProp;
1338
+ return C(t) ? t : null;
1339
+ }, Be = (e, t) => {
1340
+ const r = De(e);
1341
+ return r != null && (t == null || t == "value") ? r : t;
1342
+ }, tr = (e, t) => t != null && t == De(e) ? e?.value : e?.[t], $e = (e, t, r, n) => {
1343
+ if (t != null && t == De(e)) {
1344
+ const i = tr(e, t);
1345
+ if (i != null) return r?.(i, t, null, "set");
1346
+ }
1347
+ return ae(e, t, r, n);
1348
+ }, ot = (e, t, r) => {
1349
+ const n = ge(t);
1350
+ if (r == Se) {
1351
+ if (!n.triggerImmediately) return;
1352
+ } else if (!J(n.affectTypes, r)) return;
1353
+ return (i, s, u, ...l) => e?.(i, s, u, r, ...l);
1354
+ }, rr = (e, t, r, n = ["*"]) => {
1355
+ if (!e || !Ne(e)) return;
1356
+ const i = t != Symbol.iterator ? Be(e, t) : null;
1357
+ let s = e?.[se] ?? p.get(e);
1358
+ e = e?.[g] ?? e, queueMicrotask(() => {
1359
+ const l = ot(r, n, Se);
1360
+ l && (i != null && i != Symbol.iterator ? $e(e, i, l, null) : Ve(e, l, null));
1361
+ });
1362
+ let u = s?.affected?.(r, i, n);
1363
+ return e?.[Symbol.dispose] || (M(u, Symbol.dispose, u), M(u, Symbol.asyncDispose, u), M(e, Symbol.dispose, u), M(e, Symbol.asyncDispose, u)), u;
1364
+ }, nr = (e, t, r, n = ["*"]) => {
1365
+ const i = ge(n).affectTypes, s = {};
1366
+ let u = e?.value;
1367
+ const l = (f) => {
1368
+ const o = f?.target?.value;
1369
+ J(i, "set") && r?.(o, "value", u, "set", f), u = o;
1370
+ };
1371
+ return e?.addEventListener?.("change", l, s), () => e?.removeEventListener?.("change", l, s);
1372
+ }, ne = (e) => Array.isArray(e) && e?.length == 2 && Ne(e?.[0]) && (C(e?.[1]) || e?.[1] == Symbol.iterator), ir = (e) => !!e && typeof e == "object" && !Array.isArray(e) && ("affectTypes" in e || "triggers" in e || "triggerImmediately" in e), lr = (e) => e == null ? [] : Array.isArray(e) && !ne(e) && !z(e) ? e : [e], sr = (e) => {
1373
+ if (ne(e)) {
1374
+ const t = e?.[0];
1375
+ return {
1376
+ source: e,
1377
+ target: t,
1378
+ prop: Be(t, e?.[1])
1379
+ };
1380
+ }
1381
+ return {
1382
+ source: e,
1383
+ target: e,
1384
+ prop: null
1385
+ };
1386
+ }, ur = (e, t, r, n, i, s, u) => ({
1387
+ source: e,
1388
+ target: t,
1389
+ value: r,
1390
+ prop: n,
1391
+ name: n,
1392
+ oldValue: i,
1393
+ trigger: s,
1394
+ args: u
1395
+ }), fr = (e, t, r, n = ["*"]) => {
1396
+ const i = C(e?.[1]) ? e?.[1] : null;
1397
+ return b(e?.[0], i, r, n);
1398
+ }, or = (e, t, r, n = ["*"]) => e?.then?.((i) => b?.(i, t, r, n))?.catch?.((i) => (console.warn(i), null)), b = (e, t, r = () => {
1399
+ }, n) => {
1400
+ if (typeof t == "function" ? (n = r, r = t, t = null) : t = Be(e, t), (typeof r == "object" || Array.isArray(r)) && (n = r, r = () => {
1401
+ }), (m(e) || typeof e == "symbol") && ge(n).triggerImmediately)
1402
+ return Ee(globalThis?.Promise?.try?.(() => r?.(e, null, null, null, Se)));
1403
+ if (typeof e?.[ue] == "function") return e?.[ue]?.(r, t, n);
1404
+ if (Ne(e)) {
1405
+ const i = e;
1406
+ if (U?.has?.(e = e?.[g] ?? e)) return U?.get?.(e)?.(i, t, r, n);
1407
+ if (z(i) || ne(e) && z(e?.[0])) return We(e) ? U?.getOrInsert?.(e, or)?.(e, t, r, n) : ne(e) ? U?.getOrInsert?.(e, fr)?.(e, t, r, n) : typeof HTMLInputElement < "u" && e instanceof HTMLInputElement ? U?.getOrInsert?.(e, nr)?.(e, t, r, n) : U?.getOrInsert?.(e, rr)?.(i, t, r, n);
1408
+ {
1409
+ const s = ot(r, n, Se);
1410
+ return s ? Ee(globalThis?.Promise?.try?.(() => ne(e) ? $e?.(e?.[0], e?.[1], s, null) : t != null && t != Symbol.iterator ? $e?.(e, t, s, null) : Ve?.(e, s, null))) : void 0;
1411
+ }
1412
+ }
1413
+ };
1414
+ function cr(e, t, r) {
1415
+ if (e == null || typeof e != "function") return;
1416
+ if (ir(t) && r === void 0) return je(e, t);
1417
+ if (t == null) return je(e, r);
1418
+ const n = ut(r), i = {
1419
+ affectTypes: n.affectTypes,
1420
+ triggerImmediately: n.triggerImmediately
1421
+ }, s = lr(t).map((u) => {
1422
+ const l = sr(u);
1423
+ return b(l.target, l.prop, (f, o, y, a, ...v) => e(ur(l.source, l.target, f, o, y, a ?? null, v)), i);
1424
+ }).filter((u) => typeof u == "function");
1425
+ return () => s.forEach((u) => u?.());
1426
+ }
1427
+ function wr(e, t, r) {
1428
+ return cr(t, e, r);
1429
+ }
1430
+ var Rr = (e) => e instanceof Set ? ct(e) : e instanceof Map ? vr(e) : e, yr = class {
1431
+ #t = /* @__PURE__ */ new WeakMap();
1432
+ #e(e) {
1433
+ let t = this.#t.get(e);
1434
+ return t || (t = /* @__PURE__ */ new WeakMap(), this.#t.set(e, t)), t;
1435
+ }
1436
+ #r(e) {
1437
+ return !Array.isArray(e) || e.length !== 2 ? [null, null] : e;
1438
+ }
1439
+ hasL1(e) {
1440
+ return this.#t.has(e);
1441
+ }
1442
+ set(e, t) {
1443
+ const [r, n] = this.#r(e);
1444
+ return this.#e(r).set(n, t), this;
1445
+ }
1446
+ get(e) {
1447
+ const [t, r] = this.#r(e);
1448
+ return this.#t.get(t)?.get(r);
1449
+ }
1450
+ has(e) {
1451
+ const [t, r] = this.#r(e);
1452
+ return this.#t.get(t)?.has(r) ?? !1;
1453
+ }
1454
+ delete(e) {
1455
+ const [t, r] = this.#r(e), n = this.#t.get(t);
1456
+ return n ? n.delete(r) : !1;
1457
+ }
1458
+ deleteTop(e) {
1459
+ return this.#t.delete(e);
1460
+ }
1461
+ getOrCreate(e, t) {
1462
+ const [r, n] = this.#r(e), i = this.#e(r);
1463
+ if (i.has(n)) return i.get(n);
1464
+ const s = t();
1465
+ return i.set(n, s), s;
1466
+ }
1467
+ getOrInsert(e, t) {
1468
+ const [r, n] = this.#r(e), i = this.#e(r);
1469
+ return i.has(n) ? i.get(n) : (i.set(n, t), t);
1470
+ }
1471
+ getOrInsertComputed(e, t) {
1472
+ const [r, n] = this.#r(e), i = this.#e(r);
1473
+ if (i.has(n)) return i.get(n);
1474
+ const s = t([r, n]);
1475
+ return i.set(n, s), s;
1476
+ }
1477
+ }, Me = new yr();
1478
+ function ar(e, t, r = ["*"]) {
1479
+ if (!e) return;
1480
+ if (Me.has([e, t])) return Me.get([e, t]);
1481
+ const n = (i, s, u, l) => {
1482
+ if (s == "value") {
1483
+ const f = (u?.value ?? u)?.entries?.(), o = e?.value ?? i?.value ?? i;
1484
+ if (f) for (const [y, a] of f) {
1485
+ const v = a ?? (u?.value ?? u)?.[y] ?? null, A = o?.[y];
1486
+ v == null && A != null ? t(A, y, null, "add") : v != null && A == null ? t(null, y, v, "delete") : x(v, A) && t(A, y, v, "set");
1487
+ }
1488
+ return ar(i ?? e?.value, t, r);
1489
+ }
1490
+ return s == null ? void 0 : e[s];
1491
+ };
1492
+ return Me.getOrInsertComputed([e, t], () => e instanceof Set ? b([ct(e), Symbol.iterator], t, r) : e instanceof Map ? b(e, t, r) : I(e) ? b(e, n, r) : Array.isArray(e) && !(e?.length == 2 && C(e?.[1]) && z(e?.[0])) ? b([e, Symbol.iterator], t, r) : b(e, t, r));
1493
+ }
1494
+ function Ie(e, t) {
1495
+ return xt(e, (r) => {
1496
+ const n = Array.isArray(r) && r?.length == 2 && ["object", "function"].indexOf(typeof r?.[0]) >= 0 && C(r?.[1]), i = n ? r?.[1] : null;
1497
+ r = n && i != null ? r?.[0] ?? r : r;
1498
+ const s = typeof r == "object" || typeof r == "function" ? r?.[g] ?? r : r;
1499
+ (r?.[se] ?? p.get(s))?.unaffected?.(t, i);
1500
+ });
1501
+ }
1502
+ var hr = (e, t, r) => (b(t, null, (n, i) => {
1503
+ ie(e, n, i, !0);
1504
+ }), r?.(() => e, (n) => {
1505
+ for (const i in n) ie(t, n[i], i, !0);
1506
+ }, { deep: !0 }), e), Tr = (e, t, r) => hr(t(he(e)), e, r), Pr = (e, t, r = () => "") => b(t, null, (n, i) => {
1507
+ i == r() && ie(e, n, null, !0);
1508
+ }), Mr = (e = []) => {
1509
+ const t = T({ value: 0 }), r = (l) => typeof l == "function" ? l() : I(l) ? l.value : l, i = br([t, "value"], () => e.findIndex((l) => !!r(l)), "value"), s = () => {
1510
+ t.value++;
1511
+ }, u = [];
1512
+ z(e) && u.push(b(e, s, {
1513
+ affectTypes: [
1514
+ "add",
1515
+ "set",
1516
+ "delete"
1517
+ ],
1518
+ triggerImmediately: !1
1519
+ }));
1520
+ for (const l of e) I(l) && u.push(b([l, "value"], s, {
1521
+ affectTypes: ["setter"],
1522
+ triggerImmediately: !1
1523
+ }));
1524
+ return M(i, Symbol.dispose, () => u.forEach((l) => l?.())), i;
1525
+ }, dr = (e, t, r, n) => {
1526
+ if (m(e)) return e ? t : r;
1527
+ const i = () => t, s = () => r, u = (o) => (o != null && (e.value = I(o) ? o?.value : o), (I(e) ? e?.value : e) ? i() : s()), l = T({
1528
+ [d]: u(),
1529
+ [K]: n,
1530
+ [Symbol?.toStringTag]() {
1531
+ return String(u() ?? this[d] ?? "") || "";
1532
+ },
1533
+ [Symbol?.toPrimitive](o) {
1534
+ return E(u() ?? this[d], o);
1535
+ },
1536
+ set value(o) {
1537
+ this[d] = u(o);
1538
+ },
1539
+ get value() {
1540
+ return this[d] = u() ?? this[d];
1541
+ }
1542
+ }), f = b([e, "value"], () => {
1543
+ const o = l?.[d], y = u();
1544
+ l[d] = y, l?.[D]?.({
1545
+ key: "value",
1546
+ value: y,
1547
+ oldValue: o,
1548
+ trigger: "manual"
1549
+ });
1550
+ });
1551
+ return M(l, Symbol.dispose, f), l;
1552
+ }, Ir = dr, kr = (e, t, r) => {
1553
+ r || (r = T({}));
1554
+ const n = b(e, (i, s, u) => {
1555
+ if (s == null) return;
1556
+ const l = t?.(i, s, u);
1557
+ typeof l == "object" ? St(r, l) : x(r[s], l) && (r[s] = l);
1558
+ });
1559
+ return r && M(r, Symbol.dispose, n), r;
1560
+ }, Er = (...e) => {
1561
+ const t = T({});
1562
+ return e?.forEach?.((r) => b(r, (n, i, s) => {
1563
+ i != null && x(t[i], n) && (t[i] = n);
1564
+ })), t;
1565
+ }, ct = (e) => {
1566
+ const t = T([]);
1567
+ return t.push(...Array.from(e?.values?.() || [])), M(t, Symbol.dispose, b(e, (r, n, i) => {
1568
+ if (x(r, i)) if (i == null && r != null) t.push(r);
1569
+ else if (i != null && r == null) {
1570
+ const s = t.indexOf(i);
1571
+ s >= 0 && t.splice(s, 1);
1572
+ } else {
1573
+ const s = t.indexOf(i);
1574
+ s >= 0 && x(t[s], r) && (t[s] = r);
1575
+ }
1576
+ })), t;
1577
+ }, vr = (e) => {
1578
+ const t = T([]), r = Array.from(e.entries());
1579
+ return t.push(...r), M(t, Symbol.dispose, b(e, (n, i, s) => {
1580
+ if (x(n, s) || s == null && n != null || s != null && n == null) if (s != null && n == null) {
1581
+ let u = t.findIndex(([l, f]) => l == i);
1582
+ u < 0 && (u = t.findLastIndex(([l, f]) => s === f)), u >= 0 && t.splice(u, 1);
1583
+ } else {
1584
+ let u = t.findIndex(([l, f]) => l == i);
1585
+ u >= 0 && u < t.length ? x(t[u]?.[1], n) && (t[u] = [i, n]) : t.push([i, n]);
1586
+ }
1587
+ })), t;
1588
+ }, F = /* @__PURE__ */ new WeakMap(), Ye = (e, t, r = "value") => {
1589
+ const n = typeof e?.[1] == "function" && e?.length == 2, i = typeof t?.[1] == "function" && t?.length == 2, s = i ? t?.[1] : null, u = (C(e?.[1]) || e?.[1] == Symbol.iterator) && e?.length == 2;
1590
+ let l = u && !n ? e?.[1] : Array.isArray(e) ? null : r;
1591
+ !u && !n && (e = [e, l]), n && (e[1] = l);
1592
+ const f = (C(t?.[1]) || t?.[1] == Symbol.iterator) && t?.length == 2;
1593
+ let o = f && !i ? t?.[1] : Array.isArray(t) ? null : r;
1594
+ if (!f && !i && (t = [t, o]), i && (t[1] = o), l == null || o == null || le(l, e?.[0]) || le(o, t?.[0])) return;
1595
+ if (!((typeof t?.[0] == "object" || typeof t?.[0] == "function") && t?.[0] != null) && !Array.isArray(e[0]))
1596
+ return ye(t, () => {
1597
+ e[0][l] = t?.[0];
1598
+ }), () => {
1599
+ };
1600
+ const y = (q, Z) => {
1601
+ const B = A?.deref?.(), L = v?.deref?.();
1602
+ if (F?.get?.(B)?.get?.(l)?.bound == L) {
1603
+ let Re = null;
1604
+ const Fe = F?.get?.(B)?.get?.(l)?.cmpfx;
1605
+ ye(L, () => {
1606
+ typeof Fe == "function" ? Re = Fe?.(He(L) ?? q, Z, null) : Re = L?.[Z] ?? q;
1607
+ });
1608
+ const Ge = He(Re);
1609
+ x(B[l], Ge) && ye(L, () => {
1610
+ B[l] = Ge;
1611
+ });
1612
+ } else F?.get?.(B)?.get?.(l)?.dispose?.();
1613
+ }, a = () => {
1614
+ const q = A?.deref?.(), Z = F?.get?.(q), B = Z?.get?.(l);
1615
+ Z?.delete?.(l), B?.unsub?.();
1616
+ }, v = t?.[0] != null && (typeof t?.[0] == "object" || typeof t?.[0] == "function") && !(t?.[0] instanceof WeakRef || typeof t?.[0]?.deref == "function") ? new WeakRef(t?.[0]) : t?.[0], A = e?.[0] != null && (typeof e?.[0] == "object" || typeof e?.[0] == "function") && !(e?.[0] instanceof WeakRef || typeof e?.[0]?.deref == "function") ? new WeakRef(e?.[0]) : e?.[0];
1617
+ let w = {
1618
+ compute: y,
1619
+ dispose: a,
1620
+ cmpfx: s
1621
+ };
1622
+ const O = A?.deref?.(), k = v?.deref?.();
1623
+ return A instanceof WeakRef && (F?.get?.(O)?.get?.(l)?.bound != k && F?.get?.(O)?.delete?.(l), w = F?.getOrInsert?.(O, /* @__PURE__ */ new Map())?.getOrInsertComputed?.(l, () => ({
1624
+ bound: k,
1625
+ cmpfx: s,
1626
+ unsub: null,
1627
+ compute: y,
1628
+ dispose: a
1629
+ })), w.unsub = b(t, y), w.cmpfx = s, M(O, Symbol.dispose, w?.dispose), M(k, Symbol.dispose, w?.dispose)), k && !Array.isArray(k) && ye(O, () => {
1630
+ k[o] ??= O?.[l] ?? k[o];
1631
+ }), w?.dispose;
1632
+ }, Wr = (e, t, r = "value") => {
1633
+ const n = [Ye(e, t, r), Ye(t, e, r)];
1634
+ return () => n?.map?.((i) => i?.());
1635
+ }, br = (e, t, r, n = "value") => {
1636
+ const i = typeof e?.[1] == "function" && e?.length == 2, s = (C(e?.[1]) || e?.[1] == Symbol.iterator) && e?.length == 2;
1637
+ let u = s && !i ? e?.[1] : Array.isArray(e) ? null : n;
1638
+ if (!s && !i && (e = [s ? e?.[0] : e, u]), i && (e[1] = u), u == null || le(u, e?.[0])) return;
1639
+ const l = (a) => {
1640
+ let v;
1641
+ return a != null && (v = e[0][u], e[0][u] = a), t?.(e?.[0]?.[u], u, v);
1642
+ }, f = l(), o = T({
1643
+ [oe]: void 0,
1644
+ [d]: f,
1645
+ [K]: r,
1646
+ [Symbol?.toStringTag]() {
1647
+ return String(l() ?? this[d] ?? "") || "";
1648
+ },
1649
+ [Symbol?.toPrimitive](a) {
1650
+ return E(l() ?? this[d], a);
1651
+ },
1652
+ set value(a) {
1653
+ this[d] = l(a);
1654
+ },
1655
+ get value() {
1656
+ return this[d] = l() ?? this[d];
1657
+ }
1658
+ }), y = b([e?.[0] ?? e, u ?? "value"], () => {
1659
+ const a = o?.[d], v = l();
1660
+ o[d] = v, o?.[D]?.({
1661
+ key: "value",
1662
+ value: v,
1663
+ oldValue: a,
1664
+ trigger: "manual"
1665
+ });
1666
+ });
1667
+ return M(o, Symbol.dispose, y), o;
1668
+ }, _r = (e, t, r = 100) => {
1669
+ let n;
1670
+ return b(e, "value", (i) => {
1671
+ !i && n ? (clearTimeout(n), n = null) : i && !n && (n = Ce(e, t, r) ?? n);
1672
+ });
1673
+ };
1674
+ export {
1675
+ ue as $affected,
1676
+ Yt as $ref,
1677
+ D as $trigger,
1678
+ gt as $triggerControl,
1679
+ me as $triggerLess,
1680
+ h as $triggerLock,
1681
+ Rt as AssignObjectHandler,
1682
+ yr as DoubleWeakMap,
1683
+ M as addToCallChain,
1684
+ b as affected,
1685
+ Ye as assign,
1686
+ F as assignMap,
1687
+ hr as bindBy,
1688
+ Pr as bindByKey,
1689
+ Qt as booleanRef,
1690
+ br as computed,
1691
+ Ir as conditional,
1692
+ Mr as conditionalIndex,
1693
+ dr as conditionalRef,
1694
+ Ar as delayedBehavior,
1695
+ Or as delayedOrInstantBehavior,
1696
+ _r as delayedSubscribe,
1697
+ V as deref,
1698
+ Tr as derivate,
1699
+ cr as effect,
1700
+ wr as effected,
1701
+ z as isObservable,
1702
+ ar as iterated,
1703
+ Wr as link,
1704
+ Rr as makeArrayObservable,
1705
+ pr as makeObjectAssignable,
1706
+ jt as numberRef,
1707
+ vr as observableByMap,
1708
+ ct as observableBySet,
1709
+ T as observe,
1710
+ gr as promised,
1711
+ Xt as propRef,
1712
+ Lt as recoverReactive,
1713
+ Zt as ref,
1714
+ kr as remap,
1715
+ he as safe,
1716
+ U as specializedSubscribe,
1717
+ Jt as stringRef,
1718
+ rr as subscribeDirectly,
1719
+ nr as subscribeInput,
1720
+ fr as subscribePaired,
1721
+ or as subscribeThenable,
1722
+ Ce as triggerWithDelay,
1723
+ Ie as unaffected,
1724
+ Er as unified,
1725
+ Ot as unwrap,
1726
+ xr as useObservable,
1727
+ Xe as wrapRef,
1728
+ Sr as wrapSetAsArray
1729
+ };