@readerseye2/cr_viewer 1.0.17 → 1.0.21

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
@@ -3,12 +3,6 @@ var Vi = Object.defineProperty;
3
3
  var qi = (e, t, n) => t in e ? Vi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
4
  var Ar = (e, t, n) => qi(e, typeof t != "symbol" ? t + "" : t, n);
5
5
  import { jsx as x, jsxs as X, Fragment as yt } from "react/jsx-runtime";
6
- import "@fontsource/noto-sans-kr/400.css";
7
- import "@fontsource/noto-sans-kr/700.css";
8
- import "@fontsource/noto-serif-kr/400.css";
9
- import "@fontsource/noto-serif-kr/700.css";
10
- import "@fontsource/nanum-myeongjo/400.css";
11
- import "@fontsource/nanum-myeongjo/700.css";
12
6
  import * as dt from "react";
13
7
  import N, { createContext as Ft, useContext as Ue, useMemo as ve, useLayoutEffect as Tt, useRef as ie, useEffect as Se, useCallback as Z, createElement as hn, memo as Wt, useState as et, useId as ji } from "react";
14
8
  import Ui from "react-dom";
@@ -161,26 +155,26 @@ function Yi() {
161
155
  } else y = m.current;
162
156
  m = c(
163
157
  function() {
164
- function f(_) {
158
+ function f(C) {
165
159
  if (!u) {
166
- if (u = !0, T = _, _ = g(_), b !== void 0 && y.hasValue) {
160
+ if (u = !0, T = C, C = g(C), b !== void 0 && y.hasValue) {
167
161
  var h = y.value;
168
- if (b(h, _))
162
+ if (b(h, C))
169
163
  return k = h;
170
164
  }
171
- return k = _;
165
+ return k = C;
172
166
  }
173
- if (h = k, r(T, _)) return h;
174
- var S = g(_);
175
- return b !== void 0 && b(h, S) ? (T = _, h) : (T = _, k = S);
167
+ if (h = k, r(T, C)) return h;
168
+ var S = g(C);
169
+ return b !== void 0 && b(h, S) ? (T = C, h) : (T = C, k = S);
176
170
  }
177
- var u = !1, T, k, I = v === void 0 ? null : v;
171
+ var u = !1, T, k, R = v === void 0 ? null : v;
178
172
  return [
179
173
  function() {
180
174
  return f(d());
181
175
  },
182
- I === null ? void 0 : function() {
183
- return f(I());
176
+ R === null ? void 0 : function() {
177
+ return f(R());
184
178
  }
185
179
  ];
186
180
  },
@@ -221,27 +215,27 @@ function Xi() {
221
215
  } else y = m.current;
222
216
  m = c(
223
217
  function() {
224
- function f(_) {
218
+ function f(C) {
225
219
  if (!u) {
226
- if (u = !0, T = _, _ = g(_), b !== void 0 && y.hasValue) {
220
+ if (u = !0, T = C, C = g(C), b !== void 0 && y.hasValue) {
227
221
  var h = y.value;
228
- if (b(h, _))
222
+ if (b(h, C))
229
223
  return k = h;
230
224
  }
231
- return k = _;
225
+ return k = C;
232
226
  }
233
- if (h = k, r(T, _))
227
+ if (h = k, r(T, C))
234
228
  return h;
235
- var S = g(_);
236
- return b !== void 0 && b(h, S) ? (T = _, h) : (T = _, k = S);
229
+ var S = g(C);
230
+ return b !== void 0 && b(h, S) ? (T = C, h) : (T = C, k = S);
237
231
  }
238
- var u = !1, T, k, I = v === void 0 ? null : v;
232
+ var u = !1, T, k, R = v === void 0 ? null : v;
239
233
  return [
240
234
  function() {
241
235
  return f(d());
242
236
  },
243
- I === null ? void 0 : function() {
244
- return f(I());
237
+ R === null ? void 0 : function() {
238
+ return f(R());
245
239
  }
246
240
  ];
247
241
  },
@@ -1361,12 +1355,12 @@ const Os = {
1361
1355
  l,
1362
1356
  ce((h) => h.length > 0),
1363
1357
  be(f, y),
1364
- U(([h, S, C]) => {
1365
- const R = h.reduce((O, P, w) => Xe(O, P, Zt(P, S.offsetTree, C) || w), Gt());
1358
+ U(([h, S, I]) => {
1359
+ const _ = h.reduce((O, P, w) => Xe(O, P, Zt(P, S.offsetTree, I) || w), Gt());
1366
1360
  return {
1367
1361
  ...S,
1368
1362
  groupIndices: h,
1369
- groupOffsetTree: R
1363
+ groupOffsetTree: _
1370
1364
  };
1371
1365
  })
1372
1366
  ),
@@ -1376,10 +1370,10 @@ const Os = {
1376
1370
  r,
1377
1371
  be(f),
1378
1372
  ce(([h, { lastIndex: S }]) => h < S),
1379
- U(([h, { lastIndex: S, lastSize: C }]) => [
1373
+ U(([h, { lastIndex: S, lastSize: I }]) => [
1380
1374
  {
1381
1375
  endIndex: S,
1382
- size: C,
1376
+ size: I,
1383
1377
  startIndex: h
1384
1378
  }
1385
1379
  ])
@@ -1398,8 +1392,8 @@ const Os = {
1398
1392
  d,
1399
1393
  ce((h) => h !== void 0 && Ce(Be(f).sizeTree)),
1400
1394
  U((h) => {
1401
- const S = Be(v), C = Be(l).length > 0;
1402
- return S ? C ? [
1395
+ const S = Be(v), I = Be(l).length > 0;
1396
+ return S ? I ? [
1403
1397
  { endIndex: 0, size: S, startIndex: 0 },
1404
1398
  { endIndex: 1, size: h, startIndex: 1 }
1405
1399
  ] : [] : [{ endIndex: 0, size: h, startIndex: 0 }];
@@ -1412,19 +1406,19 @@ const Os = {
1412
1406
  ce((h) => h !== void 0 && h.length > 0 && Ce(Be(f).sizeTree)),
1413
1407
  U((h) => {
1414
1408
  const S = [];
1415
- let C = h[0], R = 0;
1409
+ let I = h[0], _ = 0;
1416
1410
  for (let O = 1; O < h.length; O++) {
1417
1411
  const P = h[O];
1418
- P !== C && (S.push({
1412
+ P !== I && (S.push({
1419
1413
  endIndex: O - 1,
1420
- size: C,
1421
- startIndex: R
1422
- }), C = P, R = O);
1414
+ size: I,
1415
+ startIndex: _
1416
+ }), I = P, _ = O);
1423
1417
  }
1424
1418
  return S.push({
1425
1419
  endIndex: h.length - 1,
1426
- size: C,
1427
- startIndex: R
1420
+ size: I,
1421
+ startIndex: _
1428
1422
  }), S;
1429
1423
  })
1430
1424
  ),
@@ -1434,21 +1428,21 @@ const Os = {
1434
1428
  l,
1435
1429
  be(v, d),
1436
1430
  ce(([, h, S]) => h !== void 0 && S !== void 0),
1437
- U(([h, S, C]) => {
1438
- const R = [];
1431
+ U(([h, S, I]) => {
1432
+ const _ = [];
1439
1433
  for (let O = 0; O < h.length; O++) {
1440
1434
  const P = h[O], w = h[O + 1];
1441
- R.push({
1435
+ _.push({
1442
1436
  startIndex: P,
1443
1437
  endIndex: P,
1444
1438
  size: S
1445
- }), w !== void 0 && R.push({
1439
+ }), w !== void 0 && _.push({
1446
1440
  startIndex: P + 1,
1447
1441
  endIndex: w - 1,
1448
- size: C
1442
+ size: I
1449
1443
  });
1450
1444
  }
1451
- return R;
1445
+ return _;
1452
1446
  })
1453
1447
  ),
1454
1448
  n
@@ -1458,9 +1452,9 @@ const Os = {
1458
1452
  n,
1459
1453
  be(f),
1460
1454
  ht(
1461
- ({ sizes: h }, [S, C]) => ({
1462
- changed: C !== h,
1463
- sizes: C
1455
+ ({ sizes: h }, [S, I]) => ({
1456
+ changed: I !== h,
1457
+ sizes: I
1464
1458
  }),
1465
1459
  { changed: !1, sizes: p }
1466
1460
  ),
@@ -1481,8 +1475,8 @@ const Os = {
1481
1475
  if (h > 0)
1482
1476
  ge(t, !0), ge(i, h + Kr(h, S));
1483
1477
  else if (h < 0) {
1484
- const C = Be(u);
1485
- C.length > 0 && (h -= Kr(-h, C)), ge(s, h);
1478
+ const I = Be(u);
1479
+ I.length > 0 && (h -= Kr(-h, I)), ge(s, h);
1486
1480
  }
1487
1481
  }
1488
1482
  ), Ie(L(c, be(e)), ([h, S]) => {
@@ -1492,23 +1486,23 @@ const Os = {
1492
1486
  Ye.ERROR
1493
1487
  );
1494
1488
  });
1495
- const I = Ze(i);
1489
+ const R = Ze(i);
1496
1490
  te(
1497
1491
  L(
1498
1492
  i,
1499
1493
  be(f),
1500
1494
  U(([h, S]) => {
1501
- const C = S.groupIndices.length > 0, R = [], O = S.lastSize;
1502
- if (C) {
1495
+ const I = S.groupIndices.length > 0, _ = [], O = S.lastSize;
1496
+ if (I) {
1503
1497
  const P = Yt(S.sizeTree, 0);
1504
1498
  let w = 0, E = 0;
1505
1499
  for (; w < h; ) {
1506
1500
  const W = S.groupIndices[E], M = S.groupIndices.length === E + 1 ? 1 / 0 : S.groupIndices[E + 1] - W - 1;
1507
- R.push({
1501
+ _.push({
1508
1502
  endIndex: W,
1509
1503
  size: P,
1510
1504
  startIndex: W
1511
- }), R.push({
1505
+ }), _.push({
1512
1506
  endIndex: W + 1 + M - 1,
1513
1507
  size: O,
1514
1508
  startIndex: W + 1
@@ -1534,7 +1528,7 @@ const Os = {
1534
1528
  {
1535
1529
  prevIndex: h,
1536
1530
  prevSize: 0,
1537
- ranges: R
1531
+ ranges: _
1538
1532
  }
1539
1533
  ).ranges;
1540
1534
  }
@@ -1554,13 +1548,13 @@ const Os = {
1554
1548
  ),
1555
1549
  n
1556
1550
  );
1557
- const _ = Ze(
1551
+ const C = Ze(
1558
1552
  L(
1559
1553
  s,
1560
1554
  be(f, y),
1561
- U(([h, { offsetTree: S }, C]) => {
1562
- const R = -h;
1563
- return Zt(R, S, C);
1555
+ U(([h, { offsetTree: S }, I]) => {
1556
+ const _ = -h;
1557
+ return Zt(_, S, I);
1564
1558
  })
1565
1559
  )
1566
1560
  );
@@ -1568,11 +1562,11 @@ const Os = {
1568
1562
  L(
1569
1563
  s,
1570
1564
  be(f, y),
1571
- U(([h, S, C]) => {
1565
+ U(([h, S, I]) => {
1572
1566
  if (S.groupIndices.length > 0) {
1573
1567
  if (Ce(S.sizeTree))
1574
1568
  return S;
1575
- let R = Gt();
1569
+ let _ = Gt();
1576
1570
  const O = Be(u);
1577
1571
  let P = 0, w = 0, E = 0;
1578
1572
  for (; P < -h; ) {
@@ -1580,30 +1574,30 @@ const Os = {
1580
1574
  const A = O[w + 1] - E - 1;
1581
1575
  w++, P += A + 1;
1582
1576
  }
1583
- if (R = kt(S.sizeTree).reduce((A, { k: W, v: M }) => Xe(A, Math.max(0, W + h), M), R), P !== -h) {
1577
+ if (_ = kt(S.sizeTree).reduce((A, { k: W, v: M }) => Xe(A, Math.max(0, W + h), M), _), P !== -h) {
1584
1578
  const A = Yt(S.sizeTree, E);
1585
- R = Xe(R, 0, A);
1579
+ _ = Xe(_, 0, A);
1586
1580
  const W = ct(S.sizeTree, -h + 1)[1];
1587
- R = Xe(R, 1, W);
1581
+ _ = Xe(_, 1, W);
1588
1582
  }
1589
1583
  return {
1590
1584
  ...S,
1591
- sizeTree: R,
1592
- ...hr(S.offsetTree, 0, R, C)
1585
+ sizeTree: _,
1586
+ ...hr(S.offsetTree, 0, _, I)
1593
1587
  };
1594
1588
  } else {
1595
- const R = kt(S.sizeTree).reduce((O, { k: P, v: w }) => Xe(O, Math.max(0, P + h), w), Gt());
1589
+ const _ = kt(S.sizeTree).reduce((O, { k: P, v: w }) => Xe(O, Math.max(0, P + h), w), Gt());
1596
1590
  return {
1597
1591
  ...S,
1598
- sizeTree: R,
1599
- ...hr(S.offsetTree, 0, R, C)
1592
+ sizeTree: _,
1593
+ ...hr(S.offsetTree, 0, _, I)
1600
1594
  };
1601
1595
  }
1602
1596
  })
1603
1597
  ),
1604
1598
  f
1605
1599
  ), {
1606
- beforeUnshiftWith: I,
1600
+ beforeUnshiftWith: R,
1607
1601
  // input
1608
1602
  data: m,
1609
1603
  defaultItemSize: d,
@@ -1616,7 +1610,7 @@ const Os = {
1616
1610
  itemSize: b,
1617
1611
  listRefresh: k,
1618
1612
  shiftWith: s,
1619
- shiftWithOffset: _,
1613
+ shiftWithOffset: C,
1620
1614
  sizeRanges: n,
1621
1615
  // output
1622
1616
  sizes: f,
@@ -1712,14 +1706,14 @@ const on = xe(
1712
1706
  be(e, i, o),
1713
1707
  U(
1714
1708
  ([
1715
- [k, I, _, h, S, C, R, O],
1709
+ [k, R, C, h, S, I, _, O],
1716
1710
  P,
1717
1711
  w,
1718
1712
  E
1719
1713
  ]) => {
1720
- const A = ci(k), { align: W, behavior: M, offset: B } = A, F = h - 1, V = li(A, I, F);
1721
- let q = Zt(V, I.offsetTree, P) + C;
1722
- W === "end" ? (q += w + ct(I.sizeTree, V)[1] - _ + E, V === F && (q += R)) : W === "center" ? q += (w + ct(I.sizeTree, V)[1] - _ + E) / 2 : q -= S, B && (q += B);
1714
+ const A = ci(k), { align: W, behavior: M, offset: B } = A, F = h - 1, D = li(A, R, F);
1715
+ let q = Zt(D, R.offsetTree, P) + I;
1716
+ W === "end" ? (q += w + ct(R.sizeTree, D)[1] - C + E, D === F && (q += _)) : W === "center" ? q += (w + ct(R.sizeTree, D)[1] - C + E) / 2 : q -= S, B && (q += B);
1723
1717
  const ue = (de) => {
1724
1718
  T(), de ? (O("retrying to scroll to", { location: k }, Ye.DEBUG), ge(b, k)) : (ge(m, !0), O("list did not change, scroll successful", {}, Ye.DEBUG));
1725
1719
  };
@@ -1734,7 +1728,7 @@ const on = xe(
1734
1728
  p = at(L(t, zs(150)), ue);
1735
1729
  return f = setTimeout(() => {
1736
1730
  T();
1737
- }, 1200), ge(l, !0), O("scrolling from index to", { behavior: M, index: V, top: q }, Ye.DEBUG), { behavior: M, top: q };
1731
+ }, 1200), ge(l, !0), O("scrolling from index to", { behavior: M, index: D, top: q }, Ye.DEBUG), { behavior: M, top: q };
1738
1732
  }
1739
1733
  )
1740
1734
  ),
@@ -1845,26 +1839,26 @@ const Jt = "up", Ut = "down", As = "none", Ls = {
1845
1839
  const m = Ze(
1846
1840
  L(
1847
1841
  Fe(r, ae(i), ae(t), ae(e), ae(d)),
1848
- ht((u, [{ scrollHeight: T, scrollTop: k }, I, _, h, S]) => {
1849
- const C = k + I - T > -S, R = {
1842
+ ht((u, [{ scrollHeight: T, scrollTop: k }, R, C, h, S]) => {
1843
+ const I = k + R - T > -S, _ = {
1850
1844
  scrollHeight: T,
1851
1845
  scrollTop: k,
1852
- viewportHeight: I
1846
+ viewportHeight: R
1853
1847
  };
1854
- if (C) {
1848
+ if (I) {
1855
1849
  let P, w;
1856
1850
  return k > u.state.scrollTop ? (P = "SCROLLED_DOWN", w = u.state.scrollTop - k) : (P = "SIZE_DECREASED", w = u.state.scrollTop - k || u.scrollTopDelta), {
1857
1851
  atBottom: !0,
1858
1852
  atBottomBecause: P,
1859
1853
  scrollTopDelta: w,
1860
- state: R
1854
+ state: _
1861
1855
  };
1862
1856
  }
1863
1857
  let O;
1864
- return R.scrollHeight > u.state.scrollHeight ? O = "SIZE_INCREASED" : I < u.state.viewportHeight ? O = "VIEWPORT_HEIGHT_DECREASING" : k < u.state.scrollTop ? O = "SCROLLING_UPWARDS" : O = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1858
+ return _.scrollHeight > u.state.scrollHeight ? O = "SIZE_INCREASED" : R < u.state.viewportHeight ? O = "VIEWPORT_HEIGHT_DECREASING" : k < u.state.scrollTop ? O = "SCROLLING_UPWARDS" : O = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1865
1859
  atBottom: !1,
1866
1860
  notAtBottomBecause: O,
1867
- state: R
1861
+ state: _
1868
1862
  };
1869
1863
  }, Ls),
1870
1864
  Me((u, T) => u && u.atBottom === T.atBottom)
@@ -1873,7 +1867,7 @@ const Jt = "up", Ut = "down", As = "none", Ls = {
1873
1867
  L(
1874
1868
  r,
1875
1869
  ht(
1876
- (u, { scrollHeight: T, scrollTop: k, viewportHeight: I }) => {
1870
+ (u, { scrollHeight: T, scrollTop: k, viewportHeight: R }) => {
1877
1871
  if (ui(u.scrollHeight, T))
1878
1872
  return {
1879
1873
  changed: !1,
@@ -1882,8 +1876,8 @@ const Jt = "up", Ut = "down", As = "none", Ls = {
1882
1876
  scrollTop: k
1883
1877
  };
1884
1878
  {
1885
- const _ = T - (k + I) < 1;
1886
- return u.scrollTop !== k && _ ? {
1879
+ const C = T - (k + R) < 1;
1880
+ return u.scrollTop !== k && C ? {
1887
1881
  changed: !0,
1888
1882
  jump: u.scrollTop - k,
1889
1883
  scrollHeight: T,
@@ -1990,12 +1984,12 @@ const kr = xe(
1990
1984
  u,
1991
1985
  T
1992
1986
  ]) => {
1993
- const k = d - u, I = p + f, _ = Math.max(g - k, 0);
1987
+ const k = d - u, R = p + f, C = Math.max(g - k, 0);
1994
1988
  let h = Qr;
1995
- const S = Xr(T, en), C = Xr(T, tn);
1996
- return b -= u, b += g + f, m += g + f, m -= u, b > d + I - S && (h = Jt), m < d - _ + v + C && (h = Ut), h !== Qr ? [
1989
+ const S = Xr(T, en), I = Xr(T, tn);
1990
+ return b -= u, b += g + f, m += g + f, m -= u, b > d + R - S && (h = Jt), m < d - C + v + I && (h = Ut), h !== Qr ? [
1997
1991
  Math.max(k - g - Yr(y, en, h) - S, 0),
1998
- k - _ - f + v + Yr(y, tn, h) + C
1992
+ k - C - f + v + Yr(y, tn, h) + I
1999
1993
  ] : null;
2000
1994
  }
2001
1995
  ),
@@ -2134,8 +2128,8 @@ const Pt = xe(
2134
2128
  ae(u),
2135
2129
  e
2136
2130
  ),
2137
- ce(([h, S, , C, , , , , , , , R]) => {
2138
- const O = R && R.length !== C;
2131
+ ce(([h, S, , I, , , , , , , , _]) => {
2132
+ const O = _ && _.length !== I;
2139
2133
  return h && !S && !O;
2140
2134
  }),
2141
2135
  U(
@@ -2143,8 +2137,8 @@ const Pt = xe(
2143
2137
  ,
2144
2138
  ,
2145
2139
  [h, S],
2146
- C,
2147
- R,
2140
+ I,
2141
+ _,
2148
2142
  O,
2149
2143
  P,
2150
2144
  w,
@@ -2153,37 +2147,37 @@ const Pt = xe(
2153
2147
  W,
2154
2148
  M
2155
2149
  ]) => {
2156
- var B, F, V, q;
2157
- const ue = R, { offsetTree: de, sizeTree: ke } = ue, Re = Be(p);
2158
- if (C === 0)
2159
- return { ...Wn, totalCount: C };
2150
+ var B, F, D, q;
2151
+ const ue = _, { offsetTree: de, sizeTree: ke } = ue, Re = Be(p);
2152
+ if (I === 0)
2153
+ return { ...Wn, totalCount: I };
2160
2154
  if (h === 0 && S === 0)
2161
- return Re === 0 ? { ...Wn, totalCount: C } : di(Re, O, R, E, A, M || []);
2155
+ return Re === 0 ? { ...Wn, totalCount: I } : di(Re, O, _, E, A, M || []);
2162
2156
  if (Ce(ke))
2163
2157
  return Re > 0 ? null : mn(
2164
- Hs(Tr(O, C), ue, M),
2158
+ Hs(Tr(O, I), ue, M),
2165
2159
  [],
2166
- C,
2160
+ I,
2167
2161
  A,
2168
2162
  ue,
2169
2163
  E
2170
2164
  );
2171
2165
  const ee = [];
2172
2166
  if (w.length > 0) {
2173
- const $ = w[0], J = w[w.length - 1];
2167
+ const V = w[0], J = w[w.length - 1];
2174
2168
  let se = 0;
2175
- for (const re of Ht(ke, $, J)) {
2176
- const pe = re.value, le = Math.max(re.start, $), we = Math.min(re.end, J);
2169
+ for (const re of Ht(ke, V, J)) {
2170
+ const pe = re.value, le = Math.max(re.start, V), we = Math.min(re.end, J);
2177
2171
  for (let me = le; me <= we; me++)
2178
2172
  ee.push({ data: M == null ? void 0 : M[me], index: me, offset: se, size: pe }), se += pe;
2179
2173
  }
2180
2174
  }
2181
2175
  if (!P)
2182
- return mn([], ee, C, A, ue, E);
2176
+ return mn([], ee, I, A, ue, E);
2183
2177
  const Q = w.length > 0 ? w[w.length - 1] + 1 : 0, z = ks(de, h, S, Q);
2184
2178
  if (z.length === 0)
2185
2179
  return null;
2186
- const K = C - 1, ne = _n([], ($) => {
2180
+ const K = I - 1, ne = _n([], (V) => {
2187
2181
  for (const J of z) {
2188
2182
  const se = J.value;
2189
2183
  let re = se.offset, pe = J.start;
@@ -2196,16 +2190,16 @@ const Pt = xe(
2196
2190
  pe < Q && (re += (Q - pe) * le, pe = Q);
2197
2191
  const we = Math.min(J.end, K);
2198
2192
  for (let me = pe; me <= we && !(re >= S); me++)
2199
- $.push({ data: M == null ? void 0 : M[me], index: me, offset: re, size: le }), re += le + A;
2193
+ V.push({ data: M == null ? void 0 : M[me], index: me, offset: re, size: le }), re += le + A;
2200
2194
  }
2201
2195
  }), H = Jr(W, en), oe = Jr(W, tn);
2202
2196
  if (ne.length > 0 && (H > 0 || oe > 0)) {
2203
- const $ = ne[0], J = ne[ne.length - 1];
2204
- if (H > 0 && $.index > Q) {
2205
- const se = Math.min(H, $.index - Q), re = [];
2206
- let pe = $.offset;
2207
- for (let le = $.index - 1; le >= $.index - se; le--) {
2208
- const we = (F = (B = Ht(ke, le, le)[0]) == null ? void 0 : B.value) != null ? F : $.size;
2197
+ const V = ne[0], J = ne[ne.length - 1];
2198
+ if (H > 0 && V.index > Q) {
2199
+ const se = Math.min(H, V.index - Q), re = [];
2200
+ let pe = V.offset;
2201
+ for (let le = V.index - 1; le >= V.index - se; le--) {
2202
+ const we = (F = (B = Ht(ke, le, le)[0]) == null ? void 0 : B.value) != null ? F : V.size;
2209
2203
  pe -= we + A, re.unshift({ data: M == null ? void 0 : M[le], index: le, offset: pe, size: we });
2210
2204
  }
2211
2205
  ne.unshift(...re);
@@ -2214,12 +2208,12 @@ const Pt = xe(
2214
2208
  const se = Math.min(oe, K - J.index);
2215
2209
  let re = J.offset + J.size + A;
2216
2210
  for (let pe = J.index + 1; pe <= J.index + se; pe++) {
2217
- const le = (q = (V = Ht(ke, pe, pe)[0]) == null ? void 0 : V.value) != null ? q : J.size;
2211
+ const le = (q = (D = Ht(ke, pe, pe)[0]) == null ? void 0 : D.value) != null ? q : J.size;
2218
2212
  ne.push({ data: M == null ? void 0 : M[pe], index: pe, offset: re, size: le }), re += le + A;
2219
2213
  }
2220
2214
  }
2221
2215
  }
2222
- return mn(ne, ee, C, A, ue, E);
2216
+ return mn(ne, ee, I, A, ue, E);
2223
2217
  }
2224
2218
  ),
2225
2219
  //@ts-expect-error filter needs to be fixed
@@ -2264,7 +2258,7 @@ const Pt = xe(
2264
2258
  Me(Xt),
2265
2259
  U(([h]) => h)
2266
2260
  )
2267
- ), I = Ze(
2261
+ ), R = Ze(
2268
2262
  L(
2269
2263
  T,
2270
2264
  mt(200),
@@ -2272,18 +2266,18 @@ const Pt = xe(
2272
2266
  U(({ items: h }) => h[0].index),
2273
2267
  Me()
2274
2268
  )
2275
- ), _ = Ze(
2269
+ ), C = Ze(
2276
2270
  L(
2277
2271
  T,
2278
2272
  ce(({ items: h }) => h.length > 0),
2279
2273
  U(({ items: h }) => {
2280
- let S = 0, C = h.length - 1;
2281
- for (; h[S].type === "group" && S < C; )
2274
+ let S = 0, I = h.length - 1;
2275
+ for (; h[S].type === "group" && S < I; )
2282
2276
  S++;
2283
- for (; h[C].type === "group" && C > S; )
2284
- C--;
2277
+ for (; h[I].type === "group" && I > S; )
2278
+ I--;
2285
2279
  return {
2286
- endIndex: h[C].index,
2280
+ endIndex: h[I].index,
2287
2281
  startIndex: h[S].index
2288
2282
  };
2289
2283
  }),
@@ -2296,8 +2290,8 @@ const Pt = xe(
2296
2290
  itemsRendered: f,
2297
2291
  listState: T,
2298
2292
  minOverscanItemCount: u,
2299
- rangeChanged: _,
2300
- startReached: I,
2293
+ rangeChanged: C,
2294
+ startReached: R,
2301
2295
  topItemsIndexes: y,
2302
2296
  ...g
2303
2297
  };
@@ -2363,10 +2357,10 @@ const Pt = xe(
2363
2357
  be(t, l, n, i, o, r, c),
2364
2358
  be(e),
2365
2359
  U(([[v, g, b, m, y, p, f, u], T]) => {
2366
- const { align: k, behavior: I, calculateViewLocation: _ = Fs, done: h, ...S } = v, C = li(v, g, m - 1), R = Zt(C, g.offsetTree, T) + y + p, O = R + ct(g.sizeTree, C)[1], P = u + p, w = u + b - f, E = _({
2360
+ const { align: k, behavior: R, calculateViewLocation: C = Fs, done: h, ...S } = v, I = li(v, g, m - 1), _ = Zt(I, g.offsetTree, T) + y + p, O = _ + ct(g.sizeTree, I)[1], P = u + p, w = u + b - f, E = C({
2367
2361
  itemBottom: O,
2368
- itemTop: R,
2369
- locationParams: { align: k, behavior: I, ...S },
2362
+ itemTop: _,
2363
+ locationParams: { align: k, behavior: R, ...S },
2370
2364
  viewportBottom: w,
2371
2365
  viewportTop: P
2372
2366
  });
@@ -2408,10 +2402,10 @@ const Ws = (e, t) => typeof e == "function" ? eo(e(t)) : t && eo(e), Ds = xe(
2408
2402
  ]) => {
2409
2403
  const m = G(!1), y = ye();
2410
2404
  let p = null;
2411
- function f(I) {
2405
+ function f(R) {
2412
2406
  ge(s, {
2413
2407
  align: "end",
2414
- behavior: I,
2408
+ behavior: R,
2415
2409
  index: "LAST"
2416
2410
  });
2417
2411
  }
@@ -2419,53 +2413,53 @@ const Ws = (e, t) => typeof e == "function" ? eo(e(t)) : t && eo(e), Ds = xe(
2419
2413
  L(
2420
2414
  Fe(L(ae(t), _t(1)), l),
2421
2415
  be(ae(m), i, c, v),
2422
- U(([[I, _], h, S, C, R]) => {
2423
- let O = _ && C, P = "auto";
2424
- return O && (P = Ws(h, S || R), O = O && !!P), { followOutputBehavior: P, shouldFollow: O, totalCount: I };
2416
+ U(([[R, C], h, S, I, _]) => {
2417
+ let O = C && I, P = "auto";
2418
+ return O && (P = Ws(h, S || _), O = O && !!P), { followOutputBehavior: P, shouldFollow: O, totalCount: R };
2425
2419
  }),
2426
- ce(({ shouldFollow: I }) => I)
2420
+ ce(({ shouldFollow: R }) => R)
2427
2421
  ),
2428
- ({ followOutputBehavior: I, totalCount: _ }) => {
2422
+ ({ followOutputBehavior: R, totalCount: C }) => {
2429
2423
  p && (p(), p = null), Be(n) ? requestAnimationFrame(() => {
2430
- Be(d)("following output to ", { totalCount: _ }, Ye.DEBUG), f(I);
2424
+ Be(d)("following output to ", { totalCount: C }, Ye.DEBUG), f(R);
2431
2425
  }) : p = at(e, () => {
2432
- Be(d)("following output to ", { totalCount: _ }, Ye.DEBUG), f(I), p = null;
2426
+ Be(d)("following output to ", { totalCount: C }, Ye.DEBUG), f(R), p = null;
2433
2427
  });
2434
2428
  }
2435
2429
  );
2436
- function u(I) {
2437
- const _ = at(o, (h) => {
2438
- I && !h.atBottom && h.notAtBottomBecause === "SIZE_INCREASED" && !p && (Be(d)("scrolling to bottom due to increased size", {}, Ye.DEBUG), f("auto"));
2430
+ function u(R) {
2431
+ const C = at(o, (h) => {
2432
+ R && !h.atBottom && h.notAtBottomBecause === "SIZE_INCREASED" && !p && (Be(d)("scrolling to bottom due to increased size", {}, Ye.DEBUG), f("auto"));
2439
2433
  });
2440
- setTimeout(_, 100);
2434
+ setTimeout(C, 100);
2441
2435
  }
2442
2436
  Ie(
2443
2437
  L(
2444
2438
  Fe(ae(m), t, a),
2445
- ce(([I, , _]) => I && _),
2439
+ ce(([R, , C]) => R && C),
2446
2440
  ht(
2447
- ({ value: I }, [, _]) => ({ refreshed: I === _, value: _ }),
2441
+ ({ value: R }, [, C]) => ({ refreshed: R === C, value: C }),
2448
2442
  { refreshed: !1, value: 0 }
2449
2443
  ),
2450
- ce(({ refreshed: I }) => I),
2444
+ ce(({ refreshed: R }) => R),
2451
2445
  be(m, t)
2452
2446
  ),
2453
- ([, I]) => {
2454
- Be(c) && u(I !== !1);
2447
+ ([, R]) => {
2448
+ Be(c) && u(R !== !1);
2455
2449
  }
2456
2450
  ), Ie(y, () => {
2457
2451
  u(Be(m) !== !1);
2458
- }), Ie(Fe(ae(m), o), ([I, _]) => {
2459
- I && !_.atBottom && _.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && f("auto");
2452
+ }), Ie(Fe(ae(m), o), ([R, C]) => {
2453
+ R && !C.atBottom && C.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && f("auto");
2460
2454
  });
2461
2455
  const T = G(null), k = ye();
2462
2456
  return te(
2463
2457
  ur(
2464
2458
  L(
2465
2459
  ae(r),
2466
- U((I) => {
2467
- var _;
2468
- return (_ = I == null ? void 0 : I.length) != null ? _ : 0;
2460
+ U((R) => {
2461
+ var C;
2462
+ return (C = R == null ? void 0 : R.length) != null ? C : 0;
2469
2463
  })
2470
2464
  ),
2471
2465
  L(ae(t))
@@ -2475,15 +2469,15 @@ const Ws = (e, t) => typeof e == "function" ? eo(e(t)) : t && eo(e), Ds = xe(
2475
2469
  L(
2476
2470
  Fe(L(k, _t(1)), l),
2477
2471
  be(ae(T), c, v, g),
2478
- U(([[I, _], h, S, C, R]) => _ && S && (h == null ? void 0 : h({ context: R, totalCount: I, scrollingInProgress: C }))),
2479
- ce((I) => !!I),
2472
+ U(([[R, C], h, S, I, _]) => C && S && (h == null ? void 0 : h({ context: _, totalCount: R, scrollingInProgress: I }))),
2473
+ ce((R) => !!R),
2480
2474
  mt(0)
2481
2475
  ),
2482
- (I) => {
2476
+ (R) => {
2483
2477
  p && (p(), p = null), Be(n) ? requestAnimationFrame(() => {
2484
- Be(d)("scrolling into view", {}), ge(b, I);
2478
+ Be(d)("scrolling into view", {}), ge(b, R);
2485
2479
  }) : p = at(e, () => {
2486
- Be(d)("scrolling into view", {}), ge(b, I), p = null;
2480
+ Be(d)("scrolling into view", {}), ge(b, R), p = null;
2487
2481
  });
2488
2482
  }
2489
2483
  ), { autoscrollToBottom: y, followOutput: m, scrollIntoViewOnChange: T };
@@ -2669,10 +2663,10 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2669
2663
  l,
2670
2664
  be(s),
2671
2665
  ht(
2672
- ([, f, u, T], [{ bottom: k, items: I, offsetBottom: _, totalCount: h }, S]) => {
2673
- const C = k + _;
2674
- let R = 0;
2675
- return u === h && f.length > 0 && I.length > 0 && (I[0].originalIndex === 0 && f[0].originalIndex === 0 || (R = C - T, R !== 0 && (R += S))), [R, I, h, C];
2666
+ ([, f, u, T], [{ bottom: k, items: R, offsetBottom: C, totalCount: h }, S]) => {
2667
+ const I = k + C;
2668
+ let _ = 0;
2669
+ return u === h && f.length > 0 && R.length > 0 && (R[0].originalIndex === 0 && f[0].originalIndex === 0 || (_ = I - T, _ !== 0 && (_ += S))), [_, R, h, I];
2676
2670
  },
2677
2671
  [0, [], 0, 0]
2678
2672
  ),
@@ -2705,20 +2699,20 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2705
2699
  L(
2706
2700
  a,
2707
2701
  be(g, d),
2708
- U(([f, { groupIndices: u, lastSize: T, sizeTree: k }, I]) => {
2709
- function _(h) {
2710
- return h * (T + I);
2702
+ U(([f, { groupIndices: u, lastSize: T, sizeTree: k }, R]) => {
2703
+ function C(h) {
2704
+ return h * (T + R);
2711
2705
  }
2712
2706
  if (u.length === 0)
2713
- return _(f);
2707
+ return C(f);
2714
2708
  {
2715
2709
  let h = 0;
2716
2710
  const S = Yt(k, 0);
2717
- let C = 0, R = 0;
2718
- for (; C < f; ) {
2719
- C++, h += S;
2720
- let O = u.length === R + 1 ? 1 / 0 : u[R + 1] - u[R] - 1;
2721
- C + O > f && (h -= S, O = f - C + 1), C += O, h += _(O), R++;
2711
+ let I = 0, _ = 0;
2712
+ for (; I < f; ) {
2713
+ I++, h += S;
2714
+ let O = u.length === _ + 1 ? 1 / 0 : u[_ + 1] - u[_] - 1;
2715
+ I + O > f && (h -= S, O = f - I + 1), I += O, h += C(O), _++;
2722
2716
  }
2723
2717
  return h;
2724
2718
  }
@@ -2796,16 +2790,16 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2796
2790
  u,
2797
2791
  T,
2798
2792
  k,
2799
- { scrollToIndex: I },
2800
- _,
2793
+ { scrollToIndex: R },
2794
+ C,
2801
2795
  { topItemCount: h },
2802
2796
  { groupCounts: S },
2803
- C
2797
+ I
2804
2798
  ]) => {
2805
- const { listState: R, minOverscanItemCount: O, topItemsIndexes: P, rangeChanged: w, ...E } = k;
2806
- return te(w, C.scrollSeekRangeChanged), te(
2799
+ const { listState: _, minOverscanItemCount: O, topItemsIndexes: P, rangeChanged: w, ...E } = k;
2800
+ return te(w, I.scrollSeekRangeChanged), te(
2807
2801
  L(
2808
- C.windowViewportRect,
2802
+ I.windowViewportRect,
2809
2803
  U((A) => A.visibleHeight)
2810
2804
  ),
2811
2805
  f.viewportHeight
@@ -2829,9 +2823,9 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2829
2823
  ...T,
2830
2824
  groupIndices: s,
2831
2825
  itemSize: l,
2832
- listState: R,
2826
+ listState: _,
2833
2827
  minOverscanItemCount: O,
2834
- scrollToIndex: I,
2828
+ scrollToIndex: R,
2835
2829
  // output
2836
2830
  statefulTotalCount: v,
2837
2831
  trackItemSizes: b,
@@ -2839,7 +2833,7 @@ const Ks = mi(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2839
2833
  rangeChanged: w,
2840
2834
  ...E,
2841
2835
  // the bag of IO from featureGroup1System
2842
- ...C,
2836
+ ...I,
2843
2837
  ...f,
2844
2838
  sizes: d,
2845
2839
  ...u
@@ -2897,18 +2891,18 @@ function vi(e, t, n) {
2897
2891
  const v = N.forwardRef((p, f) => {
2898
2892
  const { children: u, ...T } = p, [k] = N.useState(() => _n(gs(e), (h) => {
2899
2893
  l(h, T);
2900
- })), [I] = N.useState(Vr(d, k));
2894
+ })), [R] = N.useState(Vr(d, k));
2901
2895
  dn(() => {
2902
2896
  for (const h of s)
2903
- h in T && Ie(I[h], T[h]);
2897
+ h in T && Ie(R[h], T[h]);
2904
2898
  return () => {
2905
- Object.values(I).map(yr);
2899
+ Object.values(R).map(yr);
2906
2900
  };
2907
- }, [T, I, k]), dn(() => {
2901
+ }, [T, R, k]), dn(() => {
2908
2902
  l(k, T);
2909
2903
  }), N.useImperativeHandle(f, $r(a(k)));
2910
- const _ = n;
2911
- return /* @__PURE__ */ x(c.Provider, { value: k, children: n ? /* @__PURE__ */ x(_, { ...Xs([...r, ...o, ...s], T), children: u }) : u });
2904
+ const C = n;
2905
+ return /* @__PURE__ */ x(c.Provider, { value: k, children: n ? /* @__PURE__ */ x(C, { ...Xs([...r, ...o, ...s], T), children: u }) : u });
2912
2906
  }), g = (p) => {
2913
2907
  const f = N.useContext(c);
2914
2908
  return N.useCallback(
@@ -3057,7 +3051,7 @@ const Js = /* @__PURE__ */ xe(() => {
3057
3051
  Er("deviation", (E) => {
3058
3052
  f !== E && u(E);
3059
3053
  });
3060
- const T = fe("EmptyPlaceholder"), k = fe("ScrollSeekPlaceholder") || tl, I = fe("ListComponent"), _ = fe("ItemComponent"), h = fe("GroupComponent"), S = fe("computeItemKey"), C = fe("isSeeking"), R = fe("groupIndices").length > 0, O = fe("alignToBottom"), P = fe("initialItemFinalLocationReached"), w = e ? {} : {
3054
+ const T = fe("EmptyPlaceholder"), k = fe("ScrollSeekPlaceholder") || tl, R = fe("ListComponent"), C = fe("ItemComponent"), h = fe("GroupComponent"), S = fe("computeItemKey"), I = fe("isSeeking"), _ = fe("groupIndices").length > 0, O = fe("alignToBottom"), P = fe("initialItemFinalLocationReached"), w = e ? {} : {
3061
3055
  boxSizing: "border-box",
3062
3056
  ...y ? {
3063
3057
  display: "inline-block",
@@ -3074,15 +3068,15 @@ const Js = /* @__PURE__ */ xe(() => {
3074
3068
  ...P ? {} : { visibility: "hidden" }
3075
3069
  };
3076
3070
  return !e && t.totalCount === 0 && T ? /* @__PURE__ */ x(T, { ...qe(T, a) }) : /* @__PURE__ */ x(
3077
- I,
3071
+ R,
3078
3072
  {
3079
- ...qe(I, a),
3073
+ ...qe(R, a),
3080
3074
  "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
3081
3075
  ref: p,
3082
3076
  style: w,
3083
3077
  children: (e ? t.topItems : t.items).map((E) => {
3084
3078
  const A = E.originalIndex, W = S(A + t.firstItemIndex, E.data, a);
3085
- return C ? /* @__PURE__ */ hn(
3079
+ return I ? /* @__PURE__ */ hn(
3086
3080
  k,
3087
3081
  {
3088
3082
  ...qe(k, a),
@@ -3104,10 +3098,10 @@ const Js = /* @__PURE__ */ xe(() => {
3104
3098
  },
3105
3099
  d(E.index, a)
3106
3100
  ) : /* @__PURE__ */ hn(
3107
- _,
3101
+ C,
3108
3102
  {
3109
- ...qe(_, a),
3110
- ...ll(_, E.data),
3103
+ ...qe(C, a),
3104
+ ...ll(C, E.data),
3111
3105
  "data-index": A,
3112
3106
  "data-item-group-index": E.groupIndex,
3113
3107
  "data-item-index": E.index,
@@ -3115,7 +3109,7 @@ const Js = /* @__PURE__ */ xe(() => {
3115
3109
  key: W,
3116
3110
  style: y ? rl : Ii
3117
3111
  },
3118
- R ? l(E.index, E.groupIndex, E.data, a) : l(E.index, E.data, a)
3112
+ _ ? l(E.index, E.groupIndex, E.data, a) : l(E.index, E.data, a)
3119
3113
  );
3120
3114
  })
3121
3115
  }
@@ -3402,9 +3396,9 @@ const wl = /* @__PURE__ */ xe(
3402
3396
  b,
3403
3397
  { didMount: m, propsReady: y },
3404
3398
  { customScrollParent: p, useWindowScroll: f, windowScrollContainerState: u, windowScrollTo: T, windowViewportRect: k },
3405
- I
3399
+ R
3406
3400
  ]) => {
3407
- const _ = G(0), h = G(0), S = G(ro), C = G({ height: 0, width: 0 }), R = G({ height: 0, width: 0 }), O = ye(), P = ye(), w = G(0), E = G(null), A = G({ column: 0, row: 0 }), W = ye(), M = ye(), B = G(!1), F = G(0), V = G(!0), q = G(!1), ue = G(!1);
3401
+ const C = G(0), h = G(0), S = G(ro), I = G({ height: 0, width: 0 }), _ = G({ height: 0, width: 0 }), O = ye(), P = ye(), w = G(0), E = G(null), A = G({ column: 0, row: 0 }), W = ye(), M = ye(), B = G(!1), F = G(0), D = G(!0), q = G(!1), ue = G(!1);
3408
3402
  Ie(
3409
3403
  L(
3410
3404
  m,
@@ -3412,18 +3406,18 @@ const wl = /* @__PURE__ */ xe(
3412
3406
  ce(([z, K]) => !!K)
3413
3407
  ),
3414
3408
  () => {
3415
- ge(V, !1);
3409
+ ge(D, !1);
3416
3410
  }
3417
3411
  ), Ie(
3418
3412
  L(
3419
- Fe(m, V, R, C, F, q),
3413
+ Fe(m, D, _, I, F, q),
3420
3414
  ce(([z, K, ne, H, , oe]) => z && !K && ne.height !== 0 && H.height !== 0 && !oe)
3421
3415
  ),
3422
3416
  ([, , , , z]) => {
3423
3417
  ge(q, !0), Cr(1, () => {
3424
3418
  ge(O, z);
3425
3419
  }), at(L(a), () => {
3426
- ge(t, [0, 0]), ge(V, !0);
3420
+ ge(t, [0, 0]), ge(D, !0);
3427
3421
  });
3428
3422
  }
3429
3423
  ), te(
@@ -3440,21 +3434,21 @@ const wl = /* @__PURE__ */ xe(
3440
3434
  ce(([, z]) => z != null)
3441
3435
  ),
3442
3436
  ([, z]) => {
3443
- z && (ge(C, z.viewport), ge(R, z.item), ge(A, z.gap), z.scrollTop > 0 && (ge(B, !0), at(L(a, _t(1)), (K) => {
3437
+ z && (ge(I, z.viewport), ge(_, z.item), ge(A, z.gap), z.scrollTop > 0 && (ge(B, !0), at(L(a, _t(1)), (K) => {
3444
3438
  ge(B, !1);
3445
3439
  }), ge(l, { top: z.scrollTop })));
3446
3440
  }
3447
3441
  ), te(
3448
3442
  L(
3449
- C,
3443
+ I,
3450
3444
  U(({ height: z }) => z)
3451
3445
  ),
3452
3446
  v
3453
3447
  ), te(
3454
3448
  L(
3455
3449
  Fe(
3456
- ae(C, fn),
3457
- ae(R, fn),
3450
+ ae(I, fn),
3451
+ ae(_, fn),
3458
3452
  ae(A, (z, K) => z && z.column === K.column && z.row === K.row),
3459
3453
  ae(a)
3460
3454
  ),
@@ -3469,15 +3463,15 @@ const wl = /* @__PURE__ */ xe(
3469
3463
  ), te(
3470
3464
  L(
3471
3465
  Fe(
3472
- ae(_),
3466
+ ae(C),
3473
3467
  r,
3474
3468
  ae(A, xl),
3475
- ae(R, fn),
3476
- ae(C, fn),
3469
+ ae(_, fn),
3470
+ ae(I, fn),
3477
3471
  ae(E),
3478
3472
  ae(h),
3479
3473
  ae(B),
3480
- ae(V),
3474
+ ae(D),
3481
3475
  ae(F)
3482
3476
  ),
3483
3477
  ce(([, , , , , , , z]) => !z),
@@ -3487,14 +3481,14 @@ const wl = /* @__PURE__ */ xe(
3487
3481
  [K, ne],
3488
3482
  H,
3489
3483
  oe,
3490
- $,
3484
+ V,
3491
3485
  J,
3492
3486
  se,
3493
3487
  ,
3494
3488
  re,
3495
3489
  pe
3496
3490
  ]) => {
3497
- const { column: le, row: we } = H, { height: me, width: Te } = oe, { width: Oe } = $;
3491
+ const { column: le, row: we } = H, { height: me, width: Te } = oe, { width: Oe } = V;
3498
3492
  if (se === 0 && (z === 0 || Oe === 0))
3499
3493
  return ro;
3500
3494
  if (Te === 0) {
@@ -3504,7 +3498,7 @@ const wl = /* @__PURE__ */ xe(
3504
3498
  const Ne = ki(Oe, Te, le);
3505
3499
  let Le, $e;
3506
3500
  re ? K === 0 && ne === 0 && se > 0 ? (Le = 0, $e = se - 1) : (Le = Ne * Sn((K + we) / (me + we)), $e = Ne * oo((ne + we) / (me + we)) - 1, $e = Vn(z - 1, Kt($e, Ne - 1)), Le = Vn($e, Kt(0, Le))) : (Le = 0, $e = -1);
3507
- const ut = so(Le, $e, J), { bottom: Qe, top: He } = lo($, H, oe, ut), ot = oo(z / Ne), Je = ot * me + (ot - 1) * we - Qe;
3501
+ const ut = so(Le, $e, J), { bottom: Qe, top: He } = lo(V, H, oe, ut), ot = oo(z / Ne), Je = ot * me + (ot - 1) * we - Qe;
3508
3502
  return { bottom: Qe, itemHeight: me, items: ut, itemWidth: Te, offsetBottom: Je, offsetTop: He, top: He };
3509
3503
  }
3510
3504
  )
@@ -3516,14 +3510,14 @@ const wl = /* @__PURE__ */ xe(
3516
3510
  ce((z) => z !== null),
3517
3511
  U((z) => z.length)
3518
3512
  ),
3519
- _
3513
+ C
3520
3514
  ), te(
3521
3515
  L(
3522
- Fe(C, R, S, A),
3516
+ Fe(I, _, S, A),
3523
3517
  ce(([z, K, { items: ne }]) => ne.length > 0 && K.height !== 0 && z.height !== 0),
3524
3518
  U(([z, K, { items: ne }, H]) => {
3525
- const { bottom: oe, top: $ } = lo(z, H, K, ne);
3526
- return [$, oe];
3519
+ const { bottom: oe, top: V } = lo(z, H, K, ne);
3520
+ return [V, oe];
3527
3521
  }),
3528
3522
  Me(Xt)
3529
3523
  ),
@@ -3540,7 +3534,7 @@ const wl = /* @__PURE__ */ xe(
3540
3534
  );
3541
3535
  const ke = Ze(
3542
3536
  L(
3543
- Fe(S, _),
3537
+ Fe(S, C),
3544
3538
  ce(([{ items: z }]) => z.length > 0),
3545
3539
  be(de),
3546
3540
  ce(([[z, K], ne]) => {
@@ -3573,10 +3567,10 @@ const wl = /* @__PURE__ */ xe(
3573
3567
  te(ee, b.scrollSeekRangeChanged), te(
3574
3568
  L(
3575
3569
  O,
3576
- be(C, R, _, A),
3570
+ be(I, _, C, A),
3577
3571
  U(([z, K, ne, H, oe]) => {
3578
- const $ = ci(z), { align: J, behavior: se, offset: re } = $;
3579
- let pe = $.index;
3572
+ const V = ci(z), { align: J, behavior: se, offset: re } = V;
3573
+ let pe = V.index;
3580
3574
  pe === "LAST" && (pe = H - 1), pe = Kt(0, pe, Vn(H - 1, pe));
3581
3575
  let le = gr(K, oe, ne, pe);
3582
3576
  return J === "end" ? le = io(le - K.height + ne.height) : J === "center" && (le = io(le - K.height / 2 + ne.height / 2)), re && (le += re), { behavior: se, top: le };
@@ -3596,7 +3590,7 @@ const wl = /* @__PURE__ */ xe(
3596
3590
  k,
3597
3591
  U((z) => ({ height: z.visibleHeight, width: z.visibleWidth }))
3598
3592
  ),
3599
- C
3593
+ I
3600
3594
  ), {
3601
3595
  customScrollParent: p,
3602
3596
  // input
@@ -3607,7 +3601,7 @@ const wl = /* @__PURE__ */ xe(
3607
3601
  headerHeight: i,
3608
3602
  increaseViewportBy: e,
3609
3603
  initialItemCount: h,
3610
- itemDimensions: R,
3604
+ itemDimensions: _,
3611
3605
  overscan: n,
3612
3606
  restoreStateFrom: M,
3613
3607
  scrollBy: s,
@@ -3617,9 +3611,9 @@ const wl = /* @__PURE__ */ xe(
3617
3611
  scrollToIndex: O,
3618
3612
  scrollTop: a,
3619
3613
  smoothScrollTargetReached: d,
3620
- totalCount: _,
3614
+ totalCount: C,
3621
3615
  useWindowScroll: f,
3622
- viewportDimensions: C,
3616
+ viewportDimensions: I,
3623
3617
  windowScrollContainerState: u,
3624
3618
  windowScrollTo: T,
3625
3619
  windowViewportRect: k,
@@ -3636,7 +3630,7 @@ const wl = /* @__PURE__ */ xe(
3636
3630
  startReached: Re,
3637
3631
  stateChanged: W,
3638
3632
  stateRestoreInProgress: B,
3639
- ...I
3633
+ ...R
3640
3634
  };
3641
3635
  },
3642
3636
  Ee(kr, Ke, ln, gi, It, Rr, wt)
@@ -3693,8 +3687,8 @@ const Il = /* @__PURE__ */ xe(() => {
3693
3687
  s(u);
3694
3688
  const T = f.firstChild;
3695
3689
  if (T) {
3696
- const { height: k, width: I } = T.getBoundingClientRect();
3697
- v({ height: k, width: I });
3690
+ const { height: k, width: R } = T.getBoundingClientRect();
3691
+ v({ height: k, width: R });
3698
3692
  }
3699
3693
  g({
3700
3694
  column: ao("column-gap", getComputedStyle(f).columnGap, b),
@@ -3910,12 +3904,12 @@ const Ul = Object.freeze({
3910
3904
  pointerColor: void 0
3911
3905
  }), _i = N.memo(
3912
3906
  function({ runs: t, ns: n, baseIndex: r, preGroups: o }) {
3913
- const i = _e((C) => C.setClipIndex), s = _e((C) => C.seek), c = j((C) => C.setCurrentGlobalRunIndex), l = yn(), a = j((C) => C.rangeStartGI), d = j((C) => C.rangeEndGI), v = j((C) => C.setRange), g = a != null && d != null, b = Z(
3914
- (C) => {
3907
+ const i = _e((I) => I.setClipIndex), s = _e((I) => I.seek), c = j((I) => I.setCurrentGlobalRunIndex), l = yn(), a = j((I) => I.rangeStartGI), d = j((I) => I.rangeEndGI), v = j((I) => I.setRange), g = a != null && d != null, b = Z(
3908
+ (I) => {
3915
3909
  var M;
3916
- const R = (M = C.target) == null ? void 0 : M.closest("[data-g]");
3917
- if (!R) return;
3918
- const O = Number(R.dataset.g), P = O - r;
3910
+ const _ = (M = I.target) == null ? void 0 : M.closest("[data-g]");
3911
+ if (!_) return;
3912
+ const O = Number(_.dataset.g), P = O - r;
3919
3913
  if (P < 0 || P >= t.length) return;
3920
3914
  const w = t[P], E = w.text ?? "";
3921
3915
  if (!E.trim() || !/[가-힣a-zA-Z0-9]/.test(E)) return;
@@ -3925,11 +3919,11 @@ const Ul = Object.freeze({
3925
3919
  },
3926
3920
  [t, r, s, i, c]
3927
3921
  ), m = ie(null), y = ie(!1), p = Z(
3928
- (C) => {
3922
+ (I) => {
3929
3923
  var w;
3930
- const R = (w = C.target) == null ? void 0 : w.closest("[data-g]");
3931
- if (!R) return;
3932
- const O = Number(R.dataset.g), P = O - r;
3924
+ const _ = (w = I.target) == null ? void 0 : w.closest("[data-g]");
3925
+ if (!_) return;
3926
+ const O = Number(_.dataset.g), P = O - r;
3933
3927
  P < 0 || P >= t.length || (y.current = !1, m.current && (window.clearTimeout(m.current), m.current = null), m.current = window.setTimeout(() => {
3934
3928
  l.getState().status !== "playing" && (v(O, O), y.current = !0, m.current = null);
3935
3929
  }, 800));
@@ -3939,40 +3933,40 @@ const Ul = Object.freeze({
3939
3933
  m.current && (window.clearTimeout(m.current), m.current = null);
3940
3934
  }, []), u = Z(() => {
3941
3935
  f();
3942
- }, [f]), T = f, k = f, I = j((C) => C.clearRange), _ = Z(
3943
- (C) => {
3936
+ }, [f]), T = f, k = f, R = j((I) => I.clearRange), C = Z(
3937
+ (I) => {
3944
3938
  var P;
3945
3939
  if (y.current) {
3946
3940
  y.current = !1;
3947
3941
  return;
3948
3942
  }
3949
- const R = (P = C.target) == null ? void 0 : P.closest("[data-g]");
3950
- if (!R) return;
3951
- const O = Number(R.dataset.g);
3952
- isNaN(O) || g && a != null && d != null && (I(), C.stopPropagation());
3943
+ const _ = (P = I.target) == null ? void 0 : P.closest("[data-g]");
3944
+ if (!_) return;
3945
+ const O = Number(_.dataset.g);
3946
+ isNaN(O) || g && a != null && d != null && (R(), I.stopPropagation());
3953
3947
  },
3954
- [g, a, d, I]
3948
+ [g, a, d, R]
3955
3949
  ), h = o, S = r + t.length - 1;
3956
3950
  return /* @__PURE__ */ x(
3957
3951
  "span",
3958
3952
  {
3959
- onClick: _,
3953
+ onClick: C,
3960
3954
  onDoubleClick: b,
3961
3955
  onPointerDown: p,
3962
3956
  onPointerUp: u,
3963
3957
  onPointerCancel: T,
3964
3958
  onPointerLeave: k,
3965
- children: h.map((C, R) => /* @__PURE__ */ x(
3959
+ children: h.map((I, _) => /* @__PURE__ */ x(
3966
3960
  Ql,
3967
3961
  {
3968
3962
  ns: n,
3969
- group: C,
3963
+ group: I,
3970
3964
  runs: t,
3971
3965
  paraLastG: S,
3972
3966
  rangeStartGI: a,
3973
3967
  rangeEndGI: d
3974
3968
  },
3975
- `${n}/grp:${R}-${C.startG}`
3969
+ `${n}/grp:${_}-${I.startG}`
3976
3970
  ))
3977
3971
  }
3978
3972
  );
@@ -4020,7 +4014,7 @@ const Ul = Object.freeze({
4020
4014
  "--ul-offset": "0.35em"
4021
4015
  } : void 0;
4022
4016
  return /* @__PURE__ */ x(yt, { children: Array.from({ length: g }).map((p, f) => {
4023
- const T = r[v + f], k = n.startG + f, I = `${t}/run:${k}`, _ = !!T.split && k !== o;
4017
+ const T = r[v + f], k = n.startG + f, R = `${t}/run:${k}`, C = !!T.split && k !== o;
4024
4018
  let h = `${ft.runWrap}`;
4025
4019
  return b && (g === 1 ? h += ` ${ft.highlight}` : f === 0 ? h += ` ${ft.highlightleft}` : f + 1 === g ? h += ` ${ft.highlightright}` : h += ` ${ft.highlightcenter}`), m && (g === 1 ? h += ` ${ft.underline}` : f === 0 ? h += ` ${ft.underlineleft}` : f + 1 === g ? h += ` ${ft.underlineright}` : h += ` ${ft.underlinecenter}`), /* @__PURE__ */ X(N.Fragment, { children: [
4026
4020
  /* @__PURE__ */ x("span", { className: h, style: y, children: /* @__PURE__ */ x(
@@ -4034,8 +4028,8 @@ const Ul = Object.freeze({
4034
4028
  isInRange: i != null && s != null && k >= i && k <= s
4035
4029
  }
4036
4030
  ) }),
4037
- _ && /* @__PURE__ */ x(Kl, {})
4038
- ] }, I);
4031
+ C && /* @__PURE__ */ x(Kl, {})
4032
+ ] }, R);
4039
4033
  }) });
4040
4034
  },
4041
4035
  (e, t) => e.group === t.group && // 그룹 메타 참조 동일
@@ -4330,7 +4324,7 @@ function st(e, t) {
4330
4324
  return Tn(n, e, t);
4331
4325
  }
4332
4326
  const Oi = () => {
4333
- const e = j((r) => r.section), t = Ei(), n = e.quiz;
4327
+ const e = j((r) => r.section), t = Ei(), n = e.quizzes;
4334
4328
  return !n || !n.length ? null : /* @__PURE__ */ X(
4335
4329
  "button",
4336
4330
  {
@@ -4620,24 +4614,24 @@ function wa({
4620
4614
  nsPrefix: n
4621
4615
  }) {
4622
4616
  const r = ve(() => {
4623
- const C = [], R = Or();
4617
+ const I = [], _ = Or();
4624
4618
  return t.forEach((O, P) => {
4625
- O.type === "paragraph" && (C[P] = Pr(O, R));
4626
- }), C;
4627
- }, [t]), o = j((C) => {
4628
- var R;
4629
- return ((R = C.layout) == null ? void 0 : R.prefix) ?? [];
4630
- }), i = j((C) => {
4631
- var R;
4632
- return ((R = C.derivedNav) == null ? void 0 : R.splitGroupsPerBlock) ?? [];
4633
- }), s = Y((C) => C.marginX), c = Y((C) => C.viewportHeight), l = ie({
4619
+ O.type === "paragraph" && (I[P] = Pr(O, _));
4620
+ }), I;
4621
+ }, [t]), o = j((I) => {
4622
+ var _;
4623
+ return ((_ = I.layout) == null ? void 0 : _.prefix) ?? [];
4624
+ }), i = j((I) => {
4625
+ var _;
4626
+ return ((_ = I.derivedNav) == null ? void 0 : _.splitGroupsPerBlock) ?? [];
4627
+ }), s = Y((I) => I.marginX), c = Y((I) => I.viewportHeight), l = ie({
4634
4628
  start: 0,
4635
4629
  end: 0
4636
4630
  }), a = Z(
4637
- (C) => {
4638
- const R = t[C], O = `${n}blk-${R.id}`;
4639
- if (R.type === "image") {
4640
- const { src: E, alt: A, width: W, height: M } = R, B = W && M ? `${W} / ${M}` : "4 / 3", F = C >= l.current.start && C <= l.current.end, V = c > 80 ? Math.floor((c - 80) * 0.6) : void 0;
4631
+ (I) => {
4632
+ const _ = t[I], O = `${n}blk-${_.id}`;
4633
+ if (_.type === "image") {
4634
+ const { src: E, alt: A, width: W, height: M } = _, B = W && M ? `${W} / ${M}` : "4 / 3", F = I >= l.current.start && I <= l.current.end, D = c > 80 ? Math.floor((c - 80) * 0.6) : void 0;
4641
4635
  return /* @__PURE__ */ X("div", { style: { margin: "12px 0", textAlign: "center", width: "100%" }, children: [
4642
4636
  /* @__PURE__ */ x(
4643
4637
  "div",
@@ -4645,7 +4639,7 @@ function wa({
4645
4639
  style: {
4646
4640
  position: "relative",
4647
4641
  width: "100%",
4648
- maxHeight: V,
4642
+ maxHeight: D,
4649
4643
  aspectRatio: B
4650
4644
  },
4651
4645
  children: /* @__PURE__ */ x(
@@ -4671,7 +4665,7 @@ function wa({
4671
4665
  A && /* @__PURE__ */ x("div", { style: { fontSize: 12, color: "#6b7280", marginTop: 4 }, children: A })
4672
4666
  ] });
4673
4667
  }
4674
- const P = r[C] ?? void 0, w = i[C];
4668
+ const P = r[I] ?? void 0, w = i[I];
4675
4669
  return /* @__PURE__ */ x(
4676
4670
  "div",
4677
4671
  {
@@ -4682,10 +4676,10 @@ function wa({
4682
4676
  children: /* @__PURE__ */ x(
4683
4677
  Zl,
4684
4678
  {
4685
- block: R,
4679
+ block: _,
4686
4680
  computedMarker: P,
4687
4681
  ns: O,
4688
- baseIndex: o[C],
4682
+ baseIndex: o[I],
4689
4683
  sectionId: e.section_id,
4690
4684
  preGroups: w
4691
4685
  }
@@ -4694,12 +4688,12 @@ function wa({
4694
4688
  );
4695
4689
  },
4696
4690
  [t, r, o, n, e, i, c]
4697
- ), d = ie(null), v = Z((C) => {
4698
- d.current = C;
4691
+ ), d = ie(null), v = Z((I) => {
4692
+ d.current = I;
4699
4693
  }, []), g = ve(
4700
- () => Wt((C) => {
4701
- const { style: R, children: O, ...P } = C;
4702
- return /* @__PURE__ */ x("div", { ...P, style: R, children: /* @__PURE__ */ x(
4694
+ () => Wt((I) => {
4695
+ const { style: _, children: O, ...P } = I;
4696
+ return /* @__PURE__ */ x("div", { ...P, style: _, children: /* @__PURE__ */ x(
4703
4697
  "div",
4704
4698
  {
4705
4699
  style: {
@@ -4718,7 +4712,7 @@ function wa({
4718
4712
  ) });
4719
4713
  }),
4720
4714
  [s]
4721
- ), b = ie(null), m = ve(() => t.map((C) => C.id), [t]), [y, p] = et(!1);
4715
+ ), b = ie(null), m = ve(() => t.map((I) => I.id), [t]), [y, p] = et(!1);
4722
4716
  Se(() => {
4723
4717
  p(!1);
4724
4718
  }, [t]);
@@ -4727,11 +4721,11 @@ function wa({
4727
4721
  }, []), u = Z(() => {
4728
4722
  if (!y)
4729
4723
  return /* @__PURE__ */ x("div", { style: { height: 40 } });
4730
- const C = e.quiz, R = Math.max(80, Math.floor(c * 0.5));
4731
- return C && C.length ? /* @__PURE__ */ X("div", { style: { display: "block" }, children: [
4724
+ const I = e.quizzes, _ = Math.max(80, Math.floor(c * 0.5));
4725
+ return I && I.length ? /* @__PURE__ */ X("div", { style: { display: "block" }, children: [
4732
4726
  /* @__PURE__ */ x("div", { style: { display: "flex", justifyContent: "center", marginTop: 20 }, children: /* @__PURE__ */ x(Oi, {}) }),
4733
4727
  /* @__PURE__ */ x("div", { style: { display: "flex", justifyContent: "center", marginTop: 20 }, children: /* @__PURE__ */ x(Cn, { isIcon: !1 }) }),
4734
- /* @__PURE__ */ x("div", { style: { height: R, width: "100%" } })
4728
+ /* @__PURE__ */ x("div", { style: { height: _, width: "100%" } })
4735
4729
  ] }) : /* @__PURE__ */ X("div", { children: [
4736
4730
  /* @__PURE__ */ x("div", { style: { display: "flex", justifyContent: "center", marginTop: 20 }, children: /* @__PURE__ */ x(Cn, { isIcon: !1 }) }),
4737
4731
  /* @__PURE__ */ x("div", { style: { height: 40 } })
@@ -4750,28 +4744,28 @@ function wa({
4750
4744
  // , ScrollPlaceholder
4751
4745
  ]
4752
4746
  // CustomScroller는 고정이면 deps에 안 넣어도 OK
4753
- ), k = Z((C) => m[C], [m]), I = Rt(), [_] = et(() => I.getState().progress.currentGlobalRunIndex ?? 0), h = ve(() => {
4747
+ ), k = Z((I) => m[I], [m]), R = Rt(), [C] = et(() => R.getState().progress.currentGlobalRunIndex ?? 0), h = ve(() => {
4754
4748
  if (!o.length) return 0;
4755
- const C = o[o.length - 1], R = Math.max(0, Math.min(_, C));
4756
- return zi(o, R);
4757
- }, [o, _]);
4749
+ const I = o[o.length - 1], _ = Math.max(0, Math.min(C, I));
4750
+ return zi(o, _);
4751
+ }, [o, C]);
4758
4752
  console.log("SectionRenderVirtuoso확인");
4759
4753
  const S = Rt();
4760
4754
  return Se(() => {
4761
- let C = !1;
4755
+ let I = !1;
4762
4756
  return (async () => {
4763
- let R = d.current;
4764
- if (!R) {
4757
+ let _ = d.current;
4758
+ if (!_) {
4765
4759
  for (let E = 0; E < 20; E++) {
4766
- if (await new Promise((A) => setTimeout(A, 50)), C) return;
4767
- if (R = d.current, R) break;
4760
+ if (await new Promise((A) => setTimeout(A, 50)), I) return;
4761
+ if (_ = d.current, _) break;
4768
4762
  }
4769
- if (!R) return;
4763
+ if (!_) return;
4770
4764
  }
4771
4765
  const O = S.getState().progress.currentGlobalRunIndex, P = S.getState().progress.setSectionLoading, w = O != null && O >= 0 ? O : 0;
4772
- await Mi(R, w), !C && (await vt(), await vt(), await vt(), await vt(), !C && P(!1));
4766
+ await Mi(_, w), !I && (await vt(), await vt(), await vt(), await vt(), !I && P(!1));
4773
4767
  })(), () => {
4774
- C = !0;
4768
+ I = !0;
4775
4769
  };
4776
4770
  }, [d, S]), /* @__PURE__ */ X(yt, { children: [
4777
4771
  /* @__PURE__ */ x(
@@ -4833,8 +4827,8 @@ const Ia = ({
4833
4827
  let B = 0;
4834
4828
  const F = w.querySelector(`[data-g="${E}"]`);
4835
4829
  if (F) {
4836
- const V = w.getBoundingClientRect();
4837
- B = (F.getBoundingClientRect().top - V.top) / V.height;
4830
+ const D = w.getBoundingClientRect();
4831
+ B = (F.getBoundingClientRect().top - D.top) / D.height;
4838
4832
  }
4839
4833
  l.getState().emit({
4840
4834
  type: "scroll",
@@ -4853,7 +4847,7 @@ const Ia = ({
4853
4847
  s || a.current && (f.current || (y(w), p(w)));
4854
4848
  },
4855
4849
  [s, y, p]
4856
- ), T = ie(void 0), k = ie(void 0), I = ie(void 0), _ = ie(void 0);
4850
+ ), T = ie(void 0), k = ie(void 0), R = ie(void 0), C = ie(void 0);
4857
4851
  Se(() => {
4858
4852
  const w = e.current;
4859
4853
  if (w)
@@ -4861,10 +4855,10 @@ const Ia = ({
4861
4855
  a.current = !0;
4862
4856
  }, k.current = () => {
4863
4857
  a.current = !0;
4864
- }, I.current = () => {
4858
+ }, R.current = () => {
4865
4859
  a.current = !0;
4866
- }, _.current = () => u(w), w.addEventListener("wheel", T.current, { passive: !0 }), w.addEventListener("touchmove", k.current, { passive: !0 }), window.addEventListener("keydown", I.current, { passive: !0 }), w.addEventListener("scroll", _.current, { passive: !0 }), () => {
4867
- w.removeEventListener("wheel", T.current), w.removeEventListener("touchmove", k.current), window.removeEventListener("keydown", I.current), w.removeEventListener("scroll", _.current), d.current != null && cancelAnimationFrame(d.current), g.current != null && (clearTimeout(g.current), g.current = null);
4860
+ }, C.current = () => u(w), w.addEventListener("wheel", T.current, { passive: !0 }), w.addEventListener("touchmove", k.current, { passive: !0 }), window.addEventListener("keydown", R.current, { passive: !0 }), w.addEventListener("scroll", C.current, { passive: !0 }), () => {
4861
+ w.removeEventListener("wheel", T.current), w.removeEventListener("touchmove", k.current), window.removeEventListener("keydown", R.current), w.removeEventListener("scroll", C.current), d.current != null && cancelAnimationFrame(d.current), g.current != null && (clearTimeout(g.current), g.current = null);
4868
4862
  };
4869
4863
  }, [u, e]), Se(() => {
4870
4864
  const w = e.current;
@@ -4886,15 +4880,15 @@ const Ia = ({
4886
4880
  const h = ie({
4887
4881
  first: -1,
4888
4882
  last: -1
4889
- }), S = ie(!1), C = Z(() => {
4883
+ }), S = ie(!1), I = Z(() => {
4890
4884
  const w = e.current;
4891
4885
  if (!w) return;
4892
4886
  const E = go(w), A = (E == null ? void 0 : E.first) ?? -1, W = (E == null ? void 0 : E.last) ?? -1;
4893
4887
  h.current = { first: A, last: W };
4894
- }, [e]), R = ie(!1), O = Z(() => {
4888
+ }, [e]), _ = ie(!1), O = Z(() => {
4895
4889
  const w = e.current;
4896
- if (!w || R.current) return;
4897
- R.current = !0;
4890
+ if (!w || _.current) return;
4891
+ _.current = !0;
4898
4892
  const E = Math.min(
4899
4893
  w.scrollTop + Math.floor(w.clientHeight * 0.6),
4900
4894
  w.scrollHeight - w.clientHeight
@@ -4904,8 +4898,8 @@ const Ia = ({
4904
4898
  });
4905
4899
  }, [e]);
4906
4900
  Se(() => {
4907
- !S.current && s && (R.current = !1, C()), S.current = s;
4908
- }, [s, C]), Se(() => {
4901
+ !S.current && s && (_.current = !1, I()), S.current = s;
4902
+ }, [s, I]), Se(() => {
4909
4903
  if (s !== !0) return;
4910
4904
  const w = e.current;
4911
4905
  if (!w) return;
@@ -4925,7 +4919,7 @@ const Ia = ({
4925
4919
  } finally {
4926
4920
  f.current = !1;
4927
4921
  }
4928
- C();
4922
+ I();
4929
4923
  })();
4930
4924
  return;
4931
4925
  }
@@ -4939,14 +4933,14 @@ const Ia = ({
4939
4933
  });
4940
4934
  }
4941
4935
  M().then((B) => {
4942
- B ? C() : O();
4936
+ B ? I() : O();
4943
4937
  });
4944
4938
  }
4945
4939
  }, [
4946
4940
  s,
4947
4941
  i,
4948
4942
  O,
4949
- C,
4943
+ I,
4950
4944
  e
4951
4945
  ]);
4952
4946
  const P = Z(() => {
@@ -4957,8 +4951,8 @@ const Ia = ({
4957
4951
  if (!ne) return !1;
4958
4952
  const H = ee.getBoundingClientRect(), oe = ne.getBoundingClientRect();
4959
4953
  if (oe.height <= 0 || H.height <= 0) return !1;
4960
- const $ = (oe.top + oe.height / 2 - H.top) / H.height;
4961
- return $ >= z && $ <= K;
4954
+ const V = (oe.top + oe.height / 2 - H.top) / H.height;
4955
+ return V >= z && V <= K;
4962
4956
  }
4963
4957
  const A = (ee) => ee === "instant" ? "auto" : ee, W = (ee) => {
4964
4958
  const Q = w.scrollTop, z = w.scrollHeight - w.clientHeight, K = z > 0 ? Q / z : 0;
@@ -5000,10 +4994,10 @@ const Ia = ({
5000
4994
  behavior: "smooth",
5001
4995
  topPaddingRatio: K
5002
4996
  }), await B()) : ne || await M(ee, "auto"), f.current = !1, W(ee), E(w, ee, 0.1, 0.7);
5003
- }, V = async (ee) => F(ee);
4997
+ }, D = async (ee) => F(ee);
5004
4998
  return {
5005
4999
  ensureVisibleGI: F,
5006
- scrollToGI: V,
5000
+ scrollToGI: D,
5007
5001
  getVisibleRange: () => go(w),
5008
5002
  getScrollTop: () => w.scrollTop,
5009
5003
  setScrollTop: (ee) => {
@@ -5016,10 +5010,10 @@ const Ia = ({
5016
5010
  return (z.top - K.top) / K.height;
5017
5011
  },
5018
5012
  scrollToGIAtOffset: async (ee, Q) => {
5019
- await V(ee), await new Promise((se) => requestAnimationFrame(() => requestAnimationFrame(se)));
5013
+ await D(ee), await new Promise((se) => requestAnimationFrame(() => requestAnimationFrame(se)));
5020
5014
  const z = w.querySelector(`[data-g="${ee}"]`);
5021
5015
  if (!z) return;
5022
- const K = z.getBoundingClientRect(), ne = w.getBoundingClientRect(), H = ne.height > 0 ? ne.height / w.clientHeight : 1, oe = (K.top - ne.top) / H, $ = Q * w.clientHeight, J = oe - $;
5016
+ const K = z.getBoundingClientRect(), ne = w.getBoundingClientRect(), H = ne.height > 0 ? ne.height / w.clientHeight : 1, oe = (K.top - ne.top) / H, V = Q * w.clientHeight, J = oe - V;
5023
5017
  w.scrollTop = w.scrollTop + J;
5024
5018
  }
5025
5019
  };
@@ -5099,11 +5093,11 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5099
5093
  label: qa,
5100
5094
  compactBtn: ja
5101
5095
  }, Ua = Wt(function() {
5102
- const t = ie(null), n = Ue(Mt), r = (n == null ? void 0 : n.getState().isPlaybackMode) ?? !1, o = _e((S) => S.status), i = _e((S) => S.currentTimeMs), s = _e((S) => S.currentClip), c = _e((S) => S.playbackKind), l = Y((S) => S.muteAudio), a = Y((S) => S.audioSpeed), d = _e((S) => S.getClipSrc), v = _e((S) => S._onTime), g = _e((S) => S._onEnded), b = _e((S) => S._onError), m = j((S) => S.setCurrentGlobalRunIndex), y = j((S) => S.getSectionScrollApi), p = j((S) => S.snapToReadable), f = j((S) => S.edgeReadable), u = ie(null), T = ie(null), k = ie(!1), I = ie(null);
5096
+ const t = ie(null), n = Ue(Mt), r = (n == null ? void 0 : n.getState().isPlaybackMode) ?? !1, o = _e((S) => S.status), i = _e((S) => S.currentTimeMs), s = _e((S) => S.currentClip), c = _e((S) => S.playbackKind), l = Y((S) => S.muteAudio), a = Y((S) => S.audioSpeed), d = _e((S) => S.getClipSrc), v = _e((S) => S._onTime), g = _e((S) => S._onEnded), b = _e((S) => S._onError), m = j((S) => S.setCurrentGlobalRunIndex), y = j((S) => S.getSectionScrollApi), p = j((S) => S.snapToReadable), f = j((S) => S.edgeReadable), u = ie(null), T = ie(null), k = ie(!1), R = ie(null);
5103
5097
  Se(() => {
5104
5098
  c === "real" && (k.current = !0);
5105
5099
  }, [c]);
5106
- const _ = ve(() => {
5100
+ const C = ve(() => {
5107
5101
  const S = d(s);
5108
5102
  if (!S) return null;
5109
5103
  try {
@@ -5114,14 +5108,14 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5114
5108
  }, [s, d]);
5115
5109
  Se(() => {
5116
5110
  k.current = !0;
5117
- }, [_]), Se(() => {
5111
+ }, [C]), Se(() => {
5118
5112
  const S = t.current;
5119
5113
  if (!S) return;
5120
- const C = () => {
5114
+ const I = () => {
5121
5115
  if (S.paused || S.ended) return;
5122
5116
  const P = S.currentTime * 1e3;
5123
5117
  k.current && P === 0 || (P > 0 && (k.current = !1), v(P));
5124
- }, R = () => {
5118
+ }, _ = () => {
5125
5119
  var w, E;
5126
5120
  g();
5127
5121
  const P = f(1);
@@ -5133,14 +5127,14 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5133
5127
  readyState: w.readyState
5134
5128
  }), b();
5135
5129
  };
5136
- return S.addEventListener("timeupdate", C), S.addEventListener("ended", R), S.addEventListener("error", O), () => {
5137
- S.removeEventListener("timeupdate", C), S.removeEventListener("ended", R), S.removeEventListener("error", O);
5130
+ return S.addEventListener("timeupdate", I), S.addEventListener("ended", _), S.addEventListener("error", O), () => {
5131
+ S.removeEventListener("timeupdate", I), S.removeEventListener("ended", _), S.removeEventListener("error", O);
5138
5132
  };
5139
5133
  }, [v, g, b, f, m, y]), Se(() => {
5140
5134
  if (r) return;
5141
5135
  const S = t.current;
5142
5136
  if (!S) return;
5143
- if (!_) {
5137
+ if (!C) {
5144
5138
  try {
5145
5139
  S.pause();
5146
5140
  } catch (P) {
@@ -5149,24 +5143,24 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5149
5143
  T.current = null;
5150
5144
  return;
5151
5145
  }
5152
- const C = S.currentSrc || S.src || null, R = !C || C !== _;
5153
- if (R) {
5146
+ const I = S.currentSrc || S.src || null, _ = !I || I !== C;
5147
+ if (_) {
5154
5148
  try {
5155
5149
  S.pause();
5156
5150
  } catch (P) {
5157
5151
  console.log("pause error", P);
5158
5152
  }
5159
- S.src = _;
5153
+ S.src = C;
5160
5154
  try {
5161
5155
  S.load();
5162
5156
  } catch (P) {
5163
5157
  console.log("load error", P);
5164
5158
  }
5165
- T.current = _;
5159
+ T.current = C;
5166
5160
  }
5167
5161
  S.muted = !!l, S.volume = 1, S.playbackRate = typeof a == "number" ? a : 1;
5168
5162
  const O = async () => {
5169
- R && await new Promise((P) => {
5163
+ _ && await new Promise((P) => {
5170
5164
  let w = !1;
5171
5165
  const E = () => {
5172
5166
  w || (w = !0, S.removeEventListener("loadedmetadata", E), S.removeEventListener("canplay", E), P());
@@ -5187,15 +5181,15 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5187
5181
  } catch (P) {
5188
5182
  console.log("pause error", P);
5189
5183
  }
5190
- }, [_, l, o, a, r]), Se(() => {
5184
+ }, [C, l, o, a, r]), Se(() => {
5191
5185
  if (r) return;
5192
5186
  const S = t.current;
5193
5187
  if (!S || c !== "real") return;
5194
- const C = i / 1e3;
5195
- if (Number.isFinite(C)) {
5188
+ const I = i / 1e3;
5189
+ if (Number.isFinite(I)) {
5196
5190
  if (S.readyState < 1) {
5197
5191
  u.current = i;
5198
- const R = () => {
5192
+ const _ = () => {
5199
5193
  if (u.current != null) {
5200
5194
  const O = u.current / 1e3;
5201
5195
  try {
@@ -5205,27 +5199,27 @@ const Oa = "_wrap_1hfub_4", Pa = "_visible_1hfub_25", Ba = "_compact_1hfub_31",
5205
5199
  }
5206
5200
  u.current = null;
5207
5201
  }
5208
- S.removeEventListener("loadedmetadata", R), S.removeEventListener("canplay", R);
5202
+ S.removeEventListener("loadedmetadata", _), S.removeEventListener("canplay", _);
5209
5203
  };
5210
- S.addEventListener("loadedmetadata", R), S.addEventListener("canplay", R);
5204
+ S.addEventListener("loadedmetadata", _), S.addEventListener("canplay", _);
5211
5205
  return;
5212
5206
  }
5213
- if (Math.abs(S.currentTime - C) > 0.2)
5207
+ if (Math.abs(S.currentTime - I) > 0.2)
5214
5208
  try {
5215
- S.currentTime = C;
5216
- } catch (R) {
5217
- console.log("currentTime보정오류", R);
5209
+ S.currentTime = I;
5210
+ } catch (_) {
5211
+ console.log("currentTime보정오류", _);
5218
5212
  }
5219
5213
  }
5220
5214
  }, [i, c, r]);
5221
5215
  const h = _e((S) => S.getGIFromCT);
5222
5216
  return Se(() => {
5223
- var R, O;
5217
+ var _, O;
5224
5218
  if (r || c !== "real" || o !== "playing" && o !== "loading") return;
5225
5219
  const S = h(s, i);
5226
5220
  if (S < 0) return;
5227
- const C = p(S);
5228
- C !== I.current && (I.current = C, m(C, "audio"), C % 5 === 0 && ((O = (R = y()) == null ? void 0 : R.ensureVisibleGI) == null || O.call(R, C)));
5221
+ const I = p(S);
5222
+ I !== R.current && (R.current = I, m(I, "audio"), I % 5 === 0 && ((O = (_ = y()) == null ? void 0 : _.ensureVisibleGI) == null || O.call(_, I)));
5229
5223
  }, [
5230
5224
  o,
5231
5225
  s,
@@ -5250,19 +5244,19 @@ const Qa = "_scrubberWrap_uw0cd_2", Ya = "_labels_uw0cd_9", Xa = "_index_uw0cd_1
5250
5244
  range: ec
5251
5245
  };
5252
5246
  function tc() {
5253
- const e = Y((I) => I.isDev), t = j((I) => I.currentGlobalRunIndex), n = j((I) => I.totalRuns), r = j((I) => I.setCurrentGlobalRunIndex), o = j((I) => I.getSectionScrollApi), i = j((I) => I.giToPercentTotal), s = j((I) => I.percentToGITotal), c = j((I) => I.snapToReadable), l = _e((I) => I.scrollLock), a = _e((I) => I.pause), d = _e((I) => I.play), v = _e((I) => I.syncToGI), [g, b] = et(() => i(t || 0));
5247
+ const e = Y((R) => R.isDev), t = j((R) => R.currentGlobalRunIndex), n = j((R) => R.totalRuns), r = j((R) => R.setCurrentGlobalRunIndex), o = j((R) => R.getSectionScrollApi), i = j((R) => R.giToPercentTotal), s = j((R) => R.percentToGITotal), c = j((R) => R.snapToReadable), l = _e((R) => R.scrollLock), a = _e((R) => R.pause), d = _e((R) => R.play), v = _e((R) => R.syncToGI), [g, b] = et(() => i(t || 0));
5254
5248
  Se(() => {
5255
5249
  b(i(t || 0));
5256
5250
  }, [t, i]);
5257
5251
  const m = ie(!1), y = ve(() => Math.max(0, Math.min(t ?? 0, Math.max(0, (n ?? 1) - 1))) + 1, [t, n]), p = Z(() => {
5258
5252
  l && (a(), m.current = !0);
5259
- }, [l, a]), f = Z((I) => {
5260
- b(Number(I.currentTarget.value));
5253
+ }, [l, a]), f = Z((R) => {
5254
+ b(Number(R.currentTarget.value));
5261
5255
  }, []), u = Z(async () => {
5262
- const I = s(g), _ = c(I);
5263
- a(), r(_, "scrubber-commit"), v(_);
5256
+ const R = s(g), C = c(R);
5257
+ a(), r(C, "scrubber-commit"), v(C);
5264
5258
  const h = o();
5265
- h != null && h.ensureVisibleGI && await h.ensureVisibleGI(_), m.current && (m.current = !1, d());
5259
+ h != null && h.ensureVisibleGI && await h.ensureVisibleGI(C), m.current && (m.current = !1, d());
5266
5260
  }, [g, s, c, a, r, v, o, d]), T = ve(
5267
5261
  () => ({ "--pct": `${g}%` }),
5268
5262
  [g]
@@ -5293,7 +5287,7 @@ function tc() {
5293
5287
  onTouchEnd: () => {
5294
5288
  u();
5295
5289
  },
5296
- onKeyUp: (I) => I.key === "Enter" || I.key === " " ? void u() : void 0,
5290
+ onKeyUp: (R) => R.key === "Enter" || R.key === " " ? void u() : void 0,
5297
5291
  "aria-label": "진행률"
5298
5292
  }
5299
5293
  ),
@@ -5308,20 +5302,20 @@ const nc = N.memo(tc), rc = Wt(function() {
5308
5302
  const t = Ue(Mt), n = (t == null ? void 0 : t.getState().isPlaybackMode) ?? !1, r = _e((S) => S.playbackKind), o = _e((S) => S.status), i = _e((S) => S.fake), s = Y((S) => S.audioSpeed), c = _e((S) => S.pause), l = j((S) => S.totalRuns), a = j((S) => S.currentGlobalRunIndex), d = j((S) => S.setCurrentGlobalRunIndex), v = j((S) => S.getSectionScrollApi), g = j((S) => S.nextReadableFrom), b = j((S) => S.edgeReadable), m = ie(null), y = ie(null), p = ie(0), f = ie(-1), u = !n && r === "fake" && o === "playing", T = Math.max(1, (i == null ? void 0 : i.totalWords) ?? 1), k = ve(() => {
5309
5303
  const S = 200 * s;
5310
5304
  return T / S * 6e4;
5311
- }, [T, s]), I = ve(() => !l || l <= 1 || k <= 0 ? 0 : (l - 1) / k, [l, k]);
5305
+ }, [T, s]), R = ve(() => !l || l <= 1 || k <= 0 ? 0 : (l - 1) / k, [l, k]);
5312
5306
  Se(() => {
5313
5307
  if (!u) return;
5314
5308
  const S = Math.max(0, Math.min(a ?? 0, Math.max(0, (l ?? 1) - 1)));
5315
5309
  p.current = S, f.current = S, y.current = null;
5316
5310
  }, [u, a, l]);
5317
- const _ = ie(-1);
5311
+ const C = ie(-1);
5318
5312
  Se(() => {
5319
5313
  if (!l) {
5320
- _.current = -1;
5314
+ C.current = -1;
5321
5315
  return;
5322
5316
  }
5323
5317
  const S = b(1);
5324
- _.current = S ?? -1;
5318
+ C.current = S ?? -1;
5325
5319
  }, [b, l]);
5326
5320
  const h = Z(
5327
5321
  (S) => {
@@ -5331,17 +5325,17 @@ const nc = N.memo(tc), rc = Wt(function() {
5331
5325
  m.current = null;
5332
5326
  return;
5333
5327
  }
5334
- if (!l || l <= 1 || I <= 0) {
5328
+ if (!l || l <= 1 || R <= 0) {
5335
5329
  m.current = null;
5336
5330
  return;
5337
5331
  }
5338
- const C = y.current;
5332
+ const I = y.current;
5339
5333
  y.current = S;
5340
- const R = C == null ? 0 : Math.max(0, S - C), O = l - 1;
5341
- p.current = Math.min(O, p.current + I * R);
5334
+ const _ = I == null ? 0 : Math.max(0, S - I), O = l - 1;
5335
+ p.current = Math.min(O, p.current + R * _);
5342
5336
  const P = Math.floor(p.current), w = v(), E = g(P, 1);
5343
5337
  if (E == null) {
5344
- const B = _.current >= 0 ? _.current : P;
5338
+ const B = C.current >= 0 ? C.current : P;
5345
5339
  B !== f.current && (f.current = B, d(B, "audio"), await ((W = w == null ? void 0 : w.ensureVisibleGI) == null ? void 0 : W.call(w, B))), c(), m.current = null;
5346
5340
  return;
5347
5341
  }
@@ -5349,7 +5343,7 @@ const nc = N.memo(tc), rc = Wt(function() {
5349
5343
  A !== f.current && (f.current = A, d(A, "audio"), A % 5 === 0 && await ((M = w == null ? void 0 : w.ensureVisibleGI) == null ? void 0 : M.call(w, A))), m.current = requestAnimationFrame(h);
5350
5344
  })().catch(console.error);
5351
5345
  },
5352
- [u, l, I, g, d, v, c]
5346
+ [u, l, R, g, d, v, c]
5353
5347
  );
5354
5348
  return Se(() => (u ? m.current == null && (m.current = requestAnimationFrame(h)) : (m.current && (cancelAnimationFrame(m.current), m.current = null), y.current = null), () => {
5355
5349
  m.current && (cancelAnimationFrame(m.current), m.current = null);
@@ -5505,39 +5499,40 @@ function wc(e) {
5505
5499
  return rt({ 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);
5506
5500
  }
5507
5501
  function Ic() {
5508
- const e = Y((I) => I.showOverlays), t = j((I) => I.section), n = !!t.ast.isAddedSplit, r = !!t.ast.isAddedAudio, o = Y((I) => I.muteAudio), i = Y((I) => I.showPointer), s = Y((I) => I.showSplit), c = Y((I) => I.toggleMuteAudio), l = Y((I) => I.toggleShowPointer), a = Y((I) => I.toggleShowSplit), d = Y((I) => I.overlayCompactMode), v = Y((I) => I.toggleOverlayCompactMode), g = yn(), b = Rt();
5502
+ var R;
5503
+ const e = Y((C) => C.showOverlays), t = j((C) => C.section), n = !!t.ast.isAddedSplit, r = !!((R = t.audios) != null && R.length), o = Y((C) => C.muteAudio), i = Y((C) => C.showPointer), s = Y((C) => C.showSplit), c = Y((C) => C.toggleMuteAudio), l = Y((C) => C.toggleShowPointer), a = Y((C) => C.toggleShowSplit), d = Y((C) => C.overlayCompactMode), v = Y((C) => C.toggleOverlayCompactMode), g = yn(), b = Rt();
5509
5504
  Se(() => {
5510
- const I = g.getState(), { syncToGI: _, useFake: h, useReal: S } = I, C = I.playbackKind, R = b.getState().progress.currentGlobalRunIndex ?? 0;
5505
+ const C = g.getState(), { syncToGI: h, useFake: S, useReal: I } = C, _ = C.playbackKind, O = b.getState().progress.currentGlobalRunIndex ?? 0;
5511
5506
  if (!r) {
5512
- C !== "fake" && h();
5507
+ _ !== "fake" && S();
5513
5508
  return;
5514
5509
  }
5515
- o ? C !== "fake" && (console.log("이부분일까?"), h()) : C !== "real" && (_(R), S());
5510
+ o ? _ !== "fake" && (console.log("이부분일까?"), S()) : _ !== "real" && (h(O), I());
5516
5511
  }, [r, o, b, g]);
5517
- const m = _e((I) => I.play), y = _e((I) => I.pause), p = _e((I) => I.status), f = Z(
5518
- (I) => {
5519
- I.stopPropagation(), p === "playing" || p === "loading" ? y() : m();
5512
+ const m = _e((C) => C.play), y = _e((C) => C.pause), p = _e((C) => C.status), f = Z(
5513
+ (C) => {
5514
+ C.stopPropagation(), p === "playing" || p === "loading" ? y() : m();
5520
5515
  },
5521
5516
  [p, m, y]
5522
5517
  ), u = yn(), T = Rt(), k = Z(
5523
- async (I) => {
5524
- var B, F;
5525
- if (I.stopPropagation(), p === "playing" || p === "loading") {
5518
+ async (C) => {
5519
+ var F, D;
5520
+ if (C.stopPropagation(), p === "playing" || p === "loading") {
5526
5521
  y();
5527
5522
  return;
5528
5523
  }
5529
- const { progress: _ } = T.getState(), {
5530
- currentGlobalRunIndex: h,
5531
- snapToReadable: S,
5532
- edgeReadable: C,
5533
- setCurrentGlobalRunIndex: R,
5534
- getSectionScrollApi: O
5535
- } = _, P = u.getState(), w = P.currentClip, E = O == null ? void 0 : O(), A = typeof h == "number" ? h : 0, W = typeof S == "function" ? S(A) : A, M = typeof C == "function" ? C(1) : null;
5536
- if (M != null && W >= M) {
5537
- R == null || R(M, "audio"), await ((B = E == null ? void 0 : E.ensureVisibleGI) == null ? void 0 : B.call(E, M)), P.syncToGI(M);
5524
+ const { progress: h } = T.getState(), {
5525
+ currentGlobalRunIndex: S,
5526
+ snapToReadable: I,
5527
+ edgeReadable: _,
5528
+ setCurrentGlobalRunIndex: O,
5529
+ getSectionScrollApi: P
5530
+ } = h, w = u.getState(), E = w.currentClip, A = P == null ? void 0 : P(), W = typeof S == "number" ? S : 0, M = typeof I == "function" ? I(W) : W, B = typeof _ == "function" ? _(1) : null;
5531
+ if (B != null && M >= B) {
5532
+ O == null || O(B, "audio"), await ((F = A == null ? void 0 : A.ensureVisibleGI) == null ? void 0 : F.call(A, B)), w.syncToGI(B);
5538
5533
  return;
5539
5534
  }
5540
- R == null || R(W, "audio"), await ((F = E == null ? void 0 : E.ensureVisibleGI) == null ? void 0 : F.call(E, W)), P.syncToGI(W), m(w);
5535
+ O == null || O(M, "audio"), await ((D = A == null ? void 0 : A.ensureVisibleGI) == null ? void 0 : D.call(A, M)), w.syncToGI(M), m(E);
5541
5536
  },
5542
5537
  [p, y, m, u, T]
5543
5538
  );
@@ -5545,11 +5540,11 @@ function Ic() {
5545
5540
  "div",
5546
5541
  {
5547
5542
  className: `${Ge.wrap} ${e ? Ge.visible : ""} ${d ? Ge.compact : ""}`,
5548
- onClick: (I) => {
5549
- I.stopPropagation();
5543
+ onClick: (C) => {
5544
+ C.stopPropagation();
5550
5545
  },
5551
- onTouchStart: (I) => {
5552
- I.stopPropagation();
5546
+ onTouchStart: (C) => {
5547
+ C.stopPropagation();
5553
5548
  },
5554
5549
  children: [
5555
5550
  !d && /* @__PURE__ */ x(nc, {}),
@@ -5560,8 +5555,8 @@ function Ic() {
5560
5555
  "button",
5561
5556
  {
5562
5557
  type: "button",
5563
- onClick: (I) => {
5564
- I.stopPropagation(), v();
5558
+ onClick: (C) => {
5559
+ C.stopPropagation(), v();
5565
5560
  },
5566
5561
  className: Ge.compactBtn,
5567
5562
  title: d ? "오버레이 확대" : "오버레이 축소",
@@ -5589,8 +5584,8 @@ function Ic() {
5589
5584
  "button",
5590
5585
  {
5591
5586
  type: "button",
5592
- onClick: (I) => {
5593
- I.stopPropagation(), c();
5587
+ onClick: (C) => {
5588
+ C.stopPropagation(), c();
5594
5589
  },
5595
5590
  className: `${Ge.btn} ${o ? "" : Ge.btnActive}`,
5596
5591
  title: "오디오북 음소거 전환",
@@ -5604,8 +5599,8 @@ function Ic() {
5604
5599
  "button",
5605
5600
  {
5606
5601
  type: "button",
5607
- onClick: (I) => {
5608
- I.stopPropagation(), l();
5602
+ onClick: (C) => {
5603
+ C.stopPropagation(), l();
5609
5604
  },
5610
5605
  className: `${Ge.btn} ${i ? Ge.btnActive : ""}`,
5611
5606
  title: "포인터 표시",
@@ -5619,8 +5614,8 @@ function Ic() {
5619
5614
  "button",
5620
5615
  {
5621
5616
  type: "button",
5622
- onClick: (I) => {
5623
- I.stopPropagation(), a();
5617
+ onClick: (C) => {
5618
+ C.stopPropagation(), a();
5624
5619
  },
5625
5620
  disabled: !n,
5626
5621
  className: `${Ge.btn} ${s ? Ge.btnActive : ""} ${n ? "" : Ge.btnForbidden}`,
@@ -5694,22 +5689,22 @@ const Bc = N.memo(Pc), zc = "_wrap_62su0_7", Ac = "_wrapHidden_62su0_29", Lc = "
5694
5689
  inlineFlex: Qc
5695
5690
  };
5696
5691
  function Yc({ visible: e }) {
5697
- const t = Y((h) => h.mode), n = Y((h) => h.setMode), r = Y((h) => h.theme), o = Y((h) => h.setTheme), i = Y((h) => h.fontFamily), s = Y((h) => h.setFontFamily), c = Y((h) => h.resetToDefaults), l = Y((h) => h.getFontLevel()), a = Y((h) => h.getLineLevel()), d = Y((h) => h.getMarginLevel()), v = Y((h) => h.setFontLevel), g = Y((h) => h.setLineLevel), b = Y((h) => h.setMarginLevel), m = Y((h) => h.pointerStyle), y = Y((h) => h.setPointerStyle), p = Y((h) => h.pointerColor), f = Y((h) => h.setPointerColor), u = Y((h) => h.breakMarks), T = Y((h) => h.toggleBreakMark), k = Y((h) => h.getBreakGapLevel()), I = Y((h) => h.setBreakGapLevel), _ = `${Ae.wrap} ${e ? Ae.wrapVisible : Ae.wrapHidden}`;
5698
- return /* @__PURE__ */ X("div", { className: _, role: "dialog", "aria-modal": "true", "aria-label": "뷰어 설정", children: [
5692
+ const t = Y((h) => h.mode), n = Y((h) => h.setMode), r = Y((h) => h.theme), o = Y((h) => h.setTheme), i = Y((h) => h.fontFamily), s = Y((h) => h.setFontFamily), c = Y((h) => h.resetToDefaults), l = Y((h) => h.getFontLevel()), a = Y((h) => h.getLineLevel()), d = Y((h) => h.getMarginLevel()), v = Y((h) => h.setFontLevel), g = Y((h) => h.setLineLevel), b = Y((h) => h.setMarginLevel), m = Y((h) => h.pointerStyle), y = Y((h) => h.setPointerStyle), p = Y((h) => h.pointerColor), f = Y((h) => h.setPointerColor), u = Y((h) => h.breakMarks), T = Y((h) => h.toggleBreakMark), k = Y((h) => h.getBreakGapLevel()), R = Y((h) => h.setBreakGapLevel), C = `${Ae.wrap} ${e ? Ae.wrapVisible : Ae.wrapHidden}`;
5693
+ return /* @__PURE__ */ X("div", { className: C, role: "dialog", "aria-modal": "true", "aria-label": "뷰어 설정", children: [
5699
5694
  /* @__PURE__ */ X("div", { className: Ae.scrollArea, children: [
5700
5695
  /* @__PURE__ */ x(jt, { label: "열람방식", children: /* @__PURE__ */ X("div", { className: Ae.inlineFlex, children: [
5701
5696
  /* @__PURE__ */ x(Lt, { active: t === "page", onClick: () => n("page"), children: "페이지" }),
5702
5697
  /* @__PURE__ */ x(Lt, { active: t === "scroll", onClick: () => n("scroll"), children: "스크롤" })
5703
5698
  ] }) }),
5704
5699
  /* @__PURE__ */ x(jt, { label: "테마", children: /* @__PURE__ */ x("div", { className: Ae.inlineFlex, children: Object.keys(bn).map((h) => {
5705
- const S = h, C = bn[S];
5700
+ const S = h, I = bn[S];
5706
5701
  return /* @__PURE__ */ x(
5707
5702
  "button",
5708
5703
  {
5709
5704
  type: "button",
5710
5705
  onClick: () => o(S),
5711
5706
  className: `${Ae.themeCircle} ${r === h ? Ae.themeCircleActive : ""}`,
5712
- style: { background: C.bg, color: C.fg, fontFamily: i },
5707
+ style: { background: I.bg, color: I.fg, fontFamily: i },
5713
5708
  title: String(h),
5714
5709
  "aria-label": `테마: ${String(h)}`,
5715
5710
  children: "A"
@@ -5788,8 +5783,8 @@ function Yc({ visible: e }) {
5788
5783
  level: k,
5789
5784
  min: 1,
5790
5785
  max: 5,
5791
- onDec: () => I(Math.max(1, k - 1)),
5792
- onInc: () => I(Math.min(5, k + 1))
5786
+ onDec: () => R(Math.max(1, k - 1)),
5787
+ onInc: () => R(Math.min(5, k + 1))
5793
5788
  }
5794
5789
  )
5795
5790
  ] }),
@@ -6070,8 +6065,8 @@ function ru(e) {
6070
6065
  if (!f || f.length === 0) return -1;
6071
6066
  let u = 0, T = f.length - 1, k = 0;
6072
6067
  for (; u <= T; ) {
6073
- const I = u + T >> 1;
6074
- f[I].t <= p ? (k = I, u = I + 1) : T = I - 1;
6068
+ const R = u + T >> 1;
6069
+ f[R].t <= p ? (k = R, u = R + 1) : T = R - 1;
6075
6070
  }
6076
6071
  return f[Math.max(0, Math.min(k, f.length - 1))].g;
6077
6072
  },
@@ -6093,8 +6088,8 @@ function ru(e) {
6093
6088
  }
6094
6089
  if (!f) {
6095
6090
  let k = y + 1;
6096
- const I = y + 100;
6097
- for (; p[k] == null && k <= I; ) k++;
6091
+ const R = y + 100;
6092
+ for (; p[k] == null && k <= R; ) k++;
6098
6093
  p[k] && (f = p[k]);
6099
6094
  }
6100
6095
  }
@@ -6173,13 +6168,13 @@ function lu(e) {
6173
6168
  mr(u) && (i[g + f] = 1);
6174
6169
  }
6175
6170
  const y = ra(b, g).map((f) => {
6176
- var I;
6171
+ var R;
6177
6172
  const u = f.startG - g, T = f.endG - f.startG + 1;
6178
6173
  let k = -1;
6179
- for (let _ = 0; _ < T; _++) {
6180
- const h = ((I = b[u + _]) == null ? void 0 : I.text) ?? "";
6174
+ for (let C = 0; C < T; C++) {
6175
+ const h = ((R = b[u + C]) == null ? void 0 : R.text) ?? "";
6181
6176
  if (mr(h)) {
6182
- k = f.startG + _;
6177
+ k = f.startG + C;
6183
6178
  break;
6184
6179
  }
6185
6180
  }
@@ -6267,19 +6262,19 @@ function cu(e) {
6267
6262
  b((B) => {
6268
6263
  const F = B.progress;
6269
6264
  if (F.totalRuns === M) return B;
6270
- const V = F.currentGlobalRunIndex < 0 && M > 0;
6265
+ const D = F.currentGlobalRunIndex < 0 && M > 0;
6271
6266
  return {
6272
6267
  progress: {
6273
6268
  ...F,
6274
6269
  totalRuns: M,
6275
- currentGlobalRunIndex: V ? 0 : F.currentGlobalRunIndex,
6276
- lastUpdateBy: V ? "program" : F.lastUpdateBy
6270
+ currentGlobalRunIndex: D ? 0 : F.currentGlobalRunIndex,
6271
+ lastUpdateBy: D ? "program" : F.lastUpdateBy
6277
6272
  }
6278
6273
  };
6279
6274
  });
6280
6275
  }, u = (M, B = "program") => {
6281
- const F = m().progress.currentGlobalRunIndex, V = m().progress, q = V.totalRuns > 0 ? Math.max(-1, Math.min(M, V.totalRuns - 1)) : M;
6282
- F === q && V.lastUpdateBy === B || (b((ue) => ({
6276
+ const F = m().progress.currentGlobalRunIndex, D = m().progress, q = D.totalRuns > 0 ? Math.max(-1, Math.min(M, D.totalRuns - 1)) : M;
6277
+ F === q && D.lastUpdateBy === B || (b((ue) => ({
6283
6278
  progress: {
6284
6279
  ...ue.progress,
6285
6280
  currentGlobalRunIndex: q,
@@ -6292,17 +6287,17 @@ function cu(e) {
6292
6287
  }, T = (M) => {
6293
6288
  const { sectionLoading: B, _loadingStartTime: F } = m().progress;
6294
6289
  if (B === M) return;
6295
- const V = Date.now();
6290
+ const D = Date.now();
6296
6291
  if (M)
6297
6292
  b((q) => ({
6298
6293
  progress: {
6299
6294
  ...q.progress,
6300
6295
  sectionLoading: !0,
6301
- _loadingStartTime: V
6296
+ _loadingStartTime: D
6302
6297
  }
6303
6298
  })), c && c.getState().emit({ type: "loading_start", payload: {} });
6304
6299
  else {
6305
- const ue = (F ? V - F : 0) / 1e3;
6300
+ const ue = (F ? D - F : 0) / 1e3;
6306
6301
  b((de) => ({
6307
6302
  progress: {
6308
6303
  ...de.progress,
@@ -6315,8 +6310,8 @@ function cu(e) {
6315
6310
  b((B) => ({
6316
6311
  progress: { ...B.progress, pageIndex: M }
6317
6312
  }));
6318
- }, I = (M, B) => {
6319
- const V = m().progress.rangeStartGI == null;
6313
+ }, R = (M, B) => {
6314
+ const D = m().progress.rangeStartGI == null;
6320
6315
  if (b((q) => ({
6321
6316
  progress: {
6322
6317
  ...q.progress,
@@ -6326,11 +6321,11 @@ function cu(e) {
6326
6321
  })), c) {
6327
6322
  const q = S();
6328
6323
  c.getState().emit({
6329
- type: V ? "range_select" : "range_change",
6324
+ type: D ? "range_select" : "range_change",
6330
6325
  payload: { startGI: Math.min(M, B), endGI: Math.max(M, B), text: q }
6331
6326
  });
6332
6327
  }
6333
- }, _ = () => {
6328
+ }, C = () => {
6334
6329
  b((M) => ({
6335
6330
  progress: {
6336
6331
  ...M.progress,
@@ -6340,16 +6335,16 @@ function cu(e) {
6340
6335
  })), c && c.getState().emit({ type: "range_clear", payload: {} });
6341
6336
  }, h = (M) => {
6342
6337
  const { rangeStartGI: B, rangeEndGI: F } = m().progress;
6343
- B == null || F == null || (M < B ? b((V) => ({
6344
- progress: { ...V.progress, rangeStartGI: M }
6345
- })) : M > F ? b((V) => ({
6346
- progress: { ...V.progress, rangeEndGI: M }
6347
- })) : _());
6338
+ B == null || F == null || (M < B ? b((D) => ({
6339
+ progress: { ...D.progress, rangeStartGI: M }
6340
+ })) : M > F ? b((D) => ({
6341
+ progress: { ...D.progress, rangeEndGI: M }
6342
+ })) : C());
6348
6343
  }, S = () => {
6349
6344
  var ke;
6350
- const { rangeStartGI: M, rangeEndGI: B, section: F, layout: V } = m().progress;
6351
- if (M == null || B == null || !V) return "";
6352
- const q = ((ke = F.ast) == null ? void 0 : ke.blocks) ?? [], ue = V.prefix, de = [];
6345
+ const { rangeStartGI: M, rangeEndGI: B, section: F, layout: D } = m().progress;
6346
+ if (M == null || B == null || !D) return "";
6347
+ const q = ((ke = F.ast) == null ? void 0 : ke.blocks) ?? [], ue = D.prefix, de = [];
6353
6348
  for (let Re = 0; Re < q.length; Re++) {
6354
6349
  const ee = q[Re];
6355
6350
  if (ee.type !== "paragraph") continue;
@@ -6360,20 +6355,20 @@ function cu(e) {
6360
6355
  }
6361
6356
  }
6362
6357
  return de.join("");
6363
- }, C = (M) => {
6364
- const { totalRuns: B, derivedNav: F } = m().progress, V = F == null ? void 0 : F.readableGi;
6365
- if (!V || B <= 0) return M;
6358
+ }, I = (M) => {
6359
+ const { totalRuns: B, derivedNav: F } = m().progress, D = F == null ? void 0 : F.readableGi;
6360
+ if (!D || B <= 0) return M;
6366
6361
  const q = B, ue = Math.max(0, Math.min(M, q - 1));
6367
- if (V[ue]) return ue;
6362
+ if (D[ue]) return ue;
6368
6363
  let de = ue - 1, ke = ue + 1;
6369
6364
  for (; de >= 0 || ke < q; ) {
6370
- if (ke < q && V[ke]) return ke;
6371
- if (de >= 0 && V[de]) return de;
6365
+ if (ke < q && D[ke]) return ke;
6366
+ if (de >= 0 && D[de]) return de;
6372
6367
  ke += 1, de -= 1;
6373
6368
  }
6374
6369
  return ue;
6375
- }, R = (M, B) => {
6376
- const { totalRuns: F, derivedNav: V } = m().progress, q = V == null ? void 0 : V.readableGi;
6370
+ }, _ = (M, B) => {
6371
+ const { totalRuns: F, derivedNav: D } = m().progress, q = D == null ? void 0 : D.readableGi;
6377
6372
  if (!q || F <= 0) return null;
6378
6373
  if (B > 0) {
6379
6374
  for (let ue = Math.min(Math.max(M, 0), F - 1); ue < F; ue += 1)
@@ -6383,12 +6378,12 @@ function cu(e) {
6383
6378
  if (q[ue]) return ue;
6384
6379
  return null;
6385
6380
  }, O = (M) => {
6386
- const { totalRuns: B, derivedNav: F } = m().progress, V = F == null ? void 0 : F.readableGi;
6387
- if (!V || B <= 0) return null;
6381
+ const { totalRuns: B, derivedNav: F } = m().progress, D = F == null ? void 0 : F.readableGi;
6382
+ if (!D || B <= 0) return null;
6388
6383
  if (M > 0) {
6389
- for (let q = B - 1; q >= 0; q -= 1) if (V[q]) return q;
6384
+ for (let q = B - 1; q >= 0; q -= 1) if (D[q]) return q;
6390
6385
  } else
6391
- for (let q = 0; q < B; q += 1) if (V[q]) return q;
6386
+ for (let q = 0; q < B; q += 1) if (D[q]) return q;
6392
6387
  return null;
6393
6388
  };
6394
6389
  return {
@@ -6401,22 +6396,22 @@ function cu(e) {
6401
6396
  setSectionLoading: T,
6402
6397
  setPageIndex: k,
6403
6398
  // Range Selection API
6404
- setRange: I,
6405
- clearRange: _,
6399
+ setRange: R,
6400
+ clearRange: C,
6406
6401
  extendRange: h,
6407
6402
  getRangeText: S,
6408
6403
  // 네비 API
6409
- snapToReadable: C,
6410
- nextReadableFrom: R,
6404
+ snapToReadable: I,
6405
+ nextReadableFrom: _,
6411
6406
  edgeReadable: O,
6412
- hasReadableInDir: (M, B) => R(M + (B > 0 ? 1 : -1), B) != null,
6407
+ hasReadableInDir: (M, B) => _(M + (B > 0 ? 1 : -1), B) != null,
6413
6408
  computeStepTarget: (M, B) => {
6414
- const { totalRuns: F, derivedNav: V } = m().progress;
6409
+ const { totalRuns: F, derivedNav: D } = m().progress;
6415
6410
  if (!F || F <= 0) return M;
6416
- const q = (V == null ? void 0 : V.groups) ?? [], ue = V == null ? void 0 : V.giToGroupIdx;
6411
+ const q = (D == null ? void 0 : D.groups) ?? [], ue = D == null ? void 0 : D.giToGroupIdx;
6417
6412
  if (!q.length || !ue) {
6418
6413
  const z = F - 1;
6419
- return C(Math.max(0, Math.min(M + B, z)));
6414
+ return I(Math.max(0, Math.min(M + B, z)));
6420
6415
  }
6421
6416
  let de = ue[M] ?? -1;
6422
6417
  if (de < 0 || de >= q.length)
@@ -6428,15 +6423,15 @@ function cu(e) {
6428
6423
  }
6429
6424
  }
6430
6425
  if (de < 0 || de >= q.length)
6431
- return O(B) ?? C(M);
6426
+ return O(B) ?? I(M);
6432
6427
  const ke = (Q) => Q >= 0 && Q < q.length && (q[Q].firstReadableGI ?? -1) >= 0;
6433
6428
  let Re = de + B;
6434
6429
  for (; Re >= 0 && Re < q.length && !ke(Re); )
6435
6430
  Re += B;
6436
6431
  if (Re < 0 || Re >= q.length)
6437
- return O(B) ?? C(M + B);
6432
+ return O(B) ?? I(M + B);
6438
6433
  const ee = q[Re].firstReadableGI;
6439
- return ee >= 0 ? ee : C(M + B);
6434
+ return ee >= 0 ? ee : I(M + B);
6440
6435
  },
6441
6436
  giToPercentTotal: (M) => {
6442
6437
  const B = m().progress.totalRuns;
@@ -6445,8 +6440,8 @@ function cu(e) {
6445
6440
  percentToGITotal: (M) => {
6446
6441
  const B = m().progress.totalRuns;
6447
6442
  if (!B || B <= 1) return 0;
6448
- const F = Math.max(0, Math.min(M, 100)), V = Math.round(F / 100 * (B - 1));
6449
- return Math.max(0, Math.min(V, B - 1));
6443
+ const F = Math.max(0, Math.min(M, 100)), D = Math.round(F / 100 * (B - 1));
6444
+ return Math.max(0, Math.min(D, B - 1));
6450
6445
  }
6451
6446
  }
6452
6447
  };
@@ -6506,27 +6501,27 @@ const fu = ({
6506
6501
  return u;
6507
6502
  }, [m, o]), p = ve(() => {
6508
6503
  const u = [], T = Or();
6509
- return y.forEach((k, I) => {
6510
- u[I] = Pr(k.b, T);
6504
+ return y.forEach((k, R) => {
6505
+ u[R] = Pr(k.b, T);
6511
6506
  }), u;
6512
6507
  }, [y]), f = (u, T, k) => {
6513
6508
  if (!u || u.length === 0) return [];
6514
- const I = [];
6515
- for (const _ of u) {
6516
- const h = _.startG, S = _.endG;
6509
+ const R = [];
6510
+ for (const C of u) {
6511
+ const h = C.startG, S = C.endG;
6517
6512
  if (S < T || h > k) continue;
6518
- const C = Math.max(h, T), R = Math.min(S, k), O = C - h | 0, P = Math.max(0, R - C + 1);
6513
+ const I = Math.max(h, T), _ = Math.min(S, k), O = I - h | 0, P = Math.max(0, _ - I + 1);
6519
6514
  if (P <= 0) continue;
6520
- const w = (_.r0 ?? 0) + O;
6521
- I.push({
6522
- ..._,
6523
- startG: C,
6524
- endG: R,
6515
+ const w = (C.r0 ?? 0) + O;
6516
+ R.push({
6517
+ ...C,
6518
+ startG: I,
6519
+ endG: _,
6525
6520
  r0: w,
6526
6521
  len: P
6527
6522
  });
6528
6523
  }
6529
- return I;
6524
+ return R;
6530
6525
  };
6531
6526
  return /* @__PURE__ */ x(
6532
6527
  "div",
@@ -6563,7 +6558,7 @@ const fu = ({
6563
6558
  /* @__PURE__ */ x("div", { style: { height: 40 } }),
6564
6559
  /* @__PURE__ */ x("div", { style: { flex: 1, overflow: "hidden" }, children: m.map((u, T) => {
6565
6560
  var Q;
6566
- const k = o[u], I = T === 0, _ = T === m.length - 1, h = {
6561
+ const k = o[u], R = T === 0, C = T === m.length - 1, h = {
6567
6562
  boxSizing: "border-box",
6568
6563
  paddingRight: `${i}px`,
6569
6564
  paddingLeft: `${i}px`,
@@ -6575,7 +6570,7 @@ const fu = ({
6575
6570
  height: "auto"
6576
6571
  }, S = `sec-${r.section_id}/blk-${k.id ?? u}`;
6577
6572
  if (k.type === "image") {
6578
- const { src: z, alt: K, width: ne, height: H } = k, oe = ne && H ? `${ne} / ${H}` : "4 / 3", $ = a > 80 ? Math.floor((a - 80) * 0.6) : void 0;
6573
+ const { src: z, alt: K, width: ne, height: H } = k, oe = ne && H ? `${ne} / ${H}` : "4 / 3", V = a > 80 ? Math.floor((a - 80) * 0.6) : void 0;
6579
6574
  return /* @__PURE__ */ x("div", { style: h, children: /* @__PURE__ */ X(
6580
6575
  "div",
6581
6576
  {
@@ -6591,7 +6586,7 @@ const fu = ({
6591
6586
  style: {
6592
6587
  position: "relative",
6593
6588
  width: "100%",
6594
- maxHeight: $,
6589
+ maxHeight: V,
6595
6590
  aspectRatio: oe
6596
6591
  },
6597
6592
  children: /* @__PURE__ */ x(
@@ -6618,26 +6613,26 @@ const fu = ({
6618
6613
  }
6619
6614
  ) }, S);
6620
6615
  }
6621
- const C = k, R = y.findIndex(
6616
+ const I = k, _ = y.findIndex(
6622
6617
  (z) => z.originalBlockIndex === u
6623
- ), O = R >= 0 ? p[R] : void 0, P = C.runs ?? [], w = P.length;
6618
+ ), O = _ >= 0 ? p[_] : void 0, P = I.runs ?? [], w = P.length;
6624
6619
  let E = 0, A = Math.max(0, w - 1);
6625
- I && g.startOffsetInBlock != null && (E = Math.min(Math.max(0, g.startOffsetInBlock), A)), _ && g.endOffsetInBlock != null && (A = Math.max(
6620
+ R && g.startOffsetInBlock != null && (E = Math.min(Math.max(0, g.startOffsetInBlock), A)), C && g.endOffsetInBlock != null && (A = Math.max(
6626
6621
  E,
6627
6622
  Math.min(g.endOffsetInBlock, A)
6628
6623
  ));
6629
- const W = E > 0, M = d[u] ?? 0, B = v[u] ?? [], F = M + E, V = M + A;
6630
- let q = f(B, F, V);
6624
+ const W = E > 0, M = d[u] ?? 0, B = v[u] ?? [], F = M + E, D = M + A;
6625
+ let q = f(B, F, D);
6631
6626
  const ue = M + E;
6632
6627
  q = q.map((z) => {
6633
- const K = Math.max(0, (z.startG ?? F) - ue), ne = z.len ?? Math.max(1, (z.endG ?? V) - (z.startG ?? F) + 1);
6628
+ const K = Math.max(0, (z.startG ?? F) - ue), ne = z.len ?? Math.max(1, (z.endG ?? D) - (z.startG ?? F) + 1);
6634
6629
  return {
6635
6630
  ...z,
6636
6631
  r0: K,
6637
6632
  len: ne
6638
6633
  };
6639
6634
  });
6640
- const de = E <= A ? P.slice(E, A + 1) : [], ke = C.list ? C.list.level * 24 : 0, Re = ((Q = C.list) == null ? void 0 : Q.kind) === "bullet" ? C.list.glyph ?? "•" : void 0, ee = W ? void 0 : O ?? Re;
6635
+ const de = E <= A ? P.slice(E, A + 1) : [], ke = I.list ? I.list.level * 24 : 0, Re = ((Q = I.list) == null ? void 0 : Q.kind) === "bullet" ? I.list.glyph ?? "•" : void 0, ee = W ? void 0 : O ?? Re;
6641
6636
  return /* @__PURE__ */ x("div", { style: h, children: /* @__PURE__ */ X(
6642
6637
  "p",
6643
6638
  {
@@ -6645,12 +6640,12 @@ const fu = ({
6645
6640
  width: "100%",
6646
6641
  margin: "8px 0",
6647
6642
  paddingLeft: ke,
6648
- textAlign: C.textAlign,
6643
+ textAlign: I.textAlign,
6649
6644
  whiteSpace: "pre-wrap",
6650
6645
  boxSizing: "border-box"
6651
6646
  },
6652
6647
  children: [
6653
- C.list && ee ? /* @__PURE__ */ x(
6648
+ I.list && ee ? /* @__PURE__ */ x(
6654
6649
  "span",
6655
6650
  {
6656
6651
  "aria-hidden": !0,
@@ -6746,13 +6741,13 @@ function hu(e) {
6746
6741
  var E;
6747
6742
  const w = ((E = document == null ? void 0 : document.body) == null ? void 0 : E.style) ?? null;
6748
6743
  w && u.current.prevUserSelect != null && (w.userSelect = u.current.prevUserSelect, u.current.prevUserSelect = null), u.current.capturedEl && u.current.pid != null && typeof u.current.capturedEl.hasPointerCapture == "function" && u.current.capturedEl.hasPointerCapture(u.current.pid) && u.current.capturedEl.releasePointerCapture(u.current.pid), u.current.capturedEl = null;
6749
- }, I = dt.useCallback(
6744
+ }, R = dt.useCallback(
6750
6745
  (w) => {
6751
6746
  const E = s ?? i;
6752
6747
  E != null && E(w.target) || (u.current.pid = w.pointerId, u.current.startX = w.clientX, u.current.startY = w.clientY, u.current.startT = w.timeStamp, u.current.swiping = !1, u.current.canceledClick = !1, u.current.capturedEl = w.currentTarget);
6753
6748
  },
6754
6749
  [s, i]
6755
- ), _ = dt.useCallback(
6750
+ ), C = dt.useCallback(
6756
6751
  (w) => {
6757
6752
  var B;
6758
6753
  if (u.current.pid == null || w.pointerId !== u.current.pid) return;
@@ -6766,8 +6761,8 @@ function hu(e) {
6766
6761
  F.setPointerCapture(w.pointerId);
6767
6762
  } catch {
6768
6763
  }
6769
- const V = ((B = document == null ? void 0 : document.body) == null ? void 0 : B.style) ?? null;
6770
- V && (u.current.prevUserSelect = V.userSelect ?? null, V.userSelect = "none"), w.preventDefault();
6764
+ const D = ((B = document == null ? void 0 : document.body) == null ? void 0 : B.style) ?? null;
6765
+ D && (u.current.prevUserSelect = D.userSelect ?? null, D.userSelect = "none"), w.preventDefault();
6771
6766
  }
6772
6767
  return;
6773
6768
  }
@@ -6795,13 +6790,13 @@ function hu(e) {
6795
6790
  ]
6796
6791
  ), S = dt.useCallback(() => {
6797
6792
  u.current.swiping && (m == null || m()), k(), u.current.pid = null, u.current.swiping = !1, u.current.canceledClick = !1;
6798
- }, [m]), C = dt.useCallback(
6793
+ }, [m]), I = dt.useCallback(
6799
6794
  (w) => {
6800
6795
  var E, A;
6801
6796
  (A = (E = u.current.capturedEl) == null ? void 0 : E.hasPointerCapture) != null && A.call(E, w.pointerId) || u.current.pid != null && u.current.swiping && (m == null || m(), k(), u.current.pid = null, u.current.swiping = !1, u.current.canceledClick = !1);
6802
6797
  },
6803
6798
  [m]
6804
- ), R = dt.useCallback(() => {
6799
+ ), _ = dt.useCallback(() => {
6805
6800
  u.current.pid != null && u.current.swiping && (m == null || m()), k(), u.current.pid = null, u.current.swiping = !1, u.current.canceledClick = !1;
6806
6801
  }, [m]), O = dt.useCallback(
6807
6802
  (w) => {
@@ -6834,12 +6829,12 @@ function hu(e) {
6834
6829
  },
6835
6830
  []
6836
6831
  ), {
6837
- onPointerDown: I,
6838
- onPointerMove: _,
6832
+ onPointerDown: R,
6833
+ onPointerMove: C,
6839
6834
  onPointerUp: h,
6840
6835
  onPointerCancel: S,
6841
- onPointerLeave: C,
6842
- onLostPointerCapture: R,
6836
+ onPointerLeave: I,
6837
+ onLostPointerCapture: _,
6843
6838
  onClick: O,
6844
6839
  onDoubleClick: P
6845
6840
  };
@@ -6998,10 +6993,10 @@ function Tu() {
6998
6993
  var E = d, A = v;
6999
6994
  return d = v = void 0, p = w, b = c.apply(A, E), b;
7000
6995
  }
7001
- function I(w) {
6996
+ function R(w) {
7002
6997
  return p = w, m = setTimeout(S, l), f ? k(w) : b;
7003
6998
  }
7004
- function _(w) {
6999
+ function C(w) {
7005
7000
  var E = w - y, A = w - p, W = l - E;
7006
7001
  return u ? i(W, g - A) : W;
7007
7002
  }
@@ -7012,29 +7007,29 @@ function Tu() {
7012
7007
  function S() {
7013
7008
  var w = t();
7014
7009
  if (h(w))
7015
- return C(w);
7016
- m = setTimeout(S, _(w));
7010
+ return I(w);
7011
+ m = setTimeout(S, C(w));
7017
7012
  }
7018
- function C(w) {
7013
+ function I(w) {
7019
7014
  return m = void 0, T && d ? k(w) : (d = v = void 0, b);
7020
7015
  }
7021
- function R() {
7016
+ function _() {
7022
7017
  m !== void 0 && clearTimeout(m), p = 0, d = y = v = m = void 0;
7023
7018
  }
7024
7019
  function O() {
7025
- return m === void 0 ? b : C(t());
7020
+ return m === void 0 ? b : I(t());
7026
7021
  }
7027
7022
  function P() {
7028
7023
  var w = t(), E = h(w);
7029
7024
  if (d = arguments, v = this, y = w, E) {
7030
7025
  if (m === void 0)
7031
- return I(y);
7026
+ return R(y);
7032
7027
  if (u)
7033
7028
  return clearTimeout(m), m = setTimeout(S, l), k(y);
7034
7029
  }
7035
7030
  return m === void 0 && (m = setTimeout(S, l)), b;
7036
7031
  }
7037
- return P.cancel = R, P.flush = O, P;
7032
+ return P.cancel = _, P.flush = O, P;
7038
7033
  }
7039
7034
  return ir = s, ir;
7040
7035
  }
@@ -7116,17 +7111,17 @@ async function Ou({
7116
7111
  const p = Mu(y);
7117
7112
  lt(p, y);
7118
7113
  try {
7119
- const k = Math.abs(b - 1) > 1e-3, I = 1 / b;
7120
- k && (t.style.transform = `scale(${I})`, t.style.transformOrigin = "top left");
7121
- const _ = Math.max(0, e.offsetWidth || 0), h = Math.max(0, Math.min(_, o));
7114
+ const k = Math.abs(b - 1) > 1e-3, R = 1 / b;
7115
+ k && (t.style.transform = `scale(${R})`, t.style.transformOrigin = "top left");
7116
+ const C = Math.max(0, e.offsetWidth || 0), h = Math.max(0, Math.min(C, o));
7122
7117
  t.style.maxWidth = `${h}px`, lt(p, y);
7123
7118
  let S = Math.round(n.offsetHeight || 0);
7124
7119
  S || (S = Math.max(0, n.clientHeight | 0)), console.log(
7125
7120
  "[calcPages] playbackScale:",
7126
7121
  b.toFixed(4),
7127
7122
  k ? "(scaled, applying inverse)" : "(no scale)"
7128
- ), console.log("[calcPages] viewWidth:", _), console.log("[calcPages] pageBoxWidth:", h), console.log("[calcPages] maxPageHeight:", S), console.log("[calcPages] contentArea rect:", n.getBoundingClientRect()), console.log("[calcPages] measureRoot rect:", t.getBoundingClientRect());
7129
- const C = 1.5, R = (H, oe) => oe + H <= S - C, O = getComputedStyle(e), P = {
7123
+ ), console.log("[calcPages] viewWidth:", C), console.log("[calcPages] pageBoxWidth:", h), console.log("[calcPages] maxPageHeight:", S), console.log("[calcPages] contentArea rect:", n.getBoundingClientRect()), console.log("[calcPages] measureRoot rect:", t.getBoundingClientRect());
7124
+ const I = 1.5, _ = (H, oe) => oe + H <= S - I, O = getComputedStyle(e), P = {
7130
7125
  letterSpacing: O.letterSpacing,
7131
7126
  wordSpacing: O.wordSpacing,
7132
7127
  fontKerning: O.fontKerning || "normal",
@@ -7144,16 +7139,16 @@ async function Ou({
7144
7139
  W.style.boxSizing = "border-box", W.style.width = `${E}px`, W.style.maxWidth = `${E}px`, W.style.margin = "0 auto", W.style.display = "flex", n.appendChild(W);
7145
7140
  const M = document.createElement("div");
7146
7141
  M.style.boxSizing = "border-box", M.style.paddingRight = `${i}px`, M.style.paddingLeft = `${i}px`, M.style.width = `${E}px`, M.style.maxWidth = `${E}px`, M.style.margin = "0 auto", M.style.display = "flex", M.style.justifyContent = "center", M.style.height = "auto", W.appendChild(M);
7147
- const B = /* @__PURE__ */ new Map(), F = {}, V = Eu(p, y, r.length), q = (H, oe) => {
7148
- const $ = document.createElement("p");
7149
- return $.style.margin = "8px 0", $.style.paddingLeft = oe ? `${oe}px` : "0", $.style.textAlign = H.textAlign ?? "start", $.style.whiteSpace = "pre-wrap", $.style.lineHeight = String(l), $.style.fontSize = `${c}px`, $.style.boxSizing = "border-box", $.style.fontFamily = s ?? "", $.style.width = "100%", w($), $;
7142
+ const B = /* @__PURE__ */ new Map(), F = {}, D = Eu(p, y, r.length), q = (H, oe) => {
7143
+ const V = document.createElement("p");
7144
+ return V.style.margin = "8px 0", V.style.paddingLeft = oe ? `${oe}px` : "0", V.style.textAlign = H.textAlign ?? "start", V.style.whiteSpace = "pre-wrap", V.style.lineHeight = String(l), V.style.fontSize = `${c}px`, V.style.boxSizing = "border-box", V.style.fontFamily = s ?? "", V.style.width = "100%", w(V), V;
7150
7145
  }, ue = (H, oe) => {
7151
- const $ = oe ?? [], J = document.createDocumentFragment();
7152
- for (let se = 0; se < $.length; se++) {
7153
- const re = $[se], pe = document.createElement("span");
7146
+ const V = oe ?? [], J = document.createDocumentFragment();
7147
+ for (let se = 0; se < V.length; se++) {
7148
+ const re = V[se], pe = document.createElement("span");
7154
7149
  pe.dataset.runbox = String(se), pe.style.whiteSpace = "pre-wrap";
7155
7150
  const le = document.createElement("span");
7156
- if (le.dataset.run = String(se), le.textContent = (re == null ? void 0 : re.text) ?? "", le.style.whiteSpace = "pre-wrap", re != null && re.bold && (le.style.fontWeight = "700"), re != null && re.italic && (le.style.fontStyle = "italic"), re != null && re.underline && (le.style.textDecoration = "underline"), pe.appendChild(le), a && (re != null && re.split) && se !== $.length - 1) {
7151
+ if (le.dataset.run = String(se), le.textContent = (re == null ? void 0 : re.text) ?? "", le.style.whiteSpace = "pre-wrap", re != null && re.bold && (le.style.fontWeight = "700"), re != null && re.italic && (le.style.fontStyle = "italic"), re != null && re.underline && (le.style.textDecoration = "underline"), pe.appendChild(le), a && (re != null && re.split) && se !== V.length - 1) {
7157
7152
  const we = Math.max(0, (d ?? 0) / 2), me = document.createElement("span");
7158
7153
  me.style.display = "inline-block", me.style.width = `${we}px`;
7159
7154
  const Te = document.createElement("span");
@@ -7167,16 +7162,16 @@ async function Ou({
7167
7162
  }
7168
7163
  H.appendChild(J);
7169
7164
  }, de = m > 80 ? Math.floor((m - 80) * 0.6) : void 0, ke = (H) => {
7170
- const oe = H != null && H.width && (H != null && H.height) ? `${H.width} / ${H.height}` : "4 / 3", $ = document.createElement("div");
7171
- $.style.margin = "12px 0", $.style.textAlign = "center", $.style.width = `${A}px`;
7165
+ const oe = H != null && H.width && (H != null && H.height) ? `${H.width} / ${H.height}` : "4 / 3", V = document.createElement("div");
7166
+ V.style.margin = "12px 0", V.style.textAlign = "center", V.style.width = `${A}px`;
7172
7167
  const J = document.createElement("div");
7173
7168
  J.style.position = "relative", J.style.width = "100%", de && (J.style.maxHeight = `${de}px`), J.style.aspectRatio = oe;
7174
7169
  const se = document.createElement("div");
7175
- if (se.style.position = "absolute", se.style.inset = "0", se.style.width = "100%", se.style.height = "100%", J.appendChild(se), $.appendChild(J), H != null && H.alt) {
7170
+ if (se.style.position = "absolute", se.style.inset = "0", se.style.width = "100%", se.style.height = "100%", J.appendChild(se), V.appendChild(J), H != null && H.alt) {
7176
7171
  const re = document.createElement("div");
7177
- re.style.fontSize = "12px", re.style.color = "#6B7280", re.style.marginTop = "4px", re.textContent = String(H.alt), w(re), $.appendChild(re);
7172
+ re.style.fontSize = "12px", re.style.color = "#6B7280", re.style.marginTop = "4px", re.textContent = String(H.alt), w(re), V.appendChild(re);
7178
7173
  }
7179
- return $;
7174
+ return V;
7180
7175
  };
7181
7176
  for (let H = 0; H < r.length; H++) {
7182
7177
  lt(p, y);
@@ -7185,26 +7180,26 @@ async function Ou({
7185
7180
  const Te = oe.block, Oe = ke(Te);
7186
7181
  M.appendChild(Oe);
7187
7182
  const Ne = Oe.getBoundingClientRect(), { mt: Le, mb: $e } = sr(Oe);
7188
- F[H] = { contentH: Math.ceil(Ne.height), mt: Le, mb: $e }, await V(24);
7183
+ F[H] = { contentH: Math.ceil(Ne.height), mt: Le, mb: $e }, await D(24);
7189
7184
  continue;
7190
7185
  }
7191
- const $ = oe.block, J = $.list ? ($.list.level ?? 0) * 24 : 0, se = oe.paraIndex ?? 0, re = g[se] ?? (((f = $.list) == null ? void 0 : f.kind) === "bullet" ? ((u = $.list) == null ? void 0 : u.glyph) ?? "•" : void 0);
7192
- if (!!($.list && re)) {
7193
- const Te = q($, J);
7186
+ const V = oe.block, J = V.list ? (V.list.level ?? 0) * 24 : 0, se = oe.paraIndex ?? 0, re = g[se] ?? (((f = V.list) == null ? void 0 : f.kind) === "bullet" ? ((u = V.list) == null ? void 0 : u.glyph) ?? "•" : void 0);
7187
+ if (!!(V.list && re)) {
7188
+ const Te = q(V, J);
7194
7189
  Te.dataset.variant = "with";
7195
- const Oe = q($, J);
7190
+ const Oe = q(V, J);
7196
7191
  Oe.dataset.variant = "no";
7197
7192
  const Ne = document.createElement("span");
7198
- Ne.textContent = `${re} `, Ne.style.minWidth = "16px", Ne.style.display = "inline-block", Ne.style.whiteSpace = "nowrap", Ne.style.userSelect = "none", Te.appendChild(Ne), ue(Te, $.runs), ue(Oe, $.runs);
7193
+ Ne.textContent = `${re} `, Ne.style.minWidth = "16px", Ne.style.display = "inline-block", Ne.style.whiteSpace = "nowrap", Ne.style.userSelect = "none", Te.appendChild(Ne), ue(Te, V.runs), ue(Oe, V.runs);
7199
7194
  const Le = document.createDocumentFragment();
7200
7195
  Le.appendChild(Te), Le.appendChild(Oe), M.appendChild(Le);
7201
7196
  } else {
7202
- const Te = q($, J);
7203
- Te.dataset.variant = "with", ue(Te, $.runs), M.appendChild(Te);
7197
+ const Te = q(V, J);
7198
+ Te.dataset.variant = "with", ue(Te, V.runs), M.appendChild(Te);
7204
7199
  }
7205
7200
  const le = M.querySelector('p[data-variant="with"]'), we = M.querySelector('p[data-variant="no"]'), me = we ?? le;
7206
7201
  if (le && me) {
7207
- const Te = Ho(le), Oe = Ho(me), { mt: Ne, mb: Le } = sr(le), { mt: $e, mb: ut } = sr(me), Qe = ((T = $.runs) == null ? void 0 : T.length) ?? 0, He = we ? Oe : Te, ot = we ? $e : Ne, Je = we ? ut : Le;
7202
+ const Te = Ho(le), Oe = Ho(me), { mt: Ne, mb: Le } = sr(le), { mt: $e, mb: ut } = sr(me), Qe = ((T = V.runs) == null ? void 0 : T.length) ?? 0, He = we ? Oe : Te, ot = we ? $e : Ne, Je = we ? ut : Le;
7208
7203
  if (H < 3) {
7209
7204
  const bt = le.getBoundingClientRect().height;
7210
7205
  console.log(
@@ -7221,26 +7216,26 @@ async function Ou({
7221
7216
  mbNo: Je
7222
7217
  });
7223
7218
  }
7224
- await V(24);
7219
+ await D(24);
7225
7220
  }
7226
7221
  lt(p, y), M.innerHTML = "";
7227
- const Re = (H, oe, $, J) => {
7228
- if (oe > $) return { top: 0, content: 0, mb: 0 };
7229
- const se = J ? H.lastBottomNo : H.lastBottomWith, re = J ? H.mtNo : H.mtWith, pe = J ? H.mbNo : H.mbWith, le = J ? 0 : re, we = oe > 0 ? se[oe - 1] ?? 0 : 0, me = Math.max(0, (se[$] ?? 0) - we);
7222
+ const Re = (H, oe, V, J) => {
7223
+ if (oe > V) return { top: 0, content: 0, mb: 0 };
7224
+ const se = J ? H.lastBottomNo : H.lastBottomWith, re = J ? H.mtNo : H.mtWith, pe = J ? H.mbNo : H.mbWith, le = J ? 0 : re, we = oe > 0 ? se[oe - 1] ?? 0 : 0, me = Math.max(0, (se[V] ?? 0) - we);
7230
7225
  return { top: le, content: me, mb: pe };
7231
7226
  }, ee = [];
7232
7227
  let Q = 0, z, K = null, ne = null;
7233
7228
  for (; Q < r.length; ) {
7234
7229
  lt(p, y);
7235
7230
  const H = Q;
7236
- let oe = 0, $ = 0, J = z;
7231
+ let oe = 0, V = 0, J = z;
7237
7232
  J != null && K === Q && ne != null && (J = Math.max(J, ne + 1));
7238
7233
  let se = -1, re;
7239
7234
  for (; Q < r.length; ) {
7240
7235
  if (lt(p, y), r[Q].kind === "image") {
7241
- const He = F[Q] ?? { contentH: 0, mt: 0, mb: 0 }, Je = (oe === 0 ? He.mt : $ + He.mt) + He.contentH;
7242
- if (R(Je, oe)) {
7243
- oe += Je, se = Q, re = void 0, $ = He.mb, Q += 1, z = void 0, K = null, ne = null;
7236
+ const He = F[Q] ?? { contentH: 0, mt: 0, mb: 0 }, Je = (oe === 0 ? He.mt : V + He.mt) + He.contentH;
7237
+ if (_(Je, oe)) {
7238
+ oe += Je, se = Q, re = void 0, V = He.mb, Q += 1, z = void 0, K = null, ne = null;
7244
7239
  continue;
7245
7240
  }
7246
7241
  if (oe === 0) {
@@ -7249,7 +7244,7 @@ async function Ou({
7249
7244
  endBlock: Q,
7250
7245
  ...J != null ? { startOffsetInBlock: J } : {}
7251
7246
  // 이미지에는 run 오프셋 개념이 없어 endOffsetInBlock 생략
7252
- }), Q += 1, z = void 0, K = null, ne = null, $ = 0;
7247
+ }), Q += 1, z = void 0, K = null, ne = null, V = 0;
7253
7248
  break;
7254
7249
  }
7255
7250
  break;
@@ -7259,16 +7254,16 @@ async function Ou({
7259
7254
  Q += 1, z = void 0, K = null, ne = null;
7260
7255
  continue;
7261
7256
  }
7262
- const Te = me > 0, Oe = Re(le, me, we - 1, Te), Le = (oe === 0 ? Oe.top : $ + Oe.top) + Oe.content;
7263
- if (R(Le, oe)) {
7264
- oe += Le, se = Q, re = we - 1, $ = Oe.mb, Q += 1, z = void 0, K = null, ne = null;
7257
+ const Te = me > 0, Oe = Re(le, me, we - 1, Te), Le = (oe === 0 ? Oe.top : V + Oe.top) + Oe.content;
7258
+ if (_(Le, oe)) {
7259
+ oe += Le, se = Q, re = we - 1, V = Oe.mb, Q += 1, z = void 0, K = null, ne = null;
7265
7260
  continue;
7266
7261
  }
7267
7262
  let $e = me, ut = we - 1, Qe = me - 1;
7268
7263
  for (; $e <= ut; ) {
7269
7264
  lt(p, y);
7270
- const He = $e + ut >> 1, ot = Re(le, me, He, Te), Je = (oe === 0 ? ot.top : $ + ot.top) + ot.content;
7271
- R(Je, oe) ? (Qe = He, $e = He + 1) : ut = He - 1;
7265
+ const He = $e + ut >> 1, ot = Re(le, me, He, Te), Je = (oe === 0 ? ot.top : V + ot.top) + ot.content;
7266
+ _(Je, oe) ? (Qe = He, $e = He + 1) : ut = He - 1;
7272
7267
  }
7273
7268
  if (Qe >= me) {
7274
7269
  ee.push({
@@ -7276,7 +7271,7 @@ async function Ou({
7276
7271
  endBlock: Q,
7277
7272
  ...J != null ? { startOffsetInBlock: J } : {},
7278
7273
  endOffsetInBlock: Qe
7279
- }), z = Qe + 1, K = Q, ne = Qe, $ = 0;
7274
+ }), z = Qe + 1, K = Q, ne = Qe, V = 0;
7280
7275
  break;
7281
7276
  }
7282
7277
  if (oe > 0) {
@@ -7285,7 +7280,7 @@ async function Ou({
7285
7280
  endBlock: se >= 0 ? se : Math.min(Q - 1, r.length - 1),
7286
7281
  ...J != null ? { startOffsetInBlock: J } : {},
7287
7282
  ...re != null ? { endOffsetInBlock: re } : {}
7288
- }), $ = 0;
7283
+ }), V = 0;
7289
7284
  break;
7290
7285
  } else {
7291
7286
  const He = me;
@@ -7294,7 +7289,7 @@ async function Ou({
7294
7289
  endBlock: Q,
7295
7290
  ...J != null ? { startOffsetInBlock: J } : {},
7296
7291
  endOffsetInBlock: He
7297
- }), z = He + 1, K = Q, ne = He, $ = 0;
7292
+ }), z = He + 1, K = Q, ne = He, V = 0;
7298
7293
  break;
7299
7294
  }
7300
7295
  }
@@ -7366,21 +7361,21 @@ function Au(e) {
7366
7361
  }
7367
7362
  function Lu() {
7368
7363
  var zr;
7369
- const e = ji(), t = j((D) => D.section), n = j((D) => D.sectionLoading), r = j((D) => D.rangeStartGI), o = j((D) => D.rangeEndGI), i = r != null && o != null, s = Et(), c = Y((D) => D.theme), l = bn[c], a = Y((D) => D.fontFamily), d = Y((D) => D.fontSizePx), v = Y((D) => D.lineHeight), g = Y((D) => D.marginX), b = Y((D) => D.viewportHeight), m = 860, y = ie(null), { items: p } = ve(() => {
7370
- var D;
7371
- return Au(((D = t == null ? void 0 : t.ast) == null ? void 0 : D.blocks) ?? []);
7364
+ const e = ji(), t = j(($) => $.section), n = j(($) => $.sectionLoading), r = j(($) => $.rangeStartGI), o = j(($) => $.rangeEndGI), i = r != null && o != null, s = Et(), c = Y(($) => $.theme), l = bn[c], a = Y(($) => $.fontFamily), d = Y(($) => $.fontSizePx), v = Y(($) => $.lineHeight), g = Y(($) => $.marginX), b = Y(($) => $.viewportHeight), m = 860, y = ie(null), { items: p } = ve(() => {
7365
+ var $;
7366
+ return Au((($ = t == null ? void 0 : t.ast) == null ? void 0 : $.blocks) ?? []);
7372
7367
  }, [t]), f = ve(() => {
7373
- const D = [], ze = Or();
7368
+ const $ = [], ze = Or();
7374
7369
  return p.forEach((We) => {
7375
7370
  if (We.kind === "paragraph") {
7376
7371
  const Ct = We.paraIndex;
7377
- D[Ct] = Pr(We.block, ze);
7372
+ $[Ct] = Pr(We.block, ze);
7378
7373
  }
7379
- }), D;
7374
+ }), $;
7380
7375
  }, [p]), [u, T] = et({
7381
7376
  pages: [],
7382
7377
  pageByRunIndex: null
7383
- }), k = j((D) => D.pageIndex), I = j((D) => D.setPageIndex), _ = ie(0), h = ie(null), [S, C] = et(!1), [R, O] = et(null), [P, w] = et(!1), E = ve(
7378
+ }), k = j(($) => $.pageIndex), R = j(($) => $.setPageIndex), C = ie(0), h = ie(null), [S, I] = et(!1), [_, O] = et(null), [P, w] = et(!1), E = ve(
7384
7379
  () => ({
7385
7380
  flex: 1,
7386
7381
  fontFamily: a,
@@ -7401,33 +7396,33 @@ function Lu() {
7401
7396
  breakGapPx: W,
7402
7397
  slash: M
7403
7398
  } = Y(
7404
- nn((D) => {
7399
+ nn(($) => {
7405
7400
  var ze;
7406
7401
  return {
7407
- showSplit: D.showSplit,
7408
- breakGapPx: D.breakGapPx ?? 0,
7409
- slash: ((ze = D.breakMarks) == null ? void 0 : ze.slash) ?? !1
7402
+ showSplit: $.showSplit,
7403
+ breakGapPx: $.breakGapPx ?? 0,
7404
+ slash: ((ze = $.breakMarks) == null ? void 0 : ze.slash) ?? !1
7410
7405
  };
7411
7406
  })
7412
7407
  ), B = Rt();
7413
7408
  Se(() => {
7414
7409
  u && u.pages.length && (console.log("그래서 총 페이지", u.pages.length), (async () => {
7415
- const D = B.getState().progress.setSectionLoading;
7416
- await vt(), await vt(), await vt(), await vt(), console.log("recalc종료"), D(!1);
7410
+ const $ = B.getState().progress.setSectionLoading;
7411
+ await vt(), await vt(), await vt(), await vt(), console.log("recalc종료"), $(!1);
7417
7412
  })());
7418
7413
  }, [u, B]);
7419
7414
  const F = Z(() => {
7420
7415
  console.log("@@@@@@recalc호출");
7421
- const D = y.current, ze = le.current, We = we.current;
7422
- if (console.log("showSplit", A), !D || !ze || !We || p.length === 0) {
7423
- T({ pages: [], pageByRunIndex: null }), I(0);
7416
+ const $ = y.current, ze = le.current, We = we.current;
7417
+ if (console.log("showSplit", A), !$ || !ze || !We || p.length === 0) {
7418
+ T({ pages: [], pageByRunIndex: null }), R(0);
7424
7419
  return;
7425
7420
  }
7426
7421
  (async () => {
7427
7422
  const Ct = performance.now();
7428
7423
  try {
7429
7424
  const it = s.getState().playbackScale, { pages: Bt, pageByRunIndex: Di } = await Ou({
7430
- viewHost: D,
7425
+ viewHost: $,
7431
7426
  measureRoot: ze,
7432
7427
  contentArea: We,
7433
7428
  items: p,
@@ -7446,7 +7441,7 @@ function Lu() {
7446
7441
  }), $i = performance.now();
7447
7442
  console.log(
7448
7443
  `✅ calcPages 완료: ${($i - Ct).toFixed(1)} ms (${Bt.length} pages)`
7449
- ), T({ pages: Bt, pageByRunIndex: Di }), I(0);
7444
+ ), T({ pages: Bt, pageByRunIndex: Di }), R(0);
7450
7445
  } catch (it) {
7451
7446
  if (it instanceof Fi) {
7452
7447
  console.log("이젠실행 취소 들어옴!");
@@ -7456,7 +7451,7 @@ function Lu() {
7456
7451
  }
7457
7452
  })();
7458
7453
  }, [
7459
- I,
7454
+ R,
7460
7455
  p,
7461
7456
  m,
7462
7457
  g,
@@ -7470,56 +7465,56 @@ function Lu() {
7470
7465
  s,
7471
7466
  b,
7472
7467
  e
7473
- ]), V = j((D) => D.setCurrentGlobalRunIndex), q = j((D) => {
7468
+ ]), D = j(($) => $.setCurrentGlobalRunIndex), q = j(($) => {
7474
7469
  var ze;
7475
- return ((ze = D.layout) == null ? void 0 : ze.prefix) ?? [];
7476
- }), ue = _e((D) => D.syncToGI), de = Z(
7477
- (D) => {
7478
- const ze = u.pages.length + 1, We = k + D;
7470
+ return ((ze = $.layout) == null ? void 0 : ze.prefix) ?? [];
7471
+ }), ue = _e(($) => $.syncToGI), de = Z(
7472
+ ($) => {
7473
+ const ze = u.pages.length + 1, We = k + $;
7479
7474
  if (We < 0 || We >= ze) return;
7480
7475
  const Ct = k === u.pages.length;
7481
7476
  if (We === u.pages.length) {
7482
- I(We);
7477
+ R(We);
7483
7478
  return;
7484
7479
  }
7485
- if (Ct && D === -1) {
7480
+ if (Ct && $ === -1) {
7486
7481
  const Bt = No(u.pages[We], p, q);
7487
- Bt != null && (V(Bt, "scrubber-step"), ue(Bt)), I(We);
7482
+ Bt != null && (D(Bt, "scrubber-step"), ue(Bt)), R(We);
7488
7483
  return;
7489
7484
  }
7490
7485
  const it = No(u.pages[We], p, q);
7491
- it != null ? (V(it, "scrubber-step"), ue(it)) : I(We);
7486
+ it != null ? (D(it, "scrubber-step"), ue(it)) : R(We);
7492
7487
  },
7493
- [k, u.pages, p, q, V, I, ue]
7488
+ [k, u.pages, p, q, D, R, ue]
7494
7489
  ), ke = Z(() => {
7495
- S || _.current !== 0 ? (O("prev"), C(!1)) : de(-1);
7490
+ S || C.current !== 0 ? (O("prev"), I(!1)) : de(-1);
7496
7491
  }, [S, de]), Re = Z(() => {
7497
- S || _.current !== 0 ? (O("next"), C(!1)) : de(1);
7492
+ S || C.current !== 0 ? (O("next"), I(!1)) : de(1);
7498
7493
  }, [S, de]), ee = kn(), Q = Z(() => {
7499
- const { isSettingsOpen: D, setSettingsOpen: ze, toggleOverlays: We } = ee.getState();
7500
- D ? ze(!1) : We();
7501
- }, [ee]), z = u.pages.length + 1, K = ((zr = y.current) == null ? void 0 : zr.clientWidth) || 400, ne = Z((D) => {
7494
+ const { isSettingsOpen: $, setSettingsOpen: ze, toggleOverlays: We } = ee.getState();
7495
+ $ ? ze(!1) : We();
7496
+ }, [ee]), z = u.pages.length + 1, K = ((zr = y.current) == null ? void 0 : zr.clientWidth) || 400, ne = Z(($) => {
7502
7497
  var it;
7503
7498
  const ze = h.current;
7504
7499
  if (!ze) return;
7505
- const We = ((it = y.current) == null ? void 0 : it.clientWidth) || 1, Ct = D / We * 33.333;
7500
+ const We = ((it = y.current) == null ? void 0 : it.clientWidth) || 1, Ct = $ / We * 33.333;
7506
7501
  ze.style.transform = `translate3d(${-33.333 + Ct}%, 0, 0)`;
7507
7502
  }, []), H = Z(
7508
- (D) => {
7509
- k === 0 && D > 0 || k >= z - 1 && D < 0 || (_.current = D, ne(D), S || C(!0));
7503
+ ($) => {
7504
+ k === 0 && $ > 0 || k >= z - 1 && $ < 0 || (C.current = $, ne($), S || I(!0));
7510
7505
  },
7511
7506
  [k, z, ne, S]
7512
7507
  ), oe = Z(() => {
7513
- _.current = 0, C(!1);
7514
- const D = h.current;
7515
- D && (D.style.transition = "transform 250ms ease-out", D.style.transform = "translate3d(-33.333%, 0, 0)");
7516
- }, []), $ = Z(
7517
- (D) => {
7518
- if (D.target !== D.currentTarget || D.propertyName !== "transform") return;
7519
- const ze = R;
7520
- w(!0), O(null), _.current = 0, ze === "prev" ? de(-1) : ze === "next" && de(1);
7508
+ C.current = 0, I(!1);
7509
+ const $ = h.current;
7510
+ $ && ($.style.transition = "transform 250ms ease-out", $.style.transform = "translate3d(-33.333%, 0, 0)");
7511
+ }, []), V = Z(
7512
+ ($) => {
7513
+ if ($.target !== $.currentTarget || $.propertyName !== "transform") return;
7514
+ const ze = _;
7515
+ w(!0), O(null), C.current = 0, ze === "prev" ? de(-1) : ze === "next" && de(1);
7521
7516
  },
7522
- [R, de]
7517
+ [_, de]
7523
7518
  );
7524
7519
  Tt(() => {
7525
7520
  P && requestAnimationFrame(() => {
@@ -7529,12 +7524,12 @@ function Lu() {
7529
7524
  });
7530
7525
  }, [P]);
7531
7526
  const J = yn(), se = Z(
7532
- (D) => i || zu(D) ? !0 : Bu(D),
7527
+ ($) => i || zu($) ? !0 : Bu($),
7533
7528
  [i]
7534
7529
  ), re = Z(
7535
- (D) => {
7530
+ ($) => {
7536
7531
  const ze = J.getState().status;
7537
- return ze === "playing" || ze === "loading" ? !0 : se(D);
7532
+ return ze === "playing" || ze === "loading" ? !0 : se($);
7538
7533
  },
7539
7534
  [J, se]
7540
7535
  ), pe = hu({
@@ -7556,8 +7551,8 @@ function Lu() {
7556
7551
  pageTransitionThreshold: K * 0.5
7557
7552
  // 50% 이상 드래그 시 전환
7558
7553
  }), le = ie(null), we = ie(null), me = Z(() => {
7559
- const D = B.getState().progress.setSectionLoading;
7560
- D(!0);
7554
+ const $ = B.getState().progress.setSectionLoading;
7555
+ $(!0);
7561
7556
  }, [B]), Te = ve(
7562
7557
  () => ({
7563
7558
  trailing: !0,
@@ -7568,8 +7563,8 @@ function Lu() {
7568
7563
  ), Oe = _u(F, 200, me, Te), Ne = ie("");
7569
7564
  Se(() => {
7570
7565
  if (b <= 0) return;
7571
- const D = `${a}|${d}|${v}|${g}|${A}|${W}|${M}|${b}|${t == null ? void 0 : t.section_id}`;
7572
- Ne.current !== D && (Ne.current = D, console.log("debounceRecalc 취소"), Oe.cancel(), me(), F());
7566
+ const $ = `${a}|${d}|${v}|${g}|${A}|${W}|${M}|${b}|${t == null ? void 0 : t.section_id}`;
7567
+ Ne.current !== $ && (Ne.current = $, console.log("debounceRecalc 취소"), Oe.cancel(), me(), F());
7573
7568
  }, [
7574
7569
  Oe,
7575
7570
  F,
@@ -7584,7 +7579,7 @@ function Lu() {
7584
7579
  b,
7585
7580
  t == null ? void 0 : t.section_id
7586
7581
  ]), pu([y], Oe);
7587
- const Le = j((D) => D.registerSectionScrollApi);
7582
+ const Le = j(($) => $.registerSectionScrollApi);
7588
7583
  Se(() => (Le({
7589
7584
  // 페이지 모드에서는 GI 기반 스크롤 불필요 - 더미 구현
7590
7585
  ensureVisibleGI: () => Promise.resolve(!0),
@@ -7598,7 +7593,7 @@ function Lu() {
7598
7593
  // 페이지 이동 구현
7599
7594
  stepPage: de
7600
7595
  }), () => Le(void 0)), [Le, de]);
7601
- const $e = t.quiz && t.quiz.length > 0, ut = u.pages.length > 0 && k === u.pages.length, Qe = k > 0 ? k - 1 : null, He = k < z - 1 ? k + 1 : null, ot = ve(() => R === "prev" ? "translate3d(0%, 0, 0)" : R === "next" ? "translate3d(-66.666%, 0, 0)" : "translate3d(-33.333%, 0, 0)", [R]), Je = (D) => n ? null : D === u.pages.length ? /* @__PURE__ */ X(
7596
+ const $e = t.quizzes && t.quizzes.length > 0, ut = u.pages.length > 0 && k === u.pages.length, Qe = k > 0 ? k - 1 : null, He = k < z - 1 ? k + 1 : null, ot = ve(() => _ === "prev" ? "translate3d(0%, 0, 0)" : _ === "next" ? "translate3d(-66.666%, 0, 0)" : "translate3d(-33.333%, 0, 0)", [_]), Je = ($) => n ? null : $ === u.pages.length ? /* @__PURE__ */ X(
7602
7597
  "div",
7603
7598
  {
7604
7599
  style: {
@@ -7615,7 +7610,7 @@ function Lu() {
7615
7610
  /* @__PURE__ */ x(Cn, { isIcon: !1 })
7616
7611
  ]
7617
7612
  }
7618
- ) : /* @__PURE__ */ x(fu, { pages: u.pages, pageIndex: D, maxWidth: m }), bt = {
7613
+ ) : /* @__PURE__ */ x(fu, { pages: u.pages, pageIndex: $, maxWidth: m }), bt = {
7619
7614
  width: "33.333%",
7620
7615
  height: "100%",
7621
7616
  flexShrink: 0,
@@ -7626,7 +7621,7 @@ function Lu() {
7626
7621
  boxSizing: "border-box",
7627
7622
  backfaceVisibility: "hidden",
7628
7623
  WebkitBackfaceVisibility: "hidden"
7629
- }, Vt = !P && (!S || R !== null);
7624
+ }, Vt = !P && (!S || _ !== null);
7630
7625
  return console.log("여기리랜더"), /* @__PURE__ */ X("div", { ref: y, style: { ...E, touchAction: "pan-y" }, ...pe, children: [
7631
7626
  /* @__PURE__ */ X(
7632
7627
  "div",
@@ -7644,7 +7639,7 @@ function Lu() {
7644
7639
  backfaceVisibility: "hidden",
7645
7640
  WebkitBackfaceVisibility: "hidden"
7646
7641
  },
7647
- onTransitionEnd: R ? $ : void 0,
7642
+ onTransitionEnd: _ ? V : void 0,
7648
7643
  children: [
7649
7644
  /* @__PURE__ */ x("div", { style: bt, children: Qe !== null && Je(Qe) }),
7650
7645
  /* @__PURE__ */ x("div", { style: bt, children: Je(k) }),
@@ -7720,7 +7715,7 @@ function Lu() {
7720
7715
  {
7721
7716
  pages: u.pages,
7722
7717
  items: p,
7723
- onGotoPage: I,
7718
+ onGotoPage: R,
7724
7719
  currentPageIndex: k,
7725
7720
  isOnExtraPage: ut
7726
7721
  }
@@ -7791,7 +7786,7 @@ const Du = "_Overlay_ybic8_3", $u = "_Dialog_ybic8_15", Vu = "_Body_ybic8_25", q
7791
7786
  StatSub: gd
7792
7787
  };
7793
7788
  function md(e) {
7794
- return e ? e.kind === "temp" ? e.blobUrl : e.cdnUrl : null;
7789
+ return e ? e.kind === "temp" ? e.image_blob_url : e.image_cdn_url : null;
7795
7790
  }
7796
7791
  function Wi(e) {
7797
7792
  var t;
@@ -7816,18 +7811,18 @@ const vd = Wt(function() {
7816
7811
  const p = r.map((M) => n[M]), f = p.length, u = p.reduce((M, B) => M + (B.score ?? 0), 0), T = p.reduce((M, B) => {
7817
7812
  const F = v[B.qid];
7818
7813
  return M + (F != null && F.isCorrect ? B.score ?? 0 : 0);
7819
- }, 0), k = p.map((M) => v[M.qid]).filter((M) => !!M), I = typeof a == "number" && typeof d == "number" ? Math.max(0, d - a) : k.reduce((M, B) => M + (B.ms ?? 0), 0), _ = f > 0 ? Math.round(I / f) : 0, h = [...k].sort((M, B) => M.ms - B.ms), S = h[0], C = h[h.length - 1], R = k.filter((M) => !M.multi), O = k.filter((M) => M.multi), P = R.filter((M) => M.isCorrect).length, w = O.filter((M) => M.isCorrect).length, E = k.filter((M) => M.timedOut).length, A = k.filter((M) => M.revealed).length, W = k.filter((M) => !M.isCorrect).sort((M, B) => B.ms - M.ms).slice(0, 3);
7814
+ }, 0), k = p.map((M) => v[M.qid]).filter((M) => !!M), R = typeof a == "number" && typeof d == "number" ? Math.max(0, d - a) : k.reduce((M, B) => M + (B.ms ?? 0), 0), C = f > 0 ? Math.round(R / f) : 0, h = [...k].sort((M, B) => M.ms - B.ms), S = h[0], I = h[h.length - 1], _ = k.filter((M) => !M.multi), O = k.filter((M) => M.multi), P = _.filter((M) => M.isCorrect).length, w = O.filter((M) => M.isCorrect).length, E = k.filter((M) => M.timedOut).length, A = k.filter((M) => M.revealed).length, W = k.filter((M) => !M.isCorrect).sort((M, B) => B.ms - M.ms).slice(0, 3);
7820
7815
  return {
7821
7816
  total: f,
7822
7817
  correct: s,
7823
7818
  rate: f ? Math.round(s / f * 100) : 0,
7824
- timeMsTotal: I,
7825
- avgMs: _,
7819
+ timeMsTotal: R,
7820
+ avgMs: C,
7826
7821
  totalScore: u,
7827
7822
  gainedScore: T,
7828
7823
  fastest: S,
7829
- slowest: C,
7830
- singles: { total: R.length, correct: P },
7824
+ slowest: I,
7825
+ singles: { total: _.length, correct: P },
7831
7826
  multis: { total: O.length, correct: w },
7832
7827
  timedOut: E,
7833
7828
  revealed: A,
@@ -7983,7 +7978,7 @@ function ar(e) {
7983
7978
  }
7984
7979
  function Do(e) {
7985
7980
  if (!e) return {};
7986
- const t = (e.quiz ?? []).slice().sort((n, r) => n.index - r.index);
7981
+ const t = (e.quizzes ?? []).slice().sort((n, r) => n.index - r.index);
7987
7982
  return {
7988
7983
  sectionId: e.section_id,
7989
7984
  quizzes: t,
@@ -8195,26 +8190,26 @@ function Cd({ children: e, initialState: t }) {
8195
8190
  if (s.phase !== "finished" && i.phase === "finished") {
8196
8191
  const c = r.current;
8197
8192
  if (!c) return;
8198
- const { sectionId: l, quizzes: a, order: d, perQ: v, startedAt: g, finishedAt: b } = i, m = d.map((_) => a[_]), y = m.length, p = m.filter((_) => {
8193
+ const { sectionId: l, quizzes: a, order: d, perQ: v, startedAt: g, finishedAt: b } = i, m = d.map((C) => a[C]), y = m.length, p = m.filter((C) => {
8199
8194
  var h;
8200
- return (h = v[_.qid]) == null ? void 0 : h.isCorrect;
8201
- }).length, f = m.reduce((_, h) => _ + (h.score ?? 0), 0), u = m.reduce((_, h) => {
8195
+ return (h = v[C.qid]) == null ? void 0 : h.isCorrect;
8196
+ }).length, f = m.reduce((C, h) => C + (h.score ?? 0), 0), u = m.reduce((C, h) => {
8202
8197
  const S = v[h.qid];
8203
- return _ + (S != null && S.isCorrect ? h.score ?? 0 : 0);
8204
- }, 0), T = typeof g == "number" && typeof b == "number" ? Math.max(0, b - g) : 0, k = m.map((_) => {
8205
- const h = v[_.qid];
8198
+ return C + (S != null && S.isCorrect ? h.score ?? 0 : 0);
8199
+ }, 0), T = typeof g == "number" && typeof b == "number" ? Math.max(0, b - g) : 0, k = m.map((C) => {
8200
+ const h = v[C.qid];
8206
8201
  return {
8207
- qid: _.qid,
8208
- index: _.index,
8209
- question: _.question,
8210
- score: _.score ?? 0,
8202
+ qid: C.qid,
8203
+ index: C.index,
8204
+ question: C.question,
8205
+ score: C.score ?? 0,
8211
8206
  isCorrect: (h == null ? void 0 : h.isCorrect) ?? !1,
8212
8207
  selected: (h == null ? void 0 : h.selected) ?? [],
8213
8208
  correctIdxes: (h == null ? void 0 : h.correctIdxes) ?? [],
8214
8209
  ms: (h == null ? void 0 : h.ms) ?? 0,
8215
8210
  timedOut: (h == null ? void 0 : h.timedOut) ?? !1
8216
8211
  };
8217
- }), I = {
8212
+ }), R = {
8218
8213
  sectionId: l ?? "",
8219
8214
  total: y,
8220
8215
  correct: p,
@@ -8224,7 +8219,7 @@ function Cd({ children: e, initialState: t }) {
8224
8219
  timeMsTotal: T,
8225
8220
  perQuestion: k
8226
8221
  };
8227
- c(I);
8222
+ c(R);
8228
8223
  }
8229
8224
  });
8230
8225
  return () => o();
@@ -8492,15 +8487,15 @@ const Rd = ({
8492
8487
  a({ x: y.width * f / 2, y: 80 });
8493
8488
  return;
8494
8489
  }
8495
- const T = u.getBoundingClientRect(), k = m.querySelector(`[data-g="${n}"]`), I = k == null ? void 0 : k.getBoundingClientRect();
8496
- let _ = (T.left + T.width / 2 - y.left) * f;
8497
- I && (_ = ((I.left + T.right) / 2 - y.left) * f);
8498
- const h = 160, S = 50, C = 16, R = 12, O = y.width * f, P = Math.max(
8499
- C + h / 2,
8500
- Math.min(_, O - C - h / 2)
8501
- ), w = (((I == null ? void 0 : I.top) ?? T.top) - y.top) * f - S - R;
8490
+ const T = u.getBoundingClientRect(), k = m.querySelector(`[data-g="${n}"]`), R = k == null ? void 0 : k.getBoundingClientRect();
8491
+ let C = (T.left + T.width / 2 - y.left) * f;
8492
+ R && (C = ((R.left + T.right) / 2 - y.left) * f);
8493
+ const h = 160, S = 50, I = 16, _ = 12, O = y.width * f, P = Math.max(
8494
+ I + h / 2,
8495
+ Math.min(C, O - I - h / 2)
8496
+ ), w = (((R == null ? void 0 : R.top) ?? T.top) - y.top) * f - S - _;
8502
8497
  let E = w;
8503
- w < C && (E = (T.bottom - y.top) * f + R), a({ x: P, y: E });
8498
+ w < I && (E = (T.bottom - y.top) * f + _), a({ x: P, y: E });
8504
8499
  };
8505
8500
  g();
8506
8501
  const b = e.current;
@@ -8585,20 +8580,20 @@ const Rd = ({
8585
8580
  const f = () => {
8586
8581
  const T = e.current;
8587
8582
  if (!T) return;
8588
- const k = T.getBoundingClientRect(), _ = 1 / (o.getState().playbackScale || 1), h = T.querySelector(`[data-g="${t}"]`), S = T.querySelector(`[data-g="${n}"]`);
8583
+ const k = T.getBoundingClientRect(), C = 1 / (o.getState().playbackScale || 1), h = T.querySelector(`[data-g="${t}"]`), S = T.querySelector(`[data-g="${n}"]`);
8589
8584
  if (h) {
8590
- const C = h.getBoundingClientRect();
8585
+ const I = h.getBoundingClientRect();
8591
8586
  c({
8592
- x: (C.left - k.left) * _,
8593
- y: (C.bottom - k.top) * _
8587
+ x: (I.left - k.left) * C,
8588
+ y: (I.bottom - k.top) * C
8594
8589
  });
8595
8590
  } else
8596
8591
  c(null);
8597
8592
  if (S) {
8598
- const C = S.getBoundingClientRect();
8593
+ const I = S.getBoundingClientRect();
8599
8594
  a({
8600
- x: (C.right - k.left) * _,
8601
- y: (C.bottom - k.top) * _
8595
+ x: (I.right - k.left) * C,
8596
+ y: (I.bottom - k.top) * C
8602
8597
  });
8603
8598
  } else
8604
8599
  a(null);
@@ -8612,10 +8607,10 @@ const Rd = ({
8612
8607
  const g = Z((f, u) => {
8613
8608
  var k;
8614
8609
  const T = document.elementsFromPoint(f, u);
8615
- for (const I of T) {
8616
- const _ = (k = I.getAttribute) == null ? void 0 : k.call(I, "data-g");
8617
- if (_ != null)
8618
- return parseInt(_, 10);
8610
+ for (const R of T) {
8611
+ const C = (k = R.getAttribute) == null ? void 0 : k.call(R, "data-g");
8612
+ if (C != null)
8613
+ return parseInt(C, 10);
8619
8614
  }
8620
8615
  return null;
8621
8616
  }, []), b = Z(
@@ -8788,7 +8783,7 @@ const Pd = ({ isOpen: e, onClose: t, text: n }) => e ? /* @__PURE__ */ x(
8788
8783
  )
8789
8784
  }
8790
8785
  ) : null, Bd = (e, t, n) => Math.min(n, Math.max(t, e));
8791
- function qd({
8786
+ function Nd({
8792
8787
  section: e,
8793
8788
  initialViewerState: t,
8794
8789
  initialProgressRunIndex: n,
@@ -8804,11 +8799,11 @@ function qd({
8804
8799
  isDev: g = !1
8805
8800
  }) {
8806
8801
  const b = String((e == null ? void 0 : e.section_id) ?? "0"), m = ve(() => {
8807
- var k, I;
8802
+ var k, R;
8808
8803
  const u = ((k = e == null ? void 0 : e.ast) == null ? void 0 : k.blocks) ?? [];
8809
8804
  let T = 0;
8810
- for (const _ of u)
8811
- (_ == null ? void 0 : _.type) !== "image" && (T += ((I = _ == null ? void 0 : _.runs) == null ? void 0 : I.length) ?? 0);
8805
+ for (const C of u)
8806
+ (C == null ? void 0 : C.type) !== "image" && (T += ((R = C == null ? void 0 : C.runs) == null ? void 0 : R.length) ?? 0);
8812
8807
  return T;
8813
8808
  }, [e]), y = ve(() => typeof n == "number" ? Bd(n, m > 0 ? 0 : -1, Math.max(m - 1, -1)) : (m > 0, 0), [n, m]), p = ve(
8814
8809
  () => ({
@@ -8905,5 +8900,5 @@ function zd() {
8905
8900
  );
8906
8901
  }
8907
8902
  export {
8908
- qd as CRViewer
8903
+ Nd as CRViewer
8909
8904
  };