@aiquants/virtualscroll 1.14.1 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,144 +1,240 @@
1
- import { jsx as B, jsxs as Ut, Fragment as Ce } from "react/jsx-runtime";
2
- import ze, { memo as Xe, forwardRef as xe, useState as Vt, useRef as S, useCallback as T, useImperativeHandle as Ie, useMemo as yt, useEffect as X, useLayoutEffect as ee, useId as He } from "react";
3
- import { twMerge as Wt } from "tailwind-merge";
4
- const ve = {
1
+ import { jsx as $, jsxs as re, Fragment as ke } from "react/jsx-runtime";
2
+ import He, { memo as Be, forwardRef as Me, useState as Ht, useRef as S, useCallback as T, useImperativeHandle as ye, useMemo as Vt, useLayoutEffect as ae, useEffect as B, useId as Xe } from "react";
3
+ import { twMerge as ee } from "tailwind-merge";
4
+ class _ {
5
+ level;
6
+ prefix;
7
+ impl;
8
+ /**
9
+ * @constructor
10
+ * @param {LogLevel} [level=LogLevel.WARN] - The minimum log level to output.
11
+ * @param {string} [prefix="[virtualscroll]"] - The prefix to add to all log messages.
12
+ * @param {ILogger} [impl=console] - The implementation to use for logging.
13
+ */
14
+ constructor(t = 2, e = "[virtualscroll]", r = console) {
15
+ this.level = t, this.prefix = e, this.impl = r;
16
+ }
17
+ static instance = new _(2, "[virtualscroll]");
18
+ /**
19
+ * @method setLevel
20
+ * @description Updates the current log level for the static instance.
21
+ * @description 静的インスタンスの現在のログレベルを更新します。
22
+ * @param {LogLevel} level - The new log level.
23
+ */
24
+ static setLevel(t) {
25
+ _.instance.setLevel(t);
26
+ }
27
+ /**
28
+ * @method setLevel
29
+ * @description Updates the current log level.
30
+ * @description 現在のログレベルを更新します。
31
+ * @param {LogLevel} level - The new log level.
32
+ */
33
+ setLevel(t) {
34
+ this.level = t;
35
+ }
36
+ /**
37
+ * @method setImplementation
38
+ * @description Updates the logger implementation for the static instance.
39
+ * @description 静的インスタンスのロガーの実装を更新します。
40
+ * @param {ILogger} impl - The new logger implementation.
41
+ */
42
+ static setImplementation(t) {
43
+ _.instance.setImplementation(t);
44
+ }
45
+ /**
46
+ * @method setImplementation
47
+ * @description Updates the logger implementation.
48
+ * @description ロガーの実装を更新します。
49
+ * @param {ILogger} impl - The new logger implementation.
50
+ */
51
+ setImplementation(t) {
52
+ this.impl = t;
53
+ }
54
+ /**
55
+ * @method setPrefix
56
+ * @description Updates the log prefix for the static instance.
57
+ * @description 静的インスタンスのログのプレフィックスを更新します。
58
+ * @param {string} prefix - The new prefix.
59
+ */
60
+ static setPrefix(t) {
61
+ _.instance.setPrefix(t);
62
+ }
63
+ /**
64
+ * @method setPrefix
65
+ * @description Updates the log prefix.
66
+ * @description ログのプレフィックスを更新します。
67
+ * @param {string} prefix - The new prefix.
68
+ */
69
+ setPrefix(t) {
70
+ this.prefix = t;
71
+ }
72
+ formatMessage(t) {
73
+ return typeof t == "string" ? [`${this.prefix} ${t}`] : [this.prefix, t];
74
+ }
75
+ static debug(t, ...e) {
76
+ _.instance.debug(t, ...e);
77
+ }
78
+ debug(t, ...e) {
79
+ this.level <= 0 && this.impl.debug(...this.formatMessage(t), ...e);
80
+ }
81
+ static info(t, ...e) {
82
+ _.instance.info(t, ...e);
83
+ }
84
+ info(t, ...e) {
85
+ this.level <= 1 && this.impl.info(...this.formatMessage(t), ...e);
86
+ }
87
+ static warn(t, ...e) {
88
+ _.instance.warn(t, ...e);
89
+ }
90
+ warn(t, ...e) {
91
+ this.level <= 2 && this.impl.warn(...this.formatMessage(t), ...e);
92
+ }
93
+ static error(t, ...e) {
94
+ _.instance.error(t, ...e);
95
+ }
96
+ error(t, ...e) {
97
+ this.level <= 3 && this.impl.error(...this.formatMessage(t), ...e);
98
+ }
99
+ }
100
+ const Re = {
5
101
  active: !1,
6
102
  offsetX: 0,
7
103
  offsetY: 0,
8
104
  distance: 0,
9
105
  direction: 0,
10
106
  pointerId: null
11
- }, pe = 6, qe = 8, Be = ({ dragState: o, normalizedDistance: t }) => {
12
- const e = 1 + t * 0.18, n = 0.16 + t * 0.24, s = 0.38 + t * 0.28, c = o.active ? "80ms ease-out" : "220ms ease";
13
- return /* @__PURE__ */ Ut(Ce, { children: [
14
- /* @__PURE__ */ B(
107
+ }, Ie = 6, Ue = 8, $e = ({ dragState: n, normalizedDistance: t }) => {
108
+ const e = 1 + t * 0.18, r = 0.16 + t * 0.24, s = 0.38 + t * 0.28, l = n.active ? "80ms ease-out" : "220ms ease";
109
+ return /* @__PURE__ */ re(ke, { children: [
110
+ /* @__PURE__ */ $(
15
111
  "div",
16
112
  {
17
- className: "absolute inset-0 rounded-full",
113
+ className: "aqvs-tap-scroll-circle-visual-outer",
18
114
  style: {
19
115
  background: "linear-gradient(140deg, rgba(255,255,255,0.62), rgba(72,72,72,0.48))",
20
- boxShadow: `0 0 0 1px rgba(255,255,255,0.28), 0 10px 22px rgba(0,0,0,${n})`,
116
+ boxShadow: `0 0 0 1px rgba(255,255,255,0.28), 0 10px 22px rgba(0,0,0,${r})`,
21
117
  transform: `scale(${e})`,
22
- transition: `${c}, ${o.active ? "80ms" : "260ms"} box-shadow ease`
118
+ transition: `${l}, ${n.active ? "80ms" : "260ms"} box-shadow ease`
23
119
  }
24
120
  }
25
121
  ),
26
- /* @__PURE__ */ B(
122
+ /* @__PURE__ */ $(
27
123
  "div",
28
124
  {
29
- className: "aqvs:tap-scroll-circle-inner absolute rounded-full",
125
+ className: "aqvs-tap-scroll-circle-inner",
30
126
  style: {
31
127
  background: "linear-gradient(140deg, rgba(255,255,255,0.72), rgba(28,28,28,0.58))",
32
128
  boxShadow: "inset 0 4px 10px rgba(0,0,0,0.24), inset 0 0 2px rgba(255,255,255,0.55)",
33
129
  opacity: s,
34
- transition: o.active ? "120ms opacity ease-out" : "220ms opacity ease"
130
+ transition: n.active ? "120ms opacity ease-out" : "220ms opacity ease"
35
131
  }
36
132
  }
37
133
  )
38
134
  ] });
39
- }, Re = Xe(
40
- xe(({ onDragChange: o, className: t, maxVisualDistance: e = 160, size: n = 40, style: s, opacity: c = 1, renderVisual: u }, h) => {
41
- const [l, d] = Vt(ve), f = S(null), m = S({ x: 0, y: 0 }), R = S(null), b = S(0), A = T(
42
- (C) => {
43
- d(C), o(C);
135
+ }, _e = Be(
136
+ Me(({ onDragChange: n, className: t, maxVisualDistance: e = 160, size: r = 40, style: s, opacity: l = 1, renderVisual: c }, d) => {
137
+ const [f, p] = Ht(Re), m = S(null), g = S({ x: 0, y: 0 }), E = S(null), x = S(0), A = T(
138
+ (D) => {
139
+ p(D), n(D);
44
140
  },
45
- [o]
141
+ [n]
46
142
  ), U = T(
47
- (C, H, K = !1) => {
48
- const { x: O, y: it } = m.current, v = C - O, vt = H - it, y = Math.abs(vt), ct = y < pe ? 0 : vt < 0 ? -1 : 1, F = b.current;
49
- let bt = ct;
50
- const at = pe + qe;
51
- ct === 0 ? F !== 0 && y < at ? bt = F : (bt = 0, K || (b.current = 0)) : ct !== F && F !== 0 && y < at ? bt = F : b.current = ct, A({
52
- active: K || y >= pe,
53
- offsetX: v,
54
- offsetY: vt,
55
- distance: y,
56
- direction: bt,
57
- pointerId: f.current
143
+ (D, Z, J = !1) => {
144
+ const { x: W, y: F } = g.current, Tt = D - W, ct = Z - F, vt = Math.abs(ct), v = vt < Ie ? 0 : ct < 0 ? -1 : 1, Mt = x.current;
145
+ let b = v;
146
+ const Pt = Ie + Ue;
147
+ v === 0 ? Mt !== 0 && vt < Pt ? b = Mt : (b = 0, J || (x.current = 0)) : v !== Mt && Mt !== 0 && vt < Pt ? b = Mt : x.current = v, A({
148
+ active: J || vt >= Ie,
149
+ offsetX: Tt,
150
+ offsetY: ct,
151
+ distance: vt,
152
+ direction: b,
153
+ pointerId: m.current
58
154
  });
59
155
  },
60
156
  [A]
61
- ), Y = T((C) => {
62
- if (C === null)
157
+ ), q = T((D) => {
158
+ if (D === null)
63
159
  return;
64
- const H = R.current;
65
- H?.hasPointerCapture(C) && H.releasePointerCapture(C);
66
- }, []), Z = T(
67
- (C = !1) => {
68
- C && Y(f.current), f.current = null, b.current = 0, A(ve);
160
+ const Z = E.current;
161
+ Z?.hasPointerCapture(D) && Z.releasePointerCapture(D);
162
+ }, []), Q = T(
163
+ (D = !1) => {
164
+ D && q(m.current), m.current = null, x.current = 0, A(Re);
69
165
  },
70
- [A, Y]
71
- ), ft = T(
72
- (C) => {
73
- C.preventDefault(), C.stopPropagation();
74
- const H = R.current ?? C.currentTarget, { left: K, top: O, width: it, height: v } = H.getBoundingClientRect();
75
- m.current = { x: K + it / 2, y: O + v / 2 }, f.current = C.pointerId, H.setPointerCapture(C.pointerId), U(C.clientX, C.clientY, !0);
166
+ [A, q]
167
+ ), bt = T(
168
+ (D) => {
169
+ D.preventDefault(), D.stopPropagation();
170
+ const Z = E.current ?? D.currentTarget, { left: J, top: W, width: F, height: Tt } = Z.getBoundingClientRect();
171
+ g.current = { x: J + F / 2, y: W + Tt / 2 }, m.current = D.pointerId, Z.setPointerCapture(D.pointerId), U(D.clientX, D.clientY, !0);
76
172
  },
77
173
  [U]
78
- ), nt = T(
79
- (C) => {
80
- f.current === C.pointerId && (C.preventDefault(), U(C.clientX, C.clientY));
174
+ ), lt = T(
175
+ (D) => {
176
+ m.current === D.pointerId && (D.preventDefault(), U(D.clientX, D.clientY));
81
177
  },
82
178
  [U]
83
- ), tt = T(
84
- (C) => {
85
- f.current === C.pointerId && (C.preventDefault(), C.stopPropagation(), Z(!0));
179
+ ), it = T(
180
+ (D) => {
181
+ m.current === D.pointerId && (D.preventDefault(), D.stopPropagation(), Q(!0));
86
182
  },
87
- [Z]
183
+ [Q]
88
184
  );
89
- Ie(
90
- h,
185
+ ye(
186
+ d,
91
187
  () => ({
92
188
  reset: () => {
93
- Z(!0);
189
+ Q(!0);
94
190
  },
95
- getElement: () => R.current
191
+ getElement: () => E.current
96
192
  }),
97
- [Z]
193
+ [Q]
98
194
  );
99
- const N = Math.min(Math.max(c, 0), 1), w = n / 64, $ = Math.min(l.distance, e) / e, z = l.direction * $ * 10 * w, J = u ?? Be, _ = {
100
- dragState: l,
101
- normalizedDistance: $,
102
- sizeScale: w,
103
- size: n,
104
- opacity: N
105
- }, mt = {
195
+ const Y = Math.min(Math.max(l, 0), 1), tt = r / 64, C = Math.min(f.distance, e) / e, K = f.direction * C * 10 * tt, G = c ?? $e, It = {
196
+ dragState: f,
197
+ normalizedDistance: C,
198
+ sizeScale: tt,
199
+ size: r,
200
+ opacity: Y
201
+ }, L = {
106
202
  ...s,
107
- width: n,
108
- height: n,
109
- transform: `translateY(${z}px)`
203
+ width: r,
204
+ height: r,
205
+ transform: `translateY(${K}px)`
110
206
  };
111
- return mt.opacity = N, /* @__PURE__ */ B(
207
+ return L.opacity = Y, /* @__PURE__ */ $(
112
208
  "div",
113
209
  {
114
- ref: R,
210
+ ref: E,
115
211
  "data-testid": "virtual-scroll-tap-circle",
116
- className: Wt("relative flex touch-none select-none items-center justify-center", "transition-transform duration-100 ease-out", t),
117
- style: mt,
212
+ className: ee("aqvs-tap-scroll-circle", t),
213
+ style: L,
118
214
  tabIndex: -1,
119
- onPointerDown: ft,
120
- onPointerMove: nt,
121
- onPointerUp: tt,
122
- onPointerCancel: tt,
215
+ onPointerDown: bt,
216
+ onPointerMove: lt,
217
+ onPointerUp: it,
218
+ onPointerCancel: it,
123
219
  role: "presentation",
124
- children: J(_)
220
+ children: G(It)
125
221
  }
126
222
  );
127
223
  })
128
224
  );
129
- Re.displayName = "TapScrollCircle";
130
- const ht = (o, t, e) => Math.min(e, Math.max(t, o)), be = "virtualscroll:tap-scroll-cancel", Pe = 20, Ue = 250, $e = 60, Ke = 20, We = 20, je = 240, Se = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, he = 2.2, Ge = 8, Ze = 120, Je = 1 / 60, kt = {
225
+ _e.displayName = "TapScrollCircle";
226
+ const pt = (n, t, e) => Math.min(e, Math.max(t, n)), Se = "virtualscroll:tap-scroll-cancel", Ve = 20, Ke = 250, We = 60, je = 20, Ge = 20, Ze = 240, Ce = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, Te = 2.2, Je = 8, Qe = 120, tr = 1 / 60, qt = {
131
227
  enabled: !0,
132
228
  size: 40,
133
229
  offsetX: -80,
134
230
  offsetY: 0,
135
231
  className: void 0,
136
- maxVisualDistance: je,
232
+ maxVisualDistance: Ze,
137
233
  minSpeedMultiplier: 0.2,
138
234
  opacity: 0.9,
139
235
  renderVisual: void 0,
140
236
  maxSpeedCurve: void 0
141
- }, Qe = (o) => o ? {
237
+ }, er = (n) => n ? {
142
238
  mainSizeKey: "width",
143
239
  crossSizeKey: "height",
144
240
  positionKey: "left",
@@ -146,7 +242,7 @@ const ht = (o, t, e) => Math.min(e, Math.max(t, o)), be = "virtualscroll:tap-scr
146
242
  getPointerCoordinate: ({ clientX: t }) => t,
147
243
  arrowLabels: ["Scroll left", "Scroll right"],
148
244
  arrowIcons: ["◀", "▶"],
149
- directionClass: "flex flex-row items-stretch",
245
+ directionClass: "aqvs-scrollbar-horizontal",
150
246
  orientation: "horizontal"
151
247
  } : {
152
248
  mainSizeKey: "height",
@@ -156,594 +252,600 @@ const ht = (o, t, e) => Math.min(e, Math.max(t, o)), be = "virtualscroll:tap-scr
156
252
  getPointerCoordinate: ({ clientY: t }) => t,
157
253
  arrowLabels: ["Scroll up", "Scroll down"],
158
254
  arrowIcons: ["▲", "▼"],
159
- directionClass: "flex flex-col items-stretch",
255
+ directionClass: "aqvs-scrollbar-vertical",
160
256
  orientation: "vertical"
161
- }, tr = (o, t) => {
162
- const e = o?.maxSpeedMultiplier, n = typeof e == "number" ? e : nr(t);
257
+ }, rr = (n, t) => {
258
+ const e = n?.maxSpeedMultiplier, r = typeof e == "number" ? e : sr(t);
163
259
  return {
164
- enabled: o?.enabled ?? kt.enabled,
165
- size: o?.size ?? kt.size,
166
- offsetX: o?.offsetX ?? kt.offsetX,
167
- offsetY: o?.offsetY ?? kt.offsetY,
168
- className: o?.className ?? kt.className,
169
- maxVisualDistance: o?.maxVisualDistance ?? kt.maxVisualDistance,
170
- maxSpeedMultiplier: n,
171
- minSpeedMultiplier: Math.max(o?.minSpeedMultiplier ?? kt.minSpeedMultiplier, 0),
172
- opacity: ht(o?.opacity ?? kt.opacity, 0, 1),
173
- renderVisual: o?.renderVisual ?? kt.renderVisual,
174
- maxSpeedCurve: o?.maxSpeedCurve ?? kt.maxSpeedCurve
260
+ enabled: n?.enabled ?? qt.enabled,
261
+ size: n?.size ?? qt.size,
262
+ offsetX: n?.offsetX ?? qt.offsetX,
263
+ offsetY: n?.offsetY ?? qt.offsetY,
264
+ className: n?.className ?? qt.className,
265
+ maxVisualDistance: n?.maxVisualDistance ?? qt.maxVisualDistance,
266
+ maxSpeedMultiplier: r,
267
+ minSpeedMultiplier: Math.max(n?.minSpeedMultiplier ?? qt.minSpeedMultiplier, 0),
268
+ opacity: pt(n?.opacity ?? qt.opacity, 0, 1),
269
+ renderVisual: n?.renderVisual ?? qt.renderVisual,
270
+ maxSpeedCurve: n?.maxSpeedCurve ?? qt.maxSpeedCurve
175
271
  };
176
- }, er = ({ isDragging: o, isThumbHovered: t, enableThumbDrag: e }) => yt(() => e ? o ? "dragging" : t ? "hover" : "idle" : "disabled", [e, o, t]), rr = ({ canUseArrowButtons: o, enableArrowButtons: t, resetTapScroll: e, scrollByStep: n }) => {
177
- const s = S(null), c = S(null), u = T(() => {
178
- s.current !== null && (window.clearInterval(s.current), s.current = null), c.current !== null && (window.clearTimeout(c.current), c.current = null);
179
- }, []), h = T(() => {
180
- u();
181
- }, [u]), l = T(
182
- (f) => (m) => {
183
- o && (m.preventDefault(), m.stopPropagation(), e(), u(), n(f), c.current = window.setTimeout(() => {
272
+ }, nr = ({ isDragging: n, isThumbHovered: t, enableThumbDrag: e }) => Vt(() => e ? n ? "dragging" : t ? "hover" : "idle" : "disabled", [e, n, t]), ir = ({ canUseArrowButtons: n, enableArrowButtons: t, resetTapScroll: e, scrollByStep: r }) => {
273
+ const s = S(null), l = S(null), c = T(() => {
274
+ s.current !== null && (window.clearInterval(s.current), s.current = null), l.current !== null && (window.clearTimeout(l.current), l.current = null);
275
+ }, []), d = T(() => {
276
+ c();
277
+ }, [c]), f = T(
278
+ (m) => (g) => {
279
+ n && (g.cancelable && g.preventDefault(), g.stopPropagation(), e(), c(), r(m), l.current = window.setTimeout(() => {
184
280
  s.current = window.setInterval(() => {
185
- n(f);
186
- }, $e);
187
- }, Ue));
281
+ r(m);
282
+ }, We);
283
+ }, Ke));
188
284
  },
189
- [o, u, e, n]
190
- ), d = T(
191
- (f) => (m) => {
192
- t && (m.key === "Enter" || m.key === " " || m.key === "Spacebar") && (m.preventDefault(), n(f));
285
+ [n, c, e, r]
286
+ ), p = T(
287
+ (m) => (g) => {
288
+ t && (g.key === "Enter" || g.key === " " || g.key === "Spacebar") && (g.preventDefault(), r(m));
193
289
  },
194
- [t, n]
290
+ [t, r]
195
291
  );
196
- return X(() => () => {
197
- u();
198
- }, [u]), { handleArrowPointerDown: l, handleArrowPointerUp: h, handleArrowKeyDown: d };
199
- }, nr = (o) => {
200
- if (!o || o <= 0)
201
- return he;
202
- const t = Math.max(1, o), e = Math.log10(t), n = he + e * Ge;
203
- return ht(n, he, Ze);
292
+ return B(() => () => {
293
+ c();
294
+ }, [c]), { handleArrowPointerDown: f, handleArrowPointerUp: d, handleArrowKeyDown: p };
295
+ }, sr = (n) => {
296
+ if (!n || n <= 0)
297
+ return Te;
298
+ const t = Math.max(1, n), e = Math.log10(t), r = Te + e * Je;
299
+ return pt(r, Te, Qe);
204
300
  }, or = ({
205
- contentSize: o,
301
+ contentSize: n,
206
302
  viewportSize: t,
207
303
  scrollPosition: e,
208
- onScroll: n,
304
+ onScroll: r,
209
305
  enableThumbDrag: s = !0,
210
- enableTrackClick: c = !0,
211
- enableArrowButtons: u = !0,
212
- horizontal: h = !1,
213
- scrollBarWidth: l = 12,
214
- className: d,
215
- ariaControls: f,
216
- tapScrollCircleOptions: m,
217
- itemCount: R,
218
- renderThumbOverlay: b,
306
+ enableTrackClick: l = !0,
307
+ enableArrowButtons: c = !0,
308
+ horizontal: d = !1,
309
+ scrollBarWidth: f = 12,
310
+ className: p,
311
+ ariaControls: m,
312
+ tapScrollCircleOptions: g,
313
+ itemCount: E,
314
+ renderThumbOverlay: x,
219
315
  visibleStartIndex: A,
220
316
  visibleEndIndex: U
221
317
  }) => {
222
- const [Y, Z] = Vt(!1), [ft, nt] = Vt(!1), [tt, N] = Vt(!1), w = S(null), $ = S({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 }), z = S({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 }), J = S(e), _ = S(Se), mt = S(null), C = S(null), H = S(null), K = yt(() => tr(m, R), [R, m]), O = yt(() => Qe(h), [h]), {
223
- enabled: it,
224
- size: v,
318
+ const [q, Q] = Ht(!1), [bt, lt] = Ht(!1), [it, Y] = Ht(!1), tt = S(null), C = S({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 }), K = S({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 }), G = S(e), It = S(r), L = S(Ce), D = S(null), Z = S(null), J = S(null), W = Vt(() => rr(g, E), [E, g]), F = Vt(() => er(d), [d]), {
319
+ enabled: Tt,
320
+ size: ct,
225
321
  offsetX: vt,
226
- offsetY: y,
227
- className: ct,
228
- maxVisualDistance: F,
229
- maxSpeedMultiplier: bt,
230
- minSpeedMultiplier: at,
231
- opacity: At,
322
+ offsetY: v,
323
+ className: Mt,
324
+ maxVisualDistance: b,
325
+ maxSpeedMultiplier: Pt,
326
+ minSpeedMultiplier: yt,
327
+ opacity: Lt,
232
328
  renderVisual: I,
233
- maxSpeedCurve: D
234
- } = K, M = S({
235
- viewportSize: t,
236
- maxScrollPosition: Math.max(o - t, 0),
237
- scrollBarVisible: o > t,
238
- effectiveTapMaxDistance: Math.max(F, 1),
239
- tapCircleMaxSpeedMultiplier: bt,
240
- tapCircleMinSpeedMultiplier: at,
241
- tapCircleMaxSpeedCurve: D,
242
- tapScrollCircleOptions: m
243
- }), { mainSizeKey: et, crossSizeKey: L, positionKey: Mt, selectDelta: xt, getPointerCoordinate: It, arrowLabels: rt, arrowIcons: lt, directionClass: ut, orientation: gt } = O, Et = Math.max(F, 1), Xt = t / o, Pt = l, g = Math.max(t - Pt * 2, 0), P = Xt * g, ot = Math.min(Math.max(Pe, P || 0), g || Pe), W = o - t, j = Math.max(g - ot, 0), Dt = W <= 0 || j <= 0 ? 0 : e / W * j, wt = Dt + ot / 2, pt = o > t, Ct = pt && u;
244
- M.current = {
329
+ maxSpeedCurve: N
330
+ } = W, k = S({
245
331
  viewportSize: t,
246
- maxScrollPosition: W,
247
- scrollBarVisible: pt,
248
- effectiveTapMaxDistance: Et,
249
- tapCircleMaxSpeedMultiplier: bt,
250
- tapCircleMinSpeedMultiplier: at,
251
- tapCircleMaxSpeedCurve: D,
252
- tapScrollCircleOptions: m
253
- }, X(() => {
254
- J.current = e;
255
- }, [e]), X(() => {
256
- s || nt(!1);
332
+ maxScrollPosition: Math.max(n - t, 0),
333
+ scrollBarVisible: n > t,
334
+ effectiveTapMaxDistance: Math.max(b, 1),
335
+ tapCircleMaxSpeedMultiplier: Pt,
336
+ tapCircleMinSpeedMultiplier: yt,
337
+ tapCircleMaxSpeedCurve: N,
338
+ tapScrollCircleOptions: g,
339
+ effectiveTrackLength: 0,
340
+ onScroll: r,
341
+ scrollPosition: e
342
+ }), { mainSizeKey: et, crossSizeKey: ut, positionKey: Dt, selectDelta: mt, getPointerCoordinate: st, arrowLabels: ot, arrowIcons: Ct, directionClass: Et, orientation: wt } = F, At = Math.max(b, 1), Bt = t / n, ht = Math.max(t - f * 2, 0), h = Bt * ht, M = Math.min(Math.max(Ve, h || 0), ht || Ve), j = n - t, at = Math.max(ht - M, 0), dt = j <= 0 || at <= 0 ? 0 : e / j * at, Ot = dt + M / 2, ft = n > t || q, Yt = ft && c;
343
+ ae(() => {
344
+ k.current = {
345
+ viewportSize: t,
346
+ maxScrollPosition: j,
347
+ scrollBarVisible: ft,
348
+ effectiveTapMaxDistance: At,
349
+ tapCircleMaxSpeedMultiplier: Pt,
350
+ tapCircleMinSpeedMultiplier: yt,
351
+ tapCircleMaxSpeedCurve: N,
352
+ tapScrollCircleOptions: g,
353
+ effectiveTrackLength: at,
354
+ onScroll: r,
355
+ scrollPosition: e
356
+ };
357
+ }), ae(() => {
358
+ G.current = e;
359
+ }, [e]), ae(() => {
360
+ It.current = r;
361
+ }, [r]), B(() => {
362
+ s || lt(!1);
257
363
  }, [s]);
258
- const Ht = er({ isDragging: Y, isThumbHovered: ft, enableThumbDrag: s }), Nt = T(
259
- (r, a) => {
260
- const x = M.current, V = a ?? J.current;
261
- if (n) {
262
- const G = n(r, V);
263
- if (typeof G == "number" && Number.isFinite(G))
264
- return J.current = G, G;
265
- }
266
- const k = typeof r == "function" ? r(V) : r, E = Math.max(x.maxScrollPosition, 0), q = x.scrollBarVisible ? ht(k, 0, E) : 0;
267
- return J.current = q, q;
268
- },
269
- [n]
270
- ), $t = T(
271
- (r) => {
272
- const a = M.current, x = J.current;
273
- if (!a.scrollBarVisible || a.maxScrollPosition <= 0) {
274
- const G = Nt(0, x), zt = G - x;
275
- return { nextPosition: G, actualDelta: zt, reachedBoundary: !0 };
364
+ const Zt = nr({ isDragging: q, isThumbHovered: bt, enableThumbDrag: s }), Nt = T((o, P) => {
365
+ const R = k.current, i = P ?? G.current;
366
+ if (It.current) {
367
+ const w = It.current(o, i);
368
+ if (typeof w == "number" && Number.isFinite(w))
369
+ return G.current = w, w;
370
+ }
371
+ const a = typeof o == "function" ? o(i) : o, u = Math.max(R.maxScrollPosition, 0), y = R.scrollBarVisible ? pt(a, 0, u) : 0;
372
+ return G.current = y, y;
373
+ }, []), Xt = T(
374
+ (o) => {
375
+ const P = k.current, R = G.current;
376
+ if (!P.scrollBarVisible || P.maxScrollPosition <= 0) {
377
+ const w = Nt(0, R), V = w - R;
378
+ return { nextPosition: w, actualDelta: V, reachedBoundary: !0 };
276
379
  }
277
- if (r === 0)
278
- return { nextPosition: x, actualDelta: 0, reachedBoundary: !1 };
279
- const k = Nt((G) => ht(G + r, 0, a.maxScrollPosition), x), E = k - x, q = E === 0 || r < 0 && k <= 0 || r > 0 && k >= a.maxScrollPosition;
280
- return { nextPosition: k, actualDelta: E, reachedBoundary: q };
380
+ if (o === 0)
381
+ return { nextPosition: R, actualDelta: 0, reachedBoundary: !1 };
382
+ const a = Nt((w) => pt(w + o, 0, P.maxScrollPosition), R), u = a - R, y = u === 0 || o < 0 && a <= 0 || o > 0 && a >= P.maxScrollPosition;
383
+ return { nextPosition: a, actualDelta: u, reachedBoundary: y };
281
384
  },
282
385
  [Nt]
283
- ), Q = T(() => {
284
- C.current !== null && (window.cancelAnimationFrame(C.current), C.current = null), H.current = null;
285
- }, []), St = T(() => {
286
- _.current = { ...Se }, N(!1), mt.current?.reset(), Q();
287
- }, [Q]), Tt = T(
288
- (r) => {
289
- const a = _.current, x = M.current;
290
- if (!a.active || a.direction === 0) {
291
- Q();
386
+ ), St = T(() => {
387
+ Z.current !== null && (window.cancelAnimationFrame(Z.current), Z.current = null), J.current = null;
388
+ }, []), Rt = T(() => {
389
+ L.current = { ...Ce }, Y(!1), D.current?.reset(), St();
390
+ }, [St]), Qt = T(
391
+ (o) => {
392
+ const P = L.current, R = k.current;
393
+ if (!P.active || P.direction === 0) {
394
+ St();
292
395
  return;
293
396
  }
294
- if (!x.scrollBarVisible || x.maxScrollPosition <= 0) {
295
- Q();
397
+ if (!R.scrollBarVisible || R.maxScrollPosition <= 0) {
398
+ St();
296
399
  return;
297
400
  }
298
- const V = H.current ?? r, k = Math.max((r - V) / 1e3, 0), E = Math.min(k, Je);
299
- if (H.current = r, E <= 0) {
300
- C.current = window.requestAnimationFrame(Tt);
401
+ const i = J.current ?? o, a = Math.max((o - i) / 1e3, 0), u = Math.min(a, tr);
402
+ if (J.current = o, u <= 0) {
403
+ Z.current = window.requestAnimationFrame(Qt);
301
404
  return;
302
405
  }
303
- const q = Math.min(a.distance, x.effectiveTapMaxDistance) / x.effectiveTapMaxDistance, G = q ** 1.1, zt = typeof x.tapScrollCircleOptions?.maxSpeedMultiplier == "number", _t = Math.max(x.viewportSize * x.tapCircleMinSpeedMultiplier, 40), Kt = zt ? _t : 1200;
304
- let me = Math.max(x.viewportSize * x.tapCircleMaxSpeedMultiplier, Kt);
305
- const ie = x.tapCircleMaxSpeedCurve;
306
- if (ie) {
307
- const ae = Math.max(ie.exponentialSteepness, 0), Fe = Math.max(ie.exponentialScale ?? x.tapCircleMaxSpeedMultiplier, 0), Le = ae === 0 ? q : Math.expm1(ae * q), Te = ae === 0 ? 1 : Math.expm1(ae) || 1, Oe = Te === 0 ? q : Math.min(Math.max(Le / Te, 0), 1), Ye = x.viewportSize * Fe * Oe;
308
- me = Math.min(me, Math.max(Ye, _t));
406
+ const y = Math.min(P.distance, R.effectiveTapMaxDistance) / R.effectiveTapMaxDistance, w = y ** 1.1, V = typeof R.tapScrollCircleOptions?.maxSpeedMultiplier == "number", z = Math.max(R.viewportSize * R.tapCircleMinSpeedMultiplier, 40), X = V ? z : 1200;
407
+ let H = Math.max(R.viewportSize * R.tapCircleMaxSpeedMultiplier, X);
408
+ const gt = R.tapCircleMaxSpeedCurve;
409
+ if (gt) {
410
+ const he = Math.max(gt.exponentialSteepness, 0), Oe = Math.max(gt.exponentialScale ?? R.tapCircleMaxSpeedMultiplier, 0), Ye = he === 0 ? y : Math.expm1(he * y), we = he === 0 ? 1 : Math.expm1(he) || 1, ze = we === 0 ? y : Math.min(Math.max(Ye / we, 0), 1), qe = R.viewportSize * Oe * ze;
411
+ H = Math.min(H, Math.max(qe, z));
309
412
  }
310
- const Ve = Math.max(me, _t), Ae = Math.max(ie?.easedOffset ?? 0, 0), De = Math.min(1, G + Ae), Ee = _t + (Ve - _t) * De, Ne = a.direction * Ee * E, { actualDelta: _e, reachedBoundary: ke } = $t(Ne);
311
- if (ke || _e === 0) {
312
- Q();
413
+ const xt = Math.max(H, z), Ft = Math.max(gt?.easedOffset ?? 0, 0), Jt = Math.min(1, w + Ft), ce = z + (xt - z) * Jt, ue = P.direction * ce * u, { actualDelta: Fe, reachedBoundary: Le } = Xt(ue);
414
+ if (Le || Fe === 0) {
415
+ St();
313
416
  return;
314
417
  }
315
- C.current = window.requestAnimationFrame(Tt);
418
+ Z.current = window.requestAnimationFrame(Qt);
316
419
  },
317
- [$t, Q]
318
- ), jt = T(() => {
319
- C.current === null && (H.current = null, C.current = window.requestAnimationFrame(Tt));
320
- }, [Tt]);
321
- X(() => () => {
322
- Q();
323
- }, [Q]);
324
- const re = T(
325
- (r) => {
326
- _.current = r, N(r.active), r.active && r.direction !== 0 ? jt() : Q();
420
+ [Xt, St]
421
+ ), rt = T(() => {
422
+ Z.current === null && (J.current = null, Z.current = window.requestAnimationFrame(Qt));
423
+ }, [Qt]);
424
+ B(() => () => {
425
+ St();
426
+ }, [St]);
427
+ const fe = T(
428
+ (o) => {
429
+ L.current = o, Y(o.active), o.active && o.direction !== 0 ? rt() : St();
327
430
  },
328
- [jt, Q]
431
+ [rt, St]
329
432
  );
330
- X(() => {
331
- it || St();
332
- }, [St, it]), X(() => {
333
- const r = (a) => {
334
- const V = a.detail?.paneId;
335
- V && f && V !== f || St();
433
+ B(() => {
434
+ Tt || Rt();
435
+ }, [Rt, Tt]), B(() => {
436
+ const o = (P) => {
437
+ const i = P.detail?.paneId;
438
+ i && m && i !== m || Rt();
336
439
  };
337
- return window.addEventListener(be, r), () => {
338
- window.removeEventListener(be, r);
440
+ return window.addEventListener(Se, o), () => {
441
+ window.removeEventListener(Se, o);
339
442
  };
340
- }, [f, St]), X(() => {
341
- if (!it)
443
+ }, [m, Rt]), B(() => {
444
+ if (!Tt)
342
445
  return;
343
- const r = (a) => {
344
- if (!_.current.active || _.current.pointerId === a.pointerId)
446
+ const o = (P) => {
447
+ if (!L.current.active || L.current.pointerId === P.pointerId)
345
448
  return;
346
- const x = a.target;
347
- if (!(x instanceof Node)) {
348
- St();
449
+ const R = P.target;
450
+ if (!(R instanceof Node)) {
451
+ Rt();
349
452
  return;
350
453
  }
351
- mt.current?.getElement()?.contains(x) || St();
454
+ D.current?.getElement()?.contains(R) || Rt();
352
455
  };
353
- return document.addEventListener("pointerdown", r, !0), () => {
354
- document.removeEventListener("pointerdown", r, !0);
456
+ return document.addEventListener("pointerdown", o, !0), () => {
457
+ document.removeEventListener("pointerdown", o, !0);
355
458
  };
356
- }, [St, it]);
357
- const Gt = (r) => {
358
- if (!pt || j <= 0 || W <= 0)
459
+ }, [Rt, Tt]);
460
+ const le = (o) => {
461
+ if (!ft || at <= 0 || j <= 0)
359
462
  return 0;
360
- const a = ht(r, 0, j);
361
- return ht(a / j * W, 0, W);
362
- }, Bt = (r) => {
363
- const a = Math.max(Math.round(t / We), Ke);
364
- $t(r * a);
365
- }, { handleArrowPointerDown: ne, handleArrowPointerUp: Rt, handleArrowKeyDown: Ft } = rr({
366
- canUseArrowButtons: Ct,
367
- enableArrowButtons: u,
368
- resetTapScroll: St,
369
- scrollByStep: Bt
370
- }), Lt = (r) => {
371
- if (!pt)
372
- return;
373
- if (!s) {
374
- r.preventDefault(), r.stopPropagation();
375
- return;
463
+ const P = pt(o, 0, at);
464
+ return pt(P / at * j, 0, j);
465
+ }, kt = T((o) => {
466
+ const { scrollBarVisible: P, effectiveTrackLength: R, maxScrollPosition: i } = k.current;
467
+ if (_.debug("[ScrollBar] calculateScrollPositionFromThumb", { thumbPos: o, trackLen: R, maxScroll: i }), R <= 0 || i <= 0)
468
+ return null;
469
+ const a = pt(o, 0, R);
470
+ return pt(a / R * i, 0, i);
471
+ }, []), ne = T(
472
+ (o) => {
473
+ const P = C.current;
474
+ if (P.pointerId !== o.pointerId)
475
+ return;
476
+ const R = o.clientX - P.startClientX, i = o.clientY - P.startClientY, a = mt(R, i);
477
+ _.debug("[ScrollBar] handleThumbPointerMove", {
478
+ delta: a,
479
+ startThumbPosition: P.startThumbPosition,
480
+ clientY: o.clientY,
481
+ startClientY: P.startClientY,
482
+ metrics: k.current
483
+ });
484
+ const u = kt(P.startThumbPosition + a);
485
+ u !== null && Nt(u), o.cancelable && o.preventDefault();
486
+ },
487
+ [mt, kt, Nt]
488
+ ), te = T(
489
+ (o) => {
490
+ if (C.current.pointerId === o.pointerId)
491
+ if (document.removeEventListener("pointermove", ne), document.removeEventListener("pointerup", te), document.removeEventListener("pointercancel", te), C.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 }, Q(!1), tt.current) {
492
+ const R = tt.current.getBoundingClientRect();
493
+ o.clientX >= R.left && o.clientX <= R.right && o.clientY >= R.top && o.clientY <= R.bottom || lt(!1);
494
+ } else
495
+ lt(!1);
496
+ },
497
+ [ne]
498
+ ), be = (o) => {
499
+ const P = Math.max(Math.round(t / Ge), je);
500
+ Xt(o * P);
501
+ }, { handleArrowPointerDown: Ut, handleArrowPointerUp: zt, handleArrowKeyDown: $t } = ir({
502
+ canUseArrowButtons: Yt,
503
+ enableArrowButtons: c,
504
+ resetTapScroll: Rt,
505
+ scrollByStep: be
506
+ }), Kt = (o) => {
507
+ if (ft) {
508
+ if (!s) {
509
+ o.preventDefault(), o.stopPropagation();
510
+ return;
511
+ }
512
+ o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey || (Rt(), C.current = {
513
+ pointerId: o.pointerId,
514
+ startThumbPosition: dt,
515
+ startClientX: o.clientX,
516
+ startClientY: o.clientY
517
+ }, document.addEventListener("pointermove", ne), document.addEventListener("pointerup", te), document.addEventListener("pointercancel", te), Q(!0), lt(!0), o.preventDefault(), o.stopPropagation());
376
518
  }
377
- if (r.pointerType === "mouse" && r.button !== 0 || r.ctrlKey)
378
- return;
379
- St();
380
- const a = r.currentTarget;
381
- a.setPointerCapture && a.setPointerCapture(r.pointerId), $.current = {
382
- pointerId: r.pointerId,
383
- startThumbPosition: Dt,
384
- startClientX: r.clientX,
385
- startClientY: r.clientY
386
- }, Z(!0), nt(!0), r.preventDefault(), r.stopPropagation();
387
- }, Ot = (r) => {
388
- const a = $.current;
389
- if (a.pointerId !== r.pointerId)
390
- return;
391
- const x = r.clientX - a.startClientX, V = r.clientY - a.startClientY, k = xt(x, V), E = Gt(a.startThumbPosition + k);
392
- Nt(E), r.cancelable && r.preventDefault();
393
- }, Yt = (r) => {
394
- if ($.current.pointerId !== r.pointerId)
395
- return;
396
- const a = r.currentTarget;
397
- a.hasPointerCapture(r.pointerId) && a.releasePointerCapture(r.pointerId), $.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 }, Z(!1), w.current && !w.current.matches(":hover") && nt(!1), r.preventDefault(), r.stopPropagation();
398
- }, oe = (r) => {
399
- if ($.current.pointerId !== r.pointerId)
519
+ }, _t = (o) => {
520
+ if (!ft)
400
521
  return;
401
- const a = r.currentTarget;
402
- a.hasPointerCapture(r.pointerId) && a.releasePointerCapture(r.pointerId), $.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 }, Z(!1), w.current && !w.current.matches(":hover") && nt(!1);
403
- }, se = (r) => {
404
- if (!pt)
405
- return;
406
- if (!c) {
407
- r.preventDefault(), r.stopPropagation();
522
+ if (!l) {
523
+ o.preventDefault(), o.stopPropagation();
408
524
  return;
409
525
  }
410
- if (r.pointerType === "mouse" && r.button !== 0 || r.ctrlKey)
526
+ if (o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey)
411
527
  return;
412
- const a = r.currentTarget, x = a.getBoundingClientRect(), k = It(r) - (h ? x.left : x.top);
413
- St();
414
- const E = k - ot / 2, q = Gt(E);
415
- Nt(q), a.setPointerCapture && a.setPointerCapture(r.pointerId), z.current = {
416
- pointerId: r.pointerId,
417
- startThumbPosition: E,
418
- startClientX: r.clientX,
419
- startClientY: r.clientY
420
- }, r.preventDefault(), r.stopPropagation();
421
- }, ue = (r) => {
422
- const a = z.current;
423
- if (a.pointerId !== r.pointerId)
528
+ const P = o.currentTarget, R = P.getBoundingClientRect(), a = st(o) - (d ? R.left : R.top);
529
+ Rt();
530
+ const u = a - M / 2, y = le(u);
531
+ Nt(y), P.setPointerCapture && P.setPointerCapture(o.pointerId), K.current = {
532
+ pointerId: o.pointerId,
533
+ startThumbPosition: u,
534
+ startClientX: o.clientX,
535
+ startClientY: o.clientY
536
+ }, o.preventDefault(), o.stopPropagation();
537
+ }, Wt = (o) => {
538
+ const P = K.current;
539
+ if (P.pointerId !== o.pointerId)
424
540
  return;
425
- const x = r.clientX - a.startClientX, V = r.clientY - a.startClientY, k = xt(x, V), E = Gt(a.startThumbPosition + k);
426
- Nt(E), r.cancelable && r.preventDefault();
427
- }, Zt = (r) => {
428
- if (z.current.pointerId !== r.pointerId)
541
+ const R = o.clientX - P.startClientX, i = o.clientY - P.startClientY, a = mt(R, i), u = le(P.startThumbPosition + a);
542
+ Nt(u), o.cancelable && o.preventDefault();
543
+ }, jt = (o) => {
544
+ if (K.current.pointerId !== o.pointerId)
429
545
  return;
430
- const a = r.currentTarget;
431
- a.hasPointerCapture(r.pointerId) && a.releasePointerCapture(r.pointerId), z.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 }, r.preventDefault(), r.stopPropagation();
432
- }, Jt = (r) => {
433
- if (z.current.pointerId !== r.pointerId)
546
+ const P = o.currentTarget;
547
+ P.hasPointerCapture(o.pointerId) && P.releasePointerCapture(o.pointerId), K.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 }, o.preventDefault(), o.stopPropagation();
548
+ }, me = (o) => {
549
+ if (K.current.pointerId !== o.pointerId)
434
550
  return;
435
- const a = r.currentTarget;
436
- a.hasPointerCapture(r.pointerId) && a.releasePointerCapture(r.pointerId), z.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 };
437
- }, de = yt(() => ht((tt ? 1 : 0.8) * At, 0, 1), [tt, At]), fe = yt(() => {
438
- const a = `calc(50% - ${v / 2}px + ${y}px)`;
551
+ const P = o.currentTarget;
552
+ P.hasPointerCapture(o.pointerId) && P.releasePointerCapture(o.pointerId), K.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0 };
553
+ }, pe = Vt(() => pt((it ? 1 : 0.8) * Lt, 0, 1), [it, Lt]), ve = Vt(() => {
554
+ const P = `calc(50% - ${ct / 2}px + ${v}px)`;
439
555
  return {
440
556
  left: vt,
441
- top: a
557
+ top: P
442
558
  };
443
- }, [vt, y, v]), i = (r, a, x) => /* @__PURE__ */ B(
559
+ }, [vt, v, ct]), ie = (o, P, R, i) => /* @__PURE__ */ $(
444
560
  "button",
445
561
  {
446
562
  type: "button",
447
563
  tabIndex: -1,
448
- className: "aqvs:scrollbar-arrow-button flex items-center justify-center text-xs transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50",
564
+ className: "aqvs-scrollbar-arrow-button",
449
565
  style: {
450
- [et]: Pt,
451
- [L]: l
566
+ [et]: f,
567
+ [ut]: f
452
568
  },
453
- "aria-label": a,
454
- onMouseDown: ne(r),
455
- onTouchStart: ne(r),
456
- onMouseUp: Rt,
457
- onMouseLeave: Rt,
458
- onTouchEnd: Rt,
459
- onTouchCancel: Rt,
460
- onKeyDown: Ft(r),
461
- "aria-disabled": !u,
462
- disabled: !Ct,
463
- children: /* @__PURE__ */ B("span", { "aria-hidden": "true", children: x })
464
- }
465
- ), p = b && pt ? {
466
- orientation: gt,
569
+ "aria-label": P,
570
+ onPointerDown: Ut(o),
571
+ onPointerUp: zt,
572
+ onPointerLeave: zt,
573
+ onPointerCancel: zt,
574
+ onKeyDown: $t(o),
575
+ "aria-disabled": !c,
576
+ disabled: !Yt,
577
+ children: /* @__PURE__ */ $("span", { "aria-hidden": "true", children: R })
578
+ },
579
+ i
580
+ ), se = x && ft ? {
581
+ orientation: wt,
467
582
  scrollPosition: e,
468
- maxScrollPosition: W,
469
- contentSize: o,
583
+ maxScrollPosition: j,
584
+ contentSize: n,
470
585
  viewportSize: t,
471
- thumbSize: ot,
472
- thumbPosition: Dt,
473
- thumbCenter: wt,
474
- trackSize: g,
475
- isDragging: Y,
476
- isTapScrollActive: tt,
586
+ thumbSize: M,
587
+ thumbPosition: dt,
588
+ thumbCenter: Ot,
589
+ trackSize: ht,
590
+ isDragging: q,
591
+ isTapScrollActive: it,
477
592
  visibleStartIndex: A,
478
593
  visibleEndIndex: U
479
594
  } : null;
480
- return /* @__PURE__ */ Ut(
595
+ return /* @__PURE__ */ re(
481
596
  "div",
482
597
  {
483
- className: Wt("group relative cursor-default select-none", ut, d),
598
+ className: ee("aqvs-scrollbar", Et, !ft && "pointer-events-none opacity-0", p),
484
599
  style: {
485
600
  [et]: t,
486
- [L]: l,
487
- backgroundColor: "white",
488
- userSelect: "none",
489
- position: "relative",
490
- touchAction: "none"
601
+ [ut]: f
491
602
  },
492
603
  role: "scrollbar",
493
604
  tabIndex: -1,
494
- "aria-controls": f,
605
+ "aria-controls": m,
495
606
  "aria-valuenow": e,
496
607
  "aria-valuemin": 0,
497
- "aria-valuemax": W,
498
- "aria-orientation": h ? "horizontal" : "vertical",
608
+ "aria-valuemax": j,
609
+ "aria-orientation": d ? "horizontal" : "vertical",
499
610
  children: [
500
- !h && pt && it && /* @__PURE__ */ B(
501
- Re,
611
+ !d && ft && Tt && /* @__PURE__ */ $(
612
+ _e,
502
613
  {
503
- ref: mt,
504
- className: Wt("pointer-events-auto absolute transition-opacity duration-150", ct),
505
- size: v,
506
- maxVisualDistance: Et,
507
- style: fe,
508
- opacity: de,
614
+ ref: D,
615
+ className: ee("aqvs-scrollbar-tap-circle-wrapper", Mt),
616
+ size: ct,
617
+ maxVisualDistance: At,
618
+ style: ve,
619
+ opacity: pe,
509
620
  renderVisual: I,
510
- onDragChange: re
511
- }
621
+ onDragChange: fe
622
+ },
623
+ "tap-circle"
512
624
  ),
513
- i(-1, rt[0], lt[0]),
514
- /* @__PURE__ */ Ut(
625
+ ie(-1, ot[0], Ct[0], "arrow-start"),
626
+ /* @__PURE__ */ re(
515
627
  "div",
516
628
  {
517
- className: "aqvs:scrollbar-track relative flex-1",
629
+ className: "aqvs-scrollbar-track",
518
630
  style: {
519
- borderRadius: l / 2,
520
- touchAction: "none"
631
+ borderRadius: f / 2
521
632
  },
522
- onPointerDown: se,
523
- onPointerMove: ue,
524
- onPointerUp: Zt,
525
- onPointerCancel: Jt,
526
- "aria-disabled": !c,
633
+ onPointerDown: _t,
634
+ onPointerMove: Wt,
635
+ onPointerUp: jt,
636
+ onPointerCancel: me,
637
+ "aria-disabled": !l,
527
638
  children: [
528
- p && /* @__PURE__ */ B("div", { className: "pointer-events-none absolute inset-0", "aria-hidden": !0, children: b?.(p) }),
529
- pt && // スクロールバーのつまみの当たり判定を広げるためのラッパー
530
- /* @__PURE__ */ B(
639
+ se && /* @__PURE__ */ $("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: x?.(se) }, "overlay"),
640
+ /* @__PURE__ */ $(
531
641
  "div",
532
642
  {
533
- className: "group absolute",
643
+ className: ee("aqvs-scrollbar-thumb-wrapper", !(ft || q) && "pointer-events-none opacity-0"),
534
644
  style: {
535
- [et]: ot,
536
- [Mt]: Dt,
537
- ...h ? { top: 0, bottom: 0 } : { left: 0, right: 0 },
538
- touchAction: "none"
645
+ [et]: M,
646
+ [Dt]: dt,
647
+ ...d ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
539
648
  },
540
- onPointerDown: Lt,
541
- onPointerMove: Ot,
542
- onPointerUp: Yt,
543
- onPointerCancel: oe,
649
+ onPointerDown: Kt,
544
650
  role: "slider",
545
- "aria-orientation": h ? "horizontal" : "vertical",
651
+ "aria-orientation": d ? "horizontal" : "vertical",
546
652
  "aria-valuenow": e,
547
653
  "aria-valuemin": 0,
548
- "aria-valuemax": W,
654
+ "aria-valuemax": j,
549
655
  "aria-disabled": !s,
550
656
  tabIndex: -1,
551
- children: /* @__PURE__ */ B(
657
+ children: /* @__PURE__ */ $(
552
658
  "div",
553
659
  {
554
- ref: w,
555
- className: Wt("aqvs:scrollbar-thumb absolute", h ? "aqvs:scrollbar-thumb-horizontal" : "aqvs:scrollbar-thumb-vertical"),
556
- "data-thumb-state": Ht,
660
+ ref: tt,
661
+ className: ee("aqvs-scrollbar-thumb", d ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
662
+ "data-thumb-state": Zt,
557
663
  style: {
558
- borderRadius: l - 1,
664
+ borderRadius: f - 1,
559
665
  cursor: s ? "pointer" : "default"
560
666
  },
561
667
  onMouseEnter: () => {
562
- s && nt(!0);
668
+ s && lt(!0);
563
669
  },
564
670
  onMouseLeave: () => {
565
- s && nt(!1);
671
+ s && lt(!1);
566
672
  }
567
- }
673
+ },
674
+ "thumb"
568
675
  )
569
- }
676
+ },
677
+ "thumb-wrapper"
570
678
  )
571
679
  ]
572
- }
680
+ },
681
+ "track"
573
682
  ),
574
- i(1, rt[1], lt[1])
683
+ ie(1, ot[1], Ct[1], "arrow-end")
575
684
  ]
576
685
  }
577
686
  );
578
- }, dt = {
579
- debug(o, ...t) {
580
- process.env.NODE_ENV === "___" && console.debug(`[VirtualScroll] ${o}`, ...t);
581
- },
582
- warn(o, ...t) {
583
- console.warn(`[VirtualScroll] ${o}`, ...t);
584
- },
585
- error(o, ...t) {
586
- console.error(`[VirtualScroll] ${o}`, ...t);
587
- }
588
- }, Qt = {
687
+ }, de = {
589
688
  maxVelocity: 6,
590
689
  minVelocity: 0.02,
591
690
  deceleration: 25e-4,
592
691
  velocitySampleWindow: 90,
593
692
  startVelocityThreshold: 0.04
594
- }, le = (o, t, e) => {
595
- for (const [n, s, c] of t)
596
- e === "add" ? o.addEventListener(n, s, c) : o.removeEventListener(n, s, c);
597
- }, sr = xe(
693
+ }, ge = (n, t, e) => {
694
+ for (const [r, s, l] of t)
695
+ e === "add" ? n.addEventListener(r, s, l) : n.removeEventListener(r, s, l);
696
+ }, ar = Me(
598
697
  ({
599
- children: o,
698
+ children: n,
600
699
  contentSize: t,
601
700
  viewportSize: e,
602
- scrollBarWidth: n = 12,
701
+ scrollBarWidth: r = 12,
603
702
  enableThumbDrag: s = !0,
604
- enableTrackClick: c = !0,
605
- enableArrowButtons: u = !0,
606
- enablePointerDrag: h = !0,
607
- onScroll: l,
608
- className: d,
609
- style: f,
610
- background: m,
611
- tapScrollCircleOptions: R,
612
- inertiaOptions: b,
703
+ enableTrackClick: l = !0,
704
+ enableArrowButtons: c = !0,
705
+ enablePointerDrag: d = !0,
706
+ onScroll: f,
707
+ className: p,
708
+ style: m,
709
+ background: g,
710
+ tapScrollCircleOptions: E,
711
+ inertiaOptions: x,
613
712
  itemCount: A,
614
713
  renderThumbOverlay: U,
615
- wheelSpeedMultiplier: Y = 1,
616
- contentInsets: Z,
617
- visibleStartIndex: ft,
618
- visibleEndIndex: nt,
619
- renderOverlay: tt
620
- }, N) => {
621
- const w = S(0), $ = S(null), z = S(null), J = S({
714
+ wheelSpeedMultiplier: q = 1,
715
+ contentInsets: Q,
716
+ visibleStartIndex: bt,
717
+ visibleEndIndex: lt,
718
+ renderOverlay: it,
719
+ initialScrollPosition: Y = 0
720
+ }, tt) => {
721
+ const C = S(Y), K = S(null), G = S(null), It = S({
622
722
  frame: null,
623
723
  velocity: 0,
624
724
  lastTimestamp: null
625
- }), _ = yt(
725
+ }), L = Vt(
626
726
  () => ({
627
- maxVelocity: b?.maxVelocity ?? Qt.maxVelocity,
628
- minVelocity: b?.minVelocity ?? Qt.minVelocity,
629
- deceleration: b?.deceleration ?? Qt.deceleration,
630
- velocitySampleWindow: b?.velocitySampleWindow ?? Qt.velocitySampleWindow,
631
- startVelocityThreshold: b?.startVelocityThreshold ?? Qt.startVelocityThreshold
727
+ maxVelocity: x?.maxVelocity ?? de.maxVelocity,
728
+ minVelocity: x?.minVelocity ?? de.minVelocity,
729
+ deceleration: x?.deceleration ?? de.deceleration,
730
+ velocitySampleWindow: x?.velocitySampleWindow ?? de.velocitySampleWindow,
731
+ startVelocityThreshold: x?.startVelocityThreshold ?? de.startVelocityThreshold
632
732
  }),
633
- [b]
634
- ), mt = yt(() => ({
635
- top: Math.max(0, Z?.top ?? 0),
636
- bottom: Math.max(0, Z?.bottom ?? 0)
637
- }), [Z]);
638
- dt.debug("[ScrollPane] ScrollPane rendered", {
733
+ [x]
734
+ ), D = Vt(() => ({
735
+ top: Math.max(0, Q?.top ?? 0),
736
+ bottom: Math.max(0, Q?.bottom ?? 0)
737
+ }), [Q]);
738
+ _.debug("[ScrollPane] ScrollPane rendered", {
639
739
  contentSize: t,
640
740
  viewportSize: e,
641
- scrollBarWidth: n,
642
- className: d,
643
- style: f,
644
- tapScrollCircleOptions: R,
645
- inertiaOptions: b,
646
- enablePointerDrag: h,
647
- contentInsets: mt
741
+ scrollBarWidth: r,
742
+ className: p,
743
+ style: m,
744
+ tapScrollCircleOptions: E,
745
+ inertiaOptions: x,
746
+ enablePointerDrag: d,
747
+ contentInsets: D
648
748
  });
649
- const C = S({ contentSize: t, viewportSize: e }), H = yt(() => t > e, [t, e]), K = T(
749
+ const Z = S({ contentSize: t, viewportSize: e });
750
+ Z.current = { contentSize: t, viewportSize: e };
751
+ const J = Vt(() => t > e, [t, e]), W = T(
650
752
  (I) => {
651
- const { contentSize: D, viewportSize: M } = C.current, et = D > M, L = w.current;
652
- if (dt.debug("[ScrollPane] scrollTo called", { newPosition: I, contentSize: D, viewportSize: M, currentIsScrollable: et, prevPosition: L }), !et)
653
- return w.current !== 0 && (w.current = 0, l?.(0, L)), w.current;
654
- const Mt = typeof I == "function" ? I(w.current) : I, xt = Math.max(D - M, 0), It = ht(Mt, 0, xt);
655
- return w.current !== It && (w.current = It, l?.(It, L)), w.current;
753
+ const { contentSize: N, viewportSize: k } = Z.current, et = N > k, ut = C.current;
754
+ if (_.debug("[ScrollPane] scrollTo called", { newPosition: I, contentSize: N, viewportSize: k, currentIsScrollable: et, prevPosition: ut }), !et)
755
+ return C.current !== 0 && (C.current = 0, f?.(0, ut)), C.current;
756
+ const Dt = typeof I == "function" ? I(C.current) : I, mt = Math.max(N - k, 0), st = pt(Dt, 0, mt);
757
+ return C.current !== st && (C.current = st, f?.(st, ut)), C.current;
656
758
  },
657
- [l]
658
- ), O = T(() => {
659
- const I = J.current;
759
+ [f]
760
+ ), F = T(() => {
761
+ const I = It.current;
660
762
  I.frame !== null && cancelAnimationFrame(I.frame), I.frame = null, I.velocity = 0, I.lastTimestamp = null;
661
- }, []), it = S(O);
662
- X(() => {
663
- it.current = O;
664
- }, [O]);
665
- const v = T(
763
+ }, []), Tt = S(F);
764
+ B(() => {
765
+ Tt.current = F;
766
+ }, [F]);
767
+ const ct = T(
666
768
  (I) => {
667
- if (!H)
769
+ if (!J)
668
770
  return;
669
- const { maxVelocity: D, minVelocity: M, deceleration: et, startVelocityThreshold: L } = _, Mt = ht(I, -D, D);
670
- if (Math.abs(Mt) < L)
771
+ const { maxVelocity: N, minVelocity: k, deceleration: et, startVelocityThreshold: ut } = L, Dt = pt(I, -N, N);
772
+ if (Math.abs(Dt) < ut)
671
773
  return;
672
- O(), J.current.velocity = Mt, J.current.lastTimestamp = null;
673
- const xt = (It) => {
674
- const rt = J.current;
675
- if (rt.lastTimestamp === null) {
676
- rt.lastTimestamp = It, rt.frame = requestAnimationFrame(xt);
774
+ F(), It.current.velocity = Dt, It.current.lastTimestamp = null;
775
+ const mt = (st) => {
776
+ const ot = It.current;
777
+ if (ot.lastTimestamp === null) {
778
+ ot.lastTimestamp = st, ot.frame = requestAnimationFrame(mt);
677
779
  return;
678
780
  }
679
- const lt = It - rt.lastTimestamp;
680
- if (rt.lastTimestamp = It, lt <= 0) {
681
- rt.frame = requestAnimationFrame(xt);
781
+ const Ct = st - ot.lastTimestamp;
782
+ if (ot.lastTimestamp = st, Ct <= 0) {
783
+ ot.frame = requestAnimationFrame(mt);
682
784
  return;
683
785
  }
684
- const ut = rt.velocity;
685
- let gt = ut;
686
- const Et = et * lt;
687
- ut > 0 ? gt = Math.max(0, ut - Et) : ut < 0 && (gt = Math.min(0, ut + Et));
688
- const Pt = (ut + gt) / 2 * lt, g = w.current;
689
- Pt !== 0 && K((wt) => wt + Pt);
690
- const P = w.current, { contentSize: ot, viewportSize: W } = C.current, j = Math.max(ot - W, 0);
691
- rt.velocity = gt;
692
- const Dt = P === g || P <= 0 && gt <= 0 || P >= j && gt >= 0;
693
- if (Math.abs(gt) < M || Dt) {
694
- O();
786
+ const Et = ot.velocity;
787
+ let wt = Et;
788
+ const At = et * Ct;
789
+ Et > 0 ? wt = Math.max(0, Et - At) : Et < 0 && (wt = Math.min(0, Et + At));
790
+ const ht = (Et + wt) / 2 * Ct, h = C.current;
791
+ ht !== 0 && W((ft) => ft + ht);
792
+ const M = C.current, { contentSize: j, viewportSize: at } = Z.current, dt = Math.max(j - at, 0);
793
+ ot.velocity = wt;
794
+ const Ot = M === h || M <= 0 && wt <= 0 || M >= dt && wt >= 0;
795
+ if (Math.abs(wt) < k || Ot) {
796
+ F();
695
797
  return;
696
798
  }
697
- rt.frame = requestAnimationFrame(xt);
799
+ ot.frame = requestAnimationFrame(mt);
698
800
  };
699
- J.current.frame = requestAnimationFrame(xt);
801
+ It.current.frame = requestAnimationFrame(mt);
700
802
  },
701
- [H, _, K, O]
702
- ), vt = S(v);
703
- X(() => {
704
- vt.current = v;
705
- }, [v]), ee(() => {
706
- C.current = { contentSize: t, viewportSize: e };
707
- }, [t, e]), ee(() => {
708
- const I = z.current;
803
+ [J, L, W, F]
804
+ ), vt = S(ct);
805
+ B(() => {
806
+ vt.current = ct;
807
+ }, [ct]), ae(() => {
808
+ Z.current = { contentSize: t, viewportSize: e };
809
+ }, [t, e]), ae(() => {
810
+ const I = G.current;
709
811
  if (!I) return;
710
- const D = () => {
711
- I.scrollTop !== 0 && (dt.debug("[ScrollPane] Native scroll detected, resetting to 0", { scrollTop: I.scrollTop }), I.scrollTop = 0), I.scrollLeft !== 0 && (I.scrollLeft = 0);
812
+ const N = () => {
813
+ I.scrollTop !== 0 && (_.debug("[ScrollPane] Native scroll detected, resetting to 0", { scrollTop: I.scrollTop }), I.scrollTop = 0), I.scrollLeft !== 0 && (I.scrollLeft = 0);
712
814
  };
713
- return I.addEventListener("scroll", D), () => I.removeEventListener("scroll", D);
714
- }, []), ee(() => {
715
- if (H) {
716
- dt.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", { contentSize: t, viewportSize: e, scrollPosition: w.current });
717
- const I = ht(t - e, 0, t);
718
- w.current > I && K(I);
815
+ return I.addEventListener("scroll", N), () => I.removeEventListener("scroll", N);
816
+ }, []), ae(() => {
817
+ if (J) {
818
+ _.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", { contentSize: t, viewportSize: e, scrollPosition: C.current });
819
+ const I = pt(t - e, 0, t);
820
+ C.current > I && W(I);
719
821
  } else
720
- K(0);
721
- }, [H, K, t, e]), X(() => {
722
- const I = (M) => {
723
- if (!H)
822
+ W(0);
823
+ }, [J, W, t, e]), B(() => {
824
+ const I = (k) => {
825
+ if (!J)
724
826
  return;
725
- M.preventDefault(), O();
726
- let et = M.deltaY;
727
- M.deltaMode === 1 ? et *= 16 : M.deltaMode === 2 && (et *= e), Y !== 1 && (et *= Y), dt.debug("[ScrollPane] wheel event", { deltaY: et, scrollPosition: w.current, wheelSpeedMultiplier: Y, deltaMode: M.deltaMode, scrollTop: z.current?.scrollTop }), K((L) => L + et);
728
- }, D = $.current;
729
- return D && D.addEventListener("wheel", I, { passive: !1 }), () => {
730
- D && D.removeEventListener("wheel", I);
827
+ k.preventDefault(), F();
828
+ let et = k.deltaY;
829
+ k.deltaMode === 1 ? et *= 16 : k.deltaMode === 2 && (et *= e), q !== 1 && (et *= q), _.debug("[ScrollPane] wheel event", { deltaY: et, scrollPosition: C.current, wheelSpeedMultiplier: q, deltaMode: k.deltaMode, scrollTop: G.current?.scrollTop }), W((ut) => ut + et);
830
+ }, N = K.current;
831
+ return N && N.addEventListener("wheel", I, { passive: !1 }), () => {
832
+ N && N.removeEventListener("wheel", I);
731
833
  };
732
- }, [H, K, O, e, Y]), Ie(
733
- N,
834
+ }, [J, W, F, e, q]), ye(
835
+ tt,
734
836
  () => ({
735
- scrollTo: (I) => (O(), K(I)),
736
- getScrollPosition: () => w.current,
837
+ scrollTo: (I) => (F(), W(I)),
838
+ getScrollPosition: () => C.current,
737
839
  getContentSize: () => t,
738
840
  getViewportSize: () => e
739
841
  }),
740
- [K, t, e, O]
842
+ [W, t, e, F]
741
843
  );
742
- const y = S(K);
743
- X(() => {
744
- y.current = K;
745
- }, [K]);
746
- const ct = He(), F = S({
844
+ const v = S(W);
845
+ B(() => {
846
+ v.current = W;
847
+ }, [W]);
848
+ const Mt = Xe(), b = S({
747
849
  pointerId: null,
748
850
  startClientY: 0,
749
851
  startScroll: 0,
@@ -751,200 +853,201 @@ const ht = (o, t, e) => Math.min(e, Math.max(t, o)), be = "virtualscroll:tap-scr
751
853
  shouldCancelNextClick: !1,
752
854
  clickResetTimer: null,
753
855
  velocitySamples: []
754
- }), bt = S(h);
755
- X(() => {
756
- bt.current = h;
757
- }, [h]);
758
- const at = S(H);
759
- X(() => {
760
- at.current = H;
761
- }, [H]);
762
- const At = S(_);
763
- return X(() => {
764
- At.current = _;
765
- }, [_]), X(() => {
766
- if (h)
856
+ }), Pt = S(d);
857
+ B(() => {
858
+ Pt.current = d;
859
+ }, [d]);
860
+ const yt = S(J);
861
+ B(() => {
862
+ yt.current = J;
863
+ }, [J]);
864
+ const Lt = S(L);
865
+ return B(() => {
866
+ Lt.current = L;
867
+ }, [L]), B(() => {
868
+ if (d)
767
869
  return;
768
- const I = z.current, D = F.current;
769
- D.pointerId !== null && I && I.hasPointerCapture(D.pointerId) && I.releasePointerCapture(D.pointerId), D.clickResetTimer !== null && (window.clearTimeout(D.clickResetTimer), D.clickResetTimer = null), D.pointerId = null, D.startClientY = 0, D.startScroll = 0, D.isDragging = !1, D.shouldCancelNextClick = !1, D.velocitySamples = [];
770
- }, [h]), X(() => {
771
- const I = z.current;
870
+ const I = G.current, N = b.current;
871
+ N.pointerId && I?.hasPointerCapture(N.pointerId) && I.releasePointerCapture(N.pointerId), N.clickResetTimer !== null && (window.clearTimeout(N.clickResetTimer), N.clickResetTimer = null), N.pointerId = null, N.startClientY = 0, N.startScroll = 0, N.isDragging = !1, N.shouldCancelNextClick = !1, N.velocitySamples = [];
872
+ }, [d]), B(() => {
873
+ const I = G.current;
772
874
  if (!I)
773
875
  return;
774
- const D = 6, M = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), et = () => {
775
- const g = F.current;
776
- g.pointerId = null, g.startClientY = 0, g.startScroll = 0, g.isDragging = !1, g.velocitySamples = [];
777
- }, L = () => {
778
- const g = F.current;
779
- g.clickResetTimer !== null && (window.clearTimeout(g.clickResetTimer), g.clickResetTimer = null);
780
- }, Mt = (g) => {
781
- const P = F.current, ot = M();
782
- P.velocitySamples.push({ clientY: g, time: ot });
783
- const W = At.current.velocitySampleWindow;
784
- P.velocitySamples = P.velocitySamples.filter((j) => ot - j.time <= W);
785
- }, xt = (g) => g instanceof HTMLElement && g.closest("[data-scrollpane-ignore-drag='true']") !== null, It = (g) => {
786
- const P = F.current;
787
- P.shouldCancelNextClick && (g.preventDefault(), g.stopPropagation(), P.shouldCancelNextClick = !1);
788
- }, rt = (g) => {
789
- const P = F.current;
790
- P.isDragging || (P.isDragging = !0, P.shouldCancelNextClick = !0, I.hasPointerCapture(g.pointerId) || I.setPointerCapture(g.pointerId), Mt(g.clientY));
791
- }, lt = (g) => {
792
- const P = F.current;
793
- if (P.pointerId !== g.pointerId || !(bt.current && at.current) || !P.isDragging && (Math.abs(g.clientY - P.startClientY) < D || (rt(g), !P.isDragging)))
876
+ const N = 6, k = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), et = () => {
877
+ const h = b.current;
878
+ h.pointerId = null, h.startClientY = 0, h.startScroll = 0, h.isDragging = !1, h.velocitySamples = [];
879
+ }, ut = () => {
880
+ const h = b.current;
881
+ h.clickResetTimer !== null && (window.clearTimeout(h.clickResetTimer), h.clickResetTimer = null);
882
+ }, Dt = (h) => {
883
+ const M = b.current, j = k();
884
+ M.velocitySamples.push({ clientY: h, time: j });
885
+ const at = Lt.current.velocitySampleWindow;
886
+ M.velocitySamples = M.velocitySamples.filter((dt) => j - dt.time <= at);
887
+ }, mt = (h) => h instanceof HTMLElement && h.closest("[data-scrollpane-ignore-drag='true']") !== null, st = (h) => {
888
+ const M = b.current;
889
+ M.shouldCancelNextClick && (h.preventDefault(), h.stopPropagation(), M.shouldCancelNextClick = !1);
890
+ }, ot = (h) => {
891
+ const M = b.current;
892
+ M.isDragging || (M.isDragging = !0, M.shouldCancelNextClick = !0, I.hasPointerCapture(h.pointerId) || I.setPointerCapture(h.pointerId), Dt(h.clientY));
893
+ }, Ct = (h) => {
894
+ const M = b.current;
895
+ if (M.pointerId !== h.pointerId || !(Pt.current && yt.current) || !M.isDragging && (Math.abs(h.clientY - M.startClientY) < N || (ot(h), !M.isDragging)))
794
896
  return;
795
- Mt(g.clientY);
796
- const ot = g.clientY - P.startClientY, W = P.startScroll - ot;
797
- y.current(W), g.cancelable && g.preventDefault();
798
- }, ut = (g) => {
799
- const P = F.current;
800
- if (P.pointerId !== g.pointerId)
897
+ Dt(h.clientY);
898
+ const j = h.clientY - M.startClientY, at = M.startScroll - j;
899
+ v.current(at), h.cancelable && h.preventDefault();
900
+ }, Et = (h) => {
901
+ const M = b.current;
902
+ if (M.pointerId !== h.pointerId)
801
903
  return;
802
- P.isDragging && P.shouldCancelNextClick && g.cancelable && (g.preventDefault(), g.stopPropagation()), I.hasPointerCapture(g.pointerId) && I.releasePointerCapture(g.pointerId);
803
- let ot = 0;
804
- if (P.isDragging && P.velocitySamples.length >= 2) {
805
- const j = P.velocitySamples, Dt = At.current.velocitySampleWindow, wt = j[j.length - 1], pt = j.find((Ct) => wt.time - Ct.time <= Dt) ?? j[0];
806
- if (wt && pt && wt.time !== pt.time) {
807
- const Ct = wt.clientY - pt.clientY, Ht = wt.time - pt.time;
808
- ot = -(Ct / Ht);
904
+ M.isDragging && M.shouldCancelNextClick && h.cancelable && (h.preventDefault(), h.stopPropagation()), I.hasPointerCapture(h.pointerId) && I.releasePointerCapture(h.pointerId);
905
+ let j = 0;
906
+ if (M.isDragging && M.velocitySamples.length >= 2) {
907
+ const dt = M.velocitySamples, Ot = Lt.current.velocitySampleWindow, ft = dt[dt.length - 1], Yt = dt.find((Zt) => ft.time - Zt.time <= Ot) ?? dt[0];
908
+ if (ft && Yt && ft.time !== Yt.time) {
909
+ const Zt = ft.clientY - Yt.clientY, Nt = ft.time - Yt.time;
910
+ j = -(Zt / Nt);
809
911
  }
810
912
  }
811
- L(), P.shouldCancelNextClick && (P.clickResetTimer = window.setTimeout(() => {
812
- const j = F.current;
813
- j.shouldCancelNextClick = !1, j.clickResetTimer = null;
913
+ ut(), M.shouldCancelNextClick && (M.clickResetTimer = window.setTimeout(() => {
914
+ const dt = b.current;
915
+ dt.shouldCancelNextClick = !1, dt.clickResetTimer = null;
814
916
  }, 0));
815
- const W = At.current.startVelocityThreshold;
816
- et(), Math.abs(ot) >= W && vt.current?.(ot);
817
- }, gt = (g) => {
818
- if (!(bt.current && at.current) || g.button !== 0 && g.pointerType === "mouse" || g.ctrlKey || g.metaKey || g.altKey || xt(g.target))
917
+ const at = Lt.current.startVelocityThreshold;
918
+ et(), Math.abs(j) >= at && vt.current?.(j);
919
+ }, wt = (h) => {
920
+ if (!(Pt.current && yt.current) || h.button !== 0 && h.pointerType === "mouse" || h.ctrlKey || h.metaKey || h.altKey || mt(h.target))
819
921
  return;
820
- window.dispatchEvent(new CustomEvent(be, { detail: { paneId: ct } })), it.current?.();
821
- const P = F.current;
822
- L(), P.pointerId = g.pointerId, P.startClientY = g.clientY, P.startScroll = w.current, P.isDragging = !1, P.shouldCancelNextClick = !1, P.velocitySamples = [];
823
- }, Et = (g) => {
824
- const P = F.current;
825
- P.pointerId === g.pointerId && (P.shouldCancelNextClick = !1, I.hasPointerCapture(g.pointerId) && I.releasePointerCapture(g.pointerId), L(), et());
826
- }, Xt = [
827
- ["click", It, !0],
828
- ["pointerdown", gt, { passive: !1 }],
829
- ["pointermove", lt, { passive: !1 }],
830
- ["pointerup", ut, void 0],
831
- ["pointercancel", Et, void 0]
832
- ], Pt = [
833
- ["pointermove", lt, { passive: !1 }],
834
- ["pointerup", ut, void 0],
835
- ["pointercancel", Et, void 0]
922
+ window.dispatchEvent(new CustomEvent(Se, { detail: { paneId: Mt } })), Tt.current?.();
923
+ const M = b.current;
924
+ ut(), M.pointerId = h.pointerId, M.startClientY = h.clientY, M.startScroll = C.current, M.isDragging = !1, M.shouldCancelNextClick = !1, M.velocitySamples = [];
925
+ }, At = (h) => {
926
+ const M = b.current;
927
+ M.pointerId === h.pointerId && (M.shouldCancelNextClick = !1, I.hasPointerCapture(h.pointerId) && I.releasePointerCapture(h.pointerId), ut(), et());
928
+ }, Bt = [
929
+ ["click", st, !0],
930
+ ["pointerdown", wt, { passive: !1 }],
931
+ ["pointermove", Ct, { passive: !1 }],
932
+ ["pointerup", Et, void 0],
933
+ ["pointercancel", At, void 0]
934
+ ], ht = [
935
+ ["pointermove", Ct, { passive: !1 }],
936
+ ["pointerup", Et, void 0],
937
+ ["pointercancel", At, void 0]
836
938
  ];
837
- return le(I, Xt, "add"), le(window, Pt, "add"), () => {
838
- le(I, Xt, "remove"), le(window, Pt, "remove");
839
- const g = F.current;
840
- g.pointerId !== null && I.hasPointerCapture(g.pointerId) && I.releasePointerCapture(g.pointerId), L(), et();
939
+ return ge(I, Bt, "add"), ge(window, ht, "add"), () => {
940
+ ge(I, Bt, "remove"), ge(window, ht, "remove");
941
+ const h = b.current;
942
+ h.pointerId !== null && I.hasPointerCapture(h.pointerId) && I.releasePointerCapture(h.pointerId), ut(), et();
841
943
  };
842
- }, [ct]), /* @__PURE__ */ Ut("div", { ref: $, className: Wt("relative flex", d), style: f, children: [
843
- /* @__PURE__ */ Ut(
944
+ }, [Mt]), /* @__PURE__ */ re("div", { ref: K, className: ee("aqvs-scroll-pane", p), style: m, children: [
945
+ /* @__PURE__ */ re(
844
946
  "div",
845
947
  {
846
- ref: z,
847
- className: Wt("relative h-full flex-1 overflow-hidden"),
948
+ ref: G,
949
+ className: ee("aqvs-scroll-pane-content"),
848
950
  style: {
849
951
  height: e,
850
- paddingTop: mt.top,
851
- paddingBottom: mt.bottom,
852
- ...h ? { touchAction: "none" } : {}
952
+ paddingTop: D.top,
953
+ paddingBottom: D.bottom,
954
+ ...d ? { touchAction: "none" } : {}
853
955
  },
854
- id: ct,
956
+ id: Mt,
855
957
  children: [
856
- m,
857
- o(w.current)
958
+ g,
959
+ n(C.current)
858
960
  ]
859
961
  }
860
962
  ),
861
- H && /* @__PURE__ */ B(
963
+ /* @__PURE__ */ $(
862
964
  or,
863
965
  {
864
966
  contentSize: t,
865
967
  viewportSize: e,
866
- scrollPosition: w.current,
867
- onScroll: K,
968
+ scrollPosition: C.current,
969
+ onScroll: W,
868
970
  enableThumbDrag: s,
869
- enableTrackClick: c,
870
- enableArrowButtons: u,
871
- scrollBarWidth: n,
872
- ariaControls: ct,
873
- tapScrollCircleOptions: R,
971
+ enableTrackClick: l,
972
+ enableArrowButtons: c,
973
+ scrollBarWidth: r,
974
+ ariaControls: Mt,
975
+ tapScrollCircleOptions: E,
874
976
  itemCount: A,
875
977
  renderThumbOverlay: U,
876
- visibleStartIndex: ft,
877
- visibleEndIndex: nt
878
- }
978
+ visibleStartIndex: bt,
979
+ visibleEndIndex: lt
980
+ },
981
+ "scrollbar"
879
982
  ),
880
- tt?.()
983
+ it?.()
881
984
  ] });
882
985
  }
883
- ), ye = (o, t, e) => Math.min(Math.max(o, t), e), Pr = ({ dragState: o, normalizedDistance: t, sizeScale: e, size: n }) => {
884
- const s = Math.max(n / 2, 1), c = 1 + t * 0.65, u = Math.max(0.65, 1 - t * 0.25), h = o.direction * t * 26 * e, l = 0.8 + t * 0.18, d = 3 * e, f = 6 * e, m = 22 * e, R = Math.abs(h) + f, b = h > 0 ? d : -Math.abs(h) - d, A = Math.max(2.5, 3 * e), U = ye(o.offsetX, -s, s), Y = ye(o.offsetY, -s, s), Z = s * 0.35, ft = U / s * Z, nt = Y / s * Z, tt = ft * 0.45, N = nt * 0.45, w = Math.max(m * 0.38, 6), $ = 0.65 + t * 0.2, z = o.active;
885
- return /* @__PURE__ */ Ut(Ce, { children: [
886
- /* @__PURE__ */ B(
986
+ ), Ee = (n, t, e) => Math.min(Math.max(n, t), e), Tr = ({ dragState: n, normalizedDistance: t, sizeScale: e, size: r }) => {
987
+ const s = Math.max(r / 2, 1), l = 1 + t * 0.65, c = Math.max(0.65, 1 - t * 0.25), d = n.direction * t * 26 * e, f = 0.8 + t * 0.18, p = 3 * e, m = 6 * e, g = 22 * e, E = Math.abs(d) + m, x = d > 0 ? p : -Math.abs(d) - p, A = Math.max(2.5, 3 * e), U = Ee(n.offsetX, -s, s), q = Ee(n.offsetY, -s, s), Q = s * 0.35, bt = U / s * Q, lt = q / s * Q, it = bt * 0.45, Y = lt * 0.45, tt = Math.max(g * 0.38, 6), C = 0.65 + t * 0.2, K = n.active;
988
+ return /* @__PURE__ */ re(ke, { children: [
989
+ /* @__PURE__ */ $(
887
990
  "div",
888
991
  {
889
- className: "aqvs:tap-scroll-circle-gradient absolute inset-0 rounded-full border border-white/40 shadow-md",
992
+ className: "aqvs-tap-scroll-circle-gradient",
890
993
  style: {
891
- transform: `scale(${u}, ${c})`,
892
- transition: z ? "40ms transform ease-out" : "200ms ease transform"
994
+ transform: `scale(${c}, ${l})`,
995
+ transition: K ? "40ms transform ease-out" : "200ms ease transform"
893
996
  }
894
997
  }
895
998
  ),
896
- /* @__PURE__ */ B(
999
+ /* @__PURE__ */ $(
897
1000
  "div",
898
1001
  {
899
- className: "absolute top-1/2 left-1/2 rounded-full border border-white/50 bg-white/85",
1002
+ className: "aqvs-sample-visual-rod",
900
1003
  style: {
901
- width: m,
902
- height: m,
903
- transform: `translate(calc(-50% + ${ft}px), calc(-50% + ${nt}px)) scale(${u}, ${l * c})`,
904
- transition: z ? "70ms transform ease-out" : "200ms ease transform"
1004
+ width: g,
1005
+ height: g,
1006
+ transform: `translate(calc(-50% + ${bt}px), calc(-50% + ${lt}px)) scale(${c}, ${f * l})`,
1007
+ transition: K ? "70ms transform ease-out" : "200ms ease transform"
905
1008
  }
906
1009
  }
907
1010
  ),
908
- /* @__PURE__ */ B(
1011
+ /* @__PURE__ */ $(
909
1012
  "div",
910
1013
  {
911
- className: "absolute top-1/2 left-1/2 rounded-full bg-white/80",
1014
+ className: "aqvs-sample-visual-pupil",
912
1015
  style: {
913
- width: w,
914
- height: w,
915
- transform: `translate(calc(-50% + ${tt}px), calc(-50% + ${N}px)) scale(${u}, ${c})`,
916
- opacity: $,
1016
+ width: tt,
1017
+ height: tt,
1018
+ transform: `translate(calc(-50% + ${it}px), calc(-50% + ${Y}px)) scale(${c}, ${l})`,
1019
+ opacity: C,
917
1020
  boxShadow: "0 0 8px rgba(255,255,255,0.45)",
918
- transition: z ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1021
+ transition: K ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
919
1022
  }
920
1023
  }
921
1024
  ),
922
- /* @__PURE__ */ B(
1025
+ /* @__PURE__ */ $(
923
1026
  "div",
924
1027
  {
925
- className: "absolute top-1/2 left-1/2 rounded-full bg-white/50",
1028
+ className: "aqvs-sample-visual-highlight",
926
1029
  style: {
927
1030
  width: A,
928
- height: R,
929
- transform: `translate(-50%, ${b}px)`,
1031
+ height: E,
1032
+ transform: `translate(-50%, ${x}px)`,
930
1033
  opacity: t,
931
- transition: z ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1034
+ transition: K ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
932
1035
  }
933
1036
  }
934
1037
  )
935
1038
  ] });
936
- }, ir = (o) => {
937
- if (!Number.isFinite(o))
1039
+ }, lr = (n) => {
1040
+ if (!Number.isFinite(n))
938
1041
  return 0n;
939
- const t = Math.trunc(o);
1042
+ const t = Math.trunc(n);
940
1043
  return t <= 0 ? 0n : BigInt(t);
941
- }, ce = (o) => {
942
- if (o <= 0 || !Number.isFinite(o))
1044
+ }, xe = (n) => {
1045
+ if (n <= 0 || !Number.isFinite(n))
943
1046
  return 0;
944
- const t = Math.trunc(o), e = BigInt(t) & -BigInt(t);
1047
+ const t = Math.trunc(n), e = BigInt(t) & -BigInt(t);
945
1048
  return Number(e);
946
1049
  };
947
- class ar {
1050
+ class cr {
948
1051
  /**
949
1052
  * @private
950
1053
  * @property {Map<number, number>} tree - The Map storing the Fenwick tree structure, specifically the sums of deltas. It is 1-indexed.
@@ -984,8 +1087,8 @@ class ar {
984
1087
  * @param {number | ((index: number) => number)} valueOrFn - The value for all elements, or a function to generate values.
985
1088
  * @param {{ sampleRange?: { from: number; to: number }, materialize?: boolean }} [options] - Optional settings for initialization.
986
1089
  */
987
- constructor(t, e, n) {
988
- this.reset(t, e, n);
1090
+ constructor(t, e, r) {
1091
+ this.reset(t, e, r);
989
1092
  }
990
1093
  /**
991
1094
  * @method reset
@@ -995,20 +1098,20 @@ class ar {
995
1098
  * @param {number | ((index: number) => number)} valueOrFn - The value for all elements, or a function to generate values.
996
1099
  * @param {{ sampleRange?: { from: number; to: number }, materialize?: boolean }} [options] - Optional settings for initialization.
997
1100
  */
998
- reset(t, e, n) {
1101
+ reset(t, e, r) {
999
1102
  if (this.size = t, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, typeof e == "function") {
1000
1103
  if (this.valueFn = e, this.size > 0) {
1001
- const c = n?.sampleRange ?? {
1104
+ const l = r?.sampleRange ?? {
1002
1105
  from: 0,
1003
1106
  to: Math.min(99, this.size - 1)
1004
- }, { mode: u, materializedValues: h } = this._calculateMode(c.from, c.to);
1005
- if (this.baseValue = u, n?.materialize)
1006
- for (let l = 0; l < h.length; l++) {
1007
- const d = h[l], f = c.from + l;
1008
- if (f >= this.size)
1107
+ }, { mode: c, materializedValues: d } = this._calculateMode(l.from, l.to);
1108
+ if (this.baseValue = c, r?.materialize)
1109
+ for (let f = 0; f < d.length; f++) {
1110
+ const p = d[f], m = l.from + f;
1111
+ if (m >= this.size)
1009
1112
  break;
1010
- const m = d - this.baseValue;
1011
- this.deltas.set(f, m), this._updateTree(f, m);
1113
+ const g = p - this.baseValue;
1114
+ this.deltas.set(m, g), this._updateTree(m, g);
1012
1115
  }
1013
1116
  } else
1014
1117
  this.baseValue = 0;
@@ -1042,30 +1145,30 @@ class ar {
1042
1145
  _calculateMode(t, e) {
1043
1146
  if (!this.valueFn)
1044
1147
  return { mode: 0, materializedValues: [] };
1045
- const n = [];
1046
- for (let d = t; d <= e && !(d >= this.size); d++)
1047
- n.push(this.valueFn(d));
1048
- const s = [...n];
1049
- if (n.length === 0)
1148
+ const r = [];
1149
+ for (let p = t; p <= e && !(p >= this.size); p++)
1150
+ r.push(this.valueFn(p));
1151
+ const s = [...r];
1152
+ if (r.length === 0)
1050
1153
  return { mode: 0, materializedValues: [] };
1051
- n.sort((d, f) => d - f);
1052
- const c = Math.floor(n.length / 2);
1053
- let u;
1054
- n.length % 2 === 0 ? u = Math.floor((n[c - 1] + n[c]) / 2) : u = n[c];
1055
- const h = /* @__PURE__ */ new Map();
1056
- let l = 0;
1057
- for (const d of n) {
1058
- const f = (h.get(d) ?? 0) + 1;
1059
- h.set(d, f), f > l && (l = f);
1154
+ r.sort((p, m) => p - m);
1155
+ const l = Math.floor(r.length / 2);
1156
+ let c;
1157
+ r.length % 2 === 0 ? c = Math.floor((r[l - 1] + r[l]) / 2) : c = r[l];
1158
+ const d = /* @__PURE__ */ new Map();
1159
+ let f = 0;
1160
+ for (const p of r) {
1161
+ const m = (d.get(p) ?? 0) + 1;
1162
+ d.set(p, m), m > f && (f = m);
1060
1163
  }
1061
- if (l > n.length * 0.2) {
1062
- const d = [];
1063
- for (const [m, R] of h.entries())
1064
- R === l && d.push(m);
1065
- const f = d.reduce((m, R) => m + R, 0);
1066
- u = Math.floor(f / d.length);
1164
+ if (f > r.length * 0.2) {
1165
+ const p = [];
1166
+ for (const [g, E] of d.entries())
1167
+ E === f && p.push(g);
1168
+ const m = p.reduce((g, E) => g + E, 0);
1169
+ c = Math.floor(m / p.length);
1067
1170
  }
1068
- return { mode: u, materializedValues: s };
1171
+ return { mode: c, materializedValues: s };
1069
1172
  }
1070
1173
  /**
1071
1174
  * @method update
@@ -1104,11 +1207,11 @@ class ar {
1104
1207
  * @param {DeltaUpdate[]} updates - An array of updates, each with an index and the change to apply.
1105
1208
  */
1106
1209
  updateDeltas(t) {
1107
- for (const { index: e, change: n } of t) {
1210
+ for (const { index: e, change: r } of t) {
1108
1211
  if (e < 0 || e >= this.size)
1109
1212
  throw new Error(`Index ${e} out of bounds`);
1110
1213
  const s = this.deltas.get(e) ?? 0;
1111
- this.deltas.set(e, s + n), this._updateTree(e, n);
1214
+ this.deltas.set(e, s + r), this._updateTree(e, r);
1112
1215
  }
1113
1216
  return this.total;
1114
1217
  }
@@ -1123,13 +1226,13 @@ class ar {
1123
1226
  _updateTree(t, e) {
1124
1227
  if (e === 0)
1125
1228
  return;
1126
- let n = t + 1;
1127
- for (; n <= this.size; ) {
1128
- this.tree.set(n, (this.tree.get(n) ?? 0) + e);
1129
- const s = ce(n);
1229
+ let r = t + 1;
1230
+ for (; r <= this.size; ) {
1231
+ this.tree.set(r, (this.tree.get(r) ?? 0) + e);
1232
+ const s = xe(r);
1130
1233
  if (s === 0)
1131
1234
  break;
1132
- n += s;
1235
+ r += s;
1133
1236
  }
1134
1237
  this.total !== void 0 && (this.total += e);
1135
1238
  }
@@ -1143,13 +1246,13 @@ class ar {
1143
1246
  */
1144
1247
  _buildDeltaUpdates(t) {
1145
1248
  const e = [];
1146
- for (const { index: n, value: s } of t) {
1147
- if (n < 0 || n >= this.size)
1148
- throw new Error(`Index ${n} out of bounds`);
1249
+ for (const { index: r, value: s } of t) {
1250
+ if (r < 0 || r >= this.size)
1251
+ throw new Error(`Index ${r} out of bounds`);
1149
1252
  if (s < 0)
1150
1253
  throw new Error("Value cannot be negative.");
1151
- const c = this.deltas.has(n) ? (this.deltas.get(n) ?? 0) + this.baseValue : this.baseValue, u = s - c;
1152
- u !== 0 && e.push({ index: n, change: u });
1254
+ const l = this.deltas.has(r) ? (this.deltas.get(r) ?? 0) + this.baseValue : this.baseValue, c = s - l;
1255
+ c !== 0 && e.push({ index: r, change: c });
1153
1256
  }
1154
1257
  return e;
1155
1258
  }
@@ -1166,10 +1269,10 @@ class ar {
1166
1269
  let t = 0, e = this.size;
1167
1270
  for (; e > 0; ) {
1168
1271
  t += this.tree.get(e) ?? 0;
1169
- const n = ce(e);
1170
- if (n === 0)
1272
+ const r = xe(e);
1273
+ if (r === 0)
1171
1274
  break;
1172
- e -= n;
1275
+ e -= r;
1173
1276
  }
1174
1277
  return t + this.baseValue * this.size;
1175
1278
  }
@@ -1183,10 +1286,10 @@ class ar {
1183
1286
  */
1184
1287
  _materialize(t, e = !0) {
1185
1288
  if (this.valueFn) {
1186
- const n = this.deltas.get(t) ?? 0, c = this.valueFn(t) - this.baseValue;
1187
- if (c !== n && (this.deltas.set(t, c), e)) {
1188
- const u = c - n;
1189
- this._updateTree(t, u);
1289
+ const r = this.deltas.get(t) ?? 0, l = this.valueFn(t) - this.baseValue;
1290
+ if (l !== r && (this.deltas.set(t, l), e)) {
1291
+ const c = l - r;
1292
+ this._updateTree(t, c);
1190
1293
  }
1191
1294
  }
1192
1295
  }
@@ -1199,24 +1302,24 @@ class ar {
1199
1302
  * @param {number | undefined} index - Target index for materialization.
1200
1303
  * @param {boolean} [forceIndex=false] - When true, materializes the index even if it is outside the provided ranges.
1201
1304
  */
1202
- _materializeRanges(t, e, n = !1) {
1305
+ _materializeRanges(t, e, r = !1) {
1203
1306
  if (!(t?.materialize && this.valueFn))
1204
1307
  return;
1205
1308
  const s = t.ranges;
1206
1309
  if (s && s.length > 0) {
1207
- for (const h of s) {
1208
- const l = h.from, d = Math.min(h.to, this.size - 1);
1209
- for (let f = l; f <= d; f++)
1210
- this._materialize(f);
1310
+ for (const d of s) {
1311
+ const f = d.from, p = Math.min(d.to, this.size - 1);
1312
+ for (let m = f; m <= p; m++)
1313
+ this._materialize(m);
1211
1314
  }
1212
1315
  if (e === void 0)
1213
1316
  return;
1214
- if (n) {
1317
+ if (r) {
1215
1318
  this._materialize(e);
1216
1319
  return;
1217
1320
  }
1218
- const c = s[0].from, u = s[s.length - 1].to;
1219
- e >= c && e <= u && this._materialize(e);
1321
+ const l = s[0].from, c = s[s.length - 1].to;
1322
+ e >= l && e <= c && this._materialize(e);
1220
1323
  return;
1221
1324
  }
1222
1325
  e !== void 0 && this._materialize(e);
@@ -1231,31 +1334,31 @@ class ar {
1231
1334
  * @param {boolean} chooseLowerBound - When true, finds the smallest index meeting or exceeding the target; otherwise finds the largest index not exceeding it.
1232
1335
  * @returns {{ index: number; total: number | undefined; cumulative: number | undefined; currentValue: number | undefined; safeIndex: number | undefined }} Binary search result.
1233
1336
  */
1234
- _findIndex(t, e = {}, n) {
1235
- if (this.size >= Number.MAX_SAFE_INTEGER)
1236
- return this._findIndexLarge(t, e, n);
1337
+ _findIndex(t, e = {}, r) {
1338
+ if (this.size > 2147483647)
1339
+ return this._findIndexLarge(t, e, r);
1237
1340
  if (this.size === 0)
1238
1341
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1239
- let s = 0, c = 0, u = 1;
1240
- for (; u << 1 <= this.size; )
1241
- u <<= 1;
1242
- for (; u > 0; u >>= 1) {
1243
- const d = s + u;
1244
- if (d <= this.size) {
1245
- const m = (this.tree.get(d) ?? 0) + this.baseValue * u;
1246
- (n ? c + m < t : c + m <= t) && (s = d, c += m);
1342
+ let s = 0, l = 0, c = 1;
1343
+ for (; c << 1 <= this.size; )
1344
+ c <<= 1;
1345
+ for (; c > 0; c >>= 1) {
1346
+ const p = s + c;
1347
+ if (p <= this.size) {
1348
+ const g = (this.tree.get(p) ?? 0) + this.baseValue * c;
1349
+ (r ? l + g < t : l + g <= t) && (s = p, l += g);
1247
1350
  }
1248
1351
  }
1249
- const h = n ? s : s - 1;
1250
- if (h < 0 || h >= this.size)
1352
+ const d = r ? s : s - 1;
1353
+ if (d < 0 || d >= this.size)
1251
1354
  return { index: -1, total: this.total ?? this.getTotal(), cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1252
- const l = this.prefixSum(h, e);
1355
+ const f = this.prefixSum(d, e);
1253
1356
  return {
1254
- index: h,
1255
- total: this.total ?? l.total,
1256
- cumulative: l.cumulative,
1257
- currentValue: l.currentValue,
1258
- safeIndex: l.safeIndex
1357
+ index: d,
1358
+ total: this.total ?? f.total,
1359
+ cumulative: f.cumulative,
1360
+ currentValue: f.currentValue,
1361
+ safeIndex: f.safeIndex
1259
1362
  };
1260
1363
  }
1261
1364
  /**
@@ -1263,37 +1366,37 @@ class ar {
1263
1366
  *
1264
1367
  * 非常に大きなサイズに対して bigint 演算を用いた二分探索を実施。
1265
1368
  */
1266
- _findIndexLarge(t, e, n) {
1369
+ _findIndexLarge(t, e, r) {
1267
1370
  if (this.size === 0)
1268
1371
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1269
- const s = ir(this.size);
1372
+ const s = lr(this.size);
1270
1373
  if (s === 0n)
1271
1374
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1272
- let c = 0n, u = s - 1n, h, l, d, f = this.total;
1273
- for (; c <= u; ) {
1274
- const b = c + u >> 1n, A = Number(b), U = this.prefixSum(A, e);
1275
- if (d = U, f = U.total, n ? U.cumulative >= t : U.cumulative <= t)
1276
- if (h = b, l = U, n) {
1277
- if (b === 0n)
1375
+ let l = 0n, c = s - 1n, d, f, p, m = this.total;
1376
+ for (; l <= c; ) {
1377
+ const x = l + c >> 1n, A = Number(x), U = this.prefixSum(A, e);
1378
+ if (p = U, m = U.total, r ? U.cumulative >= t : U.cumulative <= t)
1379
+ if (d = x, f = U, r) {
1380
+ if (x === 0n)
1278
1381
  break;
1279
- u = b - 1n;
1382
+ c = x - 1n;
1280
1383
  } else
1281
- c = b + 1n;
1282
- else if (n)
1283
- c = b + 1n;
1384
+ l = x + 1n;
1385
+ else if (r)
1386
+ l = x + 1n;
1284
1387
  else {
1285
- if (b === 0n)
1388
+ if (x === 0n)
1286
1389
  break;
1287
- u = b - 1n;
1390
+ c = x - 1n;
1288
1391
  }
1289
1392
  }
1290
- const m = l ?? d;
1393
+ const g = f ?? p;
1291
1394
  return {
1292
- index: h !== void 0 ? Number(h) : -1,
1293
- total: f,
1294
- cumulative: m?.cumulative,
1295
- currentValue: m?.currentValue,
1296
- safeIndex: m?.safeIndex
1395
+ index: d !== void 0 ? Number(d) : -1,
1396
+ total: m,
1397
+ cumulative: g?.cumulative,
1398
+ currentValue: g?.currentValue,
1399
+ safeIndex: g?.safeIndex
1297
1400
  };
1298
1401
  }
1299
1402
  /**
@@ -1307,19 +1410,19 @@ class ar {
1307
1410
  prefixSum(t, e) {
1308
1411
  if (t < 0)
1309
1412
  return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
1310
- const n = ht(t, 0, this.size - 1), s = e?.materializeOption;
1311
- this._materializeRanges(s, n, !0);
1312
- let c = 0, u = n + 1;
1313
- for (; u > 0; ) {
1314
- const l = this.tree.get(u) ?? 0;
1315
- c += l;
1316
- const d = ce(u);
1317
- if (d === 0)
1413
+ const r = pt(t, 0, this.size - 1), s = e?.materializeOption;
1414
+ this._materializeRanges(s, r, !0);
1415
+ let l = 0, c = r + 1;
1416
+ for (; c > 0; ) {
1417
+ const f = this.tree.get(c) ?? 0;
1418
+ l += f;
1419
+ const p = xe(c);
1420
+ if (p === 0)
1318
1421
  break;
1319
- u -= d;
1422
+ c -= p;
1320
1423
  }
1321
- const h = s?.materialize ? this.get(n) : (this.deltas.get(n) || 0) + this.baseValue;
1322
- return { cumulative: c + this.baseValue * (n + 1), total: this.total, currentValue: h, safeIndex: n };
1424
+ const d = s?.materialize ? this.get(r) : (this.deltas.get(r) || 0) + this.baseValue;
1425
+ return { cumulative: l + this.baseValue * (r + 1), total: this.total, currentValue: d, safeIndex: r };
1323
1426
  }
1324
1427
  /**
1325
1428
  * @method get
@@ -1332,8 +1435,8 @@ class ar {
1332
1435
  get(t, e) {
1333
1436
  if (t < 0 || t >= this.size)
1334
1437
  throw new Error("Index out of bounds");
1335
- const n = e?.materializeOption;
1336
- return this._materializeRanges(n, t), (this.deltas.get(t) ?? 0) + this.baseValue;
1438
+ const r = e?.materializeOption;
1439
+ return this._materializeRanges(r, t), (this.deltas.get(t) ?? 0) + this.baseValue;
1337
1440
  }
1338
1441
  /**
1339
1442
  * @method getTotal
@@ -1349,8 +1452,8 @@ class ar {
1349
1452
  this.total = 0;
1350
1453
  else {
1351
1454
  this.total = this._computeTreeTotal();
1352
- const n = this.prefixSum(this.getSize() - 1);
1353
- console.assert(n.cumulative === n.total, "Inconsistent Fenwick Tree state");
1455
+ const r = this.prefixSum(this.getSize() - 1);
1456
+ r.cumulative !== r.total && _.error("Inconsistent Fenwick Tree state");
1354
1457
  }
1355
1458
  return this.total;
1356
1459
  }
@@ -1363,21 +1466,21 @@ class ar {
1363
1466
  */
1364
1467
  rebuildTree(t) {
1365
1468
  if (t?.materialize && this.valueFn) {
1366
- const n = this.valueFn;
1367
- this.reset(this.size, (s) => n(s), { materialize: !0 });
1469
+ const r = this.valueFn;
1470
+ this.reset(this.size, (s) => r(s), { materialize: !0 });
1368
1471
  return;
1369
1472
  }
1370
1473
  const e = /* @__PURE__ */ new Map();
1371
- for (const [n, s] of this.deltas.entries()) {
1474
+ for (const [r, s] of this.deltas.entries()) {
1372
1475
  if (s === 0)
1373
1476
  continue;
1374
- let c = n + 1;
1375
- for (; c <= this.size; ) {
1376
- e.set(c, (e.get(c) ?? 0) + s);
1377
- const u = ce(c);
1378
- if (u === 0)
1477
+ let l = r + 1;
1478
+ for (; l <= this.size; ) {
1479
+ e.set(l, (e.get(l) ?? 0) + s);
1480
+ const c = xe(l);
1481
+ if (c === 0)
1379
1482
  break;
1380
- c += u;
1483
+ l += c;
1381
1484
  }
1382
1485
  }
1383
1486
  this.tree = e, this.total = this._computeTreeTotal();
@@ -1410,8 +1513,8 @@ class ar {
1410
1513
  for (const s of this.deltas.keys())
1411
1514
  s >= t && this.deltas.delete(s);
1412
1515
  this.size = t, this.rebuildTree();
1413
- const n = this.prefixSum(this.getSize() - 1);
1414
- console.assert(n.cumulative === n.total, "Inconsistent Fenwick Tree state");
1516
+ const r = this.prefixSum(this.getSize() - 1);
1517
+ r.cumulative !== r.total && _.error("Inconsistent Fenwick Tree state");
1415
1518
  }
1416
1519
  /**
1417
1520
  * @method getSize
@@ -1451,11 +1554,17 @@ class ar {
1451
1554
  return this._findIndex(t, e ?? {}, !1);
1452
1555
  }
1453
1556
  }
1454
- const lr = (o, t, e) => {
1455
- const n = Math.max(0, o), s = S(null), c = yt(() => new ar(n, t, e), [n, t, e]);
1456
- return Object.is(s.current, c) || console.warn("[useFenwickMapTree] instance changed"), s.current = c, c;
1557
+ const ur = (n, t, e) => {
1558
+ const r = Math.max(0, n), s = S(null), l = S({ size: r, valueOrFn: t, options: e });
1559
+ s.current === null && (s.current = new cr(r, t, e));
1560
+ const c = s.current, d = l.current, f = d.size !== r, p = d.valueOrFn !== t, m = d.options !== e;
1561
+ if (p || m) {
1562
+ const g = e?.resetOnValueFnChange ?? !0;
1563
+ m || p && g ? (e?.debug && _.debug("[useFenwickMapTree] reset", { valueOrFnChanged: p, optionsChanged: m }), c.reset(r, t, e)) : (f && (e?.debug && _.debug("[useFenwickMapTree] resize (with valueFn change)", { from: d.size, to: r }), c.changeSize(r)), e?.debug && _.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: p }), c.setValueFn(t, { reset: !1 })), l.current = { size: r, valueOrFn: t, options: e };
1564
+ } else f && (e?.debug && _.debug("[useFenwickMapTree] resize", { from: d.size, to: r }), d.size === 0 && r > 0 ? c.reset(r, t, e) : c.changeSize(r), l.current = { size: r, valueOrFn: t, options: e });
1565
+ return c;
1457
1566
  };
1458
- class cr {
1567
+ class dr {
1459
1568
  key;
1460
1569
  value;
1461
1570
  prev = null;
@@ -1464,7 +1573,7 @@ class cr {
1464
1573
  this.key = t, this.value = e;
1465
1574
  }
1466
1575
  }
1467
- class Me {
1576
+ class Ae {
1468
1577
  head = null;
1469
1578
  tail = null;
1470
1579
  /**
@@ -1505,610 +1614,687 @@ class Me {
1505
1614
  this.remove(t), this.addToTail(t);
1506
1615
  }
1507
1616
  }
1508
- function ur(o) {
1509
- const t = S(/* @__PURE__ */ new Map()), e = S(new Me());
1510
- X(() => {
1511
- for (; t.current.size > o; ) {
1512
- const f = e.current.removeHead();
1513
- if (f)
1514
- t.current.delete(f.key);
1617
+ function fr(n) {
1618
+ const t = S(/* @__PURE__ */ new Map()), e = S(new Ae());
1619
+ B(() => {
1620
+ for (; t.current.size > n; ) {
1621
+ const m = e.current.removeHead();
1622
+ if (m)
1623
+ t.current.delete(m.key);
1515
1624
  else
1516
1625
  break;
1517
1626
  }
1518
- }, [o]);
1519
- const n = T((f) => {
1520
- const m = t.current.get(f);
1521
- if (m)
1522
- return e.current.moveToTail(m), m.value;
1627
+ }, [n]);
1628
+ const r = T((m) => {
1629
+ const g = t.current.get(m);
1630
+ if (g)
1631
+ return e.current.moveToTail(g), g.value;
1523
1632
  }, []), s = T(
1524
- (f, m) => {
1525
- if (o <= 0)
1633
+ (m, g) => {
1634
+ if (n <= 0)
1526
1635
  return;
1527
- let R = t.current.get(f);
1528
- if (R)
1529
- R.value = m, e.current.moveToTail(R);
1636
+ let E = t.current.get(m);
1637
+ if (E)
1638
+ E.value = g, e.current.moveToTail(E);
1530
1639
  else {
1531
- if (t.current.size >= o) {
1532
- const b = e.current.removeHead();
1533
- b && t.current.delete(b.key);
1640
+ if (t.current.size >= n) {
1641
+ const x = e.current.removeHead();
1642
+ x && t.current.delete(x.key);
1534
1643
  }
1535
- R = new cr(f, m), t.current.set(f, R), e.current.addToTail(R);
1644
+ E = new dr(m, g), t.current.set(m, E), e.current.addToTail(E);
1536
1645
  }
1537
1646
  },
1538
- [o]
1539
- ), c = T((f) => t.current.has(f), []), u = T((f) => {
1540
- const m = t.current.get(f);
1541
- m && (e.current.remove(m), t.current.delete(f));
1542
- }, []), h = T(() => {
1543
- t.current.clear(), e.current = new Me();
1544
- }, []), [l, d] = Vt(() => ({ get: n, set: s, has: c, remove: u, clear: h }));
1545
- return X(() => d({ get: n, set: s, has: c, remove: u, clear: h }), [n, s, c, u, h]), l;
1647
+ [n]
1648
+ ), l = T((m) => t.current.has(m), []), c = T((m) => {
1649
+ const g = t.current.get(m);
1650
+ g && (e.current.remove(g), t.current.delete(m));
1651
+ }, []), d = T(() => {
1652
+ t.current.clear(), e.current = new Ae();
1653
+ }, []), [f, p] = Ht(() => ({ get: r, set: s, has: l, remove: c, clear: d }));
1654
+ return B(() => p({ get: r, set: s, has: l, remove: c, clear: d }), [r, s, l, c, d]), f;
1546
1655
  }
1547
- const dr = 1e4, Sr = () => {
1548
- const { get: o, set: t, has: e, clear: n } = ur(dr);
1549
- return { get: o, set: t, has: e, clear: n };
1550
- }, st = (o, t) => t <= 0 ? 0 : ht(o, 0, t - 1), fr = (o) => ({
1551
- top: Math.max(0, o?.top ?? 0),
1552
- bottom: Math.max(0, o?.bottom ?? 0)
1553
- }), qt = (o, t) => o <= t ? 0 : o - t, te = (o, t) => o <= 0 ? t : o + t, ge = (o) => {
1554
- if (!Number.isFinite(o))
1555
- return 0n;
1556
- const t = Math.trunc(o);
1656
+ const mr = 1e4, Pr = () => {
1657
+ const { get: n, set: t, has: e, clear: r } = fr(mr);
1658
+ return { get: n, set: t, has: e, clear: r };
1659
+ }, nt = (n, t) => t <= 0 ? 0 : pt(n, 0, t - 1), De = (n) => ({
1660
+ top: Math.max(0, n?.top ?? 0),
1661
+ bottom: Math.max(0, n?.bottom ?? 0)
1662
+ }), Gt = (n, t) => n <= t ? 0 : n - t, oe = (n, t) => n <= 0 ? t : n + t, Pe = (n) => {
1663
+ if (!Number.isFinite(n)) return 0n;
1664
+ const t = Math.trunc(n);
1557
1665
  return t <= 0 ? 0n : BigInt(t);
1558
- }, mr = (o, t, e, n, s, c, u, h) => {
1559
- const l = ge(n);
1560
- if (l === 0n)
1666
+ }, pr = (n, t, e, r, s, l, c, d) => {
1667
+ const f = Pe(r);
1668
+ if (f === 0n)
1561
1669
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
1562
- const d = (N) => N < 0n ? 0n : N >= l ? l - 1n : N, f = { materializeOption: { materialize: !1 } }, { index: m, cumulative: R } = c.findIndexAtOrAfter(o, f);
1563
- let b;
1564
- m === -1 ? b = l - 1n : (R === o ? b = ge(m + 1) : b = ge(m), b >= l && (b = l - 1n)), o <= 0 && (b = 0n), h && o >= u && (b = l - 1n);
1565
- const A = (N) => {
1566
- let w = 0, $ = N, z = N, J = 0n;
1567
- for (; $ < l && w < t; ) {
1568
- const _ = Number($), mt = s(_);
1569
- if (w += mt, z = $, $ += 1n, J += 1n, !Number.isFinite(mt) || mt <= 0)
1670
+ const p = (Y) => Y < 0n ? 0n : Y >= f ? f - 1n : Y, m = { materializeOption: { materialize: !1 } }, { index: g, cumulative: E } = l.findIndexAtOrAfter(n, m);
1671
+ let x;
1672
+ g === -1 ? x = f - 1n : (E === n ? x = Pe(g + 1) : x = Pe(g), x >= f && (x = f - 1n)), n <= 0 && (x = 0n), d && n >= c && (x = f - 1n);
1673
+ const A = (Y) => {
1674
+ let tt = 0, C = Y, K = Y, G = 0n;
1675
+ for (; C < f && tt < t; ) {
1676
+ const It = Number(C), L = s(It);
1677
+ if (tt += L, K = C, C += 1n, G += 1n, !Number.isFinite(L) || L <= 0)
1570
1678
  break;
1571
1679
  }
1572
- return J === 0n && (z = N), { height: w, end: z };
1680
+ return G === 0n && (K = Y), { height: tt, end: K };
1573
1681
  };
1574
- let { height: U, end: Y } = A(b);
1575
- if (U < t && b > 0n) {
1576
- let N = b, w = U;
1577
- for (; N > 0n && w < t; ) {
1578
- N -= 1n;
1579
- const z = Number(N), J = s(z);
1580
- if (w += J, !Number.isFinite(J) || J <= 0)
1682
+ let { height: U, end: q } = A(x);
1683
+ if (U < t && x > 0n) {
1684
+ let Y = x, tt = U;
1685
+ for (; Y > 0n && tt < t; ) {
1686
+ Y -= 1n;
1687
+ const K = Number(Y), G = s(K);
1688
+ if (tt += G, !Number.isFinite(G) || G <= 0)
1581
1689
  break;
1582
1690
  }
1583
- b = d(N);
1584
- const $ = A(b);
1585
- U = $.height, Y = $.end;
1691
+ x = p(Y);
1692
+ const C = A(x);
1693
+ U = C.height, q = C.end;
1586
1694
  }
1587
- const Z = d(b), ft = d(Y), nt = d(Z - BigInt(Math.max(0, e))), tt = d(ft + BigInt(Math.max(0, e)));
1695
+ const Q = p(x), bt = p(q), lt = p(Q - BigInt(Math.max(0, e))), it = p(bt + BigInt(Math.max(0, e)));
1588
1696
  return {
1589
- renderingStartIndex: st(Number(nt), n),
1590
- renderingEndIndex: st(Number(tt), n),
1591
- visibleStartIndex: st(Number(Z), n),
1592
- visibleEndIndex: st(Number(ft), n)
1697
+ renderingStartIndex: nt(Number(lt), r),
1698
+ renderingEndIndex: nt(Number(it), r),
1699
+ visibleStartIndex: nt(Number(Q), r),
1700
+ visibleEndIndex: nt(Number(bt), r)
1593
1701
  };
1594
- }, pr = (o, t, e, n, s, c, u) => {
1595
- if (n === 0)
1702
+ }, hr = (n, t, e, r, s, l, c) => {
1703
+ if (r === 0)
1596
1704
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
1597
- const h = Number.isFinite(u), l = h ? Math.min(Math.max(0, o), u) : Math.max(0, o);
1598
- if (n >= Number.MAX_SAFE_INTEGER)
1599
- return mr(l, t, e, n, s, c, u, h);
1600
- const { index: d, cumulative: f, currentValue: m } = c.findIndexAtOrAfter(l, { materializeOption: { materialize: !1 } }), R = d === -1 ? t <= 0 || (f ?? 0) < l + (m ?? 0) ? n - 1 : 0 : d;
1601
- let b = st(R, n), A = 0;
1602
- if (d !== -1 && f === l)
1603
- b = st(d + 1, n), A = 0;
1604
- else if (b === d && f !== void 0 && m !== void 0)
1605
- A = f - m - l;
1705
+ const d = Number.isFinite(c), f = d ? Math.min(Math.max(0, n), c) : Math.max(0, n);
1706
+ if (r >= Number.MAX_SAFE_INTEGER)
1707
+ return pr(f, t, e, r, s, l, c, d);
1708
+ const { index: p, cumulative: m, currentValue: g } = l.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), E = p === -1 ? t <= 0 || (m ?? 0) < f + (g ?? 0) ? r - 1 : 0 : p;
1709
+ let x = nt(E, r), A = 0;
1710
+ if (p !== -1 && m === f)
1711
+ x = nt(p + 1, r), A = 0;
1712
+ else if (x === p && m !== void 0 && g !== void 0)
1713
+ A = m - g - f;
1606
1714
  else {
1607
- const { cumulative: tt, currentValue: N } = c.prefixSum(b, { materializeOption: { materialize: !1 } });
1608
- A = (tt ?? 0) - (N ?? 0) - l;
1715
+ const { cumulative: it, currentValue: Y } = l.prefixSum(x, { materializeOption: { materialize: !1 } });
1716
+ A = (it ?? 0) - (Y ?? 0) - f;
1609
1717
  }
1610
1718
  const U = A;
1611
- let Y = b;
1612
- for (; Y < n && A < t; )
1613
- A += s(Y), Y++;
1614
- if (A < t && b > 0) {
1615
- let tt = A + Math.abs(Math.min(0, U)), N = b - 1;
1616
- for (; N >= 0 && tt < t; )
1617
- tt += s(N), N--;
1618
- for (b = st(N + 1, n), A = 0, Y = b; Y < n && A < t; )
1619
- A += s(Y), Y++;
1719
+ let q = x;
1720
+ for (; q < r && A < t; )
1721
+ A += s(q), q++;
1722
+ if (A < t && x > 0) {
1723
+ let it = A + Math.abs(Math.min(0, U)), Y = x - 1;
1724
+ for (; Y >= 0 && it < t; )
1725
+ it += s(Y), Y--;
1726
+ for (x = nt(Y + 1, r), A = 0, q = x; q < r && A < t; )
1727
+ A += s(q), q++;
1620
1728
  }
1621
- const Z = st(b - e, n), ft = st(Math.max(Y - 1, b), n), nt = st(ft + e, n);
1622
- return { renderingStartIndex: Z, renderingEndIndex: nt, visibleStartIndex: b, visibleEndIndex: ft };
1623
- }, hr = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), we = (o, t, e) => {
1624
- const n = Math.max(0, t ?? 0), s = S({
1625
- lastInvokeAt: 0,
1626
- rafId: null,
1627
- pendingPayload: null,
1628
- loopActive: !1,
1629
- normalizedThrottle: n
1630
- }), c = T(() => {
1631
- const l = s.current;
1632
- l.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(l.rafId), l.rafId = null, l.loopActive = !1;
1633
- }, []), u = T(
1634
- (l) => {
1635
- const d = s.current;
1636
- d.rafId = null;
1637
- const f = typeof l == "number" ? l : hr(), m = d.normalizedThrottle, R = d.pendingPayload, b = o.current;
1638
- if (R !== null && b) {
1639
- const A = f - d.lastInvokeAt;
1640
- (m === 0 || d.lastInvokeAt === 0 || A >= m) && (d.pendingPayload = null, d.lastInvokeAt = f, e(b, R));
1641
- }
1642
- if (d.pendingPayload !== null) {
1643
- typeof requestAnimationFrame == "function" ? d.rafId = requestAnimationFrame(u) : d.loopActive = !1;
1644
- return;
1645
- }
1646
- d.loopActive = !1;
1729
+ const Q = nt(x - e, r), bt = nt(Math.max(q - 1, x), r), lt = nt(bt + e, r);
1730
+ return { renderingStartIndex: Q, renderingEndIndex: lt, visibleStartIndex: x, visibleEndIndex: bt };
1731
+ }, Ne = (n, t, e) => {
1732
+ const r = Math.max(0, t ?? 0), s = S({ last: 0, id: null, arg: null }).current;
1733
+ return B(
1734
+ () => () => {
1735
+ s.id !== null && (cancelAnimationFrame(s.id), s.id = null);
1647
1736
  },
1648
- [o, e]
1649
- ), h = T(() => {
1650
- const l = s.current;
1651
- if (!l.loopActive) {
1652
- if (l.loopActive = !0, typeof requestAnimationFrame == "function") {
1653
- l.rafId = requestAnimationFrame(u);
1654
- return;
1655
- }
1656
- l.loopActive = !1;
1657
- }
1658
- }, [u]);
1659
- return X(() => () => {
1660
- c(), s.current.pendingPayload = null;
1661
- }, [c]), X(() => {
1662
- c();
1663
- const l = s.current;
1664
- l.lastInvokeAt = 0, l.pendingPayload = null, l.normalizedThrottle = n;
1665
- }, [n, c]), T(
1737
+ [s]
1738
+ ), T(
1666
1739
  (l) => {
1667
- const d = s.current;
1668
- d.pendingPayload = l, h();
1740
+ if (s.arg = l, s.id !== null) return;
1741
+ const c = (d) => {
1742
+ if (s.id = null, s.arg === null) return;
1743
+ const f = d - s.last;
1744
+ if (r === 0 || s.last === 0 || f >= r) {
1745
+ if (n.current)
1746
+ try {
1747
+ e(n.current, s.arg);
1748
+ } catch (p) {
1749
+ console.error("[useThrottledInvoker] Error invoking callback", p);
1750
+ }
1751
+ s.arg = null, s.last = d;
1752
+ }
1753
+ s.arg !== null && (s.id = requestAnimationFrame(c));
1754
+ };
1755
+ s.id = requestAnimationFrame(c);
1669
1756
  },
1670
- [h]
1757
+ [r, e, n, s]
1671
1758
  );
1672
- }, gr = ze.memo(({ index: o, top: t, height: e, item: n, children: s, clipItemHeight: c, enableKeyboardNavigation: u, onKeyDown: h, onFocus: l, registerItemRef: d }) => {
1673
- const f = T((A) => d(o, A), [o, d]), m = T((A) => h(A, o), [o, h]), R = T(() => l(o), [o, l]), b = T((A) => {
1759
+ }, gr = He.memo(({ index: n, top: t, height: e, item: r, children: s, clipItemHeight: l, enableKeyboardNavigation: c, onKeyDown: d, onFocus: f, registerItemRef: p }) => {
1760
+ const m = T((A) => p(n, A), [n, p]), g = T((A) => d(A, n), [n, d]), E = T(() => f(n), [n, f]), x = T((A) => {
1674
1761
  A.currentTarget.focus({ preventScroll: !0 });
1675
1762
  }, []);
1676
- return /* @__PURE__ */ B(
1763
+ return /* @__PURE__ */ $(
1677
1764
  "div",
1678
1765
  {
1679
- ref: f,
1680
- "data-index": o,
1766
+ ref: m,
1767
+ "data-index": n,
1681
1768
  "data-virtualscroll-item": "true",
1682
- className: "aqvs:item-container",
1769
+ className: "aqvs-item-container",
1683
1770
  style: {
1684
1771
  top: t,
1685
1772
  height: e,
1686
- overflow: c ? "hidden" : void 0
1773
+ overflow: l ? "hidden" : void 0
1687
1774
  },
1688
- tabIndex: u ? -1 : void 0,
1689
- onPointerDown: u ? b : void 0,
1690
- onKeyDownCapture: u ? m : void 0,
1691
- onFocusCapture: u ? R : void 0,
1692
- children: s(n, o)
1775
+ tabIndex: c ? -1 : void 0,
1776
+ onPointerDown: c ? x : void 0,
1777
+ onKeyDownCapture: c ? g : void 0,
1778
+ onFocusCapture: c ? E : void 0,
1779
+ children: s(r, n)
1693
1780
  }
1694
1781
  );
1695
- }), br = ({
1696
- itemCount: o,
1782
+ }), xr = ({
1783
+ itemCount: n,
1697
1784
  getItem: t,
1698
- getItemHeight: e,
1699
- viewportSize: n,
1700
- overscanCount: s = 15,
1785
+ getItemKey: e,
1786
+ getItemHeight: r,
1787
+ viewportSize: s,
1788
+ overscanCount: l = 15,
1701
1789
  className: c,
1702
- onScroll: u,
1703
- onRangeChange: h,
1704
- children: l,
1705
- background: d,
1706
- initialScrollIndex: f,
1707
- initialScrollOffset: m,
1708
- callbackThrottleMs: R = 5,
1709
- contentInsets: b,
1710
- onItemFocus: A,
1711
- scrollBarOptions: U,
1712
- behaviorOptions: Y
1713
- }, Z) => {
1714
- const { width: ft, enableThumbDrag: nt, enableTrackClick: tt, enableArrowButtons: N, enableScrollToTopBottomButtons: w, renderThumbOverlay: $, tapScrollCircleOptions: z } = U ?? {}, { enablePointerDrag: J, enableKeyboardNavigation: _ = !0, wheelSpeedMultiplier: mt, inertiaOptions: C, clipItemHeight: H = !1, resetOnGetItemHeightChange: K = !1 } = Y ?? {}, O = S(null), it = S(!1), v = yt(() => fr(b), [b]), vt = S({ size: o, valueOrFn: e, options: { sampleRange: { from: 0, to: 100 } } }), y = lr(vt.current.size, vt.current.valueOrFn, vt.current.options), [ct] = Vt(() => {
1715
- let i = v.top, p = 0;
1716
- if (typeof f == "number") {
1717
- const r = ht(f, 0, o - 1), a = ht(r - s * 2, 0, o - 1), x = ht(r + s * 2, 0, o - 1), V = f > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: a, to: x }] } } : void 0, { cumulative: k, total: E, currentValue: q } = y.prefixSum(f, V), G = Math.max(k - q, 0);
1718
- i = te(G, v.top), p = E ?? y.getTotal();
1719
- } else typeof m == "number" && (i = te(Math.max(m, 0), v.top)), p = y.getTotal();
1720
- return { position: i, total: p };
1721
- }), [F, bt] = Vt(ct.position), [at, At] = Vt(ct.total), [I, D] = Vt(ct.position), [M, et] = Vt(o), L = S(ct.position), Mt = S(v.top), xt = S(u ?? void 0), It = S(h ?? void 0), rt = S(/* @__PURE__ */ new Map()), lt = S(null), ut = S(null), [gt, Et] = Vt(null), [Xt, Pt] = Vt(!1), g = S(null), P = S(!1), ot = S(e);
1722
- X(() => {
1723
- xt.current = u ?? void 0, It.current = h ?? void 0;
1724
- }, [h, u]);
1725
- const W = T(
1790
+ onScroll: d,
1791
+ onRangeChange: f,
1792
+ children: p,
1793
+ background: m,
1794
+ initialScrollIndex: g,
1795
+ initialScrollOffset: E,
1796
+ callbackThrottleMs: x = 5,
1797
+ contentInsets: A,
1798
+ onItemFocus: U,
1799
+ scrollBarOptions: q,
1800
+ behaviorOptions: Q
1801
+ }, bt) => {
1802
+ const { width: lt, enableThumbDrag: it, enableTrackClick: Y, enableArrowButtons: tt, enableScrollToTopBottomButtons: C, renderThumbOverlay: K, tapScrollCircleOptions: G } = q ?? {}, { enablePointerDrag: It, enableKeyboardNavigation: L = !0, wheelSpeedMultiplier: D, inertiaOptions: Z, clipItemHeight: J = !1, resetOnGetItemHeightChange: W = !1 } = Q ?? {}, F = S(null), Tt = S({
1803
+ renderingStartIndex: 0,
1804
+ renderingEndIndex: 0,
1805
+ visibleStartIndex: 0,
1806
+ visibleEndIndex: 0,
1807
+ scrollPosition: 0,
1808
+ totalHeight: 0
1809
+ }), ct = S(null), vt = S(!1);
1810
+ B(() => {
1811
+ W && (ct.current = null);
1812
+ }, [W]);
1813
+ const v = Vt(() => De(A), [A]), Mt = Vt(
1814
+ // 目的: Fenwick Tree のオプション設定
1815
+ // 依存関係: resetOnGetItemHeightChange
1816
+ () => ({
1817
+ sampleRange: { from: 0, to: 100 },
1818
+ resetOnValueFnChange: W,
1819
+ materialize: !0
1820
+ }),
1821
+ [W]
1822
+ ), b = ur(n, r, Mt), [Pt] = Ht(() => {
1823
+ let i = v.top, a = 0;
1824
+ if (typeof g == "number") {
1825
+ const u = pt(g, 0, n - 1), y = pt(u - l * 2, 0, n - 1), w = pt(u + l * 2, 0, n - 1), V = g > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: y, to: w }] } } : void 0, { cumulative: z, total: X, currentValue: O } = b.prefixSum(g, V), H = Math.max(z - O, 0);
1826
+ i = oe(H, v.top), a = X ?? b.getTotal();
1827
+ } else typeof E == "number" && (i = oe(Math.max(E, 0), v.top)), a = b.getTotal();
1828
+ return { position: i, total: a };
1829
+ }), [yt, Lt] = Ht(Pt.position), [I, N] = Ht(Pt.total), k = S(Pt.position), et = S(v.top), ut = S(d ?? void 0), Dt = S(f ?? void 0), mt = S(/* @__PURE__ */ new Map()), st = S(null), ot = S(null), [Ct, Et] = Ht(null), [wt, At] = Ht(!1), Bt = S(null), ht = S(!1), h = S(0), M = S(!1), j = S(n);
1830
+ j.current !== n && (j.current = n, M.current = !0), B(() => {
1831
+ ut.current = d ?? void 0, Dt.current = f ?? void 0;
1832
+ }, [f, d]);
1833
+ const at = T(
1726
1834
  (i) => {
1727
- if (_ && i && typeof i.focus == "function")
1835
+ if (L && i && typeof i.focus == "function")
1728
1836
  try {
1729
1837
  i.focus({ preventScroll: !0 });
1730
1838
  } catch {
1731
1839
  i.focus();
1732
1840
  }
1733
1841
  },
1734
- [_]
1735
- ), j = we(xt, R, (i, { position: p, totalHeight: r }) => {
1736
- i(p, r);
1737
- }), Dt = we(It, R, (i, { renderingStartIndex: p, renderingEndIndex: r, visibleStartIndex: a, visibleEndIndex: x, scrollPosition: V, totalHeight: k }) => {
1738
- i(p, r, a, x, V, k);
1739
- });
1740
- X(() => (it.current = !0, () => {
1741
- it.current = !1;
1742
- }), []), X(() => {
1743
- _ || (rt.current.clear(), lt.current = null, ut.current = null);
1744
- }, [_]);
1745
- const wt = T(
1746
- (i, p) => {
1747
- if (!p) {
1748
- rt.current.delete(i);
1842
+ [L]
1843
+ ), dt = T((i, { position: a, totalHeight: u }) => {
1844
+ i(a, u);
1845
+ }, []), Ot = Ne(ut, x, dt), ft = T((i, a) => {
1846
+ i(a);
1847
+ }, []), Yt = Ne(Dt, x, ft);
1848
+ B(() => (vt.current = !0, () => {
1849
+ vt.current = !1;
1850
+ }), []), B(() => {
1851
+ L || (mt.current.clear(), st.current = null, ot.current = null);
1852
+ }, [L]);
1853
+ const Zt = T(
1854
+ (i, a) => {
1855
+ if (!a) {
1856
+ mt.current.delete(i);
1749
1857
  return;
1750
1858
  }
1751
- _ && (rt.current.set(i, p), lt.current === i && (lt.current = null, ut.current = i, W(p)));
1859
+ L && (mt.current.set(i, a), st.current === i && (st.current = null, ot.current = i, at(a)));
1752
1860
  },
1753
- [_, W]
1754
- ), pt = 0.01, Ct = S({
1861
+ [L, at]
1862
+ ), Nt = 0.01, Xt = S({
1755
1863
  rafId: null,
1756
1864
  loopActive: !1,
1757
1865
  idleFrames: 0,
1758
- lastRenderedPosition: ct.position
1759
- }), Ht = T(() => {
1760
- const i = Ct.current;
1866
+ lastRenderedPosition: Pt.position
1867
+ }), St = T(() => {
1868
+ const i = Xt.current;
1761
1869
  i.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(i.rafId), i.rafId = null, i.loopActive = !1, i.idleFrames = 0;
1762
1870
  }, []);
1763
- X(
1871
+ B(
1764
1872
  () => () => {
1765
- Ht();
1873
+ St();
1766
1874
  },
1767
- [Ht]
1875
+ [St]
1768
1876
  );
1769
- const Nt = T(() => {
1770
- const i = Ct.current;
1877
+ const Rt = T(() => {
1878
+ const i = Xt.current;
1771
1879
  i.rafId = null;
1772
- const p = L.current, r = qt(p, v.top), a = y.getTotal();
1773
- if (bt((V) => Math.abs(V - p) < pt ? V : p), j({ position: r, totalHeight: a }), Math.abs(i.lastRenderedPosition - p) >= pt ? (i.lastRenderedPosition = p, i.idleFrames = 0) : i.idleFrames += 1, i.idleFrames >= 2) {
1774
- Ht();
1880
+ const a = k.current, u = Gt(a, v.top), y = b.getTotal();
1881
+ if (Lt((V) => Math.abs(V - a) < Nt ? V : a), Ot({ position: u, totalHeight: y }), Math.abs(i.lastRenderedPosition - a) >= Nt ? (i.lastRenderedPosition = a, i.idleFrames = 0) : i.idleFrames += 1, i.idleFrames >= 2) {
1882
+ St();
1775
1883
  return;
1776
1884
  }
1777
1885
  if (typeof requestAnimationFrame == "function") {
1778
- i.rafId = requestAnimationFrame(Nt);
1886
+ i.rafId = requestAnimationFrame(Rt);
1779
1887
  return;
1780
1888
  }
1781
1889
  i.loopActive = !1;
1782
- }, [y, v.top, j, Ht]), $t = T(() => {
1783
- const i = Ct.current;
1890
+ }, [b, v.top, Ot, St]), Qt = T(() => {
1891
+ const i = Xt.current;
1784
1892
  if (i.idleFrames = 0, !i.loopActive) {
1785
1893
  if (i.loopActive = !0, typeof requestAnimationFrame == "function") {
1786
- i.rafId = requestAnimationFrame(Nt);
1894
+ i.rafId = requestAnimationFrame(Rt);
1787
1895
  return;
1788
1896
  }
1789
1897
  i.loopActive = !1;
1790
1898
  }
1791
- }, [Nt]), Q = T(
1792
- (i, p) => {
1793
- const r = p?.immediate ?? !1, a = qt(i, v.top);
1794
- if (L.current = i, r) {
1795
- Ct.current.lastRenderedPosition = i, Ct.current.idleFrames = 0, bt(i), j({ position: a, totalHeight: y.getTotal() });
1899
+ }, [Rt]), rt = T(
1900
+ (i, a) => {
1901
+ const u = a?.immediate ?? !1, y = Gt(i, v.top);
1902
+ if (k.current = i, u) {
1903
+ Xt.current.lastRenderedPosition = i, Xt.current.idleFrames = 0, Lt(i), Ot({ position: y, totalHeight: b.getTotal() });
1796
1904
  return;
1797
1905
  }
1798
- $t();
1906
+ Qt();
1799
1907
  },
1800
- [$t, y, v.top, j]
1801
- ), St = S(!1);
1802
- X(() => {
1803
- if (!St.current)
1804
- if (St.current = !0, typeof m == "number") {
1805
- const i = te(Math.max(m, 0), v.top), p = Math.abs(i - L.current) > 0.5;
1806
- Q(i, { immediate: !0 }), p && D(i);
1908
+ [Qt, b, v.top, Ot]
1909
+ ), fe = S(!1);
1910
+ B(() => {
1911
+ if (!fe.current)
1912
+ if (fe.current = !0, typeof E == "number") {
1913
+ const i = oe(Math.max(E, 0), v.top), a = Math.abs(i - k.current) > 0.5;
1914
+ rt(i, { immediate: !0 }), a && F.current?.scrollTo(i);
1807
1915
  } else
1808
- Q(L.current, { immediate: !0 });
1809
- }, [m, v.top, Q]), ee(() => {
1810
- ot.current !== e ? (y.setValueFn(e, { reset: K }), ot.current = e) : y.setValueFn(e, { reset: !1 }), M !== o && (y.changeSize(o), et(o));
1811
- const p = y.getTotal();
1812
- at !== p && At(p);
1813
- }, [y, M, o, at, e, K]), ee(() => {
1814
- I !== null && O.current && (dt.debug("[VirtualScroll] Scrolling to position:", I), O.current.scrollTo(I), D(null));
1815
- }, [I]), X(() => {
1816
- const i = Mt.current;
1817
- if (i === v.top)
1818
- return;
1819
- const p = qt(L.current, i), r = te(p, v.top);
1820
- Mt.current = v.top, L.current = r, D(r), Q(r, { immediate: !0 });
1821
- }, [v.top, Q]);
1822
- const Tt = T(
1823
- (i, p) => {
1824
- if (!O.current)
1916
+ rt(k.current, { immediate: !0 });
1917
+ }, [E, v.top, rt]), B(() => {
1918
+ const i = b.getTotal();
1919
+ I !== i && N(i);
1920
+ }, [b, I, n]), B(() => {
1921
+ if (ct.current !== null) {
1922
+ const { index: i, align: a, offset: u } = ct.current, y = nt(i, n), { cumulative: w, currentValue: V } = b.prefixSum(y, { materializeOption: { materialize: !1 } });
1923
+ if (w !== void 0 && V !== void 0) {
1924
+ const z = Math.max(w - V, 0);
1925
+ let X = z;
1926
+ a === "bottom" ? X = w - s : a === "center" && (X = z + V / 2 - s / 2), u && (X -= u), X = Math.max(0, X);
1927
+ const O = Math.max(0, I + v.top + v.bottom - s), H = Math.min(oe(X, v.top), O);
1928
+ Math.abs(H - k.current) > 1 && (_.debug("[VirtualScroll] Drift correction", {
1929
+ from: k.current,
1930
+ to: H,
1931
+ targetIndex: y
1932
+ }), h.current === 0 && (h.current += 1), F.current?.scrollTo(H), rt(H, { immediate: !0 }));
1933
+ }
1934
+ }
1935
+ M.current = !1;
1936
+ }, [I, b, n, v.top, rt, s, v.bottom]), B(() => {
1937
+ const i = et.current;
1938
+ if (i === v.top) return;
1939
+ const a = Gt(k.current, i), u = oe(a, v.top);
1940
+ et.current = v.top, k.current = u, F.current?.scrollTo(u), rt(u, { immediate: !0 });
1941
+ }, [v.top, rt]);
1942
+ const le = T(
1943
+ (i, a) => {
1944
+ const u = nt(i, n), y = b.get(u), w = a - y, V = b.update(u, a);
1945
+ V !== void 0 && N(V), _.debug("[VirtualScroll] Updated item size manually", { index: u, size: a, total: V });
1946
+ let z = ct.current ? ct.current.index : null;
1947
+ if (z === null) {
1948
+ const X = k.current, O = De(A).top, H = Gt(X, O), { index: gt } = b.findIndexAtOrAfter(H, { materializeOption: { materialize: !1 } });
1949
+ z = gt;
1950
+ }
1951
+ if (z !== -1 && u < z && w !== 0) {
1952
+ const X = k.current, O = X + w;
1953
+ h.current += 1, rt(O, { immediate: !0 }), F.current?.scrollTo(O), _.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: X, to: O, causedByIndex: u, delta: w, activeVisibleStartIndex: z });
1954
+ }
1955
+ },
1956
+ [b, n, rt, A]
1957
+ ), kt = T(
1958
+ (i, a) => {
1959
+ if (!F.current)
1825
1960
  return;
1826
- const r = st(i, M), a = st(r - s * 2, M), x = st(r + s * 2, M), { cumulative: V, total: k, currentValue: E } = y.prefixSum(r, { materializeOption: { materialize: !0, ranges: [{ from: a, to: x }] } });
1827
- if (dt.debug("[VirtualScroll] Scrolling to index:", r, "ItemBottom:", V, "Total height:", k, "ItemHeight:", E, "safeIndexFrom:", a, "safeIndexTo:", x), !k)
1961
+ const u = nt(i, n), y = nt(u - l * 2, n), w = nt(u + l * 2, n), { cumulative: V, total: z, currentValue: X } = b.prefixSum(u, { materializeOption: { materialize: !0, ranges: [{ from: y, to: w }] } });
1962
+ if (_.debug("[VirtualScroll] Scrolling to index:", u, "ItemBottom:", V, "Total height:", z, "ItemHeight:", X, "safeIndexFrom:", y, "safeIndexTo:", w), !z)
1828
1963
  return;
1829
- const q = Math.max(V - E, 0);
1830
- let G = q;
1831
- p?.align === "bottom" ? G = V - n : p?.align === "center" && (G = q + E / 2 - n / 2), p?.offset && (G -= p.offset), G = Math.max(0, G);
1832
- const zt = te(G, v.top);
1833
- At(k), D(zt), dt.debug("[VirtualScroll] Setting scroll position to:", zt);
1964
+ const O = Math.max(V - X, 0);
1965
+ let H = O;
1966
+ a?.align === "bottom" ? H = V - s : a?.align === "center" && (H = O + X / 2 - s / 2), a?.offset && (H -= a.offset), H = Math.max(0, H);
1967
+ const gt = oe(H, v.top), xt = F.current?.getContentSize() ?? z + v.top + v.bottom, Ft = Math.max(0, xt - s), Jt = Math.min(gt, Ft);
1968
+ ct.current = {
1969
+ index: u,
1970
+ align: a?.align,
1971
+ offset: a?.offset
1972
+ };
1973
+ const ce = F.current?.getScrollPosition() ?? -1, ue = Math.abs(ce - Jt) > 0.5;
1974
+ ht.current = !1, h.current = 0, ue && (ht.current = !0, h.current += 1, F.current?.scrollTo(Jt)), N(z), rt(Jt, { immediate: !0 }), _.debug("[VirtualScroll] Setting scroll position to:", Jt, { original: gt, max: Ft });
1834
1975
  },
1835
- [y, s, M, v.top, n]
1836
- ), jt = T(
1976
+ [b, l, n, v.top, v.bottom, s, rt]
1977
+ ), ne = T(
1837
1978
  (i) => {
1838
- if (!O.current)
1979
+ if (!F.current)
1839
1980
  return;
1840
- const p = y.getTotal(), r = ht(Math.floor(i), 0, p), a = y.findIndexAtOrAfter(r, { materializeOption: { materialize: !1 } }).index;
1841
- Tt(a);
1981
+ const a = b.getTotal(), u = pt(Math.floor(i), 0, a), { index: y, cumulative: w, currentValue: V } = b.findIndexAtOrAfter(u, { materializeOption: { materialize: !1 } }), X = (w ?? 0) - (V ?? 0) - u;
1982
+ kt(y, { offset: X });
1842
1983
  },
1843
- [y, Tt]
1844
- ), re = T(
1984
+ [b, kt]
1985
+ ), te = T(
1845
1986
  (i) => {
1846
- const p = qt(L.current, v.top), r = typeof i == "function" ? i(p) : i;
1847
- jt(r);
1848
- const a = O.current?.getScrollPosition(), x = typeof a == "number" ? a : L.current;
1849
- return Q(x), x;
1987
+ const a = Gt(k.current, v.top), u = typeof i == "function" ? i(a) : i;
1988
+ ne(u);
1989
+ const y = F.current?.getScrollPosition(), w = typeof y == "number" ? y : k.current;
1990
+ return rt(w), w;
1850
1991
  },
1851
- [v.top, jt, Q]
1852
- ), Gt = T(
1853
- (i, p) => {
1854
- if (dt.debug("[VirtualScroll] Scroll position changed:", i), Q(i), w) {
1855
- if (P.current) {
1856
- P.current = !1;
1992
+ [v.top, ne, rt]
1993
+ ), be = T(
1994
+ (i, a) => {
1995
+ _.debug("[VirtualScroll] Scroll position changed:", i);
1996
+ const u = ht.current;
1997
+ u && (ht.current = !1);
1998
+ const y = h.current > 0;
1999
+ if (y && (h.current = 0), u || y || M.current || (ct.current = null), rt(i), C) {
2000
+ if (u || y)
1857
2001
  return;
1858
- }
1859
- const r = i - p;
1860
- if (dt.debug("[VirtualScroll] Scroll diff:", r, "New:", i, "Prev:", p), Math.abs(r) > 1) {
1861
- const a = r > 0 ? "down" : "up";
1862
- Et(a), Pt(!0), dt.debug("[VirtualScroll] Showing scroll buttons. Direction:", a), g.current && clearTimeout(g.current), g.current = setTimeout(() => {
1863
- Pt(!1), dt.debug("[VirtualScroll] Hiding scroll buttons");
2002
+ const w = i - a;
2003
+ if (_.debug("[VirtualScroll] Scroll diff:", w, "New:", i, "Prev:", a), Math.abs(w) > 1) {
2004
+ const V = w > 0 ? "down" : "up";
2005
+ Et(V), At(!0), _.debug("[VirtualScroll] Showing scroll buttons. Direction:", V), Bt.current && clearTimeout(Bt.current), Bt.current = setTimeout(() => {
2006
+ At(!1), _.debug("[VirtualScroll] Hiding scroll buttons");
1864
2007
  }, 2e3);
1865
2008
  }
1866
2009
  }
1867
2010
  },
1868
- [Q, w]
1869
- ), Bt = yt(() => qt(F, v.top), [v.top, F]), ne = yt(() => {
1870
- const i = pr(Bt, n, s, M, e, y, at);
1871
- return dt.debug("[VirtualScroll] Calculated rendering range:", {
1872
- ...i,
1873
- scrollPosition: Bt,
1874
- renderingContentSize: y.getTotal(),
1875
- overscanCount: s,
1876
- viewportSize: n
1877
- }), i;
1878
- }, [Bt, n, s, M, e, y, at]), { renderingStartIndex: Rt, renderingEndIndex: Ft, visibleStartIndex: Lt, visibleEndIndex: Ot } = ne, Yt = T(
1879
- (i, p) => {
1880
- if (!_ || M === 0)
2011
+ [rt, C]
2012
+ ), Ut = Vt(() => Gt(yt, v.top), [v.top, yt]), zt = Vt(() => {
2013
+ const i = b.getTotal(), a = hr(Ut, s, l, n, r, b, i);
2014
+ return _.debug("[VirtualScroll] Calculated rendering range:", {
2015
+ ...a,
2016
+ scrollPosition: Ut,
2017
+ renderingContentSize: i,
2018
+ overscanCount: l,
2019
+ viewportSize: s
2020
+ }), a;
2021
+ }, [Ut, s, l, n, r, b]), { renderingStartIndex: $t, renderingEndIndex: Kt, visibleStartIndex: _t, visibleEndIndex: Wt } = zt, jt = T(
2022
+ (i, a) => {
2023
+ if (!L || n === 0)
1881
2024
  return;
1882
- const r = st(i, M);
1883
- if (!(p?.ensureVisible ?? !0)) {
1884
- const Kt = rt.current.get(r);
1885
- Kt && (lt.current = null, ut.current = r, W(Kt));
2025
+ const u = nt(i, n);
2026
+ if (!(a?.ensureVisible ?? !0)) {
2027
+ const Ft = mt.current.get(u);
2028
+ Ft && (st.current = null, ot.current = u, at(Ft));
1886
2029
  return;
1887
2030
  }
1888
- const x = y.prefixSum(r, { materializeOption: { materialize: !1 } }), V = x.currentValue, k = Math.max(x.cumulative - V, 0), E = k + V, q = qt(L.current, v.top), G = q + n;
1889
- if (k < q || E > G) {
1890
- lt.current = r, Tt(r);
2031
+ const w = b.prefixSum(u, { materializeOption: { materialize: !1 } }), V = w.currentValue, z = Math.max(w.cumulative - V, 0), X = z + V, O = Gt(k.current, v.top), H = O + s;
2032
+ if (z < O || X > H) {
2033
+ st.current = u, kt(u);
1891
2034
  return;
1892
2035
  }
1893
- const _t = rt.current.get(r);
1894
- if (_t) {
1895
- lt.current = null, ut.current = r, W(_t);
2036
+ const xt = mt.current.get(u);
2037
+ if (xt) {
2038
+ st.current = null, ot.current = u, at(xt);
1896
2039
  return;
1897
2040
  }
1898
- lt.current = r;
2041
+ st.current = u;
1899
2042
  },
1900
- [_, M, y, v.top, Tt, W, n]
1901
- ), oe = T(
1902
- (i, p) => {
1903
- if (!_ || i.defaultPrevented || i.altKey || i.metaKey || i.ctrlKey)
2043
+ [L, n, b, v.top, kt, at, s]
2044
+ ), me = T(
2045
+ (i, a) => {
2046
+ if (!L || i.defaultPrevented || i.altKey || i.metaKey || i.ctrlKey)
1904
2047
  return;
1905
- const r = i.target;
1906
- if (r) {
1907
- const a = r.tagName;
1908
- if (a === "INPUT" || a === "TEXTAREA" || a === "SELECT" || r.isContentEditable)
2048
+ const u = i.target;
2049
+ if (u) {
2050
+ const y = u.tagName;
2051
+ if (y === "INPUT" || y === "TEXTAREA" || y === "SELECT" || u.isContentEditable)
1909
2052
  return;
1910
2053
  }
1911
2054
  if (i.key === "ArrowDown") {
1912
- p < M - 1 && (i.preventDefault(), Yt(p + 1));
2055
+ a < n - 1 && (i.preventDefault(), jt(a + 1));
1913
2056
  return;
1914
2057
  }
1915
2058
  if (i.key === "ArrowUp") {
1916
- p > 0 && (i.preventDefault(), Yt(p - 1));
2059
+ a > 0 && (i.preventDefault(), jt(a - 1));
1917
2060
  return;
1918
2061
  }
1919
2062
  if (i.key === "PageDown") {
1920
- if (p < M - 1) {
2063
+ if (a < n - 1) {
1921
2064
  i.preventDefault();
1922
- const a = Math.max(Ot - Lt + 1, 1), x = Math.max(a, 1), V = st(Math.min(p + x, M - 1), M);
1923
- Yt(V);
2065
+ const y = Math.max(Wt - _t + 1, 1), w = Math.max(y, 1), V = nt(Math.min(a + w, n - 1), n);
2066
+ jt(V);
1924
2067
  }
1925
2068
  return;
1926
2069
  }
1927
- if (i.key === "PageUp" && p > 0) {
2070
+ if (i.key === "PageUp" && a > 0) {
1928
2071
  i.preventDefault();
1929
- const a = Math.max(Ot - Lt + 1, 1), x = Math.max(a, 1), V = st(p - x, M);
1930
- Yt(V);
2072
+ const y = Math.max(Wt - _t + 1, 1), w = Math.max(y, 1), V = nt(a - w, n);
2073
+ jt(V);
1931
2074
  }
1932
2075
  },
1933
- [_, M, Yt, Ot, Lt]
1934
- ), se = T(
2076
+ [L, n, jt, Wt, _t]
2077
+ ), pe = T(
1935
2078
  (i) => {
1936
- if (!_)
2079
+ if (!L)
1937
2080
  return;
1938
- const p = st(i, M);
1939
- lt.current = null, ut.current = p, A?.(p);
2081
+ const a = nt(i, n);
2082
+ st.current = null, ot.current = a, U?.(a);
1940
2083
  },
1941
- [_, M, A]
2084
+ [L, n, U]
1942
2085
  );
1943
- X(() => {
1944
- const i = O.current?.getScrollPosition() ?? 0, p = L.current, r = qt(p, v.top);
1945
- dt.debug("[VirtualScroll] Range change effect triggered", {
1946
- renderingStartIndex: Rt,
1947
- renderingEndIndex: Ft,
1948
- visibleStartIndex: Lt,
1949
- visibleEndIndex: Ot,
1950
- scrollPositionState: F,
1951
- paneScrollPosition: p,
1952
- logicalScrollPosition: r,
1953
- contentSize: at,
2086
+ B(() => {
2087
+ const i = F.current?.getScrollPosition() ?? 0, a = k.current, u = Gt(a, v.top);
2088
+ _.debug("[VirtualScroll] Range change effect triggered", {
2089
+ renderingStartIndex: $t,
2090
+ renderingEndIndex: Kt,
2091
+ visibleStartIndex: _t,
2092
+ visibleEndIndex: Wt,
2093
+ scrollPositionState: yt,
2094
+ paneScrollPosition: a,
2095
+ logicalScrollPosition: u,
2096
+ contentSize: I,
1954
2097
  scrollPaneScrollPosition: i
1955
- }), Dt({
1956
- renderingStartIndex: Rt,
1957
- renderingEndIndex: Ft,
1958
- visibleStartIndex: Lt,
1959
- visibleEndIndex: Ot,
1960
- scrollPosition: r,
1961
- totalHeight: at
2098
+ }), Yt({
2099
+ renderingStartIndex: $t,
2100
+ renderingEndIndex: Kt,
2101
+ visibleStartIndex: _t,
2102
+ visibleEndIndex: Wt,
2103
+ scrollPosition: u,
2104
+ totalHeight: I
1962
2105
  });
1963
- }, [at, Ft, Rt, v.top, Dt, F, Ot, Lt]);
1964
- const ue = T(() => w ? /* @__PURE__ */ B("div", { className: "aqvs:scroll-to-edge-overlay", "data-visible": Xt && gt !== null, children: gt === "up" ? /* @__PURE__ */ B("div", { className: "aqvs:scroll-to-edge-button-container aqvs:scroll-to-edge-button-container-top", children: /* @__PURE__ */ B(
2106
+ }, [I, Kt, $t, v.top, Yt, yt, Wt, _t]);
2107
+ const ve = T(() => C ? /* @__PURE__ */ $("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": wt && Ct !== null, children: Ct === "up" ? /* @__PURE__ */ $("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ $(
1965
2108
  "button",
1966
2109
  {
1967
2110
  type: "button",
1968
- className: "aqvs:scroll-to-edge-button",
1969
- onClick: (r) => {
1970
- r.stopPropagation(), P.current = !0, Tt(0), Pt(!1);
2111
+ className: "aqvs-scroll-to-edge-button",
2112
+ onClick: (u) => {
2113
+ u.stopPropagation(), ht.current = !0, kt(0), At(!1);
1971
2114
  },
1972
2115
  children: "Top"
1973
2116
  }
1974
- ) }) : /* @__PURE__ */ B("div", { className: "aqvs:scroll-to-edge-button-container aqvs:scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ B(
2117
+ ) }) : /* @__PURE__ */ $("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ $(
1975
2118
  "button",
1976
2119
  {
1977
2120
  type: "button",
1978
- className: "aqvs:scroll-to-edge-button",
1979
- onClick: (r) => {
1980
- r.stopPropagation(), P.current = !0, Tt(o - 1), Pt(!1);
2121
+ className: "aqvs-scroll-to-edge-button",
2122
+ onClick: (u) => {
2123
+ u.stopPropagation(), ht.current = !0, kt(n - 1), At(!1);
1981
2124
  },
1982
2125
  children: "Bottom"
1983
2126
  }
1984
- ) }) }) : null, [w, Xt, gt, Tt, o]), { visibleItems: Zt, startPosition: Jt } = yt(() => {
1985
- if (M === 0)
2127
+ ) }) }) : null, [C, wt, Ct, kt, n]), { visibleItems: ie, startPosition: se } = Vt(() => {
2128
+ if (n === 0)
1986
2129
  return {
1987
- visibleItems: /* @__PURE__ */ B("div", { className: "aqvs:no-items-container", children: /* @__PURE__ */ B("div", { className: "aqvs:no-items-text", children: "No items" }) }),
2130
+ visibleItems: /* @__PURE__ */ $("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ $("div", { className: "aqvs-no-items-text", children: "No items" }) }),
1988
2131
  startPosition: 0
1989
2132
  };
1990
- const i = st(Rt, M), p = st(Ft, M), { cumulative: r, currentValue: a } = y.prefixSum(i, { materializeOption: { materialize: !1 } }), x = r - a, V = [], k = [];
1991
- for (let E = i; E <= p; E++) {
1992
- const q = e(E);
1993
- y.get(E) !== q && V.push({ index: E, value: q });
1994
- const { cumulative: zt, currentValue: _t } = y.prefixSum(E, { materializeOption: { materialize: !1 } }), Kt = zt - _t;
1995
- k.push(
1996
- /* @__PURE__ */ B(
2133
+ const i = nt($t, n), a = nt(Kt, n), { cumulative: u, currentValue: y } = b.prefixSum(i, { materializeOption: { materialize: !1 } }), w = u - y, V = [], z = [];
2134
+ let X = 0;
2135
+ for (let O = i; O <= a; O++) {
2136
+ const H = r(O), gt = b.get(O), xt = H - gt;
2137
+ xt !== 0 && V.push({ index: O, value: H });
2138
+ const { cumulative: Ft, currentValue: Jt } = b.prefixSum(O, { materializeOption: { materialize: !1 } }), ce = Ft - Jt + X, ue = e ? e(O) : O;
2139
+ z.push(
2140
+ /* @__PURE__ */ $(
1997
2141
  gr,
1998
2142
  {
1999
- index: E,
2000
- top: Kt - x + v.top,
2001
- height: q,
2002
- item: t(E),
2003
- children: l,
2004
- clipItemHeight: H,
2005
- enableKeyboardNavigation: _,
2006
- onKeyDown: oe,
2007
- onFocus: se,
2008
- registerItemRef: wt
2143
+ index: O,
2144
+ top: ce - w + v.top,
2145
+ height: H,
2146
+ item: t(O),
2147
+ clipItemHeight: J,
2148
+ enableKeyboardNavigation: L,
2149
+ onKeyDown: me,
2150
+ onFocus: pe,
2151
+ registerItemRef: Zt,
2152
+ children: p
2009
2153
  },
2010
- E
2154
+ ue
2011
2155
  )
2012
- );
2156
+ ), X += xt;
2013
2157
  }
2014
2158
  return V.length > 0 && Promise.resolve().then(() => {
2015
- if (!it.current)
2159
+ if (!vt.current)
2016
2160
  return;
2017
- const E = y.updates(V);
2018
- if (!it.current || typeof E != "number")
2161
+ let O = 0;
2162
+ for (const xt of V)
2163
+ if (xt.index < _t) {
2164
+ const Ft = b.get(xt.index);
2165
+ O += xt.value - Ft;
2166
+ }
2167
+ const H = b.updates(V);
2168
+ if (!vt.current || typeof H != "number")
2019
2169
  return;
2020
- At(E), dt.debug("[VirtualScroll] Updated heights for items", V, "New total height:", E);
2021
- const q = O.current?.getScrollPosition() ?? L.current;
2022
- q === L.current || !it.current || Q(q);
2023
- }), { visibleItems: k, startPosition: x };
2024
- }, [l, H, _, M, y, t, e, se, oe, wt, Ft, Rt, v.top, Q]), de = T(
2170
+ N(H), _.debug("[VirtualScroll] Updated heights for items", V, "New total height:", H);
2171
+ const gt = F.current?.getScrollPosition() ?? k.current;
2172
+ if (O !== 0) {
2173
+ const xt = gt + O;
2174
+ h.current += 1, rt(xt, { immediate: !0 }), F.current?.scrollTo(xt), _.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: gt, to: xt, shiftAmount: O });
2175
+ } else gt !== k.current && rt(gt);
2176
+ }), { visibleItems: z, startPosition: w };
2177
+ }, [
2178
+ p,
2179
+ J,
2180
+ L,
2181
+ n,
2182
+ b,
2183
+ t,
2184
+ e,
2185
+ r,
2186
+ pe,
2187
+ me,
2188
+ Zt,
2189
+ Kt,
2190
+ $t,
2191
+ v.top,
2192
+ rt,
2193
+ _t
2194
+ ]), o = T(
2025
2195
  (i) => {
2026
- const p = (R ?? 0) > 0, r = Math.abs(i - F), a = p && r > 0.5 ? F : i, x = qt(a, v.top);
2027
- if (dt.debug("[VirtualScroll] Rendering visible items", {
2196
+ const a = (x ?? 0) > 0, u = Math.abs(i - yt), y = a && u > 0.5 ? yt : i, w = Gt(y, v.top);
2197
+ if (_.debug("[VirtualScroll] Rendering visible items", {
2028
2198
  currentScrollPosition: i,
2029
- effectiveScrollPosition: x,
2030
- renderingStartIndex: Rt,
2031
- renderingEndIndex: Ft,
2032
- fenwickSize: M,
2033
- viewportSize: n,
2034
- callbackThrottleMs: R,
2035
- diff: r,
2036
- rawEffectiveScrollPosition: a
2037
- }), M === 0)
2038
- return Zt;
2039
- const V = Jt - x, k = v.bottom > 0 ? /* @__PURE__ */ B(
2199
+ effectiveScrollPosition: w,
2200
+ renderingStartIndex: $t,
2201
+ renderingEndIndex: Kt,
2202
+ itemCount: n,
2203
+ viewportSize: s,
2204
+ callbackThrottleMs: x,
2205
+ diff: u,
2206
+ rawEffectiveScrollPosition: y
2207
+ }), n === 0)
2208
+ return ie;
2209
+ const V = se - w, z = v.bottom > 0 ? /* @__PURE__ */ $(
2040
2210
  "div",
2041
2211
  {
2042
- className: "aqvs:bottom-inset",
2212
+ className: "aqvs-bottom-inset",
2043
2213
  style: {
2044
- top: y.getTotal() + v.top - Jt,
2214
+ top: b.getTotal() + v.top - se,
2045
2215
  height: v.bottom
2046
2216
  }
2047
2217
  },
2048
2218
  "virtualscroll-bottom-inset"
2049
2219
  ) : null;
2050
- return dt.debug("[VirtualScroll] Rendering items", {
2220
+ return _.debug("[VirtualScroll] Rendering items", {
2051
2221
  containerTop: V,
2052
- logicalScrollPosition: Bt,
2222
+ logicalScrollPosition: Ut,
2053
2223
  resolvedInsets: v,
2054
- effectiveScrollPosition: x
2055
- }), /* @__PURE__ */ Ut("div", { className: "aqvs:items-wrapper", style: { top: V }, children: [
2056
- Zt,
2057
- k
2224
+ effectiveScrollPosition: w
2225
+ }), /* @__PURE__ */ re("div", { className: "aqvs-items-wrapper", style: { top: V, position: "relative" }, children: [
2226
+ ie,
2227
+ z
2058
2228
  ] });
2059
2229
  },
2060
- [R, M, y, Bt, Ft, Rt, v, F, Jt, n, Zt]
2230
+ [x, n, b, Ut, Kt, $t, v, yt, se, s, ie]
2231
+ ), P = Vt(
2232
+ () => ({
2233
+ renderingStartIndex: zt.renderingStartIndex,
2234
+ renderingEndIndex: zt.renderingEndIndex,
2235
+ visibleStartIndex: zt.visibleStartIndex,
2236
+ visibleEndIndex: zt.visibleEndIndex,
2237
+ scrollPosition: Ut,
2238
+ totalHeight: b.getTotal()
2239
+ // contentSize (State) ではなく最新値を反映
2240
+ }),
2241
+ [zt, Ut, b]
2061
2242
  );
2062
- Ie(
2063
- Z,
2243
+ B(() => {
2244
+ Tt.current = P;
2245
+ }, [P]), ye(
2246
+ bt,
2064
2247
  () => ({
2065
- getScrollPosition: () => O.current?.getScrollPosition() ?? -1,
2066
- getContentSize: () => O.current?.getContentSize() ?? -1,
2067
- getViewportSize: () => O.current?.getViewportSize() ?? -1,
2068
- scrollTo: re,
2069
- scrollToIndex: Tt,
2070
- getFenwickTreeTotalHeight: () => y.getTotal(),
2071
- getFenwickSize: () => y.getSize(),
2072
- focusItemAtIndex: Yt
2248
+ getScrollPosition: () => F.current?.getScrollPosition() ?? -1,
2249
+ getContentSize: () => F.current?.getContentSize() ?? -1,
2250
+ getViewportSize: () => F.current?.getViewportSize() ?? -1,
2251
+ scrollTo: te,
2252
+ scrollToIndex: kt,
2253
+ getFenwickTreeTotalHeight: () => b.getTotal(),
2254
+ getFenwickSize: () => b.getSize(),
2255
+ focusItemAtIndex: jt,
2256
+ getRange: () => Tt.current,
2257
+ updateItemSize: le
2073
2258
  }),
2074
- [re, Tt, y, Yt]
2259
+ [te, kt, b, jt, le]
2075
2260
  );
2076
- const fe = at + v.top + v.bottom;
2077
- return /* @__PURE__ */ B(
2078
- sr,
2261
+ const R = b.getTotal() + v.top + v.bottom;
2262
+ return /* @__PURE__ */ $(
2263
+ ar,
2079
2264
  {
2080
- ref: O,
2081
- contentSize: fe,
2082
- viewportSize: n,
2265
+ ref: F,
2266
+ contentSize: R,
2267
+ viewportSize: s,
2083
2268
  className: c,
2084
- onScroll: Gt,
2085
- background: d,
2086
- tapScrollCircleOptions: z,
2087
- inertiaOptions: C,
2088
- itemCount: o,
2089
- scrollBarWidth: ft,
2090
- enableThumbDrag: nt,
2091
- enableTrackClick: tt,
2092
- enableArrowButtons: N,
2093
- enablePointerDrag: J,
2094
- renderThumbOverlay: $,
2095
- wheelSpeedMultiplier: mt,
2269
+ onScroll: be,
2270
+ background: m,
2271
+ tapScrollCircleOptions: G,
2272
+ inertiaOptions: Z,
2273
+ itemCount: n,
2274
+ scrollBarWidth: lt,
2275
+ enableThumbDrag: it,
2276
+ enableTrackClick: Y,
2277
+ enableArrowButtons: tt,
2278
+ enablePointerDrag: It,
2279
+ renderThumbOverlay: K,
2280
+ wheelSpeedMultiplier: D,
2096
2281
  contentInsets: v,
2097
- visibleStartIndex: Lt,
2098
- visibleEndIndex: Ot,
2099
- renderOverlay: ue,
2100
- children: de
2282
+ visibleStartIndex: _t,
2283
+ visibleEndIndex: Wt,
2284
+ renderOverlay: ve,
2285
+ initialScrollPosition: Pt.position,
2286
+ children: o
2101
2287
  }
2102
2288
  );
2103
- }, yr = xe(br);
2289
+ }, Sr = Me(xr);
2104
2290
  export {
2105
- ar as FenwickMapTree,
2291
+ cr as FenwickMapTree,
2106
2292
  or as ScrollBar,
2107
- sr as ScrollPane,
2108
- yr as VirtualScroll,
2109
- ht as minmax,
2110
- Pr as tapScrollCircleSampleVisual,
2111
- lr as useFenwickMapTree,
2112
- Sr as useHeightCache,
2113
- ur as useLruCache
2293
+ ar as ScrollPane,
2294
+ Sr as VirtualScroll,
2295
+ pt as minmax,
2296
+ Tr as tapScrollCircleSampleVisual,
2297
+ ur as useFenwickMapTree,
2298
+ Pr as useHeightCache,
2299
+ fr as useLruCache
2114
2300
  };