@pie-players/pie-tool-answer-eliminator 0.3.47 → 0.3.49

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,16 +1,16 @@
1
- import { t as f } from "./defineProperty-Dt7ri80W.js";
2
- var Go = Object.create, ti = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, Ko = Object.getOwnPropertyNames, Xo = Object.getPrototypeOf, Yo = Object.prototype.hasOwnProperty, Vu = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Jo = (e, t, n, r) => {
1
+ import { t as p } from "./defineProperty-Dt7ri80W.js";
2
+ var Uo = Object.create, ti = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, Xo = Object.getOwnPropertyNames, Yo = Object.getPrototypeOf, Jo = Object.prototype.hasOwnProperty, Xu = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Qo = (e, t, n, r) => {
3
3
  if (t && typeof t == "object" || typeof t == "function")
4
- for (var i = Ko(t), o = 0, s = i.length, a; o < s; o++)
5
- a = i[o], !Yo.call(e, a) && a !== n && ti(e, a, {
4
+ for (var i = Xo(t), o = 0, s = i.length, a; o < s; o++)
5
+ a = i[o], !Jo.call(e, a) && a !== n && ti(e, a, {
6
6
  get: ((l) => t[l]).bind(null, a),
7
- enumerable: !(r = Uo(t, a)) || r.enumerable
7
+ enumerable: !(r = Ko(t, a)) || r.enumerable
8
8
  });
9
9
  return e;
10
- }, Qo = (e, t, n) => (n = e != null ? Go(Xo(e)) : {}, Jo(t || !e || !e.__esModule ? ti(n, "default", {
10
+ }, Zo = (e, t, n) => (n = e != null ? Uo(Yo(e)) : {}, Qo(t || !e || !e.__esModule ? ti(n, "default", {
11
11
  value: e,
12
12
  enumerable: !0
13
- }) : n, e)), Gu = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : e)(function(e) {
13
+ }) : n, e)), Yu = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : e)(function(e) {
14
14
  if (typeof require < "u") return require.apply(this, arguments);
15
15
  throw Error('Calling `require` for "' + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
16
16
  });
@@ -19,12 +19,12 @@ if (typeof window < "u") {
19
19
  ((gr = (mr = window).__svelte ?? (mr.__svelte = {})).v ?? (gr.v = /* @__PURE__ */ new Set())).add("5");
20
20
  }
21
21
  var qt = {}, H = /* @__PURE__ */ Symbol("uninitialized");
22
- var Zo = Array.isArray, es = Array.prototype.indexOf, Vt = Array.prototype.includes, ts = Array.from, Gt = Object.keys, Ut = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, ns = Object.prototype, rs = Array.prototype, is = Object.getPrototypeOf, vr = Object.isExtensible, os = () => {
22
+ var es = Array.isArray, ts = Array.prototype.indexOf, Vt = Array.prototype.includes, ns = Array.from, Gt = Object.keys, Ut = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, rs = Object.prototype, is = Array.prototype, os = Object.getPrototypeOf, vr = Object.isExtensible, ss = () => {
23
23
  };
24
- function ss(e) {
24
+ function as(e) {
25
25
  for (var t = 0; t < e.length; t++) e[t]();
26
26
  }
27
- function as() {
27
+ function ls() {
28
28
  var e, t;
29
29
  return {
30
30
  promise: new Promise((n, r) => {
@@ -34,51 +34,51 @@ function as() {
34
34
  reject: t
35
35
  };
36
36
  }
37
- var Uu = 1 << 24, ae = 1024, le = 2048, Ye = 4096, ni = 8192, ls = 16384, ri = 32768, yr = 1 << 25, ii = 65536, Ku = 1 << 17, Xu = 1 << 18, Ct = 1 << 19, cs = 1 << 20, xt = 65536, br = 1 << 21, Yu = 1 << 22, oi = 1 << 23, St = /* @__PURE__ */ Symbol("$state"), si = /* @__PURE__ */ Symbol("legacy props"), us = /* @__PURE__ */ Symbol("proxy path"), hs = /* @__PURE__ */ Symbol("attributes"), ds = /* @__PURE__ */ Symbol("class"), fs = /* @__PURE__ */ Symbol("style"), ps = /* @__PURE__ */ Symbol("text"), Yn = new class extends Error {
37
+ var Ju = 1 << 24, ae = 1024, le = 2048, Ye = 4096, ni = 8192, cs = 16384, ri = 32768, yr = 1 << 25, ii = 65536, Qu = 1 << 17, Zu = 1 << 18, Ct = 1 << 19, us = 1 << 20, xt = 65536, br = 1 << 21, eh = 1 << 22, oi = 1 << 23, St = /* @__PURE__ */ Symbol("$state"), si = /* @__PURE__ */ Symbol("legacy props"), hs = /* @__PURE__ */ Symbol("proxy path"), ds = /* @__PURE__ */ Symbol("attributes"), fs = /* @__PURE__ */ Symbol("class"), ps = /* @__PURE__ */ Symbol("style"), gs = /* @__PURE__ */ Symbol("text"), Yn = new class extends Error {
38
38
  constructor(...t) {
39
- super(...t), f(this, "name", "StaleReactionError"), f(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
39
+ super(...t), p(this, "name", "StaleReactionError"), p(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
40
40
  }
41
- }(), Qu = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
42
- function gs(e) {
41
+ }(), nh = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
42
+ function ms(e) {
43
43
  throw new Error("https://svelte.dev/e/lifecycle_outside_component");
44
44
  }
45
- function ms(e) {
45
+ function vs(e) {
46
46
  throw new Error("https://svelte.dev/e/effect_in_teardown");
47
47
  }
48
- function vs() {
48
+ function ys() {
49
49
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
50
50
  }
51
- function ys(e) {
51
+ function bs(e) {
52
52
  throw new Error("https://svelte.dev/e/effect_orphan");
53
53
  }
54
- function bs() {
54
+ function Ts() {
55
55
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
56
56
  }
57
- function Ts() {
57
+ function Ss() {
58
58
  throw new Error("https://svelte.dev/e/hydration_failed");
59
59
  }
60
- function Ss(e) {
60
+ function _s(e) {
61
61
  throw new Error("https://svelte.dev/e/props_invalid_value");
62
62
  }
63
- function _s() {
63
+ function ws() {
64
64
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
65
65
  }
66
- function ws() {
66
+ function ks() {
67
67
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
68
68
  }
69
- function ks() {
69
+ function Es() {
70
70
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
71
71
  }
72
- function Es() {
72
+ function As() {
73
73
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
74
74
  }
75
- function As() {
75
+ function Cs() {
76
76
  console.warn("https://svelte.dev/e/derived_inert");
77
77
  }
78
78
  function ai(e) {
79
79
  console.warn("https://svelte.dev/e/hydration_mismatch");
80
80
  }
81
- function Cs() {
81
+ function xs() {
82
82
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
83
83
  }
84
84
  var re = !1;
@@ -94,13 +94,13 @@ function kt(e) {
94
94
  function li() {
95
95
  return kt(/* @__PURE__ */ dt(D));
96
96
  }
97
- function xs(e = 1) {
97
+ function Is(e = 1) {
98
98
  if (re) {
99
99
  for (var t = e, n = D; t--; ) n = /* @__PURE__ */ dt(n);
100
100
  D = n;
101
101
  }
102
102
  }
103
- function Is(e = !0) {
103
+ function Os(e = !0) {
104
104
  for (var t = 0, n = D; ; ) {
105
105
  if (n.nodeType === 8) {
106
106
  var r = n.data;
@@ -116,18 +116,18 @@ function Is(e = !0) {
116
116
  function ci(e) {
117
117
  return e === this.v;
118
118
  }
119
- function Os(e, t) {
119
+ function Ms(e, t) {
120
120
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
121
121
  }
122
122
  function ui(e) {
123
- return !Os(e, this.v);
123
+ return !Ms(e, this.v);
124
124
  }
125
125
  var Ce = !1, It = !1;
126
126
  function Tr(e, t) {
127
- return e.label = t, Ms(e.v, t), e;
127
+ return e.label = t, Ls(e.v, t), e;
128
128
  }
129
- function Ms(e, t) {
130
- return e?.[us]?.(t), e;
129
+ function Ls(e, t) {
130
+ return e?.[hs]?.(t), e;
131
131
  }
132
132
  var L = null;
133
133
  function Kt(e) {
@@ -163,7 +163,7 @@ function ln() {
163
163
  var $e = [];
164
164
  function fi() {
165
165
  var e = $e;
166
- $e = [], ss(e);
166
+ $e = [], as(e);
167
167
  }
168
168
  function at(e) {
169
169
  if ($e.length === 0 && !_t) {
@@ -174,7 +174,7 @@ function at(e) {
174
174
  }
175
175
  $e.push(e);
176
176
  }
177
- function Ls() {
177
+ function Rs() {
178
178
  for (; $e.length > 0; ) fi();
179
179
  }
180
180
  function pi(e) {
@@ -200,9 +200,9 @@ function it(e, t) {
200
200
  }
201
201
  throw e;
202
202
  }
203
- var Rs = ~(le | Ye | ae);
203
+ var $s = ~(le | Ye | ae);
204
204
  function P(e, t) {
205
- e.f = e.f & Rs | t;
205
+ e.f = e.f & $s | t;
206
206
  }
207
207
  function Jn(e) {
208
208
  (e.f & 512) !== 0 || e.deps === null ? P(e, ae) : P(e, Ye);
@@ -215,8 +215,8 @@ function gi(e) {
215
215
  function mi(e, t, n) {
216
216
  (e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && n.add(e), gi(e.deps), P(e, ae);
217
217
  }
218
- var $s = !1, Rt = !1;
219
- function Ps(e) {
218
+ var Ps = !1, Rt = !1;
219
+ function Ns(e) {
220
220
  var t = Rt;
221
221
  try {
222
222
  return Rt = !1, [e(), Rt];
@@ -244,9 +244,9 @@ function d(e, t) {
244
244
  return e.get(_(e, t));
245
245
  }
246
246
  var yi, Xt = null, et = null, x = null, An = null, W = null, Cn = null, _t = !1, vn = !1, lt = null, Yt = null, bi = 0;
247
- var Ns = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakSet(), ht = class Ti {
247
+ var Hs = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakSet(), ht = class Ti {
248
248
  constructor() {
249
- Qn(this, R), f(this, "id", Ns++), w(this, Jt, !1), f(this, "linked", !0), w(this, ze, null), w(this, Pe, null), f(this, "async_deriveds", /* @__PURE__ */ new Map()), f(this, "current", /* @__PURE__ */ new Map()), f(this, "previous", /* @__PURE__ */ new Map()), w(this, Qt, /* @__PURE__ */ new Set()), w(this, $t, /* @__PURE__ */ new Set()), w(this, tt, 0), w(this, Le, /* @__PURE__ */ new Map()), w(this, mt, null), w(this, J, []), w(this, xn, []), w(this, Ge, /* @__PURE__ */ new Set()), w(this, me, /* @__PURE__ */ new Set()), w(this, Ae, /* @__PURE__ */ new Map()), w(this, Bt, /* @__PURE__ */ new Set()), f(this, "is_fork", !1), w(this, vt, !1), et === null ? Xt = et = this : (T(Pe, et, this), T(ze, this, et)), et = this;
249
+ Qn(this, R), p(this, "id", Hs++), w(this, Jt, !1), p(this, "linked", !0), w(this, ze, null), w(this, Pe, null), p(this, "async_deriveds", /* @__PURE__ */ new Map()), p(this, "current", /* @__PURE__ */ new Map()), p(this, "previous", /* @__PURE__ */ new Map()), w(this, Qt, /* @__PURE__ */ new Set()), w(this, $t, /* @__PURE__ */ new Set()), w(this, tt, 0), w(this, Le, /* @__PURE__ */ new Map()), w(this, mt, null), w(this, J, []), w(this, xn, []), w(this, Ge, /* @__PURE__ */ new Set()), w(this, me, /* @__PURE__ */ new Set()), w(this, Ae, /* @__PURE__ */ new Map()), w(this, Bt, /* @__PURE__ */ new Set()), p(this, "is_fork", !1), w(this, vt, !1), et === null ? Xt = et = this : (T(Pe, et, this), T(ze, this, et)), et = this;
250
250
  }
251
251
  skip_effect(t) {
252
252
  d(Ae, this).has(t) || d(Ae, this).set(t, {
@@ -315,7 +315,7 @@ var Ns = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
315
315
  d($t, this).add(t);
316
316
  }
317
317
  settled() {
318
- return (d(mt, this) ?? T(mt, this, as())).promise;
318
+ return (d(mt, this) ?? T(mt, this, ls())).promise;
319
319
  }
320
320
  static ensure() {
321
321
  if (x === null) {
@@ -355,7 +355,7 @@ var Ns = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
355
355
  for (var n = t; n.parent !== null; ) {
356
356
  n = n.parent;
357
357
  var r = n.f;
358
- if (lt !== null && n === E && (Ce || (k === null || (k.f & 2) === 0) && !$s))
358
+ if (lt !== null && n === E && (Ce || (k === null || (k.f & 2) === 0) && !Ps))
359
359
  return;
360
360
  if ((r & 96) !== 0) {
361
361
  if ((r & 1024) === 0) return;
@@ -381,7 +381,7 @@ function Sr() {
381
381
  return !1;
382
382
  }
383
383
  function Zt() {
384
- T(Jt, this, !0), bi++ > 1e3 && (_(R, this, en).call(this), Ws());
384
+ T(Jt, this, !0), bi++ > 1e3 && (_(R, this, en).call(this), Fs());
385
385
  for (const a of d(Ge, this))
386
386
  d(me, this).delete(a), P(a, le), this.schedule(a);
387
387
  for (const a of d(me, this))
@@ -404,16 +404,16 @@ function Zt() {
404
404
  r.length > 0 && _(R, x, Zt).call(x);
405
405
  return;
406
406
  }
407
- const o = _(R, this, Hs).call(this);
407
+ const o = _(R, this, Bs).call(this);
408
408
  if (o) {
409
- _(R, this, yt).call(this, n), _(R, this, yt).call(this, t), _(R, o, Bs).call(o, this);
409
+ _(R, this, yt).call(this, n), _(R, this, yt).call(this, t), _(R, o, zs).call(o, this);
410
410
  return;
411
411
  }
412
412
  d(Ge, this).clear(), d(me, this).clear();
413
413
  for (const a of d(Qt, this)) a(this);
414
414
  d(Qt, this).clear(), An = this, _r(n), _r(t), An = null, d(mt, this)?.resolve();
415
415
  var s = x;
416
- if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_(R, this, en).call(this), Ce && (_(R, this, zs).call(this), x = s)), d(J, this).length > 0) if (s !== null) {
416
+ if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_(R, this, en).call(this), Ce && (_(R, this, Ws).call(this), x = s)), d(J, this).length > 0) if (s !== null) {
417
417
  const a = s;
418
418
  d(J, a).push(...d(J, this).filter((l) => !d(J, a).includes(l)));
419
419
  } else s = this;
@@ -441,7 +441,7 @@ function Si(e, t, n) {
441
441
  }
442
442
  }
443
443
  }
444
- function Hs() {
444
+ function Bs() {
445
445
  for (var e = d(ze, this); e !== null; ) {
446
446
  if (!e.is_fork) {
447
447
  for (const [t, [, n]] of this.current) if (e.current.has(t) && !n) return e;
@@ -450,7 +450,7 @@ function Hs() {
450
450
  }
451
451
  return null;
452
452
  }
453
- function Bs(e) {
453
+ function zs(e) {
454
454
  for (const [n, r] of e.current)
455
455
  !this.previous.has(n) && e.previous.has(n) && this.previous.set(n, e.previous.get(n)), this.current.set(n, r);
456
456
  for (const [n, r] of e.async_deriveds) {
@@ -476,20 +476,20 @@ function Bs(e) {
476
476
  function yt(e) {
477
477
  for (var t = 0; t < e.length; t += 1) mi(e[t], d(Ge, this), d(me, this));
478
478
  }
479
- function zs() {
479
+ function Ws() {
480
480
  for (let c = Xt; c !== null; c = d(Pe, c)) {
481
481
  var e = c.id < this.id, t = [];
482
- for (const [u, [h, p]] of this.current) {
482
+ for (const [u, [h, f]] of this.current) {
483
483
  if (c.current.has(u)) {
484
484
  var n = c.current.get(u)[0];
485
- if (e && h !== n) c.current.set(u, [h, p]);
485
+ if (e && h !== n) c.current.set(u, [h, f]);
486
486
  else continue;
487
487
  }
488
488
  t.push(u);
489
489
  }
490
490
  if (e) for (const [u, h] of this.async_deriveds) {
491
- const p = c.async_deriveds.get(u);
492
- p && h.promise.then(p.resolve).catch(p.reject);
491
+ const f = c.async_deriveds.get(u);
492
+ f && h.promise.then(f.resolve).catch(f.reject);
493
493
  }
494
494
  if (d(Jt, c)) {
495
495
  var r = [...c.current.keys()].filter((u) => !c.current.get(u)[1] && !this.current.has(u));
@@ -504,8 +504,8 @@ function zs() {
504
504
  for (var s of t) _i(s, r, i, o);
505
505
  o = /* @__PURE__ */ new Map();
506
506
  var a = [...c.current].filter(([u, h]) => {
507
- const p = this.current.get(u);
508
- return p ? p[0] !== h[0] || p[1] !== h[1] : !0;
507
+ const f = this.current.get(u);
508
+ return f ? f[0] !== h[0] || f[1] !== h[1] : !0;
509
509
  }).map(([u]) => u);
510
510
  if (a.length > 0)
511
511
  for (const u of d(xn, this)) (u.f & 155648) === 0 && Zn(u, a, o) && ((u.f & 4194320) !== 0 ? (P(u, le), c.schedule(u)) : d(Ge, c).add(u));
@@ -531,21 +531,21 @@ function pe(e) {
531
531
  try {
532
532
  var n;
533
533
  for (e && (x !== null && !x.is_fork && x.flush(), n = e()); ; ) {
534
- if (Ls(), x === null) return n;
534
+ if (Rs(), x === null) return n;
535
535
  x.flush();
536
536
  }
537
537
  } finally {
538
538
  _t = t;
539
539
  }
540
540
  }
541
- function Ws() {
541
+ function Fs() {
542
542
  if (0) {
543
543
  var e;
544
544
  for (const n of x.current.keys()) for (const [r, i] of n.updated ?? [])
545
545
  var t;
546
546
  }
547
547
  try {
548
- bs();
548
+ Ts();
549
549
  } catch (n) {
550
550
  it(n, Cn);
551
551
  }
@@ -607,7 +607,7 @@ function ki(e) {
607
607
  for (var t = e.first; t !== null; )
608
608
  ki(t), t = t.next;
609
609
  }
610
- function Fs(e) {
610
+ function Ds(e) {
611
611
  let t = 0, n = cn(0), r;
612
612
  return () => {
613
613
  rr() && (b(n), ir(() => (t === 0 && (r = hn(() => e(() => wt(n)))), t += 1, () => {
@@ -617,28 +617,28 @@ function Fs(e) {
617
617
  })));
618
618
  };
619
619
  }
620
- var Ds = ii | Ct;
621
- function js(e, t, n, r) {
622
- new qs(e, t, n, r);
620
+ var js = ii | Ct;
621
+ function qs(e, t, n, r) {
622
+ new Vs(e, t, n, r);
623
623
  }
624
- var ie = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Mn = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), wr = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakSet(), qs = class {
624
+ var ie = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Mn = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), wr = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakSet(), Vs = class {
625
625
  constructor(e, t, n, r) {
626
- Qn(this, B), f(this, "parent", void 0), f(this, "is_pending", !1), f(this, "transform_error", void 0), w(this, ie, void 0), w(this, In, re ? D : null), w(this, ue, void 0), w(this, Et, void 0), w(this, Q, void 0), w(this, he, null), w(this, K, null), w(this, te, null), w(this, We, null), w(this, nt, 0), w(this, Fe, 0), w(this, Pt, !1), w(this, On, /* @__PURE__ */ new Set()), w(this, Mn, /* @__PURE__ */ new Set()), w(this, Oe, null), w(this, wr, Fs(() => (T(Oe, this, cn(d(nt, this))), () => {
626
+ Qn(this, B), p(this, "parent", void 0), p(this, "is_pending", !1), p(this, "transform_error", void 0), w(this, ie, void 0), w(this, In, re ? D : null), w(this, ue, void 0), w(this, Et, void 0), w(this, Q, void 0), w(this, he, null), w(this, K, null), w(this, te, null), w(this, We, null), w(this, nt, 0), w(this, Fe, 0), w(this, Pt, !1), w(this, On, /* @__PURE__ */ new Set()), w(this, Mn, /* @__PURE__ */ new Set()), w(this, Oe, null), w(this, wr, Ds(() => (T(Oe, this, cn(d(nt, this))), () => {
627
627
  T(Oe, this, null);
628
628
  }))), T(ie, this, e), T(ue, this, t), T(Et, this, (i) => {
629
629
  var o = E;
630
630
  o.b = this, o.f |= 128, n(i);
631
- }), this.parent = E.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), T(Q, this, la(() => {
631
+ }), this.parent = E.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), T(Q, this, ca(() => {
632
632
  if (re) {
633
633
  const i = d(In, this);
634
634
  li();
635
635
  const o = i.data === "[!";
636
636
  if (i.data.startsWith("[?")) {
637
637
  const s = JSON.parse(i.data.slice(2));
638
- _(B, this, Gs).call(this, s);
639
- } else o ? _(B, this, Us).call(this) : _(B, this, Vs).call(this);
638
+ _(B, this, Us).call(this, s);
639
+ } else o ? _(B, this, Ks).call(this) : _(B, this, Gs).call(this);
640
640
  } else _(B, this, Ei).call(this);
641
- }, Ds)), re && T(ie, this, D);
641
+ }, js)), re && T(ie, this, D);
642
642
  }
643
643
  defer_effect(e) {
644
644
  mi(e, d(On, this), d(Mn, this));
@@ -664,21 +664,21 @@ var ie = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), ue =
664
664
  })) : _(B, this, kr).call(this, e);
665
665
  }
666
666
  };
667
- function Vs() {
667
+ function Gs() {
668
668
  try {
669
669
  T(he, this, Ue(() => d(Et, this).call(this, d(ie, this))));
670
670
  } catch (e) {
671
671
  this.error(e);
672
672
  }
673
673
  }
674
- function Gs(e) {
674
+ function Us(e) {
675
675
  const t = d(ue, this).failed;
676
676
  t && T(te, this, Ue(() => {
677
677
  t(d(ie, this), () => e, () => () => {
678
678
  });
679
679
  }));
680
680
  }
681
- function Us() {
681
+ function Ks() {
682
682
  const e = d(ue, this).pending;
683
683
  e && (this.is_pending = !0, T(K, this, Ue(() => e(d(ie, this)))), at(() => {
684
684
  var t = T(We, this, document.createDocumentFragment()), n = Pi();
@@ -693,7 +693,7 @@ function Ei() {
693
693
  d(Et, this).call(this, d(ie, this));
694
694
  })), d(Fe, this) > 0) {
695
695
  var e = T(We, this, document.createDocumentFragment());
696
- ha(d(he, this), e);
696
+ da(d(he, this), e);
697
697
  const t = d(ue, this).pending;
698
698
  T(K, this, Ue(() => t(d(ie, this))));
699
699
  } else _(B, this, tr).call(this, x);
@@ -728,16 +728,16 @@ function Ai(e, t) {
728
728
  }), d(We, this) && (d(ie, this).before(d(We, this)), T(We, this, null)));
729
729
  }
730
730
  function kr(e) {
731
- d(he, this) && (oe(d(he, this)), T(he, this, null)), d(K, this) && (oe(d(K, this)), T(K, this, null)), d(te, this) && (oe(d(te, this)), T(te, this, null)), re && (kt(d(In, this)), xs(), kt(Is()));
731
+ d(he, this) && (oe(d(he, this)), T(he, this, null)), d(K, this) && (oe(d(K, this)), T(K, this, null)), d(te, this) && (oe(d(te, this)), T(te, this, null)), re && (kt(d(In, this)), Is(), kt(Os()));
732
732
  var t = d(ue, this).onerror;
733
733
  let n = d(ue, this).failed;
734
734
  var r = !1, i = !1;
735
735
  const o = () => {
736
736
  if (r) {
737
- Cs();
737
+ xs();
738
738
  return;
739
739
  }
740
- r = !0, i && Es(), d(te, this) !== null && un(d(te, this), () => {
740
+ r = !0, i && As(), d(te, this) !== null && un(d(te, this), () => {
741
741
  T(te, this, null);
742
742
  }), _(B, this, Ln).call(this, () => {
743
743
  _(B, this, Ei).call(this);
@@ -794,11 +794,11 @@ function Er(e) {
794
794
  return Ce || Di(t), t;
795
795
  }
796
796
  // @__NO_SIDE_EFFECTS__
797
- function Ks(e) {
797
+ function Xs(e) {
798
798
  const t = /* @__PURE__ */ tn(e);
799
799
  return t.equals = ui, t;
800
800
  }
801
- function Xs(e) {
801
+ function Ys(e) {
802
802
  var t = e.effects;
803
803
  if (t !== null) {
804
804
  e.effects = null;
@@ -808,10 +808,10 @@ function Xs(e) {
808
808
  function nr(e) {
809
809
  var t, n = E, r = e.parent;
810
810
  if (!ve && r !== null && e.v !== H && (r.f & 24576) !== 0)
811
- return As(), e.v;
811
+ return Cs(), e.v;
812
812
  xe(r);
813
813
  try {
814
- e.f &= ~xt, Xs(e), t = Gi(e);
814
+ e.f &= ~xt, Ys(e), t = Gi(e);
815
815
  } finally {
816
816
  xe(n);
817
817
  }
@@ -825,9 +825,9 @@ function Ci(e) {
825
825
  }
826
826
  ve || (W !== null ? (rr() || x?.is_fork) && W.set(e, t) : Jn(e));
827
827
  }
828
- function Ys(e) {
828
+ function Js(e) {
829
829
  if (e.effects !== null)
830
- for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Yn), t.fn !== null && (t.teardown = os), t.ac = null, At(t, 0), or(t));
830
+ for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Yn), t.fn !== null && (t.teardown = ss), t.ac = null, At(t, 0), or(t));
831
831
  }
832
832
  function xi(e) {
833
833
  if (e.effects !== null)
@@ -852,7 +852,7 @@ function F(e, t) {
852
852
  return Di(n), n;
853
853
  }
854
854
  // @__NO_SIDE_EFFECTS__
855
- function Js(e, t = !1, n = !0) {
855
+ function Qs(e, t = !1, n = !0) {
856
856
  const r = cn(e);
857
857
  if (t || (r.equals = ui), It && n && L !== null && L.l !== null) {
858
858
  var i;
@@ -861,7 +861,7 @@ function Js(e, t = !1, n = !0) {
861
861
  return r;
862
862
  }
863
863
  function M(e, t, n = !1) {
864
- k !== null && (!ne || (k.f & 131072) !== 0) && ln() && (k.f & 4325394) !== 0 && (se === null || !se.has(e)) && ks();
864
+ k !== null && (!ne || (k.f & 131072) !== 0) && ln() && (k.f & 4325394) !== 0 && (se === null || !se.has(e)) && Es();
865
865
  let r = n ? ot(t) : t;
866
866
  return Oi(e, r, Yt);
867
867
  }
@@ -873,11 +873,11 @@ function Oi(e, t, n = null) {
873
873
  const i = e;
874
874
  (e.f & 2048) !== 0 && nr(i), W === null && Jn(i);
875
875
  }
876
- e.wv = qi(), Mi(e, le, n), ln() && E !== null && (E.f & 1024) !== 0 && (E.f & 96) === 0 && (Y === null ? fa([e]) : Y.push(e)), !r.is_fork && nn.size > 0 && !Ii && Qs();
876
+ e.wv = qi(), Mi(e, le, n), ln() && E !== null && (E.f & 1024) !== 0 && (E.f & 96) === 0 && (Y === null ? pa([e]) : Y.push(e)), !r.is_fork && nn.size > 0 && !Ii && Zs();
877
877
  }
878
878
  return t;
879
879
  }
880
- function Qs() {
880
+ function Zs() {
881
881
  Ii = !1;
882
882
  for (const e of nn) {
883
883
  (e.f & 1024) !== 0 && P(e, Ye);
@@ -912,17 +912,17 @@ function Mi(e, t, n) {
912
912
  }
913
913
  }
914
914
  }
915
- var Zs = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
915
+ var ea = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
916
916
  function ot(e) {
917
917
  if (typeof e != "object" || e === null || St in e) return e;
918
- const t = is(e);
919
- if (t !== ns && t !== rs) return e;
920
- var n = /* @__PURE__ */ new Map(), r = Zo(e), i = /* @__PURE__ */ F(0), o = null, s = je, a = (h) => {
918
+ const t = os(e);
919
+ if (t !== rs && t !== is) return e;
920
+ var n = /* @__PURE__ */ new Map(), r = es(e), i = /* @__PURE__ */ F(0), o = null, s = je, a = (h) => {
921
921
  if (je === s) return h();
922
- var p = k, g = je;
922
+ var f = k, g = je;
923
923
  de(null), xr(s);
924
924
  var m = h();
925
- return de(p), xr(g), m;
925
+ return de(f), xr(g), m;
926
926
  };
927
927
  r && n.set("length", /* @__PURE__ */ F(e.length, o));
928
928
  var l = "";
@@ -930,49 +930,49 @@ function ot(e) {
930
930
  function u(h) {
931
931
  if (!c) {
932
932
  c = !0, l = h, Tr(i, `${l} version`);
933
- for (const [p, g] of n) Tr(g, ea(l, p));
933
+ for (const [f, g] of n) Tr(g, ta(l, f));
934
934
  c = !1;
935
935
  }
936
936
  }
937
937
  return new Proxy(e, {
938
- defineProperty(h, p, g) {
939
- (!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && _s();
940
- var m = n.get(p);
938
+ defineProperty(h, f, g) {
939
+ (!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && ws();
940
+ var m = n.get(f);
941
941
  return m === void 0 ? a(() => {
942
942
  var v = /* @__PURE__ */ F(g.value, o);
943
- return n.set(p, v), v;
943
+ return n.set(f, v), v;
944
944
  }) : M(m, g.value, !0), !0;
945
945
  },
946
- deleteProperty(h, p) {
947
- var g = n.get(p);
946
+ deleteProperty(h, f) {
947
+ var g = n.get(f);
948
948
  if (g === void 0) {
949
- if (p in h) {
949
+ if (f in h) {
950
950
  const m = a(() => /* @__PURE__ */ F(H, o));
951
- n.set(p, m), wt(i);
951
+ n.set(f, m), wt(i);
952
952
  }
953
953
  } else
954
954
  M(g, H), wt(i);
955
955
  return !0;
956
956
  },
957
- get(h, p, g) {
958
- if (p === St) return e;
959
- var m = n.get(p), v = p in h;
960
- if (m === void 0 && (!v || Be(h, p)?.writable) && (m = a(() => {
961
- var S = /* @__PURE__ */ F(ot(v ? h[p] : H), o);
957
+ get(h, f, g) {
958
+ if (f === St) return e;
959
+ var m = n.get(f), v = f in h;
960
+ if (m === void 0 && (!v || Be(h, f)?.writable) && (m = a(() => {
961
+ var S = /* @__PURE__ */ F(ot(v ? h[f] : H), o);
962
962
  return S;
963
- }), n.set(p, m)), m !== void 0) {
963
+ }), n.set(f, m)), m !== void 0) {
964
964
  var y = b(m);
965
965
  return y === H ? void 0 : y;
966
966
  }
967
- return Reflect.get(h, p, g);
967
+ return Reflect.get(h, f, g);
968
968
  },
969
- getOwnPropertyDescriptor(h, p) {
970
- var g = Reflect.getOwnPropertyDescriptor(h, p);
969
+ getOwnPropertyDescriptor(h, f) {
970
+ var g = Reflect.getOwnPropertyDescriptor(h, f);
971
971
  if (g && "value" in g) {
972
- var m = n.get(p);
972
+ var m = n.get(f);
973
973
  m && (g.value = b(m));
974
974
  } else if (g === void 0) {
975
- var v = n.get(p), y = v?.v;
975
+ var v = n.get(f), y = v?.v;
976
976
  if (v !== void 0 && y !== H) return {
977
977
  enumerable: !0,
978
978
  configurable: !0,
@@ -982,31 +982,31 @@ function ot(e) {
982
982
  }
983
983
  return g;
984
984
  },
985
- has(h, p) {
986
- if (p === St) return !0;
987
- var g = n.get(p), m = g !== void 0 && g.v !== H || Reflect.has(h, p);
988
- return (g !== void 0 || E !== null && (!m || Be(h, p)?.writable)) && (g === void 0 && (g = a(() => {
989
- var v = /* @__PURE__ */ F(m ? ot(h[p]) : H, o);
985
+ has(h, f) {
986
+ if (f === St) return !0;
987
+ var g = n.get(f), m = g !== void 0 && g.v !== H || Reflect.has(h, f);
988
+ return (g !== void 0 || E !== null && (!m || Be(h, f)?.writable)) && (g === void 0 && (g = a(() => {
989
+ var v = /* @__PURE__ */ F(m ? ot(h[f]) : H, o);
990
990
  return v;
991
- }), n.set(p, g)), b(g) === H) ? !1 : m;
991
+ }), n.set(f, g)), b(g) === H) ? !1 : m;
992
992
  },
993
- set(h, p, g, m) {
994
- var v = n.get(p), y = p in h;
995
- if (r && p === "length") for (var S = g; S < v.v; S += 1) {
993
+ set(h, f, g, m) {
994
+ var v = n.get(f), y = f in h;
995
+ if (r && f === "length") for (var S = g; S < v.v; S += 1) {
996
996
  var O = n.get(S + "");
997
997
  O !== void 0 ? M(O, H) : S in h && (O = a(() => /* @__PURE__ */ F(H, o)), n.set(S + "", O));
998
998
  }
999
999
  if (v === void 0)
1000
- (!y || Be(h, p)?.writable) && (v = a(() => /* @__PURE__ */ F(void 0, o)), M(v, ot(g)), n.set(p, v));
1000
+ (!y || Be(h, f)?.writable) && (v = a(() => /* @__PURE__ */ F(void 0, o)), M(v, ot(g)), n.set(f, v));
1001
1001
  else {
1002
1002
  y = v.v !== H;
1003
1003
  var V = a(() => ot(g));
1004
1004
  M(v, V);
1005
1005
  }
1006
- var A = Reflect.getOwnPropertyDescriptor(h, p);
1006
+ var A = Reflect.getOwnPropertyDescriptor(h, f);
1007
1007
  if (A?.set && A.set.call(m, g), !y) {
1008
- if (r && typeof p == "string") {
1009
- var G = n.get("length"), Z = Number(p);
1008
+ if (r && typeof f == "string") {
1009
+ var G = n.get("length"), Z = Number(f);
1010
1010
  Number.isInteger(Z) && Z >= G.v && M(G, Z + 1);
1011
1011
  }
1012
1012
  wt(i);
@@ -1015,27 +1015,27 @@ function ot(e) {
1015
1015
  },
1016
1016
  ownKeys(h) {
1017
1017
  b(i);
1018
- var p = Reflect.ownKeys(h).filter((v) => {
1018
+ var f = Reflect.ownKeys(h).filter((v) => {
1019
1019
  var y = n.get(v);
1020
1020
  return y === void 0 || y.v !== H;
1021
1021
  });
1022
- for (var [g, m] of n) m.v !== H && !(g in h) && p.push(g);
1023
- return p;
1022
+ for (var [g, m] of n) m.v !== H && !(g in h) && f.push(g);
1023
+ return f;
1024
1024
  },
1025
1025
  setPrototypeOf() {
1026
- ws();
1026
+ ks();
1027
1027
  }
1028
1028
  });
1029
1029
  }
1030
- function ea(e, t) {
1031
- return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : Zs.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
1030
+ function ta(e, t) {
1031
+ return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : ea.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
1032
1032
  }
1033
- var Ar, ta, Li, Ri, $i;
1033
+ var Ar, na, Li, Ri, $i;
1034
1034
  function Rn() {
1035
1035
  if (Ar === void 0) {
1036
- Ar = window, ta = document, Li = /Firefox/.test(navigator.userAgent);
1036
+ Ar = window, na = document, Li = /Firefox/.test(navigator.userAgent);
1037
1037
  var e = Element.prototype, t = Node.prototype, n = Text.prototype;
1038
- Ri = Be(t, "firstChild").get, $i = Be(t, "nextSibling").get, vr(e) && (e[ds] = void 0, e[hs] = null, e[fs] = void 0, e.__e = void 0), vr(n) && (n[ps] = void 0);
1038
+ Ri = Be(t, "firstChild").get, $i = Be(t, "nextSibling").get, vr(e) && (e[fs] = void 0, e[ds] = null, e[ps] = void 0, e.__e = void 0), vr(n) && (n[gs] = void 0);
1039
1039
  }
1040
1040
  }
1041
1041
  function Pi(e = "") {
@@ -1049,7 +1049,7 @@ function $n(e) {
1049
1049
  function dt(e) {
1050
1050
  return $i.call(e);
1051
1051
  }
1052
- function na(e) {
1052
+ function ra(e) {
1053
1053
  e.textContent = "";
1054
1054
  }
1055
1055
  function Ni(e, t, n) {
@@ -1064,10 +1064,10 @@ function Hi(e) {
1064
1064
  de(t), xe(n);
1065
1065
  }
1066
1066
  }
1067
- function ra(e) {
1068
- E === null && (k === null && ys(e), vs()), ve && ms(e);
1067
+ function ia(e) {
1068
+ E === null && (k === null && bs(e), ys()), ve && vs(e);
1069
1069
  }
1070
- function ia(e, t) {
1070
+ function oa(e, t) {
1071
1071
  var n = t.last;
1072
1072
  n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
1073
1073
  }
@@ -1101,7 +1101,7 @@ function Je(e, t) {
1101
1101
  }
1102
1102
  i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && (i.f & 524288) === 0 && (i = i.first, (e & 16) !== 0 && (e & 65536) !== 0 && i !== null && (i.f |= ii));
1103
1103
  }
1104
- if (i !== null && (i.parent = n, n !== null && ia(i, n), k !== null && (k.f & 2) !== 0 && (e & 64) === 0)) {
1104
+ if (i !== null && (i.parent = n, n !== null && oa(i, n), k !== null && (k.f & 2) !== 0 && (e & 64) === 0)) {
1105
1105
  var o = k;
1106
1106
  (o.effects ?? (o.effects = [])).push(i);
1107
1107
  }
@@ -1111,7 +1111,7 @@ function rr() {
1111
1111
  return k !== null && !ne;
1112
1112
  }
1113
1113
  function Re(e) {
1114
- ra("$effect");
1114
+ ia("$effect");
1115
1115
  var t = E.f;
1116
1116
  if (!k && (t & 32) !== 0 && L !== null && !L.i) {
1117
1117
  var n = L;
@@ -1119,16 +1119,16 @@ function Re(e) {
1119
1119
  } else return Bi(e);
1120
1120
  }
1121
1121
  function Bi(e) {
1122
- return Je(4 | cs, e);
1122
+ return Je(4 | us, e);
1123
1123
  }
1124
- function oa(e) {
1124
+ function sa(e) {
1125
1125
  ht.ensure();
1126
1126
  const t = Je(64 | Ct, e);
1127
1127
  return () => {
1128
1128
  oe(t);
1129
1129
  };
1130
1130
  }
1131
- function sa(e) {
1131
+ function aa(e) {
1132
1132
  ht.ensure();
1133
1133
  const t = Je(64 | Ct, e);
1134
1134
  return (n = {}) => new Promise((r) => {
@@ -1137,13 +1137,13 @@ function sa(e) {
1137
1137
  }) : (oe(t), r(void 0));
1138
1138
  });
1139
1139
  }
1140
- function aa(e) {
1140
+ function la(e) {
1141
1141
  return Je(4, e);
1142
1142
  }
1143
1143
  function ir(e, t = 0) {
1144
1144
  return Je(8 | t, e);
1145
1145
  }
1146
- function la(e, t = 0) {
1146
+ function ca(e, t = 0) {
1147
1147
  var n = Je(16 | t, e);
1148
1148
  return n;
1149
1149
  }
@@ -1173,7 +1173,7 @@ function or(e, t = !1) {
1173
1173
  (n.f & 64) !== 0 ? n.parent = null : oe(n, t), n = r;
1174
1174
  }
1175
1175
  }
1176
- function ca(e) {
1176
+ function ua(e) {
1177
1177
  for (var t = e.first; t !== null; ) {
1178
1178
  var n = t.next;
1179
1179
  (t.f & 32) === 0 && oe(t), t = n;
@@ -1181,14 +1181,14 @@ function ca(e) {
1181
1181
  }
1182
1182
  function oe(e, t = !0) {
1183
1183
  var n = !1;
1184
- (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (ua(e.nodes.start, e.nodes.end), n = !0), P(e, yr), or(e, t && !n), At(e, 0);
1184
+ (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (ha(e.nodes.start, e.nodes.end), n = !0), P(e, yr), or(e, t && !n), At(e, 0);
1185
1185
  var r = e.nodes && e.nodes.t;
1186
1186
  if (r !== null) for (const o of r) o.stop();
1187
- zi(e), e.f ^= yr, e.f |= ls;
1187
+ zi(e), e.f ^= yr, e.f |= cs;
1188
1188
  var i = e.parent;
1189
1189
  i !== null && i.first !== null && Wi(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1190
1190
  }
1191
- function ua(e, t) {
1191
+ function ha(e, t) {
1192
1192
  for (; e !== null; ) {
1193
1193
  var n = e === t ? null : /* @__PURE__ */ dt(e);
1194
1194
  e.remove(), e = n;
@@ -1225,14 +1225,14 @@ function Fi(e, t, n) {
1225
1225
  }
1226
1226
  }
1227
1227
  }
1228
- function ha(e, t) {
1228
+ function da(e, t) {
1229
1229
  if (e.nodes)
1230
1230
  for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
1231
1231
  var i = n === r ? null : /* @__PURE__ */ dt(n);
1232
1232
  t.append(n), n = i;
1233
1233
  }
1234
1234
  }
1235
- var da = null, zt = !1, ve = !1;
1235
+ var fa = null, zt = !1, ve = !1;
1236
1236
  function Cr(e) {
1237
1237
  ve = e;
1238
1238
  }
@@ -1249,7 +1249,7 @@ function Di(e) {
1249
1249
  k !== null && (!Ce || (k.f & 2) !== 0) && (se ?? (se = /* @__PURE__ */ new Set())).add(e);
1250
1250
  }
1251
1251
  var q = null, U = 0, Y = null;
1252
- function fa(e) {
1252
+ function pa(e) {
1253
1253
  Y = e;
1254
1254
  }
1255
1255
  var ji = 1, Ne = 0, je = Ne;
@@ -1288,18 +1288,18 @@ function Gi(e) {
1288
1288
  e.f |= br;
1289
1289
  var u = e.fn, h = u();
1290
1290
  e.f |= ri;
1291
- var p = e.deps, g = x?.is_fork;
1291
+ var f = e.deps, g = x?.is_fork;
1292
1292
  if (q !== null) {
1293
1293
  var m;
1294
- if (g || At(e, U), p !== null && U > 0)
1295
- for (p.length = U + q.length, m = 0; m < q.length; m++) p[U + m] = q[m];
1296
- else e.deps = p = q;
1297
- if (rr() && (e.f & 512) !== 0) for (m = U; m < p.length; m++) {
1294
+ if (g || At(e, U), f !== null && U > 0)
1295
+ for (f.length = U + q.length, m = 0; m < q.length; m++) f[U + m] = q[m];
1296
+ else e.deps = f = q;
1297
+ if (rr() && (e.f & 512) !== 0) for (m = U; m < f.length; m++) {
1298
1298
  var v;
1299
- ((v = p[m]).reactions ?? (v.reactions = [])).push(e);
1299
+ ((v = f[m]).reactions ?? (v.reactions = [])).push(e);
1300
1300
  }
1301
- } else !g && p !== null && U < p.length && (At(e, U), p.length = U);
1302
- if (ln() && Y !== null && !ne && p !== null && (e.f & 6146) === 0) for (m = 0; m < Y.length; m++) Vi(Y[m], e);
1301
+ } else !g && f !== null && U < f.length && (At(e, U), f.length = U);
1302
+ if (ln() && Y !== null && !ne && f !== null && (e.f & 6146) === 0) for (m = 0; m < Y.length; m++) Vi(Y[m], e);
1303
1303
  if (i !== null && i !== e) {
1304
1304
  if (Ne++, i.deps !== null) for (let y = 0; y < n; y += 1) i.deps[y].rv = Ne;
1305
1305
  if (t !== null) for (const y of t) y.rv = Ne;
@@ -1312,10 +1312,10 @@ function Gi(e) {
1312
1312
  e.f ^= br, q = t, U = n, Y = r, k = i, se = o, Kt(s), ne = a, je = l;
1313
1313
  }
1314
1314
  }
1315
- function pa(e, t) {
1315
+ function ga(e, t) {
1316
1316
  let n = t.reactions;
1317
1317
  if (n !== null) {
1318
- var r = es.call(n, e);
1318
+ var r = ts.call(n, e);
1319
1319
  if (r !== -1) {
1320
1320
  var i = n.length - 1;
1321
1321
  i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
@@ -1323,13 +1323,13 @@ function pa(e, t) {
1323
1323
  }
1324
1324
  if (n === null && (t.f & 2) !== 0 && (q === null || !Vt.call(q, t))) {
1325
1325
  var o = t;
1326
- (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~xt), o.v !== H && Jn(o), Ys(o), At(o, 0);
1326
+ (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~xt), o.v !== H && Jn(o), Js(o), At(o, 0);
1327
1327
  }
1328
1328
  }
1329
1329
  function At(e, t) {
1330
1330
  var n = e.deps;
1331
1331
  if (n !== null)
1332
- for (var r = t; r < n.length; r++) pa(e, n[r]);
1332
+ for (var r = t; r < n.length; r++) ga(e, n[r]);
1333
1333
  }
1334
1334
  function ct(e) {
1335
1335
  var t = e.f;
@@ -1339,7 +1339,7 @@ function ct(e) {
1339
1339
  if (E = e, zt = !0, 0)
1340
1340
  var i, o;
1341
1341
  try {
1342
- (t & 16777232) !== 0 ? ca(e) : or(e), zi(e);
1342
+ (t & 16777232) !== 0 ? ua(e) : or(e), zi(e);
1343
1343
  var s = Gi(e);
1344
1344
  if (e.teardown = typeof s == "function" ? s : null, e.wv = ji, 0)
1345
1345
  for (var a of e.deps) ;
@@ -1350,7 +1350,7 @@ function ct(e) {
1350
1350
  }
1351
1351
  function b(e) {
1352
1352
  var t = (e.f & 2) !== 0;
1353
- if (da?.add(e), k !== null && !ne && !(E !== null && (E.f & 16384) !== 0) && (se === null || !se.has(e))) {
1353
+ if (fa?.add(e), k !== null && !ne && !(E !== null && (E.f & 16384) !== 0) && (se === null || !se.has(e))) {
1354
1354
  var n = k.deps;
1355
1355
  if ((k.f & 2097152) !== 0)
1356
1356
  e.rv < Ne && (e.rv = Ne, q === null && n !== null && n[U] === e ? U++ : q === null ? q = [e] : q.push(e));
@@ -1403,7 +1403,7 @@ function hn(e) {
1403
1403
  ne = t;
1404
1404
  }
1405
1405
  }
1406
- var Nt = /* @__PURE__ */ Symbol("events"), ga = /* @__PURE__ */ new Set(), Ir = /* @__PURE__ */ new Set(), Or = null;
1406
+ var Nt = /* @__PURE__ */ Symbol("events"), ma = /* @__PURE__ */ new Set(), Ir = /* @__PURE__ */ new Set(), Or = null;
1407
1407
  function Mr(e) {
1408
1408
  var t = this, n = t.ownerDocument, r = e.type, i = e.composedPath?.() || [], o = i[0] || e.target;
1409
1409
  Or = e;
@@ -1428,34 +1428,34 @@ function Mr(e) {
1428
1428
  var u = k, h = E;
1429
1429
  de(null), xe(null);
1430
1430
  try {
1431
- for (var p, g = []; o !== null && o !== t; ) {
1431
+ for (var f, g = []; o !== null && o !== t; ) {
1432
1432
  try {
1433
1433
  var m = o[Nt]?.[r];
1434
1434
  m != null && (!o.disabled || e.target === o) && m.call(o, e);
1435
1435
  } catch (v) {
1436
- p ? g.push(v) : p = v;
1436
+ f ? g.push(v) : f = v;
1437
1437
  }
1438
1438
  if (e.cancelBubble) break;
1439
1439
  s++, o = s < i.length ? i[s] : null;
1440
1440
  }
1441
- if (p) {
1441
+ if (f) {
1442
1442
  for (let v of g) queueMicrotask(() => {
1443
1443
  throw v;
1444
1444
  });
1445
- throw p;
1445
+ throw f;
1446
1446
  }
1447
1447
  } finally {
1448
1448
  e[Nt] = t, delete e.currentTarget, de(u), xe(h);
1449
1449
  }
1450
1450
  }
1451
1451
  }
1452
- var ma = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1453
- function va(e) {
1454
- return ma?.createHTML(e) ?? e;
1455
- }
1452
+ var va = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1456
1453
  function ya(e) {
1454
+ return va?.createHTML(e) ?? e;
1455
+ }
1456
+ function ba(e) {
1457
1457
  var t = Ni("template");
1458
- return t.innerHTML = va(e.replaceAll("<!>", "<!---->")), t.content;
1458
+ return t.innerHTML = ya(e.replaceAll("<!>", "<!---->")), t.content;
1459
1459
  }
1460
1460
  function Wt(e, t) {
1461
1461
  var n = E;
@@ -1467,12 +1467,12 @@ function Wt(e, t) {
1467
1467
  });
1468
1468
  }
1469
1469
  // @__NO_SIDE_EFFECTS__
1470
- function ba(e, t) {
1470
+ function Ta(e, t) {
1471
1471
  var n = (t & 1) !== 0, r = (t & 2) !== 0, i, o = !e.startsWith("<!>");
1472
1472
  return () => {
1473
1473
  if (re)
1474
1474
  return Wt(D, null), D;
1475
- i === void 0 && (i = ya(o ? e : "<!>" + e), n || (i = /* @__PURE__ */ $n(i)));
1475
+ i === void 0 && (i = ba(o ? e : "<!>" + e), n || (i = /* @__PURE__ */ $n(i)));
1476
1476
  var s = r || Li ? document.importNode(i, !0) : i.cloneNode(!0);
1477
1477
  if (n) {
1478
1478
  var a = /* @__PURE__ */ $n(s), l = s.lastChild;
@@ -1489,7 +1489,7 @@ function Xi(e, t) {
1489
1489
  }
1490
1490
  e !== null && e.before(t);
1491
1491
  }
1492
- var Ta = [
1492
+ var Sa = [
1493
1493
  "allowfullscreen",
1494
1494
  "async",
1495
1495
  "autofocus",
@@ -1518,8 +1518,8 @@ var Ta = [
1518
1518
  "defer",
1519
1519
  "disablepictureinpicture",
1520
1520
  "disableremoteplayback"
1521
- ], Zu = [
1522
- ...Ta,
1521
+ ], rh = [
1522
+ ...Sa,
1523
1523
  "formNoValidate",
1524
1524
  "isMap",
1525
1525
  "noModule",
@@ -1534,17 +1534,17 @@ var Ta = [
1534
1534
  "allowFullscreen",
1535
1535
  "disablePictureInPicture",
1536
1536
  "disableRemotePlayback"
1537
- ], Sa = ["touchstart", "touchmove"];
1538
- function _a(e) {
1539
- return Sa.includes(e);
1537
+ ], _a = ["touchstart", "touchmove"];
1538
+ function wa(e) {
1539
+ return _a.includes(e);
1540
1540
  }
1541
- var wa = [
1541
+ var ka = [
1542
1542
  "$state",
1543
1543
  "$state.raw",
1544
1544
  "$derived",
1545
1545
  "$derived.by"
1546
- ], eh = [
1547
- ...wa,
1546
+ ], ih = [
1547
+ ...ka,
1548
1548
  "$state.eager",
1549
1549
  "$state.snapshot",
1550
1550
  "$props",
@@ -1563,7 +1563,7 @@ var wa = [
1563
1563
  function Yi(e, t) {
1564
1564
  return Ji(e, t);
1565
1565
  }
1566
- function ka(e, t) {
1566
+ function Ea(e, t) {
1567
1567
  Rn(), t.intro = t.intro ?? !1;
1568
1568
  const n = t.target, r = re, i = D;
1569
1569
  try {
@@ -1578,7 +1578,7 @@ function ka(e, t) {
1578
1578
  } catch (s) {
1579
1579
  if (s instanceof Error && s.message.split(`
1580
1580
  `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s;
1581
- return s !== qt && console.warn("Failed to hydrate: ", s), t.recover === !1 && Ts(), Rn(), na(n), Lt(!1), Yi(e, t);
1581
+ return s !== qt && console.warn("Failed to hydrate: ", s), t.recover === !1 && Ss(), Rn(), ra(n), Lt(!1), Yi(e, t);
1582
1582
  } finally {
1583
1583
  Lt(r), kt(i);
1584
1584
  }
@@ -1586,9 +1586,9 @@ function ka(e, t) {
1586
1586
  var Ht = /* @__PURE__ */ new Map();
1587
1587
  function Ji(e, { target: t, anchor: n, props: r = {}, events: i, context: o, intro: s = !0, transformError: a }) {
1588
1588
  Rn();
1589
- var l = void 0, c = sa(() => {
1589
+ var l = void 0, c = aa(() => {
1590
1590
  var u = n ?? t.appendChild(Pi());
1591
- js(u, { pending: () => {
1591
+ qs(u, { pending: () => {
1592
1592
  } }, (g) => {
1593
1593
  hi({});
1594
1594
  var m = L;
@@ -1596,12 +1596,12 @@ function Ji(e, { target: t, anchor: n, props: r = {}, events: i, context: o, int
1596
1596
  throw ai(), qt;
1597
1597
  di();
1598
1598
  }, a);
1599
- var h = /* @__PURE__ */ new Set(), p = (g) => {
1599
+ var h = /* @__PURE__ */ new Set(), f = (g) => {
1600
1600
  for (var m = 0; m < g.length; m++) {
1601
1601
  var v = g[m];
1602
1602
  if (!h.has(v)) {
1603
1603
  h.add(v);
1604
- var y = _a(v);
1604
+ var y = wa(v);
1605
1605
  for (const V of [t, document]) {
1606
1606
  var S = Ht.get(V);
1607
1607
  S === void 0 && (S = /* @__PURE__ */ new Map(), Ht.set(V, S));
@@ -1611,28 +1611,28 @@ function Ji(e, { target: t, anchor: n, props: r = {}, events: i, context: o, int
1611
1611
  }
1612
1612
  }
1613
1613
  };
1614
- return p(ts(ga)), Ir.add(p), () => {
1614
+ return f(ns(ma)), Ir.add(f), () => {
1615
1615
  for (var g of h) for (const y of [t, document]) {
1616
1616
  var m = Ht.get(y), v = m.get(g);
1617
1617
  --v == 0 ? (y.removeEventListener(g, Mr), m.delete(g), m.size === 0 && Ht.delete(y)) : m.set(g, v);
1618
1618
  }
1619
- Ir.delete(p), u !== n && u.parentNode?.removeChild(u);
1619
+ Ir.delete(f), u !== n && u.parentNode?.removeChild(u);
1620
1620
  };
1621
1621
  });
1622
1622
  return Pn.set(l, c), l;
1623
1623
  }
1624
1624
  var Pn = /* @__PURE__ */ new WeakMap();
1625
- function Ea(e, t) {
1625
+ function Aa(e, t) {
1626
1626
  const n = Pn.get(e);
1627
1627
  return n ? (Pn.delete(e), n(t)) : Promise.resolve();
1628
1628
  }
1629
- function Aa(e) {
1630
- L === null && gs("onMount"), It && L.l !== null ? Ca(L).m.push(e) : Re(() => {
1629
+ function Ca(e) {
1630
+ L === null && ms("onMount"), It && L.l !== null ? xa(L).m.push(e) : Re(() => {
1631
1631
  const t = hn(e);
1632
1632
  if (typeof t == "function") return t;
1633
1633
  });
1634
1634
  }
1635
- function Ca(e) {
1635
+ function xa(e) {
1636
1636
  var t = e.l;
1637
1637
  return t.u ?? (t.u = {
1638
1638
  a: [],
@@ -1646,14 +1646,14 @@ var Qi, rt = /* @__PURE__ */ new WeakMap(), rn = /* @__PURE__ */ new WeakMap(),
1646
1646
  }
1647
1647
  observe(e, t) {
1648
1648
  var n = d(rt, this).get(e) || /* @__PURE__ */ new Set();
1649
- return n.add(t), d(rt, this).set(e, n), _(Rr, this, xa).call(this).observe(e, d(yn, this)), () => {
1649
+ return n.add(t), d(rt, this).set(e, n), _(Rr, this, Ia).call(this).observe(e, d(yn, this)), () => {
1650
1650
  var r = d(rt, this).get(e);
1651
1651
  r.delete(t), r.size === 0 && (d(rt, this).delete(e), d(rn, this).unobserve(e));
1652
1652
  };
1653
1653
  }
1654
1654
  };
1655
1655
  Qi = Zi;
1656
- function xa() {
1656
+ function Ia() {
1657
1657
  return d(rn, this) ?? T(rn, this, new ResizeObserver((e) => {
1658
1658
  for (var t of e) {
1659
1659
  Qi.entries.set(t.target, t);
@@ -1661,13 +1661,13 @@ function xa() {
1661
1661
  }
1662
1662
  }));
1663
1663
  }
1664
- f(Zi, "entries", /* @__PURE__ */ new WeakMap());
1664
+ p(Zi, "entries", /* @__PURE__ */ new WeakMap());
1665
1665
  function bn(e, t) {
1666
1666
  return e === t || e?.[St] === t;
1667
1667
  }
1668
- function Ia(e = {}, t, n, r) {
1668
+ function Oa(e = {}, t, n, r) {
1669
1669
  var i = L.r, o = E;
1670
- return aa(() => {
1670
+ return la(() => {
1671
1671
  var s, a;
1672
1672
  return ir(() => {
1673
1673
  s = a, a = r?.() || [], hn(() => {
@@ -1689,11 +1689,11 @@ function we(e, t, n, r) {
1689
1689
  var i = !It || (n & 2) !== 0, o = (n & 8) !== 0, s = (n & 16) !== 0, a = r, l = !0, c = void 0, u = () => s && i ? (c ?? (c = /* @__PURE__ */ tn(r)), b(c)) : (l && (l = !1, a = s ? hn(r) : r), a);
1690
1690
  let h;
1691
1691
  if (o) {
1692
- var p = St in e || si in e;
1693
- h = Be(e, t)?.set ?? (p && t in e ? (A) => e[t] = A : void 0);
1692
+ var f = St in e || si in e;
1693
+ h = Be(e, t)?.set ?? (f && t in e ? (A) => e[t] = A : void 0);
1694
1694
  }
1695
1695
  var g, m = !1;
1696
- o ? [g, m] = Ps(() => e[t]) : g = e[t], g === void 0 && r !== void 0 && (g = u(), h && (i && Ss(t), h(g)));
1696
+ o ? [g, m] = Ns(() => e[t]) : g = e[t], g === void 0 && r !== void 0 && (g = u(), h && (i && _s(t), h(g)));
1697
1697
  var v;
1698
1698
  if (i ? v = () => {
1699
1699
  var A = e[t];
@@ -1708,7 +1708,7 @@ function we(e, t, n, r) {
1708
1708
  return arguments.length > 0 ? ((!i || !G || y || m) && h(G ? v() : A), A) : v();
1709
1709
  });
1710
1710
  }
1711
- var S = !1, O = ((n & 1) !== 0 ? tn : Ks)(() => (S = !1, v()));
1711
+ var S = !1, O = ((n & 1) !== 0 ? tn : Xs)(() => (S = !1, v()));
1712
1712
  o && b(O);
1713
1713
  var V = E;
1714
1714
  return (function(A, G) {
@@ -1719,14 +1719,14 @@ function we(e, t, n, r) {
1719
1719
  return ve && S || (V.f & 16384) !== 0 ? O.v : b(O);
1720
1720
  });
1721
1721
  }
1722
- function Oa(e) {
1723
- return new Ma(e);
1722
+ function Ma(e) {
1723
+ return new La(e);
1724
1724
  }
1725
- var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Ma = class {
1725
+ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), La = class {
1726
1726
  constructor(e) {
1727
1727
  w(this, Me, void 0), w(this, ce, void 0);
1728
1728
  var t = /* @__PURE__ */ new Map(), n = (i, o) => {
1729
- var s = /* @__PURE__ */ Js(o, !1, !1);
1729
+ var s = /* @__PURE__ */ Qs(o, !1, !1);
1730
1730
  return t.set(i, s), s;
1731
1731
  };
1732
1732
  const r = new Proxy({
@@ -1743,7 +1743,7 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Ma =
1743
1743
  return M(t.get(o) ?? n(o, s), s), Reflect.set(i, o, s);
1744
1744
  }
1745
1745
  });
1746
- T(ce, this, (e.hydrate ? ka : Yi)(e.component, {
1746
+ T(ce, this, (e.hydrate ? Ea : Yi)(e.component, {
1747
1747
  target: e.target,
1748
1748
  anchor: e.anchor,
1749
1749
  props: r,
@@ -1765,7 +1765,7 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Ma =
1765
1765
  d(ce, this).$set = (i) => {
1766
1766
  Object.assign(r, i);
1767
1767
  }, d(ce, this).$destroy = () => {
1768
- Ea(d(ce, this));
1768
+ Aa(d(ce, this));
1769
1769
  };
1770
1770
  }
1771
1771
  $set(e) {
@@ -1784,7 +1784,7 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Ma =
1784
1784
  }, eo;
1785
1785
  typeof HTMLElement == "function" && (eo = class extends HTMLElement {
1786
1786
  constructor(e, t, n) {
1787
- super(), f(this, "$$ctor", void 0), f(this, "$$s", void 0), f(this, "$$c", void 0), f(this, "$$cn", !1), f(this, "$$d", {}), f(this, "$$r", !1), f(this, "$$p_d", {}), f(this, "$$l", {}), f(this, "$$l_u", /* @__PURE__ */ new Map()), f(this, "$$me", void 0), f(this, "$$shadowRoot", null), this.$$ctor = e, this.$$s = t, n && (this.$$shadowRoot = this.attachShadow(n));
1787
+ super(), p(this, "$$ctor", void 0), p(this, "$$s", void 0), p(this, "$$c", void 0), p(this, "$$cn", !1), p(this, "$$d", {}), p(this, "$$r", !1), p(this, "$$p_d", {}), p(this, "$$l", {}), p(this, "$$l_u", /* @__PURE__ */ new Map()), p(this, "$$me", void 0), p(this, "$$shadowRoot", null), this.$$ctor = e, this.$$s = t, n && (this.$$shadowRoot = this.attachShadow(n));
1788
1788
  }
1789
1789
  addEventListener(e, t, n) {
1790
1790
  if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
@@ -1808,14 +1808,14 @@ typeof HTMLElement == "function" && (eo = class extends HTMLElement {
1808
1808
  };
1809
1809
  };
1810
1810
  if (await Promise.resolve(), !this.$$cn || this.$$c) return;
1811
- const t = {}, n = La(this);
1811
+ const t = {}, n = Ra(this);
1812
1812
  for (const r of this.$$s) r in n && (r === "default" && !this.$$d.children ? (this.$$d.children = e(r), t.default = !0) : t[r] = e(r));
1813
1813
  for (const r of this.attributes) {
1814
1814
  const i = this.$$g_p(r.name);
1815
1815
  i in this.$$d || (this.$$d[i] = Ft(i, r.value, this.$$p_d, "toProp"));
1816
1816
  }
1817
1817
  for (const r in this.$$p_d) !(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
1818
- this.$$c = Oa({
1818
+ this.$$c = Ma({
1819
1819
  component: this.$$ctor,
1820
1820
  target: this.$$shadowRoot || this,
1821
1821
  props: {
@@ -1823,7 +1823,7 @@ typeof HTMLElement == "function" && (eo = class extends HTMLElement {
1823
1823
  $$slots: t,
1824
1824
  $$host: this
1825
1825
  }
1826
- }), this.$$me = oa(() => {
1826
+ }), this.$$me = sa(() => {
1827
1827
  ir(() => {
1828
1828
  this.$$r = !0;
1829
1829
  for (const r of Gt(this.$$c)) {
@@ -1880,13 +1880,13 @@ function Ft(e, t, n, r) {
1880
1880
  return t;
1881
1881
  }
1882
1882
  }
1883
- function La(e) {
1883
+ function Ra(e) {
1884
1884
  const t = {};
1885
1885
  return e.childNodes.forEach((n) => {
1886
1886
  t[n.slot || "default"] = !0;
1887
1887
  }), t;
1888
1888
  }
1889
- function Ra(e, t, n, r, i, o) {
1889
+ function $a(e, t, n, r, i, o) {
1890
1890
  let s = class extends eo {
1891
1891
  constructor() {
1892
1892
  super(e, n, i), this.$$p_d = t;
@@ -1912,16 +1912,16 @@ function Ra(e, t, n, r, i, o) {
1912
1912
  } });
1913
1913
  }), o && (s = o(s)), e.element = s, s;
1914
1914
  }
1915
- var $a = class extends Event {
1915
+ var Pa = class extends Event {
1916
1916
  constructor(e, t, n, r) {
1917
1917
  super("context-request", {
1918
1918
  bubbles: !0,
1919
1919
  composed: !0
1920
- }), f(this, "context", void 0), f(this, "contextTarget", void 0), f(this, "callback", void 0), f(this, "subscribe", void 0), this.context = e, this.contextTarget = t, this.callback = n, this.subscribe = r ?? !1;
1920
+ }), p(this, "context", void 0), p(this, "contextTarget", void 0), p(this, "callback", void 0), p(this, "subscribe", void 0), this.context = e, this.contextTarget = t, this.callback = n, this.subscribe = r ?? !1;
1921
1921
  }
1922
- }, Pa = class {
1922
+ }, Na = class {
1923
1923
  constructor(e, t) {
1924
- f(this, "host", void 0), f(this, "context", void 0), f(this, "subscribe", void 0), f(this, "onValue", void 0), f(this, "isConnected", !1), f(this, "unsubscribe", void 0), f(this, "currentValue", void 0), f(this, "handleValue", (n, r) => {
1924
+ p(this, "host", void 0), p(this, "context", void 0), p(this, "subscribe", void 0), p(this, "onValue", void 0), p(this, "isConnected", !1), p(this, "unsubscribe", void 0), p(this, "currentValue", void 0), p(this, "handleValue", (n, r) => {
1925
1925
  r !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = r), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = n, this.onValue?.(n);
1926
1926
  }), this.host = e, this.context = t.context, this.subscribe = t.subscribe ?? !0, this.onValue = t.onValue;
1927
1927
  }
@@ -1935,12 +1935,12 @@ var $a = class extends Event {
1935
1935
  return this.currentValue;
1936
1936
  }
1937
1937
  requestValue() {
1938
- this.host.dispatchEvent(new $a(this.context, this.host, this.handleValue, this.subscribe));
1938
+ this.host.dispatchEvent(new Pa(this.context, this.host, this.handleValue, this.subscribe));
1939
1939
  }
1940
- }, dn = (e) => e, Na = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), th = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Ha = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), nh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
1940
+ }, dn = (e) => e, Ha = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), oh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Ba = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), sh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
1941
1941
  function to(e, t, n) {
1942
1942
  let r = !1;
1943
- const i = new Pa(e, {
1943
+ const i = new Na(e, {
1944
1944
  context: t,
1945
1945
  subscribe: !0,
1946
1946
  onValue: (c) => {
@@ -1964,19 +1964,19 @@ function to(e, t, n) {
1964
1964
  globalThis.clearInterval(l), e.removeEventListener("context-provider", o), i.disconnect();
1965
1965
  };
1966
1966
  }
1967
- function Ba(e, t) {
1968
- return to(e, Na, t);
1969
- }
1970
1967
  function za(e, t) {
1971
1968
  return to(e, Ha, t);
1972
1969
  }
1973
1970
  function Wa(e, t) {
1974
- return Ba(e, t);
1971
+ return to(e, Ba, t);
1975
1972
  }
1976
1973
  function Fa(e, t) {
1977
1974
  return za(e, t);
1978
1975
  }
1979
- var Da = class {
1976
+ function Da(e, t) {
1977
+ return Wa(e, t);
1978
+ }
1979
+ var ja = class {
1980
1980
  serialize(e, t) {
1981
1981
  return {
1982
1982
  startContainer: this.getNodePath(e.startContainer, t),
@@ -2051,7 +2051,7 @@ var st;
2051
2051
  })(st || (st = {}));
2052
2052
  var no = class Nn {
2053
2053
  constructor(t = {}) {
2054
- if (f(this, "config", void 0), f(this, "ttsWordHighlight", null), f(this, "ttsSentenceHighlight", null), f(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), f(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), f(this, "annotations", /* @__PURE__ */ new Map()), f(this, "colorHighlights", /* @__PURE__ */ new Map()), f(this, "nextAnnotationId", 1), f(this, "supported", !1), f(this, "rangeSerializer", void 0), f(this, "themeObserver", null), f(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new Da(), typeof CSS > "u" || !("highlights" in CSS)) {
2054
+ if (p(this, "config", void 0), p(this, "ttsWordHighlight", null), p(this, "ttsSentenceHighlight", null), p(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), p(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), p(this, "annotations", /* @__PURE__ */ new Map()), p(this, "colorHighlights", /* @__PURE__ */ new Map()), p(this, "nextAnnotationId", 1), p(this, "supported", !1), p(this, "rangeSerializer", void 0), p(this, "themeObserver", null), p(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new ja(), typeof CSS > "u" || !("highlights" in CSS)) {
2055
2055
  console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");
2056
2056
  return;
2057
2057
  }
@@ -2159,14 +2159,14 @@ var no = class Nn {
2159
2159
  0.56,
2160
2160
  0.5
2161
2161
  ];
2162
- let h = u[u.length - 1], p = -1 / 0;
2162
+ let h = u[u.length - 1], f = -1 / 0;
2163
2163
  for (const G of u) {
2164
2164
  const Z = this.blend(c, a, G), pt = this.contrastRatio(Z, a), C = this.contrastRatio(Z, l), pr = pt * 1.2 + C * 0.8;
2165
2165
  if (pt >= 1.25 && C >= 2.4) {
2166
2166
  h = G;
2167
2167
  break;
2168
2168
  }
2169
- pr > p && (p = pr, h = G);
2169
+ pr > f && (f = pr, h = G);
2170
2170
  }
2171
2171
  const g = Math.max(0.24, Math.min(0.85, h * 0.55)), m = Math.max(0.55, Math.min(0.95, h + 0.2)), v = Math.max(0.22, Math.min(0.6, h * 0.45)), y = l, S = this.blend(y, a, m), O = this.contrastRatio(S, a), V = this.relativeLuminance(a) > 0.45 ? [
2172
2172
  0,
@@ -2454,14 +2454,14 @@ var no = class Nn {
2454
2454
  }
2455
2455
  }
2456
2456
  };
2457
- f(no, "SENTENCE_FALLBACK_SELECTOR", "math, mjx-container, svg, img, canvas, [role='img']");
2458
- f(no, "WORD_FALLBACK_SELECTOR", "svg, img, canvas, [role='img']");
2457
+ p(no, "SENTENCE_FALLBACK_SELECTOR", "math, mjx-container, svg, img, canvas, [role='img']");
2458
+ p(no, "WORD_FALLBACK_SELECTOR", "svg, img, canvas, [role='img']");
2459
2459
  function ro(e) {
2460
2460
  return (...t) => {
2461
2461
  console.debug(`[${e}]`, ...t);
2462
2462
  };
2463
2463
  }
2464
- var rh = ro("I18nService"), Tn = {
2464
+ var ah = ro("I18nService"), Tn = {
2465
2465
  assessment: [],
2466
2466
  section: [],
2467
2467
  item: [],
@@ -2482,19 +2482,19 @@ function ke(e, t) {
2482
2482
  if (e.find((n) => typeof n != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
2483
2483
  return e;
2484
2484
  }
2485
- function ja(e) {
2485
+ function qa(e) {
2486
2486
  if (e != null) {
2487
2487
  if (!qe(e)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
2488
2488
  return e;
2489
2489
  }
2490
2490
  }
2491
- function qa(e) {
2491
+ function Va(e) {
2492
2492
  if (e != null) {
2493
2493
  if (!qe(e)) throw new Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');
2494
2494
  return e;
2495
2495
  }
2496
2496
  }
2497
- function Va(e, t) {
2497
+ function Ga(e, t) {
2498
2498
  if (t == null) return;
2499
2499
  if (!qe(t)) throw new Error(`Invalid tools config at "providers.${e}": expected an object.`);
2500
2500
  const n = t, r = (i) => i === "polly" || i === "google" || i === "custom";
@@ -2503,11 +2503,11 @@ function Va(e, t) {
2503
2503
  if ("provider" in n && n.provider !== void 0 && !qe(n.provider) && !(e === "textToSpeech" && r(n.provider))) throw new Error(`Invalid tools config at "providers.${e}.provider": expected an object.`);
2504
2504
  return n;
2505
2505
  }
2506
- function Ga(e) {
2506
+ function Ua(e) {
2507
2507
  if (e == null) return {};
2508
2508
  if (!qe(e)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
2509
2509
  const t = {};
2510
- for (const [n, r] of Object.entries(e)) t[n] = Va(n, r);
2510
+ for (const [n, r] of Object.entries(e)) t[n] = Ga(n, r);
2511
2511
  return t;
2512
2512
  }
2513
2513
  function io(e) {
@@ -2524,15 +2524,15 @@ function Ee(e) {
2524
2524
  }
2525
2525
  return Array.from(t);
2526
2526
  }
2527
- function Ua(e, t) {
2527
+ function Ka(e, t) {
2528
2528
  if (e != null) {
2529
2529
  if (e === "on" || e === "off") return e;
2530
2530
  throw new Error(`Invalid tools config at "${t}": expected "on" or "off", got ${JSON.stringify(e)}.`);
2531
2531
  }
2532
2532
  }
2533
- function Ka(e) {
2533
+ function Xa(e) {
2534
2534
  if (e != null && !qe(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
2535
- const t = qa(e?.policy), n = ja(e?.placement), r = Ga(e?.providers), i = Ua(e?.pnpEnforcement, "pnpEnforcement"), o = {
2535
+ const t = Va(e?.policy), n = qa(e?.placement), r = Ua(e?.providers), i = Ka(e?.pnpEnforcement, "pnpEnforcement"), o = {
2536
2536
  policy: {
2537
2537
  allowed: Ee(ke(t?.allowed, "policy.allowed")),
2538
2538
  blocked: Ee(ke(t?.blocked, "policy.blocked"))
@@ -2546,7 +2546,7 @@ function Ka(e) {
2546
2546
  };
2547
2547
  return i && (o.pnpEnforcement = i), o;
2548
2548
  }
2549
- var Xa = [
2549
+ var Ya = [
2550
2550
  "assessment",
2551
2551
  "section",
2552
2552
  "item",
@@ -2557,7 +2557,7 @@ var Xa = [
2557
2557
  function Dt(e, t) {
2558
2558
  if (typeof e != "string" || e.trim().length === 0) throw new Error(`Invalid tool registration: "${t}" must be a non-empty string.`);
2559
2559
  }
2560
- var Ya = [
2560
+ var Ja = [
2561
2561
  {
2562
2562
  pattern: /<script\b/i,
2563
2563
  reason: "contains a <script> tag"
@@ -2575,17 +2575,17 @@ var Ya = [
2575
2575
  reason: "contains a <foreignObject> element"
2576
2576
  }
2577
2577
  ];
2578
- function Ja(e, t, n) {
2578
+ function Qa(e, t, n) {
2579
2579
  const r = t.trimStart(), i = r.toLowerCase().startsWith("<svg"), o = /^https?:/i.test(r);
2580
2580
  if (/^data:/i.test(r)) throw new Error(`Invalid tool registration "${e}": "${n}" may not be a data: URL.`);
2581
2581
  if (!(!i && !o)) {
2582
- for (const { pattern: s, reason: a } of Ya) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
2582
+ for (const { pattern: s, reason: a } of Ja) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
2583
2583
  }
2584
2584
  }
2585
2585
  function $r(e) {
2586
2586
  if (Dt(e.toolId, "toolId"), Dt(e.name, "name"), Dt(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.`);
2587
- if (typeof e.icon == "string" && Ja(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.`);
2588
- const t = e.supportedLevels.find((n) => !Xa.includes(n));
2587
+ if (typeof e.icon == "string" && Qa(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.`);
2588
+ const t = e.supportedLevels.find((n) => !Ya.includes(n));
2589
2589
  if (t) throw new Error(`Invalid tool registration "${e.toolId}": unsupported level "${t}".`);
2590
2590
  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)}".`);
2591
2591
  if (e.singletonScope !== void 0 && e.singletonScope !== "section") throw new Error(`Invalid tool registration "${e.toolId}": unsupported singletonScope "${String(e.singletonScope)}".`);
@@ -2594,9 +2594,9 @@ function $r(e) {
2594
2594
  if (typeof e.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${e.toolId}": "isVisibleInContext" must be a function.`);
2595
2595
  if (typeof e.renderToolbar != "function") throw new Error(`Invalid tool registration "${e.toolId}": "renderToolbar" must be a function.`);
2596
2596
  }
2597
- var Qa = class {
2597
+ var Za = class {
2598
2598
  constructor() {
2599
- f(this, "tools", /* @__PURE__ */ new Map()), f(this, "pnpIndex", /* @__PURE__ */ new Map()), f(this, "componentOverrides", {}), f(this, "moduleLoaders", /* @__PURE__ */ new Map()), f(this, "loadedToolModules", /* @__PURE__ */ new Set()), f(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
2599
+ p(this, "tools", /* @__PURE__ */ new Map()), p(this, "pnpIndex", /* @__PURE__ */ new Map()), p(this, "componentOverrides", {}), p(this, "moduleLoaders", /* @__PURE__ */ new Map()), p(this, "loadedToolModules", /* @__PURE__ */ new Set()), p(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
2600
2600
  }
2601
2601
  normalizeToolId(e) {
2602
2602
  return io(e);
@@ -2740,10 +2740,10 @@ var Qa = class {
2740
2740
  function oo(e) {
2741
2741
  return e.level === "item";
2742
2742
  }
2743
- function Za(e) {
2743
+ function el(e) {
2744
2744
  return e.level === "passage";
2745
2745
  }
2746
- function el(e) {
2746
+ function tl(e) {
2747
2747
  return e.level === "rubric";
2748
2748
  }
2749
2749
  function so(e) {
@@ -2784,7 +2784,7 @@ function sr(e) {
2784
2784
  }
2785
2785
  return r.filter(Boolean).join(" ").trim();
2786
2786
  }
2787
- if (Za(e)) {
2787
+ if (el(e)) {
2788
2788
  const t = e.passage;
2789
2789
  if (!t?.config) return "";
2790
2790
  const n = t.config, r = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
@@ -2803,7 +2803,7 @@ function sr(e) {
2803
2803
  }
2804
2804
  return r.filter(Boolean).join(" ").trim();
2805
2805
  }
2806
- if (el(e)) {
2806
+ if (tl(e)) {
2807
2807
  const t = e.rubricBlock;
2808
2808
  return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
2809
2809
  }
@@ -2820,7 +2820,7 @@ function fn(e) {
2820
2820
  /\d+\s*[+\-*/=]\s*\d+/
2821
2821
  ].some((n) => n.test(t));
2822
2822
  }
2823
- function tl(e) {
2823
+ function nl(e) {
2824
2824
  const t = [
2825
2825
  "pie-multiple-choice",
2826
2826
  "pie-inline-choice",
@@ -2850,7 +2850,7 @@ function tl(e) {
2850
2850
  function pn(e) {
2851
2851
  return sr(e).trim().length >= 10;
2852
2852
  }
2853
- function nl(e) {
2853
+ function rl(e) {
2854
2854
  const t = sr(e);
2855
2855
  return [
2856
2856
  /chemistry|chemical|element|atom|molecule|compound/i,
@@ -2861,25 +2861,25 @@ function nl(e) {
2861
2861
  /physics|force|energy|velocity|acceleration/i
2862
2862
  ].some((n) => n.test(t));
2863
2863
  }
2864
- var rl = [
2864
+ var il = [
2865
2865
  "assessment",
2866
2866
  "section",
2867
2867
  "item",
2868
2868
  "passage",
2869
2869
  "rubric"
2870
- ], il = new Set(rl);
2871
- function ol(e) {
2872
- return il.has(e);
2870
+ ], ol = new Set(il);
2871
+ function sl(e) {
2872
+ return ol.has(e);
2873
2873
  }
2874
2874
  function ar(e, t, n) {
2875
2875
  const r = e.trim(), i = n.trim();
2876
2876
  if (!r || !i) throw new Error("Tool instance ids require non-empty tool and scope ids");
2877
- if (!ol(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
2877
+ if (!sl(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
2878
2878
  return `${r}:${t}:${i}`;
2879
2879
  }
2880
- var sl = class {
2880
+ var al = class {
2881
2881
  constructor() {
2882
- f(this, "providerId", "desmos-calculator"), f(this, "providerName", "Desmos Calculator"), f(this, "category", "calculator"), f(this, "version", "1.10"), f(this, "requiresAuth", !0), f(this, "desmosProvider", null), f(this, "config", null);
2882
+ p(this, "providerId", "desmos-calculator"), p(this, "providerName", "Desmos Calculator"), p(this, "category", "calculator"), p(this, "version", "1.10"), p(this, "requiresAuth", !0), p(this, "desmosProvider", null), p(this, "config", null);
2883
2883
  }
2884
2884
  async emitTelemetry(e, t) {
2885
2885
  try {
@@ -2981,14 +2981,34 @@ var sl = class {
2981
2981
  text: e,
2982
2982
  offset: 0
2983
2983
  }];
2984
- }, ao = class {
2984
+ }, ao = (e) => String(e || "").trim().toLowerCase(), ll = () => ao((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), cl = (e, t) => {
2985
+ if (t) {
2986
+ const s = e.find((a) => a.name === t);
2987
+ if (s) return s;
2988
+ }
2989
+ const n = ll(), r = n.split("-")[0] || "en", i = (s) => {
2990
+ const a = ao(s.lang);
2991
+ return a === n || a.startsWith(`${r}-`);
2992
+ }, o = [
2993
+ (s) => s.localService && i(s),
2994
+ (s) => s.default && i(s),
2995
+ (s) => i(s),
2996
+ (s) => s.localService,
2997
+ (s) => s.default
2998
+ ];
2999
+ for (const s of o) {
3000
+ const a = e.find(s);
3001
+ if (a) return a;
3002
+ }
3003
+ return e[0] || null;
3004
+ }, ul = (e) => !e.default, lo = class {
2985
3005
  constructor() {
2986
- f(this, "providerId", "browser"), f(this, "providerName", "Browser Speech Synthesis"), f(this, "version", "1.0.0");
3006
+ p(this, "providerId", "browser"), p(this, "providerName", "Browser Speech Synthesis"), p(this, "version", "1.0.0");
2987
3007
  }
2988
3008
  async initialize(e) {
2989
3009
  if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
2990
3010
  if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
2991
- return new al(e);
3011
+ return new hl(e);
2992
3012
  }
2993
3013
  supportsFeature(e) {
2994
3014
  return !0;
@@ -3006,9 +3026,9 @@ var sl = class {
3006
3026
  }
3007
3027
  destroy() {
3008
3028
  }
3009
- }, al = class {
3029
+ }, hl = class {
3010
3030
  constructor(e) {
3011
- f(this, "utterance", null), f(this, "config", null), f(this, "_isPlaying", !1), f(this, "_isPaused", !1), f(this, "speakRunId", 0), f(this, "onWordBoundary", void 0), this.config = e;
3031
+ p(this, "utterance", null), p(this, "config", null), p(this, "_isPlaying", !1), p(this, "_isPaused", !1), p(this, "speakRunId", 0), p(this, "onWordBoundary", void 0), this.config = e;
3012
3032
  }
3013
3033
  async speak(e) {
3014
3034
  if (!this.config) throw new Error("TTS not initialized");
@@ -3091,37 +3111,40 @@ var sl = class {
3091
3111
  r(!1);
3092
3112
  return;
3093
3113
  }
3094
- if (this.utterance = new SpeechSynthesisUtterance(e), this.config?.voice) {
3095
- const o = speechSynthesis.getVoices().find((s) => s.name === this.config.voice);
3096
- o && (this.utterance.voice = o);
3097
- }
3098
- this.config?.rate && (this.utterance.rate = this.config.rate), this.config?.pitch && (this.utterance.pitch = this.config.pitch), this.utterance.onstart = () => {
3114
+ const o = new SpeechSynthesisUtterance(e);
3115
+ this.utterance = o;
3116
+ const s = cl(speechSynthesis.getVoices(), this.config?.voice);
3117
+ s && ul(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
3118
+ const a = () => {
3119
+ this.utterance === o && (this.utterance = null);
3120
+ };
3121
+ o.onstart = () => {
3099
3122
  n === this.speakRunId && (this._isPlaying = !0, this._isPaused = !1);
3100
- }, this.utterance.onend = () => {
3101
- if (n !== this.speakRunId) {
3123
+ }, o.onend = () => {
3124
+ if (a(), n !== this.speakRunId) {
3102
3125
  r(!1);
3103
3126
  return;
3104
3127
  }
3105
3128
  this._isPlaying = !1, this._isPaused = !1, r(!0);
3106
- }, this.utterance.onerror = (o) => {
3107
- if (n !== this.speakRunId) {
3129
+ }, o.onerror = (l) => {
3130
+ if (a(), n !== this.speakRunId) {
3108
3131
  r(!1);
3109
3132
  return;
3110
3133
  }
3111
- if (this._isPlaying = !1, this._isPaused = !1, o.error === "interrupted" || o.error === "canceled") {
3134
+ if (this._isPlaying = !1, this._isPaused = !1, l.error === "interrupted" || l.error === "canceled") {
3112
3135
  r(!1);
3113
3136
  return;
3114
3137
  }
3115
- i(/* @__PURE__ */ new Error(`Speech synthesis error: ${o.error}`));
3116
- }, this.utterance.onpause = () => {
3138
+ i(/* @__PURE__ */ new Error(`Speech synthesis error: ${l.error}`));
3139
+ }, o.onpause = () => {
3117
3140
  n === this.speakRunId && (this._isPaused = !0);
3118
- }, this.utterance.onresume = () => {
3141
+ }, o.onresume = () => {
3119
3142
  n === this.speakRunId && (this._isPaused = !1);
3120
- }, this.utterance.onboundary = (o) => {
3121
- if (n !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", o.name, "charIndex:", o.charIndex, "charLength:", o.charLength), o.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence") return;
3122
- const s = Math.max(0, Math.min(o.charIndex, Math.max(0, e.length - 1))), a = Number(o.charLength || 0), l = this.inferWordLength(e, s), c = Number.isFinite(a) && a > 0 && a <= 80 && s + a <= e.length ? a : l, u = e.substring(s, Math.min(e.length, s + c)).trim(), h = t + s;
3123
- console.log("[BrowserProvider] Calling onWordBoundary with word:", u, "at position:", h), this.onWordBoundary(u, h, c);
3124
- }, speechSynthesis.speak(this.utterance);
3143
+ }, o.onboundary = (l) => {
3144
+ if (n !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", l.name, "charIndex:", l.charIndex, "charLength:", l.charLength), l.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence") return;
3145
+ const c = Math.max(0, Math.min(l.charIndex, Math.max(0, e.length - 1))), u = Number(l.charLength || 0), h = this.inferWordLength(e, c), f = Number.isFinite(u) && u > 0 && u <= 80 && c + u <= e.length ? u : h, g = e.substring(c, Math.min(e.length, c + f)).trim(), m = t + c;
3146
+ console.log("[BrowserProvider] Calling onWordBoundary with word:", g, "at position:", m), this.onWordBoundary(g, m, f);
3147
+ }, speechSynthesis.speak(o);
3125
3148
  });
3126
3149
  }
3127
3150
  pause() {
@@ -3131,7 +3154,7 @@ var sl = class {
3131
3154
  this._isPlaying && this._isPaused && speechSynthesis.resume();
3132
3155
  }
3133
3156
  stop() {
3134
- this.speakRunId += 1, this._isPlaying && speechSynthesis.cancel(), this._isPlaying = !1, this._isPaused = !1;
3157
+ this.speakRunId += 1, (this._isPlaying || this.utterance) && speechSynthesis.cancel(), this.utterance = null, this._isPlaying = !1, this._isPaused = !1;
3135
3158
  }
3136
3159
  isPlaying() {
3137
3160
  return this._isPlaying && !this._isPaused;
@@ -3145,7 +3168,7 @@ var sl = class {
3145
3168
  ...e.providerOptions || {}
3146
3169
  });
3147
3170
  }
3148
- }, ll = class {
3171
+ }, dl = class {
3149
3172
  async emitTelemetry(e, t) {
3150
3173
  try {
3151
3174
  await this.config?.onTelemetry?.(e, t);
@@ -3154,7 +3177,7 @@ var sl = class {
3154
3177
  }
3155
3178
  }
3156
3179
  constructor(e = "browser") {
3157
- f(this, "providerId", "tts-service"), f(this, "providerName", "Text-to-Speech"), f(this, "category", "tts"), f(this, "version", "1.0"), f(this, "requiresAuth", void 0), f(this, "ttsProvider", null), f(this, "config", null), this.requiresAuth = e !== "browser";
3180
+ p(this, "providerId", "tts-service"), p(this, "providerName", "Text-to-Speech"), p(this, "category", "tts"), p(this, "version", "1.0"), p(this, "requiresAuth", void 0), p(this, "ttsProvider", null), p(this, "config", null), this.requiresAuth = e !== "browser";
3158
3181
  }
3159
3182
  async initialize(e) {
3160
3183
  if (this.ttsProvider) {
@@ -3177,7 +3200,7 @@ var sl = class {
3177
3200
  }
3178
3201
  async _initializeBrowserTTS(e) {
3179
3202
  if (typeof window > "u" || !("speechSynthesis" in window)) throw new Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");
3180
- this.ttsProvider = new ao(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3203
+ this.ttsProvider = new lo(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3181
3204
  }
3182
3205
  async _initializeServerTTS(e) {
3183
3206
  if (!e.apiEndpoint) throw new Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");
@@ -3235,7 +3258,7 @@ var sl = class {
3235
3258
  destroy() {
3236
3259
  this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
3237
3260
  }
3238
- }, cl = /* @__PURE__ */ new Set([
3261
+ }, fl = /* @__PURE__ */ new Set([
3239
3262
  "annotation-xml",
3240
3263
  "color-profile",
3241
3264
  "font-face",
@@ -3244,16 +3267,16 @@ var sl = class {
3244
3267
  "font-face-format",
3245
3268
  "font-face-name",
3246
3269
  "missing-glyph"
3247
- ]), ul = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, hl = (e, t = "custom element tag") => {
3270
+ ]), pl = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, gl = (e, t = "custom element tag") => {
3248
3271
  if (!e || typeof e != "string") throw new Error(`Invalid ${t}: expected a non-empty string`);
3249
3272
  const n = e.trim();
3250
3273
  if (!n) throw new Error(`Invalid ${t}: tag is empty`);
3251
3274
  if (n !== n.toLowerCase()) throw new Error(`Invalid ${t} "${n}": custom element names must be lowercase`);
3252
3275
  if (!n.includes("-")) throw new Error(`Invalid ${t} "${n}": custom element names must include a hyphen`);
3253
- if (cl.has(n)) throw new Error(`Invalid ${t} "${n}": this name is reserved by the HTML spec`);
3254
- if (!ul.test(n)) throw new Error(`Invalid ${t} "${n}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3276
+ if (fl.has(n)) throw new Error(`Invalid ${t} "${n}": this name is reserved by the HTML spec`);
3277
+ if (!pl.test(n)) throw new Error(`Invalid ${t} "${n}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3255
3278
  return n;
3256
- }, lo = {
3279
+ }, co = {
3257
3280
  calculator: "pie-tool-calculator",
3258
3281
  textToSpeech: "pie-tool-text-to-speech",
3259
3282
  ruler: "pie-tool-ruler",
@@ -3265,21 +3288,21 @@ var sl = class {
3265
3288
  annotationToolbar: "pie-tool-annotation-toolbar",
3266
3289
  graph: "pie-tool-graph",
3267
3290
  periodicTable: "pie-tool-periodic-table"
3268
- }, dl = (e, t) => hl(t?.toolTagMap?.[e] ?? lo[e] ?? e, `tool component tag for "${e}"`), fl = (e) => document.createElement(e), fe = (e, t, n, r) => {
3269
- const i = dl(e, r), o = r?.toolComponentFactories?.[e] ?? r?.toolComponentFactory;
3291
+ }, ml = (e, t) => gl(t?.toolTagMap?.[e] ?? co[e] ?? e, `tool component tag for "${e}"`), vl = (e) => document.createElement(e), fe = (e, t, n, r) => {
3292
+ const i = ml(e, r), o = r?.toolComponentFactories?.[e] ?? r?.toolComponentFactory;
3270
3293
  return o ? o({
3271
3294
  toolId: e,
3272
3295
  tagName: i,
3273
3296
  context: t,
3274
3297
  toolbarContext: n
3275
- }) : fl(i);
3298
+ }) : vl(i);
3276
3299
  }, Hn = /* @__PURE__ */ new WeakMap();
3277
- function pl(e, t) {
3300
+ function yl(e, t) {
3278
3301
  if (!e) return null;
3279
3302
  const n = Hn.get(e), r = n?.get(t);
3280
3303
  return r ? r.isConnected ? r : (n?.delete(t), null) : null;
3281
3304
  }
3282
- function gl(e, t, n) {
3305
+ function bl(e, t, n) {
3283
3306
  if (!e) return;
3284
3307
  let r = Hn.get(e);
3285
3308
  r || (r = /* @__PURE__ */ new Map(), Hn.set(e, r)), r.set(t, n);
@@ -3287,7 +3310,7 @@ function gl(e, t, n) {
3287
3310
  function Pr(e) {
3288
3311
  return e === "basic" || e === "scientific" ? e : null;
3289
3312
  }
3290
- function ml(e) {
3313
+ function Tl(e) {
3291
3314
  const t = e.getToolRenderParams?.("calculator") ?? {}, n = Pr(t.calculatorType), r = t.availableTypes;
3292
3315
  return {
3293
3316
  calculatorType: n,
@@ -3299,14 +3322,14 @@ function Nr(e, t, n) {
3299
3322
  const r = e;
3300
3323
  t ? (r.calculatorType = t, e.setAttribute("calculator-type", t)) : (delete r.calculatorType, e.removeAttribute("calculator-type")), n && n.length > 0 ? r.availableTypes = n : delete r.availableTypes;
3301
3324
  }
3302
- var vl = {
3325
+ var Sl = {
3303
3326
  toolId: "calculator",
3304
3327
  name: "Calculator",
3305
3328
  description: "Multi-type calculator (basic, scientific, graphing)",
3306
3329
  icon: "calculator",
3307
3330
  provider: {
3308
3331
  getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
3309
- createProvider: () => new sl(),
3332
+ createProvider: () => new al(),
3310
3333
  getInitConfig: (e) => e?.provider?.init ?? {},
3311
3334
  getAuthFetcher: (e) => {
3312
3335
  const t = e?.provider?.runtime?.authFetcher;
@@ -3332,8 +3355,8 @@ var vl = {
3332
3355
  return fn(e);
3333
3356
  },
3334
3357
  renderToolbar(e, t) {
3335
- const { calculatorType: n, availableTypes: r, displayName: i } = ml(t), o = ar(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = pl(t.toolCoordinator, o), l = a ?? fe(this.toolId, e, t, s);
3336
- a || gl(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Nr(l, n, r);
3358
+ const { calculatorType: n, availableTypes: r, displayName: i } = Tl(t), o = ar(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = yl(t.toolCoordinator, o), l = a ?? fe(this.toolId, e, t, s);
3359
+ a || bl(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Nr(l, n, r);
3337
3360
  const c = n === null ? "Open scientific calculator" : `Open ${i.toLowerCase()}`, u = n === null ? "Close scientific calculator" : `Close ${i.toLowerCase()}`, h = {
3338
3361
  toolId: this.toolId,
3339
3362
  label: i,
@@ -3344,7 +3367,7 @@ var vl = {
3344
3367
  onClick: () => t.toggleTool(this.toolId),
3345
3368
  active: t.isToolVisible(o)
3346
3369
  };
3347
- let p = h.active;
3370
+ let f = h.active;
3348
3371
  return l.visible !== h.active && (l.visible = h.active), {
3349
3372
  toolId: this.toolId,
3350
3373
  elements: [{
@@ -3366,7 +3389,7 @@ var vl = {
3366
3389
  button: h,
3367
3390
  sync: () => {
3368
3391
  const g = t.isToolVisible(o);
3369
- h.active = g, h.label = i, h.ariaLabel = g ? u : c, h.tooltip = g ? `Close ${i.toLowerCase()}` : i, p !== g && (l.visible = g, p = g), l.toolkitCoordinator !== t.toolkitCoordinator && (l.toolkitCoordinator = t.toolkitCoordinator), Nr(l, n, r);
3392
+ h.active = g, h.label = i, h.ariaLabel = g ? u : c, h.tooltip = g ? `Close ${i.toLowerCase()}` : i, f !== g && (l.visible = g, f = g), l.toolkitCoordinator !== t.toolkitCoordinator && (l.toolkitCoordinator = t.toolkitCoordinator), Nr(l, n, r);
3370
3393
  },
3371
3394
  subscribeActive: (g) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3372
3395
  g(t.isToolVisible(o));
@@ -3374,7 +3397,7 @@ var vl = {
3374
3397
  }
3375
3398
  };
3376
3399
  }
3377
- }, $ = (e) => e.trim().replace(/\s+/g, " "), co = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, uo = (e) => {
3400
+ }, $ = (e) => e.trim().replace(/\s+/g, " "), uo = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, ho = (e) => {
3378
3401
  if (e.hidden || e.tagName?.toLowerCase() === "mjx-assistive-mml" || e.getAttribute("aria-hidden") === "true" || e.hasAttribute("inert")) return !0;
3379
3402
  const t = e.classList;
3380
3403
  if (t?.contains("sr-only") || t?.contains("pie-sr-only") || t?.contains("visually-hidden")) return !0;
@@ -3388,12 +3411,12 @@ var vl = {
3388
3411
  }, ft = (e, t) => {
3389
3412
  let n = e.nodeType === 1 ? e : e.parentElement;
3390
3413
  for (; n; ) {
3391
- if (uo(n)) return !0;
3414
+ if (ho(n)) return !0;
3392
3415
  if (t && n === t) break;
3393
3416
  n = n.parentElement;
3394
3417
  }
3395
3418
  return !1;
3396
- }, ho = (e, t, n) => {
3419
+ }, fo = (e, t, n) => {
3397
3420
  if (!e || !t || /\s/.test(e) || /\s/.test(t)) return !1;
3398
3421
  const r = n?.boundarySpacingMode ?? "segmenterPreferred";
3399
3422
  if (r === "none") return !1;
@@ -3418,29 +3441,29 @@ var vl = {
3418
3441
  const c = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
3419
3442
  let u = c.nextNode();
3420
3443
  for (; u; ) {
3421
- const p = u;
3422
- if (p.parentElement && !ft(p, e)) {
3423
- const g = p.textContent || "", m = g.match(/\S/), v = m ? m[0] : null;
3424
- !o && !s && ho(l, v, t) && (r.push(" "), a && n.set(i, a), i++, s = !0);
3444
+ const f = u;
3445
+ if (f.parentElement && !ft(f, e)) {
3446
+ const g = f.textContent || "", m = g.match(/\S/), v = m ? m[0] : null;
3447
+ !o && !s && fo(l, v, t) && (r.push(" "), a && n.set(i, a), i++, s = !0);
3425
3448
  for (let y = 0; y < g.length; y++) {
3426
3449
  const S = g[y], O = /\s/.test(S);
3427
3450
  o ? O || (o = !1, r.push(S), n.set(i, {
3428
- node: p,
3451
+ node: f,
3429
3452
  offset: y
3430
3453
  }), a = {
3431
- node: p,
3454
+ node: f,
3432
3455
  offset: y
3433
3456
  }, i++, s = !1, l = S) : O ? (s || (r.push(" "), n.set(i, {
3434
- node: p,
3457
+ node: f,
3435
3458
  offset: y
3436
3459
  }), a = {
3437
- node: p,
3460
+ node: f,
3438
3461
  offset: y
3439
3462
  }, i++), s = !0) : (r.push(S), n.set(i, {
3440
- node: p,
3463
+ node: f,
3441
3464
  offset: y
3442
3465
  }), a = {
3443
- node: p,
3466
+ node: f,
3444
3467
  offset: y
3445
3468
  }, i++, s = !1, l = S);
3446
3469
  }
@@ -3453,11 +3476,11 @@ var vl = {
3453
3476
  text: h,
3454
3477
  map: n
3455
3478
  };
3456
- }, _n = null, Hr = Promise.resolve(), yl = (e) => (e || "en").split("-")[0].toLowerCase() || "en", bl = async () => (_n || (_n = import("./sre-Dddi65jB.js").then((e) => /* @__PURE__ */ Qo(e.default, 1)).then((e) => {
3479
+ }, _n = null, Hr = Promise.resolve(), _l = (e) => (e || "en").split("-")[0].toLowerCase() || "en", wl = async () => (_n || (_n = import("./sre-Dddi65jB.js").then((e) => /* @__PURE__ */ Zo(e.default, 1)).then((e) => {
3457
3480
  const t = e.default || e;
3458
3481
  if (!t || typeof t.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
3459
3482
  return t;
3460
- })), _n), Tl = (e) => e === "en" ? "clearspeak" : "mathspeak", Br = (e) => !!e && typeof e == "object" && !Array.isArray(e), zr = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, gn = (e) => {
3483
+ })), _n), kl = (e) => e === "en" ? "clearspeak" : "mathspeak", Br = (e) => !!e && typeof e == "object" && !Array.isArray(e), zr = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, gn = (e) => {
3461
3484
  if (!Br(e)) return;
3462
3485
  const t = zr(e.domain), n = zr(e.style), r = Br(e.engineOptions) ? e.engineOptions : void 0;
3463
3486
  if (!(!t && !n && !r))
@@ -3466,36 +3489,36 @@ var vl = {
3466
3489
  ...n ? { style: n } : {},
3467
3490
  ...r ? { engineOptions: r } : {}
3468
3491
  };
3469
- }, Sl = async (e, t, n, r) => {
3470
- const i = yl(t), o = gn(r);
3492
+ }, El = async (e, t, n, r) => {
3493
+ const i = _l(t), o = gn(r);
3471
3494
  await e.setupEngine?.({
3472
3495
  ...o?.engineOptions || {},
3473
3496
  locale: i,
3474
- domain: o?.domain || Tl(i),
3497
+ domain: o?.domain || kl(i),
3475
3498
  ...o?.style ? { style: o.style } : {},
3476
3499
  modality: "speech",
3477
3500
  markup: n
3478
3501
  }), await e.engineReady?.();
3479
- }, _l = async (e) => {
3502
+ }, Al = async (e) => {
3480
3503
  const t = Hr.then(e, e);
3481
3504
  return Hr = t.then(() => {
3482
3505
  }, () => {
3483
3506
  }), t;
3484
- }, fo = async (e, t, n, r, i) => _l(async () => (await Sl(e, n, r, i), e.toSpeech(t))), wl = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), kl = async (e, t, n, r) => {
3507
+ }, po = async (e, t, n, r, i) => Al(async () => (await El(e, n, r, i), e.toSpeech(t))), Cl = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), xl = async (e, t, n, r) => {
3485
3508
  try {
3486
- const i = wl(await fo(e, t, n, "ssml", r));
3509
+ const i = Cl(await po(e, t, n, "ssml", r));
3487
3510
  return i.includes("<speak") ? i : null;
3488
3511
  } catch (i) {
3489
3512
  return console.debug("[TTSService] Math SSML generation failed; using plain", { message: i instanceof Error ? i.message : String(i) }), null;
3490
3513
  }
3491
- }, po = async (e, t = {}) => {
3514
+ }, go = async (e, t = {}) => {
3492
3515
  if (!e.some((c) => c.type === "math")) return {
3493
3516
  speechText: $(e.map((c) => c.type === "text" ? c.text : c.fallbackText).join(" ")),
3494
3517
  usedMathSpeech: !1,
3495
3518
  usedFallback: !1
3496
3519
  };
3497
3520
  let n = null, r = !1, i = !1;
3498
- const o = t.loadSre || bl, s = [];
3521
+ const o = t.loadSre || wl, s = [];
3499
3522
  for (const c of e) {
3500
3523
  if (c.type === "text") {
3501
3524
  s.push(c.text);
@@ -3503,7 +3526,7 @@ var vl = {
3503
3526
  }
3504
3527
  try {
3505
3528
  n || (n = await o());
3506
- const u = $(await fo(n, c.mathml, t.language, "none", t.mathSpeech));
3529
+ const u = $(await po(n, c.mathml, t.language, "none", t.mathSpeech));
3507
3530
  if (u) {
3508
3531
  s.push(u), r = !0;
3509
3532
  continue;
@@ -3515,18 +3538,18 @@ var vl = {
3515
3538
  }
3516
3539
  const a = $(s.join(" "));
3517
3540
  let l;
3518
- return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await kl(n, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
3541
+ return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await xl(n, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
3519
3542
  speechText: a,
3520
3543
  usedMathSpeech: r,
3521
3544
  usedFallback: i,
3522
3545
  ssml: l
3523
3546
  };
3524
- }, El = /* @__PURE__ */ new Set([
3547
+ }, Il = /* @__PURE__ */ new Set([
3525
3548
  "reserved-row",
3526
3549
  "expanding-row",
3527
3550
  "floating-overlay",
3528
3551
  "left-aligned"
3529
- ]), Wr = (e) => e && typeof e == "object" ? e : {}, Al = (e) => e === "polly" || e === "google" || e === "server", X = (e, t) => e === void 0 ? t : e, sn = (e, t = "left-aligned") => typeof e == "string" && El.has(e) ? e : t, Fr = Object.freeze([0.8, 1.25]), wn = (e) => {
3552
+ ]), Wr = (e) => e && typeof e == "object" ? e : {}, Ol = (e) => e === "polly" || e === "google" || e === "server", X = (e, t) => e === void 0 ? t : e, sn = (e, t = "left-aligned") => typeof e == "string" && Il.has(e) ? e : t, Fr = Object.freeze([0.8, 1.25]), wn = (e) => {
3530
3553
  if (!Array.isArray(e)) return [...Fr];
3531
3554
  if (e.length === 0) return [];
3532
3555
  const t = /* @__PURE__ */ new Set();
@@ -3536,12 +3559,12 @@ var vl = {
3536
3559
  r !== 1 && t.add(r);
3537
3560
  }
3538
3561
  return t.size ? Array.from(t) : [...Fr];
3539
- }, Cl = (e) => {
3562
+ }, Ml = (e) => {
3540
3563
  const t = {
3541
3564
  ...e,
3542
3565
  layoutMode: sn(e.layoutMode)
3543
3566
  }, n = e.backend || "browser";
3544
- if (!Al(n)) return t;
3567
+ if (!Ol(n)) return t;
3545
3568
  const r = {
3546
3569
  ...t,
3547
3570
  apiEndpoint: X(t.apiEndpoint, "/api/tts"),
@@ -3564,12 +3587,12 @@ var vl = {
3564
3587
  } : r;
3565
3588
  }, kn = (e) => {
3566
3589
  const t = Wr(e), n = Wr(t.settings);
3567
- return Cl({
3590
+ return Ml({
3568
3591
  ...t,
3569
3592
  ...n
3570
3593
  });
3571
- }, Bn = (e) => e.backend || "browser", go = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, mo = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), xl = (e) => {
3572
- const t = Bn(e), n = go(e, t), r = mo(e, n), i = gn(e.mathSpeech);
3594
+ }, Bn = (e) => e.backend || "browser", mo = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, vo = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), Ll = (e) => {
3595
+ const t = Bn(e), n = mo(e, t), r = vo(e, n), i = gn(e.mathSpeech);
3573
3596
  return {
3574
3597
  voice: e.defaultVoice,
3575
3598
  rate: e.rate,
@@ -3595,8 +3618,8 @@ var vl = {
3595
3618
  validateEndpoint: e.validateEndpoint,
3596
3619
  ...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
3597
3620
  };
3598
- }, vo = (e) => sn(e.layoutMode), Il = (e) => {
3599
- switch (vo(e)) {
3621
+ }, yo = (e) => sn(e.layoutMode), Rl = (e) => {
3622
+ switch (yo(e)) {
3600
3623
  case "reserved-row":
3601
3624
  return {
3602
3625
  mount: "before-buttons",
@@ -3622,21 +3645,21 @@ var vl = {
3622
3645
  }
3623
3646
  };
3624
3647
  }
3625
- }, gt = /* @__PURE__ */ new Map(), Ol = "__pieToolElementUnmount", Dr = "pie-tool-active-change", Ml = {
3648
+ }, gt = /* @__PURE__ */ new Map(), $l = "__pieToolElementUnmount", Dr = "pie-tool-active-change", Pl = {
3626
3649
  toolId: "textToSpeech",
3627
3650
  name: "Text to Speech",
3628
3651
  description: "Read content aloud",
3629
3652
  icon: "volume-up",
3630
3653
  provider: {
3631
3654
  getProviderId: () => "tts",
3632
- createProvider: (e) => new ll(Bn(kn(e))),
3655
+ createProvider: (e) => new dl(Bn(kn(e))),
3633
3656
  getInitConfig: (e) => {
3634
- const t = kn(e), n = Bn(t), r = go(t, n);
3657
+ const t = kn(e), n = Bn(t), r = mo(t, n);
3635
3658
  return {
3636
3659
  backend: n,
3637
3660
  serverProvider: r,
3638
- transportMode: mo(t, r),
3639
- ...xl(t)
3661
+ transportMode: vo(t, r),
3662
+ ...Ll(t)
3640
3663
  };
3641
3664
  },
3642
3665
  getAuthFetcher: (e) => {
@@ -3662,12 +3685,12 @@ var vl = {
3662
3685
  return pn(e);
3663
3686
  },
3664
3687
  renderToolbar(e, t) {
3665
- const n = () => kn(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => wn(n().speedOptions), i = () => vo(n()), o = () => Il(n()), s = ar(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
3688
+ const n = () => kn(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => wn(n().speedOptions), i = () => yo(n()), o = () => Rl(n()), s = ar(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
3666
3689
  const u = t.ui?.size;
3667
3690
  return u === "sm" || u === "lg" ? u : "md";
3668
3691
  }, l = () => {
3669
3692
  let u = gt.get(s);
3670
- return u && typeof u.isConnected == "boolean" && !u.isConnected && (gt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[Ol] = () => {
3693
+ return u && typeof u.isConnected == "boolean" && !u.isConnected && (gt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[$l] = () => {
3671
3694
  gt.get(s) === u && gt.delete(s);
3672
3695
  }, gt.set(s, u)), u.setAttribute("tool-id", s), u.setAttribute("catalog-id", t.catalogId || t.itemId), u.setAttribute("language", t.language || "en-US"), u.setAttribute("size", a()), u.setAttribute("layout-mode", i()), u.speedOptions = r(), u;
3673
3696
  }, c = o();
@@ -3683,12 +3706,12 @@ var vl = {
3683
3706
  } }
3684
3707
  }],
3685
3708
  subscribeActive: (u) => {
3686
- const h = l(), p = (g) => {
3709
+ const h = l(), f = (g) => {
3687
3710
  const m = g.detail;
3688
3711
  u(m?.active === !0);
3689
3712
  };
3690
- return h.addEventListener(Dr, p), () => {
3691
- h.removeEventListener(Dr, p);
3713
+ return h.addEventListener(Dr, f), () => {
3714
+ h.removeEventListener(Dr, f);
3692
3715
  };
3693
3716
  },
3694
3717
  sync: () => {
@@ -3716,7 +3739,7 @@ function Se(e) {
3716
3739
  function cr(e, t) {
3717
3740
  e.setAttribute("data-pie-tool-surface", t);
3718
3741
  }
3719
- var Ll = {
3742
+ var Nl = {
3720
3743
  toolId: "ruler",
3721
3744
  name: "Ruler",
3722
3745
  description: "On-screen ruler for measurements",
@@ -3758,7 +3781,7 @@ var Ll = {
3758
3781
  subscribeActive: n.subscribeActive
3759
3782
  };
3760
3783
  }
3761
- }, Rl = {
3784
+ }, Hl = {
3762
3785
  toolId: "protractor",
3763
3786
  name: "Protractor",
3764
3787
  description: "On-screen protractor for angle measurements",
@@ -3800,7 +3823,7 @@ var Ll = {
3800
3823
  subscribeActive: n.subscribeActive
3801
3824
  };
3802
3825
  }
3803
- }, $l = {
3826
+ }, Bl = {
3804
3827
  toolId: "answerEliminator",
3805
3828
  name: "Answer Eliminator",
3806
3829
  description: "Strike through answer choices",
@@ -3813,7 +3836,7 @@ var Ll = {
3813
3836
  "choiceMasking"
3814
3837
  ],
3815
3838
  isVisibleInContext(e) {
3816
- return tl(e);
3839
+ return nl(e);
3817
3840
  },
3818
3841
  renderToolbar(e, t) {
3819
3842
  const n = Te(this.toolId, t), r = t.componentOverrides ?? {}, i = fe(this.toolId, e, t, r);
@@ -3847,7 +3870,7 @@ var Ll = {
3847
3870
  subscribeActive: n.subscribeActive
3848
3871
  };
3849
3872
  }
3850
- }, Pl = {
3873
+ }, zl = {
3851
3874
  toolId: "highlighter",
3852
3875
  name: "Highlighter",
3853
3876
  description: "Highlight text",
@@ -3898,7 +3921,7 @@ var Ll = {
3898
3921
  subscribeActive: n.subscribeActive
3899
3922
  };
3900
3923
  }
3901
- }, Nl = {
3924
+ }, Wl = {
3902
3925
  toolId: "lineReader",
3903
3926
  name: "Line Reader",
3904
3927
  description: "Reading guide overlay",
@@ -3947,7 +3970,7 @@ var Ll = {
3947
3970
  subscribeActive: n.subscribeActive
3948
3971
  };
3949
3972
  }
3950
- }, Hl = {
3973
+ }, Fl = {
3951
3974
  toolId: "theme",
3952
3975
  name: "Theme",
3953
3976
  description: "Accessible themes and contrast",
@@ -4002,7 +4025,7 @@ var Ll = {
4002
4025
  subscribeActive: n.subscribeActive
4003
4026
  };
4004
4027
  }
4005
- }, Bl = {
4028
+ }, Dl = {
4006
4029
  toolId: "annotationToolbar",
4007
4030
  name: "Highlighter",
4008
4031
  description: "Highlight and annotate text",
@@ -4053,7 +4076,7 @@ var Ll = {
4053
4076
  subscribeActive: n.subscribeActive
4054
4077
  };
4055
4078
  }
4056
- }, zl = {
4079
+ }, jl = {
4057
4080
  toolId: "graph",
4058
4081
  name: "Graph",
4059
4082
  description: "Graphing calculator and coordinate plane",
@@ -4106,7 +4129,7 @@ var Ll = {
4106
4129
  subscribeActive: n.subscribeActive
4107
4130
  };
4108
4131
  }
4109
- }, Wl = {
4132
+ }, ql = {
4110
4133
  toolId: "periodicTable",
4111
4134
  name: "Periodic Table",
4112
4135
  description: "Chemistry periodic table reference",
@@ -4118,7 +4141,7 @@ var Ll = {
4118
4141
  "elementReference"
4119
4142
  ],
4120
4143
  isVisibleInContext(e) {
4121
- return nl(e);
4144
+ return rl(e);
4122
4145
  },
4123
4146
  renderToolbar(e, t) {
4124
4147
  const n = Te(this.toolId, t), r = {
@@ -4158,54 +4181,54 @@ var Ll = {
4158
4181
  subscribeActive: n.subscribeActive
4159
4182
  };
4160
4183
  }
4161
- }, Fl = [
4162
- vl,
4163
- Ml,
4164
- Ll,
4165
- Rl,
4166
- $l,
4184
+ }, Vl = [
4185
+ Sl,
4167
4186
  Pl,
4168
4187
  Nl,
4169
4188
  Hl,
4170
4189
  Bl,
4171
4190
  zl,
4172
- Wl
4191
+ Wl,
4192
+ Fl,
4193
+ Dl,
4194
+ jl,
4195
+ ql
4173
4196
  ];
4174
- function Dl(e = {}) {
4175
- const t = new Qa(), n = {
4197
+ function Gl(e = {}) {
4198
+ const t = new Za(), n = {
4176
4199
  toolTagMap: {
4177
- ...lo,
4200
+ ...co,
4178
4201
  ...e.toolTagMap || {}
4179
4202
  },
4180
4203
  toolComponentFactory: e.toolComponentFactory,
4181
4204
  toolComponentFactories: e.toolComponentFactories
4182
4205
  }, r = (i) => e.overrides?.[i.toolId] || i;
4183
- return e.includePackagedTools && jl(t, {
4206
+ return e.includePackagedTools && Ul(t, {
4184
4207
  toolIds: e.toolIds,
4185
4208
  applyOverrides: r
4186
4209
  }), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(n), t;
4187
4210
  }
4188
- function jl(e, t = {}) {
4211
+ function Ul(e, t = {}) {
4189
4212
  const n = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, r = t.applyOverrides || ((i) => i);
4190
- for (const i of Fl)
4213
+ for (const i of Vl)
4191
4214
  n && !n.has(i.toolId) || e.register(r(i));
4192
4215
  }
4193
- function ql(e = {}) {
4194
- return Dl({
4216
+ function Kl(e = {}) {
4217
+ return Gl({
4195
4218
  ...e,
4196
4219
  includePackagedTools: !0
4197
4220
  });
4198
4221
  }
4199
- function Vl() {
4200
- const e = ql(), t = /* @__PURE__ */ new Set();
4222
+ function Xl() {
4223
+ const e = Kl(), t = /* @__PURE__ */ new Set();
4201
4224
  for (const n of e.getAllTools()) for (const r of n.pnpSupportIds || []) t.add(r);
4202
4225
  return [...t].sort();
4203
4226
  }
4204
- var Gl = Vl(), ih = {
4205
- supports: [...Gl],
4227
+ var Yl = Xl(), lh = {
4228
+ supports: [...Yl],
4206
4229
  prohibitedSupports: [],
4207
4230
  activateAtInit: []
4208
- }, Ul = {
4231
+ }, Jl = {
4209
4232
  visual: {
4210
4233
  magnification: "magnification",
4211
4234
  screenMagnifier: "screenMagnifier",
@@ -4318,11 +4341,11 @@ var Gl = Vl(), ih = {
4318
4341
  itemGlossary: "itemGlossary",
4319
4342
  tutorialAvailable: "tutorialAvailable"
4320
4343
  }
4321
- }, oh = Object.values(Ul).flatMap((e) => Object.values(e)), sh = ro("ToolCoordinator"), zn;
4344
+ }, ch = Object.values(Jl).flatMap((e) => Object.values(e)), uh = ro("ToolCoordinator"), zn;
4322
4345
  (function(e) {
4323
4346
  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";
4324
4347
  })(zn || (zn = {}));
4325
- var Kl = /* @__PURE__ */ new Set([
4348
+ var Ql = /* @__PURE__ */ new Set([
4326
4349
  "speak",
4327
4350
  "p",
4328
4351
  "s",
@@ -4331,20 +4354,20 @@ var Kl = /* @__PURE__ */ new Set([
4331
4354
  "say-as",
4332
4355
  "voice",
4333
4356
  "lang"
4334
- ]), jr = /* @__PURE__ */ new Set(["audio", "phoneme"]), yo = (e) => e.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&#160;/g, " ").replace(/&amp;/g, "&"), jt = (e, t, n) => {
4357
+ ]), jr = /* @__PURE__ */ new Set(["audio", "phoneme"]), bo = (e) => e.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&#160;/g, " ").replace(/&amp;/g, "&"), jt = (e, t, n) => {
4335
4358
  for (let r = 0; r < t.length; r++) e.push({
4336
4359
  char: t[r],
4337
4360
  rawOffset: n === null ? null : n + r
4338
4361
  });
4339
- }, Xl = (e, t, n) => {
4362
+ }, Zl = (e, t, n) => {
4340
4363
  const r = t.slice(n).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
4341
- return r ? (jt(e, yo(r[0]), n), r[0].length) : 0;
4364
+ return r ? (jt(e, bo(r[0]), n), r[0].length) : 0;
4342
4365
  }, qr = (e) => {
4343
4366
  e.push({
4344
4367
  char: " ",
4345
4368
  rawOffset: null
4346
4369
  });
4347
- }, Yl = (e) => {
4370
+ }, ec = (e) => {
4348
4371
  const t = /* @__PURE__ */ new Map(), n = [];
4349
4372
  let r = !0;
4350
4373
  for (const i of e) {
@@ -4360,19 +4383,19 @@ var Kl = /* @__PURE__ */ new Set([
4360
4383
  text: n.join(""),
4361
4384
  rawToSpokenOffsetMap: t
4362
4385
  };
4363
- }, Jl = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", Ql = (e, t) => {
4386
+ }, tc = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", nc = (e, t) => {
4364
4387
  const n = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), r = e.match(n);
4365
- return yo(r?.[2] ?? r?.[3] ?? "") || null;
4366
- }, bo = (e) => {
4388
+ return bo(r?.[2] ?? r?.[3] ?? "") || null;
4389
+ }, To = (e) => {
4367
4390
  const t = [];
4368
4391
  let n = !1, r = !1, i = 0;
4369
4392
  for (; i < e.length; ) {
4370
4393
  const s = e[i];
4371
4394
  if (s !== "<") {
4372
4395
  if (s === "&") {
4373
- const p = Xl(t, e, i);
4374
- if (p > 0) {
4375
- i += p;
4396
+ const f = Zl(t, e, i);
4397
+ if (f > 0) {
4398
+ i += f;
4376
4399
  continue;
4377
4400
  }
4378
4401
  }
@@ -4385,14 +4408,14 @@ var Kl = /* @__PURE__ */ new Set([
4385
4408
  continue;
4386
4409
  }
4387
4410
  r = !0;
4388
- const l = e.slice(i, a + 1), c = Jl(l), u = /^<\s*\//.test(l), h = /\/\s*>$/.test(l);
4411
+ const l = e.slice(i, a + 1), c = tc(l), u = /^<\s*\//.test(l), h = /\/\s*>$/.test(l);
4389
4412
  if (!u && c === "sub") {
4390
- const p = Ql(l, "alias");
4391
- if (!p) {
4413
+ const f = nc(l, "alias");
4414
+ if (!f) {
4392
4415
  n = !0, i = a + 1;
4393
4416
  continue;
4394
4417
  }
4395
- jt(t, p, null);
4418
+ jt(t, f, null);
4396
4419
  const g = e.toLowerCase().indexOf("</sub>", a + 1);
4397
4420
  i = g >= 0 ? g + 6 : a + 1;
4398
4421
  continue;
@@ -4405,16 +4428,16 @@ var Kl = /* @__PURE__ */ new Set([
4405
4428
  i = a + 1;
4406
4429
  continue;
4407
4430
  }
4408
- c && !Kl.has(c) && !jr.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && qr(t), i = a + 1;
4431
+ c && !Ql.has(c) && !jr.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && qr(t), i = a + 1;
4409
4432
  }
4410
- const o = Yl(t);
4433
+ const o = ec(t);
4411
4434
  return {
4412
4435
  spokenText: $(o.text),
4413
4436
  rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
4414
4437
  unsupportedSemantic: n,
4415
4438
  hasMarkup: r
4416
4439
  };
4417
- }, Zl = co(), To = /* @__PURE__ */ new Map([
4440
+ }, rc = uo(), So = /* @__PURE__ */ new Map([
4418
4441
  ["zero", "0"],
4419
4442
  ["one", "1"],
4420
4443
  ["two", "2"],
@@ -4426,7 +4449,7 @@ var Kl = /* @__PURE__ */ new Set([
4426
4449
  ["eight", "8"],
4427
4450
  ["nine", "9"],
4428
4451
  ["ten", "10"]
4429
- ]), ec = [
4452
+ ]), ic = [
4430
4453
  {
4431
4454
  phrase: [
4432
4455
  "plus",
@@ -4503,7 +4526,7 @@ var Kl = /* @__PURE__ */ new Set([
4503
4526
  }
4504
4527
  ], Wn = (e) => {
4505
4528
  const t = [];
4506
- for (const n of e.matchAll(Zl)) {
4529
+ for (const n of e.matchAll(rc)) {
4507
4530
  const r = n[0], i = n.index ?? 0;
4508
4531
  t.push({
4509
4532
  text: r,
@@ -4513,7 +4536,7 @@ var Kl = /* @__PURE__ */ new Set([
4513
4536
  });
4514
4537
  }
4515
4538
  return t;
4516
- }, Fn = (e) => To.get(e.normalized) || e.normalized, tc = (e, t) => {
4539
+ }, Fn = (e) => So.get(e.normalized) || e.normalized, oc = (e, t) => {
4517
4540
  const n = [];
4518
4541
  for (let r = 0; r < e.length; r++) {
4519
4542
  for (let i = 0; i < t.length; i++) Fn(e[r]) === Fn(t[i]) && n.push({
@@ -4522,7 +4545,7 @@ var Kl = /* @__PURE__ */ new Set([
4522
4545
  visibleToken: i,
4523
4546
  score: 10
4524
4547
  });
4525
- for (const i of ec) {
4548
+ for (const i of ic) {
4526
4549
  const o = e.slice(r, r + i.phrase.length);
4527
4550
  if (o.length === i.phrase.length && o.every((s, a) => s.normalized === i.phrase[a]))
4528
4551
  for (let s = 0; s < t.length; s++)
@@ -4535,15 +4558,15 @@ var Kl = /* @__PURE__ */ new Set([
4535
4558
  }
4536
4559
  }
4537
4560
  return n;
4538
- }, nc = (e, t) => {
4539
- const n = tc(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), r = new Array(n.length).fill(0), i = new Array(n.length).fill(-1);
4561
+ }, sc = (e, t) => {
4562
+ const n = oc(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), r = new Array(n.length).fill(0), i = new Array(n.length).fill(-1);
4540
4563
  for (let l = 0; l < n.length; l++) {
4541
4564
  const c = n[l];
4542
4565
  r[l] = c.score;
4543
4566
  for (let u = 0; u < l; u++) {
4544
4567
  const h = n[u];
4545
4568
  if (h.spokenEndToken <= c.spokenStartToken && h.visibleToken < c.visibleToken) {
4546
- const p = c.spokenStartToken - h.spokenEndToken, g = c.visibleToken - h.visibleToken - 1, m = Math.max(0, Math.abs(p - g) - 2), v = r[u] + c.score - m;
4569
+ const f = c.spokenStartToken - h.spokenEndToken, g = c.visibleToken - h.visibleToken - 1, m = Math.max(0, Math.abs(f - g) - 2), v = r[u] + c.score - m;
4547
4570
  v > r[l] && (r[l] = v, i[l] = u);
4548
4571
  }
4549
4572
  }
@@ -4565,12 +4588,12 @@ var Kl = /* @__PURE__ */ new Set([
4565
4588
  score: l.score
4566
4589
  };
4567
4590
  });
4568
- }, rc = (e, t, n) => {
4591
+ }, ac = (e, t, n) => {
4569
4592
  if (e.length === 0) return 0;
4570
4593
  const r = e.length / Math.max(1, Math.min(t.length, n.length)), i = e.reduce((o, s) => o + s.score, 0) / e.length / 10;
4571
4594
  return Math.min(1, r * i);
4572
- }, So = (e) => {
4573
- const t = bo(e.speechText), n = $(e.visibleText), r = t.spokenText, i = Wn(r), o = Wn(n), s = t.unsupportedSemantic ? [] : nc(i, o), a = rc(s, i, o), l = r === n && r.length > 0, c = s.length === 1 && s[0].score === 10 && i.length <= 2 && o.length <= 2, u = t.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", h = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
4595
+ }, _o = (e) => {
4596
+ const t = To(e.speechText), n = $(e.visibleText), r = t.spokenText, i = Wn(r), o = Wn(n), s = t.unsupportedSemantic ? [] : sc(i, o), a = ac(s, i, o), l = r === n && r.length > 0, c = s.length === 1 && s[0].score === 10 && i.length <= 2 && o.length <= 2, u = t.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", h = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
4574
4597
  return {
4575
4598
  speechText: e.speechText,
4576
4599
  spokenText: r,
@@ -4583,12 +4606,12 @@ var Kl = /* @__PURE__ */ new Set([
4583
4606
  visibleTokens: o,
4584
4607
  rawToSpokenOffsetMap: t.rawToSpokenOffsetMap
4585
4608
  };
4586
- }, ur = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, _o = (e) => {
4609
+ }, ur = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, wo = (e) => {
4587
4610
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
4588
4611
  const t = Wn(e)[0];
4589
- return t ? To.get(t.normalized) || t.normalized : null;
4612
+ return t ? So.get(t.normalized) || t.normalized : null;
4590
4613
  }, Vr = (e, t, n) => {
4591
- const r = _o(n);
4614
+ const r = wo(n);
4592
4615
  if (!t || !r) return !1;
4593
4616
  const i = ur(e.spokenTokens, t.start);
4594
4617
  return i ? Fn(i) === r : !1;
@@ -4616,7 +4639,7 @@ var Kl = /* @__PURE__ */ new Set([
4616
4639
  start: t,
4617
4640
  length: Math.min(n, r.end - t)
4618
4641
  } : null;
4619
- }, ic = (e, t, n = 1, r) => {
4642
+ }, lc = (e, t, n = 1, r) => {
4620
4643
  if (e.boundaryOffsetMode === "unsupported" || !Number.isFinite(t)) return null;
4621
4644
  const i = Math.max(1, Number.isFinite(n) ? n : 1);
4622
4645
  if (r && /^<[^>]+>$/.test(r.trim())) return null;
@@ -4625,12 +4648,12 @@ var Kl = /* @__PURE__ */ new Set([
4625
4648
  if (r) {
4626
4649
  if (Vr(e, o, r)) return o;
4627
4650
  if (Vr(e, s, r)) return s;
4628
- if (_o(r)) return null;
4651
+ if (wo(r)) return null;
4629
4652
  }
4630
4653
  return o || s;
4631
4654
  }
4632
4655
  return Kr(e, t, i) || Ur(e, t, i);
4633
- }, oc = (e, t) => {
4656
+ }, cc = (e, t) => {
4634
4657
  if (e.playbackMode === "region-fallback") return null;
4635
4658
  const n = e.anchors.find((o) => o.spokenStart <= t && t < o.spokenEnd);
4636
4659
  if (n) return {
@@ -4652,7 +4675,7 @@ var Kl = /* @__PURE__ */ new Set([
4652
4675
  start: Math.min(r.visibleStart, i.visibleStart),
4653
4676
  end: Math.max(r.visibleEnd, i.visibleEnd)
4654
4677
  } : null;
4655
- }, sc = /* @__PURE__ */ new Map([
4678
+ }, uc = /* @__PURE__ */ new Map([
4656
4679
  ["+", ["plus"]],
4657
4680
  ["-", ["minus", "negative"]],
4658
4681
  ["−", ["minus", "negative"]],
@@ -4676,12 +4699,12 @@ var Kl = /* @__PURE__ */ new Set([
4676
4699
  ["•", ["times"]],
4677
4700
  ["·", ["times"]],
4678
4701
  ["⁢", ["times", "multiplied by"]]
4679
- ]), ac = /* @__PURE__ */ new Map([
4702
+ ]), hc = /* @__PURE__ */ new Map([
4680
4703
  ["⁡", "function-application"],
4681
4704
  ["⁢", "implicit-multiply"],
4682
4705
  ["⁣", "invisible-separator"],
4683
4706
  ["⁤", "invisible-plus"]
4684
- ]), wo = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), lc = /* @__PURE__ */ new Map([
4707
+ ]), ko = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), dc = /* @__PURE__ */ new Map([
4685
4708
  ["msqrt", "radical"],
4686
4709
  ["mroot", "radical"],
4687
4710
  ["msub", "subscript"],
@@ -4691,11 +4714,11 @@ var Kl = /* @__PURE__ */ new Set([
4691
4714
  ["munderover", "underoverscript"],
4692
4715
  ["mmultiscripts", "multiscript"],
4693
4716
  ["menclose", "enclosure"]
4694
- ]), cc = (e) => e.replace(/\s+/g, " ").trim(), Ve = (e) => (e.localName || e.tagName || "").toLowerCase(), uc = (e) => e.nodeType === Node.ELEMENT_NODE, ut = (e) => Array.from(e.childNodes).filter(uc), hr = (e) => cc(e.textContent || ""), ye = (e, t) => ({
4717
+ ]), fc = (e) => e.replace(/\s+/g, " ").trim(), Ve = (e) => (e.localName || e.tagName || "").toLowerCase(), pc = (e) => e.nodeType === Node.ELEMENT_NODE, ut = (e) => Array.from(e.childNodes).filter(pc), hr = (e) => fc(e.textContent || ""), ye = (e, t) => ({
4695
4718
  type: "element-range",
4696
4719
  quality: t,
4697
4720
  element: e
4698
- }), hc = (e) => {
4721
+ }), gc = (e) => {
4699
4722
  switch (e) {
4700
4723
  case "mi":
4701
4724
  return "identifier";
@@ -4711,15 +4734,15 @@ var Kl = /* @__PURE__ */ new Set([
4711
4734
  default:
4712
4735
  return "unknown";
4713
4736
  }
4714
- }, dc = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), fc = (e, t, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? wo.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? sc.get(e) || [] : [], Ke = (e) => {
4715
- const t = e.normalized ?? dc(e.text, e.kind || "unknown");
4737
+ }, mc = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), vc = (e, t, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? ko.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? uc.get(e) || [] : [], Ke = (e) => {
4738
+ const t = e.normalized ?? mc(e.text, e.kind || "unknown");
4716
4739
  return {
4717
4740
  id: `math-token-${e.state.nextId++}`,
4718
4741
  kind: e.kind,
4719
4742
  role: e.role,
4720
4743
  text: e.text,
4721
4744
  normalized: t,
4722
- spokenAliases: fc(e.text, e.kind, e.role),
4745
+ spokenAliases: vc(e.text, e.kind, e.role),
4723
4746
  sourceElement: e.sourceElement,
4724
4747
  path: e.path,
4725
4748
  target: e.target || ye(e.sourceElement, "element-range"),
@@ -4727,9 +4750,9 @@ var Kl = /* @__PURE__ */ new Set([
4727
4750
  };
4728
4751
  }, Xe = (e, t, n = "tokens") => {
4729
4752
  e[n].push(t);
4730
- }, ko = (e, t, n) => {
4753
+ }, Eo = (e, t, n) => {
4731
4754
  ut(e).forEach((r, i) => be(r, t, `${n}/${Ve(r)}[${i}]`));
4732
- }, pc = (e, t, n) => {
4755
+ }, yc = (e, t, n) => {
4733
4756
  const r = ut(e);
4734
4757
  r[0] && be(r[0], t, `${n}/numerator`), Xe(t, Ke({
4735
4758
  state: t,
@@ -4740,7 +4763,7 @@ var Kl = /* @__PURE__ */ new Set([
4740
4763
  path: n,
4741
4764
  target: ye(e, "element-range")
4742
4765
  })), r[1] && be(r[1], t, `${n}/denominator`);
4743
- }, gc = (e, t, n) => {
4766
+ }, bc = (e, t, n) => {
4744
4767
  const r = e.getAttribute("open") || "(", i = e.getAttribute("close") || ")";
4745
4768
  Xe(t, Ke({
4746
4769
  state: t,
@@ -4750,7 +4773,7 @@ var Kl = /* @__PURE__ */ new Set([
4750
4773
  sourceElement: e,
4751
4774
  path: `${n}/open`,
4752
4775
  target: ye(e, "element-range")
4753
- })), ko(e, t, n), Xe(t, Ke({
4776
+ })), Eo(e, t, n), Xe(t, Ke({
4754
4777
  state: t,
4755
4778
  kind: "operator",
4756
4779
  role: i === "|" ? "absolute-value-fence" : "close-fence",
@@ -4759,13 +4782,13 @@ var Kl = /* @__PURE__ */ new Set([
4759
4782
  path: `${n}/close`,
4760
4783
  target: ye(e, "element-range")
4761
4784
  }));
4762
- }, mc = (e, t, n) => {
4785
+ }, Tc = (e, t, n) => {
4763
4786
  const r = ut(e);
4764
4787
  r[0] && be(r[0], t, `${n}/base`);
4765
4788
  const i = r[1];
4766
4789
  if (!i) return;
4767
4790
  const o = hr(i);
4768
- if (wo.has(o)) {
4791
+ if (ko.has(o)) {
4769
4792
  Xe(t, Ke({
4770
4793
  state: t,
4771
4794
  kind: "structure",
@@ -4779,7 +4802,7 @@ var Kl = /* @__PURE__ */ new Set([
4779
4802
  return;
4780
4803
  }
4781
4804
  be(i, t, `${n}/exponent`);
4782
- }, vc = (e, t, n, r) => {
4805
+ }, Sc = (e, t, n, r) => {
4783
4806
  Xe(t, Ke({
4784
4807
  state: t,
4785
4808
  kind: "structure",
@@ -4790,7 +4813,7 @@ var Kl = /* @__PURE__ */ new Set([
4790
4813
  path: n,
4791
4814
  target: ye(e, "element-range")
4792
4815
  }));
4793
- }, yc = (e, t, n) => {
4816
+ }, _c = (e, t, n) => {
4794
4817
  let r = 0;
4795
4818
  for (const i of ut(e))
4796
4819
  (Ve(i) === "mtr" || Ve(i) === "mlabeledtr") && (r++, Xe(t, Ke({
@@ -4803,10 +4826,10 @@ var Kl = /* @__PURE__ */ new Set([
4803
4826
  path: `${n}/row[${r}]`,
4804
4827
  target: ye(i, "region-fallback")
4805
4828
  }), "layoutTargets")), be(i, t, `${n}/${Ve(i)}[${r}]`);
4806
- }, bc = (e, t, n) => {
4829
+ }, wc = (e, t, n) => {
4807
4830
  const r = hr(e);
4808
4831
  if (!r) return;
4809
- const i = hc(Ve(e)), o = i === "operator" ? ac.get(r) : void 0, s = o ?? (i === "operator" && (r === "(" || r === ")") ? "grouping-fence" : i);
4832
+ const i = gc(Ve(e)), o = i === "operator" ? hc.get(r) : void 0, s = o ?? (i === "operator" && (r === "(" || r === ")") ? "grouping-fence" : i);
4810
4833
  Xe(t, Ke({
4811
4834
  state: t,
4812
4835
  kind: i,
@@ -4837,19 +4860,19 @@ var Kl = /* @__PURE__ */ new Set([
4837
4860
  case "mtext":
4838
4861
  case "ms":
4839
4862
  case "mspace":
4840
- bc(e, t, n);
4863
+ wc(e, t, n);
4841
4864
  return;
4842
4865
  case "mfrac":
4843
- pc(e, t, n);
4866
+ yc(e, t, n);
4844
4867
  return;
4845
4868
  case "msup":
4846
- mc(e, t, n);
4869
+ Tc(e, t, n);
4847
4870
  return;
4848
4871
  case "mfenced":
4849
- gc(e, t, n);
4872
+ bc(e, t, n);
4850
4873
  return;
4851
4874
  case "mtable":
4852
- yc(e, t, n);
4875
+ _c(e, t, n);
4853
4876
  return;
4854
4877
  case "mphantom":
4855
4878
  return;
@@ -4859,15 +4882,15 @@ var Kl = /* @__PURE__ */ new Set([
4859
4882
  return;
4860
4883
  }
4861
4884
  default: {
4862
- const i = lc.get(r);
4885
+ const i = dc.get(r);
4863
4886
  if (i) {
4864
- vc(e, t, n, i);
4887
+ Sc(e, t, n, i);
4865
4888
  return;
4866
4889
  }
4867
- ko(e, t, n);
4890
+ Eo(e, t, n);
4868
4891
  }
4869
4892
  }
4870
- }, Tc = (e) => {
4893
+ }, kc = (e) => {
4871
4894
  const t = {
4872
4895
  tokens: [],
4873
4896
  layoutTargets: [],
@@ -4878,7 +4901,7 @@ var Kl = /* @__PURE__ */ new Set([
4878
4901
  layoutTargets: t.layoutTargets,
4879
4902
  expressionTarget: ye(e, "region-fallback")
4880
4903
  };
4881
- }, Sc = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, _c = 0.95, wc = (e) => {
4904
+ }, Ec = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, Ac = 0.95, Cc = (e) => {
4882
4905
  const t = [], n = /* @__PURE__ */ new Set(), r = (i) => {
4883
4906
  const o = i.toLowerCase().trim().split(/\s+/).filter(Boolean);
4884
4907
  if (o.length === 0) return;
@@ -4903,11 +4926,11 @@ var Kl = /* @__PURE__ */ new Set([
4903
4926
  o && (r = i.length);
4904
4927
  }
4905
4928
  return r;
4906
- }, kc = (e, t) => {
4929
+ }, xc = (e, t) => {
4907
4930
  const n = [];
4908
4931
  let r = 0;
4909
4932
  for (const i of t) {
4910
- const o = wc(i);
4933
+ const o = Cc(i);
4911
4934
  if (i.optional) {
4912
4935
  const s = Xr(e, r, o);
4913
4936
  s > 0 && (n.push({
@@ -4929,23 +4952,23 @@ var Kl = /* @__PURE__ */ new Set([
4929
4952
  }
4930
4953
  }
4931
4954
  return n;
4932
- }, Ec = (e, t, n) => {
4955
+ }, Ic = (e, t, n) => {
4933
4956
  const r = n.filter((s) => !s.optional).length, i = e.filter((s) => !s.math.optional).length, o = e.reduce((s, a) => s + a.speechTokens.length, 0);
4934
4957
  return r > 0 && i === r && o === t.length;
4935
- }, Ac = (e) => e.map(({ speechTokens: t, math: n }) => ({
4958
+ }, Oc = (e) => e.map(({ speechTokens: t, math: n }) => ({
4936
4959
  speechTokenIds: t.map((r) => r.id),
4937
4960
  mathTokenIds: [n.id],
4938
4961
  score: 1,
4939
4962
  confidence: 1,
4940
4963
  target: n.target
4941
- })), Cc = (e) => {
4942
- const t = e.minExactWordConfidence ?? _c, n = kc(e.speech.tokens, e.math.tokens), r = Ec(n, e.speech.tokens, e.math.tokens) ? 1 : 0;
4964
+ })), Mc = (e) => {
4965
+ const t = e.minExactWordConfidence ?? Ac, n = xc(e.speech.tokens, e.math.tokens), r = Ic(n, e.speech.tokens, e.math.tokens) ? 1 : 0;
4943
4966
  return {
4944
- segments: r >= t ? Ac(n) : [],
4967
+ segments: r >= t ? Oc(n) : [],
4945
4968
  confidence: r,
4946
4969
  fallbackTarget: e.math.expressionTarget
4947
4970
  };
4948
- }, Eo = co(), xc = /* @__PURE__ */ new Map([
4971
+ }, Ao = uo(), Lc = /* @__PURE__ */ new Map([
4949
4972
  ["zero", "0"],
4950
4973
  ["one", "1"],
4951
4974
  ["two", "2"],
@@ -4957,17 +4980,17 @@ var Kl = /* @__PURE__ */ new Set([
4957
4980
  ["eight", "8"],
4958
4981
  ["nine", "9"],
4959
4982
  ["ten", "10"]
4960
- ]), Ao = (e) => {
4983
+ ]), Co = (e) => {
4961
4984
  const t = e.toLowerCase();
4962
- return xc.get(t) || t;
4963
- }, Ic = (e) => {
4985
+ return Lc.get(t) || t;
4986
+ }, Rc = (e) => {
4964
4987
  const t = [];
4965
- for (const n of e.matchAll(Eo)) {
4988
+ for (const n of e.matchAll(Ao)) {
4966
4989
  const r = n[0], i = n.index ?? 0;
4967
4990
  t.push({
4968
4991
  id: `speech-token-${t.length}`,
4969
4992
  text: r,
4970
- normalized: Ao(r),
4993
+ normalized: Co(r),
4971
4994
  start: i,
4972
4995
  end: i + r.length,
4973
4996
  sourceStart: i,
@@ -4977,11 +5000,11 @@ var Kl = /* @__PURE__ */ new Set([
4977
5000
  }
4978
5001
  return t;
4979
5002
  }, Mt = (e) => {
4980
- const t = bo(e.speechText);
5003
+ const t = To(e.speechText);
4981
5004
  return {
4982
5005
  speechText: e.speechText,
4983
5006
  spokenText: t.spokenText,
4984
- tokens: Ic(t.spokenText),
5007
+ tokens: Rc(t.spokenText),
4985
5008
  rawToSpokenOffsetMap: t.rawToSpokenOffsetMap,
4986
5009
  boundaryOffsetSpace: t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text",
4987
5010
  unsupportedSemantic: t.unsupportedSemantic,
@@ -4989,9 +5012,9 @@ var Kl = /* @__PURE__ */ new Set([
4989
5012
  };
4990
5013
  }, dr = (e) => {
4991
5014
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
4992
- const t = e.match(Eo);
4993
- return t?.[0] ? Ao(t[0]) : null;
4994
- }, Oc = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, Mc = (e, t) => {
5015
+ const t = e.match(Ao);
5016
+ return t?.[0] ? Co(t[0]) : null;
5017
+ }, $c = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, Pc = (e, t) => {
4995
5018
  const n = e.rawToSpokenOffsetMap.get(t);
4996
5019
  if (n !== void 0) return n;
4997
5020
  for (let r = t; r < e.speechText.length; r++) {
@@ -5002,7 +5025,7 @@ var Kl = /* @__PURE__ */ new Set([
5002
5025
  return null;
5003
5026
  }, Dn = (e, t, n) => {
5004
5027
  if (t === null) return null;
5005
- const r = Oc(e.tokens, t);
5028
+ const r = $c(e.tokens, t);
5006
5029
  return r ? {
5007
5030
  token: r,
5008
5031
  start: t,
@@ -5012,9 +5035,9 @@ var Kl = /* @__PURE__ */ new Set([
5012
5035
  }, jn = (e, t) => {
5013
5036
  const n = dr(t);
5014
5037
  return !!(e && n && e.token.normalized === n);
5015
- }, Lc = (e) => {
5038
+ }, Nc = (e) => {
5016
5039
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5017
- const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization, Mc(e.tokenization, e.position), t), r = Dn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5040
+ const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization, Pc(e.tokenization, e.position), t), r = Dn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5018
5041
  return jn(n, e.boundaryWord) ? {
5019
5042
  ...n,
5020
5043
  confidence: 1
@@ -5022,7 +5045,7 @@ var Kl = /* @__PURE__ */ new Set([
5022
5045
  ...r,
5023
5046
  confidence: 1
5024
5047
  } : e.boundaryWord && dr(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? n || r : r || n;
5025
- }, Rc = (e) => {
5048
+ }, Hc = (e) => {
5026
5049
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5027
5050
  const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5028
5051
  return jn(n, e.boundaryWord) ? {
@@ -5030,27 +5053,27 @@ var Kl = /* @__PURE__ */ new Set([
5030
5053
  confidence: 1
5031
5054
  } : e.boundaryWord && dr(e.boundaryWord) ? null : n;
5032
5055
  }, an = (e) => {
5033
- const t = Mt({ speechText: e.speechText }), n = Tc(e.mathElement);
5056
+ const t = Mt({ speechText: e.speechText }), n = kc(e.mathElement);
5034
5057
  return {
5035
5058
  speech: t,
5036
5059
  math: n,
5037
- result: Cc({
5060
+ result: Mc({
5038
5061
  speech: t,
5039
5062
  math: n
5040
5063
  })
5041
5064
  };
5042
- }, $c = (e, t) => {
5043
- const n = Rc({
5065
+ }, Bc = (e, t) => {
5066
+ const n = Hc({
5044
5067
  tokenization: e.speech,
5045
5068
  position: t.position,
5046
5069
  length: t.length,
5047
5070
  boundaryWord: t.boundaryWord
5048
5071
  });
5049
- return Sc({
5072
+ return Ec({
5050
5073
  alignment: e.result,
5051
5074
  boundary: n
5052
5075
  });
5053
- }, Pc = (e, t) => {
5076
+ }, zc = (e, t) => {
5054
5077
  if (!t.boundaryWord || /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
5055
5078
  const n = Mt({ speechText: t.boundaryWord }).tokens[0];
5056
5079
  if (!n) return null;
@@ -5059,7 +5082,7 @@ var Kl = /* @__PURE__ */ new Set([
5059
5082
  return i.normalized.toLowerCase() === o || i.spokenAliases.some((s) => s.toLowerCase() === o);
5060
5083
  });
5061
5084
  return r.length === 1 ? r[0].target : null;
5062
- }, qn = "http://www.w3.org/1998/Math/MathML", Nc = /* @__PURE__ */ new Set([
5085
+ }, qn = "http://www.w3.org/1998/Math/MathML", Wc = /* @__PURE__ */ new Set([
5063
5086
  "math",
5064
5087
  "maction",
5065
5088
  "menclose",
@@ -5093,7 +5116,7 @@ var Kl = /* @__PURE__ */ new Set([
5093
5116
  "semantics",
5094
5117
  "annotation",
5095
5118
  "annotation-xml"
5096
- ]), Hc = /* @__PURE__ */ new Set([
5119
+ ]), Fc = /* @__PURE__ */ new Set([
5097
5120
  "accent",
5098
5121
  "accentunder",
5099
5122
  "align",
@@ -5145,44 +5168,44 @@ var Kl = /* @__PURE__ */ new Set([
5145
5168
  "width",
5146
5169
  "xmlns",
5147
5170
  "xml:lang"
5148
- ]), Co = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Bc = (e) => Co(e).replace(/"/g, "&quot;"), zc = (e, t) => {
5171
+ ]), xo = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Dc = (e) => xo(e).replace(/"/g, "&quot;"), jc = (e, t) => {
5149
5172
  const n = e.toLowerCase(), r = t.trim().toLowerCase();
5150
- return !!(n.startsWith("on") || !Hc.has(n) || r.includes("javascript:") || r.includes("data:text/html"));
5151
- }, Wc = (e) => {
5173
+ return !!(n.startsWith("on") || !Fc.has(n) || r.includes("javascript:") || r.includes("data:text/html"));
5174
+ }, qc = (e) => {
5152
5175
  const t = e.localName.toLowerCase();
5153
- if (!Nc.has(t)) return !1;
5176
+ if (!Wc.has(t)) return !1;
5154
5177
  const n = e.namespaceURI;
5155
5178
  return !n || n === qn || n === "http://www.w3.org/1999/xhtml";
5156
- }, xo = (e) => {
5157
- if (e.nodeType === Node.TEXT_NODE) return Co(e.textContent || "");
5179
+ }, Io = (e) => {
5180
+ if (e.nodeType === Node.TEXT_NODE) return xo(e.textContent || "");
5158
5181
  if (e.nodeType === Node.COMMENT_NODE) return "";
5159
5182
  if (e.nodeType !== Node.ELEMENT_NODE) return null;
5160
5183
  const t = e;
5161
- if (!Wc(t)) return null;
5184
+ if (!qc(t)) return null;
5162
5185
  const n = t.localName.toLowerCase(), r = [];
5163
5186
  for (const o of Array.from(t.attributes)) {
5164
5187
  const s = o.name.toLowerCase();
5165
- if (!zc(s, o.value)) {
5188
+ if (!jc(s, o.value)) {
5166
5189
  if (s === "xmlns" && o.value !== qn) return null;
5167
- r.push(`${s}="${Bc(o.value)}"`);
5190
+ r.push(`${s}="${Dc(o.value)}"`);
5168
5191
  }
5169
5192
  }
5170
5193
  n === "math" && !r.some((o) => o.startsWith("xmlns=")) && r.unshift(`xmlns="${qn}"`);
5171
5194
  const i = [];
5172
5195
  for (const o of Array.from(t.childNodes)) {
5173
- const s = xo(o);
5196
+ const s = Io(o);
5174
5197
  if (s === null) return null;
5175
5198
  i.push(s);
5176
5199
  }
5177
5200
  return `<${n}${r.length > 0 ? ` ${r.join(" ")}` : ""}>${i.join("")}</${n}>`;
5178
- }, Fc = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, En = (e) => {
5201
+ }, Vc = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, En = (e) => {
5179
5202
  const t = String(e || "").trim();
5180
5203
  if (!t) return null;
5181
- const n = Fc(t);
5204
+ const n = Vc(t);
5182
5205
  if (!n || n.getElementsByTagName("parsererror").length > 0) return null;
5183
5206
  const r = n.documentElement;
5184
- return !r || r.localName.toLowerCase() !== "math" ? null : xo(r);
5185
- }, Io = (e) => ({
5207
+ return !r || r.localName.toLowerCase() !== "math" ? null : Io(r);
5208
+ }, Oo = (e) => ({
5186
5209
  chars: [],
5187
5210
  map: /* @__PURE__ */ new Map(),
5188
5211
  position: 0,
@@ -5190,28 +5213,28 @@ var Kl = /* @__PURE__ */ new Set([
5190
5213
  lastCharWasWhitespace: !1,
5191
5214
  lastMapped: null,
5192
5215
  options: e
5193
- }), Oo = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Mo = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Lo = (e) => {
5216
+ }), Mo = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Lo = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Ro = (e) => {
5194
5217
  const t = e.tagName?.toLowerCase();
5195
5218
  return t === "annotation" || t === "annotation-xml";
5196
- }, Dc = (e) => {
5219
+ }, Gc = (e) => {
5197
5220
  const t = e.getAttribute("data-mathml");
5198
5221
  return t && t.trim() ? t : null;
5199
- }, jc = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, qc = (e) => {
5222
+ }, Uc = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, Kc = (e) => {
5200
5223
  if (e.tagName.toLowerCase() === "math") return En(e.outerHTML);
5201
- const t = Dc(e);
5224
+ const t = Gc(e);
5202
5225
  if (t) {
5203
5226
  const n = En(t);
5204
5227
  if (n) return n;
5205
5228
  }
5206
- if (Oo(e)) {
5207
- const n = jc(e);
5229
+ if (Mo(e)) {
5230
+ const n = Uc(e);
5208
5231
  if (n) {
5209
5232
  const r = En(n);
5210
5233
  if (r) return r;
5211
5234
  }
5212
5235
  }
5213
5236
  return null;
5214
- }, Vc = /* @__PURE__ */ new Set([
5237
+ }, Xc = /* @__PURE__ */ new Set([
5215
5238
  "P",
5216
5239
  "H1",
5217
5240
  "H2",
@@ -5227,7 +5250,7 @@ var Kl = /* @__PURE__ */ new Set([
5227
5250
  "FIGCAPTION",
5228
5251
  "LABEL",
5229
5252
  "BUTTON"
5230
- ]), Gc = /* @__PURE__ */ new Set([
5253
+ ]), Yc = /* @__PURE__ */ new Set([
5231
5254
  "heading",
5232
5255
  "listitem",
5233
5256
  "option",
@@ -5236,24 +5259,24 @@ var Kl = /* @__PURE__ */ new Set([
5236
5259
  "cell",
5237
5260
  "columnheader",
5238
5261
  "rowheader"
5239
- ]), Uc = (e, t) => {
5262
+ ]), Jc = (e, t) => {
5240
5263
  let n = e.parentElement, r = null;
5241
5264
  for (; n && n !== t; ) {
5242
5265
  const i = (n.getAttribute("role") || "").toLowerCase(), o = n.tagName.toUpperCase();
5243
- if (Vc.has(o) || Gc.has(i)) {
5266
+ if (Xc.has(o) || Yc.has(i)) {
5244
5267
  r = n;
5245
5268
  break;
5246
5269
  }
5247
5270
  n = n.parentElement;
5248
5271
  }
5249
5272
  return r || t;
5250
- }, Kc = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Oo(e), He = (e, t, n) => {
5273
+ }, Qc = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Mo(e), He = (e, t, n) => {
5251
5274
  /[.,;:!?]/.test(t) && e.chars.length > 0 && e.chars[e.chars.length - 1] === " " && (e.chars.pop(), e.position--, e.map.delete(e.position)), e.chars.push(t), n ? (e.map.set(e.position, n), e.lastMapped = n) : e.lastMapped && e.map.set(e.position, e.lastMapped), e.position++;
5252
- }, Ro = (e, t) => {
5275
+ }, $o = (e, t) => {
5253
5276
  if (e.inLeadingWhitespace || e.lastCharWasWhitespace || e.chars.length === 0) return !1;
5254
5277
  const n = e.chars[e.chars.length - 1];
5255
- return ho(n, t, e.options);
5256
- }, $o = (e, t) => {
5278
+ return fo(n, t, e.options);
5279
+ }, Po = (e, t) => {
5257
5280
  const n = t.textContent || "";
5258
5281
  let r = !1;
5259
5282
  for (let i = 0; i < n.length; i++) {
@@ -5272,7 +5295,7 @@ var Kl = /* @__PURE__ */ new Set([
5272
5295
  }), e.lastCharWasWhitespace = !0;
5273
5296
  continue;
5274
5297
  }
5275
- !r && Ro(e, o) && He(e, " ", {
5298
+ !r && $o(e, o) && He(e, " ", {
5276
5299
  node: t,
5277
5300
  offset: i
5278
5301
  }), He(e, o, {
@@ -5280,7 +5303,7 @@ var Kl = /* @__PURE__ */ new Set([
5280
5303
  offset: i
5281
5304
  }), r = !0, e.lastCharWasWhitespace = !1;
5282
5305
  }
5283
- }, Xc = (e, t) => {
5306
+ }, Zc = (e, t) => {
5284
5307
  for (let n = 0; n < t.text.length; n++) {
5285
5308
  const r = t.text[n], i = /\s/.test(r), o = t.map.get(n) || null, s = o?.node || e.lastMapped?.node || null, a = o?.offset ?? e.lastMapped?.offset ?? 0, l = o ? {
5286
5309
  node: o.node,
@@ -5297,7 +5320,7 @@ var Kl = /* @__PURE__ */ new Set([
5297
5320
  e.lastCharWasWhitespace || He(e, " ", l), e.lastCharWasWhitespace = !0;
5298
5321
  continue;
5299
5322
  }
5300
- n === 0 && Ro(e, r) && He(e, " ", l), He(e, r, l), e.lastCharWasWhitespace = !1, o ? (e.map.set(e.position - 1, {
5323
+ n === 0 && $o(e, r) && He(e, " ", l), He(e, r, l), e.lastCharWasWhitespace = !1, o ? (e.map.set(e.position - 1, {
5301
5324
  node: o.node,
5302
5325
  offset: o.offset
5303
5326
  }), e.lastMapped = {
@@ -5308,7 +5331,7 @@ var Kl = /* @__PURE__ */ new Set([
5308
5331
  offset: a
5309
5332
  });
5310
5333
  }
5311
- }, Yc = (e) => {
5334
+ }, eu = (e) => {
5312
5335
  if (typeof DOMParser > "u") return "";
5313
5336
  const t = new DOMParser().parseFromString(e, "application/xml");
5314
5337
  if (t.getElementsByTagName("parsererror").length > 0) return "";
@@ -5320,38 +5343,38 @@ var Kl = /* @__PURE__ */ new Set([
5320
5343
  }
5321
5344
  if (i.nodeType !== 1) return;
5322
5345
  const o = i;
5323
- if (!Lo(o))
5346
+ if (!Ro(o))
5324
5347
  for (const s of Array.from(o.childNodes)) r(s);
5325
5348
  };
5326
5349
  return r(t.documentElement), $(n.join(" "));
5327
- }, Jc = (e, t, n) => {
5328
- const r = Io(n), i = (a) => {
5350
+ }, tu = (e, t, n) => {
5351
+ const r = Oo(n), i = (a) => {
5329
5352
  if (ft(a, e)) return;
5330
5353
  if (a.nodeType === 3) {
5331
- $o(r, a);
5354
+ Po(r, a);
5332
5355
  return;
5333
5356
  }
5334
5357
  if (a.nodeType !== 1) return;
5335
5358
  const l = a;
5336
- if (!(Mo(l) || Lo(l)))
5359
+ if (!(Lo(l) || Ro(l)))
5337
5360
  for (const c of Array.from(l.childNodes)) i(c);
5338
5361
  };
5339
- i(e), Po(r);
5362
+ i(e), No(r);
5340
5363
  const o = $(r.chars.join(""));
5341
5364
  if (o) return {
5342
5365
  text: o,
5343
5366
  map: r.map
5344
5367
  };
5345
- const s = Yc(t);
5368
+ const s = eu(t);
5346
5369
  return s ? {
5347
5370
  text: s,
5348
5371
  map: /* @__PURE__ */ new Map()
5349
5372
  } : on(e, n);
5350
- }, Po = (e) => {
5373
+ }, No = (e) => {
5351
5374
  for (; e.chars.length > 0 && /\s/.test(e.chars[e.chars.length - 1]); )
5352
5375
  e.chars.pop(), e.position--, e.map.delete(e.position);
5353
- }, Qc = (e, t) => {
5354
- const n = Io(t), r = [];
5376
+ }, nu = (e, t) => {
5377
+ const n = Oo(t), r = [];
5355
5378
  let i = 0, o, s = !1;
5356
5379
  const a = () => {
5357
5380
  const u = $(n.chars.slice(i, n.chars.length).join(""));
@@ -5363,22 +5386,22 @@ var Kl = /* @__PURE__ */ new Set([
5363
5386
  }, l = (u) => {
5364
5387
  if (ft(u, e)) return;
5365
5388
  if (u.nodeType === Node.TEXT_NODE) {
5366
- const g = Uc(u, e);
5367
- o && g !== o && a(), o = g, $o(n, u);
5389
+ const g = Jc(u, e);
5390
+ o && g !== o && a(), o = g, Po(n, u);
5368
5391
  return;
5369
5392
  }
5370
5393
  if (u.nodeType !== Node.ELEMENT_NODE) return;
5371
5394
  const h = u;
5372
- if (Mo(h)) return;
5373
- const p = qc(h);
5374
- if (p) {
5395
+ if (Lo(h)) return;
5396
+ const f = Kc(h);
5397
+ if (f) {
5375
5398
  a();
5376
- const g = Jc(h, p, t);
5377
- Xc(n, g);
5399
+ const g = tu(h, f, t);
5400
+ Zc(n, g);
5378
5401
  const m = $(g.text);
5379
5402
  r.push({
5380
5403
  type: "math",
5381
- mathml: p,
5404
+ mathml: f,
5382
5405
  fallbackText: m,
5383
5406
  sourceElement: h
5384
5407
  }), i = n.chars.length, s = !0;
@@ -5387,7 +5410,7 @@ var Kl = /* @__PURE__ */ new Set([
5387
5410
  for (const g of Array.from(h.childNodes)) l(g);
5388
5411
  };
5389
5412
  for (const u of Array.from(e.childNodes)) l(u);
5390
- Po(n), a();
5413
+ No(n), a();
5391
5414
  const c = n.chars.join("");
5392
5415
  for (; n.map.has(c.length); ) n.map.delete(c.length);
5393
5416
  return {
@@ -5397,7 +5420,7 @@ var Kl = /* @__PURE__ */ new Set([
5397
5420
  containsMathMarkup: s
5398
5421
  };
5399
5422
  }, bt = (e, t) => {
5400
- if (!Kc(e)) {
5423
+ if (!Qc(e)) {
5401
5424
  const { text: n, map: r } = on(e, t);
5402
5425
  return {
5403
5426
  visibleText: n,
@@ -5409,8 +5432,8 @@ var Kl = /* @__PURE__ */ new Set([
5409
5432
  containsMathMarkup: !1
5410
5433
  };
5411
5434
  }
5412
- return Qc(e, t);
5413
- }, Zc = (e, t) => po([e], t), eu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", tu = /* @__PURE__ */ new Set([
5435
+ return nu(e, t);
5436
+ }, ru = (e, t) => go([e], t), iu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", ou = /* @__PURE__ */ new Set([
5414
5437
  "H1",
5415
5438
  "H2",
5416
5439
  "H3",
@@ -5420,17 +5443,17 @@ var Kl = /* @__PURE__ */ new Set([
5420
5443
  "LI",
5421
5444
  "LABEL",
5422
5445
  "BUTTON"
5423
- ]), nu = /* @__PURE__ */ new Set([
5446
+ ]), su = /* @__PURE__ */ new Set([
5424
5447
  "heading",
5425
5448
  "listitem",
5426
5449
  "option",
5427
5450
  "radio"
5428
- ]), ru = (e) => {
5451
+ ]), au = (e) => {
5429
5452
  if (e.type !== "text" || !e.sourceElement) return !1;
5430
5453
  const t = e.sourceElement.tagName.toUpperCase(), n = (e.sourceElement.getAttribute("role") || "").toLowerCase();
5431
- return tu.has(t) || nu.has(n);
5432
- }, iu = async (e) => {
5433
- const t = e.resolveMathSpeech ?? Zc, { visibleText: n } = e, r = [];
5454
+ return ou.has(t) || su.has(n);
5455
+ }, lu = async (e) => {
5456
+ const t = e.resolveMathSpeech ?? ru, { visibleText: n } = e, r = [];
5434
5457
  let i = 0;
5435
5458
  const o = (a) => {
5436
5459
  const l = $(a), c = n.indexOf(l, i), u = c >= 0 ? c : i, h = u + l.length;
@@ -5442,7 +5465,7 @@ var Kl = /* @__PURE__ */ new Set([
5442
5465
  for (let a = 0; a < e.chunks.length; a++) {
5443
5466
  const l = e.chunks[a];
5444
5467
  if (l.type === "text") {
5445
- const g = ru(l) ? [{
5468
+ const g = au(l) ? [{
5446
5469
  text: l.text,
5447
5470
  offset: 0
5448
5471
  }] : lr(l.text, { locale: e.language });
@@ -5466,28 +5489,28 @@ var Kl = /* @__PURE__ */ new Set([
5466
5489
  language: e.language,
5467
5490
  produceSsml: e.produceSsml,
5468
5491
  mathSpeech: e.mathSpeech
5469
- }), h = !u.speechText, p = u.speechText || l.fallbackText;
5492
+ }), h = !u.speechText, f = u.speechText || l.fallbackText;
5470
5493
  r.push({
5471
5494
  sourceChunkIndex: a,
5472
5495
  segment: {
5473
5496
  kind: "math",
5474
- spokenText: p,
5497
+ spokenText: f,
5475
5498
  mathml: l.mathml,
5476
5499
  fallbackText: l.fallbackText,
5477
5500
  visibleSpan: c,
5478
5501
  usedFallback: h,
5479
5502
  ssml: u.ssml
5480
5503
  }
5481
- }), s.push(p);
5504
+ }), s.push(f);
5482
5505
  }
5483
5506
  return {
5484
5507
  segments: r,
5485
- locale: eu(e.language),
5508
+ locale: iu(e.language),
5486
5509
  visibleText: n,
5487
5510
  plainSpeechText: $(s.join(" "))
5488
5511
  };
5489
- }, ou = (e) => (e || "en").split("-")[0].toLowerCase() || "en", su = "sre-v1", au = 256, Vn = (e) => Array.isArray(e) ? `array:[${e.map(Vn).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${JSON.stringify(t)}:${Vn(n)}`).join(",")}}` : e === null ? "null:null" : typeof e > "u" ? "undefined:" : typeof e == "function" ? `function:${e.name || "anonymous"}` : typeof e == "symbol" ? `symbol:${String(e)}` : typeof e == "bigint" ? `bigint:${e.toString()}` : typeof e == "number" ? Number.isFinite(e) ? `number:${e}` : `number:${String(e)}` : `${typeof e}:${JSON.stringify(e)}`, Yr = (e, t, n, r) => `${su}\0${ou(e)}\0${t ? "ssml" : "plain"}\0${Vn(n ?? null)}\0${r}`, lu = (e = {}) => {
5490
- const t = Math.max(1, e.maxEntries ?? au), n = e.resolve ?? ((o, s) => po([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
5512
+ }, cu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", uu = "sre-v1", hu = 256, Vn = (e) => Array.isArray(e) ? `array:[${e.map(Vn).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${JSON.stringify(t)}:${Vn(n)}`).join(",")}}` : e === null ? "null:null" : typeof e > "u" ? "undefined:" : typeof e == "function" ? `function:${e.name || "anonymous"}` : typeof e == "symbol" ? `symbol:${String(e)}` : typeof e == "bigint" ? `bigint:${e.toString()}` : typeof e == "number" ? Number.isFinite(e) ? `number:${e}` : `number:${String(e)}` : `${typeof e}:${JSON.stringify(e)}`, Yr = (e, t, n, r) => `${uu}\0${cu(e)}\0${t ? "ssml" : "plain"}\0${Vn(n ?? null)}\0${r}`, du = (e = {}) => {
5513
+ const t = Math.max(1, e.maxEntries ?? hu), n = e.resolve ?? ((o, s) => go([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
5491
5514
  for (r.delete(o), r.set(o, s); r.size > t; ) {
5492
5515
  const a = r.keys().next().value;
5493
5516
  a !== void 0 && r.delete(a);
@@ -5507,13 +5530,13 @@ var Kl = /* @__PURE__ */ new Set([
5507
5530
  usedFallback: h.usedFallback
5508
5531
  }), i(c, h), h;
5509
5532
  };
5510
- }, cu = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : Mt({ speechText: e }).tokens[0]?.normalized || null, uu = (e, t) => {
5533
+ }, fu = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : Mt({ speechText: e }).tokens[0]?.normalized || null, pu = (e, t) => {
5511
5534
  const n = Mt({ speechText: e.speechText });
5512
5535
  if (!Number.isFinite(t.position)) return {
5513
5536
  boundary: null,
5514
5537
  spokenText: n.spokenText
5515
5538
  };
5516
- const r = Lc({
5539
+ const r = Nc({
5517
5540
  tokenization: n,
5518
5541
  position: t.position,
5519
5542
  length: t.length,
@@ -5526,8 +5549,8 @@ var Kl = /* @__PURE__ */ new Set([
5526
5549
  } : null,
5527
5550
  spokenText: n.spokenText
5528
5551
  };
5529
- }, hu = (e, t, n) => n ? Mt({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, du = (e, t) => {
5530
- const n = cu(t.word);
5552
+ }, gu = (e, t, n) => n ? Mt({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, mu = (e, t) => {
5553
+ const n = fu(t.word);
5531
5554
  if (e.id !== t.chunkId) return {
5532
5555
  chunkId: t.chunkId,
5533
5556
  normalizedWord: n,
@@ -5546,12 +5569,12 @@ var Kl = /* @__PURE__ */ new Set([
5546
5569
  };
5547
5570
  let r, i;
5548
5571
  if (e.catalogAlignment)
5549
- r = ic(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
5572
+ r = lc(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
5550
5573
  else {
5551
- const o = uu(e, t);
5574
+ const o = pu(e, t);
5552
5575
  r = o.boundary, i = o.spokenText;
5553
5576
  }
5554
- return r ? hu(i, r.start, n) ? {
5577
+ return r ? gu(i, r.start, n) ? {
5555
5578
  chunkId: e.id,
5556
5579
  normalizedWord: n,
5557
5580
  chunkSpokenStart: r.start,
@@ -5591,12 +5614,12 @@ var Kl = /* @__PURE__ */ new Set([
5591
5614
  quality: "region",
5592
5615
  confidence: e.confidence,
5593
5616
  reason: e.reason
5594
- }, No = /* @__PURE__ */ new Map([
5617
+ }, Ho = /* @__PURE__ */ new Map([
5595
5618
  ["mi", "mjx-mi"],
5596
5619
  ["mn", "mjx-mn"],
5597
5620
  ["mo", "mjx-mo"],
5598
5621
  ["mtext", "mjx-mtext"]
5599
- ]), Gn = "mi,mn,mo,mtext", Ho = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Bo = [
5622
+ ]), Gn = "mi,mn,mo,mtext", Bo = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", zo = [
5600
5623
  "mjx-mfrac",
5601
5624
  "mjx-msqrt",
5602
5625
  "mjx-mroot",
@@ -5604,14 +5627,14 @@ var Kl = /* @__PURE__ */ new Set([
5604
5627
  "mjx-munder",
5605
5628
  "mjx-mover",
5606
5629
  "mjx-munderover"
5607
- ].join(","), zo = (e) => e.type === "text-range" ? e.node.parentElement : e.element, mn = (e) => {
5630
+ ].join(","), Wo = (e) => e.type === "text-range" ? e.node.parentElement : e.element, mn = (e) => {
5608
5631
  let t = e;
5609
5632
  for (; t; ) {
5610
5633
  if (t.localName?.toLowerCase() === "mjx-container") return t;
5611
5634
  t = t.parentElement;
5612
5635
  }
5613
5636
  return null;
5614
- }, Jr = (e) => !e || mn(e) ? !1 : !ft(e), Wo = (e) => {
5637
+ }, Jr = (e) => !e || mn(e) ? !1 : !ft(e), Fo = (e) => {
5615
5638
  const t = e.getBoundingClientRect?.();
5616
5639
  return !!(t && t.width > 0 && t.height > 0);
5617
5640
  }, Un = (e) => {
@@ -5621,38 +5644,38 @@ var Kl = /* @__PURE__ */ new Set([
5621
5644
  t = t.parentElement;
5622
5645
  }
5623
5646
  return null;
5624
- }, Fo = (e, t) => {
5647
+ }, Do = (e, t) => {
5625
5648
  if (e.length === 0 || e.length !== t.length) return !1;
5626
5649
  for (let n = 0; n < e.length; n += 1) {
5627
- const r = No.get(e[n].localName.toLowerCase());
5650
+ const r = Ho.get(e[n].localName.toLowerCase());
5628
5651
  if (!r || t[n].localName.toLowerCase() !== r) return !1;
5629
5652
  }
5630
5653
  return !0;
5631
- }, fu = (e, t) => {
5632
- if (!e || !No.has(e.localName.toLowerCase()) || t.querySelector(Bo)) return null;
5654
+ }, vu = (e, t) => {
5655
+ if (!e || !Ho.has(e.localName.toLowerCase()) || t.querySelector(zo)) return null;
5633
5656
  const n = Un(e), r = t.querySelector("mjx-math");
5634
5657
  if (!n || !r) return null;
5635
5658
  const i = Array.from(n.querySelectorAll(Gn)), o = i.indexOf(e);
5636
5659
  if (o < 0) return null;
5637
- const s = Array.from(r.querySelectorAll(Ho));
5638
- if (!Fo(i, s)) return null;
5660
+ const s = Array.from(r.querySelectorAll(Bo));
5661
+ if (!Do(i, s)) return null;
5639
5662
  const a = s[o];
5640
- return !a || !Wo(a) ? null : a;
5641
- }, pu = (e) => {
5663
+ return !a || !Fo(a) ? null : a;
5664
+ }, yu = (e) => {
5642
5665
  const t = mn(e);
5643
5666
  if (t) {
5644
- if (t.querySelector(Bo)) return "expression";
5667
+ if (t.querySelector(zo)) return "expression";
5645
5668
  const r = Un(e) ?? e, i = t.querySelector("mjx-math");
5646
5669
  if (!i) return "expression";
5647
- const o = Array.from(r.querySelectorAll(Gn)), s = Array.from(i.querySelectorAll(Ho));
5648
- return Fo(o, s) && s.some((a) => Wo(a)) ? "token" : "expression";
5670
+ const o = Array.from(r.querySelectorAll(Gn)), s = Array.from(i.querySelectorAll(Bo));
5671
+ return Do(o, s) && s.some((a) => Fo(a)) ? "token" : "expression";
5649
5672
  }
5650
5673
  const n = Un(e) ?? e;
5651
5674
  return Array.from(n.querySelectorAll(Gn)).some((r) => !ft(r)) ? "token" : "expression";
5652
5675
  }, Kn = (e) => {
5653
- const t = zo(e), n = mn(t);
5676
+ const t = Wo(e), n = mn(t);
5654
5677
  if (n) {
5655
- const r = fu(t, n);
5678
+ const r = vu(t, n);
5656
5679
  return r ? {
5657
5680
  type: "element",
5658
5681
  quality: "semantic-token",
@@ -5674,24 +5697,24 @@ var Kl = /* @__PURE__ */ new Set([
5674
5697
  quality: e.quality === "region-fallback" ? "expression" : "semantic-token",
5675
5698
  element: e.element
5676
5699
  } : null;
5677
- }, gu = Kn, mu = () => {
5700
+ }, bu = Kn, Tu = () => {
5678
5701
  const e = /* @__PURE__ */ new WeakMap();
5679
5702
  return (t) => {
5680
- const n = zo(t), r = mn(n);
5703
+ const n = Wo(t), r = mn(n);
5681
5704
  if (!n || !r) return Kn(t);
5682
5705
  if (e.has(n)) return e.get(n) ?? null;
5683
5706
  const i = Kn(t);
5684
5707
  return e.set(n, i), i;
5685
5708
  };
5686
- }, vu = (e, t, n, r = e.mathAlignments, i = gu) => {
5709
+ }, Su = (e, t, n, r = e.mathAlignments, i = bu) => {
5687
5710
  if (t.chunkSpokenStart === null || t.chunkSpokenEnd === null) return null;
5688
5711
  let o = null;
5689
5712
  for (const s of r) {
5690
- const a = $c(s.alignment, {
5713
+ const a = Bc(s.alignment, {
5691
5714
  position: t.chunkSpokenStart,
5692
5715
  length: Math.max(1, t.chunkSpokenEnd - t.chunkSpokenStart),
5693
5716
  boundaryWord: n.word
5694
- }) || Pc(s.alignment, { boundaryWord: n.word });
5717
+ }) || zc(s.alignment, { boundaryWord: n.word });
5695
5718
  if (!a) continue;
5696
5719
  const l = i(a);
5697
5720
  if (l) {
@@ -5700,7 +5723,7 @@ var Kl = /* @__PURE__ */ new Set([
5700
5723
  }
5701
5724
  }
5702
5725
  return o;
5703
- }, Do = (e, t, n) => {
5726
+ }, jo = (e, t, n) => {
5704
5727
  if (!e || typeof document > "u" || n <= t) return null;
5705
5728
  const r = e.get(t);
5706
5729
  let i = e.get(Math.max(t, n - 1));
@@ -5712,17 +5735,17 @@ var Kl = /* @__PURE__ */ new Set([
5712
5735
  } catch {
5713
5736
  return null;
5714
5737
  }
5715
- }, yu = (e, t) => {
5738
+ }, _u = (e, t) => {
5716
5739
  if (!e.catalogAlignment || t.chunkSpokenStart === null) return null;
5717
- const n = oc(e.catalogAlignment, t.chunkSpokenStart);
5740
+ const n = cc(e.catalogAlignment, t.chunkSpokenStart);
5718
5741
  if (!n) return null;
5719
- const r = Do(e.visibleMap, n.start, n.end);
5742
+ const r = jo(e.visibleMap, n.start, n.end);
5720
5743
  return r ? {
5721
5744
  type: "range",
5722
5745
  quality: e.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
5723
5746
  range: r
5724
5747
  } : null;
5725
- }, bu = (e) => e.regionRange ? {
5748
+ }, wu = (e) => e.regionRange ? {
5726
5749
  type: "range",
5727
5750
  quality: "region",
5728
5751
  range: e.regionRange
@@ -5734,7 +5757,7 @@ var Kl = /* @__PURE__ */ new Set([
5734
5757
  if (t.length !== 1) return null;
5735
5758
  const n = t[0]?.alignment.result.fallbackTarget;
5736
5759
  return n ? e.renderedMathTargetResolver(n) : null;
5737
- }, Tu = (e, t) => e ? t.mathAlignments.filter(({ element: n }) => {
5760
+ }, ku = (e, t) => e ? t.mathAlignments.filter(({ element: n }) => {
5738
5761
  try {
5739
5762
  return e.type === "range" ? e.range.intersectsNode(n) : e.type === "element" ? e.element === n || e.element.contains(n) : e.node.parentElement?.contains(n) || !1;
5740
5763
  } catch {
@@ -5746,18 +5769,18 @@ var Kl = /* @__PURE__ */ new Set([
5746
5769
  quality: "region",
5747
5770
  confidence: 0,
5748
5771
  reason: "boundary chunk id was not found"
5749
- }), ei = (e) => e.length === 1 ? e[0].element : null, Su = (e, t) => t.length > 0 && t.every(({ element: n }) => e.mathCapabilityByElement.get(n) === "token"), _u = 3, wu = (e, t, n) => {
5772
+ }), ei = (e) => e.length === 1 ? e[0].element : null, Eu = (e, t) => t.length > 0 && t.every(({ element: n }) => e.mathCapabilityByElement.get(n) === "token"), Au = 3, Cu = (e, t, n) => {
5750
5773
  if (!t || t.type !== "range") return !1;
5751
5774
  const { startContainer: r, endContainer: i } = t.range;
5752
- return r === i && r.nodeType === _u ? !1 : n.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(r) && o.contains(i));
5753
- }, ku = (e, t) => ({
5775
+ return r === i && r.nodeType === Au ? !1 : n.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(r) && o.contains(i));
5776
+ }, xu = (e, t) => ({
5754
5777
  chunk: e,
5755
- regionTarget: bu(e),
5756
- renderedMathTargetResolver: mu(),
5757
- mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ? pu(n) : "expression"])),
5778
+ regionTarget: wu(e),
5779
+ renderedMathTargetResolver: Tu(),
5780
+ mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ? yu(n) : "expression"])),
5758
5781
  heldTokenByElement: /* @__PURE__ */ new Map()
5759
- }), Eu = (e) => {
5760
- const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id, ku(r, t)]));
5782
+ }), Iu = (e) => {
5783
+ const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id, xu(r, t)]));
5761
5784
  return {
5762
5785
  chunks: e.chunks,
5763
5786
  resolveInitial(r) {
@@ -5781,10 +5804,10 @@ var Kl = /* @__PURE__ */ new Set([
5781
5804
  resolveBoundary(r) {
5782
5805
  const i = n.get(r.chunkId);
5783
5806
  if (!i) return Zr();
5784
- const { chunk: o } = i, s = du(o, r), a = yu(o, s), l = Tu(a, o), c = (!a || l.length > 0 ? vu(o, s, r, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, h = c && c.quality === "expression" ? c : null;
5807
+ const { chunk: o } = i, s = mu(o, r), a = _u(o, s), l = ku(a, o), c = (!a || l.length > 0 ? Su(o, s, r, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, h = c && c.quality === "expression" ? c : null;
5785
5808
  if (u) {
5786
- const p = ei(l);
5787
- return p && i.heldTokenByElement.set(p, u), Ze({
5809
+ const f = ei(l);
5810
+ return f && i.heldTokenByElement.set(f, u), Ze({
5788
5811
  semanticTarget: u,
5789
5812
  expressionTarget: null,
5790
5813
  regionTarget: i.regionTarget,
@@ -5792,15 +5815,15 @@ var Kl = /* @__PURE__ */ new Set([
5792
5815
  reason: s.reason
5793
5816
  });
5794
5817
  }
5795
- if (a && (t ? !wu(i, a, l) : l.length === 0)) return Ze({
5818
+ if (a && (t ? !Cu(i, a, l) : l.length === 0)) return Ze({
5796
5819
  semanticTarget: a,
5797
5820
  expressionTarget: null,
5798
5821
  regionTarget: i.regionTarget,
5799
5822
  confidence: s.confidence,
5800
5823
  reason: s.reason
5801
5824
  });
5802
- if (Su(i, l)) {
5803
- const p = ei(l), g = p ? i.heldTokenByElement.get(p) ?? null : null;
5825
+ if (Eu(i, l)) {
5826
+ const f = ei(l), g = f ? i.heldTokenByElement.get(f) ?? null : null;
5804
5827
  return Ze({
5805
5828
  semanticTarget: g,
5806
5829
  expressionTarget: null,
@@ -5818,14 +5841,14 @@ var Kl = /* @__PURE__ */ new Set([
5818
5841
  });
5819
5842
  }
5820
5843
  };
5821
- }, Au = (e) => {
5844
+ }, Ou = (e) => {
5822
5845
  if (e.alignment?.boundaryOffsetMode) return e.alignment.boundaryOffsetMode;
5823
5846
  const t = e.mathAlignment?.speech.boundaryOffsetSpace;
5824
5847
  return t || "plain-spoken-text";
5825
- }, Cu = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
5848
+ }, Mu = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
5826
5849
  element: e.sourceElement,
5827
5850
  alignment: e.mathAlignment
5828
- }] : [], xu = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
5851
+ }] : [], Lu = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
5829
5852
  speechText: e.speechText || "",
5830
5853
  visibleText: e.visibleText || e.speechText || "",
5831
5854
  sourceElement: e.sourceElement || e.contentRoot,
@@ -5842,9 +5865,9 @@ var Kl = /* @__PURE__ */ new Set([
5842
5865
  regionRange: t.regionRange,
5843
5866
  visibleMap: t.visibleMap,
5844
5867
  catalogAlignment: t.alignment,
5845
- mathAlignments: Cu(t),
5846
- offsetSpace: Au(t)
5847
- })), Iu = [
5868
+ mathAlignments: Mu(t),
5869
+ offsetSpace: Ou(t)
5870
+ })), Ru = [
5848
5871
  "[data-pie-tts-region]",
5849
5872
  "[data-catalog-region]",
5850
5873
  "li",
@@ -5854,18 +5877,18 @@ var Kl = /* @__PURE__ */ new Set([
5854
5877
  "[role='group']",
5855
5878
  "[role='region']",
5856
5879
  "div"
5857
- ].join(","), jo = (e, t) => {
5858
- const n = e.closest(Iu);
5880
+ ].join(","), qo = (e, t) => {
5881
+ const n = e.closest(Ru);
5859
5882
  return n && t.contains(n) ? n : e;
5860
- }, Ou = (e, t, n) => {
5883
+ }, $u = (e, t, n) => {
5861
5884
  const r = /* @__PURE__ */ new Map();
5862
5885
  for (let i = t; i < n; i++) {
5863
5886
  const o = e.get(i);
5864
5887
  o && r.set(i - t, o);
5865
5888
  }
5866
5889
  return r;
5867
- }, Mu = async (e) => {
5868
- const t = bt(e.contentRoot, e.textProcessingOptions), n = await iu({
5890
+ }, Pu = async (e) => {
5891
+ const t = bt(e.contentRoot, e.textProcessingOptions), n = await lu({
5869
5892
  chunks: t.chunks,
5870
5893
  visibleText: t.visibleText,
5871
5894
  language: e.language,
@@ -5883,8 +5906,8 @@ var Kl = /* @__PURE__ */ new Set([
5883
5906
  segment: r,
5884
5907
  anchor: {
5885
5908
  sourceElement: a,
5886
- regionElement: jo(a, e.contentRoot),
5887
- visibleMap: Ou(t.map, r.visibleSpan.start, r.visibleSpan.end)
5909
+ regionElement: qo(a, e.contentRoot),
5910
+ visibleMap: $u(t.map, r.visibleSpan.start, r.visibleSpan.end)
5888
5911
  }
5889
5912
  };
5890
5913
  }
@@ -5904,8 +5927,8 @@ var Kl = /* @__PURE__ */ new Set([
5904
5927
  containsMathMarkup: t.containsMathMarkup,
5905
5928
  visibleText: t.visibleText
5906
5929
  };
5907
- }, Lu = (e, t) => {
5908
- const n = So({
5930
+ }, Nu = (e, t) => {
5931
+ const n = _o({
5909
5932
  speechText: e.spokenText,
5910
5933
  visibleText: e.spokenText
5911
5934
  });
@@ -5914,13 +5937,13 @@ var Kl = /* @__PURE__ */ new Set([
5914
5937
  visibleText: e.visibleText,
5915
5938
  sourceElement: t.sourceElement,
5916
5939
  regionElement: t.regionElement,
5917
- regionRange: Do(t.visibleMap, 0, e.visibleText.length) ?? void 0,
5940
+ regionRange: jo(t.visibleMap, 0, e.visibleText.length) ?? void 0,
5918
5941
  speechMatchesVisibleText: !0,
5919
5942
  playbackMode: n.playbackMode,
5920
5943
  alignment: n,
5921
5944
  visibleMap: t.visibleMap
5922
5945
  };
5923
- }, qo = (e, t) => {
5946
+ }, Vo = (e, t) => {
5924
5947
  const n = t.sourceElement;
5925
5948
  return {
5926
5949
  speechText: e.spokenText,
@@ -5933,7 +5956,7 @@ var Kl = /* @__PURE__ */ new Set([
5933
5956
  speechText: e.spokenText
5934
5957
  }) : void 0
5935
5958
  };
5936
- }, Ru = (e, t, n) => {
5959
+ }, Hu = (e, t, n) => {
5937
5960
  const r = t.sourceElement;
5938
5961
  return {
5939
5962
  speechText: n,
@@ -5945,15 +5968,15 @@ var Kl = /* @__PURE__ */ new Set([
5945
5968
  mathElement: r,
5946
5969
  speechText: n
5947
5970
  }) : void 0,
5948
- plainFallback: qo(e, t)
5971
+ plainFallback: Vo(e, t)
5949
5972
  };
5950
- }, $u = (e, t = {}) => e.items.map(({ segment: n, anchor: r }) => n.kind === "prose" ? Lu(n, r) : t.format === "ssml" && n.ssml ? Ru(n, r, n.ssml) : qo(n, r)), Pu = "pie-tts-control-handoff", I;
5973
+ }, Bu = (e, t = {}) => e.items.map(({ segment: n, anchor: r }) => n.kind === "prose" ? Nu(n, r) : t.format === "ssml" && n.ssml ? Hu(n, r, n.ssml) : Vo(n, r)), zu = "pie-tts-control-handoff", I;
5951
5974
  (function(e) {
5952
5975
  e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
5953
5976
  })(I || (I = {}));
5954
- var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Hu = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Nu(e.range, t.range) : e.type === "element" && t.type === "element" ? e.element === t.element : e.type === "text-range" && t.type === "text-range" ? e.node === t.node && e.startOffset === t.startOffset && e.endOffset === t.endOffset : !1, Bu = class Xn {
5977
+ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Fu = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Wu(e.range, t.range) : e.type === "element" && t.type === "element" ? e.element === t.element : e.type === "text-range" && t.type === "text-range" ? e.node === t.node && e.startOffset === t.startOffset && e.endOffset === t.endOffset : !1, Du = class Xn {
5955
5978
  constructor() {
5956
- f(this, "currentProvider", null), f(this, "provider", null), f(this, "highlightCoordinator", null), f(this, "catalogResolver", null), f(this, "state", I.IDLE), f(this, "ttsConfig", {}), f(this, "currentText", null), f(this, "currentContentElement", null), f(this, "normalizedToDOM", /* @__PURE__ */ new Map()), f(this, "listeners", /* @__PURE__ */ new Map()), f(this, "lastError", null), f(this, "speakRunId", 0), f(this, "currentBoundaryOffset", 0), f(this, "seekSegments", []), f(this, "sentenceHighlightSegments", []), f(this, "currentSeekSegmentIndex", 0), f(this, "activeSentenceStartOffset", null), f(this, "activeHighlightMode", "word"), f(this, "lastRenderedRegionTarget", null), f(this, "telemetryReporter", null), f(this, "generatedMathSpeechResolver", lu());
5979
+ p(this, "currentProvider", null), p(this, "provider", null), p(this, "highlightCoordinator", null), p(this, "catalogResolver", null), p(this, "state", I.IDLE), p(this, "ttsConfig", {}), p(this, "currentText", null), p(this, "currentContentElement", null), p(this, "normalizedToDOM", /* @__PURE__ */ new Map()), p(this, "listeners", /* @__PURE__ */ new Map()), p(this, "lastError", null), p(this, "speakRunId", 0), p(this, "currentBoundaryOffset", 0), p(this, "seekSegments", []), p(this, "sentenceHighlightSegments", []), p(this, "currentSeekSegmentIndex", 0), p(this, "activeSentenceStartOffset", null), p(this, "activeHighlightMode", "word"), p(this, "lastRenderedRegionTarget", null), p(this, "telemetryReporter", null), p(this, "generatedMathSpeechResolver", du());
5957
5980
  }
5958
5981
  debugLog(t, n) {
5959
5982
  Xn.debugEnabled && (n === void 0 ? console.debug(t) : console.debug(t, n));
@@ -6076,7 +6099,7 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6076
6099
  return t.includes("<") ? /<\s*break\b|<\s*speak\b|<\s*prosody\b|<\s*p\b|<\s*s\b/i.test(t) : !1;
6077
6100
  }
6078
6101
  isElementHidden(t) {
6079
- return uo(t);
6102
+ return ho(t);
6080
6103
  }
6081
6104
  getBoundaryStrength(t) {
6082
6105
  const n = Number(t.getAttribute("data-tts-break-ms"));
@@ -6129,8 +6152,8 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6129
6152
  for (; a; ) {
6130
6153
  const c = a, u = c.parentElement;
6131
6154
  if (u && !this.isElementHidden(u)) {
6132
- const h = this.getBoundaryAnchor(c, t), p = o.get(c);
6133
- h && p !== void 0 && h.anchor !== l && p > 0 && (r.set(p, Math.max(r.get(p) || 0, h.units)), l = h.anchor);
6155
+ const h = this.getBoundaryAnchor(c, t), f = o.get(c);
6156
+ h && f !== void 0 && h.anchor !== l && f > 0 && (r.set(f, Math.max(r.get(f) || 0, h.units)), l = h.anchor);
6134
6157
  }
6135
6158
  a = s.nextNode();
6136
6159
  }
@@ -6145,12 +6168,12 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6145
6168
  const r = Array.from(n.keys()).filter((l) => l > 0 && l < t.length).sort((l, c) => l - c), i = [];
6146
6169
  let o = 0;
6147
6170
  for (const l of r) {
6148
- const c = t.substring(o, l), u = c.match(/^\s*/)?.[0].length || 0, h = c.match(/\s*$/)?.[0].length || 0, p = o + u, g = l - h;
6149
- if (g > p) {
6150
- const m = t.substring(p, g);
6171
+ const c = t.substring(o, l), u = c.match(/^\s*/)?.[0].length || 0, h = c.match(/\s*$/)?.[0].length || 0, f = o + u, g = l - h;
6172
+ if (g > f) {
6173
+ const m = t.substring(f, g);
6151
6174
  i.push({
6152
6175
  text: m,
6153
- startOffset: p,
6176
+ startOffset: f,
6154
6177
  pauseMsAfter: this.resolvePauseMsFromUnits(n.get(l) || 0)
6155
6178
  });
6156
6179
  }
@@ -6189,7 +6212,7 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6189
6212
  }
6190
6213
  let u = a;
6191
6214
  for (const h of [...c, l]) {
6192
- const p = r.substring(u, h), g = p.match(/^\s*/)?.[0].length || 0, m = p.match(/\s*$/)?.[0].length || 0, v = u + g, y = h - m;
6215
+ const f = r.substring(u, h), g = f.match(/^\s*/)?.[0].length || 0, m = f.match(/\s*$/)?.[0].length || 0, v = u + g, y = h - m;
6193
6216
  y > v && o.push({
6194
6217
  text: r.substring(v, y),
6195
6218
  startOffset: v,
@@ -6291,7 +6314,7 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6291
6314
  if (await this.applyLanguageSettings(n), r !== this.speakRunId) return;
6292
6315
  const i = await this.resolveSpeechContent(t, n);
6293
6316
  if (r !== this.speakRunId) return;
6294
- const { contentToSpeak: o, speechText: s, highlightText: a, normalizedText: l, usedCatalogSpoken: c, speechSource: u, speechMatchesVisibleText: h, speechChunks: p } = i;
6317
+ const { contentToSpeak: o, speechText: s, highlightText: a, normalizedText: l, usedCatalogSpoken: c, speechSource: u, speechMatchesVisibleText: h, speechChunks: f } = i;
6295
6318
  this.logResolvedSpeechContent({
6296
6319
  contentToSpeak: o,
6297
6320
  speechSource: u,
@@ -6317,7 +6340,7 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6317
6340
  runId: r,
6318
6341
  highlightMode: g,
6319
6342
  contentToSpeak: s,
6320
- speechChunks: p
6343
+ speechChunks: f
6321
6344
  }), r !== this.speakRunId) return;
6322
6345
  this.setState(I.IDLE), this.clearHighlightsAndTracking();
6323
6346
  } catch (i) {
@@ -6328,7 +6351,7 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6328
6351
  }
6329
6352
  async switchProviderToBrowser(t, n) {
6330
6353
  if (!this.currentProvider) return !1;
6331
- const r = new ao(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6354
+ const r = new lo(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6332
6355
  textLength: a.length,
6333
6356
  textPreview: l.length < a.length ? `${l}…` : l
6334
6357
  } : {};
@@ -6467,9 +6490,9 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6467
6490
  context: n.catalogContext
6468
6491
  }) : null;
6469
6492
  }, a = (u, h) => {
6470
- const p = l(u);
6471
- if (p.length !== 1) return null;
6472
- const g = p[0], m = bt(g, this.getTextProcessingOptions(n.language)).visibleText || $(g.textContent || ""), v = (y) => $(y).replace(/\s+/g, "");
6493
+ const f = l(u);
6494
+ if (f.length !== 1) return null;
6495
+ const g = f[0], m = bt(g, this.getTextProcessingOptions(n.language)).visibleText || $(g.textContent || ""), v = (y) => $(y).replace(/\s+/g, "");
6473
6496
  return v(m) === v(h) ? g : null;
6474
6497
  }, l = (u) => {
6475
6498
  const h = Array.from(u.querySelectorAll("math"));
@@ -6481,27 +6504,27 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6481
6504
  return;
6482
6505
  }
6483
6506
  if (u.nodeType !== Node.ELEMENT_NODE) return;
6484
- const h = u, p = s(h);
6485
- if (p) {
6507
+ const h = u, f = s(h);
6508
+ if (f) {
6486
6509
  o();
6487
- const g = bt(h, this.getTextProcessingOptions(n.language)), m = g.visibleText || $(h.textContent || ""), v = So({
6488
- speechText: p.content,
6510
+ const g = bt(h, this.getTextProcessingOptions(n.language)), m = g.visibleText || $(h.textContent || ""), v = _o({
6511
+ speechText: f.content,
6489
6512
  visibleText: m
6490
6513
  }), y = a(h, m), S = y ? an({
6491
6514
  mathElement: y,
6492
- speechText: p.content
6515
+ speechText: f.content
6493
6516
  }) : void 0, O = S ? void 0 : l(h).map((A) => ({
6494
6517
  element: A,
6495
6518
  alignment: an({
6496
6519
  mathElement: A,
6497
- speechText: p.content
6520
+ speechText: f.content
6498
6521
  })
6499
- })), V = $(p.content);
6522
+ })), V = $(f.content);
6500
6523
  r.push({
6501
- speechText: p.content,
6524
+ speechText: f.content,
6502
6525
  visibleText: m,
6503
6526
  sourceElement: h,
6504
- regionElement: jo(h, t),
6527
+ regionElement: qo(h, t),
6505
6528
  speechMatchesVisibleText: V === m,
6506
6529
  playbackMode: v.playbackMode,
6507
6530
  alignment: v,
@@ -6520,7 +6543,7 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6520
6543
  return !t || t.providerId?.toLowerCase() === "browser" ? "plain" : t.getCapabilities?.().supportsSSML ? "ssml" : "plain";
6521
6544
  }
6522
6545
  async resolveGeneratedSpeechContent(t, n, r) {
6523
- const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Mu({
6546
+ const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Pu({
6524
6547
  contentRoot: t,
6525
6548
  language: r,
6526
6549
  mathSpeech: this.getMathSpeechOptions(),
@@ -6537,7 +6560,7 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6537
6560
  containsMathMarkup: !1,
6538
6561
  speechMatchesVisibleText: !0
6539
6562
  };
6540
- const c = $u(o, { format: i }), u = o.plainSpeechText;
6563
+ const c = Bu(o, { format: i }), u = o.plainSpeechText;
6541
6564
  return {
6542
6565
  contentToSpeak: u,
6543
6566
  speechText: u,
@@ -6610,7 +6633,7 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6610
6633
  }
6611
6634
  }
6612
6635
  highlightRenderableRegionTarget(t) {
6613
- if (!(!this.highlightCoordinator || !t || typeof document > "u") && !Hu(this.lastRenderedRegionTarget, t))
6636
+ if (!(!this.highlightCoordinator || !t || typeof document > "u") && !Fu(this.lastRenderedRegionTarget, t))
6614
6637
  try {
6615
6638
  const n = document.createRange();
6616
6639
  if (t.type === "element") n.selectNodeContents(t.element);
@@ -6661,10 +6684,10 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6661
6684
  async speakCatalogChunkOnce(t, n) {
6662
6685
  if (!this.provider) return;
6663
6686
  this.lastRenderedRegionTarget = null;
6664
- const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ? xu({
6687
+ const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ? Lu({
6665
6688
  contentRoot: r,
6666
6689
  chunks: [t]
6667
- })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? Eu({
6690
+ })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? Iu({
6668
6691
  chunks: [i],
6669
6692
  mathTokenHighlighting: o
6670
6693
  }) : null;
@@ -6678,14 +6701,14 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6678
6701
  }
6679
6702
  return;
6680
6703
  }
6681
- const a = this.provider, l = a.onWordBoundary, c = (u, h, p) => {
6704
+ const a = this.provider, l = a.onWordBoundary, c = (u, h, f) => {
6682
6705
  if (n === this.speakRunId && s && i) {
6683
6706
  const g = i.offsetSpace === "unsupported" ? "unknown" : i.offsetSpace;
6684
6707
  this.renderHighlightDecision(s.resolveBoundary({
6685
6708
  chunkId: i.id,
6686
6709
  word: u,
6687
6710
  position: h,
6688
- length: p,
6711
+ length: f,
6689
6712
  providerOffsetSpace: g
6690
6713
  }));
6691
6714
  return;
@@ -6775,7 +6798,7 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6775
6798
  this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(I.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
6776
6799
  }
6777
6800
  requestControlHandoff() {
6778
- typeof window > "u" || window.dispatchEvent(new CustomEvent(Pu, { detail: { source: "host" } }));
6801
+ typeof window > "u" || window.dispatchEvent(new CustomEvent(zu, { detail: { source: "host" } }));
6779
6802
  }
6780
6803
  isPlaying() {
6781
6804
  return this.state === I.PLAYING;
@@ -6846,14 +6869,14 @@ var Nu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6846
6869
  });
6847
6870
  }
6848
6871
  };
6849
- f(Bu, "debugEnabled", (() => {
6872
+ p(Du, "debugEnabled", (() => {
6850
6873
  try {
6851
6874
  if (typeof process < "u" && process.env?.PIE_TTS_DEBUG === "1") return !0;
6852
6875
  } catch {
6853
6876
  }
6854
6877
  return globalThis.__PIE_TTS_DEBUG__ === !0;
6855
6878
  })());
6856
- var ah = Ka({
6879
+ var hh = Xa({
6857
6880
  policy: {
6858
6881
  allowed: [],
6859
6882
  blocked: []
@@ -6864,9 +6887,9 @@ var ah = Ka({
6864
6887
  passage: []
6865
6888
  },
6866
6889
  providers: {}
6867
- }), Vo, Ie = class ee {
6890
+ }), Go, Ie = class ee {
6868
6891
  constructor() {
6869
- f(this, "elementType", "multiple-choice"), f(this, "priority", 100);
6892
+ p(this, "elementType", "multiple-choice"), p(this, "priority", 100);
6870
6893
  }
6871
6894
  canHandle(t) {
6872
6895
  return t.tagName.toLowerCase() === "multiple-choice" || t.classList.contains("multiple-choice");
@@ -6913,15 +6936,15 @@ var ah = Ka({
6913
6936
  for (const n of t.querySelectorAll(".feedback-tick")) n.setAttribute(ee.FEEDBACK_HOOK_ATTR, "true");
6914
6937
  }
6915
6938
  };
6916
- Vo = Ie;
6917
- f(Ie, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
6918
- f(Ie, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
6919
- f(Ie, "ROOT_HOOK_ATTR", "data-pie-answer-eliminator-root");
6920
- f(Ie, "FEEDBACK_HOOK_ATTR", "data-pie-answer-eliminator-feedback-tick");
6921
- f(Ie, "CHOICE_SELECTOR", `[${Vo.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
6922
- var zu = class {
6939
+ Go = Ie;
6940
+ p(Ie, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
6941
+ p(Ie, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
6942
+ p(Ie, "ROOT_HOOK_ATTR", "data-pie-answer-eliminator-root");
6943
+ p(Ie, "FEEDBACK_HOOK_ATTR", "data-pie-answer-eliminator-feedback-tick");
6944
+ p(Ie, "CHOICE_SELECTOR", `[${Go.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
6945
+ var ju = class {
6923
6946
  constructor() {
6924
- f(this, "elementType", "ebsr"), f(this, "priority", 95), f(this, "mcAdapter", new Ie());
6947
+ p(this, "elementType", "ebsr"), p(this, "priority", 95), p(this, "mcAdapter", new Ie());
6925
6948
  }
6926
6949
  canHandle(e) {
6927
6950
  return e.tagName.toLowerCase() === "ebsr" || e.querySelector("ebsr-multiple-choice") !== null;
@@ -6945,9 +6968,9 @@ var zu = class {
6945
6968
  getButtonContainer(e) {
6946
6969
  return this.mcAdapter.getButtonContainer(e);
6947
6970
  }
6948
- }, Wu = class {
6971
+ }, qu = class {
6949
6972
  constructor() {
6950
- f(this, "elementType", "inline-dropdown"), f(this, "priority", 90);
6973
+ p(this, "elementType", "inline-dropdown"), p(this, "priority", 90);
6951
6974
  }
6952
6975
  canHandle(e) {
6953
6976
  return e.tagName.toLowerCase() === "inline-dropdown" || e.querySelector('[role="combobox"]') !== null;
@@ -6971,12 +6994,12 @@ var zu = class {
6971
6994
  getButtonContainer(e) {
6972
6995
  return e;
6973
6996
  }
6974
- }, Fu = class {
6997
+ }, Vu = class {
6975
6998
  constructor() {
6976
- f(this, "adapters", void 0), this.adapters = [
6999
+ p(this, "adapters", void 0), this.adapters = [
6977
7000
  new Ie(),
6978
- new zu(),
6979
- new Wu()
7001
+ new ju(),
7002
+ new qu()
6980
7003
  ].sort((e, t) => t.priority - e.priority);
6981
7004
  }
6982
7005
  findAdapter(e) {
@@ -6999,7 +7022,7 @@ var zu = class {
6999
7022
  }
7000
7023
  }, Qe = class j {
7001
7024
  constructor() {
7002
- f(this, "name", "mask"), f(this, "highlights", /* @__PURE__ */ new Map()), f(this, "ranges", /* @__PURE__ */ new Map()), f(this, "fallbackContainers", /* @__PURE__ */ new Map());
7025
+ p(this, "name", "mask"), p(this, "highlights", /* @__PURE__ */ new Map()), p(this, "ranges", /* @__PURE__ */ new Map()), p(this, "fallbackContainers", /* @__PURE__ */ new Map());
7003
7026
  }
7004
7027
  initialize() {
7005
7028
  }
@@ -7079,15 +7102,15 @@ var zu = class {
7079
7102
  r.selectNodeContents(n), this.removeAriaAttributes(r), this.fallbackContainers.delete(t);
7080
7103
  }
7081
7104
  };
7082
- f(Qe, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-mask-highlight-");
7083
- f(Qe, "HIGHLIGHT_NAME_PREFIX", "pie-answer-masked-");
7084
- f(Qe, "FALLBACK_CLASS", "pie-answer-masked-fallback");
7085
- f(Qe, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
7086
- f(Qe, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
7087
- f(Qe, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
7105
+ p(Qe, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-mask-highlight-");
7106
+ p(Qe, "HIGHLIGHT_NAME_PREFIX", "pie-answer-masked-");
7107
+ p(Qe, "FALLBACK_CLASS", "pie-answer-masked-fallback");
7108
+ p(Qe, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
7109
+ p(Qe, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
7110
+ p(Qe, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
7088
7111
  var _e = class N {
7089
7112
  constructor() {
7090
- f(this, "name", "strikethrough"), f(this, "highlights", /* @__PURE__ */ new Map()), f(this, "ranges", /* @__PURE__ */ new Map()), f(this, "fallbackContainers", /* @__PURE__ */ new Map());
7113
+ p(this, "name", "strikethrough"), p(this, "highlights", /* @__PURE__ */ new Map()), p(this, "ranges", /* @__PURE__ */ new Map()), p(this, "fallbackContainers", /* @__PURE__ */ new Map());
7091
7114
  }
7092
7115
  initialize() {
7093
7116
  this.isSupported() || console.warn("CSS Custom Highlight API not supported, using fallback");
@@ -7179,17 +7202,17 @@ var _e = class N {
7179
7202
  return t.querySelector(`[${N.LABEL_HOOK_ATTR}="true"]`) || t.querySelector("label");
7180
7203
  }
7181
7204
  };
7182
- f(_e, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-highlight-");
7183
- f(_e, "HIGHLIGHT_NAME_PREFIX", "pie-answer-eliminated-");
7184
- f(_e, "FALLBACK_CLASS", "pie-answer-eliminator-eliminated-fallback");
7185
- f(_e, "SR_CLASS", "pie-answer-eliminator-sr-announcement");
7186
- f(_e, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
7187
- f(_e, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
7188
- f(_e, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
7189
- f(_e, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
7205
+ p(_e, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-highlight-");
7206
+ p(_e, "HIGHLIGHT_NAME_PREFIX", "pie-answer-eliminated-");
7207
+ p(_e, "FALLBACK_CLASS", "pie-answer-eliminator-eliminated-fallback");
7208
+ p(_e, "SR_CLASS", "pie-answer-eliminator-sr-announcement");
7209
+ p(_e, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
7210
+ p(_e, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
7211
+ p(_e, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
7212
+ p(_e, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
7190
7213
  var fr = class Tt {
7191
7214
  constructor(t = "strikethrough", n = "right") {
7192
- f(this, "registry", void 0), f(this, "strategy", void 0), f(this, "eliminatedChoices", /* @__PURE__ */ new Set()), f(this, "choiceElements", /* @__PURE__ */ new Map()), f(this, "choiceButtons", /* @__PURE__ */ new Map()), f(this, "choiceAdapters", /* @__PURE__ */ new Map()), f(this, "buttonAlignment", "right"), f(this, "shouldRestoreState", !0), f(this, "storeIntegration", null), this.registry = new Fu(), this.strategy = this.createStrategy(t), this.strategy.initialize(), this.buttonAlignment = n;
7215
+ p(this, "registry", void 0), p(this, "strategy", void 0), p(this, "eliminatedChoices", /* @__PURE__ */ new Set()), p(this, "choiceElements", /* @__PURE__ */ new Map()), p(this, "choiceButtons", /* @__PURE__ */ new Map()), p(this, "choiceAdapters", /* @__PURE__ */ new Map()), p(this, "buttonAlignment", "right"), p(this, "shouldRestoreState", !0), p(this, "storeIntegration", null), this.registry = new Vu(), this.strategy = this.createStrategy(t), this.strategy.initialize(), this.buttonAlignment = n;
7193
7216
  }
7194
7217
  createStrategy(t) {
7195
7218
  return t === "mask" ? new Qe() : new _e();
@@ -7331,27 +7354,27 @@ var fr = class Tt {
7331
7354
  this.cleanupButtons(), this.strategy.destroy();
7332
7355
  }
7333
7356
  };
7334
- f(fr, "TOGGLE_CLASS", "pie-answer-eliminator-toggle");
7335
- f(fr, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
7336
- var Du = /* @__PURE__ */ ba('<div style="display: none;" aria-hidden="true"></div>');
7337
- function ju(e, t) {
7357
+ p(fr, "TOGGLE_CLASS", "pie-answer-eliminator-toggle");
7358
+ p(fr, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
7359
+ var Gu = /* @__PURE__ */ Ta('<div style="display: none;" aria-hidden="true"></div>');
7360
+ function Uu(e, t) {
7338
7361
  hi(t, !0);
7339
- let n = we(t, "visible", 7, !1), r = we(t, "toolId", 7, "answerEliminator"), i = we(t, "strategy", 7, "strikethrough"), o = we(t, "alwaysOn", 7, !1), s = we(t, "buttonAlignment", 7, "right"), a = we(t, "scopeElement", 7, null), l = we(t, "elementToolStateStore", 7, null), c = we(t, "globalElementId", 7, ""), u = /* @__PURE__ */ F(null), h = /* @__PURE__ */ F(null), p = /* @__PURE__ */ F(null);
7362
+ let n = we(t, "visible", 7, !1), r = we(t, "toolId", 7, "answerEliminator"), i = we(t, "strategy", 7, "strikethrough"), o = we(t, "alwaysOn", 7, !1), s = we(t, "buttonAlignment", 7, "right"), a = we(t, "scopeElement", 7, null), l = we(t, "elementToolStateStore", 7, null), c = we(t, "globalElementId", 7, ""), u = /* @__PURE__ */ F(null), h = /* @__PURE__ */ F(null), f = /* @__PURE__ */ F(null);
7340
7363
  const g = /* @__PURE__ */ Er(() => b(h)?.toolCoordinator);
7341
7364
  let m = /* @__PURE__ */ F(null), v = /* @__PURE__ */ F(null), y = /* @__PURE__ */ F(null), S = /* @__PURE__ */ F(null), O = /* @__PURE__ */ Er(() => o() || n());
7342
7365
  Re(() => {
7343
7366
  if (b(u))
7344
- return Wa(b(u), (C) => {
7367
+ return Fa(b(u), (C) => {
7345
7368
  M(h, C, !0);
7346
7369
  });
7347
7370
  }), Re(() => {
7348
7371
  if (b(u))
7349
- return Fa(b(u), (C) => {
7350
- M(p, C, !0);
7372
+ return Da(b(u), (C) => {
7373
+ M(f, C, !0);
7351
7374
  });
7352
7375
  });
7353
7376
  function V() {
7354
- return a() || b(p)?.scopeElement || null;
7377
+ return a() || b(f)?.scopeElement || null;
7355
7378
  }
7356
7379
  function A() {
7357
7380
  if (!b(O) || !b(m)) return;
@@ -7373,10 +7396,10 @@ function ju(e, t) {
7373
7396
  !b(g) || !r() || (b(S) && b(y) && (b(S) !== b(g) || b(y) !== r()) && (b(S).unregisterTool(b(y)), M(S, null), M(y, null)), b(y) || (b(g).registerTool(r(), "Answer Eliminator", void 0, zn.MODAL), M(S, b(g), !0), M(y, r())));
7374
7397
  }), Re(() => {
7375
7398
  b(m) && l() && c() && b(m).setStoreIntegration(l(), c());
7376
- }), Aa(() => (M(m, new fr(i(), s()), !0), b(m) && l() && c() && b(m).setStoreIntegration(l(), c()), b(O) ? A() : b(m).cleanup(), () => {
7399
+ }), Ca(() => (M(m, new fr(i(), s()), !0), b(m) && l() && c() && b(m).setStoreIntegration(l(), c()), b(O) ? A() : b(m).cleanup(), () => {
7377
7400
  b(m)?.destroy(), M(m, null), b(S) && b(y) && (b(S).unregisterTool(b(y)), M(S, null), M(y, null));
7378
7401
  })), Re(() => {
7379
- const C = b(p)?.contextVersion ?? null;
7402
+ const C = b(f)?.contextVersion ?? null;
7380
7403
  if (C !== null) {
7381
7404
  if (b(v) === null) {
7382
7405
  M(v, C, !0);
@@ -7436,10 +7459,10 @@ function ju(e, t) {
7436
7459
  set globalElementId(C = "") {
7437
7460
  c(C), pe();
7438
7461
  }
7439
- }, pt = Du();
7440
- return Ia(pt, (C) => M(u, C), () => b(u)), Xi(e, pt), di(Z);
7462
+ }, pt = Gu();
7463
+ return Oa(pt, (C) => M(u, C), () => b(u)), Xi(e, pt), di(Z);
7441
7464
  }
7442
- customElements.define("pie-tool-answer-eliminator", Ra(ju, {
7465
+ customElements.define("pie-tool-answer-eliminator", $a(Uu, {
7443
7466
  visible: {
7444
7467
  attribute: "visible",
7445
7468
  type: "Boolean"
@@ -7465,7 +7488,7 @@ customElements.define("pie-tool-answer-eliminator", Ra(ju, {
7465
7488
  globalElementId: { type: "String" }
7466
7489
  }, [], [], { mode: "open" }));
7467
7490
  export {
7468
- ju as default,
7469
- Gu as n,
7470
- Vu as t
7491
+ Uu as default,
7492
+ Yu as n,
7493
+ Xu as t
7471
7494
  };