@pie-players/pie-section-player 0.3.46 → 0.3.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
- import { n as Se } from "../pie-section-player.js";
1
+ import { n as Se } from "./chunk-1287ba31.js";
2
2
  import { t as m } from "./defineProperty-Dt7ri80W-76aeaed7.js";
3
- var pa = Object.create, fi = Object.defineProperty, fa = Object.getOwnPropertyDescriptor, ga = Object.getOwnPropertyNames, ma = Object.getPrototypeOf, va = Object.prototype.hasOwnProperty, td = (t, e) => () => (e || (t((e = { exports: {} }).exports, e), t = null), e.exports), ba = (t, e, n, o) => {
4
- if (e && typeof e == "object" || typeof e == "function") for (var r = ga(e), i = 0, s = r.length, a; i < s; i++) a = r[i], !va.call(t, a) && a !== n && fi(t, a, {
3
+ var fa = Object.create, fi = Object.defineProperty, ga = Object.getOwnPropertyDescriptor, ma = Object.getOwnPropertyNames, va = Object.getPrototypeOf, ba = Object.prototype.hasOwnProperty, rd = (t, e) => () => (e || (t((e = { exports: {} }).exports, e), t = null), e.exports), ya = (t, e, n, o) => {
4
+ if (e && typeof e == "object" || typeof e == "function") for (var r = ma(e), i = 0, s = r.length, a; i < s; i++) a = r[i], !ba.call(t, a) && a !== n && fi(t, a, {
5
5
  get: ((l) => e[l]).bind(null, a),
6
- enumerable: !(o = fa(e, a)) || o.enumerable
6
+ enumerable: !(o = ga(e, a)) || o.enumerable
7
7
  });
8
8
  return t;
9
- }, ya = (t, e, n) => (n = t != null ? pa(ma(t)) : {}, ba(e || !t || !t.__esModule ? fi(n, "default", {
9
+ }, Ta = (t, e, n) => (n = t != null ? fa(va(t)) : {}, ya(e || !t || !t.__esModule ? fi(n, "default", {
10
10
  value: t,
11
11
  enumerable: !0
12
- }) : n, t)), ed = /* @__PURE__ */ ((t) => typeof Se < "u" ? Se : typeof Proxy < "u" ? new Proxy(t, { get: (e, n) => (typeof Se < "u" ? Se : e)[n] }) : t)(function(t) {
12
+ }) : n, t)), id = /* @__PURE__ */ ((t) => typeof Se < "u" ? Se : typeof Proxy < "u" ? new Proxy(t, { get: (e, n) => (typeof Se < "u" ? Se : e)[n] }) : t)(function(t) {
13
13
  if (typeof Se < "u") return Se.apply(this, arguments);
14
14
  throw Error('Calling `require` for "' + t + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
15
15
  });
@@ -17,9 +17,9 @@ if (typeof window < "u") {
17
17
  var kr, xr;
18
18
  ((kr = (xr = window).__svelte ?? (xr.__svelte = {})).v ?? (kr.v = /* @__PURE__ */ new Set())).add("5");
19
19
  }
20
- var Ie = {}, F = /* @__PURE__ */ Symbol("uninitialized"), gi = Array.isArray, Ta = Array.prototype.indexOf, $n = Array.prototype.includes, Kn = Array.from, On = Object.keys, Ln = Object.defineProperty, re = Object.getOwnPropertyDescriptor, wa = Object.getOwnPropertyDescriptors, Sa = Object.prototype, ka = Array.prototype, mi = Object.getPrototypeOf, Er = Object.isExtensible, xa = () => {
20
+ var Ie = {}, q = /* @__PURE__ */ Symbol("uninitialized"), gi = Array.isArray, wa = Array.prototype.indexOf, $n = Array.prototype.includes, Kn = Array.from, On = Object.keys, Ln = Object.defineProperty, re = Object.getOwnPropertyDescriptor, Sa = Object.getOwnPropertyDescriptors, ka = Object.prototype, xa = Array.prototype, mi = Object.getPrototypeOf, Er = Object.isExtensible, Ea = () => {
21
21
  };
22
- function Ea(t) {
22
+ function Ca(t) {
23
23
  for (var e = 0; e < t.length; e++) t[e]();
24
24
  }
25
25
  function vi() {
@@ -32,59 +32,59 @@ function vi() {
32
32
  reject: e
33
33
  };
34
34
  }
35
- var lt = 1024, ht = 2048, be = 4096, Uo = 8192, Ca = 16384, Ko = 32768, Cr = 1 << 25, Yo = 65536, Ne = 1 << 19, Aa = 1 << 20, Ye = 1 << 25, nn = 65536, Ar = 1 << 21, Ia = 1 << 22, Pn = 1 << 23, Xe = /* @__PURE__ */ Symbol("$state"), bi = /* @__PURE__ */ Symbol("legacy props"), Ma = /* @__PURE__ */ Symbol(""), wo = /* @__PURE__ */ Symbol("attributes"), $a = /* @__PURE__ */ Symbol("class"), So = /* @__PURE__ */ Symbol("style"), Tn = /* @__PURE__ */ Symbol("text"), Yn = new class extends Error {
35
+ var lt = 1024, ht = 2048, be = 4096, Uo = 8192, Aa = 16384, Ko = 32768, Cr = 1 << 25, Yo = 65536, _e = 1 << 19, Ia = 1 << 20, Ye = 1 << 25, nn = 65536, Ar = 1 << 21, Ma = 1 << 22, Pn = 1 << 23, Xe = /* @__PURE__ */ Symbol("$state"), bi = /* @__PURE__ */ Symbol("legacy props"), $a = /* @__PURE__ */ Symbol(""), wo = /* @__PURE__ */ Symbol("attributes"), Oa = /* @__PURE__ */ Symbol("class"), So = /* @__PURE__ */ Symbol("style"), Tn = /* @__PURE__ */ Symbol("text"), Yn = new class extends Error {
36
36
  constructor(...t) {
37
37
  super(...t), m(this, "name", "StaleReactionError"), m(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
38
38
  }
39
- }(), Oa = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
40
- function La() {
39
+ }(), La = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
40
+ function Pa() {
41
41
  throw new Error("https://svelte.dev/e/async_derived_orphan");
42
42
  }
43
- function Pa(t, e, n) {
43
+ function _a(t, e, n) {
44
44
  throw new Error("https://svelte.dev/e/each_key_duplicate");
45
45
  }
46
46
  function Na(t) {
47
47
  throw new Error("https://svelte.dev/e/effect_in_teardown");
48
48
  }
49
- function _a() {
49
+ function Ra() {
50
50
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
51
51
  }
52
- function Ra(t) {
52
+ function Wa(t) {
53
53
  throw new Error("https://svelte.dev/e/effect_orphan");
54
54
  }
55
- function Wa() {
55
+ function za() {
56
56
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
57
57
  }
58
- function za() {
58
+ function Ha() {
59
59
  throw new Error("https://svelte.dev/e/hydration_failed");
60
60
  }
61
- function Ha(t) {
61
+ function ja(t) {
62
62
  throw new Error("https://svelte.dev/e/props_invalid_value");
63
63
  }
64
- function ja() {
64
+ function Da() {
65
65
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
66
66
  }
67
- function Da() {
67
+ function Ba() {
68
68
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
69
69
  }
70
- function Ba() {
70
+ function qa() {
71
71
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
72
72
  }
73
73
  function Fa() {
74
74
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
75
75
  }
76
- function qa() {
76
+ function Va() {
77
77
  console.warn("https://svelte.dev/e/derived_inert");
78
78
  }
79
79
  function Xn(t) {
80
80
  console.warn("https://svelte.dev/e/hydration_mismatch");
81
81
  }
82
- function Va() {
82
+ function Ga() {
83
83
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
84
84
  }
85
- var N = !1;
86
- function Nt(t) {
87
- N = t;
85
+ var _ = !1;
86
+ function _t(t) {
87
+ _ = t;
88
88
  }
89
89
  var P;
90
90
  function Z(t) {
@@ -95,18 +95,18 @@ function Jn() {
95
95
  return Z(/* @__PURE__ */ It(P));
96
96
  }
97
97
  function hn(t) {
98
- if (N) {
98
+ if (_) {
99
99
  if (/* @__PURE__ */ It(P) !== null) throw Xn(), Ie;
100
100
  P = t;
101
101
  }
102
102
  }
103
- function Ga(t = 1) {
104
- if (N) {
103
+ function Ua(t = 1) {
104
+ if (_) {
105
105
  for (var e = t, n = P; e--; ) n = /* @__PURE__ */ It(n);
106
106
  P = n;
107
107
  }
108
108
  }
109
- function Nn(t = !0) {
109
+ function _n(t = !0) {
110
110
  for (var e = 0, n = P; ; ) {
111
111
  if (n.nodeType === 8) {
112
112
  var o = n.data;
@@ -126,11 +126,11 @@ function yi(t) {
126
126
  function Ti(t) {
127
127
  return t === this.v;
128
128
  }
129
- function Ua(t, e) {
129
+ function Ka(t, e) {
130
130
  return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function";
131
131
  }
132
132
  function wi(t) {
133
- return !Ua(t, this.v);
133
+ return !Ka(t, this.v);
134
134
  }
135
135
  var Rt = !1, Zn = !1, D = null;
136
136
  function Me(t) {
@@ -166,7 +166,7 @@ function on() {
166
166
  var Qt = [];
167
167
  function xi() {
168
168
  var t = Qt;
169
- Qt = [], Ea(t);
169
+ Qt = [], Ca(t);
170
170
  }
171
171
  function de(t) {
172
172
  if (Qt.length === 0 && !Je) {
@@ -177,7 +177,7 @@ function de(t) {
177
177
  }
178
178
  Qt.push(t);
179
179
  }
180
- function Ka() {
180
+ function Ya() {
181
181
  for (; Qt.length > 0; ) xi();
182
182
  }
183
183
  function Ei(t) {
@@ -201,9 +201,9 @@ function Ut(t, e) {
201
201
  }
202
202
  throw t;
203
203
  }
204
- var Ya = ~(ht | be | lt);
204
+ var Xa = ~(ht | be | lt);
205
205
  function W(t, e) {
206
- t.f = t.f & Ya | e;
206
+ t.f = t.f & Xa | e;
207
207
  }
208
208
  function Xo(t) {
209
209
  (t.f & 512) !== 0 || t.deps === null ? W(t, lt) : W(t, be);
@@ -214,8 +214,8 @@ function Ci(t) {
214
214
  function Ai(t, e, n) {
215
215
  (t.f & 2048) !== 0 ? e.add(t) : t.f & 4096 && n.add(t), Ci(t.deps), W(t, lt);
216
216
  }
217
- var Xa = !1, dn = !1;
218
- function Ja(t) {
217
+ var Ja = !1, dn = !1;
218
+ function Za(t) {
219
219
  var e = dn;
220
220
  try {
221
221
  return dn = !1, [t(), dn];
@@ -242,9 +242,9 @@ function S(t, e, n) {
242
242
  function d(t, e) {
243
243
  return t.get(A(t, e));
244
244
  }
245
- var Mi, _n = null, ke = null, I = null, ko = null, Y = null, xo = null, Je = !1, oo = !1, $e = null, Rn = null, $i = 0, Za = 1, Wn = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), zn = /* @__PURE__ */ new WeakMap(), pn = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), qe = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), Eo = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), wn = /* @__PURE__ */ new WeakMap(), Ve = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakSet(), ye = class Oi {
245
+ var Mi, Nn = null, ke = null, I = null, ko = null, Y = null, xo = null, Je = !1, oo = !1, $e = null, Rn = null, $i = 0, Qa = 1, Wn = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), zn = /* @__PURE__ */ new WeakMap(), pn = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), Eo = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), Nt = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), wn = /* @__PURE__ */ new WeakMap(), Ve = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakSet(), ye = class Oi {
246
246
  constructor() {
247
- Jo(this, z), m(this, "id", Za++), E(this, Wn, !1), m(this, "linked", !0), E(this, ie, null), E(this, te, null), m(this, "async_deriveds", /* @__PURE__ */ new Map()), m(this, "current", /* @__PURE__ */ new Map()), m(this, "previous", /* @__PURE__ */ new Map()), E(this, zn, /* @__PURE__ */ new Set()), E(this, pn, /* @__PURE__ */ new Set()), E(this, xe, 0), E(this, Zt, /* @__PURE__ */ new Map()), E(this, qe, null), E(this, it, []), E(this, Eo, []), E(this, pe, /* @__PURE__ */ new Set()), E(this, _t, /* @__PURE__ */ new Set()), E(this, Gt, /* @__PURE__ */ new Map()), E(this, wn, /* @__PURE__ */ new Set()), m(this, "is_fork", !1), E(this, Ve, !1), ke === null ? _n = ke = this : (S(te, ke, this), S(ie, this, ke)), ke = this;
247
+ Jo(this, z), m(this, "id", Qa++), E(this, Wn, !1), m(this, "linked", !0), E(this, ie, null), E(this, te, null), m(this, "async_deriveds", /* @__PURE__ */ new Map()), m(this, "current", /* @__PURE__ */ new Map()), m(this, "previous", /* @__PURE__ */ new Map()), E(this, zn, /* @__PURE__ */ new Set()), E(this, pn, /* @__PURE__ */ new Set()), E(this, xe, 0), E(this, Zt, /* @__PURE__ */ new Map()), E(this, Fe, null), E(this, it, []), E(this, Eo, []), E(this, pe, /* @__PURE__ */ new Set()), E(this, Nt, /* @__PURE__ */ new Set()), E(this, Gt, /* @__PURE__ */ new Map()), E(this, wn, /* @__PURE__ */ new Set()), m(this, "is_fork", !1), E(this, Ve, !1), ke === null ? Nn = ke = this : (S(te, ke, this), S(ie, this, ke)), ke = this;
248
248
  }
249
249
  skip_effect(e) {
250
250
  d(Gt, this).has(e) || d(Gt, this).set(e, {
@@ -262,7 +262,7 @@ var Mi, _n = null, ke = null, I = null, ko = null, Y = null, xo = null, Je = !1,
262
262
  d(wn, this).add(e);
263
263
  }
264
264
  capture(e, n, o = !1) {
265
- e.v !== F && !this.previous.has(e) && this.previous.set(e, e.v), !(e.f & 8388608) && (this.current.set(e, [n, o]), Y?.set(e, n)), this.is_fork || (e.v = n);
265
+ e.v !== q && !this.previous.has(e) && this.previous.set(e, e.v), !(e.f & 8388608) && (this.current.set(e, [n, o]), Y?.set(e, n)), this.is_fork || (e.v = n);
266
266
  }
267
267
  activate() {
268
268
  I = this;
@@ -279,7 +279,7 @@ var Mi, _n = null, ke = null, I = null, ko = null, Y = null, xo = null, Je = !1,
279
279
  }
280
280
  discard() {
281
281
  for (const e of d(pn, this)) e(this);
282
- d(pn, this).clear(), A(z, this, jn).call(this), d(qe, this)?.resolve();
282
+ d(pn, this).clear(), A(z, this, jn).call(this), d(Fe, this)?.resolve();
283
283
  }
284
284
  register_created_effect(e) {
285
285
  d(Eo, this).push(e);
@@ -301,7 +301,7 @@ var Mi, _n = null, ke = null, I = null, ko = null, Y = null, xo = null, Je = !1,
301
301
  }
302
302
  transfer_effects(e, n) {
303
303
  for (const o of e) d(pe, this).add(o);
304
- for (const o of n) d(_t, this).add(o);
304
+ for (const o of n) d(Nt, this).add(o);
305
305
  e.clear(), n.clear();
306
306
  }
307
307
  oncommit(e) {
@@ -311,7 +311,7 @@ var Mi, _n = null, ke = null, I = null, ko = null, Y = null, xo = null, Je = !1,
311
311
  d(pn, this).add(e);
312
312
  }
313
313
  settled() {
314
- return (d(qe, this) ?? S(qe, this, vi())).promise;
314
+ return (d(Fe, this) ?? S(Fe, this, vi())).promise;
315
315
  }
316
316
  static ensure() {
317
317
  if (I === null) {
@@ -329,7 +329,7 @@ var Mi, _n = null, ke = null, I = null, ko = null, Y = null, xo = null, Je = !1,
329
329
  }
330
330
  Y = /* @__PURE__ */ new Map();
331
331
  for (const [n, [o]] of this.current) Y.set(n, o);
332
- for (let n = _n; n !== null; n = d(te, n)) if (!(n === this || n.is_fork)) {
332
+ for (let n = Nn; n !== null; n = d(te, n)) if (!(n === this || n.is_fork)) {
333
333
  var e = !1;
334
334
  if (n.id < this.id) {
335
335
  for (const [o, [, r]] of n.current) if (!r && this.current.has(o)) {
@@ -348,7 +348,7 @@ var Mi, _n = null, ke = null, I = null, ko = null, Y = null, xo = null, Je = !1,
348
348
  for (var n = e; n.parent !== null; ) {
349
349
  n = n.parent;
350
350
  var o = n.f;
351
- if ($e !== null && n === C && (Rt || (M === null || (M.f & 2) === 0) && !Xa)) return;
351
+ if ($e !== null && n === C && (Rt || (M === null || (M.f & 2) === 0) && !Ja)) return;
352
352
  if ((o & 96) !== 0) {
353
353
  if ((o & 1024) === 0) return;
354
354
  n.f ^= lt;
@@ -373,16 +373,16 @@ function Ir() {
373
373
  return !1;
374
374
  }
375
375
  function Hn() {
376
- S(Wn, this, !0), $i++ > 1e3 && (A(z, this, jn).call(this), nl());
377
- for (const a of d(pe, this)) d(_t, this).delete(a), W(a, ht), this.schedule(a);
378
- for (const a of d(_t, this)) W(a, be), this.schedule(a);
376
+ S(Wn, this, !0), $i++ > 1e3 && (A(z, this, jn).call(this), ol());
377
+ for (const a of d(pe, this)) d(Nt, this).delete(a), W(a, ht), this.schedule(a);
378
+ for (const a of d(Nt, this)) W(a, be), this.schedule(a);
379
379
  const t = d(it, this);
380
380
  S(it, this, []), this.apply();
381
381
  var e = $e = [], n = [], o = Rn = [];
382
382
  for (const a of t) try {
383
383
  A(z, this, Li).call(this, a, e, n);
384
384
  } catch (l) {
385
- throw _i(a), A(z, this, Ir).call(this) || this.discard(), l;
385
+ throw Ni(a), A(z, this, Ir).call(this) || this.discard(), l;
386
386
  }
387
387
  if (I = null, o.length > 0) {
388
388
  var r = Mi.ensure();
@@ -390,20 +390,20 @@ function Hn() {
390
390
  }
391
391
  if ($e = null, Rn = null, A(z, this, Ir).call(this)) {
392
392
  A(z, this, Ge).call(this, n), A(z, this, Ge).call(this, e);
393
- for (const [a, l] of d(Gt, this)) Ni(a, l);
393
+ for (const [a, l] of d(Gt, this)) _i(a, l);
394
394
  o.length > 0 && A(z, I, Hn).call(I);
395
395
  return;
396
396
  }
397
- const i = A(z, this, Qa).call(this);
397
+ const i = A(z, this, tl).call(this);
398
398
  if (i) {
399
- A(z, this, Ge).call(this, n), A(z, this, Ge).call(this, e), A(z, i, tl).call(i, this);
399
+ A(z, this, Ge).call(this, n), A(z, this, Ge).call(this, e), A(z, i, el).call(i, this);
400
400
  return;
401
401
  }
402
- d(pe, this).clear(), d(_t, this).clear();
402
+ d(pe, this).clear(), d(Nt, this).clear();
403
403
  for (const a of d(zn, this)) a(this);
404
- d(zn, this).clear(), ko = this, Mr(n), Mr(e), ko = null, d(qe, this)?.resolve();
404
+ d(zn, this).clear(), ko = this, Mr(n), Mr(e), ko = null, d(Fe, this)?.resolve();
405
405
  var s = I;
406
- if (d(xe, this) === 0 && (d(it, this).length === 0 || s !== null) && (A(z, this, jn).call(this), Rt && (A(z, this, el).call(this), I = s)), d(it, this).length > 0) if (s !== null) {
406
+ if (d(xe, this) === 0 && (d(it, this).length === 0 || s !== null) && (A(z, this, jn).call(this), Rt && (A(z, this, nl).call(this), I = s)), d(it, this).length > 0) if (s !== null) {
407
407
  const a = s;
408
408
  d(it, a).push(...d(it, this).filter((l) => !d(it, a).includes(l)));
409
409
  } else s = this;
@@ -414,7 +414,7 @@ function Li(t, e, n) {
414
414
  for (var o = t.first; o !== null; ) {
415
415
  var r = o.f, i = (r & 96) !== 0;
416
416
  if (!(i && (r & 1024) !== 0 || (r & 8192) !== 0 || d(Gt, this).has(o)) && o.fn !== null) {
417
- i ? o.f ^= lt : (r & 4) !== 0 ? e.push(o) : Rt && (r & 16777224) !== 0 ? n.push(o) : rn(o) && (r & 16 && d(_t, this).add(o), Le(o));
417
+ i ? o.f ^= lt : (r & 4) !== 0 ? e.push(o) : Rt && (r & 16777224) !== 0 ? n.push(o) : rn(o) && (r & 16 && d(Nt, this).add(o), Le(o));
418
418
  var s = o.first;
419
419
  if (s !== null) {
420
420
  o = s;
@@ -431,7 +431,7 @@ function Li(t, e, n) {
431
431
  }
432
432
  }
433
433
  }
434
- function Qa() {
434
+ function tl() {
435
435
  for (var t = d(ie, this); t !== null; ) {
436
436
  if (!t.is_fork) {
437
437
  for (const [e, [, n]] of this.current) if (t.current.has(e) && !n) return t;
@@ -440,13 +440,13 @@ function Qa() {
440
440
  }
441
441
  return null;
442
442
  }
443
- function tl(t) {
443
+ function el(t) {
444
444
  for (const [n, o] of t.current) !this.previous.has(n) && t.previous.has(n) && this.previous.set(n, t.previous.get(n)), this.current.set(n, o);
445
445
  for (const [n, o] of t.async_deriveds) {
446
446
  const r = this.async_deriveds.get(n);
447
447
  r && o.promise.then(r.resolve).catch(r.reject);
448
448
  }
449
- this.transfer_effects(d(pe, t), d(_t, t));
449
+ this.transfer_effects(d(pe, t), d(Nt, t));
450
450
  const e = (n) => {
451
451
  var o = n.reactions;
452
452
  if (o !== null) for (const s of o) {
@@ -454,7 +454,7 @@ function tl(t) {
454
454
  if ((r & 2) !== 0) e(s);
455
455
  else {
456
456
  var i = s;
457
- r & 4194320 && !this.async_deriveds.has(i) && (d(_t, this).delete(i), W(i, ht), this.schedule(i));
457
+ r & 4194320 && !this.async_deriveds.has(i) && (d(Nt, this).delete(i), W(i, ht), this.schedule(i));
458
458
  }
459
459
  }
460
460
  };
@@ -462,10 +462,10 @@ function tl(t) {
462
462
  this.oncommit(() => t.discard()), A(z, t, jn).call(t), I = this, A(z, this, Hn).call(this);
463
463
  }
464
464
  function Ge(t) {
465
- for (var e = 0; e < t.length; e += 1) Ai(t[e], d(pe, this), d(_t, this));
465
+ for (var e = 0; e < t.length; e += 1) Ai(t[e], d(pe, this), d(Nt, this));
466
466
  }
467
- function el() {
468
- for (let c = _n; c !== null; c = d(te, c)) {
467
+ function nl() {
468
+ for (let c = Nn; c !== null; c = d(te, c)) {
469
469
  var t = c.id < this.id, e = [];
470
470
  for (const [u, [h, p]] of this.current) {
471
471
  if (c.current.has(u)) {
@@ -508,7 +508,7 @@ function el() {
508
508
  function jn() {
509
509
  if (this.linked) {
510
510
  var t = d(ie, this), e = d(te, this);
511
- t === null ? _n = e : S(te, t, e), e === null ? ke = t : S(ie, e, t), this.linked = !1;
511
+ t === null ? Nn = e : S(te, t, e), e === null ? ke = t : S(ie, e, t), this.linked = !1;
512
512
  }
513
513
  }
514
514
  function Sn(t) {
@@ -517,16 +517,16 @@ function Sn(t) {
517
517
  try {
518
518
  var n;
519
519
  for (t && (I !== null && !I.is_fork && I.flush(), n = t()); ; ) {
520
- if (Ka(), I === null) return n;
520
+ if (Ya(), I === null) return n;
521
521
  I.flush();
522
522
  }
523
523
  } finally {
524
524
  Je = e;
525
525
  }
526
526
  }
527
- function nl() {
527
+ function ol() {
528
528
  try {
529
- Wa();
529
+ za();
530
530
  } catch (t) {
531
531
  Ut(t, xo);
532
532
  }
@@ -573,17 +573,17 @@ function Zo(t, e, n) {
573
573
  function Qo(t) {
574
574
  I.schedule(t);
575
575
  }
576
- function Ni(t, e) {
576
+ function _i(t, e) {
577
577
  if (!((t.f & 32) !== 0 && (t.f & 1024) !== 0)) {
578
578
  (t.f & 2048) !== 0 ? e.d.push(t) : t.f & 4096 && e.m.push(t), W(t, lt);
579
- for (var n = t.first; n !== null; ) Ni(n, e), n = n.next;
579
+ for (var n = t.first; n !== null; ) _i(n, e), n = n.next;
580
580
  }
581
581
  }
582
- function _i(t) {
582
+ function Ni(t) {
583
583
  W(t, lt);
584
- for (var e = t.first; e !== null; ) _i(e), e = e.next;
584
+ for (var e = t.first; e !== null; ) Ni(e), e = e.next;
585
585
  }
586
- function ol(t) {
586
+ function rl(t) {
587
587
  let e = 0, n = fe(0), o;
588
588
  return () => {
589
589
  ir() && (y(n), sr(() => (e === 0 && (o = ur(() => t(() => Ze(n)))), e += 1, () => {
@@ -593,28 +593,28 @@ function ol(t) {
593
593
  })));
594
594
  };
595
595
  }
596
- var rl = Yo | Ne;
597
- function il(t, e, n, o) {
598
- new sl(t, e, n, o);
596
+ var il = Yo | _e;
597
+ function sl(t, e, n, o) {
598
+ new al(t, e, n, o);
599
599
  }
600
- var bt = /* @__PURE__ */ new WeakMap(), Co = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), fn = /* @__PURE__ */ new WeakMap(), Ao = /* @__PURE__ */ new WeakMap(), Io = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), $r = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakSet(), sl = class {
600
+ var bt = /* @__PURE__ */ new WeakMap(), Co = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), fn = /* @__PURE__ */ new WeakMap(), Ao = /* @__PURE__ */ new WeakMap(), Io = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), $r = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakSet(), al = class {
601
601
  constructor(t, e, n, o) {
602
- Jo(this, U), m(this, "parent", void 0), m(this, "is_pending", !1), m(this, "transform_error", void 0), E(this, bt, void 0), E(this, Co, N ? P : null), E(this, Et, void 0), E(this, Qe, void 0), E(this, st, void 0), E(this, Ct, null), E(this, nt, null), E(this, mt, null), E(this, se, null), E(this, Ee, 0), E(this, ae, 0), E(this, fn, !1), E(this, Ao, /* @__PURE__ */ new Set()), E(this, Io, /* @__PURE__ */ new Set()), E(this, Xt, null), E(this, $r, ol(() => (S(Xt, this, fe(d(Ee, this))), () => {
602
+ Jo(this, U), m(this, "parent", void 0), m(this, "is_pending", !1), m(this, "transform_error", void 0), E(this, bt, void 0), E(this, Co, _ ? P : null), E(this, Et, void 0), E(this, Qe, void 0), E(this, st, void 0), E(this, Ct, null), E(this, nt, null), E(this, mt, null), E(this, se, null), E(this, Ee, 0), E(this, ae, 0), E(this, fn, !1), E(this, Ao, /* @__PURE__ */ new Set()), E(this, Io, /* @__PURE__ */ new Set()), E(this, Xt, null), E(this, $r, rl(() => (S(Xt, this, fe(d(Ee, this))), () => {
603
603
  S(Xt, this, null);
604
604
  }))), S(bt, this, t), S(Et, this, e), S(Qe, this, (r) => {
605
605
  var i = C;
606
606
  i.b = this, i.f |= 128, n(r);
607
607
  }), this.parent = C.b, this.transform_error = o ?? this.parent?.transform_error ?? ((r) => r), S(st, this, ar(() => {
608
- if (N) {
608
+ if (_) {
609
609
  const r = d(Co, this);
610
610
  Jn();
611
611
  const i = r.data === "[!";
612
612
  if (r.data.startsWith("[?")) {
613
613
  const s = JSON.parse(r.data.slice(2));
614
- A(U, this, ll).call(this, s);
615
- } else i ? A(U, this, cl).call(this) : A(U, this, al).call(this);
614
+ A(U, this, cl).call(this, s);
615
+ } else i ? A(U, this, ul).call(this) : A(U, this, ll).call(this);
616
616
  } else A(U, this, Ri).call(this);
617
- }, rl)), N && S(bt, this, P);
617
+ }, il)), _ && S(bt, this, P);
618
618
  }
619
619
  defer_effect(t) {
620
620
  Ai(t, d(Ao, this), d(Io, this));
@@ -640,21 +640,21 @@ var bt = /* @__PURE__ */ new WeakMap(), Co = /* @__PURE__ */ new WeakMap(), Et =
640
640
  })) : A(U, this, Or).call(this, t);
641
641
  }
642
642
  };
643
- function al() {
643
+ function ll() {
644
644
  try {
645
645
  S(Ct, this, ct(() => d(Qe, this).call(this, d(bt, this))));
646
646
  } catch (t) {
647
647
  this.error(t);
648
648
  }
649
649
  }
650
- function ll(t) {
650
+ function cl(t) {
651
651
  const e = d(Et, this).failed;
652
652
  e && S(mt, this, ct(() => {
653
653
  e(d(bt, this), () => t, () => () => {
654
654
  });
655
655
  }));
656
656
  }
657
- function cl() {
657
+ function ul() {
658
658
  const t = d(Et, this).pending;
659
659
  t && (this.is_pending = !0, S(nt, this, ct(() => t(d(bt, this)))), de(() => {
660
660
  var e = S(se, this, document.createDocumentFragment()), n = yt();
@@ -704,13 +704,13 @@ function Wi(t, e) {
704
704
  }), d(se, this) && (d(bt, this).before(d(se, this)), S(se, this, null)));
705
705
  }
706
706
  function Or(t) {
707
- d(Ct, this) && (X(d(Ct, this)), S(Ct, this, null)), d(nt, this) && (X(d(nt, this)), S(nt, this, null)), d(mt, this) && (X(d(mt, this)), S(mt, this, null)), N && (Z(d(Co, this)), Ga(), Z(Nn()));
707
+ d(Ct, this) && (X(d(Ct, this)), S(Ct, this, null)), d(nt, this) && (X(d(nt, this)), S(nt, this, null)), d(mt, this) && (X(d(mt, this)), S(mt, this, null)), _ && (Z(d(Co, this)), Ua(), Z(_n()));
708
708
  var e = d(Et, this).onerror;
709
709
  let n = d(Et, this).failed;
710
710
  var o = !1, r = !1;
711
711
  const i = () => {
712
712
  if (o) {
713
- Va();
713
+ Ga();
714
714
  return;
715
715
  }
716
716
  o = !0, r && Fa(), d(mt, this) !== null && Te(d(mt, this), () => {
@@ -746,14 +746,14 @@ function Or(t) {
746
746
  a !== null && typeof a == "object" && typeof a.then == "function" ? a.then(s, (l) => Ut(l, d(st, this) && d(st, this).parent)) : s(a);
747
747
  });
748
748
  }
749
- function ul(t, e, n, o) {
749
+ function hl(t, e, n, o) {
750
750
  const r = on() ? tn : er;
751
751
  var i = t.filter((p) => !p.settled);
752
752
  if (n.length === 0 && i.length === 0) {
753
753
  o(e.map(r));
754
754
  return;
755
755
  }
756
- var s = C, a = hl(), l = i.length === 1 ? i[0].promise : i.length > 1 ? Promise.all(i.map((p) => p.promise)) : null;
756
+ var s = C, a = dl(), l = i.length === 1 ? i[0].promise : i.length > 1 ? Promise.all(i.map((p) => p.promise)) : null;
757
757
  function c(p) {
758
758
  if ((s.f & 16384) === 0) {
759
759
  a();
@@ -771,13 +771,13 @@ function ul(t, e, n, o) {
771
771
  return;
772
772
  }
773
773
  function h() {
774
- Promise.all(n.map((p) => /* @__PURE__ */ dl(p))).then((p) => c([...e.map(r), ...p])).catch((p) => Ut(p, s)).finally(u);
774
+ Promise.all(n.map((p) => /* @__PURE__ */ pl(p))).then((p) => c([...e.map(r), ...p])).catch((p) => Ut(p, s)).finally(u);
775
775
  }
776
776
  l ? l.then(() => {
777
777
  a(), h(), Dn();
778
778
  }) : h();
779
779
  }
780
- function hl() {
780
+ function dl() {
781
781
  var t = C, e = M, n = D, o = I;
782
782
  return function(r = !0) {
783
783
  At(t), ut(e), Me(n), r && !(t.f & 16384) && (o?.activate(), o?.apply());
@@ -795,7 +795,7 @@ function zi() {
795
795
  // @__NO_SIDE_EFFECTS__
796
796
  function tn(t) {
797
797
  var e = 2 | ht;
798
- return C !== null && (C.f |= Ne), {
798
+ return C !== null && (C.f |= _e), {
799
799
  ctx: D,
800
800
  deps: null,
801
801
  effects: null,
@@ -804,7 +804,7 @@ function tn(t) {
804
804
  fn: t,
805
805
  reactions: null,
806
806
  rv: 0,
807
- v: F,
807
+ v: q,
808
808
  wv: 0,
809
809
  parent: C,
810
810
  ac: null
@@ -812,11 +812,11 @@ function tn(t) {
812
812
  }
813
813
  var gn = /* @__PURE__ */ Symbol("obsolete");
814
814
  // @__NO_SIDE_EFFECTS__
815
- function dl(t, e, n) {
815
+ function pl(t, e, n) {
816
816
  let o = C;
817
- o === null && La();
818
- var r = void 0, i = fe(F), s = !M, a = /* @__PURE__ */ new Set();
819
- return wl(() => {
817
+ o === null && Pa();
818
+ var r = void 0, i = fe(q), s = !M, a = /* @__PURE__ */ new Set();
819
+ return Sl(() => {
820
820
  var l = C, c = vi();
821
821
  r = c.promise;
822
822
  try {
@@ -837,7 +837,7 @@ function dl(t, e, n) {
837
837
  h?.(), a.delete(c), v !== gn && (u.activate(), v ? (i.f |= Pn, Oe(i, v)) : (i.f & 8388608 && (i.f ^= Pn), Oe(i, f)), u.deactivate());
838
838
  };
839
839
  c.promise.then(p, (f) => p(null, f || "unknown"));
840
- }), bl(() => {
840
+ }), yl(() => {
841
841
  for (const l of a) l.reject(gn);
842
842
  }), new Promise((l) => {
843
843
  function c(u) {
@@ -859,7 +859,7 @@ function er(t) {
859
859
  const e = /* @__PURE__ */ tn(t);
860
860
  return e.equals = wi, e;
861
861
  }
862
- function pl(t) {
862
+ function fl(t) {
863
863
  var e = t.effects;
864
864
  if (e !== null) {
865
865
  t.effects = null;
@@ -868,10 +868,10 @@ function pl(t) {
868
868
  }
869
869
  function nr(t) {
870
870
  var e, n = C, o = t.parent;
871
- if (!Wt && o !== null && t.v !== F && (o.f & 24576) !== 0) return qa(), t.v;
871
+ if (!Wt && o !== null && t.v !== q && (o.f & 24576) !== 0) return Va(), t.v;
872
872
  At(o);
873
873
  try {
874
- t.f &= ~nn, pl(t), e = ss(t);
874
+ t.f &= ~nn, fl(t), e = ss(t);
875
875
  } finally {
876
876
  At(n);
877
877
  }
@@ -885,8 +885,8 @@ function Hi(t) {
885
885
  }
886
886
  Wt || (Y !== null ? (ir() || I?.is_fork) && Y.set(t, e) : Xo(t));
887
887
  }
888
- function fl(t) {
889
- if (t.effects !== null) for (const e of t.effects) (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Yn), e.fn !== null && (e.teardown = xa), e.ac = null, en(e, 0), lr(e));
888
+ function gl(t) {
889
+ if (t.effects !== null) for (const e of t.effects) (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Yn), e.fn !== null && (e.teardown = Ea), e.ac = null, en(e, 0), lr(e));
890
890
  }
891
891
  function ji(t) {
892
892
  if (t.effects !== null) for (const e of t.effects) e.teardown && e.fn !== null && Le(e);
@@ -903,7 +903,7 @@ function fe(t, e) {
903
903
  };
904
904
  }
905
905
  // @__NO_SIDE_EFFECTS__
906
- function q(t, e) {
906
+ function F(t, e) {
907
907
  const n = fe(t, e);
908
908
  return ns(n), n;
909
909
  }
@@ -917,7 +917,7 @@ function Bi(t, e = !1, n = !0) {
917
917
  return o;
918
918
  }
919
919
  function O(t, e, n = !1) {
920
- return M !== null && (!vt || M.f & 131072) && on() && M.f & 4325394 && (Tt === null || !Tt.has(t)) && Ba(), Oe(t, n ? ee(e) : e, Rn);
920
+ return M !== null && (!vt || M.f & 131072) && on() && M.f & 4325394 && (Tt === null || !Tt.has(t)) && qa(), Oe(t, n ? ee(e) : e, Rn);
921
921
  }
922
922
  function Oe(t, e, n = null) {
923
923
  if (!t.equals(e)) {
@@ -927,11 +927,11 @@ function Oe(t, e, n = null) {
927
927
  const r = t;
928
928
  t.f & 2048 && nr(r), Y === null && Xo(r);
929
929
  }
930
- t.wv = rs(), Fi(t, ht, n), on() && C !== null && C.f & 1024 && !(C.f & 96) && (rt === null ? El([t]) : rt.push(t)), !o.is_fork && Bn.size > 0 && !Di && gl();
930
+ t.wv = rs(), qi(t, ht, n), on() && C !== null && C.f & 1024 && !(C.f & 96) && (rt === null ? Cl([t]) : rt.push(t)), !o.is_fork && Bn.size > 0 && !Di && ml();
931
931
  }
932
932
  return e;
933
933
  }
934
- function gl() {
934
+ function ml() {
935
935
  Di = !1;
936
936
  for (const t of Bn) {
937
937
  t.f & 1024 && W(t, be);
@@ -948,7 +948,7 @@ function gl() {
948
948
  function Ze(t) {
949
949
  O(t, t.v + 1);
950
950
  }
951
- function Fi(t, e, n) {
951
+ function qi(t, e, n) {
952
952
  var o = t.reactions;
953
953
  if (o !== null) for (var r = on(), i = o.length, s = 0; s < i; s++) {
954
954
  var a = o[s], l = a.f;
@@ -957,7 +957,7 @@ function Fi(t, e, n) {
957
957
  if (c && W(a, e), (l & 131072) !== 0) Bn.add(a);
958
958
  else if ((l & 2) !== 0) {
959
959
  var u = a;
960
- Y?.delete(u), !(l & 65536) && (l & 512 && (C === null || !(C.f & 2097152)) && (a.f |= nn), Fi(u, be, n));
960
+ Y?.delete(u), !(l & 65536) && (l & 512 && (C === null || !(C.f & 2097152)) && (a.f |= nn), qi(u, be, n));
961
961
  } else if (c) {
962
962
  var h = a;
963
963
  l & 16 && xt !== null && xt.add(h), n !== null ? n.push(h) : Qo(h);
@@ -968,20 +968,20 @@ function Fi(t, e, n) {
968
968
  function ee(t) {
969
969
  if (typeof t != "object" || t === null || Xe in t) return t;
970
970
  const e = mi(t);
971
- if (e !== Sa && e !== ka) return t;
972
- var n = /* @__PURE__ */ new Map(), o = gi(t), r = /* @__PURE__ */ q(0), i = null, s = ce, a = (l) => {
971
+ if (e !== ka && e !== xa) return t;
972
+ var n = /* @__PURE__ */ new Map(), o = gi(t), r = /* @__PURE__ */ F(0), i = null, s = ce, a = (l) => {
973
973
  if (ce === s) return l();
974
974
  var c = M, u = ce;
975
- ut(null), _r(s);
975
+ ut(null), Nr(s);
976
976
  var h = l();
977
- return ut(c), _r(u), h;
977
+ return ut(c), Nr(u), h;
978
978
  };
979
- return o && n.set("length", /* @__PURE__ */ q(t.length, i)), new Proxy(t, {
979
+ return o && n.set("length", /* @__PURE__ */ F(t.length, i)), new Proxy(t, {
980
980
  defineProperty(l, c, u) {
981
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && ja();
981
+ (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Da();
982
982
  var h = n.get(c);
983
983
  return h === void 0 ? a(() => {
984
- var p = /* @__PURE__ */ q(u.value, i);
984
+ var p = /* @__PURE__ */ F(u.value, i);
985
985
  return n.set(c, p), p;
986
986
  }) : O(h, u.value, !0), !0;
987
987
  },
@@ -989,18 +989,18 @@ function ee(t) {
989
989
  var u = n.get(c);
990
990
  if (u === void 0) {
991
991
  if (c in l) {
992
- const h = a(() => /* @__PURE__ */ q(F, i));
992
+ const h = a(() => /* @__PURE__ */ F(q, i));
993
993
  n.set(c, h), Ze(r);
994
994
  }
995
- } else O(u, F), Ze(r);
995
+ } else O(u, q), Ze(r);
996
996
  return !0;
997
997
  },
998
998
  get(l, c, u) {
999
999
  if (c === Xe) return t;
1000
1000
  var h = n.get(c), p = c in l;
1001
- if (h === void 0 && (!p || re(l, c)?.writable) && (h = a(() => /* @__PURE__ */ q(ee(p ? l[c] : F), i)), n.set(c, h)), h !== void 0) {
1001
+ if (h === void 0 && (!p || re(l, c)?.writable) && (h = a(() => /* @__PURE__ */ F(ee(p ? l[c] : q), i)), n.set(c, h)), h !== void 0) {
1002
1002
  var f = y(h);
1003
- return f === F ? void 0 : f;
1003
+ return f === q ? void 0 : f;
1004
1004
  }
1005
1005
  return Reflect.get(l, c, u);
1006
1006
  },
@@ -1011,7 +1011,7 @@ function ee(t) {
1011
1011
  h && (u.value = y(h));
1012
1012
  } else if (u === void 0) {
1013
1013
  var p = n.get(c), f = p?.v;
1014
- if (p !== void 0 && f !== F) return {
1014
+ if (p !== void 0 && f !== q) return {
1015
1015
  enumerable: !0,
1016
1016
  configurable: !0,
1017
1017
  value: f,
@@ -1022,18 +1022,18 @@ function ee(t) {
1022
1022
  },
1023
1023
  has(l, c) {
1024
1024
  if (c === Xe) return !0;
1025
- var u = n.get(c), h = u !== void 0 && u.v !== F || Reflect.has(l, c);
1026
- return (u !== void 0 || C !== null && (!h || re(l, c)?.writable)) && (u === void 0 && (u = a(() => /* @__PURE__ */ q(h ? ee(l[c]) : F, i)), n.set(c, u)), y(u) === F) ? !1 : h;
1025
+ var u = n.get(c), h = u !== void 0 && u.v !== q || Reflect.has(l, c);
1026
+ return (u !== void 0 || C !== null && (!h || re(l, c)?.writable)) && (u === void 0 && (u = a(() => /* @__PURE__ */ F(h ? ee(l[c]) : q, i)), n.set(c, u)), y(u) === q) ? !1 : h;
1027
1027
  },
1028
1028
  set(l, c, u, h) {
1029
1029
  var p = n.get(c), f = c in l;
1030
1030
  if (o && c === "length") for (var v = u; v < p.v; v += 1) {
1031
1031
  var b = n.get(v + "");
1032
- b !== void 0 ? O(b, F) : v in l && (b = a(() => /* @__PURE__ */ q(F, i)), n.set(v + "", b));
1032
+ b !== void 0 ? O(b, q) : v in l && (b = a(() => /* @__PURE__ */ F(q, i)), n.set(v + "", b));
1033
1033
  }
1034
- if (p === void 0) (!f || re(l, c)?.writable) && (p = a(() => /* @__PURE__ */ q(void 0, i)), O(p, ee(u)), n.set(c, p));
1034
+ if (p === void 0) (!f || re(l, c)?.writable) && (p = a(() => /* @__PURE__ */ F(void 0, i)), O(p, ee(u)), n.set(c, p));
1035
1035
  else {
1036
- f = p.v !== F;
1036
+ f = p.v !== q;
1037
1037
  var g = a(() => ee(u));
1038
1038
  O(p, g);
1039
1039
  }
@@ -1051,22 +1051,22 @@ function ee(t) {
1051
1051
  y(r);
1052
1052
  var c = Reflect.ownKeys(l).filter((p) => {
1053
1053
  var f = n.get(p);
1054
- return f === void 0 || f.v !== F;
1054
+ return f === void 0 || f.v !== q;
1055
1055
  });
1056
- for (var [u, h] of n) h.v !== F && !(u in l) && c.push(u);
1056
+ for (var [u, h] of n) h.v !== q && !(u in l) && c.push(u);
1057
1057
  return c;
1058
1058
  },
1059
1059
  setPrototypeOf() {
1060
- Da();
1060
+ Ba();
1061
1061
  }
1062
1062
  });
1063
1063
  }
1064
- var Lr, qi, Vi, Gi;
1064
+ var Lr, Fi, Vi, Gi;
1065
1065
  function $o() {
1066
1066
  if (Lr === void 0) {
1067
- Lr = window, qi = /Firefox/.test(navigator.userAgent);
1067
+ Lr = window, Fi = /Firefox/.test(navigator.userAgent);
1068
1068
  var t = Element.prototype, e = Node.prototype, n = Text.prototype;
1069
- Vi = re(e, "firstChild").get, Gi = re(e, "nextSibling").get, Er(t) && (t[$a] = void 0, t[wo] = null, t[So] = void 0, t.__e = void 0), Er(n) && (n[Tn] = void 0);
1069
+ Vi = re(e, "firstChild").get, Gi = re(e, "nextSibling").get, Er(t) && (t[Oa] = void 0, t[wo] = null, t[So] = void 0, t.__e = void 0), Er(n) && (n[Tn] = void 0);
1070
1070
  }
1071
1071
  }
1072
1072
  function yt(t = "") {
@@ -1081,7 +1081,7 @@ function It(t) {
1081
1081
  return Gi.call(t);
1082
1082
  }
1083
1083
  function mn(t, e) {
1084
- if (!N) return /* @__PURE__ */ ge(t);
1084
+ if (!_) return /* @__PURE__ */ ge(t);
1085
1085
  var n = /* @__PURE__ */ ge(P);
1086
1086
  if (n === null) n = P.appendChild(yt());
1087
1087
  else if (e && n.nodeType !== 3) {
@@ -1091,7 +1091,7 @@ function mn(t, e) {
1091
1091
  return e && rr(n), Z(n), n;
1092
1092
  }
1093
1093
  function io(t, e = !1) {
1094
- if (!N) {
1094
+ if (!_) {
1095
1095
  var n = /* @__PURE__ */ ge(t);
1096
1096
  return n instanceof Comment && n.data === "" ? /* @__PURE__ */ It(n) : n;
1097
1097
  }
@@ -1105,9 +1105,9 @@ function io(t, e = !1) {
1105
1105
  return P;
1106
1106
  }
1107
1107
  function jt(t, e = 1, n = !1) {
1108
- let o = N ? P : t;
1108
+ let o = _ ? P : t;
1109
1109
  for (var r; e--; ) r = o, o = /* @__PURE__ */ It(o);
1110
- if (!N) return o;
1110
+ if (!_) return o;
1111
1111
  if (n) {
1112
1112
  if (o?.nodeType !== 3) {
1113
1113
  var i = yt();
@@ -1140,10 +1140,10 @@ function Yi(t) {
1140
1140
  ut(e), At(n);
1141
1141
  }
1142
1142
  }
1143
- function ml(t) {
1144
- C === null && (M === null && Ra(t), _a()), Wt && Na(t);
1143
+ function vl(t) {
1144
+ C === null && (M === null && Wa(t), Ra()), Wt && Na(t);
1145
1145
  }
1146
- function vl(t, e) {
1146
+ function bl(t, e) {
1147
1147
  var n = e.last;
1148
1148
  n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t);
1149
1149
  }
@@ -1177,7 +1177,7 @@ function Mt(t, e) {
1177
1177
  }
1178
1178
  r.deps === null && r.teardown === null && r.nodes === null && r.first === r.last && !(r.f & 524288) && (r = r.first, t & 16 && t & 65536 && r !== null && (r.f |= Yo));
1179
1179
  }
1180
- if (r !== null && (r.parent = n, n !== null && vl(r, n), M !== null && (M.f & 2) !== 0 && (t & 64) === 0)) {
1180
+ if (r !== null && (r.parent = n, n !== null && bl(r, n), M !== null && (M.f & 2) !== 0 && (t & 64) === 0)) {
1181
1181
  var i = M;
1182
1182
  (i.effects ?? (i.effects = [])).push(r);
1183
1183
  }
@@ -1186,12 +1186,12 @@ function Mt(t, e) {
1186
1186
  function ir() {
1187
1187
  return M !== null && !vt;
1188
1188
  }
1189
- function bl(t) {
1189
+ function yl(t) {
1190
1190
  const e = Mt(8, null);
1191
1191
  return W(e, lt), e.teardown = t, e;
1192
1192
  }
1193
1193
  function Pr(t) {
1194
- ml("$effect");
1194
+ vl("$effect");
1195
1195
  var e = C.f;
1196
1196
  if (!M && (e & 32) !== 0 && D !== null && !D.i) {
1197
1197
  var n = D;
@@ -1199,18 +1199,18 @@ function Pr(t) {
1199
1199
  } else return Xi(t);
1200
1200
  }
1201
1201
  function Xi(t) {
1202
- return Mt(4 | Aa, t);
1202
+ return Mt(4 | Ia, t);
1203
1203
  }
1204
- function yl(t) {
1204
+ function Tl(t) {
1205
1205
  ye.ensure();
1206
- const e = Mt(64 | Ne, t);
1206
+ const e = Mt(64 | _e, t);
1207
1207
  return () => {
1208
1208
  X(e);
1209
1209
  };
1210
1210
  }
1211
- function Tl(t) {
1211
+ function wl(t) {
1212
1212
  ye.ensure();
1213
- const e = Mt(64 | Ne, t);
1213
+ const e = Mt(64 | _e, t);
1214
1214
  return (n = {}) => new Promise((o) => {
1215
1215
  n.outro ? Te(e, () => {
1216
1216
  X(e), o(void 0);
@@ -1220,14 +1220,14 @@ function Tl(t) {
1220
1220
  function Ji(t) {
1221
1221
  return Mt(4, t);
1222
1222
  }
1223
- function wl(t) {
1224
- return Mt(Ia | Ne, t);
1223
+ function Sl(t) {
1224
+ return Mt(Ma | _e, t);
1225
1225
  }
1226
1226
  function sr(t, e = 0) {
1227
1227
  return Mt(8 | e, t);
1228
1228
  }
1229
1229
  function vn(t, e = [], n = [], o = []) {
1230
- ul(o, e, n, (r) => {
1230
+ hl(o, e, n, (r) => {
1231
1231
  Mt(8, () => t(...r.map(y)));
1232
1232
  });
1233
1233
  }
@@ -1235,17 +1235,17 @@ function ar(t, e = 0) {
1235
1235
  return Mt(16 | e, t);
1236
1236
  }
1237
1237
  function ct(t) {
1238
- return Mt(32 | Ne, t);
1238
+ return Mt(32 | _e, t);
1239
1239
  }
1240
1240
  function Zi(t) {
1241
1241
  var e = t.teardown;
1242
1242
  if (e !== null) {
1243
1243
  const n = Wt, o = M;
1244
- Nr(!0), ut(null);
1244
+ _r(!0), ut(null);
1245
1245
  try {
1246
1246
  e.call(null);
1247
1247
  } finally {
1248
- Nr(n), ut(o);
1248
+ _r(n), ut(o);
1249
1249
  }
1250
1250
  }
1251
1251
  }
@@ -1260,7 +1260,7 @@ function lr(t, e = !1) {
1260
1260
  (n.f & 64) !== 0 ? n.parent = null : X(n, e), n = o;
1261
1261
  }
1262
1262
  }
1263
- function Sl(t) {
1263
+ function kl(t) {
1264
1264
  for (var e = t.first; e !== null; ) {
1265
1265
  var n = e.next;
1266
1266
  !(e.f & 32) && X(e), e = n;
@@ -1268,14 +1268,14 @@ function Sl(t) {
1268
1268
  }
1269
1269
  function X(t, e = !0) {
1270
1270
  var n = !1;
1271
- (e || t.f & 262144) && t.nodes !== null && t.nodes.end !== null && (kl(t.nodes.start, t.nodes.end), n = !0), W(t, Cr), lr(t, e && !n), en(t, 0);
1271
+ (e || t.f & 262144) && t.nodes !== null && t.nodes.end !== null && (xl(t.nodes.start, t.nodes.end), n = !0), W(t, Cr), lr(t, e && !n), en(t, 0);
1272
1272
  var o = t.nodes && t.nodes.t;
1273
1273
  if (o !== null) for (const i of o) i.stop();
1274
- Zi(t), t.f ^= Cr, t.f |= Ca;
1274
+ Zi(t), t.f ^= Cr, t.f |= Aa;
1275
1275
  var r = t.parent;
1276
1276
  r !== null && r.first !== null && Qi(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = t.b = null;
1277
1277
  }
1278
- function kl(t, e) {
1278
+ function xl(t, e) {
1279
1279
  for (; t !== null; ) {
1280
1280
  var n = t === e ? null : /* @__PURE__ */ It(t);
1281
1281
  t.remove(), t = n;
@@ -1311,7 +1311,7 @@ function ts(t, e, n) {
1311
1311
  }
1312
1312
  }
1313
1313
  }
1314
- function Fn(t) {
1314
+ function qn(t) {
1315
1315
  es(t, !0);
1316
1316
  }
1317
1317
  function es(t, e) {
@@ -1331,8 +1331,8 @@ function cr(t, e) {
1331
1331
  e.append(n), n = r;
1332
1332
  }
1333
1333
  }
1334
- var xl = null, kn = !1, Wt = !1;
1335
- function Nr(t) {
1334
+ var El = null, kn = !1, Wt = !1;
1335
+ function _r(t) {
1336
1336
  Wt = t;
1337
1337
  }
1338
1338
  var M = null, vt = !1;
@@ -1348,11 +1348,11 @@ function ns(t) {
1348
1348
  M !== null && (!Rt || M.f & 2) && (Tt ?? (Tt = /* @__PURE__ */ new Set())).add(t);
1349
1349
  }
1350
1350
  var J = null, et = 0, rt = null;
1351
- function El(t) {
1351
+ function Cl(t) {
1352
1352
  rt = t;
1353
1353
  }
1354
1354
  var os = 1, ne = 0, ce = ne;
1355
- function _r(t) {
1355
+ function Nr(t) {
1356
1356
  ce = t;
1357
1357
  }
1358
1358
  function rs() {
@@ -1409,10 +1409,10 @@ function ss(t) {
1409
1409
  t.f ^= Ar, J = e, et = n, rt = o, M = r, Tt = i, Me(s), vt = a, ce = l;
1410
1410
  }
1411
1411
  }
1412
- function Cl(t, e) {
1412
+ function Al(t, e) {
1413
1413
  let n = e.reactions;
1414
1414
  if (n !== null) {
1415
- var o = Ta.call(n, t);
1415
+ var o = wa.call(n, t);
1416
1416
  if (o !== -1) {
1417
1417
  var r = n.length - 1;
1418
1418
  r === 0 ? n = e.reactions = null : (n[o] = n[r], n.pop());
@@ -1420,12 +1420,12 @@ function Cl(t, e) {
1420
1420
  }
1421
1421
  if (n === null && (e.f & 2) !== 0 && (J === null || !$n.call(J, e))) {
1422
1422
  var i = e;
1423
- i.f & 512 && (i.f ^= 512, i.f &= ~nn), i.v !== F && Xo(i), fl(i), en(i, 0);
1423
+ i.f & 512 && (i.f ^= 512, i.f &= ~nn), i.v !== q && Xo(i), gl(i), en(i, 0);
1424
1424
  }
1425
1425
  }
1426
1426
  function en(t, e) {
1427
1427
  var n = t.deps;
1428
- if (n !== null) for (var o = e; o < n.length; o++) Cl(t, n[o]);
1428
+ if (n !== null) for (var o = e; o < n.length; o++) Al(t, n[o]);
1429
1429
  }
1430
1430
  function Le(t) {
1431
1431
  var e = t.f;
@@ -1434,7 +1434,7 @@ function Le(t) {
1434
1434
  var n = C, o = kn;
1435
1435
  C = t, kn = !0;
1436
1436
  try {
1437
- (e & 16777232) !== 0 ? Sl(t) : lr(t), Zi(t);
1437
+ (e & 16777232) !== 0 ? kl(t) : lr(t), Zi(t);
1438
1438
  var r = ss(t);
1439
1439
  t.teardown = typeof r == "function" ? r : null, t.wv = os;
1440
1440
  } finally {
@@ -1444,7 +1444,7 @@ function Le(t) {
1444
1444
  }
1445
1445
  function y(t) {
1446
1446
  var e = (t.f & 2) !== 0;
1447
- if (xl?.add(t), M !== null && !vt && !(C !== null && (C.f & 16384) !== 0) && (Tt === null || !Tt.has(t))) {
1447
+ if (El?.add(t), M !== null && !vt && !(C !== null && (C.f & 16384) !== 0) && (Tt === null || !Tt.has(t))) {
1448
1448
  var n = M.deps;
1449
1449
  if ((M.f & 2097152) !== 0) t.rv < ne && (t.rv = ne, J === null && n !== null && n[et] === t ? et++ : J === null ? J = [t] : J.push(t));
1450
1450
  else {
@@ -1472,7 +1472,7 @@ function as(t) {
1472
1472
  if (t.f |= 512, t.deps !== null) for (const e of t.deps) (e.reactions ?? (e.reactions = [])).push(t), e.f & 2 && !(e.f & 512) && (ji(e), as(e));
1473
1473
  }
1474
1474
  function ls(t) {
1475
- if (t.v === F) return !0;
1475
+ if (t.v === q) return !0;
1476
1476
  if (t.deps === null) return !1;
1477
1477
  for (const e of t.deps) if (le.has(e) || (e.f & 2) !== 0 && ls(e)) return !0;
1478
1478
  return !1;
@@ -1489,7 +1489,7 @@ var Ae = /* @__PURE__ */ Symbol("events"), cs = /* @__PURE__ */ new Set(), Oo =
1489
1489
  function ze(t, e, n) {
1490
1490
  (e[Ae] ?? (e[Ae] = {}))[t] = n;
1491
1491
  }
1492
- function Al(t) {
1492
+ function Il(t) {
1493
1493
  for (var e = 0; e < t.length; e++) cs.add(t[e]);
1494
1494
  for (var n of Oo) n(t);
1495
1495
  }
@@ -1539,13 +1539,13 @@ function Wr(t) {
1539
1539
  }
1540
1540
  }
1541
1541
  }
1542
- var Il = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (t) => t });
1543
- function Ml(t) {
1544
- return Il?.createHTML(t) ?? t;
1545
- }
1542
+ var Ml = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (t) => t });
1546
1543
  function $l(t) {
1544
+ return Ml?.createHTML(t) ?? t;
1545
+ }
1546
+ function Ol(t) {
1547
1547
  var e = or("template");
1548
- return e.innerHTML = Ml(t.replaceAll("<!>", "<!---->")), e.content;
1548
+ return e.innerHTML = $l(t.replaceAll("<!>", "<!---->")), e.content;
1549
1549
  }
1550
1550
  function xn(t, e) {
1551
1551
  var n = C;
@@ -1560,9 +1560,9 @@ function xn(t, e) {
1560
1560
  function we(t, e) {
1561
1561
  var n = (e & 1) !== 0, o = (e & 2) !== 0, r, i = !t.startsWith("<!>");
1562
1562
  return () => {
1563
- if (N) return xn(P, null), P;
1564
- r === void 0 && (r = $l(i ? t : "<!>" + t), n || (r = /* @__PURE__ */ ge(r)));
1565
- var s = o || qi ? document.importNode(r, !0) : r.cloneNode(!0);
1563
+ if (_) return xn(P, null), P;
1564
+ r === void 0 && (r = Ol(i ? t : "<!>" + t), n || (r = /* @__PURE__ */ ge(r)));
1565
+ var s = o || Fi ? document.importNode(r, !0) : r.cloneNode(!0);
1566
1566
  if (n) {
1567
1567
  var a = /* @__PURE__ */ ge(s), l = s.lastChild;
1568
1568
  xn(a, l);
@@ -1571,16 +1571,16 @@ function we(t, e) {
1571
1571
  };
1572
1572
  }
1573
1573
  function Vt(t, e) {
1574
- if (N) {
1574
+ if (_) {
1575
1575
  var n = C;
1576
1576
  (!(n.f & 32768) || n.nodes.end === null) && (n.nodes.end = P), Jn();
1577
1577
  return;
1578
1578
  }
1579
1579
  t !== null && t.before(e);
1580
1580
  }
1581
- var Ol = ["touchstart", "touchmove"];
1582
- function Ll(t) {
1583
- return Ol.includes(t);
1581
+ var Ll = ["touchstart", "touchmove"];
1582
+ function Pl(t) {
1583
+ return Ll.includes(t);
1584
1584
  }
1585
1585
  function zr(t, e) {
1586
1586
  var n, o = e == null ? "" : typeof e == "object" ? `${e}` : e;
@@ -1589,36 +1589,36 @@ function zr(t, e) {
1589
1589
  function us(t, e) {
1590
1590
  return hs(t, e);
1591
1591
  }
1592
- function Pl(t, e) {
1592
+ function _l(t, e) {
1593
1593
  $o(), e.intro = e.intro ?? !1;
1594
- const n = e.target, o = N, r = P;
1594
+ const n = e.target, o = _, r = P;
1595
1595
  try {
1596
1596
  for (var i = /* @__PURE__ */ ge(n); i && (i.nodeType !== 8 || i.data !== "["); ) i = /* @__PURE__ */ It(i);
1597
1597
  if (!i) throw Ie;
1598
- Nt(!0), Z(i);
1598
+ _t(!0), Z(i);
1599
1599
  const s = hs(t, {
1600
1600
  ...e,
1601
1601
  anchor: i
1602
1602
  });
1603
- return Nt(!1), s;
1603
+ return _t(!1), s;
1604
1604
  } catch (s) {
1605
1605
  if (s instanceof Error && s.message.split(`
1606
1606
  `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s;
1607
- return s !== Ie && console.warn("Failed to hydrate: ", s), e.recover === !1 && za(), $o(), Ui(n), Nt(!1), us(t, e);
1607
+ return s !== Ie && console.warn("Failed to hydrate: ", s), e.recover === !1 && Ha(), $o(), Ui(n), _t(!1), us(t, e);
1608
1608
  } finally {
1609
- Nt(o), Z(r);
1609
+ _t(o), Z(r);
1610
1610
  }
1611
1611
  }
1612
1612
  var bn = /* @__PURE__ */ new Map();
1613
1613
  function hs(t, { target: e, anchor: n, props: o = {}, events: r, context: i, intro: s = !0, transformError: a }) {
1614
1614
  $o();
1615
- var l = void 0, c = Tl(() => {
1615
+ var l = void 0, c = wl(() => {
1616
1616
  var u = n ?? e.appendChild(yt());
1617
- il(u, { pending: () => {
1617
+ sl(u, { pending: () => {
1618
1618
  } }, (f) => {
1619
1619
  Si({});
1620
1620
  var v = D;
1621
- if (i && (v.c = i), r && (o.$$events = r), N && xn(f, null), l = t(f, o) || {}, N && (C.nodes.end = P, P === null || P.nodeType !== 8 || P.data !== "]")) throw Xn(), Ie;
1621
+ if (i && (v.c = i), r && (o.$$events = r), _ && xn(f, null), l = t(f, o) || {}, _ && (C.nodes.end = P, P === null || P.nodeType !== 8 || P.data !== "]")) throw Xn(), Ie;
1622
1622
  ki();
1623
1623
  }, a);
1624
1624
  var h = /* @__PURE__ */ new Set(), p = (f) => {
@@ -1626,7 +1626,7 @@ function hs(t, { target: e, anchor: n, props: o = {}, events: r, context: i, int
1626
1626
  var b = f[v];
1627
1627
  if (!h.has(b)) {
1628
1628
  h.add(b);
1629
- var g = Ll(b);
1629
+ var g = Pl(b);
1630
1630
  for (const R of [e, document]) {
1631
1631
  var T = bn.get(R);
1632
1632
  T === void 0 && (T = /* @__PURE__ */ new Map(), bn.set(R, T));
@@ -1651,15 +1651,15 @@ function Nl(t, e) {
1651
1651
  const n = Lo.get(t);
1652
1652
  return n ? (Lo.delete(t), n(e)) : Promise.resolve();
1653
1653
  }
1654
- var Ot = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), so = /* @__PURE__ */ new WeakMap(), ao = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), _l = class {
1654
+ var Ot = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), so = /* @__PURE__ */ new WeakMap(), ao = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), Rl = class {
1655
1655
  constructor(t, e = !0) {
1656
1656
  m(this, "anchor", void 0), E(this, Ot, /* @__PURE__ */ new Map()), E(this, Dt, /* @__PURE__ */ new Map()), E(this, gt, /* @__PURE__ */ new Map()), E(this, He, /* @__PURE__ */ new Set()), E(this, so, !0), E(this, ao, (n) => {
1657
1657
  if (d(Ot, this).has(n)) {
1658
1658
  var o = d(Ot, this).get(n), r = d(Dt, this).get(o);
1659
- if (r) Fn(r), d(He, this).delete(o);
1659
+ if (r) qn(r), d(He, this).delete(o);
1660
1660
  else {
1661
1661
  var i = d(gt, this).get(o);
1662
- i && (Fn(i.effect), d(Dt, this).set(o, i.effect), d(gt, this).delete(o), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect);
1662
+ i && (qn(i.effect), d(Dt, this).set(o, i.effect), d(gt, this).delete(o), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect);
1663
1663
  }
1664
1664
  for (const [s, a] of d(Ot, this)) {
1665
1665
  if (d(Ot, this).delete(s), s === n) break;
@@ -1700,19 +1700,19 @@ var Ot = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), gt =
1700
1700
  for (const [s, a] of d(Dt, this)) s === t ? n.unskip_effect(a) : n.skip_effect(a);
1701
1701
  for (const [s, a] of d(gt, this)) s === t ? n.unskip_effect(a.effect) : n.skip_effect(a.effect);
1702
1702
  n.oncommit(d(ao, this)), n.ondiscard(d(Hr, this));
1703
- } else N && (this.anchor = P), d(ao, this).call(this, n);
1703
+ } else _ && (this.anchor = P), d(ao, this).call(this, n);
1704
1704
  }
1705
1705
  };
1706
1706
  function je(t, e, n = !1) {
1707
1707
  var o;
1708
- N && (o = P, Jn());
1709
- var r = new _l(t), i = n ? Yo : 0;
1708
+ _ && (o = P, Jn());
1709
+ var r = new Rl(t), i = n ? Yo : 0;
1710
1710
  function s(a, l) {
1711
- if (N) {
1711
+ if (_) {
1712
1712
  var c = yi(o);
1713
1713
  if (a !== parseInt(c.substring(1))) {
1714
- var u = Nn();
1715
- Z(u), r.anchor = u, Nt(!1), r.ensure(a, l), Nt(!0);
1714
+ var u = _n();
1715
+ Z(u), r.anchor = u, _t(!1), r.ensure(a, l), _t(!0);
1716
1716
  return;
1717
1717
  }
1718
1718
  }
@@ -1725,10 +1725,10 @@ function je(t, e, n = !1) {
1725
1725
  }), a || s(-1, null);
1726
1726
  }, i);
1727
1727
  }
1728
- function Rl(t, e) {
1728
+ function Wl(t, e) {
1729
1729
  return e;
1730
1730
  }
1731
- function Wl(t, e, n) {
1731
+ function zl(t, e, n) {
1732
1732
  for (var o = [], r = e.length, i, s = e.length, a = 0; a < r; a++) {
1733
1733
  let h = e[a];
1734
1734
  Te(h, () => {
@@ -1764,19 +1764,19 @@ function Po(t, e, n = !0) {
1764
1764
  }
1765
1765
  }
1766
1766
  var yn;
1767
- function zl(t, e, n, o, r, i = null) {
1767
+ function Hl(t, e, n, o, r, i = null) {
1768
1768
  var s = t, a = /* @__PURE__ */ new Map();
1769
1769
  if ((e & 4) !== 0) {
1770
1770
  var l = t;
1771
- s = N ? Z(/* @__PURE__ */ ge(l)) : l.appendChild(yt());
1771
+ s = _ ? Z(/* @__PURE__ */ ge(l)) : l.appendChild(yt());
1772
1772
  }
1773
- N && Jn();
1773
+ _ && Jn();
1774
1774
  var c = null, u = /* @__PURE__ */ er(() => {
1775
1775
  var T = n();
1776
1776
  return gi(T) ? T : T == null ? [] : Kn(T);
1777
1777
  }), h, p = /* @__PURE__ */ new Map(), f = !0;
1778
1778
  function v(T) {
1779
- !(g.effect.f & 16384) && (g.pending.delete(T), g.fallback = c, Hl(g, h, s, e, o), c !== null && (h.length === 0 ? (c.f & 33554432) === 0 ? Fn(c) : (c.f ^= Ye, Ue(c, null, s)) : Te(c, () => {
1779
+ !(g.effect.f & 16384) && (g.pending.delete(T), g.fallback = c, jl(g, h, s, e, o), c !== null && (h.length === 0 ? (c.f & 33554432) === 0 ? qn(c) : (c.f ^= Ye, Ue(c, null, s)) : Te(c, () => {
1780
1780
  c = null;
1781
1781
  })));
1782
1782
  }
@@ -1788,17 +1788,17 @@ function zl(t, e, n, o, r, i = null) {
1788
1788
  h = y(u);
1789
1789
  var T = h.length;
1790
1790
  let $ = !1;
1791
- N && yi(s) === "[!" != (T === 0) && (s = Nn(), Z(s), Nt(!1), $ = !0);
1791
+ _ && yi(s) === "[!" != (T === 0) && (s = _n(), Z(s), _t(!1), $ = !0);
1792
1792
  for (var R = /* @__PURE__ */ new Set(), k = I, B = Ki(), j = 0; j < T; j += 1) {
1793
- N && P.nodeType === 8 && P.data === "]" && (s = P, $ = !0, Nt(!1));
1793
+ _ && P.nodeType === 8 && P.data === "]" && (s = P, $ = !0, _t(!1));
1794
1794
  var V = h[j], Q = o(V, j), G = f ? null : a.get(Q);
1795
- G ? (G.v && Oe(G.v, V), G.i && Oe(G.i, j), B && k.unskip_effect(G.e)) : (G = jl(a, f ? s : yn ?? (yn = yt()), V, Q, j, r, e, n), f || (G.e.f |= Ye), a.set(Q, G)), R.add(Q);
1795
+ G ? (G.v && Oe(G.v, V), G.i && Oe(G.i, j), B && k.unskip_effect(G.e)) : (G = Dl(a, f ? s : yn ?? (yn = yt()), V, Q, j, r, e, n), f || (G.e.f |= Ye), a.set(Q, G)), R.add(Q);
1796
1796
  }
1797
- if (T === 0 && i && !c && (f ? c = ct(() => i(s)) : (c = ct(() => i(yn ?? (yn = yt()))), c.f |= Ye)), T > R.size && Pa("", "", ""), N && T > 0 && Z(Nn()), !f) if (p.set(k, R), B) {
1797
+ if (T === 0 && i && !c && (f ? c = ct(() => i(s)) : (c = ct(() => i(yn ?? (yn = yt()))), c.f |= Ye)), T > R.size && _a("", "", ""), _ && T > 0 && Z(_n()), !f) if (p.set(k, R), B) {
1798
1798
  for (const [wt, an] of a) R.has(wt) || k.skip_effect(an.e);
1799
1799
  k.oncommit(v), k.ondiscard(b);
1800
1800
  } else v(k);
1801
- $ && Nt(!0), y(u);
1801
+ $ && _t(!0), y(u);
1802
1802
  }),
1803
1803
  flags: e,
1804
1804
  items: a,
@@ -1806,18 +1806,18 @@ function zl(t, e, n, o, r, i = null) {
1806
1806
  outrogroups: null,
1807
1807
  fallback: c
1808
1808
  };
1809
- f = !1, N && (s = P);
1809
+ f = !1, _ && (s = P);
1810
1810
  }
1811
1811
  function De(t) {
1812
1812
  for (; t !== null && (t.f & 32) === 0; ) t = t.next;
1813
1813
  return t;
1814
1814
  }
1815
- function Hl(t, e, n, o, r) {
1815
+ function jl(t, e, n, o, r) {
1816
1816
  var i = (o & 8) !== 0, s = e.length, a = t.items, l = De(t.effect.first), c, u = null, h, p = [], f = [], v, b, g, T;
1817
1817
  if (i) for (T = 0; T < s; T += 1) v = e[T], b = r(v, T), g = a.get(b).e, !(g.f & 33554432) && (g.nodes?.a?.measure(), (h ?? (h = /* @__PURE__ */ new Set())).add(g));
1818
1818
  for (T = 0; T < s; T += 1) {
1819
1819
  if (v = e[T], b = r(v, T), g = a.get(b).e, t.outrogroups !== null) for (const wt of t.outrogroups) wt.pending.delete(g), wt.done.delete(g);
1820
- if (g.f & 8192 && (Fn(g), i && (g.nodes?.a?.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(g))), (g.f & 33554432) !== 0) if (g.f ^= Ye, g === l) Ue(g, null, n);
1820
+ if (g.f & 8192 && (qn(g), i && (g.nodes?.a?.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(g))), (g.f & 33554432) !== 0) if (g.f ^= Ye, g === l) Ue(g, null, n);
1821
1821
  else {
1822
1822
  var $ = u ? u.next : l;
1823
1823
  g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), Bt(t, u, g), Bt(t, g, $), Ue(g, $, n), u = g, p = [], f = [], l = De(u.next);
@@ -1855,14 +1855,14 @@ function Hl(t, e, n, o, r) {
1855
1855
  for (T = 0; T < Q; T += 1) V[T].nodes?.a?.measure();
1856
1856
  for (T = 0; T < Q; T += 1) V[T].nodes?.a?.fix();
1857
1857
  }
1858
- Wl(t, V, G);
1858
+ zl(t, V, G);
1859
1859
  }
1860
1860
  }
1861
1861
  i && de(() => {
1862
1862
  if (h !== void 0) for (g of h) g.nodes?.a?.apply();
1863
1863
  });
1864
1864
  }
1865
- function jl(t, e, n, o, r, i, s, a) {
1865
+ function Dl(t, e, n, o, r, i, s, a) {
1866
1866
  var l = (s & 1) !== 0 ? (s & 16) === 0 ? /* @__PURE__ */ Bi(n, !1, !1) : fe(n) : null, c = (s & 2) !== 0 ? fe(r) : null;
1867
1867
  return {
1868
1868
  v: l,
@@ -1882,7 +1882,7 @@ function Ue(t, e, n) {
1882
1882
  function Bt(t, e, n) {
1883
1883
  e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e;
1884
1884
  }
1885
- function Dl(t, e) {
1885
+ function Bl(t, e) {
1886
1886
  Ji(() => {
1887
1887
  var n = t.getRootNode(), o = n.host ? n : n.head ?? n.ownerDocument.head;
1888
1888
  if (!o.querySelector("#" + e.hash)) {
@@ -1902,7 +1902,7 @@ function jr(t, e = !1) {
1902
1902
  function lo(t) {
1903
1903
  return t[0] !== "-" || t[1] !== "-" ? t.toLowerCase() : t;
1904
1904
  }
1905
- function Bl(t, e) {
1905
+ function ql(t, e) {
1906
1906
  if (e) {
1907
1907
  var n = "", o, r;
1908
1908
  if (Array.isArray(e) ? (o = e[0], r = e[1]) : o = e, t) {
@@ -1941,51 +1941,51 @@ function co(t, e = {}, n, o) {
1941
1941
  }
1942
1942
  function Dr(t, e, n, o) {
1943
1943
  var r = t[So];
1944
- if (N || r !== e) {
1945
- var i = Bl(e, o);
1946
- (!N || i !== t.getAttribute("style")) && (i == null ? t.removeAttribute("style") : t.style.cssText = i), t[So] = e;
1944
+ if (_ || r !== e) {
1945
+ var i = ql(e, o);
1946
+ (!_ || i !== t.getAttribute("style")) && (i == null ? t.removeAttribute("style") : t.style.cssText = i), t[So] = e;
1947
1947
  } else o && (Array.isArray(o) ? (co(t, n?.[0], o[0]), co(t, n?.[1], o[1], "important")) : co(t, n, o));
1948
1948
  return o;
1949
1949
  }
1950
- var Fl = /* @__PURE__ */ Symbol("is custom element"), ql = /* @__PURE__ */ Symbol("is html"), Vl = Oa ? "link" : "LINK";
1950
+ var Fl = /* @__PURE__ */ Symbol("is custom element"), Vl = /* @__PURE__ */ Symbol("is html"), Gl = La ? "link" : "LINK";
1951
1951
  function Br(t, e, n, o) {
1952
- var r = Gl(t);
1953
- N && (r[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === Vl) || r[e] !== (r[e] = n) && (e === "loading" && (t[Ma] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && Ul(t).includes(e) ? t[e] = n : t.setAttribute(e, n));
1952
+ var r = Ul(t);
1953
+ _ && (r[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === Gl) || r[e] !== (r[e] = n) && (e === "loading" && (t[$a] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && Kl(t).includes(e) ? t[e] = n : t.setAttribute(e, n));
1954
1954
  }
1955
- function Gl(t) {
1955
+ function Ul(t) {
1956
1956
  var e;
1957
1957
  return (e = t)[wo] ?? (e[wo] = {
1958
1958
  [Fl]: t.nodeName.includes("-"),
1959
- [ql]: t.namespaceURI === "http://www.w3.org/1999/xhtml"
1959
+ [Vl]: t.namespaceURI === "http://www.w3.org/1999/xhtml"
1960
1960
  });
1961
1961
  }
1962
- var Fr = /* @__PURE__ */ new Map();
1963
- function Ul(t) {
1964
- var e = t.getAttribute("is") || t.nodeName, n = Fr.get(e);
1962
+ var qr = /* @__PURE__ */ new Map();
1963
+ function Kl(t) {
1964
+ var e = t.getAttribute("is") || t.nodeName, n = qr.get(e);
1965
1965
  if (n) return n;
1966
- Fr.set(e, n = []);
1966
+ qr.set(e, n = []);
1967
1967
  for (var o, r = t, i = Element.prototype; i !== r; ) {
1968
- o = wa(r);
1968
+ o = Sa(r);
1969
1969
  for (var s in o) o[s].set && s !== "innerHTML" && s !== "textContent" && s !== "innerText" && n.push(s);
1970
1970
  r = mi(r);
1971
1971
  }
1972
1972
  return n;
1973
1973
  }
1974
- var ds, Ce = /* @__PURE__ */ new WeakMap(), qn = /* @__PURE__ */ new WeakMap(), uo = /* @__PURE__ */ new WeakMap(), qr = /* @__PURE__ */ new WeakSet(), ps = class {
1974
+ var ds, Ce = /* @__PURE__ */ new WeakMap(), Fn = /* @__PURE__ */ new WeakMap(), uo = /* @__PURE__ */ new WeakMap(), Fr = /* @__PURE__ */ new WeakSet(), ps = class {
1975
1975
  constructor(t) {
1976
- Jo(this, qr), E(this, Ce, /* @__PURE__ */ new WeakMap()), E(this, qn, void 0), E(this, uo, void 0), S(uo, this, t);
1976
+ Jo(this, Fr), E(this, Ce, /* @__PURE__ */ new WeakMap()), E(this, Fn, void 0), E(this, uo, void 0), S(uo, this, t);
1977
1977
  }
1978
1978
  observe(t, e) {
1979
1979
  var n = d(Ce, this).get(t) || /* @__PURE__ */ new Set();
1980
- return n.add(e), d(Ce, this).set(t, n), A(qr, this, Kl).call(this).observe(t, d(uo, this)), () => {
1980
+ return n.add(e), d(Ce, this).set(t, n), A(Fr, this, Yl).call(this).observe(t, d(uo, this)), () => {
1981
1981
  var o = d(Ce, this).get(t);
1982
- o.delete(e), o.size === 0 && (d(Ce, this).delete(t), d(qn, this).unobserve(t));
1982
+ o.delete(e), o.size === 0 && (d(Ce, this).delete(t), d(Fn, this).unobserve(t));
1983
1983
  };
1984
1984
  }
1985
1985
  };
1986
1986
  ds = ps;
1987
- function Kl() {
1988
- return d(qn, this) ?? S(qn, this, new ResizeObserver((t) => {
1987
+ function Yl() {
1988
+ return d(Fn, this) ?? S(Fn, this, new ResizeObserver((t) => {
1989
1989
  for (var e of t) {
1990
1990
  ds.entries.set(e.target, e);
1991
1991
  for (var n of d(Ce, this).get(e.target) || []) n(e);
@@ -2024,7 +2024,7 @@ function po(t, e, n, o) {
2024
2024
  h = re(t, e)?.set ?? (p && e in t ? (k) => t[e] = k : void 0);
2025
2025
  }
2026
2026
  var f, v = !1;
2027
- i ? [f, v] = Ja(() => t[e]) : f = t[e], f === void 0 && o !== void 0 && (f = u(), h && (r && Ha(e), h(f)));
2027
+ i ? [f, v] = Za(() => t[e]) : f = t[e], f === void 0 && o !== void 0 && (f = u(), h && (r && ja(e), h(f)));
2028
2028
  var b;
2029
2029
  if (r ? b = () => {
2030
2030
  var k = t[e];
@@ -2050,10 +2050,10 @@ function po(t, e, n, o) {
2050
2050
  return Wt && T || (R.f & 16384) !== 0 ? $.v : y($);
2051
2051
  });
2052
2052
  }
2053
- function Yl(t) {
2054
- return new Xl(t);
2053
+ function Xl(t) {
2054
+ return new Jl(t);
2055
2055
  }
2056
- var Jt = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), Xl = class {
2056
+ var Jt = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), Jl = class {
2057
2057
  constructor(t) {
2058
2058
  E(this, Jt, void 0), E(this, St, void 0);
2059
2059
  var e = /* @__PURE__ */ new Map(), n = (r, i) => {
@@ -2074,7 +2074,7 @@ var Jt = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), Xl =
2074
2074
  return O(e.get(i) ?? n(i, s), s), Reflect.set(r, i, s);
2075
2075
  }
2076
2076
  });
2077
- S(St, this, (t.hydrate ? Pl : us)(t.component, {
2077
+ S(St, this, (t.hydrate ? _l : us)(t.component, {
2078
2078
  target: t.target,
2079
2079
  anchor: t.anchor,
2080
2080
  props: o,
@@ -2138,14 +2138,14 @@ typeof HTMLElement == "function" && (fs = class extends HTMLElement {
2138
2138
  };
2139
2139
  };
2140
2140
  if (await Promise.resolve(), !this.$$cn || this.$$c) return;
2141
- const e = {}, n = Jl(this);
2141
+ const e = {}, n = Zl(this);
2142
2142
  for (const o of this.$$s) o in n && (o === "default" && !this.$$d.children ? (this.$$d.children = t(o), e.default = !0) : e[o] = t(o));
2143
2143
  for (const o of this.attributes) {
2144
2144
  const r = this.$$g_p(o.name);
2145
2145
  r in this.$$d || (this.$$d[r] = En(r, o.value, this.$$p_d, "toProp"));
2146
2146
  }
2147
2147
  for (const o in this.$$p_d) !(o in this.$$d) && this[o] !== void 0 && (this.$$d[o] = this[o], delete this[o]);
2148
- this.$$c = Yl({
2148
+ this.$$c = Xl({
2149
2149
  component: this.$$ctor,
2150
2150
  target: this.$$shadowRoot || this,
2151
2151
  props: {
@@ -2153,7 +2153,7 @@ typeof HTMLElement == "function" && (fs = class extends HTMLElement {
2153
2153
  $$slots: e,
2154
2154
  $$host: this
2155
2155
  }
2156
- }), this.$$me = yl(() => {
2156
+ }), this.$$me = Tl(() => {
2157
2157
  sr(() => {
2158
2158
  this.$$r = !0;
2159
2159
  for (const o of On(this.$$c)) {
@@ -2210,13 +2210,13 @@ function En(t, e, n, o) {
2210
2210
  return e;
2211
2211
  }
2212
2212
  }
2213
- function Jl(t) {
2213
+ function Zl(t) {
2214
2214
  const e = {};
2215
2215
  return t.childNodes.forEach((n) => {
2216
2216
  e[n.slot || "default"] = !0;
2217
2217
  }), e;
2218
2218
  }
2219
- function Zl(t, e, n, o, r, i) {
2219
+ function Ql(t, e, n, o, r, i) {
2220
2220
  let s = class extends fs {
2221
2221
  constructor() {
2222
2222
  super(t, n, r), this.$$p_d = e;
@@ -2242,14 +2242,14 @@ function Zl(t, e, n, o, r, i) {
2242
2242
  } });
2243
2243
  }), i && (s = i(s)), t.element = s, s;
2244
2244
  }
2245
- var Ql = class extends Event {
2245
+ var tc = class extends Event {
2246
2246
  constructor(t, e, n, o) {
2247
2247
  super("context-request", {
2248
2248
  bubbles: !0,
2249
2249
  composed: !0
2250
2250
  }), m(this, "context", void 0), m(this, "contextTarget", void 0), m(this, "callback", void 0), m(this, "subscribe", void 0), this.context = t, this.contextTarget = e, this.callback = n, this.subscribe = o ?? !1;
2251
2251
  }
2252
- }, tc = class {
2252
+ }, ec = class {
2253
2253
  constructor(t, e) {
2254
2254
  m(this, "host", void 0), m(this, "context", void 0), m(this, "subscribe", void 0), m(this, "onValue", void 0), m(this, "isConnected", !1), m(this, "unsubscribe", void 0), m(this, "currentValue", void 0), m(this, "handleValue", (n, o) => {
2255
2255
  o !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = o), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = n, this.onValue?.(n);
@@ -2265,12 +2265,12 @@ var Ql = class extends Event {
2265
2265
  return this.currentValue;
2266
2266
  }
2267
2267
  requestValue() {
2268
- this.host.dispatchEvent(new Ql(this.context, this.host, this.handleValue, this.subscribe));
2268
+ this.host.dispatchEvent(new tc(this.context, this.host, this.handleValue, this.subscribe));
2269
2269
  }
2270
- }, gs = (t) => t, ec = gs(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), nc = gs(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
2270
+ }, gs = (t) => t, nc = gs(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), oc = gs(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
2271
2271
  function ms(t, e, n) {
2272
2272
  let o = !1;
2273
- const r = new tc(t, {
2273
+ const r = new ec(t, {
2274
2274
  context: e,
2275
2275
  subscribe: !0,
2276
2276
  onValue: (c) => {
@@ -2294,13 +2294,13 @@ function ms(t, e, n) {
2294
2294
  globalThis.clearInterval(l), t.removeEventListener("context-provider", i), r.disconnect();
2295
2295
  };
2296
2296
  }
2297
- function oc(t, e) {
2298
- return ms(t, ec, e);
2299
- }
2300
2297
  function rc(t, e) {
2301
2298
  return ms(t, nc, e);
2302
2299
  }
2303
- var ic = class {
2300
+ function ic(t, e) {
2301
+ return ms(t, oc, e);
2302
+ }
2303
+ var sc = class {
2304
2304
  serialize(t, e) {
2305
2305
  return {
2306
2306
  startContainer: this.getNodePath(t.startContainer, e),
@@ -2373,9 +2373,9 @@ var at;
2373
2373
  (function(t) {
2374
2374
  t.YELLOW = "yellow", t.GREEN = "green", t.BLUE = "blue", t.PINK = "pink", t.ORANGE = "orange", t.UNDERLINE = "underline";
2375
2375
  })(at || (at = {}));
2376
- var vs = class No {
2376
+ var vs = class _o {
2377
2377
  constructor(e = {}) {
2378
- if (m(this, "config", void 0), m(this, "ttsWordHighlight", null), m(this, "ttsSentenceHighlight", null), m(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), m(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), m(this, "annotations", /* @__PURE__ */ new Map()), m(this, "colorHighlights", /* @__PURE__ */ new Map()), m(this, "nextAnnotationId", 1), m(this, "supported", !1), m(this, "rangeSerializer", void 0), m(this, "themeObserver", null), m(this, "explicitTTSColorOverride", null), this.config = e, this.rangeSerializer = new ic(), typeof CSS > "u" || !("highlights" in CSS)) {
2378
+ if (m(this, "config", void 0), m(this, "ttsWordHighlight", null), m(this, "ttsSentenceHighlight", null), m(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), m(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), m(this, "annotations", /* @__PURE__ */ new Map()), m(this, "colorHighlights", /* @__PURE__ */ new Map()), m(this, "nextAnnotationId", 1), m(this, "supported", !1), m(this, "rangeSerializer", void 0), m(this, "themeObserver", null), m(this, "explicitTTSColorOverride", null), this.config = e, this.rangeSerializer = new sc(), typeof CSS > "u" || !("highlights" in CSS)) {
2379
2379
  console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");
2380
2380
  return;
2381
2381
  }
@@ -2611,10 +2611,10 @@ var vs = class No {
2611
2611
  this.highlightTTSElementFallbacks(e);
2612
2612
  }
2613
2613
  highlightTTSElementFallbacks(e) {
2614
- typeof Element > "u" || this.highlightElementFallbacks(e, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights, No.SENTENCE_FALLBACK_SELECTOR);
2614
+ typeof Element > "u" || this.highlightElementFallbacks(e, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights, _o.SENTENCE_FALLBACK_SELECTOR);
2615
2615
  }
2616
2616
  highlightTTSWordElementFallbacks(e) {
2617
- typeof Element > "u" || this.highlightElementFallbacks(e, "data-pie-tts-word-element", this.ttsWordElementHighlights, No.WORD_FALLBACK_SELECTOR);
2617
+ typeof Element > "u" || this.highlightElementFallbacks(e, "data-pie-tts-word-element", this.ttsWordElementHighlights, _o.WORD_FALLBACK_SELECTOR);
2618
2618
  }
2619
2619
  highlightElementFallbacks(e, n, o, r) {
2620
2620
  for (const i of e) {
@@ -2792,25 +2792,25 @@ var fo = {
2792
2792
  function ue(t) {
2793
2793
  return typeof t == "object" && t !== null && !Array.isArray(t);
2794
2794
  }
2795
- function Ft(t, e) {
2795
+ function qt(t, e) {
2796
2796
  if (t == null) return [];
2797
2797
  if (!Array.isArray(t)) throw new Error(`Invalid tools config at "${e}": expected an array of tool ids.`);
2798
2798
  if (t.find((n) => typeof n != "string") !== void 0) throw new Error(`Invalid tools config at "${e}": all entries must be strings.`);
2799
2799
  return t;
2800
2800
  }
2801
- function sc(t) {
2801
+ function ac(t) {
2802
2802
  if (t != null) {
2803
2803
  if (!ue(t)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
2804
2804
  return t;
2805
2805
  }
2806
2806
  }
2807
- function ac(t) {
2807
+ function lc(t) {
2808
2808
  if (t != null) {
2809
2809
  if (!ue(t)) throw new Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');
2810
2810
  return t;
2811
2811
  }
2812
2812
  }
2813
- function lc(t, e) {
2813
+ function cc(t, e) {
2814
2814
  if (e == null) return;
2815
2815
  if (!ue(e)) throw new Error(`Invalid tools config at "providers.${t}": expected an object.`);
2816
2816
  const n = e, o = (r) => r === "polly" || r === "google" || r === "custom";
@@ -2819,17 +2819,17 @@ function lc(t, e) {
2819
2819
  if ("provider" in n && n.provider !== void 0 && !ue(n.provider) && !(t === "textToSpeech" && o(n.provider))) throw new Error(`Invalid tools config at "providers.${t}.provider": expected an object.`);
2820
2820
  return n;
2821
2821
  }
2822
- function cc(t) {
2822
+ function uc(t) {
2823
2823
  if (t == null) return {};
2824
2824
  if (!ue(t)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
2825
2825
  const e = {};
2826
- for (const [n, o] of Object.entries(t)) e[n] = lc(n, o);
2826
+ for (const [n, o] of Object.entries(t)) e[n] = cc(n, o);
2827
2827
  return e;
2828
2828
  }
2829
2829
  function bs(t) {
2830
2830
  return t.trim() || "";
2831
2831
  }
2832
- function qt(t) {
2832
+ function Ft(t) {
2833
2833
  if (!t || t.length === 0) return [];
2834
2834
  const e = /* @__PURE__ */ new Set();
2835
2835
  for (const n of t) {
@@ -2839,29 +2839,29 @@ function qt(t) {
2839
2839
  }
2840
2840
  return Array.from(e);
2841
2841
  }
2842
- function uc(t, e) {
2842
+ function hc(t, e) {
2843
2843
  if (t != null) {
2844
2844
  if (t === "on" || t === "off") return t;
2845
2845
  throw new Error(`Invalid tools config at "${e}": expected "on" or "off", got ${JSON.stringify(t)}.`);
2846
2846
  }
2847
2847
  }
2848
- function hc(t) {
2848
+ function dc(t) {
2849
2849
  if (t != null && !ue(t)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
2850
- const e = ac(t?.policy), n = sc(t?.placement), o = cc(t?.providers), r = uc(t?.pnpEnforcement, "pnpEnforcement"), i = {
2850
+ const e = lc(t?.policy), n = ac(t?.placement), o = uc(t?.providers), r = hc(t?.pnpEnforcement, "pnpEnforcement"), i = {
2851
2851
  policy: {
2852
- allowed: qt(Ft(e?.allowed, "policy.allowed")),
2853
- blocked: qt(Ft(e?.blocked, "policy.blocked"))
2852
+ allowed: Ft(qt(e?.allowed, "policy.allowed")),
2853
+ blocked: Ft(qt(e?.blocked, "policy.blocked"))
2854
2854
  },
2855
2855
  placement: {
2856
- section: qt(Ft(n?.section, "placement.section")).length ? qt(Ft(n?.section, "placement.section")) : [...go.section],
2857
- item: qt(Ft(n?.item, "placement.item")).length ? qt(Ft(n?.item, "placement.item")) : [...go.item],
2858
- passage: qt(Ft(n?.passage, "placement.passage")).length ? qt(Ft(n?.passage, "placement.passage")) : [...go.passage]
2856
+ section: Ft(qt(n?.section, "placement.section")).length ? Ft(qt(n?.section, "placement.section")) : [...go.section],
2857
+ item: Ft(qt(n?.item, "placement.item")).length ? Ft(qt(n?.item, "placement.item")) : [...go.item],
2858
+ passage: Ft(qt(n?.passage, "placement.passage")).length ? Ft(qt(n?.passage, "placement.passage")) : [...go.passage]
2859
2859
  },
2860
2860
  providers: o
2861
2861
  };
2862
2862
  return r && (i.pnpEnforcement = r), i;
2863
2863
  }
2864
- var dc = [
2864
+ var pc = [
2865
2865
  "assessment",
2866
2866
  "section",
2867
2867
  "item",
@@ -2872,7 +2872,7 @@ var dc = [
2872
2872
  function Cn(t, e) {
2873
2873
  if (typeof t != "string" || t.trim().length === 0) throw new Error(`Invalid tool registration: "${e}" must be a non-empty string.`);
2874
2874
  }
2875
- var pc = [
2875
+ var fc = [
2876
2876
  {
2877
2877
  pattern: /<script\b/i,
2878
2878
  reason: "contains a <script> tag"
@@ -2890,17 +2890,17 @@ var pc = [
2890
2890
  reason: "contains a <foreignObject> element"
2891
2891
  }
2892
2892
  ];
2893
- function fc(t, e, n) {
2893
+ function gc(t, e, n) {
2894
2894
  const o = e.trimStart(), r = o.toLowerCase().startsWith("<svg"), i = /^https?:/i.test(o);
2895
2895
  if (/^data:/i.test(o)) throw new Error(`Invalid tool registration "${t}": "${n}" may not be a data: URL.`);
2896
2896
  if (!(!r && !i)) {
2897
- for (const { pattern: s, reason: a } of pc) if (s.test(e)) throw new Error(`Invalid tool registration "${t}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
2897
+ for (const { pattern: s, reason: a } of fc) if (s.test(e)) throw new Error(`Invalid tool registration "${t}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
2898
2898
  }
2899
2899
  }
2900
2900
  function Gr(t) {
2901
2901
  if (Cn(t.toolId, "toolId"), Cn(t.name, "name"), Cn(t.description, "description"), typeof t.icon != "string" && typeof t.icon != "function") throw new Error(`Invalid tool registration "${t.toolId}": "icon" must be a string or function.`);
2902
- if (typeof t.icon == "string" && fc(t.toolId, t.icon, "icon"), !Array.isArray(t.supportedLevels) || t.supportedLevels.length === 0) throw new Error(`Invalid tool registration "${t.toolId}": "supportedLevels" must be a non-empty array.`);
2903
- const e = t.supportedLevels.find((n) => !dc.includes(n));
2902
+ if (typeof t.icon == "string" && gc(t.toolId, t.icon, "icon"), !Array.isArray(t.supportedLevels) || t.supportedLevels.length === 0) throw new Error(`Invalid tool registration "${t.toolId}": "supportedLevels" must be a non-empty array.`);
2903
+ const e = t.supportedLevels.find((n) => !pc.includes(n));
2904
2904
  if (e) throw new Error(`Invalid tool registration "${t.toolId}": unsupported level "${e}".`);
2905
2905
  if (t.activation !== void 0 && t.activation !== "toolbar-toggle" && t.activation !== "selection-gateway") throw new Error(`Invalid tool registration "${t.toolId}": unsupported activation "${String(t.activation)}".`);
2906
2906
  if (t.singletonScope !== void 0 && t.singletonScope !== "section") throw new Error(`Invalid tool registration "${t.toolId}": unsupported singletonScope "${String(t.singletonScope)}".`);
@@ -2909,7 +2909,7 @@ function Gr(t) {
2909
2909
  if (typeof t.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${t.toolId}": "isVisibleInContext" must be a function.`);
2910
2910
  if (typeof t.renderToolbar != "function") throw new Error(`Invalid tool registration "${t.toolId}": "renderToolbar" must be a function.`);
2911
2911
  }
2912
- var gc = class {
2912
+ var mc = class {
2913
2913
  constructor() {
2914
2914
  m(this, "tools", /* @__PURE__ */ new Map()), m(this, "pnpIndex", /* @__PURE__ */ new Map()), m(this, "componentOverrides", {}), m(this, "moduleLoaders", /* @__PURE__ */ new Map()), m(this, "loadedToolModules", /* @__PURE__ */ new Set()), m(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
2915
2915
  }
@@ -3051,10 +3051,10 @@ var gc = class {
3051
3051
  function ys(t) {
3052
3052
  return t.level === "item";
3053
3053
  }
3054
- function mc(t) {
3054
+ function vc(t) {
3055
3055
  return t.level === "passage";
3056
3056
  }
3057
- function vc(t) {
3057
+ function bc(t) {
3058
3058
  return t.level === "rubric";
3059
3059
  }
3060
3060
  function Ts(t) {
@@ -3089,7 +3089,7 @@ function hr(t) {
3089
3089
  }
3090
3090
  return o.filter(Boolean).join(" ").trim();
3091
3091
  }
3092
- if (mc(t)) {
3092
+ if (vc(t)) {
3093
3093
  const e = t.passage;
3094
3094
  if (!e?.config) return "";
3095
3095
  const n = e.config, o = [], r = (l) => l.replace(/<[^>]*>/g, " ").trim();
@@ -3104,7 +3104,7 @@ function hr(t) {
3104
3104
  }
3105
3105
  return o.filter(Boolean).join(" ").trim();
3106
3106
  }
3107
- if (vc(t)) {
3107
+ if (bc(t)) {
3108
3108
  const e = t.rubricBlock;
3109
3109
  return e.passage?.config ? (e.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (e.content || "").replace(/<[^>]*>/g, " ").trim();
3110
3110
  }
@@ -3121,7 +3121,7 @@ function An(t) {
3121
3121
  /\d+\s*[+\-*/=]\s*\d+/
3122
3122
  ].some((n) => n.test(e));
3123
3123
  }
3124
- function bc(t) {
3124
+ function yc(t) {
3125
3125
  const e = [
3126
3126
  "pie-multiple-choice",
3127
3127
  "pie-inline-choice",
@@ -3151,7 +3151,7 @@ function bc(t) {
3151
3151
  function In(t) {
3152
3152
  return hr(t).trim().length >= 10;
3153
3153
  }
3154
- function yc(t) {
3154
+ function Tc(t) {
3155
3155
  const e = hr(t);
3156
3156
  return [
3157
3157
  /chemistry|chemical|element|atom|molecule|compound/i,
@@ -3162,23 +3162,23 @@ function yc(t) {
3162
3162
  /physics|force|energy|velocity|acceleration/i
3163
3163
  ].some((n) => n.test(e));
3164
3164
  }
3165
- var Tc = /* @__PURE__ */ new Set([
3165
+ var wc = /* @__PURE__ */ new Set([
3166
3166
  "assessment",
3167
3167
  "section",
3168
3168
  "item",
3169
3169
  "passage",
3170
3170
  "rubric"
3171
3171
  ]);
3172
- function wc(t) {
3173
- return Tc.has(t);
3172
+ function Sc(t) {
3173
+ return wc.has(t);
3174
3174
  }
3175
3175
  function dr(t, e, n) {
3176
3176
  const o = t.trim(), r = n.trim();
3177
3177
  if (!o || !r) throw new Error("Tool instance ids require non-empty tool and scope ids");
3178
- if (!wc(e)) throw new Error(`Unknown tool scope level '${e}'. Register custom levels with registerToolScopeLevel().`);
3178
+ if (!Sc(e)) throw new Error(`Unknown tool scope level '${e}'. Register custom levels with registerToolScopeLevel().`);
3179
3179
  return `${o}:${e}:${r}`;
3180
3180
  }
3181
- var Sc = class {
3181
+ var kc = class {
3182
3182
  constructor() {
3183
3183
  m(this, "providerId", "desmos-calculator"), m(this, "providerName", "Desmos Calculator"), m(this, "category", "calculator"), m(this, "version", "1.10"), m(this, "requiresAuth", !0), m(this, "desmosProvider", null), m(this, "config", null);
3184
3184
  }
@@ -3282,14 +3282,34 @@ var Sc = class {
3282
3282
  text: t,
3283
3283
  offset: 0
3284
3284
  }];
3285
- }, ws = class {
3285
+ }, ws = (t) => String(t || "").trim().toLowerCase(), xc = () => ws((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), Ec = (t, e) => {
3286
+ if (e) {
3287
+ const s = t.find((a) => a.name === e);
3288
+ if (s) return s;
3289
+ }
3290
+ const n = xc(), o = n.split("-")[0] || "en", r = (s) => {
3291
+ const a = ws(s.lang);
3292
+ return a === n || a.startsWith(`${o}-`);
3293
+ }, i = [
3294
+ (s) => s.localService && r(s),
3295
+ (s) => s.default && r(s),
3296
+ (s) => r(s),
3297
+ (s) => s.localService,
3298
+ (s) => s.default
3299
+ ];
3300
+ for (const s of i) {
3301
+ const a = t.find(s);
3302
+ if (a) return a;
3303
+ }
3304
+ return t[0] || null;
3305
+ }, Cc = (t) => !t.default, Ss = class {
3286
3306
  constructor() {
3287
3307
  m(this, "providerId", "browser"), m(this, "providerName", "Browser Speech Synthesis"), m(this, "version", "1.0.0");
3288
3308
  }
3289
3309
  async initialize(t) {
3290
3310
  if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
3291
3311
  if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
3292
- return new kc(t);
3312
+ return new Ac(t);
3293
3313
  }
3294
3314
  supportsFeature(t) {
3295
3315
  return !0;
@@ -3307,7 +3327,7 @@ var Sc = class {
3307
3327
  }
3308
3328
  destroy() {
3309
3329
  }
3310
- }, kc = class {
3330
+ }, Ac = class {
3311
3331
  constructor(t) {
3312
3332
  m(this, "utterance", null), m(this, "config", null), m(this, "_isPlaying", !1), m(this, "_isPaused", !1), m(this, "speakRunId", 0), m(this, "onWordBoundary", void 0), this.config = t;
3313
3333
  }
@@ -3389,37 +3409,40 @@ var Sc = class {
3389
3409
  o(!1);
3390
3410
  return;
3391
3411
  }
3392
- if (this.utterance = new SpeechSynthesisUtterance(t), this.config?.voice) {
3393
- const i = speechSynthesis.getVoices().find((s) => s.name === this.config.voice);
3394
- i && (this.utterance.voice = i);
3395
- }
3396
- this.config?.rate && (this.utterance.rate = this.config.rate), this.config?.pitch && (this.utterance.pitch = this.config.pitch), this.utterance.onstart = () => {
3412
+ const i = new SpeechSynthesisUtterance(t);
3413
+ this.utterance = i;
3414
+ const s = Ec(speechSynthesis.getVoices(), this.config?.voice);
3415
+ s && Cc(s) && (i.voice = s), this.config?.rate && (i.rate = this.config.rate), this.config?.pitch && (i.pitch = this.config.pitch);
3416
+ const a = () => {
3417
+ this.utterance === i && (this.utterance = null);
3418
+ };
3419
+ i.onstart = () => {
3397
3420
  n === this.speakRunId && (this._isPlaying = !0, this._isPaused = !1);
3398
- }, this.utterance.onend = () => {
3399
- if (n !== this.speakRunId) {
3421
+ }, i.onend = () => {
3422
+ if (a(), n !== this.speakRunId) {
3400
3423
  o(!1);
3401
3424
  return;
3402
3425
  }
3403
3426
  this._isPlaying = !1, this._isPaused = !1, o(!0);
3404
- }, this.utterance.onerror = (i) => {
3405
- if (n !== this.speakRunId) {
3427
+ }, i.onerror = (l) => {
3428
+ if (a(), n !== this.speakRunId) {
3406
3429
  o(!1);
3407
3430
  return;
3408
3431
  }
3409
- if (this._isPlaying = !1, this._isPaused = !1, i.error === "interrupted" || i.error === "canceled") {
3432
+ if (this._isPlaying = !1, this._isPaused = !1, l.error === "interrupted" || l.error === "canceled") {
3410
3433
  o(!1);
3411
3434
  return;
3412
3435
  }
3413
- r(/* @__PURE__ */ new Error(`Speech synthesis error: ${i.error}`));
3414
- }, this.utterance.onpause = () => {
3436
+ r(/* @__PURE__ */ new Error(`Speech synthesis error: ${l.error}`));
3437
+ }, i.onpause = () => {
3415
3438
  n === this.speakRunId && (this._isPaused = !0);
3416
- }, this.utterance.onresume = () => {
3439
+ }, i.onresume = () => {
3417
3440
  n === this.speakRunId && (this._isPaused = !1);
3418
- }, this.utterance.onboundary = (i) => {
3419
- if (n !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", i.name, "charIndex:", i.charIndex, "charLength:", i.charLength), i.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence") return;
3420
- const s = Math.max(0, Math.min(i.charIndex, Math.max(0, t.length - 1))), a = Number(i.charLength || 0), l = this.inferWordLength(t, s), c = Number.isFinite(a) && a > 0 && a <= 80 && s + a <= t.length ? a : l, u = t.substring(s, Math.min(t.length, s + c)).trim(), h = e + s;
3421
- console.log("[BrowserProvider] Calling onWordBoundary with word:", u, "at position:", h), this.onWordBoundary(u, h, c);
3422
- }, speechSynthesis.speak(this.utterance);
3441
+ }, i.onboundary = (l) => {
3442
+ 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;
3443
+ const c = Math.max(0, Math.min(l.charIndex, Math.max(0, t.length - 1))), u = Number(l.charLength || 0), h = this.inferWordLength(t, c), p = Number.isFinite(u) && u > 0 && u <= 80 && c + u <= t.length ? u : h, f = t.substring(c, Math.min(t.length, c + p)).trim(), v = e + c;
3444
+ console.log("[BrowserProvider] Calling onWordBoundary with word:", f, "at position:", v), this.onWordBoundary(f, v, p);
3445
+ }, speechSynthesis.speak(i);
3423
3446
  });
3424
3447
  }
3425
3448
  pause() {
@@ -3429,7 +3452,7 @@ var Sc = class {
3429
3452
  this._isPlaying && this._isPaused && speechSynthesis.resume();
3430
3453
  }
3431
3454
  stop() {
3432
- this.speakRunId += 1, this._isPlaying && speechSynthesis.cancel(), this._isPlaying = !1, this._isPaused = !1;
3455
+ this.speakRunId += 1, (this._isPlaying || this.utterance) && speechSynthesis.cancel(), this.utterance = null, this._isPlaying = !1, this._isPaused = !1;
3433
3456
  }
3434
3457
  isPlaying() {
3435
3458
  return this._isPlaying && !this._isPaused;
@@ -3443,7 +3466,7 @@ var Sc = class {
3443
3466
  ...t.providerOptions || {}
3444
3467
  });
3445
3468
  }
3446
- }, xc = class {
3469
+ }, Ic = class {
3447
3470
  async emitTelemetry(t, e) {
3448
3471
  try {
3449
3472
  await this.config?.onTelemetry?.(t, e);
@@ -3475,7 +3498,7 @@ var Sc = class {
3475
3498
  }
3476
3499
  async _initializeBrowserTTS(t) {
3477
3500
  if (typeof window > "u" || !("speechSynthesis" in window)) throw new Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");
3478
- this.ttsProvider = new ws(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3501
+ this.ttsProvider = new Ss(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3479
3502
  }
3480
3503
  async _initializeServerTTS(t) {
3481
3504
  if (!t.apiEndpoint) throw new Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");
@@ -3533,7 +3556,7 @@ var Sc = class {
3533
3556
  destroy() {
3534
3557
  this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
3535
3558
  }
3536
- }, Ec = /* @__PURE__ */ new Set([
3559
+ }, Mc = /* @__PURE__ */ new Set([
3537
3560
  "annotation-xml",
3538
3561
  "color-profile",
3539
3562
  "font-face",
@@ -3542,16 +3565,16 @@ var Sc = class {
3542
3565
  "font-face-format",
3543
3566
  "font-face-name",
3544
3567
  "missing-glyph"
3545
- ]), Cc = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, Ac = (t, e = "custom element tag") => {
3568
+ ]), $c = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, Oc = (t, e = "custom element tag") => {
3546
3569
  if (!t || typeof t != "string") throw new Error(`Invalid ${e}: expected a non-empty string`);
3547
3570
  const n = t.trim();
3548
3571
  if (!n) throw new Error(`Invalid ${e}: tag is empty`);
3549
3572
  if (n !== n.toLowerCase()) throw new Error(`Invalid ${e} "${n}": custom element names must be lowercase`);
3550
3573
  if (!n.includes("-")) throw new Error(`Invalid ${e} "${n}": custom element names must include a hyphen`);
3551
- if (Ec.has(n)) throw new Error(`Invalid ${e} "${n}": this name is reserved by the HTML spec`);
3552
- if (!Cc.test(n)) throw new Error(`Invalid ${e} "${n}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3574
+ if (Mc.has(n)) throw new Error(`Invalid ${e} "${n}": this name is reserved by the HTML spec`);
3575
+ if (!$c.test(n)) throw new Error(`Invalid ${e} "${n}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3553
3576
  return n;
3554
- }, Ss = {
3577
+ }, ks = {
3555
3578
  calculator: "pie-tool-calculator",
3556
3579
  textToSpeech: "pie-tool-text-to-speech",
3557
3580
  ruler: "pie-tool-ruler",
@@ -3563,29 +3586,29 @@ var Sc = class {
3563
3586
  annotationToolbar: "pie-tool-annotation-toolbar",
3564
3587
  graph: "pie-tool-graph",
3565
3588
  periodicTable: "pie-tool-periodic-table"
3566
- }, Ic = (t, e) => Ac(e?.toolTagMap?.[t] ?? Ss[t] ?? t, `tool component tag for "${t}"`), Mc = (t) => document.createElement(t), kt = (t, e, n, o) => {
3567
- const r = Ic(t, o), i = o?.toolComponentFactories?.[t] ?? o?.toolComponentFactory;
3589
+ }, Lc = (t, e) => Oc(e?.toolTagMap?.[t] ?? ks[t] ?? t, `tool component tag for "${t}"`), Pc = (t) => document.createElement(t), kt = (t, e, n, o) => {
3590
+ const r = Lc(t, o), i = o?.toolComponentFactories?.[t] ?? o?.toolComponentFactory;
3568
3591
  return i ? i({
3569
3592
  toolId: t,
3570
3593
  tagName: r,
3571
3594
  context: e,
3572
3595
  toolbarContext: n
3573
- }) : Mc(r);
3574
- }, _o = /* @__PURE__ */ new WeakMap();
3575
- function $c(t, e) {
3596
+ }) : Pc(r);
3597
+ }, No = /* @__PURE__ */ new WeakMap();
3598
+ function _c(t, e) {
3576
3599
  if (!t) return null;
3577
- const n = _o.get(t), o = n?.get(e);
3600
+ const n = No.get(t), o = n?.get(e);
3578
3601
  return o ? o.isConnected ? o : (n?.delete(e), null) : null;
3579
3602
  }
3580
- function Oc(t, e, n) {
3603
+ function Nc(t, e, n) {
3581
3604
  if (!t) return;
3582
- let o = _o.get(t);
3583
- o || (o = /* @__PURE__ */ new Map(), _o.set(t, o)), o.set(e, n);
3605
+ let o = No.get(t);
3606
+ o || (o = /* @__PURE__ */ new Map(), No.set(t, o)), o.set(e, n);
3584
3607
  }
3585
3608
  function Ur(t) {
3586
3609
  return t === "basic" || t === "scientific" ? t : null;
3587
3610
  }
3588
- function Lc(t) {
3611
+ function Rc(t) {
3589
3612
  const e = t.getToolRenderParams?.("calculator") ?? {}, n = Ur(e.calculatorType), o = e.availableTypes;
3590
3613
  return {
3591
3614
  calculatorType: n,
@@ -3597,14 +3620,14 @@ function Kr(t, e, n) {
3597
3620
  const o = t;
3598
3621
  e ? (o.calculatorType = e, t.setAttribute("calculator-type", e)) : (delete o.calculatorType, t.removeAttribute("calculator-type")), n && n.length > 0 ? o.availableTypes = n : delete o.availableTypes;
3599
3622
  }
3600
- var Pc = {
3623
+ var Wc = {
3601
3624
  toolId: "calculator",
3602
3625
  name: "Calculator",
3603
3626
  description: "Multi-type calculator (basic, scientific, graphing)",
3604
3627
  icon: "calculator",
3605
3628
  provider: {
3606
3629
  getProviderId: (t) => typeof t?.provider?.id == "string" && t.provider.id.length > 0 ? t.provider.id : "calculator-desmos",
3607
- createProvider: () => new Sc(),
3630
+ createProvider: () => new kc(),
3608
3631
  getInitConfig: (t) => t?.provider?.init ?? {},
3609
3632
  getAuthFetcher: (t) => {
3610
3633
  const e = t?.provider?.runtime?.authFetcher;
@@ -3630,8 +3653,8 @@ var Pc = {
3630
3653
  return An(t);
3631
3654
  },
3632
3655
  renderToolbar(t, e) {
3633
- const { calculatorType: n, availableTypes: o, displayName: r } = Lc(e), i = dr(this.toolId, e.scope.level, e.scope.scopeId), s = e.componentOverrides, a = $c(e.toolCoordinator, i), l = a ?? kt(this.toolId, t, e, s);
3634
- a || Oc(e.toolCoordinator, i, l), l.setAttribute("tool-id", i), l.toolkitCoordinator = e.toolkitCoordinator, Kr(l, n, o);
3656
+ const { calculatorType: n, availableTypes: o, displayName: r } = Rc(e), i = dr(this.toolId, e.scope.level, e.scope.scopeId), s = e.componentOverrides, a = _c(e.toolCoordinator, i), l = a ?? kt(this.toolId, t, e, s);
3657
+ a || Nc(e.toolCoordinator, i, l), l.setAttribute("tool-id", i), l.toolkitCoordinator = e.toolkitCoordinator, Kr(l, n, o);
3635
3658
  const c = n === null ? "Open scientific calculator" : `Open ${r.toLowerCase()}`, u = n === null ? "Close scientific calculator" : `Close ${r.toLowerCase()}`, h = {
3636
3659
  toolId: this.toolId,
3637
3660
  label: r,
@@ -3672,7 +3695,7 @@ var Pc = {
3672
3695
  }
3673
3696
  };
3674
3697
  }
3675
- }, H = (t) => t.trim().replace(/\s+/g, " "), ks = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, xs = (t) => {
3698
+ }, H = (t) => t.trim().replace(/\s+/g, " "), xs = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, Es = (t) => {
3676
3699
  if (t.hidden || t.tagName?.toLowerCase() === "mjx-assistive-mml" || t.getAttribute("aria-hidden") === "true" || t.hasAttribute("inert")) return !0;
3677
3700
  const e = t.classList;
3678
3701
  if (e?.contains("sr-only") || e?.contains("pie-sr-only") || e?.contains("visually-hidden")) return !0;
@@ -3683,15 +3706,15 @@ var Pc = {
3683
3706
  if ((n.position === "absolute" || n.position === "fixed") && i && (n.overflow === "hidden" || s) || n.opacity === "0" && i) return !0;
3684
3707
  }
3685
3708
  return !1;
3686
- }, _e = (t, e) => {
3709
+ }, Ne = (t, e) => {
3687
3710
  let n = t.nodeType === 1 ? t : t.parentElement;
3688
3711
  for (; n; ) {
3689
- if (xs(n)) return !0;
3712
+ if (Es(n)) return !0;
3690
3713
  if (e && n === e) break;
3691
3714
  n = n.parentElement;
3692
3715
  }
3693
3716
  return !1;
3694
- }, Es = (t, e, n) => {
3717
+ }, Cs = (t, e, n) => {
3695
3718
  if (!t || !e || /\s/.test(t) || /\s/.test(e)) return !1;
3696
3719
  const o = n?.boundarySpacingMode ?? "segmenterPreferred";
3697
3720
  if (o === "none") return !1;
@@ -3717,9 +3740,9 @@ var Pc = {
3717
3740
  let u = c.nextNode();
3718
3741
  for (; u; ) {
3719
3742
  const p = u;
3720
- if (p.parentElement && !_e(p, t)) {
3743
+ if (p.parentElement && !Ne(p, t)) {
3721
3744
  const f = p.textContent || "", v = f.match(/\S/), b = v ? v[0] : null;
3722
- !i && !s && Es(l, b, e) && (o.push(" "), a && n.set(r, a), r++, s = !0);
3745
+ !i && !s && Cs(l, b, e) && (o.push(" "), a && n.set(r, a), r++, s = !0);
3723
3746
  for (let g = 0; g < f.length; g++) {
3724
3747
  const T = f[g], $ = /\s/.test(T);
3725
3748
  i ? $ || (i = !1, o.push(T), n.set(r, {
@@ -3751,11 +3774,11 @@ var Pc = {
3751
3774
  text: h,
3752
3775
  map: n
3753
3776
  };
3754
- }, mo = null, Yr = Promise.resolve(), Nc = (t) => (t || "en").split("-")[0].toLowerCase() || "en", _c = async () => (mo || (mo = import("./sre-CXN7ed6H-7db47d5d.js").then((t) => /* @__PURE__ */ ya(t.default, 1)).then((t) => {
3777
+ }, mo = null, Yr = Promise.resolve(), zc = (t) => (t || "en").split("-")[0].toLowerCase() || "en", Hc = async () => (mo || (mo = import("./sre-CXN7ed6H-7db47d5d.js").then((t) => /* @__PURE__ */ Ta(t.default, 1)).then((t) => {
3755
3778
  const e = t.default || t;
3756
3779
  if (!e || typeof e.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
3757
3780
  return e;
3758
- })), mo), Rc = (t) => t === "en" ? "clearspeak" : "mathspeak", Xr = (t) => !!t && typeof t == "object" && !Array.isArray(t), Jr = (t) => typeof t == "string" && t.trim() ? t.trim() : void 0, Qn = (t) => {
3781
+ })), mo), jc = (t) => t === "en" ? "clearspeak" : "mathspeak", Xr = (t) => !!t && typeof t == "object" && !Array.isArray(t), Jr = (t) => typeof t == "string" && t.trim() ? t.trim() : void 0, Qn = (t) => {
3759
3782
  if (!Xr(t)) return;
3760
3783
  const e = Jr(t.domain), n = Jr(t.style), o = Xr(t.engineOptions) ? t.engineOptions : void 0;
3761
3784
  if (!(!e && !n && !o)) return {
@@ -3763,36 +3786,36 @@ var Pc = {
3763
3786
  ...n ? { style: n } : {},
3764
3787
  ...o ? { engineOptions: o } : {}
3765
3788
  };
3766
- }, Wc = async (t, e, n, o) => {
3767
- const r = Nc(e), i = Qn(o);
3789
+ }, Dc = async (t, e, n, o) => {
3790
+ const r = zc(e), i = Qn(o);
3768
3791
  await t.setupEngine?.({
3769
3792
  ...i?.engineOptions || {},
3770
3793
  locale: r,
3771
- domain: i?.domain || Rc(r),
3794
+ domain: i?.domain || jc(r),
3772
3795
  ...i?.style ? { style: i.style } : {},
3773
3796
  modality: "speech",
3774
3797
  markup: n
3775
3798
  }), await t.engineReady?.();
3776
- }, zc = async (t) => {
3799
+ }, Bc = async (t) => {
3777
3800
  const e = Yr.then(t, t);
3778
3801
  return Yr = e.then(() => {
3779
3802
  }, () => {
3780
3803
  }), e;
3781
- }, Cs = async (t, e, n, o, r) => zc(async () => (await Wc(t, n, o, r), t.toSpeech(e))), Hc = (t) => t.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), jc = async (t, e, n, o) => {
3804
+ }, As = async (t, e, n, o, r) => Bc(async () => (await Dc(t, n, o, r), t.toSpeech(e))), qc = (t) => t.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), Fc = async (t, e, n, o) => {
3782
3805
  try {
3783
- const r = Hc(await Cs(t, e, n, "ssml", o));
3806
+ const r = qc(await As(t, e, n, "ssml", o));
3784
3807
  return r.includes("<speak") ? r : null;
3785
3808
  } catch (r) {
3786
3809
  return console.debug("[TTSService] Math SSML generation failed; using plain", { message: r instanceof Error ? r.message : String(r) }), null;
3787
3810
  }
3788
- }, As = async (t, e = {}) => {
3811
+ }, Is = async (t, e = {}) => {
3789
3812
  if (!t.some((c) => c.type === "math")) return {
3790
3813
  speechText: H(t.map((c) => c.type === "text" ? c.text : c.fallbackText).join(" ")),
3791
3814
  usedMathSpeech: !1,
3792
3815
  usedFallback: !1
3793
3816
  };
3794
3817
  let n = null, o = !1, r = !1;
3795
- const i = e.loadSre || _c, s = [];
3818
+ const i = e.loadSre || Hc, s = [];
3796
3819
  for (const c of t) {
3797
3820
  if (c.type === "text") {
3798
3821
  s.push(c.text);
@@ -3800,7 +3823,7 @@ var Pc = {
3800
3823
  }
3801
3824
  try {
3802
3825
  n || (n = await i());
3803
- const u = H(await Cs(n, c.mathml, e.language, "none", e.mathSpeech));
3826
+ const u = H(await As(n, c.mathml, e.language, "none", e.mathSpeech));
3804
3827
  if (u) {
3805
3828
  s.push(u), o = !0;
3806
3829
  continue;
@@ -3812,18 +3835,18 @@ var Pc = {
3812
3835
  }
3813
3836
  const a = H(s.join(" "));
3814
3837
  let l;
3815
- return e.produceSsml && n && o && t.length === 1 && t[0].type === "math" && (l = await jc(n, t[0].mathml, e.language, e.mathSpeech) ?? void 0), {
3838
+ return e.produceSsml && n && o && t.length === 1 && t[0].type === "math" && (l = await Fc(n, t[0].mathml, e.language, e.mathSpeech) ?? void 0), {
3816
3839
  speechText: a,
3817
3840
  usedMathSpeech: o,
3818
3841
  usedFallback: r,
3819
3842
  ssml: l
3820
3843
  };
3821
- }, Dc = /* @__PURE__ */ new Set([
3844
+ }, Vc = /* @__PURE__ */ new Set([
3822
3845
  "reserved-row",
3823
3846
  "expanding-row",
3824
3847
  "floating-overlay",
3825
3848
  "left-aligned"
3826
- ]), Zr = (t) => t && typeof t == "object" ? t : {}, Bc = (t) => t === "polly" || t === "google" || t === "server", ot = (t, e) => t === void 0 ? e : t, Gn = (t, e = "left-aligned") => typeof t == "string" && Dc.has(t) ? t : e, Qr = Object.freeze([0.8, 1.25]), vo = (t) => {
3849
+ ]), Zr = (t) => t && typeof t == "object" ? t : {}, Gc = (t) => t === "polly" || t === "google" || t === "server", ot = (t, e) => t === void 0 ? e : t, Gn = (t, e = "left-aligned") => typeof t == "string" && Vc.has(t) ? t : e, Qr = Object.freeze([0.8, 1.25]), vo = (t) => {
3827
3850
  if (!Array.isArray(t)) return [...Qr];
3828
3851
  if (t.length === 0) return [];
3829
3852
  const e = /* @__PURE__ */ new Set();
@@ -3833,12 +3856,12 @@ var Pc = {
3833
3856
  o !== 1 && e.add(o);
3834
3857
  }
3835
3858
  return e.size ? Array.from(e) : [...Qr];
3836
- }, Fc = (t) => {
3859
+ }, Uc = (t) => {
3837
3860
  const e = {
3838
3861
  ...t,
3839
3862
  layoutMode: Gn(t.layoutMode)
3840
3863
  }, n = t.backend || "browser";
3841
- if (!Bc(n)) return e;
3864
+ if (!Gc(n)) return e;
3842
3865
  const o = {
3843
3866
  ...e,
3844
3867
  apiEndpoint: ot(e.apiEndpoint, "/api/tts"),
@@ -3861,12 +3884,12 @@ var Pc = {
3861
3884
  } : o;
3862
3885
  }, bo = (t) => {
3863
3886
  const e = Zr(t), n = Zr(e.settings);
3864
- return Fc({
3887
+ return Uc({
3865
3888
  ...e,
3866
3889
  ...n
3867
3890
  });
3868
- }, Ro = (t) => t.backend || "browser", Is = (t, e) => e === "polly" || e === "google" ? e : t.serverProvider || t.provider, Ms = (t, e) => t.transportMode || (e === "custom" ? "custom" : "pie"), qc = (t) => {
3869
- const e = Ro(t), n = Is(t, e), o = Ms(t, n), r = Qn(t.mathSpeech);
3891
+ }, Ro = (t) => t.backend || "browser", Ms = (t, e) => e === "polly" || e === "google" ? e : t.serverProvider || t.provider, $s = (t, e) => t.transportMode || (e === "custom" ? "custom" : "pie"), Kc = (t) => {
3892
+ const e = Ro(t), n = Ms(t, e), o = $s(t, n), r = Qn(t.mathSpeech);
3870
3893
  return {
3871
3894
  voice: t.defaultVoice,
3872
3895
  rate: t.rate,
@@ -3892,8 +3915,8 @@ var Pc = {
3892
3915
  validateEndpoint: t.validateEndpoint,
3893
3916
  ...typeof t.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: t.mathTokenHighlighting } : {}
3894
3917
  };
3895
- }, $s = (t) => Gn(t.layoutMode), Vc = (t) => {
3896
- switch ($s(t)) {
3918
+ }, Os = (t) => Gn(t.layoutMode), Yc = (t) => {
3919
+ switch (Os(t)) {
3897
3920
  case "reserved-row":
3898
3921
  return {
3899
3922
  mount: "before-buttons",
@@ -3919,21 +3942,21 @@ var Pc = {
3919
3942
  }
3920
3943
  };
3921
3944
  }
3922
- }, Be = /* @__PURE__ */ new Map(), Gc = "__pieToolElementUnmount", ti = "pie-tool-active-change", Uc = {
3945
+ }, Be = /* @__PURE__ */ new Map(), Xc = "__pieToolElementUnmount", ti = "pie-tool-active-change", Jc = {
3923
3946
  toolId: "textToSpeech",
3924
3947
  name: "Text to Speech",
3925
3948
  description: "Read content aloud",
3926
3949
  icon: "volume-up",
3927
3950
  provider: {
3928
3951
  getProviderId: () => "tts",
3929
- createProvider: (t) => new xc(Ro(bo(t))),
3952
+ createProvider: (t) => new Ic(Ro(bo(t))),
3930
3953
  getInitConfig: (t) => {
3931
- const e = bo(t), n = Ro(e), o = Is(e, n);
3954
+ const e = bo(t), n = Ro(e), o = Ms(e, n);
3932
3955
  return {
3933
3956
  backend: n,
3934
3957
  serverProvider: o,
3935
- transportMode: Ms(e, o),
3936
- ...qc(e)
3958
+ transportMode: $s(e, o),
3959
+ ...Kc(e)
3937
3960
  };
3938
3961
  },
3939
3962
  getAuthFetcher: (t) => {
@@ -3959,12 +3982,12 @@ var Pc = {
3959
3982
  return In(t);
3960
3983
  },
3961
3984
  renderToolbar(t, e) {
3962
- const n = () => bo(e.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), o = () => vo(n().speedOptions), r = () => $s(n()), i = () => Vc(n()), s = dr(this.toolId, e.scope.level, e.scope.scopeId), a = () => {
3985
+ const n = () => bo(e.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), o = () => vo(n().speedOptions), r = () => Os(n()), i = () => Yc(n()), s = dr(this.toolId, e.scope.level, e.scope.scopeId), a = () => {
3963
3986
  const u = e.ui?.size;
3964
3987
  return u === "sm" || u === "lg" ? u : "md";
3965
3988
  }, l = () => {
3966
3989
  let u = Be.get(s);
3967
- return u && typeof u.isConnected == "boolean" && !u.isConnected && (Be.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[Gc] = () => {
3990
+ return u && typeof u.isConnected == "boolean" && !u.isConnected && (Be.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[Xc] = () => {
3968
3991
  Be.get(s) === u && Be.delete(s);
3969
3992
  }, Be.set(s, u)), u.setAttribute("tool-id", s), u.setAttribute("catalog-id", e.catalogId || e.itemId), u.setAttribute("language", e.language || "en-US"), u.setAttribute("size", a()), u.setAttribute("layout-mode", r()), u.speedOptions = o(), u;
3970
3993
  }, c = i();
@@ -4013,9 +4036,9 @@ function Pt(t) {
4013
4036
  function yo(t, e) {
4014
4037
  t.setAttribute("data-pie-tool-surface", e);
4015
4038
  }
4016
- var Kc = [
4017
- Pc,
4018
- Uc,
4039
+ var Zc = [
4040
+ Wc,
4041
+ Jc,
4019
4042
  {
4020
4043
  toolId: "ruler",
4021
4044
  name: "Ruler",
@@ -4115,7 +4138,7 @@ var Kc = [
4115
4138
  "choiceMasking"
4116
4139
  ],
4117
4140
  isVisibleInContext(t) {
4118
- return bc(t);
4141
+ return yc(t);
4119
4142
  },
4120
4143
  renderToolbar(t, e) {
4121
4144
  const n = Lt(this.toolId, e), o = e.componentOverrides ?? {}, r = kt(this.toolId, t, e, o);
@@ -4426,7 +4449,7 @@ var Kc = [
4426
4449
  "elementReference"
4427
4450
  ],
4428
4451
  isVisibleInContext(t) {
4429
- return yc(t);
4452
+ return Tc(t);
4430
4453
  },
4431
4454
  renderToolbar(t, e) {
4432
4455
  const n = Lt(this.toolId, e), o = {
@@ -4468,36 +4491,36 @@ var Kc = [
4468
4491
  }
4469
4492
  }
4470
4493
  ];
4471
- function Yc(t = {}) {
4472
- const e = new gc(), n = {
4494
+ function Qc(t = {}) {
4495
+ const e = new mc(), n = {
4473
4496
  toolTagMap: {
4474
- ...Ss,
4497
+ ...ks,
4475
4498
  ...t.toolTagMap || {}
4476
4499
  },
4477
4500
  toolComponentFactory: t.toolComponentFactory,
4478
4501
  toolComponentFactories: t.toolComponentFactories
4479
4502
  }, o = (r) => t.overrides?.[r.toolId] || r;
4480
- return t.includePackagedTools && Xc(e, {
4503
+ return t.includePackagedTools && tu(e, {
4481
4504
  toolIds: t.toolIds,
4482
4505
  applyOverrides: o
4483
4506
  }), t.toolModuleLoaders && Object.keys(t.toolModuleLoaders).length > 0 && e.setToolModuleLoaders(t.toolModuleLoaders), e.setComponentOverrides(n), e;
4484
4507
  }
4485
- function Xc(t, e = {}) {
4508
+ function tu(t, e = {}) {
4486
4509
  const n = e.toolIds && e.toolIds.length > 0 ? new Set(e.toolIds) : null, o = e.applyOverrides || ((r) => r);
4487
- for (const r of Kc) n && !n.has(r.toolId) || t.register(o(r));
4510
+ for (const r of Zc) n && !n.has(r.toolId) || t.register(o(r));
4488
4511
  }
4489
- function Jc(t = {}) {
4490
- return Yc({
4512
+ function eu(t = {}) {
4513
+ return Qc({
4491
4514
  ...t,
4492
4515
  includePackagedTools: !0
4493
4516
  });
4494
4517
  }
4495
- function Zc() {
4496
- const t = Jc(), e = /* @__PURE__ */ new Set();
4518
+ function nu() {
4519
+ const t = eu(), e = /* @__PURE__ */ new Set();
4497
4520
  for (const n of t.getAllTools()) for (const o of n.pnpSupportIds || []) e.add(o);
4498
4521
  return [...e].sort();
4499
4522
  }
4500
- [...Zc()];
4523
+ [...nu()];
4501
4524
  Object.values({
4502
4525
  visual: {
4503
4526
  magnification: "magnification",
@@ -4616,7 +4639,7 @@ var ei;
4616
4639
  (function(t) {
4617
4640
  t[t.BASE = 0] = "BASE", t[t.TOOL = 1e3] = "TOOL", t[t.MODAL = 2e3] = "MODAL", t[t.CONTROL = 3e3] = "CONTROL", t[t.HIGHLIGHT = 4e3] = "HIGHLIGHT";
4618
4641
  })(ei || (ei = {}));
4619
- var Qc = /* @__PURE__ */ new Set([
4642
+ var ou = /* @__PURE__ */ new Set([
4620
4643
  "speak",
4621
4644
  "p",
4622
4645
  "s",
@@ -4625,20 +4648,20 @@ var Qc = /* @__PURE__ */ new Set([
4625
4648
  "say-as",
4626
4649
  "voice",
4627
4650
  "lang"
4628
- ]), ni = /* @__PURE__ */ new Set(["audio", "phoneme"]), Os = (t) => t.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&#160;/g, " ").replace(/&amp;/g, "&"), Mn = (t, e, n) => {
4651
+ ]), ni = /* @__PURE__ */ new Set(["audio", "phoneme"]), Ls = (t) => t.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&#160;/g, " ").replace(/&amp;/g, "&"), Mn = (t, e, n) => {
4629
4652
  for (let o = 0; o < e.length; o++) t.push({
4630
4653
  char: e[o],
4631
4654
  rawOffset: n === null ? null : n + o
4632
4655
  });
4633
- }, tu = (t, e, n) => {
4656
+ }, ru = (t, e, n) => {
4634
4657
  const o = e.slice(n).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
4635
- return o ? (Mn(t, Os(o[0]), n), o[0].length) : 0;
4658
+ return o ? (Mn(t, Ls(o[0]), n), o[0].length) : 0;
4636
4659
  }, oi = (t) => {
4637
4660
  t.push({
4638
4661
  char: " ",
4639
4662
  rawOffset: null
4640
4663
  });
4641
- }, eu = (t) => {
4664
+ }, iu = (t) => {
4642
4665
  const e = /* @__PURE__ */ new Map(), n = [];
4643
4666
  let o = !0;
4644
4667
  for (const r of t) {
@@ -4654,17 +4677,17 @@ var Qc = /* @__PURE__ */ new Set([
4654
4677
  text: n.join(""),
4655
4678
  rawToSpokenOffsetMap: e
4656
4679
  };
4657
- }, nu = (t) => t.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", ou = (t, e) => {
4680
+ }, su = (t) => t.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", au = (t, e) => {
4658
4681
  const n = new RegExp(`${e}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), o = t.match(n);
4659
- return Os(o?.[2] ?? o?.[3] ?? "") || null;
4660
- }, Ls = (t) => {
4682
+ return Ls(o?.[2] ?? o?.[3] ?? "") || null;
4683
+ }, Ps = (t) => {
4661
4684
  const e = [];
4662
4685
  let n = !1, o = !1, r = 0;
4663
4686
  for (; r < t.length; ) {
4664
4687
  const s = t[r];
4665
4688
  if (s !== "<") {
4666
4689
  if (s === "&") {
4667
- const p = tu(e, t, r);
4690
+ const p = ru(e, t, r);
4668
4691
  if (p > 0) {
4669
4692
  r += p;
4670
4693
  continue;
@@ -4679,9 +4702,9 @@ var Qc = /* @__PURE__ */ new Set([
4679
4702
  continue;
4680
4703
  }
4681
4704
  o = !0;
4682
- const l = t.slice(r, a + 1), c = nu(l), u = /^<\s*\//.test(l), h = /\/\s*>$/.test(l);
4705
+ const l = t.slice(r, a + 1), c = su(l), u = /^<\s*\//.test(l), h = /\/\s*>$/.test(l);
4683
4706
  if (!u && c === "sub") {
4684
- const p = ou(l, "alias");
4707
+ const p = au(l, "alias");
4685
4708
  if (!p) {
4686
4709
  n = !0, r = a + 1;
4687
4710
  continue;
@@ -4699,16 +4722,16 @@ var Qc = /* @__PURE__ */ new Set([
4699
4722
  r = a + 1;
4700
4723
  continue;
4701
4724
  }
4702
- c && !Qc.has(c) && !ni.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && oi(e), r = a + 1;
4725
+ c && !ou.has(c) && !ni.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && oi(e), r = a + 1;
4703
4726
  }
4704
- const i = eu(e);
4727
+ const i = iu(e);
4705
4728
  return {
4706
4729
  spokenText: H(i.text),
4707
4730
  rawToSpokenOffsetMap: i.rawToSpokenOffsetMap,
4708
4731
  unsupportedSemantic: n,
4709
4732
  hasMarkup: o
4710
4733
  };
4711
- }, ru = ks(), Ps = /* @__PURE__ */ new Map([
4734
+ }, lu = xs(), _s = /* @__PURE__ */ new Map([
4712
4735
  ["zero", "0"],
4713
4736
  ["one", "1"],
4714
4737
  ["two", "2"],
@@ -4720,7 +4743,7 @@ var Qc = /* @__PURE__ */ new Set([
4720
4743
  ["eight", "8"],
4721
4744
  ["nine", "9"],
4722
4745
  ["ten", "10"]
4723
- ]), iu = [
4746
+ ]), cu = [
4724
4747
  {
4725
4748
  phrase: [
4726
4749
  "plus",
@@ -4797,7 +4820,7 @@ var Qc = /* @__PURE__ */ new Set([
4797
4820
  }
4798
4821
  ], Wo = (t) => {
4799
4822
  const e = [];
4800
- for (const n of t.matchAll(ru)) {
4823
+ for (const n of t.matchAll(lu)) {
4801
4824
  const o = n[0], r = n.index ?? 0;
4802
4825
  e.push({
4803
4826
  text: o,
@@ -4807,7 +4830,7 @@ var Qc = /* @__PURE__ */ new Set([
4807
4830
  });
4808
4831
  }
4809
4832
  return e;
4810
- }, zo = (t) => Ps.get(t.normalized) || t.normalized, su = (t, e) => {
4833
+ }, zo = (t) => _s.get(t.normalized) || t.normalized, uu = (t, e) => {
4811
4834
  const n = [];
4812
4835
  for (let o = 0; o < t.length; o++) {
4813
4836
  for (let r = 0; r < e.length; r++) zo(t[o]) === zo(e[r]) && n.push({
@@ -4816,7 +4839,7 @@ var Qc = /* @__PURE__ */ new Set([
4816
4839
  visibleToken: r,
4817
4840
  score: 10
4818
4841
  });
4819
- for (const r of iu) {
4842
+ for (const r of cu) {
4820
4843
  const i = t.slice(o, o + r.phrase.length);
4821
4844
  if (i.length === r.phrase.length && i.every((s, a) => s.normalized === r.phrase[a])) for (let s = 0; s < e.length; s++) e[s].normalized === r.visible && n.push({
4822
4845
  spokenStartToken: o,
@@ -4827,8 +4850,8 @@ var Qc = /* @__PURE__ */ new Set([
4827
4850
  }
4828
4851
  }
4829
4852
  return n;
4830
- }, au = (t, e) => {
4831
- const n = su(t, e).sort((l, c) => t[l.spokenStartToken].start - t[c.spokenStartToken].start || e[l.visibleToken].start - e[c.visibleToken].start), o = new Array(n.length).fill(0), r = new Array(n.length).fill(-1);
4853
+ }, hu = (t, e) => {
4854
+ const n = uu(t, e).sort((l, c) => t[l.spokenStartToken].start - t[c.spokenStartToken].start || e[l.visibleToken].start - e[c.visibleToken].start), o = new Array(n.length).fill(0), r = new Array(n.length).fill(-1);
4832
4855
  for (let l = 0; l < n.length; l++) {
4833
4856
  const c = n[l];
4834
4857
  o[l] = c.score;
@@ -4856,12 +4879,12 @@ var Qc = /* @__PURE__ */ new Set([
4856
4879
  score: l.score
4857
4880
  };
4858
4881
  });
4859
- }, lu = (t, e, n) => {
4882
+ }, du = (t, e, n) => {
4860
4883
  if (t.length === 0) return 0;
4861
4884
  const o = t.length / Math.max(1, Math.min(e.length, n.length)), r = t.reduce((i, s) => i + s.score, 0) / t.length / 10;
4862
4885
  return Math.min(1, o * r);
4863
4886
  }, Ns = (t) => {
4864
- const e = Ls(t.speechText), n = H(t.visibleText), o = e.spokenText, r = Wo(o), i = Wo(n), s = e.unsupportedSemantic ? [] : au(r, i), a = lu(s, r, i), l = o === n && o.length > 0, c = s.length === 1 && s[0].score === 10 && r.length <= 2 && i.length <= 2, u = e.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", h = e.unsupportedSemantic ? "unsupported" : e.hasMarkup ? "raw-ssml" : "plain-spoken-text";
4887
+ const e = Ps(t.speechText), n = H(t.visibleText), o = e.spokenText, r = Wo(o), i = Wo(n), s = e.unsupportedSemantic ? [] : hu(r, i), a = du(s, r, i), l = o === n && o.length > 0, c = s.length === 1 && s[0].score === 10 && r.length <= 2 && i.length <= 2, u = e.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", h = e.unsupportedSemantic ? "unsupported" : e.hasMarkup ? "raw-ssml" : "plain-spoken-text";
4865
4888
  return {
4866
4889
  speechText: t.speechText,
4867
4890
  spokenText: o,
@@ -4874,12 +4897,12 @@ var Qc = /* @__PURE__ */ new Set([
4874
4897
  visibleTokens: i,
4875
4898
  rawToSpokenOffsetMap: e.rawToSpokenOffsetMap
4876
4899
  };
4877
- }, fr = (t, e) => t.find((n) => n.start <= e && e < n.end) || null, _s = (t) => {
4900
+ }, fr = (t, e) => t.find((n) => n.start <= e && e < n.end) || null, Rs = (t) => {
4878
4901
  if (!t || /^<[^>]+>$/.test(t.trim())) return null;
4879
4902
  const e = Wo(t)[0];
4880
- return e ? Ps.get(e.normalized) || e.normalized : null;
4903
+ return e ? _s.get(e.normalized) || e.normalized : null;
4881
4904
  }, ri = (t, e, n) => {
4882
- const o = _s(n);
4905
+ const o = Rs(n);
4883
4906
  if (!e || !o) return !1;
4884
4907
  const r = fr(t.spokenTokens, e.start);
4885
4908
  return r ? zo(r) === o : !1;
@@ -4907,7 +4930,7 @@ var Qc = /* @__PURE__ */ new Set([
4907
4930
  start: e,
4908
4931
  length: Math.min(n, o.end - e)
4909
4932
  } : null;
4910
- }, cu = (t, e, n = 1, o) => {
4933
+ }, pu = (t, e, n = 1, o) => {
4911
4934
  if (t.boundaryOffsetMode === "unsupported" || !Number.isFinite(e)) return null;
4912
4935
  const r = Math.max(1, Number.isFinite(n) ? n : 1);
4913
4936
  if (o && /^<[^>]+>$/.test(o.trim())) return null;
@@ -4916,12 +4939,12 @@ var Qc = /* @__PURE__ */ new Set([
4916
4939
  if (o) {
4917
4940
  if (ri(t, i, o)) return i;
4918
4941
  if (ri(t, s, o)) return s;
4919
- if (_s(o)) return null;
4942
+ if (Rs(o)) return null;
4920
4943
  }
4921
4944
  return i || s;
4922
4945
  }
4923
4946
  return ai(t, e, r) || si(t, e, r);
4924
- }, uu = (t, e) => {
4947
+ }, fu = (t, e) => {
4925
4948
  if (t.playbackMode === "region-fallback") return null;
4926
4949
  const n = t.anchors.find((i) => i.spokenStart <= e && e < i.spokenEnd);
4927
4950
  if (n) return {
@@ -4943,7 +4966,7 @@ var Qc = /* @__PURE__ */ new Set([
4943
4966
  start: Math.min(o.visibleStart, r.visibleStart),
4944
4967
  end: Math.max(o.visibleEnd, r.visibleEnd)
4945
4968
  } : null;
4946
- }, hu = /* @__PURE__ */ new Map([
4969
+ }, gu = /* @__PURE__ */ new Map([
4947
4970
  ["+", ["plus"]],
4948
4971
  ["-", ["minus", "negative"]],
4949
4972
  ["−", ["minus", "negative"]],
@@ -4967,12 +4990,12 @@ var Qc = /* @__PURE__ */ new Set([
4967
4990
  ["•", ["times"]],
4968
4991
  ["·", ["times"]],
4969
4992
  ["⁢", ["times", "multiplied by"]]
4970
- ]), du = /* @__PURE__ */ new Map([
4993
+ ]), mu = /* @__PURE__ */ new Map([
4971
4994
  ["⁡", "function-application"],
4972
4995
  ["⁢", "implicit-multiply"],
4973
4996
  ["⁣", "invisible-separator"],
4974
4997
  ["⁤", "invisible-plus"]
4975
- ]), Rs = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), pu = /* @__PURE__ */ new Map([
4998
+ ]), Ws = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), vu = /* @__PURE__ */ new Map([
4976
4999
  ["msqrt", "radical"],
4977
5000
  ["mroot", "radical"],
4978
5001
  ["msub", "subscript"],
@@ -4982,11 +5005,11 @@ var Qc = /* @__PURE__ */ new Set([
4982
5005
  ["munderover", "underoverscript"],
4983
5006
  ["mmultiscripts", "multiscript"],
4984
5007
  ["menclose", "enclosure"]
4985
- ]), fu = (t) => t.replace(/\s+/g, " ").trim(), he = (t) => (t.localName || t.tagName || "").toLowerCase(), gu = (t) => t.nodeType === Node.ELEMENT_NODE, Pe = (t) => Array.from(t.childNodes).filter(gu), gr = (t) => fu(t.textContent || ""), zt = (t, e) => ({
5008
+ ]), bu = (t) => t.replace(/\s+/g, " ").trim(), he = (t) => (t.localName || t.tagName || "").toLowerCase(), yu = (t) => t.nodeType === Node.ELEMENT_NODE, Pe = (t) => Array.from(t.childNodes).filter(yu), gr = (t) => bu(t.textContent || ""), zt = (t, e) => ({
4986
5009
  type: "element-range",
4987
5010
  quality: e,
4988
5011
  element: t
4989
- }), mu = (t) => {
5012
+ }), Tu = (t) => {
4990
5013
  switch (t) {
4991
5014
  case "mi":
4992
5015
  return "identifier";
@@ -5002,15 +5025,15 @@ var Qc = /* @__PURE__ */ new Set([
5002
5025
  default:
5003
5026
  return "unknown";
5004
5027
  }
5005
- }, vu = (t, e) => e === "operator" ? t === "−" ? "-" : t : t.toLowerCase(), bu = (t, e, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? Rs.get(t) ?? [] : t === "|" ? ["absolute value"] : e === "operator" ? hu.get(t) || [] : [], me = (t) => {
5006
- const e = t.normalized ?? vu(t.text, t.kind || "unknown");
5028
+ }, wu = (t, e) => e === "operator" ? t === "−" ? "-" : t : t.toLowerCase(), Su = (t, e, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? Ws.get(t) ?? [] : t === "|" ? ["absolute value"] : e === "operator" ? gu.get(t) || [] : [], me = (t) => {
5029
+ const e = t.normalized ?? wu(t.text, t.kind || "unknown");
5007
5030
  return {
5008
5031
  id: `math-token-${t.state.nextId++}`,
5009
5032
  kind: t.kind,
5010
5033
  role: t.role,
5011
5034
  text: t.text,
5012
5035
  normalized: e,
5013
- spokenAliases: bu(t.text, t.kind, t.role),
5036
+ spokenAliases: Su(t.text, t.kind, t.role),
5014
5037
  sourceElement: t.sourceElement,
5015
5038
  path: t.path,
5016
5039
  target: t.target || zt(t.sourceElement, "element-range"),
@@ -5018,9 +5041,9 @@ var Qc = /* @__PURE__ */ new Set([
5018
5041
  };
5019
5042
  }, ve = (t, e, n = "tokens") => {
5020
5043
  t[n].push(e);
5021
- }, Ws = (t, e, n) => {
5044
+ }, zs = (t, e, n) => {
5022
5045
  Pe(t).forEach((o, r) => Ht(o, e, `${n}/${he(o)}[${r}]`));
5023
- }, yu = (t, e, n) => {
5046
+ }, ku = (t, e, n) => {
5024
5047
  const o = Pe(t);
5025
5048
  o[0] && Ht(o[0], e, `${n}/numerator`), ve(e, me({
5026
5049
  state: e,
@@ -5031,7 +5054,7 @@ var Qc = /* @__PURE__ */ new Set([
5031
5054
  path: n,
5032
5055
  target: zt(t, "element-range")
5033
5056
  })), o[1] && Ht(o[1], e, `${n}/denominator`);
5034
- }, Tu = (t, e, n) => {
5057
+ }, xu = (t, e, n) => {
5035
5058
  const o = t.getAttribute("open") || "(", r = t.getAttribute("close") || ")";
5036
5059
  ve(e, me({
5037
5060
  state: e,
@@ -5041,7 +5064,7 @@ var Qc = /* @__PURE__ */ new Set([
5041
5064
  sourceElement: t,
5042
5065
  path: `${n}/open`,
5043
5066
  target: zt(t, "element-range")
5044
- })), Ws(t, e, n), ve(e, me({
5067
+ })), zs(t, e, n), ve(e, me({
5045
5068
  state: e,
5046
5069
  kind: "operator",
5047
5070
  role: r === "|" ? "absolute-value-fence" : "close-fence",
@@ -5050,13 +5073,13 @@ var Qc = /* @__PURE__ */ new Set([
5050
5073
  path: `${n}/close`,
5051
5074
  target: zt(t, "element-range")
5052
5075
  }));
5053
- }, wu = (t, e, n) => {
5076
+ }, Eu = (t, e, n) => {
5054
5077
  const o = Pe(t);
5055
5078
  o[0] && Ht(o[0], e, `${n}/base`);
5056
5079
  const r = o[1];
5057
5080
  if (!r) return;
5058
5081
  const i = gr(r);
5059
- if (Rs.has(i)) {
5082
+ if (Ws.has(i)) {
5060
5083
  ve(e, me({
5061
5084
  state: e,
5062
5085
  kind: "structure",
@@ -5070,7 +5093,7 @@ var Qc = /* @__PURE__ */ new Set([
5070
5093
  return;
5071
5094
  }
5072
5095
  Ht(r, e, `${n}/exponent`);
5073
- }, Su = (t, e, n, o) => {
5096
+ }, Cu = (t, e, n, o) => {
5074
5097
  ve(e, me({
5075
5098
  state: e,
5076
5099
  kind: "structure",
@@ -5081,7 +5104,7 @@ var Qc = /* @__PURE__ */ new Set([
5081
5104
  path: n,
5082
5105
  target: zt(t, "element-range")
5083
5106
  }));
5084
- }, ku = (t, e, n) => {
5107
+ }, Au = (t, e, n) => {
5085
5108
  let o = 0;
5086
5109
  for (const r of Pe(t)) (he(r) === "mtr" || he(r) === "mlabeledtr") && (o++, ve(e, me({
5087
5110
  state: e,
@@ -5093,10 +5116,10 @@ var Qc = /* @__PURE__ */ new Set([
5093
5116
  path: `${n}/row[${o}]`,
5094
5117
  target: zt(r, "region-fallback")
5095
5118
  }), "layoutTargets")), Ht(r, e, `${n}/${he(r)}[${o}]`);
5096
- }, xu = (t, e, n) => {
5119
+ }, Iu = (t, e, n) => {
5097
5120
  const o = gr(t);
5098
5121
  if (!o) return;
5099
- const r = mu(he(t)), i = r === "operator" ? du.get(o) : void 0, s = i ?? (r === "operator" && (o === "(" || o === ")") ? "grouping-fence" : r);
5122
+ const r = Tu(he(t)), i = r === "operator" ? mu.get(o) : void 0, s = i ?? (r === "operator" && (o === "(" || o === ")") ? "grouping-fence" : r);
5100
5123
  ve(e, me({
5101
5124
  state: e,
5102
5125
  kind: r,
@@ -5127,19 +5150,19 @@ var Qc = /* @__PURE__ */ new Set([
5127
5150
  case "mtext":
5128
5151
  case "ms":
5129
5152
  case "mspace":
5130
- xu(t, e, n);
5153
+ Iu(t, e, n);
5131
5154
  return;
5132
5155
  case "mfrac":
5133
- yu(t, e, n);
5156
+ ku(t, e, n);
5134
5157
  return;
5135
5158
  case "msup":
5136
- wu(t, e, n);
5159
+ Eu(t, e, n);
5137
5160
  return;
5138
5161
  case "mfenced":
5139
- Tu(t, e, n);
5162
+ xu(t, e, n);
5140
5163
  return;
5141
5164
  case "mtable":
5142
- ku(t, e, n);
5165
+ Au(t, e, n);
5143
5166
  return;
5144
5167
  case "mphantom":
5145
5168
  return;
@@ -5149,15 +5172,15 @@ var Qc = /* @__PURE__ */ new Set([
5149
5172
  return;
5150
5173
  }
5151
5174
  default: {
5152
- const r = pu.get(o);
5175
+ const r = vu.get(o);
5153
5176
  if (r) {
5154
- Su(t, e, n, r);
5177
+ Cu(t, e, n, r);
5155
5178
  return;
5156
5179
  }
5157
- Ws(t, e, n);
5180
+ zs(t, e, n);
5158
5181
  }
5159
5182
  }
5160
- }, Eu = (t) => {
5183
+ }, Mu = (t) => {
5161
5184
  const e = {
5162
5185
  tokens: [],
5163
5186
  layoutTargets: [],
@@ -5168,7 +5191,7 @@ var Qc = /* @__PURE__ */ new Set([
5168
5191
  layoutTargets: e.layoutTargets,
5169
5192
  expressionTarget: zt(t, "region-fallback")
5170
5193
  };
5171
- }, Cu = (t) => t.boundary && t.alignment.segments.find((e) => e.speechTokenIds.includes(t.boundary.token.id))?.target || null, Au = 0.95, Iu = (t) => {
5194
+ }, $u = (t) => t.boundary && t.alignment.segments.find((e) => e.speechTokenIds.includes(t.boundary.token.id))?.target || null, Ou = 0.95, Lu = (t) => {
5172
5195
  const e = [], n = /* @__PURE__ */ new Set(), o = (r) => {
5173
5196
  const i = r.toLowerCase().trim().split(/\s+/).filter(Boolean);
5174
5197
  if (i.length === 0) return;
@@ -5193,11 +5216,11 @@ var Qc = /* @__PURE__ */ new Set([
5193
5216
  i && (o = r.length);
5194
5217
  }
5195
5218
  return o;
5196
- }, Mu = (t, e) => {
5219
+ }, Pu = (t, e) => {
5197
5220
  const n = [];
5198
5221
  let o = 0;
5199
5222
  for (const r of e) {
5200
- const i = Iu(r);
5223
+ const i = Lu(r);
5201
5224
  if (r.optional) {
5202
5225
  const s = li(t, o, i);
5203
5226
  s > 0 && (n.push({
@@ -5219,23 +5242,23 @@ var Qc = /* @__PURE__ */ new Set([
5219
5242
  }
5220
5243
  }
5221
5244
  return n;
5222
- }, $u = (t, e, n) => {
5245
+ }, _u = (t, e, n) => {
5223
5246
  const o = n.filter((s) => !s.optional).length, r = t.filter((s) => !s.math.optional).length, i = t.reduce((s, a) => s + a.speechTokens.length, 0);
5224
5247
  return o > 0 && r === o && i === e.length;
5225
- }, Ou = (t) => t.map(({ speechTokens: e, math: n }) => ({
5248
+ }, Nu = (t) => t.map(({ speechTokens: e, math: n }) => ({
5226
5249
  speechTokenIds: e.map((o) => o.id),
5227
5250
  mathTokenIds: [n.id],
5228
5251
  score: 1,
5229
5252
  confidence: 1,
5230
5253
  target: n.target
5231
- })), Lu = (t) => {
5232
- const e = t.minExactWordConfidence ?? Au, n = Mu(t.speech.tokens, t.math.tokens), o = $u(n, t.speech.tokens, t.math.tokens) ? 1 : 0;
5254
+ })), Ru = (t) => {
5255
+ const e = t.minExactWordConfidence ?? Ou, n = Pu(t.speech.tokens, t.math.tokens), o = _u(n, t.speech.tokens, t.math.tokens) ? 1 : 0;
5233
5256
  return {
5234
- segments: o >= e ? Ou(n) : [],
5257
+ segments: o >= e ? Nu(n) : [],
5235
5258
  confidence: o,
5236
5259
  fallbackTarget: t.math.expressionTarget
5237
5260
  };
5238
- }, zs = ks(), Pu = /* @__PURE__ */ new Map([
5261
+ }, Hs = xs(), Wu = /* @__PURE__ */ new Map([
5239
5262
  ["zero", "0"],
5240
5263
  ["one", "1"],
5241
5264
  ["two", "2"],
@@ -5247,17 +5270,17 @@ var Qc = /* @__PURE__ */ new Set([
5247
5270
  ["eight", "8"],
5248
5271
  ["nine", "9"],
5249
5272
  ["ten", "10"]
5250
- ]), Hs = (t) => {
5273
+ ]), js = (t) => {
5251
5274
  const e = t.toLowerCase();
5252
- return Pu.get(e) || e;
5253
- }, Nu = (t) => {
5275
+ return Wu.get(e) || e;
5276
+ }, zu = (t) => {
5254
5277
  const e = [];
5255
- for (const n of t.matchAll(zs)) {
5278
+ for (const n of t.matchAll(Hs)) {
5256
5279
  const o = n[0], r = n.index ?? 0;
5257
5280
  e.push({
5258
5281
  id: `speech-token-${e.length}`,
5259
5282
  text: o,
5260
- normalized: Hs(o),
5283
+ normalized: js(o),
5261
5284
  start: r,
5262
5285
  end: r + o.length,
5263
5286
  sourceStart: r,
@@ -5267,11 +5290,11 @@ var Qc = /* @__PURE__ */ new Set([
5267
5290
  }
5268
5291
  return e;
5269
5292
  }, sn = (t) => {
5270
- const e = Ls(t.speechText);
5293
+ const e = Ps(t.speechText);
5271
5294
  return {
5272
5295
  speechText: t.speechText,
5273
5296
  spokenText: e.spokenText,
5274
- tokens: Nu(e.spokenText),
5297
+ tokens: zu(e.spokenText),
5275
5298
  rawToSpokenOffsetMap: e.rawToSpokenOffsetMap,
5276
5299
  boundaryOffsetSpace: e.unsupportedSemantic ? "unsupported" : e.hasMarkup ? "raw-ssml" : "plain-spoken-text",
5277
5300
  unsupportedSemantic: e.unsupportedSemantic,
@@ -5279,9 +5302,9 @@ var Qc = /* @__PURE__ */ new Set([
5279
5302
  };
5280
5303
  }, mr = (t) => {
5281
5304
  if (!t || /^<[^>]+>$/.test(t.trim())) return null;
5282
- const e = t.match(zs);
5283
- return e?.[0] ? Hs(e[0]) : null;
5284
- }, _u = (t, e) => t.find((n) => n.start <= e && e < n.end) || null, Ru = (t, e) => {
5305
+ const e = t.match(Hs);
5306
+ return e?.[0] ? js(e[0]) : null;
5307
+ }, Hu = (t, e) => t.find((n) => n.start <= e && e < n.end) || null, ju = (t, e) => {
5285
5308
  const n = t.rawToSpokenOffsetMap.get(e);
5286
5309
  if (n !== void 0) return n;
5287
5310
  for (let o = e; o < t.speechText.length; o++) {
@@ -5292,7 +5315,7 @@ var Qc = /* @__PURE__ */ new Set([
5292
5315
  return null;
5293
5316
  }, Ho = (t, e, n) => {
5294
5317
  if (e === null) return null;
5295
- const o = _u(t.tokens, e);
5318
+ const o = Hu(t.tokens, e);
5296
5319
  return o ? {
5297
5320
  token: o,
5298
5321
  start: e,
@@ -5302,9 +5325,9 @@ var Qc = /* @__PURE__ */ new Set([
5302
5325
  }, jo = (t, e) => {
5303
5326
  const n = mr(e);
5304
5327
  return !!(t && n && t.token.normalized === n);
5305
- }, Wu = (t) => {
5328
+ }, Du = (t) => {
5306
5329
  if (t.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(t.position) || t.boundaryWord && /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
5307
- const e = Math.max(1, Number.isFinite(t.length) ? t.length : 1), n = Ho(t.tokenization, Ru(t.tokenization, t.position), e), o = Ho(t.tokenization, t.position >= 0 && t.position < t.tokenization.spokenText.length ? t.position : null, e);
5330
+ const e = Math.max(1, Number.isFinite(t.length) ? t.length : 1), n = Ho(t.tokenization, ju(t.tokenization, t.position), e), o = Ho(t.tokenization, t.position >= 0 && t.position < t.tokenization.spokenText.length ? t.position : null, e);
5308
5331
  return jo(n, t.boundaryWord) ? {
5309
5332
  ...n,
5310
5333
  confidence: 1
@@ -5312,7 +5335,7 @@ var Qc = /* @__PURE__ */ new Set([
5312
5335
  ...o,
5313
5336
  confidence: 1
5314
5337
  } : t.boundaryWord && mr(t.boundaryWord) ? null : t.tokenization.boundaryOffsetSpace === "raw-ssml" ? n || o : o || n;
5315
- }, zu = (t) => {
5338
+ }, Bu = (t) => {
5316
5339
  if (t.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(t.position) || t.boundaryWord && /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
5317
5340
  const e = Math.max(1, Number.isFinite(t.length) ? t.length : 1), n = Ho(t.tokenization, t.position >= 0 && t.position < t.tokenization.spokenText.length ? t.position : null, e);
5318
5341
  return jo(n, t.boundaryWord) ? {
@@ -5320,27 +5343,27 @@ var Qc = /* @__PURE__ */ new Set([
5320
5343
  confidence: 1
5321
5344
  } : t.boundaryWord && mr(t.boundaryWord) ? null : n;
5322
5345
  }, Un = (t) => {
5323
- const e = sn({ speechText: t.speechText }), n = Eu(t.mathElement);
5346
+ const e = sn({ speechText: t.speechText }), n = Mu(t.mathElement);
5324
5347
  return {
5325
5348
  speech: e,
5326
5349
  math: n,
5327
- result: Lu({
5350
+ result: Ru({
5328
5351
  speech: e,
5329
5352
  math: n
5330
5353
  })
5331
5354
  };
5332
- }, Hu = (t, e) => {
5333
- const n = zu({
5355
+ }, qu = (t, e) => {
5356
+ const n = Bu({
5334
5357
  tokenization: t.speech,
5335
5358
  position: e.position,
5336
5359
  length: e.length,
5337
5360
  boundaryWord: e.boundaryWord
5338
5361
  });
5339
- return Cu({
5362
+ return $u({
5340
5363
  alignment: t.result,
5341
5364
  boundary: n
5342
5365
  });
5343
- }, ju = (t, e) => {
5366
+ }, Fu = (t, e) => {
5344
5367
  if (!e.boundaryWord || /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5345
5368
  const n = sn({ speechText: e.boundaryWord }).tokens[0];
5346
5369
  if (!n) return null;
@@ -5349,7 +5372,7 @@ var Qc = /* @__PURE__ */ new Set([
5349
5372
  return r.normalized.toLowerCase() === i || r.spokenAliases.some((s) => s.toLowerCase() === i);
5350
5373
  });
5351
5374
  return o.length === 1 ? o[0].target : null;
5352
- }, Do = "http://www.w3.org/1998/Math/MathML", Du = /* @__PURE__ */ new Set([
5375
+ }, Do = "http://www.w3.org/1998/Math/MathML", Vu = /* @__PURE__ */ new Set([
5353
5376
  "math",
5354
5377
  "maction",
5355
5378
  "menclose",
@@ -5383,7 +5406,7 @@ var Qc = /* @__PURE__ */ new Set([
5383
5406
  "semantics",
5384
5407
  "annotation",
5385
5408
  "annotation-xml"
5386
- ]), Bu = /* @__PURE__ */ new Set([
5409
+ ]), Gu = /* @__PURE__ */ new Set([
5387
5410
  "accent",
5388
5411
  "accentunder",
5389
5412
  "align",
@@ -5435,44 +5458,44 @@ var Qc = /* @__PURE__ */ new Set([
5435
5458
  "width",
5436
5459
  "xmlns",
5437
5460
  "xml:lang"
5438
- ]), js = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Fu = (t) => js(t).replace(/"/g, "&quot;"), qu = (t, e) => {
5461
+ ]), Ds = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Uu = (t) => Ds(t).replace(/"/g, "&quot;"), Ku = (t, e) => {
5439
5462
  const n = t.toLowerCase(), o = e.trim().toLowerCase();
5440
- return !!(n.startsWith("on") || !Bu.has(n) || o.includes("javascript:") || o.includes("data:text/html"));
5441
- }, Vu = (t) => {
5463
+ return !!(n.startsWith("on") || !Gu.has(n) || o.includes("javascript:") || o.includes("data:text/html"));
5464
+ }, Yu = (t) => {
5442
5465
  const e = t.localName.toLowerCase();
5443
- if (!Du.has(e)) return !1;
5466
+ if (!Vu.has(e)) return !1;
5444
5467
  const n = t.namespaceURI;
5445
5468
  return !n || n === Do || n === "http://www.w3.org/1999/xhtml";
5446
- }, Ds = (t) => {
5447
- if (t.nodeType === Node.TEXT_NODE) return js(t.textContent || "");
5469
+ }, Bs = (t) => {
5470
+ if (t.nodeType === Node.TEXT_NODE) return Ds(t.textContent || "");
5448
5471
  if (t.nodeType === Node.COMMENT_NODE) return "";
5449
5472
  if (t.nodeType !== Node.ELEMENT_NODE) return null;
5450
5473
  const e = t;
5451
- if (!Vu(e)) return null;
5474
+ if (!Yu(e)) return null;
5452
5475
  const n = e.localName.toLowerCase(), o = [];
5453
5476
  for (const i of Array.from(e.attributes)) {
5454
5477
  const s = i.name.toLowerCase();
5455
- if (!qu(s, i.value)) {
5478
+ if (!Ku(s, i.value)) {
5456
5479
  if (s === "xmlns" && i.value !== Do) return null;
5457
- o.push(`${s}="${Fu(i.value)}"`);
5480
+ o.push(`${s}="${Uu(i.value)}"`);
5458
5481
  }
5459
5482
  }
5460
5483
  n === "math" && !o.some((i) => i.startsWith("xmlns=")) && o.unshift(`xmlns="${Do}"`);
5461
5484
  const r = [];
5462
5485
  for (const i of Array.from(e.childNodes)) {
5463
- const s = Ds(i);
5486
+ const s = Bs(i);
5464
5487
  if (s === null) return null;
5465
5488
  r.push(s);
5466
5489
  }
5467
5490
  return `<${n}${o.length > 0 ? ` ${o.join(" ")}` : ""}>${r.join("")}</${n}>`;
5468
- }, Gu = (t) => typeof DOMParser < "u" ? new DOMParser().parseFromString(t, "application/xml") : null, To = (t) => {
5491
+ }, Xu = (t) => typeof DOMParser < "u" ? new DOMParser().parseFromString(t, "application/xml") : null, To = (t) => {
5469
5492
  const e = String(t || "").trim();
5470
5493
  if (!e) return null;
5471
- const n = Gu(e);
5494
+ const n = Xu(e);
5472
5495
  if (!n || n.getElementsByTagName("parsererror").length > 0) return null;
5473
5496
  const o = n.documentElement;
5474
- return !o || o.localName.toLowerCase() !== "math" ? null : Ds(o);
5475
- }, Bs = (t) => ({
5497
+ return !o || o.localName.toLowerCase() !== "math" ? null : Bs(o);
5498
+ }, qs = (t) => ({
5476
5499
  chars: [],
5477
5500
  map: /* @__PURE__ */ new Map(),
5478
5501
  position: 0,
@@ -5480,28 +5503,28 @@ var Qc = /* @__PURE__ */ new Set([
5480
5503
  lastCharWasWhitespace: !1,
5481
5504
  lastMapped: null,
5482
5505
  options: t
5483
- }), Fs = (t) => t.classList?.contains("MathJax") || t.tagName?.toLowerCase() === "mjx-container", qs = (t) => t.tagName?.toLowerCase() === "mjx-assistive-mml", Vs = (t) => {
5506
+ }), Fs = (t) => t.classList?.contains("MathJax") || t.tagName?.toLowerCase() === "mjx-container", Vs = (t) => t.tagName?.toLowerCase() === "mjx-assistive-mml", Gs = (t) => {
5484
5507
  const e = t.tagName?.toLowerCase();
5485
5508
  return e === "annotation" || e === "annotation-xml";
5486
- }, Uu = (t) => {
5509
+ }, Ju = (t) => {
5487
5510
  const e = t.getAttribute("data-mathml");
5488
5511
  return e && e.trim() ? e : null;
5489
- }, Ku = (t) => t.querySelector("mjx-assistive-mml math")?.outerHTML || null, Yu = (t) => {
5512
+ }, Zu = (t) => t.querySelector("mjx-assistive-mml math")?.outerHTML || null, Qu = (t) => {
5490
5513
  if (t.tagName.toLowerCase() === "math") return To(t.outerHTML);
5491
- const e = Uu(t);
5514
+ const e = Ju(t);
5492
5515
  if (e) {
5493
5516
  const n = To(e);
5494
5517
  if (n) return n;
5495
5518
  }
5496
5519
  if (Fs(t)) {
5497
- const n = Ku(t);
5520
+ const n = Zu(t);
5498
5521
  if (n) {
5499
5522
  const o = To(n);
5500
5523
  if (o) return o;
5501
5524
  }
5502
5525
  }
5503
5526
  return null;
5504
- }, Xu = /* @__PURE__ */ new Set([
5527
+ }, th = /* @__PURE__ */ new Set([
5505
5528
  "P",
5506
5529
  "H1",
5507
5530
  "H2",
@@ -5517,7 +5540,7 @@ var Qc = /* @__PURE__ */ new Set([
5517
5540
  "FIGCAPTION",
5518
5541
  "LABEL",
5519
5542
  "BUTTON"
5520
- ]), Ju = /* @__PURE__ */ new Set([
5543
+ ]), eh = /* @__PURE__ */ new Set([
5521
5544
  "heading",
5522
5545
  "listitem",
5523
5546
  "option",
@@ -5526,24 +5549,24 @@ var Qc = /* @__PURE__ */ new Set([
5526
5549
  "cell",
5527
5550
  "columnheader",
5528
5551
  "rowheader"
5529
- ]), Zu = (t, e) => {
5552
+ ]), nh = (t, e) => {
5530
5553
  let n = t.parentElement, o = null;
5531
5554
  for (; n && n !== e; ) {
5532
5555
  const r = (n.getAttribute("role") || "").toLowerCase(), i = n.tagName.toUpperCase();
5533
- if (Xu.has(i) || Ju.has(r)) {
5556
+ if (th.has(i) || eh.has(r)) {
5534
5557
  o = n;
5535
5558
  break;
5536
5559
  }
5537
5560
  n = n.parentElement;
5538
5561
  }
5539
5562
  return o || e;
5540
- }, Qu = (t) => !!(typeof t.querySelector == "function" && t.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || t.tagName?.toLowerCase() === "math" || t.hasAttribute?.("data-mathml") || Fs(t), oe = (t, e, n) => {
5563
+ }, oh = (t) => !!(typeof t.querySelector == "function" && t.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || t.tagName?.toLowerCase() === "math" || t.hasAttribute?.("data-mathml") || Fs(t), oe = (t, e, n) => {
5541
5564
  /[.,;:!?]/.test(e) && t.chars.length > 0 && t.chars[t.chars.length - 1] === " " && (t.chars.pop(), t.position--, t.map.delete(t.position)), t.chars.push(e), n ? (t.map.set(t.position, n), t.lastMapped = n) : t.lastMapped && t.map.set(t.position, t.lastMapped), t.position++;
5542
- }, Gs = (t, e) => {
5565
+ }, Us = (t, e) => {
5543
5566
  if (t.inLeadingWhitespace || t.lastCharWasWhitespace || t.chars.length === 0) return !1;
5544
5567
  const n = t.chars[t.chars.length - 1];
5545
- return Es(n, e, t.options);
5546
- }, Us = (t, e) => {
5568
+ return Cs(n, e, t.options);
5569
+ }, Ks = (t, e) => {
5547
5570
  const n = e.textContent || "";
5548
5571
  let o = !1;
5549
5572
  for (let r = 0; r < n.length; r++) {
@@ -5562,7 +5585,7 @@ var Qc = /* @__PURE__ */ new Set([
5562
5585
  }), t.lastCharWasWhitespace = !0;
5563
5586
  continue;
5564
5587
  }
5565
- !o && Gs(t, i) && oe(t, " ", {
5588
+ !o && Us(t, i) && oe(t, " ", {
5566
5589
  node: e,
5567
5590
  offset: r
5568
5591
  }), oe(t, i, {
@@ -5570,7 +5593,7 @@ var Qc = /* @__PURE__ */ new Set([
5570
5593
  offset: r
5571
5594
  }), o = !0, t.lastCharWasWhitespace = !1;
5572
5595
  }
5573
- }, th = (t, e) => {
5596
+ }, rh = (t, e) => {
5574
5597
  for (let n = 0; n < e.text.length; n++) {
5575
5598
  const o = e.text[n], r = /\s/.test(o), i = e.map.get(n) || null, s = i?.node || t.lastMapped?.node || null, a = i?.offset ?? t.lastMapped?.offset ?? 0, l = i ? {
5576
5599
  node: i.node,
@@ -5587,7 +5610,7 @@ var Qc = /* @__PURE__ */ new Set([
5587
5610
  t.lastCharWasWhitespace || oe(t, " ", l), t.lastCharWasWhitespace = !0;
5588
5611
  continue;
5589
5612
  }
5590
- n === 0 && Gs(t, o) && oe(t, " ", l), oe(t, o, l), t.lastCharWasWhitespace = !1, i ? (t.map.set(t.position - 1, {
5613
+ n === 0 && Us(t, o) && oe(t, " ", l), oe(t, o, l), t.lastCharWasWhitespace = !1, i ? (t.map.set(t.position - 1, {
5591
5614
  node: i.node,
5592
5615
  offset: i.offset
5593
5616
  }), t.lastMapped = {
@@ -5598,7 +5621,7 @@ var Qc = /* @__PURE__ */ new Set([
5598
5621
  offset: a
5599
5622
  });
5600
5623
  }
5601
- }, eh = (t) => {
5624
+ }, ih = (t) => {
5602
5625
  if (typeof DOMParser > "u") return "";
5603
5626
  const e = new DOMParser().parseFromString(t, "application/xml");
5604
5627
  if (e.getElementsByTagName("parsererror").length > 0) return "";
@@ -5610,35 +5633,35 @@ var Qc = /* @__PURE__ */ new Set([
5610
5633
  }
5611
5634
  if (r.nodeType !== 1) return;
5612
5635
  const i = r;
5613
- if (!Vs(i)) for (const s of Array.from(i.childNodes)) o(s);
5636
+ if (!Gs(i)) for (const s of Array.from(i.childNodes)) o(s);
5614
5637
  };
5615
5638
  return o(e.documentElement), H(n.join(" "));
5616
- }, nh = (t, e, n) => {
5617
- const o = Bs(n), r = (a) => {
5618
- if (_e(a, t)) return;
5639
+ }, sh = (t, e, n) => {
5640
+ const o = qs(n), r = (a) => {
5641
+ if (Ne(a, t)) return;
5619
5642
  if (a.nodeType === 3) {
5620
- Us(o, a);
5643
+ Ks(o, a);
5621
5644
  return;
5622
5645
  }
5623
5646
  if (a.nodeType !== 1) return;
5624
5647
  const l = a;
5625
- if (!(qs(l) || Vs(l))) for (const c of Array.from(l.childNodes)) r(c);
5648
+ if (!(Vs(l) || Gs(l))) for (const c of Array.from(l.childNodes)) r(c);
5626
5649
  };
5627
- r(t), Ks(o);
5650
+ r(t), Ys(o);
5628
5651
  const i = H(o.chars.join(""));
5629
5652
  if (i) return {
5630
5653
  text: i,
5631
5654
  map: o.map
5632
5655
  };
5633
- const s = eh(e);
5656
+ const s = ih(e);
5634
5657
  return s ? {
5635
5658
  text: s,
5636
5659
  map: /* @__PURE__ */ new Map()
5637
5660
  } : Vn(t, n);
5638
- }, Ks = (t) => {
5661
+ }, Ys = (t) => {
5639
5662
  for (; t.chars.length > 0 && /\s/.test(t.chars[t.chars.length - 1]); ) t.chars.pop(), t.position--, t.map.delete(t.position);
5640
- }, oh = (t, e) => {
5641
- const n = Bs(e), o = [];
5663
+ }, ah = (t, e) => {
5664
+ const n = qs(e), o = [];
5642
5665
  let r = 0, i, s = !1;
5643
5666
  const a = () => {
5644
5667
  const u = H(n.chars.slice(r, n.chars.length).join(""));
@@ -5648,20 +5671,20 @@ var Qc = /* @__PURE__ */ new Set([
5648
5671
  sourceElement: i
5649
5672
  }), r = n.chars.length, i = void 0;
5650
5673
  }, l = (u) => {
5651
- if (_e(u, t)) return;
5674
+ if (Ne(u, t)) return;
5652
5675
  if (u.nodeType === Node.TEXT_NODE) {
5653
- const f = Zu(u, t);
5654
- i && f !== i && a(), i = f, Us(n, u);
5676
+ const f = nh(u, t);
5677
+ i && f !== i && a(), i = f, Ks(n, u);
5655
5678
  return;
5656
5679
  }
5657
5680
  if (u.nodeType !== Node.ELEMENT_NODE) return;
5658
5681
  const h = u;
5659
- if (qs(h)) return;
5660
- const p = Yu(h);
5682
+ if (Vs(h)) return;
5683
+ const p = Qu(h);
5661
5684
  if (p) {
5662
5685
  a();
5663
- const f = nh(h, p, e);
5664
- th(n, f);
5686
+ const f = sh(h, p, e);
5687
+ rh(n, f);
5665
5688
  const v = H(f.text);
5666
5689
  o.push({
5667
5690
  type: "math",
@@ -5674,7 +5697,7 @@ var Qc = /* @__PURE__ */ new Set([
5674
5697
  for (const f of Array.from(h.childNodes)) l(f);
5675
5698
  };
5676
5699
  for (const u of Array.from(t.childNodes)) l(u);
5677
- Ks(n), a();
5700
+ Ys(n), a();
5678
5701
  const c = n.chars.join("");
5679
5702
  for (; n.map.has(c.length); ) n.map.delete(c.length);
5680
5703
  return {
@@ -5684,7 +5707,7 @@ var Qc = /* @__PURE__ */ new Set([
5684
5707
  containsMathMarkup: s
5685
5708
  };
5686
5709
  }, Ke = (t, e) => {
5687
- if (!Qu(t)) {
5710
+ if (!oh(t)) {
5688
5711
  const { text: n, map: o } = Vn(t, e);
5689
5712
  return {
5690
5713
  visibleText: n,
@@ -5696,8 +5719,8 @@ var Qc = /* @__PURE__ */ new Set([
5696
5719
  containsMathMarkup: !1
5697
5720
  };
5698
5721
  }
5699
- return oh(t, e);
5700
- }, rh = (t, e) => As([t], e), ih = (t) => (t || "en").split("-")[0].toLowerCase() || "en", sh = /* @__PURE__ */ new Set([
5722
+ return ah(t, e);
5723
+ }, lh = (t, e) => Is([t], e), ch = (t) => (t || "en").split("-")[0].toLowerCase() || "en", uh = /* @__PURE__ */ new Set([
5701
5724
  "H1",
5702
5725
  "H2",
5703
5726
  "H3",
@@ -5707,17 +5730,17 @@ var Qc = /* @__PURE__ */ new Set([
5707
5730
  "LI",
5708
5731
  "LABEL",
5709
5732
  "BUTTON"
5710
- ]), ah = /* @__PURE__ */ new Set([
5733
+ ]), hh = /* @__PURE__ */ new Set([
5711
5734
  "heading",
5712
5735
  "listitem",
5713
5736
  "option",
5714
5737
  "radio"
5715
- ]), lh = (t) => {
5738
+ ]), dh = (t) => {
5716
5739
  if (t.type !== "text" || !t.sourceElement) return !1;
5717
5740
  const e = t.sourceElement.tagName.toUpperCase(), n = (t.sourceElement.getAttribute("role") || "").toLowerCase();
5718
- return sh.has(e) || ah.has(n);
5719
- }, ch = async (t) => {
5720
- const e = t.resolveMathSpeech ?? rh, { visibleText: n } = t, o = [];
5741
+ return uh.has(e) || hh.has(n);
5742
+ }, ph = async (t) => {
5743
+ const e = t.resolveMathSpeech ?? lh, { visibleText: n } = t, o = [];
5721
5744
  let r = 0;
5722
5745
  const i = (a) => {
5723
5746
  const l = H(a), c = n.indexOf(l, r), u = c >= 0 ? c : r, h = u + l.length;
@@ -5729,7 +5752,7 @@ var Qc = /* @__PURE__ */ new Set([
5729
5752
  for (let a = 0; a < t.chunks.length; a++) {
5730
5753
  const l = t.chunks[a];
5731
5754
  if (l.type === "text") {
5732
- const f = lh(l) ? [{
5755
+ const f = dh(l) ? [{
5733
5756
  text: l.text,
5734
5757
  offset: 0
5735
5758
  }] : pr(l.text, { locale: t.language });
@@ -5769,12 +5792,12 @@ var Qc = /* @__PURE__ */ new Set([
5769
5792
  }
5770
5793
  return {
5771
5794
  segments: o,
5772
- locale: ih(t.language),
5795
+ locale: ch(t.language),
5773
5796
  visibleText: n,
5774
5797
  plainSpeechText: H(s.join(" "))
5775
5798
  };
5776
- }, uh = (t) => (t || "en").split("-")[0].toLowerCase() || "en", hh = "sre-v1", dh = 256, Bo = (t) => Array.isArray(t) ? `array:[${t.map(Bo).join(",")}]` : t && typeof t == "object" ? `object:{${Object.entries(t).sort(([e], [n]) => e.localeCompare(n)).map(([e, n]) => `${JSON.stringify(e)}:${Bo(n)}`).join(",")}}` : t === null ? "null:null" : typeof t > "u" ? "undefined:" : typeof t == "function" ? `function:${t.name || "anonymous"}` : typeof t == "symbol" ? `symbol:${String(t)}` : typeof t == "bigint" ? `bigint:${t.toString()}` : typeof t == "number" ? Number.isFinite(t) ? `number:${t}` : `number:${String(t)}` : `${typeof t}:${JSON.stringify(t)}`, ci = (t, e, n, o) => `${hh}\0${uh(t)}\0${e ? "ssml" : "plain"}\0${Bo(n ?? null)}\0${o}`, ph = (t = {}) => {
5777
- const e = Math.max(1, t.maxEntries ?? dh), n = t.resolve ?? ((i, s) => As([i], s)), o = /* @__PURE__ */ new Map(), r = (i, s) => {
5799
+ }, fh = (t) => (t || "en").split("-")[0].toLowerCase() || "en", gh = "sre-v1", mh = 256, Bo = (t) => Array.isArray(t) ? `array:[${t.map(Bo).join(",")}]` : t && typeof t == "object" ? `object:{${Object.entries(t).sort(([e], [n]) => e.localeCompare(n)).map(([e, n]) => `${JSON.stringify(e)}:${Bo(n)}`).join(",")}}` : t === null ? "null:null" : typeof t > "u" ? "undefined:" : typeof t == "function" ? `function:${t.name || "anonymous"}` : typeof t == "symbol" ? `symbol:${String(t)}` : typeof t == "bigint" ? `bigint:${t.toString()}` : typeof t == "number" ? Number.isFinite(t) ? `number:${t}` : `number:${String(t)}` : `${typeof t}:${JSON.stringify(t)}`, ci = (t, e, n, o) => `${gh}\0${fh(t)}\0${e ? "ssml" : "plain"}\0${Bo(n ?? null)}\0${o}`, vh = (t = {}) => {
5800
+ const e = Math.max(1, t.maxEntries ?? mh), n = t.resolve ?? ((i, s) => Is([i], s)), o = /* @__PURE__ */ new Map(), r = (i, s) => {
5778
5801
  for (o.delete(i), o.set(i, s); o.size > e; ) {
5779
5802
  const a = o.keys().next().value;
5780
5803
  a !== void 0 && o.delete(a);
@@ -5793,13 +5816,13 @@ var Qc = /* @__PURE__ */ new Set([
5793
5816
  usedFallback: h.usedFallback
5794
5817
  }), r(c, h), h;
5795
5818
  };
5796
- }, fh = (t) => !t || /^<[^>]+>$/.test(t.trim()) ? null : sn({ speechText: t }).tokens[0]?.normalized || null, gh = (t, e) => {
5819
+ }, bh = (t) => !t || /^<[^>]+>$/.test(t.trim()) ? null : sn({ speechText: t }).tokens[0]?.normalized || null, yh = (t, e) => {
5797
5820
  const n = sn({ speechText: t.speechText });
5798
5821
  if (!Number.isFinite(e.position)) return {
5799
5822
  boundary: null,
5800
5823
  spokenText: n.spokenText
5801
5824
  };
5802
- const o = Wu({
5825
+ const o = Du({
5803
5826
  tokenization: n,
5804
5827
  position: e.position,
5805
5828
  length: e.length,
@@ -5812,8 +5835,8 @@ var Qc = /* @__PURE__ */ new Set([
5812
5835
  } : null,
5813
5836
  spokenText: n.spokenText
5814
5837
  };
5815
- }, mh = (t, e, n) => n ? sn({ speechText: t }).tokens.find((o) => o.start <= e && e < o.end)?.normalized === n : !0, vh = (t, e) => {
5816
- const n = fh(e.word);
5838
+ }, Th = (t, e, n) => n ? sn({ speechText: t }).tokens.find((o) => o.start <= e && e < o.end)?.normalized === n : !0, wh = (t, e) => {
5839
+ const n = bh(e.word);
5817
5840
  if (t.id !== e.chunkId) return {
5818
5841
  chunkId: e.chunkId,
5819
5842
  normalizedWord: n,
@@ -5831,12 +5854,12 @@ var Qc = /* @__PURE__ */ new Set([
5831
5854
  reason: "boundary offset space is unsupported"
5832
5855
  };
5833
5856
  let o, r;
5834
- if (t.catalogAlignment) o = cu(t.catalogAlignment, e.position, e.length, e.word), r = t.catalogAlignment.spokenText;
5857
+ if (t.catalogAlignment) o = pu(t.catalogAlignment, e.position, e.length, e.word), r = t.catalogAlignment.spokenText;
5835
5858
  else {
5836
- const i = gh(t, e);
5859
+ const i = yh(t, e);
5837
5860
  o = i.boundary, r = i.spokenText;
5838
5861
  }
5839
- return o ? mh(r, o.start, n) ? {
5862
+ return o ? Th(r, o.start, n) ? {
5840
5863
  chunkId: t.id,
5841
5864
  normalizedWord: n,
5842
5865
  chunkSpokenStart: o.start,
@@ -5858,7 +5881,7 @@ var Qc = /* @__PURE__ */ new Set([
5858
5881
  confidence: 0,
5859
5882
  reason: "could not resolve provider boundary to chunk speech"
5860
5883
  };
5861
- }, Fe = (t) => t.semanticTarget ? {
5884
+ }, qe = (t) => t.semanticTarget ? {
5862
5885
  activeTarget: t.semanticTarget,
5863
5886
  regionTarget: t.regionTarget,
5864
5887
  quality: t.semanticTarget.quality === "exact-word" ? "exact-word" : t.semanticTarget.quality === "expression" ? "expression" : "semantic-token",
@@ -5876,12 +5899,12 @@ var Qc = /* @__PURE__ */ new Set([
5876
5899
  quality: "region",
5877
5900
  confidence: t.confidence,
5878
5901
  reason: t.reason
5879
- }, Ys = /* @__PURE__ */ new Map([
5902
+ }, Xs = /* @__PURE__ */ new Map([
5880
5903
  ["mi", "mjx-mi"],
5881
5904
  ["mn", "mjx-mn"],
5882
5905
  ["mo", "mjx-mo"],
5883
5906
  ["mtext", "mjx-mtext"]
5884
- ]), Fo = "mi,mn,mo,mtext", Xs = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Js = [
5907
+ ]), qo = "mi,mn,mo,mtext", Js = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Zs = [
5885
5908
  "mjx-mfrac",
5886
5909
  "mjx-msqrt",
5887
5910
  "mjx-mroot",
@@ -5889,55 +5912,55 @@ var Qc = /* @__PURE__ */ new Set([
5889
5912
  "mjx-munder",
5890
5913
  "mjx-mover",
5891
5914
  "mjx-munderover"
5892
- ].join(","), Zs = (t) => t.type === "text-range" ? t.node.parentElement : t.element, to = (t) => {
5915
+ ].join(","), Qs = (t) => t.type === "text-range" ? t.node.parentElement : t.element, to = (t) => {
5893
5916
  let e = t;
5894
5917
  for (; e; ) {
5895
5918
  if (e.localName?.toLowerCase() === "mjx-container") return e;
5896
5919
  e = e.parentElement;
5897
5920
  }
5898
5921
  return null;
5899
- }, ui = (t) => !t || to(t) ? !1 : !_e(t), Qs = (t) => {
5922
+ }, ui = (t) => !t || to(t) ? !1 : !Ne(t), ta = (t) => {
5900
5923
  const e = t.getBoundingClientRect?.();
5901
5924
  return !!(e && e.width > 0 && e.height > 0);
5902
- }, qo = (t) => {
5925
+ }, Fo = (t) => {
5903
5926
  let e = t;
5904
5927
  for (; e; ) {
5905
5928
  if (e.localName?.toLowerCase() === "math") return e;
5906
5929
  e = e.parentElement;
5907
5930
  }
5908
5931
  return null;
5909
- }, ta = (t, e) => {
5932
+ }, ea = (t, e) => {
5910
5933
  if (t.length === 0 || t.length !== e.length) return !1;
5911
5934
  for (let n = 0; n < t.length; n += 1) {
5912
- const o = Ys.get(t[n].localName.toLowerCase());
5935
+ const o = Xs.get(t[n].localName.toLowerCase());
5913
5936
  if (!o || e[n].localName.toLowerCase() !== o) return !1;
5914
5937
  }
5915
5938
  return !0;
5916
- }, bh = (t, e) => {
5917
- if (!t || !Ys.has(t.localName.toLowerCase()) || e.querySelector(Js)) return null;
5918
- const n = qo(t), o = e.querySelector("mjx-math");
5939
+ }, Sh = (t, e) => {
5940
+ if (!t || !Xs.has(t.localName.toLowerCase()) || e.querySelector(Zs)) return null;
5941
+ const n = Fo(t), o = e.querySelector("mjx-math");
5919
5942
  if (!n || !o) return null;
5920
- const r = Array.from(n.querySelectorAll(Fo)), i = r.indexOf(t);
5943
+ const r = Array.from(n.querySelectorAll(qo)), i = r.indexOf(t);
5921
5944
  if (i < 0) return null;
5922
- const s = Array.from(o.querySelectorAll(Xs));
5923
- if (!ta(r, s)) return null;
5945
+ const s = Array.from(o.querySelectorAll(Js));
5946
+ if (!ea(r, s)) return null;
5924
5947
  const a = s[i];
5925
- return !a || !Qs(a) ? null : a;
5926
- }, yh = (t) => {
5948
+ return !a || !ta(a) ? null : a;
5949
+ }, kh = (t) => {
5927
5950
  const e = to(t);
5928
5951
  if (e) {
5929
- if (e.querySelector(Js)) return "expression";
5930
- const o = qo(t) ?? t, r = e.querySelector("mjx-math");
5952
+ if (e.querySelector(Zs)) return "expression";
5953
+ const o = Fo(t) ?? t, r = e.querySelector("mjx-math");
5931
5954
  if (!r) return "expression";
5932
- const i = Array.from(o.querySelectorAll(Fo)), s = Array.from(r.querySelectorAll(Xs));
5933
- return ta(i, s) && s.some((a) => Qs(a)) ? "token" : "expression";
5955
+ const i = Array.from(o.querySelectorAll(qo)), s = Array.from(r.querySelectorAll(Js));
5956
+ return ea(i, s) && s.some((a) => ta(a)) ? "token" : "expression";
5934
5957
  }
5935
- const n = qo(t) ?? t;
5936
- return Array.from(n.querySelectorAll(Fo)).some((o) => !_e(o)) ? "token" : "expression";
5958
+ const n = Fo(t) ?? t;
5959
+ return Array.from(n.querySelectorAll(qo)).some((o) => !Ne(o)) ? "token" : "expression";
5937
5960
  }, Vo = (t) => {
5938
- const e = Zs(t), n = to(e);
5961
+ const e = Qs(t), n = to(e);
5939
5962
  if (n) {
5940
- const o = bh(e, n);
5963
+ const o = Sh(e, n);
5941
5964
  return o ? {
5942
5965
  type: "element",
5943
5966
  quality: "semantic-token",
@@ -5959,24 +5982,24 @@ var Qc = /* @__PURE__ */ new Set([
5959
5982
  quality: t.quality === "region-fallback" ? "expression" : "semantic-token",
5960
5983
  element: t.element
5961
5984
  } : null;
5962
- }, Th = Vo, wh = () => {
5985
+ }, xh = Vo, Eh = () => {
5963
5986
  const t = /* @__PURE__ */ new WeakMap();
5964
5987
  return (e) => {
5965
- const n = Zs(e), o = to(n);
5988
+ const n = Qs(e), o = to(n);
5966
5989
  if (!n || !o) return Vo(e);
5967
5990
  if (t.has(n)) return t.get(n) ?? null;
5968
5991
  const r = Vo(e);
5969
5992
  return t.set(n, r), r;
5970
5993
  };
5971
- }, Sh = (t, e, n, o = t.mathAlignments, r = Th) => {
5994
+ }, Ch = (t, e, n, o = t.mathAlignments, r = xh) => {
5972
5995
  if (e.chunkSpokenStart === null || e.chunkSpokenEnd === null) return null;
5973
5996
  let i = null;
5974
5997
  for (const s of o) {
5975
- const a = Hu(s.alignment, {
5998
+ const a = qu(s.alignment, {
5976
5999
  position: e.chunkSpokenStart,
5977
6000
  length: Math.max(1, e.chunkSpokenEnd - e.chunkSpokenStart),
5978
6001
  boundaryWord: n.word
5979
- }) || ju(s.alignment, { boundaryWord: n.word });
6002
+ }) || Fu(s.alignment, { boundaryWord: n.word });
5980
6003
  if (!a) continue;
5981
6004
  const l = r(a);
5982
6005
  if (l) {
@@ -5985,7 +6008,7 @@ var Qc = /* @__PURE__ */ new Set([
5985
6008
  }
5986
6009
  }
5987
6010
  return i;
5988
- }, ea = (t, e, n) => {
6011
+ }, na = (t, e, n) => {
5989
6012
  if (!t || typeof document > "u" || n <= e) return null;
5990
6013
  const o = t.get(e);
5991
6014
  let r = t.get(Math.max(e, n - 1));
@@ -5997,17 +6020,17 @@ var Qc = /* @__PURE__ */ new Set([
5997
6020
  } catch {
5998
6021
  return null;
5999
6022
  }
6000
- }, kh = (t, e) => {
6023
+ }, Ah = (t, e) => {
6001
6024
  if (!t.catalogAlignment || e.chunkSpokenStart === null) return null;
6002
- const n = uu(t.catalogAlignment, e.chunkSpokenStart);
6025
+ const n = fu(t.catalogAlignment, e.chunkSpokenStart);
6003
6026
  if (!n) return null;
6004
- const o = ea(t.visibleMap, n.start, n.end);
6027
+ const o = na(t.visibleMap, n.start, n.end);
6005
6028
  return o ? {
6006
6029
  type: "range",
6007
6030
  quality: t.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
6008
6031
  range: o
6009
6032
  } : null;
6010
- }, xh = (t) => t.regionRange ? {
6033
+ }, Ih = (t) => t.regionRange ? {
6011
6034
  type: "range",
6012
6035
  quality: "region",
6013
6036
  range: t.regionRange
@@ -6019,7 +6042,7 @@ var Qc = /* @__PURE__ */ new Set([
6019
6042
  if (e.length !== 1) return null;
6020
6043
  const n = e[0]?.alignment.result.fallbackTarget;
6021
6044
  return n ? t.renderedMathTargetResolver(n) : null;
6022
- }, Eh = (t, e) => t ? e.mathAlignments.filter(({ element: n }) => {
6045
+ }, Mh = (t, e) => t ? e.mathAlignments.filter(({ element: n }) => {
6023
6046
  try {
6024
6047
  return t.type === "range" ? t.range.intersectsNode(n) : t.type === "element" ? t.element === n || t.element.contains(n) : t.node.parentElement?.contains(n) || !1;
6025
6048
  } catch {
@@ -6031,25 +6054,25 @@ var Qc = /* @__PURE__ */ new Set([
6031
6054
  quality: "region",
6032
6055
  confidence: 0,
6033
6056
  reason: "boundary chunk id was not found"
6034
- }), pi = (t) => t.length === 1 ? t[0].element : null, Ch = (t, e) => e.length > 0 && e.every(({ element: n }) => t.mathCapabilityByElement.get(n) === "token"), Ah = 3, Ih = (t, e, n) => {
6057
+ }), pi = (t) => t.length === 1 ? t[0].element : null, $h = (t, e) => e.length > 0 && e.every(({ element: n }) => t.mathCapabilityByElement.get(n) === "token"), Oh = 3, Lh = (t, e, n) => {
6035
6058
  if (!e || e.type !== "range") return !1;
6036
6059
  const { startContainer: o, endContainer: r } = e.range;
6037
- return o === r && o.nodeType === Ah ? !1 : n.some(({ element: i }) => t.mathCapabilityByElement.get(i) === "token" && i.contains(o) && i.contains(r));
6038
- }, Mh = (t, e) => ({
6060
+ return o === r && o.nodeType === Oh ? !1 : n.some(({ element: i }) => t.mathCapabilityByElement.get(i) === "token" && i.contains(o) && i.contains(r));
6061
+ }, Ph = (t, e) => ({
6039
6062
  chunk: t,
6040
- regionTarget: xh(t),
6041
- renderedMathTargetResolver: wh(),
6042
- mathCapabilityByElement: new Map(t.mathAlignments.map(({ element: n }) => [n, e ? yh(n) : "expression"])),
6063
+ regionTarget: Ih(t),
6064
+ renderedMathTargetResolver: Eh(),
6065
+ mathCapabilityByElement: new Map(t.mathAlignments.map(({ element: n }) => [n, e ? kh(n) : "expression"])),
6043
6066
  heldTokenByElement: /* @__PURE__ */ new Map()
6044
- }), $h = (t) => {
6045
- const e = t.mathTokenHighlighting !== !1, n = new Map(t.chunks.map((o) => [o.id, Mh(o, e)]));
6067
+ }), _h = (t) => {
6068
+ const e = t.mathTokenHighlighting !== !1, n = new Map(t.chunks.map((o) => [o.id, Ph(o, e)]));
6046
6069
  return {
6047
6070
  chunks: t.chunks,
6048
6071
  resolveInitial(o) {
6049
6072
  const r = n.get(o);
6050
6073
  if (!r) return di();
6051
6074
  const i = r.chunk.mathAlignments, s = i.length === 1 ? i[0].element : null, a = s ? r.mathCapabilityByElement.get(s) : null;
6052
- return Fe(a === "expression" ? {
6075
+ return qe(a === "expression" ? {
6053
6076
  semanticTarget: null,
6054
6077
  expressionTarget: hi(r),
6055
6078
  regionTarget: r.regionTarget,
@@ -6066,10 +6089,10 @@ var Qc = /* @__PURE__ */ new Set([
6066
6089
  resolveBoundary(o) {
6067
6090
  const r = n.get(o.chunkId);
6068
6091
  if (!r) return di();
6069
- const { chunk: i } = r, s = vh(i, o), a = kh(i, s), l = Eh(a, i), c = (!a || l.length > 0 ? Sh(i, s, o, l, r.renderedMathTargetResolver) : null) || null, u = e && c && c.quality !== "expression" ? c : null, h = c && c.quality === "expression" ? c : null;
6092
+ const { chunk: i } = r, s = wh(i, o), a = Ah(i, s), l = Mh(a, i), c = (!a || l.length > 0 ? Ch(i, s, o, l, r.renderedMathTargetResolver) : null) || null, u = e && c && c.quality !== "expression" ? c : null, h = c && c.quality === "expression" ? c : null;
6070
6093
  if (u) {
6071
6094
  const p = pi(l);
6072
- return p && r.heldTokenByElement.set(p, u), Fe({
6095
+ return p && r.heldTokenByElement.set(p, u), qe({
6073
6096
  semanticTarget: u,
6074
6097
  expressionTarget: null,
6075
6098
  regionTarget: r.regionTarget,
@@ -6077,16 +6100,16 @@ var Qc = /* @__PURE__ */ new Set([
6077
6100
  reason: s.reason
6078
6101
  });
6079
6102
  }
6080
- if (a && (e ? !Ih(r, a, l) : l.length === 0)) return Fe({
6103
+ if (a && (e ? !Lh(r, a, l) : l.length === 0)) return qe({
6081
6104
  semanticTarget: a,
6082
6105
  expressionTarget: null,
6083
6106
  regionTarget: r.regionTarget,
6084
6107
  confidence: s.confidence,
6085
6108
  reason: s.reason
6086
6109
  });
6087
- if (Ch(r, l)) {
6110
+ if ($h(r, l)) {
6088
6111
  const p = pi(l), f = p ? r.heldTokenByElement.get(p) ?? null : null;
6089
- return Fe({
6112
+ return qe({
6090
6113
  semanticTarget: f,
6091
6114
  expressionTarget: null,
6092
6115
  regionTarget: r.regionTarget,
@@ -6094,7 +6117,7 @@ var Qc = /* @__PURE__ */ new Set([
6094
6117
  reason: f ? "hold last token (sticky token mode)" : "region (sticky token mode, awaiting first token)"
6095
6118
  });
6096
6119
  }
6097
- return Fe({
6120
+ return qe({
6098
6121
  semanticTarget: null,
6099
6122
  expressionTarget: h ?? hi(r, l),
6100
6123
  regionTarget: r.regionTarget,
@@ -6103,10 +6126,10 @@ var Qc = /* @__PURE__ */ new Set([
6103
6126
  });
6104
6127
  }
6105
6128
  };
6106
- }, Oh = (t) => t.alignment?.boundaryOffsetMode ? t.alignment.boundaryOffsetMode : t.mathAlignment?.speech.boundaryOffsetSpace || "plain-spoken-text", Lh = (t) => t.mathAlignments?.length ? t.mathAlignments : t.mathAlignment && t.sourceElement ? [{
6129
+ }, Nh = (t) => t.alignment?.boundaryOffsetMode ? t.alignment.boundaryOffsetMode : t.mathAlignment?.speech.boundaryOffsetSpace || "plain-spoken-text", Rh = (t) => t.mathAlignments?.length ? t.mathAlignments : t.mathAlignment && t.sourceElement ? [{
6107
6130
  element: t.sourceElement,
6108
6131
  alignment: t.mathAlignment
6109
- }] : [], Ph = (t) => (t.chunks && t.chunks.length ? t.chunks : [{
6132
+ }] : [], Wh = (t) => (t.chunks && t.chunks.length ? t.chunks : [{
6110
6133
  speechText: t.speechText || "",
6111
6134
  visibleText: t.visibleText || t.speechText || "",
6112
6135
  sourceElement: t.sourceElement || t.contentRoot,
@@ -6123,9 +6146,9 @@ var Qc = /* @__PURE__ */ new Set([
6123
6146
  regionRange: e.regionRange,
6124
6147
  visibleMap: e.visibleMap,
6125
6148
  catalogAlignment: e.alignment,
6126
- mathAlignments: Lh(e),
6127
- offsetSpace: Oh(e)
6128
- })), Nh = [
6149
+ mathAlignments: Rh(e),
6150
+ offsetSpace: Nh(e)
6151
+ })), zh = [
6129
6152
  "[data-pie-tts-region]",
6130
6153
  "[data-catalog-region]",
6131
6154
  "li",
@@ -6135,18 +6158,18 @@ var Qc = /* @__PURE__ */ new Set([
6135
6158
  "[role='group']",
6136
6159
  "[role='region']",
6137
6160
  "div"
6138
- ].join(","), na = (t, e) => {
6139
- const n = t.closest(Nh);
6161
+ ].join(","), oa = (t, e) => {
6162
+ const n = t.closest(zh);
6140
6163
  return n && e.contains(n) ? n : t;
6141
- }, _h = (t, e, n) => {
6164
+ }, Hh = (t, e, n) => {
6142
6165
  const o = /* @__PURE__ */ new Map();
6143
6166
  for (let r = e; r < n; r++) {
6144
6167
  const i = t.get(r);
6145
6168
  i && o.set(r - e, i);
6146
6169
  }
6147
6170
  return o;
6148
- }, Rh = async (t) => {
6149
- const e = Ke(t.contentRoot, t.textProcessingOptions), n = await ch({
6171
+ }, jh = async (t) => {
6172
+ const e = Ke(t.contentRoot, t.textProcessingOptions), n = await ph({
6150
6173
  chunks: e.chunks,
6151
6174
  visibleText: e.visibleText,
6152
6175
  language: t.language,
@@ -6164,8 +6187,8 @@ var Qc = /* @__PURE__ */ new Set([
6164
6187
  segment: o,
6165
6188
  anchor: {
6166
6189
  sourceElement: a,
6167
- regionElement: na(a, t.contentRoot),
6168
- visibleMap: _h(e.map, o.visibleSpan.start, o.visibleSpan.end)
6190
+ regionElement: oa(a, t.contentRoot),
6191
+ visibleMap: Hh(e.map, o.visibleSpan.start, o.visibleSpan.end)
6169
6192
  }
6170
6193
  };
6171
6194
  }
@@ -6185,7 +6208,7 @@ var Qc = /* @__PURE__ */ new Set([
6185
6208
  containsMathMarkup: e.containsMathMarkup,
6186
6209
  visibleText: e.visibleText
6187
6210
  };
6188
- }, Wh = (t, e) => {
6211
+ }, Dh = (t, e) => {
6189
6212
  const n = Ns({
6190
6213
  speechText: t.spokenText,
6191
6214
  visibleText: t.spokenText
@@ -6195,13 +6218,13 @@ var Qc = /* @__PURE__ */ new Set([
6195
6218
  visibleText: t.visibleText,
6196
6219
  sourceElement: e.sourceElement,
6197
6220
  regionElement: e.regionElement,
6198
- regionRange: ea(e.visibleMap, 0, t.visibleText.length) ?? void 0,
6221
+ regionRange: na(e.visibleMap, 0, t.visibleText.length) ?? void 0,
6199
6222
  speechMatchesVisibleText: !0,
6200
6223
  playbackMode: n.playbackMode,
6201
6224
  alignment: n,
6202
6225
  visibleMap: e.visibleMap
6203
6226
  };
6204
- }, oa = (t, e) => {
6227
+ }, ra = (t, e) => {
6205
6228
  const n = e.sourceElement;
6206
6229
  return {
6207
6230
  speechText: t.spokenText,
@@ -6214,7 +6237,7 @@ var Qc = /* @__PURE__ */ new Set([
6214
6237
  speechText: t.spokenText
6215
6238
  }) : void 0
6216
6239
  };
6217
- }, zh = (t, e, n) => {
6240
+ }, Bh = (t, e, n) => {
6218
6241
  const o = e.sourceElement;
6219
6242
  return {
6220
6243
  speechText: n,
@@ -6226,16 +6249,16 @@ var Qc = /* @__PURE__ */ new Set([
6226
6249
  mathElement: o,
6227
6250
  speechText: n
6228
6251
  }) : void 0,
6229
- plainFallback: oa(t, e)
6252
+ plainFallback: ra(t, e)
6230
6253
  };
6231
- }, Hh = (t, e = {}) => t.items.map(({ segment: n, anchor: o }) => n.kind === "prose" ? Wh(n, o) : e.format === "ssml" && n.ssml ? zh(n, o, n.ssml) : oa(n, o)), jh = "pie-tts-control-handoff", _;
6254
+ }, qh = (t, e = {}) => t.items.map(({ segment: n, anchor: o }) => n.kind === "prose" ? Dh(n, o) : e.format === "ssml" && n.ssml ? Bh(n, o, n.ssml) : ra(n, o)), Fh = "pie-tts-control-handoff", N;
6232
6255
  (function(t) {
6233
6256
  t.IDLE = "idle", t.LOADING = "loading", t.PLAYING = "playing", t.PAUSED = "paused", t.ERROR = "error";
6234
- })(_ || (_ = {}));
6235
- var Dh = (t, e) => t === e || t.startContainer === e.startContainer && t.startOffset === e.startOffset && t.endContainer === e.endContainer && t.endOffset === e.endOffset, Bh = (t, e) => t === e ? !0 : !t || !e || t.type !== e.type || t.quality !== e.quality ? !1 : t.type === "range" && e.type === "range" ? Dh(t.range, e.range) : t.type === "element" && e.type === "element" ? t.element === e.element : t.type === "text-range" && e.type === "text-range" ? t.node === e.node && t.startOffset === e.startOffset && t.endOffset === e.endOffset : !1;
6257
+ })(N || (N = {}));
6258
+ var Vh = (t, e) => t === e || t.startContainer === e.startContainer && t.startOffset === e.startOffset && t.endContainer === e.endContainer && t.endOffset === e.endOffset, Gh = (t, e) => t === e ? !0 : !t || !e || t.type !== e.type || t.quality !== e.quality ? !1 : t.type === "range" && e.type === "range" ? Vh(t.range, e.range) : t.type === "element" && e.type === "element" ? t.element === e.element : t.type === "text-range" && e.type === "text-range" ? t.node === e.node && t.startOffset === e.startOffset && t.endOffset === e.endOffset : !1;
6236
6259
  m(class Go {
6237
6260
  constructor() {
6238
- m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "catalogResolver", null), m(this, "state", _.IDLE), m(this, "ttsConfig", {}), m(this, "currentText", null), m(this, "currentContentElement", null), m(this, "normalizedToDOM", /* @__PURE__ */ new Map()), m(this, "listeners", /* @__PURE__ */ new Map()), m(this, "lastError", null), m(this, "speakRunId", 0), m(this, "currentBoundaryOffset", 0), m(this, "seekSegments", []), m(this, "sentenceHighlightSegments", []), m(this, "currentSeekSegmentIndex", 0), m(this, "activeSentenceStartOffset", null), m(this, "activeHighlightMode", "word"), m(this, "lastRenderedRegionTarget", null), m(this, "telemetryReporter", null), m(this, "generatedMathSpeechResolver", ph());
6261
+ m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "catalogResolver", null), m(this, "state", N.IDLE), m(this, "ttsConfig", {}), m(this, "currentText", null), m(this, "currentContentElement", null), m(this, "normalizedToDOM", /* @__PURE__ */ new Map()), m(this, "listeners", /* @__PURE__ */ new Map()), m(this, "lastError", null), m(this, "speakRunId", 0), m(this, "currentBoundaryOffset", 0), m(this, "seekSegments", []), m(this, "sentenceHighlightSegments", []), m(this, "currentSeekSegmentIndex", 0), m(this, "activeSentenceStartOffset", null), m(this, "activeHighlightMode", "word"), m(this, "lastRenderedRegionTarget", null), m(this, "telemetryReporter", null), m(this, "generatedMathSpeechResolver", vh());
6239
6262
  }
6240
6263
  debugLog(e, n) {
6241
6264
  Go.debugEnabled && (n === void 0 ? console.debug(e) : console.debug(e, n));
@@ -6358,7 +6381,7 @@ m(class Go {
6358
6381
  return e.includes("<") ? /<\s*break\b|<\s*speak\b|<\s*prosody\b|<\s*p\b|<\s*s\b/i.test(e) : !1;
6359
6382
  }
6360
6383
  isElementHidden(e) {
6361
- return xs(e);
6384
+ return Es(e);
6362
6385
  }
6363
6386
  getBoundaryStrength(e) {
6364
6387
  const n = Number(e.getAttribute("data-tts-break-ms"));
@@ -6585,7 +6608,7 @@ m(class Go {
6585
6608
  contentToSpeak: a,
6586
6609
  shouldUsePlan: b,
6587
6610
  playbackSegments: this.seekSegments
6588
- }), this.setState(_.LOADING), this.prepareHighlightsForSpeak({
6611
+ }), this.setState(N.LOADING), this.prepareHighlightsForSpeak({
6589
6612
  contentToSpeak: a,
6590
6613
  options: n,
6591
6614
  highlightMode: f,
@@ -6593,23 +6616,23 @@ m(class Go {
6593
6616
  }), h ? this.configureWordBoundaryHighlighting({
6594
6617
  highlightMode: f,
6595
6618
  wordBoundaryOffset: n?.wordBoundaryOffset || 0
6596
- }) : this.clearWordBoundaryHighlighting(), this.setState(_.PLAYING), await this.executeSpeakPlayback({
6619
+ }) : this.clearWordBoundaryHighlighting(), this.setState(N.PLAYING), await this.executeSpeakPlayback({
6597
6620
  shouldUsePlan: b,
6598
6621
  runId: o,
6599
6622
  highlightMode: f,
6600
6623
  contentToSpeak: s,
6601
6624
  speechChunks: p
6602
6625
  }), o !== this.speakRunId) return;
6603
- this.setState(_.IDLE), this.clearHighlightsAndTracking();
6626
+ this.setState(N.IDLE), this.clearHighlightsAndTracking();
6604
6627
  } catch (r) {
6605
6628
  let i = r;
6606
6629
  if (console.error("TTS error:", i), this.lastError = i instanceof Error ? i.message : String(i), o !== this.speakRunId) return;
6607
- throw this.setState(_.ERROR), this.clearHighlightsAndTracking(), i;
6630
+ throw this.setState(N.ERROR), this.clearHighlightsAndTracking(), i;
6608
6631
  }
6609
6632
  }
6610
6633
  async switchProviderToBrowser(e, n) {
6611
6634
  if (!this.currentProvider) return !1;
6612
- const o = new ws(), r = this.currentProvider.providerId, i = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6635
+ const o = new Ss(), r = this.currentProvider.providerId, i = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6613
6636
  textLength: a.length,
6614
6637
  textPreview: l.length < a.length ? `${l}…` : l
6615
6638
  } : {};
@@ -6755,7 +6778,7 @@ m(class Go {
6755
6778
  const h = Array.from(u.querySelectorAll("math"));
6756
6779
  return u.localName?.toLowerCase() === "math" ? [u, ...h] : h;
6757
6780
  }, c = (u) => {
6758
- if (_e(u, e)) return;
6781
+ if (Ne(u, e)) return;
6759
6782
  if (u.nodeType === Node.TEXT_NODE) {
6760
6783
  r += ` ${u.textContent || ""}`;
6761
6784
  return;
@@ -6781,7 +6804,7 @@ m(class Go {
6781
6804
  speechText: p.content,
6782
6805
  visibleText: v,
6783
6806
  sourceElement: h,
6784
- regionElement: na(h, e),
6807
+ regionElement: oa(h, e),
6785
6808
  speechMatchesVisibleText: R === v,
6786
6809
  playbackMode: b.playbackMode,
6787
6810
  alignment: b,
@@ -6800,7 +6823,7 @@ m(class Go {
6800
6823
  return !e || e.providerId?.toLowerCase() === "browser" ? "plain" : e.getCapabilities?.().supportsSSML ? "ssml" : "plain";
6801
6824
  }
6802
6825
  async resolveGeneratedSpeechContent(e, n, o) {
6803
- const r = this.resolveGeneratedPlaybackFormat(), { plan: i, containsMathMarkup: s, visibleText: a } = await Rh({
6826
+ const r = this.resolveGeneratedPlaybackFormat(), { plan: i, containsMathMarkup: s, visibleText: a } = await jh({
6804
6827
  contentRoot: e,
6805
6828
  language: o,
6806
6829
  mathSpeech: this.getMathSpeechOptions(),
@@ -6817,7 +6840,7 @@ m(class Go {
6817
6840
  containsMathMarkup: !1,
6818
6841
  speechMatchesVisibleText: !0
6819
6842
  };
6820
- const c = Hh(i, { format: r }), u = i.plainSpeechText;
6843
+ const c = qh(i, { format: r }), u = i.plainSpeechText;
6821
6844
  return {
6822
6845
  contentToSpeak: u,
6823
6846
  speechText: u,
@@ -6888,7 +6911,7 @@ m(class Go {
6888
6911
  }
6889
6912
  }
6890
6913
  highlightRenderableRegionTarget(e) {
6891
- if (!(!this.highlightCoordinator || !e || typeof document > "u") && !Bh(this.lastRenderedRegionTarget, e)) try {
6914
+ if (!(!this.highlightCoordinator || !e || typeof document > "u") && !Gh(this.lastRenderedRegionTarget, e)) try {
6892
6915
  const n = document.createRange();
6893
6916
  if (e.type === "element") n.selectNodeContents(e.element);
6894
6917
  else if (e.type === "range") {
@@ -6937,10 +6960,10 @@ m(class Go {
6937
6960
  async speakCatalogChunkOnce(e, n) {
6938
6961
  if (!this.provider) return;
6939
6962
  this.lastRenderedRegionTarget = null;
6940
- const o = e.regionElement || e.sourceElement || this.currentContentElement, r = o ? Ph({
6963
+ const o = e.regionElement || e.sourceElement || this.currentContentElement, r = o ? Wh({
6941
6964
  contentRoot: o,
6942
6965
  chunks: [e]
6943
- })[0] : null, i = this.ttsConfig.mathTokenHighlighting !== !1, s = r ? $h({
6966
+ })[0] : null, i = this.ttsConfig.mathTokenHighlighting !== !1, s = r ? _h({
6944
6967
  chunks: [r],
6945
6968
  mathTokenHighlighting: i
6946
6969
  }) : null;
@@ -7017,26 +7040,26 @@ m(class Go {
7017
7040
  });
7018
7041
  }
7019
7042
  pause() {
7020
- this.provider && this.state === _.PLAYING && (this.provider.pause(), this.setState(_.PAUSED));
7043
+ this.provider && this.state === N.PLAYING && (this.provider.pause(), this.setState(N.PAUSED));
7021
7044
  }
7022
7045
  resume() {
7023
- this.provider && this.state === _.PAUSED && (this.provider.resume(), this.setState(_.PLAYING));
7046
+ this.provider && this.state === N.PAUSED && (this.provider.resume(), this.setState(N.PLAYING));
7024
7047
  }
7025
7048
  async seekBy(e) {
7026
- if (!this.provider || !this.currentText || this.state !== _.PLAYING && this.state !== _.PAUSED || this.hasExplicitBreakSemantics(this.currentText) || this.seekSegments.length === 0) return;
7049
+ if (!this.provider || !this.currentText || this.state !== N.PLAYING && this.state !== N.PAUSED || this.hasExplicitBreakSemantics(this.currentText) || this.seekSegments.length === 0) return;
7027
7050
  const n = Number.isFinite(e) ? Math.trunc(e) : 0;
7028
7051
  if (n === 0) return;
7029
7052
  const o = this.getCurrentSeekSegmentIndex(), r = Math.max(0, Math.min(this.seekSegments.length - 1, o + n));
7030
7053
  if (r === o) return;
7031
7054
  this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.currentSeekSegmentIndex = r;
7032
7055
  const i = ++this.speakRunId, s = this.seekSegments.slice(r);
7033
- this.setState(_.PLAYING);
7056
+ this.setState(N.PLAYING);
7034
7057
  try {
7035
7058
  if (await this.speakWithPlan(s, i, { highlightMode: this.activeHighlightMode }), i !== this.speakRunId) return;
7036
- this.setState(_.IDLE), this.clearHighlightsAndTracking();
7059
+ this.setState(N.IDLE), this.clearHighlightsAndTracking();
7037
7060
  } catch (a) {
7038
7061
  if (i !== this.speakRunId) return;
7039
- throw this.lastError = a instanceof Error ? a.message : String(a), this.setState(_.ERROR), this.clearHighlightsAndTracking(), a;
7062
+ throw this.lastError = a instanceof Error ? a.message : String(a), this.setState(N.ERROR), this.clearHighlightsAndTracking(), a;
7040
7063
  }
7041
7064
  }
7042
7065
  async seekForward(e = 1) {
@@ -7048,16 +7071,16 @@ m(class Go {
7048
7071
  await this.seekBy(-n);
7049
7072
  }
7050
7073
  stop() {
7051
- this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(_.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);
7074
+ this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(N.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);
7052
7075
  }
7053
7076
  requestControlHandoff() {
7054
- typeof window > "u" || window.dispatchEvent(new CustomEvent(jh, { detail: { source: "host" } }));
7077
+ typeof window > "u" || window.dispatchEvent(new CustomEvent(Fh, { detail: { source: "host" } }));
7055
7078
  }
7056
7079
  isPlaying() {
7057
- return this.state === _.PLAYING;
7080
+ return this.state === N.PLAYING;
7058
7081
  }
7059
7082
  isPaused() {
7060
- return this.state === _.PAUSED;
7083
+ return this.state === N.PAUSED;
7061
7084
  }
7062
7085
  getState() {
7063
7086
  return this.state;
@@ -7085,8 +7108,8 @@ m(class Go {
7085
7108
  providerId: "tts",
7086
7109
  previousState: n,
7087
7110
  state: e
7088
- }), e === _.PLAYING) {
7089
- const o = n === _.PAUSED ? "pie-tool-playback-resume" : "pie-tool-playback-start";
7111
+ }), e === N.PLAYING) {
7112
+ const o = n === N.PAUSED ? "pie-tool-playback-resume" : "pie-tool-playback-start";
7090
7113
  this.emitTelemetry(o, {
7091
7114
  toolId: "textToSpeech",
7092
7115
  providerId: "tts",
@@ -7095,7 +7118,7 @@ m(class Go {
7095
7118
  });
7096
7119
  return;
7097
7120
  }
7098
- if (e === _.PAUSED) {
7121
+ if (e === N.PAUSED) {
7099
7122
  this.emitTelemetry("pie-tool-playback-pause", {
7100
7123
  toolId: "textToSpeech",
7101
7124
  providerId: "tts",
@@ -7104,7 +7127,7 @@ m(class Go {
7104
7127
  });
7105
7128
  return;
7106
7129
  }
7107
- if (e === _.ERROR) {
7130
+ if (e === N.ERROR) {
7108
7131
  this.emitTelemetry("pie-tool-playback-error", {
7109
7132
  toolId: "textToSpeech",
7110
7133
  providerId: "tts",
@@ -7114,7 +7137,7 @@ m(class Go {
7114
7137
  });
7115
7138
  return;
7116
7139
  }
7117
- e === _.IDLE && (n === _.PLAYING || n === _.PAUSED || n === _.LOADING) && this.emitTelemetry("pie-tool-playback-stop", {
7140
+ e === N.IDLE && (n === N.PLAYING || n === N.PAUSED || n === N.LOADING) && this.emitTelemetry("pie-tool-playback-stop", {
7118
7141
  toolId: "textToSpeech",
7119
7142
  providerId: "tts",
7120
7143
  previousState: n,
@@ -7128,7 +7151,7 @@ m(class Go {
7128
7151
  }
7129
7152
  return globalThis.__PIE_TTS_DEBUG__ === !0;
7130
7153
  })());
7131
- hc({
7154
+ dc({
7132
7155
  policy: {
7133
7156
  allowed: [],
7134
7157
  blocked: []
@@ -7140,7 +7163,7 @@ hc({
7140
7163
  },
7141
7164
  providers: {}
7142
7165
  });
7143
- var Fh = /* @__PURE__ */ we('<button class="pie-tool-annotation-toolbar__highlight-swatch svelte-g8qu62"><span class="pie-sr-only svelte-g8qu62"> </span></button>'), qh = /* @__PURE__ */ we('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Read selected text aloud" title="Read Aloud"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"></path></svg></button>', 1), Vh = /* @__PURE__ */ we('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--warning svelte-g8qu62" aria-label="Remove this annotation" title="Remove"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg></button>'), Gh = /* @__PURE__ */ we('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--danger svelte-g8qu62" aria-label="Clear all annotations from document" title="Clear All">Clear All</button>'), Uh = /* @__PURE__ */ we('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <!> <!>', 1), Kh = /* @__PURE__ */ we('<div class="pie-tool-annotation-toolbar notranslate svelte-g8qu62" role="toolbar" aria-label="Text annotation toolbar" translate="no"><!> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Underline selected text" title="Underline"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z"></path></svg></button> <!> <!></div>'), Yh = /* @__PURE__ */ we('<div style="display: none;" aria-hidden="true"></div> <!> <div role="status" aria-live="polite" aria-atomic="true" class="pie-sr-only svelte-g8qu62"> </div>', 1), Xh = {
7166
+ var Uh = /* @__PURE__ */ we('<button class="pie-tool-annotation-toolbar__highlight-swatch svelte-g8qu62"><span class="pie-sr-only svelte-g8qu62"> </span></button>'), Kh = /* @__PURE__ */ we('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Read selected text aloud" title="Read Aloud"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"></path></svg></button>', 1), Yh = /* @__PURE__ */ we('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--warning svelte-g8qu62" aria-label="Remove this annotation" title="Remove"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg></button>'), Xh = /* @__PURE__ */ we('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--danger svelte-g8qu62" aria-label="Clear all annotations from document" title="Clear All">Clear All</button>'), Jh = /* @__PURE__ */ we('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <!> <!>', 1), Zh = /* @__PURE__ */ we('<div class="pie-tool-annotation-toolbar notranslate svelte-g8qu62" role="toolbar" aria-label="Text annotation toolbar" translate="no"><!> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Underline selected text" title="Underline"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z"></path></svg></button> <!> <!></div>'), Qh = /* @__PURE__ */ we('<div style="display: none;" aria-hidden="true"></div> <!> <div role="status" aria-live="polite" aria-atomic="true" class="pie-sr-only svelte-g8qu62"> </div>', 1), td = {
7144
7167
  hash: "svelte-g8qu62",
7145
7168
  code: `.pie-tool-annotation-toolbar.svelte-g8qu62 {position:fixed;z-index:4200;display:flex;gap:0.25rem;padding:0.5rem;border-radius:0.5rem;background:var(--pie-background, #fff);color:var(--pie-text, #111827);border:1px solid var(--pie-border, #d1d5db);box-shadow:0 10px 25px -8px rgb(0 0 0 / 0.3);user-select:none;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62 {width:2.5rem;height:2rem;border:2px solid color-mix(in srgb, var(--pie-border-dark, #111827) 20%, transparent);border-radius:0.375rem;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;padding:0;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62:hover {transform:scale(1.1);border-color:color-mix(in srgb, var(--pie-border-dark, #111827) 45%, transparent);box-shadow:0 2px 8px rgb(0 0 0 / 0.15);}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar.svelte-g8qu62 .divider-horizontal:where(.svelte-g8qu62) {height:auto;width:1px;background-color:color-mix(in srgb, var(--pie-border, #d1d5db) 70%, transparent);}
7146
7169
 
@@ -7148,8 +7171,8 @@ var Fh = /* @__PURE__ */ we('<button class="pie-tool-annotation-toolbar__highlig
7148
7171
 
7149
7172
  /* Button styling */.pie-tool-annotation-toolbar__button.svelte-g8qu62 {display:inline-flex;align-items:center;justify-content:center;gap:0.35rem;padding:0.4rem 0.55rem;border:1px solid var(--pie-button-border, #d1d5db);border-radius:0.4rem;background:var(--pie-button-bg, #fff);color:var(--pie-button-color, var(--pie-text, #111827));cursor:pointer;}.pie-tool-annotation-toolbar__button--icon.svelte-g8qu62 {min-width:2rem;min-height:2rem;padding:0.45rem;}.pie-tool-annotation-toolbar__button.svelte-g8qu62:hover {background:var(--pie-button-hover-bg, #f9fafb);color:var(--pie-button-hover-color, var(--pie-text, #111827));border-color:var(--pie-button-hover-border, #9ca3af);}.pie-tool-annotation-toolbar__button.svelte-g8qu62:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar__button.svelte-g8qu62:disabled {opacity:0.6;cursor:not-allowed;}.pie-tool-annotation-toolbar__button--warning.svelte-g8qu62 {color:var(--pie-missing-icon, #92400e);}.pie-tool-annotation-toolbar__button--danger.svelte-g8qu62 {color:var(--pie-incorrect-icon, #b91c1c);}.pie-tool-annotation-toolbar__button.svelte-g8qu62 svg:where(.svelte-g8qu62) {width:18px;height:18px;}`
7150
7173
  };
7151
- function Jh(t, e) {
7152
- Si(e, !0), Dl(t, Xh);
7174
+ function ed(t, e) {
7175
+ Si(e, !0), Bl(t, td);
7153
7176
  let n = po(e, "enabled", 7, !0), o = po(e, "highlightCoordinator", 7, null), r = po(e, "ttsService", 7, null);
7154
7177
  const i = typeof window < "u", s = "pie-annotations", a = [
7155
7178
  {
@@ -7183,7 +7206,7 @@ function Jh(t, e) {
7183
7206
  '[role="button"]',
7184
7207
  '[role="textbox"]'
7185
7208
  ];
7186
- let c = /* @__PURE__ */ q(null), u = /* @__PURE__ */ q(null), h = /* @__PURE__ */ q(null), p = /* @__PURE__ */ q(null), f = /* @__PURE__ */ q(ee({
7209
+ let c = /* @__PURE__ */ F(null), u = /* @__PURE__ */ F(null), h = /* @__PURE__ */ F(null), p = /* @__PURE__ */ F(null), f = /* @__PURE__ */ F(ee({
7187
7210
  isVisible: !1,
7188
7211
  selectedText: "",
7189
7212
  selectedRange: null,
@@ -7191,7 +7214,7 @@ function Jh(t, e) {
7191
7214
  x: 0,
7192
7215
  y: 0
7193
7216
  }
7194
- })), v = /* @__PURE__ */ q(!1), b = /* @__PURE__ */ q(!1), g = /* @__PURE__ */ q(""), T = /* @__PURE__ */ q(0), $ = /* @__PURE__ */ q(null), R = /* @__PURE__ */ ro(() => y(T) > 0), k = /* @__PURE__ */ ro(() => y($) !== null), B = /* @__PURE__ */ ro(() => y(p)?.scopeElement || y(h)?.scopeElement || null);
7217
+ })), v = /* @__PURE__ */ F(!1), b = /* @__PURE__ */ F(!1), g = /* @__PURE__ */ F(""), T = /* @__PURE__ */ F(0), $ = /* @__PURE__ */ F(null), R = /* @__PURE__ */ ro(() => y(T) > 0), k = /* @__PURE__ */ ro(() => y($) !== null), B = /* @__PURE__ */ ro(() => y(p)?.scopeElement || y(h)?.scopeElement || null);
7195
7218
  function j() {
7196
7219
  const w = y(c)?.ownerDocument;
7197
7220
  return y(B) || w?.documentElement || document.documentElement;
@@ -7232,7 +7255,7 @@ function Jh(t, e) {
7232
7255
  console.error("[AnnotationToolbar] Failed to save annotations:", w);
7233
7256
  }
7234
7257
  }
7235
- function ra() {
7258
+ function ia() {
7236
7259
  if (!(!i || !o())) try {
7237
7260
  const w = sessionStorage.getItem(V());
7238
7261
  if (!w) return;
@@ -7270,7 +7293,7 @@ function Jh(t, e) {
7270
7293
  O(g, "");
7271
7294
  }, 3e3), $t();
7272
7295
  }
7273
- function ia() {
7296
+ function sa() {
7274
7297
  if (!y($) || !o()) {
7275
7298
  console.warn("[AnnotationToolbar] No overlapping annotation to remove");
7276
7299
  return;
@@ -7288,13 +7311,13 @@ function Jh(t, e) {
7288
7311
  O(g, "");
7289
7312
  }, 3e3), $t();
7290
7313
  }
7291
- function sa() {
7314
+ function aa() {
7292
7315
  const w = y(T);
7293
7316
  o()?.clearAnnotations(), O(T, 0), sessionStorage.removeItem(V()), O(g, `${w} annotation${w === 1 ? "" : "s"} cleared`), setTimeout(() => {
7294
7317
  O(g, "");
7295
7318
  }, 3e3), $t();
7296
7319
  }
7297
- async function aa() {
7320
+ async function la() {
7298
7321
  if (!(!y(f).selectedRange || !r())) {
7299
7322
  O(v, !0);
7300
7323
  try {
@@ -7315,23 +7338,23 @@ function Jh(t, e) {
7315
7338
  Pr(() => {
7316
7339
  if (!i) return;
7317
7340
  const w = setTimeout(() => {
7318
- ra();
7341
+ ia();
7319
7342
  }, 2e3), x = y(B) || document;
7320
7343
  return x.addEventListener("mouseup", ln), x.addEventListener("click", cn), x.addEventListener("touchend", ln), x.addEventListener("touchstart", cn), document.addEventListener("keydown", br), window.addEventListener("scroll", $t, !0), () => {
7321
7344
  clearTimeout(w), x.removeEventListener("mouseup", ln), x.removeEventListener("click", cn), x.removeEventListener("touchend", ln), x.removeEventListener("touchstart", cn), document.removeEventListener("keydown", br), window.removeEventListener("scroll", $t, !0);
7322
7345
  };
7323
7346
  }), Pr(() => {
7324
7347
  if (!y(c)) return;
7325
- const w = oc(y(c), (L) => {
7348
+ const w = rc(y(c), (L) => {
7326
7349
  O(h, L, !0);
7327
- }), x = rc(y(c), (L) => {
7350
+ }), x = ic(y(c), (L) => {
7328
7351
  O(p, L, !0);
7329
7352
  });
7330
7353
  return () => {
7331
7354
  x(), w();
7332
7355
  };
7333
7356
  });
7334
- var la = {
7357
+ var ca = {
7335
7358
  get enabled() {
7336
7359
  return n();
7337
7360
  },
@@ -7350,51 +7373,51 @@ function Jh(t, e) {
7350
7373
  set ttsService(w = null) {
7351
7374
  r(w), Sn();
7352
7375
  }
7353
- }, yr = Yh(), Tr = io(yr);
7376
+ }, yr = Qh(), Tr = io(yr);
7354
7377
  Vr(Tr, (w) => O(c, w), () => y(c));
7355
- var wr = jt(Tr, 2), ca = (w) => {
7356
- var x = Kh(), L = mn(x);
7357
- zl(L, 17, () => a, Rl, (pt, ft) => {
7358
- var tt = Fh(), un = mn(tt), no = mn(un, !0);
7378
+ var wr = jt(Tr, 2), ua = (w) => {
7379
+ var x = Zh(), L = mn(x);
7380
+ Hl(L, 17, () => a, Wl, (pt, ft) => {
7381
+ var tt = Uh(), un = mn(tt), no = mn(un, !0);
7359
7382
  hn(un), hn(tt), vn(() => {
7360
7383
  Dr(tt, `background-color: ${y(ft).hex ?? ""};`), Br(tt, "aria-label", y(ft).label), Br(tt, "title", y(ft).label), zr(no, y(ft).label);
7361
7384
  }), ze("click", tt, () => vr(y(ft).name)), Vt(pt, tt);
7362
7385
  });
7363
7386
  var dt = jt(L, 2), Kt = jt(dt, 2), Re = (pt) => {
7364
- var ft = qh(), tt = jt(io(ft), 2);
7365
- vn(() => tt.disabled = y(v)), ze("click", tt, aa), Vt(pt, ft);
7387
+ var ft = Kh(), tt = jt(io(ft), 2);
7388
+ vn(() => tt.disabled = y(v)), ze("click", tt, la), Vt(pt, ft);
7366
7389
  };
7367
7390
  je(Kt, (pt) => {
7368
7391
  r() && pt(Re);
7369
7392
  });
7370
- var eo = jt(Kt, 2), ha = (pt) => {
7371
- var ft = Uh(), tt = jt(io(ft), 2), un = (Yt) => {
7372
- var We = Vh();
7373
- ze("click", We, ia), Vt(Yt, We);
7393
+ var eo = jt(Kt, 2), da = (pt) => {
7394
+ var ft = Jh(), tt = jt(io(ft), 2), un = (Yt) => {
7395
+ var We = Yh();
7396
+ ze("click", We, sa), Vt(Yt, We);
7374
7397
  };
7375
7398
  je(tt, (Yt) => {
7376
7399
  y(k) && Yt(un);
7377
7400
  });
7378
- var no = jt(tt, 2), da = (Yt) => {
7379
- var We = Gh();
7380
- ze("click", We, sa), Vt(Yt, We);
7401
+ var no = jt(tt, 2), pa = (Yt) => {
7402
+ var We = Xh();
7403
+ ze("click", We, aa), Vt(Yt, We);
7381
7404
  };
7382
7405
  je(no, (Yt) => {
7383
- y(R) && Yt(da);
7406
+ y(R) && Yt(pa);
7384
7407
  }), Vt(pt, ft);
7385
7408
  };
7386
7409
  je(eo, (pt) => {
7387
- (y(k) || y(R)) && pt(ha);
7410
+ (y(k) || y(R)) && pt(da);
7388
7411
  }), hn(x), Vr(x, (pt) => O(u, pt), () => y(u)), vn(() => Dr(x, `left:${y(f).toolbarPosition.x}px; top:${y(f).toolbarPosition.y}px; transform: translate(-50%, -100%);`)), ze("click", dt, () => vr(at.UNDERLINE)), Vt(w, x);
7389
7412
  };
7390
7413
  je(wr, (w) => {
7391
- y(f).isVisible && w(ca);
7414
+ y(f).isVisible && w(ua);
7392
7415
  });
7393
- var Sr = jt(wr, 2), ua = mn(Sr, !0);
7394
- return hn(Sr), vn(() => zr(ua, y(g))), Vt(t, yr), ki(la);
7416
+ var Sr = jt(wr, 2), ha = mn(Sr, !0);
7417
+ return hn(Sr), vn(() => zr(ha, y(g))), Vt(t, yr), ki(ca);
7395
7418
  }
7396
- Al(["click"]);
7397
- customElements.define("pie-tool-annotation-toolbar", Zl(Jh, {
7419
+ Il(["click"]);
7420
+ customElements.define("pie-tool-annotation-toolbar", Ql(ed, {
7398
7421
  enabled: {
7399
7422
  attribute: "enabled",
7400
7423
  type: "Boolean"
@@ -7403,6 +7426,6 @@ customElements.define("pie-tool-annotation-toolbar", Zl(Jh, {
7403
7426
  ttsService: { type: "Object" }
7404
7427
  }, [], [], { mode: "open" }));
7405
7428
  export {
7406
- ed as n,
7407
- td as t
7429
+ id as n,
7430
+ rd as t
7408
7431
  };