@pie-players/pie-tool-answer-eliminator 0.3.29 → 0.3.31

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,15 +1,15 @@
1
1
  import { t as u } from "./defineProperty-CyepwRr5.js";
2
2
  if (typeof window < "u") {
3
- var hr, pr;
4
- ((hr = (pr = window).__svelte ?? (pr.__svelte = {})).v ?? (hr.v = /* @__PURE__ */ new Set())).add("5");
3
+ var Ir, Er;
4
+ ((Ir = (Er = window).__svelte ?? (Er.__svelte = {})).v ?? (Ir.v = /* @__PURE__ */ new Set())).add("5");
5
5
  }
6
- var wt = {}, M = Symbol(), Ro = Symbol("filename");
7
- var Qi = Array.isArray, Ji = Array.prototype.indexOf, ze = Array.prototype.includes, Zi = Array.from, Tt = Object.keys, At = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, en = Object.prototype, tn = Array.prototype, rn = Object.getPrototypeOf, vr = Object.isExtensible, nn = () => {
6
+ var kt = {}, M = Symbol(), Xs = Symbol("filename");
7
+ var ln = Array.isArray, cn = Array.prototype.indexOf, Ke = Array.prototype.includes, un = Array.from, Ct = Object.keys, $t = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, dn = Object.prototype, fn = Array.prototype, hn = Object.getPrototypeOf, kr = Object.isExtensible, pn = () => {
8
8
  };
9
- function sn(e) {
9
+ function vn(e) {
10
10
  for (var t = 0; t < e.length; t++) e[t]();
11
11
  }
12
- function on() {
12
+ function gn() {
13
13
  var e, t;
14
14
  return {
15
15
  promise: new Promise((r, i) => {
@@ -19,71 +19,74 @@ function on() {
19
19
  reject: t
20
20
  };
21
21
  }
22
- var Mo = 1 << 24, ee = 1024, ce = 2048, Pe = 4096, jr = 8192, an = 16384, zr = 32768, mr = 1 << 25, Gr = 65536, Po = 1 << 17, xo = 1 << 18, st = 1 << 19, ln = 1 << 20, Ho = 1 << 25, ot = 65536, gr = 1 << 21, No = 1 << 22, Wr = 1 << 23, Je = Symbol("$state"), qr = Symbol("legacy props"), cn = Symbol("proxy path"), Jt = new class extends Error {
22
+ var Qs = 1 << 24, re = 1024, le = 2048, Fe = 4096, Jr = 8192, mn = 16384, Zr = 32768, Cr = 1 << 25, ei = 65536, Js = 1 << 17, Zs = 1 << 18, ut = 1 << 19, _n = 1 << 20, dt = 65536, $r = 1 << 21, ea = 1 << 22, ti = 1 << 23, nt = Symbol("$state"), ri = Symbol("legacy props"), yn = Symbol("proxy path"), lr = new class extends Error {
23
23
  constructor(...t) {
24
24
  super(...t), u(this, "name", "StaleReactionError"), u(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
25
25
  }
26
- }(), Fo = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
27
- function un(e) {
26
+ }(), ra = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
27
+ function bn(e) {
28
28
  throw new Error("https://svelte.dev/e/lifecycle_outside_component");
29
29
  }
30
- function dn(e) {
30
+ function wn(e) {
31
31
  throw new Error("https://svelte.dev/e/effect_in_teardown");
32
32
  }
33
- function fn() {
33
+ function Tn() {
34
34
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
35
35
  }
36
- function hn(e) {
36
+ function An(e) {
37
37
  throw new Error("https://svelte.dev/e/effect_orphan");
38
38
  }
39
- function pn() {
39
+ function Sn() {
40
40
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
41
41
  }
42
- function vn() {
42
+ function In() {
43
43
  throw new Error("https://svelte.dev/e/hydration_failed");
44
44
  }
45
- function mn(e) {
45
+ function En(e) {
46
46
  throw new Error("https://svelte.dev/e/props_invalid_value");
47
47
  }
48
- function gn() {
48
+ function kn() {
49
49
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
50
50
  }
51
- function _n() {
51
+ function Cn() {
52
52
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
53
53
  }
54
- function yn() {
54
+ function $n() {
55
55
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
56
56
  }
57
- function bn() {
57
+ function Ln() {
58
58
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
59
59
  }
60
- function Kr(e) {
60
+ function On() {
61
+ console.warn("https://svelte.dev/e/derived_inert");
62
+ }
63
+ function ii(e) {
61
64
  console.warn("https://svelte.dev/e/hydration_mismatch");
62
65
  }
63
- function wn() {
66
+ function Rn() {
64
67
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
65
68
  }
66
- var Y = !1;
67
- function ct(e) {
68
- Y = e;
69
+ var Z = !1;
70
+ function pt(e) {
71
+ Z = e;
69
72
  }
70
- var x;
71
- function tt(e) {
73
+ var N;
74
+ function at(e) {
72
75
  if (e === null)
73
- throw Kr(), wt;
74
- return x = e;
76
+ throw ii(), kt;
77
+ return N = e;
75
78
  }
76
- function Ur() {
77
- return tt(/* @__PURE__ */ Ue(x));
79
+ function ni() {
80
+ return at(/* @__PURE__ */ Ze(N));
78
81
  }
79
- function Tn(e = 1) {
80
- if (Y) {
81
- for (var t = e, r = x; t--; ) r = /* @__PURE__ */ Ue(r);
82
- x = r;
82
+ function Mn(e = 1) {
83
+ if (Z) {
84
+ for (var t = e, r = N; t--; ) r = /* @__PURE__ */ Ze(r);
85
+ N = r;
83
86
  }
84
87
  }
85
- function An(e = !0) {
86
- for (var t = 0, r = x; ; ) {
88
+ function Pn(e = !0) {
89
+ for (var t = 0, r = N; ; ) {
87
90
  if (r.nodeType === 8) {
88
91
  var i = r.data;
89
92
  if (i === "]") {
@@ -91,83 +94,83 @@ function An(e = !0) {
91
94
  t -= 1;
92
95
  } else (i === "[" || i === "[!" || i[0] === "[" && !isNaN(Number(i.slice(1)))) && (t += 1);
93
96
  }
94
- var n = /* @__PURE__ */ Ue(r);
97
+ var n = /* @__PURE__ */ Ze(r);
95
98
  e && r.remove(), r = n;
96
99
  }
97
100
  }
98
- function Yr(e) {
101
+ function oi(e) {
99
102
  return e === this.v;
100
103
  }
101
- function Sn(e, t) {
104
+ function xn(e, t) {
102
105
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
103
106
  }
104
- function Xr(e) {
105
- return !Sn(e, this.v);
107
+ function si(e) {
108
+ return !xn(e, this.v);
106
109
  }
107
- var Re = !1, at = !1;
108
- function _r(e, t) {
109
- return e.label = t, In(e.v, t), e;
110
+ var we = !1, ft = !1;
111
+ function Lr(e, t) {
112
+ return e.label = t, Hn(e.v, t), e;
110
113
  }
111
- function In(e, t) {
112
- return e?.[cn]?.(t), e;
114
+ function Hn(e, t) {
115
+ return e?.[yn]?.(t), e;
113
116
  }
114
- var O = null;
115
- function St(e) {
116
- O = e;
117
+ var L = null;
118
+ function Lt(e) {
119
+ L = e;
117
120
  }
118
- function Qr(e, t = !1, r) {
119
- O = {
120
- p: O,
121
+ function ai(e, t = !1, r) {
122
+ L = {
123
+ p: L,
121
124
  i: !1,
122
125
  c: null,
123
126
  e: null,
124
127
  s: e,
125
128
  x: null,
126
- r: T,
127
- l: at && !t ? {
129
+ r: A,
130
+ l: ft && !t ? {
128
131
  s: null,
129
132
  u: null,
130
133
  $: []
131
134
  } : null
132
135
  };
133
136
  }
134
- function Jr(e) {
135
- var t = O, r = t.e;
137
+ function li(e) {
138
+ var t = L, r = t.e;
136
139
  if (r !== null) {
137
140
  t.e = null;
138
- for (var i of r) Ii(i);
141
+ for (var i of r) Pi(i);
139
142
  }
140
- return e !== void 0 && (t.x = e), t.i = !0, O = t.p, e ?? {};
143
+ return e !== void 0 && (t.x = e), t.i = !0, L = t.p, e ?? {};
141
144
  }
142
- function $t() {
143
- return !at || O !== null && O.l === null;
145
+ function xt() {
146
+ return !ft || L !== null && L.l === null;
144
147
  }
145
- var Ie = [];
146
- function Zr() {
147
- var e = Ie;
148
- Ie = [], sn(e);
148
+ var $e = [];
149
+ function ci() {
150
+ var e = $e;
151
+ $e = [], vn(e);
149
152
  }
150
- function Ge(e) {
151
- if (Ie.length === 0 && !Ze) {
152
- var t = Ie;
153
+ function Ue(e) {
154
+ if ($e.length === 0 && !ot) {
155
+ var t = $e;
153
156
  queueMicrotask(() => {
154
- t === Ie && Zr();
157
+ t === $e && ci();
155
158
  });
156
159
  }
157
- Ie.push(e);
160
+ $e.push(e);
158
161
  }
159
- function En() {
160
- for (; Ie.length > 0; ) Zr();
162
+ function Nn() {
163
+ for (; $e.length > 0; ) ci();
161
164
  }
162
- function ei(e) {
163
- var t = T;
165
+ function ui(e) {
166
+ var t = A;
164
167
  if (t === null)
165
- return w.f |= Wr, e;
168
+ return T.f |= ti, e;
166
169
  if (!(t.f & 32768) && !(t.f & 4))
167
170
  throw e;
168
- Ve(e, t);
171
+ Ge(e, t);
169
172
  }
170
- function Ve(e, t) {
173
+ function Ge(e, t) {
171
174
  for (; t !== null; ) {
172
175
  if (t.f & 128) {
173
176
  if (!(t.f & 32768)) throw e;
@@ -182,679 +185,727 @@ function Ve(e, t) {
182
185
  }
183
186
  throw e;
184
187
  }
185
- var kn = ~(ce | Pe | ee);
186
- function R(e, t) {
187
- e.f = e.f & kn | t;
188
+ var Dn = ~(le | Fe | re);
189
+ function O(e, t) {
190
+ e.f = e.f & Dn | t;
188
191
  }
189
- function Zt(e) {
190
- e.f & 512 || e.deps === null ? R(e, ee) : R(e, Pe);
192
+ function cr(e) {
193
+ e.f & 512 || e.deps === null ? O(e, re) : O(e, Fe);
191
194
  }
192
- function ti(e) {
195
+ function di(e) {
193
196
  if (e !== null)
194
197
  for (const t of e)
195
- !(t.f & 2) || !(t.f & 65536) || (t.f ^= ot, ti(t.deps));
198
+ !(t.f & 2) || !(t.f & 65536) || (t.f ^= dt, di(t.deps));
196
199
  }
197
- function ri(e, t, r) {
198
- e.f & 2048 ? t.add(e) : e.f & 4096 && r.add(e), ti(e.deps), R(e, ee);
200
+ function fi(e, t, r) {
201
+ e.f & 2048 ? t.add(e) : e.f & 4096 && r.add(e), di(e.deps), O(e, re);
199
202
  }
200
- var Cn = !1, ut = !1;
201
- function $n(e) {
202
- var t = ut;
203
+ var Fn = !1, vt = !1;
204
+ function Bn(e) {
205
+ var t = vt;
203
206
  try {
204
- return ut = !1, [e(), ut];
207
+ return vt = !1, [e(), vt];
205
208
  } finally {
206
- ut = t;
209
+ vt = t;
207
210
  }
208
211
  }
209
- function ii(e, t) {
212
+ function hi(e, t) {
210
213
  if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
211
214
  }
212
- function er(e, t) {
213
- ii(e, t), t.add(e);
215
+ function ur(e, t) {
216
+ hi(e, t), t.add(e);
214
217
  }
215
- function A(e, t, r) {
216
- ii(e, t), t.set(e, r);
218
+ function w(e, t, r) {
219
+ hi(e, t), t.set(e, r);
217
220
  }
218
- function E(e, t, r) {
221
+ function S(e, t, r) {
219
222
  if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : r;
220
223
  throw new TypeError("Private element is not present on this object");
221
224
  }
222
- function l(e, t) {
223
- return e.get(E(e, t));
225
+ function a(e, t) {
226
+ return e.get(S(e, t));
224
227
  }
225
228
  function b(e, t, r) {
226
- return e.set(E(e, t), r), r;
229
+ return e.set(S(e, t), r), r;
227
230
  }
228
- var ni, le = /* @__PURE__ */ new Set(), C = null, yr = null, F = null, jt = null, Ze = !1, Ht = !1, We = null, It = null, si = 0;
229
- var On = 1, Et = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakSet(), Ke = class oi {
231
+ var pi, oe = /* @__PURE__ */ new Set(), I = null, Or = null, x = null, Ut = null, ot = !1, zt = !1, Ye = null, Ot = null, vi = 0;
232
+ var jn = 1, Rt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), wt = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), qe = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakSet(), Je = class gi {
230
233
  constructor() {
231
- er(this, re), u(this, "id", On++), u(this, "current", /* @__PURE__ */ new Map()), u(this, "previous", /* @__PURE__ */ new Map()), A(this, Et, /* @__PURE__ */ new Set()), A(this, dt, /* @__PURE__ */ new Set()), A(this, Ne, 0), A(this, De, 0), A(this, mt, null), A(this, U, []), A(this, rt, /* @__PURE__ */ new Set()), A(this, Ce, /* @__PURE__ */ new Set()), A(this, Se, /* @__PURE__ */ new Map()), u(this, "is_fork", !1), A(this, ft, !1);
234
+ ur(this, F), u(this, "id", jn++), u(this, "current", /* @__PURE__ */ new Map()), u(this, "previous", /* @__PURE__ */ new Map()), w(this, Rt, /* @__PURE__ */ new Set()), w(this, gt, /* @__PURE__ */ new Set()), w(this, tt, /* @__PURE__ */ new Set()), w(this, ke, /* @__PURE__ */ new Map()), w(this, ye, /* @__PURE__ */ new Map()), w(this, wt, null), w(this, Q, []), w(this, Yt, []), w(this, Xe, /* @__PURE__ */ new Set()), w(this, Re, /* @__PURE__ */ new Set()), w(this, be, /* @__PURE__ */ new Map()), w(this, Tt, /* @__PURE__ */ new Set()), u(this, "is_fork", !1), w(this, mt, !1), w(this, qe, /* @__PURE__ */ new Set());
232
235
  }
233
236
  skip_effect(t) {
234
- l(Se, this).has(t) || l(Se, this).set(t, {
237
+ a(be, this).has(t) || a(be, this).set(t, {
235
238
  d: [],
236
239
  m: []
237
- });
238
- }
239
- unskip_effect(t) {
240
- var r = l(Se, this).get(t);
241
- if (r) {
242
- l(Se, this).delete(t);
243
- for (var i of r.d)
244
- R(i, ce), this.schedule(i);
245
- for (i of r.m)
246
- R(i, Pe), this.schedule(i);
240
+ }), a(Tt, this).delete(t);
241
+ }
242
+ unskip_effect(t, r = (i) => this.schedule(i)) {
243
+ var i = a(be, this).get(t);
244
+ if (i) {
245
+ a(be, this).delete(t);
246
+ for (var n of i.d)
247
+ O(n, le), r(n);
248
+ for (n of i.m)
249
+ O(n, Fe), r(n);
247
250
  }
251
+ a(Tt, this).add(t);
248
252
  }
249
- capture(t, r) {
250
- r !== M && !this.previous.has(t) && this.previous.set(t, r), t.f & 8388608 || (this.current.set(t, t.v), F?.set(t, t.v));
253
+ capture(t, r, i = !1) {
254
+ t.v !== M && !this.previous.has(t) && this.previous.set(t, t.v), t.f & 8388608 || (this.current.set(t, [r, i]), x?.set(t, r)), this.is_fork || (t.v = r);
251
255
  }
252
256
  activate() {
253
- C = this;
257
+ I = this;
254
258
  }
255
259
  deactivate() {
256
- C = null, F = null;
260
+ I = null, x = null;
257
261
  }
258
262
  flush() {
259
263
  var t = null;
260
264
  try {
261
- Ht = !0, C = this, E(re, this, ai).call(this);
265
+ zt = !0, I = this, S(F, this, dr).call(this);
262
266
  } finally {
263
- si = 0, jt = null, We = null, It = null, Ht = !1, C = null, F = null, me.clear();
267
+ vi = 0, Ut = null, Ye = null, Ot = null, zt = !1, I = null, x = null, xe.clear();
264
268
  }
265
269
  }
266
270
  discard() {
267
- for (const t of l(dt, this)) t(this);
268
- l(dt, this).clear(), le.delete(this);
271
+ for (const t of a(gt, this)) t(this);
272
+ a(gt, this).clear(), a(tt, this).clear(), oe.delete(this);
269
273
  }
270
- increment(t) {
271
- b(Ne, this, l(Ne, this) + 1), t && b(De, this, l(De, this) + 1);
274
+ register_created_effect(t) {
275
+ a(Yt, this).push(t);
272
276
  }
273
- decrement(t, r) {
274
- b(Ne, this, l(Ne, this) - 1), t && b(De, this, l(De, this) - 1), !(l(ft, this) || r) && (b(ft, this, !0), Ge(() => {
275
- b(ft, this, !1), this.flush();
277
+ increment(t, r) {
278
+ let i = a(ke, this).get(r) ?? 0;
279
+ if (a(ke, this).set(r, i + 1), t) {
280
+ let n = a(ye, this).get(r) ?? 0;
281
+ a(ye, this).set(r, n + 1);
282
+ }
283
+ }
284
+ decrement(t, r, i) {
285
+ let n = a(ke, this).get(r) ?? 0;
286
+ if (n === 1 ? a(ke, this).delete(r) : a(ke, this).set(r, n - 1), t) {
287
+ let o = a(ye, this).get(r) ?? 0;
288
+ o === 1 ? a(ye, this).delete(r) : a(ye, this).set(r, o - 1);
289
+ }
290
+ a(mt, this) || i || (b(mt, this, !0), Ue(() => {
291
+ b(mt, this, !1), this.flush();
276
292
  }));
277
293
  }
278
294
  transfer_effects(t, r) {
279
- for (const i of t) l(rt, this).add(i);
280
- for (const i of r) l(Ce, this).add(i);
295
+ for (const i of t) a(Xe, this).add(i);
296
+ for (const i of r) a(Re, this).add(i);
281
297
  t.clear(), r.clear();
282
298
  }
283
299
  oncommit(t) {
284
- l(Et, this).add(t);
300
+ a(Rt, this).add(t);
285
301
  }
286
302
  ondiscard(t) {
287
- l(dt, this).add(t);
303
+ a(gt, this).add(t);
304
+ }
305
+ on_fork_commit(t) {
306
+ a(tt, this).add(t);
307
+ }
308
+ run_fork_commit_callbacks() {
309
+ for (const t of a(tt, this)) t(this);
310
+ a(tt, this).clear();
288
311
  }
289
312
  settled() {
290
- return (l(mt, this) ?? b(mt, this, on())).promise;
313
+ return (a(wt, this) ?? b(wt, this, gn())).promise;
291
314
  }
292
315
  static ensure() {
293
- if (C === null) {
294
- const t = C = new oi();
295
- Ht || (le.add(C), Ze || Ge(() => {
296
- C === t && t.flush();
316
+ if (I === null) {
317
+ const t = I = new gi();
318
+ zt || (oe.add(I), ot || Ue(() => {
319
+ I === t && t.flush();
297
320
  }));
298
321
  }
299
- return C;
322
+ return I;
300
323
  }
301
324
  apply() {
302
- if (!Re || !this.is_fork && le.size === 1) {
303
- F = null;
325
+ if (!we || !this.is_fork && oe.size === 1) {
326
+ x = null;
304
327
  return;
305
328
  }
306
- F = new Map(this.current);
307
- for (const t of le)
308
- if (!(t === this || t.is_fork))
309
- for (const [r, i] of t.previous) F.has(r) || F.set(r, i);
329
+ x = /* @__PURE__ */ new Map();
330
+ for (const [i, [n]] of this.current) x.set(i, n);
331
+ for (const i of oe)
332
+ if (!(i === this || i.is_fork)) {
333
+ var t = !1, r = !1;
334
+ if (i.id < this.id) for (const [n, [, o]] of i.current)
335
+ o || (t || (t = this.current.has(n)), r || (r = !this.current.has(n)));
336
+ if (t && r) a(qe, this).add(i);
337
+ else for (const [n, o] of i.previous) x.has(n) || x.set(n, o);
338
+ }
310
339
  }
311
340
  schedule(t) {
312
- if (jt = t, t.b?.is_pending && t.f & 16777228 && !(t.f & 32768)) {
341
+ if (Ut = t, t.b?.is_pending && t.f & 16777228 && !(t.f & 32768)) {
313
342
  t.b.defer_effect(t);
314
343
  return;
315
344
  }
316
345
  for (var r = t; r.parent !== null; ) {
317
346
  r = r.parent;
318
347
  var i = r.f;
319
- if (We !== null && r === T && (Re || (w === null || !(w.f & 2)) && !Cn))
348
+ if (Ye !== null && r === A && (we || (T === null || !(T.f & 2)) && !Fn))
320
349
  return;
321
350
  if (i & 96) {
322
351
  if (!(i & 1024)) return;
323
- r.f ^= ee;
352
+ r.f ^= re;
324
353
  }
325
354
  }
326
- l(U, this).push(r);
355
+ a(Q, this).push(r);
327
356
  }
328
357
  };
329
- ni = Ke;
330
- function br() {
331
- return this.is_fork || l(De, this) > 0;
332
- }
333
- function ai() {
334
- if (si++ > 1e3 && (le.delete(this), Rn()), !E(re, this, br).call(this)) {
335
- for (const o of l(rt, this))
336
- l(Ce, this).delete(o), R(o, ce), this.schedule(o);
337
- for (const o of l(Ce, this))
338
- R(o, Pe), this.schedule(o);
339
- }
340
- const e = l(U, this);
341
- b(U, this, []), this.apply();
342
- var t = We = [], r = [], i = It = [];
343
- for (const o of e) try {
344
- E(re, this, li).call(this, o, t, r);
345
- } catch (a) {
346
- throw fi(o), a;
347
- }
348
- if (C = null, i.length > 0) {
349
- var n = ni.ensure();
350
- for (const o of i) n.schedule(o);
351
- }
352
- if (We = null, It = null, E(re, this, br).call(this)) {
353
- E(re, this, wr).call(this, r), E(re, this, wr).call(this, t);
354
- for (const [o, a] of l(Se, this)) di(o, a);
358
+ pi = Je;
359
+ function Xt() {
360
+ return this.is_fork || a(ye, this).size > 0;
361
+ }
362
+ function zn() {
363
+ for (const r of a(qe, this)) for (const i of a(ye, r).keys()) {
364
+ for (var e = !1, t = i; t.parent !== null; ) {
365
+ if (a(be, this).has(t)) {
366
+ e = !0;
367
+ break;
368
+ }
369
+ t = t.parent;
370
+ }
371
+ if (!e) return !0;
372
+ }
373
+ return !1;
374
+ }
375
+ function dr() {
376
+ if (vi++ > 1e3 && (oe.delete(this), Gn()), !S(F, this, Xt).call(this)) {
377
+ for (const s of a(Xe, this))
378
+ a(Re, this).delete(s), O(s, le), this.schedule(s);
379
+ for (const s of a(Re, this))
380
+ O(s, Fe), this.schedule(s);
381
+ }
382
+ const e = a(Q, this);
383
+ b(Q, this, []), this.apply();
384
+ var t = Ye = [], r = [], i = Ot = [];
385
+ for (const s of e) try {
386
+ S(F, this, mi).call(this, s, t, r);
387
+ } catch (l) {
388
+ throw bi(s), l;
389
+ }
390
+ if (I = null, i.length > 0) {
391
+ var n = pi.ensure();
392
+ for (const s of i) n.schedule(s);
393
+ }
394
+ if (Ye = null, Ot = null, S(F, this, Xt).call(this) || S(F, this, zn).call(this)) {
395
+ S(F, this, Qt).call(this, r), S(F, this, Qt).call(this, t);
396
+ for (const [s, l] of a(be, this)) yi(s, l);
355
397
  } else {
356
- l(Ne, this) === 0 && le.delete(this), l(rt, this).clear(), l(Ce, this).clear();
357
- for (const o of l(Et, this)) o(this);
358
- l(Et, this).clear(), yr = this, Tr(r), Tr(t), yr = null, l(mt, this)?.resolve();
398
+ a(ke, this).size === 0 && oe.delete(this), a(Xe, this).clear(), a(Re, this).clear();
399
+ for (const s of a(Rt, this)) s(this);
400
+ a(Rt, this).clear(), Or = this, Rr(r), Rr(t), Or = null, a(wt, this)?.resolve();
359
401
  }
360
- var s = C;
361
- if (l(U, this).length > 0) {
362
- const o = s ?? (s = this);
363
- l(U, o).push(...l(U, this).filter((a) => !l(U, o).includes(a)));
402
+ var o = I;
403
+ if (a(Q, this).length > 0) {
404
+ const s = o ?? (o = this);
405
+ a(Q, s).push(...a(Q, this).filter((l) => !a(Q, s).includes(l)));
364
406
  }
365
- s !== null && (le.add(s), E(re, s, ai).call(s)), le.has(this) || E(re, this, Ln).call(this);
407
+ o !== null && (oe.add(o), S(F, o, dr).call(o)), we && !oe.has(this) && S(F, this, Vn).call(this);
366
408
  }
367
- function li(e, t, r) {
368
- e.f ^= ee;
409
+ function mi(e, t, r) {
410
+ e.f ^= re;
369
411
  for (var i = e.first; i !== null; ) {
370
- var n = i.f, s = (n & 96) !== 0;
371
- if (!(s && n & 1024 || n & 8192 || l(Se, this).has(i)) && i.fn !== null) {
372
- s ? i.f ^= ee : n & 4 ? t.push(i) : Re && n & 16777224 ? r.push(i) : lt(i) && (n & 16 && l(Ce, this).add(i), qe(i));
373
- var o = i.first;
374
- if (o !== null) {
375
- i = o;
412
+ var n = i.f, o = (n & 96) !== 0;
413
+ if (!(o && n & 1024 || n & 8192 || a(be, this).has(i)) && i.fn !== null) {
414
+ o ? i.f ^= re : n & 4 ? t.push(i) : we && n & 16777224 ? r.push(i) : ht(i) && (n & 16 && a(Re, this).add(i), Qe(i));
415
+ var s = i.first;
416
+ if (s !== null) {
417
+ i = s;
376
418
  continue;
377
419
  }
378
420
  }
379
421
  for (; i !== null; ) {
380
- var a = i.next;
381
- if (a !== null) {
382
- i = a;
422
+ var l = i.next;
423
+ if (l !== null) {
424
+ i = l;
383
425
  break;
384
426
  }
385
427
  i = i.parent;
386
428
  }
387
429
  }
388
430
  }
389
- function wr(e) {
390
- for (var t = 0; t < e.length; t += 1) ri(e[t], l(rt, this), l(Ce, this));
431
+ function Qt(e) {
432
+ for (var t = 0; t < e.length; t += 1) fi(e[t], a(Xe, this), a(Re, this));
391
433
  }
392
- function Ln() {
393
- for (const a of le) {
394
- var e = a.id < this.id, t = [];
395
- for (const [c, p] of this.current) {
396
- if (a.current.has(c)) if (e && p !== a.current.get(c)) a.current.set(c, p);
397
- else continue;
398
- t.push(c);
399
- }
400
- var r = [...a.current.keys()].filter((c) => !this.current.has(c));
401
- if (r.length === 0)
402
- e && a.discard();
434
+ function Vn() {
435
+ for (const d of oe) {
436
+ var e = d.id < this.id, t = [];
437
+ for (const [f, [v, h]] of this.current) {
438
+ if (d.current.has(f)) {
439
+ var r = d.current.get(f)[0];
440
+ if (e && v !== r) d.current.set(f, [v, h]);
441
+ else continue;
442
+ }
443
+ t.push(f);
444
+ }
445
+ var i = [...d.current.keys()].filter((f) => !this.current.has(f));
446
+ if (i.length === 0)
447
+ e && d.discard();
403
448
  else if (t.length > 0) {
404
- a.activate();
405
- var i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
406
- for (var s of t) ci(s, r, i, n);
407
- if (l(U, a).length > 0) {
408
- a.apply();
409
- for (var o of l(U, a)) E(re, a, li).call(a, o, [], []);
410
- b(U, a, []);
449
+ if (e) for (const f of a(Tt, this)) d.unskip_effect(f, (v) => {
450
+ v.f & 4194320 ? d.schedule(v) : S(F, d, Qt).call(d, [v]);
451
+ });
452
+ d.activate();
453
+ var n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
454
+ for (var s of t) _i(s, i, n, o);
455
+ o = /* @__PURE__ */ new Map();
456
+ var l = [...d.current.keys()].filter((f) => this.current.has(f) ? this.current.get(f)[0] !== f : !0);
457
+ for (const f of a(Yt, this)) !(f.f & 155648) && fr(f, l, o) && (f.f & 4194320 ? (O(f, le), d.schedule(f)) : a(Xe, d).add(f));
458
+ if (a(Q, d).length > 0) {
459
+ d.apply();
460
+ for (var c of a(Q, d)) S(F, d, mi).call(d, c, [], []);
461
+ b(Q, d, []);
411
462
  }
412
- a.deactivate();
463
+ d.deactivate();
413
464
  }
414
465
  }
466
+ for (const d of oe) a(qe, d).has(this) && (a(qe, d).delete(this), a(qe, d).size === 0 && !S(F, d, Xt).call(d) && (d.activate(), S(F, d, dr).call(d)));
415
467
  }
416
- function se(e) {
417
- var t = Ze;
418
- Ze = !0;
468
+ function ue(e) {
469
+ var t = ot;
470
+ ot = !0;
419
471
  try {
420
472
  var r;
421
- for (e && (C !== null && !C.is_fork && C.flush(), r = e()); ; ) {
422
- if (En(), C === null) return r;
423
- C.flush();
473
+ for (e && (I !== null && !I.is_fork && I.flush(), r = e()); ; ) {
474
+ if (Nn(), I === null) return r;
475
+ I.flush();
424
476
  }
425
477
  } finally {
426
- Ze = t;
478
+ ot = t;
427
479
  }
428
480
  }
429
- function Rn() {
481
+ function Gn() {
430
482
  if (0) {
431
483
  var e;
432
- for (const r of C.current.keys()) for (const [i, n] of r.updated ?? [])
484
+ for (const r of I.current.keys()) for (const [i, n] of r.updated ?? [])
433
485
  var t;
434
486
  }
435
487
  try {
436
- pn();
488
+ Sn();
437
489
  } catch (r) {
438
- Ve(r, jt);
490
+ Ge(r, Ut);
439
491
  }
440
492
  }
441
- var ae = null;
442
- function Tr(e) {
493
+ var de = null;
494
+ function Rr(e) {
443
495
  var t = e.length;
444
496
  if (t !== 0) {
445
497
  for (var r = 0; r < t; ) {
446
498
  var i = e[r++];
447
- if (!(i.f & 24576) && lt(i) && (ae = /* @__PURE__ */ new Set(), qe(i), i.deps === null && i.first === null && i.nodes === null && i.teardown === null && i.ac === null && ki(i), ae?.size > 0)) {
448
- me.clear();
449
- for (const n of ae) {
499
+ if (!(i.f & 24576) && ht(i) && (de = /* @__PURE__ */ new Set(), Qe(i), i.deps === null && i.first === null && i.nodes === null && i.teardown === null && i.ac === null && Hi(i), de?.size > 0)) {
500
+ xe.clear();
501
+ for (const n of de) {
450
502
  if (n.f & 24576) continue;
451
- const s = [n];
452
- let o = n.parent;
453
- for (; o !== null; )
454
- ae.has(o) && (ae.delete(o), s.push(o)), o = o.parent;
455
- for (let a = s.length - 1; a >= 0; a--) {
456
- const c = s[a];
457
- c.f & 24576 || qe(c);
503
+ const o = [n];
504
+ let s = n.parent;
505
+ for (; s !== null; )
506
+ de.has(s) && (de.delete(s), o.push(s)), s = s.parent;
507
+ for (let l = o.length - 1; l >= 0; l--) {
508
+ const c = o[l];
509
+ c.f & 24576 || Qe(c);
458
510
  }
459
511
  }
460
- ae.clear();
512
+ de.clear();
461
513
  }
462
514
  }
463
- ae = null;
515
+ de = null;
464
516
  }
465
517
  }
466
- function ci(e, t, r, i) {
518
+ function _i(e, t, r, i) {
467
519
  if (!r.has(e) && (r.add(e), e.reactions !== null))
468
520
  for (const n of e.reactions) {
469
- const s = n.f;
470
- s & 2 ? ci(n, t, r, i) : s & 4194320 && !(s & 2048) && ui(n, t, i) && (R(n, ce), tr(n));
521
+ const o = n.f;
522
+ o & 2 ? _i(n, t, r, i) : o & 4194320 && !(o & 2048) && fr(n, t, i) && (O(n, le), hr(n));
471
523
  }
472
524
  }
473
- function ui(e, t, r) {
525
+ function fr(e, t, r) {
474
526
  const i = r.get(e);
475
527
  if (i !== void 0) return i;
476
528
  if (e.deps !== null) for (const n of e.deps) {
477
- if (ze.call(t, n)) return !0;
478
- if (n.f & 2 && ui(n, t, r))
529
+ if (Ke.call(t, n)) return !0;
530
+ if (n.f & 2 && fr(n, t, r))
479
531
  return r.set(n, !0), !0;
480
532
  }
481
533
  return r.set(e, !1), !1;
482
534
  }
483
- function tr(e) {
484
- C.schedule(e);
535
+ function hr(e) {
536
+ I.schedule(e);
485
537
  }
486
- function di(e, t) {
538
+ function yi(e, t) {
487
539
  if (!(e.f & 32 && e.f & 1024)) {
488
- e.f & 2048 ? t.d.push(e) : e.f & 4096 && t.m.push(e), R(e, ee);
540
+ e.f & 2048 ? t.d.push(e) : e.f & 4096 && t.m.push(e), O(e, re);
489
541
  for (var r = e.first; r !== null; )
490
- di(r, t), r = r.next;
542
+ yi(r, t), r = r.next;
491
543
  }
492
544
  }
493
- function fi(e) {
494
- R(e, ee);
545
+ function bi(e) {
546
+ O(e, re);
495
547
  for (var t = e.first; t !== null; )
496
- fi(t), t = t.next;
548
+ bi(t), t = t.next;
497
549
  }
498
- function Mn(e) {
499
- let t = 0, r = Ot(0), i;
550
+ function Wn(e) {
551
+ let t = 0, r = Ht(0), i;
500
552
  return () => {
501
- sr() && (g(r), or(() => (t === 0 && (i = Rt(() => e(() => et(r)))), t += 1, () => {
502
- Ge(() => {
503
- t -= 1, t === 0 && (i?.(), i = void 0, et(r));
553
+ mr() && (m(r), _r(() => (t === 0 && (i = Dt(() => e(() => st(r)))), t += 1, () => {
554
+ Ue(() => {
555
+ t -= 1, t === 0 && (i?.(), i = void 0, st(r));
504
556
  });
505
557
  })));
506
558
  };
507
559
  }
508
- var Pn = Gr | st;
509
- function xn(e, t, r, i) {
510
- new Hn(e, t, r, i);
560
+ var qn = ei | ut;
561
+ function Kn(e, t, r, i) {
562
+ new Un(e, t, r, i);
511
563
  }
512
- var X = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), Ar = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakSet(), Hn = class {
564
+ var ee = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Me = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), er = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), Mr = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakSet(), Un = class {
513
565
  constructor(e, t, r, i) {
514
- er(this, N), u(this, "parent", void 0), u(this, "is_pending", !1), u(this, "transform_error", void 0), A(this, X, void 0), A(this, Nt, Y ? x : null), A(this, pe, void 0), A(this, it, void 0), A(this, z, void 0), A(this, ve, null), A(this, Q, null), A(this, oe, null), A(this, $e, null), A(this, Fe, 0), A(this, Oe, 0), A(this, ht, !1), A(this, zt, /* @__PURE__ */ new Set()), A(this, Gt, /* @__PURE__ */ new Set()), A(this, we, null), A(this, Ar, Mn(() => (b(we, this, Ot(l(Fe, this))), () => {
515
- b(we, this, null);
516
- }))), b(X, this, e), b(pe, this, t), b(it, this, (n) => {
517
- var s = T;
518
- s.b = this, s.f |= 128, r(n);
519
- }), this.parent = T.b, this.transform_error = i ?? this.parent?.transform_error ?? ((n) => n), b(z, this, ts(() => {
520
- if (Y) {
521
- const n = l(Nt, this);
522
- Ur();
523
- const s = n.data === "[!";
566
+ ur(this, P), u(this, "parent", void 0), u(this, "is_pending", !1), u(this, "transform_error", void 0), w(this, ee, void 0), w(this, Jt, Z ? N : null), w(this, ne, void 0), w(this, lt, void 0), w(this, q, void 0), w(this, se, null), w(this, V, null), w(this, X, null), w(this, Me, null), w(this, ze, 0), w(this, Pe, 0), w(this, _t, !1), w(this, Zt, /* @__PURE__ */ new Set()), w(this, er, /* @__PURE__ */ new Set()), w(this, Ie, null), w(this, Mr, Wn(() => (b(Ie, this, Ht(a(ze, this))), () => {
567
+ b(Ie, this, null);
568
+ }))), b(ee, this, e), b(ne, this, t), b(lt, this, (n) => {
569
+ var o = A;
570
+ o.b = this, o.f |= 128, r(n);
571
+ }), this.parent = A.b, this.transform_error = i ?? this.parent?.transform_error ?? ((n) => n), b(q, this, ho(() => {
572
+ if (Z) {
573
+ const n = a(Jt, this);
574
+ ni();
575
+ const o = n.data === "[!";
524
576
  if (n.data.startsWith("[?")) {
525
- const o = JSON.parse(n.data.slice(2));
526
- E(N, this, Dn).call(this, o);
527
- } else s ? E(N, this, Fn).call(this) : E(N, this, Nn).call(this);
528
- } else E(N, this, Sr).call(this);
529
- }, Pn)), Y && b(X, this, x);
577
+ const s = JSON.parse(n.data.slice(2));
578
+ S(P, this, Xn).call(this, s);
579
+ } else o ? S(P, this, Qn).call(this) : S(P, this, Yn).call(this);
580
+ } else S(P, this, wi).call(this);
581
+ }, qn)), Z && b(ee, this, N);
530
582
  }
531
583
  defer_effect(e) {
532
- ri(e, l(zt, this), l(Gt, this));
584
+ fi(e, a(Zt, this), a(er, this));
533
585
  }
534
586
  is_rendered() {
535
587
  return !this.is_pending && (!this.parent || this.parent.is_rendered());
536
588
  }
537
589
  has_pending_snippet() {
538
- return !!l(pe, this).pending;
590
+ return !!a(ne, this).pending;
539
591
  }
540
592
  update_pending_count(e, t) {
541
- E(N, this, hi).call(this, e, t), b(Fe, this, l(Fe, this) + e), !(!l(we, this) || l(ht, this)) && (b(ht, this, !0), Ge(() => {
542
- b(ht, this, !1), l(we, this) && gi(l(we, this), l(Fe, this));
593
+ S(P, this, Ti).call(this, e, t), b(ze, this, a(ze, this) + e), !(!a(Ie, this) || a(_t, this)) && (b(_t, this, !0), Ue(() => {
594
+ b(_t, this, !1), a(Ie, this) && Ei(a(Ie, this), a(ze, this));
543
595
  }));
544
596
  }
545
597
  get_effect_pending() {
546
- return l(Ar, this).call(this), g(l(we, this));
598
+ return a(Mr, this).call(this), m(a(Ie, this));
547
599
  }
548
600
  error(e) {
549
- var t = l(pe, this).onerror;
550
- let r = l(pe, this).failed;
551
- if (!t && !r) throw e;
552
- l(ve, this) && (Z(l(ve, this)), b(ve, this, null)), l(Q, this) && (Z(l(Q, this)), b(Q, this, null)), l(oe, this) && (Z(l(oe, this)), b(oe, this, null)), Y && (tt(l(Nt, this)), Tn(), tt(An()));
553
- var i = !1, n = !1;
554
- const s = () => {
555
- if (i) {
556
- wn();
557
- return;
558
- }
559
- i = !0, n && bn(), l(oe, this) !== null && Lt(l(oe, this), () => {
560
- b(oe, this, null);
561
- }), E(N, this, Wt).call(this, () => {
562
- E(N, this, Sr).call(this);
563
- });
564
- }, o = (a) => {
565
- try {
566
- n = !0, t?.(a, s), n = !1;
567
- } catch (c) {
568
- Ve(c, l(z, this) && l(z, this).parent);
569
- }
570
- r && b(oe, this, E(N, this, Wt).call(this, () => {
571
- try {
572
- return Me(() => {
573
- var c = T;
574
- c.b = this, c.f |= 128, r(l(X, this), () => a, () => s);
575
- });
576
- } catch (c) {
577
- return Ve(c, l(z, this).parent), null;
578
- }
579
- }));
580
- };
581
- Ge(() => {
582
- var a;
583
- try {
584
- a = this.transform_error(e);
585
- } catch (c) {
586
- Ve(c, l(z, this) && l(z, this).parent);
587
- return;
588
- }
589
- a !== null && typeof a == "object" && typeof a.then == "function" ? a.then(o, (c) => Ve(c, l(z, this) && l(z, this).parent)) : o(a);
590
- });
601
+ if (!a(ne, this).onerror && !a(ne, this).failed) throw e;
602
+ I?.is_fork ? (a(se, this) && I.skip_effect(a(se, this)), a(V, this) && I.skip_effect(a(V, this)), a(X, this) && I.skip_effect(a(X, this)), I.on_fork_commit(() => {
603
+ S(P, this, Pr).call(this, e);
604
+ })) : S(P, this, Pr).call(this, e);
591
605
  }
592
606
  };
593
- function Nn() {
607
+ function Yn() {
594
608
  try {
595
- b(ve, this, Me(() => l(it, this).call(this, l(X, this))));
609
+ b(se, this, De(() => a(lt, this).call(this, a(ee, this))));
596
610
  } catch (e) {
597
611
  this.error(e);
598
612
  }
599
613
  }
600
- function Dn(e) {
601
- const t = l(pe, this).failed;
602
- t && b(oe, this, Me(() => {
603
- t(l(X, this), () => e, () => () => {
614
+ function Xn(e) {
615
+ const t = a(ne, this).failed;
616
+ t && b(X, this, De(() => {
617
+ t(a(ee, this), () => e, () => () => {
604
618
  });
605
619
  }));
606
620
  }
607
- function Fn() {
608
- const e = l(pe, this).pending;
609
- e && (this.is_pending = !0, b(Q, this, Me(() => e(l(X, this)))), Ge(() => {
610
- var t = b($e, this, document.createDocumentFragment()), r = Ti();
611
- t.append(r), b(ve, this, E(N, this, Wt).call(this, () => Me(() => l(it, this).call(this, r)))), l(Oe, this) === 0 && (l(X, this).before(t), b($e, this, null), Lt(l(Q, this), () => {
612
- b(Q, this, null);
613
- }), E(N, this, rr).call(this, C));
621
+ function Qn() {
622
+ const e = a(ne, this).pending;
623
+ e && (this.is_pending = !0, b(V, this, De(() => e(a(ee, this)))), Ue(() => {
624
+ var t = b(Me, this, document.createDocumentFragment()), r = Oi();
625
+ t.append(r), b(se, this, S(P, this, tr).call(this, () => De(() => a(lt, this).call(this, r)))), a(Pe, this) === 0 && (a(ee, this).before(t), b(Me, this, null), Nt(a(V, this), () => {
626
+ b(V, this, null);
627
+ }), S(P, this, pr).call(this, I));
614
628
  }));
615
629
  }
616
- function Sr() {
630
+ function wi() {
617
631
  try {
618
- if (this.is_pending = this.has_pending_snippet(), b(Oe, this, 0), b(Fe, this, 0), b(ve, this, Me(() => {
619
- l(it, this).call(this, l(X, this));
620
- })), l(Oe, this) > 0) {
621
- var e = b($e, this, document.createDocumentFragment());
622
- ns(l(ve, this), e);
623
- const t = l(pe, this).pending;
624
- b(Q, this, Me(() => t(l(X, this))));
625
- } else E(N, this, rr).call(this, C);
632
+ if (this.is_pending = this.has_pending_snippet(), b(Pe, this, 0), b(ze, this, 0), b(se, this, De(() => {
633
+ a(lt, this).call(this, a(ee, this));
634
+ })), a(Pe, this) > 0) {
635
+ var e = b(Me, this, document.createDocumentFragment());
636
+ go(a(se, this), e);
637
+ const t = a(ne, this).pending;
638
+ b(V, this, De(() => t(a(ee, this))));
639
+ } else S(P, this, pr).call(this, I);
626
640
  } catch (t) {
627
641
  this.error(t);
628
642
  }
629
643
  }
630
- function rr(e) {
631
- this.is_pending = !1, e.transfer_effects(l(zt, this), l(Gt, this));
644
+ function pr(e) {
645
+ this.is_pending = !1, e.transfer_effects(a(Zt, this), a(er, this));
632
646
  }
633
- function Wt(e) {
634
- var t = T, r = w, i = O;
635
- _e(l(z, this)), ie(l(z, this)), St(l(z, this).ctx);
647
+ function tr(e) {
648
+ var t = A, r = T, i = L;
649
+ Te(a(q, this)), ae(a(q, this)), Lt(a(q, this).ctx);
636
650
  try {
637
- return Ke.ensure(), e();
651
+ return Je.ensure(), e();
638
652
  } catch (n) {
639
- return ei(n), null;
653
+ return ui(n), null;
640
654
  } finally {
641
- _e(t), ie(r), St(i);
655
+ Te(t), ae(r), Lt(i);
642
656
  }
643
657
  }
644
- function hi(e, t) {
658
+ function Ti(e, t) {
645
659
  if (!this.has_pending_snippet()) {
646
660
  if (this.parent) {
647
661
  var r;
648
- E(N, r = this.parent, hi).call(r, e, t);
662
+ S(P, r = this.parent, Ti).call(r, e, t);
649
663
  }
650
664
  return;
651
665
  }
652
- b(Oe, this, l(Oe, this) + e), l(Oe, this) === 0 && (E(N, this, rr).call(this, t), l(Q, this) && Lt(l(Q, this), () => {
653
- b(Q, this, null);
654
- }), l($e, this) && (l(X, this).before(l($e, this)), b($e, this, null)));
666
+ b(Pe, this, a(Pe, this) + e), a(Pe, this) === 0 && (S(P, this, pr).call(this, t), a(V, this) && Nt(a(V, this), () => {
667
+ b(V, this, null);
668
+ }), a(Me, this) && (a(ee, this).before(a(Me, this)), b(Me, this, null)));
669
+ }
670
+ function Pr(e) {
671
+ a(se, this) && (te(a(se, this)), b(se, this, null)), a(V, this) && (te(a(V, this)), b(V, this, null)), a(X, this) && (te(a(X, this)), b(X, this, null)), Z && (at(a(Jt, this)), Mn(), at(Pn()));
672
+ var t = a(ne, this).onerror;
673
+ let r = a(ne, this).failed;
674
+ var i = !1, n = !1;
675
+ const o = () => {
676
+ if (i) {
677
+ Rn();
678
+ return;
679
+ }
680
+ i = !0, n && Ln(), a(X, this) !== null && Nt(a(X, this), () => {
681
+ b(X, this, null);
682
+ }), S(P, this, tr).call(this, () => {
683
+ S(P, this, wi).call(this);
684
+ });
685
+ }, s = (l) => {
686
+ try {
687
+ n = !0, t?.(l, o), n = !1;
688
+ } catch (c) {
689
+ Ge(c, a(q, this) && a(q, this).parent);
690
+ }
691
+ r && b(X, this, S(P, this, tr).call(this, () => {
692
+ try {
693
+ return De(() => {
694
+ var c = A;
695
+ c.b = this, c.f |= 128, r(a(ee, this), () => l, () => o);
696
+ });
697
+ } catch (c) {
698
+ return Ge(c, a(q, this).parent), null;
699
+ }
700
+ }));
701
+ };
702
+ Ue(() => {
703
+ var l;
704
+ try {
705
+ l = this.transform_error(e);
706
+ } catch (c) {
707
+ Ge(c, a(q, this) && a(q, this).parent);
708
+ return;
709
+ }
710
+ l !== null && typeof l == "object" && typeof l.then == "function" ? l.then(s, (c) => Ge(c, a(q, this) && a(q, this).parent)) : s(l);
711
+ });
655
712
  }
656
713
  // @__NO_SIDE_EFFECTS__
657
- function ir(e) {
658
- var t = 2 | ce, r = w !== null && w.f & 2 ? w : null;
659
- return T !== null && (T.f |= st), {
660
- ctx: O,
714
+ function vr(e) {
715
+ var t = 2 | le;
716
+ return A !== null && (A.f |= ut), {
717
+ ctx: L,
661
718
  deps: null,
662
719
  effects: null,
663
- equals: Yr,
720
+ equals: oi,
664
721
  f: t,
665
722
  fn: e,
666
723
  reactions: null,
667
724
  rv: 0,
668
725
  v: M,
669
726
  wv: 0,
670
- parent: r ?? T,
727
+ parent: A,
671
728
  ac: null
672
729
  };
673
730
  }
674
731
  // @__NO_SIDE_EFFECTS__
675
- function Ir(e) {
676
- const t = /* @__PURE__ */ ir(e);
677
- return Re || $i(t), t;
732
+ function xr(e) {
733
+ const t = /* @__PURE__ */ vr(e);
734
+ return we || Di(t), t;
678
735
  }
679
736
  // @__NO_SIDE_EFFECTS__
680
- function Bn(e) {
681
- const t = /* @__PURE__ */ ir(e);
682
- return t.equals = Xr, t;
737
+ function Jn(e) {
738
+ const t = /* @__PURE__ */ vr(e);
739
+ return t.equals = si, t;
683
740
  }
684
- function Vn(e) {
741
+ function Zn(e) {
685
742
  var t = e.effects;
686
743
  if (t !== null) {
687
744
  e.effects = null;
688
- for (var r = 0; r < t.length; r += 1) Z(t[r]);
745
+ for (var r = 0; r < t.length; r += 1) te(t[r]);
689
746
  }
690
747
  }
691
- function jn(e) {
692
- for (var t = e.parent; t !== null; ) {
693
- if (!(t.f & 2)) return t.f & 16384 ? null : t;
694
- t = t.parent;
695
- }
696
- return null;
697
- }
698
- function nr(e) {
699
- var t, r = T;
700
- if (_e(jn(e)), 0)
748
+ function gr(e) {
749
+ var t, r = A, i = e.parent;
750
+ if (!fe && i !== null && i.f & 24576)
751
+ return On(), e.v;
752
+ if (Te(i), 0)
701
753
  try {
702
754
  } finally {
703
755
  }
704
756
  else try {
705
- e.f &= ~ot, Vn(e), t = Mi(e);
757
+ e.f &= ~dt, Zn(e), t = zi(e);
706
758
  } finally {
707
- _e(r);
759
+ Te(r);
708
760
  }
709
761
  return t;
710
762
  }
711
- function pi(e) {
712
- var t = e.v, r = nr(e);
713
- if (!e.equals(r) && (e.wv = Li(), (!C?.is_fork || e.deps === null) && (e.v = r, C?.capture(e, t), e.deps === null))) {
714
- R(e, ee);
763
+ function Ai(e) {
764
+ var t = gr(e);
765
+ if (!e.equals(t) && (e.wv = Bi(), (!I?.is_fork || e.deps === null) && (I !== null ? I.capture(e, t, !0) : e.v = t, e.deps === null))) {
766
+ O(e, re);
715
767
  return;
716
768
  }
717
- ge || (F !== null ? (sr() || C?.is_fork) && F.set(e, r) : Zt(e));
769
+ fe || (x !== null ? (mr() || I?.is_fork) && x.set(e, t) : cr(e));
718
770
  }
719
- function zn(e) {
771
+ function eo(e) {
720
772
  if (e.effects !== null)
721
- for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Jt), t.teardown = nn, t.ac = null, nt(t, 0), ar(t));
773
+ for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(lr), t.teardown = pn, t.ac = null, ct(t, 0), yr(t));
722
774
  }
723
- function vi(e) {
775
+ function Si(e) {
724
776
  if (e.effects !== null)
725
- for (const t of e.effects) t.teardown && qe(t);
777
+ for (const t of e.effects) t.teardown && Qe(t);
726
778
  }
727
- var qt = /* @__PURE__ */ new Set(), me = /* @__PURE__ */ new Map();
728
- var mi = !1;
729
- function Ot(e, t) {
779
+ var rr = /* @__PURE__ */ new Set(), xe = /* @__PURE__ */ new Map();
780
+ var Ii = !1;
781
+ function Ht(e, t) {
730
782
  var r = {
731
783
  f: 0,
732
784
  v: e,
733
785
  reactions: null,
734
- equals: Yr,
786
+ equals: oi,
735
787
  rv: 0,
736
788
  wv: 0
737
789
  };
738
790
  return r;
739
791
  }
740
792
  // @__NO_SIDE_EFFECTS__
741
- function P(e, t) {
742
- const r = Ot(e, t);
743
- return $i(r), r;
793
+ function H(e, t) {
794
+ const r = Ht(e, t);
795
+ return Di(r), r;
744
796
  }
745
797
  // @__NO_SIDE_EFFECTS__
746
- function Gn(e, t = !1, r = !0) {
747
- const i = Ot(e);
748
- if (t || (i.equals = Xr), at && r && O !== null && O.l !== null) {
798
+ function to(e, t = !1, r = !0) {
799
+ const i = Ht(e);
800
+ if (t || (i.equals = si), ft && r && L !== null && L.l !== null) {
749
801
  var n;
750
- ((n = O.l).s ?? (n.s = [])).push(i);
802
+ ((n = L.l).s ?? (n.s = [])).push(i);
751
803
  }
752
804
  return i;
753
805
  }
754
806
  function $(e, t, r = !1) {
755
- w !== null && (!J || w.f & 131072) && $t() && w.f & 4325394 && (W === null || !ze.call(W, e)) && yn();
756
- let i = r ? je(t) : t;
757
- return gi(e, i, It);
807
+ T !== null && (!J || T.f & 131072) && xt() && T.f & 4325394 && (K === null || !Ke.call(K, e)) && $n();
808
+ let i = r ? We(t) : t;
809
+ return Ei(e, i, Ot);
758
810
  }
759
- function gi(e, t, r = null) {
811
+ function Ei(e, t, r = null) {
760
812
  if (!e.equals(t)) {
761
- var i = e.v;
762
- ge ? me.set(e, t) : me.set(e, i), e.v = t;
763
- var n = Ke.ensure();
764
- if (n.capture(e, i), e.f & 2) {
765
- const s = e;
766
- e.f & 2048 && nr(s), F === null && Zt(s);
813
+ xe.set(e, fe ? t : e.v);
814
+ var i = Je.ensure();
815
+ if (i.capture(e, t), e.f & 2) {
816
+ const n = e;
817
+ e.f & 2048 && gr(n), x === null && cr(n);
767
818
  }
768
- e.wv = Li(), _i(e, ce, r), $t() && T !== null && T.f & 1024 && !(T.f & 96) && (G === null ? os([e]) : G.push(e)), !n.is_fork && qt.size > 0 && !mi && Wn();
819
+ e.wv = Bi(), ki(e, le, r), xt() && A !== null && A.f & 1024 && !(A.f & 96) && (W === null ? _o([e]) : W.push(e)), !i.is_fork && rr.size > 0 && !Ii && ro();
769
820
  }
770
821
  return t;
771
822
  }
772
- function Wn() {
773
- mi = !1;
774
- for (const e of qt)
775
- e.f & 1024 && R(e, Pe), lt(e) && qe(e);
776
- qt.clear();
823
+ function ro() {
824
+ Ii = !1;
825
+ for (const e of rr)
826
+ e.f & 1024 && O(e, Fe), ht(e) && Qe(e);
827
+ rr.clear();
777
828
  }
778
- function et(e) {
829
+ function st(e) {
779
830
  $(e, e.v + 1);
780
831
  }
781
- function _i(e, t, r) {
832
+ function ki(e, t, r) {
782
833
  var i = e.reactions;
783
834
  if (i !== null)
784
- for (var n = $t(), s = i.length, o = 0; o < s; o++) {
785
- var a = i[o], c = a.f;
786
- if (!(!n && a === T)) {
787
- var p = (c & ce) === 0;
788
- if (p && R(a, t), c & 2) {
789
- var f = a;
790
- F?.delete(f), c & 65536 || (c & 512 && (a.f |= ot), _i(f, Pe, r));
791
- } else if (p) {
792
- var m = a;
793
- c & 16 && ae !== null && ae.add(m), r !== null ? r.push(m) : tr(m);
835
+ for (var n = xt(), o = i.length, s = 0; s < o; s++) {
836
+ var l = i[s], c = l.f;
837
+ if (!(!n && l === A)) {
838
+ var d = (c & le) === 0;
839
+ if (d && O(l, t), c & 2) {
840
+ var f = l;
841
+ x?.delete(f), c & 65536 || (c & 512 && (l.f |= dt), ki(f, Fe, r));
842
+ } else if (d) {
843
+ var v = l;
844
+ c & 16 && de !== null && de.add(v), r !== null ? r.push(v) : hr(v);
794
845
  }
795
846
  }
796
847
  }
797
848
  }
798
- var qn = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
799
- function je(e) {
800
- if (typeof e != "object" || e === null || Je in e) return e;
801
- const t = rn(e);
802
- if (t !== en && t !== tn) return e;
803
- var r = /* @__PURE__ */ new Map(), i = Qi(e), n = /* @__PURE__ */ P(0), s = null, o = Le, a = (m) => {
804
- if (Le === o) return m();
805
- var h = w, v = Le;
806
- ie(null), Cr(o);
807
- var d = m();
808
- return ie(h), Cr(v), d;
849
+ var io = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
850
+ function We(e) {
851
+ if (typeof e != "object" || e === null || nt in e) return e;
852
+ const t = hn(e);
853
+ if (t !== dn && t !== fn) return e;
854
+ var r = /* @__PURE__ */ new Map(), i = ln(e), n = /* @__PURE__ */ H(0), o = null, s = He, l = (v) => {
855
+ if (He === s) return v();
856
+ var h = T, g = He;
857
+ ae(null), Dr(s);
858
+ var p = v();
859
+ return ae(h), Dr(g), p;
809
860
  };
810
- i && r.set("length", /* @__PURE__ */ P(e.length, s));
861
+ i && r.set("length", /* @__PURE__ */ H(e.length, o));
811
862
  var c = "";
812
- let p = !1;
813
- function f(m) {
814
- if (!p) {
815
- p = !0, c = m, _r(n, `${c} version`);
816
- for (const [h, v] of r) _r(v, Kn(c, h));
817
- p = !1;
863
+ let d = !1;
864
+ function f(v) {
865
+ if (!d) {
866
+ d = !0, c = v, Lr(n, `${c} version`);
867
+ for (const [h, g] of r) Lr(g, no(c, h));
868
+ d = !1;
818
869
  }
819
870
  }
820
871
  return new Proxy(e, {
821
- defineProperty(m, h, v) {
822
- (!("value" in v) || v.configurable === !1 || v.enumerable === !1 || v.writable === !1) && gn();
823
- var d = r.get(h);
824
- return d === void 0 ? a(() => {
825
- var y = /* @__PURE__ */ P(v.value, s);
872
+ defineProperty(v, h, g) {
873
+ (!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && kn();
874
+ var p = r.get(h);
875
+ return p === void 0 ? l(() => {
876
+ var y = /* @__PURE__ */ H(g.value, o);
826
877
  return r.set(h, y), y;
827
- }) : $(d, v.value, !0), !0;
878
+ }) : $(p, g.value, !0), !0;
828
879
  },
829
- deleteProperty(m, h) {
830
- var v = r.get(h);
831
- if (v === void 0) {
832
- if (h in m) {
833
- const d = a(() => /* @__PURE__ */ P(M, s));
834
- r.set(h, d), et(n);
880
+ deleteProperty(v, h) {
881
+ var g = r.get(h);
882
+ if (g === void 0) {
883
+ if (h in v) {
884
+ const p = l(() => /* @__PURE__ */ H(M, o));
885
+ r.set(h, p), st(n);
835
886
  }
836
887
  } else
837
- $(v, M), et(n);
888
+ $(g, M), st(n);
838
889
  return !0;
839
890
  },
840
- get(m, h, v) {
841
- if (h === Je) return e;
842
- var d = r.get(h), y = h in m;
843
- if (d === void 0 && (!y || ke(m, h)?.writable) && (d = a(() => {
844
- var S = /* @__PURE__ */ P(je(y ? m[h] : M), s);
845
- return S;
846
- }), r.set(h, d)), d !== void 0) {
847
- var _ = g(d);
891
+ get(v, h, g) {
892
+ if (h === nt) return e;
893
+ var p = r.get(h), y = h in v;
894
+ if (p === void 0 && (!y || Oe(v, h)?.writable) && (p = l(() => {
895
+ var E = /* @__PURE__ */ H(We(y ? v[h] : M), o);
896
+ return E;
897
+ }), r.set(h, p)), p !== void 0) {
898
+ var _ = m(p);
848
899
  return _ === M ? void 0 : _;
849
900
  }
850
- return Reflect.get(m, h, v);
901
+ return Reflect.get(v, h, g);
851
902
  },
852
- getOwnPropertyDescriptor(m, h) {
853
- var v = Reflect.getOwnPropertyDescriptor(m, h);
854
- if (v && "value" in v) {
855
- var d = r.get(h);
856
- d && (v.value = g(d));
857
- } else if (v === void 0) {
903
+ getOwnPropertyDescriptor(v, h) {
904
+ var g = Reflect.getOwnPropertyDescriptor(v, h);
905
+ if (g && "value" in g) {
906
+ var p = r.get(h);
907
+ p && (g.value = m(p));
908
+ } else if (g === void 0) {
858
909
  var y = r.get(h), _ = y?.v;
859
910
  if (y !== void 0 && _ !== M) return {
860
911
  enumerable: !0,
@@ -863,106 +914,106 @@ function je(e) {
863
914
  writable: !0
864
915
  };
865
916
  }
866
- return v;
917
+ return g;
867
918
  },
868
- has(m, h) {
869
- if (h === Je) return !0;
870
- var v = r.get(h), d = v !== void 0 && v.v !== M || Reflect.has(m, h);
871
- return (v !== void 0 || T !== null && (!d || ke(m, h)?.writable)) && (v === void 0 && (v = a(() => {
872
- var y = /* @__PURE__ */ P(d ? je(m[h]) : M, s);
919
+ has(v, h) {
920
+ if (h === nt) return !0;
921
+ var g = r.get(h), p = g !== void 0 && g.v !== M || Reflect.has(v, h);
922
+ return (g !== void 0 || A !== null && (!p || Oe(v, h)?.writable)) && (g === void 0 && (g = l(() => {
923
+ var y = /* @__PURE__ */ H(p ? We(v[h]) : M, o);
873
924
  return y;
874
- }), r.set(h, v)), g(v) === M) ? !1 : d;
925
+ }), r.set(h, g)), m(g) === M) ? !1 : p;
875
926
  },
876
- set(m, h, v, d) {
877
- var y = r.get(h), _ = h in m;
878
- if (i && h === "length") for (var S = v; S < y.v; S += 1) {
879
- var B = r.get(S + "");
880
- B !== void 0 ? $(B, M) : S in m && (B = a(() => /* @__PURE__ */ P(M, s)), r.set(S + "", B));
927
+ set(v, h, g, p) {
928
+ var y = r.get(h), _ = h in v;
929
+ if (i && h === "length") for (var E = g; E < y.v; E += 1) {
930
+ var j = r.get(E + "");
931
+ j !== void 0 ? $(j, M) : E in v && (j = l(() => /* @__PURE__ */ H(M, o)), r.set(E + "", j));
881
932
  }
882
933
  if (y === void 0)
883
- (!_ || ke(m, h)?.writable) && (y = a(() => /* @__PURE__ */ P(void 0, s)), $(y, je(v)), r.set(h, y));
934
+ (!_ || Oe(v, h)?.writable) && (y = l(() => /* @__PURE__ */ H(void 0, o)), $(y, We(g)), r.set(h, y));
884
935
  else {
885
936
  _ = y.v !== M;
886
- var k = a(() => je(v));
887
- $(y, k);
937
+ var C = l(() => We(g));
938
+ $(y, C);
888
939
  }
889
- var q = Reflect.getOwnPropertyDescriptor(m, h);
890
- if (q?.set && q.set.call(d, v), !_) {
940
+ var U = Reflect.getOwnPropertyDescriptor(v, h);
941
+ if (U?.set && U.set.call(p, g), !_) {
891
942
  if (i && typeof h == "string") {
892
- var be = r.get("length"), Ye = Number(h);
893
- Number.isInteger(Ye) && Ye >= be.v && $(be, Ye + 1);
943
+ var Se = r.get("length"), et = Number(h);
944
+ Number.isInteger(et) && et >= Se.v && $(Se, et + 1);
894
945
  }
895
- et(n);
946
+ st(n);
896
947
  }
897
948
  return !0;
898
949
  },
899
- ownKeys(m) {
900
- g(n);
901
- var h = Reflect.ownKeys(m).filter((y) => {
950
+ ownKeys(v) {
951
+ m(n);
952
+ var h = Reflect.ownKeys(v).filter((y) => {
902
953
  var _ = r.get(y);
903
954
  return _ === void 0 || _.v !== M;
904
955
  });
905
- for (var [v, d] of r) d.v !== M && !(v in m) && h.push(v);
956
+ for (var [g, p] of r) p.v !== M && !(g in v) && h.push(g);
906
957
  return h;
907
958
  },
908
959
  setPrototypeOf() {
909
- _n();
960
+ Cn();
910
961
  }
911
962
  });
912
963
  }
913
- function Kn(e, t) {
914
- return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : qn.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
964
+ function no(e, t) {
965
+ return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : io.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
915
966
  }
916
- var Er, Un, yi, bi, wi;
917
- function Kt() {
918
- if (Er === void 0) {
919
- Er = window, Un = document, yi = /Firefox/.test(navigator.userAgent);
967
+ var Hr, oo, Ci, $i, Li;
968
+ function ir() {
969
+ if (Hr === void 0) {
970
+ Hr = window, oo = document, Ci = /Firefox/.test(navigator.userAgent);
920
971
  var e = Element.prototype, t = Node.prototype, r = Text.prototype;
921
- bi = ke(t, "firstChild").get, wi = ke(t, "nextSibling").get, vr(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), vr(r) && (r.__t = void 0);
972
+ $i = Oe(t, "firstChild").get, Li = Oe(t, "nextSibling").get, kr(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), kr(r) && (r.__t = void 0);
922
973
  }
923
974
  }
924
- function Ti(e = "") {
975
+ function Oi(e = "") {
925
976
  return document.createTextNode(e);
926
977
  }
927
978
  // @__NO_SIDE_EFFECTS__
928
- function Ut(e) {
929
- return bi.call(e);
979
+ function nr(e) {
980
+ return $i.call(e);
930
981
  }
931
982
  // @__NO_SIDE_EFFECTS__
932
- function Ue(e) {
933
- return wi.call(e);
983
+ function Ze(e) {
984
+ return Li.call(e);
934
985
  }
935
- function Yn(e) {
986
+ function so(e) {
936
987
  e.textContent = "";
937
988
  }
938
- function Ai(e, t, r) {
989
+ function Ri(e, t, r) {
939
990
  let i = r ? { is: r } : void 0;
940
991
  return document.createElementNS(t ?? "http://www.w3.org/1999/xhtml", e, i);
941
992
  }
942
- function Si(e) {
943
- var t = w, r = T;
944
- ie(null), _e(null);
993
+ function Mi(e) {
994
+ var t = T, r = A;
995
+ ae(null), Te(null);
945
996
  try {
946
997
  return e();
947
998
  } finally {
948
- ie(t), _e(r);
999
+ ae(t), Te(r);
949
1000
  }
950
1001
  }
951
- function Xn(e) {
952
- T === null && (w === null && hn(e), fn()), ge && dn(e);
1002
+ function ao(e) {
1003
+ A === null && (T === null && An(e), Tn()), fe && wn(e);
953
1004
  }
954
- function Qn(e, t) {
1005
+ function lo(e, t) {
955
1006
  var r = t.last;
956
1007
  r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
957
1008
  }
958
- function xe(e, t) {
959
- var r = T;
960
- r !== null && r.f & 8192 && (e |= jr);
1009
+ function Be(e, t) {
1010
+ var r = A;
1011
+ r !== null && r.f & 8192 && (e |= Jr);
961
1012
  var i = {
962
- ctx: O,
1013
+ ctx: L,
963
1014
  deps: null,
964
1015
  nodes: null,
965
- f: e | ce | 512,
1016
+ f: e | le | 512,
966
1017
  first: null,
967
1018
  fn: t,
968
1019
  last: null,
@@ -973,307 +1024,313 @@ function xe(e, t) {
973
1024
  teardown: null,
974
1025
  wv: 0,
975
1026
  ac: null
976
- }, n = i;
977
- if (e & 4) We !== null ? We.push(i) : Ke.ensure().schedule(i);
1027
+ };
1028
+ I?.register_created_effect(i);
1029
+ var n = i;
1030
+ if (e & 4) Ye !== null ? Ye.push(i) : Je.ensure().schedule(i);
978
1031
  else if (t !== null) {
979
1032
  try {
980
- qe(i);
981
- } catch (o) {
982
- throw Z(i), o;
1033
+ Qe(i);
1034
+ } catch (s) {
1035
+ throw te(i), s;
983
1036
  }
984
- n.deps === null && n.teardown === null && n.nodes === null && n.first === n.last && !(n.f & 524288) && (n = n.first, e & 16 && e & 65536 && n !== null && (n.f |= Gr));
1037
+ n.deps === null && n.teardown === null && n.nodes === null && n.first === n.last && !(n.f & 524288) && (n = n.first, e & 16 && e & 65536 && n !== null && (n.f |= ei));
985
1038
  }
986
- if (n !== null && (n.parent = r, r !== null && Qn(n, r), w !== null && w.f & 2 && !(e & 64))) {
987
- var s = w;
988
- (s.effects ?? (s.effects = [])).push(n);
1039
+ if (n !== null && (n.parent = r, r !== null && lo(n, r), T !== null && T.f & 2 && !(e & 64))) {
1040
+ var o = T;
1041
+ (o.effects ?? (o.effects = [])).push(n);
989
1042
  }
990
1043
  return i;
991
1044
  }
992
- function sr() {
993
- return w !== null && !J;
1045
+ function mr() {
1046
+ return T !== null && !J;
994
1047
  }
995
- function Ae(e) {
996
- Xn("$effect");
997
- var t = T.f;
998
- if (!w && t & 32 && !(t & 32768)) {
999
- var r = O;
1048
+ function Ce(e) {
1049
+ ao("$effect");
1050
+ var t = A.f;
1051
+ if (!T && t & 32 && !(t & 32768)) {
1052
+ var r = L;
1000
1053
  (r.e ?? (r.e = [])).push(e);
1001
- } else return Ii(e);
1054
+ } else return Pi(e);
1002
1055
  }
1003
- function Ii(e) {
1004
- return xe(4 | ln, e);
1056
+ function Pi(e) {
1057
+ return Be(4 | _n, e);
1005
1058
  }
1006
- function Jn(e) {
1007
- Ke.ensure();
1008
- const t = xe(64 | st, e);
1059
+ function co(e) {
1060
+ Je.ensure();
1061
+ const t = Be(64 | ut, e);
1009
1062
  return () => {
1010
- Z(t);
1063
+ te(t);
1011
1064
  };
1012
1065
  }
1013
- function Zn(e) {
1014
- Ke.ensure();
1015
- const t = xe(64 | st, e);
1066
+ function uo(e) {
1067
+ Je.ensure();
1068
+ const t = Be(64 | ut, e);
1016
1069
  return (r = {}) => new Promise((i) => {
1017
- r.outro ? Lt(t, () => {
1018
- Z(t), i(void 0);
1019
- }) : (Z(t), i(void 0));
1070
+ r.outro ? Nt(t, () => {
1071
+ te(t), i(void 0);
1072
+ }) : (te(t), i(void 0));
1020
1073
  });
1021
1074
  }
1022
- function es(e) {
1023
- return xe(4, e);
1075
+ function fo(e) {
1076
+ return Be(4, e);
1024
1077
  }
1025
- function or(e, t = 0) {
1026
- return xe(8 | t, e);
1078
+ function _r(e, t = 0) {
1079
+ return Be(8 | t, e);
1027
1080
  }
1028
- function ts(e, t = 0) {
1029
- var r = xe(16 | t, e);
1081
+ function ho(e, t = 0) {
1082
+ var r = Be(16 | t, e);
1030
1083
  return r;
1031
1084
  }
1032
- function Me(e) {
1033
- return xe(32 | st, e);
1085
+ function De(e) {
1086
+ return Be(32 | ut, e);
1034
1087
  }
1035
- function Ei(e) {
1088
+ function xi(e) {
1036
1089
  var t = e.teardown;
1037
1090
  if (t !== null) {
1038
- const r = ge, i = w;
1039
- kr(!0), ie(null);
1091
+ const r = fe, i = T;
1092
+ Nr(!0), ae(null);
1040
1093
  try {
1041
1094
  t.call(null);
1042
1095
  } finally {
1043
- kr(r), ie(i);
1096
+ Nr(r), ae(i);
1044
1097
  }
1045
1098
  }
1046
1099
  }
1047
- function ar(e, t = !1) {
1100
+ function yr(e, t = !1) {
1048
1101
  var r = e.first;
1049
1102
  for (e.first = e.last = null; r !== null; ) {
1050
1103
  const n = r.ac;
1051
- n !== null && Si(() => {
1052
- n.abort(Jt);
1104
+ n !== null && Mi(() => {
1105
+ n.abort(lr);
1053
1106
  });
1054
1107
  var i = r.next;
1055
- r.f & 64 ? r.parent = null : Z(r, t), r = i;
1108
+ r.f & 64 ? r.parent = null : te(r, t), r = i;
1056
1109
  }
1057
1110
  }
1058
- function rs(e) {
1111
+ function po(e) {
1059
1112
  for (var t = e.first; t !== null; ) {
1060
1113
  var r = t.next;
1061
- t.f & 32 || Z(t), t = r;
1114
+ t.f & 32 || te(t), t = r;
1062
1115
  }
1063
1116
  }
1064
- function Z(e, t = !0) {
1117
+ function te(e, t = !0) {
1065
1118
  var r = !1;
1066
- (t || e.f & 262144) && e.nodes !== null && e.nodes.end !== null && (is(e.nodes.start, e.nodes.end), r = !0), R(e, mr), ar(e, t && !r), nt(e, 0);
1119
+ (t || e.f & 262144) && e.nodes !== null && e.nodes.end !== null && (vo(e.nodes.start, e.nodes.end), r = !0), O(e, Cr), yr(e, t && !r), ct(e, 0);
1067
1120
  var i = e.nodes && e.nodes.t;
1068
- if (i !== null) for (const s of i) s.stop();
1069
- Ei(e), e.f ^= mr, e.f |= an;
1121
+ if (i !== null) for (const o of i) o.stop();
1122
+ xi(e), e.f ^= Cr, e.f |= mn;
1070
1123
  var n = e.parent;
1071
- n !== null && n.first !== null && ki(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1124
+ n !== null && n.first !== null && Hi(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1072
1125
  }
1073
- function is(e, t) {
1126
+ function vo(e, t) {
1074
1127
  for (; e !== null; ) {
1075
- var r = e === t ? null : /* @__PURE__ */ Ue(e);
1128
+ var r = e === t ? null : /* @__PURE__ */ Ze(e);
1076
1129
  e.remove(), e = r;
1077
1130
  }
1078
1131
  }
1079
- function ki(e) {
1132
+ function Hi(e) {
1080
1133
  var t = e.parent, r = e.prev, i = e.next;
1081
1134
  r !== null && (r.next = i), i !== null && (i.prev = r), t !== null && (t.first === e && (t.first = i), t.last === e && (t.last = r));
1082
1135
  }
1083
- function Lt(e, t, r = !0) {
1136
+ function Nt(e, t, r = !0) {
1084
1137
  var i = [];
1085
- Ci(e, i, !0);
1138
+ Ni(e, i, !0);
1086
1139
  var n = () => {
1087
- r && Z(e), t && t();
1088
- }, s = i.length;
1089
- if (s > 0) {
1090
- var o = () => --s || n();
1091
- for (var a of i) a.out(o);
1140
+ r && te(e), t && t();
1141
+ }, o = i.length;
1142
+ if (o > 0) {
1143
+ var s = () => --o || n();
1144
+ for (var l of i) l.out(s);
1092
1145
  } else n();
1093
1146
  }
1094
- function Ci(e, t, r) {
1147
+ function Ni(e, t, r) {
1095
1148
  if (!(e.f & 8192)) {
1096
- e.f ^= jr;
1149
+ e.f ^= Jr;
1097
1150
  var i = e.nodes && e.nodes.t;
1098
1151
  if (i !== null)
1099
- for (const a of i) (a.is_global || r) && t.push(a);
1152
+ for (const l of i) (l.is_global || r) && t.push(l);
1100
1153
  for (var n = e.first; n !== null; ) {
1101
- var s = n.next, o = (n.f & 65536) !== 0 || (n.f & 32) !== 0 && (e.f & 16) !== 0;
1102
- Ci(n, t, o ? r : !1), n = s;
1154
+ var o = n.next;
1155
+ if (!(n.f & 64)) {
1156
+ var s = (n.f & 65536) !== 0 || (n.f & 32) !== 0 && (e.f & 16) !== 0;
1157
+ Ni(n, t, s ? r : !1);
1158
+ }
1159
+ n = o;
1103
1160
  }
1104
1161
  }
1105
1162
  }
1106
- function ns(e, t) {
1163
+ function go(e, t) {
1107
1164
  if (e.nodes)
1108
1165
  for (var r = e.nodes.start, i = e.nodes.end; r !== null; ) {
1109
- var n = r === i ? null : /* @__PURE__ */ Ue(r);
1166
+ var n = r === i ? null : /* @__PURE__ */ Ze(r);
1110
1167
  t.append(r), r = n;
1111
1168
  }
1112
1169
  }
1113
- var ss = null, gt = !1, ge = !1;
1114
- function kr(e) {
1115
- ge = e;
1116
- }
1117
- var w = null, J = !1;
1118
- function ie(e) {
1119
- w = e;
1170
+ var mo = null, At = !1, fe = !1;
1171
+ function Nr(e) {
1172
+ fe = e;
1120
1173
  }
1121
- var T = null;
1122
- function _e(e) {
1174
+ var T = null, J = !1;
1175
+ function ae(e) {
1123
1176
  T = e;
1124
1177
  }
1125
- var W = null;
1126
- function $i(e) {
1127
- w !== null && (!Re || w.f & 2) && (W === null ? W = [e] : W.push(e));
1178
+ var A = null;
1179
+ function Te(e) {
1180
+ A = e;
1128
1181
  }
1129
- var D = null, V = 0, G = null;
1130
- function os(e) {
1131
- G = e;
1182
+ var K = null;
1183
+ function Di(e) {
1184
+ T !== null && (!we || T.f & 2) && (K === null ? K = [e] : K.push(e));
1132
1185
  }
1133
- var Oi = 1, Ee = 0, Le = Ee;
1134
- function Cr(e) {
1135
- Le = e;
1186
+ var B = null, z = 0, W = null;
1187
+ function _o(e) {
1188
+ W = e;
1136
1189
  }
1137
- function Li() {
1138
- return ++Oi;
1190
+ var Fi = 1, Le = 0, He = Le;
1191
+ function Dr(e) {
1192
+ He = e;
1139
1193
  }
1140
- function lt(e) {
1194
+ function Bi() {
1195
+ return ++Fi;
1196
+ }
1197
+ function ht(e) {
1141
1198
  var t = e.f;
1142
1199
  if (t & 2048) return !0;
1143
- if (t & 2 && (e.f &= ~ot), t & 4096) {
1200
+ if (t & 2 && (e.f &= ~dt), t & 4096) {
1144
1201
  for (var r = e.deps, i = r.length, n = 0; n < i; n++) {
1145
- var s = r[n];
1146
- if (lt(s) && pi(s), s.wv > e.wv) return !0;
1202
+ var o = r[n];
1203
+ if (ht(o) && Ai(o), o.wv > e.wv) return !0;
1147
1204
  }
1148
- t & 512 && F === null && R(e, ee);
1205
+ t & 512 && x === null && O(e, re);
1149
1206
  }
1150
1207
  return !1;
1151
1208
  }
1152
- function Ri(e, t, r = !0) {
1209
+ function ji(e, t, r = !0) {
1153
1210
  var i = e.reactions;
1154
- if (i !== null && !(!Re && W !== null && ze.call(W, e)))
1211
+ if (i !== null && !(!we && K !== null && Ke.call(K, e)))
1155
1212
  for (var n = 0; n < i.length; n++) {
1156
- var s = i[n];
1157
- s.f & 2 ? Ri(s, t, !1) : t === s && (r ? R(s, ce) : s.f & 1024 && R(s, Pe), tr(s));
1213
+ var o = i[n];
1214
+ o.f & 2 ? ji(o, t, !1) : t === o && (r ? O(o, le) : o.f & 1024 && O(o, Fe), hr(o));
1158
1215
  }
1159
1216
  }
1160
- function Mi(e) {
1161
- var t = D, r = V, i = G, n = w, s = W, o = O, a = J, c = Le, p = e.f;
1162
- D = null, V = 0, G = null, w = p & 96 ? null : e, W = null, St(e.ctx), J = !1, Le = ++Ee, e.ac !== null && (Si(() => {
1163
- e.ac.abort(Jt);
1217
+ function zi(e) {
1218
+ var t = B, r = z, i = W, n = T, o = K, s = L, l = J, c = He, d = e.f;
1219
+ B = null, z = 0, W = null, T = d & 96 ? null : e, K = null, Lt(e.ctx), J = !1, He = ++Le, e.ac !== null && (Mi(() => {
1220
+ e.ac.abort(lr);
1164
1221
  }), e.ac = null);
1165
1222
  try {
1166
- e.f |= gr;
1167
- var f = e.fn, m = f();
1168
- e.f |= zr;
1169
- var h = e.deps, v = C?.is_fork;
1170
- if (D !== null) {
1171
- var d;
1172
- if (v || nt(e, V), h !== null && V > 0)
1173
- for (h.length = V + D.length, d = 0; d < D.length; d++) h[V + d] = D[d];
1174
- else e.deps = h = D;
1175
- if (sr() && e.f & 512) for (d = V; d < h.length; d++) {
1223
+ e.f |= $r;
1224
+ var f = e.fn, v = f();
1225
+ e.f |= Zr;
1226
+ var h = e.deps, g = I?.is_fork;
1227
+ if (B !== null) {
1228
+ var p;
1229
+ if (g || ct(e, z), h !== null && z > 0)
1230
+ for (h.length = z + B.length, p = 0; p < B.length; p++) h[z + p] = B[p];
1231
+ else e.deps = h = B;
1232
+ if (mr() && e.f & 512) for (p = z; p < h.length; p++) {
1176
1233
  var y;
1177
- ((y = h[d]).reactions ?? (y.reactions = [])).push(e);
1234
+ ((y = h[p]).reactions ?? (y.reactions = [])).push(e);
1178
1235
  }
1179
- } else !v && h !== null && V < h.length && (nt(e, V), h.length = V);
1180
- if ($t() && G !== null && !J && h !== null && !(e.f & 6146)) for (d = 0; d < G.length; d++) Ri(G[d], e);
1236
+ } else !g && h !== null && z < h.length && (ct(e, z), h.length = z);
1237
+ if (xt() && W !== null && !J && h !== null && !(e.f & 6146)) for (p = 0; p < W.length; p++) ji(W[p], e);
1181
1238
  if (n !== null && n !== e) {
1182
- if (Ee++, n.deps !== null) for (let _ = 0; _ < r; _ += 1) n.deps[_].rv = Ee;
1183
- if (t !== null) for (const _ of t) _.rv = Ee;
1184
- G !== null && (i === null ? i = G : i.push(...G));
1239
+ if (Le++, n.deps !== null) for (let _ = 0; _ < r; _ += 1) n.deps[_].rv = Le;
1240
+ if (t !== null) for (const _ of t) _.rv = Le;
1241
+ W !== null && (i === null ? i = W : i.push(...W));
1185
1242
  }
1186
- return e.f & 8388608 && (e.f ^= Wr), m;
1243
+ return e.f & 8388608 && (e.f ^= ti), v;
1187
1244
  } catch (_) {
1188
- return ei(_);
1245
+ return ui(_);
1189
1246
  } finally {
1190
- e.f ^= gr, D = t, V = r, G = i, w = n, W = s, St(o), J = a, Le = c;
1247
+ e.f ^= $r, B = t, z = r, W = i, T = n, K = o, Lt(s), J = l, He = c;
1191
1248
  }
1192
1249
  }
1193
- function as(e, t) {
1250
+ function yo(e, t) {
1194
1251
  let r = t.reactions;
1195
1252
  if (r !== null) {
1196
- var i = Ji.call(r, e);
1253
+ var i = cn.call(r, e);
1197
1254
  if (i !== -1) {
1198
1255
  var n = r.length - 1;
1199
1256
  n === 0 ? r = t.reactions = null : (r[i] = r[n], r.pop());
1200
1257
  }
1201
1258
  }
1202
- if (r === null && t.f & 2 && (D === null || !ze.call(D, t))) {
1203
- var s = t;
1204
- s.f & 512 && (s.f ^= 512, s.f &= ~ot), Zt(s), zn(s), nt(s, 0);
1259
+ if (r === null && t.f & 2 && (B === null || !Ke.call(B, t))) {
1260
+ var o = t;
1261
+ o.f & 512 && (o.f ^= 512, o.f &= ~dt), o.v !== M && cr(o), eo(o), ct(o, 0);
1205
1262
  }
1206
1263
  }
1207
- function nt(e, t) {
1264
+ function ct(e, t) {
1208
1265
  var r = e.deps;
1209
1266
  if (r !== null)
1210
- for (var i = t; i < r.length; i++) as(e, r[i]);
1267
+ for (var i = t; i < r.length; i++) yo(e, r[i]);
1211
1268
  }
1212
- function qe(e) {
1269
+ function Qe(e) {
1213
1270
  var t = e.f;
1214
1271
  if (!(t & 16384)) {
1215
- R(e, ee);
1216
- var r = T, i = gt;
1217
- if (T = e, gt = !0, 0)
1218
- var n, s;
1272
+ O(e, re);
1273
+ var r = A, i = At;
1274
+ if (A = e, At = !0, 0)
1275
+ var n, o;
1219
1276
  try {
1220
- t & 16777232 ? rs(e) : ar(e), Ei(e);
1221
- var o = Mi(e);
1222
- if (e.teardown = typeof o == "function" ? o : null, e.wv = Oi, 0)
1223
- for (var a of e.deps) ;
1277
+ t & 16777232 ? po(e) : yr(e), xi(e);
1278
+ var s = zi(e);
1279
+ if (e.teardown = typeof s == "function" ? s : null, e.wv = Fi, 0)
1280
+ for (var l of e.deps) ;
1224
1281
  } finally {
1225
- gt = i, T = r;
1282
+ At = i, A = r;
1226
1283
  }
1227
1284
  }
1228
1285
  }
1229
- function g(e) {
1286
+ function m(e) {
1230
1287
  var t = (e.f & 2) !== 0;
1231
- if (ss?.add(e), w !== null && !J && !(T !== null && T.f & 16384) && (W === null || !ze.call(W, e))) {
1232
- var r = w.deps;
1233
- if (w.f & 2097152)
1234
- e.rv < Ee && (e.rv = Ee, D === null && r !== null && r[V] === e ? V++ : D === null ? D = [e] : D.push(e));
1288
+ if (mo?.add(e), T !== null && !J && !(A !== null && A.f & 16384) && (K === null || !Ke.call(K, e))) {
1289
+ var r = T.deps;
1290
+ if (T.f & 2097152)
1291
+ e.rv < Le && (e.rv = Le, B === null && r !== null && r[z] === e ? z++ : B === null ? B = [e] : B.push(e));
1235
1292
  else {
1236
1293
  var i;
1237
- ((i = w).deps ?? (i.deps = [])).push(e);
1294
+ ((i = T).deps ?? (i.deps = [])).push(e);
1238
1295
  var n = e.reactions;
1239
- n === null ? e.reactions = [w] : ze.call(n, w) || n.push(w);
1296
+ n === null ? e.reactions = [T] : Ke.call(n, T) || n.push(T);
1240
1297
  }
1241
1298
  }
1242
1299
  if (0) {
1243
- if (!J && reactivity_loss_tracker && !reactivity_loss_tracker.warned && !(reactivity_loss_tracker.effect.f & 2097152))
1244
- var s;
1245
- if (tracing_mode_flag && !J && tracing_expressions !== null && w !== null && tracing_expressions.reaction === w && !e.trace) {
1246
- if (s)
1247
- var o, a;
1300
+ if (!J && reactivity_loss_tracker && !reactivity_loss_tracker.warned && !(reactivity_loss_tracker.effect.f & 2097152) && !reactivity_loss_tracker.effect_deps.has(e))
1301
+ var o;
1302
+ if (tracing_mode_flag && !J && tracing_expressions !== null && T !== null && tracing_expressions.reaction === T && !e.trace) {
1303
+ if (o)
1304
+ var s, l;
1248
1305
  }
1249
1306
  }
1250
- if (ge && me.has(e)) return me.get(e);
1307
+ if (fe && xe.has(e)) return xe.get(e);
1251
1308
  if (t) {
1252
1309
  var c = e;
1253
- if (ge) {
1254
- var p = c.v;
1255
- return (!(c.f & 1024) && c.reactions !== null || xi(c)) && (p = nr(c)), me.set(c, p), p;
1310
+ if (fe) {
1311
+ var d = c.v;
1312
+ return (!(c.f & 1024) && c.reactions !== null || Gi(c)) && (d = gr(c)), xe.set(c, d), d;
1256
1313
  }
1257
- var f = (c.f & 512) === 0 && !J && w !== null && (gt || (w.f & 512) !== 0), m = (c.f & zr) === 0;
1258
- lt(c) && (f && (c.f |= 512), pi(c)), f && !m && (vi(c), Pi(c));
1314
+ var f = (c.f & 512) === 0 && !J && T !== null && (At || (T.f & 512) !== 0), v = (c.f & Zr) === 0;
1315
+ ht(c) && (f && (c.f |= 512), Ai(c)), f && !v && (Si(c), Vi(c));
1259
1316
  }
1260
- if (F?.has(e)) return F.get(e);
1317
+ if (x?.has(e)) return x.get(e);
1261
1318
  if (e.f & 8388608) throw e.v;
1262
1319
  return e.v;
1263
1320
  }
1264
- function Pi(e) {
1321
+ function Vi(e) {
1265
1322
  if (e.f |= 512, e.deps !== null)
1266
1323
  for (const t of e.deps)
1267
- (t.reactions ?? (t.reactions = [])).push(e), t.f & 2 && !(t.f & 512) && (vi(t), Pi(t));
1324
+ (t.reactions ?? (t.reactions = [])).push(e), t.f & 2 && !(t.f & 512) && (Si(t), Vi(t));
1268
1325
  }
1269
- function xi(e) {
1326
+ function Gi(e) {
1270
1327
  if (e.v === M) return !0;
1271
1328
  if (e.deps === null) return !1;
1272
1329
  for (const t of e.deps)
1273
- if (me.has(t) || t.f & 2 && xi(t)) return !0;
1330
+ if (xe.has(t) || t.f & 2 && Gi(t)) return !0;
1274
1331
  return !1;
1275
1332
  }
1276
- function Rt(e) {
1333
+ function Dt(e) {
1277
1334
  var t = J;
1278
1335
  try {
1279
1336
  return J = !0, e();
@@ -1281,63 +1338,63 @@ function Rt(e) {
1281
1338
  J = t;
1282
1339
  }
1283
1340
  }
1284
- var pt = Symbol("events"), ls = /* @__PURE__ */ new Set(), $r = /* @__PURE__ */ new Set(), Or = null;
1285
- function Lr(e) {
1286
- var t = this, r = t.ownerDocument, i = e.type, n = e.composedPath?.() || [], s = n[0] || e.target;
1287
- Or = e;
1288
- var o = 0, a = Or === e && e[pt];
1289
- if (a) {
1290
- var c = n.indexOf(a);
1341
+ var yt = Symbol("events"), bo = /* @__PURE__ */ new Set(), Fr = /* @__PURE__ */ new Set(), Br = null;
1342
+ function jr(e) {
1343
+ var t = this, r = t.ownerDocument, i = e.type, n = e.composedPath?.() || [], o = n[0] || e.target;
1344
+ Br = e;
1345
+ var s = 0, l = Br === e && e[yt];
1346
+ if (l) {
1347
+ var c = n.indexOf(l);
1291
1348
  if (c !== -1 && (t === document || t === window)) {
1292
- e[pt] = t;
1349
+ e[yt] = t;
1293
1350
  return;
1294
1351
  }
1295
- var p = n.indexOf(t);
1296
- if (p === -1) return;
1297
- c <= p && (o = c);
1352
+ var d = n.indexOf(t);
1353
+ if (d === -1) return;
1354
+ c <= d && (s = c);
1298
1355
  }
1299
- if (s = n[o] || e.target, s !== t) {
1300
- At(e, "currentTarget", {
1356
+ if (o = n[s] || e.target, o !== t) {
1357
+ $t(e, "currentTarget", {
1301
1358
  configurable: !0,
1302
1359
  get() {
1303
- return s || r;
1360
+ return o || r;
1304
1361
  }
1305
1362
  });
1306
- var f = w, m = T;
1307
- ie(null), _e(null);
1363
+ var f = T, v = A;
1364
+ ae(null), Te(null);
1308
1365
  try {
1309
- for (var h, v = []; s !== null; ) {
1310
- var d = s.assignedSlot || s.parentNode || s.host || null;
1366
+ for (var h, g = []; o !== null; ) {
1367
+ var p = o.assignedSlot || o.parentNode || o.host || null;
1311
1368
  try {
1312
- var y = s[pt]?.[i];
1313
- y != null && (!s.disabled || e.target === s) && y.call(s, e);
1369
+ var y = o[yt]?.[i];
1370
+ y != null && (!o.disabled || e.target === o) && y.call(o, e);
1314
1371
  } catch (_) {
1315
- h ? v.push(_) : h = _;
1372
+ h ? g.push(_) : h = _;
1316
1373
  }
1317
- if (e.cancelBubble || d === t || d === null) break;
1318
- s = d;
1374
+ if (e.cancelBubble || p === t || p === null) break;
1375
+ o = p;
1319
1376
  }
1320
1377
  if (h) {
1321
- for (let _ of v) queueMicrotask(() => {
1378
+ for (let _ of g) queueMicrotask(() => {
1322
1379
  throw _;
1323
1380
  });
1324
1381
  throw h;
1325
1382
  }
1326
1383
  } finally {
1327
- e[pt] = t, delete e.currentTarget, ie(f), _e(m);
1384
+ e[yt] = t, delete e.currentTarget, ae(f), Te(v);
1328
1385
  }
1329
1386
  }
1330
1387
  }
1331
- var cs = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1332
- function us(e) {
1333
- return cs?.createHTML(e) ?? e;
1388
+ var wo = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1389
+ function To(e) {
1390
+ return wo?.createHTML(e) ?? e;
1334
1391
  }
1335
- function ds(e) {
1336
- var t = Ai("template");
1337
- return t.innerHTML = us(e.replaceAll("<!>", "<!---->")), t.content;
1392
+ function Ao(e) {
1393
+ var t = Ri("template");
1394
+ return t.innerHTML = To(e.replaceAll("<!>", "<!---->")), t.content;
1338
1395
  }
1339
- function _t(e, t) {
1340
- var r = T;
1396
+ function St(e, t) {
1397
+ var r = A;
1341
1398
  r.nodes === null && (r.nodes = {
1342
1399
  start: e,
1343
1400
  end: t,
@@ -1346,29 +1403,29 @@ function _t(e, t) {
1346
1403
  });
1347
1404
  }
1348
1405
  // @__NO_SIDE_EFFECTS__
1349
- function fs(e, t) {
1350
- var r = (t & 1) !== 0, i = (t & 2) !== 0, n, s = !e.startsWith("<!>");
1406
+ function So(e, t) {
1407
+ var r = (t & 1) !== 0, i = (t & 2) !== 0, n, o = !e.startsWith("<!>");
1351
1408
  return () => {
1352
- if (Y)
1353
- return _t(x, null), x;
1354
- n === void 0 && (n = ds(s ? e : "<!>" + e), r || (n = /* @__PURE__ */ Ut(n)));
1355
- var o = i || yi ? document.importNode(n, !0) : n.cloneNode(!0);
1409
+ if (Z)
1410
+ return St(N, null), N;
1411
+ n === void 0 && (n = Ao(o ? e : "<!>" + e), r || (n = /* @__PURE__ */ nr(n)));
1412
+ var s = i || Ci ? document.importNode(n, !0) : n.cloneNode(!0);
1356
1413
  if (r) {
1357
- var a = /* @__PURE__ */ Ut(o), c = o.lastChild;
1358
- _t(a, c);
1359
- } else _t(o, o);
1360
- return o;
1414
+ var l = /* @__PURE__ */ nr(s), c = s.lastChild;
1415
+ St(l, c);
1416
+ } else St(s, s);
1417
+ return s;
1361
1418
  };
1362
1419
  }
1363
- function Hi(e, t) {
1364
- if (Y) {
1365
- var r = T;
1366
- (!(r.f & 32768) || r.nodes.end === null) && (r.nodes.end = x), Ur();
1420
+ function Wi(e, t) {
1421
+ if (Z) {
1422
+ var r = A;
1423
+ (!(r.f & 32768) || r.nodes.end === null) && (r.nodes.end = N), ni();
1367
1424
  return;
1368
1425
  }
1369
1426
  e !== null && e.before(t);
1370
1427
  }
1371
- var hs = [
1428
+ var Io = [
1372
1429
  "allowfullscreen",
1373
1430
  "async",
1374
1431
  "autofocus",
@@ -1397,8 +1454,8 @@ var hs = [
1397
1454
  "defer",
1398
1455
  "disablepictureinpicture",
1399
1456
  "disableremoteplayback"
1400
- ], Bo = [
1401
- ...hs,
1457
+ ], ia = [
1458
+ ...Io,
1402
1459
  "formNoValidate",
1403
1460
  "isMap",
1404
1461
  "noModule",
@@ -1413,17 +1470,17 @@ var hs = [
1413
1470
  "allowFullscreen",
1414
1471
  "disablePictureInPicture",
1415
1472
  "disableRemotePlayback"
1416
- ], ps = ["touchstart", "touchmove"];
1417
- function vs(e) {
1418
- return ps.includes(e);
1473
+ ], Eo = ["touchstart", "touchmove"];
1474
+ function ko(e) {
1475
+ return Eo.includes(e);
1419
1476
  }
1420
- var ms = [
1477
+ var Co = [
1421
1478
  "$state",
1422
1479
  "$state.raw",
1423
1480
  "$derived",
1424
1481
  "$derived.by"
1425
- ], Vo = [
1426
- ...ms,
1482
+ ], na = [
1483
+ ...Co,
1427
1484
  "$state.eager",
1428
1485
  "$state.snapshot",
1429
1486
  "$props",
@@ -1438,80 +1495,80 @@ var ms = [
1438
1495
  "$inspect().with",
1439
1496
  "$inspect.trace",
1440
1497
  "$host"
1441
- ], Rr = !0;
1442
- function Ni(e, t) {
1443
- return Di(e, t);
1498
+ ], zr = !0;
1499
+ function qi(e, t) {
1500
+ return Ki(e, t);
1444
1501
  }
1445
- function gs(e, t) {
1446
- Kt(), t.intro = t.intro ?? !1;
1447
- const r = t.target, i = Y, n = x;
1502
+ function $o(e, t) {
1503
+ ir(), t.intro = t.intro ?? !1;
1504
+ const r = t.target, i = Z, n = N;
1448
1505
  try {
1449
- for (var s = /* @__PURE__ */ Ut(r); s && (s.nodeType !== 8 || s.data !== "["); ) s = /* @__PURE__ */ Ue(s);
1450
- if (!s) throw wt;
1451
- ct(!0), tt(s);
1452
- const o = Di(e, {
1506
+ for (var o = /* @__PURE__ */ nr(r); o && (o.nodeType !== 8 || o.data !== "["); ) o = /* @__PURE__ */ Ze(o);
1507
+ if (!o) throw kt;
1508
+ pt(!0), at(o);
1509
+ const s = Ki(e, {
1453
1510
  ...t,
1454
- anchor: s
1511
+ anchor: o
1455
1512
  });
1456
- return ct(!1), o;
1457
- } catch (o) {
1458
- if (o instanceof Error && o.message.split(`
1459
- `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw o;
1460
- return o !== wt && console.warn("Failed to hydrate: ", o), t.recover === !1 && vn(), Kt(), Yn(r), ct(!1), Ni(e, t);
1513
+ return pt(!1), s;
1514
+ } catch (s) {
1515
+ if (s instanceof Error && s.message.split(`
1516
+ `).some((l) => l.startsWith("https://svelte.dev/e/"))) throw s;
1517
+ return s !== kt && console.warn("Failed to hydrate: ", s), t.recover === !1 && In(), ir(), so(r), pt(!1), qi(e, t);
1461
1518
  } finally {
1462
- ct(i), tt(n);
1463
- }
1464
- }
1465
- var vt = /* @__PURE__ */ new Map();
1466
- function Di(e, { target: t, anchor: r, props: i = {}, events: n, context: s, intro: o = !0, transformError: a }) {
1467
- Kt();
1468
- var c = void 0, p = Zn(() => {
1469
- var f = r ?? t.appendChild(Ti());
1470
- xn(f, { pending: () => {
1471
- } }, (v) => {
1472
- Qr({});
1473
- var d = O;
1474
- if (s && (d.c = s), n && (i.$$events = n), Y && _t(v, null), Rr = o, c = e(v, i) || {}, Rr = !0, Y && (T.nodes.end = x, x === null || x.nodeType !== 8 || x.data !== "]"))
1475
- throw Kr(), wt;
1476
- Jr();
1477
- }, a);
1478
- var m = /* @__PURE__ */ new Set(), h = (v) => {
1479
- for (var d = 0; d < v.length; d++) {
1480
- var y = v[d];
1481
- if (!m.has(y)) {
1482
- m.add(y);
1483
- var _ = vs(y);
1484
- for (const k of [t, document]) {
1485
- var S = vt.get(k);
1486
- S === void 0 && (S = /* @__PURE__ */ new Map(), vt.set(k, S));
1487
- var B = S.get(y);
1488
- B === void 0 ? (k.addEventListener(y, Lr, { passive: _ }), S.set(y, 1)) : S.set(y, B + 1);
1519
+ pt(i), at(n);
1520
+ }
1521
+ }
1522
+ var bt = /* @__PURE__ */ new Map();
1523
+ function Ki(e, { target: t, anchor: r, props: i = {}, events: n, context: o, intro: s = !0, transformError: l }) {
1524
+ ir();
1525
+ var c = void 0, d = uo(() => {
1526
+ var f = r ?? t.appendChild(Oi());
1527
+ Kn(f, { pending: () => {
1528
+ } }, (g) => {
1529
+ ai({});
1530
+ var p = L;
1531
+ if (o && (p.c = o), n && (i.$$events = n), Z && St(g, null), zr = s, c = e(g, i) || {}, zr = !0, Z && (A.nodes.end = N, N === null || N.nodeType !== 8 || N.data !== "]"))
1532
+ throw ii(), kt;
1533
+ li();
1534
+ }, l);
1535
+ var v = /* @__PURE__ */ new Set(), h = (g) => {
1536
+ for (var p = 0; p < g.length; p++) {
1537
+ var y = g[p];
1538
+ if (!v.has(y)) {
1539
+ v.add(y);
1540
+ var _ = ko(y);
1541
+ for (const C of [t, document]) {
1542
+ var E = bt.get(C);
1543
+ E === void 0 && (E = /* @__PURE__ */ new Map(), bt.set(C, E));
1544
+ var j = E.get(y);
1545
+ j === void 0 ? (C.addEventListener(y, jr, { passive: _ }), E.set(y, 1)) : E.set(y, j + 1);
1489
1546
  }
1490
1547
  }
1491
1548
  }
1492
1549
  };
1493
- return h(Zi(ls)), $r.add(h), () => {
1494
- for (var v of m) for (const _ of [t, document]) {
1495
- var d = vt.get(_), y = d.get(v);
1496
- --y == 0 ? (_.removeEventListener(v, Lr), d.delete(v), d.size === 0 && vt.delete(_)) : d.set(v, y);
1550
+ return h(un(bo)), Fr.add(h), () => {
1551
+ for (var g of v) for (const _ of [t, document]) {
1552
+ var p = bt.get(_), y = p.get(g);
1553
+ --y == 0 ? (_.removeEventListener(g, jr), p.delete(g), p.size === 0 && bt.delete(_)) : p.set(g, y);
1497
1554
  }
1498
- $r.delete(h), f !== r && f.parentNode?.removeChild(f);
1555
+ Fr.delete(h), f !== r && f.parentNode?.removeChild(f);
1499
1556
  };
1500
1557
  });
1501
- return Yt.set(c, p), c;
1558
+ return or.set(c, d), c;
1502
1559
  }
1503
- var Yt = /* @__PURE__ */ new WeakMap();
1504
- function _s(e, t) {
1505
- const r = Yt.get(e);
1506
- return r ? (Yt.delete(e), r(t)) : Promise.resolve();
1560
+ var or = /* @__PURE__ */ new WeakMap();
1561
+ function Lo(e, t) {
1562
+ const r = or.get(e);
1563
+ return r ? (or.delete(e), r(t)) : Promise.resolve();
1507
1564
  }
1508
- function ys(e) {
1509
- O === null && un("onMount"), at && O.l !== null ? bs(O).m.push(e) : Ae(() => {
1510
- const t = Rt(e);
1565
+ function Oo(e) {
1566
+ L === null && bn("onMount"), ft && L.l !== null ? Ro(L).m.push(e) : Ce(() => {
1567
+ const t = Dt(e);
1511
1568
  if (typeof t == "function") return t;
1512
1569
  });
1513
1570
  }
1514
- function bs(e) {
1571
+ function Ro(e) {
1515
1572
  var t = e.l;
1516
1573
  return t.u ?? (t.u = {
1517
1574
  a: [],
@@ -1519,111 +1576,110 @@ function bs(e) {
1519
1576
  m: []
1520
1577
  });
1521
1578
  }
1522
- var jo = [...`
1523
- \r\f \v\uFEFF`], Fi, Be = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), Mr = /* @__PURE__ */ new WeakSet(), Bi = class {
1579
+ var Ui, Ve = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap(), Vr = /* @__PURE__ */ new WeakSet(), Yi = class {
1524
1580
  constructor(e) {
1525
- er(this, Mr), A(this, Be, /* @__PURE__ */ new WeakMap()), A(this, kt, void 0), A(this, Dt, void 0), b(Dt, this, e);
1581
+ ur(this, Vr), w(this, Ve, /* @__PURE__ */ new WeakMap()), w(this, Mt, void 0), w(this, Vt, void 0), b(Vt, this, e);
1526
1582
  }
1527
1583
  observe(e, t) {
1528
- var r = l(Be, this).get(e) || /* @__PURE__ */ new Set();
1529
- return r.add(t), l(Be, this).set(e, r), E(Mr, this, ws).call(this).observe(e, l(Dt, this)), () => {
1530
- var i = l(Be, this).get(e);
1531
- i.delete(t), i.size === 0 && (l(Be, this).delete(e), l(kt, this).unobserve(e));
1584
+ var r = a(Ve, this).get(e) || /* @__PURE__ */ new Set();
1585
+ return r.add(t), a(Ve, this).set(e, r), S(Vr, this, Mo).call(this).observe(e, a(Vt, this)), () => {
1586
+ var i = a(Ve, this).get(e);
1587
+ i.delete(t), i.size === 0 && (a(Ve, this).delete(e), a(Mt, this).unobserve(e));
1532
1588
  };
1533
1589
  }
1534
1590
  };
1535
- Fi = Bi;
1536
- function ws() {
1537
- return l(kt, this) ?? b(kt, this, new ResizeObserver((e) => {
1591
+ Ui = Yi;
1592
+ function Mo() {
1593
+ return a(Mt, this) ?? b(Mt, this, new ResizeObserver((e) => {
1538
1594
  for (var t of e) {
1539
- Fi.entries.set(t.target, t);
1540
- for (var r of l(Be, this).get(t.target) || []) r(t);
1595
+ Ui.entries.set(t.target, t);
1596
+ for (var r of a(Ve, this).get(t.target) || []) r(t);
1541
1597
  }
1542
1598
  }));
1543
1599
  }
1544
- u(Bi, "entries", /* @__PURE__ */ new WeakMap());
1545
- function Pr(e, t) {
1546
- return e === t || e?.[Je] === t;
1547
- }
1548
- function Ts(e = {}, t, r, i) {
1549
- var n = O.r, s = T;
1550
- return es(() => {
1551
- var o, a;
1552
- return or(() => {
1553
- o = a, a = i?.() || [], Rt(() => {
1554
- e !== r(...a) && (t(e, ...a), o && Pr(r(...o), e) && t(null, ...o));
1600
+ u(Yi, "entries", /* @__PURE__ */ new WeakMap());
1601
+ function Gr(e, t) {
1602
+ return e === t || e?.[nt] === t;
1603
+ }
1604
+ function Po(e = {}, t, r, i) {
1605
+ var n = L.r, o = A;
1606
+ return fo(() => {
1607
+ var s, l;
1608
+ return _r(() => {
1609
+ s = l, l = i?.() || [], Dt(() => {
1610
+ e !== r(...l) && (t(e, ...l), s && Gr(r(...s), e) && t(null, ...s));
1555
1611
  });
1556
1612
  }), () => {
1557
- let c = s;
1613
+ let c = o;
1558
1614
  for (; c !== n && c.parent !== null && c.parent.f & 33554432; ) c = c.parent;
1559
- const p = () => {
1560
- a && Pr(r(...a), e) && t(null, ...a);
1615
+ const d = () => {
1616
+ l && Gr(r(...l), e) && t(null, ...l);
1561
1617
  }, f = c.teardown;
1562
1618
  c.teardown = () => {
1563
- p(), f?.();
1619
+ d(), f?.();
1564
1620
  };
1565
1621
  };
1566
1622
  }), e;
1567
1623
  }
1568
- function he(e, t, r, i) {
1569
- var n = !at || (r & 2) !== 0, s = (r & 8) !== 0, o = (r & 16) !== 0, a = i, c = !0, p = () => (c && (c = !1, a = o ? Rt(i) : i), a);
1624
+ function ge(e, t, r, i) {
1625
+ var n = !ft || (r & 2) !== 0, o = (r & 8) !== 0, s = (r & 16) !== 0, l = i, c = !0, d = () => (c && (c = !1, l = s ? Dt(i) : i), l);
1570
1626
  let f;
1571
- if (s) {
1572
- var m = Je in e || qr in e;
1573
- f = ke(e, t)?.set ?? (m && t in e ? (k) => e[t] = k : void 0);
1574
- }
1575
- var h, v = !1;
1576
- s ? [h, v] = $n(() => e[t]) : h = e[t], h === void 0 && i !== void 0 && (h = p(), f && (n && mn(t), f(h)));
1577
- var d;
1578
- if (n ? d = () => {
1579
- var k = e[t];
1580
- return k === void 0 ? p() : (c = !0, k);
1581
- } : d = () => {
1582
- var k = e[t];
1583
- return k !== void 0 && (a = void 0), k === void 0 ? a : k;
1584
- }, n && !(r & 4)) return d;
1627
+ if (o) {
1628
+ var v = nt in e || ri in e;
1629
+ f = Oe(e, t)?.set ?? (v && t in e ? (C) => e[t] = C : void 0);
1630
+ }
1631
+ var h, g = !1;
1632
+ o ? [h, g] = Bn(() => e[t]) : h = e[t], h === void 0 && i !== void 0 && (h = d(), f && (n && En(t), f(h)));
1633
+ var p;
1634
+ if (n ? p = () => {
1635
+ var C = e[t];
1636
+ return C === void 0 ? d() : (c = !0, C);
1637
+ } : p = () => {
1638
+ var C = e[t];
1639
+ return C !== void 0 && (l = void 0), C === void 0 ? l : C;
1640
+ }, n && !(r & 4)) return p;
1585
1641
  if (f) {
1586
1642
  var y = e.$$legacy;
1587
- return function(k, q) {
1588
- return arguments.length > 0 ? ((!n || !q || y || v) && f(q ? d() : k), k) : d();
1643
+ return function(C, U) {
1644
+ return arguments.length > 0 ? ((!n || !U || y || g) && f(U ? p() : C), C) : p();
1589
1645
  };
1590
1646
  }
1591
- var _ = !1, S = (r & 1 ? ir : Bn)(() => (_ = !1, d()));
1592
- s && g(S);
1593
- var B = T;
1594
- return function(k, q) {
1647
+ var _ = !1, E = (r & 1 ? vr : Jn)(() => (_ = !1, p()));
1648
+ o && m(E);
1649
+ var j = A;
1650
+ return function(C, U) {
1595
1651
  if (arguments.length > 0) {
1596
- const be = q ? g(S) : n && s ? je(k) : k;
1597
- return $(S, be), _ = !0, a !== void 0 && (a = be), k;
1652
+ const Se = U ? m(E) : n && o ? We(C) : C;
1653
+ return $(E, Se), _ = !0, l !== void 0 && (l = Se), C;
1598
1654
  }
1599
- return ge && _ || B.f & 16384 ? S.v : g(S);
1655
+ return fe && _ || j.f & 16384 ? E.v : m(E);
1600
1656
  };
1601
1657
  }
1602
- function As(e) {
1603
- return new Ss(e);
1658
+ function xo(e) {
1659
+ return new Ho(e);
1604
1660
  }
1605
- var Te = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), Ss = class {
1661
+ var Ee = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), Ho = class {
1606
1662
  constructor(e) {
1607
- A(this, Te, void 0), A(this, te, void 0);
1608
- var t = /* @__PURE__ */ new Map(), r = (n, s) => {
1609
- var o = /* @__PURE__ */ Gn(s, !1, !1);
1610
- return t.set(n, o), o;
1663
+ w(this, Ee, void 0), w(this, ie, void 0);
1664
+ var t = /* @__PURE__ */ new Map(), r = (n, o) => {
1665
+ var s = /* @__PURE__ */ to(o, !1, !1);
1666
+ return t.set(n, s), s;
1611
1667
  };
1612
1668
  const i = new Proxy({
1613
1669
  ...e.props || {},
1614
1670
  $$events: {}
1615
1671
  }, {
1616
- get(n, s) {
1617
- return g(t.get(s) ?? r(s, Reflect.get(n, s)));
1672
+ get(n, o) {
1673
+ return m(t.get(o) ?? r(o, Reflect.get(n, o)));
1618
1674
  },
1619
- has(n, s) {
1620
- return s === qr ? !0 : (g(t.get(s) ?? r(s, Reflect.get(n, s))), Reflect.has(n, s));
1675
+ has(n, o) {
1676
+ return o === ri ? !0 : (m(t.get(o) ?? r(o, Reflect.get(n, o))), Reflect.has(n, o));
1621
1677
  },
1622
- set(n, s, o) {
1623
- return $(t.get(s) ?? r(s, o), o), Reflect.set(n, s, o);
1678
+ set(n, o, s) {
1679
+ return $(t.get(o) ?? r(o, s), s), Reflect.set(n, o, s);
1624
1680
  }
1625
1681
  });
1626
- b(te, this, (e.hydrate ? gs : Ni)(e.component, {
1682
+ b(ie, this, (e.hydrate ? $o : qi)(e.component, {
1627
1683
  target: e.target,
1628
1684
  anchor: e.anchor,
1629
1685
  props: i,
@@ -1631,38 +1687,38 @@ var Te = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), Ss =
1631
1687
  intro: e.intro ?? !1,
1632
1688
  recover: e.recover,
1633
1689
  transformError: e.transformError
1634
- })), !Re && (!e?.props?.$$host || e.sync === !1) && se(), b(Te, this, i.$$events);
1635
- for (const n of Object.keys(l(te, this)))
1636
- n === "$set" || n === "$destroy" || n === "$on" || At(this, n, {
1690
+ })), !we && (!e?.props?.$$host || e.sync === !1) && ue(), b(Ee, this, i.$$events);
1691
+ for (const n of Object.keys(a(ie, this)))
1692
+ n === "$set" || n === "$destroy" || n === "$on" || $t(this, n, {
1637
1693
  get() {
1638
- return l(te, this)[n];
1694
+ return a(ie, this)[n];
1639
1695
  },
1640
- set(s) {
1641
- l(te, this)[n] = s;
1696
+ set(o) {
1697
+ a(ie, this)[n] = o;
1642
1698
  },
1643
1699
  enumerable: !0
1644
1700
  });
1645
- l(te, this).$set = (n) => {
1701
+ a(ie, this).$set = (n) => {
1646
1702
  Object.assign(i, n);
1647
- }, l(te, this).$destroy = () => {
1648
- _s(l(te, this));
1703
+ }, a(ie, this).$destroy = () => {
1704
+ Lo(a(ie, this));
1649
1705
  };
1650
1706
  }
1651
1707
  $set(e) {
1652
- l(te, this).$set(e);
1708
+ a(ie, this).$set(e);
1653
1709
  }
1654
1710
  $on(e, t) {
1655
- l(Te, this)[e] = l(Te, this)[e] || [];
1711
+ a(Ee, this)[e] = a(Ee, this)[e] || [];
1656
1712
  const r = (...i) => t.call(this, ...i);
1657
- return l(Te, this)[e].push(r), () => {
1658
- l(Te, this)[e] = l(Te, this)[e].filter((i) => i !== r);
1713
+ return a(Ee, this)[e].push(r), () => {
1714
+ a(Ee, this)[e] = a(Ee, this)[e].filter((i) => i !== r);
1659
1715
  };
1660
1716
  }
1661
1717
  $destroy() {
1662
- l(te, this).$destroy();
1718
+ a(ie, this).$destroy();
1663
1719
  }
1664
- }, Vi;
1665
- typeof HTMLElement == "function" && (Vi = class extends HTMLElement {
1720
+ }, Xi;
1721
+ typeof HTMLElement == "function" && (Xi = class extends HTMLElement {
1666
1722
  constructor(e, t, r) {
1667
1723
  super(), u(this, "$$ctor", void 0), u(this, "$$s", void 0), u(this, "$$c", void 0), u(this, "$$cn", !1), u(this, "$$d", {}), u(this, "$$r", !1), u(this, "$$p_d", {}), u(this, "$$l", {}), u(this, "$$l_u", /* @__PURE__ */ new Map()), u(this, "$$me", void 0), u(this, "$$shadowRoot", null), this.$$ctor = e, this.$$s = t, r && (this.$$shadowRoot = this.attachShadow(r));
1668
1724
  }
@@ -1683,19 +1739,19 @@ typeof HTMLElement == "function" && (Vi = class extends HTMLElement {
1683
1739
  if (this.$$cn = !0, !this.$$c) {
1684
1740
  let e = function(i) {
1685
1741
  return (n) => {
1686
- const s = Ai("slot");
1687
- i !== "default" && (s.name = i), Hi(n, s);
1742
+ const o = Ri("slot");
1743
+ i !== "default" && (o.name = i), Wi(n, o);
1688
1744
  };
1689
1745
  };
1690
1746
  if (await Promise.resolve(), !this.$$cn || this.$$c) return;
1691
- const t = {}, r = Is(this);
1747
+ const t = {}, r = No(this);
1692
1748
  for (const i of this.$$s) i in r && (i === "default" && !this.$$d.children ? (this.$$d.children = e(i), t.default = !0) : t[i] = e(i));
1693
1749
  for (const i of this.attributes) {
1694
1750
  const n = this.$$g_p(i.name);
1695
- n in this.$$d || (this.$$d[n] = yt(n, i.value, this.$$p_d, "toProp"));
1751
+ n in this.$$d || (this.$$d[n] = It(n, i.value, this.$$p_d, "toProp"));
1696
1752
  }
1697
1753
  for (const i in this.$$p_d) !(i in this.$$d) && this[i] !== void 0 && (this.$$d[i] = this[i], delete this[i]);
1698
- this.$$c = As({
1754
+ this.$$c = xo({
1699
1755
  component: this.$$ctor,
1700
1756
  target: this.$$shadowRoot || this,
1701
1757
  props: {
@@ -1703,27 +1759,27 @@ typeof HTMLElement == "function" && (Vi = class extends HTMLElement {
1703
1759
  $$slots: t,
1704
1760
  $$host: this
1705
1761
  }
1706
- }), this.$$me = Jn(() => {
1707
- or(() => {
1762
+ }), this.$$me = co(() => {
1763
+ _r(() => {
1708
1764
  this.$$r = !0;
1709
- for (const i of Tt(this.$$c)) {
1765
+ for (const i of Ct(this.$$c)) {
1710
1766
  if (!this.$$p_d[i]?.reflect) continue;
1711
1767
  this.$$d[i] = this.$$c[i];
1712
- const n = yt(i, this.$$d[i], this.$$p_d, "toAttribute");
1768
+ const n = It(i, this.$$d[i], this.$$p_d, "toAttribute");
1713
1769
  n == null ? this.removeAttribute(this.$$p_d[i].attribute || i) : this.setAttribute(this.$$p_d[i].attribute || i, n);
1714
1770
  }
1715
1771
  this.$$r = !1;
1716
1772
  });
1717
1773
  });
1718
1774
  for (const i in this.$$l) for (const n of this.$$l[i]) {
1719
- const s = this.$$c.$on(i, n);
1720
- this.$$l_u.set(n, s);
1775
+ const o = this.$$c.$on(i, n);
1776
+ this.$$l_u.set(n, o);
1721
1777
  }
1722
1778
  this.$$l = {};
1723
1779
  }
1724
1780
  }
1725
1781
  attributeChangedCallback(e, t, r) {
1726
- this.$$r || (e = this.$$g_p(e), this.$$d[e] = yt(e, r, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
1782
+ this.$$r || (e = this.$$g_p(e), this.$$d[e] = It(e, r, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
1727
1783
  }
1728
1784
  disconnectedCallback() {
1729
1785
  this.$$cn = !1, Promise.resolve().then(() => {
@@ -1731,10 +1787,10 @@ typeof HTMLElement == "function" && (Vi = class extends HTMLElement {
1731
1787
  });
1732
1788
  }
1733
1789
  $$g_p(e) {
1734
- return Tt(this.$$p_d).find((t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e) || e;
1790
+ return Ct(this.$$p_d).find((t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e) || e;
1735
1791
  }
1736
1792
  });
1737
- function yt(e, t, r, i) {
1793
+ function It(e, t, r, i) {
1738
1794
  const n = r[e]?.type;
1739
1795
  if (t = n === "Boolean" && typeof t != "boolean" ? t != null : t, !i || !r[e]) return t;
1740
1796
  if (i === "toAttribute") switch (n) {
@@ -1760,46 +1816,46 @@ function yt(e, t, r, i) {
1760
1816
  return t;
1761
1817
  }
1762
1818
  }
1763
- function Is(e) {
1819
+ function No(e) {
1764
1820
  const t = {};
1765
1821
  return e.childNodes.forEach((r) => {
1766
1822
  t[r.slot || "default"] = !0;
1767
1823
  }), t;
1768
1824
  }
1769
- function Es(e, t, r, i, n, s) {
1770
- let o = class extends Vi {
1825
+ function Do(e, t, r, i, n, o) {
1826
+ let s = class extends Xi {
1771
1827
  constructor() {
1772
1828
  super(e, r, n), this.$$p_d = t;
1773
1829
  }
1774
1830
  static get observedAttributes() {
1775
- return Tt(t).map((a) => (t[a].attribute || a).toLowerCase());
1831
+ return Ct(t).map((l) => (t[l].attribute || l).toLowerCase());
1776
1832
  }
1777
1833
  };
1778
- return Tt(t).forEach((a) => {
1779
- At(o.prototype, a, {
1834
+ return Ct(t).forEach((l) => {
1835
+ $t(s.prototype, l, {
1780
1836
  get() {
1781
- return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a];
1837
+ return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l];
1782
1838
  },
1783
1839
  set(c) {
1784
- c = yt(a, c, t), this.$$d[a] = c;
1785
- var p = this.$$c;
1786
- p && (ke(p, a)?.get ? p[a] = c : p.$set({ [a]: c }));
1840
+ c = It(l, c, t), this.$$d[l] = c;
1841
+ var d = this.$$c;
1842
+ d && (Oe(d, l)?.get ? d[l] = c : d.$set({ [l]: c }));
1787
1843
  }
1788
1844
  });
1789
- }), i.forEach((a) => {
1790
- At(o.prototype, a, { get() {
1791
- return this.$$c?.[a];
1845
+ }), i.forEach((l) => {
1846
+ $t(s.prototype, l, { get() {
1847
+ return this.$$c?.[l];
1792
1848
  } });
1793
- }), s && (o = s(o)), e.element = o, o;
1849
+ }), o && (s = o(s)), e.element = s, s;
1794
1850
  }
1795
- var ks = class extends Event {
1851
+ var Fo = class extends Event {
1796
1852
  constructor(e, t, r, i) {
1797
1853
  super("context-request", {
1798
1854
  bubbles: !0,
1799
1855
  composed: !0
1800
1856
  }), u(this, "context", void 0), u(this, "contextTarget", void 0), u(this, "callback", void 0), u(this, "subscribe", void 0), this.context = e, this.contextTarget = t, this.callback = r, this.subscribe = i ?? !1;
1801
1857
  }
1802
- }, Cs = class {
1858
+ }, Bo = class {
1803
1859
  constructor(e, t) {
1804
1860
  u(this, "host", void 0), u(this, "context", void 0), u(this, "subscribe", void 0), u(this, "onValue", void 0), u(this, "isConnected", !1), u(this, "unsubscribe", void 0), u(this, "currentValue", void 0), u(this, "handleValue", (r, i) => {
1805
1861
  i !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = i), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = r, this.onValue?.(r);
@@ -1815,77 +1871,146 @@ var ks = class extends Event {
1815
1871
  return this.currentValue;
1816
1872
  }
1817
1873
  requestValue() {
1818
- this.host.dispatchEvent(new ks(this.context, this.host, this.handleValue, this.subscribe));
1874
+ this.host.dispatchEvent(new Fo(this.context, this.host, this.handleValue, this.subscribe));
1819
1875
  }
1820
- }, Mt = (e) => e, $s = Mt(Symbol.for("pie.assessmentToolkit.runtimeContext")), zo = Mt(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Os = Mt(Symbol.for("pie.assessmentToolkit.shellContext")), Go = Mt(Symbol.for("pie.assessmentToolkit.regionScopeContext"));
1821
- function ji(e, t, r) {
1876
+ }, Ft = (e) => e, jo = Ft(Symbol.for("pie.assessmentToolkit.runtimeContext")), oa = Ft(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), zo = Ft(Symbol.for("pie.assessmentToolkit.shellContext")), sa = Ft(Symbol.for("pie.assessmentToolkit.regionScopeContext"));
1877
+ function Qi(e, t, r) {
1822
1878
  let i = !1;
1823
- const n = new Cs(e, {
1879
+ const n = new Bo(e, {
1824
1880
  context: t,
1825
1881
  subscribe: !0,
1826
- onValue: (p) => {
1827
- i = !0, r(p);
1882
+ onValue: (d) => {
1883
+ i = !0, r(d);
1828
1884
  }
1829
1885
  });
1830
1886
  n.connect();
1831
- const s = (p) => {
1832
- p.context === t && n.requestValue();
1887
+ const o = (d) => {
1888
+ d.context === t && n.requestValue();
1833
1889
  };
1834
- e.addEventListener("context-provider", s);
1835
- let o = 0;
1836
- const a = 200, c = globalThis.setInterval(() => {
1837
- if (i || o >= a) {
1890
+ e.addEventListener("context-provider", o);
1891
+ let s = 0;
1892
+ const l = 200, c = globalThis.setInterval(() => {
1893
+ if (i || s >= l) {
1838
1894
  globalThis.clearInterval(c);
1839
1895
  return;
1840
1896
  }
1841
- o += 1, n.requestValue();
1897
+ s += 1, n.requestValue();
1842
1898
  }, 50);
1843
1899
  return () => {
1844
- globalThis.clearInterval(c), e.removeEventListener("context-provider", s), n.disconnect();
1900
+ globalThis.clearInterval(c), e.removeEventListener("context-provider", o), n.disconnect();
1845
1901
  };
1846
1902
  }
1847
- function Ls(e, t) {
1848
- return ji(e, $s, t);
1903
+ function Vo(e, t) {
1904
+ return Qi(e, jo, t);
1849
1905
  }
1850
- function Rs(e, t) {
1851
- return ji(e, Os, t);
1906
+ function Go(e, t) {
1907
+ return Qi(e, zo, t);
1852
1908
  }
1853
- function Ms(e, t) {
1854
- return Ls(e, t);
1909
+ function Wo(e, t) {
1910
+ return Vo(e, t);
1855
1911
  }
1856
- function Ps(e, t) {
1857
- return Rs(e, t);
1912
+ function qo(e, t) {
1913
+ return Go(e, t);
1858
1914
  }
1859
- var xr;
1915
+ var Wr;
1860
1916
  (function(e) {
1861
1917
  e.TTS_WORD = "tts-word", e.TTS_SENTENCE = "tts-sentence", e.ANNOTATION = "annotation";
1862
- })(xr || (xr = {}));
1863
- var Hr;
1918
+ })(Wr || (Wr = {}));
1919
+ var qr;
1864
1920
  (function(e) {
1865
1921
  e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange", e.UNDERLINE = "underline";
1866
- })(Hr || (Hr = {}));
1867
- function zi(e) {
1922
+ })(qr || (qr = {}));
1923
+ function Ji(e) {
1868
1924
  return (...t) => {
1869
1925
  console.debug(`[${e}]`, ...t);
1870
1926
  };
1871
1927
  }
1872
- var Wo = zi("I18nService"), Ft = {
1928
+ var aa = Ji("I18nService"), Gt = {
1873
1929
  assessment: [],
1874
1930
  section: [],
1875
1931
  item: [],
1876
1932
  passage: [],
1877
1933
  rubric: [],
1878
1934
  element: []
1879
- }, qo = {
1880
- section: [...Ft.section],
1881
- item: [...Ft.item],
1882
- passage: [...Ft.passage]
1935
+ }, Wt = {
1936
+ section: [...Gt.section],
1937
+ item: [...Gt.item],
1938
+ passage: [...Gt.passage]
1883
1939
  };
1884
- function xs(e) {
1940
+ function Ne(e) {
1941
+ return typeof e == "object" && e !== null && !Array.isArray(e);
1942
+ }
1943
+ function me(e, t) {
1944
+ if (e == null) return [];
1945
+ if (!Array.isArray(e)) throw new Error(`Invalid tools config at "${t}": expected an array of tool ids.`);
1946
+ if (e.find((r) => typeof r != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
1947
+ return e;
1948
+ }
1949
+ function Ko(e) {
1950
+ if (e != null) {
1951
+ if (!Ne(e)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
1952
+ return e;
1953
+ }
1954
+ }
1955
+ function Uo(e) {
1956
+ if (e != null) {
1957
+ if (!Ne(e)) throw new Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');
1958
+ return e;
1959
+ }
1960
+ }
1961
+ function Yo(e, t) {
1962
+ if (t == null) return;
1963
+ if (!Ne(t)) throw new Error(`Invalid tools config at "providers.${e}": expected an object.`);
1964
+ const r = t;
1965
+ if ("enabled" in r && r.enabled !== void 0 && typeof r.enabled != "boolean") throw new Error(`Invalid tools config at "providers.${e}.enabled": expected a boolean.`);
1966
+ if ("settings" in r && r.settings !== void 0 && !Ne(r.settings)) throw new Error(`Invalid tools config at "providers.${e}.settings": expected an object.`);
1967
+ if ("provider" in r && r.provider !== void 0 && !Ne(r.provider)) throw new Error(`Invalid tools config at "providers.${e}.provider": expected an object.`);
1968
+ return r;
1969
+ }
1970
+ function Xo(e) {
1971
+ if (e == null) return {};
1972
+ if (!Ne(e)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
1973
+ const t = {};
1974
+ for (const [r, i] of Object.entries(e)) t[r] = Yo(r, i);
1975
+ return t;
1976
+ }
1977
+ function Zi(e) {
1885
1978
  const t = e.trim();
1886
1979
  return t || "";
1887
1980
  }
1888
- var Hs = [
1981
+ function _e(e) {
1982
+ if (!e || e.length === 0) return [];
1983
+ const t = /* @__PURE__ */ new Set();
1984
+ for (const r of e) {
1985
+ if (typeof r != "string") throw new Error("Invalid tools config: tool list entries must be strings.");
1986
+ const i = Zi(r);
1987
+ i && t.add(i);
1988
+ }
1989
+ return Array.from(t);
1990
+ }
1991
+ function Qo(e) {
1992
+ if (e != null) {
1993
+ if (e === "on" || e === "off") return e;
1994
+ throw new Error(`Invalid tools config at "qtiEnforcement": expected "on" or "off", got ${JSON.stringify(e)}.`);
1995
+ }
1996
+ }
1997
+ function Jo(e) {
1998
+ if (e != null && !Ne(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
1999
+ const t = Uo(e?.policy), r = Ko(e?.placement), i = Xo(e?.providers), n = Qo(e?.qtiEnforcement), o = {
2000
+ policy: {
2001
+ allowed: _e(me(t?.allowed, "policy.allowed")),
2002
+ blocked: _e(me(t?.blocked, "policy.blocked"))
2003
+ },
2004
+ placement: {
2005
+ section: _e(me(r?.section, "placement.section")).length ? _e(me(r?.section, "placement.section")) : [...Wt.section],
2006
+ item: _e(me(r?.item, "placement.item")).length ? _e(me(r?.item, "placement.item")) : [...Wt.item],
2007
+ passage: _e(me(r?.passage, "placement.passage")).length ? _e(me(r?.passage, "placement.passage")) : [...Wt.passage]
2008
+ },
2009
+ providers: i
2010
+ };
2011
+ return n && (o.qtiEnforcement = n), o;
2012
+ }
2013
+ var Zo = [
1889
2014
  "assessment",
1890
2015
  "section",
1891
2016
  "item",
@@ -1893,13 +2018,38 @@ var Hs = [
1893
2018
  "rubric",
1894
2019
  "element"
1895
2020
  ];
1896
- function bt(e, t) {
2021
+ function Et(e, t) {
1897
2022
  if (typeof e != "string" || e.trim().length === 0) throw new Error(`Invalid tool registration: "${t}" must be a non-empty string.`);
1898
2023
  }
1899
- function Nr(e) {
1900
- if (bt(e.toolId, "toolId"), bt(e.name, "name"), bt(e.description, "description"), typeof e.icon != "string" && typeof e.icon != "function") throw new Error(`Invalid tool registration "${e.toolId}": "icon" must be a string or function.`);
1901
- if (!Array.isArray(e.supportedLevels) || e.supportedLevels.length === 0) throw new Error(`Invalid tool registration "${e.toolId}": "supportedLevels" must be a non-empty array.`);
1902
- const t = e.supportedLevels.find((r) => !Hs.includes(r));
2024
+ var es = [
2025
+ {
2026
+ pattern: /<script\b/i,
2027
+ reason: "contains a <script> tag"
2028
+ },
2029
+ {
2030
+ pattern: /\son[a-z]+\s*=/i,
2031
+ reason: "contains an inline event handler (on*=) attribute"
2032
+ },
2033
+ {
2034
+ pattern: /javascript:/i,
2035
+ reason: "contains a javascript: URL"
2036
+ },
2037
+ {
2038
+ pattern: /<foreignObject\b/i,
2039
+ reason: "contains a <foreignObject> element"
2040
+ }
2041
+ ];
2042
+ function ts(e, t, r) {
2043
+ const i = t.trimStart(), n = i.toLowerCase().startsWith("<svg"), o = /^https?:/i.test(i);
2044
+ if (/^data:/i.test(i)) throw new Error(`Invalid tool registration "${e}": "${r}" may not be a data: URL.`);
2045
+ if (!(!n && !o)) {
2046
+ for (const { pattern: s, reason: l } of es) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${r}" ${l}. Inline SVG icons must not include scriptable content.`);
2047
+ }
2048
+ }
2049
+ function Kr(e) {
2050
+ if (Et(e.toolId, "toolId"), Et(e.name, "name"), Et(e.description, "description"), typeof e.icon != "string" && typeof e.icon != "function") throw new Error(`Invalid tool registration "${e.toolId}": "icon" must be a string or function.`);
2051
+ if (typeof e.icon == "string" && ts(e.toolId, e.icon, "icon"), !Array.isArray(e.supportedLevels) || e.supportedLevels.length === 0) throw new Error(`Invalid tool registration "${e.toolId}": "supportedLevels" must be a non-empty array.`);
2052
+ const t = e.supportedLevels.find((r) => !Zo.includes(r));
1903
2053
  if (t) throw new Error(`Invalid tool registration "${e.toolId}": unsupported level "${t}".`);
1904
2054
  if (e.activation !== void 0 && e.activation !== "toolbar-toggle" && e.activation !== "selection-gateway") throw new Error(`Invalid tool registration "${e.toolId}": unsupported activation "${String(e.activation)}".`);
1905
2055
  if (e.singletonScope !== void 0 && e.singletonScope !== "section") throw new Error(`Invalid tool registration "${e.toolId}": unsupported singletonScope "${String(e.singletonScope)}".`);
@@ -1908,23 +2058,23 @@ function Nr(e) {
1908
2058
  if (typeof e.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${e.toolId}": "isVisibleInContext" must be a function.`);
1909
2059
  if (typeof e.renderToolbar != "function") throw new Error(`Invalid tool registration "${e.toolId}": "renderToolbar" must be a function.`);
1910
2060
  }
1911
- var Ns = class {
2061
+ var rs = class {
1912
2062
  constructor() {
1913
2063
  u(this, "tools", /* @__PURE__ */ new Map()), u(this, "pnpIndex", /* @__PURE__ */ new Map()), u(this, "componentOverrides", {}), u(this, "moduleLoaders", /* @__PURE__ */ new Map()), u(this, "loadedToolModules", /* @__PURE__ */ new Set()), u(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
1914
2064
  }
1915
2065
  normalizeToolId(e) {
1916
- return xs(e);
2066
+ return Zi(e);
1917
2067
  }
1918
2068
  normalizeToolIds(e) {
1919
2069
  return e.map((t) => this.normalizeToolId(t));
1920
2070
  }
1921
2071
  register(e) {
1922
- if (Nr(e), this.tools.has(e.toolId)) throw new Error(`Tool '${e.toolId}' is already registered`);
2072
+ if (Kr(e), this.tools.has(e.toolId)) throw new Error(`Tool '${e.toolId}' is already registered`);
1923
2073
  if (this.tools.set(e.toolId, e), e.pnpSupportIds) for (const t of e.pnpSupportIds)
1924
2074
  this.pnpIndex.has(t) || this.pnpIndex.set(t, /* @__PURE__ */ new Set()), this.pnpIndex.get(t).add(e.toolId);
1925
2075
  }
1926
2076
  override(e) {
1927
- if (Nr(e), !this.tools.has(e.toolId)) throw new Error(`Cannot override non-existent tool '${e.toolId}'`);
2077
+ if (Kr(e), !this.tools.has(e.toolId)) throw new Error(`Cannot override non-existent tool '${e.toolId}'`);
1928
2078
  const t = this.tools.get(e.toolId);
1929
2079
  if (t.pnpSupportIds) for (const r of t.pnpSupportIds) this.pnpIndex.get(r)?.delete(e.toolId);
1930
2080
  if (this.tools.set(e.toolId, e), e.pnpSupportIds) for (const r of e.pnpSupportIds)
@@ -1975,8 +2125,8 @@ var Ns = class {
1975
2125
  if (n.supportedLevels.includes(t.level))
1976
2126
  try {
1977
2127
  n.isVisibleInContext(t) && r.push(n);
1978
- } catch (s) {
1979
- console.error(`Error evaluating visibility for tool '${i}':`, s);
2128
+ } catch (o) {
2129
+ console.error(`Error evaluating visibility for tool '${i}':`, o);
1980
2130
  }
1981
2131
  }
1982
2132
  return r;
@@ -2009,7 +2159,7 @@ var Ns = class {
2009
2159
  setToolModuleLoaders(e) {
2010
2160
  for (const [t, r] of Object.entries(e))
2011
2161
  if (r) {
2012
- if (bt(t, "tool module loader id"), typeof r != "function") throw new Error(`Invalid tool module loader for "${t}": expected a function.`);
2162
+ if (Et(t, "tool module loader id"), typeof r != "function") throw new Error(`Invalid tool module loader for "${t}": expected a function.`);
2013
2163
  this.moduleLoaders.set(t, r);
2014
2164
  }
2015
2165
  }
@@ -2051,80 +2201,80 @@ var Ns = class {
2051
2201
  return i.renderToolbar(t, n);
2052
2202
  }
2053
2203
  };
2054
- function Gi(e) {
2204
+ function en(e) {
2055
2205
  return e.level === "item";
2056
2206
  }
2057
- function Ds(e) {
2207
+ function is(e) {
2058
2208
  return e.level === "passage";
2059
2209
  }
2060
- function Fs(e) {
2210
+ function ns(e) {
2061
2211
  return e.level === "rubric";
2062
2212
  }
2063
- function Wi(e) {
2213
+ function tn(e) {
2064
2214
  return e.level === "element";
2065
2215
  }
2066
- function lr(e) {
2067
- if (Wi(e)) {
2216
+ function br(e) {
2217
+ if (tn(e)) {
2068
2218
  const t = e.item.config;
2069
2219
  if (!t) return "";
2070
- const r = [], i = (a) => a.replace(/<[^>]*>/g, " ").trim(), n = t.elements?.[e.elementId];
2220
+ const r = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim(), n = t.elements?.[e.elementId];
2071
2221
  n && typeof n == "string" && r.push(i(n));
2072
- const s = t.models, o = (Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : []).find((a) => a && typeof a == "object" && a.id === e.elementId);
2073
- if (o) {
2074
- for (const a of Object.values(o))
2075
- if (typeof a == "string" && r.push(i(a)), Array.isArray(a)) {
2076
- for (const c of a) if (c && typeof c == "object")
2077
- for (const p of Object.values(c)) typeof p == "string" && r.push(i(p));
2222
+ const o = t.models, s = (Array.isArray(o) ? o : o && typeof o == "object" ? Object.values(o) : []).find((l) => l && typeof l == "object" && l.id === e.elementId);
2223
+ if (s) {
2224
+ for (const l of Object.values(s))
2225
+ if (typeof l == "string" && r.push(i(l)), Array.isArray(l)) {
2226
+ for (const c of l) if (c && typeof c == "object")
2227
+ for (const d of Object.values(c)) typeof d == "string" && r.push(i(d));
2078
2228
  }
2079
2229
  }
2080
2230
  return r.filter(Boolean).join(" ").trim();
2081
2231
  }
2082
- if (Gi(e)) {
2232
+ if (en(e)) {
2083
2233
  const t = e.item;
2084
2234
  if (!t?.config) return "";
2085
2235
  const r = t.config, i = [], n = (c) => c.replace(/<[^>]*>/g, " ").trim();
2086
2236
  typeof r.markup == "string" && i.push(n(r.markup));
2087
- const s = r.elements;
2088
- if (s && typeof s == "object")
2089
- for (const c of Object.values(s)) typeof c == "string" && i.push(n(c));
2090
- const o = r.models, a = Array.isArray(o) ? o : o && typeof o == "object" ? Object.values(o) : [];
2091
- for (const c of a)
2237
+ const o = r.elements;
2238
+ if (o && typeof o == "object")
2239
+ for (const c of Object.values(o)) typeof c == "string" && i.push(n(c));
2240
+ const s = r.models, l = Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : [];
2241
+ for (const c of l)
2092
2242
  if (!(!c || typeof c != "object")) {
2093
- for (const p of Object.values(c))
2094
- if (typeof p == "string" && i.push(n(p)), Array.isArray(p)) {
2095
- for (const f of p) if (f && typeof f == "object")
2096
- for (const m of Object.values(f)) typeof m == "string" && i.push(n(m));
2243
+ for (const d of Object.values(c))
2244
+ if (typeof d == "string" && i.push(n(d)), Array.isArray(d)) {
2245
+ for (const f of d) if (f && typeof f == "object")
2246
+ for (const v of Object.values(f)) typeof v == "string" && i.push(n(v));
2097
2247
  }
2098
2248
  }
2099
2249
  return i.filter(Boolean).join(" ").trim();
2100
2250
  }
2101
- if (Ds(e)) {
2251
+ if (is(e)) {
2102
2252
  const t = e.passage;
2103
2253
  if (!t?.config) return "";
2104
2254
  const r = t.config, i = [], n = (c) => c.replace(/<[^>]*>/g, " ").trim();
2105
2255
  typeof r.markup == "string" && i.push(n(r.markup)), typeof r.content == "string" && i.push(n(r.content)), typeof r.prompt == "string" && i.push(n(r.prompt));
2106
- const s = r.elements;
2107
- if (s && typeof s == "object")
2108
- for (const c of Object.values(s)) typeof c == "string" && i.push(n(c));
2109
- const o = r.models, a = Array.isArray(o) ? o : o && typeof o == "object" ? Object.values(o) : [];
2110
- for (const c of a)
2256
+ const o = r.elements;
2257
+ if (o && typeof o == "object")
2258
+ for (const c of Object.values(o)) typeof c == "string" && i.push(n(c));
2259
+ const s = r.models, l = Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : [];
2260
+ for (const c of l)
2111
2261
  if (!(!c || typeof c != "object")) {
2112
- for (const p of Object.values(c))
2113
- if (typeof p == "string" && i.push(n(p)), Array.isArray(p)) {
2114
- for (const f of p) if (f && typeof f == "object")
2115
- for (const m of Object.values(f)) typeof m == "string" && i.push(n(m));
2262
+ for (const d of Object.values(c))
2263
+ if (typeof d == "string" && i.push(n(d)), Array.isArray(d)) {
2264
+ for (const f of d) if (f && typeof f == "object")
2265
+ for (const v of Object.values(f)) typeof v == "string" && i.push(n(v));
2116
2266
  }
2117
2267
  }
2118
2268
  return i.filter(Boolean).join(" ").trim();
2119
2269
  }
2120
- if (Fs(e)) {
2270
+ if (ns(e)) {
2121
2271
  const t = e.rubricBlock;
2122
2272
  return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
2123
2273
  }
2124
2274
  return "";
2125
2275
  }
2126
- function Pt(e) {
2127
- const t = lr(e);
2276
+ function Bt(e) {
2277
+ const t = br(e);
2128
2278
  return [
2129
2279
  /<math[>\s]/i,
2130
2280
  /\\\[([^\]]+)\\\]/,
@@ -2134,7 +2284,7 @@ function Pt(e) {
2134
2284
  /\d+\s*[+\-*/=]\s*\d+/
2135
2285
  ].some((r) => r.test(t));
2136
2286
  }
2137
- function Bs(e) {
2287
+ function os(e) {
2138
2288
  const t = [
2139
2289
  "pie-multiple-choice",
2140
2290
  "pie-inline-choice",
@@ -2143,15 +2293,15 @@ function Bs(e) {
2143
2293
  "inline-choice",
2144
2294
  "select-text"
2145
2295
  ];
2146
- if (Wi(e)) {
2296
+ if (tn(e)) {
2147
2297
  const r = e.item.config;
2148
2298
  if (!r?.models) return !1;
2149
- const i = (Array.isArray(r.models) ? r.models : Object.values(r.models)).find((s) => s && typeof s == "object" && s.id === e.elementId);
2299
+ const i = (Array.isArray(r.models) ? r.models : Object.values(r.models)).find((o) => o && typeof o == "object" && o.id === e.elementId);
2150
2300
  if (!i) return !1;
2151
2301
  const n = i.element || "";
2152
2302
  return t.includes(n);
2153
2303
  }
2154
- if (Gi(e)) {
2304
+ if (en(e)) {
2155
2305
  const r = e.item.config?.models;
2156
2306
  return (Array.isArray(r) ? r : r && typeof r == "object" ? Object.values(r) : []).some((i) => {
2157
2307
  if (!i || typeof i != "object") return !1;
@@ -2161,11 +2311,11 @@ function Bs(e) {
2161
2311
  }
2162
2312
  return !1;
2163
2313
  }
2164
- function xt(e) {
2165
- return lr(e).trim().length >= 10;
2314
+ function jt(e) {
2315
+ return br(e).trim().length >= 10;
2166
2316
  }
2167
- function Vs(e) {
2168
- const t = lr(e);
2317
+ function ss(e) {
2318
+ const t = br(e);
2169
2319
  return [
2170
2320
  /chemistry|chemical|element|atom|molecule|compound/i,
2171
2321
  /periodic\s+table/i,
@@ -2175,23 +2325,23 @@ function Vs(e) {
2175
2325
  /physics|force|energy|velocity|acceleration/i
2176
2326
  ].some((r) => r.test(t));
2177
2327
  }
2178
- var js = [
2328
+ var as = [
2179
2329
  "assessment",
2180
2330
  "section",
2181
2331
  "item",
2182
2332
  "passage",
2183
2333
  "rubric"
2184
- ], zs = new Set(js);
2185
- function Gs(e) {
2186
- return zs.has(e);
2334
+ ], ls = new Set(as);
2335
+ function cs(e) {
2336
+ return ls.has(e);
2187
2337
  }
2188
- function cr(e, t, r) {
2338
+ function wr(e, t, r) {
2189
2339
  const i = e.trim(), n = r.trim();
2190
2340
  if (!i || !n) throw new Error("Tool instance ids require non-empty tool and scope ids");
2191
- if (!Gs(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
2341
+ if (!cs(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
2192
2342
  return `${i}:${t}:${n}`;
2193
2343
  }
2194
- var Ws = class {
2344
+ var us = class {
2195
2345
  constructor() {
2196
2346
  u(this, "providerId", "desmos-calculator"), u(this, "providerName", "Desmos Calculator"), u(this, "category", "calculator"), u(this, "version", "1.10"), u(this, "requiresAuth", !0), u(this, "desmosProvider", null), u(this, "config", null);
2197
2347
  }
@@ -2213,34 +2363,36 @@ var Ws = class {
2213
2363
  toolId: "calculator",
2214
2364
  operation: "desmos-provider-module-import",
2215
2365
  backend: "desmos"
2216
- }), this.desmosProvider = new (await (async () => {
2366
+ });
2367
+ const r = await (async () => {
2217
2368
  try {
2218
- const r = await import("./dist-DwP27yIs.js");
2369
+ const i = await import("./dist-rF11IR1B.js");
2219
2370
  return await this.emitTelemetry("pie-tool-library-load-success", {
2220
2371
  toolId: "calculator",
2221
2372
  operation: "desmos-provider-module-import",
2222
2373
  backend: "desmos",
2223
2374
  duration: Date.now() - t
2224
- }), r;
2225
- } catch (r) {
2375
+ }), i;
2376
+ } catch (i) {
2226
2377
  throw await this.emitTelemetry("pie-tool-library-load-error", {
2227
2378
  toolId: "calculator",
2228
2379
  operation: "desmos-provider-module-import",
2229
2380
  backend: "desmos",
2230
2381
  duration: Date.now() - t,
2231
2382
  errorType: "ToolLibraryLoadError",
2232
- message: r instanceof Error ? r.message : String(r)
2233
- }), r;
2383
+ message: i instanceof Error ? i.message : String(i)
2384
+ }), i;
2234
2385
  }
2235
- })()).DesmosCalculatorProvider();
2386
+ })();
2387
+ this.desmosProvider = new r.DesmosCalculatorProvider();
2236
2388
  try {
2237
2389
  await this.desmosProvider.initialize({
2238
2390
  apiKey: e.apiKey,
2239
2391
  proxyEndpoint: e.proxyEndpoint,
2240
2392
  onTelemetry: e.onTelemetry
2241
2393
  }), console.log(`[DesmosToolProvider] Initialized successfully ${e.proxyEndpoint ? "(using proxy)" : e.apiKey ? "(direct API key)" : "(no auth)"}`);
2242
- } catch (r) {
2243
- throw console.error("[DesmosToolProvider] Initialization failed:", r), new Error("Failed to initialize Desmos calculator provider. Check API key or proxy endpoint.");
2394
+ } catch (i) {
2395
+ throw console.error("[DesmosToolProvider] Initialization failed:", i), new Error("Failed to initialize Desmos calculator provider. Check API key or proxy endpoint.");
2244
2396
  }
2245
2397
  }
2246
2398
  async createInstance(e) {
@@ -2266,41 +2418,41 @@ var Ws = class {
2266
2418
  destroy() {
2267
2419
  this.desmosProvider && (this.desmosProvider.destroy(), this.desmosProvider = null), this.config = null, console.log("[DesmosToolProvider] Destroyed");
2268
2420
  }
2269
- }, qs = (e, t) => {
2421
+ }, ds = (e, t) => {
2270
2422
  const r = t?.useSentenceSegmenter !== !1;
2271
2423
  try {
2272
2424
  if (!r) throw new Error("Segmenter disabled by policy");
2273
- const o = globalThis.Intl?.Segmenter;
2274
- if (typeof o == "function") {
2275
- const a = new o(t?.locale, { granularity: "sentence" }), c = Array.from(a.segment(e)).map((p) => ({
2276
- text: p.segment,
2277
- offset: p.index
2278
- })).filter((p) => p.text.trim().length > 0);
2425
+ const s = globalThis.Intl?.Segmenter;
2426
+ if (typeof s == "function") {
2427
+ const l = new s(t?.locale, { granularity: "sentence" }), c = Array.from(l.segment(e)).map((d) => ({
2428
+ text: d.segment,
2429
+ offset: d.index
2430
+ })).filter((d) => d.text.trim().length > 0);
2279
2431
  if (c.length > 0) return c;
2280
2432
  }
2281
2433
  } catch {
2282
2434
  }
2283
2435
  const i = e.match(/[^.!?]+(?:[.!?]+|$)/g) || [e], n = [];
2284
- let s = 0;
2285
- for (const o of i) {
2286
- const a = e.indexOf(o, s);
2287
- a !== -1 && (n.push({
2288
- text: o,
2289
- offset: a
2290
- }), s = a + o.length);
2436
+ let o = 0;
2437
+ for (const s of i) {
2438
+ const l = e.indexOf(s, o);
2439
+ l !== -1 && (n.push({
2440
+ text: s,
2441
+ offset: l
2442
+ }), o = l + s.length);
2291
2443
  }
2292
2444
  return n.length > 0 ? n : [{
2293
2445
  text: e,
2294
2446
  offset: 0
2295
2447
  }];
2296
- }, Ks = class {
2448
+ }, fs = class {
2297
2449
  constructor() {
2298
2450
  u(this, "providerId", "browser"), u(this, "providerName", "Browser Speech Synthesis"), u(this, "version", "1.0.0");
2299
2451
  }
2300
2452
  async initialize(e) {
2301
2453
  if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
2302
2454
  if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
2303
- return new Us(e);
2455
+ return new hs(e);
2304
2456
  }
2305
2457
  supportsFeature(e) {
2306
2458
  return !0;
@@ -2317,7 +2469,7 @@ var Ws = class {
2317
2469
  }
2318
2470
  destroy() {
2319
2471
  }
2320
- }, Us = class {
2472
+ }, hs = class {
2321
2473
  constructor(e) {
2322
2474
  u(this, "utterance", null), u(this, "config", null), u(this, "_isPlaying", !1), u(this, "_isPaused", !1), u(this, "speakRunId", 0), u(this, "onWordBoundary", void 0), this.config = e;
2323
2475
  }
@@ -2335,8 +2487,8 @@ var Ws = class {
2335
2487
  for (const r of e) {
2336
2488
  if (t !== this.speakRunId) break;
2337
2489
  const i = this.splitIntoChunks(r.text);
2338
- for (const s of i)
2339
- if (t !== this.speakRunId || !await this.speakChunk(s.text, r.startOffset + s.offset, t)) break;
2490
+ for (const o of i)
2491
+ if (t !== this.speakRunId || !await this.speakChunk(o.text, r.startOffset + o.offset, t)) break;
2340
2492
  const n = Math.max(0, Number(r.pauseMsAfter || 0));
2341
2493
  if (n > 0 && t === this.speakRunId && !await this.waitForPause(n, t))
2342
2494
  break;
@@ -2351,24 +2503,24 @@ var Ws = class {
2351
2503
  offset: 0
2352
2504
  }];
2353
2505
  const r = this.segmentSentences(e), i = [];
2354
- let n = "", s = 0;
2355
- for (const o of r) {
2356
- const a = o.text.trim();
2357
- if (!a) continue;
2358
- const c = o.text.search(/\S/), p = o.offset + (c === -1 ? 0 : c);
2506
+ let n = "", o = 0;
2507
+ for (const s of r) {
2508
+ const l = s.text.trim();
2509
+ if (!l) continue;
2510
+ const c = s.text.search(/\S/), d = s.offset + (c === -1 ? 0 : c);
2359
2511
  if (!n) {
2360
- n = a, s = p;
2512
+ n = l, o = d;
2361
2513
  continue;
2362
2514
  }
2363
- const f = `${n} ${a}`;
2515
+ const f = `${n} ${l}`;
2364
2516
  f.length <= 260 ? n = f : (i.push({
2365
2517
  text: n,
2366
- offset: s
2367
- }), n = a, s = p);
2518
+ offset: o
2519
+ }), n = l, o = d);
2368
2520
  }
2369
2521
  return n && i.push({
2370
2522
  text: n,
2371
- offset: s
2523
+ offset: o
2372
2524
  }), i.length ? i : [{
2373
2525
  text: e,
2374
2526
  offset: 0
@@ -2387,7 +2539,7 @@ var Ws = class {
2387
2539
  }
2388
2540
  segmentSentences(e) {
2389
2541
  const t = this.getSegmentationPolicy();
2390
- return qs(e, {
2542
+ return ds(e, {
2391
2543
  locale: t.locale,
2392
2544
  useSentenceSegmenter: t.useSentenceSegmenter
2393
2545
  });
@@ -2403,8 +2555,8 @@ var Ws = class {
2403
2555
  return;
2404
2556
  }
2405
2557
  if (this.utterance = new SpeechSynthesisUtterance(e), this.config?.voice) {
2406
- const s = speechSynthesis.getVoices().find((o) => o.name === this.config.voice);
2407
- s && (this.utterance.voice = s);
2558
+ const o = speechSynthesis.getVoices().find((s) => s.name === this.config.voice);
2559
+ o && (this.utterance.voice = o);
2408
2560
  }
2409
2561
  this.config?.rate && (this.utterance.rate = this.config.rate), this.config?.pitch && (this.utterance.pitch = this.config.pitch), this.utterance.onstart = () => {
2410
2562
  r === this.speakRunId && (this._isPlaying = !0, this._isPaused = !1);
@@ -2414,24 +2566,24 @@ var Ws = class {
2414
2566
  return;
2415
2567
  }
2416
2568
  this._isPlaying = !1, this._isPaused = !1, i(!0);
2417
- }, this.utterance.onerror = (s) => {
2569
+ }, this.utterance.onerror = (o) => {
2418
2570
  if (r !== this.speakRunId) {
2419
2571
  i(!1);
2420
2572
  return;
2421
2573
  }
2422
- if (this._isPlaying = !1, this._isPaused = !1, s.error === "interrupted" || s.error === "canceled") {
2574
+ if (this._isPlaying = !1, this._isPaused = !1, o.error === "interrupted" || o.error === "canceled") {
2423
2575
  i(!1);
2424
2576
  return;
2425
2577
  }
2426
- n(/* @__PURE__ */ new Error(`Speech synthesis error: ${s.error}`));
2578
+ n(/* @__PURE__ */ new Error(`Speech synthesis error: ${o.error}`));
2427
2579
  }, this.utterance.onpause = () => {
2428
2580
  r === this.speakRunId && (this._isPaused = !0);
2429
2581
  }, this.utterance.onresume = () => {
2430
2582
  r === this.speakRunId && (this._isPaused = !1);
2431
- }, this.utterance.onboundary = (s) => {
2432
- if (r !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", s.name, "charIndex:", s.charIndex, "charLength:", s.charLength), s.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence") return;
2433
- const o = Math.max(0, Math.min(s.charIndex, Math.max(0, e.length - 1))), a = Number(s.charLength || 0), c = this.inferWordLength(e, o), p = Number.isFinite(a) && a > 0 && a <= 80 && o + a <= e.length ? a : c, f = e.substring(o, Math.min(e.length, o + p)).trim(), m = t + o;
2434
- console.log("[BrowserProvider] Calling onWordBoundary with word:", f, "at position:", m), this.onWordBoundary(f, m, p);
2583
+ }, this.utterance.onboundary = (o) => {
2584
+ if (r !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", o.name, "charIndex:", o.charIndex, "charLength:", o.charLength), o.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence") return;
2585
+ const s = Math.max(0, Math.min(o.charIndex, Math.max(0, e.length - 1))), l = Number(o.charLength || 0), c = this.inferWordLength(e, s), d = Number.isFinite(l) && l > 0 && l <= 80 && s + l <= e.length ? l : c, f = e.substring(s, Math.min(e.length, s + d)).trim(), v = t + s;
2586
+ console.log("[BrowserProvider] Calling onWordBoundary with word:", f, "at position:", v), this.onWordBoundary(f, v, d);
2435
2587
  }, speechSynthesis.speak(this.utterance);
2436
2588
  });
2437
2589
  }
@@ -2456,7 +2608,7 @@ var Ws = class {
2456
2608
  ...e.providerOptions || {}
2457
2609
  });
2458
2610
  }
2459
- }, Ys = class {
2611
+ }, ps = class {
2460
2612
  async emitTelemetry(e, t) {
2461
2613
  try {
2462
2614
  await this.config?.onTelemetry?.(e, t);
@@ -2488,7 +2640,7 @@ var Ws = class {
2488
2640
  }
2489
2641
  async _initializeBrowserTTS(e) {
2490
2642
  if (typeof window > "u" || !("speechSynthesis" in window)) throw new Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");
2491
- this.ttsProvider = new Ks(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
2643
+ this.ttsProvider = new fs(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
2492
2644
  }
2493
2645
  async _initializeServerTTS(e) {
2494
2646
  if (!e.apiEndpoint) throw new Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");
@@ -2497,26 +2649,28 @@ var Ws = class {
2497
2649
  toolId: "tts",
2498
2650
  operation: "server-provider-module-import",
2499
2651
  backend: e.serverProvider || e.backend
2500
- }), this.ttsProvider = new (await (async () => {
2652
+ });
2653
+ const r = await (async () => {
2501
2654
  try {
2502
- const r = await import("./dist-Bud4G4lv.js");
2655
+ const i = await import("./dist-DIBQdekL.js");
2503
2656
  return await this.emitTelemetry("pie-tool-library-load-success", {
2504
2657
  toolId: "tts",
2505
2658
  operation: "server-provider-module-import",
2506
2659
  backend: e.serverProvider || e.backend,
2507
2660
  duration: Date.now() - t
2508
- }), r;
2509
- } catch (r) {
2661
+ }), i;
2662
+ } catch (i) {
2510
2663
  throw await this.emitTelemetry("pie-tool-library-load-error", {
2511
2664
  toolId: "tts",
2512
2665
  operation: "server-provider-module-import",
2513
2666
  backend: e.serverProvider || e.backend,
2514
2667
  duration: Date.now() - t,
2515
2668
  errorType: "ToolLibraryLoadError",
2516
- message: r instanceof Error ? r.message : String(r)
2517
- }), r;
2669
+ message: i instanceof Error ? i.message : String(i)
2670
+ }), i;
2518
2671
  }
2519
- })()).ServerTTSProvider(), console.log(`[TTSToolProvider] Server TTS initialized (provider: ${e.serverProvider || e.backend})`);
2672
+ })();
2673
+ this.ttsProvider = new r.ServerTTSProvider(), console.log(`[TTSToolProvider] Server TTS initialized (provider: ${e.serverProvider || e.backend})`);
2520
2674
  }
2521
2675
  async createInstance(e) {
2522
2676
  if (!this.ttsProvider) throw new Error("[TTSToolProvider] Provider not initialized. Call initialize() first.");
@@ -2544,7 +2698,7 @@ var Ws = class {
2544
2698
  destroy() {
2545
2699
  this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
2546
2700
  }
2547
- }, Xs = /* @__PURE__ */ new Set([
2701
+ }, vs = /* @__PURE__ */ new Set([
2548
2702
  "annotation-xml",
2549
2703
  "color-profile",
2550
2704
  "font-face",
@@ -2553,16 +2707,16 @@ var Ws = class {
2553
2707
  "font-face-format",
2554
2708
  "font-face-name",
2555
2709
  "missing-glyph"
2556
- ]), Qs = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, Js = (e, t = "custom element tag") => {
2710
+ ]), gs = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, ms = (e, t = "custom element tag") => {
2557
2711
  if (!e || typeof e != "string") throw new Error(`Invalid ${t}: expected a non-empty string`);
2558
2712
  const r = e.trim();
2559
2713
  if (!r) throw new Error(`Invalid ${t}: tag is empty`);
2560
2714
  if (r !== r.toLowerCase()) throw new Error(`Invalid ${t} "${r}": custom element names must be lowercase`);
2561
2715
  if (!r.includes("-")) throw new Error(`Invalid ${t} "${r}": custom element names must include a hyphen`);
2562
- if (Xs.has(r)) throw new Error(`Invalid ${t} "${r}": this name is reserved by the HTML spec`);
2563
- if (!Qs.test(r)) throw new Error(`Invalid ${t} "${r}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
2716
+ if (vs.has(r)) throw new Error(`Invalid ${t} "${r}": this name is reserved by the HTML spec`);
2717
+ if (!gs.test(r)) throw new Error(`Invalid ${t} "${r}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
2564
2718
  return r;
2565
- }, qi = {
2719
+ }, rn = {
2566
2720
  calculator: "pie-tool-calculator",
2567
2721
  textToSpeech: "pie-tool-text-to-speech",
2568
2722
  ruler: "pie-tool-ruler",
@@ -2575,22 +2729,22 @@ var Ws = class {
2575
2729
  annotationToolbar: "pie-tool-annotation-toolbar",
2576
2730
  graph: "pie-tool-graph",
2577
2731
  periodicTable: "pie-tool-periodic-table"
2578
- }, Zs = (e, t) => Js(t?.toolTagMap?.[e] ?? qi[e] ?? e, `tool component tag for "${e}"`), eo = (e) => document.createElement(e), ne = (e, t, r, i) => {
2579
- const n = Zs(e, i), s = i?.toolComponentFactories?.[e] ?? i?.toolComponentFactory;
2580
- return s ? s({
2732
+ }, _s = (e, t) => ms(t?.toolTagMap?.[e] ?? rn[e] ?? e, `tool component tag for "${e}"`), ys = (e) => document.createElement(e), ce = (e, t, r, i) => {
2733
+ const n = _s(e, i), o = i?.toolComponentFactories?.[e] ?? i?.toolComponentFactory;
2734
+ return o ? o({
2581
2735
  toolId: e,
2582
2736
  tagName: n,
2583
2737
  context: t,
2584
2738
  toolbarContext: r
2585
- }) : eo(n);
2586
- }, to = {
2739
+ }) : ys(n);
2740
+ }, bs = {
2587
2741
  toolId: "calculator",
2588
2742
  name: "Calculator",
2589
2743
  description: "Multi-type calculator (basic, scientific, graphing)",
2590
2744
  icon: "calculator",
2591
2745
  provider: {
2592
2746
  getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
2593
- createProvider: () => new Ws(),
2747
+ createProvider: () => new us(),
2594
2748
  getInitConfig: (e) => e?.provider?.init ?? {},
2595
2749
  getAuthFetcher: (e) => {
2596
2750
  const t = e?.provider?.runtime?.authFetcher;
@@ -2613,12 +2767,12 @@ var Ws = class {
2613
2767
  "scientificCalculator"
2614
2768
  ],
2615
2769
  isVisibleInContext(e) {
2616
- return Pt(e);
2770
+ return Bt(e);
2617
2771
  },
2618
2772
  renderToolbar(e, t) {
2619
- const r = cr(this.toolId, t.scope.level, t.scope.scopeId), i = t.componentOverrides, n = ne(this.toolId, e, t, i);
2773
+ const r = wr(this.toolId, t.scope.level, t.scope.scopeId), i = t.componentOverrides, n = ce(this.toolId, e, t, i);
2620
2774
  n.setAttribute("tool-id", r), n.toolkitCoordinator = t.toolkitCoordinator;
2621
- const s = {
2775
+ const o = {
2622
2776
  toolId: this.toolId,
2623
2777
  label: this.name,
2624
2778
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -2628,8 +2782,8 @@ var Ws = class {
2628
2782
  onClick: () => t.toggleTool(this.toolId),
2629
2783
  active: t.isToolVisible(r)
2630
2784
  };
2631
- let o = s.active;
2632
- return n.visible = s.active, {
2785
+ let s = o.active;
2786
+ return n.visible = o.active, {
2633
2787
  toolId: this.toolId,
2634
2788
  elements: [{
2635
2789
  element: n,
@@ -2645,24 +2799,24 @@ var Ws = class {
2645
2799
  minHeight: 420
2646
2800
  }
2647
2801
  }],
2648
- button: s,
2802
+ button: o,
2649
2803
  sync: () => {
2650
- const a = t.isToolVisible(r);
2651
- s.active = a, s.ariaLabel = a ? "Close scientific calculator" : "Open scientific calculator", s.tooltip = a ? "Close calculator" : "Calculator", o !== a && (n.visible = a, o = a), n.toolkitCoordinator !== t.toolkitCoordinator && (n.toolkitCoordinator = t.toolkitCoordinator);
2804
+ const l = t.isToolVisible(r);
2805
+ o.active = l, o.ariaLabel = l ? "Close scientific calculator" : "Open scientific calculator", o.tooltip = l ? "Close calculator" : "Calculator", s !== l && (n.visible = l, s = l), n.toolkitCoordinator !== t.toolkitCoordinator && (n.toolkitCoordinator = t.toolkitCoordinator);
2652
2806
  },
2653
- subscribeActive: (a) => t.subscribeVisibility ? t.subscribeVisibility(() => {
2654
- a(t.isToolVisible(r));
2807
+ subscribeActive: (l) => t.subscribeVisibility ? t.subscribeVisibility(() => {
2808
+ l(t.isToolVisible(r));
2655
2809
  }) : () => {
2656
2810
  }
2657
2811
  };
2658
2812
  }
2659
- }, ro = /* @__PURE__ */ new Set([
2813
+ }, ws = /* @__PURE__ */ new Set([
2660
2814
  "reserved-row",
2661
2815
  "expanding-row",
2662
2816
  "floating-overlay",
2663
2817
  "left-aligned"
2664
- ]), Dr = (e) => e && typeof e == "object" ? e : {}, io = (e) => e === "polly" || e === "google" || e === "server", j = (e, t) => e === void 0 ? t : e, Ct = (e, t = "left-aligned") => typeof e == "string" && ro.has(e) ? e : t, Fr = Object.freeze([0.8, 1.25]), Bt = (e) => {
2665
- if (!Array.isArray(e)) return [...Fr];
2818
+ ]), Ur = (e) => e && typeof e == "object" ? e : {}, Ts = (e) => e === "polly" || e === "google" || e === "server", G = (e, t) => e === void 0 ? t : e, Pt = (e, t = "left-aligned") => typeof e == "string" && ws.has(e) ? e : t, Yr = Object.freeze([0.8, 1.25]), qt = (e) => {
2819
+ if (!Array.isArray(e)) return [...Yr];
2666
2820
  if (e.length === 0) return [];
2667
2821
  const t = /* @__PURE__ */ new Set();
2668
2822
  for (const r of e) {
@@ -2670,41 +2824,41 @@ var Ws = class {
2670
2824
  const i = Math.round(r * 100) / 100;
2671
2825
  i !== 1 && t.add(i);
2672
2826
  }
2673
- return t.size ? Array.from(t) : [...Fr];
2674
- }, no = (e) => {
2827
+ return t.size ? Array.from(t) : [...Yr];
2828
+ }, As = (e) => {
2675
2829
  const t = {
2676
2830
  ...e,
2677
- layoutMode: Ct(e.layoutMode)
2831
+ layoutMode: Pt(e.layoutMode)
2678
2832
  }, r = e.backend || "browser";
2679
- if (!io(r)) return t;
2833
+ if (!Ts(r)) return t;
2680
2834
  const i = {
2681
2835
  ...t,
2682
- apiEndpoint: j(t.apiEndpoint, "/api/tts"),
2683
- transportMode: j(t.transportMode, "pie"),
2684
- endpointValidationMode: j(t.endpointValidationMode, "voices"),
2685
- validateEndpoint: j(t.validateEndpoint, !0),
2686
- includeAuthOnAssetFetch: j(t.includeAuthOnAssetFetch, !1),
2687
- rate: j(t.rate, 1),
2688
- language: j(t.language, "en-US")
2836
+ apiEndpoint: G(t.apiEndpoint, "/api/tts"),
2837
+ transportMode: G(t.transportMode, "pie"),
2838
+ endpointValidationMode: G(t.endpointValidationMode, "voices"),
2839
+ validateEndpoint: G(t.validateEndpoint, !0),
2840
+ includeAuthOnAssetFetch: G(t.includeAuthOnAssetFetch, !1),
2841
+ rate: G(t.rate, 1),
2842
+ language: G(t.language, "en-US")
2689
2843
  };
2690
2844
  return r === "polly" ? {
2691
2845
  ...i,
2692
- defaultVoice: j(i.defaultVoice, "Joanna"),
2693
- engine: j(i.engine, "neural"),
2694
- format: j(i.format, "mp3"),
2695
- speechMarksMode: j(i.speechMarksMode, "word+sentence")
2846
+ defaultVoice: G(i.defaultVoice, "Joanna"),
2847
+ engine: G(i.engine, "neural"),
2848
+ format: G(i.format, "mp3"),
2849
+ speechMarksMode: G(i.speechMarksMode, "word+sentence")
2696
2850
  } : r === "google" ? {
2697
2851
  ...i,
2698
- defaultVoice: j(i.defaultVoice, "en-US-Wavenet-A")
2852
+ defaultVoice: G(i.defaultVoice, "en-US-Wavenet-A")
2699
2853
  } : i;
2700
- }, Vt = (e) => {
2701
- const t = Dr(e), r = Dr(e?.settings);
2702
- return no({
2854
+ }, Kt = (e) => {
2855
+ const t = Ur(e), r = Ur(e?.settings);
2856
+ return As({
2703
2857
  ...t,
2704
2858
  ...r
2705
2859
  });
2706
- }, Xt = (e) => e.backend || "browser", Ki = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, Ui = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), so = (e) => {
2707
- const t = Xt(e), r = Ki(e, t), i = Ui(e, r);
2860
+ }, sr = (e) => e.backend || "browser", nn = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, on = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), Ss = (e) => {
2861
+ const t = sr(e), r = nn(e, t), i = on(e, r);
2708
2862
  return {
2709
2863
  voice: e.defaultVoice,
2710
2864
  rate: e.rate,
@@ -2728,8 +2882,8 @@ var Ws = class {
2728
2882
  includeAuthOnAssetFetch: e.includeAuthOnAssetFetch,
2729
2883
  validateEndpoint: e.validateEndpoint
2730
2884
  };
2731
- }, Yi = (e) => Ct(e.layoutMode), oo = (e) => {
2732
- switch (Yi(e)) {
2885
+ }, sn = (e) => Pt(e.layoutMode), Is = (e) => {
2886
+ switch (sn(e)) {
2733
2887
  case "reserved-row":
2734
2888
  return {
2735
2889
  mount: "before-buttons",
@@ -2755,21 +2909,21 @@ var Ws = class {
2755
2909
  }
2756
2910
  };
2757
2911
  }
2758
- }, Xe = /* @__PURE__ */ new Map(), ao = "__pieToolElementUnmount", Br = "pie-tool-active-change", lo = {
2912
+ }, rt = /* @__PURE__ */ new Map(), Es = "__pieToolElementUnmount", Xr = "pie-tool-active-change", ks = {
2759
2913
  toolId: "textToSpeech",
2760
2914
  name: "Text to Speech",
2761
2915
  description: "Read content aloud",
2762
2916
  icon: "volume-up",
2763
2917
  provider: {
2764
2918
  getProviderId: () => "tts",
2765
- createProvider: (e) => new Ys(Xt(Vt(e))),
2919
+ createProvider: (e) => new ps(sr(Kt(e))),
2766
2920
  getInitConfig: (e) => {
2767
- const t = Vt(e), r = Xt(t), i = Ki(t, r);
2921
+ const t = Kt(e), r = sr(t), i = nn(t, r);
2768
2922
  return {
2769
2923
  backend: r,
2770
2924
  serverProvider: i,
2771
- transportMode: Ui(t, i),
2772
- ...so(t)
2925
+ transportMode: on(t, i),
2926
+ ...Ss(t)
2773
2927
  };
2774
2928
  },
2775
2929
  getAuthFetcher: (e) => {
@@ -2778,9 +2932,9 @@ var Ws = class {
2778
2932
  },
2779
2933
  sanitizeConfig: (e) => {
2780
2934
  const t = e.settings && typeof e.settings == "object" ? { ...e.settings } : void 0;
2781
- t && "layoutMode" in t && (t.layoutMode = Ct(t.layoutMode)), t && "speedOptions" in t && (t.speedOptions = Bt(t.speedOptions));
2935
+ t && "layoutMode" in t && (t.layoutMode = Pt(t.layoutMode)), t && "speedOptions" in t && (t.speedOptions = qt(t.speedOptions));
2782
2936
  const r = { ...e };
2783
- return "layoutMode" in r && (r.layoutMode = Ct(r.layoutMode)), "speedOptions" in r && (r.speedOptions = Bt(r.speedOptions)), t && (r.settings = t), r;
2937
+ return "layoutMode" in r && (r.layoutMode = Pt(r.layoutMode)), "speedOptions" in r && (r.speedOptions = qt(r.speedOptions)), t && (r.settings = t), r;
2784
2938
  },
2785
2939
  lazy: !0
2786
2940
  },
@@ -2792,47 +2946,47 @@ var Ws = class {
2792
2946
  "speechOutput"
2793
2947
  ],
2794
2948
  isVisibleInContext(e) {
2795
- return xt(e);
2949
+ return jt(e);
2796
2950
  },
2797
2951
  renderToolbar(e, t) {
2798
- const r = () => Vt(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), i = () => Bt(r().speedOptions), n = () => Yi(r()), s = () => oo(r()), o = cr(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
2952
+ const r = () => Kt(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), i = () => qt(r().speedOptions), n = () => sn(r()), o = () => Is(r()), s = wr(this.toolId, t.scope.level, t.scope.scopeId), l = () => {
2799
2953
  const f = t.ui?.size;
2800
2954
  return f === "sm" || f === "lg" ? f : "md";
2801
2955
  }, c = () => {
2802
- let f = Xe.get(o);
2803
- return f && typeof f.isConnected == "boolean" && !f.isConnected && (Xe.delete(o), f = void 0), f || (f = document.createElement("pie-tool-tts-inline"), f[ao] = () => {
2804
- Xe.get(o) === f && Xe.delete(o);
2805
- }, Xe.set(o, f)), f.setAttribute("tool-id", o), f.setAttribute("catalog-id", t.catalogId || t.itemId), f.setAttribute("language", t.language || "en-US"), f.setAttribute("size", a()), f.setAttribute("layout-mode", n()), f.speedOptions = i(), f;
2806
- }, p = s();
2956
+ let f = rt.get(s);
2957
+ return f && typeof f.isConnected == "boolean" && !f.isConnected && (rt.delete(s), f = void 0), f || (f = document.createElement("pie-tool-tts-inline"), f[Es] = () => {
2958
+ rt.get(s) === f && rt.delete(s);
2959
+ }, rt.set(s, f)), f.setAttribute("tool-id", s), f.setAttribute("catalog-id", t.catalogId || t.itemId), f.setAttribute("language", t.language || "en-US"), f.setAttribute("size", l()), f.setAttribute("layout-mode", n()), f.speedOptions = i(), f;
2960
+ }, d = o();
2807
2961
  return {
2808
2962
  toolId: this.toolId,
2809
2963
  button: null,
2810
2964
  elements: [{
2811
2965
  element: c(),
2812
- mount: p.mount,
2966
+ mount: d.mount,
2813
2967
  layoutHints: { controlsRow: {
2814
- reserveSpace: p.controlsRow.reserveSpace,
2815
- showWhenToolActive: p.controlsRow.expandWhenToolActive
2968
+ reserveSpace: d.controlsRow.reserveSpace,
2969
+ showWhenToolActive: d.controlsRow.expandWhenToolActive
2816
2970
  } }
2817
2971
  }],
2818
2972
  subscribeActive: (f) => {
2819
- const m = c(), h = (v) => {
2820
- const d = v.detail;
2821
- f(d?.active === !0);
2973
+ const v = c(), h = (g) => {
2974
+ const p = g.detail;
2975
+ f(p?.active === !0);
2822
2976
  };
2823
- return m.addEventListener(Br, h), () => {
2824
- m.removeEventListener(Br, h);
2977
+ return v.addEventListener(Xr, h), () => {
2978
+ v.removeEventListener(Xr, h);
2825
2979
  };
2826
2980
  },
2827
2981
  sync: () => {
2828
2982
  const f = c();
2829
- f.setAttribute("tool-id", o), f.setAttribute("catalog-id", t.catalogId || t.itemId), f.setAttribute("language", t.language || "en-US"), f.setAttribute("size", a()), f.setAttribute("layout-mode", n()), f.speedOptions = i();
2983
+ f.setAttribute("tool-id", s), f.setAttribute("catalog-id", t.catalogId || t.itemId), f.setAttribute("language", t.language || "en-US"), f.setAttribute("size", l()), f.setAttribute("layout-mode", n()), f.speedOptions = i();
2830
2984
  }
2831
2985
  };
2832
2986
  }
2833
2987
  };
2834
- function ue(e, t) {
2835
- const r = cr(e, t.scope.level, t.scope.scopeId);
2988
+ function he(e, t) {
2989
+ const r = wr(e, t.scope.level, t.scope.scopeId);
2836
2990
  return {
2837
2991
  fullToolId: r,
2838
2992
  isActive: () => t.isToolVisible(r),
@@ -2842,14 +2996,14 @@ function ue(e, t) {
2842
2996
  }
2843
2997
  };
2844
2998
  }
2845
- function de(e) {
2999
+ function pe(e) {
2846
3000
  const t = e.isActive();
2847
3001
  e.button.active = t, e.overlay.visible = t, e.onActiveChange?.(t);
2848
3002
  }
2849
- function ur(e, t) {
3003
+ function Tr(e, t) {
2850
3004
  e.setAttribute("data-pie-tool-surface", t);
2851
3005
  }
2852
- var co = {
3006
+ var Cs = {
2853
3007
  toolId: "ruler",
2854
3008
  name: "Ruler",
2855
3009
  description: "On-screen ruler for measurements",
@@ -2861,10 +3015,10 @@ var co = {
2861
3015
  ],
2862
3016
  pnpSupportIds: ["ruler", "measurement"],
2863
3017
  isVisibleInContext(e) {
2864
- return Pt(e);
3018
+ return Bt(e);
2865
3019
  },
2866
3020
  renderToolbar(e, t) {
2867
- const r = ue(this.toolId, t), i = {
3021
+ const r = he(this.toolId, t), i = {
2868
3022
  toolId: this.toolId,
2869
3023
  label: this.name,
2870
3024
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -2873,25 +3027,25 @@ var co = {
2873
3027
  tooltip: "Ruler",
2874
3028
  onClick: () => t.toggleTool(this.toolId),
2875
3029
  active: r.isActive()
2876
- }, n = t.componentOverrides ?? {}, s = ne(this.toolId, e, t, n);
2877
- return s.setAttribute("tool-id", r.fullToolId), ur(s, "frameless"), {
3030
+ }, n = t.componentOverrides ?? {}, o = ce(this.toolId, e, t, n);
3031
+ return o.setAttribute("tool-id", r.fullToolId), Tr(o, "frameless"), {
2878
3032
  toolId: this.toolId,
2879
3033
  button: i,
2880
3034
  elements: [{
2881
- element: s,
3035
+ element: o,
2882
3036
  mount: "after-buttons"
2883
3037
  }],
2884
3038
  sync: () => {
2885
- de({
3039
+ pe({
2886
3040
  button: i,
2887
- overlay: s,
3041
+ overlay: o,
2888
3042
  isActive: r.isActive
2889
- }), t.toolkitCoordinator && (s.toolkitCoordinator = t.toolkitCoordinator);
3043
+ }), t.toolkitCoordinator && (o.toolkitCoordinator = t.toolkitCoordinator);
2890
3044
  },
2891
3045
  subscribeActive: r.subscribeActive
2892
3046
  };
2893
3047
  }
2894
- }, uo = {
3048
+ }, $s = {
2895
3049
  toolId: "protractor",
2896
3050
  name: "Protractor",
2897
3051
  description: "On-screen protractor for angle measurements",
@@ -2903,10 +3057,10 @@ var co = {
2903
3057
  ],
2904
3058
  pnpSupportIds: ["protractor", "angleMeasurement"],
2905
3059
  isVisibleInContext(e) {
2906
- return Pt(e);
3060
+ return Bt(e);
2907
3061
  },
2908
3062
  renderToolbar(e, t) {
2909
- const r = ue(this.toolId, t), i = {
3063
+ const r = he(this.toolId, t), i = {
2910
3064
  toolId: this.toolId,
2911
3065
  label: this.name,
2912
3066
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -2915,25 +3069,25 @@ var co = {
2915
3069
  tooltip: "Protractor",
2916
3070
  onClick: () => t.toggleTool(this.toolId),
2917
3071
  active: r.isActive()
2918
- }, n = t.componentOverrides ?? {}, s = ne(this.toolId, e, t, n);
2919
- return s.setAttribute("tool-id", r.fullToolId), ur(s, "frameless"), {
3072
+ }, n = t.componentOverrides ?? {}, o = ce(this.toolId, e, t, n);
3073
+ return o.setAttribute("tool-id", r.fullToolId), Tr(o, "frameless"), {
2920
3074
  toolId: this.toolId,
2921
3075
  button: i,
2922
3076
  elements: [{
2923
- element: s,
3077
+ element: o,
2924
3078
  mount: "after-buttons"
2925
3079
  }],
2926
3080
  sync: () => {
2927
- de({
3081
+ pe({
2928
3082
  button: i,
2929
- overlay: s,
3083
+ overlay: o,
2930
3084
  isActive: r.isActive
2931
- }), t.toolkitCoordinator && (s.toolkitCoordinator = t.toolkitCoordinator);
3085
+ }), t.toolkitCoordinator && (o.toolkitCoordinator = t.toolkitCoordinator);
2932
3086
  },
2933
3087
  subscribeActive: r.subscribeActive
2934
3088
  };
2935
3089
  }
2936
- }, fo = {
3090
+ }, Ls = {
2937
3091
  toolId: "answerEliminator",
2938
3092
  name: "Answer Eliminator",
2939
3093
  description: "Strike through answer choices",
@@ -2946,12 +3100,12 @@ var co = {
2946
3100
  "choiceMasking"
2947
3101
  ],
2948
3102
  isVisibleInContext(e) {
2949
- return Bs(e);
3103
+ return os(e);
2950
3104
  },
2951
3105
  renderToolbar(e, t) {
2952
- const r = ue(this.toolId, t), i = t.componentOverrides ?? {}, n = ne(this.toolId, e, t, i);
3106
+ const r = he(this.toolId, t), i = t.componentOverrides ?? {}, n = ce(this.toolId, e, t, i);
2953
3107
  n.setAttribute("tool-id", r.fullToolId), n.setAttribute("strategy", "strikethrough"), n.setAttribute("button-alignment", "inline");
2954
- const s = {
3108
+ const o = {
2955
3109
  toolId: this.toolId,
2956
3110
  label: this.name,
2957
3111
  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>',
@@ -2963,24 +3117,24 @@ var co = {
2963
3117
  };
2964
3118
  return {
2965
3119
  toolId: this.toolId,
2966
- button: s,
3120
+ button: o,
2967
3121
  elements: [{
2968
3122
  element: n,
2969
3123
  mount: "after-buttons"
2970
3124
  }],
2971
3125
  sync: () => {
2972
- de({
2973
- button: s,
3126
+ pe({
3127
+ button: o,
2974
3128
  overlay: n,
2975
3129
  isActive: r.isActive
2976
3130
  }), t.toolCoordinator && (n.coordinator = t.toolCoordinator), n.scopeElement = t.getScopeElement?.() || null, t.elementToolStateStore && (n.elementToolStateStore = t.elementToolStateStore);
2977
- const o = t.getGlobalElementId?.();
2978
- o && (n.globalElementId = o);
3131
+ const s = t.getGlobalElementId?.();
3132
+ s && (n.globalElementId = s);
2979
3133
  },
2980
3134
  subscribeActive: r.subscribeActive
2981
3135
  };
2982
3136
  }
2983
- }, ho = {
3137
+ }, Os = {
2984
3138
  toolId: "highlighter",
2985
3139
  name: "Highlighter",
2986
3140
  description: "Highlight text",
@@ -2998,10 +3152,10 @@ var co = {
2998
3152
  "annotation"
2999
3153
  ],
3000
3154
  isVisibleInContext(e) {
3001
- return xt(e);
3155
+ return jt(e);
3002
3156
  },
3003
3157
  renderToolbar(e, t) {
3004
- const r = ue(this.toolId, t), i = {
3158
+ const r = he(this.toolId, t), i = {
3005
3159
  toolId: this.toolId,
3006
3160
  label: this.name,
3007
3161
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -3010,28 +3164,28 @@ var co = {
3010
3164
  tooltip: "Highlight",
3011
3165
  onClick: () => t.toggleTool(this.toolId),
3012
3166
  active: r.isActive()
3013
- }, n = t.componentOverrides ?? {}, s = ne(this.toolId, e, t, n);
3014
- return s.setAttribute("tool-id", r.fullToolId), {
3167
+ }, n = t.componentOverrides ?? {}, o = ce(this.toolId, e, t, n);
3168
+ return o.setAttribute("tool-id", r.fullToolId), {
3015
3169
  toolId: this.toolId,
3016
3170
  button: i,
3017
3171
  elements: [{
3018
- element: s,
3172
+ element: o,
3019
3173
  mount: "after-buttons"
3020
3174
  }],
3021
3175
  sync: () => {
3022
- de({
3176
+ pe({
3023
3177
  button: i,
3024
- overlay: s,
3178
+ overlay: o,
3025
3179
  isActive: r.isActive,
3026
- onActiveChange: (o) => {
3027
- s.enabled = o;
3180
+ onActiveChange: (s) => {
3181
+ o.enabled = s;
3028
3182
  }
3029
- }), t.ttsService && (s.ttsService = t.ttsService);
3183
+ }), t.ttsService && (o.ttsService = t.ttsService);
3030
3184
  },
3031
3185
  subscribeActive: r.subscribeActive
3032
3186
  };
3033
3187
  }
3034
- }, po = {
3188
+ }, Rs = {
3035
3189
  toolId: "lineReader",
3036
3190
  name: "Line Reader",
3037
3191
  description: "Reading guide overlay",
@@ -3050,10 +3204,10 @@ var co = {
3050
3204
  "trackingGuide"
3051
3205
  ],
3052
3206
  isVisibleInContext(e) {
3053
- return xt(e);
3207
+ return jt(e);
3054
3208
  },
3055
3209
  renderToolbar(e, t) {
3056
- const r = ue(this.toolId, t), i = {
3210
+ const r = he(this.toolId, t), i = {
3057
3211
  toolId: this.toolId,
3058
3212
  label: this.name,
3059
3213
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -3062,25 +3216,25 @@ var co = {
3062
3216
  tooltip: "Line Reader",
3063
3217
  onClick: () => t.toggleTool(this.toolId),
3064
3218
  active: r.isActive()
3065
- }, n = t.componentOverrides ?? {}, s = ne(this.toolId, e, t, n);
3066
- return s.setAttribute("tool-id", r.fullToolId), ur(s, "frameless"), {
3219
+ }, n = t.componentOverrides ?? {}, o = ce(this.toolId, e, t, n);
3220
+ return o.setAttribute("tool-id", r.fullToolId), Tr(o, "frameless"), {
3067
3221
  toolId: this.toolId,
3068
3222
  button: i,
3069
3223
  elements: [{
3070
- element: s,
3224
+ element: o,
3071
3225
  mount: "after-buttons"
3072
3226
  }],
3073
3227
  sync: () => {
3074
- de({
3228
+ pe({
3075
3229
  button: i,
3076
- overlay: s,
3230
+ overlay: o,
3077
3231
  isActive: r.isActive
3078
- }), t.toolkitCoordinator && (s.toolkitCoordinator = t.toolkitCoordinator);
3232
+ }), t.toolkitCoordinator && (o.toolkitCoordinator = t.toolkitCoordinator);
3079
3233
  },
3080
3234
  subscribeActive: r.subscribeActive
3081
3235
  };
3082
3236
  }
3083
- }, vo = {
3237
+ }, Ms = {
3084
3238
  toolId: "theme",
3085
3239
  name: "Theme",
3086
3240
  description: "Accessible themes and contrast",
@@ -3099,7 +3253,7 @@ var co = {
3099
3253
  return !0;
3100
3254
  },
3101
3255
  renderToolbar(e, t) {
3102
- const r = ue(this.toolId, t), i = {
3256
+ const r = he(this.toolId, t), i = {
3103
3257
  toolId: this.toolId,
3104
3258
  label: this.name,
3105
3259
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -3108,12 +3262,12 @@ var co = {
3108
3262
  tooltip: "Theme",
3109
3263
  onClick: () => t.toggleTool(this.toolId),
3110
3264
  active: r.isActive()
3111
- }, n = t.componentOverrides ?? {}, s = ne(this.toolId, e, t, n);
3112
- return s.setAttribute("tool-id", r.fullToolId), {
3265
+ }, n = t.componentOverrides ?? {}, o = ce(this.toolId, e, t, n);
3266
+ return o.setAttribute("tool-id", r.fullToolId), {
3113
3267
  toolId: this.toolId,
3114
3268
  button: i,
3115
3269
  elements: [{
3116
- element: s,
3270
+ element: o,
3117
3271
  mount: "after-buttons",
3118
3272
  shell: {
3119
3273
  title: this.name,
@@ -3127,16 +3281,16 @@ var co = {
3127
3281
  }
3128
3282
  }],
3129
3283
  sync: () => {
3130
- de({
3284
+ pe({
3131
3285
  button: i,
3132
- overlay: s,
3286
+ overlay: o,
3133
3287
  isActive: r.isActive
3134
- }), t.toolkitCoordinator && (s.toolkitCoordinator = t.toolkitCoordinator);
3288
+ }), t.toolkitCoordinator && (o.toolkitCoordinator = t.toolkitCoordinator);
3135
3289
  },
3136
3290
  subscribeActive: r.subscribeActive
3137
3291
  };
3138
3292
  }
3139
- }, mo = {
3293
+ }, Ps = {
3140
3294
  toolId: "annotationToolbar",
3141
3295
  name: "Highlighter",
3142
3296
  description: "Highlight and annotate text",
@@ -3157,10 +3311,10 @@ var co = {
3157
3311
  "annotation"
3158
3312
  ],
3159
3313
  isVisibleInContext(e) {
3160
- return xt(e);
3314
+ return jt(e);
3161
3315
  },
3162
3316
  renderToolbar(e, t) {
3163
- const r = ue(this.toolId, t), i = {
3317
+ const r = he(this.toolId, t), i = {
3164
3318
  toolId: this.toolId,
3165
3319
  label: this.name,
3166
3320
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -3169,25 +3323,25 @@ var co = {
3169
3323
  tooltip: "Highlight",
3170
3324
  onClick: () => t.toggleTool(this.toolId),
3171
3325
  active: r.isActive()
3172
- }, n = t.componentOverrides ?? {}, s = ne(this.toolId, e, t, n);
3173
- return s.setAttribute("tool-id", r.fullToolId), {
3326
+ }, n = t.componentOverrides ?? {}, o = ce(this.toolId, e, t, n);
3327
+ return o.setAttribute("tool-id", r.fullToolId), {
3174
3328
  toolId: this.toolId,
3175
3329
  button: i,
3176
3330
  elements: [{
3177
- element: s,
3331
+ element: o,
3178
3332
  mount: "after-buttons"
3179
3333
  }],
3180
3334
  sync: () => {
3181
- de({
3335
+ pe({
3182
3336
  button: i,
3183
- overlay: s,
3337
+ overlay: o,
3184
3338
  isActive: r.isActive
3185
- }), t.toolkitCoordinator && (s.toolkitCoordinator = t.toolkitCoordinator);
3339
+ }), t.toolkitCoordinator && (o.toolkitCoordinator = t.toolkitCoordinator);
3186
3340
  },
3187
3341
  subscribeActive: r.subscribeActive
3188
3342
  };
3189
3343
  }
3190
- }, go = {
3344
+ }, xs = {
3191
3345
  toolId: "graph",
3192
3346
  name: "Graph",
3193
3347
  description: "Graphing calculator and coordinate plane",
@@ -3200,10 +3354,10 @@ var co = {
3200
3354
  "graphingTool"
3201
3355
  ],
3202
3356
  isVisibleInContext(e) {
3203
- return Pt(e);
3357
+ return Bt(e);
3204
3358
  },
3205
3359
  renderToolbar(e, t) {
3206
- const r = ue(this.toolId, t), i = {
3360
+ const r = he(this.toolId, t), i = {
3207
3361
  toolId: this.toolId,
3208
3362
  label: this.name,
3209
3363
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -3212,12 +3366,12 @@ var co = {
3212
3366
  tooltip: "Graph",
3213
3367
  onClick: () => t.toggleTool(this.toolId),
3214
3368
  active: r.isActive()
3215
- }, n = t.componentOverrides ?? {}, s = ne(this.toolId, e, t, n);
3216
- return s.setAttribute("tool-id", r.fullToolId), {
3369
+ }, n = t.componentOverrides ?? {}, o = ce(this.toolId, e, t, n);
3370
+ return o.setAttribute("tool-id", r.fullToolId), {
3217
3371
  toolId: this.toolId,
3218
3372
  button: i,
3219
3373
  elements: [{
3220
- element: s,
3374
+ element: o,
3221
3375
  mount: "after-buttons",
3222
3376
  shell: {
3223
3377
  title: this.name,
@@ -3231,16 +3385,16 @@ var co = {
3231
3385
  }
3232
3386
  }],
3233
3387
  sync: () => {
3234
- de({
3388
+ pe({
3235
3389
  button: i,
3236
- overlay: s,
3390
+ overlay: o,
3237
3391
  isActive: r.isActive
3238
3392
  });
3239
3393
  },
3240
3394
  subscribeActive: r.subscribeActive
3241
3395
  };
3242
3396
  }
3243
- }, _o = {
3397
+ }, Hs = {
3244
3398
  toolId: "periodicTable",
3245
3399
  name: "Periodic Table",
3246
3400
  description: "Chemistry periodic table reference",
@@ -3252,10 +3406,10 @@ var co = {
3252
3406
  "elementReference"
3253
3407
  ],
3254
3408
  isVisibleInContext(e) {
3255
- return Vs(e);
3409
+ return ss(e);
3256
3410
  },
3257
3411
  renderToolbar(e, t) {
3258
- const r = ue(this.toolId, t), i = {
3412
+ const r = he(this.toolId, t), i = {
3259
3413
  toolId: this.toolId,
3260
3414
  label: this.name,
3261
3415
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -3264,12 +3418,12 @@ var co = {
3264
3418
  tooltip: "Periodic Table",
3265
3419
  onClick: () => t.toggleTool(this.toolId),
3266
3420
  active: r.isActive()
3267
- }, n = t.componentOverrides ?? {}, s = ne(this.toolId, e, t, n);
3268
- return s.setAttribute("tool-id", r.fullToolId), {
3421
+ }, n = t.componentOverrides ?? {}, o = ce(this.toolId, e, t, n);
3422
+ return o.setAttribute("tool-id", r.fullToolId), {
3269
3423
  toolId: this.toolId,
3270
3424
  button: i,
3271
3425
  elements: [{
3272
- element: s,
3426
+ element: o,
3273
3427
  mount: "after-buttons",
3274
3428
  shell: {
3275
3429
  title: this.name,
@@ -3283,63 +3437,63 @@ var co = {
3283
3437
  }
3284
3438
  }],
3285
3439
  sync: () => {
3286
- de({
3440
+ pe({
3287
3441
  button: i,
3288
- overlay: s,
3442
+ overlay: o,
3289
3443
  isActive: r.isActive
3290
3444
  });
3291
3445
  },
3292
3446
  subscribeActive: r.subscribeActive
3293
3447
  };
3294
3448
  }
3295
- }, yo = [
3296
- to,
3297
- lo,
3298
- co,
3299
- uo,
3300
- fo,
3301
- ho,
3302
- po,
3303
- vo,
3304
- mo,
3305
- go,
3306
- _o
3449
+ }, Ns = [
3450
+ bs,
3451
+ ks,
3452
+ Cs,
3453
+ $s,
3454
+ Ls,
3455
+ Os,
3456
+ Rs,
3457
+ Ms,
3458
+ Ps,
3459
+ xs,
3460
+ Hs
3307
3461
  ];
3308
- function bo(e = {}) {
3309
- const t = new Ns(), r = {
3462
+ function Ds(e = {}) {
3463
+ const t = new rs(), r = {
3310
3464
  toolTagMap: {
3311
- ...qi,
3465
+ ...rn,
3312
3466
  ...e.toolTagMap || {}
3313
3467
  },
3314
3468
  toolComponentFactory: e.toolComponentFactory,
3315
3469
  toolComponentFactories: e.toolComponentFactories
3316
3470
  }, i = (n) => e.overrides?.[n.toolId] || n;
3317
- return e.includePackagedTools && wo(t, {
3471
+ return e.includePackagedTools && Fs(t, {
3318
3472
  toolIds: e.toolIds,
3319
3473
  applyOverrides: i
3320
3474
  }), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(r), t;
3321
3475
  }
3322
- function wo(e, t = {}) {
3476
+ function Fs(e, t = {}) {
3323
3477
  const r = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, i = t.applyOverrides || ((n) => n);
3324
- for (const n of yo)
3478
+ for (const n of Ns)
3325
3479
  r && !r.has(n.toolId) || e.register(i(n));
3326
3480
  }
3327
- function To(e = {}) {
3328
- return bo({
3481
+ function Bs(e = {}) {
3482
+ return Ds({
3329
3483
  ...e,
3330
3484
  includePackagedTools: !0
3331
3485
  });
3332
3486
  }
3333
- function Ao() {
3334
- const e = To(), t = /* @__PURE__ */ new Set();
3487
+ function js() {
3488
+ const e = Bs(), t = /* @__PURE__ */ new Set();
3335
3489
  for (const r of e.getAllTools()) for (const i of r.pnpSupportIds || []) t.add(i);
3336
3490
  return [...t].sort();
3337
3491
  }
3338
- var So = Ao(), Ko = {
3339
- supports: [...So],
3492
+ var zs = js(), la = {
3493
+ supports: [...zs],
3340
3494
  prohibitedSupports: [],
3341
3495
  activateAtInit: []
3342
- }, Io = {
3496
+ }, Vs = {
3343
3497
  visual: {
3344
3498
  magnification: "magnification",
3345
3499
  screenMagnifier: "screenMagnifier",
@@ -3452,15 +3606,26 @@ var So = Ao(), Ko = {
3452
3606
  itemGlossary: "itemGlossary",
3453
3607
  tutorialAvailable: "tutorialAvailable"
3454
3608
  }
3455
- }, Uo = Object.values(Io).flatMap((e) => Object.values(e)), Yo = zi("ToolCoordinator"), Qt;
3609
+ }, ca = Object.values(Vs).flatMap((e) => Object.values(e)), ua = Ji("ToolCoordinator"), ar;
3456
3610
  (function(e) {
3457
3611
  e[e.BASE = 0] = "BASE", e[e.TOOL = 1e3] = "TOOL", e[e.MODAL = 2e3] = "MODAL", e[e.CONTROL = 3e3] = "CONTROL", e[e.HIGHLIGHT = 4e3] = "HIGHLIGHT";
3458
- })(Qt || (Qt = {}));
3459
- var Vr;
3612
+ })(ar || (ar = {}));
3613
+ var Qr;
3460
3614
  (function(e) {
3461
3615
  e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
3462
- })(Vr || (Vr = {}));
3463
- var Xi, ye = class K {
3616
+ })(Qr || (Qr = {}));
3617
+ var da = Jo({
3618
+ policy: {
3619
+ allowed: [],
3620
+ blocked: []
3621
+ },
3622
+ placement: {
3623
+ section: [],
3624
+ item: [],
3625
+ passage: []
3626
+ },
3627
+ providers: {}
3628
+ }), an, Ae = class Y {
3464
3629
  constructor() {
3465
3630
  u(this, "elementType", "multiple-choice"), u(this, "priority", 100);
3466
3631
  }
@@ -3468,8 +3633,8 @@ var Xi, ye = class K {
3468
3633
  return t.tagName.toLowerCase() === "multiple-choice" || t.classList.contains("multiple-choice");
3469
3634
  }
3470
3635
  findChoices(t) {
3471
- t.setAttribute(K.ROOT_HOOK_ATTR, "true");
3472
- const r = Array.from(t.querySelectorAll(K.CHOICE_SELECTOR));
3636
+ t.setAttribute(Y.ROOT_HOOK_ATTR, "true");
3637
+ const r = Array.from(t.querySelectorAll(Y.CHOICE_SELECTOR));
3473
3638
  for (const i of r) this.annotateChoice(i);
3474
3639
  return this.annotateFeedbackTicks(t), r;
3475
3640
  }
@@ -3488,36 +3653,36 @@ var Xi, ye = class K {
3488
3653
  }
3489
3654
  canEliminate(t) {
3490
3655
  const r = t.querySelector('input[type="checkbox"], input[type="radio"]');
3491
- return !(!r || r.getAttribute("aria-checked") === "true" || r.disabled || (t.closest(`[${K.ROOT_HOOK_ATTR}="true"]`) || t.closest("multiple-choice"))?.querySelector(`[${K.FEEDBACK_HOOK_ATTR}="true"]`));
3656
+ return !(!r || r.getAttribute("aria-checked") === "true" || r.disabled || (t.closest(`[${Y.ROOT_HOOK_ATTR}="true"]`) || t.closest("multiple-choice"))?.querySelector(`[${Y.FEEDBACK_HOOK_ATTR}="true"]`));
3492
3657
  }
3493
3658
  getButtonContainer(t) {
3494
3659
  return t;
3495
3660
  }
3496
3661
  generateFallbackId(t) {
3497
- const r = (t.closest(`[${K.ROOT_HOOK_ATTR}="true"]`) || t.closest("multiple-choice"))?.querySelectorAll(`[${K.CHOICE_HOOK_ATTR}="true"]`) || [];
3662
+ const r = (t.closest(`[${Y.ROOT_HOOK_ATTR}="true"]`) || t.closest("multiple-choice"))?.querySelectorAll(`[${Y.CHOICE_HOOK_ATTR}="true"]`) || [];
3498
3663
  return `choice-${Array.from(r).indexOf(t)}`;
3499
3664
  }
3500
3665
  annotateChoice(t) {
3501
- t.setAttribute(K.CHOICE_HOOK_ATTR, "true");
3666
+ t.setAttribute(Y.CHOICE_HOOK_ATTR, "true");
3502
3667
  const r = this.resolveLabelElement(t);
3503
- r && r.setAttribute(K.LABEL_HOOK_ATTR, "true");
3668
+ r && r.setAttribute(Y.LABEL_HOOK_ATTR, "true");
3504
3669
  }
3505
3670
  resolveLabelElement(t) {
3506
- return t.querySelector(`[${K.LABEL_HOOK_ATTR}="true"]`) || t.querySelector("label") || t.querySelector("span");
3671
+ return t.querySelector(`[${Y.LABEL_HOOK_ATTR}="true"]`) || t.querySelector("label") || t.querySelector("span");
3507
3672
  }
3508
3673
  annotateFeedbackTicks(t) {
3509
- for (const r of t.querySelectorAll(".feedback-tick")) r.setAttribute(K.FEEDBACK_HOOK_ATTR, "true");
3674
+ for (const r of t.querySelectorAll(".feedback-tick")) r.setAttribute(Y.FEEDBACK_HOOK_ATTR, "true");
3510
3675
  }
3511
3676
  };
3512
- Xi = ye;
3513
- u(ye, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
3514
- u(ye, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
3515
- u(ye, "ROOT_HOOK_ATTR", "data-pie-answer-eliminator-root");
3516
- u(ye, "FEEDBACK_HOOK_ATTR", "data-pie-answer-eliminator-feedback-tick");
3517
- u(ye, "CHOICE_SELECTOR", `[${Xi.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
3518
- var Eo = class {
3677
+ an = Ae;
3678
+ u(Ae, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
3679
+ u(Ae, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
3680
+ u(Ae, "ROOT_HOOK_ATTR", "data-pie-answer-eliminator-root");
3681
+ u(Ae, "FEEDBACK_HOOK_ATTR", "data-pie-answer-eliminator-feedback-tick");
3682
+ u(Ae, "CHOICE_SELECTOR", `[${an.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
3683
+ var Gs = class {
3519
3684
  constructor() {
3520
- u(this, "elementType", "ebsr"), u(this, "priority", 95), u(this, "mcAdapter", new ye());
3685
+ u(this, "elementType", "ebsr"), u(this, "priority", 95), u(this, "mcAdapter", new Ae());
3521
3686
  }
3522
3687
  canHandle(e) {
3523
3688
  return e.tagName.toLowerCase() === "ebsr" || e.querySelector("ebsr-multiple-choice") !== null;
@@ -3541,7 +3706,7 @@ var Eo = class {
3541
3706
  getButtonContainer(e) {
3542
3707
  return this.mcAdapter.getButtonContainer(e);
3543
3708
  }
3544
- }, ko = class {
3709
+ }, Ws = class {
3545
3710
  constructor() {
3546
3711
  u(this, "elementType", "inline-dropdown"), u(this, "priority", 90);
3547
3712
  }
@@ -3567,12 +3732,12 @@ var Eo = class {
3567
3732
  getButtonContainer(e) {
3568
3733
  return e;
3569
3734
  }
3570
- }, Co = class {
3735
+ }, qs = class {
3571
3736
  constructor() {
3572
3737
  u(this, "adapters", void 0), this.adapters = [
3573
- new ye(),
3574
- new Eo(),
3575
- new ko()
3738
+ new Ae(),
3739
+ new Gs(),
3740
+ new Ws()
3576
3741
  ].sort((e, t) => t.priority - e.priority);
3577
3742
  }
3578
3743
  findAdapter(e) {
@@ -3582,9 +3747,9 @@ var Eo = class {
3582
3747
  const t = [], r = /* @__PURE__ */ new Set();
3583
3748
  for (const i of this.adapters) {
3584
3749
  const n = i.findChoices(e);
3585
- for (const s of n)
3586
- r.has(s) || (r.add(s), t.push({
3587
- choice: s,
3750
+ for (const o of n)
3751
+ r.has(o) || (r.add(o), t.push({
3752
+ choice: o,
3588
3753
  adapter: i
3589
3754
  }));
3590
3755
  }
@@ -3593,7 +3758,7 @@ var Eo = class {
3593
3758
  registerAdapter(e) {
3594
3759
  this.adapters.push(e), this.adapters.sort((t, r) => r.priority - t.priority);
3595
3760
  }
3596
- }, He = class H {
3761
+ }, je = class D {
3597
3762
  constructor() {
3598
3763
  u(this, "name", "mask"), u(this, "highlights", /* @__PURE__ */ new Map()), u(this, "ranges", /* @__PURE__ */ new Map()), u(this, "fallbackContainers", /* @__PURE__ */ new Map());
3599
3764
  }
@@ -3609,14 +3774,14 @@ var Eo = class {
3609
3774
  }
3610
3775
  this.injectHighlightCSS(t);
3611
3776
  const i = new Highlight(r);
3612
- CSS.highlights.set(`${H.HIGHLIGHT_NAME_PREFIX}${t}`, i), this.highlights.set(t, i), this.ranges.set(t, r), this.addAriaAttributes(r);
3777
+ CSS.highlights.set(`${D.HIGHLIGHT_NAME_PREFIX}${t}`, i), this.highlights.set(t, i), this.ranges.set(t, r), this.addAriaAttributes(r);
3613
3778
  }
3614
3779
  remove(t) {
3615
3780
  if (!this.isSupported()) {
3616
3781
  this.removeFallback(t);
3617
3782
  return;
3618
3783
  }
3619
- CSS.highlights.delete(`${H.HIGHLIGHT_NAME_PREFIX}${t}`), this.removeHighlightCSS(t);
3784
+ CSS.highlights.delete(`${D.HIGHLIGHT_NAME_PREFIX}${t}`), this.removeHighlightCSS(t);
3620
3785
  const r = this.ranges.get(t);
3621
3786
  r && this.removeAriaAttributes(r), this.highlights.delete(t), this.ranges.delete(t), this.fallbackContainers.delete(t);
3622
3787
  }
@@ -3634,7 +3799,7 @@ var Eo = class {
3634
3799
  return typeof CSS < "u" && "highlights" in CSS;
3635
3800
  }
3636
3801
  injectHighlightCSS(t) {
3637
- const r = `${H.HIGHLIGHT_STYLE_PREFIX}${t}`;
3802
+ const r = `${D.HIGHLIGHT_STYLE_PREFIX}${t}`;
3638
3803
  if (document.getElementById(r)) return;
3639
3804
  const i = document.createElement("style");
3640
3805
  i.id = r, i.textContent = `
@@ -3645,43 +3810,43 @@ var Eo = class {
3645
3810
  `, document.head.appendChild(i);
3646
3811
  }
3647
3812
  removeHighlightCSS(t) {
3648
- document.getElementById(`${H.HIGHLIGHT_STYLE_PREFIX}${t}`)?.remove();
3813
+ document.getElementById(`${D.HIGHLIGHT_STYLE_PREFIX}${t}`)?.remove();
3649
3814
  }
3650
3815
  addAriaAttributes(t) {
3651
3816
  const r = this.findChoiceContainer(t);
3652
- r && (r.setAttribute(H.ELIMINATED_ATTR, "true"), r.setAttribute("aria-hidden", "true"));
3817
+ r && (r.setAttribute(D.ELIMINATED_ATTR, "true"), r.setAttribute("aria-hidden", "true"));
3653
3818
  }
3654
3819
  removeAriaAttributes(t) {
3655
3820
  const r = this.findChoiceContainer(t);
3656
- r && (r.removeAttribute(H.ELIMINATED_ATTR), r.removeAttribute("aria-hidden"));
3821
+ r && (r.removeAttribute(D.ELIMINATED_ATTR), r.removeAttribute("aria-hidden"));
3657
3822
  }
3658
3823
  findChoiceContainer(t) {
3659
3824
  let r = t.startContainer;
3660
3825
  for (r.nodeType === Node.TEXT_NODE && (r = r.parentElement); r && r !== document.body; ) {
3661
- if (r.getAttribute(H.CHOICE_HOOK_ATTR) === "true") return r;
3826
+ if (r.getAttribute(D.CHOICE_HOOK_ATTR) === "true") return r;
3662
3827
  r = r.parentElement;
3663
3828
  }
3664
3829
  return null;
3665
3830
  }
3666
3831
  applyFallback(t, r) {
3667
3832
  const i = this.findChoiceContainer(r);
3668
- i && (i.classList.add(H.FALLBACK_CLASS), i.setAttribute(H.ELIMINATED_ATTR, "true"), i.setAttribute(H.ELIMINATED_ID_ATTR, t), this.fallbackContainers.set(t, i), this.addAriaAttributes(r));
3833
+ i && (i.classList.add(D.FALLBACK_CLASS), i.setAttribute(D.ELIMINATED_ATTR, "true"), i.setAttribute(D.ELIMINATED_ID_ATTR, t), this.fallbackContainers.set(t, i), this.addAriaAttributes(r));
3669
3834
  }
3670
3835
  removeFallback(t) {
3671
3836
  const r = this.fallbackContainers.get(t);
3672
3837
  if (!r) return;
3673
- r.classList.remove(H.FALLBACK_CLASS), r.removeAttribute(H.ELIMINATED_ATTR), r.removeAttribute(H.ELIMINATED_ID_ATTR);
3838
+ r.classList.remove(D.FALLBACK_CLASS), r.removeAttribute(D.ELIMINATED_ATTR), r.removeAttribute(D.ELIMINATED_ID_ATTR);
3674
3839
  const i = document.createRange();
3675
3840
  i.selectNodeContents(r), this.removeAriaAttributes(i), this.fallbackContainers.delete(t);
3676
3841
  }
3677
3842
  };
3678
- u(He, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-mask-highlight-");
3679
- u(He, "HIGHLIGHT_NAME_PREFIX", "pie-answer-masked-");
3680
- u(He, "FALLBACK_CLASS", "pie-answer-masked-fallback");
3681
- u(He, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
3682
- u(He, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
3683
- u(He, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
3684
- var fe = class L {
3843
+ u(je, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-mask-highlight-");
3844
+ u(je, "HIGHLIGHT_NAME_PREFIX", "pie-answer-masked-");
3845
+ u(je, "FALLBACK_CLASS", "pie-answer-masked-fallback");
3846
+ u(je, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
3847
+ u(je, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
3848
+ u(je, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
3849
+ var ve = class R {
3685
3850
  constructor() {
3686
3851
  u(this, "name", "strikethrough"), u(this, "highlights", /* @__PURE__ */ new Map()), u(this, "ranges", /* @__PURE__ */ new Map()), u(this, "fallbackContainers", /* @__PURE__ */ new Map());
3687
3852
  }
@@ -3698,14 +3863,14 @@ var fe = class L {
3698
3863
  }
3699
3864
  this.injectHighlightCSS(t);
3700
3865
  const i = new Highlight(r);
3701
- CSS.highlights.set(`${L.HIGHLIGHT_NAME_PREFIX}${t}`, i), this.highlights.set(t, i), this.ranges.set(t, r), this.addAriaAttributes(r);
3866
+ CSS.highlights.set(`${R.HIGHLIGHT_NAME_PREFIX}${t}`, i), this.highlights.set(t, i), this.ranges.set(t, r), this.addAriaAttributes(r);
3702
3867
  }
3703
3868
  remove(t) {
3704
3869
  if (!this.isSupported()) {
3705
3870
  this.removeFallback(t);
3706
3871
  return;
3707
3872
  }
3708
- CSS.highlights.delete(`${L.HIGHLIGHT_NAME_PREFIX}${t}`), this.removeHighlightCSS(t);
3873
+ CSS.highlights.delete(`${R.HIGHLIGHT_NAME_PREFIX}${t}`), this.removeHighlightCSS(t);
3709
3874
  const r = this.ranges.get(t);
3710
3875
  r && this.removeAriaAttributes(r), this.highlights.delete(t), this.ranges.delete(t), this.fallbackContainers.delete(t);
3711
3876
  }
@@ -3723,7 +3888,7 @@ var fe = class L {
3723
3888
  return typeof CSS < "u" && "highlights" in CSS;
3724
3889
  }
3725
3890
  injectHighlightCSS(t) {
3726
- const r = `${L.HIGHLIGHT_STYLE_PREFIX}${t}`;
3891
+ const r = `${R.HIGHLIGHT_STYLE_PREFIX}${t}`;
3727
3892
  if (document.getElementById(r)) return;
3728
3893
  const i = document.createElement("style");
3729
3894
  i.id = r, i.textContent = `
@@ -3736,63 +3901,63 @@ var fe = class L {
3736
3901
  `, document.head.appendChild(i);
3737
3902
  }
3738
3903
  removeHighlightCSS(t) {
3739
- document.getElementById(`${L.HIGHLIGHT_STYLE_PREFIX}${t}`)?.remove();
3904
+ document.getElementById(`${R.HIGHLIGHT_STYLE_PREFIX}${t}`)?.remove();
3740
3905
  }
3741
3906
  addAriaAttributes(t) {
3742
3907
  const r = this.findChoiceContainer(t);
3743
3908
  if (!r) return;
3744
- r.setAttribute(L.ELIMINATED_ATTR, "true"), r.setAttribute("aria-disabled", "true");
3909
+ r.setAttribute(R.ELIMINATED_ATTR, "true"), r.setAttribute("aria-disabled", "true");
3745
3910
  const i = this.resolveLabelElement(r);
3746
- if (i && !i.querySelector(`.${L.SR_CLASS}`)) {
3911
+ if (i && !i.querySelector(`.${R.SR_CLASS}`)) {
3747
3912
  const n = document.createElement("span");
3748
- n.className = L.SR_CLASS, n.textContent = " (eliminated)", i.appendChild(n);
3913
+ n.className = R.SR_CLASS, n.textContent = " (eliminated)", i.appendChild(n);
3749
3914
  }
3750
3915
  }
3751
3916
  removeAriaAttributes(t) {
3752
3917
  const r = this.findChoiceContainer(t);
3753
- r && (r.removeAttribute(L.ELIMINATED_ATTR), r.removeAttribute("aria-disabled"), r.querySelector(`.${L.SR_CLASS}`)?.remove());
3918
+ r && (r.removeAttribute(R.ELIMINATED_ATTR), r.removeAttribute("aria-disabled"), r.querySelector(`.${R.SR_CLASS}`)?.remove());
3754
3919
  }
3755
3920
  findChoiceContainer(t) {
3756
3921
  let r = t.startContainer;
3757
3922
  for (r.nodeType === Node.TEXT_NODE && (r = r.parentElement); r && r !== document.body; ) {
3758
- if (r.getAttribute(L.CHOICE_HOOK_ATTR) === "true") return r;
3923
+ if (r.getAttribute(R.CHOICE_HOOK_ATTR) === "true") return r;
3759
3924
  r = r.parentElement;
3760
3925
  }
3761
3926
  return null;
3762
3927
  }
3763
3928
  applyFallback(t, r) {
3764
3929
  const i = this.findChoiceContainer(r);
3765
- i && (i.classList.add(L.FALLBACK_CLASS), i.setAttribute(L.ELIMINATED_ATTR, "true"), i.setAttribute(L.ELIMINATED_ID_ATTR, t), this.fallbackContainers.set(t, i), this.addAriaAttributes(r));
3930
+ i && (i.classList.add(R.FALLBACK_CLASS), i.setAttribute(R.ELIMINATED_ATTR, "true"), i.setAttribute(R.ELIMINATED_ID_ATTR, t), this.fallbackContainers.set(t, i), this.addAriaAttributes(r));
3766
3931
  }
3767
3932
  removeFallback(t) {
3768
3933
  const r = this.fallbackContainers.get(t);
3769
3934
  if (!r) return;
3770
- r.classList.remove(L.FALLBACK_CLASS), r.removeAttribute(L.ELIMINATED_ATTR), r.removeAttribute(L.ELIMINATED_ID_ATTR);
3935
+ r.classList.remove(R.FALLBACK_CLASS), r.removeAttribute(R.ELIMINATED_ATTR), r.removeAttribute(R.ELIMINATED_ID_ATTR);
3771
3936
  const i = document.createRange();
3772
3937
  i.selectNodeContents(r), this.removeAriaAttributes(i), this.fallbackContainers.delete(t);
3773
3938
  }
3774
3939
  resolveLabelElement(t) {
3775
- return t.querySelector(`[${L.LABEL_HOOK_ATTR}="true"]`) || t.querySelector("label");
3940
+ return t.querySelector(`[${R.LABEL_HOOK_ATTR}="true"]`) || t.querySelector("label");
3776
3941
  }
3777
3942
  };
3778
- u(fe, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-highlight-");
3779
- u(fe, "HIGHLIGHT_NAME_PREFIX", "pie-answer-eliminated-");
3780
- u(fe, "FALLBACK_CLASS", "pie-answer-eliminator-eliminated-fallback");
3781
- u(fe, "SR_CLASS", "pie-answer-eliminator-sr-announcement");
3782
- u(fe, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
3783
- u(fe, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
3784
- u(fe, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
3785
- u(fe, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
3786
- var dr = class Qe {
3943
+ u(ve, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-highlight-");
3944
+ u(ve, "HIGHLIGHT_NAME_PREFIX", "pie-answer-eliminated-");
3945
+ u(ve, "FALLBACK_CLASS", "pie-answer-eliminator-eliminated-fallback");
3946
+ u(ve, "SR_CLASS", "pie-answer-eliminator-sr-announcement");
3947
+ u(ve, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
3948
+ u(ve, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
3949
+ u(ve, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
3950
+ u(ve, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
3951
+ var Ar = class it {
3787
3952
  constructor(t = "strikethrough", r = "right") {
3788
- u(this, "registry", void 0), u(this, "strategy", void 0), u(this, "eliminatedChoices", /* @__PURE__ */ new Set()), u(this, "choiceElements", /* @__PURE__ */ new Map()), u(this, "choiceButtons", /* @__PURE__ */ new Map()), u(this, "choiceAdapters", /* @__PURE__ */ new Map()), u(this, "buttonAlignment", "right"), u(this, "shouldRestoreState", !0), u(this, "storeIntegration", null), this.registry = new Co(), this.strategy = this.createStrategy(t), this.strategy.initialize(), this.buttonAlignment = r;
3953
+ u(this, "registry", void 0), u(this, "strategy", void 0), u(this, "eliminatedChoices", /* @__PURE__ */ new Set()), u(this, "choiceElements", /* @__PURE__ */ new Map()), u(this, "choiceButtons", /* @__PURE__ */ new Map()), u(this, "choiceAdapters", /* @__PURE__ */ new Map()), u(this, "buttonAlignment", "right"), u(this, "shouldRestoreState", !0), u(this, "storeIntegration", null), this.registry = new qs(), this.strategy = this.createStrategy(t), this.strategy.initialize(), this.buttonAlignment = r;
3789
3954
  }
3790
3955
  createStrategy(t) {
3791
3956
  switch (t) {
3792
3957
  case "mask":
3793
- return new He();
3958
+ return new je();
3794
3959
  default:
3795
- return new fe();
3960
+ return new ve();
3796
3961
  }
3797
3962
  }
3798
3963
  initializeForQuestion(t) {
@@ -3807,14 +3972,14 @@ var dr = class Qe {
3807
3972
  const n = this.createToggleButton(t, r);
3808
3973
  if (!n) return;
3809
3974
  this.choiceButtons.set(i, n);
3810
- const s = r.getButtonContainer(t);
3811
- s && (s.style.position = "relative", s.appendChild(n));
3975
+ const o = r.getButtonContainer(t);
3976
+ o && (o.style.position = "relative", o.appendChild(n));
3812
3977
  }
3813
3978
  createToggleButton(t, r) {
3814
- const i = r.getChoiceId(t), n = r.getChoiceLabel(t), s = document.createElement("button");
3815
- return s.type = "button", s.className = Qe.TOGGLE_CLASS, s.setAttribute("aria-label", `Toggle elimination for ${n}`), s.setAttribute("data-choice-id", i), s.textContent = "⊗", this.applyButtonAlignment(s), s.addEventListener("click", (o) => {
3816
- o.preventDefault(), o.stopPropagation(), this.toggleElimination(t, r);
3817
- }), s;
3979
+ const i = r.getChoiceId(t), n = r.getChoiceLabel(t), o = document.createElement("button");
3980
+ return o.type = "button", o.className = it.TOGGLE_CLASS, o.setAttribute("aria-label", `Toggle elimination for ${n}`), o.setAttribute("data-choice-id", i), o.textContent = "⊗", this.applyButtonAlignment(o), o.addEventListener("click", (s) => {
3981
+ s.preventDefault(), s.stopPropagation(), this.toggleElimination(t, r);
3982
+ }), o;
3818
3983
  }
3819
3984
  toggleElimination(t, r) {
3820
3985
  const i = r.getChoiceId(t);
@@ -3835,13 +4000,13 @@ var dr = class Qe {
3835
4000
  return;
3836
4001
  }
3837
4002
  this.strategy.apply(i, n), this.eliminatedChoices.add(i);
3838
- const s = this.choiceButtons.get(i);
3839
- s && (s.classList.add(Qe.TOGGLE_ACTIVE_CLASS), s.setAttribute("aria-pressed", "true")), this.saveState();
4003
+ const o = this.choiceButtons.get(i);
4004
+ o && (o.classList.add(it.TOGGLE_ACTIVE_CLASS), o.setAttribute("aria-pressed", "true")), this.saveState();
3840
4005
  }
3841
4006
  restoreChoice(t) {
3842
4007
  this.strategy.remove(t), this.eliminatedChoices.delete(t);
3843
4008
  const r = this.choiceButtons.get(t);
3844
- r && (r.classList.remove(Qe.TOGGLE_ACTIVE_CLASS), r.setAttribute("aria-pressed", "false")), this.saveState();
4009
+ r && (r.classList.remove(it.TOGGLE_ACTIVE_CLASS), r.setAttribute("aria-pressed", "false")), this.saveState();
3845
4010
  }
3846
4011
  resetAll() {
3847
4012
  if (this.eliminatedChoices.size !== 0) {
@@ -3873,13 +4038,13 @@ var dr = class Qe {
3873
4038
  for (const i of r) {
3874
4039
  const n = this.choiceElements.get(i);
3875
4040
  if (!n) continue;
3876
- const s = this.choiceAdapters.get(i);
3877
- if (!s) continue;
3878
- const o = s.createChoiceRange(n);
3879
- if (o) {
3880
- this.strategy.apply(i, o), this.eliminatedChoices.add(i);
3881
- const a = this.choiceButtons.get(i);
3882
- a && (a.classList.add(Qe.TOGGLE_ACTIVE_CLASS), a.setAttribute("aria-pressed", "true"));
4041
+ const o = this.choiceAdapters.get(i);
4042
+ if (!o) continue;
4043
+ const s = o.createChoiceRange(n);
4044
+ if (s) {
4045
+ this.strategy.apply(i, s), this.eliminatedChoices.add(i);
4046
+ const l = this.choiceButtons.get(i);
4047
+ l && (l.classList.add(it.TOGGLE_ACTIVE_CLASS), l.setAttribute("aria-pressed", "true"));
3883
4048
  }
3884
4049
  }
3885
4050
  } catch (r) {
@@ -3932,115 +4097,115 @@ var dr = class Qe {
3932
4097
  this.cleanupButtons(), this.strategy.destroy();
3933
4098
  }
3934
4099
  };
3935
- u(dr, "TOGGLE_CLASS", "pie-answer-eliminator-toggle");
3936
- u(dr, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
3937
- var $o = /* @__PURE__ */ fs('<div style="display: none;" aria-hidden="true"></div>');
3938
- function Oo(e, t) {
3939
- Qr(t, !0);
3940
- let r = he(t, "visible", 7, !1), i = he(t, "toolId", 7, "answerEliminator"), n = he(t, "strategy", 7, "strikethrough"), s = he(t, "alwaysOn", 7, !1), o = he(t, "buttonAlignment", 7, "right"), a = he(t, "scopeElement", 7, null), c = he(t, "elementToolStateStore", 7, null), p = he(t, "globalElementId", 7, ""), f = /* @__PURE__ */ P(null), m = /* @__PURE__ */ P(null), h = /* @__PURE__ */ P(null);
3941
- const v = /* @__PURE__ */ Ir(() => g(m)?.toolCoordinator);
3942
- let d = /* @__PURE__ */ P(null), y = /* @__PURE__ */ P(null), _ = /* @__PURE__ */ P(null), S = /* @__PURE__ */ P(null), B = /* @__PURE__ */ Ir(() => s() || r());
3943
- Ae(() => {
3944
- if (g(f))
3945
- return Ms(g(f), (I) => {
3946
- $(m, I, !0);
4100
+ u(Ar, "TOGGLE_CLASS", "pie-answer-eliminator-toggle");
4101
+ u(Ar, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
4102
+ var Ks = /* @__PURE__ */ So('<div style="display: none;" aria-hidden="true"></div>');
4103
+ function Us(e, t) {
4104
+ ai(t, !0);
4105
+ let r = ge(t, "visible", 7, !1), i = ge(t, "toolId", 7, "answerEliminator"), n = ge(t, "strategy", 7, "strikethrough"), o = ge(t, "alwaysOn", 7, !1), s = ge(t, "buttonAlignment", 7, "right"), l = ge(t, "scopeElement", 7, null), c = ge(t, "elementToolStateStore", 7, null), d = ge(t, "globalElementId", 7, ""), f = /* @__PURE__ */ H(null), v = /* @__PURE__ */ H(null), h = /* @__PURE__ */ H(null);
4106
+ const g = /* @__PURE__ */ xr(() => m(v)?.toolCoordinator);
4107
+ let p = /* @__PURE__ */ H(null), y = /* @__PURE__ */ H(null), _ = /* @__PURE__ */ H(null), E = /* @__PURE__ */ H(null), j = /* @__PURE__ */ xr(() => o() || r());
4108
+ Ce(() => {
4109
+ if (m(f))
4110
+ return Wo(m(f), (k) => {
4111
+ $(v, k, !0);
3947
4112
  });
3948
- }), Ae(() => {
3949
- if (g(f))
3950
- return Ps(g(f), (I) => {
3951
- $(h, I, !0);
4113
+ }), Ce(() => {
4114
+ if (m(f))
4115
+ return qo(m(f), (k) => {
4116
+ $(h, k, !0);
3952
4117
  });
3953
4118
  });
3954
- function k() {
3955
- return a() || g(h)?.scopeElement || null;
4119
+ function C() {
4120
+ return l() || m(h)?.scopeElement || null;
3956
4121
  }
3957
- function q() {
3958
- if (!g(B) || !g(d)) return;
3959
- const I = k();
3960
- if (!I) {
4122
+ function U() {
4123
+ if (!m(j) || !m(p)) return;
4124
+ const k = C();
4125
+ if (!k) {
3961
4126
  console.warn("[AnswerEliminator] Missing shell scope context for question root");
3962
4127
  return;
3963
4128
  }
3964
- g(d).initializeForQuestion(I);
4129
+ m(p).initializeForQuestion(k);
3965
4130
  }
3966
- function be() {
4131
+ function Se() {
3967
4132
  requestAnimationFrame(() => {
3968
4133
  requestAnimationFrame(() => {
3969
- q();
4134
+ U();
3970
4135
  });
3971
4136
  });
3972
4137
  }
3973
- Ae(() => {
3974
- !g(v) || !i() || (g(S) && g(_) && (g(S) !== g(v) || g(_) !== i()) && (g(S).unregisterTool(g(_)), $(S, null), $(_, null)), g(_) || (g(v).registerTool(i(), "Answer Eliminator", void 0, Qt.MODAL), $(S, g(v), !0), $(_, i())));
3975
- }), Ae(() => {
3976
- g(d) && c() && p() && g(d).setStoreIntegration(c(), p());
3977
- }), ys(() => ($(d, new dr(n(), o()), !0), g(d) && c() && p() && g(d).setStoreIntegration(c(), p()), g(B) ? q() : g(d).cleanup(), () => {
3978
- g(d)?.destroy(), $(d, null), g(S) && g(_) && (g(S).unregisterTool(g(_)), $(S, null), $(_, null));
3979
- })), Ae(() => {
3980
- const I = g(h)?.contextVersion ?? null;
3981
- if (I !== null) {
3982
- if (g(y) === null) {
3983
- $(y, I, !0);
4138
+ Ce(() => {
4139
+ !m(g) || !i() || (m(E) && m(_) && (m(E) !== m(g) || m(_) !== i()) && (m(E).unregisterTool(m(_)), $(E, null), $(_, null)), m(_) || (m(g).registerTool(i(), "Answer Eliminator", void 0, ar.MODAL), $(E, m(g), !0), $(_, i())));
4140
+ }), Ce(() => {
4141
+ m(p) && c() && d() && m(p).setStoreIntegration(c(), d());
4142
+ }), Oo(() => ($(p, new Ar(n(), s()), !0), m(p) && c() && d() && m(p).setStoreIntegration(c(), d()), m(j) ? U() : m(p).cleanup(), () => {
4143
+ m(p)?.destroy(), $(p, null), m(E) && m(_) && (m(E).unregisterTool(m(_)), $(E, null), $(_, null));
4144
+ })), Ce(() => {
4145
+ const k = m(h)?.contextVersion ?? null;
4146
+ if (k !== null) {
4147
+ if (m(y) === null) {
4148
+ $(y, k, !0);
3984
4149
  return;
3985
4150
  }
3986
- I !== g(y) && ($(y, I, !0), be());
4151
+ k !== m(y) && ($(y, k, !0), Se());
3987
4152
  }
3988
- }), Ae(() => {
3989
- g(d) && (g(B) ? (g(d).enableStateRestoration(), q()) : g(d).cleanup());
4153
+ }), Ce(() => {
4154
+ m(p) && (m(j) ? (m(p).enableStateRestoration(), U()) : m(p).cleanup());
3990
4155
  });
3991
- var Ye = {
4156
+ var et = {
3992
4157
  get visible() {
3993
4158
  return r();
3994
4159
  },
3995
- set visible(I = !1) {
3996
- r(I), se();
4160
+ set visible(k = !1) {
4161
+ r(k), ue();
3997
4162
  },
3998
4163
  get toolId() {
3999
4164
  return i();
4000
4165
  },
4001
- set toolId(I = "answerEliminator") {
4002
- i(I), se();
4166
+ set toolId(k = "answerEliminator") {
4167
+ i(k), ue();
4003
4168
  },
4004
4169
  get strategy() {
4005
4170
  return n();
4006
4171
  },
4007
- set strategy(I = "strikethrough") {
4008
- n(I), se();
4172
+ set strategy(k = "strikethrough") {
4173
+ n(k), ue();
4009
4174
  },
4010
4175
  get alwaysOn() {
4011
- return s();
4176
+ return o();
4012
4177
  },
4013
- set alwaysOn(I = !1) {
4014
- s(I), se();
4178
+ set alwaysOn(k = !1) {
4179
+ o(k), ue();
4015
4180
  },
4016
4181
  get buttonAlignment() {
4017
- return o();
4182
+ return s();
4018
4183
  },
4019
- set buttonAlignment(I = "right") {
4020
- o(I), se();
4184
+ set buttonAlignment(k = "right") {
4185
+ s(k), ue();
4021
4186
  },
4022
4187
  get scopeElement() {
4023
- return a();
4188
+ return l();
4024
4189
  },
4025
- set scopeElement(I = null) {
4026
- a(I), se();
4190
+ set scopeElement(k = null) {
4191
+ l(k), ue();
4027
4192
  },
4028
4193
  get elementToolStateStore() {
4029
4194
  return c();
4030
4195
  },
4031
- set elementToolStateStore(I = null) {
4032
- c(I), se();
4196
+ set elementToolStateStore(k = null) {
4197
+ c(k), ue();
4033
4198
  },
4034
4199
  get globalElementId() {
4035
- return p();
4200
+ return d();
4036
4201
  },
4037
- set globalElementId(I = "") {
4038
- p(I), se();
4202
+ set globalElementId(k = "") {
4203
+ d(k), ue();
4039
4204
  }
4040
- }, fr = $o();
4041
- return Ts(fr, (I) => $(f, I), () => g(f)), Hi(e, fr), Jr(Ye);
4205
+ }, Sr = Ks();
4206
+ return Po(Sr, (k) => $(f, k), () => m(f)), Wi(e, Sr), li(et);
4042
4207
  }
4043
- customElements.define("pie-tool-answer-eliminator", Es(Oo, {
4208
+ customElements.define("pie-tool-answer-eliminator", Do(Us, {
4044
4209
  visible: {
4045
4210
  attribute: "visible",
4046
4211
  type: "Boolean"
@@ -4066,5 +4231,5 @@ customElements.define("pie-tool-answer-eliminator", Es(Oo, {
4066
4231
  globalElementId: { type: "String" }
4067
4232
  }, [], [], { mode: "open" }));
4068
4233
  export {
4069
- Oo as default
4234
+ Us as default
4070
4235
  };