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