virtua 0.50.6 → 0.51.1

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