react-virtuoso 4.18.20 → 4.18.22

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