@pie-players/pie-section-player 0.3.1 → 0.3.3

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.
@@ -11,8 +11,8 @@ function ar(e) {
11
11
  e[t]();
12
12
  }
13
13
  function Pn() {
14
- var e, t, o = new Promise((n, r) => {
15
- e = n, t = r;
14
+ var e, t, o = new Promise((n, i) => {
15
+ e = n, t = i;
16
16
  });
17
17
  return { promise: o, resolve: e, reject: t };
18
18
  }
@@ -104,11 +104,11 @@ function fo(e = !0) {
104
104
  } else (n === Ko || n === vo || // "[1", "[2", etc. for if blocks
105
105
  n[0] === "[" && !isNaN(Number(n.slice(1)))) && (t += 1);
106
106
  }
107
- var r = (
107
+ var i = (
108
108
  /** @type {TemplateNode} */
109
109
  /* @__PURE__ */ et(o)
110
110
  );
111
- e && o.remove(), o = r;
111
+ e && o.remove(), o = i;
112
112
  }
113
113
  }
114
114
  function Wn(e) {
@@ -258,14 +258,14 @@ const Lr = class Xn {
258
258
  process(t) {
259
259
  F = [], this.apply();
260
260
  var o = [], n = [];
261
- for (const r of t)
262
- G(this, te, Ro).call(this, r, o, n);
261
+ for (const i of t)
262
+ G(this, te, Ro).call(this, i, o, n);
263
263
  if (this.is_deferred()) {
264
264
  G(this, te, No).call(this, n), G(this, te, No).call(this, o);
265
- for (const [r, i] of u(this, Ht))
266
- ei(r, i);
265
+ for (const [i, r] of u(this, Ht))
266
+ ei(i, r);
267
267
  } else {
268
- for (const r of u(this, Oe)) r();
268
+ for (const i of u(this, Oe)) i();
269
269
  u(this, Oe).clear(), u(this, Nt) === 0 && G(this, te, Zn).call(this), V = null, mn(n), mn(o), u(this, Ne)?.resolve();
270
270
  }
271
271
  ft = null;
@@ -351,10 +351,10 @@ Oe = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Nt = /*
351
351
  */
352
352
  Ro = function(e, t, o) {
353
353
  e.f ^= N;
354
- for (var n = e.first, r = null; n !== null; ) {
355
- var i = n.f, s = (i & (dt | Jt)) !== 0, l = s && (i & N) !== 0, a = l || (i & J) !== 0 || u(this, Ht).has(n);
354
+ for (var n = e.first, i = null; n !== null; ) {
355
+ var r = n.f, s = (r & (dt | Jt)) !== 0, l = s && (r & N) !== 0, a = l || (r & J) !== 0 || u(this, Ht).has(n);
356
356
  if (!a && n.fn !== null) {
357
- s ? n.f ^= N : r !== null && (i & (ze | bo | qn)) !== 0 ? r.b.defer_effect(n) : (i & ze) !== 0 ? t.push(n) : Fe(n) && ((i & Mt) !== 0 && u(this, me).add(n), _e(n));
357
+ s ? n.f ^= N : i !== null && (r & (ze | bo | qn)) !== 0 ? i.b.defer_effect(n) : (r & ze) !== 0 ? t.push(n) : Fe(n) && ((r & Mt) !== 0 && u(this, me).add(n), _e(n));
358
358
  var c = n.first;
359
359
  if (c !== null) {
360
360
  n = c;
@@ -362,7 +362,7 @@ Ro = function(e, t, o) {
362
362
  }
363
363
  }
364
364
  for (; n !== null; ) {
365
- n === r && (r = null);
365
+ n === i && (i = null);
366
366
  var f = n.next;
367
367
  if (f !== null) {
368
368
  n = f;
@@ -382,34 +382,34 @@ No = function(e) {
382
382
  if (oo.size > 1) {
383
383
  this.previous.clear();
384
384
  var t = ft, o = !0;
385
- for (const r of oo) {
386
- if (r === this) {
385
+ for (const i of oo) {
386
+ if (i === this) {
387
387
  o = !1;
388
388
  continue;
389
389
  }
390
- const i = [];
390
+ const r = [];
391
391
  for (const [l, a] of this.current) {
392
- if (r.current.has(l))
393
- if (o && a !== r.current.get(l))
394
- r.current.set(l, a);
392
+ if (i.current.has(l))
393
+ if (o && a !== i.current.get(l))
394
+ i.current.set(l, a);
395
395
  else
396
396
  continue;
397
- i.push(l);
397
+ r.push(l);
398
398
  }
399
- if (i.length === 0)
399
+ if (r.length === 0)
400
400
  continue;
401
- const s = [...r.current.keys()].filter((l) => !this.current.has(l));
401
+ const s = [...i.current.keys()].filter((l) => !this.current.has(l));
402
402
  if (s.length > 0) {
403
403
  var n = F;
404
404
  F = [];
405
405
  const l = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
406
- for (const c of i)
406
+ for (const c of r)
407
407
  Qn(c, s, l, a);
408
408
  if (F.length > 0) {
409
- V = r, r.apply();
409
+ V = i, i.apply();
410
410
  for (const c of F)
411
- G(e = r, te, Ro).call(e, c, [], []);
412
- r.deactivate();
411
+ G(e = i, te, Ro).call(e, c, [], []);
412
+ i.deactivate();
413
413
  }
414
414
  F = n;
415
415
  }
@@ -463,14 +463,14 @@ function mn(e) {
463
463
  var n = e[o++];
464
464
  if ((n.f & (Vt | J)) === 0 && Fe(n) && (At = /* @__PURE__ */ new Set(), _e(n), n.deps === null && n.first === null && n.nodes === null && n.teardown === null && n.ac === null && mi(n), At?.size > 0)) {
465
465
  Ut.clear();
466
- for (const r of At) {
467
- if ((r.f & (Vt | J)) !== 0) continue;
468
- const i = [r];
469
- let s = r.parent;
466
+ for (const i of At) {
467
+ if ((i.f & (Vt | J)) !== 0) continue;
468
+ const r = [i];
469
+ let s = i.parent;
470
470
  for (; s !== null; )
471
- At.has(s) && (At.delete(s), i.push(s)), s = s.parent;
472
- for (let l = i.length - 1; l >= 0; l--) {
473
- const a = i[l];
471
+ At.has(s) && (At.delete(s), r.push(s)), s = s.parent;
472
+ for (let l = r.length - 1; l >= 0; l--) {
473
+ const a = r[l];
474
474
  (a.f & (Vt | J)) === 0 && _e(a);
475
475
  }
476
476
  }
@@ -482,17 +482,17 @@ function mn(e) {
482
482
  }
483
483
  function Qn(e, t, o, n) {
484
484
  if (!o.has(e) && (o.add(e), e.reactions !== null))
485
- for (const r of e.reactions) {
486
- const i = r.f;
487
- (i & P) !== 0 ? Qn(
485
+ for (const i of e.reactions) {
486
+ const r = i.f;
487
+ (r & P) !== 0 ? Qn(
488
488
  /** @type {Derived} */
489
- r,
489
+ i,
490
490
  t,
491
491
  o,
492
492
  n
493
- ) : (i & (Xo | Mt)) !== 0 && (i & q) === 0 && ti(r, t, n) && (M(r, q), ct(
493
+ ) : (r & (Xo | Mt)) !== 0 && (r & q) === 0 && ti(i, t, n) && (M(i, q), ct(
494
494
  /** @type {Effect} */
495
- r
495
+ i
496
496
  ));
497
497
  }
498
498
  }
@@ -500,18 +500,18 @@ function ti(e, t, o) {
500
500
  const n = o.get(e);
501
501
  if (n !== void 0) return n;
502
502
  if (e.deps !== null)
503
- for (const r of e.deps) {
504
- if (we.call(t, r))
503
+ for (const i of e.deps) {
504
+ if (we.call(t, i))
505
505
  return !0;
506
- if ((r.f & P) !== 0 && ti(
506
+ if ((i.f & P) !== 0 && ti(
507
507
  /** @type {Derived} */
508
- r,
508
+ i,
509
509
  t,
510
510
  o
511
511
  ))
512
512
  return o.set(
513
513
  /** @type {Derived} */
514
- r,
514
+ i,
515
515
  !0
516
516
  ), !0;
517
517
  }
@@ -561,20 +561,20 @@ class Rr {
561
561
  constructor(t, o, n) {
562
562
  x(this, st), $(this, "parent"), $(this, "is_pending", !1), x(this, lt), x(this, io, L ? E : null), x(this, zt), x(this, pe), x(this, Lt), x(this, Et, null), x(this, X, null), x(this, kt, null), x(this, jt, null), x(this, ee, 0), x(this, Pt, 0), x(this, Pe, !1), x(this, De, /* @__PURE__ */ new Set()), x(this, He, /* @__PURE__ */ new Set()), x(this, qt, null), x(this, jo, Vr(() => (T(this, qt, ce(u(this, ee))), () => {
563
563
  T(this, qt, null);
564
- }))), T(this, lt, t), T(this, zt, o), T(this, pe, (r) => {
565
- var i = (
564
+ }))), T(this, lt, t), T(this, zt, o), T(this, pe, (i) => {
565
+ var r = (
566
566
  /** @type {Effect} */
567
567
  S
568
568
  );
569
- i.b = this, i.f |= Vo, n(r);
569
+ r.b = this, r.f |= Vo, n(i);
570
570
  }), this.parent = /** @type {Effect} */
571
571
  S.b, T(this, Lt, Io(() => {
572
572
  if (L) {
573
- const r = (
573
+ const i = (
574
574
  /** @type {Comment} */
575
575
  u(this, io)
576
576
  );
577
- wo(), r.data === vo ? G(this, st, ni).call(this) : G(this, st, oi).call(this);
577
+ wo(), i.data === vo ? G(this, st, ni).call(this) : G(this, st, oi).call(this);
578
578
  } else
579
579
  G(this, st, Po).call(this);
580
580
  }, Mr)), L && T(this, lt, E);
@@ -623,13 +623,13 @@ class Rr {
623
623
  /** @type {TemplateNode} */
624
624
  u(this, io)
625
625
  ), _r(), B(fo()));
626
- var r = !1, i = !1;
626
+ var i = !1, r = !1;
627
627
  const s = () => {
628
- if (r) {
628
+ if (i) {
629
629
  xr();
630
630
  return;
631
631
  }
632
- r = !0, i && Ir(), u(this, kt) !== null && fe(u(this, kt), () => {
632
+ i = !0, r && Ir(), u(this, kt) !== null && fe(u(this, kt), () => {
633
633
  T(this, kt, null);
634
634
  }), G(this, st, po).call(this, () => {
635
635
  ae.ensure(), G(this, st, Po).call(this);
@@ -637,7 +637,7 @@ class Rr {
637
637
  };
638
638
  le(() => {
639
639
  try {
640
- i = !0, o?.(t, s), i = !1;
640
+ r = !0, o?.(t, s), r = !1;
641
641
  } catch (l) {
642
642
  Ie(l, u(this, Lt) && u(this, Lt).parent);
643
643
  }
@@ -710,8 +710,8 @@ po = function(e) {
710
710
  Tt(u(this, Lt)), ot(u(this, Lt)), $e(u(this, Lt).ctx);
711
711
  try {
712
712
  return e();
713
- } catch (r) {
714
- return Un(r), null;
713
+ } catch (i) {
714
+ return Un(i), null;
715
715
  } finally {
716
716
  Tt(t), ot(o), $e(n);
717
717
  }
@@ -738,16 +738,16 @@ qo = function(e) {
738
738
  }
739
739
  };
740
740
  function Nr(e, t, o, n) {
741
- const r = $o;
742
- var i = e.filter((v) => !v.settled);
743
- if (o.length === 0 && i.length === 0) {
744
- n(t.map(r));
741
+ const i = $o;
742
+ var r = e.filter((v) => !v.settled);
743
+ if (o.length === 0 && r.length === 0) {
744
+ n(t.map(i));
745
745
  return;
746
746
  }
747
747
  var s = V, l = (
748
748
  /** @type {Effect} */
749
749
  S
750
- ), a = jr(), c = i.length === 1 ? i[0].promise : i.length > 1 ? Promise.all(i.map((v) => v.promise)) : null;
750
+ ), a = jr(), c = r.length === 1 ? r[0].promise : r.length > 1 ? Promise.all(r.map((v) => v.promise)) : null;
751
751
  function f(v) {
752
752
  a();
753
753
  try {
@@ -758,18 +758,18 @@ function Nr(e, t, o, n) {
758
758
  s?.deactivate(), Wo();
759
759
  }
760
760
  if (o.length === 0) {
761
- c.then(() => f(t.map(r)));
761
+ c.then(() => f(t.map(i)));
762
762
  return;
763
763
  }
764
764
  function p() {
765
- a(), Promise.all(o.map((v) => /* @__PURE__ */ Pr(v))).then((v) => f([...t.map(r), ...v])).catch((v) => Ie(v, l));
765
+ a(), Promise.all(o.map((v) => /* @__PURE__ */ Pr(v))).then((v) => f([...t.map(i), ...v])).catch((v) => Ie(v, l));
766
766
  }
767
767
  c ? c.then(p) : p();
768
768
  }
769
769
  function jr() {
770
770
  var e = S, t = _, o = tt, n = V;
771
- return function(r = !0) {
772
- Tt(e), ot(t), $e(o), r && n?.activate();
771
+ return function(i = !0) {
772
+ Tt(e), ot(t), $e(o), i && n?.activate();
773
773
  };
774
774
  }
775
775
  function Wo() {
@@ -806,10 +806,10 @@ function Pr(e, t, o) {
806
806
  S
807
807
  );
808
808
  n === null && dr();
809
- var r = (
809
+ var i = (
810
810
  /** @type {Boundary} */
811
811
  n.b
812
- ), i = (
812
+ ), r = (
813
813
  /** @type {Promise<V>} */
814
814
  /** @type {unknown} */
815
815
  void 0
@@ -819,7 +819,7 @@ function Pr(e, t, o) {
819
819
  ), l = !_, a = /* @__PURE__ */ new Map();
820
820
  return Jr(() => {
821
821
  var c = Pn();
822
- i = c.promise;
822
+ r = c.promise;
823
823
  try {
824
824
  Promise.resolve(e()).then(c.resolve, c.reject).then(() => {
825
825
  f === V && f.committed && f.deactivate(), Wo();
@@ -832,8 +832,8 @@ function Pr(e, t, o) {
832
832
  V
833
833
  );
834
834
  if (l) {
835
- var p = r.is_rendered();
836
- r.update_pending_count(1), f.increment(p), a.get(f)?.reject(oe), a.delete(f), a.set(f, c);
835
+ var p = i.is_rendered();
836
+ i.update_pending_count(1), f.increment(p), a.get(f)?.reject(oe), a.delete(f), a.set(f, c);
837
837
  }
838
838
  const v = (d, h = void 0) => {
839
839
  if (f.activate(), h)
@@ -845,7 +845,7 @@ function Pr(e, t, o) {
845
845
  y.reject(oe);
846
846
  }
847
847
  }
848
- l && (r.update_pending_count(-1), f.decrement(p));
848
+ l && (i.update_pending_count(-1), f.decrement(p));
849
849
  };
850
850
  c.promise.then(v, (d) => v(null, d || "unknown"));
851
851
  }), Fr(() => {
@@ -854,11 +854,11 @@ function Pr(e, t, o) {
854
854
  }), new Promise((c) => {
855
855
  function f(p) {
856
856
  function v() {
857
- p === i ? c(s) : f(i);
857
+ p === r ? c(s) : f(r);
858
858
  }
859
859
  p.then(v, v);
860
860
  }
861
- f(i);
861
+ f(r);
862
862
  });
863
863
  }
864
864
  // @__NO_SIDE_EFFECTS__
@@ -959,11 +959,11 @@ function xe(e, t) {
959
959
  Kt ? Ut.set(e, t) : Ut.set(e, o), e.v = t;
960
960
  var n = ae.ensure();
961
961
  if (n.capture(e, o), (e.f & P) !== 0) {
962
- const r = (
962
+ const i = (
963
963
  /** @type {Derived} */
964
964
  e
965
965
  );
966
- (e.f & q) !== 0 && Qo(r), Yo(r);
966
+ (e.f & q) !== 0 && Qo(i), Yo(i);
967
967
  }
968
968
  e.wv = xi(), ai(e, q), S !== null && (S.f & N) !== 0 && (S.f & (dt | Jt)) === 0 && (Z === null ? Yr([e]) : Z.push(e)), !n.is_fork && Do.size > 0 && !si && Br();
969
969
  }
@@ -981,20 +981,20 @@ function Be(e) {
981
981
  function ai(e, t) {
982
982
  var o = e.reactions;
983
983
  if (o !== null)
984
- for (var n = o.length, r = 0; r < n; r++) {
985
- var i = o[r], s = i.f, l = (s & q) === 0;
986
- if (l && M(i, t), (s & P) !== 0) {
984
+ for (var n = o.length, i = 0; i < n; i++) {
985
+ var r = o[i], s = r.f, l = (s & q) === 0;
986
+ if (l && M(r, t), (s & P) !== 0) {
987
987
  var a = (
988
988
  /** @type {Derived} */
989
- i
989
+ r
990
990
  );
991
- ft?.delete(a), (s & se) === 0 && (s & Y && (i.f |= se), ai(a, ht));
991
+ ft?.delete(a), (s & se) === 0 && (s & Y && (r.f |= se), ai(a, ht));
992
992
  } else l && ((s & Mt) !== 0 && At !== null && At.add(
993
993
  /** @type {Effect} */
994
- i
994
+ r
995
995
  ), ct(
996
996
  /** @type {Effect} */
997
- i
997
+ r
998
998
  ));
999
999
  }
1000
1000
  }
@@ -1004,11 +1004,11 @@ function ve(e) {
1004
1004
  const t = jn(e);
1005
1005
  if (t !== rr && t !== sr)
1006
1006
  return e;
1007
- var o = /* @__PURE__ */ new Map(), n = Nn(e), r = /* @__PURE__ */ R(0), i = re, s = (l) => {
1008
- if (re === i)
1007
+ var o = /* @__PURE__ */ new Map(), n = Nn(e), i = /* @__PURE__ */ R(0), r = re, s = (l) => {
1008
+ if (re === r)
1009
1009
  return l();
1010
1010
  var a = _, c = re;
1011
- ot(null), $n(i);
1011
+ ot(null), $n(r);
1012
1012
  var f = l();
1013
1013
  return ot(a), $n(c), f;
1014
1014
  };
@@ -1032,10 +1032,10 @@ function ve(e) {
1032
1032
  if (c === void 0) {
1033
1033
  if (a in l) {
1034
1034
  const f = s(() => /* @__PURE__ */ R(j));
1035
- o.set(a, f), Be(r);
1035
+ o.set(a, f), Be(i);
1036
1036
  }
1037
1037
  } else
1038
- C(c, j), Be(r);
1038
+ C(c, j), Be(i);
1039
1039
  return !0;
1040
1040
  },
1041
1041
  get(l, a, c) {
@@ -1107,12 +1107,12 @@ function ve(e) {
1107
1107
  ), I = Number(a);
1108
1108
  Number.isInteger(I) && I >= k.v && C(k, I + 1);
1109
1109
  }
1110
- Be(r);
1110
+ Be(i);
1111
1111
  }
1112
1112
  return !0;
1113
1113
  },
1114
1114
  ownKeys(l) {
1115
- b(r);
1115
+ b(i);
1116
1116
  var a = Reflect.ownKeys(l).filter((p) => {
1117
1117
  var v = o.get(p);
1118
1118
  return v === void 0 || v.v !== j;
@@ -1186,15 +1186,15 @@ function Lo(e, t = !1) {
1186
1186
  }
1187
1187
  function Ot(e, t = 1, o = !1) {
1188
1188
  let n = L ? E : e;
1189
- for (var r; t--; )
1190
- r = n, n = /** @type {TemplateNode} */
1189
+ for (var i; t--; )
1190
+ i = n, n = /** @type {TemplateNode} */
1191
1191
  /* @__PURE__ */ et(n);
1192
1192
  if (!L)
1193
1193
  return n;
1194
1194
  if (o) {
1195
1195
  if (n?.nodeType !== mo) {
1196
- var i = wt();
1197
- return n === null ? r?.after(i) : n.before(i), B(i), i;
1196
+ var r = wt();
1197
+ return n === null ? i?.after(r) : n.before(r), B(r), r;
1198
1198
  }
1199
1199
  en(
1200
1200
  /** @type {Text} */
@@ -1245,7 +1245,7 @@ function Gr(e, t) {
1245
1245
  function $t(e, t, o) {
1246
1246
  var n = S;
1247
1247
  n !== null && (n.f & J) !== 0 && (e |= J);
1248
- var r = {
1248
+ var i = {
1249
1249
  ctx: tt,
1250
1250
  deps: null,
1251
1251
  nodes: null,
@@ -1263,21 +1263,21 @@ function $t(e, t, o) {
1263
1263
  };
1264
1264
  if (o)
1265
1265
  try {
1266
- _e(r);
1266
+ _e(i);
1267
1267
  } catch (l) {
1268
- throw H(r), l;
1268
+ throw H(i), l;
1269
1269
  }
1270
- else t !== null && ct(r);
1271
- var i = r;
1272
- if (o && i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && // either `null`, or a singular child
1273
- (i.f & he) === 0 && (i = i.first, (e & Mt) !== 0 && (e & Te) !== 0 && i !== null && (i.f |= Te)), i !== null && (i.parent = n, n !== null && Gr(i, n), _ !== null && (_.f & P) !== 0 && (e & Jt) === 0)) {
1270
+ else t !== null && ct(i);
1271
+ var r = i;
1272
+ if (o && r.deps === null && r.teardown === null && r.nodes === null && r.first === r.last && // either `null`, or a singular child
1273
+ (r.f & he) === 0 && (r = r.first, (e & Mt) !== 0 && (e & Te) !== 0 && r !== null && (r.f |= Te)), r !== null && (r.parent = n, n !== null && Gr(r, n), _ !== null && (_.f & P) !== 0 && (e & Jt) === 0)) {
1274
1274
  var s = (
1275
1275
  /** @type {Derived} */
1276
1276
  _
1277
1277
  );
1278
- (s.effects ?? (s.effects = [])).push(i);
1278
+ (s.effects ?? (s.effects = [])).push(r);
1279
1279
  }
1280
- return r;
1280
+ return i;
1281
1281
  }
1282
1282
  function on() {
1283
1283
  return _ !== null && !ut;
@@ -1330,8 +1330,8 @@ function nn(e, t = 0) {
1330
1330
  return $t(bo | t, e, !0);
1331
1331
  }
1332
1332
  function Ye(e, t = [], o = [], n = []) {
1333
- Nr(n, t, o, (r) => {
1334
- $t(bo, () => e(...r.map(b)), !0);
1333
+ Nr(n, t, o, (i) => {
1334
+ $t(bo, () => e(...i.map(b)), !0);
1335
1335
  });
1336
1336
  }
1337
1337
  function Io(e, t = 0) {
@@ -1356,9 +1356,9 @@ function bi(e) {
1356
1356
  function rn(e, t = !1) {
1357
1357
  var o = e.first;
1358
1358
  for (e.first = e.last = null; o !== null; ) {
1359
- const r = o.ac;
1360
- r !== null && pi(() => {
1361
- r.abort(oe);
1359
+ const i = o.ac;
1360
+ i !== null && pi(() => {
1361
+ i.abort(oe);
1362
1362
  });
1363
1363
  var n = o.next;
1364
1364
  (o.f & Jt) !== 0 ? o.parent = null : H(o, t), o = n;
@@ -1379,11 +1379,11 @@ function H(e, t = !0) {
1379
1379
  ), o = !0), rn(e, t && !o), Ge(e, 0), M(e, Vt);
1380
1380
  var n = e.nodes && e.nodes.t;
1381
1381
  if (n !== null)
1382
- for (const i of n)
1383
- i.stop();
1382
+ for (const r of n)
1383
+ r.stop();
1384
1384
  bi(e);
1385
- var r = e.parent;
1386
- r !== null && r.first !== null && mi(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1385
+ var i = e.parent;
1386
+ i !== null && i.first !== null && mi(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1387
1387
  }
1388
1388
  function Xr(e, t) {
1389
1389
  for (; e !== null; ) {
@@ -1398,15 +1398,15 @@ function mi(e) {
1398
1398
  function fe(e, t, o = !0) {
1399
1399
  var n = [];
1400
1400
  yi(e, n, !0);
1401
- var r = () => {
1401
+ var i = () => {
1402
1402
  o && H(e), t && t();
1403
- }, i = n.length;
1404
- if (i > 0) {
1405
- var s = () => --i || r();
1403
+ }, r = n.length;
1404
+ if (r > 0) {
1405
+ var s = () => --r || i();
1406
1406
  for (var l of n)
1407
1407
  l.out(s);
1408
1408
  } else
1409
- r();
1409
+ i();
1410
1410
  }
1411
1411
  function yi(e, t, o) {
1412
1412
  if ((e.f & J) === 0) {
@@ -1415,12 +1415,12 @@ function yi(e, t, o) {
1415
1415
  if (n !== null)
1416
1416
  for (const l of n)
1417
1417
  (l.is_global || o) && t.push(l);
1418
- for (var r = e.first; r !== null; ) {
1419
- var i = r.next, s = (r.f & Te) !== 0 || // If this is a branch effect without a block effect parent,
1418
+ for (var i = e.first; i !== null; ) {
1419
+ var r = i.next, s = (i.f & Te) !== 0 || // If this is a branch effect without a block effect parent,
1420
1420
  // it means the parent block effect was pruned. In that case,
1421
1421
  // transparency information was transferred to the branch effect.
1422
- (r.f & dt) !== 0 && (e.f & Mt) !== 0;
1423
- yi(r, t, s ? o : !1), r = i;
1422
+ (i.f & dt) !== 0 && (e.f & Mt) !== 0;
1423
+ yi(i, t, s ? o : !1), i = r;
1424
1424
  }
1425
1425
  }
1426
1426
  }
@@ -1431,20 +1431,20 @@ function wi(e, t) {
1431
1431
  if ((e.f & J) !== 0) {
1432
1432
  e.f ^= J, (e.f & N) === 0 && (M(e, q), ct(e));
1433
1433
  for (var o = e.first; o !== null; ) {
1434
- var n = o.next, r = (o.f & Te) !== 0 || (o.f & dt) !== 0;
1435
- wi(o, r ? t : !1), o = n;
1434
+ var n = o.next, i = (o.f & Te) !== 0 || (o.f & dt) !== 0;
1435
+ wi(o, i ? t : !1), o = n;
1436
1436
  }
1437
- var i = e.nodes && e.nodes.t;
1438
- if (i !== null)
1439
- for (const s of i)
1437
+ var r = e.nodes && e.nodes.t;
1438
+ if (r !== null)
1439
+ for (const s of r)
1440
1440
  (s.is_global || t) && s.in();
1441
1441
  }
1442
1442
  }
1443
1443
  function Ti(e, t) {
1444
1444
  if (e.nodes)
1445
1445
  for (var o = e.nodes.start, n = e.nodes.end; o !== null; ) {
1446
- var r = o === n ? null : /* @__PURE__ */ et(o);
1447
- t.append(o), o = r;
1446
+ var i = o === n ? null : /* @__PURE__ */ et(o);
1447
+ t.append(o), o = i;
1448
1448
  }
1449
1449
  }
1450
1450
  let ro = !1, Kt = !1;
@@ -1482,15 +1482,15 @@ function Fe(e) {
1482
1482
  for (var o = (
1483
1483
  /** @type {Value[]} */
1484
1484
  e.deps
1485
- ), n = o.length, r = 0; r < n; r++) {
1486
- var i = o[r];
1485
+ ), n = o.length, i = 0; i < n; i++) {
1486
+ var r = o[i];
1487
1487
  if (Fe(
1488
1488
  /** @type {Derived} */
1489
- i
1489
+ r
1490
1490
  ) && ii(
1491
1491
  /** @type {Derived} */
1492
- i
1493
- ), i.wv > e.wv)
1492
+ r
1493
+ ), r.wv > e.wv)
1494
1494
  return !0;
1495
1495
  }
1496
1496
  (t & Y) !== 0 && // During time traveling we don't want to reset the status so that
@@ -1502,21 +1502,21 @@ function Fe(e) {
1502
1502
  function _i(e, t, o = !0) {
1503
1503
  var n = e.reactions;
1504
1504
  if (n !== null && !(Q !== null && we.call(Q, e)))
1505
- for (var r = 0; r < n.length; r++) {
1506
- var i = n[r];
1507
- (i.f & P) !== 0 ? _i(
1505
+ for (var i = 0; i < n.length; i++) {
1506
+ var r = n[i];
1507
+ (r.f & P) !== 0 ? _i(
1508
1508
  /** @type {Derived} */
1509
- i,
1509
+ r,
1510
1510
  t,
1511
1511
  !1
1512
- ) : t === i && (o ? M(i, q) : (i.f & N) !== 0 && M(i, ht), ct(
1512
+ ) : t === r && (o ? M(r, q) : (r.f & N) !== 0 && M(r, ht), ct(
1513
1513
  /** @type {Effect} */
1514
- i
1514
+ r
1515
1515
  ));
1516
1516
  }
1517
1517
  }
1518
1518
  function Si(e) {
1519
- var t, o = z, n = K, r = Z, i = _, s = Q, l = tt, a = ut, c = re, f = e.f;
1519
+ var t, o = z, n = K, i = Z, r = _, s = Q, l = tt, a = ut, c = re, f = e.f;
1520
1520
  z = /** @type {null | Value[]} */
1521
1521
  null, K = 0, Z = null, _ = (f & (dt | Jt)) === 0 ? e : null, Q = null, $e(e.ctx), ut = !1, re = ++ie, e.ac !== null && (pi(() => {
1522
1522
  e.ac.abort(oe);
@@ -1548,21 +1548,21 @@ function Si(e) {
1548
1548
  /** @type {Effect} */
1549
1549
  e
1550
1550
  );
1551
- if (i !== null && i !== e) {
1552
- if (ie++, i.deps !== null)
1551
+ if (r !== null && r !== e) {
1552
+ if (ie++, r.deps !== null)
1553
1553
  for (let y = 0; y < n; y += 1)
1554
- i.deps[y].rv = ie;
1554
+ r.deps[y].rv = ie;
1555
1555
  if (o !== null)
1556
1556
  for (const y of o)
1557
1557
  y.rv = ie;
1558
- Z !== null && (r === null ? r = Z : r.push(.../** @type {Source[]} */
1558
+ Z !== null && (i === null ? i = Z : i.push(.../** @type {Source[]} */
1559
1559
  Z));
1560
1560
  }
1561
1561
  return (e.f & Ft) !== 0 && (e.f ^= Ft), v;
1562
1562
  } catch (y) {
1563
1563
  return Un(y);
1564
1564
  } finally {
1565
- e.f ^= Mo, z = o, K = n, Z = r, _ = i, Q = s, $e(l), ut = a, re = c;
1565
+ e.f ^= Mo, z = o, K = n, Z = i, _ = r, Q = s, $e(l), ut = a, re = c;
1566
1566
  }
1567
1567
  }
1568
1568
  function Qr(e, t) {
@@ -1570,19 +1570,19 @@ function Qr(e, t) {
1570
1570
  if (o !== null) {
1571
1571
  var n = nr.call(o, e);
1572
1572
  if (n !== -1) {
1573
- var r = o.length - 1;
1574
- r === 0 ? o = t.reactions = null : (o[n] = o[r], o.pop());
1573
+ var i = o.length - 1;
1574
+ i === 0 ? o = t.reactions = null : (o[n] = o[i], o.pop());
1575
1575
  }
1576
1576
  }
1577
1577
  if (o === null && (t.f & P) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1578
1578
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1579
1579
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1580
1580
  (z === null || !we.call(z, t))) {
1581
- var i = (
1581
+ var r = (
1582
1582
  /** @type {Derived} */
1583
1583
  t
1584
1584
  );
1585
- (i.f & Y) !== 0 && (i.f ^= Y, i.f &= ~se), Yo(i), Hr(i), Ge(i, 0);
1585
+ (r.f & Y) !== 0 && (r.f ^= Y, r.f &= ~se), Yo(r), Hr(r), Ge(r, 0);
1586
1586
  }
1587
1587
  }
1588
1588
  function Ge(e, t) {
@@ -1599,9 +1599,9 @@ function _e(e) {
1599
1599
  S = e, ro = !0;
1600
1600
  try {
1601
1601
  (t & (Mt | qn)) !== 0 ? Zr(e) : rn(e), bi(e);
1602
- var r = Si(e);
1603
- e.teardown = typeof r == "function" ? r : null, e.wv = Ii;
1604
- var i;
1602
+ var i = Si(e);
1603
+ e.teardown = typeof i == "function" ? i : null, e.wv = Ii;
1604
+ var r;
1605
1605
  or && kr && (e.f & q) !== 0 && e.deps;
1606
1606
  } finally {
1607
1607
  ro = n, S = o;
@@ -1613,13 +1613,13 @@ function b(e) {
1613
1613
  if (_ !== null && !ut) {
1614
1614
  var n = S !== null && (S.f & Vt) !== 0;
1615
1615
  if (!n && (Q === null || !we.call(Q, e))) {
1616
- var r = _.deps;
1616
+ var i = _.deps;
1617
1617
  if ((_.f & Mo) !== 0)
1618
- e.rv < ie && (e.rv = ie, z === null && r !== null && r[K] === e ? K++ : z === null ? z = [e] : z.push(e));
1618
+ e.rv < ie && (e.rv = ie, z === null && i !== null && i[K] === e ? K++ : z === null ? z = [e] : z.push(e));
1619
1619
  else {
1620
1620
  (_.deps ?? (_.deps = [])).push(e);
1621
- var i = e.reactions;
1622
- i === null ? e.reactions = [_] : we.call(i, _) || i.push(_);
1621
+ var r = e.reactions;
1622
+ r === null ? e.reactions = [_] : we.call(r, _) || r.push(_);
1623
1623
  }
1624
1624
  }
1625
1625
  }
@@ -1688,50 +1688,50 @@ function xn(e) {
1688
1688
  var t = this, o = (
1689
1689
  /** @type {Node} */
1690
1690
  t.ownerDocument
1691
- ), n = e.type, r = e.composedPath?.() || [], i = (
1691
+ ), n = e.type, i = e.composedPath?.() || [], r = (
1692
1692
  /** @type {null | Element} */
1693
- r[0] || e.target
1693
+ i[0] || e.target
1694
1694
  );
1695
1695
  In = e;
1696
1696
  var s = 0, l = In === e && e[ge];
1697
1697
  if (l) {
1698
- var a = r.indexOf(l);
1698
+ var a = i.indexOf(l);
1699
1699
  if (a !== -1 && (t === document || t === /** @type {any} */
1700
1700
  window)) {
1701
1701
  e[ge] = t;
1702
1702
  return;
1703
1703
  }
1704
- var c = r.indexOf(t);
1704
+ var c = i.indexOf(t);
1705
1705
  if (c === -1)
1706
1706
  return;
1707
1707
  a <= c && (s = a);
1708
1708
  }
1709
- if (i = /** @type {Element} */
1710
- r[s] || e.target, i !== t) {
1709
+ if (r = /** @type {Element} */
1710
+ i[s] || e.target, r !== t) {
1711
1711
  uo(e, "currentTarget", {
1712
1712
  configurable: !0,
1713
1713
  get() {
1714
- return i || o;
1714
+ return r || o;
1715
1715
  }
1716
1716
  });
1717
1717
  var f = _, p = S;
1718
1718
  ot(null), Tt(null);
1719
1719
  try {
1720
- for (var v, d = []; i !== null; ) {
1721
- var h = i.assignedSlot || i.parentNode || /** @type {any} */
1722
- i.host || null;
1720
+ for (var v, d = []; r !== null; ) {
1721
+ var h = r.assignedSlot || r.parentNode || /** @type {any} */
1722
+ r.host || null;
1723
1723
  try {
1724
- var m = i[ge]?.[n];
1724
+ var m = r[ge]?.[n];
1725
1725
  m != null && (!/** @type {any} */
1726
- i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1726
+ r.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1727
1727
  // -> the target could not have been disabled because it emits the event in the first place
1728
- e.target === i) && m.call(i, e);
1728
+ e.target === r) && m.call(r, e);
1729
1729
  } catch (y) {
1730
1730
  v ? d.push(y) : v = y;
1731
1731
  }
1732
1732
  if (e.cancelBubble || h === t || h === null)
1733
1733
  break;
1734
- i = h;
1734
+ r = h;
1735
1735
  }
1736
1736
  if (v) {
1737
1737
  for (let y of d)
@@ -1771,15 +1771,15 @@ function so(e, t) {
1771
1771
  }
1772
1772
  // @__NO_SIDE_EFFECTS__
1773
1773
  function Zt(e, t) {
1774
- var o = (t & tr) !== 0, n = (t & er) !== 0, r, i = !e.startsWith("<!>");
1774
+ var o = (t & tr) !== 0, n = (t & er) !== 0, i, r = !e.startsWith("<!>");
1775
1775
  return () => {
1776
1776
  if (L)
1777
1777
  return so(E, null), E;
1778
- r === void 0 && (r = ns(i ? e : "<!>" + e, !0), o || (r = /** @type {TemplateNode} */
1779
- /* @__PURE__ */ ue(r)));
1778
+ i === void 0 && (i = ns(r ? e : "<!>" + e, !0), o || (i = /** @type {TemplateNode} */
1779
+ /* @__PURE__ */ ue(i)));
1780
1780
  var s = (
1781
1781
  /** @type {TemplateNode} */
1782
- n || ci ? document.importNode(r, !0) : r.cloneNode(!0)
1782
+ n || ci ? document.importNode(i, !0) : i.cloneNode(!0)
1783
1783
  );
1784
1784
  if (o) {
1785
1785
  var l = (
@@ -1822,18 +1822,18 @@ function Ei(e, t) {
1822
1822
  }
1823
1823
  function ss(e, t) {
1824
1824
  Ho(), t.intro = t.intro ?? !1;
1825
- const o = t.target, n = L, r = E;
1825
+ const o = t.target, n = L, i = E;
1826
1826
  try {
1827
- for (var i = /* @__PURE__ */ ue(o); i && (i.nodeType !== ke || /** @type {Comment} */
1828
- i.data !== Ko); )
1829
- i = /* @__PURE__ */ et(i);
1830
- if (!i)
1827
+ for (var r = /* @__PURE__ */ ue(o); r && (r.nodeType !== ke || /** @type {Comment} */
1828
+ r.data !== Ko); )
1829
+ r = /* @__PURE__ */ et(r);
1830
+ if (!r)
1831
1831
  throw ye;
1832
1832
  at(!0), B(
1833
1833
  /** @type {Comment} */
1834
- i
1834
+ r
1835
1835
  );
1836
- const s = Vi(e, { ...t, anchor: i });
1836
+ const s = Vi(e, { ...t, anchor: r });
1837
1837
  return at(!1), /** @type {Exports} */
1838
1838
  s;
1839
1839
  } catch (s) {
@@ -1842,11 +1842,11 @@ function ss(e, t) {
1842
1842
  throw s;
1843
1843
  return s !== ye && console.warn("Failed to hydrate: ", s), t.recover === !1 && yr(), Ho(), hi(o), at(!1), Ei(e, t);
1844
1844
  } finally {
1845
- at(n), B(r);
1845
+ at(n), B(i);
1846
1846
  }
1847
1847
  }
1848
1848
  const Qe = /* @__PURE__ */ new Map();
1849
- function Vi(e, { target: t, anchor: o, props: n = {}, events: r, context: i, intro: s = !0 }) {
1849
+ function Vi(e, { target: t, anchor: o, props: n = {}, events: i, context: r, intro: s = !0 }) {
1850
1850
  Ho();
1851
1851
  var l = void 0, a = Kr(() => {
1852
1852
  var c = o ?? t.appendChild(wt());
@@ -1863,7 +1863,7 @@ function Vi(e, { target: t, anchor: o, props: n = {}, events: r, context: i, int
1863
1863
  /** @type {ComponentContext} */
1864
1864
  tt
1865
1865
  );
1866
- if (i && (d.c = i), r && (n.$$events = r), L && so(
1866
+ if (r && (d.c = r), i && (n.$$events = i), L && so(
1867
1867
  /** @type {TemplateNode} */
1868
1868
  v,
1869
1869
  null
@@ -1923,15 +1923,15 @@ class as {
1923
1923
  V
1924
1924
  );
1925
1925
  if (u(this, bt).has(n)) {
1926
- var r = (
1926
+ var i = (
1927
1927
  /** @type {Key} */
1928
1928
  u(this, bt).get(n)
1929
- ), i = u(this, Wt).get(r);
1930
- if (i)
1931
- sn(i), u(this, de).delete(r);
1929
+ ), r = u(this, Wt).get(i);
1930
+ if (r)
1931
+ sn(r), u(this, de).delete(i);
1932
1932
  else {
1933
- var s = u(this, mt).get(r);
1934
- s && (u(this, Wt).set(r, s.effect), u(this, mt).delete(r), s.fragment.lastChild.remove(), this.anchor.before(s.fragment), i = s.effect);
1933
+ var s = u(this, mt).get(i);
1934
+ s && (u(this, Wt).set(i, s.effect), u(this, mt).delete(i), s.fragment.lastChild.remove(), this.anchor.before(s.fragment), r = s.effect);
1935
1935
  }
1936
1936
  for (const [l, a] of u(this, bt)) {
1937
1937
  if (u(this, bt).delete(l), l === n)
@@ -1940,7 +1940,7 @@ class as {
1940
1940
  c && (H(c.effect), u(this, mt).delete(a));
1941
1941
  }
1942
1942
  for (const [l, a] of u(this, Wt)) {
1943
- if (l === r || u(this, de).has(l)) continue;
1943
+ if (l === i || u(this, de).has(l)) continue;
1944
1944
  const c = () => {
1945
1945
  if (Array.from(u(this, bt).values()).includes(l)) {
1946
1946
  var f = document.createDocumentFragment();
@@ -1949,14 +1949,14 @@ class as {
1949
1949
  H(a);
1950
1950
  u(this, de).delete(l), u(this, Wt).delete(l);
1951
1951
  };
1952
- u(this, lo) || !i ? (u(this, de).add(l), fe(a, c, !1)) : c();
1952
+ u(this, lo) || !r ? (u(this, de).add(l), fe(a, c, !1)) : c();
1953
1953
  }
1954
1954
  }
1955
1955
  }), x(this, Mi, (n) => {
1956
1956
  u(this, bt).delete(n);
1957
- const r = Array.from(u(this, bt).values());
1958
- for (const [i, s] of u(this, mt))
1959
- r.includes(i) || (H(s.effect), u(this, mt).delete(i));
1957
+ const i = Array.from(u(this, bt).values());
1958
+ for (const [r, s] of u(this, mt))
1959
+ i.includes(r) || (H(s.effect), u(this, mt).delete(r));
1960
1960
  }), this.anchor = t, T(this, lo, o);
1961
1961
  }
1962
1962
  /**
@@ -1968,18 +1968,18 @@ class as {
1968
1968
  var n = (
1969
1969
  /** @type {Batch} */
1970
1970
  V
1971
- ), r = di();
1971
+ ), i = di();
1972
1972
  o && !u(this, Wt).has(t) && !u(this, mt).has(t) && u(this, Wt).set(
1973
1973
  t,
1974
1974
  yt(() => o(this.anchor))
1975
- ), u(this, bt).set(n, t), r || (L && (this.anchor = E), u(this, Go).call(this));
1975
+ ), u(this, bt).set(n, t), i || (L && (this.anchor = E), u(this, Go).call(this));
1976
1976
  }
1977
1977
  }
1978
1978
  bt = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new WeakMap(), lo = /* @__PURE__ */ new WeakMap(), Go = /* @__PURE__ */ new WeakMap(), Mi = /* @__PURE__ */ new WeakMap();
1979
1979
  function Ve(e, t, o = !1) {
1980
1980
  L && wo();
1981
- var n = new as(e), r = o ? Te : 0;
1982
- function i(s, l) {
1981
+ var n = new as(e), i = o ? Te : 0;
1982
+ function r(s, l) {
1983
1983
  if (L) {
1984
1984
  const f = Wn(e);
1985
1985
  var a;
@@ -1994,26 +1994,26 @@ function Ve(e, t, o = !1) {
1994
1994
  Io(() => {
1995
1995
  var s = !1;
1996
1996
  t((l, a = 0) => {
1997
- s = !0, i(a, l);
1998
- }), s || i(!1, null);
1999
- }, r);
1997
+ s = !0, r(a, l);
1998
+ }), s || r(!1, null);
1999
+ }, i);
2000
2000
  }
2001
2001
  function cs(e, t) {
2002
2002
  return t;
2003
2003
  }
2004
2004
  function us(e, t, o) {
2005
- for (var n = [], r = t.length, i, s = t.length, l = 0; l < r; l++) {
2005
+ for (var n = [], i = t.length, r, s = t.length, l = 0; l < i; l++) {
2006
2006
  let p = t[l];
2007
2007
  fe(
2008
2008
  p,
2009
2009
  () => {
2010
- if (i) {
2011
- if (i.pending.delete(p), i.done.add(p), i.pending.size === 0) {
2010
+ if (r) {
2011
+ if (r.pending.delete(p), r.done.add(p), r.pending.size === 0) {
2012
2012
  var v = (
2013
2013
  /** @type {Set<EachOutroGroup>} */
2014
2014
  e.outrogroups
2015
2015
  );
2016
- Fo(go(i.done)), v.delete(i), v.size === 0 && (e.outrogroups = null);
2016
+ Fo(go(r.done)), v.delete(r), v.size === 0 && (e.outrogroups = null);
2017
2017
  }
2018
2018
  } else
2019
2019
  s -= 1;
@@ -2035,17 +2035,17 @@ function us(e, t, o) {
2035
2035
  }
2036
2036
  Fo(t, !a);
2037
2037
  } else
2038
- i = {
2038
+ r = {
2039
2039
  pending: new Set(t),
2040
2040
  done: /* @__PURE__ */ new Set()
2041
- }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(i);
2041
+ }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(r);
2042
2042
  }
2043
2043
  function Fo(e, t = !0) {
2044
2044
  for (var o = 0; o < e.length; o++)
2045
2045
  H(e[o], t);
2046
2046
  }
2047
2047
  var to;
2048
- function fs(e, t, o, n, r, i = null) {
2048
+ function fs(e, t, o, n, i, r = null) {
2049
2049
  var s = e, l = /* @__PURE__ */ new Map();
2050
2050
  L && wo();
2051
2051
  var a = null, c = /* @__PURE__ */ qr(() => {
@@ -2080,12 +2080,12 @@ function fs(e, t, o, n, r, i = null) {
2080
2080
  _t,
2081
2081
  gt,
2082
2082
  W,
2083
- r,
2083
+ i,
2084
2084
  t,
2085
2085
  o
2086
2086
  ), p || (O.e.f |= Gt), l.set(gt, O)), I.add(gt);
2087
2087
  }
2088
- if (m === 0 && i && !a && (p ? a = yt(() => i(s)) : (a = yt(() => i(to ?? (to = wt()))), a.f |= Gt)), m > I.size && pr(), L && m > 0 && B(fo()), !p)
2088
+ if (m === 0 && r && !a && (p ? a = yt(() => r(s)) : (a = yt(() => r(to ?? (to = wt()))), a.f |= Gt)), m > I.size && pr(), L && m > 0 && B(fo()), !p)
2089
2089
  if (xt) {
2090
2090
  for (const [So, ko] of l)
2091
2091
  I.has(So) || vt.skip_effect(ko.e);
@@ -2102,10 +2102,10 @@ function Me(e) {
2102
2102
  e = e.next;
2103
2103
  return e;
2104
2104
  }
2105
- function hs(e, t, o, n, r) {
2106
- var i = t.length, s = e.items, l = Me(e.effect.first), a, c = null, f = [], p = [], v, d, h, m;
2107
- for (m = 0; m < i; m += 1) {
2108
- if (v = t[m], d = r(v, m), h = /** @type {EachItem} */
2105
+ function hs(e, t, o, n, i) {
2106
+ var r = t.length, s = e.items, l = Me(e.effect.first), a, c = null, f = [], p = [], v, d, h, m;
2107
+ for (m = 0; m < r; m += 1) {
2108
+ if (v = t[m], d = i(v, m), h = /** @type {EachItem} */
2109
2109
  s.get(d).e, e.outrogroups !== null)
2110
2110
  for (const O of e.outrogroups)
2111
2111
  O.pending.delete(h), O.done.delete(h);
@@ -2158,19 +2158,19 @@ function hs(e, t, o, n, r) {
2158
2158
  }
2159
2159
  }
2160
2160
  }
2161
- function ds(e, t, o, n, r, i, s, l) {
2162
- var a = (s & Xi) !== 0 ? (s & Qi) === 0 ? /* @__PURE__ */ li(o, !1, !1) : ce(o) : null, c = (s & Yi) !== 0 ? ce(r) : null;
2161
+ function ds(e, t, o, n, i, r, s, l) {
2162
+ var a = (s & Xi) !== 0 ? (s & Qi) === 0 ? /* @__PURE__ */ li(o, !1, !1) : ce(o) : null, c = (s & Yi) !== 0 ? ce(i) : null;
2163
2163
  return {
2164
2164
  v: a,
2165
2165
  i: c,
2166
- e: yt(() => (i(t, a ?? o, c ?? r, l), () => {
2166
+ e: yt(() => (r(t, a ?? o, c ?? i, l), () => {
2167
2167
  e.delete(n);
2168
2168
  }))
2169
2169
  };
2170
2170
  }
2171
2171
  function qe(e, t, o) {
2172
2172
  if (e.nodes)
2173
- for (var n = e.nodes.start, r = e.nodes.end, i = t && (t.f & Gt) === 0 ? (
2173
+ for (var n = e.nodes.start, i = e.nodes.end, r = t && (t.f & Gt) === 0 ? (
2174
2174
  /** @type {EffectNodes} */
2175
2175
  t.nodes.start
2176
2176
  ) : o; n !== null; ) {
@@ -2178,7 +2178,7 @@ function qe(e, t, o) {
2178
2178
  /** @type {TemplateNode} */
2179
2179
  /* @__PURE__ */ et(n)
2180
2180
  );
2181
- if (i.before(n), n === r)
2181
+ if (r.before(n), n === i)
2182
2182
  return;
2183
2183
  n = s;
2184
2184
  }
@@ -2188,25 +2188,25 @@ function Rt(e, t, o) {
2188
2188
  }
2189
2189
  function ps(e, t) {
2190
2190
  let o = null, n = L;
2191
- var r;
2191
+ var i;
2192
2192
  if (L) {
2193
2193
  o = E;
2194
- for (var i = /* @__PURE__ */ ue(document.head); i !== null && (i.nodeType !== ke || /** @type {Comment} */
2195
- i.data !== e); )
2196
- i = /* @__PURE__ */ et(i);
2197
- if (i === null)
2194
+ for (var r = /* @__PURE__ */ ue(document.head); r !== null && (r.nodeType !== ke || /** @type {Comment} */
2195
+ r.data !== e); )
2196
+ r = /* @__PURE__ */ et(r);
2197
+ if (r === null)
2198
2198
  at(!1);
2199
2199
  else {
2200
2200
  var s = (
2201
2201
  /** @type {TemplateNode} */
2202
- /* @__PURE__ */ et(i)
2202
+ /* @__PURE__ */ et(r)
2203
2203
  );
2204
- i.remove(), B(s);
2204
+ r.remove(), B(s);
2205
2205
  }
2206
2206
  }
2207
- L || (r = document.head.appendChild(wt()));
2207
+ L || (i = document.head.appendChild(wt()));
2208
2208
  try {
2209
- Io(() => t(r), Zo);
2209
+ Io(() => t(i), Zo);
2210
2210
  } finally {
2211
2211
  n && (at(!0), B(
2212
2212
  /** @type {TemplateNode} */
@@ -2228,8 +2228,8 @@ function vs(e, t) {
2228
2228
  )
2229
2229
  );
2230
2230
  if (!n.querySelector("#" + t.hash)) {
2231
- const r = tn("style");
2232
- r.id = t.hash, r.textContent = t.code, n.appendChild(r);
2231
+ const i = tn("style");
2232
+ i.id = t.hash, i.textContent = t.code, n.appendChild(i);
2233
2233
  }
2234
2234
  });
2235
2235
  }
@@ -2237,17 +2237,17 @@ function gs(e, t) {
2237
2237
  return e == null ? null : String(e);
2238
2238
  }
2239
2239
  function Sn(e, t, o, n) {
2240
- var r = e.__style;
2241
- if (L || r !== t) {
2242
- var i = gs(t);
2243
- (!L || i !== e.getAttribute("style")) && (i == null ? e.removeAttribute("style") : e.style.cssText = i), e.__style = t;
2240
+ var i = e.__style;
2241
+ if (L || i !== t) {
2242
+ var r = gs(t);
2243
+ (!L || r !== e.getAttribute("style")) && (r == null ? e.removeAttribute("style") : e.style.cssText = r), e.__style = t;
2244
2244
  }
2245
2245
  return n;
2246
2246
  }
2247
2247
  const bs = /* @__PURE__ */ Symbol("is custom element"), ms = /* @__PURE__ */ Symbol("is html"), ys = hr ? "link" : "LINK";
2248
2248
  function kn(e, t, o, n) {
2249
- var r = ws(e);
2250
- L && (r[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ys) || r[t] !== (r[t] = o) && (t === "loading" && (e[fr] = o), o == null ? e.removeAttribute(t) : typeof o != "string" && Ts(e).includes(t) ? e[t] = o : e.setAttribute(t, o));
2249
+ var i = ws(e);
2250
+ L && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ys) || i[t] !== (i[t] = o) && (t === "loading" && (e[fr] = o), o == null ? e.removeAttribute(t) : typeof o != "string" && Ts(e).includes(t) ? e[t] = o : e.setAttribute(t, o));
2251
2251
  }
2252
2252
  function ws(e) {
2253
2253
  return (
@@ -2264,11 +2264,11 @@ function Ts(e) {
2264
2264
  var t = e.getAttribute("is") || e.nodeName, o = Cn.get(t);
2265
2265
  if (o) return o;
2266
2266
  Cn.set(t, o = []);
2267
- for (var n, r = e, i = Element.prototype; i !== r; ) {
2268
- n = ir(r);
2267
+ for (var n, i = e, r = Element.prototype; r !== i; ) {
2268
+ n = ir(i);
2269
2269
  for (var s in n)
2270
2270
  n[s].set && o.push(s);
2271
- r = jn(r);
2271
+ i = jn(i);
2272
2272
  }
2273
2273
  return o;
2274
2274
  }
@@ -2277,24 +2277,24 @@ function An(e, t) {
2277
2277
  }
2278
2278
  function Ln(e = {}, t, o, n) {
2279
2279
  return gi(() => {
2280
- var r, i;
2280
+ var i, r;
2281
2281
  return nn(() => {
2282
- r = i, i = [], Ai(() => {
2283
- e !== o(...i) && (t(e, ...i), r && An(o(...r), e) && t(null, ...r));
2282
+ i = r, r = [], Ai(() => {
2283
+ e !== o(...r) && (t(e, ...r), i && An(o(...i), e) && t(null, ...i));
2284
2284
  });
2285
2285
  }), () => {
2286
2286
  le(() => {
2287
- i && An(o(...i), e) && t(null, ...i);
2287
+ r && An(o(...r), e) && t(null, ...r);
2288
2288
  });
2289
2289
  };
2290
2290
  }), e;
2291
2291
  }
2292
2292
  function Eo(e, t, o, n) {
2293
- var r = (
2293
+ var i = (
2294
2294
  /** @type {V} */
2295
2295
  n
2296
- ), i = !0, s = () => (i && (i = !1, r = /** @type {V} */
2297
- n), r), l;
2296
+ ), r = !0, s = () => (r && (r = !1, i = /** @type {V} */
2297
+ n), i), l;
2298
2298
  l = /** @type {V} */
2299
2299
  e[t], l === void 0 && n !== void 0 && (l = s());
2300
2300
  var a;
@@ -2303,7 +2303,7 @@ function Eo(e, t, o, n) {
2303
2303
  /** @type {V} */
2304
2304
  e[t]
2305
2305
  );
2306
- return v === void 0 ? s() : (i = !0, v);
2306
+ return v === void 0 ? s() : (r = !0, v);
2307
2307
  };
2308
2308
  var c = !1, f = /* @__PURE__ */ $o(() => (c = !1, a())), p = (
2309
2309
  /** @type {Effect} */
@@ -2314,7 +2314,7 @@ function Eo(e, t, o, n) {
2314
2314
  (function(v, d) {
2315
2315
  if (arguments.length > 0) {
2316
2316
  const h = d ? b(f) : v;
2317
- return C(f, h), c = !0, r !== void 0 && (r = h), v;
2317
+ return C(f, h), c = !0, i !== void 0 && (i = h), v;
2318
2318
  }
2319
2319
  return Kt && c || (p.f & Vt) !== 0 ? f.v : b(f);
2320
2320
  })
@@ -2332,46 +2332,46 @@ class Is {
2332
2332
  */
2333
2333
  constructor(t) {
2334
2334
  x(this, Dt), x(this, rt);
2335
- var o = /* @__PURE__ */ new Map(), n = (i, s) => {
2335
+ var o = /* @__PURE__ */ new Map(), n = (r, s) => {
2336
2336
  var l = /* @__PURE__ */ li(s, !1, !1);
2337
- return o.set(i, l), l;
2337
+ return o.set(r, l), l;
2338
2338
  };
2339
- const r = new Proxy(
2339
+ const i = new Proxy(
2340
2340
  { ...t.props || {}, $$events: {} },
2341
2341
  {
2342
- get(i, s) {
2343
- return b(o.get(s) ?? n(s, Reflect.get(i, s)));
2342
+ get(r, s) {
2343
+ return b(o.get(s) ?? n(s, Reflect.get(r, s)));
2344
2344
  },
2345
- has(i, s) {
2346
- return s === ur ? !0 : (b(o.get(s) ?? n(s, Reflect.get(i, s))), Reflect.has(i, s));
2345
+ has(r, s) {
2346
+ return s === ur ? !0 : (b(o.get(s) ?? n(s, Reflect.get(r, s))), Reflect.has(r, s));
2347
2347
  },
2348
- set(i, s, l) {
2349
- return C(o.get(s) ?? n(s, l), l), Reflect.set(i, s, l);
2348
+ set(r, s, l) {
2349
+ return C(o.get(s) ?? n(s, l), l), Reflect.set(r, s, l);
2350
2350
  }
2351
2351
  }
2352
2352
  );
2353
2353
  T(this, rt, (t.hydrate ? ss : Ei)(t.component, {
2354
2354
  target: t.target,
2355
2355
  anchor: t.anchor,
2356
- props: r,
2356
+ props: i,
2357
2357
  context: t.context,
2358
2358
  intro: t.intro ?? !1,
2359
2359
  recover: t.recover
2360
- })), (!t?.props?.$$host || t.sync === !1) && no(), T(this, Dt, r.$$events);
2361
- for (const i of Object.keys(u(this, rt)))
2362
- i === "$set" || i === "$destroy" || i === "$on" || uo(this, i, {
2360
+ })), (!t?.props?.$$host || t.sync === !1) && no(), T(this, Dt, i.$$events);
2361
+ for (const r of Object.keys(u(this, rt)))
2362
+ r === "$set" || r === "$destroy" || r === "$on" || uo(this, r, {
2363
2363
  get() {
2364
- return u(this, rt)[i];
2364
+ return u(this, rt)[r];
2365
2365
  },
2366
2366
  /** @param {any} value */
2367
2367
  set(s) {
2368
- u(this, rt)[i] = s;
2368
+ u(this, rt)[r] = s;
2369
2369
  },
2370
2370
  enumerable: !0
2371
2371
  });
2372
2372
  u(this, rt).$set = /** @param {Record<string, any>} next */
2373
- (i) => {
2374
- Object.assign(r, i);
2373
+ (r) => {
2374
+ Object.assign(i, r);
2375
2375
  }, u(this, rt).$destroy = () => {
2376
2376
  ls(u(this, rt));
2377
2377
  };
@@ -2387,11 +2387,11 @@ class Is {
2387
2387
  */
2388
2388
  $on(t, o) {
2389
2389
  u(this, Dt)[t] = u(this, Dt)[t] || [];
2390
- const n = (...r) => o.call(this, ...r);
2390
+ const n = (...i) => o.call(this, ...i);
2391
2391
  return u(this, Dt)[t].push(n), () => {
2392
2392
  u(this, Dt)[t] = u(this, Dt)[t].filter(
2393
2393
  /** @param {any} fn */
2394
- (r) => r !== n
2394
+ (i) => i !== n
2395
2395
  );
2396
2396
  };
2397
2397
  }
@@ -2436,9 +2436,9 @@ typeof HTMLElement == "function" && (Oi = class extends HTMLElement {
2436
2436
  async connectedCallback() {
2437
2437
  if (this.$$cn = !0, !this.$$c) {
2438
2438
  let e = function(n) {
2439
- return (r) => {
2440
- const i = tn("slot");
2441
- n !== "default" && (i.name = n), Ct(r, i);
2439
+ return (i) => {
2440
+ const r = tn("slot");
2441
+ n !== "default" && (r.name = n), Ct(i, r);
2442
2442
  };
2443
2443
  };
2444
2444
  if (await Promise.resolve(), !this.$$cn || this.$$c)
@@ -2447,8 +2447,8 @@ typeof HTMLElement == "function" && (Oi = class extends HTMLElement {
2447
2447
  for (const n of this.$$s)
2448
2448
  n in o && (n === "default" && !this.$$d.children ? (this.$$d.children = e(n), t.default = !0) : t[n] = e(n));
2449
2449
  for (const n of this.attributes) {
2450
- const r = this.$$g_p(n.name);
2451
- r in this.$$d || (this.$$d[r] = ao(r, n.value, this.$$p_d, "toProp"));
2450
+ const i = this.$$g_p(n.name);
2451
+ i in this.$$d || (this.$$d[i] = ao(i, n.value, this.$$p_d, "toProp"));
2452
2452
  }
2453
2453
  for (const n in this.$$p_d)
2454
2454
  !(n in this.$$d) && this[n] !== void 0 && (this.$$d[n] = this[n], delete this[n]);
@@ -2466,21 +2466,21 @@ typeof HTMLElement == "function" && (Oi = class extends HTMLElement {
2466
2466
  for (const n of co(this.$$c)) {
2467
2467
  if (!this.$$p_d[n]?.reflect) continue;
2468
2468
  this.$$d[n] = this.$$c[n];
2469
- const r = ao(
2469
+ const i = ao(
2470
2470
  n,
2471
2471
  this.$$d[n],
2472
2472
  this.$$p_d,
2473
2473
  "toAttribute"
2474
2474
  );
2475
- r == null ? this.removeAttribute(this.$$p_d[n].attribute || n) : this.setAttribute(this.$$p_d[n].attribute || n, r);
2475
+ i == null ? this.removeAttribute(this.$$p_d[n].attribute || n) : this.setAttribute(this.$$p_d[n].attribute || n, i);
2476
2476
  }
2477
2477
  this.$$r = !1;
2478
2478
  });
2479
2479
  });
2480
2480
  for (const n in this.$$l)
2481
- for (const r of this.$$l[n]) {
2482
- const i = this.$$c.$on(n, r);
2483
- this.$$l_u.set(r, i);
2481
+ for (const i of this.$$l[n]) {
2482
+ const r = this.$$c.$on(n, i);
2483
+ this.$$l_u.set(i, r);
2484
2484
  }
2485
2485
  this.$$l = {};
2486
2486
  }
@@ -2510,11 +2510,11 @@ typeof HTMLElement == "function" && (Oi = class extends HTMLElement {
2510
2510
  }
2511
2511
  });
2512
2512
  function ao(e, t, o, n) {
2513
- const r = o[e]?.type;
2514
- if (t = r === "Boolean" && typeof t != "boolean" ? t != null : t, !n || !o[e])
2513
+ const i = o[e]?.type;
2514
+ if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !n || !o[e])
2515
2515
  return t;
2516
2516
  if (n === "toAttribute")
2517
- switch (r) {
2517
+ switch (i) {
2518
2518
  case "Object":
2519
2519
  case "Array":
2520
2520
  return t == null ? null : JSON.stringify(t);
@@ -2526,7 +2526,7 @@ function ao(e, t, o, n) {
2526
2526
  return t;
2527
2527
  }
2528
2528
  else
2529
- switch (r) {
2529
+ switch (i) {
2530
2530
  case "Object":
2531
2531
  case "Array":
2532
2532
  return t && JSON.parse(t);
@@ -2548,10 +2548,10 @@ function xs(e) {
2548
2548
  ] = !0;
2549
2549
  }), t;
2550
2550
  }
2551
- function _s(e, t, o, n, r, i) {
2551
+ function _s(e, t, o, n, i, r) {
2552
2552
  let s = class extends Oi {
2553
2553
  constructor() {
2554
- super(e, o, r), this.$$p_d = t;
2554
+ super(e, o, i), this.$$p_d = t;
2555
2555
  }
2556
2556
  static get observedAttributes() {
2557
2557
  return co(t).map(
@@ -2583,14 +2583,14 @@ function _s(e, t, o, n, r, i) {
2583
2583
  s, s;
2584
2584
  }
2585
2585
  class Ss extends Event {
2586
- constructor(t, o, n, r) {
2587
- super("context-request", { bubbles: !0, composed: !0 }), $(this, "context"), $(this, "contextTarget"), $(this, "callback"), $(this, "subscribe"), this.context = t, this.contextTarget = o, this.callback = n, this.subscribe = r ?? !1;
2586
+ constructor(t, o, n, i) {
2587
+ super("context-request", { bubbles: !0, composed: !0 }), $(this, "context"), $(this, "contextTarget"), $(this, "callback"), $(this, "subscribe"), this.context = t, this.contextTarget = o, this.callback = n, this.subscribe = i ?? !1;
2588
2588
  }
2589
2589
  }
2590
2590
  class ks {
2591
2591
  constructor(t, o) {
2592
- $(this, "host"), $(this, "context"), $(this, "subscribe"), $(this, "onValue"), $(this, "isConnected", !1), $(this, "unsubscribe"), $(this, "currentValue"), $(this, "handleValue", (n, r) => {
2593
- r !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = r), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = n, this.onValue?.(n);
2592
+ $(this, "host"), $(this, "context"), $(this, "subscribe"), $(this, "onValue"), $(this, "isConnected", !1), $(this, "unsubscribe"), $(this, "currentValue"), $(this, "handleValue", (n, i) => {
2593
+ i !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = i), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = n, this.onValue?.(n);
2594
2594
  }), this.host = t, this.context = o.context, this.subscribe = o.subscribe ?? !0, this.onValue = o.onValue;
2595
2595
  }
2596
2596
  connect() {
@@ -2609,28 +2609,28 @@ class ks {
2609
2609
  const Ri = (e) => e, Cs = Ri(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), As = Ri(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
2610
2610
  function Ni(e, t, o) {
2611
2611
  let n = !1;
2612
- const r = new ks(e, {
2612
+ const i = new ks(e, {
2613
2613
  context: t,
2614
2614
  subscribe: !0,
2615
2615
  onValue: (c) => {
2616
2616
  n = !0, o(c);
2617
2617
  }
2618
2618
  });
2619
- r.connect();
2620
- const i = (c) => {
2621
- c.context === t && r.requestValue();
2619
+ i.connect();
2620
+ const r = (c) => {
2621
+ c.context === t && i.requestValue();
2622
2622
  };
2623
- e.addEventListener("context-provider", i);
2623
+ e.addEventListener("context-provider", r);
2624
2624
  let s = 0;
2625
2625
  const l = 200, a = globalThis.setInterval(() => {
2626
2626
  if (n || s >= l) {
2627
2627
  globalThis.clearInterval(a);
2628
2628
  return;
2629
2629
  }
2630
- s += 1, r.requestValue();
2630
+ s += 1, i.requestValue();
2631
2631
  }, 50);
2632
2632
  return () => {
2633
- globalThis.clearInterval(a), e.removeEventListener("context-provider", i), r.disconnect();
2633
+ globalThis.clearInterval(a), e.removeEventListener("context-provider", r), i.disconnect();
2634
2634
  };
2635
2635
  }
2636
2636
  function Ls(e, t) {
@@ -2796,17 +2796,17 @@ class Os {
2796
2796
  */
2797
2797
  filterVisibleInContext(t, o) {
2798
2798
  const n = [];
2799
- for (const r of t) {
2800
- const i = this.get(r);
2801
- if (!i) {
2802
- console.warn(`Tool '${r}' is allowed but not registered`);
2799
+ for (const i of t) {
2800
+ const r = this.get(i);
2801
+ if (!r) {
2802
+ console.warn(`Tool '${i}' is allowed but not registered`);
2803
2803
  continue;
2804
2804
  }
2805
- if (i.supportedLevels.includes(o.level))
2805
+ if (r.supportedLevels.includes(o.level))
2806
2806
  try {
2807
- i.isVisibleInContext(o) && n.push(i);
2807
+ r.isVisibleInContext(o) && n.push(r);
2808
2808
  } catch (s) {
2809
- console.error(`Error evaluating visibility for tool '${r}':`, s);
2809
+ console.error(`Error evaluating visibility for tool '${i}':`, s);
2810
2810
  }
2811
2811
  }
2812
2812
  return n;
@@ -2838,10 +2838,10 @@ class Os {
2838
2838
  generatePNPSupportsFromTools(t) {
2839
2839
  const o = /* @__PURE__ */ new Set();
2840
2840
  for (const n of t) {
2841
- const r = this.get(n);
2842
- if (r?.pnpSupportIds)
2843
- for (const i of r.pnpSupportIds)
2844
- o.add(i);
2841
+ const i = this.get(n);
2842
+ if (i?.pnpSupportIds)
2843
+ for (const r of i.pnpSupportIds)
2844
+ o.add(r);
2845
2845
  }
2846
2846
  return Array.from(o);
2847
2847
  }
@@ -2880,12 +2880,12 @@ class Os {
2880
2880
  const n = this.moduleLoaders.get(t);
2881
2881
  if (!n)
2882
2882
  return;
2883
- const r = (async () => {
2883
+ const i = (async () => {
2884
2884
  await n(), this.loadedToolModules.add(t);
2885
2885
  })();
2886
- this.moduleLoadPromises.set(t, r);
2886
+ this.moduleLoadPromises.set(t, i);
2887
2887
  try {
2888
- await r;
2888
+ await i;
2889
2889
  } finally {
2890
2890
  this.moduleLoadPromises.delete(t);
2891
2891
  }
@@ -2906,17 +2906,17 @@ class Os {
2906
2906
  * Render a tool for toolbar use with component overrides attached.
2907
2907
  */
2908
2908
  renderForToolbar(t, o, n) {
2909
- const r = this.get(t);
2910
- if (!r)
2909
+ const i = this.get(t);
2910
+ if (!i)
2911
2911
  throw new Error(`Tool '${t}' is not registered`);
2912
- const i = {
2912
+ const r = {
2913
2913
  ...n,
2914
2914
  componentOverrides: {
2915
2915
  ...this.componentOverrides || {},
2916
2916
  ...n.componentOverrides || {}
2917
2917
  }
2918
2918
  };
2919
- return r.renderToolbar(o, i);
2919
+ return i.renderToolbar(o, r);
2920
2920
  }
2921
2921
  }
2922
2922
  function ji(e) {
@@ -2936,9 +2936,9 @@ function ln(e) {
2936
2936
  const t = e.item.config;
2937
2937
  if (!t)
2938
2938
  return "";
2939
- const o = [], n = (l) => l.replace(/<[^>]*>/g, " ").trim(), r = t.elements?.[e.elementId];
2940
- r && typeof r == "string" && o.push(n(r));
2941
- const i = t.models, s = (Array.isArray(i) ? i : i && typeof i == "object" ? Object.values(i) : []).find((l) => l && typeof l == "object" && l.id === e.elementId);
2939
+ const o = [], n = (l) => l.replace(/<[^>]*>/g, " ").trim(), i = t.elements?.[e.elementId];
2940
+ i && typeof i == "string" && o.push(n(i));
2941
+ const r = t.models, s = (Array.isArray(r) ? r : r && typeof r == "object" ? Object.values(r) : []).find((l) => l && typeof l == "object" && l.id === e.elementId);
2942
2942
  if (s) {
2943
2943
  for (const l of Object.values(s))
2944
2944
  if (typeof l == "string" && o.push(n(l)), Array.isArray(l)) {
@@ -2954,21 +2954,21 @@ function ln(e) {
2954
2954
  const t = e.item;
2955
2955
  if (!t?.config)
2956
2956
  return "";
2957
- const o = t.config, n = [], r = (a) => a.replace(/<[^>]*>/g, " ").trim();
2958
- typeof o.markup == "string" && n.push(r(o.markup));
2959
- const i = o.elements;
2960
- if (i && typeof i == "object")
2961
- for (const a of Object.values(i))
2962
- typeof a == "string" && n.push(r(a));
2957
+ const o = t.config, n = [], i = (a) => a.replace(/<[^>]*>/g, " ").trim();
2958
+ typeof o.markup == "string" && n.push(i(o.markup));
2959
+ const r = o.elements;
2960
+ if (r && typeof r == "object")
2961
+ for (const a of Object.values(r))
2962
+ typeof a == "string" && n.push(i(a));
2963
2963
  const s = o.models, l = Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : [];
2964
2964
  for (const a of l)
2965
2965
  if (!(!a || typeof a != "object")) {
2966
2966
  for (const c of Object.values(a))
2967
- if (typeof c == "string" && n.push(r(c)), Array.isArray(c)) {
2967
+ if (typeof c == "string" && n.push(i(c)), Array.isArray(c)) {
2968
2968
  for (const f of c)
2969
2969
  if (f && typeof f == "object")
2970
2970
  for (const p of Object.values(f))
2971
- typeof p == "string" && n.push(r(p));
2971
+ typeof p == "string" && n.push(i(p));
2972
2972
  }
2973
2973
  }
2974
2974
  return n.filter(Boolean).join(" ").trim();
@@ -2977,21 +2977,21 @@ function ln(e) {
2977
2977
  const t = e.passage;
2978
2978
  if (!t?.config)
2979
2979
  return "";
2980
- const o = t.config, n = [], r = (a) => a.replace(/<[^>]*>/g, " ").trim();
2981
- typeof o.markup == "string" && n.push(r(o.markup)), typeof o.content == "string" && n.push(r(o.content)), typeof o.prompt == "string" && n.push(r(o.prompt));
2982
- const i = o.elements;
2983
- if (i && typeof i == "object")
2984
- for (const a of Object.values(i))
2985
- typeof a == "string" && n.push(r(a));
2980
+ const o = t.config, n = [], i = (a) => a.replace(/<[^>]*>/g, " ").trim();
2981
+ typeof o.markup == "string" && n.push(i(o.markup)), typeof o.content == "string" && n.push(i(o.content)), typeof o.prompt == "string" && n.push(i(o.prompt));
2982
+ const r = o.elements;
2983
+ if (r && typeof r == "object")
2984
+ for (const a of Object.values(r))
2985
+ typeof a == "string" && n.push(i(a));
2986
2986
  const s = o.models, l = Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : [];
2987
2987
  for (const a of l)
2988
2988
  if (!(!a || typeof a != "object")) {
2989
2989
  for (const c of Object.values(a))
2990
- if (typeof c == "string" && n.push(r(c)), Array.isArray(c)) {
2990
+ if (typeof c == "string" && n.push(i(c)), Array.isArray(c)) {
2991
2991
  for (const f of c)
2992
2992
  if (f && typeof f == "object")
2993
2993
  for (const p of Object.values(f))
2994
- typeof p == "string" && n.push(r(p));
2994
+ typeof p == "string" && n.push(i(p));
2995
2995
  }
2996
2996
  }
2997
2997
  return n.filter(Boolean).join(" ").trim();
@@ -3032,19 +3032,19 @@ function js(e) {
3032
3032
  const o = e.item.config;
3033
3033
  if (!o?.models)
3034
3034
  return !1;
3035
- const n = (Array.isArray(o.models) ? o.models : Object.values(o.models)).find((i) => i && typeof i == "object" && i.id === e.elementId);
3035
+ const n = (Array.isArray(o.models) ? o.models : Object.values(o.models)).find((r) => r && typeof r == "object" && r.id === e.elementId);
3036
3036
  if (!n)
3037
3037
  return !1;
3038
- const r = n.element || "";
3039
- return t.includes(r);
3038
+ const i = n.element || "";
3039
+ return t.includes(i);
3040
3040
  }
3041
3041
  if (ji(e)) {
3042
3042
  const o = e.item.config?.models;
3043
3043
  return (Array.isArray(o) ? o : o && typeof o == "object" ? Object.values(o) : []).some((n) => {
3044
3044
  if (!n || typeof n != "object")
3045
3045
  return !1;
3046
- const r = n.element || "";
3047
- return t.includes(r) ? !0 : Array.isArray(n.choices) && n.choices.length > 0;
3046
+ const i = n.element || "";
3047
+ return t.includes(i) ? !0 : Array.isArray(n.choices) && n.choices.length > 0;
3048
3048
  });
3049
3049
  }
3050
3050
  return !1;
@@ -3076,12 +3076,12 @@ function Ds(e) {
3076
3076
  return Ws.has(e);
3077
3077
  }
3078
3078
  function pt(e, t, o) {
3079
- const n = e.trim(), r = o.trim();
3080
- if (!n || !r)
3079
+ const n = e.trim(), i = o.trim();
3080
+ if (!n || !i)
3081
3081
  throw new Error("Tool instance ids require non-empty tool and scope ids");
3082
3082
  if (!Ds(t))
3083
3083
  throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
3084
- return `${n}:${t}:${r}`;
3084
+ return `${n}:${t}:${i}`;
3085
3085
  }
3086
3086
  const Hs = /* @__PURE__ */ new Set([
3087
3087
  "annotation-xml",
@@ -3124,8 +3124,8 @@ const Hs = /* @__PURE__ */ new Set([
3124
3124
  const o = t?.toolTagMap?.[e] ?? qi[e] ?? e;
3125
3125
  return zs(o, `tool component tag for "${e}"`);
3126
3126
  }, Fs = (e) => document.createElement(e), It = (e, t, o, n) => {
3127
- const r = Gs(e, n), i = n?.toolComponentFactories?.[e] ?? n?.toolComponentFactory;
3128
- return i ? i({ toolId: e, tagName: r, context: t, toolbarContext: o }) : Fs(r);
3127
+ const i = Gs(e, n), r = n?.toolComponentFactories?.[e] ?? n?.toolComponentFactory;
3128
+ return r ? r({ toolId: e, tagName: i, context: t, toolbarContext: o }) : Fs(i);
3129
3129
  }, Us = {
3130
3130
  toolId: "calculator",
3131
3131
  name: "Calculator",
@@ -3155,9 +3155,9 @@ const Hs = /* @__PURE__ */ new Set([
3155
3155
  return xo(e);
3156
3156
  },
3157
3157
  renderToolbar(e, t) {
3158
- const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = t.componentOverrides, r = It(this.toolId, e, t, n);
3159
- r.setAttribute("tool-id", o);
3160
- const i = {
3158
+ const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = t.componentOverrides, i = It(this.toolId, e, t, n);
3159
+ i.setAttribute("tool-id", o);
3160
+ const r = {
3161
3161
  toolId: this.toolId,
3162
3162
  label: this.name,
3163
3163
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -3169,11 +3169,11 @@ const Hs = /* @__PURE__ */ new Set([
3169
3169
  };
3170
3170
  return {
3171
3171
  toolId: this.toolId,
3172
- elements: [{ element: r, mount: "after-buttons" }],
3173
- button: i,
3172
+ elements: [{ element: i, mount: "after-buttons" }],
3173
+ button: r,
3174
3174
  sync: () => {
3175
3175
  const s = t.isToolVisible(o);
3176
- i.active = s, i.ariaLabel = s ? "Close scientific calculator" : "Open scientific calculator", i.tooltip = s ? "Close calculator" : "Calculator", r.visible = s;
3176
+ r.active = s, r.ariaLabel = s ? "Close scientific calculator" : "Open scientific calculator", r.tooltip = s ? "Close calculator" : "Calculator", i.visible = s;
3177
3177
  },
3178
3178
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3179
3179
  s(t.isToolVisible(o));
@@ -3211,7 +3211,7 @@ const Hs = /* @__PURE__ */ new Set([
3211
3211
  },
3212
3212
  renderToolbar(e, t) {
3213
3213
  let o = null;
3214
- const n = t.ttsService, r = pt(this.toolId, t.scope.level, t.scope.scopeId), i = () => t.isToolVisible(r), s = {
3214
+ const n = t.ttsService, i = pt(this.toolId, t.scope.level, t.scope.scopeId), r = () => t.isToolVisible(i), s = {
3215
3215
  toolId: this.toolId,
3216
3216
  label: "Read aloud",
3217
3217
  icon: typeof this.icon == "function" ? this.icon(e) : this.icon,
@@ -3223,16 +3223,16 @@ const Hs = /* @__PURE__ */ new Set([
3223
3223
  disabled: !1,
3224
3224
  active: !1
3225
3225
  }, l = () => {
3226
- const d = i() ? "Stop reading" : "Read aloud";
3227
- s.label = d, s.ariaLabel = d, s.tooltip = d, s.active = i(), s.disabled = !t.ttsService;
3226
+ const d = r() ? "Stop reading" : "Read aloud";
3227
+ s.label = d, s.ariaLabel = d, s.tooltip = d, s.active = r(), s.disabled = !t.ttsService;
3228
3228
  }, a = (d) => {
3229
- (d === "idle" || d === "error") && i() && (t.toggleTool(this.toolId), l());
3229
+ (d === "idle" || d === "error") && r() && (t.toggleTool(this.toolId), l());
3230
3230
  }, c = async () => {
3231
3231
  t.ensureTTSReady && (o || (o = (async () => {
3232
3232
  await t.ensureTTSReady?.(), t.toolkitCoordinator?.highlightCoordinator && n?.setHighlightCoordinator?.(t.toolkitCoordinator.highlightCoordinator);
3233
3233
  })()), await o);
3234
3234
  }, f = () => {
3235
- n?.stop?.(), i() && t.toggleTool(this.toolId), l();
3235
+ n?.stop?.(), r() && t.toggleTool(this.toolId), l();
3236
3236
  }, p = () => {
3237
3237
  const d = t.getScopeElement?.();
3238
3238
  if (d)
@@ -3256,7 +3256,7 @@ const Hs = /* @__PURE__ */ new Set([
3256
3256
  }, v = async () => {
3257
3257
  if (!n?.speak || !t.ttsService)
3258
3258
  return;
3259
- if (i()) {
3259
+ if (r()) {
3260
3260
  f();
3261
3261
  return;
3262
3262
  }
@@ -3266,7 +3266,7 @@ const Hs = /* @__PURE__ */ new Set([
3266
3266
  const h = d.textContent || "";
3267
3267
  if (h.trim())
3268
3268
  try {
3269
- i() || t.toggleTool(this.toolId), l(), await c(), n.setRootElement?.(d), n.speak(h, {
3269
+ r() || t.toggleTool(this.toolId), l(), await c(), n.setRootElement?.(d), n.speak(h, {
3270
3270
  // For passage-level TTS, use rendered DOM text as the source of truth.
3271
3271
  // Catalog/SSML content can diverge from rendered text and break
3272
3272
  // word-boundary-to-DOM mapping for progressive yellow highlighting.
@@ -3292,15 +3292,15 @@ const Hs = /* @__PURE__ */ new Set([
3292
3292
  const h = [];
3293
3293
  if (t.subscribeVisibility) {
3294
3294
  const m = t.subscribeVisibility(() => {
3295
- const y = i();
3295
+ const y = r();
3296
3296
  l(), d(y);
3297
3297
  });
3298
3298
  h.push(m);
3299
3299
  }
3300
3300
  if (t.ttsService) {
3301
- const m = `tts-toolbar:${r}`, y = (k) => {
3301
+ const m = `tts-toolbar:${i}`, y = (k) => {
3302
3302
  a(String(k || ""));
3303
- const I = i();
3303
+ const I = r();
3304
3304
  l(), d(I);
3305
3305
  };
3306
3306
  t.ttsService.onStateChange(m, y), h.push(() => {
@@ -3346,14 +3346,14 @@ const Hs = /* @__PURE__ */ new Set([
3346
3346
  tooltip: "Ruler",
3347
3347
  onClick: () => t.toggleTool(this.toolId),
3348
3348
  active: t.isToolVisible(o)
3349
- }, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
3350
- return i.setAttribute("tool-id", o), {
3349
+ }, i = t.componentOverrides ?? {}, r = It(this.toolId, e, t, i);
3350
+ return r.setAttribute("tool-id", o), {
3351
3351
  toolId: this.toolId,
3352
3352
  button: n,
3353
- elements: [{ element: i, mount: "after-buttons" }],
3353
+ elements: [{ element: r, mount: "after-buttons" }],
3354
3354
  sync: () => {
3355
3355
  const s = t.isToolVisible(o);
3356
- n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
3356
+ n.active = s, r.visible = s, t.toolkitCoordinator && (r.toolkitCoordinator = t.toolkitCoordinator);
3357
3357
  },
3358
3358
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3359
3359
  s(t.isToolVisible(o));
@@ -3392,14 +3392,14 @@ const Hs = /* @__PURE__ */ new Set([
3392
3392
  tooltip: "Protractor",
3393
3393
  onClick: () => t.toggleTool(this.toolId),
3394
3394
  active: t.isToolVisible(o)
3395
- }, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
3396
- return i.setAttribute("tool-id", o), {
3395
+ }, i = t.componentOverrides ?? {}, r = It(this.toolId, e, t, i);
3396
+ return r.setAttribute("tool-id", o), {
3397
3397
  toolId: this.toolId,
3398
3398
  button: n,
3399
- elements: [{ element: i, mount: "after-buttons" }],
3399
+ elements: [{ element: r, mount: "after-buttons" }],
3400
3400
  sync: () => {
3401
3401
  const s = t.isToolVisible(o);
3402
- n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
3402
+ n.active = s, r.visible = s, t.toolkitCoordinator && (r.toolkitCoordinator = t.toolkitCoordinator);
3403
3403
  },
3404
3404
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3405
3405
  s(t.isToolVisible(o));
@@ -3433,9 +3433,9 @@ const Hs = /* @__PURE__ */ new Set([
3433
3433
  return js(e);
3434
3434
  },
3435
3435
  renderToolbar(e, t) {
3436
- const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = t.componentOverrides ?? {}, r = It(this.toolId, e, t, n);
3437
- r.setAttribute("tool-id", o), r.setAttribute("strategy", "strikethrough"), r.setAttribute("button-alignment", "inline");
3438
- const i = {
3436
+ const o = pt(this.toolId, t.scope.level, t.scope.scopeId), n = t.componentOverrides ?? {}, i = It(this.toolId, e, t, n);
3437
+ i.setAttribute("tool-id", o), i.setAttribute("strategy", "strikethrough"), i.setAttribute("button-alignment", "inline");
3438
+ const r = {
3439
3439
  toolId: this.toolId,
3440
3440
  label: this.name,
3441
3441
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true"><path d="M19,3H16.3H7.7H5A2,2 0 0,0 3,5V7.7V16.4V19A2,2 0 0,0 5,21H7.7H16.4H19A2,2 0 0,0 21,19V16.3V7.7V5A2,2 0 0,0 19,3M15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4L13.4,12L17,15.6L15.6,17Z"/></svg>',
@@ -3447,13 +3447,13 @@ const Hs = /* @__PURE__ */ new Set([
3447
3447
  };
3448
3448
  return {
3449
3449
  toolId: this.toolId,
3450
- button: i,
3451
- elements: [{ element: r, mount: "after-buttons" }],
3450
+ button: r,
3451
+ elements: [{ element: i, mount: "after-buttons" }],
3452
3452
  sync: () => {
3453
3453
  const s = t.isToolVisible(o);
3454
- i.active = s, r.visible = s, t.toolCoordinator && (r.coordinator = t.toolCoordinator), r.scopeElement = t.getScopeElement?.() || null, t.elementToolStateStore && (r.elementToolStateStore = t.elementToolStateStore);
3454
+ r.active = s, i.visible = s, t.toolCoordinator && (i.coordinator = t.toolCoordinator), i.scopeElement = t.getScopeElement?.() || null, t.elementToolStateStore && (i.elementToolStateStore = t.elementToolStateStore);
3455
3455
  const l = t.getGlobalElementId?.();
3456
- l && (r.globalElementId = l);
3456
+ l && (i.globalElementId = l);
3457
3457
  },
3458
3458
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3459
3459
  s(t.isToolVisible(o));
@@ -3487,14 +3487,14 @@ const Hs = /* @__PURE__ */ new Set([
3487
3487
  tooltip: "Highlight",
3488
3488
  onClick: () => t.toggleTool(this.toolId),
3489
3489
  active: t.isToolVisible(o)
3490
- }, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
3491
- return i.setAttribute("tool-id", o), {
3490
+ }, i = t.componentOverrides ?? {}, r = It(this.toolId, e, t, i);
3491
+ return r.setAttribute("tool-id", o), {
3492
3492
  toolId: this.toolId,
3493
3493
  button: n,
3494
- elements: [{ element: i, mount: "after-buttons" }],
3494
+ elements: [{ element: r, mount: "after-buttons" }],
3495
3495
  sync: () => {
3496
3496
  const s = t.isToolVisible(o);
3497
- n.active = s, i.enabled = s, i.visible = s, t.ttsService && (i.ttsService = t.ttsService);
3497
+ n.active = s, r.enabled = s, r.visible = s, t.ttsService && (r.ttsService = t.ttsService);
3498
3498
  },
3499
3499
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3500
3500
  s(t.isToolVisible(o));
@@ -3539,14 +3539,14 @@ const Hs = /* @__PURE__ */ new Set([
3539
3539
  tooltip: "Line Reader",
3540
3540
  onClick: () => t.toggleTool(this.toolId),
3541
3541
  active: t.isToolVisible(o)
3542
- }, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
3543
- return i.setAttribute("tool-id", o), {
3542
+ }, i = t.componentOverrides ?? {}, r = It(this.toolId, e, t, i);
3543
+ return r.setAttribute("tool-id", o), {
3544
3544
  toolId: this.toolId,
3545
3545
  button: n,
3546
- elements: [{ element: i, mount: "after-buttons" }],
3546
+ elements: [{ element: r, mount: "after-buttons" }],
3547
3547
  sync: () => {
3548
3548
  const s = t.isToolVisible(o);
3549
- n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
3549
+ n.active = s, r.visible = s, t.toolkitCoordinator && (r.toolkitCoordinator = t.toolkitCoordinator);
3550
3550
  },
3551
3551
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3552
3552
  s(t.isToolVisible(o));
@@ -3595,14 +3595,14 @@ const Hs = /* @__PURE__ */ new Set([
3595
3595
  tooltip: "Theme",
3596
3596
  onClick: () => t.toggleTool(this.toolId),
3597
3597
  active: t.isToolVisible(o)
3598
- }, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
3599
- return i.setAttribute("tool-id", o), {
3598
+ }, i = t.componentOverrides ?? {}, r = It(this.toolId, e, t, i);
3599
+ return r.setAttribute("tool-id", o), {
3600
3600
  toolId: this.toolId,
3601
3601
  button: n,
3602
- elements: [{ element: i, mount: "after-buttons" }],
3602
+ elements: [{ element: r, mount: "after-buttons" }],
3603
3603
  sync: () => {
3604
3604
  const s = t.isToolVisible(o);
3605
- n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
3605
+ n.active = s, r.visible = s, t.toolkitCoordinator && (r.toolkitCoordinator = t.toolkitCoordinator);
3606
3606
  },
3607
3607
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3608
3608
  s(t.isToolVisible(o));
@@ -3649,14 +3649,14 @@ const Hs = /* @__PURE__ */ new Set([
3649
3649
  tooltip: "Highlight",
3650
3650
  onClick: () => t.toggleTool(this.toolId),
3651
3651
  active: t.isToolVisible(o)
3652
- }, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
3653
- return i.setAttribute("tool-id", o), {
3652
+ }, i = t.componentOverrides ?? {}, r = It(this.toolId, e, t, i);
3653
+ return r.setAttribute("tool-id", o), {
3654
3654
  toolId: this.toolId,
3655
3655
  button: n,
3656
- elements: [{ element: i, mount: "after-buttons" }],
3656
+ elements: [{ element: r, mount: "after-buttons" }],
3657
3657
  sync: () => {
3658
3658
  const s = t.isToolVisible(o);
3659
- n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
3659
+ n.active = s, r.visible = s, t.toolkitCoordinator && (r.toolkitCoordinator = t.toolkitCoordinator);
3660
3660
  },
3661
3661
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3662
3662
  s(t.isToolVisible(o));
@@ -3699,14 +3699,14 @@ const Hs = /* @__PURE__ */ new Set([
3699
3699
  tooltip: "Graph",
3700
3700
  onClick: () => t.toggleTool(this.toolId),
3701
3701
  active: t.isToolVisible(o)
3702
- }, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
3703
- return i.setAttribute("tool-id", o), {
3702
+ }, i = t.componentOverrides ?? {}, r = It(this.toolId, e, t, i);
3703
+ return r.setAttribute("tool-id", o), {
3704
3704
  toolId: this.toolId,
3705
3705
  button: n,
3706
- elements: [{ element: i, mount: "after-buttons" }],
3706
+ elements: [{ element: r, mount: "after-buttons" }],
3707
3707
  sync: () => {
3708
3708
  const s = t.isToolVisible(o);
3709
- n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
3709
+ n.active = s, r.visible = s, t.toolkitCoordinator && (r.toolkitCoordinator = t.toolkitCoordinator);
3710
3710
  },
3711
3711
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3712
3712
  s(t.isToolVisible(o));
@@ -3747,14 +3747,14 @@ const Hs = /* @__PURE__ */ new Set([
3747
3747
  tooltip: "Periodic Table",
3748
3748
  onClick: () => t.toggleTool(this.toolId),
3749
3749
  active: t.isToolVisible(o)
3750
- }, r = t.componentOverrides ?? {}, i = It(this.toolId, e, t, r);
3751
- return i.setAttribute("tool-id", o), {
3750
+ }, i = t.componentOverrides ?? {}, r = It(this.toolId, e, t, i);
3751
+ return r.setAttribute("tool-id", o), {
3752
3752
  toolId: this.toolId,
3753
3753
  button: n,
3754
- elements: [{ element: i, mount: "after-buttons" }],
3754
+ elements: [{ element: r, mount: "after-buttons" }],
3755
3755
  sync: () => {
3756
3756
  const s = t.isToolVisible(o);
3757
- n.active = s, i.visible = s, t.toolkitCoordinator && (i.toolkitCoordinator = t.toolkitCoordinator);
3757
+ n.active = s, r.visible = s, t.toolkitCoordinator && (r.toolkitCoordinator = t.toolkitCoordinator);
3758
3758
  },
3759
3759
  subscribeActive: (s) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3760
3760
  s(t.isToolVisible(o));
@@ -3762,8 +3762,20 @@ const Hs = /* @__PURE__ */ new Set([
3762
3762
  }
3763
3763
  };
3764
3764
  }
3765
- };
3766
- function rl(e = {}) {
3765
+ }, rl = [
3766
+ Us,
3767
+ Ks,
3768
+ Js,
3769
+ Zs,
3770
+ Xs,
3771
+ Ys,
3772
+ Qs,
3773
+ el,
3774
+ ol,
3775
+ nl,
3776
+ il
3777
+ ];
3778
+ function sl(e = {}) {
3767
3779
  const t = new Os(), o = {
3768
3780
  toolTagMap: {
3769
3781
  ...qi,
@@ -3771,18 +3783,26 @@ function rl(e = {}) {
3771
3783
  },
3772
3784
  toolComponentFactory: e.toolComponentFactory,
3773
3785
  toolComponentFactories: e.toolComponentFactories
3774
- }, n = (r) => e.overrides?.[r.toolId] || r;
3775
- return t.register(n(Us)), t.register(n(Ks)), t.register(n(Js)), t.register(n(Zs)), t.register(n(Xs)), t.register(n(Ys)), t.register(n(Qs)), t.register(n(el)), t.register(n(ol)), t.register(n(nl)), t.register(n(il)), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(o), t;
3776
- }
3777
- function sl() {
3778
- const e = rl(), t = /* @__PURE__ */ new Set();
3786
+ }, n = (i) => e.overrides?.[i.toolId] || i;
3787
+ return e.includePackagedTools && ll(t, {
3788
+ toolIds: e.toolIds,
3789
+ applyOverrides: n
3790
+ }), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(o), t;
3791
+ }
3792
+ function ll(e, t = {}) {
3793
+ const o = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, n = t.applyOverrides || ((i) => i);
3794
+ for (const i of rl)
3795
+ o && !o.has(i.toolId) || e.register(n(i));
3796
+ }
3797
+ function al() {
3798
+ const e = sl(), t = /* @__PURE__ */ new Set();
3779
3799
  for (const o of e.getAllTools())
3780
3800
  for (const n of o.pnpSupportIds || [])
3781
3801
  t.add(n);
3782
3802
  return [...t].sort();
3783
3803
  }
3784
- sl();
3785
- const ll = {
3804
+ al();
3805
+ const cl = {
3786
3806
  /**
3787
3807
  * Visual accessibility features
3788
3808
  * For students with low vision, color blindness, or visual processing needs
@@ -3953,7 +3973,7 @@ const ll = {
3953
3973
  tutorialAvailable: "tutorialAvailable"
3954
3974
  }
3955
3975
  };
3956
- Object.values(ll).flatMap((e) => Object.values(e));
3976
+ Object.values(cl).flatMap((e) => Object.values(e));
3957
3977
  var Vn;
3958
3978
  (function(e) {
3959
3979
  e[e.BASE = 0] = "BASE", e[e.TOOL = 1e3] = "TOOL", e[e.MODAL = 2e3] = "MODAL", e[e.CONTROL = 3e3] = "CONTROL", e[e.HIGHLIGHT = 4e3] = "HIGHLIGHT";
@@ -3962,8 +3982,8 @@ var Mn;
3962
3982
  (function(e) {
3963
3983
  e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
3964
3984
  })(Mn || (Mn = {}));
3965
- var al = /* @__PURE__ */ Zt('<link rel="stylesheet" href="./highlights.css"/>'), cl = /* @__PURE__ */ Zt('<button class="pie-tool-annotation-toolbar__highlight-swatch svelte-g8qu62"><span class="pie-sr-only svelte-g8qu62"> </span></button>'), ul = /* @__PURE__ */ Zt('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Read selected text aloud" title="Read Aloud"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"></path></svg></button>', 1), fl = /* @__PURE__ */ Zt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--warning svelte-g8qu62" aria-label="Remove this annotation" title="Remove"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg></button>'), hl = /* @__PURE__ */ Zt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--danger svelte-g8qu62" aria-label="Clear all annotations from document" title="Clear All">Clear All</button>'), dl = /* @__PURE__ */ Zt('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <!> <!>', 1), pl = /* @__PURE__ */ Zt('<div class="pie-tool-annotation-toolbar notranslate svelte-g8qu62" role="toolbar" aria-label="Text annotation toolbar" translate="no"><!> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Underline selected text" title="Underline"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z"></path></svg></button> <!> <!></div>'), vl = /* @__PURE__ */ Zt('<div style="display: none;" aria-hidden="true"></div> <!> <div role="status" aria-live="polite" aria-atomic="true" class="pie-sr-only svelte-g8qu62"> </div>', 1);
3966
- const gl = {
3985
+ var ul = /* @__PURE__ */ Zt('<link rel="stylesheet" href="./highlights.css"/>'), fl = /* @__PURE__ */ Zt('<button class="pie-tool-annotation-toolbar__highlight-swatch svelte-g8qu62"><span class="pie-sr-only svelte-g8qu62"> </span></button>'), hl = /* @__PURE__ */ Zt('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Read selected text aloud" title="Read Aloud"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"></path></svg></button>', 1), dl = /* @__PURE__ */ Zt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--warning svelte-g8qu62" aria-label="Remove this annotation" title="Remove"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg></button>'), pl = /* @__PURE__ */ Zt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--danger svelte-g8qu62" aria-label="Clear all annotations from document" title="Clear All">Clear All</button>'), vl = /* @__PURE__ */ Zt('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <!> <!>', 1), gl = /* @__PURE__ */ Zt('<div class="pie-tool-annotation-toolbar notranslate svelte-g8qu62" role="toolbar" aria-label="Text annotation toolbar" translate="no"><!> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Underline selected text" title="Underline"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z"></path></svg></button> <!> <!></div>'), bl = /* @__PURE__ */ Zt('<div style="display: none;" aria-hidden="true"></div> <!> <div role="status" aria-live="polite" aria-atomic="true" class="pie-sr-only svelte-g8qu62"> </div>', 1);
3986
+ const ml = {
3967
3987
  hash: "svelte-g8qu62",
3968
3988
  code: `.pie-tool-annotation-toolbar.svelte-g8qu62 {position:fixed;z-index:4200;display:flex;gap:0.25rem;padding:0.5rem;border-radius:0.5rem;background:var(--pie-background, #fff);color:var(--pie-text, #111827);border:1px solid var(--pie-border, #d1d5db);box-shadow:0 10px 25px -8px rgb(0 0 0 / 0.3);user-select:none;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62 {width:2.5rem;height:2rem;border:2px solid color-mix(in srgb, var(--pie-border-dark, #111827) 20%, transparent);border-radius:0.375rem;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;padding:0;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62:hover {transform:scale(1.1);border-color:color-mix(in srgb, var(--pie-border-dark, #111827) 45%, transparent);box-shadow:0 2px 8px rgb(0 0 0 / 0.15);}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar.svelte-g8qu62 .divider-horizontal:where(.svelte-g8qu62) {height:auto;width:1px;background-color:color-mix(in srgb, var(--pie-border, #d1d5db) 70%, transparent);}
3969
3989
 
@@ -3971,10 +3991,10 @@ const gl = {
3971
3991
 
3972
3992
  /* Button styling */.pie-tool-annotation-toolbar__button.svelte-g8qu62 {display:inline-flex;align-items:center;justify-content:center;gap:0.35rem;padding:0.4rem 0.55rem;border:1px solid var(--pie-button-border, #d1d5db);border-radius:0.4rem;background:var(--pie-button-bg, #fff);color:var(--pie-button-color, var(--pie-text, #111827));cursor:pointer;}.pie-tool-annotation-toolbar__button--icon.svelte-g8qu62 {min-width:2rem;min-height:2rem;padding:0.45rem;}.pie-tool-annotation-toolbar__button.svelte-g8qu62:hover {background:var(--pie-button-hover-bg, #f9fafb);color:var(--pie-button-hover-color, var(--pie-text, #111827));border-color:var(--pie-button-hover-border, #9ca3af);}.pie-tool-annotation-toolbar__button.svelte-g8qu62:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar__button.svelte-g8qu62:disabled {opacity:0.6;cursor:not-allowed;}.pie-tool-annotation-toolbar__button--warning.svelte-g8qu62 {color:var(--pie-missing-icon, #92400e);}.pie-tool-annotation-toolbar__button--danger.svelte-g8qu62 {color:var(--pie-incorrect-icon, #b91c1c);}.pie-tool-annotation-toolbar__button.svelte-g8qu62 svg:where(.svelte-g8qu62) {width:18px;height:18px;}`
3973
3993
  };
3974
- function bl(e, t) {
3975
- Bn(t, !0), vs(e, gl);
3976
- let o = Eo(t, "enabled", 7, !0), n = Eo(t, "highlightCoordinator", 7, null), r = Eo(t, "ttsService", 7, null);
3977
- const i = typeof window < "u", s = "pie-annotations", l = [
3994
+ function yl(e, t) {
3995
+ Bn(t, !0), vs(e, ml);
3996
+ let o = Eo(t, "enabled", 7, !0), n = Eo(t, "highlightCoordinator", 7, null), i = Eo(t, "ttsService", 7, null);
3997
+ const r = typeof window < "u", s = "pie-annotations", l = [
3978
3998
  {
3979
3999
  name: Bt.YELLOW,
3980
4000
  hex: "#fde995",
@@ -4056,7 +4076,7 @@ function bl(e, t) {
4056
4076
  return !!A && b(W).contains(A);
4057
4077
  }
4058
4078
  function an() {
4059
- if (!(!i || !n()))
4079
+ if (!(!r || !n()))
4060
4080
  try {
4061
4081
  const g = _t(), w = n().exportAnnotations(g);
4062
4082
  sessionStorage.setItem(gt(), JSON.stringify(w));
@@ -4065,7 +4085,7 @@ function bl(e, t) {
4065
4085
  }
4066
4086
  }
4067
4087
  function Wi() {
4068
- if (!(!i || !n()))
4088
+ if (!(!r || !n()))
4069
4089
  try {
4070
4090
  const g = sessionStorage.getItem(gt());
4071
4091
  if (!g) return;
@@ -4076,7 +4096,7 @@ function bl(e, t) {
4076
4096
  }
4077
4097
  }
4078
4098
  function Ue() {
4079
- if (!o() || !i) return;
4099
+ if (!o() || !r) return;
4080
4100
  const g = window.getSelection();
4081
4101
  if (!g || g.rangeCount === 0) return St();
4082
4102
  const w = g.getRangeAt(0), A = g.toString().trim();
@@ -4098,7 +4118,7 @@ function bl(e, t) {
4098
4118
  );
4099
4119
  }
4100
4120
  function St() {
4101
- b(h) && r() && (r().stop(), C(h, !1)), b(d).isVisible = !1, b(d).selectedText = "", b(d).selectedRange = null;
4121
+ b(h) && i() && (i().stop(), C(h, !1)), b(d).isVisible = !1, b(d).selectedText = "", b(d).selectedRange = null;
4102
4122
  }
4103
4123
  function cn(g) {
4104
4124
  if (!b(d).selectedRange || !n()) return;
@@ -4145,10 +4165,10 @@ function bl(e, t) {
4145
4165
  ), St();
4146
4166
  }
4147
4167
  async function Bi() {
4148
- if (!(!b(d).selectedRange || !r())) {
4168
+ if (!(!b(d).selectedRange || !i())) {
4149
4169
  C(h, !0);
4150
4170
  try {
4151
- console.log("[AnnotationToolbar] Speaking range:", b(d).selectedRange.toString().substring(0, 50)), await r().speakRange(b(d).selectedRange, { contentRoot: _t() }), console.log("[AnnotationToolbar] TTS completed successfully");
4171
+ console.log("[AnnotationToolbar] Speaking range:", b(d).selectedRange.toString().substring(0, 50)), await i().speakRange(b(d).selectedRange, { contentRoot: _t() }), console.log("[AnnotationToolbar] TTS completed successfully");
4152
4172
  } catch (g) {
4153
4173
  console.error("[AnnotationToolbar] TTS error:", g), alert(`TTS failed: ${g instanceof Error ? g.message : String(g)}`);
4154
4174
  } finally {
@@ -4163,7 +4183,7 @@ function bl(e, t) {
4163
4183
  !b(d).isVisible || b(m) || b(f) && !b(f).contains(g.target) && St();
4164
4184
  }
4165
4185
  wn(() => {
4166
- if (!i) return;
4186
+ if (!r) return;
4167
4187
  const g = setTimeout(
4168
4188
  () => {
4169
4189
  Wi();
@@ -4198,14 +4218,14 @@ function bl(e, t) {
4198
4218
  n(g), no();
4199
4219
  },
4200
4220
  get ttsService() {
4201
- return r();
4221
+ return i();
4202
4222
  },
4203
4223
  set ttsService(g = null) {
4204
- r(g), no();
4224
+ i(g), no();
4205
4225
  }
4206
- }, fn = vl();
4226
+ }, fn = bl();
4207
4227
  ps("g8qu62", (g) => {
4208
- var w = al();
4228
+ var w = ul();
4209
4229
  Ct(g, w);
4210
4230
  });
4211
4231
  var hn = Lo(fn);
@@ -4213,9 +4233,9 @@ function bl(e, t) {
4213
4233
  var dn = Ot(hn, 2);
4214
4234
  {
4215
4235
  var Gi = (g) => {
4216
- var w = pl(), A = Xe(w);
4236
+ var w = gl(), A = Xe(w);
4217
4237
  fs(A, 17, () => l, cs, (nt, it) => {
4218
- var U = cl(), Je = Xe(U), Co = Xe(Je, !0);
4238
+ var U = fl(), Je = Xe(U), Co = Xe(Je, !0);
4219
4239
  Ze(Je), Ze(U), Ye(() => {
4220
4240
  Sn(U, `background-color: ${b(it).hex ?? ""};`), kn(U, "aria-label", b(it).label), kn(U, "title", b(it).label), _n(Co, b(it).label);
4221
4241
  }), Ee("click", U, () => cn(b(it).name)), Ct(nt, U);
@@ -4223,20 +4243,20 @@ function bl(e, t) {
4223
4243
  var D = Ot(A, 2), Xt = Ot(D, 2);
4224
4244
  {
4225
4245
  var Ce = (nt) => {
4226
- var it = ul(), U = Ot(Lo(it), 2);
4246
+ var it = hl(), U = Ot(Lo(it), 2);
4227
4247
  Ye(() => U.disabled = b(h)), Ee("click", U, Bi), Ct(nt, it);
4228
4248
  };
4229
4249
  Ve(Xt, (nt) => {
4230
- r() && nt(Ce);
4250
+ i() && nt(Ce);
4231
4251
  });
4232
4252
  }
4233
4253
  var Ae = Ot(Xt, 2);
4234
4254
  {
4235
4255
  var Ui = (nt) => {
4236
- var it = dl(), U = Ot(Lo(it), 2);
4256
+ var it = vl(), U = Ot(Lo(it), 2);
4237
4257
  {
4238
4258
  var Je = (Yt) => {
4239
- var Le = fl();
4259
+ var Le = dl();
4240
4260
  Ee("click", Le, Di), Ct(Yt, Le);
4241
4261
  };
4242
4262
  Ve(U, (Yt) => {
@@ -4246,7 +4266,7 @@ function bl(e, t) {
4246
4266
  var Co = Ot(U, 2);
4247
4267
  {
4248
4268
  var Ki = (Yt) => {
4249
- var Le = hl();
4269
+ var Le = pl();
4250
4270
  Ee("click", Le, Hi), Ct(Yt, Le);
4251
4271
  };
4252
4272
  Ve(Co, (Yt) => {
@@ -4270,7 +4290,7 @@ function bl(e, t) {
4270
4290
  }
4271
4291
  ts(["click"]);
4272
4292
  customElements.define("pie-tool-annotation-toolbar", _s(
4273
- bl,
4293
+ yl,
4274
4294
  {
4275
4295
  enabled: { attribute: "enabled", type: "Boolean" },
4276
4296
  highlightCoordinator: { type: "Object" },
@@ -4281,5 +4301,5 @@ customElements.define("pie-tool-annotation-toolbar", _s(
4281
4301
  { mode: "open" }
4282
4302
  ));
4283
4303
  export {
4284
- bl as default
4304
+ yl as default
4285
4305
  };