@pie-players/pie-section-player 0.3.5 → 0.3.7

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.
@@ -915,8 +915,8 @@ function nl(n, e, t, i) {
915
915
  l();
916
916
  try {
917
917
  i(f);
918
- } catch (p) {
919
- (s.f & zt) === 0 && rn(p, s);
918
+ } catch (m) {
919
+ (s.f & zt) === 0 && rn(m, s);
920
920
  }
921
921
  yo();
922
922
  }
@@ -992,8 +992,8 @@ function rl(n, e, t) {
992
992
  o = c.promise;
993
993
  try {
994
994
  Promise.resolve(n()).then(c.resolve, c.reject).finally(yo);
995
- } catch (p) {
996
- c.reject(p), yo();
995
+ } catch (m) {
996
+ c.reject(m), yo();
997
997
  }
998
998
  var d = (
999
999
  /** @type {Batch} */
@@ -1003,19 +1003,19 @@ function rl(n, e, t) {
1003
1003
  var u = ol();
1004
1004
  l.get(d)?.reject(pn), l.delete(d), l.set(d, c);
1005
1005
  }
1006
- const f = (p, b = void 0) => {
1007
- if (d.activate(), b)
1008
- b !== pn && (r.f |= an, ei(r, b));
1006
+ const f = (m, S = void 0) => {
1007
+ if (d.activate(), S)
1008
+ S !== pn && (r.f |= an, ei(r, S));
1009
1009
  else {
1010
- (r.f & an) !== 0 && (r.f ^= an), ei(r, p);
1011
- for (const [h, S] of l) {
1010
+ (r.f & an) !== 0 && (r.f ^= an), ei(r, m);
1011
+ for (const [h, b] of l) {
1012
1012
  if (l.delete(h), h === d) break;
1013
- S.reject(pn);
1013
+ b.reject(pn);
1014
1014
  }
1015
1015
  }
1016
1016
  u && u();
1017
1017
  };
1018
- c.promise.then(f, (p) => f(null, p || "unknown"));
1018
+ c.promise.then(f, (m) => f(null, m || "unknown"));
1019
1019
  }), $o(() => {
1020
1020
  for (const c of l.values())
1021
1021
  c.reject(pn);
@@ -1211,11 +1211,11 @@ function sn(n) {
1211
1211
  return n;
1212
1212
  var u = t.get(c), f = c in l;
1213
1213
  if (u === void 0 && (!f || wn(l, c)?.writable) && (u = s(() => {
1214
- var b = sn(f ? l[c] : xe), h = /* @__PURE__ */ U(b);
1214
+ var S = sn(f ? l[c] : xe), h = /* @__PURE__ */ U(S);
1215
1215
  return h;
1216
1216
  }), t.set(c, u)), u !== void 0) {
1217
- var p = a(u);
1218
- return p === xe ? void 0 : p;
1217
+ var m = a(u);
1218
+ return m === xe ? void 0 : m;
1219
1219
  }
1220
1220
  return Reflect.get(l, c, d);
1221
1221
  },
@@ -1225,12 +1225,12 @@ function sn(n) {
1225
1225
  var u = t.get(c);
1226
1226
  u && (d.value = a(u));
1227
1227
  } else if (d === void 0) {
1228
- var f = t.get(c), p = f?.v;
1229
- if (f !== void 0 && p !== xe)
1228
+ var f = t.get(c), m = f?.v;
1229
+ if (f !== void 0 && m !== xe)
1230
1230
  return {
1231
1231
  enumerable: !0,
1232
1232
  configurable: !0,
1233
- value: p,
1233
+ value: m,
1234
1234
  writable: !0
1235
1235
  };
1236
1236
  }
@@ -1242,8 +1242,8 @@ function sn(n) {
1242
1242
  var d = t.get(c), u = d !== void 0 && d.v !== xe || Reflect.has(l, c);
1243
1243
  if (d !== void 0 || de !== null && (!u || wn(l, c)?.writable)) {
1244
1244
  d === void 0 && (d = s(() => {
1245
- var p = u ? sn(l[c]) : xe, b = /* @__PURE__ */ U(p);
1246
- return b;
1245
+ var m = u ? sn(l[c]) : xe, S = /* @__PURE__ */ U(m);
1246
+ return S;
1247
1247
  }), t.set(c, d));
1248
1248
  var f = a(d);
1249
1249
  if (f === xe)
@@ -1252,28 +1252,28 @@ function sn(n) {
1252
1252
  return u;
1253
1253
  },
1254
1254
  set(l, c, d, u) {
1255
- var f = t.get(c), p = c in l;
1255
+ var f = t.get(c), m = c in l;
1256
1256
  if (i && c === "length")
1257
- for (var b = d; b < /** @type {Source<number>} */
1258
- f.v; b += 1) {
1259
- var h = t.get(b + "");
1260
- h !== void 0 ? F(h, xe) : b in l && (h = s(() => /* @__PURE__ */ U(xe)), t.set(b + "", h));
1257
+ for (var S = d; S < /** @type {Source<number>} */
1258
+ f.v; S += 1) {
1259
+ var h = t.get(S + "");
1260
+ h !== void 0 ? F(h, xe) : S in l && (h = s(() => /* @__PURE__ */ U(xe)), t.set(S + "", h));
1261
1261
  }
1262
1262
  if (f === void 0)
1263
- (!p || wn(l, c)?.writable) && (f = s(() => /* @__PURE__ */ U(void 0)), F(f, sn(d)), t.set(c, f));
1263
+ (!m || wn(l, c)?.writable) && (f = s(() => /* @__PURE__ */ U(void 0)), F(f, sn(d)), t.set(c, f));
1264
1264
  else {
1265
- p = f.v !== xe;
1266
- var S = s(() => sn(d));
1267
- F(f, S);
1265
+ m = f.v !== xe;
1266
+ var b = s(() => sn(d));
1267
+ F(f, b);
1268
1268
  }
1269
1269
  var w = Reflect.getOwnPropertyDescriptor(l, c);
1270
- if (w?.set && w.set.call(u, d), !p) {
1270
+ if (w?.set && w.set.call(u, d), !m) {
1271
1271
  if (i && typeof c == "string") {
1272
- var g = (
1272
+ var p = (
1273
1273
  /** @type {Source<number>} */
1274
1274
  t.get("length")
1275
1275
  ), C = Number(c);
1276
- Number.isInteger(C) && C >= g.v && F(g, C + 1);
1276
+ Number.isInteger(C) && C >= p.v && F(p, C + 1);
1277
1277
  }
1278
1278
  di(o);
1279
1279
  }
@@ -1282,8 +1282,8 @@ function sn(n) {
1282
1282
  ownKeys(l) {
1283
1283
  a(o);
1284
1284
  var c = Reflect.ownKeys(l).filter((f) => {
1285
- var p = t.get(f);
1286
- return p === void 0 || p.v !== xe;
1285
+ var m = t.get(f);
1286
+ return m === void 0 || m.v !== xe;
1287
1287
  });
1288
1288
  for (var [d, u] of t)
1289
1289
  u.v !== xe && !(d in l) && c.push(d);
@@ -1686,7 +1686,7 @@ function Ss(n, e, t = !0) {
1686
1686
  }
1687
1687
  }
1688
1688
  function Ts(n) {
1689
- var S;
1689
+ var b;
1690
1690
  var e = Xe, t = tt, i = dt, o = oe, r = mt, s = Je, l = _t, c = En, d = n.f;
1691
1691
  Xe = /** @type {null | Value[]} */
1692
1692
  null, tt = 0, dt = null, oe = (d & (Pt | fn)) === 0 ? n : null, mt = null, Zn(n.ctx), _t = !1, En = ++gn, n.ac !== null && (Wo(() => {
@@ -1699,19 +1699,19 @@ function Ts(n) {
1699
1699
  n.fn
1700
1700
  ), f = u();
1701
1701
  n.f |= zn;
1702
- var p = n.deps, b = Te?.is_fork;
1702
+ var m = n.deps, S = Te?.is_fork;
1703
1703
  if (Xe !== null) {
1704
1704
  var h;
1705
- if (b || fi(n, tt), p !== null && tt > 0)
1706
- for (p.length = tt + Xe.length, h = 0; h < Xe.length; h++)
1707
- p[tt + h] = Xe[h];
1705
+ if (S || fi(n, tt), m !== null && tt > 0)
1706
+ for (m.length = tt + Xe.length, h = 0; h < Xe.length; h++)
1707
+ m[tt + h] = Xe[h];
1708
1708
  else
1709
- n.deps = p = Xe;
1709
+ n.deps = m = Xe;
1710
1710
  if (Uo() && (n.f & pt) !== 0)
1711
- for (h = tt; h < p.length; h++)
1712
- ((S = p[h]).reactions ?? (S.reactions = [])).push(n);
1713
- } else !b && p !== null && tt < p.length && (fi(n, tt), p.length = tt);
1714
- if (qr() && dt !== null && !_t && p !== null && (n.f & (Ne | Et | Me)) === 0)
1711
+ for (h = tt; h < m.length; h++)
1712
+ ((b = m[h]).reactions ?? (b.reactions = [])).push(n);
1713
+ } else !S && m !== null && tt < m.length && (fi(n, tt), m.length = tt);
1714
+ if (qr() && dt !== null && !_t && m !== null && (n.f & (Ne | Et | Me)) === 0)
1715
1715
  for (h = 0; h < /** @type {Source[]} */
1716
1716
  dt.length; h++)
1717
1717
  Ss(
@@ -1940,28 +1940,28 @@ function wo(n) {
1940
1940
  var u = oe, f = de;
1941
1941
  Ze(null), yt(null);
1942
1942
  try {
1943
- for (var p, b = []; r !== null; ) {
1943
+ for (var m, S = []; r !== null; ) {
1944
1944
  var h = r.assignedSlot || r.parentNode || /** @type {any} */
1945
1945
  r.host || null;
1946
1946
  try {
1947
- var S = r[vn]?.[i];
1948
- S != null && (!/** @type {any} */
1947
+ var b = r[vn]?.[i];
1948
+ b != null && (!/** @type {any} */
1949
1949
  r.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1950
1950
  // -> the target could not have been disabled because it emits the event in the first place
1951
- n.target === r) && S.call(r, n);
1951
+ n.target === r) && b.call(r, n);
1952
1952
  } catch (w) {
1953
- p ? b.push(w) : p = w;
1953
+ m ? S.push(w) : m = w;
1954
1954
  }
1955
1955
  if (n.cancelBubble || h === e || h === null)
1956
1956
  break;
1957
1957
  r = h;
1958
1958
  }
1959
- if (p) {
1960
- for (let w of b)
1959
+ if (m) {
1960
+ for (let w of S)
1961
1961
  queueMicrotask(() => {
1962
1962
  throw w;
1963
1963
  });
1964
- throw p;
1964
+ throw m;
1965
1965
  }
1966
1966
  } finally {
1967
1967
  n[vn] = e, delete n.currentTarget, Ze(u), yt(f);
@@ -2096,7 +2096,7 @@ function ks(n, { target: e, anchor: t, props: i = {}, events: o, context: r, int
2096
2096
  pending: () => {
2097
2097
  }
2098
2098
  },
2099
- (b) => {
2099
+ (S) => {
2100
2100
  Be({});
2101
2101
  var h = (
2102
2102
  /** @type {ComponentContext} */
@@ -2104,43 +2104,43 @@ function ks(n, { target: e, anchor: t, props: i = {}, events: o, context: r, int
2104
2104
  );
2105
2105
  if (r && (h.c = r), o && (i.$$events = o), Z && Pn(
2106
2106
  /** @type {TemplateNode} */
2107
- b,
2107
+ S,
2108
2108
  null
2109
- ), c = n(b, i) || {}, Z && (de.nodes.end = ce, ce === null || ce.nodeType !== yi || /** @type {Comment} */
2109
+ ), c = n(S, i) || {}, Z && (de.nodes.end = ce, ce === null || ce.nodeType !== yi || /** @type {Comment} */
2110
2110
  ce.data !== zo))
2111
2111
  throw qi(), Yn;
2112
2112
  He();
2113
2113
  },
2114
2114
  l
2115
2115
  );
2116
- var f = /* @__PURE__ */ new Set(), p = (b) => {
2117
- for (var h = 0; h < b.length; h++) {
2118
- var S = b[h];
2119
- if (!f.has(S)) {
2120
- f.add(S);
2121
- var w = El(S);
2122
- for (const x of [e, document]) {
2123
- var g = Ei.get(x);
2124
- g === void 0 && (g = /* @__PURE__ */ new Map(), Ei.set(x, g));
2125
- var C = g.get(S);
2126
- C === void 0 ? (x.addEventListener(S, wo, { passive: w }), g.set(S, 1)) : g.set(S, C + 1);
2116
+ var f = /* @__PURE__ */ new Set(), m = (S) => {
2117
+ for (var h = 0; h < S.length; h++) {
2118
+ var b = S[h];
2119
+ if (!f.has(b)) {
2120
+ f.add(b);
2121
+ var w = El(b);
2122
+ for (const R of [e, document]) {
2123
+ var p = Ei.get(R);
2124
+ p === void 0 && (p = /* @__PURE__ */ new Map(), Ei.set(R, p));
2125
+ var C = p.get(b);
2126
+ C === void 0 ? (R.addEventListener(b, wo, { passive: w }), p.set(b, 1)) : p.set(b, C + 1);
2127
2127
  }
2128
2128
  }
2129
2129
  }
2130
2130
  };
2131
- return p(ji(_s)), To.add(p), () => {
2132
- for (var b of f)
2131
+ return m(ji(_s)), To.add(m), () => {
2132
+ for (var S of f)
2133
2133
  for (const w of [e, document]) {
2134
2134
  var h = (
2135
2135
  /** @type {Map<string, number>} */
2136
2136
  Ei.get(w)
2137
- ), S = (
2137
+ ), b = (
2138
2138
  /** @type {number} */
2139
- h.get(b)
2139
+ h.get(S)
2140
2140
  );
2141
- --S == 0 ? (w.removeEventListener(b, wo), h.delete(b), h.size === 0 && Ei.delete(w)) : h.set(b, S);
2141
+ --b == 0 ? (w.removeEventListener(S, wo), h.delete(S), h.size === 0 && Ei.delete(w)) : h.set(S, b);
2142
2142
  }
2143
- To.delete(p), u !== t && u.parentNode?.removeChild(u);
2143
+ To.delete(m), u !== t && u.parentNode?.removeChild(u);
2144
2144
  };
2145
2145
  });
2146
2146
  return Co.set(c, d), c;
@@ -2340,11 +2340,11 @@ function Ll(n, e, t) {
2340
2340
  () => {
2341
2341
  if (r) {
2342
2342
  if (r.pending.delete(f), r.done.add(f), r.pending.size === 0) {
2343
- var p = (
2343
+ var m = (
2344
2344
  /** @type {Set<EachOutroGroup>} */
2345
2345
  n.outrogroups
2346
2346
  );
2347
- _o(n, ji(r.done)), p.delete(r), p.size === 0 && (n.outrogroups = null);
2347
+ _o(n, ji(r.done)), m.delete(r), m.size === 0 && (n.outrogroups = null);
2348
2348
  }
2349
2349
  } else
2350
2350
  s -= 1;
@@ -2397,55 +2397,55 @@ function Rs(n, e, t, i, o, r = null) {
2397
2397
  var s = n, l = /* @__PURE__ */ new Map();
2398
2398
  Z && xn();
2399
2399
  var c = null, d = /* @__PURE__ */ ns(() => {
2400
- var g = t();
2401
- return Do(g) ? g : g == null ? [] : ji(g);
2402
- }), u, f = /* @__PURE__ */ new Map(), p = !0;
2403
- function b(g) {
2404
- (w.effect.f & zt) === 0 && (w.pending.delete(g), w.fallback = c, Ol(w, u, s, e, i), c !== null && (u.length === 0 ? (c.f & Ut) === 0 ? Xo(c) : (c.f ^= Ut, li(c, null, s)) : _n(c, () => {
2400
+ var p = t();
2401
+ return Do(p) ? p : p == null ? [] : ji(p);
2402
+ }), u, f = /* @__PURE__ */ new Map(), m = !0;
2403
+ function S(p) {
2404
+ (w.effect.f & zt) === 0 && (w.pending.delete(p), w.fallback = c, Ol(w, u, s, e, i), c !== null && (u.length === 0 ? (c.f & Ut) === 0 ? Xo(c) : (c.f ^= Ut, li(c, null, s)) : _n(c, () => {
2405
2405
  c = null;
2406
2406
  })));
2407
2407
  }
2408
- function h(g) {
2409
- w.pending.delete(g);
2408
+ function h(p) {
2409
+ w.pending.delete(p);
2410
2410
  }
2411
- var S = Yi(() => {
2411
+ var b = Yi(() => {
2412
2412
  u = /** @type {V[]} */
2413
2413
  a(d);
2414
- var g = u.length;
2414
+ var p = u.length;
2415
2415
  let C = !1;
2416
2416
  if (Z) {
2417
- var x = Vr(s) === No;
2418
- x !== (g === 0) && (s = Ni(), De(s), rt(!1), C = !0);
2417
+ var R = Vr(s) === No;
2418
+ R !== (p === 0) && (s = Ni(), De(s), rt(!1), C = !0);
2419
2419
  }
2420
2420
  for (var O = /* @__PURE__ */ new Set(), _ = (
2421
2421
  /** @type {Batch} */
2422
2422
  Te
2423
- ), H = fs(), R = 0; R < g; R += 1) {
2423
+ ), H = fs(), x = 0; x < p; x += 1) {
2424
2424
  Z && ce.nodeType === yi && /** @type {Comment} */
2425
2425
  ce.data === zo && (s = /** @type {Comment} */
2426
2426
  ce, C = !0, rt(!1));
2427
- var D = u[R], K = i(D, R), J = p ? null : l.get(K);
2428
- J ? (J.v && ei(J.v, D), J.i && ei(J.i, R), H && _.unskip_effect(J.e)) : (J = Ml(
2427
+ var D = u[x], K = i(D, x), J = m ? null : l.get(K);
2428
+ J ? (J.v && ei(J.v, D), J.i && ei(J.i, x), H && _.unskip_effect(J.e)) : (J = Ml(
2429
2429
  l,
2430
- p ? s : br ?? (br = gt()),
2430
+ m ? s : br ?? (br = gt()),
2431
2431
  D,
2432
2432
  K,
2433
- R,
2433
+ x,
2434
2434
  o,
2435
2435
  e,
2436
2436
  t
2437
- ), p || (J.e.f |= Ut), l.set(K, J)), O.add(K);
2437
+ ), m || (J.e.f |= Ut), l.set(K, J)), O.add(K);
2438
2438
  }
2439
- if (g === 0 && r && !c && (p ? c = ht(() => r(s)) : (c = ht(() => r(br ?? (br = gt()))), c.f |= Ut)), g > O.size && Na(), Z && g > 0 && De(Ni()), !p)
2439
+ if (p === 0 && r && !c && (m ? c = ht(() => r(s)) : (c = ht(() => r(br ?? (br = gt()))), c.f |= Ut)), p > O.size && Na(), Z && p > 0 && De(Ni()), !m)
2440
2440
  if (f.set(_, O), H) {
2441
2441
  for (const [L, P] of l)
2442
2442
  O.has(L) || _.skip_effect(P.e);
2443
- _.oncommit(b), _.ondiscard(h);
2443
+ _.oncommit(S), _.ondiscard(h);
2444
2444
  } else
2445
- b(_);
2445
+ S(_);
2446
2446
  C && rt(!0), a(d);
2447
- }), w = { effect: S, items: l, pending: f, outrogroups: null, fallback: c };
2448
- p = !1, Z && (s = ce);
2447
+ }), w = { effect: b, items: l, pending: f, outrogroups: null, fallback: c };
2448
+ m = !1, Z && (s = ce);
2449
2449
  }
2450
2450
  function ai(n) {
2451
2451
  for (; n !== null && (n.f & Pt) === 0; )
@@ -2453,10 +2453,10 @@ function ai(n) {
2453
2453
  return n;
2454
2454
  }
2455
2455
  function Ol(n, e, t, i, o) {
2456
- var r = e.length, s = n.items, l = ai(n.effect.first), c, d = null, u = [], f = [], p, b, h, S;
2457
- for (S = 0; S < r; S += 1) {
2458
- if (p = e[S], b = o(p, S), h = /** @type {EachItem} */
2459
- s.get(b).e, n.outrogroups !== null)
2456
+ var r = e.length, s = n.items, l = ai(n.effect.first), c, d = null, u = [], f = [], m, S, h, b;
2457
+ for (b = 0; b < r; b += 1) {
2458
+ if (m = e[b], S = o(m, b), h = /** @type {EachItem} */
2459
+ s.get(S).e, n.outrogroups !== null)
2460
2460
  for (const D of n.outrogroups)
2461
2461
  D.pending.delete(h), D.done.delete(h);
2462
2462
  if ((h.f & Ut) !== 0)
@@ -2470,14 +2470,14 @@ function Ol(n, e, t, i, o) {
2470
2470
  if ((h.f & Fe) !== 0 && Xo(h), h !== l) {
2471
2471
  if (c !== void 0 && c.has(h)) {
2472
2472
  if (u.length < f.length) {
2473
- var g = f[0], C;
2474
- d = g.prev;
2475
- var x = u[0], O = u[u.length - 1];
2473
+ var p = f[0], C;
2474
+ d = p.prev;
2475
+ var R = u[0], O = u[u.length - 1];
2476
2476
  for (C = 0; C < u.length; C += 1)
2477
- li(u[C], g, t);
2477
+ li(u[C], p, t);
2478
2478
  for (C = 0; C < f.length; C += 1)
2479
2479
  c.delete(f[C]);
2480
- Zt(n, x.prev, O.next), Zt(n, d, x), Zt(n, O, g), l = g, d = O, S -= 1, u = [], f = [];
2480
+ Zt(n, R.prev, O.next), Zt(n, d, R), Zt(n, O, p), l = p, d = O, b -= 1, u = [], f = [];
2481
2481
  } else
2482
2482
  c.delete(h), li(h, l, t), Zt(n, h.prev, h.next), Zt(n, h, d === null ? n.effect.first : d.next), Zt(n, d, h), d = h;
2483
2483
  continue;
@@ -2503,8 +2503,8 @@ function Ol(n, e, t, i, o) {
2503
2503
  (l.f & Fe) === 0 && l !== n.fallback && _.push(l), l = ai(l.next);
2504
2504
  var H = _.length;
2505
2505
  if (H > 0) {
2506
- var R = null;
2507
- Ll(n, _, R);
2506
+ var x = null;
2507
+ Ll(n, _, x);
2508
2508
  }
2509
2509
  }
2510
2510
  }
@@ -2558,19 +2558,19 @@ function xs(n, e, t, i, o, r) {
2558
2558
  d.ensure(null, null);
2559
2559
  return;
2560
2560
  }
2561
- return d.ensure(u, (p) => {
2561
+ return d.ensure(u, (m) => {
2562
2562
  if (u) {
2563
2563
  if (l = Z ? (
2564
2564
  /** @type {Element} */
2565
2565
  l
2566
2566
  ) : $i(u, f), Pn(l, l), i) {
2567
2567
  Z && kl(u) && l.append(document.createComment(""));
2568
- var b = Z ? /* @__PURE__ */ On(l) : l.appendChild(gt());
2569
- Z && (b === null ? rt(!1) : De(b)), i(l, b);
2568
+ var S = Z ? /* @__PURE__ */ On(l) : l.appendChild(gt());
2569
+ Z && (S === null ? rt(!1) : De(S)), i(l, S);
2570
2570
  }
2571
- de.nodes.end = l, p.before(l);
2571
+ de.nodes.end = l, m.before(l);
2572
2572
  }
2573
- Z && De(p);
2573
+ Z && De(m);
2574
2574
  }), () => {
2575
2575
  };
2576
2576
  }, An), $o(() => {
@@ -2722,44 +2722,44 @@ function y(n, e, t, i) {
2722
2722
  var u = Cn in n || Dr in n;
2723
2723
  d = wn(n, e)?.set ?? (u && e in n ? (C) => n[e] = C : void 0);
2724
2724
  }
2725
- var f, p = !1;
2726
- o ? [f, p] = jl(() => (
2725
+ var f, m = !1;
2726
+ o ? [f, m] = jl(() => (
2727
2727
  /** @type {V} */
2728
2728
  n[e]
2729
2729
  )) : f = /** @type {V} */
2730
2730
  n[e], f === void 0 && i !== void 0 && (f = c(), d && (Fa(), d(f)));
2731
- var b;
2732
- if (b = () => {
2731
+ var S;
2732
+ if (S = () => {
2733
2733
  var C = (
2734
2734
  /** @type {V} */
2735
2735
  n[e]
2736
2736
  );
2737
2737
  return C === void 0 ? c() : (l = !0, C);
2738
2738
  }, (t & ya) === 0)
2739
- return b;
2739
+ return S;
2740
2740
  if (d) {
2741
2741
  var h = n.$$legacy;
2742
2742
  return (
2743
2743
  /** @type {() => V} */
2744
- (function(C, x) {
2745
- return arguments.length > 0 ? ((!x || h || p) && d(x ? b() : C), C) : b();
2744
+ (function(C, R) {
2745
+ return arguments.length > 0 ? ((!R || h || m) && d(R ? S() : C), C) : S();
2746
2746
  })
2747
2747
  );
2748
2748
  }
2749
- var S = !1, w = ((t & va) !== 0 ? Ui : ns)(() => (S = !1, b()));
2749
+ var b = !1, w = ((t & va) !== 0 ? Ui : ns)(() => (b = !1, S()));
2750
2750
  o && a(w);
2751
- var g = (
2751
+ var p = (
2752
2752
  /** @type {Effect} */
2753
2753
  de
2754
2754
  );
2755
2755
  return (
2756
2756
  /** @type {() => V} */
2757
- (function(C, x) {
2757
+ (function(C, R) {
2758
2758
  if (arguments.length > 0) {
2759
- const O = x ? a(w) : o ? sn(C) : C;
2760
- return F(w, O), S = !0, s !== void 0 && (s = O), C;
2759
+ const O = R ? a(w) : o ? sn(C) : C;
2760
+ return F(w, O), b = !0, s !== void 0 && (s = O), C;
2761
2761
  }
2762
- return dn && S || (g.f & zt) !== 0 ? w.v : a(w);
2762
+ return dn && b || (p.f & zt) !== 0 ? w.v : a(w);
2763
2763
  })
2764
2764
  );
2765
2765
  }
@@ -3844,20 +3844,20 @@ class oc {
3844
3844
  }
3845
3845
  resolveAdaptiveTTSStyle(e) {
3846
3846
  const t = [255, 235, 59], i = [17, 24, 39], o = [255, 255, 255], r = e || (typeof document < "u" ? document.documentElement : null), s = r && typeof getComputedStyle == "function" ? getComputedStyle(r) : null, l = this.parseColor(s?.getPropertyValue("--pie-background") || s?.backgroundColor) || o, c = this.parseColor(s?.getPropertyValue("--pie-text")) || i, d = this.explicitTTSColorOverride ? this.parseColor(this.explicitTTSColorOverride.color) || t : this.parseColor(s?.getPropertyValue("--pie-missing")) || t, u = this.explicitTTSColorOverride ? [Math.max(0.3, Math.min(0.95, this.explicitTTSColorOverride.opacity))] : [0.8, 0.72, 0.68, 0.62, 0.56, 0.5];
3847
- let f = u[u.length - 1], p = -1 / 0;
3847
+ let f = u[u.length - 1], m = -1 / 0;
3848
3848
  for (const K of u) {
3849
3849
  const J = this.blend(d, l, K), L = this.contrastRatio(J, l), P = this.contrastRatio(J, c), W = L * 1.2 + P * 0.8;
3850
3850
  if (L >= 1.25 && P >= 2.4) {
3851
3851
  f = K;
3852
3852
  break;
3853
3853
  }
3854
- W > p && (p = W, f = K);
3854
+ W > m && (m = W, f = K);
3855
3855
  }
3856
- const b = Math.max(0.24, Math.min(0.85, f * 0.55)), h = Math.max(0.55, Math.min(0.95, f + 0.2)), S = Math.max(0.22, Math.min(0.6, f * 0.45)), w = c, g = this.blend(w, l, h), C = this.contrastRatio(g, l), x = this.relativeLuminance(l) > 0.45 ? [0, 0, 0] : [255, 255, 255], O = C >= 1.35 ? w : x, _ = `rgba(${d[0]}, ${d[1]}, ${d[2]}, ${f})`, H = `rgba(${d[0]}, ${d[1]}, ${d[2]}, ${b})`, R = `rgba(${O[0]}, ${O[1]}, ${O[2]}, ${h})`, D = `rgba(${O[0]}, ${O[1]}, ${O[2]}, ${S})`;
3856
+ const S = Math.max(0.24, Math.min(0.85, f * 0.55)), h = Math.max(0.55, Math.min(0.95, f + 0.2)), b = Math.max(0.22, Math.min(0.6, f * 0.45)), w = c, p = this.blend(w, l, h), C = this.contrastRatio(p, l), R = this.relativeLuminance(l) > 0.45 ? [0, 0, 0] : [255, 255, 255], O = C >= 1.35 ? w : R, _ = `rgba(${d[0]}, ${d[1]}, ${d[2]}, ${f})`, H = `rgba(${d[0]}, ${d[1]}, ${d[2]}, ${S})`, x = `rgba(${O[0]}, ${O[1]}, ${O[2]}, ${h})`, D = `rgba(${O[0]}, ${O[1]}, ${O[2]}, ${b})`;
3857
3857
  return {
3858
3858
  wordHighlight: _,
3859
3859
  sentenceHighlight: H,
3860
- wordUnderline: R,
3860
+ wordUnderline: x,
3861
3861
  wordShadow: D
3862
3862
  };
3863
3863
  }
@@ -5177,8 +5177,8 @@ class Sc {
5177
5177
  }, this.utterance.onboundary = (s) => {
5178
5178
  if (i !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", s.name, "charIndex:", s.charIndex, "charLength:", s.charLength), s.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence")
5179
5179
  return;
5180
- const l = Math.max(0, Math.min(s.charIndex, Math.max(0, e.length - 1))), c = Number(s.charLength || 0), d = this.inferWordLength(e, l), u = Number.isFinite(c) && c > 0 && c <= 80 && l + c <= e.length ? c : d, f = e.substring(l, Math.min(e.length, l + u)).trim(), p = t + l;
5181
- console.log("[BrowserProvider] Calling onWordBoundary with word:", f, "at position:", p), this.onWordBoundary(f, p, u);
5180
+ const l = Math.max(0, Math.min(s.charIndex, Math.max(0, e.length - 1))), c = Number(s.charLength || 0), d = this.inferWordLength(e, l), u = Number.isFinite(c) && c > 0 && c <= 80 && l + c <= e.length ? c : d, f = e.substring(l, Math.min(e.length, l + u)).trim(), m = t + l;
5181
+ console.log("[BrowserProvider] Calling onWordBoundary with word:", f, "at position:", m), this.onWordBoundary(f, m, u);
5182
5182
  }, speechSynthesis.speak(this.utterance);
5183
5183
  });
5184
5184
  }
@@ -5500,15 +5500,15 @@ const qs = {
5500
5500
  ariaLabel: "Read aloud",
5501
5501
  tooltip: "Read aloud",
5502
5502
  onClick: () => {
5503
- p();
5503
+ m();
5504
5504
  },
5505
5505
  disabled: !1,
5506
5506
  active: !1
5507
5507
  }, l = () => {
5508
- const b = r() ? "Stop reading" : "Read aloud";
5509
- s.label = b, s.ariaLabel = b, s.tooltip = b, s.active = r(), s.disabled = !e.ttsService;
5510
- }, c = (b) => {
5511
- (b === "idle" || b === "error") && r() && (e.toggleTool(this.toolId), l());
5508
+ const S = r() ? "Stop reading" : "Read aloud";
5509
+ s.label = S, s.ariaLabel = S, s.tooltip = S, s.active = r(), s.disabled = !e.ttsService;
5510
+ }, c = (S) => {
5511
+ (S === "idle" || S === "error") && r() && (e.toggleTool(this.toolId), l());
5512
5512
  }, d = async () => {
5513
5513
  e.ensureTTSReady && (t || (t = (async () => {
5514
5514
  await e.ensureTTSReady?.(), e.toolkitCoordinator?.highlightCoordinator && i?.setHighlightCoordinator?.(e.toolkitCoordinator.highlightCoordinator);
@@ -5516,83 +5516,83 @@ const qs = {
5516
5516
  }, u = () => {
5517
5517
  i?.stop?.(), r() && e.toggleTool(this.toolId), l();
5518
5518
  }, f = () => {
5519
- const b = e.getScopeElement?.();
5520
- if (b)
5521
- return b;
5522
- const h = (g) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(g) : g.replace(/"/g, '\\"'), S = [
5519
+ const S = e.getScopeElement?.();
5520
+ if (S)
5521
+ return S;
5522
+ const h = (p) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(p) : p.replace(/"/g, '\\"'), b = [
5523
5523
  e.catalogId,
5524
5524
  e.scope.itemId,
5525
5525
  e.scope.canonicalItemId
5526
- ].filter((g) => typeof g == "string" && g.length > 0), w = [];
5527
- for (const g of S) {
5528
- const C = h(g);
5526
+ ].filter((p) => typeof p == "string" && p.length > 0), w = [];
5527
+ for (const p of b) {
5528
+ const C = h(p);
5529
5529
  e.scope.level === "passage" && w.push(`pie-passage-shell[item-id="${C}"] [data-region="content"]`), w.push(`pie-item-shell[item-id="${C}"] [data-region="content"]`);
5530
5530
  }
5531
5531
  w.push("[data-region='content']");
5532
- for (const g of w) {
5533
- const C = document.querySelector(g);
5532
+ for (const p of w) {
5533
+ const C = document.querySelector(p);
5534
5534
  if (C instanceof HTMLElement)
5535
5535
  return C;
5536
5536
  }
5537
5537
  return null;
5538
- }, p = async () => {
5538
+ }, m = async () => {
5539
5539
  if (!i?.speak || !e.ttsService)
5540
5540
  return;
5541
5541
  if (r()) {
5542
5542
  u();
5543
5543
  return;
5544
5544
  }
5545
- const b = f();
5546
- if (!b)
5545
+ const S = f();
5546
+ if (!S)
5547
5547
  return;
5548
- const h = b.textContent || "";
5548
+ const h = S.textContent || "";
5549
5549
  if (h.trim())
5550
5550
  try {
5551
- r() || e.toggleTool(this.toolId), l(), await d(), i.setRootElement?.(b), i.speak(h, {
5551
+ r() || e.toggleTool(this.toolId), l(), await d(), i.setRootElement?.(S), i.speak(h, {
5552
5552
  // For passage-level TTS, use rendered DOM text as the source of truth.
5553
5553
  // Catalog/SSML content can diverge from rendered text and break
5554
5554
  // word-boundary-to-DOM mapping for progressive yellow highlighting.
5555
5555
  catalogId: e.scope.level === "passage" ? void 0 : e.catalogId || e.itemId,
5556
5556
  language: e.language,
5557
- contentElement: b
5558
- }).catch((S) => {
5559
- console.error("[ttsToolRegistration] Failed to start reading:", S), l();
5557
+ contentElement: S
5558
+ }).catch((b) => {
5559
+ console.error("[ttsToolRegistration] Failed to start reading:", b), l();
5560
5560
  }), l();
5561
- } catch (S) {
5562
- l(), console.error("[ttsToolRegistration] Failed to start reading:", S);
5561
+ } catch (b) {
5562
+ l(), console.error("[ttsToolRegistration] Failed to start reading:", b);
5563
5563
  }
5564
5564
  };
5565
5565
  return {
5566
5566
  toolId: this.toolId,
5567
5567
  button: s,
5568
5568
  sync: () => {
5569
- l(), e.ensureTTSReady && d().catch((b) => {
5570
- console.error("[ttsToolRegistration] Failed to initialize TTS service:", b);
5569
+ l(), e.ensureTTSReady && d().catch((S) => {
5570
+ console.error("[ttsToolRegistration] Failed to initialize TTS service:", S);
5571
5571
  });
5572
5572
  },
5573
- subscribeActive: (b) => {
5573
+ subscribeActive: (S) => {
5574
5574
  const h = [];
5575
5575
  if (e.subscribeVisibility) {
5576
- const S = e.subscribeVisibility(() => {
5576
+ const b = e.subscribeVisibility(() => {
5577
5577
  const w = r();
5578
- l(), b(w);
5578
+ l(), S(w);
5579
5579
  });
5580
- h.push(S);
5580
+ h.push(b);
5581
5581
  }
5582
5582
  if (e.ttsService) {
5583
- const S = `tts-toolbar:${o}`, w = (g) => {
5584
- c(String(g || ""));
5583
+ const b = `tts-toolbar:${o}`, w = (p) => {
5584
+ c(String(p || ""));
5585
5585
  const C = r();
5586
- l(), b(C);
5586
+ l(), S(C);
5587
5587
  };
5588
- e.ttsService.onStateChange(S, w), h.push(() => {
5589
- e.ttsService?.offStateChange(S, w);
5588
+ e.ttsService.onStateChange(b, w), h.push(() => {
5589
+ e.ttsService?.offStateChange(b, w);
5590
5590
  });
5591
5591
  }
5592
5592
  return h.length === 0 ? () => {
5593
5593
  } : () => {
5594
- for (const S of h)
5595
- S();
5594
+ for (const b of h)
5595
+ b();
5596
5596
  };
5597
5597
  }
5598
5598
  };
@@ -6601,13 +6601,13 @@ const Er = (n) => n.trim().replace(/\s+/g, " "), Us = (n) => {
6601
6601
  const d = document.createTreeWalker(n, NodeFilter.SHOW_TEXT);
6602
6602
  let u = d.nextNode();
6603
6603
  for (; u; ) {
6604
- const p = u, b = p.parentElement;
6605
- if (b && !Us(b)) {
6606
- const h = p.textContent || "", S = h.match(/\S/), w = S ? S[0] : null;
6604
+ const m = u, S = m.parentElement;
6605
+ if (S && !Us(S)) {
6606
+ const h = m.textContent || "", b = h.match(/\S/), w = b ? b[0] : null;
6607
6607
  !r && !s && Wc(c, w, e) && (i.push(" "), l && t.set(o, l), o++, s = !0);
6608
- for (let g = 0; g < h.length; g++) {
6609
- const C = h[g], x = /\s/.test(C);
6610
- r ? x || (r = !1, i.push(C), t.set(o, { node: p, offset: g }), l = { node: p, offset: g }, o++, s = !1, c = C) : x ? (s || (i.push(" "), t.set(o, { node: p, offset: g }), l = { node: p, offset: g }, o++), s = !0) : (i.push(C), t.set(o, { node: p, offset: g }), l = { node: p, offset: g }, o++, s = !1, c = C);
6608
+ for (let p = 0; p < h.length; p++) {
6609
+ const C = h[p], R = /\s/.test(C);
6610
+ r ? R || (r = !1, i.push(C), t.set(o, { node: m, offset: p }), l = { node: m, offset: p }, o++, s = !1, c = C) : R ? (s || (i.push(" "), t.set(o, { node: m, offset: p }), l = { node: m, offset: p }, o++), s = !0) : (i.push(C), t.set(o, { node: m, offset: p }), l = { node: m, offset: p }, o++, s = !1, c = C);
6611
6611
  }
6612
6612
  }
6613
6613
  u = d.nextNode();
@@ -6815,38 +6815,38 @@ class $c {
6815
6815
  const i = /* @__PURE__ */ new Map();
6816
6816
  let o = null;
6817
6817
  const { map: r } = Ao(e, this.getTextProcessingOptions()), s = /* @__PURE__ */ new Map();
6818
- for (const [S, w] of r.entries())
6819
- s.has(w.node) || s.set(w.node, S);
6818
+ for (const [b, w] of r.entries())
6819
+ s.has(w.node) || s.set(w.node, b);
6820
6820
  const l = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
6821
6821
  let c = l.nextNode();
6822
6822
  for (; c; ) {
6823
- const S = c, w = S.parentElement;
6823
+ const b = c, w = b.parentElement;
6824
6824
  if (w && !this.isElementHidden(w)) {
6825
- const g = this.getBoundaryAnchor(S, e), C = s.get(S);
6826
- g && C !== void 0 && g.anchor !== o && C > 0 && (i.set(C, Math.max(i.get(C) || 0, g.units)), o = g.anchor);
6825
+ const p = this.getBoundaryAnchor(b, e), C = s.get(b);
6826
+ p && C !== void 0 && p.anchor !== o && C > 0 && (i.set(C, Math.max(i.get(C) || 0, p.units)), o = p.anchor);
6827
6827
  }
6828
6828
  c = l.nextNode();
6829
6829
  }
6830
- const d = Array.from(i.keys()).filter((S) => S > 0 && S < t.length).sort((S, w) => S - w), u = [];
6830
+ const d = Array.from(i.keys()).filter((b) => b > 0 && b < t.length).sort((b, w) => b - w), u = [];
6831
6831
  let f = 0;
6832
- for (const S of d) {
6833
- const w = t.substring(f, S), g = w.match(/^\s*/)?.[0].length || 0, C = w.match(/\s*$/)?.[0].length || 0, x = f + g, O = S - C;
6834
- if (O > x) {
6835
- const _ = t.substring(x, O);
6832
+ for (const b of d) {
6833
+ const w = t.substring(f, b), p = w.match(/^\s*/)?.[0].length || 0, C = w.match(/\s*$/)?.[0].length || 0, R = f + p, O = b - C;
6834
+ if (O > R) {
6835
+ const _ = t.substring(R, O);
6836
6836
  u.push({
6837
6837
  text: _,
6838
- startOffset: x,
6839
- pauseMsAfter: this.resolvePauseMsFromUnits(i.get(S) || 0)
6838
+ startOffset: R,
6839
+ pauseMsAfter: this.resolvePauseMsFromUnits(i.get(b) || 0)
6840
6840
  });
6841
6841
  }
6842
- f = S;
6842
+ f = b;
6843
6843
  }
6844
- const b = t.substring(f).match(/^\s*/)?.[0].length || 0, h = f + b;
6844
+ const S = t.substring(f).match(/^\s*/)?.[0].length || 0, h = f + S;
6845
6845
  return h < t.length && u.push({
6846
6846
  text: t.substring(h).trimEnd(),
6847
6847
  startOffset: h,
6848
6848
  pauseMsAfter: 0
6849
- }), u.filter((S) => S.text.trim().length > 0);
6849
+ }), u.filter((b) => b.text.trim().length > 0);
6850
6850
  }
6851
6851
  async speakWithPlan(e, t, i) {
6852
6852
  if (!this.provider || e.length === 0)
@@ -6921,11 +6921,11 @@ class $c {
6921
6921
  throw new Error("TTS service not initialized");
6922
6922
  const i = ++this.speakRunId;
6923
6923
  if (t?.language) {
6924
- const p = this.ttsConfig.providerOptions || {}, b = p.textNormalization || {}, h = p.segmenter || {}, S = {
6925
- ...p,
6924
+ const m = this.ttsConfig.providerOptions || {}, S = m.textNormalization || {}, h = m.segmenter || {}, b = {
6925
+ ...m,
6926
6926
  locale: t.language,
6927
6927
  textNormalization: {
6928
- ...b,
6928
+ ...S,
6929
6929
  locale: t.language
6930
6930
  },
6931
6931
  segmenter: {
@@ -6935,18 +6935,18 @@ class $c {
6935
6935
  };
6936
6936
  this.ttsConfig = {
6937
6937
  ...this.ttsConfig,
6938
- providerOptions: S
6939
- }, "updateSettings" in this.provider && typeof this.provider.updateSettings == "function" && await this.provider.updateSettings({ providerOptions: S });
6938
+ providerOptions: b
6939
+ }, "updateSettings" in this.provider && typeof this.provider.updateSettings == "function" && await this.provider.updateSettings({ providerOptions: b });
6940
6940
  }
6941
6941
  const o = Er(e), r = t?.contentElement && this.extractVisibleText(t.contentElement, t.language) || o;
6942
6942
  let s = r, l = !1, c = "dom-or-input";
6943
6943
  if (t?.catalogId && this.catalogResolver) {
6944
- const p = this.catalogResolver.getAlternative(t.catalogId, {
6944
+ const m = this.catalogResolver.getAlternative(t.catalogId, {
6945
6945
  type: "spoken",
6946
6946
  language: t.language || "en-US",
6947
6947
  useFallback: !0
6948
6948
  });
6949
- p ? (s = p.content, l = !0, c = "catalog-spoken", console.debug(`[TTSService] Using catalog content for "${t.catalogId}" (${p.language})`)) : console.debug(`[TTSService] No catalog found for "${t.catalogId}", falling back to generated TTS`);
6949
+ m ? (s = m.content, l = !0, c = "catalog-spoken", console.debug(`[TTSService] Using catalog content for "${t.catalogId}" (${m.language})`)) : console.debug(`[TTSService] No catalog found for "${t.catalogId}", falling back to generated TTS`);
6950
6950
  }
6951
6951
  const d = s.replace(/\s+/g, " ").trim().slice(0, 200);
6952
6952
  console.debug("[TTSService] Speak resolved content", {
@@ -6957,29 +6957,29 @@ class $c {
6957
6957
  }), this.currentText = s, this.currentContentElement = t?.contentElement || null, this.lastError = null, this.currentBoundaryOffset = 0;
6958
6958
  const u = t?.highlightModeOverride || this.resolveHighlightMode(), f = !!this.currentContentElement && !l && !this.hasExplicitBreakSemantics(s);
6959
6959
  if (this.setState($e.LOADING), this.currentContentElement && this.highlightCoordinator && (this.buildPositionMap(this.currentContentElement, s, t?.language), !(u === "sentence" && f))) {
6960
- const p = document.createRange();
6961
- p.selectNodeContents(this.currentContentElement), this.highlightCoordinator.highlightTTSSentence([p]), console.log("[TTSService] Applied sentence-level highlighting");
6960
+ const m = document.createRange();
6961
+ m.selectNodeContents(this.currentContentElement), this.highlightCoordinator.highlightTTSSentence([m]), console.log("[TTSService] Applied sentence-level highlighting");
6962
6962
  }
6963
6963
  try {
6964
- if (u === "word" && this.highlightCoordinator && this.currentContentElement && (this.provider.onWordBoundary = (p, b, h) => {
6965
- const S = h || p.length, w = b + this.currentBoundaryOffset + (t?.wordBoundaryOffset || 0), g = this.findHighlightRange(w, S);
6966
- if (g && this.highlightCoordinator) {
6967
- const C = g.node.textContent?.substring(g.start, g.end) || "";
6968
- console.log(`[TTSService] Highlighting "${C}" (word: "${p}") at position ${w}`), this.highlightCoordinator.highlightTTSWord(g.node, g.start, g.end);
6964
+ if (u === "word" && this.highlightCoordinator && this.currentContentElement && (this.provider.onWordBoundary = (m, S, h) => {
6965
+ const b = h || m.length, w = S + this.currentBoundaryOffset + (t?.wordBoundaryOffset || 0), p = this.findHighlightRange(w, b);
6966
+ if (p && this.highlightCoordinator) {
6967
+ const C = p.node.textContent?.substring(p.start, p.end) || "";
6968
+ console.log(`[TTSService] Highlighting "${C}" (word: "${m}") at position ${w}`), this.highlightCoordinator.highlightTTSWord(p.node, p.start, p.end);
6969
6969
  } else
6970
- console.warn(`[TTSService] Could not find highlight range for position ${w}, length ${S}`);
6970
+ console.warn(`[TTSService] Could not find highlight range for position ${w}, length ${b}`);
6971
6971
  }), this.setState($e.PLAYING), f && this.currentContentElement) {
6972
- const p = this.createSpeechPlan(this.currentContentElement, r);
6973
- p.length > 0 ? await this.speakWithPlan(p, i, { highlightMode: u }) : await this.provider.speak(s);
6972
+ const m = this.createSpeechPlan(this.currentContentElement, r);
6973
+ m.length > 0 ? await this.speakWithPlan(m, i, { highlightMode: u }) : await this.provider.speak(s);
6974
6974
  } else
6975
6975
  await this.provider.speak(s);
6976
6976
  if (i !== this.speakRunId)
6977
6977
  return;
6978
6978
  this.setState($e.IDLE), this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0;
6979
- } catch (p) {
6980
- if (console.error("TTS error:", p), this.lastError = p instanceof Error ? p.message : String(p), i !== this.speakRunId)
6979
+ } catch (m) {
6980
+ if (console.error("TTS error:", m), this.lastError = m instanceof Error ? m.message : String(m), i !== this.speakRunId)
6981
6981
  return;
6982
- throw this.setState($e.ERROR), this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, p;
6982
+ throw this.setState($e.ERROR), this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, m;
6983
6983
  }
6984
6984
  }
6985
6985
  /**
@@ -7093,6 +7093,19 @@ class $c {
7093
7093
  }
7094
7094
  }
7095
7095
  }
7096
+ const Gc = [
7097
+ "item-selected",
7098
+ "item-session-data-changed",
7099
+ "item-session-meta-changed",
7100
+ "item-complete-changed",
7101
+ "content-loaded",
7102
+ "item-player-error"
7103
+ ], Yc = [
7104
+ "section-navigation-change",
7105
+ "section-loading-complete",
7106
+ "section-items-complete-changed",
7107
+ "section-error"
7108
+ ];
7096
7109
  class tr {
7097
7110
  constructor(e) {
7098
7111
  /** Assessment identifier (for scoping tool state) */
@@ -7198,7 +7211,7 @@ class tr {
7198
7211
  return `pie:section-controller:v1:${o}:${r}:${s || "default"}`;
7199
7212
  };
7200
7213
  return {
7201
- async load(i) {
7214
+ async loadSession(i) {
7202
7215
  if (!e)
7203
7216
  return null;
7204
7217
  const o = e.getItem(t(i));
@@ -7210,10 +7223,10 @@ class tr {
7210
7223
  return null;
7211
7224
  }
7212
7225
  },
7213
- async save(i, o) {
7226
+ async saveSession(i, o) {
7214
7227
  e && e.setItem(t(i), JSON.stringify(o));
7215
7228
  },
7216
- async clear(i) {
7229
+ async clearSession(i) {
7217
7230
  e && e.removeItem(t(i));
7218
7231
  }
7219
7232
  };
@@ -7224,7 +7237,7 @@ class tr {
7224
7237
  return i;
7225
7238
  const o = {
7226
7239
  createDefaultPersistence: () => this.createDefaultSectionPersistence()
7227
- }, r = await this.hooks.createSectionPersistence?.(e, o) ?? await o.createDefaultPersistence();
7240
+ }, r = await this.hooks.createSectionSessionPersistence?.(e, o) ?? await o.createDefaultPersistence();
7228
7241
  return this.sectionPersistenceStrategies.set(t, r), r;
7229
7242
  }
7230
7243
  setupStatePersistenceHooks() {
@@ -7342,38 +7355,82 @@ class tr {
7342
7355
  attemptId: e.attemptId
7343
7356
  });
7344
7357
  } catch (b) {
7345
- const h = b instanceof Error ? b.message : String(b);
7346
- if (e.sectionId !== void 0 && e.attemptId === void 0 && h.includes("subscribeSectionEvents is ambiguous for section"))
7347
- return console.warn(h), () => {
7358
+ const w = b instanceof Error ? b.message : String(b);
7359
+ if (e.sectionId !== void 0 && e.attemptId === void 0 && w.includes("subscribeSectionEvents is ambiguous for section"))
7360
+ return console.warn(w), () => {
7348
7361
  };
7349
7362
  throw b;
7350
7363
  }
7351
7364
  const i = t.controller, o = i.subscribe;
7352
7365
  if (!o) {
7353
- const b = this.sectionControllerKeys.get(t.mapKey), h = b?.sectionId || e.sectionId || "<unknown>", S = b?.attemptId || e.attemptId || "<default>";
7354
- throw new Error(`[ToolkitCoordinator] subscribeSectionEvents could not subscribe: resolved controller for section "${h}" attempt "${S}" does not expose subscribe().`);
7366
+ const b = this.sectionControllerKeys.get(t.mapKey), w = b?.sectionId || e.sectionId || "<unknown>", p = b?.attemptId || e.attemptId || "<default>";
7367
+ throw new Error(`[ToolkitCoordinator] subscribeSectionEvents could not subscribe: resolved controller for section "${w}" attempt "${p}" does not expose subscribe().`);
7355
7368
  }
7356
7369
  const { mapKey: r } = t;
7357
7370
  let s = this.sectionEventListenerIds.get(e.listener);
7358
7371
  s || (s = this.nextSectionEventListenerId++, this.sectionEventListenerIds.set(e.listener, s));
7359
7372
  const l = `${r}::${s}`;
7360
7373
  this.sectionEventSubscriptions.get(l)?.();
7361
- const d = e.eventTypes ? new Set(e.eventTypes) : null, u = e.itemIds ? new Set(e.itemIds) : null, f = o.call(i, (b) => {
7374
+ const d = e.eventTypes ? new Set(e.eventTypes) : null, u = e.itemIds ? new Set(e.itemIds) : null, f = (b) => {
7362
7375
  if (d || u) {
7363
- const h = b?.type || null;
7364
- if (d && (!h || !d.has(h)))
7365
- return;
7376
+ const w = b?.type || null;
7377
+ if (d && (!w || !d.has(w)))
7378
+ return !1;
7366
7379
  if (u) {
7367
- const S = /* @__PURE__ */ new Set();
7368
- if ("itemId" in b && typeof b.itemId == "string" && S.add(b.itemId), "canonicalItemId" in b && typeof b.canonicalItemId == "string" && S.add(b.canonicalItemId), "currentItemId" in b && typeof b.currentItemId == "string" && S.add(b.currentItemId), "previousItemId" in b && typeof b.previousItemId == "string" && S.add(b.previousItemId), !Array.from(S).some((g) => u.has(g)))
7369
- return;
7380
+ const p = /* @__PURE__ */ new Set();
7381
+ if ("itemId" in b && typeof b.itemId == "string" && p.add(b.itemId), "canonicalItemId" in b && typeof b.canonicalItemId == "string" && p.add(b.canonicalItemId), "currentItemId" in b && typeof b.currentItemId == "string" && p.add(b.currentItemId), "previousItemId" in b && typeof b.previousItemId == "string" && p.add(b.previousItemId), !Array.from(p).some((R) => u.has(R)))
7382
+ return !1;
7370
7383
  }
7371
7384
  }
7372
- e.listener(b);
7373
- }), p = () => {
7374
- this.sectionEventSubscriptions.get(l) === p && (this.sectionEventSubscriptions.delete(l), f());
7385
+ return !0;
7386
+ }, m = o.call(i, (b) => {
7387
+ f(b) && e.listener(b);
7388
+ }), S = i.getRuntimeState?.();
7389
+ if (S?.loadingComplete && S.totalRegistered > 0 && S.totalLoaded >= S.totalRegistered) {
7390
+ const b = {
7391
+ type: "section-loading-complete",
7392
+ totalRegistered: S.totalRegistered,
7393
+ totalLoaded: S.totalLoaded,
7394
+ currentItemIndex: S.currentItemIndex,
7395
+ timestamp: Date.now()
7396
+ };
7397
+ f(b) && e.listener(b);
7398
+ }
7399
+ const h = () => {
7400
+ this.sectionEventSubscriptions.get(l) === h && (this.sectionEventSubscriptions.delete(l), m());
7375
7401
  };
7376
- return this.sectionEventSubscriptions.set(l, p), p;
7402
+ return this.sectionEventSubscriptions.set(l, h), h;
7403
+ }
7404
+ /**
7405
+ * Subscribe to item-scoped controller events.
7406
+ *
7407
+ * Prefer this helper for answer/session/navigation events tied to item IDs.
7408
+ * Use `subscribeSectionEvents` directly only when you need mixed item+section
7409
+ * filtering behavior.
7410
+ */
7411
+ subscribeItemEvents(e) {
7412
+ return this.subscribeSectionEvents({
7413
+ sectionId: e.sectionId,
7414
+ attemptId: e.attemptId,
7415
+ eventTypes: e.eventTypes || Gc,
7416
+ itemIds: e.itemIds,
7417
+ listener: e.listener
7418
+ });
7419
+ }
7420
+ /**
7421
+ * Subscribe to section-scoped controller events.
7422
+ *
7423
+ * Prefer this helper for section lifecycle/loading/completion/error state.
7424
+ * Section-scoped events do not carry item identifiers, so this helper
7425
+ * intentionally does not expose `itemIds` filtering.
7426
+ */
7427
+ subscribeSectionLifecycleEvents(e) {
7428
+ return this.subscribeSectionEvents({
7429
+ sectionId: e.sectionId,
7430
+ attemptId: e.attemptId,
7431
+ eventTypes: e.eventTypes || Yc,
7432
+ listener: e.listener
7433
+ });
7377
7434
  }
7378
7435
  resolveSectionControllerForSubscription(e) {
7379
7436
  if (e.sectionId) {
@@ -7434,7 +7491,10 @@ class tr {
7434
7491
  }, c = await this.resolveSectionPersistence(l), d = {
7435
7492
  createDefaultController: e.createDefaultController
7436
7493
  }, u = await this.hooks.createSectionController?.(l, d) ?? await d.createDefaultController();
7437
- return await u.setPersistenceStrategy?.(c), await u.setPersistenceContext?.(l), await u.initialize?.(e.input), await u.hydrate?.(), this.sectionControllers.set(i, u), this.sectionControllerKeys.set(i, t), this.emitSectionControllerLifecycle({
7494
+ return await u.configureSessionPersistence?.({
7495
+ strategy: c,
7496
+ context: l
7497
+ }), await u.initialize?.(e.input), await u.hydrate?.(), this.sectionControllers.set(i, u), this.sectionControllerKeys.set(i, t), this.emitSectionControllerLifecycle({
7438
7498
  type: "ready",
7439
7499
  key: t,
7440
7500
  controller: u
@@ -7489,7 +7549,7 @@ class tr {
7489
7549
  this.sectionControllers.delete(i), this.sectionControllerKeys.delete(i), this.emitSectionControllerLifecycle({
7490
7550
  type: "disposed",
7491
7551
  key: t
7492
- }), e.clearPersistence && await this.sectionPersistenceStrategies.get(i)?.clear?.(s), this.sectionPersistenceStrategies.delete(i);
7552
+ }), e.clearPersistence && await this.sectionPersistenceStrategies.get(i)?.clearSession?.(s), this.sectionPersistenceStrategies.delete(i);
7493
7553
  }
7494
7554
  }
7495
7555
  /**
@@ -7698,14 +7758,14 @@ class tr {
7698
7758
  e && await this.registerProviderFromTool(e);
7699
7759
  }
7700
7760
  }
7701
- const Gc = 1;
7761
+ const Xc = 1;
7702
7762
  function $s() {
7703
7763
  return (/* @__PURE__ */ new Date()).toISOString();
7704
7764
  }
7705
- function Yc(n) {
7765
+ function Jc(n) {
7706
7766
  const e = $s();
7707
7767
  return {
7708
- version: Gc,
7768
+ version: Xc,
7709
7769
  testAttemptSessionIdentifier: n.testAttemptSessionIdentifier,
7710
7770
  assessmentId: n.assessmentId,
7711
7771
  startedAt: e,
@@ -7721,7 +7781,7 @@ function Yc(n) {
7721
7781
  itemSessions: {}
7722
7782
  };
7723
7783
  }
7724
- function Xc(n, e) {
7784
+ function Zc(n, e) {
7725
7785
  if (!e)
7726
7786
  return n;
7727
7787
  const t = new Set(n.navigationState.visitedItemIdentifiers || []);
@@ -7733,7 +7793,7 @@ function Xc(n, e) {
7733
7793
  }
7734
7794
  };
7735
7795
  }
7736
- function Jc(n, e) {
7796
+ function Qc(n, e) {
7737
7797
  return {
7738
7798
  ...n,
7739
7799
  navigationState: {
@@ -7743,7 +7803,7 @@ function Jc(n, e) {
7743
7803
  }
7744
7804
  };
7745
7805
  }
7746
- function Zc(n, e) {
7806
+ function ed(n, e) {
7747
7807
  const { itemIdentifier: t, pieSessionId: i, isCompleted: o } = e;
7748
7808
  if (!t || !i)
7749
7809
  return n;
@@ -7768,11 +7828,11 @@ function Zc(n, e) {
7768
7828
  function Ro(n) {
7769
7829
  return Object.entries(n.itemSessions).reduce((e, [t, i]) => (i.session && (e[t] = i.session), e), {});
7770
7830
  }
7771
- function Qc(n, e = "iife") {
7831
+ function td(n, e = "iife") {
7772
7832
  return n === "iife" || n === "esm" || n === "preloaded" ? n : e;
7773
7833
  }
7774
- const ed = "";
7775
- function td(n, e) {
7834
+ const nd = "";
7835
+ function id(n, e) {
7776
7836
  if (!n && !e)
7777
7837
  return !0;
7778
7838
  if (!n || !e || (n.id || "") !== (e.id || ""))
@@ -7783,7 +7843,7 @@ function td(n, e) {
7783
7843
  return !1;
7784
7844
  }
7785
7845
  }
7786
- function xo(n, e = ed) {
7846
+ function xo(n, e = nd) {
7787
7847
  if (n && typeof n == "object") {
7788
7848
  const t = n;
7789
7849
  return Array.isArray(t.data) ? {
@@ -7793,7 +7853,7 @@ function xo(n, e = ed) {
7793
7853
  }
7794
7854
  return Array.isArray(n) ? { id: e, data: n } : { id: e, data: [] };
7795
7855
  }
7796
- function nd(n, e, t, i) {
7856
+ function od(n, e, t, i) {
7797
7857
  const o = xo(e, n), r = [...o.data], s = r.findIndex((l) => !l || typeof l != "object" ? !1 : l.id === t);
7798
7858
  if (s >= 0) {
7799
7859
  const l = r[s];
@@ -7817,8 +7877,8 @@ function Gs(n) {
7817
7877
  };
7818
7878
  const o = t;
7819
7879
  if (Array.isArray(o.data)) {
7820
- const u = xo(o, i), f = n.previousItemSession !== void 0 ? xo(n.previousItemSession, i) : null, p = Object.keys(e);
7821
- return p.length > 0 && p.every((h) => h === "session" || h === "complete" || h === "component" || h === "timestamp" || h === "sourceRuntimeId") && f && td(u, f) ? {
7880
+ const u = xo(o, i), f = n.previousItemSession !== void 0 ? xo(n.previousItemSession, i) : null, m = Object.keys(e);
7881
+ return m.length > 0 && m.every((h) => h === "session" || h === "complete" || h === "component" || h === "timestamp" || h === "sourceRuntimeId") && f && id(u, f) ? {
7822
7882
  itemId: i,
7823
7883
  session: null,
7824
7884
  intent: "metadata-only",
@@ -7841,7 +7901,7 @@ function Gs(n) {
7841
7901
  component: typeof e.component == "string" ? e.component : void 0,
7842
7902
  complete: typeof e.complete == "boolean" ? e.complete : void 0
7843
7903
  };
7844
- const l = typeof e.component == "string" ? e.component : typeof o.component == "string" ? o.component : "response", c = typeof o.id == "string" && o.id ? o.id : l, d = nd(i, n.previousItemSession, c, { id: c, ...o });
7904
+ const l = typeof e.component == "string" ? e.component : typeof o.component == "string" ? o.component : "response", c = typeof o.id == "string" && o.id ? o.id : l, d = od(i, n.previousItemSession, c, { id: c, ...o });
7845
7905
  return {
7846
7906
  itemId: i,
7847
7907
  session: d,
@@ -7851,24 +7911,24 @@ function Gs(n) {
7851
7911
  };
7852
7912
  }
7853
7913
  const Pr = /* @__PURE__ */ new Map();
7854
- var id = /* @__PURE__ */ ve('<div class="pie-item-shell-anchor svelte-ljk393" aria-hidden="true"></div> <!>', 1);
7855
- const od = {
7914
+ var rd = /* @__PURE__ */ ve('<div class="pie-item-shell-anchor svelte-ljk393" aria-hidden="true"></div> <!>', 1);
7915
+ const sd = {
7856
7916
  hash: "svelte-ljk393",
7857
7917
  code: ".pie-item-shell-anchor.svelte-ljk393 {display:none;}"
7858
7918
  };
7859
- function rd(n, e) {
7860
- Be(e, !0), et(n, od);
7919
+ function ad(n, e) {
7920
+ Be(e, !0), et(n, sd);
7861
7921
  const t = "pie-content-loaded", i = "pie-item-player-error";
7862
7922
  let o = y(e, "itemId", 7, ""), r = y(e, "canonicalItemId", 7, ""), s = y(e, "contentKind", 7, "assessment-item"), l = y(e, "regionPolicy", 7, "default"), c = y(e, "scopeElement", 7, null), d = y(e, "item", 7, null), u = /* @__PURE__ */ U(null);
7863
7923
  const f = Date.now();
7864
- let p = null, b = null, h = null, S = null;
7924
+ let m = null, S = null, h = null, b = null;
7865
7925
  function w() {
7866
7926
  if (!a(u)) return null;
7867
7927
  const j = a(u).getRootNode();
7868
7928
  return j && "host" in j ? j.host : a(u).parentElement;
7869
7929
  }
7870
- const g = /* @__PURE__ */ N(() => w()), C = /* @__PURE__ */ N(() => c() || a(g) || null), x = /* @__PURE__ */ N(() => a(C) ? { scopeElement: a(C) } : null), O = /* @__PURE__ */ N(() => {
7871
- if (!a(g)) return null;
7930
+ const p = /* @__PURE__ */ N(() => w()), C = /* @__PURE__ */ N(() => c() || a(p) || null), R = /* @__PURE__ */ N(() => a(C) ? { scopeElement: a(C) } : null), O = /* @__PURE__ */ N(() => {
7931
+ if (!a(p)) return null;
7872
7932
  const j = r() || o();
7873
7933
  return {
7874
7934
  kind: "item",
@@ -7882,21 +7942,21 @@ function rd(n, e) {
7882
7942
  };
7883
7943
  });
7884
7944
  function _(j) {
7885
- if (!a(g) || !o()) return;
7945
+ if (!a(p) || !o()) return;
7886
7946
  const G = {
7887
7947
  kind: "item",
7888
7948
  itemId: o(),
7889
7949
  canonicalItemId: r() || o(),
7890
7950
  contentKind: s(),
7891
7951
  item: d(),
7892
- element: a(g)
7952
+ element: a(p)
7893
7953
  };
7894
- Wt(a(g), j, G);
7954
+ Wt(a(p), j, G);
7895
7955
  }
7896
7956
  function H(j) {
7897
- if (!a(g) || !o()) return;
7957
+ if (!a(p) || !o()) return;
7898
7958
  const G = j.detail, ye = { itemId: o(), session: G };
7899
- Wt(a(g), ko, ye);
7959
+ Wt(a(p), ko, ye);
7900
7960
  const me = Gs({ itemId: o(), sessionDetail: G });
7901
7961
  if (me.intent === "metadata-only" || !me.session)
7902
7962
  return;
@@ -7905,27 +7965,27 @@ function rd(n, e) {
7905
7965
  canonicalItemId: r() || o(),
7906
7966
  session: me.session
7907
7967
  };
7908
- Wt(a(g), Zl, he);
7968
+ Wt(a(p), Zl, he);
7909
7969
  }
7910
- function R(j) {
7911
- if (!a(g) || !o()) return;
7970
+ function x(j) {
7971
+ if (!a(p) || !o()) return;
7912
7972
  const G = {
7913
7973
  itemId: o(),
7914
7974
  canonicalItemId: r() || o(),
7915
7975
  contentKind: s(),
7916
7976
  detail: j
7917
7977
  };
7918
- Wt(a(g), t, G);
7978
+ Wt(a(p), t, G);
7919
7979
  }
7920
7980
  function D(j) {
7921
- if (!a(g) || !o()) return;
7981
+ if (!a(p) || !o()) return;
7922
7982
  const G = {
7923
7983
  itemId: o(),
7924
7984
  canonicalItemId: r() || o(),
7925
7985
  contentKind: s(),
7926
7986
  error: j
7927
7987
  };
7928
- Wt(a(g), i, G);
7988
+ Wt(a(p), i, G);
7929
7989
  }
7930
7990
  function K(j) {
7931
7991
  const G = j && typeof j == "object" ? { ...j } : j;
@@ -7937,7 +7997,7 @@ function rd(n, e) {
7937
7997
  }
7938
7998
  }
7939
7999
  se(() => {
7940
- if (!a(g)) return;
8000
+ if (!a(p)) return;
7941
8001
  _(zi);
7942
8002
  const j = /* @__PURE__ */ new WeakSet();
7943
8003
  let G = "";
@@ -7949,37 +8009,37 @@ function rd(n, e) {
7949
8009
  const M = o() || r() || "__unknown-item__", te = Date.now(), z = Pr.get(M);
7950
8010
  z && z.fingerprint === Y && te - z.timestamp < ye || (Pr.set(M, { fingerprint: Y, timestamp: te }), G = Y, H(ae));
7951
8011
  };
7952
- a(g).addEventListener("sessionchanged", me), a(g).addEventListener("session-changed", me);
8012
+ a(p).addEventListener("sessionchanged", me), a(p).addEventListener("session-changed", me);
7953
8013
  const he = (ae) => {
7954
- ae.stopPropagation(), R(ae.detail);
8014
+ ae.stopPropagation(), x(ae.detail);
7955
8015
  }, ue = (ae) => {
7956
8016
  ae.stopPropagation(), D(ae.detail);
7957
8017
  };
7958
- return a(g).addEventListener("load-complete", he), a(g).addEventListener("player-error", ue), () => {
7959
- a(g)?.removeEventListener("sessionchanged", me), a(g)?.removeEventListener("session-changed", me), a(g)?.removeEventListener("load-complete", he), a(g)?.removeEventListener("player-error", ue), _(Di);
8018
+ return a(p).addEventListener("load-complete", he), a(p).addEventListener("player-error", ue), () => {
8019
+ a(p)?.removeEventListener("sessionchanged", me), a(p)?.removeEventListener("session-changed", me), a(p)?.removeEventListener("load-complete", he), a(p)?.removeEventListener("player-error", ue), _(Di);
7960
8020
  };
7961
8021
  }), se(() => {
7962
- a(g) && (a(g).setAttribute("data-item-id", o()), a(g).setAttribute("data-canonical-item-id", r() || o()), a(g).setAttribute("data-pie-shell-root", "item"), a(g).setAttribute("data-region-policy", l()));
8022
+ a(p) && (a(p).setAttribute("data-item-id", o()), a(p).setAttribute("data-canonical-item-id", r() || o()), a(p).setAttribute("data-pie-shell-root", "item"), a(p).setAttribute("data-region-policy", l()));
7963
8023
  }), se(() => {
7964
- if (!(!a(g) || !a(O)))
7965
- return p = new Mn(a(g), {
8024
+ if (!(!a(p) || !a(O)))
8025
+ return m = new Mn(a(p), {
7966
8026
  context: zs,
7967
8027
  initialValue: a(O)
7968
- }), p.connect(), b = new Nn(a(g)), b.attach(), () => {
7969
- b?.detach(), b = null, p?.disconnect(), p = null;
8028
+ }), m.connect(), S = new Nn(a(p)), S.attach(), () => {
8029
+ S?.detach(), S = null, m?.disconnect(), m = null;
7970
8030
  };
7971
8031
  }), se(() => {
7972
- a(O) && p?.setValue(a(O));
8032
+ a(O) && m?.setValue(a(O));
7973
8033
  }), se(() => {
7974
- if (!(!a(g) || !a(x)))
7975
- return h = new Mn(a(g), {
8034
+ if (!(!a(p) || !a(R)))
8035
+ return h = new Mn(a(p), {
7976
8036
  context: Ds,
7977
- initialValue: a(x)
7978
- }), h.connect(), S = new Nn(a(g)), S.attach(), () => {
7979
- S?.detach(), S = null, h?.disconnect(), h = null;
8037
+ initialValue: a(R)
8038
+ }), h.connect(), b = new Nn(a(p)), b.attach(), () => {
8039
+ b?.detach(), b = null, h?.disconnect(), h = null;
7980
8040
  };
7981
8041
  }), se(() => {
7982
- a(x) && h?.setValue(a(x));
8042
+ a(R) && h?.setValue(a(R));
7983
8043
  });
7984
8044
  var J = {
7985
8045
  get itemId() {
@@ -8018,13 +8078,13 @@ function rd(n, e) {
8018
8078
  set item(j = null) {
8019
8079
  d(j), v();
8020
8080
  }
8021
- }, L = id(), P = vt(L);
8081
+ }, L = rd(), P = vt(L);
8022
8082
  at(P, (j) => F(u, j), () => a(u));
8023
8083
  var W = Pe(P, 2);
8024
8084
  return Hn(W, e, "default", {}), fe(n, L), He(J);
8025
8085
  }
8026
8086
  customElements.define("pie-item-shell", Ke(
8027
- rd,
8087
+ ad,
8028
8088
  {
8029
8089
  itemId: { attribute: "item-id", type: "String" },
8030
8090
  canonicalItemId: { attribute: "canonical-item-id", type: "String" },
@@ -8037,7 +8097,7 @@ customElements.define("pie-item-shell", Ke(
8037
8097
  [],
8038
8098
  { mode: "open" }
8039
8099
  ));
8040
- const sd = { id: "", data: [] }, nr = {
8100
+ const ld = { id: "", data: [] }, nr = {
8041
8101
  section: null,
8042
8102
  assessmentItemRefs: [],
8043
8103
  passages: [],
@@ -8056,14 +8116,14 @@ function Bi(n) {
8056
8116
  const e = n?.title;
8057
8117
  return typeof e == "string" ? e.trim() : "";
8058
8118
  }
8059
- function ad(n, e) {
8119
+ function cd(n, e) {
8060
8120
  return Ys(n, e)?.canonicalItemId || "";
8061
8121
  }
8062
- function ld(n, e) {
8122
+ function dd(n, e) {
8063
8123
  return Ys(n, e)?.session;
8064
8124
  }
8065
- function cd(n, e) {
8066
- return ld(n, e) || sd;
8125
+ function ud(n, e) {
8126
+ return dd(n, e) || ld;
8067
8127
  }
8068
8128
  function Ys(n, e) {
8069
8129
  const t = e.id || "";
@@ -8078,7 +8138,7 @@ function ir(n) {
8078
8138
  const e = n.getRootNode();
8079
8139
  return e && "host" in e ? e.host : n.parentElement;
8080
8140
  }
8081
- function dd(n, e, t) {
8141
+ function fd(n, e, t) {
8082
8142
  let i = !1;
8083
8143
  const o = new Ns(n, {
8084
8144
  context: e,
@@ -8105,13 +8165,13 @@ function dd(n, e, t) {
8105
8165
  };
8106
8166
  }
8107
8167
  function Js(n, e) {
8108
- return dd(
8168
+ return fd(
8109
8169
  n,
8110
8170
  Xs,
8111
8171
  e
8112
8172
  );
8113
8173
  }
8114
- function ud(n, e) {
8174
+ function hd(n, e) {
8115
8175
  const t = new Mn(n, {
8116
8176
  context: Xs,
8117
8177
  initialValue: e
@@ -8125,27 +8185,27 @@ function ud(n, e) {
8125
8185
  }
8126
8186
  };
8127
8187
  }
8128
- var fd = /* @__PURE__ */ ve('<h2 class="svelte-7chqkg"> </h2>'), hd = /* @__PURE__ */ ve('<div class="pie-section-player-item-card-anchor svelte-7chqkg" aria-hidden="true"></div> <pie-item-shell><div class="pie-section-player-content-card svelte-7chqkg"><div class="pie-section-player-content-card-header pie-section-player-item-header pie-section-player__item-header svelte-7chqkg" data-region="header"><!> <pie-item-toolbar></pie-item-toolbar></div> <div class="pie-section-player-content-card-body pie-section-player-item-content pie-section-player__item-content svelte-7chqkg" data-region="content"><!></div> <div data-region="footer"></div></div></pie-item-shell>', 3);
8129
- const pd = {
8188
+ var pd = /* @__PURE__ */ ve('<h2 class="svelte-7chqkg"> </h2>'), md = /* @__PURE__ */ ve('<div class="pie-section-player-item-card-anchor svelte-7chqkg" aria-hidden="true"></div> <pie-item-shell><div class="pie-section-player-content-card svelte-7chqkg"><div class="pie-section-player-content-card-header pie-section-player-item-header pie-section-player__item-header svelte-7chqkg" data-region="header"><!> <pie-item-toolbar></pie-item-toolbar></div> <div class="pie-section-player-content-card-body pie-section-player-item-content pie-section-player__item-content svelte-7chqkg" data-region="content"><!></div> <div data-region="footer"></div></div></pie-item-shell>', 3);
8189
+ const gd = {
8130
8190
  hash: "svelte-7chqkg",
8131
8191
  code: ".pie-section-player-item-card-anchor.svelte-7chqkg {display:none;}.pie-section-player-content-card.svelte-7chqkg {border:1px solid var(--pie-border-light, #e5e7eb);border-radius:8px;background:var(--pie-background, #fff);color:var(--pie-text, #111827);}.pie-section-player-content-card-header.svelte-7chqkg {display:flex;align-items:center;gap:0.75rem;padding:0.75rem 1rem;border-bottom:1px solid var(--pie-border-light, #e5e7eb);}.pie-section-player-content-card-header.svelte-7chqkg h2:where(.svelte-7chqkg) {margin:0;font-size:0.95rem;font-weight:600;color:var(--pie-text, #111827);}.pie-section-player-content-card-header.svelte-7chqkg pie-item-toolbar:where(.svelte-7chqkg) {margin-left:auto;}.pie-section-player-content-card-body.svelte-7chqkg {padding:1rem;color:var(--pie-text, #111827);}"
8132
8192
  };
8133
- function md(n, e) {
8134
- Be(e, !0), et(n, pd);
8193
+ function vd(n, e) {
8194
+ Be(e, !0), et(n, gd);
8135
8195
  let t = y(e, "item", 7), i = y(e, "canonicalItemId", 7), o = y(e, "resolvedPlayerTag", 7, "div"), r = y(e, "playerAction", 7, (P, W) => {
8136
8196
  }), s = y(e, "playerParams", 7), l = y(e, "itemToolbarTools", 7), c = /* @__PURE__ */ U(null), d = /* @__PURE__ */ U(null), u = /* @__PURE__ */ U(null), f = /* @__PURE__ */ U(!1);
8137
- const p = /* @__PURE__ */ N(() => (a(f) ? a(d) : null) || o()), b = /* @__PURE__ */ N(() => (a(f) ? a(u) : null) || r());
8197
+ const m = /* @__PURE__ */ N(() => (a(f) ? a(d) : null) || o()), S = /* @__PURE__ */ N(() => (a(f) ? a(u) : null) || r());
8138
8198
  function h() {
8139
8199
  F(f, !1), F(d, null), F(u, null);
8140
8200
  }
8141
- function S(P) {
8201
+ function b(P) {
8142
8202
  !P || typeof P != "object" || (typeof P.resolvedPlayerTag == "string" && P.resolvedPlayerTag.trim() && F(d, P.resolvedPlayerTag, !0), typeof P.playerAction == "function" && F(u, P.playerAction, !0));
8143
8203
  }
8144
8204
  Zo(() => {
8145
8205
  const P = ir(a(c));
8146
8206
  if (!P) return;
8147
8207
  F(f, !0);
8148
- const W = Js(P, S);
8208
+ const W = Js(P, b);
8149
8209
  return () => {
8150
8210
  W(), h();
8151
8211
  };
@@ -8188,29 +8248,29 @@ function md(n, e) {
8188
8248
  set itemToolbarTools(P) {
8189
8249
  l(P), v();
8190
8250
  }
8191
- }, g = hd(), C = vt(g);
8251
+ }, p = md(), C = vt(p);
8192
8252
  at(C, (P) => F(c, P), () => a(c));
8193
- var x = Pe(C, 2);
8194
- k(() => E(x, "item-id", t().id)), k(() => E(x, "canonical-item-id", i())), E(x, "content-kind", "assessment-item"), k(() => E(x, "item", t()));
8195
- var O = Se(x), _ = Se(O), H = Se(_);
8253
+ var R = Pe(C, 2);
8254
+ k(() => E(R, "item-id", t().id)), k(() => E(R, "canonical-item-id", i())), E(R, "content-kind", "assessment-item"), k(() => E(R, "item", t()));
8255
+ var O = Se(R), _ = Se(O), H = Se(_);
8196
8256
  {
8197
- var R = (P) => {
8198
- var W = fd(), j = Se(W, !0);
8257
+ var x = (P) => {
8258
+ var W = pd(), j = Se(W, !0);
8199
8259
  Ie(W), k((G) => Es(j, G), [() => Bi(t())]), fe(P, W);
8200
8260
  }, D = /* @__PURE__ */ N(() => Bi(t()));
8201
8261
  st(H, (P) => {
8202
- a(D) && P(R);
8262
+ a(D) && P(x);
8203
8263
  });
8204
8264
  }
8205
8265
  var K = Pe(H, 2);
8206
8266
  k(() => E(K, "item-id", t().id)), k(() => E(K, "catalog-id", t().id)), k(() => E(K, "tools", l())), E(K, "content-kind", "assessment-item"), E(K, "size", "md"), E(K, "language", "en-US"), wt(K, 1, "svelte-7chqkg"), Ie(_);
8207
8267
  var J = Pe(_, 2), L = Se(J);
8208
- return xs(L, () => a(p), !1, (P, W) => {
8209
- Ls(P, (j, G) => a(b)?.(j, G), s);
8210
- }), Ie(J), Hr(2), Ie(O), Ie(x), fe(n, g), He(w);
8268
+ return xs(L, () => a(m), !1, (P, W) => {
8269
+ Ls(P, (j, G) => a(S)?.(j, G), s);
8270
+ }), Ie(J), Hr(2), Ie(O), Ie(R), fe(n, p), He(w);
8211
8271
  }
8212
8272
  customElements.define("pie-section-player-item-card", Ke(
8213
- md,
8273
+ vd,
8214
8274
  {
8215
8275
  item: { type: "Object" },
8216
8276
  canonicalItemId: { attribute: "canonical-item-id", type: "String" },
@@ -8222,24 +8282,24 @@ customElements.define("pie-section-player-item-card", Ke(
8222
8282
  [],
8223
8283
  []
8224
8284
  ));
8225
- var gd = /* @__PURE__ */ ve('<div class="pie-passage-shell-anchor svelte-16sht1m" aria-hidden="true"></div> <!>', 1);
8226
- const vd = {
8285
+ var yd = /* @__PURE__ */ ve('<div class="pie-passage-shell-anchor svelte-16sht1m" aria-hidden="true"></div> <!>', 1);
8286
+ const bd = {
8227
8287
  hash: "svelte-16sht1m",
8228
8288
  code: ".pie-passage-shell-anchor.svelte-16sht1m {display:none;}"
8229
8289
  };
8230
- function yd(n, e) {
8231
- Be(e, !0), et(n, vd);
8290
+ function Id(n, e) {
8291
+ Be(e, !0), et(n, bd);
8232
8292
  const t = "pie-content-loaded", i = "pie-item-player-error";
8233
8293
  let o = y(e, "itemId", 7, ""), r = y(e, "canonicalItemId", 7, ""), s = y(e, "contentKind", 7, "rubric-block-stimulus"), l = y(e, "regionPolicy", 7, "default"), c = y(e, "scopeElement", 7, null), d = y(e, "item", 7, null), u = /* @__PURE__ */ U(null);
8234
8294
  const f = Date.now();
8235
- let p = null, b = null, h = null, S = null;
8295
+ let m = null, S = null, h = null, b = null;
8236
8296
  function w() {
8237
8297
  if (!a(u)) return null;
8238
8298
  const P = a(u).getRootNode();
8239
8299
  return P && "host" in P ? P.host : a(u).parentElement;
8240
8300
  }
8241
- const g = /* @__PURE__ */ N(() => w()), C = /* @__PURE__ */ N(() => c() || a(g) || null), x = /* @__PURE__ */ N(() => a(C) ? { scopeElement: a(C) } : null), O = /* @__PURE__ */ N(() => {
8242
- if (!a(g)) return null;
8301
+ const p = /* @__PURE__ */ N(() => w()), C = /* @__PURE__ */ N(() => c() || a(p) || null), R = /* @__PURE__ */ N(() => a(C) ? { scopeElement: a(C) } : null), O = /* @__PURE__ */ N(() => {
8302
+ if (!a(p)) return null;
8243
8303
  const P = r() || o();
8244
8304
  return {
8245
8305
  kind: "passage",
@@ -8253,70 +8313,70 @@ function yd(n, e) {
8253
8313
  };
8254
8314
  });
8255
8315
  function _(P) {
8256
- if (!a(g) || !o()) return;
8316
+ if (!a(p) || !o()) return;
8257
8317
  const W = {
8258
8318
  kind: "passage",
8259
8319
  itemId: o(),
8260
8320
  canonicalItemId: r() || o(),
8261
8321
  contentKind: s(),
8262
8322
  item: d(),
8263
- element: a(g)
8323
+ element: a(p)
8264
8324
  };
8265
- Wt(a(g), P, W);
8325
+ Wt(a(p), P, W);
8266
8326
  }
8267
8327
  function H(P) {
8268
- if (!a(g) || !o()) return;
8328
+ if (!a(p) || !o()) return;
8269
8329
  const W = {
8270
8330
  itemId: o(),
8271
8331
  canonicalItemId: r() || o(),
8272
8332
  contentKind: s(),
8273
8333
  detail: P
8274
8334
  };
8275
- Wt(a(g), t, W);
8335
+ Wt(a(p), t, W);
8276
8336
  }
8277
- function R(P) {
8278
- if (!a(g) || !o()) return;
8337
+ function x(P) {
8338
+ if (!a(p) || !o()) return;
8279
8339
  const W = {
8280
8340
  itemId: o(),
8281
8341
  canonicalItemId: r() || o(),
8282
8342
  contentKind: s(),
8283
8343
  error: P
8284
8344
  };
8285
- Wt(a(g), i, W);
8345
+ Wt(a(p), i, W);
8286
8346
  }
8287
8347
  se(() => {
8288
- if (!a(g)) return;
8348
+ if (!a(p)) return;
8289
8349
  _(zi);
8290
8350
  const P = (j) => {
8291
8351
  j.stopPropagation(), H(j.detail);
8292
8352
  }, W = (j) => {
8293
- j.stopPropagation(), R(j.detail);
8353
+ j.stopPropagation(), x(j.detail);
8294
8354
  };
8295
- return a(g).addEventListener("load-complete", P), a(g).addEventListener("player-error", W), () => {
8296
- a(g)?.removeEventListener("load-complete", P), a(g)?.removeEventListener("player-error", W), _(Di);
8355
+ return a(p).addEventListener("load-complete", P), a(p).addEventListener("player-error", W), () => {
8356
+ a(p)?.removeEventListener("load-complete", P), a(p)?.removeEventListener("player-error", W), _(Di);
8297
8357
  };
8298
8358
  }), se(() => {
8299
- a(g) && (a(g).setAttribute("data-item-id", o()), a(g).setAttribute("data-canonical-item-id", r() || o()), a(g).setAttribute("data-pie-shell-root", "passage"), a(g).setAttribute("data-region-policy", l()));
8359
+ a(p) && (a(p).setAttribute("data-item-id", o()), a(p).setAttribute("data-canonical-item-id", r() || o()), a(p).setAttribute("data-pie-shell-root", "passage"), a(p).setAttribute("data-region-policy", l()));
8300
8360
  }), se(() => {
8301
- if (!(!a(g) || !a(O)))
8302
- return p = new Mn(a(g), {
8361
+ if (!(!a(p) || !a(O)))
8362
+ return m = new Mn(a(p), {
8303
8363
  context: zs,
8304
8364
  initialValue: a(O)
8305
- }), p.connect(), b = new Nn(a(g)), b.attach(), () => {
8306
- b?.detach(), b = null, p?.disconnect(), p = null;
8365
+ }), m.connect(), S = new Nn(a(p)), S.attach(), () => {
8366
+ S?.detach(), S = null, m?.disconnect(), m = null;
8307
8367
  };
8308
8368
  }), se(() => {
8309
- a(O) && p?.setValue(a(O));
8369
+ a(O) && m?.setValue(a(O));
8310
8370
  }), se(() => {
8311
- if (!(!a(g) || !a(x)))
8312
- return h = new Mn(a(g), {
8371
+ if (!(!a(p) || !a(R)))
8372
+ return h = new Mn(a(p), {
8313
8373
  context: Ds,
8314
- initialValue: a(x)
8315
- }), h.connect(), S = new Nn(a(g)), S.attach(), () => {
8316
- S?.detach(), S = null, h?.disconnect(), h = null;
8374
+ initialValue: a(R)
8375
+ }), h.connect(), b = new Nn(a(p)), b.attach(), () => {
8376
+ b?.detach(), b = null, h?.disconnect(), h = null;
8317
8377
  };
8318
8378
  }), se(() => {
8319
- a(x) && h?.setValue(a(x));
8379
+ a(R) && h?.setValue(a(R));
8320
8380
  });
8321
8381
  var D = {
8322
8382
  get itemId() {
@@ -8355,13 +8415,13 @@ function yd(n, e) {
8355
8415
  set item(P = null) {
8356
8416
  d(P), v();
8357
8417
  }
8358
- }, K = gd(), J = vt(K);
8418
+ }, K = yd(), J = vt(K);
8359
8419
  at(J, (P) => F(u, P), () => a(u));
8360
8420
  var L = Pe(J, 2);
8361
8421
  return Hn(L, e, "default", {}), fe(n, K), He(D);
8362
8422
  }
8363
8423
  customElements.define("pie-passage-shell", Ke(
8364
- yd,
8424
+ Id,
8365
8425
  {
8366
8426
  itemId: { attribute: "item-id", type: "String" },
8367
8427
  canonicalItemId: { attribute: "canonical-item-id", type: "String" },
@@ -8374,17 +8434,17 @@ customElements.define("pie-passage-shell", Ke(
8374
8434
  [],
8375
8435
  { mode: "open" }
8376
8436
  ));
8377
- var bd = /* @__PURE__ */ ve('<h2 class="svelte-10ek8e9"> </h2>'), Id = /* @__PURE__ */ ve('<div class="pie-section-player-passage-card-anchor svelte-10ek8e9" aria-hidden="true"></div> <pie-passage-shell><div class="pie-section-player-content-card svelte-10ek8e9"><div class="pie-section-player-content-card-header pie-section-player-passage-header pie-section-player__passage-header svelte-10ek8e9" data-region="header"><!> <pie-item-toolbar></pie-item-toolbar></div> <div class="pie-section-player-content-card-body pie-section-player-passage-content pie-section-player__passage-content svelte-10ek8e9" data-region="content"><!></div></div></pie-passage-shell>', 3);
8378
- const Sd = {
8437
+ var Sd = /* @__PURE__ */ ve('<h2 class="svelte-10ek8e9"> </h2>'), Td = /* @__PURE__ */ ve('<div class="pie-section-player-passage-card-anchor svelte-10ek8e9" aria-hidden="true"></div> <pie-passage-shell><div class="pie-section-player-content-card svelte-10ek8e9"><div class="pie-section-player-content-card-header pie-section-player-passage-header pie-section-player__passage-header svelte-10ek8e9" data-region="header"><!> <pie-item-toolbar></pie-item-toolbar></div> <div class="pie-section-player-content-card-body pie-section-player-passage-content pie-section-player__passage-content svelte-10ek8e9" data-region="content"><!></div></div></pie-passage-shell>', 3);
8438
+ const wd = {
8379
8439
  hash: "svelte-10ek8e9",
8380
8440
  code: ".pie-section-player-passage-card-anchor.svelte-10ek8e9 {display:none;}.pie-section-player-content-card.svelte-10ek8e9 {border:1px solid var(--pie-border-light, #e5e7eb);border-radius:8px;background:var(--pie-background, #fff);color:var(--pie-text, #111827);}.pie-section-player-content-card-header.svelte-10ek8e9 {display:flex;align-items:center;gap:0.75rem;padding:0.75rem 1rem;border-bottom:1px solid var(--pie-border-light, #e5e7eb);}.pie-section-player-content-card-header.svelte-10ek8e9 h2:where(.svelte-10ek8e9) {margin:0;font-size:0.95rem;font-weight:600;color:var(--pie-text, #111827);}.pie-section-player-content-card-header.svelte-10ek8e9 pie-item-toolbar:where(.svelte-10ek8e9) {margin-left:auto;}.pie-section-player-content-card-body.svelte-10ek8e9 {padding:1rem;color:var(--pie-text, #111827);}"
8381
8441
  };
8382
- function Td(n, e) {
8383
- Be(e, !0), et(n, Sd);
8442
+ function Cd(n, e) {
8443
+ Be(e, !0), et(n, wd);
8384
8444
  let t = y(e, "passage", 7), i = y(e, "resolvedPlayerTag", 7, "div"), o = y(e, "playerAction", 7, (L, P) => {
8385
8445
  }), r = y(e, "playerParams", 7), s = y(e, "passageToolbarTools", 7), l = /* @__PURE__ */ U(null), c = /* @__PURE__ */ U(null), d = /* @__PURE__ */ U(null), u = /* @__PURE__ */ U(!1);
8386
- const f = /* @__PURE__ */ N(() => (a(u) ? a(c) : null) || i()), p = /* @__PURE__ */ N(() => (a(u) ? a(d) : null) || o());
8387
- function b() {
8446
+ const f = /* @__PURE__ */ N(() => (a(u) ? a(c) : null) || i()), m = /* @__PURE__ */ N(() => (a(u) ? a(d) : null) || o());
8447
+ function S() {
8388
8448
  F(u, !1), F(c, null), F(d, null);
8389
8449
  }
8390
8450
  function h(L) {
@@ -8396,10 +8456,10 @@ function Td(n, e) {
8396
8456
  F(u, !0);
8397
8457
  const P = Js(L, h);
8398
8458
  return () => {
8399
- P(), b();
8459
+ P(), S();
8400
8460
  };
8401
8461
  });
8402
- var S = {
8462
+ var b = {
8403
8463
  get passage() {
8404
8464
  return t();
8405
8465
  },
@@ -8431,29 +8491,29 @@ function Td(n, e) {
8431
8491
  set passageToolbarTools(L) {
8432
8492
  s(L), v();
8433
8493
  }
8434
- }, w = Id(), g = vt(w);
8435
- at(g, (L) => F(l, L), () => a(l));
8436
- var C = Pe(g, 2);
8494
+ }, w = Td(), p = vt(w);
8495
+ at(p, (L) => F(l, L), () => a(l));
8496
+ var C = Pe(p, 2);
8437
8497
  k(() => E(C, "item-id", t().id)), E(C, "content-kind", "rubric-block-stimulus"), k(() => E(C, "item", t()));
8438
- var x = Se(C), O = Se(x), _ = Se(O);
8498
+ var R = Se(C), O = Se(R), _ = Se(O);
8439
8499
  {
8440
8500
  var H = (L) => {
8441
- var P = bd(), W = Se(P, !0);
8501
+ var P = Sd(), W = Se(P, !0);
8442
8502
  Ie(P), k((j) => Es(W, j), [() => Bi(t())]), fe(L, P);
8443
- }, R = /* @__PURE__ */ N(() => Bi(t()));
8503
+ }, x = /* @__PURE__ */ N(() => Bi(t()));
8444
8504
  st(_, (L) => {
8445
- a(R) && L(H);
8505
+ a(x) && L(H);
8446
8506
  });
8447
8507
  }
8448
8508
  var D = Pe(_, 2);
8449
8509
  k(() => E(D, "item-id", t().id)), k(() => E(D, "catalog-id", t().id)), k(() => E(D, "tools", s())), E(D, "content-kind", "rubric-block-stimulus"), E(D, "size", "md"), E(D, "language", "en-US"), wt(D, 1, "svelte-10ek8e9"), Ie(O);
8450
8510
  var K = Pe(O, 2), J = Se(K);
8451
8511
  return xs(J, () => a(f), !1, (L, P) => {
8452
- Ls(L, (W, j) => a(p)?.(W, j), r);
8453
- }), Ie(K), Ie(x), Ie(C), fe(n, w), He(S);
8512
+ Ls(L, (W, j) => a(m)?.(W, j), r);
8513
+ }), Ie(K), Ie(R), Ie(C), fe(n, w), He(b);
8454
8514
  }
8455
8515
  customElements.define("pie-section-player-passage-card", Ke(
8456
- Td,
8516
+ Cd,
8457
8517
  {
8458
8518
  passage: { type: "Object" },
8459
8519
  resolvedPlayerTag: { attribute: "resolved-player-tag", type: "String" },
@@ -8497,7 +8557,7 @@ const kr = {
8497
8557
  }
8498
8558
  }
8499
8559
  }, Lo = "section-demo-direct", Hi = "iife", Oo = !0, Mo = "inherit", Zs = { mode: "gather", role: "student" };
8500
- function wd(n) {
8560
+ function _d(n) {
8501
8561
  const e = n.runtime?.tools || n.tools || {}, t = yn(e), i = ao(n.enabledTools), o = ao(n.itemToolbarTools), r = ao(n.passageToolbarTools);
8502
8562
  return yn({
8503
8563
  ...t,
@@ -8509,7 +8569,7 @@ function wd(n) {
8509
8569
  }
8510
8570
  });
8511
8571
  }
8512
- function Cd(n) {
8572
+ function Ed(n) {
8513
8573
  const e = n.runtime || {};
8514
8574
  return {
8515
8575
  ...e,
@@ -8525,10 +8585,10 @@ function Cd(n) {
8525
8585
  tools: n.effectiveToolsConfig
8526
8586
  };
8527
8587
  }
8528
- function _d(n) {
8588
+ function Pd(n) {
8529
8589
  const e = String(
8530
8590
  n.effectiveRuntime?.playerType || n.playerType || Hi
8531
- ), t = kr[e] || kr.iife, i = t?.tagName || "pie-item-player", o = t?.attributes || {}, r = t?.props || {}, s = n.effectiveRuntime?.env || n.env || {}, l = Qc(
8591
+ ), t = kr[e] || kr.iife, i = t?.tagName || "pie-item-player", o = t?.attributes || {}, r = t?.props || {}, s = n.effectiveRuntime?.env || n.env || {}, l = td(
8532
8592
  o?.strategy || e,
8533
8593
  "iife"
8534
8594
  );
@@ -8542,17 +8602,17 @@ function _d(n) {
8542
8602
  strategy: l
8543
8603
  };
8544
8604
  }
8545
- function Ed(n) {
8605
+ function kd(n) {
8546
8606
  return n.map((e) => e?.entity);
8547
8607
  }
8548
- function Pd(n) {
8549
- const e = n.assessmentId ?? Lo, t = n.playerType ?? Hi, i = n.player ?? null, o = n.lazyInit ?? Oo, r = n.accessibility ?? null, s = n.coordinator ?? null, l = n.createSectionController ?? null, c = n.isolation ?? Mo, d = n.env ?? null, u = n.tools ?? null, f = wd({
8608
+ function Ad(n) {
8609
+ const e = n.assessmentId ?? Lo, t = n.playerType ?? Hi, i = n.player ?? null, o = n.lazyInit ?? Oo, r = n.accessibility ?? null, s = n.coordinator ?? null, l = n.createSectionController ?? null, c = n.isolation ?? Mo, d = n.env ?? null, u = n.tools ?? null, f = _d({
8550
8610
  runtime: n.runtime,
8551
8611
  tools: u,
8552
8612
  enabledTools: n.enabledTools,
8553
8613
  itemToolbarTools: n.itemToolbarTools,
8554
8614
  passageToolbarTools: n.passageToolbarTools
8555
- }), p = Cd({
8615
+ }), m = Ed({
8556
8616
  assessmentId: e,
8557
8617
  playerType: t,
8558
8618
  player: i,
@@ -8564,22 +8624,22 @@ function Pd(n) {
8564
8624
  env: d,
8565
8625
  runtime: n.runtime,
8566
8626
  effectiveToolsConfig: f
8567
- }), b = _d({
8568
- effectiveRuntime: p,
8627
+ }), S = Pd({
8628
+ effectiveRuntime: m,
8569
8629
  playerType: t,
8570
8630
  env: d
8571
8631
  });
8572
8632
  return {
8573
8633
  effectiveToolsConfig: f,
8574
- effectiveRuntime: p,
8575
- playerRuntime: b
8634
+ effectiveRuntime: m,
8635
+ playerRuntime: S
8576
8636
  };
8577
8637
  }
8578
- function kd(n) {
8638
+ function Rd(n) {
8579
8639
  return n.detail?.composition || nr;
8580
8640
  }
8581
8641
  function Qs(n) {
8582
- const e = Ed(n.renderables || []);
8642
+ const e = kd(n.renderables || []);
8583
8643
  return {
8584
8644
  compositionModel: n,
8585
8645
  passages: n.passages || [],
@@ -8588,10 +8648,10 @@ function Qs(n) {
8588
8648
  renderablesSignature: da(n.renderables || [])
8589
8649
  };
8590
8650
  }
8591
- function Ad(n) {
8592
- return Qs(kd(n));
8651
+ function xd(n) {
8652
+ return Qs(Rd(n));
8593
8653
  }
8594
- function Rd(n) {
8654
+ function Ld(n) {
8595
8655
  return {
8596
8656
  config: n.passage.config || {},
8597
8657
  env: n.resolvedPlayerEnv,
@@ -8600,45 +8660,45 @@ function Rd(n) {
8600
8660
  skipElementLoading: n.playerStrategy !== "preloaded"
8601
8661
  };
8602
8662
  }
8603
- function xd(n) {
8663
+ function Od(n) {
8604
8664
  return {
8605
8665
  config: n.item.config || {},
8606
8666
  env: n.resolvedPlayerEnv,
8607
- session: cd(n.compositionModel, n.item),
8667
+ session: ud(n.compositionModel, n.item),
8608
8668
  attributes: n.resolvedPlayerAttributes || {},
8609
8669
  props: n.resolvedPlayerProps || {},
8610
8670
  skipElementLoading: n.playerStrategy !== "preloaded"
8611
8671
  };
8612
8672
  }
8613
- function Ld(n) {
8614
- return ad(n.compositionModel, n.item);
8673
+ function Md(n) {
8674
+ return cd(n.compositionModel, n.item);
8615
8675
  }
8616
- var Od = /* @__PURE__ */ ve('<div class="pie-section-player-content-card svelte-pqze5h"><div class="pie-section-player-content-card-body pie-section-player-item-content pie-section-player__item-content svelte-pqze5h">Loading section content...</div></div>'), Md = /* @__PURE__ */ ve("<pie-section-player-item-card></pie-section-player-item-card>", 2);
8617
- const Nd = {
8676
+ var Nd = /* @__PURE__ */ ve('<div class="pie-section-player-content-card svelte-pqze5h"><div class="pie-section-player-content-card-body pie-section-player-item-content pie-section-player__item-content svelte-pqze5h">Loading section content...</div></div>'), zd = /* @__PURE__ */ ve("<pie-section-player-item-card></pie-section-player-item-card>", 2);
8677
+ const Dd = {
8618
8678
  hash: "svelte-pqze5h",
8619
8679
  code: ":host {display:flex;flex-direction:column;gap:1rem;min-height:0;min-width:0;}.pie-section-player-content-card.svelte-pqze5h {border:1px solid var(--pie-border-light, #e5e7eb);border-radius:8px;background:var(--pie-background, #fff);}.pie-section-player-content-card-body.svelte-pqze5h {padding:1rem;}"
8620
8680
  };
8621
- function zd(n, e) {
8622
- Be(e, !0), et(n, Nd);
8623
- let t = y(e, "items", 23, () => []), i = y(e, "compositionModel", 7), o = y(e, "resolvedPlayerEnv", 23, () => ({})), r = y(e, "resolvedPlayerAttributes", 23, () => ({})), s = y(e, "resolvedPlayerProps", 23, () => ({})), l = y(e, "playerStrategy", 7, "preloaded"), c = y(e, "itemToolbarTools", 7, ""), d = y(e, "iifeBundleHost", 7, ""), u = y(e, "preloadedRenderables", 23, () => []), f = y(e, "preloadedRenderablesSignature", 7, ""), p = y(e, "preloadComponentTag", 7, "pie-section-player-items-pane");
8624
- const b = Bn();
8625
- let h = /* @__PURE__ */ U(!1), S = /* @__PURE__ */ U(""), w = /* @__PURE__ */ U(0);
8626
- const g = fa({
8627
- setLastPreloadSignature: (R) => {
8628
- F(S, R, !0);
8681
+ function Bd(n, e) {
8682
+ Be(e, !0), et(n, Dd);
8683
+ let t = y(e, "items", 23, () => []), i = y(e, "compositionModel", 7), o = y(e, "resolvedPlayerEnv", 23, () => ({})), r = y(e, "resolvedPlayerAttributes", 23, () => ({})), s = y(e, "resolvedPlayerProps", 23, () => ({})), l = y(e, "playerStrategy", 7, "preloaded"), c = y(e, "itemToolbarTools", 7, ""), d = y(e, "iifeBundleHost", 7, ""), u = y(e, "preloadedRenderables", 23, () => []), f = y(e, "preloadedRenderablesSignature", 7, ""), m = y(e, "preloadComponentTag", 7, "pie-section-player-items-pane");
8684
+ const S = Bn();
8685
+ let h = /* @__PURE__ */ U(!1), b = /* @__PURE__ */ U(""), w = /* @__PURE__ */ U(0);
8686
+ const p = fa({
8687
+ setLastPreloadSignature: (x) => {
8688
+ F(b, x, !0);
8629
8689
  },
8630
- setPreloadRunToken: (R) => {
8631
- F(w, R, !0);
8690
+ setPreloadRunToken: (x) => {
8691
+ F(w, x, !0);
8632
8692
  },
8633
- setElementsLoaded: (R) => {
8634
- F(h, R, !0);
8693
+ setElementsLoaded: (x) => {
8694
+ F(h, x, !0);
8635
8695
  }
8636
8696
  });
8637
8697
  se(() => {
8638
- b("elements-loaded-change", { elementsLoaded: a(h) });
8698
+ S("elements-loaded-change", { elementsLoaded: a(h) });
8639
8699
  }), se(() => {
8640
8700
  ua({
8641
- componentTag: p(),
8701
+ componentTag: m(),
8642
8702
  strategy: l(),
8643
8703
  renderables: u(),
8644
8704
  renderablesSignature: f(),
@@ -8646,90 +8706,90 @@ function zd(n, e) {
8646
8706
  resolvedPlayerEnv: o(),
8647
8707
  iifeBundleHost: d(),
8648
8708
  getState: () => ({
8649
- lastPreloadSignature: a(S),
8709
+ lastPreloadSignature: a(b),
8650
8710
  preloadRunToken: a(w),
8651
8711
  elementsLoaded: a(h)
8652
8712
  }),
8653
- setState: g
8713
+ setState: p
8654
8714
  });
8655
8715
  });
8656
8716
  var C = {
8657
8717
  get items() {
8658
8718
  return t();
8659
8719
  },
8660
- set items(R = []) {
8661
- t(R), v();
8720
+ set items(x = []) {
8721
+ t(x), v();
8662
8722
  },
8663
8723
  get compositionModel() {
8664
8724
  return i();
8665
8725
  },
8666
- set compositionModel(R) {
8667
- i(R), v();
8726
+ set compositionModel(x) {
8727
+ i(x), v();
8668
8728
  },
8669
8729
  get resolvedPlayerEnv() {
8670
8730
  return o();
8671
8731
  },
8672
- set resolvedPlayerEnv(R = {}) {
8673
- o(R), v();
8732
+ set resolvedPlayerEnv(x = {}) {
8733
+ o(x), v();
8674
8734
  },
8675
8735
  get resolvedPlayerAttributes() {
8676
8736
  return r();
8677
8737
  },
8678
- set resolvedPlayerAttributes(R = {}) {
8679
- r(R), v();
8738
+ set resolvedPlayerAttributes(x = {}) {
8739
+ r(x), v();
8680
8740
  },
8681
8741
  get resolvedPlayerProps() {
8682
8742
  return s();
8683
8743
  },
8684
- set resolvedPlayerProps(R = {}) {
8685
- s(R), v();
8744
+ set resolvedPlayerProps(x = {}) {
8745
+ s(x), v();
8686
8746
  },
8687
8747
  get playerStrategy() {
8688
8748
  return l();
8689
8749
  },
8690
- set playerStrategy(R = "preloaded") {
8691
- l(R), v();
8750
+ set playerStrategy(x = "preloaded") {
8751
+ l(x), v();
8692
8752
  },
8693
8753
  get itemToolbarTools() {
8694
8754
  return c();
8695
8755
  },
8696
- set itemToolbarTools(R = "") {
8697
- c(R), v();
8756
+ set itemToolbarTools(x = "") {
8757
+ c(x), v();
8698
8758
  },
8699
8759
  get iifeBundleHost() {
8700
8760
  return d();
8701
8761
  },
8702
- set iifeBundleHost(R = "") {
8703
- d(R), v();
8762
+ set iifeBundleHost(x = "") {
8763
+ d(x), v();
8704
8764
  },
8705
8765
  get preloadedRenderables() {
8706
8766
  return u();
8707
8767
  },
8708
- set preloadedRenderables(R = []) {
8709
- u(R), v();
8768
+ set preloadedRenderables(x = []) {
8769
+ u(x), v();
8710
8770
  },
8711
8771
  get preloadedRenderablesSignature() {
8712
8772
  return f();
8713
8773
  },
8714
- set preloadedRenderablesSignature(R = "") {
8715
- f(R), v();
8774
+ set preloadedRenderablesSignature(x = "") {
8775
+ f(x), v();
8716
8776
  },
8717
8777
  get preloadComponentTag() {
8718
- return p();
8778
+ return m();
8719
8779
  },
8720
- set preloadComponentTag(R = "pie-section-player-items-pane") {
8721
- p(R), v();
8780
+ set preloadComponentTag(x = "pie-section-player-items-pane") {
8781
+ m(x), v();
8722
8782
  }
8723
- }, x = hi(), O = vt(x);
8783
+ }, R = hi(), O = vt(R);
8724
8784
  {
8725
- var _ = (R) => {
8726
- var D = Od();
8727
- fe(R, D);
8728
- }, H = (R) => {
8785
+ var _ = (x) => {
8786
+ var D = Nd();
8787
+ fe(x, D);
8788
+ }, H = (x) => {
8729
8789
  var D = hi(), K = vt(D);
8730
8790
  Rs(K, 19, t, (J, L) => J.id || L, (J, L) => {
8731
- var P = Md();
8732
- k(() => E(P, "item", a(L))), k(() => E(P, "canonicalItemId", Ld({ compositionModel: i(), item: a(L) }))), k(() => E(P, "playerParams", xd({
8791
+ var P = zd();
8792
+ k(() => E(P, "item", a(L))), k(() => E(P, "canonicalItemId", Md({ compositionModel: i(), item: a(L) }))), k(() => E(P, "playerParams", Od({
8733
8793
  item: a(L),
8734
8794
  compositionModel: i(),
8735
8795
  resolvedPlayerEnv: o(),
@@ -8737,16 +8797,16 @@ function zd(n, e) {
8737
8797
  resolvedPlayerProps: s(),
8738
8798
  playerStrategy: l()
8739
8799
  }))), k(() => E(P, "itemToolbarTools", c())), fe(J, P);
8740
- }), fe(R, D);
8800
+ }), fe(x, D);
8741
8801
  };
8742
- st(O, (R) => {
8743
- a(h) ? R(H, -1) : R(_);
8802
+ st(O, (x) => {
8803
+ a(h) ? x(H, -1) : x(_);
8744
8804
  });
8745
8805
  }
8746
- return fe(n, x), He(C);
8806
+ return fe(n, R), He(C);
8747
8807
  }
8748
8808
  customElements.define("pie-section-player-items-pane", Ke(
8749
- zd,
8809
+ Bd,
8750
8810
  {
8751
8811
  items: { type: "Object" },
8752
8812
  compositionModel: { attribute: "composition-model", type: "Object" },
@@ -8763,13 +8823,13 @@ customElements.define("pie-section-player-items-pane", Ke(
8763
8823
  [],
8764
8824
  []
8765
8825
  ));
8766
- var Dd = /* @__PURE__ */ ve('<div class="pie-section-player-content-card svelte-42gyvq"><div class="pie-section-player-content-card-body pie-section-player-passage-content pie-section-player__passage-content svelte-42gyvq">Loading passage content...</div></div>'), Bd = /* @__PURE__ */ ve("<pie-section-player-passage-card></pie-section-player-passage-card>", 2);
8767
- const Hd = {
8826
+ var Hd = /* @__PURE__ */ ve('<div class="pie-section-player-content-card svelte-42gyvq"><div class="pie-section-player-content-card-body pie-section-player-passage-content pie-section-player__passage-content svelte-42gyvq">Loading passage content...</div></div>'), Vd = /* @__PURE__ */ ve("<pie-section-player-passage-card></pie-section-player-passage-card>", 2);
8827
+ const Fd = {
8768
8828
  hash: "svelte-42gyvq",
8769
8829
  code: ":host {display:flex;flex-direction:column;gap:1rem;min-height:0;min-width:0;}.pie-section-player-content-card.svelte-42gyvq {border:1px solid var(--pie-border-light, #e5e7eb);border-radius:8px;background:var(--pie-background, #fff);}.pie-section-player-content-card-body.svelte-42gyvq {padding:1rem;}"
8770
8830
  };
8771
- function Vd(n, e) {
8772
- Be(e, !0), et(n, Hd);
8831
+ function jd(n, e) {
8832
+ Be(e, !0), et(n, Fd);
8773
8833
  let t = y(e, "passages", 23, () => []), i = y(e, "elementsLoaded", 7, !1), o = y(e, "resolvedPlayerEnv", 23, () => ({})), r = y(e, "resolvedPlayerAttributes", 23, () => ({})), s = y(e, "resolvedPlayerProps", 23, () => ({})), l = y(e, "playerStrategy", 7, "preloaded"), c = y(e, "passageToolbarTools", 7, "");
8774
8834
  var d = {
8775
8835
  get passages() {
@@ -8816,30 +8876,30 @@ function Vd(n, e) {
8816
8876
  }
8817
8877
  }, u = hi(), f = vt(u);
8818
8878
  {
8819
- var p = (h) => {
8820
- var S = Dd();
8821
- fe(h, S);
8822
- }, b = (h) => {
8823
- var S = hi(), w = vt(S);
8824
- Rs(w, 19, t, (g, C) => g.id || C, (g, C) => {
8825
- var x = Bd();
8826
- k(() => E(x, "passage", a(C))), k(() => E(x, "playerParams", Rd({
8879
+ var m = (h) => {
8880
+ var b = Hd();
8881
+ fe(h, b);
8882
+ }, S = (h) => {
8883
+ var b = hi(), w = vt(b);
8884
+ Rs(w, 19, t, (p, C) => p.id || C, (p, C) => {
8885
+ var R = Vd();
8886
+ k(() => E(R, "passage", a(C))), k(() => E(R, "playerParams", Ld({
8827
8887
  passage: a(C),
8828
8888
  resolvedPlayerEnv: o(),
8829
8889
  resolvedPlayerAttributes: r(),
8830
8890
  resolvedPlayerProps: s(),
8831
8891
  playerStrategy: l()
8832
- }))), k(() => E(x, "passageToolbarTools", c())), fe(g, x);
8833
- }), fe(h, S);
8892
+ }))), k(() => E(R, "passageToolbarTools", c())), fe(p, R);
8893
+ }), fe(h, b);
8834
8894
  };
8835
8895
  st(f, (h) => {
8836
- i() ? h(b, -1) : h(p);
8896
+ i() ? h(S, -1) : h(m);
8837
8897
  });
8838
8898
  }
8839
8899
  return fe(n, u), He(d);
8840
8900
  }
8841
8901
  customElements.define("pie-section-player-passages-pane", Ke(
8842
- Vd,
8902
+ jd,
8843
8903
  {
8844
8904
  passages: { type: "Object" },
8845
8905
  elementsLoaded: { attribute: "elements-loaded", type: "Boolean" },
@@ -8858,7 +8918,7 @@ const Ar = {
8858
8918
  focus: { autoFocusFirstItem: !1 },
8859
8919
  telemetry: { enabled: !0 }
8860
8920
  }, pi = /* @__PURE__ */ new WeakMap();
8861
- function Fd(n) {
8921
+ function Kd(n) {
8862
8922
  if (!n) return "";
8863
8923
  try {
8864
8924
  return JSON.stringify(n);
@@ -8874,28 +8934,28 @@ function Rr(n) {
8874
8934
  return String(n);
8875
8935
  }
8876
8936
  }
8877
- function jd(n) {
8937
+ function qd(n) {
8878
8938
  return (e, t) => (xr(e, t, n), {
8879
8939
  update(i) {
8880
8940
  xr(e, i, n);
8881
8941
  },
8882
8942
  destroy() {
8883
- Wd(e, n.stateKey);
8943
+ $d(e, n.stateKey);
8884
8944
  }
8885
8945
  });
8886
8946
  }
8887
8947
  function xr(n, e, t) {
8888
- const i = n, o = Kd(n, t.stateKey), r = Rr(e.config);
8948
+ const i = n, o = Wd(n, t.stateKey), r = Rr(e.config);
8889
8949
  o.configSignature !== r && (i.config = e.config);
8890
8950
  const s = Rr(e.env);
8891
8951
  o.envSignature !== s && (i.env = e.env);
8892
- const l = Fd(e.session);
8952
+ const l = Kd(e.session);
8893
8953
  e.session !== void 0 && o.sessionSignature !== l && (i.session = e.session);
8894
8954
  for (const [c, d] of Object.entries(e.attributes || {}))
8895
8955
  n.setAttribute(c, String(d));
8896
8956
  for (const [c, d] of Object.entries(e.props || {}))
8897
8957
  i[c] = d;
8898
- e.skipElementLoading && (t.setSkipElementLoadingOnce !== !0 || o.skipElementLoading !== !0) && n.setAttribute("skip-element-loading", "true"), qd(n, t.stateKey, {
8958
+ e.skipElementLoading && (t.setSkipElementLoadingOnce !== !0 || o.skipElementLoading !== !0) && n.setAttribute("skip-element-loading", "true"), Ud(n, t.stateKey, {
8899
8959
  config: e.config,
8900
8960
  configSignature: r,
8901
8961
  env: e.env,
@@ -8905,14 +8965,14 @@ function xr(n, e, t) {
8905
8965
  skipElementLoading: !!e.skipElementLoading
8906
8966
  });
8907
8967
  }
8908
- function Kd(n, e) {
8968
+ function Wd(n, e) {
8909
8969
  return pi.get(n)?.get(e) || {};
8910
8970
  }
8911
- function qd(n, e, t) {
8971
+ function Ud(n, e, t) {
8912
8972
  const i = pi.get(n) || /* @__PURE__ */ new Map();
8913
8973
  i.set(e, t), pi.set(n, i);
8914
8974
  }
8915
- function Wd(n, e) {
8975
+ function $d(n, e) {
8916
8976
  const t = pi.get(n);
8917
8977
  t && (t.delete(e), t.size === 0 && pi.delete(n));
8918
8978
  }
@@ -8924,13 +8984,13 @@ function or(n, e = !1) {
8924
8984
  const t = String(n).trim().toLowerCase();
8925
8985
  return t === "" ? e : ["false", "0", "off", "no"].includes(t) ? !1 : ["true", "1", "on", "yes"].includes(t) ? !0 : !!t;
8926
8986
  }
8927
- function Ud(n) {
8987
+ function Gd(n) {
8928
8988
  return n.runtimeError ? "error" : n.allLoadingComplete ? "ready" : n.interactionReady ? "interaction-ready" : n.sectionReady ? "loading" : "bootstrapping";
8929
8989
  }
8930
- function $d(n) {
8990
+ function Yd(n) {
8931
8991
  const e = n.signals.sectionReady && n.signals.allLoadingComplete, t = n.mode === "strict" ? e : n.signals.interactionReady;
8932
8992
  return {
8933
- phase: Ud({
8993
+ phase: Gd({
8934
8994
  ...n.signals,
8935
8995
  allLoadingComplete: e,
8936
8996
  interactionReady: t
@@ -8940,13 +9000,13 @@ function $d(n) {
8940
9000
  reason: n.reason
8941
9001
  };
8942
9002
  }
8943
- function Gd(n, e) {
9003
+ function Xd(n, e) {
8944
9004
  if (n === e)
8945
9005
  return 0;
8946
9006
  const t = n.compareDocumentPosition(e);
8947
9007
  return t & Node.DOCUMENT_POSITION_PRECEDING ? 1 : t & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 0;
8948
9008
  }
8949
- class Yd {
9009
+ class Jd {
8950
9010
  constructor() {
8951
9011
  I(this, "shellsByElement", /* @__PURE__ */ new Map());
8952
9012
  }
@@ -8962,7 +9022,7 @@ class Yd {
8962
9022
  }
8963
9023
  getOrderedShells(e) {
8964
9024
  const t = Array.from(this.shellsByElement.values()).filter((i) => !e || i.kind === e);
8965
- return t.sort((i, o) => Gd(i.element, o.element)), t;
9025
+ return t.sort((i, o) => Xd(i.element, o.element)), t;
8966
9026
  }
8967
9027
  getCanonicalIdMap() {
8968
9028
  const e = {};
@@ -8974,9 +9034,9 @@ class Yd {
8974
9034
  this.shellsByElement.clear();
8975
9035
  }
8976
9036
  }
8977
- class Xd {
9037
+ class Zd {
8978
9038
  constructor() {
8979
- I(this, "registry", new Yd());
9039
+ I(this, "registry", new Jd());
8980
9040
  I(this, "controller", null);
8981
9041
  I(this, "coordinator", null);
8982
9042
  I(this, "sectionId", "");
@@ -9039,9 +9099,9 @@ class Xd {
9039
9099
  reportSectionError(e) {
9040
9100
  this.controller?.reportSectionError?.(e);
9041
9101
  }
9042
- handleItemSessionChanged(e, t) {
9102
+ updateItemSession(e, t) {
9043
9103
  const i = this.getCanonicalItemId(e);
9044
- return this.controller?.handleItemSessionChanged?.(i, t) ?? null;
9104
+ return this.controller?.updateItemSession?.(i, t) ?? null;
9045
9105
  }
9046
9106
  navigateToItem(e) {
9047
9107
  return this.controller?.navigateToItem?.(e) ?? null;
@@ -9062,30 +9122,30 @@ class Xd {
9062
9122
  }), this.registry.clear(), this.controller = null, this.coordinator = null;
9063
9123
  }
9064
9124
  }
9065
- function Jd(n = "runtime") {
9125
+ function Qd(n = "runtime") {
9066
9126
  return `${n}-${Math.random().toString(16).slice(2)}-${Date.now()}`;
9067
9127
  }
9068
- function Zd() {
9128
+ function eu() {
9069
9129
  return {
9070
9130
  lastSessionEventSignatureByItemId: /* @__PURE__ */ new Map(),
9071
9131
  lastMetadataSignatureByItemId: /* @__PURE__ */ new Map()
9072
9132
  };
9073
9133
  }
9074
- function Qd(n) {
9134
+ function tu(n) {
9075
9135
  n.lastSessionEventSignatureByItemId.clear(), n.lastMetadataSignatureByItemId.clear();
9076
9136
  }
9077
- function eu(n) {
9137
+ function nu(n) {
9078
9138
  const { state: e, itemId: t, payload: i } = n;
9079
- if (nu(i)) {
9080
- const s = iu(i);
9139
+ if (ou(i)) {
9140
+ const s = ru(i);
9081
9141
  if (e.lastMetadataSignatureByItemId.get(t) === s)
9082
9142
  return !1;
9083
9143
  e.lastMetadataSignatureByItemId.set(t, s);
9084
9144
  }
9085
- const o = tu(i);
9145
+ const o = iu(i);
9086
9146
  return e.lastSessionEventSignatureByItemId.get(t) === o ? !1 : (e.lastSessionEventSignatureByItemId.set(t, o), !0);
9087
9147
  }
9088
- function tu(n) {
9148
+ function iu(n) {
9089
9149
  const e = { ...n };
9090
9150
  delete e.timestamp, delete e.sourceRuntimeId;
9091
9151
  try {
@@ -9094,10 +9154,10 @@ function tu(n) {
9094
9154
  return String(e.itemId || "");
9095
9155
  }
9096
9156
  }
9097
- function nu(n) {
9157
+ function ou(n) {
9098
9158
  return n.intent === "metadata-only";
9099
9159
  }
9100
- function iu(n) {
9160
+ function ru(n) {
9101
9161
  try {
9102
9162
  return JSON.stringify({
9103
9163
  itemId: n.itemId,
@@ -9110,38 +9170,38 @@ function iu(n) {
9110
9170
  return String(n.itemId || "");
9111
9171
  }
9112
9172
  }
9113
- var ou = /* @__PURE__ */ ve('<div class="pie-assessment-toolkit-anchor svelte-vpe4u2" aria-hidden="true"></div> <!>', 1);
9114
- const ru = {
9173
+ var su = /* @__PURE__ */ ve('<div class="pie-assessment-toolkit-anchor svelte-vpe4u2" aria-hidden="true"></div> <!>', 1);
9174
+ const au = {
9115
9175
  hash: "svelte-vpe4u2",
9116
9176
  code: ".pie-assessment-toolkit-anchor.svelte-vpe4u2 {display:none;}"
9117
9177
  };
9118
- function su(n, e) {
9119
- Be(e, !0), et(n, ru);
9120
- const t = Jd("toolkit"), i = new Xd(), o = { mode: "gather", role: "student" }, r = {
9178
+ function lu(n, e) {
9179
+ Be(e, !0), et(n, au);
9180
+ const t = Qd("toolkit"), i = new Zd(), o = { mode: "gather", role: "student" }, r = {
9121
9181
  iife: "pie-item-player",
9122
9182
  esm: "pie-item-player",
9123
9183
  preloaded: "pie-item-player",
9124
9184
  custom: ""
9125
9185
  };
9126
- let s = y(e, "assessmentId", 7, ""), l = y(e, "section", 7, null), c = y(e, "sectionId", 7, ""), d = y(e, "attemptId", 7, ""), u = y(e, "view", 7, "candidate"), f = y(e, "env", 23, () => ({})), p = y(e, "lazyInit", 7, !0), b = y(e, "tools", 23, () => ({})), h = y(e, "accessibility", 23, () => ({})), S = y(e, "player", 7, null), w = y(e, "playerType", 7, ""), g = y(e, "coordinator", 7, null), C = y(e, "createSectionController", 7, null), x = y(e, "isolation", 7, "inherit"), O = /* @__PURE__ */ U(null), _ = /* @__PURE__ */ U(null), H = /* @__PURE__ */ U(null), R = /* @__PURE__ */ U(null), D = null, K = null, J = null, L = null, P = /* @__PURE__ */ U(0), W = /* @__PURE__ */ U(null), j = /* @__PURE__ */ U(null), G = /* @__PURE__ */ U(""), ye = null, me = !1, he = null;
9127
- const ue = Zd();
9186
+ let s = y(e, "assessmentId", 7, ""), l = y(e, "section", 7, null), c = y(e, "sectionId", 7, ""), d = y(e, "attemptId", 7, ""), u = y(e, "view", 7, "candidate"), f = y(e, "env", 23, () => ({})), m = y(e, "lazyInit", 7, !0), S = y(e, "tools", 23, () => ({})), h = y(e, "accessibility", 23, () => ({})), b = y(e, "player", 7, null), w = y(e, "playerType", 7, ""), p = y(e, "coordinator", 7, null), C = y(e, "createSectionController", 7, null), R = y(e, "isolation", 7, "inherit"), O = /* @__PURE__ */ U(null), _ = /* @__PURE__ */ U(null), H = /* @__PURE__ */ U(null), x = /* @__PURE__ */ U(null), D = null, K = null, J = null, L = null, P = /* @__PURE__ */ U(0), W = /* @__PURE__ */ U(null), j = /* @__PURE__ */ U(null), G = /* @__PURE__ */ U(""), ye = null, me = !1, he = null;
9187
+ const ue = eu();
9128
9188
  function ae() {
9129
9189
  if (!a(O)) return null;
9130
- const m = a(O).getRootNode();
9131
- return m && "host" in m ? m.host : a(O).parentElement;
9190
+ const g = a(O).getRootNode();
9191
+ return g && "host" in g ? g.host : a(O).parentElement;
9132
9192
  }
9133
9193
  const Y = /* @__PURE__ */ N(() => ae());
9134
- function M(m, q) {
9135
- a(Y) && Wt(a(Y), m, q);
9194
+ function M(g, q) {
9195
+ a(Y) && Wt(a(Y), g, q);
9136
9196
  }
9137
- function te(m) {
9197
+ function te(g) {
9138
9198
  let q = 5381;
9139
- for (let we = 0; we < m.length; we += 1)
9140
- q = (q << 5) + q ^ m.charCodeAt(we);
9199
+ for (let we = 0; we < g.length; we += 1)
9200
+ q = (q << 5) + q ^ g.charCodeAt(we);
9141
9201
  return (q >>> 0).toString(36);
9142
9202
  }
9143
- function z(m) {
9144
- const q = m || {}, we = q.section?.identifier || q.sectionId || "", Ue = typeof q.currentItemIndex == "number" ? q.currentItemIndex : -1, Ci = (Array.isArray(q.renderables) ? q.renderables : []).map((ct, Jt) => {
9203
+ function z(g) {
9204
+ const q = g || {}, we = q.section?.identifier || q.sectionId || "", Ue = typeof q.currentItemIndex == "number" ? q.currentItemIndex : -1, Ci = (Array.isArray(q.renderables) ? q.renderables : []).map((ct, Jt) => {
9145
9205
  const bt = (ct || {}).entity || {}, si = typeof bt.id == "string" && bt.id || `renderable-${Jt}`, sa = typeof bt.version == "string" && bt.version || (typeof bt.version == "number" ? String(bt.version) : "") || (typeof bt.config?.version == "string" ? bt.config.version : "");
9146
9206
  return `${si}:${sa}`;
9147
9207
  }).join("|"), Re = q.itemSessionsByItemId || {}, pe = Object.keys(Re).sort((ct, Jt) => ct.localeCompare(Jt)).map((ct) => {
@@ -9156,11 +9216,11 @@ function su(n, e) {
9156
9216
  }).join("|");
9157
9217
  return `${we}|${Ue}|${Ci}|${pe}`;
9158
9218
  }
9159
- function ke(m) {
9160
- return m === "iife" || m === "esm" || m === "preloaded" || m === "custom";
9219
+ function ke(g) {
9220
+ return g === "iife" || g === "esm" || g === "preloaded" || g === "custom";
9161
9221
  }
9162
- function V(m, q) {
9163
- const we = m?.type, Ue = ke(we) ? we : ke(q) ? q : m?.tagName ? "custom" : "iife", Vn = m?.tagName?.trim();
9222
+ function V(g, q) {
9223
+ const we = g?.type, Ue = ke(we) ? we : ke(q) ? q : g?.tagName ? "custom" : "iife", Vn = g?.tagName?.trim();
9164
9224
  return Ue === "custom" && !Vn ? {
9165
9225
  type: "iife",
9166
9226
  tagName: r.iife,
@@ -9170,17 +9230,17 @@ function su(n, e) {
9170
9230
  } : {
9171
9231
  type: Ue,
9172
9232
  tagName: Vn || r[Ue],
9173
- version: m?.version,
9174
- source: m?.source,
9175
- isDefault: !m && !q
9233
+ version: g?.version,
9234
+ source: g?.source,
9235
+ isDefault: !g && !q
9176
9236
  };
9177
9237
  }
9178
- function ge(m) {
9179
- const q = m || {}, we = typeof q.mode == "string" && q.mode.trim() ? q.mode.trim() : o.mode, Ue = typeof q.role == "string" && q.role.trim() ? q.role.trim() : o.role;
9238
+ function ge(g) {
9239
+ const q = g || {}, we = typeof q.mode == "string" && q.mode.trim() ? q.mode.trim() : o.mode, Ue = typeof q.role == "string" && q.role.trim() ? q.role.trim() : o.role;
9180
9240
  return { mode: we, role: Ue };
9181
9241
  }
9182
- function le(m) {
9183
- const q = ge(m);
9242
+ function le(g) {
9243
+ const q = ge(g);
9184
9244
  return q.mode === "author" ? "author" : q.role === "instructor" ? "scorer" : "candidate";
9185
9245
  }
9186
9246
  async function Ve() {
@@ -9189,54 +9249,54 @@ function su(n, e) {
9189
9249
  throw new Error("pie-assessment-toolkit requires createSectionController when no coordinator hook provides one");
9190
9250
  }
9191
9251
  function qe() {
9192
- const m = s() || l()?.identifier || `assessment-${Math.random().toString(16).slice(2)}`;
9252
+ const g = s() || l()?.identifier || `assessment-${Math.random().toString(16).slice(2)}`;
9193
9253
  return new tr({
9194
- assessmentId: m,
9195
- lazyInit: p(),
9196
- tools: b(),
9254
+ assessmentId: g,
9255
+ lazyInit: m(),
9256
+ tools: S(),
9197
9257
  accessibility: h()
9198
9258
  });
9199
9259
  }
9200
- const X = /* @__PURE__ */ N(() => x() !== "force" && a(H)?.coordinator ? a(H).coordinator : g() || a(_));
9260
+ const X = /* @__PURE__ */ N(() => R() !== "force" && a(H)?.coordinator ? a(H).coordinator : p() || a(_));
9201
9261
  se(() => {
9202
- if (g()) {
9262
+ if (p()) {
9203
9263
  a(_) && F(_, null);
9204
9264
  return;
9205
9265
  }
9206
- if (x() !== "force" && a(H)?.coordinator) {
9266
+ if (R() !== "force" && a(H)?.coordinator) {
9207
9267
  a(_) && F(_, null);
9208
9268
  return;
9209
9269
  }
9210
9270
  a(_) || F(_, qe(), !0);
9211
9271
  });
9212
- const B = /* @__PURE__ */ N(() => s() || a(X)?.assessmentId || ""), Q = /* @__PURE__ */ N(() => c() || l()?.identifier || `section-${a(B) || "default"}`), re = /* @__PURE__ */ N(() => ge(f())), A = /* @__PURE__ */ N(() => le(a(re))), $ = /* @__PURE__ */ N(() => V(S(), w())), ne = /* @__PURE__ */ N(() => {
9272
+ const B = /* @__PURE__ */ N(() => s() || a(X)?.assessmentId || ""), Q = /* @__PURE__ */ N(() => c() || l()?.identifier || `section-${a(B) || "default"}`), re = /* @__PURE__ */ N(() => ge(f())), A = /* @__PURE__ */ N(() => le(a(re))), $ = /* @__PURE__ */ N(() => V(b(), w())), ne = /* @__PURE__ */ N(() => {
9213
9273
  if (!a(X)) return null;
9214
- const m = a(X).getServiceBundle();
9274
+ const g = a(X).getServiceBundle();
9215
9275
  return {
9216
9276
  toolkitCoordinator: a(X),
9217
9277
  toolCoordinator: a(X).toolCoordinator,
9218
- ttsService: m.ttsService,
9219
- highlightCoordinator: m.highlightCoordinator,
9220
- catalogResolver: m.catalogResolver,
9221
- elementToolStateStore: m.elementToolStateStore,
9278
+ ttsService: g.ttsService,
9279
+ highlightCoordinator: g.highlightCoordinator,
9280
+ catalogResolver: g.catalogResolver,
9281
+ elementToolStateStore: g.elementToolStateStore,
9222
9282
  assessmentId: a(B),
9223
9283
  sectionId: a(Q),
9224
9284
  itemPlayer: a($),
9225
9285
  reportSessionChanged: (q, we) => {
9226
- const Ue = i.handleItemSessionChanged(q, we);
9286
+ const Ue = i.updateItemSession(q, we);
9227
9287
  lt({ itemId: q, result: Ue, fallbackSession: we });
9228
9288
  }
9229
9289
  };
9230
9290
  }), be = /* @__PURE__ */ N(() => a(X) ? { runtimeId: t, coordinator: a(X) } : null);
9231
- function ze(m) {
9232
- const q = z(m);
9233
- q !== a(G) && (F(G, q, !0), F(P, a(P) + 1), F(W, m, !0), M("composition-changed", {
9291
+ function ze(g) {
9292
+ const q = z(g);
9293
+ q !== a(G) && (F(G, q, !0), F(P, a(P) + 1), F(W, g, !0), M("composition-changed", {
9234
9294
  composition: a(W),
9235
9295
  version: a(P)
9236
9296
  }));
9237
9297
  }
9238
- function Ae(m) {
9239
- if (ye = m ?? i.getCompositionModel(), me) return;
9298
+ function Ae(g) {
9299
+ if (ye = g ?? i.getCompositionModel(), me) return;
9240
9300
  me = !0;
9241
9301
  const q = () => {
9242
9302
  me = !1, he = null, ze(ye);
@@ -9247,33 +9307,33 @@ function su(n, e) {
9247
9307
  }
9248
9308
  queueMicrotask(q);
9249
9309
  }
9250
- function lt(m) {
9310
+ function lt(g) {
9251
9311
  const we = {
9252
- ...m.result?.eventDetail || m.fallbackSession,
9253
- itemId: m.itemId,
9254
- canonicalItemId: m.canonicalItemId || m.itemId,
9312
+ ...g.result?.eventDetail || g.fallbackSession,
9313
+ itemId: g.itemId,
9314
+ canonicalItemId: g.canonicalItemId || g.itemId,
9255
9315
  sourceRuntimeId: t
9256
9316
  };
9257
- eu({ state: ue, itemId: m.itemId, payload: we }) && M("session-changed", we);
9317
+ nu({ state: ue, itemId: g.itemId, payload: we }) && M("session-changed", we);
9258
9318
  }
9259
- function kt(m) {
9260
- return m instanceof HTMLElement ? $l(m, Po)?.runtimeId === t : !1;
9319
+ function kt(g) {
9320
+ return g instanceof HTMLElement ? $l(g, Po)?.runtimeId === t : !1;
9261
9321
  }
9262
9322
  se(() => {
9263
9323
  if (a(Y)) {
9264
- if (x() === "force") {
9324
+ if (R() === "force") {
9265
9325
  F(H, null);
9266
9326
  return;
9267
9327
  }
9268
- return Jl(a(Y), (m) => {
9269
- m.runtimeId !== t && F(H, m, !0);
9328
+ return Jl(a(Y), (g) => {
9329
+ g.runtimeId !== t && F(H, g, !0);
9270
9330
  });
9271
9331
  }
9272
9332
  }), se(() => {
9273
- const m = x() !== "force" && a(H) ? a(H).runtimeId : null, q = m ? "inherited" : "owned";
9274
- q !== a(R) && (F(R, q, !0), M(q === "inherited" ? "runtime-inherited" : "runtime-owned", { runtimeId: t, parentRuntimeId: m }));
9333
+ const g = R() !== "force" && a(H) ? a(H).runtimeId : null, q = g ? "inherited" : "owned";
9334
+ q !== a(x) && (F(x, q, !0), M(q === "inherited" ? "runtime-inherited" : "runtime-owned", { runtimeId: t, parentRuntimeId: g }));
9275
9335
  }), se(() => {
9276
- a(Q), d(), Qd(ue);
9336
+ a(Q), d(), tu(ue);
9277
9337
  }), se(() => {
9278
9338
  if (!(!a(Y) || !a(be)))
9279
9339
  return J = new Mn(a(Y), {
@@ -9298,7 +9358,7 @@ function su(n, e) {
9298
9358
  a(ne) && D?.setValue(a(ne));
9299
9359
  }), se(() => {
9300
9360
  if (!l() || !a(X)) return;
9301
- let m = !1;
9361
+ let g = !1;
9302
9362
  return i.initialize({
9303
9363
  coordinator: a(X),
9304
9364
  section: l(),
@@ -9308,10 +9368,10 @@ function su(n, e) {
9308
9368
  view: a(A),
9309
9369
  createDefaultController: Ve,
9310
9370
  onCompositionChanged: (q) => {
9311
- m || Ae(q);
9371
+ g || Ae(q);
9312
9372
  }
9313
9373
  }).then(() => {
9314
- m || (M("toolkit-ready", {
9374
+ g || (M("toolkit-ready", {
9315
9375
  runtimeId: t,
9316
9376
  assessmentId: a(B),
9317
9377
  sectionId: a(Q),
@@ -9321,11 +9381,11 @@ function su(n, e) {
9321
9381
  }).catch((q) => {
9322
9382
  F(j, q, !0), i.reportSectionError({ source: "section-runtime", error: q, timestamp: Date.now() }), M("runtime-error", { runtimeId: t, error: q });
9323
9383
  }), () => {
9324
- m = !0;
9384
+ g = !0;
9325
9385
  };
9326
9386
  }), se(() => {
9327
9387
  if (!a(Y)) return;
9328
- const m = a(Y), q = (Re) => {
9388
+ const g = a(Y), q = (Re) => {
9329
9389
  if (!kt(Re.target)) return;
9330
9390
  const pe = Re.detail;
9331
9391
  if (!pe?.element || !pe?.itemId) return;
@@ -9341,7 +9401,7 @@ function su(n, e) {
9341
9401
  if (!kt(Re.target)) return;
9342
9402
  const pe = Re.detail;
9343
9403
  if (!pe?.itemId) return;
9344
- const ct = i.handleItemSessionChanged(pe.itemId, pe.session);
9404
+ const ct = i.updateItemSession(pe.itemId, pe.session);
9345
9405
  lt({
9346
9406
  itemId: pe.itemId,
9347
9407
  canonicalItemId: i.getCanonicalItemId(pe.itemId),
@@ -9369,8 +9429,8 @@ function su(n, e) {
9369
9429
  timestamp: Date.now()
9370
9430
  });
9371
9431
  };
9372
- return m.addEventListener(zi, q), m.addEventListener(Di, we), m.addEventListener(ko, Ue), m.addEventListener(Sr, Vn), m.addEventListener(Tr, Ci), () => {
9373
- m.removeEventListener(zi, q), m.removeEventListener(Di, we), m.removeEventListener(ko, Ue), m.removeEventListener(Sr, Vn), m.removeEventListener(Tr, Ci);
9432
+ return g.addEventListener(zi, q), g.addEventListener(Di, we), g.addEventListener(ko, Ue), g.addEventListener(Sr, Vn), g.addEventListener(Tr, Ci), () => {
9433
+ g.removeEventListener(zi, q), g.removeEventListener(Di, we), g.removeEventListener(ko, Ue), g.removeEventListener(Sr, Vn), g.removeEventListener(Tr, Ci);
9374
9434
  };
9375
9435
  });
9376
9436
  async function Xt() {
@@ -9383,13 +9443,13 @@ function su(n, e) {
9383
9443
  throw new Error("Coordinator not initialized");
9384
9444
  return a(X).getServiceBundle();
9385
9445
  }
9386
- function ii(m) {
9446
+ function ii(g) {
9387
9447
  if (!a(X))
9388
9448
  throw new Error("Coordinator not initialized");
9389
- a(X).setHooks(m);
9449
+ a(X).setHooks(g);
9390
9450
  }
9391
- function oi(m) {
9392
- return i.navigateToItem(m);
9451
+ function oi(g) {
9452
+ return i.navigateToItem(g);
9393
9453
  }
9394
9454
  function hn() {
9395
9455
  return i.getCompositionModel();
@@ -9404,8 +9464,8 @@ function su(n, e) {
9404
9464
  await i.hydrate();
9405
9465
  }
9406
9466
  se(() => () => {
9407
- he !== null && typeof window < "u" && (window.cancelAnimationFrame(he), he = null), me = !1, i.dispose().catch((m) => {
9408
- F(j, m, !0);
9467
+ he !== null && typeof window < "u" && (window.cancelAnimationFrame(he), he = null), me = !1, i.dispose().catch((g) => {
9468
+ F(j, g, !0);
9409
9469
  });
9410
9470
  });
9411
9471
  var no = {
@@ -9420,94 +9480,94 @@ function su(n, e) {
9420
9480
  get assessmentId() {
9421
9481
  return s();
9422
9482
  },
9423
- set assessmentId(m) {
9424
- s(m), v();
9483
+ set assessmentId(g) {
9484
+ s(g), v();
9425
9485
  },
9426
9486
  get section() {
9427
9487
  return l();
9428
9488
  },
9429
- set section(m) {
9430
- l(m), v();
9489
+ set section(g) {
9490
+ l(g), v();
9431
9491
  },
9432
9492
  get sectionId() {
9433
9493
  return c();
9434
9494
  },
9435
- set sectionId(m) {
9436
- c(m), v();
9495
+ set sectionId(g) {
9496
+ c(g), v();
9437
9497
  },
9438
9498
  get attemptId() {
9439
9499
  return d();
9440
9500
  },
9441
- set attemptId(m) {
9442
- d(m), v();
9501
+ set attemptId(g) {
9502
+ d(g), v();
9443
9503
  },
9444
9504
  get view() {
9445
9505
  return u();
9446
9506
  },
9447
- set view(m) {
9448
- u(m), v();
9507
+ set view(g) {
9508
+ u(g), v();
9449
9509
  },
9450
9510
  get env() {
9451
9511
  return f();
9452
9512
  },
9453
- set env(m) {
9454
- f(m), v();
9513
+ set env(g) {
9514
+ f(g), v();
9455
9515
  },
9456
9516
  get lazyInit() {
9457
- return p();
9517
+ return m();
9458
9518
  },
9459
- set lazyInit(m) {
9460
- p(m), v();
9519
+ set lazyInit(g) {
9520
+ m(g), v();
9461
9521
  },
9462
9522
  get tools() {
9463
- return b();
9523
+ return S();
9464
9524
  },
9465
- set tools(m) {
9466
- b(m), v();
9525
+ set tools(g) {
9526
+ S(g), v();
9467
9527
  },
9468
9528
  get accessibility() {
9469
9529
  return h();
9470
9530
  },
9471
- set accessibility(m) {
9472
- h(m), v();
9531
+ set accessibility(g) {
9532
+ h(g), v();
9473
9533
  },
9474
9534
  get player() {
9475
- return S();
9535
+ return b();
9476
9536
  },
9477
- set player(m) {
9478
- S(m), v();
9537
+ set player(g) {
9538
+ b(g), v();
9479
9539
  },
9480
9540
  get playerType() {
9481
9541
  return w();
9482
9542
  },
9483
- set playerType(m) {
9484
- w(m), v();
9543
+ set playerType(g) {
9544
+ w(g), v();
9485
9545
  },
9486
9546
  get coordinator() {
9487
- return g();
9547
+ return p();
9488
9548
  },
9489
- set coordinator(m) {
9490
- g(m), v();
9549
+ set coordinator(g) {
9550
+ p(g), v();
9491
9551
  },
9492
9552
  get createSectionController() {
9493
9553
  return C();
9494
9554
  },
9495
- set createSectionController(m) {
9496
- C(m), v();
9555
+ set createSectionController(g) {
9556
+ C(g), v();
9497
9557
  },
9498
9558
  get isolation() {
9499
- return x();
9559
+ return R();
9500
9560
  },
9501
- set isolation(m) {
9502
- x(m), v();
9561
+ set isolation(g) {
9562
+ R(g), v();
9503
9563
  }
9504
- }, Ti = ou(), wi = vt(Ti);
9505
- at(wi, (m) => F(O, m), () => a(O));
9564
+ }, Ti = su(), wi = vt(Ti);
9565
+ at(wi, (g) => F(O, g), () => a(O));
9506
9566
  var io = Pe(wi, 2);
9507
9567
  return Hn(io, e, "default", {}), fe(n, Ti), He(no);
9508
9568
  }
9509
9569
  customElements.define("pie-assessment-toolkit", Ke(
9510
- su,
9570
+ lu,
9511
9571
  {
9512
9572
  assessmentId: { attribute: "assessment-id", type: "String" },
9513
9573
  section: { attribute: "section", type: "Object" },
@@ -9537,7 +9597,7 @@ customElements.define("pie-assessment-toolkit", Ke(
9537
9597
  ],
9538
9598
  { mode: "open" }
9539
9599
  ));
9540
- class au {
9600
+ class cu {
9541
9601
  createUniqueId(e, t, i) {
9542
9602
  const o = e.trim() || i;
9543
9603
  let r = o, s = 2;
@@ -9566,43 +9626,43 @@ class au {
9566
9626
  adapterItemRefs: []
9567
9627
  };
9568
9628
  const i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = (e.rubricBlocks || []).filter((f) => f.view === t), l = s.filter((f) => f.class === "instructions");
9569
- for (const [f, p] of (e.rubricBlocks || []).entries())
9570
- if (p.class === "stimulus" && p.passage && (p.view === "candidate" || p.view === t)) {
9571
- const b = this.normalizePassageEntity(
9572
- p.passage,
9629
+ for (const [f, m] of (e.rubricBlocks || []).entries())
9630
+ if (m.class === "stimulus" && m.passage && (m.view === "candidate" || m.view === t)) {
9631
+ const S = this.normalizePassageEntity(
9632
+ m.passage,
9573
9633
  o,
9574
9634
  `passage-${f + 1}`
9575
9635
  );
9576
- i.set(b.id, b);
9636
+ i.set(S.id, S);
9577
9637
  }
9578
9638
  const c = [], d = [];
9579
- for (const [f, p] of (e.assessmentItemRefs || []).entries()) {
9580
- if (!p.item) continue;
9581
- const b = p.item.id || p.identifier || p.item.name || `item-${f + 1}`, h = this.createUniqueId(
9582
- String(b),
9639
+ for (const [f, m] of (e.assessmentItemRefs || []).entries()) {
9640
+ if (!m.item) continue;
9641
+ const S = m.item.id || m.identifier || m.item.name || `item-${f + 1}`, h = this.createUniqueId(
9642
+ String(S),
9583
9643
  r,
9584
9644
  `item-${f + 1}`
9585
- ), S = p.item.passage && typeof p.item.passage == "object" ? (() => {
9586
- const C = typeof p.item?.passage?.id == "string" ? p.item.passage.id.trim() : "";
9645
+ ), b = m.item.passage && typeof m.item.passage == "object" ? (() => {
9646
+ const C = typeof m.item?.passage?.id == "string" ? m.item.passage.id.trim() : "";
9587
9647
  return C && i.has(C) ? i.get(C) : this.normalizePassageEntity(
9588
- p.item.passage,
9648
+ m.item.passage,
9589
9649
  o,
9590
9650
  `passage-${f + 1}`
9591
9651
  );
9592
9652
  })() : void 0, w = {
9593
- ...p.item,
9653
+ ...m.item,
9594
9654
  id: h,
9595
- passage: S || p.item.passage
9655
+ passage: b || m.item.passage
9596
9656
  };
9597
9657
  c.push(w);
9598
- const g = p.identifier || h || p.item.name || "";
9658
+ const p = m.identifier || h || m.item.name || "";
9599
9659
  d.push({
9600
- identifier: g,
9660
+ identifier: p,
9601
9661
  item: {
9602
9662
  id: h,
9603
- identifier: g
9663
+ identifier: p
9604
9664
  }
9605
- }), S && typeof S == "object" && S.id && !i.has(S.id) && i.set(S.id, S);
9665
+ }), b && typeof b == "object" && b.id && !i.has(b.id) && i.set(b.id, b);
9606
9666
  }
9607
9667
  const u = [
9608
9668
  ...Array.from(i.values()).map((f) => ({
@@ -9614,10 +9674,10 @@ class au {
9614
9674
  entity: f
9615
9675
  })),
9616
9676
  ...s.filter((f) => f.class === "rubric").map(
9617
- (f, p) => f?.passage ? this.normalizePassageEntity(
9677
+ (f, m) => f?.passage ? this.normalizePassageEntity(
9618
9678
  f.passage,
9619
9679
  o,
9620
- `rubric-passage-${p + 1}`
9680
+ `rubric-passage-${m + 1}`
9621
9681
  ) : null
9622
9682
  ).filter((f) => !!f?.config).map((f) => ({
9623
9683
  flavor: "rubric",
@@ -9634,11 +9694,11 @@ class au {
9634
9694
  };
9635
9695
  }
9636
9696
  }
9637
- class lu {
9697
+ class du {
9638
9698
  navigate(e) {
9639
9699
  if (e.isPageMode || e.index < 0 || e.index >= e.items.length) return null;
9640
- const t = e.items[e.currentItemIndex]?.id || "", i = e.items[e.index]?.id || "", o = Xc(
9641
- Jc(e.testAttemptSession, {
9700
+ const t = e.items[e.currentItemIndex]?.id || "", i = e.items[e.index]?.id || "", o = Zc(
9701
+ Qc(e.testAttemptSession, {
9642
9702
  currentItemIndex: e.index,
9643
9703
  currentSectionIdentifier: e.sectionIdentifier
9644
9704
  }),
@@ -9657,10 +9717,10 @@ class lu {
9657
9717
  };
9658
9718
  }
9659
9719
  }
9660
- class cu {
9720
+ class uu {
9661
9721
  createEmptyCanonicalAttempt(e) {
9662
9722
  const t = e.adapterItemRefs.map((i) => i?.identifier || i?.item?.id).filter((i) => typeof i == "string" && !!i);
9663
- return Yc({
9723
+ return Jc({
9664
9724
  testAttemptSessionIdentifier: `tas_${e.assessmentId}_${e.sectionId}`,
9665
9725
  assessmentId: e.assessmentId,
9666
9726
  seed: `${e.assessmentId}:${e.sectionId}`,
@@ -9689,7 +9749,7 @@ class cu {
9689
9749
  previousItemSession: e.itemSessions[e.itemId]
9690
9750
  }), i = t.itemId, o = t.session;
9691
9751
  let r = e.testAttemptSession;
9692
- o && i && (r = Zc(
9752
+ o && i && (r = ed(
9693
9753
  e.testAttemptSession,
9694
9754
  {
9695
9755
  itemIdentifier: i,
@@ -9716,9 +9776,9 @@ class cu {
9716
9776
  };
9717
9777
  }
9718
9778
  }
9719
- class du {
9779
+ class fu {
9720
9780
  constructor() {
9721
- this.contentService = new au(), this.sessionService = new cu(), this.itemNavigationService = new lu(), this.persistenceStrategy = null, this.persistenceContext = null, this.state = {
9781
+ this.contentService = new cu(), this.sessionService = new uu(), this.itemNavigationService = new du(), this.sessionPersistence = null, this.state = {
9722
9782
  input: null,
9723
9783
  viewModel: {
9724
9784
  passages: [],
@@ -9778,32 +9838,23 @@ class du {
9778
9838
  }
9779
9839
  }
9780
9840
  async updateInput(e) {
9781
- await this.initialize(e);
9782
- }
9783
- async setPersistenceStrategy(e) {
9784
- this.persistenceStrategy = e;
9841
+ const t = this.getSession();
9842
+ await this.initialize(e), t && await this.applySession(t, { mode: "replace" });
9785
9843
  }
9786
- setPersistenceContext(e) {
9787
- this.persistenceContext = e;
9844
+ configureSessionPersistence(e) {
9845
+ this.sessionPersistence = e;
9788
9846
  }
9789
9847
  async hydrate() {
9790
- if (!this.persistenceStrategy || !this.persistenceContext) return;
9791
- const e = await this.persistenceStrategy.load(
9792
- this.persistenceContext
9848
+ if (!this.sessionPersistence) return;
9849
+ const e = await this.sessionPersistence.strategy.loadSession(
9850
+ this.sessionPersistence.context
9793
9851
  );
9794
- if (!e || !this.state.testAttemptSession) return;
9795
- e.itemSessions && typeof e.itemSessions == "object" && (this.state.testAttemptSession.itemSessions = e.itemSessions);
9796
- const t = Array.isArray(e.visitedItemIdentifiers) ? e.visitedItemIdentifiers.filter(
9797
- (o) => typeof o == "string" && !!o
9798
- ) : [];
9799
- this.state.testAttemptSession.navigationState.visitedItemIdentifiers = t;
9800
- const i = typeof e.currentItemIndex == "number" && e.currentItemIndex >= 0 ? e.currentItemIndex : 0;
9801
- this.state.testAttemptSession.navigationState.currentItemIndex = i, this.state.viewModel.currentItemIndex = i, this.bootstrapCompletionFromSessions();
9852
+ e && await this.applySession(e, { mode: "replace" });
9802
9853
  }
9803
9854
  async persist() {
9804
- !this.persistenceStrategy || !this.persistenceContext || await this.persistenceStrategy.save(
9805
- this.persistenceContext,
9806
- this.getSessionState()
9855
+ this.sessionPersistence && await this.sessionPersistence.strategy.saveSession(
9856
+ this.sessionPersistence.context,
9857
+ this.getSession()
9807
9858
  );
9808
9859
  }
9809
9860
  dispose() {
@@ -9889,7 +9940,7 @@ class du {
9889
9940
  * Use this for serializing/restoring section session state across reloads.
9890
9941
  * This is intentionally compact and not a full runtime diagnostics view.
9891
9942
  */
9892
- getSessionState() {
9943
+ getSession() {
9893
9944
  return this.state.testAttemptSession ? this.sessionService.toSessionState(this.state.testAttemptSession) : null;
9894
9945
  }
9895
9946
  getSectionItemIdentifiers() {
@@ -9899,7 +9950,7 @@ class du {
9899
9950
  /**
9900
9951
  * Runtime/debugger shape scoped to the current section.
9901
9952
  * Use this for widgets that need a section-scoped live snapshot (debug panels, diagnostics).
9902
- * Unlike getSessionState(), this is optimized for runtime introspection, not host persistence.
9953
+ * Unlike getSession(), this is optimized for runtime introspection, not host persistence.
9903
9954
  */
9904
9955
  getRuntimeState() {
9905
9956
  if (!this.state.testAttemptSession) return null;
@@ -9948,7 +9999,7 @@ class du {
9948
9999
  isLoading: e
9949
10000
  };
9950
10001
  }
9951
- handleItemSessionChanged(e, t) {
10002
+ updateItemSession(e, t) {
9952
10003
  if (!this.state.testAttemptSession) return null;
9953
10004
  const i = this.getResolvedItemSessions(), o = this.sessionService.applyItemSessionChanged({
9954
10005
  itemId: e,
@@ -9990,6 +10041,20 @@ class du {
9990
10041
  timestamp: s
9991
10042
  }), o;
9992
10043
  }
10044
+ async applySession(e, t) {
10045
+ if (!this.state.testAttemptSession || !e) return;
10046
+ const i = t?.mode || "replace", o = e.itemSessions && typeof e.itemSessions == "object" ? e.itemSessions : {};
10047
+ if (i === "merge" ? this.state.testAttemptSession.itemSessions = {
10048
+ ...this.state.testAttemptSession.itemSessions,
10049
+ ...o
10050
+ } : this.state.testAttemptSession.itemSessions = o, Array.isArray(e.visitedItemIdentifiers)) {
10051
+ const r = e.visitedItemIdentifiers.filter(
10052
+ (s) => typeof s == "string" && !!s
10053
+ );
10054
+ this.state.testAttemptSession.navigationState.visitedItemIdentifiers = r;
10055
+ } else i === "replace" && (this.state.testAttemptSession.navigationState.visitedItemIdentifiers = []);
10056
+ typeof e.currentItemIndex == "number" && e.currentItemIndex >= 0 ? (this.state.testAttemptSession.navigationState.currentItemIndex = e.currentItemIndex, this.state.viewModel.currentItemIndex = e.currentItemIndex) : i === "replace" && (this.state.testAttemptSession.navigationState.currentItemIndex = 0, this.state.viewModel.currentItemIndex = 0), this.bootstrapCompletionFromSessions();
10057
+ }
9993
10058
  /**
9994
10059
  * Move between items inside the current section only.
9995
10060
  * Cross-section navigation belongs to the higher-level assessment player.
@@ -10174,15 +10239,15 @@ class du {
10174
10239
  }
10175
10240
  }
10176
10241
  }
10177
- var uu = /* @__PURE__ */ ve("<pie-tool-annotation-toolbar></pie-tool-annotation-toolbar>", 2), fu = /* @__PURE__ */ ve("<pie-assessment-toolkit><!> <!></pie-assessment-toolkit>", 2);
10178
- const hu = {
10242
+ var hu = /* @__PURE__ */ ve("<pie-tool-annotation-toolbar></pie-tool-annotation-toolbar>", 2), pu = /* @__PURE__ */ ve("<pie-assessment-toolkit><!> <!></pie-assessment-toolkit>", 2);
10243
+ const mu = {
10179
10244
  hash: "svelte-19m8zbn",
10180
10245
  code: ":host {display:block;width:100%;height:100%;min-height:0;}pie-assessment-toolkit.svelte-19m8zbn {display:flex;flex-direction:column;flex:1;width:100%;height:100%;min-height:0;overflow:hidden;}"
10181
10246
  };
10182
- function pu(n, e) {
10183
- Be(e, !0), et(n, hu);
10184
- let t = y(e, "assessmentId", 7, Lo), i = y(e, "runtime", 7, null), o = y(e, "section", 7, null), r = y(e, "sectionId", 7, ""), s = y(e, "attemptId", 7, ""), l = y(e, "playerType", 7, Hi), c = y(e, "player", 7, null), d = y(e, "lazyInit", 7, Oo), u = y(e, "tools", 7, null), f = y(e, "accessibility", 7, null), p = y(e, "coordinator", 7, null), b = y(e, "createSectionController", 7, null), h = y(e, "isolation", 7, Mo), S = y(e, "env", 7, null), w = /* @__PURE__ */ U(null), g = /* @__PURE__ */ U(null), C = /* @__PURE__ */ U(-1);
10185
- const x = Bn(), O = /* @__PURE__ */ N(() => i()?.assessmentId ?? t()), _ = /* @__PURE__ */ N(() => i()?.playerType ?? l()), H = /* @__PURE__ */ N(() => i()?.player ?? c()), R = /* @__PURE__ */ N(() => i()?.lazyInit ?? d()), D = /* @__PURE__ */ N(() => i()?.tools ?? u()), K = /* @__PURE__ */ N(() => i()?.accessibility ?? f()), J = /* @__PURE__ */ N(() => i()?.coordinator ?? p()), L = /* @__PURE__ */ N(() => i()?.createSectionController ?? b()), P = /* @__PURE__ */ N(() => i()?.isolation ?? h()), W = /* @__PURE__ */ N(() => i()?.env ?? S() ?? Zs), j = /* @__PURE__ */ N(() => r() || a(G)?.identifier || "");
10247
+ function gu(n, e) {
10248
+ Be(e, !0), et(n, mu);
10249
+ let t = y(e, "assessmentId", 7, Lo), i = y(e, "runtime", 7, null), o = y(e, "section", 7, null), r = y(e, "sectionId", 7, ""), s = y(e, "attemptId", 7, ""), l = y(e, "playerType", 7, Hi), c = y(e, "player", 7, null), d = y(e, "lazyInit", 7, Oo), u = y(e, "tools", 7, null), f = y(e, "accessibility", 7, null), m = y(e, "coordinator", 7, null), S = y(e, "createSectionController", 7, null), h = y(e, "isolation", 7, Mo), b = y(e, "env", 7, null), w = /* @__PURE__ */ U(null), p = /* @__PURE__ */ U(null), C = /* @__PURE__ */ U(-1);
10250
+ const R = Bn(), O = /* @__PURE__ */ N(() => i()?.assessmentId ?? t()), _ = /* @__PURE__ */ N(() => i()?.playerType ?? l()), H = /* @__PURE__ */ N(() => i()?.player ?? c()), x = /* @__PURE__ */ N(() => i()?.lazyInit ?? d()), D = /* @__PURE__ */ N(() => i()?.tools ?? u()), K = /* @__PURE__ */ N(() => i()?.accessibility ?? f()), J = /* @__PURE__ */ N(() => i()?.coordinator ?? m()), L = /* @__PURE__ */ N(() => i()?.createSectionController ?? S()), P = /* @__PURE__ */ N(() => i()?.isolation ?? h()), W = /* @__PURE__ */ N(() => i()?.env ?? b() ?? Zs), j = /* @__PURE__ */ N(() => r() || a(G)?.identifier || "");
10186
10251
  let G = /* @__PURE__ */ N(() => {
10187
10252
  if (!o()) return null;
10188
10253
  const A = o();
@@ -10192,7 +10257,7 @@ function pu(n, e) {
10192
10257
  };
10193
10258
  });
10194
10259
  function ye(A, $) {
10195
- x(A, $);
10260
+ R(A, $);
10196
10261
  }
10197
10262
  function me(A) {
10198
10263
  const $ = A.detail, ne = $?.composition || nr, be = typeof $?.version == "number" ? $.version : a(C) + 1;
@@ -10200,9 +10265,9 @@ function pu(n, e) {
10200
10265
  }
10201
10266
  function he(A, $) {
10202
10267
  const ne = A.detail;
10203
- $ === "toolkit-ready" && ne?.coordinator && F(g, ne.coordinator, !0), ye($, ne || {});
10268
+ $ === "toolkit-ready" && ne?.coordinator && F(p, ne.coordinator, !0), ye($, ne || {});
10204
10269
  }
10205
- const ue = /* @__PURE__ */ N(() => yn(a(D) || {})), ae = /* @__PURE__ */ N(() => ["section", "item", "passage"].some(($) => Vs(a(ue), $).includes("annotationToolbar"))), Y = /* @__PURE__ */ N(() => a(g)?.isToolEnabled?.("annotationToolbar") ?? a(ue)?.providers?.annotationToolbar?.enabled !== !1), M = /* @__PURE__ */ N(() => !!(a(g) && a(ae) && a(Y)));
10270
+ const ue = /* @__PURE__ */ N(() => yn(a(D) || {})), ae = /* @__PURE__ */ N(() => ["section", "item", "passage"].some(($) => Vs(a(ue), $).includes("annotationToolbar"))), Y = /* @__PURE__ */ N(() => a(p)?.isToolEnabled?.("annotationToolbar") ?? a(ue)?.providers?.annotationToolbar?.enabled !== !1), M = /* @__PURE__ */ N(() => !!(a(p) && a(ae) && a(Y)));
10206
10271
  let te = /* @__PURE__ */ U(!1);
10207
10272
  se(() => {
10208
10273
  if (!a(M) || a(te)) return;
@@ -10215,7 +10280,7 @@ function pu(n, e) {
10215
10280
  A = !0;
10216
10281
  };
10217
10282
  }), se(() => {
10218
- a(w) && (a(w).createSectionController = a(L) || (() => new du()));
10283
+ a(w) && (a(w).createSectionController = a(L) || (() => new fu()));
10219
10284
  });
10220
10285
  function z(A) {
10221
10286
  return a(w)?.navigateToItem ? a(w).navigateToItem(A) : null;
@@ -10236,7 +10301,7 @@ function pu(n, e) {
10236
10301
  function ge() {
10237
10302
  const A = a(j);
10238
10303
  if (!A) return null;
10239
- const $ = s() || void 0, ne = a(g) || a(J);
10304
+ const $ = s() || void 0, ne = a(p) || a(J);
10240
10305
  return ne?.getSectionController && ne.getSectionController({ sectionId: A, attemptId: $ }) || null;
10241
10306
  }
10242
10307
  function le() {
@@ -10318,16 +10383,16 @@ function pu(n, e) {
10318
10383
  f(A), v();
10319
10384
  },
10320
10385
  get coordinator() {
10321
- return p();
10386
+ return m();
10322
10387
  },
10323
10388
  set coordinator(A = null) {
10324
- p(A), v();
10389
+ m(A), v();
10325
10390
  },
10326
10391
  get createSectionController() {
10327
- return b();
10392
+ return S();
10328
10393
  },
10329
10394
  set createSectionController(A = null) {
10330
- b(A), v();
10395
+ S(A), v();
10331
10396
  },
10332
10397
  get isolation() {
10333
10398
  return h();
@@ -10336,18 +10401,18 @@ function pu(n, e) {
10336
10401
  h(A), v();
10337
10402
  },
10338
10403
  get env() {
10339
- return S();
10404
+ return b();
10340
10405
  },
10341
10406
  set env(A = null) {
10342
- S(A), v();
10407
+ b(A), v();
10343
10408
  }
10344
- }, X = fu();
10345
- k(() => E(X, "assessment-id", a(O))), k(() => E(X, "section", a(G))), k(() => E(X, "section-id", r())), k(() => E(X, "attempt-id", s())), k(() => E(X, "player-type", a(_))), k(() => E(X, "player", a(H))), k(() => E(X, "env", a(W))), k(() => E(X, "lazy-init", a(R))), k(() => E(X, "tools", a(D))), k(() => E(X, "accessibility", a(K))), k(() => E(X, "coordinator", a(J))), k(() => E(X, "isolation", a(P))), wt(X, 1, "svelte-19m8zbn");
10409
+ }, X = pu();
10410
+ k(() => E(X, "assessment-id", a(O))), k(() => E(X, "section", a(G))), k(() => E(X, "section-id", r())), k(() => E(X, "attempt-id", s())), k(() => E(X, "player-type", a(_))), k(() => E(X, "player", a(H))), k(() => E(X, "env", a(W))), k(() => E(X, "lazy-init", a(x))), k(() => E(X, "tools", a(D))), k(() => E(X, "accessibility", a(K))), k(() => E(X, "coordinator", a(J))), k(() => E(X, "isolation", a(P))), wt(X, 1, "svelte-19m8zbn");
10346
10411
  var B = Se(X);
10347
10412
  {
10348
10413
  var Q = (A) => {
10349
- var $ = uu();
10350
- E($, "enabled", !0), k(() => E($, "ttsService", a(g).ttsService)), k(() => E($, "highlightCoordinator", a(g).highlightCoordinator)), fe(A, $);
10414
+ var $ = hu();
10415
+ E($, "enabled", !0), k(() => E($, "ttsService", a(p).ttsService)), k(() => E($, "highlightCoordinator", a(p).highlightCoordinator)), fe(A, $);
10351
10416
  };
10352
10417
  st(B, (A) => {
10353
10418
  a(M) && a(te) && A(Q);
@@ -10357,7 +10422,7 @@ function pu(n, e) {
10357
10422
  return Hn(re, e, "default", {}), Ie(X), at(X, (A) => F(w, A), () => a(w)), Le("composition-changed", X, me), Le("toolkit-ready", X, (A) => he(A, "toolkit-ready")), Le("section-ready", X, (A) => he(A, "section-ready")), Le("runtime-error", X, (A) => he(A, "runtime-error")), Le("session-changed", X, (A) => he(A, "session-changed")), Le("runtime-owned", X, (A) => he(A, "runtime-owned")), Le("runtime-inherited", X, (A) => he(A, "runtime-inherited")), fe(n, X), He(qe);
10358
10423
  }
10359
10424
  customElements.define("pie-section-player-base", Ke(
10360
- pu,
10425
+ gu,
10361
10426
  {
10362
10427
  assessmentId: { attribute: "assessment-id", type: "String" },
10363
10428
  runtime: { type: "Object" },
@@ -10384,8 +10449,8 @@ customElements.define("pie-section-player-base", Ke(
10384
10449
  ],
10385
10450
  { mode: "open" }
10386
10451
  ));
10387
- var mu = /* @__PURE__ */ ve("<pie-section-toolbar></pie-section-toolbar>", 2), gu = /* @__PURE__ */ ve('<aside class="pie-section-player-toolbar-pane pie-section-player-toolbar-pane--left svelte-klnow4" aria-label="Section tools"><pie-section-toolbar></pie-section-toolbar></aside>', 2), vu = /* @__PURE__ */ ve('<aside class="pie-section-player-toolbar-pane pie-section-player-toolbar-pane--right svelte-klnow4" aria-label="Section tools"><pie-section-toolbar></pie-section-toolbar></aside>', 2), yu = /* @__PURE__ */ ve("<pie-section-toolbar></pie-section-toolbar>", 2), bu = /* @__PURE__ */ ve("<div><!> <div><!> <!> <!></div> <!></div>");
10388
- const Iu = {
10452
+ var vu = /* @__PURE__ */ ve("<pie-section-toolbar></pie-section-toolbar>", 2), yu = /* @__PURE__ */ ve('<aside class="pie-section-player-toolbar-pane pie-section-player-toolbar-pane--left svelte-klnow4" aria-label="Section tools"><pie-section-toolbar></pie-section-toolbar></aside>', 2), bu = /* @__PURE__ */ ve('<aside class="pie-section-player-toolbar-pane pie-section-player-toolbar-pane--right svelte-klnow4" aria-label="Section tools"><pie-section-toolbar></pie-section-toolbar></aside>', 2), Iu = /* @__PURE__ */ ve("<pie-section-toolbar></pie-section-toolbar>", 2), Su = /* @__PURE__ */ ve("<div><!> <div><!> <!> <!></div> <!></div>");
10453
+ const Tu = {
10389
10454
  hash: "svelte-klnow4",
10390
10455
  code: `:host {display:block;width:100%;height:100%;min-height:0;}.pie-section-player-shell.svelte-klnow4 {display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden;background:var(--pie-background-dark, #ecedf1);}.pie-section-player-layout-body.svelte-klnow4 {display:grid;grid-template-columns:minmax(0, 1fr);flex:1;min-height:0;overflow:hidden;background:var(--pie-background-dark, #ecedf1);}.pie-section-player-layout-body--inline.svelte-klnow4 {gap:0;}.pie-section-player-layout-body--inline-left.svelte-klnow4 {grid-template-columns:auto minmax(0, 1fr);}.pie-section-player-layout-body--inline-right.svelte-klnow4 {grid-template-columns:minmax(0, 1fr) auto;}.pie-section-player-toolbar-pane.svelte-klnow4 {min-height:0;overflow:auto;padding:0.25rem;box-sizing:border-box;background:var(--pie-background-dark, #ecedf1);}.pie-section-player-toolbar-pane--right.svelte-klnow4 {border-left:1px solid var(--pie-border-light, #e5e7eb);}.pie-section-player-toolbar-pane--left.svelte-klnow4 {border-right:1px solid var(--pie-border-light, #e5e7eb);}.pie-section-player-toolbar.svelte-klnow4 {margin:0.25rem;}.pie-section-player-toolbar-pane.svelte-klnow4 pie-section-toolbar:where(.svelte-klnow4) {margin:0.25rem;}
10391
10456
 
@@ -10393,8 +10458,8 @@ const Iu = {
10393
10458
  .pie-section-player-toolbar-pane--right.svelte-klnow4 {border:none;padding:0;}
10394
10459
  }`
10395
10460
  };
10396
- function Su(n, e) {
10397
- Be(e, !0), et(n, Iu);
10461
+ function wu(n, e) {
10462
+ Be(e, !0), et(n, Tu);
10398
10463
  let t = y(e, "showToolbar", 7, "false"), i = y(e, "toolbarPosition", 7, "right"), o = y(e, "enabledTools", 7, "");
10399
10464
  const r = /* @__PURE__ */ N(() => or(t(), !1) && i() !== "none"), s = /* @__PURE__ */ N(() => i() === "top"), l = /* @__PURE__ */ N(() => i() === "bottom"), c = /* @__PURE__ */ N(() => i() === "left" || i() === "right");
10400
10465
  var d = {
@@ -10416,52 +10481,52 @@ function Su(n, e) {
10416
10481
  set enabledTools(_ = "") {
10417
10482
  o(_), v();
10418
10483
  }
10419
- }, u = bu(), f = Se(u);
10484
+ }, u = Su(), f = Se(u);
10420
10485
  {
10421
- var p = (_) => {
10422
- var H = mu();
10486
+ var m = (_) => {
10487
+ var H = vu();
10423
10488
  k(() => E(H, "position", i())), k(() => E(H, "enabled-tools", o())), k(() => wt(H, 1, `pie-section-player-toolbar pie-section-player-toolbar--${i()}`, "svelte-klnow4")), fe(_, H);
10424
10489
  };
10425
10490
  st(f, (_) => {
10426
- a(r) && a(s) && _(p);
10491
+ a(r) && a(s) && _(m);
10427
10492
  });
10428
10493
  }
10429
- var b = Pe(f, 2), h = Se(b);
10494
+ var S = Pe(f, 2), h = Se(S);
10430
10495
  {
10431
- var S = (_) => {
10432
- var H = gu(), R = Se(H);
10433
- E(R, "position", "left"), k(() => E(R, "enabled-tools", o())), wt(R, 1, "svelte-klnow4"), Ie(H), fe(_, H);
10496
+ var b = (_) => {
10497
+ var H = yu(), x = Se(H);
10498
+ E(x, "position", "left"), k(() => E(x, "enabled-tools", o())), wt(x, 1, "svelte-klnow4"), Ie(H), fe(_, H);
10434
10499
  };
10435
10500
  st(h, (_) => {
10436
- a(r) && a(c) && i() === "left" && _(S);
10501
+ a(r) && a(c) && i() === "left" && _(b);
10437
10502
  });
10438
10503
  }
10439
10504
  var w = Pe(h, 2);
10440
10505
  Hn(w, e, "default", {});
10441
- var g = Pe(w, 2);
10506
+ var p = Pe(w, 2);
10442
10507
  {
10443
10508
  var C = (_) => {
10444
- var H = vu(), R = Se(H);
10445
- E(R, "position", "right"), k(() => E(R, "enabled-tools", o())), wt(R, 1, "svelte-klnow4"), Ie(H), fe(_, H);
10509
+ var H = bu(), x = Se(H);
10510
+ E(x, "position", "right"), k(() => E(x, "enabled-tools", o())), wt(x, 1, "svelte-klnow4"), Ie(H), fe(_, H);
10446
10511
  };
10447
- st(g, (_) => {
10512
+ st(p, (_) => {
10448
10513
  a(r) && a(c) && i() === "right" && _(C);
10449
10514
  });
10450
10515
  }
10451
- Ie(b);
10452
- var x = Pe(b, 2);
10516
+ Ie(S);
10517
+ var R = Pe(S, 2);
10453
10518
  {
10454
10519
  var O = (_) => {
10455
- var H = yu();
10520
+ var H = Iu();
10456
10521
  k(() => E(H, "position", i())), k(() => E(H, "enabled-tools", o())), k(() => wt(H, 1, `pie-section-player-toolbar pie-section-player-toolbar--${i()}`, "svelte-klnow4")), fe(_, H);
10457
10522
  };
10458
- st(x, (_) => {
10523
+ st(R, (_) => {
10459
10524
  a(r) && a(l) && _(O);
10460
10525
  });
10461
10526
  }
10462
10527
  return Ie(u), k(() => {
10463
10528
  wt(u, 1, `pie-section-player-shell pie-section-player-shell--${i()}`, "svelte-klnow4"), wt(
10464
- b,
10529
+ S,
10465
10530
  1,
10466
10531
  `pie-section-player-layout-body ${a(r) && a(c) ? `pie-section-player-layout-body--inline pie-section-player-layout-body--inline-${i()}` : ""}`,
10467
10532
  "svelte-klnow4"
@@ -10469,7 +10534,7 @@ function Su(n, e) {
10469
10534
  }), fe(n, u), He(d);
10470
10535
  }
10471
10536
  customElements.define("pie-section-player-shell", Ke(
10472
- Su,
10537
+ wu,
10473
10538
  {
10474
10539
  showToolbar: { attribute: "show-toolbar", type: "String" },
10475
10540
  toolbarPosition: { attribute: "toolbar-position", type: "String" },
@@ -10479,32 +10544,32 @@ customElements.define("pie-section-player-shell", Ke(
10479
10544
  [],
10480
10545
  { mode: "open" }
10481
10546
  ));
10482
- var Tu = /* @__PURE__ */ ve('<div class="pie-section-player-layout-scaffold-anchor svelte-9tgqlk" aria-hidden="true"></div> <pie-section-player-base><pie-section-player-shell><!></pie-section-player-shell></pie-section-player-base>', 3);
10483
- const wu = {
10547
+ var Cu = /* @__PURE__ */ ve('<div class="pie-section-player-layout-scaffold-anchor svelte-9tgqlk" aria-hidden="true"></div> <pie-section-player-base><pie-section-player-shell><!></pie-section-player-shell></pie-section-player-base>', 3);
10548
+ const _u = {
10484
10549
  hash: "svelte-9tgqlk",
10485
10550
  code: ".pie-section-player-layout-scaffold-anchor.svelte-9tgqlk {display:none;}"
10486
10551
  };
10487
10552
  function ea(n, e) {
10488
- Be(e, !0), et(n, wu);
10489
- let t = y(e, "runtime", 7, null), i = y(e, "section", 7, null), o = y(e, "sectionId", 7, ""), r = y(e, "attemptId", 7, ""), s = y(e, "showToolbar", 7, "false"), l = y(e, "toolbarPosition", 7, "right"), c = y(e, "enabledTools", 7, ""), d = y(e, "cardRenderContext", 7, null), u = y(e, "onCompositionChanged", 7), f = y(e, "onSectionReady", 7), p = y(e, "onRuntimeError", 7), b = y(e, "onSessionChanged", 7), h = y(e, "onRuntimeOwned", 7), S = y(e, "onRuntimeInherited", 7), w = y(e, "onToolkitReady", 7), g = /* @__PURE__ */ U(null), C = /* @__PURE__ */ U(null), x = /* @__PURE__ */ U(null);
10490
- const O = /* @__PURE__ */ N(() => ir(a(g))), _ = /* @__PURE__ */ N(() => or(s(), !1));
10553
+ Be(e, !0), et(n, _u);
10554
+ let t = y(e, "runtime", 7, null), i = y(e, "section", 7, null), o = y(e, "sectionId", 7, ""), r = y(e, "attemptId", 7, ""), s = y(e, "showToolbar", 7, "false"), l = y(e, "toolbarPosition", 7, "right"), c = y(e, "enabledTools", 7, ""), d = y(e, "cardRenderContext", 7, null), u = y(e, "onCompositionChanged", 7), f = y(e, "onSectionReady", 7), m = y(e, "onRuntimeError", 7), S = y(e, "onSessionChanged", 7), h = y(e, "onRuntimeOwned", 7), b = y(e, "onRuntimeInherited", 7), w = y(e, "onToolkitReady", 7), p = /* @__PURE__ */ U(null), C = /* @__PURE__ */ U(null), R = /* @__PURE__ */ U(null);
10555
+ const O = /* @__PURE__ */ N(() => ir(a(p))), _ = /* @__PURE__ */ N(() => or(s(), !1));
10491
10556
  function H(z) {
10492
10557
  u()?.(z);
10493
10558
  }
10494
- function R(z) {
10559
+ function x(z) {
10495
10560
  f()?.(z);
10496
10561
  }
10497
10562
  function D(z) {
10498
- p()?.(z);
10563
+ m()?.(z);
10499
10564
  }
10500
10565
  function K(z) {
10501
- b()?.(z);
10566
+ S()?.(z);
10502
10567
  }
10503
10568
  function J(z) {
10504
10569
  h()?.(z);
10505
10570
  }
10506
10571
  function L(z) {
10507
- S()?.(z);
10572
+ b()?.(z);
10508
10573
  }
10509
10574
  function P(z) {
10510
10575
  w()?.(z);
@@ -10533,11 +10598,11 @@ function ea(n, e) {
10533
10598
  }
10534
10599
  se(() => {
10535
10600
  if (!(!a(O) || !d()))
10536
- return F(x, ud(a(O), d()), !0), () => {
10537
- a(x)?.disconnect(), F(x, null);
10601
+ return F(R, hd(a(O), d()), !0), () => {
10602
+ a(R)?.disconnect(), F(R, null);
10538
10603
  };
10539
10604
  }), se(() => {
10540
- d() && a(x)?.setValue(d());
10605
+ d() && a(R)?.setValue(d());
10541
10606
  });
10542
10607
  var he = {
10543
10608
  navigateToItem: W,
@@ -10606,16 +10671,16 @@ function ea(n, e) {
10606
10671
  f(z), v();
10607
10672
  },
10608
10673
  get onRuntimeError() {
10609
- return p();
10674
+ return m();
10610
10675
  },
10611
10676
  set onRuntimeError(z) {
10612
- p(z), v();
10677
+ m(z), v();
10613
10678
  },
10614
10679
  get onSessionChanged() {
10615
- return b();
10680
+ return S();
10616
10681
  },
10617
10682
  set onSessionChanged(z) {
10618
- b(z), v();
10683
+ S(z), v();
10619
10684
  },
10620
10685
  get onRuntimeOwned() {
10621
10686
  return h();
@@ -10624,10 +10689,10 @@ function ea(n, e) {
10624
10689
  h(z), v();
10625
10690
  },
10626
10691
  get onRuntimeInherited() {
10627
- return S();
10692
+ return b();
10628
10693
  },
10629
10694
  set onRuntimeInherited(z) {
10630
- S(z), v();
10695
+ b(z), v();
10631
10696
  },
10632
10697
  get onToolkitReady() {
10633
10698
  return w();
@@ -10635,14 +10700,14 @@ function ea(n, e) {
10635
10700
  set onToolkitReady(z) {
10636
10701
  w(z), v();
10637
10702
  }
10638
- }, ue = Tu(), ae = vt(ue);
10639
- at(ae, (z) => F(g, z), () => a(g));
10703
+ }, ue = Cu(), ae = vt(ue);
10704
+ at(ae, (z) => F(p, z), () => a(p));
10640
10705
  var Y = Pe(ae, 2);
10641
10706
  k(() => E(Y, "runtime", t())), k(() => E(Y, "section", i())), k(() => E(Y, "section-id", o())), k(() => E(Y, "attempt-id", r()));
10642
10707
  var M = Se(Y);
10643
10708
  k(() => E(M, "show-toolbar", a(_))), k(() => E(M, "toolbar-position", l())), k(() => E(M, "enabled-tools", c()));
10644
10709
  var te = Se(M);
10645
- return Hn(te, e, "default", {}), Ie(M), Ie(Y), at(Y, (z) => F(C, z), () => a(C)), Le("composition-changed", Y, H), Le("section-ready", Y, R), Le("runtime-error", Y, D), Le("session-changed", Y, K), Le("runtime-owned", Y, J), Le("runtime-inherited", Y, L), Le("toolkit-ready", Y, P), fe(n, ue), He(he);
10710
+ return Hn(te, e, "default", {}), Ie(M), Ie(Y), at(Y, (z) => F(C, z), () => a(C)), Le("composition-changed", Y, H), Le("section-ready", Y, x), Le("runtime-error", Y, D), Le("session-changed", Y, K), Le("runtime-owned", Y, J), Le("runtime-inherited", Y, L), Le("toolkit-ready", Y, P), fe(n, ue), He(he);
10646
10711
  }
10647
10712
  Ke(
10648
10713
  ea,
@@ -10675,72 +10740,72 @@ Ke(
10675
10740
  );
10676
10741
  function Qi(n, e) {
10677
10742
  Be(e, !0);
10678
- let t = y(e, "assessmentId", 7), i = y(e, "runtime", 7, null), o = y(e, "section", 7, null), r = y(e, "sectionId", 7, ""), s = y(e, "attemptId", 7, ""), l = y(e, "playerType", 7), c = y(e, "player", 7), d = y(e, "lazyInit", 7), u = y(e, "tools", 7), f = y(e, "accessibility", 7), p = y(e, "coordinator", 7), b = y(e, "createSectionController", 7), h = y(e, "isolation", 7), S = y(e, "env", 7), w = y(e, "iifeBundleHost", 7), g = y(e, "showToolbar", 7, "false"), C = y(e, "toolbarPosition", 7, "right"), x = y(e, "enabledTools", 7, ""), O = y(e, "itemToolbarTools", 7, ""), _ = y(e, "passageToolbarTools", 7, ""), H = y(e, "playerActionConfig", 23, () => ({
10743
+ let t = y(e, "assessmentId", 7), i = y(e, "runtime", 7, null), o = y(e, "section", 7, null), r = y(e, "sectionId", 7, ""), s = y(e, "attemptId", 7, ""), l = y(e, "playerType", 7), c = y(e, "player", 7), d = y(e, "lazyInit", 7), u = y(e, "tools", 7), f = y(e, "accessibility", 7), m = y(e, "coordinator", 7), S = y(e, "createSectionController", 7), h = y(e, "isolation", 7), b = y(e, "env", 7), w = y(e, "iifeBundleHost", 7), p = y(e, "showToolbar", 7, "false"), C = y(e, "toolbarPosition", 7, "right"), R = y(e, "enabledTools", 7, ""), O = y(e, "itemToolbarTools", 7, ""), _ = y(e, "passageToolbarTools", 7, ""), H = y(e, "playerActionConfig", 23, () => ({
10679
10744
  stateKey: "__sectionPlayerAppliedParams",
10680
10745
  includeSessionRefInState: !1
10681
- })), R = y(e, "policies", 7, Ar);
10746
+ })), x = y(e, "policies", 7, Ar);
10682
10747
  const D = Bn();
10683
10748
  let K = /* @__PURE__ */ U(sn(Qs(nr))), J = /* @__PURE__ */ U(!1), L = /* @__PURE__ */ U(null), P = /* @__PURE__ */ U(!1), W = /* @__PURE__ */ U(!1), j = /* @__PURE__ */ U(!1), G = /* @__PURE__ */ U(!1), ye = /* @__PURE__ */ U(!1);
10684
- const me = /* @__PURE__ */ N(() => a(K).compositionModel), he = /* @__PURE__ */ N(() => a(K).passages), ue = /* @__PURE__ */ N(() => a(K).items), ae = /* @__PURE__ */ N(() => a(K).renderables), Y = /* @__PURE__ */ N(() => a(K).renderablesSignature), M = /* @__PURE__ */ N(() => Pd({
10749
+ const me = /* @__PURE__ */ N(() => a(K).compositionModel), he = /* @__PURE__ */ N(() => a(K).passages), ue = /* @__PURE__ */ N(() => a(K).items), ae = /* @__PURE__ */ N(() => a(K).renderables), Y = /* @__PURE__ */ N(() => a(K).renderablesSignature), M = /* @__PURE__ */ N(() => Ad({
10685
10750
  assessmentId: t(),
10686
10751
  playerType: l(),
10687
10752
  player: c(),
10688
10753
  lazyInit: d(),
10689
10754
  tools: u(),
10690
10755
  accessibility: f(),
10691
- coordinator: p(),
10692
- createSectionController: b(),
10756
+ coordinator: m(),
10757
+ createSectionController: S(),
10693
10758
  isolation: h(),
10694
- env: S(),
10759
+ env: b(),
10695
10760
  runtime: i(),
10696
- enabledTools: x(),
10761
+ enabledTools: R(),
10697
10762
  itemToolbarTools: O(),
10698
10763
  passageToolbarTools: _()
10699
- })), te = /* @__PURE__ */ N(() => a(M).effectiveRuntime), z = /* @__PURE__ */ N(() => a(M).playerRuntime), ke = /* @__PURE__ */ N(() => a(z).resolvedPlayerDefinition), V = /* @__PURE__ */ N(() => a(z).resolvedPlayerTag), ge = /* @__PURE__ */ N(() => a(z).resolvedPlayerAttributes), le = /* @__PURE__ */ N(() => a(z).resolvedPlayerProps), Ve = /* @__PURE__ */ N(() => a(z).resolvedPlayerEnv), qe = /* @__PURE__ */ N(() => a(z).strategy), X = /* @__PURE__ */ N(() => jd(H())), B = /* @__PURE__ */ N(() => ({
10764
+ })), te = /* @__PURE__ */ N(() => a(M).effectiveRuntime), z = /* @__PURE__ */ N(() => a(M).playerRuntime), ke = /* @__PURE__ */ N(() => a(z).resolvedPlayerDefinition), V = /* @__PURE__ */ N(() => a(z).resolvedPlayerTag), ge = /* @__PURE__ */ N(() => a(z).resolvedPlayerAttributes), le = /* @__PURE__ */ N(() => a(z).resolvedPlayerProps), Ve = /* @__PURE__ */ N(() => a(z).resolvedPlayerEnv), qe = /* @__PURE__ */ N(() => a(z).strategy), X = /* @__PURE__ */ N(() => qd(H())), B = /* @__PURE__ */ N(() => ({
10700
10765
  resolvedPlayerTag: a(V),
10701
10766
  playerAction: a(X)
10702
- })), Q = /* @__PURE__ */ N(() => or(g(), !1)), re = /* @__PURE__ */ N(() => $d({
10703
- mode: R().readiness.mode,
10767
+ })), Q = /* @__PURE__ */ N(() => or(p(), !1)), re = /* @__PURE__ */ N(() => Yd({
10768
+ mode: x().readiness.mode,
10704
10769
  signals: {
10705
10770
  sectionReady: a(P),
10706
10771
  interactionReady: a(P),
10707
10772
  allLoadingComplete: a(J),
10708
10773
  runtimeError: a(G)
10709
10774
  },
10710
- reason: `policy:${R().readiness.mode}`
10775
+ reason: `policy:${x().readiness.mode}`
10711
10776
  }));
10712
- function A(m) {
10713
- F(K, Ad(m), !0), D("composition-changed", m.detail);
10777
+ function A(g) {
10778
+ F(K, xd(g), !0), D("composition-changed", g.detail);
10714
10779
  }
10715
- function $(m) {
10716
- const q = m.detail;
10780
+ function $(g) {
10781
+ const q = g.detail;
10717
10782
  F(J, q?.elementsLoaded === !0);
10718
10783
  }
10719
- function ne(m) {
10784
+ function ne(g) {
10720
10785
  F(P, !0);
10721
10786
  }
10722
- function be(m) {
10723
- F(G, !0), D("runtime-error", m.detail || {});
10787
+ function be(g) {
10788
+ F(G, !0), D("runtime-error", g.detail || {});
10724
10789
  }
10725
- function ze(m) {
10726
- D("session-changed", m.detail || {});
10790
+ function ze(g) {
10791
+ D("session-changed", g.detail || {});
10727
10792
  }
10728
- function Ae(m) {
10729
- D("runtime-owned", m.detail || {});
10793
+ function Ae(g) {
10794
+ D("runtime-owned", g.detail || {});
10730
10795
  }
10731
- function lt(m) {
10732
- D("runtime-inherited", m.detail || {});
10796
+ function lt(g) {
10797
+ D("runtime-inherited", g.detail || {});
10733
10798
  }
10734
10799
  async function kt() {
10735
10800
  if (a(ye)) return;
10736
- const m = await a(L)?.waitForSectionController?.(2500);
10737
- m && (F(ye, !0), D("section-controller-ready", {
10801
+ const g = await a(L)?.waitForSectionController?.(2500);
10802
+ g && (F(ye, !0), D("section-controller-ready", {
10738
10803
  sectionId: r(),
10739
10804
  attemptId: s() || void 0,
10740
- controller: m
10805
+ controller: g
10741
10806
  }));
10742
10807
  }
10743
- function Xt(m) {
10808
+ function Xt(g) {
10744
10809
  kt();
10745
10810
  }
10746
10811
  function We() {
@@ -10774,27 +10839,27 @@ function Qi(n, e) {
10774
10839
  function eo() {
10775
10840
  return a(re);
10776
10841
  }
10777
- function ri(m) {
10778
- return a(L)?.navigateToItem?.(m) === !0;
10842
+ function ri(g) {
10843
+ return a(L)?.navigateToItem?.(g) === !0;
10779
10844
  }
10780
10845
  function to() {
10781
- const m = We();
10782
- return m.canNext ? ri(m.currentIndex + 1) : !1;
10846
+ const g = We();
10847
+ return g.canNext ? ri(g.currentIndex + 1) : !1;
10783
10848
  }
10784
10849
  function no() {
10785
- const m = We();
10786
- return m.canPrevious ? ri(m.currentIndex - 1) : !1;
10850
+ const g = We();
10851
+ return g.canPrevious ? ri(g.currentIndex - 1) : !1;
10787
10852
  }
10788
10853
  function Ti() {
10789
- const m = a(L)?.getSectionController?.() || null;
10790
- return m && !a(ye) && (F(ye, !0), D("section-controller-ready", {
10854
+ const g = a(L)?.getSectionController?.() || null;
10855
+ return g && !a(ye) && (F(ye, !0), D("section-controller-ready", {
10791
10856
  sectionId: r(),
10792
10857
  attemptId: s() || void 0,
10793
- controller: m
10794
- })), m;
10858
+ controller: g
10859
+ })), g;
10795
10860
  }
10796
- async function wi(m = 5e3) {
10797
- const q = await a(L)?.waitForSectionController?.(m);
10861
+ async function wi(g = 5e3) {
10862
+ const q = await a(L)?.waitForSectionController?.(g);
10798
10863
  return q && !a(ye) && (F(ye, !0), D("section-controller-ready", {
10799
10864
  sectionId: r(),
10800
10865
  attemptId: s() || void 0,
@@ -10802,8 +10867,8 @@ function Qi(n, e) {
10802
10867
  })), q || null;
10803
10868
  }
10804
10869
  se(() => {
10805
- a(ke)?.ensureDefined?.().catch((m) => {
10806
- console.error("[section-player-layout-kernel] Failed to load item player component:", m);
10870
+ a(ke)?.ensureDefined?.().catch((g) => {
10871
+ console.error("[section-player-layout-kernel] Failed to load item player component:", g);
10807
10872
  });
10808
10873
  }), se(() => {
10809
10874
  D("readiness-change", a(re)), a(re).interactionReady && !a(W) && (F(W, !0), D("interaction-ready", a(re))), a(re).allLoadingComplete && !a(j) && (F(j, !0), D("ready", a(re)));
@@ -10821,137 +10886,137 @@ function Qi(n, e) {
10821
10886
  get assessmentId() {
10822
10887
  return t();
10823
10888
  },
10824
- set assessmentId(m) {
10825
- t(m), v();
10889
+ set assessmentId(g) {
10890
+ t(g), v();
10826
10891
  },
10827
10892
  get runtime() {
10828
10893
  return i();
10829
10894
  },
10830
- set runtime(m = null) {
10831
- i(m), v();
10895
+ set runtime(g = null) {
10896
+ i(g), v();
10832
10897
  },
10833
10898
  get section() {
10834
10899
  return o();
10835
10900
  },
10836
- set section(m = null) {
10837
- o(m), v();
10901
+ set section(g = null) {
10902
+ o(g), v();
10838
10903
  },
10839
10904
  get sectionId() {
10840
10905
  return r();
10841
10906
  },
10842
- set sectionId(m = "") {
10843
- r(m), v();
10907
+ set sectionId(g = "") {
10908
+ r(g), v();
10844
10909
  },
10845
10910
  get attemptId() {
10846
10911
  return s();
10847
10912
  },
10848
- set attemptId(m = "") {
10849
- s(m), v();
10913
+ set attemptId(g = "") {
10914
+ s(g), v();
10850
10915
  },
10851
10916
  get playerType() {
10852
10917
  return l();
10853
10918
  },
10854
- set playerType(m) {
10855
- l(m), v();
10919
+ set playerType(g) {
10920
+ l(g), v();
10856
10921
  },
10857
10922
  get player() {
10858
10923
  return c();
10859
10924
  },
10860
- set player(m) {
10861
- c(m), v();
10925
+ set player(g) {
10926
+ c(g), v();
10862
10927
  },
10863
10928
  get lazyInit() {
10864
10929
  return d();
10865
10930
  },
10866
- set lazyInit(m) {
10867
- d(m), v();
10931
+ set lazyInit(g) {
10932
+ d(g), v();
10868
10933
  },
10869
10934
  get tools() {
10870
10935
  return u();
10871
10936
  },
10872
- set tools(m) {
10873
- u(m), v();
10937
+ set tools(g) {
10938
+ u(g), v();
10874
10939
  },
10875
10940
  get accessibility() {
10876
10941
  return f();
10877
10942
  },
10878
- set accessibility(m) {
10879
- f(m), v();
10943
+ set accessibility(g) {
10944
+ f(g), v();
10880
10945
  },
10881
10946
  get coordinator() {
10882
- return p();
10947
+ return m();
10883
10948
  },
10884
- set coordinator(m) {
10885
- p(m), v();
10949
+ set coordinator(g) {
10950
+ m(g), v();
10886
10951
  },
10887
10952
  get createSectionController() {
10888
- return b();
10953
+ return S();
10889
10954
  },
10890
- set createSectionController(m) {
10891
- b(m), v();
10955
+ set createSectionController(g) {
10956
+ S(g), v();
10892
10957
  },
10893
10958
  get isolation() {
10894
10959
  return h();
10895
10960
  },
10896
- set isolation(m) {
10897
- h(m), v();
10961
+ set isolation(g) {
10962
+ h(g), v();
10898
10963
  },
10899
10964
  get env() {
10900
- return S();
10965
+ return b();
10901
10966
  },
10902
- set env(m) {
10903
- S(m), v();
10967
+ set env(g) {
10968
+ b(g), v();
10904
10969
  },
10905
10970
  get iifeBundleHost() {
10906
10971
  return w();
10907
10972
  },
10908
- set iifeBundleHost(m) {
10909
- w(m), v();
10973
+ set iifeBundleHost(g) {
10974
+ w(g), v();
10910
10975
  },
10911
10976
  get showToolbar() {
10912
- return g();
10977
+ return p();
10913
10978
  },
10914
- set showToolbar(m = "false") {
10915
- g(m), v();
10979
+ set showToolbar(g = "false") {
10980
+ p(g), v();
10916
10981
  },
10917
10982
  get toolbarPosition() {
10918
10983
  return C();
10919
10984
  },
10920
- set toolbarPosition(m = "right") {
10921
- C(m), v();
10985
+ set toolbarPosition(g = "right") {
10986
+ C(g), v();
10922
10987
  },
10923
10988
  get enabledTools() {
10924
- return x();
10989
+ return R();
10925
10990
  },
10926
- set enabledTools(m = "") {
10927
- x(m), v();
10991
+ set enabledTools(g = "") {
10992
+ R(g), v();
10928
10993
  },
10929
10994
  get itemToolbarTools() {
10930
10995
  return O();
10931
10996
  },
10932
- set itemToolbarTools(m = "") {
10933
- O(m), v();
10997
+ set itemToolbarTools(g = "") {
10998
+ O(g), v();
10934
10999
  },
10935
11000
  get passageToolbarTools() {
10936
11001
  return _();
10937
11002
  },
10938
- set passageToolbarTools(m = "") {
10939
- _(m), v();
11003
+ set passageToolbarTools(g = "") {
11004
+ _(g), v();
10940
11005
  },
10941
11006
  get playerActionConfig() {
10942
11007
  return H();
10943
11008
  },
10944
- set playerActionConfig(m = {
11009
+ set playerActionConfig(g = {
10945
11010
  stateKey: "__sectionPlayerAppliedParams",
10946
11011
  includeSessionRefInState: !1
10947
11012
  }) {
10948
- H(m), v();
11013
+ H(g), v();
10949
11014
  },
10950
11015
  get policies() {
10951
- return R();
11016
+ return x();
10952
11017
  },
10953
- set policies(m = Ar) {
10954
- R(m), v();
11018
+ set policies(g = Ar) {
11019
+ x(g), v();
10955
11020
  }
10956
11021
  };
10957
11022
  return at(
@@ -10982,12 +11047,12 @@ function Qi(n, e) {
10982
11047
  return C();
10983
11048
  },
10984
11049
  get enabledTools() {
10985
- return x();
11050
+ return R();
10986
11051
  },
10987
11052
  get cardRenderContext() {
10988
11053
  return a(B);
10989
11054
  },
10990
- children: (m, q) => {
11055
+ children: (g, q) => {
10991
11056
  var we = hi(), Ue = vt(we);
10992
11057
  Hn(
10993
11058
  Ue,
@@ -11049,11 +11114,11 @@ function Qi(n, e) {
11049
11114
  },
11050
11115
  onItemsPaneElementsLoaded: $
11051
11116
  }
11052
- ), fe(m, we);
11117
+ ), fe(g, we);
11053
11118
  },
11054
11119
  $$slots: { default: !0 }
11055
11120
  }),
11056
- (m) => F(L, m, !0),
11121
+ (g) => F(L, g, !0),
11057
11122
  () => a(L)
11058
11123
  ), He(io);
11059
11124
  }
@@ -11097,30 +11162,30 @@ Ke(
11097
11162
  ],
11098
11163
  { mode: "open" }
11099
11164
  );
11100
- var Cu = /* @__PURE__ */ ve('<div role="separator" aria-orientation="vertical"><span class="pie-section-player-split-divider-handle svelte-1ncvi88"></span></div>');
11101
- const _u = {
11165
+ var Eu = /* @__PURE__ */ ve('<div role="separator" aria-orientation="vertical"><span class="pie-section-player-split-divider-handle svelte-1ncvi88"></span></div>');
11166
+ const Pu = {
11102
11167
  hash: "svelte-1ncvi88",
11103
11168
  code: `.pie-section-player-split-divider.svelte-1ncvi88 {border:none;padding:0;margin:0;font:inherit;align-self:stretch;height:100%;min-height:0;position:relative;cursor:col-resize;background:var(--pie-secondary-background, #f3f4f6);display:flex;align-items:center;justify-content:center;user-select:none;touch-action:none;transition:background 0.2s ease;}.pie-section-player-split-divider.svelte-1ncvi88:hover {background:var(--pie-border-light, #e5e7eb);}.pie-section-player-split-divider.svelte-1ncvi88:focus {outline:2px solid var(--pie-focus-checked-border, #1976d2);outline-offset:-2px;}.pie-section-player-split-divider-handle.svelte-1ncvi88 {position:absolute;inset:0;margin:auto;width:6px;height:60px;background:var(--pie-blue-grey-600, #9ca3af);border-radius:3px;transition:all 0.2s ease;pointer-events:none;}.pie-section-player-split-divider-handle.svelte-1ncvi88::before {content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:2px;height:20px;background:var(--pie-white, white);border-radius:1px;opacity:0.8;}.pie-section-player-split-divider.svelte-1ncvi88:hover .pie-section-player-split-divider-handle:where(.svelte-1ncvi88),
11104
11169
  .pie-section-player-split-divider.svelte-1ncvi88:focus .pie-section-player-split-divider-handle:where(.svelte-1ncvi88),
11105
11170
  .pie-section-player-split-divider--dragging.svelte-1ncvi88 .pie-section-player-split-divider-handle:where(.svelte-1ncvi88) {background:var(--pie-primary, #1976d2);height:80px;box-shadow:0 2px 8px rgba(25, 118, 210, 0.3);}.pie-section-player-split-divider--dragging.svelte-1ncvi88 {background:var(--pie-primary-light, #dbeafe);}`
11106
11171
  };
11107
11172
  function ta(n, e) {
11108
- Be(e, !0), et(n, _u);
11173
+ Be(e, !0), et(n, Pu);
11109
11174
  let t = y(e, "value", 7, 50), i = y(e, "min", 7, 20), o = y(e, "max", 7, 80), r = y(e, "step", 7, 5), s = y(e, "disabled", 7, !1), l = y(e, "ariaLabel", 7, "Resize panels"), c = y(e, "ariaControls", 7, ""), d = y(e, "ariaValueText", 7, "");
11110
11175
  const u = Bn();
11111
- let f = /* @__PURE__ */ U(!1), p = 0, b = 0;
11176
+ let f = /* @__PURE__ */ U(!1), m = 0, S = 0;
11112
11177
  function h(_) {
11113
11178
  return Math.max(i(), Math.min(o(), _));
11114
11179
  }
11115
- function S(_) {
11116
- s() || (_.preventDefault(), F(f, !0), p = _.clientX, b = t(), u("resize-start", { value: t() }));
11180
+ function b(_) {
11181
+ s() || (_.preventDefault(), F(f, !0), m = _.clientX, S = t(), u("resize-start", { value: t() }));
11117
11182
  }
11118
11183
  function w(_) {
11119
11184
  if (!a(f)) return;
11120
- const H = _.clientX - p, R = h(b + H * 0.1);
11121
- u("resize-preview", { value: R, input: "pointer" });
11185
+ const H = _.clientX - m, x = h(S + H * 0.1);
11186
+ u("resize-preview", { value: x, input: "pointer" });
11122
11187
  }
11123
- function g() {
11188
+ function p() {
11124
11189
  a(f) && (F(f, !1), u("resize-commit", { value: t(), input: "pointer" }));
11125
11190
  }
11126
11191
  function C(_) {
@@ -11136,18 +11201,18 @@ function ta(n, e) {
11136
11201
  else if (_.key === "End")
11137
11202
  H = o();
11138
11203
  else {
11139
- const R = _.key === "ArrowLeft" ? -r() : r();
11140
- H = h(t() + R);
11204
+ const x = _.key === "ArrowLeft" ? -r() : r();
11205
+ H = h(t() + x);
11141
11206
  }
11142
11207
  u("resize-preview", { value: H, input: "keyboard" }), u("resize-commit", { value: H, input: "keyboard" });
11143
11208
  }
11144
11209
  se(() => {
11145
11210
  if (a(f))
11146
- return window.addEventListener("mousemove", w), window.addEventListener("mouseup", g), () => {
11147
- window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", g);
11211
+ return window.addEventListener("mousemove", w), window.addEventListener("mouseup", p), () => {
11212
+ window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", p);
11148
11213
  };
11149
11214
  });
11150
- var x = {
11215
+ var R = {
11151
11216
  get value() {
11152
11217
  return t();
11153
11218
  },
@@ -11196,13 +11261,13 @@ function ta(n, e) {
11196
11261
  set ariaValueText(_ = "") {
11197
11262
  d(_), v();
11198
11263
  }
11199
- }, O = Cu();
11264
+ }, O = Eu();
11200
11265
  return k(
11201
11266
  (_) => {
11202
11267
  wt(O, 1, `pie-section-player-split-divider ${a(f) ? "pie-section-player-split-divider--dragging" : ""}`, "svelte-1ncvi88"), It(O, "aria-label", l()), It(O, "aria-controls", c() || void 0), It(O, "aria-valuemin", i()), It(O, "aria-valuemax", o()), It(O, "aria-valuenow", _), It(O, "aria-valuetext", d() || void 0), It(O, "aria-disabled", s() ? "true" : void 0), It(O, "tabindex", s() ? void 0 : 0);
11203
11268
  },
11204
11269
  [() => Math.round(t())]
11205
- ), vr("mousedown", O, S), vr("keydown", O, C), fe(n, O), He(x);
11270
+ ), vr("mousedown", O, b), vr("keydown", O, C), fe(n, O), He(R);
11206
11271
  }
11207
11272
  Sl(["mousedown", "keydown"]);
11208
11273
  Ke(
@@ -11221,7 +11286,7 @@ Ke(
11221
11286
  [],
11222
11287
  { mode: "open" }
11223
11288
  );
11224
- function Eu(n) {
11289
+ function ku(n) {
11225
11290
  const e = "pie-outer-scrollbars-managed", t = "pie-outer-scrolling", o = document.documentElement, r = document.body;
11226
11291
  let s = null;
11227
11292
  o.classList.add(e), r.classList.add(e);
@@ -11234,8 +11299,8 @@ function Eu(n) {
11234
11299
  window.removeEventListener("scroll", l), o.classList.remove(t), r.classList.remove(t), o.classList.remove(e), r.classList.remove(e), s && clearTimeout(s);
11235
11300
  };
11236
11301
  }
11237
- var Pu = /* @__PURE__ */ ve('<aside class="pie-section-player-passages-pane svelte-1psecfm" aria-label="Passages"><pie-section-player-passages-pane></pie-section-player-passages-pane></aside> <!>', 3), ku = /* @__PURE__ */ ve('<div><!> <main class="pie-section-player-items-pane svelte-1psecfm" aria-label="Items"><pie-section-player-items-pane></pie-section-player-items-pane></main></div>', 2);
11238
- const Au = {
11302
+ var Au = /* @__PURE__ */ ve('<aside class="pie-section-player-passages-pane svelte-1psecfm" aria-label="Passages"><pie-section-player-passages-pane></pie-section-player-passages-pane></aside> <!>', 3), Ru = /* @__PURE__ */ ve('<div><!> <main class="pie-section-player-items-pane svelte-1psecfm" aria-label="Items"><pie-section-player-items-pane></pie-section-player-items-pane></main></div>', 2);
11303
+ const xu = {
11239
11304
  hash: "svelte-1psecfm",
11240
11305
  code: `:host {display:block;width:100%;height:100%;min-height:0;max-height:100%;overflow:hidden;}.pie-section-player-split-content.svelte-1psecfm {display:grid;gap:0;min-height:0;height:100%;overflow:hidden;}
11241
11306
 
@@ -11250,10 +11315,10 @@ const Au = {
11250
11315
  body.pie-outer-scrollbars-managed.pie-outer-scrolling::-webkit-scrollbar-thumb {background:#c1c1c1;border-radius:4px;}html.pie-outer-scrollbars-managed.pie-outer-scrolling::-webkit-scrollbar-thumb:hover,
11251
11316
  body.pie-outer-scrollbars-managed.pie-outer-scrolling::-webkit-scrollbar-thumb:hover {background:#a1a1a1;}`
11252
11317
  };
11253
- function Ru(n, e) {
11254
- Be(e, !0), et(n, Au);
11318
+ function Lu(n, e) {
11319
+ Be(e, !0), et(n, xu);
11255
11320
  const t = 1100, i = 400, o = 2e3;
11256
- let r = y(e, "assessmentId", 7), s = y(e, "runtime", 7, null), l = y(e, "section", 7, null), c = y(e, "sectionId", 7, ""), d = y(e, "attemptId", 7, ""), u = y(e, "playerType", 7), f = y(e, "player", 7), p = y(e, "lazyInit", 7), b = y(e, "tools", 7), h = y(e, "accessibility", 7), S = y(e, "coordinator", 7), w = y(e, "createSectionController", 7), g = y(e, "isolation", 7), C = y(e, "env", 7), x = y(e, "iifeBundleHost", 7), O = y(e, "showToolbar", 7, "false"), _ = y(e, "toolbarPosition", 7, "right"), H = y(e, "enabledTools", 7, ""), R = y(e, "itemToolbarTools", 7, ""), D = y(e, "passageToolbarTools", 7, ""), K = y(e, "narrowLayoutBreakpoint", 7, void 0);
11321
+ let r = y(e, "assessmentId", 7), s = y(e, "runtime", 7, null), l = y(e, "section", 7, null), c = y(e, "sectionId", 7, ""), d = y(e, "attemptId", 7, ""), u = y(e, "playerType", 7), f = y(e, "player", 7), m = y(e, "lazyInit", 7), S = y(e, "tools", 7), h = y(e, "accessibility", 7), b = y(e, "coordinator", 7), w = y(e, "createSectionController", 7), p = y(e, "isolation", 7), C = y(e, "env", 7), R = y(e, "iifeBundleHost", 7), O = y(e, "showToolbar", 7, "false"), _ = y(e, "toolbarPosition", 7, "right"), H = y(e, "enabledTools", 7, ""), x = y(e, "itemToolbarTools", 7, ""), D = y(e, "passageToolbarTools", 7, ""), K = y(e, "narrowLayoutBreakpoint", 7, void 0);
11257
11322
  const J = /* @__PURE__ */ N(() => {
11258
11323
  const B = K() ?? t, Q = typeof B == "number" ? B : Number(B), re = Number.isFinite(Q) ? Q : t;
11259
11324
  return Math.max(i, Math.min(o, re));
@@ -11305,7 +11370,7 @@ function Ru(n, e) {
11305
11370
  async function qe(B = 5e3) {
11306
11371
  return await a(W)?.waitForSectionController?.(B) || null;
11307
11372
  }
11308
- Zo(() => Eu());
11373
+ Zo(() => ku());
11309
11374
  var X = {
11310
11375
  getSnapshot: M,
11311
11376
  selectComposition: te,
@@ -11359,16 +11424,16 @@ function Ru(n, e) {
11359
11424
  f(B), v();
11360
11425
  },
11361
11426
  get lazyInit() {
11362
- return p();
11427
+ return m();
11363
11428
  },
11364
11429
  set lazyInit(B) {
11365
- p(B), v();
11430
+ m(B), v();
11366
11431
  },
11367
11432
  get tools() {
11368
- return b();
11433
+ return S();
11369
11434
  },
11370
11435
  set tools(B) {
11371
- b(B), v();
11436
+ S(B), v();
11372
11437
  },
11373
11438
  get accessibility() {
11374
11439
  return h();
@@ -11377,10 +11442,10 @@ function Ru(n, e) {
11377
11442
  h(B), v();
11378
11443
  },
11379
11444
  get coordinator() {
11380
- return S();
11445
+ return b();
11381
11446
  },
11382
11447
  set coordinator(B) {
11383
- S(B), v();
11448
+ b(B), v();
11384
11449
  },
11385
11450
  get createSectionController() {
11386
11451
  return w();
@@ -11389,10 +11454,10 @@ function Ru(n, e) {
11389
11454
  w(B), v();
11390
11455
  },
11391
11456
  get isolation() {
11392
- return g();
11457
+ return p();
11393
11458
  },
11394
11459
  set isolation(B) {
11395
- g(B), v();
11460
+ p(B), v();
11396
11461
  },
11397
11462
  get env() {
11398
11463
  return C();
@@ -11401,10 +11466,10 @@ function Ru(n, e) {
11401
11466
  C(B), v();
11402
11467
  },
11403
11468
  get iifeBundleHost() {
11404
- return x();
11469
+ return R();
11405
11470
  },
11406
11471
  set iifeBundleHost(B) {
11407
- x(B), v();
11472
+ R(B), v();
11408
11473
  },
11409
11474
  get showToolbar() {
11410
11475
  return O();
@@ -11425,10 +11490,10 @@ function Ru(n, e) {
11425
11490
  H(B), v();
11426
11491
  },
11427
11492
  get itemToolbarTools() {
11428
- return R();
11493
+ return x();
11429
11494
  },
11430
11495
  set itemToolbarTools(B = "") {
11431
- R(B), v();
11496
+ x(B), v();
11432
11497
  },
11433
11498
  get passageToolbarTools() {
11434
11499
  return D();
@@ -11469,28 +11534,28 @@ function Ru(n, e) {
11469
11534
  return f();
11470
11535
  },
11471
11536
  get lazyInit() {
11472
- return p();
11537
+ return m();
11473
11538
  },
11474
11539
  get tools() {
11475
- return b();
11540
+ return S();
11476
11541
  },
11477
11542
  get accessibility() {
11478
11543
  return h();
11479
11544
  },
11480
11545
  get coordinator() {
11481
- return S();
11546
+ return b();
11482
11547
  },
11483
11548
  get createSectionController() {
11484
11549
  return w();
11485
11550
  },
11486
11551
  get isolation() {
11487
- return g();
11552
+ return p();
11488
11553
  },
11489
11554
  get env() {
11490
11555
  return C();
11491
11556
  },
11492
11557
  get iifeBundleHost() {
11493
- return x();
11558
+ return R();
11494
11559
  },
11495
11560
  get showToolbar() {
11496
11561
  return O();
@@ -11502,7 +11567,7 @@ function Ru(n, e) {
11502
11567
  return H();
11503
11568
  },
11504
11569
  get itemToolbarTools() {
11505
- return R();
11570
+ return x();
11506
11571
  },
11507
11572
  get passageToolbarTools() {
11508
11573
  return D();
@@ -11527,10 +11592,10 @@ function Ru(n, e) {
11527
11592
  $$slots: {
11528
11593
  default: (Q, re) => {
11529
11594
  const A = /* @__PURE__ */ N(() => re.layoutModel);
11530
- var $ = ku(), ne = Se($);
11595
+ var $ = Ru(), ne = Se($);
11531
11596
  {
11532
11597
  var be = (lt) => {
11533
- var kt = Pu(), Xt = vt(kt), We = Se(Xt);
11598
+ var kt = Au(), Xt = vt(kt), We = Se(Xt);
11534
11599
  k(() => E(We, "passages", a(A).passages)), k(() => E(We, "elementsLoaded", a(A).paneElementsLoaded)), k(() => E(We, "resolvedPlayerEnv", a(A).resolvedPlayerEnv)), k(() => E(We, "resolvedPlayerAttributes", a(A).resolvedPlayerAttributes)), k(() => E(We, "resolvedPlayerProps", a(A).resolvedPlayerProps)), k(() => E(We, "playerStrategy", a(A).playerStrategy)), k(() => E(We, "passageToolbarTools", D())), Ie(Xt);
11535
11600
  var ii = Pe(Xt, 2);
11536
11601
  {
@@ -11563,7 +11628,7 @@ function Ru(n, e) {
11563
11628
  });
11564
11629
  }
11565
11630
  var ze = Pe(ne, 2), Ae = Se(ze);
11566
- k(() => E(Ae, "items", a(A).items)), k(() => E(Ae, "compositionModel", a(A).compositionModel)), k(() => E(Ae, "resolvedPlayerEnv", a(A).resolvedPlayerEnv)), k(() => E(Ae, "resolvedPlayerAttributes", a(A).resolvedPlayerAttributes)), k(() => E(Ae, "resolvedPlayerProps", a(A).resolvedPlayerProps)), k(() => E(Ae, "playerStrategy", a(A).playerStrategy)), k(() => E(Ae, "itemToolbarTools", R())), k(() => E(Ae, "iifeBundleHost", x())), k(() => E(Ae, "preloadedRenderables", a(A).preloadedRenderables)), k(() => E(Ae, "preloadedRenderablesSignature", a(A).preloadedRenderablesSignature)), E(Ae, "preloadComponentTag", "pie-section-player-splitpane"), Ie(ze), Ie($), at($, (lt) => F(P, lt), () => a(P)), k(() => {
11631
+ k(() => E(Ae, "items", a(A).items)), k(() => E(Ae, "compositionModel", a(A).compositionModel)), k(() => E(Ae, "resolvedPlayerEnv", a(A).resolvedPlayerEnv)), k(() => E(Ae, "resolvedPlayerAttributes", a(A).resolvedPlayerAttributes)), k(() => E(Ae, "resolvedPlayerProps", a(A).resolvedPlayerProps)), k(() => E(Ae, "playerStrategy", a(A).playerStrategy)), k(() => E(Ae, "itemToolbarTools", x())), k(() => E(Ae, "iifeBundleHost", R())), k(() => E(Ae, "preloadedRenderables", a(A).preloadedRenderables)), k(() => E(Ae, "preloadedRenderablesSignature", a(A).preloadedRenderablesSignature)), E(Ae, "preloadComponentTag", "pie-section-player-splitpane"), Ie(ze), Ie($), at($, (lt) => F(P, lt), () => a(P)), k(() => {
11567
11632
  wt($, 1, `pie-section-player-split-content ${a(A).passages.length === 0 ? "pie-section-player-split-content--no-passages" : ""} ${a(j) ? "pie-section-player-split-content--stacked" : ""}`, "svelte-1psecfm"), Dl($, a(A).passages.length === 0 ? "grid-template-columns: 1fr" : a(j) ? "" : `grid-template-columns: ${a(L)}% 0.5rem ${100 - a(L) - 0.5}%`), It(ze, "id", a(he));
11568
11633
  }), Le("elements-loaded-change", Ae, function(...lt) {
11569
11634
  a(A).onItemsPaneElementsLoaded?.apply(this, lt);
@@ -11578,7 +11643,7 @@ function Ru(n, e) {
11578
11643
  return He(X);
11579
11644
  }
11580
11645
  customElements.define("pie-section-player-splitpane", Ke(
11581
- Ru,
11646
+ Lu,
11582
11647
  {
11583
11648
  assessmentId: { attribute: "assessment-id", type: "String" },
11584
11649
  runtime: { type: "Object" },
@@ -11615,18 +11680,18 @@ customElements.define("pie-section-player-splitpane", Ke(
11615
11680
  "waitForSectionController"
11616
11681
  ]
11617
11682
  ));
11618
- var xu = /* @__PURE__ */ ve('<section class="pie-section-player-passages-section svelte-j50lbm" aria-label="Passages"><pie-section-player-passages-pane></pie-section-player-passages-pane></section>', 2), Lu = /* @__PURE__ */ ve('<div class="pie-section-player-vertical-content svelte-j50lbm"><!> <section class="pie-section-player-items-section svelte-j50lbm" aria-label="Items"><pie-section-player-items-pane></pie-section-player-items-pane></section></div>', 2);
11619
- const Ou = {
11683
+ var Ou = /* @__PURE__ */ ve('<section class="pie-section-player-passages-section svelte-j50lbm" aria-label="Passages"><pie-section-player-passages-pane></pie-section-player-passages-pane></section>', 2), Mu = /* @__PURE__ */ ve('<div class="pie-section-player-vertical-content svelte-j50lbm"><!> <section class="pie-section-player-items-section svelte-j50lbm" aria-label="Items"><pie-section-player-items-pane></pie-section-player-items-pane></section></div>', 2);
11684
+ const Nu = {
11620
11685
  hash: "svelte-j50lbm",
11621
11686
  code: `:host {display:block;width:100%;height:100%;min-height:0;max-height:100%;overflow:hidden;}.pie-section-player-vertical-content.svelte-j50lbm {height:100%;max-height:100%;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;display:flex;flex-direction:column;gap:1rem;padding:0.5rem;box-sizing:border-box;background:var(--pie-background-dark, #ecedf1);}.pie-section-player-passages-section.svelte-j50lbm,
11622
11687
  .pie-section-player-items-section.svelte-j50lbm {min-height:0;
11623
11688
  /* Prevent flexbox from compressing content sections.
11624
11689
  Let the vertical container own scrolling instead. */flex:0 0 auto;}.pie-section-player-passages-section.svelte-j50lbm {width:100%;}`
11625
11690
  };
11626
- function Mu(n, e) {
11627
- Be(e, !0), et(n, Ou);
11691
+ function zu(n, e) {
11692
+ Be(e, !0), et(n, Nu);
11628
11693
  const t = 1100, i = 400, o = 2e3;
11629
- let r = y(e, "assessmentId", 7), s = y(e, "runtime", 7, null), l = y(e, "section", 7, null), c = y(e, "sectionId", 7, ""), d = y(e, "attemptId", 7, ""), u = y(e, "playerType", 7), f = y(e, "player", 7), p = y(e, "lazyInit", 7), b = y(e, "tools", 7), h = y(e, "accessibility", 7), S = y(e, "coordinator", 7), w = y(e, "createSectionController", 7), g = y(e, "isolation", 7), C = y(e, "env", 7), x = y(e, "iifeBundleHost", 7), O = y(e, "showToolbar", 7, "false"), _ = y(e, "toolbarPosition", 7, "right"), H = y(e, "enabledTools", 7, ""), R = y(e, "itemToolbarTools", 7, ""), D = y(e, "passageToolbarTools", 7, ""), K = y(e, "narrowLayoutBreakpoint", 7, void 0);
11694
+ let r = y(e, "assessmentId", 7), s = y(e, "runtime", 7, null), l = y(e, "section", 7, null), c = y(e, "sectionId", 7, ""), d = y(e, "attemptId", 7, ""), u = y(e, "playerType", 7), f = y(e, "player", 7), m = y(e, "lazyInit", 7), S = y(e, "tools", 7), h = y(e, "accessibility", 7), b = y(e, "coordinator", 7), w = y(e, "createSectionController", 7), p = y(e, "isolation", 7), C = y(e, "env", 7), R = y(e, "iifeBundleHost", 7), O = y(e, "showToolbar", 7, "false"), _ = y(e, "toolbarPosition", 7, "right"), H = y(e, "enabledTools", 7, ""), x = y(e, "itemToolbarTools", 7, ""), D = y(e, "passageToolbarTools", 7, ""), K = y(e, "narrowLayoutBreakpoint", 7, void 0);
11630
11695
  const J = Bn();
11631
11696
  let L = /* @__PURE__ */ U(null), P = /* @__PURE__ */ U(!1);
11632
11697
  const W = /* @__PURE__ */ N(() => {
@@ -11727,16 +11792,16 @@ function Mu(n, e) {
11727
11792
  f(V), v();
11728
11793
  },
11729
11794
  get lazyInit() {
11730
- return p();
11795
+ return m();
11731
11796
  },
11732
11797
  set lazyInit(V) {
11733
- p(V), v();
11798
+ m(V), v();
11734
11799
  },
11735
11800
  get tools() {
11736
- return b();
11801
+ return S();
11737
11802
  },
11738
11803
  set tools(V) {
11739
- b(V), v();
11804
+ S(V), v();
11740
11805
  },
11741
11806
  get accessibility() {
11742
11807
  return h();
@@ -11745,10 +11810,10 @@ function Mu(n, e) {
11745
11810
  h(V), v();
11746
11811
  },
11747
11812
  get coordinator() {
11748
- return S();
11813
+ return b();
11749
11814
  },
11750
11815
  set coordinator(V) {
11751
- S(V), v();
11816
+ b(V), v();
11752
11817
  },
11753
11818
  get createSectionController() {
11754
11819
  return w();
@@ -11757,10 +11822,10 @@ function Mu(n, e) {
11757
11822
  w(V), v();
11758
11823
  },
11759
11824
  get isolation() {
11760
- return g();
11825
+ return p();
11761
11826
  },
11762
11827
  set isolation(V) {
11763
- g(V), v();
11828
+ p(V), v();
11764
11829
  },
11765
11830
  get env() {
11766
11831
  return C();
@@ -11769,10 +11834,10 @@ function Mu(n, e) {
11769
11834
  C(V), v();
11770
11835
  },
11771
11836
  get iifeBundleHost() {
11772
- return x();
11837
+ return R();
11773
11838
  },
11774
11839
  set iifeBundleHost(V) {
11775
- x(V), v();
11840
+ R(V), v();
11776
11841
  },
11777
11842
  get showToolbar() {
11778
11843
  return O();
@@ -11793,10 +11858,10 @@ function Mu(n, e) {
11793
11858
  H(V), v();
11794
11859
  },
11795
11860
  get itemToolbarTools() {
11796
- return R();
11861
+ return x();
11797
11862
  },
11798
11863
  set itemToolbarTools(V = "") {
11799
- R(V), v();
11864
+ x(V), v();
11800
11865
  },
11801
11866
  get passageToolbarTools() {
11802
11867
  return D();
@@ -11835,28 +11900,28 @@ function Mu(n, e) {
11835
11900
  return f();
11836
11901
  },
11837
11902
  get lazyInit() {
11838
- return p();
11903
+ return m();
11839
11904
  },
11840
11905
  get tools() {
11841
- return b();
11906
+ return S();
11842
11907
  },
11843
11908
  get accessibility() {
11844
11909
  return h();
11845
11910
  },
11846
11911
  get coordinator() {
11847
- return S();
11912
+ return b();
11848
11913
  },
11849
11914
  get createSectionController() {
11850
11915
  return w();
11851
11916
  },
11852
11917
  get isolation() {
11853
- return g();
11918
+ return p();
11854
11919
  },
11855
11920
  get env() {
11856
11921
  return C();
11857
11922
  },
11858
11923
  get iifeBundleHost() {
11859
- return x();
11924
+ return R();
11860
11925
  },
11861
11926
  get showToolbar() {
11862
11927
  return O();
@@ -11868,7 +11933,7 @@ function Mu(n, e) {
11868
11933
  return H();
11869
11934
  },
11870
11935
  get itemToolbarTools() {
11871
- return R();
11936
+ return x();
11872
11937
  },
11873
11938
  get passageToolbarTools() {
11874
11939
  return D();
@@ -11892,10 +11957,10 @@ function Mu(n, e) {
11892
11957
  $$slots: {
11893
11958
  default: (V, ge) => {
11894
11959
  const le = /* @__PURE__ */ N(() => ge.layoutModel);
11895
- var Ve = Lu(), qe = Se(Ve);
11960
+ var Ve = Mu(), qe = Se(Ve);
11896
11961
  {
11897
11962
  var X = (re) => {
11898
- var A = xu(), $ = Se(A);
11963
+ var A = Ou(), $ = Se(A);
11899
11964
  k(() => E($, "passages", a(le).passages)), k(() => E($, "elementsLoaded", a(le).paneElementsLoaded)), k(() => E($, "resolvedPlayerEnv", a(le).resolvedPlayerEnv)), k(() => E($, "resolvedPlayerAttributes", a(le).resolvedPlayerAttributes)), k(() => E($, "resolvedPlayerProps", a(le).resolvedPlayerProps)), k(() => E($, "playerStrategy", a(le).playerStrategy)), k(() => E($, "passageToolbarTools", D())), Ie(A), fe(re, A);
11900
11965
  };
11901
11966
  st(qe, (re) => {
@@ -11903,7 +11968,7 @@ function Mu(n, e) {
11903
11968
  });
11904
11969
  }
11905
11970
  var B = Pe(qe, 2), Q = Se(B);
11906
- k(() => E(Q, "items", a(le).items)), k(() => E(Q, "compositionModel", a(le).compositionModel)), k(() => E(Q, "resolvedPlayerEnv", a(le).resolvedPlayerEnv)), k(() => E(Q, "resolvedPlayerAttributes", a(le).resolvedPlayerAttributes)), k(() => E(Q, "resolvedPlayerProps", a(le).resolvedPlayerProps)), k(() => E(Q, "playerStrategy", a(le).playerStrategy)), k(() => E(Q, "itemToolbarTools", R())), k(() => E(Q, "iifeBundleHost", x())), k(() => E(Q, "preloadedRenderables", a(le).preloadedRenderables)), k(() => E(Q, "preloadedRenderablesSignature", a(le).preloadedRenderablesSignature)), E(Q, "preloadComponentTag", "pie-section-player-vertical"), Ie(B), Ie(Ve), Le("elements-loaded-change", Q, function(...re) {
11971
+ k(() => E(Q, "items", a(le).items)), k(() => E(Q, "compositionModel", a(le).compositionModel)), k(() => E(Q, "resolvedPlayerEnv", a(le).resolvedPlayerEnv)), k(() => E(Q, "resolvedPlayerAttributes", a(le).resolvedPlayerAttributes)), k(() => E(Q, "resolvedPlayerProps", a(le).resolvedPlayerProps)), k(() => E(Q, "playerStrategy", a(le).playerStrategy)), k(() => E(Q, "itemToolbarTools", x())), k(() => E(Q, "iifeBundleHost", R())), k(() => E(Q, "preloadedRenderables", a(le).preloadedRenderables)), k(() => E(Q, "preloadedRenderablesSignature", a(le).preloadedRenderablesSignature)), E(Q, "preloadComponentTag", "pie-section-player-vertical"), Ie(B), Ie(Ve), Le("elements-loaded-change", Q, function(...re) {
11907
11972
  a(le).onItemsPaneElementsLoaded?.apply(this, re);
11908
11973
  }), fe(V, Ve);
11909
11974
  }
@@ -11914,7 +11979,7 @@ function Mu(n, e) {
11914
11979
  ), He(ke);
11915
11980
  }
11916
11981
  customElements.define("pie-section-player-vertical", Ke(
11917
- Mu,
11982
+ zu,
11918
11983
  {
11919
11984
  assessmentId: { attribute: "assessment-id", type: "String" },
11920
11985
  runtime: { type: "Object" },
@@ -11951,15 +12016,15 @@ customElements.define("pie-section-player-vertical", Ke(
11951
12016
  "waitForSectionController"
11952
12017
  ]
11953
12018
  ));
11954
- var Nu = /* @__PURE__ */ ve("<pie-section-player-passages-pane></pie-section-player-passages-pane>", 2), zu = /* @__PURE__ */ ve('<div class="pie-section-player-kernel-host-content svelte-18wms89"><!> <pie-section-player-items-pane></pie-section-player-items-pane></div>', 2);
11955
- const Du = {
12019
+ var Du = /* @__PURE__ */ ve("<pie-section-player-passages-pane></pie-section-player-passages-pane>", 2), Bu = /* @__PURE__ */ ve('<div class="pie-section-player-kernel-host-content svelte-18wms89"><!> <pie-section-player-items-pane></pie-section-player-items-pane></div>', 2);
12020
+ const Hu = {
11956
12021
  hash: "svelte-18wms89",
11957
12022
  code: ":host {display:block;width:100%;height:100%;min-height:0;overflow:hidden;}.pie-section-player-kernel-host-content.svelte-18wms89 {display:flex;flex-direction:column;gap:1rem;min-height:0;height:100%;padding:0.5rem;box-sizing:border-box;}"
11958
12023
  };
11959
- function Bu(n, e) {
11960
- Be(e, !0), et(n, Du);
11961
- let t = y(e, "assessmentId", 7), i = y(e, "runtime", 7, null), o = y(e, "section", 7, null), r = y(e, "sectionId", 7, ""), s = y(e, "attemptId", 7, ""), l = y(e, "playerType", 7), c = y(e, "player", 7), d = y(e, "lazyInit", 7), u = y(e, "tools", 7), f = y(e, "accessibility", 7), p = y(e, "coordinator", 7), b = y(e, "createSectionController", 7), h = y(e, "isolation", 7), S = y(e, "env", 7), w = y(e, "iifeBundleHost", 7), g = y(e, "showToolbar", 7, "false"), C = y(e, "toolbarPosition", 7, "right"), x = y(e, "enabledTools", 7, ""), O = y(e, "itemToolbarTools", 7, ""), _ = y(e, "passageToolbarTools", 7, ""), H = y(e, "policies", 7);
11962
- const R = Bn();
12024
+ function Vu(n, e) {
12025
+ Be(e, !0), et(n, Hu);
12026
+ let t = y(e, "assessmentId", 7), i = y(e, "runtime", 7, null), o = y(e, "section", 7, null), r = y(e, "sectionId", 7, ""), s = y(e, "attemptId", 7, ""), l = y(e, "playerType", 7), c = y(e, "player", 7), d = y(e, "lazyInit", 7), u = y(e, "tools", 7), f = y(e, "accessibility", 7), m = y(e, "coordinator", 7), S = y(e, "createSectionController", 7), h = y(e, "isolation", 7), b = y(e, "env", 7), w = y(e, "iifeBundleHost", 7), p = y(e, "showToolbar", 7, "false"), C = y(e, "toolbarPosition", 7, "right"), R = y(e, "enabledTools", 7, ""), O = y(e, "itemToolbarTools", 7, ""), _ = y(e, "passageToolbarTools", 7, ""), H = y(e, "policies", 7);
12027
+ const x = Bn();
11963
12028
  let D = /* @__PURE__ */ U(null), K = /* @__PURE__ */ U(sn({
11964
12029
  readiness: {
11965
12030
  phase: "bootstrapping",
@@ -12003,7 +12068,7 @@ function Bu(n, e) {
12003
12068
  }
12004
12069
  function ue(M) {
12005
12070
  const te = M;
12006
- R(te.type, te.detail);
12071
+ x(te.type, te.detail);
12007
12072
  }
12008
12073
  function ae() {
12009
12074
  F(
@@ -12086,16 +12151,16 @@ function Bu(n, e) {
12086
12151
  f(M), v();
12087
12152
  },
12088
12153
  get coordinator() {
12089
- return p();
12154
+ return m();
12090
12155
  },
12091
12156
  set coordinator(M) {
12092
- p(M), v();
12157
+ m(M), v();
12093
12158
  },
12094
12159
  get createSectionController() {
12095
- return b();
12160
+ return S();
12096
12161
  },
12097
12162
  set createSectionController(M) {
12098
- b(M), v();
12163
+ S(M), v();
12099
12164
  },
12100
12165
  get isolation() {
12101
12166
  return h();
@@ -12104,10 +12169,10 @@ function Bu(n, e) {
12104
12169
  h(M), v();
12105
12170
  },
12106
12171
  get env() {
12107
- return S();
12172
+ return b();
12108
12173
  },
12109
12174
  set env(M) {
12110
- S(M), v();
12175
+ b(M), v();
12111
12176
  },
12112
12177
  get iifeBundleHost() {
12113
12178
  return w();
@@ -12116,10 +12181,10 @@ function Bu(n, e) {
12116
12181
  w(M), v();
12117
12182
  },
12118
12183
  get showToolbar() {
12119
- return g();
12184
+ return p();
12120
12185
  },
12121
12186
  set showToolbar(M = "false") {
12122
- g(M), v();
12187
+ p(M), v();
12123
12188
  },
12124
12189
  get toolbarPosition() {
12125
12190
  return C();
@@ -12128,10 +12193,10 @@ function Bu(n, e) {
12128
12193
  C(M), v();
12129
12194
  },
12130
12195
  get enabledTools() {
12131
- return x();
12196
+ return R();
12132
12197
  },
12133
12198
  set enabledTools(M = "") {
12134
- x(M), v();
12199
+ R(M), v();
12135
12200
  },
12136
12201
  get itemToolbarTools() {
12137
12202
  return O();
@@ -12185,28 +12250,28 @@ function Bu(n, e) {
12185
12250
  return f();
12186
12251
  },
12187
12252
  get coordinator() {
12188
- return p();
12253
+ return m();
12189
12254
  },
12190
12255
  get createSectionController() {
12191
- return b();
12256
+ return S();
12192
12257
  },
12193
12258
  get isolation() {
12194
12259
  return h();
12195
12260
  },
12196
12261
  get env() {
12197
- return S();
12262
+ return b();
12198
12263
  },
12199
12264
  get iifeBundleHost() {
12200
12265
  return w();
12201
12266
  },
12202
12267
  get showToolbar() {
12203
- return g();
12268
+ return p();
12204
12269
  },
12205
12270
  get toolbarPosition() {
12206
12271
  return C();
12207
12272
  },
12208
12273
  get enabledTools() {
12209
- return x();
12274
+ return R();
12210
12275
  },
12211
12276
  get itemToolbarTools() {
12212
12277
  return O();
@@ -12245,10 +12310,10 @@ function Bu(n, e) {
12245
12310
  $$slots: {
12246
12311
  default: (M, te) => {
12247
12312
  const z = /* @__PURE__ */ N(() => te.items), ke = /* @__PURE__ */ N(() => te.passages), V = /* @__PURE__ */ N(() => te.compositionModel), ge = /* @__PURE__ */ N(() => te.resolvedPlayerEnv), le = /* @__PURE__ */ N(() => te.resolvedPlayerAttributes), Ve = /* @__PURE__ */ N(() => te.resolvedPlayerProps), qe = /* @__PURE__ */ N(() => te.playerStrategy), X = /* @__PURE__ */ N(() => te.preloadedRenderables), B = /* @__PURE__ */ N(() => te.preloadedRenderablesSignature), Q = /* @__PURE__ */ N(() => te.onItemsPaneElementsLoaded);
12248
- var re = zu(), A = Se(re);
12313
+ var re = Bu(), A = Se(re);
12249
12314
  {
12250
12315
  var $ = (be) => {
12251
- var ze = Nu();
12316
+ var ze = Du();
12252
12317
  k(() => E(ze, "passages", a(ke))), k(() => E(ze, "elementsLoaded", a(K).readiness.allLoadingComplete)), k(() => E(ze, "resolvedPlayerEnv", a(ge))), k(() => E(ze, "resolvedPlayerAttributes", a(le))), k(() => E(ze, "resolvedPlayerProps", a(Ve))), k(() => E(ze, "playerStrategy", a(qe))), k(() => E(ze, "passageToolbarTools", _())), fe(be, ze);
12253
12318
  };
12254
12319
  st(A, (be) => {
@@ -12267,7 +12332,7 @@ function Bu(n, e) {
12267
12332
  ), He(Y);
12268
12333
  }
12269
12334
  customElements.define("pie-section-player-kernel-host", Ke(
12270
- Bu,
12335
+ Vu,
12271
12336
  {
12272
12337
  assessmentId: { attribute: "assessment-id", type: "String" },
12273
12338
  runtime: { type: "Object" },
@@ -12368,7 +12433,7 @@ const Vt = {
12368
12433
  "passage-toolbar",
12369
12434
  "readiness-events",
12370
12435
  "navigation-events"
12371
- ], qu = {
12436
+ ], Uu = {
12372
12437
  version: 1,
12373
12438
  layout: "splitpane",
12374
12439
  props: na,
@@ -12377,7 +12442,7 @@ const Vt = {
12377
12442
  events: ia,
12378
12443
  commands: oa,
12379
12444
  capabilities: ra
12380
- }, Wu = {
12445
+ }, $u = {
12381
12446
  version: 1,
12382
12447
  layout: "vertical",
12383
12448
  props: na,
@@ -12390,6 +12455,6 @@ const Vt = {
12390
12455
  export {
12391
12456
  Ar as DEFAULT_SECTION_PLAYER_POLICIES,
12392
12457
  Vt as SECTION_PLAYER_PUBLIC_EVENTS,
12393
- qu as SPLITPANE_LAYOUT_CONTRACT,
12394
- Wu as VERTICAL_LAYOUT_CONTRACT
12458
+ Uu as SPLITPANE_LAYOUT_CONTRACT,
12459
+ $u as VERTICAL_LAYOUT_CONTRACT
12395
12460
  };