@pie-players/pie-tool-answer-eliminator 0.2.9 → 0.2.10

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.
@@ -1,126 +1,126 @@
1
- var Sn = Object.defineProperty;
2
- var Zt = (t) => {
1
+ var Rn = Object.defineProperty;
2
+ var li = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
- var An = (t, e, i) => e in t ? Sn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
6
- var f = (t, e, i) => An(t, typeof e != "symbol" ? e + "" : e, i), Ct = (t, e, i) => e.has(t) || Zt("Cannot " + i);
7
- var c = (t, e, i) => (Ct(t, e, "read from private field"), i ? i.call(t) : e.get(t)), w = (t, e, i) => e.has(t) ? Zt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), v = (t, e, i, n) => (Ct(t, e, "write to private field"), n ? n.call(t, i) : e.set(t, i), i), V = (t, e, i) => (Ct(t, e, "access private method"), i);
8
- var pi;
9
- typeof window < "u" && ((pi = window.__svelte ?? (window.__svelte = {})).v ?? (pi.v = /* @__PURE__ */ new Set())).add("5");
10
- const In = 2, gi = "[", mi = "[!", vi = "]", mt = {}, k = /* @__PURE__ */ Symbol(), En = "http://www.w3.org/1999/xhtml", kt = !1;
11
- var $n = Array.isArray, Cn = Array.prototype.indexOf, Ge = Array.prototype.includes, kn = Array.from, vt = Object.keys, bt = Object.defineProperty, De = Object.getOwnPropertyDescriptor, Rn = Object.prototype, On = Array.prototype, Ln = Object.getPrototypeOf, ei = Object.isExtensible;
12
- const Vn = () => {
5
+ var On = (t, e, i) => e in t ? Rn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
6
+ var f = (t, e, i) => On(t, typeof e != "symbol" ? e + "" : e, i), Ht = (t, e, i) => e.has(t) || li("Cannot " + i);
7
+ var c = (t, e, i) => (Ht(t, e, "read from private field"), i ? i.call(t) : e.get(t)), A = (t, e, i) => e.has(t) ? li("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), _ = (t, e, i, n) => (Ht(t, e, "write to private field"), n ? n.call(t, i) : e.set(t, i), i), D = (t, e, i) => (Ht(t, e, "access private method"), i);
8
+ var Ai;
9
+ typeof window < "u" && ((Ai = window.__svelte ?? (window.__svelte = {})).v ?? (Ai.v = /* @__PURE__ */ new Set())).add("5");
10
+ const kn = 2, Ii = "[", Ei = "[!", wi = "]", yt = {}, N = /* @__PURE__ */ Symbol(), Hn = "http://www.w3.org/1999/xhtml", Nt = !1;
11
+ var Nn = Array.isArray, Vn = Array.prototype.indexOf, Xe = Array.prototype.includes, Mn = Array.from, Tt = Object.keys, At = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, Fn = Object.prototype, Dn = Array.prototype, Pn = Object.getPrototypeOf, ai = Object.isExtensible;
12
+ const Bn = () => {
13
13
  };
14
- function Nn(t) {
14
+ function Gn(t) {
15
15
  for (var e = 0; e < t.length; e++)
16
16
  t[e]();
17
17
  }
18
- function Mn() {
19
- var t, e, i = new Promise((n, r) => {
20
- t = n, e = r;
18
+ function jn() {
19
+ var t, e, i = new Promise((n, s) => {
20
+ t = n, e = s;
21
21
  });
22
22
  return { promise: i, resolve: t, reject: e };
23
23
  }
24
- const C = 2, Ze = 4, bi = 8, yi = 1 << 24, ge = 16, me = 32, Ae = 64, Rt = 128, z = 512, R = 1024, L = 2048, Z = 4096, ye = 8192, _e = 16384, Ye = 32768, yt = 65536, ti = 1 << 17, _i = 1 << 18, We = 1 << 19, Fn = 1 << 20, Ne = 65536, Ot = 1 << 21, wi = 1 << 22, et = 1 << 23, ft = /* @__PURE__ */ Symbol("$state"), Dn = /* @__PURE__ */ Symbol("legacy props"), Ht = new class extends Error {
24
+ const H = 2, nt = 4, Si = 8, $i = 1 << 24, be = 16, _e = 32, Ce = 64, Vt = 128, x = 512, V = 1024, F = 2048, te = 4096, Ie = 8192, Ee = 16384, Qe = 32768, It = 65536, ci = 1 << 17, Ci = 1 << 18, Je = 1 << 19, qn = 1 << 20, De = 65536, Mt = 1 << 21, Li = 1 << 22, st = 1 << 23, gt = /* @__PURE__ */ Symbol("$state"), Kn = /* @__PURE__ */ Symbol("legacy props"), Wt = new class extends Error {
25
25
  constructor() {
26
26
  super(...arguments);
27
27
  f(this, "name", "StaleReactionError");
28
28
  f(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
29
29
  }
30
- }(), qt = 8;
31
- function Pn(t) {
30
+ }(), Qt = 8;
31
+ function zn(t) {
32
32
  throw new Error("https://svelte.dev/e/lifecycle_outside_component");
33
33
  }
34
- function xn(t) {
34
+ function Yn(t) {
35
35
  throw new Error("https://svelte.dev/e/effect_in_teardown");
36
36
  }
37
- function jn() {
37
+ function Un() {
38
38
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
39
39
  }
40
- function Bn(t) {
40
+ function xn(t) {
41
41
  throw new Error("https://svelte.dev/e/effect_orphan");
42
42
  }
43
- function Hn() {
43
+ function Xn() {
44
44
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
45
45
  }
46
- function qn() {
46
+ function Wn() {
47
47
  throw new Error("https://svelte.dev/e/hydration_failed");
48
48
  }
49
- function zn() {
49
+ function Qn() {
50
50
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
51
51
  }
52
- function Gn() {
52
+ function Jn() {
53
53
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
54
54
  }
55
- function Un() {
55
+ function Zn() {
56
56
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
57
57
  }
58
- function Yn() {
58
+ function es() {
59
59
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
60
60
  }
61
- function Ti(t) {
61
+ function Ri(t) {
62
62
  console.warn("https://svelte.dev/e/hydration_mismatch");
63
63
  }
64
- function Wn() {
64
+ function ts() {
65
65
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
66
66
  }
67
- let Q = !1;
68
- function lt(t) {
69
- Q = t;
67
+ let J = !1;
68
+ function ft(t) {
69
+ J = t;
70
70
  }
71
- let M;
72
- function tt(t) {
71
+ let B;
72
+ function rt(t) {
73
73
  if (t === null)
74
- throw Ti(), mt;
75
- return M = t;
74
+ throw Ri(), yt;
75
+ return B = t;
76
76
  }
77
- function Si() {
78
- return tt(/* @__PURE__ */ Ke(M));
77
+ function Oi() {
78
+ return rt(/* @__PURE__ */ Ze(B));
79
79
  }
80
- function Kn(t = 1) {
81
- if (Q) {
82
- for (var e = t, i = M; e--; )
80
+ function is(t = 1) {
81
+ if (J) {
82
+ for (var e = t, i = B; e--; )
83
83
  i = /** @type {TemplateNode} */
84
- /* @__PURE__ */ Ke(i);
85
- M = i;
84
+ /* @__PURE__ */ Ze(i);
85
+ B = i;
86
86
  }
87
87
  }
88
- function Qn(t = !0) {
89
- for (var e = 0, i = M; ; ) {
90
- if (i.nodeType === qt) {
88
+ function ns(t = !0) {
89
+ for (var e = 0, i = B; ; ) {
90
+ if (i.nodeType === Qt) {
91
91
  var n = (
92
92
  /** @type {Comment} */
93
93
  i.data
94
94
  );
95
- if (n === vi) {
95
+ if (n === wi) {
96
96
  if (e === 0) return i;
97
97
  e -= 1;
98
- } else (n === gi || n === mi || // "[1", "[2", etc. for if blocks
98
+ } else (n === Ii || n === Ei || // "[1", "[2", etc. for if blocks
99
99
  n[0] === "[" && !isNaN(Number(n.slice(1)))) && (e += 1);
100
100
  }
101
- var r = (
101
+ var s = (
102
102
  /** @type {TemplateNode} */
103
- /* @__PURE__ */ Ke(i)
103
+ /* @__PURE__ */ Ze(i)
104
104
  );
105
- t && i.remove(), i = r;
105
+ t && i.remove(), i = s;
106
106
  }
107
107
  }
108
- function Ai(t) {
108
+ function ki(t) {
109
109
  return t === this.v;
110
110
  }
111
- function Jn(t, e) {
111
+ function ss(t, e) {
112
112
  return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function";
113
113
  }
114
- function Xn(t) {
115
- return !Jn(t, this.v);
114
+ function rs(t) {
115
+ return !ss(t, this.v);
116
116
  }
117
- let Zn = !1, U = null;
118
- function _t(t) {
119
- U = t;
117
+ let os = !1, W = null;
118
+ function Et(t) {
119
+ W = t;
120
120
  }
121
- function Ii(t, e = !1, i) {
122
- U = {
123
- p: U,
121
+ function Hi(t, e = !1, i) {
122
+ W = {
123
+ p: W,
124
124
  i: !1,
125
125
  c: null,
126
126
  e: null,
@@ -129,52 +129,52 @@ function Ii(t, e = !1, i) {
129
129
  l: null
130
130
  };
131
131
  }
132
- function Ei(t) {
132
+ function Ni(t) {
133
133
  var e = (
134
134
  /** @type {ComponentContext} */
135
- U
135
+ W
136
136
  ), i = e.e;
137
137
  if (i !== null) {
138
138
  e.e = null;
139
139
  for (var n of i)
140
- Xi(n);
140
+ ln(n);
141
141
  }
142
- return t !== void 0 && (e.x = t), e.i = !0, U = e.p, t ?? /** @type {T} */
142
+ return t !== void 0 && (e.x = t), e.i = !0, W = e.p, t ?? /** @type {T} */
143
143
  {};
144
144
  }
145
- function $i() {
145
+ function Vi() {
146
146
  return !0;
147
147
  }
148
- let Ee = [];
149
- function Ci() {
150
- var t = Ee;
151
- Ee = [], Nn(t);
148
+ let Re = [];
149
+ function Mi() {
150
+ var t = Re;
151
+ Re = [], Gn(t);
152
152
  }
153
- function Le(t) {
154
- if (Ee.length === 0 && !Je) {
155
- var e = Ee;
153
+ function Me(t) {
154
+ if (Re.length === 0 && !tt) {
155
+ var e = Re;
156
156
  queueMicrotask(() => {
157
- e === Ee && Ci();
157
+ e === Re && Mi();
158
158
  });
159
159
  }
160
- Ee.push(t);
160
+ Re.push(t);
161
161
  }
162
- function er() {
163
- for (; Ee.length > 0; )
164
- Ci();
162
+ function ls() {
163
+ for (; Re.length > 0; )
164
+ Mi();
165
165
  }
166
- function ki(t) {
167
- var e = S;
166
+ function Fi(t) {
167
+ var e = E;
168
168
  if (e === null)
169
- return b.f |= et, t;
170
- if ((e.f & Ye) === 0 && (e.f & Ze) === 0)
169
+ return y.f |= st, t;
170
+ if ((e.f & Qe) === 0 && (e.f & nt) === 0)
171
171
  throw t;
172
172
  wt(t, e);
173
173
  }
174
174
  function wt(t, e) {
175
175
  for (; e !== null; ) {
176
- if ((e.f & Rt) !== 0) {
177
- if ((e.f & Ye) === 0)
176
+ if ((e.f & Vt) !== 0) {
177
+ if ((e.f & Qe) === 0)
178
178
  throw t;
179
179
  try {
180
180
  e.b.error(t);
@@ -187,30 +187,30 @@ function wt(t, e) {
187
187
  }
188
188
  throw t;
189
189
  }
190
- const tr = -7169;
191
- function I(t, e) {
192
- t.f = t.f & tr | e;
190
+ const as = -7169;
191
+ function R(t, e) {
192
+ t.f = t.f & as | e;
193
193
  }
194
- function zt(t) {
195
- (t.f & z) !== 0 || t.deps === null ? I(t, R) : I(t, Z);
194
+ function Jt(t) {
195
+ (t.f & x) !== 0 || t.deps === null ? R(t, V) : R(t, te);
196
196
  }
197
- function Ri(t) {
197
+ function Di(t) {
198
198
  if (t !== null)
199
199
  for (const e of t)
200
- (e.f & C) === 0 || (e.f & Ne) === 0 || (e.f ^= Ne, Ri(
200
+ (e.f & H) === 0 || (e.f & De) === 0 || (e.f ^= De, Di(
201
201
  /** @type {Derived} */
202
202
  e.deps
203
203
  ));
204
204
  }
205
- function Oi(t, e, i) {
206
- (t.f & L) !== 0 ? e.add(t) : (t.f & Z) !== 0 && i.add(t), Ri(t.deps), I(t, R);
205
+ function Pi(t, e, i) {
206
+ (t.f & F) !== 0 ? e.add(t) : (t.f & te) !== 0 && i.add(t), Di(t.deps), R(t, V);
207
207
  }
208
- const at = /* @__PURE__ */ new Set();
209
- let $ = null, K = null, D = [], St = null, Lt = !1, Je = !1;
210
- var Pe, xe, Ce, je, nt, rt, ke, ce, Be, se, Vt, Nt, Li;
211
- const Jt = class Jt {
208
+ const dt = /* @__PURE__ */ new Set();
209
+ let k = null, Q = null, G = [], Ct = null, Ft = !1, tt = !1;
210
+ var je, qe, ke, Ke, lt, at, He, de, ze, ae, Dt, Pt, Bi;
211
+ const ri = class ri {
212
212
  constructor() {
213
- w(this, se);
213
+ A(this, ae);
214
214
  f(this, "committed", !1);
215
215
  /**
216
216
  * The current values of any sources that are updated in this batch
@@ -229,36 +229,36 @@ const Jt = class Jt {
229
229
  * and append new ones by calling the functions added inside (if/each/key/etc) blocks
230
230
  * @type {Set<() => void>}
231
231
  */
232
- w(this, Pe, /* @__PURE__ */ new Set());
232
+ A(this, je, /* @__PURE__ */ new Set());
233
233
  /**
234
234
  * If a fork is discarded, we need to destroy any effects that are no longer needed
235
235
  * @type {Set<(batch: Batch) => void>}
236
236
  */
237
- w(this, xe, /* @__PURE__ */ new Set());
237
+ A(this, qe, /* @__PURE__ */ new Set());
238
238
  /**
239
239
  * The number of async effects that are currently in flight
240
240
  */
241
- w(this, Ce, 0);
241
+ A(this, ke, 0);
242
242
  /**
243
243
  * The number of async effects that are currently in flight, _not_ inside a pending boundary
244
244
  */
245
- w(this, je, 0);
245
+ A(this, Ke, 0);
246
246
  /**
247
247
  * A deferred that resolves when the batch is committed, used with `settled()`
248
248
  * TODO replace with Promise.withResolvers once supported widely enough
249
249
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
250
250
  */
251
- w(this, nt, null);
251
+ A(this, lt, null);
252
252
  /**
253
253
  * Deferred effects (which run after async work has completed) that are DIRTY
254
254
  * @type {Set<Effect>}
255
255
  */
256
- w(this, rt, /* @__PURE__ */ new Set());
256
+ A(this, at, /* @__PURE__ */ new Set());
257
257
  /**
258
258
  * Deferred effects that are MAYBE_DIRTY
259
259
  * @type {Set<Effect>}
260
260
  */
261
- w(this, ke, /* @__PURE__ */ new Set());
261
+ A(this, He, /* @__PURE__ */ new Set());
262
262
  /**
263
263
  * A map of branches that still exist, but will be destroyed when this batch
264
264
  * is committed — we skip over these during `process`.
@@ -266,19 +266,19 @@ const Jt = class Jt {
266
266
  * so they can be rescheduled if the branch survives.
267
267
  * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
268
268
  */
269
- w(this, ce, /* @__PURE__ */ new Map());
269
+ A(this, de, /* @__PURE__ */ new Map());
270
270
  f(this, "is_fork", !1);
271
- w(this, Be, !1);
271
+ A(this, ze, !1);
272
272
  }
273
273
  is_deferred() {
274
- return this.is_fork || c(this, je) > 0;
274
+ return this.is_fork || c(this, Ke) > 0;
275
275
  }
276
276
  /**
277
277
  * Add an effect to the #skipped_branches map and reset its children
278
278
  * @param {Effect} effect
279
279
  */
280
280
  skip_effect(e) {
281
- c(this, ce).has(e) || c(this, ce).set(e, { d: [], m: [] });
281
+ c(this, de).has(e) || c(this, de).set(e, { d: [], m: [] });
282
282
  }
283
283
  /**
284
284
  * Remove an effect from the #skipped_branches map and reschedule
@@ -286,13 +286,13 @@ const Jt = class Jt {
286
286
  * @param {Effect} effect
287
287
  */
288
288
  unskip_effect(e) {
289
- var i = c(this, ce).get(e);
289
+ var i = c(this, de).get(e);
290
290
  if (i) {
291
- c(this, ce).delete(e);
291
+ c(this, de).delete(e);
292
292
  for (var n of i.d)
293
- I(n, L), ne(n);
293
+ R(n, F), oe(n);
294
294
  for (n of i.m)
295
- I(n, Z), ne(n);
295
+ R(n, te), oe(n);
296
296
  }
297
297
  }
298
298
  /**
@@ -300,19 +300,19 @@ const Jt = class Jt {
300
300
  * @param {Effect[]} root_effects
301
301
  */
302
302
  process(e) {
303
- D = [], this.apply();
303
+ G = [], this.apply();
304
304
  var i = [], n = [];
305
- for (const r of e)
306
- V(this, se, Vt).call(this, r, i, n);
305
+ for (const s of e)
306
+ D(this, ae, Dt).call(this, s, i, n);
307
307
  if (this.is_deferred()) {
308
- V(this, se, Nt).call(this, n), V(this, se, Nt).call(this, i);
309
- for (const [r, s] of c(this, ce))
310
- Fi(r, s);
308
+ D(this, ae, Pt).call(this, n), D(this, ae, Pt).call(this, i);
309
+ for (const [s, r] of c(this, de))
310
+ Ki(s, r);
311
311
  } else {
312
- for (const r of c(this, Pe)) r();
313
- c(this, Pe).clear(), c(this, Ce) === 0 && V(this, se, Li).call(this), $ = null, ii(n), ii(i), c(this, nt)?.resolve();
312
+ for (const s of c(this, je)) s();
313
+ c(this, je).clear(), c(this, ke) === 0 && D(this, ae, Bi).call(this), k = null, ui(n), ui(i), c(this, lt)?.resolve();
314
314
  }
315
- K = null;
315
+ Q = null;
316
316
  }
317
317
  /**
318
318
  * Associate a change to a given source with the current
@@ -321,318 +321,318 @@ const Jt = class Jt {
321
321
  * @param {any} value
322
322
  */
323
323
  capture(e, i) {
324
- i !== k && !this.previous.has(e) && this.previous.set(e, i), (e.f & et) === 0 && (this.current.set(e, e.v), K?.set(e, e.v));
324
+ i !== N && !this.previous.has(e) && this.previous.set(e, i), (e.f & st) === 0 && (this.current.set(e, e.v), Q?.set(e, e.v));
325
325
  }
326
326
  activate() {
327
- $ = this, this.apply();
327
+ k = this, this.apply();
328
328
  }
329
329
  deactivate() {
330
- $ === this && ($ = null, K = null);
330
+ k === this && (k = null, Q = null);
331
331
  }
332
332
  flush() {
333
- if (this.activate(), D.length > 0) {
334
- if (Vi(), $ !== null && $ !== this)
333
+ if (this.activate(), G.length > 0) {
334
+ if (Gi(), k !== null && k !== this)
335
335
  return;
336
- } else c(this, Ce) === 0 && this.process([]);
336
+ } else c(this, ke) === 0 && this.process([]);
337
337
  this.deactivate();
338
338
  }
339
339
  discard() {
340
- for (const e of c(this, xe)) e(this);
341
- c(this, xe).clear();
340
+ for (const e of c(this, qe)) e(this);
341
+ c(this, qe).clear();
342
342
  }
343
343
  /**
344
344
  *
345
345
  * @param {boolean} blocking
346
346
  */
347
347
  increment(e) {
348
- v(this, Ce, c(this, Ce) + 1), e && v(this, je, c(this, je) + 1);
348
+ _(this, ke, c(this, ke) + 1), e && _(this, Ke, c(this, Ke) + 1);
349
349
  }
350
350
  /**
351
351
  *
352
352
  * @param {boolean} blocking
353
353
  */
354
354
  decrement(e) {
355
- v(this, Ce, c(this, Ce) - 1), e && v(this, je, c(this, je) - 1), !c(this, Be) && (v(this, Be, !0), Le(() => {
356
- v(this, Be, !1), this.is_deferred() ? D.length > 0 && this.flush() : this.revive();
355
+ _(this, ke, c(this, ke) - 1), e && _(this, Ke, c(this, Ke) - 1), !c(this, ze) && (_(this, ze, !0), Me(() => {
356
+ _(this, ze, !1), this.is_deferred() ? G.length > 0 && this.flush() : this.revive();
357
357
  }));
358
358
  }
359
359
  revive() {
360
- for (const e of c(this, rt))
361
- c(this, ke).delete(e), I(e, L), ne(e);
362
- for (const e of c(this, ke))
363
- I(e, Z), ne(e);
360
+ for (const e of c(this, at))
361
+ c(this, He).delete(e), R(e, F), oe(e);
362
+ for (const e of c(this, He))
363
+ R(e, te), oe(e);
364
364
  this.flush();
365
365
  }
366
366
  /** @param {() => void} fn */
367
367
  oncommit(e) {
368
- c(this, Pe).add(e);
368
+ c(this, je).add(e);
369
369
  }
370
370
  /** @param {(batch: Batch) => void} fn */
371
371
  ondiscard(e) {
372
- c(this, xe).add(e);
372
+ c(this, qe).add(e);
373
373
  }
374
374
  settled() {
375
- return (c(this, nt) ?? v(this, nt, Mn())).promise;
375
+ return (c(this, lt) ?? _(this, lt, jn())).promise;
376
376
  }
377
377
  static ensure() {
378
- if ($ === null) {
379
- const e = $ = new Jt();
380
- at.add($), Je || Le(() => {
381
- $ === e && e.flush();
378
+ if (k === null) {
379
+ const e = k = new ri();
380
+ dt.add(k), tt || Me(() => {
381
+ k === e && e.flush();
382
382
  });
383
383
  }
384
- return $;
384
+ return k;
385
385
  }
386
386
  apply() {
387
387
  }
388
388
  };
389
- Pe = new WeakMap(), xe = new WeakMap(), Ce = new WeakMap(), je = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), ke = new WeakMap(), ce = new WeakMap(), Be = new WeakMap(), se = new WeakSet(), /**
389
+ je = new WeakMap(), qe = new WeakMap(), ke = new WeakMap(), Ke = new WeakMap(), lt = new WeakMap(), at = new WeakMap(), He = new WeakMap(), de = new WeakMap(), ze = new WeakMap(), ae = new WeakSet(), /**
390
390
  * Traverse the effect tree, executing effects or stashing
391
391
  * them for later execution as appropriate
392
392
  * @param {Effect} root
393
393
  * @param {Effect[]} effects
394
394
  * @param {Effect[]} render_effects
395
395
  */
396
- Vt = function(e, i, n) {
397
- e.f ^= R;
398
- for (var r = e.first, s = null; r !== null; ) {
399
- var o = r.f, l = (o & (me | Ae)) !== 0, a = l && (o & R) !== 0, u = a || (o & ye) !== 0 || c(this, ce).has(r);
400
- if (!u && r.fn !== null) {
401
- l ? r.f ^= R : s !== null && (o & (Ze | bi | yi)) !== 0 ? s.b.defer_effect(r) : (o & Ze) !== 0 ? i.push(r) : ot(r) && ((o & ge) !== 0 && c(this, ke).add(r), Ue(r));
402
- var d = r.first;
396
+ Dt = function(e, i, n) {
397
+ e.f ^= V;
398
+ for (var s = e.first, r = null; s !== null; ) {
399
+ var o = s.f, l = (o & (_e | Ce)) !== 0, a = l && (o & V) !== 0, u = a || (o & Ie) !== 0 || c(this, de).has(s);
400
+ if (!u && s.fn !== null) {
401
+ l ? s.f ^= V : r !== null && (o & (nt | Si | $i)) !== 0 ? r.b.defer_effect(s) : (o & nt) !== 0 ? i.push(s) : ut(s) && ((o & be) !== 0 && c(this, He).add(s), We(s));
402
+ var d = s.first;
403
403
  if (d !== null) {
404
- r = d;
404
+ s = d;
405
405
  continue;
406
406
  }
407
407
  }
408
- for (; r !== null; ) {
409
- r === s && (s = null);
410
- var m = r.next;
411
- if (m !== null) {
412
- r = m;
408
+ for (; s !== null; ) {
409
+ s === r && (r = null);
410
+ var v = s.next;
411
+ if (v !== null) {
412
+ s = v;
413
413
  break;
414
414
  }
415
- r = r.parent;
415
+ s = s.parent;
416
416
  }
417
417
  }
418
418
  }, /**
419
419
  * @param {Effect[]} effects
420
420
  */
421
- Nt = function(e) {
421
+ Pt = function(e) {
422
422
  for (var i = 0; i < e.length; i += 1)
423
- Oi(e[i], c(this, rt), c(this, ke));
424
- }, Li = function() {
425
- var r;
426
- if (at.size > 1) {
423
+ Pi(e[i], c(this, at), c(this, He));
424
+ }, Bi = function() {
425
+ var s;
426
+ if (dt.size > 1) {
427
427
  this.previous.clear();
428
- var e = K, i = !0;
429
- for (const s of at) {
430
- if (s === this) {
428
+ var e = Q, i = !0;
429
+ for (const r of dt) {
430
+ if (r === this) {
431
431
  i = !1;
432
432
  continue;
433
433
  }
434
434
  const o = [];
435
435
  for (const [a, u] of this.current) {
436
- if (s.current.has(a))
437
- if (i && u !== s.current.get(a))
438
- s.current.set(a, u);
436
+ if (r.current.has(a))
437
+ if (i && u !== r.current.get(a))
438
+ r.current.set(a, u);
439
439
  else
440
440
  continue;
441
441
  o.push(a);
442
442
  }
443
443
  if (o.length === 0)
444
444
  continue;
445
- const l = [...s.current.keys()].filter((a) => !this.current.has(a));
445
+ const l = [...r.current.keys()].filter((a) => !this.current.has(a));
446
446
  if (l.length > 0) {
447
- var n = D;
448
- D = [];
447
+ var n = G;
448
+ G = [];
449
449
  const a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
450
450
  for (const d of o)
451
- Ni(d, l, a, u);
452
- if (D.length > 0) {
453
- $ = s, s.apply();
454
- for (const d of D)
455
- V(r = s, se, Vt).call(r, d, [], []);
456
- s.deactivate();
451
+ ji(d, l, a, u);
452
+ if (G.length > 0) {
453
+ k = r, r.apply();
454
+ for (const d of G)
455
+ D(s = r, ae, Dt).call(s, d, [], []);
456
+ r.deactivate();
457
457
  }
458
- D = n;
458
+ G = n;
459
459
  }
460
460
  }
461
- $ = null, K = e;
461
+ k = null, Q = e;
462
462
  }
463
- this.committed = !0, at.delete(this);
463
+ this.committed = !0, dt.delete(this);
464
464
  };
465
- let pe = Jt;
466
- function le(t) {
467
- var e = Je;
468
- Je = !0;
465
+ let ve = ri;
466
+ function ue(t) {
467
+ var e = tt;
468
+ tt = !0;
469
469
  try {
470
470
  for (var i; ; ) {
471
- if (er(), D.length === 0 && ($?.flush(), D.length === 0))
472
- return St = null, /** @type {T} */
471
+ if (ls(), G.length === 0 && (k?.flush(), G.length === 0))
472
+ return Ct = null, /** @type {T} */
473
473
  i;
474
- Vi();
474
+ Gi();
475
475
  }
476
476
  } finally {
477
- Je = e;
477
+ tt = e;
478
478
  }
479
479
  }
480
- function Vi() {
481
- Lt = !0;
480
+ function Gi() {
481
+ Ft = !0;
482
482
  var t = null;
483
483
  try {
484
- for (var e = 0; D.length > 0; ) {
485
- var i = pe.ensure();
484
+ for (var e = 0; G.length > 0; ) {
485
+ var i = ve.ensure();
486
486
  if (e++ > 1e3) {
487
- var n, r;
488
- ir();
487
+ var n, s;
488
+ cs();
489
489
  }
490
- i.process(D), we.clear();
490
+ i.process(G), we.clear();
491
491
  }
492
492
  } finally {
493
- D = [], Lt = !1, St = null;
493
+ G = [], Ft = !1, Ct = null;
494
494
  }
495
495
  }
496
- function ir() {
496
+ function cs() {
497
497
  try {
498
- Hn();
498
+ Xn();
499
499
  } catch (t) {
500
- wt(t, St);
500
+ wt(t, Ct);
501
501
  }
502
502
  }
503
- let ae = null;
504
- function ii(t) {
503
+ let fe = null;
504
+ function ui(t) {
505
505
  var e = t.length;
506
506
  if (e !== 0) {
507
507
  for (var i = 0; i < e; ) {
508
508
  var n = t[i++];
509
- if ((n.f & (_e | ye)) === 0 && ot(n) && (ae = /* @__PURE__ */ new Set(), Ue(n), n.deps === null && n.first === null && n.nodes === null && n.teardown === null && n.ac === null && en(n), ae?.size > 0)) {
509
+ if ((n.f & (Ee | Ie)) === 0 && ut(n) && (fe = /* @__PURE__ */ new Set(), We(n), n.deps === null && n.first === null && n.nodes === null && n.teardown === null && n.ac === null && cn(n), fe?.size > 0)) {
510
510
  we.clear();
511
- for (const r of ae) {
512
- if ((r.f & (_e | ye)) !== 0) continue;
513
- const s = [r];
514
- let o = r.parent;
511
+ for (const s of fe) {
512
+ if ((s.f & (Ee | Ie)) !== 0) continue;
513
+ const r = [s];
514
+ let o = s.parent;
515
515
  for (; o !== null; )
516
- ae.has(o) && (ae.delete(o), s.push(o)), o = o.parent;
517
- for (let l = s.length - 1; l >= 0; l--) {
518
- const a = s[l];
519
- (a.f & (_e | ye)) === 0 && Ue(a);
516
+ fe.has(o) && (fe.delete(o), r.push(o)), o = o.parent;
517
+ for (let l = r.length - 1; l >= 0; l--) {
518
+ const a = r[l];
519
+ (a.f & (Ee | Ie)) === 0 && We(a);
520
520
  }
521
521
  }
522
- ae.clear();
522
+ fe.clear();
523
523
  }
524
524
  }
525
- ae = null;
525
+ fe = null;
526
526
  }
527
527
  }
528
- function Ni(t, e, i, n) {
528
+ function ji(t, e, i, n) {
529
529
  if (!i.has(t) && (i.add(t), t.reactions !== null))
530
- for (const r of t.reactions) {
531
- const s = r.f;
532
- (s & C) !== 0 ? Ni(
530
+ for (const s of t.reactions) {
531
+ const r = s.f;
532
+ (r & H) !== 0 ? ji(
533
533
  /** @type {Derived} */
534
- r,
534
+ s,
535
535
  e,
536
536
  i,
537
537
  n
538
- ) : (s & (wi | ge)) !== 0 && (s & L) === 0 && Mi(r, e, n) && (I(r, L), ne(
538
+ ) : (r & (Li | be)) !== 0 && (r & F) === 0 && qi(s, e, n) && (R(s, F), oe(
539
539
  /** @type {Effect} */
540
- r
540
+ s
541
541
  ));
542
542
  }
543
543
  }
544
- function Mi(t, e, i) {
544
+ function qi(t, e, i) {
545
545
  const n = i.get(t);
546
546
  if (n !== void 0) return n;
547
547
  if (t.deps !== null)
548
- for (const r of t.deps) {
549
- if (Ge.call(e, r))
548
+ for (const s of t.deps) {
549
+ if (Xe.call(e, s))
550
550
  return !0;
551
- if ((r.f & C) !== 0 && Mi(
551
+ if ((s.f & H) !== 0 && qi(
552
552
  /** @type {Derived} */
553
- r,
553
+ s,
554
554
  e,
555
555
  i
556
556
  ))
557
557
  return i.set(
558
558
  /** @type {Derived} */
559
- r,
559
+ s,
560
560
  !0
561
561
  ), !0;
562
562
  }
563
563
  return i.set(t, !1), !1;
564
564
  }
565
- function ne(t) {
566
- for (var e = St = t; e.parent !== null; ) {
565
+ function oe(t) {
566
+ for (var e = Ct = t; e.parent !== null; ) {
567
567
  e = e.parent;
568
568
  var i = e.f;
569
- if (Lt && e === S && (i & ge) !== 0 && (i & _i) === 0)
569
+ if (Ft && e === E && (i & be) !== 0 && (i & Ci) === 0)
570
570
  return;
571
- if ((i & (Ae | me)) !== 0) {
572
- if ((i & R) === 0) return;
573
- e.f ^= R;
571
+ if ((i & (Ce | _e)) !== 0) {
572
+ if ((i & V) === 0) return;
573
+ e.f ^= V;
574
574
  }
575
575
  }
576
- D.push(e);
576
+ G.push(e);
577
577
  }
578
- function Fi(t, e) {
579
- if (!((t.f & me) !== 0 && (t.f & R) !== 0)) {
580
- (t.f & L) !== 0 ? e.d.push(t) : (t.f & Z) !== 0 && e.m.push(t), I(t, R);
578
+ function Ki(t, e) {
579
+ if (!((t.f & _e) !== 0 && (t.f & V) !== 0)) {
580
+ (t.f & F) !== 0 ? e.d.push(t) : (t.f & te) !== 0 && e.m.push(t), R(t, V);
581
581
  for (var i = t.first; i !== null; )
582
- Fi(i, e), i = i.next;
582
+ Ki(i, e), i = i.next;
583
583
  }
584
584
  }
585
- function nr(t) {
586
- let e = 0, i = At(0), n;
585
+ function us(t) {
586
+ let e = 0, i = Lt(0), n;
587
587
  return () => {
588
- Ut() && (g(i), Yt(() => (e === 0 && (n = Kt(() => t(() => Xe(i)))), e += 1, () => {
589
- Le(() => {
590
- e -= 1, e === 0 && (n?.(), n = void 0, Xe(i));
588
+ ei() && (m(i), ti(() => (e === 0 && (n = ni(() => t(() => it(i)))), e += 1, () => {
589
+ Me(() => {
590
+ e -= 1, e === 0 && (n?.(), n = void 0, it(i));
591
591
  });
592
592
  })));
593
593
  };
594
594
  }
595
- var rr = yt | We;
596
- function sr(t, e, i) {
597
- new or(t, e, i);
595
+ var fs = It | Je;
596
+ function ds(t, e, i) {
597
+ new hs(t, e, i);
598
598
  }
599
- var H, st, ue, Re, ee, te, j, ie, fe, Oe, be, He, qe, ze, de, Tt, O, Di, Pi, Mt, dt, Ft;
600
- class or {
599
+ var Y, ct, he, Ne, ne, se, K, re, pe, Ve, Ae, Ye, Ue, xe, ge, $t, M, zi, Yi, Bt, mt, Gt;
600
+ class hs {
601
601
  /**
602
602
  * @param {TemplateNode} node
603
603
  * @param {BoundaryProps} props
604
604
  * @param {((anchor: Node) => void)} children
605
605
  */
606
606
  constructor(e, i, n) {
607
- w(this, O);
607
+ A(this, M);
608
608
  /** @type {Boundary | null} */
609
609
  f(this, "parent");
610
610
  f(this, "is_pending", !1);
611
611
  /** @type {TemplateNode} */
612
- w(this, H);
612
+ A(this, Y);
613
613
  /** @type {TemplateNode | null} */
614
- w(this, st, Q ? M : null);
614
+ A(this, ct, J ? B : null);
615
615
  /** @type {BoundaryProps} */
616
- w(this, ue);
616
+ A(this, he);
617
617
  /** @type {((anchor: Node) => void)} */
618
- w(this, Re);
618
+ A(this, Ne);
619
619
  /** @type {Effect} */
620
- w(this, ee);
620
+ A(this, ne);
621
621
  /** @type {Effect | null} */
622
- w(this, te, null);
622
+ A(this, se, null);
623
623
  /** @type {Effect | null} */
624
- w(this, j, null);
624
+ A(this, K, null);
625
625
  /** @type {Effect | null} */
626
- w(this, ie, null);
626
+ A(this, re, null);
627
627
  /** @type {DocumentFragment | null} */
628
- w(this, fe, null);
629
- w(this, Oe, 0);
630
- w(this, be, 0);
631
- w(this, He, !1);
628
+ A(this, pe, null);
629
+ A(this, Ve, 0);
630
+ A(this, Ae, 0);
631
+ A(this, Ye, !1);
632
632
  /** @type {Set<Effect>} */
633
- w(this, qe, /* @__PURE__ */ new Set());
633
+ A(this, Ue, /* @__PURE__ */ new Set());
634
634
  /** @type {Set<Effect>} */
635
- w(this, ze, /* @__PURE__ */ new Set());
635
+ A(this, xe, /* @__PURE__ */ new Set());
636
636
  /**
637
637
  * A source containing the number of pending async deriveds/expressions.
638
638
  * Only created if `$effect.pending()` is used inside the boundary,
@@ -640,34 +640,34 @@ class or {
640
640
  * calls followed by no-op flushes
641
641
  * @type {Source<number> | null}
642
642
  */
643
- w(this, de, null);
644
- w(this, Tt, nr(() => (v(this, de, At(c(this, Oe))), () => {
645
- v(this, de, null);
643
+ A(this, ge, null);
644
+ A(this, $t, us(() => (_(this, ge, Lt(c(this, Ve))), () => {
645
+ _(this, ge, null);
646
646
  })));
647
- v(this, H, e), v(this, ue, i), v(this, Re, (r) => {
648
- var s = (
647
+ _(this, Y, e), _(this, he, i), _(this, Ne, (s) => {
648
+ var r = (
649
649
  /** @type {Effect} */
650
- S
650
+ E
651
651
  );
652
- s.b = this, s.f |= Rt, n(r);
652
+ r.b = this, r.f |= Vt, n(s);
653
653
  }), this.parent = /** @type {Effect} */
654
- S.b, v(this, ee, br(() => {
655
- if (Q) {
656
- const r = (
654
+ E.b, _(this, ne, ws(() => {
655
+ if (J) {
656
+ const s = (
657
657
  /** @type {Comment} */
658
- c(this, st)
658
+ c(this, ct)
659
659
  );
660
- Si(), r.data === mi ? V(this, O, Pi).call(this) : V(this, O, Di).call(this);
660
+ Oi(), s.data === Ei ? D(this, M, Yi).call(this) : D(this, M, zi).call(this);
661
661
  } else
662
- V(this, O, Mt).call(this);
663
- }, rr)), Q && v(this, H, M);
662
+ D(this, M, Bt).call(this);
663
+ }, fs)), J && _(this, Y, B);
664
664
  }
665
665
  /**
666
666
  * Defer an effect inside a pending boundary until the boundary resolves
667
667
  * @param {Effect} effect
668
668
  */
669
669
  defer_effect(e) {
670
- Oi(e, c(this, qe), c(this, ze));
670
+ Pi(e, c(this, Ue), c(this, xe));
671
671
  }
672
672
  /**
673
673
  * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
@@ -677,7 +677,7 @@ class or {
677
677
  return !this.is_pending && (!this.parent || this.parent.is_rendered());
678
678
  }
679
679
  has_pending_snippet() {
680
- return !!c(this, ue).pending;
680
+ return !!c(this, he).pending;
681
681
  }
682
682
  /**
683
683
  * Update the source that powers `$effect.pending()` inside this boundary,
@@ -686,54 +686,54 @@ class or {
686
686
  * @param {1 | -1} d
687
687
  */
688
688
  update_pending_count(e) {
689
- V(this, O, Ft).call(this, e), v(this, Oe, c(this, Oe) + e), !(!c(this, de) || c(this, He)) && (v(this, He, !0), Le(() => {
690
- v(this, He, !1), c(this, de) && qi(c(this, de), c(this, Oe));
689
+ D(this, M, Gt).call(this, e), _(this, Ve, c(this, Ve) + e), !(!c(this, ge) || c(this, Ye)) && (_(this, Ye, !0), Me(() => {
690
+ _(this, Ye, !1), c(this, ge) && Qi(c(this, ge), c(this, Ve));
691
691
  }));
692
692
  }
693
693
  get_effect_pending() {
694
- return c(this, Tt).call(this), g(
694
+ return c(this, $t).call(this), m(
695
695
  /** @type {Source<number>} */
696
- c(this, de)
696
+ c(this, ge)
697
697
  );
698
698
  }
699
699
  /** @param {unknown} error */
700
700
  error(e) {
701
- var i = c(this, ue).onerror;
702
- let n = c(this, ue).failed;
701
+ var i = c(this, he).onerror;
702
+ let n = c(this, he).failed;
703
703
  if (!i && !n)
704
704
  throw e;
705
- c(this, te) && (X(c(this, te)), v(this, te, null)), c(this, j) && (X(c(this, j)), v(this, j, null)), c(this, ie) && (X(c(this, ie)), v(this, ie, null)), Q && (tt(
705
+ c(this, se) && (ee(c(this, se)), _(this, se, null)), c(this, K) && (ee(c(this, K)), _(this, K, null)), c(this, re) && (ee(c(this, re)), _(this, re, null)), J && (rt(
706
706
  /** @type {TemplateNode} */
707
- c(this, st)
708
- ), Kn(), tt(Qn()));
709
- var r = !1, s = !1;
707
+ c(this, ct)
708
+ ), is(), rt(ns()));
709
+ var s = !1, r = !1;
710
710
  const o = () => {
711
- if (r) {
712
- Wn();
711
+ if (s) {
712
+ ts();
713
713
  return;
714
714
  }
715
- r = !0, s && Yn(), c(this, ie) !== null && ht(c(this, ie), () => {
716
- v(this, ie, null);
717
- }), V(this, O, dt).call(this, () => {
718
- pe.ensure(), V(this, O, Mt).call(this);
715
+ s = !0, r && es(), c(this, re) !== null && vt(c(this, re), () => {
716
+ _(this, re, null);
717
+ }), D(this, M, mt).call(this, () => {
718
+ ve.ensure(), D(this, M, Bt).call(this);
719
719
  });
720
720
  };
721
- Le(() => {
721
+ Me(() => {
722
722
  try {
723
- s = !0, i?.(e, o), s = !1;
723
+ r = !0, i?.(e, o), r = !1;
724
724
  } catch (l) {
725
- wt(l, c(this, ee) && c(this, ee).parent);
725
+ wt(l, c(this, ne) && c(this, ne).parent);
726
726
  }
727
- n && v(this, ie, V(this, O, dt).call(this, () => {
728
- pe.ensure();
727
+ n && _(this, re, D(this, M, mt).call(this, () => {
728
+ ve.ensure();
729
729
  try {
730
- return Fe(() => {
730
+ return Be(() => {
731
731
  var l = (
732
732
  /** @type {Effect} */
733
- S
733
+ E
734
734
  );
735
- l.b = this, l.f |= Rt, n(
736
- c(this, H),
735
+ l.b = this, l.f |= Vt, n(
736
+ c(this, Y),
737
737
  () => e,
738
738
  () => o
739
739
  );
@@ -742,43 +742,43 @@ class or {
742
742
  return wt(
743
743
  l,
744
744
  /** @type {Effect} */
745
- c(this, ee).parent
745
+ c(this, ne).parent
746
746
  ), null;
747
747
  }
748
748
  }));
749
749
  });
750
750
  }
751
751
  }
752
- H = new WeakMap(), st = new WeakMap(), ue = new WeakMap(), Re = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), j = new WeakMap(), ie = new WeakMap(), fe = new WeakMap(), Oe = new WeakMap(), be = new WeakMap(), He = new WeakMap(), qe = new WeakMap(), ze = new WeakMap(), de = new WeakMap(), Tt = new WeakMap(), O = new WeakSet(), Di = function() {
752
+ Y = new WeakMap(), ct = new WeakMap(), he = new WeakMap(), Ne = new WeakMap(), ne = new WeakMap(), se = new WeakMap(), K = new WeakMap(), re = new WeakMap(), pe = new WeakMap(), Ve = new WeakMap(), Ae = new WeakMap(), Ye = new WeakMap(), Ue = new WeakMap(), xe = new WeakMap(), ge = new WeakMap(), $t = new WeakMap(), M = new WeakSet(), zi = function() {
753
753
  try {
754
- v(this, te, Fe(() => c(this, Re).call(this, c(this, H))));
754
+ _(this, se, Be(() => c(this, Ne).call(this, c(this, Y))));
755
755
  } catch (e) {
756
756
  this.error(e);
757
757
  }
758
- }, Pi = function() {
759
- const e = c(this, ue).pending;
760
- e && (this.is_pending = !0, v(this, j, Fe(() => e(c(this, H)))), Le(() => {
761
- var i = v(this, fe, document.createDocumentFragment()), n = Wi();
762
- i.append(n), v(this, te, V(this, O, dt).call(this, () => (pe.ensure(), Fe(() => c(this, Re).call(this, n))))), c(this, be) === 0 && (c(this, H).before(i), v(this, fe, null), ht(
758
+ }, Yi = function() {
759
+ const e = c(this, he).pending;
760
+ e && (this.is_pending = !0, _(this, K, Be(() => e(c(this, Y)))), Me(() => {
761
+ var i = _(this, pe, document.createDocumentFragment()), n = nn();
762
+ i.append(n), _(this, se, D(this, M, mt).call(this, () => (ve.ensure(), Be(() => c(this, Ne).call(this, n))))), c(this, Ae) === 0 && (c(this, Y).before(i), _(this, pe, null), vt(
763
763
  /** @type {Effect} */
764
- c(this, j),
764
+ c(this, K),
765
765
  () => {
766
- v(this, j, null);
766
+ _(this, K, null);
767
767
  }
768
768
  ), this.is_pending = !1);
769
769
  }));
770
- }, Mt = function() {
770
+ }, Bt = function() {
771
771
  try {
772
- if (this.is_pending = this.has_pending_snippet(), v(this, be, 0), v(this, Oe, 0), v(this, te, Fe(() => {
773
- c(this, Re).call(this, c(this, H));
774
- })), c(this, be) > 0) {
775
- var e = v(this, fe, document.createDocumentFragment());
776
- wr(c(this, te), e);
772
+ if (this.is_pending = this.has_pending_snippet(), _(this, Ae, 0), _(this, Ve, 0), _(this, se, Be(() => {
773
+ c(this, Ne).call(this, c(this, Y));
774
+ })), c(this, Ae) > 0) {
775
+ var e = _(this, pe, document.createDocumentFragment());
776
+ Cs(c(this, se), e);
777
777
  const i = (
778
778
  /** @type {(anchor: Node) => void} */
779
- c(this, ue).pending
779
+ c(this, he).pending
780
780
  );
781
- v(this, j, Fe(() => i(c(this, H))));
781
+ _(this, K, Be(() => i(c(this, Y))));
782
782
  } else
783
783
  this.is_pending = !1;
784
784
  } catch (i) {
@@ -788,82 +788,82 @@ H = new WeakMap(), st = new WeakMap(), ue = new WeakMap(), Re = new WeakMap(), e
788
788
  * @template T
789
789
  * @param {() => T} fn
790
790
  */
791
- dt = function(e) {
792
- var i = S, n = b, r = U;
793
- Se(c(this, ee)), re(c(this, ee)), _t(c(this, ee).ctx);
791
+ mt = function(e) {
792
+ var i = E, n = y, s = W;
793
+ $e(c(this, ne)), le(c(this, ne)), Et(c(this, ne).ctx);
794
794
  try {
795
795
  return e();
796
- } catch (s) {
797
- return ki(s), null;
796
+ } catch (r) {
797
+ return Fi(r), null;
798
798
  } finally {
799
- Se(i), re(n), _t(r);
799
+ $e(i), le(n), Et(s);
800
800
  }
801
801
  }, /**
802
802
  * Updates the pending count associated with the currently visible pending snippet,
803
803
  * if any, such that we can replace the snippet with content once work is done
804
804
  * @param {1 | -1} d
805
805
  */
806
- Ft = function(e) {
806
+ Gt = function(e) {
807
807
  var i;
808
808
  if (!this.has_pending_snippet()) {
809
- this.parent && V(i = this.parent, O, Ft).call(i, e);
809
+ this.parent && D(i = this.parent, M, Gt).call(i, e);
810
810
  return;
811
811
  }
812
- if (v(this, be, c(this, be) + e), c(this, be) === 0) {
812
+ if (_(this, Ae, c(this, Ae) + e), c(this, Ae) === 0) {
813
813
  this.is_pending = !1;
814
- for (const n of c(this, qe))
815
- I(n, L), ne(n);
816
- for (const n of c(this, ze))
817
- I(n, Z), ne(n);
818
- c(this, qe).clear(), c(this, ze).clear(), c(this, j) && ht(c(this, j), () => {
819
- v(this, j, null);
820
- }), c(this, fe) && (c(this, H).before(c(this, fe)), v(this, fe, null));
814
+ for (const n of c(this, Ue))
815
+ R(n, F), oe(n);
816
+ for (const n of c(this, xe))
817
+ R(n, te), oe(n);
818
+ c(this, Ue).clear(), c(this, xe).clear(), c(this, K) && vt(c(this, K), () => {
819
+ _(this, K, null);
820
+ }), c(this, pe) && (c(this, Y).before(c(this, pe)), _(this, pe, null));
821
821
  }
822
822
  };
823
823
  // @__NO_SIDE_EFFECTS__
824
- function xi(t) {
825
- var e = C | L, i = b !== null && (b.f & C) !== 0 ? (
824
+ function Ui(t) {
825
+ var e = H | F, i = y !== null && (y.f & H) !== 0 ? (
826
826
  /** @type {Derived} */
827
- b
827
+ y
828
828
  ) : null;
829
- return S !== null && (S.f |= We), {
830
- ctx: U,
829
+ return E !== null && (E.f |= Je), {
830
+ ctx: W,
831
831
  deps: null,
832
832
  effects: null,
833
- equals: Ai,
833
+ equals: ki,
834
834
  f: e,
835
835
  fn: t,
836
836
  reactions: null,
837
837
  rv: 0,
838
838
  v: (
839
839
  /** @type {V} */
840
- k
840
+ N
841
841
  ),
842
842
  wv: 0,
843
- parent: i ?? S,
843
+ parent: i ?? E,
844
844
  ac: null
845
845
  };
846
846
  }
847
847
  // @__NO_SIDE_EFFECTS__
848
- function ni(t) {
849
- const e = /* @__PURE__ */ xi(t);
850
- return nn(e), e;
848
+ function fi(t) {
849
+ const e = /* @__PURE__ */ Ui(t);
850
+ return fn(e), e;
851
851
  }
852
- function lr(t) {
852
+ function ps(t) {
853
853
  var e = t.effects;
854
854
  if (e !== null) {
855
855
  t.effects = null;
856
856
  for (var i = 0; i < e.length; i += 1)
857
- X(
857
+ ee(
858
858
  /** @type {Effect} */
859
859
  e[i]
860
860
  );
861
861
  }
862
862
  }
863
- function ar(t) {
863
+ function gs(t) {
864
864
  for (var e = t.parent; e !== null; ) {
865
- if ((e.f & C) === 0)
866
- return (e.f & _e) === 0 ? (
865
+ if ((e.f & H) === 0)
866
+ return (e.f & Ee) === 0 ? (
867
867
  /** @type {Effect} */
868
868
  e
869
869
  ) : null;
@@ -871,126 +871,126 @@ function ar(t) {
871
871
  }
872
872
  return null;
873
873
  }
874
- function Gt(t) {
875
- var e, i = S;
876
- Se(ar(t));
874
+ function Zt(t) {
875
+ var e, i = E;
876
+ $e(gs(t));
877
877
  try {
878
- t.f &= ~Ne, lr(t), e = ln(t);
878
+ t.f &= ~De, ps(t), e = gn(t);
879
879
  } finally {
880
- Se(i);
880
+ $e(i);
881
881
  }
882
882
  return e;
883
883
  }
884
- function ji(t) {
885
- var e = Gt(t);
886
- if (!t.equals(e) && (t.wv = sn(), (!$?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
887
- I(t, R);
884
+ function xi(t) {
885
+ var e = Zt(t);
886
+ if (!t.equals(e) && (t.wv = hn(), (!k?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
887
+ R(t, V);
888
888
  return;
889
889
  }
890
- Te || (K !== null ? (Ut() || $?.is_fork) && K.set(t, e) : zt(t));
890
+ Se || (Q !== null ? (ei() || k?.is_fork) && Q.set(t, e) : Jt(t));
891
891
  }
892
- function cr(t) {
892
+ function ms(t) {
893
893
  if (t.effects !== null)
894
894
  for (const e of t.effects)
895
- (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Ht), e.teardown = Vn, e.ac = null, it(e, 0), Wt(e));
895
+ (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Wt), e.teardown = Bn, e.ac = null, ot(e, 0), ii(e));
896
896
  }
897
- function Bi(t) {
897
+ function Xi(t) {
898
898
  if (t.effects !== null)
899
899
  for (const e of t.effects)
900
- e.teardown && Ue(e);
900
+ e.teardown && We(e);
901
901
  }
902
- let Dt = /* @__PURE__ */ new Set();
902
+ let jt = /* @__PURE__ */ new Set();
903
903
  const we = /* @__PURE__ */ new Map();
904
- let Hi = !1;
905
- function At(t, e) {
904
+ let Wi = !1;
905
+ function Lt(t, e) {
906
906
  var i = {
907
907
  f: 0,
908
908
  // TODO ideally we could skip this altogether, but it causes type errors
909
909
  v: t,
910
910
  reactions: null,
911
- equals: Ai,
911
+ equals: ki,
912
912
  rv: 0,
913
913
  wv: 0
914
914
  };
915
915
  return i;
916
916
  }
917
917
  // @__NO_SIDE_EFFECTS__
918
- function N(t, e) {
919
- const i = At(t);
920
- return nn(i), i;
918
+ function P(t, e) {
919
+ const i = Lt(t);
920
+ return fn(i), i;
921
921
  }
922
922
  // @__NO_SIDE_EFFECTS__
923
- function ur(t, e = !1, i = !0) {
924
- const n = At(t);
925
- return e || (n.equals = Xn), n;
923
+ function vs(t, e = !1, i = !0) {
924
+ const n = Lt(t);
925
+ return e || (n.equals = rs), n;
926
926
  }
927
- function A(t, e, i = !1) {
928
- b !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
927
+ function $(t, e, i = !1) {
928
+ y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
929
929
  // to ensure we error if state is set inside an inspect effect
930
- (!J || (b.f & ti) !== 0) && $i() && (b.f & (C | ge | wi | ti)) !== 0 && (G === null || !Ge.call(G, t)) && Un();
931
- let n = i ? Qe(e) : e;
932
- return qi(t, n);
930
+ (!Z || (y.f & ci) !== 0) && Vi() && (y.f & (H | be | Li | ci)) !== 0 && (X === null || !Xe.call(X, t)) && Zn();
931
+ let n = i ? et(e) : e;
932
+ return Qi(t, n);
933
933
  }
934
- function qi(t, e) {
934
+ function Qi(t, e) {
935
935
  if (!t.equals(e)) {
936
936
  var i = t.v;
937
- Te ? we.set(t, e) : we.set(t, i), t.v = e;
938
- var n = pe.ensure();
939
- if (n.capture(t, i), (t.f & C) !== 0) {
940
- const r = (
937
+ Se ? we.set(t, e) : we.set(t, i), t.v = e;
938
+ var n = ve.ensure();
939
+ if (n.capture(t, i), (t.f & H) !== 0) {
940
+ const s = (
941
941
  /** @type {Derived} */
942
942
  t
943
943
  );
944
- (t.f & L) !== 0 && Gt(r), zt(r);
944
+ (t.f & F) !== 0 && Zt(s), Jt(s);
945
945
  }
946
- t.wv = sn(), zi(t, L), S !== null && (S.f & R) !== 0 && (S.f & (me | Ae)) === 0 && (B === null ? Tr([t]) : B.push(t)), !n.is_fork && Dt.size > 0 && !Hi && fr();
946
+ t.wv = hn(), Ji(t, F), E !== null && (E.f & V) !== 0 && (E.f & (_e | Ce)) === 0 && (z === null ? Ls([t]) : z.push(t)), !n.is_fork && jt.size > 0 && !Wi && bs();
947
947
  }
948
948
  return e;
949
949
  }
950
- function fr() {
951
- Hi = !1;
952
- for (const t of Dt)
953
- (t.f & R) !== 0 && I(t, Z), ot(t) && Ue(t);
954
- Dt.clear();
950
+ function bs() {
951
+ Wi = !1;
952
+ for (const t of jt)
953
+ (t.f & V) !== 0 && R(t, te), ut(t) && We(t);
954
+ jt.clear();
955
955
  }
956
- function Xe(t) {
957
- A(t, t.v + 1);
956
+ function it(t) {
957
+ $(t, t.v + 1);
958
958
  }
959
- function zi(t, e) {
959
+ function Ji(t, e) {
960
960
  var i = t.reactions;
961
961
  if (i !== null)
962
- for (var n = i.length, r = 0; r < n; r++) {
963
- var s = i[r], o = s.f, l = (o & L) === 0;
964
- if (l && I(s, e), (o & C) !== 0) {
962
+ for (var n = i.length, s = 0; s < n; s++) {
963
+ var r = i[s], o = r.f, l = (o & F) === 0;
964
+ if (l && R(r, e), (o & H) !== 0) {
965
965
  var a = (
966
966
  /** @type {Derived} */
967
- s
967
+ r
968
968
  );
969
- K?.delete(a), (o & Ne) === 0 && (o & z && (s.f |= Ne), zi(a, Z));
970
- } else l && ((o & ge) !== 0 && ae !== null && ae.add(
969
+ Q?.delete(a), (o & De) === 0 && (o & x && (r.f |= De), Ji(a, te));
970
+ } else l && ((o & be) !== 0 && fe !== null && fe.add(
971
971
  /** @type {Effect} */
972
- s
973
- ), ne(
972
+ r
973
+ ), oe(
974
974
  /** @type {Effect} */
975
- s
975
+ r
976
976
  ));
977
977
  }
978
978
  }
979
- function Qe(t) {
980
- if (typeof t != "object" || t === null || ft in t)
979
+ function et(t) {
980
+ if (typeof t != "object" || t === null || gt in t)
981
981
  return t;
982
- const e = Ln(t);
983
- if (e !== Rn && e !== On)
982
+ const e = Pn(t);
983
+ if (e !== Fn && e !== Dn)
984
984
  return t;
985
- var i = /* @__PURE__ */ new Map(), n = $n(t), r = /* @__PURE__ */ N(0), s = Ve, o = (l) => {
986
- if (Ve === s)
985
+ var i = /* @__PURE__ */ new Map(), n = Nn(t), s = /* @__PURE__ */ P(0), r = Fe, o = (l) => {
986
+ if (Fe === r)
987
987
  return l();
988
- var a = b, u = Ve;
989
- re(null), oi(s);
988
+ var a = y, u = Fe;
989
+ le(null), pi(r);
990
990
  var d = l();
991
- return re(a), oi(u), d;
991
+ return le(a), pi(u), d;
992
992
  };
993
- return n && i.set("length", /* @__PURE__ */ N(
993
+ return n && i.set("length", /* @__PURE__ */ P(
994
994
  /** @type {any[]} */
995
995
  t.length
996
996
  )), new Proxy(
@@ -998,34 +998,34 @@ function Qe(t) {
998
998
  t,
999
999
  {
1000
1000
  defineProperty(l, a, u) {
1001
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && zn();
1001
+ (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Qn();
1002
1002
  var d = i.get(a);
1003
1003
  return d === void 0 ? o(() => {
1004
- var m = /* @__PURE__ */ N(u.value);
1005
- return i.set(a, m), m;
1006
- }) : A(d, u.value, !0), !0;
1004
+ var v = /* @__PURE__ */ P(u.value);
1005
+ return i.set(a, v), v;
1006
+ }) : $(d, u.value, !0), !0;
1007
1007
  },
1008
1008
  deleteProperty(l, a) {
1009
1009
  var u = i.get(a);
1010
1010
  if (u === void 0) {
1011
1011
  if (a in l) {
1012
- const d = o(() => /* @__PURE__ */ N(k));
1013
- i.set(a, d), Xe(r);
1012
+ const d = o(() => /* @__PURE__ */ P(N));
1013
+ i.set(a, d), it(s);
1014
1014
  }
1015
1015
  } else
1016
- A(u, k), Xe(r);
1016
+ $(u, N), it(s);
1017
1017
  return !0;
1018
1018
  },
1019
1019
  get(l, a, u) {
1020
- if (a === ft)
1020
+ if (a === gt)
1021
1021
  return t;
1022
- var d = i.get(a), m = a in l;
1023
- if (d === void 0 && (!m || De(l, a)?.writable) && (d = o(() => {
1024
- var y = Qe(m ? l[a] : k), h = /* @__PURE__ */ N(y);
1022
+ var d = i.get(a), v = a in l;
1023
+ if (d === void 0 && (!v || Ge(l, a)?.writable) && (d = o(() => {
1024
+ var g = et(v ? l[a] : N), h = /* @__PURE__ */ P(g);
1025
1025
  return h;
1026
1026
  }), i.set(a, d)), d !== void 0) {
1027
- var p = g(d);
1028
- return p === k ? void 0 : p;
1027
+ var p = m(d);
1028
+ return p === N ? void 0 : p;
1029
1029
  }
1030
1030
  return Reflect.get(l, a, u);
1031
1031
  },
@@ -1033,10 +1033,10 @@ function Qe(t) {
1033
1033
  var u = Reflect.getOwnPropertyDescriptor(l, a);
1034
1034
  if (u && "value" in u) {
1035
1035
  var d = i.get(a);
1036
- d && (u.value = g(d));
1036
+ d && (u.value = m(d));
1037
1037
  } else if (u === void 0) {
1038
- var m = i.get(a), p = m?.v;
1039
- if (m !== void 0 && p !== k)
1038
+ var v = i.get(a), p = v?.v;
1039
+ if (v !== void 0 && p !== N)
1040
1040
  return {
1041
1041
  enumerable: !0,
1042
1042
  configurable: !0,
@@ -1047,122 +1047,122 @@ function Qe(t) {
1047
1047
  return u;
1048
1048
  },
1049
1049
  has(l, a) {
1050
- if (a === ft)
1050
+ if (a === gt)
1051
1051
  return !0;
1052
- var u = i.get(a), d = u !== void 0 && u.v !== k || Reflect.has(l, a);
1053
- if (u !== void 0 || S !== null && (!d || De(l, a)?.writable)) {
1052
+ var u = i.get(a), d = u !== void 0 && u.v !== N || Reflect.has(l, a);
1053
+ if (u !== void 0 || E !== null && (!d || Ge(l, a)?.writable)) {
1054
1054
  u === void 0 && (u = o(() => {
1055
- var p = d ? Qe(l[a]) : k, y = /* @__PURE__ */ N(p);
1056
- return y;
1055
+ var p = d ? et(l[a]) : N, g = /* @__PURE__ */ P(p);
1056
+ return g;
1057
1057
  }), i.set(a, u));
1058
- var m = g(u);
1059
- if (m === k)
1058
+ var v = m(u);
1059
+ if (v === N)
1060
1060
  return !1;
1061
1061
  }
1062
1062
  return d;
1063
1063
  },
1064
1064
  set(l, a, u, d) {
1065
- var m = i.get(a), p = a in l;
1065
+ var v = i.get(a), p = a in l;
1066
1066
  if (n && a === "length")
1067
- for (var y = u; y < /** @type {Source<number>} */
1068
- m.v; y += 1) {
1069
- var h = i.get(y + "");
1070
- h !== void 0 ? A(h, k) : y in l && (h = o(() => /* @__PURE__ */ N(k)), i.set(y + "", h));
1067
+ for (var g = u; g < /** @type {Source<number>} */
1068
+ v.v; g += 1) {
1069
+ var h = i.get(g + "");
1070
+ h !== void 0 ? $(h, N) : g in l && (h = o(() => /* @__PURE__ */ P(N)), i.set(g + "", h));
1071
1071
  }
1072
- if (m === void 0)
1073
- (!p || De(l, a)?.writable) && (m = o(() => /* @__PURE__ */ N(void 0)), A(m, Qe(u)), i.set(a, m));
1072
+ if (v === void 0)
1073
+ (!p || Ge(l, a)?.writable) && (v = o(() => /* @__PURE__ */ P(void 0)), $(v, et(u)), i.set(a, v));
1074
1074
  else {
1075
- p = m.v !== k;
1076
- var E = o(() => Qe(u));
1077
- A(m, E);
1075
+ p = v.v !== N;
1076
+ var T = o(() => et(u));
1077
+ $(v, T);
1078
1078
  }
1079
- var _ = Reflect.getOwnPropertyDescriptor(l, a);
1080
- if (_?.set && _.set.call(d, u), !p) {
1079
+ var b = Reflect.getOwnPropertyDescriptor(l, a);
1080
+ if (b?.set && b.set.call(d, u), !p) {
1081
1081
  if (n && typeof a == "string") {
1082
- var F = (
1082
+ var S = (
1083
1083
  /** @type {Source<number>} */
1084
1084
  i.get("length")
1085
- ), W = Number(a);
1086
- Number.isInteger(W) && W >= F.v && A(F, W + 1);
1085
+ ), L = Number(a);
1086
+ Number.isInteger(L) && L >= S.v && $(S, L + 1);
1087
1087
  }
1088
- Xe(r);
1088
+ it(s);
1089
1089
  }
1090
1090
  return !0;
1091
1091
  },
1092
1092
  ownKeys(l) {
1093
- g(r);
1094
- var a = Reflect.ownKeys(l).filter((m) => {
1095
- var p = i.get(m);
1096
- return p === void 0 || p.v !== k;
1093
+ m(s);
1094
+ var a = Reflect.ownKeys(l).filter((v) => {
1095
+ var p = i.get(v);
1096
+ return p === void 0 || p.v !== N;
1097
1097
  });
1098
1098
  for (var [u, d] of i)
1099
- d.v !== k && !(u in l) && a.push(u);
1099
+ d.v !== N && !(u in l) && a.push(u);
1100
1100
  return a;
1101
1101
  },
1102
1102
  setPrototypeOf() {
1103
- Gn();
1103
+ Jn();
1104
1104
  }
1105
1105
  }
1106
1106
  );
1107
1107
  }
1108
- var ri, Gi, Ui, Yi;
1109
- function Pt() {
1110
- if (ri === void 0) {
1111
- ri = window, Gi = /Firefox/.test(navigator.userAgent);
1108
+ var di, Zi, en, tn;
1109
+ function qt() {
1110
+ if (di === void 0) {
1111
+ di = window, Zi = /Firefox/.test(navigator.userAgent);
1112
1112
  var t = Element.prototype, e = Node.prototype, i = Text.prototype;
1113
- Ui = De(e, "firstChild").get, Yi = De(e, "nextSibling").get, ei(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), ei(i) && (i.__t = void 0);
1113
+ en = Ge(e, "firstChild").get, tn = Ge(e, "nextSibling").get, ai(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), ai(i) && (i.__t = void 0);
1114
1114
  }
1115
1115
  }
1116
- function Wi(t = "") {
1116
+ function nn(t = "") {
1117
1117
  return document.createTextNode(t);
1118
1118
  }
1119
1119
  // @__NO_SIDE_EFFECTS__
1120
- function Ki(t) {
1120
+ function sn(t) {
1121
1121
  return (
1122
1122
  /** @type {TemplateNode | null} */
1123
- Ui.call(t)
1123
+ en.call(t)
1124
1124
  );
1125
1125
  }
1126
1126
  // @__NO_SIDE_EFFECTS__
1127
- function Ke(t) {
1127
+ function Ze(t) {
1128
1128
  return (
1129
1129
  /** @type {TemplateNode | null} */
1130
- Yi.call(t)
1130
+ tn.call(t)
1131
1131
  );
1132
1132
  }
1133
- function dr(t) {
1133
+ function _s(t) {
1134
1134
  t.textContent = "";
1135
1135
  }
1136
- function Qi(t, e, i) {
1136
+ function rn(t, e, i) {
1137
1137
  return (
1138
1138
  /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
1139
- document.createElementNS(En, t, void 0)
1139
+ document.createElementNS(Hn, t, void 0)
1140
1140
  );
1141
1141
  }
1142
- function Ji(t) {
1143
- var e = b, i = S;
1144
- re(null), Se(null);
1142
+ function on(t) {
1143
+ var e = y, i = E;
1144
+ le(null), $e(null);
1145
1145
  try {
1146
1146
  return t();
1147
1147
  } finally {
1148
- re(e), Se(i);
1148
+ le(e), $e(i);
1149
1149
  }
1150
1150
  }
1151
- function hr(t) {
1152
- S === null && (b === null && Bn(), jn()), Te && xn();
1151
+ function ys(t) {
1152
+ E === null && (y === null && xn(), Un()), Se && Yn();
1153
1153
  }
1154
- function pr(t, e) {
1154
+ function Ts(t, e) {
1155
1155
  var i = e.last;
1156
1156
  i === null ? e.last = e.first = t : (i.next = t, t.prev = i, e.last = t);
1157
1157
  }
1158
- function Me(t, e, i) {
1159
- var n = S;
1160
- n !== null && (n.f & ye) !== 0 && (t |= ye);
1161
- var r = {
1162
- ctx: U,
1158
+ function Pe(t, e, i) {
1159
+ var n = E;
1160
+ n !== null && (n.f & Ie) !== 0 && (t |= Ie);
1161
+ var s = {
1162
+ ctx: W,
1163
1163
  deps: null,
1164
1164
  nodes: null,
1165
- f: t | L | z,
1165
+ f: t | F | x,
1166
1166
  first: null,
1167
1167
  fn: e,
1168
1168
  last: null,
@@ -1176,498 +1176,498 @@ function Me(t, e, i) {
1176
1176
  };
1177
1177
  if (i)
1178
1178
  try {
1179
- Ue(r);
1179
+ We(s);
1180
1180
  } catch (l) {
1181
- throw X(r), l;
1181
+ throw ee(s), l;
1182
1182
  }
1183
- else e !== null && ne(r);
1184
- var s = r;
1185
- if (i && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
1186
- (s.f & We) === 0 && (s = s.first, (t & ge) !== 0 && (t & yt) !== 0 && s !== null && (s.f |= yt)), s !== null && (s.parent = n, n !== null && pr(s, n), b !== null && (b.f & C) !== 0 && (t & Ae) === 0)) {
1183
+ else e !== null && oe(s);
1184
+ var r = s;
1185
+ if (i && r.deps === null && r.teardown === null && r.nodes === null && r.first === r.last && // either `null`, or a singular child
1186
+ (r.f & Je) === 0 && (r = r.first, (t & be) !== 0 && (t & It) !== 0 && r !== null && (r.f |= It)), r !== null && (r.parent = n, n !== null && Ts(r, n), y !== null && (y.f & H) !== 0 && (t & Ce) === 0)) {
1187
1187
  var o = (
1188
1188
  /** @type {Derived} */
1189
- b
1189
+ y
1190
1190
  );
1191
- (o.effects ?? (o.effects = [])).push(s);
1191
+ (o.effects ?? (o.effects = [])).push(r);
1192
1192
  }
1193
- return r;
1193
+ return s;
1194
1194
  }
1195
- function Ut() {
1196
- return b !== null && !J;
1195
+ function ei() {
1196
+ return y !== null && !Z;
1197
1197
  }
1198
- function Ie(t) {
1199
- hr();
1198
+ function Le(t) {
1199
+ ys();
1200
1200
  var e = (
1201
1201
  /** @type {Effect} */
1202
- S.f
1203
- ), i = !b && (e & me) !== 0 && (e & Ye) === 0;
1202
+ E.f
1203
+ ), i = !y && (e & _e) !== 0 && (e & Qe) === 0;
1204
1204
  if (i) {
1205
1205
  var n = (
1206
1206
  /** @type {ComponentContext} */
1207
- U
1207
+ W
1208
1208
  );
1209
1209
  (n.e ?? (n.e = [])).push(t);
1210
1210
  } else
1211
- return Xi(t);
1211
+ return ln(t);
1212
1212
  }
1213
- function Xi(t) {
1214
- return Me(Ze | Fn, t, !1);
1213
+ function ln(t) {
1214
+ return Pe(nt | qn, t, !1);
1215
1215
  }
1216
- function gr(t) {
1217
- pe.ensure();
1218
- const e = Me(Ae | We, t, !0);
1216
+ function As(t) {
1217
+ ve.ensure();
1218
+ const e = Pe(Ce | Je, t, !0);
1219
1219
  return () => {
1220
- X(e);
1220
+ ee(e);
1221
1221
  };
1222
1222
  }
1223
- function mr(t) {
1224
- pe.ensure();
1225
- const e = Me(Ae | We, t, !0);
1223
+ function Is(t) {
1224
+ ve.ensure();
1225
+ const e = Pe(Ce | Je, t, !0);
1226
1226
  return (i = {}) => new Promise((n) => {
1227
- i.outro ? ht(e, () => {
1228
- X(e), n(void 0);
1229
- }) : (X(e), n(void 0));
1227
+ i.outro ? vt(e, () => {
1228
+ ee(e), n(void 0);
1229
+ }) : (ee(e), n(void 0));
1230
1230
  });
1231
1231
  }
1232
- function vr(t) {
1233
- return Me(Ze, t, !1);
1232
+ function Es(t) {
1233
+ return Pe(nt, t, !1);
1234
1234
  }
1235
- function Yt(t, e = 0) {
1236
- return Me(bi | e, t, !0);
1235
+ function ti(t, e = 0) {
1236
+ return Pe(Si | e, t, !0);
1237
1237
  }
1238
- function br(t, e = 0) {
1239
- var i = Me(ge | e, t, !0);
1238
+ function ws(t, e = 0) {
1239
+ var i = Pe(be | e, t, !0);
1240
1240
  return i;
1241
1241
  }
1242
- function Fe(t) {
1243
- return Me(me | We, t, !0);
1242
+ function Be(t) {
1243
+ return Pe(_e | Je, t, !0);
1244
1244
  }
1245
- function Zi(t) {
1245
+ function an(t) {
1246
1246
  var e = t.teardown;
1247
1247
  if (e !== null) {
1248
- const i = Te, n = b;
1249
- si(!0), re(null);
1248
+ const i = Se, n = y;
1249
+ hi(!0), le(null);
1250
1250
  try {
1251
1251
  e.call(null);
1252
1252
  } finally {
1253
- si(i), re(n);
1253
+ hi(i), le(n);
1254
1254
  }
1255
1255
  }
1256
1256
  }
1257
- function Wt(t, e = !1) {
1257
+ function ii(t, e = !1) {
1258
1258
  var i = t.first;
1259
1259
  for (t.first = t.last = null; i !== null; ) {
1260
- const r = i.ac;
1261
- r !== null && Ji(() => {
1262
- r.abort(Ht);
1260
+ const s = i.ac;
1261
+ s !== null && on(() => {
1262
+ s.abort(Wt);
1263
1263
  });
1264
1264
  var n = i.next;
1265
- (i.f & Ae) !== 0 ? i.parent = null : X(i, e), i = n;
1265
+ (i.f & Ce) !== 0 ? i.parent = null : ee(i, e), i = n;
1266
1266
  }
1267
1267
  }
1268
- function yr(t) {
1268
+ function Ss(t) {
1269
1269
  for (var e = t.first; e !== null; ) {
1270
1270
  var i = e.next;
1271
- (e.f & me) === 0 && X(e), e = i;
1271
+ (e.f & _e) === 0 && ee(e), e = i;
1272
1272
  }
1273
1273
  }
1274
- function X(t, e = !0) {
1274
+ function ee(t, e = !0) {
1275
1275
  var i = !1;
1276
- (e || (t.f & _i) !== 0) && t.nodes !== null && t.nodes.end !== null && (_r(
1276
+ (e || (t.f & Ci) !== 0) && t.nodes !== null && t.nodes.end !== null && ($s(
1277
1277
  t.nodes.start,
1278
1278
  /** @type {TemplateNode} */
1279
1279
  t.nodes.end
1280
- ), i = !0), Wt(t, e && !i), it(t, 0), I(t, _e);
1280
+ ), i = !0), ii(t, e && !i), ot(t, 0), R(t, Ee);
1281
1281
  var n = t.nodes && t.nodes.t;
1282
1282
  if (n !== null)
1283
- for (const s of n)
1284
- s.stop();
1285
- Zi(t);
1286
- var r = t.parent;
1287
- r !== null && r.first !== null && en(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1283
+ for (const r of n)
1284
+ r.stop();
1285
+ an(t);
1286
+ var s = t.parent;
1287
+ s !== null && s.first !== null && cn(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1288
1288
  }
1289
- function _r(t, e) {
1289
+ function $s(t, e) {
1290
1290
  for (; t !== null; ) {
1291
- var i = t === e ? null : /* @__PURE__ */ Ke(t);
1291
+ var i = t === e ? null : /* @__PURE__ */ Ze(t);
1292
1292
  t.remove(), t = i;
1293
1293
  }
1294
1294
  }
1295
- function en(t) {
1295
+ function cn(t) {
1296
1296
  var e = t.parent, i = t.prev, n = t.next;
1297
1297
  i !== null && (i.next = n), n !== null && (n.prev = i), e !== null && (e.first === t && (e.first = n), e.last === t && (e.last = i));
1298
1298
  }
1299
- function ht(t, e, i = !0) {
1299
+ function vt(t, e, i = !0) {
1300
1300
  var n = [];
1301
- tn(t, n, !0);
1302
- var r = () => {
1303
- i && X(t), e && e();
1304
- }, s = n.length;
1305
- if (s > 0) {
1306
- var o = () => --s || r();
1301
+ un(t, n, !0);
1302
+ var s = () => {
1303
+ i && ee(t), e && e();
1304
+ }, r = n.length;
1305
+ if (r > 0) {
1306
+ var o = () => --r || s();
1307
1307
  for (var l of n)
1308
1308
  l.out(o);
1309
1309
  } else
1310
- r();
1310
+ s();
1311
1311
  }
1312
- function tn(t, e, i) {
1313
- if ((t.f & ye) === 0) {
1314
- t.f ^= ye;
1312
+ function un(t, e, i) {
1313
+ if ((t.f & Ie) === 0) {
1314
+ t.f ^= Ie;
1315
1315
  var n = t.nodes && t.nodes.t;
1316
1316
  if (n !== null)
1317
1317
  for (const l of n)
1318
1318
  (l.is_global || i) && e.push(l);
1319
- for (var r = t.first; r !== null; ) {
1320
- var s = r.next, o = (r.f & yt) !== 0 || // If this is a branch effect without a block effect parent,
1319
+ for (var s = t.first; s !== null; ) {
1320
+ var r = s.next, o = (s.f & It) !== 0 || // If this is a branch effect without a block effect parent,
1321
1321
  // it means the parent block effect was pruned. In that case,
1322
1322
  // transparency information was transferred to the branch effect.
1323
- (r.f & me) !== 0 && (t.f & ge) !== 0;
1324
- tn(r, e, o ? i : !1), r = s;
1323
+ (s.f & _e) !== 0 && (t.f & be) !== 0;
1324
+ un(s, e, o ? i : !1), s = r;
1325
1325
  }
1326
1326
  }
1327
1327
  }
1328
- function wr(t, e) {
1328
+ function Cs(t, e) {
1329
1329
  if (t.nodes)
1330
1330
  for (var i = t.nodes.start, n = t.nodes.end; i !== null; ) {
1331
- var r = i === n ? null : /* @__PURE__ */ Ke(i);
1332
- e.append(i), i = r;
1331
+ var s = i === n ? null : /* @__PURE__ */ Ze(i);
1332
+ e.append(i), i = s;
1333
1333
  }
1334
1334
  }
1335
- let pt = !1, Te = !1;
1336
- function si(t) {
1337
- Te = t;
1335
+ let bt = !1, Se = !1;
1336
+ function hi(t) {
1337
+ Se = t;
1338
1338
  }
1339
- let b = null, J = !1;
1340
- function re(t) {
1341
- b = t;
1339
+ let y = null, Z = !1;
1340
+ function le(t) {
1341
+ y = t;
1342
1342
  }
1343
- let S = null;
1344
- function Se(t) {
1345
- S = t;
1343
+ let E = null;
1344
+ function $e(t) {
1345
+ E = t;
1346
1346
  }
1347
- let G = null;
1348
- function nn(t) {
1349
- b !== null && (G === null ? G = [t] : G.push(t));
1347
+ let X = null;
1348
+ function fn(t) {
1349
+ y !== null && (X === null ? X = [t] : X.push(t));
1350
1350
  }
1351
- let P = null, x = 0, B = null;
1352
- function Tr(t) {
1353
- B = t;
1351
+ let j = null, q = 0, z = null;
1352
+ function Ls(t) {
1353
+ z = t;
1354
1354
  }
1355
- let rn = 1, $e = 0, Ve = $e;
1356
- function oi(t) {
1357
- Ve = t;
1355
+ let dn = 1, Oe = 0, Fe = Oe;
1356
+ function pi(t) {
1357
+ Fe = t;
1358
1358
  }
1359
- function sn() {
1360
- return ++rn;
1359
+ function hn() {
1360
+ return ++dn;
1361
1361
  }
1362
- function ot(t) {
1362
+ function ut(t) {
1363
1363
  var e = t.f;
1364
- if ((e & L) !== 0)
1364
+ if ((e & F) !== 0)
1365
1365
  return !0;
1366
- if (e & C && (t.f &= ~Ne), (e & Z) !== 0) {
1366
+ if (e & H && (t.f &= ~De), (e & te) !== 0) {
1367
1367
  for (var i = (
1368
1368
  /** @type {Value[]} */
1369
1369
  t.deps
1370
- ), n = i.length, r = 0; r < n; r++) {
1371
- var s = i[r];
1372
- if (ot(
1370
+ ), n = i.length, s = 0; s < n; s++) {
1371
+ var r = i[s];
1372
+ if (ut(
1373
1373
  /** @type {Derived} */
1374
- s
1375
- ) && ji(
1374
+ r
1375
+ ) && xi(
1376
1376
  /** @type {Derived} */
1377
- s
1378
- ), s.wv > t.wv)
1377
+ r
1378
+ ), r.wv > t.wv)
1379
1379
  return !0;
1380
1380
  }
1381
- (e & z) !== 0 && // During time traveling we don't want to reset the status so that
1381
+ (e & x) !== 0 && // During time traveling we don't want to reset the status so that
1382
1382
  // traversal of the graph in the other batches still happens
1383
- K === null && I(t, R);
1383
+ Q === null && R(t, V);
1384
1384
  }
1385
1385
  return !1;
1386
1386
  }
1387
- function on(t, e, i = !0) {
1387
+ function pn(t, e, i = !0) {
1388
1388
  var n = t.reactions;
1389
- if (n !== null && !(G !== null && Ge.call(G, t)))
1390
- for (var r = 0; r < n.length; r++) {
1391
- var s = n[r];
1392
- (s.f & C) !== 0 ? on(
1389
+ if (n !== null && !(X !== null && Xe.call(X, t)))
1390
+ for (var s = 0; s < n.length; s++) {
1391
+ var r = n[s];
1392
+ (r.f & H) !== 0 ? pn(
1393
1393
  /** @type {Derived} */
1394
- s,
1394
+ r,
1395
1395
  e,
1396
1396
  !1
1397
- ) : e === s && (i ? I(s, L) : (s.f & R) !== 0 && I(s, Z), ne(
1397
+ ) : e === r && (i ? R(r, F) : (r.f & V) !== 0 && R(r, te), oe(
1398
1398
  /** @type {Effect} */
1399
- s
1399
+ r
1400
1400
  ));
1401
1401
  }
1402
1402
  }
1403
- function ln(t) {
1404
- var E;
1405
- var e = P, i = x, n = B, r = b, s = G, o = U, l = J, a = Ve, u = t.f;
1406
- P = /** @type {null | Value[]} */
1407
- null, x = 0, B = null, b = (u & (me | Ae)) === 0 ? t : null, G = null, _t(t.ctx), J = !1, Ve = ++$e, t.ac !== null && (Ji(() => {
1408
- t.ac.abort(Ht);
1403
+ function gn(t) {
1404
+ var T;
1405
+ var e = j, i = q, n = z, s = y, r = X, o = W, l = Z, a = Fe, u = t.f;
1406
+ j = /** @type {null | Value[]} */
1407
+ null, q = 0, z = null, y = (u & (_e | Ce)) === 0 ? t : null, X = null, Et(t.ctx), Z = !1, Fe = ++Oe, t.ac !== null && (on(() => {
1408
+ t.ac.abort(Wt);
1409
1409
  }), t.ac = null);
1410
1410
  try {
1411
- t.f |= Ot;
1411
+ t.f |= Mt;
1412
1412
  var d = (
1413
1413
  /** @type {Function} */
1414
1414
  t.fn
1415
- ), m = d();
1416
- t.f |= Ye;
1417
- var p = t.deps, y = $?.is_fork;
1418
- if (P !== null) {
1415
+ ), v = d();
1416
+ t.f |= Qe;
1417
+ var p = t.deps, g = k?.is_fork;
1418
+ if (j !== null) {
1419
1419
  var h;
1420
- if (y || it(t, x), p !== null && x > 0)
1421
- for (p.length = x + P.length, h = 0; h < P.length; h++)
1422
- p[x + h] = P[h];
1420
+ if (g || ot(t, q), p !== null && q > 0)
1421
+ for (p.length = q + j.length, h = 0; h < j.length; h++)
1422
+ p[q + h] = j[h];
1423
1423
  else
1424
- t.deps = p = P;
1425
- if (Ut() && (t.f & z) !== 0)
1426
- for (h = x; h < p.length; h++)
1427
- ((E = p[h]).reactions ?? (E.reactions = [])).push(t);
1428
- } else !y && p !== null && x < p.length && (it(t, x), p.length = x);
1429
- if ($i() && B !== null && !J && p !== null && (t.f & (C | Z | L)) === 0)
1424
+ t.deps = p = j;
1425
+ if (ei() && (t.f & x) !== 0)
1426
+ for (h = q; h < p.length; h++)
1427
+ ((T = p[h]).reactions ?? (T.reactions = [])).push(t);
1428
+ } else !g && p !== null && q < p.length && (ot(t, q), p.length = q);
1429
+ if (Vi() && z !== null && !Z && p !== null && (t.f & (H | te | F)) === 0)
1430
1430
  for (h = 0; h < /** @type {Source[]} */
1431
- B.length; h++)
1432
- on(
1433
- B[h],
1431
+ z.length; h++)
1432
+ pn(
1433
+ z[h],
1434
1434
  /** @type {Effect} */
1435
1435
  t
1436
1436
  );
1437
- if (r !== null && r !== t) {
1438
- if ($e++, r.deps !== null)
1439
- for (let _ = 0; _ < i; _ += 1)
1440
- r.deps[_].rv = $e;
1437
+ if (s !== null && s !== t) {
1438
+ if (Oe++, s.deps !== null)
1439
+ for (let b = 0; b < i; b += 1)
1440
+ s.deps[b].rv = Oe;
1441
1441
  if (e !== null)
1442
- for (const _ of e)
1443
- _.rv = $e;
1444
- B !== null && (n === null ? n = B : n.push(.../** @type {Source[]} */
1445
- B));
1442
+ for (const b of e)
1443
+ b.rv = Oe;
1444
+ z !== null && (n === null ? n = z : n.push(.../** @type {Source[]} */
1445
+ z));
1446
1446
  }
1447
- return (t.f & et) !== 0 && (t.f ^= et), m;
1448
- } catch (_) {
1449
- return ki(_);
1447
+ return (t.f & st) !== 0 && (t.f ^= st), v;
1448
+ } catch (b) {
1449
+ return Fi(b);
1450
1450
  } finally {
1451
- t.f ^= Ot, P = e, x = i, B = n, b = r, G = s, _t(o), J = l, Ve = a;
1451
+ t.f ^= Mt, j = e, q = i, z = n, y = s, X = r, Et(o), Z = l, Fe = a;
1452
1452
  }
1453
1453
  }
1454
- function Sr(t, e) {
1454
+ function Rs(t, e) {
1455
1455
  let i = e.reactions;
1456
1456
  if (i !== null) {
1457
- var n = Cn.call(i, t);
1457
+ var n = Vn.call(i, t);
1458
1458
  if (n !== -1) {
1459
- var r = i.length - 1;
1460
- r === 0 ? i = e.reactions = null : (i[n] = i[r], i.pop());
1459
+ var s = i.length - 1;
1460
+ s === 0 ? i = e.reactions = null : (i[n] = i[s], i.pop());
1461
1461
  }
1462
1462
  }
1463
- if (i === null && (e.f & C) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1463
+ if (i === null && (e.f & H) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1464
1464
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1465
1465
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1466
- (P === null || !Ge.call(P, e))) {
1467
- var s = (
1466
+ (j === null || !Xe.call(j, e))) {
1467
+ var r = (
1468
1468
  /** @type {Derived} */
1469
1469
  e
1470
1470
  );
1471
- (s.f & z) !== 0 && (s.f ^= z, s.f &= ~Ne), zt(s), cr(s), it(s, 0);
1471
+ (r.f & x) !== 0 && (r.f ^= x, r.f &= ~De), Jt(r), ms(r), ot(r, 0);
1472
1472
  }
1473
1473
  }
1474
- function it(t, e) {
1474
+ function ot(t, e) {
1475
1475
  var i = t.deps;
1476
1476
  if (i !== null)
1477
1477
  for (var n = e; n < i.length; n++)
1478
- Sr(t, i[n]);
1478
+ Rs(t, i[n]);
1479
1479
  }
1480
- function Ue(t) {
1480
+ function We(t) {
1481
1481
  var e = t.f;
1482
- if ((e & _e) === 0) {
1483
- I(t, R);
1484
- var i = S, n = pt;
1485
- S = t, pt = !0;
1482
+ if ((e & Ee) === 0) {
1483
+ R(t, V);
1484
+ var i = E, n = bt;
1485
+ E = t, bt = !0;
1486
1486
  try {
1487
- (e & (ge | yi)) !== 0 ? yr(t) : Wt(t), Zi(t);
1488
- var r = ln(t);
1489
- t.teardown = typeof r == "function" ? r : null, t.wv = rn;
1490
- var s;
1491
- kt && Zn && (t.f & L) !== 0 && t.deps;
1487
+ (e & (be | $i)) !== 0 ? Ss(t) : ii(t), an(t);
1488
+ var s = gn(t);
1489
+ t.teardown = typeof s == "function" ? s : null, t.wv = dn;
1490
+ var r;
1491
+ Nt && os && (t.f & F) !== 0 && t.deps;
1492
1492
  } finally {
1493
- pt = n, S = i;
1493
+ bt = n, E = i;
1494
1494
  }
1495
1495
  }
1496
1496
  }
1497
- function g(t) {
1498
- var e = t.f, i = (e & C) !== 0;
1499
- if (b !== null && !J) {
1500
- var n = S !== null && (S.f & _e) !== 0;
1501
- if (!n && (G === null || !Ge.call(G, t))) {
1502
- var r = b.deps;
1503
- if ((b.f & Ot) !== 0)
1504
- t.rv < $e && (t.rv = $e, P === null && r !== null && r[x] === t ? x++ : P === null ? P = [t] : P.push(t));
1497
+ function m(t) {
1498
+ var e = t.f, i = (e & H) !== 0;
1499
+ if (y !== null && !Z) {
1500
+ var n = E !== null && (E.f & Ee) !== 0;
1501
+ if (!n && (X === null || !Xe.call(X, t))) {
1502
+ var s = y.deps;
1503
+ if ((y.f & Mt) !== 0)
1504
+ t.rv < Oe && (t.rv = Oe, j === null && s !== null && s[q] === t ? q++ : j === null ? j = [t] : j.push(t));
1505
1505
  else {
1506
- (b.deps ?? (b.deps = [])).push(t);
1507
- var s = t.reactions;
1508
- s === null ? t.reactions = [b] : Ge.call(s, b) || s.push(b);
1506
+ (y.deps ?? (y.deps = [])).push(t);
1507
+ var r = t.reactions;
1508
+ r === null ? t.reactions = [y] : Xe.call(r, y) || r.push(y);
1509
1509
  }
1510
1510
  }
1511
1511
  }
1512
- if (Te && we.has(t))
1512
+ if (Se && we.has(t))
1513
1513
  return we.get(t);
1514
1514
  if (i) {
1515
1515
  var o = (
1516
1516
  /** @type {Derived} */
1517
1517
  t
1518
1518
  );
1519
- if (Te) {
1519
+ if (Se) {
1520
1520
  var l = o.v;
1521
- return ((o.f & R) === 0 && o.reactions !== null || cn(o)) && (l = Gt(o)), we.set(o, l), l;
1521
+ return ((o.f & V) === 0 && o.reactions !== null || vn(o)) && (l = Zt(o)), we.set(o, l), l;
1522
1522
  }
1523
- var a = (o.f & z) === 0 && !J && b !== null && (pt || (b.f & z) !== 0), u = (o.f & Ye) === 0;
1524
- ot(o) && (a && (o.f |= z), ji(o)), a && !u && (Bi(o), an(o));
1523
+ var a = (o.f & x) === 0 && !Z && y !== null && (bt || (y.f & x) !== 0), u = (o.f & Qe) === 0;
1524
+ ut(o) && (a && (o.f |= x), xi(o)), a && !u && (Xi(o), mn(o));
1525
1525
  }
1526
- if (K?.has(t))
1527
- return K.get(t);
1528
- if ((t.f & et) !== 0)
1526
+ if (Q?.has(t))
1527
+ return Q.get(t);
1528
+ if ((t.f & st) !== 0)
1529
1529
  throw t.v;
1530
1530
  return t.v;
1531
1531
  }
1532
- function an(t) {
1533
- if (t.f |= z, t.deps !== null)
1532
+ function mn(t) {
1533
+ if (t.f |= x, t.deps !== null)
1534
1534
  for (const e of t.deps)
1535
- (e.reactions ?? (e.reactions = [])).push(t), (e.f & C) !== 0 && (e.f & z) === 0 && (Bi(
1535
+ (e.reactions ?? (e.reactions = [])).push(t), (e.f & H) !== 0 && (e.f & x) === 0 && (Xi(
1536
1536
  /** @type {Derived} */
1537
1537
  e
1538
- ), an(
1538
+ ), mn(
1539
1539
  /** @type {Derived} */
1540
1540
  e
1541
1541
  ));
1542
1542
  }
1543
- function cn(t) {
1544
- if (t.v === k) return !0;
1543
+ function vn(t) {
1544
+ if (t.v === N) return !0;
1545
1545
  if (t.deps === null) return !1;
1546
1546
  for (const e of t.deps)
1547
- if (we.has(e) || (e.f & C) !== 0 && cn(
1547
+ if (we.has(e) || (e.f & H) !== 0 && vn(
1548
1548
  /** @type {Derived} */
1549
1549
  e
1550
1550
  ))
1551
1551
  return !0;
1552
1552
  return !1;
1553
1553
  }
1554
- function Kt(t) {
1555
- var e = J;
1554
+ function ni(t) {
1555
+ var e = Z;
1556
1556
  try {
1557
- return J = !0, t();
1557
+ return Z = !0, t();
1558
1558
  } finally {
1559
- J = e;
1559
+ Z = e;
1560
1560
  }
1561
1561
  }
1562
- const ct = /* @__PURE__ */ Symbol("events"), Ar = /* @__PURE__ */ new Set(), li = /* @__PURE__ */ new Set();
1563
- let ai = null;
1564
- function ci(t) {
1562
+ const ht = /* @__PURE__ */ Symbol("events"), Os = /* @__PURE__ */ new Set(), gi = /* @__PURE__ */ new Set();
1563
+ let mi = null;
1564
+ function vi(t) {
1565
1565
  var e = this, i = (
1566
1566
  /** @type {Node} */
1567
1567
  e.ownerDocument
1568
- ), n = t.type, r = t.composedPath?.() || [], s = (
1568
+ ), n = t.type, s = t.composedPath?.() || [], r = (
1569
1569
  /** @type {null | Element} */
1570
- r[0] || t.target
1570
+ s[0] || t.target
1571
1571
  );
1572
- ai = t;
1573
- var o = 0, l = ai === t && t[ct];
1572
+ mi = t;
1573
+ var o = 0, l = mi === t && t[ht];
1574
1574
  if (l) {
1575
- var a = r.indexOf(l);
1575
+ var a = s.indexOf(l);
1576
1576
  if (a !== -1 && (e === document || e === /** @type {any} */
1577
1577
  window)) {
1578
- t[ct] = e;
1578
+ t[ht] = e;
1579
1579
  return;
1580
1580
  }
1581
- var u = r.indexOf(e);
1581
+ var u = s.indexOf(e);
1582
1582
  if (u === -1)
1583
1583
  return;
1584
1584
  a <= u && (o = a);
1585
1585
  }
1586
- if (s = /** @type {Element} */
1587
- r[o] || t.target, s !== e) {
1588
- bt(t, "currentTarget", {
1586
+ if (r = /** @type {Element} */
1587
+ s[o] || t.target, r !== e) {
1588
+ At(t, "currentTarget", {
1589
1589
  configurable: !0,
1590
1590
  get() {
1591
- return s || i;
1591
+ return r || i;
1592
1592
  }
1593
1593
  });
1594
- var d = b, m = S;
1595
- re(null), Se(null);
1594
+ var d = y, v = E;
1595
+ le(null), $e(null);
1596
1596
  try {
1597
- for (var p, y = []; s !== null; ) {
1598
- var h = s.assignedSlot || s.parentNode || /** @type {any} */
1599
- s.host || null;
1597
+ for (var p, g = []; r !== null; ) {
1598
+ var h = r.assignedSlot || r.parentNode || /** @type {any} */
1599
+ r.host || null;
1600
1600
  try {
1601
- var E = s[ct]?.[n];
1602
- E != null && (!/** @type {any} */
1603
- s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1601
+ var T = r[ht]?.[n];
1602
+ T != null && (!/** @type {any} */
1603
+ r.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1604
1604
  // -> the target could not have been disabled because it emits the event in the first place
1605
- t.target === s) && E.call(s, t);
1606
- } catch (_) {
1607
- p ? y.push(_) : p = _;
1605
+ t.target === r) && T.call(r, t);
1606
+ } catch (b) {
1607
+ p ? g.push(b) : p = b;
1608
1608
  }
1609
1609
  if (t.cancelBubble || h === e || h === null)
1610
1610
  break;
1611
- s = h;
1611
+ r = h;
1612
1612
  }
1613
1613
  if (p) {
1614
- for (let _ of y)
1614
+ for (let b of g)
1615
1615
  queueMicrotask(() => {
1616
- throw _;
1616
+ throw b;
1617
1617
  });
1618
1618
  throw p;
1619
1619
  }
1620
1620
  } finally {
1621
- t[ct] = e, delete t.currentTarget, re(d), Se(m);
1621
+ t[ht] = e, delete t.currentTarget, le(d), $e(v);
1622
1622
  }
1623
1623
  }
1624
1624
  }
1625
- const Ir = (
1625
+ const ks = (
1626
1626
  // We gotta write it like this because after downleveling the pure comment may end up in the wrong location
1627
1627
  globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
1628
1628
  /** @param {string} html */
1629
1629
  createHTML: (t) => t
1630
1630
  })
1631
1631
  );
1632
- function Er(t) {
1632
+ function Hs(t) {
1633
1633
  return (
1634
1634
  /** @type {string} */
1635
- Ir?.createHTML(t) ?? t
1635
+ ks?.createHTML(t) ?? t
1636
1636
  );
1637
1637
  }
1638
- function $r(t, e = !1) {
1639
- var i = Qi("template");
1640
- return t = t.replaceAll("<!>", "<!---->"), i.innerHTML = e ? Er(t) : t, i.content;
1638
+ function Ns(t, e = !1) {
1639
+ var i = rn("template");
1640
+ return t = t.replaceAll("<!>", "<!---->"), i.innerHTML = e ? Hs(t) : t, i.content;
1641
1641
  }
1642
- function xt(t, e) {
1642
+ function Kt(t, e) {
1643
1643
  var i = (
1644
1644
  /** @type {Effect} */
1645
- S
1645
+ E
1646
1646
  );
1647
1647
  i.nodes === null && (i.nodes = { start: t, end: e, a: null, t: null });
1648
1648
  }
1649
1649
  // @__NO_SIDE_EFFECTS__
1650
- function Cr(t, e) {
1651
- var i = (e & In) !== 0, n, r = !t.startsWith("<!>");
1650
+ function Vs(t, e) {
1651
+ var i = (e & kn) !== 0, n, s = !t.startsWith("<!>");
1652
1652
  return () => {
1653
- if (Q)
1654
- return xt(M, null), M;
1655
- n === void 0 && (n = $r(r ? t : "<!>" + t, !0), n = /** @type {TemplateNode} */
1656
- /* @__PURE__ */ Ki(n));
1657
- var s = (
1653
+ if (J)
1654
+ return Kt(B, null), B;
1655
+ n === void 0 && (n = Ns(s ? t : "<!>" + t, !0), n = /** @type {TemplateNode} */
1656
+ /* @__PURE__ */ sn(n));
1657
+ var r = (
1658
1658
  /** @type {TemplateNode} */
1659
- i || Gi ? document.importNode(n, !0) : n.cloneNode(!0)
1659
+ i || Zi ? document.importNode(n, !0) : n.cloneNode(!0)
1660
1660
  );
1661
- return xt(s, s), s;
1661
+ return Kt(r, r), r;
1662
1662
  };
1663
1663
  }
1664
- function un(t, e) {
1665
- if (Q) {
1664
+ function bn(t, e) {
1665
+ if (J) {
1666
1666
  var i = (
1667
1667
  /** @type {Effect & { nodes: EffectNodes }} */
1668
- S
1668
+ E
1669
1669
  );
1670
- ((i.f & Ye) === 0 || i.nodes.end === null) && (i.nodes.end = M), Si();
1670
+ ((i.f & Qe) === 0 || i.nodes.end === null) && (i.nodes.end = B), Oi();
1671
1671
  return;
1672
1672
  }
1673
1673
  t !== null && t.before(
@@ -1675,44 +1675,44 @@ function un(t, e) {
1675
1675
  e
1676
1676
  );
1677
1677
  }
1678
- const kr = ["touchstart", "touchmove"];
1679
- function Rr(t) {
1680
- return kr.includes(t);
1678
+ const Ms = ["touchstart", "touchmove"];
1679
+ function Fs(t) {
1680
+ return Ms.includes(t);
1681
1681
  }
1682
- function fn(t, e) {
1683
- return dn(t, e);
1682
+ function _n(t, e) {
1683
+ return yn(t, e);
1684
1684
  }
1685
- function Or(t, e) {
1686
- Pt(), e.intro = e.intro ?? !1;
1687
- const i = e.target, n = Q, r = M;
1685
+ function Ds(t, e) {
1686
+ qt(), e.intro = e.intro ?? !1;
1687
+ const i = e.target, n = J, s = B;
1688
1688
  try {
1689
- for (var s = /* @__PURE__ */ Ki(i); s && (s.nodeType !== qt || /** @type {Comment} */
1690
- s.data !== gi); )
1691
- s = /* @__PURE__ */ Ke(s);
1692
- if (!s)
1693
- throw mt;
1694
- lt(!0), tt(
1689
+ for (var r = /* @__PURE__ */ sn(i); r && (r.nodeType !== Qt || /** @type {Comment} */
1690
+ r.data !== Ii); )
1691
+ r = /* @__PURE__ */ Ze(r);
1692
+ if (!r)
1693
+ throw yt;
1694
+ ft(!0), rt(
1695
1695
  /** @type {Comment} */
1696
- s
1696
+ r
1697
1697
  );
1698
- const o = dn(t, { ...e, anchor: s });
1699
- return lt(!1), /** @type {Exports} */
1698
+ const o = yn(t, { ...e, anchor: r });
1699
+ return ft(!1), /** @type {Exports} */
1700
1700
  o;
1701
1701
  } catch (o) {
1702
1702
  if (o instanceof Error && o.message.split(`
1703
1703
  `).some((l) => l.startsWith("https://svelte.dev/e/")))
1704
1704
  throw o;
1705
- return o !== mt && console.warn("Failed to hydrate: ", o), e.recover === !1 && qn(), Pt(), dr(i), lt(!1), fn(t, e);
1705
+ return o !== yt && console.warn("Failed to hydrate: ", o), e.recover === !1 && Wn(), qt(), _s(i), ft(!1), _n(t, e);
1706
1706
  } finally {
1707
- lt(n), tt(r);
1707
+ ft(n), rt(s);
1708
1708
  }
1709
1709
  }
1710
- const ut = /* @__PURE__ */ new Map();
1711
- function dn(t, { target: e, anchor: i, props: n = {}, events: r, context: s, intro: o = !0 }) {
1712
- Pt();
1713
- var l = void 0, a = mr(() => {
1714
- var u = i ?? e.appendChild(Wi());
1715
- sr(
1710
+ const pt = /* @__PURE__ */ new Map();
1711
+ function yn(t, { target: e, anchor: i, props: n = {}, events: s, context: r, intro: o = !0 }) {
1712
+ qt();
1713
+ var l = void 0, a = Is(() => {
1714
+ var u = i ?? e.appendChild(nn());
1715
+ ds(
1716
1716
  /** @type {TemplateNode} */
1717
1717
  u,
1718
1718
  {
@@ -1720,90 +1720,90 @@ function dn(t, { target: e, anchor: i, props: n = {}, events: r, context: s, int
1720
1720
  }
1721
1721
  },
1722
1722
  (p) => {
1723
- Ii({});
1724
- var y = (
1723
+ Hi({});
1724
+ var g = (
1725
1725
  /** @type {ComponentContext} */
1726
- U
1726
+ W
1727
1727
  );
1728
- if (s && (y.c = s), r && (n.$$events = r), Q && xt(
1728
+ if (r && (g.c = r), s && (n.$$events = s), J && Kt(
1729
1729
  /** @type {TemplateNode} */
1730
1730
  p,
1731
1731
  null
1732
- ), l = t(p, n) || {}, Q && (S.nodes.end = M, M === null || M.nodeType !== qt || /** @type {Comment} */
1733
- M.data !== vi))
1734
- throw Ti(), mt;
1735
- Ei();
1732
+ ), l = t(p, n) || {}, J && (E.nodes.end = B, B === null || B.nodeType !== Qt || /** @type {Comment} */
1733
+ B.data !== wi))
1734
+ throw Ri(), yt;
1735
+ Ni();
1736
1736
  }
1737
1737
  );
1738
- var d = /* @__PURE__ */ new Set(), m = (p) => {
1739
- for (var y = 0; y < p.length; y++) {
1740
- var h = p[y];
1738
+ var d = /* @__PURE__ */ new Set(), v = (p) => {
1739
+ for (var g = 0; g < p.length; g++) {
1740
+ var h = p[g];
1741
1741
  if (!d.has(h)) {
1742
1742
  d.add(h);
1743
- var E = Rr(h);
1744
- for (const W of [e, document]) {
1745
- var _ = ut.get(W);
1746
- _ === void 0 && (_ = /* @__PURE__ */ new Map(), ut.set(W, _));
1747
- var F = _.get(h);
1748
- F === void 0 ? (W.addEventListener(h, ci, { passive: E }), _.set(h, 1)) : _.set(h, F + 1);
1743
+ var T = Fs(h);
1744
+ for (const L of [e, document]) {
1745
+ var b = pt.get(L);
1746
+ b === void 0 && (b = /* @__PURE__ */ new Map(), pt.set(L, b));
1747
+ var S = b.get(h);
1748
+ S === void 0 ? (L.addEventListener(h, vi, { passive: T }), b.set(h, 1)) : b.set(h, S + 1);
1749
1749
  }
1750
1750
  }
1751
1751
  }
1752
1752
  };
1753
- return m(kn(Ar)), li.add(m), () => {
1753
+ return v(Mn(Os)), gi.add(v), () => {
1754
1754
  for (var p of d)
1755
- for (const E of [e, document]) {
1756
- var y = (
1755
+ for (const T of [e, document]) {
1756
+ var g = (
1757
1757
  /** @type {Map<string, number>} */
1758
- ut.get(E)
1758
+ pt.get(T)
1759
1759
  ), h = (
1760
1760
  /** @type {number} */
1761
- y.get(p)
1761
+ g.get(p)
1762
1762
  );
1763
- --h == 0 ? (E.removeEventListener(p, ci), y.delete(p), y.size === 0 && ut.delete(E)) : y.set(p, h);
1763
+ --h == 0 ? (T.removeEventListener(p, vi), g.delete(p), g.size === 0 && pt.delete(T)) : g.set(p, h);
1764
1764
  }
1765
- li.delete(m), u !== i && u.parentNode?.removeChild(u);
1765
+ gi.delete(v), u !== i && u.parentNode?.removeChild(u);
1766
1766
  };
1767
1767
  });
1768
- return jt.set(l, a), l;
1768
+ return zt.set(l, a), l;
1769
1769
  }
1770
- let jt = /* @__PURE__ */ new WeakMap();
1771
- function Lr(t, e) {
1772
- const i = jt.get(t);
1773
- return i ? (jt.delete(t), i(e)) : Promise.resolve();
1770
+ let zt = /* @__PURE__ */ new WeakMap();
1771
+ function Ps(t, e) {
1772
+ const i = zt.get(t);
1773
+ return i ? (zt.delete(t), i(e)) : Promise.resolve();
1774
1774
  }
1775
- function Vr(t) {
1776
- U === null && Pn(), Ie(() => {
1777
- const e = Kt(t);
1775
+ function Bs(t) {
1776
+ W === null && zn(), Le(() => {
1777
+ const e = ni(t);
1778
1778
  if (typeof e == "function") return (
1779
1779
  /** @type {() => void} */
1780
1780
  e
1781
1781
  );
1782
1782
  });
1783
1783
  }
1784
- function ui(t, e) {
1785
- return t === e || t?.[ft] === e;
1784
+ function bi(t, e) {
1785
+ return t === e || t?.[gt] === e;
1786
1786
  }
1787
- function Nr(t = {}, e, i, n) {
1788
- return vr(() => {
1789
- var r, s;
1790
- return Yt(() => {
1791
- r = s, s = [], Kt(() => {
1792
- t !== i(...s) && (e(t, ...s), r && ui(i(...r), t) && e(null, ...r));
1787
+ function Gs(t = {}, e, i, n) {
1788
+ return Es(() => {
1789
+ var s, r;
1790
+ return ti(() => {
1791
+ s = r, r = [], ni(() => {
1792
+ t !== i(...r) && (e(t, ...r), s && bi(i(...s), t) && e(null, ...s));
1793
1793
  });
1794
1794
  }), () => {
1795
- Le(() => {
1796
- s && ui(i(...s), t) && e(null, ...s);
1795
+ Me(() => {
1796
+ r && bi(i(...r), t) && e(null, ...r);
1797
1797
  });
1798
1798
  };
1799
1799
  }), t;
1800
1800
  }
1801
- function ve(t, e, i, n) {
1802
- var r = (
1801
+ function ye(t, e, i, n) {
1802
+ var s = (
1803
1803
  /** @type {V} */
1804
1804
  n
1805
- ), s = !0, o = () => (s && (s = !1, r = /** @type {V} */
1806
- n), r), l;
1805
+ ), r = !0, o = () => (r && (r = !1, s = /** @type {V} */
1806
+ n), s), l;
1807
1807
  l = /** @type {V} */
1808
1808
  t[e], l === void 0 && n !== void 0 && (l = o());
1809
1809
  var a;
@@ -1812,28 +1812,28 @@ function ve(t, e, i, n) {
1812
1812
  /** @type {V} */
1813
1813
  t[e]
1814
1814
  );
1815
- return p === void 0 ? o() : (s = !0, p);
1815
+ return p === void 0 ? o() : (r = !0, p);
1816
1816
  };
1817
- var u = !1, d = /* @__PURE__ */ xi(() => (u = !1, a())), m = (
1817
+ var u = !1, d = /* @__PURE__ */ Ui(() => (u = !1, a())), v = (
1818
1818
  /** @type {Effect} */
1819
- S
1819
+ E
1820
1820
  );
1821
1821
  return (
1822
1822
  /** @type {() => V} */
1823
- (function(p, y) {
1823
+ (function(p, g) {
1824
1824
  if (arguments.length > 0) {
1825
- const h = y ? g(d) : p;
1826
- return A(d, h), u = !0, r !== void 0 && (r = h), p;
1825
+ const h = g ? m(d) : p;
1826
+ return $(d, h), u = !0, s !== void 0 && (s = h), p;
1827
1827
  }
1828
- return Te && u || (m.f & _e) !== 0 ? d.v : g(d);
1828
+ return Se && u || (v.f & Ee) !== 0 ? d.v : m(d);
1829
1829
  })
1830
1830
  );
1831
1831
  }
1832
- function Mr(t) {
1833
- return new Fr(t);
1832
+ function js(t) {
1833
+ return new qs(t);
1834
1834
  }
1835
- var he, q;
1836
- class Fr {
1835
+ var me, U;
1836
+ class qs {
1837
1837
  /**
1838
1838
  * @param {ComponentConstructorOptions & {
1839
1839
  * component: any;
@@ -1841,56 +1841,56 @@ class Fr {
1841
1841
  */
1842
1842
  constructor(e) {
1843
1843
  /** @type {any} */
1844
- w(this, he);
1844
+ A(this, me);
1845
1845
  /** @type {Record<string, any>} */
1846
- w(this, q);
1847
- var i = /* @__PURE__ */ new Map(), n = (s, o) => {
1848
- var l = /* @__PURE__ */ ur(o, !1, !1);
1849
- return i.set(s, l), l;
1846
+ A(this, U);
1847
+ var i = /* @__PURE__ */ new Map(), n = (r, o) => {
1848
+ var l = /* @__PURE__ */ vs(o, !1, !1);
1849
+ return i.set(r, l), l;
1850
1850
  };
1851
- const r = new Proxy(
1851
+ const s = new Proxy(
1852
1852
  { ...e.props || {}, $$events: {} },
1853
1853
  {
1854
- get(s, o) {
1855
- return g(i.get(o) ?? n(o, Reflect.get(s, o)));
1854
+ get(r, o) {
1855
+ return m(i.get(o) ?? n(o, Reflect.get(r, o)));
1856
1856
  },
1857
- has(s, o) {
1858
- return o === Dn ? !0 : (g(i.get(o) ?? n(o, Reflect.get(s, o))), Reflect.has(s, o));
1857
+ has(r, o) {
1858
+ return o === Kn ? !0 : (m(i.get(o) ?? n(o, Reflect.get(r, o))), Reflect.has(r, o));
1859
1859
  },
1860
- set(s, o, l) {
1861
- return A(i.get(o) ?? n(o, l), l), Reflect.set(s, o, l);
1860
+ set(r, o, l) {
1861
+ return $(i.get(o) ?? n(o, l), l), Reflect.set(r, o, l);
1862
1862
  }
1863
1863
  }
1864
1864
  );
1865
- v(this, q, (e.hydrate ? Or : fn)(e.component, {
1865
+ _(this, U, (e.hydrate ? Ds : _n)(e.component, {
1866
1866
  target: e.target,
1867
1867
  anchor: e.anchor,
1868
- props: r,
1868
+ props: s,
1869
1869
  context: e.context,
1870
1870
  intro: e.intro ?? !1,
1871
1871
  recover: e.recover
1872
- })), (!e?.props?.$$host || e.sync === !1) && le(), v(this, he, r.$$events);
1873
- for (const s of Object.keys(c(this, q)))
1874
- s === "$set" || s === "$destroy" || s === "$on" || bt(this, s, {
1872
+ })), (!e?.props?.$$host || e.sync === !1) && ue(), _(this, me, s.$$events);
1873
+ for (const r of Object.keys(c(this, U)))
1874
+ r === "$set" || r === "$destroy" || r === "$on" || At(this, r, {
1875
1875
  get() {
1876
- return c(this, q)[s];
1876
+ return c(this, U)[r];
1877
1877
  },
1878
1878
  /** @param {any} value */
1879
1879
  set(o) {
1880
- c(this, q)[s] = o;
1880
+ c(this, U)[r] = o;
1881
1881
  },
1882
1882
  enumerable: !0
1883
1883
  });
1884
- c(this, q).$set = /** @param {Record<string, any>} next */
1885
- (s) => {
1886
- Object.assign(r, s);
1887
- }, c(this, q).$destroy = () => {
1888
- Lr(c(this, q));
1884
+ c(this, U).$set = /** @param {Record<string, any>} next */
1885
+ (r) => {
1886
+ Object.assign(s, r);
1887
+ }, c(this, U).$destroy = () => {
1888
+ Ps(c(this, U));
1889
1889
  };
1890
1890
  }
1891
1891
  /** @param {Record<string, any>} props */
1892
1892
  $set(e) {
1893
- c(this, q).$set(e);
1893
+ c(this, U).$set(e);
1894
1894
  }
1895
1895
  /**
1896
1896
  * @param {string} event
@@ -1898,22 +1898,22 @@ class Fr {
1898
1898
  * @returns {any}
1899
1899
  */
1900
1900
  $on(e, i) {
1901
- c(this, he)[e] = c(this, he)[e] || [];
1902
- const n = (...r) => i.call(this, ...r);
1903
- return c(this, he)[e].push(n), () => {
1904
- c(this, he)[e] = c(this, he)[e].filter(
1901
+ c(this, me)[e] = c(this, me)[e] || [];
1902
+ const n = (...s) => i.call(this, ...s);
1903
+ return c(this, me)[e].push(n), () => {
1904
+ c(this, me)[e] = c(this, me)[e].filter(
1905
1905
  /** @param {any} fn */
1906
- (r) => r !== n
1906
+ (s) => s !== n
1907
1907
  );
1908
1908
  };
1909
1909
  }
1910
1910
  $destroy() {
1911
- c(this, q).$destroy();
1911
+ c(this, U).$destroy();
1912
1912
  }
1913
1913
  }
1914
- he = new WeakMap(), q = new WeakMap();
1915
- let hn;
1916
- typeof HTMLElement == "function" && (hn = class extends HTMLElement {
1914
+ me = new WeakMap(), U = new WeakMap();
1915
+ let Tn;
1916
+ typeof HTMLElement == "function" && (Tn = class extends HTMLElement {
1917
1917
  /**
1918
1918
  * @param {*} $$componentCtor
1919
1919
  * @param {*} $$slots
@@ -1952,8 +1952,8 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
1952
1952
  */
1953
1953
  addEventListener(e, i, n) {
1954
1954
  if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(i), this.$$c) {
1955
- const r = this.$$c.$on(e, i);
1956
- this.$$l_u.set(i, r);
1955
+ const s = this.$$c.$on(e, i);
1956
+ this.$$l_u.set(i, s);
1957
1957
  }
1958
1958
  super.addEventListener(e, i, n);
1959
1959
  }
@@ -1964,30 +1964,30 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
1964
1964
  */
1965
1965
  removeEventListener(e, i, n) {
1966
1966
  if (super.removeEventListener(e, i, n), this.$$c) {
1967
- const r = this.$$l_u.get(i);
1968
- r && (r(), this.$$l_u.delete(i));
1967
+ const s = this.$$l_u.get(i);
1968
+ s && (s(), this.$$l_u.delete(i));
1969
1969
  }
1970
1970
  }
1971
1971
  async connectedCallback() {
1972
1972
  if (this.$$cn = !0, !this.$$c) {
1973
- let e = function(r) {
1974
- return (s) => {
1975
- const o = Qi("slot");
1976
- r !== "default" && (o.name = r), un(s, o);
1973
+ let e = function(s) {
1974
+ return (r) => {
1975
+ const o = rn("slot");
1976
+ s !== "default" && (o.name = s), bn(r, o);
1977
1977
  };
1978
1978
  };
1979
1979
  if (await Promise.resolve(), !this.$$cn || this.$$c)
1980
1980
  return;
1981
- const i = {}, n = Dr(this);
1982
- for (const r of this.$$s)
1983
- r in n && (r === "default" && !this.$$d.children ? (this.$$d.children = e(r), i.default = !0) : i[r] = e(r));
1984
- for (const r of this.attributes) {
1985
- const s = this.$$g_p(r.name);
1986
- s in this.$$d || (this.$$d[s] = gt(s, r.value, this.$$p_d, "toProp"));
1981
+ const i = {}, n = Ks(this);
1982
+ for (const s of this.$$s)
1983
+ s in n && (s === "default" && !this.$$d.children ? (this.$$d.children = e(s), i.default = !0) : i[s] = e(s));
1984
+ for (const s of this.attributes) {
1985
+ const r = this.$$g_p(s.name);
1986
+ r in this.$$d || (this.$$d[r] = _t(r, s.value, this.$$p_d, "toProp"));
1987
1987
  }
1988
- for (const r in this.$$p_d)
1989
- !(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
1990
- this.$$c = Mr({
1988
+ for (const s in this.$$p_d)
1989
+ !(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]);
1990
+ this.$$c = js({
1991
1991
  component: this.$$ctor,
1992
1992
  target: this.$$shadowRoot || this,
1993
1993
  props: {
@@ -1995,27 +1995,27 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
1995
1995
  $$slots: i,
1996
1996
  $$host: this
1997
1997
  }
1998
- }), this.$$me = gr(() => {
1999
- Yt(() => {
1998
+ }), this.$$me = As(() => {
1999
+ ti(() => {
2000
2000
  this.$$r = !0;
2001
- for (const r of vt(this.$$c)) {
2002
- if (!this.$$p_d[r]?.reflect) continue;
2003
- this.$$d[r] = this.$$c[r];
2004
- const s = gt(
2005
- r,
2006
- this.$$d[r],
2001
+ for (const s of Tt(this.$$c)) {
2002
+ if (!this.$$p_d[s]?.reflect) continue;
2003
+ this.$$d[s] = this.$$c[s];
2004
+ const r = _t(
2005
+ s,
2006
+ this.$$d[s],
2007
2007
  this.$$p_d,
2008
2008
  "toAttribute"
2009
2009
  );
2010
- s == null ? this.removeAttribute(this.$$p_d[r].attribute || r) : this.setAttribute(this.$$p_d[r].attribute || r, s);
2010
+ r == null ? this.removeAttribute(this.$$p_d[s].attribute || s) : this.setAttribute(this.$$p_d[s].attribute || s, r);
2011
2011
  }
2012
2012
  this.$$r = !1;
2013
2013
  });
2014
2014
  });
2015
- for (const r in this.$$l)
2016
- for (const s of this.$$l[r]) {
2017
- const o = this.$$c.$on(r, s);
2018
- this.$$l_u.set(s, o);
2015
+ for (const s in this.$$l)
2016
+ for (const r of this.$$l[s]) {
2017
+ const o = this.$$c.$on(s, r);
2018
+ this.$$l_u.set(r, o);
2019
2019
  }
2020
2020
  this.$$l = {};
2021
2021
  }
@@ -2028,7 +2028,7 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
2028
2028
  * @param {string} newValue
2029
2029
  */
2030
2030
  attributeChangedCallback(e, i, n) {
2031
- this.$$r || (e = this.$$g_p(e), this.$$d[e] = gt(e, n, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
2031
+ this.$$r || (e = this.$$g_p(e), this.$$d[e] = _t(e, n, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
2032
2032
  }
2033
2033
  disconnectedCallback() {
2034
2034
  this.$$cn = !1, Promise.resolve().then(() => {
@@ -2039,17 +2039,17 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
2039
2039
  * @param {string} attribute_name
2040
2040
  */
2041
2041
  $$g_p(e) {
2042
- return vt(this.$$p_d).find(
2042
+ return Tt(this.$$p_d).find(
2043
2043
  (i) => this.$$p_d[i].attribute === e || !this.$$p_d[i].attribute && i.toLowerCase() === e
2044
2044
  ) || e;
2045
2045
  }
2046
2046
  });
2047
- function gt(t, e, i, n) {
2048
- const r = i[t]?.type;
2049
- if (e = r === "Boolean" && typeof e != "boolean" ? e != null : e, !n || !i[t])
2047
+ function _t(t, e, i, n) {
2048
+ const s = i[t]?.type;
2049
+ if (e = s === "Boolean" && typeof e != "boolean" ? e != null : e, !n || !i[t])
2050
2050
  return e;
2051
2051
  if (n === "toAttribute")
2052
- switch (r) {
2052
+ switch (s) {
2053
2053
  case "Object":
2054
2054
  case "Array":
2055
2055
  return e == null ? null : JSON.stringify(e);
@@ -2061,7 +2061,7 @@ function gt(t, e, i, n) {
2061
2061
  return e;
2062
2062
  }
2063
2063
  else
2064
- switch (r) {
2064
+ switch (s) {
2065
2065
  case "Object":
2066
2066
  case "Array":
2067
2067
  return e && JSON.parse(e);
@@ -2074,7 +2074,7 @@ function gt(t, e, i, n) {
2074
2074
  return e;
2075
2075
  }
2076
2076
  }
2077
- function Dr(t) {
2077
+ function Ks(t) {
2078
2078
  const e = {};
2079
2079
  return t.childNodes.forEach((i) => {
2080
2080
  e[
@@ -2083,33 +2083,33 @@ function Dr(t) {
2083
2083
  ] = !0;
2084
2084
  }), e;
2085
2085
  }
2086
- function Pr(t, e, i, n, r, s) {
2087
- let o = class extends hn {
2086
+ function zs(t, e, i, n, s, r) {
2087
+ let o = class extends Tn {
2088
2088
  constructor() {
2089
- super(t, i, r), this.$$p_d = e;
2089
+ super(t, i, s), this.$$p_d = e;
2090
2090
  }
2091
2091
  static get observedAttributes() {
2092
- return vt(e).map(
2092
+ return Tt(e).map(
2093
2093
  (l) => (e[l].attribute || l).toLowerCase()
2094
2094
  );
2095
2095
  }
2096
2096
  };
2097
- return vt(e).forEach((l) => {
2098
- bt(o.prototype, l, {
2097
+ return Tt(e).forEach((l) => {
2098
+ At(o.prototype, l, {
2099
2099
  get() {
2100
2100
  return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l];
2101
2101
  },
2102
2102
  set(a) {
2103
- a = gt(l, a, e), this.$$d[l] = a;
2103
+ a = _t(l, a, e), this.$$d[l] = a;
2104
2104
  var u = this.$$c;
2105
2105
  if (u) {
2106
- var d = De(u, l)?.get;
2106
+ var d = Ge(u, l)?.get;
2107
2107
  d ? u[l] = a : u.$set({ [l]: a });
2108
2108
  }
2109
2109
  }
2110
2110
  });
2111
2111
  }), n.forEach((l) => {
2112
- bt(o.prototype, l, {
2112
+ At(o.prototype, l, {
2113
2113
  get() {
2114
2114
  return this.$$c?.[l];
2115
2115
  }
@@ -2117,17 +2117,17 @@ function Pr(t, e, i, n, r, s) {
2117
2117
  }), t.element = /** @type {any} */
2118
2118
  o, o;
2119
2119
  }
2120
- class xr extends Event {
2121
- constructor(i, n, r, s) {
2120
+ class Ys extends Event {
2121
+ constructor(i, n, s, r) {
2122
2122
  super("context-request", { bubbles: !0, composed: !0 });
2123
2123
  f(this, "context");
2124
2124
  f(this, "contextTarget");
2125
2125
  f(this, "callback");
2126
2126
  f(this, "subscribe");
2127
- this.context = i, this.contextTarget = n, this.callback = r, this.subscribe = s ?? !1;
2127
+ this.context = i, this.contextTarget = n, this.callback = s, this.subscribe = r ?? !1;
2128
2128
  }
2129
2129
  }
2130
- class jr {
2130
+ class Us {
2131
2131
  constructor(e, i) {
2132
2132
  f(this, "host");
2133
2133
  f(this, "context");
@@ -2151,57 +2151,65 @@ class jr {
2151
2151
  return this.currentValue;
2152
2152
  }
2153
2153
  requestValue() {
2154
- this.host.dispatchEvent(new xr(this.context, this.host, this.handleValue, this.subscribe));
2154
+ this.host.dispatchEvent(new Ys(this.context, this.host, this.handleValue, this.subscribe));
2155
2155
  }
2156
2156
  }
2157
- const pn = (t) => t, Br = pn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), Hr = pn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext"));
2158
- function gn(t, e, i) {
2157
+ const An = (t) => t, xs = An(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), Xs = An(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext"));
2158
+ function In(t, e, i) {
2159
2159
  let n = !1;
2160
- const r = new jr(t, {
2160
+ const s = new Us(t, {
2161
2161
  context: e,
2162
2162
  subscribe: !0,
2163
2163
  onValue: (u) => {
2164
2164
  n = !0, i(u);
2165
2165
  }
2166
2166
  });
2167
- r.connect();
2168
- const s = (u) => {
2169
- u.context === e && r.requestValue();
2167
+ s.connect();
2168
+ const r = (u) => {
2169
+ u.context === e && s.requestValue();
2170
2170
  };
2171
- t.addEventListener("context-provider", s);
2171
+ t.addEventListener("context-provider", r);
2172
2172
  let o = 0;
2173
2173
  const l = 200, a = globalThis.setInterval(() => {
2174
2174
  if (n || o >= l) {
2175
2175
  globalThis.clearInterval(a);
2176
2176
  return;
2177
2177
  }
2178
- o += 1, r.requestValue();
2178
+ o += 1, s.requestValue();
2179
2179
  }, 50);
2180
2180
  return () => {
2181
- globalThis.clearInterval(a), t.removeEventListener("context-provider", s), r.disconnect();
2181
+ globalThis.clearInterval(a), t.removeEventListener("context-provider", r), s.disconnect();
2182
2182
  };
2183
2183
  }
2184
- function qr(t, e) {
2185
- return gn(t, Br, e);
2184
+ function Ws(t, e) {
2185
+ return In(t, xs, e);
2186
2186
  }
2187
- function zr(t, e) {
2188
- return gn(t, Hr, e);
2187
+ function Qs(t, e) {
2188
+ return In(t, Xs, e);
2189
2189
  }
2190
- function Gr(t, e) {
2191
- return qr(t, e);
2190
+ function Js(t, e) {
2191
+ return Ws(t, e);
2192
2192
  }
2193
- function Ur(t, e) {
2194
- return zr(t, e);
2193
+ function Zs(t, e) {
2194
+ return Qs(t, e);
2195
2195
  }
2196
- var fi;
2196
+ var _i;
2197
2197
  (function(t) {
2198
2198
  t.TTS_WORD = "tts-word", t.TTS_SENTENCE = "tts-sentence", t.ANNOTATION = "annotation";
2199
- })(fi || (fi = {}));
2200
- var di;
2199
+ })(_i || (_i = {}));
2200
+ var yi;
2201
2201
  (function(t) {
2202
2202
  t.YELLOW = "yellow", t.GREEN = "green", t.BLUE = "blue", t.PINK = "pink", t.ORANGE = "orange", t.UNDERLINE = "underline";
2203
- })(di || (di = {}));
2204
- class Yr {
2203
+ })(yi || (yi = {}));
2204
+ const er = {
2205
+ tts: "textToSpeech",
2206
+ colorScheme: "theme"
2207
+ };
2208
+ function tr(t) {
2209
+ const e = t.trim();
2210
+ return e ? er[e] || e : "";
2211
+ }
2212
+ class ir {
2205
2213
  constructor() {
2206
2214
  f(this, "tools", /* @__PURE__ */ new Map());
2207
2215
  f(this, "pnpIndex", /* @__PURE__ */ new Map());
@@ -2215,7 +2223,7 @@ class Yr {
2215
2223
  * Normalize a single tool alias to canonical toolId.
2216
2224
  */
2217
2225
  normalizeToolId(e) {
2218
- return e === "tts" ? "textToSpeech" : e;
2226
+ return tr(e);
2219
2227
  }
2220
2228
  /**
2221
2229
  * Normalize a list of tool aliases to canonical toolIds.
@@ -2330,17 +2338,17 @@ class Yr {
2330
2338
  */
2331
2339
  filterVisibleInContext(e, i) {
2332
2340
  const n = [];
2333
- for (const r of e) {
2334
- const s = this.get(r);
2335
- if (!s) {
2336
- console.warn(`Tool '${r}' is allowed but not registered`);
2341
+ for (const s of e) {
2342
+ const r = this.get(s);
2343
+ if (!r) {
2344
+ console.warn(`Tool '${s}' is allowed but not registered`);
2337
2345
  continue;
2338
2346
  }
2339
- if (s.supportedLevels.includes(i.level))
2347
+ if (r.supportedLevels.includes(i.level))
2340
2348
  try {
2341
- s.isVisibleInContext(i) && n.push(s);
2349
+ r.isVisibleInContext(i) && n.push(r);
2342
2350
  } catch (o) {
2343
- console.error(`Error evaluating visibility for tool '${r}':`, o);
2351
+ console.error(`Error evaluating visibility for tool '${s}':`, o);
2344
2352
  }
2345
2353
  }
2346
2354
  return n;
@@ -2370,10 +2378,10 @@ class Yr {
2370
2378
  generatePNPSupportsFromTools(e) {
2371
2379
  const i = /* @__PURE__ */ new Set();
2372
2380
  for (const n of e) {
2373
- const r = this.get(n);
2374
- if (r?.pnpSupportIds)
2375
- for (const s of r.pnpSupportIds)
2376
- i.add(s);
2381
+ const s = this.get(n);
2382
+ if (s?.pnpSupportIds)
2383
+ for (const r of s.pnpSupportIds)
2384
+ i.add(r);
2377
2385
  }
2378
2386
  return Array.from(i);
2379
2387
  }
@@ -2412,12 +2420,12 @@ class Yr {
2412
2420
  const n = this.moduleLoaders.get(e);
2413
2421
  if (!n)
2414
2422
  return;
2415
- const r = (async () => {
2423
+ const s = (async () => {
2416
2424
  await n(), this.loadedToolModules.add(e);
2417
2425
  })();
2418
- this.moduleLoadPromises.set(e, r);
2426
+ this.moduleLoadPromises.set(e, s);
2419
2427
  try {
2420
- await r;
2428
+ await s;
2421
2429
  } finally {
2422
2430
  this.moduleLoadPromises.delete(e);
2423
2431
  }
@@ -2438,39 +2446,39 @@ class Yr {
2438
2446
  * Render a tool for toolbar use with component overrides attached.
2439
2447
  */
2440
2448
  renderForToolbar(e, i, n) {
2441
- const r = this.get(e);
2442
- if (!r)
2449
+ const s = this.get(e);
2450
+ if (!s)
2443
2451
  throw new Error(`Tool '${e}' is not registered`);
2444
- const s = {
2452
+ const r = {
2445
2453
  ...n,
2446
2454
  componentOverrides: {
2447
2455
  ...this.componentOverrides || {},
2448
2456
  ...n.componentOverrides || {}
2449
2457
  }
2450
2458
  };
2451
- return r.renderToolbar(i, s);
2459
+ return s.renderToolbar(i, r);
2452
2460
  }
2453
2461
  }
2454
- function mn(t) {
2462
+ function En(t) {
2455
2463
  return t.level === "item";
2456
2464
  }
2457
- function Wr(t) {
2465
+ function nr(t) {
2458
2466
  return t.level === "passage";
2459
2467
  }
2460
- function Kr(t) {
2468
+ function sr(t) {
2461
2469
  return t.level === "rubric";
2462
2470
  }
2463
- function vn(t) {
2471
+ function wn(t) {
2464
2472
  return t.level === "element";
2465
2473
  }
2466
- function Qt(t) {
2467
- if (vn(t)) {
2474
+ function si(t) {
2475
+ if (wn(t)) {
2468
2476
  const e = t.item.config;
2469
2477
  if (!e)
2470
2478
  return "";
2471
- const i = [], n = (a) => a.replace(/<[^>]*>/g, " ").trim(), r = e.elements?.[t.elementId];
2472
- r && typeof r == "string" && i.push(n(r));
2473
- const s = e.models, l = (Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : []).find((a) => a && typeof a == "object" && a.id === t.elementId);
2479
+ const i = [], n = (a) => a.replace(/<[^>]*>/g, " ").trim(), s = e.elements?.[t.elementId];
2480
+ s && typeof s == "string" && i.push(n(s));
2481
+ const r = e.models, l = (Array.isArray(r) ? r : r && typeof r == "object" ? Object.values(r) : []).find((a) => a && typeof a == "object" && a.id === t.elementId);
2474
2482
  if (l) {
2475
2483
  for (const a of Object.values(l))
2476
2484
  if (typeof a == "string" && i.push(n(a)), Array.isArray(a)) {
@@ -2482,41 +2490,60 @@ function Qt(t) {
2482
2490
  }
2483
2491
  return i.filter(Boolean).join(" ").trim();
2484
2492
  }
2485
- if (mn(t)) {
2493
+ if (En(t)) {
2486
2494
  const e = t.item;
2487
2495
  if (!e?.config)
2488
2496
  return "";
2489
- const i = e.config, n = [], r = (a) => a.replace(/<[^>]*>/g, " ").trim();
2490
- typeof i.markup == "string" && n.push(r(i.markup));
2491
- const s = i.elements;
2492
- if (s && typeof s == "object")
2493
- for (const a of Object.values(s))
2494
- typeof a == "string" && n.push(r(a));
2497
+ const i = e.config, n = [], s = (a) => a.replace(/<[^>]*>/g, " ").trim();
2498
+ typeof i.markup == "string" && n.push(s(i.markup));
2499
+ const r = i.elements;
2500
+ if (r && typeof r == "object")
2501
+ for (const a of Object.values(r))
2502
+ typeof a == "string" && n.push(s(a));
2495
2503
  const o = i.models, l = Array.isArray(o) ? o : o && typeof o == "object" ? Object.values(o) : [];
2496
2504
  for (const a of l)
2497
2505
  if (!(!a || typeof a != "object")) {
2498
2506
  for (const u of Object.values(a))
2499
- if (typeof u == "string" && n.push(r(u)), Array.isArray(u)) {
2507
+ if (typeof u == "string" && n.push(s(u)), Array.isArray(u)) {
2500
2508
  for (const d of u)
2501
2509
  if (d && typeof d == "object")
2502
- for (const m of Object.values(d))
2503
- typeof m == "string" && n.push(r(m));
2510
+ for (const v of Object.values(d))
2511
+ typeof v == "string" && n.push(s(v));
2504
2512
  }
2505
2513
  }
2506
2514
  return n.filter(Boolean).join(" ").trim();
2507
2515
  }
2508
- if (Wr(t)) {
2516
+ if (nr(t)) {
2509
2517
  const e = t.passage;
2510
- return e?.config ? (e.config.markup || "").replace(/<[^>]*>/g, " ").trim() : "";
2518
+ if (!e?.config)
2519
+ return "";
2520
+ const i = e.config, n = [], s = (a) => a.replace(/<[^>]*>/g, " ").trim();
2521
+ typeof i.markup == "string" && n.push(s(i.markup)), typeof i.content == "string" && n.push(s(i.content)), typeof i.prompt == "string" && n.push(s(i.prompt));
2522
+ const r = i.elements;
2523
+ if (r && typeof r == "object")
2524
+ for (const a of Object.values(r))
2525
+ typeof a == "string" && n.push(s(a));
2526
+ const o = i.models, l = Array.isArray(o) ? o : o && typeof o == "object" ? Object.values(o) : [];
2527
+ for (const a of l)
2528
+ if (!(!a || typeof a != "object")) {
2529
+ for (const u of Object.values(a))
2530
+ if (typeof u == "string" && n.push(s(u)), Array.isArray(u)) {
2531
+ for (const d of u)
2532
+ if (d && typeof d == "object")
2533
+ for (const v of Object.values(d))
2534
+ typeof v == "string" && n.push(s(v));
2535
+ }
2536
+ }
2537
+ return n.filter(Boolean).join(" ").trim();
2511
2538
  }
2512
- if (Kr(t)) {
2539
+ if (sr(t)) {
2513
2540
  const e = t.rubricBlock;
2514
2541
  return e.passage?.config ? (e.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (e.content || "").replace(/<[^>]*>/g, " ").trim();
2515
2542
  }
2516
2543
  return "";
2517
2544
  }
2518
- function It(t) {
2519
- const e = Qt(t);
2545
+ function Rt(t) {
2546
+ const e = si(t);
2520
2547
  return [
2521
2548
  /<math[>\s]/i,
2522
2549
  // MathML
@@ -2532,7 +2559,7 @@ function It(t) {
2532
2559
  // Simple arithmetic
2533
2560
  ].some((n) => n.test(e));
2534
2561
  }
2535
- function Qr(t) {
2562
+ function rr(t) {
2536
2563
  const e = [
2537
2564
  "pie-multiple-choice",
2538
2565
  "pie-inline-choice",
@@ -2541,32 +2568,32 @@ function Qr(t) {
2541
2568
  "inline-choice",
2542
2569
  "select-text"
2543
2570
  ];
2544
- if (vn(t)) {
2571
+ if (wn(t)) {
2545
2572
  const i = t.item.config;
2546
2573
  if (!i?.models)
2547
2574
  return !1;
2548
- const r = (Array.isArray(i.models) ? i.models : Object.values(i.models)).find((o) => o && typeof o == "object" && o.id === t.elementId);
2549
- if (!r)
2575
+ const s = (Array.isArray(i.models) ? i.models : Object.values(i.models)).find((o) => o && typeof o == "object" && o.id === t.elementId);
2576
+ if (!s)
2550
2577
  return !1;
2551
- const s = r.element || "";
2552
- return e.includes(s);
2578
+ const r = s.element || "";
2579
+ return e.includes(r);
2553
2580
  }
2554
- if (mn(t)) {
2581
+ if (En(t)) {
2555
2582
  const i = t.item.config?.models;
2556
- return (Array.isArray(i) ? i : i && typeof i == "object" ? Object.values(i) : []).some((r) => {
2557
- if (!r || typeof r != "object")
2583
+ return (Array.isArray(i) ? i : i && typeof i == "object" ? Object.values(i) : []).some((s) => {
2584
+ if (!s || typeof s != "object")
2558
2585
  return !1;
2559
- const s = r.element || "";
2560
- return e.includes(s) ? !0 : Array.isArray(r.choices) && r.choices.length > 0;
2586
+ const r = s.element || "";
2587
+ return e.includes(r) ? !0 : Array.isArray(s.choices) && s.choices.length > 0;
2561
2588
  });
2562
2589
  }
2563
2590
  return !1;
2564
2591
  }
2565
- function Et(t) {
2566
- return Qt(t).trim().length >= 10;
2592
+ function Ot(t) {
2593
+ return si(t).trim().length >= 10;
2567
2594
  }
2568
- function Jr(t) {
2569
- const e = Qt(t);
2595
+ function or(t) {
2596
+ const e = si(t);
2570
2597
  return [
2571
2598
  /chemistry|chemical|element|atom|molecule|compound/i,
2572
2599
  /periodic\s+table/i,
@@ -2578,25 +2605,25 @@ function Jr(t) {
2578
2605
  /physics|force|energy|velocity|acceleration/i
2579
2606
  ].some((n) => n.test(e));
2580
2607
  }
2581
- const Xr = [
2608
+ const lr = [
2582
2609
  "assessment",
2583
2610
  "section",
2584
2611
  "item",
2585
2612
  "passage",
2586
2613
  "rubric"
2587
- ], Zr = new Set(Xr);
2588
- function es(t) {
2589
- return Zr.has(t);
2614
+ ], ar = new Set(lr);
2615
+ function cr(t) {
2616
+ return ar.has(t);
2590
2617
  }
2591
- function Y(t, e, i, n = "overlay") {
2592
- const r = t.trim(), s = i.trim();
2593
- if (!r || !s)
2618
+ function ie(t, e, i) {
2619
+ const n = t.trim(), s = i.trim();
2620
+ if (!n || !s)
2594
2621
  throw new Error("Tool instance ids require non-empty tool and scope ids");
2595
- if (!es(e))
2622
+ if (!cr(e))
2596
2623
  throw new Error(`Unknown tool scope level '${e}'. Register custom levels with registerToolScopeLevel().`);
2597
- return n === "inline" ? `${r}:${e}:${s}:inline` : `${r}:${e}:${s}`;
2624
+ return `${n}:${e}:${s}`;
2598
2625
  }
2599
- const ts = /* @__PURE__ */ new Set([
2626
+ const ur = /* @__PURE__ */ new Set([
2600
2627
  "annotation-xml",
2601
2628
  "color-profile",
2602
2629
  "font-face",
@@ -2605,7 +2632,7 @@ const ts = /* @__PURE__ */ new Set([
2605
2632
  "font-face-format",
2606
2633
  "font-face-name",
2607
2634
  "missing-glyph"
2608
- ]), is = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, ns = (t, e = "custom element tag") => {
2635
+ ]), fr = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, dr = (t, e = "custom element tag") => {
2609
2636
  if (!t || typeof t != "string")
2610
2637
  throw new Error(`Invalid ${e}: expected a non-empty string`);
2611
2638
  const i = t.trim();
@@ -2615,12 +2642,12 @@ const ts = /* @__PURE__ */ new Set([
2615
2642
  throw new Error(`Invalid ${e} "${i}": custom element names must be lowercase`);
2616
2643
  if (!i.includes("-"))
2617
2644
  throw new Error(`Invalid ${e} "${i}": custom element names must include a hyphen`);
2618
- if (ts.has(i))
2645
+ if (ur.has(i))
2619
2646
  throw new Error(`Invalid ${e} "${i}": this name is reserved by the HTML spec`);
2620
- if (!is.test(i))
2647
+ if (!fr.test(i))
2621
2648
  throw new Error(`Invalid ${e} "${i}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
2622
2649
  return i;
2623
- }, bn = {
2650
+ }, Sn = {
2624
2651
  calculator: "pie-tool-calculator",
2625
2652
  textToSpeech: "pie-tool-text-to-speech",
2626
2653
  ruler: "pie-tool-ruler",
@@ -2628,17 +2655,18 @@ const ts = /* @__PURE__ */ new Set([
2628
2655
  answerEliminator: "pie-tool-answer-eliminator",
2629
2656
  highlighter: "pie-tool-annotation-toolbar",
2630
2657
  lineReader: "pie-tool-line-reader",
2631
- colorScheme: "pie-tool-color-scheme",
2658
+ theme: "pie-tool-theme",
2659
+ colorScheme: "pie-tool-theme",
2632
2660
  annotationToolbar: "pie-tool-annotation-toolbar",
2633
2661
  graph: "pie-tool-graph",
2634
2662
  periodicTable: "pie-tool-periodic-table"
2635
- }, rs = (t, e) => {
2636
- const i = e?.toolTagMap?.[t] ?? bn[t] ?? t;
2637
- return ns(i, `tool component tag for "${t}"`);
2638
- }, ss = (t) => document.createElement(t), oe = (t, e, i, n) => {
2639
- const r = rs(t, n), o = n?.toolComponentFactories?.[t] ?? n?.toolComponentFactory;
2640
- return o ? o({ toolId: t, tagName: r, context: e, toolbarContext: i }) : ss(r);
2641
- }, os = {
2663
+ }, hr = (t, e) => {
2664
+ const i = e?.toolTagMap?.[t] ?? Sn[t] ?? t;
2665
+ return dr(i, `tool component tag for "${t}"`);
2666
+ }, pr = (t) => document.createElement(t), ce = (t, e, i, n) => {
2667
+ const s = hr(t, n), o = n?.toolComponentFactories?.[t] ?? n?.toolComponentFactory;
2668
+ return o ? o({ toolId: t, tagName: s, context: e, toolbarContext: i }) : pr(s);
2669
+ }, gr = {
2642
2670
  toolId: "calculator",
2643
2671
  name: "Calculator",
2644
2672
  description: "Multi-type calculator (basic, scientific, graphing)",
@@ -2664,20 +2692,28 @@ const ts = /* @__PURE__ */ new Set([
2664
2692
  * (MathML, LaTeX, arithmetic markers).
2665
2693
  */
2666
2694
  isVisibleInContext(t) {
2667
- return It(t);
2695
+ return Rt(t);
2668
2696
  },
2669
2697
  renderToolbar(t, e) {
2670
- const i = Y(this.toolId, "item", e.itemId), n = e.componentOverrides, r = oe(this.toolId, t, e, n);
2671
- r.setAttribute("tool-id", i);
2672
- const s = document.createElement("pie-tool-calculator-inline");
2673
- return s.setAttribute("tool-id", Y(this.toolId, "item", e.itemId, "inline")), s.setAttribute("target-tool-id", i), s.setAttribute("calculator-type", "scientific"), s.setAttribute("available-types", "basic,scientific,graphing"), s.setAttribute("size", e.ui?.size || "md"), {
2698
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = e.componentOverrides, s = ce(this.toolId, t, e, n);
2699
+ s.setAttribute("tool-id", i);
2700
+ const r = {
2701
+ toolId: this.toolId,
2702
+ label: this.name,
2703
+ icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
2704
+ disabled: !1,
2705
+ ariaLabel: "Open scientific calculator",
2706
+ tooltip: "Calculator",
2707
+ onClick: () => e.toggleTool(this.toolId),
2708
+ active: e.isToolVisible(i)
2709
+ };
2710
+ return {
2674
2711
  toolId: this.toolId,
2675
- inlineElement: s,
2676
- overlayElement: r,
2677
- button: null,
2712
+ elements: [{ element: s, mount: "after-buttons" }],
2713
+ button: r,
2678
2714
  sync: () => {
2679
2715
  const o = e.isToolVisible(i);
2680
- r.visible = o;
2716
+ r.active = o, r.ariaLabel = o ? "Close scientific calculator" : "Open scientific calculator", r.tooltip = o ? "Close calculator" : "Calculator", s.visible = o;
2681
2717
  },
2682
2718
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
2683
2719
  o(e.isToolVisible(i));
@@ -2685,7 +2721,7 @@ const ts = /* @__PURE__ */ new Set([
2685
2721
  }
2686
2722
  };
2687
2723
  }
2688
- }, ls = {
2724
+ }, mr = {
2689
2725
  toolId: "textToSpeech",
2690
2726
  name: "Text to Speech",
2691
2727
  description: "Read content aloud",
@@ -2711,23 +2747,115 @@ const ts = /* @__PURE__ */ new Set([
2711
2747
  * - Context contains readable text (at least 10 characters)
2712
2748
  */
2713
2749
  isVisibleInContext(t) {
2714
- return Et(t);
2750
+ return Ot(t);
2715
2751
  },
2716
2752
  renderToolbar(t, e) {
2717
- const i = Y(this.toolId, "item", e.itemId, "inline"), n = document.createElement("pie-tool-tts-inline");
2718
- n.setAttribute("tool-id", i), n.setAttribute("catalog-id", e.catalogId || e.itemId), n.setAttribute("language", e.language), n.setAttribute("size", e.ui?.size || "md");
2719
- let r = !1;
2753
+ let i = null;
2754
+ const n = e.ttsService, s = ie(this.toolId, e.scope.level, e.scope.scopeId), r = () => e.isToolVisible(s), o = {
2755
+ toolId: this.toolId,
2756
+ label: "Read aloud",
2757
+ icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
2758
+ ariaLabel: "Read aloud",
2759
+ tooltip: "Read aloud",
2760
+ onClick: () => {
2761
+ p();
2762
+ },
2763
+ disabled: !1,
2764
+ active: !1
2765
+ }, l = () => {
2766
+ const g = r() ? "Stop reading" : "Read aloud";
2767
+ o.label = g, o.ariaLabel = g, o.tooltip = g, o.active = r(), o.disabled = !e.ttsService;
2768
+ }, a = (g) => {
2769
+ (g === "idle" || g === "error") && r() && (e.toggleTool(this.toolId), l());
2770
+ }, u = async () => {
2771
+ e.ensureTTSReady && (i || (i = (async () => {
2772
+ await e.ensureTTSReady?.(), e.toolkitCoordinator?.highlightCoordinator && n?.setHighlightCoordinator?.(e.toolkitCoordinator.highlightCoordinator);
2773
+ })()), await i);
2774
+ }, d = () => {
2775
+ n?.stop?.(), r() && e.toggleTool(this.toolId), l();
2776
+ }, v = () => {
2777
+ const g = e.getScopeElement?.();
2778
+ if (g)
2779
+ return g;
2780
+ const h = (S) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(S) : S.replace(/"/g, '\\"'), T = [
2781
+ e.catalogId,
2782
+ e.scope.itemId,
2783
+ e.scope.canonicalItemId
2784
+ ].filter((S) => typeof S == "string" && S.length > 0), b = [];
2785
+ for (const S of T) {
2786
+ const L = h(S);
2787
+ e.scope.level === "passage" && b.push(`pie-passage-shell[item-id="${L}"] [data-region="content"]`), b.push(`pie-item-shell[item-id="${L}"] [data-region="content"]`);
2788
+ }
2789
+ b.push("[data-region='content']");
2790
+ for (const S of b) {
2791
+ const L = document.querySelector(S);
2792
+ if (L instanceof HTMLElement)
2793
+ return L;
2794
+ }
2795
+ return null;
2796
+ }, p = async () => {
2797
+ if (!n?.speak || !e.ttsService)
2798
+ return;
2799
+ if (r()) {
2800
+ d();
2801
+ return;
2802
+ }
2803
+ const g = v();
2804
+ if (!g)
2805
+ return;
2806
+ const h = g.textContent || "";
2807
+ if (h.trim())
2808
+ try {
2809
+ r() || e.toggleTool(this.toolId), l(), await u(), n.setRootElement?.(g), n.speak(h, {
2810
+ // For passage-level TTS, use rendered DOM text as the source of truth.
2811
+ // Catalog/SSML content can diverge from rendered text and break
2812
+ // word-boundary-to-DOM mapping for progressive yellow highlighting.
2813
+ catalogId: e.scope.level === "passage" ? void 0 : e.catalogId || e.itemId,
2814
+ language: e.language,
2815
+ contentElement: g
2816
+ }).catch((T) => {
2817
+ console.error("[ttsToolRegistration] Failed to start reading:", T), l();
2818
+ }), l();
2819
+ } catch (T) {
2820
+ l(), console.error("[ttsToolRegistration] Failed to start reading:", T);
2821
+ }
2822
+ };
2720
2823
  return {
2721
2824
  toolId: this.toolId,
2722
- inlineElement: n,
2825
+ button: o,
2723
2826
  sync: () => {
2724
- n.setAttribute("catalog-id", e.catalogId || e.itemId), n.setAttribute("language", e.language), n.setAttribute("size", e.ui?.size || "md"), e.ttsService && (n.ttsService = e.ttsService), !r && e.ensureTTSReady && (r = !0, e.ensureTTSReady().catch((s) => {
2725
- console.error("[ttsToolRegistration] Failed to initialize TTS service:", s);
2726
- }));
2827
+ l(), e.ensureTTSReady && u().catch((g) => {
2828
+ console.error("[ttsToolRegistration] Failed to initialize TTS service:", g);
2829
+ });
2830
+ },
2831
+ subscribeActive: (g) => {
2832
+ const h = [];
2833
+ if (e.subscribeVisibility) {
2834
+ const T = e.subscribeVisibility(() => {
2835
+ const b = r();
2836
+ l(), g(b);
2837
+ });
2838
+ h.push(T);
2839
+ }
2840
+ if (e.ttsService) {
2841
+ const T = `tts-toolbar:${s}`, b = (S) => {
2842
+ a(String(S || ""));
2843
+ const L = r();
2844
+ l(), g(L);
2845
+ };
2846
+ e.ttsService.onStateChange(T, b), h.push(() => {
2847
+ e.ttsService?.offStateChange(T, b);
2848
+ });
2849
+ }
2850
+ return h.length === 0 ? () => {
2851
+ } : () => {
2852
+ for (const T of h)
2853
+ T();
2854
+ };
2727
2855
  }
2728
2856
  };
2729
2857
  }
2730
- }, as = {
2858
+ }, vr = {
2731
2859
  toolId: "ruler",
2732
2860
  name: "Ruler",
2733
2861
  description: "On-screen ruler for measurements",
@@ -2746,10 +2874,10 @@ const ts = /* @__PURE__ */ new Set([
2746
2874
  * Pass 2: Ruler is relevant when math content is present
2747
2875
  */
2748
2876
  isVisibleInContext(t) {
2749
- return It(t);
2877
+ return Rt(t);
2750
2878
  },
2751
2879
  renderToolbar(t, e) {
2752
- const i = Y(this.toolId, "item", e.itemId), n = {
2880
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
2753
2881
  toolId: this.toolId,
2754
2882
  label: this.name,
2755
2883
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -2758,14 +2886,14 @@ const ts = /* @__PURE__ */ new Set([
2758
2886
  tooltip: "Ruler",
2759
2887
  onClick: () => e.toggleTool(this.toolId),
2760
2888
  active: e.isToolVisible(i)
2761
- }, r = e.componentOverrides ?? {}, s = oe(this.toolId, t, e, r);
2762
- return s.setAttribute("tool-id", i), {
2889
+ }, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
2890
+ return r.setAttribute("tool-id", i), {
2763
2891
  toolId: this.toolId,
2764
2892
  button: n,
2765
- overlayElement: s,
2893
+ elements: [{ element: r, mount: "after-buttons" }],
2766
2894
  sync: () => {
2767
2895
  const o = e.isToolVisible(i);
2768
- n.active = o, s.visible = o, e.toolkitCoordinator && (s.toolkitCoordinator = e.toolkitCoordinator);
2896
+ n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
2769
2897
  },
2770
2898
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
2771
2899
  o(e.isToolVisible(i));
@@ -2773,7 +2901,7 @@ const ts = /* @__PURE__ */ new Set([
2773
2901
  }
2774
2902
  };
2775
2903
  }
2776
- }, cs = {
2904
+ }, br = {
2777
2905
  toolId: "protractor",
2778
2906
  name: "Protractor",
2779
2907
  description: "On-screen protractor for angle measurements",
@@ -2792,10 +2920,10 @@ const ts = /* @__PURE__ */ new Set([
2792
2920
  * Pass 2: Protractor is relevant when math content is present
2793
2921
  */
2794
2922
  isVisibleInContext(t) {
2795
- return It(t);
2923
+ return Rt(t);
2796
2924
  },
2797
2925
  renderToolbar(t, e) {
2798
- const i = Y(this.toolId, "item", e.itemId), n = {
2926
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
2799
2927
  toolId: this.toolId,
2800
2928
  label: this.name,
2801
2929
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -2804,14 +2932,14 @@ const ts = /* @__PURE__ */ new Set([
2804
2932
  tooltip: "Protractor",
2805
2933
  onClick: () => e.toggleTool(this.toolId),
2806
2934
  active: e.isToolVisible(i)
2807
- }, r = e.componentOverrides ?? {}, s = oe(this.toolId, t, e, r);
2808
- return s.setAttribute("tool-id", i), {
2935
+ }, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
2936
+ return r.setAttribute("tool-id", i), {
2809
2937
  toolId: this.toolId,
2810
2938
  button: n,
2811
- overlayElement: s,
2939
+ elements: [{ element: r, mount: "after-buttons" }],
2812
2940
  sync: () => {
2813
2941
  const o = e.isToolVisible(i);
2814
- n.active = o, s.visible = o, e.toolkitCoordinator && (s.toolkitCoordinator = e.toolkitCoordinator);
2942
+ n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
2815
2943
  },
2816
2944
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
2817
2945
  o(e.isToolVisible(i));
@@ -2819,7 +2947,7 @@ const ts = /* @__PURE__ */ new Set([
2819
2947
  }
2820
2948
  };
2821
2949
  }
2822
- }, us = {
2950
+ }, _r = {
2823
2951
  toolId: "answerEliminator",
2824
2952
  name: "Answer Eliminator",
2825
2953
  description: "Strike through answer choices",
@@ -2842,12 +2970,12 @@ const ts = /* @__PURE__ */ new Set([
2842
2970
  * Pass 2: Answer eliminator is relevant only for choice-based questions
2843
2971
  */
2844
2972
  isVisibleInContext(t) {
2845
- return Qr(t);
2973
+ return rr(t);
2846
2974
  },
2847
2975
  renderToolbar(t, e) {
2848
- const i = Y(this.toolId, "item", e.itemId), n = e.componentOverrides ?? {}, r = oe(this.toolId, t, e, n);
2849
- r.setAttribute("tool-id", i), r.setAttribute("strategy", "strikethrough"), r.setAttribute("button-alignment", "inline");
2850
- const s = {
2976
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = e.componentOverrides ?? {}, s = ce(this.toolId, t, e, n);
2977
+ s.setAttribute("tool-id", i), s.setAttribute("strategy", "strikethrough"), s.setAttribute("button-alignment", "inline");
2978
+ const r = {
2851
2979
  toolId: this.toolId,
2852
2980
  label: this.name,
2853
2981
  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>',
@@ -2859,13 +2987,13 @@ const ts = /* @__PURE__ */ new Set([
2859
2987
  };
2860
2988
  return {
2861
2989
  toolId: this.toolId,
2862
- button: s,
2863
- overlayElement: r,
2990
+ button: r,
2991
+ elements: [{ element: s, mount: "after-buttons" }],
2864
2992
  sync: () => {
2865
2993
  const o = e.isToolVisible(i);
2866
- s.active = o, r.visible = o, e.toolCoordinator && (r.coordinator = e.toolCoordinator), r.scopeElement = e.getScopeElement?.() || null, e.elementToolStateStore && (r.elementToolStateStore = e.elementToolStateStore);
2994
+ r.active = o, s.visible = o, e.toolCoordinator && (s.coordinator = e.toolCoordinator), s.scopeElement = e.getScopeElement?.() || null, e.elementToolStateStore && (s.elementToolStateStore = e.elementToolStateStore);
2867
2995
  const l = e.getGlobalElementId?.();
2868
- l && (r.globalElementId = l);
2996
+ l && (s.globalElementId = l);
2869
2997
  },
2870
2998
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
2871
2999
  o(e.isToolVisible(i));
@@ -2873,7 +3001,7 @@ const ts = /* @__PURE__ */ new Set([
2873
3001
  }
2874
3002
  };
2875
3003
  }
2876
- }, fs = {
3004
+ }, yr = {
2877
3005
  toolId: "highlighter",
2878
3006
  name: "Highlighter",
2879
3007
  description: "Highlight text",
@@ -2886,10 +3014,10 @@ const ts = /* @__PURE__ */ new Set([
2886
3014
  * Pass 2: Highlighter is relevant when readable text is available
2887
3015
  */
2888
3016
  isVisibleInContext(t) {
2889
- return Et(t);
3017
+ return Ot(t);
2890
3018
  },
2891
3019
  renderToolbar(t, e) {
2892
- const i = Y(this.toolId, "item", e.itemId), n = {
3020
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
2893
3021
  toolId: this.toolId,
2894
3022
  label: this.name,
2895
3023
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -2898,14 +3026,14 @@ const ts = /* @__PURE__ */ new Set([
2898
3026
  tooltip: "Highlight",
2899
3027
  onClick: () => e.toggleTool(this.toolId),
2900
3028
  active: e.isToolVisible(i)
2901
- }, r = e.componentOverrides ?? {}, s = oe(this.toolId, t, e, r);
2902
- return s.setAttribute("tool-id", i), {
3029
+ }, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
3030
+ return r.setAttribute("tool-id", i), {
2903
3031
  toolId: this.toolId,
2904
3032
  button: n,
2905
- overlayElement: s,
3033
+ elements: [{ element: r, mount: "after-buttons" }],
2906
3034
  sync: () => {
2907
3035
  const o = e.isToolVisible(i);
2908
- n.active = o, s.enabled = o, s.visible = o, e.ttsService && (s.ttsService = e.ttsService);
3036
+ n.active = o, r.enabled = o, r.visible = o, e.ttsService && (r.ttsService = e.ttsService);
2909
3037
  },
2910
3038
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
2911
3039
  o(e.isToolVisible(i));
@@ -2913,7 +3041,7 @@ const ts = /* @__PURE__ */ new Set([
2913
3041
  }
2914
3042
  };
2915
3043
  }
2916
- }, ds = {
3044
+ }, Tr = {
2917
3045
  toolId: "lineReader",
2918
3046
  name: "Line Reader",
2919
3047
  description: "Reading guide overlay",
@@ -2938,10 +3066,10 @@ const ts = /* @__PURE__ */ new Set([
2938
3066
  * Pass 2: Line reader is relevant when readable text is present
2939
3067
  */
2940
3068
  isVisibleInContext(t) {
2941
- return Et(t);
3069
+ return Ot(t);
2942
3070
  },
2943
3071
  renderToolbar(t, e) {
2944
- const i = Y(this.toolId, "item", e.itemId), n = {
3072
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
2945
3073
  toolId: this.toolId,
2946
3074
  label: this.name,
2947
3075
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -2950,14 +3078,14 @@ const ts = /* @__PURE__ */ new Set([
2950
3078
  tooltip: "Line Reader",
2951
3079
  onClick: () => e.toggleTool(this.toolId),
2952
3080
  active: e.isToolVisible(i)
2953
- }, r = e.componentOverrides ?? {}, s = oe(this.toolId, t, e, r);
2954
- return s.setAttribute("tool-id", i), {
3081
+ }, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
3082
+ return r.setAttribute("tool-id", i), {
2955
3083
  toolId: this.toolId,
2956
3084
  button: n,
2957
- overlayElement: s,
3085
+ elements: [{ element: r, mount: "after-buttons" }],
2958
3086
  sync: () => {
2959
3087
  const o = e.isToolVisible(i);
2960
- n.active = o, s.visible = o, e.toolkitCoordinator && (s.toolkitCoordinator = e.toolkitCoordinator);
3088
+ n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
2961
3089
  },
2962
3090
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
2963
3091
  o(e.isToolVisible(i));
@@ -2965,10 +3093,10 @@ const ts = /* @__PURE__ */ new Set([
2965
3093
  }
2966
3094
  };
2967
3095
  }
2968
- }, hs = {
2969
- toolId: "colorScheme",
2970
- name: "Color Scheme",
2971
- description: "Accessible color themes and contrast",
3096
+ }, Ar = {
3097
+ toolId: "theme",
3098
+ name: "Theme",
3099
+ description: "Accessible themes and contrast",
2972
3100
  icon: "swatch",
2973
3101
  // Color scheme is assessment-wide
2974
3102
  supportedLevels: ["assessment", "section"],
@@ -2982,7 +3110,9 @@ const ts = /* @__PURE__ */ new Set([
2982
3110
  "invertColors",
2983
3111
  // QTI 3.0 standard (visual.invertColors)
2984
3112
  "colorScheme",
2985
- // Common variant
3113
+ // Legacy alias
3114
+ "theme",
3115
+ // Canonical id
2986
3116
  "highContrast",
2987
3117
  // Common variant
2988
3118
  "customColors"
@@ -2995,23 +3125,23 @@ const ts = /* @__PURE__ */ new Set([
2995
3125
  return !0;
2996
3126
  },
2997
3127
  renderToolbar(t, e) {
2998
- const i = Y(this.toolId, "item", e.itemId), n = {
3128
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
2999
3129
  toolId: this.toolId,
3000
3130
  label: this.name,
3001
3131
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
3002
3132
  disabled: !1,
3003
- ariaLabel: "Color scheme - Change colors and contrast",
3004
- tooltip: "Color Scheme",
3133
+ ariaLabel: "Theme - Change colors and contrast",
3134
+ tooltip: "Theme",
3005
3135
  onClick: () => e.toggleTool(this.toolId),
3006
3136
  active: e.isToolVisible(i)
3007
- }, r = e.componentOverrides ?? {}, s = oe(this.toolId, t, e, r);
3008
- return s.setAttribute("tool-id", i), {
3137
+ }, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
3138
+ return r.setAttribute("tool-id", i), {
3009
3139
  toolId: this.toolId,
3010
3140
  button: n,
3011
- overlayElement: s,
3141
+ elements: [{ element: r, mount: "after-buttons" }],
3012
3142
  sync: () => {
3013
3143
  const o = e.isToolVisible(i);
3014
- n.active = o, s.visible = o, e.toolkitCoordinator && (s.toolkitCoordinator = e.toolkitCoordinator);
3144
+ n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
3015
3145
  },
3016
3146
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3017
3147
  o(e.isToolVisible(i));
@@ -3019,7 +3149,7 @@ const ts = /* @__PURE__ */ new Set([
3019
3149
  }
3020
3150
  };
3021
3151
  }
3022
- }, ps = {
3152
+ }, Ir = Ar, Er = {
3023
3153
  toolId: "annotationToolbar",
3024
3154
  name: "Highlighter",
3025
3155
  description: "Highlight and annotate text",
@@ -3044,10 +3174,10 @@ const ts = /* @__PURE__ */ new Set([
3044
3174
  * Pass 2: Annotation is relevant when readable text is present
3045
3175
  */
3046
3176
  isVisibleInContext(t) {
3047
- return Et(t);
3177
+ return Ot(t);
3048
3178
  },
3049
3179
  renderToolbar(t, e) {
3050
- const i = Y(this.toolId, "item", e.itemId), n = {
3180
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
3051
3181
  toolId: this.toolId,
3052
3182
  label: this.name,
3053
3183
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3056,14 +3186,14 @@ const ts = /* @__PURE__ */ new Set([
3056
3186
  tooltip: "Highlight",
3057
3187
  onClick: () => e.toggleTool(this.toolId),
3058
3188
  active: e.isToolVisible(i)
3059
- }, r = e.componentOverrides ?? {}, s = oe(this.toolId, t, e, r);
3060
- return s.setAttribute("tool-id", i), {
3189
+ }, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
3190
+ return r.setAttribute("tool-id", i), {
3061
3191
  toolId: this.toolId,
3062
3192
  button: n,
3063
- overlayElement: s,
3193
+ elements: [{ element: r, mount: "after-buttons" }],
3064
3194
  sync: () => {
3065
3195
  const o = e.isToolVisible(i);
3066
- n.active = o, s.visible = o, e.toolkitCoordinator && (s.toolkitCoordinator = e.toolkitCoordinator);
3196
+ n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
3067
3197
  },
3068
3198
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3069
3199
  o(e.isToolVisible(i));
@@ -3071,7 +3201,7 @@ const ts = /* @__PURE__ */ new Set([
3071
3201
  }
3072
3202
  };
3073
3203
  }
3074
- }, gs = {
3204
+ }, wr = {
3075
3205
  toolId: "graph",
3076
3206
  name: "Graph",
3077
3207
  description: "Graphing calculator and coordinate plane",
@@ -3094,10 +3224,10 @@ const ts = /* @__PURE__ */ new Set([
3094
3224
  * Pass 2: Graph is relevant when math content is present
3095
3225
  */
3096
3226
  isVisibleInContext(t) {
3097
- return It(t);
3227
+ return Rt(t);
3098
3228
  },
3099
3229
  renderToolbar(t, e) {
3100
- const i = Y(this.toolId, "item", e.itemId), n = {
3230
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
3101
3231
  toolId: this.toolId,
3102
3232
  label: this.name,
3103
3233
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3106,14 +3236,14 @@ const ts = /* @__PURE__ */ new Set([
3106
3236
  tooltip: "Graph",
3107
3237
  onClick: () => e.toggleTool(this.toolId),
3108
3238
  active: e.isToolVisible(i)
3109
- }, r = e.componentOverrides ?? {}, s = oe(this.toolId, t, e, r);
3110
- return s.setAttribute("tool-id", i), {
3239
+ }, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
3240
+ return r.setAttribute("tool-id", i), {
3111
3241
  toolId: this.toolId,
3112
3242
  button: n,
3113
- overlayElement: s,
3243
+ elements: [{ element: r, mount: "after-buttons" }],
3114
3244
  sync: () => {
3115
3245
  const o = e.isToolVisible(i);
3116
- n.active = o, s.visible = o, e.toolkitCoordinator && (s.toolkitCoordinator = e.toolkitCoordinator);
3246
+ n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
3117
3247
  },
3118
3248
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3119
3249
  o(e.isToolVisible(i));
@@ -3121,7 +3251,7 @@ const ts = /* @__PURE__ */ new Set([
3121
3251
  }
3122
3252
  };
3123
3253
  }
3124
- }, ms = {
3254
+ }, Sr = {
3125
3255
  toolId: "periodicTable",
3126
3256
  name: "Periodic Table",
3127
3257
  description: "Chemistry periodic table reference",
@@ -3142,10 +3272,10 @@ const ts = /* @__PURE__ */ new Set([
3142
3272
  * Pass 2: Periodic table is relevant when science content is present
3143
3273
  */
3144
3274
  isVisibleInContext(t) {
3145
- return Jr(t);
3275
+ return or(t);
3146
3276
  },
3147
3277
  renderToolbar(t, e) {
3148
- const i = Y(this.toolId, "item", e.itemId), n = {
3278
+ const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
3149
3279
  toolId: this.toolId,
3150
3280
  label: this.name,
3151
3281
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3154,14 +3284,14 @@ const ts = /* @__PURE__ */ new Set([
3154
3284
  tooltip: "Periodic Table",
3155
3285
  onClick: () => e.toggleTool(this.toolId),
3156
3286
  active: e.isToolVisible(i)
3157
- }, r = e.componentOverrides ?? {}, s = oe(this.toolId, t, e, r);
3158
- return s.setAttribute("tool-id", i), {
3287
+ }, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
3288
+ return r.setAttribute("tool-id", i), {
3159
3289
  toolId: this.toolId,
3160
3290
  button: n,
3161
- overlayElement: s,
3291
+ elements: [{ element: r, mount: "after-buttons" }],
3162
3292
  sync: () => {
3163
3293
  const o = e.isToolVisible(i);
3164
- n.active = o, s.visible = o, e.toolkitCoordinator && (s.toolkitCoordinator = e.toolkitCoordinator);
3294
+ n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
3165
3295
  },
3166
3296
  subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3167
3297
  o(e.isToolVisible(i));
@@ -3170,26 +3300,26 @@ const ts = /* @__PURE__ */ new Set([
3170
3300
  };
3171
3301
  }
3172
3302
  };
3173
- function vs(t = {}) {
3174
- const e = new Yr(), i = {
3303
+ function $r(t = {}) {
3304
+ const e = new ir(), i = {
3175
3305
  toolTagMap: {
3176
- ...bn,
3306
+ ...Sn,
3177
3307
  ...t.toolTagMap || {}
3178
3308
  },
3179
3309
  toolComponentFactory: t.toolComponentFactory,
3180
3310
  toolComponentFactories: t.toolComponentFactories
3181
- }, n = (r) => t.overrides?.[r.toolId] || r;
3182
- return e.register(n(os)), e.register(n(ls)), e.register(n(as)), e.register(n(cs)), e.register(n(us)), e.register(n(fs)), e.register(n(ds)), e.register(n(hs)), e.register(n(ps)), e.register(n(gs)), e.register(n(ms)), t.toolModuleLoaders && Object.keys(t.toolModuleLoaders).length > 0 && e.setToolModuleLoaders(t.toolModuleLoaders), e.setComponentOverrides(i), e;
3311
+ }, n = (s) => t.overrides?.[s.toolId] || s;
3312
+ return e.register(n(gr)), e.register(n(mr)), e.register(n(vr)), e.register(n(br)), e.register(n(_r)), e.register(n(yr)), e.register(n(Tr)), e.register(n(Ir)), e.register(n(Er)), e.register(n(wr)), e.register(n(Sr)), t.toolModuleLoaders && Object.keys(t.toolModuleLoaders).length > 0 && e.setToolModuleLoaders(t.toolModuleLoaders), e.setComponentOverrides(i), e;
3183
3313
  }
3184
- function bs() {
3185
- const t = vs(), e = /* @__PURE__ */ new Set();
3314
+ function Cr() {
3315
+ const t = $r(), e = /* @__PURE__ */ new Set();
3186
3316
  for (const i of t.getAllTools())
3187
3317
  for (const n of i.pnpSupportIds || [])
3188
3318
  e.add(n);
3189
3319
  return [...e].sort();
3190
3320
  }
3191
- bs();
3192
- const ys = {
3321
+ Cr();
3322
+ const Lr = {
3193
3323
  /**
3194
3324
  * Visual accessibility features
3195
3325
  * For students with low vision, color blindness, or visual processing needs
@@ -3360,16 +3490,16 @@ const ys = {
3360
3490
  tutorialAvailable: "tutorialAvailable"
3361
3491
  }
3362
3492
  };
3363
- Object.values(ys).flatMap((t) => Object.values(t));
3364
- var Bt;
3493
+ Object.values(Lr).flatMap((t) => Object.values(t));
3494
+ var Yt;
3365
3495
  (function(t) {
3366
3496
  t[t.BASE = 0] = "BASE", t[t.TOOL = 1e3] = "TOOL", t[t.MODAL = 2e3] = "MODAL", t[t.CONTROL = 3e3] = "CONTROL", t[t.HIGHLIGHT = 4e3] = "HIGHLIGHT";
3367
- })(Bt || (Bt = {}));
3368
- var hi;
3497
+ })(Yt || (Yt = {}));
3498
+ var Ti;
3369
3499
  (function(t) {
3370
3500
  t.IDLE = "idle", t.LOADING = "loading", t.PLAYING = "playing", t.PAUSED = "paused", t.ERROR = "error";
3371
- })(hi || (hi = {}));
3372
- class yn {
3501
+ })(Ti || (Ti = {}));
3502
+ const O = class O {
3373
3503
  constructor() {
3374
3504
  f(this, "elementType", "multiple-choice");
3375
3505
  f(this, "priority", 100);
@@ -3378,14 +3508,16 @@ class yn {
3378
3508
  return e.tagName.toLowerCase() === "multiple-choice" || e.classList.contains("multiple-choice");
3379
3509
  }
3380
3510
  findChoices(e) {
3381
- return Array.from(
3382
- e.querySelectorAll(
3383
- ".corespring-checkbox, .corespring-radio-button"
3384
- )
3511
+ e.setAttribute(O.ROOT_HOOK_ATTR, "true");
3512
+ const i = Array.from(
3513
+ e.querySelectorAll(O.CHOICE_SELECTOR)
3385
3514
  );
3515
+ for (const n of i)
3516
+ this.annotateChoice(n);
3517
+ return this.annotateFeedbackTicks(e), i;
3386
3518
  }
3387
3519
  createChoiceRange(e) {
3388
- const i = e.querySelector(".label") || e.querySelector("label") || e.querySelector('[class*="label"]') || e.querySelector("span");
3520
+ const i = this.resolveLabelElement(e);
3389
3521
  if (!i)
3390
3522
  return null;
3391
3523
  const n = document.createRange();
@@ -3398,34 +3530,59 @@ class yn {
3398
3530
  return i?.getAttribute("value") || i?.id || this.generateFallbackId(e);
3399
3531
  }
3400
3532
  getChoiceLabel(e) {
3401
- return e.querySelector(".label")?.textContent?.trim() || "Unlabeled choice";
3533
+ return this.resolveLabelElement(e)?.textContent?.trim() || "Unlabeled choice";
3402
3534
  }
3403
3535
  canEliminate(e) {
3404
3536
  const i = e.querySelector(
3405
3537
  'input[type="checkbox"], input[type="radio"]'
3406
3538
  );
3407
- return !(!i || i.getAttribute("aria-checked") === "true" || i.disabled || e.closest(".multiple-choice")?.querySelector(".feedback-tick"));
3539
+ return !(!i || i.getAttribute("aria-checked") === "true" || i.disabled || (e.closest(`[${O.ROOT_HOOK_ATTR}="true"]`) || e.closest("multiple-choice"))?.querySelector(
3540
+ `[${O.FEEDBACK_HOOK_ATTR}="true"]`
3541
+ ));
3408
3542
  }
3409
3543
  getButtonContainer(e) {
3410
3544
  return e;
3411
3545
  }
3412
3546
  generateFallbackId(e) {
3413
- const n = e.closest(".multiple-choice")?.querySelectorAll(".choice-input") || [];
3547
+ const n = (e.closest(`[${O.ROOT_HOOK_ATTR}="true"]`) || e.closest("multiple-choice"))?.querySelectorAll(
3548
+ `[${O.CHOICE_HOOK_ATTR}="true"]`
3549
+ ) || [];
3414
3550
  return `choice-${Array.from(n).indexOf(e)}`;
3415
3551
  }
3416
- }
3417
- class _s {
3552
+ annotateChoice(e) {
3553
+ e.setAttribute(O.CHOICE_HOOK_ATTR, "true");
3554
+ const i = this.resolveLabelElement(e);
3555
+ i && i.setAttribute(O.LABEL_HOOK_ATTR, "true");
3556
+ }
3557
+ resolveLabelElement(e) {
3558
+ return e.querySelector(
3559
+ `[${O.LABEL_HOOK_ATTR}="true"]`
3560
+ ) || e.querySelector("label") || e.querySelector("span");
3561
+ }
3562
+ annotateFeedbackTicks(e) {
3563
+ for (const i of e.querySelectorAll(
3564
+ ".feedback-tick"
3565
+ ))
3566
+ i.setAttribute(
3567
+ O.FEEDBACK_HOOK_ATTR,
3568
+ "true"
3569
+ );
3570
+ }
3571
+ };
3572
+ f(O, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice"), f(O, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label"), f(O, "ROOT_HOOK_ATTR", "data-pie-answer-eliminator-root"), f(O, "FEEDBACK_HOOK_ATTR", "data-pie-answer-eliminator-feedback-tick"), f(O, "CHOICE_SELECTOR", `[${O.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
3573
+ let St = O;
3574
+ class Rr {
3418
3575
  constructor() {
3419
3576
  f(this, "elementType", "ebsr");
3420
3577
  f(this, "priority", 95);
3421
- f(this, "mcAdapter", new yn());
3578
+ f(this, "mcAdapter", new St());
3422
3579
  }
3423
3580
  canHandle(e) {
3424
3581
  return e.tagName.toLowerCase() === "ebsr" || e.querySelector("ebsr-multiple-choice") !== null;
3425
3582
  }
3426
3583
  findChoices(e) {
3427
- const i = e.querySelector('ebsr-multiple-choice[id="a"]'), n = e.querySelector('ebsr-multiple-choice[id="b"]'), r = [];
3428
- return i && r.push(...this.mcAdapter.findChoices(i)), n && r.push(...this.mcAdapter.findChoices(n)), r;
3584
+ const i = e.querySelector('ebsr-multiple-choice[id="a"]'), n = e.querySelector('ebsr-multiple-choice[id="b"]'), s = [];
3585
+ return i && s.push(...this.mcAdapter.findChoices(i)), n && s.push(...this.mcAdapter.findChoices(n)), s;
3429
3586
  }
3430
3587
  // Delegate all other methods to MultipleChoiceAdapter
3431
3588
  createChoiceRange(e) {
@@ -3445,7 +3602,7 @@ class _s {
3445
3602
  return this.mcAdapter.getButtonContainer(e);
3446
3603
  }
3447
3604
  }
3448
- class ws {
3605
+ class Or {
3449
3606
  constructor() {
3450
3607
  f(this, "elementType", "inline-dropdown");
3451
3608
  f(this, "priority", 90);
@@ -3473,13 +3630,13 @@ class ws {
3473
3630
  return e;
3474
3631
  }
3475
3632
  }
3476
- class Ts {
3633
+ class kr {
3477
3634
  constructor() {
3478
3635
  f(this, "adapters");
3479
3636
  this.adapters = [
3480
- new yn(),
3481
- new _s(),
3482
- new ws()
3637
+ new St(),
3638
+ new Rr(),
3639
+ new Or()
3483
3640
  ].sort((e, i) => i.priority - e.priority);
3484
3641
  }
3485
3642
  /**
@@ -3493,10 +3650,10 @@ class Ts {
3493
3650
  */
3494
3651
  findAllChoicesWithAdapters(e) {
3495
3652
  const i = [], n = /* @__PURE__ */ new Set();
3496
- for (const r of this.adapters) {
3497
- const s = r.findChoices(e);
3498
- for (const o of s)
3499
- n.has(o) || (n.add(o), i.push({ choice: o, adapter: r }));
3653
+ for (const s of this.adapters) {
3654
+ const r = s.findChoices(e);
3655
+ for (const o of r)
3656
+ n.has(o) || (n.add(o), i.push({ choice: o, adapter: s }));
3500
3657
  }
3501
3658
  return i;
3502
3659
  }
@@ -3507,7 +3664,7 @@ class Ts {
3507
3664
  this.adapters.push(e), this.adapters.sort((i, n) => n.priority - i.priority);
3508
3665
  }
3509
3666
  }
3510
- class Ss {
3667
+ const C = class C {
3511
3668
  constructor() {
3512
3669
  f(this, "name", "mask");
3513
3670
  f(this, "highlights", /* @__PURE__ */ new Map());
@@ -3515,10 +3672,9 @@ class Ss {
3515
3672
  f(this, "fallbackContainers", /* @__PURE__ */ new Map());
3516
3673
  }
3517
3674
  initialize() {
3518
- this.injectCSS();
3519
3675
  }
3520
3676
  destroy() {
3521
- this.clearAll(), this.removeCSS();
3677
+ this.clearAll();
3522
3678
  }
3523
3679
  apply(e, i) {
3524
3680
  if (!this.isSupported()) {
@@ -3527,14 +3683,17 @@ class Ss {
3527
3683
  }
3528
3684
  this.injectHighlightCSS(e);
3529
3685
  const n = new Highlight(i);
3530
- CSS.highlights.set(`answer-masked-${e}`, n), this.highlights.set(e, n), this.ranges.set(e, i), this.addAriaAttributes(i);
3686
+ CSS.highlights.set(
3687
+ `${C.HIGHLIGHT_NAME_PREFIX}${e}`,
3688
+ n
3689
+ ), this.highlights.set(e, n), this.ranges.set(e, i), this.addAriaAttributes(i);
3531
3690
  }
3532
3691
  remove(e) {
3533
3692
  if (!this.isSupported()) {
3534
3693
  this.removeFallback(e);
3535
3694
  return;
3536
3695
  }
3537
- CSS.highlights.delete(`answer-masked-${e}`), this.removeHighlightCSS(e);
3696
+ CSS.highlights.delete(`${C.HIGHLIGHT_NAME_PREFIX}${e}`), this.removeHighlightCSS(e);
3538
3697
  const i = this.ranges.get(e);
3539
3698
  i && this.removeAriaAttributes(i), this.highlights.delete(e), this.ranges.delete(e), this.fallbackContainers.delete(e);
3540
3699
  }
@@ -3552,47 +3711,32 @@ class Ss {
3552
3711
  isSupported() {
3553
3712
  return typeof CSS < "u" && "highlights" in CSS;
3554
3713
  }
3555
- injectCSS() {
3556
- const e = "answer-eliminator-mask-styles";
3557
- if (document.getElementById(e)) return;
3558
- const i = document.createElement("style");
3559
- i.id = e, i.textContent = `
3560
- /* Fallback */
3561
- .answer-masked-fallback {
3562
- opacity: 0.2;
3563
- filter: blur(2px);
3564
- }
3565
- `, document.head.appendChild(i);
3566
- }
3567
3714
  injectHighlightCSS(e) {
3568
- const i = `answer-eliminator-mask-highlight-${e}`;
3715
+ const i = `${C.HIGHLIGHT_STYLE_PREFIX}${e}`;
3569
3716
  if (document.getElementById(i)) return;
3570
3717
  const n = document.createElement("style");
3571
3718
  n.id = i, n.textContent = `
3572
- ::highlight(answer-masked-${e}) {
3719
+ ::highlight(pie-answer-masked-${e}) {
3573
3720
  opacity: 0.2;
3574
3721
  filter: blur(2px);
3575
3722
  }
3576
3723
  `, document.head.appendChild(n);
3577
3724
  }
3578
3725
  removeHighlightCSS(e) {
3579
- document.getElementById(`answer-eliminator-mask-highlight-${e}`)?.remove();
3580
- }
3581
- removeCSS() {
3582
- document.getElementById("answer-eliminator-mask-styles")?.remove();
3726
+ document.getElementById(`${C.HIGHLIGHT_STYLE_PREFIX}${e}`)?.remove();
3583
3727
  }
3584
3728
  addAriaAttributes(e) {
3585
3729
  const i = this.findChoiceContainer(e);
3586
- i && (i.setAttribute("data-eliminated", "true"), i.setAttribute("aria-hidden", "true"));
3730
+ i && (i.setAttribute(C.ELIMINATED_ATTR, "true"), i.setAttribute("aria-hidden", "true"));
3587
3731
  }
3588
3732
  removeAriaAttributes(e) {
3589
3733
  const i = this.findChoiceContainer(e);
3590
- i && (i.removeAttribute("data-eliminated"), i.removeAttribute("aria-hidden"));
3734
+ i && (i.removeAttribute(C.ELIMINATED_ATTR), i.removeAttribute("aria-hidden"));
3591
3735
  }
3592
3736
  findChoiceContainer(e) {
3593
3737
  let i = e.startContainer;
3594
3738
  for (i.nodeType === Node.TEXT_NODE && (i = i.parentElement); i && i !== document.body; ) {
3595
- if (i.classList?.contains("choice-input"))
3739
+ if (i.getAttribute(C.CHOICE_HOOK_ATTR) === "true")
3596
3740
  return i;
3597
3741
  i = i.parentElement;
3598
3742
  }
@@ -3600,17 +3744,19 @@ class Ss {
3600
3744
  }
3601
3745
  applyFallback(e, i) {
3602
3746
  const n = this.findChoiceContainer(i);
3603
- n && (n.classList.add("answer-masked-fallback"), n.setAttribute("data-eliminated", "true"), n.setAttribute("data-eliminated-id", e), this.fallbackContainers.set(e, n), this.addAriaAttributes(i));
3747
+ n && (n.classList.add(C.FALLBACK_CLASS), n.setAttribute(C.ELIMINATED_ATTR, "true"), n.setAttribute(C.ELIMINATED_ID_ATTR, e), this.fallbackContainers.set(e, n), this.addAriaAttributes(i));
3604
3748
  }
3605
3749
  removeFallback(e) {
3606
3750
  const i = this.fallbackContainers.get(e);
3607
3751
  if (!i) return;
3608
- i.classList.remove("answer-masked-fallback"), i.removeAttribute("data-eliminated"), i.removeAttribute("data-eliminated-id");
3752
+ i.classList.remove(C.FALLBACK_CLASS), i.removeAttribute(C.ELIMINATED_ATTR), i.removeAttribute(C.ELIMINATED_ID_ATTR);
3609
3753
  const n = document.createRange();
3610
3754
  n.selectNodeContents(i), this.removeAriaAttributes(n), this.fallbackContainers.delete(e);
3611
3755
  }
3612
- }
3613
- class As {
3756
+ };
3757
+ f(C, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-mask-highlight-"), f(C, "HIGHLIGHT_NAME_PREFIX", "pie-answer-masked-"), f(C, "FALLBACK_CLASS", "pie-answer-masked-fallback"), f(C, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice"), f(C, "ELIMINATED_ATTR", "data-pie-answer-eliminated"), f(C, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
3758
+ let Ut = C;
3759
+ const w = class w {
3614
3760
  constructor() {
3615
3761
  f(this, "name", "strikethrough");
3616
3762
  f(this, "highlights", /* @__PURE__ */ new Map());
@@ -3618,14 +3764,10 @@ class As {
3618
3764
  f(this, "fallbackContainers", /* @__PURE__ */ new Map());
3619
3765
  }
3620
3766
  initialize() {
3621
- if (!this.isSupported()) {
3622
- console.warn("CSS Custom Highlight API not supported, using fallback");
3623
- return;
3624
- }
3625
- this.injectCSS();
3767
+ this.isSupported() || console.warn("CSS Custom Highlight API not supported, using fallback");
3626
3768
  }
3627
3769
  destroy() {
3628
- this.clearAll(), this.removeCSS();
3770
+ this.clearAll();
3629
3771
  }
3630
3772
  apply(e, i) {
3631
3773
  if (!this.isSupported()) {
@@ -3634,14 +3776,19 @@ class As {
3634
3776
  }
3635
3777
  this.injectHighlightCSS(e);
3636
3778
  const n = new Highlight(i);
3637
- CSS.highlights.set(`answer-eliminated-${e}`, n), this.highlights.set(e, n), this.ranges.set(e, i), this.addAriaAttributes(i);
3779
+ CSS.highlights.set(
3780
+ `${w.HIGHLIGHT_NAME_PREFIX}${e}`,
3781
+ n
3782
+ ), this.highlights.set(e, n), this.ranges.set(e, i), this.addAriaAttributes(i);
3638
3783
  }
3639
3784
  remove(e) {
3640
3785
  if (!this.isSupported()) {
3641
3786
  this.removeFallback(e);
3642
3787
  return;
3643
3788
  }
3644
- CSS.highlights.delete(`answer-eliminated-${e}`), this.removeHighlightCSS(e);
3789
+ CSS.highlights.delete(
3790
+ `${w.HIGHLIGHT_NAME_PREFIX}${e}`
3791
+ ), this.removeHighlightCSS(e);
3645
3792
  const i = this.ranges.get(e);
3646
3793
  i && this.removeAriaAttributes(i), this.highlights.delete(e), this.ranges.delete(e), this.fallbackContainers.delete(e);
3647
3794
  }
@@ -3659,35 +3806,12 @@ class As {
3659
3806
  isSupported() {
3660
3807
  return typeof CSS < "u" && "highlights" in CSS;
3661
3808
  }
3662
- injectCSS() {
3663
- const e = "answer-eliminator-strikethrough-styles";
3664
- if (document.getElementById(e)) return;
3665
- const i = document.createElement("style");
3666
- i.id = e, i.textContent = `
3667
- /* Fallback for browsers without CSS Highlight API */
3668
- .answer-eliminated-fallback {
3669
- text-decoration: line-through;
3670
- text-decoration-thickness: 2px;
3671
- text-decoration-color: var(--pie-incorrect, #ff9800);
3672
- opacity: 0.6;
3673
- }
3674
-
3675
- /* Screen reader only text */
3676
- .sr-announcement {
3677
- position: absolute;
3678
- left: -10000px;
3679
- width: 1px;
3680
- height: 1px;
3681
- overflow: hidden;
3682
- }
3683
- `, document.head.appendChild(i);
3684
- }
3685
3809
  injectHighlightCSS(e) {
3686
- const i = `answer-eliminator-highlight-${e}`;
3810
+ const i = `${w.HIGHLIGHT_STYLE_PREFIX}${e}`;
3687
3811
  if (document.getElementById(i)) return;
3688
3812
  const n = document.createElement("style");
3689
3813
  n.id = i, n.textContent = `
3690
- ::highlight(answer-eliminated-${e}) {
3814
+ ::highlight(pie-answer-eliminated-${e}) {
3691
3815
  text-decoration: line-through;
3692
3816
  text-decoration-thickness: 2px;
3693
3817
  text-decoration-color: var(--pie-incorrect, #ff9800);
@@ -3696,32 +3820,31 @@ class As {
3696
3820
  `, document.head.appendChild(n);
3697
3821
  }
3698
3822
  removeHighlightCSS(e) {
3699
- document.getElementById(`answer-eliminator-highlight-${e}`)?.remove();
3700
- }
3701
- removeCSS() {
3702
3823
  document.getElementById(
3703
- "answer-eliminator-strikethrough-styles"
3824
+ `${w.HIGHLIGHT_STYLE_PREFIX}${e}`
3704
3825
  )?.remove();
3705
3826
  }
3706
3827
  addAriaAttributes(e) {
3707
3828
  const i = this.findChoiceContainer(e);
3708
3829
  if (!i) return;
3709
- i.setAttribute("data-eliminated", "true"), i.setAttribute("aria-disabled", "true");
3710
- const n = i.querySelector(".label");
3711
- if (n && !n.querySelector(".sr-announcement")) {
3712
- const r = document.createElement("span");
3713
- r.className = "sr-announcement", r.textContent = " (eliminated)", n.appendChild(r);
3830
+ i.setAttribute(w.ELIMINATED_ATTR, "true"), i.setAttribute("aria-disabled", "true");
3831
+ const n = this.resolveLabelElement(i);
3832
+ if (n && !n.querySelector(`.${w.SR_CLASS}`)) {
3833
+ const s = document.createElement("span");
3834
+ s.className = w.SR_CLASS, s.textContent = " (eliminated)", n.appendChild(s);
3714
3835
  }
3715
3836
  }
3716
3837
  removeAriaAttributes(e) {
3717
3838
  const i = this.findChoiceContainer(e);
3718
3839
  if (!i) return;
3719
- i.removeAttribute("data-eliminated"), i.removeAttribute("aria-disabled"), i.querySelector(".sr-announcement")?.remove();
3840
+ i.removeAttribute(w.ELIMINATED_ATTR), i.removeAttribute("aria-disabled"), i.querySelector(
3841
+ `.${w.SR_CLASS}`
3842
+ )?.remove();
3720
3843
  }
3721
3844
  findChoiceContainer(e) {
3722
3845
  let i = e.startContainer;
3723
3846
  for (i.nodeType === Node.TEXT_NODE && (i = i.parentElement); i && i !== document.body; ) {
3724
- if (i.classList?.contains("choice-input") || i.classList?.contains("corespring-checkbox") || i.classList?.contains("corespring-radio-button"))
3847
+ if (i.getAttribute(w.CHOICE_HOOK_ATTR) === "true")
3725
3848
  return i;
3726
3849
  i = i.parentElement;
3727
3850
  }
@@ -3730,17 +3853,24 @@ class As {
3730
3853
  // Fallback for browsers without CSS Highlight API
3731
3854
  applyFallback(e, i) {
3732
3855
  const n = this.findChoiceContainer(i);
3733
- n && (n.classList.add("answer-eliminated-fallback"), n.setAttribute("data-eliminated", "true"), n.setAttribute("data-eliminated-id", e), this.fallbackContainers.set(e, n), this.addAriaAttributes(i));
3856
+ n && (n.classList.add(w.FALLBACK_CLASS), n.setAttribute(w.ELIMINATED_ATTR, "true"), n.setAttribute(w.ELIMINATED_ID_ATTR, e), this.fallbackContainers.set(e, n), this.addAriaAttributes(i));
3734
3857
  }
3735
3858
  removeFallback(e) {
3736
3859
  const i = this.fallbackContainers.get(e);
3737
3860
  if (!i) return;
3738
- i.classList.remove("answer-eliminated-fallback"), i.removeAttribute("data-eliminated"), i.removeAttribute("data-eliminated-id");
3861
+ i.classList.remove(w.FALLBACK_CLASS), i.removeAttribute(w.ELIMINATED_ATTR), i.removeAttribute(w.ELIMINATED_ID_ATTR);
3739
3862
  const n = document.createRange();
3740
3863
  n.selectNodeContents(i), this.removeAriaAttributes(n), this.fallbackContainers.delete(e);
3741
3864
  }
3742
- }
3743
- class Is {
3865
+ resolveLabelElement(e) {
3866
+ return e.querySelector(
3867
+ `[${w.LABEL_HOOK_ATTR}="true"]`
3868
+ ) || e.querySelector("label");
3869
+ }
3870
+ };
3871
+ f(w, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-highlight-"), f(w, "HIGHLIGHT_NAME_PREFIX", "pie-answer-eliminated-"), f(w, "FALLBACK_CLASS", "pie-answer-eliminator-eliminated-fallback"), f(w, "SR_CLASS", "pie-answer-eliminator-sr-announcement"), f(w, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice"), f(w, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label"), f(w, "ELIMINATED_ATTR", "data-pie-answer-eliminated"), f(w, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
3872
+ let xt = w;
3873
+ const Te = class Te {
3744
3874
  constructor(e = "strikethrough", i = "right") {
3745
3875
  f(this, "registry");
3746
3876
  f(this, "strategy");
@@ -3757,10 +3887,10 @@ class Is {
3757
3887
  // Whether to restore eliminations from state storage
3758
3888
  // Store integration (replaces session/localStorage)
3759
3889
  f(this, "storeIntegration", null);
3760
- this.registry = new Ts(), this.strategy = this.createStrategy(e), this.strategy.initialize(), this.buttonAlignment = i;
3890
+ this.registry = new kr(), this.strategy = this.createStrategy(e), this.strategy.initialize(), this.buttonAlignment = i;
3761
3891
  }
3762
3892
  createStrategy(e) {
3763
- return e === "mask" ? new Ss() : new As();
3893
+ return e === "mask" ? new Ut() : new xt();
3764
3894
  }
3765
3895
  /**
3766
3896
  * Initialize eliminator for a question
@@ -3768,8 +3898,8 @@ class Is {
3768
3898
  initializeForQuestion(e) {
3769
3899
  this.cleanupButtons();
3770
3900
  const i = this.registry.findAllChoicesWithAdapters(e);
3771
- for (const { choice: n, adapter: r } of i)
3772
- this.initializeChoice(n, r);
3901
+ for (const { choice: n, adapter: s } of i)
3902
+ this.initializeChoice(n, s);
3773
3903
  this.shouldRestoreState && this.restoreState();
3774
3904
  }
3775
3905
  /**
@@ -3778,40 +3908,20 @@ class Is {
3778
3908
  initializeChoice(e, i) {
3779
3909
  const n = i.getChoiceId(e);
3780
3910
  this.choiceElements.set(n, e), this.choiceAdapters.set(n, i);
3781
- const r = this.createToggleButton(e, i);
3782
- if (!r) return;
3783
- this.choiceButtons.set(n, r);
3784
- const s = i.getButtonContainer(e);
3785
- s && (s.style.position = "relative", s.appendChild(r));
3911
+ const s = this.createToggleButton(e, i);
3912
+ if (!s) return;
3913
+ this.choiceButtons.set(n, s);
3914
+ const r = i.getButtonContainer(e);
3915
+ r && (r.style.position = "relative", r.appendChild(s));
3786
3916
  }
3787
3917
  /**
3788
3918
  * Create elimination toggle button
3789
3919
  */
3790
3920
  createToggleButton(e, i) {
3791
- const n = i.getChoiceId(e), r = i.getChoiceLabel(e), s = document.createElement("button");
3792
- return s.type = "button", s.className = "answer-eliminator-toggle", s.setAttribute("aria-label", `Toggle elimination for ${r}`), s.setAttribute("data-choice-id", n), s.textContent = "⊗", this.applyButtonAlignment(s), Object.assign(s.style, {
3793
- width: "28px",
3794
- height: "28px",
3795
- padding: "0",
3796
- border: "1px solid #ccc",
3797
- borderRadius: "4px",
3798
- background: "white",
3799
- cursor: "pointer",
3800
- fontSize: "18px",
3801
- lineHeight: "1",
3802
- display: "flex",
3803
- alignItems: "center",
3804
- justifyContent: "center",
3805
- color: "#666",
3806
- transition: "all 0.2s ease",
3807
- zIndex: "10"
3808
- }), s.addEventListener("mouseenter", () => {
3809
- s.style.background = "#f0f0f0", s.style.borderColor = "#999", s.style.color = "#333";
3810
- }), s.addEventListener("mouseleave", () => {
3811
- this.strategy.isEliminated(n) || (s.style.background = "white", s.style.borderColor = "#ccc", s.style.color = "#666");
3812
- }), s.addEventListener("click", (o) => {
3921
+ const n = i.getChoiceId(e), s = i.getChoiceLabel(e), r = document.createElement("button");
3922
+ return r.type = "button", r.className = Te.TOGGLE_CLASS, r.setAttribute("aria-label", `Toggle elimination for ${s}`), r.setAttribute("data-choice-id", n), r.textContent = "⊗", this.applyButtonAlignment(r), r.addEventListener("click", (o) => {
3813
3923
  o.preventDefault(), o.stopPropagation(), this.toggleElimination(e, i);
3814
- }), s;
3924
+ }), r;
3815
3925
  }
3816
3926
  /**
3817
3927
  * Toggle elimination for a choice
@@ -3835,14 +3945,14 @@ class Is {
3835
3945
  * Eliminate a choice
3836
3946
  */
3837
3947
  eliminateChoice(e, i) {
3838
- const n = i.getChoiceId(e), r = i.createChoiceRange(e);
3839
- if (!r) {
3948
+ const n = i.getChoiceId(e), s = i.createChoiceRange(e);
3949
+ if (!s) {
3840
3950
  console.error("Failed to create range for choice");
3841
3951
  return;
3842
3952
  }
3843
- this.strategy.apply(n, r), this.eliminatedChoices.add(n);
3844
- const s = this.choiceButtons.get(n);
3845
- s && (s.classList.add("active"), s.setAttribute("aria-pressed", "true"), s.style.background = "#ff9800", s.style.borderColor = "#ff9800", s.style.color = "white"), this.saveState();
3953
+ this.strategy.apply(n, s), this.eliminatedChoices.add(n);
3954
+ const r = this.choiceButtons.get(n);
3955
+ r && (r.classList.add(Te.TOGGLE_ACTIVE_CLASS), r.setAttribute("aria-pressed", "true")), this.saveState();
3846
3956
  }
3847
3957
  /**
3848
3958
  * Restore a choice
@@ -3850,7 +3960,7 @@ class Is {
3850
3960
  restoreChoice(e) {
3851
3961
  this.strategy.remove(e), this.eliminatedChoices.delete(e);
3852
3962
  const i = this.choiceButtons.get(e);
3853
- i && (i.classList.remove("active"), i.setAttribute("aria-pressed", "false"), i.style.background = "white", i.style.borderColor = "#ccc", i.style.color = "#666"), this.saveState();
3963
+ i && (i.classList.remove(Te.TOGGLE_ACTIVE_CLASS), i.setAttribute("aria-pressed", "false")), this.saveState();
3854
3964
  }
3855
3965
  /**
3856
3966
  * Reset all eliminations for current element
@@ -3904,15 +4014,15 @@ class Is {
3904
4014
  const i = e.eliminatedChoices;
3905
4015
  if (!i || i.length === 0) return;
3906
4016
  for (const n of i) {
3907
- const r = this.choiceElements.get(n);
3908
- if (!r) continue;
3909
- const s = this.choiceAdapters.get(n);
4017
+ const s = this.choiceElements.get(n);
3910
4018
  if (!s) continue;
3911
- const o = s.createChoiceRange(r);
4019
+ const r = this.choiceAdapters.get(n);
4020
+ if (!r) continue;
4021
+ const o = r.createChoiceRange(s);
3912
4022
  if (o) {
3913
4023
  this.strategy.apply(n, o), this.eliminatedChoices.add(n);
3914
4024
  const l = this.choiceButtons.get(n);
3915
- l && (l.classList.add("active"), l.setAttribute("aria-pressed", "true"), l.style.background = "#ff9800", l.style.borderColor = "#ff9800", l.style.color = "white");
4025
+ l && (l.classList.add(Te.TOGGLE_ACTIVE_CLASS), l.setAttribute("aria-pressed", "true"));
3916
4026
  }
3917
4027
  }
3918
4028
  } catch (i) {
@@ -3985,145 +4095,147 @@ class Is {
3985
4095
  destroy() {
3986
4096
  this.cleanupButtons(), this.strategy.destroy();
3987
4097
  }
3988
- }
3989
- var Es = /* @__PURE__ */ Cr('<div style="display: none;" aria-hidden="true"></div>');
3990
- function $s(t, e) {
3991
- Ii(e, !0);
3992
- let i = ve(e, "visible", 7, !1), n = ve(e, "toolId", 7, "answerEliminator"), r = ve(e, "strategy", 7, "strikethrough"), s = ve(
4098
+ };
4099
+ f(Te, "TOGGLE_CLASS", "pie-answer-eliminator-toggle"), f(Te, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
4100
+ let Xt = Te;
4101
+ var Hr = /* @__PURE__ */ Vs('<div style="display: none;" aria-hidden="true"></div>');
4102
+ function Nr(t, e) {
4103
+ Hi(e, !0);
4104
+ let i = ye(e, "visible", 7, !1), n = ye(e, "toolId", 7, "answerEliminator"), s = ye(e, "strategy", 7, "strikethrough"), r = ye(
3993
4105
  e,
3994
4106
  "alwaysOn",
3995
4107
  7,
3996
4108
  !1
3997
4109
  // Set true for profile-based accommodation
3998
- ), o = ve(
4110
+ ), o = ye(
3999
4111
  e,
4000
4112
  "buttonAlignment",
4001
4113
  7,
4002
4114
  "right"
4003
4115
  // Button placement: left, right, or inline with checkbox
4004
- ), l = ve(
4116
+ ), l = ye(
4005
4117
  e,
4006
4118
  "scopeElement",
4007
4119
  7,
4008
4120
  null
4009
4121
  // Container element to limit DOM queries (for multi-item pages)
4010
- ), a = ve(
4122
+ ), a = ye(
4011
4123
  e,
4012
4124
  "elementToolStateStore",
4013
4125
  7,
4014
4126
  null
4015
4127
  // ElementToolStateStore instance
4016
- ), u = ve(
4128
+ ), u = ye(
4017
4129
  e,
4018
4130
  "globalElementId",
4019
4131
  7,
4020
4132
  ""
4021
4133
  // Composite key: "assessmentId:sectionId:itemId:elementId"
4022
- ), d = /* @__PURE__ */ N(null), m = /* @__PURE__ */ N(null), p = /* @__PURE__ */ N(null);
4023
- const y = /* @__PURE__ */ ni(() => g(m)?.toolCoordinator);
4024
- let h = /* @__PURE__ */ N(null), E = /* @__PURE__ */ N(null), _ = /* @__PURE__ */ N(null), F = /* @__PURE__ */ N(null), W = /* @__PURE__ */ ni(() => s() || i());
4025
- Ie(() => {
4026
- if (g(d))
4027
- return Gr(g(d), (T) => {
4028
- A(m, T, !0);
4134
+ ), d = /* @__PURE__ */ P(null), v = /* @__PURE__ */ P(null), p = /* @__PURE__ */ P(null);
4135
+ const g = /* @__PURE__ */ fi(() => m(v)?.toolCoordinator);
4136
+ let h = /* @__PURE__ */ P(null), T = /* @__PURE__ */ P(null), b = /* @__PURE__ */ P(null), S = /* @__PURE__ */ P(null), L = /* @__PURE__ */ fi(() => r() || i());
4137
+ Le(() => {
4138
+ if (m(d))
4139
+ return Js(m(d), (I) => {
4140
+ $(v, I, !0);
4029
4141
  });
4030
- }), Ie(() => {
4031
- if (g(d))
4032
- return Ur(g(d), (T) => {
4033
- A(p, T, !0);
4142
+ }), Le(() => {
4143
+ if (m(d))
4144
+ return Zs(m(d), (I) => {
4145
+ $(p, I, !0);
4034
4146
  });
4035
4147
  });
4036
- function _n() {
4037
- return l() || g(p)?.scopeElement || null;
4148
+ function $n() {
4149
+ return l() || m(p)?.scopeElement || null;
4038
4150
  }
4039
- function $t() {
4040
- if (!g(W) || !g(h)) return;
4041
- const T = _n();
4042
- if (!T) {
4151
+ function kt() {
4152
+ if (!m(L) || !m(h)) return;
4153
+ const I = $n();
4154
+ if (!I) {
4043
4155
  console.warn("[AnswerEliminator] Missing shell scope context for question root");
4044
4156
  return;
4045
4157
  }
4046
- g(h).initializeForQuestion(T);
4158
+ m(h).initializeForQuestion(I);
4047
4159
  }
4048
- function wn() {
4160
+ function Cn() {
4049
4161
  requestAnimationFrame(() => {
4050
4162
  requestAnimationFrame(() => {
4051
- $t();
4163
+ kt();
4052
4164
  });
4053
4165
  });
4054
4166
  }
4055
- Ie(() => {
4056
- !g(y) || !n() || (g(F) && g(_) && (g(F) !== g(y) || g(_) !== n()) && (g(F).unregisterTool(g(_)), A(F, null), A(_, null)), g(_) || (g(y).registerTool(n(), "Answer Eliminator", void 0, Bt.MODAL), A(F, g(y), !0), A(_, n())));
4057
- }), Ie(() => {
4058
- g(h) && a() && u() && g(h).setStoreIntegration(a(), u());
4059
- }), Vr(() => (A(h, new Is(r(), o()), !0), g(h) && a() && u() && g(h).setStoreIntegration(a(), u()), g(W) ? $t() : g(h).cleanup(), () => {
4060
- g(h)?.destroy(), A(h, null), g(F) && g(_) && (g(F).unregisterTool(g(_)), A(F, null), A(_, null));
4061
- })), Ie(() => {
4062
- const T = g(p)?.contextVersion ?? null;
4063
- if (T !== null) {
4064
- if (g(E) === null) {
4065
- A(E, T, !0);
4167
+ Le(() => {
4168
+ !m(g) || !n() || (m(S) && m(b) && (m(S) !== m(g) || m(b) !== n()) && (m(S).unregisterTool(m(b)), $(S, null), $(b, null)), m(b) || (m(g).registerTool(n(), "Answer Eliminator", void 0, Yt.MODAL), $(S, m(g), !0), $(b, n())));
4169
+ }), Le(() => {
4170
+ m(h) && a() && u() && m(h).setStoreIntegration(a(), u());
4171
+ }), Bs(() => ($(h, new Xt(s(), o()), !0), m(h) && a() && u() && m(h).setStoreIntegration(a(), u()), m(L) ? kt() : m(h).cleanup(), () => {
4172
+ m(h)?.destroy(), $(h, null), m(S) && m(b) && (m(S).unregisterTool(m(b)), $(S, null), $(b, null));
4173
+ })), Le(() => {
4174
+ const I = m(p)?.contextVersion ?? null;
4175
+ if (I !== null) {
4176
+ if (m(T) === null) {
4177
+ $(T, I, !0);
4066
4178
  return;
4067
4179
  }
4068
- T !== g(E) && (A(E, T, !0), wn());
4180
+ I !== m(T) && ($(T, I, !0), Cn());
4069
4181
  }
4070
- }), Ie(() => {
4071
- g(h) && (g(W) ? (g(h).enableStateRestoration(), $t()) : g(h).cleanup());
4182
+ }), Le(() => {
4183
+ m(h) && (m(L) ? (m(h).enableStateRestoration(), kt()) : m(h).cleanup());
4072
4184
  });
4073
- var Tn = {
4185
+ var Ln = {
4074
4186
  get visible() {
4075
4187
  return i();
4076
4188
  },
4077
- set visible(T = !1) {
4078
- i(T), le();
4189
+ set visible(I = !1) {
4190
+ i(I), ue();
4079
4191
  },
4080
4192
  get toolId() {
4081
4193
  return n();
4082
4194
  },
4083
- set toolId(T = "answerEliminator") {
4084
- n(T), le();
4195
+ set toolId(I = "answerEliminator") {
4196
+ n(I), ue();
4085
4197
  },
4086
4198
  get strategy() {
4087
- return r();
4199
+ return s();
4088
4200
  },
4089
- set strategy(T = "strikethrough") {
4090
- r(T), le();
4201
+ set strategy(I = "strikethrough") {
4202
+ s(I), ue();
4091
4203
  },
4092
4204
  get alwaysOn() {
4093
- return s();
4205
+ return r();
4094
4206
  },
4095
- set alwaysOn(T = !1) {
4096
- s(T), le();
4207
+ set alwaysOn(I = !1) {
4208
+ r(I), ue();
4097
4209
  },
4098
4210
  get buttonAlignment() {
4099
4211
  return o();
4100
4212
  },
4101
- set buttonAlignment(T = "right") {
4102
- o(T), le();
4213
+ set buttonAlignment(I = "right") {
4214
+ o(I), ue();
4103
4215
  },
4104
4216
  get scopeElement() {
4105
4217
  return l();
4106
4218
  },
4107
- set scopeElement(T = null) {
4108
- l(T), le();
4219
+ set scopeElement(I = null) {
4220
+ l(I), ue();
4109
4221
  },
4110
4222
  get elementToolStateStore() {
4111
4223
  return a();
4112
4224
  },
4113
- set elementToolStateStore(T = null) {
4114
- a(T), le();
4225
+ set elementToolStateStore(I = null) {
4226
+ a(I), ue();
4115
4227
  },
4116
4228
  get globalElementId() {
4117
4229
  return u();
4118
4230
  },
4119
- set globalElementId(T = "") {
4120
- u(T), le();
4231
+ set globalElementId(I = "") {
4232
+ u(I), ue();
4121
4233
  }
4122
- }, Xt = Es();
4123
- return Nr(Xt, (T) => A(d, T), () => g(d)), un(t, Xt), Ei(Tn);
4234
+ }, oi = Hr();
4235
+ return Gs(oi, (I) => $(d, I), () => m(d)), bn(t, oi), Ni(Ln);
4124
4236
  }
4125
- customElements.define("pie-tool-answer-eliminator", Pr(
4126
- $s,
4237
+ customElements.define("pie-tool-answer-eliminator", zs(
4238
+ Nr,
4127
4239
  {
4128
4240
  visible: { attribute: "visible", type: "Boolean" },
4129
4241
  toolId: { attribute: "tool-id", type: "String" },
@@ -4139,5 +4251,5 @@ customElements.define("pie-tool-answer-eliminator", Pr(
4139
4251
  { mode: "open" }
4140
4252
  ));
4141
4253
  export {
4142
- $s as default
4254
+ Nr as default
4143
4255
  };