@aiquants/virtualscroll 1.22.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx as st, jsxs as ue, Fragment as je } from "react/jsx-runtime";
2
- import Je, { memo as Qe, forwardRef as Ye, useState as Zt, useRef as T, useCallback as S, useImperativeHandle as Be, useMemo as At, useLayoutEffect as be, useEffect as Y, useId as tr } from "react";
3
- import { twMerge as ce } from "tailwind-merge";
1
+ import { jsx as ot, jsxs as he, Fragment as Ge } from "react/jsx-runtime";
2
+ import Qe, { memo as tr, forwardRef as Be, useState as Jt, useRef as I, useCallback as S, useImperativeHandle as qe, useMemo as Lt, useLayoutEffect as Te, useEffect as q, useId as er } from "react";
3
+ import { twMerge as pe } from "tailwind-merge";
4
4
  class C {
5
5
  level;
6
6
  prefix;
@@ -146,17 +146,17 @@ class C {
146
146
  this.level <= 3 && this.impl.error(...this.formatMessage(C.resolveLazy(t)), ...e.map(C.resolveLazy));
147
147
  }
148
148
  }
149
- const qe = {
149
+ const He = {
150
150
  active: !1,
151
151
  offsetX: 0,
152
152
  offsetY: 0,
153
153
  distance: 0,
154
154
  direction: 0,
155
155
  pointerId: null
156
- }, Le = 6, er = 8, rr = ({ dragState: n, normalizedDistance: t }) => {
156
+ }, _e = 6, rr = 8, nr = ({ dragState: n, normalizedDistance: t }) => {
157
157
  const e = 1 + t * 0.18, r = 0.16 + t * 0.24, i = 0.38 + t * 0.28, s = n.active ? "80ms ease-out" : "220ms ease";
158
- return /* @__PURE__ */ ue(je, { children: [
159
- /* @__PURE__ */ st(
158
+ return /* @__PURE__ */ he(Ge, { children: [
159
+ /* @__PURE__ */ ot(
160
160
  "div",
161
161
  {
162
162
  className: "aqvs-tap-scroll-circle-visual-outer",
@@ -168,7 +168,7 @@ const qe = {
168
168
  }
169
169
  }
170
170
  ),
171
- /* @__PURE__ */ st(
171
+ /* @__PURE__ */ ot(
172
172
  "div",
173
173
  {
174
174
  className: "aqvs-tap-scroll-circle-inner",
@@ -181,154 +181,154 @@ const qe = {
181
181
  }
182
182
  )
183
183
  ] });
184
- }, Ge = Qe(
185
- Ye(({ onDragChange: n, className: t, maxVisualDistance: e = 160, size: r = 40, style: i, opacity: s = 1, renderVisual: l }, c) => {
186
- const [d, x] = Zt(qe), I = T(null), M = T(null), E = T({ x: 0, y: 0 }), h = T(null), _ = T(0), z = S(
187
- (p) => {
188
- x(p), n(p);
184
+ }, Ze = tr(
185
+ Be(({ onDragChange: n, className: t, maxVisualDistance: e = 160, size: r = 40, style: i, opacity: s = 1, renderVisual: a }, c) => {
186
+ const [d, b] = Jt(He), x = I(null), v = I(null), E = I({ x: 0, y: 0 }), m = I(null), _ = I(0), B = S(
187
+ (T) => {
188
+ b(T), n(T);
189
189
  },
190
190
  [n]
191
- ), j = S(
192
- (p, $, St = !1) => {
193
- const { x: Rt, y: Z } = E.current, k = p - Rt, Ct = $ - Z, U = Math.abs(Ct), Et = U < Le ? 0 : Ct < 0 ? -1 : 1, y = _.current;
194
- let Yt = Et;
195
- const Ht = Le + er;
196
- Et === 0 ? y !== 0 && U < Ht ? Yt = y : (Yt = 0, St || (_.current = 0)) : Et !== y && y !== 0 && U < Ht ? Yt = y : _.current = Et, z({
197
- active: St || U >= Le,
198
- offsetX: k,
199
- offsetY: Ct,
200
- distance: U,
201
- direction: Yt,
202
- pointerId: I.current
191
+ ), Z = S(
192
+ (T, V, Tt = !1) => {
193
+ const { x: Yt, y: yt } = E.current, J = T - Yt, F = V - yt, Ct = Math.abs(F), W = Ct < _e ? 0 : F < 0 ? -1 : 1, At = _.current;
194
+ let y = W;
195
+ const Kt = _e + rr;
196
+ W === 0 ? At !== 0 && Ct < Kt ? y = At : (y = 0, Tt || (_.current = 0)) : W !== At && At !== 0 && Ct < Kt ? y = At : _.current = W, B({
197
+ active: Tt || Ct >= _e,
198
+ offsetX: J,
199
+ offsetY: F,
200
+ distance: Ct,
201
+ direction: y,
202
+ pointerId: x.current
203
203
  });
204
204
  },
205
- [z]
206
- ), ut = S((p) => {
207
- if (p === null)
205
+ [B]
206
+ ), ut = S((T) => {
207
+ if (T === null)
208
208
  return;
209
- const $ = h.current;
210
- $?.hasPointerCapture(p) && $.releasePointerCapture(p);
211
- }, []), Q = S(
212
- (p = !1) => {
213
- p && ut(I.current), I.current = null, M.current = null, _.current = 0, z(qe);
209
+ const V = m.current;
210
+ V?.hasPointerCapture(T) && V.releasePointerCapture(T);
211
+ }, []), rt = S(
212
+ (T = !1) => {
213
+ T && ut(x.current), x.current = null, v.current = null, _.current = 0, B(He);
214
214
  },
215
- [z, ut]
216
- ), tt = S(
217
- (p) => {
218
- if (I.current !== null && I.current !== p.pointerId) {
219
- M.current = { pointerId: p.pointerId, clientX: p.clientX, clientY: p.clientY }, p.preventDefault(), p.stopPropagation();
215
+ [B, ut]
216
+ ), nt = S(
217
+ (T) => {
218
+ if (x.current !== null && x.current !== T.pointerId) {
219
+ v.current = { pointerId: T.pointerId, clientX: T.clientX, clientY: T.clientY }, T.preventDefault(), T.stopPropagation();
220
220
  return;
221
221
  }
222
- p.preventDefault(), p.stopPropagation();
223
- const $ = h.current ?? p.currentTarget, { left: St, top: Rt, width: Z, height: k } = $.getBoundingClientRect();
224
- E.current = { x: St + Z / 2, y: Rt + k / 2 }, I.current = p.pointerId;
222
+ T.preventDefault(), T.stopPropagation();
223
+ const V = m.current ?? T.currentTarget, { left: Tt, top: Yt, width: yt, height: J } = V.getBoundingClientRect();
224
+ E.current = { x: Tt + yt / 2, y: Yt + J / 2 }, x.current = T.pointerId;
225
225
  try {
226
- $.setPointerCapture(p.pointerId);
226
+ V.setPointerCapture(T.pointerId);
227
227
  } catch {
228
228
  }
229
- j(p.clientX, p.clientY, !0);
229
+ Z(T.clientX, T.clientY, !0);
230
230
  },
231
- [j]
232
- ), mt = S(
233
- (p) => {
234
- if (I.current !== p.pointerId) {
235
- M.current !== null && M.current.pointerId === p.pointerId && (M.current = { pointerId: p.pointerId, clientX: p.clientX, clientY: p.clientY });
231
+ [Z]
232
+ ), pt = S(
233
+ (T) => {
234
+ if (x.current !== T.pointerId) {
235
+ v.current !== null && v.current.pointerId === T.pointerId && (v.current = { pointerId: T.pointerId, clientX: T.clientX, clientY: T.clientY });
236
236
  return;
237
237
  }
238
- p.preventDefault(), j(p.clientX, p.clientY);
238
+ T.preventDefault(), Z(T.clientX, T.clientY);
239
239
  },
240
- [j]
241
- ), Tt = S(
242
- (p) => {
243
- if (I.current !== p.pointerId) {
244
- M.current !== null && M.current.pointerId === p.pointerId && (M.current = null);
240
+ [Z]
241
+ ), Pt = S(
242
+ (T) => {
243
+ if (x.current !== T.pointerId) {
244
+ v.current !== null && v.current.pointerId === T.pointerId && (v.current = null);
245
245
  return;
246
246
  }
247
- p.preventDefault(), p.stopPropagation();
248
- const $ = M.current;
249
- if (M.current = null, $ !== null) {
250
- ut(p.pointerId);
251
- const St = h.current;
252
- let Rt = !0;
253
- if (St !== null && typeof St.setPointerCapture == "function")
247
+ T.preventDefault(), T.stopPropagation();
248
+ const V = v.current;
249
+ if (v.current = null, V !== null) {
250
+ ut(T.pointerId);
251
+ const Tt = m.current;
252
+ let Yt = !0;
253
+ if (Tt !== null && typeof Tt.setPointerCapture == "function")
254
254
  try {
255
- St.setPointerCapture($.pointerId);
256
- } catch (Z) {
257
- (typeof Z == "object" && Z !== null && "name" in Z ? Z.name : void 0) === "NotFoundError" && (Rt = !1);
255
+ Tt.setPointerCapture(V.pointerId);
256
+ } catch (yt) {
257
+ (typeof yt == "object" && yt !== null && "name" in yt ? yt.name : void 0) === "NotFoundError" && (Yt = !1);
258
258
  }
259
- if (Rt) {
260
- I.current = $.pointerId, j($.clientX, $.clientY, !0);
259
+ if (Yt) {
260
+ x.current = V.pointerId, Z(V.clientX, V.clientY, !0);
261
261
  return;
262
262
  }
263
263
  }
264
- Q(!0);
264
+ rt(!0);
265
265
  },
266
- [Q, ut, j]
266
+ [rt, ut, Z]
267
267
  ), D = S(
268
- (p) => {
269
- I.current === p.pointerId && Q(!1);
268
+ (T) => {
269
+ T.target === T.currentTarget && x.current === T.pointerId && rt(!1);
270
270
  },
271
- [Q]
271
+ [rt]
272
272
  );
273
- Be(
273
+ qe(
274
274
  c,
275
275
  () => ({
276
276
  reset: () => {
277
- Q(!0);
277
+ rt(!0);
278
278
  },
279
- getElement: () => h.current
279
+ getElement: () => m.current
280
280
  }),
281
- [Q]
281
+ [rt]
282
282
  );
283
- const O = Math.min(Math.max(s, 0), 1), P = r / 64, B = Math.min(d.distance, e) / e, N = d.direction * B * 10 * P, q = l ?? rr, et = {
283
+ const k = Math.min(Math.max(s, 0), 1), P = r / 64, X = Math.min(d.distance, e) / e, $ = d.direction * X * 10 * P, N = a ?? nr, lt = {
284
284
  dragState: d,
285
- normalizedDistance: B,
285
+ normalizedDistance: X,
286
286
  sizeScale: P,
287
287
  size: r,
288
- opacity: O
289
- }, G = {
288
+ opacity: k
289
+ }, K = {
290
290
  ...i,
291
291
  width: r,
292
292
  height: r,
293
- transform: `translateY(${N}px)`
293
+ transform: `translateY(${$}px)`
294
294
  };
295
- return G.opacity = O, /* @__PURE__ */ st(
295
+ return K.opacity = k, /* @__PURE__ */ ot(
296
296
  "div",
297
297
  {
298
- ref: h,
298
+ ref: m,
299
299
  "data-testid": "virtual-scroll-tap-circle",
300
- className: ce("aqvs-tap-scroll-circle", t),
301
- style: G,
300
+ className: pe("aqvs-tap-scroll-circle", t),
301
+ style: K,
302
302
  tabIndex: -1,
303
- onPointerDown: tt,
304
- onPointerMove: mt,
305
- onPointerUp: Tt,
306
- onPointerCancel: Tt,
303
+ onPointerDown: nt,
304
+ onPointerMove: pt,
305
+ onPointerUp: Pt,
306
+ onPointerCancel: Pt,
307
307
  onLostPointerCapture: D,
308
308
  role: "presentation",
309
- children: q(et)
309
+ children: N(lt)
310
310
  }
311
311
  );
312
312
  })
313
313
  );
314
- Ge.displayName = "TapScrollCircle";
315
- const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scroll-cancel", He = 20, nr = 250, ir = 60, sr = 20, or = 20, Ze = {
314
+ Ze.displayName = "TapScrollCircle";
315
+ const vt = (n, t, e) => Math.max(t, Math.min(e, n)), Ye = "virtualscroll:tap-scroll-cancel", Xe = 20, ir = 250, sr = 60, or = 20, ar = 20, Je = {
316
316
  /** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
317
317
  maxDistance: 240,
318
318
  /** 最小速度倍率 (ビューポート比)。 */
319
319
  minSpeedMultiplier: 0.2
320
- }, ar = Ze.maxDistance, Xe = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, _e = 2.2, lr = 8, cr = 120, ur = 1 / 10, Gt = {
320
+ }, lr = Je.maxDistance, $e = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, ke = 2.2, cr = 8, ur = 120, dr = 1 / 10, Zt = {
321
321
  enabled: !0,
322
322
  size: 40,
323
323
  offsetX: -80,
324
324
  offsetY: 0,
325
325
  className: void 0,
326
- maxVisualDistance: ar,
327
- minSpeedMultiplier: Ze.minSpeedMultiplier,
326
+ maxVisualDistance: lr,
327
+ minSpeedMultiplier: Je.minSpeedMultiplier,
328
328
  opacity: 0.9,
329
329
  renderVisual: void 0,
330
330
  maxSpeedCurve: void 0
331
- }, dr = (n) => n ? {
331
+ }, fr = (n) => n ? {
332
332
  mainSizeKey: "width",
333
333
  crossSizeKey: "height",
334
334
  positionKey: "left",
@@ -348,512 +348,512 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
348
348
  arrowIcons: ["▲", "▼"],
349
349
  directionClass: "aqvs-scrollbar-vertical",
350
350
  orientation: "vertical"
351
- }, fr = (n, t) => {
352
- const e = n?.maxSpeedMultiplier, r = typeof e == "number" ? e : br(t);
351
+ }, mr = (n, t) => {
352
+ const e = n?.maxSpeedMultiplier, r = typeof e == "number" ? e : xr(t);
353
353
  return {
354
- enabled: n?.enabled ?? Gt.enabled,
355
- size: n?.size ?? Gt.size,
356
- offsetX: n?.offsetX ?? Gt.offsetX,
357
- offsetY: n?.offsetY ?? Gt.offsetY,
358
- className: n?.className ?? Gt.className,
359
- maxVisualDistance: n?.maxVisualDistance ?? Gt.maxVisualDistance,
354
+ enabled: n?.enabled ?? Zt.enabled,
355
+ size: n?.size ?? Zt.size,
356
+ offsetX: n?.offsetX ?? Zt.offsetX,
357
+ offsetY: n?.offsetY ?? Zt.offsetY,
358
+ className: n?.className ?? Zt.className,
359
+ maxVisualDistance: n?.maxVisualDistance ?? Zt.maxVisualDistance,
360
360
  maxSpeedMultiplier: r,
361
- minSpeedMultiplier: Math.max(n?.minSpeedMultiplier ?? Gt.minSpeedMultiplier, 0),
362
- opacity: It(n?.opacity ?? Gt.opacity, 0, 1),
363
- renderVisual: n?.renderVisual ?? Gt.renderVisual,
364
- maxSpeedCurve: n?.maxSpeedCurve ?? Gt.maxSpeedCurve
361
+ minSpeedMultiplier: Math.max(n?.minSpeedMultiplier ?? Zt.minSpeedMultiplier, 0),
362
+ opacity: vt(n?.opacity ?? Zt.opacity, 0, 1),
363
+ renderVisual: n?.renderVisual ?? Zt.renderVisual,
364
+ maxSpeedCurve: n?.maxSpeedCurve ?? Zt.maxSpeedCurve
365
365
  };
366
- }, mr = ({ isDragging: n, isThumbHovered: t, enableThumbDrag: e }) => At(() => e ? n ? "dragging" : t ? "hover" : "idle" : "disabled", [e, n, t]), pr = ({ canUseArrowButtons: n, enableArrowButtons: t, resetTapScroll: e, scrollByStep: r }) => {
367
- const i = T(null), s = T(null), l = T(null), c = S(() => {
368
- i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), l.current !== null && (window.removeEventListener("pointerup", l.current), window.removeEventListener("pointercancel", l.current), window.removeEventListener("blur", l.current), l.current = null);
366
+ }, pr = ({ isDragging: n, isThumbHovered: t, enableThumbDrag: e }) => Lt(() => e ? n ? "dragging" : t ? "hover" : "idle" : "disabled", [e, n, t]), hr = ({ canUseArrowButtons: n, enableArrowButtons: t, resetTapScroll: e, scrollByStep: r }) => {
367
+ const i = I(null), s = I(null), a = I(null), c = S(() => {
368
+ i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), a.current !== null && (window.removeEventListener("pointerup", a.current), window.removeEventListener("pointercancel", a.current), window.removeEventListener("blur", a.current), a.current = null);
369
369
  }, []), d = S(() => {
370
370
  c();
371
- }, [c]), x = S(
372
- (M) => (E) => {
371
+ }, [c]), b = S(
372
+ (v) => (E) => {
373
373
  if (!n)
374
374
  return;
375
- E.cancelable && E.preventDefault(), E.stopPropagation(), e(), c(), r(M), s.current = window.setTimeout(() => {
375
+ E.cancelable && E.preventDefault(), E.stopPropagation(), e(), c(), r(v), s.current = window.setTimeout(() => {
376
376
  i.current = window.setInterval(() => {
377
- r(M);
378
- }, ir);
379
- }, nr);
380
- const h = () => c();
381
- l.current = h, window.addEventListener("pointerup", h), window.addEventListener("pointercancel", h), window.addEventListener("blur", h);
377
+ r(v);
378
+ }, sr);
379
+ }, ir);
380
+ const m = () => c();
381
+ a.current = m, window.addEventListener("pointerup", m), window.addEventListener("pointercancel", m), window.addEventListener("blur", m);
382
382
  },
383
383
  [n, c, e, r]
384
- ), I = S(
385
- (M) => (E) => {
386
- t && (E.key === "Enter" || E.key === " " || E.key === "Spacebar") && (E.preventDefault(), r(M));
384
+ ), x = S(
385
+ (v) => (E) => {
386
+ t && (E.key === "Enter" || E.key === " " || E.key === "Spacebar") && (E.preventDefault(), r(v));
387
387
  },
388
388
  [t, r]
389
389
  );
390
- return Y(() => {
390
+ return q(() => {
391
391
  n || c();
392
- }, [n, c]), Y(() => () => {
392
+ }, [n, c]), q(() => () => {
393
393
  c();
394
- }, [c]), { handleArrowPointerDown: x, handleArrowPointerUp: d, handleArrowKeyDown: I };
395
- }, hr = 700, ae = (n, t) => typeof n == "number" && Number.isFinite(n) ? n : t, gr = ({ distance: n, maxDistance: t, viewportSize: e, minSpeedMultiplier: r, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: l }) => {
396
- const c = Math.max(ae(n, 0), 0), d = ae(t, 0), x = d > 0 ? Math.min(c, d) / d : 1, I = Math.max(ae(e, 0), 0), M = Math.max(ae(r, 0), 0), E = Math.max(ae(i, 0), 0), h = Math.max(I * M, 40), _ = s ? h : 1200, z = Math.max(I * E, _), j = l ? Math.max(ae(l.exponentialScale, E), 0) : 0, ut = l ? Math.min(z, Math.max(I * j, h)) : z, Q = Math.max(ut, h);
397
- let tt = x ** 1.1;
398
- if (l) {
399
- const Tt = Math.min(Math.max(ae(l.exponentialSteepness, 0), 0), hr);
400
- if (Tt === 0)
401
- tt = x;
394
+ }, [c]), { handleArrowPointerDown: b, handleArrowPointerUp: d, handleArrowKeyDown: x };
395
+ }, gr = 700, fe = (n, t) => typeof n == "number" && Number.isFinite(n) ? n : t, br = ({ distance: n, maxDistance: t, viewportSize: e, minSpeedMultiplier: r, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
396
+ const c = Math.max(fe(n, 0), 0), d = fe(t, 0), b = d > 0 ? Math.min(c, d) / d : 1, x = Math.max(fe(e, 0), 0), v = Math.max(fe(r, 0), 0), E = Math.max(fe(i, 0), 0), m = Math.max(x * v, 40), _ = s ? m : 1200, B = Math.max(x * E, _), Z = a ? Math.max(fe(a.exponentialScale, E), 0) : 0, ut = a ? Math.min(B, Math.max(x * Z, m)) : B, rt = Math.max(ut, m);
397
+ let nt = b ** 1.1;
398
+ if (a) {
399
+ const Pt = Math.min(Math.max(fe(a.exponentialSteepness, 0), 0), gr);
400
+ if (Pt === 0)
401
+ nt = b;
402
402
  else {
403
- const D = Math.expm1(Tt) || 1;
404
- tt = Math.min(Math.max(Math.expm1(Tt * x) / D, 0), 1);
403
+ const D = Math.expm1(Pt) || 1;
404
+ nt = Math.min(Math.max(Math.expm1(Pt * b) / D, 0), 1);
405
405
  }
406
406
  }
407
- const mt = Math.min(Math.max(ae(l?.easedOffset, 0), 0), 1);
408
- return h + (Q - h) * (mt + (1 - mt) * tt);
409
- }, br = (n) => {
407
+ const pt = Math.min(Math.max(fe(a?.easedOffset, 0), 0), 1);
408
+ return m + (rt - m) * (pt + (1 - pt) * nt);
409
+ }, xr = (n) => {
410
410
  if (!n || n <= 0)
411
- return _e;
412
- const t = Math.max(1, n), e = Math.log10(t), r = _e + e * lr;
413
- return It(r, _e, cr);
414
- }, xr = ({
411
+ return ke;
412
+ const t = Math.max(1, n), e = Math.log10(t), r = ke + e * cr;
413
+ return vt(r, ke, ur);
414
+ }, Ir = ({
415
415
  contentSize: n,
416
416
  viewportSize: t,
417
417
  scrollPosition: e,
418
418
  onScroll: r,
419
419
  enableThumbDrag: i = !0,
420
420
  enableTrackClick: s = !0,
421
- enableArrowButtons: l = !0,
421
+ enableArrowButtons: a = !0,
422
422
  horizontal: c = !1,
423
423
  scrollBarWidth: d = 12,
424
- className: x,
425
- ariaControls: I,
426
- tapScrollCircleOptions: M,
424
+ className: b,
425
+ ariaControls: x,
426
+ tapScrollCircleOptions: v,
427
427
  itemCount: E,
428
- renderThumbOverlay: h,
428
+ renderThumbOverlay: m,
429
429
  visibleStartIndex: _,
430
- visibleEndIndex: z
430
+ visibleEndIndex: B
431
431
  }) => {
432
- const [j, ut] = Zt(!1), [Q, tt] = Zt(!1), [mt, Tt] = Zt(!1), D = T(null), O = T({
432
+ const [Z, ut] = Jt(!1), [rt, nt] = Jt(!1), [pt, Pt] = Jt(!1), D = I(null), k = I({
433
433
  pointerId: null,
434
434
  startThumbPosition: 0,
435
435
  startClientX: 0,
436
436
  startClientY: 0,
437
437
  scale: 1,
438
438
  captureTarget: null
439
- }), P = T({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), B = T(e), N = T(r), q = T(Xe), et = T(null), G = T(null), p = T(null), $ = T(0), St = T(0), Rt = At(() => fr(M, E), [E, M]), Z = At(() => dr(c), [c]), {
440
- enabled: k,
441
- size: Ct,
442
- offsetX: U,
443
- offsetY: Et,
444
- className: y,
445
- maxVisualDistance: Yt,
446
- maxSpeedMultiplier: Ht,
447
- minSpeedMultiplier: v,
448
- opacity: Xt,
449
- renderVisual: Bt,
450
- maxSpeedCurve: Jt
451
- } = Rt, at = T({
439
+ }), P = I({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), X = I(e), $ = I(r), N = I($e), lt = I(null), K = I(null), T = I(null), V = I(0), Tt = I(0), Yt = Lt(() => mr(v, E), [E, v]), yt = Lt(() => fr(c), [c]), {
440
+ enabled: J,
441
+ size: F,
442
+ offsetX: Ct,
443
+ offsetY: W,
444
+ className: At,
445
+ maxVisualDistance: y,
446
+ maxSpeedMultiplier: Kt,
447
+ minSpeedMultiplier: ae,
448
+ opacity: A,
449
+ renderVisual: j,
450
+ maxSpeedCurve: Bt
451
+ } = Yt, _t = I({
452
452
  viewportSize: t,
453
453
  maxScrollPosition: Math.max(n - t, 0),
454
454
  scrollBarVisible: n > t,
455
- effectiveTapMaxDistance: Math.max(Yt, 1),
456
- tapCircleMaxSpeedMultiplier: Ht,
457
- tapCircleMinSpeedMultiplier: v,
458
- tapCircleMaxSpeedCurve: Jt,
459
- tapScrollCircleOptions: M,
455
+ effectiveTapMaxDistance: Math.max(y, 1),
456
+ tapCircleMaxSpeedMultiplier: Kt,
457
+ tapCircleMinSpeedMultiplier: ae,
458
+ tapCircleMaxSpeedCurve: Bt,
459
+ tapScrollCircleOptions: v,
460
460
  effectiveTrackLength: 0,
461
461
  onScroll: r,
462
462
  scrollPosition: e
463
- }), { mainSizeKey: jt, crossSizeKey: f, positionKey: dt, selectDelta: lt, getPointerCoordinate: H, arrowLabels: it, arrowIcons: J, directionClass: yt, orientation: wt } = Z, Nt = Math.max(Yt, 1), rt = t / n, Dt = Math.max(t - d * 2, 0), Mt = rt * Dt, ft = Math.min(Math.max(He, Mt || 0), Dt || He), ot = n - t, Lt = Math.max(Dt - ft, 0), $t = ot <= 0 || Lt <= 0 ? 0 : It(e / ot * Lt, 0, Lt), Qt = $t + ft / 2, ct = n > t || j, g = ct && l;
464
- be(() => {
465
- at.current = {
463
+ }), { mainSizeKey: Et, crossSizeKey: Xt, positionKey: dt, selectDelta: p, getPointerCoordinate: ft, arrowLabels: mt, arrowIcons: z, directionClass: et, orientation: ct } = yt, kt = Math.max(y, 1), Ot = t / n, Mt = Math.max(t - d * 2, 0), it = Ot * Mt, ht = Math.min(Math.max(Xe, it || 0), Mt || Xe), st = n - t, Q = Math.max(Mt - ht, 0), qt = st <= 0 || Q <= 0 ? 0 : vt(e / st * Q, 0, Q), le = qt + ht / 2, Nt = n > t || Z, $t = Nt && a;
464
+ Te(() => {
465
+ _t.current = {
466
466
  viewportSize: t,
467
- maxScrollPosition: ot,
468
- scrollBarVisible: ct,
469
- effectiveTapMaxDistance: Nt,
470
- tapCircleMaxSpeedMultiplier: Ht,
471
- tapCircleMinSpeedMultiplier: v,
472
- tapCircleMaxSpeedCurve: Jt,
473
- tapScrollCircleOptions: M,
474
- effectiveTrackLength: Lt,
467
+ maxScrollPosition: st,
468
+ scrollBarVisible: Nt,
469
+ effectiveTapMaxDistance: kt,
470
+ tapCircleMaxSpeedMultiplier: Kt,
471
+ tapCircleMinSpeedMultiplier: ae,
472
+ tapCircleMaxSpeedCurve: Bt,
473
+ tapScrollCircleOptions: v,
474
+ effectiveTrackLength: Q,
475
475
  onScroll: r,
476
476
  scrollPosition: e
477
477
  };
478
- }), be(() => {
479
- B.current = e;
480
- }, [e]), be(() => {
481
- N.current = r;
482
- }, [r]), Y(() => {
483
- i || tt(!1);
478
+ }), Te(() => {
479
+ X.current = e;
480
+ }, [e]), Te(() => {
481
+ $.current = r;
482
+ }, [r]), q(() => {
483
+ i || nt(!1);
484
484
  }, [i]);
485
- const w = mr({ isDragging: j, isThumbHovered: Q, enableThumbDrag: i }), bt = S((a, b) => {
486
- const R = at.current, L = b ?? B.current;
487
- if (N.current) {
488
- const m = N.current(a, L);
489
- if (typeof m == "number" && Number.isFinite(m))
490
- return B.current = m, m;
485
+ const Gt = pr({ isDragging: Z, isThumbHovered: rt, enableThumbDrag: i }), Vt = S((o, g) => {
486
+ const M = _t.current, L = g ?? X.current;
487
+ if ($.current) {
488
+ const u = $.current(o, L);
489
+ if (typeof u == "number" && Number.isFinite(u))
490
+ return X.current = u, u;
491
491
  }
492
- const X = typeof a == "function" ? a(L) : a, o = Math.max(R.maxScrollPosition, 0), u = R.scrollBarVisible ? It(X, 0, o) : 0;
493
- return B.current = u, u;
494
- }, []), qt = S(
495
- (a) => {
496
- const b = at.current, R = B.current;
497
- if (!b.scrollBarVisible || b.maxScrollPosition <= 0) {
498
- const A = bt(0, R), F = A - R;
499
- return { nextPosition: A, actualDelta: F, reachedBoundary: !0 };
492
+ const H = typeof o == "function" ? o(L) : o, St = Math.max(M.maxScrollPosition, 0), l = M.scrollBarVisible ? vt(H, 0, St) : 0;
493
+ return X.current = l, l;
494
+ }, []), f = S(
495
+ (o) => {
496
+ const g = _t.current, M = X.current;
497
+ if (!g.scrollBarVisible || g.maxScrollPosition <= 0) {
498
+ const R = Vt(0, M), O = R - M;
499
+ return { nextPosition: R, actualDelta: O, reachedBoundary: !0 };
500
500
  }
501
- if (a === 0)
502
- return { nextPosition: R, actualDelta: 0, reachedBoundary: !1 };
503
- const X = bt((A) => It(A + a, 0, b.maxScrollPosition), R), o = X - R, u = a < 0 && R + a <= 0, m = a > 0 && R + a >= b.maxScrollPosition, V = a < 0 && (X <= 0 || u && o === 0) || a > 0 && (X >= b.maxScrollPosition || m && o === 0);
504
- return { nextPosition: X, actualDelta: o, reachedBoundary: V };
501
+ if (o === 0)
502
+ return { nextPosition: M, actualDelta: 0, reachedBoundary: !1 };
503
+ const H = Vt((R) => vt(R + o, 0, g.maxScrollPosition), M), St = H - M, l = o < 0 && M + o <= 0, u = o > 0 && M + o >= g.maxScrollPosition, h = o < 0 && (H <= 0 || l && St === 0) || o > 0 && (H >= g.maxScrollPosition || u && St === 0);
504
+ return { nextPosition: H, actualDelta: St, reachedBoundary: h };
505
505
  },
506
- [bt]
507
- ), xt = S(
508
- (a, b) => {
509
- a.current += b;
510
- const R = Math.max(at.current.maxScrollPosition, 0);
511
- R > 0 && (a.current = It(a.current, -R, R));
512
- const L = qt(a.current);
513
- return a.current -= L.actualDelta, L.reachedBoundary && (a.current = 0), L;
506
+ [Vt]
507
+ ), w = S(
508
+ (o, g) => {
509
+ o.current += g;
510
+ const M = Math.max(_t.current.maxScrollPosition, 0);
511
+ M > 0 && (o.current = vt(o.current, -M, M));
512
+ const L = f(o.current);
513
+ return o.current -= L.actualDelta, L.reachedBoundary && (o.current = 0), L;
514
514
  },
515
- [qt]
516
- ), _t = S(() => {
517
- G.current !== null && (window.cancelAnimationFrame(G.current), G.current = null), p.current = null, $.current = 0, St.current = 0;
518
- }, []), vt = S(() => {
519
- q.current = { ...Xe }, Tt(!1), et.current?.reset(), _t();
520
- }, [_t]), Ut = S(
521
- (a) => {
522
- const b = q.current, R = at.current;
523
- if (!b.active || b.direction === 0) {
524
- _t();
515
+ [f]
516
+ ), at = S(() => {
517
+ K.current !== null && (window.cancelAnimationFrame(K.current), K.current = null), T.current = null, V.current = 0, Tt.current = 0;
518
+ }, []), gt = S(() => {
519
+ N.current = { ...$e }, Pt(!1), lt.current?.reset(), at();
520
+ }, [at]), wt = S(
521
+ (o) => {
522
+ const g = N.current, M = _t.current;
523
+ if (!g.active || g.direction === 0) {
524
+ at();
525
525
  return;
526
526
  }
527
- if (!R.scrollBarVisible || R.maxScrollPosition <= 0) {
528
- _t();
527
+ if (!M.scrollBarVisible || M.maxScrollPosition <= 0) {
528
+ at();
529
529
  return;
530
530
  }
531
- const L = p.current ?? a, X = Math.max((a - L) / 1e3, 0), o = Math.min(X, ur);
532
- if (p.current = a, o <= 0) {
533
- G.current = window.requestAnimationFrame(Ut);
531
+ const L = T.current ?? o, H = Math.max((o - L) / 1e3, 0), St = Math.min(H, dr);
532
+ if (T.current = o, St <= 0) {
533
+ K.current = window.requestAnimationFrame(wt);
534
534
  return;
535
535
  }
536
- const u = gr({
537
- distance: b.distance,
538
- maxDistance: R.effectiveTapMaxDistance,
539
- viewportSize: R.viewportSize,
540
- minSpeedMultiplier: R.tapCircleMinSpeedMultiplier,
541
- maxSpeedMultiplier: R.tapCircleMaxSpeedMultiplier,
542
- hasCustomMaxSpeedMultiplier: typeof R.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
543
- curve: R.tapCircleMaxSpeedCurve
536
+ const l = br({
537
+ distance: g.distance,
538
+ maxDistance: M.effectiveTapMaxDistance,
539
+ viewportSize: M.viewportSize,
540
+ minSpeedMultiplier: M.tapCircleMinSpeedMultiplier,
541
+ maxSpeedMultiplier: M.tapCircleMaxSpeedMultiplier,
542
+ hasCustomMaxSpeedMultiplier: typeof M.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
543
+ curve: M.tapCircleMaxSpeedCurve
544
544
  });
545
- St.current !== b.direction && (St.current = b.direction, $.current = 0);
546
- const { reachedBoundary: m } = xt($, b.direction * u * o);
547
- if (m) {
548
- _t();
545
+ Tt.current !== g.direction && (Tt.current = g.direction, V.current = 0);
546
+ const { reachedBoundary: u } = w(V, g.direction * l * St);
547
+ if (u) {
548
+ at();
549
549
  return;
550
550
  }
551
- G.current = window.requestAnimationFrame(Ut);
551
+ K.current = window.requestAnimationFrame(wt);
552
552
  },
553
- [xt, _t]
554
- ), Ft = S(() => {
555
- G.current === null && (p.current = null, $.current = 0, G.current = window.requestAnimationFrame(Ut));
556
- }, [Ut]);
557
- Y(() => {
558
- const a = q.current;
559
- !a.active || a.direction === 0 || Ft();
560
- }, [n, t, Ft]), Y(() => () => {
561
- _t();
562
- }, [_t]);
563
- const ie = S(
564
- (a) => {
565
- q.current = a, Tt(a.active), a.active && a.direction !== 0 ? Ft() : _t();
553
+ [w, at]
554
+ ), Qt = S(() => {
555
+ K.current === null && (T.current = null, V.current = 0, K.current = window.requestAnimationFrame(wt));
556
+ }, [wt]);
557
+ q(() => {
558
+ const o = N.current;
559
+ !o.active || o.direction === 0 || Qt();
560
+ }, [n, t, Qt]), q(() => () => {
561
+ at();
562
+ }, [at]);
563
+ const Ht = S(
564
+ (o) => {
565
+ N.current = o, Pt(o.active), o.active && o.direction !== 0 ? Qt() : at();
566
566
  },
567
- [Ft, _t]
567
+ [Qt, at]
568
568
  );
569
- Y(() => {
570
- k || vt();
571
- }, [vt, k]), Y(() => {
572
- const a = (b) => {
573
- const L = b.detail?.paneId;
574
- L && I && L !== I || vt();
569
+ q(() => {
570
+ J || gt();
571
+ }, [gt, J]), q(() => {
572
+ const o = (g) => {
573
+ const L = g.detail?.paneId;
574
+ L && x && L !== x || gt();
575
575
  };
576
- return window.addEventListener(ze, a), () => {
577
- window.removeEventListener(ze, a);
576
+ return window.addEventListener(Ye, o), () => {
577
+ window.removeEventListener(Ye, o);
578
578
  };
579
- }, [I, vt]), Y(() => {
580
- if (!k)
579
+ }, [x, gt]), q(() => {
580
+ if (!J)
581
581
  return;
582
- const a = (b) => {
583
- if (!q.current.active || q.current.pointerId === b.pointerId)
582
+ const o = (g) => {
583
+ if (!N.current.active || N.current.pointerId === g.pointerId)
584
584
  return;
585
- const R = b.target;
586
- if (!(R instanceof Node)) {
587
- vt();
585
+ const M = g.target;
586
+ if (!(M instanceof Node)) {
587
+ gt();
588
588
  return;
589
589
  }
590
- et.current?.getElement()?.contains(R) || vt();
590
+ lt.current?.getElement()?.contains(M) || gt();
591
591
  };
592
- return document.addEventListener("pointerdown", a, !0), () => {
593
- document.removeEventListener("pointerdown", a, !0);
592
+ return document.addEventListener("pointerdown", o, !0), () => {
593
+ document.removeEventListener("pointerdown", o, !0);
594
594
  };
595
- }, [vt, k]);
596
- const xe = (a) => {
597
- if (!ct || Lt <= 0 || ot <= 0)
595
+ }, [gt, J]);
596
+ const Ut = (o) => {
597
+ if (!Nt || Q <= 0 || st <= 0)
598
598
  return 0;
599
- const b = It(a, 0, Lt);
600
- return It(b / Lt * ot, 0, ot);
601
- }, de = S((a) => {
602
- const { scrollBarVisible: b, effectiveTrackLength: R, maxScrollPosition: L } = at.current;
603
- if (C.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: a, trackLen: R, maxScroll: L })), R <= 0 || L <= 0)
599
+ const g = vt(o, 0, Q);
600
+ return vt(g / Q * st, 0, st);
601
+ }, te = S((o) => {
602
+ const { scrollBarVisible: g, effectiveTrackLength: M, maxScrollPosition: L } = _t.current;
603
+ if (C.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: o, trackLen: M, maxScroll: L })), M <= 0 || L <= 0)
604
604
  return null;
605
- const X = It(a, 0, R);
606
- return It(X / R * L, 0, L);
607
- }, []), Ie = S(
608
- (a) => {
609
- const b = a.getBoundingClientRect(), R = c ? b.width : b.height, L = (V) => {
610
- const A = Number.parseFloat(V);
611
- return Number.isFinite(A) ? A : 0;
612
- }, X = window.getComputedStyle(a), o = L(c ? X.width : X.height), u = o > 0 ? o + L(c ? X.paddingLeft : X.paddingTop) + L(c ? X.paddingRight : X.paddingBottom) + L(c ? X.borderLeftWidth : X.borderTopWidth) + L(c ? X.borderRightWidth : X.borderBottomWidth) : 0, m = u > 0 ? u : c ? a.offsetWidth : a.offsetHeight;
613
- return m <= 0 || R <= 0 ? 1 : R / m;
605
+ const H = vt(o, 0, M);
606
+ return vt(H / M * L, 0, L);
607
+ }, []), ce = S(
608
+ (o) => {
609
+ const g = o.getBoundingClientRect(), M = c ? g.width : g.height, L = (h) => {
610
+ const R = Number.parseFloat(h);
611
+ return Number.isFinite(R) ? R : 0;
612
+ }, H = window.getComputedStyle(o), St = L(c ? H.width : H.height), l = St > 0 ? St + L(c ? H.paddingLeft : H.paddingTop) + L(c ? H.paddingRight : H.paddingBottom) + L(c ? H.borderLeftWidth : H.borderTopWidth) + L(c ? H.borderRightWidth : H.borderBottomWidth) : 0, u = l > 0 ? l : c ? o.offsetWidth : o.offsetHeight;
613
+ return u <= 0 || M <= 0 ? 1 : M / u;
614
614
  },
615
615
  [c]
616
- ), nt = S(
617
- (a) => {
618
- const b = O.current;
619
- if (b.pointerId !== a.pointerId)
616
+ ), ue = S(
617
+ (o) => {
618
+ const g = k.current;
619
+ if (g.pointerId !== o.pointerId)
620
620
  return;
621
- const R = a.clientX - b.startClientX, L = a.clientY - b.startClientY, X = lt(R, L) / (b.scale || 1);
621
+ const M = o.clientX - g.startClientX, L = o.clientY - g.startClientY, H = p(M, L) / (g.scale || 1);
622
622
  C.debug("[ScrollBar] handleThumbPointerMove", () => ({
623
- delta: X,
624
- startThumbPosition: b.startThumbPosition,
625
- clientY: a.clientY,
626
- startClientY: b.startClientY,
627
- metrics: at.current
623
+ delta: H,
624
+ startThumbPosition: g.startThumbPosition,
625
+ clientY: o.clientY,
626
+ startClientY: g.startClientY,
627
+ metrics: _t.current
628
628
  }));
629
- const o = de(b.startThumbPosition + X);
630
- o !== null && bt(o), a.cancelable && a.preventDefault();
629
+ const St = te(g.startThumbPosition + H);
630
+ St !== null && Vt(St), o.cancelable && o.preventDefault();
631
631
  },
632
- [lt, de, bt]
633
- ), zt = S(
634
- (a) => {
635
- const b = O.current;
636
- if (b.pointerId !== a.pointerId)
632
+ [p, te, Vt]
633
+ ), tt = S(
634
+ (o) => {
635
+ const g = k.current;
636
+ if (g.pointerId !== o.pointerId)
637
637
  return;
638
- document.removeEventListener("pointermove", nt), document.removeEventListener("pointerup", zt), document.removeEventListener("pointercancel", zt);
639
- const R = b.captureTarget;
640
- if (R?.hasPointerCapture?.(a.pointerId) && R.releasePointerCapture(a.pointerId), O.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ut(!1), D.current) {
638
+ document.removeEventListener("pointermove", ue), document.removeEventListener("pointerup", tt), document.removeEventListener("pointercancel", tt);
639
+ const M = g.captureTarget;
640
+ if (M?.hasPointerCapture?.(o.pointerId) && M.releasePointerCapture(o.pointerId), k.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ut(!1), D.current) {
641
641
  const L = D.current.getBoundingClientRect();
642
- a.clientX >= L.left && a.clientX <= L.right && a.clientY >= L.top && a.clientY <= L.bottom || tt(!1);
642
+ o.clientX >= L.left && o.clientX <= L.right && o.clientY >= L.top && o.clientY <= L.bottom || nt(!1);
643
643
  } else
644
- tt(!1);
644
+ nt(!1);
645
645
  },
646
- [nt]
646
+ [ue]
647
647
  );
648
- Y(() => () => {
649
- document.removeEventListener("pointermove", nt), document.removeEventListener("pointerup", zt), document.removeEventListener("pointercancel", zt);
650
- }, [nt, zt]);
651
- const Te = T(0), ve = T(0), Wt = S(
652
- (a) => {
653
- const b = Math.max(Math.round(at.current.viewportSize / or), sr);
654
- ve.current !== a && (ve.current = a, Te.current = 0), xt(Te, a * b);
648
+ q(() => () => {
649
+ document.removeEventListener("pointermove", ue), document.removeEventListener("pointerup", tt), document.removeEventListener("pointercancel", tt);
650
+ }, [ue, tt]);
651
+ const ee = I(0), Se = I(0), we = S(
652
+ (o) => {
653
+ const g = Math.max(Math.round(_t.current.viewportSize / ar), or);
654
+ Se.current !== o && (Se.current = o, ee.current = 0), w(ee, o * g);
655
655
  },
656
- [xt]
657
- ), { handleArrowPointerDown: ye, handleArrowPointerUp: fe, handleArrowKeyDown: Ae } = pr({
658
- canUseArrowButtons: g,
659
- enableArrowButtons: l,
660
- resetTapScroll: vt,
661
- scrollByStep: Wt
662
- }), te = (a) => {
663
- if (!ct)
656
+ [w]
657
+ ), { handleArrowPointerDown: Wt, handleArrowPointerUp: ge, handleArrowKeyDown: Re } = hr({
658
+ canUseArrowButtons: $t,
659
+ enableArrowButtons: a,
660
+ resetTapScroll: gt,
661
+ scrollByStep: we
662
+ }), De = (o) => {
663
+ if (!Nt)
664
664
  return;
665
665
  if (!i) {
666
- a.preventDefault(), a.stopPropagation();
666
+ o.preventDefault(), o.stopPropagation();
667
667
  return;
668
668
  }
669
- if (a.pointerType === "mouse" && a.button !== 0 || a.ctrlKey)
669
+ if (o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey)
670
670
  return;
671
- vt();
672
- const b = a.currentTarget, R = Ie(b);
671
+ gt();
672
+ const g = o.currentTarget, M = ce(g);
673
673
  let L = null;
674
- if (b.setPointerCapture)
674
+ if (g.setPointerCapture)
675
675
  try {
676
- b.setPointerCapture(a.pointerId), L = b;
676
+ g.setPointerCapture(o.pointerId), L = g;
677
677
  } catch {
678
678
  L = null;
679
679
  }
680
- O.current = {
681
- pointerId: a.pointerId,
682
- startThumbPosition: $t,
683
- startClientX: a.clientX,
684
- startClientY: a.clientY,
685
- scale: R,
680
+ k.current = {
681
+ pointerId: o.pointerId,
682
+ startThumbPosition: qt,
683
+ startClientX: o.clientX,
684
+ startClientY: o.clientY,
685
+ scale: M,
686
686
  captureTarget: L
687
- }, document.addEventListener("pointermove", nt), document.addEventListener("pointerup", zt), document.addEventListener("pointercancel", zt), ut(!0), tt(!0), a.preventDefault(), a.stopPropagation();
688
- }, se = (a) => {
689
- if (!ct)
687
+ }, document.addEventListener("pointermove", ue), document.addEventListener("pointerup", tt), document.addEventListener("pointercancel", tt), ut(!0), nt(!0), o.preventDefault(), o.stopPropagation();
688
+ }, re = (o) => {
689
+ if (!Nt)
690
690
  return;
691
691
  if (!s) {
692
- a.preventDefault(), a.stopPropagation();
692
+ o.preventDefault(), o.stopPropagation();
693
693
  return;
694
694
  }
695
- if (a.pointerType === "mouse" && a.button !== 0 || a.ctrlKey)
695
+ if (o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey)
696
696
  return;
697
- const b = a.currentTarget, R = b.getBoundingClientRect(), L = H(a), X = Ie(b), o = (L - (c ? R.left : R.top)) / X;
698
- vt();
699
- const u = o - ft / 2, m = xe(u);
700
- if (bt(m), b.setPointerCapture)
697
+ const g = o.currentTarget, M = g.getBoundingClientRect(), L = ft(o), H = ce(g), St = (L - (c ? M.left : M.top)) / H;
698
+ gt();
699
+ const l = St - ht / 2, u = Ut(l);
700
+ if (Vt(u), g.setPointerCapture)
701
701
  try {
702
- b.setPointerCapture(a.pointerId);
702
+ g.setPointerCapture(o.pointerId);
703
703
  } catch {
704
704
  }
705
705
  P.current = {
706
- pointerId: a.pointerId,
707
- startThumbPosition: u,
708
- startClientX: a.clientX,
709
- startClientY: a.clientY,
710
- scale: X
711
- }, a.preventDefault(), a.stopPropagation();
712
- }, Kt = () => {
706
+ pointerId: o.pointerId,
707
+ startThumbPosition: l,
708
+ startClientX: o.clientX,
709
+ startClientY: o.clientY,
710
+ scale: H
711
+ }, o.preventDefault(), o.stopPropagation();
712
+ }, jt = () => {
713
713
  P.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
714
- }, ee = (a) => {
715
- const b = P.current;
716
- if (b.pointerId !== a.pointerId)
714
+ }, ne = (o) => {
715
+ const g = P.current;
716
+ if (g.pointerId !== o.pointerId)
717
717
  return;
718
- if (a.pointerType === "mouse" && a.buttons === 0) {
719
- Kt();
718
+ if (o.pointerType === "mouse" && o.buttons === 0) {
719
+ jt();
720
720
  return;
721
721
  }
722
- const R = a.clientX - b.startClientX, L = a.clientY - b.startClientY, X = lt(R, L) / (b.scale || 1), o = xe(b.startThumbPosition + X);
723
- bt(o), a.cancelable && a.preventDefault();
724
- }, oe = (a) => {
725
- if (P.current.pointerId !== a.pointerId)
722
+ const M = o.clientX - g.startClientX, L = o.clientY - g.startClientY, H = p(M, L) / (g.scale || 1), St = Ut(g.startThumbPosition + H);
723
+ Vt(St), o.cancelable && o.preventDefault();
724
+ }, ie = (o) => {
725
+ if (P.current.pointerId !== o.pointerId)
726
726
  return;
727
- const b = a.currentTarget;
728
- b.hasPointerCapture?.(a.pointerId) && b.releasePointerCapture(a.pointerId), Kt(), a.preventDefault(), a.stopPropagation();
729
- }, me = (a) => {
730
- if (P.current.pointerId !== a.pointerId)
727
+ const g = o.currentTarget;
728
+ g.hasPointerCapture?.(o.pointerId) && g.releasePointerCapture(o.pointerId), jt(), o.preventDefault(), o.stopPropagation();
729
+ }, de = (o) => {
730
+ if (P.current.pointerId !== o.pointerId)
731
731
  return;
732
- const b = a.currentTarget;
733
- b.hasPointerCapture?.(a.pointerId) && b.releasePointerCapture(a.pointerId), Kt();
734
- }, re = (a) => {
735
- P.current.pointerId === a.pointerId && Kt();
736
- }, we = At(() => It((mt ? 1 : 0.8) * Xt, 0, 1), [mt, Xt]), Re = At(() => {
737
- const b = `calc(50% - ${Ct / 2}px + ${Et}px)`;
732
+ const g = o.currentTarget;
733
+ g.hasPointerCapture?.(o.pointerId) && g.releasePointerCapture(o.pointerId), jt();
734
+ }, be = (o) => {
735
+ o.target === o.currentTarget && P.current.pointerId === o.pointerId && jt();
736
+ }, se = Lt(() => vt((pt ? 1 : 0.8) * A, 0, 1), [pt, A]), Ce = Lt(() => {
737
+ const g = `calc(50% - ${F / 2}px + ${W}px)`;
738
738
  return {
739
- left: U,
740
- top: b
739
+ left: Ct,
740
+ top: g
741
741
  };
742
- }, [U, Et, Ct]), Ce = (a, b, R, L) => /* @__PURE__ */ st(
742
+ }, [Ct, W, F]), ve = (o, g, M, L) => /* @__PURE__ */ ot(
743
743
  "button",
744
744
  {
745
745
  type: "button",
746
746
  tabIndex: 0,
747
747
  className: "aqvs-scrollbar-arrow-button",
748
748
  style: {
749
- [jt]: d,
750
- [f]: d
749
+ [Et]: d,
750
+ [Xt]: d
751
751
  },
752
- "aria-label": b,
753
- onPointerDown: ye(a),
754
- onPointerUp: fe,
755
- onPointerLeave: fe,
756
- onPointerCancel: fe,
757
- onKeyDown: Ae(a),
758
- "aria-disabled": !l,
759
- disabled: !g,
760
- children: /* @__PURE__ */ st("span", { "aria-hidden": "true", children: R })
752
+ "aria-label": g,
753
+ onPointerDown: Wt(o),
754
+ onPointerUp: ge,
755
+ onPointerLeave: ge,
756
+ onPointerCancel: ge,
757
+ onKeyDown: Re(o),
758
+ "aria-disabled": !a,
759
+ disabled: !$t,
760
+ children: /* @__PURE__ */ ot("span", { "aria-hidden": "true", children: M })
761
761
  },
762
762
  L
763
- ), pe = h && ct ? {
764
- orientation: wt,
763
+ ), Ee = m && Nt ? {
764
+ orientation: ct,
765
765
  scrollPosition: e,
766
- maxScrollPosition: ot,
766
+ maxScrollPosition: st,
767
767
  contentSize: n,
768
768
  viewportSize: t,
769
- thumbSize: ft,
770
- thumbPosition: $t,
771
- thumbCenter: Qt,
772
- trackSize: Dt,
773
- isDragging: j,
774
- isTapScrollActive: mt,
769
+ thumbSize: ht,
770
+ thumbPosition: qt,
771
+ thumbCenter: le,
772
+ trackSize: Mt,
773
+ isDragging: Z,
774
+ isTapScrollActive: pt,
775
775
  visibleStartIndex: _,
776
- visibleEndIndex: z
776
+ visibleEndIndex: B
777
777
  } : null;
778
- return /* @__PURE__ */ ue(
778
+ return /* @__PURE__ */ he(
779
779
  "div",
780
780
  {
781
- className: ce("aqvs-scrollbar", yt, !ct && "pointer-events-none opacity-0", x),
781
+ className: pe("aqvs-scrollbar", et, !Nt && "pointer-events-none opacity-0", b),
782
782
  style: {
783
- [jt]: t,
784
- [f]: d
783
+ [Et]: t,
784
+ [Xt]: d
785
785
  },
786
786
  role: "scrollbar",
787
787
  tabIndex: -1,
788
- "aria-controls": I,
788
+ "aria-controls": x,
789
789
  "aria-valuenow": e,
790
790
  "aria-valuemin": 0,
791
- "aria-valuemax": ot,
791
+ "aria-valuemax": st,
792
792
  "aria-orientation": c ? "horizontal" : "vertical",
793
793
  children: [
794
- !c && ct && k && /* @__PURE__ */ st(
795
- Ge,
794
+ !c && Nt && J && /* @__PURE__ */ ot(
795
+ Ze,
796
796
  {
797
- ref: et,
798
- className: ce("aqvs-scrollbar-tap-circle-wrapper", y),
799
- size: Ct,
800
- maxVisualDistance: Nt,
801
- style: Re,
802
- opacity: we,
803
- renderVisual: Bt,
804
- onDragChange: ie
797
+ ref: lt,
798
+ className: pe("aqvs-scrollbar-tap-circle-wrapper", At),
799
+ size: F,
800
+ maxVisualDistance: kt,
801
+ style: Ce,
802
+ opacity: se,
803
+ renderVisual: j,
804
+ onDragChange: Ht
805
805
  },
806
806
  "tap-circle"
807
807
  ),
808
- Ce(-1, it[0], J[0], "arrow-start"),
809
- /* @__PURE__ */ ue(
808
+ ve(-1, mt[0], z[0], "arrow-start"),
809
+ /* @__PURE__ */ he(
810
810
  "div",
811
811
  {
812
812
  className: "aqvs-scrollbar-track",
813
813
  style: {
814
814
  borderRadius: d / 2
815
815
  },
816
- onPointerDown: se,
817
- onPointerMove: ee,
818
- onPointerUp: oe,
819
- onPointerCancel: me,
820
- onLostPointerCapture: re,
816
+ onPointerDown: re,
817
+ onPointerMove: ne,
818
+ onPointerUp: ie,
819
+ onPointerCancel: de,
820
+ onLostPointerCapture: be,
821
821
  "aria-disabled": !s,
822
822
  children: [
823
- pe && /* @__PURE__ */ st("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: h?.(pe) }, "overlay"),
824
- /* @__PURE__ */ st(
823
+ Ee && /* @__PURE__ */ ot("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: m?.(Ee) }, "overlay"),
824
+ /* @__PURE__ */ ot(
825
825
  "div",
826
826
  {
827
- className: ce("aqvs-scrollbar-thumb-wrapper", !(ct || j) && "pointer-events-none opacity-0"),
827
+ className: pe("aqvs-scrollbar-thumb-wrapper", !(Nt || Z) && "pointer-events-none opacity-0"),
828
828
  style: {
829
- [jt]: ft,
830
- [dt]: $t,
829
+ [Et]: ht,
830
+ [dt]: qt,
831
831
  ...c ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
832
832
  },
833
- onPointerDown: te,
833
+ onPointerDown: De,
834
834
  role: "slider",
835
835
  "aria-orientation": c ? "horizontal" : "vertical",
836
836
  "aria-valuenow": e,
837
837
  "aria-valuemin": 0,
838
- "aria-valuemax": ot,
838
+ "aria-valuemax": st,
839
839
  "aria-disabled": !i,
840
840
  tabIndex: -1,
841
- children: /* @__PURE__ */ st(
841
+ children: /* @__PURE__ */ ot(
842
842
  "div",
843
843
  {
844
844
  ref: D,
845
- className: ce("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
845
+ className: pe("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
846
846
  "data-testid": "aqvs-scrollbar-thumb",
847
- "data-thumb-state": w,
847
+ "data-thumb-state": Gt,
848
848
  style: {
849
849
  borderRadius: d - 1,
850
850
  cursor: i ? "pointer" : "default"
851
851
  },
852
852
  onMouseEnter: () => {
853
- i && tt(!0);
853
+ i && nt(!0);
854
854
  },
855
855
  onMouseLeave: () => {
856
- i && tt(!1);
856
+ i && nt(!1);
857
857
  }
858
858
  },
859
859
  "thumb"
@@ -865,20 +865,20 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
865
865
  },
866
866
  "track"
867
867
  ),
868
- Ce(1, it[1], J[1], "arrow-end")
868
+ ve(1, mt[1], z[1], "arrow-end")
869
869
  ]
870
870
  }
871
871
  );
872
- }, Ir = ["mouse", "pen", "touch"], ke = (n, t) => !(n === "mouse" || n === "pen" || n === "touch") || t.includes(n), Me = {
872
+ }, Tr = ["mouse", "pen", "touch"], Oe = (n, t) => !(n === "mouse" || n === "pen" || n === "touch") || t.includes(n), Sr = (n) => n === "mouse" || n === "pen", Me = {
873
873
  maxVelocity: 6,
874
874
  minVelocity: 0.02,
875
875
  deceleration: 25e-4,
876
876
  velocitySampleWindow: 90,
877
877
  startVelocityThreshold: 0.04
878
- }, Ee = (n, t, e) => {
878
+ }, Ne = (n, t, e) => {
879
879
  for (const [r, i, s] of t)
880
880
  e === "add" ? n.addEventListener(r, i, s) : n.removeEventListener(r, i, s);
881
- }, Tr = Ye(
881
+ }, vr = Be(
882
882
  ({
883
883
  children: n,
884
884
  contentSize: t,
@@ -886,180 +886,181 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
886
886
  scrollBarWidth: r = 12,
887
887
  enableThumbDrag: i = !0,
888
888
  enableTrackClick: s = !0,
889
- enableArrowButtons: l = !0,
889
+ enableArrowButtons: a = !0,
890
890
  enablePointerDrag: c = !0,
891
- pointerDragInputs: d = Ir,
892
- onScroll: x,
893
- className: I,
894
- testId: M,
891
+ pointerDragInputs: d = Tr,
892
+ onScroll: b,
893
+ className: x,
894
+ testId: v,
895
895
  style: E,
896
- background: h,
896
+ background: m,
897
897
  tapScrollCircleOptions: _,
898
- inertiaOptions: z,
899
- itemCount: j,
898
+ inertiaOptions: B,
899
+ itemCount: Z,
900
900
  renderThumbOverlay: ut,
901
- wheelSpeedMultiplier: Q = 1,
902
- onWheelHorizontal: tt,
903
- contentInsets: mt,
904
- visibleStartIndex: Tt,
901
+ wheelSpeedMultiplier: rt = 1,
902
+ onWheelHorizontal: nt,
903
+ contentInsets: pt,
904
+ visibleStartIndex: Pt,
905
905
  visibleEndIndex: D,
906
- renderOverlay: O,
907
- initialScrollPosition: P = 0
908
- }, B) => {
909
- const N = T(Number.isFinite(P) ? Math.max(0, P) : 0), q = T(null), et = T(null), G = T(tt);
910
- Y(() => {
911
- G.current = tt;
912
- }, [tt]);
913
- const p = T({
906
+ renderOverlay: k,
907
+ initialScrollPosition: P = 0,
908
+ contentProps: X
909
+ }, $) => {
910
+ const N = I(Number.isFinite(P) ? Math.max(0, P) : 0), lt = I(null), K = I(null), T = I(nt);
911
+ q(() => {
912
+ T.current = nt;
913
+ }, [nt]);
914
+ const V = I({
914
915
  frame: null,
915
916
  velocity: 0,
916
917
  lastTimestamp: null,
917
918
  generation: 0
918
- }), $ = At(
919
+ }), Tt = Lt(
919
920
  () => ({
920
- maxVelocity: z?.maxVelocity ?? Me.maxVelocity,
921
- minVelocity: z?.minVelocity ?? Me.minVelocity,
922
- deceleration: z?.deceleration ?? Me.deceleration,
923
- velocitySampleWindow: z?.velocitySampleWindow ?? Me.velocitySampleWindow,
924
- startVelocityThreshold: z?.startVelocityThreshold ?? Me.startVelocityThreshold
921
+ maxVelocity: B?.maxVelocity ?? Me.maxVelocity,
922
+ minVelocity: B?.minVelocity ?? Me.minVelocity,
923
+ deceleration: B?.deceleration ?? Me.deceleration,
924
+ velocitySampleWindow: B?.velocitySampleWindow ?? Me.velocitySampleWindow,
925
+ startVelocityThreshold: B?.startVelocityThreshold ?? Me.startVelocityThreshold
925
926
  }),
926
- [z]
927
- ), St = At(() => ({
928
- top: Math.max(0, mt?.top ?? 0),
929
- bottom: Math.max(0, mt?.bottom ?? 0)
930
- }), [mt]);
927
+ [B]
928
+ ), Yt = Lt(() => ({
929
+ top: Math.max(0, pt?.top ?? 0),
930
+ bottom: Math.max(0, pt?.bottom ?? 0)
931
+ }), [pt]);
931
932
  C.debug("[ScrollPane] ScrollPane rendered", () => ({
932
933
  contentSize: t,
933
934
  viewportSize: e,
934
935
  scrollBarWidth: r,
935
- className: I,
936
+ className: x,
936
937
  style: E,
937
938
  tapScrollCircleOptions: _,
938
- inertiaOptions: z,
939
+ inertiaOptions: B,
939
940
  enablePointerDrag: c,
940
- contentInsets: St
941
+ contentInsets: Yt
941
942
  }));
942
- const Rt = T({ contentSize: t, viewportSize: e });
943
- Rt.current = { contentSize: t, viewportSize: e };
944
- const Z = At(() => t > e, [t, e]), k = S(
945
- (f) => {
946
- const { contentSize: dt, viewportSize: lt } = Rt.current, H = dt > lt, it = N.current;
947
- if (C.debug("[ScrollPane] scrollTo called", () => ({ newPosition: f, contentSize: dt, viewportSize: lt, currentIsScrollable: H, prevPosition: it })), !H)
948
- return N.current !== 0 && (N.current = 0, x?.(0, it)), N.current;
949
- const J = typeof f == "function" ? f(N.current) : f;
950
- if (!Number.isFinite(J))
951
- return C.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: J }), N.current;
952
- const yt = Math.max(dt - lt, 0), wt = It(J, 0, yt);
953
- return N.current !== wt && (N.current = wt, x?.(wt, it)), N.current;
943
+ const yt = I({ contentSize: t, viewportSize: e });
944
+ yt.current = { contentSize: t, viewportSize: e };
945
+ const J = Lt(() => t > e, [t, e]), F = S(
946
+ (p) => {
947
+ const { contentSize: ft, viewportSize: mt } = yt.current, z = ft > mt, et = N.current;
948
+ if (C.debug("[ScrollPane] scrollTo called", () => ({ newPosition: p, contentSize: ft, viewportSize: mt, currentIsScrollable: z, prevPosition: et })), !z)
949
+ return N.current !== 0 && (N.current = 0, b?.(0, et)), N.current;
950
+ const ct = typeof p == "function" ? p(N.current) : p;
951
+ if (!Number.isFinite(ct))
952
+ return C.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: ct }), N.current;
953
+ const kt = Math.max(ft - mt, 0), Ot = vt(ct, 0, kt);
954
+ return N.current !== Ot && (N.current = Ot, b?.(Ot, et)), N.current;
954
955
  },
955
- [x]
956
- ), Ct = T(k);
957
- Y(() => {
958
- Ct.current = k;
959
- }, [k]);
960
- const U = S(() => {
961
- const f = p.current;
962
- f.generation += 1, f.frame !== null && cancelAnimationFrame(f.frame), f.frame = null, f.velocity = 0, f.lastTimestamp = null;
963
- }, []), Et = T(U);
964
- Y(() => {
965
- Et.current = U;
966
- }, [U]), Y(() => () => {
967
- Et.current();
956
+ [b]
957
+ ), Ct = I(F);
958
+ q(() => {
959
+ Ct.current = F;
960
+ }, [F]);
961
+ const W = S(() => {
962
+ const p = V.current;
963
+ p.generation += 1, p.frame !== null && cancelAnimationFrame(p.frame), p.frame = null, p.velocity = 0, p.lastTimestamp = null;
964
+ }, []), At = I(W);
965
+ q(() => {
966
+ At.current = W;
967
+ }, [W]), q(() => () => {
968
+ At.current();
968
969
  }, []);
969
970
  const y = S(
970
- (f) => {
971
- if (!Z)
971
+ (p) => {
972
+ if (!J)
972
973
  return;
973
- const { maxVelocity: dt, minVelocity: lt, deceleration: H, startVelocityThreshold: it } = $, J = It(f, -dt, dt);
974
- if (Math.abs(J) < it)
974
+ const { maxVelocity: ft, minVelocity: mt, deceleration: z, startVelocityThreshold: et } = Tt, ct = vt(p, -ft, ft);
975
+ if (Math.abs(ct) < et)
975
976
  return;
976
- U(), p.current.velocity = J, p.current.lastTimestamp = null;
977
- const yt = p.current.generation, wt = (Nt) => {
978
- const rt = p.current;
979
- if (rt.generation !== yt)
977
+ W(), V.current.velocity = ct, V.current.lastTimestamp = null;
978
+ const kt = V.current.generation, Ot = (Mt) => {
979
+ const it = V.current;
980
+ if (it.generation !== kt)
980
981
  return;
981
- if (rt.lastTimestamp === null) {
982
- rt.lastTimestamp = Nt, rt.frame = requestAnimationFrame(wt);
982
+ if (it.lastTimestamp === null) {
983
+ it.lastTimestamp = Mt, it.frame = requestAnimationFrame(Ot);
983
984
  return;
984
985
  }
985
- const Dt = Nt - rt.lastTimestamp;
986
- if (rt.lastTimestamp = Nt, Dt <= 0) {
987
- rt.frame = requestAnimationFrame(wt);
986
+ const ht = Mt - it.lastTimestamp;
987
+ if (it.lastTimestamp = Mt, ht <= 0) {
988
+ it.frame = requestAnimationFrame(Ot);
988
989
  return;
989
990
  }
990
- const Mt = rt.velocity;
991
- let ft = Mt;
992
- const ot = H * Dt;
993
- Mt > 0 ? ft = Math.max(0, Mt - ot) : Mt < 0 && (ft = Math.min(0, Mt + ot));
994
- const $t = (Mt + ft) / 2 * Dt, Qt = N.current;
995
- if ($t !== 0 && Ct.current((xt) => xt + $t), p.current.generation !== yt)
991
+ const st = it.velocity;
992
+ let Q = st;
993
+ const qt = z * ht;
994
+ st > 0 ? Q = Math.max(0, st - qt) : st < 0 && (Q = Math.min(0, st + qt));
995
+ const Nt = (st + Q) / 2 * ht, $t = N.current;
996
+ if (Nt !== 0 && Ct.current((gt) => gt + Nt), V.current.generation !== kt)
996
997
  return;
997
- const ct = N.current, { contentSize: g, viewportSize: w } = Rt.current, bt = Math.max(g - w, 0);
998
- rt.velocity = ft;
999
- const qt = ct === Qt || ct <= 0 && ft <= 0 || ct >= bt && ft >= 0;
1000
- if (Math.abs(ft) < lt || qt) {
1001
- U();
998
+ const Gt = N.current, { contentSize: Vt, viewportSize: f } = yt.current, w = Math.max(Vt - f, 0);
999
+ it.velocity = Q;
1000
+ const at = Gt === $t || Gt <= 0 && Q <= 0 || Gt >= w && Q >= 0;
1001
+ if (Math.abs(Q) < mt || at) {
1002
+ W();
1002
1003
  return;
1003
1004
  }
1004
- rt.frame = requestAnimationFrame(wt);
1005
+ it.frame = requestAnimationFrame(Ot);
1005
1006
  };
1006
- p.current.frame = requestAnimationFrame(wt);
1007
+ V.current.frame = requestAnimationFrame(Ot);
1007
1008
  },
1008
- [Z, $, U]
1009
- ), Yt = T(y);
1010
- Y(() => {
1011
- Yt.current = y;
1012
- }, [y]), be(() => {
1013
- Rt.current = { contentSize: t, viewportSize: e };
1014
- }, [t, e]), be(() => {
1015
- const f = et.current;
1016
- if (!f) return;
1017
- const dt = () => {
1018
- f.scrollTop !== 0 && (C.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: f.scrollTop })), f.scrollTop = 0), f.scrollLeft !== 0 && (f.scrollLeft = 0);
1009
+ [J, Tt, W]
1010
+ ), Kt = I(y);
1011
+ q(() => {
1012
+ Kt.current = y;
1013
+ }, [y]), Te(() => {
1014
+ yt.current = { contentSize: t, viewportSize: e };
1015
+ }, [t, e]), Te(() => {
1016
+ const p = K.current;
1017
+ if (!p) return;
1018
+ const ft = () => {
1019
+ p.scrollTop !== 0 && (C.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: p.scrollTop })), p.scrollTop = 0), p.scrollLeft !== 0 && (p.scrollLeft = 0);
1019
1020
  };
1020
- return f.addEventListener("scroll", dt), () => f.removeEventListener("scroll", dt);
1021
- }, []), be(() => {
1022
- if (Z) {
1021
+ return p.addEventListener("scroll", ft), () => p.removeEventListener("scroll", ft);
1022
+ }, []), Te(() => {
1023
+ if (J) {
1023
1024
  C.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: t, viewportSize: e, scrollPosition: N.current }));
1024
- const f = It(t - e, 0, t);
1025
- N.current > f && k(f);
1025
+ const p = vt(t - e, 0, t);
1026
+ N.current > p && F(p);
1026
1027
  } else
1027
- k(0);
1028
- }, [Z, k, t, e]), Y(() => {
1029
- const f = (H) => {
1030
- if (H.ctrlKey)
1028
+ F(0);
1029
+ }, [J, F, t, e]), q(() => {
1030
+ const p = (z) => {
1031
+ if (z.ctrlKey)
1031
1032
  return;
1032
- const it = H.shiftKey && H.deltaX === 0, J = it ? H.deltaY : H.deltaX, yt = it ? 0 : H.deltaY;
1033
- if (J !== 0 && Math.abs(J) >= Math.abs(yt)) {
1034
- if (G.current) {
1035
- H.preventDefault(), U();
1036
- let rt = J;
1037
- H.deltaMode === 1 ? rt *= 16 : H.deltaMode === 2 && (rt *= e), G.current(rt);
1033
+ const et = z.shiftKey && z.deltaX === 0, ct = et ? z.deltaY : z.deltaX, kt = et ? 0 : z.deltaY;
1034
+ if (ct !== 0 && Math.abs(ct) >= Math.abs(kt)) {
1035
+ if (T.current) {
1036
+ z.preventDefault(), W();
1037
+ let it = ct;
1038
+ z.deltaMode === 1 ? it *= 16 : z.deltaMode === 2 && (it *= e), T.current(it);
1038
1039
  }
1039
1040
  return;
1040
1041
  }
1041
- if (!Z || H.deltaY === 0)
1042
+ if (!J || z.deltaY === 0)
1042
1043
  return;
1043
- H.preventDefault(), U();
1044
- let Nt = H.deltaY;
1045
- H.deltaMode === 1 ? Nt *= 16 : H.deltaMode === 2 && (Nt *= e), Q !== 1 && (Nt *= Q), C.debug("[ScrollPane] wheel event", () => ({ deltaY: Nt, scrollPosition: N.current, wheelSpeedMultiplier: Q, deltaMode: H.deltaMode, scrollTop: et.current?.scrollTop })), k((rt) => rt + Nt);
1046
- }, dt = () => {
1047
- U();
1048
- }, lt = q.current;
1049
- return lt && (lt.addEventListener("wheel", f, { passive: !1 }), lt.addEventListener("pointerdown", dt, { capture: !0, passive: !0 })), () => {
1050
- lt && (lt.removeEventListener("wheel", f), lt.removeEventListener("pointerdown", dt, { capture: !0 }));
1044
+ z.preventDefault(), W();
1045
+ let Mt = z.deltaY;
1046
+ z.deltaMode === 1 ? Mt *= 16 : z.deltaMode === 2 && (Mt *= e), rt !== 1 && (Mt *= rt), C.debug("[ScrollPane] wheel event", () => ({ deltaY: Mt, scrollPosition: N.current, wheelSpeedMultiplier: rt, deltaMode: z.deltaMode, scrollTop: K.current?.scrollTop })), F((it) => it + Mt);
1047
+ }, ft = () => {
1048
+ W();
1049
+ }, mt = lt.current;
1050
+ return mt && (mt.addEventListener("wheel", p, { passive: !1 }), mt.addEventListener("pointerdown", ft, { capture: !0, passive: !0 })), () => {
1051
+ mt && (mt.removeEventListener("wheel", p), mt.removeEventListener("pointerdown", ft, { capture: !0 }));
1051
1052
  };
1052
- }, [Z, k, U, e, Q]), Be(
1053
- B,
1053
+ }, [J, F, W, e, rt]), qe(
1054
+ $,
1054
1055
  () => ({
1055
- scrollTo: (f) => (U(), k(f)),
1056
+ scrollTo: (p) => (W(), F(p)),
1056
1057
  getScrollPosition: () => N.current,
1057
1058
  getContentSize: () => t,
1058
1059
  getViewportSize: () => e
1059
1060
  }),
1060
- [k, t, e, U]
1061
+ [F, t, e, W]
1061
1062
  );
1062
- const Ht = tr(), v = T({
1063
+ const ae = er(), A = X?.id ?? ae, j = I({
1063
1064
  pointerType: "",
1064
1065
  pointerId: null,
1065
1066
  startClientY: 0,
@@ -1068,241 +1069,256 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
1068
1069
  shouldCancelNextClick: !1,
1069
1070
  clickResetTimer: null,
1070
1071
  velocitySamples: []
1071
- }), Xt = T(c), Bt = T(d);
1072
- Y(() => {
1073
- Xt.current = c;
1074
- }, [c]), Y(() => {
1075
- Bt.current = d;
1072
+ }), Bt = I(c), _t = I(d);
1073
+ q(() => {
1074
+ Bt.current = c;
1075
+ }, [c]), q(() => {
1076
+ _t.current = d;
1076
1077
  }, [d]);
1077
- const Jt = T(Z);
1078
- Y(() => {
1079
- Jt.current = Z;
1080
- }, [Z]);
1081
- const at = T($);
1082
- Y(() => {
1083
- at.current = $;
1084
- }, [$]), Y(() => {
1085
- const f = v.current;
1086
- if (c && Z && (f.pointerId === null || ke(f.pointerType, d)) || f.pointerId === null)
1078
+ const Et = I(J);
1079
+ q(() => {
1080
+ Et.current = J;
1081
+ }, [J]);
1082
+ const Xt = I(Tt);
1083
+ q(() => {
1084
+ Xt.current = Tt;
1085
+ }, [Tt]), q(() => {
1086
+ const p = j.current;
1087
+ if (c && J && (p.pointerId === null || Oe(p.pointerType, d)) || p.pointerId === null)
1087
1088
  return;
1088
- const dt = et.current;
1089
- f.clickResetTimer !== null && (window.clearTimeout(f.clickResetTimer), f.clickResetTimer = null);
1090
- const lt = f.isDragging && f.shouldCancelNextClick, H = f.pointerId;
1091
- f.pointerId = null, f.pointerType = "", f.startClientY = 0, f.startScroll = 0, f.isDragging = !1, f.shouldCancelNextClick = lt, f.velocitySamples = [], dt?.hasPointerCapture(H) && dt.releasePointerCapture(H);
1092
- }, [c, d, Z]), Y(() => {
1093
- const f = et.current;
1094
- if (!f)
1089
+ const ft = K.current;
1090
+ p.clickResetTimer !== null && (window.clearTimeout(p.clickResetTimer), p.clickResetTimer = null);
1091
+ const mt = p.isDragging && p.shouldCancelNextClick, z = p.pointerId;
1092
+ p.pointerId = null, p.pointerType = "", p.startClientY = 0, p.startScroll = 0, p.isDragging = !1, p.shouldCancelNextClick = mt, p.velocitySamples = [], ft?.hasPointerCapture(z) && ft.releasePointerCapture(z);
1093
+ }, [c, d, J]), q(() => {
1094
+ const p = K.current;
1095
+ if (!p)
1095
1096
  return;
1096
- const dt = 6, lt = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), H = () => {
1097
- const g = v.current;
1098
- g.pointerId = null, g.pointerType = "", g.startClientY = 0, g.startScroll = 0, g.isDragging = !1, g.velocitySamples = [];
1099
- }, it = () => {
1100
- const g = v.current;
1101
- g.clickResetTimer !== null && (window.clearTimeout(g.clickResetTimer), g.clickResetTimer = null);
1102
- }, J = (g) => {
1103
- const w = v.current, bt = lt();
1104
- w.velocitySamples.push({ clientY: g, time: bt });
1105
- const qt = at.current.velocitySampleWindow;
1106
- w.velocitySamples = w.velocitySamples.filter((xt) => bt - xt.time <= qt);
1107
- }, yt = (g) => g instanceof HTMLElement && g.closest("[data-scrollpane-ignore-drag='true']") !== null, wt = (g) => {
1108
- const w = v.current;
1109
- w.shouldCancelNextClick && (g.preventDefault(), g.stopPropagation(), w.shouldCancelNextClick = !1);
1110
- }, Nt = (g) => {
1111
- const w = v.current;
1097
+ const ft = 6, mt = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), z = () => {
1098
+ const f = j.current;
1099
+ f.pointerId = null, f.pointerType = "", f.startClientY = 0, f.startScroll = 0, f.isDragging = !1, f.velocitySamples = [];
1100
+ }, et = () => {
1101
+ const f = j.current;
1102
+ f.clickResetTimer !== null && (window.clearTimeout(f.clickResetTimer), f.clickResetTimer = null);
1103
+ }, ct = (f) => {
1104
+ const w = j.current, at = mt();
1105
+ w.velocitySamples.push({ clientY: f, time: at });
1106
+ const gt = Xt.current.velocitySampleWindow;
1107
+ w.velocitySamples = w.velocitySamples.filter((wt) => at - wt.time <= gt);
1108
+ }, kt = (f) => f instanceof HTMLElement && f.closest("[data-scrollpane-ignore-drag='true']") !== null, Ot = (f) => {
1109
+ const w = j.current;
1110
+ w.shouldCancelNextClick && (f.preventDefault(), f.stopPropagation(), w.shouldCancelNextClick = !1);
1111
+ }, Mt = (f) => {
1112
+ const w = j.current;
1112
1113
  if (!w.isDragging) {
1113
- if (w.isDragging = !0, w.shouldCancelNextClick = !0, !f.hasPointerCapture(g.pointerId))
1114
+ if (w.isDragging = !0, w.shouldCancelNextClick = !0, !p.hasPointerCapture(f.pointerId))
1114
1115
  try {
1115
- f.setPointerCapture(g.pointerId);
1116
+ p.setPointerCapture(f.pointerId);
1116
1117
  } catch {
1117
1118
  }
1118
- J(g.clientY);
1119
+ ct(f.clientY);
1119
1120
  }
1120
- }, rt = (g) => {
1121
- const w = v.current;
1122
- f.hasPointerCapture(g) && f.releasePointerCapture(g), w.shouldCancelNextClick = !1, it(), H();
1123
- }, Dt = (g) => {
1124
- const w = v.current;
1125
- if (w.pointerId !== g.pointerId)
1121
+ }, it = (f) => f.isTrusted || f.target === p, ht = (f) => {
1122
+ const w = j.current;
1123
+ p.hasPointerCapture(f) && p.releasePointerCapture(f), w.shouldCancelNextClick = !1, et(), z();
1124
+ }, st = (f) => {
1125
+ const w = j.current;
1126
+ if (w.pointerId !== f.pointerId)
1126
1127
  return;
1127
- if (g.buttons === 0) {
1128
- rt(g.pointerId);
1128
+ if (f.buttons === 0 && Sr(f.pointerType)) {
1129
+ ht(f.pointerId);
1129
1130
  return;
1130
1131
  }
1131
- if (!(Xt.current && Jt.current) || !ke(g.pointerType, Bt.current) || !w.isDragging && (Math.abs(g.clientY - w.startClientY) < dt || (Nt(g), !w.isDragging)))
1132
+ if (!(Bt.current && Et.current) || !Oe(f.pointerType, _t.current) || !w.isDragging && (Math.abs(f.clientY - w.startClientY) < ft || (Mt(f), !w.isDragging)))
1132
1133
  return;
1133
- J(g.clientY);
1134
- const bt = g.clientY - w.startClientY, qt = w.startScroll - bt;
1135
- Ct.current(qt), g.cancelable && g.preventDefault();
1136
- }, Mt = () => {
1137
- const g = v.current;
1138
- return g.pointerId !== null || !g.shouldCancelNextClick ? !1 : (it(), g.clickResetTimer = window.setTimeout(() => {
1139
- const w = v.current;
1134
+ ct(f.clientY);
1135
+ const at = f.clientY - w.startClientY, gt = w.startScroll - at;
1136
+ Ct.current(gt), f.cancelable && f.preventDefault();
1137
+ }, Q = () => {
1138
+ const f = j.current;
1139
+ return f.pointerId !== null || !f.shouldCancelNextClick ? !1 : (et(), f.clickResetTimer = window.setTimeout(() => {
1140
+ const w = j.current;
1140
1141
  w.shouldCancelNextClick = !1, w.clickResetTimer = null;
1141
1142
  }, 0), !0);
1142
- }, ft = (g) => {
1143
- const w = v.current;
1144
- if (w.pointerId !== g.pointerId) {
1145
- Mt();
1143
+ }, qt = (f) => {
1144
+ const w = j.current;
1145
+ if (w.pointerId !== f.pointerId) {
1146
+ Q();
1146
1147
  return;
1147
1148
  }
1148
- w.isDragging && w.shouldCancelNextClick && g.cancelable && (g.preventDefault(), g.stopPropagation()), w.isDragging && J(g.clientY);
1149
- let bt = 0;
1149
+ w.isDragging && w.shouldCancelNextClick && f.cancelable && (f.preventDefault(), f.stopPropagation()), w.isDragging && ct(f.clientY);
1150
+ let at = 0;
1150
1151
  if (w.isDragging && w.velocitySamples.length >= 2) {
1151
- const xt = w.velocitySamples, _t = at.current.velocitySampleWindow, vt = xt[xt.length - 1], Ut = xt.find((Ft) => vt.time - Ft.time <= _t) ?? xt[0];
1152
- if (vt && Ut && vt.time !== Ut.time) {
1153
- const Ft = vt.clientY - Ut.clientY, ie = vt.time - Ut.time;
1154
- bt = -(Ft / ie);
1152
+ const wt = w.velocitySamples, Qt = Xt.current.velocitySampleWindow, Ht = wt[wt.length - 1], Ut = wt.find((te) => Ht.time - te.time <= Qt) ?? wt[0];
1153
+ if (Ht && Ut && Ht.time !== Ut.time) {
1154
+ const te = Ht.clientY - Ut.clientY, ce = Ht.time - Ut.time;
1155
+ at = -(te / ce);
1155
1156
  }
1156
1157
  }
1157
- it(), w.shouldCancelNextClick && (w.clickResetTimer = window.setTimeout(() => {
1158
- const xt = v.current;
1159
- xt.shouldCancelNextClick = !1, xt.clickResetTimer = null;
1158
+ et(), w.shouldCancelNextClick && (w.clickResetTimer = window.setTimeout(() => {
1159
+ const wt = j.current;
1160
+ wt.shouldCancelNextClick = !1, wt.clickResetTimer = null;
1160
1161
  }, 0));
1161
- const qt = at.current.startVelocityThreshold;
1162
- H(), f.hasPointerCapture(g.pointerId) && f.releasePointerCapture(g.pointerId), Math.abs(bt) >= qt && Yt.current?.(bt);
1163
- }, ot = (g) => {
1164
- if (v.current.pointerId !== null || (v.current.shouldCancelNextClick && (it(), v.current.shouldCancelNextClick = !1), !(Xt.current && Jt.current)) || !ke(g.pointerType, Bt.current) || g.button !== 0 && g.pointerType === "mouse" || g.ctrlKey || g.metaKey || g.altKey || yt(g.target))
1162
+ const gt = Xt.current.startVelocityThreshold;
1163
+ z(), p.hasPointerCapture(f.pointerId) && p.releasePointerCapture(f.pointerId), Math.abs(at) >= gt && Kt.current?.(at);
1164
+ }, le = (f) => {
1165
+ if (j.current.pointerId !== null) {
1166
+ if (!f.isPrimary || f.pointerType !== j.current.pointerType)
1167
+ return;
1168
+ ht(j.current.pointerId);
1169
+ }
1170
+ if (j.current.shouldCancelNextClick && (et(), j.current.shouldCancelNextClick = !1), !(Bt.current && Et.current) || !Oe(f.pointerType, _t.current) || f.button !== 0 && f.pointerType === "mouse" || f.ctrlKey || f.metaKey || f.altKey || kt(f.target))
1165
1171
  return;
1166
- window.dispatchEvent(new CustomEvent(ze, { detail: { paneId: Ht } })), Et.current?.();
1167
- const w = v.current;
1168
- it(), w.pointerId = g.pointerId, w.pointerType = g.pointerType, w.startClientY = g.clientY, w.startScroll = N.current, w.isDragging = !1, w.shouldCancelNextClick = !1, w.velocitySamples = [];
1169
- }, Lt = (g) => {
1170
- if (v.current.pointerId !== g.pointerId) {
1171
- Mt();
1172
+ window.dispatchEvent(new CustomEvent(Ye, { detail: { paneId: ae } })), At.current?.();
1173
+ const w = j.current;
1174
+ et(), w.pointerId = f.pointerId, w.pointerType = f.pointerType, w.startClientY = f.clientY, w.startScroll = N.current, w.isDragging = !1, w.shouldCancelNextClick = !1, w.velocitySamples = [];
1175
+ }, Nt = (f) => {
1176
+ if (j.current.pointerId !== f.pointerId) {
1177
+ Q();
1172
1178
  return;
1173
1179
  }
1174
- rt(g.pointerId);
1175
- }, Qt = [
1176
- ["click", wt, !0],
1177
- ["pointerdown", ot, { passive: !1 }],
1178
- ["lostpointercapture", (g) => {
1179
- v.current.pointerId === g.pointerId && rt(g.pointerId);
1180
+ it(f) && ht(f.pointerId);
1181
+ }, Gt = [
1182
+ ["click", Ot, !0],
1183
+ ["pointerdown", le, { passive: !1 }],
1184
+ ["lostpointercapture", (f) => {
1185
+ f.target !== p || j.current.pointerId !== f.pointerId || ht(f.pointerId);
1180
1186
  }, void 0]
1181
- ], ct = [
1182
- ["pointermove", Dt, { passive: !1 }],
1183
- ["pointerup", ft, void 0],
1184
- ["pointercancel", Lt, void 0]
1187
+ ], Vt = [
1188
+ ["pointermove", st, { passive: !1 }],
1189
+ ["pointerup", qt, void 0],
1190
+ ["pointercancel", Nt, void 0]
1185
1191
  ];
1186
- return Ee(f, Qt, "add"), Ee(window, ct, "add"), () => {
1187
- Ee(f, Qt, "remove"), Ee(window, ct, "remove");
1188
- const g = v.current;
1189
- g.pointerId !== null && f.hasPointerCapture(g.pointerId) && f.releasePointerCapture(g.pointerId), it(), H();
1192
+ return Ne(p, Gt, "add"), Ne(window, Vt, "add"), () => {
1193
+ Ne(p, Gt, "remove"), Ne(window, Vt, "remove");
1194
+ const f = j.current;
1195
+ f.pointerId !== null && p.hasPointerCapture(f.pointerId) && p.releasePointerCapture(f.pointerId), et(), z();
1190
1196
  };
1191
- }, [Ht]);
1192
- const jt = S(
1193
- (f) => (U(), k(f)),
1194
- [k, U]
1197
+ }, [ae]);
1198
+ const dt = S(
1199
+ (p) => (W(), F(p)),
1200
+ [F, W]
1195
1201
  );
1196
- return /* @__PURE__ */ ue("div", { ref: q, "data-testid": M, className: ce("aqvs-scroll-pane", I), style: E, children: [
1197
- /* @__PURE__ */ ue(
1202
+ return /* @__PURE__ */ he("div", { ref: lt, "data-testid": v, className: pe("aqvs-scroll-pane", x), style: E, children: [
1203
+ /* @__PURE__ */ he(
1198
1204
  "div",
1199
1205
  {
1200
- ref: et,
1201
- className: ce("aqvs-scroll-pane-content"),
1206
+ ref: K,
1207
+ className: pe("aqvs-scroll-pane-content"),
1202
1208
  "data-testid": "aqvs-scroll-pane-content",
1203
1209
  style: {
1204
1210
  height: e,
1205
- paddingTop: St.top,
1206
- paddingBottom: St.bottom,
1211
+ paddingTop: Yt.top,
1212
+ paddingBottom: Yt.bottom,
1207
1213
  // スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
1208
1214
  // 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
1209
1215
  // 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
1210
1216
  // touch-action はペン入力にも効くため、判定は touch と pen の論理和にする
1211
- ...c && Z && d.some((f) => f === "touch" || f === "pen") ? { touchAction: "none" } : {}
1217
+ //
1218
+ // ❗ この値はタッチ開始時にラッチされる (実測: 1ms 後に none へ変えても手遅れ)。
1219
+ // 中身が非同期に届くリストでは、「まだスクロール不能」な一瞬に指が着地すると
1220
+ // **そのジェスチャ 1 回分**はブラウザに接収されたまま戻らない。
1221
+ // 指を離して置き直せば次のジェスチャからは正常に効くため、損失は 1 ジェスチャに
1222
+ // 限られ恒久破損にはならない (実測で確認)。ドラッグ許可の判定 (isScrollable) と
1223
+ // 同一条件で揃えてあるため状態としても一貫している。
1224
+ // 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
1225
+ // (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
1226
+ ...c && J && d.some((p) => p === "touch" || p === "pen") ? { touchAction: "none" } : {}
1212
1227
  },
1213
- id: Ht,
1228
+ ...X,
1229
+ id: A,
1214
1230
  children: [
1215
- h,
1231
+ m,
1216
1232
  n(N.current)
1217
1233
  ]
1218
1234
  }
1219
1235
  ),
1220
- /* @__PURE__ */ st(
1221
- xr,
1236
+ /* @__PURE__ */ ot(
1237
+ Ir,
1222
1238
  {
1223
1239
  contentSize: t,
1224
1240
  viewportSize: e,
1225
1241
  scrollPosition: N.current,
1226
- onScroll: jt,
1242
+ onScroll: dt,
1227
1243
  enableThumbDrag: i,
1228
1244
  enableTrackClick: s,
1229
- enableArrowButtons: l,
1245
+ enableArrowButtons: a,
1230
1246
  scrollBarWidth: r,
1231
- ariaControls: Ht,
1247
+ ariaControls: A,
1232
1248
  tapScrollCircleOptions: _,
1233
- itemCount: j,
1249
+ itemCount: Z,
1234
1250
  renderThumbOverlay: ut,
1235
- visibleStartIndex: Tt,
1251
+ visibleStartIndex: Pt,
1236
1252
  visibleEndIndex: D
1237
1253
  },
1238
1254
  "scrollbar"
1239
1255
  ),
1240
- O?.()
1256
+ k?.()
1241
1257
  ] });
1242
1258
  }
1243
- ), $e = (n, t, e) => Math.min(Math.max(n, t), e), _r = ({ dragState: n, normalizedDistance: t, sizeScale: e, size: r }) => {
1244
- const i = Math.max(r / 2, 1), s = 1 + t * 0.65, l = Math.max(0.65, 1 - t * 0.25), c = n.direction * t * 26 * e, d = 0.8 + t * 0.18, x = 3 * e, I = 6 * e, M = 22 * e, E = Math.abs(c) + I, h = c > 0 ? x : -Math.abs(c) - x, _ = Math.max(2.5, 3 * e), z = $e(n.offsetX, -i, i), j = $e(n.offsetY, -i, i), ut = i * 0.35, Q = z / i * ut, tt = j / i * ut, mt = Q * 0.45, Tt = tt * 0.45, D = Math.max(M * 0.38, 6), O = 0.65 + t * 0.2, P = n.active;
1245
- return /* @__PURE__ */ ue(je, { children: [
1246
- /* @__PURE__ */ st(
1259
+ ), Ue = (n, t, e) => Math.min(Math.max(n, t), e), Or = ({ dragState: n, normalizedDistance: t, sizeScale: e, size: r }) => {
1260
+ const i = Math.max(r / 2, 1), s = 1 + t * 0.65, a = Math.max(0.65, 1 - t * 0.25), c = n.direction * t * 26 * e, d = 0.8 + t * 0.18, b = 3 * e, x = 6 * e, v = 22 * e, E = Math.abs(c) + x, m = c > 0 ? b : -Math.abs(c) - b, _ = Math.max(2.5, 3 * e), B = Ue(n.offsetX, -i, i), Z = Ue(n.offsetY, -i, i), ut = i * 0.35, rt = B / i * ut, nt = Z / i * ut, pt = rt * 0.45, Pt = nt * 0.45, D = Math.max(v * 0.38, 6), k = 0.65 + t * 0.2, P = n.active;
1261
+ return /* @__PURE__ */ he(Ge, { children: [
1262
+ /* @__PURE__ */ ot(
1247
1263
  "div",
1248
1264
  {
1249
1265
  className: "aqvs-tap-scroll-circle-gradient",
1250
1266
  style: {
1251
- transform: `scale(${l}, ${s})`,
1267
+ transform: `scale(${a}, ${s})`,
1252
1268
  transition: P ? "40ms transform ease-out" : "200ms ease transform"
1253
1269
  }
1254
1270
  }
1255
1271
  ),
1256
- /* @__PURE__ */ st(
1272
+ /* @__PURE__ */ ot(
1257
1273
  "div",
1258
1274
  {
1259
1275
  className: "aqvs-sample-visual-pupil",
1260
1276
  style: {
1261
- width: M,
1262
- height: M,
1263
- transform: `translate(calc(-50% + ${Q}px), calc(-50% + ${tt}px)) scale(${l}, ${d * s})`,
1277
+ width: v,
1278
+ height: v,
1279
+ transform: `translate(calc(-50% + ${rt}px), calc(-50% + ${nt}px)) scale(${a}, ${d * s})`,
1264
1280
  transition: P ? "70ms transform ease-out" : "200ms ease transform"
1265
1281
  }
1266
1282
  }
1267
1283
  ),
1268
- /* @__PURE__ */ st(
1284
+ /* @__PURE__ */ ot(
1269
1285
  "div",
1270
1286
  {
1271
1287
  className: "aqvs-sample-visual-highlight",
1272
1288
  style: {
1273
1289
  width: D,
1274
1290
  height: D,
1275
- transform: `translate(calc(-50% + ${mt}px), calc(-50% + ${Tt}px)) scale(${l}, ${s})`,
1276
- opacity: O,
1291
+ transform: `translate(calc(-50% + ${pt}px), calc(-50% + ${Pt}px)) scale(${a}, ${s})`,
1292
+ opacity: k,
1277
1293
  boxShadow: "0 0 8px rgba(255,255,255,0.45)",
1278
1294
  transition: P ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1279
1295
  }
1280
1296
  }
1281
1297
  ),
1282
- /* @__PURE__ */ st(
1298
+ /* @__PURE__ */ ot(
1283
1299
  "div",
1284
1300
  {
1285
1301
  className: "aqvs-sample-visual-rod",
1286
1302
  style: {
1287
1303
  width: _,
1288
1304
  height: E,
1289
- transform: `translate(-50%, ${h}px)`,
1305
+ transform: `translate(-50%, ${m}px)`,
1290
1306
  opacity: t,
1291
1307
  transition: P ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1292
1308
  }
1293
1309
  }
1294
1310
  )
1295
1311
  ] });
1296
- }, Ne = 100, vr = (n) => {
1312
+ }, Ve = 100, Pr = (n) => {
1297
1313
  if (!Number.isFinite(n))
1298
1314
  return 0n;
1299
1315
  const t = Math.trunc(n);
1300
1316
  return t <= 0 ? 0n : BigInt(t);
1301
- }, Oe = (n, t) => {
1317
+ }, Fe = (n, t) => {
1302
1318
  if (!Number.isFinite(n))
1303
1319
  throw new Error(`valueFn returned a non-finite value at index ${t}: ${n}`);
1304
1320
  return n;
1305
- }, he = (n) => {
1321
+ }, xe = (n) => {
1306
1322
  if (n <= 0 || !Number.isFinite(n))
1307
1323
  return 0;
1308
1324
  const t = Math.trunc(n);
@@ -1311,7 +1327,7 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
1311
1327
  const e = BigInt(t) & -BigInt(t);
1312
1328
  return Number(e);
1313
1329
  };
1314
- class le {
1330
+ class me {
1315
1331
  /**
1316
1332
  * @private
1317
1333
  * @property {Map<number, number>} tree - The Map storing the Fenwick tree structure, specifically the sums of deltas. It is 1-indexed.
@@ -1375,27 +1391,27 @@ class le {
1375
1391
  this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.valueFn = void 0, this.baseValue = e, this.total = this.baseValue * this.size;
1376
1392
  return;
1377
1393
  }
1378
- let s = 0, l;
1394
+ let s = 0, a;
1379
1395
  if (i > 0) {
1380
1396
  const c = r?.sampleRange ?? {
1381
1397
  from: 0,
1382
- to: Math.min(Ne - 1, i - 1)
1398
+ to: Math.min(Ve - 1, i - 1)
1383
1399
  };
1384
- let d = Math.max(0, Math.trunc(c.from)), x = Math.min(Math.trunc(c.to), i - 1);
1385
- if (d > x && (d = 0, x = Math.min(Ne - 1, i - 1)), i > Ne)
1386
- s = le._sampleBaseValueStrided(e, i, Ne), r?.materialize && (l = { from: d, values: le._collectValidatedValues(e, d, x) });
1400
+ let d = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), i - 1);
1401
+ if (d > b && (d = 0, b = Math.min(Ve - 1, i - 1)), i > Ve)
1402
+ s = me._sampleBaseValueStrided(e, i, Ve), r?.materialize && (a = { from: d, values: me._collectValidatedValues(e, d, b) });
1387
1403
  else {
1388
- const I = le._collectValidatedValues(e, d, x);
1389
- s = le._modeOrMedian([...I]), r?.materialize && (l = { from: d, values: I });
1404
+ const x = me._collectValidatedValues(e, d, b);
1405
+ s = me._modeOrMedian([...x]), r?.materialize && (a = { from: d, values: x });
1390
1406
  }
1391
1407
  }
1392
- if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = e, this.baseValue = s, l)
1393
- for (let c = 0; c < l.values.length; c++) {
1394
- const d = l.from + c;
1408
+ if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = e, this.baseValue = s, a)
1409
+ for (let c = 0; c < a.values.length; c++) {
1410
+ const d = a.from + c;
1395
1411
  if (d >= this.size)
1396
1412
  break;
1397
- const x = l.values[c] - this.baseValue;
1398
- x !== 0 && (this.deltas.set(d, x), this._updateTree(d, x));
1413
+ const b = a.values[c] - this.baseValue;
1414
+ b !== 0 && (this.deltas.set(d, b), this._updateTree(d, b));
1399
1415
  }
1400
1416
  this.total = this.getTotal();
1401
1417
  }
@@ -1426,7 +1442,7 @@ class le {
1426
1442
  static _collectValidatedValues(t, e, r) {
1427
1443
  const i = [];
1428
1444
  for (let s = e; s <= r; s++)
1429
- i.push(Oe(t(s), s));
1445
+ i.push(Fe(t(s), s));
1430
1446
  return i;
1431
1447
  }
1432
1448
  /**
@@ -1440,22 +1456,22 @@ class le {
1440
1456
  static _modeOrMedian(t) {
1441
1457
  if (t.length === 0)
1442
1458
  return 0;
1443
- t.sort((l, c) => l - c);
1459
+ t.sort((a, c) => a - c);
1444
1460
  const e = Math.floor(t.length / 2);
1445
1461
  let r;
1446
1462
  t.length % 2 === 0 ? r = Math.floor((t[e - 1] + t[e]) / 2) : r = t[e];
1447
1463
  const i = /* @__PURE__ */ new Map();
1448
1464
  let s = 0;
1449
- for (const l of t) {
1450
- const c = (i.get(l) ?? 0) + 1;
1451
- i.set(l, c), c > s && (s = c);
1465
+ for (const a of t) {
1466
+ const c = (i.get(a) ?? 0) + 1;
1467
+ i.set(a, c), c > s && (s = c);
1452
1468
  }
1453
1469
  if (s > t.length * 0.2) {
1454
- const l = [];
1455
- for (const [d, x] of i.entries())
1456
- x === s && l.push(d);
1457
- const c = l.reduce((d, x) => d + x, 0);
1458
- r = Math.floor(c / l.length);
1470
+ const a = [];
1471
+ for (const [d, b] of i.entries())
1472
+ b === s && a.push(d);
1473
+ const c = a.reduce((d, b) => d + b, 0);
1474
+ r = Math.floor(c / a.length);
1459
1475
  }
1460
1476
  return r;
1461
1477
  }
@@ -1475,9 +1491,9 @@ class le {
1475
1491
  let i = Math.max(1, Math.ceil(e / r));
1476
1492
  i % 2 === 0 && (i += 1);
1477
1493
  const s = [];
1478
- for (let l = 0; l < e && s.length < r; l += i)
1479
- s.push(Oe(t(l), l));
1480
- return le._modeOrMedian(s);
1494
+ for (let a = 0; a < e && s.length < r; a += i)
1495
+ s.push(Fe(t(a), a));
1496
+ return me._modeOrMedian(s);
1481
1497
  }
1482
1498
  /**
1483
1499
  * @method update
@@ -1524,14 +1540,14 @@ class le {
1524
1540
  throw new Error(`Index must be an integer: ${r}`);
1525
1541
  if (!Number.isFinite(i))
1526
1542
  throw new Error(`Change must be a finite number: ${i}`);
1527
- const l = (e.get(r) ?? this.deltas.get(r) ?? 0) + i;
1528
- if (l + this.baseValue < -1e-9)
1529
- throw new Error(`Change would make the value at index ${r} negative: ${l + this.baseValue}`);
1530
- e.set(r, l);
1543
+ const a = (e.get(r) ?? this.deltas.get(r) ?? 0) + i;
1544
+ if (a + this.baseValue < -1e-9)
1545
+ throw new Error(`Change would make the value at index ${r} negative: ${a + this.baseValue}`);
1546
+ e.set(r, a);
1531
1547
  }
1532
1548
  for (const { index: r, change: i } of t) {
1533
- const l = (this.deltas.get(r) ?? 0) + i;
1534
- l === 0 ? this.deltas.delete(r) : this.deltas.set(r, l), this._updateTree(r, i);
1549
+ const a = (this.deltas.get(r) ?? 0) + i;
1550
+ a === 0 ? this.deltas.delete(r) : this.deltas.set(r, a), this._updateTree(r, i);
1535
1551
  }
1536
1552
  return this.total;
1537
1553
  }
@@ -1549,7 +1565,7 @@ class le {
1549
1565
  let r = t + 1;
1550
1566
  for (; r <= this.size; ) {
1551
1567
  this.tree.set(r, (this.tree.get(r) ?? 0) + e);
1552
- const i = he(r);
1568
+ const i = xe(r);
1553
1569
  if (i === 0)
1554
1570
  break;
1555
1571
  r += i;
@@ -1575,8 +1591,8 @@ class le {
1575
1591
  throw new Error(`Value must be a finite number: ${s}`);
1576
1592
  if (s < 0)
1577
1593
  throw new Error("Value cannot be negative.");
1578
- const l = r.has(i) ? r.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = l + this.baseValue, d = s - c;
1579
- d !== 0 && e.push({ index: i, change: d }), r.set(i, l + d);
1594
+ const a = r.has(i) ? r.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = a + this.baseValue, d = s - c;
1595
+ d !== 0 && e.push({ index: i, change: d }), r.set(i, a + d);
1580
1596
  }
1581
1597
  return e;
1582
1598
  }
@@ -1593,7 +1609,7 @@ class le {
1593
1609
  let t = 0, e = this.size;
1594
1610
  for (; e > 0; ) {
1595
1611
  t += this.tree.get(e) ?? 0;
1596
- const r = he(e);
1612
+ const r = xe(e);
1597
1613
  if (r === 0)
1598
1614
  break;
1599
1615
  e -= r;
@@ -1610,10 +1626,10 @@ class le {
1610
1626
  */
1611
1627
  _materialize(t, e = !0) {
1612
1628
  if (this.valueFn) {
1613
- const r = this.deltas.get(t) ?? 0, s = Oe(this.valueFn(t), t) - this.baseValue;
1629
+ const r = this.deltas.get(t) ?? 0, s = Fe(this.valueFn(t), t) - this.baseValue;
1614
1630
  if (s !== r && (s === 0 ? this.deltas.delete(t) : this.deltas.set(t, s), e)) {
1615
- const l = s - r;
1616
- this._updateTree(t, l);
1631
+ const a = s - r;
1632
+ this._updateTree(t, a);
1617
1633
  }
1618
1634
  }
1619
1635
  }
@@ -1632,9 +1648,9 @@ class le {
1632
1648
  const i = t.ranges;
1633
1649
  if (i && i.length > 0) {
1634
1650
  for (const c of i) {
1635
- const d = Math.max(0, Math.trunc(c.from)), x = Math.min(Math.trunc(c.to), this.size - 1);
1636
- for (let I = d; I <= x; I++)
1637
- this._materialize(I);
1651
+ const d = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), this.size - 1);
1652
+ for (let x = d; x <= b; x++)
1653
+ this._materialize(x);
1638
1654
  }
1639
1655
  if (e === void 0)
1640
1656
  return;
@@ -1642,8 +1658,8 @@ class le {
1642
1658
  this._materialize(e);
1643
1659
  return;
1644
1660
  }
1645
- const s = i[0].from, l = i[i.length - 1].to;
1646
- e >= s && e <= l && this._materialize(e);
1661
+ const s = i[0].from, a = i[i.length - 1].to;
1662
+ e >= s && e <= a && this._materialize(e);
1647
1663
  return;
1648
1664
  }
1649
1665
  e !== void 0 && this._materialize(e);
@@ -1675,13 +1691,13 @@ class le {
1675
1691
  if (this._materialize(s), (this.deltas.get(s) ?? 0) === c)
1676
1692
  break;
1677
1693
  }
1678
- const l = this.prefixSum(s);
1694
+ const a = this.prefixSum(s);
1679
1695
  return {
1680
1696
  index: s,
1681
- total: this.total ?? l.total,
1682
- cumulative: l.cumulative,
1683
- currentValue: l.currentValue,
1684
- safeIndex: l.safeIndex
1697
+ total: this.total ?? a.total,
1698
+ cumulative: a.cumulative,
1699
+ currentValue: a.currentValue,
1700
+ safeIndex: a.safeIndex
1685
1701
  };
1686
1702
  }
1687
1703
  /**
@@ -1698,10 +1714,10 @@ class le {
1698
1714
  for (; s << 1 <= this.size; )
1699
1715
  s <<= 1;
1700
1716
  for (; s > 0; s >>= 1) {
1701
- const l = r + s;
1702
- if (l <= this.size) {
1703
- const d = (this.tree.get(l) ?? 0) + this.baseValue * s;
1704
- (e ? i + d < t : i + d <= t) && (r = l, i += d);
1717
+ const a = r + s;
1718
+ if (a <= this.size) {
1719
+ const d = (this.tree.get(a) ?? 0) + this.baseValue * s;
1720
+ (e ? i + d < t : i + d <= t) && (r = a, i += d);
1705
1721
  }
1706
1722
  }
1707
1723
  return e ? r : r - 1;
@@ -1714,42 +1730,42 @@ class le {
1714
1730
  _findIndexLarge(t, e, r) {
1715
1731
  if (this.size === 0)
1716
1732
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1717
- const i = vr(this.size);
1733
+ const i = Pr(this.size);
1718
1734
  if (i === 0n)
1719
1735
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1720
1736
  this._materializeRanges(e.materializeOption);
1721
1737
  const s = e.materializeOption?.materialize === !0;
1722
1738
  for (; ; ) {
1723
- let l = 0n, c = i - 1n, d, x, I = this.total;
1724
- for (; l <= c; ) {
1725
- const h = l + c >> 1n, _ = Number(h), z = this.prefixSum(_);
1726
- if (I = z.total, r ? z.cumulative >= t : z.cumulative <= t)
1727
- if (d = h, x = z, r) {
1728
- if (h === 0n)
1739
+ let a = 0n, c = i - 1n, d, b, x = this.total;
1740
+ for (; a <= c; ) {
1741
+ const m = a + c >> 1n, _ = Number(m), B = this.prefixSum(_);
1742
+ if (x = B.total, r ? B.cumulative >= t : B.cumulative <= t)
1743
+ if (d = m, b = B, r) {
1744
+ if (m === 0n)
1729
1745
  break;
1730
- c = h - 1n;
1746
+ c = m - 1n;
1731
1747
  } else
1732
- l = h + 1n;
1748
+ a = m + 1n;
1733
1749
  else if (r)
1734
- l = h + 1n;
1750
+ a = m + 1n;
1735
1751
  else {
1736
- if (h === 0n)
1752
+ if (m === 0n)
1737
1753
  break;
1738
- c = h - 1n;
1754
+ c = m - 1n;
1739
1755
  }
1740
1756
  }
1741
- const M = x, E = d !== void 0 ? Number(d) : -1;
1757
+ const v = b, E = d !== void 0 ? Number(d) : -1;
1742
1758
  if (s && E >= 0) {
1743
- const h = this.deltas.get(E) ?? 0;
1744
- if (this._materialize(E), (this.deltas.get(E) ?? 0) !== h)
1759
+ const m = this.deltas.get(E) ?? 0;
1760
+ if (this._materialize(E), (this.deltas.get(E) ?? 0) !== m)
1745
1761
  continue;
1746
1762
  }
1747
1763
  return {
1748
1764
  index: E,
1749
- total: I,
1750
- cumulative: M?.cumulative,
1751
- currentValue: M?.currentValue,
1752
- safeIndex: M?.safeIndex
1765
+ total: x,
1766
+ cumulative: v?.cumulative,
1767
+ currentValue: v?.currentValue,
1768
+ safeIndex: v?.safeIndex
1753
1769
  };
1754
1770
  }
1755
1771
  }
@@ -1766,16 +1782,16 @@ class le {
1766
1782
  return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
1767
1783
  if (this.size === 0)
1768
1784
  return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
1769
- const r = It(Math.trunc(t), 0, this.size - 1), i = e?.materializeOption;
1785
+ const r = vt(Math.trunc(t), 0, this.size - 1), i = e?.materializeOption;
1770
1786
  this._materializeRanges(i, r, !0);
1771
- let s = 0, l = r + 1;
1772
- for (; l > 0; ) {
1773
- const d = this.tree.get(l) ?? 0;
1787
+ let s = 0, a = r + 1;
1788
+ for (; a > 0; ) {
1789
+ const d = this.tree.get(a) ?? 0;
1774
1790
  s += d;
1775
- const x = he(l);
1776
- if (x === 0)
1791
+ const b = xe(a);
1792
+ if (b === 0)
1777
1793
  break;
1778
- l -= x;
1794
+ a -= b;
1779
1795
  }
1780
1796
  const c = i?.materialize ? this.get(r) : (this.deltas.get(r) || 0) + this.baseValue;
1781
1797
  return { cumulative: s + this.baseValue * (r + 1), total: this.total, currentValue: c, safeIndex: r };
@@ -1835,10 +1851,10 @@ class le {
1835
1851
  let s = r + 1;
1836
1852
  for (; s <= this.size; ) {
1837
1853
  e.set(s, (e.get(s) ?? 0) + i);
1838
- const l = he(s);
1839
- if (l === 0)
1854
+ const a = xe(s);
1855
+ if (a === 0)
1840
1856
  break;
1841
- s += l;
1857
+ s += a;
1842
1858
  }
1843
1859
  }
1844
1860
  this.tree = e, this.total = this._computeTreeTotal();
@@ -1952,17 +1968,17 @@ class le {
1952
1968
  _propagateDeltaToGrownNodes(t, e, r, i) {
1953
1969
  let s = t + 1;
1954
1970
  for (; s <= r; ) {
1955
- const l = he(s);
1956
- if (l === 0)
1971
+ const a = xe(s);
1972
+ if (a === 0)
1957
1973
  break;
1958
- s += l;
1974
+ s += a;
1959
1975
  }
1960
1976
  for (; s <= i; ) {
1961
1977
  this.tree.set(s, (this.tree.get(s) ?? 0) + e);
1962
- const l = he(s);
1963
- if (l === 0)
1978
+ const a = xe(s);
1979
+ if (a === 0)
1964
1980
  break;
1965
- s += l;
1981
+ s += a;
1966
1982
  }
1967
1983
  }
1968
1984
  /**
@@ -1975,15 +1991,15 @@ class le {
1975
1991
  */
1976
1992
  _growSize(t, e) {
1977
1993
  if (this.size = e, this.deltas.size > 0) {
1978
- const r = le._minCoveredLowBound(t, e);
1994
+ const r = me._minCoveredLowBound(t, e);
1979
1995
  if (t - r < this.deltas.size)
1980
1996
  for (let s = r; s < t; s++) {
1981
- const l = this.deltas.get(s);
1982
- l === void 0 || l === 0 || this._propagateDeltaToGrownNodes(s, l, t, e);
1997
+ const a = this.deltas.get(s);
1998
+ a === void 0 || a === 0 || this._propagateDeltaToGrownNodes(s, a, t, e);
1983
1999
  }
1984
2000
  else
1985
- for (const [s, l] of this.deltas.entries())
1986
- l === 0 || s < r || this._propagateDeltaToGrownNodes(s, l, t, e);
2001
+ for (const [s, a] of this.deltas.entries())
2002
+ a === 0 || s < r || this._propagateDeltaToGrownNodes(s, a, t, e);
1987
2003
  }
1988
2004
  this.total = this._computeTreeTotal();
1989
2005
  }
@@ -2053,20 +2069,20 @@ class le {
2053
2069
  return this._findIndex(t, e ?? {}, !1);
2054
2070
  }
2055
2071
  }
2056
- const Sr = (n, t) => {
2072
+ const Mr = (n, t) => {
2057
2073
  const e = n?.sampleRange, r = t?.sampleRange;
2058
2074
  return e === r ? !1 : e && r ? e.from !== r.from || e.to !== r.to : !0;
2059
- }, Mr = (n, t, e) => {
2060
- const r = Number.isFinite(n) && n > 0 ? Math.trunc(n) : 0, i = T(null), s = T({ size: r, valueOrFn: t, options: e });
2061
- i.current === null && (i.current = new le(r, t, e));
2062
- const l = i.current, c = s.current, d = c.size !== r, x = c.valueOrFn !== t, I = Sr(c.options, e), M = c.size === 0 && r > 0 && (!i.current || i.current.base === 0);
2063
- if (x || I) {
2075
+ }, yr = (n, t, e) => {
2076
+ const r = Number.isFinite(n) && n > 0 ? Math.trunc(n) : 0, i = I(null), s = I({ size: r, valueOrFn: t, options: e });
2077
+ i.current === null && (i.current = new me(r, t, e));
2078
+ const a = i.current, c = s.current, d = c.size !== r, b = c.valueOrFn !== t, x = Mr(c.options, e), v = c.size === 0 && r > 0 && (!i.current || i.current.base === 0);
2079
+ if (b || x) {
2064
2080
  const E = e?.resetOnValueFnChange ?? !0;
2065
- I || x && E || M ? (e?.debug && C.debug("[useFenwickMapTree] reset", { valueOrFnChanged: x, optionsChanged: I }), l.reset(r, t, e)) : (d && (e?.debug && C.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: r }), l.changeSize(r)), e?.debug && C.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: x }), l.setValueFn(t, { reset: !1 })), s.current = { size: r, valueOrFn: t, options: e };
2066
- } else d && (e?.debug && C.debug("[useFenwickMapTree] resize", { from: c.size, to: r }), M ? l.reset(r, t, e) : l.changeSize(r), s.current = { size: r, valueOrFn: t, options: e });
2067
- return l;
2081
+ x || b && E || v ? (e?.debug && C.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: x }), a.reset(r, t, e)) : (d && (e?.debug && C.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: r }), a.changeSize(r)), e?.debug && C.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(t, { reset: !1 })), s.current = { size: r, valueOrFn: t, options: e };
2082
+ } else d && (e?.debug && C.debug("[useFenwickMapTree] resize", { from: c.size, to: r }), v ? a.reset(r, t, e) : a.changeSize(r), s.current = { size: r, valueOrFn: t, options: e });
2083
+ return a;
2068
2084
  };
2069
- class Pr {
2085
+ class wr {
2070
2086
  key;
2071
2087
  value;
2072
2088
  prev = null;
@@ -2075,7 +2091,7 @@ class Pr {
2075
2091
  this.key = t, this.value = e;
2076
2092
  }
2077
2093
  }
2078
- class Fe {
2094
+ class ze {
2079
2095
  head = null;
2080
2096
  tail = null;
2081
2097
  /**
@@ -2116,118 +2132,118 @@ class Fe {
2116
2132
  this.remove(t), this.addToTail(t);
2117
2133
  }
2118
2134
  }
2119
- function yr(n) {
2120
- const t = T(/* @__PURE__ */ new Map()), e = T(new Fe()), r = Math.floor(n), i = T(r);
2121
- Y(() => {
2135
+ function Rr(n) {
2136
+ const t = I(/* @__PURE__ */ new Map()), e = I(new ze()), r = Math.floor(n), i = I(r);
2137
+ q(() => {
2122
2138
  if (i.current = r, Number.isNaN(r) || r < 0) {
2123
- C.warn(`useLruCache: invalid capacity ${n}; the cache will not store any entries.`), t.current.clear(), e.current = new Fe();
2139
+ C.warn(`useLruCache: invalid capacity ${n}; the cache will not store any entries.`), t.current.clear(), e.current = new ze();
2124
2140
  return;
2125
2141
  }
2126
2142
  if (Number.isFinite(r))
2127
2143
  for (; t.current.size > r; ) {
2128
- const I = e.current.removeHead();
2129
- if (I)
2130
- t.current.delete(I.key);
2144
+ const x = e.current.removeHead();
2145
+ if (x)
2146
+ t.current.delete(x.key);
2131
2147
  else
2132
2148
  break;
2133
2149
  }
2134
2150
  }, [n, r]);
2135
- const s = S((I) => {
2136
- const M = t.current.get(I);
2137
- if (M)
2138
- return e.current.moveToTail(M), M.value;
2139
- }, []), l = S((I, M) => {
2151
+ const s = S((x) => {
2152
+ const v = t.current.get(x);
2153
+ if (v)
2154
+ return e.current.moveToTail(v), v.value;
2155
+ }, []), a = S((x, v) => {
2140
2156
  const E = i.current;
2141
2157
  if (Number.isNaN(E) || E <= 0)
2142
2158
  return;
2143
- let h = t.current.get(I);
2144
- if (h)
2145
- h.value = M, e.current.moveToTail(h);
2159
+ let m = t.current.get(x);
2160
+ if (m)
2161
+ m.value = v, e.current.moveToTail(m);
2146
2162
  else {
2147
2163
  if (t.current.size >= E) {
2148
2164
  const _ = e.current.removeHead();
2149
2165
  _ && t.current.delete(_.key);
2150
2166
  }
2151
- h = new Pr(I, M), t.current.set(I, h), e.current.addToTail(h);
2167
+ m = new wr(x, v), t.current.set(x, m), e.current.addToTail(m);
2152
2168
  }
2153
- }, []), c = S((I) => t.current.has(I), []), d = S((I) => {
2154
- const M = t.current.get(I);
2155
- M && (e.current.remove(M), t.current.delete(I));
2156
- }, []), x = S(() => {
2157
- t.current.clear(), e.current = new Fe();
2169
+ }, []), c = S((x) => t.current.has(x), []), d = S((x) => {
2170
+ const v = t.current.get(x);
2171
+ v && (e.current.remove(v), t.current.delete(x));
2172
+ }, []), b = S(() => {
2173
+ t.current.clear(), e.current = new ze();
2158
2174
  }, []);
2159
- return At(() => ({ get: s, set: l, has: c, remove: d, clear: x }), [s, l, c, d, x]);
2175
+ return Lt(() => ({ get: s, set: a, has: c, remove: d, clear: b }), [s, a, c, d, b]);
2160
2176
  }
2161
- const wr = 1e4, kr = () => {
2162
- const { get: n, set: t, has: e, clear: r } = yr(wr);
2163
- return At(() => ({ get: n, set: t, has: e, clear: r }), [n, t, e, r]);
2164
- }, gt = (n, t) => t <= 0 ? 0 : It(n, 0, t - 1), Ue = (n) => ({
2177
+ const Cr = 1e4, Fr = () => {
2178
+ const { get: n, set: t, has: e, clear: r } = Rr(Cr);
2179
+ return Lt(() => ({ get: n, set: t, has: e, clear: r }), [n, t, e, r]);
2180
+ }, It = (n, t) => t <= 0 ? 0 : vt(n, 0, t - 1), Ke = (n) => ({
2165
2181
  top: Math.max(0, n?.top ?? 0),
2166
2182
  bottom: Math.max(0, n?.bottom ?? 0)
2167
- }), ne = (n, t) => n <= t ? 0 : n - t, ge = (n, t) => n <= 0 ? t : n + t, Ve = 1e3, Ke = 2e3, Rr = 1048576, Pe = (n) => {
2183
+ }), oe = (n, t) => n <= t ? 0 : n - t, Ie = (n, t) => n <= 0 ? t : n + t, Ae = 1e3, We = 2e3, Er = 1048576, ye = (n) => {
2168
2184
  if (!Number.isFinite(n)) return 0n;
2169
2185
  const t = Math.trunc(n);
2170
2186
  return t <= 0 ? 0n : BigInt(t);
2171
- }, Cr = (n, t, e, r, i, s, l, c) => {
2172
- const d = Pe(r);
2187
+ }, Nr = (n, t, e, r, i, s, a, c) => {
2188
+ const d = ye(r);
2173
2189
  if (d === 0n)
2174
2190
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2175
- const x = (D) => D < 0n ? 0n : D >= d ? d - 1n : D, I = { materializeOption: { materialize: !1 } }, { index: M, cumulative: E } = s.findIndexAtOrAfter(n, I);
2176
- let h;
2177
- M === -1 ? h = d - 1n : (E === n ? h = Pe(M + 1) : h = Pe(M), h >= d && (h = d - 1n)), n <= 0 && (h = 0n), c && n >= l && (h = d - 1n);
2191
+ const b = (D) => D < 0n ? 0n : D >= d ? d - 1n : D, x = { materializeOption: { materialize: !1 } }, { index: v, cumulative: E } = s.findIndexAtOrAfter(n, x);
2192
+ let m;
2193
+ v === -1 ? m = d - 1n : (E === n ? m = ye(v + 1) : m = ye(v), m >= d && (m = d - 1n)), n <= 0 && (m = 0n), c && n >= a && (m = d - 1n);
2178
2194
  const _ = (D) => {
2179
- const O = Number(D);
2180
- if (!Number.isSafeInteger(O))
2195
+ const k = Number(D);
2196
+ if (!Number.isSafeInteger(k))
2181
2197
  return null;
2182
- const { cumulative: P } = s.prefixSum(O, { materializeOption: { materialize: !1 } });
2198
+ const { cumulative: P } = s.prefixSum(k, { materializeOption: { materialize: !1 } });
2183
2199
  if (!Number.isFinite(P))
2184
2200
  return null;
2185
- const { index: B } = s.findIndexAtOrAfter(P + 0.5, { materializeOption: { materialize: !1 } });
2186
- if (B === -1)
2201
+ const { index: X } = s.findIndexAtOrAfter(P + 0.5, { materializeOption: { materialize: !1 } });
2202
+ if (X === -1)
2187
2203
  return null;
2188
- const N = Pe(B);
2189
- return N > D ? N : null;
2190
- }, z = (D) => {
2191
- let O = 0, P = D, B = D, N = 0n, q = 0;
2192
- for (; P < d && O < t; ) {
2193
- const et = Number(P), G = i(et);
2194
- if (O += G, B = P, P += 1n, N += 1n, !Number.isFinite(G) || G < 0)
2204
+ const $ = ye(X);
2205
+ return $ > D ? $ : null;
2206
+ }, B = (D) => {
2207
+ let k = 0, P = D, X = D, $ = 0n, N = 0;
2208
+ for (; P < d && k < t; ) {
2209
+ const lt = Number(P), K = i(lt);
2210
+ if (k += K, X = P, P += 1n, $ += 1n, !Number.isFinite(K) || K < 0)
2195
2211
  break;
2196
- if (G === 0) {
2197
- if (q += 1, q > Ve) {
2198
- const p = _(B);
2199
- if (p !== null && p > P)
2200
- P = p, q = 0;
2201
- else if (p !== null && p === P && i(Number(P)) > 0)
2202
- q = 0;
2212
+ if (K === 0) {
2213
+ if (N += 1, N > Ae) {
2214
+ const T = _(X);
2215
+ if (T !== null && T > P)
2216
+ P = T, N = 0;
2217
+ else if (T !== null && T === P && i(Number(P)) > 0)
2218
+ N = 0;
2203
2219
  else
2204
2220
  break;
2205
2221
  }
2206
2222
  } else
2207
- q = 0;
2223
+ N = 0;
2208
2224
  }
2209
- return N === 0n && (B = D), { height: O, end: B };
2225
+ return $ === 0n && (X = D), { height: k, end: X };
2210
2226
  };
2211
- let { height: j, end: ut } = z(h);
2212
- if (j < t && h > 0n) {
2213
- let D = h, O = j, P = 0;
2214
- for (; D > 0n && O < t; ) {
2227
+ let { height: Z, end: ut } = B(m);
2228
+ if (Z < t && m > 0n) {
2229
+ let D = m, k = Z, P = 0;
2230
+ for (; D > 0n && k < t; ) {
2215
2231
  D -= 1n;
2216
- const N = Number(D), q = i(N);
2217
- if (O += q, !Number.isFinite(q) || q < 0)
2232
+ const $ = Number(D), N = i($);
2233
+ if (k += N, !Number.isFinite(N) || N < 0)
2218
2234
  break;
2219
- if (q === 0) {
2220
- if (P += 1, P > Ve) {
2221
- const et = Number(D);
2222
- if (!Number.isSafeInteger(et))
2235
+ if (N === 0) {
2236
+ if (P += 1, P > Ae) {
2237
+ const lt = Number(D);
2238
+ if (!Number.isSafeInteger(lt))
2223
2239
  break;
2224
- const { cumulative: G } = s.prefixSum(et, { materializeOption: { materialize: !1 } });
2225
- if (!Number.isFinite(G))
2240
+ const { cumulative: K } = s.prefixSum(lt, { materializeOption: { materialize: !1 } });
2241
+ if (!Number.isFinite(K))
2226
2242
  break;
2227
- const { index: p } = s.findIndexAtOrAfter(G - 0.5, { materializeOption: { materialize: !1 } }), $ = p === -1 ? -1n : Pe(p);
2228
- if ($ >= 0n && $ < D)
2229
- D = $ + 1n, P = 0;
2230
- else if ($ === D && D >= 1n && i(Number(D - 1n)) > 0)
2243
+ const { index: T } = s.findIndexAtOrAfter(K - 0.5, { materializeOption: { materialize: !1 } }), V = T === -1 ? -1n : ye(T);
2244
+ if (V >= 0n && V < D)
2245
+ D = V + 1n, P = 0;
2246
+ else if (V === D && D >= 1n && i(Number(D - 1n)) > 0)
2231
2247
  P = 0;
2232
2248
  else
2233
2249
  break;
@@ -2235,90 +2251,90 @@ const wr = 1e4, kr = () => {
2235
2251
  } else
2236
2252
  P = 0;
2237
2253
  }
2238
- h = x(D);
2239
- const B = z(h);
2240
- j = B.height, ut = B.end;
2254
+ m = b(D);
2255
+ const X = B(m);
2256
+ Z = X.height, ut = X.end;
2241
2257
  }
2242
- const Q = x(h), tt = x(ut), mt = x(Q - BigInt(Math.max(0, e))), Tt = x(tt + BigInt(Math.max(0, e)));
2258
+ const rt = b(m), nt = b(ut), pt = b(rt - BigInt(Math.max(0, e))), Pt = b(nt + BigInt(Math.max(0, e)));
2243
2259
  return {
2244
- renderingStartIndex: gt(Number(mt), r),
2245
- renderingEndIndex: gt(Number(Tt), r),
2246
- visibleStartIndex: gt(Number(Q), r),
2247
- visibleEndIndex: gt(Number(tt), r)
2260
+ renderingStartIndex: It(Number(pt), r),
2261
+ renderingEndIndex: It(Number(Pt), r),
2262
+ visibleStartIndex: It(Number(rt), r),
2263
+ visibleEndIndex: It(Number(nt), r)
2248
2264
  };
2249
- }, Er = (n, t, e, r, i, s, l) => {
2265
+ }, Vr = (n, t, e, r, i, s, a) => {
2250
2266
  if (r === 0)
2251
2267
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2252
- const c = Number.isFinite(l), d = c ? Math.min(Math.max(0, n), l) : Math.max(0, n);
2268
+ const c = Number.isFinite(a), d = c ? Math.min(Math.max(0, n), a) : Math.max(0, n);
2253
2269
  if (r >= Number.MAX_SAFE_INTEGER)
2254
- return Cr(d, t, e, r, i, s, l, c);
2255
- const { index: x, cumulative: I, currentValue: M } = s.findIndexAtOrAfter(d, { materializeOption: { materialize: !1 } }), E = x === -1 ? t <= 0 || (I ?? 0) < d + (M ?? 0) ? r - 1 : 0 : x;
2256
- let h = gt(E, r), _ = 0;
2257
- if (x !== -1 && I === d)
2258
- h = gt(x + 1, r), _ = 0;
2259
- else if (h === x && I !== void 0 && M !== void 0)
2260
- _ = I - M - d;
2270
+ return Nr(d, t, e, r, i, s, a, c);
2271
+ const { index: b, cumulative: x, currentValue: v } = s.findIndexAtOrAfter(d, { materializeOption: { materialize: !1 } }), E = b === -1 ? t <= 0 || (x ?? 0) < d + (v ?? 0) ? r - 1 : 0 : b;
2272
+ let m = It(E, r), _ = 0;
2273
+ if (b !== -1 && x === d)
2274
+ m = It(b + 1, r), _ = 0;
2275
+ else if (m === b && x !== void 0 && v !== void 0)
2276
+ _ = x - v - d;
2261
2277
  else {
2262
- const { cumulative: D, currentValue: O } = s.prefixSum(h, { materializeOption: { materialize: !1 } });
2263
- _ = (D ?? 0) - (O ?? 0) - d;
2278
+ const { cumulative: D, currentValue: k } = s.prefixSum(m, { materializeOption: { materialize: !1 } });
2279
+ _ = (D ?? 0) - (k ?? 0) - d;
2264
2280
  }
2265
- const z = _, j = (D, O) => {
2266
- let P = D, B = O, N = 0;
2267
- for (; P < r && B < t; ) {
2268
- const q = i(P);
2269
- if (B += q, P++, !Number.isFinite(q) || q < 0)
2281
+ const B = _, Z = (D, k) => {
2282
+ let P = D, X = k, $ = 0;
2283
+ for (; P < r && X < t; ) {
2284
+ const N = i(P);
2285
+ if (X += N, P++, !Number.isFinite(N) || N < 0)
2270
2286
  break;
2271
- if (q === 0) {
2272
- if (N++, N > Ve) {
2273
- const { cumulative: et } = s.prefixSum(P - 1, { materializeOption: { materialize: !1 } }), { index: G } = Number.isFinite(et) ? s.findIndexAtOrAfter(et + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2274
- if (G > P)
2275
- P = G, N = 0;
2276
- else if (G === P && i(P) > 0)
2277
- N = 0;
2287
+ if (N === 0) {
2288
+ if ($++, $ > Ae) {
2289
+ const { cumulative: lt } = s.prefixSum(P - 1, { materializeOption: { materialize: !1 } }), { index: K } = Number.isFinite(lt) ? s.findIndexAtOrAfter(lt + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2290
+ if (K > P)
2291
+ P = K, $ = 0;
2292
+ else if (K === P && i(P) > 0)
2293
+ $ = 0;
2278
2294
  else
2279
2295
  break;
2280
2296
  }
2281
2297
  } else
2282
- N = 0;
2298
+ $ = 0;
2283
2299
  }
2284
- return { cursor: P, height: B };
2285
- }, ut = j(h, _);
2286
- let Q = ut.cursor;
2287
- if (_ = ut.height, _ < t && h > 0) {
2288
- let D = _ + Math.abs(Math.min(0, z)), O = h - 1, P = 0;
2289
- for (; O >= 0 && D < t; ) {
2290
- const N = i(O);
2291
- if (D += N, !Number.isFinite(N) || N < 0) {
2292
- O--;
2300
+ return { cursor: P, height: X };
2301
+ }, ut = Z(m, _);
2302
+ let rt = ut.cursor;
2303
+ if (_ = ut.height, _ < t && m > 0) {
2304
+ let D = _ + Math.abs(Math.min(0, B)), k = m - 1, P = 0;
2305
+ for (; k >= 0 && D < t; ) {
2306
+ const $ = i(k);
2307
+ if (D += $, !Number.isFinite($) || $ < 0) {
2308
+ k--;
2293
2309
  break;
2294
2310
  }
2295
- if (N === 0) {
2296
- if (P++, P > Ve) {
2297
- const { cumulative: q } = s.prefixSum(O, { materializeOption: { materialize: !1 } }), { index: et } = Number.isFinite(q) ? s.findIndexAtOrAfter(q - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2298
- if (et !== -1 && et < O) {
2299
- O = et, P = 0;
2311
+ if ($ === 0) {
2312
+ if (P++, P > Ae) {
2313
+ const { cumulative: N } = s.prefixSum(k, { materializeOption: { materialize: !1 } }), { index: lt } = Number.isFinite(N) ? s.findIndexAtOrAfter(N - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2314
+ if (lt !== -1 && lt < k) {
2315
+ k = lt, P = 0;
2300
2316
  continue;
2301
2317
  }
2302
- if (et === O && O >= 1 && i(O - 1) > 0)
2318
+ if (lt === k && k >= 1 && i(k - 1) > 0)
2303
2319
  P = 0;
2304
2320
  else {
2305
- O--;
2321
+ k--;
2306
2322
  break;
2307
2323
  }
2308
2324
  }
2309
2325
  } else
2310
2326
  P = 0;
2311
- O--;
2327
+ k--;
2312
2328
  }
2313
- h = gt(O + 1, r);
2314
- const B = j(h, 0);
2315
- Q = B.cursor, _ = B.height;
2329
+ m = It(k + 1, r);
2330
+ const X = Z(m, 0);
2331
+ rt = X.cursor, _ = X.height;
2316
2332
  }
2317
- const tt = gt(h - e, r), mt = gt(Math.max(Q - 1, h), r), Tt = gt(mt + e, r);
2318
- return { renderingStartIndex: tt, renderingEndIndex: Tt, visibleStartIndex: h, visibleEndIndex: mt };
2319
- }, We = (n, t, e) => {
2320
- const r = Math.max(0, t ?? 0), i = T({ last: 0, id: null, arg: null }).current;
2321
- return Y(
2333
+ const nt = It(m - e, r), pt = It(Math.max(rt - 1, m), r), Pt = It(pt + e, r);
2334
+ return { renderingStartIndex: nt, renderingEndIndex: Pt, visibleStartIndex: m, visibleEndIndex: pt };
2335
+ }, je = (n, t, e) => {
2336
+ const r = Math.max(0, t ?? 0), i = I({ last: 0, id: null, arg: null }).current;
2337
+ return q(
2322
2338
  () => () => {
2323
2339
  i.id !== null && (cancelAnimationFrame(i.id), i.id = null);
2324
2340
  },
@@ -2326,32 +2342,32 @@ const wr = 1e4, kr = () => {
2326
2342
  ), S(
2327
2343
  (s) => {
2328
2344
  if (i.arg = s, i.id !== null) return;
2329
- const l = (c) => {
2345
+ const a = (c) => {
2330
2346
  if (i.id = null, i.arg === null) return;
2331
2347
  const d = c - i.last;
2332
2348
  if (r === 0 || i.last === 0 || d >= r) {
2333
2349
  if (n.current)
2334
2350
  try {
2335
2351
  e(n.current, i.arg);
2336
- } catch (x) {
2337
- console.error("[useThrottledInvoker] Error invoking callback", x);
2352
+ } catch (b) {
2353
+ console.error("[useThrottledInvoker] Error invoking callback", b);
2338
2354
  }
2339
2355
  i.arg = null, i.last = c;
2340
2356
  }
2341
- i.arg !== null && (i.id = requestAnimationFrame(l));
2357
+ i.arg !== null && (i.id = requestAnimationFrame(a));
2342
2358
  };
2343
- i.id = requestAnimationFrame(l);
2359
+ i.id = requestAnimationFrame(a);
2344
2360
  },
2345
2361
  [r, e, n, i]
2346
2362
  );
2347
- }, Nr = Je.memo(({ index: n, top: t, height: e, item: r, children: i, clipItemHeight: s, enableKeyboardNavigation: l, onKeyDown: c, onFocus: d, registerItemRef: x }) => {
2348
- const I = S((_) => x(n, _), [n, x]), M = S((_) => c(_, n), [n, c]), E = S(() => d(n), [n, d]), h = S((_) => {
2363
+ }, Ar = Qe.memo(({ index: n, top: t, height: e, item: r, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: c, onFocus: d, registerItemRef: b }) => {
2364
+ const x = S((_) => b(n, _), [n, b]), v = S((_) => c(_, n), [n, c]), E = S(() => d(n), [n, d]), m = S((_) => {
2349
2365
  _.currentTarget.focus({ preventScroll: !0 });
2350
2366
  }, []);
2351
- return /* @__PURE__ */ st(
2367
+ return /* @__PURE__ */ ot(
2352
2368
  "div",
2353
2369
  {
2354
- ref: I,
2370
+ ref: x,
2355
2371
  "data-index": n,
2356
2372
  "data-virtualscroll-item": "true",
2357
2373
  className: "aqvs-item-container",
@@ -2360,580 +2376,582 @@ const wr = 1e4, kr = () => {
2360
2376
  height: e,
2361
2377
  overflow: s ? "hidden" : void 0
2362
2378
  },
2363
- tabIndex: l ? -1 : void 0,
2364
- onPointerDown: l ? h : void 0,
2365
- onKeyDownCapture: l ? M : void 0,
2366
- onFocusCapture: l ? E : void 0,
2379
+ tabIndex: a ? -1 : void 0,
2380
+ onPointerDown: a ? m : void 0,
2381
+ onKeyDownCapture: a ? v : void 0,
2382
+ onFocusCapture: a ? E : void 0,
2367
2383
  children: i(r, n)
2368
2384
  }
2369
2385
  );
2370
- }), Vr = ({
2386
+ }), Dr = ({
2371
2387
  itemCount: n,
2372
2388
  getItem: t,
2373
2389
  getItemKey: e,
2374
2390
  getItemHeight: r,
2375
2391
  viewportSize: i,
2376
2392
  overscanCount: s = 15,
2377
- className: l,
2393
+ className: a,
2378
2394
  testId: c,
2379
2395
  onScroll: d,
2380
- onRangeChange: x,
2381
- children: I,
2382
- background: M,
2396
+ onRangeChange: b,
2397
+ children: x,
2398
+ background: v,
2383
2399
  initialScrollIndex: E,
2384
- initialScrollOffset: h,
2400
+ initialScrollOffset: m,
2385
2401
  callbackThrottleMs: _ = 5,
2386
- contentInsets: z,
2387
- onItemFocus: j,
2402
+ contentInsets: B,
2403
+ onItemFocus: Z,
2388
2404
  scrollBarOptions: ut,
2389
- behaviorOptions: Q,
2390
- onWheelHorizontal: tt
2391
- }, mt) => {
2392
- const { width: Tt, enableThumbDrag: D, enableTrackClick: O, enableArrowButtons: P, enableScrollToTopBottomButtons: B, renderThumbOverlay: N, tapScrollCircleOptions: q } = ut ?? {}, { enablePointerDrag: et, pointerDragInputs: G, enableKeyboardNavigation: p = !0, wheelSpeedMultiplier: $, inertiaOptions: St, clipItemHeight: Rt = !1, resetOnGetItemHeightChange: Z = !1 } = Q ?? {}, k = T(null), Ct = T({
2405
+ behaviorOptions: rt,
2406
+ onWheelHorizontal: nt,
2407
+ contentProps: pt
2408
+ }, Pt) => {
2409
+ const { width: D, enableThumbDrag: k, enableTrackClick: P, enableArrowButtons: X, enableScrollToTopBottomButtons: $, renderThumbOverlay: N, tapScrollCircleOptions: lt } = ut ?? {}, { enablePointerDrag: K, pointerDragInputs: T, enableKeyboardNavigation: V = !0, wheelSpeedMultiplier: Tt, inertiaOptions: Yt, clipItemHeight: yt = !1, resetOnGetItemHeightChange: J = !1 } = rt ?? {}, F = I(null), Ct = I({
2393
2410
  renderingStartIndex: 0,
2394
2411
  renderingEndIndex: 0,
2395
2412
  visibleStartIndex: 0,
2396
2413
  visibleEndIndex: 0,
2397
2414
  scrollPosition: 0,
2398
2415
  totalHeight: 0
2399
- }), U = T(null), Et = T(!1);
2400
- Y(() => {
2401
- Z && (U.current = null);
2402
- }, [Z, r]);
2403
- const y = At(() => Ue(z), [z]), [Yt] = Zt(() => {
2416
+ }), W = I(null), At = I(!1);
2417
+ q(() => {
2418
+ J && (W.current = null);
2419
+ }, [J, r]);
2420
+ const y = Lt(() => Ke(B), [B]), [Kt] = Jt(() => {
2404
2421
  const u = typeof E == "number" && Number.isFinite(E) ? Math.max(0, Math.trunc(E)) : 0;
2405
2422
  return { from: Math.max(0, u - 50), to: u + 50 };
2406
- }), Ht = At(
2423
+ }), ae = Lt(
2407
2424
  // 目的: Fenwick Tree のオプション設定
2408
2425
  // 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
2409
2426
  // itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
2410
2427
  // この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
2411
2428
  () => ({
2412
- sampleRange: Yt,
2413
- resetOnValueFnChange: Z,
2429
+ sampleRange: Kt,
2430
+ resetOnValueFnChange: J,
2414
2431
  materialize: !0
2415
2432
  }),
2416
- [Z, Yt]
2417
- ), v = Mr(n, r, Ht), [Xt] = Zt(() => {
2418
- let o = 0, u = 0;
2433
+ [J, Kt]
2434
+ ), A = yr(n, r, ae), [j] = Jt(() => {
2435
+ let l = 0, u = 0;
2419
2436
  if (typeof E == "number") {
2420
- const m = It(E, 0, n - 1), V = It(m - s * 2, 0, n - 1), A = It(m + s * 2, 0, n - 1), F = E > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: V, to: A }] } } : void 0, { cumulative: K, total: W, currentValue: Pt } = v.prefixSum(E, F), pt = Math.max(K - Pt, 0);
2421
- o = ge(pt, y.top), u = W ?? v.getTotal();
2422
- } else typeof h == "number" && (o = ge(Math.max(h, 0), y.top)), u = v.getTotal();
2423
- return { position: o, total: u };
2424
- }), [Bt, Jt] = Zt(Xt.position), [at, jt] = Zt(Xt.total), f = T(Xt.position), dt = T(y.top), lt = T(d ?? void 0), H = T(x ?? void 0), it = T(/* @__PURE__ */ new Map()), J = T(null), yt = T(null), [wt, Nt] = Zt(null), [rt, Dt] = Zt(!1), Mt = T(null), ft = T(!1), ot = T(0), Lt = T(!1), $t = T(!1), Qt = T(n);
2425
- Qt.current !== n && (Qt.current = n, $t.current = !0), Y(() => {
2426
- lt.current = d ?? void 0, H.current = x ?? void 0;
2427
- }, [x, d]);
2428
- const ct = S(
2429
- (o) => {
2430
- if (p && o && typeof o.focus == "function")
2437
+ const h = vt(E, 0, n - 1), R = vt(h - s * 2, 0, n - 1), O = vt(h + s * 2, 0, n - 1), Y = E > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: R, to: O }] } } : void 0, { cumulative: U, total: G, currentValue: Rt } = A.prefixSum(E, Y), bt = Math.max(U - Rt, 0);
2438
+ l = Ie(bt, y.top), u = G ?? A.getTotal();
2439
+ } else typeof m == "number" && (l = Ie(Math.max(m, 0), y.top)), u = A.getTotal();
2440
+ return { position: l, total: u };
2441
+ }), [Bt, _t] = Jt(j.position), [Et, Xt] = Jt(j.total), dt = I(j.position), p = I(y.top), ft = I(d ?? void 0), mt = I(b ?? void 0), z = I(/* @__PURE__ */ new Map()), et = I(null), ct = I(null), [kt, Ot] = Jt(null), [Mt, it] = Jt(!1), ht = I(null), st = I(!1), Q = I(0), qt = I(!1), le = I(!1), Nt = I(n);
2442
+ Nt.current !== n && (Nt.current = n, le.current = !0), q(() => {
2443
+ ft.current = d ?? void 0, mt.current = b ?? void 0;
2444
+ }, [b, d]);
2445
+ const $t = S(
2446
+ (l) => {
2447
+ if (V && l && typeof l.focus == "function")
2431
2448
  try {
2432
- o.focus({ preventScroll: !0 });
2449
+ l.focus({ preventScroll: !0 });
2433
2450
  } catch {
2434
- o.focus();
2451
+ l.focus();
2435
2452
  }
2436
2453
  },
2437
- [p]
2438
- ), g = S((o, { position: u, totalHeight: m }) => {
2439
- o(u, m);
2440
- }, []), w = We(lt, _, g), bt = S((o, u) => {
2441
- o(u);
2442
- }, []), qt = We(H, _, bt), xt = T(y.top);
2443
- xt.current = y.top;
2444
- const _t = T(w);
2445
- _t.current = w, Y(() => (Et.current = !1, () => {
2446
- Et.current = !0, Mt.current && (clearTimeout(Mt.current), Mt.current = null);
2447
- }), []), Y(() => {
2448
- p || (it.current.clear(), J.current = null, yt.current = null);
2449
- }, [p]);
2450
- const vt = S(
2451
- (o, u) => {
2454
+ [V]
2455
+ ), Gt = S((l, { position: u, totalHeight: h }) => {
2456
+ l(u, h);
2457
+ }, []), Vt = je(ft, _, Gt), f = S((l, u) => {
2458
+ l(u);
2459
+ }, []), w = je(mt, _, f), at = I(y.top);
2460
+ at.current = y.top;
2461
+ const gt = I(Vt);
2462
+ gt.current = Vt, q(() => (At.current = !1, () => {
2463
+ At.current = !0, ht.current && (clearTimeout(ht.current), ht.current = null);
2464
+ }), []), q(() => {
2465
+ V || (z.current.clear(), et.current = null, ct.current = null);
2466
+ }, [V]);
2467
+ const wt = S(
2468
+ (l, u) => {
2452
2469
  if (!u) {
2453
- it.current.delete(o);
2470
+ z.current.delete(l);
2454
2471
  return;
2455
2472
  }
2456
- p && (it.current.set(o, u), J.current === o && (J.current = null, yt.current = o, ct(u)));
2473
+ V && (z.current.set(l, u), et.current === l && (et.current = null, ct.current = l, $t(u)));
2457
2474
  },
2458
- [p, ct]
2459
- ), Ut = 0.01, Ft = T({
2475
+ [V, $t]
2476
+ ), Qt = 0.01, Ht = I({
2460
2477
  rafId: null,
2461
2478
  loopActive: !1,
2462
2479
  idleFrames: 0,
2463
- lastRenderedPosition: Xt.position
2464
- }), ie = S(() => {
2465
- const o = Ft.current;
2466
- o.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(o.rafId), o.rafId = null, o.loopActive = !1, o.idleFrames = 0;
2480
+ lastRenderedPosition: j.position
2481
+ }), Ut = S(() => {
2482
+ const l = Ht.current;
2483
+ l.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(l.rafId), l.rafId = null, l.loopActive = !1, l.idleFrames = 0;
2467
2484
  }, []);
2468
- Y(
2485
+ q(
2469
2486
  () => () => {
2470
- ie();
2487
+ Ut();
2471
2488
  },
2472
- [ie]
2489
+ [Ut]
2473
2490
  );
2474
- const xe = T(() => {
2475
- }), de = S(() => {
2476
- const o = Ft.current;
2477
- o.rafId = null;
2478
- const u = f.current, m = ne(u, xt.current), V = v.getTotal();
2479
- if (Jt((F) => Math.abs(F - u) < Ut ? F : u), Math.abs(o.lastRenderedPosition - u) >= Ut ? (_t.current({ position: m, totalHeight: V }), o.lastRenderedPosition = u, o.idleFrames = 0) : o.idleFrames += 1, o.idleFrames >= 2) {
2480
- ie();
2491
+ const te = I(() => {
2492
+ }), ce = S(() => {
2493
+ const l = Ht.current;
2494
+ l.rafId = null;
2495
+ const u = dt.current, h = oe(u, at.current), R = A.getTotal();
2496
+ if (_t((Y) => Math.abs(Y - u) < Qt ? Y : u), Math.abs(l.lastRenderedPosition - u) >= Qt ? (gt.current({ position: h, totalHeight: R }), l.lastRenderedPosition = u, l.idleFrames = 0) : l.idleFrames += 1, l.idleFrames >= 2) {
2497
+ Ut();
2481
2498
  return;
2482
2499
  }
2483
2500
  if (typeof requestAnimationFrame == "function") {
2484
- o.rafId = requestAnimationFrame((F) => xe.current(F));
2501
+ l.rafId = requestAnimationFrame((Y) => te.current(Y));
2485
2502
  return;
2486
2503
  }
2487
- o.loopActive = !1;
2488
- }, [v, ie]);
2489
- xe.current = de;
2490
- const Ie = S(() => {
2491
- const o = Ft.current;
2492
- if (o.idleFrames = 0, !o.loopActive) {
2493
- if (o.loopActive = !0, typeof requestAnimationFrame == "function") {
2494
- o.rafId = requestAnimationFrame(de);
2504
+ l.loopActive = !1;
2505
+ }, [A, Ut]);
2506
+ te.current = ce;
2507
+ const ue = S(() => {
2508
+ const l = Ht.current;
2509
+ if (l.idleFrames = 0, !l.loopActive) {
2510
+ if (l.loopActive = !0, typeof requestAnimationFrame == "function") {
2511
+ l.rafId = requestAnimationFrame(ce);
2495
2512
  return;
2496
2513
  }
2497
- o.loopActive = !1;
2514
+ l.loopActive = !1;
2498
2515
  }
2499
- }, [de]), nt = S(
2500
- (o, u) => {
2501
- const m = u?.immediate ?? !1, V = ne(o, y.top);
2502
- if (f.current = o, m) {
2503
- Ft.current.lastRenderedPosition = o, Ft.current.idleFrames = 0, Jt(o), w({ position: V, totalHeight: v.getTotal() });
2516
+ }, [ce]), tt = S(
2517
+ (l, u) => {
2518
+ const h = u?.immediate ?? !1, R = oe(l, y.top);
2519
+ if (dt.current = l, h) {
2520
+ Ht.current.lastRenderedPosition = l, Ht.current.idleFrames = 0, _t(l), Vt({ position: R, totalHeight: A.getTotal() });
2504
2521
  return;
2505
2522
  }
2506
- Ie();
2523
+ ue();
2507
2524
  },
2508
- [Ie, v, y.top, w]
2509
- ), zt = S((o) => {
2510
- const u = k.current;
2525
+ [ue, A, y.top, Vt]
2526
+ ), ee = S((l) => {
2527
+ const u = F.current;
2511
2528
  if (!u)
2512
- return o;
2513
- const m = u.getScrollPosition();
2514
- ot.current += 1;
2515
- const V = u.scrollTo(o);
2516
- return V === m && (ot.current = Math.max(0, ot.current - 1)), Math.abs(V - o) > 0.5 && (Lt.current = !0), V;
2517
- }, []), Te = T(!1);
2518
- Y(() => {
2519
- if (!Te.current)
2520
- if (Te.current = !0, typeof h == "number") {
2521
- const o = ge(Math.max(h, 0), y.top), u = Math.abs(o - f.current) > 0.5;
2522
- nt(o, { immediate: !0 }), u && k.current?.scrollTo(o);
2529
+ return l;
2530
+ const h = u.getScrollPosition();
2531
+ Q.current += 1;
2532
+ const R = u.scrollTo(l);
2533
+ return R === h && (Q.current = Math.max(0, Q.current - 1)), Math.abs(R - l) > 0.5 && (qt.current = !0), R;
2534
+ }, []), Se = I(!1);
2535
+ q(() => {
2536
+ if (!Se.current)
2537
+ if (Se.current = !0, typeof m == "number") {
2538
+ const l = Ie(Math.max(m, 0), y.top), u = Math.abs(l - dt.current) > 0.5;
2539
+ tt(l, { immediate: !0 }), u && F.current?.scrollTo(l);
2523
2540
  } else
2524
- nt(f.current, { immediate: !0 });
2525
- }, [h, y.top, nt]), Y(() => {
2526
- const o = v.getTotal();
2527
- if (at !== o) {
2528
- jt(o);
2541
+ tt(dt.current, { immediate: !0 });
2542
+ }, [m, y.top, tt]), q(() => {
2543
+ const l = A.getTotal();
2544
+ if (Et !== l) {
2545
+ Xt(l);
2529
2546
  return;
2530
2547
  }
2531
- if (Lt.current) {
2532
- Lt.current = !1;
2533
- const u = k.current;
2534
- if (u && Math.abs(u.getScrollPosition() - f.current) > 0.5) {
2535
- const m = zt(f.current);
2536
- Lt.current = !1, nt(m, { immediate: !0 });
2548
+ if (qt.current) {
2549
+ qt.current = !1;
2550
+ const u = F.current;
2551
+ if (u && Math.abs(u.getScrollPosition() - dt.current) > 0.5) {
2552
+ const h = ee(dt.current);
2553
+ qt.current = !1, tt(h, { immediate: !0 });
2537
2554
  }
2538
2555
  }
2539
- }, [v, at, n, zt, nt]), Y(() => {
2540
- if (U.current !== null) {
2541
- const { index: o, align: u, offset: m } = U.current, V = gt(o, n), { cumulative: A, currentValue: F } = v.prefixSum(V, { materializeOption: { materialize: !1 } });
2542
- if (A !== void 0 && F !== void 0) {
2543
- const K = Math.max(A - F, 0);
2544
- let W = K;
2545
- u === "bottom" ? W = A - i : u === "center" && (W = K + F / 2 - i / 2), m && (W -= m), W = Math.max(0, W);
2546
- const Pt = Math.max(0, at + y.top + y.bottom - i), pt = Math.min(ge(W, y.top), Pt);
2547
- Math.abs(pt - f.current) > 1 && (C.debug("[VirtualScroll] Drift correction", {
2548
- from: f.current,
2549
- to: pt,
2550
- targetIndex: V
2551
- }), ot.current === 0 && (ot.current += 1), k.current?.scrollTo(pt), nt(pt, { immediate: !0 }));
2556
+ }, [A, Et, n, ee, tt]), q(() => {
2557
+ if (W.current !== null) {
2558
+ const { index: l, align: u, offset: h } = W.current, R = It(l, n), { cumulative: O, currentValue: Y } = A.prefixSum(R, { materializeOption: { materialize: !1 } });
2559
+ if (O !== void 0 && Y !== void 0) {
2560
+ const U = Math.max(O - Y, 0);
2561
+ let G = U;
2562
+ u === "bottom" ? G = O - i : u === "center" && (G = U + Y / 2 - i / 2), h && (G -= h), G = Math.max(0, G);
2563
+ const Rt = Math.max(0, Et + y.top + y.bottom - i), bt = Math.min(Ie(G, y.top), Rt);
2564
+ Math.abs(bt - dt.current) > 1 && (C.debug("[VirtualScroll] Drift correction", {
2565
+ from: dt.current,
2566
+ to: bt,
2567
+ targetIndex: R
2568
+ }), Q.current === 0 && (Q.current += 1), F.current?.scrollTo(bt), tt(bt, { immediate: !0 }));
2552
2569
  }
2553
2570
  }
2554
- $t.current = !1;
2555
- }, [at, v, n, y.top, nt, i, y.bottom]), Y(() => {
2556
- const o = dt.current;
2557
- if (o === y.top) return;
2558
- const u = ne(f.current, o), m = ge(u, y.top);
2559
- dt.current = y.top, f.current = m, k.current?.scrollTo(m), nt(m, { immediate: !0 });
2560
- }, [y.top, nt]);
2561
- const ve = S(
2562
- (o, u) => {
2571
+ le.current = !1;
2572
+ }, [Et, A, n, y.top, tt, i, y.bottom]), q(() => {
2573
+ const l = p.current;
2574
+ if (l === y.top) return;
2575
+ const u = oe(dt.current, l), h = Ie(u, y.top);
2576
+ p.current = y.top, dt.current = h, F.current?.scrollTo(h), tt(h, { immediate: !0 });
2577
+ }, [y.top, tt]);
2578
+ const we = S(
2579
+ (l, u) => {
2563
2580
  if (n === 0)
2564
2581
  return;
2565
- const m = gt(o, n), V = v.get(m), A = u - V, F = v.update(m, u);
2566
- F !== void 0 && jt(F), C.debug("[VirtualScroll] Updated item size manually", { index: m, size: u, total: F });
2567
- let K = U.current ? U.current.index : null;
2568
- if (K === null) {
2569
- const W = f.current, Pt = Ue(z).top, pt = ne(W, Pt), { index: ht, cumulative: kt } = v.findIndexAtOrAfter(pt, { materializeOption: { materialize: !1 } });
2570
- K = kt !== void 0 && kt === pt ? ht + 1 : ht;
2582
+ const h = It(l, n), R = A.get(h), O = u - R, Y = A.update(h, u);
2583
+ Y !== void 0 && Xt(Y), C.debug("[VirtualScroll] Updated item size manually", { index: h, size: u, total: Y });
2584
+ let U = W.current ? W.current.index : null;
2585
+ if (U === null) {
2586
+ const G = dt.current, Rt = Ke(B).top, bt = oe(G, Rt), { index: xt, cumulative: Ft } = A.findIndexAtOrAfter(bt, { materializeOption: { materialize: !1 } });
2587
+ U = Ft !== void 0 && Ft === bt ? xt + 1 : xt;
2571
2588
  }
2572
- if (K !== -1 && m < K && A !== 0) {
2573
- const W = f.current, Pt = W + A;
2574
- zt(Pt), nt(Pt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: W, to: Pt, causedByIndex: m, delta: A, activeVisibleStartIndex: K });
2589
+ if (U !== -1 && h < U && O !== 0) {
2590
+ const G = dt.current, Rt = G + O;
2591
+ ee(Rt), tt(Rt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: G, to: Rt, causedByIndex: h, delta: O, activeVisibleStartIndex: U });
2575
2592
  }
2576
2593
  },
2577
- [v, n, zt, nt, z]
2594
+ [A, n, ee, tt, B]
2578
2595
  ), Wt = S(
2579
- (o, u) => {
2580
- if (!k.current || n === 0)
2596
+ (l, u) => {
2597
+ if (!F.current || n === 0)
2581
2598
  return;
2582
- const m = gt(o, n), V = gt(m - s * 2, n), A = gt(m + s * 2, n), { cumulative: F, total: K, currentValue: W } = v.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: V, to: A }] } });
2583
- if (C.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", F, "Total height:", K, "ItemHeight:", W, "safeIndexFrom:", V, "safeIndexTo:", A), !K)
2599
+ const h = It(l, n), R = It(h - s * 2, n), O = It(h + s * 2, n), { cumulative: Y, total: U, currentValue: G } = A.prefixSum(h, { materializeOption: { materialize: !0, ranges: [{ from: R, to: O }] } });
2600
+ if (C.debug("[VirtualScroll] Scrolling to index:", h, "ItemBottom:", Y, "Total height:", U, "ItemHeight:", G, "safeIndexFrom:", R, "safeIndexTo:", O), !U)
2584
2601
  return;
2585
- const Pt = Math.max(F - W, 0);
2586
- let pt = Pt;
2587
- u?.align === "bottom" ? pt = F - i : u?.align === "center" && (pt = Pt + W / 2 - i / 2), u?.offset && (pt -= u.offset), pt = Math.max(0, pt);
2588
- const ht = ge(pt, y.top), kt = k.current?.getContentSize() ?? K + y.top + y.bottom, Vt = Math.max(0, kt - i), Ot = Math.min(ht, Vt);
2589
- U.current = {
2590
- index: m,
2602
+ const Rt = Math.max(Y - G, 0);
2603
+ let bt = Rt;
2604
+ u?.align === "bottom" ? bt = Y - i : u?.align === "center" && (bt = Rt + G / 2 - i / 2), u?.offset && (bt -= u.offset), bt = Math.max(0, bt);
2605
+ const xt = Ie(bt, y.top), Ft = F.current?.getContentSize() ?? U + y.top + y.bottom, Dt = Math.max(0, Ft - i), zt = Math.min(xt, Dt);
2606
+ W.current = {
2607
+ index: h,
2591
2608
  align: u?.align,
2592
2609
  offset: u?.offset
2593
2610
  };
2594
- const Se = k.current?.getScrollPosition() ?? -1, De = Math.abs(Se - Ot) > 0.5;
2595
- ft.current = !1, ot.current = 0, De && (ft.current = !0, ot.current += 1, k.current?.scrollTo(Ot)), jt(K), nt(Ot, { immediate: !0 }), C.debug("[VirtualScroll] Setting scroll position to:", Ot, { original: ht, max: Vt });
2611
+ const Pe = F.current?.getScrollPosition() ?? -1, Le = Math.abs(Pe - zt) > 0.5;
2612
+ st.current = !1, Q.current = 0, Le && (st.current = !0, Q.current += 1, F.current?.scrollTo(zt)), Xt(U), tt(zt, { immediate: !0 }), C.debug("[VirtualScroll] Setting scroll position to:", zt, { original: xt, max: Dt });
2596
2613
  },
2597
- [v, s, n, y.top, y.bottom, i, nt]
2598
- ), ye = S(
2599
- (o) => {
2600
- if (!k.current || n === 0)
2614
+ [A, s, n, y.top, y.bottom, i, tt]
2615
+ ), ge = S(
2616
+ (l) => {
2617
+ if (!F.current || n === 0)
2601
2618
  return;
2602
- const u = v.getTotal(), m = It(Math.floor(o), 0, u), { index: V, cumulative: A, currentValue: F } = v.findIndexAtOrAfter(m, { materializeOption: { materialize: !1 } }), W = (A ?? 0) - (F ?? 0) - m;
2603
- Wt(V, { offset: W });
2619
+ const u = A.getTotal(), h = vt(Math.floor(l), 0, u), { index: R, cumulative: O, currentValue: Y } = A.findIndexAtOrAfter(h, { materializeOption: { materialize: !1 } }), G = (O ?? 0) - (Y ?? 0) - h;
2620
+ Wt(R, { offset: G });
2604
2621
  },
2605
- [v, n, Wt]
2606
- ), fe = S(
2607
- (o) => {
2608
- const u = ne(f.current, y.top), m = typeof o == "function" ? o(u) : o;
2609
- ye(m);
2610
- const V = k.current?.getScrollPosition(), A = typeof V == "number" ? V : f.current;
2611
- return nt(A), A;
2622
+ [A, n, Wt]
2623
+ ), Re = S(
2624
+ (l) => {
2625
+ const u = oe(dt.current, y.top), h = typeof l == "function" ? l(u) : l;
2626
+ ge(h);
2627
+ const R = F.current?.getScrollPosition(), O = typeof R == "number" ? R : dt.current;
2628
+ return tt(O), O;
2612
2629
  },
2613
- [y.top, ye, nt]
2614
- ), Ae = S(
2615
- (o, u) => {
2616
- C.debug("[VirtualScroll] Scroll position changed:", o);
2617
- const m = ft.current;
2618
- m && (ft.current = !1);
2619
- const V = ot.current > 0;
2620
- if (V && (ot.current = 0), m || V || $t.current || (U.current = null), nt(o), B) {
2621
- if (m || V)
2630
+ [y.top, ge, tt]
2631
+ ), De = S(
2632
+ (l, u) => {
2633
+ C.debug("[VirtualScroll] Scroll position changed:", l);
2634
+ const h = st.current;
2635
+ h && (st.current = !1);
2636
+ const R = Q.current > 0;
2637
+ if (R && (Q.current = 0), h || R || le.current || (W.current = null), tt(l), $) {
2638
+ if (h || R)
2622
2639
  return;
2623
- const A = o - u;
2624
- if (C.debug("[VirtualScroll] Scroll diff:", A, "New:", o, "Prev:", u), Math.abs(A) > 1) {
2625
- const F = A > 0 ? "down" : "up";
2626
- Nt(F), Dt(!0), C.debug("[VirtualScroll] Showing scroll buttons. Direction:", F), Mt.current && clearTimeout(Mt.current), Mt.current = setTimeout(() => {
2627
- Dt(!1), C.debug("[VirtualScroll] Hiding scroll buttons");
2640
+ const O = l - u;
2641
+ if (C.debug("[VirtualScroll] Scroll diff:", O, "New:", l, "Prev:", u), Math.abs(O) > 1) {
2642
+ const Y = O > 0 ? "down" : "up";
2643
+ Ot(Y), it(!0), C.debug("[VirtualScroll] Showing scroll buttons. Direction:", Y), ht.current && clearTimeout(ht.current), ht.current = setTimeout(() => {
2644
+ it(!1), C.debug("[VirtualScroll] Hiding scroll buttons");
2628
2645
  }, 2e3);
2629
2646
  }
2630
2647
  }
2631
2648
  },
2632
- [nt, B]
2633
- ), te = At(() => ne(Bt, y.top), [y.top, Bt]), se = At(() => {
2634
- const o = v.getTotal(), u = Er(te, i, s, n, r, v, o);
2649
+ [tt, $]
2650
+ ), re = Lt(() => oe(Bt, y.top), [y.top, Bt]), jt = Lt(() => {
2651
+ const l = A.getTotal(), u = Vr(re, i, s, n, r, A, l);
2635
2652
  return C.debug("[VirtualScroll] Calculated rendering range:", () => ({
2636
2653
  ...u,
2637
- scrollPosition: te,
2638
- renderingContentSize: o,
2654
+ scrollPosition: re,
2655
+ renderingContentSize: l,
2639
2656
  overscanCount: s,
2640
2657
  viewportSize: i
2641
2658
  })), u;
2642
- }, [te, i, s, n, r, v]), { renderingStartIndex: Kt, renderingEndIndex: ee, visibleStartIndex: oe, visibleEndIndex: me } = se, re = S(
2643
- (o, u) => {
2644
- if (!p || n === 0)
2659
+ }, [re, i, s, n, r, A]), { renderingStartIndex: ne, renderingEndIndex: ie, visibleStartIndex: de, visibleEndIndex: be } = jt, se = S(
2660
+ (l, u) => {
2661
+ if (!V || n === 0)
2645
2662
  return;
2646
- const m = gt(o, n);
2663
+ const h = It(l, n);
2647
2664
  if (!(u?.ensureVisible ?? !0)) {
2648
- const Vt = it.current.get(m);
2649
- Vt && (J.current = null, yt.current = m, ct(Vt));
2665
+ const Dt = z.current.get(h);
2666
+ Dt && (et.current = null, ct.current = h, $t(Dt));
2650
2667
  return;
2651
2668
  }
2652
- const A = v.prefixSum(m, { materializeOption: { materialize: !1 } }), F = A.currentValue, K = Math.max(A.cumulative - F, 0), W = K + F, Pt = ne(f.current, y.top), pt = Pt + i;
2653
- if (K < Pt || W > pt) {
2654
- Wt(m);
2655
- const Vt = it.current.get(m);
2656
- Vt ? (J.current = null, yt.current = m, ct(Vt)) : J.current = m;
2669
+ const O = A.prefixSum(h, { materializeOption: { materialize: !1 } }), Y = O.currentValue, U = Math.max(O.cumulative - Y, 0), G = U + Y, Rt = oe(dt.current, y.top), bt = Rt + i;
2670
+ if (U < Rt || G > bt) {
2671
+ Wt(h);
2672
+ const Dt = z.current.get(h);
2673
+ Dt ? (et.current = null, ct.current = h, $t(Dt)) : et.current = h;
2657
2674
  return;
2658
2675
  }
2659
- const kt = it.current.get(m);
2660
- if (kt) {
2661
- J.current = null, yt.current = m, ct(kt);
2676
+ const Ft = z.current.get(h);
2677
+ if (Ft) {
2678
+ et.current = null, ct.current = h, $t(Ft);
2662
2679
  return;
2663
2680
  }
2664
- J.current = m;
2681
+ et.current = h;
2665
2682
  },
2666
- [p, n, v, y.top, Wt, ct, i]
2667
- ), we = S(
2668
- (o, u) => {
2669
- if (!p || o.defaultPrevented || o.altKey || o.metaKey || o.ctrlKey)
2683
+ [V, n, A, y.top, Wt, $t, i]
2684
+ ), Ce = S(
2685
+ (l, u) => {
2686
+ if (!V || l.defaultPrevented || l.altKey || l.metaKey || l.ctrlKey)
2670
2687
  return;
2671
- const m = o.target;
2672
- if (m) {
2673
- const V = m.tagName;
2674
- if (V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || m.isContentEditable)
2688
+ const h = l.target;
2689
+ if (h) {
2690
+ const R = h.tagName;
2691
+ if (R === "INPUT" || R === "TEXTAREA" || R === "SELECT" || h.isContentEditable)
2675
2692
  return;
2676
2693
  }
2677
- if (o.key === "ArrowDown") {
2678
- u < n - 1 && (o.preventDefault(), re(u + 1));
2694
+ if (l.key === "ArrowDown") {
2695
+ u < n - 1 && (l.preventDefault(), se(u + 1));
2679
2696
  return;
2680
2697
  }
2681
- if (o.key === "ArrowUp") {
2682
- u > 0 && (o.preventDefault(), re(u - 1));
2698
+ if (l.key === "ArrowUp") {
2699
+ u > 0 && (l.preventDefault(), se(u - 1));
2683
2700
  return;
2684
2701
  }
2685
- if (o.key === "PageDown") {
2702
+ if (l.key === "PageDown") {
2686
2703
  if (u < n - 1) {
2687
- o.preventDefault();
2688
- const { visibleStartIndex: V, visibleEndIndex: A } = Ct.current, F = Math.max(A - V + 1, 1), K = Math.max(F, 1), W = gt(Math.min(u + K, n - 1), n);
2689
- re(W);
2704
+ l.preventDefault();
2705
+ const { visibleStartIndex: R, visibleEndIndex: O } = Ct.current, Y = Math.max(O - R + 1, 1), U = Math.max(Y, 1), G = It(Math.min(u + U, n - 1), n);
2706
+ se(G);
2690
2707
  }
2691
2708
  return;
2692
2709
  }
2693
- if (o.key === "PageUp" && u > 0) {
2694
- o.preventDefault();
2695
- const { visibleStartIndex: V, visibleEndIndex: A } = Ct.current, F = Math.max(A - V + 1, 1), K = Math.max(F, 1), W = gt(u - K, n);
2696
- re(W);
2710
+ if (l.key === "PageUp" && u > 0) {
2711
+ l.preventDefault();
2712
+ const { visibleStartIndex: R, visibleEndIndex: O } = Ct.current, Y = Math.max(O - R + 1, 1), U = Math.max(Y, 1), G = It(u - U, n);
2713
+ se(G);
2697
2714
  }
2698
2715
  },
2699
- [p, n, re]
2700
- ), Re = S(
2701
- (o) => {
2702
- if (!p)
2716
+ [V, n, se]
2717
+ ), ve = S(
2718
+ (l) => {
2719
+ if (!V)
2703
2720
  return;
2704
- const u = gt(o, n);
2705
- J.current = null, yt.current = u, j?.(u);
2721
+ const u = It(l, n);
2722
+ et.current = null, ct.current = u, Z?.(u);
2706
2723
  },
2707
- [p, n, j]
2724
+ [V, n, Z]
2708
2725
  );
2709
- Y(() => {
2710
- const o = k.current?.getScrollPosition() ?? 0, u = f.current, m = ne(u, y.top);
2726
+ q(() => {
2727
+ const l = F.current?.getScrollPosition() ?? 0, u = dt.current, h = oe(u, y.top);
2711
2728
  C.debug("[VirtualScroll] Range change effect triggered", () => ({
2712
- renderingStartIndex: Kt,
2713
- renderingEndIndex: ee,
2714
- visibleStartIndex: oe,
2715
- visibleEndIndex: me,
2729
+ renderingStartIndex: ne,
2730
+ renderingEndIndex: ie,
2731
+ visibleStartIndex: de,
2732
+ visibleEndIndex: be,
2716
2733
  scrollPositionState: Bt,
2717
2734
  paneScrollPosition: u,
2718
- logicalScrollPosition: m,
2719
- contentSize: at,
2720
- scrollPaneScrollPosition: o
2721
- })), qt({
2722
- renderingStartIndex: Kt,
2723
- renderingEndIndex: ee,
2724
- visibleStartIndex: oe,
2725
- visibleEndIndex: me,
2726
- scrollPosition: m,
2727
- totalHeight: at
2735
+ logicalScrollPosition: h,
2736
+ contentSize: Et,
2737
+ scrollPaneScrollPosition: l
2738
+ })), w({
2739
+ renderingStartIndex: ne,
2740
+ renderingEndIndex: ie,
2741
+ visibleStartIndex: de,
2742
+ visibleEndIndex: be,
2743
+ scrollPosition: h,
2744
+ totalHeight: Et
2728
2745
  });
2729
- }, [at, ee, Kt, y.top, qt, Bt, me, oe]);
2730
- const Ce = S(() => B ? /* @__PURE__ */ st("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": rt && wt !== null, children: wt === "up" ? /* @__PURE__ */ st("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ st(
2746
+ }, [Et, ie, ne, y.top, w, Bt, be, de]);
2747
+ const Ee = S(() => $ ? /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": Mt && kt !== null, children: kt === "up" ? /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ ot(
2731
2748
  "button",
2732
2749
  {
2733
2750
  type: "button",
2734
2751
  className: "aqvs-scroll-to-edge-button",
2735
- onClick: (m) => {
2736
- m.stopPropagation(), ft.current = !0, Wt(0), Dt(!1);
2752
+ onClick: (h) => {
2753
+ h.stopPropagation(), st.current = !0, Wt(0), it(!1);
2737
2754
  },
2738
2755
  children: "Top"
2739
2756
  }
2740
- ) }) : /* @__PURE__ */ st("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ st(
2757
+ ) }) : /* @__PURE__ */ ot("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ ot(
2741
2758
  "button",
2742
2759
  {
2743
2760
  type: "button",
2744
2761
  className: "aqvs-scroll-to-edge-button",
2745
- onClick: (m) => {
2746
- m.stopPropagation(), ft.current = !0, Wt(n - 1), Dt(!1);
2762
+ onClick: (h) => {
2763
+ h.stopPropagation(), st.current = !0, Wt(n - 1), it(!1);
2747
2764
  },
2748
2765
  children: "Bottom"
2749
2766
  }
2750
- ) }) }) : null, [B, rt, wt, Wt, n]), pe = T(0), { visibleItems: a, renderAnchor: b } = At(() => {
2767
+ ) }) }) : null, [$, Mt, kt, Wt, n]), o = I(0), { visibleItems: g, renderAnchor: M } = Lt(() => {
2751
2768
  if (n === 0)
2752
2769
  return {
2753
- visibleItems: /* @__PURE__ */ st("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ st("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2770
+ visibleItems: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ ot("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2754
2771
  renderAnchor: 0
2755
2772
  };
2756
- const o = gt(Kt, n), u = gt(ee, n), { cumulative: m, currentValue: V } = v.prefixSum(o, { materializeOption: { materialize: !1 } }), A = m - V;
2757
- Number.isFinite(A) && Math.abs(A - pe.current) > Rr && (pe.current = A);
2758
- const F = pe.current, K = [], W = [];
2759
- let Pt = 0, pt = A;
2760
- for (let ht = o; ht <= u; ht++) {
2761
- if (W.length >= Ke) {
2762
- C.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Ke, safeRenderingStartIndex: o, safeRenderingEndIndex: u });
2773
+ const l = It(ne, n), u = It(ie, n), { cumulative: h, currentValue: R } = A.prefixSum(l, { materializeOption: { materialize: !1 } }), O = h - R;
2774
+ Number.isFinite(O) && Math.abs(O - o.current) > Er && (o.current = O);
2775
+ const Y = o.current, U = [], G = [];
2776
+ let Rt = 0, bt = O;
2777
+ for (let xt = l; xt <= u; xt++) {
2778
+ if (G.length >= We) {
2779
+ C.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: We, safeRenderingStartIndex: l, safeRenderingEndIndex: u });
2763
2780
  break;
2764
2781
  }
2765
- const kt = r(ht), Vt = v.get(ht), Ot = kt - Vt;
2766
- Ot !== 0 && K.push({ index: ht, value: kt });
2767
- const Se = pt + Pt, De = e ? e(ht) : ht;
2768
- W.push(
2769
- /* @__PURE__ */ st(
2770
- Nr,
2782
+ const Ft = r(xt), Dt = A.get(xt), zt = Ft - Dt;
2783
+ zt !== 0 && U.push({ index: xt, value: Ft });
2784
+ const Pe = bt + Rt, Le = e ? e(xt) : xt;
2785
+ G.push(
2786
+ /* @__PURE__ */ ot(
2787
+ Ar,
2771
2788
  {
2772
- index: ht,
2773
- top: Se - F,
2774
- height: kt,
2775
- item: t(ht),
2776
- clipItemHeight: Rt,
2777
- enableKeyboardNavigation: p,
2778
- onKeyDown: we,
2779
- onFocus: Re,
2780
- registerItemRef: vt,
2781
- children: I
2789
+ index: xt,
2790
+ top: Pe - Y,
2791
+ height: Ft,
2792
+ item: t(xt),
2793
+ clipItemHeight: yt,
2794
+ enableKeyboardNavigation: V,
2795
+ onKeyDown: Ce,
2796
+ onFocus: ve,
2797
+ registerItemRef: wt,
2798
+ children: x
2782
2799
  },
2783
- De
2800
+ Le
2784
2801
  )
2785
- ), Pt += Ot, pt += Vt;
2802
+ ), Rt += zt, bt += Dt;
2786
2803
  }
2787
- return K.length > 0 && Promise.resolve().then(() => {
2788
- if (Et.current)
2804
+ return U.length > 0 && Promise.resolve().then(() => {
2805
+ if (At.current)
2789
2806
  return;
2790
- let ht = 0;
2791
- for (const Ot of K)
2792
- if (Ot.index < oe) {
2793
- const Se = v.get(Ot.index);
2794
- ht += Ot.value - Se;
2807
+ let xt = 0;
2808
+ for (const zt of U)
2809
+ if (zt.index < de) {
2810
+ const Pe = A.get(zt.index);
2811
+ xt += zt.value - Pe;
2795
2812
  }
2796
- const kt = v.updates(K);
2797
- if (Et.current || typeof kt != "number")
2813
+ const Ft = A.updates(U);
2814
+ if (At.current || typeof Ft != "number")
2798
2815
  return;
2799
- jt(kt), C.debug("[VirtualScroll] Updated heights for items", K, "New total height:", kt);
2800
- const Vt = k.current?.getScrollPosition() ?? f.current;
2801
- if (ht !== 0) {
2802
- const Ot = Vt + ht;
2803
- zt(Ot), nt(Ot, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Vt, to: Ot, shiftAmount: ht });
2804
- } else Vt !== f.current && nt(Vt);
2805
- }), { visibleItems: W, renderAnchor: F };
2816
+ Xt(Ft), C.debug("[VirtualScroll] Updated heights for items", U, "New total height:", Ft);
2817
+ const Dt = F.current?.getScrollPosition() ?? dt.current;
2818
+ if (xt !== 0) {
2819
+ const zt = Dt + xt;
2820
+ ee(zt), tt(zt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Dt, to: zt, shiftAmount: xt });
2821
+ } else Dt !== dt.current && tt(Dt);
2822
+ }), { visibleItems: G, renderAnchor: Y };
2806
2823
  }, [
2807
- I,
2808
- Rt,
2809
- at,
2810
- p,
2824
+ x,
2825
+ yt,
2826
+ Et,
2827
+ V,
2811
2828
  n,
2812
- v,
2829
+ A,
2813
2830
  t,
2814
2831
  e,
2815
2832
  r,
2816
- Re,
2817
- we,
2818
- zt,
2819
- vt,
2833
+ ve,
2834
+ Ce,
2820
2835
  ee,
2821
- Kt,
2822
- nt,
2823
- oe
2824
- ]), R = S(
2825
- (o) => {
2826
- const u = (_ ?? 0) > 0, m = Math.abs(o - Bt), V = u && m > 0.5 ? Bt : o, A = ne(V, y.top);
2836
+ wt,
2837
+ ie,
2838
+ ne,
2839
+ tt,
2840
+ de
2841
+ ]), L = S(
2842
+ (l) => {
2843
+ const u = (_ ?? 0) > 0, h = Math.abs(l - Bt), R = u && h > 0.5 ? Bt : l, O = oe(R, y.top);
2827
2844
  if (C.debug("[VirtualScroll] Rendering visible items", () => ({
2828
- currentScrollPosition: o,
2829
- effectiveScrollPosition: A,
2830
- renderingStartIndex: Kt,
2831
- renderingEndIndex: ee,
2845
+ currentScrollPosition: l,
2846
+ effectiveScrollPosition: O,
2847
+ renderingStartIndex: ne,
2848
+ renderingEndIndex: ie,
2832
2849
  itemCount: n,
2833
2850
  viewportSize: i,
2834
2851
  callbackThrottleMs: _,
2835
- diff: m,
2836
- rawEffectiveScrollPosition: V
2852
+ diff: h,
2853
+ rawEffectiveScrollPosition: R
2837
2854
  })), n === 0)
2838
- return a;
2839
- const F = y.top + b - V, K = y.bottom > 0 ? /* @__PURE__ */ st(
2855
+ return g;
2856
+ const Y = y.top + M - R, U = y.bottom > 0 ? /* @__PURE__ */ ot(
2840
2857
  "div",
2841
2858
  {
2842
2859
  className: "aqvs-bottom-inset",
2843
2860
  style: {
2844
2861
  // ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
2845
- top: v.getTotal() - b,
2862
+ top: A.getTotal() - M,
2846
2863
  height: y.bottom
2847
2864
  }
2848
2865
  },
2849
2866
  "virtualscroll-bottom-inset"
2850
2867
  ) : null;
2851
2868
  return C.debug("[VirtualScroll] Rendering items", () => ({
2852
- containerTop: F,
2853
- logicalScrollPosition: te,
2869
+ containerTop: Y,
2870
+ logicalScrollPosition: re,
2854
2871
  resolvedInsets: y,
2855
- effectiveScrollPosition: A
2856
- })), /* @__PURE__ */ ue("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${F}px)`, willChange: "transform" }, children: [
2857
- a,
2858
- K
2872
+ effectiveScrollPosition: O
2873
+ })), /* @__PURE__ */ he("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${Y}px)`, willChange: "transform" }, children: [
2874
+ g,
2875
+ U
2859
2876
  ] });
2860
2877
  },
2861
- [_, n, v, te, b, ee, Kt, y, Bt, i, a]
2862
- ), L = At(
2878
+ [_, n, A, re, M, ie, ne, y, Bt, i, g]
2879
+ ), H = Lt(
2863
2880
  () => ({
2864
- renderingStartIndex: se.renderingStartIndex,
2865
- renderingEndIndex: se.renderingEndIndex,
2866
- visibleStartIndex: se.visibleStartIndex,
2867
- visibleEndIndex: se.visibleEndIndex,
2868
- scrollPosition: te,
2869
- totalHeight: v.getTotal()
2881
+ renderingStartIndex: jt.renderingStartIndex,
2882
+ renderingEndIndex: jt.renderingEndIndex,
2883
+ visibleStartIndex: jt.visibleStartIndex,
2884
+ visibleEndIndex: jt.visibleEndIndex,
2885
+ scrollPosition: re,
2886
+ totalHeight: A.getTotal()
2870
2887
  // contentSize (State) ではなく最新値を反映
2871
2888
  }),
2872
2889
  // contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
2873
2890
  // (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
2874
- [se, te, v, at]
2891
+ [jt, re, A, Et]
2875
2892
  );
2876
- Y(() => {
2877
- Ct.current = L;
2878
- }, [L]), Be(
2879
- mt,
2893
+ q(() => {
2894
+ Ct.current = H;
2895
+ }, [H]), qe(
2896
+ Pt,
2880
2897
  () => ({
2881
- getScrollPosition: () => k.current?.getScrollPosition() ?? -1,
2882
- getContentSize: () => k.current?.getContentSize() ?? -1,
2883
- getViewportSize: () => k.current?.getViewportSize() ?? -1,
2884
- scrollTo: fe,
2898
+ getScrollPosition: () => F.current?.getScrollPosition() ?? -1,
2899
+ getContentSize: () => F.current?.getContentSize() ?? -1,
2900
+ getViewportSize: () => F.current?.getViewportSize() ?? -1,
2901
+ scrollTo: Re,
2885
2902
  scrollToIndex: Wt,
2886
- getFenwickTreeTotalHeight: () => v.getTotal(),
2887
- getFenwickSize: () => v.getSize(),
2888
- focusItemAtIndex: re,
2903
+ getFenwickTreeTotalHeight: () => A.getTotal(),
2904
+ getFenwickSize: () => A.getSize(),
2905
+ focusItemAtIndex: se,
2889
2906
  getRange: () => Ct.current,
2890
- updateItemSize: ve
2907
+ updateItemSize: we
2891
2908
  }),
2892
- [fe, Wt, v, re, ve]
2909
+ [Re, Wt, A, se, we]
2893
2910
  );
2894
- const X = v.getTotal() + y.top + y.bottom;
2895
- return /* @__PURE__ */ st(
2896
- Tr,
2911
+ const St = A.getTotal() + y.top + y.bottom;
2912
+ return /* @__PURE__ */ ot(
2913
+ vr,
2897
2914
  {
2898
- ref: k,
2899
- contentSize: X,
2915
+ ref: F,
2916
+ contentSize: St,
2900
2917
  viewportSize: i,
2901
- className: l,
2918
+ className: a,
2902
2919
  testId: c,
2903
- onScroll: Ae,
2904
- background: M,
2905
- tapScrollCircleOptions: q,
2906
- inertiaOptions: St,
2920
+ onScroll: De,
2921
+ background: v,
2922
+ tapScrollCircleOptions: lt,
2923
+ inertiaOptions: Yt,
2907
2924
  itemCount: n,
2908
- scrollBarWidth: Tt,
2909
- enableThumbDrag: D,
2910
- enableTrackClick: O,
2911
- enableArrowButtons: P,
2912
- enablePointerDrag: et,
2913
- pointerDragInputs: G,
2925
+ scrollBarWidth: D,
2926
+ enableThumbDrag: k,
2927
+ enableTrackClick: P,
2928
+ enableArrowButtons: X,
2929
+ enablePointerDrag: K,
2930
+ pointerDragInputs: T,
2914
2931
  renderThumbOverlay: N,
2915
- wheelSpeedMultiplier: $,
2916
- onWheelHorizontal: tt,
2932
+ wheelSpeedMultiplier: Tt,
2933
+ onWheelHorizontal: nt,
2917
2934
  contentInsets: y,
2918
- visibleStartIndex: oe,
2919
- visibleEndIndex: me,
2920
- renderOverlay: Ce,
2921
- initialScrollPosition: Xt.position,
2922
- children: R
2935
+ contentProps: pt,
2936
+ visibleStartIndex: de,
2937
+ visibleEndIndex: be,
2938
+ renderOverlay: Ee,
2939
+ initialScrollPosition: j.position,
2940
+ children: L
2923
2941
  }
2924
2942
  );
2925
- }, Or = Ye(Vr);
2943
+ }, zr = Be(Dr);
2926
2944
  export {
2927
- le as FenwickMapTree,
2928
- xr as ScrollBar,
2929
- Tr as ScrollPane,
2930
- Ze as TAP_SCROLL_SPEED_DEFAULTS,
2931
- Or as VirtualScroll,
2932
- br as computeAutoTapScrollMaxSpeedMultiplier,
2933
- gr as computeTapScrollSpeed,
2934
- It as minmax,
2935
- _r as tapScrollCircleSampleVisual,
2936
- Mr as useFenwickMapTree,
2937
- kr as useHeightCache,
2938
- yr as useLruCache
2945
+ me as FenwickMapTree,
2946
+ Ir as ScrollBar,
2947
+ vr as ScrollPane,
2948
+ Je as TAP_SCROLL_SPEED_DEFAULTS,
2949
+ zr as VirtualScroll,
2950
+ xr as computeAutoTapScrollMaxSpeedMultiplier,
2951
+ br as computeTapScrollSpeed,
2952
+ vt as minmax,
2953
+ Or as tapScrollCircleSampleVisual,
2954
+ yr as useFenwickMapTree,
2955
+ Fr as useHeightCache,
2956
+ Rr as useLruCache
2939
2957
  };