virtua 0.50.2 → 0.50.3

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/lib/index.js CHANGED
@@ -6,98 +6,98 @@ import { jsx as c } from "react/jsx-runtime";
6
6
 
7
7
  import { flushSync as f } from "react-dom";
8
8
 
9
- var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p = e => [ ...e ].sort((e, t) => e - t), v = "function" == typeof queueMicrotask ? queueMicrotask : e => {
9
+ var {min: u, max: a, abs: d, floor: h} = Math, g = (e, t, o) => u(o, a(t, e)), p = e => [ ...e ].sort((e, t) => e - t), v = setTimeout, S = "function" == typeof queueMicrotask ? queueMicrotask : e => {
10
10
  Promise.resolve().then(e);
11
11
  }, m = () => {
12
12
  let e;
13
13
  return [ new Promise(t => {
14
14
  e = t;
15
15
  }), e ];
16
- }, _ = e => {
16
+ }, w = e => {
17
17
  let t;
18
18
  return () => (e && (t = e(), e = void 0), t);
19
- }, w = (e, t, o) => {
19
+ }, _ = (e, t, o) => {
20
20
  const n = o ? "unshift" : "push";
21
21
  for (let o = 0; o < t; o++) e[n](-1);
22
22
  return e;
23
- }, S = (e, t) => {
23
+ }, $ = (e, t) => {
24
24
  const o = e.t[t];
25
25
  return -1 === o ? e.o : o;
26
- }, $ = (e, t, o) => {
26
+ }, z = (e, t, o) => {
27
27
  const n = -1 === e.t[t];
28
28
  return e.t[t] = o, e.i = u(t, e.i), n;
29
- }, z = (e, t) => {
29
+ }, b = (e, t) => {
30
30
  if (!e.l) return 0;
31
31
  if (e.i >= t) return e.u[t];
32
32
  e.i < 0 && (e.u[0] = 0, e.i = 0);
33
33
  let o = e.i, n = e.u[o];
34
- for (;o < t; ) n += S(e, o), e.u[++o] = n;
34
+ for (;o < t; ) n += $(e, o), e.u[++o] = n;
35
35
  return e.i = t, n;
36
- }, b = (e, t, o = 0, n = e.l - 1) => {
36
+ }, y = (e, t, o = 0, n = e.l - 1) => {
37
37
  let r = o;
38
38
  for (;o <= n; ) {
39
39
  const i = h((o + n) / 2);
40
- z(e, i) <= t ? (r = i, o = i + 1) : n = i - 1;
40
+ b(e, i) <= t ? (r = i, o = i + 1) : n = i - 1;
41
41
  }
42
42
  return g(r, 0, e.l - 1);
43
- }, y = (e, t, o) => {
43
+ }, x = (e, t, o) => {
44
44
  const n = t - e.l;
45
- return e.i = o ? -1 : u(t - 1, e.i), e.l = t, n > 0 ? (w(e.u, n), w(e.t, n, o),
45
+ return e.i = o ? -1 : u(t - 1, e.i), e.l = t, n > 0 ? (_(e.u, n), _(e.t, n, o),
46
46
  e.o * n) : (e.u.splice(n), (o ? e.t.splice(0, -n) : e.t.splice(n)).reduce((t, o) => t - (-1 === o ? e.o : o), 0));
47
- }, x = "undefined" != typeof window, I = e => e.documentElement, k = e => e.ownerDocument, R = e => e.defaultView, T = /*#__PURE__*/ _(() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0), C = /*#__PURE__*/ _(() => "scrollBehavior" in I(document).style), M = e => d(e.h(), e.p()), O = (e, t = 40, o = 0, n, r = !1) => {
48
- let i = !!o, s = 1, l = 0, c = 0, f = 0, h = 0, g = 0, v = 0, m = 0, _ = 0, x = null, I = [ 0, i ? d(o - 1, 0) : -1 ], k = 0, R = !1;
49
- const C = ((e, t, o) => ({
47
+ }, I = "undefined" != typeof window, k = e => e.documentElement, C = e => e.ownerDocument, R = e => e.defaultView, M = /*#__PURE__*/ w(() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0), O = /*#__PURE__*/ w(() => "scrollBehavior" in k(document).style), T = e => a(e.h(), e.p()), E = (e, t = 40, o = 0, n, r = !1) => {
48
+ let i = !!o, s = 1, l = 0, c = 0, f = 0, h = 0, g = 0, v = 0, S = 0, m = 0, w = null, I = [ 0, i ? a(o - 1, 0) : -1 ], k = 0, C = !1;
49
+ const R = ((e, t, o) => ({
50
50
  o: t,
51
- t: o ? w(o.slice(0, u(e, o.length)), d(0, e - o.length)) : w([], e),
51
+ t: o ? _(o.slice(0, u(e, o.length)), a(0, e - o.length)) : _([], e),
52
52
  l: e,
53
53
  i: -1,
54
- u: w([], e + 1)
55
- }))(e, n ? n[1] : t, n && n[0]), M = /* @__PURE__ */ new Set, O = () => f - c, E = () => O() + g + h, H = (e, t) => ((e, t, o, n) => {
56
- if (n = u(n, e.l - 1), z(e, n) <= t) {
57
- const r = b(e, o, n);
58
- return [ b(e, t, n, r), r ];
54
+ u: _([], e + 1)
55
+ }))(e, n && n[1] || t, n && n[0]), O = /* @__PURE__ */ new Set, T = () => f - c, E = () => T() + g + h, H = (e, t) => ((e, t, o, n) => {
56
+ if (n = u(n, e.l - 1), b(e, n) <= t) {
57
+ const r = y(e, o, n);
58
+ return [ y(e, t, n, r), r ];
59
59
  }
60
60
  {
61
- const r = b(e, t, void 0, n);
62
- return [ r, b(e, o, r) ];
61
+ const r = y(e, t, void 0, n);
62
+ return [ r, y(e, o, r) ];
63
63
  }
64
- })(C, e, t, I[0]), W = () => z(C, C.l), B = (e, t) => {
65
- const o = z(C, e) - g;
64
+ })(R, e, t, I[0]), W = () => b(R, R.l), B = (e, t) => {
65
+ const o = b(R, e) - g;
66
66
  return t ? W() - o - J(e) : o;
67
- }, J = e => S(C, e), A = (e, t = -1) => C.t[e] === t, L = e => {
68
- e && (T() && 0 !== m || x && 1 === _ ? g += e : h += e);
67
+ }, J = e => $(R, e), L = (e, t = -1) => R.t[e] === t, X = e => {
68
+ e && (M() && 0 !== S || w && 1 === m ? g += e : h += e);
69
69
  };
70
70
  return {
71
71
  v: () => {
72
- M.clear();
72
+ O.clear();
73
73
  },
74
- m: () => s,
75
- _: () => (e => [ e.t.slice(), e.o ])(C),
76
- S: (e = 200) => {
77
- if (!R || i) return I;
74
+ S: () => s,
75
+ m: () => (e => [ e.t.slice(), e.o ])(R),
76
+ _: (e = 200) => {
77
+ if (!C || i) return I;
78
78
  let t, o;
79
79
  if (v) [t, o] = I; else {
80
- let n = d(0, E()), i = n + l;
81
- r || (e = d(0, e), 1 !== m && (n -= e), 2 !== m && (i += e)), [t, o] = I = H(d(0, n), d(0, i)),
82
- x && (t = u(t, x[0]), o = d(o, x[1]));
80
+ let n = a(0, E()), i = n + l;
81
+ r || (e = a(0, e), 1 !== S && (n -= e), 2 !== S && (i += e)), [t, o] = I = H(a(0, n), a(0, i)),
82
+ w && (t = u(t, w[0]), o = a(o, w[1]));
83
83
  }
84
- return [ d(t, 0), u(o, C.l - 1) ];
84
+ return [ a(t, 0), u(o, R.l - 1) ];
85
85
  },
86
- $: e => b(C, e - c),
87
- I: A,
86
+ $: e => y(R, e - c),
87
+ I: L,
88
88
  k: B,
89
- R: J,
90
- T: () => C.l,
91
- C: () => f,
92
- M: () => 0 !== m,
89
+ C: J,
90
+ R: () => R.l,
91
+ M: () => f,
92
+ O: () => 0 !== S,
93
93
  p: () => l,
94
- O: () => c,
94
+ T: () => c,
95
95
  h: W,
96
- H: () => (v = h, h = 0, [ v, 2 === _ ]),
96
+ H: () => (v = h, h = 0, [ v, 2 === m ]),
97
97
  W: (e, t) => {
98
98
  const o = [ e, t ];
99
- return M.add(o), () => {
100
- M.delete(o);
99
+ return O.add(o), () => {
100
+ O.delete(o);
101
101
  };
102
102
  },
103
103
  B: (e, t) => {
@@ -105,54 +105,54 @@ var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p
105
105
  switch (e) {
106
106
  case 1:
107
107
  {
108
- if (t === f && 0 === _) break;
108
+ if (t === f && 0 === m) break;
109
109
  const e = v;
110
110
  v = 0;
111
- const o = t - f, r = a(o);
112
- e && r < a(e) + 1 || 0 !== _ || (m = o < 0 ? 2 : 1), i && (i = !1), f = t, u = 4;
113
- const s = O();
111
+ const o = t - f, r = d(o);
112
+ e && r < d(e) + 1 || 0 !== m || (S = o < 0 ? 2 : 1), i && (i = !1), f = t, u = 4;
113
+ const s = T();
114
114
  s >= -l && s <= W() && (u += 1, n = r > l);
115
115
  break;
116
116
  }
117
117
 
118
118
  case 2:
119
- u = 8, 0 !== m && (o = !0, u += 1), m = 0, _ = 0, x = null;
119
+ u = 8, 0 !== S && (o = !0, u += 1), S = 0, m = 0, w = null;
120
120
  break;
121
121
 
122
122
  case 3:
123
123
  {
124
- const e = t.filter(([e, t]) => !A(e, t));
124
+ const e = t.filter(([e, t]) => !L(e, t));
125
125
  if (!e.length) break;
126
- L(e.reduce((e, [t, o]) => {
126
+ X(e.reduce((e, [t, o]) => {
127
127
  let n;
128
- if (2 === _) n = !0; else if (x && 1 === _) n = t < x[0]; else {
129
- const e = O(), o = B(t), r = J(t);
130
- n = 1 !== m && 0 === _ ? o + r <= e : o < e && o + r < e + l;
128
+ if (2 === m) n = !0; else if (w && 1 === m) n = t < w[0]; else {
129
+ const e = T(), o = B(t), r = J(t);
130
+ n = 1 !== S && 0 === m ? o + r <= e : o < e && o + r < e + l;
131
131
  }
132
132
  return n && (e += o - J(t)), e;
133
133
  }, 0));
134
134
  for (const [t, o] of e) {
135
- const e = J(t), n = $(C, t, o);
135
+ const e = J(t), n = z(R, t, o);
136
136
  r && (k += n ? o : o - e);
137
137
  }
138
- r && l && k > l && (L(((e, t) => {
138
+ r && l && k > l && (X(((e, t) => {
139
139
  let o = 0;
140
140
  const n = [];
141
141
  e.t.forEach((e, r) => {
142
142
  -1 !== e && (n.push(e), r < t && o++);
143
143
  }), e.i = -1;
144
144
  const r = p(n), i = r.length, s = i / 2 | 0, l = i % 2 == 0 ? (r[s - 1] + r[s]) / 2 : r[s], c = e.o;
145
- return ((e.o = l) - c) * d(t - o, 0);
146
- })(C, b(C, E()))), r = !1), u = 3, n = !0;
145
+ return ((e.o = l) - c) * a(t - o, 0);
146
+ })(R, y(R, E()))), r = !1), u = 3, n = !0;
147
147
  break;
148
148
  }
149
149
 
150
150
  case 4:
151
- l !== t && (l || (R = n = !0), l = t, u = 3);
151
+ l !== t && (l || (C = n = !0), l = t, u = 3);
152
152
  break;
153
153
 
154
154
  case 5:
155
- t[1] ? (L(y(C, t[0], !0)), _ = 2, u = 1) : (y(C, t[0]), u = 1);
155
+ t[1] ? (X(x(R, t[0], !0)), m = 2, u = 1) : (x(R, t[0]), u = 1);
156
156
  break;
157
157
 
158
158
  case 6:
@@ -160,61 +160,74 @@ var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p
160
160
  break;
161
161
 
162
162
  case 7:
163
- _ = 1;
163
+ m = 1;
164
164
  break;
165
165
 
166
166
  case 8:
167
- x = H(t, t + l), u = 1;
167
+ w = H(t, t + l), u = 1;
168
168
  }
169
- u && (s = 1 + (2147483647 & s), o && g && (h += g, g = 0), M.forEach(([e, t]) => {
169
+ u && (s = 1 + (2147483647 & s), o && g && (h += g, g = 0), O.forEach(([e, t]) => {
170
170
  u & e && t(n);
171
171
  }));
172
172
  }
173
173
  };
174
- }, E = setTimeout, H = (e, t) => t ? -e : e, W = (e, t, o, n, r, i) => {
174
+ }, H = e => {
175
+ let t;
176
+ return {
177
+ J(o) {
178
+ (t || (t = new (R(C(o)).ResizeObserver)(e))).observe(o);
179
+ },
180
+ L(e) {
181
+ t.unobserve(e);
182
+ },
183
+ X() {
184
+ t && t.disconnect();
185
+ }
186
+ };
187
+ }, W = (e, t) => t ? -e : e, B = (e, t, o, n, r, i) => {
175
188
  const s = Date.now;
176
- let l = 0, c = !1, f = !1, u = !1, d = !1;
177
- const a = (() => {
189
+ let l = 0, c = !1, f = !1, u = !1, a = !1;
190
+ const d = (() => {
178
191
  let t;
179
192
  const o = () => {
180
193
  null != t && clearTimeout(t);
181
194
  }, n = () => {
182
- o(), t = E(() => {
195
+ o(), t = v(() => {
183
196
  t = null, (() => {
184
- if (c || f) return c = !1, void a();
197
+ if (c || f) return c = !1, void d();
185
198
  u = !1, e.B(2);
186
199
  })();
187
200
  }, 150);
188
201
  };
189
- return n.J = o, n;
202
+ return n.Y = o, n;
190
203
  })(), h = () => {
191
- l = s(), u && (d = !0), i && e.B(6, i()), e.B(1, n()), a();
204
+ l = s(), u && (a = !0), i && e.B(6, i()), e.B(1, n()), d();
192
205
  }, g = t => {
193
- if (c || !e.M() || t.ctrlKey) return;
206
+ if (c || !e.O() || t.ctrlKey) return;
194
207
  const n = s() - l;
195
208
  150 > n && 50 < n && (o ? t.deltaX : t.deltaY) && (c = !0);
196
209
  }, p = () => {
197
- f = !0, u = d = !1;
198
- }, v = () => {
199
- f = !1, T() && (u = !0);
210
+ f = !0, u = a = !1;
211
+ }, S = () => {
212
+ f = !1, M() && (u = !0);
200
213
  };
201
214
  return t.addEventListener("scroll", h), t.addEventListener("wheel", g, {
202
215
  passive: !0
203
216
  }), t.addEventListener("touchstart", p, {
204
217
  passive: !0
205
- }), t.addEventListener("touchend", v, {
218
+ }), t.addEventListener("touchend", S, {
206
219
  passive: !0
207
220
  }), {
208
- A: () => {
221
+ X: () => {
209
222
  t.removeEventListener("scroll", h), t.removeEventListener("wheel", g), t.removeEventListener("touchstart", p),
210
- t.removeEventListener("touchend", v), a.J();
223
+ t.removeEventListener("touchend", S), d.Y();
211
224
  },
212
- L: () => {
225
+ A: () => {
213
226
  const [t, o] = e.H();
214
- t && (r(t, o, d), d = !1, o && e.p() > e.h() && e.B(1, n()));
227
+ t && (r(t, o, a), a = !1, o && e.p() > e.h() && e.B(1, n()));
215
228
  }
216
229
  };
217
- }, B = (e, t, o) => {
230
+ }, J = (e, t, o) => {
218
231
  let n;
219
232
  return [ async (r, i) => {
220
233
  if (!await t()) return;
@@ -223,14 +236,14 @@ var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p
223
236
  const [t, o] = m();
224
237
  return n = () => {
225
238
  o(!1);
226
- }, e.p() && E(n, 150), [ t, e.W(2, () => {
239
+ }, e.p() && v(n, 150), [ t, e.W(2, () => {
227
240
  o(!0);
228
241
  }) ];
229
242
  };
230
- if (i && C()) e.B(8, r()), v(async () => {
243
+ if (i && O()) e.B(8, r()), S(async () => {
231
244
  for (;;) {
232
245
  let t = !0;
233
- for (let [o, n] = e.S(); o <= n; o++) if (e.I(o)) {
246
+ for (let [o, n] = e._(); o <= n; o++) if (e.I(o)) {
234
247
  t = !1;
235
248
  break;
236
249
  }
@@ -254,248 +267,217 @@ var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p
254
267
  }, () => {
255
268
  n && n();
256
269
  } ];
257
- }, J = (e, t) => {
270
+ }, L = (e, t) => {
258
271
  let o, n, r = m(), i = !1;
259
- const s = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", [c, f] = B(e, () => r[0], (e, n) => {
260
- e = H(e, i), n ? o.scrollTo({
272
+ const s = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", [c, f] = J(e, () => r[0], (e, n) => {
273
+ e = W(e, i), n ? o.scrollTo({
261
274
  [t ? "left" : "top"]: e,
262
275
  behavior: "smooth"
263
276
  }) : o[s] = e;
277
+ }), u = t ? "width" : "height", a = /* @__PURE__ */ new WeakMap, d = H(t => {
278
+ const n = [];
279
+ for (const {target: r, contentRect: i} of t) if (r.offsetParent) if (r === o) e.B(4, i[u]); else {
280
+ const e = a.get(r);
281
+ null != e && n.push([ e, i[u] ]);
282
+ }
283
+ n.length && e.B(3, n);
264
284
  });
265
285
  return {
266
- N(c, u) {
267
- o = u, t && (i = "rtl" === getComputedStyle(u).direction), n = W(e, u, t, () => H(u[s], i), (t, o, n) => {
286
+ N(c, u = c.parentElement) {
287
+ d.J(o = u), t && (i = "rtl" === getComputedStyle(u).direction), n = B(e, u, t, () => W(u[s], i), (t, o, n) => {
268
288
  if (n) {
269
289
  const e = u.style, t = e[l];
270
- e[l] = "hidden", E(() => {
290
+ e[l] = "hidden", v(() => {
271
291
  e[l] = t;
272
292
  });
273
293
  }
274
- u[s] = H(e.C() + t, i), o && f();
294
+ u[s] = W(e.M() + t, i), o && f();
275
295
  }), r[1](!0);
276
296
  },
277
297
  v() {
278
- n && n.A(), r[1](!1), r = m();
279
- },
280
- P: () => i,
281
- V(e) {
282
- c(() => e);
298
+ d.X(), n && n.X(), r[1](!1), r = m();
283
299
  },
284
- X(t) {
285
- t += e.C(), c(() => t);
286
- },
287
- Y(t, {align: o, smooth: n, offset: r = 0} = {}) {
288
- if (t = g(t, 0, e.T() - 1), "nearest" === o) {
289
- const n = e.k(t), r = e.C();
290
- if (n < r) o = "start"; else {
291
- if (!(n + e.R(t) > r + e.p())) return;
292
- o = "end";
293
- }
294
- }
295
- c(() => r + e.O() + e.k(t) + ("end" === o ? e.R(t) - e.p() : "center" === o ? (e.R(t) - e.p()) / 2 : 0), n);
300
+ P: (e, t) => (a.set(e, t), d.J(e), () => {
301
+ a.delete(e), d.L(e);
302
+ }),
303
+ V: () => i,
304
+ q: c,
305
+ j() {
306
+ n && n.A();
296
307
  },
297
- q: () => {
298
- n && n.L();
299
- }
308
+ D: e.T,
309
+ G: () => 0
300
310
  };
301
- }, A = (e, t) => {
302
- let o, n, r = m(), i = !1;
303
- const s = t ? "left" : "top", [l] = B(e, () => r[0], (e, t) => {
304
- e = H(e, i);
305
- const n = R(k(o));
311
+ }, X = (e, t) => {
312
+ let o, n, r, i = m(), s = !1;
313
+ const l = t ? "left" : "top", [c] = J(e, () => i[0], (e, t) => {
314
+ e = W(e, s);
315
+ const n = R(C(o));
306
316
  t ? n.scroll({
307
- [s]: e,
317
+ [l]: e,
308
318
  behavior: "smooth"
309
319
  }) : n.scroll({
310
- [s]: e
320
+ [l]: e
311
321
  });
312
- }), c = (e, t, o, n, r = 0) => {
313
- const s = n ? "offsetLeft" : "offsetTop", l = r + (n && i ? o.innerWidth - e[s] - e.offsetWidth : e[s]), f = e.offsetParent;
314
- return e !== t && f ? c(f, t, o, n, l) : l;
315
- };
316
- return {
317
- N(l) {
318
- o = l;
319
- const f = t ? "scrollX" : "scrollY", u = k(l), d = R(u);
320
- t && (i = "rtl" === getComputedStyle(I(u)).direction), n = W(e, d, t, () => H(d[f], i), (t, o) => {
321
- o ? d.scroll({
322
- [s]: H(e.C() + t, i)
323
- }) : d.scrollBy({
324
- [s]: H(t, i)
325
- });
326
- }, () => c(l, u.body, d, t)), r[1](!0);
327
- },
328
- v() {
329
- n && n.A(), o = void 0, r[1](!1), r = m();
330
- },
331
- P: () => i,
332
- q: () => {
333
- n && n.L();
334
- },
335
- Y(n, {align: r, smooth: i, offset: s = 0} = {}) {
336
- if (!o) return;
337
- if (n = g(n, 0, e.T() - 1), "nearest" === r) {
338
- const t = e.k(n), o = e.C();
339
- if (t < o) r = "start"; else {
340
- if (!(t + e.R(n) > o + e.p())) return;
341
- r = "end";
342
- }
343
- }
344
- const f = k(o), u = R(f), d = I(f), a = () => e.p() - (t ? d.clientWidth : d.clientHeight);
345
- l(() => s + c(o, f.body, u, t) + e.k(n) + ("end" === r ? e.R(n) - (e.p() - a()) : "center" === r ? (e.R(n) - (e.p() - a())) / 2 : 0), i);
322
+ }), f = t ? "width" : "height", u = /* @__PURE__ */ new WeakMap, a = H(t => {
323
+ const o = [];
324
+ for (const {target: e, contentRect: n} of t) {
325
+ if (!e.offsetParent) continue;
326
+ const t = u.get(e);
327
+ null != t && o.push([ t, n[f] ]);
346
328
  }
329
+ o.length && e.B(3, o);
330
+ }), d = (e, t, o, n, r = 0) => {
331
+ const i = n ? "offsetLeft" : "offsetTop", l = r + (n && s ? o.innerWidth - e[i] - e.offsetWidth : e[i]), c = e.offsetParent;
332
+ return e !== t && c ? d(c, t, o, n, l) : l;
347
333
  };
348
- }, L = (e, t) => {
349
- const o = J(e, !1), n = J(t, !0);
350
334
  return {
351
- N(e, t) {
352
- o.N(e, t), n.N(e, t);
335
+ N(c) {
336
+ o = c;
337
+ const f = t ? "scrollX" : "scrollY", u = C(c), a = R(u), h = () => {
338
+ e.B(4, a[t ? "innerWidth" : "innerHeight"]);
339
+ };
340
+ a.addEventListener("resize", h), S(h), r = () => {
341
+ a.removeEventListener("resize", h);
342
+ }, t && (s = "rtl" === getComputedStyle(k(u)).direction), n = B(e, a, t, () => W(a[f], s), (t, o) => {
343
+ o ? a.scroll({
344
+ [l]: W(e.M() + t, s)
345
+ }) : a.scrollBy({
346
+ [l]: W(t, s)
347
+ });
348
+ }, () => d(c, u.body, a, t)), i[1](!0);
353
349
  },
354
350
  v() {
355
- o.v(), n.v();
356
- },
357
- P: n.P,
358
- V(e, t) {
359
- null != e && o.V(e), null != t && n.V(t);
360
- },
361
- X(e, t) {
362
- null != e && o.X(e), null != t && n.X(t);
363
- },
364
- Y(e, t) {
365
- null != e && o.Y(e), null != t && n.Y(t);
366
- },
367
- q() {
368
- o.q(), n.q();
369
- }
370
- };
371
- }, N = e => {
372
- let t;
373
- return {
374
- j(o) {
375
- (t || (t = new (R(k(o)).ResizeObserver)(e))).observe(o);
376
- },
377
- D(e) {
378
- t.unobserve(e);
379
- },
380
- A() {
381
- t && t.disconnect();
382
- }
383
- };
384
- }, P = (e, t) => {
385
- let o;
386
- const n = t ? "width" : "height", r = /* @__PURE__ */ new WeakMap, i = N(t => {
387
- const i = [];
388
- for (const {target: s, contentRect: l} of t) if (s.offsetParent) if (s === o) e.B(4, l[n]); else {
389
- const e = r.get(s);
390
- null != e && i.push([ e, l[n] ]);
391
- }
392
- i.length && e.B(3, i);
393
- });
394
- return {
395
- G(e) {
396
- i.j(o = e);
351
+ r && r(), a.X(), n && n.X(), o = void 0, i[1](!1), i = m();
397
352
  },
398
- U: (e, t) => (r.set(e, t), i.j(e), () => {
399
- r.delete(e), i.D(e);
353
+ P: (e, t) => (u.set(e, t), a.J(e), () => {
354
+ u.delete(e), a.L(e);
400
355
  }),
401
- v: i.A
402
- };
403
- }, V = (e, t) => {
404
- const o = t ? "width" : "height", n = t ? "innerWidth" : "innerHeight", r = /* @__PURE__ */ new WeakMap, i = N(t => {
405
- const n = [];
406
- for (const {target: e, contentRect: i} of t) {
407
- if (!e.offsetParent) continue;
408
- const t = r.get(e);
409
- null != t && n.push([ t, i[o] ]);
410
- }
411
- n.length && e.B(3, n);
412
- });
413
- let s;
414
- return {
415
- G(t) {
416
- const o = R(k(t)), r = () => {
417
- e.B(4, o[n]);
418
- };
419
- o.addEventListener("resize", r), v(r), s = () => {
420
- o.removeEventListener("resize", r);
421
- };
422
- },
423
- U: (e, t) => (r.set(e, t), i.j(e), () => {
424
- r.delete(e), i.D(e);
425
- }),
426
- v() {
427
- s && s(), i.A();
356
+ V: () => s,
357
+ q: c,
358
+ j() {
359
+ n && n.A();
360
+ },
361
+ D() {
362
+ const e = C(o);
363
+ return d(o, e.body, R(e), t);
364
+ },
365
+ G() {
366
+ const n = k(C(o));
367
+ return e.p() - (t ? n.clientWidth : n.clientHeight);
428
368
  }
429
369
  };
430
- }, X = (e, t) => {
431
- let o;
432
- const n = /* @__PURE__ */ new WeakMap, r = /* @__PURE__ */ new Set, i = /* @__PURE__ */ new Set, s = /* @__PURE__ */ new Map, l = (e, t) => `${e}-${t}`, c = N(c => {
433
- const f = /* @__PURE__ */ new Set, u = /* @__PURE__ */ new Set;
434
- for (const {target: r, contentRect: {width: i, height: d}} of c) if (r.offsetParent) if (r === o) e.B(4, d),
435
- t.B(4, i); else {
436
- const e = n.get(r);
370
+ }, Y = (e, t) => {
371
+ let o, n, r, i = m(), s = !1;
372
+ const [l, c] = J(t, () => i[0], (e, t) => {
373
+ const n = {
374
+ left: W(e, s)
375
+ };
376
+ t && (n.behavior = "smooth"), o.scrollTo(n);
377
+ }), [f, u] = J(e, () => i[0], (e, t) => {
378
+ const n = {
379
+ top: e
380
+ };
381
+ t && (n.behavior = "smooth"), o.scrollTo(n);
382
+ }), d = /* @__PURE__ */ new WeakMap, h = /* @__PURE__ */ new Set, g = /* @__PURE__ */ new Set, p = /* @__PURE__ */ new Map, S = (e, t) => `${e}-${t}`, w = H(n => {
383
+ const r = /* @__PURE__ */ new Set, i = /* @__PURE__ */ new Set;
384
+ for (const {target: s, contentRect: {width: l, height: c}} of n) if (s.offsetParent) if (s === o) e.B(4, c),
385
+ t.B(4, l); else {
386
+ const e = d.get(s);
437
387
  if (e) {
438
- const [t, o] = e, n = l(t, o), r = s.get(n);
439
- let c, a;
440
- r ? (r[0] !== d && (c = !0), r[1] !== i && (a = !0)) : c = a = !0, c && f.add(t),
441
- a && u.add(o), (c || a) && s.set(n, [ d, i ]);
388
+ const [t, o] = e, n = S(t, o), s = p.get(n);
389
+ let f, u;
390
+ s ? (s[0] !== c && (f = !0), s[1] !== l && (u = !0)) : f = u = !0, f && r.add(t),
391
+ u && i.add(o), (f || u) && p.set(n, [ c, l ]);
442
392
  }
443
393
  }
444
- if (f.size) {
394
+ if (r.size) {
445
395
  const t = [];
446
- f.forEach(e => {
396
+ r.forEach(e => {
447
397
  let o = 0;
448
- i.forEach(t => {
449
- const n = s.get(l(e, t));
450
- n && (o = d(o, n[0]));
398
+ g.forEach(t => {
399
+ const n = p.get(S(e, t));
400
+ n && (o = a(o, n[0]));
451
401
  }), o && t.push([ e, o ]);
452
402
  }), e.B(3, t);
453
403
  }
454
- if (u.size) {
404
+ if (i.size) {
455
405
  const e = [];
456
- u.forEach(t => {
406
+ i.forEach(t => {
457
407
  let o = 0;
458
- r.forEach(e => {
459
- const n = s.get(l(e, t));
460
- n && (o = d(o, n[1]));
408
+ h.forEach(e => {
409
+ const n = p.get(S(e, t));
410
+ n && (o = a(o, n[1]));
461
411
  }), o && e.push([ t, o ]);
462
412
  }), t.B(3, e);
463
413
  }
464
- });
414
+ }), _ = (e, t, n) => {
415
+ const r = o, i = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", c = t && s;
416
+ return B(e, r, t, () => W(r[i], c), (t, o, s) => {
417
+ if (s) {
418
+ const e = r.style, t = e[l];
419
+ e[l] = "hidden", v(() => {
420
+ e[l] = t;
421
+ });
422
+ }
423
+ r[i] = W(e.M() + t, c), o && n();
424
+ });
425
+ };
465
426
  return {
466
- G(e) {
467
- c.j(o = e);
427
+ N(l, f = l.parentElement) {
428
+ w.J(o = f), s = "rtl" === getComputedStyle(f).direction, n = _(e, !1, u), r = _(t, !0, c),
429
+ i[1](!0);
430
+ },
431
+ v() {
432
+ w.X(), n && n.X(), r && r.X(), i[1](!1), i = m();
468
433
  },
469
- U: (e, t, o) => (n.set(e, [ t, o ]), r.add(t), i.add(o), c.j(e), () => {
470
- n.delete(e), c.D(e);
434
+ P: (e, t, o) => (d.set(e, [ t, o ]), h.add(t), g.add(o), w.J(e), () => {
435
+ d.delete(e), w.L(e);
471
436
  }),
437
+ U(o) {
438
+ for (const [e] of o) for (let o = 0; o < t.R(); o++) p.delete(S(e, o));
439
+ e.B(3, o);
440
+ },
472
441
  F(o) {
473
- for (const [t] of o) for (let o = 0; o < e.T(); o++) s.delete(l(o, t));
442
+ for (const [t] of o) for (let o = 0; o < e.R(); o++) p.delete(S(o, t));
474
443
  t.B(3, o);
475
444
  },
476
- K(o) {
477
- for (const [e] of o) for (let o = 0; o < t.T(); o++) s.delete(l(e, o));
478
- e.B(3, o);
445
+ V: () => s,
446
+ K: l,
447
+ Z: f,
448
+ j() {
449
+ n && n.A(), r && r.A();
479
450
  },
480
- v: c.A
451
+ D: o => (o ? t : e).T()
481
452
  };
482
- }, Y = x ? r : o, q = "current", j = (e, t) => {
483
- if (Array.isArray(e)) for (const o of e) j(o, t); else null == e || "boolean" == typeof e || t.push(e);
484
- }, D = (e, t) => {
453
+ }, A = (e, t) => {
454
+ e.q(() => t);
455
+ }, N = (e, t, o, {align: n, smooth: r, offset: i = 0} = {}) => {
456
+ if (o = g(o, 0, t.R() - 1), "nearest" === n) {
457
+ const e = t.k(o), r = t.M();
458
+ if (e < r) n = "start"; else {
459
+ if (!(e + t.C(o) > r + t.p())) return;
460
+ n = "end";
461
+ }
462
+ }
463
+ e.q(() => i + e.D() + t.k(o) + ("end" === n ? t.C(o) - (t.p() - e.G()) : "center" === n ? (t.C(o) - (t.p() - e.G())) / 2 : 0), r);
464
+ }, P = I ? r : o, V = "current", q = (e, t) => {
465
+ if (Array.isArray(e)) for (const o of e) q(o, t); else null == e || "boolean" == typeof e || t.push(e);
466
+ }, j = (e, t) => {
485
467
  const o = e.key;
486
468
  return null != o ? o : "_" + t;
487
- }, G = e => {
469
+ }, D = e => {
488
470
  const t = l(null);
489
471
  return t.current || (t.current = e());
490
- }, U = e => {
472
+ }, G = e => {
491
473
  const t = l(e);
492
- return Y(() => {
493
- t[q] = e;
474
+ return P(() => {
475
+ t[V] = e;
494
476
  }, [ e ]), t;
495
- }, F = /*#__PURE__*/ t(({Z: e, ee: t, te: o, oe: n, ne: r, re: s, ie: f, se: u}) => {
496
- const d = l(null);
497
- Y(() => t(d[q], o), [ o ]);
498
- const a = i(() => {
477
+ }, U = /*#__PURE__*/ t(({ee: e, te: t, oe: o, ne: n, re: r, ie: s, se: f, le: u}) => {
478
+ const a = l(null);
479
+ P(() => t(a[V], o), [ o ]);
480
+ const d = i(() => {
499
481
  const e = {
500
482
  contain: "layout style",
501
483
  position: r && u ? void 0 : "absolute",
@@ -508,101 +490,101 @@ var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p
508
490
  }, [ n, r, u, f ]);
509
491
  /* @__PURE__ */
510
492
  return c(s, "string" == typeof s ? {
511
- ref: d,
512
- style: a,
493
+ ref: a,
494
+ style: d,
513
495
  children: e
514
496
  } : {
515
- ref: d,
516
- style: a,
497
+ ref: a,
498
+ style: d,
517
499
  index: o,
518
500
  children: e
519
501
  });
520
- }), K = (e, t) => i(() => {
502
+ }), F = (e, t) => i(() => {
521
503
  if ("function" == typeof e) return [ o => e(t[o], o), t.length ];
522
504
  const o = (e => {
523
505
  const t = [];
524
- return j(e, t), t;
506
+ return q(e, t), t;
525
507
  })(e);
526
508
  return [ e => o[e], o.length ];
527
- }, [ e, t ]), Q = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: r, shift: i, horizontal: u, keepMounted: d, cache: a, startMargin: h = 0, ssrCount: g, as: m = "div", item: _ = "div", scrollRef: w, onScroll: S, onScrollEnd: $}, z) => {
528
- const [b, y] = K(e, t), x = l(null), I = l(!!g), k = U(S), R = U($), [T, C, E, H] = G(() => {
529
- const e = !!u, t = O(y, r, g, a, !r);
530
- return [ t, P(t, e), J(t, e), e ];
509
+ }, [ e, t ]), K = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: r, shift: i, horizontal: u, keepMounted: a, cache: d, startMargin: h = 0, ssrCount: g, as: v = "div", item: m = "div", scrollRef: w, onScroll: _, onScrollEnd: $}, z) => {
510
+ const [b, y] = F(e, t), x = l(null), I = l(!!g), k = G(_), C = G($), [R, M, O] = D(() => {
511
+ const e = !!u, t = E(y, r, g, d, !r);
512
+ return [ t, L(t, e), e ];
531
513
  });
532
- y !== T.T() && T.B(5, [ y, i ]), h !== T.O() && T.B(6, h);
533
- const [W, B] = s(T.m, void 0, T.m), A = T.M(), L = T.h(), N = E.P(), V = [], X = e => {
514
+ y !== R.R() && R.B(5, [ y, i ]), h !== R.T() && R.B(6, h);
515
+ const [H, W] = s(R.S, void 0, R.S), B = R.O(), J = R.h(), X = M.V(), Y = [], q = e => {
534
516
  const t = b(e);
535
517
  /* @__PURE__ */
536
- return c(F, {
537
- ee: C.U,
538
- te: e,
539
- oe: T.k(e, N),
540
- ne: T.I(e),
541
- re: _,
542
- Z: t,
543
- ie: H,
544
- se: I[q]
545
- }, D(t, e));
518
+ return c(U, {
519
+ te: M.P,
520
+ oe: e,
521
+ ne: R.k(e, X),
522
+ re: R.I(e),
523
+ ie: m,
524
+ ee: t,
525
+ se: O,
526
+ le: I[V]
527
+ }, j(t, e));
546
528
  };
547
- if (Y(() => {
548
- I[q] = !1, T.W(1, e => {
549
- e ? f(B) : B();
550
- }), T.W(4, () => {
551
- k.current && k.current(T.C());
552
- }), T.W(8, () => {
553
- R.current && R.current();
529
+ if (P(() => {
530
+ I[V] = !1, R.W(1, e => {
531
+ e ? f(W) : W();
532
+ }), R.W(4, () => {
533
+ k.current && k.current(R.M());
534
+ }), R.W(8, () => {
535
+ C.current && C.current();
554
536
  });
555
- const e = x[q], t = t => {
556
- C.G(t), E.N(e, t);
537
+ const e = x[V];
538
+ return w ? S(() => {
539
+ w.current && M.N(e, w[V]);
540
+ }) : M.N(e), () => {
541
+ R.v(), M.v();
557
542
  };
558
- return w ? v(() => {
559
- w.current && t(w[q]);
560
- }) : t(e.parentElement), () => {
561
- T.v(), C.v(), E.v();
562
- };
563
- }, []), Y(() => {
564
- E.q();
565
- }, [ W ]), n(z, () => ({
543
+ }, []), P(() => {
544
+ M.j();
545
+ }, [ H ]), n(z, () => ({
566
546
  get cache() {
567
- return T._();
547
+ return R.m();
568
548
  },
569
549
  get scrollOffset() {
570
- return T.C();
550
+ return R.M();
571
551
  },
572
552
  get scrollSize() {
573
- return M(T);
553
+ return T(R);
574
554
  },
575
555
  get viewportSize() {
576
- return T.p();
577
- },
578
- findItemIndex: T.$,
579
- getItemOffset: T.k,
580
- getItemSize: T.R,
581
- scrollToIndex: E.Y,
582
- scrollTo: E.V,
583
- scrollBy: E.X
584
- }), []), d) {
585
- const e = new Set(d);
586
- for (let [t, n] = T.S(o); t <= n; t++) e.add(t);
556
+ return R.p();
557
+ },
558
+ findItemIndex: R.$,
559
+ getItemOffset: R.k,
560
+ getItemSize: R.C,
561
+ scrollToIndex: (e, t) => N(M, R, e, t),
562
+ scrollTo: e => A(M, e),
563
+ scrollBy: e => ((e, t, o) => {
564
+ A(e, o + t.M());
565
+ })(M, R, e)
566
+ }), []), a) {
567
+ const e = new Set(a);
568
+ for (let [t, n] = R._(o); t <= n; t++) e.add(t);
587
569
  p([ ...e ]).forEach(e => {
588
- V.push(X(e));
570
+ Y.push(q(e));
589
571
  });
590
- } else for (let [e, t] = T.S(o); e <= t; e++) V.push(X(e));
572
+ } else for (let [e, t] = R._(o); e <= t; e++) Y.push(q(e));
591
573
  /* @__PURE__ */
592
- return c(m, {
574
+ return c(v, {
593
575
  ref: x,
594
576
  style: {
595
577
  contain: "size style",
596
578
  overflowAnchor: "none",
597
579
  flex: "none",
598
580
  position: "relative",
599
- width: H ? L : "100%",
600
- height: H ? "100%" : L,
601
- pointerEvents: A ? "none" : void 0
581
+ width: O ? J : "100%",
582
+ height: O ? "100%" : J,
583
+ pointerEvents: B ? "none" : void 0
602
584
  },
603
- children: V
585
+ children: Y
604
586
  });
605
- }), Z = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: n, shift: r, horizontal: i, keepMounted: s, cache: l, ssrCount: f, item: u, onScroll: d, onScrollEnd: a, style: h, ...g}, p) => /* @__PURE__ */ c("div", {
587
+ }), Q = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: n, shift: r, horizontal: i, keepMounted: s, cache: l, ssrCount: f, item: u, onScroll: a, onScrollEnd: d, style: h, ...g}, p) => /* @__PURE__ */ c("div", {
606
588
  ...g,
607
589
  style: {
608
590
  display: i ? "inline-block" : "block",
@@ -612,7 +594,7 @@ var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p
612
594
  height: "100%",
613
595
  ...h
614
596
  },
615
- children: /* @__PURE__ */ c(Q, {
597
+ children: /* @__PURE__ */ c(K, {
616
598
  ref: p,
617
599
  data: t,
618
600
  bufferSize: o,
@@ -623,76 +605,72 @@ var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p
623
605
  cache: l,
624
606
  ssrCount: f,
625
607
  item: u,
626
- onScroll: d,
627
- onScrollEnd: a,
608
+ onScroll: a,
609
+ onScrollEnd: d,
628
610
  children: e
629
611
  })
630
- })), ee = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: r, shift: i, horizontal: u, cache: d, ssrCount: a, as: h = "div", item: g = "div", onScroll: p, onScrollEnd: v}, m) => {
631
- const [_, w] = K(e, t), S = l(null), $ = U(p), z = U(v), b = l(!!a), [y, x, I, k] = G(() => {
632
- const e = !!u, t = O(w, r, a, d, !r);
633
- return [ t, V(t, e), A(t, e), e ];
612
+ })), Z = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: r, shift: i, horizontal: u, cache: a, ssrCount: d, as: h = "div", item: g = "div", onScroll: p, onScrollEnd: v}, S) => {
613
+ const [m, w] = F(e, t), _ = l(null), $ = G(p), z = G(v), b = l(!!d), [y, x, I] = D(() => {
614
+ const e = !!u, t = E(w, r, d, a, !r);
615
+ return [ t, X(t, e), e ];
634
616
  });
635
- w !== y.T() && y.B(5, [ w, i ]);
636
- const [R, T] = s(y.m, void 0, y.m), C = y.M(), M = y.h(), E = I.P(), H = [];
637
- Y(() => {
638
- b[q] = !1, y.W(1, e => {
639
- e ? f(T) : T();
640
- }), y.W(4, () => {
641
- $.current && $.current();
642
- }), y.W(8, () => {
643
- z.current && z.current();
644
- });
645
- const e = S[q];
646
- return x.G(e), I.N(e), () => {
647
- y.v(), x.v(), I.v();
648
- };
649
- }, []), Y(() => {
650
- I.q();
651
- }, [ R ]), n(m, () => ({
617
+ w !== y.R() && y.B(5, [ w, i ]);
618
+ const [k, C] = s(y.S, void 0, y.S), R = y.O(), M = y.h(), O = x.V(), T = [];
619
+ P(() => (b[V] = !1, y.W(1, e => {
620
+ e ? f(C) : C();
621
+ }), y.W(4, () => {
622
+ $.current && $.current();
623
+ }), y.W(8, () => {
624
+ z.current && z.current();
625
+ }), x.N(_[V]), () => {
626
+ y.v(), x.v();
627
+ }), []), P(() => {
628
+ x.j();
629
+ }, [ k ]), n(S, () => ({
652
630
  get cache() {
653
- return y._();
631
+ return y.m();
654
632
  },
655
633
  get scrollOffset() {
656
- return y.C();
634
+ return y.M();
657
635
  },
658
636
  get viewportSize() {
659
637
  return y.p();
660
638
  },
661
639
  findItemIndex: y.$,
662
640
  getItemOffset: y.k,
663
- getItemSize: y.R,
664
- scrollToIndex: I.Y
641
+ getItemSize: y.C,
642
+ scrollToIndex: (e, t) => N(x, y, e, t)
665
643
  }), []);
666
- for (let [e, t] = y.S(o); e <= t; e++) {
667
- const t = _(e);
668
- H.push(/* @__PURE__ */ c(F, {
669
- ee: x.U,
670
- te: e,
671
- oe: y.k(e, E),
672
- ne: y.I(e),
673
- re: g,
674
- Z: t,
675
- ie: k,
676
- se: b[q]
677
- }, D(t, e)));
644
+ for (let [e, t] = y._(o); e <= t; e++) {
645
+ const t = m(e);
646
+ T.push(/* @__PURE__ */ c(U, {
647
+ te: x.P,
648
+ oe: e,
649
+ ne: y.k(e, O),
650
+ re: y.I(e),
651
+ ie: g,
652
+ ee: t,
653
+ se: I,
654
+ le: b[V]
655
+ }, j(t, e)));
678
656
  }
679
657
  /* @__PURE__ */
680
658
  return c(h, {
681
- ref: S,
659
+ ref: _,
682
660
  style: {
683
661
  contain: "size style",
684
662
  overflowAnchor: "none",
685
663
  flex: "none",
686
664
  position: "relative",
687
- width: k ? M : "100%",
688
- height: k ? "100%" : M,
689
- pointerEvents: C ? "none" : void 0
665
+ width: I ? M : "100%",
666
+ height: I ? "100%" : M,
667
+ pointerEvents: R ? "none" : void 0
690
668
  },
691
- children: H
669
+ children: T
692
670
  });
693
- }), te = (e, t) => `${e}-${t}`, oe = /*#__PURE__*/ t(({Z: e, ee: t, le: o, ce: n, fe: r, ue: s, de: f, ae: u, ne: d, he: a}) => {
671
+ }), ee = (e, t) => `${e}-${t}`, te = /*#__PURE__*/ t(({ee: e, te: t, ce: o, fe: n, ue: r, ae: s, de: f, he: u, re: a, ge: d}) => {
694
672
  const h = l(null);
695
- return Y(() => t.U(h[q], o, n), [ n, o ]), /* @__PURE__ */ c(a, {
673
+ return P(() => t(h[V], o, n), [ n, o ]), /* @__PURE__ */ c(d, {
696
674
  ref: h,
697
675
  style: i(() => ({
698
676
  contain: "layout style",
@@ -700,102 +678,122 @@ var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p
700
678
  position: "absolute",
701
679
  top: r,
702
680
  left: s,
703
- visibility: d ? "hidden" : void 0,
681
+ visibility: a ? "hidden" : void 0,
704
682
  minHeight: f,
705
683
  minWidth: u
706
- }), [ r, s, u, f, d ]),
684
+ }), [ r, s, u, f, a ]),
707
685
  children: e
708
686
  });
709
- }), ne = /*#__PURE__*/ e(({children: e, row: t, col: o, cellHeight: r = 40, cellWidth: u = 100, bufferSize: d, ssrRowCount: a, ssrColCount: h, item: g = "div", domRef: p, onScroll: v, onScrollEnd: m, style: _, ...w}, S) => {
710
- const [$, z, b, y] = G(() => {
711
- const e = O(t, r, a), n = O(o, u, h);
712
- return [ e, n, X(e, n), L(e, n) ];
687
+ }), oe = /*#__PURE__*/ e(({children: e, row: t, col: o, cellHeight: r = 40, cellWidth: u = 100, bufferSize: a, ssrRowCount: d, ssrColCount: h, item: p = "div", domRef: v, onScroll: S, onScrollEnd: m, style: w, ..._}, $) => {
688
+ const [z, b, y] = D(() => {
689
+ const e = E(t, r, d), n = E(o, u, h);
690
+ return [ e, n, Y(e, n) ];
713
691
  });
714
- t !== $.T() && $.B(5, [ t ]), o !== z.T() && z.B(5, [ o ]);
715
- const [x, I] = s($.m, void 0, $.m), [k, R] = s(z.m, void 0, z.m), T = $.M(), C = z.M(), E = M($), H = M(z), W = l(null), B = U(v), J = U(m);
716
- Y(() => {
717
- $.W(1, e => {
692
+ t !== z.R() && z.B(5, [ t ]), o !== b.R() && b.B(5, [ o ]);
693
+ const [x, I] = s(z.S, void 0, z.S), [k, C] = s(b.S, void 0, b.S), R = z.O(), M = b.O(), O = T(z), H = T(b), W = l(null), B = G(S), J = G(m);
694
+ P(() => {
695
+ z.W(1, e => {
718
696
  e ? f(I) : I();
719
- }), z.W(1, e => {
720
- e ? f(R) : R();
721
- }), $.W(4, () => {
722
- B.current && B.current($.C());
723
- }), $.W(8, () => {
697
+ }), b.W(1, e => {
698
+ e ? f(C) : C();
699
+ }), z.W(4, () => {
700
+ B.current && B.current(z.M());
701
+ }), z.W(8, () => {
724
702
  J.current && J.current();
725
703
  });
726
- const e = W[q], t = e.parentElement;
727
- return b.G(t), y.N(e, t), () => {
728
- $.v(), z.v(), b.v(), y.v();
704
+ const e = W[V];
705
+ return y.N(e), () => {
706
+ z.v(), b.v(), y.v();
729
707
  };
730
- }, []), Y(() => {
731
- y.q();
732
- }, [ x, k ]), n(S, () => ({
708
+ }, []), P(() => {
709
+ y.j();
710
+ }, [ x, k ]), n($, () => ({
733
711
  get scrollTop() {
734
- return $.C();
712
+ return z.M();
735
713
  },
736
714
  get scrollLeft() {
737
- return z.C();
715
+ return b.M();
738
716
  },
739
717
  get scrollHeight() {
740
- return M($);
718
+ return T(z);
741
719
  },
742
720
  get scrollWidth() {
743
- return M(z);
721
+ return T(b);
744
722
  },
745
723
  get viewportHeight() {
746
- return $.p();
747
- },
748
- get viewportWidth() {
749
724
  return z.p();
750
725
  },
751
- findRowIndex: $.$,
752
- findColIndex: z.$,
753
- getRowOffset: $.k,
754
- getColOffset: z.k,
755
- getRowSize: $.R,
756
- getColSize: z.R,
726
+ get viewportWidth() {
727
+ return b.p();
728
+ },
729
+ findRowIndex: z.$,
730
+ findColIndex: b.$,
731
+ getRowOffset: z.k,
732
+ getColOffset: b.k,
733
+ getRowSize: z.C,
734
+ getColSize: b.C,
757
735
  resizeCols(e) {
758
- b.F(e);
736
+ y.F(e);
759
737
  },
760
738
  resizeRows(e) {
761
- b.K(e);
739
+ y.U(e);
762
740
  },
763
- scrollToIndex: y.Y,
764
- scrollTo: y.V,
765
- scrollBy: y.X
741
+ scrollToIndex: (e, t) => ((e, t, o, n, r) => {
742
+ if (null != n) {
743
+ const o = g(n, 0, t.R() - 1);
744
+ e.Z(() => e.D(!1) + t.k(o));
745
+ }
746
+ if (null != r) {
747
+ const t = g(r, 0, o.R() - 1);
748
+ e.K(() => e.D(!0) + o.k(t));
749
+ }
750
+ })(y, z, b, e, t),
751
+ scrollTo: (e, t) => ((e, t, o) => {
752
+ null != t && e.Z(() => t), null != o && e.K(() => o);
753
+ })(y, e, t),
754
+ scrollBy: (e, t) => ((e, t, o, n, r) => {
755
+ if (null != n) {
756
+ const o = n + t.M();
757
+ e.Z(() => o);
758
+ }
759
+ if (null != r) {
760
+ const t = r + o.M();
761
+ e.K(() => t);
762
+ }
763
+ })(y, z, b, e, t)
766
764
  }), []);
767
- const A = i(() => {
765
+ const L = i(() => {
768
766
  const t = /* @__PURE__ */ new Map;
769
767
  return (o, n) => {
770
- let r = t.get(te(o, n));
771
- return r || t.set(te(o, n), r = e({
768
+ let r = t.get(ee(o, n));
769
+ return r || t.set(ee(o, n), r = e({
772
770
  rowIndex: o,
773
771
  colIndex: n
774
772
  })), r;
775
773
  };
776
- }, [ e ]), N = y.P(), [P, V] = $.S(d), [j, D] = z.S(d), F = [];
777
- for (let e = P; e <= V; e++) for (let t = j; t <= D; t++) F.push(/* @__PURE__ */ c(oe, {
778
- ee: b,
779
- le: e,
780
- ce: t,
781
- fe: $.k(e),
782
- ue: z.k(t, N),
783
- de: $.R(e),
784
- ae: z.R(t),
785
- ne: $.I(e) || z.I(t),
786
- he: g,
787
- Z: A(e, t)
788
- }, te(e, t)));
774
+ }, [ e ]), X = y.V(), [A, N] = z._(a), [q, j] = b._(a), U = [];
775
+ for (let e = A; e <= N; e++) for (let t = q; t <= j; t++) U.push(/* @__PURE__ */ c(te, {
776
+ te: y.P,
777
+ ce: e,
778
+ fe: t,
779
+ ue: z.k(e),
780
+ ae: b.k(t, X),
781
+ de: z.C(e),
782
+ he: b.C(t),
783
+ re: z.I(e) || b.I(t),
784
+ ge: p,
785
+ ee: L(e, t)
786
+ }, ee(e, t)));
789
787
  /* @__PURE__ */
790
788
  return c("div", {
791
- ref: p,
792
- ...w,
789
+ ref: v,
790
+ ..._,
793
791
  style: {
794
792
  overflow: "auto",
795
793
  contain: "strict",
796
794
  width: "100%",
797
795
  height: "100%",
798
- ..._
796
+ ...w
799
797
  },
800
798
  children: /* @__PURE__ */ c("div", {
801
799
  ref: W,
@@ -805,13 +803,13 @@ var {min: u, max: d, abs: a, floor: h} = Math, g = (e, t, o) => u(o, d(t, e)), p
805
803
  flex: "none",
806
804
  position: "relative",
807
805
  width: H,
808
- height: E,
809
- pointerEvents: T || C ? "none" : void 0
806
+ height: O,
807
+ pointerEvents: R || M ? "none" : void 0
810
808
  },
811
- children: F
809
+ children: U
812
810
  })
813
811
  });
814
812
  });
815
813
 
816
- export { Z as VList, Q as Virtualizer, ee as WindowVirtualizer, ne as experimental_VGrid };
814
+ export { Q as VList, K as Virtualizer, Z as WindowVirtualizer, oe as experimental_VGrid };
817
815
  //# sourceMappingURL=index.js.map