@aiquants/virtualscroll 3.7.0 → 3.7.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,7 +1,7 @@
1
- import { jsx as U, jsxs as qt, Fragment as Wr } from "react/jsx-runtime";
2
- import Ln, { memo as On, forwardRef as Cr, useState as ke, useRef as d, useCallback as w, useImperativeHandle as Nr, useMemo as Me, useLayoutEffect as Je, useEffect as X, useId as _n, createElement as Dr } from "react";
3
- import { twMerge as Ct } from "tailwind-merge";
4
- const wn = ["en", "ja"], Hr = ["scrollUp", "scrollDown", "scrollLeft", "scrollRight", "scrollToTop", "scrollToBottom", "noItems"], Fn = Object.freeze({
1
+ import { jsx as U, jsxs as qt, Fragment as Gr } from "react/jsx-runtime";
2
+ import kn, { memo as Hn, forwardRef as Cr, useState as _e, useRef as d, useCallback as w, useImperativeHandle as Ar, useMemo as Me, useLayoutEffect as Je, useEffect as X, useId as $n, createElement as Or } from "react";
3
+ import { twMerge as Nt } from "tailwind-merge";
4
+ const Mn = ["en", "ja"], Xr = ["scrollUp", "scrollDown", "scrollLeft", "scrollRight", "scrollToTop", "scrollToBottom", "noItems"], Xn = Object.freeze({
5
5
  en: Object.freeze({
6
6
  scrollUp: "Scroll up",
7
7
  scrollDown: "Scroll down",
@@ -20,33 +20,33 @@ const wn = ["en", "ja"], Hr = ["scrollUp", "scrollDown", "scrollLeft", "scrollRi
20
20
  scrollToBottom: "末尾へ",
21
21
  noItems: "項目がありません"
22
22
  })
23
- }), kn = (t) => wn.includes(t), $r = (t) => typeof t == "string" ? JSON.stringify(t) : t === null ? "null" : typeof t, Hn = (t) => {
23
+ }), qn = (t) => Mn.includes(t), qr = (t) => typeof t == "string" ? JSON.stringify(t) : t === null ? "null" : typeof t, Yn = (t) => {
24
24
  if (t === void 0)
25
25
  return "en";
26
- if (kn(t))
26
+ if (qn(t))
27
27
  return t;
28
- const e = wn.map((r) => JSON.stringify(r)).join(", ");
29
- throw new RangeError(`[virtualscroll] locale must be one of ${e}; got ${$r(t)}`);
30
- }, $n = (t) => Hr.includes(t), Sn = (t, e) => {
31
- const r = Fn[Hn(t)];
28
+ const e = Mn.map((r) => JSON.stringify(r)).join(", ");
29
+ throw new RangeError(`[virtualscroll] locale must be one of ${e}; got ${qr(t)}`);
30
+ }, Bn = (t) => Xr.includes(t), In = (t, e) => {
31
+ const r = Xn[Yn(t)];
32
32
  if (e === void 0)
33
33
  return r;
34
34
  if (e === null || typeof e != "object")
35
- throw new RangeError(`[virtualscroll] labels must be an object; got ${$r(e)}`);
35
+ throw new RangeError(`[virtualscroll] labels must be an object; got ${qr(e)}`);
36
36
  const n = Object.getPrototypeOf(e);
37
37
  if (n !== Object.prototype && n !== null)
38
38
  throw new RangeError(`[virtualscroll] labels must be a plain object (prototype Object.prototype or null); got ${Array.isArray(e) ? "an array" : "an object with a non-plain prototype"}`);
39
39
  const i = new Set(Object.keys(e));
40
40
  for (const o of i)
41
- if (!$n(o))
42
- throw new RangeError(`[virtualscroll] labels.${o} is not a known label key; expected one of ${Hr.join(", ")}`);
41
+ if (!Bn(o))
42
+ throw new RangeError(`[virtualscroll] labels.${o} is not a known label key; expected one of ${Xr.join(", ")}`);
43
43
  const s = { ...r };
44
- for (const o of Hr) {
45
- const c = i.has(o) ? e[o] : void 0;
46
- if (c !== void 0) {
47
- if (typeof c != "string" || c.trim() === "")
48
- throw new RangeError(`[virtualscroll] labels.${o} must be a non-blank string; got ${$r(c)}`);
49
- s[o] = c;
44
+ for (const o of Xr) {
45
+ const l = i.has(o) ? e[o] : void 0;
46
+ if (l !== void 0) {
47
+ if (typeof l != "string" || l.trim() === "")
48
+ throw new RangeError(`[virtualscroll] labels.${o} must be a non-blank string; got ${qr(l)}`);
49
+ s[o] = l;
50
50
  }
51
51
  }
52
52
  return Object.freeze(s);
@@ -196,16 +196,26 @@ class A {
196
196
  this.level <= 3 && this.impl.error(...this.formatMessage(A.resolveLazy(e)), ...r.map(A.resolveLazy));
197
197
  }
198
198
  }
199
- const nn = {
199
+ const yn = (t) => typeof t.setPointerCapture == "function" && typeof t.releasePointerCapture == "function" && typeof t.hasPointerCapture == "function", Tn = (t, e) => yn(t) && t.hasPointerCapture(e), wr = (t, e) => {
200
+ if (!yn(t))
201
+ return "unsupported";
202
+ try {
203
+ return t.setPointerCapture(e), "captured";
204
+ } catch (r) {
205
+ return (typeof r == "object" && r !== null && "name" in r ? r.name : void 0) === "NotFoundError" ? "inactive-pointer" : "rejected";
206
+ }
207
+ }, sr = (t, e) => {
208
+ Tn(t, e) && t.releasePointerCapture(e);
209
+ }, on = {
200
210
  active: !1,
201
211
  offsetX: 0,
202
212
  offsetY: 0,
203
213
  distance: 0,
204
214
  direction: 0,
205
215
  pointerId: null
206
- }, Tr = 6, Xn = 8, qn = ({ dragState: t, normalizedDistance: e }) => {
216
+ }, Pr = 6, Wn = 8, Un = ({ dragState: t, normalizedDistance: e }) => {
207
217
  const r = 1 + e * 0.18, n = 0.16 + e * 0.24, i = 0.38 + e * 0.28, s = t.active ? "80ms ease-out" : "220ms ease";
208
- return /* @__PURE__ */ qt(Wr, { children: [
218
+ return /* @__PURE__ */ qt(Gr, { children: [
209
219
  /* @__PURE__ */ U(
210
220
  "div",
211
221
  {
@@ -231,44 +241,44 @@ const nn = {
231
241
  }
232
242
  )
233
243
  ] });
234
- }, Ur = On(
235
- Cr(({ onDragChange: t, className: e, maxVisualDistance: r = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: o, axis: c = "y" }, f) => {
236
- const [g, b] = ke(nn), R = d(null), T = d(null), S = d({ x: 0, y: 0 }), C = d(null), Z = d(0), F = w(
244
+ }, jr = Hn(
245
+ Cr(({ onDragChange: t, className: e, maxVisualDistance: r = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: o, axis: l = "y" }, f) => {
246
+ const [g, x] = _e(on), R = d(null), T = d(null), S = d({ x: 0, y: 0 }), N = d(null), j = d(0), F = w(
237
247
  (y) => {
238
- b(y), t(y);
248
+ x(y), t(y);
239
249
  },
240
250
  [t]
241
251
  ), Te = w(
242
- (y, se, ne = !1) => {
243
- const { x: Le, y: te } = S.current, Ye = y - Le, xe = se - te;
244
- let ie, Qe;
245
- if (c === "xy")
246
- ie = Math.hypot(Ye, xe), Qe = ie < Tr ? 0 : 1;
252
+ (y, re, ne = !1) => {
253
+ const { x: Xe, y: de } = S.current, Ue = y - Xe, xe = re - de;
254
+ let te, Qe;
255
+ if (l === "xy")
256
+ te = Math.hypot(Ue, xe), Qe = te < Pr ? 0 : 1;
247
257
  else {
248
- const qe = c === "x" ? Ye : xe;
249
- ie = Math.abs(qe), Qe = ie < Tr ? 0 : qe < 0 ? -1 : 1;
258
+ const qe = l === "x" ? Ue : xe;
259
+ te = Math.abs(qe), Qe = te < Pr ? 0 : qe < 0 ? -1 : 1;
250
260
  }
251
- const at = Z.current;
261
+ const at = j.current;
252
262
  let et = Qe;
253
- const wt = Tr + Xn;
254
- Qe === 0 ? at !== 0 && ie < wt ? et = at : (et = 0, ne || (Z.current = 0)) : Qe !== at && at !== 0 && ie < wt ? et = at : Z.current = Qe, F({
255
- active: ne || ie >= Tr,
256
- offsetX: Ye,
263
+ const wt = Pr + Wn;
264
+ Qe === 0 ? at !== 0 && te < wt ? et = at : (et = 0, ne || (j.current = 0)) : Qe !== at && at !== 0 && te < wt ? et = at : j.current = Qe, F({
265
+ active: ne || te >= Pr,
266
+ offsetX: Ue,
257
267
  offsetY: xe,
258
- distance: ie,
268
+ distance: te,
259
269
  direction: et,
260
270
  pointerId: R.current
261
271
  });
262
272
  },
263
- [F, c]
273
+ [F, l]
264
274
  ), ze = w((y) => {
265
275
  if (y === null)
266
276
  return;
267
- const se = C.current;
268
- se?.hasPointerCapture(y) && se.releasePointerCapture(y);
277
+ const re = N.current;
278
+ re !== null && sr(re, y);
269
279
  }, []), D = w(
270
280
  (y = !1) => {
271
- y && ze(R.current), R.current = null, T.current = null, Z.current = 0, F(nn);
281
+ y && ze(R.current), R.current = null, T.current = null, j.current = 0, F(on);
272
282
  },
273
283
  [F, ze]
274
284
  ), k = w(
@@ -278,13 +288,8 @@ const nn = {
278
288
  return;
279
289
  }
280
290
  y.preventDefault(), y.stopPropagation();
281
- const se = C.current ?? y.currentTarget, { left: ne, top: Le, width: te, height: Ye } = se.getBoundingClientRect();
282
- S.current = { x: ne + te / 2, y: Le + Ye / 2 }, R.current = y.pointerId;
283
- try {
284
- se.setPointerCapture(y.pointerId);
285
- } catch {
286
- }
287
- Te(y.clientX, y.clientY, !0);
291
+ const re = N.current ?? y.currentTarget, { left: ne, top: Xe, width: de, height: Ue } = re.getBoundingClientRect();
292
+ S.current = { x: ne + de / 2, y: Xe + Ue / 2 }, R.current = y.pointerId, wr(re, y.pointerId), Te(y.clientX, y.clientY, !0);
288
293
  },
289
294
  [Te]
290
295
  ), ce = w(
@@ -303,102 +308,95 @@ const nn = {
303
308
  return;
304
309
  }
305
310
  y.preventDefault(), y.stopPropagation();
306
- const se = T.current;
307
- if (T.current = null, se !== null) {
311
+ const re = T.current;
312
+ if (T.current = null, re !== null) {
308
313
  ze(y.pointerId);
309
- const ne = C.current;
310
- let Le = !0;
311
- if (ne !== null && typeof ne.setPointerCapture == "function")
312
- try {
313
- ne.setPointerCapture(se.pointerId);
314
- } catch (te) {
315
- (typeof te == "object" && te !== null && "name" in te ? te.name : void 0) === "NotFoundError" && (Le = !1);
316
- }
317
- if (Le) {
318
- R.current = se.pointerId, Te(se.clientX, se.clientY, !0);
314
+ const ne = N.current;
315
+ if (ne === null || wr(ne, re.pointerId) !== "inactive-pointer") {
316
+ R.current = re.pointerId, Te(re.clientX, re.clientY, !0);
319
317
  return;
320
318
  }
321
319
  }
322
320
  D(!0);
323
321
  },
324
322
  [D, ze, Te]
325
- ), E = w(
323
+ ), P = w(
326
324
  (y) => {
327
325
  y.target === y.currentTarget && R.current === y.pointerId && D(!1);
328
326
  },
329
327
  [D]
330
328
  );
331
- Nr(
329
+ Ar(
332
330
  f,
333
331
  () => ({
334
332
  reset: () => {
335
333
  D(!0);
336
334
  },
337
- getElement: () => C.current
335
+ getElement: () => N.current
338
336
  }),
339
337
  [D]
340
338
  );
341
- const V = Math.min(Math.max(s, 0), 1), J = n / 64, B = Math.min(g.distance, r) / r, H = g.direction * B * 10 * J;
342
- let Q;
343
- if (c === "xy") {
344
- const y = g.distance, se = y === 0 ? 0 : H * g.offsetX / y, ne = y === 0 ? 0 : H * g.offsetY / y;
345
- Q = `translate(${se}px, ${ne}px)`;
346
- } else c === "x" ? Q = `translateX(${H}px)` : Q = `translateY(${H}px)`;
347
- const oe = o ?? qn, ge = {
339
+ const C = Math.min(Math.max(s, 0), 1), K = n / 64, B = Math.min(g.distance, r) / r, H = g.direction * B * 10 * K;
340
+ let J;
341
+ if (l === "xy") {
342
+ const y = g.distance, re = y === 0 ? 0 : H * g.offsetX / y, ne = y === 0 ? 0 : H * g.offsetY / y;
343
+ J = `translate(${re}px, ${ne}px)`;
344
+ } else l === "x" ? J = `translateX(${H}px)` : J = `translateY(${H}px)`;
345
+ const ie = o ?? Un, ge = {
348
346
  dragState: g,
349
347
  normalizedDistance: B,
350
- sizeScale: J,
348
+ sizeScale: K,
351
349
  size: n,
352
- opacity: V
353
- }, Xe = {
350
+ opacity: C
351
+ }, $e = {
354
352
  ...i,
355
353
  width: n,
356
354
  height: n,
357
- transform: Q
355
+ transform: J
358
356
  };
359
- return Xe.opacity = V, /* @__PURE__ */ U(
357
+ return $e.opacity = C, /* @__PURE__ */ U(
360
358
  "div",
361
359
  {
362
- ref: C,
360
+ ref: N,
363
361
  "data-testid": "virtual-scroll-tap-circle",
364
- className: Ct("aqvs-tap-scroll-circle", e),
365
- style: Xe,
362
+ className: Nt("aqvs-tap-scroll-circle", e),
363
+ style: $e,
366
364
  tabIndex: -1,
367
365
  onPointerDown: k,
368
366
  onPointerMove: ce,
369
367
  onPointerUp: L,
370
368
  onPointerCancel: L,
371
- onLostPointerCapture: E,
369
+ onLostPointerCapture: P,
372
370
  role: "presentation",
373
- children: oe(ge)
371
+ children: ie(ge)
374
372
  }
375
373
  );
376
374
  })
377
375
  );
378
- Ur.displayName = "TapScrollCircle";
379
- const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
380
- const r = e === "x", n = t.getBoundingClientRect(), i = r ? n.width : n.height, s = (b) => {
381
- const R = Number.parseFloat(b);
376
+ jr.displayName = "TapScrollCircle";
377
+ const ee = (t, e, r) => Math.max(e, Math.min(r, t)), Yr = (t, e) => {
378
+ const r = e === "x", n = t.getBoundingClientRect(), i = r ? n.width : n.height, s = (x) => {
379
+ const R = Number.parseFloat(x);
382
380
  return Number.isFinite(R) ? R : 0;
383
- }, o = window.getComputedStyle(t), c = s(r ? o.width : o.height), f = c > 0 ? c + 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;
381
+ }, 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;
384
382
  return g <= 0 || i <= 0 ? 1 : i / g;
385
- }, vr = "virtualscroll:tap-scroll-cancel", sn = 20, Yn = 250, Bn = 60, Wn = 20, Un = 20, Mn = {
383
+ }, Sr = "virtualscroll:tap-scroll-cancel", an = 20, Gn = 250, jn = 60, Kn = 20, Zn = 20, Rn = {
386
384
  /** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
387
385
  maxDistance: 240,
388
386
  /** 最小速度倍率 (ビューポート比)。 */
389
387
  minSpeedMultiplier: 0.2
390
- }, Gn = Mn.maxDistance, on = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, Lr = 2.2, jn = 8, Kn = 120, In = 1 / 10, Xt = {
388
+ }, Jn = Rn.maxDistance, cn = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, _r = 2.2, Qn = 8, ei = 120, Pn = 1 / 10, Xt = {
391
389
  enabled: !0,
392
390
  size: 40,
393
391
  offsetX: -80,
394
392
  offsetY: 0,
395
393
  className: void 0,
396
- maxVisualDistance: Gn,
397
- minSpeedMultiplier: Mn.minSpeedMultiplier,
394
+ maxVisualDistance: Jn,
395
+ minSpeedMultiplier: Rn.minSpeedMultiplier,
398
396
  opacity: 0.9,
399
397
  renderVisual: void 0,
400
398
  maxSpeedCurve: void 0
401
- }, Zn = (t) => t ? {
399
+ }, ti = (t) => t ? {
402
400
  mainSizeKey: "width",
403
401
  crossSizeKey: "height",
404
402
  positionKey: "left",
@@ -416,8 +414,8 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
416
414
  arrowIcons: ["▲", "▼"],
417
415
  directionClass: "aqvs-scrollbar-vertical",
418
416
  orientation: "vertical"
419
- }, qr = (t, e) => {
420
- const r = t?.maxSpeedMultiplier, n = typeof r == "number" ? r : ti(e);
417
+ }, Br = (t, e) => {
418
+ const r = t?.maxSpeedMultiplier, n = typeof r == "number" ? r : si(e);
421
419
  return {
422
420
  enabled: t?.enabled ?? Xt.enabled,
423
421
  size: t?.size ?? Xt.size,
@@ -427,44 +425,44 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
427
425
  maxVisualDistance: t?.maxVisualDistance ?? Xt.maxVisualDistance,
428
426
  maxSpeedMultiplier: n,
429
427
  minSpeedMultiplier: Math.max(t?.minSpeedMultiplier ?? Xt.minSpeedMultiplier, 0),
430
- opacity: re(t?.opacity ?? Xt.opacity, 0, 1),
428
+ opacity: ee(t?.opacity ?? Xt.opacity, 0, 1),
431
429
  renderVisual: t?.renderVisual ?? Xt.renderVisual,
432
430
  maxSpeedCurve: t?.maxSpeedCurve ?? Xt.maxSpeedCurve
433
431
  };
434
- }, Jn = ({ isDragging: t, isThumbHovered: e, enableThumbDrag: r }) => Me(() => r ? t ? "dragging" : e ? "hover" : "idle" : "disabled", [r, t, e]), Qn = ({ canUseArrowButtons: t, enableArrowButtons: e, resetTapScroll: r, scrollByStep: n }) => {
435
- const i = d(null), s = d(null), o = d(null), c = w(() => {
432
+ }, ri = ({ isDragging: t, isThumbHovered: e, enableThumbDrag: r }) => Me(() => r ? t ? "dragging" : e ? "hover" : "idle" : "disabled", [r, t, e]), ni = ({ canUseArrowButtons: t, enableArrowButtons: e, resetTapScroll: r, scrollByStep: n }) => {
433
+ const i = d(null), s = d(null), o = d(null), l = w(() => {
436
434
  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);
437
435
  }, []), f = w(() => {
438
- c();
439
- }, [c]), g = w(
436
+ l();
437
+ }, [l]), g = w(
440
438
  (R) => (T) => {
441
439
  if (!t)
442
440
  return;
443
- T.cancelable && T.preventDefault(), T.stopPropagation(), r(), c(), n(R), s.current = window.setTimeout(() => {
441
+ T.cancelable && T.preventDefault(), T.stopPropagation(), r(), l(), n(R), s.current = window.setTimeout(() => {
444
442
  i.current = window.setInterval(() => {
445
443
  n(R);
446
- }, Bn);
447
- }, Yn);
448
- const S = () => c();
444
+ }, jn);
445
+ }, Gn);
446
+ const S = () => l();
449
447
  o.current = S, window.addEventListener("pointerup", S), window.addEventListener("pointercancel", S), window.addEventListener("blur", S);
450
448
  },
451
- [t, c, r, n]
452
- ), b = w(
449
+ [t, l, r, n]
450
+ ), x = w(
453
451
  (R) => (T) => {
454
452
  e && (T.key === "Enter" || T.key === " " || T.key === "Spacebar") && (T.preventDefault(), n(R));
455
453
  },
456
454
  [e, n]
457
455
  );
458
456
  return X(() => {
459
- t || c();
460
- }, [t, c]), X(() => () => {
461
- c();
462
- }, [c]), { handleArrowPointerDown: g, handleArrowPointerUp: f, handleArrowKeyDown: b };
463
- }, ei = 700, ir = (t, e) => typeof t == "number" && Number.isFinite(t) ? t : e, Yr = ({ distance: t, maxDistance: e, viewportSize: r, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: o }) => {
464
- const c = Math.max(ir(t, 0), 0), f = ir(e, 0), g = f > 0 ? Math.min(c, f) / f : 1, b = Math.max(ir(r, 0), 0), R = Math.max(ir(n, 0), 0), T = Math.max(ir(i, 0), 0), S = Math.max(b * R, 40), C = s ? S : 1200, Z = Math.max(b * T, C), F = o ? Math.max(ir(o.exponentialScale, T), 0) : 0, Te = o ? Math.min(Z, Math.max(b * F, S)) : Z, ze = Math.max(Te, S);
457
+ t || l();
458
+ }, [t, l]), X(() => () => {
459
+ l();
460
+ }, [l]), { handleArrowPointerDown: g, handleArrowPointerUp: f, handleArrowKeyDown: x };
461
+ }, ii = 700, ir = (t, e) => typeof t == "number" && Number.isFinite(t) ? t : e, Wr = ({ distance: t, maxDistance: e, viewportSize: r, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: o }) => {
462
+ const l = Math.max(ir(t, 0), 0), f = ir(e, 0), g = f > 0 ? Math.min(l, f) / f : 1, x = Math.max(ir(r, 0), 0), R = Math.max(ir(n, 0), 0), T = Math.max(ir(i, 0), 0), S = Math.max(x * R, 40), N = s ? S : 1200, j = Math.max(x * T, N), F = o ? Math.max(ir(o.exponentialScale, T), 0) : 0, Te = o ? Math.min(j, Math.max(x * F, S)) : j, ze = Math.max(Te, S);
465
463
  let D = g ** 1.1;
466
464
  if (o) {
467
- const ce = Math.min(Math.max(ir(o.exponentialSteepness, 0), 0), ei);
465
+ const ce = Math.min(Math.max(ir(o.exponentialSteepness, 0), 0), ii);
468
466
  if (ce === 0)
469
467
  D = g;
470
468
  else {
@@ -474,12 +472,12 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
474
472
  }
475
473
  const k = Math.min(Math.max(ir(o?.easedOffset, 0), 0), 1);
476
474
  return S + (ze - S) * (k + (1 - k) * D);
477
- }, ti = (t) => {
475
+ }, si = (t) => {
478
476
  if (!t || t <= 0)
479
- return Lr;
480
- const e = Math.max(1, t), r = Math.log10(e), n = Lr + r * jn;
481
- return re(n, Lr, Kn);
482
- }, yn = ({
477
+ return _r;
478
+ const e = Math.max(1, t), r = Math.log10(e), n = _r + r * Qn;
479
+ return ee(n, _r, ei);
480
+ }, En = ({
483
481
  contentSize: t,
484
482
  viewportSize: e,
485
483
  scrollPosition: r,
@@ -487,240 +485,237 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
487
485
  enableThumbDrag: i = !0,
488
486
  enableTrackClick: s = !0,
489
487
  enableArrowButtons: o = !0,
490
- horizontal: c = !1,
488
+ horizontal: l = !1,
491
489
  enableHorizontalTapCircle: f = !1,
492
490
  stretchMainSize: g = !1,
493
- scrollBarWidth: b = 12,
491
+ scrollBarWidth: x = 12,
494
492
  className: R,
495
493
  ariaControls: T,
496
494
  tapScrollCircleOptions: S,
497
- itemCount: C,
498
- renderThumbOverlay: Z,
495
+ itemCount: N,
496
+ renderThumbOverlay: j,
499
497
  visibleStartIndex: F,
500
498
  visibleEndIndex: Te,
501
499
  locale: ze,
502
500
  labels: D
503
501
  }) => {
504
- const [k, ce] = ke(!1), [L, E] = ke(!1), [V, J] = ke(!1), B = d(null), H = d({
502
+ const [k, ce] = _e(!1), [L, P] = _e(!1), [C, K] = _e(!1), B = d(null), H = d({
505
503
  pointerId: null,
506
504
  startThumbPosition: 0,
507
505
  startClientX: 0,
508
506
  startClientY: 0,
509
507
  scale: 1,
510
508
  captureTarget: null
511
- }), Q = d({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), oe = d(r), ge = d(n), Xe = d(on), y = d(null), se = d(null), ne = d(null), Le = d(0), te = d(0), Ye = Me(() => qr(S, C), [C, S]), xe = Me(() => Zn(c), [c]), ie = Me(() => Sn(ze, D), [ze, D]), Qe = c ? [ie.scrollLeft, ie.scrollRight] : [ie.scrollUp, ie.scrollDown], {
509
+ }), J = d({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), ie = d(r), ge = d(n), $e = d(cn), y = d(null), re = d(null), ne = d(null), Xe = d(0), de = d(0), Ue = Me(() => Br(S, N), [N, S]), xe = Me(() => ti(l), [l]), te = Me(() => In(ze, D), [ze, D]), Qe = l ? [te.scrollLeft, te.scrollRight] : [te.scrollUp, te.scrollDown], {
512
510
  enabled: at,
513
511
  size: et,
514
512
  offsetX: wt,
515
513
  offsetY: qe,
516
- className: Be,
517
- maxVisualDistance: Ce,
518
- maxSpeedMultiplier: lt,
519
- minSpeedMultiplier: ee,
520
- opacity: Oe,
514
+ className: Ye,
515
+ maxVisualDistance: Ne,
516
+ maxSpeedMultiplier: ct,
517
+ minSpeedMultiplier: Q,
518
+ opacity: Le,
521
519
  renderVisual: Re,
522
- maxSpeedCurve: ue
523
- } = Ye, be = d({
520
+ maxSpeedCurve: le
521
+ } = Ue, be = d({
524
522
  viewportSize: e,
525
523
  maxScrollPosition: Math.max(t - e, 0),
526
524
  scrollBarVisible: t > e,
527
- effectiveTapMaxDistance: Math.max(Ce, 1),
528
- tapCircleMaxSpeedMultiplier: lt,
529
- tapCircleMinSpeedMultiplier: ee,
530
- tapCircleMaxSpeedCurve: ue,
525
+ effectiveTapMaxDistance: Math.max(Ne, 1),
526
+ tapCircleMaxSpeedMultiplier: ct,
527
+ tapCircleMinSpeedMultiplier: Q,
528
+ tapCircleMaxSpeedCurve: le,
531
529
  tapScrollCircleOptions: S,
532
530
  effectiveTrackLength: 0,
533
531
  onScroll: n,
534
532
  scrollPosition: r
535
- }), { mainSizeKey: fe, crossSizeKey: xt, positionKey: M, selectDelta: He, getPointerCoordinate: he, arrowIcons: O, directionClass: dt, orientation: tt } = xe, Nt = Math.max(Ce, 1), St = e / t, x = Math.max(e - b * 2, 0), N = St * x, de = Math.min(Math.max(sn, N || 0), x || sn), G = Math.max(t - e, 0), ae = Math.max(x - de, 0), me = G <= 0 || ae <= 0 ? 0 : re(r / G * ae, 0, ae), Ge = me + de / 2, ve = t > e || k, We = ve && o;
533
+ }), { mainSizeKey: fe, crossSizeKey: xt, positionKey: M, selectDelta: Fe, getPointerCoordinate: he, arrowIcons: _, directionClass: dt, orientation: tt } = xe, Vt = Math.max(Ne, 1), St = e / t, b = Math.max(e - x * 2, 0), V = St * b, ue = Math.min(Math.max(an, V || 0), b || an), Z = Math.max(t - e, 0), se = Math.max(b - ue, 0), me = Z <= 0 || se <= 0 ? 0 : ee(r / Z * se, 0, se), Ge = me + ue / 2, ve = t > e || k, Be = ve && o;
536
534
  Je(() => {
537
535
  be.current = {
538
536
  viewportSize: e,
539
- maxScrollPosition: G,
537
+ maxScrollPosition: Z,
540
538
  scrollBarVisible: ve,
541
- effectiveTapMaxDistance: Nt,
542
- tapCircleMaxSpeedMultiplier: lt,
543
- tapCircleMinSpeedMultiplier: ee,
544
- tapCircleMaxSpeedCurve: ue,
539
+ effectiveTapMaxDistance: Vt,
540
+ tapCircleMaxSpeedMultiplier: ct,
541
+ tapCircleMinSpeedMultiplier: Q,
542
+ tapCircleMaxSpeedCurve: le,
545
543
  tapScrollCircleOptions: S,
546
- effectiveTrackLength: ae,
544
+ effectiveTrackLength: se,
547
545
  onScroll: n,
548
546
  scrollPosition: r
549
547
  };
550
548
  }), Je(() => {
551
- oe.current = r;
549
+ ie.current = r;
552
550
  }, [r]), Je(() => {
553
551
  ge.current = n;
554
552
  }, [n]), X(() => {
555
- i || E(!1);
553
+ i || P(!1);
556
554
  }, [i]);
557
- const Ie = Jn({ isDragging: k, isThumbHovered: L, enableThumbDrag: i }), _e = w((u, P) => {
558
- const _ = be.current, j = P ?? oe.current;
555
+ const Ie = ri({ isDragging: k, isThumbHovered: L, enableThumbDrag: i }), Oe = w((u, E) => {
556
+ const O = be.current, oe = E ?? ie.current;
559
557
  if (ge.current) {
560
- const Ke = ge.current(u, j);
558
+ const Ke = ge.current(u, oe);
561
559
  if (typeof Ke == "number" && Number.isFinite(Ke))
562
- return oe.current = Ke, Ke;
560
+ return ie.current = Ke, Ke;
563
561
  }
564
- const Fe = typeof u == "function" ? u(j) : u, je = Math.max(_.maxScrollPosition, 0), pt = _.scrollBarVisible ? re(Fe, 0, je) : 0;
565
- return oe.current = pt, pt;
562
+ const He = typeof u == "function" ? u(oe) : u, je = Math.max(O.maxScrollPosition, 0), pt = O.scrollBarVisible ? ee(He, 0, je) : 0;
563
+ return ie.current = pt, pt;
566
564
  }, []), mt = w(
567
565
  (u) => {
568
- const P = be.current, _ = oe.current;
569
- if (!P.scrollBarVisible || P.maxScrollPosition <= 0) {
570
- const yt = _e(0, _), _t = yt - _;
566
+ const E = be.current, O = ie.current;
567
+ if (!E.scrollBarVisible || E.maxScrollPosition <= 0) {
568
+ const yt = Oe(0, O), _t = yt - O;
571
569
  return { nextPosition: yt, actualDelta: _t, reachedBoundary: !0 };
572
570
  }
573
571
  if (u === 0)
574
- return { nextPosition: _, actualDelta: 0, reachedBoundary: !1 };
575
- const Fe = _e((yt) => re(yt + u, 0, P.maxScrollPosition), _), je = Fe - _, pt = u < 0 && _ + u <= 0, Ke = u > 0 && _ + u >= P.maxScrollPosition, Ot = u < 0 && (Fe <= 0 || pt && je === 0) || u > 0 && (Fe >= P.maxScrollPosition || Ke && je === 0);
576
- return { nextPosition: Fe, actualDelta: je, reachedBoundary: Ot };
572
+ return { nextPosition: O, actualDelta: 0, reachedBoundary: !1 };
573
+ const He = Oe((yt) => ee(yt + u, 0, E.maxScrollPosition), O), je = He - O, pt = u < 0 && O + u <= 0, Ke = u > 0 && O + u >= E.maxScrollPosition, Ot = u < 0 && (He <= 0 || pt && je === 0) || u > 0 && (He >= E.maxScrollPosition || Ke && je === 0);
574
+ return { nextPosition: He, actualDelta: je, reachedBoundary: Ot };
577
575
  },
578
- [_e]
576
+ [Oe]
579
577
  ), rt = w(
580
- (u, P) => {
581
- u.current += P;
582
- const _ = Math.max(be.current.maxScrollPosition, 0);
583
- _ > 0 && (u.current = re(u.current, -_, _));
584
- const j = mt(u.current);
585
- return u.current -= j.actualDelta, j.reachedBoundary && (u.current = 0), j;
578
+ (u, E) => {
579
+ u.current += E;
580
+ const O = Math.max(be.current.maxScrollPosition, 0);
581
+ O > 0 && (u.current = ee(u.current, -O, O));
582
+ const oe = mt(u.current);
583
+ return u.current -= oe.actualDelta, oe.reachedBoundary && (u.current = 0), oe;
586
584
  },
587
585
  [mt]
588
586
  ), nt = w(() => {
589
- se.current !== null && (window.cancelAnimationFrame(se.current), se.current = null), ne.current = null, Le.current = 0, te.current = 0;
590
- }, []), $e = w(() => {
591
- Xe.current = { ...on }, J(!1), y.current?.reset(), nt();
592
- }, [nt]), ct = w(
587
+ re.current !== null && (window.cancelAnimationFrame(re.current), re.current = null), ne.current = null, Xe.current = 0, de.current = 0;
588
+ }, []), ke = w(() => {
589
+ $e.current = { ...cn }, K(!1), y.current?.reset(), nt();
590
+ }, [nt]), lt = w(
593
591
  (u) => {
594
- const P = Xe.current, _ = be.current;
595
- if (!P.active || P.direction === 0) {
592
+ const E = $e.current, O = be.current;
593
+ if (!E.active || E.direction === 0) {
596
594
  nt();
597
595
  return;
598
596
  }
599
- if (!_.scrollBarVisible || _.maxScrollPosition <= 0) {
597
+ if (!O.scrollBarVisible || O.maxScrollPosition <= 0) {
600
598
  nt();
601
599
  return;
602
600
  }
603
- const j = ne.current ?? u, Fe = Math.max((u - j) / 1e3, 0), je = Math.min(Fe, In);
601
+ const oe = ne.current ?? u, He = Math.max((u - oe) / 1e3, 0), je = Math.min(He, Pn);
604
602
  if (ne.current = u, je <= 0) {
605
- se.current = window.requestAnimationFrame(ct);
603
+ re.current = window.requestAnimationFrame(lt);
606
604
  return;
607
605
  }
608
- const pt = Yr({
609
- distance: P.distance,
610
- maxDistance: _.effectiveTapMaxDistance,
611
- viewportSize: _.viewportSize,
612
- minSpeedMultiplier: _.tapCircleMinSpeedMultiplier,
613
- maxSpeedMultiplier: _.tapCircleMaxSpeedMultiplier,
614
- hasCustomMaxSpeedMultiplier: typeof _.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
615
- curve: _.tapCircleMaxSpeedCurve
606
+ const pt = Wr({
607
+ distance: E.distance,
608
+ maxDistance: O.effectiveTapMaxDistance,
609
+ viewportSize: O.viewportSize,
610
+ minSpeedMultiplier: O.tapCircleMinSpeedMultiplier,
611
+ maxSpeedMultiplier: O.tapCircleMaxSpeedMultiplier,
612
+ hasCustomMaxSpeedMultiplier: typeof O.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
613
+ curve: O.tapCircleMaxSpeedCurve
616
614
  });
617
- te.current !== P.direction && (te.current = P.direction, Le.current = 0);
618
- const { reachedBoundary: Ke } = rt(Le, P.direction * pt * je);
615
+ de.current !== E.direction && (de.current = E.direction, Xe.current = 0);
616
+ const { reachedBoundary: Ke } = rt(Xe, E.direction * pt * je);
619
617
  if (Ke) {
620
618
  nt();
621
619
  return;
622
620
  }
623
- se.current = window.requestAnimationFrame(ct);
621
+ re.current = window.requestAnimationFrame(lt);
624
622
  },
625
623
  [rt, nt]
626
624
  ), we = w(() => {
627
- se.current === null && (ne.current = null, Le.current = 0, se.current = window.requestAnimationFrame(ct));
628
- }, [ct]);
625
+ re.current === null && (ne.current = null, Xe.current = 0, re.current = window.requestAnimationFrame(lt));
626
+ }, [lt]);
629
627
  X(() => {
630
- const u = Xe.current;
628
+ const u = $e.current;
631
629
  !u.active || u.direction === 0 || we();
632
630
  }, [t, e, we]), X(() => () => {
633
631
  nt();
634
632
  }, [nt]);
635
633
  const pe = w(
636
634
  (u) => {
637
- Xe.current = u, J(u.active), u.active && u.direction !== 0 ? we() : nt();
635
+ $e.current = u, K(u.active), u.active && u.direction !== 0 ? we() : nt();
638
636
  },
639
637
  [we, nt]
640
638
  );
641
639
  X(() => {
642
- at || $e();
643
- }, [$e, at]), X(() => {
644
- const u = (P) => {
645
- const j = P.detail?.paneId;
646
- j && T && j !== T || $e();
640
+ at || ke();
641
+ }, [ke, at]), X(() => {
642
+ const u = (E) => {
643
+ const oe = E.detail?.paneId;
644
+ oe && T && oe !== T || ke();
647
645
  };
648
- return window.addEventListener(vr, u), () => {
649
- window.removeEventListener(vr, u);
646
+ return window.addEventListener(Sr, u), () => {
647
+ window.removeEventListener(Sr, u);
650
648
  };
651
- }, [T, $e]), X(() => {
649
+ }, [T, ke]), X(() => {
652
650
  if (!at)
653
651
  return;
654
- const u = (P) => {
655
- if (!Xe.current.active || Xe.current.pointerId === P.pointerId)
652
+ const u = (E) => {
653
+ if (!$e.current.active || $e.current.pointerId === E.pointerId)
656
654
  return;
657
- const _ = P.target;
658
- if (!(_ instanceof Node)) {
659
- $e();
655
+ const O = E.target;
656
+ if (!(O instanceof Node)) {
657
+ ke();
660
658
  return;
661
659
  }
662
- y.current?.getElement()?.contains(_) || $e();
660
+ y.current?.getElement()?.contains(O) || ke();
663
661
  };
664
662
  return document.addEventListener("pointerdown", u, !0), () => {
665
663
  document.removeEventListener("pointerdown", u, !0);
666
664
  };
667
- }, [$e, at]);
665
+ }, [ke, at]);
668
666
  const Mt = (u) => {
669
- if (!ve || ae <= 0 || G <= 0)
667
+ if (!ve || se <= 0 || Z <= 0)
670
668
  return 0;
671
- const P = re(u, 0, ae);
672
- return re(P / ae * G, 0, G);
669
+ const E = ee(u, 0, se);
670
+ return ee(E / se * Z, 0, Z);
673
671
  }, m = w((u) => {
674
- const { scrollBarVisible: P, effectiveTrackLength: _, maxScrollPosition: j } = be.current;
675
- if (A.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: u, trackLen: _, maxScroll: j })), _ <= 0 || j <= 0)
672
+ const { scrollBarVisible: E, effectiveTrackLength: O, maxScrollPosition: oe } = be.current;
673
+ if (A.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: u, trackLen: O, maxScroll: oe })), O <= 0 || oe <= 0)
676
674
  return null;
677
- const Fe = re(u, 0, _);
678
- return re(Fe / _ * j, 0, j);
679
- }, []), z = w((u) => Xr(u, c ? "x" : "y"), [c]), Pe = w(
675
+ const He = ee(u, 0, O);
676
+ return ee(He / O * oe, 0, oe);
677
+ }, []), z = w((u) => Yr(u, l ? "x" : "y"), [l]), Pe = w(
680
678
  (u) => {
681
- const P = H.current;
682
- if (P.pointerId !== u.pointerId)
679
+ const E = H.current;
680
+ if (E.pointerId !== u.pointerId)
683
681
  return;
684
- const _ = u.clientX - P.startClientX, j = u.clientY - P.startClientY, Fe = He(_, j) / (P.scale || 1);
682
+ const O = u.clientX - E.startClientX, oe = u.clientY - E.startClientY, He = Fe(O, oe) / (E.scale || 1);
685
683
  A.debug("[ScrollBar] handleThumbPointerMove", () => ({
686
- delta: Fe,
687
- startThumbPosition: P.startThumbPosition,
684
+ delta: He,
685
+ startThumbPosition: E.startThumbPosition,
688
686
  clientY: u.clientY,
689
- startClientY: P.startClientY,
687
+ startClientY: E.startClientY,
690
688
  metrics: be.current
691
689
  }));
692
- const je = m(P.startThumbPosition + Fe);
693
- je !== null && _e(je), u.cancelable && u.preventDefault();
690
+ const je = m(E.startThumbPosition + He);
691
+ je !== null && Oe(je), u.cancelable && u.preventDefault();
694
692
  },
695
- [He, m, _e]
693
+ [Fe, m, Oe]
696
694
  ), it = w(
697
695
  (u) => {
698
- const P = H.current;
699
- if (P.pointerId !== u.pointerId)
700
- return;
701
- document.removeEventListener("pointermove", Pe), document.removeEventListener("pointerup", it), document.removeEventListener("pointercancel", it);
702
- const _ = P.captureTarget;
703
- if (_?.hasPointerCapture?.(u.pointerId) && _.releasePointerCapture(u.pointerId), H.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ce(!1), B.current) {
704
- const j = B.current.getBoundingClientRect();
705
- u.clientX >= j.left && u.clientX <= j.right && u.clientY >= j.top && u.clientY <= j.bottom || E(!1);
706
- } else
707
- E(!1);
696
+ const E = H.current;
697
+ if (E.pointerId === u.pointerId)
698
+ if (document.removeEventListener("pointermove", Pe), document.removeEventListener("pointerup", it), document.removeEventListener("pointercancel", it), E.captureTarget !== null && sr(E.captureTarget, u.pointerId), H.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ce(!1), B.current) {
699
+ const O = B.current.getBoundingClientRect();
700
+ u.clientX >= O.left && u.clientX <= O.right && u.clientY >= O.top && u.clientY <= O.bottom || P(!1);
701
+ } else
702
+ P(!1);
708
703
  },
709
704
  [Pe]
710
705
  );
711
706
  X(() => () => {
712
707
  document.removeEventListener("pointermove", Pe), document.removeEventListener("pointerup", it), document.removeEventListener("pointercancel", it);
713
708
  }, [Pe, it]);
714
- const Ne = d(0), Pt = d(0), st = w(
709
+ const Ve = d(0), Pt = d(0), st = w(
715
710
  (u) => {
716
- const P = Math.max(Math.round(be.current.viewportSize / Un), Wn);
717
- Pt.current !== u && (Pt.current = u, Ne.current = 0), rt(Ne, u * P);
711
+ const E = Math.max(Math.round(be.current.viewportSize / Zn), Kn);
712
+ Pt.current !== u && (Pt.current = u, Ve.current = 0), rt(Ve, u * E);
718
713
  },
719
714
  [rt]
720
- ), { handleArrowPointerDown: ut, handleArrowPointerUp: Ve, handleArrowKeyDown: Yt } = Qn({
721
- canUseArrowButtons: We,
715
+ ), { handleArrowPointerDown: ut, handleArrowPointerUp: Ce, handleArrowKeyDown: Yt } = ni({
716
+ canUseArrowButtons: Be,
722
717
  enableArrowButtons: o,
723
- resetTapScroll: $e,
718
+ resetTapScroll: ke,
724
719
  scrollByStep: st
725
720
  }), lr = (u) => {
726
721
  if (!ve)
@@ -731,23 +726,16 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
731
726
  }
732
727
  if (u.pointerType === "mouse" && u.button !== 0 || u.ctrlKey)
733
728
  return;
734
- $e();
735
- const P = u.currentTarget, _ = z(P);
736
- let j = null;
737
- if (P.setPointerCapture)
738
- try {
739
- P.setPointerCapture(u.pointerId), j = P;
740
- } catch {
741
- j = null;
742
- }
729
+ ke();
730
+ const E = u.currentTarget, O = z(E), oe = wr(E, u.pointerId) === "captured" ? E : null;
743
731
  H.current = {
744
732
  pointerId: u.pointerId,
745
733
  startThumbPosition: me,
746
734
  startClientX: u.clientX,
747
735
  startClientY: u.clientY,
748
- scale: _,
749
- captureTarget: j
750
- }, document.addEventListener("pointermove", Pe), document.addEventListener("pointerup", it), document.addEventListener("pointercancel", it), ce(!0), E(!0), u.preventDefault(), u.stopPropagation();
736
+ scale: O,
737
+ captureTarget: oe
738
+ }, document.addEventListener("pointermove", Pe), document.addEventListener("pointerup", it), document.addEventListener("pointercancel", it), ce(!0), P(!0), u.preventDefault(), u.stopPropagation();
751
739
  }, Bt = (u) => {
752
740
  if (!ve)
753
741
  return;
@@ -757,96 +745,85 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
757
745
  }
758
746
  if (u.pointerType === "mouse" && u.button !== 0 || u.ctrlKey)
759
747
  return;
760
- const P = u.currentTarget, _ = P.getBoundingClientRect(), j = he(u), Fe = z(P), je = (j - (c ? _.left : _.top)) / Fe;
761
- $e();
762
- const pt = je - de / 2, Ke = Mt(pt);
763
- if (_e(Ke), P.setPointerCapture)
764
- try {
765
- P.setPointerCapture(u.pointerId);
766
- } catch {
767
- }
768
- Q.current = {
748
+ const E = u.currentTarget, O = E.getBoundingClientRect(), oe = he(u), He = z(E), je = (oe - (l ? O.left : O.top)) / He;
749
+ ke();
750
+ const pt = je - ue / 2, Ke = Mt(pt);
751
+ Oe(Ke), wr(E, u.pointerId), J.current = {
769
752
  pointerId: u.pointerId,
770
753
  startThumbPosition: pt,
771
754
  startClientX: u.clientX,
772
755
  startClientY: u.clientY,
773
- scale: Fe
756
+ scale: He
774
757
  }, u.preventDefault(), u.stopPropagation();
775
758
  }, Se = () => {
776
- Q.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
759
+ J.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
777
760
  }, Lt = (u) => {
778
- const P = Q.current;
779
- if (P.pointerId !== u.pointerId)
761
+ const E = J.current;
762
+ if (E.pointerId !== u.pointerId)
780
763
  return;
781
764
  if (u.pointerType === "mouse" && u.buttons === 0) {
782
765
  Se();
783
766
  return;
784
767
  }
785
- const _ = u.clientX - P.startClientX, j = u.clientY - P.startClientY, Fe = He(_, j) / (P.scale || 1), je = Mt(P.startThumbPosition + Fe);
786
- _e(je), u.cancelable && u.preventDefault();
768
+ const O = u.clientX - E.startClientX, oe = u.clientY - E.startClientY, He = Fe(O, oe) / (E.scale || 1), je = Mt(E.startThumbPosition + He);
769
+ Oe(je), u.cancelable && u.preventDefault();
787
770
  }, Zt = (u) => {
788
- if (Q.current.pointerId !== u.pointerId)
789
- return;
790
- const P = u.currentTarget;
791
- P.hasPointerCapture?.(u.pointerId) && P.releasePointerCapture(u.pointerId), Se(), u.preventDefault(), u.stopPropagation();
792
- }, sr = (u) => {
793
- if (Q.current.pointerId !== u.pointerId)
794
- return;
795
- const P = u.currentTarget;
796
- P.hasPointerCapture?.(u.pointerId) && P.releasePointerCapture(u.pointerId), Se();
771
+ J.current.pointerId === u.pointerId && (sr(u.currentTarget, u.pointerId), Se(), u.preventDefault(), u.stopPropagation());
772
+ }, or = (u) => {
773
+ J.current.pointerId === u.pointerId && (sr(u.currentTarget, u.pointerId), Se());
797
774
  }, Ee = (u) => {
798
- u.target === u.currentTarget && Q.current.pointerId === u.pointerId && Se();
799
- }, It = Me(() => re((V ? 1 : 0.8) * Oe, 0, 1), [V, Oe]), Wt = Me(() => {
800
- const P = `calc(50% - ${et / 2}px + ${qe}px)`;
775
+ u.target === u.currentTarget && J.current.pointerId === u.pointerId && Se();
776
+ }, It = Me(() => ee((C ? 1 : 0.8) * Le, 0, 1), [C, Le]), Wt = Me(() => {
777
+ const E = `calc(50% - ${et / 2}px + ${qe}px)`;
801
778
  return {
802
779
  left: wt,
803
- top: P
780
+ top: E
804
781
  };
805
- }, [wt, qe, et]), Ht = (u, P, _, j) => /* @__PURE__ */ U(
782
+ }, [wt, qe, et]), Ht = (u, E, O, oe) => /* @__PURE__ */ U(
806
783
  "button",
807
784
  {
808
785
  type: "button",
809
786
  tabIndex: 0,
810
787
  className: "aqvs-scrollbar-arrow-button",
811
788
  style: {
812
- [fe]: b,
813
- [xt]: b
789
+ [fe]: x,
790
+ [xt]: x
814
791
  },
815
- "aria-label": P,
792
+ "aria-label": E,
816
793
  onPointerDown: ut(u),
817
- onPointerUp: Ve,
818
- onPointerLeave: Ve,
819
- onPointerCancel: Ve,
794
+ onPointerUp: Ce,
795
+ onPointerLeave: Ce,
796
+ onPointerCancel: Ce,
820
797
  onKeyDown: Yt(u),
821
798
  "aria-disabled": !o,
822
- disabled: !We,
823
- children: /* @__PURE__ */ U("span", { "aria-hidden": "true", children: _ })
799
+ disabled: !Be,
800
+ children: /* @__PURE__ */ U("span", { "aria-hidden": "true", children: O })
824
801
  },
825
- j
826
- ), bt = Z && ve ? {
802
+ oe
803
+ ), bt = j && ve ? {
827
804
  orientation: tt,
828
805
  scrollPosition: r,
829
- maxScrollPosition: G,
806
+ maxScrollPosition: Z,
830
807
  contentSize: t,
831
808
  viewportSize: e,
832
- thumbSize: de,
809
+ thumbSize: ue,
833
810
  thumbPosition: me,
834
811
  thumbCenter: Ge,
835
- trackSize: x,
812
+ trackSize: b,
836
813
  isDragging: k,
837
- isTapScrollActive: V,
814
+ isTapScrollActive: C,
838
815
  visibleStartIndex: F,
839
816
  visibleEndIndex: Te
840
817
  } : null;
841
818
  return /* @__PURE__ */ qt(
842
819
  "div",
843
820
  {
844
- className: Ct("aqvs-scrollbar", dt, R),
821
+ className: Nt("aqvs-scrollbar", dt, R),
845
822
  style: {
846
823
  // 自己計測ペインの縦バーはインライン主軸寸を書かない (ラチェット遮断 — ペイン仕様 §2.5)。
847
824
  // 横バーは stretch が主軸を寸法決めできないため常に書く
848
- ...g && !c ? {} : { [fe]: e },
849
- [xt]: b
825
+ ...g && !l ? {} : { [fe]: e },
826
+ [xt]: x
850
827
  },
851
828
  "data-visible": ve ? "true" : "false",
852
829
  role: "scrollbar",
@@ -854,17 +831,17 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
854
831
  "aria-controls": T,
855
832
  "aria-valuenow": r,
856
833
  "aria-valuemin": 0,
857
- "aria-valuemax": G,
858
- "aria-orientation": c ? "horizontal" : "vertical",
834
+ "aria-valuemax": Z,
835
+ "aria-orientation": l ? "horizontal" : "vertical",
859
836
  children: [
860
- (!c || f) && ve && at && /* @__PURE__ */ U(
861
- Ur,
837
+ (!l || f) && ve && at && /* @__PURE__ */ U(
838
+ jr,
862
839
  {
863
- axis: c ? "x" : "y",
840
+ axis: l ? "x" : "y",
864
841
  ref: y,
865
- className: Ct("aqvs-scrollbar-tap-circle-wrapper", Be),
842
+ className: Nt("aqvs-scrollbar-tap-circle-wrapper", Ye),
866
843
  size: et,
867
- maxVisualDistance: Nt,
844
+ maxVisualDistance: Vt,
868
845
  style: Wt,
869
846
  opacity: It,
870
847
  renderVisual: Re,
@@ -872,56 +849,56 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
872
849
  },
873
850
  "tap-circle"
874
851
  ),
875
- Ht(-1, Qe[0], O[0], "arrow-start"),
852
+ Ht(-1, Qe[0], _[0], "arrow-start"),
876
853
  /* @__PURE__ */ qt(
877
854
  "div",
878
855
  {
879
856
  className: "aqvs-scrollbar-track",
880
857
  style: {
881
- borderRadius: b / 2
858
+ borderRadius: x / 2
882
859
  },
883
860
  onPointerDown: Bt,
884
861
  onPointerMove: Lt,
885
862
  onPointerUp: Zt,
886
- onPointerCancel: sr,
863
+ onPointerCancel: or,
887
864
  onLostPointerCapture: Ee,
888
865
  "aria-disabled": !s,
889
866
  children: [
890
- bt && /* @__PURE__ */ U("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: Z?.(bt) }, "overlay"),
867
+ bt && /* @__PURE__ */ U("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: j?.(bt) }, "overlay"),
891
868
  /* @__PURE__ */ U(
892
869
  "div",
893
870
  {
894
871
  className: "aqvs-scrollbar-thumb-wrapper",
895
872
  style: {
896
- [fe]: de,
873
+ [fe]: ue,
897
874
  [M]: me,
898
- ...c ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
875
+ ...l ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
899
876
  },
900
877
  "data-visible": ve || k ? "true" : "false",
901
878
  onPointerDown: lr,
902
879
  role: "slider",
903
- "aria-orientation": c ? "horizontal" : "vertical",
880
+ "aria-orientation": l ? "horizontal" : "vertical",
904
881
  "aria-valuenow": r,
905
882
  "aria-valuemin": 0,
906
- "aria-valuemax": G,
883
+ "aria-valuemax": Z,
907
884
  "aria-disabled": !i,
908
885
  tabIndex: -1,
909
886
  children: /* @__PURE__ */ U(
910
887
  "div",
911
888
  {
912
889
  ref: B,
913
- className: Ct("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
890
+ className: Nt("aqvs-scrollbar-thumb", l ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
914
891
  "data-testid": "aqvs-scrollbar-thumb",
915
892
  "data-thumb-state": Ie,
916
893
  style: {
917
- borderRadius: b - 1,
894
+ borderRadius: x - 1,
918
895
  cursor: i ? "pointer" : "default"
919
896
  },
920
897
  onMouseEnter: () => {
921
- i && E(!0);
898
+ i && P(!0);
922
899
  },
923
900
  onMouseLeave: () => {
924
- i && E(!1);
901
+ i && P(!1);
925
902
  }
926
903
  },
927
904
  "thumb"
@@ -933,24 +910,24 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
933
910
  },
934
911
  "track"
935
912
  ),
936
- Ht(1, Qe[1], O[1], "arrow-end")
913
+ Ht(1, Qe[1], _[1], "arrow-end")
937
914
  ]
938
915
  }
939
916
  );
940
- }, ri = ({ offsetX: t, offsetY: e, maxDistance: r, x: n, y: i }) => {
941
- const s = Number.isFinite(t) ? t : 0, o = Number.isFinite(e) ? e : 0, c = Math.hypot(s, o);
942
- if (c === 0)
917
+ }, oi = ({ offsetX: t, offsetY: e, maxDistance: r, x: n, y: i }) => {
918
+ const s = Number.isFinite(t) ? t : 0, o = Number.isFinite(e) ? e : 0, l = Math.hypot(s, o);
919
+ if (l === 0)
943
920
  return { x: 0, y: 0 };
944
- const f = Yr({
945
- distance: c,
921
+ const f = Wr({
922
+ distance: l,
946
923
  maxDistance: r,
947
924
  viewportSize: n.viewportSize,
948
925
  minSpeedMultiplier: n.minSpeedMultiplier,
949
926
  maxSpeedMultiplier: n.maxSpeedMultiplier,
950
927
  hasCustomMaxSpeedMultiplier: n.hasCustomMaxSpeedMultiplier,
951
928
  curve: n.curve
952
- }), g = Yr({
953
- distance: c,
929
+ }), g = Wr({
930
+ distance: l,
954
931
  maxDistance: r,
955
932
  viewportSize: i.viewportSize,
956
933
  minSpeedMultiplier: i.minSpeedMultiplier,
@@ -958,8 +935,8 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
958
935
  hasCustomMaxSpeedMultiplier: i.hasCustomMaxSpeedMultiplier,
959
936
  curve: i.curve
960
937
  });
961
- return { x: f * s / c, y: g * o / c };
962
- }, Vi = (t) => {
938
+ return { x: f * s / l, y: g * o / l };
939
+ }, Oi = (t) => {
963
940
  const { quantum: e, resetOnDirectionChange: r = !0 } = t;
964
941
  if (!(Number.isFinite(e) && e > 0))
965
942
  throw new TypeError(`[createResidualQuantizer] quantum must be a finite positive number, received ${e}`);
@@ -977,7 +954,7 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
977
954
  n = 0;
978
955
  }
979
956
  };
980
- }, ni = 16, an = (t, e, r) => e === 1 ? t * ni : e === 2 ? t * r : t, ii = (t, e) => {
957
+ }, ai = 16, ln = (t, e, r) => e === 1 ? t * ai : e === 2 ? t * r : t, ci = (t, e) => {
981
958
  const r = t.shiftKey && t.deltaX === 0, n = r ? t.deltaY : t.deltaX, i = r ? 0 : t.deltaY, s = n !== 0 && Math.abs(n) >= Math.abs(i);
982
959
  return {
983
960
  // ❗ ズームでもデルタは潰さない。ここは**事実だけ**を報告し、「横取りしない」という
@@ -986,21 +963,21 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
986
963
  // どのテストも検出できなくなる (変異解析で実証済み)。
987
964
  isZoomGesture: t.ctrlKey,
988
965
  isHorizontalDominant: s,
989
- horizontalDelta: an(n, t.deltaMode, e),
990
- verticalDelta: an(i, t.deltaMode, e)
966
+ horizontalDelta: ln(n, t.deltaMode, e),
967
+ verticalDelta: ln(i, t.deltaMode, e)
991
968
  };
992
- }, Tn = /* @__PURE__ */ new WeakSet(), ln = (t) => {
993
- Tn.add(t);
994
- }, si = (t) => Tn.has(t), oi = ["mouse", "pen", "touch"], Or = (t, e) => !(t === "mouse" || t === "pen" || t === "touch") || e.includes(t), ai = (t) => t === "mouse" || t === "pen", xr = {
969
+ }, zn = /* @__PURE__ */ new WeakSet(), un = (t) => {
970
+ zn.add(t);
971
+ }, li = (t) => zn.has(t), ui = ["mouse", "pen", "touch"], Fr = (t, e) => !(t === "mouse" || t === "pen" || t === "touch") || e.includes(t), di = (t) => t === "mouse" || t === "pen", br = {
995
972
  maxVelocity: 6,
996
973
  minVelocity: 0.02,
997
974
  deceleration: 25e-4,
998
975
  velocitySampleWindow: 90,
999
976
  startVelocityThreshold: 0.04
1000
- }, Rr = (t, e, r) => {
977
+ }, Er = (t, e, r) => {
1001
978
  for (const [n, i, s] of e)
1002
979
  r === "add" ? t.addEventListener(n, i, s) : t.removeEventListener(n, i, s);
1003
- }, li = Cr(
980
+ }, fi = Cr(
1004
981
  ({
1005
982
  children: t,
1006
983
  contentSize: e,
@@ -1009,15 +986,15 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1009
986
  scrollBarWidth: i = 12,
1010
987
  enableThumbDrag: s = !0,
1011
988
  enableTrackClick: o = !0,
1012
- enableArrowButtons: c = !0,
989
+ enableArrowButtons: l = !0,
1013
990
  enablePointerDrag: f = !0,
1014
- pointerDragInputs: g = oi,
1015
- onScroll: b,
991
+ pointerDragInputs: g = ui,
992
+ onScroll: x,
1016
993
  className: R,
1017
994
  testId: T,
1018
995
  style: S,
1019
- background: C,
1020
- tapScrollCircleOptions: Z,
996
+ background: N,
997
+ tapScrollCircleOptions: j,
1021
998
  inertiaOptions: F,
1022
999
  itemCount: Te,
1023
1000
  renderThumbOverlay: ze,
@@ -1025,60 +1002,60 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1025
1002
  overscrollBehavior: k = "auto",
1026
1003
  onWheelHorizontal: ce,
1027
1004
  onPanHorizontal: L,
1028
- contentInsets: E,
1029
- visibleStartIndex: V,
1030
- visibleEndIndex: J,
1005
+ contentInsets: P,
1006
+ visibleStartIndex: C,
1007
+ visibleEndIndex: K,
1031
1008
  renderOverlay: B,
1032
1009
  initialScrollPosition: H = 0,
1033
- contentProps: Q,
1034
- locale: oe,
1010
+ contentProps: J,
1011
+ locale: ie,
1035
1012
  labels: ge
1036
- }, Xe) => {
1037
- const y = d(Number.isFinite(H) ? Math.max(0, H) : 0), se = d(null), ne = d(null), Le = r === void 0, [te, Ye] = ke(0), xe = r ?? te, ie = d(null);
1013
+ }, $e) => {
1014
+ const y = d(Number.isFinite(H) ? Math.max(0, H) : 0), re = d(null), ne = d(null), Xe = r === void 0, [de, Ue] = _e(0), xe = r ?? de, te = d(null);
1038
1015
  Je(() => {
1039
- if (!Le)
1016
+ if (!Xe)
1040
1017
  return;
1041
- const x = ne.current;
1042
- if (!x)
1018
+ const b = ne.current;
1019
+ if (!b)
1043
1020
  return;
1044
- const N = () => {
1045
- const G = x.offsetHeight;
1046
- if (G > 0) {
1047
- Ye((ae) => ae === G ? ae : G);
1021
+ const V = () => {
1022
+ const Z = b.offsetHeight;
1023
+ if (Z > 0) {
1024
+ Ue((se) => se === Z ? se : Z);
1048
1025
  return;
1049
1026
  }
1050
- x.offsetParent !== null && e > 0 && ie.current !== "zero" && (ie.current = "zero", A.warn("[ScrollPane] The self-measured viewport is 0px. Give the scroll pane's host element a definite height (e.g. h-full, flex-1 + min-h-0, an explicit px height), or pass viewportSize explicitly."));
1027
+ b.offsetParent !== null && e > 0 && te.current !== "zero" && (te.current = "zero", A.warn("[ScrollPane] The self-measured viewport is 0px. Give the scroll pane's host element a definite height (e.g. h-full, flex-1 + min-h-0, an explicit px height), or pass viewportSize explicitly."));
1051
1028
  };
1052
- if (N(), typeof ResizeObserver != "function")
1029
+ if (V(), typeof ResizeObserver != "function")
1053
1030
  return;
1054
- const de = new ResizeObserver(N);
1055
- return de.observe(x), () => {
1056
- de.disconnect();
1031
+ const ue = new ResizeObserver(V);
1032
+ return ue.observe(b), () => {
1033
+ ue.disconnect();
1057
1034
  };
1058
- }, [e, Le]), Je(() => {
1059
- Le && n?.(te);
1060
- }, [Le, te, n]), Je(() => {
1061
- if (Le)
1035
+ }, [e, Xe]), Je(() => {
1036
+ Xe && n?.(de);
1037
+ }, [Xe, de, n]), Je(() => {
1038
+ if (Xe)
1062
1039
  return;
1063
- const x = se.current;
1064
- if (!x)
1040
+ const b = re.current;
1041
+ if (!b)
1065
1042
  return;
1066
- const N = () => {
1067
- const G = x.clientHeight;
1068
- if (G <= 0 || Math.abs(G - xe) <= 1)
1043
+ const V = () => {
1044
+ const Z = b.clientHeight;
1045
+ if (Z <= 0 || Math.abs(Z - xe) <= 1)
1069
1046
  return;
1070
- const ae = `${xe}/${G}`;
1071
- ie.current !== ae && (ie.current = ae, A.warn(
1072
- `[ScrollPane] viewportSize=${xe} but the host band is ${G}px. The clip window, max scroll position, thumb mapping, rendered row count and scrollability all derive from viewportSize, so they are now wrong. Omit viewportSize to let the pane measure itself.`
1047
+ const se = `${xe}/${Z}`;
1048
+ te.current !== se && (te.current = se, A.warn(
1049
+ `[ScrollPane] viewportSize=${xe} but the host band is ${Z}px. The clip window, max scroll position, thumb mapping, rendered row count and scrollability all derive from viewportSize, so they are now wrong. Omit viewportSize to let the pane measure itself.`
1073
1050
  ));
1074
1051
  };
1075
- if (N(), typeof ResizeObserver != "function")
1052
+ if (V(), typeof ResizeObserver != "function")
1076
1053
  return;
1077
- const de = new ResizeObserver(N);
1078
- return de.observe(x), () => {
1079
- de.disconnect();
1054
+ const ue = new ResizeObserver(V);
1055
+ return ue.observe(b), () => {
1056
+ ue.disconnect();
1080
1057
  };
1081
- }, [Le, xe]);
1058
+ }, [Xe, xe]);
1082
1059
  const Qe = d(ce);
1083
1060
  X(() => {
1084
1061
  Qe.current = ce;
@@ -1094,161 +1071,161 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1094
1071
  generation: 0
1095
1072
  }), wt = Me(
1096
1073
  () => ({
1097
- maxVelocity: F?.maxVelocity ?? xr.maxVelocity,
1098
- minVelocity: F?.minVelocity ?? xr.minVelocity,
1099
- deceleration: F?.deceleration ?? xr.deceleration,
1100
- velocitySampleWindow: F?.velocitySampleWindow ?? xr.velocitySampleWindow,
1101
- startVelocityThreshold: F?.startVelocityThreshold ?? xr.startVelocityThreshold
1074
+ maxVelocity: F?.maxVelocity ?? br.maxVelocity,
1075
+ minVelocity: F?.minVelocity ?? br.minVelocity,
1076
+ deceleration: F?.deceleration ?? br.deceleration,
1077
+ velocitySampleWindow: F?.velocitySampleWindow ?? br.velocitySampleWindow,
1078
+ startVelocityThreshold: F?.startVelocityThreshold ?? br.startVelocityThreshold
1102
1079
  }),
1103
1080
  [F]
1104
1081
  ), qe = Me(() => ({
1105
- top: Math.max(0, E?.top ?? 0),
1106
- bottom: Math.max(0, E?.bottom ?? 0)
1107
- }), [E]);
1082
+ top: Math.max(0, P?.top ?? 0),
1083
+ bottom: Math.max(0, P?.bottom ?? 0)
1084
+ }), [P]);
1108
1085
  A.debug("[ScrollPane] ScrollPane rendered", () => ({
1109
1086
  contentSize: e,
1110
1087
  viewportSize: xe,
1111
1088
  scrollBarWidth: i,
1112
1089
  className: R,
1113
1090
  style: S,
1114
- tapScrollCircleOptions: Z,
1091
+ tapScrollCircleOptions: j,
1115
1092
  inertiaOptions: F,
1116
1093
  enablePointerDrag: f,
1117
1094
  contentInsets: qe
1118
1095
  }));
1119
- const Be = d({ contentSize: e, viewportSize: xe }), Ce = Me(() => e > xe, [e, xe]), lt = w(
1120
- (x, N) => {
1121
- let de = N ?? Be.current;
1122
- N && !(Number.isFinite(N.contentSize) && Number.isFinite(N.viewportSize)) && (A.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: N }), de = Be.current);
1123
- const { contentSize: G, viewportSize: ae } = de, me = G > ae, Ge = y.current;
1124
- if (A.debug("[ScrollPane] scrollTo called", () => ({ newPosition: x, contentSize: G, viewportSize: ae, currentIsScrollable: me, prevPosition: Ge })), !me)
1125
- return y.current !== 0 && (y.current = 0, b?.(0, Ge)), y.current;
1126
- const ve = typeof x == "function" ? x(y.current) : x;
1096
+ const Ye = d({ contentSize: e, viewportSize: xe }), Ne = Me(() => e > xe, [e, xe]), ct = w(
1097
+ (b, V) => {
1098
+ let ue = V ?? Ye.current;
1099
+ V && !(Number.isFinite(V.contentSize) && Number.isFinite(V.viewportSize)) && (A.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: V }), ue = Ye.current);
1100
+ const { contentSize: Z, viewportSize: se } = ue, me = Z > se, Ge = y.current;
1101
+ if (A.debug("[ScrollPane] scrollTo called", () => ({ newPosition: b, contentSize: Z, viewportSize: se, currentIsScrollable: me, prevPosition: Ge })), !me)
1102
+ return y.current !== 0 && (y.current = 0, x?.(0, Ge)), y.current;
1103
+ const ve = typeof b == "function" ? b(y.current) : b;
1127
1104
  if (!Number.isFinite(ve))
1128
1105
  return A.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: ve }), y.current;
1129
- const We = Math.max(G - ae, 0), Ie = re(ve, 0, We);
1130
- return y.current !== Ie && (y.current = Ie, b?.(Ie, Ge)), y.current;
1106
+ const Be = Math.max(Z - se, 0), Ie = ee(ve, 0, Be);
1107
+ return y.current !== Ie && (y.current = Ie, x?.(Ie, Ge)), y.current;
1131
1108
  },
1132
- [b]
1133
- ), ee = d(lt);
1109
+ [x]
1110
+ ), Q = d(ct);
1134
1111
  X(() => {
1135
- ee.current = lt;
1136
- }, [lt]);
1137
- const Oe = w(() => {
1138
- const x = et.current;
1139
- x.generation += 1, x.frame !== null && cancelAnimationFrame(x.frame), x.frame = null, x.velocity = 0, x.lastTimestamp = null;
1140
- }, []), Re = d(Oe);
1112
+ Q.current = ct;
1113
+ }, [ct]);
1114
+ const Le = w(() => {
1115
+ const b = et.current;
1116
+ b.generation += 1, b.frame !== null && cancelAnimationFrame(b.frame), b.frame = null, b.velocity = 0, b.lastTimestamp = null;
1117
+ }, []), Re = d(Le);
1141
1118
  X(() => {
1142
- Re.current = Oe;
1143
- }, [Oe]), X(() => () => {
1119
+ Re.current = Le;
1120
+ }, [Le]), X(() => () => {
1144
1121
  Re.current();
1145
1122
  }, []);
1146
- const ue = w(
1147
- (x) => {
1148
- if (!Ce)
1123
+ const le = w(
1124
+ (b) => {
1125
+ if (!Ne)
1149
1126
  return;
1150
- const { maxVelocity: N, minVelocity: de, deceleration: G, startVelocityThreshold: ae } = wt, me = re(x, -N, N);
1151
- if (Math.abs(me) < ae)
1127
+ const { maxVelocity: V, minVelocity: ue, deceleration: Z, startVelocityThreshold: se } = wt, me = ee(b, -V, V);
1128
+ if (Math.abs(me) < se)
1152
1129
  return;
1153
- Oe(), et.current.velocity = me, et.current.lastTimestamp = null;
1154
- const Ge = et.current.generation, ve = (We) => {
1130
+ Le(), et.current.velocity = me, et.current.lastTimestamp = null;
1131
+ const Ge = et.current.generation, ve = (Be) => {
1155
1132
  const Ie = et.current;
1156
1133
  if (Ie.generation !== Ge)
1157
1134
  return;
1158
1135
  if (Ie.lastTimestamp === null) {
1159
- Ie.lastTimestamp = We, Ie.frame = requestAnimationFrame(ve);
1136
+ Ie.lastTimestamp = Be, Ie.frame = requestAnimationFrame(ve);
1160
1137
  return;
1161
1138
  }
1162
- const _e = We - Ie.lastTimestamp;
1163
- if (Ie.lastTimestamp = We, _e <= 0) {
1139
+ const Oe = Be - Ie.lastTimestamp;
1140
+ if (Ie.lastTimestamp = Be, Oe <= 0) {
1164
1141
  Ie.frame = requestAnimationFrame(ve);
1165
1142
  return;
1166
1143
  }
1167
1144
  const mt = Ie.velocity;
1168
1145
  let rt = mt;
1169
- const nt = G * _e;
1146
+ const nt = Z * Oe;
1170
1147
  mt > 0 ? rt = Math.max(0, mt - nt) : mt < 0 && (rt = Math.min(0, mt + nt));
1171
- const ct = (mt + rt) / 2 * _e, we = y.current;
1172
- if (ct !== 0 && ee.current((it) => it + ct), et.current.generation !== Ge)
1148
+ const lt = (mt + rt) / 2 * Oe, we = y.current;
1149
+ if (lt !== 0 && Q.current((it) => it + lt), et.current.generation !== Ge)
1173
1150
  return;
1174
- const pe = y.current, { contentSize: Mt, viewportSize: m } = Be.current, z = Math.max(Mt - m, 0);
1151
+ const pe = y.current, { contentSize: Mt, viewportSize: m } = Ye.current, z = Math.max(Mt - m, 0);
1175
1152
  Ie.velocity = rt;
1176
1153
  const Pe = pe === we || pe <= 0 && rt <= 0 || pe >= z && rt >= 0;
1177
- if (Math.abs(rt) < de || Pe) {
1178
- Oe();
1154
+ if (Math.abs(rt) < ue || Pe) {
1155
+ Le();
1179
1156
  return;
1180
1157
  }
1181
1158
  Ie.frame = requestAnimationFrame(ve);
1182
1159
  };
1183
1160
  et.current.frame = requestAnimationFrame(ve);
1184
1161
  },
1185
- [Ce, wt, Oe]
1186
- ), be = d(ue);
1162
+ [Ne, wt, Le]
1163
+ ), be = d(le);
1187
1164
  X(() => {
1188
- be.current = ue;
1189
- }, [ue]), Je(() => {
1190
- Be.current = { contentSize: e, viewportSize: xe };
1165
+ be.current = le;
1166
+ }, [le]), Je(() => {
1167
+ Ye.current = { contentSize: e, viewportSize: xe };
1191
1168
  }, [e, xe]), Je(() => {
1192
- const x = ne.current;
1193
- if (!x) return;
1194
- const N = () => {
1195
- x.scrollTop !== 0 && (A.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: x.scrollTop })), x.scrollTop = 0), x.scrollLeft !== 0 && (x.scrollLeft = 0);
1169
+ const b = ne.current;
1170
+ if (!b) return;
1171
+ const V = () => {
1172
+ b.scrollTop !== 0 && (A.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: b.scrollTop })), b.scrollTop = 0), b.scrollLeft !== 0 && (b.scrollLeft = 0);
1196
1173
  };
1197
- return x.addEventListener("scroll", N), () => x.removeEventListener("scroll", N);
1174
+ return b.addEventListener("scroll", V), () => b.removeEventListener("scroll", V);
1198
1175
  }, []), Je(() => {
1199
- if (Ce) {
1176
+ if (Ne) {
1200
1177
  A.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: xe, scrollPosition: y.current }));
1201
- const x = re(e - xe, 0, e);
1202
- y.current > x && lt(x);
1178
+ const b = ee(e - xe, 0, e);
1179
+ y.current > b && ct(b);
1203
1180
  } else
1204
- lt(0);
1205
- }, [Ce, lt, e, xe]);
1206
- const fe = d({ isScrollable: Ce, viewportSize: xe, wheelSpeedMultiplier: D, overscrollBehavior: k });
1181
+ ct(0);
1182
+ }, [Ne, ct, e, xe]);
1183
+ const fe = d({ isScrollable: Ne, viewportSize: xe, wheelSpeedMultiplier: D, overscrollBehavior: k });
1207
1184
  Je(() => {
1208
- fe.current = { isScrollable: Ce, viewportSize: xe, wheelSpeedMultiplier: D, overscrollBehavior: k };
1209
- }, [Ce, xe, D, k]);
1185
+ fe.current = { isScrollable: Ne, viewportSize: xe, wheelSpeedMultiplier: D, overscrollBehavior: k };
1186
+ }, [Ne, xe, D, k]);
1210
1187
  const xt = w(
1211
- (x) => {
1212
- if (si(x))
1188
+ (b) => {
1189
+ if (li(b))
1213
1190
  return !1;
1214
- const { isScrollable: N, viewportSize: de, wheelSpeedMultiplier: G, overscrollBehavior: ae } = fe.current, me = ii(x, de);
1191
+ const { isScrollable: V, viewportSize: ue, wheelSpeedMultiplier: Z, overscrollBehavior: se } = fe.current, me = ci(b, ue);
1215
1192
  if (me.isZoomGesture)
1216
1193
  return !1;
1217
1194
  if (me.isHorizontalDominant)
1218
- return Qe.current ? (ln(x), x.preventDefault(), Oe(), Qe.current(me.horizontalDelta), !0) : !1;
1219
- if (!N || me.verticalDelta === 0)
1195
+ return Qe.current ? (un(b), b.preventDefault(), Le(), Qe.current(me.horizontalDelta), !0) : !1;
1196
+ if (!V || me.verticalDelta === 0)
1220
1197
  return !1;
1221
1198
  let Ge = me.verticalDelta;
1222
- if (G !== 1 && (Ge *= G), ae !== "contain") {
1223
- const ve = y.current, We = Math.max(Be.current.contentSize - de, 0);
1224
- if (Ge > 0 && ve >= We || Ge < 0 && ve <= 0)
1199
+ if (Z !== 1 && (Ge *= Z), se !== "contain") {
1200
+ const ve = y.current, Be = Math.max(Ye.current.contentSize - ue, 0);
1201
+ if (Ge > 0 && ve >= Be || Ge < 0 && ve <= 0)
1225
1202
  return !1;
1226
1203
  }
1227
- return ln(x), x.preventDefault(), Oe(), A.debug("[ScrollPane] wheel event", () => ({ deltaY: Ge, scrollPosition: y.current, wheelSpeedMultiplier: G, deltaMode: x.deltaMode, scrollTop: ne.current?.scrollTop })), lt((ve) => ve + Ge), !0;
1204
+ return un(b), b.preventDefault(), Le(), A.debug("[ScrollPane] wheel event", () => ({ deltaY: Ge, scrollPosition: y.current, wheelSpeedMultiplier: Z, deltaMode: b.deltaMode, scrollTop: ne.current?.scrollTop })), ct((ve) => ve + Ge), !0;
1228
1205
  },
1229
- [lt, Oe]
1206
+ [ct, Le]
1230
1207
  );
1231
1208
  X(() => {
1232
- const x = (G) => {
1233
- xt(G);
1234
- }, N = () => {
1235
- Oe();
1236
- }, de = se.current;
1237
- return de && (de.addEventListener("wheel", x, { passive: !1 }), de.addEventListener("pointerdown", N, { capture: !0, passive: !0 })), () => {
1238
- de && (de.removeEventListener("wheel", x), de.removeEventListener("pointerdown", N, { capture: !0 }));
1209
+ const b = (Z) => {
1210
+ xt(Z);
1211
+ }, V = () => {
1212
+ Le();
1213
+ }, ue = re.current;
1214
+ return ue && (ue.addEventListener("wheel", b, { passive: !1 }), ue.addEventListener("pointerdown", V, { capture: !0, passive: !0 })), () => {
1215
+ ue && (ue.removeEventListener("wheel", b), ue.removeEventListener("pointerdown", V, { capture: !0 }));
1239
1216
  };
1240
- }, [xt, Oe]), Nr(
1241
- Xe,
1217
+ }, [xt, Le]), Ar(
1218
+ $e,
1242
1219
  () => ({
1243
- scrollTo: (x, N) => (Oe(), lt(x, N)),
1220
+ scrollTo: (b, V) => (Le(), ct(b, V)),
1244
1221
  getScrollPosition: () => y.current,
1245
1222
  getContentSize: () => e,
1246
1223
  getViewportSize: () => xe,
1247
1224
  applyWheel: xt
1248
1225
  }),
1249
- [lt, e, xe, Oe, xt]
1226
+ [ct, e, xe, Le, xt]
1250
1227
  );
1251
- const M = _n(), He = Q?.id ?? M, he = d({
1228
+ const M = $n(), Fe = J?.id ?? M, he = d({
1252
1229
  pointerType: "",
1253
1230
  pointerId: null,
1254
1231
  startClientY: 0,
@@ -1261,85 +1238,78 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1261
1238
  velocitySamples: [],
1262
1239
  scale: 1,
1263
1240
  scaleX: 1
1264
- }), O = d(f), dt = d(g);
1241
+ }), _ = d(f), dt = d(g);
1265
1242
  X(() => {
1266
- O.current = f;
1243
+ _.current = f;
1267
1244
  }, [f]), X(() => {
1268
1245
  dt.current = g;
1269
1246
  }, [g]);
1270
- const tt = d(Ce);
1247
+ const tt = d(Ne);
1271
1248
  X(() => {
1272
- tt.current = Ce;
1273
- }, [Ce]);
1274
- const Nt = d(wt);
1249
+ tt.current = Ne;
1250
+ }, [Ne]);
1251
+ const Vt = d(wt);
1275
1252
  X(() => {
1276
- Nt.current = wt;
1253
+ Vt.current = wt;
1277
1254
  }, [wt]), X(() => {
1278
- const x = he.current;
1279
- if (f && Ce && (x.pointerId === null || Or(x.pointerType, g)) || x.pointerId === null)
1255
+ const b = he.current;
1256
+ if (f && Ne && (b.pointerId === null || Fr(b.pointerType, g)) || b.pointerId === null)
1280
1257
  return;
1281
- const N = ne.current;
1282
- x.clickResetTimer !== null && (window.clearTimeout(x.clickResetTimer), x.clickResetTimer = null);
1283
- const de = x.isDragging && x.shouldCancelNextClick, G = x.pointerId;
1284
- x.pointerId = null, x.pointerType = "", x.startClientY = 0, x.startScroll = 0, x.isDragging = !1, x.shouldCancelNextClick = de, x.velocitySamples = [], x.scale = 1, N?.hasPointerCapture(G) && N.releasePointerCapture(G);
1285
- }, [f, g, Ce]), X(() => {
1286
- const x = ne.current;
1287
- if (!x)
1258
+ const V = ne.current;
1259
+ b.clickResetTimer !== null && (window.clearTimeout(b.clickResetTimer), b.clickResetTimer = null);
1260
+ const ue = b.isDragging && b.shouldCancelNextClick, Z = b.pointerId;
1261
+ b.pointerId = null, b.pointerType = "", b.startClientY = 0, b.startScroll = 0, b.isDragging = !1, b.shouldCancelNextClick = ue, b.velocitySamples = [], b.scale = 1, V !== null && sr(V, Z);
1262
+ }, [f, g, Ne]), X(() => {
1263
+ const b = ne.current;
1264
+ if (!b)
1288
1265
  return;
1289
- const N = 6, de = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), G = () => {
1266
+ const V = 6, ue = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), Z = () => {
1290
1267
  const m = he.current;
1291
1268
  m.pointerId = null, m.pointerType = "", m.startClientY = 0, m.startScroll = 0, m.isDragging = !1, m.velocitySamples = [], m.scale = 1;
1292
- }, ae = () => {
1269
+ }, se = () => {
1293
1270
  const m = he.current;
1294
1271
  m.clickResetTimer !== null && (window.clearTimeout(m.clickResetTimer), m.clickResetTimer = null);
1295
1272
  }, me = (m) => {
1296
- const z = he.current, Pe = de();
1273
+ const z = he.current, Pe = ue();
1297
1274
  z.velocitySamples.push({ clientY: m, time: Pe });
1298
- const it = Nt.current.velocitySampleWindow;
1299
- z.velocitySamples = z.velocitySamples.filter((Ne) => Pe - Ne.time <= it);
1275
+ const it = Vt.current.velocitySampleWindow;
1276
+ z.velocitySamples = z.velocitySamples.filter((Ve) => Pe - Ve.time <= it);
1300
1277
  }, Ge = (m) => m instanceof HTMLElement && m.closest("[data-scrollpane-ignore-drag='true']") !== null, ve = (m) => {
1301
1278
  const z = he.current;
1302
1279
  z.shouldCancelNextClick && (m.preventDefault(), m.stopPropagation(), z.shouldCancelNextClick = !1);
1303
- }, We = (m) => {
1280
+ }, Be = (m) => {
1304
1281
  const z = he.current;
1305
- if (!z.isDragging) {
1306
- if (z.isDragging = !0, z.shouldCancelNextClick = !0, !x.hasPointerCapture(m.pointerId))
1307
- try {
1308
- x.setPointerCapture(m.pointerId);
1309
- } catch {
1310
- }
1311
- me(m.clientY);
1312
- }
1313
- }, Ie = (m) => m.isTrusted || m.target === x, _e = (m) => {
1282
+ z.isDragging || (z.isDragging = !0, z.shouldCancelNextClick = !0, Tn(b, m.pointerId) || wr(b, m.pointerId), me(m.clientY));
1283
+ }, Ie = (m) => m.isTrusted || m.target === b, Oe = (m) => {
1314
1284
  const z = he.current;
1315
- x.hasPointerCapture(m) && x.releasePointerCapture(m), z.shouldCancelNextClick = !1, ae(), G();
1285
+ sr(b, m), z.shouldCancelNextClick = !1, se(), Z();
1316
1286
  }, mt = (m) => {
1317
1287
  const z = he.current;
1318
1288
  if (z.pointerId !== m.pointerId)
1319
1289
  return;
1320
- if (m.buttons === 0 && ai(m.pointerType)) {
1321
- _e(m.pointerId);
1290
+ if (m.buttons === 0 && di(m.pointerType)) {
1291
+ Oe(m.pointerId);
1322
1292
  return;
1323
1293
  }
1324
- if (!(O.current && tt.current) || !Or(m.pointerType, dt.current))
1294
+ if (!(_.current && tt.current) || !Fr(m.pointerType, dt.current))
1325
1295
  return;
1326
1296
  if (!z.isDragging) {
1327
1297
  const Pt = Math.abs(m.clientY - z.startClientY), st = at.current ? Math.abs(m.clientX - z.startClientX) : 0;
1328
- if (Math.max(Pt, st) < N || (We(m), !z.isDragging))
1298
+ if (Math.max(Pt, st) < V || (Be(m), !z.isDragging))
1329
1299
  return;
1330
1300
  }
1331
1301
  me(m.clientY);
1332
1302
  const Pe = (m.clientY - z.startClientY) / (z.scale || 1), it = z.startScroll - Pe;
1333
- ee.current(it);
1334
- const Ne = at.current;
1335
- if (Ne) {
1303
+ Q.current(it);
1304
+ const Ve = at.current;
1305
+ if (Ve) {
1336
1306
  const Pt = m.clientX - z.lastPanClientX;
1337
- z.lastPanClientX = m.clientX, Pt !== 0 && Ne(-Pt / (z.scaleX || 1));
1307
+ z.lastPanClientX = m.clientX, Pt !== 0 && Ve(-Pt / (z.scaleX || 1));
1338
1308
  }
1339
1309
  m.cancelable && m.preventDefault();
1340
1310
  }, rt = () => {
1341
1311
  const m = he.current;
1342
- return m.pointerId !== null || !m.shouldCancelNextClick ? !1 : (ae(), m.clickResetTimer = window.setTimeout(() => {
1312
+ return m.pointerId !== null || !m.shouldCancelNextClick ? !1 : (se(), m.clickResetTimer = window.setTimeout(() => {
1343
1313
  const z = he.current;
1344
1314
  z.shouldCancelNextClick = !1, z.clickResetTimer = null;
1345
1315
  }, 0), !0);
@@ -1352,69 +1322,69 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1352
1322
  z.isDragging && z.shouldCancelNextClick && m.cancelable && (m.preventDefault(), m.stopPropagation()), z.isDragging && me(m.clientY);
1353
1323
  let Pe = 0;
1354
1324
  if (z.isDragging && z.velocitySamples.length >= 2) {
1355
- const Ne = z.velocitySamples, Pt = Nt.current.velocitySampleWindow, st = Ne[Ne.length - 1], ut = Ne.find((Ve) => st.time - Ve.time <= Pt) ?? Ne[0];
1325
+ const Ve = z.velocitySamples, Pt = Vt.current.velocitySampleWindow, st = Ve[Ve.length - 1], ut = Ve.find((Ce) => st.time - Ce.time <= Pt) ?? Ve[0];
1356
1326
  if (st && ut && st.time !== ut.time) {
1357
- const Ve = st.clientY - ut.clientY, Yt = st.time - ut.time;
1358
- Pe = -(Ve / Yt) / (z.scale || 1);
1327
+ const Ce = st.clientY - ut.clientY, Yt = st.time - ut.time;
1328
+ Pe = -(Ce / Yt) / (z.scale || 1);
1359
1329
  }
1360
1330
  }
1361
- ae(), z.shouldCancelNextClick && (z.clickResetTimer = window.setTimeout(() => {
1362
- const Ne = he.current;
1363
- Ne.shouldCancelNextClick = !1, Ne.clickResetTimer = null;
1331
+ se(), z.shouldCancelNextClick && (z.clickResetTimer = window.setTimeout(() => {
1332
+ const Ve = he.current;
1333
+ Ve.shouldCancelNextClick = !1, Ve.clickResetTimer = null;
1364
1334
  }, 0));
1365
- const it = Nt.current.startVelocityThreshold;
1366
- G(), x.hasPointerCapture(m.pointerId) && x.releasePointerCapture(m.pointerId), Math.abs(Pe) >= it && be.current?.(Pe);
1367
- }, $e = (m) => {
1335
+ const it = Vt.current.startVelocityThreshold;
1336
+ Z(), sr(b, m.pointerId), Math.abs(Pe) >= it && be.current?.(Pe);
1337
+ }, ke = (m) => {
1368
1338
  if (he.current.pointerId !== null) {
1369
1339
  if (!m.isPrimary || m.pointerType !== he.current.pointerType)
1370
1340
  return;
1371
- _e(he.current.pointerId);
1341
+ Oe(he.current.pointerId);
1372
1342
  }
1373
- if (he.current.shouldCancelNextClick && (ae(), he.current.shouldCancelNextClick = !1), !(O.current && tt.current) || !Or(m.pointerType, dt.current) || m.button !== 0 && m.pointerType === "mouse" || m.ctrlKey || m.metaKey || m.altKey || Ge(m.target))
1343
+ if (he.current.shouldCancelNextClick && (se(), he.current.shouldCancelNextClick = !1), !(_.current && tt.current) || !Fr(m.pointerType, dt.current) || m.button !== 0 && m.pointerType === "mouse" || m.ctrlKey || m.metaKey || m.altKey || Ge(m.target))
1374
1344
  return;
1375
- window.dispatchEvent(new CustomEvent(vr, { detail: { paneId: M } })), Re.current?.();
1345
+ window.dispatchEvent(new CustomEvent(Sr, { detail: { paneId: M } })), Re.current?.();
1376
1346
  const z = he.current;
1377
- ae(), z.pointerId = m.pointerId, z.pointerType = m.pointerType, z.startClientY = m.clientY, z.startClientX = m.clientX, z.lastPanClientX = m.clientX, z.startScroll = y.current, z.scale = Xr(x, "y"), z.scaleX = at.current ? Xr(x, "x") : 1, z.isDragging = !1, z.shouldCancelNextClick = !1, z.velocitySamples = [];
1378
- }, ct = (m) => {
1347
+ se(), z.pointerId = m.pointerId, z.pointerType = m.pointerType, z.startClientY = m.clientY, z.startClientX = m.clientX, z.lastPanClientX = m.clientX, z.startScroll = y.current, z.scale = Yr(b, "y"), z.scaleX = at.current ? Yr(b, "x") : 1, z.isDragging = !1, z.shouldCancelNextClick = !1, z.velocitySamples = [];
1348
+ }, lt = (m) => {
1379
1349
  if (he.current.pointerId !== m.pointerId) {
1380
1350
  rt();
1381
1351
  return;
1382
1352
  }
1383
- Ie(m) && _e(m.pointerId);
1353
+ Ie(m) && Oe(m.pointerId);
1384
1354
  }, pe = [
1385
1355
  ["click", ve, !0],
1386
- ["pointerdown", $e, { passive: !1 }],
1356
+ ["pointerdown", ke, { passive: !1 }],
1387
1357
  ["lostpointercapture", (m) => {
1388
- m.target !== x || he.current.pointerId !== m.pointerId || _e(m.pointerId);
1358
+ m.target !== b || he.current.pointerId !== m.pointerId || Oe(m.pointerId);
1389
1359
  }, void 0]
1390
1360
  ], Mt = [
1391
1361
  ["pointermove", mt, { passive: !1 }],
1392
1362
  ["pointerup", nt, void 0],
1393
- ["pointercancel", ct, void 0]
1363
+ ["pointercancel", lt, void 0]
1394
1364
  ];
1395
- return Rr(x, pe, "add"), Rr(window, Mt, "add"), () => {
1396
- Rr(x, pe, "remove"), Rr(window, Mt, "remove");
1365
+ return Er(b, pe, "add"), Er(window, Mt, "add"), () => {
1366
+ Er(b, pe, "remove"), Er(window, Mt, "remove");
1397
1367
  const m = he.current;
1398
- m.pointerId !== null && x.hasPointerCapture(m.pointerId) && x.releasePointerCapture(m.pointerId), ae(), G();
1368
+ m.pointerId !== null && sr(b, m.pointerId), se(), Z();
1399
1369
  };
1400
1370
  }, [M]);
1401
1371
  const St = w(
1402
- (x) => (Oe(), lt(x)),
1403
- [lt, Oe]
1372
+ (b) => (Le(), ct(b)),
1373
+ [ct, Le]
1404
1374
  );
1405
- return /* @__PURE__ */ qt("div", { ref: se, "data-testid": T, "data-self-measured": Le ? "true" : void 0, className: Ct("aqvs-scroll-pane", R), style: S, children: [
1375
+ return /* @__PURE__ */ qt("div", { ref: re, "data-testid": T, "data-self-measured": Xe ? "true" : void 0, className: Nt("aqvs-scroll-pane", R), style: S, children: [
1406
1376
  /* @__PURE__ */ qt(
1407
1377
  "div",
1408
1378
  {
1409
1379
  ref: ne,
1410
- className: Ct("aqvs-scroll-pane-content"),
1380
+ className: Nt("aqvs-scroll-pane-content"),
1411
1381
  "data-testid": "aqvs-scroll-pane-content",
1412
1382
  style: {
1413
1383
  // ❗ 自己計測モードでは高さを書かない。CSS の `height: 100%` (= ルートの確定高さ) が
1414
1384
  // レイアウトを所有することで、「計測した値を書き戻して自分のサイズを変える」
1415
1385
  // フィードバックループが構造的に起こらず、初回 paint の時点でも帯は実寸で正しい
1416
1386
  // (数値の反映だけが 1 コミット遅れる)。明示モードは従来どおり px を書く。
1417
- height: Le ? void 0 : xe,
1387
+ height: Xe ? void 0 : xe,
1418
1388
  paddingTop: qe.top,
1419
1389
  paddingBottom: qe.bottom,
1420
1390
  // スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
@@ -1430,35 +1400,35 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1430
1400
  // 同一条件で揃えてあるため状態としても一貫している。
1431
1401
  // 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
1432
1402
  // (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
1433
- ...f && Ce && g.some((x) => x === "touch" || x === "pen") ? { touchAction: "none" } : {}
1403
+ ...f && Ne && g.some((b) => b === "touch" || b === "pen") ? { touchAction: "none" } : {}
1434
1404
  },
1435
- ...Q,
1436
- id: He,
1405
+ ...J,
1406
+ id: Fe,
1437
1407
  children: [
1438
- C,
1408
+ N,
1439
1409
  t(y.current)
1440
1410
  ]
1441
1411
  }
1442
1412
  ),
1443
1413
  /* @__PURE__ */ U(
1444
- yn,
1414
+ En,
1445
1415
  {
1446
1416
  contentSize: e,
1447
1417
  viewportSize: xe,
1448
- stretchMainSize: Le,
1418
+ stretchMainSize: Xe,
1449
1419
  scrollPosition: y.current,
1450
1420
  onScroll: St,
1451
1421
  enableThumbDrag: s,
1452
1422
  enableTrackClick: o,
1453
- enableArrowButtons: c,
1423
+ enableArrowButtons: l,
1454
1424
  scrollBarWidth: i,
1455
- ariaControls: He,
1456
- tapScrollCircleOptions: Z,
1425
+ ariaControls: Fe,
1426
+ tapScrollCircleOptions: j,
1457
1427
  itemCount: Te,
1458
1428
  renderThumbOverlay: ze,
1459
- visibleStartIndex: V,
1460
- visibleEndIndex: J,
1461
- locale: oe,
1429
+ visibleStartIndex: C,
1430
+ visibleEndIndex: K,
1431
+ locale: ie,
1462
1432
  labels: ge
1463
1433
  },
1464
1434
  "scrollbar"
@@ -1466,16 +1436,16 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1466
1436
  B?.()
1467
1437
  ] });
1468
1438
  }
1469
- ), cn = (t, e, r) => Math.min(Math.max(t, e), r), Ai = ({ dragState: t, normalizedDistance: e, sizeScale: r, size: n }) => {
1470
- const i = Math.max(n / 2, 1), s = 1 + e * 0.65, o = Math.max(0.65, 1 - e * 0.25), c = t.direction * e * 26 * r, f = 0.8 + e * 0.18, g = 3 * r, b = 6 * r, R = 22 * r, T = Math.abs(c) + b, S = c > 0 ? g : -Math.abs(c) - g, C = Math.max(2.5, 3 * r), Z = cn(t.offsetX, -i, i), F = cn(t.offsetY, -i, i), Te = i * 0.35, ze = Z / i * Te, D = F / i * Te, k = ze * 0.45, ce = D * 0.45, L = Math.max(R * 0.38, 6), E = 0.65 + e * 0.2, V = t.active;
1471
- return /* @__PURE__ */ qt(Wr, { children: [
1439
+ ), dn = (t, e, r) => Math.min(Math.max(t, e), r), _i = ({ dragState: t, normalizedDistance: e, sizeScale: r, size: n }) => {
1440
+ 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, x = 6 * r, R = 22 * r, T = Math.abs(l) + x, S = l > 0 ? g : -Math.abs(l) - g, N = Math.max(2.5, 3 * r), j = dn(t.offsetX, -i, i), F = dn(t.offsetY, -i, i), Te = i * 0.35, ze = j / i * Te, D = F / i * Te, k = ze * 0.45, ce = D * 0.45, L = Math.max(R * 0.38, 6), P = 0.65 + e * 0.2, C = t.active;
1441
+ return /* @__PURE__ */ qt(Gr, { children: [
1472
1442
  /* @__PURE__ */ U(
1473
1443
  "div",
1474
1444
  {
1475
1445
  className: "aqvs-tap-scroll-circle-gradient",
1476
1446
  style: {
1477
1447
  transform: `scale(${o}, ${s})`,
1478
- transition: V ? "40ms transform ease-out" : "200ms ease transform"
1448
+ transition: C ? "40ms transform ease-out" : "200ms ease transform"
1479
1449
  }
1480
1450
  }
1481
1451
  ),
@@ -1487,7 +1457,7 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1487
1457
  width: R,
1488
1458
  height: R,
1489
1459
  transform: `translate(calc(-50% + ${ze}px), calc(-50% + ${D}px)) scale(${o}, ${f * s})`,
1490
- transition: V ? "70ms transform ease-out" : "200ms ease transform"
1460
+ transition: C ? "70ms transform ease-out" : "200ms ease transform"
1491
1461
  }
1492
1462
  }
1493
1463
  ),
@@ -1499,9 +1469,9 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1499
1469
  width: L,
1500
1470
  height: L,
1501
1471
  transform: `translate(calc(-50% + ${k}px), calc(-50% + ${ce}px)) scale(${o}, ${s})`,
1502
- opacity: E,
1472
+ opacity: P,
1503
1473
  boxShadow: "0 0 8px rgba(255,255,255,0.45)",
1504
- transition: V ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1474
+ transition: C ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1505
1475
  }
1506
1476
  }
1507
1477
  ),
@@ -1510,25 +1480,25 @@ const re = (t, e, r) => Math.max(e, Math.min(r, t)), Xr = (t, e) => {
1510
1480
  {
1511
1481
  className: "aqvs-sample-visual-rod",
1512
1482
  style: {
1513
- width: C,
1483
+ width: N,
1514
1484
  height: T,
1515
1485
  transform: `translate(-50%, ${S}px)`,
1516
1486
  opacity: e,
1517
- transition: V ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1487
+ transition: C ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1518
1488
  }
1519
1489
  }
1520
1490
  )
1521
1491
  ] });
1522
- }, dr = 100, ci = (t) => {
1492
+ }, fr = 100, hi = (t) => {
1523
1493
  if (!Number.isFinite(t))
1524
1494
  return 0n;
1525
1495
  const e = Math.trunc(t);
1526
1496
  return e <= 0 ? 0n : BigInt(e);
1527
- }, _r = (t, e) => {
1497
+ }, kr = (t, e) => {
1528
1498
  if (!Number.isFinite(t))
1529
1499
  throw new Error(`valueFn returned a non-finite value at index ${e}: ${t}`);
1530
1500
  return t;
1531
- }, fr = (t) => {
1501
+ }, hr = (t) => {
1532
1502
  if (t <= 0 || !Number.isFinite(t))
1533
1503
  return 0;
1534
1504
  const e = Math.trunc(t);
@@ -1602,25 +1572,25 @@ class Kt {
1602
1572
  return;
1603
1573
  }
1604
1574
  let s = 0, o;
1605
- const c = n?.baseValue;
1606
- if (c !== void 0 && !(Number.isFinite(c) && c >= 0))
1607
- throw new RangeError(`[FenwickMapTree] options.baseValue must be a finite number >= 0, received ${c}.`);
1608
- if (i > 0 && c !== void 0) {
1609
- if (s = c, n?.materialize) {
1610
- const f = n?.sampleRange ?? { from: 0, to: Math.min(dr - 1, i - 1) };
1611
- let g = Math.max(0, Math.trunc(f.from)), b = Math.min(Math.trunc(f.to), i - 1);
1612
- g > b && (g = 0, b = Math.min(dr - 1, i - 1)), o = { from: g, values: Kt._collectValidatedValues(r, g, b) };
1575
+ const l = n?.baseValue;
1576
+ if (l !== void 0 && !(Number.isFinite(l) && l >= 0))
1577
+ throw new RangeError(`[FenwickMapTree] options.baseValue must be a finite number >= 0, received ${l}.`);
1578
+ if (i > 0 && l !== void 0) {
1579
+ if (s = l, n?.materialize) {
1580
+ const f = n?.sampleRange ?? { from: 0, to: Math.min(fr - 1, i - 1) };
1581
+ let g = Math.max(0, Math.trunc(f.from)), x = Math.min(Math.trunc(f.to), i - 1);
1582
+ g > x && (g = 0, x = Math.min(fr - 1, i - 1)), o = { from: g, values: Kt._collectValidatedValues(r, g, x) };
1613
1583
  }
1614
1584
  } else if (i > 0) {
1615
1585
  const f = n?.sampleRange ?? {
1616
1586
  from: 0,
1617
- to: Math.min(dr - 1, i - 1)
1587
+ to: Math.min(fr - 1, i - 1)
1618
1588
  };
1619
- let g = Math.max(0, Math.trunc(f.from)), b = Math.min(Math.trunc(f.to), i - 1);
1620
- if (g > b && (g = 0, b = Math.min(dr - 1, i - 1)), i > dr)
1621
- s = Kt._sampleBaseValueStrided(r, i, dr), n?.materialize && (o = { from: g, values: Kt._collectValidatedValues(r, g, b) });
1589
+ let g = Math.max(0, Math.trunc(f.from)), x = Math.min(Math.trunc(f.to), i - 1);
1590
+ if (g > x && (g = 0, x = Math.min(fr - 1, i - 1)), i > fr)
1591
+ s = Kt._sampleBaseValueStrided(r, i, fr), n?.materialize && (o = { from: g, values: Kt._collectValidatedValues(r, g, x) });
1622
1592
  else {
1623
- const R = Kt._collectValidatedValues(r, g, b);
1593
+ const R = Kt._collectValidatedValues(r, g, x);
1624
1594
  s = Kt._modeOrMedian([...R]), n?.materialize && (o = { from: g, values: R });
1625
1595
  }
1626
1596
  }
@@ -1629,8 +1599,8 @@ class Kt {
1629
1599
  const g = o.from + f;
1630
1600
  if (g >= this.size)
1631
1601
  break;
1632
- const b = o.values[f] - this.baseValue;
1633
- b !== 0 && (this.deltas.set(g, b), this._updateTree(g, b));
1602
+ const x = o.values[f] - this.baseValue;
1603
+ x !== 0 && (this.deltas.set(g, x), this._updateTree(g, x));
1634
1604
  }
1635
1605
  this.total = this.getTotal();
1636
1606
  }
@@ -1661,7 +1631,7 @@ class Kt {
1661
1631
  static _collectValidatedValues(e, r, n) {
1662
1632
  const i = [];
1663
1633
  for (let s = r; s <= n; s++)
1664
- i.push(_r(e(s), s));
1634
+ i.push(kr(e(s), s));
1665
1635
  return i;
1666
1636
  }
1667
1637
  /**
@@ -1675,22 +1645,22 @@ class Kt {
1675
1645
  static _modeOrMedian(e) {
1676
1646
  if (e.length === 0)
1677
1647
  return 0;
1678
- e.sort((o, c) => o - c);
1648
+ e.sort((o, l) => o - l);
1679
1649
  const r = Math.floor(e.length / 2);
1680
1650
  let n;
1681
1651
  e.length % 2 === 0 ? n = Math.floor((e[r - 1] + e[r]) / 2) : n = e[r];
1682
1652
  const i = /* @__PURE__ */ new Map();
1683
1653
  let s = 0;
1684
1654
  for (const o of e) {
1685
- const c = (i.get(o) ?? 0) + 1;
1686
- i.set(o, c), c > s && (s = c);
1655
+ const l = (i.get(o) ?? 0) + 1;
1656
+ i.set(o, l), l > s && (s = l);
1687
1657
  }
1688
1658
  if (s > e.length * 0.2) {
1689
1659
  const o = [];
1690
1660
  for (const [f, g] of i.entries())
1691
1661
  g === s && o.push(f);
1692
- const c = o.reduce((f, g) => f + g, 0);
1693
- n = Math.floor(c / o.length);
1662
+ const l = o.reduce((f, g) => f + g, 0);
1663
+ n = Math.floor(l / o.length);
1694
1664
  }
1695
1665
  return n;
1696
1666
  }
@@ -1711,7 +1681,7 @@ class Kt {
1711
1681
  i % 2 === 0 && (i += 1);
1712
1682
  const s = [];
1713
1683
  for (let o = 0; o < r && s.length < n; o += i)
1714
- s.push(_r(e(o), o));
1684
+ s.push(kr(e(o), o));
1715
1685
  return Kt._modeOrMedian(s);
1716
1686
  }
1717
1687
  /**
@@ -1784,7 +1754,7 @@ class Kt {
1784
1754
  let n = e + 1;
1785
1755
  for (; n <= this.size; ) {
1786
1756
  this.tree.set(n, (this.tree.get(n) ?? 0) + r);
1787
- const i = fr(n);
1757
+ const i = hr(n);
1788
1758
  if (i === 0)
1789
1759
  break;
1790
1760
  n += i;
@@ -1810,7 +1780,7 @@ class Kt {
1810
1780
  throw new Error(`Value must be a finite number: ${s}`);
1811
1781
  if (s < 0)
1812
1782
  throw new Error("Value cannot be negative.");
1813
- const o = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = o + this.baseValue, f = s - c;
1783
+ const o = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, l = o + this.baseValue, f = s - l;
1814
1784
  f !== 0 && r.push({ index: i, change: f }), n.set(i, o + f);
1815
1785
  }
1816
1786
  return r;
@@ -1828,7 +1798,7 @@ class Kt {
1828
1798
  let e = 0, r = this.size;
1829
1799
  for (; r > 0; ) {
1830
1800
  e += this.tree.get(r) ?? 0;
1831
- const n = fr(r);
1801
+ const n = hr(r);
1832
1802
  if (n === 0)
1833
1803
  break;
1834
1804
  r -= n;
@@ -1845,7 +1815,7 @@ class Kt {
1845
1815
  */
1846
1816
  _materialize(e, r = !0) {
1847
1817
  if (this.valueFn) {
1848
- const n = this.deltas.get(e) ?? 0, s = _r(this.valueFn(e), e) - this.baseValue;
1818
+ const n = this.deltas.get(e) ?? 0, s = kr(this.valueFn(e), e) - this.baseValue;
1849
1819
  if (s !== n && (s === 0 ? this.deltas.delete(e) : this.deltas.set(e, s), r)) {
1850
1820
  const o = s - n;
1851
1821
  this._updateTree(e, o);
@@ -1866,10 +1836,10 @@ class Kt {
1866
1836
  return;
1867
1837
  const i = e.ranges;
1868
1838
  if (i && i.length > 0) {
1869
- for (const c of i) {
1870
- const f = Math.max(0, Math.trunc(c.from)), g = Math.min(Math.trunc(c.to), this.size - 1);
1871
- for (let b = f; b <= g; b++)
1872
- this._materialize(b);
1839
+ for (const l of i) {
1840
+ const f = Math.max(0, Math.trunc(l.from)), g = Math.min(Math.trunc(l.to), this.size - 1);
1841
+ for (let x = f; x <= g; x++)
1842
+ this._materialize(x);
1873
1843
  }
1874
1844
  if (r === void 0)
1875
1845
  return;
@@ -1906,8 +1876,8 @@ class Kt {
1906
1876
  return { index: -1, total: this.total ?? this.getTotal(), cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1907
1877
  if (!i)
1908
1878
  break;
1909
- const c = this.deltas.get(s) ?? 0;
1910
- if (this._materialize(s), (this.deltas.get(s) ?? 0) === c)
1879
+ const l = this.deltas.get(s) ?? 0;
1880
+ if (this._materialize(s), (this.deltas.get(s) ?? 0) === l)
1911
1881
  break;
1912
1882
  }
1913
1883
  const o = this.prefixSum(s);
@@ -1949,20 +1919,20 @@ class Kt {
1949
1919
  _findIndexLarge(e, r, n) {
1950
1920
  if (this.size === 0)
1951
1921
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1952
- const i = ci(this.size);
1922
+ const i = hi(this.size);
1953
1923
  if (i === 0n)
1954
1924
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1955
1925
  this._materializeRanges(r.materializeOption);
1956
1926
  const s = r.materializeOption?.materialize === !0;
1957
1927
  for (; ; ) {
1958
- let o = 0n, c = i - 1n, f, g, b = this.total;
1959
- for (; o <= c; ) {
1960
- const S = o + c >> 1n, C = Number(S), Z = this.prefixSum(C);
1961
- if (b = Z.total, n ? Z.cumulative >= e : Z.cumulative <= e)
1962
- if (f = S, g = Z, n) {
1928
+ let o = 0n, l = i - 1n, f, g, x = this.total;
1929
+ for (; o <= l; ) {
1930
+ const S = o + l >> 1n, N = Number(S), j = this.prefixSum(N);
1931
+ if (x = j.total, n ? j.cumulative >= e : j.cumulative <= e)
1932
+ if (f = S, g = j, n) {
1963
1933
  if (S === 0n)
1964
1934
  break;
1965
- c = S - 1n;
1935
+ l = S - 1n;
1966
1936
  } else
1967
1937
  o = S + 1n;
1968
1938
  else if (n)
@@ -1970,7 +1940,7 @@ class Kt {
1970
1940
  else {
1971
1941
  if (S === 0n)
1972
1942
  break;
1973
- c = S - 1n;
1943
+ l = S - 1n;
1974
1944
  }
1975
1945
  }
1976
1946
  const R = g, T = f !== void 0 ? Number(f) : -1;
@@ -1981,7 +1951,7 @@ class Kt {
1981
1951
  }
1982
1952
  return {
1983
1953
  index: T,
1984
- total: b,
1954
+ total: x,
1985
1955
  cumulative: R?.cumulative,
1986
1956
  currentValue: R?.currentValue,
1987
1957
  safeIndex: R?.safeIndex
@@ -2001,19 +1971,19 @@ class Kt {
2001
1971
  return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
2002
1972
  if (this.size === 0)
2003
1973
  return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
2004
- const n = re(Math.trunc(e), 0, this.size - 1), i = r?.materializeOption;
1974
+ const n = ee(Math.trunc(e), 0, this.size - 1), i = r?.materializeOption;
2005
1975
  this._materializeRanges(i, n, !0);
2006
1976
  let s = 0, o = n + 1;
2007
1977
  for (; o > 0; ) {
2008
1978
  const f = this.tree.get(o) ?? 0;
2009
1979
  s += f;
2010
- const g = fr(o);
1980
+ const g = hr(o);
2011
1981
  if (g === 0)
2012
1982
  break;
2013
1983
  o -= g;
2014
1984
  }
2015
- const c = i?.materialize ? this.get(n) : (this.deltas.get(n) || 0) + this.baseValue;
2016
- return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue: c, safeIndex: n };
1985
+ const l = i?.materialize ? this.get(n) : (this.deltas.get(n) || 0) + this.baseValue;
1986
+ return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue: l, safeIndex: n };
2017
1987
  }
2018
1988
  /**
2019
1989
  * @method get
@@ -2070,7 +2040,7 @@ class Kt {
2070
2040
  let s = n + 1;
2071
2041
  for (; s <= this.size; ) {
2072
2042
  r.set(s, (r.get(s) ?? 0) + i);
2073
- const o = fr(s);
2043
+ const o = hr(s);
2074
2044
  if (o === 0)
2075
2045
  break;
2076
2046
  s += o;
@@ -2187,14 +2157,14 @@ class Kt {
2187
2157
  _propagateDeltaToGrownNodes(e, r, n, i) {
2188
2158
  let s = e + 1;
2189
2159
  for (; s <= n; ) {
2190
- const o = fr(s);
2160
+ const o = hr(s);
2191
2161
  if (o === 0)
2192
2162
  break;
2193
2163
  s += o;
2194
2164
  }
2195
2165
  for (; s <= i; ) {
2196
2166
  this.tree.set(s, (this.tree.get(s) ?? 0) + r);
2197
- const o = fr(s);
2167
+ const o = hr(s);
2198
2168
  if (o === 0)
2199
2169
  break;
2200
2170
  s += o;
@@ -2288,20 +2258,20 @@ class Kt {
2288
2258
  return this._findIndex(e, r ?? {}, !1);
2289
2259
  }
2290
2260
  }
2291
- const ui = (t, e) => {
2261
+ const mi = (t, e) => {
2292
2262
  const r = t?.sampleRange, n = e?.sampleRange;
2293
2263
  return r === n ? !1 : r && n ? r.from !== n.from || r.to !== n.to : !0;
2294
- }, Rn = (t, e, r) => {
2264
+ }, Nn = (t, e, r) => {
2295
2265
  const n = Number.isFinite(t) && t > 0 ? Math.trunc(t) : 0, i = d(null), s = d({ size: n, valueOrFn: e, options: r });
2296
2266
  i.current === null && (i.current = new Kt(n, e, r));
2297
- const o = i.current, c = s.current, f = c.size !== n, g = c.valueOrFn !== e, b = ui(c.options, r) || c.options?.baseValue !== r?.baseValue, R = c.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2298
- if (g || b) {
2267
+ const o = i.current, l = s.current, f = l.size !== n, g = l.valueOrFn !== e, x = mi(l.options, r) || l.options?.baseValue !== r?.baseValue, R = l.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2268
+ if (g || x) {
2299
2269
  const T = r?.resetOnValueFnChange ?? !0;
2300
- b || g && T || R ? (r?.debug && A.debug("[useFenwickMapTree] reset", { valueOrFnChanged: g, optionsChanged: b }), o.reset(n, e, r)) : (f && (r?.debug && A.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: n }), o.changeSize(n)), r?.debug && A.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: g }), o.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: r };
2301
- } else f && (r?.debug && A.debug("[useFenwickMapTree] resize", { from: c.size, to: n }), R ? o.reset(n, e, r) : o.changeSize(n), s.current = { size: n, valueOrFn: e, options: r });
2270
+ x || g && T || R ? (r?.debug && A.debug("[useFenwickMapTree] reset", { valueOrFnChanged: g, optionsChanged: x }), o.reset(n, e, r)) : (f && (r?.debug && A.debug("[useFenwickMapTree] resize (with valueFn change)", { from: l.size, to: n }), o.changeSize(n)), r?.debug && A.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: g }), o.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: r };
2271
+ } else f && (r?.debug && A.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 });
2302
2272
  return o;
2303
2273
  };
2304
- class di {
2274
+ class pi {
2305
2275
  key;
2306
2276
  value;
2307
2277
  prev = null;
@@ -2310,7 +2280,7 @@ class di {
2310
2280
  this.key = e, this.value = r;
2311
2281
  }
2312
2282
  }
2313
- class Fr {
2283
+ class Hr {
2314
2284
  head = null;
2315
2285
  tail = null;
2316
2286
  /**
@@ -2351,52 +2321,52 @@ class Fr {
2351
2321
  this.remove(e), this.addToTail(e);
2352
2322
  }
2353
2323
  }
2354
- function fi(t) {
2355
- const e = d(/* @__PURE__ */ new Map()), r = d(new Fr()), n = Math.floor(t), i = d(n);
2324
+ function gi(t) {
2325
+ const e = d(/* @__PURE__ */ new Map()), r = d(new Hr()), n = Math.floor(t), i = d(n);
2356
2326
  X(() => {
2357
2327
  if (i.current = n, Number.isNaN(n) || n < 0) {
2358
- A.warn(`useLruCache: invalid capacity ${t}; the cache will not store any entries.`), e.current.clear(), r.current = new Fr();
2328
+ A.warn(`useLruCache: invalid capacity ${t}; the cache will not store any entries.`), e.current.clear(), r.current = new Hr();
2359
2329
  return;
2360
2330
  }
2361
2331
  if (Number.isFinite(n))
2362
2332
  for (; e.current.size > n; ) {
2363
- const b = r.current.removeHead();
2364
- if (b)
2365
- e.current.delete(b.key);
2333
+ const x = r.current.removeHead();
2334
+ if (x)
2335
+ e.current.delete(x.key);
2366
2336
  else
2367
2337
  break;
2368
2338
  }
2369
2339
  }, [t, n]);
2370
- const s = w((b) => {
2371
- const R = e.current.get(b);
2340
+ const s = w((x) => {
2341
+ const R = e.current.get(x);
2372
2342
  if (R)
2373
2343
  return r.current.moveToTail(R), R.value;
2374
- }, []), o = w((b, R) => {
2344
+ }, []), o = w((x, R) => {
2375
2345
  const T = i.current;
2376
2346
  if (Number.isNaN(T) || T <= 0)
2377
2347
  return;
2378
- let S = e.current.get(b);
2348
+ let S = e.current.get(x);
2379
2349
  if (S)
2380
2350
  S.value = R, r.current.moveToTail(S);
2381
2351
  else {
2382
2352
  if (e.current.size >= T) {
2383
- const C = r.current.removeHead();
2384
- C && e.current.delete(C.key);
2353
+ const N = r.current.removeHead();
2354
+ N && e.current.delete(N.key);
2385
2355
  }
2386
- S = new di(b, R), e.current.set(b, S), r.current.addToTail(S);
2356
+ S = new pi(x, R), e.current.set(x, S), r.current.addToTail(S);
2387
2357
  }
2388
- }, []), c = w((b) => e.current.has(b), []), f = w((b) => {
2389
- const R = e.current.get(b);
2390
- R && (r.current.remove(R), e.current.delete(b));
2358
+ }, []), l = w((x) => e.current.has(x), []), f = w((x) => {
2359
+ const R = e.current.get(x);
2360
+ R && (r.current.remove(R), e.current.delete(x));
2391
2361
  }, []), g = w(() => {
2392
- e.current.clear(), r.current = new Fr();
2362
+ e.current.clear(), r.current = new Hr();
2393
2363
  }, []);
2394
- return Me(() => ({ get: s, set: o, has: c, remove: f, clear: g }), [s, o, c, f, g]);
2364
+ return Me(() => ({ get: s, set: o, has: l, remove: f, clear: g }), [s, o, l, f, g]);
2395
2365
  }
2396
- const hi = 1e4, Di = () => {
2397
- const { get: t, set: e, has: r, clear: n } = fi(hi);
2366
+ const xi = 1e4, Fi = () => {
2367
+ const { get: t, set: e, has: r, clear: n } = gi(xi);
2398
2368
  return Me(() => ({ get: t, set: e, has: r, clear: n }), [t, e, r, n]);
2399
- }, Li = (t, e) => {
2369
+ }, ki = (t, e) => {
2400
2370
  const r = d(e), n = d(t);
2401
2371
  Je(() => {
2402
2372
  r.current = e, n.current = t;
@@ -2405,73 +2375,73 @@ const hi = 1e4, Di = () => {
2405
2375
  return w((s) => {
2406
2376
  if (!s || i.current.has(s))
2407
2377
  return;
2408
- const o = (c) => {
2409
- r.current?.enableBridge !== !1 && n.current.current?.applyWheel(c);
2378
+ const o = (l) => {
2379
+ r.current?.enableBridge !== !1 && n.current.current?.applyWheel(l);
2410
2380
  };
2411
2381
  return s.addEventListener("wheel", o, { passive: !1 }), i.current.set(s, o), () => {
2412
2382
  i.current.get(s) === o && (s.removeEventListener("wheel", o), i.current.delete(s));
2413
2383
  };
2414
2384
  }, []);
2415
- }, un = -200, dn = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, mi = (t) => {
2385
+ }, fn = -200, hn = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, bi = (t) => {
2416
2386
  const e = d(t);
2417
2387
  e.current = t;
2418
- const r = d(dn), n = d(null), [i, s] = ke(!1), o = d(null), c = d(null), f = d({ residual: 0, direction: 0 }), g = d({ residual: 0, direction: 0 }), b = w(() => {
2419
- o.current !== null && (window.cancelAnimationFrame(o.current), o.current = null), c.current = null, f.current = { residual: 0, direction: 0 }, g.current = { residual: 0, direction: 0 };
2420
- }, []), R = w((D, k, ce, L, E, V) => {
2421
- const J = k > 0 ? 1 : k < 0 ? -1 : 0;
2422
- J !== 0 && J !== D.direction && (D.direction = J, D.residual = 0), D.residual += k * ce;
2423
- const B = Math.max(E(), 0);
2424
- B > 0 && (D.residual = re(D.residual, -B, B));
2388
+ const r = d(hn), n = d(null), [i, s] = _e(!1), o = d(null), l = d(null), f = d({ residual: 0, direction: 0 }), g = d({ residual: 0, direction: 0 }), x = w(() => {
2389
+ 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 };
2390
+ }, []), R = w((D, k, ce, L, P, C) => {
2391
+ const K = k > 0 ? 1 : k < 0 ? -1 : 0;
2392
+ K !== 0 && K !== D.direction && (D.direction = K, D.residual = 0), D.residual += k * ce;
2393
+ const B = Math.max(P(), 0);
2394
+ B > 0 && (D.residual = ee(D.residual, -B, B));
2425
2395
  const H = D.residual;
2426
2396
  if (H === 0)
2427
2397
  return { actualDelta: 0, atBoundary: !1 };
2428
- const Q = L(), oe = V(H), ge = oe - Q;
2398
+ const J = L(), ie = C(H), ge = ie - J;
2429
2399
  D.residual -= ge;
2430
- const Xe = H < 0 && Q + H <= 0, y = H > 0 && Q + H >= B, se = H < 0 && (oe <= 0 || Xe && ge === 0) || H > 0 && (oe >= B || y && ge === 0);
2431
- return se && (D.residual = 0), { actualDelta: ge, atBoundary: se };
2400
+ const $e = H < 0 && J + H <= 0, y = H > 0 && J + H >= B, re = H < 0 && (ie <= 0 || $e && ge === 0) || H > 0 && (ie >= B || y && ge === 0);
2401
+ return re && (D.residual = 0), { actualDelta: ge, atBoundary: re };
2432
2402
  }, []), T = w(
2433
2403
  (D) => {
2434
2404
  const k = e.current, ce = r.current;
2435
2405
  if (!ce.active || ce.direction === 0) {
2436
- b();
2406
+ x();
2437
2407
  return;
2438
2408
  }
2439
- const L = c.current ?? D, E = Math.max((D - L) / 1e3, 0), V = Math.min(E, In);
2440
- if (c.current = D, V <= 0) {
2409
+ const L = l.current ?? D, P = Math.max((D - L) / 1e3, 0), C = Math.min(P, Pn);
2410
+ if (l.current = D, C <= 0) {
2441
2411
  o.current = window.requestAnimationFrame(T);
2442
2412
  return;
2443
2413
  }
2444
- const J = ri({ offsetX: ce.offsetX, offsetY: ce.offsetY, maxDistance: k.maxDistance, x: k.xSpeedParams, y: k.ySpeedParams }), B = R(f.current, J.x, V, k.getHx, k.getMaxHx, (ge) => k.applyHxRef.current(k.getHx() + ge));
2414
+ const K = oi({ offsetX: ce.offsetX, offsetY: ce.offsetY, maxDistance: k.maxDistance, x: k.xSpeedParams, y: k.ySpeedParams }), B = R(f.current, K.x, C, k.getHx, k.getMaxHx, (ge) => k.applyHxRef.current(k.getHx() + ge));
2445
2415
  B.actualDelta !== 0 && (k.pendingColAnchorRef.current = null);
2446
- const H = R(g.current, J.y, V, k.getVy, k.getMaxVy, k.applyVy), Q = k.getMaxHx() <= 0 || B.atBoundary || ce.offsetX === 0, oe = k.getMaxVy() <= 0 || H.atBoundary || ce.offsetY === 0;
2447
- if (Q && oe) {
2448
- b();
2416
+ const H = R(g.current, K.y, C, k.getVy, k.getMaxVy, k.applyVy), J = k.getMaxHx() <= 0 || B.atBoundary || ce.offsetX === 0, ie = k.getMaxVy() <= 0 || H.atBoundary || ce.offsetY === 0;
2417
+ if (J && ie) {
2418
+ x();
2449
2419
  return;
2450
2420
  }
2451
2421
  o.current = window.requestAnimationFrame(T);
2452
2422
  },
2453
- [b, R]
2423
+ [x, R]
2454
2424
  ), S = w(() => {
2455
- o.current === null && (c.current = null, f.current = { residual: 0, direction: 0 }, g.current = { residual: 0, direction: 0 }, o.current = window.requestAnimationFrame(T));
2456
- }, [T]), C = w(() => {
2457
- r.current = { ...dn }, s(!1), n.current?.reset(), b();
2458
- }, [b]), Z = w(
2425
+ o.current === null && (l.current = null, f.current = { residual: 0, direction: 0 }, g.current = { residual: 0, direction: 0 }, o.current = window.requestAnimationFrame(T));
2426
+ }, [T]), N = w(() => {
2427
+ r.current = { ...hn }, s(!1), n.current?.reset(), x();
2428
+ }, [x]), j = w(
2459
2429
  (D) => {
2460
- r.current = D, s(D.active), D.active && D.direction !== 0 ? S() : b();
2430
+ r.current = D, s(D.active), D.active && D.direction !== 0 ? S() : x();
2461
2431
  },
2462
- [S, b]
2432
+ [S, x]
2463
2433
  ), { enabled: F, xExtentFreshness: Te, yExtentFreshness: ze } = t;
2464
2434
  return X(() => {
2465
2435
  const D = r.current;
2466
2436
  !D.active || D.direction === 0 || S();
2467
2437
  }, [Te, ze, S]), X(() => {
2468
2438
  const D = () => {
2469
- C();
2439
+ N();
2470
2440
  };
2471
- return window.addEventListener(vr, D), () => {
2472
- window.removeEventListener(vr, D);
2441
+ return window.addEventListener(Sr, D), () => {
2442
+ window.removeEventListener(Sr, D);
2473
2443
  };
2474
- }, [C]), X(() => {
2444
+ }, [N]), X(() => {
2475
2445
  if (!F)
2476
2446
  return;
2477
2447
  const D = (k) => {
@@ -2479,57 +2449,57 @@ const hi = 1e4, Di = () => {
2479
2449
  return;
2480
2450
  const ce = k.target;
2481
2451
  if (!(ce instanceof Node)) {
2482
- C();
2452
+ N();
2483
2453
  return;
2484
2454
  }
2485
- n.current?.getElement()?.contains(ce) || C();
2455
+ n.current?.getElement()?.contains(ce) || N();
2486
2456
  };
2487
2457
  return document.addEventListener("pointerdown", D, !0), () => {
2488
2458
  document.removeEventListener("pointerdown", D, !0);
2489
2459
  };
2490
- }, [F, C]), X(() => {
2491
- F || C();
2492
- }, [F, C]), X(() => () => {
2493
- b();
2494
- }, [b]), { isTapActive: i, handleTapCircleDragChange: Z, tapCircleHandleRef: n };
2495
- }, Ze = (t, e) => e <= 0 ? 0 : re(t, 0, e - 1), fn = (t) => ({
2460
+ }, [F, N]), X(() => {
2461
+ F || N();
2462
+ }, [F, N]), X(() => () => {
2463
+ x();
2464
+ }, [x]), { isTapActive: i, handleTapCircleDragChange: j, tapCircleHandleRef: n };
2465
+ }, Ze = (t, e) => e <= 0 ? 0 : ee(t, 0, e - 1), mn = (t) => ({
2496
2466
  top: Math.max(0, t?.top ?? 0),
2497
2467
  bottom: Math.max(0, t?.bottom ?? 0)
2498
- }), Rt = (t, e) => t <= e ? 0 : t - e, ar = (t, e) => t <= 0 ? 0 : t + e, wr = 1e3, Br = 2e3, Pn = 1048576, pi = 40, br = (t) => {
2468
+ }), Rt = (t, e) => t <= e ? 0 : t - e, cr = (t, e) => t <= 0 ? 0 : t + e, Mr = 1e3, Ur = 2e3, Vn = 1048576, vi = 40, vr = (t) => {
2499
2469
  if (!Number.isFinite(t)) return 0n;
2500
2470
  const e = Math.trunc(t);
2501
2471
  return e <= 0 ? 0n : BigInt(e);
2502
- }, gi = (t, e, r, n, i, s, o, c) => {
2503
- const f = br(n);
2472
+ }, wi = (t, e, r, n, i, s, o, l) => {
2473
+ const f = vr(n);
2504
2474
  if (f === 0n)
2505
2475
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2506
- const g = (L) => L < 0n ? 0n : L >= f ? f - 1n : L, b = { materializeOption: { materialize: !1 } }, { index: R, cumulative: T } = s.findIndexAtOrAfter(t, b);
2476
+ const g = (L) => L < 0n ? 0n : L >= f ? f - 1n : L, x = { materializeOption: { materialize: !1 } }, { index: R, cumulative: T } = s.findIndexAtOrAfter(t, x);
2507
2477
  let S;
2508
- R === -1 ? S = f - 1n : (T === t ? S = br(R + 1) : S = br(R), S >= f && (S = f - 1n)), t <= 0 && (S = 0n), c && t >= o && (S = f - 1n);
2509
- const C = (L) => {
2510
- const E = Number(L);
2511
- if (!Number.isSafeInteger(E))
2478
+ R === -1 ? S = f - 1n : (T === t ? S = vr(R + 1) : S = vr(R), S >= f && (S = f - 1n)), t <= 0 && (S = 0n), l && t >= o && (S = f - 1n);
2479
+ const N = (L) => {
2480
+ const P = Number(L);
2481
+ if (!Number.isSafeInteger(P))
2512
2482
  return null;
2513
- const { cumulative: V } = s.prefixSum(E, { materializeOption: { materialize: !1 } });
2514
- if (!Number.isFinite(V))
2483
+ const { cumulative: C } = s.prefixSum(P, { materializeOption: { materialize: !1 } });
2484
+ if (!Number.isFinite(C))
2515
2485
  return null;
2516
- const { index: J } = s.findIndexAtOrAfter(V + 0.5, { materializeOption: { materialize: !1 } });
2517
- if (J === -1)
2486
+ const { index: K } = s.findIndexAtOrAfter(C + 0.5, { materializeOption: { materialize: !1 } });
2487
+ if (K === -1)
2518
2488
  return null;
2519
- const B = br(J);
2489
+ const B = vr(K);
2520
2490
  return B > L ? B : null;
2521
- }, Z = (L) => {
2522
- let E = 0, V = L, J = L, B = 0n, H = 0;
2523
- for (; V < f && E < e; ) {
2524
- const Q = Number(V), oe = i(Q);
2525
- if (E += oe, J = V, V += 1n, B += 1n, !Number.isFinite(oe) || oe < 0)
2491
+ }, j = (L) => {
2492
+ let P = 0, C = L, K = L, B = 0n, H = 0;
2493
+ for (; C < f && P < e; ) {
2494
+ const J = Number(C), ie = i(J);
2495
+ if (P += ie, K = C, C += 1n, B += 1n, !Number.isFinite(ie) || ie < 0)
2526
2496
  break;
2527
- if (oe === 0) {
2528
- if (H += 1, H > wr) {
2529
- const ge = C(J);
2530
- if (ge !== null && ge > V)
2531
- V = ge, H = 0;
2532
- else if (ge !== null && ge === V && i(Number(V)) > 0)
2497
+ if (ie === 0) {
2498
+ if (H += 1, H > Mr) {
2499
+ const ge = N(K);
2500
+ if (ge !== null && ge > C)
2501
+ C = ge, H = 0;
2502
+ else if (ge !== null && ge === C && i(Number(C)) > 0)
2533
2503
  H = 0;
2534
2504
  else
2535
2505
  break;
@@ -2537,38 +2507,38 @@ const hi = 1e4, Di = () => {
2537
2507
  } else
2538
2508
  H = 0;
2539
2509
  }
2540
- return B === 0n && (J = L), { height: E, end: J };
2510
+ return B === 0n && (K = L), { height: P, end: K };
2541
2511
  };
2542
- let { height: F, end: Te } = Z(S);
2512
+ let { height: F, end: Te } = j(S);
2543
2513
  if (F < e && S > 0n) {
2544
- let L = S, E = F, V = 0;
2545
- for (; L > 0n && E < e; ) {
2514
+ let L = S, P = F, C = 0;
2515
+ for (; L > 0n && P < e; ) {
2546
2516
  L -= 1n;
2547
2517
  const B = Number(L), H = i(B);
2548
- if (E += H, !Number.isFinite(H) || H < 0)
2518
+ if (P += H, !Number.isFinite(H) || H < 0)
2549
2519
  break;
2550
2520
  if (H === 0) {
2551
- if (V += 1, V > wr) {
2552
- const Q = Number(L);
2553
- if (!Number.isSafeInteger(Q))
2521
+ if (C += 1, C > Mr) {
2522
+ const J = Number(L);
2523
+ if (!Number.isSafeInteger(J))
2554
2524
  break;
2555
- const { cumulative: oe } = s.prefixSum(Q, { materializeOption: { materialize: !1 } });
2556
- if (!Number.isFinite(oe))
2525
+ const { cumulative: ie } = s.prefixSum(J, { materializeOption: { materialize: !1 } });
2526
+ if (!Number.isFinite(ie))
2557
2527
  break;
2558
- const { index: ge } = s.findIndexAtOrAfter(oe - 0.5, { materializeOption: { materialize: !1 } }), Xe = ge === -1 ? -1n : br(ge);
2559
- if (Xe >= 0n && Xe < L)
2560
- L = Xe + 1n, V = 0;
2561
- else if (Xe === L && L >= 1n && i(Number(L - 1n)) > 0)
2562
- V = 0;
2528
+ const { index: ge } = s.findIndexAtOrAfter(ie - 0.5, { materializeOption: { materialize: !1 } }), $e = ge === -1 ? -1n : vr(ge);
2529
+ if ($e >= 0n && $e < L)
2530
+ L = $e + 1n, C = 0;
2531
+ else if ($e === L && L >= 1n && i(Number(L - 1n)) > 0)
2532
+ C = 0;
2563
2533
  else
2564
2534
  break;
2565
2535
  }
2566
2536
  } else
2567
- V = 0;
2537
+ C = 0;
2568
2538
  }
2569
2539
  S = g(L);
2570
- const J = Z(S);
2571
- F = J.height, Te = J.end;
2540
+ const K = j(S);
2541
+ F = K.height, Te = K.end;
2572
2542
  }
2573
2543
  const ze = g(S), D = g(Te), k = g(ze - BigInt(Math.max(0, r))), ce = g(D + BigInt(Math.max(0, r)));
2574
2544
  return {
@@ -2577,34 +2547,34 @@ const hi = 1e4, Di = () => {
2577
2547
  visibleStartIndex: Ze(Number(ze), n),
2578
2548
  visibleEndIndex: Ze(Number(D), n)
2579
2549
  };
2580
- }, En = (t, e, r, n, i, s, o) => {
2550
+ }, Cn = (t, e, r, n, i, s, o) => {
2581
2551
  if (n === 0)
2582
2552
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2583
- const c = Number.isFinite(o), f = c ? Math.min(Math.max(0, t), o) : Math.max(0, t);
2553
+ const l = Number.isFinite(o), f = l ? Math.min(Math.max(0, t), o) : Math.max(0, t);
2584
2554
  if (n >= Number.MAX_SAFE_INTEGER)
2585
- return gi(f, e, r, n, i, s, o, c);
2586
- const { index: g, cumulative: b, currentValue: R } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), T = g === -1 ? e <= 0 || (b ?? 0) < f + (R ?? 0) ? n - 1 : 0 : g;
2587
- let S = Ze(T, n), C = 0;
2588
- if (g !== -1 && b === f)
2589
- S = Ze(g + 1, n), C = 0;
2590
- else if (S === g && b !== void 0 && R !== void 0)
2591
- C = b - R - f;
2555
+ return wi(f, e, r, n, i, s, o, l);
2556
+ const { index: g, cumulative: x, currentValue: R } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), T = g === -1 ? e <= 0 || (x ?? 0) < f + (R ?? 0) ? n - 1 : 0 : g;
2557
+ let S = Ze(T, n), N = 0;
2558
+ if (g !== -1 && x === f)
2559
+ S = Ze(g + 1, n), N = 0;
2560
+ else if (S === g && x !== void 0 && R !== void 0)
2561
+ N = x - R - f;
2592
2562
  else {
2593
- const { cumulative: L, currentValue: E } = s.prefixSum(S, { materializeOption: { materialize: !1 } });
2594
- C = (L ?? 0) - (E ?? 0) - f;
2595
- }
2596
- const Z = C, F = (L, E) => {
2597
- let V = L, J = E, B = 0;
2598
- for (; V < n && J < e; ) {
2599
- const H = i(V);
2600
- if (J += H, V++, !Number.isFinite(H) || H < 0)
2563
+ const { cumulative: L, currentValue: P } = s.prefixSum(S, { materializeOption: { materialize: !1 } });
2564
+ N = (L ?? 0) - (P ?? 0) - f;
2565
+ }
2566
+ const j = N, F = (L, P) => {
2567
+ let C = L, K = P, B = 0;
2568
+ for (; C < n && K < e; ) {
2569
+ const H = i(C);
2570
+ if (K += H, C++, !Number.isFinite(H) || H < 0)
2601
2571
  break;
2602
2572
  if (H === 0) {
2603
- if (B++, B > wr) {
2604
- const { cumulative: Q } = s.prefixSum(V - 1, { materializeOption: { materialize: !1 } }), { index: oe } = Number.isFinite(Q) ? s.findIndexAtOrAfter(Q + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2605
- if (oe > V)
2606
- V = oe, B = 0;
2607
- else if (oe === V && i(V) > 0)
2573
+ if (B++, B > Mr) {
2574
+ const { cumulative: J } = s.prefixSum(C - 1, { materializeOption: { materialize: !1 } }), { index: ie } = Number.isFinite(J) ? s.findIndexAtOrAfter(J + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2575
+ if (ie > C)
2576
+ C = ie, B = 0;
2577
+ else if (ie === C && i(C) > 0)
2608
2578
  B = 0;
2609
2579
  else
2610
2580
  break;
@@ -2612,42 +2582,42 @@ const hi = 1e4, Di = () => {
2612
2582
  } else
2613
2583
  B = 0;
2614
2584
  }
2615
- return { cursor: V, height: J };
2616
- }, Te = F(S, C);
2585
+ return { cursor: C, height: K };
2586
+ }, Te = F(S, N);
2617
2587
  let ze = Te.cursor;
2618
- if (C = Te.height, C < e && S > 0) {
2619
- let L = C + Math.abs(Math.min(0, Z)), E = S - 1, V = 0;
2620
- for (; E >= 0 && L < e; ) {
2621
- const B = i(E);
2588
+ if (N = Te.height, N < e && S > 0) {
2589
+ let L = N + Math.abs(Math.min(0, j)), P = S - 1, C = 0;
2590
+ for (; P >= 0 && L < e; ) {
2591
+ const B = i(P);
2622
2592
  if (L += B, !Number.isFinite(B) || B < 0) {
2623
- E--;
2593
+ P--;
2624
2594
  break;
2625
2595
  }
2626
2596
  if (B === 0) {
2627
- if (V++, V > wr) {
2628
- const { cumulative: H } = s.prefixSum(E, { materializeOption: { materialize: !1 } }), { index: Q } = Number.isFinite(H) ? s.findIndexAtOrAfter(H - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2629
- if (Q !== -1 && Q < E) {
2630
- E = Q, V = 0;
2597
+ if (C++, C > Mr) {
2598
+ const { cumulative: H } = s.prefixSum(P, { materializeOption: { materialize: !1 } }), { index: J } = Number.isFinite(H) ? s.findIndexAtOrAfter(H - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2599
+ if (J !== -1 && J < P) {
2600
+ P = J, C = 0;
2631
2601
  continue;
2632
2602
  }
2633
- if (Q === E && E >= 1 && i(E - 1) > 0)
2634
- V = 0;
2603
+ if (J === P && P >= 1 && i(P - 1) > 0)
2604
+ C = 0;
2635
2605
  else {
2636
- E--;
2606
+ P--;
2637
2607
  break;
2638
2608
  }
2639
2609
  }
2640
2610
  } else
2641
- V = 0;
2642
- E--;
2611
+ C = 0;
2612
+ P--;
2643
2613
  }
2644
- S = Ze(E + 1, n);
2645
- const J = F(S, 0);
2646
- ze = J.cursor, C = J.height;
2614
+ S = Ze(P + 1, n);
2615
+ const K = F(S, 0);
2616
+ ze = K.cursor, N = K.height;
2647
2617
  }
2648
2618
  const D = Ze(S - r, n), k = Ze(Math.max(ze - 1, S), n), ce = Ze(k + r, n);
2649
2619
  return { renderingStartIndex: D, renderingEndIndex: ce, visibleStartIndex: S, visibleEndIndex: k };
2650
- }, hn = (t, e, r) => {
2620
+ }, pn = (t, e, r) => {
2651
2621
  const n = Math.max(0, e ?? 0), i = d({ last: 0, id: null, arg: null }).current;
2652
2622
  return X(
2653
2623
  () => () => {
@@ -2664,9 +2634,9 @@ const hi = 1e4, Di = () => {
2664
2634
  ), w(
2665
2635
  (s) => {
2666
2636
  if (i.arg = s, i.id !== null) return;
2667
- const o = (c) => {
2637
+ const o = (l) => {
2668
2638
  if (i.id = null, i.arg === null) return;
2669
- const f = c - i.last;
2639
+ const f = l - i.last;
2670
2640
  if (n === 0 || i.last === 0 || f >= n) {
2671
2641
  if (t.current)
2672
2642
  try {
@@ -2674,7 +2644,7 @@ const hi = 1e4, Di = () => {
2674
2644
  } catch (g) {
2675
2645
  console.error("[useThrottledInvoker] Error invoking callback", g);
2676
2646
  }
2677
- i.arg = null, i.last = c;
2647
+ i.arg = null, i.last = l;
2678
2648
  }
2679
2649
  i.arg !== null && (i.id = requestAnimationFrame(o));
2680
2650
  };
@@ -2682,8 +2652,8 @@ const hi = 1e4, Di = () => {
2682
2652
  },
2683
2653
  [n, r, t, i]
2684
2654
  );
2685
- }, xi = Ln.memo(({ index: t, top: e, height: r, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: o, onKeyDown: c, onEscapeKeyDown: f, onFocus: g, registerItemRef: b }) => {
2686
- const R = w((F) => b(t, F), [t, b]), T = w((F) => c(F, t), [t, c]), S = w((F) => f?.(F, t), [t, f]), C = w(() => g(t), [t, g]), Z = w((F) => {
2655
+ }, Si = kn.memo(({ index: t, top: e, height: r, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: o, onKeyDown: l, onEscapeKeyDown: f, onFocus: g, registerItemRef: x }) => {
2656
+ const R = w((F) => x(t, F), [t, x]), T = w((F) => l(F, t), [t, l]), S = w((F) => f?.(F, t), [t, f]), N = w(() => g(t), [t, g]), j = w((F) => {
2687
2657
  F.currentTarget.focus({ preventScroll: !0 });
2688
2658
  }, []);
2689
2659
  return (
@@ -2704,15 +2674,15 @@ const hi = 1e4, Di = () => {
2704
2674
  overflow: s ? "hidden" : void 0
2705
2675
  },
2706
2676
  tabIndex: o ? -1 : void 0,
2707
- onPointerDown: o ? Z : void 0,
2677
+ onPointerDown: o ? j : void 0,
2708
2678
  onKeyDownCapture: o ? T : void 0,
2709
2679
  onKeyDown: o && f ? S : void 0,
2710
- onFocusCapture: o ? C : void 0,
2680
+ onFocusCapture: o ? N : void 0,
2711
2681
  children: i(n, t)
2712
2682
  }
2713
2683
  )
2714
2684
  );
2715
- }), bi = ({
2685
+ }), Mi = ({
2716
2686
  itemCount: t,
2717
2687
  getItem: e,
2718
2688
  getItemKey: r,
@@ -2720,15 +2690,15 @@ const hi = 1e4, Di = () => {
2720
2690
  viewportSize: i,
2721
2691
  overscanCount: s = 15,
2722
2692
  className: o,
2723
- testId: c,
2693
+ testId: l,
2724
2694
  onScroll: f,
2725
2695
  onRangeChange: g,
2726
- children: b,
2696
+ children: x,
2727
2697
  background: R,
2728
2698
  initialScrollIndex: T,
2729
2699
  initialScrollOffset: S,
2730
- initialScrollAnchor: C,
2731
- callbackThrottleMs: Z = 5,
2700
+ initialScrollAnchor: N,
2701
+ callbackThrottleMs: j = 5,
2732
2702
  contentInsets: F,
2733
2703
  onItemFocus: Te,
2734
2704
  scrollBarOptions: ze,
@@ -2736,31 +2706,31 @@ const hi = 1e4, Di = () => {
2736
2706
  onWheelHorizontal: k,
2737
2707
  onPanHorizontal: ce,
2738
2708
  horizontalKeyInputs: L,
2739
- horizontalKeyStep: E = pi,
2740
- contentProps: V,
2741
- liveRegion: J,
2709
+ horizontalKeyStep: P = vi,
2710
+ contentProps: C,
2711
+ liveRegion: K,
2742
2712
  locale: B,
2743
2713
  labels: H
2744
- }, Q) => {
2745
- const { width: oe, enableThumbDrag: ge, enableTrackClick: Xe, enableArrowButtons: y, enableScrollToTopBottomButtons: se, renderThumbOverlay: ne, tapScrollCircleOptions: Le } = ze ?? {}, te = Me(() => Sn(B, H), [B, H]), { enablePointerDrag: Ye, pointerDragInputs: xe, enableKeyboardNavigation: ie = !0, enableEscapeRowReturn: Qe = !1, wheelSpeedMultiplier: at, inertiaOptions: et, overscrollBehavior: wt, clipItemHeight: qe = !1, resetOnGetItemHeightChange: Be = !1 } = D ?? {}, [Ce, lt] = ke(0), ee = i ?? Ce, Oe = w((l) => {
2746
- lt((h) => h === l ? h : l);
2747
- }, []), Re = d(null), ue = d({
2714
+ }, J) => {
2715
+ const { width: ie, enableThumbDrag: ge, enableTrackClick: $e, enableArrowButtons: y, enableScrollToTopBottomButtons: re, renderThumbOverlay: ne, tapScrollCircleOptions: Xe } = ze ?? {}, de = Me(() => In(B, H), [B, H]), { enablePointerDrag: Ue, pointerDragInputs: xe, enableKeyboardNavigation: te = !0, enableEscapeRowReturn: Qe = !1, wheelSpeedMultiplier: at, inertiaOptions: et, overscrollBehavior: wt, clipItemHeight: qe = !1, resetOnGetItemHeightChange: Ye = !1 } = D ?? {}, [Ne, ct] = _e(0), Q = i ?? Ne, Le = w((c) => {
2716
+ ct((h) => h === c ? h : c);
2717
+ }, []), Re = d(null), le = d({
2748
2718
  renderingStartIndex: 0,
2749
2719
  renderingEndIndex: 0,
2750
2720
  visibleStartIndex: 0,
2751
2721
  visibleEndIndex: 0,
2752
2722
  scrollPosition: 0,
2753
2723
  totalHeight: 0
2754
- }), be = d(C && t > 0 ? { index: re(Math.trunc(C.index), 0, t - 1), align: "top", offset: -Math.max(0, C.offsetPx ?? 0) } : null), fe = d(!1), xt = d(!0);
2724
+ }), be = d(N && t > 0 ? { index: ee(Math.trunc(N.index), 0, t - 1), align: "top", offset: -Math.max(0, N.offsetPx ?? 0) } : null), fe = d(!1), xt = d(!0);
2755
2725
  X(() => {
2756
2726
  if (xt.current) {
2757
2727
  xt.current = !1;
2758
2728
  return;
2759
2729
  }
2760
- Be && (be.current = null);
2761
- }, [Be, n]);
2762
- const M = Me(() => fn(F), [F]), [He] = ke(() => {
2763
- const h = C?.index ?? T, v = typeof h == "number" && Number.isFinite(h) ? Math.max(0, Math.trunc(h)) : 0;
2730
+ Ye && (be.current = null);
2731
+ }, [Ye, n]);
2732
+ const M = Me(() => mn(F), [F]), [Fe] = _e(() => {
2733
+ const h = N?.index ?? T, v = typeof h == "number" && Number.isFinite(h) ? Math.max(0, Math.trunc(h)) : 0;
2764
2734
  return { from: Math.max(0, v - 50), to: v + 50 };
2765
2735
  }), he = Me(
2766
2736
  // 目的: Fenwick Tree のオプション設定
@@ -2768,68 +2738,68 @@ const hi = 1e4, Di = () => {
2768
2738
  // itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
2769
2739
  // この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
2770
2740
  () => ({
2771
- sampleRange: He,
2772
- resetOnValueFnChange: Be,
2741
+ sampleRange: Fe,
2742
+ resetOnValueFnChange: Ye,
2773
2743
  materialize: !0
2774
2744
  }),
2775
- [Be, He]
2776
- ), O = Rn(t, n, he), [dt] = ke(() => {
2777
- let l = 0, h = 0;
2778
- if (C && t > 0) {
2779
- const v = re(Math.trunc(C.index), 0, t - 1), q = Math.max(0, C.offsetPx ?? 0), Y = re(v - s * 2, 0, t - 1), W = re(v + s * 2, 0, t - 1), K = v > 0 || q > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: Y, to: W }] } } : void 0, { cumulative: ye, total: Ue, currentValue: Ae } = O.prefixSum(v, K), De = Math.max(ye - Ae + q, 0);
2780
- l = ar(De, M.top), h = Ue ?? O.getTotal();
2745
+ [Ye, Fe]
2746
+ ), _ = Nn(t, n, he), [dt] = _e(() => {
2747
+ let c = 0, h = 0;
2748
+ if (N && t > 0) {
2749
+ const v = ee(Math.trunc(N.index), 0, t - 1), q = Math.max(0, N.offsetPx ?? 0), Y = ee(v - s * 2, 0, t - 1), W = ee(v + s * 2, 0, t - 1), G = v > 0 || q > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: Y, to: W }] } } : void 0, { cumulative: ye, total: We, currentValue: Ae } = _.prefixSum(v, G), De = Math.max(ye - Ae + q, 0);
2750
+ c = cr(De, M.top), h = We ?? _.getTotal();
2781
2751
  } else if (typeof T == "number") {
2782
- const v = re(T, 0, t - 1), q = re(v - s * 2, 0, t - 1), Y = re(v + s * 2, 0, t - 1), W = T > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: q, to: Y }] } } : void 0, { cumulative: K, total: ye, currentValue: Ue } = O.prefixSum(T, W), Ae = Math.max(K - Ue, 0);
2783
- l = ar(Ae, M.top), h = ye ?? O.getTotal();
2784
- } else typeof S == "number" && (l = ar(Math.max(S, 0), M.top)), h = O.getTotal();
2785
- return { position: l, total: h };
2786
- }), [tt, Nt] = ke(dt.position), [St, x] = ke(dt.total), N = d(dt.position), de = d(M.top), G = d(f ?? void 0), ae = d(g ?? void 0), me = d(k), Ge = (L?.length ?? 0) > 0, ve = !!k;
2752
+ const v = ee(T, 0, t - 1), q = ee(v - s * 2, 0, t - 1), Y = ee(v + s * 2, 0, t - 1), W = T > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: q, to: Y }] } } : void 0, { cumulative: G, total: ye, currentValue: We } = _.prefixSum(T, W), Ae = Math.max(G - We, 0);
2753
+ c = cr(Ae, M.top), h = ye ?? _.getTotal();
2754
+ } else typeof S == "number" && (c = cr(Math.max(S, 0), M.top)), h = _.getTotal();
2755
+ return { position: c, total: h };
2756
+ }), [tt, Vt] = _e(dt.position), [St, b] = _e(dt.total), V = d(dt.position), ue = d(M.top), Z = d(f ?? void 0), se = d(g ?? void 0), me = d(k), Ge = (L?.length ?? 0) > 0, ve = !!k;
2787
2757
  X(() => {
2788
- Ge && (ie || A.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), ve || A.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(E) && E > 0 || A.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${E}. Horizontal arrow keys are left untouched.`));
2789
- }, [Ge, ve, ie, E]);
2790
- const We = d(/* @__PURE__ */ new Map()), Ie = d(null), _e = d(null), [mt, rt] = ke(null), [nt, $e] = ke(!1), ct = d(null), we = d(!1), pe = d(0), Mt = d(!1), m = d(!1), z = d(t);
2758
+ Ge && (te || A.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), ve || A.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(P) && P > 0 || A.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${P}. Horizontal arrow keys are left untouched.`));
2759
+ }, [Ge, ve, te, P]);
2760
+ const Be = d(/* @__PURE__ */ new Map()), Ie = d(null), Oe = d(null), [mt, rt] = _e(null), [nt, ke] = _e(!1), lt = d(null), we = d(!1), pe = d(0), Mt = d(!1), m = d(!1), z = d(t);
2791
2761
  z.current !== t && (z.current = t, m.current = !0), Je(() => {
2792
- G.current = f ?? void 0, ae.current = g ?? void 0, me.current = k;
2762
+ Z.current = f ?? void 0, se.current = g ?? void 0, me.current = k;
2793
2763
  }, [g, f, k]);
2794
2764
  const Pe = w(
2795
- (l) => {
2796
- if (ie && l && typeof l.focus == "function")
2765
+ (c) => {
2766
+ if (te && c && typeof c.focus == "function")
2797
2767
  try {
2798
- l.focus({ preventScroll: !0 });
2768
+ c.focus({ preventScroll: !0 });
2799
2769
  } catch {
2800
- l.focus();
2770
+ c.focus();
2801
2771
  }
2802
2772
  },
2803
- [ie]
2804
- ), it = w((l, { position: h, totalHeight: v }) => {
2805
- l(h, v);
2806
- }, []), Ne = hn(G, Z, it), Pt = w((l, h) => {
2807
- l(h);
2808
- }, []), st = hn(ae, Z, Pt), ut = d(M.top);
2773
+ [te]
2774
+ ), it = w((c, { position: h, totalHeight: v }) => {
2775
+ c(h, v);
2776
+ }, []), Ve = pn(Z, j, it), Pt = w((c, h) => {
2777
+ c(h);
2778
+ }, []), st = pn(se, j, Pt), ut = d(M.top);
2809
2779
  ut.current = M.top;
2810
- const Ve = d(Ne);
2811
- Ve.current = Ne, X(() => (fe.current = !1, () => {
2812
- fe.current = !0, ct.current && (clearTimeout(ct.current), ct.current = null);
2780
+ const Ce = d(Ve);
2781
+ Ce.current = Ve, X(() => (fe.current = !1, () => {
2782
+ fe.current = !0, lt.current && (clearTimeout(lt.current), lt.current = null);
2813
2783
  }), []), X(() => {
2814
- ie || (We.current.clear(), Ie.current = null, _e.current = null);
2815
- }, [ie]);
2784
+ te || (Be.current.clear(), Ie.current = null, Oe.current = null);
2785
+ }, [te]);
2816
2786
  const Yt = w(
2817
- (l, h) => {
2787
+ (c, h) => {
2818
2788
  if (!h) {
2819
- We.current.delete(l);
2789
+ Be.current.delete(c);
2820
2790
  return;
2821
2791
  }
2822
- ie && (We.current.set(l, h), Ie.current === l && (Ie.current = null, _e.current = l, Pe(h)));
2792
+ te && (Be.current.set(c, h), Ie.current === c && (Ie.current = null, Oe.current = c, Pe(h)));
2823
2793
  },
2824
- [ie, Pe]
2794
+ [te, Pe]
2825
2795
  ), lr = 0.01, Bt = d({
2826
2796
  rafId: null,
2827
2797
  loopActive: !1,
2828
2798
  idleFrames: 0,
2829
2799
  lastRenderedPosition: dt.position
2830
2800
  }), Se = w(() => {
2831
- const l = Bt.current;
2832
- l.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(l.rafId), l.rafId = null, l.loopActive = !1, l.idleFrames = 0;
2801
+ const c = Bt.current;
2802
+ c.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(c.rafId), c.rafId = null, c.loopActive = !1, c.idleFrames = 0;
2833
2803
  }, []);
2834
2804
  X(
2835
2805
  () => () => {
@@ -2839,255 +2809,255 @@ const hi = 1e4, Di = () => {
2839
2809
  );
2840
2810
  const Lt = d(() => {
2841
2811
  }), Zt = w(() => {
2842
- const l = Bt.current;
2843
- l.rafId = null;
2844
- const h = N.current, v = Rt(h, ut.current), q = O.getTotal();
2845
- if (Nt((W) => Math.abs(W - h) < lr ? W : h), Math.abs(l.lastRenderedPosition - h) >= lr ? (Ve.current({ position: v, totalHeight: q }), l.lastRenderedPosition = h, l.idleFrames = 0) : l.idleFrames += 1, l.idleFrames >= 2) {
2812
+ const c = Bt.current;
2813
+ c.rafId = null;
2814
+ const h = V.current, v = Rt(h, ut.current), q = _.getTotal();
2815
+ if (Vt((W) => Math.abs(W - h) < lr ? W : h), Math.abs(c.lastRenderedPosition - h) >= lr ? (Ce.current({ position: v, totalHeight: q }), c.lastRenderedPosition = h, c.idleFrames = 0) : c.idleFrames += 1, c.idleFrames >= 2) {
2846
2816
  Se();
2847
2817
  return;
2848
2818
  }
2849
2819
  if (typeof requestAnimationFrame == "function") {
2850
- l.rafId = requestAnimationFrame((W) => Lt.current(W));
2820
+ c.rafId = requestAnimationFrame((W) => Lt.current(W));
2851
2821
  return;
2852
2822
  }
2853
- l.loopActive = !1;
2854
- }, [O, Se]);
2823
+ c.loopActive = !1;
2824
+ }, [_, Se]);
2855
2825
  Lt.current = Zt;
2856
- const sr = w(() => {
2857
- const l = Bt.current;
2858
- if (l.idleFrames = 0, !l.loopActive) {
2859
- if (l.loopActive = !0, typeof requestAnimationFrame == "function") {
2860
- l.rafId = requestAnimationFrame(Zt);
2826
+ const or = w(() => {
2827
+ const c = Bt.current;
2828
+ if (c.idleFrames = 0, !c.loopActive) {
2829
+ if (c.loopActive = !0, typeof requestAnimationFrame == "function") {
2830
+ c.rafId = requestAnimationFrame(Zt);
2861
2831
  return;
2862
2832
  }
2863
- l.loopActive = !1;
2833
+ c.loopActive = !1;
2864
2834
  }
2865
2835
  }, [Zt]), Ee = w(
2866
- (l, h) => {
2867
- const v = h?.immediate ?? !1, q = Rt(l, M.top);
2868
- if (N.current = l, v) {
2869
- Bt.current.lastRenderedPosition = l, Bt.current.idleFrames = 0, Nt(l), Ne({ position: q, totalHeight: O.getTotal() });
2836
+ (c, h) => {
2837
+ const v = h?.immediate ?? !1, q = Rt(c, M.top);
2838
+ if (V.current = c, v) {
2839
+ Bt.current.lastRenderedPosition = c, Bt.current.idleFrames = 0, Vt(c), Ve({ position: q, totalHeight: _.getTotal() });
2870
2840
  return;
2871
2841
  }
2872
- sr();
2842
+ or();
2873
2843
  },
2874
- [sr, O, M.top, Ne]
2875
- ), It = w((l, h = 0) => {
2844
+ [or, _, M.top, Ve]
2845
+ ), It = w((c, h = 0) => {
2876
2846
  const v = Re.current;
2877
2847
  if (!v)
2878
- return l;
2848
+ return c;
2879
2849
  const q = v.getScrollPosition();
2880
2850
  pe.current += 1;
2881
- const Y = v.getContentSize() + h, W = v.getViewportSize(), K = v.scrollTo(l, { contentSize: Y, viewportSize: W });
2882
- return K === q && (pe.current = Math.max(0, pe.current - 1)), Math.abs(K - l) > 0.5 && (Mt.current = !0), K;
2851
+ const Y = v.getContentSize() + h, W = v.getViewportSize(), G = v.scrollTo(c, { contentSize: Y, viewportSize: W });
2852
+ return G === q && (pe.current = Math.max(0, pe.current - 1)), Math.abs(G - c) > 0.5 && (Mt.current = !0), G;
2883
2853
  }, []), Wt = d(!1);
2884
2854
  X(() => {
2885
2855
  if (!Wt.current)
2886
- if (Wt.current = !0, C == null && typeof T != "number" && typeof S == "number") {
2887
- const l = ar(Math.max(S, 0), M.top), h = Math.abs(l - N.current) > 0.5;
2888
- Ee(l, { immediate: !0 }), h && Re.current?.scrollTo(l);
2856
+ if (Wt.current = !0, N == null && typeof T != "number" && typeof S == "number") {
2857
+ const c = cr(Math.max(S, 0), M.top), h = Math.abs(c - V.current) > 0.5;
2858
+ Ee(c, { immediate: !0 }), h && Re.current?.scrollTo(c);
2889
2859
  } else
2890
- Ee(N.current, { immediate: !0 });
2891
- }, [C, T, S, M.top, Ee]), X(() => {
2892
- const l = O.getTotal();
2893
- if (St !== l) {
2894
- x(l);
2860
+ Ee(V.current, { immediate: !0 });
2861
+ }, [N, T, S, M.top, Ee]), X(() => {
2862
+ const c = _.getTotal();
2863
+ if (St !== c) {
2864
+ b(c);
2895
2865
  return;
2896
2866
  }
2897
2867
  if (Mt.current) {
2898
2868
  Mt.current = !1;
2899
2869
  const h = Re.current;
2900
- if (h && Math.abs(h.getScrollPosition() - N.current) > 0.5) {
2901
- const v = It(N.current);
2870
+ if (h && Math.abs(h.getScrollPosition() - V.current) > 0.5) {
2871
+ const v = It(V.current);
2902
2872
  Mt.current = !1, Ee(v, { immediate: !0 });
2903
2873
  }
2904
2874
  }
2905
- }, [O, St, t, It, Ee]), X(() => {
2875
+ }, [_, St, t, It, Ee]), X(() => {
2906
2876
  if (be.current !== null) {
2907
- const { index: l, align: h, offset: v } = be.current, q = Ze(l, t), { cumulative: Y, currentValue: W } = O.prefixSum(q, { materializeOption: { materialize: !1 } });
2877
+ const { index: c, align: h, offset: v } = be.current, q = Ze(c, t), { cumulative: Y, currentValue: W } = _.prefixSum(q, { materializeOption: { materialize: !1 } });
2908
2878
  if (Y !== void 0 && W !== void 0) {
2909
- const K = Math.max(Y - W, 0);
2910
- let ye = K;
2911
- h === "bottom" ? ye = Y - ee : h === "center" && (ye = K + W / 2 - ee / 2), v && (ye -= v), ye = Math.max(0, ye);
2912
- const Ue = Math.max(0, St + M.top + M.bottom - ee), Ae = Math.min(ar(ye, M.top), Ue);
2913
- Math.abs(Ae - N.current) > 1 && (A.debug("[VirtualScroll] Drift correction", {
2914
- from: N.current,
2879
+ const G = Math.max(Y - W, 0);
2880
+ let ye = G;
2881
+ h === "bottom" ? ye = Y - Q : h === "center" && (ye = G + W / 2 - Q / 2), v && (ye -= v), ye = Math.max(0, ye);
2882
+ const We = Math.max(0, St + M.top + M.bottom - Q), Ae = Math.min(cr(ye, M.top), We);
2883
+ Math.abs(Ae - V.current) > 1 && (A.debug("[VirtualScroll] Drift correction", {
2884
+ from: V.current,
2915
2885
  to: Ae,
2916
2886
  targetIndex: q
2917
2887
  }), pe.current === 0 && (pe.current += 1), Re.current?.scrollTo(Ae), Ee(Ae, { immediate: !0 }));
2918
2888
  }
2919
2889
  }
2920
2890
  m.current = !1;
2921
- }, [St, O, t, M.top, Ee, ee, M.bottom]), X(() => {
2922
- const l = de.current;
2923
- if (l === M.top || (de.current = M.top, be.current))
2891
+ }, [St, _, t, M.top, Ee, Q, M.bottom]), X(() => {
2892
+ const c = ue.current;
2893
+ if (c === M.top || (ue.current = M.top, be.current))
2924
2894
  return;
2925
- const h = Rt(N.current, l), v = ar(h, M.top);
2926
- N.current = v, Re.current?.scrollTo(v), Ee(v, { immediate: !0 });
2895
+ const h = Rt(V.current, c), v = cr(h, M.top);
2896
+ V.current = v, Re.current?.scrollTo(v), Ee(v, { immediate: !0 });
2927
2897
  }, [M.top, Ee]);
2928
2898
  const Ht = w(
2929
- (l, h) => {
2899
+ (c, h) => {
2930
2900
  if (t === 0)
2931
2901
  return;
2932
- const v = Ze(l, t), q = O.get(v), Y = h - q, W = O.update(v, h);
2933
- W !== void 0 && x(W), A.debug("[VirtualScroll] Updated item size manually", { index: v, size: h, total: W });
2934
- let K = be.current ? be.current.index : null;
2935
- if (K === null) {
2936
- const ye = N.current, Ue = fn(F).top, Ae = Rt(ye, Ue), { index: De, cumulative: ft } = O.findIndexAtOrAfter(Ae, { materializeOption: { materialize: !1 } });
2937
- K = ft !== void 0 && ft === Ae ? De + 1 : De;
2902
+ const v = Ze(c, t), q = _.get(v), Y = h - q, W = _.update(v, h);
2903
+ W !== void 0 && b(W), A.debug("[VirtualScroll] Updated item size manually", { index: v, size: h, total: W });
2904
+ let G = be.current ? be.current.index : null;
2905
+ if (G === null) {
2906
+ const ye = V.current, We = mn(F).top, Ae = Rt(ye, We), { index: De, cumulative: ft } = _.findIndexAtOrAfter(Ae, { materializeOption: { materialize: !1 } });
2907
+ G = ft !== void 0 && ft === Ae ? De + 1 : De;
2938
2908
  }
2939
- if (K !== -1 && v < K && Y !== 0) {
2940
- const ye = N.current, Ue = ye + Y;
2941
- It(Ue, Y), Ee(Ue, { immediate: !0 }), A.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: ye, to: Ue, causedByIndex: v, delta: Y, activeVisibleStartIndex: K });
2909
+ if (G !== -1 && v < G && Y !== 0) {
2910
+ const ye = V.current, We = ye + Y;
2911
+ It(We, Y), Ee(We, { immediate: !0 }), A.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: ye, to: We, causedByIndex: v, delta: Y, activeVisibleStartIndex: G });
2942
2912
  }
2943
2913
  },
2944
- [O, t, It, Ee, F]
2914
+ [_, t, It, Ee, F]
2945
2915
  ), bt = w(
2946
- (l, h) => {
2916
+ (c, h) => {
2947
2917
  if (!Re.current || t === 0)
2948
2918
  return;
2949
- const v = Ze(l, t), q = Ze(v - s * 2, t), Y = Ze(v + s * 2, t), { cumulative: W, total: K, currentValue: ye } = O.prefixSum(v, { materializeOption: { materialize: !0, ranges: [{ from: q, to: Y }] } });
2950
- if (A.debug("[VirtualScroll] Scrolling to index:", v, "ItemBottom:", W, "Total height:", K, "ItemHeight:", ye, "safeIndexFrom:", q, "safeIndexTo:", Y), !K)
2919
+ const v = Ze(c, t), q = Ze(v - s * 2, t), Y = Ze(v + s * 2, t), { cumulative: W, total: G, currentValue: ye } = _.prefixSum(v, { materializeOption: { materialize: !0, ranges: [{ from: q, to: Y }] } });
2920
+ if (A.debug("[VirtualScroll] Scrolling to index:", v, "ItemBottom:", W, "Total height:", G, "ItemHeight:", ye, "safeIndexFrom:", q, "safeIndexTo:", Y), !G)
2951
2921
  return;
2952
- const Ue = Math.max(W - ye, 0);
2953
- let Ae = Ue;
2954
- h?.align === "bottom" ? Ae = W - ee : h?.align === "center" && (Ae = Ue + ye / 2 - ee / 2), h?.offset && (Ae -= h.offset), Ae = Math.max(0, Ae);
2955
- const De = ar(Ae, M.top), ft = Re.current?.getContentSize() ?? K + M.top + M.bottom, ht = Math.max(0, ft - ee), gt = Math.min(De, ht);
2922
+ const We = Math.max(W - ye, 0);
2923
+ let Ae = We;
2924
+ h?.align === "bottom" ? Ae = W - Q : h?.align === "center" && (Ae = We + ye / 2 - Q / 2), h?.offset && (Ae -= h.offset), Ae = Math.max(0, Ae);
2925
+ const De = cr(Ae, M.top), ft = Re.current?.getContentSize() ?? G + M.top + M.bottom, ht = Math.max(0, ft - Q), gt = Math.min(De, ht);
2956
2926
  be.current = {
2957
2927
  index: v,
2958
2928
  align: h?.align,
2959
2929
  offset: h?.offset
2960
2930
  };
2961
- const nr = Re.current?.getScrollPosition() ?? -1, pr = Math.abs(nr - gt) > 0.5;
2962
- we.current = !1, pe.current = 0, pr && (we.current = !0, pe.current += 1, Re.current?.scrollTo(gt)), x(K), Ee(gt, { immediate: !0 }), A.debug("[VirtualScroll] Setting scroll position to:", gt, { original: De, max: ht });
2931
+ const nr = Re.current?.getScrollPosition() ?? -1, gr = Math.abs(nr - gt) > 0.5;
2932
+ we.current = !1, pe.current = 0, gr && (we.current = !0, pe.current += 1, Re.current?.scrollTo(gt)), b(G), Ee(gt, { immediate: !0 }), A.debug("[VirtualScroll] Setting scroll position to:", gt, { original: De, max: ht });
2963
2933
  },
2964
- [O, s, t, M.top, M.bottom, ee, Ee]
2965
- ), u = d(C && t === 0 ? C : null);
2934
+ [_, s, t, M.top, M.bottom, Q, Ee]
2935
+ ), u = d(N && t === 0 ? N : null);
2966
2936
  X(() => {
2967
- const l = u.current;
2968
- !l || t === 0 || (u.current = null, bt(re(Math.trunc(l.index), 0, t - 1), { align: "top", offset: -Math.max(0, l.offsetPx ?? 0) }));
2937
+ const c = u.current;
2938
+ !c || t === 0 || (u.current = null, bt(ee(Math.trunc(c.index), 0, t - 1), { align: "top", offset: -Math.max(0, c.offsetPx ?? 0) }));
2969
2939
  }, [t, bt]);
2970
- const P = w(
2971
- (l) => {
2940
+ const E = w(
2941
+ (c) => {
2972
2942
  if (!Re.current || t === 0)
2973
2943
  return;
2974
- const h = O.getTotal(), v = re(Math.floor(l), 0, h), { index: q, cumulative: Y, currentValue: W } = O.findIndexAtOrAfter(v, { materializeOption: { materialize: !1 } }), ye = (Y ?? 0) - (W ?? 0) - v;
2944
+ const h = _.getTotal(), v = ee(Math.floor(c), 0, h), { index: q, cumulative: Y, currentValue: W } = _.findIndexAtOrAfter(v, { materializeOption: { materialize: !1 } }), ye = (Y ?? 0) - (W ?? 0) - v;
2975
2945
  bt(q, { offset: ye });
2976
2946
  },
2977
- [O, t, bt]
2978
- ), _ = w(() => {
2947
+ [_, t, bt]
2948
+ ), O = w(() => {
2979
2949
  if (t === 0)
2980
2950
  return null;
2981
- const l = Rt(N.current, M.top), { index: h, cumulative: v, currentValue: q } = O.findIndexAtOrAfter(l, { materializeOption: { materialize: !1 } });
2951
+ const c = Rt(V.current, M.top), { index: h, cumulative: v, currentValue: q } = _.findIndexAtOrAfter(c, { materializeOption: { materialize: !1 } });
2982
2952
  if (h === -1)
2983
2953
  return { index: t - 1, offsetPx: 0 };
2984
- if (v === l)
2985
- return { index: re(h + 1, 0, t - 1), offsetPx: 0 };
2954
+ if (v === c)
2955
+ return { index: ee(h + 1, 0, t - 1), offsetPx: 0 };
2986
2956
  const Y = (v ?? 0) - (q ?? 0);
2987
- return { index: h, offsetPx: Math.max(0, l - Y) };
2988
- }, [O, t, M.top]), j = w(
2989
- (l) => {
2990
- const h = Rt(N.current, M.top), v = typeof l == "function" ? l(h) : l;
2991
- P(v);
2992
- const q = Re.current?.getScrollPosition(), Y = typeof q == "number" ? q : N.current;
2957
+ return { index: h, offsetPx: Math.max(0, c - Y) };
2958
+ }, [_, t, M.top]), oe = w(
2959
+ (c) => {
2960
+ const h = Rt(V.current, M.top), v = typeof c == "function" ? c(h) : c;
2961
+ E(v);
2962
+ const q = Re.current?.getScrollPosition(), Y = typeof q == "number" ? q : V.current;
2993
2963
  return Ee(Y), Rt(Y, ut.current);
2994
2964
  },
2995
- [M.top, P, Ee]
2996
- ), Fe = w((l) => {
2965
+ [M.top, E, Ee]
2966
+ ), He = w((c) => {
2997
2967
  const h = Re.current;
2998
2968
  if (!h)
2999
- return Rt(N.current, ut.current);
3000
- const v = h.scrollTo((q) => q + l);
2969
+ return Rt(V.current, ut.current);
2970
+ const v = h.scrollTo((q) => q + c);
3001
2971
  return Rt(v, ut.current);
3002
- }, []), je = w((l) => Re.current?.applyWheel(l) ?? !1, []), pt = w(
3003
- (l, h) => {
3004
- A.debug("[VirtualScroll] Scroll position changed:", l);
2972
+ }, []), je = w((c) => Re.current?.applyWheel(c) ?? !1, []), pt = w(
2973
+ (c, h) => {
2974
+ A.debug("[VirtualScroll] Scroll position changed:", c);
3005
2975
  const v = we.current;
3006
2976
  v && (we.current = !1);
3007
2977
  const q = pe.current > 0;
3008
2978
  q && (pe.current = 0);
3009
2979
  const Y = m.current && z.current === t;
3010
- if (v || q || Y || (be.current = null), Ee(l), se) {
2980
+ if (v || q || Y || (be.current = null), Ee(c), re) {
3011
2981
  if (v || q)
3012
2982
  return;
3013
- const W = l - h;
3014
- if (A.debug("[VirtualScroll] Scroll diff:", W, "New:", l, "Prev:", h), Math.abs(W) > 1) {
3015
- const K = W > 0 ? "down" : "up";
3016
- rt(K), $e(!0), A.debug("[VirtualScroll] Showing scroll buttons. Direction:", K), ct.current && clearTimeout(ct.current), ct.current = setTimeout(() => {
3017
- $e(!1), A.debug("[VirtualScroll] Hiding scroll buttons");
2983
+ const W = c - h;
2984
+ if (A.debug("[VirtualScroll] Scroll diff:", W, "New:", c, "Prev:", h), Math.abs(W) > 1) {
2985
+ const G = W > 0 ? "down" : "up";
2986
+ rt(G), ke(!0), A.debug("[VirtualScroll] Showing scroll buttons. Direction:", G), lt.current && clearTimeout(lt.current), lt.current = setTimeout(() => {
2987
+ ke(!1), A.debug("[VirtualScroll] Hiding scroll buttons");
3018
2988
  }, 2e3);
3019
2989
  }
3020
2990
  }
3021
2991
  },
3022
- [Ee, se, t]
2992
+ [Ee, re, t]
3023
2993
  ), Ke = Me(() => Rt(tt, M.top), [M.top, tt]), Ot = Me(() => {
3024
- const l = O.getTotal(), h = En(Ke, ee, s, t, n, O, l);
2994
+ const c = _.getTotal(), h = Cn(Ke, Q, s, t, n, _, c);
3025
2995
  return A.debug("[VirtualScroll] Calculated rendering range:", () => ({
3026
2996
  ...h,
3027
2997
  scrollPosition: Ke,
3028
- renderingContentSize: l,
2998
+ renderingContentSize: c,
3029
2999
  overscanCount: s,
3030
- viewportSize: ee
3000
+ viewportSize: Q
3031
3001
  })), h;
3032
- }, [Ke, ee, s, t, n, O]), { renderingStartIndex: yt, renderingEndIndex: _t, visibleStartIndex: Ft, visibleEndIndex: Jt } = Ot, Et = w(
3033
- (l, h) => {
3034
- if (!ie || t === 0)
3002
+ }, [Ke, Q, s, t, n, _]), { renderingStartIndex: yt, renderingEndIndex: _t, visibleStartIndex: Ft, visibleEndIndex: Jt } = Ot, Et = w(
3003
+ (c, h) => {
3004
+ if (!te || t === 0)
3035
3005
  return;
3036
- const v = Ze(l, t);
3006
+ const v = Ze(c, t);
3037
3007
  if (!(h?.ensureVisible ?? !0)) {
3038
- const ht = We.current.get(v);
3039
- ht && (Ie.current = null, _e.current = v, Pe(ht));
3008
+ const ht = Be.current.get(v);
3009
+ ht && (Ie.current = null, Oe.current = v, Pe(ht));
3040
3010
  return;
3041
3011
  }
3042
- const Y = O.prefixSum(v, { materializeOption: { materialize: !1 } }), W = Y.currentValue, K = Math.max(Y.cumulative - W, 0), ye = K + W, Ue = Rt(N.current, M.top), Ae = Ue + ee;
3043
- if (K < Ue || ye > Ae) {
3012
+ const Y = _.prefixSum(v, { materializeOption: { materialize: !1 } }), W = Y.currentValue, G = Math.max(Y.cumulative - W, 0), ye = G + W, We = Rt(V.current, M.top), Ae = We + Q;
3013
+ if (G < We || ye > Ae) {
3044
3014
  bt(v);
3045
- const ht = We.current.get(v);
3046
- ht ? (Ie.current = null, _e.current = v, Pe(ht)) : Ie.current = v;
3015
+ const ht = Be.current.get(v);
3016
+ ht ? (Ie.current = null, Oe.current = v, Pe(ht)) : Ie.current = v;
3047
3017
  return;
3048
3018
  }
3049
- const ft = We.current.get(v);
3019
+ const ft = Be.current.get(v);
3050
3020
  if (ft) {
3051
- Ie.current = null, _e.current = v, Pe(ft);
3021
+ Ie.current = null, Oe.current = v, Pe(ft);
3052
3022
  return;
3053
3023
  }
3054
3024
  Ie.current = v;
3055
3025
  },
3056
- [ie, t, O, M.top, bt, Pe, ee]
3026
+ [te, t, _, M.top, bt, Pe, Q]
3057
3027
  ), Ut = w(
3058
- (l, h) => {
3059
- if (!(!ie || l.defaultPrevented) && !(l.altKey || l.metaKey || l.ctrlKey) && l.target === l.currentTarget && !l.currentTarget.isContentEditable) {
3060
- if (l.key === "ArrowLeft" || l.key === "ArrowRight") {
3028
+ (c, h) => {
3029
+ if (!(!te || c.defaultPrevented) && !(c.altKey || c.metaKey || c.ctrlKey) && c.target === c.currentTarget && !c.currentTarget.isContentEditable) {
3030
+ if (c.key === "ArrowLeft" || c.key === "ArrowRight") {
3061
3031
  const v = me.current;
3062
- if (!v || l.shiftKey || !L?.includes("arrow") || !(Number.isFinite(E) && E > 0))
3032
+ if (!v || c.shiftKey || !L?.includes("arrow") || !(Number.isFinite(P) && P > 0))
3063
3033
  return;
3064
- l.preventDefault(), v(l.key === "ArrowLeft" ? -E : E);
3034
+ c.preventDefault(), v(c.key === "ArrowLeft" ? -P : P);
3065
3035
  return;
3066
3036
  }
3067
- if (l.key === "ArrowDown") {
3068
- h < t - 1 && (l.preventDefault(), Et(h + 1));
3037
+ if (c.key === "ArrowDown") {
3038
+ h < t - 1 && (c.preventDefault(), Et(h + 1));
3069
3039
  return;
3070
3040
  }
3071
- if (l.key === "ArrowUp") {
3072
- h > 0 && (l.preventDefault(), Et(h - 1));
3041
+ if (c.key === "ArrowUp") {
3042
+ h > 0 && (c.preventDefault(), Et(h - 1));
3073
3043
  return;
3074
3044
  }
3075
- if (l.key === "PageDown") {
3045
+ if (c.key === "PageDown") {
3076
3046
  if (h < t - 1) {
3077
- l.preventDefault();
3078
- const { visibleStartIndex: v, visibleEndIndex: q } = ue.current, Y = Math.max(q - v + 1, 1), W = Math.max(Y, 1), K = Ze(Math.min(h + W, t - 1), t);
3079
- Et(K);
3047
+ c.preventDefault();
3048
+ const { visibleStartIndex: v, visibleEndIndex: q } = le.current, Y = Math.max(q - v + 1, 1), W = Math.max(Y, 1), G = Ze(Math.min(h + W, t - 1), t);
3049
+ Et(G);
3080
3050
  }
3081
3051
  return;
3082
3052
  }
3083
- if (l.key === "PageUp" && h > 0) {
3084
- l.preventDefault();
3085
- const { visibleStartIndex: v, visibleEndIndex: q } = ue.current, Y = Math.max(q - v + 1, 1), W = Math.max(Y, 1), K = Ze(h - W, t);
3086
- Et(K);
3053
+ if (c.key === "PageUp" && h > 0) {
3054
+ c.preventDefault();
3055
+ const { visibleStartIndex: v, visibleEndIndex: q } = le.current, Y = Math.max(q - v + 1, 1), W = Math.max(Y, 1), G = Ze(h - W, t);
3056
+ Et(G);
3087
3057
  }
3088
3058
  }
3089
3059
  },
3090
- [ie, t, Et, L, E]
3060
+ [te, t, Et, L, P]
3091
3061
  ), Gt = w(
3092
3062
  /**
3093
3063
  * Returns focus from an element inside the row back to the row wrapper on Escape.
@@ -3096,24 +3066,24 @@ const hi = 1e4, Di = () => {
3096
3066
  * @param event - Keyboard event (bubble phase on the row wrapper) / 行ラッパー bubble フェーズのキーイベント
3097
3067
  * @param index - Row index / 行インデックス
3098
3068
  */
3099
- (l, h) => {
3100
- if (l.key !== "Escape" || l.defaultPrevented || l.nativeEvent.isComposing || l.target === l.currentTarget)
3069
+ (c, h) => {
3070
+ if (c.key !== "Escape" || c.defaultPrevented || c.nativeEvent.isComposing || c.target === c.currentTarget)
3101
3071
  return;
3102
- const v = l.target;
3103
- v instanceof HTMLInputElement || v instanceof HTMLTextAreaElement || v instanceof HTMLSelectElement || v.isContentEditable || (l.preventDefault(), Et(h));
3072
+ const v = c.target;
3073
+ v instanceof HTMLInputElement || v instanceof HTMLTextAreaElement || v instanceof HTMLSelectElement || v.isContentEditable || (c.preventDefault(), Et(h));
3104
3074
  },
3105
3075
  [Et]
3106
- ), hr = w(
3107
- (l) => {
3108
- if (!ie)
3076
+ ), mr = w(
3077
+ (c) => {
3078
+ if (!te)
3109
3079
  return;
3110
- const h = Ze(l, t);
3111
- Ie.current = null, _e.current = h, Te?.(h);
3080
+ const h = Ze(c, t);
3081
+ Ie.current = null, Oe.current = h, Te?.(h);
3112
3082
  },
3113
- [ie, t, Te]
3083
+ [te, t, Te]
3114
3084
  );
3115
3085
  X(() => {
3116
- const l = Re.current?.getScrollPosition() ?? 0, h = N.current, v = Rt(h, M.top);
3086
+ const c = Re.current?.getScrollPosition() ?? 0, h = V.current, v = Rt(h, M.top);
3117
3087
  A.debug("[VirtualScroll] Range change effect triggered", () => ({
3118
3088
  renderingStartIndex: yt,
3119
3089
  renderingEndIndex: _t,
@@ -3123,7 +3093,7 @@ const hi = 1e4, Di = () => {
3123
3093
  paneScrollPosition: h,
3124
3094
  logicalScrollPosition: v,
3125
3095
  contentSize: St,
3126
- scrollPaneScrollPosition: l
3096
+ scrollPaneScrollPosition: c
3127
3097
  })), st({
3128
3098
  renderingStartIndex: yt,
3129
3099
  renderingEndIndex: _t,
@@ -3133,101 +3103,101 @@ const hi = 1e4, Di = () => {
3133
3103
  totalHeight: St
3134
3104
  });
3135
3105
  }, [St, _t, yt, M.top, st, tt, Jt, Ft]);
3136
- const Vt = w(() => {
3137
- if (!se)
3106
+ const Ct = w(() => {
3107
+ if (!re)
3138
3108
  return null;
3139
- const l = nt && mt !== null;
3140
- return /* @__PURE__ */ U("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": l, inert: !l, children: mt === "up" ? /* @__PURE__ */ U("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ U(
3109
+ const c = nt && mt !== null;
3110
+ return /* @__PURE__ */ U("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": c, inert: !c, children: mt === "up" ? /* @__PURE__ */ U("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ U(
3141
3111
  "button",
3142
3112
  {
3143
3113
  type: "button",
3144
3114
  className: "aqvs-scroll-to-edge-button",
3145
- tabIndex: l ? 0 : -1,
3115
+ tabIndex: c ? 0 : -1,
3146
3116
  onClick: (v) => {
3147
- v.stopPropagation(), we.current = !0, bt(0), $e(!1);
3117
+ v.stopPropagation(), we.current = !0, bt(0), ke(!1);
3148
3118
  },
3149
- children: te.scrollToTop
3119
+ children: de.scrollToTop
3150
3120
  }
3151
3121
  ) }) : /* @__PURE__ */ U("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ U(
3152
3122
  "button",
3153
3123
  {
3154
3124
  type: "button",
3155
3125
  className: "aqvs-scroll-to-edge-button",
3156
- tabIndex: l ? 0 : -1,
3126
+ tabIndex: c ? 0 : -1,
3157
3127
  onClick: (v) => {
3158
- v.stopPropagation(), we.current = !0, bt(t - 1), $e(!1);
3128
+ v.stopPropagation(), we.current = !0, bt(t - 1), ke(!1);
3159
3129
  },
3160
- children: te.scrollToBottom
3130
+ children: de.scrollToBottom
3161
3131
  }
3162
3132
  ) }) });
3163
- }, [se, nt, mt, bt, t, te]), At = d(0), { visibleItems: $t, renderAnchor: Dt } = Me(() => {
3133
+ }, [re, nt, mt, bt, t, de]), At = d(0), { visibleItems: $t, renderAnchor: Dt } = Me(() => {
3164
3134
  if (t === 0)
3165
3135
  return {
3166
- visibleItems: /* @__PURE__ */ U("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ U("div", { className: "aqvs-no-items-text", children: te.noItems }) }),
3136
+ visibleItems: /* @__PURE__ */ U("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ U("div", { className: "aqvs-no-items-text", children: de.noItems }) }),
3167
3137
  renderAnchor: 0
3168
3138
  };
3169
- const l = Ze(yt, t), h = Ze(_t, t), { cumulative: v, currentValue: q } = O.prefixSum(l, { materializeOption: { materialize: !1 } }), Y = v - q;
3170
- Number.isFinite(Y) && Math.abs(Y - At.current) > Pn && (At.current = Y);
3171
- const W = At.current, K = [], ye = [];
3172
- let Ue = 0, Ae = Y;
3173
- for (let De = l; De <= h; De++) {
3174
- if (ye.length >= Br) {
3175
- A.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Br, safeRenderingStartIndex: l, safeRenderingEndIndex: h });
3139
+ const c = Ze(yt, t), h = Ze(_t, t), { cumulative: v, currentValue: q } = _.prefixSum(c, { materializeOption: { materialize: !1 } }), Y = v - q;
3140
+ Number.isFinite(Y) && Math.abs(Y - At.current) > Vn && (At.current = Y);
3141
+ const W = At.current, G = [], ye = [];
3142
+ let We = 0, Ae = Y;
3143
+ for (let De = c; De <= h; De++) {
3144
+ if (ye.length >= Ur) {
3145
+ A.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Ur, safeRenderingStartIndex: c, safeRenderingEndIndex: h });
3176
3146
  break;
3177
3147
  }
3178
- const ft = n(De), ht = O.get(De), gt = ft - ht;
3179
- gt !== 0 && K.push({ index: De, value: ft });
3180
- const nr = Ae + Ue, pr = r ? r(De) : De;
3148
+ const ft = n(De), ht = _.get(De), gt = ft - ht;
3149
+ gt !== 0 && G.push({ index: De, value: ft });
3150
+ const nr = Ae + We, gr = r ? r(De) : De;
3181
3151
  ye.push(
3182
3152
  /* @__PURE__ */ U(
3183
- xi,
3153
+ Si,
3184
3154
  {
3185
3155
  index: De,
3186
3156
  top: nr - W,
3187
3157
  height: ft,
3188
3158
  item: e(De),
3189
3159
  clipItemHeight: qe,
3190
- enableKeyboardNavigation: ie,
3160
+ enableKeyboardNavigation: te,
3191
3161
  onKeyDown: Ut,
3192
3162
  onEscapeKeyDown: Qe ? Gt : void 0,
3193
- onFocus: hr,
3163
+ onFocus: mr,
3194
3164
  registerItemRef: Yt,
3195
- children: b
3165
+ children: x
3196
3166
  },
3197
- pr
3167
+ gr
3198
3168
  )
3199
- ), Ue += gt, Ae += ht;
3169
+ ), We += gt, Ae += ht;
3200
3170
  }
3201
- return K.length > 0 && Promise.resolve().then(() => {
3171
+ return G.length > 0 && Promise.resolve().then(() => {
3202
3172
  if (fe.current)
3203
3173
  return;
3204
3174
  let De = 0;
3205
- for (const gt of K)
3175
+ for (const gt of G)
3206
3176
  if (gt.index < Ft) {
3207
- const nr = O.get(gt.index);
3177
+ const nr = _.get(gt.index);
3208
3178
  De += gt.value - nr;
3209
3179
  }
3210
- const ft = O.updates(K);
3180
+ const ft = _.updates(G);
3211
3181
  if (fe.current || typeof ft != "number")
3212
3182
  return;
3213
- x(ft), A.debug("[VirtualScroll] Updated heights for items", K, "New total height:", ft);
3214
- const ht = Re.current?.getScrollPosition() ?? N.current;
3183
+ b(ft), A.debug("[VirtualScroll] Updated heights for items", G, "New total height:", ft);
3184
+ const ht = Re.current?.getScrollPosition() ?? V.current;
3215
3185
  if (De !== 0) {
3216
3186
  const gt = ht + De;
3217
3187
  It(gt, De), Ee(gt, { immediate: !0 }), A.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: ht, to: gt, shiftAmount: De });
3218
- } else ht !== N.current && Ee(ht);
3188
+ } else ht !== V.current && Ee(ht);
3219
3189
  }), { visibleItems: ye, renderAnchor: W };
3220
3190
  }, [
3221
- b,
3191
+ x,
3222
3192
  qe,
3223
3193
  St,
3224
- ie,
3194
+ te,
3225
3195
  t,
3226
- O,
3196
+ _,
3227
3197
  e,
3228
3198
  r,
3229
3199
  n,
3230
- hr,
3200
+ mr,
3231
3201
  Ut,
3232
3202
  Qe,
3233
3203
  Gt,
@@ -3235,31 +3205,31 @@ const hi = 1e4, Di = () => {
3235
3205
  Yt,
3236
3206
  _t,
3237
3207
  yt,
3238
- te,
3208
+ de,
3239
3209
  Ee,
3240
3210
  Ft
3241
3211
  ]), Qt = w(
3242
- (l) => {
3243
- const h = (Z ?? 0) > 0, v = Math.abs(l - tt), q = h && v > 0.5 ? tt : l, Y = Rt(q, M.top);
3212
+ (c) => {
3213
+ const h = (j ?? 0) > 0, v = Math.abs(c - tt), q = h && v > 0.5 ? tt : c, Y = Rt(q, M.top);
3244
3214
  if (A.debug("[VirtualScroll] Rendering visible items", () => ({
3245
- currentScrollPosition: l,
3215
+ currentScrollPosition: c,
3246
3216
  effectiveScrollPosition: Y,
3247
3217
  renderingStartIndex: yt,
3248
3218
  renderingEndIndex: _t,
3249
3219
  itemCount: t,
3250
- viewportSize: ee,
3251
- callbackThrottleMs: Z,
3220
+ viewportSize: Q,
3221
+ callbackThrottleMs: j,
3252
3222
  diff: v,
3253
3223
  rawEffectiveScrollPosition: q
3254
3224
  })), t === 0)
3255
3225
  return $t;
3256
- const W = M.top + Dt - q, K = M.bottom > 0 ? /* @__PURE__ */ U(
3226
+ const W = M.top + Dt - q, G = M.bottom > 0 ? /* @__PURE__ */ U(
3257
3227
  "div",
3258
3228
  {
3259
3229
  className: "aqvs-bottom-inset",
3260
3230
  style: {
3261
3231
  // ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
3262
- top: O.getTotal() - Dt,
3232
+ top: _.getTotal() - Dt,
3263
3233
  height: M.bottom
3264
3234
  }
3265
3235
  },
@@ -3272,10 +3242,10 @@ const hi = 1e4, Di = () => {
3272
3242
  effectiveScrollPosition: Y
3273
3243
  })), /* @__PURE__ */ qt("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${W}px)`, willChange: "transform" }, children: [
3274
3244
  $t,
3275
- K
3245
+ G
3276
3246
  ] });
3277
3247
  },
3278
- [Z, t, O, Ke, Dt, _t, yt, M, tt, ee, $t]
3248
+ [j, t, _, Ke, Dt, _t, yt, M, tt, Q, $t]
3279
3249
  ), er = Me(
3280
3250
  () => ({
3281
3251
  renderingStartIndex: Ot.renderingStartIndex,
@@ -3283,114 +3253,114 @@ const hi = 1e4, Di = () => {
3283
3253
  visibleStartIndex: Ot.visibleStartIndex,
3284
3254
  visibleEndIndex: Ot.visibleEndIndex,
3285
3255
  scrollPosition: Ke,
3286
- totalHeight: O.getTotal()
3256
+ totalHeight: _.getTotal()
3287
3257
  // contentSize (State) ではなく最新値を反映
3288
3258
  }),
3289
3259
  // contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
3290
3260
  // (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
3291
- [Ot, Ke, O, St]
3261
+ [Ot, Ke, _, St]
3292
3262
  );
3293
3263
  X(() => {
3294
- ue.current = er;
3264
+ le.current = er;
3295
3265
  }, [er]);
3296
- const [tr, Tt] = ke(""), rr = d(J);
3266
+ const [tr, Tt] = _e(""), rr = d(K);
3297
3267
  Je(() => {
3298
- rr.current = J;
3299
- }, [J]);
3300
- const zt = J?.debounceMs ?? 400, vt = Number.isFinite(zt) && zt >= 0, or = J !== void 0;
3268
+ rr.current = K;
3269
+ }, [K]);
3270
+ const zt = K?.debounceMs ?? 400, vt = Number.isFinite(zt) && zt >= 0, ar = K !== void 0;
3301
3271
  X(() => {
3302
- or && !vt && A.warn(`[VirtualScroll] liveRegion.debounceMs must be a finite number >= 0, received ${zt}. Announcements are disabled.`);
3303
- }, [or, vt, zt]), X(() => {
3304
- if (!(or && vt)) {
3272
+ ar && !vt && A.warn(`[VirtualScroll] liveRegion.debounceMs must be a finite number >= 0, received ${zt}. Announcements are disabled.`);
3273
+ }, [ar, vt, zt]), X(() => {
3274
+ if (!(ar && vt)) {
3305
3275
  Tt("");
3306
3276
  return;
3307
3277
  }
3308
- const l = setTimeout(() => {
3278
+ const c = setTimeout(() => {
3309
3279
  const h = rr.current?.format;
3310
3280
  if (!h)
3311
3281
  return;
3312
3282
  const v = h({ visibleStartIndex: Ft, visibleEndIndex: Jt, itemCount: t });
3313
3283
  Tt(v);
3314
3284
  }, zt);
3315
- return () => clearTimeout(l);
3316
- }, [or, vt, zt, Ft, Jt, t]), Nr(
3317
- Q,
3285
+ return () => clearTimeout(c);
3286
+ }, [ar, vt, zt, Ft, Jt, t]), Ar(
3287
+ J,
3318
3288
  () => ({
3319
3289
  getScrollPosition: () => {
3320
- const l = Re.current?.getScrollPosition();
3321
- return typeof l == "number" ? Rt(l, ut.current) : -1;
3290
+ const c = Re.current?.getScrollPosition();
3291
+ return typeof c == "number" ? Rt(c, ut.current) : -1;
3322
3292
  },
3323
3293
  getContentSize: () => Re.current?.getContentSize() ?? -1,
3324
3294
  getViewportSize: () => Re.current?.getViewportSize() ?? -1,
3325
- scrollTo: j,
3326
- scrollBy: Fe,
3295
+ scrollTo: oe,
3296
+ scrollBy: He,
3327
3297
  applyWheel: je,
3328
3298
  scrollToIndex: bt,
3329
- getFenwickTreeTotalHeight: () => O.getTotal(),
3330
- getFenwickSize: () => O.getSize(),
3299
+ getFenwickTreeTotalHeight: () => _.getTotal(),
3300
+ getFenwickSize: () => _.getSize(),
3331
3301
  focusItemAtIndex: Et,
3332
- getRange: () => ue.current,
3333
- getScrollAnchor: _,
3302
+ getRange: () => le.current,
3303
+ getScrollAnchor: O,
3334
3304
  updateItemSize: Ht
3335
3305
  }),
3336
- [j, Fe, je, bt, O, Et, _, Ht]
3306
+ [oe, He, je, bt, _, Et, O, Ht]
3337
3307
  );
3338
- const jt = O.getTotal() + M.top + M.bottom, mr = /* @__PURE__ */ U(
3339
- li,
3308
+ const jt = _.getTotal() + M.top + M.bottom, pr = /* @__PURE__ */ U(
3309
+ fi,
3340
3310
  {
3341
3311
  ref: Re,
3342
3312
  contentSize: jt,
3343
3313
  viewportSize: i,
3344
- onViewportSizeChange: Oe,
3314
+ onViewportSizeChange: Le,
3345
3315
  className: o,
3346
- testId: c,
3316
+ testId: l,
3347
3317
  onScroll: pt,
3348
3318
  background: R,
3349
- tapScrollCircleOptions: Le,
3319
+ tapScrollCircleOptions: Xe,
3350
3320
  inertiaOptions: et,
3351
3321
  overscrollBehavior: wt,
3352
3322
  itemCount: t,
3353
- scrollBarWidth: oe,
3323
+ scrollBarWidth: ie,
3354
3324
  enableThumbDrag: ge,
3355
- enableTrackClick: Xe,
3325
+ enableTrackClick: $e,
3356
3326
  enableArrowButtons: y,
3357
- enablePointerDrag: Ye,
3327
+ enablePointerDrag: Ue,
3358
3328
  pointerDragInputs: xe,
3359
3329
  renderThumbOverlay: ne,
3360
3330
  wheelSpeedMultiplier: at,
3361
3331
  onWheelHorizontal: k,
3362
3332
  onPanHorizontal: ce,
3363
3333
  contentInsets: M,
3364
- contentProps: V,
3334
+ contentProps: C,
3365
3335
  visibleStartIndex: Ft,
3366
3336
  visibleEndIndex: Jt,
3367
- renderOverlay: Vt,
3337
+ renderOverlay: Ct,
3368
3338
  initialScrollPosition: dt.position,
3369
3339
  locale: B,
3370
3340
  labels: H,
3371
3341
  children: Qt
3372
3342
  }
3373
3343
  );
3374
- return or ? /* @__PURE__ */ qt(Wr, { children: [
3375
- mr,
3344
+ return ar ? /* @__PURE__ */ qt(Gr, { children: [
3345
+ pr,
3376
3346
  /* @__PURE__ */ U("div", { className: "aqvs-live-region", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-aqvs-live-region": "", children: tr })
3377
- ] }) : mr;
3378
- }, vi = Cr(bi), zr = 262144, mn = 3, wi = 32768, pn = 128, gn = 128, xn = 128, bn = 128, kr = 10, Si = (t, e) => Math.max(1, Math.floor((t ?? wi) / Math.max(1, e))), Mi = (t, e, r, n, i) => {
3379
- let s = 0, o = 0, c = Math.max(0, Math.min(n, r - 1));
3380
- for (; c < r && s < t && o < Br; )
3381
- s += e(c), o += 1, c += 1;
3347
+ ] }) : pr;
3348
+ }, Ii = Cr(Mi), Vr = 262144, gn = 3, yi = 32768, xn = 128, bn = 128, vn = 128, wn = 128, $r = 10, Ti = (t, e) => Math.max(1, Math.floor((t ?? yi) / Math.max(1, e))), Ri = (t, e, r, n, i) => {
3349
+ let s = 0, o = 0, l = Math.max(0, Math.min(n, r - 1));
3350
+ for (; l < r && s < t && o < Ur; )
3351
+ s += e(l), o += 1, l += 1;
3382
3352
  return Math.max(1, o + 2 * i + 2);
3383
- }, Pr = (t, e, r) => {
3384
- if (!(Number.isInteger(t) && t >= 0 && t <= zr))
3353
+ }, zr = (t, e, r) => {
3354
+ if (!(Number.isInteger(t) && t >= 0 && t <= Vr))
3385
3355
  throw new RangeError(
3386
- `[VirtualGrid] ${e === "row" ? "getRowHeight" : "getColWidth"}(${r}) returned ${t} — must be an integer in [0, ${zr}] (0 = hidden). Oversized tracks would pierce the browser layout-coordinate wall (see the design plan §3.1/§6).`
3356
+ `[VirtualGrid] ${e === "row" ? "getRowHeight" : "getColWidth"}(${r}) returned ${t} — must be an integer in [0, ${Vr}] (0 = hidden). Oversized tracks would pierce the browser layout-coordinate wall (see the design plan §3.1/§6).`
3387
3357
  );
3388
3358
  return t;
3389
- }, Ii = (t, e, r, n, i, s, o, c) => {
3390
- const f = En(t, e, r, n, i, s, o);
3359
+ }, Pi = (t, e, r, n, i, s, o, l) => {
3360
+ const f = Cn(t, e, r, n, i, s, o);
3391
3361
  if (n === 0)
3392
3362
  return { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0 };
3393
- const g = re(f.renderingStartIndex, 0, n - 1), { cumulative: b, currentValue: R } = s.prefixSum(g, { materializeOption: { materialize: !1 } }), T = b - R, S = Number.isFinite(T) && Math.abs(T - c) > Pn ? T : c;
3363
+ const g = ee(f.renderingStartIndex, 0, n - 1), { cumulative: x, currentValue: R } = s.prefixSum(g, { materializeOption: { materialize: !1 } }), T = x - R, S = Number.isFinite(T) && Math.abs(T - l) > Vn ? T : l;
3394
3364
  return {
3395
3365
  renderingColStart: f.renderingStartIndex,
3396
3366
  renderingColEnd: f.renderingEndIndex,
@@ -3398,46 +3368,46 @@ const hi = 1e4, Di = () => {
3398
3368
  visibleColEnd: f.visibleEndIndex,
3399
3369
  colAnchor: S
3400
3370
  };
3401
- }, vn = [], yi = (t, e, r, n, i) => {
3371
+ }, Sn = [], Ei = (t, e, r, n, i) => {
3402
3372
  const s = [], o = [];
3403
3373
  if (e < t)
3404
3374
  return { columns: s, widthUpdates: o, truncated: 0 };
3405
- const c = n.prefixSum(t, { materializeOption: { materialize: !1 } });
3406
- let f = c.cumulative - c.currentValue, g = 0, b = t;
3407
- for (; b <= e; ) {
3375
+ const l = n.prefixSum(t, { materializeOption: { materialize: !1 } });
3376
+ let f = l.cumulative - l.currentValue, g = 0, x = t;
3377
+ for (; x <= e; ) {
3408
3378
  if (s.length >= i)
3409
- return { columns: s, widthUpdates: o, truncated: e - b + 1 };
3410
- const R = r(b), T = n.get(b);
3411
- if (R !== T && o.push({ index: b, value: R }), R > 0) {
3412
- s.push({ col: b, left: f, width: R }), f += T, g = 0, b += 1;
3379
+ return { columns: s, widthUpdates: o, truncated: e - x + 1 };
3380
+ const R = r(x), T = n.get(x);
3381
+ if (R !== T && o.push({ index: x, value: R }), R > 0) {
3382
+ s.push({ col: x, left: f, width: R }), f += T, g = 0, x += 1;
3413
3383
  continue;
3414
3384
  }
3415
- if (f += T, g += 1, b += 1, g > wr) {
3385
+ if (f += T, g += 1, x += 1, g > Mr) {
3416
3386
  const S = n.findIndexAtOrAfter(f + 0.5, { materializeOption: { materialize: !1 } });
3417
- if (S.index === -1 || S.index <= b || !Number.isSafeInteger(S.index))
3387
+ if (S.index === -1 || S.index <= x || !Number.isSafeInteger(S.index))
3418
3388
  break;
3419
- const C = n.prefixSum(S.index, { materializeOption: { materialize: !1 } });
3420
- f = C.cumulative - C.currentValue, b = S.index, g = 0;
3389
+ const N = n.prefixSum(S.index, { materializeOption: { materialize: !1 } });
3390
+ f = N.cumulative - N.currentValue, x = S.index, g = 0;
3421
3391
  }
3422
3392
  }
3423
3393
  return { columns: s, widthUpdates: o, truncated: 0 };
3424
- }, Ti = (t, e, r) => {
3394
+ }, zi = (t, e, r) => {
3425
3395
  const n = [], i = [];
3426
3396
  let s = 0;
3427
3397
  for (let o = 0; o < t; o += 1) {
3428
- const c = e(o), f = r.get(o);
3429
- c !== f && i.push({ index: o, value: c }), c > 0 && n.push({ col: o, left: s, width: c }), s += f;
3398
+ const l = e(o), f = r.get(o);
3399
+ l !== f && i.push({ index: o, value: l }), l > 0 && n.push({ col: o, left: s, width: l }), s += f;
3430
3400
  }
3431
3401
  return { columns: n, widthUpdates: i, width: s };
3432
- }, Ri = (t, e, r, n) => {
3402
+ }, Ni = (t, e, r, n) => {
3433
3403
  const i = [], s = [];
3434
3404
  let o = 0;
3435
- for (let c = t - e; c < t; c += 1) {
3436
- const f = r(c), g = n.get(c);
3437
- f !== g && s.push({ index: c, value: f }), f > 0 && i.push({ col: c, left: o, width: f }), o += g;
3405
+ for (let l = t - e; l < t; l += 1) {
3406
+ const f = r(l), g = n.get(l);
3407
+ f !== g && s.push({ index: l, value: f }), f > 0 && i.push({ col: l, left: o, width: f }), o += g;
3438
3408
  }
3439
3409
  return { columns: i, widthUpdates: s, width: o };
3440
- }, Er = (t, e, r) => Math.min(t, Math.max(0, r - e)), Pi = { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0, key: "0:0:0" }, Ei = ({
3410
+ }, Nr = (t, e, r) => Math.min(t, Math.max(0, r - e)), Vi = { renderingColStart: 0, renderingColEnd: 0, visibleColStart: 0, visibleColEnd: 0, colAnchor: 0, key: "0:0:0" }, Ci = ({
3441
3411
  rowCount: t,
3442
3412
  colCount: e,
3443
3413
  getRowHeight: r,
@@ -3445,15 +3415,15 @@ const hi = 1e4, Di = () => {
3445
3415
  getCell: i,
3446
3416
  getCellKey: s,
3447
3417
  children: o,
3448
- getCellProps: c,
3418
+ getCellProps: l,
3449
3419
  getRowProps: f,
3450
3420
  contentProps: g,
3451
- background: b,
3421
+ background: x,
3452
3422
  contentInsets: R,
3453
3423
  onRowFocus: T,
3454
3424
  frozenLeadingCols: S = 0,
3455
- frozenLeadingRows: C = 0,
3456
- frozenTrailingCols: Z = 0,
3425
+ frozenLeadingRows: N = 0,
3426
+ frozenTrailingCols: j = 0,
3457
3427
  frozenTrailingRows: F = 0,
3458
3428
  horizontalKeyInputs: Te,
3459
3429
  horizontalKeyStep: ze,
@@ -3461,46 +3431,46 @@ const hi = 1e4, Di = () => {
3461
3431
  onRangeChange: k,
3462
3432
  onRenderTruncated: ce,
3463
3433
  callbackThrottleMs: L,
3464
- initialScrollAnchor: E,
3465
- overscanRows: V = mn,
3466
- overscanCols: J = mn,
3434
+ initialScrollAnchor: P,
3435
+ overscanRows: C = gn,
3436
+ overscanCols: K = gn,
3467
3437
  viewportSize: B,
3468
3438
  __maxRenderedCells: H,
3469
- behaviorOptions: Q,
3470
- scrollBarOptions: oe,
3439
+ behaviorOptions: J,
3440
+ scrollBarOptions: ie,
3471
3441
  liveRegion: ge,
3472
- locale: Xe,
3442
+ locale: $e,
3473
3443
  labels: y,
3474
- className: se,
3444
+ className: re,
3475
3445
  testId: ne
3476
- }, Le) => {
3477
- const te = d(null), Ye = d(null), xe = d(r);
3446
+ }, Xe) => {
3447
+ const de = d(null), Ue = d(null), xe = d(r);
3478
3448
  xe.current = r;
3479
- const ie = d(n);
3480
- ie.current = n;
3481
- const Qe = Q?.resetOnGetColWidthChange === !0, et = Q?.resetOnGetItemHeightChange === !0 ? r : null, wt = Qe ? n : null, qe = w(
3482
- (a) => Pr(xe.current(a), "row", a),
3449
+ const te = d(n);
3450
+ te.current = n;
3451
+ const Qe = J?.resetOnGetColWidthChange === !0, et = J?.resetOnGetItemHeightChange === !0 ? r : null, wt = Qe ? n : null, qe = w(
3452
+ (a) => zr(xe.current(a), "row", a),
3483
3453
  [et]
3484
- ), Be = w(
3485
- (a) => Pr(ie.current(a), "col", a),
3454
+ ), Ye = w(
3455
+ (a) => zr(te.current(a), "col", a),
3486
3456
  [wt]
3487
- ), Ce = Q?.defaultColWidth, lt = Me(() => {
3488
- if (Ce !== void 0 && !(Number.isInteger(Ce) && Ce >= 0 && Ce <= zr))
3489
- throw new RangeError(`[VirtualGrid] behaviorOptions.defaultColWidth must be an integer in [0, ${zr}], received ${Ce}.`);
3490
- return { resetOnValueFnChange: Qe, baseValue: Ce };
3491
- }, [Qe, Ce]), ee = Rn(e, Be, lt), [Oe, Re] = ke(0);
3492
- if (!(Number.isInteger(S) && S >= 0 && S <= pn))
3493
- throw new RangeError(`[VirtualGrid] frozenLeadingCols must be an integer in [0, ${pn}], received ${S}.`);
3494
- const ue = Math.min(S, e), be = d(0);
3495
- if (!(Number.isInteger(Z) && Z >= 0 && Z <= xn))
3496
- throw new RangeError(`[VirtualGrid] frozenTrailingCols must be an integer in [0, ${xn}], received ${Z}.`);
3497
- const fe = Math.min(Z, e - ue), xt = d(0);
3498
- if (!(Number.isInteger(C) && C >= 0 && C <= gn))
3499
- throw new RangeError(`[VirtualGrid] frozenLeadingRows must be an integer in [0, ${gn}], received ${C}.`);
3500
- const M = Math.min(C, t);
3501
- if (!(Number.isInteger(F) && F >= 0 && F <= bn))
3502
- throw new RangeError(`[VirtualGrid] frozenTrailingRows must be an integer in [0, ${bn}], received ${F}.`);
3503
- const He = Math.min(F, t - M), he = Math.max(0, t - M - He), O = d(!1), dt = d(0), tt = d(0), [Nt, St] = ke(0), { frozenRows: x, frozenHeight: N } = Me(() => {
3457
+ ), Ne = J?.defaultColWidth, ct = Me(() => {
3458
+ if (Ne !== void 0 && !(Number.isInteger(Ne) && Ne >= 0 && Ne <= Vr))
3459
+ throw new RangeError(`[VirtualGrid] behaviorOptions.defaultColWidth must be an integer in [0, ${Vr}], received ${Ne}.`);
3460
+ return { resetOnValueFnChange: Qe, baseValue: Ne };
3461
+ }, [Qe, Ne]), Q = Nn(e, Ye, ct), [Le, Re] = _e(0);
3462
+ if (!(Number.isInteger(S) && S >= 0 && S <= xn))
3463
+ throw new RangeError(`[VirtualGrid] frozenLeadingCols must be an integer in [0, ${xn}], received ${S}.`);
3464
+ const le = Math.min(S, e), be = d(0);
3465
+ if (!(Number.isInteger(j) && j >= 0 && j <= vn))
3466
+ throw new RangeError(`[VirtualGrid] frozenTrailingCols must be an integer in [0, ${vn}], received ${j}.`);
3467
+ const fe = Math.min(j, e - le), xt = d(0);
3468
+ if (!(Number.isInteger(N) && N >= 0 && N <= bn))
3469
+ throw new RangeError(`[VirtualGrid] frozenLeadingRows must be an integer in [0, ${bn}], received ${N}.`);
3470
+ const M = Math.min(N, t);
3471
+ if (!(Number.isInteger(F) && F >= 0 && F <= wn))
3472
+ throw new RangeError(`[VirtualGrid] frozenTrailingRows must be an integer in [0, ${wn}], received ${F}.`);
3473
+ const Fe = Math.min(F, t - M), he = Math.max(0, t - M - Fe), _ = d(!1), dt = d(0), tt = d(0), [Vt, St] = _e(0), { frozenRows: b, frozenHeight: V } = Me(() => {
3504
3474
  if (M === 0)
3505
3475
  return { frozenRows: [], frozenHeight: 0 };
3506
3476
  const a = [];
@@ -3510,93 +3480,93 @@ const hi = 1e4, Di = () => {
3510
3480
  $ > 0 && a.push({ row: I, top: p, height: $ }), p += $;
3511
3481
  }
3512
3482
  return { frozenRows: a, frozenHeight: p };
3513
- }, [M, Nt, qe]);
3514
- dt.current = N;
3515
- const [de, G] = ke(0), { trailingRows: ae, trailingHeight: me } = Me(() => {
3516
- if (He === 0)
3483
+ }, [M, Vt, qe]);
3484
+ dt.current = V;
3485
+ const [ue, Z] = _e(0), { trailingRows: se, trailingHeight: me } = Me(() => {
3486
+ if (Fe === 0)
3517
3487
  return { trailingRows: [], trailingHeight: 0 };
3518
3488
  const a = [];
3519
3489
  let p = 0;
3520
- for (let I = t - He; I < t; I += 1) {
3490
+ for (let I = t - Fe; I < t; I += 1) {
3521
3491
  const $ = qe(I);
3522
3492
  $ > 0 && a.push({ row: I, top: p, height: $ }), p += $;
3523
3493
  }
3524
3494
  return { trailingRows: a, trailingHeight: p };
3525
- }, [He, t, de, qe]);
3495
+ }, [Fe, t, ue, qe]);
3526
3496
  tt.current = me;
3527
3497
  const Ge = w((a) => qe(a + M), [qe, M]), ve = d(T);
3528
3498
  ve.current = T;
3529
- const We = T !== void 0, Ie = Me(() => We ? (a) => ve.current?.(a + M) : void 0, [M, We]), _e = N, mt = me, [rt, nt] = ke(M), $e = d(null), ct = d(!1);
3499
+ const Be = T !== void 0, Ie = Me(() => Be ? (a) => ve.current?.(a + M) : void 0, [M, Be]), Oe = V, mt = me, [rt, nt] = _e(M), ke = d(null), lt = d(!1);
3530
3500
  if (rt !== M) {
3531
- nt(M), ct.current = !0;
3532
- const a = te.current?.getScrollAnchor() ?? null;
3533
- $e.current = a === null ? null : { row: a.index + rt, offsetPx: a.offsetPx };
3501
+ nt(M), lt.current = !0;
3502
+ const a = de.current?.getScrollAnchor() ?? null;
3503
+ ke.current = a === null ? null : { row: a.index + rt, offsetPx: a.offsetPx };
3534
3504
  }
3535
- const we = d(0), pe = d(0), Mt = d(!1), [m, z] = ke(Pi), Pe = d(m);
3505
+ const we = d(0), pe = d(0), Mt = d(!1), [m, z] = _e(Vi), Pe = d(m);
3536
3506
  Pe.current = m;
3537
- const it = d(0), [Ne, Pt] = ke(() => ee.getTotal() ?? 0), st = d(Ne);
3538
- st.current = Ne;
3507
+ const it = d(0), [Ve, Pt] = _e(() => Q.getTotal() ?? 0), st = d(Ve);
3508
+ st.current = Ve;
3539
3509
  const ut = w((a) => {
3540
3510
  typeof a == "number" && Number.isFinite(a) && (st.current = a, Pt(a));
3541
3511
  }, []);
3542
3512
  Je(() => {
3543
- const a = ee.getTotal();
3513
+ const a = Q.getTotal();
3544
3514
  typeof a == "number" && Number.isFinite(a) && a !== st.current && ut(a);
3545
3515
  });
3546
- const Ve = oe?.width ?? 12, Yt = B === void 0 ? null : { width: Math.max(0, Math.round(B.width) - Ve), height: Math.max(0, Math.round(B.height) - Ve) }, [lr, Bt] = ke({ width: 0, height: 0 }), Se = Yt ?? lr, Lt = d(Se);
3516
+ const Ce = ie?.width ?? 12, Yt = B === void 0 ? null : { width: Math.max(0, Math.round(B.width) - Ce), height: Math.max(0, Math.round(B.height) - Ce) }, [lr, Bt] = _e({ width: 0, height: 0 }), Se = Yt ?? lr, Lt = d(Se);
3547
3517
  Lt.current = Se;
3548
- const Zt = Se.height > 0 && Se.height - N - me <= 0;
3549
- O.current = Zt;
3550
- const sr = Yt !== null;
3518
+ const Zt = Se.height > 0 && Se.height - V - me <= 0;
3519
+ _.current = Zt;
3520
+ const or = Yt !== null;
3551
3521
  Je(() => {
3552
- if (sr)
3522
+ if (or)
3553
3523
  return;
3554
- const a = Ye.current;
3524
+ const a = Ue.current;
3555
3525
  if (a === null)
3556
3526
  return;
3557
3527
  const p = () => {
3558
- const $ = Math.max(0, Math.round(a.clientWidth) - Ve), le = Math.max(0, Math.round(a.clientHeight) - Ve);
3559
- Bt((ot) => ot.width === $ && ot.height === le ? ot : { width: $, height: le });
3528
+ const $ = Math.max(0, Math.round(a.clientWidth) - Ce), ae = Math.max(0, Math.round(a.clientHeight) - Ce);
3529
+ Bt((ot) => ot.width === $ && ot.height === ae ? ot : { width: $, height: ae });
3560
3530
  };
3561
3531
  p();
3562
3532
  const I = new ResizeObserver(p);
3563
3533
  return I.observe(a), () => I.disconnect();
3564
- }, [Ve, sr]);
3534
+ }, [Ce, or]);
3565
3535
  const Ee = w(() => {
3566
- const a = Ye.current;
3536
+ const a = Ue.current;
3567
3537
  a !== null && a.style.setProperty("--aqvs-grid-hx-residual", `${it.current - we.current}px`);
3568
3538
  }, []), It = w(() => Math.max(0, Lt.current.width - be.current - xt.current), []), Wt = w(() => Math.max(0, st.current - be.current - xt.current - It()), [It]), Ht = w(() => {
3569
- const a = It(), p = Ii(be.current + we.current, a, J, e, Be, ee, st.current, Pe.current.colAnchor);
3570
- if (ue > 0 && (p.renderingColStart = Math.max(p.renderingColStart, ue), p.visibleColStart = Math.max(p.visibleColStart, ue)), fe > 0) {
3539
+ const a = It(), p = Pi(be.current + we.current, a, K, e, Ye, Q, st.current, Pe.current.colAnchor);
3540
+ if (le > 0 && (p.renderingColStart = Math.max(p.renderingColStart, le), p.visibleColStart = Math.max(p.visibleColStart, le)), fe > 0) {
3571
3541
  const $ = e - fe - 1;
3572
3542
  p.renderingColEnd = Math.min(p.renderingColEnd, $), p.visibleColEnd = Math.min(p.visibleColEnd, $);
3573
3543
  }
3574
- (ue > 0 || fe > 0) && (a <= 0 || p.renderingColStart > p.renderingColEnd) && (p.renderingColStart = e, p.renderingColEnd = e - 1, p.visibleColStart = e, p.visibleColEnd = e - 1);
3544
+ (le > 0 || fe > 0) && (a <= 0 || p.renderingColStart > p.renderingColEnd) && (p.renderingColStart = e, p.renderingColEnd = e - 1, p.visibleColStart = e, p.visibleColEnd = e - 1);
3575
3545
  const I = `${p.renderingColStart}:${p.renderingColEnd}:${p.colAnchor}`;
3576
3546
  I !== Pe.current.key && z({ ...p, key: I });
3577
- }, [J, e, Be, ee, ue, fe, It]), [bt, u] = ke(0), P = d(null), _ = w(() => {
3578
- P.current === null && (P.current = requestAnimationFrame(() => {
3579
- P.current = null, u(we.current);
3547
+ }, [K, e, Ye, Q, le, fe, It]), [bt, u] = _e(0), E = d(null), O = w(() => {
3548
+ E.current === null && (E.current = requestAnimationFrame(() => {
3549
+ E.current = null, u(we.current);
3580
3550
  }));
3581
3551
  }, []);
3582
3552
  X(
3583
3553
  () => () => {
3584
- P.current !== null && cancelAnimationFrame(P.current);
3554
+ E.current !== null && cancelAnimationFrame(E.current);
3585
3555
  },
3586
3556
  []
3587
3557
  );
3588
- const j = d(D);
3589
- j.current = D;
3590
- const Fe = d(k);
3591
- Fe.current = k;
3558
+ const oe = d(D);
3559
+ oe.current = D;
3560
+ const He = d(k);
3561
+ He.current = k;
3592
3562
  const je = d(ce);
3593
3563
  je.current = ce;
3594
- const pt = d(null), [Ke, Ot] = ke(null), [yt, _t] = ke(Se.height);
3564
+ const pt = d(null), [Ke, Ot] = _e(null), [yt, _t] = _e(Se.height);
3595
3565
  yt !== Se.height && (_t(Se.height), Ot(null));
3596
- const Ft = E === void 0 || t === 0 ? 0 : re(Math.trunc(E.row), 0, t - 1), Jt = Me(() => {
3566
+ const Ft = P === void 0 || t === 0 ? 0 : ee(Math.trunc(P.row), 0, t - 1), Jt = Me(() => {
3597
3567
  const a = pt.current?.renderingStartIndex ?? Ft;
3598
- return Mi(Math.max(0, Se.height - dt.current - tt.current), qe, t, a, V);
3599
- }, [Se.height, qe, t, Ft, V, _e, mt]), Et = Ke ?? Jt, Ut = w(() => {
3568
+ return Ri(Math.max(0, Se.height - dt.current - tt.current), qe, t, a, C);
3569
+ }, [Se.height, qe, t, Ft, C, Oe, mt]), Et = Ke ?? Jt, Ut = w(() => {
3600
3570
  const a = pt.current;
3601
3571
  if (a === null)
3602
3572
  return null;
@@ -3619,131 +3589,131 @@ const hi = 1e4, Di = () => {
3619
3589
  };
3620
3590
  }, []), Gt = w(() => {
3621
3591
  const a = Ut();
3622
- a !== null && Fe.current?.(a);
3623
- }, [Ut]), hr = w(
3592
+ a !== null && He.current?.(a);
3593
+ }, [Ut]), mr = w(
3624
3594
  (a) => {
3625
- const p = Wt(), I = re(a, 0, p);
3626
- return I !== we.current && (we.current = I, Ee(), Ht(), _(), j.current?.({ x: I, y: pe.current })), I;
3595
+ const p = Wt(), I = ee(a, 0, p);
3596
+ return I !== we.current && (we.current = I, Ee(), Ht(), O(), oe.current?.({ x: I, y: pe.current })), I;
3627
3597
  },
3628
- [Ee, Ht, _, Wt]
3629
- ), Vt = d(hr);
3630
- Vt.current = hr, Je(() => {
3598
+ [Ee, Ht, O, Wt]
3599
+ ), Ct = d(mr);
3600
+ Ct.current = mr, Je(() => {
3631
3601
  it.current = m.colAnchor, Ee(), Gt();
3632
3602
  }, [m, Ee, Gt]), Je(() => {
3633
3603
  pt.current !== null && Gt();
3634
- }, [N, me, Gt]);
3604
+ }, [V, me, Gt]);
3635
3605
  const At = d(null), $t = w(
3636
3606
  (a) => {
3637
- const p = re(a.col, 0, Math.max(0, e - 1)), I = ee.prefixSum(p, { materializeOption: { materialize: !1 } }), $ = I.cumulative - I.currentValue, le = I.currentValue, ot = It();
3638
- return (a.alignX === "end" ? $ + le - be.current - ot : a.alignX === "center" ? $ + le / 2 - be.current - ot / 2 : $ - be.current) + a.offsetX;
3607
+ const p = ee(a.col, 0, Math.max(0, e - 1)), I = Q.prefixSum(p, { materializeOption: { materialize: !1 } }), $ = I.cumulative - I.currentValue, ae = I.currentValue, ot = It();
3608
+ return (a.alignX === "end" ? $ + ae - be.current - ot : a.alignX === "center" ? $ + ae / 2 - be.current - ot / 2 : $ - be.current) + a.offsetX;
3639
3609
  },
3640
- [ee, e, It]
3610
+ [Q, e, It]
3641
3611
  ), Dt = d(null), Qt = w(() => {
3642
3612
  const a = Dt.current;
3643
- Dt.current = null, !(a === null || a.length === 0) && (ut(ee.updates(a)), Re((p) => p + 1));
3644
- }, [ee, ut]), er = d({ count: 0, warned: !1 }), { frozenColumns: tr, frozenWidth: Tt } = Me(() => {
3645
- if (ue === 0)
3646
- return er.current.count = 0, er.current.warned = !1, { frozenColumns: vn, frozenWidth: 0 };
3647
- const { columns: a, widthUpdates: p, width: I } = Ti(ue, Be, ee);
3613
+ Dt.current = null, !(a === null || a.length === 0) && (ut(Q.updates(a)), Re((p) => p + 1));
3614
+ }, [Q, ut]), er = d({ count: 0, warned: !1 }), { frozenColumns: tr, frozenWidth: Tt } = Me(() => {
3615
+ if (le === 0)
3616
+ return er.current.count = 0, er.current.warned = !1, { frozenColumns: Sn, frozenWidth: 0 };
3617
+ const { columns: a, widthUpdates: p, width: I } = zi(le, Ye, Q);
3648
3618
  if (p.length > 0) {
3649
3619
  const $ = er.current;
3650
- $.count >= kr ? $.warned || ($.warned = !0, A.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).", {
3651
- frozenCols: ue,
3620
+ $.count >= $r ? $.warned || ($.warned = !0, A.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).", {
3621
+ frozenCols: le,
3652
3622
  pendingUpdates: p.length
3653
3623
  })) : ($.count += 1, Dt.current = [...Dt.current ?? [], ...p], Promise.resolve().then(Qt));
3654
3624
  } else
3655
3625
  er.current.count = 0, er.current.warned = !1;
3656
3626
  return { frozenColumns: a, frozenWidth: I };
3657
- }, [ue, Oe, Be, ee, Qt]);
3627
+ }, [le, Le, Ye, Q, Qt]);
3658
3628
  be.current = Tt, Je(() => {
3659
- ue > 0 ? Ye.current?.style.setProperty("--aqvs-grid-frozen-width", `${Tt}px`) : Ye.current?.style.removeProperty("--aqvs-grid-frozen-width");
3660
- }, [Tt, ue]);
3629
+ le > 0 ? Ue.current?.style.setProperty("--aqvs-grid-frozen-width", `${Tt}px`) : Ue.current?.style.removeProperty("--aqvs-grid-frozen-width");
3630
+ }, [Tt, le]);
3661
3631
  const rr = d({ count: 0, warned: !1 }), { trailingColumns: zt, trailingWidth: vt } = Me(() => {
3662
3632
  if (fe === 0)
3663
- return rr.current.count = 0, rr.current.warned = !1, { trailingColumns: vn, trailingWidth: 0 };
3664
- const { columns: a, widthUpdates: p, width: I } = Ri(e, fe, Be, ee);
3633
+ return rr.current.count = 0, rr.current.warned = !1, { trailingColumns: Sn, trailingWidth: 0 };
3634
+ const { columns: a, widthUpdates: p, width: I } = Ni(e, fe, Ye, Q);
3665
3635
  if (p.length > 0) {
3666
3636
  const $ = rr.current;
3667
- $.count >= kr ? $.warned || ($.warned = !0, A.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).", {
3637
+ $.count >= $r ? $.warned || ($.warned = !0, A.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).", {
3668
3638
  trailingCols: fe,
3669
3639
  pendingUpdates: p.length
3670
3640
  })) : ($.count += 1, Dt.current = [...Dt.current ?? [], ...p], Promise.resolve().then(Qt));
3671
3641
  } else
3672
3642
  rr.current.count = 0, rr.current.warned = !1;
3673
3643
  return { trailingColumns: a, trailingWidth: I };
3674
- }, [fe, e, Oe, Be, ee, Qt]);
3644
+ }, [fe, e, Le, Ye, Q, Qt]);
3675
3645
  xt.current = vt, Je(() => {
3676
- fe > 0 ? Ye.current?.style.setProperty("--aqvs-grid-trailing-width", `${vt}px`) : Ye.current?.style.removeProperty("--aqvs-grid-trailing-width");
3646
+ fe > 0 ? Ue.current?.style.setProperty("--aqvs-grid-trailing-width", `${vt}px`) : Ue.current?.style.removeProperty("--aqvs-grid-trailing-width");
3677
3647
  }, [vt, fe]);
3678
- const or = Me(() => ({ ...oe, tapScrollCircleOptions: { ...oe?.tapScrollCircleOptions, enabled: !1 } }), [oe]), jt = oe?.tapScrollCircleOptions, mr = typeof jt?.maxSpeedMultiplier == "number", l = Me(
3648
+ const ar = Me(() => ({ ...ie, tapScrollCircleOptions: { ...ie?.tapScrollCircleOptions, enabled: !1 } }), [ie]), jt = ie?.tapScrollCircleOptions, pr = typeof jt?.maxSpeedMultiplier == "number", c = Me(
3679
3649
  () => ({
3680
3650
  ...jt,
3681
- offsetX: jt?.offsetX === void 0 ? un : jt.offsetX,
3682
- offsetY: jt?.offsetY === void 0 ? un : jt.offsetY
3651
+ offsetX: jt?.offsetX === void 0 ? fn : jt.offsetX,
3652
+ offsetY: jt?.offsetY === void 0 ? fn : jt.offsetY
3683
3653
  }),
3684
3654
  [jt]
3685
- ), h = Me(() => qr(l, Math.max(0, e - ue - fe)), [l, e, ue, fe]), v = Me(() => qr(l, he), [l, he]), q = h.enabled, Y = Math.max(h.maxVisualDistance, 1), W = {
3655
+ ), h = Me(() => Br(c, Math.max(0, e - le - fe)), [c, e, le, fe]), v = Me(() => Br(c, he), [c, he]), q = h.enabled, Y = Math.max(h.maxVisualDistance, 1), W = {
3686
3656
  viewportSize: Math.max(0, Se.width - Tt - vt),
3687
3657
  minSpeedMultiplier: h.minSpeedMultiplier,
3688
3658
  maxSpeedMultiplier: h.maxSpeedMultiplier,
3689
- hasCustomMaxSpeedMultiplier: mr,
3659
+ hasCustomMaxSpeedMultiplier: pr,
3690
3660
  curve: h.maxSpeedCurve
3691
- }, K = {
3692
- viewportSize: Math.max(0, Se.height - N - me),
3661
+ }, G = {
3662
+ viewportSize: Math.max(0, Se.height - V - me),
3693
3663
  minSpeedMultiplier: v.minSpeedMultiplier,
3694
3664
  maxSpeedMultiplier: v.maxSpeedMultiplier,
3695
- hasCustomMaxSpeedMultiplier: mr,
3665
+ hasCustomMaxSpeedMultiplier: pr,
3696
3666
  curve: v.maxSpeedCurve
3697
- }, ye = w(() => we.current, []), Ue = w(() => {
3698
- const a = te.current;
3667
+ }, ye = w(() => we.current, []), We = w(() => {
3668
+ const a = de.current;
3699
3669
  if (a === null)
3700
3670
  return pe.current;
3701
3671
  const p = a.getScrollPosition();
3702
3672
  return p < 0 ? pe.current : p;
3703
3673
  }, []), Ae = w(() => {
3704
- const a = te.current;
3674
+ const a = de.current;
3705
3675
  return a === null ? 0 : Math.max(0, Math.max(0, a.getContentSize()) - Math.max(0, a.getViewportSize()));
3706
3676
  }, []), De = w((a) => {
3707
- const p = te.current;
3677
+ const p = de.current;
3708
3678
  if (p === null)
3709
3679
  return pe.current;
3710
3680
  const I = p.scrollBy(a);
3711
3681
  return pe.current = I, I;
3712
- }, []), ft = Wt() > 0 || Ae() > 0, ht = `${Ne}:${Tt}:${vt}:${Se.width}:${m.key}`, gt = `${t}:${Ke ?? -1}:${N}:${me}:${Se.height}`, { isTapActive: nr, handleTapCircleDragChange: pr, tapCircleHandleRef: zn } = mi({
3682
+ }, []), ft = Wt() > 0 || Ae() > 0, ht = `${Ve}:${Tt}:${vt}:${Se.width}:${m.key}`, gt = `${t}:${Ke ?? -1}:${V}:${me}:${Se.height}`, { isTapActive: nr, handleTapCircleDragChange: gr, tapCircleHandleRef: An } = bi({
3713
3683
  enabled: q && ft,
3714
3684
  maxDistance: Y,
3715
3685
  xSpeedParams: W,
3716
- ySpeedParams: K,
3717
- applyHxRef: Vt,
3686
+ ySpeedParams: G,
3687
+ applyHxRef: Ct,
3718
3688
  getHx: ye,
3719
3689
  getMaxHx: Wt,
3720
3690
  applyVy: De,
3721
- getVy: Ue,
3691
+ getVy: We,
3722
3692
  getMaxVy: Ae,
3723
3693
  pendingColAnchorRef: At,
3724
3694
  xExtentFreshness: ht,
3725
3695
  yExtentFreshness: gt
3726
- }), Cn = Me(() => re((nr ? 1 : 0.8) * h.opacity, 0, 1), [nr, h.opacity]);
3696
+ }), Dn = Me(() => ee((nr ? 1 : 0.8) * h.opacity, 0, 1), [nr, h.opacity]);
3727
3697
  Je(() => {
3728
3698
  const a = At.current;
3729
- a === null ? Vt.current(we.current) : Vt.current($t(a)), Ht();
3730
- }, [Se.width, Ne, Oe, Tt, vt, Ht, $t]);
3731
- const Gr = d(!1);
3699
+ a === null ? Ct.current(we.current) : Ct.current($t(a)), Ht();
3700
+ }, [Se.width, Ve, Le, Tt, vt, Ht, $t]);
3701
+ const Kr = d(!1);
3732
3702
  Je(() => {
3733
- if (Gr.current || E === void 0 || e === 0)
3703
+ if (Kr.current || P === void 0 || e === 0)
3734
3704
  return;
3735
- Gr.current = !0;
3736
- const a = re(Math.trunc(E.col), 0, e - 1);
3737
- if (a < ue || a >= e - fe)
3705
+ Kr.current = !0;
3706
+ const a = ee(Math.trunc(P.col), 0, e - 1);
3707
+ if (a < le || a >= e - fe)
3738
3708
  return;
3739
- const p = { col: a, alignX: "start", offsetX: Math.max(0, E.offsetX) };
3740
- At.current = p, Vt.current($t(p));
3741
- }, [E, e, $t, ue, fe]);
3742
- const Nn = w((a) => {
3743
- pe.current = a, Mt.current = !0, j.current?.({ x: we.current, y: a });
3744
- }, []), jr = w(
3709
+ const p = { col: a, alignX: "start", offsetX: Math.max(0, P.offsetX) };
3710
+ At.current = p, Ct.current($t(p));
3711
+ }, [P, e, $t, le, fe]);
3712
+ const Ln = w((a) => {
3713
+ pe.current = a, Mt.current = !0, oe.current?.({ x: we.current, y: a });
3714
+ }, []), Zr = w(
3745
3715
  (a) => {
3746
- if (he === 0 || O.current)
3716
+ if (he === 0 || _.current)
3747
3717
  pt.current = { renderingStartIndex: t, renderingEndIndex: t - 1, visibleStartIndex: t, visibleEndIndex: t - 1, scrollPosition: 0, totalHeight: he === 0 ? 0 : a.totalHeight }, pe.current = 0;
3748
3718
  else {
3749
3719
  const p = M;
@@ -3762,189 +3732,189 @@ const hi = 1e4, Di = () => {
3762
3732
  }), Gt();
3763
3733
  },
3764
3734
  [Gt, M, he, t]
3765
- ), Kr = w((a) => {
3766
- At.current = null, Vt.current(we.current + a);
3767
- }, []), Zr = Si(H, Et + x.length + ae.length), Vr = d({ count: 0, warned: !1 }), { placedColumns: Sr, truncatedCols: Mr } = Me(() => {
3735
+ ), Jr = w((a) => {
3736
+ At.current = null, Ct.current(we.current + a);
3737
+ }, []), Qr = Ti(H, Et + b.length + se.length), Dr = d({ count: 0, warned: !1 }), { placedColumns: Ir, truncatedCols: yr } = Me(() => {
3768
3738
  const a = Math.max(0, Se.width - Tt - vt);
3769
3739
  if (e === 0 || a <= 0)
3770
3740
  return { placedColumns: [], truncatedCols: 0 };
3771
3741
  if (m.renderingColStart > m.renderingColEnd)
3772
3742
  return { placedColumns: [], truncatedCols: 0 };
3773
- const p = Math.max(1, Zr - tr.length - zt.length), { columns: I, widthUpdates: $, truncated: le } = yi(re(m.renderingColStart, 0, e - 1), re(m.renderingColEnd, 0, e - 1), Be, ee, p);
3743
+ const p = Math.max(1, Qr - tr.length - zt.length), { columns: I, widthUpdates: $, truncated: ae } = Ei(ee(m.renderingColStart, 0, e - 1), ee(m.renderingColEnd, 0, e - 1), Ye, Q, p);
3774
3744
  if ($.length > 0) {
3775
- const ot = Vr.current;
3776
- ot.count >= kr ? ot.warned || (ot.warned = !0, A.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).", {
3745
+ const ot = Dr.current;
3746
+ ot.count >= $r ? ot.warned || (ot.warned = !0, A.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).", {
3777
3747
  window: m.key,
3778
3748
  pendingUpdates: $.length
3779
3749
  })) : (ot.count += 1, Dt.current = [...Dt.current ?? [], ...$], Promise.resolve().then(Qt));
3780
3750
  } else
3781
- Vr.current.count = 0, Vr.current.warned = !1;
3782
- return { placedColumns: I, truncatedCols: le };
3783
- }, [m, e, Se.width, Tt, vt, tr.length, zt.length, Oe, Be, ee, Zr, Qt]), Jr = d("");
3751
+ Dr.current.count = 0, Dr.current.warned = !1;
3752
+ return { placedColumns: I, truncatedCols: ae };
3753
+ }, [m, e, Se.width, Tt, vt, tr.length, zt.length, Le, Ye, Q, Qr, Qt]), en = d("");
3784
3754
  X(() => {
3785
- if (Mr > 0) {
3786
- const a = `${m.key}:${Mr}`;
3787
- a !== Jr.current && (Jr.current = a, je.current?.({ renderedCells: (Sr.length + tr.length + zt.length) * (Et + x.length + ae.length), droppedCols: Mr }));
3755
+ if (yr > 0) {
3756
+ const a = `${m.key}:${yr}`;
3757
+ a !== en.current && (en.current = a, je.current?.({ renderedCells: (Ir.length + tr.length + zt.length) * (Et + b.length + se.length), droppedCols: yr }));
3788
3758
  }
3789
- }, [Mr, m.key, Sr.length, tr.length, zt.length, Et, x.length, ae.length]);
3790
- const Qr = m.colAnchor, Ar = w(
3759
+ }, [yr, m.key, Ir.length, tr.length, zt.length, Et, b.length, se.length]);
3760
+ const tn = m.colAnchor, Lr = w(
3791
3761
  (a) => {
3792
- const p = f?.(a), I = qe(a) === 0, $ = I ? null : Sr.map(({ col: le, left: ot, width: ur }) => {
3793
- const kt = c?.(a, le), gr = { ...kt?.style, left: ot - Qr, width: ur };
3794
- return /* @__PURE__ */ Dr("div", { ...kt, key: s ? s(a, le) : le, className: Ct("aqvs-grid-cell", kt?.className), style: gr }, o(i(a, le), a, le));
3762
+ const p = f?.(a), I = qe(a) === 0, $ = I ? null : Ir.map(({ col: ae, left: ot, width: dr }) => {
3763
+ const kt = l?.(a, ae), xr = { ...kt?.style, left: ot - tn, width: dr };
3764
+ return /* @__PURE__ */ Or("div", { ...kt, key: s ? s(a, ae) : ae, className: Nt("aqvs-grid-cell", kt?.className), style: xr }, o(i(a, ae), a, ae));
3795
3765
  });
3796
- return ue === 0 && fe === 0 ? /* @__PURE__ */ U("div", { ...p, className: Ct("aqvs-grid-row", p?.className), style: p?.style, children: $ }) : /* @__PURE__ */ qt("div", { ...p, "data-aqvs-frozen-row": ue > 0 ? "" : void 0, className: Ct("aqvs-grid-row aqvs-grid-row-frozen-host", p?.className), style: p?.style, children: [
3797
- I ? null : tr.map(({ col: le, left: ot, width: ur }) => {
3798
- const kt = c?.(a, le), gr = { ...kt?.style, left: ot, width: ur };
3799
- return /* @__PURE__ */ Dr("div", { ...kt, "data-aqvs-frozen-cell": "", key: s ? s(a, le) : le, className: Ct("aqvs-grid-cell", kt?.className), style: gr }, o(i(a, le), a, le));
3766
+ return le === 0 && fe === 0 ? /* @__PURE__ */ U("div", { ...p, className: Nt("aqvs-grid-row", p?.className), style: p?.style, children: $ }) : /* @__PURE__ */ qt("div", { ...p, "data-aqvs-frozen-row": le > 0 ? "" : void 0, className: Nt("aqvs-grid-row aqvs-grid-row-frozen-host", p?.className), style: p?.style, children: [
3767
+ I ? null : tr.map(({ col: ae, left: ot, width: dr }) => {
3768
+ const kt = l?.(a, ae), xr = { ...kt?.style, left: ot, width: dr };
3769
+ return /* @__PURE__ */ Or("div", { ...kt, "data-aqvs-frozen-cell": "", key: s ? s(a, ae) : ae, className: Nt("aqvs-grid-cell", kt?.className), style: xr }, o(i(a, ae), a, ae));
3800
3770
  }),
3801
3771
  I ? null : /* @__PURE__ */ U("div", { className: "aqvs-grid-row-scroll", children: /* @__PURE__ */ U("div", { className: "aqvs-grid-row-scroll-inner", children: $ }) }),
3802
- I || fe === 0 ? null : /* @__PURE__ */ U("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ U("div", { className: "aqvs-grid-row-trailing-inner", children: zt.map(({ col: le, left: ot, width: ur }) => {
3803
- const kt = c?.(a, le), gr = { ...kt?.style, left: ot, width: ur };
3804
- return /* @__PURE__ */ Dr("div", { ...kt, "data-aqvs-trailing-cell": "", key: s ? s(a, le) : le, className: Ct("aqvs-grid-cell", kt?.className), style: gr }, o(i(a, le), a, le));
3772
+ I || fe === 0 ? null : /* @__PURE__ */ U("div", { className: "aqvs-grid-row-trailing", children: /* @__PURE__ */ U("div", { className: "aqvs-grid-row-trailing-inner", children: zt.map(({ col: ae, left: ot, width: dr }) => {
3773
+ const kt = l?.(a, ae), xr = { ...kt?.style, left: ot, width: dr };
3774
+ return /* @__PURE__ */ Or("div", { ...kt, "data-aqvs-trailing-cell": "", key: s ? s(a, ae) : ae, className: Nt("aqvs-grid-cell", kt?.className), style: xr }, o(i(a, ae), a, ae));
3805
3775
  }) }) })
3806
3776
  ] });
3807
3777
  },
3808
- [Sr, tr, zt, ue, fe, Qr, f, c, s, i, o, qe]
3809
- ), [Vn, An] = ke(""), cr = d(null), en = d(ge);
3810
- en.current = ge;
3811
- const Ir = w(() => {
3812
- const a = en.current;
3778
+ [Ir, tr, zt, le, fe, tn, f, l, s, i, o, qe]
3779
+ ), [On, _n] = _e(""), ur = d(null), rn = d(ge);
3780
+ rn.current = ge;
3781
+ const Tr = w(() => {
3782
+ const a = rn.current;
3813
3783
  if (a === void 0)
3814
3784
  return;
3815
3785
  const p = a.debounceMs ?? 400;
3816
- Number.isFinite(p) && p >= 0 && (cr.current !== null && window.clearTimeout(cr.current), cr.current = window.setTimeout(() => {
3817
- cr.current = null;
3786
+ Number.isFinite(p) && p >= 0 && (ur.current !== null && window.clearTimeout(ur.current), ur.current = window.setTimeout(() => {
3787
+ ur.current = null;
3818
3788
  const I = Ut();
3819
- I !== null && An(($) => {
3820
- const le = a.buildMessage(I);
3821
- return le === $ ? $ : le;
3789
+ I !== null && _n(($) => {
3790
+ const ae = a.buildMessage(I);
3791
+ return ae === $ ? $ : ae;
3822
3792
  });
3823
3793
  }, p));
3824
- }, [Ut]), yr = ge?.debounceMs ?? 400, tn = Number.isFinite(yr) && yr >= 0, rn = ge !== void 0;
3794
+ }, [Ut]), Rr = ge?.debounceMs ?? 400, nn = Number.isFinite(Rr) && Rr >= 0, sn = ge !== void 0;
3825
3795
  X(() => {
3826
- rn && !tn && A.warn(`[VirtualGrid] liveRegion.debounceMs must be a finite number >= 0, received ${yr}. Announcements are disabled.`);
3827
- }, [rn, tn, yr]), X(
3796
+ sn && !nn && A.warn(`[VirtualGrid] liveRegion.debounceMs must be a finite number >= 0, received ${Rr}. Announcements are disabled.`);
3797
+ }, [sn, nn, Rr]), X(
3828
3798
  () => () => {
3829
- cr.current !== null && window.clearTimeout(cr.current);
3799
+ ur.current !== null && window.clearTimeout(ur.current);
3830
3800
  },
3831
3801
  []
3832
3802
  ), X(() => {
3833
- Ir();
3834
- }, [m, Ir]);
3835
- const Dn = w(
3803
+ Tr();
3804
+ }, [m, Tr]);
3805
+ const Fn = w(
3836
3806
  (a) => {
3837
- jr(a), Ir();
3807
+ Zr(a), Tr();
3838
3808
  },
3839
- [jr, Ir]
3809
+ [Zr, Tr]
3840
3810
  );
3841
- return Nr(
3842
- Le,
3811
+ return Ar(
3812
+ Xe,
3843
3813
  () => ({
3844
3814
  scrollTo: (a) => {
3845
- const p = te.current;
3815
+ const p = de.current;
3846
3816
  let I = pe.current;
3847
3817
  a.y !== void 0 && p !== null && (p.scrollTo(a.y), I = p.getScrollPosition(), pe.current = I);
3848
3818
  let $ = we.current;
3849
- return a.x !== void 0 && (At.current = null, $ = Vt.current(a.x)), { x: $, y: I };
3819
+ return a.x !== void 0 && (At.current = null, $ = Ct.current(a.x)), { x: $, y: I };
3850
3820
  },
3851
3821
  scrollBy: (a) => {
3852
- const p = te.current;
3822
+ const p = de.current;
3853
3823
  let I = pe.current;
3854
3824
  a.y !== void 0 && a.y !== 0 && p !== null && (I = p.scrollBy(a.y), pe.current = I);
3855
3825
  let $ = we.current;
3856
- return a.x !== void 0 && a.x !== 0 && (At.current = null, $ = Vt.current(we.current + a.x)), { x: $, y: I };
3826
+ return a.x !== void 0 && a.x !== 0 && (At.current = null, $ = Ct.current(we.current + a.x)), { x: $, y: I };
3857
3827
  },
3858
3828
  scrollToCell: (a, p, I) => {
3859
- const $ = te.current;
3829
+ const $ = de.current;
3860
3830
  if ($ !== null && t > 0) {
3861
- const le = re(Math.trunc(a), 0, t - 1);
3862
- le >= M && le < t - He && $.scrollToIndex(le - M, { align: I?.alignY ?? "top", offset: I?.offsetY });
3831
+ const ae = ee(Math.trunc(a), 0, t - 1);
3832
+ ae >= M && ae < t - Fe && $.scrollToIndex(ae - M, { align: I?.alignY ?? "top", offset: I?.offsetY });
3863
3833
  }
3864
3834
  if (e > 0) {
3865
- const le = re(Math.trunc(p), 0, e - 1);
3866
- if (le >= ue && le < e - fe) {
3867
- const ot = { col: le, alignX: I?.alignX ?? "start", offsetX: I?.offsetX ?? 0 };
3868
- At.current = ot, Vt.current($t(ot));
3835
+ const ae = ee(Math.trunc(p), 0, e - 1);
3836
+ if (ae >= le && ae < e - fe) {
3837
+ const ot = { col: ae, alignX: I?.alignX ?? "start", offsetX: I?.offsetX ?? 0 };
3838
+ At.current = ot, Ct.current($t(ot));
3869
3839
  }
3870
3840
  }
3871
3841
  },
3872
- getScrollPosition: () => Mt.current || te.current !== null ? { x: we.current, y: te.current?.getScrollPosition() ?? pe.current } : { x: -1, y: -1 },
3842
+ getScrollPosition: () => Mt.current || de.current !== null ? { x: we.current, y: de.current?.getScrollPosition() ?? pe.current } : { x: -1, y: -1 },
3873
3843
  getScrollAnchor: () => {
3874
3844
  if (t === 0 || e === 0)
3875
3845
  return null;
3876
- const a = te.current?.getScrollAnchor() ?? null;
3846
+ const a = de.current?.getScrollAnchor() ?? null;
3877
3847
  if (a === null)
3878
3848
  return null;
3879
- const p = be.current + we.current, I = ee.findIndexAtOrAfter(p, { materializeOption: { materialize: !1 } });
3849
+ const p = be.current + we.current, I = Q.findIndexAtOrAfter(p, { materializeOption: { materialize: !1 } });
3880
3850
  if (I.index === -1)
3881
3851
  return { row: a.index + M, col: e - 1, offsetX: 0, offsetY: a.offsetPx };
3882
3852
  if (I.cumulative === p)
3883
- return { row: a.index + M, col: re(I.index + 1, 0, e - 1), offsetX: 0, offsetY: a.offsetPx };
3853
+ return { row: a.index + M, col: ee(I.index + 1, 0, e - 1), offsetX: 0, offsetY: a.offsetPx };
3884
3854
  const $ = (I.cumulative ?? 0) - (I.currentValue ?? 0);
3885
3855
  return { row: a.index + M, col: I.index, offsetX: Math.max(0, p - $), offsetY: a.offsetPx };
3886
3856
  },
3887
3857
  getViewportSize: () => ({ width: Lt.current.width, height: Lt.current.height }),
3888
3858
  // 縦はインセット込みの行側 getContentSize を単一情報源にする (range.totalHeight は木総高のみ)。
3889
3859
  // 3.5.0: height = H_F + 埋め込み + H_T
3890
- getContentSize: () => ({ width: st.current, height: te.current === null ? 0 : dt.current + tt.current + Math.max(0, te.current.getContentSize()) }),
3860
+ getContentSize: () => ({ width: st.current, height: de.current === null ? 0 : dt.current + tt.current + Math.max(0, de.current.getContentSize()) }),
3891
3861
  getRange: Ut,
3892
3862
  updateRowSize: (a, p) => {
3893
- Pr(p, "row", a), Math.trunc(a) < M ? St((I) => I + 1) : He > 0 && Math.trunc(a) >= t - He ? G((I) => I + 1) : te.current?.updateItemSize(Math.trunc(a) - M, p);
3863
+ zr(p, "row", a), Math.trunc(a) < M ? St((I) => I + 1) : Fe > 0 && Math.trunc(a) >= t - Fe ? Z((I) => I + 1) : de.current?.updateItemSize(Math.trunc(a) - M, p);
3894
3864
  },
3895
3865
  updateColSize: (a, p) => {
3896
- Pr(p, "col", a), ut(ee.update(re(Math.trunc(a), 0, Math.max(0, e - 1)), p)), Re((I) => I + 1);
3866
+ zr(p, "col", a), ut(Q.update(ee(Math.trunc(a), 0, Math.max(0, e - 1)), p)), Re((I) => I + 1);
3897
3867
  },
3898
3868
  getFrozenSize: () => ({
3899
- cols: ue,
3869
+ cols: le,
3900
3870
  width: be.current,
3901
3871
  rows: M,
3902
3872
  height: dt.current,
3903
3873
  trailingCols: fe,
3904
- trailingRows: He,
3874
+ trailingRows: Fe,
3905
3875
  trailingWidth: xt.current,
3906
3876
  trailingHeight: tt.current,
3907
3877
  // vis は単一 JS 源ヘルパーの呼び出しのみ (式の再導出禁止 — 3.5.0 プラン §2.1-4)
3908
- trailingVisibleWidth: Er(xt.current, be.current, Lt.current.width),
3909
- trailingVisibleHeight: Er(tt.current, dt.current, Lt.current.height)
3878
+ trailingVisibleWidth: Nr(xt.current, be.current, Lt.current.width),
3879
+ trailingVisibleHeight: Nr(tt.current, dt.current, Lt.current.height)
3910
3880
  }),
3911
- applyWheel: (a) => te.current?.applyWheel(a) ?? !1,
3881
+ applyWheel: (a) => de.current?.applyWheel(a) ?? !1,
3912
3882
  focusRowAtIndex: (a, p) => {
3913
3883
  const I = Math.trunc(a);
3914
- I < M ? Ye.current?.querySelector(`[data-aqvs-frozen-band-row="${I}"]`)?.focus() : He > 0 && I >= t - He ? Ye.current?.querySelector(`[data-aqvs-trailing-band-row="${I}"]`)?.focus() : te.current?.focusItemAtIndex(I - M, p);
3884
+ I < M ? Ue.current?.querySelector(`[data-aqvs-frozen-band-row="${I}"]`)?.focus() : Fe > 0 && I >= t - Fe ? Ue.current?.querySelector(`[data-aqvs-trailing-band-row="${I}"]`)?.focus() : de.current?.focusItemAtIndex(I - M, p);
3915
3885
  }
3916
3886
  }),
3917
- [t, e, ee, Ut, ut, $t, ue, M, fe, He]
3918
- ), /* @__PURE__ */ qt("div", { ref: Ye, className: Ct("aqvs-grid", M > 0 ? "aqvs-grid-has-frozen-rows" : "", He > 0 ? "aqvs-grid-has-trailing-rows" : "", se), "data-testid": ne, children: [
3887
+ [t, e, Q, Ut, ut, $t, le, M, fe, Fe]
3888
+ ), /* @__PURE__ */ qt("div", { ref: Ue, className: Nt("aqvs-grid", M > 0 ? "aqvs-grid-has-frozen-rows" : "", Fe > 0 ? "aqvs-grid-has-trailing-rows" : "", re), "data-testid": ne, children: [
3919
3889
  M > 0 ? (
3920
3890
  // 凍結行帯 (行凍結設計 §4-2): グリッド所有の帯外バンド — 行本体は renderRow を
3921
3891
  // そのまま再利用する (F > 0 の凍結セル / クリップ / hx 残差 var は継承で無償追随
3922
3892
  // = 4 象限コーナーの成立点)。top は木絶対プレフィックス、高さ 0 行は DOM 非生成
3923
- /* @__PURE__ */ U("div", { className: "aqvs-grid-frozen-rows", style: { height: N }, "data-testid": ne ? `${ne}-frozen-rows` : void 0, children: x.map(({ row: a, top: p, height: I }) => (
3893
+ /* @__PURE__ */ U("div", { className: "aqvs-grid-frozen-rows", style: { height: V }, "data-testid": ne ? `${ne}-frozen-rows` : void 0, children: b.map(({ row: a, top: p, height: I }) => (
3924
3894
  // 行ラッパーの role は消費側の複合ウィジェット契約 (listbox / tree / grid — README
3925
3895
  // 「Composite widget roles」) の所有物で、パッケージが既定 role を課すと衝突する。
3926
3896
  // フォーカス結線は focusRowAtIndex ↔ onRowFocus 往復のバンド版そのもの。右インセット
3927
3897
  // (right: scrollBarWidth + overflow クリップ) は縦バーコーナーの予約 — ペインの
3928
3898
  // クリップ箱 (root − バー幅) と帯のクリップ箱を一致させる (R1 是正)。
3929
3899
  // biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (上記)
3930
- /* @__PURE__ */ U("div", { "data-aqvs-frozen-band-row": a, className: "aqvs-grid-frozen-band-row", style: { top: p, height: I, right: Ve }, tabIndex: -1, onFocus: () => T?.(a), children: Ar(a) }, a)
3900
+ /* @__PURE__ */ U("div", { "data-aqvs-frozen-band-row": a, className: "aqvs-grid-frozen-band-row", style: { top: p, height: I, right: Ce }, tabIndex: -1, onFocus: () => T?.(a), children: Lr(a) }, a)
3931
3901
  )) })
3932
3902
  ) : null,
3933
3903
  /* @__PURE__ */ U("div", { className: "aqvs-grid-main", "data-testid": ne ? `${ne}-main` : void 0, children: /* @__PURE__ */ U(
3934
- vi,
3904
+ Ii,
3935
3905
  {
3936
- ref: te,
3906
+ ref: de,
3937
3907
  itemCount: Zt ? 0 : he,
3938
3908
  getItem: (a) => a + M,
3939
3909
  getItemKey: (a) => a + M,
3940
3910
  getItemHeight: Ge,
3941
- overscanCount: V,
3942
- viewportSize: Se.height > 0 ? Math.max(0, Se.height - N - me) : void 0,
3911
+ overscanCount: C,
3912
+ viewportSize: Se.height > 0 ? Math.max(0, Se.height - V - me) : void 0,
3943
3913
  callbackThrottleMs: L,
3944
- behaviorOptions: Q,
3945
- scrollBarOptions: or,
3914
+ behaviorOptions: J,
3915
+ scrollBarOptions: ar,
3946
3916
  contentProps: g,
3947
- background: b,
3917
+ background: x,
3948
3918
  contentInsets: R,
3949
3919
  onItemFocus: Ie,
3950
3920
  horizontalKeyInputs: Te,
@@ -3953,45 +3923,45 @@ const hi = 1e4, Di = () => {
3953
3923
  // トグル済みなら視点保存 (捕捉アンカー) のみ — 捕捉 null は undefined (先頭)
3954
3924
  // へ落とし、消費済みマウント props の蘇りを断つ (R2 是正)。未トグルのみ
3955
3925
  // マウント props の凍結行 no-op 付き −R 変換 (列の §8 no-op と同文)
3956
- ct.current ? $e.current !== null && $e.current.row >= M && he > 0 ? { index: $e.current.row - M, offsetPx: $e.current.offsetPx } : void 0 : E !== void 0 && he > 0 && Math.trunc(E.row) >= M && Math.trunc(E.row) < t - He ? { index: Math.trunc(E.row) - M, offsetPx: E.offsetY } : void 0
3926
+ lt.current ? ke.current !== null && ke.current.row >= M && he > 0 ? { index: ke.current.row - M, offsetPx: ke.current.offsetPx } : void 0 : P !== void 0 && he > 0 && Math.trunc(P.row) >= M && Math.trunc(P.row) < t - Fe ? { index: Math.trunc(P.row) - M, offsetPx: P.offsetY } : void 0
3957
3927
  ),
3958
- onScroll: Nn,
3959
- onRangeChange: Dn,
3960
- onWheelHorizontal: Kr,
3961
- onPanHorizontal: Kr,
3962
- locale: Xe,
3928
+ onScroll: Ln,
3929
+ onRangeChange: Fn,
3930
+ onWheelHorizontal: Jr,
3931
+ onPanHorizontal: Jr,
3932
+ locale: $e,
3963
3933
  labels: y,
3964
3934
  testId: ne ? `${ne}-rows` : void 0,
3965
- children: Ar
3935
+ children: Lr
3966
3936
  },
3967
3937
  M
3968
3938
  ) }),
3969
- He > 0 ? (
3939
+ Fe > 0 ? (
3970
3940
  // 末尾行帯 (3.5.0 プラン §6.1-17): .aqvs-grid-main の**後**・hbar の**前**の兄弟
3971
3941
  // (AT には「最終行が最後」の DOM 順正しさ。縦バーは帯の上で自然に終端)。帯クリップ高は
3972
3942
  // インライン H_T_vis (単一 JS 源 — 帯寸の CSS 変数は幅 2 つのみで高さ変数は導入しない)、
3973
3943
  // inner はインライン木高 H_T の bottom 定着 — 帯上端 = extent − H_T_vis が全構成で
3974
3944
  // 成立し、重複縮退では帯の**末尾**行が可視に残る。行本体は renderRow 逐語再利用
3975
3945
  // (先頭列 / 末尾列の帯構造を継承し 4 象限コーナー全種が無償で成立)
3976
- /* @__PURE__ */ U("div", { className: "aqvs-grid-trailing-rows", style: { height: Er(me, N, Se.height) }, "data-testid": ne ? `${ne}-trailing-rows` : void 0, children: /* @__PURE__ */ U("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: me }, children: ae.map(({ row: a, top: p, height: I }) => (
3946
+ /* @__PURE__ */ U("div", { className: "aqvs-grid-trailing-rows", style: { height: Nr(me, V, Se.height) }, "data-testid": ne ? `${ne}-trailing-rows` : void 0, children: /* @__PURE__ */ U("div", { className: "aqvs-grid-trailing-rows-inner", style: { height: me }, children: se.map(({ row: a, top: p, height: I }) => (
3977
3947
  // 帯行は帯ローカル top + right: scrollBarWidth (縦バーコーナーの予約 — 先頭帯行と
3978
3948
  // 同文) + tabIndex −1 + onFocus フル行 index (focusRowAtIndex ↔ onRowFocus 往復)。
3979
3949
  // biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (先頭帯行と同文)
3980
- /* @__PURE__ */ U("div", { "data-aqvs-trailing-band-row": a, className: "aqvs-grid-trailing-band-row", style: { top: p, height: I, right: Ve }, tabIndex: -1, onFocus: () => T?.(a), children: Ar(a) }, a)
3950
+ /* @__PURE__ */ U("div", { "data-aqvs-trailing-band-row": a, className: "aqvs-grid-trailing-band-row", style: { top: p, height: I, right: Ce }, tabIndex: -1, onFocus: () => T?.(a), children: Lr(a) }, a)
3981
3951
  )) }) })
3982
3952
  ) : null,
3983
- /* @__PURE__ */ U("div", { className: "aqvs-grid-hbar-strip", style: { height: Ve, paddingRight: fe > 0 ? Ve + Er(vt, Tt, Se.width) : Ve }, "data-testid": ne ? `${ne}-hbar` : void 0, children: /* @__PURE__ */ U(
3984
- yn,
3953
+ /* @__PURE__ */ U("div", { className: "aqvs-grid-hbar-strip", style: { height: Ce, paddingRight: fe > 0 ? Ce + Nr(vt, Tt, Se.width) : Ce }, "data-testid": ne ? `${ne}-hbar` : void 0, children: /* @__PURE__ */ U(
3954
+ En,
3985
3955
  {
3986
3956
  horizontal: !0,
3987
- contentSize: Math.max(0, Ne - Tt - vt),
3957
+ contentSize: Math.max(0, Ve - Tt - vt),
3988
3958
  viewportSize: Math.max(0, Se.width - Tt - vt),
3989
3959
  scrollPosition: bt,
3990
- itemCount: Math.max(0, e - ue - fe),
3991
- tapScrollCircleOptions: oe?.tapScrollCircleOptions,
3992
- onScroll: (a, p) => (At.current = null, Vt.current(typeof a == "function" ? a(p ?? we.current) : a)),
3993
- scrollBarWidth: Ve,
3994
- locale: Xe,
3960
+ itemCount: Math.max(0, e - le - fe),
3961
+ tapScrollCircleOptions: ie?.tapScrollCircleOptions,
3962
+ onScroll: (a, p) => (At.current = null, Ct.current(typeof a == "function" ? a(p ?? we.current) : a)),
3963
+ scrollBarWidth: Ce,
3964
+ locale: $e,
3995
3965
  labels: y
3996
3966
  }
3997
3967
  ) }),
@@ -4007,53 +3977,53 @@ const hi = 1e4, Di = () => {
4007
3977
  className: "aqvs-grid-tap-circle-wrapper",
4008
3978
  "data-aqvs-grid-tap-circle": "",
4009
3979
  style: {
4010
- left: `min(calc(100% - ${Ve + h.size}px), max(calc(100% - ${Ve}px + ${h.offsetX}px), calc(75% - ${h.size / 2}px)))`,
4011
- top: `min(calc(100% - ${Ve + h.size}px), max(calc(100% - ${Ve}px + ${h.offsetY}px), calc(75% - ${h.size / 2}px)))`
3980
+ left: `min(calc(100% - ${Ce + h.size}px), max(calc(100% - ${Ce}px + ${h.offsetX}px), calc(75% - ${h.size / 2}px)))`,
3981
+ top: `min(calc(100% - ${Ce + h.size}px), max(calc(100% - ${Ce}px + ${h.offsetY}px), calc(75% - ${h.size / 2}px)))`
4012
3982
  },
4013
3983
  children: /* @__PURE__ */ U(
4014
- Ur,
3984
+ jr,
4015
3985
  {
4016
3986
  axis: "xy",
4017
- ref: zn,
4018
- className: Ct("aqvs-grid-tap-circle", h.className),
3987
+ ref: An,
3988
+ className: Nt("aqvs-grid-tap-circle", h.className),
4019
3989
  size: h.size,
4020
3990
  maxVisualDistance: Y,
4021
- opacity: Cn,
3991
+ opacity: Dn,
4022
3992
  renderVisual: h.renderVisual,
4023
- onDragChange: pr
3993
+ onDragChange: gr
4024
3994
  }
4025
3995
  )
4026
3996
  }
4027
3997
  ),
4028
- ge !== void 0 ? /* @__PURE__ */ U("div", { className: "aqvs-grid-live-region", "aria-live": "polite", "data-testid": ne ? `${ne}-live` : void 0, children: Vn }) : null
3998
+ ge !== void 0 ? /* @__PURE__ */ U("div", { className: "aqvs-grid-live-region", "aria-live": "polite", "data-testid": ne ? `${ne}-live` : void 0, children: On }) : null
4029
3999
  ] });
4030
- }, Oi = Cr(Ei);
4000
+ }, Hi = Cr(Ci);
4031
4001
  export {
4032
4002
  Kt as FenwickMapTree,
4033
- pn as MAX_FROZEN_LEADING_COLS,
4034
- gn as MAX_FROZEN_LEADING_ROWS,
4035
- xn as MAX_FROZEN_TRAILING_COLS,
4036
- bn as MAX_FROZEN_TRAILING_ROWS,
4037
- wi as MAX_RENDERED_CELLS,
4038
- zr as MAX_TRACK_SIZE,
4039
- yn as ScrollBar,
4040
- li as ScrollPane,
4041
- Mn as TAP_SCROLL_SPEED_DEFAULTS,
4042
- Fn as VIRTUAL_SCROLL_LABEL_CATALOGS,
4043
- Hr as VIRTUAL_SCROLL_LABEL_KEYS,
4044
- wn as VIRTUAL_SCROLL_LOCALES,
4045
- Oi as VirtualGrid,
4046
- vi as VirtualScroll,
4047
- ti as computeAutoTapScrollMaxSpeedMultiplier,
4048
- Yr as computeTapScrollSpeed,
4049
- ri as computeTapScrollVelocity,
4050
- Vi as createResidualQuantizer,
4051
- re as minmax,
4052
- Sn as resolveVirtualScrollLabels,
4053
- Hn as resolveVirtualScrollLocale,
4054
- Ai as tapScrollCircleSampleVisual,
4055
- Rn as useFenwickMapTree,
4056
- Di as useHeightCache,
4057
- fi as useLruCache,
4058
- Li as useWheelBridge
4003
+ xn as MAX_FROZEN_LEADING_COLS,
4004
+ bn as MAX_FROZEN_LEADING_ROWS,
4005
+ vn as MAX_FROZEN_TRAILING_COLS,
4006
+ wn as MAX_FROZEN_TRAILING_ROWS,
4007
+ yi as MAX_RENDERED_CELLS,
4008
+ Vr as MAX_TRACK_SIZE,
4009
+ En as ScrollBar,
4010
+ fi as ScrollPane,
4011
+ Rn as TAP_SCROLL_SPEED_DEFAULTS,
4012
+ Xn as VIRTUAL_SCROLL_LABEL_CATALOGS,
4013
+ Xr as VIRTUAL_SCROLL_LABEL_KEYS,
4014
+ Mn as VIRTUAL_SCROLL_LOCALES,
4015
+ Hi as VirtualGrid,
4016
+ Ii as VirtualScroll,
4017
+ si as computeAutoTapScrollMaxSpeedMultiplier,
4018
+ Wr as computeTapScrollSpeed,
4019
+ oi as computeTapScrollVelocity,
4020
+ Oi as createResidualQuantizer,
4021
+ ee as minmax,
4022
+ In as resolveVirtualScrollLabels,
4023
+ Yn as resolveVirtualScrollLocale,
4024
+ _i as tapScrollCircleSampleVisual,
4025
+ Nn as useFenwickMapTree,
4026
+ Fi as useHeightCache,
4027
+ gi as useLruCache,
4028
+ ki as useWheelBridge
4059
4029
  };