@pie-players/pie-section-player 0.2.14 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component-definitions.d.ts.map +1 -1
- package/dist/index-CGEKDUBQ.js +228 -0
- package/dist/index-DF-Dk87f.js +192 -0
- package/dist/pie-section-player.js +12155 -55904
- package/dist/tool-annotation-toolbar-9oNN3xoH.js +4285 -0
- package/package.json +13 -18
- package/src/components/PieSectionPlayerBaseElement.svelte +23 -2
- package/src/components/PieSectionPlayerSplitPaneElement.svelte +0 -7
- package/src/components/PieSectionPlayerVerticalElement.svelte +0 -7
- package/dist/pie-item-player-q4jcP2lZ.js +0 -6196
|
@@ -0,0 +1,4285 @@
|
|
|
1
|
+
var Ji = Object.defineProperty, On = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
|
+
}, Zi = (e, t, o) => t in e ? Ji(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, $ = (e, t, o) => Zi(e, typeof t != "symbol" ? t + "" : t, o), Uo = (e, t, o) => t.has(e) || On("Cannot " + o), u = (e, t, o) => (Uo(e, t, "read from private field"), o ? o.call(e) : t.get(e)), x = (e, t, o) => t.has(e) ? On("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, o), T = (e, t, o, n) => (Uo(e, t, "write to private field"), t.set(e, o), o), G = (e, t, o) => (Uo(e, t, "access private method"), o), vn;
|
|
4
|
+
typeof window < "u" && ((vn = window.__svelte ?? (window.__svelte = {})).v ?? (vn.v = /* @__PURE__ */ new Set())).add("5");
|
|
5
|
+
const Xi = 1, Yi = 2, Qi = 16, tr = 1, er = 2, Ko = "[", vo = "[!", Jo = "]", ye = {}, j = /* @__PURE__ */ Symbol(), Rn = "http://www.w3.org/1999/xhtml", or = !1;
|
|
6
|
+
var Nn = Array.isArray, nr = Array.prototype.indexOf, we = Array.prototype.includes, go = Array.from, co = Object.keys, uo = Object.defineProperty, be = Object.getOwnPropertyDescriptor, ir = Object.getOwnPropertyDescriptors, rr = Object.prototype, sr = Array.prototype, jn = Object.getPrototypeOf, gn = Object.isExtensible;
|
|
7
|
+
const lr = () => {
|
|
8
|
+
};
|
|
9
|
+
function ar(e) {
|
|
10
|
+
for (var t = 0; t < e.length; t++)
|
|
11
|
+
e[t]();
|
|
12
|
+
}
|
|
13
|
+
function Pn() {
|
|
14
|
+
var e, t, o = new Promise((n, r) => {
|
|
15
|
+
e = n, t = r;
|
|
16
|
+
});
|
|
17
|
+
return { promise: o, resolve: e, reject: t };
|
|
18
|
+
}
|
|
19
|
+
const P = 2, ze = 4, bo = 8, qn = 1 << 24, Mt = 16, dt = 32, Jt = 64, Vo = 128, Y = 512, N = 1024, q = 2048, ht = 4096, J = 8192, Vt = 16384, Se = 32768, Te = 65536, bn = 1 << 17, Zo = 1 << 18, he = 1 << 19, cr = 1 << 20, Gt = 1 << 25, se = 65536, Mo = 1 << 21, Xo = 1 << 22, Ft = 1 << 23, eo = /* @__PURE__ */ Symbol("$state"), ur = /* @__PURE__ */ Symbol("legacy props"), fr = /* @__PURE__ */ Symbol(""), oe = new class extends Error {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments), $(this, "name", "StaleReactionError"), $(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
22
|
+
}
|
|
23
|
+
}(), hr = (
|
|
24
|
+
// We gotta write it like this because after downleveling the pure comment may end up in the wrong location
|
|
25
|
+
!!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml")
|
|
26
|
+
), mo = 3, ke = 8;
|
|
27
|
+
function dr() {
|
|
28
|
+
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
29
|
+
}
|
|
30
|
+
function pr(e, t, o) {
|
|
31
|
+
throw new Error("https://svelte.dev/e/each_key_duplicate");
|
|
32
|
+
}
|
|
33
|
+
function vr(e) {
|
|
34
|
+
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
35
|
+
}
|
|
36
|
+
function gr() {
|
|
37
|
+
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
38
|
+
}
|
|
39
|
+
function br(e) {
|
|
40
|
+
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
41
|
+
}
|
|
42
|
+
function mr() {
|
|
43
|
+
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
44
|
+
}
|
|
45
|
+
function yr() {
|
|
46
|
+
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
47
|
+
}
|
|
48
|
+
function wr() {
|
|
49
|
+
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
50
|
+
}
|
|
51
|
+
function Tr() {
|
|
52
|
+
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
53
|
+
}
|
|
54
|
+
function $r() {
|
|
55
|
+
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
56
|
+
}
|
|
57
|
+
function Ir() {
|
|
58
|
+
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
59
|
+
}
|
|
60
|
+
function yo(e) {
|
|
61
|
+
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
62
|
+
}
|
|
63
|
+
function xr() {
|
|
64
|
+
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
65
|
+
}
|
|
66
|
+
let L = !1;
|
|
67
|
+
function at(e) {
|
|
68
|
+
L = e;
|
|
69
|
+
}
|
|
70
|
+
let E;
|
|
71
|
+
function B(e) {
|
|
72
|
+
if (e === null)
|
|
73
|
+
throw yo(), ye;
|
|
74
|
+
return E = e;
|
|
75
|
+
}
|
|
76
|
+
function wo() {
|
|
77
|
+
return B(/* @__PURE__ */ et(E));
|
|
78
|
+
}
|
|
79
|
+
function Ze(e) {
|
|
80
|
+
if (L) {
|
|
81
|
+
if (/* @__PURE__ */ et(E) !== null)
|
|
82
|
+
throw yo(), ye;
|
|
83
|
+
E = e;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function _r(e = 1) {
|
|
87
|
+
if (L) {
|
|
88
|
+
for (var t = e, o = E; t--; )
|
|
89
|
+
o = /** @type {TemplateNode} */
|
|
90
|
+
/* @__PURE__ */ et(o);
|
|
91
|
+
E = o;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function fo(e = !0) {
|
|
95
|
+
for (var t = 0, o = E; ; ) {
|
|
96
|
+
if (o.nodeType === ke) {
|
|
97
|
+
var n = (
|
|
98
|
+
/** @type {Comment} */
|
|
99
|
+
o.data
|
|
100
|
+
);
|
|
101
|
+
if (n === Jo) {
|
|
102
|
+
if (t === 0) return o;
|
|
103
|
+
t -= 1;
|
|
104
|
+
} else (n === Ko || n === vo || // "[1", "[2", etc. for if blocks
|
|
105
|
+
n[0] === "[" && !isNaN(Number(n.slice(1)))) && (t += 1);
|
|
106
|
+
}
|
|
107
|
+
var r = (
|
|
108
|
+
/** @type {TemplateNode} */
|
|
109
|
+
/* @__PURE__ */ et(o)
|
|
110
|
+
);
|
|
111
|
+
e && o.remove(), o = r;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function Wn(e) {
|
|
115
|
+
if (!e || e.nodeType !== ke)
|
|
116
|
+
throw yo(), ye;
|
|
117
|
+
return (
|
|
118
|
+
/** @type {Comment} */
|
|
119
|
+
e.data
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
function Dn(e) {
|
|
123
|
+
return e === this.v;
|
|
124
|
+
}
|
|
125
|
+
function Sr(e, t) {
|
|
126
|
+
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
127
|
+
}
|
|
128
|
+
function Hn(e) {
|
|
129
|
+
return !Sr(e, this.v);
|
|
130
|
+
}
|
|
131
|
+
let kr = !1, tt = null;
|
|
132
|
+
function $e(e) {
|
|
133
|
+
tt = e;
|
|
134
|
+
}
|
|
135
|
+
function Bn(e, t = !1, o) {
|
|
136
|
+
tt = {
|
|
137
|
+
p: tt,
|
|
138
|
+
i: !1,
|
|
139
|
+
c: null,
|
|
140
|
+
e: null,
|
|
141
|
+
s: e,
|
|
142
|
+
x: null,
|
|
143
|
+
l: null
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function zn(e) {
|
|
147
|
+
var t = (
|
|
148
|
+
/** @type {ComponentContext} */
|
|
149
|
+
tt
|
|
150
|
+
), o = t.e;
|
|
151
|
+
if (o !== null) {
|
|
152
|
+
t.e = null;
|
|
153
|
+
for (var n of o)
|
|
154
|
+
vi(n);
|
|
155
|
+
}
|
|
156
|
+
return e !== void 0 && (t.x = e), t.i = !0, tt = t.p, e ?? /** @type {T} */
|
|
157
|
+
{};
|
|
158
|
+
}
|
|
159
|
+
function Gn() {
|
|
160
|
+
return !0;
|
|
161
|
+
}
|
|
162
|
+
let ne = [];
|
|
163
|
+
function Fn() {
|
|
164
|
+
var e = ne;
|
|
165
|
+
ne = [], ar(e);
|
|
166
|
+
}
|
|
167
|
+
function le(e) {
|
|
168
|
+
if (ne.length === 0 && !We) {
|
|
169
|
+
var t = ne;
|
|
170
|
+
queueMicrotask(() => {
|
|
171
|
+
t === ne && Fn();
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
ne.push(e);
|
|
175
|
+
}
|
|
176
|
+
function Cr() {
|
|
177
|
+
for (; ne.length > 0; )
|
|
178
|
+
Fn();
|
|
179
|
+
}
|
|
180
|
+
function Un(e) {
|
|
181
|
+
var t = S;
|
|
182
|
+
if (t === null)
|
|
183
|
+
return _.f |= Ft, e;
|
|
184
|
+
if ((t.f & Se) === 0 && (t.f & ze) === 0)
|
|
185
|
+
throw e;
|
|
186
|
+
Ie(e, t);
|
|
187
|
+
}
|
|
188
|
+
function Ie(e, t) {
|
|
189
|
+
for (; t !== null; ) {
|
|
190
|
+
if ((t.f & Vo) !== 0) {
|
|
191
|
+
if ((t.f & Se) === 0)
|
|
192
|
+
throw e;
|
|
193
|
+
try {
|
|
194
|
+
t.b.error(e);
|
|
195
|
+
return;
|
|
196
|
+
} catch (o) {
|
|
197
|
+
e = o;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
t = t.parent;
|
|
201
|
+
}
|
|
202
|
+
throw e;
|
|
203
|
+
}
|
|
204
|
+
const Ar = -7169;
|
|
205
|
+
function M(e, t) {
|
|
206
|
+
e.f = e.f & Ar | t;
|
|
207
|
+
}
|
|
208
|
+
function Yo(e) {
|
|
209
|
+
(e.f & Y) !== 0 || e.deps === null ? M(e, N) : M(e, ht);
|
|
210
|
+
}
|
|
211
|
+
function Kn(e) {
|
|
212
|
+
if (e !== null)
|
|
213
|
+
for (const t of e)
|
|
214
|
+
(t.f & P) === 0 || (t.f & se) === 0 || (t.f ^= se, Kn(
|
|
215
|
+
/** @type {Derived} */
|
|
216
|
+
t.deps
|
|
217
|
+
));
|
|
218
|
+
}
|
|
219
|
+
function Jn(e, t, o) {
|
|
220
|
+
(e.f & q) !== 0 ? t.add(e) : (e.f & ht) !== 0 && o.add(e), Kn(e.deps), M(e, N);
|
|
221
|
+
}
|
|
222
|
+
const oo = /* @__PURE__ */ new Set();
|
|
223
|
+
let V = null, ft = null, F = [], To = null, Oo = !1, We = !1;
|
|
224
|
+
var Oe, Re, Nt, Qt, Ne, ho, me, Ht, je, te, Ro, No, Zn;
|
|
225
|
+
const Lr = class Xn {
|
|
226
|
+
constructor() {
|
|
227
|
+
x(this, te), $(this, "committed", !1), $(this, "current", /* @__PURE__ */ new Map()), $(this, "previous", /* @__PURE__ */ new Map()), x(this, Oe, /* @__PURE__ */ new Set()), x(this, Re, /* @__PURE__ */ new Set()), x(this, Nt, 0), x(this, Qt, 0), x(this, Ne, null), x(this, ho, /* @__PURE__ */ new Set()), x(this, me, /* @__PURE__ */ new Set()), x(this, Ht, /* @__PURE__ */ new Map()), $(this, "is_fork", !1), x(this, je, !1);
|
|
228
|
+
}
|
|
229
|
+
is_deferred() {
|
|
230
|
+
return this.is_fork || u(this, Qt) > 0;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Add an effect to the #skipped_branches map and reset its children
|
|
234
|
+
* @param {Effect} effect
|
|
235
|
+
*/
|
|
236
|
+
skip_effect(t) {
|
|
237
|
+
u(this, Ht).has(t) || u(this, Ht).set(t, { d: [], m: [] });
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Remove an effect from the #skipped_branches map and reschedule
|
|
241
|
+
* any tracked dirty/maybe_dirty child effects
|
|
242
|
+
* @param {Effect} effect
|
|
243
|
+
*/
|
|
244
|
+
unskip_effect(t) {
|
|
245
|
+
var o = u(this, Ht).get(t);
|
|
246
|
+
if (o) {
|
|
247
|
+
u(this, Ht).delete(t);
|
|
248
|
+
for (var n of o.d)
|
|
249
|
+
M(n, q), ct(n);
|
|
250
|
+
for (n of o.m)
|
|
251
|
+
M(n, ht), ct(n);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
*
|
|
256
|
+
* @param {Effect[]} root_effects
|
|
257
|
+
*/
|
|
258
|
+
process(t) {
|
|
259
|
+
F = [], this.apply();
|
|
260
|
+
var o = [], n = [];
|
|
261
|
+
for (const r of t)
|
|
262
|
+
G(this, te, Ro).call(this, r, o, n);
|
|
263
|
+
if (this.is_deferred()) {
|
|
264
|
+
G(this, te, No).call(this, n), G(this, te, No).call(this, o);
|
|
265
|
+
for (const [r, i] of u(this, Ht))
|
|
266
|
+
ei(r, i);
|
|
267
|
+
} else {
|
|
268
|
+
for (const r of u(this, Oe)) r();
|
|
269
|
+
u(this, Oe).clear(), u(this, Nt) === 0 && G(this, te, Zn).call(this), V = null, mn(n), mn(o), u(this, Ne)?.resolve();
|
|
270
|
+
}
|
|
271
|
+
ft = null;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Associate a change to a given source with the current
|
|
275
|
+
* batch, noting its previous and current values
|
|
276
|
+
* @param {Source} source
|
|
277
|
+
* @param {any} value
|
|
278
|
+
*/
|
|
279
|
+
capture(t, o) {
|
|
280
|
+
o !== j && !this.previous.has(t) && this.previous.set(t, o), (t.f & Ft) === 0 && (this.current.set(t, t.v), ft?.set(t, t.v));
|
|
281
|
+
}
|
|
282
|
+
activate() {
|
|
283
|
+
V = this, this.apply();
|
|
284
|
+
}
|
|
285
|
+
deactivate() {
|
|
286
|
+
V === this && (V = null, ft = null);
|
|
287
|
+
}
|
|
288
|
+
flush() {
|
|
289
|
+
if (this.activate(), F.length > 0) {
|
|
290
|
+
if (Yn(), V !== null && V !== this)
|
|
291
|
+
return;
|
|
292
|
+
} else u(this, Nt) === 0 && this.process([]);
|
|
293
|
+
this.deactivate();
|
|
294
|
+
}
|
|
295
|
+
discard() {
|
|
296
|
+
for (const t of u(this, Re)) t(this);
|
|
297
|
+
u(this, Re).clear();
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
*
|
|
301
|
+
* @param {boolean} blocking
|
|
302
|
+
*/
|
|
303
|
+
increment(t) {
|
|
304
|
+
T(this, Nt, u(this, Nt) + 1), t && T(this, Qt, u(this, Qt) + 1);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
*
|
|
308
|
+
* @param {boolean} blocking
|
|
309
|
+
*/
|
|
310
|
+
decrement(t) {
|
|
311
|
+
T(this, Nt, u(this, Nt) - 1), t && T(this, Qt, u(this, Qt) - 1), !u(this, je) && (T(this, je, !0), le(() => {
|
|
312
|
+
T(this, je, !1), this.is_deferred() ? F.length > 0 && this.flush() : this.revive();
|
|
313
|
+
}));
|
|
314
|
+
}
|
|
315
|
+
revive() {
|
|
316
|
+
for (const t of u(this, ho))
|
|
317
|
+
u(this, me).delete(t), M(t, q), ct(t);
|
|
318
|
+
for (const t of u(this, me))
|
|
319
|
+
M(t, ht), ct(t);
|
|
320
|
+
this.flush();
|
|
321
|
+
}
|
|
322
|
+
/** @param {() => void} fn */
|
|
323
|
+
oncommit(t) {
|
|
324
|
+
u(this, Oe).add(t);
|
|
325
|
+
}
|
|
326
|
+
/** @param {(batch: Batch) => void} fn */
|
|
327
|
+
ondiscard(t) {
|
|
328
|
+
u(this, Re).add(t);
|
|
329
|
+
}
|
|
330
|
+
settled() {
|
|
331
|
+
return (u(this, Ne) ?? T(this, Ne, Pn())).promise;
|
|
332
|
+
}
|
|
333
|
+
static ensure() {
|
|
334
|
+
if (V === null) {
|
|
335
|
+
const t = V = new Xn();
|
|
336
|
+
oo.add(V), We || le(() => {
|
|
337
|
+
V === t && t.flush();
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
return V;
|
|
341
|
+
}
|
|
342
|
+
apply() {
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
Oe = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), ho = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), je = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakSet(), /**
|
|
346
|
+
* Traverse the effect tree, executing effects or stashing
|
|
347
|
+
* them for later execution as appropriate
|
|
348
|
+
* @param {Effect} root
|
|
349
|
+
* @param {Effect[]} effects
|
|
350
|
+
* @param {Effect[]} render_effects
|
|
351
|
+
*/
|
|
352
|
+
Ro = function(e, t, o) {
|
|
353
|
+
e.f ^= N;
|
|
354
|
+
for (var n = e.first, r = null; n !== null; ) {
|
|
355
|
+
var i = n.f, s = (i & (dt | Jt)) !== 0, l = s && (i & N) !== 0, a = l || (i & J) !== 0 || u(this, Ht).has(n);
|
|
356
|
+
if (!a && n.fn !== null) {
|
|
357
|
+
s ? n.f ^= N : r !== null && (i & (ze | bo | qn)) !== 0 ? r.b.defer_effect(n) : (i & ze) !== 0 ? t.push(n) : Fe(n) && ((i & Mt) !== 0 && u(this, me).add(n), _e(n));
|
|
358
|
+
var c = n.first;
|
|
359
|
+
if (c !== null) {
|
|
360
|
+
n = c;
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
for (; n !== null; ) {
|
|
365
|
+
n === r && (r = null);
|
|
366
|
+
var f = n.next;
|
|
367
|
+
if (f !== null) {
|
|
368
|
+
n = f;
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
n = n.parent;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}, /**
|
|
375
|
+
* @param {Effect[]} effects
|
|
376
|
+
*/
|
|
377
|
+
No = function(e) {
|
|
378
|
+
for (var t = 0; t < e.length; t += 1)
|
|
379
|
+
Jn(e[t], u(this, ho), u(this, me));
|
|
380
|
+
}, Zn = function() {
|
|
381
|
+
var e;
|
|
382
|
+
if (oo.size > 1) {
|
|
383
|
+
this.previous.clear();
|
|
384
|
+
var t = ft, o = !0;
|
|
385
|
+
for (const r of oo) {
|
|
386
|
+
if (r === this) {
|
|
387
|
+
o = !1;
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
const i = [];
|
|
391
|
+
for (const [l, a] of this.current) {
|
|
392
|
+
if (r.current.has(l))
|
|
393
|
+
if (o && a !== r.current.get(l))
|
|
394
|
+
r.current.set(l, a);
|
|
395
|
+
else
|
|
396
|
+
continue;
|
|
397
|
+
i.push(l);
|
|
398
|
+
}
|
|
399
|
+
if (i.length === 0)
|
|
400
|
+
continue;
|
|
401
|
+
const s = [...r.current.keys()].filter((l) => !this.current.has(l));
|
|
402
|
+
if (s.length > 0) {
|
|
403
|
+
var n = F;
|
|
404
|
+
F = [];
|
|
405
|
+
const l = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
|
|
406
|
+
for (const c of i)
|
|
407
|
+
Qn(c, s, l, a);
|
|
408
|
+
if (F.length > 0) {
|
|
409
|
+
V = r, r.apply();
|
|
410
|
+
for (const c of F)
|
|
411
|
+
G(e = r, te, Ro).call(e, c, [], []);
|
|
412
|
+
r.deactivate();
|
|
413
|
+
}
|
|
414
|
+
F = n;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
V = null, ft = t;
|
|
418
|
+
}
|
|
419
|
+
this.committed = !0, oo.delete(this);
|
|
420
|
+
};
|
|
421
|
+
let ae = Lr;
|
|
422
|
+
function no(e) {
|
|
423
|
+
var t = We;
|
|
424
|
+
We = !0;
|
|
425
|
+
try {
|
|
426
|
+
for (var o; ; ) {
|
|
427
|
+
if (Cr(), F.length === 0 && (V?.flush(), F.length === 0))
|
|
428
|
+
return To = null, /** @type {T} */
|
|
429
|
+
o;
|
|
430
|
+
Yn();
|
|
431
|
+
}
|
|
432
|
+
} finally {
|
|
433
|
+
We = t;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
function Yn() {
|
|
437
|
+
Oo = !0;
|
|
438
|
+
try {
|
|
439
|
+
for (var e = 0; F.length > 0; ) {
|
|
440
|
+
var t = ae.ensure();
|
|
441
|
+
if (e++ > 1e3) {
|
|
442
|
+
var o, n;
|
|
443
|
+
Er();
|
|
444
|
+
}
|
|
445
|
+
t.process(F), Ut.clear();
|
|
446
|
+
}
|
|
447
|
+
} finally {
|
|
448
|
+
F = [], Oo = !1, To = null;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function Er() {
|
|
452
|
+
try {
|
|
453
|
+
mr();
|
|
454
|
+
} catch (e) {
|
|
455
|
+
Ie(e, To);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
let At = null;
|
|
459
|
+
function mn(e) {
|
|
460
|
+
var t = e.length;
|
|
461
|
+
if (t !== 0) {
|
|
462
|
+
for (var o = 0; o < t; ) {
|
|
463
|
+
var n = e[o++];
|
|
464
|
+
if ((n.f & (Vt | J)) === 0 && Fe(n) && (At = /* @__PURE__ */ new Set(), _e(n), n.deps === null && n.first === null && n.nodes === null && n.teardown === null && n.ac === null && mi(n), At?.size > 0)) {
|
|
465
|
+
Ut.clear();
|
|
466
|
+
for (const r of At) {
|
|
467
|
+
if ((r.f & (Vt | J)) !== 0) continue;
|
|
468
|
+
const i = [r];
|
|
469
|
+
let s = r.parent;
|
|
470
|
+
for (; s !== null; )
|
|
471
|
+
At.has(s) && (At.delete(s), i.push(s)), s = s.parent;
|
|
472
|
+
for (let l = i.length - 1; l >= 0; l--) {
|
|
473
|
+
const a = i[l];
|
|
474
|
+
(a.f & (Vt | J)) === 0 && _e(a);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
At.clear();
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
At = null;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
function Qn(e, t, o, n) {
|
|
484
|
+
if (!o.has(e) && (o.add(e), e.reactions !== null))
|
|
485
|
+
for (const r of e.reactions) {
|
|
486
|
+
const i = r.f;
|
|
487
|
+
(i & P) !== 0 ? Qn(
|
|
488
|
+
/** @type {Derived} */
|
|
489
|
+
r,
|
|
490
|
+
t,
|
|
491
|
+
o,
|
|
492
|
+
n
|
|
493
|
+
) : (i & (Xo | Mt)) !== 0 && (i & q) === 0 && ti(r, t, n) && (M(r, q), ct(
|
|
494
|
+
/** @type {Effect} */
|
|
495
|
+
r
|
|
496
|
+
));
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
function ti(e, t, o) {
|
|
500
|
+
const n = o.get(e);
|
|
501
|
+
if (n !== void 0) return n;
|
|
502
|
+
if (e.deps !== null)
|
|
503
|
+
for (const r of e.deps) {
|
|
504
|
+
if (we.call(t, r))
|
|
505
|
+
return !0;
|
|
506
|
+
if ((r.f & P) !== 0 && ti(
|
|
507
|
+
/** @type {Derived} */
|
|
508
|
+
r,
|
|
509
|
+
t,
|
|
510
|
+
o
|
|
511
|
+
))
|
|
512
|
+
return o.set(
|
|
513
|
+
/** @type {Derived} */
|
|
514
|
+
r,
|
|
515
|
+
!0
|
|
516
|
+
), !0;
|
|
517
|
+
}
|
|
518
|
+
return o.set(e, !1), !1;
|
|
519
|
+
}
|
|
520
|
+
function ct(e) {
|
|
521
|
+
for (var t = To = e; t.parent !== null; ) {
|
|
522
|
+
t = t.parent;
|
|
523
|
+
var o = t.f;
|
|
524
|
+
if (Oo && t === S && (o & Mt) !== 0 && (o & Zo) === 0)
|
|
525
|
+
return;
|
|
526
|
+
if ((o & (Jt | dt)) !== 0) {
|
|
527
|
+
if ((o & N) === 0) return;
|
|
528
|
+
t.f ^= N;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
F.push(t);
|
|
532
|
+
}
|
|
533
|
+
function ei(e, t) {
|
|
534
|
+
if (!((e.f & dt) !== 0 && (e.f & N) !== 0)) {
|
|
535
|
+
(e.f & q) !== 0 ? t.d.push(e) : (e.f & ht) !== 0 && t.m.push(e), M(e, N);
|
|
536
|
+
for (var o = e.first; o !== null; )
|
|
537
|
+
ei(o, t), o = o.next;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
function Vr(e) {
|
|
541
|
+
let t = 0, o = ce(0), n;
|
|
542
|
+
return () => {
|
|
543
|
+
on() && (b(o), nn(() => (t === 0 && (n = Ai(() => e(() => Be(o)))), t += 1, () => {
|
|
544
|
+
le(() => {
|
|
545
|
+
t -= 1, t === 0 && (n?.(), n = void 0, Be(o));
|
|
546
|
+
});
|
|
547
|
+
})));
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
var Mr = Te | he;
|
|
551
|
+
function Or(e, t, o) {
|
|
552
|
+
new Rr(e, t, o);
|
|
553
|
+
}
|
|
554
|
+
var lt, io, zt, pe, Lt, Et, X, kt, jt, ee, Pt, Pe, De, He, qt, jo, st, oi, ni, Po, po, qo;
|
|
555
|
+
class Rr {
|
|
556
|
+
/**
|
|
557
|
+
* @param {TemplateNode} node
|
|
558
|
+
* @param {BoundaryProps} props
|
|
559
|
+
* @param {((anchor: Node) => void)} children
|
|
560
|
+
*/
|
|
561
|
+
constructor(t, o, n) {
|
|
562
|
+
x(this, st), $(this, "parent"), $(this, "is_pending", !1), x(this, lt), x(this, io, L ? E : null), x(this, zt), x(this, pe), x(this, Lt), x(this, Et, null), x(this, X, null), x(this, kt, null), x(this, jt, null), x(this, ee, 0), x(this, Pt, 0), x(this, Pe, !1), x(this, De, /* @__PURE__ */ new Set()), x(this, He, /* @__PURE__ */ new Set()), x(this, qt, null), x(this, jo, Vr(() => (T(this, qt, ce(u(this, ee))), () => {
|
|
563
|
+
T(this, qt, null);
|
|
564
|
+
}))), T(this, lt, t), T(this, zt, o), T(this, pe, (r) => {
|
|
565
|
+
var i = (
|
|
566
|
+
/** @type {Effect} */
|
|
567
|
+
S
|
|
568
|
+
);
|
|
569
|
+
i.b = this, i.f |= Vo, n(r);
|
|
570
|
+
}), this.parent = /** @type {Effect} */
|
|
571
|
+
S.b, T(this, Lt, Io(() => {
|
|
572
|
+
if (L) {
|
|
573
|
+
const r = (
|
|
574
|
+
/** @type {Comment} */
|
|
575
|
+
u(this, io)
|
|
576
|
+
);
|
|
577
|
+
wo(), r.data === vo ? G(this, st, ni).call(this) : G(this, st, oi).call(this);
|
|
578
|
+
} else
|
|
579
|
+
G(this, st, Po).call(this);
|
|
580
|
+
}, Mr)), L && T(this, lt, E);
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Defer an effect inside a pending boundary until the boundary resolves
|
|
584
|
+
* @param {Effect} effect
|
|
585
|
+
*/
|
|
586
|
+
defer_effect(t) {
|
|
587
|
+
Jn(t, u(this, De), u(this, He));
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
591
|
+
* @returns {boolean}
|
|
592
|
+
*/
|
|
593
|
+
is_rendered() {
|
|
594
|
+
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
595
|
+
}
|
|
596
|
+
has_pending_snippet() {
|
|
597
|
+
return !!u(this, zt).pending;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
601
|
+
* and controls when the current `pending` snippet (if any) is removed.
|
|
602
|
+
* Do not call from inside the class
|
|
603
|
+
* @param {1 | -1} d
|
|
604
|
+
*/
|
|
605
|
+
update_pending_count(t) {
|
|
606
|
+
G(this, st, qo).call(this, t), T(this, ee, u(this, ee) + t), !(!u(this, qt) || u(this, Pe)) && (T(this, Pe, !0), le(() => {
|
|
607
|
+
T(this, Pe, !1), u(this, qt) && xe(u(this, qt), u(this, ee));
|
|
608
|
+
}));
|
|
609
|
+
}
|
|
610
|
+
get_effect_pending() {
|
|
611
|
+
return u(this, jo).call(this), b(
|
|
612
|
+
/** @type {Source<number>} */
|
|
613
|
+
u(this, qt)
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
/** @param {unknown} error */
|
|
617
|
+
error(t) {
|
|
618
|
+
var o = u(this, zt).onerror;
|
|
619
|
+
let n = u(this, zt).failed;
|
|
620
|
+
if (!o && !n)
|
|
621
|
+
throw t;
|
|
622
|
+
u(this, Et) && (H(u(this, Et)), T(this, Et, null)), u(this, X) && (H(u(this, X)), T(this, X, null)), u(this, kt) && (H(u(this, kt)), T(this, kt, null)), L && (B(
|
|
623
|
+
/** @type {TemplateNode} */
|
|
624
|
+
u(this, io)
|
|
625
|
+
), _r(), B(fo()));
|
|
626
|
+
var r = !1, i = !1;
|
|
627
|
+
const s = () => {
|
|
628
|
+
if (r) {
|
|
629
|
+
xr();
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
r = !0, i && Ir(), u(this, kt) !== null && fe(u(this, kt), () => {
|
|
633
|
+
T(this, kt, null);
|
|
634
|
+
}), G(this, st, po).call(this, () => {
|
|
635
|
+
ae.ensure(), G(this, st, Po).call(this);
|
|
636
|
+
});
|
|
637
|
+
};
|
|
638
|
+
le(() => {
|
|
639
|
+
try {
|
|
640
|
+
i = !0, o?.(t, s), i = !1;
|
|
641
|
+
} catch (l) {
|
|
642
|
+
Ie(l, u(this, Lt) && u(this, Lt).parent);
|
|
643
|
+
}
|
|
644
|
+
n && T(this, kt, G(this, st, po).call(this, () => {
|
|
645
|
+
ae.ensure();
|
|
646
|
+
try {
|
|
647
|
+
return yt(() => {
|
|
648
|
+
var l = (
|
|
649
|
+
/** @type {Effect} */
|
|
650
|
+
S
|
|
651
|
+
);
|
|
652
|
+
l.b = this, l.f |= Vo, n(
|
|
653
|
+
u(this, lt),
|
|
654
|
+
() => t,
|
|
655
|
+
() => s
|
|
656
|
+
);
|
|
657
|
+
});
|
|
658
|
+
} catch (l) {
|
|
659
|
+
return Ie(
|
|
660
|
+
l,
|
|
661
|
+
/** @type {Effect} */
|
|
662
|
+
u(this, Lt).parent
|
|
663
|
+
), null;
|
|
664
|
+
}
|
|
665
|
+
}));
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
lt = /* @__PURE__ */ new WeakMap(), io = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), jt = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), jo = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakSet(), oi = function() {
|
|
670
|
+
try {
|
|
671
|
+
T(this, Et, yt(() => u(this, pe).call(this, u(this, lt))));
|
|
672
|
+
} catch (e) {
|
|
673
|
+
this.error(e);
|
|
674
|
+
}
|
|
675
|
+
}, ni = function() {
|
|
676
|
+
const e = u(this, zt).pending;
|
|
677
|
+
e && (this.is_pending = !0, T(this, X, yt(() => e(u(this, lt)))), le(() => {
|
|
678
|
+
var t = T(this, jt, document.createDocumentFragment()), o = wt();
|
|
679
|
+
t.append(o), T(this, Et, G(this, st, po).call(this, () => (ae.ensure(), yt(() => u(this, pe).call(this, o))))), u(this, Pt) === 0 && (u(this, lt).before(t), T(this, jt, null), fe(
|
|
680
|
+
/** @type {Effect} */
|
|
681
|
+
u(this, X),
|
|
682
|
+
() => {
|
|
683
|
+
T(this, X, null);
|
|
684
|
+
}
|
|
685
|
+
), this.is_pending = !1);
|
|
686
|
+
}));
|
|
687
|
+
}, Po = function() {
|
|
688
|
+
try {
|
|
689
|
+
if (this.is_pending = this.has_pending_snippet(), T(this, Pt, 0), T(this, ee, 0), T(this, Et, yt(() => {
|
|
690
|
+
u(this, pe).call(this, u(this, lt));
|
|
691
|
+
})), u(this, Pt) > 0) {
|
|
692
|
+
var e = T(this, jt, document.createDocumentFragment());
|
|
693
|
+
Ti(u(this, Et), e);
|
|
694
|
+
const t = (
|
|
695
|
+
/** @type {(anchor: Node) => void} */
|
|
696
|
+
u(this, zt).pending
|
|
697
|
+
);
|
|
698
|
+
T(this, X, yt(() => t(u(this, lt))));
|
|
699
|
+
} else
|
|
700
|
+
this.is_pending = !1;
|
|
701
|
+
} catch (t) {
|
|
702
|
+
this.error(t);
|
|
703
|
+
}
|
|
704
|
+
}, /**
|
|
705
|
+
* @template T
|
|
706
|
+
* @param {() => T} fn
|
|
707
|
+
*/
|
|
708
|
+
po = function(e) {
|
|
709
|
+
var t = S, o = _, n = tt;
|
|
710
|
+
Tt(u(this, Lt)), ot(u(this, Lt)), $e(u(this, Lt).ctx);
|
|
711
|
+
try {
|
|
712
|
+
return e();
|
|
713
|
+
} catch (r) {
|
|
714
|
+
return Un(r), null;
|
|
715
|
+
} finally {
|
|
716
|
+
Tt(t), ot(o), $e(n);
|
|
717
|
+
}
|
|
718
|
+
}, /**
|
|
719
|
+
* Updates the pending count associated with the currently visible pending snippet,
|
|
720
|
+
* if any, such that we can replace the snippet with content once work is done
|
|
721
|
+
* @param {1 | -1} d
|
|
722
|
+
*/
|
|
723
|
+
qo = function(e) {
|
|
724
|
+
var t;
|
|
725
|
+
if (!this.has_pending_snippet()) {
|
|
726
|
+
this.parent && G(t = this.parent, st, qo).call(t, e);
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
if (T(this, Pt, u(this, Pt) + e), u(this, Pt) === 0) {
|
|
730
|
+
this.is_pending = !1;
|
|
731
|
+
for (const o of u(this, De))
|
|
732
|
+
M(o, q), ct(o);
|
|
733
|
+
for (const o of u(this, He))
|
|
734
|
+
M(o, ht), ct(o);
|
|
735
|
+
u(this, De).clear(), u(this, He).clear(), u(this, X) && fe(u(this, X), () => {
|
|
736
|
+
T(this, X, null);
|
|
737
|
+
}), u(this, jt) && (u(this, lt).before(u(this, jt)), T(this, jt, null));
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
function Nr(e, t, o, n) {
|
|
741
|
+
const r = $o;
|
|
742
|
+
var i = e.filter((v) => !v.settled);
|
|
743
|
+
if (o.length === 0 && i.length === 0) {
|
|
744
|
+
n(t.map(r));
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
var s = V, l = (
|
|
748
|
+
/** @type {Effect} */
|
|
749
|
+
S
|
|
750
|
+
), a = jr(), c = i.length === 1 ? i[0].promise : i.length > 1 ? Promise.all(i.map((v) => v.promise)) : null;
|
|
751
|
+
function f(v) {
|
|
752
|
+
a();
|
|
753
|
+
try {
|
|
754
|
+
n(v);
|
|
755
|
+
} catch (d) {
|
|
756
|
+
(l.f & Vt) === 0 && Ie(d, l);
|
|
757
|
+
}
|
|
758
|
+
s?.deactivate(), Wo();
|
|
759
|
+
}
|
|
760
|
+
if (o.length === 0) {
|
|
761
|
+
c.then(() => f(t.map(r)));
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
function p() {
|
|
765
|
+
a(), Promise.all(o.map((v) => /* @__PURE__ */ Pr(v))).then((v) => f([...t.map(r), ...v])).catch((v) => Ie(v, l));
|
|
766
|
+
}
|
|
767
|
+
c ? c.then(p) : p();
|
|
768
|
+
}
|
|
769
|
+
function jr() {
|
|
770
|
+
var e = S, t = _, o = tt, n = V;
|
|
771
|
+
return function(r = !0) {
|
|
772
|
+
Tt(e), ot(t), $e(o), r && n?.activate();
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
function Wo() {
|
|
776
|
+
Tt(null), ot(null), $e(null);
|
|
777
|
+
}
|
|
778
|
+
// @__NO_SIDE_EFFECTS__
|
|
779
|
+
function $o(e) {
|
|
780
|
+
var t = P | q, o = _ !== null && (_.f & P) !== 0 ? (
|
|
781
|
+
/** @type {Derived} */
|
|
782
|
+
_
|
|
783
|
+
) : null;
|
|
784
|
+
return S !== null && (S.f |= he), {
|
|
785
|
+
ctx: tt,
|
|
786
|
+
deps: null,
|
|
787
|
+
effects: null,
|
|
788
|
+
equals: Dn,
|
|
789
|
+
f: t,
|
|
790
|
+
fn: e,
|
|
791
|
+
reactions: null,
|
|
792
|
+
rv: 0,
|
|
793
|
+
v: (
|
|
794
|
+
/** @type {V} */
|
|
795
|
+
j
|
|
796
|
+
),
|
|
797
|
+
wv: 0,
|
|
798
|
+
parent: o ?? S,
|
|
799
|
+
ac: null
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
// @__NO_SIDE_EFFECTS__
|
|
803
|
+
function Pr(e, t, o) {
|
|
804
|
+
let n = (
|
|
805
|
+
/** @type {Effect | null} */
|
|
806
|
+
S
|
|
807
|
+
);
|
|
808
|
+
n === null && dr();
|
|
809
|
+
var r = (
|
|
810
|
+
/** @type {Boundary} */
|
|
811
|
+
n.b
|
|
812
|
+
), i = (
|
|
813
|
+
/** @type {Promise<V>} */
|
|
814
|
+
/** @type {unknown} */
|
|
815
|
+
void 0
|
|
816
|
+
), s = ce(
|
|
817
|
+
/** @type {V} */
|
|
818
|
+
j
|
|
819
|
+
), l = !_, a = /* @__PURE__ */ new Map();
|
|
820
|
+
return Jr(() => {
|
|
821
|
+
var c = Pn();
|
|
822
|
+
i = c.promise;
|
|
823
|
+
try {
|
|
824
|
+
Promise.resolve(e()).then(c.resolve, c.reject).then(() => {
|
|
825
|
+
f === V && f.committed && f.deactivate(), Wo();
|
|
826
|
+
});
|
|
827
|
+
} catch (d) {
|
|
828
|
+
c.reject(d), Wo();
|
|
829
|
+
}
|
|
830
|
+
var f = (
|
|
831
|
+
/** @type {Batch} */
|
|
832
|
+
V
|
|
833
|
+
);
|
|
834
|
+
if (l) {
|
|
835
|
+
var p = r.is_rendered();
|
|
836
|
+
r.update_pending_count(1), f.increment(p), a.get(f)?.reject(oe), a.delete(f), a.set(f, c);
|
|
837
|
+
}
|
|
838
|
+
const v = (d, h = void 0) => {
|
|
839
|
+
if (f.activate(), h)
|
|
840
|
+
h !== oe && (s.f |= Ft, xe(s, h));
|
|
841
|
+
else {
|
|
842
|
+
(s.f & Ft) !== 0 && (s.f ^= Ft), xe(s, d);
|
|
843
|
+
for (const [m, y] of a) {
|
|
844
|
+
if (a.delete(m), m === f) break;
|
|
845
|
+
y.reject(oe);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
l && (r.update_pending_count(-1), f.decrement(p));
|
|
849
|
+
};
|
|
850
|
+
c.promise.then(v, (d) => v(null, d || "unknown"));
|
|
851
|
+
}), Fr(() => {
|
|
852
|
+
for (const c of a.values())
|
|
853
|
+
c.reject(oe);
|
|
854
|
+
}), new Promise((c) => {
|
|
855
|
+
function f(p) {
|
|
856
|
+
function v() {
|
|
857
|
+
p === i ? c(s) : f(i);
|
|
858
|
+
}
|
|
859
|
+
p.then(v, v);
|
|
860
|
+
}
|
|
861
|
+
f(i);
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
// @__NO_SIDE_EFFECTS__
|
|
865
|
+
function Ao(e) {
|
|
866
|
+
const t = /* @__PURE__ */ $o(e);
|
|
867
|
+
return $i(t), t;
|
|
868
|
+
}
|
|
869
|
+
// @__NO_SIDE_EFFECTS__
|
|
870
|
+
function qr(e) {
|
|
871
|
+
const t = /* @__PURE__ */ $o(e);
|
|
872
|
+
return t.equals = Hn, t;
|
|
873
|
+
}
|
|
874
|
+
function Wr(e) {
|
|
875
|
+
var t = e.effects;
|
|
876
|
+
if (t !== null) {
|
|
877
|
+
e.effects = null;
|
|
878
|
+
for (var o = 0; o < t.length; o += 1)
|
|
879
|
+
H(
|
|
880
|
+
/** @type {Effect} */
|
|
881
|
+
t[o]
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
function Dr(e) {
|
|
886
|
+
for (var t = e.parent; t !== null; ) {
|
|
887
|
+
if ((t.f & P) === 0)
|
|
888
|
+
return (t.f & Vt) === 0 ? (
|
|
889
|
+
/** @type {Effect} */
|
|
890
|
+
t
|
|
891
|
+
) : null;
|
|
892
|
+
t = t.parent;
|
|
893
|
+
}
|
|
894
|
+
return null;
|
|
895
|
+
}
|
|
896
|
+
function Qo(e) {
|
|
897
|
+
var t, o = S;
|
|
898
|
+
Tt(Dr(e));
|
|
899
|
+
try {
|
|
900
|
+
e.f &= ~se, Wr(e), t = Si(e);
|
|
901
|
+
} finally {
|
|
902
|
+
Tt(o);
|
|
903
|
+
}
|
|
904
|
+
return t;
|
|
905
|
+
}
|
|
906
|
+
function ii(e) {
|
|
907
|
+
var t = Qo(e);
|
|
908
|
+
if (!e.equals(t) && (e.wv = xi(), (!V?.is_fork || e.deps === null) && (e.v = t, e.deps === null))) {
|
|
909
|
+
M(e, N);
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
Kt || (ft !== null ? (on() || V?.is_fork) && ft.set(e, t) : Yo(e));
|
|
913
|
+
}
|
|
914
|
+
function Hr(e) {
|
|
915
|
+
if (e.effects !== null)
|
|
916
|
+
for (const t of e.effects)
|
|
917
|
+
(t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(oe), t.teardown = lr, t.ac = null, Ge(t, 0), rn(t));
|
|
918
|
+
}
|
|
919
|
+
function ri(e) {
|
|
920
|
+
if (e.effects !== null)
|
|
921
|
+
for (const t of e.effects)
|
|
922
|
+
t.teardown && _e(t);
|
|
923
|
+
}
|
|
924
|
+
let Do = /* @__PURE__ */ new Set();
|
|
925
|
+
const Ut = /* @__PURE__ */ new Map();
|
|
926
|
+
let si = !1;
|
|
927
|
+
function ce(e, t) {
|
|
928
|
+
var o = {
|
|
929
|
+
f: 0,
|
|
930
|
+
// TODO ideally we could skip this altogether, but it causes type errors
|
|
931
|
+
v: e,
|
|
932
|
+
reactions: null,
|
|
933
|
+
equals: Dn,
|
|
934
|
+
rv: 0,
|
|
935
|
+
wv: 0
|
|
936
|
+
};
|
|
937
|
+
return o;
|
|
938
|
+
}
|
|
939
|
+
// @__NO_SIDE_EFFECTS__
|
|
940
|
+
function R(e, t) {
|
|
941
|
+
const o = ce(e);
|
|
942
|
+
return $i(o), o;
|
|
943
|
+
}
|
|
944
|
+
// @__NO_SIDE_EFFECTS__
|
|
945
|
+
function li(e, t = !1, o = !0) {
|
|
946
|
+
const n = ce(e);
|
|
947
|
+
return t || (n.equals = Hn), n;
|
|
948
|
+
}
|
|
949
|
+
function C(e, t, o = !1) {
|
|
950
|
+
_ !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
951
|
+
// to ensure we error if state is set inside an inspect effect
|
|
952
|
+
(!ut || (_.f & bn) !== 0) && Gn() && (_.f & (P | Mt | Xo | bn)) !== 0 && (Q === null || !we.call(Q, e)) && $r();
|
|
953
|
+
let n = o ? ve(t) : t;
|
|
954
|
+
return xe(e, n);
|
|
955
|
+
}
|
|
956
|
+
function xe(e, t) {
|
|
957
|
+
if (!e.equals(t)) {
|
|
958
|
+
var o = e.v;
|
|
959
|
+
Kt ? Ut.set(e, t) : Ut.set(e, o), e.v = t;
|
|
960
|
+
var n = ae.ensure();
|
|
961
|
+
if (n.capture(e, o), (e.f & P) !== 0) {
|
|
962
|
+
const r = (
|
|
963
|
+
/** @type {Derived} */
|
|
964
|
+
e
|
|
965
|
+
);
|
|
966
|
+
(e.f & q) !== 0 && Qo(r), Yo(r);
|
|
967
|
+
}
|
|
968
|
+
e.wv = xi(), ai(e, q), S !== null && (S.f & N) !== 0 && (S.f & (dt | Jt)) === 0 && (Z === null ? Yr([e]) : Z.push(e)), !n.is_fork && Do.size > 0 && !si && Br();
|
|
969
|
+
}
|
|
970
|
+
return t;
|
|
971
|
+
}
|
|
972
|
+
function Br() {
|
|
973
|
+
si = !1;
|
|
974
|
+
for (const e of Do)
|
|
975
|
+
(e.f & N) !== 0 && M(e, ht), Fe(e) && _e(e);
|
|
976
|
+
Do.clear();
|
|
977
|
+
}
|
|
978
|
+
function Be(e) {
|
|
979
|
+
C(e, e.v + 1);
|
|
980
|
+
}
|
|
981
|
+
function ai(e, t) {
|
|
982
|
+
var o = e.reactions;
|
|
983
|
+
if (o !== null)
|
|
984
|
+
for (var n = o.length, r = 0; r < n; r++) {
|
|
985
|
+
var i = o[r], s = i.f, l = (s & q) === 0;
|
|
986
|
+
if (l && M(i, t), (s & P) !== 0) {
|
|
987
|
+
var a = (
|
|
988
|
+
/** @type {Derived} */
|
|
989
|
+
i
|
|
990
|
+
);
|
|
991
|
+
ft?.delete(a), (s & se) === 0 && (s & Y && (i.f |= se), ai(a, ht));
|
|
992
|
+
} else l && ((s & Mt) !== 0 && At !== null && At.add(
|
|
993
|
+
/** @type {Effect} */
|
|
994
|
+
i
|
|
995
|
+
), ct(
|
|
996
|
+
/** @type {Effect} */
|
|
997
|
+
i
|
|
998
|
+
));
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
function ve(e) {
|
|
1002
|
+
if (typeof e != "object" || e === null || eo in e)
|
|
1003
|
+
return e;
|
|
1004
|
+
const t = jn(e);
|
|
1005
|
+
if (t !== rr && t !== sr)
|
|
1006
|
+
return e;
|
|
1007
|
+
var o = /* @__PURE__ */ new Map(), n = Nn(e), r = /* @__PURE__ */ R(0), i = re, s = (l) => {
|
|
1008
|
+
if (re === i)
|
|
1009
|
+
return l();
|
|
1010
|
+
var a = _, c = re;
|
|
1011
|
+
ot(null), $n(i);
|
|
1012
|
+
var f = l();
|
|
1013
|
+
return ot(a), $n(c), f;
|
|
1014
|
+
};
|
|
1015
|
+
return n && o.set("length", /* @__PURE__ */ R(
|
|
1016
|
+
/** @type {any[]} */
|
|
1017
|
+
e.length
|
|
1018
|
+
)), new Proxy(
|
|
1019
|
+
/** @type {any} */
|
|
1020
|
+
e,
|
|
1021
|
+
{
|
|
1022
|
+
defineProperty(l, a, c) {
|
|
1023
|
+
(!("value" in c) || c.configurable === !1 || c.enumerable === !1 || c.writable === !1) && wr();
|
|
1024
|
+
var f = o.get(a);
|
|
1025
|
+
return f === void 0 ? s(() => {
|
|
1026
|
+
var p = /* @__PURE__ */ R(c.value);
|
|
1027
|
+
return o.set(a, p), p;
|
|
1028
|
+
}) : C(f, c.value, !0), !0;
|
|
1029
|
+
},
|
|
1030
|
+
deleteProperty(l, a) {
|
|
1031
|
+
var c = o.get(a);
|
|
1032
|
+
if (c === void 0) {
|
|
1033
|
+
if (a in l) {
|
|
1034
|
+
const f = s(() => /* @__PURE__ */ R(j));
|
|
1035
|
+
o.set(a, f), Be(r);
|
|
1036
|
+
}
|
|
1037
|
+
} else
|
|
1038
|
+
C(c, j), Be(r);
|
|
1039
|
+
return !0;
|
|
1040
|
+
},
|
|
1041
|
+
get(l, a, c) {
|
|
1042
|
+
if (a === eo)
|
|
1043
|
+
return e;
|
|
1044
|
+
var f = o.get(a), p = a in l;
|
|
1045
|
+
if (f === void 0 && (!p || be(l, a)?.writable) && (f = s(() => {
|
|
1046
|
+
var d = ve(p ? l[a] : j), h = /* @__PURE__ */ R(d);
|
|
1047
|
+
return h;
|
|
1048
|
+
}), o.set(a, f)), f !== void 0) {
|
|
1049
|
+
var v = b(f);
|
|
1050
|
+
return v === j ? void 0 : v;
|
|
1051
|
+
}
|
|
1052
|
+
return Reflect.get(l, a, c);
|
|
1053
|
+
},
|
|
1054
|
+
getOwnPropertyDescriptor(l, a) {
|
|
1055
|
+
var c = Reflect.getOwnPropertyDescriptor(l, a);
|
|
1056
|
+
if (c && "value" in c) {
|
|
1057
|
+
var f = o.get(a);
|
|
1058
|
+
f && (c.value = b(f));
|
|
1059
|
+
} else if (c === void 0) {
|
|
1060
|
+
var p = o.get(a), v = p?.v;
|
|
1061
|
+
if (p !== void 0 && v !== j)
|
|
1062
|
+
return {
|
|
1063
|
+
enumerable: !0,
|
|
1064
|
+
configurable: !0,
|
|
1065
|
+
value: v,
|
|
1066
|
+
writable: !0
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
return c;
|
|
1070
|
+
},
|
|
1071
|
+
has(l, a) {
|
|
1072
|
+
if (a === eo)
|
|
1073
|
+
return !0;
|
|
1074
|
+
var c = o.get(a), f = c !== void 0 && c.v !== j || Reflect.has(l, a);
|
|
1075
|
+
if (c !== void 0 || S !== null && (!f || be(l, a)?.writable)) {
|
|
1076
|
+
c === void 0 && (c = s(() => {
|
|
1077
|
+
var v = f ? ve(l[a]) : j, d = /* @__PURE__ */ R(v);
|
|
1078
|
+
return d;
|
|
1079
|
+
}), o.set(a, c));
|
|
1080
|
+
var p = b(c);
|
|
1081
|
+
if (p === j)
|
|
1082
|
+
return !1;
|
|
1083
|
+
}
|
|
1084
|
+
return f;
|
|
1085
|
+
},
|
|
1086
|
+
set(l, a, c, f) {
|
|
1087
|
+
var p = o.get(a), v = a in l;
|
|
1088
|
+
if (n && a === "length")
|
|
1089
|
+
for (var d = c; d < /** @type {Source<number>} */
|
|
1090
|
+
p.v; d += 1) {
|
|
1091
|
+
var h = o.get(d + "");
|
|
1092
|
+
h !== void 0 ? C(h, j) : d in l && (h = s(() => /* @__PURE__ */ R(j)), o.set(d + "", h));
|
|
1093
|
+
}
|
|
1094
|
+
if (p === void 0)
|
|
1095
|
+
(!v || be(l, a)?.writable) && (p = s(() => /* @__PURE__ */ R(void 0)), C(p, ve(c)), o.set(a, p));
|
|
1096
|
+
else {
|
|
1097
|
+
v = p.v !== j;
|
|
1098
|
+
var m = s(() => ve(c));
|
|
1099
|
+
C(p, m);
|
|
1100
|
+
}
|
|
1101
|
+
var y = Reflect.getOwnPropertyDescriptor(l, a);
|
|
1102
|
+
if (y?.set && y.set.call(f, c), !v) {
|
|
1103
|
+
if (n && typeof a == "string") {
|
|
1104
|
+
var k = (
|
|
1105
|
+
/** @type {Source<number>} */
|
|
1106
|
+
o.get("length")
|
|
1107
|
+
), I = Number(a);
|
|
1108
|
+
Number.isInteger(I) && I >= k.v && C(k, I + 1);
|
|
1109
|
+
}
|
|
1110
|
+
Be(r);
|
|
1111
|
+
}
|
|
1112
|
+
return !0;
|
|
1113
|
+
},
|
|
1114
|
+
ownKeys(l) {
|
|
1115
|
+
b(r);
|
|
1116
|
+
var a = Reflect.ownKeys(l).filter((p) => {
|
|
1117
|
+
var v = o.get(p);
|
|
1118
|
+
return v === void 0 || v.v !== j;
|
|
1119
|
+
});
|
|
1120
|
+
for (var [c, f] of o)
|
|
1121
|
+
f.v !== j && !(c in l) && a.push(c);
|
|
1122
|
+
return a;
|
|
1123
|
+
},
|
|
1124
|
+
setPrototypeOf() {
|
|
1125
|
+
Tr();
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1130
|
+
var yn, ci, ui, fi;
|
|
1131
|
+
function Ho() {
|
|
1132
|
+
if (yn === void 0) {
|
|
1133
|
+
yn = window, ci = /Firefox/.test(navigator.userAgent);
|
|
1134
|
+
var e = Element.prototype, t = Node.prototype, o = Text.prototype;
|
|
1135
|
+
ui = be(t, "firstChild").get, fi = be(t, "nextSibling").get, gn(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), gn(o) && (o.__t = void 0);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
function wt(e = "") {
|
|
1139
|
+
return document.createTextNode(e);
|
|
1140
|
+
}
|
|
1141
|
+
// @__NO_SIDE_EFFECTS__
|
|
1142
|
+
function ue(e) {
|
|
1143
|
+
return (
|
|
1144
|
+
/** @type {TemplateNode | null} */
|
|
1145
|
+
ui.call(e)
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1148
|
+
// @__NO_SIDE_EFFECTS__
|
|
1149
|
+
function et(e) {
|
|
1150
|
+
return (
|
|
1151
|
+
/** @type {TemplateNode | null} */
|
|
1152
|
+
fi.call(e)
|
|
1153
|
+
);
|
|
1154
|
+
}
|
|
1155
|
+
function Xe(e, t) {
|
|
1156
|
+
if (!L)
|
|
1157
|
+
return /* @__PURE__ */ ue(e);
|
|
1158
|
+
var o = /* @__PURE__ */ ue(E);
|
|
1159
|
+
if (o === null)
|
|
1160
|
+
o = E.appendChild(wt());
|
|
1161
|
+
else if (t && o.nodeType !== mo) {
|
|
1162
|
+
var n = wt();
|
|
1163
|
+
return o?.before(n), B(n), n;
|
|
1164
|
+
}
|
|
1165
|
+
return t && en(
|
|
1166
|
+
/** @type {Text} */
|
|
1167
|
+
o
|
|
1168
|
+
), B(o), o;
|
|
1169
|
+
}
|
|
1170
|
+
function Lo(e, t = !1) {
|
|
1171
|
+
if (!L) {
|
|
1172
|
+
var o = /* @__PURE__ */ ue(e);
|
|
1173
|
+
return o instanceof Comment && o.data === "" ? /* @__PURE__ */ et(o) : o;
|
|
1174
|
+
}
|
|
1175
|
+
if (t) {
|
|
1176
|
+
if (E?.nodeType !== mo) {
|
|
1177
|
+
var n = wt();
|
|
1178
|
+
return E?.before(n), B(n), n;
|
|
1179
|
+
}
|
|
1180
|
+
en(
|
|
1181
|
+
/** @type {Text} */
|
|
1182
|
+
E
|
|
1183
|
+
);
|
|
1184
|
+
}
|
|
1185
|
+
return E;
|
|
1186
|
+
}
|
|
1187
|
+
function Ot(e, t = 1, o = !1) {
|
|
1188
|
+
let n = L ? E : e;
|
|
1189
|
+
for (var r; t--; )
|
|
1190
|
+
r = n, n = /** @type {TemplateNode} */
|
|
1191
|
+
/* @__PURE__ */ et(n);
|
|
1192
|
+
if (!L)
|
|
1193
|
+
return n;
|
|
1194
|
+
if (o) {
|
|
1195
|
+
if (n?.nodeType !== mo) {
|
|
1196
|
+
var i = wt();
|
|
1197
|
+
return n === null ? r?.after(i) : n.before(i), B(i), i;
|
|
1198
|
+
}
|
|
1199
|
+
en(
|
|
1200
|
+
/** @type {Text} */
|
|
1201
|
+
n
|
|
1202
|
+
);
|
|
1203
|
+
}
|
|
1204
|
+
return B(n), n;
|
|
1205
|
+
}
|
|
1206
|
+
function hi(e) {
|
|
1207
|
+
e.textContent = "";
|
|
1208
|
+
}
|
|
1209
|
+
function di() {
|
|
1210
|
+
return !1;
|
|
1211
|
+
}
|
|
1212
|
+
function tn(e, t, o) {
|
|
1213
|
+
return (
|
|
1214
|
+
/** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
|
|
1215
|
+
document.createElementNS(Rn, e, void 0)
|
|
1216
|
+
);
|
|
1217
|
+
}
|
|
1218
|
+
function en(e) {
|
|
1219
|
+
if (
|
|
1220
|
+
/** @type {string} */
|
|
1221
|
+
e.nodeValue.length < 65536
|
|
1222
|
+
)
|
|
1223
|
+
return;
|
|
1224
|
+
let t = e.nextSibling;
|
|
1225
|
+
for (; t !== null && t.nodeType === mo; )
|
|
1226
|
+
t.remove(), e.nodeValue += /** @type {string} */
|
|
1227
|
+
t.nodeValue, t = e.nextSibling;
|
|
1228
|
+
}
|
|
1229
|
+
function pi(e) {
|
|
1230
|
+
var t = _, o = S;
|
|
1231
|
+
ot(null), Tt(null);
|
|
1232
|
+
try {
|
|
1233
|
+
return e();
|
|
1234
|
+
} finally {
|
|
1235
|
+
ot(t), Tt(o);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
function zr(e) {
|
|
1239
|
+
S === null && (_ === null && br(), gr()), Kt && vr();
|
|
1240
|
+
}
|
|
1241
|
+
function Gr(e, t) {
|
|
1242
|
+
var o = t.last;
|
|
1243
|
+
o === null ? t.last = t.first = e : (o.next = e, e.prev = o, t.last = e);
|
|
1244
|
+
}
|
|
1245
|
+
function $t(e, t, o) {
|
|
1246
|
+
var n = S;
|
|
1247
|
+
n !== null && (n.f & J) !== 0 && (e |= J);
|
|
1248
|
+
var r = {
|
|
1249
|
+
ctx: tt,
|
|
1250
|
+
deps: null,
|
|
1251
|
+
nodes: null,
|
|
1252
|
+
f: e | q | Y,
|
|
1253
|
+
first: null,
|
|
1254
|
+
fn: t,
|
|
1255
|
+
last: null,
|
|
1256
|
+
next: null,
|
|
1257
|
+
parent: n,
|
|
1258
|
+
b: n && n.b,
|
|
1259
|
+
prev: null,
|
|
1260
|
+
teardown: null,
|
|
1261
|
+
wv: 0,
|
|
1262
|
+
ac: null
|
|
1263
|
+
};
|
|
1264
|
+
if (o)
|
|
1265
|
+
try {
|
|
1266
|
+
_e(r);
|
|
1267
|
+
} catch (l) {
|
|
1268
|
+
throw H(r), l;
|
|
1269
|
+
}
|
|
1270
|
+
else t !== null && ct(r);
|
|
1271
|
+
var i = r;
|
|
1272
|
+
if (o && i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && // either `null`, or a singular child
|
|
1273
|
+
(i.f & he) === 0 && (i = i.first, (e & Mt) !== 0 && (e & Te) !== 0 && i !== null && (i.f |= Te)), i !== null && (i.parent = n, n !== null && Gr(i, n), _ !== null && (_.f & P) !== 0 && (e & Jt) === 0)) {
|
|
1274
|
+
var s = (
|
|
1275
|
+
/** @type {Derived} */
|
|
1276
|
+
_
|
|
1277
|
+
);
|
|
1278
|
+
(s.effects ?? (s.effects = [])).push(i);
|
|
1279
|
+
}
|
|
1280
|
+
return r;
|
|
1281
|
+
}
|
|
1282
|
+
function on() {
|
|
1283
|
+
return _ !== null && !ut;
|
|
1284
|
+
}
|
|
1285
|
+
function Fr(e) {
|
|
1286
|
+
const t = $t(bo, null, !1);
|
|
1287
|
+
return M(t, N), t.teardown = e, t;
|
|
1288
|
+
}
|
|
1289
|
+
function wn(e) {
|
|
1290
|
+
zr();
|
|
1291
|
+
var t = (
|
|
1292
|
+
/** @type {Effect} */
|
|
1293
|
+
S.f
|
|
1294
|
+
), o = !_ && (t & dt) !== 0 && (t & Se) === 0;
|
|
1295
|
+
if (o) {
|
|
1296
|
+
var n = (
|
|
1297
|
+
/** @type {ComponentContext} */
|
|
1298
|
+
tt
|
|
1299
|
+
);
|
|
1300
|
+
(n.e ?? (n.e = [])).push(e);
|
|
1301
|
+
} else
|
|
1302
|
+
return vi(e);
|
|
1303
|
+
}
|
|
1304
|
+
function vi(e) {
|
|
1305
|
+
return $t(ze | cr, e, !1);
|
|
1306
|
+
}
|
|
1307
|
+
function Ur(e) {
|
|
1308
|
+
ae.ensure();
|
|
1309
|
+
const t = $t(Jt | he, e, !0);
|
|
1310
|
+
return () => {
|
|
1311
|
+
H(t);
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
function Kr(e) {
|
|
1315
|
+
ae.ensure();
|
|
1316
|
+
const t = $t(Jt | he, e, !0);
|
|
1317
|
+
return (o = {}) => new Promise((n) => {
|
|
1318
|
+
o.outro ? fe(t, () => {
|
|
1319
|
+
H(t), n(void 0);
|
|
1320
|
+
}) : (H(t), n(void 0));
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
function gi(e) {
|
|
1324
|
+
return $t(ze, e, !1);
|
|
1325
|
+
}
|
|
1326
|
+
function Jr(e) {
|
|
1327
|
+
return $t(Xo | he, e, !0);
|
|
1328
|
+
}
|
|
1329
|
+
function nn(e, t = 0) {
|
|
1330
|
+
return $t(bo | t, e, !0);
|
|
1331
|
+
}
|
|
1332
|
+
function Ye(e, t = [], o = [], n = []) {
|
|
1333
|
+
Nr(n, t, o, (r) => {
|
|
1334
|
+
$t(bo, () => e(...r.map(b)), !0);
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
function Io(e, t = 0) {
|
|
1338
|
+
var o = $t(Mt | t, e, !0);
|
|
1339
|
+
return o;
|
|
1340
|
+
}
|
|
1341
|
+
function yt(e) {
|
|
1342
|
+
return $t(dt | he, e, !0);
|
|
1343
|
+
}
|
|
1344
|
+
function bi(e) {
|
|
1345
|
+
var t = e.teardown;
|
|
1346
|
+
if (t !== null) {
|
|
1347
|
+
const o = Kt, n = _;
|
|
1348
|
+
Tn(!0), ot(null);
|
|
1349
|
+
try {
|
|
1350
|
+
t.call(null);
|
|
1351
|
+
} finally {
|
|
1352
|
+
Tn(o), ot(n);
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
function rn(e, t = !1) {
|
|
1357
|
+
var o = e.first;
|
|
1358
|
+
for (e.first = e.last = null; o !== null; ) {
|
|
1359
|
+
const r = o.ac;
|
|
1360
|
+
r !== null && pi(() => {
|
|
1361
|
+
r.abort(oe);
|
|
1362
|
+
});
|
|
1363
|
+
var n = o.next;
|
|
1364
|
+
(o.f & Jt) !== 0 ? o.parent = null : H(o, t), o = n;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
function Zr(e) {
|
|
1368
|
+
for (var t = e.first; t !== null; ) {
|
|
1369
|
+
var o = t.next;
|
|
1370
|
+
(t.f & dt) === 0 && H(t), t = o;
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
function H(e, t = !0) {
|
|
1374
|
+
var o = !1;
|
|
1375
|
+
(t || (e.f & Zo) !== 0) && e.nodes !== null && e.nodes.end !== null && (Xr(
|
|
1376
|
+
e.nodes.start,
|
|
1377
|
+
/** @type {TemplateNode} */
|
|
1378
|
+
e.nodes.end
|
|
1379
|
+
), o = !0), rn(e, t && !o), Ge(e, 0), M(e, Vt);
|
|
1380
|
+
var n = e.nodes && e.nodes.t;
|
|
1381
|
+
if (n !== null)
|
|
1382
|
+
for (const i of n)
|
|
1383
|
+
i.stop();
|
|
1384
|
+
bi(e);
|
|
1385
|
+
var r = e.parent;
|
|
1386
|
+
r !== null && r.first !== null && mi(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
|
|
1387
|
+
}
|
|
1388
|
+
function Xr(e, t) {
|
|
1389
|
+
for (; e !== null; ) {
|
|
1390
|
+
var o = e === t ? null : /* @__PURE__ */ et(e);
|
|
1391
|
+
e.remove(), e = o;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
function mi(e) {
|
|
1395
|
+
var t = e.parent, o = e.prev, n = e.next;
|
|
1396
|
+
o !== null && (o.next = n), n !== null && (n.prev = o), t !== null && (t.first === e && (t.first = n), t.last === e && (t.last = o));
|
|
1397
|
+
}
|
|
1398
|
+
function fe(e, t, o = !0) {
|
|
1399
|
+
var n = [];
|
|
1400
|
+
yi(e, n, !0);
|
|
1401
|
+
var r = () => {
|
|
1402
|
+
o && H(e), t && t();
|
|
1403
|
+
}, i = n.length;
|
|
1404
|
+
if (i > 0) {
|
|
1405
|
+
var s = () => --i || r();
|
|
1406
|
+
for (var l of n)
|
|
1407
|
+
l.out(s);
|
|
1408
|
+
} else
|
|
1409
|
+
r();
|
|
1410
|
+
}
|
|
1411
|
+
function yi(e, t, o) {
|
|
1412
|
+
if ((e.f & J) === 0) {
|
|
1413
|
+
e.f ^= J;
|
|
1414
|
+
var n = e.nodes && e.nodes.t;
|
|
1415
|
+
if (n !== null)
|
|
1416
|
+
for (const l of n)
|
|
1417
|
+
(l.is_global || o) && t.push(l);
|
|
1418
|
+
for (var r = e.first; r !== null; ) {
|
|
1419
|
+
var i = r.next, s = (r.f & Te) !== 0 || // If this is a branch effect without a block effect parent,
|
|
1420
|
+
// it means the parent block effect was pruned. In that case,
|
|
1421
|
+
// transparency information was transferred to the branch effect.
|
|
1422
|
+
(r.f & dt) !== 0 && (e.f & Mt) !== 0;
|
|
1423
|
+
yi(r, t, s ? o : !1), r = i;
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
function sn(e) {
|
|
1428
|
+
wi(e, !0);
|
|
1429
|
+
}
|
|
1430
|
+
function wi(e, t) {
|
|
1431
|
+
if ((e.f & J) !== 0) {
|
|
1432
|
+
e.f ^= J, (e.f & N) === 0 && (M(e, q), ct(e));
|
|
1433
|
+
for (var o = e.first; o !== null; ) {
|
|
1434
|
+
var n = o.next, r = (o.f & Te) !== 0 || (o.f & dt) !== 0;
|
|
1435
|
+
wi(o, r ? t : !1), o = n;
|
|
1436
|
+
}
|
|
1437
|
+
var i = e.nodes && e.nodes.t;
|
|
1438
|
+
if (i !== null)
|
|
1439
|
+
for (const s of i)
|
|
1440
|
+
(s.is_global || t) && s.in();
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
function Ti(e, t) {
|
|
1444
|
+
if (e.nodes)
|
|
1445
|
+
for (var o = e.nodes.start, n = e.nodes.end; o !== null; ) {
|
|
1446
|
+
var r = o === n ? null : /* @__PURE__ */ et(o);
|
|
1447
|
+
t.append(o), o = r;
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
let ro = !1, Kt = !1;
|
|
1451
|
+
function Tn(e) {
|
|
1452
|
+
Kt = e;
|
|
1453
|
+
}
|
|
1454
|
+
let _ = null, ut = !1;
|
|
1455
|
+
function ot(e) {
|
|
1456
|
+
_ = e;
|
|
1457
|
+
}
|
|
1458
|
+
let S = null;
|
|
1459
|
+
function Tt(e) {
|
|
1460
|
+
S = e;
|
|
1461
|
+
}
|
|
1462
|
+
let Q = null;
|
|
1463
|
+
function $i(e) {
|
|
1464
|
+
_ !== null && (Q === null ? Q = [e] : Q.push(e));
|
|
1465
|
+
}
|
|
1466
|
+
let z = null, K = 0, Z = null;
|
|
1467
|
+
function Yr(e) {
|
|
1468
|
+
Z = e;
|
|
1469
|
+
}
|
|
1470
|
+
let Ii = 1, ie = 0, re = ie;
|
|
1471
|
+
function $n(e) {
|
|
1472
|
+
re = e;
|
|
1473
|
+
}
|
|
1474
|
+
function xi() {
|
|
1475
|
+
return ++Ii;
|
|
1476
|
+
}
|
|
1477
|
+
function Fe(e) {
|
|
1478
|
+
var t = e.f;
|
|
1479
|
+
if ((t & q) !== 0)
|
|
1480
|
+
return !0;
|
|
1481
|
+
if (t & P && (e.f &= ~se), (t & ht) !== 0) {
|
|
1482
|
+
for (var o = (
|
|
1483
|
+
/** @type {Value[]} */
|
|
1484
|
+
e.deps
|
|
1485
|
+
), n = o.length, r = 0; r < n; r++) {
|
|
1486
|
+
var i = o[r];
|
|
1487
|
+
if (Fe(
|
|
1488
|
+
/** @type {Derived} */
|
|
1489
|
+
i
|
|
1490
|
+
) && ii(
|
|
1491
|
+
/** @type {Derived} */
|
|
1492
|
+
i
|
|
1493
|
+
), i.wv > e.wv)
|
|
1494
|
+
return !0;
|
|
1495
|
+
}
|
|
1496
|
+
(t & Y) !== 0 && // During time traveling we don't want to reset the status so that
|
|
1497
|
+
// traversal of the graph in the other batches still happens
|
|
1498
|
+
ft === null && M(e, N);
|
|
1499
|
+
}
|
|
1500
|
+
return !1;
|
|
1501
|
+
}
|
|
1502
|
+
function _i(e, t, o = !0) {
|
|
1503
|
+
var n = e.reactions;
|
|
1504
|
+
if (n !== null && !(Q !== null && we.call(Q, e)))
|
|
1505
|
+
for (var r = 0; r < n.length; r++) {
|
|
1506
|
+
var i = n[r];
|
|
1507
|
+
(i.f & P) !== 0 ? _i(
|
|
1508
|
+
/** @type {Derived} */
|
|
1509
|
+
i,
|
|
1510
|
+
t,
|
|
1511
|
+
!1
|
|
1512
|
+
) : t === i && (o ? M(i, q) : (i.f & N) !== 0 && M(i, ht), ct(
|
|
1513
|
+
/** @type {Effect} */
|
|
1514
|
+
i
|
|
1515
|
+
));
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
function Si(e) {
|
|
1519
|
+
var t, o = z, n = K, r = Z, i = _, s = Q, l = tt, a = ut, c = re, f = e.f;
|
|
1520
|
+
z = /** @type {null | Value[]} */
|
|
1521
|
+
null, K = 0, Z = null, _ = (f & (dt | Jt)) === 0 ? e : null, Q = null, $e(e.ctx), ut = !1, re = ++ie, e.ac !== null && (pi(() => {
|
|
1522
|
+
e.ac.abort(oe);
|
|
1523
|
+
}), e.ac = null);
|
|
1524
|
+
try {
|
|
1525
|
+
e.f |= Mo;
|
|
1526
|
+
var p = (
|
|
1527
|
+
/** @type {Function} */
|
|
1528
|
+
e.fn
|
|
1529
|
+
), v = p();
|
|
1530
|
+
e.f |= Se;
|
|
1531
|
+
var d = e.deps, h = V?.is_fork;
|
|
1532
|
+
if (z !== null) {
|
|
1533
|
+
var m;
|
|
1534
|
+
if (h || Ge(e, K), d !== null && K > 0)
|
|
1535
|
+
for (d.length = K + z.length, m = 0; m < z.length; m++)
|
|
1536
|
+
d[K + m] = z[m];
|
|
1537
|
+
else
|
|
1538
|
+
e.deps = d = z;
|
|
1539
|
+
if (on() && (e.f & Y) !== 0)
|
|
1540
|
+
for (m = K; m < d.length; m++)
|
|
1541
|
+
((t = d[m]).reactions ?? (t.reactions = [])).push(e);
|
|
1542
|
+
} else !h && d !== null && K < d.length && (Ge(e, K), d.length = K);
|
|
1543
|
+
if (Gn() && Z !== null && !ut && d !== null && (e.f & (P | ht | q)) === 0)
|
|
1544
|
+
for (m = 0; m < /** @type {Source[]} */
|
|
1545
|
+
Z.length; m++)
|
|
1546
|
+
_i(
|
|
1547
|
+
Z[m],
|
|
1548
|
+
/** @type {Effect} */
|
|
1549
|
+
e
|
|
1550
|
+
);
|
|
1551
|
+
if (i !== null && i !== e) {
|
|
1552
|
+
if (ie++, i.deps !== null)
|
|
1553
|
+
for (let y = 0; y < n; y += 1)
|
|
1554
|
+
i.deps[y].rv = ie;
|
|
1555
|
+
if (o !== null)
|
|
1556
|
+
for (const y of o)
|
|
1557
|
+
y.rv = ie;
|
|
1558
|
+
Z !== null && (r === null ? r = Z : r.push(.../** @type {Source[]} */
|
|
1559
|
+
Z));
|
|
1560
|
+
}
|
|
1561
|
+
return (e.f & Ft) !== 0 && (e.f ^= Ft), v;
|
|
1562
|
+
} catch (y) {
|
|
1563
|
+
return Un(y);
|
|
1564
|
+
} finally {
|
|
1565
|
+
e.f ^= Mo, z = o, K = n, Z = r, _ = i, Q = s, $e(l), ut = a, re = c;
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
function Qr(e, t) {
|
|
1569
|
+
let o = t.reactions;
|
|
1570
|
+
if (o !== null) {
|
|
1571
|
+
var n = nr.call(o, e);
|
|
1572
|
+
if (n !== -1) {
|
|
1573
|
+
var r = o.length - 1;
|
|
1574
|
+
r === 0 ? o = t.reactions = null : (o[n] = o[r], o.pop());
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
if (o === null && (t.f & P) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1578
|
+
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1579
|
+
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1580
|
+
(z === null || !we.call(z, t))) {
|
|
1581
|
+
var i = (
|
|
1582
|
+
/** @type {Derived} */
|
|
1583
|
+
t
|
|
1584
|
+
);
|
|
1585
|
+
(i.f & Y) !== 0 && (i.f ^= Y, i.f &= ~se), Yo(i), Hr(i), Ge(i, 0);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
function Ge(e, t) {
|
|
1589
|
+
var o = e.deps;
|
|
1590
|
+
if (o !== null)
|
|
1591
|
+
for (var n = t; n < o.length; n++)
|
|
1592
|
+
Qr(e, o[n]);
|
|
1593
|
+
}
|
|
1594
|
+
function _e(e) {
|
|
1595
|
+
var t = e.f;
|
|
1596
|
+
if ((t & Vt) === 0) {
|
|
1597
|
+
M(e, N);
|
|
1598
|
+
var o = S, n = ro;
|
|
1599
|
+
S = e, ro = !0;
|
|
1600
|
+
try {
|
|
1601
|
+
(t & (Mt | qn)) !== 0 ? Zr(e) : rn(e), bi(e);
|
|
1602
|
+
var r = Si(e);
|
|
1603
|
+
e.teardown = typeof r == "function" ? r : null, e.wv = Ii;
|
|
1604
|
+
var i;
|
|
1605
|
+
or && kr && (e.f & q) !== 0 && e.deps;
|
|
1606
|
+
} finally {
|
|
1607
|
+
ro = n, S = o;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
function b(e) {
|
|
1612
|
+
var t = e.f, o = (t & P) !== 0;
|
|
1613
|
+
if (_ !== null && !ut) {
|
|
1614
|
+
var n = S !== null && (S.f & Vt) !== 0;
|
|
1615
|
+
if (!n && (Q === null || !we.call(Q, e))) {
|
|
1616
|
+
var r = _.deps;
|
|
1617
|
+
if ((_.f & Mo) !== 0)
|
|
1618
|
+
e.rv < ie && (e.rv = ie, z === null && r !== null && r[K] === e ? K++ : z === null ? z = [e] : z.push(e));
|
|
1619
|
+
else {
|
|
1620
|
+
(_.deps ?? (_.deps = [])).push(e);
|
|
1621
|
+
var i = e.reactions;
|
|
1622
|
+
i === null ? e.reactions = [_] : we.call(i, _) || i.push(_);
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
if (Kt && Ut.has(e))
|
|
1627
|
+
return Ut.get(e);
|
|
1628
|
+
if (o) {
|
|
1629
|
+
var s = (
|
|
1630
|
+
/** @type {Derived} */
|
|
1631
|
+
e
|
|
1632
|
+
);
|
|
1633
|
+
if (Kt) {
|
|
1634
|
+
var l = s.v;
|
|
1635
|
+
return ((s.f & N) === 0 && s.reactions !== null || Ci(s)) && (l = Qo(s)), Ut.set(s, l), l;
|
|
1636
|
+
}
|
|
1637
|
+
var a = (s.f & Y) === 0 && !ut && _ !== null && (ro || (_.f & Y) !== 0), c = (s.f & Se) === 0;
|
|
1638
|
+
Fe(s) && (a && (s.f |= Y), ii(s)), a && !c && (ri(s), ki(s));
|
|
1639
|
+
}
|
|
1640
|
+
if (ft?.has(e))
|
|
1641
|
+
return ft.get(e);
|
|
1642
|
+
if ((e.f & Ft) !== 0)
|
|
1643
|
+
throw e.v;
|
|
1644
|
+
return e.v;
|
|
1645
|
+
}
|
|
1646
|
+
function ki(e) {
|
|
1647
|
+
if (e.f |= Y, e.deps !== null)
|
|
1648
|
+
for (const t of e.deps)
|
|
1649
|
+
(t.reactions ?? (t.reactions = [])).push(e), (t.f & P) !== 0 && (t.f & Y) === 0 && (ri(
|
|
1650
|
+
/** @type {Derived} */
|
|
1651
|
+
t
|
|
1652
|
+
), ki(
|
|
1653
|
+
/** @type {Derived} */
|
|
1654
|
+
t
|
|
1655
|
+
));
|
|
1656
|
+
}
|
|
1657
|
+
function Ci(e) {
|
|
1658
|
+
if (e.v === j) return !0;
|
|
1659
|
+
if (e.deps === null) return !1;
|
|
1660
|
+
for (const t of e.deps)
|
|
1661
|
+
if (Ut.has(t) || (t.f & P) !== 0 && Ci(
|
|
1662
|
+
/** @type {Derived} */
|
|
1663
|
+
t
|
|
1664
|
+
))
|
|
1665
|
+
return !0;
|
|
1666
|
+
return !1;
|
|
1667
|
+
}
|
|
1668
|
+
function Ai(e) {
|
|
1669
|
+
var t = ut;
|
|
1670
|
+
try {
|
|
1671
|
+
return ut = !0, e();
|
|
1672
|
+
} finally {
|
|
1673
|
+
ut = t;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
const ge = /* @__PURE__ */ Symbol("events"), Li = /* @__PURE__ */ new Set(), Bo = /* @__PURE__ */ new Set();
|
|
1677
|
+
function Ee(e, t, o) {
|
|
1678
|
+
(t[ge] ?? (t[ge] = {}))[e] = o;
|
|
1679
|
+
}
|
|
1680
|
+
function ts(e) {
|
|
1681
|
+
for (var t = 0; t < e.length; t++)
|
|
1682
|
+
Li.add(e[t]);
|
|
1683
|
+
for (var o of Bo)
|
|
1684
|
+
o(e);
|
|
1685
|
+
}
|
|
1686
|
+
let In = null;
|
|
1687
|
+
function xn(e) {
|
|
1688
|
+
var t = this, o = (
|
|
1689
|
+
/** @type {Node} */
|
|
1690
|
+
t.ownerDocument
|
|
1691
|
+
), n = e.type, r = e.composedPath?.() || [], i = (
|
|
1692
|
+
/** @type {null | Element} */
|
|
1693
|
+
r[0] || e.target
|
|
1694
|
+
);
|
|
1695
|
+
In = e;
|
|
1696
|
+
var s = 0, l = In === e && e[ge];
|
|
1697
|
+
if (l) {
|
|
1698
|
+
var a = r.indexOf(l);
|
|
1699
|
+
if (a !== -1 && (t === document || t === /** @type {any} */
|
|
1700
|
+
window)) {
|
|
1701
|
+
e[ge] = t;
|
|
1702
|
+
return;
|
|
1703
|
+
}
|
|
1704
|
+
var c = r.indexOf(t);
|
|
1705
|
+
if (c === -1)
|
|
1706
|
+
return;
|
|
1707
|
+
a <= c && (s = a);
|
|
1708
|
+
}
|
|
1709
|
+
if (i = /** @type {Element} */
|
|
1710
|
+
r[s] || e.target, i !== t) {
|
|
1711
|
+
uo(e, "currentTarget", {
|
|
1712
|
+
configurable: !0,
|
|
1713
|
+
get() {
|
|
1714
|
+
return i || o;
|
|
1715
|
+
}
|
|
1716
|
+
});
|
|
1717
|
+
var f = _, p = S;
|
|
1718
|
+
ot(null), Tt(null);
|
|
1719
|
+
try {
|
|
1720
|
+
for (var v, d = []; i !== null; ) {
|
|
1721
|
+
var h = i.assignedSlot || i.parentNode || /** @type {any} */
|
|
1722
|
+
i.host || null;
|
|
1723
|
+
try {
|
|
1724
|
+
var m = i[ge]?.[n];
|
|
1725
|
+
m != null && (!/** @type {any} */
|
|
1726
|
+
i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1727
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
1728
|
+
e.target === i) && m.call(i, e);
|
|
1729
|
+
} catch (y) {
|
|
1730
|
+
v ? d.push(y) : v = y;
|
|
1731
|
+
}
|
|
1732
|
+
if (e.cancelBubble || h === t || h === null)
|
|
1733
|
+
break;
|
|
1734
|
+
i = h;
|
|
1735
|
+
}
|
|
1736
|
+
if (v) {
|
|
1737
|
+
for (let y of d)
|
|
1738
|
+
queueMicrotask(() => {
|
|
1739
|
+
throw y;
|
|
1740
|
+
});
|
|
1741
|
+
throw v;
|
|
1742
|
+
}
|
|
1743
|
+
} finally {
|
|
1744
|
+
e[ge] = t, delete e.currentTarget, ot(f), Tt(p);
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
const es = (
|
|
1749
|
+
// We gotta write it like this because after downleveling the pure comment may end up in the wrong location
|
|
1750
|
+
globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
|
|
1751
|
+
/** @param {string} html */
|
|
1752
|
+
createHTML: (e) => e
|
|
1753
|
+
})
|
|
1754
|
+
);
|
|
1755
|
+
function os(e) {
|
|
1756
|
+
return (
|
|
1757
|
+
/** @type {string} */
|
|
1758
|
+
es?.createHTML(e) ?? e
|
|
1759
|
+
);
|
|
1760
|
+
}
|
|
1761
|
+
function ns(e, t = !1) {
|
|
1762
|
+
var o = tn("template");
|
|
1763
|
+
return e = e.replaceAll("<!>", "<!---->"), o.innerHTML = t ? os(e) : e, o.content;
|
|
1764
|
+
}
|
|
1765
|
+
function so(e, t) {
|
|
1766
|
+
var o = (
|
|
1767
|
+
/** @type {Effect} */
|
|
1768
|
+
S
|
|
1769
|
+
);
|
|
1770
|
+
o.nodes === null && (o.nodes = { start: e, end: t, a: null, t: null });
|
|
1771
|
+
}
|
|
1772
|
+
// @__NO_SIDE_EFFECTS__
|
|
1773
|
+
function Zt(e, t) {
|
|
1774
|
+
var o = (t & tr) !== 0, n = (t & er) !== 0, r, i = !e.startsWith("<!>");
|
|
1775
|
+
return () => {
|
|
1776
|
+
if (L)
|
|
1777
|
+
return so(E, null), E;
|
|
1778
|
+
r === void 0 && (r = ns(i ? e : "<!>" + e, !0), o || (r = /** @type {TemplateNode} */
|
|
1779
|
+
/* @__PURE__ */ ue(r)));
|
|
1780
|
+
var s = (
|
|
1781
|
+
/** @type {TemplateNode} */
|
|
1782
|
+
n || ci ? document.importNode(r, !0) : r.cloneNode(!0)
|
|
1783
|
+
);
|
|
1784
|
+
if (o) {
|
|
1785
|
+
var l = (
|
|
1786
|
+
/** @type {TemplateNode} */
|
|
1787
|
+
/* @__PURE__ */ ue(s)
|
|
1788
|
+
), a = (
|
|
1789
|
+
/** @type {TemplateNode} */
|
|
1790
|
+
s.lastChild
|
|
1791
|
+
);
|
|
1792
|
+
so(l, a);
|
|
1793
|
+
} else
|
|
1794
|
+
so(s, s);
|
|
1795
|
+
return s;
|
|
1796
|
+
};
|
|
1797
|
+
}
|
|
1798
|
+
function Ct(e, t) {
|
|
1799
|
+
if (L) {
|
|
1800
|
+
var o = (
|
|
1801
|
+
/** @type {Effect & { nodes: EffectNodes }} */
|
|
1802
|
+
S
|
|
1803
|
+
);
|
|
1804
|
+
((o.f & Se) === 0 || o.nodes.end === null) && (o.nodes.end = E), wo();
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
e !== null && e.before(
|
|
1808
|
+
/** @type {Node} */
|
|
1809
|
+
t
|
|
1810
|
+
);
|
|
1811
|
+
}
|
|
1812
|
+
const is = ["touchstart", "touchmove"];
|
|
1813
|
+
function rs(e) {
|
|
1814
|
+
return is.includes(e);
|
|
1815
|
+
}
|
|
1816
|
+
function _n(e, t) {
|
|
1817
|
+
var o = t == null ? "" : typeof t == "object" ? t + "" : t;
|
|
1818
|
+
o !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = o, e.nodeValue = o + "");
|
|
1819
|
+
}
|
|
1820
|
+
function Ei(e, t) {
|
|
1821
|
+
return Vi(e, t);
|
|
1822
|
+
}
|
|
1823
|
+
function ss(e, t) {
|
|
1824
|
+
Ho(), t.intro = t.intro ?? !1;
|
|
1825
|
+
const o = t.target, n = L, r = E;
|
|
1826
|
+
try {
|
|
1827
|
+
for (var i = /* @__PURE__ */ ue(o); i && (i.nodeType !== ke || /** @type {Comment} */
|
|
1828
|
+
i.data !== Ko); )
|
|
1829
|
+
i = /* @__PURE__ */ et(i);
|
|
1830
|
+
if (!i)
|
|
1831
|
+
throw ye;
|
|
1832
|
+
at(!0), B(
|
|
1833
|
+
/** @type {Comment} */
|
|
1834
|
+
i
|
|
1835
|
+
);
|
|
1836
|
+
const s = Vi(e, { ...t, anchor: i });
|
|
1837
|
+
return at(!1), /** @type {Exports} */
|
|
1838
|
+
s;
|
|
1839
|
+
} catch (s) {
|
|
1840
|
+
if (s instanceof Error && s.message.split(`
|
|
1841
|
+
`).some((l) => l.startsWith("https://svelte.dev/e/")))
|
|
1842
|
+
throw s;
|
|
1843
|
+
return s !== ye && console.warn("Failed to hydrate: ", s), t.recover === !1 && yr(), Ho(), hi(o), at(!1), Ei(e, t);
|
|
1844
|
+
} finally {
|
|
1845
|
+
at(n), B(r);
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
const Qe = /* @__PURE__ */ new Map();
|
|
1849
|
+
function Vi(e, { target: t, anchor: o, props: n = {}, events: r, context: i, intro: s = !0 }) {
|
|
1850
|
+
Ho();
|
|
1851
|
+
var l = void 0, a = Kr(() => {
|
|
1852
|
+
var c = o ?? t.appendChild(wt());
|
|
1853
|
+
Or(
|
|
1854
|
+
/** @type {TemplateNode} */
|
|
1855
|
+
c,
|
|
1856
|
+
{
|
|
1857
|
+
pending: () => {
|
|
1858
|
+
}
|
|
1859
|
+
},
|
|
1860
|
+
(v) => {
|
|
1861
|
+
Bn({});
|
|
1862
|
+
var d = (
|
|
1863
|
+
/** @type {ComponentContext} */
|
|
1864
|
+
tt
|
|
1865
|
+
);
|
|
1866
|
+
if (i && (d.c = i), r && (n.$$events = r), L && so(
|
|
1867
|
+
/** @type {TemplateNode} */
|
|
1868
|
+
v,
|
|
1869
|
+
null
|
|
1870
|
+
), l = e(v, n) || {}, L && (S.nodes.end = E, E === null || E.nodeType !== ke || /** @type {Comment} */
|
|
1871
|
+
E.data !== Jo))
|
|
1872
|
+
throw yo(), ye;
|
|
1873
|
+
zn();
|
|
1874
|
+
}
|
|
1875
|
+
);
|
|
1876
|
+
var f = /* @__PURE__ */ new Set(), p = (v) => {
|
|
1877
|
+
for (var d = 0; d < v.length; d++) {
|
|
1878
|
+
var h = v[d];
|
|
1879
|
+
if (!f.has(h)) {
|
|
1880
|
+
f.add(h);
|
|
1881
|
+
var m = rs(h);
|
|
1882
|
+
for (const I of [t, document]) {
|
|
1883
|
+
var y = Qe.get(I);
|
|
1884
|
+
y === void 0 && (y = /* @__PURE__ */ new Map(), Qe.set(I, y));
|
|
1885
|
+
var k = y.get(h);
|
|
1886
|
+
k === void 0 ? (I.addEventListener(h, xn, { passive: m }), y.set(h, 1)) : y.set(h, k + 1);
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
return p(go(Li)), Bo.add(p), () => {
|
|
1892
|
+
for (var v of f)
|
|
1893
|
+
for (const m of [t, document]) {
|
|
1894
|
+
var d = (
|
|
1895
|
+
/** @type {Map<string, number>} */
|
|
1896
|
+
Qe.get(m)
|
|
1897
|
+
), h = (
|
|
1898
|
+
/** @type {number} */
|
|
1899
|
+
d.get(v)
|
|
1900
|
+
);
|
|
1901
|
+
--h == 0 ? (m.removeEventListener(v, xn), d.delete(v), d.size === 0 && Qe.delete(m)) : d.set(v, h);
|
|
1902
|
+
}
|
|
1903
|
+
Bo.delete(p), c !== o && c.parentNode?.removeChild(c);
|
|
1904
|
+
};
|
|
1905
|
+
});
|
|
1906
|
+
return zo.set(l, a), l;
|
|
1907
|
+
}
|
|
1908
|
+
let zo = /* @__PURE__ */ new WeakMap();
|
|
1909
|
+
function ls(e, t) {
|
|
1910
|
+
const o = zo.get(e);
|
|
1911
|
+
return o ? (zo.delete(e), o(t)) : Promise.resolve();
|
|
1912
|
+
}
|
|
1913
|
+
var bt, Wt, mt, de, lo, Go, Mi;
|
|
1914
|
+
class as {
|
|
1915
|
+
/**
|
|
1916
|
+
* @param {TemplateNode} anchor
|
|
1917
|
+
* @param {boolean} transition
|
|
1918
|
+
*/
|
|
1919
|
+
constructor(t, o = !0) {
|
|
1920
|
+
$(this, "anchor"), x(this, bt, /* @__PURE__ */ new Map()), x(this, Wt, /* @__PURE__ */ new Map()), x(this, mt, /* @__PURE__ */ new Map()), x(this, de, /* @__PURE__ */ new Set()), x(this, lo, !0), x(this, Go, () => {
|
|
1921
|
+
var n = (
|
|
1922
|
+
/** @type {Batch} */
|
|
1923
|
+
V
|
|
1924
|
+
);
|
|
1925
|
+
if (u(this, bt).has(n)) {
|
|
1926
|
+
var r = (
|
|
1927
|
+
/** @type {Key} */
|
|
1928
|
+
u(this, bt).get(n)
|
|
1929
|
+
), i = u(this, Wt).get(r);
|
|
1930
|
+
if (i)
|
|
1931
|
+
sn(i), u(this, de).delete(r);
|
|
1932
|
+
else {
|
|
1933
|
+
var s = u(this, mt).get(r);
|
|
1934
|
+
s && (u(this, Wt).set(r, s.effect), u(this, mt).delete(r), s.fragment.lastChild.remove(), this.anchor.before(s.fragment), i = s.effect);
|
|
1935
|
+
}
|
|
1936
|
+
for (const [l, a] of u(this, bt)) {
|
|
1937
|
+
if (u(this, bt).delete(l), l === n)
|
|
1938
|
+
break;
|
|
1939
|
+
const c = u(this, mt).get(a);
|
|
1940
|
+
c && (H(c.effect), u(this, mt).delete(a));
|
|
1941
|
+
}
|
|
1942
|
+
for (const [l, a] of u(this, Wt)) {
|
|
1943
|
+
if (l === r || u(this, de).has(l)) continue;
|
|
1944
|
+
const c = () => {
|
|
1945
|
+
if (Array.from(u(this, bt).values()).includes(l)) {
|
|
1946
|
+
var f = document.createDocumentFragment();
|
|
1947
|
+
Ti(a, f), f.append(wt()), u(this, mt).set(l, { effect: a, fragment: f });
|
|
1948
|
+
} else
|
|
1949
|
+
H(a);
|
|
1950
|
+
u(this, de).delete(l), u(this, Wt).delete(l);
|
|
1951
|
+
};
|
|
1952
|
+
u(this, lo) || !i ? (u(this, de).add(l), fe(a, c, !1)) : c();
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
}), x(this, Mi, (n) => {
|
|
1956
|
+
u(this, bt).delete(n);
|
|
1957
|
+
const r = Array.from(u(this, bt).values());
|
|
1958
|
+
for (const [i, s] of u(this, mt))
|
|
1959
|
+
r.includes(i) || (H(s.effect), u(this, mt).delete(i));
|
|
1960
|
+
}), this.anchor = t, T(this, lo, o);
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
*
|
|
1964
|
+
* @param {any} key
|
|
1965
|
+
* @param {null | ((target: TemplateNode) => void)} fn
|
|
1966
|
+
*/
|
|
1967
|
+
ensure(t, o) {
|
|
1968
|
+
var n = (
|
|
1969
|
+
/** @type {Batch} */
|
|
1970
|
+
V
|
|
1971
|
+
), r = di();
|
|
1972
|
+
o && !u(this, Wt).has(t) && !u(this, mt).has(t) && u(this, Wt).set(
|
|
1973
|
+
t,
|
|
1974
|
+
yt(() => o(this.anchor))
|
|
1975
|
+
), u(this, bt).set(n, t), r || (L && (this.anchor = E), u(this, Go).call(this));
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
bt = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new WeakMap(), lo = /* @__PURE__ */ new WeakMap(), Go = /* @__PURE__ */ new WeakMap(), Mi = /* @__PURE__ */ new WeakMap();
|
|
1979
|
+
function Ve(e, t, o = !1) {
|
|
1980
|
+
L && wo();
|
|
1981
|
+
var n = new as(e), r = o ? Te : 0;
|
|
1982
|
+
function i(s, l) {
|
|
1983
|
+
if (L) {
|
|
1984
|
+
const f = Wn(e);
|
|
1985
|
+
var a;
|
|
1986
|
+
if (f === Ko ? a = 0 : f === vo ? a = !1 : a = parseInt(f.substring(1)), s !== a) {
|
|
1987
|
+
var c = fo();
|
|
1988
|
+
B(c), n.anchor = c, at(!1), n.ensure(s, l), at(!0);
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
n.ensure(s, l);
|
|
1993
|
+
}
|
|
1994
|
+
Io(() => {
|
|
1995
|
+
var s = !1;
|
|
1996
|
+
t((l, a = 0) => {
|
|
1997
|
+
s = !0, i(a, l);
|
|
1998
|
+
}), s || i(!1, null);
|
|
1999
|
+
}, r);
|
|
2000
|
+
}
|
|
2001
|
+
function cs(e, t) {
|
|
2002
|
+
return t;
|
|
2003
|
+
}
|
|
2004
|
+
function us(e, t, o) {
|
|
2005
|
+
for (var n = [], r = t.length, i, s = t.length, l = 0; l < r; l++) {
|
|
2006
|
+
let p = t[l];
|
|
2007
|
+
fe(
|
|
2008
|
+
p,
|
|
2009
|
+
() => {
|
|
2010
|
+
if (i) {
|
|
2011
|
+
if (i.pending.delete(p), i.done.add(p), i.pending.size === 0) {
|
|
2012
|
+
var v = (
|
|
2013
|
+
/** @type {Set<EachOutroGroup>} */
|
|
2014
|
+
e.outrogroups
|
|
2015
|
+
);
|
|
2016
|
+
Fo(go(i.done)), v.delete(i), v.size === 0 && (e.outrogroups = null);
|
|
2017
|
+
}
|
|
2018
|
+
} else
|
|
2019
|
+
s -= 1;
|
|
2020
|
+
},
|
|
2021
|
+
!1
|
|
2022
|
+
);
|
|
2023
|
+
}
|
|
2024
|
+
if (s === 0) {
|
|
2025
|
+
var a = n.length === 0 && o !== null;
|
|
2026
|
+
if (a) {
|
|
2027
|
+
var c = (
|
|
2028
|
+
/** @type {Element} */
|
|
2029
|
+
o
|
|
2030
|
+
), f = (
|
|
2031
|
+
/** @type {Element} */
|
|
2032
|
+
c.parentNode
|
|
2033
|
+
);
|
|
2034
|
+
hi(f), f.append(c), e.items.clear();
|
|
2035
|
+
}
|
|
2036
|
+
Fo(t, !a);
|
|
2037
|
+
} else
|
|
2038
|
+
i = {
|
|
2039
|
+
pending: new Set(t),
|
|
2040
|
+
done: /* @__PURE__ */ new Set()
|
|
2041
|
+
}, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(i);
|
|
2042
|
+
}
|
|
2043
|
+
function Fo(e, t = !0) {
|
|
2044
|
+
for (var o = 0; o < e.length; o++)
|
|
2045
|
+
H(e[o], t);
|
|
2046
|
+
}
|
|
2047
|
+
var to;
|
|
2048
|
+
function fs(e, t, o, n, r, i = null) {
|
|
2049
|
+
var s = e, l = /* @__PURE__ */ new Map();
|
|
2050
|
+
L && wo();
|
|
2051
|
+
var a = null, c = /* @__PURE__ */ qr(() => {
|
|
2052
|
+
var m = o();
|
|
2053
|
+
return Nn(m) ? m : m == null ? [] : go(m);
|
|
2054
|
+
}), f, p = !0;
|
|
2055
|
+
function v() {
|
|
2056
|
+
h.fallback = a, hs(h, f, s, t, n), a !== null && (f.length === 0 ? (a.f & Gt) === 0 ? sn(a) : (a.f ^= Gt, qe(a, null, s)) : fe(a, () => {
|
|
2057
|
+
a = null;
|
|
2058
|
+
}));
|
|
2059
|
+
}
|
|
2060
|
+
var d = Io(() => {
|
|
2061
|
+
f = /** @type {V[]} */
|
|
2062
|
+
b(c);
|
|
2063
|
+
var m = f.length;
|
|
2064
|
+
let y = !1;
|
|
2065
|
+
if (L) {
|
|
2066
|
+
var k = Wn(s) === vo;
|
|
2067
|
+
k !== (m === 0) && (s = fo(), B(s), at(!1), y = !0);
|
|
2068
|
+
}
|
|
2069
|
+
for (var I = /* @__PURE__ */ new Set(), vt = (
|
|
2070
|
+
/** @type {Batch} */
|
|
2071
|
+
V
|
|
2072
|
+
), xt = di(), W = 0; W < m; W += 1) {
|
|
2073
|
+
L && E.nodeType === ke && /** @type {Comment} */
|
|
2074
|
+
E.data === Jo && (s = /** @type {Comment} */
|
|
2075
|
+
E, y = !0, at(!1));
|
|
2076
|
+
var _t = f[W], gt = n(_t, W), O = p ? null : l.get(gt);
|
|
2077
|
+
O ? (O.v && xe(O.v, _t), O.i && xe(O.i, W), xt && vt.unskip_effect(O.e)) : (O = ds(
|
|
2078
|
+
l,
|
|
2079
|
+
p ? s : to ?? (to = wt()),
|
|
2080
|
+
_t,
|
|
2081
|
+
gt,
|
|
2082
|
+
W,
|
|
2083
|
+
r,
|
|
2084
|
+
t,
|
|
2085
|
+
o
|
|
2086
|
+
), p || (O.e.f |= Gt), l.set(gt, O)), I.add(gt);
|
|
2087
|
+
}
|
|
2088
|
+
if (m === 0 && i && !a && (p ? a = yt(() => i(s)) : (a = yt(() => i(to ?? (to = wt()))), a.f |= Gt)), m > I.size && pr(), L && m > 0 && B(fo()), !p)
|
|
2089
|
+
if (xt) {
|
|
2090
|
+
for (const [So, ko] of l)
|
|
2091
|
+
I.has(So) || vt.skip_effect(ko.e);
|
|
2092
|
+
vt.oncommit(v), vt.ondiscard(() => {
|
|
2093
|
+
});
|
|
2094
|
+
} else
|
|
2095
|
+
v();
|
|
2096
|
+
y && at(!0), b(c);
|
|
2097
|
+
}), h = { effect: d, items: l, outrogroups: null, fallback: a };
|
|
2098
|
+
p = !1, L && (s = E);
|
|
2099
|
+
}
|
|
2100
|
+
function Me(e) {
|
|
2101
|
+
for (; e !== null && (e.f & dt) === 0; )
|
|
2102
|
+
e = e.next;
|
|
2103
|
+
return e;
|
|
2104
|
+
}
|
|
2105
|
+
function hs(e, t, o, n, r) {
|
|
2106
|
+
var i = t.length, s = e.items, l = Me(e.effect.first), a, c = null, f = [], p = [], v, d, h, m;
|
|
2107
|
+
for (m = 0; m < i; m += 1) {
|
|
2108
|
+
if (v = t[m], d = r(v, m), h = /** @type {EachItem} */
|
|
2109
|
+
s.get(d).e, e.outrogroups !== null)
|
|
2110
|
+
for (const O of e.outrogroups)
|
|
2111
|
+
O.pending.delete(h), O.done.delete(h);
|
|
2112
|
+
if ((h.f & Gt) !== 0)
|
|
2113
|
+
if (h.f ^= Gt, h === l)
|
|
2114
|
+
qe(h, null, o);
|
|
2115
|
+
else {
|
|
2116
|
+
var y = c ? c.next : l;
|
|
2117
|
+
h === e.effect.last && (e.effect.last = h.prev), h.prev && (h.prev.next = h.next), h.next && (h.next.prev = h.prev), Rt(e, c, h), Rt(e, h, y), qe(h, y, o), c = h, f = [], p = [], l = Me(c.next);
|
|
2118
|
+
continue;
|
|
2119
|
+
}
|
|
2120
|
+
if ((h.f & J) !== 0 && sn(h), h !== l) {
|
|
2121
|
+
if (a !== void 0 && a.has(h)) {
|
|
2122
|
+
if (f.length < p.length) {
|
|
2123
|
+
var k = p[0], I;
|
|
2124
|
+
c = k.prev;
|
|
2125
|
+
var vt = f[0], xt = f[f.length - 1];
|
|
2126
|
+
for (I = 0; I < f.length; I += 1)
|
|
2127
|
+
qe(f[I], k, o);
|
|
2128
|
+
for (I = 0; I < p.length; I += 1)
|
|
2129
|
+
a.delete(p[I]);
|
|
2130
|
+
Rt(e, vt.prev, xt.next), Rt(e, c, vt), Rt(e, xt, k), l = k, c = xt, m -= 1, f = [], p = [];
|
|
2131
|
+
} else
|
|
2132
|
+
a.delete(h), qe(h, l, o), Rt(e, h.prev, h.next), Rt(e, h, c === null ? e.effect.first : c.next), Rt(e, c, h), c = h;
|
|
2133
|
+
continue;
|
|
2134
|
+
}
|
|
2135
|
+
for (f = [], p = []; l !== null && l !== h; )
|
|
2136
|
+
(a ?? (a = /* @__PURE__ */ new Set())).add(l), p.push(l), l = Me(l.next);
|
|
2137
|
+
if (l === null)
|
|
2138
|
+
continue;
|
|
2139
|
+
}
|
|
2140
|
+
(h.f & Gt) === 0 && f.push(h), c = h, l = Me(h.next);
|
|
2141
|
+
}
|
|
2142
|
+
if (e.outrogroups !== null) {
|
|
2143
|
+
for (const O of e.outrogroups)
|
|
2144
|
+
O.pending.size === 0 && (Fo(go(O.done)), e.outrogroups?.delete(O));
|
|
2145
|
+
e.outrogroups.size === 0 && (e.outrogroups = null);
|
|
2146
|
+
}
|
|
2147
|
+
if (l !== null || a !== void 0) {
|
|
2148
|
+
var W = [];
|
|
2149
|
+
if (a !== void 0)
|
|
2150
|
+
for (h of a)
|
|
2151
|
+
(h.f & J) === 0 && W.push(h);
|
|
2152
|
+
for (; l !== null; )
|
|
2153
|
+
(l.f & J) === 0 && l !== e.fallback && W.push(l), l = Me(l.next);
|
|
2154
|
+
var _t = W.length;
|
|
2155
|
+
if (_t > 0) {
|
|
2156
|
+
var gt = null;
|
|
2157
|
+
us(e, W, gt);
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
function ds(e, t, o, n, r, i, s, l) {
|
|
2162
|
+
var a = (s & Xi) !== 0 ? (s & Qi) === 0 ? /* @__PURE__ */ li(o, !1, !1) : ce(o) : null, c = (s & Yi) !== 0 ? ce(r) : null;
|
|
2163
|
+
return {
|
|
2164
|
+
v: a,
|
|
2165
|
+
i: c,
|
|
2166
|
+
e: yt(() => (i(t, a ?? o, c ?? r, l), () => {
|
|
2167
|
+
e.delete(n);
|
|
2168
|
+
}))
|
|
2169
|
+
};
|
|
2170
|
+
}
|
|
2171
|
+
function qe(e, t, o) {
|
|
2172
|
+
if (e.nodes)
|
|
2173
|
+
for (var n = e.nodes.start, r = e.nodes.end, i = t && (t.f & Gt) === 0 ? (
|
|
2174
|
+
/** @type {EffectNodes} */
|
|
2175
|
+
t.nodes.start
|
|
2176
|
+
) : o; n !== null; ) {
|
|
2177
|
+
var s = (
|
|
2178
|
+
/** @type {TemplateNode} */
|
|
2179
|
+
/* @__PURE__ */ et(n)
|
|
2180
|
+
);
|
|
2181
|
+
if (i.before(n), n === r)
|
|
2182
|
+
return;
|
|
2183
|
+
n = s;
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
function Rt(e, t, o) {
|
|
2187
|
+
t === null ? e.effect.first = o : t.next = o, o === null ? e.effect.last = t : o.prev = t;
|
|
2188
|
+
}
|
|
2189
|
+
function ps(e, t) {
|
|
2190
|
+
let o = null, n = L;
|
|
2191
|
+
var r;
|
|
2192
|
+
if (L) {
|
|
2193
|
+
o = E;
|
|
2194
|
+
for (var i = /* @__PURE__ */ ue(document.head); i !== null && (i.nodeType !== ke || /** @type {Comment} */
|
|
2195
|
+
i.data !== e); )
|
|
2196
|
+
i = /* @__PURE__ */ et(i);
|
|
2197
|
+
if (i === null)
|
|
2198
|
+
at(!1);
|
|
2199
|
+
else {
|
|
2200
|
+
var s = (
|
|
2201
|
+
/** @type {TemplateNode} */
|
|
2202
|
+
/* @__PURE__ */ et(i)
|
|
2203
|
+
);
|
|
2204
|
+
i.remove(), B(s);
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
L || (r = document.head.appendChild(wt()));
|
|
2208
|
+
try {
|
|
2209
|
+
Io(() => t(r), Zo);
|
|
2210
|
+
} finally {
|
|
2211
|
+
n && (at(!0), B(
|
|
2212
|
+
/** @type {TemplateNode} */
|
|
2213
|
+
o
|
|
2214
|
+
));
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
function vs(e, t) {
|
|
2218
|
+
gi(() => {
|
|
2219
|
+
var o = e.getRootNode(), n = (
|
|
2220
|
+
/** @type {ShadowRoot} */
|
|
2221
|
+
o.host ? (
|
|
2222
|
+
/** @type {ShadowRoot} */
|
|
2223
|
+
o
|
|
2224
|
+
) : (
|
|
2225
|
+
/** @type {Document} */
|
|
2226
|
+
o.head ?? /** @type {Document} */
|
|
2227
|
+
o.ownerDocument.head
|
|
2228
|
+
)
|
|
2229
|
+
);
|
|
2230
|
+
if (!n.querySelector("#" + t.hash)) {
|
|
2231
|
+
const r = tn("style");
|
|
2232
|
+
r.id = t.hash, r.textContent = t.code, n.appendChild(r);
|
|
2233
|
+
}
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2236
|
+
function gs(e, t) {
|
|
2237
|
+
return e == null ? null : String(e);
|
|
2238
|
+
}
|
|
2239
|
+
function Sn(e, t, o, n) {
|
|
2240
|
+
var r = e.__style;
|
|
2241
|
+
if (L || r !== t) {
|
|
2242
|
+
var i = gs(t);
|
|
2243
|
+
(!L || i !== e.getAttribute("style")) && (i == null ? e.removeAttribute("style") : e.style.cssText = i), e.__style = t;
|
|
2244
|
+
}
|
|
2245
|
+
return n;
|
|
2246
|
+
}
|
|
2247
|
+
const bs = /* @__PURE__ */ Symbol("is custom element"), ms = /* @__PURE__ */ Symbol("is html"), ys = hr ? "link" : "LINK";
|
|
2248
|
+
function kn(e, t, o, n) {
|
|
2249
|
+
var r = ws(e);
|
|
2250
|
+
L && (r[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ys) || r[t] !== (r[t] = o) && (t === "loading" && (e[fr] = o), o == null ? e.removeAttribute(t) : typeof o != "string" && Ts(e).includes(t) ? e[t] = o : e.setAttribute(t, o));
|
|
2251
|
+
}
|
|
2252
|
+
function ws(e) {
|
|
2253
|
+
return (
|
|
2254
|
+
/** @type {Record<string | symbol, unknown>} **/
|
|
2255
|
+
// @ts-expect-error
|
|
2256
|
+
e.__attributes ?? (e.__attributes = {
|
|
2257
|
+
[bs]: e.nodeName.includes("-"),
|
|
2258
|
+
[ms]: e.namespaceURI === Rn
|
|
2259
|
+
})
|
|
2260
|
+
);
|
|
2261
|
+
}
|
|
2262
|
+
var Cn = /* @__PURE__ */ new Map();
|
|
2263
|
+
function Ts(e) {
|
|
2264
|
+
var t = e.getAttribute("is") || e.nodeName, o = Cn.get(t);
|
|
2265
|
+
if (o) return o;
|
|
2266
|
+
Cn.set(t, o = []);
|
|
2267
|
+
for (var n, r = e, i = Element.prototype; i !== r; ) {
|
|
2268
|
+
n = ir(r);
|
|
2269
|
+
for (var s in n)
|
|
2270
|
+
n[s].set && o.push(s);
|
|
2271
|
+
r = jn(r);
|
|
2272
|
+
}
|
|
2273
|
+
return o;
|
|
2274
|
+
}
|
|
2275
|
+
function An(e, t) {
|
|
2276
|
+
return e === t || e?.[eo] === t;
|
|
2277
|
+
}
|
|
2278
|
+
function Ln(e = {}, t, o, n) {
|
|
2279
|
+
return gi(() => {
|
|
2280
|
+
var r, i;
|
|
2281
|
+
return nn(() => {
|
|
2282
|
+
r = i, i = [], Ai(() => {
|
|
2283
|
+
e !== o(...i) && (t(e, ...i), r && An(o(...r), e) && t(null, ...r));
|
|
2284
|
+
});
|
|
2285
|
+
}), () => {
|
|
2286
|
+
le(() => {
|
|
2287
|
+
i && An(o(...i), e) && t(null, ...i);
|
|
2288
|
+
});
|
|
2289
|
+
};
|
|
2290
|
+
}), e;
|
|
2291
|
+
}
|
|
2292
|
+
function Eo(e, t, o, n) {
|
|
2293
|
+
var r = (
|
|
2294
|
+
/** @type {V} */
|
|
2295
|
+
n
|
|
2296
|
+
), i = !0, s = () => (i && (i = !1, r = /** @type {V} */
|
|
2297
|
+
n), r), l;
|
|
2298
|
+
l = /** @type {V} */
|
|
2299
|
+
e[t], l === void 0 && n !== void 0 && (l = s());
|
|
2300
|
+
var a;
|
|
2301
|
+
a = () => {
|
|
2302
|
+
var v = (
|
|
2303
|
+
/** @type {V} */
|
|
2304
|
+
e[t]
|
|
2305
|
+
);
|
|
2306
|
+
return v === void 0 ? s() : (i = !0, v);
|
|
2307
|
+
};
|
|
2308
|
+
var c = !1, f = /* @__PURE__ */ $o(() => (c = !1, a())), p = (
|
|
2309
|
+
/** @type {Effect} */
|
|
2310
|
+
S
|
|
2311
|
+
);
|
|
2312
|
+
return (
|
|
2313
|
+
/** @type {() => V} */
|
|
2314
|
+
(function(v, d) {
|
|
2315
|
+
if (arguments.length > 0) {
|
|
2316
|
+
const h = d ? b(f) : v;
|
|
2317
|
+
return C(f, h), c = !0, r !== void 0 && (r = h), v;
|
|
2318
|
+
}
|
|
2319
|
+
return Kt && c || (p.f & Vt) !== 0 ? f.v : b(f);
|
|
2320
|
+
})
|
|
2321
|
+
);
|
|
2322
|
+
}
|
|
2323
|
+
function $s(e) {
|
|
2324
|
+
return new Is(e);
|
|
2325
|
+
}
|
|
2326
|
+
var Dt, rt;
|
|
2327
|
+
class Is {
|
|
2328
|
+
/**
|
|
2329
|
+
* @param {ComponentConstructorOptions & {
|
|
2330
|
+
* component: any;
|
|
2331
|
+
* }} options
|
|
2332
|
+
*/
|
|
2333
|
+
constructor(t) {
|
|
2334
|
+
x(this, Dt), x(this, rt);
|
|
2335
|
+
var o = /* @__PURE__ */ new Map(), n = (i, s) => {
|
|
2336
|
+
var l = /* @__PURE__ */ li(s, !1, !1);
|
|
2337
|
+
return o.set(i, l), l;
|
|
2338
|
+
};
|
|
2339
|
+
const r = new Proxy(
|
|
2340
|
+
{ ...t.props || {}, $$events: {} },
|
|
2341
|
+
{
|
|
2342
|
+
get(i, s) {
|
|
2343
|
+
return b(o.get(s) ?? n(s, Reflect.get(i, s)));
|
|
2344
|
+
},
|
|
2345
|
+
has(i, s) {
|
|
2346
|
+
return s === ur ? !0 : (b(o.get(s) ?? n(s, Reflect.get(i, s))), Reflect.has(i, s));
|
|
2347
|
+
},
|
|
2348
|
+
set(i, s, l) {
|
|
2349
|
+
return C(o.get(s) ?? n(s, l), l), Reflect.set(i, s, l);
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
);
|
|
2353
|
+
T(this, rt, (t.hydrate ? ss : Ei)(t.component, {
|
|
2354
|
+
target: t.target,
|
|
2355
|
+
anchor: t.anchor,
|
|
2356
|
+
props: r,
|
|
2357
|
+
context: t.context,
|
|
2358
|
+
intro: t.intro ?? !1,
|
|
2359
|
+
recover: t.recover
|
|
2360
|
+
})), (!t?.props?.$$host || t.sync === !1) && no(), T(this, Dt, r.$$events);
|
|
2361
|
+
for (const i of Object.keys(u(this, rt)))
|
|
2362
|
+
i === "$set" || i === "$destroy" || i === "$on" || uo(this, i, {
|
|
2363
|
+
get() {
|
|
2364
|
+
return u(this, rt)[i];
|
|
2365
|
+
},
|
|
2366
|
+
/** @param {any} value */
|
|
2367
|
+
set(s) {
|
|
2368
|
+
u(this, rt)[i] = s;
|
|
2369
|
+
},
|
|
2370
|
+
enumerable: !0
|
|
2371
|
+
});
|
|
2372
|
+
u(this, rt).$set = /** @param {Record<string, any>} next */
|
|
2373
|
+
(i) => {
|
|
2374
|
+
Object.assign(r, i);
|
|
2375
|
+
}, u(this, rt).$destroy = () => {
|
|
2376
|
+
ls(u(this, rt));
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
/** @param {Record<string, any>} props */
|
|
2380
|
+
$set(t) {
|
|
2381
|
+
u(this, rt).$set(t);
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* @param {string} event
|
|
2385
|
+
* @param {(...args: any[]) => any} callback
|
|
2386
|
+
* @returns {any}
|
|
2387
|
+
*/
|
|
2388
|
+
$on(t, o) {
|
|
2389
|
+
u(this, Dt)[t] = u(this, Dt)[t] || [];
|
|
2390
|
+
const n = (...r) => o.call(this, ...r);
|
|
2391
|
+
return u(this, Dt)[t].push(n), () => {
|
|
2392
|
+
u(this, Dt)[t] = u(this, Dt)[t].filter(
|
|
2393
|
+
/** @param {any} fn */
|
|
2394
|
+
(r) => r !== n
|
|
2395
|
+
);
|
|
2396
|
+
};
|
|
2397
|
+
}
|
|
2398
|
+
$destroy() {
|
|
2399
|
+
u(this, rt).$destroy();
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
Dt = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap();
|
|
2403
|
+
let Oi;
|
|
2404
|
+
typeof HTMLElement == "function" && (Oi = class extends HTMLElement {
|
|
2405
|
+
/**
|
|
2406
|
+
* @param {*} $$componentCtor
|
|
2407
|
+
* @param {*} $$slots
|
|
2408
|
+
* @param {ShadowRootInit | undefined} shadow_root_init
|
|
2409
|
+
*/
|
|
2410
|
+
constructor(e, t, o) {
|
|
2411
|
+
super(), $(this, "$$ctor"), $(this, "$$s"), $(this, "$$c"), $(this, "$$cn", !1), $(this, "$$d", {}), $(this, "$$r", !1), $(this, "$$p_d", {}), $(this, "$$l", {}), $(this, "$$l_u", /* @__PURE__ */ new Map()), $(this, "$$me"), $(this, "$$shadowRoot", null), this.$$ctor = e, this.$$s = t, o && (this.$$shadowRoot = this.attachShadow(o));
|
|
2412
|
+
}
|
|
2413
|
+
/**
|
|
2414
|
+
* @param {string} type
|
|
2415
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2416
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2417
|
+
*/
|
|
2418
|
+
addEventListener(e, t, o) {
|
|
2419
|
+
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
|
|
2420
|
+
const n = this.$$c.$on(e, t);
|
|
2421
|
+
this.$$l_u.set(t, n);
|
|
2422
|
+
}
|
|
2423
|
+
super.addEventListener(e, t, o);
|
|
2424
|
+
}
|
|
2425
|
+
/**
|
|
2426
|
+
* @param {string} type
|
|
2427
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2428
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2429
|
+
*/
|
|
2430
|
+
removeEventListener(e, t, o) {
|
|
2431
|
+
if (super.removeEventListener(e, t, o), this.$$c) {
|
|
2432
|
+
const n = this.$$l_u.get(t);
|
|
2433
|
+
n && (n(), this.$$l_u.delete(t));
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
async connectedCallback() {
|
|
2437
|
+
if (this.$$cn = !0, !this.$$c) {
|
|
2438
|
+
let e = function(n) {
|
|
2439
|
+
return (r) => {
|
|
2440
|
+
const i = tn("slot");
|
|
2441
|
+
n !== "default" && (i.name = n), Ct(r, i);
|
|
2442
|
+
};
|
|
2443
|
+
};
|
|
2444
|
+
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
2445
|
+
return;
|
|
2446
|
+
const t = {}, o = xs(this);
|
|
2447
|
+
for (const n of this.$$s)
|
|
2448
|
+
n in o && (n === "default" && !this.$$d.children ? (this.$$d.children = e(n), t.default = !0) : t[n] = e(n));
|
|
2449
|
+
for (const n of this.attributes) {
|
|
2450
|
+
const r = this.$$g_p(n.name);
|
|
2451
|
+
r in this.$$d || (this.$$d[r] = ao(r, n.value, this.$$p_d, "toProp"));
|
|
2452
|
+
}
|
|
2453
|
+
for (const n in this.$$p_d)
|
|
2454
|
+
!(n in this.$$d) && this[n] !== void 0 && (this.$$d[n] = this[n], delete this[n]);
|
|
2455
|
+
this.$$c = $s({
|
|
2456
|
+
component: this.$$ctor,
|
|
2457
|
+
target: this.$$shadowRoot || this,
|
|
2458
|
+
props: {
|
|
2459
|
+
...this.$$d,
|
|
2460
|
+
$$slots: t,
|
|
2461
|
+
$$host: this
|
|
2462
|
+
}
|
|
2463
|
+
}), this.$$me = Ur(() => {
|
|
2464
|
+
nn(() => {
|
|
2465
|
+
this.$$r = !0;
|
|
2466
|
+
for (const n of co(this.$$c)) {
|
|
2467
|
+
if (!this.$$p_d[n]?.reflect) continue;
|
|
2468
|
+
this.$$d[n] = this.$$c[n];
|
|
2469
|
+
const r = ao(
|
|
2470
|
+
n,
|
|
2471
|
+
this.$$d[n],
|
|
2472
|
+
this.$$p_d,
|
|
2473
|
+
"toAttribute"
|
|
2474
|
+
);
|
|
2475
|
+
r == null ? this.removeAttribute(this.$$p_d[n].attribute || n) : this.setAttribute(this.$$p_d[n].attribute || n, r);
|
|
2476
|
+
}
|
|
2477
|
+
this.$$r = !1;
|
|
2478
|
+
});
|
|
2479
|
+
});
|
|
2480
|
+
for (const n in this.$$l)
|
|
2481
|
+
for (const r of this.$$l[n]) {
|
|
2482
|
+
const i = this.$$c.$on(n, r);
|
|
2483
|
+
this.$$l_u.set(r, i);
|
|
2484
|
+
}
|
|
2485
|
+
this.$$l = {};
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
2489
|
+
// and setting attributes through setAttribute etc, this is helpful
|
|
2490
|
+
/**
|
|
2491
|
+
* @param {string} attr
|
|
2492
|
+
* @param {string} _oldValue
|
|
2493
|
+
* @param {string} newValue
|
|
2494
|
+
*/
|
|
2495
|
+
attributeChangedCallback(e, t, o) {
|
|
2496
|
+
this.$$r || (e = this.$$g_p(e), this.$$d[e] = ao(e, o, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
|
|
2497
|
+
}
|
|
2498
|
+
disconnectedCallback() {
|
|
2499
|
+
this.$$cn = !1, Promise.resolve().then(() => {
|
|
2500
|
+
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
/**
|
|
2504
|
+
* @param {string} attribute_name
|
|
2505
|
+
*/
|
|
2506
|
+
$$g_p(e) {
|
|
2507
|
+
return co(this.$$p_d).find(
|
|
2508
|
+
(t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e
|
|
2509
|
+
) || e;
|
|
2510
|
+
}
|
|
2511
|
+
});
|
|
2512
|
+
function ao(e, t, o, n) {
|
|
2513
|
+
const r = o[e]?.type;
|
|
2514
|
+
if (t = r === "Boolean" && typeof t != "boolean" ? t != null : t, !n || !o[e])
|
|
2515
|
+
return t;
|
|
2516
|
+
if (n === "toAttribute")
|
|
2517
|
+
switch (r) {
|
|
2518
|
+
case "Object":
|
|
2519
|
+
case "Array":
|
|
2520
|
+
return t == null ? null : JSON.stringify(t);
|
|
2521
|
+
case "Boolean":
|
|
2522
|
+
return t ? "" : null;
|
|
2523
|
+
case "Number":
|
|
2524
|
+
return t ?? null;
|
|
2525
|
+
default:
|
|
2526
|
+
return t;
|
|
2527
|
+
}
|
|
2528
|
+
else
|
|
2529
|
+
switch (r) {
|
|
2530
|
+
case "Object":
|
|
2531
|
+
case "Array":
|
|
2532
|
+
return t && JSON.parse(t);
|
|
2533
|
+
case "Boolean":
|
|
2534
|
+
return t;
|
|
2535
|
+
// conversion already handled above
|
|
2536
|
+
case "Number":
|
|
2537
|
+
return t != null ? +t : t;
|
|
2538
|
+
default:
|
|
2539
|
+
return t;
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
function xs(e) {
|
|
2543
|
+
const t = {};
|
|
2544
|
+
return e.childNodes.forEach((o) => {
|
|
2545
|
+
t[
|
|
2546
|
+
/** @type {Element} node */
|
|
2547
|
+
o.slot || "default"
|
|
2548
|
+
] = !0;
|
|
2549
|
+
}), t;
|
|
2550
|
+
}
|
|
2551
|
+
function _s(e, t, o, n, r, i) {
|
|
2552
|
+
let s = class extends Oi {
|
|
2553
|
+
constructor() {
|
|
2554
|
+
super(e, o, r), this.$$p_d = t;
|
|
2555
|
+
}
|
|
2556
|
+
static get observedAttributes() {
|
|
2557
|
+
return co(t).map(
|
|
2558
|
+
(l) => (t[l].attribute || l).toLowerCase()
|
|
2559
|
+
);
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
return co(t).forEach((l) => {
|
|
2563
|
+
uo(s.prototype, l, {
|
|
2564
|
+
get() {
|
|
2565
|
+
return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l];
|
|
2566
|
+
},
|
|
2567
|
+
set(a) {
|
|
2568
|
+
a = ao(l, a, t), this.$$d[l] = a;
|
|
2569
|
+
var c = this.$$c;
|
|
2570
|
+
if (c) {
|
|
2571
|
+
var f = be(c, l)?.get;
|
|
2572
|
+
f ? c[l] = a : c.$set({ [l]: a });
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
});
|
|
2576
|
+
}), n.forEach((l) => {
|
|
2577
|
+
uo(s.prototype, l, {
|
|
2578
|
+
get() {
|
|
2579
|
+
return this.$$c?.[l];
|
|
2580
|
+
}
|
|
2581
|
+
});
|
|
2582
|
+
}), e.element = /** @type {any} */
|
|
2583
|
+
s, s;
|
|
2584
|
+
}
|
|
2585
|
+
class Ss extends Event {
|
|
2586
|
+
constructor(t, o, n, r) {
|
|
2587
|
+
super("context-request", { bubbles: !0, composed: !0 }), $(this, "context"), $(this, "contextTarget"), $(this, "callback"), $(this, "subscribe"), this.context = t, this.contextTarget = o, this.callback = n, this.subscribe = r ?? !1;
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
class ks {
|
|
2591
|
+
constructor(t, o) {
|
|
2592
|
+
$(this, "host"), $(this, "context"), $(this, "subscribe"), $(this, "onValue"), $(this, "isConnected", !1), $(this, "unsubscribe"), $(this, "currentValue"), $(this, "handleValue", (n, r) => {
|
|
2593
|
+
r !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = r), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = n, this.onValue?.(n);
|
|
2594
|
+
}), this.host = t, this.context = o.context, this.subscribe = o.subscribe ?? !0, this.onValue = o.onValue;
|
|
2595
|
+
}
|
|
2596
|
+
connect() {
|
|
2597
|
+
this.isConnected || (this.isConnected = !0, this.requestValue());
|
|
2598
|
+
}
|
|
2599
|
+
disconnect() {
|
|
2600
|
+
this.isConnected && (this.isConnected = !1, this.unsubscribe?.(), this.unsubscribe = void 0);
|
|
2601
|
+
}
|
|
2602
|
+
get value() {
|
|
2603
|
+
return this.currentValue;
|
|
2604
|
+
}
|
|
2605
|
+
requestValue() {
|
|
2606
|
+
this.host.dispatchEvent(new Ss(this.context, this.host, this.handleValue, this.subscribe));
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
const Ri = (e) => e, Cs = Ri(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), As = Ri(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
|
|
2610
|
+
function Ni(e, t, o) {
|
|
2611
|
+
let n = !1;
|
|
2612
|
+
const r = new ks(e, {
|
|
2613
|
+
context: t,
|
|
2614
|
+
subscribe: !0,
|
|
2615
|
+
onValue: (c) => {
|
|
2616
|
+
n = !0, o(c);
|
|
2617
|
+
}
|
|
2618
|
+
});
|
|
2619
|
+
r.connect();
|
|
2620
|
+
const i = (c) => {
|
|
2621
|
+
c.context === t && r.requestValue();
|
|
2622
|
+
};
|
|
2623
|
+
e.addEventListener("context-provider", i);
|
|
2624
|
+
let s = 0;
|
|
2625
|
+
const l = 200, a = globalThis.setInterval(() => {
|
|
2626
|
+
if (n || s >= l) {
|
|
2627
|
+
globalThis.clearInterval(a);
|
|
2628
|
+
return;
|
|
2629
|
+
}
|
|
2630
|
+
s += 1, r.requestValue();
|
|
2631
|
+
}, 50);
|
|
2632
|
+
return () => {
|
|
2633
|
+
globalThis.clearInterval(a), e.removeEventListener("context-provider", i), r.disconnect();
|
|
2634
|
+
};
|
|
2635
|
+
}
|
|
2636
|
+
function Ls(e, t) {
|
|
2637
|
+
return Ni(e, Cs, t);
|
|
2638
|
+
}
|
|
2639
|
+
function Es(e, t) {
|
|
2640
|
+
return Ni(e, As, t);
|
|
2641
|
+
}
|
|
2642
|
+
var En;
|
|
2643
|
+
(function(e) {
|
|
2644
|
+
e.TTS_WORD = "tts-word", e.TTS_SENTENCE = "tts-sentence", e.ANNOTATION = "annotation";
|
|
2645
|
+
})(En || (En = {}));
|
|
2646
|
+
var Bt;
|
|
2647
|
+
(function(e) {
|
|
2648
|
+
e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange", e.UNDERLINE = "underline";
|
|
2649
|
+
})(Bt || (Bt = {}));
|
|
2650
|
+
const Vs = {
|
|
2651
|
+
tts: "textToSpeech",
|
|
2652
|
+
colorScheme: "theme"
|
|
2653
|
+
};
|
|
2654
|
+
function Ms(e) {
|
|
2655
|
+
const t = e.trim();
|
|
2656
|
+
return t ? Vs[t] || t : "";
|
|
2657
|
+
}
|
|
2658
|
+
class Os {
|
|
2659
|
+
constructor() {
|
|
2660
|
+
$(this, "tools", /* @__PURE__ */ new Map()), $(this, "pnpIndex", /* @__PURE__ */ new Map()), $(this, "componentOverrides", {}), $(this, "moduleLoaders", /* @__PURE__ */ new Map()), $(this, "loadedToolModules", /* @__PURE__ */ new Set()), $(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
|
|
2661
|
+
}
|
|
2662
|
+
/**
|
|
2663
|
+
* Normalize a single tool alias to canonical toolId.
|
|
2664
|
+
*/
|
|
2665
|
+
normalizeToolId(t) {
|
|
2666
|
+
return Ms(t);
|
|
2667
|
+
}
|
|
2668
|
+
/**
|
|
2669
|
+
* Normalize a list of tool aliases to canonical toolIds.
|
|
2670
|
+
*/
|
|
2671
|
+
normalizeToolIds(t) {
|
|
2672
|
+
return t.map((o) => this.normalizeToolId(o));
|
|
2673
|
+
}
|
|
2674
|
+
/**
|
|
2675
|
+
* Register a tool
|
|
2676
|
+
*
|
|
2677
|
+
* @param registration - Tool registration
|
|
2678
|
+
* @throws Error if toolId is already registered
|
|
2679
|
+
*/
|
|
2680
|
+
register(t) {
|
|
2681
|
+
if (this.tools.has(t.toolId))
|
|
2682
|
+
throw new Error(`Tool '${t.toolId}' is already registered`);
|
|
2683
|
+
if (this.tools.set(t.toolId, t), t.pnpSupportIds)
|
|
2684
|
+
for (const o of t.pnpSupportIds)
|
|
2685
|
+
this.pnpIndex.has(o) || this.pnpIndex.set(o, /* @__PURE__ */ new Set()), this.pnpIndex.get(o).add(t.toolId);
|
|
2686
|
+
}
|
|
2687
|
+
/**
|
|
2688
|
+
* Override an existing tool registration
|
|
2689
|
+
*
|
|
2690
|
+
* @param registration - New tool registration (must have existing toolId)
|
|
2691
|
+
*/
|
|
2692
|
+
override(t) {
|
|
2693
|
+
if (!this.tools.has(t.toolId))
|
|
2694
|
+
throw new Error(`Cannot override non-existent tool '${t.toolId}'`);
|
|
2695
|
+
const o = this.tools.get(t.toolId);
|
|
2696
|
+
if (o.pnpSupportIds)
|
|
2697
|
+
for (const n of o.pnpSupportIds)
|
|
2698
|
+
this.pnpIndex.get(n)?.delete(t.toolId);
|
|
2699
|
+
if (this.tools.set(t.toolId, t), t.pnpSupportIds)
|
|
2700
|
+
for (const n of t.pnpSupportIds)
|
|
2701
|
+
this.pnpIndex.has(n) || this.pnpIndex.set(n, /* @__PURE__ */ new Set()), this.pnpIndex.get(n).add(t.toolId);
|
|
2702
|
+
}
|
|
2703
|
+
/**
|
|
2704
|
+
* Unregister a tool
|
|
2705
|
+
*
|
|
2706
|
+
* @param toolId - Tool ID to remove
|
|
2707
|
+
*/
|
|
2708
|
+
unregister(t) {
|
|
2709
|
+
const o = this.tools.get(t);
|
|
2710
|
+
if (o) {
|
|
2711
|
+
if (o.pnpSupportIds)
|
|
2712
|
+
for (const n of o.pnpSupportIds)
|
|
2713
|
+
this.pnpIndex.get(n)?.delete(t);
|
|
2714
|
+
this.tools.delete(t);
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
/**
|
|
2718
|
+
* Get a tool registration by ID
|
|
2719
|
+
*
|
|
2720
|
+
* @param toolId - Tool ID
|
|
2721
|
+
* @returns Tool registration or undefined
|
|
2722
|
+
*/
|
|
2723
|
+
get(t) {
|
|
2724
|
+
return this.tools.get(t);
|
|
2725
|
+
}
|
|
2726
|
+
/**
|
|
2727
|
+
* Check if a tool is registered
|
|
2728
|
+
*
|
|
2729
|
+
* @param toolId - Tool ID
|
|
2730
|
+
* @returns true if registered
|
|
2731
|
+
*/
|
|
2732
|
+
has(t) {
|
|
2733
|
+
return this.tools.has(t);
|
|
2734
|
+
}
|
|
2735
|
+
/**
|
|
2736
|
+
* Get all registered tool IDs
|
|
2737
|
+
*
|
|
2738
|
+
* @returns Array of tool IDs
|
|
2739
|
+
*/
|
|
2740
|
+
getAllToolIds() {
|
|
2741
|
+
return Array.from(this.tools.keys());
|
|
2742
|
+
}
|
|
2743
|
+
/**
|
|
2744
|
+
* Get all tool registrations
|
|
2745
|
+
*
|
|
2746
|
+
* @returns Array of tool registrations
|
|
2747
|
+
*/
|
|
2748
|
+
getAllTools() {
|
|
2749
|
+
return Array.from(this.tools.values());
|
|
2750
|
+
}
|
|
2751
|
+
/**
|
|
2752
|
+
* Find tool IDs that support a given PNP support ID
|
|
2753
|
+
*
|
|
2754
|
+
* @param pnpSupportId - PNP support ID (e.g., 'calculator')
|
|
2755
|
+
* @returns Set of tool IDs that support this PNP ID
|
|
2756
|
+
*/
|
|
2757
|
+
getToolsByPNPSupport(t) {
|
|
2758
|
+
return this.pnpIndex.get(t) || /* @__PURE__ */ new Set();
|
|
2759
|
+
}
|
|
2760
|
+
/**
|
|
2761
|
+
* Get tools that support a specific level
|
|
2762
|
+
*
|
|
2763
|
+
* @param level - Tool level (assessment, section, item, passage, element)
|
|
2764
|
+
* @returns Array of tool registrations that support this level
|
|
2765
|
+
*/
|
|
2766
|
+
getToolsByLevel(t) {
|
|
2767
|
+
return this.getAllTools().filter((o) => o.supportedLevels.includes(t));
|
|
2768
|
+
}
|
|
2769
|
+
/**
|
|
2770
|
+
* Resolve tool activation with backward-compatible defaults.
|
|
2771
|
+
*/
|
|
2772
|
+
getToolActivation(t) {
|
|
2773
|
+
return this.get(t)?.activation || "toolbar-toggle";
|
|
2774
|
+
}
|
|
2775
|
+
/**
|
|
2776
|
+
* Resolve singleton scope for a tool when present.
|
|
2777
|
+
*/
|
|
2778
|
+
getToolSingletonScope(t) {
|
|
2779
|
+
return this.get(t)?.singletonScope || null;
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* Filter tool IDs by activation type.
|
|
2783
|
+
*/
|
|
2784
|
+
filterToolIdsByActivation(t, o) {
|
|
2785
|
+
return t.filter((n) => this.getToolActivation(n) === o);
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Filter tools by visibility in a given context
|
|
2789
|
+
*
|
|
2790
|
+
* Pass 2 of the two-pass model: Given a list of allowed tool IDs (from Pass 1),
|
|
2791
|
+
* ask each tool if it's relevant in this context.
|
|
2792
|
+
*
|
|
2793
|
+
* @param allowedToolIds - Tool IDs that passed Pass 1 (orchestrator approval)
|
|
2794
|
+
* @param context - Context to evaluate
|
|
2795
|
+
* @returns Array of visible tool registrations
|
|
2796
|
+
*/
|
|
2797
|
+
filterVisibleInContext(t, o) {
|
|
2798
|
+
const n = [];
|
|
2799
|
+
for (const r of t) {
|
|
2800
|
+
const i = this.get(r);
|
|
2801
|
+
if (!i) {
|
|
2802
|
+
console.warn(`Tool '${r}' is allowed but not registered`);
|
|
2803
|
+
continue;
|
|
2804
|
+
}
|
|
2805
|
+
if (i.supportedLevels.includes(o.level))
|
|
2806
|
+
try {
|
|
2807
|
+
i.isVisibleInContext(o) && n.push(i);
|
|
2808
|
+
} catch (s) {
|
|
2809
|
+
console.error(`Error evaluating visibility for tool '${r}':`, s);
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
return n;
|
|
2813
|
+
}
|
|
2814
|
+
/**
|
|
2815
|
+
* Get tool metadata for building UIs
|
|
2816
|
+
* Useful for building PNP configuration interfaces
|
|
2817
|
+
*
|
|
2818
|
+
* @returns Array of tool metadata (id, name, description, pnpSupportIds)
|
|
2819
|
+
*/
|
|
2820
|
+
getToolMetadata() {
|
|
2821
|
+
return this.getAllTools().map((t) => ({
|
|
2822
|
+
toolId: t.toolId,
|
|
2823
|
+
name: t.name,
|
|
2824
|
+
description: t.description,
|
|
2825
|
+
pnpSupportIds: t.pnpSupportIds || [],
|
|
2826
|
+
supportedLevels: t.supportedLevels,
|
|
2827
|
+
activation: t.activation || "toolbar-toggle",
|
|
2828
|
+
singletonScope: t.singletonScope || null
|
|
2829
|
+
}));
|
|
2830
|
+
}
|
|
2831
|
+
/**
|
|
2832
|
+
* Generate PNP support IDs from enabled tools
|
|
2833
|
+
* Useful for creating PNP profiles
|
|
2834
|
+
*
|
|
2835
|
+
* @param enabledToolIds - Tool IDs to enable
|
|
2836
|
+
* @returns Array of unique PNP support IDs
|
|
2837
|
+
*/
|
|
2838
|
+
generatePNPSupportsFromTools(t) {
|
|
2839
|
+
const o = /* @__PURE__ */ new Set();
|
|
2840
|
+
for (const n of t) {
|
|
2841
|
+
const r = this.get(n);
|
|
2842
|
+
if (r?.pnpSupportIds)
|
|
2843
|
+
for (const i of r.pnpSupportIds)
|
|
2844
|
+
o.add(i);
|
|
2845
|
+
}
|
|
2846
|
+
return Array.from(o);
|
|
2847
|
+
}
|
|
2848
|
+
/**
|
|
2849
|
+
* Clear all registrations (useful for testing)
|
|
2850
|
+
*/
|
|
2851
|
+
clear() {
|
|
2852
|
+
this.tools.clear(), this.pnpIndex.clear();
|
|
2853
|
+
}
|
|
2854
|
+
/**
|
|
2855
|
+
* Configure global component overrides used by tool instance creation.
|
|
2856
|
+
*/
|
|
2857
|
+
setComponentOverrides(t) {
|
|
2858
|
+
this.componentOverrides = t;
|
|
2859
|
+
}
|
|
2860
|
+
/**
|
|
2861
|
+
* Register lazy module loaders by toolId.
|
|
2862
|
+
* Toolbars call ensureToolModuleLoaded(toolId) before instance creation.
|
|
2863
|
+
*/
|
|
2864
|
+
setToolModuleLoaders(t) {
|
|
2865
|
+
for (const [o, n] of Object.entries(t))
|
|
2866
|
+
n && this.moduleLoaders.set(o, n);
|
|
2867
|
+
}
|
|
2868
|
+
/**
|
|
2869
|
+
* Ensure tool module side-effects are loaded exactly once.
|
|
2870
|
+
* Safe to call repeatedly; concurrent callers share the same promise.
|
|
2871
|
+
*/
|
|
2872
|
+
async ensureToolModuleLoaded(t) {
|
|
2873
|
+
if (this.loadedToolModules.has(t))
|
|
2874
|
+
return;
|
|
2875
|
+
const o = this.moduleLoadPromises.get(t);
|
|
2876
|
+
if (o) {
|
|
2877
|
+
await o;
|
|
2878
|
+
return;
|
|
2879
|
+
}
|
|
2880
|
+
const n = this.moduleLoaders.get(t);
|
|
2881
|
+
if (!n)
|
|
2882
|
+
return;
|
|
2883
|
+
const r = (async () => {
|
|
2884
|
+
await n(), this.loadedToolModules.add(t);
|
|
2885
|
+
})();
|
|
2886
|
+
this.moduleLoadPromises.set(t, r);
|
|
2887
|
+
try {
|
|
2888
|
+
await r;
|
|
2889
|
+
} finally {
|
|
2890
|
+
this.moduleLoadPromises.delete(t);
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
/**
|
|
2894
|
+
* Ensure a set of tool modules are loaded.
|
|
2895
|
+
*/
|
|
2896
|
+
async ensureToolModulesLoaded(t) {
|
|
2897
|
+
await Promise.all(t.map((o) => this.ensureToolModuleLoaded(o)));
|
|
2898
|
+
}
|
|
2899
|
+
/**
|
|
2900
|
+
* Whether a tool module has already been loaded.
|
|
2901
|
+
*/
|
|
2902
|
+
isToolModuleLoaded(t) {
|
|
2903
|
+
return this.loadedToolModules.has(t);
|
|
2904
|
+
}
|
|
2905
|
+
/**
|
|
2906
|
+
* Render a tool for toolbar use with component overrides attached.
|
|
2907
|
+
*/
|
|
2908
|
+
renderForToolbar(t, o, n) {
|
|
2909
|
+
const r = this.get(t);
|
|
2910
|
+
if (!r)
|
|
2911
|
+
throw new Error(`Tool '${t}' is not registered`);
|
|
2912
|
+
const i = {
|
|
2913
|
+
...n,
|
|
2914
|
+
componentOverrides: {
|
|
2915
|
+
...this.componentOverrides || {},
|
|
2916
|
+
...n.componentOverrides || {}
|
|
2917
|
+
}
|
|
2918
|
+
};
|
|
2919
|
+
return r.renderToolbar(o, i);
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
function ji(e) {
|
|
2923
|
+
return e.level === "item";
|
|
2924
|
+
}
|
|
2925
|
+
function Rs(e) {
|
|
2926
|
+
return e.level === "passage";
|
|
2927
|
+
}
|
|
2928
|
+
function Ns(e) {
|
|
2929
|
+
return e.level === "rubric";
|
|
2930
|
+
}
|
|
2931
|
+
function Pi(e) {
|
|
2932
|
+
return e.level === "element";
|
|
2933
|
+
}
|
|
2934
|
+
function ln(e) {
|
|
2935
|
+
if (Pi(e)) {
|
|
2936
|
+
const t = e.item.config;
|
|
2937
|
+
if (!t)
|
|
2938
|
+
return "";
|
|
2939
|
+
const o = [], n = (l) => l.replace(/<[^>]*>/g, " ").trim(), r = t.elements?.[e.elementId];
|
|
2940
|
+
r && typeof r == "string" && o.push(n(r));
|
|
2941
|
+
const i = t.models, s = (Array.isArray(i) ? i : i && typeof i == "object" ? Object.values(i) : []).find((l) => l && typeof l == "object" && l.id === e.elementId);
|
|
2942
|
+
if (s) {
|
|
2943
|
+
for (const l of Object.values(s))
|
|
2944
|
+
if (typeof l == "string" && o.push(n(l)), Array.isArray(l)) {
|
|
2945
|
+
for (const a of l)
|
|
2946
|
+
if (a && typeof a == "object")
|
|
2947
|
+
for (const c of Object.values(a))
|
|
2948
|
+
typeof c == "string" && o.push(n(c));
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
return o.filter(Boolean).join(" ").trim();
|
|
2952
|
+
}
|
|
2953
|
+
if (ji(e)) {
|
|
2954
|
+
const t = e.item;
|
|
2955
|
+
if (!t?.config)
|
|
2956
|
+
return "";
|
|
2957
|
+
const o = t.config, n = [], r = (a) => a.replace(/<[^>]*>/g, " ").trim();
|
|
2958
|
+
typeof o.markup == "string" && n.push(r(o.markup));
|
|
2959
|
+
const i = o.elements;
|
|
2960
|
+
if (i && typeof i == "object")
|
|
2961
|
+
for (const a of Object.values(i))
|
|
2962
|
+
typeof a == "string" && n.push(r(a));
|
|
2963
|
+
const s = o.models, l = Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : [];
|
|
2964
|
+
for (const a of l)
|
|
2965
|
+
if (!(!a || typeof a != "object")) {
|
|
2966
|
+
for (const c of Object.values(a))
|
|
2967
|
+
if (typeof c == "string" && n.push(r(c)), Array.isArray(c)) {
|
|
2968
|
+
for (const f of c)
|
|
2969
|
+
if (f && typeof f == "object")
|
|
2970
|
+
for (const p of Object.values(f))
|
|
2971
|
+
typeof p == "string" && n.push(r(p));
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
return n.filter(Boolean).join(" ").trim();
|
|
2975
|
+
}
|
|
2976
|
+
if (Rs(e)) {
|
|
2977
|
+
const t = e.passage;
|
|
2978
|
+
if (!t?.config)
|
|
2979
|
+
return "";
|
|
2980
|
+
const o = t.config, n = [], r = (a) => a.replace(/<[^>]*>/g, " ").trim();
|
|
2981
|
+
typeof o.markup == "string" && n.push(r(o.markup)), typeof o.content == "string" && n.push(r(o.content)), typeof o.prompt == "string" && n.push(r(o.prompt));
|
|
2982
|
+
const i = o.elements;
|
|
2983
|
+
if (i && typeof i == "object")
|
|
2984
|
+
for (const a of Object.values(i))
|
|
2985
|
+
typeof a == "string" && n.push(r(a));
|
|
2986
|
+
const s = o.models, l = Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : [];
|
|
2987
|
+
for (const a of l)
|
|
2988
|
+
if (!(!a || typeof a != "object")) {
|
|
2989
|
+
for (const c of Object.values(a))
|
|
2990
|
+
if (typeof c == "string" && n.push(r(c)), Array.isArray(c)) {
|
|
2991
|
+
for (const f of c)
|
|
2992
|
+
if (f && typeof f == "object")
|
|
2993
|
+
for (const p of Object.values(f))
|
|
2994
|
+
typeof p == "string" && n.push(r(p));
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
return n.filter(Boolean).join(" ").trim();
|
|
2998
|
+
}
|
|
2999
|
+
if (Ns(e)) {
|
|
3000
|
+
const t = e.rubricBlock;
|
|
3001
|
+
return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
|
|
3002
|
+
}
|
|
3003
|
+
return "";
|
|
3004
|
+
}
|
|
3005
|
+
function xo(e) {
|
|
3006
|
+
const t = ln(e);
|
|
3007
|
+
return [
|
|
3008
|
+
/<math[>\s]/i,
|
|
3009
|
+
// MathML
|
|
3010
|
+
/\\\[([^\]]+)\\\]/,
|
|
3011
|
+
// LaTeX display math
|
|
3012
|
+
/\$\$[^$]+\$\$/,
|
|
3013
|
+
// LaTeX display math ($$...$$)
|
|
3014
|
+
/\\\(/,
|
|
3015
|
+
// LaTeX inline math
|
|
3016
|
+
/[+\-*/=<>≤≥∑∫√π]/,
|
|
3017
|
+
// Math symbols
|
|
3018
|
+
/\d+\s*[+\-*/=]\s*\d+/
|
|
3019
|
+
// Simple arithmetic
|
|
3020
|
+
].some((o) => o.test(t));
|
|
3021
|
+
}
|
|
3022
|
+
function js(e) {
|
|
3023
|
+
const t = [
|
|
3024
|
+
"pie-multiple-choice",
|
|
3025
|
+
"pie-inline-choice",
|
|
3026
|
+
"pie-select-text",
|
|
3027
|
+
"multiple-choice",
|
|
3028
|
+
"inline-choice",
|
|
3029
|
+
"select-text"
|
|
3030
|
+
];
|
|
3031
|
+
if (Pi(e)) {
|
|
3032
|
+
const o = e.item.config;
|
|
3033
|
+
if (!o?.models)
|
|
3034
|
+
return !1;
|
|
3035
|
+
const n = (Array.isArray(o.models) ? o.models : Object.values(o.models)).find((i) => i && typeof i == "object" && i.id === e.elementId);
|
|
3036
|
+
if (!n)
|
|
3037
|
+
return !1;
|
|
3038
|
+
const r = n.element || "";
|
|
3039
|
+
return t.includes(r);
|
|
3040
|
+
}
|
|
3041
|
+
if (ji(e)) {
|
|
3042
|
+
const o = e.item.config?.models;
|
|
3043
|
+
return (Array.isArray(o) ? o : o && typeof o == "object" ? Object.values(o) : []).some((n) => {
|
|
3044
|
+
if (!n || typeof n != "object")
|
|
3045
|
+
return !1;
|
|
3046
|
+
const r = n.element || "";
|
|
3047
|
+
return t.includes(r) ? !0 : Array.isArray(n.choices) && n.choices.length > 0;
|
|
3048
|
+
});
|
|
3049
|
+
}
|
|
3050
|
+
return !1;
|
|
3051
|
+
}
|
|
3052
|
+
function _o(e) {
|
|
3053
|
+
return ln(e).trim().length >= 10;
|
|
3054
|
+
}
|
|
3055
|
+
function Ps(e) {
|
|
3056
|
+
const t = ln(e);
|
|
3057
|
+
return [
|
|
3058
|
+
/chemistry|chemical|element|atom|molecule|compound/i,
|
|
3059
|
+
/periodic\s+table/i,
|
|
3060
|
+
/H₂O|CO₂|NaCl|O₂|N₂/i,
|
|
3061
|
+
// Chemical formulas
|
|
3062
|
+
/\b[A-Z][a-z]?\d*\b/,
|
|
3063
|
+
// Element symbols (H, He, Li, etc.)
|
|
3064
|
+
/biology|organism|cell|DNA|RNA|protein/i,
|
|
3065
|
+
/physics|force|energy|velocity|acceleration/i
|
|
3066
|
+
].some((o) => o.test(t));
|
|
3067
|
+
}
|
|
3068
|
+
const qs = [
|
|
3069
|
+
"assessment",
|
|
3070
|
+
"section",
|
|
3071
|
+
"item",
|
|
3072
|
+
"passage",
|
|
3073
|
+
"rubric"
|
|
3074
|
+
], Ws = new Set(qs);
|
|
3075
|
+
function Ds(e) {
|
|
3076
|
+
return Ws.has(e);
|
|
3077
|
+
}
|
|
3078
|
+
function pt(e, t, o) {
|
|
3079
|
+
const n = e.trim(), r = o.trim();
|
|
3080
|
+
if (!n || !r)
|
|
3081
|
+
throw new Error("Tool instance ids require non-empty tool and scope ids");
|
|
3082
|
+
if (!Ds(t))
|
|
3083
|
+
throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
|
|
3084
|
+
return `${n}:${t}:${r}`;
|
|
3085
|
+
}
|
|
3086
|
+
const Hs = /* @__PURE__ */ new Set([
|
|
3087
|
+
"annotation-xml",
|
|
3088
|
+
"color-profile",
|
|
3089
|
+
"font-face",
|
|
3090
|
+
"font-face-src",
|
|
3091
|
+
"font-face-uri",
|
|
3092
|
+
"font-face-format",
|
|
3093
|
+
"font-face-name",
|
|
3094
|
+
"missing-glyph"
|
|
3095
|
+
]), Bs = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, zs = (e, t = "custom element tag") => {
|
|
3096
|
+
if (!e || typeof e != "string")
|
|
3097
|
+
throw new Error(`Invalid ${t}: expected a non-empty string`);
|
|
3098
|
+
const o = e.trim();
|
|
3099
|
+
if (!o)
|
|
3100
|
+
throw new Error(`Invalid ${t}: tag is empty`);
|
|
3101
|
+
if (o !== o.toLowerCase())
|
|
3102
|
+
throw new Error(`Invalid ${t} "${o}": custom element names must be lowercase`);
|
|
3103
|
+
if (!o.includes("-"))
|
|
3104
|
+
throw new Error(`Invalid ${t} "${o}": custom element names must include a hyphen`);
|
|
3105
|
+
if (Hs.has(o))
|
|
3106
|
+
throw new Error(`Invalid ${t} "${o}": this name is reserved by the HTML spec`);
|
|
3107
|
+
if (!Bs.test(o))
|
|
3108
|
+
throw new Error(`Invalid ${t} "${o}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
|
|
3109
|
+
return o;
|
|
3110
|
+
}, qi = {
|
|
3111
|
+
calculator: "pie-tool-calculator",
|
|
3112
|
+
textToSpeech: "pie-tool-text-to-speech",
|
|
3113
|
+
ruler: "pie-tool-ruler",
|
|
3114
|
+
protractor: "pie-tool-protractor",
|
|
3115
|
+
answerEliminator: "pie-tool-answer-eliminator",
|
|
3116
|
+
highlighter: "pie-tool-annotation-toolbar",
|
|
3117
|
+
lineReader: "pie-tool-line-reader",
|
|
3118
|
+
theme: "pie-tool-theme",
|
|
3119
|
+
colorScheme: "pie-tool-theme",
|
|
3120
|
+
annotationToolbar: "pie-tool-annotation-toolbar",
|
|
3121
|
+
graph: "pie-tool-graph",
|
|
3122
|
+
periodicTable: "pie-tool-periodic-table"
|
|
3123
|
+
}, Gs = (e, t) => {
|
|
3124
|
+
const o = t?.toolTagMap?.[e] ?? qi[e] ?? e;
|
|
3125
|
+
return zs(o, `tool component tag for "${e}"`);
|
|
3126
|
+
}, Fs = (e) => document.createElement(e), It = (e, t, o, n) => {
|
|
3127
|
+
const r = Gs(e, n), i = n?.toolComponentFactories?.[e] ?? n?.toolComponentFactory;
|
|
3128
|
+
return i ? i({ toolId: e, tagName: r, context: t, toolbarContext: o }) : Fs(r);
|
|
3129
|
+
}, Us = {
|
|
3130
|
+
toolId: "calculator",
|
|
3131
|
+
name: "Calculator",
|
|
3132
|
+
description: "Multi-type calculator (basic, scientific, graphing)",
|
|
3133
|
+
icon: "calculator",
|
|
3134
|
+
// Calculator is item-level in this player architecture.
|
|
3135
|
+
supportedLevels: ["item"],
|
|
3136
|
+
// PNP support IDs that enable this tool
|
|
3137
|
+
// Maps to QTI 3.0 standard features: calculator, graphingCalculator
|
|
3138
|
+
pnpSupportIds: [
|
|
3139
|
+
"calculator",
|
|
3140
|
+
// QTI 3.0 standard (cognitive.calculator)
|
|
3141
|
+
"graphingCalculator",
|
|
3142
|
+
// QTI 3.0 standard (assessment.graphingCalculator)
|
|
3143
|
+
"basicCalculator",
|
|
3144
|
+
// Common variant
|
|
3145
|
+
"scientificCalculator"
|
|
3146
|
+
// Common variant
|
|
3147
|
+
],
|
|
3148
|
+
/**
|
|
3149
|
+
* Pass 2: Determine if calculator is relevant in this context
|
|
3150
|
+
*
|
|
3151
|
+
* Calculator is relevant when context contains mathematical content
|
|
3152
|
+
* (MathML, LaTeX, arithmetic markers).
|
|
3153
|
+
*/
|
|
3154
|
+
isVisibleInContext(e) {
|
|
3155
|
+
return xo(e);
|
|
3156
|
+
},
|
|
3157
|
+
renderToolbar(e, t) {
|
|
3158
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = t.componentOverrides, r = It(this.toolId, e, t, n);
|
|
3159
|
+
r.setAttribute("tool-id", o);
|
|
3160
|
+
const i = {
|
|
3161
|
+
toolId: this.toolId,
|
|
3162
|
+
label: this.name,
|
|
3163
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3164
|
+
disabled: !1,
|
|
3165
|
+
ariaLabel: "Open scientific calculator",
|
|
3166
|
+
tooltip: "Calculator",
|
|
3167
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3168
|
+
active: t.isToolVisible(o)
|
|
3169
|
+
};
|
|
3170
|
+
return {
|
|
3171
|
+
toolId: this.toolId,
|
|
3172
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
3173
|
+
button: i,
|
|
3174
|
+
sync: () => {
|
|
3175
|
+
const s = t.isToolVisible(o);
|
|
3176
|
+
i.active = s, i.ariaLabel = s ? "Close scientific calculator" : "Open scientific calculator", i.tooltip = s ? "Close calculator" : "Calculator", r.visible = s;
|
|
3177
|
+
},
|
|
3178
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3179
|
+
s(t.isToolVisible(o));
|
|
3180
|
+
}) : () => {
|
|
3181
|
+
}
|
|
3182
|
+
};
|
|
3183
|
+
}
|
|
3184
|
+
}, Ks = {
|
|
3185
|
+
toolId: "textToSpeech",
|
|
3186
|
+
name: "Text to Speech",
|
|
3187
|
+
description: "Read content aloud",
|
|
3188
|
+
icon: "volume-up",
|
|
3189
|
+
// TTS can appear at all levels except assessment and element.
|
|
3190
|
+
supportedLevels: ["section", "item", "passage", "rubric"],
|
|
3191
|
+
// PNP support IDs that enable this tool
|
|
3192
|
+
// Maps to QTI 3.0 standard features: textToSpeech, readAloud
|
|
3193
|
+
pnpSupportIds: [
|
|
3194
|
+
"textToSpeech",
|
|
3195
|
+
// QTI 3.0 standard (auditory.textToSpeech)
|
|
3196
|
+
"readAloud",
|
|
3197
|
+
// QTI 3.0 standard (auditory.readAloud)
|
|
3198
|
+
"tts",
|
|
3199
|
+
// Common abbreviation
|
|
3200
|
+
"speechOutput"
|
|
3201
|
+
// Common variant
|
|
3202
|
+
],
|
|
3203
|
+
/**
|
|
3204
|
+
* Pass 2: Determine if TTS is relevant in this context
|
|
3205
|
+
*
|
|
3206
|
+
* TTS is relevant when:
|
|
3207
|
+
* - Context contains readable text (at least 10 characters)
|
|
3208
|
+
*/
|
|
3209
|
+
isVisibleInContext(e) {
|
|
3210
|
+
return _o(e);
|
|
3211
|
+
},
|
|
3212
|
+
renderToolbar(e, t) {
|
|
3213
|
+
let o = null;
|
|
3214
|
+
const n = t.ttsService, r = pt(this.toolId, t.scope.level, t.scope.scopeId), i = () => t.isToolVisible(r), s = {
|
|
3215
|
+
toolId: this.toolId,
|
|
3216
|
+
label: "Read aloud",
|
|
3217
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3218
|
+
ariaLabel: "Read aloud",
|
|
3219
|
+
tooltip: "Read aloud",
|
|
3220
|
+
onClick: () => {
|
|
3221
|
+
v();
|
|
3222
|
+
},
|
|
3223
|
+
disabled: !1,
|
|
3224
|
+
active: !1
|
|
3225
|
+
}, l = () => {
|
|
3226
|
+
const d = i() ? "Stop reading" : "Read aloud";
|
|
3227
|
+
s.label = d, s.ariaLabel = d, s.tooltip = d, s.active = i(), s.disabled = !t.ttsService;
|
|
3228
|
+
}, a = (d) => {
|
|
3229
|
+
(d === "idle" || d === "error") && i() && (t.toggleTool(this.toolId), l());
|
|
3230
|
+
}, c = async () => {
|
|
3231
|
+
t.ensureTTSReady && (o || (o = (async () => {
|
|
3232
|
+
await t.ensureTTSReady?.(), t.toolkitCoordinator?.highlightCoordinator && n?.setHighlightCoordinator?.(t.toolkitCoordinator.highlightCoordinator);
|
|
3233
|
+
})()), await o);
|
|
3234
|
+
}, f = () => {
|
|
3235
|
+
n?.stop?.(), i() && t.toggleTool(this.toolId), l();
|
|
3236
|
+
}, p = () => {
|
|
3237
|
+
const d = t.getScopeElement?.();
|
|
3238
|
+
if (d)
|
|
3239
|
+
return d;
|
|
3240
|
+
const h = (k) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(k) : k.replace(/"/g, '\\"'), m = [
|
|
3241
|
+
t.catalogId,
|
|
3242
|
+
t.scope.itemId,
|
|
3243
|
+
t.scope.canonicalItemId
|
|
3244
|
+
].filter((k) => typeof k == "string" && k.length > 0), y = [];
|
|
3245
|
+
for (const k of m) {
|
|
3246
|
+
const I = h(k);
|
|
3247
|
+
t.scope.level === "passage" && y.push(`pie-passage-shell[item-id="${I}"] [data-region="content"]`), y.push(`pie-item-shell[item-id="${I}"] [data-region="content"]`);
|
|
3248
|
+
}
|
|
3249
|
+
y.push("[data-region='content']");
|
|
3250
|
+
for (const k of y) {
|
|
3251
|
+
const I = document.querySelector(k);
|
|
3252
|
+
if (I instanceof HTMLElement)
|
|
3253
|
+
return I;
|
|
3254
|
+
}
|
|
3255
|
+
return null;
|
|
3256
|
+
}, v = async () => {
|
|
3257
|
+
if (!n?.speak || !t.ttsService)
|
|
3258
|
+
return;
|
|
3259
|
+
if (i()) {
|
|
3260
|
+
f();
|
|
3261
|
+
return;
|
|
3262
|
+
}
|
|
3263
|
+
const d = p();
|
|
3264
|
+
if (!d)
|
|
3265
|
+
return;
|
|
3266
|
+
const h = d.textContent || "";
|
|
3267
|
+
if (h.trim())
|
|
3268
|
+
try {
|
|
3269
|
+
i() || t.toggleTool(this.toolId), l(), await c(), n.setRootElement?.(d), n.speak(h, {
|
|
3270
|
+
// For passage-level TTS, use rendered DOM text as the source of truth.
|
|
3271
|
+
// Catalog/SSML content can diverge from rendered text and break
|
|
3272
|
+
// word-boundary-to-DOM mapping for progressive yellow highlighting.
|
|
3273
|
+
catalogId: t.scope.level === "passage" ? void 0 : t.catalogId || t.itemId,
|
|
3274
|
+
language: t.language,
|
|
3275
|
+
contentElement: d
|
|
3276
|
+
}).catch((m) => {
|
|
3277
|
+
console.error("[ttsToolRegistration] Failed to start reading:", m), l();
|
|
3278
|
+
}), l();
|
|
3279
|
+
} catch (m) {
|
|
3280
|
+
l(), console.error("[ttsToolRegistration] Failed to start reading:", m);
|
|
3281
|
+
}
|
|
3282
|
+
};
|
|
3283
|
+
return {
|
|
3284
|
+
toolId: this.toolId,
|
|
3285
|
+
button: s,
|
|
3286
|
+
sync: () => {
|
|
3287
|
+
l(), t.ensureTTSReady && c().catch((d) => {
|
|
3288
|
+
console.error("[ttsToolRegistration] Failed to initialize TTS service:", d);
|
|
3289
|
+
});
|
|
3290
|
+
},
|
|
3291
|
+
subscribeActive: (d) => {
|
|
3292
|
+
const h = [];
|
|
3293
|
+
if (t.subscribeVisibility) {
|
|
3294
|
+
const m = t.subscribeVisibility(() => {
|
|
3295
|
+
const y = i();
|
|
3296
|
+
l(), d(y);
|
|
3297
|
+
});
|
|
3298
|
+
h.push(m);
|
|
3299
|
+
}
|
|
3300
|
+
if (t.ttsService) {
|
|
3301
|
+
const m = `tts-toolbar:${r}`, y = (k) => {
|
|
3302
|
+
a(String(k || ""));
|
|
3303
|
+
const I = i();
|
|
3304
|
+
l(), d(I);
|
|
3305
|
+
};
|
|
3306
|
+
t.ttsService.onStateChange(m, y), h.push(() => {
|
|
3307
|
+
t.ttsService?.offStateChange(m, y);
|
|
3308
|
+
});
|
|
3309
|
+
}
|
|
3310
|
+
return h.length === 0 ? () => {
|
|
3311
|
+
} : () => {
|
|
3312
|
+
for (const m of h)
|
|
3313
|
+
m();
|
|
3314
|
+
};
|
|
3315
|
+
}
|
|
3316
|
+
};
|
|
3317
|
+
}
|
|
3318
|
+
}, Js = {
|
|
3319
|
+
toolId: "ruler",
|
|
3320
|
+
name: "Ruler",
|
|
3321
|
+
description: "On-screen ruler for measurements",
|
|
3322
|
+
icon: "ruler",
|
|
3323
|
+
// Ruler typically appears at item/element level
|
|
3324
|
+
supportedLevels: ["item", "element"],
|
|
3325
|
+
// PNP support IDs
|
|
3326
|
+
// Maps to QTI 3.0 standard feature: ruler
|
|
3327
|
+
pnpSupportIds: [
|
|
3328
|
+
"ruler",
|
|
3329
|
+
// QTI 3.0 standard (assessment.ruler)
|
|
3330
|
+
"measurement"
|
|
3331
|
+
// Common variant
|
|
3332
|
+
],
|
|
3333
|
+
/**
|
|
3334
|
+
* Pass 2: Ruler is relevant when math content is present
|
|
3335
|
+
*/
|
|
3336
|
+
isVisibleInContext(e) {
|
|
3337
|
+
return xo(e);
|
|
3338
|
+
},
|
|
3339
|
+
renderToolbar(e, t) {
|
|
3340
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = {
|
|
3341
|
+
toolId: this.toolId,
|
|
3342
|
+
label: this.name,
|
|
3343
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3344
|
+
disabled: !1,
|
|
3345
|
+
ariaLabel: "Open ruler tool",
|
|
3346
|
+
tooltip: "Ruler",
|
|
3347
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3348
|
+
active: t.isToolVisible(o)
|
|
3349
|
+
}, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
|
|
3350
|
+
return i.setAttribute("tool-id", o), {
|
|
3351
|
+
toolId: this.toolId,
|
|
3352
|
+
button: n,
|
|
3353
|
+
elements: [{ element: i, mount: "after-buttons" }],
|
|
3354
|
+
sync: () => {
|
|
3355
|
+
const s = t.isToolVisible(o);
|
|
3356
|
+
n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
|
|
3357
|
+
},
|
|
3358
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3359
|
+
s(t.isToolVisible(o));
|
|
3360
|
+
}) : () => {
|
|
3361
|
+
}
|
|
3362
|
+
};
|
|
3363
|
+
}
|
|
3364
|
+
}, Zs = {
|
|
3365
|
+
toolId: "protractor",
|
|
3366
|
+
name: "Protractor",
|
|
3367
|
+
description: "On-screen protractor for angle measurements",
|
|
3368
|
+
icon: "protractor",
|
|
3369
|
+
// Protractor typically appears at item/element level
|
|
3370
|
+
supportedLevels: ["item", "element"],
|
|
3371
|
+
// PNP support IDs
|
|
3372
|
+
// Maps to QTI 3.0 standard feature: protractor
|
|
3373
|
+
pnpSupportIds: [
|
|
3374
|
+
"protractor",
|
|
3375
|
+
// QTI 3.0 standard (assessment.protractor)
|
|
3376
|
+
"angleMeasurement"
|
|
3377
|
+
// Common variant
|
|
3378
|
+
],
|
|
3379
|
+
/**
|
|
3380
|
+
* Pass 2: Protractor is relevant when math content is present
|
|
3381
|
+
*/
|
|
3382
|
+
isVisibleInContext(e) {
|
|
3383
|
+
return xo(e);
|
|
3384
|
+
},
|
|
3385
|
+
renderToolbar(e, t) {
|
|
3386
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = {
|
|
3387
|
+
toolId: this.toolId,
|
|
3388
|
+
label: this.name,
|
|
3389
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3390
|
+
disabled: !1,
|
|
3391
|
+
ariaLabel: "Open protractor tool",
|
|
3392
|
+
tooltip: "Protractor",
|
|
3393
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3394
|
+
active: t.isToolVisible(o)
|
|
3395
|
+
}, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
|
|
3396
|
+
return i.setAttribute("tool-id", o), {
|
|
3397
|
+
toolId: this.toolId,
|
|
3398
|
+
button: n,
|
|
3399
|
+
elements: [{ element: i, mount: "after-buttons" }],
|
|
3400
|
+
sync: () => {
|
|
3401
|
+
const s = t.isToolVisible(o);
|
|
3402
|
+
n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
|
|
3403
|
+
},
|
|
3404
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3405
|
+
s(t.isToolVisible(o));
|
|
3406
|
+
}) : () => {
|
|
3407
|
+
}
|
|
3408
|
+
};
|
|
3409
|
+
}
|
|
3410
|
+
}, Xs = {
|
|
3411
|
+
toolId: "answerEliminator",
|
|
3412
|
+
name: "Answer Eliminator",
|
|
3413
|
+
description: "Strike through answer choices",
|
|
3414
|
+
icon: "strikethrough",
|
|
3415
|
+
// Answer eliminator appears at item level only
|
|
3416
|
+
supportedLevels: ["item"],
|
|
3417
|
+
// PNP support IDs
|
|
3418
|
+
// Maps to QTI 3.0 standard feature: answerMasking
|
|
3419
|
+
pnpSupportIds: [
|
|
3420
|
+
"answerMasking",
|
|
3421
|
+
// QTI 3.0 standard (assessment.answerMasking)
|
|
3422
|
+
"answerEliminator",
|
|
3423
|
+
// QTI 3.0 standard (assessment.answerEliminator)
|
|
3424
|
+
"strikethrough",
|
|
3425
|
+
// Common variant
|
|
3426
|
+
"choiceMasking"
|
|
3427
|
+
// Common variant
|
|
3428
|
+
],
|
|
3429
|
+
/**
|
|
3430
|
+
* Pass 2: Answer eliminator is relevant only for choice-based questions
|
|
3431
|
+
*/
|
|
3432
|
+
isVisibleInContext(e) {
|
|
3433
|
+
return js(e);
|
|
3434
|
+
},
|
|
3435
|
+
renderToolbar(e, t) {
|
|
3436
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = t.componentOverrides ?? {}, r = It(this.toolId, e, t, n);
|
|
3437
|
+
r.setAttribute("tool-id", o), r.setAttribute("strategy", "strikethrough"), r.setAttribute("button-alignment", "inline");
|
|
3438
|
+
const i = {
|
|
3439
|
+
toolId: this.toolId,
|
|
3440
|
+
label: this.name,
|
|
3441
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true"><path d="M19,3H16.3H7.7H5A2,2 0 0,0 3,5V7.7V16.4V19A2,2 0 0,0 5,21H7.7H16.4H19A2,2 0 0,0 21,19V16.3V7.7V5A2,2 0 0,0 19,3M15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4L13.4,12L17,15.6L15.6,17Z"/></svg>',
|
|
3442
|
+
disabled: !1,
|
|
3443
|
+
ariaLabel: "Answer eliminator - Strike through choices",
|
|
3444
|
+
tooltip: "Strike Through",
|
|
3445
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3446
|
+
active: t.isToolVisible(o)
|
|
3447
|
+
};
|
|
3448
|
+
return {
|
|
3449
|
+
toolId: this.toolId,
|
|
3450
|
+
button: i,
|
|
3451
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
3452
|
+
sync: () => {
|
|
3453
|
+
const s = t.isToolVisible(o);
|
|
3454
|
+
i.active = s, r.visible = s, t.toolCoordinator && (r.coordinator = t.toolCoordinator), r.scopeElement = t.getScopeElement?.() || null, t.elementToolStateStore && (r.elementToolStateStore = t.elementToolStateStore);
|
|
3455
|
+
const l = t.getGlobalElementId?.();
|
|
3456
|
+
l && (r.globalElementId = l);
|
|
3457
|
+
},
|
|
3458
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3459
|
+
s(t.isToolVisible(o));
|
|
3460
|
+
}) : () => {
|
|
3461
|
+
}
|
|
3462
|
+
};
|
|
3463
|
+
}
|
|
3464
|
+
}, Ys = {
|
|
3465
|
+
toolId: "highlighter",
|
|
3466
|
+
name: "Highlighter",
|
|
3467
|
+
description: "Highlight text",
|
|
3468
|
+
icon: "highlighter",
|
|
3469
|
+
activation: "toolbar-toggle",
|
|
3470
|
+
// Highlighter appears at passage, rubric, item, and element levels
|
|
3471
|
+
supportedLevels: ["passage", "rubric", "item", "element"],
|
|
3472
|
+
// PNP support IDs
|
|
3473
|
+
pnpSupportIds: ["highlighter", "textHighlight", "annotation"],
|
|
3474
|
+
/**
|
|
3475
|
+
* Pass 2: Highlighter is relevant when readable text is available
|
|
3476
|
+
*/
|
|
3477
|
+
isVisibleInContext(e) {
|
|
3478
|
+
return _o(e);
|
|
3479
|
+
},
|
|
3480
|
+
renderToolbar(e, t) {
|
|
3481
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = {
|
|
3482
|
+
toolId: this.toolId,
|
|
3483
|
+
label: this.name,
|
|
3484
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3485
|
+
disabled: !1,
|
|
3486
|
+
ariaLabel: "Highlighter - Highlight text",
|
|
3487
|
+
tooltip: "Highlight",
|
|
3488
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3489
|
+
active: t.isToolVisible(o)
|
|
3490
|
+
}, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
|
|
3491
|
+
return i.setAttribute("tool-id", o), {
|
|
3492
|
+
toolId: this.toolId,
|
|
3493
|
+
button: n,
|
|
3494
|
+
elements: [{ element: i, mount: "after-buttons" }],
|
|
3495
|
+
sync: () => {
|
|
3496
|
+
const s = t.isToolVisible(o);
|
|
3497
|
+
n.active = s, i.enabled = s, i.visible = s, t.ttsService && (i.ttsService = t.ttsService);
|
|
3498
|
+
},
|
|
3499
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3500
|
+
s(t.isToolVisible(o));
|
|
3501
|
+
}) : () => {
|
|
3502
|
+
}
|
|
3503
|
+
};
|
|
3504
|
+
}
|
|
3505
|
+
}, Qs = {
|
|
3506
|
+
toolId: "lineReader",
|
|
3507
|
+
name: "Line Reader",
|
|
3508
|
+
description: "Reading guide overlay",
|
|
3509
|
+
icon: "bars-3",
|
|
3510
|
+
// Line reader appears where there's text to read
|
|
3511
|
+
supportedLevels: ["passage", "rubric", "item"],
|
|
3512
|
+
// PNP support IDs
|
|
3513
|
+
// Maps to QTI 3.0 standard features: readingMask, readingGuide, readingRuler
|
|
3514
|
+
pnpSupportIds: [
|
|
3515
|
+
"readingMask",
|
|
3516
|
+
// QTI 3.0 standard (reading.readingMask)
|
|
3517
|
+
"readingGuide",
|
|
3518
|
+
// QTI 3.0 standard (reading.readingGuide)
|
|
3519
|
+
"readingRuler",
|
|
3520
|
+
// QTI 3.0 standard (reading.readingRuler)
|
|
3521
|
+
"lineReader",
|
|
3522
|
+
// Common variant
|
|
3523
|
+
"trackingGuide"
|
|
3524
|
+
// Common variant
|
|
3525
|
+
],
|
|
3526
|
+
/**
|
|
3527
|
+
* Pass 2: Line reader is relevant when readable text is present
|
|
3528
|
+
*/
|
|
3529
|
+
isVisibleInContext(e) {
|
|
3530
|
+
return _o(e);
|
|
3531
|
+
},
|
|
3532
|
+
renderToolbar(e, t) {
|
|
3533
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = {
|
|
3534
|
+
toolId: this.toolId,
|
|
3535
|
+
label: this.name,
|
|
3536
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3537
|
+
disabled: !1,
|
|
3538
|
+
ariaLabel: "Line reader - Reading guide",
|
|
3539
|
+
tooltip: "Line Reader",
|
|
3540
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3541
|
+
active: t.isToolVisible(o)
|
|
3542
|
+
}, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
|
|
3543
|
+
return i.setAttribute("tool-id", o), {
|
|
3544
|
+
toolId: this.toolId,
|
|
3545
|
+
button: n,
|
|
3546
|
+
elements: [{ element: i, mount: "after-buttons" }],
|
|
3547
|
+
sync: () => {
|
|
3548
|
+
const s = t.isToolVisible(o);
|
|
3549
|
+
n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
|
|
3550
|
+
},
|
|
3551
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3552
|
+
s(t.isToolVisible(o));
|
|
3553
|
+
}) : () => {
|
|
3554
|
+
}
|
|
3555
|
+
};
|
|
3556
|
+
}
|
|
3557
|
+
}, tl = {
|
|
3558
|
+
toolId: "theme",
|
|
3559
|
+
name: "Theme",
|
|
3560
|
+
description: "Accessible themes and contrast",
|
|
3561
|
+
icon: "swatch",
|
|
3562
|
+
// Color scheme is assessment-wide
|
|
3563
|
+
supportedLevels: ["assessment", "section"],
|
|
3564
|
+
// PNP support IDs
|
|
3565
|
+
// Maps to QTI 3.0 standard features: highContrastDisplay, colorContrast, invertColors
|
|
3566
|
+
pnpSupportIds: [
|
|
3567
|
+
"highContrastDisplay",
|
|
3568
|
+
// QTI 3.0 standard (visual.highContrastDisplay)
|
|
3569
|
+
"colorContrast",
|
|
3570
|
+
// QTI 3.0 standard (visual.colorContrast)
|
|
3571
|
+
"invertColors",
|
|
3572
|
+
// QTI 3.0 standard (visual.invertColors)
|
|
3573
|
+
"colorScheme",
|
|
3574
|
+
// Legacy alias
|
|
3575
|
+
"theme",
|
|
3576
|
+
// Canonical id
|
|
3577
|
+
"highContrast",
|
|
3578
|
+
// Common variant
|
|
3579
|
+
"customColors"
|
|
3580
|
+
// Common variant
|
|
3581
|
+
],
|
|
3582
|
+
/**
|
|
3583
|
+
* Pass 2: Color scheme is always relevant when allowed
|
|
3584
|
+
*/
|
|
3585
|
+
isVisibleInContext(e) {
|
|
3586
|
+
return !0;
|
|
3587
|
+
},
|
|
3588
|
+
renderToolbar(e, t) {
|
|
3589
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = {
|
|
3590
|
+
toolId: this.toolId,
|
|
3591
|
+
label: this.name,
|
|
3592
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3593
|
+
disabled: !1,
|
|
3594
|
+
ariaLabel: "Theme - Change colors and contrast",
|
|
3595
|
+
tooltip: "Theme",
|
|
3596
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3597
|
+
active: t.isToolVisible(o)
|
|
3598
|
+
}, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
|
|
3599
|
+
return i.setAttribute("tool-id", o), {
|
|
3600
|
+
toolId: this.toolId,
|
|
3601
|
+
button: n,
|
|
3602
|
+
elements: [{ element: i, mount: "after-buttons" }],
|
|
3603
|
+
sync: () => {
|
|
3604
|
+
const s = t.isToolVisible(o);
|
|
3605
|
+
n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
|
|
3606
|
+
},
|
|
3607
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3608
|
+
s(t.isToolVisible(o));
|
|
3609
|
+
}) : () => {
|
|
3610
|
+
}
|
|
3611
|
+
};
|
|
3612
|
+
}
|
|
3613
|
+
}, el = tl, ol = {
|
|
3614
|
+
toolId: "annotationToolbar",
|
|
3615
|
+
name: "Highlighter",
|
|
3616
|
+
description: "Highlight and annotate text",
|
|
3617
|
+
icon: "highlighter",
|
|
3618
|
+
activation: "selection-gateway",
|
|
3619
|
+
singletonScope: "section",
|
|
3620
|
+
// Annotation appears where there's text content
|
|
3621
|
+
supportedLevels: ["passage", "rubric", "item", "element"],
|
|
3622
|
+
// PNP support IDs
|
|
3623
|
+
// Maps to QTI 3.0 standard features: highlighting, annotations
|
|
3624
|
+
pnpSupportIds: [
|
|
3625
|
+
"highlighting",
|
|
3626
|
+
// QTI 3.0 standard (cognitive.highlighting / reading.wordHighlighting)
|
|
3627
|
+
"annotations",
|
|
3628
|
+
// QTI 3.0 standard (cognitive.annotations)
|
|
3629
|
+
"highlighter",
|
|
3630
|
+
// Common variant
|
|
3631
|
+
"textHighlight",
|
|
3632
|
+
// Common variant
|
|
3633
|
+
"annotation"
|
|
3634
|
+
// Common variant
|
|
3635
|
+
],
|
|
3636
|
+
/**
|
|
3637
|
+
* Pass 2: Annotation is relevant when readable text is present
|
|
3638
|
+
*/
|
|
3639
|
+
isVisibleInContext(e) {
|
|
3640
|
+
return _o(e);
|
|
3641
|
+
},
|
|
3642
|
+
renderToolbar(e, t) {
|
|
3643
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = {
|
|
3644
|
+
toolId: this.toolId,
|
|
3645
|
+
label: this.name,
|
|
3646
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3647
|
+
disabled: !1,
|
|
3648
|
+
ariaLabel: "Annotation toolbar - Highlight text",
|
|
3649
|
+
tooltip: "Highlight",
|
|
3650
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3651
|
+
active: t.isToolVisible(o)
|
|
3652
|
+
}, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
|
|
3653
|
+
return i.setAttribute("tool-id", o), {
|
|
3654
|
+
toolId: this.toolId,
|
|
3655
|
+
button: n,
|
|
3656
|
+
elements: [{ element: i, mount: "after-buttons" }],
|
|
3657
|
+
sync: () => {
|
|
3658
|
+
const s = t.isToolVisible(o);
|
|
3659
|
+
n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
|
|
3660
|
+
},
|
|
3661
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3662
|
+
s(t.isToolVisible(o));
|
|
3663
|
+
}) : () => {
|
|
3664
|
+
}
|
|
3665
|
+
};
|
|
3666
|
+
}
|
|
3667
|
+
}, nl = {
|
|
3668
|
+
toolId: "graph",
|
|
3669
|
+
name: "Graph",
|
|
3670
|
+
description: "Graphing calculator and coordinate plane",
|
|
3671
|
+
icon: "chart-bar",
|
|
3672
|
+
// Graph appears at item and element level where graphing might be needed
|
|
3673
|
+
supportedLevels: ["item", "element"],
|
|
3674
|
+
// PNP support IDs
|
|
3675
|
+
// Maps to QTI 3.0 standard features: graph, graphingCalculator
|
|
3676
|
+
pnpSupportIds: [
|
|
3677
|
+
"graph",
|
|
3678
|
+
// QTI 3.0 standard (assessment.graph)
|
|
3679
|
+
"graphingCalculator",
|
|
3680
|
+
// QTI 3.0 standard (assessment.graphingCalculator)
|
|
3681
|
+
"coordinatePlane",
|
|
3682
|
+
// Common variant
|
|
3683
|
+
"graphingTool"
|
|
3684
|
+
// Common variant
|
|
3685
|
+
],
|
|
3686
|
+
/**
|
|
3687
|
+
* Pass 2: Graph is relevant when math content is present
|
|
3688
|
+
*/
|
|
3689
|
+
isVisibleInContext(e) {
|
|
3690
|
+
return xo(e);
|
|
3691
|
+
},
|
|
3692
|
+
renderToolbar(e, t) {
|
|
3693
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = {
|
|
3694
|
+
toolId: this.toolId,
|
|
3695
|
+
label: this.name,
|
|
3696
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3697
|
+
disabled: !1,
|
|
3698
|
+
ariaLabel: "Graph - Graphing calculator",
|
|
3699
|
+
tooltip: "Graph",
|
|
3700
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3701
|
+
active: t.isToolVisible(o)
|
|
3702
|
+
}, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
|
|
3703
|
+
return i.setAttribute("tool-id", o), {
|
|
3704
|
+
toolId: this.toolId,
|
|
3705
|
+
button: n,
|
|
3706
|
+
elements: [{ element: i, mount: "after-buttons" }],
|
|
3707
|
+
sync: () => {
|
|
3708
|
+
const s = t.isToolVisible(o);
|
|
3709
|
+
n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
|
|
3710
|
+
},
|
|
3711
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3712
|
+
s(t.isToolVisible(o));
|
|
3713
|
+
}) : () => {
|
|
3714
|
+
}
|
|
3715
|
+
};
|
|
3716
|
+
}
|
|
3717
|
+
}, il = {
|
|
3718
|
+
toolId: "periodicTable",
|
|
3719
|
+
name: "Periodic Table",
|
|
3720
|
+
description: "Chemistry periodic table reference",
|
|
3721
|
+
icon: "beaker",
|
|
3722
|
+
// Periodic table appears at item and element level
|
|
3723
|
+
supportedLevels: ["item", "element"],
|
|
3724
|
+
// PNP support IDs
|
|
3725
|
+
// Maps to QTI 3.0 standard feature: periodicTable
|
|
3726
|
+
pnpSupportIds: [
|
|
3727
|
+
"periodicTable",
|
|
3728
|
+
// QTI 3.0 standard (assessment.periodicTable)
|
|
3729
|
+
"chemistryReference",
|
|
3730
|
+
// Common variant
|
|
3731
|
+
"elementReference"
|
|
3732
|
+
// Common variant
|
|
3733
|
+
],
|
|
3734
|
+
/**
|
|
3735
|
+
* Pass 2: Periodic table is relevant when science content is present
|
|
3736
|
+
*/
|
|
3737
|
+
isVisibleInContext(e) {
|
|
3738
|
+
return Ps(e);
|
|
3739
|
+
},
|
|
3740
|
+
renderToolbar(e, t) {
|
|
3741
|
+
const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = {
|
|
3742
|
+
toolId: this.toolId,
|
|
3743
|
+
label: this.name,
|
|
3744
|
+
icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
|
|
3745
|
+
disabled: !1,
|
|
3746
|
+
ariaLabel: "Periodic table - Chemistry reference",
|
|
3747
|
+
tooltip: "Periodic Table",
|
|
3748
|
+
onClick: () => t.toggleTool(this.toolId),
|
|
3749
|
+
active: t.isToolVisible(o)
|
|
3750
|
+
}, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
|
|
3751
|
+
return i.setAttribute("tool-id", o), {
|
|
3752
|
+
toolId: this.toolId,
|
|
3753
|
+
button: n,
|
|
3754
|
+
elements: [{ element: i, mount: "after-buttons" }],
|
|
3755
|
+
sync: () => {
|
|
3756
|
+
const s = t.isToolVisible(o);
|
|
3757
|
+
n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
|
|
3758
|
+
},
|
|
3759
|
+
subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3760
|
+
s(t.isToolVisible(o));
|
|
3761
|
+
}) : () => {
|
|
3762
|
+
}
|
|
3763
|
+
};
|
|
3764
|
+
}
|
|
3765
|
+
};
|
|
3766
|
+
function rl(e = {}) {
|
|
3767
|
+
const t = new Os(), o = {
|
|
3768
|
+
toolTagMap: {
|
|
3769
|
+
...qi,
|
|
3770
|
+
...e.toolTagMap || {}
|
|
3771
|
+
},
|
|
3772
|
+
toolComponentFactory: e.toolComponentFactory,
|
|
3773
|
+
toolComponentFactories: e.toolComponentFactories
|
|
3774
|
+
}, n = (r) => e.overrides?.[r.toolId] || r;
|
|
3775
|
+
return t.register(n(Us)), t.register(n(Ks)), t.register(n(Js)), t.register(n(Zs)), t.register(n(Xs)), t.register(n(Ys)), t.register(n(Qs)), t.register(n(el)), t.register(n(ol)), t.register(n(nl)), t.register(n(il)), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(o), t;
|
|
3776
|
+
}
|
|
3777
|
+
function sl() {
|
|
3778
|
+
const e = rl(), t = /* @__PURE__ */ new Set();
|
|
3779
|
+
for (const o of e.getAllTools())
|
|
3780
|
+
for (const n of o.pnpSupportIds || [])
|
|
3781
|
+
t.add(n);
|
|
3782
|
+
return [...t].sort();
|
|
3783
|
+
}
|
|
3784
|
+
sl();
|
|
3785
|
+
const ll = {
|
|
3786
|
+
/**
|
|
3787
|
+
* Visual accessibility features
|
|
3788
|
+
* For students with low vision, color blindness, or visual processing needs
|
|
3789
|
+
*/
|
|
3790
|
+
visual: {
|
|
3791
|
+
// Magnification and zoom
|
|
3792
|
+
magnification: "magnification",
|
|
3793
|
+
screenMagnifier: "screenMagnifier",
|
|
3794
|
+
zoomable: "zoomable",
|
|
3795
|
+
// Color and contrast
|
|
3796
|
+
highContrastDisplay: "highContrastDisplay",
|
|
3797
|
+
highContrastAudio: "highContrastAudio",
|
|
3798
|
+
colorContrast: "colorContrast",
|
|
3799
|
+
invertColors: "invertColors",
|
|
3800
|
+
// Display customization
|
|
3801
|
+
displayTransformability: "displayTransformability",
|
|
3802
|
+
largePrint: "largePrint",
|
|
3803
|
+
fontEnlargement: "fontEnlargement",
|
|
3804
|
+
resizeText: "resizeText",
|
|
3805
|
+
// Visual alternatives
|
|
3806
|
+
alternativeText: "alternativeText",
|
|
3807
|
+
longDescription: "longDescription",
|
|
3808
|
+
describedMath: "describedMath",
|
|
3809
|
+
tactileGraphic: "tactileGraphic",
|
|
3810
|
+
tactileObject: "tactileObject"
|
|
3811
|
+
},
|
|
3812
|
+
/**
|
|
3813
|
+
* Auditory accessibility features
|
|
3814
|
+
* For students who are deaf, hard of hearing, or benefit from audio
|
|
3815
|
+
*/
|
|
3816
|
+
auditory: {
|
|
3817
|
+
// Audio output
|
|
3818
|
+
audioDescription: "audioDescription",
|
|
3819
|
+
textToSpeech: "textToSpeech",
|
|
3820
|
+
readAloud: "readAloud",
|
|
3821
|
+
humanVoice: "humanVoice",
|
|
3822
|
+
syntheticVoice: "syntheticVoice",
|
|
3823
|
+
// Speech control
|
|
3824
|
+
speechRate: "speechRate",
|
|
3825
|
+
speechVolume: "speechVolume",
|
|
3826
|
+
voicePitch: "voicePitch",
|
|
3827
|
+
// Visual alternatives for audio
|
|
3828
|
+
captions: "captions",
|
|
3829
|
+
closedCaptions: "closedCaptions",
|
|
3830
|
+
openCaptions: "openCaptions",
|
|
3831
|
+
transcript: "transcript",
|
|
3832
|
+
signLanguage: "signLanguage",
|
|
3833
|
+
subtitles: "subtitles",
|
|
3834
|
+
// Audio adjustments
|
|
3835
|
+
audioControl: "audioControl",
|
|
3836
|
+
noBackgroundAudio: "noBackgroundAudio"
|
|
3837
|
+
},
|
|
3838
|
+
/**
|
|
3839
|
+
* Motor/physical accessibility features
|
|
3840
|
+
* For students with limited mobility or motor control
|
|
3841
|
+
*/
|
|
3842
|
+
motor: {
|
|
3843
|
+
// Input alternatives
|
|
3844
|
+
keyboardControl: "keyboardControl",
|
|
3845
|
+
mouseControl: "mouseControl",
|
|
3846
|
+
touchControl: "touchControl",
|
|
3847
|
+
voiceControl: "voiceControl",
|
|
3848
|
+
switchControl: "switchControl",
|
|
3849
|
+
eyeGazeControl: "eyeGazeControl",
|
|
3850
|
+
// Keyboard features
|
|
3851
|
+
singleSwitchAccess: "singleSwitchAccess",
|
|
3852
|
+
stickyKeys: "stickyKeys",
|
|
3853
|
+
keyboardShortcuts: "keyboardShortcuts",
|
|
3854
|
+
// Timing
|
|
3855
|
+
timingControl: "timingControl",
|
|
3856
|
+
unlimitedTime: "unlimitedTime",
|
|
3857
|
+
extendedTime: "extendedTime",
|
|
3858
|
+
pauseControl: "pauseControl"
|
|
3859
|
+
},
|
|
3860
|
+
/**
|
|
3861
|
+
* Cognitive/learning accessibility features
|
|
3862
|
+
* For students with learning disabilities, ADHD, autism, etc.
|
|
3863
|
+
*/
|
|
3864
|
+
cognitive: {
|
|
3865
|
+
// Content simplification
|
|
3866
|
+
simplifiedLanguage: "simplifiedLanguage",
|
|
3867
|
+
reducedComplexity: "reducedComplexity",
|
|
3868
|
+
structuralNavigation: "structuralNavigation",
|
|
3869
|
+
tableOfContents: "tableOfContents",
|
|
3870
|
+
// Focus and attention
|
|
3871
|
+
reducedDistraction: "reducedDistraction",
|
|
3872
|
+
noFlashing: "noFlashing",
|
|
3873
|
+
pauseAnimation: "pauseAnimation",
|
|
3874
|
+
// Organization and support
|
|
3875
|
+
annotations: "annotations",
|
|
3876
|
+
bookmarking: "bookmarking",
|
|
3877
|
+
highlighting: "highlighting",
|
|
3878
|
+
guidedNavigation: "guidedNavigation",
|
|
3879
|
+
// Tools
|
|
3880
|
+
calculator: "calculator",
|
|
3881
|
+
thesaurus: "thesaurus",
|
|
3882
|
+
spellingAssistance: "spellingAssistance",
|
|
3883
|
+
grammarAssistance: "grammarAssistance"
|
|
3884
|
+
},
|
|
3885
|
+
/**
|
|
3886
|
+
* Reading support features
|
|
3887
|
+
* For students with dyslexia or reading challenges
|
|
3888
|
+
*/
|
|
3889
|
+
reading: {
|
|
3890
|
+
// Text presentation
|
|
3891
|
+
lineSpacing: "lineSpacing",
|
|
3892
|
+
wordSpacing: "wordSpacing",
|
|
3893
|
+
letterSpacing: "letterSpacing",
|
|
3894
|
+
fontFamily: "fontFamily",
|
|
3895
|
+
readingMask: "readingMask",
|
|
3896
|
+
readingGuide: "readingGuide",
|
|
3897
|
+
readingRuler: "readingRuler",
|
|
3898
|
+
// Highlighting and emphasis
|
|
3899
|
+
wordHighlighting: "wordHighlighting",
|
|
3900
|
+
lineHighlighting: "lineHighlighting",
|
|
3901
|
+
focusIndicator: "focusIndicator",
|
|
3902
|
+
// Content support
|
|
3903
|
+
printableResource: "printableResource",
|
|
3904
|
+
braille: "braille",
|
|
3905
|
+
nemeth: "nemeth",
|
|
3906
|
+
refreshableBraille: "refreshableBraille"
|
|
3907
|
+
},
|
|
3908
|
+
/**
|
|
3909
|
+
* Navigation features
|
|
3910
|
+
* For efficient content navigation
|
|
3911
|
+
*/
|
|
3912
|
+
navigation: {
|
|
3913
|
+
// Structure
|
|
3914
|
+
index: "index",
|
|
3915
|
+
pageNavigation: "pageNavigation",
|
|
3916
|
+
skipContent: "skipContent",
|
|
3917
|
+
breadcrumbs: "breadcrumbs",
|
|
3918
|
+
// Search
|
|
3919
|
+
searchable: "searchable",
|
|
3920
|
+
fullTextSearch: "fullTextSearch"
|
|
3921
|
+
},
|
|
3922
|
+
/**
|
|
3923
|
+
* Linguistic features
|
|
3924
|
+
* For language support
|
|
3925
|
+
*/
|
|
3926
|
+
linguistic: {
|
|
3927
|
+
// Languages
|
|
3928
|
+
multilingualText: "multilingualText",
|
|
3929
|
+
translatedText: "translatedText",
|
|
3930
|
+
glossary: "glossary",
|
|
3931
|
+
// Sign language
|
|
3932
|
+
signLanguageInterpretation: "signLanguageInterpretation",
|
|
3933
|
+
visualLanguage: "visualLanguage"
|
|
3934
|
+
},
|
|
3935
|
+
/**
|
|
3936
|
+
* Assessment-specific features
|
|
3937
|
+
* Features specific to test-taking environments
|
|
3938
|
+
*/
|
|
3939
|
+
assessment: {
|
|
3940
|
+
// Tools
|
|
3941
|
+
protractor: "protractor",
|
|
3942
|
+
ruler: "ruler",
|
|
3943
|
+
graph: "graph",
|
|
3944
|
+
graphingCalculator: "graphingCalculator",
|
|
3945
|
+
periodicTable: "periodicTable",
|
|
3946
|
+
formulaSheet: "formulaSheet",
|
|
3947
|
+
// Answer support
|
|
3948
|
+
answerMasking: "answerMasking",
|
|
3949
|
+
answerEliminator: "answerEliminator",
|
|
3950
|
+
strikethrough: "strikethrough",
|
|
3951
|
+
// Item features
|
|
3952
|
+
itemGlossary: "itemGlossary",
|
|
3953
|
+
tutorialAvailable: "tutorialAvailable"
|
|
3954
|
+
}
|
|
3955
|
+
};
|
|
3956
|
+
Object.values(ll).flatMap((e) => Object.values(e));
|
|
3957
|
+
var Vn;
|
|
3958
|
+
(function(e) {
|
|
3959
|
+
e[e.BASE = 0] = "BASE", e[e.TOOL = 1e3] = "TOOL", e[e.MODAL = 2e3] = "MODAL", e[e.CONTROL = 3e3] = "CONTROL", e[e.HIGHLIGHT = 4e3] = "HIGHLIGHT";
|
|
3960
|
+
})(Vn || (Vn = {}));
|
|
3961
|
+
var Mn;
|
|
3962
|
+
(function(e) {
|
|
3963
|
+
e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
|
|
3964
|
+
})(Mn || (Mn = {}));
|
|
3965
|
+
var al = /* @__PURE__ */ Zt('<link rel="stylesheet" href="./highlights.css"/>'), cl = /* @__PURE__ */ Zt('<button class="pie-tool-annotation-toolbar__highlight-swatch svelte-g8qu62"><span class="pie-sr-only svelte-g8qu62"> </span></button>'), ul = /* @__PURE__ */ Zt('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Read selected text aloud" title="Read Aloud"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"></path></svg></button>', 1), fl = /* @__PURE__ */ Zt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--warning svelte-g8qu62" aria-label="Remove this annotation" title="Remove"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg></button>'), hl = /* @__PURE__ */ Zt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--danger svelte-g8qu62" aria-label="Clear all annotations from document" title="Clear All">Clear All</button>'), dl = /* @__PURE__ */ Zt('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <!> <!>', 1), pl = /* @__PURE__ */ Zt('<div class="pie-tool-annotation-toolbar notranslate svelte-g8qu62" role="toolbar" aria-label="Text annotation toolbar" translate="no"><!> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Underline selected text" title="Underline"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z"></path></svg></button> <!> <!></div>'), vl = /* @__PURE__ */ Zt('<div style="display: none;" aria-hidden="true"></div> <!> <div role="status" aria-live="polite" aria-atomic="true" class="pie-sr-only svelte-g8qu62"> </div>', 1);
|
|
3966
|
+
const gl = {
|
|
3967
|
+
hash: "svelte-g8qu62",
|
|
3968
|
+
code: `.pie-tool-annotation-toolbar.svelte-g8qu62 {position:fixed;z-index:4200;display:flex;gap:0.25rem;padding:0.5rem;border-radius:0.5rem;background:var(--pie-background, #fff);color:var(--pie-text, #111827);border:1px solid var(--pie-border, #d1d5db);box-shadow:0 10px 25px -8px rgb(0 0 0 / 0.3);user-select:none;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62 {width:2.5rem;height:2rem;border:2px solid color-mix(in srgb, var(--pie-border-dark, #111827) 20%, transparent);border-radius:0.375rem;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;padding:0;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62:hover {transform:scale(1.1);border-color:color-mix(in srgb, var(--pie-border-dark, #111827) 45%, transparent);box-shadow:0 2px 8px rgb(0 0 0 / 0.15);}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar.svelte-g8qu62 .divider-horizontal:where(.svelte-g8qu62) {height:auto;width:1px;background-color:color-mix(in srgb, var(--pie-border, #d1d5db) 70%, transparent);}
|
|
3969
|
+
|
|
3970
|
+
/* Screen reader only content */.pie-sr-only.svelte-g8qu62 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;}
|
|
3971
|
+
|
|
3972
|
+
/* Button styling */.pie-tool-annotation-toolbar__button.svelte-g8qu62 {display:inline-flex;align-items:center;justify-content:center;gap:0.35rem;padding:0.4rem 0.55rem;border:1px solid var(--pie-button-border, #d1d5db);border-radius:0.4rem;background:var(--pie-button-bg, #fff);color:var(--pie-button-color, var(--pie-text, #111827));cursor:pointer;}.pie-tool-annotation-toolbar__button--icon.svelte-g8qu62 {min-width:2rem;min-height:2rem;padding:0.45rem;}.pie-tool-annotation-toolbar__button.svelte-g8qu62:hover {background:var(--pie-button-hover-bg, #f9fafb);color:var(--pie-button-hover-color, var(--pie-text, #111827));border-color:var(--pie-button-hover-border, #9ca3af);}.pie-tool-annotation-toolbar__button.svelte-g8qu62:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar__button.svelte-g8qu62:disabled {opacity:0.6;cursor:not-allowed;}.pie-tool-annotation-toolbar__button--warning.svelte-g8qu62 {color:var(--pie-missing-icon, #92400e);}.pie-tool-annotation-toolbar__button--danger.svelte-g8qu62 {color:var(--pie-incorrect-icon, #b91c1c);}.pie-tool-annotation-toolbar__button.svelte-g8qu62 svg:where(.svelte-g8qu62) {width:18px;height:18px;}`
|
|
3973
|
+
};
|
|
3974
|
+
function bl(e, t) {
|
|
3975
|
+
Bn(t, !0), vs(e, gl);
|
|
3976
|
+
let o = Eo(t, "enabled", 7, !0), n = Eo(t, "highlightCoordinator", 7, null), r = Eo(t, "ttsService", 7, null);
|
|
3977
|
+
const i = typeof window < "u", s = "pie-annotations", l = [
|
|
3978
|
+
{
|
|
3979
|
+
name: Bt.YELLOW,
|
|
3980
|
+
hex: "#fde995",
|
|
3981
|
+
label: "Yellow highlight"
|
|
3982
|
+
},
|
|
3983
|
+
{
|
|
3984
|
+
name: Bt.PINK,
|
|
3985
|
+
hex: "#ff9fae",
|
|
3986
|
+
label: "Pink highlight"
|
|
3987
|
+
},
|
|
3988
|
+
{
|
|
3989
|
+
name: Bt.BLUE,
|
|
3990
|
+
hex: "#a7e0f6",
|
|
3991
|
+
label: "Blue highlight"
|
|
3992
|
+
},
|
|
3993
|
+
{
|
|
3994
|
+
name: Bt.GREEN,
|
|
3995
|
+
hex: "#a6e1c5",
|
|
3996
|
+
label: "Green highlight"
|
|
3997
|
+
}
|
|
3998
|
+
], a = [
|
|
3999
|
+
"button",
|
|
4000
|
+
"input",
|
|
4001
|
+
"select",
|
|
4002
|
+
"textarea",
|
|
4003
|
+
'[contenteditable="true"]',
|
|
4004
|
+
".pie-tool-annotation-toolbar",
|
|
4005
|
+
".pie-tool-toolbar",
|
|
4006
|
+
'[role="button"]',
|
|
4007
|
+
'[role="textbox"]'
|
|
4008
|
+
];
|
|
4009
|
+
let c = /* @__PURE__ */ R(null), f = /* @__PURE__ */ R(null), p = /* @__PURE__ */ R(null), v = /* @__PURE__ */ R(null), d = /* @__PURE__ */ R(ve({
|
|
4010
|
+
isVisible: !1,
|
|
4011
|
+
selectedText: "",
|
|
4012
|
+
selectedRange: null,
|
|
4013
|
+
toolbarPosition: { x: 0, y: 0 }
|
|
4014
|
+
})), h = /* @__PURE__ */ R(!1), m = /* @__PURE__ */ R(
|
|
4015
|
+
!1
|
|
4016
|
+
// Flag to prevent immediate hiding after showing
|
|
4017
|
+
), y = /* @__PURE__ */ R(
|
|
4018
|
+
""
|
|
4019
|
+
// For screen readers when toolbar is repositioned
|
|
4020
|
+
), k = /* @__PURE__ */ R(0), I = /* @__PURE__ */ R(null), vt = /* @__PURE__ */ Ao(() => b(k) > 0), xt = /* @__PURE__ */ Ao(() => b(I) !== null), W = /* @__PURE__ */ Ao(() => b(v)?.scopeElement || b(p)?.scopeElement || null);
|
|
4021
|
+
function _t() {
|
|
4022
|
+
const g = b(c)?.ownerDocument;
|
|
4023
|
+
return b(W) || g?.documentElement || document.documentElement;
|
|
4024
|
+
}
|
|
4025
|
+
function gt() {
|
|
4026
|
+
const g = b(p)?.canonicalItemId || b(p)?.itemId || "global";
|
|
4027
|
+
return `${s}:${g}`;
|
|
4028
|
+
}
|
|
4029
|
+
function O(g) {
|
|
4030
|
+
if (!n()) return null;
|
|
4031
|
+
const w = n().getAnnotations();
|
|
4032
|
+
for (const A of w) {
|
|
4033
|
+
const D = g.compareBoundaryPoints(Range.START_TO_START, A.range), Xt = g.compareBoundaryPoints(Range.END_TO_END, A.range), Ce = g.compareBoundaryPoints(Range.START_TO_END, A.range), Ae = g.compareBoundaryPoints(Range.END_TO_START, A.range);
|
|
4034
|
+
if (D >= 0 && Xt <= 0 || // selection inside annotation
|
|
4035
|
+
D <= 0 && Xt >= 0 || // annotation inside selection
|
|
4036
|
+
Ce > 0 && Ae < 0)
|
|
4037
|
+
return A.id;
|
|
4038
|
+
}
|
|
4039
|
+
return null;
|
|
4040
|
+
}
|
|
4041
|
+
function So(g) {
|
|
4042
|
+
if (g.nodeType !== Node.ELEMENT_NODE && g.nodeType !== Node.TEXT_NODE)
|
|
4043
|
+
return !1;
|
|
4044
|
+
const w = g.nodeType === Node.TEXT_NODE ? g.parentElement : g;
|
|
4045
|
+
return w ? !a.some((A) => {
|
|
4046
|
+
try {
|
|
4047
|
+
return w.closest(A) !== null;
|
|
4048
|
+
} catch {
|
|
4049
|
+
return !1;
|
|
4050
|
+
}
|
|
4051
|
+
}) : !1;
|
|
4052
|
+
}
|
|
4053
|
+
function ko(g) {
|
|
4054
|
+
if (!b(W)) return !0;
|
|
4055
|
+
const w = g.commonAncestorContainer, A = w.nodeType === Node.TEXT_NODE ? w.parentElement : w;
|
|
4056
|
+
return !!A && b(W).contains(A);
|
|
4057
|
+
}
|
|
4058
|
+
function an() {
|
|
4059
|
+
if (!(!i || !n()))
|
|
4060
|
+
try {
|
|
4061
|
+
const g = _t(), w = n().exportAnnotations(g);
|
|
4062
|
+
sessionStorage.setItem(gt(), JSON.stringify(w));
|
|
4063
|
+
} catch (g) {
|
|
4064
|
+
console.error("[AnnotationToolbar] Failed to save annotations:", g);
|
|
4065
|
+
}
|
|
4066
|
+
}
|
|
4067
|
+
function Wi() {
|
|
4068
|
+
if (!(!i || !n()))
|
|
4069
|
+
try {
|
|
4070
|
+
const g = sessionStorage.getItem(gt());
|
|
4071
|
+
if (!g) return;
|
|
4072
|
+
const w = JSON.parse(g), A = _t(), D = n().importAnnotations(w, A);
|
|
4073
|
+
console.log(`[AnnotationToolbar] Restored ${D} annotations`), C(k, n().getAnnotations().length, !0);
|
|
4074
|
+
} catch (g) {
|
|
4075
|
+
console.error("[AnnotationToolbar] Failed to load annotations:", g);
|
|
4076
|
+
}
|
|
4077
|
+
}
|
|
4078
|
+
function Ue() {
|
|
4079
|
+
if (!o() || !i) return;
|
|
4080
|
+
const g = window.getSelection();
|
|
4081
|
+
if (!g || g.rangeCount === 0) return St();
|
|
4082
|
+
const w = g.getRangeAt(0), A = g.toString().trim();
|
|
4083
|
+
if (!A || !ko(w) || !So(w.commonAncestorContainer))
|
|
4084
|
+
return St();
|
|
4085
|
+
const D = w.getBoundingClientRect(), Xt = D.left + D.width / 2, Ce = D.top - 8;
|
|
4086
|
+
C(I, O(w), !0), b(d).isVisible = !0, b(d).selectedText = A, b(d).selectedRange = w.cloneRange(), b(d).toolbarPosition = { x: Xt, y: Ce };
|
|
4087
|
+
const Ae = A.length > 30 ? A.substring(0, 30) + "..." : A;
|
|
4088
|
+
C(y, `Annotation toolbar opened for "${Ae}"`), setTimeout(
|
|
4089
|
+
() => {
|
|
4090
|
+
C(y, "");
|
|
4091
|
+
},
|
|
4092
|
+
2e3
|
|
4093
|
+
), C(m, !0), setTimeout(
|
|
4094
|
+
() => {
|
|
4095
|
+
C(m, !1);
|
|
4096
|
+
},
|
|
4097
|
+
100
|
|
4098
|
+
);
|
|
4099
|
+
}
|
|
4100
|
+
function St() {
|
|
4101
|
+
b(h) && r() && (r().stop(), C(h, !1)), b(d).isVisible = !1, b(d).selectedText = "", b(d).selectedRange = null;
|
|
4102
|
+
}
|
|
4103
|
+
function cn(g) {
|
|
4104
|
+
if (!b(d).selectedRange || !n()) return;
|
|
4105
|
+
const w = b(d).selectedText;
|
|
4106
|
+
n().addAnnotation(b(d).selectedRange, g), C(k, n().getAnnotations().length, !0), an();
|
|
4107
|
+
const A = g === Bt.UNDERLINE ? "underlined" : `highlighted in ${g}`, D = w.length > 30 ? w.substring(0, 30) + "..." : w;
|
|
4108
|
+
C(y, `"${D}" ${A}`), setTimeout(
|
|
4109
|
+
() => {
|
|
4110
|
+
C(y, "");
|
|
4111
|
+
},
|
|
4112
|
+
3e3
|
|
4113
|
+
), St();
|
|
4114
|
+
}
|
|
4115
|
+
function Di() {
|
|
4116
|
+
if (!b(I) || !n()) {
|
|
4117
|
+
console.warn("[AnnotationToolbar] No overlapping annotation to remove");
|
|
4118
|
+
return;
|
|
4119
|
+
}
|
|
4120
|
+
console.log("[AnnotationToolbar] Removing annotation:", b(I));
|
|
4121
|
+
const g = n().getAnnotation(b(I));
|
|
4122
|
+
if (!g) {
|
|
4123
|
+
console.warn("[AnnotationToolbar] Annotation not found:", b(I));
|
|
4124
|
+
return;
|
|
4125
|
+
}
|
|
4126
|
+
const w = g.range.toString();
|
|
4127
|
+
n().removeAnnotation(b(I));
|
|
4128
|
+
const A = n().getAnnotations().length;
|
|
4129
|
+
C(k, A, !0), console.log("[AnnotationToolbar] Annotations remaining:", A), an();
|
|
4130
|
+
const D = w.length > 30 ? w.substring(0, 30) + "..." : w;
|
|
4131
|
+
C(y, `Removed annotation from "${D}"`), setTimeout(
|
|
4132
|
+
() => {
|
|
4133
|
+
C(y, "");
|
|
4134
|
+
},
|
|
4135
|
+
3e3
|
|
4136
|
+
), St();
|
|
4137
|
+
}
|
|
4138
|
+
function Hi() {
|
|
4139
|
+
const g = b(k);
|
|
4140
|
+
n()?.clearAnnotations(), C(k, 0), sessionStorage.removeItem(gt()), C(y, `${g} annotation${g === 1 ? "" : "s"} cleared`), setTimeout(
|
|
4141
|
+
() => {
|
|
4142
|
+
C(y, "");
|
|
4143
|
+
},
|
|
4144
|
+
3e3
|
|
4145
|
+
), St();
|
|
4146
|
+
}
|
|
4147
|
+
async function Bi() {
|
|
4148
|
+
if (!(!b(d).selectedRange || !r())) {
|
|
4149
|
+
C(h, !0);
|
|
4150
|
+
try {
|
|
4151
|
+
console.log("[AnnotationToolbar] Speaking range:", b(d).selectedRange.toString().substring(0, 50)), await r().speakRange(b(d).selectedRange, { contentRoot: _t() }), console.log("[AnnotationToolbar] TTS completed successfully");
|
|
4152
|
+
} catch (g) {
|
|
4153
|
+
console.error("[AnnotationToolbar] TTS error:", g), alert(`TTS failed: ${g instanceof Error ? g.message : String(g)}`);
|
|
4154
|
+
} finally {
|
|
4155
|
+
C(h, !1);
|
|
4156
|
+
}
|
|
4157
|
+
}
|
|
4158
|
+
}
|
|
4159
|
+
function un(g) {
|
|
4160
|
+
g.key === "Escape" && b(d).isVisible && (g.preventDefault(), St());
|
|
4161
|
+
}
|
|
4162
|
+
function Ke(g) {
|
|
4163
|
+
!b(d).isVisible || b(m) || b(f) && !b(f).contains(g.target) && St();
|
|
4164
|
+
}
|
|
4165
|
+
wn(() => {
|
|
4166
|
+
if (!i) return;
|
|
4167
|
+
const g = setTimeout(
|
|
4168
|
+
() => {
|
|
4169
|
+
Wi();
|
|
4170
|
+
},
|
|
4171
|
+
2e3
|
|
4172
|
+
), w = b(W) || document;
|
|
4173
|
+
return w.addEventListener("mouseup", Ue), w.addEventListener("click", Ke), w.addEventListener("touchend", Ue), w.addEventListener("touchstart", Ke), document.addEventListener("keydown", un), window.addEventListener("scroll", St, !0), () => {
|
|
4174
|
+
clearTimeout(g), w.removeEventListener("mouseup", Ue), w.removeEventListener("click", Ke), w.removeEventListener("touchend", Ue), w.removeEventListener("touchstart", Ke), document.removeEventListener("keydown", un), window.removeEventListener("scroll", St, !0);
|
|
4175
|
+
};
|
|
4176
|
+
}), wn(() => {
|
|
4177
|
+
if (!b(c)) return;
|
|
4178
|
+
const g = Ls(b(c), (A) => {
|
|
4179
|
+
C(p, A, !0);
|
|
4180
|
+
}), w = Es(b(c), (A) => {
|
|
4181
|
+
C(v, A, !0);
|
|
4182
|
+
});
|
|
4183
|
+
return () => {
|
|
4184
|
+
w(), g();
|
|
4185
|
+
};
|
|
4186
|
+
});
|
|
4187
|
+
var zi = {
|
|
4188
|
+
get enabled() {
|
|
4189
|
+
return o();
|
|
4190
|
+
},
|
|
4191
|
+
set enabled(g = !0) {
|
|
4192
|
+
o(g), no();
|
|
4193
|
+
},
|
|
4194
|
+
get highlightCoordinator() {
|
|
4195
|
+
return n();
|
|
4196
|
+
},
|
|
4197
|
+
set highlightCoordinator(g = null) {
|
|
4198
|
+
n(g), no();
|
|
4199
|
+
},
|
|
4200
|
+
get ttsService() {
|
|
4201
|
+
return r();
|
|
4202
|
+
},
|
|
4203
|
+
set ttsService(g = null) {
|
|
4204
|
+
r(g), no();
|
|
4205
|
+
}
|
|
4206
|
+
}, fn = vl();
|
|
4207
|
+
ps("g8qu62", (g) => {
|
|
4208
|
+
var w = al();
|
|
4209
|
+
Ct(g, w);
|
|
4210
|
+
});
|
|
4211
|
+
var hn = Lo(fn);
|
|
4212
|
+
Ln(hn, (g) => C(c, g), () => b(c));
|
|
4213
|
+
var dn = Ot(hn, 2);
|
|
4214
|
+
{
|
|
4215
|
+
var Gi = (g) => {
|
|
4216
|
+
var w = pl(), A = Xe(w);
|
|
4217
|
+
fs(A, 17, () => l, cs, (nt, it) => {
|
|
4218
|
+
var U = cl(), Je = Xe(U), Co = Xe(Je, !0);
|
|
4219
|
+
Ze(Je), Ze(U), Ye(() => {
|
|
4220
|
+
Sn(U, `background-color: ${b(it).hex ?? ""};`), kn(U, "aria-label", b(it).label), kn(U, "title", b(it).label), _n(Co, b(it).label);
|
|
4221
|
+
}), Ee("click", U, () => cn(b(it).name)), Ct(nt, U);
|
|
4222
|
+
});
|
|
4223
|
+
var D = Ot(A, 2), Xt = Ot(D, 2);
|
|
4224
|
+
{
|
|
4225
|
+
var Ce = (nt) => {
|
|
4226
|
+
var it = ul(), U = Ot(Lo(it), 2);
|
|
4227
|
+
Ye(() => U.disabled = b(h)), Ee("click", U, Bi), Ct(nt, it);
|
|
4228
|
+
};
|
|
4229
|
+
Ve(Xt, (nt) => {
|
|
4230
|
+
r() && nt(Ce);
|
|
4231
|
+
});
|
|
4232
|
+
}
|
|
4233
|
+
var Ae = Ot(Xt, 2);
|
|
4234
|
+
{
|
|
4235
|
+
var Ui = (nt) => {
|
|
4236
|
+
var it = dl(), U = Ot(Lo(it), 2);
|
|
4237
|
+
{
|
|
4238
|
+
var Je = (Yt) => {
|
|
4239
|
+
var Le = fl();
|
|
4240
|
+
Ee("click", Le, Di), Ct(Yt, Le);
|
|
4241
|
+
};
|
|
4242
|
+
Ve(U, (Yt) => {
|
|
4243
|
+
b(xt) && Yt(Je);
|
|
4244
|
+
});
|
|
4245
|
+
}
|
|
4246
|
+
var Co = Ot(U, 2);
|
|
4247
|
+
{
|
|
4248
|
+
var Ki = (Yt) => {
|
|
4249
|
+
var Le = hl();
|
|
4250
|
+
Ee("click", Le, Hi), Ct(Yt, Le);
|
|
4251
|
+
};
|
|
4252
|
+
Ve(Co, (Yt) => {
|
|
4253
|
+
b(vt) && Yt(Ki);
|
|
4254
|
+
});
|
|
4255
|
+
}
|
|
4256
|
+
Ct(nt, it);
|
|
4257
|
+
};
|
|
4258
|
+
Ve(Ae, (nt) => {
|
|
4259
|
+
(b(xt) || b(vt)) && nt(Ui);
|
|
4260
|
+
});
|
|
4261
|
+
}
|
|
4262
|
+
Ze(w), Ln(w, (nt) => C(f, nt), () => b(f)), Ye(() => Sn(w, `left:${b(d).toolbarPosition.x}px; top:${b(d).toolbarPosition.y}px; transform: translate(-50%, -100%);`)), Ee("click", D, () => cn(Bt.UNDERLINE)), Ct(g, w);
|
|
4263
|
+
};
|
|
4264
|
+
Ve(dn, (g) => {
|
|
4265
|
+
b(d).isVisible && g(Gi);
|
|
4266
|
+
});
|
|
4267
|
+
}
|
|
4268
|
+
var pn = Ot(dn, 2), Fi = Xe(pn, !0);
|
|
4269
|
+
return Ze(pn), Ye(() => _n(Fi, b(y))), Ct(e, fn), zn(zi);
|
|
4270
|
+
}
|
|
4271
|
+
ts(["click"]);
|
|
4272
|
+
customElements.define("pie-tool-annotation-toolbar", _s(
|
|
4273
|
+
bl,
|
|
4274
|
+
{
|
|
4275
|
+
enabled: { attribute: "enabled", type: "Boolean" },
|
|
4276
|
+
highlightCoordinator: { type: "Object" },
|
|
4277
|
+
ttsService: { type: "Object" }
|
|
4278
|
+
},
|
|
4279
|
+
[],
|
|
4280
|
+
[],
|
|
4281
|
+
{ mode: "open" }
|
|
4282
|
+
));
|
|
4283
|
+
export {
|
|
4284
|
+
bl as default
|
|
4285
|
+
};
|