react-virtuoso 4.12.6 → 4.12.8

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.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as z, jsxs as Kt, Fragment as io } from "react/jsx-runtime";
1
+ import { jsx as z, jsxs as Kt, Fragment as so } from "react/jsx-runtime";
2
2
  import H, { createElement as $t } from "react";
3
- import lo from "react-dom";
3
+ import io from "react-dom";
4
4
  const we = 0, zt = 1, qt = 2, En = 4;
5
5
  function ln(t) {
6
6
  return () => t;
7
7
  }
8
- function co(t) {
8
+ function lo(t) {
9
9
  t();
10
10
  }
11
11
  function ne(t, e) {
@@ -14,7 +14,7 @@ function ne(t, e) {
14
14
  function cn(t, e) {
15
15
  return () => t(e);
16
16
  }
17
- function kn(t, e) {
17
+ function co(t, e) {
18
18
  return (n) => t(e, n);
19
19
  }
20
20
  function Me(t) {
@@ -22,12 +22,12 @@ function Me(t) {
22
22
  }
23
23
  function uo(...t) {
24
24
  return () => {
25
- t.map(co);
25
+ t.map(lo);
26
26
  };
27
27
  }
28
28
  function Yt() {
29
29
  }
30
- function ye(t, e) {
30
+ function ve(t, e) {
31
31
  return e(t), t;
32
32
  }
33
33
  function ao(t, e) {
@@ -45,13 +45,13 @@ function W(t, e) {
45
45
  function We(t) {
46
46
  t(qt);
47
47
  }
48
- function lt(t) {
48
+ function st(t) {
49
49
  return t(En);
50
50
  }
51
- function F(t, e) {
52
- return K(t, kn(e, we));
51
+ function O(t, e) {
52
+ return K(t, co(e, we));
53
53
  }
54
- function Rt(t, e) {
54
+ function bt(t, e) {
55
55
  const n = t(zt, (o) => {
56
56
  n(), e(o);
57
57
  });
@@ -82,7 +82,7 @@ function P(t) {
82
82
  function E(t) {
83
83
  return (e) => ne(e, t);
84
84
  }
85
- function vt(t) {
85
+ function yt(t) {
86
86
  return (e) => () => {
87
87
  e(t);
88
88
  };
@@ -99,7 +99,7 @@ function x(t, ...e) {
99
99
  }
100
100
  };
101
101
  }
102
- function bt(t, e) {
102
+ function Rt(t, e) {
103
103
  return (n) => (o) => {
104
104
  n(e = t(e, o));
105
105
  };
@@ -117,15 +117,15 @@ function Lt(t) {
117
117
  }, t));
118
118
  };
119
119
  }
120
- function G(...t) {
120
+ function _(...t) {
121
121
  const e = new Array(t.length);
122
122
  let n = 0, o = null;
123
123
  const r = Math.pow(2, t.length) - 1;
124
124
  return t.forEach((s, i) => {
125
125
  const l = Math.pow(2, i);
126
126
  K(s, (c) => {
127
- const u = n;
128
- n = n | l, e[i] = c, u !== r && n === r && o && (o(), o = null);
127
+ const a = n;
128
+ n = n | l, e[i] = c, a !== r && n === r && o && (o(), o = null);
129
129
  });
130
130
  }), (s) => (i) => {
131
131
  const l = () => {
@@ -150,7 +150,7 @@ function mo(t) {
150
150
  }
151
151
  };
152
152
  }
153
- function y(t) {
153
+ function v(t) {
154
154
  let e = t;
155
155
  const n = $();
156
156
  return (o, r) => {
@@ -169,7 +169,7 @@ function y(t) {
169
169
  };
170
170
  }
171
171
  function ct(t, e) {
172
- return ye(y(e), (n) => F(t, n));
172
+ return ve(v(e), (n) => O(t, n));
173
173
  }
174
174
  function $() {
175
175
  const t = [];
@@ -191,8 +191,8 @@ function $() {
191
191
  }
192
192
  };
193
193
  }
194
- function pt(t) {
195
- return ye($(), (e) => F(t, e));
194
+ function ht(t) {
195
+ return ve($(), (e) => O(t, e));
196
196
  }
197
197
  function U(t, e = [], { singleton: n } = { singleton: !0 }) {
198
198
  return {
@@ -245,7 +245,7 @@ function an(...t) {
245
245
  }
246
246
  };
247
247
  }
248
- var ht = /* @__PURE__ */ ((t) => (t[t.DEBUG = 0] = "DEBUG", t[t.INFO = 1] = "INFO", t[t.WARN = 2] = "WARN", t[t.ERROR = 3] = "ERROR", t))(ht || {});
248
+ var mt = /* @__PURE__ */ ((t) => (t[t.DEBUG = 0] = "DEBUG", t[t.INFO = 1] = "INFO", t[t.WARN = 2] = "WARN", t[t.ERROR = 3] = "ERROR", t))(mt || {});
249
249
  const go = {
250
250
  0: "debug",
251
251
  3: "error",
@@ -253,14 +253,14 @@ const go = {
253
253
  2: "warn"
254
254
  }, Io = () => typeof globalThis > "u" ? window : globalThis, Vt = U(
255
255
  () => {
256
- const t = y(
256
+ const t = v(
257
257
  3
258
258
  /* ERROR */
259
259
  );
260
260
  return {
261
- log: y((n, o, r = 1) => {
261
+ log: v((n, o, r = 1) => {
262
262
  var i;
263
- const s = (i = Io().VIRTUOSO_LOG_LEVEL) != null ? i : lt(t);
263
+ const s = (i = Io().VIRTUOSO_LOG_LEVEL) != null ? i : st(t);
264
264
  r >= s && console[go[r]](
265
265
  "%creact-virtuoso: %c%s %o",
266
266
  "color: #0253b3; font-weight: bold",
@@ -276,48 +276,45 @@ const go = {
276
276
  { singleton: !0 }
277
277
  );
278
278
  function Ht(t, e, n) {
279
- return _e(t, e, n).callbackRef;
279
+ return Ge(t, e, n).callbackRef;
280
280
  }
281
- function _e(t, e, n) {
281
+ function Ge(t, e, n) {
282
282
  const o = H.useRef(null);
283
- let r = (s) => {
283
+ let r = (i) => {
284
284
  };
285
- if (typeof ResizeObserver < "u") {
286
- const s = H.useMemo(() => new ResizeObserver((i) => {
287
- const l = () => {
288
- const c = i[0].target;
289
- c.offsetParent !== null && t(c);
290
- };
291
- n ? l() : requestAnimationFrame(l);
292
- }), [t]);
293
- r = (i) => {
294
- i && e ? (s.observe(i), o.current = i) : (o.current && s.unobserve(o.current), o.current = null);
285
+ const s = H.useMemo(() => typeof ResizeObserver < "u" ? new ResizeObserver((i) => {
286
+ const l = () => {
287
+ const c = i[0].target;
288
+ c.offsetParent !== null && t(c);
295
289
  };
296
- }
297
- return { callbackRef: r, ref: o };
298
- }
299
- function On(t, e, n, o, r, s, i, l, c) {
300
- const u = H.useCallback(
301
- (f) => {
302
- const S = So(f.children, e, l ? "offsetWidth" : "offsetHeight", r);
303
- let p = f.parentElement;
304
- for (; !p.dataset.virtuosoScroller; )
305
- p = p.parentElement;
306
- const m = p.lastElementChild.dataset.viewportType === "window";
307
- let w;
308
- m && (w = p.ownerDocument.defaultView);
309
- const I = i ? l ? i.scrollLeft : i.scrollTop : m ? l ? w.scrollX || w.document.documentElement.scrollLeft : w.scrollY || w.document.documentElement.scrollTop : l ? p.scrollLeft : p.scrollTop, C = i ? l ? i.scrollWidth : i.scrollHeight : m ? l ? w.document.documentElement.scrollWidth : w.document.documentElement.scrollHeight : l ? p.scrollWidth : p.scrollHeight, g = i ? l ? i.offsetWidth : i.offsetHeight : m ? l ? w.innerWidth : w.innerHeight : l ? p.offsetWidth : p.offsetHeight;
290
+ n ? l() : requestAnimationFrame(l);
291
+ }) : null, [t, n]);
292
+ return r = (i) => {
293
+ i && e ? (s == null || s.observe(i), o.current = i) : (o.current && (s == null || s.unobserve(o.current)), o.current = null);
294
+ }, { callbackRef: r, ref: o };
295
+ }
296
+ function kn(t, e, n, o, r, s, i, l, c) {
297
+ const a = H.useCallback(
298
+ (p) => {
299
+ const I = So(p.children, e, l ? "offsetWidth" : "offsetHeight", r);
300
+ let h = p.parentElement;
301
+ for (; !h.dataset.virtuosoScroller; )
302
+ h = h.parentElement;
303
+ const f = h.lastElementChild.dataset.viewportType === "window";
304
+ let C;
305
+ f && (C = h.ownerDocument.defaultView);
306
+ const w = i ? l ? i.scrollLeft : i.scrollTop : f ? l ? C.scrollX || C.document.documentElement.scrollLeft : C.scrollY || C.document.documentElement.scrollTop : l ? h.scrollLeft : h.scrollTop, S = i ? l ? i.scrollWidth : i.scrollHeight : f ? l ? C.document.documentElement.scrollWidth : C.document.documentElement.scrollHeight : l ? h.scrollWidth : h.scrollHeight, m = i ? l ? i.offsetWidth : i.offsetHeight : f ? l ? C.innerWidth : C.innerHeight : l ? h.offsetWidth : h.offsetHeight;
310
307
  o({
311
- scrollHeight: C,
312
- scrollTop: Math.max(I, 0),
313
- viewportHeight: g
308
+ scrollHeight: S,
309
+ scrollTop: Math.max(w, 0),
310
+ viewportHeight: m
314
311
  }), s == null || s(
315
- l ? dn("column-gap", getComputedStyle(f).columnGap, r) : dn("row-gap", getComputedStyle(f).rowGap, r)
316
- ), S !== null && t(S);
312
+ l ? dn("column-gap", getComputedStyle(p).columnGap, r) : dn("row-gap", getComputedStyle(p).rowGap, r)
313
+ ), I !== null && t(I);
317
314
  },
318
- [t, e, r, s, i, o]
315
+ [t, e, r, s, i, o, l]
319
316
  );
320
- return _e(u, n, c);
317
+ return Ge(a, n, c);
321
318
  }
322
319
  function So(t, e, n, o) {
323
320
  const r = t.length;
@@ -328,90 +325,91 @@ function So(t, e, n, o) {
328
325
  const l = t.item(i);
329
326
  if (l.dataset.index === void 0)
330
327
  continue;
331
- const c = parseInt(l.dataset.index), u = parseFloat(l.dataset.knownSize), f = e(l, n);
332
- if (f === 0 && o("Zero-sized element, this should not happen", { child: l }, ht.ERROR), f === u)
328
+ const c = parseInt(l.dataset.index), a = parseFloat(l.dataset.knownSize), p = e(l, n);
329
+ if (p === 0 && o("Zero-sized element, this should not happen", { child: l }, mt.ERROR), p === a)
333
330
  continue;
334
- const S = s[s.length - 1];
335
- s.length === 0 || S.size !== f || S.endIndex !== c - 1 ? s.push({ endIndex: c, size: f, startIndex: c }) : s[s.length - 1].endIndex++;
331
+ const I = s[s.length - 1];
332
+ s.length === 0 || I.size !== p || I.endIndex !== c - 1 ? s.push({ endIndex: c, size: p, startIndex: c }) : s[s.length - 1].endIndex++;
336
333
  }
337
334
  return s;
338
335
  }
339
336
  function dn(t, e, n) {
340
- return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e, ht.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
337
+ return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
341
338
  }
342
- function Ge(t, e, n) {
339
+ function _e(t, e, n) {
343
340
  const o = H.useRef(null), r = H.useCallback(
344
341
  (c) => {
345
342
  if (!(c != null && c.offsetParent))
346
343
  return;
347
- const u = c.getBoundingClientRect(), f = u.width;
348
- let S, p;
344
+ const a = c.getBoundingClientRect(), p = a.width;
345
+ let I, h;
349
346
  if (e) {
350
- const m = e.getBoundingClientRect(), w = u.top - m.top;
351
- p = m.height - Math.max(0, w), S = w + e.scrollTop;
347
+ const f = e.getBoundingClientRect(), C = a.top - f.top;
348
+ h = f.height - Math.max(0, C), I = C + e.scrollTop;
352
349
  } else {
353
- const m = i.current.ownerDocument.defaultView;
354
- p = m.innerHeight - Math.max(0, u.top), S = u.top + m.scrollY;
350
+ const f = i.current.ownerDocument.defaultView;
351
+ h = f.innerHeight - Math.max(0, a.top), I = a.top + f.scrollY;
355
352
  }
356
353
  o.current = {
357
- offsetTop: S,
358
- visibleHeight: p,
359
- visibleWidth: f
354
+ offsetTop: I,
355
+ visibleHeight: h,
356
+ visibleWidth: p
360
357
  }, t(o.current);
361
358
  },
359
+ // eslint-disable-next-line react-hooks/exhaustive-deps
362
360
  [t, e]
363
- ), { callbackRef: s, ref: i } = _e(r, !0, n), l = H.useCallback(() => {
361
+ ), { callbackRef: s, ref: i } = Ge(r, !0, n), l = H.useCallback(() => {
364
362
  r(i.current);
365
363
  }, [r, i]);
366
364
  return H.useEffect(() => {
367
365
  var c;
368
366
  if (e) {
369
367
  e.addEventListener("scroll", l);
370
- const u = new ResizeObserver(() => {
368
+ const a = new ResizeObserver(() => {
371
369
  requestAnimationFrame(l);
372
370
  });
373
- return u.observe(e), () => {
374
- e.removeEventListener("scroll", l), u.unobserve(e);
371
+ return a.observe(e), () => {
372
+ e.removeEventListener("scroll", l), a.unobserve(e);
375
373
  };
376
374
  } else {
377
- const u = (c = i.current) == null ? void 0 : c.ownerDocument.defaultView;
378
- return u == null || u.addEventListener("scroll", l), u == null || u.addEventListener("resize", l), () => {
379
- u == null || u.removeEventListener("scroll", l), u == null || u.removeEventListener("resize", l);
375
+ const a = (c = i.current) == null ? void 0 : c.ownerDocument.defaultView;
376
+ return a == null || a.addEventListener("scroll", l), a == null || a.addEventListener("resize", l), () => {
377
+ a == null || a.removeEventListener("scroll", l), a == null || a.removeEventListener("resize", l);
380
378
  };
381
379
  }
382
- }, [l, e]), s;
380
+ }, [l, e, i]), s;
383
381
  }
384
382
  const at = U(
385
383
  () => {
386
- const t = $(), e = $(), n = y(0), o = $(), r = y(0), s = $(), i = $(), l = y(0), c = y(0), u = y(0), f = y(0), S = $(), p = $(), m = y(!1), w = y(!1), I = y(!1);
387
- return F(
384
+ const t = $(), e = $(), n = v(0), o = $(), r = v(0), s = $(), i = $(), l = v(0), c = v(0), a = v(0), p = v(0), I = $(), h = $(), f = v(!1), C = v(!1), w = v(!1);
385
+ return O(
388
386
  x(
389
387
  t,
390
- E(({ scrollTop: C }) => C)
388
+ E(({ scrollTop: S }) => S)
391
389
  ),
392
390
  e
393
- ), F(
391
+ ), O(
394
392
  x(
395
393
  t,
396
- E(({ scrollHeight: C }) => C)
394
+ E(({ scrollHeight: S }) => S)
397
395
  ),
398
396
  i
399
- ), F(e, r), {
397
+ ), O(e, r), {
400
398
  deviation: n,
401
- fixedFooterHeight: u,
399
+ fixedFooterHeight: a,
402
400
  fixedHeaderHeight: c,
403
- footerHeight: f,
401
+ footerHeight: p,
404
402
  headerHeight: l,
405
- horizontalDirection: w,
406
- scrollBy: p,
403
+ horizontalDirection: C,
404
+ scrollBy: h,
407
405
  // input
408
406
  scrollContainerState: t,
409
407
  scrollHeight: i,
410
- scrollingInProgress: m,
408
+ scrollingInProgress: f,
411
409
  // signals
412
- scrollTo: S,
410
+ scrollTo: I,
413
411
  scrollTop: e,
414
- skipAnimationFrameInResizeObserver: I,
412
+ skipAnimationFrameInResizeObserver: w,
415
413
  smoothScrollTargetReached: o,
416
414
  // state
417
415
  statefulScrollTop: r,
@@ -451,13 +449,13 @@ function Ct(t, e, n = "k") {
451
449
  }
452
450
  return Ct(t.l, e, n);
453
451
  }
454
- function mt(t, e, n) {
455
- return j(t) ? Vn(e, n, 1) : e === t.k ? ot(t, { k: e, v: n }) : e < t.k ? fn(ot(t, { l: mt(t.l, e, n) })) : fn(ot(t, { r: mt(t.r, e, n) }));
452
+ function pt(t, e, n) {
453
+ return j(t) ? zn(e, n, 1) : e === t.k ? ot(t, { k: e, v: n }) : e < t.k ? fn(ot(t, { l: pt(t.l, e, n) })) : fn(ot(t, { r: pt(t.r, e, n) }));
456
454
  }
457
455
  function Ut() {
458
456
  return oe;
459
457
  }
460
- function ve(t, e, n) {
458
+ function ye(t, e, n) {
461
459
  if (j(t))
462
460
  return [];
463
461
  const o = Ct(t, e)[0];
@@ -472,13 +470,13 @@ function Le(t, e) {
472
470
  if (j(r))
473
471
  return o;
474
472
  {
475
- const [s, i] = zn(o);
476
- return ge(ot(t, { k: s, l: Ln(o), v: i }));
473
+ const [s, i] = Ln(o);
474
+ return ge(ot(t, { k: s, l: On(o), v: i }));
477
475
  }
478
476
  } else return e < n ? ge(ot(t, { l: Le(o, e) })) : ge(ot(t, { r: Le(r, e) }));
479
477
  }
480
- function _t(t) {
481
- return j(t) ? [] : [..._t(t.l), { k: t.k, v: t.v }, ..._t(t.r)];
478
+ function Gt(t) {
479
+ return j(t) ? [] : [...Gt(t.l), { k: t.k, v: t.v }, ...Gt(t.r)];
482
480
  }
483
481
  function ze(t, e, n) {
484
482
  if (j(t))
@@ -493,7 +491,7 @@ function ge(t) {
493
491
  return t;
494
492
  if (n > o.lvl + 1) {
495
493
  if (Ee(e))
496
- return Pn(ot(t, { lvl: n - 1 }));
494
+ return Vn(ot(t, { lvl: n - 1 }));
497
495
  if (!j(e) && !j(e.r))
498
496
  return ot(e.r, {
499
497
  l: ot(e, { r: e.r.l }),
@@ -522,7 +520,7 @@ function ge(t) {
522
520
  }
523
521
  }
524
522
  function ot(t, e) {
525
- return Vn(
523
+ return zn(
526
524
  e.k !== void 0 ? e.k : t.k,
527
525
  e.v !== void 0 ? e.v : t.v,
528
526
  e.lvl !== void 0 ? e.lvl : t.lvl,
@@ -530,22 +528,22 @@ function ot(t, e) {
530
528
  e.r !== void 0 ? e.r : t.r
531
529
  );
532
530
  }
533
- function Ln(t) {
534
- return j(t.r) ? t.l : ge(ot(t, { r: Ln(t.r) }));
531
+ function On(t) {
532
+ return j(t.r) ? t.l : ge(ot(t, { r: On(t.r) }));
535
533
  }
536
534
  function Ee(t) {
537
535
  return j(t) || t.lvl > t.r.lvl;
538
536
  }
539
- function zn(t) {
540
- return j(t.r) ? [t.k, t.v] : zn(t.r);
537
+ function Ln(t) {
538
+ return j(t.r) ? [t.k, t.v] : Ln(t.r);
541
539
  }
542
- function Vn(t, e, n, o = oe, r = oe) {
540
+ function zn(t, e, n, o = oe, r = oe) {
543
541
  return { k: t, l: o, lvl: n, r, v: e };
544
542
  }
545
543
  function fn(t) {
546
- return Ve(Pn(t));
544
+ return Ve(Vn(t));
547
545
  }
548
- function Pn(t) {
546
+ function Vn(t) {
549
547
  const { l: e } = t;
550
548
  return !j(e) && e.lvl === t.lvl ? ot(e, { r: ot(t, { l: e.r }) }) : t;
551
549
  }
@@ -556,18 +554,18 @@ function Ve(t) {
556
554
  function xo(t) {
557
555
  return Fn(t, ({ k: e, v: n }) => ({ index: e, value: n }));
558
556
  }
559
- function An(t, e) {
557
+ function Pn(t, e) {
560
558
  return !!(t && t.startIndex === e.startIndex && t.endIndex === e.endIndex);
561
559
  }
562
560
  function se(t, e) {
563
561
  return !!(t && t[0] === e[0] && t[1] === e[1]);
564
562
  }
565
563
  const Ne = U(
566
- () => ({ recalcInProgress: y(!1) }),
564
+ () => ({ recalcInProgress: v(!1) }),
567
565
  [],
568
566
  { singleton: !0 }
569
567
  );
570
- function Mn(t, e, n) {
568
+ function An(t, e, n) {
571
569
  return t[Se(t, e, n)];
572
570
  }
573
571
  function Se(t, e, n, o = 0) {
@@ -595,7 +593,7 @@ function To(t, e, n, o) {
595
593
  function wt(t, e) {
596
594
  return Math.round(t.getBoundingClientRect()[e]);
597
595
  }
598
- function be(t) {
596
+ function Re(t) {
599
597
  return !j(t.groupOffsetTree);
600
598
  }
601
599
  function De({ index: t }, e) {
@@ -617,75 +615,75 @@ function wo(t, e) {
617
615
  for (const o of e) {
618
616
  const { endIndex: r, size: s, startIndex: i } = o;
619
617
  if (n = Math.min(n, i), j(t)) {
620
- t = mt(t, 0, s);
618
+ t = pt(t, 0, s);
621
619
  continue;
622
620
  }
623
- const l = ve(t, i - 1, r + 1);
624
- if (l.some(ko(o)))
621
+ const l = ye(t, i - 1, r + 1);
622
+ if (l.some(Bo(o)))
625
623
  continue;
626
- let c = !1, u = !1;
627
- for (const { end: f, start: S, value: p } of l)
628
- c ? (r >= S || s === p) && (t = Le(t, S)) : (u = p !== s, c = !0), f > r && r >= S && p !== s && (t = mt(t, r + 1, p));
629
- u && (t = mt(t, i, s));
624
+ let c = !1, a = !1;
625
+ for (const { end: p, start: I, value: h } of l)
626
+ c ? (r >= I || s === h) && (t = Le(t, I)) : (a = h !== s, c = !0), p > r && r >= I && h !== s && (t = pt(t, r + 1, h));
627
+ a && (t = pt(t, i, s));
630
628
  }
631
629
  return [t, n];
632
630
  }
633
- function yo(t) {
631
+ function vo(t) {
634
632
  return typeof t.groupIndex < "u";
635
633
  }
636
- function vo({ offset: t }, e) {
634
+ function yo({ offset: t }, e) {
637
635
  return e === t ? 0 : e < t ? -1 : 1;
638
636
  }
639
637
  function ie(t, e, n) {
640
638
  if (e.length === 0)
641
639
  return 0;
642
- const { index: o, offset: r, size: s } = Mn(e, t, De), i = t - o, l = s * i + (i - 1) * n + r;
640
+ const { index: o, offset: r, size: s } = An(e, t, De), i = t - o, l = s * i + (i - 1) * n + r;
643
641
  return l > 0 ? l + n : l;
644
642
  }
645
- function Wn(t, e) {
646
- if (!be(e))
643
+ function Mn(t, e) {
644
+ if (!Re(e))
647
645
  return t;
648
646
  let n = 0;
649
647
  for (; e.groupIndices[n] <= t + n; )
650
648
  n++;
651
649
  return t + n;
652
650
  }
653
- function _n(t, e, n) {
654
- if (yo(t))
651
+ function Wn(t, e, n) {
652
+ if (vo(t))
655
653
  return e.groupIndices[t.groupIndex] + 1;
656
654
  {
657
655
  const o = t.index === "LAST" ? n : t.index;
658
- let r = Wn(o, e);
656
+ let r = Mn(o, e);
659
657
  return r = Math.max(0, r, Math.min(n, r)), r;
660
658
  }
661
659
  }
662
- function bo(t, e, n, o = 0) {
663
- return o > 0 && (e = Math.max(e, Mn(t, o, De).offset)), Fn(To(t, e, n, vo), Eo);
660
+ function Ro(t, e, n, o = 0) {
661
+ return o > 0 && (e = Math.max(e, An(t, o, De).offset)), Fn(To(t, e, n, yo), Eo);
664
662
  }
665
- function Ro(t, [e, n, o, r]) {
666
- e.length > 0 && o("received item sizes", e, ht.DEBUG);
663
+ function bo(t, [e, n, o, r]) {
664
+ e.length > 0 && o("received item sizes", e, mt.DEBUG);
667
665
  const s = t.sizeTree;
668
666
  let i = s, l = 0;
669
667
  if (n.length > 0 && j(s) && e.length === 2) {
670
- const p = e[0].size, m = e[1].size;
671
- i = n.reduce((w, I) => mt(mt(w, I, p), I + 1, m), i);
668
+ const h = e[0].size, f = e[1].size;
669
+ i = n.reduce((C, w) => pt(pt(C, w, h), w + 1, f), i);
672
670
  } else
673
671
  [i, l] = wo(i, e);
674
672
  if (i === s)
675
673
  return t;
676
- const { lastIndex: c, lastOffset: u, lastSize: f, offsetTree: S } = Pe(t.offsetTree, l, i, r);
674
+ const { lastIndex: c, lastOffset: a, lastSize: p, offsetTree: I } = Pe(t.offsetTree, l, i, r);
677
675
  return {
678
676
  groupIndices: n,
679
- groupOffsetTree: n.reduce((p, m) => mt(p, m, ie(m, S, r)), Ut()),
677
+ groupOffsetTree: n.reduce((h, f) => pt(h, f, ie(f, I, r)), Ut()),
680
678
  lastIndex: c,
681
- lastOffset: u,
682
- lastSize: f,
683
- offsetTree: S,
679
+ lastOffset: a,
680
+ lastSize: p,
681
+ offsetTree: I,
684
682
  sizeTree: i
685
683
  };
686
684
  }
687
685
  function Ho(t) {
688
- return _t(t).map(({ k: e, v: n }, o, r) => {
686
+ return Gt(t).map(({ k: e, v: n }, o, r) => {
689
687
  const s = r[o + 1];
690
688
  return { endIndex: s ? s.k - 1 : 1 / 0, size: n, startIndex: e };
691
689
  });
@@ -700,17 +698,17 @@ function Pe(t, e, n, o) {
700
698
  let r = t, s = 0, i = 0, l = 0, c = 0;
701
699
  if (e !== 0) {
702
700
  c = Se(r, e - 1, De), l = r[c].offset;
703
- const f = Ct(n, e - 1);
704
- s = f[0], i = f[1], r.length && r[c].size === Ct(n, e)[1] && (c -= 1), r = r.slice(0, c + 1);
701
+ const p = Ct(n, e - 1);
702
+ s = p[0], i = p[1], r.length && r[c].size === Ct(n, e)[1] && (c -= 1), r = r.slice(0, c + 1);
705
703
  } else
706
704
  r = [];
707
- for (const { start: u, value: f } of ve(n, e, 1 / 0)) {
708
- const S = u - s, p = S * i + l + S * o;
705
+ for (const { start: a, value: p } of ye(n, e, 1 / 0)) {
706
+ const I = a - s, h = I * i + l + I * o;
709
707
  r.push({
710
- index: u,
711
- offset: p,
712
- size: f
713
- }), s = u, l = p, i = f;
708
+ index: a,
709
+ offset: h,
710
+ size: p
711
+ }), s = a, l = h, i = p;
714
712
  }
715
713
  return {
716
714
  lastIndex: s,
@@ -722,169 +720,169 @@ function Pe(t, e, n, o) {
722
720
  function Eo(t) {
723
721
  return { index: t.index, value: t };
724
722
  }
725
- function ko(t) {
723
+ function Bo(t) {
726
724
  const { endIndex: e, size: n, startIndex: o } = t;
727
725
  return (r) => r.start === o && (r.end === e || r.end === 1 / 0) && r.value === n;
728
726
  }
729
- const Bo = {
727
+ const ko = {
730
728
  offsetHeight: "height",
731
729
  offsetWidth: "width"
732
730
  }, Et = U(
733
731
  ([{ log: t }, { recalcInProgress: e }]) => {
734
- const n = $(), o = $(), r = ct(o, 0), s = $(), i = $(), l = y(0), c = y([]), u = y(void 0), f = y(void 0), S = y((h, d) => wt(h, Bo[d])), p = y(void 0), m = y(0), w = Co(), I = ct(
735
- x(n, G(c, t, m), bt(Ro, w), Y()),
736
- w
737
- ), C = ct(
732
+ const n = $(), o = $(), r = ct(o, 0), s = $(), i = $(), l = v(0), c = v([]), a = v(void 0), p = v(void 0), I = v((g, d) => wt(g, ko[d])), h = v(void 0), f = v(0), C = Co(), w = ct(
733
+ x(n, _(c, t, f), Rt(bo, C), Y()),
734
+ C
735
+ ), S = ct(
738
736
  x(
739
737
  c,
740
738
  Y(),
741
- bt((h, d) => ({ current: d, prev: h.current }), {
739
+ Rt((g, d) => ({ current: d, prev: g.current }), {
742
740
  current: [],
743
741
  prev: []
744
742
  }),
745
- E(({ prev: h }) => h)
743
+ E(({ prev: g }) => g)
746
744
  ),
747
745
  []
748
746
  );
749
- F(
747
+ O(
750
748
  x(
751
749
  c,
752
- P((h) => h.length > 0),
753
- G(I, m),
754
- E(([h, d, R]) => {
755
- const B = h.reduce((O, L, V) => mt(O, L, ie(L, d.offsetTree, R) || V), Ut());
750
+ P((g) => g.length > 0),
751
+ _(w, f),
752
+ E(([g, d, b]) => {
753
+ const k = g.reduce((F, L, V) => pt(F, L, ie(L, d.offsetTree, b) || V), Ut());
756
754
  return {
757
755
  ...d,
758
- groupIndices: h,
759
- groupOffsetTree: B
756
+ groupIndices: g,
757
+ groupOffsetTree: k
760
758
  };
761
759
  })
762
760
  ),
763
- I
764
- ), F(
761
+ w
762
+ ), O(
765
763
  x(
766
764
  o,
767
- G(I),
768
- P(([h, { lastIndex: d }]) => h < d),
769
- E(([h, { lastIndex: d, lastSize: R }]) => [
765
+ _(w),
766
+ P(([g, { lastIndex: d }]) => g < d),
767
+ E(([g, { lastIndex: d, lastSize: b }]) => [
770
768
  {
771
769
  endIndex: d,
772
- size: R,
773
- startIndex: h
770
+ size: b,
771
+ startIndex: g
774
772
  }
775
773
  ])
776
774
  ),
777
775
  n
778
- ), F(u, f);
779
- const g = ct(
776
+ ), O(a, p);
777
+ const m = ct(
780
778
  x(
781
- u,
782
- E((h) => h === void 0)
779
+ a,
780
+ E((g) => g === void 0)
783
781
  ),
784
782
  !0
785
783
  );
786
- F(
784
+ O(
787
785
  x(
788
- f,
789
- P((h) => h !== void 0 && j(lt(I).sizeTree)),
790
- E((h) => [{ endIndex: 0, size: h, startIndex: 0 }])
786
+ p,
787
+ P((g) => g !== void 0 && j(st(w).sizeTree)),
788
+ E((g) => [{ endIndex: 0, size: g, startIndex: 0 }])
791
789
  ),
792
790
  n
793
791
  );
794
- const a = pt(
792
+ const u = ht(
795
793
  x(
796
794
  n,
797
- G(I),
798
- bt(
799
- ({ sizes: h }, [d, R]) => ({
800
- changed: R !== h,
801
- sizes: R
795
+ _(w),
796
+ Rt(
797
+ ({ sizes: g }, [d, b]) => ({
798
+ changed: b !== g,
799
+ sizes: b
802
800
  }),
803
- { changed: !1, sizes: w }
801
+ { changed: !1, sizes: C }
804
802
  ),
805
- E((h) => h.changed)
803
+ E((g) => g.changed)
806
804
  )
807
805
  );
808
806
  K(
809
807
  x(
810
808
  l,
811
- bt(
812
- (h, d) => ({ diff: h.prev - d, prev: d }),
809
+ Rt(
810
+ (g, d) => ({ diff: g.prev - d, prev: d }),
813
811
  { diff: 0, prev: 0 }
814
812
  ),
815
- E((h) => h.diff)
813
+ E((g) => g.diff)
816
814
  ),
817
- (h) => {
818
- const { groupIndices: d } = lt(I);
819
- if (h > 0)
820
- W(e, !0), W(s, h + mn(h, d));
821
- else if (h < 0) {
822
- const R = lt(C);
823
- R.length > 0 && (h -= mn(-h, R)), W(i, h);
815
+ (g) => {
816
+ const { groupIndices: d } = st(w);
817
+ if (g > 0)
818
+ W(e, !0), W(s, g + mn(g, d));
819
+ else if (g < 0) {
820
+ const b = st(S);
821
+ b.length > 0 && (g -= mn(-g, b)), W(i, g);
824
822
  }
825
823
  }
826
- ), K(x(l, G(t)), ([h, d]) => {
827
- h < 0 && d(
824
+ ), K(x(l, _(t)), ([g, d]) => {
825
+ g < 0 && d(
828
826
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
829
827
  { firstItemIndex: l },
830
- ht.ERROR
828
+ mt.ERROR
831
829
  );
832
830
  });
833
- const T = pt(s);
834
- F(
831
+ const T = ht(s);
832
+ O(
835
833
  x(
836
834
  s,
837
- G(I),
838
- E(([h, d]) => {
839
- const R = d.groupIndices.length > 0, B = [], O = d.lastSize;
840
- if (R) {
835
+ _(w),
836
+ E(([g, d]) => {
837
+ const b = d.groupIndices.length > 0, k = [], F = d.lastSize;
838
+ if (b) {
841
839
  const L = re(d.sizeTree, 0);
842
840
  let V = 0, D = 0;
843
- for (; V < h; ) {
844
- const k = d.groupIndices[D], q = d.groupIndices.length === D + 1 ? 1 / 0 : d.groupIndices[D + 1] - k - 1;
845
- B.push({
846
- endIndex: k,
841
+ for (; V < g; ) {
842
+ const B = d.groupIndices[D], q = d.groupIndices.length === D + 1 ? 1 / 0 : d.groupIndices[D + 1] - B - 1;
843
+ k.push({
844
+ endIndex: B,
847
845
  size: L,
848
- startIndex: k
849
- }), B.push({
850
- endIndex: k + 1 + q - 1,
851
- size: O,
852
- startIndex: k + 1
846
+ startIndex: B
847
+ }), k.push({
848
+ endIndex: B + 1 + q - 1,
849
+ size: F,
850
+ startIndex: B + 1
853
851
  }), D++, V += q + 1;
854
852
  }
855
- const J = _t(d.sizeTree);
856
- return V !== h && J.shift(), J.reduce(
857
- (k, { k: q, v: st }) => {
858
- let dt = k.ranges;
859
- return k.prevSize !== 0 && (dt = [
860
- ...k.ranges,
853
+ const J = Gt(d.sizeTree);
854
+ return V !== g && J.shift(), J.reduce(
855
+ (B, { k: q, v: it }) => {
856
+ let dt = B.ranges;
857
+ return B.prevSize !== 0 && (dt = [
858
+ ...B.ranges,
861
859
  {
862
- endIndex: q + h - 1,
863
- size: k.prevSize,
864
- startIndex: k.prevIndex
860
+ endIndex: q + g - 1,
861
+ size: B.prevSize,
862
+ startIndex: B.prevIndex
865
863
  }
866
864
  ]), {
867
- prevIndex: q + h,
868
- prevSize: st,
865
+ prevIndex: q + g,
866
+ prevSize: it,
869
867
  ranges: dt
870
868
  };
871
869
  },
872
870
  {
873
- prevIndex: h,
871
+ prevIndex: g,
874
872
  prevSize: 0,
875
- ranges: B
873
+ ranges: k
876
874
  }
877
875
  ).ranges;
878
876
  }
879
- return _t(d.sizeTree).reduce(
877
+ return Gt(d.sizeTree).reduce(
880
878
  (L, { k: V, v: D }) => ({
881
- prevIndex: V + h,
879
+ prevIndex: V + g,
882
880
  prevSize: D,
883
- ranges: [...L.ranges, { endIndex: V + h - 1, size: L.prevSize, startIndex: L.prevIndex }]
881
+ ranges: [...L.ranges, { endIndex: V + g - 1, size: L.prevSize, startIndex: L.prevIndex }]
884
882
  }),
885
883
  {
886
884
  prevIndex: 0,
887
- prevSize: O,
885
+ prevSize: F,
888
886
  ranges: []
889
887
  }
890
888
  ).ranges;
@@ -892,80 +890,80 @@ const Bo = {
892
890
  ),
893
891
  n
894
892
  );
895
- const b = pt(
893
+ const R = ht(
896
894
  x(
897
895
  i,
898
- G(I, m),
899
- E(([h, { offsetTree: d }, R]) => {
900
- const B = -h;
901
- return ie(B, d, R);
896
+ _(w, f),
897
+ E(([g, { offsetTree: d }, b]) => {
898
+ const k = -g;
899
+ return ie(k, d, b);
902
900
  })
903
901
  )
904
902
  );
905
- return F(
903
+ return O(
906
904
  x(
907
905
  i,
908
- G(I, m),
909
- E(([h, d, R]) => {
906
+ _(w, f),
907
+ E(([g, d, b]) => {
910
908
  if (d.groupIndices.length > 0) {
911
909
  if (j(d.sizeTree))
912
910
  return d;
913
- let O = Ut();
914
- const L = lt(C);
911
+ let F = Ut();
912
+ const L = st(S);
915
913
  let V = 0, D = 0, J = 0;
916
- for (; V < -h; ) {
914
+ for (; V < -g; ) {
917
915
  J = L[D];
918
- const k = L[D + 1] - J - 1;
919
- D++, V += k + 1;
916
+ const B = L[D + 1] - J - 1;
917
+ D++, V += B + 1;
920
918
  }
921
- if (O = _t(d.sizeTree).reduce((k, { k: q, v: st }) => mt(k, Math.max(0, q + h), st), O), V !== -h) {
922
- const k = re(d.sizeTree, J);
923
- O = mt(O, 0, k);
924
- const q = Ct(d.sizeTree, -h + 1)[1];
925
- O = mt(O, 1, q);
919
+ if (F = Gt(d.sizeTree).reduce((B, { k: q, v: it }) => pt(B, Math.max(0, q + g), it), F), V !== -g) {
920
+ const B = re(d.sizeTree, J);
921
+ F = pt(F, 0, B);
922
+ const q = Ct(d.sizeTree, -g + 1)[1];
923
+ F = pt(F, 1, q);
926
924
  }
927
925
  return {
928
926
  ...d,
929
- sizeTree: O,
930
- ...Pe(d.offsetTree, 0, O, R)
927
+ sizeTree: F,
928
+ ...Pe(d.offsetTree, 0, F, b)
931
929
  };
932
930
  } else {
933
- const O = _t(d.sizeTree).reduce((L, { k: V, v: D }) => mt(L, Math.max(0, V + h), D), Ut());
931
+ const F = Gt(d.sizeTree).reduce((L, { k: V, v: D }) => pt(L, Math.max(0, V + g), D), Ut());
934
932
  return {
935
933
  ...d,
936
- sizeTree: O,
937
- ...Pe(d.offsetTree, 0, O, R)
934
+ sizeTree: F,
935
+ ...Pe(d.offsetTree, 0, F, b)
938
936
  };
939
937
  }
940
938
  })
941
939
  ),
942
- I
940
+ w
943
941
  ), {
944
942
  beforeUnshiftWith: T,
945
943
  // input
946
- data: p,
947
- defaultItemSize: f,
944
+ data: h,
945
+ defaultItemSize: p,
948
946
  firstItemIndex: l,
949
- fixedItemSize: u,
950
- gap: m,
947
+ fixedItemSize: a,
948
+ gap: f,
951
949
  groupIndices: c,
952
- itemSize: S,
953
- listRefresh: a,
950
+ itemSize: I,
951
+ listRefresh: u,
954
952
  shiftWith: i,
955
- shiftWithOffset: b,
953
+ shiftWithOffset: R,
956
954
  sizeRanges: n,
957
955
  // output
958
- sizes: I,
956
+ sizes: w,
959
957
  statefulTotalCount: r,
960
958
  totalCount: o,
961
- trackItemSizes: g,
959
+ trackItemSizes: m,
962
960
  unshiftWith: s
963
961
  };
964
962
  },
965
963
  X(Vt, Ne),
966
964
  { singleton: !0 }
967
965
  );
968
- function Oo(t) {
966
+ function Fo(t) {
969
967
  return t.reduce(
970
968
  (e, n) => (e.groupIndices.push(e.totalCount), e.totalCount += n + 1, e),
971
969
  {
@@ -976,24 +974,24 @@ function Oo(t) {
976
974
  }
977
975
  const Gn = U(
978
976
  ([{ groupIndices: t, sizes: e, totalCount: n }, { headerHeight: o, scrollTop: r }]) => {
979
- const s = $(), i = $(), l = pt(x(s, E(Oo)));
980
- return F(
977
+ const s = $(), i = $(), l = ht(x(s, E(Fo)));
978
+ return O(
981
979
  x(
982
980
  l,
983
981
  E((c) => c.totalCount)
984
982
  ),
985
983
  n
986
- ), F(
984
+ ), O(
987
985
  x(
988
986
  l,
989
987
  E((c) => c.groupIndices)
990
988
  ),
991
989
  t
992
- ), F(
990
+ ), O(
993
991
  x(
994
992
  rt(r, e, o),
995
- P(([c, u]) => be(u)),
996
- E(([c, u, f]) => Ct(u.groupOffsetTree, Math.max(c - f, 0), "v")[0]),
993
+ P(([c, a]) => Re(a)),
994
+ E(([c, a, p]) => Ct(a.groupOffsetTree, Math.max(c - p, 0), "v")[0]),
997
995
  Y(),
998
996
  E((c) => [c])
999
997
  ),
@@ -1003,7 +1001,7 @@ const Gn = U(
1003
1001
  X(Et, at)
1004
1002
  ), Pt = U(
1005
1003
  ([{ log: t }]) => {
1006
- const e = y(!1), n = pt(
1004
+ const e = v(!1), n = ht(
1007
1005
  x(
1008
1006
  e,
1009
1007
  P((o) => o),
@@ -1011,15 +1009,15 @@ const Gn = U(
1011
1009
  )
1012
1010
  );
1013
1011
  return K(e, (o) => {
1014
- o && lt(t)("props updated", {}, ht.DEBUG);
1012
+ o && st(t)("props updated", {}, mt.DEBUG);
1015
1013
  }), { didMount: n, propsReady: e };
1016
1014
  },
1017
1015
  X(Vt),
1018
1016
  { singleton: !0 }
1019
- ), Fo = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
1020
- function Nn(t) {
1017
+ ), Oo = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
1018
+ function _n(t) {
1021
1019
  const e = typeof t == "number" ? { index: t } : t;
1022
- return e.align || (e.align = "start"), (!e.behavior || !Fo) && (e.behavior = "auto"), e.offset || (e.offset = 0), e;
1020
+ return e.align || (e.align = "start"), (!e.behavior || !Oo) && (e.behavior = "auto"), e.offset || (e.offset = 0), e;
1023
1021
  }
1024
1022
  const ce = U(
1025
1023
  ([
@@ -1030,55 +1028,55 @@ const ce = U(
1030
1028
  footerHeight: i,
1031
1029
  headerHeight: l,
1032
1030
  scrollingInProgress: c,
1033
- scrollTo: u,
1034
- smoothScrollTargetReached: f,
1035
- viewportHeight: S
1031
+ scrollTo: a,
1032
+ smoothScrollTargetReached: p,
1033
+ viewportHeight: I
1036
1034
  },
1037
- { log: p }
1035
+ { log: h }
1038
1036
  ]) => {
1039
- const m = $(), w = $(), I = y(0);
1040
- let C = null, g = null, a = null;
1037
+ const f = $(), C = $(), w = v(0);
1038
+ let S = null, m = null, u = null;
1041
1039
  function T() {
1042
- C && (C(), C = null), a && (a(), a = null), g && (clearTimeout(g), g = null), W(c, !1);
1040
+ S && (S(), S = null), u && (u(), u = null), m && (clearTimeout(m), m = null), W(c, !1);
1043
1041
  }
1044
- return F(
1042
+ return O(
1045
1043
  x(
1046
- m,
1047
- G(n, S, o, I, l, i, p),
1048
- G(t, s, r),
1044
+ f,
1045
+ _(n, I, o, w, l, i, h),
1046
+ _(t, s, r),
1049
1047
  E(
1050
1048
  ([
1051
- [b, h, d, R, B, O, L, V],
1049
+ [R, g, d, b, k, F, L, V],
1052
1050
  D,
1053
1051
  J,
1054
1052
  nt
1055
1053
  ]) => {
1056
- const k = Nn(b), { align: q, behavior: st, offset: dt } = k, St = R - 1, ft = _n(k, h, St);
1057
- let ut = ie(ft, h.offsetTree, D) + O;
1058
- q === "end" ? (ut += J + Ct(h.sizeTree, ft)[1] - d + nt, ft === St && (ut += L)) : q === "center" ? ut += (J + Ct(h.sizeTree, ft)[1] - d + nt) / 2 : ut -= B, dt && (ut += dt);
1054
+ const B = _n(R), { align: q, behavior: it, offset: dt } = B, St = b - 1, ft = Wn(B, g, St);
1055
+ let ut = ie(ft, g.offsetTree, D) + F;
1056
+ q === "end" ? (ut += J + Ct(g.sizeTree, ft)[1] - d + nt, ft === St && (ut += L)) : q === "center" ? ut += (J + Ct(g.sizeTree, ft)[1] - d + nt) / 2 : ut -= k, dt && (ut += dt);
1059
1057
  const At = (xt) => {
1060
- T(), xt ? (V("retrying to scroll to", { location: b }, ht.DEBUG), W(m, b)) : (W(w, !0), V("list did not change, scroll successful", {}, ht.DEBUG));
1058
+ T(), xt ? (V("retrying to scroll to", { location: R }, mt.DEBUG), W(f, R)) : (W(C, !0), V("list did not change, scroll successful", {}, mt.DEBUG));
1061
1059
  };
1062
- if (T(), st === "smooth") {
1060
+ if (T(), it === "smooth") {
1063
1061
  let xt = !1;
1064
- a = K(e, (Xt) => {
1062
+ u = K(e, (Xt) => {
1065
1063
  xt = xt || Xt;
1066
- }), C = Rt(f, () => {
1064
+ }), S = bt(p, () => {
1067
1065
  At(xt);
1068
1066
  });
1069
1067
  } else
1070
- C = Rt(x(e, Lo(150)), At);
1071
- return g = setTimeout(() => {
1068
+ S = bt(x(e, Lo(150)), At);
1069
+ return m = setTimeout(() => {
1072
1070
  T();
1073
- }, 1200), W(c, !0), V("scrolling from index to", { behavior: st, index: ft, top: ut }, ht.DEBUG), { behavior: st, top: ut };
1071
+ }, 1200), W(c, !0), V("scrolling from index to", { behavior: it, index: ft, top: ut }, mt.DEBUG), { behavior: it, top: ut };
1074
1072
  }
1075
1073
  )
1076
1074
  ),
1077
- u
1075
+ a
1078
1076
  ), {
1079
- scrollTargetReached: w,
1080
- scrollToIndex: m,
1081
- topListHeight: I
1077
+ scrollTargetReached: C,
1078
+ scrollToIndex: f,
1079
+ topListHeight: w
1082
1080
  };
1083
1081
  },
1084
1082
  X(Et, at, Vt),
@@ -1105,41 +1103,41 @@ function Ue(t, e) {
1105
1103
  }
1106
1104
  const ue = U(
1107
1105
  ([{ defaultItemSize: t, listRefresh: e, sizes: n }, { scrollTop: o }, { scrollTargetReached: r, scrollToIndex: s }, { didMount: i }]) => {
1108
- const l = y(!0), c = y(0), u = y(!0);
1109
- return F(
1106
+ const l = v(!0), c = v(0), a = v(!0);
1107
+ return O(
1110
1108
  x(
1111
1109
  i,
1112
- G(c),
1113
- P(([f, S]) => !!S),
1114
- vt(!1)
1110
+ _(c),
1111
+ P(([p, I]) => !!I),
1112
+ yt(!1)
1115
1113
  ),
1116
1114
  l
1117
- ), F(
1115
+ ), O(
1118
1116
  x(
1119
1117
  i,
1120
- G(c),
1121
- P(([f, S]) => !!S),
1122
- vt(!1)
1118
+ _(c),
1119
+ P(([p, I]) => !!I),
1120
+ yt(!1)
1123
1121
  ),
1124
- u
1122
+ a
1125
1123
  ), K(
1126
1124
  x(
1127
1125
  rt(e, i),
1128
- G(l, n, t, u),
1129
- P(([[, f], S, { sizeTree: p }, m, w]) => f && (!j(p) || Me(m)) && !S && !w),
1130
- G(c)
1126
+ _(l, n, t, a),
1127
+ P(([[, p], I, { sizeTree: h }, f, C]) => p && (!j(h) || Me(f)) && !I && !C),
1128
+ _(c)
1131
1129
  ),
1132
- ([, f]) => {
1133
- Rt(r, () => {
1134
- W(u, !0);
1130
+ ([, p]) => {
1131
+ bt(r, () => {
1132
+ W(a, !0);
1135
1133
  }), $e(4, () => {
1136
- Rt(o, () => {
1134
+ bt(o, () => {
1137
1135
  W(l, !0);
1138
- }), W(s, f);
1136
+ }), W(s, p);
1139
1137
  });
1140
1138
  }
1141
1139
  ), {
1142
- initialItemFinalLocationReached: u,
1140
+ initialItemFinalLocationReached: a,
1143
1141
  initialTopMostItemIndex: c,
1144
1142
  scrolledToInitialItem: l
1145
1143
  };
@@ -1147,7 +1145,7 @@ const ue = U(
1147
1145
  X(Et, at, ce, Pt),
1148
1146
  { singleton: !0 }
1149
1147
  );
1150
- function Dn(t, e) {
1148
+ function Nn(t, e) {
1151
1149
  return Math.abs(t - e) < 1.01;
1152
1150
  }
1153
1151
  const le = "up", te = "down", zo = "none", Vo = {
@@ -1160,36 +1158,36 @@ const le = "up", te = "down", zo = "none", Vo = {
1160
1158
  viewportHeight: 0
1161
1159
  }
1162
1160
  }, Po = 0, ae = U(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
1163
- const i = y(!1), l = y(!0), c = $(), u = $(), f = y(4), S = y(Po), p = ct(
1161
+ const i = v(!1), l = v(!0), c = $(), a = $(), p = v(4), I = v(Po), h = ct(
1164
1162
  x(
1165
- an(x(A(r), jt(1), vt(!0)), x(A(r), jt(1), vt(!1), un(100))),
1163
+ an(x(A(r), jt(1), yt(!0)), x(A(r), jt(1), yt(!1), un(100))),
1166
1164
  Y()
1167
1165
  ),
1168
1166
  !1
1169
- ), m = ct(
1170
- x(an(x(n, vt(!0)), x(n, vt(!1), un(200))), Y()),
1167
+ ), f = ct(
1168
+ x(an(x(n, yt(!0)), x(n, yt(!1), un(200))), Y()),
1171
1169
  !1
1172
1170
  );
1173
- F(
1171
+ O(
1174
1172
  x(
1175
- rt(A(r), A(S)),
1176
- E(([a, T]) => a <= T),
1173
+ rt(A(r), A(I)),
1174
+ E(([u, T]) => u <= T),
1177
1175
  Y()
1178
1176
  ),
1179
1177
  l
1180
- ), F(x(l, Lt(50)), u);
1181
- const w = pt(
1178
+ ), O(x(l, Lt(50)), a);
1179
+ const C = ht(
1182
1180
  x(
1183
- rt(o, A(s), A(e), A(t), A(f)),
1184
- bt((a, [{ scrollHeight: T, scrollTop: b }, h, d, R, B]) => {
1185
- const O = b + h - T > -B, L = {
1181
+ rt(o, A(s), A(e), A(t), A(p)),
1182
+ Rt((u, [{ scrollHeight: T, scrollTop: R }, g, d, b, k]) => {
1183
+ const F = R + g - T > -k, L = {
1186
1184
  scrollHeight: T,
1187
- scrollTop: b,
1188
- viewportHeight: h
1185
+ scrollTop: R,
1186
+ viewportHeight: g
1189
1187
  };
1190
- if (O) {
1188
+ if (F) {
1191
1189
  let D, J;
1192
- return b > a.state.scrollTop ? (D = "SCROLLED_DOWN", J = a.state.scrollTop - b) : (D = "SIZE_DECREASED", J = a.state.scrollTop - b || a.scrollTopDelta), {
1190
+ return R > u.state.scrollTop ? (D = "SCROLLED_DOWN", J = u.state.scrollTop - R) : (D = "SIZE_DECREASED", J = u.state.scrollTop - R || u.scrollTopDelta), {
1193
1191
  atBottom: !0,
1194
1192
  atBottomBecause: D,
1195
1193
  scrollTopDelta: J,
@@ -1197,99 +1195,99 @@ const le = "up", te = "down", zo = "none", Vo = {
1197
1195
  };
1198
1196
  }
1199
1197
  let V;
1200
- return L.scrollHeight > a.state.scrollHeight ? V = "SIZE_INCREASED" : h < a.state.viewportHeight ? V = "VIEWPORT_HEIGHT_DECREASING" : b < a.state.scrollTop ? V = "SCROLLING_UPWARDS" : V = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1198
+ return L.scrollHeight > u.state.scrollHeight ? V = "SIZE_INCREASED" : g < u.state.viewportHeight ? V = "VIEWPORT_HEIGHT_DECREASING" : R < u.state.scrollTop ? V = "SCROLLING_UPWARDS" : V = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1201
1199
  atBottom: !1,
1202
1200
  notAtBottomBecause: V,
1203
1201
  state: L
1204
1202
  };
1205
1203
  }, Vo),
1206
- Y((a, T) => a && a.atBottom === T.atBottom)
1204
+ Y((u, T) => u && u.atBottom === T.atBottom)
1207
1205
  )
1208
- ), I = ct(
1206
+ ), w = ct(
1209
1207
  x(
1210
1208
  o,
1211
- bt(
1212
- (a, { scrollHeight: T, scrollTop: b, viewportHeight: h }) => {
1213
- if (Dn(a.scrollHeight, T))
1209
+ Rt(
1210
+ (u, { scrollHeight: T, scrollTop: R, viewportHeight: g }) => {
1211
+ if (Nn(u.scrollHeight, T))
1214
1212
  return {
1215
1213
  changed: !1,
1216
1214
  jump: 0,
1217
1215
  scrollHeight: T,
1218
- scrollTop: b
1216
+ scrollTop: R
1219
1217
  };
1220
1218
  {
1221
- const d = T - (b + h) < 1;
1222
- return a.scrollTop !== b && d ? {
1219
+ const d = T - (R + g) < 1;
1220
+ return u.scrollTop !== R && d ? {
1223
1221
  changed: !0,
1224
- jump: a.scrollTop - b,
1222
+ jump: u.scrollTop - R,
1225
1223
  scrollHeight: T,
1226
- scrollTop: b
1224
+ scrollTop: R
1227
1225
  } : {
1228
1226
  changed: !0,
1229
1227
  jump: 0,
1230
1228
  scrollHeight: T,
1231
- scrollTop: b
1229
+ scrollTop: R
1232
1230
  };
1233
1231
  }
1234
1232
  },
1235
1233
  { changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
1236
1234
  ),
1237
- P((a) => a.changed),
1238
- E((a) => a.jump)
1235
+ P((u) => u.changed),
1236
+ E((u) => u.jump)
1239
1237
  ),
1240
1238
  0
1241
1239
  );
1242
- F(
1240
+ O(
1243
1241
  x(
1244
- w,
1245
- E((a) => a.atBottom)
1242
+ C,
1243
+ E((u) => u.atBottom)
1246
1244
  ),
1247
1245
  i
1248
- ), F(x(i, Lt(50)), c);
1249
- const C = y(te);
1250
- F(
1246
+ ), O(x(i, Lt(50)), c);
1247
+ const S = v(te);
1248
+ O(
1251
1249
  x(
1252
1250
  o,
1253
- E(({ scrollTop: a }) => a),
1251
+ E(({ scrollTop: u }) => u),
1254
1252
  Y(),
1255
- bt(
1256
- (a, T) => lt(m) ? { direction: a.direction, prevScrollTop: T } : { direction: T < a.prevScrollTop ? le : te, prevScrollTop: T },
1253
+ Rt(
1254
+ (u, T) => st(f) ? { direction: u.direction, prevScrollTop: T } : { direction: T < u.prevScrollTop ? le : te, prevScrollTop: T },
1257
1255
  { direction: te, prevScrollTop: 0 }
1258
1256
  ),
1259
- E((a) => a.direction)
1257
+ E((u) => u.direction)
1260
1258
  ),
1261
- C
1262
- ), F(x(o, Lt(50), vt(zo)), C);
1263
- const g = y(0);
1264
- return F(
1259
+ S
1260
+ ), O(x(o, Lt(50), yt(zo)), S);
1261
+ const m = v(0);
1262
+ return O(
1265
1263
  x(
1266
- p,
1267
- P((a) => !a),
1268
- vt(0)
1264
+ h,
1265
+ P((u) => !u),
1266
+ yt(0)
1269
1267
  ),
1270
- g
1271
- ), F(
1268
+ m
1269
+ ), O(
1272
1270
  x(
1273
1271
  r,
1274
1272
  Lt(100),
1275
- G(p),
1276
- P(([a, T]) => !!T),
1277
- bt(([a, T], [b]) => [T, b], [0, 0]),
1278
- E(([a, T]) => T - a)
1273
+ _(h),
1274
+ P(([u, T]) => !!T),
1275
+ Rt(([u, T], [R]) => [T, R], [0, 0]),
1276
+ E(([u, T]) => T - u)
1279
1277
  ),
1280
- g
1278
+ m
1281
1279
  ), {
1282
- atBottomState: w,
1280
+ atBottomState: C,
1283
1281
  atBottomStateChange: c,
1284
- atBottomThreshold: f,
1285
- atTopStateChange: u,
1286
- atTopThreshold: S,
1282
+ atBottomThreshold: p,
1283
+ atTopStateChange: a,
1284
+ atTopThreshold: I,
1287
1285
  isAtBottom: i,
1288
1286
  isAtTop: l,
1289
- isScrolling: p,
1290
- lastJumpDueToItemResize: I,
1291
- scrollDirection: C,
1292
- scrollVelocity: g
1287
+ isScrolling: h,
1288
+ lastJumpDueToItemResize: w,
1289
+ scrollDirection: S,
1290
+ scrollVelocity: m
1293
1291
  };
1294
1292
  }, X(at)), xe = "top", Te = "bottom", pn = "none";
1295
1293
  function hn(t, e, n) {
@@ -1301,7 +1299,7 @@ function gn(t, e) {
1301
1299
  }
1302
1300
  const Ke = U(
1303
1301
  ([{ deviation: t, fixedHeaderHeight: e, headerHeight: n, scrollTop: o, viewportHeight: r }]) => {
1304
- const s = $(), i = y(0), l = y(0), c = y(0), u = ct(
1302
+ const s = $(), i = v(0), l = v(0), c = v(0), a = ct(
1305
1303
  x(
1306
1304
  rt(
1307
1305
  A(o),
@@ -1316,26 +1314,26 @@ const Ke = U(
1316
1314
  ),
1317
1315
  E(
1318
1316
  ([
1319
- f,
1320
- S,
1321
1317
  p,
1322
- [m, w],
1323
1318
  I,
1324
- C,
1325
- g,
1326
- a,
1319
+ h,
1320
+ [f, C],
1321
+ w,
1322
+ S,
1323
+ m,
1324
+ u,
1327
1325
  T
1328
1326
  ]) => {
1329
- const b = f - a, h = C + g, d = Math.max(p - b, 0);
1330
- let R = pn;
1331
- const B = gn(T, xe), O = gn(T, Te);
1332
- return m -= a, m += p + g, w += p + g, w -= a, m > f + h - B && (R = le), w < f - d + S + O && (R = te), R !== pn ? [
1333
- Math.max(b - p - hn(I, xe, R) - B, 0),
1334
- b - d - g + S + hn(I, Te, R) + O
1327
+ const R = p - u, g = S + m, d = Math.max(h - R, 0);
1328
+ let b = pn;
1329
+ const k = gn(T, xe), F = gn(T, Te);
1330
+ return f -= u, f += h + m, C += h + m, C -= u, f > p + g - k && (b = le), C < p - d + I + F && (b = te), b !== pn ? [
1331
+ Math.max(R - h - hn(w, xe, b) - k, 0),
1332
+ R - d - m + I + hn(w, Te, b) + F
1335
1333
  ] : null;
1336
1334
  }
1337
1335
  ),
1338
- P((f) => f != null),
1336
+ P((p) => p != null),
1339
1337
  Y(se)
1340
1338
  ),
1341
1339
  [0, 0]
@@ -1347,15 +1345,15 @@ const Ke = U(
1347
1345
  overscan: c,
1348
1346
  topListHeight: i,
1349
1347
  // output
1350
- visibleRange: u
1348
+ visibleRange: a
1351
1349
  };
1352
1350
  },
1353
1351
  X(at),
1354
1352
  { singleton: !0 }
1355
1353
  );
1356
1354
  function Ao(t, e, n) {
1357
- if (be(e)) {
1358
- const o = Wn(t, e);
1355
+ if (Re(e)) {
1356
+ const o = Mn(t, e);
1359
1357
  return [
1360
1358
  { index: Ct(e.groupOffsetTree, o)[0], offset: 0, size: 0 },
1361
1359
  { data: n == null ? void 0 : n[0], index: o, offset: 0, size: 0 }
@@ -1363,7 +1361,7 @@ function Ao(t, e, n) {
1363
1361
  }
1364
1362
  return [{ data: n == null ? void 0 : n[0], index: t, offset: 0, size: 0 }];
1365
1363
  }
1366
- const ke = {
1364
+ const Be = {
1367
1365
  bottom: 0,
1368
1366
  firstItemIndex: 0,
1369
1367
  items: [],
@@ -1376,230 +1374,230 @@ const ke = {
1376
1374
  };
1377
1375
  function Ie(t, e, n, o, r, s) {
1378
1376
  const { lastIndex: i, lastOffset: l, lastSize: c } = r;
1379
- let u = 0, f = 0;
1377
+ let a = 0, p = 0;
1380
1378
  if (t.length > 0) {
1381
- u = t[0].offset;
1382
- const I = t[t.length - 1];
1383
- f = I.offset + I.size;
1379
+ a = t[0].offset;
1380
+ const w = t[t.length - 1];
1381
+ p = w.offset + w.size;
1384
1382
  }
1385
- const S = n - i, p = l + S * c + (S - 1) * o, m = u, w = p - f;
1383
+ const I = n - i, h = l + I * c + (I - 1) * o, f = a, C = h - p;
1386
1384
  return {
1387
- bottom: f,
1385
+ bottom: p,
1388
1386
  firstItemIndex: s,
1389
1387
  items: In(t, r, s),
1390
- offsetBottom: w,
1391
- offsetTop: u,
1392
- top: m,
1388
+ offsetBottom: C,
1389
+ offsetTop: a,
1390
+ top: f,
1393
1391
  topItems: In(e, r, s),
1394
- topListHeight: e.reduce((I, C) => C.size + I, 0),
1392
+ topListHeight: e.reduce((w, S) => S.size + w, 0),
1395
1393
  totalCount: n
1396
1394
  };
1397
1395
  }
1398
- function $n(t, e, n, o, r, s) {
1396
+ function Dn(t, e, n, o, r, s) {
1399
1397
  let i = 0;
1400
1398
  if (n.groupIndices.length > 0)
1401
- for (const f of n.groupIndices) {
1402
- if (f - i >= t)
1399
+ for (const p of n.groupIndices) {
1400
+ if (p - i >= t)
1403
1401
  break;
1404
1402
  i++;
1405
1403
  }
1406
- const l = t + i, c = Ue(e, l), u = Array.from({ length: l }).map((f, S) => ({
1407
- data: s[S + c],
1408
- index: S + c,
1404
+ const l = t + i, c = Ue(e, l), a = Array.from({ length: l }).map((p, I) => ({
1405
+ data: s[I + c],
1406
+ index: I + c,
1409
1407
  offset: 0,
1410
1408
  size: 0
1411
1409
  }));
1412
- return Ie(u, [], l, r, n, o);
1410
+ return Ie(a, [], l, r, n, o);
1413
1411
  }
1414
1412
  function In(t, e, n) {
1415
1413
  if (t.length === 0)
1416
1414
  return [];
1417
- if (!be(e))
1418
- return t.map((u) => ({ ...u, index: u.index + n, originalIndex: u.index }));
1419
- const o = t[0].index, r = t[t.length - 1].index, s = [], i = ve(e.groupOffsetTree, o, r);
1415
+ if (!Re(e))
1416
+ return t.map((a) => ({ ...a, index: a.index + n, originalIndex: a.index }));
1417
+ const o = t[0].index, r = t[t.length - 1].index, s = [], i = ye(e.groupOffsetTree, o, r);
1420
1418
  let l, c = 0;
1421
- for (const u of t) {
1422
- (!l || l.end < u.index) && (l = i.shift(), c = e.groupIndices.indexOf(l.start));
1423
- let f;
1424
- u.index === l.start ? f = {
1419
+ for (const a of t) {
1420
+ (!l || l.end < a.index) && (l = i.shift(), c = e.groupIndices.indexOf(l.start));
1421
+ let p;
1422
+ a.index === l.start ? p = {
1425
1423
  index: c,
1426
1424
  type: "group"
1427
- } : f = {
1425
+ } : p = {
1428
1426
  groupIndex: c,
1429
- index: u.index - (c + 1) + n
1427
+ index: a.index - (c + 1) + n
1430
1428
  }, s.push({
1431
- ...f,
1432
- data: u.data,
1433
- offset: u.offset,
1434
- originalIndex: u.index,
1435
- size: u.size
1429
+ ...p,
1430
+ data: a.data,
1431
+ offset: a.offset,
1432
+ originalIndex: a.index,
1433
+ size: a.size
1436
1434
  });
1437
1435
  }
1438
1436
  return s;
1439
1437
  }
1440
- const Gt = U(
1438
+ const _t = U(
1441
1439
  ([
1442
1440
  { data: t, firstItemIndex: e, gap: n, sizes: o, totalCount: r },
1443
1441
  s,
1444
1442
  { listBoundary: i, topListHeight: l, visibleRange: c },
1445
- { initialTopMostItemIndex: u, scrolledToInitialItem: f },
1446
- { topListHeight: S },
1447
- p,
1448
- { didMount: m },
1449
- { recalcInProgress: w }
1443
+ { initialTopMostItemIndex: a, scrolledToInitialItem: p },
1444
+ { topListHeight: I },
1445
+ h,
1446
+ { didMount: f },
1447
+ { recalcInProgress: C }
1450
1448
  ]) => {
1451
- const I = y([]), C = y(0), g = $();
1452
- F(s.topItemsIndexes, I);
1453
- const a = ct(
1449
+ const w = v([]), S = v(0), m = $();
1450
+ O(s.topItemsIndexes, w);
1451
+ const u = ct(
1454
1452
  x(
1455
1453
  rt(
1456
- m,
1457
- w,
1454
+ f,
1455
+ C,
1458
1456
  A(c, se),
1459
1457
  A(r),
1460
1458
  A(o),
1461
- A(u),
1462
- f,
1463
- A(I),
1459
+ A(a),
1460
+ p,
1461
+ A(w),
1464
1462
  A(e),
1465
1463
  A(n),
1466
1464
  t
1467
1465
  ),
1468
- P(([d, R, , B, , , , , , , O]) => {
1469
- const L = O && O.length !== B;
1470
- return d && !R && !L;
1466
+ P(([d, b, , k, , , , , , , F]) => {
1467
+ const L = F && F.length !== k;
1468
+ return d && !b && !L;
1471
1469
  }),
1472
1470
  E(
1473
1471
  ([
1474
1472
  ,
1475
1473
  ,
1476
- [d, R],
1477
- B,
1478
- O,
1474
+ [d, b],
1475
+ k,
1476
+ F,
1479
1477
  L,
1480
1478
  V,
1481
1479
  D,
1482
1480
  J,
1483
1481
  nt,
1484
- k
1482
+ B
1485
1483
  ]) => {
1486
- const q = O, { offsetTree: st, sizeTree: dt } = q, St = lt(C);
1487
- if (B === 0)
1488
- return { ...ke, totalCount: B };
1489
- if (d === 0 && R === 0)
1490
- return St === 0 ? { ...ke, totalCount: B } : $n(St, L, O, J, nt, k || []);
1484
+ const q = F, { offsetTree: it, sizeTree: dt } = q, St = st(S);
1485
+ if (k === 0)
1486
+ return { ...Be, totalCount: k };
1487
+ if (d === 0 && b === 0)
1488
+ return St === 0 ? { ...Be, totalCount: k } : Dn(St, L, F, J, nt, B || []);
1491
1489
  if (j(dt))
1492
1490
  return St > 0 ? null : Ie(
1493
- Ao(Ue(L, B), q, k),
1491
+ Ao(Ue(L, k), q, B),
1494
1492
  [],
1495
- B,
1493
+ k,
1496
1494
  nt,
1497
1495
  q,
1498
1496
  J
1499
1497
  );
1500
1498
  const ft = [];
1501
1499
  if (D.length > 0) {
1502
- const Mt = D[0], yt = D[D.length - 1];
1503
- let kt = 0;
1504
- for (const v of ve(dt, Mt, yt)) {
1505
- const N = v.value, Q = Math.max(v.start, Mt), it = Math.min(v.end, yt);
1506
- for (let tt = Q; tt <= it; tt++)
1507
- ft.push({ data: k == null ? void 0 : k[tt], index: tt, offset: kt, size: N }), kt += N;
1500
+ const Mt = D[0], vt = D[D.length - 1];
1501
+ let Bt = 0;
1502
+ for (const y of ye(dt, Mt, vt)) {
1503
+ const N = y.value, Q = Math.max(y.start, Mt), lt = Math.min(y.end, vt);
1504
+ for (let tt = Q; tt <= lt; tt++)
1505
+ ft.push({ data: B == null ? void 0 : B[tt], index: tt, offset: Bt, size: N }), Bt += N;
1508
1506
  }
1509
1507
  }
1510
1508
  if (!V)
1511
- return Ie([], ft, B, nt, q, J);
1512
- const ut = D.length > 0 ? D[D.length - 1] + 1 : 0, At = bo(st, d, R, ut);
1509
+ return Ie([], ft, k, nt, q, J);
1510
+ const ut = D.length > 0 ? D[D.length - 1] + 1 : 0, At = Ro(it, d, b, ut);
1513
1511
  if (At.length === 0)
1514
1512
  return null;
1515
- const xt = B - 1, Xt = ye([], (Mt) => {
1516
- for (const yt of At) {
1517
- const kt = yt.value;
1518
- let v = kt.offset, N = yt.start;
1519
- const Q = kt.size;
1520
- if (kt.offset < d) {
1521
- N += Math.floor((d - kt.offset + nt) / (Q + nt));
1522
- const tt = N - yt.start;
1523
- v += tt * Q + tt * nt;
1513
+ const xt = k - 1, Xt = ve([], (Mt) => {
1514
+ for (const vt of At) {
1515
+ const Bt = vt.value;
1516
+ let y = Bt.offset, N = vt.start;
1517
+ const Q = Bt.size;
1518
+ if (Bt.offset < d) {
1519
+ N += Math.floor((d - Bt.offset + nt) / (Q + nt));
1520
+ const tt = N - vt.start;
1521
+ y += tt * Q + tt * nt;
1524
1522
  }
1525
- N < ut && (v += (ut - N) * Q, N = ut);
1526
- const it = Math.min(yt.end, xt);
1527
- for (let tt = N; tt <= it && !(v >= R); tt++)
1528
- Mt.push({ data: k == null ? void 0 : k[tt], index: tt, offset: v, size: Q }), v += Q + nt;
1523
+ N < ut && (y += (ut - N) * Q, N = ut);
1524
+ const lt = Math.min(vt.end, xt);
1525
+ for (let tt = N; tt <= lt && !(y >= b); tt++)
1526
+ Mt.push({ data: B == null ? void 0 : B[tt], index: tt, offset: y, size: Q }), y += Q + nt;
1529
1527
  }
1530
1528
  });
1531
- return Ie(Xt, ft, B, nt, q, J);
1529
+ return Ie(Xt, ft, k, nt, q, J);
1532
1530
  }
1533
1531
  ),
1534
1532
  //@ts-expect-error filter needs to be fixed
1535
1533
  P((d) => d !== null),
1536
1534
  Y()
1537
1535
  ),
1538
- ke
1536
+ Be
1539
1537
  );
1540
- F(
1538
+ O(
1541
1539
  x(
1542
1540
  t,
1543
1541
  P(Me),
1544
1542
  E((d) => d == null ? void 0 : d.length)
1545
1543
  ),
1546
1544
  r
1547
- ), F(
1545
+ ), O(
1548
1546
  x(
1549
- a,
1547
+ u,
1550
1548
  E((d) => d.topListHeight)
1551
1549
  ),
1552
- S
1553
- ), F(S, l), F(
1550
+ I
1551
+ ), O(I, l), O(
1554
1552
  x(
1555
- a,
1553
+ u,
1556
1554
  E((d) => [d.top, d.bottom])
1557
1555
  ),
1558
1556
  i
1559
- ), F(
1557
+ ), O(
1560
1558
  x(
1561
- a,
1559
+ u,
1562
1560
  E((d) => d.items)
1563
1561
  ),
1564
- g
1562
+ m
1565
1563
  );
1566
- const T = pt(
1564
+ const T = ht(
1567
1565
  x(
1568
- a,
1566
+ u,
1569
1567
  P(({ items: d }) => d.length > 0),
1570
- G(r, t),
1571
- P(([{ items: d }, R]) => d[d.length - 1].originalIndex === R - 1),
1572
- E(([, d, R]) => [d - 1, R]),
1568
+ _(r, t),
1569
+ P(([{ items: d }, b]) => d[d.length - 1].originalIndex === b - 1),
1570
+ E(([, d, b]) => [d - 1, b]),
1573
1571
  Y(se),
1574
1572
  E(([d]) => d)
1575
1573
  )
1576
- ), b = pt(
1574
+ ), R = ht(
1577
1575
  x(
1578
- a,
1576
+ u,
1579
1577
  Lt(200),
1580
- P(({ items: d, topItems: R }) => d.length > 0 && d[0].originalIndex === R.length),
1578
+ P(({ items: d, topItems: b }) => d.length > 0 && d[0].originalIndex === b.length),
1581
1579
  E(({ items: d }) => d[0].index),
1582
1580
  Y()
1583
1581
  )
1584
- ), h = pt(
1582
+ ), g = ht(
1585
1583
  x(
1586
- a,
1584
+ u,
1587
1585
  P(({ items: d }) => d.length > 0),
1588
1586
  E(({ items: d }) => {
1589
- let R = 0, B = d.length - 1;
1590
- for (; d[R].type === "group" && R < B; )
1591
- R++;
1592
- for (; d[B].type === "group" && B > R; )
1593
- B--;
1587
+ let b = 0, k = d.length - 1;
1588
+ for (; d[b].type === "group" && b < k; )
1589
+ b++;
1590
+ for (; d[k].type === "group" && k > b; )
1591
+ k--;
1594
1592
  return {
1595
- endIndex: d[B].index,
1596
- startIndex: d[R].index
1593
+ endIndex: d[k].index,
1594
+ startIndex: d[b].index
1597
1595
  };
1598
1596
  }),
1599
- Y(An)
1597
+ Y(Pn)
1600
1598
  )
1601
1599
  );
1602
- return { endReached: T, initialItemCount: C, itemsRendered: g, listState: a, rangeChanged: h, startReached: b, topItemsIndexes: I, ...p };
1600
+ return { endReached: T, initialItemCount: S, itemsRendered: m, listState: u, rangeChanged: g, startReached: R, topItemsIndexes: w, ...h };
1603
1601
  },
1604
1602
  X(
1605
1603
  Et,
@@ -1612,22 +1610,22 @@ const Gt = U(
1612
1610
  Ne
1613
1611
  ),
1614
1612
  { singleton: !0 }
1615
- ), Un = U(
1613
+ ), $n = U(
1616
1614
  ([{ fixedFooterHeight: t, fixedHeaderHeight: e, footerHeight: n, headerHeight: o }, { listState: r }]) => {
1617
1615
  const s = $(), i = ct(
1618
1616
  x(
1619
1617
  rt(n, t, o, e, r),
1620
- E(([l, c, u, f, S]) => l + c + u + f + S.offsetBottom + S.bottom)
1618
+ E(([l, c, a, p, I]) => l + c + a + p + I.offsetBottom + I.bottom)
1621
1619
  ),
1622
1620
  0
1623
1621
  );
1624
- return F(A(i), s), { totalListHeight: i, totalListHeightChanged: s };
1622
+ return O(A(i), s), { totalListHeight: i, totalListHeightChanged: s };
1625
1623
  },
1626
- X(at, Gt),
1624
+ X(at, _t),
1627
1625
  { singleton: !0 }
1628
1626
  ), Mo = U(
1629
1627
  ([{ viewportHeight: t }, { totalListHeight: e }]) => {
1630
- const n = y(!1), o = ct(
1628
+ const n = v(!1), o = ct(
1631
1629
  x(
1632
1630
  rt(n, t, e),
1633
1631
  P(([r]) => r),
@@ -1639,99 +1637,101 @@ const Gt = U(
1639
1637
  );
1640
1638
  return { alignToBottom: n, paddingTopAddition: o };
1641
1639
  },
1642
- X(at, Un),
1640
+ X(at, $n),
1643
1641
  { singleton: !0 }
1644
1642
  );
1645
1643
  function Sn(t) {
1646
1644
  return t ? t === "smooth" ? "smooth" : "auto" : !1;
1647
1645
  }
1648
- const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
1646
+ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), Go = U(
1649
1647
  ([
1650
- { listRefresh: t, totalCount: e },
1651
- { atBottomState: n, isAtBottom: o },
1652
- { scrollToIndex: r },
1653
- { scrolledToInitialItem: s },
1654
- { didMount: i, propsReady: l },
1655
- { log: c },
1656
- { scrollingInProgress: u }
1648
+ { listRefresh: t, totalCount: e, fixedItemSize: n },
1649
+ { atBottomState: o, isAtBottom: r },
1650
+ { scrollToIndex: s },
1651
+ { scrolledToInitialItem: i },
1652
+ { didMount: l, propsReady: c },
1653
+ { log: a },
1654
+ { scrollingInProgress: p }
1657
1655
  ]) => {
1658
- const f = y(!1), S = $();
1659
- let p = null;
1660
- function m(I) {
1661
- W(r, {
1656
+ const I = v(!1), h = $();
1657
+ let f = null;
1658
+ function C(S) {
1659
+ W(s, {
1662
1660
  align: "end",
1663
- behavior: I,
1661
+ behavior: S,
1664
1662
  index: "LAST"
1665
1663
  });
1666
1664
  }
1667
1665
  K(
1668
1666
  x(
1669
- rt(x(A(e), jt(1)), i),
1670
- G(A(f), o, s, u),
1671
- E(([[I, C], g, a, T, b]) => {
1672
- let h = C && T, d = "auto";
1673
- return h && (d = Wo(g, a || b), h = h && !!d), { followOutputBehavior: d, shouldFollow: h, totalCount: I };
1667
+ rt(x(A(e), jt(1)), l),
1668
+ _(A(I), r, i, p),
1669
+ E(([[S, m], u, T, R, g]) => {
1670
+ let d = m && R, b = "auto";
1671
+ return d && (b = Wo(u, T || g), d = d && !!b), { followOutputBehavior: b, shouldFollow: d, totalCount: S };
1674
1672
  }),
1675
- P(({ shouldFollow: I }) => I)
1673
+ P(({ shouldFollow: S }) => S)
1676
1674
  ),
1677
- ({ followOutputBehavior: I, totalCount: C }) => {
1678
- p && (p(), p = null), p = Rt(t, () => {
1679
- lt(c)("following output to ", { totalCount: C }, ht.DEBUG), m(I), p = null;
1675
+ ({ followOutputBehavior: S, totalCount: m }) => {
1676
+ f && (f(), f = null), st(n) ? requestAnimationFrame(() => {
1677
+ st(a)("following output to ", { totalCount: m }, mt.DEBUG), C(S);
1678
+ }) : f = bt(t, () => {
1679
+ st(a)("following output to ", { totalCount: m }, mt.DEBUG), C(S), f = null;
1680
1680
  });
1681
1681
  }
1682
1682
  );
1683
- function w(I) {
1684
- const C = Rt(n, (g) => {
1685
- I && !g.atBottom && g.notAtBottomBecause === "SIZE_INCREASED" && !p && (lt(c)("scrolling to bottom due to increased size", {}, ht.DEBUG), m("auto"));
1683
+ function w(S) {
1684
+ const m = bt(o, (u) => {
1685
+ S && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && !f && (st(a)("scrolling to bottom due to increased size", {}, mt.DEBUG), C("auto"));
1686
1686
  });
1687
- setTimeout(C, 100);
1687
+ setTimeout(m, 100);
1688
1688
  }
1689
1689
  return K(
1690
1690
  x(
1691
- rt(A(f), e, l),
1692
- P(([I, , C]) => I && C),
1693
- bt(
1694
- ({ value: I }, [, C]) => ({ refreshed: I === C, value: C }),
1691
+ rt(A(I), e, c),
1692
+ P(([S, , m]) => S && m),
1693
+ Rt(
1694
+ ({ value: S }, [, m]) => ({ refreshed: S === m, value: m }),
1695
1695
  { refreshed: !1, value: 0 }
1696
1696
  ),
1697
- P(({ refreshed: I }) => I),
1698
- G(f, e)
1697
+ P(({ refreshed: S }) => S),
1698
+ _(I, e)
1699
1699
  ),
1700
- ([, I]) => {
1701
- lt(s) && w(I !== !1);
1700
+ ([, S]) => {
1701
+ st(i) && w(S !== !1);
1702
1702
  }
1703
- ), K(S, () => {
1704
- w(lt(f) !== !1);
1705
- }), K(rt(A(f), n), ([I, C]) => {
1706
- I && !C.atBottom && C.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && m("auto");
1707
- }), { autoscrollToBottom: S, followOutput: f };
1703
+ ), K(h, () => {
1704
+ w(st(I) !== !1);
1705
+ }), K(rt(A(I), o), ([S, m]) => {
1706
+ S && !m.atBottom && m.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && C("auto");
1707
+ }), { autoscrollToBottom: h, followOutput: I };
1708
1708
  },
1709
1709
  X(Et, ae, ce, ue, Pt, Vt, at)
1710
- ), Go = U(
1711
- ([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (F(
1710
+ ), _o = U(
1711
+ ([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (O(
1712
1712
  x(
1713
1713
  l,
1714
- G(s),
1714
+ _(s),
1715
1715
  P(([, c]) => c !== 0),
1716
- G(r, o, e, n, t),
1717
- E(([[, c], u, f, S, p, m = []]) => $n(c, u, f, S, p, m))
1716
+ _(r, o, e, n, t),
1717
+ E(([[, c], a, p, I, h, f = []]) => Dn(c, a, p, I, h, f))
1718
1718
  ),
1719
1719
  i
1720
1720
  ), {}),
1721
- X(Et, ue, Gt, Pt),
1721
+ X(Et, ue, _t, Pt),
1722
1722
  { singleton: !0 }
1723
1723
  ), No = U(
1724
1724
  ([{ didMount: t }, { scrollTo: e }, { listState: n }]) => {
1725
- const o = y(0);
1725
+ const o = v(0);
1726
1726
  return K(
1727
1727
  x(
1728
1728
  t,
1729
- G(o),
1729
+ _(o),
1730
1730
  P(([, r]) => r !== 0),
1731
1731
  E(([, r]) => ({ top: r }))
1732
1732
  ),
1733
1733
  (r) => {
1734
- Rt(
1734
+ bt(
1735
1735
  x(
1736
1736
  n,
1737
1737
  jt(1),
@@ -1748,7 +1748,7 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
1748
1748
  initialScrollTop: o
1749
1749
  };
1750
1750
  },
1751
- X(Pt, at, Gt),
1751
+ X(Pt, at, _t),
1752
1752
  { singleton: !0 }
1753
1753
  ), Do = ({
1754
1754
  itemBottom: t,
@@ -1760,54 +1760,54 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
1760
1760
  ([
1761
1761
  { gap: t, sizes: e, totalCount: n },
1762
1762
  { fixedFooterHeight: o, fixedHeaderHeight: r, headerHeight: s, scrollingInProgress: i, scrollTop: l, viewportHeight: c },
1763
- { scrollToIndex: u }
1763
+ { scrollToIndex: a }
1764
1764
  ]) => {
1765
- const f = $();
1766
- return F(
1765
+ const p = $();
1766
+ return O(
1767
1767
  x(
1768
- f,
1769
- G(e, c, n, s, r, o, l),
1770
- G(t),
1771
- E(([[S, p, m, w, I, C, g, a], T]) => {
1772
- const { align: b, behavior: h, calculateViewLocation: d = Do, done: R, ...B } = S, O = _n(S, p, w - 1), L = ie(O, p.offsetTree, T) + I + C, V = L + Ct(p.sizeTree, O)[1], D = a + C, J = a + m - g, nt = d({
1768
+ p,
1769
+ _(e, c, n, s, r, o, l),
1770
+ _(t),
1771
+ E(([[I, h, f, C, w, S, m, u], T]) => {
1772
+ const { align: R, behavior: g, calculateViewLocation: d = Do, done: b, ...k } = I, F = Wn(I, h, C - 1), L = ie(F, h.offsetTree, T) + w + S, V = L + Ct(h.sizeTree, F)[1], D = u + S, J = u + f - m, nt = d({
1773
1773
  itemBottom: V,
1774
1774
  itemTop: L,
1775
- locationParams: { align: b, behavior: h, ...B },
1775
+ locationParams: { align: R, behavior: g, ...k },
1776
1776
  viewportBottom: J,
1777
1777
  viewportTop: D
1778
1778
  });
1779
- return nt ? R && Rt(
1779
+ return nt ? b && bt(
1780
1780
  x(
1781
1781
  i,
1782
- P((k) => !k),
1782
+ P((B) => !B),
1783
1783
  // skips the initial publish of false, and the cleanup call.
1784
1784
  // but if scrollingInProgress is true, we skip the initial publish.
1785
- jt(lt(i) ? 1 : 2)
1785
+ jt(st(i) ? 1 : 2)
1786
1786
  ),
1787
- R
1788
- ) : R && R(), nt;
1787
+ b
1788
+ ) : b && b(), nt;
1789
1789
  }),
1790
- P((S) => S !== null)
1790
+ P((I) => I !== null)
1791
1791
  ),
1792
- u
1792
+ a
1793
1793
  ), {
1794
- scrollIntoView: f
1794
+ scrollIntoView: p
1795
1795
  };
1796
1796
  },
1797
- X(Et, at, ce, Gt, Vt),
1797
+ X(Et, at, ce, _t, Vt),
1798
1798
  { singleton: !0 }
1799
- ), Kn = U(
1799
+ ), Un = U(
1800
1800
  ([{ scrollVelocity: t }]) => {
1801
- const e = y(!1), n = $(), o = y(!1);
1802
- return F(
1801
+ const e = v(!1), n = $(), o = v(!1);
1802
+ return O(
1803
1803
  x(
1804
1804
  t,
1805
- G(o, e, n),
1805
+ _(o, e, n),
1806
1806
  P(([r, s]) => !!s),
1807
1807
  E(([r, s, i, l]) => {
1808
- const { enter: c, exit: u } = s;
1808
+ const { enter: c, exit: a } = s;
1809
1809
  if (i) {
1810
- if (u(r, l))
1810
+ if (a(r, l))
1811
1811
  return !1;
1812
1812
  } else if (c(r, l))
1813
1813
  return !0;
@@ -1817,7 +1817,7 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
1817
1817
  ),
1818
1818
  e
1819
1819
  ), K(
1820
- x(rt(e, t, n), G(o)),
1820
+ x(rt(e, t, n), _(o)),
1821
1821
  ([[r, s, i], l]) => {
1822
1822
  r && l && l.change && l.change(s, i);
1823
1823
  }
@@ -1826,21 +1826,21 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
1826
1826
  X(ae),
1827
1827
  { singleton: !0 }
1828
1828
  ), je = U(([{ scrollContainerState: t, scrollTo: e }]) => {
1829
- const n = $(), o = $(), r = $(), s = y(!1), i = y(void 0);
1830
- return F(
1829
+ const n = $(), o = $(), r = $(), s = v(!1), i = v(void 0);
1830
+ return O(
1831
1831
  x(
1832
1832
  rt(n, o),
1833
- E(([{ scrollHeight: l, scrollTop: c, viewportHeight: u }, { offsetTop: f }]) => ({
1833
+ E(([{ scrollHeight: l, scrollTop: c, viewportHeight: a }, { offsetTop: p }]) => ({
1834
1834
  scrollHeight: l,
1835
- scrollTop: Math.max(0, c - f),
1836
- viewportHeight: u
1835
+ scrollTop: Math.max(0, c - p),
1836
+ viewportHeight: a
1837
1837
  }))
1838
1838
  ),
1839
1839
  t
1840
- ), F(
1840
+ ), O(
1841
1841
  x(
1842
1842
  e,
1843
- G(o),
1843
+ _(o),
1844
1844
  E(([l, { offsetTop: c }]) => ({
1845
1845
  ...l,
1846
1846
  top: l.top + c
@@ -1865,28 +1865,28 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
1865
1865
  { didMount: s },
1866
1866
  { useWindowScroll: i, windowScrollContainerState: l, windowViewportRect: c }
1867
1867
  ]) => {
1868
- const u = $(), f = y(void 0), S = y(null), p = y(null);
1869
- return F(l, S), F(c, p), K(
1868
+ const a = $(), p = v(void 0), I = v(null), h = v(null);
1869
+ return O(l, I), O(c, h), K(
1870
1870
  x(
1871
- u,
1872
- G(e, o, i, S, p, n)
1871
+ a,
1872
+ _(e, o, i, I, h, n)
1873
1873
  ),
1874
- ([m, w, I, C, g, a, T]) => {
1875
- const b = Ho(w.sizeTree);
1876
- C && g !== null && a !== null && (I = g.scrollTop - a.offsetTop), I -= T, m({ ranges: b, scrollTop: I });
1874
+ ([f, C, w, S, m, u, T]) => {
1875
+ const R = Ho(C.sizeTree);
1876
+ S && m !== null && u !== null && (w = m.scrollTop - u.offsetTop), w -= T, f({ ranges: R, scrollTop: w });
1877
1877
  }
1878
- ), F(x(f, P(Me), E(Ko)), r), F(
1878
+ ), O(x(p, P(Me), E(Ko)), r), O(
1879
1879
  x(
1880
1880
  s,
1881
- G(f),
1882
- P(([, m]) => m !== void 0),
1881
+ _(p),
1882
+ P(([, f]) => f !== void 0),
1883
1883
  Y(),
1884
- E(([, m]) => m.ranges)
1884
+ E(([, f]) => f.ranges)
1885
1885
  ),
1886
1886
  t
1887
1887
  ), {
1888
- getState: u,
1889
- restoreStateFrom: f
1888
+ getState: a,
1889
+ restoreStateFrom: p
1890
1890
  };
1891
1891
  },
1892
1892
  X(Et, at, ue, Pt, je)
@@ -1895,8 +1895,8 @@ function Ko(t) {
1895
1895
  return { align: "start", index: 0, offset: t.scrollTop };
1896
1896
  }
1897
1897
  const jo = U(([{ topItemsIndexes: t }]) => {
1898
- const e = y(0);
1899
- return F(
1898
+ const e = v(0);
1899
+ return O(
1900
1900
  x(
1901
1901
  e,
1902
1902
  P((n) => n >= 0),
@@ -1904,90 +1904,90 @@ const jo = U(([{ topItemsIndexes: t }]) => {
1904
1904
  ),
1905
1905
  t
1906
1906
  ), { topItemCount: e };
1907
- }, X(Gt));
1908
- function jn(t) {
1907
+ }, X(_t));
1908
+ function Kn(t) {
1909
1909
  let e = !1, n;
1910
1910
  return () => (e || (e = !0, n = t()), n);
1911
1911
  }
1912
- const qo = jn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), Yo = U(
1912
+ const qo = Kn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), Yo = U(
1913
1913
  ([
1914
1914
  { deviation: t, scrollBy: e, scrollingInProgress: n, scrollTop: o },
1915
1915
  { isAtBottom: r, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: l },
1916
1916
  { listState: c },
1917
- { beforeUnshiftWith: u, gap: f, shiftWithOffset: S, sizes: p },
1918
- { log: m },
1919
- { recalcInProgress: w }
1917
+ { beforeUnshiftWith: a, gap: p, shiftWithOffset: I, sizes: h },
1918
+ { log: f },
1919
+ { recalcInProgress: C }
1920
1920
  ]) => {
1921
- const I = pt(
1921
+ const w = ht(
1922
1922
  x(
1923
1923
  c,
1924
- G(i),
1925
- bt(
1926
- ([, g, a, T], [{ bottom: b, items: h, offsetBottom: d, totalCount: R }, B]) => {
1927
- const O = b + d;
1924
+ _(i),
1925
+ Rt(
1926
+ ([, m, u, T], [{ bottom: R, items: g, offsetBottom: d, totalCount: b }, k]) => {
1927
+ const F = R + d;
1928
1928
  let L = 0;
1929
- return a === R && g.length > 0 && h.length > 0 && (h[0].originalIndex === 0 && g[0].originalIndex === 0 || (L = O - T, L !== 0 && (L += B))), [L, h, R, O];
1929
+ return u === b && m.length > 0 && g.length > 0 && (g[0].originalIndex === 0 && m[0].originalIndex === 0 || (L = F - T, L !== 0 && (L += k))), [L, g, b, F];
1930
1930
  },
1931
1931
  [0, [], 0, 0]
1932
1932
  ),
1933
- P(([g]) => g !== 0),
1934
- G(o, l, n, r, m, w),
1935
- P(([, g, a, T, , , b]) => !b && !T && g !== 0 && a === le),
1936
- E(([[g], , , , , a]) => (a("Upward scrolling compensation", { amount: g }, ht.DEBUG), g))
1933
+ P(([m]) => m !== 0),
1934
+ _(o, l, n, r, f, C),
1935
+ P(([, m, u, T, , , R]) => !R && !T && m !== 0 && u === le),
1936
+ E(([[m], , , , , u]) => (u("Upward scrolling compensation", { amount: m }, mt.DEBUG), m))
1937
1937
  )
1938
1938
  );
1939
- function C(g) {
1940
- g > 0 ? (W(e, { behavior: "auto", top: -g }), W(t, 0)) : (W(t, 0), W(e, { behavior: "auto", top: -g }));
1939
+ function S(m) {
1940
+ m > 0 ? (W(e, { behavior: "auto", top: -m }), W(t, 0)) : (W(t, 0), W(e, { behavior: "auto", top: -m }));
1941
1941
  }
1942
- return K(x(I, G(t, s)), ([g, a, T]) => {
1943
- T && qo() ? W(t, a - g) : C(-g);
1942
+ return K(x(w, _(t, s)), ([m, u, T]) => {
1943
+ T && qo() ? W(t, u - m) : S(-m);
1944
1944
  }), K(
1945
1945
  x(
1946
- rt(ct(s, !1), t, w),
1947
- P(([g, a, T]) => !g && !T && a !== 0),
1948
- E(([g, a]) => a),
1946
+ rt(ct(s, !1), t, C),
1947
+ P(([m, u, T]) => !m && !T && u !== 0),
1948
+ E(([m, u]) => u),
1949
1949
  Lt(1)
1950
1950
  ),
1951
- C
1952
- ), F(
1951
+ S
1952
+ ), O(
1953
1953
  x(
1954
- S,
1955
- E((g) => ({ top: -g }))
1954
+ I,
1955
+ E((m) => ({ top: -m }))
1956
1956
  ),
1957
1957
  e
1958
1958
  ), K(
1959
1959
  x(
1960
- u,
1961
- G(p, f),
1962
- E(([g, { groupIndices: a, lastSize: T, sizeTree: b }, h]) => {
1963
- function d(R) {
1964
- return R * (T + h);
1960
+ a,
1961
+ _(h, p),
1962
+ E(([m, { groupIndices: u, lastSize: T, sizeTree: R }, g]) => {
1963
+ function d(b) {
1964
+ return b * (T + g);
1965
1965
  }
1966
- if (a.length === 0)
1967
- return d(g);
1966
+ if (u.length === 0)
1967
+ return d(m);
1968
1968
  {
1969
- let R = 0;
1970
- const B = re(b, 0);
1971
- let O = 0, L = 0;
1972
- for (; O < g; ) {
1973
- O++, R += B;
1974
- let V = a.length === L + 1 ? 1 / 0 : a[L + 1] - a[L] - 1;
1975
- O + V > g && (R -= B, V = g - O + 1), O += V, R += d(V), L++;
1969
+ let b = 0;
1970
+ const k = re(R, 0);
1971
+ let F = 0, L = 0;
1972
+ for (; F < m; ) {
1973
+ F++, b += k;
1974
+ let V = u.length === L + 1 ? 1 / 0 : u[L + 1] - u[L] - 1;
1975
+ F + V > m && (b -= k, V = m - F + 1), F += V, b += d(V), L++;
1976
1976
  }
1977
- return R;
1977
+ return b;
1978
1978
  }
1979
1979
  })
1980
1980
  ),
1981
- (g) => {
1982
- W(t, g), requestAnimationFrame(() => {
1983
- W(e, { top: g }), requestAnimationFrame(() => {
1984
- W(t, 0), W(w, !1);
1981
+ (m) => {
1982
+ W(t, m), requestAnimationFrame(() => {
1983
+ W(e, { top: m }), requestAnimationFrame(() => {
1984
+ W(t, 0), W(C, !1);
1985
1985
  });
1986
1986
  });
1987
1987
  }
1988
1988
  ), { deviation: t };
1989
1989
  },
1990
- X(at, ae, Gt, Et, Vt, Ne)
1990
+ X(at, ae, _t, Et, Vt, Ne)
1991
1991
  ), Zo = U(
1992
1992
  ([
1993
1993
  t,
@@ -1999,7 +1999,7 @@ const qo = jn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
1999
1999
  i,
2000
2000
  l,
2001
2001
  c,
2002
- u
2002
+ a
2003
2003
  ]) => ({
2004
2004
  ...t,
2005
2005
  ...e,
@@ -2010,21 +2010,21 @@ const qo = jn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2010
2010
  ...i,
2011
2011
  ...l,
2012
2012
  ...c,
2013
- ...u
2013
+ ...a
2014
2014
  }),
2015
2015
  X(
2016
2016
  Ke,
2017
- Go,
2017
+ _o,
2018
2018
  Pt,
2019
- Kn,
2020
2019
  Un,
2020
+ $n,
2021
2021
  No,
2022
2022
  Mo,
2023
2023
  je,
2024
2024
  $o,
2025
2025
  Vt
2026
2026
  )
2027
- ), qn = U(
2027
+ ), jn = U(
2028
2028
  ([
2029
2029
  {
2030
2030
  data: t,
@@ -2036,64 +2036,64 @@ const qo = jn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2036
2036
  itemSize: i,
2037
2037
  sizeRanges: l,
2038
2038
  sizes: c,
2039
- statefulTotalCount: u,
2040
- totalCount: f,
2041
- trackItemSizes: S
2039
+ statefulTotalCount: a,
2040
+ totalCount: p,
2041
+ trackItemSizes: I
2042
2042
  },
2043
- { initialItemFinalLocationReached: p, initialTopMostItemIndex: m, scrolledToInitialItem: w },
2044
- I,
2045
- C,
2046
- g,
2047
- { listState: a, topItemsIndexes: T, ...b },
2048
- { scrollToIndex: h },
2043
+ { initialItemFinalLocationReached: h, initialTopMostItemIndex: f, scrolledToInitialItem: C },
2044
+ w,
2045
+ S,
2046
+ m,
2047
+ { listState: u, topItemsIndexes: T, ...R },
2048
+ { scrollToIndex: g },
2049
2049
  d,
2050
- { topItemCount: R },
2051
- { groupCounts: B },
2052
- O
2053
- ]) => (F(b.rangeChanged, O.scrollSeekRangeChanged), F(
2050
+ { topItemCount: b },
2051
+ { groupCounts: k },
2052
+ F
2053
+ ]) => (O(R.rangeChanged, F.scrollSeekRangeChanged), O(
2054
2054
  x(
2055
- O.windowViewportRect,
2055
+ F.windowViewportRect,
2056
2056
  E((L) => L.visibleHeight)
2057
2057
  ),
2058
- I.viewportHeight
2058
+ w.viewportHeight
2059
2059
  ), {
2060
2060
  data: t,
2061
2061
  defaultItemHeight: e,
2062
2062
  firstItemIndex: n,
2063
2063
  fixedItemHeight: o,
2064
2064
  gap: r,
2065
- groupCounts: B,
2066
- initialItemFinalLocationReached: p,
2067
- initialTopMostItemIndex: m,
2068
- scrolledToInitialItem: w,
2065
+ groupCounts: k,
2066
+ initialItemFinalLocationReached: h,
2067
+ initialTopMostItemIndex: f,
2068
+ scrolledToInitialItem: C,
2069
2069
  sizeRanges: l,
2070
- topItemCount: R,
2070
+ topItemCount: b,
2071
2071
  topItemsIndexes: T,
2072
2072
  // input
2073
- totalCount: f,
2074
- ...g,
2073
+ totalCount: p,
2074
+ ...m,
2075
2075
  groupIndices: s,
2076
2076
  itemSize: i,
2077
- listState: a,
2078
- scrollToIndex: h,
2077
+ listState: u,
2078
+ scrollToIndex: g,
2079
2079
  // output
2080
- statefulTotalCount: u,
2081
- trackItemSizes: S,
2080
+ statefulTotalCount: a,
2081
+ trackItemSizes: I,
2082
2082
  // exported from stateFlagsSystem
2083
- ...b,
2083
+ ...R,
2084
2084
  // the bag of IO from featureGroup1System
2085
- ...O,
2086
- ...I,
2085
+ ...F,
2086
+ ...w,
2087
2087
  sizes: c,
2088
- ...C
2088
+ ...S
2089
2089
  }),
2090
2090
  X(
2091
2091
  Et,
2092
2092
  ue,
2093
2093
  at,
2094
2094
  Uo,
2095
- _o,
2096
- Gt,
2095
+ Go,
2096
+ _t,
2097
2097
  ce,
2098
2098
  Yo,
2099
2099
  jo,
@@ -2114,147 +2114,155 @@ function Xo(t, e) {
2114
2114
  const pe = typeof document < "u" ? H.useLayoutEffect : H.useEffect;
2115
2115
  function qe(t, e, n) {
2116
2116
  const o = Object.keys(e.required || {}), r = Object.keys(e.optional || {}), s = Object.keys(e.methods || {}), i = Object.keys(e.events || {}), l = H.createContext({});
2117
- function c(g, a) {
2118
- g.propsReady && W(g.propsReady, !1);
2117
+ function c(m, u) {
2118
+ m.propsReady && W(m.propsReady, !1);
2119
2119
  for (const T of o) {
2120
- const b = g[e.required[T]];
2121
- W(b, a[T]);
2120
+ const R = m[e.required[T]];
2121
+ W(R, u[T]);
2122
2122
  }
2123
2123
  for (const T of r)
2124
- if (T in a) {
2125
- const b = g[e.optional[T]];
2126
- W(b, a[T]);
2124
+ if (T in u) {
2125
+ const R = m[e.optional[T]];
2126
+ W(R, u[T]);
2127
2127
  }
2128
- g.propsReady && W(g.propsReady, !0);
2128
+ m.propsReady && W(m.propsReady, !0);
2129
2129
  }
2130
- function u(g) {
2131
- return s.reduce((a, T) => (a[T] = (b) => {
2132
- const h = g[e.methods[T]];
2133
- W(h, b);
2134
- }, a), {});
2130
+ function a(m) {
2131
+ return s.reduce((u, T) => (u[T] = (R) => {
2132
+ const g = m[e.methods[T]];
2133
+ W(g, R);
2134
+ }, u), {});
2135
2135
  }
2136
- function f(g) {
2137
- return i.reduce((a, T) => (a[T] = mo(g[e.events[T]]), a), {});
2136
+ function p(m) {
2137
+ return i.reduce((u, T) => (u[T] = mo(m[e.events[T]]), u), {});
2138
2138
  }
2139
- const S = H.forwardRef((g, a) => {
2140
- const { children: T, ...b } = g, [h] = H.useState(() => ye(ho(t), (B) => {
2141
- c(B, b);
2142
- })), [d] = H.useState(cn(f, h));
2139
+ const I = H.forwardRef((m, u) => {
2140
+ const { children: T, ...R } = m, [g] = H.useState(() => ve(ho(t), (k) => {
2141
+ c(k, R);
2142
+ })), [d] = H.useState(cn(p, g));
2143
2143
  pe(() => {
2144
- for (const B of i)
2145
- B in b && K(d[B], b[B]);
2144
+ for (const k of i)
2145
+ k in R && K(d[k], R[k]);
2146
2146
  return () => {
2147
2147
  Object.values(d).map(We);
2148
2148
  };
2149
- }, [b, d, h]), pe(() => {
2150
- c(h, b);
2151
- }), H.useImperativeHandle(a, ln(u(h)));
2152
- const R = n;
2153
- return /* @__PURE__ */ z(l.Provider, { value: h, children: n ? /* @__PURE__ */ z(R, { ...Xo([...o, ...r, ...i], b), children: T }) : T });
2154
- }), p = (g) => H.useCallback(kn(W, H.useContext(l)[g]), [g]), m = (g) => {
2155
- const T = H.useContext(l)[g], b = H.useCallback(
2156
- (h) => K(T, h),
2149
+ }, [R, d, g]), pe(() => {
2150
+ c(g, R);
2151
+ }), H.useImperativeHandle(u, ln(a(g)));
2152
+ const b = n;
2153
+ return /* @__PURE__ */ z(l.Provider, { value: g, children: n ? /* @__PURE__ */ z(b, { ...Xo([...o, ...r, ...i], R), children: T }) : T });
2154
+ }), h = (m) => {
2155
+ const u = H.useContext(l);
2156
+ return H.useCallback(
2157
+ (T) => {
2158
+ W(u[m], T);
2159
+ },
2160
+ [u, m]
2161
+ );
2162
+ }, f = (m) => {
2163
+ const T = H.useContext(l)[m], R = H.useCallback(
2164
+ (g) => K(T, g),
2157
2165
  [T]
2158
2166
  );
2159
2167
  return H.useSyncExternalStore(
2160
- b,
2161
- () => lt(T),
2162
- () => lt(T)
2168
+ R,
2169
+ () => st(T),
2170
+ () => st(T)
2163
2171
  );
2164
- }, w = (g) => {
2165
- const T = H.useContext(l)[g], [b, h] = H.useState(cn(lt, T));
2172
+ }, C = (m) => {
2173
+ const T = H.useContext(l)[m], [R, g] = H.useState(cn(st, T));
2166
2174
  return pe(
2167
2175
  () => K(T, (d) => {
2168
- d !== b && h(ln(d));
2176
+ d !== R && g(ln(d));
2169
2177
  }),
2170
- [T, b]
2171
- ), b;
2172
- }, I = H.version.startsWith("18") ? m : w;
2178
+ [T, R]
2179
+ ), R;
2180
+ }, w = H.version.startsWith("18") ? f : C;
2173
2181
  return {
2174
- Component: S,
2175
- useEmitter: (g, a) => {
2176
- const b = H.useContext(l)[g];
2177
- pe(() => K(b, a), [a, b]);
2182
+ Component: I,
2183
+ useEmitter: (m, u) => {
2184
+ const R = H.useContext(l)[m];
2185
+ pe(() => K(R, u), [u, R]);
2178
2186
  },
2179
- useEmitterValue: I,
2180
- usePublisher: p
2187
+ useEmitterValue: w,
2188
+ usePublisher: h
2181
2189
  };
2182
2190
  }
2183
- const Re = H.createContext(void 0), Yn = H.createContext(void 0), Zn = typeof document < "u" ? H.useLayoutEffect : H.useEffect;
2184
- function Be(t) {
2191
+ const be = H.createContext(void 0), qn = H.createContext(void 0), Yn = typeof document < "u" ? H.useLayoutEffect : H.useEffect;
2192
+ function ke(t) {
2185
2193
  return "self" in t;
2186
2194
  }
2187
2195
  function Jo(t) {
2188
2196
  return "body" in t;
2189
2197
  }
2190
- function Xn(t, e, n, o = Yt, r, s) {
2191
- const i = H.useRef(null), l = H.useRef(null), c = H.useRef(null), u = H.useCallback(
2192
- (p) => {
2193
- let m, w, I;
2194
- const C = p.target;
2195
- if (Jo(C) || Be(C)) {
2196
- const a = Be(C) ? C : C.defaultView;
2197
- I = s ? a.scrollX : a.scrollY, m = s ? a.document.documentElement.scrollWidth : a.document.documentElement.scrollHeight, w = s ? a.innerWidth : a.innerHeight;
2198
+ function Zn(t, e, n, o = Yt, r, s) {
2199
+ const i = H.useRef(null), l = H.useRef(null), c = H.useRef(null), a = H.useCallback(
2200
+ (h) => {
2201
+ let f, C, w;
2202
+ const S = h.target;
2203
+ if (Jo(S) || ke(S)) {
2204
+ const u = ke(S) ? S : S.defaultView;
2205
+ w = s ? u.scrollX : u.scrollY, f = s ? u.document.documentElement.scrollWidth : u.document.documentElement.scrollHeight, C = s ? u.innerWidth : u.innerHeight;
2198
2206
  } else
2199
- I = s ? C.scrollLeft : C.scrollTop, m = s ? C.scrollWidth : C.scrollHeight, w = s ? C.offsetWidth : C.offsetHeight;
2200
- const g = () => {
2207
+ w = s ? S.scrollLeft : S.scrollTop, f = s ? S.scrollWidth : S.scrollHeight, C = s ? S.offsetWidth : S.offsetHeight;
2208
+ const m = () => {
2201
2209
  t({
2202
- scrollHeight: m,
2203
- scrollTop: Math.max(I, 0),
2204
- viewportHeight: w
2210
+ scrollHeight: f,
2211
+ scrollTop: Math.max(w, 0),
2212
+ viewportHeight: C
2205
2213
  });
2206
2214
  };
2207
- p.suppressFlushSync ? g() : lo.flushSync(g), l.current !== null && (I === l.current || I <= 0 || I === m - w) && (l.current = null, e(!0), c.current && (clearTimeout(c.current), c.current = null));
2215
+ h.suppressFlushSync ? m() : io.flushSync(m), l.current !== null && (w === l.current || w <= 0 || w === f - C) && (l.current = null, e(!0), c.current && (clearTimeout(c.current), c.current = null));
2208
2216
  },
2209
- [t, e]
2217
+ [t, e, s]
2210
2218
  );
2211
2219
  H.useEffect(() => {
2212
- const p = r || i.current;
2213
- return o(r || i.current), u({ suppressFlushSync: !0, target: p }), p.addEventListener("scroll", u, { passive: !0 }), () => {
2214
- o(null), p.removeEventListener("scroll", u);
2220
+ const h = r || i.current;
2221
+ return o(r || i.current), a({ suppressFlushSync: !0, target: h }), h.addEventListener("scroll", a, { passive: !0 }), () => {
2222
+ o(null), h.removeEventListener("scroll", a);
2215
2223
  };
2216
- }, [i, u, n, o, r]);
2217
- function f(p) {
2218
- const m = i.current;
2219
- if (!m || (s ? "offsetWidth" in m && m.offsetWidth === 0 : "offsetHeight" in m && m.offsetHeight === 0))
2224
+ }, [i, a, n, o, r]);
2225
+ function p(h) {
2226
+ const f = i.current;
2227
+ if (!f || (s ? "offsetWidth" in f && f.offsetWidth === 0 : "offsetHeight" in f && f.offsetHeight === 0))
2220
2228
  return;
2221
- const w = p.behavior === "smooth";
2222
- let I, C, g;
2223
- Be(m) ? (C = Math.max(
2224
- wt(m.document.documentElement, s ? "width" : "height"),
2225
- s ? m.document.documentElement.scrollWidth : m.document.documentElement.scrollHeight
2226
- ), I = s ? m.innerWidth : m.innerHeight, g = s ? window.scrollX : window.scrollY) : (C = m[s ? "scrollWidth" : "scrollHeight"], I = wt(m, s ? "width" : "height"), g = m[s ? "scrollLeft" : "scrollTop"]);
2227
- const a = C - I;
2228
- if (p.top = Math.ceil(Math.max(Math.min(a, p.top), 0)), Dn(I, C) || p.top === g) {
2229
- t({ scrollHeight: C, scrollTop: g, viewportHeight: I }), w && e(!0);
2229
+ const C = h.behavior === "smooth";
2230
+ let w, S, m;
2231
+ ke(f) ? (S = Math.max(
2232
+ wt(f.document.documentElement, s ? "width" : "height"),
2233
+ s ? f.document.documentElement.scrollWidth : f.document.documentElement.scrollHeight
2234
+ ), w = s ? f.innerWidth : f.innerHeight, m = s ? window.scrollX : window.scrollY) : (S = f[s ? "scrollWidth" : "scrollHeight"], w = wt(f, s ? "width" : "height"), m = f[s ? "scrollLeft" : "scrollTop"]);
2235
+ const u = S - w;
2236
+ if (h.top = Math.ceil(Math.max(Math.min(u, h.top), 0)), Nn(w, S) || h.top === m) {
2237
+ t({ scrollHeight: S, scrollTop: m, viewportHeight: w }), C && e(!0);
2230
2238
  return;
2231
2239
  }
2232
- w ? (l.current = p.top, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
2240
+ C ? (l.current = h.top, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
2233
2241
  c.current = null, l.current = null, e(!0);
2234
- }, 1e3)) : l.current = null, s && (p = { behavior: p.behavior, left: p.top }), m.scrollTo(p);
2242
+ }, 1e3)) : l.current = null, s && (h = { behavior: h.behavior, left: h.top }), f.scrollTo(h);
2235
2243
  }
2236
- function S(p) {
2237
- s && (p = { behavior: p.behavior, left: p.top }), i.current.scrollBy(p);
2244
+ function I(h) {
2245
+ s && (h = { behavior: h.behavior, left: h.top }), i.current.scrollBy(h);
2238
2246
  }
2239
- return { scrollByCallback: S, scrollerRef: i, scrollToCallback: f };
2247
+ return { scrollByCallback: I, scrollerRef: i, scrollToCallback: p };
2240
2248
  }
2241
- const Oe = "-webkit-sticky", xn = "sticky", Jn = jn(() => {
2249
+ const Fe = "-webkit-sticky", xn = "sticky", Xn = Kn(() => {
2242
2250
  if (typeof document > "u")
2243
2251
  return xn;
2244
2252
  const t = document.createElement("div");
2245
- return t.style.position = Oe, t.style.position === Oe ? Oe : xn;
2253
+ return t.style.position = Fe, t.style.position === Fe ? Fe : xn;
2246
2254
  });
2247
2255
  function Ye(t) {
2248
2256
  return t;
2249
2257
  }
2250
2258
  const Qo = /* @__PURE__ */ U(() => {
2251
- const t = y((c) => `Item ${c}`), e = y(null), n = y((c) => `Group ${c}`), o = y({}), r = y(Ye), s = y("div"), i = y(Yt), l = (c, u = null) => ct(
2259
+ const t = v((c) => `Item ${c}`), e = v(null), n = v((c) => `Group ${c}`), o = v({}), r = v(Ye), s = v("div"), i = v(Yt), l = (c, a = null) => ct(
2252
2260
  x(
2253
2261
  o,
2254
- E((f) => f[c]),
2262
+ E((p) => p[c]),
2255
2263
  Y()
2256
2264
  ),
2257
- u
2265
+ a
2258
2266
  );
2259
2267
  return {
2260
2268
  components: o,
@@ -2276,81 +2284,81 @@ const Qo = /* @__PURE__ */ U(() => {
2276
2284
  };
2277
2285
  }), tr = /* @__PURE__ */ U(
2278
2286
  ([t, e]) => ({ ...t, ...e }),
2279
- X(qn, Qo)
2280
- ), er = ({ height: t }) => /* @__PURE__ */ z("div", { style: { height: t } }), nr = { overflowAnchor: "none", position: Jn(), zIndex: 1 }, Qn = { overflowAnchor: "none" }, or = { ...Qn, display: "inline-block", height: "100%" }, Tn = /* @__PURE__ */ H.memo(function({ showTopList: e = !1 }) {
2281
- const n = M("listState"), o = gt("sizeRanges"), r = M("useWindowScroll"), s = M("customScrollParent"), i = gt("windowScrollContainerState"), l = gt("scrollContainerState"), c = s || r ? i : l, u = M("itemContent"), f = M("context"), S = M("groupContent"), p = M("trackItemSizes"), m = M("itemSize"), w = M("log"), I = gt("gap"), C = M("horizontalDirection"), { callbackRef: g } = On(
2287
+ X(jn, Qo)
2288
+ ), er = ({ height: t }) => /* @__PURE__ */ z("div", { style: { height: t } }), nr = { overflowAnchor: "none", position: Xn(), zIndex: 1 }, Jn = { overflowAnchor: "none" }, or = { ...Jn, display: "inline-block", height: "100%" }, Tn = /* @__PURE__ */ H.memo(function({ showTopList: e = !1 }) {
2289
+ const n = M("listState"), o = gt("sizeRanges"), r = M("useWindowScroll"), s = M("customScrollParent"), i = gt("windowScrollContainerState"), l = gt("scrollContainerState"), c = s || r ? i : l, a = M("itemContent"), p = M("context"), I = M("groupContent"), h = M("trackItemSizes"), f = M("itemSize"), C = M("log"), w = gt("gap"), S = M("horizontalDirection"), { callbackRef: m } = kn(
2282
2290
  o,
2283
- m,
2284
- p,
2291
+ f,
2292
+ h,
2285
2293
  e ? Yt : c,
2294
+ C,
2286
2295
  w,
2287
- I,
2288
2296
  s,
2289
- C,
2297
+ S,
2290
2298
  M("skipAnimationFrameInResizeObserver")
2291
- ), [a, T] = H.useState(0);
2292
- Je("deviation", (k) => {
2293
- a !== k && T(k);
2299
+ ), [u, T] = H.useState(0);
2300
+ Je("deviation", (B) => {
2301
+ u !== B && T(B);
2294
2302
  });
2295
- const b = M("EmptyPlaceholder"), h = M("ScrollSeekPlaceholder") || er, d = M("ListComponent"), R = M("ItemComponent"), B = M("GroupComponent"), O = M("computeItemKey"), L = M("isSeeking"), V = M("groupIndices").length > 0, D = M("alignToBottom"), J = M("initialItemFinalLocationReached"), nt = e ? {} : {
2303
+ const R = M("EmptyPlaceholder"), g = M("ScrollSeekPlaceholder") || er, d = M("ListComponent"), b = M("ItemComponent"), k = M("GroupComponent"), F = M("computeItemKey"), L = M("isSeeking"), V = M("groupIndices").length > 0, D = M("alignToBottom"), J = M("initialItemFinalLocationReached"), nt = e ? {} : {
2296
2304
  boxSizing: "border-box",
2297
- ...C ? {
2305
+ ...S ? {
2298
2306
  display: "inline-block",
2299
2307
  height: "100%",
2300
- marginLeft: a !== 0 ? a : D ? "auto" : 0,
2308
+ marginLeft: u !== 0 ? u : D ? "auto" : 0,
2301
2309
  paddingLeft: n.offsetTop,
2302
2310
  paddingRight: n.offsetBottom,
2303
2311
  whiteSpace: "nowrap"
2304
2312
  } : {
2305
- marginTop: a !== 0 ? a : D ? "auto" : 0,
2313
+ marginTop: u !== 0 ? u : D ? "auto" : 0,
2306
2314
  paddingBottom: n.offsetBottom,
2307
2315
  paddingTop: n.offsetTop
2308
2316
  },
2309
2317
  ...J ? {} : { visibility: "hidden" }
2310
2318
  };
2311
- return !e && n.totalCount === 0 && b ? /* @__PURE__ */ z(b, { ...Z(b, f) }) : /* @__PURE__ */ z(
2319
+ return !e && n.totalCount === 0 && R ? /* @__PURE__ */ z(R, { ...Z(R, p) }) : /* @__PURE__ */ z(
2312
2320
  d,
2313
2321
  {
2314
- ...Z(d, f),
2322
+ ...Z(d, p),
2315
2323
  "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
2316
- ref: g,
2324
+ ref: m,
2317
2325
  style: nt,
2318
- children: (e ? n.topItems : n.items).map((k) => {
2319
- const q = k.originalIndex, st = O(q + n.firstItemIndex, k.data, f);
2326
+ children: (e ? n.topItems : n.items).map((B) => {
2327
+ const q = B.originalIndex, it = F(q + n.firstItemIndex, B.data, p);
2320
2328
  return L ? /* @__PURE__ */ $t(
2321
- h,
2329
+ g,
2322
2330
  {
2323
- ...Z(h, f),
2324
- height: k.size,
2325
- index: k.index,
2326
- key: st,
2327
- type: k.type || "item",
2328
- ...k.type === "group" ? {} : { groupIndex: k.groupIndex }
2331
+ ...Z(g, p),
2332
+ height: B.size,
2333
+ index: B.index,
2334
+ key: it,
2335
+ type: B.type || "item",
2336
+ ...B.type === "group" ? {} : { groupIndex: B.groupIndex }
2329
2337
  }
2330
- ) : k.type === "group" ? /* @__PURE__ */ $t(
2331
- B,
2338
+ ) : B.type === "group" ? /* @__PURE__ */ $t(
2339
+ k,
2332
2340
  {
2333
- ...Z(B, f),
2341
+ ...Z(k, p),
2334
2342
  "data-index": q,
2335
- "data-item-index": k.index,
2336
- "data-known-size": k.size,
2337
- key: st,
2343
+ "data-item-index": B.index,
2344
+ "data-known-size": B.size,
2345
+ key: it,
2338
2346
  style: nr
2339
2347
  },
2340
- S(k.index, f)
2348
+ I(B.index, p)
2341
2349
  ) : /* @__PURE__ */ $t(
2342
- R,
2350
+ b,
2343
2351
  {
2344
- ...Z(R, f),
2345
- ...to(R, k.data),
2352
+ ...Z(b, p),
2353
+ ...Qn(b, B.data),
2346
2354
  "data-index": q,
2347
- "data-item-group-index": k.groupIndex,
2348
- "data-item-index": k.index,
2349
- "data-known-size": k.size,
2350
- key: st,
2351
- style: C ? or : Qn
2355
+ "data-item-group-index": B.groupIndex,
2356
+ "data-item-index": B.index,
2357
+ "data-known-size": B.size,
2358
+ key: it,
2359
+ style: S ? or : Jn
2352
2360
  },
2353
- V ? u(k.index, k.groupIndex, k.data, f) : u(k.index, k.data, f)
2361
+ V ? a(B.index, B.groupIndex, B.data, p) : a(B.index, B.data, p)
2354
2362
  );
2355
2363
  })
2356
2364
  }
@@ -2372,7 +2380,7 @@ const Qo = /* @__PURE__ */ U(() => {
2372
2380
  width: "100%",
2373
2381
  ...t ? { display: "flex", flexDirection: "column" } : {}
2374
2382
  }), ir = {
2375
- position: Jn(),
2383
+ position: Xn(),
2376
2384
  top: 0,
2377
2385
  width: "100%",
2378
2386
  zIndex: 1
@@ -2381,7 +2389,7 @@ function Z(t, e) {
2381
2389
  if (typeof t != "string")
2382
2390
  return { context: e };
2383
2391
  }
2384
- function to(t, e) {
2392
+ function Qn(t, e) {
2385
2393
  return { item: typeof t == "string" ? void 0 : e };
2386
2394
  }
2387
2395
  const lr = /* @__PURE__ */ H.memo(function() {
@@ -2411,24 +2419,24 @@ const lr = /* @__PURE__ */ H.memo(function() {
2411
2419
  });
2412
2420
  function Ze({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2413
2421
  return H.memo(function({ children: s, style: i, ...l }) {
2414
- const c = n("scrollContainerState"), u = e("ScrollerComponent"), f = n("smoothScrollTargetReached"), S = e("scrollerRef"), p = e("context"), m = e("horizontalDirection") || !1, { scrollByCallback: w, scrollerRef: I, scrollToCallback: C } = Xn(
2422
+ const c = n("scrollContainerState"), a = e("ScrollerComponent"), p = n("smoothScrollTargetReached"), I = e("scrollerRef"), h = e("context"), f = e("horizontalDirection") || !1, { scrollByCallback: C, scrollerRef: w, scrollToCallback: S } = Zn(
2415
2423
  c,
2416
- f,
2417
- u,
2418
- S,
2424
+ p,
2425
+ a,
2426
+ I,
2419
2427
  void 0,
2420
- m
2428
+ f
2421
2429
  );
2422
- return t("scrollTo", C), t("scrollBy", w), /* @__PURE__ */ z(
2423
- u,
2430
+ return t("scrollTo", S), t("scrollBy", C), /* @__PURE__ */ z(
2431
+ a,
2424
2432
  {
2425
2433
  "data-testid": "virtuoso-scroller",
2426
2434
  "data-virtuoso-scroller": !0,
2427
- ref: I,
2428
- style: { ...m ? sr : rr, ...i },
2435
+ ref: w,
2436
+ style: { ...f ? sr : rr, ...i },
2429
2437
  tabIndex: 0,
2430
2438
  ...l,
2431
- ...Z(u, p),
2439
+ ...Z(a, h),
2432
2440
  children: s
2433
2441
  }
2434
2442
  );
@@ -2436,33 +2444,33 @@ function Ze({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2436
2444
  }
2437
2445
  function Xe({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2438
2446
  return H.memo(function({ children: s, style: i, ...l }) {
2439
- const c = n("windowScrollContainerState"), u = e("ScrollerComponent"), f = n("smoothScrollTargetReached"), S = e("totalListHeight"), p = e("deviation"), m = e("customScrollParent"), w = e("context"), I = H.useRef(null), C = e("scrollerRef"), { scrollByCallback: g, scrollerRef: a, scrollToCallback: T } = Xn(
2447
+ const c = n("windowScrollContainerState"), a = e("ScrollerComponent"), p = n("smoothScrollTargetReached"), I = e("totalListHeight"), h = e("deviation"), f = e("customScrollParent"), C = e("context"), w = H.useRef(null), S = e("scrollerRef"), { scrollByCallback: m, scrollerRef: u, scrollToCallback: T } = Zn(
2440
2448
  c,
2441
- f,
2442
- u,
2443
- C,
2444
- m
2449
+ p,
2450
+ a,
2451
+ S,
2452
+ f
2445
2453
  );
2446
- return Zn(() => {
2447
- var b;
2448
- return a.current = m || ((b = I.current) == null ? void 0 : b.ownerDocument.defaultView), () => {
2449
- a.current = null;
2454
+ return Yn(() => {
2455
+ var R;
2456
+ return u.current = f || ((R = w.current) == null ? void 0 : R.ownerDocument.defaultView), () => {
2457
+ u.current = null;
2450
2458
  };
2451
- }, [a, m]), t("windowScrollTo", T), t("scrollBy", g), /* @__PURE__ */ z(
2452
- u,
2459
+ }, [u, f]), t("windowScrollTo", T), t("scrollBy", m), /* @__PURE__ */ z(
2460
+ a,
2453
2461
  {
2454
- ref: I,
2462
+ ref: w,
2455
2463
  "data-virtuoso-scroller": !0,
2456
- style: { position: "relative", ...i, ...S !== 0 ? { height: S + p } : {} },
2464
+ style: { position: "relative", ...i, ...I !== 0 ? { height: I + h } : {} },
2457
2465
  ...l,
2458
- ...Z(u, w),
2466
+ ...Z(a, C),
2459
2467
  children: s
2460
2468
  }
2461
2469
  );
2462
2470
  });
2463
2471
  }
2464
2472
  const ur = ({ children: t }) => {
2465
- const e = H.useContext(Re), n = gt("viewportHeight"), o = gt("fixedItemHeight"), r = M("alignToBottom"), s = M("horizontalDirection"), i = H.useMemo(
2473
+ const e = H.useContext(be), n = gt("viewportHeight"), o = gt("fixedItemHeight"), r = M("alignToBottom"), s = M("horizontalDirection"), i = H.useMemo(
2466
2474
  () => ne(n, (c) => wt(c, s ? "width" : "height")),
2467
2475
  [n, s]
2468
2476
  ), l = Ht(i, !0, M("skipAnimationFrameInResizeObserver"));
@@ -2470,7 +2478,7 @@ const ur = ({ children: t }) => {
2470
2478
  e && (n(e.viewportHeight), o(e.itemHeight));
2471
2479
  }, [e, n, o]), /* @__PURE__ */ z("div", { "data-viewport-type": "element", ref: l, style: Zt(r), children: t });
2472
2480
  }, ar = ({ children: t }) => {
2473
- const e = H.useContext(Re), n = gt("windowViewportRect"), o = gt("fixedItemHeight"), r = M("customScrollParent"), s = Ge(
2481
+ const e = H.useContext(be), n = gt("windowViewportRect"), o = gt("fixedItemHeight"), r = M("customScrollParent"), s = _e(
2474
2482
  n,
2475
2483
  r,
2476
2484
  M("skipAnimationFrameInResizeObserver")
@@ -2492,79 +2500,79 @@ const ur = ({ children: t }) => {
2492
2500
  ] })
2493
2501
  ] });
2494
2502
  }), {
2495
- Component: eo,
2503
+ Component: to,
2496
2504
  useEmitter: Je,
2497
2505
  useEmitterValue: M,
2498
2506
  usePublisher: gt
2499
2507
  } = /* @__PURE__ */ qe(
2500
2508
  tr,
2501
2509
  {
2502
- events: {
2503
- atBottomStateChange: "atBottomStateChange",
2504
- atTopStateChange: "atTopStateChange",
2505
- endReached: "endReached",
2506
- groupIndices: "groupIndices",
2507
- isScrolling: "isScrolling",
2508
- itemsRendered: "itemsRendered",
2509
- rangeChanged: "rangeChanged",
2510
- startReached: "startReached",
2511
- totalListHeightChanged: "totalListHeightChanged"
2512
- },
2513
- methods: {
2514
- autoscrollToBottom: "autoscrollToBottom",
2515
- getState: "getState",
2516
- scrollBy: "scrollBy",
2517
- scrollIntoView: "scrollIntoView",
2518
- scrollTo: "scrollTo",
2519
- scrollToIndex: "scrollToIndex"
2520
- },
2510
+ required: {},
2521
2511
  optional: {
2522
- alignToBottom: "alignToBottom",
2512
+ restoreStateFrom: "restoreStateFrom",
2513
+ context: "context",
2514
+ followOutput: "followOutput",
2515
+ itemContent: "itemContent",
2516
+ groupContent: "groupContent",
2517
+ overscan: "overscan",
2518
+ increaseViewportBy: "increaseViewportBy",
2519
+ totalCount: "totalCount",
2520
+ groupCounts: "groupCounts",
2521
+ topItemCount: "topItemCount",
2522
+ firstItemIndex: "firstItemIndex",
2523
+ initialTopMostItemIndex: "initialTopMostItemIndex",
2524
+ components: "components",
2523
2525
  atBottomThreshold: "atBottomThreshold",
2524
2526
  atTopThreshold: "atTopThreshold",
2525
- components: "components",
2526
2527
  computeItemKey: "computeItemKey",
2527
- context: "context",
2528
- customScrollParent: "customScrollParent",
2529
- data: "data",
2530
2528
  defaultItemHeight: "defaultItemHeight",
2531
- firstItemIndex: "firstItemIndex",
2532
2529
  fixedItemHeight: "fixedItemHeight",
2533
- followOutput: "followOutput",
2534
- groupContent: "groupContent",
2535
- groupCounts: "groupCounts",
2530
+ itemSize: "itemSize",
2531
+ scrollSeekConfiguration: "scrollSeekConfiguration",
2536
2532
  headerFooterTag: "HeaderFooterTag",
2537
- horizontalDirection: "horizontalDirection",
2538
- increaseViewportBy: "increaseViewportBy",
2533
+ data: "data",
2539
2534
  initialItemCount: "initialItemCount",
2540
2535
  initialScrollTop: "initialScrollTop",
2541
- initialTopMostItemIndex: "initialTopMostItemIndex",
2542
- itemContent: "itemContent",
2543
- itemSize: "itemSize",
2544
- logLevel: "logLevel",
2545
- overscan: "overscan",
2546
- restoreStateFrom: "restoreStateFrom",
2536
+ alignToBottom: "alignToBottom",
2537
+ useWindowScroll: "useWindowScroll",
2538
+ customScrollParent: "customScrollParent",
2547
2539
  scrollerRef: "scrollerRef",
2548
- scrollSeekConfiguration: "scrollSeekConfiguration",
2549
- skipAnimationFrameInResizeObserver: "skipAnimationFrameInResizeObserver",
2550
- topItemCount: "topItemCount",
2551
- totalCount: "totalCount",
2552
- useWindowScroll: "useWindowScroll"
2540
+ logLevel: "logLevel",
2541
+ horizontalDirection: "horizontalDirection",
2542
+ skipAnimationFrameInResizeObserver: "skipAnimationFrameInResizeObserver"
2543
+ },
2544
+ methods: {
2545
+ scrollToIndex: "scrollToIndex",
2546
+ scrollIntoView: "scrollIntoView",
2547
+ scrollTo: "scrollTo",
2548
+ scrollBy: "scrollBy",
2549
+ autoscrollToBottom: "autoscrollToBottom",
2550
+ getState: "getState"
2553
2551
  },
2554
- required: {}
2552
+ events: {
2553
+ isScrolling: "isScrolling",
2554
+ endReached: "endReached",
2555
+ startReached: "startReached",
2556
+ rangeChanged: "rangeChanged",
2557
+ atBottomStateChange: "atBottomStateChange",
2558
+ atTopStateChange: "atTopStateChange",
2559
+ totalListHeightChanged: "totalListHeightChanged",
2560
+ itemsRendered: "itemsRendered",
2561
+ groupIndices: "groupIndices"
2562
+ }
2555
2563
  },
2556
2564
  fr
2557
- ), mr = /* @__PURE__ */ Ze({ useEmitter: Je, useEmitterValue: M, usePublisher: gt }), pr = /* @__PURE__ */ Xe({ useEmitter: Je, useEmitterValue: M, usePublisher: gt }), Kr = eo, jr = eo, hr = /* @__PURE__ */ U(() => {
2558
- const t = y((c) => /* @__PURE__ */ Kt("td", { children: [
2565
+ ), mr = /* @__PURE__ */ Ze({ useEmitter: Je, useEmitterValue: M, usePublisher: gt }), pr = /* @__PURE__ */ Xe({ useEmitter: Je, useEmitterValue: M, usePublisher: gt }), Kr = to, jr = to, hr = /* @__PURE__ */ U(() => {
2566
+ const t = v((c) => /* @__PURE__ */ Kt("td", { children: [
2559
2567
  "Item $",
2560
2568
  c
2561
- ] })), e = y(null), n = y(null), o = y(null), r = y({}), s = y(Ye), i = y(Yt), l = (c, u = null) => ct(
2569
+ ] })), e = v(null), n = v(null), o = v(null), r = v({}), s = v(Ye), i = v(Yt), l = (c, a = null) => ct(
2562
2570
  x(
2563
2571
  r,
2564
- E((f) => f[c]),
2572
+ E((p) => p[c]),
2565
2573
  Y()
2566
2574
  ),
2567
- u
2575
+ a
2568
2576
  );
2569
2577
  return {
2570
2578
  components: r,
@@ -2586,171 +2594,171 @@ const ur = ({ children: t }) => {
2586
2594
  };
2587
2595
  }), gr = /* @__PURE__ */ U(
2588
2596
  ([t, e]) => ({ ...t, ...e }),
2589
- X(qn, hr)
2597
+ X(jn, hr)
2590
2598
  ), Ir = ({ height: t }) => /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", { style: { height: t } }) }), Sr = ({ height: t }) => /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", { style: { border: 0, height: t, padding: 0 } }) }), xr = { overflowAnchor: "none" }, Cn = /* @__PURE__ */ H.memo(function({ showTopList: e = !1 }) {
2591
- const n = _("listState"), o = _("computeItemKey"), r = _("firstItemIndex"), s = _("isSeeking"), i = _("ScrollSeekPlaceholder") || Ir, l = _("context"), c = _("TableRowComponent"), u = _("fixedHeaderHeight"), f = _("itemContent"), S = (e ? n.topItems : []).reduce((m, w, I) => (I === 0 ? m.push(w.size) : m.push(m[I - 1] + w.size), m), []), p = (e ? n.topItems : n.items).map((m) => {
2592
- const w = m.originalIndex, I = o(w + r, m.data, l), C = e ? w === 0 ? 0 : S[w - 1] : 0;
2599
+ const n = G("listState"), o = G("computeItemKey"), r = G("firstItemIndex"), s = G("isSeeking"), i = G("ScrollSeekPlaceholder") || Ir, l = G("context"), c = G("TableRowComponent"), a = G("fixedHeaderHeight"), p = G("itemContent"), I = (e ? n.topItems : []).reduce((f, C, w) => (w === 0 ? f.push(C.size) : f.push(f[w - 1] + C.size), f), []), h = (e ? n.topItems : n.items).map((f) => {
2600
+ const C = f.originalIndex, w = o(C + r, f.data, l), S = e ? C === 0 ? 0 : I[C - 1] : 0;
2593
2601
  return s ? /* @__PURE__ */ $t(
2594
2602
  i,
2595
2603
  {
2596
2604
  ...Z(i, l),
2597
- height: m.size,
2598
- index: m.index,
2599
- key: I,
2600
- type: m.type || "item"
2605
+ height: f.size,
2606
+ index: f.index,
2607
+ key: w,
2608
+ type: f.type || "item"
2601
2609
  }
2602
2610
  ) : /* @__PURE__ */ $t(
2603
2611
  c,
2604
2612
  {
2605
2613
  ...Z(c, l),
2606
- ...to(c, m.data),
2607
- "data-index": w,
2608
- "data-item-index": m.index,
2609
- "data-known-size": m.size,
2610
- key: I,
2611
- style: e ? { overflowAnchor: "none", position: "sticky", top: u + C, zIndex: 2 } : xr
2614
+ ...Qn(c, f.data),
2615
+ "data-index": C,
2616
+ "data-item-index": f.index,
2617
+ "data-known-size": f.size,
2618
+ key: w,
2619
+ style: e ? { overflowAnchor: "none", position: "sticky", top: a + S, zIndex: 2 } : xr
2612
2620
  },
2613
- f(m.index, m.data, l)
2621
+ p(f.index, f.data, l)
2614
2622
  );
2615
2623
  });
2616
- return /* @__PURE__ */ z(io, { children: p });
2624
+ return /* @__PURE__ */ z(so, { children: h });
2617
2625
  }), Tr = /* @__PURE__ */ H.memo(function() {
2618
- const e = _("listState"), n = _("topItemsIndexes").length > 0, o = Tt("sizeRanges"), r = _("useWindowScroll"), s = _("customScrollParent"), i = Tt("windowScrollContainerState"), l = Tt("scrollContainerState"), c = s || r ? i : l, u = _("trackItemSizes"), f = _("itemSize"), S = _("log"), { callbackRef: p, ref: m } = On(
2626
+ const e = G("listState"), n = G("topItemsIndexes").length > 0, o = Tt("sizeRanges"), r = G("useWindowScroll"), s = G("customScrollParent"), i = Tt("windowScrollContainerState"), l = Tt("scrollContainerState"), c = s || r ? i : l, a = G("trackItemSizes"), p = G("itemSize"), I = G("log"), { callbackRef: h, ref: f } = kn(
2619
2627
  o,
2620
- f,
2621
- u,
2628
+ p,
2629
+ a,
2622
2630
  c,
2623
- S,
2631
+ I,
2624
2632
  void 0,
2625
2633
  s,
2626
2634
  !1,
2627
- _("skipAnimationFrameInResizeObserver")
2628
- ), [w, I] = H.useState(0);
2635
+ G("skipAnimationFrameInResizeObserver")
2636
+ ), [C, w] = H.useState(0);
2629
2637
  Qe("deviation", (V) => {
2630
- w !== V && (m.current.style.marginTop = `${V}px`, I(V));
2638
+ C !== V && (f.current.style.marginTop = `${V}px`, w(V));
2631
2639
  });
2632
- const C = _("EmptyPlaceholder"), g = _("FillerRow") || Sr, a = _("TableBodyComponent"), T = _("paddingTopAddition"), b = _("statefulTotalCount"), h = _("context");
2633
- if (b === 0 && C)
2634
- return /* @__PURE__ */ z(C, { ...Z(C, h) });
2635
- const d = (n ? e.topItems : []).reduce((V, D) => V + D.size, 0), R = e.offsetTop + T + w - d, B = e.offsetBottom, O = R > 0 ? /* @__PURE__ */ z(g, { context: h, height: R }, "padding-top") : null, L = B > 0 ? /* @__PURE__ */ z(g, { context: h, height: B }, "padding-bottom") : null;
2636
- return /* @__PURE__ */ Kt(a, { "data-testid": "virtuoso-item-list", ref: p, ...Z(a, h), children: [
2637
- O,
2640
+ const S = G("EmptyPlaceholder"), m = G("FillerRow") || Sr, u = G("TableBodyComponent"), T = G("paddingTopAddition"), R = G("statefulTotalCount"), g = G("context");
2641
+ if (R === 0 && S)
2642
+ return /* @__PURE__ */ z(S, { ...Z(S, g) });
2643
+ const d = (n ? e.topItems : []).reduce((V, D) => V + D.size, 0), b = e.offsetTop + T + C - d, k = e.offsetBottom, F = b > 0 ? /* @__PURE__ */ z(m, { context: g, height: b }, "padding-top") : null, L = k > 0 ? /* @__PURE__ */ z(m, { context: g, height: k }, "padding-bottom") : null;
2644
+ return /* @__PURE__ */ Kt(u, { "data-testid": "virtuoso-item-list", ref: h, ...Z(u, g), children: [
2645
+ F,
2638
2646
  n && /* @__PURE__ */ z(Cn, { showTopList: !0 }),
2639
2647
  /* @__PURE__ */ z(Cn, {}),
2640
2648
  L
2641
2649
  ] });
2642
2650
  }), Cr = ({ children: t }) => {
2643
- const e = H.useContext(Re), n = Tt("viewportHeight"), o = Tt("fixedItemHeight"), r = Ht(
2651
+ const e = H.useContext(be), n = Tt("viewportHeight"), o = Tt("fixedItemHeight"), r = Ht(
2644
2652
  H.useMemo(() => ne(n, (s) => wt(s, "height")), [n]),
2645
2653
  !0,
2646
- _("skipAnimationFrameInResizeObserver")
2654
+ G("skipAnimationFrameInResizeObserver")
2647
2655
  );
2648
2656
  return H.useEffect(() => {
2649
2657
  e && (n(e.viewportHeight), o(e.itemHeight));
2650
2658
  }, [e, n, o]), /* @__PURE__ */ z("div", { "data-viewport-type": "element", ref: r, style: Zt(!1), children: t });
2651
2659
  }, wr = ({ children: t }) => {
2652
- const e = H.useContext(Re), n = Tt("windowViewportRect"), o = Tt("fixedItemHeight"), r = _("customScrollParent"), s = Ge(
2660
+ const e = H.useContext(be), n = Tt("windowViewportRect"), o = Tt("fixedItemHeight"), r = G("customScrollParent"), s = _e(
2653
2661
  n,
2654
2662
  r,
2655
- _("skipAnimationFrameInResizeObserver")
2663
+ G("skipAnimationFrameInResizeObserver")
2656
2664
  );
2657
2665
  return H.useEffect(() => {
2658
2666
  e && (o(e.itemHeight), n({ offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
2659
2667
  }, [e, n, o]), /* @__PURE__ */ z("div", { "data-viewport-type": "window", ref: s, style: Zt(!1), children: t });
2660
- }, yr = /* @__PURE__ */ H.memo(function(e) {
2661
- const n = _("useWindowScroll"), o = _("customScrollParent"), r = Tt("fixedHeaderHeight"), s = Tt("fixedFooterHeight"), i = _("fixedHeaderContent"), l = _("fixedFooterContent"), c = _("context"), u = Ht(
2662
- H.useMemo(() => ne(r, (a) => wt(a, "height")), [r]),
2668
+ }, vr = /* @__PURE__ */ H.memo(function(e) {
2669
+ const n = G("useWindowScroll"), o = G("customScrollParent"), r = Tt("fixedHeaderHeight"), s = Tt("fixedFooterHeight"), i = G("fixedHeaderContent"), l = G("fixedFooterContent"), c = G("context"), a = Ht(
2670
+ H.useMemo(() => ne(r, (u) => wt(u, "height")), [r]),
2663
2671
  !0,
2664
- _("skipAnimationFrameInResizeObserver")
2665
- ), f = Ht(
2666
- H.useMemo(() => ne(s, (a) => wt(a, "height")), [s]),
2672
+ G("skipAnimationFrameInResizeObserver")
2673
+ ), p = Ht(
2674
+ H.useMemo(() => ne(s, (u) => wt(u, "height")), [s]),
2667
2675
  !0,
2668
- _("skipAnimationFrameInResizeObserver")
2669
- ), S = o || n ? Rr : br, p = o || n ? wr : Cr, m = _("TableComponent"), w = _("TableHeadComponent"), I = _("TableFooterComponent"), C = i ? /* @__PURE__ */ z(
2670
- w,
2676
+ G("skipAnimationFrameInResizeObserver")
2677
+ ), I = o || n ? br : Rr, h = o || n ? wr : Cr, f = G("TableComponent"), C = G("TableHeadComponent"), w = G("TableFooterComponent"), S = i ? /* @__PURE__ */ z(
2678
+ C,
2671
2679
  {
2672
- ref: u,
2680
+ ref: a,
2673
2681
  style: { position: "sticky", top: 0, zIndex: 2 },
2674
- ...Z(w, c),
2682
+ ...Z(C, c),
2675
2683
  children: i()
2676
2684
  },
2677
2685
  "TableHead"
2678
- ) : null, g = l ? /* @__PURE__ */ z(
2679
- I,
2686
+ ) : null, m = l ? /* @__PURE__ */ z(
2687
+ w,
2680
2688
  {
2681
- ref: f,
2689
+ ref: p,
2682
2690
  style: { bottom: 0, position: "sticky", zIndex: 1 },
2683
- ...Z(I, c),
2691
+ ...Z(w, c),
2684
2692
  children: l()
2685
2693
  },
2686
2694
  "TableFoot"
2687
2695
  ) : null;
2688
- return /* @__PURE__ */ z(S, { ...e, ...Z(S, c), children: /* @__PURE__ */ z(p, { children: /* @__PURE__ */ Kt(m, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...Z(m, c), children: [
2689
- C,
2696
+ return /* @__PURE__ */ z(I, { ...e, ...Z(I, c), children: /* @__PURE__ */ z(h, { children: /* @__PURE__ */ Kt(f, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...Z(f, c), children: [
2697
+ S,
2690
2698
  /* @__PURE__ */ z(Tr, {}, "TableBody"),
2691
- g
2699
+ m
2692
2700
  ] }) }) });
2693
2701
  }), {
2694
- Component: vr,
2702
+ Component: yr,
2695
2703
  useEmitter: Qe,
2696
- useEmitterValue: _,
2704
+ useEmitterValue: G,
2697
2705
  usePublisher: Tt
2698
2706
  } = /* @__PURE__ */ qe(
2699
2707
  gr,
2700
2708
  {
2701
- events: {
2702
- atBottomStateChange: "atBottomStateChange",
2703
- atTopStateChange: "atTopStateChange",
2704
- endReached: "endReached",
2705
- groupIndices: "groupIndices",
2706
- isScrolling: "isScrolling",
2707
- itemsRendered: "itemsRendered",
2708
- rangeChanged: "rangeChanged",
2709
- startReached: "startReached",
2710
- totalListHeightChanged: "totalListHeightChanged"
2711
- },
2712
- methods: {
2713
- getState: "getState",
2714
- scrollBy: "scrollBy",
2715
- scrollIntoView: "scrollIntoView",
2716
- scrollTo: "scrollTo",
2717
- scrollToIndex: "scrollToIndex"
2718
- },
2709
+ required: {},
2719
2710
  optional: {
2720
- alignToBottom: "alignToBottom",
2711
+ restoreStateFrom: "restoreStateFrom",
2712
+ context: "context",
2713
+ followOutput: "followOutput",
2714
+ firstItemIndex: "firstItemIndex",
2715
+ itemContent: "itemContent",
2716
+ fixedHeaderContent: "fixedHeaderContent",
2717
+ fixedFooterContent: "fixedFooterContent",
2718
+ overscan: "overscan",
2719
+ increaseViewportBy: "increaseViewportBy",
2720
+ totalCount: "totalCount",
2721
+ topItemCount: "topItemCount",
2722
+ initialTopMostItemIndex: "initialTopMostItemIndex",
2723
+ components: "components",
2724
+ groupCounts: "groupCounts",
2721
2725
  atBottomThreshold: "atBottomThreshold",
2722
2726
  atTopThreshold: "atTopThreshold",
2723
- components: "components",
2724
2727
  computeItemKey: "computeItemKey",
2725
- context: "context",
2726
- customScrollParent: "customScrollParent",
2727
- data: "data",
2728
2728
  defaultItemHeight: "defaultItemHeight",
2729
- firstItemIndex: "firstItemIndex",
2730
- fixedFooterContent: "fixedFooterContent",
2731
- fixedHeaderContent: "fixedHeaderContent",
2732
2729
  fixedItemHeight: "fixedItemHeight",
2733
- followOutput: "followOutput",
2734
- groupCounts: "groupCounts",
2735
- increaseViewportBy: "increaseViewportBy",
2730
+ itemSize: "itemSize",
2731
+ scrollSeekConfiguration: "scrollSeekConfiguration",
2732
+ data: "data",
2736
2733
  initialItemCount: "initialItemCount",
2737
2734
  initialScrollTop: "initialScrollTop",
2738
- initialTopMostItemIndex: "initialTopMostItemIndex",
2739
- itemContent: "itemContent",
2740
- itemSize: "itemSize",
2741
- logLevel: "logLevel",
2742
- overscan: "overscan",
2743
- restoreStateFrom: "restoreStateFrom",
2735
+ alignToBottom: "alignToBottom",
2736
+ useWindowScroll: "useWindowScroll",
2737
+ customScrollParent: "customScrollParent",
2744
2738
  scrollerRef: "scrollerRef",
2745
- scrollSeekConfiguration: "scrollSeekConfiguration",
2746
- topItemCount: "topItemCount",
2747
- totalCount: "totalCount",
2748
- useWindowScroll: "useWindowScroll"
2739
+ logLevel: "logLevel"
2740
+ },
2741
+ methods: {
2742
+ scrollToIndex: "scrollToIndex",
2743
+ scrollIntoView: "scrollIntoView",
2744
+ scrollTo: "scrollTo",
2745
+ scrollBy: "scrollBy",
2746
+ getState: "getState"
2749
2747
  },
2750
- required: {}
2748
+ events: {
2749
+ isScrolling: "isScrolling",
2750
+ endReached: "endReached",
2751
+ startReached: "startReached",
2752
+ rangeChanged: "rangeChanged",
2753
+ atBottomStateChange: "atBottomStateChange",
2754
+ atTopStateChange: "atTopStateChange",
2755
+ totalListHeightChanged: "totalListHeightChanged",
2756
+ itemsRendered: "itemsRendered",
2757
+ groupIndices: "groupIndices"
2758
+ }
2751
2759
  },
2752
- yr
2753
- ), br = /* @__PURE__ */ Ze({ useEmitter: Qe, useEmitterValue: _, usePublisher: Tt }), Rr = /* @__PURE__ */ Xe({ useEmitter: Qe, useEmitterValue: _, usePublisher: Tt }), qr = vr, wn = {
2760
+ vr
2761
+ ), Rr = /* @__PURE__ */ Ze({ useEmitter: Qe, useEmitterValue: G, usePublisher: Tt }), br = /* @__PURE__ */ Xe({ useEmitter: Qe, useEmitterValue: G, usePublisher: Tt }), qr = yr, wn = {
2754
2762
  bottom: 0,
2755
2763
  itemHeight: 0,
2756
2764
  items: [],
@@ -2766,8 +2774,8 @@ const ur = ({ children: t }) => {
2766
2774
  offsetBottom: 0,
2767
2775
  offsetTop: 0,
2768
2776
  top: 0
2769
- }, { ceil: yn, floor: Ce, max: ee, min: Fe, round: vn } = Math;
2770
- function bn(t, e, n) {
2777
+ }, { ceil: vn, floor: Ce, max: ee, min: Oe, round: yn } = Math;
2778
+ function Rn(t, e, n) {
2771
2779
  return Array.from({ length: e - t + 1 }).map((o, r) => ({ data: n === null ? null : n[r + t], index: r + t }));
2772
2780
  }
2773
2781
  function Er(t) {
@@ -2779,260 +2787,260 @@ function Er(t) {
2779
2787
  function he(t, e) {
2780
2788
  return t && t.width === e.width && t.height === e.height;
2781
2789
  }
2782
- function kr(t, e) {
2790
+ function Br(t, e) {
2783
2791
  return t && t.column === e.column && t.row === e.row;
2784
2792
  }
2785
- const Br = /* @__PURE__ */ U(
2793
+ const kr = /* @__PURE__ */ U(
2786
2794
  ([
2787
2795
  { increaseViewportBy: t, listBoundary: e, overscan: n, visibleRange: o },
2788
- { footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: u, smoothScrollTargetReached: f, viewportHeight: S },
2789
- p,
2790
- m,
2791
- { didMount: w, propsReady: I },
2792
- { customScrollParent: C, useWindowScroll: g, windowScrollContainerState: a, windowScrollTo: T, windowViewportRect: b },
2793
- h
2796
+ { footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: a, smoothScrollTargetReached: p, viewportHeight: I },
2797
+ h,
2798
+ f,
2799
+ { didMount: C, propsReady: w },
2800
+ { customScrollParent: S, useWindowScroll: m, windowScrollContainerState: u, windowScrollTo: T, windowViewportRect: R },
2801
+ g
2794
2802
  ]) => {
2795
- const d = y(0), R = y(0), B = y(wn), O = y({ height: 0, width: 0 }), L = y({ height: 0, width: 0 }), V = $(), D = $(), J = y(0), nt = y(null), k = y({ column: 0, row: 0 }), q = $(), st = $(), dt = y(!1), St = y(0), ft = y(!0), ut = y(!1), At = y(!1);
2803
+ const d = v(0), b = v(0), k = v(wn), F = v({ height: 0, width: 0 }), L = v({ height: 0, width: 0 }), V = $(), D = $(), J = v(0), nt = v(null), B = v({ column: 0, row: 0 }), q = $(), it = $(), dt = v(!1), St = v(0), ft = v(!0), ut = v(!1), At = v(!1);
2796
2804
  K(
2797
2805
  x(
2798
- w,
2799
- G(St),
2800
- P(([v, N]) => !!N)
2806
+ C,
2807
+ _(St),
2808
+ P(([y, N]) => !!N)
2801
2809
  ),
2802
2810
  () => {
2803
2811
  W(ft, !1);
2804
2812
  }
2805
2813
  ), K(
2806
2814
  x(
2807
- rt(w, ft, L, O, St, ut),
2808
- P(([v, N, Q, it, , tt]) => v && !N && Q.height !== 0 && it.height !== 0 && !tt)
2815
+ rt(C, ft, L, F, St, ut),
2816
+ P(([y, N, Q, lt, , tt]) => y && !N && Q.height !== 0 && lt.height !== 0 && !tt)
2809
2817
  ),
2810
- ([, , , , v]) => {
2818
+ ([, , , , y]) => {
2811
2819
  W(ut, !0), $e(1, () => {
2812
- W(V, v);
2813
- }), Rt(x(u), () => {
2820
+ W(V, y);
2821
+ }), bt(x(a), () => {
2814
2822
  W(e, [0, 0]), W(ft, !0);
2815
2823
  });
2816
2824
  }
2817
- ), F(
2825
+ ), O(
2818
2826
  x(
2819
- st,
2820
- P((v) => v != null && v.scrollTop > 0),
2821
- vt(0)
2827
+ it,
2828
+ P((y) => y != null && y.scrollTop > 0),
2829
+ yt(0)
2822
2830
  ),
2823
- R
2831
+ b
2824
2832
  ), K(
2825
2833
  x(
2826
- w,
2827
- G(st),
2828
- P(([, v]) => v != null)
2834
+ C,
2835
+ _(it),
2836
+ P(([, y]) => y != null)
2829
2837
  ),
2830
- ([, v]) => {
2831
- v && (W(O, v.viewport), W(L, v.item), W(k, v.gap), v.scrollTop > 0 && (W(dt, !0), Rt(x(u, jt(1)), (N) => {
2838
+ ([, y]) => {
2839
+ y && (W(F, y.viewport), W(L, y.item), W(B, y.gap), y.scrollTop > 0 && (W(dt, !0), bt(x(a, jt(1)), (N) => {
2832
2840
  W(dt, !1);
2833
- }), W(c, { top: v.scrollTop })));
2841
+ }), W(c, { top: y.scrollTop })));
2834
2842
  }
2835
- ), F(
2843
+ ), O(
2836
2844
  x(
2837
- O,
2838
- E(({ height: v }) => v)
2845
+ F,
2846
+ E(({ height: y }) => y)
2839
2847
  ),
2840
- S
2841
- ), F(
2848
+ I
2849
+ ), O(
2842
2850
  x(
2843
2851
  rt(
2844
- A(O, he),
2852
+ A(F, he),
2845
2853
  A(L, he),
2846
- A(k, (v, N) => v && v.column === N.column && v.row === N.row),
2847
- A(u)
2854
+ A(B, (y, N) => y && y.column === N.column && y.row === N.row),
2855
+ A(a)
2848
2856
  ),
2849
- E(([v, N, Q, it]) => ({
2857
+ E(([y, N, Q, lt]) => ({
2850
2858
  gap: Q,
2851
2859
  item: N,
2852
- scrollTop: it,
2853
- viewport: v
2860
+ scrollTop: lt,
2861
+ viewport: y
2854
2862
  }))
2855
2863
  ),
2856
2864
  q
2857
- ), F(
2865
+ ), O(
2858
2866
  x(
2859
2867
  rt(
2860
2868
  A(d),
2861
2869
  o,
2862
- A(k, kr),
2870
+ A(B, Br),
2863
2871
  A(L, he),
2864
- A(O, he),
2872
+ A(F, he),
2865
2873
  A(nt),
2866
- A(R),
2874
+ A(b),
2867
2875
  A(dt),
2868
2876
  A(ft),
2869
2877
  A(St)
2870
2878
  ),
2871
- P(([, , , , , , , v]) => !v),
2879
+ P(([, , , , , , , y]) => !y),
2872
2880
  E(
2873
2881
  ([
2874
- v,
2882
+ y,
2875
2883
  [N, Q],
2876
- it,
2884
+ lt,
2877
2885
  tt,
2878
- Bt,
2886
+ kt,
2879
2887
  Jt,
2880
2888
  Nt,
2881
2889
  ,
2882
2890
  de,
2883
- Ot
2891
+ Ft
2884
2892
  ]) => {
2885
- const { column: Ft, row: Qt } = it, { height: fe, width: He } = tt, { width: tn } = Bt;
2886
- if (Nt === 0 && (v === 0 || tn === 0))
2893
+ const { column: Ot, row: Qt } = lt, { height: fe, width: He } = tt, { width: tn } = kt;
2894
+ if (Nt === 0 && (y === 0 || tn === 0))
2887
2895
  return wn;
2888
2896
  if (He === 0) {
2889
- const sn = Ue(Ot, v), so = sn + Math.max(Nt - 1, 0);
2890
- return Er(bn(sn, so, Jt));
2897
+ const sn = Ue(Ft, y), ro = sn + Math.max(Nt - 1, 0);
2898
+ return Er(Rn(sn, ro, Jt));
2891
2899
  }
2892
- const me = no(tn, He, Ft);
2900
+ const me = eo(tn, He, Ot);
2893
2901
  let Dt, Wt;
2894
- de ? N === 0 && Q === 0 && Nt > 0 ? (Dt = 0, Wt = Nt - 1) : (Dt = me * Ce((N + Qt) / (fe + Qt)), Wt = me * yn((Q + Qt) / (fe + Qt)) - 1, Wt = Fe(v - 1, ee(Wt, me - 1)), Dt = Fe(Wt, ee(0, Dt))) : (Dt = 0, Wt = -1);
2895
- const en = bn(Dt, Wt, Jt), { bottom: nn, top: on } = Rn(Bt, it, tt, en), rn = yn(v / me), ro = rn * fe + (rn - 1) * Qt - nn;
2896
- return { bottom: nn, itemHeight: fe, items: en, itemWidth: He, offsetBottom: ro, offsetTop: on, top: on };
2902
+ de ? N === 0 && Q === 0 && Nt > 0 ? (Dt = 0, Wt = Nt - 1) : (Dt = me * Ce((N + Qt) / (fe + Qt)), Wt = me * vn((Q + Qt) / (fe + Qt)) - 1, Wt = Oe(y - 1, ee(Wt, me - 1)), Dt = Oe(Wt, ee(0, Dt))) : (Dt = 0, Wt = -1);
2903
+ const en = Rn(Dt, Wt, Jt), { bottom: nn, top: on } = bn(kt, lt, tt, en), rn = vn(y / me), oo = rn * fe + (rn - 1) * Qt - nn;
2904
+ return { bottom: nn, itemHeight: fe, items: en, itemWidth: He, offsetBottom: oo, offsetTop: on, top: on };
2897
2905
  }
2898
2906
  )
2899
2907
  ),
2900
- B
2901
- ), F(
2908
+ k
2909
+ ), O(
2902
2910
  x(
2903
2911
  nt,
2904
- P((v) => v !== null),
2905
- E((v) => v.length)
2912
+ P((y) => y !== null),
2913
+ E((y) => y.length)
2906
2914
  ),
2907
2915
  d
2908
- ), F(
2916
+ ), O(
2909
2917
  x(
2910
- rt(O, L, B, k),
2911
- P(([v, N, { items: Q }]) => Q.length > 0 && N.height !== 0 && v.height !== 0),
2912
- E(([v, N, { items: Q }, it]) => {
2913
- const { bottom: tt, top: Bt } = Rn(v, it, N, Q);
2914
- return [Bt, tt];
2918
+ rt(F, L, k, B),
2919
+ P(([y, N, { items: Q }]) => Q.length > 0 && N.height !== 0 && y.height !== 0),
2920
+ E(([y, N, { items: Q }, lt]) => {
2921
+ const { bottom: tt, top: kt } = bn(y, lt, N, Q);
2922
+ return [kt, tt];
2915
2923
  }),
2916
2924
  Y(se)
2917
2925
  ),
2918
2926
  e
2919
2927
  );
2920
- const xt = y(!1);
2921
- F(
2928
+ const xt = v(!1);
2929
+ O(
2922
2930
  x(
2923
- u,
2924
- G(xt),
2925
- E(([v, N]) => N || v !== 0)
2931
+ a,
2932
+ _(xt),
2933
+ E(([y, N]) => N || y !== 0)
2926
2934
  ),
2927
2935
  xt
2928
2936
  );
2929
- const Xt = pt(
2937
+ const Xt = ht(
2930
2938
  x(
2931
- rt(B, d),
2932
- P(([{ items: v }]) => v.length > 0),
2933
- G(xt),
2934
- P(([[v, N], Q]) => {
2935
- const tt = v.items[v.items.length - 1].index === N - 1;
2936
- return (Q || v.bottom > 0 && v.itemHeight > 0 && v.offsetBottom === 0 && v.items.length === N) && tt;
2939
+ rt(k, d),
2940
+ P(([{ items: y }]) => y.length > 0),
2941
+ _(xt),
2942
+ P(([[y, N], Q]) => {
2943
+ const tt = y.items[y.items.length - 1].index === N - 1;
2944
+ return (Q || y.bottom > 0 && y.itemHeight > 0 && y.offsetBottom === 0 && y.items.length === N) && tt;
2937
2945
  }),
2938
- E(([[, v]]) => v - 1),
2946
+ E(([[, y]]) => y - 1),
2939
2947
  Y()
2940
2948
  )
2941
- ), Mt = pt(
2949
+ ), Mt = ht(
2942
2950
  x(
2943
- A(B),
2944
- P(({ items: v }) => v.length > 0 && v[0].index === 0),
2945
- vt(0),
2951
+ A(k),
2952
+ P(({ items: y }) => y.length > 0 && y[0].index === 0),
2953
+ yt(0),
2946
2954
  Y()
2947
2955
  )
2948
- ), yt = pt(
2956
+ ), vt = ht(
2949
2957
  x(
2950
- A(B),
2951
- G(dt),
2952
- P(([{ items: v }, N]) => v.length > 0 && !N),
2953
- E(([{ items: v }]) => ({
2954
- endIndex: v[v.length - 1].index,
2955
- startIndex: v[0].index
2958
+ A(k),
2959
+ _(dt),
2960
+ P(([{ items: y }, N]) => y.length > 0 && !N),
2961
+ E(([{ items: y }]) => ({
2962
+ endIndex: y[y.length - 1].index,
2963
+ startIndex: y[0].index
2956
2964
  })),
2957
- Y(An),
2965
+ Y(Pn),
2958
2966
  Lt(0)
2959
2967
  )
2960
2968
  );
2961
- F(yt, m.scrollSeekRangeChanged), F(
2969
+ O(vt, f.scrollSeekRangeChanged), O(
2962
2970
  x(
2963
2971
  V,
2964
- G(O, L, d, k),
2965
- E(([v, N, Q, it, tt]) => {
2966
- const Bt = Nn(v), { align: Jt, behavior: Nt, offset: de } = Bt;
2967
- let Ot = Bt.index;
2968
- Ot === "LAST" && (Ot = it - 1), Ot = ee(0, Ot, Fe(it - 1, Ot));
2969
- let Ft = Ae(N, tt, Q, Ot);
2970
- return Jt === "end" ? Ft = vn(Ft - N.height + Q.height) : Jt === "center" && (Ft = vn(Ft - N.height / 2 + Q.height / 2)), de && (Ft += de), { behavior: Nt, top: Ft };
2972
+ _(F, L, d, B),
2973
+ E(([y, N, Q, lt, tt]) => {
2974
+ const kt = _n(y), { align: Jt, behavior: Nt, offset: de } = kt;
2975
+ let Ft = kt.index;
2976
+ Ft === "LAST" && (Ft = lt - 1), Ft = ee(0, Ft, Oe(lt - 1, Ft));
2977
+ let Ot = Ae(N, tt, Q, Ft);
2978
+ return Jt === "end" ? Ot = yn(Ot - N.height + Q.height) : Jt === "center" && (Ot = yn(Ot - N.height / 2 + Q.height / 2)), de && (Ot += de), { behavior: Nt, top: Ot };
2971
2979
  })
2972
2980
  ),
2973
2981
  c
2974
2982
  );
2975
- const kt = ct(
2983
+ const Bt = ct(
2976
2984
  x(
2977
- B,
2978
- E((v) => v.offsetBottom + v.bottom)
2985
+ k,
2986
+ E((y) => y.offsetBottom + y.bottom)
2979
2987
  ),
2980
2988
  0
2981
2989
  );
2982
- return F(
2990
+ return O(
2983
2991
  x(
2984
- b,
2985
- E((v) => ({ height: v.visibleHeight, width: v.visibleWidth }))
2992
+ R,
2993
+ E((y) => ({ height: y.visibleHeight, width: y.visibleWidth }))
2986
2994
  ),
2987
- O
2995
+ F
2988
2996
  ), {
2989
- customScrollParent: C,
2997
+ customScrollParent: S,
2990
2998
  // input
2991
2999
  data: nt,
2992
3000
  deviation: J,
2993
3001
  footerHeight: r,
2994
- gap: k,
3002
+ gap: B,
2995
3003
  headerHeight: s,
2996
3004
  increaseViewportBy: t,
2997
- initialItemCount: R,
3005
+ initialItemCount: b,
2998
3006
  itemDimensions: L,
2999
3007
  overscan: n,
3000
- restoreStateFrom: st,
3008
+ restoreStateFrom: it,
3001
3009
  scrollBy: i,
3002
3010
  scrollContainerState: l,
3003
3011
  scrollHeight: D,
3004
3012
  scrollTo: c,
3005
3013
  scrollToIndex: V,
3006
- scrollTop: u,
3007
- smoothScrollTargetReached: f,
3014
+ scrollTop: a,
3015
+ smoothScrollTargetReached: p,
3008
3016
  totalCount: d,
3009
- useWindowScroll: g,
3010
- viewportDimensions: O,
3011
- windowScrollContainerState: a,
3017
+ useWindowScroll: m,
3018
+ viewportDimensions: F,
3019
+ windowScrollContainerState: u,
3012
3020
  windowScrollTo: T,
3013
- windowViewportRect: b,
3014
- ...m,
3021
+ windowViewportRect: R,
3022
+ ...f,
3015
3023
  // output
3016
- gridState: B,
3024
+ gridState: k,
3017
3025
  horizontalDirection: At,
3018
3026
  initialTopMostItemIndex: St,
3019
- totalListHeight: kt,
3020
- ...p,
3027
+ totalListHeight: Bt,
3028
+ ...h,
3021
3029
  endReached: Xt,
3022
- propsReady: I,
3023
- rangeChanged: yt,
3030
+ propsReady: w,
3031
+ rangeChanged: vt,
3024
3032
  startReached: Mt,
3025
3033
  stateChanged: q,
3026
3034
  stateRestoreInProgress: dt,
3027
- ...h
3035
+ ...g
3028
3036
  };
3029
3037
  },
3030
- X(Ke, at, ae, Kn, Pt, je, Vt)
3038
+ X(Ke, at, ae, Un, Pt, je, Vt)
3031
3039
  );
3032
- function no(t, e, n) {
3040
+ function eo(t, e, n) {
3033
3041
  return ee(1, Ce((t + n) / (Ce(e) + n)));
3034
3042
  }
3035
- function Rn(t, e, n, o) {
3043
+ function bn(t, e, n, o) {
3036
3044
  const { height: r } = n;
3037
3045
  if (r === void 0 || o.length === 0)
3038
3046
  return { bottom: 0, top: 0 };
@@ -3040,19 +3048,19 @@ function Rn(t, e, n, o) {
3040
3048
  return { bottom: Ae(t, e, n, o[o.length - 1].index) + r, top: s };
3041
3049
  }
3042
3050
  function Ae(t, e, n, o) {
3043
- const r = no(t.width, n.width, e.column), s = Ce(o / r), i = s * n.height + ee(0, s - 1) * e.row;
3051
+ const r = eo(t.width, n.width, e.column), s = Ce(o / r), i = s * n.height + ee(0, s - 1) * e.row;
3044
3052
  return i > 0 ? i + e.row : i;
3045
3053
  }
3046
- const Or = /* @__PURE__ */ U(() => {
3047
- const t = y((S) => `Item ${S}`), e = y({}), n = y(null), o = y("virtuoso-grid-item"), r = y("virtuoso-grid-list"), s = y(Ye), i = y("div"), l = y(Yt), c = (S, p = null) => ct(
3054
+ const Fr = /* @__PURE__ */ U(() => {
3055
+ const t = v((I) => `Item ${I}`), e = v({}), n = v(null), o = v("virtuoso-grid-item"), r = v("virtuoso-grid-list"), s = v(Ye), i = v("div"), l = v(Yt), c = (I, h = null) => ct(
3048
3056
  x(
3049
3057
  e,
3050
- E((m) => m[S]),
3058
+ E((f) => f[I]),
3051
3059
  Y()
3052
3060
  ),
3053
- p
3054
- ), u = y(!1), f = y(!1);
3055
- return F(A(f), u), {
3061
+ h
3062
+ ), a = v(!1), p = v(!1);
3063
+ return O(A(p), a), {
3056
3064
  components: e,
3057
3065
  computeItemKey: s,
3058
3066
  context: n,
@@ -3064,66 +3072,66 @@ const Or = /* @__PURE__ */ U(() => {
3064
3072
  itemContent: t,
3065
3073
  listClassName: r,
3066
3074
  ListComponent: c("List", "div"),
3067
- readyStateChanged: u,
3068
- reportReadyState: f,
3075
+ readyStateChanged: a,
3076
+ reportReadyState: p,
3069
3077
  ScrollerComponent: c("Scroller", "div"),
3070
3078
  scrollerRef: l,
3071
3079
  ScrollSeekPlaceholder: c("ScrollSeekPlaceholder", "div")
3072
3080
  };
3073
- }), Fr = /* @__PURE__ */ U(
3081
+ }), Or = /* @__PURE__ */ U(
3074
3082
  ([t, e]) => ({ ...t, ...e }),
3075
- X(Br, Or)
3083
+ X(kr, Fr)
3076
3084
  ), Lr = /* @__PURE__ */ H.memo(function() {
3077
- const e = et("gridState"), n = et("listClassName"), o = et("itemClassName"), r = et("itemContent"), s = et("computeItemKey"), i = et("isSeeking"), l = It("scrollHeight"), c = et("ItemComponent"), u = et("ListComponent"), f = et("ScrollSeekPlaceholder"), S = et("context"), p = It("itemDimensions"), m = It("gap"), w = et("log"), I = et("stateRestoreInProgress"), C = It("reportReadyState"), g = Ht(
3085
+ const e = et("gridState"), n = et("listClassName"), o = et("itemClassName"), r = et("itemContent"), s = et("computeItemKey"), i = et("isSeeking"), l = It("scrollHeight"), c = et("ItemComponent"), a = et("ListComponent"), p = et("ScrollSeekPlaceholder"), I = et("context"), h = It("itemDimensions"), f = It("gap"), C = et("log"), w = et("stateRestoreInProgress"), S = It("reportReadyState"), m = Ht(
3078
3086
  H.useMemo(
3079
- () => (a) => {
3080
- const T = a.parentElement.parentElement.scrollHeight;
3087
+ () => (u) => {
3088
+ const T = u.parentElement.parentElement.scrollHeight;
3081
3089
  l(T);
3082
- const b = a.firstChild;
3083
- if (b) {
3084
- const { height: h, width: d } = b.getBoundingClientRect();
3085
- p({ height: h, width: d });
3090
+ const R = u.firstChild;
3091
+ if (R) {
3092
+ const { height: g, width: d } = R.getBoundingClientRect();
3093
+ h({ height: g, width: d });
3086
3094
  }
3087
- m({
3088
- column: Hn("column-gap", getComputedStyle(a).columnGap, w),
3089
- row: Hn("row-gap", getComputedStyle(a).rowGap, w)
3095
+ f({
3096
+ column: Hn("column-gap", getComputedStyle(u).columnGap, C),
3097
+ row: Hn("row-gap", getComputedStyle(u).rowGap, C)
3090
3098
  });
3091
3099
  },
3092
- [l, p, m, w]
3100
+ [l, h, f, C]
3093
3101
  ),
3094
3102
  !0,
3095
3103
  !1
3096
3104
  );
3097
- return Zn(() => {
3098
- e.itemHeight > 0 && e.itemWidth > 0 && C(!0);
3099
- }, [e]), I ? null : /* @__PURE__ */ z(
3100
- u,
3105
+ return Yn(() => {
3106
+ e.itemHeight > 0 && e.itemWidth > 0 && S(!0);
3107
+ }, [e]), w ? null : /* @__PURE__ */ z(
3108
+ a,
3101
3109
  {
3102
3110
  className: n,
3103
- ref: g,
3104
- ...Z(u, S),
3111
+ ref: m,
3112
+ ...Z(a, I),
3105
3113
  "data-testid": "virtuoso-item-list",
3106
3114
  style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
3107
- children: e.items.map((a) => {
3108
- const T = s(a.index, a.data, S);
3115
+ children: e.items.map((u) => {
3116
+ const T = s(u.index, u.data, I);
3109
3117
  return i ? /* @__PURE__ */ z(
3110
- f,
3118
+ p,
3111
3119
  {
3112
- ...Z(f, S),
3120
+ ...Z(p, I),
3113
3121
  height: e.itemHeight,
3114
- index: a.index,
3122
+ index: u.index,
3115
3123
  width: e.itemWidth
3116
3124
  },
3117
3125
  T
3118
3126
  ) : /* @__PURE__ */ $t(
3119
3127
  c,
3120
3128
  {
3121
- ...Z(c, S),
3129
+ ...Z(c, I),
3122
3130
  className: o,
3123
- "data-index": a.index,
3131
+ "data-index": u.index,
3124
3132
  key: T
3125
3133
  },
3126
- r(a.index, a.data, S)
3134
+ r(u.index, u.data, I)
3127
3135
  );
3128
3136
  })
3129
3137
  }
@@ -3153,7 +3161,7 @@ const Or = /* @__PURE__ */ U(() => {
3153
3161
  ), s = et("context");
3154
3162
  return e ? /* @__PURE__ */ z(o, { ref: r, children: /* @__PURE__ */ z(e, { ...Z(e, s) }) }) : null;
3155
3163
  }), Pr = ({ children: t }) => {
3156
- const e = H.useContext(Yn), n = It("itemDimensions"), o = It("viewportDimensions"), r = Ht(
3164
+ const e = H.useContext(qn), n = It("itemDimensions"), o = It("viewportDimensions"), r = Ht(
3157
3165
  H.useMemo(
3158
3166
  () => (s) => {
3159
3167
  o(s.getBoundingClientRect());
@@ -3167,12 +3175,12 @@ const Or = /* @__PURE__ */ U(() => {
3167
3175
  e && (o({ height: e.viewportHeight, width: e.viewportWidth }), n({ height: e.itemHeight, width: e.itemWidth }));
3168
3176
  }, [e, o, n]), /* @__PURE__ */ z("div", { ref: r, style: Zt(!1), children: t });
3169
3177
  }, Ar = ({ children: t }) => {
3170
- const e = H.useContext(Yn), n = It("windowViewportRect"), o = It("itemDimensions"), r = et("customScrollParent"), s = Ge(n, r, !1);
3178
+ const e = H.useContext(qn), n = It("windowViewportRect"), o = It("itemDimensions"), r = et("customScrollParent"), s = _e(n, r, !1);
3171
3179
  return H.useEffect(() => {
3172
3180
  e && (o({ height: e.itemHeight, width: e.itemWidth }), n({ offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: e.viewportWidth }));
3173
3181
  }, [e, n, o]), /* @__PURE__ */ z("div", { ref: s, style: Zt(!1), children: t });
3174
3182
  }, Mr = /* @__PURE__ */ H.memo(function({ ...e }) {
3175
- const n = et("useWindowScroll"), o = et("customScrollParent"), r = o || n ? Gr : _r, s = o || n ? Ar : Pr, i = et("context");
3183
+ const n = et("useWindowScroll"), o = et("customScrollParent"), r = o || n ? _r : Gr, s = o || n ? Ar : Pr, i = et("context");
3176
3184
  return /* @__PURE__ */ z(r, { ...e, ...Z(r, i), children: /* @__PURE__ */ Kt(s, { children: [
3177
3185
  /* @__PURE__ */ z(zr, {}),
3178
3186
  /* @__PURE__ */ z(Lr, {}),
@@ -3180,61 +3188,61 @@ const Or = /* @__PURE__ */ U(() => {
3180
3188
  ] }) });
3181
3189
  }), {
3182
3190
  Component: Wr,
3183
- useEmitter: oo,
3191
+ useEmitter: no,
3184
3192
  useEmitterValue: et,
3185
3193
  usePublisher: It
3186
3194
  } = /* @__PURE__ */ qe(
3187
- Fr,
3195
+ Or,
3188
3196
  {
3189
- events: {
3190
- atBottomStateChange: "atBottomStateChange",
3191
- atTopStateChange: "atTopStateChange",
3192
- endReached: "endReached",
3193
- isScrolling: "isScrolling",
3194
- rangeChanged: "rangeChanged",
3195
- readyStateChanged: "readyStateChanged",
3196
- startReached: "startReached",
3197
- stateChanged: "stateChanged"
3198
- },
3199
- methods: {
3200
- scrollBy: "scrollBy",
3201
- scrollTo: "scrollTo",
3202
- scrollToIndex: "scrollToIndex"
3203
- },
3204
3197
  optional: {
3198
+ context: "context",
3199
+ totalCount: "totalCount",
3200
+ overscan: "overscan",
3201
+ itemContent: "itemContent",
3205
3202
  components: "components",
3206
3203
  computeItemKey: "computeItemKey",
3207
- context: "context",
3208
- customScrollParent: "customScrollParent",
3209
3204
  data: "data",
3210
- headerFooterTag: "headerFooterTag",
3211
- increaseViewportBy: "increaseViewportBy",
3212
3205
  initialItemCount: "initialItemCount",
3213
- initialTopMostItemIndex: "initialTopMostItemIndex",
3214
- itemClassName: "itemClassName",
3215
- itemContent: "itemContent",
3206
+ scrollSeekConfiguration: "scrollSeekConfiguration",
3207
+ headerFooterTag: "headerFooterTag",
3216
3208
  listClassName: "listClassName",
3209
+ itemClassName: "itemClassName",
3210
+ useWindowScroll: "useWindowScroll",
3211
+ customScrollParent: "customScrollParent",
3212
+ scrollerRef: "scrollerRef",
3217
3213
  logLevel: "logLevel",
3218
- overscan: "overscan",
3219
3214
  restoreStateFrom: "restoreStateFrom",
3220
- scrollerRef: "scrollerRef",
3221
- scrollSeekConfiguration: "scrollSeekConfiguration",
3222
- totalCount: "totalCount",
3223
- useWindowScroll: "useWindowScroll"
3215
+ initialTopMostItemIndex: "initialTopMostItemIndex",
3216
+ increaseViewportBy: "increaseViewportBy"
3217
+ },
3218
+ methods: {
3219
+ scrollTo: "scrollTo",
3220
+ scrollBy: "scrollBy",
3221
+ scrollToIndex: "scrollToIndex"
3222
+ },
3223
+ events: {
3224
+ isScrolling: "isScrolling",
3225
+ endReached: "endReached",
3226
+ startReached: "startReached",
3227
+ rangeChanged: "rangeChanged",
3228
+ atBottomStateChange: "atBottomStateChange",
3229
+ atTopStateChange: "atTopStateChange",
3230
+ stateChanged: "stateChanged",
3231
+ readyStateChanged: "readyStateChanged"
3224
3232
  }
3225
3233
  },
3226
3234
  Mr
3227
- ), _r = /* @__PURE__ */ Ze({ useEmitter: oo, useEmitterValue: et, usePublisher: It }), Gr = /* @__PURE__ */ Xe({ useEmitter: oo, useEmitterValue: et, usePublisher: It });
3235
+ ), Gr = /* @__PURE__ */ Ze({ useEmitter: no, useEmitterValue: et, usePublisher: It }), _r = /* @__PURE__ */ Xe({ useEmitter: no, useEmitterValue: et, usePublisher: It });
3228
3236
  function Hn(t, e, n) {
3229
- return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e, ht.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
3237
+ return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
3230
3238
  }
3231
3239
  const Yr = Wr;
3232
3240
  export {
3233
3241
  jr as GroupedVirtuoso,
3234
- ht as LogLevel,
3242
+ mt as LogLevel,
3235
3243
  qr as TableVirtuoso,
3236
3244
  Kr as Virtuoso,
3237
3245
  Yr as VirtuosoGrid,
3238
- Yn as VirtuosoGridMockContext,
3239
- Re as VirtuosoMockContext
3246
+ qn as VirtuosoGridMockContext,
3247
+ be as VirtuosoMockContext
3240
3248
  };