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