virtua 0.51.1 → 0.51.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.
@@ -1,19 +1,19 @@
1
- import { Dynamic as e, createComponent as t, effect as r, insert as n, memo as o, mergeProps as s, setStyleProperty as i, spread as l, template as c, use as u } from "solid-js/web";
1
+ import { Dynamic as e, createComponent as t, effect as r, insert as n, isServer as o, memo as s, mergeProps as i, setStyleProperty as l, spread as c, template as u, use as a } from "solid-js/web";
2
2
 
3
- import { For as a, createComputed as f, createEffect as g, createMemo as d, createSignal as h, mergeProps as p, on as m, onCleanup as v, onMount as $, splitProps as S, untrack as z } from "solid-js";
3
+ import { For as f, createComputed as g, createEffect as d, createMemo as h, createSignal as p, mergeProps as m, on as $, onCleanup as v, onMount as S, splitProps as z, untrack as b } from "solid-js";
4
4
 
5
- var b, {min: w, max: I, abs: _, floor: x} = Math, y = (e, t, r) => w(r, I(t, e)), k = e => [ ...e ].sort((e, t) => e - t), O = setTimeout, T = clearTimeout, M = "function" == typeof queueMicrotask ? queueMicrotask : e => {
5
+ var w, {min: I, max: _, abs: x, floor: y} = Math, k = (e, t, r) => I(r, _(t, e)), O = e => [ ...e ].sort((e, t) => e - t), T = setTimeout, M = clearTimeout, L = "function" == typeof queueMicrotask ? queueMicrotask : e => {
6
6
  Promise.resolve().then(e);
7
- }, L = () => {
7
+ }, R = () => {
8
8
  let e;
9
9
  return [ new Promise(t => {
10
10
  e = t;
11
11
  }), e ];
12
- }, R = e => e.ownerDocument, C = e => e.defaultView, E = () => (null == b && (b = /iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0),
13
- b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) => {
14
- let f = !!u, g = !!a, d = 1, h = 0, p = 0, m = 0, v = 0, $ = 0, S = 0, z = 0, b = 0, x = null, y = [ 0, g ? I(a - 1, 0) : -1 ], k = 0, O = !1;
15
- const T = /* @__PURE__ */ new Set, M = () => m - p, L = () => M() + $ + v, R = e => r(e) - $, C = e => {
16
- e && (E() && 0 !== z || x && 1 === b ? $ += e : v += e);
12
+ }, C = e => e.ownerDocument, E = e => e.defaultView, q = () => (null == w && (w = /iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0),
13
+ w), P = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, $: l, v: c, S: u}, a = 0) => {
14
+ let f = !!u, g = !!a, d = 1, h = 0, p = 0, m = 0, $ = 0, v = 0, S = 0, z = 0, b = 0, w = null, y = [ 0, g ? _(a - 1, 0) : -1 ], k = 0, O = !1;
15
+ const T = /* @__PURE__ */ new Set, M = () => m - p, L = () => M() + v + $, R = e => r(e) - v, C = e => {
16
+ e && (q() && 0 !== z || w && 1 === b ? v += e : $ += e);
17
17
  };
18
18
  return {
19
19
  I: () => {
@@ -24,11 +24,11 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
24
24
  if (!O || g) return y;
25
25
  let r, n;
26
26
  if (S) [r, n] = y; else {
27
- let o = I(0, L()), s = o + h;
28
- f || (t = I(0, t), 1 !== z && (o -= t), 2 !== z && (s += t)), [r, n] = y = e(I(0, o), I(0, s)),
29
- x && (r = w(r, x[0]), n = I(n, x[1]));
27
+ let o = _(0, L()), s = o + h;
28
+ f || (t = _(0, t), 1 !== z && (o -= t), 2 !== z && (s += t)), [r, n] = y = e(_(0, o), _(0, s)),
29
+ w && (r = I(r, w[0]), n = _(n, w[1]));
30
30
  }
31
- return [ I(r, 0), w(n, l() - 1) ];
31
+ return [ _(r, 0), I(n, l() - 1) ];
32
32
  },
33
33
  k: e => t(e - p),
34
34
  O: s,
@@ -40,7 +40,7 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
40
40
  R: () => h,
41
41
  C: () => p,
42
42
  m: i,
43
- q: () => (S = v, v = 0, [ S, 2 === b ]),
43
+ q: () => (S = $, $ = 0, [ S, 2 === b ]),
44
44
  P: (e, t) => {
45
45
  const r = [ e, t ];
46
46
  return T.add(r), () => {
@@ -48,22 +48,22 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
48
48
  };
49
49
  },
50
50
  B: (r, l) => {
51
- let a, w, I = 0;
51
+ let a, I, _ = 0;
52
52
  switch (r) {
53
53
  case 1:
54
54
  {
55
55
  if (l === m && 0 === b) break;
56
56
  const e = S;
57
57
  S = 0;
58
- const t = l - m, r = _(t);
59
- e && r < _(e) + 1 || 0 !== b || (z = t < 0 ? 2 : 1), g && (g = !1), m = l, I = 4;
58
+ const t = l - m, r = x(t);
59
+ e && r < x(e) + 1 || 0 !== b || (z = t < 0 ? 2 : 1), g && (g = !1), m = l, _ = 4;
60
60
  const n = M();
61
- n >= -h && n <= i() && (I += 1, w = r > h);
61
+ n >= -h && n <= i() && (_ += 1, I = r > h);
62
62
  break;
63
63
  }
64
64
 
65
65
  case 2:
66
- I = 8, 0 !== z && (a = !0, I += 1), z = 0, b = 0, x = null;
66
+ _ = 8, 0 !== z && (a = !0, _ += 1), z = 0, b = 0, w = null;
67
67
  break;
68
68
 
69
69
  case 3:
@@ -72,7 +72,7 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
72
72
  if (!e.length) break;
73
73
  C(e.reduce((e, [t, r]) => {
74
74
  let o;
75
- if (2 === b) o = !0; else if (x && 1 === b) o = t < x[0]; else {
75
+ if (2 === b) o = !0; else if (w && 1 === b) o = t < w[0]; else {
76
76
  const e = M(), r = R(t), s = n(t);
77
77
  o = 1 !== z && 0 === b ? r + s <= e : r < e && r + s < e + h;
78
78
  }
@@ -82,16 +82,16 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
82
82
  const e = n(t), s = o(t, r);
83
83
  f && (k += s ? r : r - e);
84
84
  }
85
- f && h && k > h && (C(u(t(L()))), f = !1), I = 3, w = !0;
85
+ f && h && k > h && (C(u(t(L()))), f = !1), _ = 3, I = !0;
86
86
  break;
87
87
  }
88
88
 
89
89
  case 4:
90
- h !== l && (h || (O = w = !0), h = l, I = 3);
90
+ h !== l && (h || (O = I = !0), h = l, _ = 3);
91
91
  break;
92
92
 
93
93
  case 5:
94
- l[1] ? (C(c(l[0], !0)), b = 2, I = 1) : (c(l[0]), I = 1);
94
+ l[1] ? (C(c(l[0], !0)), b = 2, _ = 1) : (c(l[0]), _ = 1);
95
95
  break;
96
96
 
97
97
  case 6:
@@ -103,27 +103,27 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
103
103
  break;
104
104
 
105
105
  case 8:
106
- x = e(l, l + h), I = 1;
106
+ w = e(l, l + h), _ = 1;
107
107
  }
108
- I && (d = 1 + (2147483647 & d), a && $ && (v += $, $ = 0), T.forEach(([e, t]) => {
109
- I & e && t(w);
108
+ _ && (d = 1 + (2147483647 & d), a && v && ($ += v, v = 0), T.forEach(([e, t]) => {
109
+ _ & e && t(I);
110
110
  }));
111
111
  }
112
112
  };
113
- }, P = (e, t, r, n = 0, o = t - 1) => {
113
+ }, B = (e, t, r, n = 0, o = t - 1) => {
114
114
  let s = n;
115
115
  for (;n <= o; ) {
116
- const t = x((n + o) / 2);
116
+ const t = y((n + o) / 2);
117
117
  e(t) <= r ? (s = t, n = t + 1) : o = t - 1;
118
118
  }
119
- return y(s, 0, t - 1);
120
- }, B = (e, t, r) => {
119
+ return k(s, 0, t - 1);
120
+ }, D = (e, t, r) => {
121
121
  const n = r ? "unshift" : "push";
122
122
  for (let r = 0; r < t; r++) e[n](-1);
123
123
  return e;
124
- }, D = (e, t, r) => {
124
+ }, j = (e, t, r) => {
125
125
  let n = r && r[1] || t || 40, o = -1, s = 0;
126
- const i = r && r[0], l = i ? B(i.slice(0, w(e, i.length)), I(0, e - i.length)) : B([], e), c = B([], e + 1), u = e => {
126
+ const i = r && r[0], l = i ? D(i.slice(0, I(e, i.length)), _(0, e - i.length)) : D([], e), c = D([], e + 1), u = e => {
127
127
  const t = l[e];
128
128
  return -1 === t ? n : t;
129
129
  }, a = t => {
@@ -137,22 +137,22 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
137
137
  return {
138
138
  o: (t, r) => {
139
139
  let n, o;
140
- return s = w(s, e - 1), a(s) <= t ? (o = P(a, e, r, s), n = P(a, e, t, s, o)) : (n = P(a, e, t, void 0, s),
141
- o = P(a, e, r, n)), s = n, [ n, o ];
140
+ return s = I(s, e - 1), a(s) <= t ? (o = B(a, e, r, s), n = B(a, e, t, s, o)) : (n = B(a, e, t, void 0, s),
141
+ o = B(a, e, r, n)), s = n, [ n, o ];
142
142
  },
143
- i: t => P(a, e, t),
143
+ i: t => B(a, e, t),
144
144
  l: a,
145
145
  u,
146
146
  h: (e, t) => {
147
147
  const r = -1 === l[e];
148
- return l[e] = t, o = w(e, o), r;
148
+ return l[e] = t, o = I(e, o), r;
149
149
  },
150
150
  p: (e, t = -1) => l[e] === t,
151
151
  m: () => a(e),
152
- v: () => e,
153
- $: (t, r) => {
152
+ $: () => e,
153
+ v: (t, r) => {
154
154
  const s = t - e;
155
- return o = r ? -1 : w(t - 1, o), e = t, s > 0 ? (B(c, s), B(l, s, r), n * s) : (c.splice(s),
155
+ return o = r ? -1 : I(t - 1, o), e = t, s > 0 ? (D(c, s), D(l, s, r), n * s) : (c.splice(s),
156
156
  (r ? l.splice(0, -s) : l.splice(s)).reduce((e, t) => e - (-1 === t ? n : t), 0));
157
157
  },
158
158
  S: t ? void 0 : e => {
@@ -161,16 +161,16 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
161
161
  l.forEach((n, o) => {
162
162
  -1 !== n && (n && r.push(n), o < e && t++);
163
163
  }), o = -1;
164
- const s = k(r), i = s.length, c = i / 2 | 0, u = i % 2 == 0 ? (s[c - 1] + s[c]) / 2 : s[c], a = n;
165
- return ((n = u) - a) * I(e - t, 0);
164
+ const s = O(r), i = s.length, c = i / 2 | 0, u = i % 2 == 0 ? (s[c - 1] + s[c]) / 2 : s[c], a = n;
165
+ return ((n = u) - a) * _(e - t, 0);
166
166
  },
167
167
  D: () => [ l.slice(), n ]
168
168
  };
169
- }, j = e => {
169
+ }, H = e => {
170
170
  let t;
171
171
  return {
172
172
  j(r) {
173
- (t || (t = new (C(R(r)).ResizeObserver)(e))).observe(r);
173
+ (t || (t = new (E(C(r)).ResizeObserver)(e))).observe(r);
174
174
  },
175
175
  H(e) {
176
176
  t.unobserve(e);
@@ -179,20 +179,20 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
179
179
  t && t.disconnect();
180
180
  }
181
181
  };
182
- }, H = (e, t, r, n, o, s, i) => {
182
+ }, J = (e, t, r, n, o, s, i) => {
183
183
  let l, c, u = 0, a = !1, f = !1, g = !1, d = !1;
184
- const h = Date.now, p = n ? "scrollLeft" : "scrollTop", m = n ? "left" : "top", v = e => o ? -e : e, $ = () => v(r[p]), S = (e, t) => {
184
+ const h = Date.now, p = n ? "scrollLeft" : "scrollTop", m = n ? "left" : "top", $ = e => o ? -e : e, v = () => $(r[p]), S = (e, t) => {
185
185
  r.scrollTo({
186
- [m]: v(e),
186
+ [m]: $(e),
187
187
  behavior: t ? "smooth" : "instant"
188
188
  });
189
189
  }, z = () => {
190
190
  if (a || f) return a = !1, void b();
191
191
  g = !1, e.B(2);
192
192
  }, b = () => {
193
- T(c), c = O(z, 150);
193
+ M(c), c = T(z, 150);
194
194
  }, w = () => {
195
- u = h(), g && (d = !0), i && e.B(6, i()), e.B(1, $()), b();
195
+ u = h(), g && (d = !0), i && e.B(6, i()), e.B(1, v()), b();
196
196
  }, I = t => {
197
197
  if (a || !e.L() || t.ctrlKey) return;
198
198
  const r = h() - u;
@@ -200,7 +200,7 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
200
200
  }, _ = () => {
201
201
  f = !0, g = d = !1;
202
202
  }, x = () => {
203
- f = !1, E() && (g = !0);
203
+ f = !1, q() && (g = !0);
204
204
  };
205
205
  return t.addEventListener("scroll", w), t.addEventListener("wheel", I, {
206
206
  passive: !0
@@ -211,7 +211,7 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
211
211
  }), {
212
212
  J: () => {
213
213
  t.removeEventListener("scroll", w), t.removeEventListener("wheel", I), t.removeEventListener("touchstart", _),
214
- t.removeEventListener("touchend", x), T(c);
214
+ t.removeEventListener("touchend", x), M(c);
215
215
  },
216
216
  V: () => {
217
217
  const [t, n] = e.q();
@@ -219,18 +219,18 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
219
219
  d && s && s(), d = !1;
220
220
  const o = e.M() + t;
221
221
  o <= 0 || o >= e.C() + e.m() - e.R() ? S(o) : r.scrollBy({
222
- [m]: v(t),
222
+ [m]: $(t),
223
223
  behavior: "instant"
224
- }), n && (l && l(), e.R() > e.m() && e.B(1, $()));
224
+ }), n && (l && l(), e.R() > e.m() && e.B(1, v()));
225
225
  },
226
226
  W: (t, r) => {
227
227
  let n, o, s;
228
228
  l && l();
229
229
  const i = l = () => {
230
- n = !0, T(o), s && s();
230
+ n = !0, M(o), s && s();
231
231
  }, c = () => {
232
232
  if (!n) {
233
- if (e.R() && (T(o), o = O(i, 150)), r) {
233
+ if (e.R() && (M(o), o = T(i, 150)), r) {
234
234
  for (let [t, r] = e.o(0); t <= r; t++) if (e.O(t)) return;
235
235
  i();
236
236
  }
@@ -240,18 +240,18 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
240
240
  if (n) return;
241
241
  let t;
242
242
  s = e.P(2, () => {
243
- t || (t = !0, M(() => {
243
+ t || (t = !0, L(() => {
244
244
  t = !1, c();
245
245
  }));
246
246
  }), c();
247
247
  };
248
- r ? (e.B(8, t()), M(u)) : u();
248
+ r ? (e.B(8, t()), L(u)) : u();
249
249
  }
250
250
  };
251
- }, J = (e, t) => {
251
+ }, V = (e, t) => {
252
252
  e.U(() => t);
253
- }, V = (e, t, r, {align: n, smooth: o, offset: s = 0} = {}) => {
254
- if (r = y(r, 0, t.T() - 1), "nearest" === n) {
253
+ }, W = (e, t, r, {align: n, smooth: o, offset: s = 0} = {}) => {
254
+ if (r = k(r, 0, t.T() - 1), "nearest" === n) {
255
255
  const e = t.l(r), o = t.M();
256
256
  if (e < o) n = "start"; else {
257
257
  if (!(e + t.u(r) > o + t.R())) return;
@@ -259,14 +259,14 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
259
259
  }
260
260
  }
261
261
  e.U(() => s + e.X() + t.l(r) + ("end" === n ? t.u(r) - t.R() : "center" === n ? (t.u(r) - t.R()) / 2 : 0), o);
262
- }, W = r => {
262
+ }, U = r => {
263
263
  let n;
264
- r = p({
264
+ r = m({
265
265
  Y: "div"
266
- }, r), g(() => {
266
+ }, r), d(() => {
267
267
  n && v(r.A(n, r.F));
268
268
  });
269
- const s = d(() => {
269
+ const o = h(() => {
270
270
  const e = r.G, t = r.K, n = r.N, o = {
271
271
  contain: "layout style",
272
272
  position: t && n ? void 0 : "absolute",
@@ -282,48 +282,48 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
282
282
  return r.Y;
283
283
  },
284
284
  get index() {
285
- return o(() => "string" == typeof r.Y)() ? void 0 : r.F;
285
+ return s(() => "string" == typeof r.Y)() ? void 0 : r.F;
286
286
  },
287
287
  ref(e) {
288
288
  "function" == typeof n ? n(e) : n = e;
289
289
  },
290
290
  get style() {
291
- return s();
291
+ return o();
292
292
  },
293
293
  get children() {
294
294
  return r.ee;
295
295
  }
296
296
  });
297
- }, U = (e, t) => e[0] === t[0] && e[1] === t[1], X = r => {
297
+ }, X = (e, t) => e[0] === t[0] && e[1] === t[1], Y = r => {
298
298
  let n;
299
- const {itemSize: o, horizontal: s = !1, cache: i, ssrCount: l} = r;
300
- r = p({
299
+ const {itemSize: s, horizontal: i = !1, cache: l, ssrCount: c} = r;
300
+ r = m({
301
301
  as: "div"
302
302
  }, r);
303
- const [c, u] = h(!!l), S = D(r.data.length, o, i), b = q(S, l), w = ((e, t) => {
304
- let r, n, o = L();
305
- const s = t ? "width" : "height", i = /* @__PURE__ */ new WeakMap, l = j(t => {
306
- const n = [];
307
- for (const {target: o, contentRect: l} of t) if (o.offsetParent) if (o === r) e.B(4, l[s]); else {
308
- const e = i.get(o);
309
- null != e && n.push([ e, l[s] ]);
303
+ const [u, a] = p(!!c), z = j(r.data.length, s, l), w = P(z, c), I = ((e, t) => {
304
+ let r, n, o = R();
305
+ const s = /* @__PURE__ */ new WeakMap, i = H(n => {
306
+ const o = [];
307
+ for (const {target: i, contentRect: {width: l, height: c}} of n) if (i === r) (l || c) && e.B(4, t ? l : c); else if (i.offsetParent) {
308
+ const e = s.get(i);
309
+ null != e && o.push([ e, t ? l : c ]);
310
310
  }
311
- n.length && e.B(3, n);
311
+ o.length && e.B(3, o);
312
312
  });
313
313
  return {
314
- te(s, i = s.parentElement) {
315
- l.j(r = i), n = H(e, i, i, t, t && "rtl" === getComputedStyle(i).direction, () => {
316
- const e = t ? "overflowX" : "overflowY", r = i.style, n = r[e];
317
- r[e] = "hidden", O(() => {
314
+ te(s, l = s.parentElement) {
315
+ i.j(r = l), n = J(e, l, l, t, t && "rtl" === getComputedStyle(l).direction, () => {
316
+ const e = t ? "overflowX" : "overflowY", r = l.style, n = r[e];
317
+ r[e] = "hidden", T(() => {
318
318
  r[e] = n;
319
319
  });
320
320
  }), o[1](!0);
321
321
  },
322
322
  I() {
323
- l.J(), n && n.J(), o[1](!1), o = L();
323
+ i.J(), n && n.J(), o[1](!1), o = R();
324
324
  },
325
- re: (e, t) => (i.set(e, t), l.j(e), () => {
326
- i.delete(e), l.H(e);
325
+ re: (e, t) => (s.set(e, t), i.j(e), () => {
326
+ s.delete(e), i.H(e);
327
327
  }),
328
328
  async U(e, t) {
329
329
  await o[0] && n.W(e, t);
@@ -333,62 +333,62 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
333
333
  },
334
334
  X: e.C
335
335
  };
336
- })(b, s), [_, x] = h(b._());
337
- b.P(1, () => {
338
- x(b._());
339
- }), b.P(4, () => {
340
- r.onScroll?.(b.M());
341
- }), b.P(8, () => {
336
+ })(w, i), [x, y] = p(w._());
337
+ w.P(1, () => {
338
+ y(w._());
339
+ }), w.P(4, () => {
340
+ r.onScroll?.(w.M());
341
+ }), w.P(8, () => {
342
342
  r.onScrollEnd?.();
343
343
  });
344
- const y = d(e => {
345
- _();
346
- const t = b.o(r.bufferSize);
347
- return e && U(e, t) ? e : t;
348
- }), T = d(() => _() && b.L()), M = d(() => _() && b.m());
349
- $(() => {
350
- u(!1), r.ref && r.ref({
351
- get cache() {
352
- return S.D();
353
- },
354
- get scrollOffset() {
355
- return b.M();
356
- },
357
- get scrollSize() {
358
- return (e => I(e.m(), e.R()))(b);
359
- },
360
- get viewportSize() {
361
- return b.R();
362
- },
363
- findItemIndex: b.k,
364
- getItemOffset: b.l,
365
- getItemSize: b.u,
366
- scrollToIndex: (e, t) => V(w, b, e, t),
367
- scrollTo: e => J(w, e),
368
- scrollBy: e => ((e, t, r) => {
369
- J(e, r + t.M());
370
- })(w, b, e)
371
- }), w.te(n, r.scrollRef), v(() => {
372
- r.ref && r.ref(), b.I(), w.I();
344
+ const k = h(e => {
345
+ x();
346
+ const t = w.o(r.bufferSize);
347
+ return e && X(e, t) ? e : t;
348
+ }), M = h(() => x() && w.L()), L = h(() => x() && w.m()), C = r.ref;
349
+ !o && C && (C({
350
+ get cache() {
351
+ return z.D();
352
+ },
353
+ get scrollOffset() {
354
+ return w.M();
355
+ },
356
+ get scrollSize() {
357
+ return (e => _(e.m(), e.R()))(w);
358
+ },
359
+ get viewportSize() {
360
+ return w.R();
361
+ },
362
+ findItemIndex: w.k,
363
+ getItemOffset: w.l,
364
+ getItemSize: w.u,
365
+ scrollToIndex: (e, t) => W(I, w, e, t),
366
+ scrollTo: e => V(I, e),
367
+ scrollBy: e => ((e, t, r) => {
368
+ V(e, r + t.M());
369
+ })(I, w, e)
370
+ }), v(() => C())), S(() => {
371
+ a(!1), I.te(n, r.scrollRef), v(() => {
372
+ w.I(), I.I();
373
373
  });
374
- }), f(m(() => r.startMargin || 0, e => {
375
- e !== b.C() && b.B(6, e);
376
- })), g(m(_, () => {
377
- w.ne();
374
+ }), g($(() => r.startMargin || 0, e => {
375
+ e !== w.C() && w.B(6, e);
376
+ })), d($(x, () => {
377
+ I.ne();
378
378
  }));
379
- const R = d(() => {
379
+ const E = h(() => {
380
380
  const e = r.data.length;
381
- z(() => {
382
- e !== b.T() && b.B(5, [ e, r.shift ]);
381
+ b(() => {
382
+ e !== w.T() && w.B(5, [ e, r.shift ]);
383
383
  });
384
384
  const t = [], n = [];
385
385
  if (r.keepMounted) {
386
- const e = new Set(r.keepMounted);
387
- for (let [t, r] = y(); t <= r; t++) e.add(t);
388
- k([ ...e ]).forEach(e => {
389
- t.push(r.data[e]), n.push(e);
386
+ const o = new Set(r.keepMounted);
387
+ for (let [e, t] = k(); e <= t; e++) o.add(e);
388
+ O([ ...o ]).forEach(o => {
389
+ o < e && (t.push(r.data[o]), n.push(o));
390
390
  });
391
- } else for (let [e, o] = y(); e <= o; e++) t.push(r.data[e]), n.push(e);
391
+ } else for (let [e, o] = k(); e <= o; e++) t.push(r.data[e]), n.push(e);
392
392
  return {
393
393
  oe: t,
394
394
  se: n
@@ -407,19 +407,19 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
407
407
  "overflow-anchor": "none",
408
408
  flex: "none",
409
409
  position: "relative",
410
- width: s ? M() + "px" : "100%",
411
- height: s ? "100%" : M() + "px",
412
- "pointer-events": T() ? "none" : void 0
410
+ width: i ? L() + "px" : "100%",
411
+ height: i ? "100%" : L() + "px",
412
+ "pointer-events": M() ? "none" : void 0
413
413
  };
414
414
  },
415
415
  get children() {
416
- return t(a, {
416
+ return t(f, {
417
417
  get each() {
418
- return R().oe;
418
+ return E().oe;
419
419
  },
420
420
  children: (e, n) => ((e, n) => {
421
- const o = d(() => (_(), b.l(n()))), i = d(() => (_(), b.O(n()))), l = d(() => z(() => r.children(e, n)));
422
- return t(W, {
421
+ const o = h(() => (x(), w.l(n()))), s = h(() => (x(), w.O(n()))), l = h(() => b(() => r.children(e, n)));
422
+ return t(U, {
423
423
  get Y() {
424
424
  return r.item;
425
425
  },
@@ -427,29 +427,29 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
427
427
  return n();
428
428
  },
429
429
  get A() {
430
- return w.re;
430
+ return I.re;
431
431
  },
432
432
  get Z() {
433
433
  return o();
434
434
  },
435
435
  get K() {
436
- return i();
436
+ return s();
437
437
  },
438
438
  get ee() {
439
439
  return l();
440
440
  },
441
- G: s,
441
+ G: i,
442
442
  get N() {
443
- return c();
443
+ return u();
444
444
  }
445
445
  });
446
- })(e, d(() => R().se[n()]))
446
+ })(e, h(() => E().se[n()]))
447
447
  });
448
448
  }
449
449
  });
450
- }, Y = /*#__PURE__*/ c("<div>"), A = e => {
451
- const [r, o] = S(e, [ "ref", "data", "children", "bufferSize", "itemSize", "ssrCount", "shift", "horizontal", "keepMounted", "cache", "item", "onScroll", "onScrollEnd", "style" ]);
452
- return i = Y(), l(i, s(o, {
450
+ }, A = /*#__PURE__*/ u("<div>"), F = e => {
451
+ const [r, o] = z(e, [ "ref", "data", "children", "bufferSize", "itemSize", "ssrCount", "shift", "horizontal", "keepMounted", "cache", "item", "onScroll", "onScrollEnd", "style" ]);
452
+ return s = A(), c(s, i(o, {
453
453
  get style() {
454
454
  return {
455
455
  display: r.horizontal ? "inline-block" : "block",
@@ -460,7 +460,7 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
460
460
  ...r.style
461
461
  };
462
462
  }
463
- }), !1, !0), n(i, t(X, {
463
+ }), !1, !0), n(s, t(Y, {
464
464
  ref(e) {
465
465
  var t = r.ref;
466
466
  "function" == typeof t ? t(e) : r.ref = e;
@@ -501,42 +501,37 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
501
501
  get children() {
502
502
  return r.children;
503
503
  }
504
- })), i;
505
- var i;
506
- }, F = /*#__PURE__*/ c('<div style="contain:size style;overflow-anchor:none;flex:none;position:relative">'), G = e => {
507
- let o;
508
- const {ref: s, data: l, children: c, itemSize: f, ssrCount: p, shift: S, horizontal: b = !1, cache: w, onScrollEnd: I} = e, [_, x] = h(!!p), y = D(e.data.length, f, w), k = q(y, p), O = ((e, t) => {
509
- let r, n, o, s, i, l = L();
510
- const c = t ? "width" : "height", u = /* @__PURE__ */ new WeakMap, a = j(t => {
511
- const n = [];
512
- for (const {target: e, contentRect: o} of t) {
513
- if (e === r) {
514
- i && i();
515
- continue;
516
- }
517
- if (!e.offsetParent) continue;
518
- const t = u.get(e);
519
- null != t && n.push([ t, o[c] ]);
504
+ })), s;
505
+ var s;
506
+ }, G = /*#__PURE__*/ u('<div style="contain:size style;overflow-anchor:none;flex:none;position:relative">'), K = e => {
507
+ let s;
508
+ const {ref: i, data: c, children: u, itemSize: g, ssrCount: m, shift: z, horizontal: w = !1, cache: I, onScrollEnd: _} = e, [x, y] = p(!!m), k = j(e.data.length, g, I), O = P(k, m), T = ((e, t) => {
509
+ let r, n, o, s, i, l = R();
510
+ const c = /* @__PURE__ */ new WeakMap, u = H(n => {
511
+ const o = [];
512
+ for (const {target: e, contentRect: {width: s, height: l}} of n) if (e === r) i && i(); else if (e.offsetParent) {
513
+ const r = c.get(e);
514
+ null != r && o.push([ r, t ? s : l ]);
520
515
  }
521
- n.length && e.B(3, n);
516
+ o.length && e.B(3, o);
522
517
  });
523
518
  return {
524
519
  te(c) {
525
- const u = R(c), f = C(u), g = r = u.scrollingElement, d = t && "rtl" === getComputedStyle(g).direction, h = (e, t, r, n, o = 0) => {
520
+ const a = C(c), f = E(a), g = r = a.scrollingElement, d = t && "rtl" === getComputedStyle(g).direction, h = (e, t, r, n, o = 0) => {
526
521
  const s = n ? "offsetLeft" : "offsetTop", i = o + (d ? t.clientWidth - e[s] - e.offsetWidth : e[s]), l = e.offsetParent;
527
522
  return e !== r && l ? h(l, t, r, n, i) : i;
528
- }, p = s = () => h(c, g, u.body, t), m = i = () => {
523
+ }, p = s = () => h(c, g, a.body, t), m = i = () => {
529
524
  e.B(4, g[t ? "clientWidth" : "clientHeight"]);
530
525
  };
531
- f.addEventListener("resize", m), a.j(g), o = () => {
526
+ f.addEventListener("resize", m), u.j(g), o = () => {
532
527
  f.removeEventListener("resize", m);
533
- }, n = H(e, f, g, t, d, null, p), l[1](!0);
528
+ }, n = J(e, f, g, t, d, null, p), l[1](!0);
534
529
  },
535
530
  I() {
536
- o && o(), a.J(), n && n.J(), r = void 0, l[1](!1), l = L();
531
+ o && o(), u.J(), n && n.J(), l[1](!1), l = R();
537
532
  },
538
- re: (e, t) => (u.set(e, t), a.j(e), () => {
539
- u.delete(e), a.H(e);
533
+ re: (e, t) => (c.set(e, t), u.j(e), () => {
534
+ c.delete(e), u.H(e);
540
535
  }),
541
536
  async U(e, t) {
542
537
  await l[0] && n.W(e, t);
@@ -546,62 +541,62 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
546
541
  },
547
542
  X: () => s()
548
543
  };
549
- })(k, b), [T, M] = h(k._());
550
- k.P(1, () => {
551
- M(k._());
552
- }), k.P(4, () => {
544
+ })(O, w), [M, L] = p(O._());
545
+ O.P(1, () => {
546
+ L(O._());
547
+ }), O.P(4, () => {
553
548
  e.onScroll?.();
554
- }), k.P(8, () => {
549
+ }), O.P(8, () => {
555
550
  e.onScrollEnd?.();
556
551
  });
557
- const E = d(t => {
558
- T();
559
- const r = k.o(e.bufferSize);
560
- return t && U(t, r) ? t : r;
561
- }), P = d(() => T() && k.L()), B = d(() => T() && k.m());
562
- $(() => {
563
- x(!1), e.ref && e.ref({
564
- get cache() {
565
- return y.D();
566
- },
567
- get scrollOffset() {
568
- return k.M();
569
- },
570
- get viewportSize() {
571
- return k.R();
572
- },
573
- findItemIndex: k.k,
574
- getItemOffset: k.l,
575
- getItemSize: k.u,
576
- scrollToIndex: (e, t) => V(O, k, e, t)
577
- }), O.te(o), v(() => {
578
- e.ref && e.ref(), k.I(), O.I();
552
+ const q = h(t => {
553
+ M();
554
+ const r = O.o(e.bufferSize);
555
+ return t && X(t, r) ? t : r;
556
+ }), B = h(() => M() && O.L()), D = h(() => M() && O.m()), V = e.ref;
557
+ !o && V && (V({
558
+ get cache() {
559
+ return k.D();
560
+ },
561
+ get scrollOffset() {
562
+ return O.M();
563
+ },
564
+ get viewportSize() {
565
+ return O.R();
566
+ },
567
+ findItemIndex: O.k,
568
+ getItemOffset: O.l,
569
+ getItemSize: O.u,
570
+ scrollToIndex: (e, t) => W(T, O, e, t)
571
+ }), v(() => V())), S(() => {
572
+ y(!1), T.te(s), v(() => {
573
+ O.I(), T.I();
579
574
  });
580
- }), g(m(T, () => {
581
- O.ne();
575
+ }), d($(M, () => {
576
+ T.ne();
582
577
  }));
583
- const J = d(() => {
578
+ const Y = h(() => {
584
579
  const t = e.data.length;
585
- z(() => {
586
- t !== k.T() && k.B(5, [ t, e.shift ]);
580
+ b(() => {
581
+ t !== O.T() && O.B(5, [ t, e.shift ]);
587
582
  });
588
583
  const r = [];
589
- for (let [t, n] = E(); t <= n; t++) r.push(e.data[t]);
584
+ for (let [t, n] = q(); t <= n; t++) r.push(e.data[t]);
590
585
  return r;
591
586
  });
592
- return X = F(), "function" == typeof o ? u(o, X) : o = X, n(X, t(a, {
587
+ return A = G(), "function" == typeof s ? a(s, A) : s = A, n(A, t(f, {
593
588
  get each() {
594
- return J();
589
+ return Y();
595
590
  },
596
591
  children: (r, n) => {
597
- const o = d(() => E()[0] + n()), s = d(() => (T(), k.l(o()))), i = d(() => (T(),
598
- k.O(o()))), l = d(() => z(() => e.children(r, o)));
599
- return t(W, {
592
+ const o = h(() => q()[0] + n()), s = h(() => (M(), O.l(o()))), i = h(() => (M(),
593
+ O.O(o()))), l = h(() => b(() => e.children(r, o)));
594
+ return t(U, {
600
595
  get F() {
601
596
  return o();
602
597
  },
603
598
  get A() {
604
- return O.re;
599
+ return T.re;
605
600
  },
606
601
  get Z() {
607
602
  return s();
@@ -612,23 +607,23 @@ b), q = ({o: e, i: t, l: r, u: n, h: o, p: s, m: i, v: l, $: c, S: u}, a = 0) =>
612
607
  get ee() {
613
608
  return l();
614
609
  },
615
- G: b,
610
+ G: w,
616
611
  get N() {
617
- return _();
612
+ return x();
618
613
  }
619
614
  });
620
615
  }
621
616
  })), r(e => {
622
- var t = b ? B() + "px" : "100%", r = b ? "100%" : B() + "px", n = P() ? "none" : void 0;
623
- return t !== e.e && i(X, "width", e.e = t), r !== e.t && i(X, "height", e.t = r),
624
- n !== e.a && i(X, "pointer-events", e.a = n), e;
617
+ var t = w ? D() + "px" : "100%", r = w ? "100%" : D() + "px", n = B() ? "none" : void 0;
618
+ return t !== e.e && l(A, "width", e.e = t), r !== e.t && l(A, "height", e.t = r),
619
+ n !== e.a && l(A, "pointer-events", e.a = n), e;
625
620
  }, {
626
621
  e: void 0,
627
622
  t: void 0,
628
623
  a: void 0
629
- }), X;
630
- var X;
624
+ }), A;
625
+ var A;
631
626
  };
632
627
 
633
- export { A as VList, X as Virtualizer, G as WindowVirtualizer };
628
+ export { F as VList, Y as Virtualizer, K as WindowVirtualizer };
634
629
  //# sourceMappingURL=index.js.map