@pie-players/pie-tool-line-reader 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/tool-line-reader.js +3217 -0
- package/dist/tool-line-reader.js.map +1 -0
- package/index.ts +8 -0
- package/package.json +61 -0
- package/tool-line-reader.svelte +544 -0
|
@@ -0,0 +1,3217 @@
|
|
|
1
|
+
var hs = Object.defineProperty;
|
|
2
|
+
var Ar = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
|
+
};
|
|
5
|
+
var vs = (e, t, n) => t in e ? hs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
6
|
+
var N = (e, t, n) => vs(e, typeof t != "symbol" ? t + "" : t, n), Yn = (e, t, n) => t.has(e) || Ar("Cannot " + n);
|
|
7
|
+
var f = (e, t, n) => (Yn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), $ = (e, t, n) => t.has(e) ? Ar("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), b = (e, t, n, i) => (Yn(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), F = (e, t, n) => (Yn(e, t, "access private method"), n);
|
|
8
|
+
var qr;
|
|
9
|
+
typeof window < "u" && ((qr = window.__svelte ?? (window.__svelte = {})).v ?? (qr.v = /* @__PURE__ */ new Set())).add("5");
|
|
10
|
+
const _s = 1, ps = 2, gs = 16, ms = 1, bs = 2, Vr = "[", kn = "[!", ir = "]", Ot = {}, B = /* @__PURE__ */ Symbol(), ws = "http://www.w3.org/1999/xhtml", Un = !1;
|
|
11
|
+
var Gr = Array.isArray, $s = Array.prototype.indexOf, Mt = Array.prototype.includes, Tn = Array.from, mn = Object.keys, bn = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, ys = Object.getOwnPropertyDescriptors, Es = Object.prototype, xs = Array.prototype, Wr = Object.getPrototypeOf, Cr = Object.isExtensible;
|
|
12
|
+
function ks(e) {
|
|
13
|
+
for (var t = 0; t < e.length; t++)
|
|
14
|
+
e[t]();
|
|
15
|
+
}
|
|
16
|
+
function Kr() {
|
|
17
|
+
var e, t, n = new Promise((i, r) => {
|
|
18
|
+
e = i, t = r;
|
|
19
|
+
});
|
|
20
|
+
return { promise: n, resolve: e, reject: t };
|
|
21
|
+
}
|
|
22
|
+
const Y = 2, wn = 4, Sn = 8, Xr = 1 << 24, je = 16, me = 32, Je = 64, sr = 128, ue = 512, j = 1024, G = 2048, Be = 4096, te = 8192, Ie = 16384, An = 32768, Rt = 65536, Or = 1 << 17, Jr = 1 << 18, vt = 1 << 19, Ts = 1 << 20, qe = 1 << 25, dt = 32768, qn = 1 << 21, lr = 1 << 22, Ve = 1 << 23, un = /* @__PURE__ */ Symbol("$state"), Ss = /* @__PURE__ */ Symbol("legacy props"), As = /* @__PURE__ */ Symbol(""), bt = new class extends Error {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
N(this, "name", "StaleReactionError");
|
|
26
|
+
N(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
27
|
+
}
|
|
28
|
+
}(), Cn = 3, It = 8;
|
|
29
|
+
function Cs(e) {
|
|
30
|
+
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
31
|
+
}
|
|
32
|
+
function Os() {
|
|
33
|
+
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
34
|
+
}
|
|
35
|
+
function Ms(e) {
|
|
36
|
+
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
37
|
+
}
|
|
38
|
+
function Rs() {
|
|
39
|
+
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
40
|
+
}
|
|
41
|
+
function Ns(e) {
|
|
42
|
+
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
43
|
+
}
|
|
44
|
+
function Ls() {
|
|
45
|
+
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
46
|
+
}
|
|
47
|
+
function Ps() {
|
|
48
|
+
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
49
|
+
}
|
|
50
|
+
function Ds() {
|
|
51
|
+
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
52
|
+
}
|
|
53
|
+
function Is() {
|
|
54
|
+
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
55
|
+
}
|
|
56
|
+
function Fs() {
|
|
57
|
+
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
58
|
+
}
|
|
59
|
+
function zs() {
|
|
60
|
+
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
61
|
+
}
|
|
62
|
+
function On(e) {
|
|
63
|
+
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
64
|
+
}
|
|
65
|
+
function js() {
|
|
66
|
+
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
67
|
+
}
|
|
68
|
+
let x = !1;
|
|
69
|
+
function Pe(e) {
|
|
70
|
+
x = e;
|
|
71
|
+
}
|
|
72
|
+
let k;
|
|
73
|
+
function ne(e) {
|
|
74
|
+
if (e === null)
|
|
75
|
+
throw On(), Ot;
|
|
76
|
+
return k = e;
|
|
77
|
+
}
|
|
78
|
+
function nn() {
|
|
79
|
+
return ne(/* @__PURE__ */ Se(k));
|
|
80
|
+
}
|
|
81
|
+
function U(e) {
|
|
82
|
+
if (x) {
|
|
83
|
+
if (/* @__PURE__ */ Se(k) !== null)
|
|
84
|
+
throw On(), Ot;
|
|
85
|
+
k = e;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function cn(e = 1) {
|
|
89
|
+
if (x) {
|
|
90
|
+
for (var t = e, n = k; t--; )
|
|
91
|
+
n = /** @type {TemplateNode} */
|
|
92
|
+
/* @__PURE__ */ Se(n);
|
|
93
|
+
k = n;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function $n(e = !0) {
|
|
97
|
+
for (var t = 0, n = k; ; ) {
|
|
98
|
+
if (n.nodeType === It) {
|
|
99
|
+
var i = (
|
|
100
|
+
/** @type {Comment} */
|
|
101
|
+
n.data
|
|
102
|
+
);
|
|
103
|
+
if (i === ir) {
|
|
104
|
+
if (t === 0) return n;
|
|
105
|
+
t -= 1;
|
|
106
|
+
} else (i === Vr || i === kn) && (t += 1);
|
|
107
|
+
}
|
|
108
|
+
var r = (
|
|
109
|
+
/** @type {TemplateNode} */
|
|
110
|
+
/* @__PURE__ */ Se(n)
|
|
111
|
+
);
|
|
112
|
+
e && n.remove(), n = r;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function Qr(e) {
|
|
116
|
+
if (!e || e.nodeType !== It)
|
|
117
|
+
throw On(), Ot;
|
|
118
|
+
return (
|
|
119
|
+
/** @type {Comment} */
|
|
120
|
+
e.data
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function Zr(e) {
|
|
124
|
+
return e === this.v;
|
|
125
|
+
}
|
|
126
|
+
function Bs(e, t) {
|
|
127
|
+
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
128
|
+
}
|
|
129
|
+
function ei(e) {
|
|
130
|
+
return !Bs(e, this.v);
|
|
131
|
+
}
|
|
132
|
+
let Ys = !1, re = null;
|
|
133
|
+
function Nt(e) {
|
|
134
|
+
re = e;
|
|
135
|
+
}
|
|
136
|
+
function Mn(e, t = !1, n) {
|
|
137
|
+
re = {
|
|
138
|
+
p: re,
|
|
139
|
+
i: !1,
|
|
140
|
+
c: null,
|
|
141
|
+
e: null,
|
|
142
|
+
s: e,
|
|
143
|
+
x: null,
|
|
144
|
+
l: null
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function Rn(e) {
|
|
148
|
+
var t = (
|
|
149
|
+
/** @type {ComponentContext} */
|
|
150
|
+
re
|
|
151
|
+
), n = t.e;
|
|
152
|
+
if (n !== null) {
|
|
153
|
+
t.e = null;
|
|
154
|
+
for (var i of n)
|
|
155
|
+
xi(i);
|
|
156
|
+
}
|
|
157
|
+
return e !== void 0 && (t.x = e), t.i = !0, re = t.p, e ?? /** @type {T} */
|
|
158
|
+
{};
|
|
159
|
+
}
|
|
160
|
+
function ti() {
|
|
161
|
+
return !0;
|
|
162
|
+
}
|
|
163
|
+
let nt = [];
|
|
164
|
+
function ni() {
|
|
165
|
+
var e = nt;
|
|
166
|
+
nt = [], ks(e);
|
|
167
|
+
}
|
|
168
|
+
function Ge(e) {
|
|
169
|
+
if (nt.length === 0 && !Wt) {
|
|
170
|
+
var t = nt;
|
|
171
|
+
queueMicrotask(() => {
|
|
172
|
+
t === nt && ni();
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
nt.push(e);
|
|
176
|
+
}
|
|
177
|
+
function Hs() {
|
|
178
|
+
for (; nt.length > 0; )
|
|
179
|
+
ni();
|
|
180
|
+
}
|
|
181
|
+
function ri(e) {
|
|
182
|
+
var t = T;
|
|
183
|
+
if (t === null)
|
|
184
|
+
return y.f |= Ve, e;
|
|
185
|
+
if ((t.f & An) === 0) {
|
|
186
|
+
if ((t.f & sr) === 0)
|
|
187
|
+
throw e;
|
|
188
|
+
t.b.error(e);
|
|
189
|
+
} else
|
|
190
|
+
Lt(e, t);
|
|
191
|
+
}
|
|
192
|
+
function Lt(e, t) {
|
|
193
|
+
for (; t !== null; ) {
|
|
194
|
+
if ((t.f & sr) !== 0)
|
|
195
|
+
try {
|
|
196
|
+
t.b.error(e);
|
|
197
|
+
return;
|
|
198
|
+
} catch (n) {
|
|
199
|
+
e = n;
|
|
200
|
+
}
|
|
201
|
+
t = t.parent;
|
|
202
|
+
}
|
|
203
|
+
throw e;
|
|
204
|
+
}
|
|
205
|
+
const Us = -7169;
|
|
206
|
+
function D(e, t) {
|
|
207
|
+
e.f = e.f & Us | t;
|
|
208
|
+
}
|
|
209
|
+
function ar(e) {
|
|
210
|
+
(e.f & ue) !== 0 || e.deps === null ? D(e, j) : D(e, Be);
|
|
211
|
+
}
|
|
212
|
+
function ii(e) {
|
|
213
|
+
if (e !== null)
|
|
214
|
+
for (const t of e)
|
|
215
|
+
(t.f & Y) === 0 || (t.f & dt) === 0 || (t.f ^= dt, ii(
|
|
216
|
+
/** @type {Derived} */
|
|
217
|
+
t.deps
|
|
218
|
+
));
|
|
219
|
+
}
|
|
220
|
+
function si(e, t, n) {
|
|
221
|
+
(e.f & G) !== 0 ? t.add(e) : (e.f & Be) !== 0 && n.add(e), ii(e.deps), D(e, j);
|
|
222
|
+
}
|
|
223
|
+
const an = /* @__PURE__ */ new Set();
|
|
224
|
+
let R = null, ve = null, ee = [], Nn = null, Vn = !1, Wt = !1;
|
|
225
|
+
var Et, xt, it, kt, Jt, Qt, st, Tt, Te, Gn, Wn, li;
|
|
226
|
+
const br = class br {
|
|
227
|
+
constructor() {
|
|
228
|
+
$(this, Te);
|
|
229
|
+
N(this, "committed", !1);
|
|
230
|
+
/**
|
|
231
|
+
* The current values of any sources that are updated in this batch
|
|
232
|
+
* They keys of this map are identical to `this.#previous`
|
|
233
|
+
* @type {Map<Source, any>}
|
|
234
|
+
*/
|
|
235
|
+
N(this, "current", /* @__PURE__ */ new Map());
|
|
236
|
+
/**
|
|
237
|
+
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
238
|
+
* They keys of this map are identical to `this.#current`
|
|
239
|
+
* @type {Map<Source, any>}
|
|
240
|
+
*/
|
|
241
|
+
N(this, "previous", /* @__PURE__ */ new Map());
|
|
242
|
+
/**
|
|
243
|
+
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
244
|
+
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
245
|
+
* @type {Set<() => void>}
|
|
246
|
+
*/
|
|
247
|
+
$(this, Et, /* @__PURE__ */ new Set());
|
|
248
|
+
/**
|
|
249
|
+
* If a fork is discarded, we need to destroy any effects that are no longer needed
|
|
250
|
+
* @type {Set<(batch: Batch) => void>}
|
|
251
|
+
*/
|
|
252
|
+
$(this, xt, /* @__PURE__ */ new Set());
|
|
253
|
+
/**
|
|
254
|
+
* The number of async effects that are currently in flight
|
|
255
|
+
*/
|
|
256
|
+
$(this, it, 0);
|
|
257
|
+
/**
|
|
258
|
+
* The number of async effects that are currently in flight, _not_ inside a pending boundary
|
|
259
|
+
*/
|
|
260
|
+
$(this, kt, 0);
|
|
261
|
+
/**
|
|
262
|
+
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
263
|
+
* TODO replace with Promise.withResolvers once supported widely enough
|
|
264
|
+
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
265
|
+
*/
|
|
266
|
+
$(this, Jt, null);
|
|
267
|
+
/**
|
|
268
|
+
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
269
|
+
* @type {Set<Effect>}
|
|
270
|
+
*/
|
|
271
|
+
$(this, Qt, /* @__PURE__ */ new Set());
|
|
272
|
+
/**
|
|
273
|
+
* Deferred effects that are MAYBE_DIRTY
|
|
274
|
+
* @type {Set<Effect>}
|
|
275
|
+
*/
|
|
276
|
+
$(this, st, /* @__PURE__ */ new Set());
|
|
277
|
+
/**
|
|
278
|
+
* A set of branches that still exist, but will be destroyed when this batch
|
|
279
|
+
* is committed — we skip over these during `process`
|
|
280
|
+
* @type {Set<Effect>}
|
|
281
|
+
*/
|
|
282
|
+
N(this, "skipped_effects", /* @__PURE__ */ new Set());
|
|
283
|
+
N(this, "is_fork", !1);
|
|
284
|
+
$(this, Tt, !1);
|
|
285
|
+
}
|
|
286
|
+
is_deferred() {
|
|
287
|
+
return this.is_fork || f(this, kt) > 0;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
* @param {Effect[]} root_effects
|
|
292
|
+
*/
|
|
293
|
+
process(t) {
|
|
294
|
+
ee = [], this.apply();
|
|
295
|
+
var n = [], i = [];
|
|
296
|
+
for (const r of t)
|
|
297
|
+
F(this, Te, Gn).call(this, r, n, i);
|
|
298
|
+
if (this.is_deferred()) {
|
|
299
|
+
F(this, Te, Wn).call(this, i), F(this, Te, Wn).call(this, n);
|
|
300
|
+
for (const r of this.skipped_effects)
|
|
301
|
+
ui(r);
|
|
302
|
+
} else {
|
|
303
|
+
for (const r of f(this, Et)) r();
|
|
304
|
+
f(this, Et).clear(), f(this, it) === 0 && F(this, Te, li).call(this), R = null, Mr(i), Mr(n), f(this, Jt)?.resolve();
|
|
305
|
+
}
|
|
306
|
+
ve = null;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Associate a change to a given source with the current
|
|
310
|
+
* batch, noting its previous and current values
|
|
311
|
+
* @param {Source} source
|
|
312
|
+
* @param {any} value
|
|
313
|
+
*/
|
|
314
|
+
capture(t, n) {
|
|
315
|
+
n !== B && !this.previous.has(t) && this.previous.set(t, n), (t.f & Ve) === 0 && (this.current.set(t, t.v), ve?.set(t, t.v));
|
|
316
|
+
}
|
|
317
|
+
activate() {
|
|
318
|
+
R = this, this.apply();
|
|
319
|
+
}
|
|
320
|
+
deactivate() {
|
|
321
|
+
R === this && (R = null, ve = null);
|
|
322
|
+
}
|
|
323
|
+
flush() {
|
|
324
|
+
if (this.activate(), ee.length > 0) {
|
|
325
|
+
if (ai(), R !== null && R !== this)
|
|
326
|
+
return;
|
|
327
|
+
} else f(this, it) === 0 && this.process([]);
|
|
328
|
+
this.deactivate();
|
|
329
|
+
}
|
|
330
|
+
discard() {
|
|
331
|
+
for (const t of f(this, xt)) t(this);
|
|
332
|
+
f(this, xt).clear();
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
*
|
|
336
|
+
* @param {boolean} blocking
|
|
337
|
+
*/
|
|
338
|
+
increment(t) {
|
|
339
|
+
b(this, it, f(this, it) + 1), t && b(this, kt, f(this, kt) + 1);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
*
|
|
343
|
+
* @param {boolean} blocking
|
|
344
|
+
*/
|
|
345
|
+
decrement(t) {
|
|
346
|
+
b(this, it, f(this, it) - 1), t && b(this, kt, f(this, kt) - 1), !f(this, Tt) && (b(this, Tt, !0), Ge(() => {
|
|
347
|
+
b(this, Tt, !1), this.is_deferred() ? ee.length > 0 && this.flush() : this.revive();
|
|
348
|
+
}));
|
|
349
|
+
}
|
|
350
|
+
revive() {
|
|
351
|
+
for (const t of f(this, Qt))
|
|
352
|
+
f(this, st).delete(t), D(t, G), ze(t);
|
|
353
|
+
for (const t of f(this, st))
|
|
354
|
+
D(t, Be), ze(t);
|
|
355
|
+
this.flush();
|
|
356
|
+
}
|
|
357
|
+
/** @param {() => void} fn */
|
|
358
|
+
oncommit(t) {
|
|
359
|
+
f(this, Et).add(t);
|
|
360
|
+
}
|
|
361
|
+
/** @param {(batch: Batch) => void} fn */
|
|
362
|
+
ondiscard(t) {
|
|
363
|
+
f(this, xt).add(t);
|
|
364
|
+
}
|
|
365
|
+
settled() {
|
|
366
|
+
return (f(this, Jt) ?? b(this, Jt, Kr())).promise;
|
|
367
|
+
}
|
|
368
|
+
static ensure() {
|
|
369
|
+
if (R === null) {
|
|
370
|
+
const t = R = new br();
|
|
371
|
+
an.add(R), Wt || Ge(() => {
|
|
372
|
+
R === t && t.flush();
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return R;
|
|
376
|
+
}
|
|
377
|
+
apply() {
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
Et = new WeakMap(), xt = new WeakMap(), it = new WeakMap(), kt = new WeakMap(), Jt = new WeakMap(), Qt = new WeakMap(), st = new WeakMap(), Tt = new WeakMap(), Te = new WeakSet(), /**
|
|
381
|
+
* Traverse the effect tree, executing effects or stashing
|
|
382
|
+
* them for later execution as appropriate
|
|
383
|
+
* @param {Effect} root
|
|
384
|
+
* @param {Effect[]} effects
|
|
385
|
+
* @param {Effect[]} render_effects
|
|
386
|
+
*/
|
|
387
|
+
Gn = function(t, n, i) {
|
|
388
|
+
t.f ^= j;
|
|
389
|
+
for (var r = t.first, s = null; r !== null; ) {
|
|
390
|
+
var l = r.f, a = (l & (me | Je)) !== 0, o = a && (l & j) !== 0, c = o || (l & te) !== 0 || this.skipped_effects.has(r);
|
|
391
|
+
if (!c && r.fn !== null) {
|
|
392
|
+
a ? r.f ^= j : s !== null && (l & (wn | Sn | Xr)) !== 0 ? s.b.defer_effect(r) : (l & wn) !== 0 ? n.push(r) : rn(r) && ((l & je) !== 0 && f(this, st).add(r), Xt(r));
|
|
393
|
+
var d = r.first;
|
|
394
|
+
if (d !== null) {
|
|
395
|
+
r = d;
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
var h = r.parent;
|
|
400
|
+
for (r = r.next; r === null && h !== null; )
|
|
401
|
+
h === s && (s = null), r = h.next, h = h.parent;
|
|
402
|
+
}
|
|
403
|
+
}, /**
|
|
404
|
+
* @param {Effect[]} effects
|
|
405
|
+
*/
|
|
406
|
+
Wn = function(t) {
|
|
407
|
+
for (var n = 0; n < t.length; n += 1)
|
|
408
|
+
si(t[n], f(this, Qt), f(this, st));
|
|
409
|
+
}, li = function() {
|
|
410
|
+
var r;
|
|
411
|
+
if (an.size > 1) {
|
|
412
|
+
this.previous.clear();
|
|
413
|
+
var t = ve, n = !0;
|
|
414
|
+
for (const s of an) {
|
|
415
|
+
if (s === this) {
|
|
416
|
+
n = !1;
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
const l = [];
|
|
420
|
+
for (const [o, c] of this.current) {
|
|
421
|
+
if (s.current.has(o))
|
|
422
|
+
if (n && c !== s.current.get(o))
|
|
423
|
+
s.current.set(o, c);
|
|
424
|
+
else
|
|
425
|
+
continue;
|
|
426
|
+
l.push(o);
|
|
427
|
+
}
|
|
428
|
+
if (l.length === 0)
|
|
429
|
+
continue;
|
|
430
|
+
const a = [...s.current.keys()].filter((o) => !this.current.has(o));
|
|
431
|
+
if (a.length > 0) {
|
|
432
|
+
var i = ee;
|
|
433
|
+
ee = [];
|
|
434
|
+
const o = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
|
|
435
|
+
for (const d of l)
|
|
436
|
+
oi(d, a, o, c);
|
|
437
|
+
if (ee.length > 0) {
|
|
438
|
+
R = s, s.apply();
|
|
439
|
+
for (const d of ee)
|
|
440
|
+
F(r = s, Te, Gn).call(r, d, [], []);
|
|
441
|
+
s.deactivate();
|
|
442
|
+
}
|
|
443
|
+
ee = i;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
R = null, ve = t;
|
|
447
|
+
}
|
|
448
|
+
this.committed = !0, an.delete(this);
|
|
449
|
+
};
|
|
450
|
+
let Fe = br;
|
|
451
|
+
function fe(e) {
|
|
452
|
+
var t = Wt;
|
|
453
|
+
Wt = !0;
|
|
454
|
+
try {
|
|
455
|
+
for (var n; ; ) {
|
|
456
|
+
if (Hs(), ee.length === 0 && (R?.flush(), ee.length === 0))
|
|
457
|
+
return Nn = null, /** @type {T} */
|
|
458
|
+
n;
|
|
459
|
+
ai();
|
|
460
|
+
}
|
|
461
|
+
} finally {
|
|
462
|
+
Wt = t;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
function ai() {
|
|
466
|
+
Vn = !0;
|
|
467
|
+
var e = null;
|
|
468
|
+
try {
|
|
469
|
+
for (var t = 0; ee.length > 0; ) {
|
|
470
|
+
var n = Fe.ensure();
|
|
471
|
+
if (t++ > 1e3) {
|
|
472
|
+
var i, r;
|
|
473
|
+
qs();
|
|
474
|
+
}
|
|
475
|
+
n.process(ee), We.clear();
|
|
476
|
+
}
|
|
477
|
+
} finally {
|
|
478
|
+
Vn = !1, Nn = null;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
function qs() {
|
|
482
|
+
try {
|
|
483
|
+
Ls();
|
|
484
|
+
} catch (e) {
|
|
485
|
+
Lt(e, Nn);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
let Oe = null;
|
|
489
|
+
function Mr(e) {
|
|
490
|
+
var t = e.length;
|
|
491
|
+
if (t !== 0) {
|
|
492
|
+
for (var n = 0; n < t; ) {
|
|
493
|
+
var i = e[n++];
|
|
494
|
+
if ((i.f & (Ie | te)) === 0 && rn(i) && (Oe = /* @__PURE__ */ new Set(), Xt(i), i.deps === null && i.first === null && i.nodes === null && (i.teardown === null && i.ac === null ? Ai(i) : i.fn = null), Oe?.size > 0)) {
|
|
495
|
+
We.clear();
|
|
496
|
+
for (const r of Oe) {
|
|
497
|
+
if ((r.f & (Ie | te)) !== 0) continue;
|
|
498
|
+
const s = [r];
|
|
499
|
+
let l = r.parent;
|
|
500
|
+
for (; l !== null; )
|
|
501
|
+
Oe.has(l) && (Oe.delete(l), s.push(l)), l = l.parent;
|
|
502
|
+
for (let a = s.length - 1; a >= 0; a--) {
|
|
503
|
+
const o = s[a];
|
|
504
|
+
(o.f & (Ie | te)) === 0 && Xt(o);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
Oe.clear();
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
Oe = null;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
function oi(e, t, n, i) {
|
|
514
|
+
if (!n.has(e) && (n.add(e), e.reactions !== null))
|
|
515
|
+
for (const r of e.reactions) {
|
|
516
|
+
const s = r.f;
|
|
517
|
+
(s & Y) !== 0 ? oi(
|
|
518
|
+
/** @type {Derived} */
|
|
519
|
+
r,
|
|
520
|
+
t,
|
|
521
|
+
n,
|
|
522
|
+
i
|
|
523
|
+
) : (s & (lr | je)) !== 0 && (s & G) === 0 && fi(r, t, i) && (D(r, G), ze(
|
|
524
|
+
/** @type {Effect} */
|
|
525
|
+
r
|
|
526
|
+
));
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function fi(e, t, n) {
|
|
530
|
+
const i = n.get(e);
|
|
531
|
+
if (i !== void 0) return i;
|
|
532
|
+
if (e.deps !== null)
|
|
533
|
+
for (const r of e.deps) {
|
|
534
|
+
if (Mt.call(t, r))
|
|
535
|
+
return !0;
|
|
536
|
+
if ((r.f & Y) !== 0 && fi(
|
|
537
|
+
/** @type {Derived} */
|
|
538
|
+
r,
|
|
539
|
+
t,
|
|
540
|
+
n
|
|
541
|
+
))
|
|
542
|
+
return n.set(
|
|
543
|
+
/** @type {Derived} */
|
|
544
|
+
r,
|
|
545
|
+
!0
|
|
546
|
+
), !0;
|
|
547
|
+
}
|
|
548
|
+
return n.set(e, !1), !1;
|
|
549
|
+
}
|
|
550
|
+
function ze(e) {
|
|
551
|
+
for (var t = Nn = e; t.parent !== null; ) {
|
|
552
|
+
t = t.parent;
|
|
553
|
+
var n = t.f;
|
|
554
|
+
if (Vn && t === T && (n & je) !== 0 && (n & Jr) === 0)
|
|
555
|
+
return;
|
|
556
|
+
if ((n & (Je | me)) !== 0) {
|
|
557
|
+
if ((n & j) === 0) return;
|
|
558
|
+
t.f ^= j;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
ee.push(t);
|
|
562
|
+
}
|
|
563
|
+
function ui(e) {
|
|
564
|
+
if (!((e.f & me) !== 0 && (e.f & j) !== 0)) {
|
|
565
|
+
D(e, j);
|
|
566
|
+
for (var t = e.first; t !== null; )
|
|
567
|
+
ui(t), t = t.next;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
function Vs(e) {
|
|
571
|
+
let t = 0, n = ht(0), i;
|
|
572
|
+
return () => {
|
|
573
|
+
ur() && (u(n), cr(() => (t === 0 && (i = vr(() => e(() => Kt(n)))), t += 1, () => {
|
|
574
|
+
Ge(() => {
|
|
575
|
+
t -= 1, t === 0 && (i?.(), i = void 0, Kt(n));
|
|
576
|
+
});
|
|
577
|
+
})));
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
var Gs = Rt | vt | sr;
|
|
581
|
+
function Ws(e, t, n) {
|
|
582
|
+
new Ks(e, t, n);
|
|
583
|
+
}
|
|
584
|
+
var Q, Zt, we, lt, $e, le, W, ye, Me, Ue, at, Re, St, ot, At, Ct, Ne, En, L, ci, di, Kn, dn, hn, Xn;
|
|
585
|
+
class Ks {
|
|
586
|
+
/**
|
|
587
|
+
* @param {TemplateNode} node
|
|
588
|
+
* @param {BoundaryProps} props
|
|
589
|
+
* @param {((anchor: Node) => void)} children
|
|
590
|
+
*/
|
|
591
|
+
constructor(t, n, i) {
|
|
592
|
+
$(this, L);
|
|
593
|
+
/** @type {Boundary | null} */
|
|
594
|
+
N(this, "parent");
|
|
595
|
+
N(this, "is_pending", !1);
|
|
596
|
+
/** @type {TemplateNode} */
|
|
597
|
+
$(this, Q);
|
|
598
|
+
/** @type {TemplateNode | null} */
|
|
599
|
+
$(this, Zt, x ? k : null);
|
|
600
|
+
/** @type {BoundaryProps} */
|
|
601
|
+
$(this, we);
|
|
602
|
+
/** @type {((anchor: Node) => void)} */
|
|
603
|
+
$(this, lt);
|
|
604
|
+
/** @type {Effect} */
|
|
605
|
+
$(this, $e);
|
|
606
|
+
/** @type {Effect | null} */
|
|
607
|
+
$(this, le, null);
|
|
608
|
+
/** @type {Effect | null} */
|
|
609
|
+
$(this, W, null);
|
|
610
|
+
/** @type {Effect | null} */
|
|
611
|
+
$(this, ye, null);
|
|
612
|
+
/** @type {DocumentFragment | null} */
|
|
613
|
+
$(this, Me, null);
|
|
614
|
+
/** @type {TemplateNode | null} */
|
|
615
|
+
$(this, Ue, null);
|
|
616
|
+
$(this, at, 0);
|
|
617
|
+
$(this, Re, 0);
|
|
618
|
+
$(this, St, !1);
|
|
619
|
+
$(this, ot, !1);
|
|
620
|
+
/** @type {Set<Effect>} */
|
|
621
|
+
$(this, At, /* @__PURE__ */ new Set());
|
|
622
|
+
/** @type {Set<Effect>} */
|
|
623
|
+
$(this, Ct, /* @__PURE__ */ new Set());
|
|
624
|
+
/**
|
|
625
|
+
* A source containing the number of pending async deriveds/expressions.
|
|
626
|
+
* Only created if `$effect.pending()` is used inside the boundary,
|
|
627
|
+
* otherwise updating the source results in needless `Batch.ensure()`
|
|
628
|
+
* calls followed by no-op flushes
|
|
629
|
+
* @type {Source<number> | null}
|
|
630
|
+
*/
|
|
631
|
+
$(this, Ne, null);
|
|
632
|
+
$(this, En, Vs(() => (b(this, Ne, ht(f(this, at))), () => {
|
|
633
|
+
b(this, Ne, null);
|
|
634
|
+
})));
|
|
635
|
+
b(this, Q, t), b(this, we, n), b(this, lt, i), this.parent = /** @type {Effect} */
|
|
636
|
+
T.b, this.is_pending = !!f(this, we).pending, b(this, $e, dr(() => {
|
|
637
|
+
if (T.b = this, x) {
|
|
638
|
+
const s = f(this, Zt);
|
|
639
|
+
nn(), /** @type {Comment} */
|
|
640
|
+
s.nodeType === It && /** @type {Comment} */
|
|
641
|
+
s.data === kn ? F(this, L, di).call(this) : (F(this, L, ci).call(this), f(this, Re) === 0 && (this.is_pending = !1));
|
|
642
|
+
} else {
|
|
643
|
+
var r = F(this, L, Kn).call(this);
|
|
644
|
+
try {
|
|
645
|
+
b(this, le, oe(() => i(r)));
|
|
646
|
+
} catch (s) {
|
|
647
|
+
this.error(s);
|
|
648
|
+
}
|
|
649
|
+
f(this, Re) > 0 ? F(this, L, hn).call(this) : this.is_pending = !1;
|
|
650
|
+
}
|
|
651
|
+
return () => {
|
|
652
|
+
f(this, Ue)?.remove();
|
|
653
|
+
};
|
|
654
|
+
}, Gs)), x && b(this, Q, k);
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Defer an effect inside a pending boundary until the boundary resolves
|
|
658
|
+
* @param {Effect} effect
|
|
659
|
+
*/
|
|
660
|
+
defer_effect(t) {
|
|
661
|
+
si(t, f(this, At), f(this, Ct));
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
665
|
+
* @returns {boolean}
|
|
666
|
+
*/
|
|
667
|
+
is_rendered() {
|
|
668
|
+
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
669
|
+
}
|
|
670
|
+
has_pending_snippet() {
|
|
671
|
+
return !!f(this, we).pending;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
675
|
+
* and controls when the current `pending` snippet (if any) is removed.
|
|
676
|
+
* Do not call from inside the class
|
|
677
|
+
* @param {1 | -1} d
|
|
678
|
+
*/
|
|
679
|
+
update_pending_count(t) {
|
|
680
|
+
F(this, L, Xn).call(this, t), b(this, at, f(this, at) + t), !(!f(this, Ne) || f(this, St)) && (b(this, St, !0), Ge(() => {
|
|
681
|
+
b(this, St, !1), f(this, Ne) && Pt(f(this, Ne), f(this, at));
|
|
682
|
+
}));
|
|
683
|
+
}
|
|
684
|
+
get_effect_pending() {
|
|
685
|
+
return f(this, En).call(this), u(
|
|
686
|
+
/** @type {Source<number>} */
|
|
687
|
+
f(this, Ne)
|
|
688
|
+
);
|
|
689
|
+
}
|
|
690
|
+
/** @param {unknown} error */
|
|
691
|
+
error(t) {
|
|
692
|
+
var n = f(this, we).onerror;
|
|
693
|
+
let i = f(this, we).failed;
|
|
694
|
+
if (f(this, ot) || !n && !i)
|
|
695
|
+
throw t;
|
|
696
|
+
f(this, le) && (V(f(this, le)), b(this, le, null)), f(this, W) && (V(f(this, W)), b(this, W, null)), f(this, ye) && (V(f(this, ye)), b(this, ye, null)), x && (ne(
|
|
697
|
+
/** @type {TemplateNode} */
|
|
698
|
+
f(this, Zt)
|
|
699
|
+
), cn(), ne($n()));
|
|
700
|
+
var r = !1, s = !1;
|
|
701
|
+
const l = () => {
|
|
702
|
+
if (r) {
|
|
703
|
+
js();
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
r = !0, s && zs(), Fe.ensure(), b(this, at, 0), f(this, ye) !== null && ut(f(this, ye), () => {
|
|
707
|
+
b(this, ye, null);
|
|
708
|
+
}), this.is_pending = this.has_pending_snippet(), b(this, le, F(this, L, dn).call(this, () => (b(this, ot, !1), oe(() => f(this, lt).call(this, f(this, Q)))))), f(this, Re) > 0 ? F(this, L, hn).call(this) : this.is_pending = !1;
|
|
709
|
+
};
|
|
710
|
+
Ge(() => {
|
|
711
|
+
try {
|
|
712
|
+
s = !0, n?.(t, l), s = !1;
|
|
713
|
+
} catch (a) {
|
|
714
|
+
Lt(a, f(this, $e) && f(this, $e).parent);
|
|
715
|
+
}
|
|
716
|
+
i && b(this, ye, F(this, L, dn).call(this, () => {
|
|
717
|
+
Fe.ensure(), b(this, ot, !0);
|
|
718
|
+
try {
|
|
719
|
+
return oe(() => {
|
|
720
|
+
i(
|
|
721
|
+
f(this, Q),
|
|
722
|
+
() => t,
|
|
723
|
+
() => l
|
|
724
|
+
);
|
|
725
|
+
});
|
|
726
|
+
} catch (a) {
|
|
727
|
+
return Lt(
|
|
728
|
+
a,
|
|
729
|
+
/** @type {Effect} */
|
|
730
|
+
f(this, $e).parent
|
|
731
|
+
), null;
|
|
732
|
+
} finally {
|
|
733
|
+
b(this, ot, !1);
|
|
734
|
+
}
|
|
735
|
+
}));
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
Q = new WeakMap(), Zt = new WeakMap(), we = new WeakMap(), lt = new WeakMap(), $e = new WeakMap(), le = new WeakMap(), W = new WeakMap(), ye = new WeakMap(), Me = new WeakMap(), Ue = new WeakMap(), at = new WeakMap(), Re = new WeakMap(), St = new WeakMap(), ot = new WeakMap(), At = new WeakMap(), Ct = new WeakMap(), Ne = new WeakMap(), En = new WeakMap(), L = new WeakSet(), ci = function() {
|
|
740
|
+
try {
|
|
741
|
+
b(this, le, oe(() => f(this, lt).call(this, f(this, Q))));
|
|
742
|
+
} catch (t) {
|
|
743
|
+
this.error(t);
|
|
744
|
+
}
|
|
745
|
+
}, di = function() {
|
|
746
|
+
const t = f(this, we).pending;
|
|
747
|
+
t && (b(this, W, oe(() => t(f(this, Q)))), Ge(() => {
|
|
748
|
+
var n = F(this, L, Kn).call(this);
|
|
749
|
+
b(this, le, F(this, L, dn).call(this, () => (Fe.ensure(), oe(() => f(this, lt).call(this, n))))), f(this, Re) > 0 ? F(this, L, hn).call(this) : (ut(
|
|
750
|
+
/** @type {Effect} */
|
|
751
|
+
f(this, W),
|
|
752
|
+
() => {
|
|
753
|
+
b(this, W, null);
|
|
754
|
+
}
|
|
755
|
+
), this.is_pending = !1);
|
|
756
|
+
}));
|
|
757
|
+
}, Kn = function() {
|
|
758
|
+
var t = f(this, Q);
|
|
759
|
+
return this.is_pending && (b(this, Ue, ge()), f(this, Q).before(f(this, Ue)), t = f(this, Ue)), t;
|
|
760
|
+
}, /**
|
|
761
|
+
* @param {() => Effect | null} fn
|
|
762
|
+
*/
|
|
763
|
+
dn = function(t) {
|
|
764
|
+
var n = T, i = y, r = re;
|
|
765
|
+
ke(f(this, $e)), de(f(this, $e)), Nt(f(this, $e).ctx);
|
|
766
|
+
try {
|
|
767
|
+
return t();
|
|
768
|
+
} catch (s) {
|
|
769
|
+
return ri(s), null;
|
|
770
|
+
} finally {
|
|
771
|
+
ke(n), de(i), Nt(r);
|
|
772
|
+
}
|
|
773
|
+
}, hn = function() {
|
|
774
|
+
const t = (
|
|
775
|
+
/** @type {(anchor: Node) => void} */
|
|
776
|
+
f(this, we).pending
|
|
777
|
+
);
|
|
778
|
+
f(this, le) !== null && (b(this, Me, document.createDocumentFragment()), f(this, Me).append(
|
|
779
|
+
/** @type {TemplateNode} */
|
|
780
|
+
f(this, Ue)
|
|
781
|
+
), Mi(f(this, le), f(this, Me))), f(this, W) === null && b(this, W, oe(() => t(f(this, Q))));
|
|
782
|
+
}, /**
|
|
783
|
+
* Updates the pending count associated with the currently visible pending snippet,
|
|
784
|
+
* if any, such that we can replace the snippet with content once work is done
|
|
785
|
+
* @param {1 | -1} d
|
|
786
|
+
*/
|
|
787
|
+
Xn = function(t) {
|
|
788
|
+
var n;
|
|
789
|
+
if (!this.has_pending_snippet()) {
|
|
790
|
+
this.parent && F(n = this.parent, L, Xn).call(n, t);
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
if (b(this, Re, f(this, Re) + t), f(this, Re) === 0) {
|
|
794
|
+
this.is_pending = !1;
|
|
795
|
+
for (const i of f(this, At))
|
|
796
|
+
D(i, G), ze(i);
|
|
797
|
+
for (const i of f(this, Ct))
|
|
798
|
+
D(i, Be), ze(i);
|
|
799
|
+
f(this, At).clear(), f(this, Ct).clear(), f(this, W) && ut(f(this, W), () => {
|
|
800
|
+
b(this, W, null);
|
|
801
|
+
}), f(this, Me) && (f(this, Q).before(f(this, Me)), b(this, Me, null));
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
function Xs(e, t, n, i) {
|
|
805
|
+
const r = Ln;
|
|
806
|
+
var s = e.filter((_) => !_.settled);
|
|
807
|
+
if (n.length === 0 && s.length === 0) {
|
|
808
|
+
i(t.map(r));
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
var l = R, a = (
|
|
812
|
+
/** @type {Effect} */
|
|
813
|
+
T
|
|
814
|
+
), o = Js(), c = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((_) => _.promise)) : null;
|
|
815
|
+
function d(_) {
|
|
816
|
+
o();
|
|
817
|
+
try {
|
|
818
|
+
i(_);
|
|
819
|
+
} catch (p) {
|
|
820
|
+
(a.f & Ie) === 0 && Lt(p, a);
|
|
821
|
+
}
|
|
822
|
+
l?.deactivate(), Jn();
|
|
823
|
+
}
|
|
824
|
+
if (n.length === 0) {
|
|
825
|
+
c.then(() => d(t.map(r)));
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
function h() {
|
|
829
|
+
o(), Promise.all(n.map((_) => /* @__PURE__ */ Qs(_))).then((_) => d([...t.map(r), ..._])).catch((_) => Lt(_, a));
|
|
830
|
+
}
|
|
831
|
+
c ? c.then(h) : h();
|
|
832
|
+
}
|
|
833
|
+
function Js() {
|
|
834
|
+
var e = T, t = y, n = re, i = R;
|
|
835
|
+
return function(s = !0) {
|
|
836
|
+
ke(e), de(t), Nt(n), s && i?.activate();
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
function Jn() {
|
|
840
|
+
ke(null), de(null), Nt(null);
|
|
841
|
+
}
|
|
842
|
+
// @__NO_SIDE_EFFECTS__
|
|
843
|
+
function Ln(e) {
|
|
844
|
+
var t = Y | G, n = y !== null && (y.f & Y) !== 0 ? (
|
|
845
|
+
/** @type {Derived} */
|
|
846
|
+
y
|
|
847
|
+
) : null;
|
|
848
|
+
return T !== null && (T.f |= vt), {
|
|
849
|
+
ctx: re,
|
|
850
|
+
deps: null,
|
|
851
|
+
effects: null,
|
|
852
|
+
equals: Zr,
|
|
853
|
+
f: t,
|
|
854
|
+
fn: e,
|
|
855
|
+
reactions: null,
|
|
856
|
+
rv: 0,
|
|
857
|
+
v: (
|
|
858
|
+
/** @type {V} */
|
|
859
|
+
B
|
|
860
|
+
),
|
|
861
|
+
wv: 0,
|
|
862
|
+
parent: n ?? T,
|
|
863
|
+
ac: null
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
// @__NO_SIDE_EFFECTS__
|
|
867
|
+
function Qs(e, t, n) {
|
|
868
|
+
let i = (
|
|
869
|
+
/** @type {Effect | null} */
|
|
870
|
+
T
|
|
871
|
+
);
|
|
872
|
+
i === null && Os();
|
|
873
|
+
var r = (
|
|
874
|
+
/** @type {Boundary} */
|
|
875
|
+
i.b
|
|
876
|
+
), s = (
|
|
877
|
+
/** @type {Promise<V>} */
|
|
878
|
+
/** @type {unknown} */
|
|
879
|
+
void 0
|
|
880
|
+
), l = ht(
|
|
881
|
+
/** @type {V} */
|
|
882
|
+
B
|
|
883
|
+
), a = !y, o = /* @__PURE__ */ new Map();
|
|
884
|
+
return fl(() => {
|
|
885
|
+
var c = Kr();
|
|
886
|
+
s = c.promise;
|
|
887
|
+
try {
|
|
888
|
+
Promise.resolve(e()).then(c.resolve, c.reject).then(() => {
|
|
889
|
+
d === R && d.committed && d.deactivate(), Jn();
|
|
890
|
+
});
|
|
891
|
+
} catch (p) {
|
|
892
|
+
c.reject(p), Jn();
|
|
893
|
+
}
|
|
894
|
+
var d = (
|
|
895
|
+
/** @type {Batch} */
|
|
896
|
+
R
|
|
897
|
+
);
|
|
898
|
+
if (a) {
|
|
899
|
+
var h = r.is_rendered();
|
|
900
|
+
r.update_pending_count(1), d.increment(h), o.get(d)?.reject(bt), o.delete(d), o.set(d, c);
|
|
901
|
+
}
|
|
902
|
+
const _ = (p, v = void 0) => {
|
|
903
|
+
if (d.activate(), v)
|
|
904
|
+
v !== bt && (l.f |= Ve, Pt(l, v));
|
|
905
|
+
else {
|
|
906
|
+
(l.f & Ve) !== 0 && (l.f ^= Ve), Pt(l, p);
|
|
907
|
+
for (const [g, m] of o) {
|
|
908
|
+
if (o.delete(g), g === d) break;
|
|
909
|
+
m.reject(bt);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
a && (r.update_pending_count(-1), d.decrement(h));
|
|
913
|
+
};
|
|
914
|
+
c.promise.then(_, (p) => _(null, p || "unknown"));
|
|
915
|
+
}), ll(() => {
|
|
916
|
+
for (const c of o.values())
|
|
917
|
+
c.reject(bt);
|
|
918
|
+
}), new Promise((c) => {
|
|
919
|
+
function d(h) {
|
|
920
|
+
function _() {
|
|
921
|
+
h === s ? c(l) : d(s);
|
|
922
|
+
}
|
|
923
|
+
h.then(_, _);
|
|
924
|
+
}
|
|
925
|
+
d(s);
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
// @__NO_SIDE_EFFECTS__
|
|
929
|
+
function Zs(e) {
|
|
930
|
+
const t = /* @__PURE__ */ Ln(e);
|
|
931
|
+
return Ri(t), t;
|
|
932
|
+
}
|
|
933
|
+
// @__NO_SIDE_EFFECTS__
|
|
934
|
+
function el(e) {
|
|
935
|
+
const t = /* @__PURE__ */ Ln(e);
|
|
936
|
+
return t.equals = ei, t;
|
|
937
|
+
}
|
|
938
|
+
function hi(e) {
|
|
939
|
+
var t = e.effects;
|
|
940
|
+
if (t !== null) {
|
|
941
|
+
e.effects = null;
|
|
942
|
+
for (var n = 0; n < t.length; n += 1)
|
|
943
|
+
V(
|
|
944
|
+
/** @type {Effect} */
|
|
945
|
+
t[n]
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
function tl(e) {
|
|
950
|
+
for (var t = e.parent; t !== null; ) {
|
|
951
|
+
if ((t.f & Y) === 0)
|
|
952
|
+
return (t.f & Ie) === 0 ? (
|
|
953
|
+
/** @type {Effect} */
|
|
954
|
+
t
|
|
955
|
+
) : null;
|
|
956
|
+
t = t.parent;
|
|
957
|
+
}
|
|
958
|
+
return null;
|
|
959
|
+
}
|
|
960
|
+
function or(e) {
|
|
961
|
+
var t, n = T;
|
|
962
|
+
ke(tl(e));
|
|
963
|
+
try {
|
|
964
|
+
e.f &= ~dt, hi(e), t = Di(e);
|
|
965
|
+
} finally {
|
|
966
|
+
ke(n);
|
|
967
|
+
}
|
|
968
|
+
return t;
|
|
969
|
+
}
|
|
970
|
+
function vi(e) {
|
|
971
|
+
var t = or(e);
|
|
972
|
+
if (!e.equals(t) && (e.wv = Li(), (!R?.is_fork || e.deps === null) && (e.v = t, e.deps === null))) {
|
|
973
|
+
D(e, j);
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
Xe || (ve !== null ? (ur() || R?.is_fork) && ve.set(e, t) : ar(e));
|
|
977
|
+
}
|
|
978
|
+
let Qn = /* @__PURE__ */ new Set();
|
|
979
|
+
const We = /* @__PURE__ */ new Map();
|
|
980
|
+
let _i = !1;
|
|
981
|
+
function ht(e, t) {
|
|
982
|
+
var n = {
|
|
983
|
+
f: 0,
|
|
984
|
+
// TODO ideally we could skip this altogether, but it causes type errors
|
|
985
|
+
v: e,
|
|
986
|
+
reactions: null,
|
|
987
|
+
equals: Zr,
|
|
988
|
+
rv: 0,
|
|
989
|
+
wv: 0
|
|
990
|
+
};
|
|
991
|
+
return n;
|
|
992
|
+
}
|
|
993
|
+
// @__NO_SIDE_EFFECTS__
|
|
994
|
+
function M(e, t) {
|
|
995
|
+
const n = ht(e);
|
|
996
|
+
return Ri(n), n;
|
|
997
|
+
}
|
|
998
|
+
// @__NO_SIDE_EFFECTS__
|
|
999
|
+
function pi(e, t = !1, n = !0) {
|
|
1000
|
+
const i = ht(e);
|
|
1001
|
+
return t || (i.equals = ei), i;
|
|
1002
|
+
}
|
|
1003
|
+
function E(e, t, n = !1) {
|
|
1004
|
+
y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
1005
|
+
// to ensure we error if state is set inside an inspect effect
|
|
1006
|
+
(!_e || (y.f & Or) !== 0) && ti() && (y.f & (Y | je | lr | Or)) !== 0 && (ce === null || !Mt.call(ce, e)) && Fs();
|
|
1007
|
+
let i = n ? De(t) : t;
|
|
1008
|
+
return Pt(e, i);
|
|
1009
|
+
}
|
|
1010
|
+
function Pt(e, t) {
|
|
1011
|
+
if (!e.equals(t)) {
|
|
1012
|
+
var n = e.v;
|
|
1013
|
+
Xe ? We.set(e, t) : We.set(e, n), e.v = t;
|
|
1014
|
+
var i = Fe.ensure();
|
|
1015
|
+
if (i.capture(e, n), (e.f & Y) !== 0) {
|
|
1016
|
+
const r = (
|
|
1017
|
+
/** @type {Derived} */
|
|
1018
|
+
e
|
|
1019
|
+
);
|
|
1020
|
+
(e.f & G) !== 0 && or(r), ar(r);
|
|
1021
|
+
}
|
|
1022
|
+
e.wv = Li(), gi(e, G), T !== null && (T.f & j) !== 0 && (T.f & (me | Je)) === 0 && (se === null ? dl([e]) : se.push(e)), !i.is_fork && Qn.size > 0 && !_i && nl();
|
|
1023
|
+
}
|
|
1024
|
+
return t;
|
|
1025
|
+
}
|
|
1026
|
+
function nl() {
|
|
1027
|
+
_i = !1;
|
|
1028
|
+
for (const e of Qn)
|
|
1029
|
+
(e.f & j) !== 0 && D(e, Be), rn(e) && Xt(e);
|
|
1030
|
+
Qn.clear();
|
|
1031
|
+
}
|
|
1032
|
+
function Kt(e) {
|
|
1033
|
+
E(e, e.v + 1);
|
|
1034
|
+
}
|
|
1035
|
+
function gi(e, t) {
|
|
1036
|
+
var n = e.reactions;
|
|
1037
|
+
if (n !== null)
|
|
1038
|
+
for (var i = n.length, r = 0; r < i; r++) {
|
|
1039
|
+
var s = n[r], l = s.f, a = (l & G) === 0;
|
|
1040
|
+
if (a && D(s, t), (l & Y) !== 0) {
|
|
1041
|
+
var o = (
|
|
1042
|
+
/** @type {Derived} */
|
|
1043
|
+
s
|
|
1044
|
+
);
|
|
1045
|
+
ve?.delete(o), (l & dt) === 0 && (l & ue && (s.f |= dt), gi(o, Be));
|
|
1046
|
+
} else a && ((l & je) !== 0 && Oe !== null && Oe.add(
|
|
1047
|
+
/** @type {Effect} */
|
|
1048
|
+
s
|
|
1049
|
+
), ze(
|
|
1050
|
+
/** @type {Effect} */
|
|
1051
|
+
s
|
|
1052
|
+
));
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
function De(e) {
|
|
1056
|
+
if (typeof e != "object" || e === null || un in e)
|
|
1057
|
+
return e;
|
|
1058
|
+
const t = Wr(e);
|
|
1059
|
+
if (t !== Es && t !== xs)
|
|
1060
|
+
return e;
|
|
1061
|
+
var n = /* @__PURE__ */ new Map(), i = Gr(e), r = /* @__PURE__ */ M(0), s = ct, l = (a) => {
|
|
1062
|
+
if (ct === s)
|
|
1063
|
+
return a();
|
|
1064
|
+
var o = y, c = ct;
|
|
1065
|
+
de(null), Pr(s);
|
|
1066
|
+
var d = a();
|
|
1067
|
+
return de(o), Pr(c), d;
|
|
1068
|
+
};
|
|
1069
|
+
return i && n.set("length", /* @__PURE__ */ M(
|
|
1070
|
+
/** @type {any[]} */
|
|
1071
|
+
e.length
|
|
1072
|
+
)), new Proxy(
|
|
1073
|
+
/** @type {any} */
|
|
1074
|
+
e,
|
|
1075
|
+
{
|
|
1076
|
+
defineProperty(a, o, c) {
|
|
1077
|
+
(!("value" in c) || c.configurable === !1 || c.enumerable === !1 || c.writable === !1) && Ds();
|
|
1078
|
+
var d = n.get(o);
|
|
1079
|
+
return d === void 0 ? d = l(() => {
|
|
1080
|
+
var h = /* @__PURE__ */ M(c.value);
|
|
1081
|
+
return n.set(o, h), h;
|
|
1082
|
+
}) : E(d, c.value, !0), !0;
|
|
1083
|
+
},
|
|
1084
|
+
deleteProperty(a, o) {
|
|
1085
|
+
var c = n.get(o);
|
|
1086
|
+
if (c === void 0) {
|
|
1087
|
+
if (o in a) {
|
|
1088
|
+
const d = l(() => /* @__PURE__ */ M(B));
|
|
1089
|
+
n.set(o, d), Kt(r);
|
|
1090
|
+
}
|
|
1091
|
+
} else
|
|
1092
|
+
E(c, B), Kt(r);
|
|
1093
|
+
return !0;
|
|
1094
|
+
},
|
|
1095
|
+
get(a, o, c) {
|
|
1096
|
+
if (o === un)
|
|
1097
|
+
return e;
|
|
1098
|
+
var d = n.get(o), h = o in a;
|
|
1099
|
+
if (d === void 0 && (!h || wt(a, o)?.writable) && (d = l(() => {
|
|
1100
|
+
var p = De(h ? a[o] : B), v = /* @__PURE__ */ M(p);
|
|
1101
|
+
return v;
|
|
1102
|
+
}), n.set(o, d)), d !== void 0) {
|
|
1103
|
+
var _ = u(d);
|
|
1104
|
+
return _ === B ? void 0 : _;
|
|
1105
|
+
}
|
|
1106
|
+
return Reflect.get(a, o, c);
|
|
1107
|
+
},
|
|
1108
|
+
getOwnPropertyDescriptor(a, o) {
|
|
1109
|
+
var c = Reflect.getOwnPropertyDescriptor(a, o);
|
|
1110
|
+
if (c && "value" in c) {
|
|
1111
|
+
var d = n.get(o);
|
|
1112
|
+
d && (c.value = u(d));
|
|
1113
|
+
} else if (c === void 0) {
|
|
1114
|
+
var h = n.get(o), _ = h?.v;
|
|
1115
|
+
if (h !== void 0 && _ !== B)
|
|
1116
|
+
return {
|
|
1117
|
+
enumerable: !0,
|
|
1118
|
+
configurable: !0,
|
|
1119
|
+
value: _,
|
|
1120
|
+
writable: !0
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
return c;
|
|
1124
|
+
},
|
|
1125
|
+
has(a, o) {
|
|
1126
|
+
if (o === un)
|
|
1127
|
+
return !0;
|
|
1128
|
+
var c = n.get(o), d = c !== void 0 && c.v !== B || Reflect.has(a, o);
|
|
1129
|
+
if (c !== void 0 || T !== null && (!d || wt(a, o)?.writable)) {
|
|
1130
|
+
c === void 0 && (c = l(() => {
|
|
1131
|
+
var _ = d ? De(a[o]) : B, p = /* @__PURE__ */ M(_);
|
|
1132
|
+
return p;
|
|
1133
|
+
}), n.set(o, c));
|
|
1134
|
+
var h = u(c);
|
|
1135
|
+
if (h === B)
|
|
1136
|
+
return !1;
|
|
1137
|
+
}
|
|
1138
|
+
return d;
|
|
1139
|
+
},
|
|
1140
|
+
set(a, o, c, d) {
|
|
1141
|
+
var h = n.get(o), _ = o in a;
|
|
1142
|
+
if (i && o === "length")
|
|
1143
|
+
for (var p = c; p < /** @type {Source<number>} */
|
|
1144
|
+
h.v; p += 1) {
|
|
1145
|
+
var v = n.get(p + "");
|
|
1146
|
+
v !== void 0 ? E(v, B) : p in a && (v = l(() => /* @__PURE__ */ M(B)), n.set(p + "", v));
|
|
1147
|
+
}
|
|
1148
|
+
if (h === void 0)
|
|
1149
|
+
(!_ || wt(a, o)?.writable) && (h = l(() => /* @__PURE__ */ M(void 0)), E(h, De(c)), n.set(o, h));
|
|
1150
|
+
else {
|
|
1151
|
+
_ = h.v !== B;
|
|
1152
|
+
var g = l(() => De(c));
|
|
1153
|
+
E(h, g);
|
|
1154
|
+
}
|
|
1155
|
+
var m = Reflect.getOwnPropertyDescriptor(a, o);
|
|
1156
|
+
if (m?.set && m.set.call(d, c), !_) {
|
|
1157
|
+
if (i && typeof o == "string") {
|
|
1158
|
+
var S = (
|
|
1159
|
+
/** @type {Source<number>} */
|
|
1160
|
+
n.get("length")
|
|
1161
|
+
), C = Number(o);
|
|
1162
|
+
Number.isInteger(C) && C >= S.v && E(S, C + 1);
|
|
1163
|
+
}
|
|
1164
|
+
Kt(r);
|
|
1165
|
+
}
|
|
1166
|
+
return !0;
|
|
1167
|
+
},
|
|
1168
|
+
ownKeys(a) {
|
|
1169
|
+
u(r);
|
|
1170
|
+
var o = Reflect.ownKeys(a).filter((h) => {
|
|
1171
|
+
var _ = n.get(h);
|
|
1172
|
+
return _ === void 0 || _.v !== B;
|
|
1173
|
+
});
|
|
1174
|
+
for (var [c, d] of n)
|
|
1175
|
+
d.v !== B && !(c in a) && o.push(c);
|
|
1176
|
+
return o;
|
|
1177
|
+
},
|
|
1178
|
+
setPrototypeOf() {
|
|
1179
|
+
Is();
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
var Rr, mi, bi, wi;
|
|
1185
|
+
function Zn() {
|
|
1186
|
+
if (Rr === void 0) {
|
|
1187
|
+
Rr = window, mi = /Firefox/.test(navigator.userAgent);
|
|
1188
|
+
var e = Element.prototype, t = Node.prototype, n = Text.prototype;
|
|
1189
|
+
bi = wt(t, "firstChild").get, wi = wt(t, "nextSibling").get, Cr(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Cr(n) && (n.__t = void 0);
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
function ge(e = "") {
|
|
1193
|
+
return document.createTextNode(e);
|
|
1194
|
+
}
|
|
1195
|
+
// @__NO_SIDE_EFFECTS__
|
|
1196
|
+
function Dt(e) {
|
|
1197
|
+
return (
|
|
1198
|
+
/** @type {TemplateNode | null} */
|
|
1199
|
+
bi.call(e)
|
|
1200
|
+
);
|
|
1201
|
+
}
|
|
1202
|
+
// @__NO_SIDE_EFFECTS__
|
|
1203
|
+
function Se(e) {
|
|
1204
|
+
return (
|
|
1205
|
+
/** @type {TemplateNode | null} */
|
|
1206
|
+
wi.call(e)
|
|
1207
|
+
);
|
|
1208
|
+
}
|
|
1209
|
+
function q(e, t) {
|
|
1210
|
+
if (!x)
|
|
1211
|
+
return /* @__PURE__ */ Dt(e);
|
|
1212
|
+
var n = /* @__PURE__ */ Dt(k);
|
|
1213
|
+
if (n === null)
|
|
1214
|
+
n = k.appendChild(ge());
|
|
1215
|
+
else if (t && n.nodeType !== Cn) {
|
|
1216
|
+
var i = ge();
|
|
1217
|
+
return n?.before(i), ne(i), i;
|
|
1218
|
+
}
|
|
1219
|
+
return t && fr(
|
|
1220
|
+
/** @type {Text} */
|
|
1221
|
+
n
|
|
1222
|
+
), ne(n), n;
|
|
1223
|
+
}
|
|
1224
|
+
function et(e, t = !1) {
|
|
1225
|
+
if (!x) {
|
|
1226
|
+
var n = /* @__PURE__ */ Dt(e);
|
|
1227
|
+
return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Se(n) : n;
|
|
1228
|
+
}
|
|
1229
|
+
if (t) {
|
|
1230
|
+
if (k?.nodeType !== Cn) {
|
|
1231
|
+
var i = ge();
|
|
1232
|
+
return k?.before(i), ne(i), i;
|
|
1233
|
+
}
|
|
1234
|
+
fr(
|
|
1235
|
+
/** @type {Text} */
|
|
1236
|
+
k
|
|
1237
|
+
);
|
|
1238
|
+
}
|
|
1239
|
+
return k;
|
|
1240
|
+
}
|
|
1241
|
+
function z(e, t = 1, n = !1) {
|
|
1242
|
+
let i = x ? k : e;
|
|
1243
|
+
for (var r; t--; )
|
|
1244
|
+
r = i, i = /** @type {TemplateNode} */
|
|
1245
|
+
/* @__PURE__ */ Se(i);
|
|
1246
|
+
if (!x)
|
|
1247
|
+
return i;
|
|
1248
|
+
if (n) {
|
|
1249
|
+
if (i?.nodeType !== Cn) {
|
|
1250
|
+
var s = ge();
|
|
1251
|
+
return i === null ? r?.after(s) : i.before(s), ne(s), s;
|
|
1252
|
+
}
|
|
1253
|
+
fr(
|
|
1254
|
+
/** @type {Text} */
|
|
1255
|
+
i
|
|
1256
|
+
);
|
|
1257
|
+
}
|
|
1258
|
+
return ne(i), i;
|
|
1259
|
+
}
|
|
1260
|
+
function $i(e) {
|
|
1261
|
+
e.textContent = "";
|
|
1262
|
+
}
|
|
1263
|
+
function yi() {
|
|
1264
|
+
return !1;
|
|
1265
|
+
}
|
|
1266
|
+
function fr(e) {
|
|
1267
|
+
if (
|
|
1268
|
+
/** @type {string} */
|
|
1269
|
+
e.nodeValue.length < 65536
|
|
1270
|
+
)
|
|
1271
|
+
return;
|
|
1272
|
+
let t = e.nextSibling;
|
|
1273
|
+
for (; t !== null && t.nodeType === Cn; )
|
|
1274
|
+
t.remove(), e.nodeValue += /** @type {string} */
|
|
1275
|
+
t.nodeValue, t = e.nextSibling;
|
|
1276
|
+
}
|
|
1277
|
+
let Nr = !1;
|
|
1278
|
+
function rl() {
|
|
1279
|
+
Nr || (Nr = !0, document.addEventListener(
|
|
1280
|
+
"reset",
|
|
1281
|
+
(e) => {
|
|
1282
|
+
Promise.resolve().then(() => {
|
|
1283
|
+
if (!e.defaultPrevented)
|
|
1284
|
+
for (
|
|
1285
|
+
const t of
|
|
1286
|
+
/**@type {HTMLFormElement} */
|
|
1287
|
+
e.target.elements
|
|
1288
|
+
)
|
|
1289
|
+
t.__on_r?.();
|
|
1290
|
+
});
|
|
1291
|
+
},
|
|
1292
|
+
// In the capture phase to guarantee we get noticed of it (no possibility of stopPropagation)
|
|
1293
|
+
{ capture: !0 }
|
|
1294
|
+
));
|
|
1295
|
+
}
|
|
1296
|
+
function Ei(e) {
|
|
1297
|
+
var t = y, n = T;
|
|
1298
|
+
de(null), ke(null);
|
|
1299
|
+
try {
|
|
1300
|
+
return e();
|
|
1301
|
+
} finally {
|
|
1302
|
+
de(t), ke(n);
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
function il(e) {
|
|
1306
|
+
T === null && (y === null && Ns(), Rs()), Xe && Ms();
|
|
1307
|
+
}
|
|
1308
|
+
function sl(e, t) {
|
|
1309
|
+
var n = t.last;
|
|
1310
|
+
n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
|
|
1311
|
+
}
|
|
1312
|
+
function Ae(e, t, n) {
|
|
1313
|
+
var i = T;
|
|
1314
|
+
i !== null && (i.f & te) !== 0 && (e |= te);
|
|
1315
|
+
var r = {
|
|
1316
|
+
ctx: re,
|
|
1317
|
+
deps: null,
|
|
1318
|
+
nodes: null,
|
|
1319
|
+
f: e | G | ue,
|
|
1320
|
+
first: null,
|
|
1321
|
+
fn: t,
|
|
1322
|
+
last: null,
|
|
1323
|
+
next: null,
|
|
1324
|
+
parent: i,
|
|
1325
|
+
b: i && i.b,
|
|
1326
|
+
prev: null,
|
|
1327
|
+
teardown: null,
|
|
1328
|
+
wv: 0,
|
|
1329
|
+
ac: null
|
|
1330
|
+
};
|
|
1331
|
+
if (n)
|
|
1332
|
+
try {
|
|
1333
|
+
Xt(r), r.f |= An;
|
|
1334
|
+
} catch (a) {
|
|
1335
|
+
throw V(r), a;
|
|
1336
|
+
}
|
|
1337
|
+
else t !== null && ze(r);
|
|
1338
|
+
var s = r;
|
|
1339
|
+
if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
|
|
1340
|
+
(s.f & vt) === 0 && (s = s.first, (e & je) !== 0 && (e & Rt) !== 0 && s !== null && (s.f |= Rt)), s !== null && (s.parent = i, i !== null && sl(s, i), y !== null && (y.f & Y) !== 0 && (e & Je) === 0)) {
|
|
1341
|
+
var l = (
|
|
1342
|
+
/** @type {Derived} */
|
|
1343
|
+
y
|
|
1344
|
+
);
|
|
1345
|
+
(l.effects ?? (l.effects = [])).push(s);
|
|
1346
|
+
}
|
|
1347
|
+
return r;
|
|
1348
|
+
}
|
|
1349
|
+
function ur() {
|
|
1350
|
+
return y !== null && !_e;
|
|
1351
|
+
}
|
|
1352
|
+
function ll(e) {
|
|
1353
|
+
const t = Ae(Sn, null, !1);
|
|
1354
|
+
return D(t, j), t.teardown = e, t;
|
|
1355
|
+
}
|
|
1356
|
+
function $t(e) {
|
|
1357
|
+
il();
|
|
1358
|
+
var t = (
|
|
1359
|
+
/** @type {Effect} */
|
|
1360
|
+
T.f
|
|
1361
|
+
), n = !y && (t & me) !== 0 && (t & An) === 0;
|
|
1362
|
+
if (n) {
|
|
1363
|
+
var i = (
|
|
1364
|
+
/** @type {ComponentContext} */
|
|
1365
|
+
re
|
|
1366
|
+
);
|
|
1367
|
+
(i.e ?? (i.e = [])).push(e);
|
|
1368
|
+
} else
|
|
1369
|
+
return xi(e);
|
|
1370
|
+
}
|
|
1371
|
+
function xi(e) {
|
|
1372
|
+
return Ae(wn | Ts, e, !1);
|
|
1373
|
+
}
|
|
1374
|
+
function al(e) {
|
|
1375
|
+
Fe.ensure();
|
|
1376
|
+
const t = Ae(Je | vt, e, !0);
|
|
1377
|
+
return () => {
|
|
1378
|
+
V(t);
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
function ol(e) {
|
|
1382
|
+
Fe.ensure();
|
|
1383
|
+
const t = Ae(Je | vt, e, !0);
|
|
1384
|
+
return (n = {}) => new Promise((i) => {
|
|
1385
|
+
n.outro ? ut(t, () => {
|
|
1386
|
+
V(t), i(void 0);
|
|
1387
|
+
}) : (V(t), i(void 0));
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
function ki(e) {
|
|
1391
|
+
return Ae(wn, e, !1);
|
|
1392
|
+
}
|
|
1393
|
+
function fl(e) {
|
|
1394
|
+
return Ae(lr | vt, e, !0);
|
|
1395
|
+
}
|
|
1396
|
+
function cr(e, t = 0) {
|
|
1397
|
+
return Ae(Sn | t, e, !0);
|
|
1398
|
+
}
|
|
1399
|
+
function tt(e, t = [], n = [], i = []) {
|
|
1400
|
+
Xs(i, t, n, (r) => {
|
|
1401
|
+
Ae(Sn, () => e(...r.map(u)), !0);
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
function dr(e, t = 0) {
|
|
1405
|
+
var n = Ae(je | t, e, !0);
|
|
1406
|
+
return n;
|
|
1407
|
+
}
|
|
1408
|
+
function oe(e) {
|
|
1409
|
+
return Ae(me | vt, e, !0);
|
|
1410
|
+
}
|
|
1411
|
+
function Ti(e) {
|
|
1412
|
+
var t = e.teardown;
|
|
1413
|
+
if (t !== null) {
|
|
1414
|
+
const n = Xe, i = y;
|
|
1415
|
+
Lr(!0), de(null);
|
|
1416
|
+
try {
|
|
1417
|
+
t.call(null);
|
|
1418
|
+
} finally {
|
|
1419
|
+
Lr(n), de(i);
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
function Si(e, t = !1) {
|
|
1424
|
+
var n = e.first;
|
|
1425
|
+
for (e.first = e.last = null; n !== null; ) {
|
|
1426
|
+
const r = n.ac;
|
|
1427
|
+
r !== null && Ei(() => {
|
|
1428
|
+
r.abort(bt);
|
|
1429
|
+
});
|
|
1430
|
+
var i = n.next;
|
|
1431
|
+
(n.f & Je) !== 0 ? n.parent = null : V(n, t), n = i;
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
function ul(e) {
|
|
1435
|
+
for (var t = e.first; t !== null; ) {
|
|
1436
|
+
var n = t.next;
|
|
1437
|
+
(t.f & me) === 0 && V(t), t = n;
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
function V(e, t = !0) {
|
|
1441
|
+
var n = !1;
|
|
1442
|
+
(t || (e.f & Jr) !== 0) && e.nodes !== null && e.nodes.end !== null && (cl(
|
|
1443
|
+
e.nodes.start,
|
|
1444
|
+
/** @type {TemplateNode} */
|
|
1445
|
+
e.nodes.end
|
|
1446
|
+
), n = !0), Si(e, t && !n), yn(e, 0), D(e, Ie);
|
|
1447
|
+
var i = e.nodes && e.nodes.t;
|
|
1448
|
+
if (i !== null)
|
|
1449
|
+
for (const s of i)
|
|
1450
|
+
s.stop();
|
|
1451
|
+
Ti(e);
|
|
1452
|
+
var r = e.parent;
|
|
1453
|
+
r !== null && r.first !== null && Ai(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
|
|
1454
|
+
}
|
|
1455
|
+
function cl(e, t) {
|
|
1456
|
+
for (; e !== null; ) {
|
|
1457
|
+
var n = e === t ? null : /* @__PURE__ */ Se(e);
|
|
1458
|
+
e.remove(), e = n;
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
function Ai(e) {
|
|
1462
|
+
var t = e.parent, n = e.prev, i = e.next;
|
|
1463
|
+
n !== null && (n.next = i), i !== null && (i.prev = n), t !== null && (t.first === e && (t.first = i), t.last === e && (t.last = n));
|
|
1464
|
+
}
|
|
1465
|
+
function ut(e, t, n = !0) {
|
|
1466
|
+
var i = [];
|
|
1467
|
+
Ci(e, i, !0);
|
|
1468
|
+
var r = () => {
|
|
1469
|
+
n && V(e), t && t();
|
|
1470
|
+
}, s = i.length;
|
|
1471
|
+
if (s > 0) {
|
|
1472
|
+
var l = () => --s || r();
|
|
1473
|
+
for (var a of i)
|
|
1474
|
+
a.out(l);
|
|
1475
|
+
} else
|
|
1476
|
+
r();
|
|
1477
|
+
}
|
|
1478
|
+
function Ci(e, t, n) {
|
|
1479
|
+
if ((e.f & te) === 0) {
|
|
1480
|
+
e.f ^= te;
|
|
1481
|
+
var i = e.nodes && e.nodes.t;
|
|
1482
|
+
if (i !== null)
|
|
1483
|
+
for (const a of i)
|
|
1484
|
+
(a.is_global || n) && t.push(a);
|
|
1485
|
+
for (var r = e.first; r !== null; ) {
|
|
1486
|
+
var s = r.next, l = (r.f & Rt) !== 0 || // If this is a branch effect without a block effect parent,
|
|
1487
|
+
// it means the parent block effect was pruned. In that case,
|
|
1488
|
+
// transparency information was transferred to the branch effect.
|
|
1489
|
+
(r.f & me) !== 0 && (e.f & je) !== 0;
|
|
1490
|
+
Ci(r, t, l ? n : !1), r = s;
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
function hr(e) {
|
|
1495
|
+
Oi(e, !0);
|
|
1496
|
+
}
|
|
1497
|
+
function Oi(e, t) {
|
|
1498
|
+
if ((e.f & te) !== 0) {
|
|
1499
|
+
e.f ^= te, (e.f & j) === 0 && (D(e, G), ze(e));
|
|
1500
|
+
for (var n = e.first; n !== null; ) {
|
|
1501
|
+
var i = n.next, r = (n.f & Rt) !== 0 || (n.f & me) !== 0;
|
|
1502
|
+
Oi(n, r ? t : !1), n = i;
|
|
1503
|
+
}
|
|
1504
|
+
var s = e.nodes && e.nodes.t;
|
|
1505
|
+
if (s !== null)
|
|
1506
|
+
for (const l of s)
|
|
1507
|
+
(l.is_global || t) && l.in();
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
function Mi(e, t) {
|
|
1511
|
+
if (e.nodes)
|
|
1512
|
+
for (var n = e.nodes.start, i = e.nodes.end; n !== null; ) {
|
|
1513
|
+
var r = n === i ? null : /* @__PURE__ */ Se(n);
|
|
1514
|
+
t.append(n), n = r;
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
let vn = !1, Xe = !1;
|
|
1518
|
+
function Lr(e) {
|
|
1519
|
+
Xe = e;
|
|
1520
|
+
}
|
|
1521
|
+
let y = null, _e = !1;
|
|
1522
|
+
function de(e) {
|
|
1523
|
+
y = e;
|
|
1524
|
+
}
|
|
1525
|
+
let T = null;
|
|
1526
|
+
function ke(e) {
|
|
1527
|
+
T = e;
|
|
1528
|
+
}
|
|
1529
|
+
let ce = null;
|
|
1530
|
+
function Ri(e) {
|
|
1531
|
+
y !== null && (ce === null ? ce = [e] : ce.push(e));
|
|
1532
|
+
}
|
|
1533
|
+
let K = null, J = 0, se = null;
|
|
1534
|
+
function dl(e) {
|
|
1535
|
+
se = e;
|
|
1536
|
+
}
|
|
1537
|
+
let Ni = 1, rt = 0, ct = rt;
|
|
1538
|
+
function Pr(e) {
|
|
1539
|
+
ct = e;
|
|
1540
|
+
}
|
|
1541
|
+
function Li() {
|
|
1542
|
+
return ++Ni;
|
|
1543
|
+
}
|
|
1544
|
+
function rn(e) {
|
|
1545
|
+
var t = e.f;
|
|
1546
|
+
if ((t & G) !== 0)
|
|
1547
|
+
return !0;
|
|
1548
|
+
if (t & Y && (e.f &= ~dt), (t & Be) !== 0) {
|
|
1549
|
+
for (var n = (
|
|
1550
|
+
/** @type {Value[]} */
|
|
1551
|
+
e.deps
|
|
1552
|
+
), i = n.length, r = 0; r < i; r++) {
|
|
1553
|
+
var s = n[r];
|
|
1554
|
+
if (rn(
|
|
1555
|
+
/** @type {Derived} */
|
|
1556
|
+
s
|
|
1557
|
+
) && vi(
|
|
1558
|
+
/** @type {Derived} */
|
|
1559
|
+
s
|
|
1560
|
+
), s.wv > e.wv)
|
|
1561
|
+
return !0;
|
|
1562
|
+
}
|
|
1563
|
+
(t & ue) !== 0 && // During time traveling we don't want to reset the status so that
|
|
1564
|
+
// traversal of the graph in the other batches still happens
|
|
1565
|
+
ve === null && D(e, j);
|
|
1566
|
+
}
|
|
1567
|
+
return !1;
|
|
1568
|
+
}
|
|
1569
|
+
function Pi(e, t, n = !0) {
|
|
1570
|
+
var i = e.reactions;
|
|
1571
|
+
if (i !== null && !(ce !== null && Mt.call(ce, e)))
|
|
1572
|
+
for (var r = 0; r < i.length; r++) {
|
|
1573
|
+
var s = i[r];
|
|
1574
|
+
(s.f & Y) !== 0 ? Pi(
|
|
1575
|
+
/** @type {Derived} */
|
|
1576
|
+
s,
|
|
1577
|
+
t,
|
|
1578
|
+
!1
|
|
1579
|
+
) : t === s && (n ? D(s, G) : (s.f & j) !== 0 && D(s, Be), ze(
|
|
1580
|
+
/** @type {Effect} */
|
|
1581
|
+
s
|
|
1582
|
+
));
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
function Di(e) {
|
|
1586
|
+
var g;
|
|
1587
|
+
var t = K, n = J, i = se, r = y, s = ce, l = re, a = _e, o = ct, c = e.f;
|
|
1588
|
+
K = /** @type {null | Value[]} */
|
|
1589
|
+
null, J = 0, se = null, y = (c & (me | Je)) === 0 ? e : null, ce = null, Nt(e.ctx), _e = !1, ct = ++rt, e.ac !== null && (Ei(() => {
|
|
1590
|
+
e.ac.abort(bt);
|
|
1591
|
+
}), e.ac = null);
|
|
1592
|
+
try {
|
|
1593
|
+
e.f |= qn;
|
|
1594
|
+
var d = (
|
|
1595
|
+
/** @type {Function} */
|
|
1596
|
+
e.fn
|
|
1597
|
+
), h = d(), _ = e.deps, p = R?.is_fork;
|
|
1598
|
+
if (K !== null) {
|
|
1599
|
+
var v;
|
|
1600
|
+
if (p || yn(e, J), _ !== null && J > 0)
|
|
1601
|
+
for (_.length = J + K.length, v = 0; v < K.length; v++)
|
|
1602
|
+
_[J + v] = K[v];
|
|
1603
|
+
else
|
|
1604
|
+
e.deps = _ = K;
|
|
1605
|
+
if (ur() && (e.f & ue) !== 0)
|
|
1606
|
+
for (v = J; v < _.length; v++)
|
|
1607
|
+
((g = _[v]).reactions ?? (g.reactions = [])).push(e);
|
|
1608
|
+
} else !p && _ !== null && J < _.length && (yn(e, J), _.length = J);
|
|
1609
|
+
if (ti() && se !== null && !_e && _ !== null && (e.f & (Y | Be | G)) === 0)
|
|
1610
|
+
for (v = 0; v < /** @type {Source[]} */
|
|
1611
|
+
se.length; v++)
|
|
1612
|
+
Pi(
|
|
1613
|
+
se[v],
|
|
1614
|
+
/** @type {Effect} */
|
|
1615
|
+
e
|
|
1616
|
+
);
|
|
1617
|
+
if (r !== null && r !== e) {
|
|
1618
|
+
if (rt++, r.deps !== null)
|
|
1619
|
+
for (let m = 0; m < n; m += 1)
|
|
1620
|
+
r.deps[m].rv = rt;
|
|
1621
|
+
if (t !== null)
|
|
1622
|
+
for (const m of t)
|
|
1623
|
+
m.rv = rt;
|
|
1624
|
+
se !== null && (i === null ? i = se : i.push(.../** @type {Source[]} */
|
|
1625
|
+
se));
|
|
1626
|
+
}
|
|
1627
|
+
return (e.f & Ve) !== 0 && (e.f ^= Ve), h;
|
|
1628
|
+
} catch (m) {
|
|
1629
|
+
return ri(m);
|
|
1630
|
+
} finally {
|
|
1631
|
+
e.f ^= qn, K = t, J = n, se = i, y = r, ce = s, Nt(l), _e = a, ct = o;
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
function hl(e, t) {
|
|
1635
|
+
let n = t.reactions;
|
|
1636
|
+
if (n !== null) {
|
|
1637
|
+
var i = $s.call(n, e);
|
|
1638
|
+
if (i !== -1) {
|
|
1639
|
+
var r = n.length - 1;
|
|
1640
|
+
r === 0 ? n = t.reactions = null : (n[i] = n[r], n.pop());
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
if (n === null && (t.f & Y) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1644
|
+
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1645
|
+
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1646
|
+
(K === null || !Mt.call(K, t))) {
|
|
1647
|
+
var s = (
|
|
1648
|
+
/** @type {Derived} */
|
|
1649
|
+
t
|
|
1650
|
+
);
|
|
1651
|
+
(s.f & ue) !== 0 && (s.f ^= ue, s.f &= ~dt), ar(s), hi(s), yn(s, 0);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
function yn(e, t) {
|
|
1655
|
+
var n = e.deps;
|
|
1656
|
+
if (n !== null)
|
|
1657
|
+
for (var i = t; i < n.length; i++)
|
|
1658
|
+
hl(e, n[i]);
|
|
1659
|
+
}
|
|
1660
|
+
function Xt(e) {
|
|
1661
|
+
var t = e.f;
|
|
1662
|
+
if ((t & Ie) === 0) {
|
|
1663
|
+
D(e, j);
|
|
1664
|
+
var n = T, i = vn;
|
|
1665
|
+
T = e, vn = !0;
|
|
1666
|
+
try {
|
|
1667
|
+
(t & (je | Xr)) !== 0 ? ul(e) : Si(e), Ti(e);
|
|
1668
|
+
var r = Di(e);
|
|
1669
|
+
e.teardown = typeof r == "function" ? r : null, e.wv = Ni;
|
|
1670
|
+
var s;
|
|
1671
|
+
Un && Ys && (e.f & G) !== 0 && e.deps;
|
|
1672
|
+
} finally {
|
|
1673
|
+
vn = i, T = n;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
function u(e) {
|
|
1678
|
+
var t = e.f, n = (t & Y) !== 0;
|
|
1679
|
+
if (y !== null && !_e) {
|
|
1680
|
+
var i = T !== null && (T.f & Ie) !== 0;
|
|
1681
|
+
if (!i && (ce === null || !Mt.call(ce, e))) {
|
|
1682
|
+
var r = y.deps;
|
|
1683
|
+
if ((y.f & qn) !== 0)
|
|
1684
|
+
e.rv < rt && (e.rv = rt, K === null && r !== null && r[J] === e ? J++ : K === null ? K = [e] : K.push(e));
|
|
1685
|
+
else {
|
|
1686
|
+
(y.deps ?? (y.deps = [])).push(e);
|
|
1687
|
+
var s = e.reactions;
|
|
1688
|
+
s === null ? e.reactions = [y] : Mt.call(s, y) || s.push(y);
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
if (Xe && We.has(e))
|
|
1693
|
+
return We.get(e);
|
|
1694
|
+
if (n) {
|
|
1695
|
+
var l = (
|
|
1696
|
+
/** @type {Derived} */
|
|
1697
|
+
e
|
|
1698
|
+
);
|
|
1699
|
+
if (Xe) {
|
|
1700
|
+
var a = l.v;
|
|
1701
|
+
return ((l.f & j) === 0 && l.reactions !== null || Fi(l)) && (a = or(l)), We.set(l, a), a;
|
|
1702
|
+
}
|
|
1703
|
+
var o = (l.f & ue) === 0 && !_e && y !== null && (vn || (y.f & ue) !== 0), c = l.deps === null;
|
|
1704
|
+
rn(l) && (o && (l.f |= ue), vi(l)), o && !c && Ii(l);
|
|
1705
|
+
}
|
|
1706
|
+
if (ve?.has(e))
|
|
1707
|
+
return ve.get(e);
|
|
1708
|
+
if ((e.f & Ve) !== 0)
|
|
1709
|
+
throw e.v;
|
|
1710
|
+
return e.v;
|
|
1711
|
+
}
|
|
1712
|
+
function Ii(e) {
|
|
1713
|
+
if (e.deps !== null) {
|
|
1714
|
+
e.f |= ue;
|
|
1715
|
+
for (const t of e.deps)
|
|
1716
|
+
(t.reactions ?? (t.reactions = [])).push(e), (t.f & Y) !== 0 && (t.f & ue) === 0 && Ii(
|
|
1717
|
+
/** @type {Derived} */
|
|
1718
|
+
t
|
|
1719
|
+
);
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
function Fi(e) {
|
|
1723
|
+
if (e.v === B) return !0;
|
|
1724
|
+
if (e.deps === null) return !1;
|
|
1725
|
+
for (const t of e.deps)
|
|
1726
|
+
if (We.has(t) || (t.f & Y) !== 0 && Fi(
|
|
1727
|
+
/** @type {Derived} */
|
|
1728
|
+
t
|
|
1729
|
+
))
|
|
1730
|
+
return !0;
|
|
1731
|
+
return !1;
|
|
1732
|
+
}
|
|
1733
|
+
function vr(e) {
|
|
1734
|
+
var t = _e;
|
|
1735
|
+
try {
|
|
1736
|
+
return _e = !0, e();
|
|
1737
|
+
} finally {
|
|
1738
|
+
_e = t;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
const zi = /* @__PURE__ */ new Set(), er = /* @__PURE__ */ new Set();
|
|
1742
|
+
function _r(e) {
|
|
1743
|
+
for (var t = 0; t < e.length; t++)
|
|
1744
|
+
zi.add(e[t]);
|
|
1745
|
+
for (var n of er)
|
|
1746
|
+
n(e);
|
|
1747
|
+
}
|
|
1748
|
+
let Dr = null;
|
|
1749
|
+
function on(e) {
|
|
1750
|
+
var t = this, n = (
|
|
1751
|
+
/** @type {Node} */
|
|
1752
|
+
t.ownerDocument
|
|
1753
|
+
), i = e.type, r = e.composedPath?.() || [], s = (
|
|
1754
|
+
/** @type {null | Element} */
|
|
1755
|
+
r[0] || e.target
|
|
1756
|
+
);
|
|
1757
|
+
Dr = e;
|
|
1758
|
+
var l = 0, a = Dr === e && e.__root;
|
|
1759
|
+
if (a) {
|
|
1760
|
+
var o = r.indexOf(a);
|
|
1761
|
+
if (o !== -1 && (t === document || t === /** @type {any} */
|
|
1762
|
+
window)) {
|
|
1763
|
+
e.__root = t;
|
|
1764
|
+
return;
|
|
1765
|
+
}
|
|
1766
|
+
var c = r.indexOf(t);
|
|
1767
|
+
if (c === -1)
|
|
1768
|
+
return;
|
|
1769
|
+
o <= c && (l = o);
|
|
1770
|
+
}
|
|
1771
|
+
if (s = /** @type {Element} */
|
|
1772
|
+
r[l] || e.target, s !== t) {
|
|
1773
|
+
bn(e, "currentTarget", {
|
|
1774
|
+
configurable: !0,
|
|
1775
|
+
get() {
|
|
1776
|
+
return s || n;
|
|
1777
|
+
}
|
|
1778
|
+
});
|
|
1779
|
+
var d = y, h = T;
|
|
1780
|
+
de(null), ke(null);
|
|
1781
|
+
try {
|
|
1782
|
+
for (var _, p = []; s !== null; ) {
|
|
1783
|
+
var v = s.assignedSlot || s.parentNode || /** @type {any} */
|
|
1784
|
+
s.host || null;
|
|
1785
|
+
try {
|
|
1786
|
+
var g = s["__" + i];
|
|
1787
|
+
g != null && (!/** @type {any} */
|
|
1788
|
+
s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1789
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
1790
|
+
e.target === s) && g.call(s, e);
|
|
1791
|
+
} catch (m) {
|
|
1792
|
+
_ ? p.push(m) : _ = m;
|
|
1793
|
+
}
|
|
1794
|
+
if (e.cancelBubble || v === t || v === null)
|
|
1795
|
+
break;
|
|
1796
|
+
s = v;
|
|
1797
|
+
}
|
|
1798
|
+
if (_) {
|
|
1799
|
+
for (let m of p)
|
|
1800
|
+
queueMicrotask(() => {
|
|
1801
|
+
throw m;
|
|
1802
|
+
});
|
|
1803
|
+
throw _;
|
|
1804
|
+
}
|
|
1805
|
+
} finally {
|
|
1806
|
+
e.__root = t, delete e.currentTarget, de(d), ke(h);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
function vl(e) {
|
|
1811
|
+
var t = document.createElement("template");
|
|
1812
|
+
return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
|
|
1813
|
+
}
|
|
1814
|
+
function yt(e, t) {
|
|
1815
|
+
var n = (
|
|
1816
|
+
/** @type {Effect} */
|
|
1817
|
+
T
|
|
1818
|
+
);
|
|
1819
|
+
n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
|
|
1820
|
+
}
|
|
1821
|
+
// @__NO_SIDE_EFFECTS__
|
|
1822
|
+
function _t(e, t) {
|
|
1823
|
+
var n = (t & ms) !== 0, i = (t & bs) !== 0, r, s = !e.startsWith("<!>");
|
|
1824
|
+
return () => {
|
|
1825
|
+
if (x)
|
|
1826
|
+
return yt(k, null), k;
|
|
1827
|
+
r === void 0 && (r = vl(s ? e : "<!>" + e), n || (r = /** @type {TemplateNode} */
|
|
1828
|
+
/* @__PURE__ */ Dt(r)));
|
|
1829
|
+
var l = (
|
|
1830
|
+
/** @type {TemplateNode} */
|
|
1831
|
+
i || mi ? document.importNode(r, !0) : r.cloneNode(!0)
|
|
1832
|
+
);
|
|
1833
|
+
if (n) {
|
|
1834
|
+
var a = (
|
|
1835
|
+
/** @type {TemplateNode} */
|
|
1836
|
+
/* @__PURE__ */ Dt(l)
|
|
1837
|
+
), o = (
|
|
1838
|
+
/** @type {TemplateNode} */
|
|
1839
|
+
l.lastChild
|
|
1840
|
+
);
|
|
1841
|
+
yt(a, o);
|
|
1842
|
+
} else
|
|
1843
|
+
yt(l, l);
|
|
1844
|
+
return l;
|
|
1845
|
+
};
|
|
1846
|
+
}
|
|
1847
|
+
function ji() {
|
|
1848
|
+
if (x)
|
|
1849
|
+
return yt(k, null), k;
|
|
1850
|
+
var e = document.createDocumentFragment(), t = document.createComment(""), n = ge();
|
|
1851
|
+
return e.append(t, n), yt(t, n), e;
|
|
1852
|
+
}
|
|
1853
|
+
function xe(e, t) {
|
|
1854
|
+
if (x) {
|
|
1855
|
+
var n = (
|
|
1856
|
+
/** @type {Effect & { nodes: EffectNodes }} */
|
|
1857
|
+
T
|
|
1858
|
+
);
|
|
1859
|
+
((n.f & An) === 0 || n.nodes.end === null) && (n.nodes.end = k), nn();
|
|
1860
|
+
return;
|
|
1861
|
+
}
|
|
1862
|
+
e !== null && e.before(
|
|
1863
|
+
/** @type {Node} */
|
|
1864
|
+
t
|
|
1865
|
+
);
|
|
1866
|
+
}
|
|
1867
|
+
const _l = ["touchstart", "touchmove"];
|
|
1868
|
+
function pl(e) {
|
|
1869
|
+
return _l.includes(e);
|
|
1870
|
+
}
|
|
1871
|
+
function _n(e, t) {
|
|
1872
|
+
var n = t == null ? "" : typeof t == "object" ? t + "" : t;
|
|
1873
|
+
n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + "");
|
|
1874
|
+
}
|
|
1875
|
+
function Bi(e, t) {
|
|
1876
|
+
return Yi(e, t);
|
|
1877
|
+
}
|
|
1878
|
+
function gl(e, t) {
|
|
1879
|
+
Zn(), t.intro = t.intro ?? !1;
|
|
1880
|
+
const n = t.target, i = x, r = k;
|
|
1881
|
+
try {
|
|
1882
|
+
for (var s = /* @__PURE__ */ Dt(n); s && (s.nodeType !== It || /** @type {Comment} */
|
|
1883
|
+
s.data !== Vr); )
|
|
1884
|
+
s = /* @__PURE__ */ Se(s);
|
|
1885
|
+
if (!s)
|
|
1886
|
+
throw Ot;
|
|
1887
|
+
Pe(!0), ne(
|
|
1888
|
+
/** @type {Comment} */
|
|
1889
|
+
s
|
|
1890
|
+
);
|
|
1891
|
+
const l = Yi(e, { ...t, anchor: s });
|
|
1892
|
+
return Pe(!1), /** @type {Exports} */
|
|
1893
|
+
l;
|
|
1894
|
+
} catch (l) {
|
|
1895
|
+
if (l instanceof Error && l.message.split(`
|
|
1896
|
+
`).some((a) => a.startsWith("https://svelte.dev/e/")))
|
|
1897
|
+
throw l;
|
|
1898
|
+
return l !== Ot && console.warn("Failed to hydrate: ", l), t.recover === !1 && Ps(), Zn(), $i(n), Pe(!1), Bi(e, t);
|
|
1899
|
+
} finally {
|
|
1900
|
+
Pe(i), ne(r);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
const mt = /* @__PURE__ */ new Map();
|
|
1904
|
+
function Yi(e, { target: t, anchor: n, props: i = {}, events: r, context: s, intro: l = !0 }) {
|
|
1905
|
+
Zn();
|
|
1906
|
+
var a = /* @__PURE__ */ new Set(), o = (h) => {
|
|
1907
|
+
for (var _ = 0; _ < h.length; _++) {
|
|
1908
|
+
var p = h[_];
|
|
1909
|
+
if (!a.has(p)) {
|
|
1910
|
+
a.add(p);
|
|
1911
|
+
var v = pl(p);
|
|
1912
|
+
t.addEventListener(p, on, { passive: v });
|
|
1913
|
+
var g = mt.get(p);
|
|
1914
|
+
g === void 0 ? (document.addEventListener(p, on, { passive: v }), mt.set(p, 1)) : mt.set(p, g + 1);
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
};
|
|
1918
|
+
o(Tn(zi)), er.add(o);
|
|
1919
|
+
var c = void 0, d = ol(() => {
|
|
1920
|
+
var h = n ?? t.appendChild(ge());
|
|
1921
|
+
return Ws(
|
|
1922
|
+
/** @type {TemplateNode} */
|
|
1923
|
+
h,
|
|
1924
|
+
{
|
|
1925
|
+
pending: () => {
|
|
1926
|
+
}
|
|
1927
|
+
},
|
|
1928
|
+
(_) => {
|
|
1929
|
+
if (s) {
|
|
1930
|
+
Mn({});
|
|
1931
|
+
var p = (
|
|
1932
|
+
/** @type {ComponentContext} */
|
|
1933
|
+
re
|
|
1934
|
+
);
|
|
1935
|
+
p.c = s;
|
|
1936
|
+
}
|
|
1937
|
+
if (r && (i.$$events = r), x && yt(
|
|
1938
|
+
/** @type {TemplateNode} */
|
|
1939
|
+
_,
|
|
1940
|
+
null
|
|
1941
|
+
), c = e(_, i) || {}, x && (T.nodes.end = k, k === null || k.nodeType !== It || /** @type {Comment} */
|
|
1942
|
+
k.data !== ir))
|
|
1943
|
+
throw On(), Ot;
|
|
1944
|
+
s && Rn();
|
|
1945
|
+
}
|
|
1946
|
+
), () => {
|
|
1947
|
+
for (var _ of a) {
|
|
1948
|
+
t.removeEventListener(_, on);
|
|
1949
|
+
var p = (
|
|
1950
|
+
/** @type {number} */
|
|
1951
|
+
mt.get(_)
|
|
1952
|
+
);
|
|
1953
|
+
--p === 0 ? (document.removeEventListener(_, on), mt.delete(_)) : mt.set(_, p);
|
|
1954
|
+
}
|
|
1955
|
+
er.delete(o), h !== n && h.parentNode?.removeChild(h);
|
|
1956
|
+
};
|
|
1957
|
+
});
|
|
1958
|
+
return tr.set(c, d), c;
|
|
1959
|
+
}
|
|
1960
|
+
let tr = /* @__PURE__ */ new WeakMap();
|
|
1961
|
+
function ml(e, t) {
|
|
1962
|
+
const n = tr.get(e);
|
|
1963
|
+
return n ? (tr.delete(e), n(t)) : Promise.resolve();
|
|
1964
|
+
}
|
|
1965
|
+
var he, Ee, Z, ft, en, tn, xn;
|
|
1966
|
+
class bl {
|
|
1967
|
+
/**
|
|
1968
|
+
* @param {TemplateNode} anchor
|
|
1969
|
+
* @param {boolean} transition
|
|
1970
|
+
*/
|
|
1971
|
+
constructor(t, n = !0) {
|
|
1972
|
+
/** @type {TemplateNode} */
|
|
1973
|
+
N(this, "anchor");
|
|
1974
|
+
/** @type {Map<Batch, Key>} */
|
|
1975
|
+
$(this, he, /* @__PURE__ */ new Map());
|
|
1976
|
+
/**
|
|
1977
|
+
* Map of keys to effects that are currently rendered in the DOM.
|
|
1978
|
+
* These effects are visible and actively part of the document tree.
|
|
1979
|
+
* Example:
|
|
1980
|
+
* ```
|
|
1981
|
+
* {#if condition}
|
|
1982
|
+
* foo
|
|
1983
|
+
* {:else}
|
|
1984
|
+
* bar
|
|
1985
|
+
* {/if}
|
|
1986
|
+
* ```
|
|
1987
|
+
* Can result in the entries `true->Effect` and `false->Effect`
|
|
1988
|
+
* @type {Map<Key, Effect>}
|
|
1989
|
+
*/
|
|
1990
|
+
$(this, Ee, /* @__PURE__ */ new Map());
|
|
1991
|
+
/**
|
|
1992
|
+
* Similar to #onscreen with respect to the keys, but contains branches that are not yet
|
|
1993
|
+
* in the DOM, because their insertion is deferred.
|
|
1994
|
+
* @type {Map<Key, Branch>}
|
|
1995
|
+
*/
|
|
1996
|
+
$(this, Z, /* @__PURE__ */ new Map());
|
|
1997
|
+
/**
|
|
1998
|
+
* Keys of effects that are currently outroing
|
|
1999
|
+
* @type {Set<Key>}
|
|
2000
|
+
*/
|
|
2001
|
+
$(this, ft, /* @__PURE__ */ new Set());
|
|
2002
|
+
/**
|
|
2003
|
+
* Whether to pause (i.e. outro) on change, or destroy immediately.
|
|
2004
|
+
* This is necessary for `<svelte:element>`
|
|
2005
|
+
*/
|
|
2006
|
+
$(this, en, !0);
|
|
2007
|
+
$(this, tn, () => {
|
|
2008
|
+
var t = (
|
|
2009
|
+
/** @type {Batch} */
|
|
2010
|
+
R
|
|
2011
|
+
);
|
|
2012
|
+
if (f(this, he).has(t)) {
|
|
2013
|
+
var n = (
|
|
2014
|
+
/** @type {Key} */
|
|
2015
|
+
f(this, he).get(t)
|
|
2016
|
+
), i = f(this, Ee).get(n);
|
|
2017
|
+
if (i)
|
|
2018
|
+
hr(i), f(this, ft).delete(n);
|
|
2019
|
+
else {
|
|
2020
|
+
var r = f(this, Z).get(n);
|
|
2021
|
+
r && (f(this, Ee).set(n, r.effect), f(this, Z).delete(n), r.fragment.lastChild.remove(), this.anchor.before(r.fragment), i = r.effect);
|
|
2022
|
+
}
|
|
2023
|
+
for (const [s, l] of f(this, he)) {
|
|
2024
|
+
if (f(this, he).delete(s), s === t)
|
|
2025
|
+
break;
|
|
2026
|
+
const a = f(this, Z).get(l);
|
|
2027
|
+
a && (V(a.effect), f(this, Z).delete(l));
|
|
2028
|
+
}
|
|
2029
|
+
for (const [s, l] of f(this, Ee)) {
|
|
2030
|
+
if (s === n || f(this, ft).has(s)) continue;
|
|
2031
|
+
const a = () => {
|
|
2032
|
+
if (Array.from(f(this, he).values()).includes(s)) {
|
|
2033
|
+
var c = document.createDocumentFragment();
|
|
2034
|
+
Mi(l, c), c.append(ge()), f(this, Z).set(s, { effect: l, fragment: c });
|
|
2035
|
+
} else
|
|
2036
|
+
V(l);
|
|
2037
|
+
f(this, ft).delete(s), f(this, Ee).delete(s);
|
|
2038
|
+
};
|
|
2039
|
+
f(this, en) || !i ? (f(this, ft).add(s), ut(l, a, !1)) : a();
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
});
|
|
2043
|
+
/**
|
|
2044
|
+
* @param {Batch} batch
|
|
2045
|
+
*/
|
|
2046
|
+
$(this, xn, (t) => {
|
|
2047
|
+
f(this, he).delete(t);
|
|
2048
|
+
const n = Array.from(f(this, he).values());
|
|
2049
|
+
for (const [i, r] of f(this, Z))
|
|
2050
|
+
n.includes(i) || (V(r.effect), f(this, Z).delete(i));
|
|
2051
|
+
});
|
|
2052
|
+
this.anchor = t, b(this, en, n);
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
*
|
|
2056
|
+
* @param {any} key
|
|
2057
|
+
* @param {null | ((target: TemplateNode) => void)} fn
|
|
2058
|
+
*/
|
|
2059
|
+
ensure(t, n) {
|
|
2060
|
+
var i = (
|
|
2061
|
+
/** @type {Batch} */
|
|
2062
|
+
R
|
|
2063
|
+
), r = yi();
|
|
2064
|
+
if (n && !f(this, Ee).has(t) && !f(this, Z).has(t))
|
|
2065
|
+
if (r) {
|
|
2066
|
+
var s = document.createDocumentFragment(), l = ge();
|
|
2067
|
+
s.append(l), f(this, Z).set(t, {
|
|
2068
|
+
effect: oe(() => n(l)),
|
|
2069
|
+
fragment: s
|
|
2070
|
+
});
|
|
2071
|
+
} else
|
|
2072
|
+
f(this, Ee).set(
|
|
2073
|
+
t,
|
|
2074
|
+
oe(() => n(this.anchor))
|
|
2075
|
+
);
|
|
2076
|
+
if (f(this, he).set(i, t), r) {
|
|
2077
|
+
for (const [a, o] of f(this, Ee))
|
|
2078
|
+
a === t ? i.skipped_effects.delete(o) : i.skipped_effects.add(o);
|
|
2079
|
+
for (const [a, o] of f(this, Z))
|
|
2080
|
+
a === t ? i.skipped_effects.delete(o.effect) : i.skipped_effects.add(o.effect);
|
|
2081
|
+
i.oncommit(f(this, tn)), i.ondiscard(f(this, xn));
|
|
2082
|
+
} else
|
|
2083
|
+
x && (this.anchor = k), f(this, tn).call(this);
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
he = new WeakMap(), Ee = new WeakMap(), Z = new WeakMap(), ft = new WeakMap(), en = new WeakMap(), tn = new WeakMap(), xn = new WeakMap();
|
|
2087
|
+
function Hi(e) {
|
|
2088
|
+
re === null && Cs(), $t(() => {
|
|
2089
|
+
const t = vr(e);
|
|
2090
|
+
if (typeof t == "function") return (
|
|
2091
|
+
/** @type {() => void} */
|
|
2092
|
+
t
|
|
2093
|
+
);
|
|
2094
|
+
});
|
|
2095
|
+
}
|
|
2096
|
+
function pn(e, t, n = !1) {
|
|
2097
|
+
x && nn();
|
|
2098
|
+
var i = new bl(e), r = n ? Rt : 0;
|
|
2099
|
+
function s(l, a) {
|
|
2100
|
+
if (x) {
|
|
2101
|
+
const c = Qr(e) === kn;
|
|
2102
|
+
if (l === c) {
|
|
2103
|
+
var o = $n();
|
|
2104
|
+
ne(o), i.anchor = o, Pe(!1), i.ensure(l, a), Pe(!0);
|
|
2105
|
+
return;
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
i.ensure(l, a);
|
|
2109
|
+
}
|
|
2110
|
+
dr(() => {
|
|
2111
|
+
var l = !1;
|
|
2112
|
+
t((a, o = !0) => {
|
|
2113
|
+
l = !0, s(o, a);
|
|
2114
|
+
}), l || s(!1, null);
|
|
2115
|
+
}, r);
|
|
2116
|
+
}
|
|
2117
|
+
function wl(e, t) {
|
|
2118
|
+
return t;
|
|
2119
|
+
}
|
|
2120
|
+
function $l(e, t, n) {
|
|
2121
|
+
for (var i = [], r = t.length, s, l = t.length, a = 0; a < r; a++) {
|
|
2122
|
+
let h = t[a];
|
|
2123
|
+
ut(
|
|
2124
|
+
h,
|
|
2125
|
+
() => {
|
|
2126
|
+
if (s) {
|
|
2127
|
+
if (s.pending.delete(h), s.done.add(h), s.pending.size === 0) {
|
|
2128
|
+
var _ = (
|
|
2129
|
+
/** @type {Set<EachOutroGroup>} */
|
|
2130
|
+
e.outrogroups
|
|
2131
|
+
);
|
|
2132
|
+
nr(Tn(s.done)), _.delete(s), _.size === 0 && (e.outrogroups = null);
|
|
2133
|
+
}
|
|
2134
|
+
} else
|
|
2135
|
+
l -= 1;
|
|
2136
|
+
},
|
|
2137
|
+
!1
|
|
2138
|
+
);
|
|
2139
|
+
}
|
|
2140
|
+
if (l === 0) {
|
|
2141
|
+
var o = i.length === 0 && n !== null;
|
|
2142
|
+
if (o) {
|
|
2143
|
+
var c = (
|
|
2144
|
+
/** @type {Element} */
|
|
2145
|
+
n
|
|
2146
|
+
), d = (
|
|
2147
|
+
/** @type {Element} */
|
|
2148
|
+
c.parentNode
|
|
2149
|
+
);
|
|
2150
|
+
$i(d), d.append(c), e.items.clear();
|
|
2151
|
+
}
|
|
2152
|
+
nr(t, !o);
|
|
2153
|
+
} else
|
|
2154
|
+
s = {
|
|
2155
|
+
pending: new Set(t),
|
|
2156
|
+
done: /* @__PURE__ */ new Set()
|
|
2157
|
+
}, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s);
|
|
2158
|
+
}
|
|
2159
|
+
function nr(e, t = !0) {
|
|
2160
|
+
for (var n = 0; n < e.length; n++)
|
|
2161
|
+
V(e[n], t);
|
|
2162
|
+
}
|
|
2163
|
+
var Ir;
|
|
2164
|
+
function yl(e, t, n, i, r, s = null) {
|
|
2165
|
+
var l = e, a = /* @__PURE__ */ new Map();
|
|
2166
|
+
x && nn();
|
|
2167
|
+
var o = null, c = /* @__PURE__ */ el(() => {
|
|
2168
|
+
var g = n();
|
|
2169
|
+
return Gr(g) ? g : g == null ? [] : Tn(g);
|
|
2170
|
+
}), d, h = !0;
|
|
2171
|
+
function _() {
|
|
2172
|
+
v.fallback = o, El(v, d, l, t, i), o !== null && (d.length === 0 ? (o.f & qe) === 0 ? hr(o) : (o.f ^= qe, Gt(o, null, l)) : ut(o, () => {
|
|
2173
|
+
o = null;
|
|
2174
|
+
}));
|
|
2175
|
+
}
|
|
2176
|
+
var p = dr(() => {
|
|
2177
|
+
d = /** @type {V[]} */
|
|
2178
|
+
u(c);
|
|
2179
|
+
var g = d.length;
|
|
2180
|
+
let m = !1;
|
|
2181
|
+
if (x) {
|
|
2182
|
+
var S = Qr(l) === kn;
|
|
2183
|
+
S !== (g === 0) && (l = $n(), ne(l), Pe(!1), m = !0);
|
|
2184
|
+
}
|
|
2185
|
+
for (var C = /* @__PURE__ */ new Set(), ie = (
|
|
2186
|
+
/** @type {Batch} */
|
|
2187
|
+
R
|
|
2188
|
+
), H = yi(), P = 0; P < g; P += 1) {
|
|
2189
|
+
x && k.nodeType === It && /** @type {Comment} */
|
|
2190
|
+
k.data === ir && (l = /** @type {Comment} */
|
|
2191
|
+
k, m = !0, Pe(!1));
|
|
2192
|
+
var be = d[P], A = i(be, P), I = h ? null : a.get(A);
|
|
2193
|
+
I ? (I.v && Pt(I.v, be), I.i && Pt(I.i, P), H && ie.skipped_effects.delete(I.e)) : (I = xl(
|
|
2194
|
+
a,
|
|
2195
|
+
h ? l : Ir ?? (Ir = ge()),
|
|
2196
|
+
be,
|
|
2197
|
+
A,
|
|
2198
|
+
P,
|
|
2199
|
+
r,
|
|
2200
|
+
t,
|
|
2201
|
+
n
|
|
2202
|
+
), h || (I.e.f |= qe), a.set(A, I)), C.add(A);
|
|
2203
|
+
}
|
|
2204
|
+
if (g === 0 && s && !o && (h ? o = oe(() => s(l)) : (o = oe(() => s(Ir ?? (Ir = ge()))), o.f |= qe)), x && g > 0 && ne($n()), !h)
|
|
2205
|
+
if (H) {
|
|
2206
|
+
for (const [sn, Pn] of a)
|
|
2207
|
+
C.has(sn) || ie.skipped_effects.add(Pn.e);
|
|
2208
|
+
ie.oncommit(_), ie.ondiscard(() => {
|
|
2209
|
+
});
|
|
2210
|
+
} else
|
|
2211
|
+
_();
|
|
2212
|
+
m && Pe(!0), u(c);
|
|
2213
|
+
}), v = { effect: p, items: a, outrogroups: null, fallback: o };
|
|
2214
|
+
h = !1, x && (l = k);
|
|
2215
|
+
}
|
|
2216
|
+
function Vt(e) {
|
|
2217
|
+
for (; e !== null && (e.f & me) === 0; )
|
|
2218
|
+
e = e.next;
|
|
2219
|
+
return e;
|
|
2220
|
+
}
|
|
2221
|
+
function El(e, t, n, i, r) {
|
|
2222
|
+
var s = t.length, l = e.items, a = Vt(e.effect.first), o, c = null, d = [], h = [], _, p, v, g;
|
|
2223
|
+
for (g = 0; g < s; g += 1) {
|
|
2224
|
+
if (_ = t[g], p = r(_, g), v = /** @type {EachItem} */
|
|
2225
|
+
l.get(p).e, e.outrogroups !== null)
|
|
2226
|
+
for (const I of e.outrogroups)
|
|
2227
|
+
I.pending.delete(v), I.done.delete(v);
|
|
2228
|
+
if ((v.f & qe) !== 0)
|
|
2229
|
+
if (v.f ^= qe, v === a)
|
|
2230
|
+
Gt(v, null, n);
|
|
2231
|
+
else {
|
|
2232
|
+
var m = c ? c.next : a;
|
|
2233
|
+
v === e.effect.last && (e.effect.last = v.prev), v.prev && (v.prev.next = v.next), v.next && (v.next.prev = v.prev), Ye(e, c, v), Ye(e, v, m), Gt(v, m, n), c = v, d = [], h = [], a = Vt(c.next);
|
|
2234
|
+
continue;
|
|
2235
|
+
}
|
|
2236
|
+
if ((v.f & te) !== 0 && hr(v), v !== a) {
|
|
2237
|
+
if (o !== void 0 && o.has(v)) {
|
|
2238
|
+
if (d.length < h.length) {
|
|
2239
|
+
var S = h[0], C;
|
|
2240
|
+
c = S.prev;
|
|
2241
|
+
var ie = d[0], H = d[d.length - 1];
|
|
2242
|
+
for (C = 0; C < d.length; C += 1)
|
|
2243
|
+
Gt(d[C], S, n);
|
|
2244
|
+
for (C = 0; C < h.length; C += 1)
|
|
2245
|
+
o.delete(h[C]);
|
|
2246
|
+
Ye(e, ie.prev, H.next), Ye(e, c, ie), Ye(e, H, S), a = S, c = H, g -= 1, d = [], h = [];
|
|
2247
|
+
} else
|
|
2248
|
+
o.delete(v), Gt(v, a, n), Ye(e, v.prev, v.next), Ye(e, v, c === null ? e.effect.first : c.next), Ye(e, c, v), c = v;
|
|
2249
|
+
continue;
|
|
2250
|
+
}
|
|
2251
|
+
for (d = [], h = []; a !== null && a !== v; )
|
|
2252
|
+
(o ?? (o = /* @__PURE__ */ new Set())).add(a), h.push(a), a = Vt(a.next);
|
|
2253
|
+
if (a === null)
|
|
2254
|
+
continue;
|
|
2255
|
+
}
|
|
2256
|
+
(v.f & qe) === 0 && d.push(v), c = v, a = Vt(v.next);
|
|
2257
|
+
}
|
|
2258
|
+
if (e.outrogroups !== null) {
|
|
2259
|
+
for (const I of e.outrogroups)
|
|
2260
|
+
I.pending.size === 0 && (nr(Tn(I.done)), e.outrogroups?.delete(I));
|
|
2261
|
+
e.outrogroups.size === 0 && (e.outrogroups = null);
|
|
2262
|
+
}
|
|
2263
|
+
if (a !== null || o !== void 0) {
|
|
2264
|
+
var P = [];
|
|
2265
|
+
if (o !== void 0)
|
|
2266
|
+
for (v of o)
|
|
2267
|
+
(v.f & te) === 0 && P.push(v);
|
|
2268
|
+
for (; a !== null; )
|
|
2269
|
+
(a.f & te) === 0 && a !== e.fallback && P.push(a), a = Vt(a.next);
|
|
2270
|
+
var be = P.length;
|
|
2271
|
+
if (be > 0) {
|
|
2272
|
+
var A = null;
|
|
2273
|
+
$l(e, P, A);
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
function xl(e, t, n, i, r, s, l, a) {
|
|
2278
|
+
var o = (l & _s) !== 0 ? (l & gs) === 0 ? /* @__PURE__ */ pi(n, !1, !1) : ht(n) : null, c = (l & ps) !== 0 ? ht(r) : null;
|
|
2279
|
+
return {
|
|
2280
|
+
v: o,
|
|
2281
|
+
i: c,
|
|
2282
|
+
e: oe(() => (s(t, o ?? n, c ?? r, a), () => {
|
|
2283
|
+
e.delete(i);
|
|
2284
|
+
}))
|
|
2285
|
+
};
|
|
2286
|
+
}
|
|
2287
|
+
function Gt(e, t, n) {
|
|
2288
|
+
if (e.nodes)
|
|
2289
|
+
for (var i = e.nodes.start, r = e.nodes.end, s = t && (t.f & qe) === 0 ? (
|
|
2290
|
+
/** @type {EffectNodes} */
|
|
2291
|
+
t.nodes.start
|
|
2292
|
+
) : n; i !== null; ) {
|
|
2293
|
+
var l = (
|
|
2294
|
+
/** @type {TemplateNode} */
|
|
2295
|
+
/* @__PURE__ */ Se(i)
|
|
2296
|
+
);
|
|
2297
|
+
if (s.before(i), i === r)
|
|
2298
|
+
return;
|
|
2299
|
+
i = l;
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
function Ye(e, t, n) {
|
|
2303
|
+
t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
|
|
2304
|
+
}
|
|
2305
|
+
function kl(e, t, n, i, r) {
|
|
2306
|
+
x && nn();
|
|
2307
|
+
var s = t.$$slots?.[n], l = !1;
|
|
2308
|
+
s === !0 && (s = t.children, l = !0), s === void 0 || s(e, l ? () => i : i);
|
|
2309
|
+
}
|
|
2310
|
+
function Tl(e, t) {
|
|
2311
|
+
ki(() => {
|
|
2312
|
+
var n = e.getRootNode(), i = (
|
|
2313
|
+
/** @type {ShadowRoot} */
|
|
2314
|
+
n.host ? (
|
|
2315
|
+
/** @type {ShadowRoot} */
|
|
2316
|
+
n
|
|
2317
|
+
) : (
|
|
2318
|
+
/** @type {Document} */
|
|
2319
|
+
n.head ?? /** @type {Document} */
|
|
2320
|
+
n.ownerDocument.head
|
|
2321
|
+
)
|
|
2322
|
+
);
|
|
2323
|
+
if (!i.querySelector("#" + t.hash)) {
|
|
2324
|
+
const r = document.createElement("style");
|
|
2325
|
+
r.id = t.hash, r.textContent = t.code, i.appendChild(r);
|
|
2326
|
+
}
|
|
2327
|
+
});
|
|
2328
|
+
}
|
|
2329
|
+
const Fr = [...`
|
|
2330
|
+
\r\f \v\uFEFF`];
|
|
2331
|
+
function Sl(e, t, n) {
|
|
2332
|
+
var i = "" + e;
|
|
2333
|
+
if (n) {
|
|
2334
|
+
for (var r in n)
|
|
2335
|
+
if (n[r])
|
|
2336
|
+
i = i ? i + " " + r : r;
|
|
2337
|
+
else if (i.length)
|
|
2338
|
+
for (var s = r.length, l = 0; (l = i.indexOf(r, l)) >= 0; ) {
|
|
2339
|
+
var a = l + s;
|
|
2340
|
+
(l === 0 || Fr.includes(i[l - 1])) && (a === i.length || Fr.includes(i[a])) ? i = (l === 0 ? "" : i.substring(0, l)) + i.substring(a + 1) : l = a;
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
return i === "" ? null : i;
|
|
2344
|
+
}
|
|
2345
|
+
function Al(e, t) {
|
|
2346
|
+
return e == null ? null : String(e);
|
|
2347
|
+
}
|
|
2348
|
+
function Cl(e, t, n, i, r, s) {
|
|
2349
|
+
var l = e.__className;
|
|
2350
|
+
if (x || l !== n || l === void 0) {
|
|
2351
|
+
var a = Sl(n, i, s);
|
|
2352
|
+
(!x || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : e.className = a), e.__className = n;
|
|
2353
|
+
} else if (s && r !== s)
|
|
2354
|
+
for (var o in s) {
|
|
2355
|
+
var c = !!s[o];
|
|
2356
|
+
(r == null || c !== !!r[o]) && e.classList.toggle(o, c);
|
|
2357
|
+
}
|
|
2358
|
+
return s;
|
|
2359
|
+
}
|
|
2360
|
+
function He(e, t, n, i) {
|
|
2361
|
+
var r = e.__style;
|
|
2362
|
+
if (x || r !== t) {
|
|
2363
|
+
var s = Al(t);
|
|
2364
|
+
(!x || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t;
|
|
2365
|
+
}
|
|
2366
|
+
return i;
|
|
2367
|
+
}
|
|
2368
|
+
const Ol = /* @__PURE__ */ Symbol("is custom element"), Ml = /* @__PURE__ */ Symbol("is html");
|
|
2369
|
+
function fn(e) {
|
|
2370
|
+
if (x) {
|
|
2371
|
+
var t = !1, n = () => {
|
|
2372
|
+
if (!t) {
|
|
2373
|
+
if (t = !0, e.hasAttribute("value")) {
|
|
2374
|
+
var i = e.value;
|
|
2375
|
+
Ke(e, "value", null), e.value = i;
|
|
2376
|
+
}
|
|
2377
|
+
if (e.hasAttribute("checked")) {
|
|
2378
|
+
var r = e.checked;
|
|
2379
|
+
Ke(e, "checked", null), e.checked = r;
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
};
|
|
2383
|
+
e.__on_r = n, Ge(n), rl();
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
function zr(e, t) {
|
|
2387
|
+
var n = pr(e);
|
|
2388
|
+
n.value === (n.value = // treat null and undefined the same for the initial value
|
|
2389
|
+
t ?? void 0) || // @ts-expect-error
|
|
2390
|
+
// `progress` elements always need their value set when it's `0`
|
|
2391
|
+
e.value === t && (t !== 0 || e.nodeName !== "PROGRESS") || (e.value = t ?? "");
|
|
2392
|
+
}
|
|
2393
|
+
function Hn(e, t) {
|
|
2394
|
+
var n = pr(e);
|
|
2395
|
+
n.checked !== (n.checked = // treat null and undefined the same for the initial value
|
|
2396
|
+
t ?? void 0) && (e.checked = t);
|
|
2397
|
+
}
|
|
2398
|
+
function Ke(e, t, n, i) {
|
|
2399
|
+
var r = pr(e);
|
|
2400
|
+
x && (r[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || r[t] !== (r[t] = n) && (t === "loading" && (e[As] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && Rl(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
|
|
2401
|
+
}
|
|
2402
|
+
function pr(e) {
|
|
2403
|
+
return (
|
|
2404
|
+
/** @type {Record<string | symbol, unknown>} **/
|
|
2405
|
+
// @ts-expect-error
|
|
2406
|
+
e.__attributes ?? (e.__attributes = {
|
|
2407
|
+
[Ol]: e.nodeName.includes("-"),
|
|
2408
|
+
[Ml]: e.namespaceURI === ws
|
|
2409
|
+
})
|
|
2410
|
+
);
|
|
2411
|
+
}
|
|
2412
|
+
var jr = /* @__PURE__ */ new Map();
|
|
2413
|
+
function Rl(e) {
|
|
2414
|
+
var t = e.getAttribute("is") || e.nodeName, n = jr.get(t);
|
|
2415
|
+
if (n) return n;
|
|
2416
|
+
jr.set(t, n = []);
|
|
2417
|
+
for (var i, r = e, s = Element.prototype; s !== r; ) {
|
|
2418
|
+
i = ys(r);
|
|
2419
|
+
for (var l in i)
|
|
2420
|
+
i[l].set && n.push(l);
|
|
2421
|
+
r = Wr(r);
|
|
2422
|
+
}
|
|
2423
|
+
return n;
|
|
2424
|
+
}
|
|
2425
|
+
function Br(e, t) {
|
|
2426
|
+
return e === t || e?.[un] === t;
|
|
2427
|
+
}
|
|
2428
|
+
function gr(e = {}, t, n, i) {
|
|
2429
|
+
return ki(() => {
|
|
2430
|
+
var r, s;
|
|
2431
|
+
return cr(() => {
|
|
2432
|
+
r = s, s = [], vr(() => {
|
|
2433
|
+
e !== n(...s) && (t(e, ...s), r && Br(n(...r), e) && t(null, ...r));
|
|
2434
|
+
});
|
|
2435
|
+
}), () => {
|
|
2436
|
+
Ge(() => {
|
|
2437
|
+
s && Br(n(...s), e) && t(null, ...s);
|
|
2438
|
+
});
|
|
2439
|
+
};
|
|
2440
|
+
}), e;
|
|
2441
|
+
}
|
|
2442
|
+
function pe(e, t, n, i) {
|
|
2443
|
+
var r = (
|
|
2444
|
+
/** @type {V} */
|
|
2445
|
+
i
|
|
2446
|
+
), s = !0, l = () => (s && (s = !1, r = /** @type {V} */
|
|
2447
|
+
i), r), a;
|
|
2448
|
+
a = /** @type {V} */
|
|
2449
|
+
e[t], a === void 0 && i !== void 0 && (a = l());
|
|
2450
|
+
var o;
|
|
2451
|
+
o = () => {
|
|
2452
|
+
var _ = (
|
|
2453
|
+
/** @type {V} */
|
|
2454
|
+
e[t]
|
|
2455
|
+
);
|
|
2456
|
+
return _ === void 0 ? l() : (s = !0, _);
|
|
2457
|
+
};
|
|
2458
|
+
var c = !1, d = /* @__PURE__ */ Ln(() => (c = !1, o())), h = (
|
|
2459
|
+
/** @type {Effect} */
|
|
2460
|
+
T
|
|
2461
|
+
);
|
|
2462
|
+
return (
|
|
2463
|
+
/** @type {() => V} */
|
|
2464
|
+
(function(_, p) {
|
|
2465
|
+
if (arguments.length > 0) {
|
|
2466
|
+
const v = p ? u(d) : _;
|
|
2467
|
+
return E(d, v), c = !0, r !== void 0 && (r = v), _;
|
|
2468
|
+
}
|
|
2469
|
+
return Xe && c || (h.f & Ie) !== 0 ? d.v : u(d);
|
|
2470
|
+
})
|
|
2471
|
+
);
|
|
2472
|
+
}
|
|
2473
|
+
function Nl(e) {
|
|
2474
|
+
return new Ll(e);
|
|
2475
|
+
}
|
|
2476
|
+
var Le, ae;
|
|
2477
|
+
class Ll {
|
|
2478
|
+
/**
|
|
2479
|
+
* @param {ComponentConstructorOptions & {
|
|
2480
|
+
* component: any;
|
|
2481
|
+
* }} options
|
|
2482
|
+
*/
|
|
2483
|
+
constructor(t) {
|
|
2484
|
+
/** @type {any} */
|
|
2485
|
+
$(this, Le);
|
|
2486
|
+
/** @type {Record<string, any>} */
|
|
2487
|
+
$(this, ae);
|
|
2488
|
+
var n = /* @__PURE__ */ new Map(), i = (s, l) => {
|
|
2489
|
+
var a = /* @__PURE__ */ pi(l, !1, !1);
|
|
2490
|
+
return n.set(s, a), a;
|
|
2491
|
+
};
|
|
2492
|
+
const r = new Proxy(
|
|
2493
|
+
{ ...t.props || {}, $$events: {} },
|
|
2494
|
+
{
|
|
2495
|
+
get(s, l) {
|
|
2496
|
+
return u(n.get(l) ?? i(l, Reflect.get(s, l)));
|
|
2497
|
+
},
|
|
2498
|
+
has(s, l) {
|
|
2499
|
+
return l === Ss ? !0 : (u(n.get(l) ?? i(l, Reflect.get(s, l))), Reflect.has(s, l));
|
|
2500
|
+
},
|
|
2501
|
+
set(s, l, a) {
|
|
2502
|
+
return E(n.get(l) ?? i(l, a), a), Reflect.set(s, l, a);
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
);
|
|
2506
|
+
b(this, ae, (t.hydrate ? gl : Bi)(t.component, {
|
|
2507
|
+
target: t.target,
|
|
2508
|
+
anchor: t.anchor,
|
|
2509
|
+
props: r,
|
|
2510
|
+
context: t.context,
|
|
2511
|
+
intro: t.intro ?? !1,
|
|
2512
|
+
recover: t.recover
|
|
2513
|
+
})), (!t?.props?.$$host || t.sync === !1) && fe(), b(this, Le, r.$$events);
|
|
2514
|
+
for (const s of Object.keys(f(this, ae)))
|
|
2515
|
+
s === "$set" || s === "$destroy" || s === "$on" || bn(this, s, {
|
|
2516
|
+
get() {
|
|
2517
|
+
return f(this, ae)[s];
|
|
2518
|
+
},
|
|
2519
|
+
/** @param {any} value */
|
|
2520
|
+
set(l) {
|
|
2521
|
+
f(this, ae)[s] = l;
|
|
2522
|
+
},
|
|
2523
|
+
enumerable: !0
|
|
2524
|
+
});
|
|
2525
|
+
f(this, ae).$set = /** @param {Record<string, any>} next */
|
|
2526
|
+
(s) => {
|
|
2527
|
+
Object.assign(r, s);
|
|
2528
|
+
}, f(this, ae).$destroy = () => {
|
|
2529
|
+
ml(f(this, ae));
|
|
2530
|
+
};
|
|
2531
|
+
}
|
|
2532
|
+
/** @param {Record<string, any>} props */
|
|
2533
|
+
$set(t) {
|
|
2534
|
+
f(this, ae).$set(t);
|
|
2535
|
+
}
|
|
2536
|
+
/**
|
|
2537
|
+
* @param {string} event
|
|
2538
|
+
* @param {(...args: any[]) => any} callback
|
|
2539
|
+
* @returns {any}
|
|
2540
|
+
*/
|
|
2541
|
+
$on(t, n) {
|
|
2542
|
+
f(this, Le)[t] = f(this, Le)[t] || [];
|
|
2543
|
+
const i = (...r) => n.call(this, ...r);
|
|
2544
|
+
return f(this, Le)[t].push(i), () => {
|
|
2545
|
+
f(this, Le)[t] = f(this, Le)[t].filter(
|
|
2546
|
+
/** @param {any} fn */
|
|
2547
|
+
(r) => r !== i
|
|
2548
|
+
);
|
|
2549
|
+
};
|
|
2550
|
+
}
|
|
2551
|
+
$destroy() {
|
|
2552
|
+
f(this, ae).$destroy();
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
Le = new WeakMap(), ae = new WeakMap();
|
|
2556
|
+
let Ui;
|
|
2557
|
+
typeof HTMLElement == "function" && (Ui = class extends HTMLElement {
|
|
2558
|
+
/**
|
|
2559
|
+
* @param {*} $$componentCtor
|
|
2560
|
+
* @param {*} $$slots
|
|
2561
|
+
* @param {ShadowRootInit | undefined} shadow_root_init
|
|
2562
|
+
*/
|
|
2563
|
+
constructor(t, n, i) {
|
|
2564
|
+
super();
|
|
2565
|
+
/** The Svelte component constructor */
|
|
2566
|
+
N(this, "$$ctor");
|
|
2567
|
+
/** Slots */
|
|
2568
|
+
N(this, "$$s");
|
|
2569
|
+
/** @type {any} The Svelte component instance */
|
|
2570
|
+
N(this, "$$c");
|
|
2571
|
+
/** Whether or not the custom element is connected */
|
|
2572
|
+
N(this, "$$cn", !1);
|
|
2573
|
+
/** @type {Record<string, any>} Component props data */
|
|
2574
|
+
N(this, "$$d", {});
|
|
2575
|
+
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
2576
|
+
N(this, "$$r", !1);
|
|
2577
|
+
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
2578
|
+
N(this, "$$p_d", {});
|
|
2579
|
+
/** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
|
|
2580
|
+
N(this, "$$l", {});
|
|
2581
|
+
/** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
|
|
2582
|
+
N(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
2583
|
+
/** @type {any} The managed render effect for reflecting attributes */
|
|
2584
|
+
N(this, "$$me");
|
|
2585
|
+
/** @type {ShadowRoot | null} The ShadowRoot of the custom element */
|
|
2586
|
+
N(this, "$$shadowRoot", null);
|
|
2587
|
+
this.$$ctor = t, this.$$s = n, i && (this.$$shadowRoot = this.attachShadow(i));
|
|
2588
|
+
}
|
|
2589
|
+
/**
|
|
2590
|
+
* @param {string} type
|
|
2591
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2592
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2593
|
+
*/
|
|
2594
|
+
addEventListener(t, n, i) {
|
|
2595
|
+
if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) {
|
|
2596
|
+
const r = this.$$c.$on(t, n);
|
|
2597
|
+
this.$$l_u.set(n, r);
|
|
2598
|
+
}
|
|
2599
|
+
super.addEventListener(t, n, i);
|
|
2600
|
+
}
|
|
2601
|
+
/**
|
|
2602
|
+
* @param {string} type
|
|
2603
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2604
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2605
|
+
*/
|
|
2606
|
+
removeEventListener(t, n, i) {
|
|
2607
|
+
if (super.removeEventListener(t, n, i), this.$$c) {
|
|
2608
|
+
const r = this.$$l_u.get(n);
|
|
2609
|
+
r && (r(), this.$$l_u.delete(n));
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
async connectedCallback() {
|
|
2613
|
+
if (this.$$cn = !0, !this.$$c) {
|
|
2614
|
+
let t = function(r) {
|
|
2615
|
+
return (s) => {
|
|
2616
|
+
const l = document.createElement("slot");
|
|
2617
|
+
r !== "default" && (l.name = r), xe(s, l);
|
|
2618
|
+
};
|
|
2619
|
+
};
|
|
2620
|
+
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
2621
|
+
return;
|
|
2622
|
+
const n = {}, i = Pl(this);
|
|
2623
|
+
for (const r of this.$$s)
|
|
2624
|
+
r in i && (r === "default" && !this.$$d.children ? (this.$$d.children = t(r), n.default = !0) : n[r] = t(r));
|
|
2625
|
+
for (const r of this.attributes) {
|
|
2626
|
+
const s = this.$$g_p(r.name);
|
|
2627
|
+
s in this.$$d || (this.$$d[s] = gn(s, r.value, this.$$p_d, "toProp"));
|
|
2628
|
+
}
|
|
2629
|
+
for (const r in this.$$p_d)
|
|
2630
|
+
!(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
|
|
2631
|
+
this.$$c = Nl({
|
|
2632
|
+
component: this.$$ctor,
|
|
2633
|
+
target: this.$$shadowRoot || this,
|
|
2634
|
+
props: {
|
|
2635
|
+
...this.$$d,
|
|
2636
|
+
$$slots: n,
|
|
2637
|
+
$$host: this
|
|
2638
|
+
}
|
|
2639
|
+
}), this.$$me = al(() => {
|
|
2640
|
+
cr(() => {
|
|
2641
|
+
this.$$r = !0;
|
|
2642
|
+
for (const r of mn(this.$$c)) {
|
|
2643
|
+
if (!this.$$p_d[r]?.reflect) continue;
|
|
2644
|
+
this.$$d[r] = this.$$c[r];
|
|
2645
|
+
const s = gn(
|
|
2646
|
+
r,
|
|
2647
|
+
this.$$d[r],
|
|
2648
|
+
this.$$p_d,
|
|
2649
|
+
"toAttribute"
|
|
2650
|
+
);
|
|
2651
|
+
s == null ? this.removeAttribute(this.$$p_d[r].attribute || r) : this.setAttribute(this.$$p_d[r].attribute || r, s);
|
|
2652
|
+
}
|
|
2653
|
+
this.$$r = !1;
|
|
2654
|
+
});
|
|
2655
|
+
});
|
|
2656
|
+
for (const r in this.$$l)
|
|
2657
|
+
for (const s of this.$$l[r]) {
|
|
2658
|
+
const l = this.$$c.$on(r, s);
|
|
2659
|
+
this.$$l_u.set(s, l);
|
|
2660
|
+
}
|
|
2661
|
+
this.$$l = {};
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
2665
|
+
// and setting attributes through setAttribute etc, this is helpful
|
|
2666
|
+
/**
|
|
2667
|
+
* @param {string} attr
|
|
2668
|
+
* @param {string} _oldValue
|
|
2669
|
+
* @param {string} newValue
|
|
2670
|
+
*/
|
|
2671
|
+
attributeChangedCallback(t, n, i) {
|
|
2672
|
+
this.$$r || (t = this.$$g_p(t), this.$$d[t] = gn(t, i, this.$$p_d, "toProp"), this.$$c?.$set({ [t]: this.$$d[t] }));
|
|
2673
|
+
}
|
|
2674
|
+
disconnectedCallback() {
|
|
2675
|
+
this.$$cn = !1, Promise.resolve().then(() => {
|
|
2676
|
+
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
|
|
2677
|
+
});
|
|
2678
|
+
}
|
|
2679
|
+
/**
|
|
2680
|
+
* @param {string} attribute_name
|
|
2681
|
+
*/
|
|
2682
|
+
$$g_p(t) {
|
|
2683
|
+
return mn(this.$$p_d).find(
|
|
2684
|
+
(n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t
|
|
2685
|
+
) || t;
|
|
2686
|
+
}
|
|
2687
|
+
});
|
|
2688
|
+
function gn(e, t, n, i) {
|
|
2689
|
+
const r = n[e]?.type;
|
|
2690
|
+
if (t = r === "Boolean" && typeof t != "boolean" ? t != null : t, !i || !n[e])
|
|
2691
|
+
return t;
|
|
2692
|
+
if (i === "toAttribute")
|
|
2693
|
+
switch (r) {
|
|
2694
|
+
case "Object":
|
|
2695
|
+
case "Array":
|
|
2696
|
+
return t == null ? null : JSON.stringify(t);
|
|
2697
|
+
case "Boolean":
|
|
2698
|
+
return t ? "" : null;
|
|
2699
|
+
case "Number":
|
|
2700
|
+
return t ?? null;
|
|
2701
|
+
default:
|
|
2702
|
+
return t;
|
|
2703
|
+
}
|
|
2704
|
+
else
|
|
2705
|
+
switch (r) {
|
|
2706
|
+
case "Object":
|
|
2707
|
+
case "Array":
|
|
2708
|
+
return t && JSON.parse(t);
|
|
2709
|
+
case "Boolean":
|
|
2710
|
+
return t;
|
|
2711
|
+
// conversion already handled above
|
|
2712
|
+
case "Number":
|
|
2713
|
+
return t != null ? +t : t;
|
|
2714
|
+
default:
|
|
2715
|
+
return t;
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
function Pl(e) {
|
|
2719
|
+
const t = {};
|
|
2720
|
+
return e.childNodes.forEach((n) => {
|
|
2721
|
+
t[
|
|
2722
|
+
/** @type {Element} node */
|
|
2723
|
+
n.slot || "default"
|
|
2724
|
+
] = !0;
|
|
2725
|
+
}), t;
|
|
2726
|
+
}
|
|
2727
|
+
function mr(e, t, n, i, r, s) {
|
|
2728
|
+
let l = class extends Ui {
|
|
2729
|
+
constructor() {
|
|
2730
|
+
super(e, n, r), this.$$p_d = t;
|
|
2731
|
+
}
|
|
2732
|
+
static get observedAttributes() {
|
|
2733
|
+
return mn(t).map(
|
|
2734
|
+
(a) => (t[a].attribute || a).toLowerCase()
|
|
2735
|
+
);
|
|
2736
|
+
}
|
|
2737
|
+
};
|
|
2738
|
+
return mn(t).forEach((a) => {
|
|
2739
|
+
bn(l.prototype, a, {
|
|
2740
|
+
get() {
|
|
2741
|
+
return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a];
|
|
2742
|
+
},
|
|
2743
|
+
set(o) {
|
|
2744
|
+
o = gn(a, o, t), this.$$d[a] = o;
|
|
2745
|
+
var c = this.$$c;
|
|
2746
|
+
if (c) {
|
|
2747
|
+
var d = wt(c, a)?.get;
|
|
2748
|
+
d ? c[a] = o : c.$set({ [a]: o });
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
});
|
|
2752
|
+
}), i.forEach((a) => {
|
|
2753
|
+
bn(l.prototype, a, {
|
|
2754
|
+
get() {
|
|
2755
|
+
return this.$$c?.[a];
|
|
2756
|
+
}
|
|
2757
|
+
});
|
|
2758
|
+
}), e.element = /** @type {any} */
|
|
2759
|
+
l, l;
|
|
2760
|
+
}
|
|
2761
|
+
var Yr;
|
|
2762
|
+
(function(e) {
|
|
2763
|
+
e.TTS_WORD = "tts-word", e.TTS_SENTENCE = "tts-sentence", e.ANNOTATION = "annotation";
|
|
2764
|
+
})(Yr || (Yr = {}));
|
|
2765
|
+
var Hr;
|
|
2766
|
+
(function(e) {
|
|
2767
|
+
e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange";
|
|
2768
|
+
})(Hr || (Hr = {}));
|
|
2769
|
+
const Dl = {
|
|
2770
|
+
// Standard QTI 3.0 PNP supports
|
|
2771
|
+
textToSpeech: "pie-tool-text-to-speech",
|
|
2772
|
+
calculator: "pie-tool-calculator",
|
|
2773
|
+
ruler: "pie-tool-ruler",
|
|
2774
|
+
protractor: "pie-tool-protractor",
|
|
2775
|
+
highlighter: "pie-tool-annotation-toolbar",
|
|
2776
|
+
lineReader: "pie-tool-line-reader",
|
|
2777
|
+
magnifier: "pie-tool-magnifier",
|
|
2778
|
+
colorContrast: "pie-theme-contrast",
|
|
2779
|
+
answerMasking: "pie-tool-answer-eliminator",
|
|
2780
|
+
dictionaryLookup: "pie-tool-dictionary",
|
|
2781
|
+
// Common extensions (not in QTI standard but widely used)
|
|
2782
|
+
graphingCalculator: "pie-tool-calculator",
|
|
2783
|
+
scientificCalculator: "pie-tool-calculator",
|
|
2784
|
+
basicCalculator: "pie-tool-calculator"
|
|
2785
|
+
};
|
|
2786
|
+
Object.fromEntries(Object.entries(Dl).map(([e, t]) => [t, e]));
|
|
2787
|
+
var rr;
|
|
2788
|
+
(function(e) {
|
|
2789
|
+
e[e.BASE = 0] = "BASE", e[e.TOOL = 1e3] = "TOOL", e[e.MODAL = 2e3] = "MODAL", e[e.CONTROL = 3e3] = "CONTROL", e[e.HIGHLIGHT = 4e3] = "HIGHLIGHT";
|
|
2790
|
+
})(rr || (rr = {}));
|
|
2791
|
+
var Ur;
|
|
2792
|
+
(function(e) {
|
|
2793
|
+
e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
|
|
2794
|
+
})(Ur || (Ur = {}));
|
|
2795
|
+
var Il = /* @__PURE__ */ _t('<button type="button" class="btn btn-ghost btn-sm btn-circle"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></button>');
|
|
2796
|
+
function qi(e, t) {
|
|
2797
|
+
Mn(t, !0);
|
|
2798
|
+
let n = pe(t, "buttonEl", 7, null), i = pe(t, "onClick"), r = pe(t, "ariaLabel", 7, "Settings"), s = pe(t, "active", 7, !1);
|
|
2799
|
+
var l = {
|
|
2800
|
+
get buttonEl() {
|
|
2801
|
+
return n();
|
|
2802
|
+
},
|
|
2803
|
+
set buttonEl(o = null) {
|
|
2804
|
+
n(o), fe();
|
|
2805
|
+
},
|
|
2806
|
+
get onClick() {
|
|
2807
|
+
return i();
|
|
2808
|
+
},
|
|
2809
|
+
set onClick(o) {
|
|
2810
|
+
i(o), fe();
|
|
2811
|
+
},
|
|
2812
|
+
get ariaLabel() {
|
|
2813
|
+
return r();
|
|
2814
|
+
},
|
|
2815
|
+
set ariaLabel(o = "Settings") {
|
|
2816
|
+
r(o), fe();
|
|
2817
|
+
},
|
|
2818
|
+
get active() {
|
|
2819
|
+
return s();
|
|
2820
|
+
},
|
|
2821
|
+
set active(o = !1) {
|
|
2822
|
+
s(o), fe();
|
|
2823
|
+
}
|
|
2824
|
+
}, a = Il();
|
|
2825
|
+
return a.__click = function(...o) {
|
|
2826
|
+
i()?.apply(this, o);
|
|
2827
|
+
}, gr(a, (o) => n(o), () => n()), tt(() => {
|
|
2828
|
+
Ke(a, "aria-label", r()), Ke(a, "aria-pressed", s());
|
|
2829
|
+
}), xe(e, a), Rn(l);
|
|
2830
|
+
}
|
|
2831
|
+
_r(["click"]);
|
|
2832
|
+
mr(qi, { buttonEl: {}, onClick: {}, ariaLabel: {}, active: {} }, [], [], { mode: "open" });
|
|
2833
|
+
var Fl = /* @__PURE__ */ _t('<div class="fixed inset-0" aria-hidden="true" style="z-index: 4000;"></div> <div class="tool-settings-panel fixed w-80 rounded-box bg-base-100 shadow p-3 text-base-content" role="dialog" tabindex="-1"><div class="flex items-center justify-between gap-2 mb-2"><h2 class="font-semibold text-sm"> </h2> <button type="button" class="btn btn-ghost btn-xs" aria-label="Close settings">Close</button></div> <div class="text-sm"><!></div></div>', 1);
|
|
2834
|
+
function Vi(e, t) {
|
|
2835
|
+
Mn(t, !0);
|
|
2836
|
+
let n = pe(t, "open"), i = pe(t, "title", 7, "Settings"), r = pe(t, "onClose"), s = pe(t, "anchorEl", 7, null), l = /* @__PURE__ */ M(null), a = /* @__PURE__ */ M(null);
|
|
2837
|
+
function o(p) {
|
|
2838
|
+
p.key === "Escape" && r()();
|
|
2839
|
+
}
|
|
2840
|
+
$t(() => {
|
|
2841
|
+
n() && queueMicrotask(() => u(l)?.focus?.());
|
|
2842
|
+
}), $t(() => {
|
|
2843
|
+
if (n() && s()) {
|
|
2844
|
+
const p = s().getBoundingClientRect(), v = 320, g = 8, m = p.right + g;
|
|
2845
|
+
m + v <= window.innerWidth ? E(a, { top: p.top, left: m }, !0) : E(
|
|
2846
|
+
a,
|
|
2847
|
+
{
|
|
2848
|
+
top: p.top,
|
|
2849
|
+
right: window.innerWidth - p.left + g
|
|
2850
|
+
},
|
|
2851
|
+
!0
|
|
2852
|
+
);
|
|
2853
|
+
} else
|
|
2854
|
+
E(a, null);
|
|
2855
|
+
}), Hi(() => {
|
|
2856
|
+
const p = (v) => {
|
|
2857
|
+
if (!n()) return;
|
|
2858
|
+
const g = v.target;
|
|
2859
|
+
g && (u(l)?.contains(g) || s()?.contains(g) || r()());
|
|
2860
|
+
};
|
|
2861
|
+
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
2862
|
+
});
|
|
2863
|
+
var c = {
|
|
2864
|
+
get open() {
|
|
2865
|
+
return n();
|
|
2866
|
+
},
|
|
2867
|
+
set open(p) {
|
|
2868
|
+
n(p), fe();
|
|
2869
|
+
},
|
|
2870
|
+
get title() {
|
|
2871
|
+
return i();
|
|
2872
|
+
},
|
|
2873
|
+
set title(p = "Settings") {
|
|
2874
|
+
i(p), fe();
|
|
2875
|
+
},
|
|
2876
|
+
get onClose() {
|
|
2877
|
+
return r();
|
|
2878
|
+
},
|
|
2879
|
+
set onClose(p) {
|
|
2880
|
+
r(p), fe();
|
|
2881
|
+
},
|
|
2882
|
+
get anchorEl() {
|
|
2883
|
+
return s();
|
|
2884
|
+
},
|
|
2885
|
+
set anchorEl(p = null) {
|
|
2886
|
+
s(p), fe();
|
|
2887
|
+
}
|
|
2888
|
+
}, d = ji(), h = et(d);
|
|
2889
|
+
{
|
|
2890
|
+
var _ = (p) => {
|
|
2891
|
+
var v = Fl(), g = et(v);
|
|
2892
|
+
g.__mousedown = function(...A) {
|
|
2893
|
+
r()?.apply(this, A);
|
|
2894
|
+
};
|
|
2895
|
+
var m = z(g, 2);
|
|
2896
|
+
m.__keydown = o;
|
|
2897
|
+
var S = q(m), C = q(S), ie = q(C, !0);
|
|
2898
|
+
U(C);
|
|
2899
|
+
var H = z(C, 2);
|
|
2900
|
+
H.__click = function(...A) {
|
|
2901
|
+
r()?.apply(this, A);
|
|
2902
|
+
}, U(S);
|
|
2903
|
+
var P = z(S, 2), be = q(P);
|
|
2904
|
+
kl(be, t, "default", {}), U(P), U(m), gr(m, (A) => E(l, A), () => u(l)), tt(() => {
|
|
2905
|
+
Ke(m, "aria-label", i()), He(m, `z-index: 4100; ${u(a) ? `top: ${u(a).top}px; ${u(a).left !== void 0 ? `left: ${u(a).left}px;` : `right: ${u(a).right}px;`}` : "top: 4rem; right: 1rem;"}`), _n(ie, i());
|
|
2906
|
+
}), xe(p, v);
|
|
2907
|
+
};
|
|
2908
|
+
pn(h, (p) => {
|
|
2909
|
+
n() && p(_);
|
|
2910
|
+
});
|
|
2911
|
+
}
|
|
2912
|
+
return xe(e, d), Rn(c);
|
|
2913
|
+
}
|
|
2914
|
+
_r(["mousedown", "keydown", "click"]);
|
|
2915
|
+
mr(Vi, { open: {}, title: {}, onClose: {}, anchorEl: {} }, ["default"], [], { mode: "open" });
|
|
2916
|
+
var zl = /* @__PURE__ */ _t('<div class="line-reader-mask line-reader-mask-top svelte-1a3d6dx" aria-hidden="true"></div> <div class="line-reader-mask line-reader-mask-bottom svelte-1a3d6dx" aria-hidden="true"></div> <div class="line-reader-mask line-reader-mask-left svelte-1a3d6dx" aria-hidden="true"></div> <div class="line-reader-mask line-reader-mask-right svelte-1a3d6dx" aria-hidden="true"></div>', 1), jl = /* @__PURE__ */ _t('<label><input type="radio" name="color"/> <div class="color-swatch"></div> <span> </span></label>'), Bl = /* @__PURE__ */ _t('<fieldset class="setting-group"><legend>Color</legend> <!></fieldset> <div class="setting-group"><div class="setting-label"><span>Opacity</span> <span class="setting-value" aria-live="polite"> </span></div> <input type="range" min="10" max="90" step="5" aria-label="Opacity" aria-valuemin="10" aria-valuemax="90"/></div>', 1), Yl = /* @__PURE__ */ _t('<fieldset class="setting-group"><legend>Mode</legend> <label><input type="radio" name="mode" value="highlight"/> <span>Highlight</span></label> <label><input type="radio" name="mode" value="obscure"/> <span>Masking</span></label></fieldset> <!>', 1), Hl = /* @__PURE__ */ _t('<div class="sr-only svelte-1a3d6dx" role="status" aria-live="polite" aria-atomic="true"> </div> <!> <div role="application" tabindex="0" aria-roledescription="Draggable and resizable reading guide overlay"><div class="line-reader-container svelte-1a3d6dx"><!></div> <div class="resize-handle resize-handle-bottom svelte-1a3d6dx" title="Drag to resize height" role="button" tabindex="-1" aria-label="Resize handle - drag to adjust height"><svg width="20" height="8" viewBox="0 0 20 8" aria-hidden="true"><rect x="8" y="3" width="4" height="2" fill="#4CAF50" rx="1"></rect></svg></div></div> <!>', 1);
|
|
2917
|
+
const Ul = {
|
|
2918
|
+
hash: "svelte-1a3d6dx",
|
|
2919
|
+
code: `.sr-only.svelte-1a3d6dx {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;}.line-reader-frame.svelte-1a3d6dx {border:2px solid rgba(76, 175, 80, 0.8);cursor:move;overflow:visible;position:absolute;transform:translate(-50%, -50%);user-select:none;pointer-events:auto;touch-action:none;}.line-reader-frame.svelte-1a3d6dx:focus {outline:3px solid #4A90E2;outline-offset:2px;}.line-reader-frame.svelte-1a3d6dx:focus-visible {outline:3px solid #4A90E2;outline-offset:2px;}.line-reader-container.svelte-1a3d6dx {width:100%;height:100%;position:relative;transition:background-color 0.2s ease;}.resize-handle.svelte-1a3d6dx {position:absolute;cursor:ns-resize;z-index:10;display:flex;align-items:center;justify-content:center;}.resize-handle-bottom.svelte-1a3d6dx {bottom:-10px;left:50%;transform:translateX(-50%);width:40px;height:16px;background-color:rgba(255, 255, 255, 0.9);border-radius:8px;border:2px solid #4CAF50;}.resize-handle.svelte-1a3d6dx:hover {background-color:rgba(76, 175, 80, 0.2);}.resize-handle.svelte-1a3d6dx:active {cursor:ns-resize;}.line-reader-frame.svelte-1a3d6dx:active {cursor:grabbing;}
|
|
2920
|
+
|
|
2921
|
+
/* Masking overlays for obscure mode - 4 rectangles covering all areas except line reader window */.line-reader-mask.svelte-1a3d6dx {position:fixed;background:rgba(0, 0, 0, 0.85);z-index:999;pointer-events:none;}.line-reader-mask-top.svelte-1a3d6dx {top:0;left:0;right:0;
|
|
2922
|
+
/* Height set via inline style */}.line-reader-mask-bottom.svelte-1a3d6dx {
|
|
2923
|
+
/* Top set via inline style */left:0;right:0;bottom:0;}.line-reader-mask-left.svelte-1a3d6dx {
|
|
2924
|
+
/* Top, height, and width set via inline style */left:0;}.line-reader-mask-right.svelte-1a3d6dx {
|
|
2925
|
+
/* Top, height, and left set via inline style */right:0;}
|
|
2926
|
+
|
|
2927
|
+
/* In masking mode, change the window appearance */.line-reader-frame.masking-mode.svelte-1a3d6dx {border-color:rgba(76, 175, 80, 1);box-shadow:0 0 0 3px rgba(76, 175, 80, 0.8), 0 0 20px rgba(76, 175, 80, 0.4);}
|
|
2928
|
+
|
|
2929
|
+
/* In masking mode, the window should be transparent to show content underneath */.line-reader-frame.masking-mode.svelte-1a3d6dx .line-reader-container:where(.svelte-1a3d6dx) {background-color:transparent !important;}`
|
|
2930
|
+
};
|
|
2931
|
+
function ql(e, t) {
|
|
2932
|
+
Mn(t, !0), Tl(e, Ul);
|
|
2933
|
+
let n = pe(t, "visible", 7, !1), i = pe(t, "toolId", 7, "lineReader"), r = pe(t, "coordinator");
|
|
2934
|
+
const s = typeof window < "u";
|
|
2935
|
+
let l = /* @__PURE__ */ M(void 0), a = /* @__PURE__ */ M(void 0), o = /* @__PURE__ */ M(!1), c = /* @__PURE__ */ M(!1), d = /* @__PURE__ */ M(De({
|
|
2936
|
+
x: s ? window.innerWidth / 2 : 400,
|
|
2937
|
+
y: s ? window.innerHeight / 2 : 300
|
|
2938
|
+
})), h = /* @__PURE__ */ M(De({ width: 600, height: 60 })), _ = /* @__PURE__ */ M(De({ x: 0, y: 0 })), p = /* @__PURE__ */ M(De({ width: 0, height: 0, mouseY: 0 })), v = /* @__PURE__ */ M(""), g = /* @__PURE__ */ M(
|
|
2939
|
+
"#ffff00"
|
|
2940
|
+
// Yellow
|
|
2941
|
+
), m = /* @__PURE__ */ M(0.3), S = /* @__PURE__ */ M("highlight"), C = /* @__PURE__ */ M(!1), ie = /* @__PURE__ */ M(!1);
|
|
2942
|
+
const H = [
|
|
2943
|
+
{ name: "Yellow", value: "#ffff00" },
|
|
2944
|
+
{ name: "Blue", value: "#00bfff" },
|
|
2945
|
+
{ name: "Pink", value: "#ff69b4" },
|
|
2946
|
+
{ name: "Green", value: "#00ff7f" },
|
|
2947
|
+
{ name: "Orange", value: "#ffa500" }
|
|
2948
|
+
], P = 10, be = 10;
|
|
2949
|
+
function A(w) {
|
|
2950
|
+
E(v, w, !0), setTimeout(() => E(v, ""), 1e3);
|
|
2951
|
+
}
|
|
2952
|
+
function I() {
|
|
2953
|
+
const O = (H.findIndex((Qe) => Qe.value === u(g)) + 1) % H.length;
|
|
2954
|
+
E(g, H[O].value, !0), A(`Color changed to ${H[O].name}`);
|
|
2955
|
+
}
|
|
2956
|
+
function sn(w) {
|
|
2957
|
+
E(m, Math.max(0.1, Math.min(0.9, u(m) + w)), !0), A(`Opacity ${Math.round(u(m) * 100)}%`);
|
|
2958
|
+
}
|
|
2959
|
+
function Pn() {
|
|
2960
|
+
E(S, u(S) === "highlight" ? "obscure" : "highlight", !0), A(`Mode changed to ${u(S) === "highlight" ? "highlight" : "masking"}`);
|
|
2961
|
+
}
|
|
2962
|
+
function Gi() {
|
|
2963
|
+
E(C, !u(C));
|
|
2964
|
+
}
|
|
2965
|
+
function Wi() {
|
|
2966
|
+
E(C, !1);
|
|
2967
|
+
}
|
|
2968
|
+
function Ki(w) {
|
|
2969
|
+
E(g, w, !0);
|
|
2970
|
+
const O = H.find((Qe) => Qe.value === w)?.name || "Unknown";
|
|
2971
|
+
A(`Color changed to ${O}`);
|
|
2972
|
+
}
|
|
2973
|
+
function Xi(w) {
|
|
2974
|
+
const O = w.target;
|
|
2975
|
+
if (O.closest(".resize-handle"))
|
|
2976
|
+
Qi(w);
|
|
2977
|
+
else {
|
|
2978
|
+
if (O.closest(".tool-settings-button") || O.closest(".tool-settings-panel"))
|
|
2979
|
+
return;
|
|
2980
|
+
Ji(w);
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
function Ji(w) {
|
|
2984
|
+
u(l) && (u(l).setPointerCapture(w.pointerId), E(o, !0), E(
|
|
2985
|
+
_,
|
|
2986
|
+
{
|
|
2987
|
+
x: w.clientX - u(d).x,
|
|
2988
|
+
y: w.clientY - u(d).y
|
|
2989
|
+
},
|
|
2990
|
+
!0
|
|
2991
|
+
), r()?.bringToFront(u(l)), u(l).addEventListener("pointermove", Dn), u(l).addEventListener("pointerup", In), w.preventDefault());
|
|
2992
|
+
}
|
|
2993
|
+
function Qi(w) {
|
|
2994
|
+
u(l) && (u(l).setPointerCapture(w.pointerId), E(c, !0), E(
|
|
2995
|
+
p,
|
|
2996
|
+
{
|
|
2997
|
+
width: u(h).width,
|
|
2998
|
+
height: u(h).height,
|
|
2999
|
+
mouseY: w.clientY
|
|
3000
|
+
},
|
|
3001
|
+
!0
|
|
3002
|
+
), r()?.bringToFront(u(l)), u(l).addEventListener("pointermove", Dn), u(l).addEventListener("pointerup", In), w.preventDefault(), w.stopPropagation());
|
|
3003
|
+
}
|
|
3004
|
+
function Dn(w) {
|
|
3005
|
+
if (u(o))
|
|
3006
|
+
E(
|
|
3007
|
+
d,
|
|
3008
|
+
{
|
|
3009
|
+
x: w.clientX - u(_).x,
|
|
3010
|
+
y: w.clientY - u(_).y
|
|
3011
|
+
},
|
|
3012
|
+
!0
|
|
3013
|
+
);
|
|
3014
|
+
else if (u(c)) {
|
|
3015
|
+
const O = w.clientY - u(p).mouseY;
|
|
3016
|
+
u(h).height = Math.max(20, Math.min(400, u(p).height + O));
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
function In(w) {
|
|
3020
|
+
u(l) && (u(l).releasePointerCapture(w.pointerId), u(l).removeEventListener("pointermove", Dn), u(l).removeEventListener("pointerup", In), E(o, !1), E(c, !1));
|
|
3021
|
+
}
|
|
3022
|
+
function Zi(w) {
|
|
3023
|
+
let O = !1;
|
|
3024
|
+
switch (w.key) {
|
|
3025
|
+
case "ArrowUp":
|
|
3026
|
+
u(d).y -= P, A(`Moved up to ${Math.round(u(d).y)}`), O = !0;
|
|
3027
|
+
break;
|
|
3028
|
+
case "ArrowDown":
|
|
3029
|
+
u(d).y += P, A(`Moved down to ${Math.round(u(d).y)}`), O = !0;
|
|
3030
|
+
break;
|
|
3031
|
+
case "ArrowLeft":
|
|
3032
|
+
u(d).x -= P, A(`Moved left to ${Math.round(u(d).x)}`), O = !0;
|
|
3033
|
+
break;
|
|
3034
|
+
case "ArrowRight":
|
|
3035
|
+
u(d).x += P, A(`Moved right to ${Math.round(u(d).x)}`), O = !0;
|
|
3036
|
+
break;
|
|
3037
|
+
case "+":
|
|
3038
|
+
case "=":
|
|
3039
|
+
u(h).height = Math.min(400, u(h).height + be), A(`Height ${u(h).height} pixels`), O = !0;
|
|
3040
|
+
break;
|
|
3041
|
+
case "-":
|
|
3042
|
+
case "_":
|
|
3043
|
+
u(h).height = Math.max(20, u(h).height - be), A(`Height ${u(h).height} pixels`), O = !0;
|
|
3044
|
+
break;
|
|
3045
|
+
case "c":
|
|
3046
|
+
case "C":
|
|
3047
|
+
I(), O = !0;
|
|
3048
|
+
break;
|
|
3049
|
+
case "]":
|
|
3050
|
+
sn(0.1), O = !0;
|
|
3051
|
+
break;
|
|
3052
|
+
case "[":
|
|
3053
|
+
sn(-0.1), O = !0;
|
|
3054
|
+
break;
|
|
3055
|
+
case "m":
|
|
3056
|
+
case "M":
|
|
3057
|
+
Pn(), O = !0;
|
|
3058
|
+
break;
|
|
3059
|
+
}
|
|
3060
|
+
O && w.preventDefault();
|
|
3061
|
+
}
|
|
3062
|
+
$t(() => {
|
|
3063
|
+
r() && i() && !u(ie) && (r().registerTool(i(), "Line Reader", void 0, rr.TOOL), E(ie, !0));
|
|
3064
|
+
}), Hi(() => () => {
|
|
3065
|
+
r() && i() && r().unregisterTool(i());
|
|
3066
|
+
}), $t(() => {
|
|
3067
|
+
r() && u(l) && i() && r().updateToolElement(i(), u(l));
|
|
3068
|
+
}), $t(() => {
|
|
3069
|
+
n() && u(l) && setTimeout(() => u(l)?.focus(), 100);
|
|
3070
|
+
});
|
|
3071
|
+
let es = /* @__PURE__ */ Zs(() => u(g) + Math.round(u(m) * 255).toString(16).padStart(2, "0"));
|
|
3072
|
+
var ts = {
|
|
3073
|
+
get visible() {
|
|
3074
|
+
return n();
|
|
3075
|
+
},
|
|
3076
|
+
set visible(w = !1) {
|
|
3077
|
+
n(w), fe();
|
|
3078
|
+
},
|
|
3079
|
+
get toolId() {
|
|
3080
|
+
return i();
|
|
3081
|
+
},
|
|
3082
|
+
set toolId(w = "lineReader") {
|
|
3083
|
+
i(w), fe();
|
|
3084
|
+
},
|
|
3085
|
+
get coordinator() {
|
|
3086
|
+
return r();
|
|
3087
|
+
},
|
|
3088
|
+
set coordinator(w) {
|
|
3089
|
+
r(w), fe();
|
|
3090
|
+
}
|
|
3091
|
+
}, wr = ji(), ns = et(wr);
|
|
3092
|
+
{
|
|
3093
|
+
var rs = (w) => {
|
|
3094
|
+
var O = Hl(), Qe = et(O), is = q(Qe, !0);
|
|
3095
|
+
U(Qe);
|
|
3096
|
+
var $r = z(Qe, 2);
|
|
3097
|
+
{
|
|
3098
|
+
var ss = (X) => {
|
|
3099
|
+
var Ft = zl(), zt = et(Ft), pt = z(zt, 2), gt = z(pt, 2), jt = z(gt, 2);
|
|
3100
|
+
tt(
|
|
3101
|
+
(ln, Bt) => {
|
|
3102
|
+
He(zt, `height: ${ln ?? ""}px;`), He(pt, `top: ${u(d).y + u(h).height / 2}px;`), He(gt, `top: ${u(d).y - u(h).height / 2}px; height: ${u(h).height ?? ""}px; width: ${Bt ?? ""}px;`), He(jt, `top: ${u(d).y - u(h).height / 2}px; height: ${u(h).height ?? ""}px; left: ${u(d).x + u(h).width / 2}px;`);
|
|
3103
|
+
},
|
|
3104
|
+
[
|
|
3105
|
+
() => Math.max(0, u(d).y - u(h).height / 2),
|
|
3106
|
+
() => Math.max(0, u(d).x - u(h).width / 2)
|
|
3107
|
+
]
|
|
3108
|
+
), xe(X, Ft);
|
|
3109
|
+
};
|
|
3110
|
+
pn($r, (X) => {
|
|
3111
|
+
u(S) === "obscure" && X(ss);
|
|
3112
|
+
});
|
|
3113
|
+
}
|
|
3114
|
+
var Ce = z($r, 2);
|
|
3115
|
+
let yr;
|
|
3116
|
+
Ce.__pointerdown = Xi, Ce.__keydown = Zi;
|
|
3117
|
+
var Fn = q(Ce), ls = q(Fn);
|
|
3118
|
+
qi(ls, {
|
|
3119
|
+
onClick: Gi,
|
|
3120
|
+
ariaLabel: "Line reader settings",
|
|
3121
|
+
get active() {
|
|
3122
|
+
return u(C);
|
|
3123
|
+
},
|
|
3124
|
+
get buttonEl() {
|
|
3125
|
+
return u(a);
|
|
3126
|
+
},
|
|
3127
|
+
set buttonEl(X) {
|
|
3128
|
+
E(a, X, !0);
|
|
3129
|
+
}
|
|
3130
|
+
}), U(Fn), cn(2), U(Ce), gr(Ce, (X) => E(l, X), () => u(l));
|
|
3131
|
+
var as = z(Ce, 2);
|
|
3132
|
+
Vi(as, {
|
|
3133
|
+
get open() {
|
|
3134
|
+
return u(C);
|
|
3135
|
+
},
|
|
3136
|
+
title: "Line Reader Settings",
|
|
3137
|
+
onClose: Wi,
|
|
3138
|
+
get anchorEl() {
|
|
3139
|
+
return u(a);
|
|
3140
|
+
},
|
|
3141
|
+
children: (X, Ft) => {
|
|
3142
|
+
var zt = Yl(), pt = et(zt), gt = z(q(pt), 2), jt = q(gt);
|
|
3143
|
+
fn(jt), jt.__change = () => {
|
|
3144
|
+
E(S, "highlight"), A("Mode changed to highlight");
|
|
3145
|
+
}, cn(2), U(gt);
|
|
3146
|
+
var ln = z(gt, 2), Bt = q(ln);
|
|
3147
|
+
fn(Bt), Bt.__change = () => {
|
|
3148
|
+
E(S, "obscure"), A("Mode changed to masking");
|
|
3149
|
+
}, cn(2), U(ln), U(pt);
|
|
3150
|
+
var os = z(pt, 2);
|
|
3151
|
+
{
|
|
3152
|
+
var fs = (zn) => {
|
|
3153
|
+
var Er = Bl(), jn = et(Er), us = z(q(jn), 2);
|
|
3154
|
+
yl(us, 17, () => H, wl, (Ht, Ze) => {
|
|
3155
|
+
var Ut = jl(), qt = q(Ut);
|
|
3156
|
+
fn(qt), qt.__change = () => Ki(u(Ze).value);
|
|
3157
|
+
var Tr = z(qt, 2), Sr = z(Tr, 2), ds = q(Sr, !0);
|
|
3158
|
+
U(Sr), U(Ut), tt(() => {
|
|
3159
|
+
zr(qt, u(Ze).value), Hn(qt, u(g) === u(Ze).value), He(Tr, `background-color: ${u(Ze).value ?? ""};`), _n(ds, u(Ze).name);
|
|
3160
|
+
}), xe(Ht, Ut);
|
|
3161
|
+
}), U(jn);
|
|
3162
|
+
var xr = z(jn, 2), Bn = q(xr), kr = z(q(Bn), 2), cs = q(kr);
|
|
3163
|
+
U(kr), U(Bn);
|
|
3164
|
+
var Yt = z(Bn, 2);
|
|
3165
|
+
fn(Yt), Yt.__input = (Ht) => {
|
|
3166
|
+
E(m, Number(Ht.currentTarget.value) / 100), A(`Opacity ${Math.round(u(m) * 100)}%`);
|
|
3167
|
+
}, U(xr), tt(
|
|
3168
|
+
(Ht, Ze, Ut) => {
|
|
3169
|
+
_n(cs, `${Ht ?? ""}%`), zr(Yt, u(m) * 100), Ke(Yt, "aria-valuenow", Ze), Ke(Yt, "aria-valuetext", `${Ut ?? ""} percent`);
|
|
3170
|
+
},
|
|
3171
|
+
[
|
|
3172
|
+
() => Math.round(u(m) * 100),
|
|
3173
|
+
() => Math.round(u(m) * 100),
|
|
3174
|
+
() => Math.round(u(m) * 100)
|
|
3175
|
+
]
|
|
3176
|
+
), xe(zn, Er);
|
|
3177
|
+
};
|
|
3178
|
+
pn(os, (zn) => {
|
|
3179
|
+
u(S) === "highlight" && zn(fs);
|
|
3180
|
+
});
|
|
3181
|
+
}
|
|
3182
|
+
tt(() => {
|
|
3183
|
+
Hn(jt, u(S) === "highlight"), Hn(Bt, u(S) === "obscure");
|
|
3184
|
+
}), xe(X, zt);
|
|
3185
|
+
},
|
|
3186
|
+
$$slots: { default: !0 }
|
|
3187
|
+
}), tt(
|
|
3188
|
+
(X, Ft) => {
|
|
3189
|
+
_n(is, u(v)), yr = Cl(Ce, 1, "line-reader-frame svelte-1a3d6dx", null, yr, { "masking-mode": u(S) === "obscure" }), He(Ce, `left: ${u(d).x ?? ""}px; top: ${u(d).y ?? ""}px; width: ${u(h).width ?? ""}px; height: ${u(h).height ?? ""}px;`), Ke(Ce, "aria-label", `Line Reader tool. Mode: ${u(S) === "highlight" ? "Highlight" : "Masking"}. Use arrow keys to move, +/- to resize height, C to change color, [ and ] to adjust opacity, M to toggle mode. Current color: ${X ?? ""}, Opacity: ${Ft ?? ""}%`), He(Fn, `background-color: ${u(es) ?? ""};`);
|
|
3190
|
+
},
|
|
3191
|
+
[
|
|
3192
|
+
() => H.find((X) => X.value === u(g))?.name,
|
|
3193
|
+
() => Math.round(u(m) * 100)
|
|
3194
|
+
]
|
|
3195
|
+
), xe(w, O);
|
|
3196
|
+
};
|
|
3197
|
+
pn(ns, (w) => {
|
|
3198
|
+
n() && w(rs);
|
|
3199
|
+
});
|
|
3200
|
+
}
|
|
3201
|
+
return xe(e, wr), Rn(ts);
|
|
3202
|
+
}
|
|
3203
|
+
_r(["pointerdown", "keydown", "change", "input"]);
|
|
3204
|
+
customElements.define("pie-tool-line-reader", mr(
|
|
3205
|
+
ql,
|
|
3206
|
+
{
|
|
3207
|
+
visible: { attribute: "visible", type: "Boolean" },
|
|
3208
|
+
toolId: { attribute: "tool-id", type: "String" },
|
|
3209
|
+
coordinator: { type: "Object" }
|
|
3210
|
+
},
|
|
3211
|
+
[],
|
|
3212
|
+
[]
|
|
3213
|
+
));
|
|
3214
|
+
export {
|
|
3215
|
+
ql as default
|
|
3216
|
+
};
|
|
3217
|
+
//# sourceMappingURL=tool-line-reader.js.map
|