react-virtuoso 4.12.8 → 4.14.0

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