@readerseye2/cr_viewer 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ function Zi() {
31
31
  }
32
32
  var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, o = e.useEffect, i = e.useLayoutEffect, s = e.useDebugValue;
33
33
  function u(b, h) {
34
- var p = h(), v = r({ inst: { value: p, getSnapshot: h } }), y = v[0].inst, c = v[1];
34
+ var p = h(), S = r({ inst: { value: p, getSnapshot: h } }), y = S[0].inst, c = S[1];
35
35
  return i(
36
36
  function() {
37
37
  y.value = p, y.getSnapshot = h, a(y) && c({ inst: y });
@@ -75,29 +75,29 @@ var Pn = {};
75
75
  var Hr;
76
76
  function Ji() {
77
77
  return Hr || (Hr = 1, process.env.NODE_ENV !== "production" && (function() {
78
- function e(p, v) {
79
- return p === v && (p !== 0 || 1 / p === 1 / v) || p !== p && v !== v;
78
+ function e(p, S) {
79
+ return p === S && (p !== 0 || 1 / p === 1 / S) || p !== p && S !== S;
80
80
  }
81
- function t(p, v) {
81
+ function t(p, S) {
82
82
  d || o.startTransition === void 0 || (d = !0, console.error(
83
83
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
84
84
  ));
85
- var y = v();
85
+ var y = S();
86
86
  if (!b) {
87
- var c = v();
87
+ var c = S();
88
88
  i(y, c) || (console.error(
89
89
  "The result of getSnapshot should be cached to avoid an infinite loop"
90
90
  ), b = !0);
91
91
  }
92
92
  c = s({
93
- inst: { value: y, getSnapshot: v }
93
+ inst: { value: y, getSnapshot: S }
94
94
  });
95
95
  var g = c[0].inst, f = c[1];
96
96
  return a(
97
97
  function() {
98
- g.value = y, g.getSnapshot = v, n(g) && f({ inst: g });
98
+ g.value = y, g.getSnapshot = S, n(g) && f({ inst: g });
99
99
  },
100
- [p, y, v]
100
+ [p, y, S]
101
101
  ), u(
102
102
  function() {
103
103
  return n(g) && f({ inst: g }), p(function() {
@@ -108,17 +108,17 @@ function Ji() {
108
108
  ), l(y), y;
109
109
  }
110
110
  function n(p) {
111
- var v = p.getSnapshot;
111
+ var S = p.getSnapshot;
112
112
  p = p.value;
113
113
  try {
114
- var y = v();
114
+ var y = S();
115
115
  return !i(p, y);
116
116
  } catch {
117
117
  return !0;
118
118
  }
119
119
  }
120
- function r(p, v) {
121
- return v();
120
+ function r(p, S) {
121
+ return S();
122
122
  }
123
123
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
124
124
  var o = $, i = typeof Object.is == "function" ? Object.is : e, s = o.useState, u = o.useEffect, a = o.useLayoutEffect, l = o.useDebugValue, d = !1, b = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : t;
@@ -148,12 +148,12 @@ function es() {
148
148
  }
149
149
  var r = typeof Object.is == "function" ? Object.is : n, o = t.useSyncExternalStore, i = e.useRef, s = e.useEffect, u = e.useMemo, a = e.useDebugValue;
150
150
  return An.useSyncExternalStoreWithSelector = function(l, d, b, h, p) {
151
- var v = i(null);
152
- if (v.current === null) {
151
+ var S = i(null);
152
+ if (S.current === null) {
153
153
  var y = { hasValue: !1, value: null };
154
- v.current = y;
155
- } else y = v.current;
156
- v = u(
154
+ S.current = y;
155
+ } else y = S.current;
156
+ S = u(
157
157
  function() {
158
158
  function g(E) {
159
159
  if (!f) {
@@ -165,8 +165,8 @@ function es() {
165
165
  return C = E;
166
166
  }
167
167
  if (m = C, r(x, E)) return m;
168
- var S = h(E);
169
- return p !== void 0 && p(m, S) ? (x = E, m) : (x = E, C = S);
168
+ var v = h(E);
169
+ return p !== void 0 && p(m, v) ? (x = E, m) : (x = E, C = v);
170
170
  }
171
171
  var f = !1, x, C, T = b === void 0 ? null : b;
172
172
  return [
@@ -180,7 +180,7 @@ function es() {
180
180
  },
181
181
  [d, b, h, p]
182
182
  );
183
- var c = o(l, v[0], v[1]);
183
+ var c = o(l, S[0], S[1]);
184
184
  return s(
185
185
  function() {
186
186
  y.hasValue = !0, y.value = c;
@@ -208,12 +208,12 @@ function ts() {
208
208
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
209
209
  var t = $, n = Ko(), r = typeof Object.is == "function" ? Object.is : e, o = n.useSyncExternalStore, i = t.useRef, s = t.useEffect, u = t.useMemo, a = t.useDebugValue;
210
210
  Gn.useSyncExternalStoreWithSelector = function(l, d, b, h, p) {
211
- var v = i(null);
212
- if (v.current === null) {
211
+ var S = i(null);
212
+ if (S.current === null) {
213
213
  var y = { hasValue: !1, value: null };
214
- v.current = y;
215
- } else y = v.current;
216
- v = u(
214
+ S.current = y;
215
+ } else y = S.current;
216
+ S = u(
217
217
  function() {
218
218
  function g(E) {
219
219
  if (!f) {
@@ -226,8 +226,8 @@ function ts() {
226
226
  }
227
227
  if (m = C, r(x, E))
228
228
  return m;
229
- var S = h(E);
230
- return p !== void 0 && p(m, S) ? (x = E, m) : (x = E, C = S);
229
+ var v = h(E);
230
+ return p !== void 0 && p(m, v) ? (x = E, m) : (x = E, C = v);
231
231
  }
232
232
  var f = !1, x, C, T = b === void 0 ? null : b;
233
233
  return [
@@ -241,7 +241,7 @@ function ts() {
241
241
  },
242
242
  [d, b, h, p]
243
243
  );
244
- var c = o(l, v[0], v[1]);
244
+ var c = o(l, S[0], S[1]);
245
245
  return s(
246
246
  function() {
247
247
  y.hasValue = !0, y.value = c;
@@ -914,9 +914,9 @@ function ws(e, t, n, r, o, i, s, u, a) {
914
914
  for (; !h.dataset.virtuosoScroller; )
915
915
  h = h.parentElement;
916
916
  const p = h.lastElementChild.dataset.viewportType === "window";
917
- let v;
918
- p && (v = h.ownerDocument.defaultView);
919
- const y = s ? u ? s.scrollLeft : s.scrollTop : p ? u ? v.scrollX || v.document.documentElement.scrollLeft : v.scrollY || v.document.documentElement.scrollTop : u ? h.scrollLeft : h.scrollTop, c = s ? u ? s.scrollWidth : s.scrollHeight : p ? u ? v.document.documentElement.scrollWidth : v.document.documentElement.scrollHeight : u ? h.scrollWidth : h.scrollHeight, g = s ? u ? s.offsetWidth : s.offsetHeight : p ? u ? v.innerWidth : v.innerHeight : u ? h.offsetWidth : h.offsetHeight;
917
+ let S;
918
+ p && (S = h.ownerDocument.defaultView);
919
+ const y = s ? u ? s.scrollLeft : s.scrollTop : p ? u ? S.scrollX || S.document.documentElement.scrollLeft : S.scrollY || S.document.documentElement.scrollTop : u ? h.scrollLeft : h.scrollTop, c = s ? u ? s.scrollWidth : s.scrollHeight : p ? u ? S.document.documentElement.scrollWidth : S.document.documentElement.scrollHeight : u ? h.scrollWidth : h.scrollHeight, g = s ? u ? s.offsetWidth : s.offsetHeight : p ? u ? S.innerWidth : S.innerHeight : u ? h.offsetWidth : h.offsetHeight;
920
920
  r({
921
921
  scrollHeight: c,
922
922
  scrollTop: Math.max(y, 0),
@@ -957,8 +957,8 @@ function ti(e, t, n) {
957
957
  const l = a.getBoundingClientRect(), d = l.width;
958
958
  let b, h;
959
959
  if (t) {
960
- const p = t.getBoundingClientRect(), v = l.top - p.top;
961
- h = p.height - Math.max(0, v), b = v + t.scrollTop;
960
+ const p = t.getBoundingClientRect(), S = l.top - p.top;
961
+ h = p.height - Math.max(0, S), b = S + t.scrollTop;
962
962
  } else {
963
963
  const p = s.current.ownerDocument.defaultView;
964
964
  h = p.innerHeight - Math.max(0, l.top), b = l.top + p.scrollY;
@@ -994,7 +994,7 @@ function ti(e, t, n) {
994
994
  }
995
995
  const Ke = we(
996
996
  () => {
997
- const e = xe(), t = xe(), n = F(0), r = xe(), o = F(0), i = xe(), s = xe(), u = F(0), a = F(0), l = F(0), d = F(0), b = xe(), h = xe(), p = F(!1), v = F(!1), y = F(!1);
997
+ const e = xe(), t = xe(), n = F(0), r = xe(), o = F(0), i = xe(), s = xe(), u = F(0), a = F(0), l = F(0), d = F(0), b = xe(), h = xe(), p = F(!1), S = F(!1), y = F(!1);
998
998
  return re(
999
999
  P(
1000
1000
  e,
@@ -1013,7 +1013,7 @@ const Ke = we(
1013
1013
  fixedHeaderHeight: a,
1014
1014
  footerHeight: d,
1015
1015
  headerHeight: u,
1016
- horizontalDirection: v,
1016
+ horizontalDirection: S,
1017
1017
  scrollBy: h,
1018
1018
  // input
1019
1019
  scrollContainerState: e,
@@ -1279,7 +1279,7 @@ function zs(e, [t, n, r, o]) {
1279
1279
  let s = i, u = 0;
1280
1280
  if (n.length > 0 && Te(i) && t.length === 2) {
1281
1281
  const h = t[0].size, p = t[1].size;
1282
- s = n.reduce((v, y) => et(et(v, y, h), y + 1, p), s);
1282
+ s = n.reduce((S, y) => et(et(S, y, h), y + 1, p), s);
1283
1283
  } else
1284
1284
  [s, u] = Rs(s, t);
1285
1285
  if (s === i)
@@ -1342,14 +1342,14 @@ const Ps = {
1342
1342
  offsetWidth: "width"
1343
1343
  }, gt = we(
1344
1344
  ([{ log: e }, { recalcInProgress: t }]) => {
1345
- const n = xe(), r = xe(), o = Ue(r, 0), i = xe(), s = xe(), u = F(0), a = F([]), l = F(void 0), d = F(void 0), b = F(void 0), h = F(void 0), p = F((m, S) => xt(m, Ps[S])), v = F(void 0), y = F(0), c = ks(), g = Ue(
1345
+ const n = xe(), r = xe(), o = Ue(r, 0), i = xe(), s = xe(), u = F(0), a = F([]), l = F(void 0), d = F(void 0), b = F(void 0), h = F(void 0), p = F((m, v) => xt(m, Ps[v])), S = F(void 0), y = F(0), c = ks(), g = Ue(
1346
1346
  P(n, ve(a, e, y), pt(zs, c), Me()),
1347
1347
  c
1348
1348
  ), f = Ue(
1349
1349
  P(
1350
1350
  a,
1351
1351
  Me(),
1352
- pt((m, S) => ({ current: S, prev: m.current }), {
1352
+ pt((m, v) => ({ current: v, prev: m.current }), {
1353
1353
  current: [],
1354
1354
  prev: []
1355
1355
  }),
@@ -1362,10 +1362,10 @@ const Ps = {
1362
1362
  a,
1363
1363
  ae((m) => m.length > 0),
1364
1364
  ve(g, y),
1365
- X(([m, S, R]) => {
1366
- const I = m.reduce((k, z, A) => et(k, z, Yt(z, S.offsetTree, R) || A), Gt());
1365
+ X(([m, v, k]) => {
1366
+ const I = m.reduce((_, z, A) => et(_, z, Yt(z, v.offsetTree, k) || A), Gt());
1367
1367
  return {
1368
- ...S,
1368
+ ...v,
1369
1369
  groupIndices: m,
1370
1370
  groupOffsetTree: I
1371
1371
  };
@@ -1376,11 +1376,11 @@ const Ps = {
1376
1376
  P(
1377
1377
  r,
1378
1378
  ve(g),
1379
- ae(([m, { lastIndex: S }]) => m < S),
1380
- X(([m, { lastIndex: S, lastSize: R }]) => [
1379
+ ae(([m, { lastIndex: v }]) => m < v),
1380
+ X(([m, { lastIndex: v, lastSize: k }]) => [
1381
1381
  {
1382
- endIndex: S,
1383
- size: R,
1382
+ endIndex: v,
1383
+ size: k,
1384
1384
  startIndex: m
1385
1385
  }
1386
1386
  ])
@@ -1399,9 +1399,9 @@ const Ps = {
1399
1399
  d,
1400
1400
  ae((m) => m !== void 0 && Te(Be(g).sizeTree)),
1401
1401
  X((m) => {
1402
- const S = Be(b), R = Be(a).length > 0;
1403
- return S ? R ? [
1404
- { endIndex: 0, size: S, startIndex: 0 },
1402
+ const v = Be(b), k = Be(a).length > 0;
1403
+ return v ? k ? [
1404
+ { endIndex: 0, size: v, startIndex: 0 },
1405
1405
  { endIndex: 1, size: m, startIndex: 1 }
1406
1406
  ] : [] : [{ endIndex: 0, size: m, startIndex: 0 }];
1407
1407
  })
@@ -1412,21 +1412,21 @@ const Ps = {
1412
1412
  h,
1413
1413
  ae((m) => m !== void 0 && m.length > 0 && Te(Be(g).sizeTree)),
1414
1414
  X((m) => {
1415
- const S = [];
1416
- let R = m[0], I = 0;
1417
- for (let k = 1; k < m.length; k++) {
1418
- const z = m[k];
1419
- z !== R && (S.push({
1420
- endIndex: k - 1,
1421
- size: R,
1415
+ const v = [];
1416
+ let k = m[0], I = 0;
1417
+ for (let _ = 1; _ < m.length; _++) {
1418
+ const z = m[_];
1419
+ z !== k && (v.push({
1420
+ endIndex: _ - 1,
1421
+ size: k,
1422
1422
  startIndex: I
1423
- }), R = z, I = k);
1423
+ }), k = z, I = _);
1424
1424
  }
1425
- return S.push({
1425
+ return v.push({
1426
1426
  endIndex: m.length - 1,
1427
- size: R,
1427
+ size: k,
1428
1428
  startIndex: I
1429
- }), S;
1429
+ }), v;
1430
1430
  })
1431
1431
  ),
1432
1432
  n
@@ -1434,19 +1434,19 @@ const Ps = {
1434
1434
  P(
1435
1435
  a,
1436
1436
  ve(b, d),
1437
- ae(([, m, S]) => m !== void 0 && S !== void 0),
1438
- X(([m, S, R]) => {
1437
+ ae(([, m, v]) => m !== void 0 && v !== void 0),
1438
+ X(([m, v, k]) => {
1439
1439
  const I = [];
1440
- for (let k = 0; k < m.length; k++) {
1441
- const z = m[k], A = m[k + 1];
1440
+ for (let _ = 0; _ < m.length; _++) {
1441
+ const z = m[_], A = m[_ + 1];
1442
1442
  I.push({
1443
1443
  startIndex: z,
1444
1444
  endIndex: z,
1445
- size: S
1445
+ size: v
1446
1446
  }), A !== void 0 && I.push({
1447
1447
  startIndex: z + 1,
1448
1448
  endIndex: A - 1,
1449
- size: R
1449
+ size: k
1450
1450
  });
1451
1451
  }
1452
1452
  return I;
@@ -1459,9 +1459,9 @@ const Ps = {
1459
1459
  n,
1460
1460
  ve(g),
1461
1461
  pt(
1462
- ({ sizes: m }, [S, R]) => ({
1463
- changed: R !== m,
1464
- sizes: R
1462
+ ({ sizes: m }, [v, k]) => ({
1463
+ changed: k !== m,
1464
+ sizes: k
1465
1465
  }),
1466
1466
  { changed: !1, sizes: c }
1467
1467
  ),
@@ -1472,22 +1472,22 @@ const Ps = {
1472
1472
  P(
1473
1473
  u,
1474
1474
  pt(
1475
- (m, S) => ({ diff: m.prev - S, prev: S }),
1475
+ (m, v) => ({ diff: m.prev - v, prev: v }),
1476
1476
  { diff: 0, prev: 0 }
1477
1477
  ),
1478
1478
  X((m) => m.diff)
1479
1479
  ),
1480
1480
  (m) => {
1481
- const { groupIndices: S } = Be(g);
1481
+ const { groupIndices: v } = Be(g);
1482
1482
  if (m > 0)
1483
- me(t, !0), me(i, m + Xr(m, S));
1483
+ me(t, !0), me(i, m + Xr(m, v));
1484
1484
  else if (m < 0) {
1485
- const R = Be(f);
1486
- R.length > 0 && (m -= Xr(-m, R)), me(s, m);
1485
+ const k = Be(f);
1486
+ k.length > 0 && (m -= Xr(-m, k)), me(s, m);
1487
1487
  }
1488
1488
  }
1489
- ), Ce(P(u, ve(e)), ([m, S]) => {
1490
- m < 0 && S(
1489
+ ), Ce(P(u, ve(e)), ([m, v]) => {
1490
+ m < 0 && v(
1491
1491
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
1492
1492
  { firstItemIndex: u },
1493
1493
  Qe.ERROR
@@ -1498,37 +1498,37 @@ const Ps = {
1498
1498
  P(
1499
1499
  i,
1500
1500
  ve(g),
1501
- X(([m, S]) => {
1502
- const R = S.groupIndices.length > 0, I = [], k = S.lastSize;
1503
- if (R) {
1504
- const z = Xt(S.sizeTree, 0);
1501
+ X(([m, v]) => {
1502
+ const k = v.groupIndices.length > 0, I = [], _ = v.lastSize;
1503
+ if (k) {
1504
+ const z = Xt(v.sizeTree, 0);
1505
1505
  let A = 0, M = 0;
1506
1506
  for (; A < m; ) {
1507
- const G = S.groupIndices[M], _ = S.groupIndices.length === M + 1 ? 1 / 0 : S.groupIndices[M + 1] - G - 1;
1507
+ const G = v.groupIndices[M], R = v.groupIndices.length === M + 1 ? 1 / 0 : v.groupIndices[M + 1] - G - 1;
1508
1508
  I.push({
1509
1509
  endIndex: G,
1510
1510
  size: z,
1511
1511
  startIndex: G
1512
1512
  }), I.push({
1513
- endIndex: G + 1 + _ - 1,
1514
- size: k,
1513
+ endIndex: G + 1 + R - 1,
1514
+ size: _,
1515
1515
  startIndex: G + 1
1516
- }), M++, A += _ + 1;
1516
+ }), M++, A += R + 1;
1517
1517
  }
1518
- const B = Mt(S.sizeTree);
1518
+ const B = Mt(v.sizeTree);
1519
1519
  return A !== m && B.shift(), B.reduce(
1520
- (G, { k: _, v: N }) => {
1520
+ (G, { k: R, v: H }) => {
1521
1521
  let Z = G.ranges;
1522
1522
  return G.prevSize !== 0 && (Z = [
1523
1523
  ...G.ranges,
1524
1524
  {
1525
- endIndex: _ + m - 1,
1525
+ endIndex: R + m - 1,
1526
1526
  size: G.prevSize,
1527
1527
  startIndex: G.prevIndex
1528
1528
  }
1529
1529
  ]), {
1530
- prevIndex: _ + m,
1531
- prevSize: N,
1530
+ prevIndex: R + m,
1531
+ prevSize: H,
1532
1532
  ranges: Z
1533
1533
  };
1534
1534
  },
@@ -1539,7 +1539,7 @@ const Ps = {
1539
1539
  }
1540
1540
  ).ranges;
1541
1541
  }
1542
- return Mt(S.sizeTree).reduce(
1542
+ return Mt(v.sizeTree).reduce(
1543
1543
  (z, { k: A, v: M }) => ({
1544
1544
  prevIndex: A + m,
1545
1545
  prevSize: M,
@@ -1547,7 +1547,7 @@ const Ps = {
1547
1547
  }),
1548
1548
  {
1549
1549
  prevIndex: 0,
1550
- prevSize: k,
1550
+ prevSize: _,
1551
1551
  ranges: []
1552
1552
  }
1553
1553
  ).ranges;
@@ -1559,9 +1559,9 @@ const Ps = {
1559
1559
  P(
1560
1560
  s,
1561
1561
  ve(g, y),
1562
- X(([m, { offsetTree: S }, R]) => {
1562
+ X(([m, { offsetTree: v }, k]) => {
1563
1563
  const I = -m;
1564
- return Yt(I, S, R);
1564
+ return Yt(I, v, k);
1565
1565
  })
1566
1566
  )
1567
1567
  );
@@ -1569,35 +1569,35 @@ const Ps = {
1569
1569
  P(
1570
1570
  s,
1571
1571
  ve(g, y),
1572
- X(([m, S, R]) => {
1573
- if (S.groupIndices.length > 0) {
1574
- if (Te(S.sizeTree))
1575
- return S;
1572
+ X(([m, v, k]) => {
1573
+ if (v.groupIndices.length > 0) {
1574
+ if (Te(v.sizeTree))
1575
+ return v;
1576
1576
  let I = Gt();
1577
- const k = Be(f);
1577
+ const _ = Be(f);
1578
1578
  let z = 0, A = 0, M = 0;
1579
1579
  for (; z < -m; ) {
1580
- M = k[A];
1581
- const B = k[A + 1] - M - 1;
1580
+ M = _[A];
1581
+ const B = _[A + 1] - M - 1;
1582
1582
  A++, z += B + 1;
1583
1583
  }
1584
- if (I = Mt(S.sizeTree).reduce((B, { k: G, v: _ }) => et(B, Math.max(0, G + m), _), I), z !== -m) {
1585
- const B = Xt(S.sizeTree, M);
1584
+ if (I = Mt(v.sizeTree).reduce((B, { k: G, v: R }) => et(B, Math.max(0, G + m), R), I), z !== -m) {
1585
+ const B = Xt(v.sizeTree, M);
1586
1586
  I = et(I, 0, B);
1587
- const G = at(S.sizeTree, -m + 1)[1];
1587
+ const G = at(v.sizeTree, -m + 1)[1];
1588
1588
  I = et(I, 1, G);
1589
1589
  }
1590
1590
  return {
1591
- ...S,
1591
+ ...v,
1592
1592
  sizeTree: I,
1593
- ...hr(S.offsetTree, 0, I, R)
1593
+ ...hr(v.offsetTree, 0, I, k)
1594
1594
  };
1595
1595
  } else {
1596
- const I = Mt(S.sizeTree).reduce((k, { k: z, v: A }) => et(k, Math.max(0, z + m), A), Gt());
1596
+ const I = Mt(v.sizeTree).reduce((_, { k: z, v: A }) => et(_, Math.max(0, z + m), A), Gt());
1597
1597
  return {
1598
- ...S,
1598
+ ...v,
1599
1599
  sizeTree: I,
1600
- ...hr(S.offsetTree, 0, I, R)
1600
+ ...hr(v.offsetTree, 0, I, k)
1601
1601
  };
1602
1602
  }
1603
1603
  })
@@ -1606,7 +1606,7 @@ const Ps = {
1606
1606
  ), {
1607
1607
  beforeUnshiftWith: T,
1608
1608
  // input
1609
- data: v,
1609
+ data: S,
1610
1610
  defaultItemSize: d,
1611
1611
  firstItemIndex: u,
1612
1612
  fixedItemSize: l,
@@ -1701,7 +1701,7 @@ const on = we(
1701
1701
  },
1702
1702
  { log: h }
1703
1703
  ]) => {
1704
- const p = xe(), v = xe(), y = F(0);
1704
+ const p = xe(), S = xe(), y = F(0);
1705
1705
  let c = null, g = null, f = null;
1706
1706
  function x() {
1707
1707
  c && (c(), c = null), f && (f(), f = null), g && (clearTimeout(g), g = null), me(a, !1);
@@ -1713,18 +1713,18 @@ const on = we(
1713
1713
  ve(e, i, o),
1714
1714
  X(
1715
1715
  ([
1716
- [C, T, E, m, S, R, I, k],
1716
+ [C, T, E, m, v, k, I, _],
1717
1717
  z,
1718
1718
  A,
1719
1719
  M
1720
1720
  ]) => {
1721
- const B = fi(C), { align: G, behavior: _, offset: N } = B, Z = m - 1, pe = ui(B, T, Z);
1722
- let ce = Yt(pe, T.offsetTree, z) + R;
1723
- G === "end" ? (ce += A + at(T.sizeTree, pe)[1] - E + M, pe === Z && (ce += I)) : G === "center" ? ce += (A + at(T.sizeTree, pe)[1] - E + M) / 2 : ce -= S, N && (ce += N);
1721
+ const B = fi(C), { align: G, behavior: R, offset: H } = B, Z = m - 1, pe = ui(B, T, Z);
1722
+ let ce = Yt(pe, T.offsetTree, z) + k;
1723
+ G === "end" ? (ce += A + at(T.sizeTree, pe)[1] - E + M, pe === Z && (ce += I)) : G === "center" ? ce += (A + at(T.sizeTree, pe)[1] - E + M) / 2 : ce -= v, H && (ce += H);
1724
1724
  const de = (ye) => {
1725
- x(), ye ? (k("retrying to scroll to", { location: C }, Qe.DEBUG), me(p, C)) : (me(v, !0), k("list did not change, scroll successful", {}, Qe.DEBUG));
1725
+ x(), ye ? (_("retrying to scroll to", { location: C }, Qe.DEBUG), me(p, C)) : (me(S, !0), _("list did not change, scroll successful", {}, Qe.DEBUG));
1726
1726
  };
1727
- if (x(), _ === "smooth") {
1727
+ if (x(), R === "smooth") {
1728
1728
  let ye = !1;
1729
1729
  f = Ce(t, (ze) => {
1730
1730
  ye = ye || ze;
@@ -1735,13 +1735,13 @@ const on = we(
1735
1735
  c = lt(P(t, Hs(150)), de);
1736
1736
  return g = setTimeout(() => {
1737
1737
  x();
1738
- }, 1200), me(a, !0), k("scrolling from index to", { behavior: _, index: pe, top: ce }, Qe.DEBUG), { behavior: _, top: ce };
1738
+ }, 1200), me(a, !0), _("scrolling from index to", { behavior: R, index: pe, top: ce }, Qe.DEBUG), { behavior: R, top: ce };
1739
1739
  }
1740
1740
  )
1741
1741
  ),
1742
1742
  l
1743
1743
  ), {
1744
- scrollTargetReached: v,
1744
+ scrollTargetReached: S,
1745
1745
  scrollToIndex: p,
1746
1746
  topListHeight: y
1747
1747
  };
@@ -1791,7 +1791,7 @@ const sn = we(
1791
1791
  P(
1792
1792
  Fe(t, s),
1793
1793
  ve(u, n, e, l),
1794
- ae(([[, d], b, { sizeTree: h }, p, v]) => d && (!Te(h) || yr(p)) && !b && !v),
1794
+ ae(([[, d], b, { sizeTree: h }, p, S]) => d && (!Te(h) || yr(p)) && !b && !S),
1795
1795
  ve(a)
1796
1796
  ),
1797
1797
  ([, d]) => {
@@ -1843,16 +1843,16 @@ const Zt = "up", jt = "down", Ns = "none", Fs = {
1843
1843
  ),
1844
1844
  u
1845
1845
  ), re(P(u, mt(50)), l);
1846
- const v = tt(
1846
+ const S = tt(
1847
1847
  P(
1848
1848
  Fe(r, le(i), le(t), le(e), le(d)),
1849
- pt((f, [{ scrollHeight: x, scrollTop: C }, T, E, m, S]) => {
1850
- const R = C + T - x > -S, I = {
1849
+ pt((f, [{ scrollHeight: x, scrollTop: C }, T, E, m, v]) => {
1850
+ const k = C + T - x > -v, I = {
1851
1851
  scrollHeight: x,
1852
1852
  scrollTop: C,
1853
1853
  viewportHeight: T
1854
1854
  };
1855
- if (R) {
1855
+ if (k) {
1856
1856
  let z, A;
1857
1857
  return C > f.state.scrollTop ? (z = "SCROLLED_DOWN", A = f.state.scrollTop - C) : (z = "SIZE_DECREASED", A = f.state.scrollTop - C || f.scrollTopDelta), {
1858
1858
  atBottom: !0,
@@ -1861,10 +1861,10 @@ const Zt = "up", jt = "down", Ns = "none", Fs = {
1861
1861
  state: I
1862
1862
  };
1863
1863
  }
1864
- let k;
1865
- return I.scrollHeight > f.state.scrollHeight ? k = "SIZE_INCREASED" : T < f.state.viewportHeight ? k = "VIEWPORT_HEIGHT_DECREASING" : C < f.state.scrollTop ? k = "SCROLLING_UPWARDS" : k = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1864
+ let _;
1865
+ return I.scrollHeight > f.state.scrollHeight ? _ = "SIZE_INCREASED" : T < f.state.viewportHeight ? _ = "VIEWPORT_HEIGHT_DECREASING" : C < f.state.scrollTop ? _ = "SCROLLING_UPWARDS" : _ = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1866
1866
  atBottom: !1,
1867
- notAtBottomBecause: k,
1867
+ notAtBottomBecause: _,
1868
1868
  state: I
1869
1869
  };
1870
1870
  }, Fs),
@@ -1906,7 +1906,7 @@ const Zt = "up", jt = "down", Ns = "none", Fs = {
1906
1906
  );
1907
1907
  re(
1908
1908
  P(
1909
- v,
1909
+ S,
1910
1910
  X((f) => f.atBottom)
1911
1911
  ),
1912
1912
  s
@@ -1944,7 +1944,7 @@ const Zt = "up", jt = "down", Ns = "none", Fs = {
1944
1944
  ),
1945
1945
  g
1946
1946
  ), {
1947
- atBottomState: v,
1947
+ atBottomState: S,
1948
1948
  atBottomStateChange: a,
1949
1949
  atBottomThreshold: d,
1950
1950
  atTopStateChange: l,
@@ -1984,7 +1984,7 @@ const Rr = we(
1984
1984
  d,
1985
1985
  b,
1986
1986
  h,
1987
- [p, v],
1987
+ [p, S],
1988
1988
  y,
1989
1989
  c,
1990
1990
  g,
@@ -1993,10 +1993,10 @@ const Rr = we(
1993
1993
  ]) => {
1994
1994
  const C = d - f, T = c + g, E = Math.max(h - C, 0);
1995
1995
  let m = Qr;
1996
- const S = Zr(x, Jt), R = Zr(x, en);
1997
- return p -= f, p += h + g, v += h + g, v -= f, p > d + T - S && (m = Zt), v < d - E + b + R && (m = jt), m !== Qr ? [
1998
- Math.max(C - h - Yr(y, Jt, m) - S, 0),
1999
- C - E - g + b + Yr(y, en, m) + R
1996
+ const v = Zr(x, Jt), k = Zr(x, en);
1997
+ return p -= f, p += h + g, S += h + g, S -= f, p > d + T - v && (m = Zt), S < d - E + b + k && (m = jt), m !== Qr ? [
1998
+ Math.max(C - h - Yr(y, Jt, m) - v, 0),
1999
+ C - E - g + b + Yr(y, en, m) + k
2000
2000
  ] : null;
2001
2001
  }
2002
2002
  ),
@@ -2047,12 +2047,12 @@ function bn(e, t, n, r, o, i) {
2047
2047
  const y = e[e.length - 1];
2048
2048
  d = y.offset + y.size;
2049
2049
  }
2050
- const b = n - s, h = u + b * a + (b - 1) * r, p = l, v = h - d;
2050
+ const b = n - s, h = u + b * a + (b - 1) * r, p = l, S = h - d;
2051
2051
  return {
2052
2052
  bottom: d,
2053
2053
  firstItemIndex: i,
2054
2054
  items: Jr(e, o, i),
2055
- offsetBottom: v,
2055
+ offsetBottom: S,
2056
2056
  offsetTop: l,
2057
2057
  top: p,
2058
2058
  topItems: Jr(t, o, i),
@@ -2115,7 +2115,7 @@ const Ot = we(
2115
2115
  { topListHeight: b },
2116
2116
  h,
2117
2117
  { didMount: p },
2118
- { recalcInProgress: v }
2118
+ { recalcInProgress: S }
2119
2119
  ]) => {
2120
2120
  const y = F([]), c = F(0), g = xe(), f = F(0);
2121
2121
  re(i.topItemsIndexes, y);
@@ -2123,7 +2123,7 @@ const Ot = we(
2123
2123
  P(
2124
2124
  Fe(
2125
2125
  p,
2126
- v,
2126
+ S,
2127
2127
  le(a, Qt),
2128
2128
  le(o),
2129
2129
  le(r),
@@ -2135,36 +2135,36 @@ const Ot = we(
2135
2135
  le(f),
2136
2136
  e
2137
2137
  ),
2138
- ae(([m, S, , R, , , , , , , , I]) => {
2139
- const k = I && I.length !== R;
2140
- return m && !S && !k;
2138
+ ae(([m, v, , k, , , , , , , , I]) => {
2139
+ const _ = I && I.length !== k;
2140
+ return m && !v && !_;
2141
2141
  }),
2142
2142
  X(
2143
2143
  ([
2144
2144
  ,
2145
2145
  ,
2146
- [m, S],
2147
- R,
2148
- I,
2146
+ [m, v],
2149
2147
  k,
2148
+ I,
2149
+ _,
2150
2150
  z,
2151
2151
  A,
2152
2152
  M,
2153
2153
  B,
2154
2154
  G,
2155
- _
2155
+ R
2156
2156
  ]) => {
2157
- var N, Z, pe, ce;
2157
+ var H, Z, pe, ce;
2158
2158
  const de = I, { offsetTree: ye, sizeTree: ze } = de, W = Be(c);
2159
- if (R === 0)
2160
- return { ...Wn, totalCount: R };
2161
- if (m === 0 && S === 0)
2162
- return W === 0 ? { ...Wn, totalCount: R } : gi(W, k, I, M, B, _ || []);
2159
+ if (k === 0)
2160
+ return { ...Wn, totalCount: k };
2161
+ if (m === 0 && v === 0)
2162
+ return W === 0 ? { ...Wn, totalCount: k } : gi(W, _, I, M, B, R || []);
2163
2163
  if (Te(ze))
2164
2164
  return W > 0 ? null : bn(
2165
- Ws(kr(k, R), de, _),
2165
+ Ws(kr(_, k), de, R),
2166
2166
  [],
2167
- R,
2167
+ k,
2168
2168
  B,
2169
2169
  de,
2170
2170
  M
@@ -2176,15 +2176,15 @@ const Ot = we(
2176
2176
  for (const ee of Lt(ze, V, J)) {
2177
2177
  const ue = ee.value, se = Math.max(ee.start, V), Ie = Math.min(ee.end, J);
2178
2178
  for (let be = se; be <= Ie; be++)
2179
- D.push({ data: _ == null ? void 0 : _[be], index: be, offset: ne, size: ue }), ne += ue;
2179
+ D.push({ data: R == null ? void 0 : R[be], index: be, offset: ne, size: ue }), ne += ue;
2180
2180
  }
2181
2181
  }
2182
2182
  if (!z)
2183
- return bn([], D, R, B, de, M);
2184
- const U = A.length > 0 ? A[A.length - 1] + 1 : 0, O = Es(ye, m, S, U);
2183
+ return bn([], D, k, B, de, M);
2184
+ const U = A.length > 0 ? A[A.length - 1] + 1 : 0, O = Es(ye, m, v, U);
2185
2185
  if (O.length === 0)
2186
2186
  return null;
2187
- const H = R - 1, Q = _n([], (V) => {
2187
+ const N = k - 1, Q = _n([], (V) => {
2188
2188
  for (const J of O) {
2189
2189
  const ne = J.value;
2190
2190
  let ee = ne.offset, ue = J.start;
@@ -2195,9 +2195,9 @@ const Ot = we(
2195
2195
  ee += be * se + be * B;
2196
2196
  }
2197
2197
  ue < U && (ee += (U - ue) * se, ue = U);
2198
- const Ie = Math.min(J.end, H);
2199
- for (let be = ue; be <= Ie && !(ee >= S); be++)
2200
- V.push({ data: _ == null ? void 0 : _[be], index: be, offset: ee, size: se }), ee += se + B;
2198
+ const Ie = Math.min(J.end, N);
2199
+ for (let be = ue; be <= Ie && !(ee >= v); be++)
2200
+ V.push({ data: R == null ? void 0 : R[be], index: be, offset: ee, size: se }), ee += se + B;
2201
2201
  }
2202
2202
  }), L = eo(G, Jt), ie = eo(G, en);
2203
2203
  if (Q.length > 0 && (L > 0 || ie > 0)) {
@@ -2206,21 +2206,21 @@ const Ot = we(
2206
2206
  const ne = Math.min(L, V.index - U), ee = [];
2207
2207
  let ue = V.offset;
2208
2208
  for (let se = V.index - 1; se >= V.index - ne; se--) {
2209
- const Ie = (Z = (N = Lt(ze, se, se)[0]) == null ? void 0 : N.value) != null ? Z : V.size;
2210
- ue -= Ie + B, ee.unshift({ data: _ == null ? void 0 : _[se], index: se, offset: ue, size: Ie });
2209
+ const Ie = (Z = (H = Lt(ze, se, se)[0]) == null ? void 0 : H.value) != null ? Z : V.size;
2210
+ ue -= Ie + B, ee.unshift({ data: R == null ? void 0 : R[se], index: se, offset: ue, size: Ie });
2211
2211
  }
2212
2212
  Q.unshift(...ee);
2213
2213
  }
2214
- if (ie > 0 && J.index < H) {
2215
- const ne = Math.min(ie, H - J.index);
2214
+ if (ie > 0 && J.index < N) {
2215
+ const ne = Math.min(ie, N - J.index);
2216
2216
  let ee = J.offset + J.size + B;
2217
2217
  for (let ue = J.index + 1; ue <= J.index + ne; ue++) {
2218
2218
  const se = (ce = (pe = Lt(ze, ue, ue)[0]) == null ? void 0 : pe.value) != null ? ce : J.size;
2219
- Q.push({ data: _ == null ? void 0 : _[ue], index: ue, offset: ee, size: se }), ee += se + B;
2219
+ Q.push({ data: R == null ? void 0 : R[ue], index: ue, offset: ee, size: se }), ee += se + B;
2220
2220
  }
2221
2221
  }
2222
2222
  }
2223
- return bn(Q, D, R, B, de, M);
2223
+ return bn(Q, D, k, B, de, M);
2224
2224
  }
2225
2225
  ),
2226
2226
  //@ts-expect-error filter needs to be fixed
@@ -2260,8 +2260,8 @@ const Ot = we(
2260
2260
  x,
2261
2261
  ae(({ items: m }) => m.length > 0),
2262
2262
  ve(o, e),
2263
- ae(([{ items: m }, S]) => m[m.length - 1].originalIndex === S - 1),
2264
- X(([, m, S]) => [m - 1, S]),
2263
+ ae(([{ items: m }, v]) => m[m.length - 1].originalIndex === v - 1),
2264
+ X(([, m, v]) => [m - 1, v]),
2265
2265
  Me(Qt),
2266
2266
  X(([m]) => m)
2267
2267
  )
@@ -2269,7 +2269,7 @@ const Ot = we(
2269
2269
  P(
2270
2270
  x,
2271
2271
  mt(200),
2272
- ae(({ items: m, topItems: S }) => m.length > 0 && m[0].originalIndex === S.length),
2272
+ ae(({ items: m, topItems: v }) => m.length > 0 && m[0].originalIndex === v.length),
2273
2273
  X(({ items: m }) => m[0].index),
2274
2274
  Me()
2275
2275
  )
@@ -2278,14 +2278,14 @@ const Ot = we(
2278
2278
  x,
2279
2279
  ae(({ items: m }) => m.length > 0),
2280
2280
  X(({ items: m }) => {
2281
- let S = 0, R = m.length - 1;
2282
- for (; m[S].type === "group" && S < R; )
2283
- S++;
2284
- for (; m[R].type === "group" && R > S; )
2285
- R--;
2281
+ let v = 0, k = m.length - 1;
2282
+ for (; m[v].type === "group" && v < k; )
2283
+ v++;
2284
+ for (; m[k].type === "group" && k > v; )
2285
+ k--;
2286
2286
  return {
2287
- endIndex: m[R].index,
2288
- startIndex: m[S].index
2287
+ endIndex: m[k].index,
2288
+ startIndex: m[v].index
2289
2289
  };
2290
2290
  }),
2291
2291
  Me(li)
@@ -2363,11 +2363,11 @@ const Ot = we(
2363
2363
  d,
2364
2364
  ve(t, a, n, i, o, r, u),
2365
2365
  ve(e),
2366
- X(([[b, h, p, v, y, c, g, f], x]) => {
2367
- const { align: C, behavior: T, calculateViewLocation: E = $s, done: m, ...S } = b, R = ui(b, h, v - 1), I = Yt(R, h.offsetTree, x) + y + c, k = I + at(h.sizeTree, R)[1], z = f + c, A = f + p - g, M = E({
2368
- itemBottom: k,
2366
+ X(([[b, h, p, S, y, c, g, f], x]) => {
2367
+ const { align: C, behavior: T, calculateViewLocation: E = $s, done: m, ...v } = b, k = ui(b, h, S - 1), I = Yt(k, h.offsetTree, x) + y + c, _ = I + at(h.sizeTree, k)[1], z = f + c, A = f + p - g, M = E({
2368
+ itemBottom: _,
2369
2369
  itemTop: I,
2370
- locationParams: { align: C, behavior: T, ...S },
2370
+ locationParams: { align: C, behavior: T, ...v },
2371
2371
  viewportBottom: A,
2372
2372
  viewportTop: z
2373
2373
  });
@@ -2407,7 +2407,7 @@ const qs = (e, t) => typeof e == "function" ? to(e(t)) : t && to(e), js = we(
2407
2407
  { context: h },
2408
2408
  { scrollIntoView: p }
2409
2409
  ]) => {
2410
- const v = F(!1), y = xe();
2410
+ const S = F(!1), y = xe();
2411
2411
  let c = null;
2412
2412
  function g(T) {
2413
2413
  me(s, {
@@ -2419,10 +2419,10 @@ const qs = (e, t) => typeof e == "function" ? to(e(t)) : t && to(e), js = we(
2419
2419
  Ce(
2420
2420
  P(
2421
2421
  Fe(P(le(t), Et(1)), a),
2422
- ve(le(v), i, u, b),
2423
- X(([[T, E], m, S, R, I]) => {
2424
- let k = E && R, z = "auto";
2425
- return k && (z = qs(m, S || I), k = k && !!z), { followOutputBehavior: z, shouldFollow: k, totalCount: T };
2422
+ ve(le(S), i, u, b),
2423
+ X(([[T, E], m, v, k, I]) => {
2424
+ let _ = E && k, z = "auto";
2425
+ return _ && (z = qs(m, v || I), _ = _ && !!z), { followOutputBehavior: z, shouldFollow: _, totalCount: T };
2426
2426
  }),
2427
2427
  ae(({ shouldFollow: T }) => T)
2428
2428
  ),
@@ -2442,21 +2442,21 @@ const qs = (e, t) => typeof e == "function" ? to(e(t)) : t && to(e), js = we(
2442
2442
  }
2443
2443
  Ce(
2444
2444
  P(
2445
- Fe(le(v), t, l),
2445
+ Fe(le(S), t, l),
2446
2446
  ae(([T, , E]) => T && E),
2447
2447
  pt(
2448
2448
  ({ value: T }, [, E]) => ({ refreshed: T === E, value: E }),
2449
2449
  { refreshed: !1, value: 0 }
2450
2450
  ),
2451
2451
  ae(({ refreshed: T }) => T),
2452
- ve(v, t)
2452
+ ve(S, t)
2453
2453
  ),
2454
2454
  ([, T]) => {
2455
2455
  Be(u) && f(T !== !1);
2456
2456
  }
2457
2457
  ), Ce(y, () => {
2458
- f(Be(v) !== !1);
2459
- }), Ce(Fe(le(v), o), ([T, E]) => {
2458
+ f(Be(S) !== !1);
2459
+ }), Ce(Fe(le(S), o), ([T, E]) => {
2460
2460
  T && !E.atBottom && E.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
2461
2461
  });
2462
2462
  const x = F(null), C = xe();
@@ -2476,7 +2476,7 @@ const qs = (e, t) => typeof e == "function" ? to(e(t)) : t && to(e), js = we(
2476
2476
  P(
2477
2477
  Fe(P(C, Et(1)), a),
2478
2478
  ve(le(x), u, b, h),
2479
- X(([[T, E], m, S, R, I]) => E && S && (m == null ? void 0 : m({ context: I, totalCount: T, scrollingInProgress: R }))),
2479
+ X(([[T, E], m, v, k, I]) => E && v && (m == null ? void 0 : m({ context: I, totalCount: T, scrollingInProgress: k }))),
2480
2480
  ae((T) => !!T),
2481
2481
  mt(0)
2482
2482
  ),
@@ -2487,7 +2487,7 @@ const qs = (e, t) => typeof e == "function" ? to(e(t)) : t && to(e), js = we(
2487
2487
  Be(d)("scrolling into view", {}), me(p, T), c = null;
2488
2488
  });
2489
2489
  }
2490
- ), { autoscrollToBottom: y, followOutput: v, scrollIntoViewOnChange: x };
2490
+ ), { autoscrollToBottom: y, followOutput: S, scrollIntoViewOnChange: x };
2491
2491
  },
2492
2492
  Ee(
2493
2493
  gt,
@@ -2618,8 +2618,8 @@ const qs = (e, t) => typeof e == "function" ? to(e(t)) : t && to(e), js = we(
2618
2618
  l,
2619
2619
  ve(t, r, s, b, h, n)
2620
2620
  ),
2621
- ([p, v, y, c, g, f, x]) => {
2622
- const C = Os(v.sizeTree);
2621
+ ([p, S, y, c, g, f, x]) => {
2622
+ const C = Os(S.sizeTree);
2623
2623
  c && g !== null && f !== null && (y = g.scrollTop - f.offsetTop), y -= x, p({ ranges: C, scrollTop: y });
2624
2624
  }
2625
2625
  ), re(P(d, ae(yr), X(Qs)), o), re(
@@ -2663,22 +2663,22 @@ const Zs = Si(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2663
2663
  { listState: a },
2664
2664
  { beforeUnshiftWith: l, gap: d, shiftWithOffset: b, sizes: h },
2665
2665
  { log: p },
2666
- { recalcInProgress: v }
2666
+ { recalcInProgress: S }
2667
2667
  ]) => {
2668
2668
  const y = tt(
2669
2669
  P(
2670
2670
  a,
2671
2671
  ve(s),
2672
2672
  pt(
2673
- ([, g, f, x], [{ bottom: C, items: T, offsetBottom: E, totalCount: m }, S]) => {
2674
- const R = C + E;
2673
+ ([, g, f, x], [{ bottom: C, items: T, offsetBottom: E, totalCount: m }, v]) => {
2674
+ const k = C + E;
2675
2675
  let I = 0;
2676
- return f === m && g.length > 0 && T.length > 0 && (T[0].originalIndex === 0 && g[0].originalIndex === 0 || (I = R - x, I !== 0 && (I += S))), [I, T, m, R];
2676
+ return f === m && g.length > 0 && T.length > 0 && (T[0].originalIndex === 0 && g[0].originalIndex === 0 || (I = k - x, I !== 0 && (I += v))), [I, T, m, k];
2677
2677
  },
2678
2678
  [0, [], 0, 0]
2679
2679
  ),
2680
2680
  ae(([g]) => g !== 0),
2681
- ve(r, u, n, o, p, v),
2681
+ ve(r, u, n, o, p, S),
2682
2682
  ae(([, g, f, x, , , C]) => !C && !x && g !== 0 && f === Zt),
2683
2683
  X(([[g], , , , , f]) => (f("Upward scrolling compensation", { amount: g }, Qe.DEBUG), g))
2684
2684
  )
@@ -2690,7 +2690,7 @@ const Zs = Si(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2690
2690
  x && Zs() ? me(e, f - g) : c(-g);
2691
2691
  }), Ce(
2692
2692
  P(
2693
- Fe(Ue(i, !1), e, v),
2693
+ Fe(Ue(i, !1), e, S),
2694
2694
  ae(([g, f, x]) => !g && !x && f !== 0),
2695
2695
  X(([g, f]) => f),
2696
2696
  mt(1)
@@ -2714,12 +2714,12 @@ const Zs = Si(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2714
2714
  return E(g);
2715
2715
  {
2716
2716
  let m = 0;
2717
- const S = Xt(C, 0);
2718
- let R = 0, I = 0;
2719
- for (; R < g; ) {
2720
- R++, m += S;
2721
- let k = f.length === I + 1 ? 1 / 0 : f[I + 1] - f[I] - 1;
2722
- R + k > g && (m -= S, k = g - R + 1), R += k, m += E(k), I++;
2717
+ const v = Xt(C, 0);
2718
+ let k = 0, I = 0;
2719
+ for (; k < g; ) {
2720
+ k++, m += v;
2721
+ let _ = f.length === I + 1 ? 1 / 0 : f[I + 1] - f[I] - 1;
2722
+ k + _ > g && (m -= v, _ = g - k + 1), k += _, m += E(_), I++;
2723
2723
  }
2724
2724
  return m;
2725
2725
  }
@@ -2728,7 +2728,7 @@ const Zs = Si(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2728
2728
  (g) => {
2729
2729
  me(e, g), requestAnimationFrame(() => {
2730
2730
  me(t, { top: g }), requestAnimationFrame(() => {
2731
- me(e, 0), me(v, !1);
2731
+ me(e, 0), me(S, !1);
2732
2732
  });
2733
2733
  });
2734
2734
  }
@@ -2792,7 +2792,7 @@ const Zs = Si(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2792
2792
  totalCount: h,
2793
2793
  trackItemSizes: p
2794
2794
  },
2795
- { initialItemFinalLocationReached: v, initialTopMostItemIndex: y, scrolledToInitialItem: c },
2795
+ { initialItemFinalLocationReached: S, initialTopMostItemIndex: y, scrolledToInitialItem: c },
2796
2796
  g,
2797
2797
  f,
2798
2798
  x,
@@ -2800,13 +2800,13 @@ const Zs = Si(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2800
2800
  { scrollToIndex: T },
2801
2801
  E,
2802
2802
  { topItemCount: m },
2803
- { groupCounts: S },
2804
- R
2803
+ { groupCounts: v },
2804
+ k
2805
2805
  ]) => {
2806
- const { listState: I, minOverscanItemCount: k, topItemsIndexes: z, rangeChanged: A, ...M } = C;
2807
- return re(A, R.scrollSeekRangeChanged), re(
2806
+ const { listState: I, minOverscanItemCount: _, topItemsIndexes: z, rangeChanged: A, ...M } = C;
2807
+ return re(A, k.scrollSeekRangeChanged), re(
2808
2808
  P(
2809
- R.windowViewportRect,
2809
+ k.windowViewportRect,
2810
2810
  X((B) => B.visibleHeight)
2811
2811
  ),
2812
2812
  g.viewportHeight
@@ -2817,9 +2817,9 @@ const Zs = Si(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2817
2817
  fixedItemHeight: r,
2818
2818
  fixedGroupHeight: o,
2819
2819
  gap: i,
2820
- groupCounts: S,
2820
+ groupCounts: v,
2821
2821
  heightEstimates: u,
2822
- initialItemFinalLocationReached: v,
2822
+ initialItemFinalLocationReached: S,
2823
2823
  initialTopMostItemIndex: y,
2824
2824
  scrolledToInitialItem: c,
2825
2825
  sizeRanges: l,
@@ -2831,7 +2831,7 @@ const Zs = Si(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2831
2831
  groupIndices: s,
2832
2832
  itemSize: a,
2833
2833
  listState: I,
2834
- minOverscanItemCount: k,
2834
+ minOverscanItemCount: _,
2835
2835
  scrollToIndex: T,
2836
2836
  // output
2837
2837
  statefulTotalCount: b,
@@ -2840,7 +2840,7 @@ const Zs = Si(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2840
2840
  rangeChanged: A,
2841
2841
  ...M,
2842
2842
  // the bag of IO from featureGroup1System
2843
- ...R,
2843
+ ...k,
2844
2844
  ...g,
2845
2845
  sizes: d,
2846
2846
  ...f
@@ -2928,7 +2928,7 @@ function xi(e, t, n) {
2928
2928
  () => Be(g),
2929
2929
  () => Be(g)
2930
2930
  );
2931
- }, v = (c) => {
2931
+ }, S = (c) => {
2932
2932
  const g = $.useContext(u)[c], [f, x] = $.useState(qr(Be, g));
2933
2933
  return dn(
2934
2934
  () => Ce(g, (C) => {
@@ -2936,7 +2936,7 @@ function xi(e, t, n) {
2936
2936
  }),
2937
2937
  [g, f]
2938
2938
  ), f;
2939
- }, y = $.version.startsWith("18") ? p : v;
2939
+ }, y = $.version.startsWith("18") ? p : S;
2940
2940
  return {
2941
2941
  Component: b,
2942
2942
  useEmitter: (c, g) => {
@@ -2957,21 +2957,21 @@ function nl(e) {
2957
2957
  function Ti(e, t, n, r = Wt, o, i) {
2958
2958
  const s = $.useRef(null), u = $.useRef(null), a = $.useRef(null), l = $.useCallback(
2959
2959
  (h) => {
2960
- let p, v, y;
2960
+ let p, S, y;
2961
2961
  const c = h.target;
2962
2962
  if (nl(c) || Vn(c)) {
2963
2963
  const f = Vn(c) ? c : c.defaultView;
2964
- y = i ? f.scrollX : f.scrollY, p = i ? f.document.documentElement.scrollWidth : f.document.documentElement.scrollHeight, v = i ? f.innerWidth : f.innerHeight;
2964
+ y = i ? f.scrollX : f.scrollY, p = i ? f.document.documentElement.scrollWidth : f.document.documentElement.scrollHeight, S = i ? f.innerWidth : f.innerHeight;
2965
2965
  } else
2966
- y = i ? c.scrollLeft : c.scrollTop, p = i ? c.scrollWidth : c.scrollHeight, v = i ? c.offsetWidth : c.offsetHeight;
2966
+ y = i ? c.scrollLeft : c.scrollTop, p = i ? c.scrollWidth : c.scrollHeight, S = i ? c.offsetWidth : c.offsetHeight;
2967
2967
  const g = () => {
2968
2968
  e({
2969
2969
  scrollHeight: p,
2970
2970
  scrollTop: Math.max(y, 0),
2971
- viewportHeight: v
2971
+ viewportHeight: S
2972
2972
  });
2973
2973
  };
2974
- h.suppressFlushSync ? g() : Yi.flushSync(g), u.current !== null && (y === u.current || y <= 0 || y === p - v) && (u.current = null, t(!0), a.current && (clearTimeout(a.current), a.current = null));
2974
+ h.suppressFlushSync ? g() : Yi.flushSync(g), u.current !== null && (y === u.current || y <= 0 || y === p - S) && (u.current = null, t(!0), a.current && (clearTimeout(a.current), a.current = null));
2975
2975
  },
2976
2976
  [e, t, i]
2977
2977
  );
@@ -2985,7 +2985,7 @@ function Ti(e, t, n, r = Wt, o, i) {
2985
2985
  const p = s.current;
2986
2986
  if (!p || (i ? "offsetWidth" in p && p.offsetWidth === 0 : "offsetHeight" in p && p.offsetHeight === 0))
2987
2987
  return;
2988
- const v = h.behavior === "smooth";
2988
+ const S = h.behavior === "smooth";
2989
2989
  let y, c, g;
2990
2990
  Vn(p) ? (c = Math.max(
2991
2991
  xt(p.document.documentElement, i ? "width" : "height"),
@@ -2993,10 +2993,10 @@ function Ti(e, t, n, r = Wt, o, i) {
2993
2993
  ), y = i ? p.innerWidth : p.innerHeight, g = i ? window.scrollX : window.scrollY) : (c = p[i ? "scrollWidth" : "scrollHeight"], y = xt(p, i ? "width" : "height"), g = p[i ? "scrollLeft" : "scrollTop"]);
2994
2994
  const f = c - y;
2995
2995
  if (h.top = Math.ceil(Math.max(Math.min(f, h.top), 0)), pi(y, c) || h.top === g) {
2996
- e({ scrollHeight: c, scrollTop: g, viewportHeight: y }), v && t(!0);
2996
+ e({ scrollHeight: c, scrollTop: g, viewportHeight: y }), S && t(!0);
2997
2997
  return;
2998
2998
  }
2999
- v ? (u.current = h.top, a.current && clearTimeout(a.current), a.current = setTimeout(() => {
2999
+ S ? (u.current = h.top, a.current && clearTimeout(a.current), a.current = setTimeout(() => {
3000
3000
  a.current = null, u.current = null, t(!0);
3001
3001
  }, 1e3)) : u.current = null, i && (h = { behavior: h.behavior, left: h.top }), p.scrollTo(h);
3002
3002
  }
@@ -3044,13 +3044,13 @@ const rl = /* @__PURE__ */ we(() => {
3044
3044
  ([e, t]) => ({ ...e, ...t }),
3045
3045
  Ee(yi, rl)
3046
3046
  ), il = ({ height: e }) => /* @__PURE__ */ w("div", { style: { height: e } }), sl = { overflowAnchor: "none", position: Mr(), zIndex: 1 }, ki = { overflowAnchor: "none" }, ll = { ...ki, display: "inline-block", height: "100%" }, ro = /* @__PURE__ */ $.memo(function({ showTopList: e = !1 }) {
3047
- const t = fe("listState"), n = ot("sizeRanges"), r = fe("useWindowScroll"), o = fe("customScrollParent"), i = ot("windowScrollContainerState"), s = ot("scrollContainerState"), u = o || r ? i : s, a = fe("itemContent"), l = fe("context"), d = fe("groupContent"), b = fe("trackItemSizes"), h = fe("itemSize"), p = fe("log"), v = ot("gap"), y = fe("horizontalDirection"), { callbackRef: c } = ws(
3047
+ const t = fe("listState"), n = ot("sizeRanges"), r = fe("useWindowScroll"), o = fe("customScrollParent"), i = ot("windowScrollContainerState"), s = ot("scrollContainerState"), u = o || r ? i : s, a = fe("itemContent"), l = fe("context"), d = fe("groupContent"), b = fe("trackItemSizes"), h = fe("itemSize"), p = fe("log"), S = ot("gap"), y = fe("horizontalDirection"), { callbackRef: c } = ws(
3048
3048
  n,
3049
3049
  h,
3050
3050
  b,
3051
3051
  e ? Wt : u,
3052
3052
  p,
3053
- v,
3053
+ S,
3054
3054
  o,
3055
3055
  y,
3056
3056
  fe("skipAnimationFrameInResizeObserver")
@@ -3058,17 +3058,17 @@ const rl = /* @__PURE__ */ we(() => {
3058
3058
  zr("deviation", (M) => {
3059
3059
  g !== M && f(M);
3060
3060
  });
3061
- const x = fe("EmptyPlaceholder"), C = fe("ScrollSeekPlaceholder") || il, T = fe("ListComponent"), E = fe("ItemComponent"), m = fe("GroupComponent"), S = fe("computeItemKey"), R = fe("isSeeking"), I = fe("groupIndices").length > 0, k = fe("alignToBottom"), z = fe("initialItemFinalLocationReached"), A = e ? {} : {
3061
+ const x = fe("EmptyPlaceholder"), C = fe("ScrollSeekPlaceholder") || il, T = fe("ListComponent"), E = fe("ItemComponent"), m = fe("GroupComponent"), v = fe("computeItemKey"), k = fe("isSeeking"), I = fe("groupIndices").length > 0, _ = fe("alignToBottom"), z = fe("initialItemFinalLocationReached"), A = e ? {} : {
3062
3062
  boxSizing: "border-box",
3063
3063
  ...y ? {
3064
3064
  display: "inline-block",
3065
3065
  height: "100%",
3066
- marginLeft: g !== 0 ? g : k ? "auto" : 0,
3066
+ marginLeft: g !== 0 ? g : _ ? "auto" : 0,
3067
3067
  paddingLeft: t.offsetTop,
3068
3068
  paddingRight: t.offsetBottom,
3069
3069
  whiteSpace: "nowrap"
3070
3070
  } : {
3071
- marginTop: g !== 0 ? g : k ? "auto" : 0,
3071
+ marginTop: g !== 0 ? g : _ ? "auto" : 0,
3072
3072
  paddingBottom: t.offsetBottom,
3073
3073
  paddingTop: t.offsetTop
3074
3074
  },
@@ -3082,8 +3082,8 @@ const rl = /* @__PURE__ */ we(() => {
3082
3082
  ref: c,
3083
3083
  style: A,
3084
3084
  children: (e ? t.topItems : t.items).map((M) => {
3085
- const B = M.originalIndex, G = S(B + t.firstItemIndex, M.data, l);
3086
- return R ? /* @__PURE__ */ hn(
3085
+ const B = M.originalIndex, G = v(B + t.firstItemIndex, M.data, l);
3086
+ return k ? /* @__PURE__ */ hn(
3087
3087
  C,
3088
3088
  {
3089
3089
  ...je(C, l),
@@ -3177,7 +3177,7 @@ const fl = /* @__PURE__ */ $.memo(function() {
3177
3177
  });
3178
3178
  function Ri({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
3179
3179
  return $.memo(function({ children: r, style: o, context: i, ...s }) {
3180
- const u = n("scrollContainerState"), a = t("ScrollerComponent"), l = n("smoothScrollTargetReached"), d = t("scrollerRef"), b = t("horizontalDirection") || !1, { scrollByCallback: h, scrollerRef: p, scrollToCallback: v } = Ti(
3180
+ const u = n("scrollContainerState"), a = t("ScrollerComponent"), l = n("smoothScrollTargetReached"), d = t("scrollerRef"), b = t("horizontalDirection") || !1, { scrollByCallback: h, scrollerRef: p, scrollToCallback: S } = Ti(
3181
3181
  u,
3182
3182
  l,
3183
3183
  a,
@@ -3185,7 +3185,7 @@ function Ri({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
3185
3185
  void 0,
3186
3186
  b
3187
3187
  );
3188
- return e("scrollTo", v), e("scrollBy", h), /* @__PURE__ */ w(
3188
+ return e("scrollTo", S), e("scrollBy", h), /* @__PURE__ */ w(
3189
3189
  a,
3190
3190
  {
3191
3191
  "data-testid": "virtuoso-scroller",
@@ -3202,11 +3202,11 @@ function Ri({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
3202
3202
  }
3203
3203
  function _i({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
3204
3204
  return $.memo(function({ children: r, style: o, context: i, ...s }) {
3205
- const u = n("windowScrollContainerState"), a = t("ScrollerComponent"), l = n("smoothScrollTargetReached"), d = t("totalListHeight"), b = t("deviation"), h = t("customScrollParent"), p = $.useRef(null), v = t("scrollerRef"), { scrollByCallback: y, scrollerRef: c, scrollToCallback: g } = Ti(
3205
+ const u = n("windowScrollContainerState"), a = t("ScrollerComponent"), l = n("smoothScrollTargetReached"), d = t("totalListHeight"), b = t("deviation"), h = t("customScrollParent"), p = $.useRef(null), S = t("scrollerRef"), { scrollByCallback: y, scrollerRef: c, scrollToCallback: g } = Ti(
3206
3206
  u,
3207
3207
  l,
3208
3208
  a,
3209
- v,
3209
+ S,
3210
3210
  h
3211
3211
  );
3212
3212
  return Ci(() => {
@@ -3401,67 +3401,67 @@ const kl = /* @__PURE__ */ we(
3401
3401
  { footerHeight: o, headerHeight: i, scrollBy: s, scrollContainerState: u, scrollTo: a, scrollTop: l, smoothScrollTargetReached: d, viewportHeight: b },
3402
3402
  h,
3403
3403
  p,
3404
- { didMount: v, propsReady: y },
3404
+ { didMount: S, propsReady: y },
3405
3405
  { customScrollParent: c, useWindowScroll: g, windowScrollContainerState: f, windowScrollTo: x, windowViewportRect: C },
3406
3406
  T
3407
3407
  ]) => {
3408
- const E = F(0), m = F(0), S = F(oo), R = F({ height: 0, width: 0 }), I = F({ height: 0, width: 0 }), k = xe(), z = xe(), A = F(0), M = F(null), B = F({ column: 0, row: 0 }), G = xe(), _ = xe(), N = F(!1), Z = F(0), pe = F(!0), ce = F(!1), de = F(!1);
3408
+ const E = F(0), m = F(0), v = F(oo), k = F({ height: 0, width: 0 }), I = F({ height: 0, width: 0 }), _ = xe(), z = xe(), A = F(0), M = F(null), B = F({ column: 0, row: 0 }), G = xe(), R = xe(), H = F(!1), Z = F(0), pe = F(!0), ce = F(!1), de = F(!1);
3409
3409
  Ce(
3410
3410
  P(
3411
- v,
3411
+ S,
3412
3412
  ve(Z),
3413
- ae(([O, H]) => !!H)
3413
+ ae(([O, N]) => !!N)
3414
3414
  ),
3415
3415
  () => {
3416
3416
  me(pe, !1);
3417
3417
  }
3418
3418
  ), Ce(
3419
3419
  P(
3420
- Fe(v, pe, I, R, Z, ce),
3421
- ae(([O, H, Q, L, , ie]) => O && !H && Q.height !== 0 && L.height !== 0 && !ie)
3420
+ Fe(S, pe, I, k, Z, ce),
3421
+ ae(([O, N, Q, L, , ie]) => O && !N && Q.height !== 0 && L.height !== 0 && !ie)
3422
3422
  ),
3423
3423
  ([, , , , O]) => {
3424
3424
  me(ce, !0), Tr(1, () => {
3425
- me(k, O);
3425
+ me(_, O);
3426
3426
  }), lt(P(l), () => {
3427
3427
  me(t, [0, 0]), me(pe, !0);
3428
3428
  });
3429
3429
  }
3430
3430
  ), re(
3431
3431
  P(
3432
- _,
3432
+ R,
3433
3433
  ae((O) => O != null && O.scrollTop > 0),
3434
3434
  dt(0)
3435
3435
  ),
3436
3436
  m
3437
3437
  ), Ce(
3438
3438
  P(
3439
- v,
3440
- ve(_),
3439
+ S,
3440
+ ve(R),
3441
3441
  ae(([, O]) => O != null)
3442
3442
  ),
3443
3443
  ([, O]) => {
3444
- O && (me(R, O.viewport), me(I, O.item), me(B, O.gap), O.scrollTop > 0 && (me(N, !0), lt(P(l, Et(1)), (H) => {
3445
- me(N, !1);
3444
+ O && (me(k, O.viewport), me(I, O.item), me(B, O.gap), O.scrollTop > 0 && (me(H, !0), lt(P(l, Et(1)), (N) => {
3445
+ me(H, !1);
3446
3446
  }), me(a, { top: O.scrollTop })));
3447
3447
  }
3448
3448
  ), re(
3449
3449
  P(
3450
- R,
3450
+ k,
3451
3451
  X(({ height: O }) => O)
3452
3452
  ),
3453
3453
  b
3454
3454
  ), re(
3455
3455
  P(
3456
3456
  Fe(
3457
- le(R, fn),
3457
+ le(k, fn),
3458
3458
  le(I, fn),
3459
- le(B, (O, H) => O && O.column === H.column && O.row === H.row),
3459
+ le(B, (O, N) => O && O.column === N.column && O.row === N.row),
3460
3460
  le(l)
3461
3461
  ),
3462
- X(([O, H, Q, L]) => ({
3462
+ X(([O, N, Q, L]) => ({
3463
3463
  gap: Q,
3464
- item: H,
3464
+ item: N,
3465
3465
  scrollTop: L,
3466
3466
  viewport: O
3467
3467
  }))
@@ -3474,10 +3474,10 @@ const kl = /* @__PURE__ */ we(
3474
3474
  r,
3475
3475
  le(B, Tl),
3476
3476
  le(I, fn),
3477
- le(R, fn),
3477
+ le(k, fn),
3478
3478
  le(M),
3479
3479
  le(m),
3480
- le(N),
3480
+ le(H),
3481
3481
  le(pe),
3482
3482
  le(Z)
3483
3483
  ),
@@ -3485,7 +3485,7 @@ const kl = /* @__PURE__ */ we(
3485
3485
  X(
3486
3486
  ([
3487
3487
  O,
3488
- [H, Q],
3488
+ [N, Q],
3489
3489
  L,
3490
3490
  ie,
3491
3491
  V,
@@ -3504,13 +3504,13 @@ const kl = /* @__PURE__ */ we(
3504
3504
  }
3505
3505
  const Ne = Mi(Oe, Re, se);
3506
3506
  let Ge, Ve;
3507
- ee ? H === 0 && Q === 0 && ne > 0 ? (Ge = 0, Ve = ne - 1) : (Ge = Ne * yn((H + Ie) / (be + Ie)), Ve = Ne * io((Q + Ie) / (be + Ie)) - 1, Ve = qn(O - 1, Ut(Ve, Ne - 1)), Ge = qn(Ve, Ut(0, Ge))) : (Ge = 0, Ve = -1);
3507
+ ee ? N === 0 && Q === 0 && ne > 0 ? (Ge = 0, Ve = ne - 1) : (Ge = Ne * yn((N + Ie) / (be + Ie)), Ve = Ne * io((Q + Ie) / (be + Ie)) - 1, Ve = qn(O - 1, Ut(Ve, Ne - 1)), Ge = qn(Ve, Ut(0, Ge))) : (Ge = 0, Ve = -1);
3508
3508
  const ct = lo(Ge, Ve, J), { bottom: Ze, top: Le } = ao(V, L, ie, ct), st = io(O / Ne), nt = st * be + (st - 1) * Ie - Ze;
3509
3509
  return { bottom: Ze, itemHeight: be, items: ct, itemWidth: Re, offsetBottom: nt, offsetTop: Le, top: Le };
3510
3510
  }
3511
3511
  )
3512
3512
  ),
3513
- S
3513
+ v
3514
3514
  ), re(
3515
3515
  P(
3516
3516
  M,
@@ -3520,10 +3520,10 @@ const kl = /* @__PURE__ */ we(
3520
3520
  E
3521
3521
  ), re(
3522
3522
  P(
3523
- Fe(R, I, S, B),
3524
- ae(([O, H, { items: Q }]) => Q.length > 0 && H.height !== 0 && O.height !== 0),
3525
- X(([O, H, { items: Q }, L]) => {
3526
- const { bottom: ie, top: V } = ao(O, L, H, Q);
3523
+ Fe(k, I, v, B),
3524
+ ae(([O, N, { items: Q }]) => Q.length > 0 && N.height !== 0 && O.height !== 0),
3525
+ X(([O, N, { items: Q }, L]) => {
3526
+ const { bottom: ie, top: V } = ao(O, L, N, Q);
3527
3527
  return [V, ie];
3528
3528
  }),
3529
3529
  Me(Qt)
@@ -3535,34 +3535,34 @@ const kl = /* @__PURE__ */ we(
3535
3535
  P(
3536
3536
  l,
3537
3537
  ve(ye),
3538
- X(([O, H]) => H || O !== 0)
3538
+ X(([O, N]) => N || O !== 0)
3539
3539
  ),
3540
3540
  ye
3541
3541
  );
3542
3542
  const ze = tt(
3543
3543
  P(
3544
- Fe(S, E),
3544
+ Fe(v, E),
3545
3545
  ae(([{ items: O }]) => O.length > 0),
3546
3546
  ve(ye),
3547
- ae(([[O, H], Q]) => {
3548
- const L = O.items[O.items.length - 1].index === H - 1;
3549
- return (Q || O.bottom > 0 && O.itemHeight > 0 && O.offsetBottom === 0 && O.items.length === H) && L;
3547
+ ae(([[O, N], Q]) => {
3548
+ const L = O.items[O.items.length - 1].index === N - 1;
3549
+ return (Q || O.bottom > 0 && O.itemHeight > 0 && O.offsetBottom === 0 && O.items.length === N) && L;
3550
3550
  }),
3551
3551
  X(([[, O]]) => O - 1),
3552
3552
  Me()
3553
3553
  )
3554
3554
  ), W = tt(
3555
3555
  P(
3556
- le(S),
3556
+ le(v),
3557
3557
  ae(({ items: O }) => O.length > 0 && O[0].index === 0),
3558
3558
  dt(0),
3559
3559
  Me()
3560
3560
  )
3561
3561
  ), D = tt(
3562
3562
  P(
3563
- le(S),
3564
- ve(N),
3565
- ae(([{ items: O }, H]) => O.length > 0 && !H),
3563
+ le(v),
3564
+ ve(H),
3565
+ ae(([{ items: O }, N]) => O.length > 0 && !N),
3566
3566
  X(([{ items: O }]) => ({
3567
3567
  endIndex: O[O.length - 1].index,
3568
3568
  startIndex: O[0].index
@@ -3573,21 +3573,21 @@ const kl = /* @__PURE__ */ we(
3573
3573
  );
3574
3574
  re(D, p.scrollSeekRangeChanged), re(
3575
3575
  P(
3576
- k,
3577
- ve(R, I, E, B),
3578
- X(([O, H, Q, L, ie]) => {
3576
+ _,
3577
+ ve(k, I, E, B),
3578
+ X(([O, N, Q, L, ie]) => {
3579
3579
  const V = fi(O), { align: J, behavior: ne, offset: ee } = V;
3580
3580
  let ue = V.index;
3581
3581
  ue === "LAST" && (ue = L - 1), ue = Ut(0, ue, qn(L - 1, ue));
3582
- let se = mr(H, ie, Q, ue);
3583
- return J === "end" ? se = so(se - H.height + Q.height) : J === "center" && (se = so(se - H.height / 2 + Q.height / 2)), ee && (se += ee), { behavior: ne, top: se };
3582
+ let se = mr(N, ie, Q, ue);
3583
+ return J === "end" ? se = so(se - N.height + Q.height) : J === "center" && (se = so(se - N.height / 2 + Q.height / 2)), ee && (se += ee), { behavior: ne, top: se };
3584
3584
  })
3585
3585
  ),
3586
3586
  a
3587
3587
  );
3588
3588
  const U = Ue(
3589
3589
  P(
3590
- S,
3590
+ v,
3591
3591
  X((O) => O.offsetBottom + O.bottom)
3592
3592
  ),
3593
3593
  0
@@ -3597,7 +3597,7 @@ const kl = /* @__PURE__ */ we(
3597
3597
  C,
3598
3598
  X((O) => ({ height: O.visibleHeight, width: O.visibleWidth }))
3599
3599
  ),
3600
- R
3600
+ k
3601
3601
  ), {
3602
3602
  customScrollParent: c,
3603
3603
  // input
@@ -3610,23 +3610,23 @@ const kl = /* @__PURE__ */ we(
3610
3610
  initialItemCount: m,
3611
3611
  itemDimensions: I,
3612
3612
  overscan: n,
3613
- restoreStateFrom: _,
3613
+ restoreStateFrom: R,
3614
3614
  scrollBy: s,
3615
3615
  scrollContainerState: u,
3616
3616
  scrollHeight: z,
3617
3617
  scrollTo: a,
3618
- scrollToIndex: k,
3618
+ scrollToIndex: _,
3619
3619
  scrollTop: l,
3620
3620
  smoothScrollTargetReached: d,
3621
3621
  totalCount: E,
3622
3622
  useWindowScroll: g,
3623
- viewportDimensions: R,
3623
+ viewportDimensions: k,
3624
3624
  windowScrollContainerState: f,
3625
3625
  windowScrollTo: x,
3626
3626
  windowViewportRect: C,
3627
3627
  ...p,
3628
3628
  // output
3629
- gridState: S,
3629
+ gridState: v,
3630
3630
  horizontalDirection: de,
3631
3631
  initialTopMostItemIndex: Z,
3632
3632
  totalListHeight: U,
@@ -3636,7 +3636,7 @@ const kl = /* @__PURE__ */ we(
3636
3636
  rangeChanged: D,
3637
3637
  startReached: W,
3638
3638
  stateChanged: G,
3639
- stateRestoreInProgress: N,
3639
+ stateRestoreInProgress: H,
3640
3640
  ...T
3641
3641
  };
3642
3642
  },
@@ -3687,7 +3687,7 @@ const Rl = /* @__PURE__ */ we(() => {
3687
3687
  ([e, t]) => ({ ...e, ...t }),
3688
3688
  Ee(kl, Rl)
3689
3689
  ), Ml = /* @__PURE__ */ $.memo(function() {
3690
- const e = Ae("gridState"), t = Ae("listClassName"), n = Ae("itemClassName"), r = Ae("itemContent"), o = Ae("computeItemKey"), i = Ae("isSeeking"), s = it("scrollHeight"), u = Ae("ItemComponent"), a = Ae("ListComponent"), l = Ae("ScrollSeekPlaceholder"), d = Ae("context"), b = it("itemDimensions"), h = it("gap"), p = Ae("log"), v = Ae("stateRestoreInProgress"), y = it("reportReadyState"), c = zt(
3690
+ const e = Ae("gridState"), t = Ae("listClassName"), n = Ae("itemClassName"), r = Ae("itemContent"), o = Ae("computeItemKey"), i = Ae("isSeeking"), s = it("scrollHeight"), u = Ae("ItemComponent"), a = Ae("ListComponent"), l = Ae("ScrollSeekPlaceholder"), d = Ae("context"), b = it("itemDimensions"), h = it("gap"), p = Ae("log"), S = Ae("stateRestoreInProgress"), y = it("reportReadyState"), c = zt(
3691
3691
  $.useMemo(
3692
3692
  () => (g) => {
3693
3693
  const f = g.parentElement.parentElement.scrollHeight;
@@ -3709,7 +3709,7 @@ const Rl = /* @__PURE__ */ we(() => {
3709
3709
  );
3710
3710
  return Ci(() => {
3711
3711
  e.itemHeight > 0 && e.itemWidth > 0 && y(!0);
3712
- }, [e]), v ? null : /* @__PURE__ */ w(
3712
+ }, [e]), S ? null : /* @__PURE__ */ w(
3713
3713
  a,
3714
3714
  {
3715
3715
  className: t,
@@ -3918,78 +3918,78 @@ const Yl = Object.freeze({
3918
3918
  pointerColor: void 0
3919
3919
  }), Ai = $.memo(
3920
3920
  function({ runs: t, ns: n, baseIndex: r, preGroups: o }) {
3921
- const i = ke((k) => k.setClipIndex), s = ke((k) => k.seek), u = j((k) => k.setCurrentGlobalRunIndex), a = xn(), l = j((k) => k.rangeStartGI), d = j((k) => k.rangeEndGI), b = j((k) => k.setRange), h = l != null && d != null, p = te(
3922
- (k) => {
3921
+ const i = ke((_) => _.setClipIndex), s = ke((_) => _.seek), u = j((_) => _.setCurrentGlobalRunIndex), a = xn(), l = j((_) => _.rangeStartGI), d = j((_) => _.rangeEndGI), b = j((_) => _.setRange), h = l != null && d != null, p = te(
3922
+ (_) => {
3923
3923
  var Z;
3924
- const z = (Z = k.target) == null ? void 0 : Z.closest("[data-g]");
3924
+ const z = (Z = _.target) == null ? void 0 : Z.closest("[data-g]");
3925
3925
  if (!z) return;
3926
3926
  const A = Number(z.dataset.g), M = A - r;
3927
3927
  if (M < 0 || M >= t.length) return;
3928
3928
  const B = t[M], G = B.text ?? "";
3929
3929
  if (!G.trim() || !/[가-힣a-zA-Z0-9]/.test(G)) return;
3930
3930
  u(A, "program");
3931
- const _ = B.audioChunkIndex, N = B.audioTimeMs;
3932
- _ != null && N != null && (i(_), s(N));
3931
+ const R = B.audioChunkIndex, H = B.audioTimeMs;
3932
+ R != null && H != null && (i(R), s(H));
3933
3933
  },
3934
3934
  [t, r, s, i, u]
3935
- ), v = oe(null), y = oe(!1), c = oe({ x: 0, y: 0 }), g = te(
3936
- (k) => {
3935
+ ), S = oe(null), y = oe(!1), c = oe({ x: 0, y: 0 }), g = te(
3936
+ (_) => {
3937
3937
  var B;
3938
- const z = (B = k.target) == null ? void 0 : B.closest("[data-g]");
3938
+ const z = (B = _.target) == null ? void 0 : B.closest("[data-g]");
3939
3939
  if (!z) return;
3940
3940
  const A = Number(z.dataset.g), M = A - r;
3941
- M < 0 || M >= t.length || (y.current = !1, c.current = { x: k.clientX, y: k.clientY }, v.current && (window.clearTimeout(v.current), v.current = null), v.current = window.setTimeout(() => {
3942
- a.getState().status !== "playing" && (b(A, A), y.current = !0, v.current = null);
3941
+ M < 0 || M >= t.length || (y.current = !1, c.current = { x: _.clientX, y: _.clientY }, S.current && (window.clearTimeout(S.current), S.current = null), S.current = window.setTimeout(() => {
3942
+ a.getState().status !== "playing" && (b(A, A), y.current = !0, S.current = null);
3943
3943
  }, 800));
3944
3944
  },
3945
3945
  [t, r, b, a]
3946
3946
  ), f = te(() => {
3947
- v.current && (window.clearTimeout(v.current), v.current = null);
3947
+ S.current && (window.clearTimeout(S.current), S.current = null);
3948
3948
  }, []), x = te(
3949
- (k) => {
3950
- if (!v.current) return;
3951
- const z = k.clientX - c.current.x, A = k.clientY - c.current.y;
3949
+ (_) => {
3950
+ if (!S.current) return;
3951
+ const z = _.clientX - c.current.x, A = _.clientY - c.current.y;
3952
3952
  (Math.abs(z) > 5 || Math.abs(A) > 5) && f();
3953
3953
  },
3954
3954
  [f]
3955
3955
  ), C = te(() => {
3956
3956
  f();
3957
- }, [f]), T = f, E = f, m = j((k) => k.clearRange), S = te(
3958
- (k) => {
3957
+ }, [f]), T = f, E = f, m = j((_) => _.clearRange), v = te(
3958
+ (_) => {
3959
3959
  var M;
3960
3960
  if (y.current) {
3961
3961
  y.current = !1;
3962
3962
  return;
3963
3963
  }
3964
3964
  if (Oi()) return;
3965
- const z = (M = k.target) == null ? void 0 : M.closest("[data-g]");
3965
+ const z = (M = _.target) == null ? void 0 : M.closest("[data-g]");
3966
3966
  if (!z) return;
3967
3967
  const A = Number(z.dataset.g);
3968
- isNaN(A) || h && l != null && d != null && (m(), k.stopPropagation());
3968
+ isNaN(A) || h && l != null && d != null && (m(), _.stopPropagation());
3969
3969
  },
3970
3970
  [h, l, d, m]
3971
- ), R = o, I = r + t.length - 1;
3971
+ ), k = o, I = r + t.length - 1;
3972
3972
  return /* @__PURE__ */ w(
3973
3973
  "span",
3974
3974
  {
3975
- onClick: S,
3975
+ onClick: v,
3976
3976
  onDoubleClick: p,
3977
3977
  onPointerDown: g,
3978
3978
  onPointerMove: x,
3979
3979
  onPointerUp: C,
3980
3980
  onPointerCancel: T,
3981
3981
  onPointerLeave: E,
3982
- children: R.map((k, z) => /* @__PURE__ */ w(
3982
+ children: k.map((_, z) => /* @__PURE__ */ w(
3983
3983
  Jl,
3984
3984
  {
3985
3985
  ns: n,
3986
- group: k,
3986
+ group: _,
3987
3987
  runs: t,
3988
3988
  paraLastG: I,
3989
3989
  rangeStartGI: l,
3990
3990
  rangeEndGI: d
3991
3991
  },
3992
- `${n}/grp:${z}-${k.startG}`
3992
+ `${n}/grp:${z}-${_.startG}`
3993
3993
  ))
3994
3994
  }
3995
3995
  );
@@ -4028,7 +4028,7 @@ const Yl = Object.freeze({
4028
4028
  pointerColor: c.pointerColor
4029
4029
  } : Yl,
4030
4030
  [a]
4031
- ), d = K(tn(l)), b = n.r0 ?? 0, h = n.len ?? Math.max(0, n.endG - n.startG + 1), p = a && d.showPointer && d.pointerStyle !== "underline", v = a && d.showPointer && d.pointerStyle === "underline", y = p || v ? {
4031
+ ), d = K(tn(l)), b = n.r0 ?? 0, h = n.len ?? Math.max(0, n.endG - n.startG + 1), p = a && d.showPointer && d.pointerStyle !== "underline", S = a && d.showPointer && d.pointerStyle === "underline", y = p || S ? {
4032
4032
  // 배경색(하이라이트)
4033
4033
  "--hl-color": d.pointerColor,
4034
4034
  // 밑줄 색/두께/오프셋
@@ -4039,7 +4039,7 @@ const Yl = Object.freeze({
4039
4039
  return /* @__PURE__ */ w(wt, { children: Array.from({ length: h }).map((c, g) => {
4040
4040
  const x = r[b + g], C = n.startG + g, T = `${t}/run:${C}`, E = !!x.split && C !== o;
4041
4041
  let m = `${ut.runWrap}`;
4042
- return p && (h === 1 ? m += ` ${ut.highlight}` : g === 0 ? m += ` ${ut.highlightleft}` : g + 1 === h ? m += ` ${ut.highlightright}` : m += ` ${ut.highlightcenter}`), v && (h === 1 ? m += ` ${ut.underline}` : g === 0 ? m += ` ${ut.underlineleft}` : g + 1 === h ? m += ` ${ut.underlineright}` : m += ` ${ut.underlinecenter}`), /* @__PURE__ */ Y($.Fragment, { children: [
4042
+ return p && (h === 1 ? m += ` ${ut.highlight}` : g === 0 ? m += ` ${ut.highlightleft}` : g + 1 === h ? m += ` ${ut.highlightright}` : m += ` ${ut.highlightcenter}`), S && (h === 1 ? m += ` ${ut.underline}` : g === 0 ? m += ` ${ut.underlineleft}` : g + 1 === h ? m += ` ${ut.underlineright}` : m += ` ${ut.underlinecenter}`), /* @__PURE__ */ Y($.Fragment, { children: [
4043
4043
  /* @__PURE__ */ w("span", { className: m, style: y, children: /* @__PURE__ */ w(
4044
4044
  ea,
4045
4045
  {
@@ -4268,18 +4268,18 @@ function fa(e, t = 12, n = 1.5, r = 0.5) {
4268
4268
  let s = -1, u = 1 / 0, a = 1 / 0, l = -1, d = 1 / 0, b = 1 / 0;
4269
4269
  const h = e.querySelectorAll("[data-g]");
4270
4270
  for (let p = 0; p < h.length; p++) {
4271
- const v = h[p];
4272
- if (!v || !v.isConnected) continue;
4273
- const y = da(v);
4271
+ const S = h[p];
4272
+ if (!S || !S.isConnected) continue;
4273
+ const y = da(S);
4274
4274
  if (!y || !br(y)) continue;
4275
- const c = v.getBoundingClientRect();
4275
+ const c = S.getBoundingClientRect();
4276
4276
  if (c.height <= r || c.width <= r || c.bottom <= o.top || c.top >= o.bottom) continue;
4277
4277
  if (c.top < i) {
4278
4278
  const x = Math.abs(c.top - i);
4279
- (x < d || x === d && (c.top < b || l !== -1 && Number(v.dataset.g) < l)) && (d = x, l = Number(v.dataset.g), b = c.top);
4279
+ (x < d || x === d && (c.top < b || l !== -1 && Number(S.dataset.g) < l)) && (d = x, l = Number(S.dataset.g), b = c.top);
4280
4280
  continue;
4281
4281
  }
4282
- const g = Number(v.dataset.g);
4282
+ const g = Number(S.dataset.g);
4283
4283
  if (Number.isNaN(g)) continue;
4284
4284
  c.top < a - n ? (a = c.top, u = c.top, s = g) : c.top <= a + n && (c.top < u || c.top === u && (s === -1 || g < s)) && (u = c.top, s = g);
4285
4285
  const f = Math.abs(c.top - i);
@@ -4651,8 +4651,8 @@ function Ra(e) {
4651
4651
  let E = 0;
4652
4652
  const m = t.querySelector(`[data-g="${f}"]`);
4653
4653
  if (m) {
4654
- const S = t.getBoundingClientRect(), R = m.getBoundingClientRect(), I = S.height > 0 ? S.height / t.clientHeight : 1, k = (R.top - S.top) / I / t.clientHeight;
4655
- E = Math.max(0, Math.min(k, 1));
4654
+ const v = t.getBoundingClientRect(), k = m.getBoundingClientRect(), I = v.height > 0 ? v.height / t.clientHeight : 1, _ = (k.top - v.top) / I / t.clientHeight;
4655
+ E = Math.max(0, Math.min(_, 1));
4656
4656
  }
4657
4657
  o.getState().emit({
4658
4658
  type: "scroll",
@@ -4669,16 +4669,24 @@ function Ra(e) {
4669
4669
  }, l = () => new Promise((f) => requestAnimationFrame(() => f())), d = async (f) => {
4670
4670
  if (wo(t, f, 0.1, 0.7))
4671
4671
  return u(f), !0;
4672
+ if (t.scrollTop >= t.scrollHeight - t.clientHeight - 1) {
4673
+ const v = t.querySelector(`[data-g="${f}"]`);
4674
+ if (v) {
4675
+ const k = t.getBoundingClientRect(), I = v.getBoundingClientRect();
4676
+ if (I.bottom > k.top && I.top < k.bottom)
4677
+ return u(f), !0;
4678
+ }
4679
+ }
4672
4680
  i.current = !0;
4673
- const x = t.querySelector(`[data-g="${f}"]`), C = t.getBoundingClientRect();
4674
- let T = t.scrollTop <= 1 ? 0 : 0.1;
4675
- if (x) {
4676
- const m = x.getBoundingClientRect();
4677
- T = ((m.top + m.height / 2 - C.top) / C.height > 0.5, 0.15);
4681
+ const C = t.querySelector(`[data-g="${f}"]`), T = t.getBoundingClientRect();
4682
+ let E = t.scrollTop <= 1 ? 0 : 0.1;
4683
+ if (C) {
4684
+ const v = C.getBoundingClientRect();
4685
+ E = ((v.top + v.height / 2 - T.top) / T.height > 0.5, 0.15);
4678
4686
  }
4679
- return !!x ? (await bo(t, f, {
4687
+ return !!C ? (await bo(t, f, {
4680
4688
  behavior: "smooth",
4681
- topPaddingRatio: T
4689
+ topPaddingRatio: E
4682
4690
  }), await l()) : (await a(f, "auto"), await bo(t, f, { behavior: "auto", topPaddingRatio: 0.15 })), i.current = !1, u(f), wo(t, f, 0.1, 0.7);
4683
4691
  };
4684
4692
  return {
@@ -4700,26 +4708,29 @@ function Ra(e) {
4700
4708
  var E, m;
4701
4709
  const C = t.querySelector(`[data-g="${f}"]`);
4702
4710
  if (C) {
4703
- const S = C.getBoundingClientRect(), R = t.getBoundingClientRect(), I = R.height > 0 ? R.height / t.clientHeight : 1, k = (S.top - R.top) / I, z = x * t.clientHeight;
4704
- if (Math.abs(k - z) <= 3) return;
4711
+ const v = C.getBoundingClientRect(), k = t.getBoundingClientRect(), I = k.height > 0 ? k.height / t.clientHeight : 1, _ = (v.top - k.top) / I, z = x * t.clientHeight;
4712
+ if (Math.abs(_ - z) <= 3) return;
4705
4713
  }
4706
4714
  const T = ++s.current;
4707
4715
  i.current = !0;
4708
4716
  try {
4709
- const S = () => new Promise((k) => requestAnimationFrame(() => k())), R = () => {
4710
- const k = t.querySelector(`[data-g="${f}"]`);
4711
- if (!k) return null;
4712
- const z = k.getBoundingClientRect(), A = t.getBoundingClientRect(), M = A.height > 0 ? A.height / t.clientHeight : 1, B = (z.top - A.top) / M, G = x * t.clientHeight;
4713
- return { delta: B - G, cur: B, tgt: G };
4717
+ const v = () => new Promise((A) => requestAnimationFrame(() => A())), k = () => {
4718
+ const A = t.querySelector(`[data-g="${f}"]`);
4719
+ if (!A) return null;
4720
+ const M = A.getBoundingClientRect(), B = t.getBoundingClientRect(), G = B.height > 0 ? B.height / t.clientHeight : 1, R = (M.top - B.top) / G, H = x * t.clientHeight;
4721
+ return { delta: R - H, cur: R, tgt: H };
4714
4722
  };
4715
- if (T !== s.current || (await a(f, "auto"), T !== s.current) || (await S(), await S(), await S(), T !== s.current)) return;
4716
- const I = R();
4717
- if (I && Math.abs(I.delta) > 1) {
4718
- if ((E = n.current) == null || E.scrollBy({ top: I.delta }), await S(), T !== s.current) return;
4719
- for (let k = 0; k < 3; k++) {
4720
- const z = R();
4721
- if (!z || Math.abs(z.delta) <= 2) break;
4722
- if ((m = n.current) == null || m.scrollBy({ top: z.delta }), await S(), T !== s.current) return;
4723
+ if (T !== s.current || (await a(f, "auto"), T !== s.current) || (await v(), await v(), await v(), T !== s.current)) return;
4724
+ const I = k(), _ = t.scrollTop >= t.scrollHeight - t.clientHeight - 1, z = t.scrollTop <= 1;
4725
+ if (I && Math.abs(I.delta) > 1 && !(_ && I.delta > 0) && !(z && I.delta < 0)) {
4726
+ const A = t.scrollTop;
4727
+ if ((E = n.current) == null || E.scrollBy({ top: I.delta }), await v(), T !== s.current) return;
4728
+ for (let M = 0; M < 3; M++) {
4729
+ const B = k();
4730
+ if (!B || Math.abs(B.delta) <= 2) break;
4731
+ const G = t.scrollTop;
4732
+ if ((m = n.current) == null || m.scrollBy({ top: B.delta }), await v(), T !== s.current) return;
4733
+ if (Math.abs(t.scrollTop - G) < 1) break;
4723
4734
  }
4724
4735
  }
4725
4736
  } finally {
@@ -4737,39 +4748,39 @@ const _a = ({
4737
4748
  virtRef: t,
4738
4749
  prefix: n
4739
4750
  }) => {
4740
- const r = j((_) => _.setCurrentGlobalRunIndex), o = j((_) => _.registerSectionScrollApi), i = ke((_) => _.scrollLock), s = ke((_) => _.syncToGI), u = Ct(), a = bt(), l = Qo((_) => _.isPlaybackMode), d = oe(!1), b = oe(null), h = oe(null), p = oe(0), v = oe(null), y = oe(-1), c = te(() => {
4751
+ const r = j((R) => R.setCurrentGlobalRunIndex), o = j((R) => R.registerSectionScrollApi), i = ke((R) => R.scrollLock), s = ke((R) => R.syncToGI), u = Ct(), a = bt(), l = Qo((R) => R.isPlaybackMode), d = oe(!1), b = oe(null), h = oe(null), p = oe(0), S = oe(null), y = oe(-1), c = te(() => {
4741
4752
  if (l || i) return;
4742
4753
  b.current = null;
4743
- const _ = h.current;
4744
- if (!_) return;
4745
- const N = fa(_, 5);
4746
- N !== -1 && N !== y.current && (y.current = N, s(N));
4754
+ const R = h.current;
4755
+ if (!R) return;
4756
+ const H = fa(R, 5);
4757
+ H !== -1 && H !== y.current && (y.current = H, s(H));
4747
4758
  }, [l, i, s]), g = te(
4748
- (_) => {
4749
- h.current = _, b.current == null && (b.current = requestAnimationFrame(c));
4759
+ (R) => {
4760
+ h.current = R, b.current == null && (b.current = requestAnimationFrame(c));
4750
4761
  },
4751
4762
  [c]
4752
4763
  ), f = te(
4753
- (_) => {
4764
+ (R) => {
4754
4765
  var pe;
4755
- h.current = _, (pe = v.current) == null || pe.abort();
4756
- const N = new AbortController();
4757
- v.current = N, new Promise((ce) => {
4758
- "onscrollend" in _ ? _.addEventListener("scrollend", () => ce(), { once: !0 }) : setTimeout(ce, 150);
4766
+ h.current = R, (pe = S.current) == null || pe.abort();
4767
+ const H = new AbortController();
4768
+ S.current = H, new Promise((ce) => {
4769
+ "onscrollend" in R ? R.addEventListener("scrollend", () => ce(), { once: !0 }) : setTimeout(ce, 150);
4759
4770
  }).then(() => {
4760
- if (N.signal.aborted) return;
4761
- v.current = null, c();
4771
+ if (H.signal.aborted) return;
4772
+ S.current = null, c();
4762
4773
  const ce = y.current;
4763
4774
  ce !== -1 && r(ce, "scroll"), requestAnimationFrame(() => {
4764
4775
  requestAnimationFrame(() => {
4765
- if (N.signal.aborted) return;
4776
+ if (H.signal.aborted) return;
4766
4777
  const de = y.current;
4767
4778
  if (de === -1) return;
4768
- const ye = _.scrollTop, ze = _.scrollHeight - _.clientHeight, W = ze > 0 ? ye / ze : 0;
4779
+ const ye = R.scrollTop, ze = R.scrollHeight - R.clientHeight, W = ze > 0 ? ye / ze : 0;
4769
4780
  let D = 0;
4770
- const U = _.querySelector(`[data-g="${de}"]`);
4781
+ const U = R.querySelector(`[data-g="${de}"]`);
4771
4782
  if (U) {
4772
- const O = _.getBoundingClientRect(), H = U.getBoundingClientRect(), Q = O.height > 0 ? O.height / _.clientHeight : 1, L = (H.top - O.top) / Q / _.clientHeight;
4783
+ const O = R.getBoundingClientRect(), N = U.getBoundingClientRect(), Q = O.height > 0 ? O.height / R.clientHeight : 1, L = (N.top - O.top) / Q / R.clientHeight;
4773
4784
  D = Math.max(0, Math.min(L, 1));
4774
4785
  }
4775
4786
  u.getState().emit({
@@ -4787,71 +4798,71 @@ const _a = ({
4787
4798
  },
4788
4799
  [c, u, r]
4789
4800
  ), x = oe(!1), C = te(
4790
- (_) => {
4791
- l || i || d.current && (x.current || (g(_), f(_)));
4801
+ (R) => {
4802
+ l || i || d.current && (x.current || (g(R), f(R)));
4792
4803
  },
4793
4804
  [l, i, g, f]
4794
- ), T = oe(void 0), E = oe(void 0), m = oe(void 0), S = oe(void 0);
4805
+ ), T = oe(void 0), E = oe(void 0), m = oe(void 0), v = oe(void 0);
4795
4806
  he(() => {
4796
- const _ = e.current;
4797
- if (_)
4807
+ const R = e.current;
4808
+ if (R)
4798
4809
  return T.current = () => {
4799
4810
  d.current = !0;
4800
4811
  }, E.current = () => {
4801
4812
  d.current = !0;
4802
4813
  }, m.current = () => {
4803
4814
  d.current = !0;
4804
- }, S.current = () => C(_), _.addEventListener("wheel", T.current, { passive: !0 }), _.addEventListener("touchmove", E.current, { passive: !0 }), window.addEventListener("keydown", m.current, { passive: !0 }), _.addEventListener("scroll", S.current, { passive: !0 }), () => {
4805
- var N;
4806
- _.removeEventListener("wheel", T.current), _.removeEventListener("touchmove", E.current), window.removeEventListener("keydown", m.current), _.removeEventListener("scroll", S.current), b.current != null && cancelAnimationFrame(b.current), (N = v.current) == null || N.abort();
4815
+ }, v.current = () => C(R), R.addEventListener("wheel", T.current, { passive: !0 }), R.addEventListener("touchmove", E.current, { passive: !0 }), window.addEventListener("keydown", m.current, { passive: !0 }), R.addEventListener("scroll", v.current, { passive: !0 }), () => {
4816
+ var H;
4817
+ R.removeEventListener("wheel", T.current), R.removeEventListener("touchmove", E.current), window.removeEventListener("keydown", m.current), R.removeEventListener("scroll", v.current), b.current != null && cancelAnimationFrame(b.current), (H = S.current) == null || H.abort();
4807
4818
  };
4808
4819
  }, [C, e]), he(() => {
4809
- const _ = e.current;
4810
- if (!_ || !i) return;
4811
- const N = (de) => {
4820
+ const R = e.current;
4821
+ if (!R || !i) return;
4822
+ const H = (de) => {
4812
4823
  de.preventDefault(), de.stopPropagation(), d.current = !1;
4813
4824
  }, Z = (de) => {
4814
4825
  de.preventDefault(), de.stopPropagation(), d.current = !1;
4815
4826
  }, pe = (de) => {
4816
4827
  ["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "].includes(de.key) && (de.preventDefault(), de.stopPropagation(), d.current = !1);
4817
4828
  }, ce = {
4818
- overscrollBehavior: _.style.overscrollBehavior,
4819
- touchAction: _.style.touchAction
4829
+ overscrollBehavior: R.style.overscrollBehavior,
4830
+ touchAction: R.style.touchAction
4820
4831
  };
4821
- return _.style.overscrollBehavior = "contain", _.style.touchAction = "none", _.addEventListener("wheel", N, { passive: !1 }), _.addEventListener("touchmove", Z, { passive: !1 }), window.addEventListener("keydown", pe, { passive: !1 }), () => {
4822
- _.removeEventListener("wheel", N), _.removeEventListener("touchmove", Z), window.removeEventListener("keydown", pe), _.style.overscrollBehavior = ce.overscrollBehavior, _.style.touchAction = ce.touchAction;
4832
+ return R.style.overscrollBehavior = "contain", R.style.touchAction = "none", R.addEventListener("wheel", H, { passive: !1 }), R.addEventListener("touchmove", Z, { passive: !1 }), window.addEventListener("keydown", pe, { passive: !1 }), () => {
4833
+ R.removeEventListener("wheel", H), R.removeEventListener("touchmove", Z), window.removeEventListener("keydown", pe), R.style.overscrollBehavior = ce.overscrollBehavior, R.style.touchAction = ce.touchAction;
4823
4834
  };
4824
4835
  }, [i, e]);
4825
- const R = oe({
4836
+ const k = oe({
4826
4837
  first: -1,
4827
4838
  last: -1
4828
- }), I = oe(!1), k = te(() => {
4829
- const _ = e.current;
4830
- if (!_) return;
4831
- const N = Pi(_), Z = (N == null ? void 0 : N.first) ?? -1, pe = (N == null ? void 0 : N.last) ?? -1;
4832
- R.current = { first: Z, last: pe };
4839
+ }), I = oe(!1), _ = te(() => {
4840
+ const R = e.current;
4841
+ if (!R) return;
4842
+ const H = Pi(R), Z = (H == null ? void 0 : H.first) ?? -1, pe = (H == null ? void 0 : H.last) ?? -1;
4843
+ k.current = { first: Z, last: pe };
4833
4844
  }, [e]), z = oe(!1), A = te(() => {
4834
- const _ = e.current;
4835
- if (!_ || z.current) return;
4845
+ const R = e.current;
4846
+ if (!R || z.current) return;
4836
4847
  z.current = !0;
4837
- const N = Math.min(
4838
- _.scrollTop + Math.floor(_.clientHeight * 0.6),
4839
- _.scrollHeight - _.clientHeight
4848
+ const H = Math.min(
4849
+ R.scrollTop + Math.floor(R.clientHeight * 0.6),
4850
+ R.scrollHeight - R.clientHeight
4840
4851
  );
4841
4852
  requestAnimationFrame(() => {
4842
- _.scrollTo({ top: N, behavior: "instant" });
4853
+ R.scrollTo({ top: H, behavior: "instant" });
4843
4854
  });
4844
4855
  }, [e]);
4845
4856
  he(() => {
4846
- !I.current && i && (z.current = !1, k()), I.current = i;
4847
- }, [i, k]);
4857
+ !I.current && i && (z.current = !1, _()), I.current = i;
4858
+ }, [i, _]);
4848
4859
  const M = oe(0), B = oe(0);
4849
4860
  he(() => {
4850
4861
  if (!i || l) return;
4851
- const _ = (Z) => {
4862
+ const R = (Z) => {
4852
4863
  const pe = e.current;
4853
4864
  if (!pe) return;
4854
- const { first: ce, last: de } = R.current;
4865
+ const { first: ce, last: de } = k.current;
4855
4866
  if (ce === -1 || de === -1) {
4856
4867
  A();
4857
4868
  return;
@@ -4862,7 +4873,7 @@ const _a = ({
4862
4873
  if (W.height > 0) {
4863
4874
  const U = (D.top - W.top) / W.height, O = (D.bottom - W.top) / W.height;
4864
4875
  if (U >= 0.02 && O <= 0.95) {
4865
- k();
4876
+ _();
4866
4877
  return;
4867
4878
  }
4868
4879
  }
@@ -4872,17 +4883,17 @@ const _a = ({
4872
4883
  if (ze !== M.current) return;
4873
4884
  const W = a.getState().progress.getSectionScrollApi();
4874
4885
  W ? W.ensureVisibleGI(Z).then((D) => {
4875
- ze === M.current && (D ? k() : A());
4886
+ ze === M.current && (D ? _() : A());
4876
4887
  }) : A();
4877
4888
  }, 80);
4878
4889
  };
4879
- _(a.getState().progress.currentGlobalRunIndex);
4880
- const N = a.subscribe((Z, pe) => {
4890
+ R(a.getState().progress.currentGlobalRunIndex);
4891
+ const H = a.subscribe((Z, pe) => {
4881
4892
  const ce = Z.progress.currentGlobalRunIndex;
4882
- ce !== pe.progress.currentGlobalRunIndex && _(ce);
4893
+ ce !== pe.progress.currentGlobalRunIndex && R(ce);
4883
4894
  });
4884
4895
  return () => {
4885
- N(), M.current += 1;
4896
+ H(), M.current += 1;
4886
4897
  const Z = B.current;
4887
4898
  window.clearTimeout(Z);
4888
4899
  };
@@ -4890,15 +4901,15 @@ const _a = ({
4890
4901
  i,
4891
4902
  l,
4892
4903
  A,
4893
- k,
4904
+ _,
4894
4905
  e,
4895
4906
  a
4896
4907
  ]);
4897
4908
  const G = te(() => {
4898
- const _ = e.current;
4899
- if (_)
4909
+ const R = e.current;
4910
+ if (R)
4900
4911
  return Ra({
4901
- sc: _,
4912
+ sc: R,
4902
4913
  virtRef: t,
4903
4914
  prefix: n,
4904
4915
  recorderStoreApi: u,
@@ -4914,24 +4925,24 @@ function Ma({
4914
4925
  nsPrefix: n
4915
4926
  }) {
4916
4927
  const r = Se(() => {
4917
- const I = [], k = Or();
4928
+ const I = [], _ = Or();
4918
4929
  return t.forEach((z, A) => {
4919
- z.type === "paragraph" && (I[A] = Ar(z, k));
4930
+ z.type === "paragraph" && (I[A] = Ar(z, _));
4920
4931
  }), I;
4921
4932
  }, [t]), o = j((I) => {
4922
- var k;
4923
- return ((k = I.layout) == null ? void 0 : k.prefix) ?? [];
4933
+ var _;
4934
+ return ((_ = I.layout) == null ? void 0 : _.prefix) ?? [];
4924
4935
  }), i = j((I) => {
4925
- var k;
4926
- return ((k = I.derivedNav) == null ? void 0 : k.splitGroupsPerBlock) ?? [];
4936
+ var _;
4937
+ return ((_ = I.derivedNav) == null ? void 0 : _.splitGroupsPerBlock) ?? [];
4927
4938
  }), s = K((I) => I.marginX), u = K((I) => I.viewportHeight), a = oe({
4928
4939
  start: 0,
4929
4940
  end: 0
4930
4941
  }), l = te(
4931
4942
  (I) => {
4932
- const k = t[I], z = `${n}blk-${k.id}`;
4933
- if (k.type === "image") {
4934
- const { src: B, alt: G, width: _, height: N } = k, Z = _ && N ? `${_} / ${N}` : "4 / 3", pe = I >= a.current.start && I <= a.current.end, ce = u > 80 ? Math.floor((u - 80) * 0.6) : void 0;
4943
+ const _ = t[I], z = `${n}blk-${_.id}`;
4944
+ if (_.type === "image") {
4945
+ const { src: B, alt: G, width: R, height: H } = _, Z = R && H ? `${R} / ${H}` : "4 / 3", pe = I >= a.current.start && I <= a.current.end, ce = u > 80 ? Math.floor((u - 80) * 0.6) : void 0;
4935
4946
  return /* @__PURE__ */ Y("div", { style: { margin: "12px 0", textAlign: "center", width: "100%" }, children: [
4936
4947
  /* @__PURE__ */ w(
4937
4948
  "div",
@@ -4975,7 +4986,7 @@ function Ma({
4975
4986
  children: /* @__PURE__ */ w(
4976
4987
  na,
4977
4988
  {
4978
- block: k,
4989
+ block: _,
4979
4990
  computedMarker: A,
4980
4991
  ns: z,
4981
4992
  baseIndex: o[I],
@@ -4991,8 +5002,8 @@ function Ma({
4991
5002
  d.current = I;
4992
5003
  }, []), h = Se(
4993
5004
  () => Ft((I) => {
4994
- const { style: k, children: z, ...A } = I;
4995
- return /* @__PURE__ */ w("div", { ...A, style: k, children: /* @__PURE__ */ w(
5005
+ const { style: _, children: z, ...A } = I;
5006
+ return /* @__PURE__ */ w("div", { ...A, style: _, children: /* @__PURE__ */ w(
4996
5007
  "div",
4997
5008
  {
4998
5009
  style: {
@@ -5009,7 +5020,7 @@ function Ma({
5009
5020
  ) });
5010
5021
  }),
5011
5022
  [s]
5012
- ), p = oe(null), v = Se(() => t.map((I) => I.id), [t]), y = Qo((I) => I.isPlaybackMode), [c, g] = ft(!1);
5023
+ ), p = oe(null), S = Se(() => t.map((I) => I.id), [t]), y = Qo((I) => I.isPlaybackMode), [c, g] = ft(!1);
5013
5024
  he(() => {
5014
5025
  g(y);
5015
5026
  }, [t, y]);
@@ -5019,8 +5030,8 @@ function Ma({
5019
5030
  const I = Math.max(80, Math.floor(u * 0.5));
5020
5031
  if (!c)
5021
5032
  return /* @__PURE__ */ w("div", { style: { height: I } });
5022
- const k = e.quizzes;
5023
- return k && k.length ? /* @__PURE__ */ Y("div", { style: { display: "block" }, children: [
5033
+ const _ = e.quizzes;
5034
+ return _ && _.length ? /* @__PURE__ */ Y("div", { style: { display: "block" }, children: [
5024
5035
  /* @__PURE__ */ w("div", { style: { display: "flex", justifyContent: "center", marginTop: 20 }, children: /* @__PURE__ */ w(Li, {}) }),
5025
5036
  /* @__PURE__ */ w("div", { style: { display: "flex", justifyContent: "center", marginTop: 20 }, children: /* @__PURE__ */ w(Tn, { isIcon: !1 }) }),
5026
5037
  /* @__PURE__ */ w("div", { style: { height: I, width: "100%" } })
@@ -5036,28 +5047,28 @@ function Ma({
5036
5047
  Scroller: ua
5037
5048
  }),
5038
5049
  [x, h]
5039
- ), T = te((I) => v[I], [v]), E = bt(), [m] = ft(() => E.getState().progress.currentGlobalRunIndex ?? 0), S = Se(() => {
5050
+ ), T = te((I) => S[I], [S]), E = bt(), [m] = ft(() => E.getState().progress.currentGlobalRunIndex ?? 0), v = Se(() => {
5040
5051
  if (!o.length) return 0;
5041
- const I = o[o.length - 1], k = Math.max(0, Math.min(m, I));
5042
- return Fi(o, k);
5043
- }, [o, m]), R = bt();
5052
+ const I = o[o.length - 1], _ = Math.max(0, Math.min(m, I));
5053
+ return Fi(o, _);
5054
+ }, [o, m]), k = bt();
5044
5055
  return he(() => {
5045
5056
  let I = !1;
5046
5057
  return (async () => {
5047
- let k = d.current;
5048
- if (!k) {
5058
+ let _ = d.current;
5059
+ if (!_) {
5049
5060
  for (let B = 0; B < 20; B++) {
5050
5061
  if (await new Promise((G) => setTimeout(G, 50)), I) return;
5051
- if (k = d.current, k) break;
5062
+ if (_ = d.current, _) break;
5052
5063
  }
5053
- if (!k) return;
5064
+ if (!_) return;
5054
5065
  }
5055
- const z = R.getState().progress.currentGlobalRunIndex, A = R.getState().progress.setSectionLoading, M = z != null && z >= 0 ? z : 0;
5056
- await Bi(k, M), !I && (await yt(), await yt(), await yt(), await yt(), !I && A(!1));
5066
+ const z = k.getState().progress.currentGlobalRunIndex, A = k.getState().progress.setSectionLoading, M = z != null && z >= 0 ? z : 0;
5067
+ await Bi(_, M), !I && (await yt(), await yt(), await yt(), await yt(), !I && A(!1));
5057
5068
  })(), () => {
5058
5069
  I = !0;
5059
5070
  };
5060
- }, [d, R]), /* @__PURE__ */ Y(wt, { children: [
5071
+ }, [d, k]), /* @__PURE__ */ Y(wt, { children: [
5061
5072
  /* @__PURE__ */ w(
5062
5073
  xl,
5063
5074
  {
@@ -5071,7 +5082,7 @@ function Ma({
5071
5082
  computeItemKey: T,
5072
5083
  totalCount: t.length,
5073
5084
  itemContent: l,
5074
- initialTopMostItemIndex: S,
5085
+ initialTopMostItemIndex: v,
5075
5086
  increaseViewportBy: { top: 100, bottom: 100 },
5076
5087
  endReached: f,
5077
5088
  components: C,
@@ -5096,13 +5107,13 @@ function Ea(e) {
5096
5107
  return !!(["a", "button", "input", "textarea", "select", "label"].includes(n) || t.isContentEditable);
5097
5108
  }
5098
5109
  function za() {
5099
- const e = j((v) => v.section), t = K((v) => v.theme), n = K((v) => v.fontFamily), r = K((v) => v.fontSizePx), o = K((v) => v.lineHeight), i = vn[t], { blocks: s, nsPrefix: u } = Se(() => ({
5110
+ const e = j((S) => S.section), t = K((S) => S.theme), n = K((S) => S.fontFamily), r = K((S) => S.fontSizePx), o = K((S) => S.lineHeight), i = vn[t], { blocks: s, nsPrefix: u } = Se(() => ({
5100
5111
  sectionId: e.section_id,
5101
5112
  blocks: e.ast.blocks,
5102
5113
  nsPrefix: `sec-${e.section_id ?? "0"}/`
5103
5114
  }), [e]), a = kn(), l = te(() => {
5104
- const { isSettingsOpen: v, setSettingsOpen: y, toggleOverlays: c } = a.getState();
5105
- v ? y(!1) : c();
5115
+ const { isSettingsOpen: S, setSettingsOpen: y, toggleOverlays: c } = a.getState();
5116
+ S ? y(!1) : c();
5106
5117
  }, [a]), { onClick: d, onDoubleClick: b } = cs({
5107
5118
  onSingle: l,
5108
5119
  onDouble: () => {
@@ -5168,133 +5179,133 @@ const Na = "_wrap_1hfub_4", Fa = "_visible_1hfub_25", Da = "_compact_1hfub_31",
5168
5179
  label: Ja,
5169
5180
  compactBtn: ec
5170
5181
  }, tc = Ft(function() {
5171
- const t = oe(null), n = $e(It), r = (n == null ? void 0 : n.getState().isPlaybackMode) ?? !1, o = ke((S) => S.status), i = ke((S) => S.currentTimeMs), s = ke((S) => S.currentClip), u = ke((S) => S.playbackKind), a = K((S) => S.muteAudio), l = K((S) => S.audioSpeed), d = ke((S) => S.getClipSrc), b = ke((S) => S._onTime), h = ke((S) => S._onEnded), p = ke((S) => S._onError), v = j((S) => S.setCurrentGlobalRunIndex), y = j((S) => S.getSectionScrollApi), c = j((S) => S.snapToReadable), g = j((S) => S.edgeReadable), f = oe(null), x = oe(null), C = oe(!1), T = oe(null);
5182
+ const t = oe(null), n = $e(It), r = (n == null ? void 0 : n.getState().isPlaybackMode) ?? !1, o = ke((v) => v.status), i = ke((v) => v.currentTimeMs), s = ke((v) => v.currentClip), u = ke((v) => v.playbackKind), a = K((v) => v.muteAudio), l = K((v) => v.audioSpeed), d = ke((v) => v.getClipSrc), b = ke((v) => v._onTime), h = ke((v) => v._onEnded), p = ke((v) => v._onError), S = j((v) => v.setCurrentGlobalRunIndex), y = j((v) => v.getSectionScrollApi), c = j((v) => v.snapToReadable), g = j((v) => v.edgeReadable), f = oe(null), x = oe(null), C = oe(!1), T = oe(null);
5172
5183
  he(() => {
5173
5184
  u === "real" && (C.current = !0);
5174
5185
  }, [u]);
5175
5186
  const E = Se(() => {
5176
- const S = d(s);
5177
- if (!S) return null;
5187
+ const v = d(s);
5188
+ if (!v) return null;
5178
5189
  try {
5179
- return new URL(S, window.location.href).href;
5190
+ return new URL(v, window.location.href).href;
5180
5191
  } catch {
5181
- return S;
5192
+ return v;
5182
5193
  }
5183
5194
  }, [s, d]);
5184
5195
  he(() => {
5185
5196
  C.current = !0;
5186
5197
  }, [E]), he(() => {
5187
- const S = t.current;
5188
- if (!S) return;
5189
- const R = () => {
5190
- if (S.paused || S.ended) return;
5191
- const z = S.currentTime * 1e3;
5198
+ const v = t.current;
5199
+ if (!v) return;
5200
+ const k = () => {
5201
+ if (v.paused || v.ended) return;
5202
+ const z = v.currentTime * 1e3;
5192
5203
  C.current && z === 0 || (z > 0 && (C.current = !1), b(z));
5193
5204
  }, I = () => {
5194
5205
  var A, M;
5195
5206
  h();
5196
5207
  const z = g(1);
5197
- typeof z == "number" && z >= 0 && (v(z, "audio"), (M = (A = y()) == null ? void 0 : A.ensureVisibleGI) == null || M.call(A, z));
5198
- }, k = (z) => {
5208
+ typeof z == "number" && z >= 0 && (S(z, "audio"), (M = (A = y()) == null ? void 0 : A.ensureVisibleGI) == null || M.call(A, z));
5209
+ }, _ = (z) => {
5199
5210
  const A = z.currentTarget;
5200
5211
  console.warn("Audio error", {
5201
5212
  networkState: A.networkState,
5202
5213
  readyState: A.readyState
5203
5214
  }), p();
5204
5215
  };
5205
- return S.addEventListener("timeupdate", R), S.addEventListener("ended", I), S.addEventListener("error", k), () => {
5206
- S.removeEventListener("timeupdate", R), S.removeEventListener("ended", I), S.removeEventListener("error", k);
5216
+ return v.addEventListener("timeupdate", k), v.addEventListener("ended", I), v.addEventListener("error", _), () => {
5217
+ v.removeEventListener("timeupdate", k), v.removeEventListener("ended", I), v.removeEventListener("error", _);
5207
5218
  };
5208
- }, [b, h, p, g, v, y]), he(() => {
5219
+ }, [b, h, p, g, S, y]), he(() => {
5209
5220
  if (r) return;
5210
- const S = t.current;
5211
- if (!S) return;
5221
+ const v = t.current;
5222
+ if (!v) return;
5212
5223
  if (!E) {
5213
5224
  try {
5214
- S.pause();
5225
+ v.pause();
5215
5226
  } catch (z) {
5216
5227
  console.log("pause error", z);
5217
5228
  }
5218
5229
  x.current = null;
5219
5230
  return;
5220
5231
  }
5221
- const R = S.currentSrc || S.src || null, I = !R || R !== E;
5232
+ const k = v.currentSrc || v.src || null, I = !k || k !== E;
5222
5233
  if (I) {
5223
5234
  try {
5224
- S.pause();
5235
+ v.pause();
5225
5236
  } catch (z) {
5226
5237
  console.log("pause error", z);
5227
5238
  }
5228
- S.src = E;
5239
+ v.src = E;
5229
5240
  try {
5230
- S.load();
5241
+ v.load();
5231
5242
  } catch (z) {
5232
5243
  console.log("load error", z);
5233
5244
  }
5234
5245
  x.current = E;
5235
5246
  }
5236
- S.muted = !!a, S.volume = 1, S.playbackRate = typeof l == "number" ? l : 1;
5237
- const k = async () => {
5247
+ v.muted = !!a, v.volume = 1, v.playbackRate = typeof l == "number" ? l : 1;
5248
+ const _ = async () => {
5238
5249
  I && await new Promise((z) => {
5239
5250
  let A = !1;
5240
5251
  const M = () => {
5241
- A || (A = !0, S.removeEventListener("loadedmetadata", M), S.removeEventListener("canplay", M), z());
5252
+ A || (A = !0, v.removeEventListener("loadedmetadata", M), v.removeEventListener("canplay", M), z());
5242
5253
  };
5243
- S.addEventListener("loadedmetadata", M), S.addEventListener("canplay", M), S.readyState >= 1 && M();
5254
+ v.addEventListener("loadedmetadata", M), v.addEventListener("canplay", M), v.readyState >= 1 && M();
5244
5255
  });
5245
5256
  try {
5246
- await S.play();
5257
+ await v.play();
5247
5258
  } catch (z) {
5248
5259
  console.warn("el.play() failed", z);
5249
5260
  }
5250
5261
  };
5251
5262
  if (o === "loading" || o === "playing")
5252
- k();
5263
+ _();
5253
5264
  else
5254
5265
  try {
5255
- S.pause();
5266
+ v.pause();
5256
5267
  } catch (z) {
5257
5268
  console.log("pause error", z);
5258
5269
  }
5259
5270
  }, [E, a, o, l, r]), he(() => {
5260
5271
  if (r) return;
5261
- const S = t.current;
5262
- if (!S || u !== "real") return;
5263
- const R = i / 1e3;
5264
- if (Number.isFinite(R)) {
5265
- if (S.readyState < 1) {
5272
+ const v = t.current;
5273
+ if (!v || u !== "real") return;
5274
+ const k = i / 1e3;
5275
+ if (Number.isFinite(k)) {
5276
+ if (v.readyState < 1) {
5266
5277
  f.current = i;
5267
5278
  const I = () => {
5268
5279
  if (f.current != null) {
5269
- const k = f.current / 1e3;
5280
+ const _ = f.current / 1e3;
5270
5281
  try {
5271
- S.currentTime = k;
5282
+ v.currentTime = _;
5272
5283
  } catch (z) {
5273
5284
  console.log("currentTime보정 오류", z);
5274
5285
  }
5275
5286
  f.current = null;
5276
5287
  }
5277
- S.removeEventListener("loadedmetadata", I), S.removeEventListener("canplay", I);
5288
+ v.removeEventListener("loadedmetadata", I), v.removeEventListener("canplay", I);
5278
5289
  };
5279
- S.addEventListener("loadedmetadata", I), S.addEventListener("canplay", I);
5290
+ v.addEventListener("loadedmetadata", I), v.addEventListener("canplay", I);
5280
5291
  return;
5281
5292
  }
5282
- if (Math.abs(S.currentTime - R) > 0.2)
5293
+ if (Math.abs(v.currentTime - k) > 0.2)
5283
5294
  try {
5284
- S.currentTime = R;
5295
+ v.currentTime = k;
5285
5296
  } catch (I) {
5286
5297
  console.log("currentTime보정오류", I);
5287
5298
  }
5288
5299
  }
5289
5300
  }, [i, u, r]);
5290
- const m = ke((S) => S.getGIFromCT);
5301
+ const m = ke((v) => v.getGIFromCT);
5291
5302
  return he(() => {
5292
- var I, k;
5303
+ var I, _;
5293
5304
  if (r || u !== "real" || o !== "playing" && o !== "loading") return;
5294
- const S = m(s, i);
5295
- if (S < 0) return;
5296
- const R = c(S);
5297
- R !== T.current && (T.current = R, v(R, "audio"), R % 5 === 0 && ((k = (I = y()) == null ? void 0 : I.ensureVisibleGI) == null || k.call(I, R)));
5305
+ const v = m(s, i);
5306
+ if (v < 0) return;
5307
+ const k = c(v);
5308
+ k !== T.current && (T.current = k, S(k, "audio"), k % 5 === 0 && ((_ = (I = y()) == null ? void 0 : I.ensureVisibleGI) == null || _.call(I, k)));
5298
5309
  }, [
5299
5310
  o,
5300
5311
  s,
@@ -5302,7 +5313,7 @@ const Na = "_wrap_1hfub_4", Fa = "_visible_1hfub_25", Da = "_compact_1hfub_31",
5302
5313
  u,
5303
5314
  m,
5304
5315
  c,
5305
- v,
5316
+ S,
5306
5317
  y,
5307
5318
  r
5308
5319
  ]), /* @__PURE__ */ w("audio", { ref: t, preload: "auto", style: { display: "none" } });
@@ -5323,15 +5334,15 @@ function cc() {
5323
5334
  he(() => {
5324
5335
  p(i(t || 0));
5325
5336
  }, [t, i]);
5326
- const v = oe(!1), y = Se(() => Math.max(0, Math.min(t ?? 0, Math.max(0, (n ?? 1) - 1))) + 1, [t, n]), c = te(() => {
5327
- a && (l(), v.current = !0);
5337
+ const S = oe(!1), y = Se(() => Math.max(0, Math.min(t ?? 0, Math.max(0, (n ?? 1) - 1))) + 1, [t, n]), c = te(() => {
5338
+ a && (l(), S.current = !0);
5328
5339
  }, [a, l]), g = te((T) => {
5329
5340
  p(Number(T.currentTarget.value));
5330
5341
  }, []), f = te(async () => {
5331
5342
  const T = s(h), E = u(T);
5332
5343
  l(), r(E, "scrubber-commit"), b(E);
5333
5344
  const m = o();
5334
- m != null && m.ensureVisibleGI && await m.ensureVisibleGI(E), v.current && (v.current = !1, d());
5345
+ m != null && m.ensureVisibleGI && await m.ensureVisibleGI(E), S.current && (S.current = !1, d());
5335
5346
  }, [h, s, u, l, r, b, o, d]), x = Se(
5336
5347
  () => ({ "--pct": `${h}%` }),
5337
5348
  [h]
@@ -5374,14 +5385,14 @@ function cc() {
5374
5385
  ] });
5375
5386
  }
5376
5387
  const uc = $.memo(cc), dc = Ft(function() {
5377
- const t = $e(It), n = (t == null ? void 0 : t.getState().isPlaybackMode) ?? !1, r = ke((S) => S.playbackKind), o = ke((S) => S.status), i = ke((S) => S.fake), s = K((S) => S.audioSpeed), u = ke((S) => S.pause), a = j((S) => S.totalRuns), l = j((S) => S.currentGlobalRunIndex), d = j((S) => S.setCurrentGlobalRunIndex), b = j((S) => S.getSectionScrollApi), h = j((S) => S.nextReadableFrom), p = j((S) => S.edgeReadable), v = oe(null), y = oe(null), c = oe(0), g = oe(-1), f = !n && r === "fake" && o === "playing", x = Math.max(1, (i == null ? void 0 : i.totalWords) ?? 1), C = Se(() => {
5378
- const S = 200 * s;
5379
- return x / S * 6e4;
5388
+ const t = $e(It), n = (t == null ? void 0 : t.getState().isPlaybackMode) ?? !1, r = ke((v) => v.playbackKind), o = ke((v) => v.status), i = ke((v) => v.fake), s = K((v) => v.audioSpeed), u = ke((v) => v.pause), a = j((v) => v.totalRuns), l = j((v) => v.currentGlobalRunIndex), d = j((v) => v.setCurrentGlobalRunIndex), b = j((v) => v.getSectionScrollApi), h = j((v) => v.nextReadableFrom), p = j((v) => v.edgeReadable), S = oe(null), y = oe(null), c = oe(0), g = oe(-1), f = !n && r === "fake" && o === "playing", x = Math.max(1, (i == null ? void 0 : i.totalWords) ?? 1), C = Se(() => {
5389
+ const v = 200 * s;
5390
+ return x / v * 6e4;
5380
5391
  }, [x, s]), T = Se(() => !a || a <= 1 || C <= 0 ? 0 : (a - 1) / C, [a, C]);
5381
5392
  he(() => {
5382
5393
  if (!f) return;
5383
- const S = Math.max(0, Math.min(l ?? 0, Math.max(0, (a ?? 1) - 1)));
5384
- c.current = S, g.current = S, y.current = null;
5394
+ const v = Math.max(0, Math.min(l ?? 0, Math.max(0, (a ?? 1) - 1)));
5395
+ c.current = v, g.current = v, y.current = null;
5385
5396
  }, [f, l, a]);
5386
5397
  const E = oe(-1);
5387
5398
  he(() => {
@@ -5389,39 +5400,39 @@ const uc = $.memo(cc), dc = Ft(function() {
5389
5400
  E.current = -1;
5390
5401
  return;
5391
5402
  }
5392
- const S = p(1);
5393
- E.current = S ?? -1;
5403
+ const v = p(1);
5404
+ E.current = v ?? -1;
5394
5405
  }, [p, a]);
5395
5406
  const m = te(
5396
- (S) => {
5407
+ (v) => {
5397
5408
  (async () => {
5398
- var G, _;
5409
+ var G, R;
5399
5410
  if (!f) {
5400
- v.current = null;
5411
+ S.current = null;
5401
5412
  return;
5402
5413
  }
5403
5414
  if (!a || a <= 1 || T <= 0) {
5404
- v.current = null;
5415
+ S.current = null;
5405
5416
  return;
5406
5417
  }
5407
- const R = y.current;
5408
- y.current = S;
5409
- const I = R == null ? 0 : Math.max(0, S - R), k = a - 1;
5410
- c.current = Math.min(k, c.current + T * I);
5418
+ const k = y.current;
5419
+ y.current = v;
5420
+ const I = k == null ? 0 : Math.max(0, v - k), _ = a - 1;
5421
+ c.current = Math.min(_, c.current + T * I);
5411
5422
  const z = Math.floor(c.current), A = b(), M = h(z, 1);
5412
5423
  if (M == null) {
5413
- const N = E.current >= 0 ? E.current : z;
5414
- N !== g.current && (g.current = N, d(N, "audio"), await ((G = A == null ? void 0 : A.ensureVisibleGI) == null ? void 0 : G.call(A, N))), u(), v.current = null;
5424
+ const H = E.current >= 0 ? E.current : z;
5425
+ H !== g.current && (g.current = H, d(H, "audio"), await ((G = A == null ? void 0 : A.ensureVisibleGI) == null ? void 0 : G.call(A, H))), u(), S.current = null;
5415
5426
  return;
5416
5427
  }
5417
5428
  const B = M;
5418
- B !== g.current && (g.current = B, d(B, "audio"), B % 5 === 0 && await ((_ = A == null ? void 0 : A.ensureVisibleGI) == null ? void 0 : _.call(A, B))), v.current = requestAnimationFrame(m);
5429
+ B !== g.current && (g.current = B, d(B, "audio"), B % 5 === 0 && await ((R = A == null ? void 0 : A.ensureVisibleGI) == null ? void 0 : R.call(A, B))), S.current = requestAnimationFrame(m);
5419
5430
  })().catch(console.error);
5420
5431
  },
5421
5432
  [f, a, T, h, d, b, u]
5422
5433
  );
5423
- return he(() => (f ? v.current == null && (v.current = requestAnimationFrame(m)) : (v.current && (cancelAnimationFrame(v.current), v.current = null), y.current = null), () => {
5424
- v.current && (cancelAnimationFrame(v.current), v.current = null);
5434
+ return he(() => (f ? S.current == null && (S.current = requestAnimationFrame(m)) : (S.current && (cancelAnimationFrame(S.current), S.current = null), y.current = null), () => {
5435
+ S.current && (cancelAnimationFrame(S.current), S.current = null);
5425
5436
  }), [f, m]), null;
5426
5437
  }), fc = Ft(function() {
5427
5438
  return /* @__PURE__ */ w(dc, {});
@@ -5454,8 +5465,8 @@ const uc = $.memo(cc), dc = Ft(function() {
5454
5465
  (h) => {
5455
5466
  if (s.current) return;
5456
5467
  s.current = h, i.current = Io, u(h) && l();
5457
- const v = () => a();
5458
- window.addEventListener("mouseup", v, { once: !0 }), window.addEventListener("touchend", v, { once: !0 });
5468
+ const S = () => a();
5469
+ window.addEventListener("mouseup", S, { once: !0 }), window.addEventListener("touchend", S, { once: !0 });
5459
5470
  },
5460
5471
  [l, u, a]
5461
5472
  );
@@ -5511,9 +5522,9 @@ function Tc(e) {
5511
5522
  function Co({ direction: e }) {
5512
5523
  const t = j((b) => b.currentGlobalRunIndex), n = j((b) => b.totalRuns), r = j((b) => b.hasReadableInDir), o = j((b) => b.computeStepTarget), i = j((b) => b.setCurrentGlobalRunIndex), s = ke((b) => b.syncToGI), u = j((b) => b.getSectionScrollApi), a = te(
5513
5524
  async (b) => {
5514
- var v, y;
5525
+ var S, y;
5515
5526
  const h = Math.max(t, Math.min(0, Math.max(0, (n ?? 1) - 1))), p = o(h, b);
5516
- i(p, "scrubber-step"), s(p), await ((y = (v = u()) == null ? void 0 : v.ensureVisibleGI) == null ? void 0 : y.call(v, p));
5527
+ i(p, "scrubber-step"), s(p), await ((y = (S = u()) == null ? void 0 : S.ensureVisibleGI) == null ? void 0 : y.call(S, p));
5517
5528
  },
5518
5529
  [
5519
5530
  t,
@@ -5574,47 +5585,47 @@ function Ec(e) {
5574
5585
  return Ye({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z" }, child: [] }] })(e);
5575
5586
  }
5576
5587
  function zc() {
5577
- var R;
5578
- const e = K((I) => I.showOverlays), t = j((I) => I.section), n = !!t.ast.isAddedSplit, r = !!((R = t.audios) != null && R.length), o = j((I) => I.canTracking), i = j((I) => I.canToggleShowGaze), s = j((I) => I.showGaze), u = j((I) => I.onToggleShowGaze), a = K((I) => I.muteAudio), l = K((I) => I.showPointer), d = K((I) => I.showSplit), b = K((I) => I.toggleMuteAudio), h = K((I) => I.toggleShowPointer), p = K((I) => I.toggleShowSplit), v = K((I) => I.overlayCompactMode), y = K((I) => I.toggleOverlayCompactMode), c = xn(), g = bt();
5588
+ var k;
5589
+ const e = K((I) => I.showOverlays), t = j((I) => I.section), n = !!t.ast.isAddedSplit, r = !!((k = t.audios) != null && k.length), o = j((I) => I.canTracking), i = j((I) => I.canToggleShowGaze), s = j((I) => I.showGaze), u = j((I) => I.onToggleShowGaze), a = K((I) => I.muteAudio), l = K((I) => I.showPointer), d = K((I) => I.showSplit), b = K((I) => I.toggleMuteAudio), h = K((I) => I.toggleShowPointer), p = K((I) => I.toggleShowSplit), S = K((I) => I.overlayCompactMode), y = K((I) => I.toggleOverlayCompactMode), c = xn(), g = bt();
5579
5590
  he(() => {
5580
- const I = c.getState(), { syncToGI: k, useFake: z, useReal: A } = I, M = I.playbackKind, B = g.getState().progress.currentGlobalRunIndex ?? 0;
5591
+ const I = c.getState(), { syncToGI: _, useFake: z, useReal: A } = I, M = I.playbackKind, B = g.getState().progress.currentGlobalRunIndex ?? 0;
5581
5592
  if (!r) {
5582
5593
  M !== "fake" && z();
5583
5594
  return;
5584
5595
  }
5585
- a ? M !== "fake" && z() : M !== "real" && (k(B), A());
5596
+ a ? M !== "fake" && z() : M !== "real" && (_(B), A());
5586
5597
  }, [r, a, g, c]);
5587
5598
  const f = ke((I) => I.play), x = ke((I) => I.pause), C = ke((I) => I.status), T = te(
5588
5599
  (I) => {
5589
5600
  I.stopPropagation(), C === "playing" || C === "loading" ? x() : f();
5590
5601
  },
5591
5602
  [C, f, x]
5592
- ), E = xn(), m = bt(), S = te(
5603
+ ), E = xn(), m = bt(), v = te(
5593
5604
  async (I) => {
5594
5605
  var ye, ze;
5595
5606
  if (I.stopPropagation(), C === "playing" || C === "loading") {
5596
5607
  x();
5597
5608
  return;
5598
5609
  }
5599
- const { progress: k } = m.getState(), {
5610
+ const { progress: _ } = m.getState(), {
5600
5611
  currentGlobalRunIndex: z,
5601
5612
  snapToReadable: A,
5602
5613
  edgeReadable: M,
5603
5614
  setCurrentGlobalRunIndex: B,
5604
5615
  getSectionScrollApi: G
5605
- } = k, _ = E.getState(), N = _.currentClip, Z = G == null ? void 0 : G(), pe = typeof z == "number" ? z : 0, ce = typeof A == "function" ? A(pe) : pe, de = typeof M == "function" ? M(1) : null;
5616
+ } = _, R = E.getState(), H = R.currentClip, Z = G == null ? void 0 : G(), pe = typeof z == "number" ? z : 0, ce = typeof A == "function" ? A(pe) : pe, de = typeof M == "function" ? M(1) : null;
5606
5617
  if (de != null && ce >= de) {
5607
- B == null || B(de, "audio"), await ((ye = Z == null ? void 0 : Z.ensureVisibleGI) == null ? void 0 : ye.call(Z, de)), _.syncToGI(de);
5618
+ B == null || B(de, "audio"), await ((ye = Z == null ? void 0 : Z.ensureVisibleGI) == null ? void 0 : ye.call(Z, de)), R.syncToGI(de);
5608
5619
  return;
5609
5620
  }
5610
- B == null || B(ce, "audio"), await ((ze = Z == null ? void 0 : Z.ensureVisibleGI) == null ? void 0 : ze.call(Z, ce)), _.syncToGI(ce), f(N);
5621
+ B == null || B(ce, "audio"), await ((ze = Z == null ? void 0 : Z.ensureVisibleGI) == null ? void 0 : ze.call(Z, ce)), R.syncToGI(ce), f(H);
5611
5622
  },
5612
5623
  [C, x, f, E, m]
5613
5624
  );
5614
5625
  return /* @__PURE__ */ Y(
5615
5626
  "div",
5616
5627
  {
5617
- className: `${_e.wrap} ${e ? _e.visible : ""} ${v ? _e.compact : ""}`,
5628
+ className: `${_e.wrap} ${e ? _e.visible : ""} ${S ? _e.compact : ""}`,
5618
5629
  onClick: (I) => {
5619
5630
  I.stopPropagation();
5620
5631
  },
@@ -5622,8 +5633,8 @@ function zc() {
5622
5633
  I.stopPropagation();
5623
5634
  },
5624
5635
  children: [
5625
- !v && /* @__PURE__ */ w(uc, {}),
5626
- /* @__PURE__ */ w("div", { style: v ? { display: "none" } : void 0, children: r && !a ? /* @__PURE__ */ w(nc, {}) : /* @__PURE__ */ w(fc, {}) }),
5636
+ !S && /* @__PURE__ */ w(uc, {}),
5637
+ /* @__PURE__ */ w("div", { style: S ? { display: "none" } : void 0, children: r && !a ? /* @__PURE__ */ w(nc, {}) : /* @__PURE__ */ w(fc, {}) }),
5627
5638
  /* @__PURE__ */ Y("div", { className: _e.controls, children: [
5628
5639
  /* @__PURE__ */ Y("div", { className: _e.row1, children: [
5629
5640
  /* @__PURE__ */ w("div", { className: _e.groupExpand, children: /* @__PURE__ */ w(
@@ -5634,8 +5645,8 @@ function zc() {
5634
5645
  I.stopPropagation(), y();
5635
5646
  },
5636
5647
  className: _e.compactBtn,
5637
- title: v ? "오버레이 확대" : "오버레이 축소",
5638
- children: v ? /* @__PURE__ */ w(Ec, { size: 24 }) : /* @__PURE__ */ w(Mc, { size: 24 })
5648
+ title: S ? "오버레이 확대" : "오버레이 축소",
5649
+ children: S ? /* @__PURE__ */ w(Ec, { size: 24 }) : /* @__PURE__ */ w(Mc, { size: 24 })
5639
5650
  }
5640
5651
  ) }),
5641
5652
  /* @__PURE__ */ Y("div", { className: _e.groupPlayback, children: [
@@ -5645,7 +5656,7 @@ function zc() {
5645
5656
  {
5646
5657
  size: 34,
5647
5658
  isPlaying: C === "playing",
5648
- onClick: a ? S : T,
5659
+ onClick: a ? v : T,
5649
5660
  title: C === "playing" ? "일시정지" : "재생"
5650
5661
  }
5651
5662
  ),
@@ -5794,7 +5805,7 @@ const Vc = $.memo(Wc), $c = "_wrap_62su0_7", qc = "_wrapHidden_62su0_29", jc = "
5794
5805
  inlineFlex: iu
5795
5806
  };
5796
5807
  function su({ visible: e }) {
5797
- const t = K((m) => m.mode), n = K((m) => m.setMode), r = K((m) => m.theme), o = K((m) => m.setTheme), i = K((m) => m.fontFamily), s = K((m) => m.setFontFamily), u = K((m) => m.resetToDefaults), a = K((m) => m.getFontLevel()), l = K((m) => m.getLineLevel()), d = K((m) => m.getMarginLevel()), b = K((m) => m.setFontLevel), h = K((m) => m.setLineLevel), p = K((m) => m.setMarginLevel), v = K((m) => m.pointerStyle), y = K((m) => m.setPointerStyle), c = K((m) => m.pointerColor), g = K((m) => m.setPointerColor), f = K((m) => m.breakMarks), x = K((m) => m.toggleBreakMark), C = K((m) => m.getBreakGapLevel()), T = K((m) => m.setBreakGapLevel), E = `${Pe.wrap} ${e ? Pe.wrapVisible : Pe.wrapHidden}`;
5808
+ const t = K((m) => m.mode), n = K((m) => m.setMode), r = K((m) => m.theme), o = K((m) => m.setTheme), i = K((m) => m.fontFamily), s = K((m) => m.setFontFamily), u = K((m) => m.resetToDefaults), a = K((m) => m.getFontLevel()), l = K((m) => m.getLineLevel()), d = K((m) => m.getMarginLevel()), b = K((m) => m.setFontLevel), h = K((m) => m.setLineLevel), p = K((m) => m.setMarginLevel), S = K((m) => m.pointerStyle), y = K((m) => m.setPointerStyle), c = K((m) => m.pointerColor), g = K((m) => m.setPointerColor), f = K((m) => m.breakMarks), x = K((m) => m.toggleBreakMark), C = K((m) => m.getBreakGapLevel()), T = K((m) => m.setBreakGapLevel), E = `${Pe.wrap} ${e ? Pe.wrapVisible : Pe.wrapHidden}`;
5798
5809
  return /* @__PURE__ */ Y("div", { className: E, role: "dialog", "aria-modal": "true", "aria-label": "뷰어 설정", children: [
5799
5810
  /* @__PURE__ */ Y("div", { className: Pe.scrollArea, children: [
5800
5811
  /* @__PURE__ */ w(qt, { label: "열람방식", children: /* @__PURE__ */ Y("div", { className: Pe.inlineFlex, children: [
@@ -5802,14 +5813,14 @@ function su({ visible: e }) {
5802
5813
  /* @__PURE__ */ w(Pt, { active: t === "scroll", onClick: () => n("scroll"), children: "스크롤" })
5803
5814
  ] }) }),
5804
5815
  /* @__PURE__ */ w(qt, { label: "테마", children: /* @__PURE__ */ w("div", { className: Pe.inlineFlex, children: Object.keys(vn).map((m) => {
5805
- const S = m, R = vn[S];
5816
+ const v = m, k = vn[v];
5806
5817
  return /* @__PURE__ */ w(
5807
5818
  "button",
5808
5819
  {
5809
5820
  type: "button",
5810
- onClick: () => o(S),
5821
+ onClick: () => o(v),
5811
5822
  className: `${Pe.themeCircle} ${r === m ? Pe.themeCircleActive : ""}`,
5812
- style: { background: R.bg, color: R.fg, fontFamily: i },
5823
+ style: { background: k.bg, color: k.fg, fontFamily: i },
5813
5824
  title: String(m),
5814
5825
  "aria-label": `테마: ${String(m)}`,
5815
5826
  children: "A"
@@ -5861,8 +5872,8 @@ function su({ visible: e }) {
5861
5872
  }
5862
5873
  ),
5863
5874
  /* @__PURE__ */ w(qt, { label: "포인터", children: /* @__PURE__ */ Y("div", { className: Pe.inlineFlex, children: [
5864
- /* @__PURE__ */ w(Pt, { active: v === "highlight", onClick: () => y("highlight"), children: "형광펜" }),
5865
- /* @__PURE__ */ w(Pt, { active: v === "underline", onClick: () => y("underline"), children: "밑줄" }),
5875
+ /* @__PURE__ */ w(Pt, { active: S === "highlight", onClick: () => y("highlight"), children: "형광펜" }),
5876
+ /* @__PURE__ */ w(Pt, { active: S === "underline", onClick: () => y("underline"), children: "밑줄" }),
5866
5877
  /* @__PURE__ */ w(
5867
5878
  "input",
5868
5879
  {
@@ -5987,8 +5998,8 @@ const lu = $.memo(function() {
5987
5998
  l = (h) => {
5988
5999
  const p = s(h);
5989
6000
  if (!d(b, p)) {
5990
- const v = b;
5991
- u(b = p, v);
6001
+ const S = b;
6002
+ u(b = p, S);
5992
6003
  }
5993
6004
  }, a != null && a.fireImmediately && u(b, b);
5994
6005
  }
@@ -6018,16 +6029,16 @@ function pu(e) {
6018
6029
  let n = e == null ? void 0 : e.map, r = e == null ? void 0 : e.initialIndex;
6019
6030
  const o = (p) => {
6020
6031
  if (!n) return null;
6021
- const { g2ct: v } = n;
6022
- if (!v) return null;
6023
- const y = v[p];
6032
+ const { g2ct: S } = n;
6033
+ if (!S) return null;
6034
+ const y = S[p];
6024
6035
  if (y) return { clip: y.clip, t: y.t };
6025
6036
  for (let c = 1; c <= 100 && p - c >= 0; c++) {
6026
- const g = v[p - c];
6037
+ const g = S[p - c];
6027
6038
  if (g) return { clip: g.clip, t: g.t };
6028
6039
  }
6029
6040
  for (let c = 1; c <= 100; c++) {
6030
- const g = v[p + c];
6041
+ const g = S[p + c];
6031
6042
  if (g) return { clip: g.clip, t: g.t };
6032
6043
  }
6033
6044
  return null;
@@ -6040,7 +6051,7 @@ function pu(e) {
6040
6051
  }
6041
6052
  const l = i.length > 0, d = l ? "paused" : "idle", b = l ? "real" : "fake", h = l ? null : { totalWords: a };
6042
6053
  return nn(
6043
- cu((p, v) => ({
6054
+ cu((p, S) => ({
6044
6055
  // 원본/포인터
6045
6056
  clips: i,
6046
6057
  currentClip: Math.max(0, Math.min(s, Math.max(0, i.length - 1))),
@@ -6158,7 +6169,7 @@ function pu(e) {
6158
6169
  setClipIndex: (y) => p((c) => c.playbackKind === "fake" || y < 0 || y >= c.clips.length ? c : { currentClip: y, currentTimeMs: 0 }),
6159
6170
  // 조회
6160
6171
  getClipSrc: (y) => {
6161
- const c = v();
6172
+ const c = S();
6162
6173
  if (!c.clips.length) return null;
6163
6174
  const g = typeof y == "number" ? y : c.currentClip;
6164
6175
  return uu(c.clips[g]);
@@ -6202,12 +6213,12 @@ function pu(e) {
6202
6213
  },
6203
6214
  // 편의
6204
6215
  getMetaByGI: (y) => {
6205
- const c = v().getCTFromGI(y);
6216
+ const c = S().getCTFromGI(y);
6206
6217
  return c ? { clipIndex: c.clip, timeMs: c.timeMs } : null;
6207
6218
  },
6208
6219
  syncToGI: (y) => {
6209
- const c = v().getMetaByGI(y);
6210
- c && v().setClipAndMs(c.clipIndex, c.timeMs);
6220
+ const c = S().getMetaByGI(y);
6221
+ c && S().setClipAndMs(c.clipIndex, c.timeMs);
6211
6222
  },
6212
6223
  // <audio> 이벤트 (real 전용)
6213
6224
  _onTime: (y) => p({ currentTimeMs: y, status: "playing", scrollLock: !0 }),
@@ -6321,7 +6332,7 @@ function vu(e) {
6321
6332
  nav: b,
6322
6333
  layout: h,
6323
6334
  initialIndex: p,
6324
- mountTime: v
6335
+ mountTime: S
6325
6336
  } = e, y = h.totalRuns ?? 0, c = typeof p == "number" ? p : y > 0 ? 0 : -1, g = c >= 0 ? mu(b.readableGi, c, y) : -1;
6326
6337
  return {
6327
6338
  section: t,
@@ -6341,7 +6352,7 @@ function vu(e) {
6341
6352
  pageIndex: 0,
6342
6353
  totalPages: 0,
6343
6354
  sectionLoading: !0,
6344
- _loadingStartTime: v,
6355
+ _loadingStartTime: S,
6345
6356
  _scrollApi: void 0,
6346
6357
  derivedNav: b,
6347
6358
  layout: h,
@@ -6369,7 +6380,7 @@ function Su(e) {
6369
6380
  onToggleShowGaze: d,
6370
6381
  handleAskCalibration: b,
6371
6382
  eventBridgeStore: h
6372
- } = e, p = t.ast.blocks, { nav: v, layout: y } = bu(p), c = Date.now(), g = vu({
6383
+ } = e, p = t.ast.blocks, { nav: S, layout: y } = bu(p), c = Date.now(), g = vu({
6373
6384
  section: t,
6374
6385
  onViewerClose: r,
6375
6386
  onSectionNav: o,
@@ -6380,7 +6391,7 @@ function Su(e) {
6380
6391
  showGaze: l,
6381
6392
  onToggleShowGaze: d,
6382
6393
  handleAskCalibration: b,
6383
- nav: v,
6394
+ nav: S,
6384
6395
  layout: y,
6385
6396
  initialIndex: n,
6386
6397
  mountTime: c
@@ -6405,25 +6416,25 @@ function Su(e) {
6405
6416
  };
6406
6417
  });
6407
6418
  }, m = (W, D = "program") => {
6408
- const U = x().progress.currentGlobalRunIndex, O = x().progress, H = O.totalRuns > 0 ? Math.max(-1, Math.min(W, O.totalRuns - 1)) : W;
6409
- U === H && O.lastUpdateBy === D || (f((Q) => ({
6419
+ const U = x().progress.currentGlobalRunIndex, O = x().progress, N = O.totalRuns > 0 ? Math.max(-1, Math.min(W, O.totalRuns - 1)) : W;
6420
+ U === N && O.lastUpdateBy === D || (f((Q) => ({
6410
6421
  progress: {
6411
6422
  ...Q.progress,
6412
- currentGlobalRunIndex: H,
6423
+ currentGlobalRunIndex: N,
6413
6424
  lastUpdateBy: D
6414
6425
  }
6415
- })), U !== H && h && h.getState().emit({
6426
+ })), U !== N && h && h.getState().emit({
6416
6427
  type: "global_index_change",
6417
- payload: { globalIndex: H }
6428
+ payload: { globalIndex: N }
6418
6429
  }));
6419
- }, S = (W) => {
6430
+ }, v = (W) => {
6420
6431
  const { sectionLoading: D, _loadingStartTime: U } = x().progress;
6421
6432
  if (D === W) return;
6422
6433
  const O = Date.now();
6423
6434
  if (W)
6424
- f((H) => ({
6435
+ f((N) => ({
6425
6436
  progress: {
6426
- ...H.progress,
6437
+ ...N.progress,
6427
6438
  sectionLoading: !0,
6428
6439
  _loadingStartTime: O
6429
6440
  }
@@ -6438,7 +6449,7 @@ function Su(e) {
6438
6449
  }
6439
6450
  })), h && h.getState().emit({ type: "loading_end", payload: { duration: Q } });
6440
6451
  }
6441
- }, R = (W) => {
6452
+ }, k = (W) => {
6442
6453
  f((D) => ({
6443
6454
  progress: { ...D.progress, pageIndex: W }
6444
6455
  }));
@@ -6446,19 +6457,19 @@ function Su(e) {
6446
6457
  f((D) => ({
6447
6458
  progress: { ...D.progress, totalPages: W }
6448
6459
  }));
6449
- }, k = (W, D) => {
6460
+ }, _ = (W, D) => {
6450
6461
  const O = x().progress.rangeStartGI == null;
6451
- if (f((H) => ({
6462
+ if (f((N) => ({
6452
6463
  progress: {
6453
- ...H.progress,
6464
+ ...N.progress,
6454
6465
  rangeStartGI: Math.min(W, D),
6455
6466
  rangeEndGI: Math.max(W, D)
6456
6467
  }
6457
6468
  })), h) {
6458
- const H = M();
6469
+ const N = M();
6459
6470
  h.getState().emit({
6460
6471
  type: O ? "range_select" : "range_change",
6461
- payload: { startGI: Math.min(W, D), endGI: Math.max(W, D), text: H }
6472
+ payload: { startGI: Math.min(W, D), endGI: Math.max(W, D), text: N }
6462
6473
  });
6463
6474
  }
6464
6475
  }, z = () => {
@@ -6480,9 +6491,9 @@ function Su(e) {
6480
6491
  var ie;
6481
6492
  const { rangeStartGI: W, rangeEndGI: D, section: U, layout: O } = x().progress;
6482
6493
  if (W == null || D == null || !O) return "";
6483
- const H = ((ie = U.ast) == null ? void 0 : ie.blocks) ?? [], Q = O.prefix, L = [];
6484
- for (let V = 0; V < H.length; V++) {
6485
- const J = H[V];
6494
+ const N = ((ie = U.ast) == null ? void 0 : ie.blocks) ?? [], Q = O.prefix, L = [];
6495
+ for (let V = 0; V < N.length; V++) {
6496
+ const J = N[V];
6486
6497
  if (J.type !== "paragraph") continue;
6487
6498
  const ne = J.runs ?? [], ee = Q[V] ?? 0;
6488
6499
  for (let ue = 0; ue < ne.length; ue++) {
@@ -6515,35 +6526,35 @@ function Su(e) {
6515
6526
  translateEndGI: void 0
6516
6527
  }
6517
6528
  }));
6518
- }, _ = (W) => {
6529
+ }, R = (W) => {
6519
6530
  const { totalRuns: D, derivedNav: U } = x().progress, O = U == null ? void 0 : U.readableGi;
6520
6531
  if (!O || D <= 0) return W;
6521
- const H = D, Q = Math.max(0, Math.min(W, H - 1));
6532
+ const N = D, Q = Math.max(0, Math.min(W, N - 1));
6522
6533
  if (O[Q]) return Q;
6523
6534
  let L = Q - 1, ie = Q + 1;
6524
- for (; L >= 0 || ie < H; ) {
6525
- if (ie < H && O[ie]) return ie;
6535
+ for (; L >= 0 || ie < N; ) {
6536
+ if (ie < N && O[ie]) return ie;
6526
6537
  if (L >= 0 && O[L]) return L;
6527
6538
  ie += 1, L -= 1;
6528
6539
  }
6529
6540
  return Q;
6530
- }, N = (W, D) => {
6531
- const { totalRuns: U, derivedNav: O } = x().progress, H = O == null ? void 0 : O.readableGi;
6532
- if (!H || U <= 0) return null;
6541
+ }, H = (W, D) => {
6542
+ const { totalRuns: U, derivedNav: O } = x().progress, N = O == null ? void 0 : O.readableGi;
6543
+ if (!N || U <= 0) return null;
6533
6544
  if (D > 0) {
6534
6545
  for (let Q = Math.min(Math.max(W, 0), U - 1); Q < U; Q += 1)
6535
- if (H[Q]) return Q;
6546
+ if (N[Q]) return Q;
6536
6547
  } else
6537
6548
  for (let Q = Math.min(Math.max(W, 0), U - 1); Q >= 0; Q -= 1)
6538
- if (H[Q]) return Q;
6549
+ if (N[Q]) return Q;
6539
6550
  return null;
6540
6551
  }, Z = (W) => {
6541
6552
  const { totalRuns: D, derivedNav: U } = x().progress, O = U == null ? void 0 : U.readableGi;
6542
6553
  if (!O || D <= 0) return null;
6543
6554
  if (W > 0) {
6544
- for (let H = D - 1; H >= 0; H -= 1) if (O[H]) return H;
6555
+ for (let N = D - 1; N >= 0; N -= 1) if (O[N]) return N;
6545
6556
  } else
6546
- for (let H = 0; H < D; H += 1) if (O[H]) return H;
6557
+ for (let N = 0; N < D; N += 1) if (O[N]) return N;
6547
6558
  return null;
6548
6559
  };
6549
6560
  return {
@@ -6553,49 +6564,49 @@ function Su(e) {
6553
6564
  getSectionScrollApi: T,
6554
6565
  setTotalRuns: E,
6555
6566
  setCurrentGlobalRunIndex: m,
6556
- setSectionLoading: S,
6557
- setPageIndex: R,
6567
+ setSectionLoading: v,
6568
+ setPageIndex: k,
6558
6569
  setTotalPages: I,
6559
6570
  // Translate API
6560
6571
  setTranslateState: B,
6561
6572
  clearTranslate: G,
6562
6573
  // Range Selection API
6563
- setRange: k,
6574
+ setRange: _,
6564
6575
  clearRange: z,
6565
6576
  extendRange: A,
6566
6577
  getRangeText: M,
6567
6578
  // 네비 API
6568
- snapToReadable: _,
6569
- nextReadableFrom: N,
6579
+ snapToReadable: R,
6580
+ nextReadableFrom: H,
6570
6581
  edgeReadable: Z,
6571
- hasReadableInDir: (W, D) => N(W + (D > 0 ? 1 : -1), D) != null,
6582
+ hasReadableInDir: (W, D) => H(W + (D > 0 ? 1 : -1), D) != null,
6572
6583
  computeStepTarget: (W, D) => {
6573
6584
  const { totalRuns: U, derivedNav: O } = x().progress;
6574
6585
  if (!U || U <= 0) return W;
6575
- const H = (O == null ? void 0 : O.groups) ?? [], Q = O == null ? void 0 : O.giToGroupIdx;
6576
- if (!H.length || !Q) {
6586
+ const N = (O == null ? void 0 : O.groups) ?? [], Q = O == null ? void 0 : O.giToGroupIdx;
6587
+ if (!N.length || !Q) {
6577
6588
  const ee = U - 1;
6578
- return _(Math.max(0, Math.min(W + D, ee)));
6589
+ return R(Math.max(0, Math.min(W + D, ee)));
6579
6590
  }
6580
6591
  let L = Q[W] ?? -1;
6581
- if (L < 0 || L >= H.length)
6582
- for (let ne = 0; ne < H.length; ne += 1) {
6583
- const ee = H[ne];
6592
+ if (L < 0 || L >= N.length)
6593
+ for (let ne = 0; ne < N.length; ne += 1) {
6594
+ const ee = N[ne];
6584
6595
  if (W >= ee.startG && W <= ee.endG) {
6585
6596
  L = ne;
6586
6597
  break;
6587
6598
  }
6588
6599
  }
6589
- if (L < 0 || L >= H.length)
6590
- return Z(D) ?? _(W);
6591
- const ie = (ne) => ne >= 0 && ne < H.length && (H[ne].firstReadableGI ?? -1) >= 0;
6600
+ if (L < 0 || L >= N.length)
6601
+ return Z(D) ?? R(W);
6602
+ const ie = (ne) => ne >= 0 && ne < N.length && (N[ne].firstReadableGI ?? -1) >= 0;
6592
6603
  let V = L + D;
6593
- for (; V >= 0 && V < H.length && !ie(V); )
6604
+ for (; V >= 0 && V < N.length && !ie(V); )
6594
6605
  V += D;
6595
- if (V < 0 || V >= H.length)
6596
- return Z(D) ?? _(W + D);
6597
- const J = H[V].firstReadableGI;
6598
- return J >= 0 ? J : _(W + D);
6606
+ if (V < 0 || V >= N.length)
6607
+ return Z(D) ?? R(W + D);
6608
+ const J = N[V].firstReadableGI;
6609
+ return J >= 0 ? J : R(W + D);
6599
6610
  },
6600
6611
  giToPercentTotal: (W) => {
6601
6612
  const D = x().progress.totalRuns;
@@ -6670,7 +6681,7 @@ const wu = ({
6670
6681
  return o.forEach((x, C) => {
6671
6682
  (x.type === "paragraph" || x.type === "image") && f.push(C);
6672
6683
  }), f;
6673
- }, [o]), v = Se(() => {
6684
+ }, [o]), S = Se(() => {
6674
6685
  if (!h) return [];
6675
6686
  const f = [];
6676
6687
  for (let x = h.startBlock; x <= h.endBlock; x++) {
@@ -6680,12 +6691,12 @@ const wu = ({
6680
6691
  return f;
6681
6692
  }, [h, p]), y = Se(() => {
6682
6693
  const f = [];
6683
- for (const x of v) {
6694
+ for (const x of S) {
6684
6695
  const C = o[x];
6685
6696
  (C == null ? void 0 : C.type) === "paragraph" && f.push({ b: C, originalBlockIndex: x });
6686
6697
  }
6687
6698
  return f;
6688
- }, [v, o]), c = Se(() => {
6699
+ }, [S, o]), c = Se(() => {
6689
6700
  const f = /* @__PURE__ */ new Map(), x = Or();
6690
6701
  return y.forEach((C, T) => {
6691
6702
  f.set(C.originalBlockIndex, {
@@ -6697,14 +6708,14 @@ const wu = ({
6697
6708
  if (!f || f.length === 0) return [];
6698
6709
  const T = [];
6699
6710
  for (const E of f) {
6700
- const m = E.startG, S = E.endG;
6701
- if (S < x || m > C) continue;
6702
- const R = Math.max(m, x), I = Math.min(S, C), k = R - m | 0, z = Math.max(0, I - R + 1);
6711
+ const m = E.startG, v = E.endG;
6712
+ if (v < x || m > C) continue;
6713
+ const k = Math.max(m, x), I = Math.min(v, C), _ = k - m | 0, z = Math.max(0, I - k + 1);
6703
6714
  if (z <= 0) continue;
6704
- const A = (E.r0 ?? 0) + k;
6715
+ const A = (E.r0 ?? 0) + _;
6705
6716
  T.push({
6706
6717
  ...E,
6707
- startG: R,
6718
+ startG: k,
6708
6719
  endG: I,
6709
6720
  r0: A,
6710
6721
  len: z
@@ -6745,9 +6756,9 @@ const wu = ({
6745
6756
  },
6746
6757
  children: [
6747
6758
  /* @__PURE__ */ w("div", { style: { height: 40 } }),
6748
- /* @__PURE__ */ w("div", { style: { flex: 1, overflow: "hidden" }, children: v.map((f, x) => {
6759
+ /* @__PURE__ */ w("div", { style: { flex: 1, overflow: "hidden" }, children: S.map((f, x) => {
6749
6760
  var U;
6750
- const C = o[f], T = x === 0, E = x === v.length - 1, m = {
6761
+ const C = o[f], T = x === 0, E = x === S.length - 1, m = {
6751
6762
  boxSizing: "border-box",
6752
6763
  paddingRight: `${i}px`,
6753
6764
  paddingLeft: `${i}px`,
@@ -6757,9 +6768,9 @@ const wu = ({
6757
6768
  // justifyContent: 'center',
6758
6769
  width: "100%",
6759
6770
  height: "auto"
6760
- }, S = `sec-${r.section_id}/blk-${C.id ?? f}`;
6771
+ }, v = `sec-${r.section_id}/blk-${C.id ?? f}`;
6761
6772
  if (C.type === "image") {
6762
- const { src: O, alt: H, width: Q, height: L } = C, ie = Q && L ? `${Q} / ${L}` : "4 / 3", V = l > 80 ? Math.floor((l - 80) * 0.6) : void 0;
6773
+ const { src: O, alt: N, width: Q, height: L } = C, ie = Q && L ? `${Q} / ${L}` : "4 / 3", V = l > 80 ? Math.floor((l - 80) * 0.6) : void 0;
6763
6774
  return /* @__PURE__ */ w("div", { style: m, children: /* @__PURE__ */ Y(
6764
6775
  "div",
6765
6776
  {
@@ -6782,7 +6793,7 @@ const wu = ({
6782
6793
  "img",
6783
6794
  {
6784
6795
  src: O,
6785
- alt: H || "",
6796
+ alt: N || "",
6786
6797
  loading: "eager",
6787
6798
  style: {
6788
6799
  pointerEvents: "none",
@@ -6797,29 +6808,29 @@ const wu = ({
6797
6808
  )
6798
6809
  }
6799
6810
  ),
6800
- H && /* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#6b7280", marginTop: 4 }, children: H })
6811
+ N && /* @__PURE__ */ w("div", { style: { fontSize: 12, color: "#6b7280", marginTop: 4 }, children: N })
6801
6812
  ]
6802
6813
  }
6803
- ) }, S);
6814
+ ) }, v);
6804
6815
  }
6805
- const R = C, I = c.get(f), k = I == null ? void 0 : I.marker, z = R.runs ?? [], A = z.length;
6816
+ const k = C, I = c.get(f), _ = I == null ? void 0 : I.marker, z = k.runs ?? [], A = z.length;
6806
6817
  let M = 0, B = Math.max(0, A - 1);
6807
6818
  T && h.startOffsetInBlock != null && (M = Math.min(Math.max(0, h.startOffsetInBlock), B)), E && h.endOffsetInBlock != null && (B = Math.max(
6808
6819
  M,
6809
6820
  Math.min(h.endOffsetInBlock, B)
6810
6821
  ));
6811
- const G = M > 0, _ = d[f] ?? 0, N = b[f] ?? [], Z = _ + M, pe = _ + B;
6812
- let ce = g(N, Z, pe);
6813
- const de = _ + M;
6822
+ const G = M > 0, R = d[f] ?? 0, H = b[f] ?? [], Z = R + M, pe = R + B;
6823
+ let ce = g(H, Z, pe);
6824
+ const de = R + M;
6814
6825
  ce = ce.map((O) => {
6815
- const H = Math.max(0, (O.startG ?? Z) - de), Q = O.len ?? Math.max(1, (O.endG ?? pe) - (O.startG ?? Z) + 1);
6826
+ const N = Math.max(0, (O.startG ?? Z) - de), Q = O.len ?? Math.max(1, (O.endG ?? pe) - (O.startG ?? Z) + 1);
6816
6827
  return {
6817
6828
  ...O,
6818
- r0: H,
6829
+ r0: N,
6819
6830
  len: Q
6820
6831
  };
6821
6832
  });
6822
- const ye = M <= B ? z.slice(M, B + 1) : [], ze = R.list ? R.list.level * 24 : 0, W = ((U = R.list) == null ? void 0 : U.kind) === "bullet" ? R.list.glyph ?? "•" : void 0, D = G ? void 0 : k ?? W;
6833
+ const ye = M <= B ? z.slice(M, B + 1) : [], ze = k.list ? k.list.level * 24 : 0, W = ((U = k.list) == null ? void 0 : U.kind) === "bullet" ? k.list.glyph ?? "•" : void 0, D = G ? void 0 : _ ?? W;
6823
6834
  return /* @__PURE__ */ w("div", { style: m, children: /* @__PURE__ */ Y(
6824
6835
  "p",
6825
6836
  {
@@ -6827,12 +6838,12 @@ const wu = ({
6827
6838
  width: "100%",
6828
6839
  margin: "8px 0",
6829
6840
  paddingLeft: ze,
6830
- textAlign: R.textAlign,
6841
+ textAlign: k.textAlign,
6831
6842
  whiteSpace: "pre-wrap",
6832
6843
  boxSizing: "border-box"
6833
6844
  },
6834
6845
  children: [
6835
- R.list && D ? /* @__PURE__ */ w(
6846
+ k.list && D ? /* @__PURE__ */ w(
6836
6847
  "span",
6837
6848
  {
6838
6849
  "aria-hidden": !0,
@@ -6850,14 +6861,14 @@ const wu = ({
6850
6861
  {
6851
6862
  preGroups: ce,
6852
6863
  runs: ye,
6853
- ns: S,
6864
+ ns: v,
6854
6865
  baseIndex: de,
6855
6866
  sectionId: String(r.section_id)
6856
6867
  }
6857
6868
  )
6858
6869
  ]
6859
6870
  }
6860
- ) }, S);
6871
+ ) }, v);
6861
6872
  }) })
6862
6873
  ]
6863
6874
  }
@@ -6917,7 +6928,7 @@ function Cu(e) {
6917
6928
  onDragMove: b,
6918
6929
  onDragEnd: h,
6919
6930
  pageTransitionThreshold: p
6920
- } = e, v = p ?? u, y = 10, c = Xe.useRef({
6931
+ } = e, S = p ?? u, y = 10, c = Xe.useRef({
6921
6932
  // ── touch ──
6922
6933
  touchId: null,
6923
6934
  startX: 0,
@@ -6950,9 +6961,9 @@ function Cu(e) {
6950
6961
  ), x = Xe.useCallback(
6951
6962
  (M, B) => {
6952
6963
  const G = Math.abs(M) / Math.max(1, B);
6953
- Math.abs(M) >= v || G >= a ? M < 0 ? n() : t() : h == null || h();
6964
+ Math.abs(M) >= S || G >= a ? M < 0 ? n() : t() : h == null || h();
6954
6965
  },
6955
- [v, a, n, t, h]
6966
+ [S, a, n, t, h]
6956
6967
  ), C = Xe.useCallback(
6957
6968
  (M) => {
6958
6969
  if (M.touches.length !== 1) return;
@@ -6967,9 +6978,9 @@ function Cu(e) {
6967
6978
  if (c.current.touchId == null) return;
6968
6979
  const B = Array.from(M.touches).find((Z) => Z.identifier === c.current.touchId);
6969
6980
  if (!B) return;
6970
- const G = B.clientX - c.current.startX, _ = Math.abs(G), N = Math.abs(B.clientY - c.current.startY);
6981
+ const G = B.clientX - c.current.startX, R = Math.abs(G), H = Math.abs(B.clientY - c.current.startY);
6971
6982
  if (!c.current.swiping)
6972
- if (_ >= y && _ > N)
6983
+ if (R >= y && R > H)
6973
6984
  c.current.swiping = !0;
6974
6985
  else
6975
6986
  return;
@@ -6981,30 +6992,30 @@ function Cu(e) {
6981
6992
  if (c.current.touchId == null) return;
6982
6993
  const B = Array.from(M.changedTouches).find((Z) => Z.identifier === c.current.touchId);
6983
6994
  if (!B) return;
6984
- const G = B.clientX - c.current.startX, _ = B.clientY - c.current.startY, N = M.timeStamp - c.current.startT;
6985
- c.current.swiping ? x(G, N) : Math.abs(G) < 10 && Math.abs(_) < 10 && f(M.target), c.current.suppressClick = !0, c.current.touchId = null, c.current.swiping = !1;
6995
+ const G = B.clientX - c.current.startX, R = B.clientY - c.current.startY, H = M.timeStamp - c.current.startT;
6996
+ c.current.swiping ? x(G, H) : Math.abs(G) < 10 && Math.abs(R) < 10 && f(M.target), c.current.suppressClick = !0, c.current.touchId = null, c.current.swiping = !1;
6986
6997
  },
6987
6998
  [x, f]
6988
6999
  ), m = Xe.useCallback(() => {
6989
7000
  c.current.swiping && (h == null || h()), c.current.touchId = null, c.current.swiping = !1;
6990
- }, [h]), S = Xe.useCallback(
7001
+ }, [h]), v = Xe.useCallback(
6991
7002
  (M) => {
6992
7003
  if (M.pointerType === "touch" || c.current.mouseDown) return;
6993
7004
  const B = s ?? i;
6994
7005
  B != null && B(M.target) || (c.current.mouseDown = !0, c.current.mouseSwiping = !1, c.current.mStartX = M.clientX, c.current.mStartY = M.clientY, c.current.mStartT = M.timeStamp, c.current.suppressClick = !1, c.current.capturedEl = M.currentTarget);
6995
7006
  },
6996
7007
  [s, i]
6997
- ), R = Xe.useCallback(
7008
+ ), k = Xe.useCallback(
6998
7009
  (M) => {
6999
7010
  if (M.pointerType === "touch" || !c.current.mouseDown) return;
7000
- const B = M.clientX - c.current.mStartX, G = Math.abs(B), _ = Math.abs(M.clientY - c.current.mStartY);
7011
+ const B = M.clientX - c.current.mStartX, G = Math.abs(B), R = Math.abs(M.clientY - c.current.mStartY);
7001
7012
  if (!c.current.mouseSwiping)
7002
- if (G >= y && G > _) {
7013
+ if (G >= y && G > R) {
7003
7014
  c.current.mouseSwiping = !0, c.current.suppressClick = !0;
7004
- const N = c.current.capturedEl;
7005
- if (N != null && N.setPointerCapture)
7015
+ const H = c.current.capturedEl;
7016
+ if (H != null && H.setPointerCapture)
7006
7017
  try {
7007
- N.setPointerCapture(M.pointerId);
7018
+ H.setPointerCapture(M.pointerId);
7008
7019
  } catch {
7009
7020
  }
7010
7021
  c.current.prevUserSelect = document.body.style.userSelect, document.body.style.userSelect = "none", M.preventDefault();
@@ -7018,8 +7029,8 @@ function Cu(e) {
7018
7029
  var G;
7019
7030
  if (M.pointerType === "touch" || !c.current.mouseDown) return;
7020
7031
  if (c.current.mouseSwiping) {
7021
- const _ = M.clientX - c.current.mStartX, N = M.timeStamp - c.current.mStartT;
7022
- x(_, N), document.body.style.userSelect = c.current.prevUserSelect;
7032
+ const R = M.clientX - c.current.mStartX, H = M.timeStamp - c.current.mStartT;
7033
+ x(R, H), document.body.style.userSelect = c.current.prevUserSelect;
7023
7034
  }
7024
7035
  const B = c.current.capturedEl;
7025
7036
  if ((G = B == null ? void 0 : B.hasPointerCapture) != null && G.call(B, M.pointerId))
@@ -7030,7 +7041,7 @@ function Cu(e) {
7030
7041
  c.current.mouseDown = !1, c.current.mouseSwiping = !1, c.current.capturedEl = null;
7031
7042
  },
7032
7043
  [x]
7033
- ), k = Xe.useCallback(
7044
+ ), _ = Xe.useCallback(
7034
7045
  (M) => {
7035
7046
  M.pointerType !== "touch" && (c.current.mouseSwiping && (h == null || h(), document.body.style.userSelect = c.current.prevUserSelect), c.current.mouseDown = !1, c.current.mouseSwiping = !1, c.current.capturedEl = null);
7036
7047
  },
@@ -7059,10 +7070,10 @@ function Cu(e) {
7059
7070
  onTouchEnd: E,
7060
7071
  onTouchCancel: m,
7061
7072
  // mouse
7062
- onPointerDown: S,
7063
- onPointerMove: R,
7073
+ onPointerDown: v,
7074
+ onPointerMove: k,
7064
7075
  onPointerUp: I,
7065
- onPointerCancel: k,
7076
+ onPointerCancel: _,
7066
7077
  onLostPointerCapture: z,
7067
7078
  // click (mouse only)
7068
7079
  onClick: A
@@ -7214,7 +7225,7 @@ function Pu() {
7214
7225
  No = 1;
7215
7226
  var e = Di(), t = ku(), n = Bu(), r = "Expected a function", o = Math.max, i = Math.min;
7216
7227
  function s(u, a, l) {
7217
- var d, b, h, p, v, y, c = 0, g = !1, f = !1, x = !0;
7228
+ var d, b, h, p, S, y, c = 0, g = !1, f = !1, x = !0;
7218
7229
  if (typeof u != "function")
7219
7230
  throw new TypeError(r);
7220
7231
  a = n(a) || 0, e(l) && (g = !!l.leading, f = "maxWait" in l, h = f ? o(n(l.maxWait) || 0, a) : h, x = "trailing" in l ? !!l.trailing : x);
@@ -7223,7 +7234,7 @@ function Pu() {
7223
7234
  return d = b = void 0, c = A, p = u.apply(B, M), p;
7224
7235
  }
7225
7236
  function T(A) {
7226
- return c = A, v = setTimeout(S, a), g ? C(A) : p;
7237
+ return c = A, S = setTimeout(v, a), g ? C(A) : p;
7227
7238
  }
7228
7239
  function E(A) {
7229
7240
  var M = A - y, B = A - c, G = a - M;
@@ -7233,32 +7244,32 @@ function Pu() {
7233
7244
  var M = A - y, B = A - c;
7234
7245
  return y === void 0 || M >= a || M < 0 || f && B >= h;
7235
7246
  }
7236
- function S() {
7247
+ function v() {
7237
7248
  var A = t();
7238
7249
  if (m(A))
7239
- return R(A);
7240
- v = setTimeout(S, E(A));
7250
+ return k(A);
7251
+ S = setTimeout(v, E(A));
7241
7252
  }
7242
- function R(A) {
7243
- return v = void 0, x && d ? C(A) : (d = b = void 0, p);
7253
+ function k(A) {
7254
+ return S = void 0, x && d ? C(A) : (d = b = void 0, p);
7244
7255
  }
7245
7256
  function I() {
7246
- v !== void 0 && clearTimeout(v), c = 0, d = y = b = v = void 0;
7257
+ S !== void 0 && clearTimeout(S), c = 0, d = y = b = S = void 0;
7247
7258
  }
7248
- function k() {
7249
- return v === void 0 ? p : R(t());
7259
+ function _() {
7260
+ return S === void 0 ? p : k(t());
7250
7261
  }
7251
7262
  function z() {
7252
7263
  var A = t(), M = m(A);
7253
7264
  if (d = arguments, b = this, y = A, M) {
7254
- if (v === void 0)
7265
+ if (S === void 0)
7255
7266
  return T(y);
7256
7267
  if (f)
7257
- return clearTimeout(v), v = setTimeout(S, a), C(y);
7268
+ return clearTimeout(S), S = setTimeout(v, a), C(y);
7258
7269
  }
7259
- return v === void 0 && (v = setTimeout(S, a)), p;
7270
+ return S === void 0 && (S = setTimeout(v, a)), p;
7260
7271
  }
7261
- return z.cancel = I, z.flush = k, z;
7272
+ return z.cancel = I, z.flush = _, z;
7262
7273
  }
7263
7274
  return ir = s, ir;
7264
7275
  }
@@ -7344,7 +7355,7 @@ async function Vu({
7344
7355
  showSlash: b,
7345
7356
  paragraphMarkers: h,
7346
7357
  playbackScale: p = 1,
7347
- viewportHeight: v = 0,
7358
+ viewportHeight: S = 0,
7348
7359
  instanceId: y = "default"
7349
7360
  }) {
7350
7361
  var g, f, x;
@@ -7363,27 +7374,27 @@ async function Vu({
7363
7374
  C && (t.style.transform = `scale(${T})`, t.style.transformOrigin = "top left");
7364
7375
  const E = Math.max(0, e.offsetWidth || 0), m = Math.max(0, Math.min(E, o));
7365
7376
  t.style.maxWidth = `${m}px`, rt(c, y);
7366
- let S = Math.round(n.offsetHeight || 0);
7367
- S || (S = Math.max(0, n.clientHeight | 0));
7368
- const R = 1.5, I = (L, ie) => ie + L <= S - R, k = getComputedStyle(e), z = {
7369
- letterSpacing: k.letterSpacing,
7370
- wordSpacing: k.wordSpacing,
7371
- fontKerning: k.fontKerning || "normal",
7372
- fontVariantLigatures: k.fontVariantLigatures || "normal",
7373
- textTransform: k.textTransform || "none",
7374
- direction: k.direction || "ltr",
7375
- wordBreak: k.wordBreak || "keep-all",
7376
- overflowWrap: k.overflowWrap || k.wordWrap || "break-word",
7377
- hyphens: k.hyphens || "manual"
7377
+ let v = Math.round(n.offsetHeight || 0);
7378
+ v || (v = Math.max(0, n.clientHeight | 0));
7379
+ const k = 1.5, I = (L, ie) => ie + L <= v - k, _ = getComputedStyle(e), z = {
7380
+ letterSpacing: _.letterSpacing,
7381
+ wordSpacing: _.wordSpacing,
7382
+ fontKerning: _.fontKerning || "normal",
7383
+ fontVariantLigatures: _.fontVariantLigatures || "normal",
7384
+ textTransform: _.textTransform || "none",
7385
+ direction: _.direction || "ltr",
7386
+ wordBreak: _.wordBreak || "keep-all",
7387
+ overflowWrap: _.overflowWrap || _.wordWrap || "break-word",
7388
+ hyphens: _.hyphens || "manual"
7378
7389
  }, A = (L) => {
7379
7390
  L.style.letterSpacing = z.letterSpacing || "", L.style.wordSpacing = z.wordSpacing || "", L.style.fontKerning = z.fontKerning || "", L.style.fontVariantLigatures = z.fontVariantLigatures || "", L.style.textTransform = z.textTransform || "", L.style.direction = z.direction || "", L.style.wordBreak = z.wordBreak || "", L.style.wordWrap = z.overflowWrap || "", L.style.overflowWrap = z.overflowWrap || "", L.style.hyphens = z.hyphens || "";
7380
7391
  }, M = m, B = Math.max(0, M - 2 * (i || 0));
7381
7392
  n.innerHTML = "";
7382
7393
  const G = document.createElement("div");
7383
7394
  G.style.boxSizing = "border-box", G.style.width = `${M}px`, G.style.maxWidth = `${M}px`, G.style.margin = "0 auto", G.style.display = "flex", n.appendChild(G);
7384
- const _ = document.createElement("div");
7385
- _.style.boxSizing = "border-box", _.style.paddingRight = `${i}px`, _.style.paddingLeft = `${i}px`, _.style.width = `${M}px`, _.style.maxWidth = `${M}px`, _.style.margin = "0 auto", _.style.display = "flex", _.style.justifyContent = "center", _.style.height = "auto", G.appendChild(_);
7386
- const N = /* @__PURE__ */ new Map(), Z = {}, pe = Wu(c, y, r.length), ce = (L, ie) => {
7395
+ const R = document.createElement("div");
7396
+ R.style.boxSizing = "border-box", R.style.paddingRight = `${i}px`, R.style.paddingLeft = `${i}px`, R.style.width = `${M}px`, R.style.maxWidth = `${M}px`, R.style.margin = "0 auto", R.style.display = "flex", R.style.justifyContent = "center", R.style.height = "auto", G.appendChild(R);
7397
+ const H = /* @__PURE__ */ new Map(), Z = {}, pe = Wu(c, y, r.length), ce = (L, ie) => {
7387
7398
  const V = document.createElement("p");
7388
7399
  return V.style.margin = "8px 0", V.style.paddingLeft = ie ? `${ie}px` : "0", V.style.textAlign = L.textAlign ?? "start", V.style.whiteSpace = "pre-wrap", V.style.lineHeight = String(a), V.style.fontSize = `${u}px`, V.style.boxSizing = "border-box", V.style.fontFamily = s ?? "", V.style.width = "100%", A(V), V;
7389
7400
  }, de = (L, ie) => {
@@ -7405,7 +7416,7 @@ async function Vu({
7405
7416
  J.appendChild(ue);
7406
7417
  }
7407
7418
  L.appendChild(J);
7408
- }, ye = v > 80 ? Math.floor((v - 80) * 0.6) : void 0, ze = (L) => {
7419
+ }, ye = S > 80 ? Math.floor((S - 80) * 0.6) : void 0, ze = (L) => {
7409
7420
  const ie = L != null && L.width && (L != null && L.height) ? `${L.width} / ${L.height}` : "4 / 3", V = document.createElement("div");
7410
7421
  V.style.margin = "12px 0", V.style.textAlign = "center", V.style.width = `${B}px`;
7411
7422
  const J = document.createElement("div");
@@ -7420,9 +7431,9 @@ async function Vu({
7420
7431
  for (let L = 0; L < r.length; L++) {
7421
7432
  rt(c, y);
7422
7433
  const ie = r[L];
7423
- if (_.dataset.block = String(L), _.innerHTML = "", ie.kind === "image") {
7434
+ if (R.dataset.block = String(L), R.innerHTML = "", ie.kind === "image") {
7424
7435
  const Re = ie.block, Oe = ze(Re);
7425
- _.appendChild(Oe);
7436
+ R.appendChild(Oe);
7426
7437
  const Ne = Oe.getBoundingClientRect(), { mt: Ge, mb: Ve } = lr(Oe);
7427
7438
  Z[L] = { contentH: Math.ceil(Ne.height), mt: Ge, mb: Ve }, await pe(24);
7428
7439
  continue;
@@ -7436,15 +7447,15 @@ async function Vu({
7436
7447
  const Ne = document.createElement("span");
7437
7448
  Ne.textContent = `${ee} `, Ne.style.minWidth = "16px", Ne.style.display = "inline-block", Ne.style.whiteSpace = "nowrap", Ne.style.userSelect = "none", Re.appendChild(Ne), de(Re, V.runs), de(Oe, V.runs);
7438
7449
  const Ge = document.createDocumentFragment();
7439
- Ge.appendChild(Re), Ge.appendChild(Oe), _.appendChild(Ge);
7450
+ Ge.appendChild(Re), Ge.appendChild(Oe), R.appendChild(Ge);
7440
7451
  } else {
7441
7452
  const Re = ce(V, J);
7442
- Re.dataset.variant = "with", de(Re, V.runs), _.appendChild(Re);
7453
+ Re.dataset.variant = "with", de(Re, V.runs), R.appendChild(Re);
7443
7454
  }
7444
- const se = _.querySelector('p[data-variant="with"]'), Ie = _.querySelector('p[data-variant="no"]'), be = Ie ?? se;
7455
+ const se = R.querySelector('p[data-variant="with"]'), Ie = R.querySelector('p[data-variant="no"]'), be = Ie ?? se;
7445
7456
  if (se && be) {
7446
7457
  const Re = Fo(se), Oe = Fo(be), { mt: Ne, mb: Ge } = lr(se), { mt: Ve, mb: ct } = lr(be), Ze = ((x = V.runs) == null ? void 0 : x.length) ?? 0, Le = Ie ? Oe : Re, st = Ie ? Ve : Ne, nt = Ie ? ct : Ge;
7447
- N.set(L, {
7458
+ H.set(L, {
7448
7459
  runsLen: Ze,
7449
7460
  lastBottomWith: Re,
7450
7461
  lastBottomNo: Le,
@@ -7456,24 +7467,24 @@ async function Vu({
7456
7467
  }
7457
7468
  await pe(24);
7458
7469
  }
7459
- rt(c, y), _.innerHTML = "";
7470
+ rt(c, y), R.innerHTML = "";
7460
7471
  const W = (L, ie, V, J) => {
7461
7472
  if (ie > V) return { top: 0, content: 0, mb: 0 };
7462
7473
  const ne = J ? L.lastBottomNo : L.lastBottomWith, ee = J ? L.mtNo : L.mtWith, ue = J ? L.mbNo : L.mbWith, se = J ? 0 : ee, Ie = ie > 0 ? ne[ie - 1] ?? 0 : 0, be = Math.max(0, (ne[V] ?? 0) - Ie);
7463
7474
  return { top: se, content: be, mb: ue };
7464
7475
  }, D = [];
7465
- let U = 0, O, H = null, Q = null;
7476
+ let U = 0, O, N = null, Q = null;
7466
7477
  for (; U < r.length; ) {
7467
7478
  rt(c, y);
7468
7479
  const L = U;
7469
7480
  let ie = 0, V = 0, J = O;
7470
- J != null && H === U && Q != null && (J = Math.max(J, Q + 1));
7481
+ J != null && N === U && Q != null && (J = Math.max(J, Q + 1));
7471
7482
  let ne = -1, ee;
7472
7483
  for (; U < r.length; ) {
7473
7484
  if (rt(c, y), r[U].kind === "image") {
7474
7485
  const Le = Z[U] ?? { contentH: 0, mt: 0, mb: 0 }, nt = (ie === 0 ? Le.mt : V + Le.mt) + Le.contentH;
7475
7486
  if (I(nt, ie)) {
7476
- ie += nt, ne = U, ee = void 0, V = Le.mb, U += 1, O = void 0, H = null, Q = null;
7487
+ ie += nt, ne = U, ee = void 0, V = Le.mb, U += 1, O = void 0, N = null, Q = null;
7477
7488
  continue;
7478
7489
  }
7479
7490
  if (ie === 0) {
@@ -7482,19 +7493,19 @@ async function Vu({
7482
7493
  endBlock: U,
7483
7494
  ...J != null ? { startOffsetInBlock: J } : {}
7484
7495
  // 이미지에는 run 오프셋 개념이 없어 endOffsetInBlock 생략
7485
- }), U += 1, O = void 0, H = null, Q = null, V = 0;
7496
+ }), U += 1, O = void 0, N = null, Q = null, V = 0;
7486
7497
  break;
7487
7498
  }
7488
7499
  break;
7489
7500
  }
7490
- const se = N.get(U), Ie = se.runsLen, be = U === L && J != null ? J : 0;
7501
+ const se = H.get(U), Ie = se.runsLen, be = U === L && J != null ? J : 0;
7491
7502
  if (be >= Ie) {
7492
- U += 1, O = void 0, H = null, Q = null;
7503
+ U += 1, O = void 0, N = null, Q = null;
7493
7504
  continue;
7494
7505
  }
7495
7506
  const Re = be > 0, Oe = W(se, be, Ie - 1, Re), Ge = (ie === 0 ? Oe.top : V + Oe.top) + Oe.content;
7496
7507
  if (I(Ge, ie)) {
7497
- ie += Ge, ne = U, ee = Ie - 1, V = Oe.mb, U += 1, O = void 0, H = null, Q = null;
7508
+ ie += Ge, ne = U, ee = Ie - 1, V = Oe.mb, U += 1, O = void 0, N = null, Q = null;
7498
7509
  continue;
7499
7510
  }
7500
7511
  let Ve = be, ct = Ie - 1, Ze = be - 1;
@@ -7509,7 +7520,7 @@ async function Vu({
7509
7520
  endBlock: U,
7510
7521
  ...J != null ? { startOffsetInBlock: J } : {},
7511
7522
  endOffsetInBlock: Ze
7512
- }), O = Ze + 1, H = U, Q = Ze, V = 0;
7523
+ }), O = Ze + 1, N = U, Q = Ze, V = 0;
7513
7524
  break;
7514
7525
  }
7515
7526
  if (ie > 0) {
@@ -7527,7 +7538,7 @@ async function Vu({
7527
7538
  endBlock: U,
7528
7539
  ...J != null ? { startOffsetInBlock: J } : {},
7529
7540
  endOffsetInBlock: Le
7530
- }), O = Le + 1, H = U, Q = Le, V = 0;
7541
+ }), O = Le + 1, N = U, Q = Le, V = 0;
7531
7542
  break;
7532
7543
  }
7533
7544
  }
@@ -7579,8 +7590,8 @@ function qu(e, t, n, r) {
7579
7590
  if (!l) continue;
7580
7591
  let d = 0, b = l - 1;
7581
7592
  u === s.startBlock && s.startOffsetInBlock != null && (d = Math.max(0, Math.min(s.startOffsetInBlock, b))), u === s.endBlock && s.endOffsetInBlock != null && (b = Math.max(d, Math.min(s.endOffsetInBlock, b)));
7582
- const h = r[a.originalIndex] ?? 0, p = h + d, v = h + b;
7583
- if (e >= p && e <= v) return i;
7593
+ const h = r[a.originalIndex] ?? 0, p = h + d, S = h + b;
7594
+ if (e >= p && e <= S) return i;
7584
7595
  }
7585
7596
  }
7586
7597
  return -1;
@@ -7603,7 +7614,7 @@ function Ku() {
7603
7614
  he(() => r.subscribe((q) => {
7604
7615
  o.current = q.progress.rangeStartGI != null && q.progress.rangeEndGI != null;
7605
7616
  }), [r]);
7606
- const i = o.current, s = Ct(), u = K((q) => q.theme), a = vn[u], l = K((q) => q.fontFamily), d = K((q) => q.fontSizePx), b = K((q) => q.lineHeight), h = K((q) => q.marginX), p = K((q) => q.viewportHeight), v = 860, y = oe(null), { items: c } = Se(() => {
7617
+ const i = o.current, s = Ct(), u = K((q) => q.theme), a = vn[u], l = K((q) => q.fontFamily), d = K((q) => q.fontSizePx), b = K((q) => q.lineHeight), h = K((q) => q.marginX), p = K((q) => q.viewportHeight), S = 860, y = oe(null), { items: c } = Se(() => {
7607
7618
  var q;
7608
7619
  return $u(((q = t == null ? void 0 : t.ast) == null ? void 0 : q.blocks) ?? []);
7609
7620
  }, [t]), g = Se(() => {
@@ -7617,7 +7628,7 @@ function Ku() {
7617
7628
  }, [c]), [f, x] = ft({
7618
7629
  pages: [],
7619
7630
  pageByRunIndex: null
7620
- }), C = j((q) => q.pageIndex), T = j((q) => q.setPageIndex), E = oe(0), m = oe(null), [S, R] = ft(!1), [I, k] = ft(null), [z, A] = ft(!1), M = Se(
7631
+ }), C = j((q) => q.pageIndex), T = j((q) => q.setPageIndex), E = oe(0), m = oe(null), [v, k] = ft(!1), [I, _] = ft(null), [z, A] = ft(!1), M = Se(
7621
7632
  () => ({
7622
7633
  flex: 1,
7623
7634
  fontFamily: l,
@@ -7638,7 +7649,7 @@ function Ku() {
7638
7649
  ), {
7639
7650
  showSplit: B,
7640
7651
  breakGapPx: G,
7641
- slash: _
7652
+ slash: R
7642
7653
  } = K(
7643
7654
  tn((q) => {
7644
7655
  var He;
@@ -7648,17 +7659,17 @@ function Ku() {
7648
7659
  slash: ((He = q.breakMarks) == null ? void 0 : He.slash) ?? !1
7649
7660
  };
7650
7661
  })
7651
- ), N = bt();
7662
+ ), H = bt();
7652
7663
  he(() => {
7653
- f && f.pages.length && (N.getState().progress.setTotalPages(f.pages.length + 1), (async () => {
7654
- const q = N.getState().progress.setSectionLoading;
7664
+ f && f.pages.length && (H.getState().progress.setTotalPages(f.pages.length + 1), (async () => {
7665
+ const q = H.getState().progress.setSectionLoading;
7655
7666
  await yt(), await yt(), await yt(), await yt(), q(!1);
7656
7667
  })());
7657
- }, [f, N]);
7668
+ }, [f, H]);
7658
7669
  const Z = te(() => {
7659
7670
  const q = y.current, He = se.current, De = Ie.current;
7660
7671
  if (!q || !He || !De || c.length === 0) {
7661
- x({ pages: [], pageByRunIndex: null }), T(0), N.getState().progress.setTotalPages(0);
7672
+ x({ pages: [], pageByRunIndex: null }), T(0), H.getState().progress.setTotalPages(0);
7662
7673
  return;
7663
7674
  }
7664
7675
  (async () => {
@@ -7669,14 +7680,14 @@ function Ku() {
7669
7680
  measureRoot: He,
7670
7681
  contentArea: De,
7671
7682
  items: c,
7672
- cfgMaxWidth: v,
7683
+ cfgMaxWidth: S,
7673
7684
  marginX: h,
7674
7685
  fontFamily: l,
7675
7686
  fontSizePx: d,
7676
7687
  lineHeight: b,
7677
7688
  showSplit: B,
7678
7689
  breakGapPx: G,
7679
- showSlash: _,
7690
+ showSlash: R,
7680
7691
  paragraphMarkers: g,
7681
7692
  playbackScale: ht,
7682
7693
  viewportHeight: p,
@@ -7691,19 +7702,19 @@ function Ku() {
7691
7702
  }, [
7692
7703
  T,
7693
7704
  c,
7694
- v,
7705
+ S,
7695
7706
  h,
7696
7707
  l,
7697
7708
  d,
7698
7709
  b,
7699
7710
  B,
7700
7711
  G,
7701
- _,
7712
+ R,
7702
7713
  g,
7703
7714
  s,
7704
7715
  p,
7705
7716
  e,
7706
- N
7717
+ H
7707
7718
  ]), pe = j((q) => q.setCurrentGlobalRunIndex), ce = j((q) => {
7708
7719
  var He;
7709
7720
  return ((He = q.layout) == null ? void 0 : He.prefix) ?? [];
@@ -7726,13 +7737,13 @@ function Ku() {
7726
7737
  },
7727
7738
  [C, f.pages, c, ce, pe, T, de]
7728
7739
  ), ze = te(() => {
7729
- S || E.current !== 0 ? (k("prev"), R(!1)) : ye(-1);
7730
- }, [S, ye]), W = te(() => {
7731
- S || E.current !== 0 ? (k("next"), R(!1)) : ye(1);
7732
- }, [S, ye]), D = kn(), U = te(() => {
7740
+ v || E.current !== 0 ? (_("prev"), k(!1)) : ye(-1);
7741
+ }, [v, ye]), W = te(() => {
7742
+ v || E.current !== 0 ? (_("next"), k(!1)) : ye(1);
7743
+ }, [v, ye]), D = kn(), U = te(() => {
7733
7744
  const { isSettingsOpen: q, setSettingsOpen: He, toggleOverlays: De } = D.getState();
7734
7745
  q ? He(!1) : De();
7735
- }, [D]), O = f.pages.length + 1, H = ((Pr = y.current) == null ? void 0 : Pr.clientWidth) || 400, Q = te((q) => {
7746
+ }, [D]), O = f.pages.length + 1, N = ((Pr = y.current) == null ? void 0 : Pr.clientWidth) || 400, Q = te((q) => {
7736
7747
  var vt;
7737
7748
  const He = m.current;
7738
7749
  if (!He) return;
@@ -7740,18 +7751,18 @@ function Ku() {
7740
7751
  He.style.transform = `translate3d(${-33.333 + ht}%, 0, 0)`;
7741
7752
  }, []), L = te(
7742
7753
  (q) => {
7743
- C === 0 && q > 0 || C >= O - 1 && q < 0 || (E.current = q, Q(q), S || R(!0));
7754
+ C === 0 && q > 0 || C >= O - 1 && q < 0 || (E.current = q, Q(q), v || k(!0));
7744
7755
  },
7745
- [C, O, Q, S]
7756
+ [C, O, Q, v]
7746
7757
  ), ie = te(() => {
7747
- E.current = 0, R(!1);
7758
+ E.current = 0, k(!1);
7748
7759
  const q = m.current;
7749
7760
  q && (q.style.transition = "transform 250ms ease-out", q.style.transform = "translate3d(-33.333%, 0, 0)");
7750
7761
  }, []), V = te(
7751
7762
  (q) => {
7752
7763
  if (q.target !== q.currentTarget || q.propertyName !== "transform") return;
7753
7764
  const He = I;
7754
- A(!0), k(null), E.current = 0, He === "prev" ? ye(-1) : He === "next" && ye(1);
7765
+ A(!0), _(null), E.current = 0, He === "prev" ? ye(-1) : He === "next" && ye(1);
7755
7766
  },
7756
7767
  [I, ye]
7757
7768
  );
@@ -7782,11 +7793,11 @@ function Ku() {
7782
7793
  doubleClickWindowMs: 300,
7783
7794
  onDragMove: L,
7784
7795
  onDragEnd: ie,
7785
- pageTransitionThreshold: H * 0.5
7796
+ pageTransitionThreshold: N * 0.5
7786
7797
  }), se = oe(null), Ie = oe(null), be = te(() => {
7787
- const q = N.getState().progress.setSectionLoading;
7798
+ const q = H.getState().progress.setSectionLoading;
7788
7799
  q(!0);
7789
- }, [N]), Re = Se(
7800
+ }, [H]), Re = Se(
7790
7801
  () => ({
7791
7802
  trailing: !0,
7792
7803
  leading: !1,
@@ -7796,7 +7807,7 @@ function Ku() {
7796
7807
  ), Oe = Hu(Z, 200, be, Re), Ne = oe("");
7797
7808
  he(() => {
7798
7809
  if (p <= 0) return;
7799
- const q = `${l}|${d}|${b}|${h}|${B}|${G}|${_}|${p}|${t == null ? void 0 : t.section_id}`;
7810
+ const q = `${l}|${d}|${b}|${h}|${B}|${G}|${R}|${p}|${t == null ? void 0 : t.section_id}`;
7800
7811
  Ne.current !== q && (Ne.current = q, Oe.cancel(), be(), Z());
7801
7812
  }, [
7802
7813
  Oe,
@@ -7808,7 +7819,7 @@ function Ku() {
7808
7819
  h,
7809
7820
  B,
7810
7821
  G,
7811
- _,
7822
+ R,
7812
7823
  p,
7813
7824
  t == null ? void 0 : t.section_id
7814
7825
  ]), Iu([y], Oe);
@@ -7841,7 +7852,7 @@ function Ku() {
7841
7852
  /* @__PURE__ */ w(Tn, { isIcon: !1 })
7842
7853
  ]
7843
7854
  }
7844
- ) : /* @__PURE__ */ w(wu, { pages: f.pages, pageIndex: q, maxWidth: v }), At = {
7855
+ ) : /* @__PURE__ */ w(wu, { pages: f.pages, pageIndex: q, maxWidth: S }), At = {
7845
7856
  width: "33.333%",
7846
7857
  height: "100%",
7847
7858
  flexShrink: 0,
@@ -7852,7 +7863,7 @@ function Ku() {
7852
7863
  boxSizing: "border-box",
7853
7864
  backfaceVisibility: "hidden",
7854
7865
  WebkitBackfaceVisibility: "hidden"
7855
- }, On = !z && (!S || I !== null);
7866
+ }, On = !z && (!v || I !== null);
7856
7867
  return /* @__PURE__ */ Y("div", { ref: y, style: { ...M, touchAction: "none" }, ...ue, children: [
7857
7868
  /* @__PURE__ */ Y(
7858
7869
  "div",
@@ -7890,7 +7901,7 @@ function Ku() {
7890
7901
  zIndex: -999999,
7891
7902
  opacity: 0,
7892
7903
  width: "100%",
7893
- maxWidth: v,
7904
+ maxWidth: S,
7894
7905
  height: "100%",
7895
7906
  minHeight: 0,
7896
7907
  boxSizing: "border-box",
@@ -7906,7 +7917,7 @@ function Ku() {
7906
7917
  {
7907
7918
  style: {
7908
7919
  width: "100%",
7909
- maxWidth: v,
7920
+ maxWidth: S,
7910
7921
  height: "100%",
7911
7922
  boxSizing: "border-box",
7912
7923
  display: "flex",
@@ -8029,12 +8040,12 @@ const Ed = Ft(function() {
8029
8040
  const c = window.setInterval(() => h.getState().tick(), 1e3);
8030
8041
  return () => window.clearInterval(c);
8031
8042
  }, [t, u, h]);
8032
- const p = t === "doing" ? n[r[o]] : void 0, v = t === "doing" && p ? i[p.qid] ?? [] : [], y = Se(() => {
8043
+ const p = t === "doing" ? n[r[o]] : void 0, S = t === "doing" && p ? i[p.qid] ?? [] : [], y = Se(() => {
8033
8044
  if (t === "idle" || t !== "finished") return;
8034
- const c = r.map((_) => n[_]), g = c.length, f = c.reduce((_, N) => _ + (N.score ?? 0), 0), x = c.reduce((_, N) => {
8035
- const Z = b[N.qid];
8036
- return _ + (Z != null && Z.isCorrect ? N.score ?? 0 : 0);
8037
- }, 0), C = c.map((_) => b[_.qid]).filter((_) => !!_), T = typeof l == "number" && typeof d == "number" ? Math.max(0, d - l) : C.reduce((_, N) => _ + (N.ms ?? 0), 0), E = g > 0 ? Math.round(T / g) : 0, m = [...C].sort((_, N) => _.ms - N.ms), S = m[0], R = m[m.length - 1], I = C.filter((_) => !_.multi), k = C.filter((_) => _.multi), z = I.filter((_) => _.isCorrect).length, A = k.filter((_) => _.isCorrect).length, M = C.filter((_) => _.timedOut).length, B = C.filter((_) => _.revealed).length, G = C.filter((_) => !_.isCorrect).sort((_, N) => N.ms - _.ms).slice(0, 3);
8045
+ const c = r.map((R) => n[R]), g = c.length, f = c.reduce((R, H) => R + (H.score ?? 0), 0), x = c.reduce((R, H) => {
8046
+ const Z = b[H.qid];
8047
+ return R + (Z != null && Z.isCorrect ? H.score ?? 0 : 0);
8048
+ }, 0), C = c.map((R) => b[R.qid]).filter((R) => !!R), T = typeof l == "number" && typeof d == "number" ? Math.max(0, d - l) : C.reduce((R, H) => R + (H.ms ?? 0), 0), E = g > 0 ? Math.round(T / g) : 0, m = [...C].sort((R, H) => R.ms - H.ms), v = m[0], k = m[m.length - 1], I = C.filter((R) => !R.multi), _ = C.filter((R) => R.multi), z = I.filter((R) => R.isCorrect).length, A = _.filter((R) => R.isCorrect).length, M = C.filter((R) => R.timedOut).length, B = C.filter((R) => R.revealed).length, G = C.filter((R) => !R.isCorrect).sort((R, H) => H.ms - R.ms).slice(0, 3);
8038
8049
  return {
8039
8050
  total: g,
8040
8051
  correct: s,
@@ -8043,10 +8054,10 @@ const Ed = Ft(function() {
8043
8054
  avgMs: E,
8044
8055
  totalScore: f,
8045
8056
  gainedScore: x,
8046
- fastest: S,
8047
- slowest: R,
8057
+ fastest: v,
8058
+ slowest: k,
8048
8059
  singles: { total: I.length, correct: z },
8049
- multis: { total: k.length, correct: A },
8060
+ multis: { total: _.length, correct: A },
8050
8061
  timedOut: M,
8051
8062
  revealed: B,
8052
8063
  wrongTop3: G
@@ -8058,7 +8069,7 @@ const Ed = Ft(function() {
8058
8069
  q: p,
8059
8070
  index: o,
8060
8071
  total: r.length,
8061
- selected: v,
8072
+ selected: S,
8062
8073
  uiReveal: a,
8063
8074
  onSelect: (c) => {
8064
8075
  if (a) return;
@@ -8117,12 +8128,12 @@ function zd(e) {
8117
8128
  [c[g], c[f]] = [c[f], c[g]];
8118
8129
  }
8119
8130
  return c;
8120
- }, [t.options]), p = Se(() => _d(t), [t]), v = Se(() => Md(t), [t]), y = Se(() => {
8131
+ }, [t.options]), p = Se(() => _d(t), [t]), S = Se(() => Md(t), [t]), y = Se(() => {
8121
8132
  const c = [...o].sort((g, f) => g - f);
8122
- if (c.length !== v.length) return !1;
8123
- for (let g = 0; g < c.length; g++) if (c[g] !== v[g]) return !1;
8133
+ if (c.length !== S.length) return !1;
8134
+ for (let g = 0; g < c.length; g++) if (c[g] !== S[g]) return !1;
8124
8135
  return !0;
8125
- }, [o, v]);
8136
+ }, [o, S]);
8126
8137
  return /* @__PURE__ */ Y("div", { className: ge.Body, children: [
8127
8138
  /* @__PURE__ */ Y("div", { className: ge.Header, children: [
8128
8139
  /* @__PURE__ */ w("div", { className: ge.Paging, children: `Quiz (${n + 1}/${r})` }),
@@ -8140,7 +8151,7 @@ function zd(e) {
8140
8151
  ),
8141
8152
  /* @__PURE__ */ w("div", { className: ge.Image, children: p && /* @__PURE__ */ w("img", { src: p, alt: "" }) }),
8142
8153
  /* @__PURE__ */ w("div", { className: ge.Options, children: h.map(({ opt: c, i: g }) => {
8143
- const f = o.includes(g), x = v.includes(g), C = [
8154
+ const f = o.includes(g), x = S.includes(g), C = [
8144
8155
  ge.OptionBtn,
8145
8156
  f ? ge.OptionBtnActive : "",
8146
8157
  i && x ? ge.OptionBtnCorrect : ""
@@ -8326,8 +8337,8 @@ function Pd(e, t) {
8326
8337
  selectToggle: (l) => {
8327
8338
  const d = a();
8328
8339
  if (d.phase !== "doing" || d.uiReveal) return;
8329
- const h = d.quizzes[d.order[d.currentIndex]].qid, p = d.answers[h] ?? [], v = p.includes(l) ? p.filter((y) => y !== l) : [...p, l].sort((y, c) => y - c);
8330
- u({ answers: { ...d.answers, [h]: v } });
8340
+ const h = d.quizzes[d.order[d.currentIndex]].qid, p = d.answers[h] ?? [], S = p.includes(l) ? p.filter((y) => y !== l) : [...p, l].sort((y, c) => y - c);
8341
+ u({ answers: { ...d.answers, [h]: S } });
8331
8342
  },
8332
8343
  selectSingle: (l) => {
8333
8344
  const d = a();
@@ -8338,14 +8349,14 @@ function Pd(e, t) {
8338
8349
  submitCurrent: () => {
8339
8350
  const l = a();
8340
8351
  if (l.phase !== "doing") return;
8341
- const d = l.order[l.currentIndex], b = l.quizzes[d], h = b.qid, p = (l.answers[h] ?? []).slice().sort((x, C) => x - C), v = cr(b), y = Bd(p, v), c = l.questionStartedAt ? Date.now() - l.questionStartedAt : 0, g = l.perQ[h], f = {
8352
+ const d = l.order[l.currentIndex], b = l.quizzes[d], h = b.qid, p = (l.answers[h] ?? []).slice().sort((x, C) => x - C), S = cr(b), y = Bd(p, S), c = l.questionStartedAt ? Date.now() - l.questionStartedAt : 0, g = l.perQ[h], f = {
8342
8353
  qid: h,
8343
8354
  index: b.index,
8344
8355
  question: b.question,
8345
8356
  score: b.score ?? 0,
8346
8357
  multi: ar(b),
8347
8358
  selected: p,
8348
- correctIdxes: v,
8359
+ correctIdxes: S,
8349
8360
  isCorrect: y,
8350
8361
  ms: c,
8351
8362
  revealed: (g == null ? void 0 : g.revealed) ?? !1,
@@ -8370,7 +8381,7 @@ function Pd(e, t) {
8370
8381
  const d = a();
8371
8382
  if (d.phase === "doing") {
8372
8383
  if (l) {
8373
- const b = d.quizzes[d.order[d.currentIndex]], h = b.qid, p = d.perQ[h], v = {
8384
+ const b = d.quizzes[d.order[d.currentIndex]], h = b.qid, p = d.perQ[h], S = {
8374
8385
  qid: h,
8375
8386
  index: b.index,
8376
8387
  question: b.question,
@@ -8383,7 +8394,7 @@ function Pd(e, t) {
8383
8394
  revealed: !0,
8384
8395
  timedOut: (p == null ? void 0 : p.timedOut) ?? !1
8385
8396
  };
8386
- u({ perQ: { ...d.perQ, [h]: v } });
8397
+ u({ perQ: { ...d.perQ, [h]: S } });
8387
8398
  }
8388
8399
  u({ uiReveal: l });
8389
8400
  }
@@ -8426,7 +8437,7 @@ function Pd(e, t) {
8426
8437
  if (l.phase !== "doing" || l.remainingSec == null) return;
8427
8438
  const d = l.remainingSec - 1;
8428
8439
  if (d <= 0) {
8429
- const b = l.quizzes[l.order[l.currentIndex]], h = b.qid, p = l.perQ[h], v = {
8440
+ const b = l.quizzes[l.order[l.currentIndex]], h = b.qid, p = l.perQ[h], S = {
8430
8441
  qid: h,
8431
8442
  index: b.index,
8432
8443
  question: b.question,
@@ -8442,7 +8453,7 @@ function Pd(e, t) {
8442
8453
  u({
8443
8454
  remainingSec: 0,
8444
8455
  uiReveal: !0,
8445
- perQ: { ...l.perQ, [h]: v }
8456
+ perQ: { ...l.perQ, [h]: S }
8446
8457
  });
8447
8458
  } else
8448
8459
  u({ remainingSec: d });
@@ -8467,24 +8478,24 @@ function Gd({ children: e, initialState: t }) {
8467
8478
  if (u.phase !== "doing" && s.phase === "doing" && ((a = r.current) == null || a.call(r)), u.phase !== "finished" && s.phase === "finished") {
8468
8479
  const l = o.current;
8469
8480
  if (!l || !s.retryAllowed && s.previousResult && !s.startedAt) return;
8470
- const { sectionId: d, quizzes: b, order: h, perQ: p, startedAt: v, finishedAt: y } = s, c = h.map((S) => b[S]), g = c.length, f = c.filter((S) => {
8471
- var R;
8472
- return (R = p[S.qid]) == null ? void 0 : R.isCorrect;
8473
- }).length, x = c.reduce((S, R) => S + (R.score ?? 0), 0), C = c.reduce((S, R) => {
8474
- const I = p[R.qid];
8475
- return S + (I != null && I.isCorrect ? R.score ?? 0 : 0);
8476
- }, 0), T = typeof v == "number" && typeof y == "number" ? Math.max(0, y - v) : 0, E = c.map((S) => {
8477
- const R = p[S.qid];
8481
+ const { sectionId: d, quizzes: b, order: h, perQ: p, startedAt: S, finishedAt: y } = s, c = h.map((v) => b[v]), g = c.length, f = c.filter((v) => {
8482
+ var k;
8483
+ return (k = p[v.qid]) == null ? void 0 : k.isCorrect;
8484
+ }).length, x = c.reduce((v, k) => v + (k.score ?? 0), 0), C = c.reduce((v, k) => {
8485
+ const I = p[k.qid];
8486
+ return v + (I != null && I.isCorrect ? k.score ?? 0 : 0);
8487
+ }, 0), T = typeof S == "number" && typeof y == "number" ? Math.max(0, y - S) : 0, E = c.map((v) => {
8488
+ const k = p[v.qid];
8478
8489
  return {
8479
- qid: S.qid,
8480
- index: S.index,
8481
- question: S.question,
8482
- score: S.score ?? 0,
8483
- isCorrect: (R == null ? void 0 : R.isCorrect) ?? !1,
8484
- selected: (R == null ? void 0 : R.selected) ?? [],
8485
- correctIdxes: (R == null ? void 0 : R.correctIdxes) ?? [],
8486
- ms: (R == null ? void 0 : R.ms) ?? 0,
8487
- timedOut: (R == null ? void 0 : R.timedOut) ?? !1
8490
+ qid: v.qid,
8491
+ index: v.index,
8492
+ question: v.question,
8493
+ score: v.score ?? 0,
8494
+ isCorrect: (k == null ? void 0 : k.isCorrect) ?? !1,
8495
+ selected: (k == null ? void 0 : k.selected) ?? [],
8496
+ correctIdxes: (k == null ? void 0 : k.correctIdxes) ?? [],
8497
+ ms: (k == null ? void 0 : k.ms) ?? 0,
8498
+ timedOut: (k == null ? void 0 : k.timedOut) ?? !1
8488
8499
  };
8489
8500
  }), m = {
8490
8501
  sectionId: d ?? "",
@@ -8577,18 +8588,18 @@ function Hd() {
8577
8588
  if (a.scrollY === 0)
8578
8589
  p.setScrollTop(0);
8579
8590
  else if (p.scrollToGIAtOffset) {
8580
- const v = a.anchorGI ?? a.globalIndex;
8581
- if (typeof v == "number") {
8591
+ const S = a.anchorGI ?? a.globalIndex;
8592
+ if (typeof S == "number") {
8582
8593
  const y = a.anchorOffsetRatio ?? 0;
8583
- p.scrollToGIAtOffset(v, y);
8594
+ p.scrollToGIAtOffset(S, y);
8584
8595
  }
8585
8596
  }
8586
8597
  return !0;
8587
8598
  };
8588
8599
  if (!h()) {
8589
8600
  let p = 0;
8590
- const v = setInterval(() => {
8591
- (h() || ++p >= 10) && clearInterval(v);
8601
+ const S = setInterval(() => {
8602
+ (h() || ++p >= 10) && clearInterval(S);
8592
8603
  }, 50);
8593
8604
  }
8594
8605
  }
@@ -8605,12 +8616,12 @@ function Hd() {
8605
8616
  },
8606
8617
  [t, n, o]
8607
8618
  ), s = te(() => {
8608
- var T, E, m, S;
8609
- const a = t.getState(), l = n.getState().progress, d = (T = l.getSectionScrollApi) == null ? void 0 : T.call(l), b = l.currentGlobalRunIndex ?? 0, h = ((E = d == null ? void 0 : d.getScrollTop) == null ? void 0 : E.call(d)) ?? 0, p = ((m = d == null ? void 0 : d.getAnchorOffsetRatio) == null ? void 0 : m.call(d, b)) ?? 0, v = o == null ? void 0 : o.getState(), y = v ? {
8610
- status: v.status,
8611
- currentClip: v.currentClip,
8612
- currentTimeMs: v.currentTimeMs
8613
- } : void 0, { rangeStartGI: c, rangeEndGI: g } = l, f = c != null && g != null ? { startGI: c, endGI: g, text: l.getRangeText() } : null, x = ((S = d == null ? void 0 : d.getScrollRatio) == null ? void 0 : S.call(d)) ?? 0, C = l.translateOpen ? {
8619
+ var T, E, m, v;
8620
+ const a = t.getState(), l = n.getState().progress, d = (T = l.getSectionScrollApi) == null ? void 0 : T.call(l), b = l.currentGlobalRunIndex ?? 0, h = ((E = d == null ? void 0 : d.getScrollTop) == null ? void 0 : E.call(d)) ?? 0, p = ((m = d == null ? void 0 : d.getAnchorOffsetRatio) == null ? void 0 : m.call(d, b)) ?? 0, S = o == null ? void 0 : o.getState(), y = S ? {
8621
+ status: S.status,
8622
+ currentClip: S.currentClip,
8623
+ currentTimeMs: S.currentTimeMs
8624
+ } : void 0, { rangeStartGI: c, rangeEndGI: g } = l, f = c != null && g != null ? { startGI: c, endGI: g, text: l.getRangeText() } : null, x = ((v = d == null ? void 0 : d.getScrollRatio) == null ? void 0 : v.call(d)) ?? 0, C = l.translateOpen ? {
8614
8625
  isOpen: !0,
8615
8626
  isLoading: l.translateLoading,
8616
8627
  text: l.translateText,
@@ -8829,14 +8840,14 @@ const Dd = ({
8829
8840
  const h = e.current;
8830
8841
  if (!h) return;
8831
8842
  let p = !0;
8832
- const v = new ResizeObserver(() => {
8843
+ const S = new ResizeObserver(() => {
8833
8844
  if (p) {
8834
8845
  p = !1;
8835
8846
  return;
8836
8847
  }
8837
8848
  i();
8838
8849
  });
8839
- return v.observe(h), () => v.disconnect();
8850
+ return S.observe(h), () => S.disconnect();
8840
8851
  }, [u, i, e]), he(() => {
8841
8852
  if (!u || n == null || r == null) {
8842
8853
  l(null);
@@ -8851,25 +8862,25 @@ const Dd = ({
8851
8862
  return;
8852
8863
  }
8853
8864
  const T = C.getBoundingClientRect(), E = c.querySelector(`[data-g="${n}"]`), m = E == null ? void 0 : E.getBoundingClientRect();
8854
- let S = (T.left + T.width / 2 - g.left) * x;
8855
- m && (S = ((m.left + T.right) / 2 - g.left) * x);
8856
- const R = 160, I = 50, k = 16, z = 12, A = g.width * x, M = Math.max(
8857
- k + R / 2,
8858
- Math.min(S, A - k - R / 2)
8865
+ let v = (T.left + T.width / 2 - g.left) * x;
8866
+ m && (v = ((m.left + T.right) / 2 - g.left) * x);
8867
+ const k = 160, I = 50, _ = 16, z = 12, A = g.width * x, M = Math.max(
8868
+ _ + k / 2,
8869
+ Math.min(v, A - _ - k / 2)
8859
8870
  ), B = (((m == null ? void 0 : m.top) ?? T.top) - g.top) * x - I - z;
8860
8871
  let G = B;
8861
- B < k && (G = (T.bottom - g.top) * x + z), l({ x: M, y: G });
8872
+ B < _ && (G = (T.bottom - g.top) * x + z), l({ x: M, y: G });
8862
8873
  };
8863
8874
  h();
8864
8875
  const p = e.current;
8865
- let v = 0;
8876
+ let S = 0;
8866
8877
  const y = () => {
8867
- v || (v = requestAnimationFrame(() => {
8868
- v = 0, h();
8878
+ S || (S = requestAnimationFrame(() => {
8879
+ S = 0, h();
8869
8880
  }));
8870
8881
  };
8871
8882
  return p && p.addEventListener("scroll", y, !0), () => {
8872
- v && cancelAnimationFrame(v), p && p.removeEventListener("scroll", y, !0);
8883
+ S && cancelAnimationFrame(S), p && p.removeEventListener("scroll", y, !0);
8873
8884
  };
8874
8885
  }, [u, n, r, e, s]);
8875
8886
  const d = te(() => {
@@ -8955,18 +8966,18 @@ const Dd = ({
8955
8966
  if (!f) return;
8956
8967
  const x = f.getBoundingClientRect(), T = 1 / (o.getState().playbackScale || 1), E = f.querySelector(`[data-g="${t}"]`), m = f.querySelector(`[data-g="${n}"]`);
8957
8968
  if (E) {
8958
- const S = E.getBoundingClientRect();
8969
+ const v = E.getBoundingClientRect();
8959
8970
  u({
8960
- x: (S.left - x.left) * T,
8961
- y: (S.bottom - x.top) * T
8971
+ x: (v.left - x.left) * T,
8972
+ y: (v.bottom - x.top) * T
8962
8973
  });
8963
8974
  } else
8964
8975
  u(null);
8965
8976
  if (m) {
8966
- const S = m.getBoundingClientRect();
8977
+ const v = m.getBoundingClientRect();
8967
8978
  l({
8968
- x: (S.right - x.left) * T,
8969
- y: (S.bottom - x.top) * T
8979
+ x: (v.right - x.left) * T,
8980
+ y: (v.bottom - x.top) * T
8970
8981
  });
8971
8982
  } else
8972
8983
  l(null);
@@ -9003,7 +9014,7 @@ const Dd = ({
9003
9014
  document.removeEventListener("pointermove", c), document.removeEventListener("pointerup", g), document.removeEventListener("pointercancel", g);
9004
9015
  };
9005
9016
  }, [p]);
9006
- const v = te(
9017
+ const S = te(
9007
9018
  (c) => (g) => {
9008
9019
  g.preventDefault(), g.stopPropagation(), d.current = c, uo(!0);
9009
9020
  },
@@ -9019,7 +9030,7 @@ const Dd = ({
9019
9030
  left: s.x - 26,
9020
9031
  top: s.y
9021
9032
  },
9022
- onPointerDown: v("start")
9033
+ onPointerDown: S("start")
9023
9034
  }
9024
9035
  ),
9025
9036
  a && /* @__PURE__ */ w(
@@ -9031,7 +9042,7 @@ const Dd = ({
9031
9042
  left: a.x,
9032
9043
  top: a.y
9033
9044
  },
9034
- onPointerDown: v("end")
9045
+ onPointerDown: S("end")
9035
9046
  }
9036
9047
  )
9037
9048
  ] }) : null;
@@ -9223,18 +9234,18 @@ function e0({
9223
9234
  onViewerEvent: b,
9224
9235
  viewerRef: h,
9225
9236
  gazeSync: p,
9226
- onRequestTranslate: v,
9237
+ onRequestTranslate: S,
9227
9238
  isPlaybackMode: y = !1,
9228
9239
  playbackScale: c,
9229
9240
  isDev: g = !1
9230
9241
  }) {
9231
9242
  const f = String((e == null ? void 0 : e.section_id) ?? "0"), x = Se(() => {
9232
- var R, I;
9233
- const m = ((R = e == null ? void 0 : e.ast) == null ? void 0 : R.blocks) ?? [];
9234
- let S = 0;
9235
- for (const k of m)
9236
- (k == null ? void 0 : k.type) !== "image" && (S += ((I = k == null ? void 0 : k.runs) == null ? void 0 : I.length) ?? 0);
9237
- return S;
9243
+ var k, I;
9244
+ const m = ((k = e == null ? void 0 : e.ast) == null ? void 0 : k.blocks) ?? [];
9245
+ let v = 0;
9246
+ for (const _ of m)
9247
+ (_ == null ? void 0 : _.type) !== "image" && (v += ((I = _ == null ? void 0 : _.runs) == null ? void 0 : I.length) ?? 0);
9248
+ return v;
9238
9249
  }, [e]), C = Se(() => typeof n == "number" ? Ud(n, x > 0 ? 0 : -1, Math.max(x - 1, -1)) : (x > 0, 0), [n, x]), T = Se(
9239
9250
  () => ({
9240
9251
  section: e,
@@ -9246,10 +9257,10 @@ function e0({
9246
9257
  }),
9247
9258
  [e, C, r, o, i, s]
9248
9259
  ), E = Se(() => {
9249
- const m = (e == null ? void 0 : e.audios) ?? [], S = m.length > 0 ? hu(e) : void 0;
9260
+ const m = (e == null ? void 0 : e.audios) ?? [], v = m.length > 0 ? hu(e) : void 0;
9250
9261
  return {
9251
9262
  clips: m,
9252
- map: S,
9263
+ map: v,
9253
9264
  initialIndex: C,
9254
9265
  section: e
9255
9266
  };
@@ -9276,7 +9287,7 @@ function e0({
9276
9287
  quizRetryAllowed: l,
9277
9288
  previousQuizResult: d
9278
9289
  },
9279
- children: /* @__PURE__ */ w(Kd, { onRequestTranslate: v })
9290
+ children: /* @__PURE__ */ w(Kd, { onRequestTranslate: S })
9280
9291
  },
9281
9292
  f
9282
9293
  ) }, f)
@@ -9289,18 +9300,18 @@ function e0({
9289
9300
  function Kd({
9290
9301
  onRequestTranslate: e
9291
9302
  }) {
9292
- const t = K((v) => v.mode), n = oe(null), r = Ct(), o = bt(), i = j((v) => v.translateOpen), s = j((v) => v.translateLoading), u = j((v) => v.translateText), a = j((v) => v.translatedText), l = oe(null), d = te(
9293
- (v) => {
9303
+ const t = K((S) => S.mode), n = oe(null), r = Ct(), o = bt(), i = j((S) => S.translateOpen), s = j((S) => S.translateLoading), u = j((S) => S.translateText), a = j((S) => S.translatedText), l = oe(null), d = te(
9304
+ (S) => {
9294
9305
  var C;
9295
9306
  const { rangeStartGI: y, rangeEndGI: c } = o.getState().progress, g = y ?? 0, f = c ?? 0;
9296
9307
  if (r.getState().emit({
9297
9308
  type: "translate_request",
9298
- payload: { text: v, startGI: g, endGI: f }
9309
+ payload: { text: S, startGI: g, endGI: f }
9299
9310
  }), !e) {
9300
9311
  o.getState().progress.setTranslateState({
9301
9312
  isOpen: !0,
9302
9313
  isLoading: !1,
9303
- text: v,
9314
+ text: S,
9304
9315
  startGI: g,
9305
9316
  endGI: f
9306
9317
  });
@@ -9309,12 +9320,12 @@ function Kd({
9309
9320
  o.getState().progress.setTranslateState({
9310
9321
  isOpen: !0,
9311
9322
  isLoading: !0,
9312
- text: v,
9323
+ text: S,
9313
9324
  startGI: g,
9314
9325
  endGI: f
9315
9326
  }), (C = l.current) == null || C.abort();
9316
9327
  const x = new AbortController();
9317
- l.current = x, e(v, x.signal).then((T) => {
9328
+ l.current = x, e(S, x.signal).then((T) => {
9318
9329
  if (!x.signal.aborted) {
9319
9330
  if (T == null) {
9320
9331
  o.getState().progress.clearTranslate();
@@ -9323,13 +9334,13 @@ function Kd({
9323
9334
  o.getState().progress.setTranslateState({
9324
9335
  isOpen: !0,
9325
9336
  isLoading: !1,
9326
- text: v,
9337
+ text: S,
9327
9338
  translatedText: T,
9328
9339
  startGI: g,
9329
9340
  endGI: f
9330
9341
  }), r.getState().emit({
9331
9342
  type: "translate_loading_end",
9332
- payload: { originalText: v, translatedText: T }
9343
+ payload: { originalText: S, translatedText: T }
9333
9344
  });
9334
9345
  }
9335
9346
  }).catch((T) => {
@@ -9338,7 +9349,7 @@ function Kd({
9338
9349
  o.getState().progress.setTranslateState({
9339
9350
  isOpen: !0,
9340
9351
  isLoading: !1,
9341
- text: v,
9352
+ text: S,
9342
9353
  translatedText: `[오류] ${E}`,
9343
9354
  startGI: g,
9344
9355
  endGI: f
@@ -9347,8 +9358,8 @@ function Kd({
9347
9358
  },
9348
9359
  [r, o, e]
9349
9360
  ), b = te(() => {
9350
- var v;
9351
- (v = l.current) == null || v.abort(), l.current = null, o.getState().progress.clearTranslate(), r.getState().emit({
9361
+ var S;
9362
+ (S = l.current) == null || S.abort(), l.current = null, o.getState().progress.clearTranslate(), r.getState().emit({
9352
9363
  type: "translate_modal_close",
9353
9364
  payload: {}
9354
9365
  });
@@ -9357,11 +9368,11 @@ function Kd({
9357
9368
  "div",
9358
9369
  {
9359
9370
  ref: n,
9360
- onContextMenu: (v) => {
9361
- v.preventDefault();
9371
+ onContextMenu: (S) => {
9372
+ S.preventDefault();
9362
9373
  },
9363
- onDragStart: (v) => {
9364
- v.preventDefault();
9374
+ onDragStart: (S) => {
9375
+ S.preventDefault();
9365
9376
  },
9366
9377
  style: {
9367
9378
  position: "relative",