@aiquants/virtualscroll 3.6.0 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as Q, jsxs as Wt, Fragment as Xr } from "react/jsx-runtime";
2
- import zn, { memo as Nn, forwardRef as Rr, useState as Oe, useRef as d, useCallback as w, useImperativeHandle as Pr, useMemo as Se, useLayoutEffect as Qe, useEffect as q, useId as Cn, createElement as Cr } from "react";
2
+ import zn, { memo as Nn, forwardRef as Rr, useState as Oe, useRef as d, useCallback as w, useImperativeHandle as Pr, useMemo as Me, useLayoutEffect as Qe, useEffect as q, useId as Cn, createElement as Cr } from "react";
3
3
  import { twMerge as Et } from "tailwind-merge";
4
4
  class V {
5
5
  level;
@@ -182,13 +182,13 @@ const Qr = {
182
182
  )
183
183
  ] });
184
184
  }, qr = Nn(
185
- Rr(({ onDragChange: t, className: e, maxVisualDistance: r = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: o, axis: l = "y" }, f) => {
186
- const [g, v] = Oe(Qr), R = d(null), T = d(null), S = d({ x: 0, y: 0 }), N = d(null), ee = d(0), F = w(
185
+ Rr(({ onDragChange: t, className: e, maxVisualDistance: r = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: a, axis: l = "y" }, f) => {
186
+ const [x, v] = Oe(Qr), R = d(null), T = d(null), S = d({ x: 0, y: 0 }), N = d(null), ee = d(0), F = w(
187
187
  (I) => {
188
188
  v(I), t(I);
189
189
  },
190
190
  [t]
191
- ), Me = w(
191
+ ), Ie = w(
192
192
  (I, le, ue = !1) => {
193
193
  const { x: Ye, y: _ } = S.current, Xe = I - Ye, ut = le - _;
194
194
  let nt, Ge;
@@ -211,16 +211,16 @@ const Qr = {
211
211
  });
212
212
  },
213
213
  [F, l]
214
- ), Ie = w((I) => {
214
+ ), ye = w((I) => {
215
215
  if (I === null)
216
216
  return;
217
217
  const le = N.current;
218
218
  le?.hasPointerCapture(I) && le.releasePointerCapture(I);
219
219
  }, []), A = w(
220
220
  (I = !1) => {
221
- I && Ie(R.current), R.current = null, T.current = null, ee.current = 0, F(Qr);
221
+ I && ye(R.current), R.current = null, T.current = null, ee.current = 0, F(Qr);
222
222
  },
223
- [F, Ie]
223
+ [F, ye]
224
224
  ), $ = w(
225
225
  (I) => {
226
226
  if (R.current !== null && R.current !== I.pointerId) {
@@ -234,18 +234,18 @@ const Qr = {
234
234
  le.setPointerCapture(I.pointerId);
235
235
  } catch {
236
236
  }
237
- Me(I.clientX, I.clientY, !0);
237
+ Ie(I.clientX, I.clientY, !0);
238
238
  },
239
- [Me]
239
+ [Ie]
240
240
  ), ie = w(
241
241
  (I) => {
242
242
  if (R.current !== I.pointerId) {
243
243
  T.current !== null && T.current.pointerId === I.pointerId && (T.current = { pointerId: I.pointerId, clientX: I.clientX, clientY: I.clientY });
244
244
  return;
245
245
  }
246
- I.preventDefault(), Me(I.clientX, I.clientY);
246
+ I.preventDefault(), Ie(I.clientX, I.clientY);
247
247
  },
248
- [Me]
248
+ [Ie]
249
249
  ), L = w(
250
250
  (I) => {
251
251
  if (R.current !== I.pointerId) {
@@ -255,7 +255,7 @@ const Qr = {
255
255
  I.preventDefault(), I.stopPropagation();
256
256
  const le = T.current;
257
257
  if (T.current = null, le !== null) {
258
- Ie(I.pointerId);
258
+ ye(I.pointerId);
259
259
  const ue = N.current;
260
260
  let Ye = !0;
261
261
  if (ue !== null && typeof ue.setPointerCapture == "function")
@@ -265,13 +265,13 @@ const Qr = {
265
265
  (typeof _ == "object" && _ !== null && "name" in _ ? _.name : void 0) === "NotFoundError" && (Ye = !1);
266
266
  }
267
267
  if (Ye) {
268
- R.current = le.pointerId, Me(le.clientX, le.clientY, !0);
268
+ R.current = le.pointerId, Ie(le.clientX, le.clientY, !0);
269
269
  return;
270
270
  }
271
271
  }
272
272
  A(!0);
273
273
  },
274
- [A, Ie, Me]
274
+ [A, ye, Ie]
275
275
  ), z = w(
276
276
  (I) => {
277
277
  I.target === I.currentTarget && R.current === I.pointerId && A(!1);
@@ -288,31 +288,31 @@ const Qr = {
288
288
  }),
289
289
  [A]
290
290
  );
291
- const C = Math.min(Math.max(s, 0), 1), K = n / 64, B = Math.min(g.distance, r) / r, Y = g.direction * B * 10 * K;
291
+ const C = Math.min(Math.max(s, 0), 1), K = n / 64, B = Math.min(x.distance, r) / r, Y = x.direction * B * 10 * K;
292
292
  let ae;
293
293
  if (l === "xy") {
294
- const I = g.distance, le = I === 0 ? 0 : Y * g.offsetX / I, ue = I === 0 ? 0 : Y * g.offsetY / I;
294
+ const I = x.distance, le = I === 0 ? 0 : Y * x.offsetX / I, ue = I === 0 ? 0 : Y * x.offsetY / I;
295
295
  ae = `translate(${le}px, ${ue}px)`;
296
296
  } else l === "x" ? ae = `translateX(${Y}px)` : ae = `translateY(${Y}px)`;
297
- const ce = o ?? An, k = {
298
- dragState: g,
297
+ const ce = a ?? An, k = {
298
+ dragState: x,
299
299
  normalizedDistance: B,
300
300
  sizeScale: K,
301
301
  size: n,
302
302
  opacity: C
303
- }, ye = {
303
+ }, Te = {
304
304
  ...i,
305
305
  width: n,
306
306
  height: n,
307
307
  transform: ae
308
308
  };
309
- return ye.opacity = C, /* @__PURE__ */ Q(
309
+ return Te.opacity = C, /* @__PURE__ */ Q(
310
310
  "div",
311
311
  {
312
312
  ref: N,
313
313
  "data-testid": "virtual-scroll-tap-circle",
314
314
  className: Et("aqvs-tap-scroll-circle", e),
315
- style: ye,
315
+ style: Te,
316
316
  tabIndex: -1,
317
317
  onPointerDown: $,
318
318
  onPointerMove: ie,
@@ -330,8 +330,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
330
330
  const r = e === "x", n = t.getBoundingClientRect(), i = r ? n.width : n.height, s = (v) => {
331
331
  const R = Number.parseFloat(v);
332
332
  return Number.isFinite(R) ? R : 0;
333
- }, o = window.getComputedStyle(t), l = s(r ? o.width : o.height), f = l > 0 ? l + s(r ? o.paddingLeft : o.paddingTop) + s(r ? o.paddingRight : o.paddingBottom) + s(r ? o.borderLeftWidth : o.borderTopWidth) + s(r ? o.borderRightWidth : o.borderBottomWidth) : 0, g = f > 0 ? f : r ? t.offsetWidth : t.offsetHeight;
334
- return g <= 0 || i <= 0 ? 1 : i / g;
333
+ }, a = window.getComputedStyle(t), l = s(r ? a.width : a.height), f = l > 0 ? l + s(r ? a.paddingLeft : a.paddingTop) + s(r ? a.paddingRight : a.paddingBottom) + s(r ? a.borderLeftWidth : a.borderTopWidth) + s(r ? a.borderRightWidth : a.borderBottomWidth) : 0, x = f > 0 ? f : r ? t.offsetWidth : t.offsetHeight;
334
+ return x <= 0 || i <= 0 ? 1 : i / x;
335
335
  }, mr = "virtualscroll:tap-scroll-cancel", Jr = 20, Dn = 250, Ln = 60, On = 20, _n = 20, pn = {
336
336
  /** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
337
337
  maxDistance: 240,
@@ -383,12 +383,12 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
383
383
  renderVisual: t?.renderVisual ?? Yt.renderVisual,
384
384
  maxSpeedCurve: t?.maxSpeedCurve ?? Yt.maxSpeedCurve
385
385
  };
386
- }, qn = ({ isDragging: t, isThumbHovered: e, enableThumbDrag: r }) => Se(() => r ? t ? "dragging" : e ? "hover" : "idle" : "disabled", [r, t, e]), $n = ({ canUseArrowButtons: t, enableArrowButtons: e, resetTapScroll: r, scrollByStep: n }) => {
387
- const i = d(null), s = d(null), o = d(null), l = w(() => {
388
- i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), o.current !== null && (window.removeEventListener("pointerup", o.current), window.removeEventListener("pointercancel", o.current), window.removeEventListener("blur", o.current), o.current = null);
386
+ }, qn = ({ isDragging: t, isThumbHovered: e, enableThumbDrag: r }) => Me(() => r ? t ? "dragging" : e ? "hover" : "idle" : "disabled", [r, t, e]), $n = ({ canUseArrowButtons: t, enableArrowButtons: e, resetTapScroll: r, scrollByStep: n }) => {
387
+ const i = d(null), s = d(null), a = d(null), l = w(() => {
388
+ 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);
389
389
  }, []), f = w(() => {
390
390
  l();
391
- }, [l]), g = w(
391
+ }, [l]), x = w(
392
392
  (R) => (T) => {
393
393
  if (!t)
394
394
  return;
@@ -398,7 +398,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
398
398
  }, Ln);
399
399
  }, Dn);
400
400
  const S = () => l();
401
- o.current = S, window.addEventListener("pointerup", S), window.addEventListener("pointercancel", S), window.addEventListener("blur", S);
401
+ a.current = S, window.addEventListener("pointerup", S), window.addEventListener("pointercancel", S), window.addEventListener("blur", S);
402
402
  },
403
403
  [t, l, r, n]
404
404
  ), v = w(
@@ -411,21 +411,21 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
411
411
  t || l();
412
412
  }, [t, l]), q(() => () => {
413
413
  l();
414
- }, [l]), { handleArrowPointerDown: g, handleArrowPointerUp: f, handleArrowKeyDown: v };
415
- }, Yn = 700, er = (t, e) => typeof t == "number" && Number.isFinite(t) ? t : e, kr = ({ distance: t, maxDistance: e, viewportSize: r, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: o }) => {
416
- const l = Math.max(er(t, 0), 0), f = er(e, 0), g = f > 0 ? Math.min(l, f) / f : 1, v = Math.max(er(r, 0), 0), R = Math.max(er(n, 0), 0), T = Math.max(er(i, 0), 0), S = Math.max(v * R, 40), N = s ? S : 1200, ee = Math.max(v * T, N), F = o ? Math.max(er(o.exponentialScale, T), 0) : 0, Me = o ? Math.min(ee, Math.max(v * F, S)) : ee, Ie = Math.max(Me, S);
417
- let A = g ** 1.1;
418
- if (o) {
419
- const ie = Math.min(Math.max(er(o.exponentialSteepness, 0), 0), Yn);
414
+ }, [l]), { handleArrowPointerDown: x, handleArrowPointerUp: f, handleArrowKeyDown: v };
415
+ }, Yn = 700, er = (t, e) => typeof t == "number" && Number.isFinite(t) ? t : e, kr = ({ distance: t, maxDistance: e, viewportSize: r, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
416
+ const l = Math.max(er(t, 0), 0), f = er(e, 0), x = f > 0 ? Math.min(l, f) / f : 1, v = Math.max(er(r, 0), 0), R = Math.max(er(n, 0), 0), T = Math.max(er(i, 0), 0), S = Math.max(v * R, 40), N = s ? S : 1200, ee = Math.max(v * T, N), F = a ? Math.max(er(a.exponentialScale, T), 0) : 0, Ie = a ? Math.min(ee, Math.max(v * F, S)) : ee, ye = Math.max(Ie, S);
417
+ let A = x ** 1.1;
418
+ if (a) {
419
+ const ie = Math.min(Math.max(er(a.exponentialSteepness, 0), 0), Yn);
420
420
  if (ie === 0)
421
- A = g;
421
+ A = x;
422
422
  else {
423
423
  const L = Math.expm1(ie) || 1;
424
- A = Math.min(Math.max(Math.expm1(ie * g) / L, 0), 1);
424
+ A = Math.min(Math.max(Math.expm1(ie * x) / L, 0), 1);
425
425
  }
426
426
  }
427
- const $ = Math.min(Math.max(er(o?.easedOffset, 0), 0), 1);
428
- return S + (Ie - S) * ($ + (1 - $) * A);
427
+ const $ = Math.min(Math.max(er(a?.easedOffset, 0), 0), 1);
428
+ return S + (ye - S) * ($ + (1 - $) * A);
429
429
  }, Wn = (t) => {
430
430
  if (!t || t <= 0)
431
431
  return Vr;
@@ -438,10 +438,10 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
438
438
  onScroll: n,
439
439
  enableThumbDrag: i = !0,
440
440
  enableTrackClick: s = !0,
441
- enableArrowButtons: o = !0,
441
+ enableArrowButtons: a = !0,
442
442
  horizontal: l = !1,
443
443
  enableHorizontalTapCircle: f = !1,
444
- stretchMainSize: g = !1,
444
+ stretchMainSize: x = !1,
445
445
  scrollBarWidth: v = 12,
446
446
  className: R,
447
447
  ariaControls: T,
@@ -449,16 +449,16 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
449
449
  itemCount: N,
450
450
  renderThumbOverlay: ee,
451
451
  visibleStartIndex: F,
452
- visibleEndIndex: Me
452
+ visibleEndIndex: Ie
453
453
  }) => {
454
- const [Ie, A] = Oe(!1), [$, ie] = Oe(!1), [L, z] = Oe(!1), C = d(null), K = d({
454
+ const [ye, A] = Oe(!1), [$, ie] = Oe(!1), [L, z] = Oe(!1), C = d(null), K = d({
455
455
  pointerId: null,
456
456
  startThumbPosition: 0,
457
457
  startClientX: 0,
458
458
  startClientY: 0,
459
459
  scale: 1,
460
460
  captureTarget: null
461
- }), B = d({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), Y = d(r), ae = d(n), ce = d(en), k = d(null), ye = d(null), I = d(null), le = d(0), ue = d(0), Ye = Se(() => Fr(S, N), [N, S]), _ = Se(() => Xn(l), [l]), {
461
+ }), B = d({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), Y = d(r), ae = d(n), ce = d(en), k = d(null), Te = d(null), I = d(null), le = d(0), ue = d(0), Ye = Me(() => Fr(S, N), [N, S]), _ = Me(() => Xn(l), [l]), {
462
462
  enabled: Xe,
463
463
  size: ut,
464
464
  offsetX: nt,
@@ -482,7 +482,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
482
482
  effectiveTrackLength: 0,
483
483
  onScroll: n,
484
484
  scrollPosition: r
485
- }), { mainSizeKey: re, crossSizeKey: Ke, positionKey: ge, selectDelta: D, getPointerCoordinate: Z, arrowLabels: We, arrowIcons: y, directionClass: vt, orientation: et } = _, xt = Math.max(Pe, 1), ct = e / t, Tt = Math.max(e - v * 2, 0), h = ct * Tt, H = Math.min(Math.max(Jr, h || 0), Tt || Jr), se = Math.max(t - e, 0), ne = Math.max(Tt - H, 0), he = se <= 0 || ne <= 0 ? 0 : oe(r / se * ne, 0, ne), xe = he + H / 2, ve = t > e || Ie, Te = ve && o;
485
+ }), { mainSizeKey: re, crossSizeKey: Ke, positionKey: ge, selectDelta: D, getPointerCoordinate: Z, arrowLabels: We, arrowIcons: y, directionClass: vt, orientation: et } = _, xt = Math.max(Pe, 1), ct = e / t, Tt = Math.max(e - v * 2, 0), h = ct * Tt, H = Math.min(Math.max(Jr, h || 0), Tt || Jr), se = Math.max(t - e, 0), ne = Math.max(Tt - H, 0), he = se <= 0 || ne <= 0 ? 0 : oe(r / se * ne, 0, ne), xe = he + H / 2, ve = t > e || ye, Re = ve && a;
486
486
  Qe(() => {
487
487
  Je.current = {
488
488
  viewportSize: e,
@@ -504,7 +504,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
504
504
  }, [n]), q(() => {
505
505
  i || ie(!1);
506
506
  }, [i]);
507
- const _e = qn({ isDragging: Ie, isThumbHovered: $, enableThumbDrag: i }), me = w((u, E) => {
507
+ const _e = qn({ isDragging: ye, isThumbHovered: $, enableThumbDrag: i }), me = w((u, E) => {
508
508
  const O = Je.current, te = E ?? Y.current;
509
509
  if (ae.current) {
510
510
  const He = ae.current(u, te);
@@ -536,7 +536,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
536
536
  },
537
537
  [dt]
538
538
  ), Ee = w(() => {
539
- ye.current !== null && (window.cancelAnimationFrame(ye.current), ye.current = null), I.current = null, le.current = 0, ue.current = 0;
539
+ Te.current !== null && (window.cancelAnimationFrame(Te.current), Te.current = null), I.current = null, le.current = 0, ue.current = 0;
540
540
  }, []), Be = w(() => {
541
541
  ce.current = { ...en }, z(!1), k.current?.reset(), Ee();
542
542
  }, [Ee]), tt = w(
@@ -552,7 +552,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
552
552
  }
553
553
  const te = I.current ?? u, Ce = Math.max((u - te) / 1e3, 0), je = Math.min(Ce, gn);
554
554
  if (I.current = u, je <= 0) {
555
- ye.current = window.requestAnimationFrame(tt);
555
+ Te.current = window.requestAnimationFrame(tt);
556
556
  return;
557
557
  }
558
558
  const St = kr({
@@ -570,11 +570,11 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
570
570
  Ee();
571
571
  return;
572
572
  }
573
- ye.current = window.requestAnimationFrame(tt);
573
+ Te.current = window.requestAnimationFrame(tt);
574
574
  },
575
575
  [ft, Ee]
576
576
  ), it = w(() => {
577
- ye.current === null && (I.current = null, le.current = 0, ye.current = window.requestAnimationFrame(tt));
577
+ Te.current === null && (I.current = null, le.current = 0, Te.current = window.requestAnimationFrame(tt));
578
578
  }, [tt]);
579
579
  q(() => {
580
580
  const u = ce.current;
@@ -615,7 +615,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
615
615
  document.removeEventListener("pointerdown", u, !0);
616
616
  };
617
617
  }, [Be, Xe]);
618
- const Re = (u) => {
618
+ const we = (u) => {
619
619
  if (!ve || ne <= 0 || se <= 0)
620
620
  return 0;
621
621
  const E = oe(u, 0, ne);
@@ -668,8 +668,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
668
668
  },
669
669
  [ft]
670
670
  ), { handleArrowPointerDown: Fe, handleArrowPointerUp: ht, handleArrowKeyDown: ke } = $n({
671
- canUseArrowButtons: Te,
672
- enableArrowButtons: o,
671
+ canUseArrowButtons: Re,
672
+ enableArrowButtons: a,
673
673
  resetTapScroll: Be,
674
674
  scrollByStep: Rt
675
675
  }), Bt = (u) => {
@@ -709,7 +709,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
709
709
  return;
710
710
  const E = u.currentTarget, O = E.getBoundingClientRect(), te = Z(u), Ce = p(E), je = (te - (l ? O.left : O.top)) / Ce;
711
711
  Be();
712
- const St = je - H / 2, He = Re(St);
712
+ const St = je - H / 2, He = we(St);
713
713
  if (me(He), E.setPointerCapture)
714
714
  try {
715
715
  E.setPointerCapture(u.pointerId);
@@ -732,7 +732,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
732
732
  Vt();
733
733
  return;
734
734
  }
735
- const O = u.clientX - E.startClientX, te = u.clientY - E.startClientY, Ce = D(O, te) / (E.scale || 1), je = Re(E.startThumbPosition + Ce);
735
+ const O = u.clientX - E.startClientX, te = u.clientY - E.startClientY, Ce = D(O, te) / (E.scale || 1), je = we(E.startThumbPosition + Ce);
736
736
  me(je), u.cancelable && u.preventDefault();
737
737
  }, zt = (u) => {
738
738
  if (B.current.pointerId !== u.pointerId)
@@ -746,7 +746,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
746
746
  E.hasPointerCapture?.(u.pointerId) && E.releasePointerCapture(u.pointerId), Vt();
747
747
  }, De = (u) => {
748
748
  u.target === u.currentTarget && B.current.pointerId === u.pointerId && Vt();
749
- }, Pt = Se(() => oe((L ? 1 : 0.8) * fe, 0, 1), [L, fe]), At = Se(() => {
749
+ }, Pt = Me(() => oe((L ? 1 : 0.8) * fe, 0, 1), [L, fe]), At = Me(() => {
750
750
  const E = `calc(50% - ${ut / 2}px + ${Ge}px)`;
751
751
  return {
752
752
  left: nt,
@@ -768,8 +768,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
768
768
  onPointerLeave: ht,
769
769
  onPointerCancel: ht,
770
770
  onKeyDown: ke(u),
771
- "aria-disabled": !o,
772
- disabled: !Te,
771
+ "aria-disabled": !a,
772
+ disabled: !Re,
773
773
  children: /* @__PURE__ */ Q("span", { "aria-hidden": "true", children: O })
774
774
  },
775
775
  te
@@ -783,10 +783,10 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
783
783
  thumbPosition: he,
784
784
  thumbCenter: xe,
785
785
  trackSize: Tt,
786
- isDragging: Ie,
786
+ isDragging: ye,
787
787
  isTapScrollActive: L,
788
788
  visibleStartIndex: F,
789
- visibleEndIndex: Me
789
+ visibleEndIndex: Ie
790
790
  } : null;
791
791
  return /* @__PURE__ */ Wt(
792
792
  "div",
@@ -795,7 +795,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
795
795
  style: {
796
796
  // 自己計測ペインの縦バーはインライン主軸寸を書かない (ラチェット遮断 — ペイン仕様 §2.5)。
797
797
  // 横バーは stretch が主軸を寸法決めできないため常に書く
798
- ...g && !l ? {} : { [re]: e },
798
+ ...x && !l ? {} : { [re]: e },
799
799
  [Ke]: v
800
800
  },
801
801
  "data-visible": ve ? "true" : "false",
@@ -847,7 +847,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
847
847
  [ge]: he,
848
848
  ...l ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
849
849
  },
850
- "data-visible": ve || Ie ? "true" : "false",
850
+ "data-visible": ve || ye ? "true" : "false",
851
851
  onPointerDown: Bt,
852
852
  role: "slider",
853
853
  "aria-orientation": l ? "horizontal" : "vertical",
@@ -888,7 +888,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
888
888
  }
889
889
  );
890
890
  }, Bn = ({ offsetX: t, offsetY: e, maxDistance: r, x: n, y: i }) => {
891
- const s = Number.isFinite(t) ? t : 0, o = Number.isFinite(e) ? e : 0, l = Math.hypot(s, o);
891
+ const s = Number.isFinite(t) ? t : 0, a = Number.isFinite(e) ? e : 0, l = Math.hypot(s, a);
892
892
  if (l === 0)
893
893
  return { x: 0, y: 0 };
894
894
  const f = kr({
@@ -899,7 +899,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
899
899
  maxSpeedMultiplier: n.maxSpeedMultiplier,
900
900
  hasCustomMaxSpeedMultiplier: n.hasCustomMaxSpeedMultiplier,
901
901
  curve: n.curve
902
- }), g = kr({
902
+ }), x = kr({
903
903
  distance: l,
904
904
  maxDistance: r,
905
905
  viewportSize: i.viewportSize,
@@ -908,7 +908,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
908
908
  hasCustomMaxSpeedMultiplier: i.hasCustomMaxSpeedMultiplier,
909
909
  curve: i.curve
910
910
  });
911
- return { x: f * s / l, y: g * o / l };
911
+ return { x: f * s / l, y: x * a / l };
912
912
  }, Mi = (t) => {
913
913
  const { quantum: e, resetOnDirectionChange: r = !0 } = t;
914
914
  if (!(Number.isFinite(e) && e > 0))
@@ -958,10 +958,10 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
958
958
  onViewportSizeChange: n,
959
959
  scrollBarWidth: i = 12,
960
960
  enableThumbDrag: s = !0,
961
- enableTrackClick: o = !0,
961
+ enableTrackClick: a = !0,
962
962
  enableArrowButtons: l = !0,
963
963
  enablePointerDrag: f = !0,
964
- pointerDragInputs: g = jn,
964
+ pointerDragInputs: x = jn,
965
965
  onScroll: v,
966
966
  className: R,
967
967
  testId: T,
@@ -969,8 +969,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
969
969
  background: N,
970
970
  tapScrollCircleOptions: ee,
971
971
  inertiaOptions: F,
972
- itemCount: Me,
973
- renderThumbOverlay: Ie,
972
+ itemCount: Ie,
973
+ renderThumbOverlay: ye,
974
974
  wheelSpeedMultiplier: A = 1,
975
975
  overscrollBehavior: $ = "auto",
976
976
  onWheelHorizontal: ie,
@@ -982,7 +982,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
982
982
  initialScrollPosition: Y = 0,
983
983
  contentProps: ae
984
984
  }, ce) => {
985
- const k = d(Number.isFinite(Y) ? Math.max(0, Y) : 0), ye = d(null), I = d(null), le = r === void 0, [ue, Ye] = Oe(0), _ = r ?? ue, Xe = d(null);
985
+ const k = d(Number.isFinite(Y) ? Math.max(0, Y) : 0), Te = d(null), I = d(null), le = r === void 0, [ue, Ye] = Oe(0), _ = r ?? ue, Xe = d(null);
986
986
  Qe(() => {
987
987
  if (!le)
988
988
  return;
@@ -1008,7 +1008,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1008
1008
  }, [le, ue, n]), Qe(() => {
1009
1009
  if (le)
1010
1010
  return;
1011
- const h = ye.current;
1011
+ const h = Te.current;
1012
1012
  if (!h)
1013
1013
  return;
1014
1014
  const H = () => {
@@ -1040,7 +1040,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1040
1040
  velocity: 0,
1041
1041
  lastTimestamp: null,
1042
1042
  generation: 0
1043
- }), at = Se(
1043
+ }), at = Me(
1044
1044
  () => ({
1045
1045
  maxVelocity: F?.maxVelocity ?? fr.maxVelocity,
1046
1046
  minVelocity: F?.minVelocity ?? fr.minVelocity,
@@ -1049,7 +1049,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1049
1049
  startVelocityThreshold: F?.startVelocityThreshold ?? fr.startVelocityThreshold
1050
1050
  }),
1051
1051
  [F]
1052
- ), Pe = Se(() => ({
1052
+ ), Pe = Me(() => ({
1053
1053
  top: Math.max(0, z?.top ?? 0),
1054
1054
  bottom: Math.max(0, z?.bottom ?? 0)
1055
1055
  }), [z]);
@@ -1064,17 +1064,17 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1064
1064
  enablePointerDrag: f,
1065
1065
  contentInsets: Pe
1066
1066
  }));
1067
- const qe = d({ contentSize: e, viewportSize: _ }), be = Se(() => e > _, [e, _]), fe = w(
1067
+ const qe = d({ contentSize: e, viewportSize: _ }), be = Me(() => e > _, [e, _]), fe = w(
1068
1068
  (h, H) => {
1069
1069
  let se = H ?? qe.current;
1070
1070
  H && !(Number.isFinite(H.contentSize) && Number.isFinite(H.viewportSize)) && (V.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: H }), se = qe.current);
1071
1071
  const { contentSize: ne, viewportSize: he } = se, xe = ne > he, ve = k.current;
1072
1072
  if (V.debug("[ScrollPane] scrollTo called", () => ({ newPosition: h, contentSize: ne, viewportSize: he, currentIsScrollable: xe, prevPosition: ve })), !xe)
1073
1073
  return k.current !== 0 && (k.current = 0, v?.(0, ve)), k.current;
1074
- const Te = typeof h == "function" ? h(k.current) : h;
1075
- if (!Number.isFinite(Te))
1076
- return V.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: Te }), k.current;
1077
- const _e = Math.max(ne - he, 0), me = oe(Te, 0, _e);
1074
+ const Re = typeof h == "function" ? h(k.current) : h;
1075
+ if (!Number.isFinite(Re))
1076
+ return V.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: Re }), k.current;
1077
+ const _e = Math.max(ne - he, 0), me = oe(Re, 0, _e);
1078
1078
  return k.current !== me && (k.current = me, v?.(me, ve)), k.current;
1079
1079
  },
1080
1080
  [v]
@@ -1099,17 +1099,17 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1099
1099
  if (Math.abs(xe) < he)
1100
1100
  return;
1101
1101
  j(), Ge.current.velocity = xe, Ge.current.lastTimestamp = null;
1102
- const ve = Ge.current.generation, Te = (_e) => {
1102
+ const ve = Ge.current.generation, Re = (_e) => {
1103
1103
  const me = Ge.current;
1104
1104
  if (me.generation !== ve)
1105
1105
  return;
1106
1106
  if (me.lastTimestamp === null) {
1107
- me.lastTimestamp = _e, me.frame = requestAnimationFrame(Te);
1107
+ me.lastTimestamp = _e, me.frame = requestAnimationFrame(Re);
1108
1108
  return;
1109
1109
  }
1110
1110
  const dt = _e - me.lastTimestamp;
1111
1111
  if (me.lastTimestamp = _e, dt <= 0) {
1112
- me.frame = requestAnimationFrame(Te);
1112
+ me.frame = requestAnimationFrame(Re);
1113
1113
  return;
1114
1114
  }
1115
1115
  const ft = me.velocity;
@@ -1119,16 +1119,16 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1119
1119
  const it = (ft + Ee) / 2 * dt, pe = k.current;
1120
1120
  if (it !== 0 && Ve.current((lt) => lt + it), Ge.current.generation !== ve)
1121
1121
  return;
1122
- const Re = k.current, { contentSize: wt, viewportSize: p } = qe.current, P = Math.max(wt - p, 0);
1122
+ const we = k.current, { contentSize: wt, viewportSize: p } = qe.current, P = Math.max(wt - p, 0);
1123
1123
  me.velocity = Ee;
1124
- const Ae = Re === pe || Re <= 0 && Ee <= 0 || Re >= P && Ee >= 0;
1124
+ const Ae = we === pe || we <= 0 && Ee <= 0 || we >= P && Ee >= 0;
1125
1125
  if (Math.abs(Ee) < se || Ae) {
1126
1126
  j();
1127
1127
  return;
1128
1128
  }
1129
- me.frame = requestAnimationFrame(Te);
1129
+ me.frame = requestAnimationFrame(Re);
1130
1130
  };
1131
- Ge.current.frame = requestAnimationFrame(Te);
1131
+ Ge.current.frame = requestAnimationFrame(Re);
1132
1132
  },
1133
1133
  [be, at, j]
1134
1134
  ), Ke = d(re);
@@ -1168,11 +1168,11 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1168
1168
  return !1;
1169
1169
  let ve = xe.verticalDelta;
1170
1170
  if (ne !== 1 && (ve *= ne), he !== "contain") {
1171
- const Te = k.current, _e = Math.max(qe.current.contentSize - se, 0);
1172
- if (ve > 0 && Te >= _e || ve < 0 && Te <= 0)
1171
+ const Re = k.current, _e = Math.max(qe.current.contentSize - se, 0);
1172
+ if (ve > 0 && Re >= _e || ve < 0 && Re <= 0)
1173
1173
  return !1;
1174
1174
  }
1175
- return rn(h), h.preventDefault(), j(), V.debug("[ScrollPane] wheel event", () => ({ deltaY: ve, scrollPosition: k.current, wheelSpeedMultiplier: ne, deltaMode: h.deltaMode, scrollTop: I.current?.scrollTop })), fe((Te) => Te + ve), !0;
1175
+ return rn(h), h.preventDefault(), j(), V.debug("[ScrollPane] wheel event", () => ({ deltaY: ve, scrollPosition: k.current, wheelSpeedMultiplier: ne, deltaMode: h.deltaMode, scrollTop: I.current?.scrollTop })), fe((Re) => Re + ve), !0;
1176
1176
  },
1177
1177
  [fe, j]
1178
1178
  );
@@ -1181,7 +1181,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1181
1181
  D(ne);
1182
1182
  }, H = () => {
1183
1183
  j();
1184
- }, se = ye.current;
1184
+ }, se = Te.current;
1185
1185
  return se && (se.addEventListener("wheel", h, { passive: !1 }), se.addEventListener("pointerdown", H, { capture: !0, passive: !0 })), () => {
1186
1186
  se && (se.removeEventListener("wheel", h), se.removeEventListener("pointerdown", H, { capture: !0 }));
1187
1187
  };
@@ -1209,12 +1209,12 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1209
1209
  velocitySamples: [],
1210
1210
  scale: 1,
1211
1211
  scaleX: 1
1212
- }), vt = d(f), et = d(g);
1212
+ }), vt = d(f), et = d(x);
1213
1213
  q(() => {
1214
1214
  vt.current = f;
1215
1215
  }, [f]), q(() => {
1216
- et.current = g;
1217
- }, [g]);
1216
+ et.current = x;
1217
+ }, [x]);
1218
1218
  const xt = d(be);
1219
1219
  q(() => {
1220
1220
  xt.current = be;
@@ -1224,13 +1224,13 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1224
1224
  ct.current = at;
1225
1225
  }, [at]), q(() => {
1226
1226
  const h = y.current;
1227
- if (f && be && (h.pointerId === null || Ar(h.pointerType, g)) || h.pointerId === null)
1227
+ if (f && be && (h.pointerId === null || Ar(h.pointerType, x)) || h.pointerId === null)
1228
1228
  return;
1229
1229
  const H = I.current;
1230
1230
  h.clickResetTimer !== null && (window.clearTimeout(h.clickResetTimer), h.clickResetTimer = null);
1231
1231
  const se = h.isDragging && h.shouldCancelNextClick, ne = h.pointerId;
1232
1232
  h.pointerId = null, h.pointerType = "", h.startClientY = 0, h.startScroll = 0, h.isDragging = !1, h.shouldCancelNextClick = se, h.velocitySamples = [], h.scale = 1, H?.hasPointerCapture(ne) && H.releasePointerCapture(ne);
1233
- }, [f, g, be]), q(() => {
1233
+ }, [f, x, be]), q(() => {
1234
1234
  const h = I.current;
1235
1235
  if (!h)
1236
1236
  return;
@@ -1245,7 +1245,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1245
1245
  P.velocitySamples.push({ clientY: p, time: Ae });
1246
1246
  const lt = ct.current.velocitySampleWindow;
1247
1247
  P.velocitySamples = P.velocitySamples.filter(($e) => Ae - $e.time <= lt);
1248
- }, ve = (p) => p instanceof HTMLElement && p.closest("[data-scrollpane-ignore-drag='true']") !== null, Te = (p) => {
1248
+ }, ve = (p) => p instanceof HTMLElement && p.closest("[data-scrollpane-ignore-drag='true']") !== null, Re = (p) => {
1249
1249
  const P = y.current;
1250
1250
  P.shouldCancelNextClick && (p.preventDefault(), p.stopPropagation(), P.shouldCancelNextClick = !1);
1251
1251
  }, _e = (p) => {
@@ -1329,8 +1329,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1329
1329
  return;
1330
1330
  }
1331
1331
  me(p) && dt(p.pointerId);
1332
- }, Re = [
1333
- ["click", Te, !0],
1332
+ }, we = [
1333
+ ["click", Re, !0],
1334
1334
  ["pointerdown", tt, { passive: !1 }],
1335
1335
  ["lostpointercapture", (p) => {
1336
1336
  p.target !== h || y.current.pointerId !== p.pointerId || dt(p.pointerId);
@@ -1340,8 +1340,8 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1340
1340
  ["pointerup", Be, void 0],
1341
1341
  ["pointercancel", it, void 0]
1342
1342
  ];
1343
- return Mr(h, Re, "add"), Mr(window, wt, "add"), () => {
1344
- Mr(h, Re, "remove"), Mr(window, wt, "remove");
1343
+ return Mr(h, we, "add"), Mr(window, wt, "add"), () => {
1344
+ Mr(h, we, "remove"), Mr(window, wt, "remove");
1345
1345
  const p = y.current;
1346
1346
  p.pointerId !== null && h.hasPointerCapture(p.pointerId) && h.releasePointerCapture(p.pointerId), he(), ne();
1347
1347
  };
@@ -1350,7 +1350,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1350
1350
  (h) => (j(), fe(h)),
1351
1351
  [fe, j]
1352
1352
  );
1353
- return /* @__PURE__ */ Wt("div", { ref: ye, "data-testid": T, "data-self-measured": le ? "true" : void 0, className: Et("aqvs-scroll-pane", R), style: S, children: [
1353
+ return /* @__PURE__ */ Wt("div", { ref: Te, "data-testid": T, "data-self-measured": le ? "true" : void 0, className: Et("aqvs-scroll-pane", R), style: S, children: [
1354
1354
  /* @__PURE__ */ Wt(
1355
1355
  "div",
1356
1356
  {
@@ -1378,7 +1378,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1378
1378
  // 同一条件で揃えてあるため状態としても一貫している。
1379
1379
  // 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
1380
1380
  // (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
1381
- ...f && be && g.some((h) => h === "touch" || h === "pen") ? { touchAction: "none" } : {}
1381
+ ...f && be && x.some((h) => h === "touch" || h === "pen") ? { touchAction: "none" } : {}
1382
1382
  },
1383
1383
  ...ae,
1384
1384
  id: We,
@@ -1397,13 +1397,13 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1397
1397
  scrollPosition: k.current,
1398
1398
  onScroll: Tt,
1399
1399
  enableThumbDrag: s,
1400
- enableTrackClick: o,
1400
+ enableTrackClick: a,
1401
1401
  enableArrowButtons: l,
1402
1402
  scrollBarWidth: i,
1403
1403
  ariaControls: We,
1404
1404
  tapScrollCircleOptions: ee,
1405
- itemCount: Me,
1406
- renderThumbOverlay: Ie,
1405
+ itemCount: Ie,
1406
+ renderThumbOverlay: ye,
1407
1407
  visibleStartIndex: C,
1408
1408
  visibleEndIndex: K
1409
1409
  },
@@ -1413,14 +1413,14 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1413
1413
  ] });
1414
1414
  }
1415
1415
  ), nn = (t, e, r) => Math.min(Math.max(t, e), r), Ii = ({ dragState: t, normalizedDistance: e, sizeScale: r, size: n }) => {
1416
- const i = Math.max(n / 2, 1), s = 1 + e * 0.65, o = Math.max(0.65, 1 - e * 0.25), l = t.direction * e * 26 * r, f = 0.8 + e * 0.18, g = 3 * r, v = 6 * r, R = 22 * r, T = Math.abs(l) + v, S = l > 0 ? g : -Math.abs(l) - g, N = Math.max(2.5, 3 * r), ee = nn(t.offsetX, -i, i), F = nn(t.offsetY, -i, i), Me = i * 0.35, Ie = ee / i * Me, A = F / i * Me, $ = Ie * 0.45, ie = A * 0.45, L = Math.max(R * 0.38, 6), z = 0.65 + e * 0.2, C = t.active;
1416
+ const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), l = t.direction * e * 26 * r, f = 0.8 + e * 0.18, x = 3 * r, v = 6 * r, R = 22 * r, T = Math.abs(l) + v, S = l > 0 ? x : -Math.abs(l) - x, N = Math.max(2.5, 3 * r), ee = nn(t.offsetX, -i, i), F = nn(t.offsetY, -i, i), Ie = i * 0.35, ye = ee / i * Ie, A = F / i * Ie, $ = ye * 0.45, ie = A * 0.45, L = Math.max(R * 0.38, 6), z = 0.65 + e * 0.2, C = t.active;
1417
1417
  return /* @__PURE__ */ Wt(Xr, { children: [
1418
1418
  /* @__PURE__ */ Q(
1419
1419
  "div",
1420
1420
  {
1421
1421
  className: "aqvs-tap-scroll-circle-gradient",
1422
1422
  style: {
1423
- transform: `scale(${o}, ${s})`,
1423
+ transform: `scale(${a}, ${s})`,
1424
1424
  transition: C ? "40ms transform ease-out" : "200ms ease transform"
1425
1425
  }
1426
1426
  }
@@ -1432,7 +1432,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1432
1432
  style: {
1433
1433
  width: R,
1434
1434
  height: R,
1435
- transform: `translate(calc(-50% + ${Ie}px), calc(-50% + ${A}px)) scale(${o}, ${f * s})`,
1435
+ transform: `translate(calc(-50% + ${ye}px), calc(-50% + ${A}px)) scale(${a}, ${f * s})`,
1436
1436
  transition: C ? "70ms transform ease-out" : "200ms ease transform"
1437
1437
  }
1438
1438
  }
@@ -1444,7 +1444,7 @@ const oe = (t, e, r) => Math.max(e, Math.min(r, t)), _r = (t, e) => {
1444
1444
  style: {
1445
1445
  width: L,
1446
1446
  height: L,
1447
- transform: `translate(calc(-50% + ${$}px), calc(-50% + ${ie}px)) scale(${o}, ${s})`,
1447
+ transform: `translate(calc(-50% + ${$}px), calc(-50% + ${ie}px)) scale(${a}, ${s})`,
1448
1448
  opacity: z,
1449
1449
  boxShadow: "0 0 8px rgba(255,255,255,0.45)",
1450
1450
  transition: C ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
@@ -1547,36 +1547,36 @@ class Jt {
1547
1547
  this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.valueFn = void 0, this.baseValue = r, this.total = this.baseValue * this.size;
1548
1548
  return;
1549
1549
  }
1550
- let s = 0, o;
1550
+ let s = 0, a;
1551
1551
  const l = n?.baseValue;
1552
1552
  if (l !== void 0 && !(Number.isFinite(l) && l >= 0))
1553
1553
  throw new RangeError(`[FenwickMapTree] options.baseValue must be a finite number >= 0, received ${l}.`);
1554
1554
  if (i > 0 && l !== void 0) {
1555
1555
  if (s = l, n?.materialize) {
1556
1556
  const f = n?.sampleRange ?? { from: 0, to: Math.min(lr - 1, i - 1) };
1557
- let g = Math.max(0, Math.trunc(f.from)), v = Math.min(Math.trunc(f.to), i - 1);
1558
- g > v && (g = 0, v = Math.min(lr - 1, i - 1)), o = { from: g, values: Jt._collectValidatedValues(r, g, v) };
1557
+ let x = Math.max(0, Math.trunc(f.from)), v = Math.min(Math.trunc(f.to), i - 1);
1558
+ x > v && (x = 0, v = Math.min(lr - 1, i - 1)), a = { from: x, values: Jt._collectValidatedValues(r, x, v) };
1559
1559
  }
1560
1560
  } else if (i > 0) {
1561
1561
  const f = n?.sampleRange ?? {
1562
1562
  from: 0,
1563
1563
  to: Math.min(lr - 1, i - 1)
1564
1564
  };
1565
- let g = Math.max(0, Math.trunc(f.from)), v = Math.min(Math.trunc(f.to), i - 1);
1566
- if (g > v && (g = 0, v = Math.min(lr - 1, i - 1)), i > lr)
1567
- s = Jt._sampleBaseValueStrided(r, i, lr), n?.materialize && (o = { from: g, values: Jt._collectValidatedValues(r, g, v) });
1565
+ let x = Math.max(0, Math.trunc(f.from)), v = Math.min(Math.trunc(f.to), i - 1);
1566
+ if (x > v && (x = 0, v = Math.min(lr - 1, i - 1)), i > lr)
1567
+ s = Jt._sampleBaseValueStrided(r, i, lr), n?.materialize && (a = { from: x, values: Jt._collectValidatedValues(r, x, v) });
1568
1568
  else {
1569
- const R = Jt._collectValidatedValues(r, g, v);
1570
- s = Jt._modeOrMedian([...R]), n?.materialize && (o = { from: g, values: R });
1569
+ const R = Jt._collectValidatedValues(r, x, v);
1570
+ s = Jt._modeOrMedian([...R]), n?.materialize && (a = { from: x, values: R });
1571
1571
  }
1572
1572
  }
1573
- if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = r, this.baseValue = s, o)
1574
- for (let f = 0; f < o.values.length; f++) {
1575
- const g = o.from + f;
1576
- if (g >= this.size)
1573
+ if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = r, this.baseValue = s, a)
1574
+ for (let f = 0; f < a.values.length; f++) {
1575
+ const x = a.from + f;
1576
+ if (x >= this.size)
1577
1577
  break;
1578
- const v = o.values[f] - this.baseValue;
1579
- v !== 0 && (this.deltas.set(g, v), this._updateTree(g, v));
1578
+ const v = a.values[f] - this.baseValue;
1579
+ v !== 0 && (this.deltas.set(x, v), this._updateTree(x, v));
1580
1580
  }
1581
1581
  this.total = this.getTotal();
1582
1582
  }
@@ -1621,22 +1621,22 @@ class Jt {
1621
1621
  static _modeOrMedian(e) {
1622
1622
  if (e.length === 0)
1623
1623
  return 0;
1624
- e.sort((o, l) => o - l);
1624
+ e.sort((a, l) => a - l);
1625
1625
  const r = Math.floor(e.length / 2);
1626
1626
  let n;
1627
1627
  e.length % 2 === 0 ? n = Math.floor((e[r - 1] + e[r]) / 2) : n = e[r];
1628
1628
  const i = /* @__PURE__ */ new Map();
1629
1629
  let s = 0;
1630
- for (const o of e) {
1631
- const l = (i.get(o) ?? 0) + 1;
1632
- i.set(o, l), l > s && (s = l);
1630
+ for (const a of e) {
1631
+ const l = (i.get(a) ?? 0) + 1;
1632
+ i.set(a, l), l > s && (s = l);
1633
1633
  }
1634
1634
  if (s > e.length * 0.2) {
1635
- const o = [];
1636
- for (const [f, g] of i.entries())
1637
- g === s && o.push(f);
1638
- const l = o.reduce((f, g) => f + g, 0);
1639
- n = Math.floor(l / o.length);
1635
+ const a = [];
1636
+ for (const [f, x] of i.entries())
1637
+ x === s && a.push(f);
1638
+ const l = a.reduce((f, x) => f + x, 0);
1639
+ n = Math.floor(l / a.length);
1640
1640
  }
1641
1641
  return n;
1642
1642
  }
@@ -1656,8 +1656,8 @@ class Jt {
1656
1656
  let i = Math.max(1, Math.ceil(r / n));
1657
1657
  i % 2 === 0 && (i += 1);
1658
1658
  const s = [];
1659
- for (let o = 0; o < r && s.length < n; o += i)
1660
- s.push(Dr(e(o), o));
1659
+ for (let a = 0; a < r && s.length < n; a += i)
1660
+ s.push(Dr(e(a), a));
1661
1661
  return Jt._modeOrMedian(s);
1662
1662
  }
1663
1663
  /**
@@ -1705,14 +1705,14 @@ class Jt {
1705
1705
  throw new Error(`Index must be an integer: ${n}`);
1706
1706
  if (!Number.isFinite(i))
1707
1707
  throw new Error(`Change must be a finite number: ${i}`);
1708
- const o = (r.get(n) ?? this.deltas.get(n) ?? 0) + i;
1709
- if (o + this.baseValue < -1e-9)
1710
- throw new Error(`Change would make the value at index ${n} negative: ${o + this.baseValue}`);
1711
- r.set(n, o);
1708
+ const a = (r.get(n) ?? this.deltas.get(n) ?? 0) + i;
1709
+ if (a + this.baseValue < -1e-9)
1710
+ throw new Error(`Change would make the value at index ${n} negative: ${a + this.baseValue}`);
1711
+ r.set(n, a);
1712
1712
  }
1713
1713
  for (const { index: n, change: i } of e) {
1714
- const o = (this.deltas.get(n) ?? 0) + i;
1715
- o === 0 ? this.deltas.delete(n) : this.deltas.set(n, o), this._updateTree(n, i);
1714
+ const a = (this.deltas.get(n) ?? 0) + i;
1715
+ a === 0 ? this.deltas.delete(n) : this.deltas.set(n, a), this._updateTree(n, i);
1716
1716
  }
1717
1717
  return this.total;
1718
1718
  }
@@ -1756,8 +1756,8 @@ class Jt {
1756
1756
  throw new Error(`Value must be a finite number: ${s}`);
1757
1757
  if (s < 0)
1758
1758
  throw new Error("Value cannot be negative.");
1759
- const o = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, l = o + this.baseValue, f = s - l;
1760
- f !== 0 && r.push({ index: i, change: f }), n.set(i, o + f);
1759
+ const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, l = a + this.baseValue, f = s - l;
1760
+ f !== 0 && r.push({ index: i, change: f }), n.set(i, a + f);
1761
1761
  }
1762
1762
  return r;
1763
1763
  }
@@ -1793,8 +1793,8 @@ class Jt {
1793
1793
  if (this.valueFn) {
1794
1794
  const n = this.deltas.get(e) ?? 0, s = Dr(this.valueFn(e), e) - this.baseValue;
1795
1795
  if (s !== n && (s === 0 ? this.deltas.delete(e) : this.deltas.set(e, s), r)) {
1796
- const o = s - n;
1797
- this._updateTree(e, o);
1796
+ const a = s - n;
1797
+ this._updateTree(e, a);
1798
1798
  }
1799
1799
  }
1800
1800
  }
@@ -1813,8 +1813,8 @@ class Jt {
1813
1813
  const i = e.ranges;
1814
1814
  if (i && i.length > 0) {
1815
1815
  for (const l of i) {
1816
- const f = Math.max(0, Math.trunc(l.from)), g = Math.min(Math.trunc(l.to), this.size - 1);
1817
- for (let v = f; v <= g; v++)
1816
+ const f = Math.max(0, Math.trunc(l.from)), x = Math.min(Math.trunc(l.to), this.size - 1);
1817
+ for (let v = f; v <= x; v++)
1818
1818
  this._materialize(v);
1819
1819
  }
1820
1820
  if (r === void 0)
@@ -1823,8 +1823,8 @@ class Jt {
1823
1823
  this._materialize(r);
1824
1824
  return;
1825
1825
  }
1826
- const s = i[0].from, o = i[i.length - 1].to;
1827
- r >= s && r <= o && this._materialize(r);
1826
+ const s = i[0].from, a = i[i.length - 1].to;
1827
+ r >= s && r <= a && this._materialize(r);
1828
1828
  return;
1829
1829
  }
1830
1830
  r !== void 0 && this._materialize(r);
@@ -1856,13 +1856,13 @@ class Jt {
1856
1856
  if (this._materialize(s), (this.deltas.get(s) ?? 0) === l)
1857
1857
  break;
1858
1858
  }
1859
- const o = this.prefixSum(s);
1859
+ const a = this.prefixSum(s);
1860
1860
  return {
1861
1861
  index: s,
1862
- total: this.total ?? o.total,
1863
- cumulative: o.cumulative,
1864
- currentValue: o.currentValue,
1865
- safeIndex: o.safeIndex
1862
+ total: this.total ?? a.total,
1863
+ cumulative: a.cumulative,
1864
+ currentValue: a.currentValue,
1865
+ safeIndex: a.safeIndex
1866
1866
  };
1867
1867
  }
1868
1868
  /**
@@ -1879,10 +1879,10 @@ class Jt {
1879
1879
  for (; s << 1 <= this.size; )
1880
1880
  s <<= 1;
1881
1881
  for (; s > 0; s >>= 1) {
1882
- const o = n + s;
1883
- if (o <= this.size) {
1884
- const f = (this.tree.get(o) ?? 0) + this.baseValue * s;
1885
- (r ? i + f < e : i + f <= e) && (n = o, i += f);
1882
+ const a = n + s;
1883
+ if (a <= this.size) {
1884
+ const f = (this.tree.get(a) ?? 0) + this.baseValue * s;
1885
+ (r ? i + f < e : i + f <= e) && (n = a, i += f);
1886
1886
  }
1887
1887
  }
1888
1888
  return r ? n : n - 1;
@@ -1901,25 +1901,25 @@ class Jt {
1901
1901
  this._materializeRanges(r.materializeOption);
1902
1902
  const s = r.materializeOption?.materialize === !0;
1903
1903
  for (; ; ) {
1904
- let o = 0n, l = i - 1n, f, g, v = this.total;
1905
- for (; o <= l; ) {
1906
- const S = o + l >> 1n, N = Number(S), ee = this.prefixSum(N);
1904
+ let a = 0n, l = i - 1n, f, x, v = this.total;
1905
+ for (; a <= l; ) {
1906
+ const S = a + l >> 1n, N = Number(S), ee = this.prefixSum(N);
1907
1907
  if (v = ee.total, n ? ee.cumulative >= e : ee.cumulative <= e)
1908
- if (f = S, g = ee, n) {
1908
+ if (f = S, x = ee, n) {
1909
1909
  if (S === 0n)
1910
1910
  break;
1911
1911
  l = S - 1n;
1912
1912
  } else
1913
- o = S + 1n;
1913
+ a = S + 1n;
1914
1914
  else if (n)
1915
- o = S + 1n;
1915
+ a = S + 1n;
1916
1916
  else {
1917
1917
  if (S === 0n)
1918
1918
  break;
1919
1919
  l = S - 1n;
1920
1920
  }
1921
1921
  }
1922
- const R = g, T = f !== void 0 ? Number(f) : -1;
1922
+ const R = x, T = f !== void 0 ? Number(f) : -1;
1923
1923
  if (s && T >= 0) {
1924
1924
  const S = this.deltas.get(T) ?? 0;
1925
1925
  if (this._materialize(T), (this.deltas.get(T) ?? 0) !== S)
@@ -1949,14 +1949,14 @@ class Jt {
1949
1949
  return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
1950
1950
  const n = oe(Math.trunc(e), 0, this.size - 1), i = r?.materializeOption;
1951
1951
  this._materializeRanges(i, n, !0);
1952
- let s = 0, o = n + 1;
1953
- for (; o > 0; ) {
1954
- const f = this.tree.get(o) ?? 0;
1952
+ let s = 0, a = n + 1;
1953
+ for (; a > 0; ) {
1954
+ const f = this.tree.get(a) ?? 0;
1955
1955
  s += f;
1956
- const g = ur(o);
1957
- if (g === 0)
1956
+ const x = ur(a);
1957
+ if (x === 0)
1958
1958
  break;
1959
- o -= g;
1959
+ a -= x;
1960
1960
  }
1961
1961
  const l = i?.materialize ? this.get(n) : (this.deltas.get(n) || 0) + this.baseValue;
1962
1962
  return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue: l, safeIndex: n };
@@ -2016,10 +2016,10 @@ class Jt {
2016
2016
  let s = n + 1;
2017
2017
  for (; s <= this.size; ) {
2018
2018
  r.set(s, (r.get(s) ?? 0) + i);
2019
- const o = ur(s);
2020
- if (o === 0)
2019
+ const a = ur(s);
2020
+ if (a === 0)
2021
2021
  break;
2022
- s += o;
2022
+ s += a;
2023
2023
  }
2024
2024
  }
2025
2025
  this.tree = r, this.total = this._computeTreeTotal();
@@ -2133,17 +2133,17 @@ class Jt {
2133
2133
  _propagateDeltaToGrownNodes(e, r, n, i) {
2134
2134
  let s = e + 1;
2135
2135
  for (; s <= n; ) {
2136
- const o = ur(s);
2137
- if (o === 0)
2136
+ const a = ur(s);
2137
+ if (a === 0)
2138
2138
  break;
2139
- s += o;
2139
+ s += a;
2140
2140
  }
2141
2141
  for (; s <= i; ) {
2142
2142
  this.tree.set(s, (this.tree.get(s) ?? 0) + r);
2143
- const o = ur(s);
2144
- if (o === 0)
2143
+ const a = ur(s);
2144
+ if (a === 0)
2145
2145
  break;
2146
- s += o;
2146
+ s += a;
2147
2147
  }
2148
2148
  }
2149
2149
  /**
@@ -2159,12 +2159,12 @@ class Jt {
2159
2159
  const n = Jt._minCoveredLowBound(e, r);
2160
2160
  if (e - n < this.deltas.size)
2161
2161
  for (let s = n; s < e; s++) {
2162
- const o = this.deltas.get(s);
2163
- o === void 0 || o === 0 || this._propagateDeltaToGrownNodes(s, o, e, r);
2162
+ const a = this.deltas.get(s);
2163
+ a === void 0 || a === 0 || this._propagateDeltaToGrownNodes(s, a, e, r);
2164
2164
  }
2165
2165
  else
2166
- for (const [s, o] of this.deltas.entries())
2167
- o === 0 || s < n || this._propagateDeltaToGrownNodes(s, o, e, r);
2166
+ for (const [s, a] of this.deltas.entries())
2167
+ a === 0 || s < n || this._propagateDeltaToGrownNodes(s, a, e, r);
2168
2168
  }
2169
2169
  this.total = this._computeTreeTotal();
2170
2170
  }
@@ -2240,12 +2240,12 @@ const ei = (t, e) => {
2240
2240
  }, vn = (t, e, r) => {
2241
2241
  const n = Number.isFinite(t) && t > 0 ? Math.trunc(t) : 0, i = d(null), s = d({ size: n, valueOrFn: e, options: r });
2242
2242
  i.current === null && (i.current = new Jt(n, e, r));
2243
- const o = i.current, l = s.current, f = l.size !== n, g = l.valueOrFn !== e, v = ei(l.options, r) || l.options?.baseValue !== r?.baseValue, R = l.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2244
- if (g || v) {
2243
+ const a = i.current, l = s.current, f = l.size !== n, x = l.valueOrFn !== e, v = ei(l.options, r) || l.options?.baseValue !== r?.baseValue, R = l.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2244
+ if (x || v) {
2245
2245
  const T = r?.resetOnValueFnChange ?? !0;
2246
- v || g && T || R ? (r?.debug && V.debug("[useFenwickMapTree] reset", { valueOrFnChanged: g, optionsChanged: v }), o.reset(n, e, r)) : (f && (r?.debug && V.debug("[useFenwickMapTree] resize (with valueFn change)", { from: l.size, to: n }), o.changeSize(n)), r?.debug && V.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: g }), o.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: r };
2247
- } else f && (r?.debug && V.debug("[useFenwickMapTree] resize", { from: l.size, to: n }), R ? o.reset(n, e, r) : o.changeSize(n), s.current = { size: n, valueOrFn: e, options: r });
2248
- return o;
2246
+ v || x && T || R ? (r?.debug && V.debug("[useFenwickMapTree] reset", { valueOrFnChanged: x, optionsChanged: v }), a.reset(n, e, r)) : (f && (r?.debug && V.debug("[useFenwickMapTree] resize (with valueFn change)", { from: l.size, to: n }), a.changeSize(n)), r?.debug && V.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: x }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: r };
2247
+ } else f && (r?.debug && V.debug("[useFenwickMapTree] resize", { from: l.size, to: n }), R ? a.reset(n, e, r) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: r });
2248
+ return a;
2249
2249
  };
2250
2250
  class ti {
2251
2251
  key;
@@ -2317,7 +2317,7 @@ function ri(t) {
2317
2317
  const R = e.current.get(v);
2318
2318
  if (R)
2319
2319
  return r.current.moveToTail(R), R.value;
2320
- }, []), o = w((v, R) => {
2320
+ }, []), a = w((v, R) => {
2321
2321
  const T = i.current;
2322
2322
  if (Number.isNaN(T) || T <= 0)
2323
2323
  return;
@@ -2334,14 +2334,14 @@ function ri(t) {
2334
2334
  }, []), l = w((v) => e.current.has(v), []), f = w((v) => {
2335
2335
  const R = e.current.get(v);
2336
2336
  R && (r.current.remove(R), e.current.delete(v));
2337
- }, []), g = w(() => {
2337
+ }, []), x = w(() => {
2338
2338
  e.current.clear(), r.current = new Lr();
2339
2339
  }, []);
2340
- return Se(() => ({ get: s, set: o, has: l, remove: f, clear: g }), [s, o, l, f, g]);
2340
+ return Me(() => ({ get: s, set: a, has: l, remove: f, clear: x }), [s, a, l, f, x]);
2341
2341
  }
2342
2342
  const ni = 1e4, yi = () => {
2343
2343
  const { get: t, set: e, has: r, clear: n } = ri(ni);
2344
- return Se(() => ({ get: t, set: e, has: r, clear: n }), [t, e, r, n]);
2344
+ return Me(() => ({ get: t, set: e, has: r, clear: n }), [t, e, r, n]);
2345
2345
  }, Ti = (t, e) => {
2346
2346
  const r = d(e), n = d(t);
2347
2347
  Qe(() => {
@@ -2351,18 +2351,18 @@ const ni = 1e4, yi = () => {
2351
2351
  return w((s) => {
2352
2352
  if (!s || i.current.has(s))
2353
2353
  return;
2354
- const o = (l) => {
2354
+ const a = (l) => {
2355
2355
  r.current?.enableBridge !== !1 && n.current.current?.applyWheel(l);
2356
2356
  };
2357
- return s.addEventListener("wheel", o, { passive: !1 }), i.current.set(s, o), () => {
2358
- i.current.get(s) === o && (s.removeEventListener("wheel", o), i.current.delete(s));
2357
+ return s.addEventListener("wheel", a, { passive: !1 }), i.current.set(s, a), () => {
2358
+ i.current.get(s) === a && (s.removeEventListener("wheel", a), i.current.delete(s));
2359
2359
  };
2360
2360
  }, []);
2361
2361
  }, sn = -200, on = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, ii = (t) => {
2362
2362
  const e = d(t);
2363
2363
  e.current = t;
2364
- const r = d(on), n = d(null), [i, s] = Oe(!1), o = d(null), l = d(null), f = d({ residual: 0, direction: 0 }), g = d({ residual: 0, direction: 0 }), v = w(() => {
2365
- o.current !== null && (window.cancelAnimationFrame(o.current), o.current = null), l.current = null, f.current = { residual: 0, direction: 0 }, g.current = { residual: 0, direction: 0 };
2364
+ const r = d(on), n = d(null), [i, s] = Oe(!1), a = d(null), l = d(null), f = d({ residual: 0, direction: 0 }), x = d({ residual: 0, direction: 0 }), v = w(() => {
2365
+ a.current !== null && (window.cancelAnimationFrame(a.current), a.current = null), l.current = null, f.current = { residual: 0, direction: 0 }, x.current = { residual: 0, direction: 0 };
2366
2366
  }, []), R = w((A, $, ie, L, z, C) => {
2367
2367
  const K = $ > 0 ? 1 : $ < 0 ? -1 : 0;
2368
2368
  K !== 0 && K !== A.direction && (A.direction = K, A.residual = 0), A.residual += $ * ie;
@@ -2373,7 +2373,7 @@ const ni = 1e4, yi = () => {
2373
2373
  return { actualDelta: 0, atBoundary: !1 };
2374
2374
  const ae = L(), ce = C(Y), k = ce - ae;
2375
2375
  A.residual -= k;
2376
- const ye = Y < 0 && ae + Y <= 0, I = Y > 0 && ae + Y >= B, le = Y < 0 && (ce <= 0 || ye && k === 0) || Y > 0 && (ce >= B || I && k === 0);
2376
+ const Te = Y < 0 && ae + Y <= 0, I = Y > 0 && ae + Y >= B, le = Y < 0 && (ce <= 0 || Te && k === 0) || Y > 0 && (ce >= B || I && k === 0);
2377
2377
  return le && (A.residual = 0), { actualDelta: k, atBoundary: le };
2378
2378
  }, []), T = w(
2379
2379
  (A) => {
@@ -2384,21 +2384,21 @@ const ni = 1e4, yi = () => {
2384
2384
  }
2385
2385
  const L = l.current ?? A, z = Math.max((A - L) / 1e3, 0), C = Math.min(z, gn);
2386
2386
  if (l.current = A, C <= 0) {
2387
- o.current = window.requestAnimationFrame(T);
2387
+ a.current = window.requestAnimationFrame(T);
2388
2388
  return;
2389
2389
  }
2390
2390
  const K = Bn({ offsetX: ie.offsetX, offsetY: ie.offsetY, maxDistance: $.maxDistance, x: $.xSpeedParams, y: $.ySpeedParams }), B = R(f.current, K.x, C, $.getHx, $.getMaxHx, (k) => $.applyHxRef.current($.getHx() + k));
2391
2391
  B.actualDelta !== 0 && ($.pendingColAnchorRef.current = null);
2392
- const Y = R(g.current, K.y, C, $.getVy, $.getMaxVy, $.applyVy), ae = $.getMaxHx() <= 0 || B.atBoundary || ie.offsetX === 0, ce = $.getMaxVy() <= 0 || Y.atBoundary || ie.offsetY === 0;
2392
+ const Y = R(x.current, K.y, C, $.getVy, $.getMaxVy, $.applyVy), ae = $.getMaxHx() <= 0 || B.atBoundary || ie.offsetX === 0, ce = $.getMaxVy() <= 0 || Y.atBoundary || ie.offsetY === 0;
2393
2393
  if (ae && ce) {
2394
2394
  v();
2395
2395
  return;
2396
2396
  }
2397
- o.current = window.requestAnimationFrame(T);
2397
+ a.current = window.requestAnimationFrame(T);
2398
2398
  },
2399
2399
  [v, R]
2400
2400
  ), S = w(() => {
2401
- o.current === null && (l.current = null, f.current = { residual: 0, direction: 0 }, g.current = { residual: 0, direction: 0 }, o.current = window.requestAnimationFrame(T));
2401
+ a.current === null && (l.current = null, f.current = { residual: 0, direction: 0 }, x.current = { residual: 0, direction: 0 }, a.current = window.requestAnimationFrame(T));
2402
2402
  }, [T]), N = w(() => {
2403
2403
  r.current = { ...on }, s(!1), n.current?.reset(), v();
2404
2404
  }, [v]), ee = w(
@@ -2406,11 +2406,11 @@ const ni = 1e4, yi = () => {
2406
2406
  r.current = A, s(A.active), A.active && A.direction !== 0 ? S() : v();
2407
2407
  },
2408
2408
  [S, v]
2409
- ), { enabled: F, xExtentFreshness: Me, yExtentFreshness: Ie } = t;
2409
+ ), { enabled: F, xExtentFreshness: Ie, yExtentFreshness: ye } = t;
2410
2410
  return q(() => {
2411
2411
  const A = r.current;
2412
2412
  !A.active || A.direction === 0 || S();
2413
- }, [Me, Ie, S]), q(() => {
2413
+ }, [Ie, ye, S]), q(() => {
2414
2414
  const A = () => {
2415
2415
  N();
2416
2416
  };
@@ -2445,13 +2445,13 @@ const ni = 1e4, yi = () => {
2445
2445
  if (!Number.isFinite(t)) return 0n;
2446
2446
  const e = Math.trunc(t);
2447
2447
  return e <= 0 ? 0n : BigInt(e);
2448
- }, oi = (t, e, r, n, i, s, o, l) => {
2448
+ }, oi = (t, e, r, n, i, s, a, l) => {
2449
2449
  const f = hr(n);
2450
2450
  if (f === 0n)
2451
2451
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2452
- const g = (L) => L < 0n ? 0n : L >= f ? f - 1n : L, v = { materializeOption: { materialize: !1 } }, { index: R, cumulative: T } = s.findIndexAtOrAfter(t, v);
2452
+ const x = (L) => L < 0n ? 0n : L >= f ? f - 1n : L, v = { materializeOption: { materialize: !1 } }, { index: R, cumulative: T } = s.findIndexAtOrAfter(t, v);
2453
2453
  let S;
2454
- R === -1 ? S = f - 1n : (T === t ? S = hr(R + 1) : S = hr(R), S >= f && (S = f - 1n)), t <= 0 && (S = 0n), l && t >= o && (S = f - 1n);
2454
+ R === -1 ? S = f - 1n : (T === t ? S = hr(R + 1) : S = hr(R), S >= f && (S = f - 1n)), t <= 0 && (S = 0n), l && t >= a && (S = f - 1n);
2455
2455
  const N = (L) => {
2456
2456
  const z = Number(L);
2457
2457
  if (!Number.isSafeInteger(z))
@@ -2485,7 +2485,7 @@ const ni = 1e4, yi = () => {
2485
2485
  }
2486
2486
  return B === 0n && (K = L), { height: z, end: K };
2487
2487
  };
2488
- let { height: F, end: Me } = ee(S);
2488
+ let { height: F, end: Ie } = ee(S);
2489
2489
  if (F < e && S > 0n) {
2490
2490
  let L = S, z = F, C = 0;
2491
2491
  for (; L > 0n && z < e; ) {
@@ -2501,10 +2501,10 @@ const ni = 1e4, yi = () => {
2501
2501
  const { cumulative: ce } = s.prefixSum(ae, { materializeOption: { materialize: !1 } });
2502
2502
  if (!Number.isFinite(ce))
2503
2503
  break;
2504
- const { index: k } = s.findIndexAtOrAfter(ce - 0.5, { materializeOption: { materialize: !1 } }), ye = k === -1 ? -1n : hr(k);
2505
- if (ye >= 0n && ye < L)
2506
- L = ye + 1n, C = 0;
2507
- else if (ye === L && L >= 1n && i(Number(L - 1n)) > 0)
2504
+ const { index: k } = s.findIndexAtOrAfter(ce - 0.5, { materializeOption: { materialize: !1 } }), Te = k === -1 ? -1n : hr(k);
2505
+ if (Te >= 0n && Te < L)
2506
+ L = Te + 1n, C = 0;
2507
+ else if (Te === L && L >= 1n && i(Number(L - 1n)) > 0)
2508
2508
  C = 0;
2509
2509
  else
2510
2510
  break;
@@ -2512,28 +2512,28 @@ const ni = 1e4, yi = () => {
2512
2512
  } else
2513
2513
  C = 0;
2514
2514
  }
2515
- S = g(L);
2515
+ S = x(L);
2516
2516
  const K = ee(S);
2517
- F = K.height, Me = K.end;
2517
+ F = K.height, Ie = K.end;
2518
2518
  }
2519
- const Ie = g(S), A = g(Me), $ = g(Ie - BigInt(Math.max(0, r))), ie = g(A + BigInt(Math.max(0, r)));
2519
+ const ye = x(S), A = x(Ie), $ = x(ye - BigInt(Math.max(0, r))), ie = x(A + BigInt(Math.max(0, r)));
2520
2520
  return {
2521
2521
  renderingStartIndex: Ze(Number($), n),
2522
2522
  renderingEndIndex: Ze(Number(ie), n),
2523
- visibleStartIndex: Ze(Number(Ie), n),
2523
+ visibleStartIndex: Ze(Number(ye), n),
2524
2524
  visibleEndIndex: Ze(Number(A), n)
2525
2525
  };
2526
- }, Sn = (t, e, r, n, i, s, o) => {
2526
+ }, Sn = (t, e, r, n, i, s, a) => {
2527
2527
  if (n === 0)
2528
2528
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2529
- const l = Number.isFinite(o), f = l ? Math.min(Math.max(0, t), o) : Math.max(0, t);
2529
+ const l = Number.isFinite(a), f = l ? Math.min(Math.max(0, t), a) : Math.max(0, t);
2530
2530
  if (n >= Number.MAX_SAFE_INTEGER)
2531
- return oi(f, e, r, n, i, s, o, l);
2532
- const { index: g, cumulative: v, currentValue: R } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), T = g === -1 ? e <= 0 || (v ?? 0) < f + (R ?? 0) ? n - 1 : 0 : g;
2531
+ return oi(f, e, r, n, i, s, a, l);
2532
+ const { index: x, cumulative: v, currentValue: R } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), T = x === -1 ? e <= 0 || (v ?? 0) < f + (R ?? 0) ? n - 1 : 0 : x;
2533
2533
  let S = Ze(T, n), N = 0;
2534
- if (g !== -1 && v === f)
2535
- S = Ze(g + 1, n), N = 0;
2536
- else if (S === g && v !== void 0 && R !== void 0)
2534
+ if (x !== -1 && v === f)
2535
+ S = Ze(x + 1, n), N = 0;
2536
+ else if (S === x && v !== void 0 && R !== void 0)
2537
2537
  N = v - R - f;
2538
2538
  else {
2539
2539
  const { cumulative: L, currentValue: z } = s.prefixSum(S, { materializeOption: { materialize: !1 } });
@@ -2559,9 +2559,9 @@ const ni = 1e4, yi = () => {
2559
2559
  B = 0;
2560
2560
  }
2561
2561
  return { cursor: C, height: K };
2562
- }, Me = F(S, N);
2563
- let Ie = Me.cursor;
2564
- if (N = Me.height, N < e && S > 0) {
2562
+ }, Ie = F(S, N);
2563
+ let ye = Ie.cursor;
2564
+ if (N = Ie.height, N < e && S > 0) {
2565
2565
  let L = N + Math.abs(Math.min(0, ee)), z = S - 1, C = 0;
2566
2566
  for (; z >= 0 && L < e; ) {
2567
2567
  const B = i(z);
@@ -2589,9 +2589,9 @@ const ni = 1e4, yi = () => {
2589
2589
  }
2590
2590
  S = Ze(z + 1, n);
2591
2591
  const K = F(S, 0);
2592
- Ie = K.cursor, N = K.height;
2592
+ ye = K.cursor, N = K.height;
2593
2593
  }
2594
- const A = Ze(S - r, n), $ = Ze(Math.max(Ie - 1, S), n), ie = Ze($ + r, n);
2594
+ const A = Ze(S - r, n), $ = Ze(Math.max(ye - 1, S), n), ie = Ze($ + r, n);
2595
2595
  return { renderingStartIndex: A, renderingEndIndex: ie, visibleStartIndex: S, visibleEndIndex: $ };
2596
2596
  }, cn = (t, e, r) => {
2597
2597
  const n = Math.max(0, e ?? 0), i = d({ last: 0, id: null, arg: null }).current;
@@ -2610,26 +2610,26 @@ const ni = 1e4, yi = () => {
2610
2610
  ), w(
2611
2611
  (s) => {
2612
2612
  if (i.arg = s, i.id !== null) return;
2613
- const o = (l) => {
2613
+ const a = (l) => {
2614
2614
  if (i.id = null, i.arg === null) return;
2615
2615
  const f = l - i.last;
2616
2616
  if (n === 0 || i.last === 0 || f >= n) {
2617
2617
  if (t.current)
2618
2618
  try {
2619
2619
  r(t.current, i.arg);
2620
- } catch (g) {
2621
- console.error("[useThrottledInvoker] Error invoking callback", g);
2620
+ } catch (x) {
2621
+ console.error("[useThrottledInvoker] Error invoking callback", x);
2622
2622
  }
2623
2623
  i.arg = null, i.last = l;
2624
2624
  }
2625
- i.arg !== null && (i.id = requestAnimationFrame(o));
2625
+ i.arg !== null && (i.id = requestAnimationFrame(a));
2626
2626
  };
2627
- i.id = requestAnimationFrame(o);
2627
+ i.id = requestAnimationFrame(a);
2628
2628
  },
2629
2629
  [n, r, t, i]
2630
2630
  );
2631
- }, ai = zn.memo(({ index: t, top: e, height: r, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: o, onKeyDown: l, onEscapeKeyDown: f, onFocus: g, registerItemRef: v }) => {
2632
- const R = w((F) => v(t, F), [t, v]), T = w((F) => l(F, t), [t, l]), S = w((F) => f?.(F, t), [t, f]), N = w(() => g(t), [t, g]), ee = w((F) => {
2631
+ }, ai = zn.memo(({ index: t, top: e, height: r, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: l, onEscapeKeyDown: f, onFocus: x, registerItemRef: v }) => {
2632
+ const R = w((F) => v(t, F), [t, v]), T = w((F) => l(F, t), [t, l]), S = w((F) => f?.(F, t), [t, f]), N = w(() => x(t), [t, x]), ee = w((F) => {
2633
2633
  F.currentTarget.focus({ preventScroll: !0 });
2634
2634
  }, []);
2635
2635
  return (
@@ -2649,11 +2649,11 @@ const ni = 1e4, yi = () => {
2649
2649
  height: r,
2650
2650
  overflow: s ? "hidden" : void 0
2651
2651
  },
2652
- tabIndex: o ? -1 : void 0,
2653
- onPointerDown: o ? ee : void 0,
2654
- onKeyDownCapture: o ? T : void 0,
2655
- onKeyDown: o && f ? S : void 0,
2656
- onFocusCapture: o ? N : void 0,
2652
+ tabIndex: a ? -1 : void 0,
2653
+ onPointerDown: a ? ee : void 0,
2654
+ onKeyDownCapture: a ? T : void 0,
2655
+ onKeyDown: a && f ? S : void 0,
2656
+ onFocusCapture: a ? N : void 0,
2657
2657
  children: i(n, t)
2658
2658
  }
2659
2659
  )
@@ -2665,10 +2665,10 @@ const ni = 1e4, yi = () => {
2665
2665
  getItemHeight: n,
2666
2666
  viewportSize: i,
2667
2667
  overscanCount: s = 15,
2668
- className: o,
2668
+ className: a,
2669
2669
  testId: l,
2670
2670
  onScroll: f,
2671
- onRangeChange: g,
2671
+ onRangeChange: x,
2672
2672
  children: v,
2673
2673
  background: R,
2674
2674
  initialScrollIndex: T,
@@ -2676,8 +2676,8 @@ const ni = 1e4, yi = () => {
2676
2676
  initialScrollAnchor: N,
2677
2677
  callbackThrottleMs: ee = 5,
2678
2678
  contentInsets: F,
2679
- onItemFocus: Me,
2680
- scrollBarOptions: Ie,
2679
+ onItemFocus: Ie,
2680
+ scrollBarOptions: ye,
2681
2681
  behaviorOptions: A,
2682
2682
  onWheelHorizontal: $,
2683
2683
  onPanHorizontal: ie,
@@ -2686,8 +2686,8 @@ const ni = 1e4, yi = () => {
2686
2686
  contentProps: C,
2687
2687
  liveRegion: K
2688
2688
  }, B) => {
2689
- const { width: Y, enableThumbDrag: ae, enableTrackClick: ce, enableArrowButtons: k, enableScrollToTopBottomButtons: ye, renderThumbOverlay: I, tapScrollCircleOptions: le } = Ie ?? {}, { enablePointerDrag: ue, pointerDragInputs: Ye, enableKeyboardNavigation: _ = !0, enableEscapeRowReturn: Xe = !1, wheelSpeedMultiplier: ut, inertiaOptions: nt, overscrollBehavior: Ge, clipItemHeight: at = !1, resetOnGetItemHeightChange: Pe = !1 } = A ?? {}, [qe, be] = Oe(0), fe = i ?? qe, Ve = w((c) => {
2690
- be((x) => x === c ? x : c);
2689
+ const { width: Y, enableThumbDrag: ae, enableTrackClick: ce, enableArrowButtons: k, enableScrollToTopBottomButtons: Te, renderThumbOverlay: I, tapScrollCircleOptions: le } = ye ?? {}, { enablePointerDrag: ue, pointerDragInputs: Ye, enableKeyboardNavigation: _ = !0, enableEscapeRowReturn: Xe = !1, wheelSpeedMultiplier: ut, inertiaOptions: nt, overscrollBehavior: Ge, clipItemHeight: at = !1, resetOnGetItemHeightChange: Pe = !1 } = A ?? {}, [qe, be] = Oe(0), fe = i ?? qe, Ve = w((c) => {
2690
+ be((b) => b === c ? b : c);
2691
2691
  }, []), j = d(null), Je = d({
2692
2692
  renderingStartIndex: 0,
2693
2693
  renderingEndIndex: 0,
@@ -2703,10 +2703,10 @@ const ni = 1e4, yi = () => {
2703
2703
  }
2704
2704
  Pe && (re.current = null);
2705
2705
  }, [Pe, n]);
2706
- const D = Se(() => an(F), [F]), [Z] = Oe(() => {
2707
- const x = N?.index ?? T, m = typeof x == "number" && Number.isFinite(x) ? Math.max(0, Math.trunc(x)) : 0;
2706
+ const D = Me(() => an(F), [F]), [Z] = Oe(() => {
2707
+ const b = N?.index ?? T, m = typeof b == "number" && Number.isFinite(b) ? Math.max(0, Math.trunc(b)) : 0;
2708
2708
  return { from: Math.max(0, m - 50), to: m + 50 };
2709
- }), We = Se(
2709
+ }), We = Me(
2710
2710
  // 目的: Fenwick Tree のオプション設定
2711
2711
  // 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
2712
2712
  // itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
@@ -2718,23 +2718,23 @@ const ni = 1e4, yi = () => {
2718
2718
  }),
2719
2719
  [Pe, Z]
2720
2720
  ), y = vn(t, n, We), [vt] = Oe(() => {
2721
- let c = 0, x = 0;
2721
+ let c = 0, b = 0;
2722
2722
  if (N && t > 0) {
2723
- const m = oe(Math.trunc(N.index), 0, t - 1), W = Math.max(0, N.offsetPx ?? 0), U = oe(m - s * 2, 0, t - 1), G = oe(m + s * 2, 0, t - 1), J = m > 0 || W > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: U, to: G }] } } : void 0, { cumulative: we, total: Ue, currentValue: Le } = y.prefixSum(m, J), ze = Math.max(we - Le + W, 0);
2724
- c = ir(ze, D.top), x = Ue ?? y.getTotal();
2723
+ const m = oe(Math.trunc(N.index), 0, t - 1), W = Math.max(0, N.offsetPx ?? 0), U = oe(m - s * 2, 0, t - 1), G = oe(m + s * 2, 0, t - 1), J = m > 0 || W > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: U, to: G }] } } : void 0, { cumulative: Se, total: Ue, currentValue: Le } = y.prefixSum(m, J), ze = Math.max(Se - Le + W, 0);
2724
+ c = ir(ze, D.top), b = Ue ?? y.getTotal();
2725
2725
  } else if (typeof T == "number") {
2726
- const m = oe(T, 0, t - 1), W = oe(m - s * 2, 0, t - 1), U = oe(m + s * 2, 0, t - 1), G = T > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: W, to: U }] } } : void 0, { cumulative: J, total: we, currentValue: Ue } = y.prefixSum(T, G), Le = Math.max(J - Ue, 0);
2727
- c = ir(Le, D.top), x = we ?? y.getTotal();
2728
- } else typeof S == "number" && (c = ir(Math.max(S, 0), D.top)), x = y.getTotal();
2729
- return { position: c, total: x };
2730
- }), [et, xt] = Oe(vt.position), [ct, Tt] = Oe(vt.total), h = d(vt.position), H = d(D.top), se = d(f ?? void 0), ne = d(g ?? void 0), he = d($), xe = (L?.length ?? 0) > 0, ve = !!$;
2726
+ const m = oe(T, 0, t - 1), W = oe(m - s * 2, 0, t - 1), U = oe(m + s * 2, 0, t - 1), G = T > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: W, to: U }] } } : void 0, { cumulative: J, total: Se, currentValue: Ue } = y.prefixSum(T, G), Le = Math.max(J - Ue, 0);
2727
+ c = ir(Le, D.top), b = Se ?? y.getTotal();
2728
+ } else typeof S == "number" && (c = ir(Math.max(S, 0), D.top)), b = y.getTotal();
2729
+ return { position: c, total: b };
2730
+ }), [et, xt] = Oe(vt.position), [ct, Tt] = Oe(vt.total), h = d(vt.position), H = d(D.top), se = d(f ?? void 0), ne = d(x ?? void 0), he = d($), xe = (L?.length ?? 0) > 0, ve = !!$;
2731
2731
  q(() => {
2732
2732
  xe && (_ || V.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), ve || V.warn("[VirtualScroll] horizontalKeyInputs is set but onWheelHorizontal is missing; horizontal keyboard scrolling is disabled because the package does not own the horizontal axis."), Number.isFinite(z) && z > 0 || V.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${z}. Horizontal arrow keys are left untouched.`));
2733
2733
  }, [xe, ve, _, z]);
2734
- const Te = d(/* @__PURE__ */ new Map()), _e = d(null), me = d(null), [dt, ft] = Oe(null), [Ee, Be] = Oe(!1), tt = d(null), it = d(!1), pe = d(0), Re = d(!1), wt = d(!1), p = d(t);
2734
+ const Re = d(/* @__PURE__ */ new Map()), _e = d(null), me = d(null), [dt, ft] = Oe(null), [Ee, Be] = Oe(!1), tt = d(null), it = d(!1), pe = d(0), we = d(!1), wt = d(!1), p = d(t);
2735
2735
  p.current !== t && (p.current = t, wt.current = !0), Qe(() => {
2736
- se.current = f ?? void 0, ne.current = g ?? void 0, he.current = $;
2737
- }, [g, f, $]);
2736
+ se.current = f ?? void 0, ne.current = x ?? void 0, he.current = $;
2737
+ }, [x, f, $]);
2738
2738
  const P = w(
2739
2739
  (c) => {
2740
2740
  if (_ && c && typeof c.focus == "function")
@@ -2745,25 +2745,25 @@ const ni = 1e4, yi = () => {
2745
2745
  }
2746
2746
  },
2747
2747
  [_]
2748
- ), Ae = w((c, { position: x, totalHeight: m }) => {
2749
- c(x, m);
2750
- }, []), lt = cn(se, ee, Ae), $e = w((c, x) => {
2751
- c(x);
2748
+ ), Ae = w((c, { position: b, totalHeight: m }) => {
2749
+ c(b, m);
2750
+ }, []), lt = cn(se, ee, Ae), $e = w((c, b) => {
2751
+ c(b);
2752
2752
  }, []), Rt = cn(ne, ee, $e), Fe = d(D.top);
2753
2753
  Fe.current = D.top;
2754
2754
  const ht = d(lt);
2755
2755
  ht.current = lt, q(() => (Ke.current = !1, () => {
2756
2756
  Ke.current = !0, tt.current && (clearTimeout(tt.current), tt.current = null);
2757
2757
  }), []), q(() => {
2758
- _ || (Te.current.clear(), _e.current = null, me.current = null);
2758
+ _ || (Re.current.clear(), _e.current = null, me.current = null);
2759
2759
  }, [_]);
2760
2760
  const ke = w(
2761
- (c, x) => {
2762
- if (!x) {
2763
- Te.current.delete(c);
2761
+ (c, b) => {
2762
+ if (!b) {
2763
+ Re.current.delete(c);
2764
2764
  return;
2765
2765
  }
2766
- _ && (Te.current.set(c, x), _e.current === c && (_e.current = null, me.current = c, P(x)));
2766
+ _ && (Re.current.set(c, b), _e.current === c && (_e.current = null, me.current = c, P(b)));
2767
2767
  },
2768
2768
  [_, P]
2769
2769
  ), Bt = 0.01, Ut = d({
@@ -2785,8 +2785,8 @@ const ni = 1e4, yi = () => {
2785
2785
  }), zt = w(() => {
2786
2786
  const c = Ut.current;
2787
2787
  c.rafId = null;
2788
- const x = h.current, m = yt(x, Fe.current), W = y.getTotal();
2789
- if (xt((G) => Math.abs(G - x) < Bt ? G : x), Math.abs(c.lastRenderedPosition - x) >= Bt ? (ht.current({ position: m, totalHeight: W }), c.lastRenderedPosition = x, c.idleFrames = 0) : c.idleFrames += 1, c.idleFrames >= 2) {
2788
+ const b = h.current, m = yt(b, Fe.current), W = y.getTotal();
2789
+ if (xt((G) => Math.abs(G - b) < Bt ? G : b), Math.abs(c.lastRenderedPosition - b) >= Bt ? (ht.current({ position: m, totalHeight: W }), c.lastRenderedPosition = b, c.idleFrames = 0) : c.idleFrames += 1, c.idleFrames >= 2) {
2790
2790
  Vt();
2791
2791
  return;
2792
2792
  }
@@ -2807,8 +2807,8 @@ const ni = 1e4, yi = () => {
2807
2807
  c.loopActive = !1;
2808
2808
  }
2809
2809
  }, [zt]), De = w(
2810
- (c, x) => {
2811
- const m = x?.immediate ?? !1, W = yt(c, D.top);
2810
+ (c, b) => {
2811
+ const m = b?.immediate ?? !1, W = yt(c, D.top);
2812
2812
  if (h.current = c, m) {
2813
2813
  Ut.current.lastRenderedPosition = c, Ut.current.idleFrames = 0, xt(c), lt({ position: W, totalHeight: y.getTotal() });
2814
2814
  return;
@@ -2816,20 +2816,20 @@ const ni = 1e4, yi = () => {
2816
2816
  tr();
2817
2817
  },
2818
2818
  [tr, y, D.top, lt]
2819
- ), Pt = w((c, x = 0) => {
2819
+ ), Pt = w((c, b = 0) => {
2820
2820
  const m = j.current;
2821
2821
  if (!m)
2822
2822
  return c;
2823
2823
  const W = m.getScrollPosition();
2824
2824
  pe.current += 1;
2825
- const U = m.getContentSize() + x, G = m.getViewportSize(), J = m.scrollTo(c, { contentSize: U, viewportSize: G });
2826
- return J === W && (pe.current = Math.max(0, pe.current - 1)), Math.abs(J - c) > 0.5 && (Re.current = !0), J;
2825
+ const U = m.getContentSize() + b, G = m.getViewportSize(), J = m.scrollTo(c, { contentSize: U, viewportSize: G });
2826
+ return J === W && (pe.current = Math.max(0, pe.current - 1)), Math.abs(J - c) > 0.5 && (we.current = !0), J;
2827
2827
  }, []), At = d(!1);
2828
2828
  q(() => {
2829
2829
  if (!At.current)
2830
2830
  if (At.current = !0, N == null && typeof T != "number" && typeof S == "number") {
2831
- const c = ir(Math.max(S, 0), D.top), x = Math.abs(c - h.current) > 0.5;
2832
- De(c, { immediate: !0 }), x && j.current?.scrollTo(c);
2831
+ const c = ir(Math.max(S, 0), D.top), b = Math.abs(c - h.current) > 0.5;
2832
+ De(c, { immediate: !0 }), b && j.current?.scrollTo(c);
2833
2833
  } else
2834
2834
  De(h.current, { immediate: !0 });
2835
2835
  }, [N, T, S, D.top, De]), q(() => {
@@ -2838,22 +2838,22 @@ const ni = 1e4, yi = () => {
2838
2838
  Tt(c);
2839
2839
  return;
2840
2840
  }
2841
- if (Re.current) {
2842
- Re.current = !1;
2843
- const x = j.current;
2844
- if (x && Math.abs(x.getScrollPosition() - h.current) > 0.5) {
2841
+ if (we.current) {
2842
+ we.current = !1;
2843
+ const b = j.current;
2844
+ if (b && Math.abs(b.getScrollPosition() - h.current) > 0.5) {
2845
2845
  const m = Pt(h.current);
2846
- Re.current = !1, De(m, { immediate: !0 });
2846
+ we.current = !1, De(m, { immediate: !0 });
2847
2847
  }
2848
2848
  }
2849
2849
  }, [y, ct, t, Pt, De]), q(() => {
2850
2850
  if (re.current !== null) {
2851
- const { index: c, align: x, offset: m } = re.current, W = Ze(c, t), { cumulative: U, currentValue: G } = y.prefixSum(W, { materializeOption: { materialize: !1 } });
2851
+ const { index: c, align: b, offset: m } = re.current, W = Ze(c, t), { cumulative: U, currentValue: G } = y.prefixSum(W, { materializeOption: { materialize: !1 } });
2852
2852
  if (U !== void 0 && G !== void 0) {
2853
2853
  const J = Math.max(U - G, 0);
2854
- let we = J;
2855
- x === "bottom" ? we = U - fe : x === "center" && (we = J + G / 2 - fe / 2), m && (we -= m), we = Math.max(0, we);
2856
- const Ue = Math.max(0, ct + D.top + D.bottom - fe), Le = Math.min(ir(we, D.top), Ue);
2854
+ let Se = J;
2855
+ b === "bottom" ? Se = U - fe : b === "center" && (Se = J + G / 2 - fe / 2), m && (Se -= m), Se = Math.max(0, Se);
2856
+ const Ue = Math.max(0, ct + D.top + D.bottom - fe), Le = Math.min(ir(Se, D.top), Ue);
2857
2857
  Math.abs(Le - h.current) > 1 && (V.debug("[VirtualScroll] Drift correction", {
2858
2858
  from: h.current,
2859
2859
  to: Le,
@@ -2866,41 +2866,41 @@ const ni = 1e4, yi = () => {
2866
2866
  const c = H.current;
2867
2867
  if (c === D.top || (H.current = D.top, re.current))
2868
2868
  return;
2869
- const x = yt(h.current, c), m = ir(x, D.top);
2869
+ const b = yt(h.current, c), m = ir(b, D.top);
2870
2870
  h.current = m, j.current?.scrollTo(m), De(m, { immediate: !0 });
2871
2871
  }, [D.top, De]);
2872
2872
  const kt = w(
2873
- (c, x) => {
2873
+ (c, b) => {
2874
2874
  if (t === 0)
2875
2875
  return;
2876
- const m = Ze(c, t), W = y.get(m), U = x - W, G = y.update(m, x);
2877
- G !== void 0 && Tt(G), V.debug("[VirtualScroll] Updated item size manually", { index: m, size: x, total: G });
2876
+ const m = Ze(c, t), W = y.get(m), U = b - W, G = y.update(m, b);
2877
+ G !== void 0 && Tt(G), V.debug("[VirtualScroll] Updated item size manually", { index: m, size: b, total: G });
2878
2878
  let J = re.current ? re.current.index : null;
2879
2879
  if (J === null) {
2880
- const we = h.current, Ue = an(F).top, Le = yt(we, Ue), { index: ze, cumulative: pt } = y.findIndexAtOrAfter(Le, { materializeOption: { materialize: !1 } });
2880
+ const Se = h.current, Ue = an(F).top, Le = yt(Se, Ue), { index: ze, cumulative: pt } = y.findIndexAtOrAfter(Le, { materializeOption: { materialize: !1 } });
2881
2881
  J = pt !== void 0 && pt === Le ? ze + 1 : ze;
2882
2882
  }
2883
2883
  if (J !== -1 && m < J && U !== 0) {
2884
- const we = h.current, Ue = we + U;
2885
- Pt(Ue, U), De(Ue, { immediate: !0 }), V.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: we, to: Ue, causedByIndex: m, delta: U, activeVisibleStartIndex: J });
2884
+ const Se = h.current, Ue = Se + U;
2885
+ Pt(Ue, U), De(Ue, { immediate: !0 }), V.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: Se, to: Ue, causedByIndex: m, delta: U, activeVisibleStartIndex: J });
2886
2886
  }
2887
2887
  },
2888
2888
  [y, t, Pt, De, F]
2889
2889
  ), st = w(
2890
- (c, x) => {
2890
+ (c, b) => {
2891
2891
  if (!j.current || t === 0)
2892
2892
  return;
2893
- const m = Ze(c, t), W = Ze(m - s * 2, t), U = Ze(m + s * 2, t), { cumulative: G, total: J, currentValue: we } = y.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: W, to: U }] } });
2894
- if (V.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", G, "Total height:", J, "ItemHeight:", we, "safeIndexFrom:", W, "safeIndexTo:", U), !J)
2893
+ const m = Ze(c, t), W = Ze(m - s * 2, t), U = Ze(m + s * 2, t), { cumulative: G, total: J, currentValue: Se } = y.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: W, to: U }] } });
2894
+ if (V.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", G, "Total height:", J, "ItemHeight:", Se, "safeIndexFrom:", W, "safeIndexTo:", U), !J)
2895
2895
  return;
2896
- const Ue = Math.max(G - we, 0);
2896
+ const Ue = Math.max(G - Se, 0);
2897
2897
  let Le = Ue;
2898
- x?.align === "bottom" ? Le = G - fe : x?.align === "center" && (Le = Ue + we / 2 - fe / 2), x?.offset && (Le -= x.offset), Le = Math.max(0, Le);
2898
+ b?.align === "bottom" ? Le = G - fe : b?.align === "center" && (Le = Ue + Se / 2 - fe / 2), b?.offset && (Le -= b.offset), Le = Math.max(0, Le);
2899
2899
  const ze = ir(Le, D.top), pt = j.current?.getContentSize() ?? J + D.top + D.bottom, ot = Math.max(0, pt - fe), gt = Math.min(ze, ot);
2900
2900
  re.current = {
2901
2901
  index: m,
2902
- align: x?.align,
2903
- offset: x?.offset
2902
+ align: b?.align,
2903
+ offset: b?.offset
2904
2904
  };
2905
2905
  const nr = j.current?.getScrollPosition() ?? -1, or = Math.abs(nr - gt) > 0.5;
2906
2906
  it.current = !1, pe.current = 0, or && (it.current = !0, pe.current += 1, j.current?.scrollTo(gt)), Tt(J), De(gt, { immediate: !0 }), V.debug("[VirtualScroll] Setting scroll position to:", gt, { original: ze, max: ot });
@@ -2915,47 +2915,47 @@ const ni = 1e4, yi = () => {
2915
2915
  (c) => {
2916
2916
  if (!j.current || t === 0)
2917
2917
  return;
2918
- const x = y.getTotal(), m = oe(Math.floor(c), 0, x), { index: W, cumulative: U, currentValue: G } = y.findIndexAtOrAfter(m, { materializeOption: { materialize: !1 } }), we = (U ?? 0) - (G ?? 0) - m;
2919
- st(W, { offset: we });
2918
+ const b = y.getTotal(), m = oe(Math.floor(c), 0, b), { index: W, cumulative: U, currentValue: G } = y.findIndexAtOrAfter(m, { materializeOption: { materialize: !1 } }), Se = (U ?? 0) - (G ?? 0) - m;
2919
+ st(W, { offset: Se });
2920
2920
  },
2921
2921
  [y, t, st]
2922
2922
  ), O = w(() => {
2923
2923
  if (t === 0)
2924
2924
  return null;
2925
- const c = yt(h.current, D.top), { index: x, cumulative: m, currentValue: W } = y.findIndexAtOrAfter(c, { materializeOption: { materialize: !1 } });
2926
- if (x === -1)
2925
+ const c = yt(h.current, D.top), { index: b, cumulative: m, currentValue: W } = y.findIndexAtOrAfter(c, { materializeOption: { materialize: !1 } });
2926
+ if (b === -1)
2927
2927
  return { index: t - 1, offsetPx: 0 };
2928
2928
  if (m === c)
2929
- return { index: oe(x + 1, 0, t - 1), offsetPx: 0 };
2929
+ return { index: oe(b + 1, 0, t - 1), offsetPx: 0 };
2930
2930
  const U = (m ?? 0) - (W ?? 0);
2931
- return { index: x, offsetPx: Math.max(0, c - U) };
2931
+ return { index: b, offsetPx: Math.max(0, c - U) };
2932
2932
  }, [y, t, D.top]), te = w(
2933
2933
  (c) => {
2934
- const x = yt(h.current, D.top), m = typeof c == "function" ? c(x) : c;
2934
+ const b = yt(h.current, D.top), m = typeof c == "function" ? c(b) : c;
2935
2935
  E(m);
2936
2936
  const W = j.current?.getScrollPosition(), U = typeof W == "number" ? W : h.current;
2937
2937
  return De(U), yt(U, Fe.current);
2938
2938
  },
2939
2939
  [D.top, E, De]
2940
2940
  ), Ce = w((c) => {
2941
- const x = j.current;
2942
- if (!x)
2941
+ const b = j.current;
2942
+ if (!b)
2943
2943
  return yt(h.current, Fe.current);
2944
- const m = x.scrollTo((W) => W + c);
2944
+ const m = b.scrollTo((W) => W + c);
2945
2945
  return yt(m, Fe.current);
2946
2946
  }, []), je = w((c) => j.current?.applyWheel(c) ?? !1, []), St = w(
2947
- (c, x) => {
2947
+ (c, b) => {
2948
2948
  V.debug("[VirtualScroll] Scroll position changed:", c);
2949
2949
  const m = it.current;
2950
2950
  m && (it.current = !1);
2951
2951
  const W = pe.current > 0;
2952
2952
  W && (pe.current = 0);
2953
2953
  const U = wt.current && p.current === t;
2954
- if (m || W || U || (re.current = null), De(c), ye) {
2954
+ if (m || W || U || (re.current = null), De(c), Te) {
2955
2955
  if (m || W)
2956
2956
  return;
2957
- const G = c - x;
2958
- if (V.debug("[VirtualScroll] Scroll diff:", G, "New:", c, "Prev:", x), Math.abs(G) > 1) {
2957
+ const G = c - b;
2958
+ if (V.debug("[VirtualScroll] Scroll diff:", G, "New:", c, "Prev:", b), Math.abs(G) > 1) {
2959
2959
  const J = G > 0 ? "down" : "up";
2960
2960
  ft(J), Be(!0), V.debug("[VirtualScroll] Showing scroll buttons. Direction:", J), tt.current && clearTimeout(tt.current), tt.current = setTimeout(() => {
2961
2961
  Be(!1), V.debug("[VirtualScroll] Hiding scroll buttons");
@@ -2963,34 +2963,34 @@ const ni = 1e4, yi = () => {
2963
2963
  }
2964
2964
  }
2965
2965
  },
2966
- [De, ye, t]
2967
- ), He = Se(() => yt(et, D.top), [D.top, et]), Dt = Se(() => {
2968
- const c = y.getTotal(), x = Sn(He, fe, s, t, n, y, c);
2966
+ [De, Te, t]
2967
+ ), He = Me(() => yt(et, D.top), [D.top, et]), Dt = Me(() => {
2968
+ const c = y.getTotal(), b = Sn(He, fe, s, t, n, y, c);
2969
2969
  return V.debug("[VirtualScroll] Calculated rendering range:", () => ({
2970
- ...x,
2970
+ ...b,
2971
2971
  scrollPosition: He,
2972
2972
  renderingContentSize: c,
2973
2973
  overscanCount: s,
2974
2974
  viewportSize: fe
2975
- })), x;
2975
+ })), b;
2976
2976
  }, [He, fe, s, t, n, y]), { renderingStartIndex: bt, renderingEndIndex: Lt, visibleStartIndex: Ht, visibleEndIndex: Gt } = Dt, Ot = w(
2977
- (c, x) => {
2977
+ (c, b) => {
2978
2978
  if (!_ || t === 0)
2979
2979
  return;
2980
2980
  const m = Ze(c, t);
2981
- if (!(x?.ensureVisible ?? !0)) {
2982
- const ot = Te.current.get(m);
2981
+ if (!(b?.ensureVisible ?? !0)) {
2982
+ const ot = Re.current.get(m);
2983
2983
  ot && (_e.current = null, me.current = m, P(ot));
2984
2984
  return;
2985
2985
  }
2986
- const U = y.prefixSum(m, { materializeOption: { materialize: !1 } }), G = U.currentValue, J = Math.max(U.cumulative - G, 0), we = J + G, Ue = yt(h.current, D.top), Le = Ue + fe;
2987
- if (J < Ue || we > Le) {
2986
+ const U = y.prefixSum(m, { materializeOption: { materialize: !1 } }), G = U.currentValue, J = Math.max(U.cumulative - G, 0), Se = J + G, Ue = yt(h.current, D.top), Le = Ue + fe;
2987
+ if (J < Ue || Se > Le) {
2988
2988
  st(m);
2989
- const ot = Te.current.get(m);
2989
+ const ot = Re.current.get(m);
2990
2990
  ot ? (_e.current = null, me.current = m, P(ot)) : _e.current = m;
2991
2991
  return;
2992
2992
  }
2993
- const pt = Te.current.get(m);
2993
+ const pt = Re.current.get(m);
2994
2994
  if (pt) {
2995
2995
  _e.current = null, me.current = m, P(pt);
2996
2996
  return;
@@ -2999,7 +2999,7 @@ const ni = 1e4, yi = () => {
2999
2999
  },
3000
3000
  [_, t, y, D.top, st, P, fe]
3001
3001
  ), sr = w(
3002
- (c, x) => {
3002
+ (c, b) => {
3003
3003
  if (!(!_ || c.defaultPrevented) && !(c.altKey || c.metaKey || c.ctrlKey) && c.target === c.currentTarget && !c.currentTarget.isContentEditable) {
3004
3004
  if (c.key === "ArrowLeft" || c.key === "ArrowRight") {
3005
3005
  const m = he.current;
@@ -3009,24 +3009,24 @@ const ni = 1e4, yi = () => {
3009
3009
  return;
3010
3010
  }
3011
3011
  if (c.key === "ArrowDown") {
3012
- x < t - 1 && (c.preventDefault(), Ot(x + 1));
3012
+ b < t - 1 && (c.preventDefault(), Ot(b + 1));
3013
3013
  return;
3014
3014
  }
3015
3015
  if (c.key === "ArrowUp") {
3016
- x > 0 && (c.preventDefault(), Ot(x - 1));
3016
+ b > 0 && (c.preventDefault(), Ot(b - 1));
3017
3017
  return;
3018
3018
  }
3019
3019
  if (c.key === "PageDown") {
3020
- if (x < t - 1) {
3020
+ if (b < t - 1) {
3021
3021
  c.preventDefault();
3022
- const { visibleStartIndex: m, visibleEndIndex: W } = Je.current, U = Math.max(W - m + 1, 1), G = Math.max(U, 1), J = Ze(Math.min(x + G, t - 1), t);
3022
+ const { visibleStartIndex: m, visibleEndIndex: W } = Je.current, U = Math.max(W - m + 1, 1), G = Math.max(U, 1), J = Ze(Math.min(b + G, t - 1), t);
3023
3023
  Ot(J);
3024
3024
  }
3025
3025
  return;
3026
3026
  }
3027
- if (c.key === "PageUp" && x > 0) {
3027
+ if (c.key === "PageUp" && b > 0) {
3028
3028
  c.preventDefault();
3029
- const { visibleStartIndex: m, visibleEndIndex: W } = Je.current, U = Math.max(W - m + 1, 1), G = Math.max(U, 1), J = Ze(x - G, t);
3029
+ const { visibleStartIndex: m, visibleEndIndex: W } = Je.current, U = Math.max(W - m + 1, 1), G = Math.max(U, 1), J = Ze(b - G, t);
3030
3030
  Ot(J);
3031
3031
  }
3032
3032
  }
@@ -3040,31 +3040,31 @@ const ni = 1e4, yi = () => {
3040
3040
  * @param event - Keyboard event (bubble phase on the row wrapper) / 行ラッパー bubble フェーズのキーイベント
3041
3041
  * @param index - Row index / 行インデックス
3042
3042
  */
3043
- (c, x) => {
3043
+ (c, b) => {
3044
3044
  if (c.key !== "Escape" || c.defaultPrevented || c.nativeEvent.isComposing || c.target === c.currentTarget)
3045
3045
  return;
3046
3046
  const m = c.target;
3047
- m instanceof HTMLInputElement || m instanceof HTMLTextAreaElement || m instanceof HTMLSelectElement || m.isContentEditable || (c.preventDefault(), Ot(x));
3047
+ m instanceof HTMLInputElement || m instanceof HTMLTextAreaElement || m instanceof HTMLSelectElement || m.isContentEditable || (c.preventDefault(), Ot(b));
3048
3048
  },
3049
3049
  [Ot]
3050
3050
  ), jt = w(
3051
3051
  (c) => {
3052
3052
  if (!_)
3053
3053
  return;
3054
- const x = Ze(c, t);
3055
- _e.current = null, me.current = x, Me?.(x);
3054
+ const b = Ze(c, t);
3055
+ _e.current = null, me.current = b, Ie?.(b);
3056
3056
  },
3057
- [_, t, Me]
3057
+ [_, t, Ie]
3058
3058
  );
3059
3059
  q(() => {
3060
- const c = j.current?.getScrollPosition() ?? 0, x = h.current, m = yt(x, D.top);
3060
+ const c = j.current?.getScrollPosition() ?? 0, b = h.current, m = yt(b, D.top);
3061
3061
  V.debug("[VirtualScroll] Range change effect triggered", () => ({
3062
3062
  renderingStartIndex: bt,
3063
3063
  renderingEndIndex: Lt,
3064
3064
  visibleStartIndex: Ht,
3065
3065
  visibleEndIndex: Gt,
3066
3066
  scrollPositionState: et,
3067
- paneScrollPosition: x,
3067
+ paneScrollPosition: b,
3068
3068
  logicalScrollPosition: m,
3069
3069
  contentSize: ct,
3070
3070
  scrollPaneScrollPosition: c
@@ -3078,7 +3078,7 @@ const ni = 1e4, yi = () => {
3078
3078
  });
3079
3079
  }, [ct, Lt, bt, D.top, Rt, et, Gt, Ht]);
3080
3080
  const gr = w(() => {
3081
- if (!ye)
3081
+ if (!Te)
3082
3082
  return null;
3083
3083
  const c = Ee && dt !== null;
3084
3084
  return /* @__PURE__ */ Q("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": c, inert: !c, children: dt === "up" ? /* @__PURE__ */ Q("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ Q(
@@ -3104,25 +3104,25 @@ const ni = 1e4, yi = () => {
3104
3104
  children: "Bottom"
3105
3105
  }
3106
3106
  ) }) });
3107
- }, [ye, Ee, dt, st, t]), Mt = d(0), { visibleItems: Nt, renderAnchor: Xt } = Se(() => {
3107
+ }, [Te, Ee, dt, st, t]), Mt = d(0), { visibleItems: Nt, renderAnchor: Xt } = Me(() => {
3108
3108
  if (t === 0)
3109
3109
  return {
3110
3110
  visibleItems: /* @__PURE__ */ Q("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ Q("div", { className: "aqvs-no-items-text", children: "No items" }) }),
3111
3111
  renderAnchor: 0
3112
3112
  };
3113
- const c = Ze(bt, t), x = Ze(Lt, t), { cumulative: m, currentValue: W } = y.prefixSum(c, { materializeOption: { materialize: !1 } }), U = m - W;
3113
+ const c = Ze(bt, t), b = Ze(Lt, t), { cumulative: m, currentValue: W } = y.prefixSum(c, { materializeOption: { materialize: !1 } }), U = m - W;
3114
3114
  Number.isFinite(U) && Math.abs(U - Mt.current) > wn && (Mt.current = U);
3115
- const G = Mt.current, J = [], we = [];
3115
+ const G = Mt.current, J = [], Se = [];
3116
3116
  let Ue = 0, Le = U;
3117
- for (let ze = c; ze <= x; ze++) {
3118
- if (we.length >= Hr) {
3119
- V.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Hr, safeRenderingStartIndex: c, safeRenderingEndIndex: x });
3117
+ for (let ze = c; ze <= b; ze++) {
3118
+ if (Se.length >= Hr) {
3119
+ V.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Hr, safeRenderingStartIndex: c, safeRenderingEndIndex: b });
3120
3120
  break;
3121
3121
  }
3122
3122
  const pt = n(ze), ot = y.get(ze), gt = pt - ot;
3123
3123
  gt !== 0 && J.push({ index: ze, value: pt });
3124
3124
  const nr = Le + Ue, or = r ? r(ze) : ze;
3125
- we.push(
3125
+ Se.push(
3126
3126
  /* @__PURE__ */ Q(
3127
3127
  ai,
3128
3128
  {
@@ -3160,7 +3160,7 @@ const ni = 1e4, yi = () => {
3160
3160
  const gt = ot + ze;
3161
3161
  Pt(gt, ze), De(gt, { immediate: !0 }), V.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: ot, to: gt, shiftAmount: ze });
3162
3162
  } else ot !== h.current && De(ot);
3163
- }), { visibleItems: we, renderAnchor: G };
3163
+ }), { visibleItems: Se, renderAnchor: G };
3164
3164
  }, [
3165
3165
  v,
3166
3166
  at,
@@ -3183,7 +3183,7 @@ const ni = 1e4, yi = () => {
3183
3183
  Ht
3184
3184
  ]), qt = w(
3185
3185
  (c) => {
3186
- const x = (ee ?? 0) > 0, m = Math.abs(c - et), W = x && m > 0.5 ? et : c, U = yt(W, D.top);
3186
+ const b = (ee ?? 0) > 0, m = Math.abs(c - et), W = b && m > 0.5 ? et : c, U = yt(W, D.top);
3187
3187
  if (V.debug("[VirtualScroll] Rendering visible items", () => ({
3188
3188
  currentScrollPosition: c,
3189
3189
  effectiveScrollPosition: U,
@@ -3219,7 +3219,7 @@ const ni = 1e4, yi = () => {
3219
3219
  ] });
3220
3220
  },
3221
3221
  [ee, t, y, He, Xt, Lt, bt, D, et, fe, Nt]
3222
- ), Zt = Se(
3222
+ ), Zt = Me(
3223
3223
  () => ({
3224
3224
  renderingStartIndex: Dt.renderingStartIndex,
3225
3225
  renderingEndIndex: Dt.renderingEndIndex,
@@ -3249,10 +3249,10 @@ const ni = 1e4, yi = () => {
3249
3249
  return;
3250
3250
  }
3251
3251
  const c = setTimeout(() => {
3252
- const x = It.current?.format;
3253
- if (!x)
3252
+ const b = It.current?.format;
3253
+ if (!b)
3254
3254
  return;
3255
- const m = x({ visibleStartIndex: Ht, visibleEndIndex: Gt, itemCount: t });
3255
+ const m = b({ visibleStartIndex: Ht, visibleEndIndex: Gt, itemCount: t });
3256
3256
  Qt(m);
3257
3257
  }, Ct);
3258
3258
  return () => clearTimeout(c);
@@ -3285,7 +3285,7 @@ const ni = 1e4, yi = () => {
3285
3285
  contentSize: Er,
3286
3286
  viewportSize: i,
3287
3287
  onViewportSizeChange: Ve,
3288
- className: o,
3288
+ className: a,
3289
3289
  testId: l,
3290
3290
  onScroll: St,
3291
3291
  background: R,
@@ -3317,21 +3317,21 @@ const ni = 1e4, yi = () => {
3317
3317
  /* @__PURE__ */ Q("div", { className: "aqvs-live-region", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-aqvs-live-region": "", children: rr })
3318
3318
  ] }) : $t;
3319
3319
  }, li = Rr(ci), Tr = 262144, ln = 3, ui = 32768, un = 128, dn = 128, fn = 128, hn = 128, Or = 10, di = (t, e) => Math.max(1, Math.floor((t ?? ui) / Math.max(1, e))), fi = (t, e, r, n, i) => {
3320
- let s = 0, o = 0, l = Math.max(0, Math.min(n, r - 1));
3321
- for (; l < r && s < t && o < Hr; )
3322
- s += e(l), o += 1, l += 1;
3323
- return Math.max(1, o + 2 * i + 2);
3320
+ let s = 0, a = 0, l = Math.max(0, Math.min(n, r - 1));
3321
+ for (; l < r && s < t && a < Hr; )
3322
+ s += e(l), a += 1, l += 1;
3323
+ return Math.max(1, a + 2 * i + 2);
3324
3324
  }, Ir = (t, e, r) => {
3325
3325
  if (!(Number.isInteger(t) && t >= 0 && t <= Tr))
3326
3326
  throw new RangeError(
3327
3327
  `[VirtualGrid] ${e === "row" ? "getRowHeight" : "getColWidth"}(${r}) returned ${t} — must be an integer in [0, ${Tr}] (0 = hidden). Oversized tracks would pierce the browser layout-coordinate wall (see the design plan §3.1/§6).`
3328
3328
  );
3329
3329
  return t;
3330
- }, hi = (t, e, r, n, i, s, o, l) => {
3331
- const f = Sn(t, e, r, n, i, s, o);
3330
+ }, hi = (t, e, r, n, i, s, a, l) => {
3331
+ const f = Sn(t, e, r, n, i, s, a);
3332
3332
  if (n === 0)
3333
3333
  return { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0 };
3334
- const g = oe(f.renderingStartIndex, 0, n - 1), { cumulative: v, currentValue: R } = s.prefixSum(g, { materializeOption: { materialize: !1 } }), T = v - R, S = Number.isFinite(T) && Math.abs(T - l) > wn ? T : l;
3334
+ const x = oe(f.renderingStartIndex, 0, n - 1), { cumulative: v, currentValue: R } = s.prefixSum(x, { materializeOption: { materialize: !1 } }), T = v - R, S = Number.isFinite(T) && Math.abs(T - l) > wn ? T : l;
3335
3335
  return {
3336
3336
  renderingColStart: f.renderingStartIndex,
3337
3337
  renderingColEnd: f.renderingEndIndex,
@@ -3340,44 +3340,44 @@ const ni = 1e4, yi = () => {
3340
3340
  colAnchor: S
3341
3341
  };
3342
3342
  }, mn = [], mi = (t, e, r, n, i) => {
3343
- const s = [], o = [];
3343
+ const s = [], a = [];
3344
3344
  if (e < t)
3345
- return { columns: s, widthUpdates: o, truncated: 0 };
3345
+ return { columns: s, widthUpdates: a, truncated: 0 };
3346
3346
  const l = n.prefixSum(t, { materializeOption: { materialize: !1 } });
3347
- let f = l.cumulative - l.currentValue, g = 0, v = t;
3347
+ let f = l.cumulative - l.currentValue, x = 0, v = t;
3348
3348
  for (; v <= e; ) {
3349
3349
  if (s.length >= i)
3350
- return { columns: s, widthUpdates: o, truncated: e - v + 1 };
3350
+ return { columns: s, widthUpdates: a, truncated: e - v + 1 };
3351
3351
  const R = r(v), T = n.get(v);
3352
- if (R !== T && o.push({ index: v, value: R }), R > 0) {
3353
- s.push({ col: v, left: f, width: R }), f += T, g = 0, v += 1;
3352
+ if (R !== T && a.push({ index: v, value: R }), R > 0) {
3353
+ s.push({ col: v, left: f, width: R }), f += T, x = 0, v += 1;
3354
3354
  continue;
3355
3355
  }
3356
- if (f += T, g += 1, v += 1, g > pr) {
3356
+ if (f += T, x += 1, v += 1, x > pr) {
3357
3357
  const S = n.findIndexAtOrAfter(f + 0.5, { materializeOption: { materialize: !1 } });
3358
3358
  if (S.index === -1 || S.index <= v || !Number.isSafeInteger(S.index))
3359
3359
  break;
3360
3360
  const N = n.prefixSum(S.index, { materializeOption: { materialize: !1 } });
3361
- f = N.cumulative - N.currentValue, v = S.index, g = 0;
3361
+ f = N.cumulative - N.currentValue, v = S.index, x = 0;
3362
3362
  }
3363
3363
  }
3364
- return { columns: s, widthUpdates: o, truncated: 0 };
3364
+ return { columns: s, widthUpdates: a, truncated: 0 };
3365
3365
  }, pi = (t, e, r) => {
3366
3366
  const n = [], i = [];
3367
3367
  let s = 0;
3368
- for (let o = 0; o < t; o += 1) {
3369
- const l = e(o), f = r.get(o);
3370
- l !== f && i.push({ index: o, value: l }), l > 0 && n.push({ col: o, left: s, width: l }), s += f;
3368
+ for (let a = 0; a < t; a += 1) {
3369
+ const l = e(a), f = r.get(a);
3370
+ l !== f && i.push({ index: a, value: l }), l > 0 && n.push({ col: a, left: s, width: l }), s += f;
3371
3371
  }
3372
3372
  return { columns: n, widthUpdates: i, width: s };
3373
3373
  }, gi = (t, e, r, n) => {
3374
3374
  const i = [], s = [];
3375
- let o = 0;
3375
+ let a = 0;
3376
3376
  for (let l = t - e; l < t; l += 1) {
3377
- const f = r(l), g = n.get(l);
3378
- f !== g && s.push({ index: l, value: f }), f > 0 && i.push({ col: l, left: o, width: f }), o += g;
3377
+ const f = r(l), x = n.get(l);
3378
+ f !== x && s.push({ index: l, value: f }), f > 0 && i.push({ col: l, left: a, width: f }), a += x;
3379
3379
  }
3380
- return { columns: i, widthUpdates: s, width: o };
3380
+ return { columns: i, widthUpdates: s, width: a };
3381
3381
  }, yr = (t, e, r) => Math.min(t, Math.max(0, r - e)), xi = { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0, key: "0:0:0" }, bi = ({
3382
3382
  rowCount: t,
3383
3383
  colCount: e,
@@ -3385,10 +3385,10 @@ const ni = 1e4, yi = () => {
3385
3385
  getColWidth: n,
3386
3386
  getCell: i,
3387
3387
  getCellKey: s,
3388
- children: o,
3388
+ children: a,
3389
3389
  getCellProps: l,
3390
3390
  getRowProps: f,
3391
- contentProps: g,
3391
+ contentProps: x,
3392
3392
  background: v,
3393
3393
  contentInsets: R,
3394
3394
  onRowFocus: T,
@@ -3396,8 +3396,8 @@ const ni = 1e4, yi = () => {
3396
3396
  frozenLeadingRows: N = 0,
3397
3397
  frozenTrailingCols: ee = 0,
3398
3398
  frozenTrailingRows: F = 0,
3399
- horizontalKeyInputs: Me,
3400
- horizontalKeyStep: Ie,
3399
+ horizontalKeyInputs: Ie,
3400
+ horizontalKeyStep: ye,
3401
3401
  onScroll: A,
3402
3402
  onRangeChange: $,
3403
3403
  onRenderTruncated: ie,
@@ -3410,7 +3410,7 @@ const ni = 1e4, yi = () => {
3410
3410
  behaviorOptions: ae,
3411
3411
  scrollBarOptions: ce,
3412
3412
  liveRegion: k,
3413
- className: ye,
3413
+ className: Te,
3414
3414
  testId: I
3415
3415
  }, le) => {
3416
3416
  const ue = d(null), Ye = d(null), _ = d(r);
@@ -3418,12 +3418,12 @@ const ni = 1e4, yi = () => {
3418
3418
  const Xe = d(n);
3419
3419
  Xe.current = n;
3420
3420
  const ut = ae?.resetOnGetColWidthChange === !0, Ge = ae?.resetOnGetItemHeightChange === !0 ? r : null, at = ut ? n : null, Pe = w(
3421
- (a) => Ir(_.current(a), "row", a),
3421
+ (o) => Ir(_.current(o), "row", o),
3422
3422
  [Ge]
3423
3423
  ), qe = w(
3424
- (a) => Ir(Xe.current(a), "col", a),
3424
+ (o) => Ir(Xe.current(o), "col", o),
3425
3425
  [at]
3426
- ), be = ae?.defaultColWidth, fe = Se(() => {
3426
+ ), be = ae?.defaultColWidth, fe = Me(() => {
3427
3427
  if (be !== void 0 && !(Number.isInteger(be) && be >= 0 && be <= Tr))
3428
3428
  throw new RangeError(`[VirtualGrid] behaviorOptions.defaultColWidth must be an integer in [0, ${Tr}], received ${be}.`);
3429
3429
  return { resetOnValueFnChange: ut, baseValue: be };
@@ -3439,48 +3439,48 @@ const ni = 1e4, yi = () => {
3439
3439
  const Z = Math.min(N, t);
3440
3440
  if (!(Number.isInteger(F) && F >= 0 && F <= hn))
3441
3441
  throw new RangeError(`[VirtualGrid] frozenTrailingRows must be an integer in [0, ${hn}], received ${F}.`);
3442
- const We = Math.min(F, t - Z), y = Math.max(0, t - Z - We), vt = d(!1), et = d(0), xt = d(0), [ct, Tt] = Oe(0), { frozenRows: h, frozenHeight: H } = Se(() => {
3442
+ const We = Math.min(F, t - Z), y = Math.max(0, t - Z - We), vt = d(!1), et = d(0), xt = d(0), [ct, Tt] = Oe(0), { frozenRows: h, frozenHeight: H } = Me(() => {
3443
3443
  if (Z === 0)
3444
3444
  return { frozenRows: [], frozenHeight: 0 };
3445
- const a = [];
3446
- let b = 0;
3445
+ const o = [];
3446
+ let g = 0;
3447
3447
  for (let M = 0; M < Z; M += 1) {
3448
3448
  const X = Pe(M);
3449
- X > 0 && a.push({ row: M, top: b, height: X }), b += X;
3449
+ X > 0 && o.push({ row: M, top: g, height: X }), g += X;
3450
3450
  }
3451
- return { frozenRows: a, frozenHeight: b };
3451
+ return { frozenRows: o, frozenHeight: g };
3452
3452
  }, [Z, ct, Pe]);
3453
3453
  et.current = H;
3454
- const [se, ne] = Oe(0), { trailingRows: he, trailingHeight: xe } = Se(() => {
3454
+ const [se, ne] = Oe(0), { trailingRows: he, trailingHeight: xe } = Me(() => {
3455
3455
  if (We === 0)
3456
3456
  return { trailingRows: [], trailingHeight: 0 };
3457
- const a = [];
3458
- let b = 0;
3457
+ const o = [];
3458
+ let g = 0;
3459
3459
  for (let M = t - We; M < t; M += 1) {
3460
3460
  const X = Pe(M);
3461
- X > 0 && a.push({ row: M, top: b, height: X }), b += X;
3461
+ X > 0 && o.push({ row: M, top: g, height: X }), g += X;
3462
3462
  }
3463
- return { trailingRows: a, trailingHeight: b };
3463
+ return { trailingRows: o, trailingHeight: g };
3464
3464
  }, [We, t, se, Pe]);
3465
3465
  xt.current = xe;
3466
- const ve = w((a) => Pe(a + Z), [Pe, Z]), Te = d(T);
3467
- Te.current = T;
3468
- const _e = T !== void 0, me = Se(() => _e ? (a) => Te.current?.(a + Z) : void 0, [Z, _e]), dt = H, ft = xe, [Ee, Be] = Oe(Z), tt = d(null), it = d(!1);
3466
+ const ve = w((o) => Pe(o + Z), [Pe, Z]), Re = d(T);
3467
+ Re.current = T;
3468
+ const _e = T !== void 0, me = Me(() => _e ? (o) => Re.current?.(o + Z) : void 0, [Z, _e]), dt = H, ft = xe, [Ee, Be] = Oe(Z), tt = d(null), it = d(!1);
3469
3469
  if (Ee !== Z) {
3470
3470
  Be(Z), it.current = !0;
3471
- const a = ue.current?.getScrollAnchor() ?? null;
3472
- tt.current = a === null ? null : { row: a.index + Ee, offsetPx: a.offsetPx };
3471
+ const o = ue.current?.getScrollAnchor() ?? null;
3472
+ tt.current = o === null ? null : { row: o.index + Ee, offsetPx: o.offsetPx };
3473
3473
  }
3474
- const pe = d(0), Re = d(0), wt = d(!1), [p, P] = Oe(xi), Ae = d(p);
3474
+ const pe = d(0), we = d(0), wt = d(!1), [p, P] = Oe(xi), Ae = d(p);
3475
3475
  Ae.current = p;
3476
3476
  const lt = d(0), [$e, Rt] = Oe(() => Ve.getTotal() ?? 0), Fe = d($e);
3477
3477
  Fe.current = $e;
3478
- const ht = w((a) => {
3479
- typeof a == "number" && Number.isFinite(a) && (Fe.current = a, Rt(a));
3478
+ const ht = w((o) => {
3479
+ typeof o == "number" && Number.isFinite(o) && (Fe.current = o, Rt(o));
3480
3480
  }, []);
3481
3481
  Qe(() => {
3482
- const a = Ve.getTotal();
3483
- typeof a == "number" && Number.isFinite(a) && a !== Fe.current && ht(a);
3482
+ const o = Ve.getTotal();
3483
+ typeof o == "number" && Number.isFinite(o) && o !== Fe.current && ht(o);
3484
3484
  });
3485
3485
  const ke = ce?.width ?? 12, Bt = B === void 0 ? null : { width: Math.max(0, Math.round(B.width) - ke), height: Math.max(0, Math.round(B.height) - ke) }, [Ut, Vt] = Oe({ width: 0, height: 0 }), Ne = Bt ?? Ut, zt = d(Ne);
3486
3486
  zt.current = Ne;
@@ -3490,29 +3490,29 @@ const ni = 1e4, yi = () => {
3490
3490
  Qe(() => {
3491
3491
  if (De)
3492
3492
  return;
3493
- const a = Ye.current;
3494
- if (a === null)
3493
+ const o = Ye.current;
3494
+ if (o === null)
3495
3495
  return;
3496
- const b = () => {
3497
- const X = Math.max(0, Math.round(a.clientWidth) - ke), de = Math.max(0, Math.round(a.clientHeight) - ke);
3496
+ const g = () => {
3497
+ const X = Math.max(0, Math.round(o.clientWidth) - ke), de = Math.max(0, Math.round(o.clientHeight) - ke);
3498
3498
  Vt((rt) => rt.width === X && rt.height === de ? rt : { width: X, height: de });
3499
3499
  };
3500
- b();
3501
- const M = new ResizeObserver(b);
3502
- return M.observe(a), () => M.disconnect();
3500
+ g();
3501
+ const M = new ResizeObserver(g);
3502
+ return M.observe(o), () => M.disconnect();
3503
3503
  }, [ke, De]);
3504
3504
  const Pt = w(() => {
3505
- const a = Ye.current;
3506
- a !== null && a.style.setProperty("--aqvs-grid-hx-residual", `${lt.current - pe.current}px`);
3505
+ const o = Ye.current;
3506
+ o !== null && o.style.setProperty("--aqvs-grid-hx-residual", `${lt.current - pe.current}px`);
3507
3507
  }, []), At = w(() => Math.max(0, zt.current.width - Ke.current - D.current), []), kt = w(() => Math.max(0, Fe.current - Ke.current - D.current - At()), [At]), st = w(() => {
3508
- const a = At(), b = hi(Ke.current + pe.current, a, K, e, qe, Ve, Fe.current, Ae.current.colAnchor);
3509
- if (re > 0 && (b.renderingColStart = Math.max(b.renderingColStart, re), b.visibleColStart = Math.max(b.visibleColStart, re)), ge > 0) {
3508
+ const o = At(), g = hi(Ke.current + pe.current, o, K, e, qe, Ve, Fe.current, Ae.current.colAnchor);
3509
+ if (re > 0 && (g.renderingColStart = Math.max(g.renderingColStart, re), g.visibleColStart = Math.max(g.visibleColStart, re)), ge > 0) {
3510
3510
  const X = e - ge - 1;
3511
- b.renderingColEnd = Math.min(b.renderingColEnd, X), b.visibleColEnd = Math.min(b.visibleColEnd, X);
3511
+ g.renderingColEnd = Math.min(g.renderingColEnd, X), g.visibleColEnd = Math.min(g.visibleColEnd, X);
3512
3512
  }
3513
- (re > 0 || ge > 0) && (a <= 0 || b.renderingColStart > b.renderingColEnd) && (b.renderingColStart = e, b.renderingColEnd = e - 1, b.visibleColStart = e, b.visibleColEnd = e - 1);
3514
- const M = `${b.renderingColStart}:${b.renderingColEnd}:${b.colAnchor}`;
3515
- M !== Ae.current.key && P({ ...b, key: M });
3513
+ (re > 0 || ge > 0) && (o <= 0 || g.renderingColStart > g.renderingColEnd) && (g.renderingColStart = e, g.renderingColEnd = e - 1, g.visibleColStart = e, g.visibleColEnd = e - 1);
3514
+ const M = `${g.renderingColStart}:${g.renderingColEnd}:${g.colAnchor}`;
3515
+ M !== Ae.current.key && P({ ...g, key: M });
3516
3516
  }, [K, e, qe, Ve, re, ge, At]), [u, E] = Oe(0), O = d(null), te = w(() => {
3517
3517
  O.current === null && (O.current = requestAnimationFrame(() => {
3518
3518
  O.current = null, E(pe.current);
@@ -3532,37 +3532,37 @@ const ni = 1e4, yi = () => {
3532
3532
  St.current = ie;
3533
3533
  const He = d(null), [Dt, bt] = Oe(null), [Lt, Ht] = Oe(Ne.height);
3534
3534
  Lt !== Ne.height && (Ht(Ne.height), bt(null));
3535
- const Gt = z === void 0 || t === 0 ? 0 : oe(Math.trunc(z.row), 0, t - 1), Ot = Se(() => {
3536
- const a = He.current?.renderingStartIndex ?? Gt;
3537
- return fi(Math.max(0, Ne.height - et.current - xt.current), Pe, t, a, C);
3535
+ const Gt = z === void 0 || t === 0 ? 0 : oe(Math.trunc(z.row), 0, t - 1), Ot = Me(() => {
3536
+ const o = He.current?.renderingStartIndex ?? Gt;
3537
+ return fi(Math.max(0, Ne.height - et.current - xt.current), Pe, t, o, C);
3538
3538
  }, [Ne.height, Pe, t, Gt, C, dt, ft]), sr = Dt ?? Ot, Kt = w(() => {
3539
- const a = He.current;
3540
- if (a === null)
3539
+ const o = He.current;
3540
+ if (o === null)
3541
3541
  return null;
3542
- const b = Ae.current;
3542
+ const g = Ae.current;
3543
3543
  return {
3544
- renderingRowStart: a.renderingStartIndex,
3545
- renderingRowEnd: a.renderingEndIndex,
3546
- visibleRowStart: a.visibleStartIndex,
3547
- visibleRowEnd: a.visibleEndIndex,
3548
- renderingColStart: b.renderingColStart,
3549
- renderingColEnd: b.renderingColEnd,
3550
- visibleColStart: b.visibleColStart,
3551
- visibleColEnd: b.visibleColEnd,
3544
+ renderingRowStart: o.renderingStartIndex,
3545
+ renderingRowEnd: o.renderingEndIndex,
3546
+ visibleRowStart: o.visibleStartIndex,
3547
+ visibleRowEnd: o.visibleEndIndex,
3548
+ renderingColStart: g.renderingColStart,
3549
+ renderingColEnd: g.renderingColEnd,
3550
+ visibleColStart: g.visibleColStart,
3551
+ visibleColEnd: g.visibleColEnd,
3552
3552
  scrollX: pe.current,
3553
- scrollY: Re.current,
3553
+ scrollY: we.current,
3554
3554
  totalWidth: Fe.current,
3555
3555
  // 帯高は鮮度加算 (格納はスクロール木のみ — 帯行リサイズ後も総高が正しい。R1 是正。
3556
3556
  // 3.5.0: 末尾帯高 H_T も同じ鮮度規律で加算)
3557
- totalHeight: a.totalHeight + et.current + xt.current
3557
+ totalHeight: o.totalHeight + et.current + xt.current
3558
3558
  };
3559
3559
  }, []), jt = w(() => {
3560
- const a = Kt();
3561
- a !== null && je.current?.(a);
3560
+ const o = Kt();
3561
+ o !== null && je.current?.(o);
3562
3562
  }, [Kt]), gr = w(
3563
- (a) => {
3564
- const b = kt(), M = oe(a, 0, b);
3565
- return M !== pe.current && (pe.current = M, Pt(), st(), te(), Ce.current?.({ x: M, y: Re.current })), M;
3563
+ (o) => {
3564
+ const g = kt(), M = oe(o, 0, g);
3565
+ return M !== pe.current && (pe.current = M, Pt(), st(), te(), Ce.current?.({ x: M, y: we.current })), M;
3566
3566
  },
3567
3567
  [Pt, st, te, kt]
3568
3568
  ), Mt = d(gr);
@@ -3572,81 +3572,87 @@ const ni = 1e4, yi = () => {
3572
3572
  He.current !== null && jt();
3573
3573
  }, [H, xe, jt]);
3574
3574
  const Nt = d(null), Xt = w(
3575
- (a) => {
3576
- const b = oe(a.col, 0, Math.max(0, e - 1)), M = Ve.prefixSum(b, { materializeOption: { materialize: !1 } }), X = M.cumulative - M.currentValue, de = M.currentValue, rt = At();
3577
- return (a.alignX === "end" ? X + de - Ke.current - rt : a.alignX === "center" ? X + de / 2 - Ke.current - rt / 2 : X - Ke.current) + a.offsetX;
3575
+ (o) => {
3576
+ const g = oe(o.col, 0, Math.max(0, e - 1)), M = Ve.prefixSum(g, { materializeOption: { materialize: !1 } }), X = M.cumulative - M.currentValue, de = M.currentValue, rt = At();
3577
+ return (o.alignX === "end" ? X + de - Ke.current - rt : o.alignX === "center" ? X + de / 2 - Ke.current - rt / 2 : X - Ke.current) + o.offsetX;
3578
3578
  },
3579
3579
  [Ve, e, At]
3580
3580
  ), qt = d(null), Zt = w(() => {
3581
- const a = qt.current;
3582
- qt.current = null, !(a === null || a.length === 0) && (ht(Ve.updates(a)), Je((b) => b + 1));
3583
- }, [Ve, ht]), rr = d({ count: 0, warned: !1 }), { frozenColumns: Qt, frozenWidth: It } = Se(() => {
3581
+ const o = qt.current;
3582
+ qt.current = null, !(o === null || o.length === 0) && (ht(Ve.updates(o)), Je((g) => g + 1));
3583
+ }, [Ve, ht]), rr = d({ count: 0, warned: !1 }), { frozenColumns: Qt, frozenWidth: It } = Me(() => {
3584
3584
  if (re === 0)
3585
3585
  return rr.current.count = 0, rr.current.warned = !1, { frozenColumns: mn, frozenWidth: 0 };
3586
- const { columns: a, widthUpdates: b, width: M } = pi(re, qe, Ve);
3587
- if (b.length > 0) {
3586
+ const { columns: o, widthUpdates: g, width: M } = pi(re, qe, Ve);
3587
+ if (g.length > 0) {
3588
3588
  const X = rr.current;
3589
3589
  X.count >= Or ? X.warned || (X.warned = !0, V.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the frozen band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
3590
3590
  frozenCols: re,
3591
- pendingUpdates: b.length
3592
- })) : (X.count += 1, qt.current = [...qt.current ?? [], ...b], Promise.resolve().then(Zt));
3591
+ pendingUpdates: g.length
3592
+ })) : (X.count += 1, qt.current = [...qt.current ?? [], ...g], Promise.resolve().then(Zt));
3593
3593
  } else
3594
3594
  rr.current.count = 0, rr.current.warned = !1;
3595
- return { frozenColumns: a, frozenWidth: M };
3595
+ return { frozenColumns: o, frozenWidth: M };
3596
3596
  }, [re, j, qe, Ve, Zt]);
3597
3597
  Ke.current = It, Qe(() => {
3598
3598
  re > 0 ? Ye.current?.style.setProperty("--aqvs-grid-frozen-width", `${It}px`) : Ye.current?.style.removeProperty("--aqvs-grid-frozen-width");
3599
3599
  }, [It, re]);
3600
- const Ct = d({ count: 0, warned: !1 }), { trailingColumns: _t, trailingWidth: mt } = Se(() => {
3600
+ const Ct = d({ count: 0, warned: !1 }), { trailingColumns: _t, trailingWidth: mt } = Me(() => {
3601
3601
  if (ge === 0)
3602
3602
  return Ct.current.count = 0, Ct.current.warned = !1, { trailingColumns: mn, trailingWidth: 0 };
3603
- const { columns: a, widthUpdates: b, width: M } = gi(e, ge, qe, Ve);
3604
- if (b.length > 0) {
3603
+ const { columns: o, widthUpdates: g, width: M } = gi(e, ge, qe, Ve);
3604
+ if (g.length > 0) {
3605
3605
  const X = Ct.current;
3606
3606
  X.count >= Or ? X.warned || (X.warned = !0, V.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values inside the trailing band; width self-heal is suspended until a converged pass re-arms it (unstable accessor).", {
3607
3607
  trailingCols: ge,
3608
- pendingUpdates: b.length
3609
- })) : (X.count += 1, qt.current = [...qt.current ?? [], ...b], Promise.resolve().then(Zt));
3608
+ pendingUpdates: g.length
3609
+ })) : (X.count += 1, qt.current = [...qt.current ?? [], ...g], Promise.resolve().then(Zt));
3610
3610
  } else
3611
3611
  Ct.current.count = 0, Ct.current.warned = !1;
3612
- return { trailingColumns: a, trailingWidth: M };
3612
+ return { trailingColumns: o, trailingWidth: M };
3613
3613
  }, [ge, e, j, qe, Ve, Zt]);
3614
3614
  D.current = mt, Qe(() => {
3615
3615
  ge > 0 ? Ye.current?.style.setProperty("--aqvs-grid-trailing-width", `${mt}px`) : Ye.current?.style.removeProperty("--aqvs-grid-trailing-width");
3616
3616
  }, [mt, ge]);
3617
- const Er = Se(() => ({ ...ce, tapScrollCircleOptions: { ...ce?.tapScrollCircleOptions, enabled: !1 } }), [ce]), $t = ce?.tapScrollCircleOptions, c = typeof $t?.maxSpeedMultiplier == "number", x = Se(
3617
+ const Er = Me(() => ({ ...ce, tapScrollCircleOptions: { ...ce?.tapScrollCircleOptions, enabled: !1 } }), [ce]), $t = ce?.tapScrollCircleOptions, c = typeof $t?.maxSpeedMultiplier == "number", b = Me(
3618
3618
  () => ({
3619
3619
  ...$t,
3620
3620
  offsetX: $t?.offsetX === void 0 ? sn : $t.offsetX,
3621
3621
  offsetY: $t?.offsetY === void 0 ? sn : $t.offsetY
3622
3622
  }),
3623
3623
  [$t]
3624
- ), m = Se(() => Fr(x, Math.max(0, e - re - ge)), [x, e, re, ge]), W = Se(() => Fr(x, y), [x, y]), U = m.enabled, G = Math.max(m.maxVisualDistance, 1), J = {
3624
+ ), m = Me(() => Fr(b, Math.max(0, e - re - ge)), [b, e, re, ge]), W = Me(() => Fr(b, y), [b, y]), U = m.enabled, G = Math.max(m.maxVisualDistance, 1), J = {
3625
3625
  viewportSize: Math.max(0, Ne.width - It - mt),
3626
3626
  minSpeedMultiplier: m.minSpeedMultiplier,
3627
3627
  maxSpeedMultiplier: m.maxSpeedMultiplier,
3628
3628
  hasCustomMaxSpeedMultiplier: c,
3629
3629
  curve: m.maxSpeedCurve
3630
- }, we = {
3630
+ }, Se = {
3631
3631
  viewportSize: Math.max(0, Ne.height - H - xe),
3632
3632
  minSpeedMultiplier: W.minSpeedMultiplier,
3633
3633
  maxSpeedMultiplier: W.maxSpeedMultiplier,
3634
3634
  hasCustomMaxSpeedMultiplier: c,
3635
3635
  curve: W.maxSpeedCurve
3636
- }, Ue = w(() => pe.current, []), Le = w(() => Re.current, []), ze = w(() => {
3637
- const a = ue.current;
3638
- return a === null ? 0 : Math.max(0, Math.max(0, a.getContentSize()) - Math.max(0, a.getViewportSize()));
3639
- }, []), pt = w((a) => {
3640
- const b = ue.current;
3641
- if (b === null)
3642
- return Re.current;
3643
- const M = b.scrollBy(a);
3644
- return Re.current = M, M;
3636
+ }, Ue = w(() => pe.current, []), Le = w(() => {
3637
+ const o = ue.current;
3638
+ if (o === null)
3639
+ return we.current;
3640
+ const g = o.getScrollPosition();
3641
+ return g < 0 ? we.current : g;
3642
+ }, []), ze = w(() => {
3643
+ const o = ue.current;
3644
+ return o === null ? 0 : Math.max(0, Math.max(0, o.getContentSize()) - Math.max(0, o.getViewportSize()));
3645
+ }, []), pt = w((o) => {
3646
+ const g = ue.current;
3647
+ if (g === null)
3648
+ return we.current;
3649
+ const M = g.scrollBy(o);
3650
+ return we.current = M, M;
3645
3651
  }, []), ot = kt() > 0 || ze() > 0, gt = `${$e}:${It}:${mt}:${Ne.width}:${p.key}`, nr = `${t}:${Dt ?? -1}:${H}:${xe}:${Ne.height}`, { isTapActive: or, handleTapCircleDragChange: Mn, tapCircleHandleRef: In } = ii({
3646
3652
  enabled: U && ot,
3647
3653
  maxDistance: G,
3648
3654
  xSpeedParams: J,
3649
- ySpeedParams: we,
3655
+ ySpeedParams: Se,
3650
3656
  applyHxRef: Mt,
3651
3657
  getHx: Ue,
3652
3658
  getMaxHx: kt,
@@ -3656,54 +3662,54 @@ const ni = 1e4, yi = () => {
3656
3662
  pendingColAnchorRef: Nt,
3657
3663
  xExtentFreshness: gt,
3658
3664
  yExtentFreshness: nr
3659
- }), yn = Se(() => oe((or ? 1 : 0.8) * m.opacity, 0, 1), [or, m.opacity]);
3665
+ }), yn = Me(() => oe((or ? 1 : 0.8) * m.opacity, 0, 1), [or, m.opacity]);
3660
3666
  Qe(() => {
3661
- const a = Nt.current;
3662
- a === null ? Mt.current(pe.current) : Mt.current(Xt(a)), st();
3667
+ const o = Nt.current;
3668
+ o === null ? Mt.current(pe.current) : Mt.current(Xt(o)), st();
3663
3669
  }, [Ne.width, $e, j, It, mt, st, Xt]);
3664
3670
  const $r = d(!1);
3665
3671
  Qe(() => {
3666
3672
  if ($r.current || z === void 0 || e === 0)
3667
3673
  return;
3668
3674
  $r.current = !0;
3669
- const a = oe(Math.trunc(z.col), 0, e - 1);
3670
- if (a < re || a >= e - ge)
3675
+ const o = oe(Math.trunc(z.col), 0, e - 1);
3676
+ if (o < re || o >= e - ge)
3671
3677
  return;
3672
- const b = { col: a, alignX: "start", offsetX: Math.max(0, z.offsetX) };
3673
- Nt.current = b, Mt.current(Xt(b));
3678
+ const g = { col: o, alignX: "start", offsetX: Math.max(0, z.offsetX) };
3679
+ Nt.current = g, Mt.current(Xt(g));
3674
3680
  }, [z, e, Xt, re, ge]);
3675
- const Tn = w((a) => {
3676
- Re.current = a, wt.current = !0, Ce.current?.({ x: pe.current, y: a });
3681
+ const Tn = w((o) => {
3682
+ we.current = o, wt.current = !0, Ce.current?.({ x: pe.current, y: o });
3677
3683
  }, []), Yr = w(
3678
- (a) => {
3684
+ (o) => {
3679
3685
  if (y === 0 || vt.current)
3680
- He.current = { renderingStartIndex: t, renderingEndIndex: t - 1, visibleStartIndex: t, visibleEndIndex: t - 1, scrollPosition: 0, totalHeight: y === 0 ? 0 : a.totalHeight }, Re.current = 0;
3686
+ He.current = { renderingStartIndex: t, renderingEndIndex: t - 1, visibleStartIndex: t, visibleEndIndex: t - 1, scrollPosition: 0, totalHeight: y === 0 ? 0 : o.totalHeight }, we.current = 0;
3681
3687
  else {
3682
- const b = Z;
3688
+ const g = Z;
3683
3689
  He.current = {
3684
- renderingStartIndex: a.renderingStartIndex + b,
3685
- renderingEndIndex: a.renderingEndIndex + b,
3686
- visibleStartIndex: a.visibleStartIndex + b,
3687
- visibleEndIndex: a.visibleEndIndex + b,
3688
- scrollPosition: a.scrollPosition,
3689
- totalHeight: a.totalHeight
3690
- }, Re.current = a.scrollPosition;
3690
+ renderingStartIndex: o.renderingStartIndex + g,
3691
+ renderingEndIndex: o.renderingEndIndex + g,
3692
+ visibleStartIndex: o.visibleStartIndex + g,
3693
+ visibleEndIndex: o.visibleEndIndex + g,
3694
+ scrollPosition: o.scrollPosition,
3695
+ totalHeight: o.totalHeight
3696
+ }, we.current = o.scrollPosition;
3691
3697
  }
3692
- bt((b) => {
3693
- const M = Math.max(1, a.renderingEndIndex - a.renderingStartIndex + 1);
3694
- return M === b ? b : M;
3698
+ bt((g) => {
3699
+ const M = Math.max(1, o.renderingEndIndex - o.renderingStartIndex + 1);
3700
+ return M === g ? g : M;
3695
3701
  }), jt();
3696
3702
  },
3697
3703
  [jt, Z, y, t]
3698
- ), Wr = w((a) => {
3699
- Nt.current = null, Mt.current(pe.current + a);
3700
- }, []), Br = di(Y, sr + h.length + he.length), zr = d({ count: 0, warned: !1 }), { placedColumns: xr, truncatedCols: br } = Se(() => {
3701
- const a = Math.max(0, Ne.width - It - mt);
3702
- if (e === 0 || a <= 0)
3704
+ ), Wr = w((o) => {
3705
+ Nt.current = null, Mt.current(pe.current + o);
3706
+ }, []), Br = di(Y, sr + h.length + he.length), zr = d({ count: 0, warned: !1 }), { placedColumns: xr, truncatedCols: br } = Me(() => {
3707
+ const o = Math.max(0, Ne.width - It - mt);
3708
+ if (e === 0 || o <= 0)
3703
3709
  return { placedColumns: [], truncatedCols: 0 };
3704
3710
  if (p.renderingColStart > p.renderingColEnd)
3705
3711
  return { placedColumns: [], truncatedCols: 0 };
3706
- const b = Math.max(1, Br - Qt.length - _t.length), { columns: M, widthUpdates: X, truncated: de } = mi(oe(p.renderingColStart, 0, e - 1), oe(p.renderingColEnd, 0, e - 1), qe, Ve, b);
3712
+ const g = Math.max(1, Br - Qt.length - _t.length), { columns: M, widthUpdates: X, truncated: de } = mi(oe(p.renderingColStart, 0, e - 1), oe(p.renderingColEnd, 0, e - 1), qe, Ve, g);
3707
3713
  if (X.length > 0) {
3708
3714
  const rt = zr.current;
3709
3715
  rt.count >= Or ? rt.warned || (rt.warned = !0, V.warn("[VirtualGrid] getColWidth keeps disagreeing with its own previous values; width self-heal is suspended until a converged (zero-deviation) pass re-arms it (unstable accessor — the accessor must be index-stable while the ordering is unchanged).", {
@@ -3716,44 +3722,44 @@ const ni = 1e4, yi = () => {
3716
3722
  }, [p, e, Ne.width, It, mt, Qt.length, _t.length, j, qe, Ve, Br, Zt]), Ur = d("");
3717
3723
  q(() => {
3718
3724
  if (br > 0) {
3719
- const a = `${p.key}:${br}`;
3720
- a !== Ur.current && (Ur.current = a, St.current?.({ renderedCells: (xr.length + Qt.length + _t.length) * (sr + h.length + he.length), droppedCols: br }));
3725
+ const o = `${p.key}:${br}`;
3726
+ o !== Ur.current && (Ur.current = o, St.current?.({ renderedCells: (xr.length + Qt.length + _t.length) * (sr + h.length + he.length), droppedCols: br }));
3721
3727
  }
3722
3728
  }, [br, p.key, xr.length, Qt.length, _t.length, sr, h.length, he.length]);
3723
3729
  const Gr = p.colAnchor, Nr = w(
3724
- (a) => {
3725
- const b = f?.(a), M = Pe(a) === 0, X = M ? null : xr.map(({ col: de, left: rt, width: cr }) => {
3726
- const Ft = l?.(a, de), dr = { ...Ft?.style, left: rt - Gr, width: cr };
3727
- return /* @__PURE__ */ Cr("div", { ...Ft, key: s ? s(a, de) : de, className: Et("aqvs-grid-cell", Ft?.className), style: dr }, o(i(a, de), a, de));
3730
+ (o) => {
3731
+ const g = f?.(o), M = Pe(o) === 0, X = M ? null : xr.map(({ col: de, left: rt, width: cr }) => {
3732
+ const Ft = l?.(o, de), dr = { ...Ft?.style, left: rt - Gr, width: cr };
3733
+ return /* @__PURE__ */ Cr("div", { ...Ft, key: s ? s(o, de) : de, className: Et("aqvs-grid-cell", Ft?.className), style: dr }, a(i(o, de), o, de));
3728
3734
  });
3729
- return re === 0 && ge === 0 ? /* @__PURE__ */ Q("div", { ...b, className: Et("aqvs-grid-row", b?.className), style: b?.style, children: X }) : /* @__PURE__ */ Wt("div", { ...b, "data-aqvs-frozen-row": re > 0 ? "" : void 0, className: Et("aqvs-grid-row aqvs-grid-row-frozen-host", b?.className), style: b?.style, children: [
3735
+ return re === 0 && ge === 0 ? /* @__PURE__ */ Q("div", { ...g, className: Et("aqvs-grid-row", g?.className), style: g?.style, children: X }) : /* @__PURE__ */ Wt("div", { ...g, "data-aqvs-frozen-row": re > 0 ? "" : void 0, className: Et("aqvs-grid-row aqvs-grid-row-frozen-host", g?.className), style: g?.style, children: [
3730
3736
  M ? null : Qt.map(({ col: de, left: rt, width: cr }) => {
3731
- const Ft = l?.(a, de), dr = { ...Ft?.style, left: rt, width: cr };
3732
- return /* @__PURE__ */ Cr("div", { ...Ft, "data-aqvs-frozen-cell": "", key: s ? s(a, de) : de, className: Et("aqvs-grid-cell", Ft?.className), style: dr }, o(i(a, de), a, de));
3737
+ const Ft = l?.(o, de), dr = { ...Ft?.style, left: rt, width: cr };
3738
+ return /* @__PURE__ */ Cr("div", { ...Ft, "data-aqvs-frozen-cell": "", key: s ? s(o, de) : de, className: Et("aqvs-grid-cell", Ft?.className), style: dr }, a(i(o, de), o, de));
3733
3739
  }),
3734
3740
  M ? null : /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-scroll", children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-scroll-inner", children: X }) }),
3735
3741
  M || ge === 0 ? null : /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-row-trailing-inner", children: _t.map(({ col: de, left: rt, width: cr }) => {
3736
- const Ft = l?.(a, de), dr = { ...Ft?.style, left: rt, width: cr };
3737
- return /* @__PURE__ */ Cr("div", { ...Ft, "data-aqvs-trailing-cell": "", key: s ? s(a, de) : de, className: Et("aqvs-grid-cell", Ft?.className), style: dr }, o(i(a, de), a, de));
3742
+ const Ft = l?.(o, de), dr = { ...Ft?.style, left: rt, width: cr };
3743
+ return /* @__PURE__ */ Cr("div", { ...Ft, "data-aqvs-trailing-cell": "", key: s ? s(o, de) : de, className: Et("aqvs-grid-cell", Ft?.className), style: dr }, a(i(o, de), o, de));
3738
3744
  }) }) })
3739
3745
  ] });
3740
3746
  },
3741
- [xr, Qt, _t, re, ge, Gr, f, l, s, i, o, Pe]
3747
+ [xr, Qt, _t, re, ge, Gr, f, l, s, i, a, Pe]
3742
3748
  ), [Rn, Pn] = Oe(""), ar = d(null), Kr = d(k);
3743
3749
  Kr.current = k;
3744
3750
  const vr = w(() => {
3745
- const a = Kr.current;
3746
- if (a === void 0)
3751
+ const o = Kr.current;
3752
+ if (o === void 0)
3747
3753
  return;
3748
- const b = a.debounceMs ?? 400;
3749
- Number.isFinite(b) && b >= 0 && (ar.current !== null && window.clearTimeout(ar.current), ar.current = window.setTimeout(() => {
3754
+ const g = o.debounceMs ?? 400;
3755
+ Number.isFinite(g) && g >= 0 && (ar.current !== null && window.clearTimeout(ar.current), ar.current = window.setTimeout(() => {
3750
3756
  ar.current = null;
3751
3757
  const M = Kt();
3752
3758
  M !== null && Pn((X) => {
3753
- const de = a.buildMessage(M);
3759
+ const de = o.buildMessage(M);
3754
3760
  return de === X ? X : de;
3755
3761
  });
3756
- }, b));
3762
+ }, g));
3757
3763
  }, [Kt]), wr = k?.debounceMs ?? 400, jr = Number.isFinite(wr) && wr >= 0, Zr = k !== void 0;
3758
3764
  q(() => {
3759
3765
  Zr && !jr && V.warn(`[VirtualGrid] liveRegion.debounceMs must be a finite number >= 0, received ${wr}. Announcements are disabled.`);
@@ -3766,67 +3772,67 @@ const ni = 1e4, yi = () => {
3766
3772
  vr();
3767
3773
  }, [p, vr]);
3768
3774
  const En = w(
3769
- (a) => {
3770
- Yr(a), vr();
3775
+ (o) => {
3776
+ Yr(o), vr();
3771
3777
  },
3772
3778
  [Yr, vr]
3773
3779
  );
3774
3780
  return Pr(
3775
3781
  le,
3776
3782
  () => ({
3777
- scrollTo: (a) => {
3778
- const b = ue.current;
3779
- let M = Re.current;
3780
- a.y !== void 0 && b !== null && (b.scrollTo(a.y), M = b.getScrollPosition(), Re.current = M);
3783
+ scrollTo: (o) => {
3784
+ const g = ue.current;
3785
+ let M = we.current;
3786
+ o.y !== void 0 && g !== null && (g.scrollTo(o.y), M = g.getScrollPosition(), we.current = M);
3781
3787
  let X = pe.current;
3782
- return a.x !== void 0 && (Nt.current = null, X = Mt.current(a.x)), { x: X, y: M };
3788
+ return o.x !== void 0 && (Nt.current = null, X = Mt.current(o.x)), { x: X, y: M };
3783
3789
  },
3784
- scrollBy: (a) => {
3785
- const b = ue.current;
3786
- let M = Re.current;
3787
- a.y !== void 0 && a.y !== 0 && b !== null && (M = b.scrollBy(a.y), Re.current = M);
3790
+ scrollBy: (o) => {
3791
+ const g = ue.current;
3792
+ let M = we.current;
3793
+ o.y !== void 0 && o.y !== 0 && g !== null && (M = g.scrollBy(o.y), we.current = M);
3788
3794
  let X = pe.current;
3789
- return a.x !== void 0 && a.x !== 0 && (Nt.current = null, X = Mt.current(pe.current + a.x)), { x: X, y: M };
3795
+ return o.x !== void 0 && o.x !== 0 && (Nt.current = null, X = Mt.current(pe.current + o.x)), { x: X, y: M };
3790
3796
  },
3791
- scrollToCell: (a, b, M) => {
3797
+ scrollToCell: (o, g, M) => {
3792
3798
  const X = ue.current;
3793
3799
  if (X !== null && t > 0) {
3794
- const de = oe(Math.trunc(a), 0, t - 1);
3800
+ const de = oe(Math.trunc(o), 0, t - 1);
3795
3801
  de >= Z && de < t - We && X.scrollToIndex(de - Z, { align: M?.alignY ?? "top", offset: M?.offsetY });
3796
3802
  }
3797
3803
  if (e > 0) {
3798
- const de = oe(Math.trunc(b), 0, e - 1);
3804
+ const de = oe(Math.trunc(g), 0, e - 1);
3799
3805
  if (de >= re && de < e - ge) {
3800
3806
  const rt = { col: de, alignX: M?.alignX ?? "start", offsetX: M?.offsetX ?? 0 };
3801
3807
  Nt.current = rt, Mt.current(Xt(rt));
3802
3808
  }
3803
3809
  }
3804
3810
  },
3805
- getScrollPosition: () => wt.current || ue.current !== null ? { x: pe.current, y: ue.current?.getScrollPosition() ?? Re.current } : { x: -1, y: -1 },
3811
+ getScrollPosition: () => wt.current || ue.current !== null ? { x: pe.current, y: ue.current?.getScrollPosition() ?? we.current } : { x: -1, y: -1 },
3806
3812
  getScrollAnchor: () => {
3807
3813
  if (t === 0 || e === 0)
3808
3814
  return null;
3809
- const a = ue.current?.getScrollAnchor() ?? null;
3810
- if (a === null)
3815
+ const o = ue.current?.getScrollAnchor() ?? null;
3816
+ if (o === null)
3811
3817
  return null;
3812
- const b = Ke.current + pe.current, M = Ve.findIndexAtOrAfter(b, { materializeOption: { materialize: !1 } });
3818
+ const g = Ke.current + pe.current, M = Ve.findIndexAtOrAfter(g, { materializeOption: { materialize: !1 } });
3813
3819
  if (M.index === -1)
3814
- return { row: a.index + Z, col: e - 1, offsetX: 0, offsetY: a.offsetPx };
3815
- if (M.cumulative === b)
3816
- return { row: a.index + Z, col: oe(M.index + 1, 0, e - 1), offsetX: 0, offsetY: a.offsetPx };
3820
+ return { row: o.index + Z, col: e - 1, offsetX: 0, offsetY: o.offsetPx };
3821
+ if (M.cumulative === g)
3822
+ return { row: o.index + Z, col: oe(M.index + 1, 0, e - 1), offsetX: 0, offsetY: o.offsetPx };
3817
3823
  const X = (M.cumulative ?? 0) - (M.currentValue ?? 0);
3818
- return { row: a.index + Z, col: M.index, offsetX: Math.max(0, b - X), offsetY: a.offsetPx };
3824
+ return { row: o.index + Z, col: M.index, offsetX: Math.max(0, g - X), offsetY: o.offsetPx };
3819
3825
  },
3820
3826
  getViewportSize: () => ({ width: zt.current.width, height: zt.current.height }),
3821
3827
  // 縦はインセット込みの行側 getContentSize を単一情報源にする (range.totalHeight は木総高のみ)。
3822
3828
  // 3.5.0: height = H_F + 埋め込み + H_T
3823
3829
  getContentSize: () => ({ width: Fe.current, height: ue.current === null ? 0 : et.current + xt.current + Math.max(0, ue.current.getContentSize()) }),
3824
3830
  getRange: Kt,
3825
- updateRowSize: (a, b) => {
3826
- Ir(b, "row", a), Math.trunc(a) < Z ? Tt((M) => M + 1) : We > 0 && Math.trunc(a) >= t - We ? ne((M) => M + 1) : ue.current?.updateItemSize(Math.trunc(a) - Z, b);
3831
+ updateRowSize: (o, g) => {
3832
+ Ir(g, "row", o), Math.trunc(o) < Z ? Tt((M) => M + 1) : We > 0 && Math.trunc(o) >= t - We ? ne((M) => M + 1) : ue.current?.updateItemSize(Math.trunc(o) - Z, g);
3827
3833
  },
3828
- updateColSize: (a, b) => {
3829
- Ir(b, "col", a), ht(Ve.update(oe(Math.trunc(a), 0, Math.max(0, e - 1)), b)), Je((M) => M + 1);
3834
+ updateColSize: (o, g) => {
3835
+ Ir(g, "col", o), ht(Ve.update(oe(Math.trunc(o), 0, Math.max(0, e - 1)), g)), Je((M) => M + 1);
3830
3836
  },
3831
3837
  getFrozenSize: () => ({
3832
3838
  cols: re,
@@ -3841,26 +3847,26 @@ const ni = 1e4, yi = () => {
3841
3847
  trailingVisibleWidth: yr(D.current, Ke.current, zt.current.width),
3842
3848
  trailingVisibleHeight: yr(xt.current, et.current, zt.current.height)
3843
3849
  }),
3844
- applyWheel: (a) => ue.current?.applyWheel(a) ?? !1,
3845
- focusRowAtIndex: (a, b) => {
3846
- const M = Math.trunc(a);
3847
- M < Z ? Ye.current?.querySelector(`[data-aqvs-frozen-band-row="${M}"]`)?.focus() : We > 0 && M >= t - We ? Ye.current?.querySelector(`[data-aqvs-trailing-band-row="${M}"]`)?.focus() : ue.current?.focusItemAtIndex(M - Z, b);
3850
+ applyWheel: (o) => ue.current?.applyWheel(o) ?? !1,
3851
+ focusRowAtIndex: (o, g) => {
3852
+ const M = Math.trunc(o);
3853
+ M < Z ? Ye.current?.querySelector(`[data-aqvs-frozen-band-row="${M}"]`)?.focus() : We > 0 && M >= t - We ? Ye.current?.querySelector(`[data-aqvs-trailing-band-row="${M}"]`)?.focus() : ue.current?.focusItemAtIndex(M - Z, g);
3848
3854
  }
3849
3855
  }),
3850
3856
  [t, e, Ve, Kt, ht, Xt, re, Z, ge, We]
3851
- ), /* @__PURE__ */ Wt("div", { ref: Ye, className: Et("aqvs-grid", Z > 0 ? "aqvs-grid-has-frozen-rows" : "", We > 0 ? "aqvs-grid-has-trailing-rows" : "", ye), "data-testid": I, children: [
3857
+ ), /* @__PURE__ */ Wt("div", { ref: Ye, className: Et("aqvs-grid", Z > 0 ? "aqvs-grid-has-frozen-rows" : "", We > 0 ? "aqvs-grid-has-trailing-rows" : "", Te), "data-testid": I, children: [
3852
3858
  Z > 0 ? (
3853
3859
  // 凍結行帯 (行凍結設計 §4-2): グリッド所有の帯外バンド — 行本体は renderRow を
3854
3860
  // そのまま再利用する (F > 0 の凍結セル / クリップ / hx 残差 var は継承で無償追随
3855
3861
  // = 4 象限コーナーの成立点)。top は木絶対プレフィックス、高さ 0 行は DOM 非生成
3856
- /* @__PURE__ */ Q("div", { className: "aqvs-grid-frozen-rows", style: { height: H }, "data-testid": I ? `${I}-frozen-rows` : void 0, children: h.map(({ row: a, top: b, height: M }) => (
3862
+ /* @__PURE__ */ Q("div", { className: "aqvs-grid-frozen-rows", style: { height: H }, "data-testid": I ? `${I}-frozen-rows` : void 0, children: h.map(({ row: o, top: g, height: M }) => (
3857
3863
  // 行ラッパーの role は消費側の複合ウィジェット契約 (listbox / tree / grid — README
3858
3864
  // 「Composite widget roles」) の所有物で、パッケージが既定 role を課すと衝突する。
3859
3865
  // フォーカス結線は focusRowAtIndex ↔ onRowFocus 往復のバンド版そのもの。右インセット
3860
3866
  // (right: scrollBarWidth + overflow クリップ) は縦バーコーナーの予約 — ペインの
3861
3867
  // クリップ箱 (root − バー幅) と帯のクリップ箱を一致させる (R1 是正)。
3862
3868
  // biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (上記)
3863
- /* @__PURE__ */ Q("div", { "data-aqvs-frozen-band-row": a, className: "aqvs-grid-frozen-band-row", style: { top: b, height: M, right: ke }, tabIndex: -1, onFocus: () => T?.(a), children: Nr(a) }, a)
3869
+ /* @__PURE__ */ Q("div", { "data-aqvs-frozen-band-row": o, className: "aqvs-grid-frozen-band-row", style: { top: g, height: M, right: ke }, tabIndex: -1, onFocus: () => T?.(o), children: Nr(o) }, o)
3864
3870
  )) })
3865
3871
  ) : null,
3866
3872
  /* @__PURE__ */ Q("div", { className: "aqvs-grid-main", "data-testid": I ? `${I}-main` : void 0, children: /* @__PURE__ */ Q(
@@ -3868,20 +3874,20 @@ const ni = 1e4, yi = () => {
3868
3874
  {
3869
3875
  ref: ue,
3870
3876
  itemCount: tr ? 0 : y,
3871
- getItem: (a) => a + Z,
3872
- getItemKey: (a) => a + Z,
3877
+ getItem: (o) => o + Z,
3878
+ getItemKey: (o) => o + Z,
3873
3879
  getItemHeight: ve,
3874
3880
  overscanCount: C,
3875
3881
  viewportSize: Ne.height > 0 ? Math.max(0, Ne.height - H - xe) : void 0,
3876
3882
  callbackThrottleMs: L,
3877
3883
  behaviorOptions: ae,
3878
3884
  scrollBarOptions: Er,
3879
- contentProps: g,
3885
+ contentProps: x,
3880
3886
  background: v,
3881
3887
  contentInsets: R,
3882
3888
  onItemFocus: me,
3883
- horizontalKeyInputs: Me,
3884
- horizontalKeyStep: Ie,
3889
+ horizontalKeyInputs: Ie,
3890
+ horizontalKeyStep: ye,
3885
3891
  initialScrollAnchor: (
3886
3892
  // トグル済みなら視点保存 (捕捉アンカー) のみ — 捕捉 null は undefined (先頭)
3887
3893
  // へ落とし、消費済みマウント props の蘇りを断つ (R2 是正)。未トグルのみ
@@ -3904,11 +3910,11 @@ const ni = 1e4, yi = () => {
3904
3910
  // inner はインライン木高 H_T の bottom 定着 — 帯上端 = extent − H_T_vis が全構成で
3905
3911
  // 成立し、重複縮退では帯の**末尾**行が可視に残る。行本体は renderRow 逐語再利用
3906
3912
  // (先頭列 / 末尾列の帯構造を継承し 4 象限コーナー全種が無償で成立)
3907
- /* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows", style: { height: yr(xe, H, Ne.height) }, "data-testid": I ? `${I}-trailing-rows` : void 0, children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: xe }, children: he.map(({ row: a, top: b, height: M }) => (
3913
+ /* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows", style: { height: yr(xe, H, Ne.height) }, "data-testid": I ? `${I}-trailing-rows` : void 0, children: /* @__PURE__ */ Q("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: xe }, children: he.map(({ row: o, top: g, height: M }) => (
3908
3914
  // 帯行は帯ローカル top + right: scrollBarWidth (縦バーコーナーの予約 — 先頭帯行と
3909
3915
  // 同文) + tabIndex −1 + onFocus フル行 index (focusRowAtIndex ↔ onRowFocus 往復)。
3910
3916
  // biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (先頭帯行と同文)
3911
- /* @__PURE__ */ Q("div", { "data-aqvs-trailing-band-row": a, className: "aqvs-grid-trailing-band-row", style: { top: b, height: M, right: ke }, tabIndex: -1, onFocus: () => T?.(a), children: Nr(a) }, a)
3917
+ /* @__PURE__ */ Q("div", { "data-aqvs-trailing-band-row": o, className: "aqvs-grid-trailing-band-row", style: { top: g, height: M, right: ke }, tabIndex: -1, onFocus: () => T?.(o), children: Nr(o) }, o)
3912
3918
  )) }) })
3913
3919
  ) : null,
3914
3920
  /* @__PURE__ */ Q("div", { className: "aqvs-grid-hbar-strip", style: { height: ke, paddingRight: ge > 0 ? ke + yr(mt, It, Ne.width) : ke }, "data-testid": I ? `${I}-hbar` : void 0, children: /* @__PURE__ */ Q(
@@ -3920,7 +3926,7 @@ const ni = 1e4, yi = () => {
3920
3926
  scrollPosition: u,
3921
3927
  itemCount: Math.max(0, e - re - ge),
3922
3928
  tapScrollCircleOptions: ce?.tapScrollCircleOptions,
3923
- onScroll: (a, b) => (Nt.current = null, Mt.current(typeof a == "function" ? a(b ?? pe.current) : a)),
3929
+ onScroll: (o, g) => (Nt.current = null, Mt.current(typeof o == "function" ? o(g ?? pe.current) : o)),
3924
3930
  scrollBarWidth: ke
3925
3931
  }
3926
3932
  ) }),