react-virtuoso 4.15.0 → 4.16.1

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