virtua 0.53.3 → 0.53.5

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 (51) hide show
  1. package/README.md +37 -32
  2. package/lib/angular/VGrid.d.ts +1 -1
  3. package/lib/angular/VList.d.ts +1 -1
  4. package/lib/angular/VMasonry.d.ts +1 -1
  5. package/lib/angular/Virtualizer.d.ts +1 -1
  6. package/lib/angular/WindowVirtualizer.d.ts +1 -1
  7. package/lib/angular/index.js +588 -586
  8. package/lib/angular/index.js.map +1 -1
  9. package/lib/core/index.cjs +415 -412
  10. package/lib/core/index.cjs.map +1 -1
  11. package/lib/core/index.d.ts +2 -2
  12. package/lib/core/index.js +426 -423
  13. package/lib/core/index.js.map +1 -1
  14. package/lib/index.cjs +647 -645
  15. package/lib/index.cjs.map +1 -1
  16. package/lib/index.js +641 -639
  17. package/lib/index.js.map +1 -1
  18. package/lib/react/VGrid.d.ts +1 -1
  19. package/lib/react/VMasonry.d.ts +1 -1
  20. package/lib/react/Virtualizer.d.ts +1 -1
  21. package/lib/react/WindowVirtualizer.d.ts +1 -1
  22. package/lib/solid/VGrid.d.ts +1 -1
  23. package/lib/solid/VMasonry.d.ts +1 -1
  24. package/lib/solid/Virtualizer.d.ts +1 -1
  25. package/lib/solid/WindowVirtualizer.d.ts +1 -1
  26. package/lib/solid/index.cjs +674 -671
  27. package/lib/solid/index.cjs.map +1 -1
  28. package/lib/solid/index.js +673 -671
  29. package/lib/solid/index.js.map +1 -1
  30. package/lib/solid/index.jsx +167 -216
  31. package/lib/solid/index.jsx.map +1 -1
  32. package/lib/svelte/GridRow.svelte +3 -1
  33. package/lib/svelte/GridRowGroup.svelte +3 -1
  34. package/lib/svelte/VGrid.svelte +18 -21
  35. package/lib/svelte/VGrid.type.d.ts +1 -1
  36. package/lib/svelte/VMasonry.svelte +13 -15
  37. package/lib/svelte/VMasonry.type.d.ts +1 -1
  38. package/lib/svelte/Virtualizer.svelte +12 -13
  39. package/lib/svelte/Virtualizer.type.d.ts +1 -1
  40. package/lib/svelte/WindowVirtualizer.svelte +11 -10
  41. package/lib/svelte/WindowVirtualizer.type.d.ts +1 -1
  42. package/lib/vue/VGrid.d.ts +1 -1
  43. package/lib/vue/VMasonry.d.ts +1 -1
  44. package/lib/vue/Virtualizer.d.ts +1 -1
  45. package/lib/vue/WindowVirtualizer.d.ts +1 -1
  46. package/lib/vue/index.cjs +802 -797
  47. package/lib/vue/index.cjs.map +1 -1
  48. package/lib/vue/index.js +773 -768
  49. package/lib/vue/index.js.map +1 -1
  50. package/package.json +1 -1
  51. package/lib/core/observer.d.ts +0 -1
@@ -1,10 +1,10 @@
1
1
  import * as e from "@angular/core";
2
2
 
3
- import { ApplicationRef as t, ChangeDetectionStrategy as i, DestroyRef as s, ElementRef as r, HostAttributeToken as n, InjectionToken as o, TemplateRef as l, afterNextRender as a, afterRenderEffect as c, computed as u, contentChild as p, effect as m, inject as d, input as h, output as f, signal as g, untracked as S, viewChild as y } from "@angular/core";
3
+ import { ApplicationRef as t, ChangeDetectionStrategy as i, DestroyRef as s, ElementRef as n, HostAttributeToken as r, InjectionToken as o, TemplateRef as l, afterNextRender as a, afterRenderEffect as c, computed as u, contentChild as p, effect as m, inject as d, input as h, output as f, signal as g, untracked as S, viewChild as y } from "@angular/core";
4
4
 
5
5
  import { NgTemplateOutlet as v } from "@angular/common";
6
6
 
7
- var z, N = [], {min: w, max: b, abs: $, floor: R} = Math, P = (e, t, i) => w(i, b(t, e)), I = e => e.sort((e, t) => e - t), x = setTimeout, q = clearTimeout, F = "function" == typeof queueMicrotask ? queueMicrotask : e => {
7
+ var z, N = [], {min: w, max: b, abs: $, floor: R} = Math, I = (e, t, i) => w(i, b(t, e)), P = e => e.sort((e, t) => e - t), x = setTimeout, q = clearTimeout, F = "function" == typeof queueMicrotask ? queueMicrotask : e => {
8
8
  Promise.resolve().then(e);
9
9
  }, k = () => {
10
10
  let e;
@@ -12,167 +12,177 @@ var z, N = [], {min: w, max: b, abs: $, floor: R} = Math, P = (e, t, i) => w(i,
12
12
  e = t;
13
13
  }), e ];
14
14
  }, O = e => e.ownerDocument, C = e => e.defaultView, T = () => (null == z && (z = /iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0),
15
- z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $getItemOffset: t, $getItemSize: i, $isSizeEqual: s, $getTotalSize: r, $getLength: n, $setLength: o, $isEstimating: l, $resize: a}, c = 0) => {
15
+ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = (e, t, i, s) => {
16
+ const n = e.t(), r = t.$getItemOffset(n);
17
+ t.$relayout(i, s) && e.$update(6, t.$getItemOffset(n) - r);
18
+ }, V = ({$getRange: e, $findIndex: t, $getItemOffset: i, $getItemSize: s, $setItemSizes: n, $getTotalSize: r, $getLength: o, $setLength: l, $isEstimating: a}, c = 0) => {
16
19
  let u = !!c, p = 1, m = 0, d = 0, h = 0, f = 0, g = 0, S = 0, y = 0, v = 0, z = null, N = [ 0, u ? b(c - 1, 0) : -1 ], R = !1;
17
- const P = /* @__PURE__ */ new Set, I = () => h - d, x = () => I() + g + f, q = e => t(e) - g, F = e => {
18
- if (2 === v) return !0;
19
- if (z && 1 === v) return e < z[0];
20
- const t = I(), s = q(e), r = i(e);
21
- return 1 !== y && 0 === v ? s + r <= t : s < t && s + r < t + m;
22
- }, k = e => {
20
+ const I = /* @__PURE__ */ new Set, P = () => h - d, x = () => P() + g + f, q = (e, t) => {
21
+ const n = i(e), r = s(e);
22
+ return 1 !== y && 0 === v ? n + r <= t : n < t && n + r < t + m;
23
+ }, F = e => {
23
24
  e && (T() && 0 !== y || z && 1 === v ? g += e : f += e);
25
+ }, k = () => {
26
+ const e = o();
27
+ if (2 === v) return e;
28
+ if (z && 1 === v) return w(z[0], e);
29
+ const i = x();
30
+ let s = t(i);
31
+ for (;s > 0 && !q(s - 1, i); ) s--;
32
+ for (;s < e && q(s, i); ) s++;
33
+ return s;
24
34
  };
25
35
  return {
26
36
  $dispose: () => {
27
- P.clear();
37
+ I.clear();
28
38
  },
29
39
  $getStateVersion: () => p,
30
40
  $getRange: (t = 200) => {
31
41
  if (!R || u) return N;
32
42
  let i, s;
33
43
  if (S) [i, s] = N; else {
34
- let r = b(0, x()), n = r + m;
35
- l() || (t = b(0, t), 1 !== y && (r -= t), 2 !== y && (n += t)), [i, s] = N = e(b(0, r), b(0, n)),
44
+ let n = b(0, x()), r = n + m;
45
+ a() || (t = b(0, t), 1 !== y && (n -= t), 2 !== y && (r += t)), [i, s] = N = e(b(0, n), b(0, r)),
36
46
  z && (i = w(i, z[0]), s = b(s, z[1]));
37
47
  }
38
- return [ b(i, 0), w(s, n() - 1) ];
48
+ return [ b(i, 0), w(s, o() - 1) ];
39
49
  },
40
- $isUnmeasuredItem: s,
41
- $getItemOffset: q,
42
- $getItemSize: i,
43
- $getItemsLength: n,
50
+ t: k,
51
+ $getItemOffset: e => i(e) - g,
44
52
  $getScrollOffset: () => h,
45
- $getVisibleOffset: x,
46
53
  $isScrolling: () => 0 !== y,
47
54
  $getViewportSize: () => m,
48
55
  $getStartSpacerSize: () => d,
49
56
  $getTotalSize: r,
50
- t: () => (S = f, f = 0, [ S, 2 === v ]),
57
+ i: () => (S = f, f = 0, [ S, 2 === v ]),
51
58
  $subscribe: (e, t) => {
52
59
  const i = [ e, t ];
53
- return P.add(i), () => {
54
- P.delete(i);
60
+ return I.add(i), () => {
61
+ I.delete(i);
55
62
  };
56
63
  },
57
- $update: (t, i) => {
58
- let n, l, c = 0;
64
+ $update: (t, s, a) => {
65
+ let c, N, w = 0;
59
66
  switch (t) {
60
67
  case 1:
61
68
  {
62
- if (i === h && 0 === v) break;
69
+ if (s === h && 0 === v) break;
63
70
  const e = S;
64
71
  S = 0;
65
- const t = i - h, s = $(t);
66
- e && s < $(e) + 1 || 0 !== v || (y = t < 0 ? 2 : 1), u && (u = !1), h = i, c = 4;
67
- const n = I();
68
- n >= -m && n <= r() && (c += 1, l = s > m);
72
+ const t = s - h, i = $(t);
73
+ e && i < $(e) + 1 || 0 !== v || (y = t < 0 ? 2 : 1), u && (u = !1), h = s, w = 4;
74
+ const n = P();
75
+ n >= -m && n <= r() && (w += 1, N = i > m);
69
76
  break;
70
77
  }
71
78
 
72
79
  case 2:
73
- c = 8, 0 !== y && (n = !0, c += 1), y = 0, v = 0, z = null;
80
+ w = 8, 0 !== y && (c = !0, w += 1), y = 0, v = 0, z = null;
74
81
  break;
75
82
 
76
83
  case 3:
77
- {
78
- const e = i.filter(([e, t]) => !s(e, t));
79
- if (!e.length) break;
80
- k(a(e, F, x(), m)), c = 3, l = !0;
81
- break;
84
+ if (s.length) {
85
+ const e = k(), t = i(e);
86
+ n(s, m), F(i(e) - t), w = 3, N = !0;
82
87
  }
88
+ break;
83
89
 
84
90
  case 4:
85
- m !== i && (m || (R = l = !0), m = i, c = 3);
91
+ m !== s && (m || (R = N = !0), m = s, w = 3);
86
92
  break;
87
93
 
88
94
  case 5:
89
- i[1] ? (k(o(i[0], !0)), v = 2, c = 1) : (o(i[0]), c = 1);
95
+ if (s !== o()) {
96
+ if (a) {
97
+ const e = r();
98
+ l(s, !0), F(r() - e), v = 2;
99
+ } else l(s);
100
+ w = 1;
101
+ }
90
102
  break;
91
103
 
92
104
  case 6:
93
- d = i;
105
+ F(s), w = 1;
94
106
  break;
95
107
 
96
108
  case 7:
97
- v = 1;
109
+ d = s;
98
110
  break;
99
111
 
100
- case 9:
101
- null != i && (k(i), c = 1);
112
+ case 8:
113
+ v = 1;
102
114
  break;
103
115
 
104
- case 8:
105
- z = e(i, i + m), c = 1;
116
+ case 9:
117
+ z = e(s, s + m), w = 1;
106
118
  }
107
- c && (p = 1 + (2147483647 & p), n && g && (f += g, g = 0), P.forEach(([e, t]) => {
108
- c & e && t(l);
119
+ w && (p = 1 + (2147483647 & p), c && g && (f += g, g = 0), I.forEach(([e, t]) => {
120
+ w & e && t(N);
109
121
  }));
110
122
  }
111
123
  };
112
- }, V = (e, t, i) => {
124
+ }, E = (e, t, i) => {
113
125
  const s = i ? "unshift" : "push";
114
126
  for (let i = 0; i < t; i++) e[s](-1);
115
127
  return e;
116
- }, E = (e, t, i, s = 0, r = t - 1) => {
117
- let n = s;
118
- for (;s <= r; ) {
119
- const t = R((s + r) / 2);
120
- e(t) <= i ? (n = t, s = t + 1) : r = t - 1;
128
+ }, K = (e, t, i, s = 0, n = t - 1) => {
129
+ let r = s;
130
+ for (;s <= n; ) {
131
+ const t = R((s + n) / 2);
132
+ e(t) <= i ? (r = t, s = t + 1) : n = t - 1;
121
133
  }
122
- return P(n, 0, t - 1);
134
+ return I(r, 0, t - 1);
123
135
  }, L = (e, t, i) => {
124
- let s = i && i[1] || t || 40, r = -1, n = 0, o = !t, l = 0;
125
- const a = i && i[0], c = a ? V(a.slice(0, w(e, a.length)), b(0, e - a.length)) : V([], e), u = V([], e + 1), p = e => {
126
- const t = c[e];
136
+ let s = i && i[1] || t || 40, n = -1, r = 0, o = !t, l = 0;
137
+ const a = i ? i[0].slice(0, e) : [];
138
+ E(a, e - a.length);
139
+ const c = E([], e + 1), u = e => {
140
+ const t = a[e];
127
141
  return -1 === t ? s : t;
128
- }, m = t => {
142
+ }, p = t => {
129
143
  if (!e) return 0;
130
- if (r >= t) return u[t];
131
- r < 0 && (u[0] = 0, r = 0);
132
- let i = r, s = u[i];
133
- for (;i < t; ) s += p(i), u[++i] = s;
134
- return r = t, s;
144
+ if (n >= t) return c[t];
145
+ n < 0 && (c[0] = 0, n = 0);
146
+ let i = n, s = c[i];
147
+ for (;i < t; ) s += u(i), c[++i] = s;
148
+ return n = t, s;
135
149
  };
136
150
  return {
137
151
  $getRange: (t, i) => {
138
- let s, r;
139
- return l = w(l, e - 1), m(l) <= t ? (r = E(m, e, i, l), s = E(m, e, t, l, r)) : (s = E(m, e, t, void 0, l),
140
- r = E(m, e, i, s)), l = s, [ s, r ];
152
+ let s, n;
153
+ return l = w(l, e - 1), p(l) <= t ? (n = K(p, e, i, l), s = K(p, e, t, l, n)) : (s = K(p, e, t, void 0, l),
154
+ n = K(p, e, i, s)), l = s, [ s, n ];
141
155
  },
142
- $findIndex: t => E(m, e, t),
143
- $getItemOffset: m,
144
- $getItemSize: p,
145
- $isSizeEqual: (e, t = -1) => c[e] === t,
146
- $resize: (t, i, l, a) => {
147
- let u = t.reduce((e, [t, s]) => i(t) ? e + (s - p(t)) : e, 0);
148
- for (const [e, i] of t) n += -1 === c[e] ? i : i - p(e), c[e] = i, r = w(e, r);
149
- if (o && a && n > a) {
150
- let t = 0;
151
- const i = E(m, e, l + u), n = [];
152
- c.forEach((e, s) => {
153
- -1 !== e && (e && n.push(e), s < i && t++);
154
- }), r = -1, I(n);
155
- const a = n.length, p = a / 2 | 0, d = a % 2 == 0 ? (n[p - 1] + n[p]) / 2 : n[p], h = s;
156
- u += ((s = d) - h) * b(i - t, 0), o = !1;
156
+ $findIndex: t => K(p, e, t),
157
+ $getItemOffset: p,
158
+ $getItemSize: u,
159
+ $isSizeEqual: (e, t = -1) => a[e] === t,
160
+ $setItemSizes: (e, t) => {
161
+ for (const [t, i] of e) r += -1 === a[t] ? i : i - u(t), a[t] = i, n = w(t, n);
162
+ if (o && t && r > t) {
163
+ const e = [];
164
+ a.forEach(t => {
165
+ -1 !== t && t && e.push(t);
166
+ }), n = -1, P(e);
167
+ const t = e.length, i = t / 2 | 0;
168
+ s = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], o = !1;
157
169
  }
158
- return u;
159
170
  },
160
- $getTotalSize: () => m(e),
171
+ $getTotalSize: () => p(e),
161
172
  $getLength: () => e,
162
173
  $setLength: (t, i) => {
163
- const n = t - e;
164
- return r = i ? -1 : w(t - 1, r), e = t, n > 0 ? (V(u, n), V(c, n, i), s * n) : (u.splice(n),
165
- (i ? c.splice(0, -n) : c.splice(n)).reduce((e, t) => e - (-1 === t ? s : t), 0));
174
+ const s = t - e;
175
+ n = i ? -1 : w(t - 1, n), e = t, s > 0 ? (E(c, s), E(a, s, i)) : (c.splice(s), i ? a.splice(0, -s) : a.splice(s));
166
176
  },
167
177
  $isEstimating: () => o,
168
- $snapshot: () => [ c.slice(), s ]
178
+ $snapshot: () => [ a.slice(), s ]
169
179
  };
170
- }, K = e => "number" == typeof e ? e : e.length, D = (e, t) => "number" == typeof e ? t : e[t], G = (e, t, i = 0) => {
171
- let s = K(e);
172
- const r = "number" == typeof t, n = "auto" === t;
173
- let o = (r ? t : 40) + i, l = -1, a = 0, c = n, u = 0, p = 0, m = null;
174
- const d = [], h = [], f = [], g = e => n || !!f[e], S = () => {
175
- d.length || V(d, s);
180
+ }, D = e => "number" == typeof e ? e : e.length, G = (e, t) => "number" == typeof e ? t : e[t], W = (e, t, i = 0) => {
181
+ let s = D(e);
182
+ const n = "number" == typeof t, r = "auto" === t;
183
+ let o = (n ? t : 40) + i, l = -1, a = 0, c = r, u = 0, p = 0, m = null;
184
+ const d = [], h = [], f = [], g = e => r || !!f[e], S = () => {
185
+ d.length || E(d, s);
176
186
  }, y = e => {
177
187
  const t = d[e];
178
188
  return -1 === t ? o : t;
@@ -186,28 +196,25 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
186
196
  return l = e, i;
187
197
  }, z = (e, t) => {
188
198
  d[e] = t, l = w(e, l);
189
- }, N = e => d.length ? E(v, s, e) : o ? P(R(e / o), 0, s - 1) : 0, $ = () => w(u, s), x = () => b(s - p, $()), q = e => (d.length ? y(e) : o) - i;
199
+ }, N = e => d.length ? K(v, s, e) : o ? I(R(e / o), 0, s - 1) : 0, $ = () => w(u, s), x = () => b(s - p, $()), q = e => (d.length ? y(e) : o) - i;
190
200
  return {
191
201
  $getRange: (e, t) => {
192
- const r = v($()), n = v(s) - v(x()), o = e + (r ? r - i : 0);
193
- return [ N(o), N(b(o, t - (n ? n - i : 0))) ];
202
+ const n = v($()), r = v(s) - v(x()), o = e + (n ? n - i : 0);
203
+ return [ N(o), N(b(o, t - (r ? r - i : 0))) ];
194
204
  },
195
205
  $findIndex: N,
196
206
  $getItemOffset: v,
197
207
  $getItemSize: q,
198
- $resize: (e, t, s, r) => {
199
- let n = e.reduce((e, [i, s]) => g(i) && t(i) ? e + (s - q(i)) : e, 0);
208
+ $setItemSizes: (e, t) => {
200
209
  for (const [t, s] of e) g(t) && (S(), a += -1 === d[t] ? s : s - q(t), z(t, s + i));
201
- if (c && r && a > r) {
202
- let e = 0;
203
- const t = N(s + n), i = [];
204
- d.forEach((s, r) => {
205
- -1 !== s && (s && i.push(s), r < t && e++);
206
- }), l = -1, I(i);
207
- const r = i.length, a = r / 2 | 0, u = r % 2 == 0 ? (i[a - 1] + i[a]) / 2 : i[a], p = o;
208
- n += ((o = u) - p) * b(t - e, 0), c = !1;
210
+ if (c && t && a > t) {
211
+ const e = [];
212
+ d.forEach(t => {
213
+ -1 !== t && t && e.push(t);
214
+ }), l = -1, P(e);
215
+ const t = e.length, i = t / 2 | 0;
216
+ o = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], c = !1;
209
217
  }
210
- return n;
211
218
  },
212
219
  $isSizeEqual: (e, t = -1) => {
213
220
  const s = d.length ? d[e] : -1;
@@ -217,7 +224,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
217
224
  $getLength: () => s,
218
225
  $setLength: e => {
219
226
  const t = e - s;
220
- return l = w(e - 1, l), s = e, d.length && (t > 0 ? V(d, t) : d.splice(t)), 0;
227
+ l = w(e - 1, l), s = e, d.length && (t > 0 ? E(d, t) : d.splice(t));
221
228
  },
222
229
  $isEstimating: () => c,
223
230
  $isMeasurable: g,
@@ -226,234 +233,236 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
226
233
  },
227
234
  $getPinnedStart: $,
228
235
  $getTrailStart: x,
229
- $getSizes: (e, t) => "number" == typeof t ? r ? t : null : r || n || "auto" === t ? null : e.map(e => null != e ? e[t] : null),
230
- $relayout: (e, t) => {
231
- if (null == e) return;
236
+ $getSizes: (e, t) => "number" == typeof t ? n ? t : null : n || r || "auto" === t ? null : e.map(e => null != e ? e[t] : null),
237
+ $relayout: e => {
238
+ if (null == e) return !1;
232
239
  if ("number" == typeof e) {
233
- const s = e + i;
234
- if (s === o) return;
235
- const r = N(t) * (s - o);
236
- return o = s, r;
240
+ const t = e + i;
241
+ return t !== o && (o = t, !0);
237
242
  }
238
- if (e === m && s === f.length) return;
243
+ if (e === m && s === f.length) return !1;
239
244
  m = e, f.length = s, S();
240
- const r = N(t), n = v(r);
241
- let l;
242
- for (let t = 0; t < s; t++) {
243
- const s = e[t], r = "number" != typeof s;
244
- if (!r || !f[t]) {
245
- f[t] = r;
245
+ let t = !1;
246
+ for (let n = 0; n < s; n++) {
247
+ const s = e[n], r = "number" != typeof s;
248
+ if (!r || !f[n]) {
249
+ f[n] = r;
246
250
  const e = r ? -1 : s + i;
247
- d[t] !== e && (z(t, e), l = !0);
251
+ d[n] !== e && (z(n, e), t = !0);
248
252
  }
249
253
  }
250
- return l ? v(r) - n : void 0;
254
+ return t;
251
255
  }
252
256
  };
253
- }, W = /*#__PURE__*/ new WeakMap, B = (e, t, i) => {
257
+ }, B = /*#__PURE__*/ new WeakMap, H = (e, t, i) => {
254
258
  const s = [];
255
- for (const r of e) r >= t && r < i && s.push(r);
256
- return I(s);
257
- }, H = (e, t, i) => {
259
+ for (const n of e) n >= t && n < i && s.push(n);
260
+ return P(s);
261
+ }, j = (e, t, i) => {
258
262
  if (t >= i) return -1;
259
- let s = 0, r = e.length;
260
- for (;s < r; ) {
261
- const i = s + r >> 1;
262
- e[i] <= t ? s = i + 1 : r = i;
263
+ let s = 0, n = e.length;
264
+ for (;s < n; ) {
265
+ const i = s + n >> 1;
266
+ e[i] <= t ? s = i + 1 : n = i;
263
267
  }
264
268
  return s - 1;
265
- }, j = (e, t, i, s, r) => {
266
- const n = t.length;
267
- for (;i < n && t[i] < s; i++) {
269
+ }, A = (e, t, i, s, n) => {
270
+ const r = t.length;
271
+ for (;i < r && t[i] < s; i++) {
268
272
  const s = t[i];
269
- s > r && (e.push(s), r = s);
273
+ s > n && (e.push(s), n = s);
270
274
  }
271
275
  return i;
272
- }, A = (e, t, i, s, r, n) => {
276
+ }, Q = (e, t, i, s, n, r) => {
273
277
  const o = [];
274
278
  for (let e = 0; e < i; e++) o.push(e);
275
- const l = j(o, e, 0, s, i - 1);
276
- for (let e = s; e <= r; e++) o.push(e);
277
- j(o, e, l, n, r);
278
- for (let e = n; e < t; e++) o.push(e);
279
+ const l = A(o, e, 0, s, i - 1);
280
+ for (let e = s; e <= n; e++) o.push(e);
281
+ A(o, e, l, r, n);
282
+ for (let e = r; e < t; e++) o.push(e);
279
283
  return o;
280
- }, Q = (e, t) => w(e.rowIndex + (e.rowSpan || 1), t), J = (e, t) => w(e.colIndex + (e.colSpan || 1), t), X = (e, t, i, s, r, n) => {
284
+ }, J = (e, t) => w(e.rowIndex + (e.rowSpan || 1), t), X = (e, t) => w(e.colIndex + (e.colSpan || 1), t), Y = (e, t, i, s, n, r) => {
281
285
  const o = t.length, l = s.length;
282
286
  let a = "[l0]", c = 0, u = 0, p = 0;
283
- for (;c < n; ) {
287
+ for (;c < r; ) {
284
288
  for (;p < l && s[p] <= c; ) p++;
285
- const m = u < o ? t[u] : n;
289
+ const m = u < o ? t[u] : r;
286
290
  let d, h;
287
291
  if (m === c) {
288
292
  d = c + 1;
289
293
  const t = i[u];
290
- h = null == t ? e.$getItemSize(c) + "px" : t ? r : "minmax(" + e.$getItemSize(c) + "px,auto)",
294
+ h = null == t ? e.$getItemSize(c) + "px" : t ? n : "minmax(" + e.$getItemSize(c) + "px,auto)",
291
295
  u++;
292
- } else d = w(m, p < l ? s[p] : n), h = "minmax(" + (e.$getItemOffset(d - 1) + e.$getItemSize(d - 1) - e.$getItemOffset(c)) + "px,auto)";
296
+ } else d = w(m, p < l ? s[p] : r), h = "minmax(" + (e.$getItemOffset(d - 1) + e.$getItemSize(d - 1) - e.$getItemOffset(c)) + "px,auto)";
293
297
  a += " " + h + " [l" + d + "]", c = d;
294
298
  }
295
299
  return a;
296
- }, Y = (e, t, i, s, r) => {
297
- const n = {
300
+ }, U = (e, t, i, s, n) => {
301
+ const r = {
298
302
  display: "grid",
299
303
  gridTemplateRows: "subgrid",
300
304
  gridTemplateColumns: "subgrid",
301
305
  gridColumn: "1/-1",
302
306
  gridRow: "l" + e + "/l" + t
303
307
  };
304
- return null != i && (n.position = "sticky", n[s] = i + "px", n.zIndex = r), n;
305
- }, U = e => {
308
+ return null != i && (r.position = "sticky", r[s] = i + "px", r.zIndex = n), r;
309
+ }, Z = e => {
306
310
  let t;
307
311
  return {
308
- i(i) {
312
+ o(i) {
309
313
  (t || (t = new (C(O(i)).ResizeObserver)(e))).observe(i);
310
314
  },
311
- o(e) {
315
+ l(e) {
312
316
  t.unobserve(e);
313
317
  },
314
- l() {
318
+ u() {
315
319
  t && t.disconnect();
316
320
  }
317
321
  };
318
- }, Z = (e, t, i, s, r, n, o) => {
319
- let l, a, c = 0, u = !1, p = !1, m = !1, d = !1;
320
- const h = Date.now, f = s ? "scrollLeft" : "scrollTop", g = s ? "left" : "top", S = e => r ? -e : e, y = () => S(i[f]), v = (e, t) => {
321
- i.scrollTo({
322
- [g]: S(e),
322
+ }, ee = (e, t, i, s, n, r, o, l) => {
323
+ let a, c, u = 0, p = !1, m = !1, d = !1, h = !1;
324
+ const f = Date.now, g = n ? "scrollLeft" : "scrollTop", S = n ? "left" : "top", y = e => r ? -e : e, v = () => y(s[g]), z = (e, t) => {
325
+ s.scrollTo({
326
+ [S]: y(e),
323
327
  behavior: t ? "smooth" : "instant"
324
328
  });
325
- }, z = () => {
326
- if (u || p) return u = !1, void N();
327
- m = !1, e.$update(2);
328
329
  }, N = () => {
329
- q(a), a = x(z, 150);
330
+ if (p || m) return p = !1, void w();
331
+ d = !1, e.$update(2);
330
332
  }, w = () => {
331
- c = h(), m && (d = !0), o && e.$update(6, o()), e.$update(1, y()), N();
332
- }, b = t => {
333
- if (u || !e.$isScrolling() || t.ctrlKey) return;
334
- const i = h() - c;
335
- 150 > i && 50 < i && (s ? t.deltaX : t.deltaY) && (u = !0);
336
- }, $ = () => {
337
- p = !0, m = d = !1;
333
+ q(c), c = x(N, 150);
334
+ }, b = () => {
335
+ u = f(), d && (h = !0), l && e.$update(7, l()), e.$update(1, v()), w();
336
+ }, $ = t => {
337
+ if (p || !e.$isScrolling() || t.ctrlKey) return;
338
+ const i = f() - u;
339
+ 150 > i && 50 < i && (n ? t.deltaX : t.deltaY) && (p = !0);
338
340
  }, R = () => {
339
- p = !1, T() && (m = !0);
341
+ m = !0, d = h = !1;
342
+ }, I = () => {
343
+ m = !1, T() && (d = !0);
340
344
  };
341
- return t.addEventListener("scroll", w), t.addEventListener("wheel", b, {
345
+ return i.addEventListener("scroll", b), i.addEventListener("wheel", $, {
346
+ passive: !0
347
+ }), i.addEventListener("touchstart", R, {
342
348
  passive: !0
343
- }), t.addEventListener("touchstart", $, {
349
+ }), i.addEventListener("touchend", I, {
344
350
  passive: !0
345
- }), t.addEventListener("touchend", R, {
351
+ }), i.addEventListener("touchcancel", I, {
346
352
  passive: !0
347
353
  }), {
348
- u: w,
349
- l: () => {
350
- t.removeEventListener("scroll", w), t.removeEventListener("wheel", b), t.removeEventListener("touchstart", $),
351
- t.removeEventListener("touchend", R), q(a);
354
+ p: b,
355
+ u: () => {
356
+ i.removeEventListener("scroll", b), i.removeEventListener("wheel", $), i.removeEventListener("touchstart", R),
357
+ i.removeEventListener("touchend", I), i.removeEventListener("touchcancel", I), q(c);
352
358
  },
353
- p: () => {
354
- const [t, s] = e.t();
359
+ m: () => {
360
+ const [t, i] = e.i();
355
361
  if (!t) return;
356
- d && n && n(), d = !1;
357
- const r = e.$getScrollOffset(), o = r + t, a = e.$getStartSpacerSize() + e.$getTotalSize() - e.$getViewportSize();
358
- o <= 0 || o >= a || r >= a ? v(o) : i.scrollBy({
359
- [g]: S(t),
362
+ h && o && o(), h = !1;
363
+ const n = e.$getScrollOffset(), r = n + t, l = e.$getStartSpacerSize() + e.$getTotalSize() - e.$getViewportSize();
364
+ r <= 0 || r >= l || n >= l ? z(r) : s.scrollBy({
365
+ [S]: y(t),
360
366
  behavior: "instant"
361
- }), s && (l && l(), e.$getViewportSize() > e.$getTotalSize() && e.$update(1, y()));
367
+ }), i && (a && a(), e.$getViewportSize() > e.$getTotalSize() && e.$update(1, v()));
362
368
  },
363
- m: (t, i) => {
364
- let s, r, n;
365
- l && l();
366
- const o = l = () => {
367
- s = !0, q(r), n && n();
368
- }, a = () => {
369
- if (!s) {
370
- if (e.$getViewportSize() && (q(r), r = x(o, 150)), i) {
371
- for (let [t, i] = e.$getRange(0); t <= i; t++) if (e.$isUnmeasuredItem(t)) return;
372
- o();
369
+ h: (i, s) => {
370
+ let n, r, o;
371
+ a && a();
372
+ const l = a = () => {
373
+ n = !0, q(r), o && o();
374
+ }, c = () => {
375
+ if (!n) {
376
+ if (e.$getViewportSize() && (q(r), r = x(l, 150)), s) {
377
+ for (let [i, s] = e.$getRange(0); i <= s; i++) if (t.$isSizeEqual(i)) return;
378
+ l();
373
379
  }
374
- e.$update(7), v(t(), i);
380
+ e.$update(8), z(i(), s);
375
381
  }
376
382
  };
377
- i && e.$update(8, t()), (() => {
378
- if (s) return;
383
+ s && e.$update(9, i()), (() => {
384
+ if (n) return;
379
385
  let t;
380
- n = e.$subscribe(2, () => {
386
+ o = e.$subscribe(2, () => {
381
387
  t || (t = !0, F(() => {
382
- t = !1, a();
388
+ t = !1, c();
383
389
  }));
384
- }), a();
390
+ }), c();
385
391
  })();
386
392
  }
387
393
  };
388
- }, ee = (e, t) => {
389
- let i, s, r = k(), n = !0;
390
- const o = /* @__PURE__ */ new WeakMap, l = U(r => {
391
- const l = [];
392
- for (const {target: a, contentRect: {width: c, height: u}} of r) if (a === i) c || u ? (n || s.u(),
393
- n = !0, e.$update(4, t ? c : u)) : n = !1; else if (a.offsetParent) {
394
- const e = o.get(a);
395
- null != e && l.push([ e, t ? c : u ]);
394
+ }, te = (e, t, i) => {
395
+ let s, n, r = k(), o = !0;
396
+ const l = /* @__PURE__ */ new WeakMap, a = Z(r => {
397
+ const a = [];
398
+ for (const {target: c, contentRect: {width: u, height: p}} of r) if (c === s) u || p ? (o || n.p(),
399
+ o = !0, e.$update(4, i ? u : p)) : o = !1; else if (c.offsetParent) {
400
+ const e = l.get(c);
401
+ if (null != e) {
402
+ const s = i ? u : p;
403
+ t.$isSizeEqual(e, s) || a.push([ e, s ]);
404
+ }
396
405
  }
397
- l.length && e.$update(3, l);
406
+ e.$update(3, a);
398
407
  });
399
408
  return {
400
- $observe(n, o = n.parentElement) {
401
- l.i(i = o), s = Z(e, o, o, t, t && "rtl" === getComputedStyle(o).direction, () => {
402
- const e = t ? "overflowX" : "overflowY", i = o.style, s = i[e];
403
- i[e] = "hidden", x(() => {
404
- i[e] = s;
409
+ $observe(o, l = o.parentElement) {
410
+ a.o(s = l), n = ee(e, t, l, l, i, i && "rtl" === getComputedStyle(l).direction, () => {
411
+ const e = i ? "overflowX" : "overflowY", t = l.style, s = t[e];
412
+ t[e] = "hidden", x(() => {
413
+ t[e] = s;
405
414
  });
406
415
  }), r[1](!0);
407
416
  },
408
417
  $dispose() {
409
- l.l(), s && s.l(), r[1](!1), r = k();
418
+ a.u(), n && n.u(), r[1](!1), r = k();
410
419
  },
411
- $observeItem: (e, t) => (o.set(e, t), l.i(e), () => {
412
- o.delete(e), l.o(e);
420
+ $observeItem: (e, t) => (l.set(e, t), a.o(e), () => {
421
+ l.delete(e), a.l(e);
413
422
  }),
414
423
  async $scroll(e, t) {
415
- await r[0] && s.m(e, t);
424
+ await r[0] && n.h(e, t);
416
425
  },
417
426
  $effect() {
418
- s && s.p();
427
+ n && n.m();
419
428
  },
420
429
  $getBaseOffset: e.$getStartSpacerSize
421
430
  };
422
- }, te = (e, t) => {
431
+ }, ie = (e, t) => {
423
432
  e.$scroll(() => t);
424
- }, ie = (e, t, i) => {
425
- te(e, i + t.$getScrollOffset());
426
- }, se = (e, t, i, {align: s, smooth: r, offset: n = 0} = {}) => {
427
- if (i = P(i, 0, t.$getItemsLength() - 1), "nearest" === s) {
428
- const e = t.$getItemOffset(i), r = t.$getScrollOffset();
429
- if (e < r) s = "start"; else {
430
- if (!(e + t.$getItemSize(i) > r + t.$getViewportSize())) return;
431
- s = "end";
433
+ }, se = (e, t, i) => {
434
+ ie(e, i + t.$getScrollOffset());
435
+ }, ne = (e, t, i, s, {align: n, smooth: r, offset: o = 0} = {}) => {
436
+ if (s = I(s, 0, i.$getLength() - 1), "nearest" === n) {
437
+ const e = t.$getItemOffset(s), r = t.$getScrollOffset();
438
+ if (e < r) n = "start"; else {
439
+ if (!(e + i.$getItemSize(s) > r + t.$getViewportSize())) return;
440
+ n = "end";
432
441
  }
433
442
  }
434
- e.$scroll(() => n + e.$getBaseOffset() + t.$getItemOffset(i) + ("end" === s ? t.$getItemSize(i) - t.$getViewportSize() : "center" === s ? (t.$getItemSize(i) - t.$getViewportSize()) / 2 : 0), r);
435
- }, re = (e, t, i, s, r, n, o) => {
436
- const l = t.$getItemsLength(), a = i.$getPinnedStart(), c = i.$getTrailStart();
437
- r = P(r, 0, l - 1);
438
- const u = B(s, a, c), p = H(u, r, c), m = p < 0 ? -1 : u[p], d = () => i.$getItemOffset(a) + (m < 0 || m === r ? 0 : i.$getItemOffset(m + 1) - i.$getItemOffset(m)), h = () => i.$getItemOffset(l) - i.$getItemOffset(c);
439
- if ("nearest" === n) {
440
- if (r < a || r >= c) return;
441
- const e = d(), i = t.$getScrollOffset() + e, s = t.$getViewportSize() - e - h(), o = t.$getItemSize(r);
442
- let l = t.$getItemOffset(r);
443
- if (m === r) {
443
+ e.$scroll(() => o + e.$getBaseOffset() + t.$getItemOffset(s) + ("end" === n ? i.$getItemSize(s) - t.$getViewportSize() : "center" === n ? (i.$getItemSize(s) - t.$getViewportSize()) / 2 : 0), r);
444
+ }, re = (e, t, i, s, n, r, o) => {
445
+ const l = i.$getLength(), a = i.$getPinnedStart(), c = i.$getTrailStart();
446
+ n = I(n, 0, l - 1);
447
+ const u = H(s, a, c), p = j(u, n, c), m = p < 0 ? -1 : u[p], d = () => i.$getItemOffset(a) + (m < 0 || m === n ? 0 : i.$getItemOffset(m + 1) - i.$getItemOffset(m)), h = () => i.$getItemOffset(l) - i.$getItemOffset(c);
448
+ if ("nearest" === r) {
449
+ if (n < a || n >= c) return;
450
+ const e = d(), s = t.$getScrollOffset() + e, o = t.$getViewportSize() - e - h(), l = i.$getItemSize(n);
451
+ let f = t.$getItemOffset(n);
452
+ if (m === n) {
444
453
  const e = (p + 1 < u.length ? u[p + 1] : c) - 1;
445
- l = b(l, w(i, t.$getItemOffset(e) + t.$getItemSize(e) - o));
454
+ f = b(f, w(s, t.$getItemOffset(e) + i.$getItemSize(e) - l));
446
455
  }
447
- if (l < i) n = "start"; else {
448
- if (!(l + o > i + s)) return;
449
- n = "end";
456
+ if (f < s) r = "start"; else {
457
+ if (!(f + l > s + o)) return;
458
+ r = "end";
450
459
  }
451
460
  }
452
461
  e.$scroll(o, () => {
453
- const e = d(), i = t.$getItemSize(r) - (t.$getViewportSize() - e - h());
454
- return t.$getItemOffset(r) - e + ("end" === n ? i : "center" === n ? i / 2 : 0);
462
+ const e = d(), s = i.$getItemSize(n) - (t.$getViewportSize() - e - h());
463
+ return t.$getItemOffset(n) - e + ("end" === r ? s : "center" === r ? s / 2 : 0);
455
464
  });
456
- }, ne = class t {
465
+ }, oe = class t {
457
466
  index=h.required();
458
467
  offset=h.required();
459
468
  hide=h.required();
@@ -474,7 +483,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
474
483
  return e && (s.display = "inline-flex"), s;
475
484
  });
476
485
  constructor() {
477
- const e = d(r).nativeElement;
486
+ const e = d(n).nativeElement;
478
487
  let t;
479
488
  c({
480
489
  read: () => {
@@ -565,9 +574,9 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
565
574
  },
566
575
  ngImport: e
567
576
  });
568
- }, oe = (e, t) => "_" + t, le = /*#__PURE__*/ new o("virtua-item-template"), ae = class i {
577
+ }, le = (e, t) => "_" + t, ae = /*#__PURE__*/ new o("virtua-item-template"), ce = class i {
569
578
  data=h.required();
570
- getKey=h(oe);
579
+ getKey=h(le);
571
580
  itemProps=h();
572
581
  bufferSize=h();
573
582
  scrollRef=h();
@@ -584,48 +593,48 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
584
593
  scrollEnded=f();
585
594
  resized=f();
586
595
  contentTemplate=p(l);
587
- h=d(le, {
596
+ S=d(ae, {
588
597
  optional: !0
589
598
  });
590
- template=u(() => this.h?.() ?? this.contentTemplate());
591
- S;
599
+ template=u(() => this.S?.() ?? this.contentTemplate());
592
600
  v;
601
+ N;
593
602
  driver;
594
- N=d(r).nativeElement;
595
- $=d(t);
596
- R=g(void 0);
603
+ $=d(n).nativeElement;
604
+ R=d(t);
605
+ I=g(void 0);
597
606
  isSSR=g(!1);
598
607
  P=u(() => {
599
- this.R();
600
- const e = this.data().length, [t, i] = this.S.$getRange(this.bufferSize()), s = this.keepMounted(), r = [];
608
+ this.I();
609
+ const e = this.data().length, [t, i] = this.v.$getRange(this.bufferSize()), s = this.keepMounted(), n = [];
601
610
  if (s) {
602
- const n = new Set(s);
603
- for (let e = t; e <= i; e++) n.add(e);
604
- for (const t of I([ ...n ])) t < e && r.push(t);
605
- } else for (let e = t; e <= i; e++) r.push(e);
606
- return r;
611
+ const r = new Set(s);
612
+ for (let e = t; e <= i; e++) r.add(e);
613
+ for (const t of P([ ...r ])) t < e && n.push(t);
614
+ } else for (let e = t; e <= i; e++) n.push(e);
615
+ return n;
607
616
  });
608
617
  items=u(() => {
609
- this.R();
610
- const e = this.S, t = this.data(), i = this.getKey(), s = this.itemProps();
611
- return this.P().map(r => {
612
- const n = t[r];
618
+ this.I();
619
+ const e = this.v, t = this.data(), i = this.getKey(), s = this.itemProps();
620
+ return this.P().map(n => {
621
+ const r = t[n];
613
622
  return {
614
- key: i(n, r),
615
- index: r,
616
- data: n,
617
- offset: e.$getItemOffset(r),
618
- hide: e.$isUnmeasuredItem(r),
623
+ key: i(r, n),
624
+ index: n,
625
+ data: r,
626
+ offset: e.$getItemOffset(n),
627
+ hide: this.N.$isSizeEqual(n),
619
628
  attrs: s?.({
620
- item: n,
621
- index: r
629
+ item: r,
630
+ index: n
622
631
  })
623
632
  };
624
633
  });
625
634
  });
626
635
  containerStyle=u(() => {
627
- this.R();
628
- const e = this.horizontal(), t = this.S.$getTotalSize();
636
+ this.I();
637
+ const e = this.horizontal(), t = this.v.$getTotalSize();
629
638
  return {
630
639
  display: "block",
631
640
  contain: "size style",
@@ -634,71 +643,71 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
634
643
  position: "relative",
635
644
  width: e ? t + "px" : "100%",
636
645
  height: e ? "100%" : t + "px",
637
- "pointer-events": this.S.$isScrolling() ? "none" : void 0
646
+ "pointer-events": this.v.$isScrolling() ? "none" : void 0
638
647
  };
639
648
  });
640
649
  constructor() {
641
650
  m(() => {
642
651
  const e = this.data().length;
643
- this.S && e !== this.S.$getItemsLength() && this.S.$update(5, [ e, S(this.shift) ]);
652
+ this.v && this.v.$update(5, e, S(this.shift));
644
653
  }), m(() => {
645
654
  const e = this.startMargin();
646
- this.S && e !== this.S.$getStartSpacerSize() && this.S.$update(6, e);
655
+ this.v && this.v.$update(7, e);
647
656
  }), a({
648
657
  read: () => {
649
- this.isSSR.set(!1), this.driver.$observe(this.N, this.scrollRef());
658
+ this.isSSR.set(!1), this.driver.$observe(this.$, this.scrollRef());
650
659
  }
651
660
  }), c({
652
661
  read: () => {
653
- this.R(), this.driver.$effect();
662
+ this.I(), this.driver.$effect();
654
663
  }
655
664
  }), d(s).onDestroy(() => {
656
- this.S?.$dispose(), this.driver?.$dispose();
665
+ this.v?.$dispose(), this.driver?.$dispose();
657
666
  });
658
667
  }
659
668
  ngOnInit() {
660
669
  const e = this.itemSize(), t = this.ssrCount();
661
670
  this.isSSR.set(!!t);
662
- const i = this.v = L(this.data().length, e, this.cacheProp()), s = this.S = _(i, t);
663
- this.driver = ee(s, this.horizontal()), s.$subscribe(1, e => {
664
- this.R.set(s.$getStateVersion()), e && this.$.tick();
671
+ const i = this.N = L(this.data().length, e, this.cacheProp()), s = this.v = V(i, t);
672
+ this.driver = te(s, i, this.horizontal()), s.$subscribe(1, e => {
673
+ this.I.set(s.$getStateVersion()), e && this.R.tick();
665
674
  }), s.$subscribe(4, () => {
666
675
  this.scrolled.emit(s.$getScrollOffset());
667
676
  }), s.$subscribe(8, () => {
668
677
  this.scrollEnded.emit();
669
678
  }), s.$subscribe(2, () => {
670
679
  this.resized.emit();
671
- }), this.R.set(s.$getStateVersion());
680
+ }), this.I.set(s.$getStateVersion());
672
681
  }
673
682
  get cache() {
674
- return this.v.$snapshot();
683
+ return this.N.$snapshot();
675
684
  }
676
685
  get scrollOffset() {
677
- return this.S.$getScrollOffset();
686
+ return this.v.$getScrollOffset();
678
687
  }
679
688
  get scrollSize() {
680
- return M(this.S);
689
+ return M(this.v);
681
690
  }
682
691
  get viewportSize() {
683
- return this.S.$getViewportSize();
692
+ return this.v.$getViewportSize();
684
693
  }
685
694
  findItemIndex(e) {
686
- return this.v.$findIndex(e - this.S.$getStartSpacerSize());
695
+ return this.N.$findIndex(e - this.v.$getStartSpacerSize());
687
696
  }
688
697
  getItemOffset(e) {
689
- return this.S.$getItemOffset(e);
698
+ return this.v.$getItemOffset(e);
690
699
  }
691
700
  getItemSize(e) {
692
- return this.S.$getItemSize(e);
701
+ return this.N.$getItemSize(e);
693
702
  }
694
703
  scrollToIndex(e, t) {
695
- se(this.driver, this.S, e, t);
704
+ ne(this.driver, this.v, this.N, e, t);
696
705
  }
697
706
  scrollTo(e) {
698
- te(this.driver, e);
707
+ ie(this.driver, e);
699
708
  }
700
709
  scrollBy(e) {
701
- ie(this.driver, this.S, e);
710
+ se(this.driver, this.v, e);
702
711
  }
703
712
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
704
713
  minVersion: "12.0.0",
@@ -823,7 +832,7 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
823
832
  isInline: !0,
824
833
  dependencies: [ {
825
834
  kind: "directive",
826
- type: e.forwardRef(() => ne),
835
+ type: e.forwardRef(() => oe),
827
836
  selector: "div[virtuaListItem]",
828
837
  inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
829
838
  }, {
@@ -838,9 +847,9 @@ z), M = e => b(e.$getTotalSize(), e.$getViewportSize()), _ = ({$getRange: e, $ge
838
847
 
839
848
  i.OnPush;
840
849
 
841
- var ce = class t {
850
+ var ue = class t {
842
851
  data=h.required();
843
- getKey=h(oe);
852
+ getKey=h(le);
844
853
  itemProps=h();
845
854
  bufferSize=h();
846
855
  itemSize=h();
@@ -855,10 +864,10 @@ var ce = class t {
855
864
  scrollEnded=f();
856
865
  resized=f();
857
866
  template=p.required(l);
858
- virtualizer=y.required(ae);
859
- N=d(r).nativeElement;
867
+ virtualizer=y.required(ce);
868
+ $=d(n).nativeElement;
860
869
  ngOnInit() {
861
- const e = this.horizontal(), t = this.N;
870
+ const e = this.horizontal(), t = this.$;
862
871
  t.setAttribute("style", `display:block;${e ? "overflow-x" : "overflow-y"}:auto;contain:strict;width:100%;height:100%;` + (t.getAttribute("style") || ""));
863
872
  }
864
873
  get cache() {
@@ -993,7 +1002,7 @@ var ce = class t {
993
1002
  viewQueries: [ {
994
1003
  propertyName: "virtualizer",
995
1004
  first: !0,
996
- predicate: ae,
1005
+ predicate: ce,
997
1006
  emitDistinctChangesOnly: !1,
998
1007
  descendants: !0,
999
1008
  isSignal: !0
@@ -1003,13 +1012,13 @@ var ce = class t {
1003
1012
  isInline: !0,
1004
1013
  dependencies: [ {
1005
1014
  kind: "directive",
1006
- type: e.forwardRef(() => ae),
1015
+ type: e.forwardRef(() => ce),
1007
1016
  selector: "virtua-virtualizer",
1008
1017
  inputs: [ "data", "getKey", "itemProps", "bufferSize", "scrollRef", "itemSize", "ssrCount", "shift", "horizontal", "keepMounted", "cache", "startMargin" ],
1009
1018
  outputs: [ "scrolled", "scrollEnded", "resized" ]
1010
1019
  } ],
1011
1020
  viewProviders: [ {
1012
- provide: le,
1021
+ provide: ae,
1013
1022
  useFactory: () => d(t).template
1014
1023
  } ],
1015
1024
  changeDetection: e.ChangeDetectionStrategy.OnPush
@@ -1018,9 +1027,9 @@ var ce = class t {
1018
1027
 
1019
1028
  i.OnPush;
1020
1029
 
1021
- var ue = class i {
1030
+ var pe = class i {
1022
1031
  data=h.required();
1023
- getKey=h(oe);
1032
+ getKey=h(le);
1024
1033
  bufferSize=h();
1025
1034
  itemSize=h();
1026
1035
  ssrCount=h();
@@ -1033,31 +1042,31 @@ var ue = class i {
1033
1042
  scrollEnded=f();
1034
1043
  resized=f();
1035
1044
  template=p.required(l);
1036
- S;
1037
1045
  v;
1046
+ N;
1038
1047
  driver;
1039
- N=d(r).nativeElement;
1040
- $=d(t);
1041
- R=g(void 0);
1048
+ $=d(n).nativeElement;
1049
+ R=d(t);
1050
+ I=g(void 0);
1042
1051
  isSSR=g(!1);
1043
1052
  items=u(() => {
1044
- this.R();
1045
- const e = this.S, t = this.data(), i = this.getKey(), [s, r] = e.$getRange(this.bufferSize()), n = [];
1046
- for (let o = s; o <= r; o++) {
1053
+ this.I();
1054
+ const e = this.v, t = this.data(), i = this.getKey(), [s, n] = e.$getRange(this.bufferSize()), r = [];
1055
+ for (let o = s; o <= n; o++) {
1047
1056
  const s = t[o];
1048
- n.push({
1057
+ r.push({
1049
1058
  key: i(s, o),
1050
1059
  index: o,
1051
1060
  data: s,
1052
1061
  offset: e.$getItemOffset(o),
1053
- hide: e.$isUnmeasuredItem(o)
1062
+ hide: this.N.$isSizeEqual(o)
1054
1063
  });
1055
1064
  }
1056
- return n;
1065
+ return r;
1057
1066
  });
1058
1067
  containerStyle=u(() => {
1059
- this.R();
1060
- const e = this.horizontal(), t = this.S.$getTotalSize();
1068
+ this.I();
1069
+ const e = this.horizontal(), t = this.v.$getTotalSize();
1061
1070
  return {
1062
1071
  display: "block",
1063
1072
  contain: "size style",
@@ -1066,95 +1075,98 @@ var ue = class i {
1066
1075
  position: "relative",
1067
1076
  width: e ? t + "px" : "100%",
1068
1077
  height: e ? "100%" : t + "px",
1069
- "pointer-events": this.S.$isScrolling() ? "none" : void 0
1078
+ "pointer-events": this.v.$isScrolling() ? "none" : void 0
1070
1079
  };
1071
1080
  });
1072
1081
  constructor() {
1073
1082
  m(() => {
1074
1083
  const e = this.data().length;
1075
- this.S && e !== this.S.$getItemsLength() && this.S.$update(5, [ e, S(this.shift) ]);
1084
+ this.v && this.v.$update(5, e, S(this.shift));
1076
1085
  }), a({
1077
1086
  read: () => {
1078
- this.isSSR.set(!1), this.driver.$observe(this.N);
1087
+ this.isSSR.set(!1), this.driver.$observe(this.$);
1079
1088
  }
1080
1089
  }), c({
1081
1090
  read: () => {
1082
- this.R(), this.driver.$effect();
1091
+ this.I(), this.driver.$effect();
1083
1092
  }
1084
1093
  }), d(s).onDestroy(() => {
1085
- this.S?.$dispose(), this.driver?.$dispose();
1094
+ this.v?.$dispose(), this.driver?.$dispose();
1086
1095
  });
1087
1096
  }
1088
1097
  ngOnInit() {
1089
1098
  const e = this.itemSize(), t = this.ssrCount();
1090
1099
  this.isSSR.set(!!t);
1091
- const i = this.v = L(this.data().length, e, this.cacheProp()), s = this.S = _(i, t);
1092
- this.driver = ((e, t) => {
1093
- let i, s, r, n, o, l = k();
1094
- const a = /* @__PURE__ */ new WeakMap, c = U(s => {
1100
+ const i = this.N = L(this.data().length, e, this.cacheProp()), s = this.v = V(i, t);
1101
+ this.driver = ((e, t, i) => {
1102
+ let s, n, r, o, l, a = k();
1103
+ const c = /* @__PURE__ */ new WeakMap, u = Z(n => {
1095
1104
  const r = [];
1096
- for (const {target: e, contentRect: {width: n, height: l}} of s) if (e === i) o && o(); else if (e.offsetParent) {
1097
- const i = a.get(e);
1098
- null != i && r.push([ i, t ? n : l ]);
1105
+ for (const {target: e, contentRect: {width: o, height: a}} of n) if (e === s) l && l(); else if (e.offsetParent) {
1106
+ const s = c.get(e);
1107
+ if (null != s) {
1108
+ const e = i ? o : a;
1109
+ t.$isSizeEqual(s, e) || r.push([ s, e ]);
1110
+ }
1099
1111
  }
1100
- r.length && e.$update(3, r);
1112
+ e.$update(3, r);
1101
1113
  });
1102
1114
  return {
1103
- $observe(a) {
1104
- const u = O(a), p = C(u), m = i = u.scrollingElement, d = t && "rtl" === getComputedStyle(m).direction, h = (e, t, i, s, r = 0) => {
1105
- const n = s ? "offsetLeft" : "offsetTop", o = r + (d ? t.clientWidth - e[n] - e.offsetWidth : e[n]), l = e.offsetParent;
1106
- return e !== i && l ? h(l, t, i, s, o) : o;
1107
- }, f = n = () => h(a, m, u.body, t), g = o = () => {
1108
- e.$update(4, m[t ? "clientWidth" : "clientHeight"]);
1115
+ $observe(c) {
1116
+ const p = O(c), m = C(p), d = s = p.scrollingElement, h = i && "rtl" === getComputedStyle(d).direction, f = (e, t, i, s, n = 0) => {
1117
+ const r = s ? "offsetLeft" : "offsetTop", o = n + (h ? t.clientWidth - e[r] - e.offsetWidth : e[r]), l = e.offsetParent;
1118
+ return e !== i && l ? f(l, t, i, s, o) : o;
1119
+ }, g = o = () => f(c, d, p.body, i), S = l = () => {
1120
+ e.$update(4, d[i ? "clientWidth" : "clientHeight"]);
1109
1121
  };
1110
- p.addEventListener("resize", g), c.i(m), r = () => {
1111
- p.removeEventListener("resize", g);
1112
- }, s = Z(e, p, m, t, d, null, f), l[1](!0);
1122
+ m.addEventListener("resize", S), u.o(d), r = () => {
1123
+ m.removeEventListener("resize", S);
1124
+ }, n = ee(e, t, m, d, i, h, null, g), a[1](!0);
1113
1125
  },
1114
1126
  $dispose() {
1115
- r && r(), c.l(), s && s.l(), l[1](!1), l = k();
1127
+ r && r(), u.u(), n && n.u(), a[1](!1), a = k();
1116
1128
  },
1117
- $observeItem: (e, t) => (a.set(e, t), c.i(e), () => {
1118
- a.delete(e), c.o(e);
1129
+ $observeItem: (e, t) => (c.set(e, t), u.o(e), () => {
1130
+ c.delete(e), u.l(e);
1119
1131
  }),
1120
1132
  async $scroll(e, t) {
1121
- await l[0] && s.m(e, t);
1133
+ await a[0] && n.h(e, t);
1122
1134
  },
1123
1135
  $effect() {
1124
- s && s.p();
1136
+ n && n.m();
1125
1137
  },
1126
- $getBaseOffset: () => n()
1138
+ $getBaseOffset: () => o()
1127
1139
  };
1128
- })(s, this.horizontal()), s.$subscribe(1, e => {
1129
- this.R.set(s.$getStateVersion()), e && this.$.tick();
1140
+ })(s, i, this.horizontal()), s.$subscribe(1, e => {
1141
+ this.I.set(s.$getStateVersion()), e && this.R.tick();
1130
1142
  }), s.$subscribe(4, () => {
1131
1143
  this.scrolled.emit();
1132
1144
  }), s.$subscribe(8, () => {
1133
1145
  this.scrollEnded.emit();
1134
1146
  }), s.$subscribe(2, () => {
1135
1147
  this.resized.emit();
1136
- }), this.R.set(s.$getStateVersion());
1148
+ }), this.I.set(s.$getStateVersion());
1137
1149
  }
1138
1150
  get cache() {
1139
- return this.v.$snapshot();
1151
+ return this.N.$snapshot();
1140
1152
  }
1141
1153
  get scrollOffset() {
1142
- return this.S.$getScrollOffset();
1154
+ return this.v.$getScrollOffset();
1143
1155
  }
1144
1156
  get viewportSize() {
1145
- return this.S.$getViewportSize();
1157
+ return this.v.$getViewportSize();
1146
1158
  }
1147
1159
  findItemIndex(e) {
1148
- return this.v.$findIndex(e - this.S.$getStartSpacerSize());
1160
+ return this.N.$findIndex(e - this.v.$getStartSpacerSize());
1149
1161
  }
1150
1162
  getItemOffset(e) {
1151
- return this.S.$getItemOffset(e);
1163
+ return this.v.$getItemOffset(e);
1152
1164
  }
1153
1165
  getItemSize(e) {
1154
- return this.S.$getItemSize(e);
1166
+ return this.N.$getItemSize(e);
1155
1167
  }
1156
1168
  scrollToIndex(e, t) {
1157
- se(this.driver, this.S, e, t);
1169
+ ne(this.driver, this.v, this.N, e, t);
1158
1170
  }
1159
1171
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
1160
1172
  minVersion: "12.0.0",
@@ -1251,7 +1263,7 @@ var ue = class i {
1251
1263
  isInline: !0,
1252
1264
  dependencies: [ {
1253
1265
  kind: "directive",
1254
- type: e.forwardRef(() => ne),
1266
+ type: e.forwardRef(() => oe),
1255
1267
  selector: "div[virtuaListItem]",
1256
1268
  inputs: [ "index", "offset", "hide", "horizontal", "isSSR", "resizer", "attrs" ]
1257
1269
  }, {
@@ -1266,19 +1278,19 @@ var ue = class i {
1266
1278
 
1267
1279
  i.OnPush;
1268
1280
 
1269
- var pe = class t {
1281
+ var me = class t {
1270
1282
  state=h.required();
1271
1283
  resizer=h.required();
1272
1284
  constructor() {
1273
- const e = d(r).nativeElement, t = u(() => this.state().$measureRow), i = u(() => this.state().$measureCol);
1274
- let n;
1285
+ const e = d(n).nativeElement, t = u(() => this.state().$measureRow), i = u(() => this.state().$measureCol);
1286
+ let r;
1275
1287
  c({
1276
1288
  read: () => {
1277
- const s = t(), r = i();
1278
- n && n(), n = null == s && null == r ? void 0 : S(this.resizer)(e, s, r);
1289
+ const s = t(), n = i();
1290
+ r && r(), r = null == s && null == n ? void 0 : S(this.resizer)(e, s, n);
1279
1291
  }
1280
1292
  }), d(s).onDestroy(() => {
1281
- n && n();
1293
+ r && r();
1282
1294
  });
1283
1295
  }
1284
1296
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
@@ -1323,14 +1335,14 @@ var pe = class t {
1323
1335
  },
1324
1336
  ngImport: e
1325
1337
  });
1326
- }, me = class t {
1338
+ }, de = class t {
1327
1339
  state=h.required();
1328
1340
  template=h.required();
1329
1341
  row=h.required();
1330
1342
  cols=h.required();
1331
1343
  resizer=h.required();
1332
1344
  colItem(e) {
1333
- return D(this.cols(), e);
1345
+ return G(this.cols(), e);
1334
1346
  }
1335
1347
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
1336
1348
  minVersion: "12.0.0",
@@ -1397,7 +1409,7 @@ var pe = class t {
1397
1409
  isInline: !0,
1398
1410
  dependencies: [ {
1399
1411
  kind: "directive",
1400
- type: e.forwardRef(() => pe),
1412
+ type: e.forwardRef(() => me),
1401
1413
  selector: "div[virtuaGridCell]",
1402
1414
  inputs: [ "state", "resizer" ]
1403
1415
  }, {
@@ -1408,14 +1420,14 @@ var pe = class t {
1408
1420
  } ],
1409
1421
  changeDetection: e.ChangeDetectionStrategy.OnPush
1410
1422
  });
1411
- }, de = class t {
1423
+ }, he = class t {
1412
1424
  state=h.required();
1413
1425
  template=h.required();
1414
1426
  rows=h.required();
1415
1427
  cols=h.required();
1416
1428
  resizer=h.required();
1417
1429
  rowItem(e) {
1418
- return D(this.rows(), e);
1430
+ return G(this.rows(), e);
1419
1431
  }
1420
1432
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
1421
1433
  minVersion: "12.0.0",
@@ -1481,13 +1493,13 @@ var pe = class t {
1481
1493
  isInline: !0,
1482
1494
  dependencies: [ {
1483
1495
  kind: "directive",
1484
- type: e.forwardRef(() => me),
1496
+ type: e.forwardRef(() => de),
1485
1497
  selector: "div[virtuaGridRow]",
1486
1498
  inputs: [ "state", "template", "row", "cols", "resizer" ]
1487
1499
  } ],
1488
1500
  changeDetection: e.ChangeDetectionStrategy.OnPush
1489
1501
  });
1490
- }, he = class i {
1502
+ }, fe = class i {
1491
1503
  rows=h.required();
1492
1504
  cols=h.required();
1493
1505
  rowHeight=h.required();
@@ -1508,25 +1520,25 @@ var pe = class t {
1508
1520
  resized=f();
1509
1521
  template=p.required(l);
1510
1522
  container=y.required("container");
1511
- I;
1512
1523
  q;
1513
1524
  F;
1514
1525
  k;
1526
+ O;
1515
1527
  driver;
1516
- N=d(r).nativeElement;
1517
- $=d(t);
1518
- R=g(void 0);
1519
- ariaRowCount=d(new n("aria-rowcount"), {
1528
+ $=d(n).nativeElement;
1529
+ R=d(t);
1530
+ I=g(void 0);
1531
+ ariaRowCount=d(new r("aria-rowcount"), {
1520
1532
  optional: !0
1521
1533
  });
1522
- ariaColCount=d(new n("aria-colcount"), {
1534
+ ariaColCount=d(new r("aria-colcount"), {
1523
1535
  optional: !0
1524
1536
  });
1525
- rowCount=u(() => this.R() && this.I.$getItemsLength());
1526
- colCount=u(() => this.R() && this.q.$getItemsLength());
1527
- O=u(() => this.F.$getSizes(this.rows(), this.rowHeight()));
1528
- C=u(() => this.k.$getSizes(this.cols(), this.colWidth()));
1529
- T=u(() => ((e = N) => {
1537
+ rowCount=u(() => this.I() && this.k.$getLength());
1538
+ colCount=u(() => this.I() && this.O.$getLength());
1539
+ C=u(() => this.k.$getSizes(this.rows(), this.rowHeight()));
1540
+ T=u(() => this.O.$getSizes(this.cols(), this.colWidth()));
1541
+ M=u(() => ((e = N) => {
1530
1542
  const t = /* @__PURE__ */ new Map;
1531
1543
  for (const i of e) {
1532
1544
  const e = i.rowIndex + (i.rowSpan || 1);
@@ -1537,18 +1549,18 @@ var pe = class t {
1537
1549
  }
1538
1550
  return t;
1539
1551
  })(this.spans()));
1540
- plan=u(() => (this.R(), ((e, t, [i, s], [r, n], o, l = N, a = N, c) => {
1552
+ plan=u(() => (this.I(), ((e, t, [i, s], [n, r], o, l = N, a = N, c) => {
1541
1553
  const u = e.$getLength(), p = t.$getLength(), m = e.$getPinnedStart(), d = e.$getTrailStart(), h = t.$getPinnedStart(), f = t.$getTrailStart();
1542
- i = P(i, m, d), s = w(s, d - 1), r = P(r, h, f), n = w(n, f - 1);
1543
- const g = B(l, m, d), S = b(h - 1, 0), y = [], v = [], z = [];
1554
+ i = I(i, m, d), s = w(s, d - 1), n = I(n, h, f), r = w(r, f - 1);
1555
+ const g = H(l, m, d), S = b(h - 1, 0), y = [], v = [], z = [];
1544
1556
  for (const e of a) e.rowIndex < u && e.colIndex < p && (z.push(e), y.push(e.rowIndex));
1545
- const $ = z.length, R = H(g, i, d), x = R < 0 ? -1 : g[R];
1557
+ const $ = z.length, R = j(g, i, d), x = R < 0 ? -1 : g[R];
1546
1558
  x >= 0 && y.push(x);
1547
- const q = A(I(y), u, m, i, s, d);
1559
+ const q = Q(P(y), u, m, i, s, d);
1548
1560
  for (let e = 0; e < q.length; e++) for (const t of o.get(q[e]) || N) {
1549
- const {rowIndex: o, colIndex: l} = t, a = Q(t, u), c = J(t, p);
1561
+ const {rowIndex: o, colIndex: l} = t, a = J(t, u), c = X(t, p);
1550
1562
  if ((e < 1 || q[e - 1] < o) && l < p && (a - o > 1 || c - l > 1)) {
1551
- let e = (o < m || b(o, i) < w(a, s + 1) || d < a || x >= o && x < a) && (l < h || b(l, r) < w(c, n + 1) || f < c);
1563
+ let e = (o < m || b(o, i) < w(a, s + 1) || d < a || x >= o && x < a) && (l < h || b(l, n) < w(c, r + 1) || f < c);
1552
1564
  for (let t = 0; !e && t < $; t++) {
1553
1565
  const i = z[t];
1554
1566
  e = i.rowIndex >= o && i.rowIndex < a && i.colIndex >= l && i.colIndex < c;
@@ -1557,57 +1569,57 @@ var pe = class t {
1557
1569
  }
1558
1570
  }
1559
1571
  for (const {rowIndex: e, colIndex: t} of z) {
1560
- const i = H(g, e, d);
1572
+ const i = j(g, e, d);
1561
1573
  y.push(e), i >= 0 && y.push(g[i]), v.push(t);
1562
1574
  }
1563
- I(y), I(v);
1564
- const F = A(y, u, m, i, s, d), k = A(v, p, h, r, n, f), O = F.length, C = k.length, T = /* @__PURE__ */ new Map, M = [], _ = [];
1575
+ P(y), P(v);
1576
+ const F = Q(y, u, m, i, s, d), k = Q(v, p, h, n, r, f), O = F.length, C = k.length, T = /* @__PURE__ */ new Map, M = [], _ = [];
1565
1577
  for (const e of z) {
1566
- const t = Q(e, u), i = J(e, p);
1578
+ const t = J(e, u), i = X(e, p);
1567
1579
  M.push(t), _.push(i);
1568
1580
  const s = k.indexOf(e.colIndex);
1569
- for (let r = F.indexOf(e.rowIndex); r < O && F[r] < t; r++) {
1570
- const t = F[r] * p;
1571
- for (let r = s; r < C && k[r] < i; r++) T.set(t + k[r], e);
1581
+ for (let n = F.indexOf(e.rowIndex); n < O && F[n] < t; n++) {
1582
+ const t = F[n] * p;
1583
+ for (let n = s; n < C && k[n] < i; n++) T.set(t + k[n], e);
1572
1584
  }
1573
1585
  }
1574
1586
  const V = [];
1575
1587
  for (const e of k) V.push(!t.$isMeasurable(e) && null);
1576
- const E = [], L = e.$getItemOffset(m), K = [];
1577
- let D = K;
1578
- const G = W.get(e), j = /* @__PURE__ */ new Map;
1588
+ const E = [], K = e.$getItemOffset(m), L = [];
1589
+ let D = L;
1590
+ const G = B.get(e), W = /* @__PURE__ */ new Map;
1579
1591
  for (const o of F) {
1580
- const l = o < m, a = o >= d, y = H(g, o, d), v = l ? 0 : a ? d : y < 0 ? -1 : g[y];
1592
+ const l = o < m, a = o >= d, y = j(g, o, d), v = l ? 0 : a ? d : y < 0 ? -1 : g[y];
1581
1593
  if (o === v) {
1582
1594
  const e = l ? m : a ? u : y + 1 < g.length ? g[y + 1] : d;
1583
1595
  M.push(e);
1584
1596
  const t = [];
1585
- K.push({
1597
+ L.push({
1586
1598
  $key: l ? -1 : a ? -2 : -3 - v,
1587
1599
  $rows: t,
1588
- $style: Y(v, e, l || a ? 0 : null, a ? "bottom" : "top", 4)
1600
+ $style: U(v, e, l || a ? 0 : null, a ? "bottom" : "top", 4)
1589
1601
  }), D = t;
1590
- } else v < 0 && (D = K);
1591
- const z = y >= 0 && o === v, N = l || a || o === x || o >= i && o <= s, w = z ? L : null, $ = o * p, R = G && G.get(o), P = R && R.$cells, I = [];
1602
+ } else v < 0 && (D = L);
1603
+ const z = y >= 0 && o === v, N = l || a || o === x || o >= i && o <= s, w = z ? K : null, $ = o * p, R = G && G.get(o), I = R && R.$cells, P = [];
1592
1604
  let q = 0, F = !e.$isMeasurable(o) && null, O = o + 1, _ = !1;
1593
1605
  for (let e = 0; e < C; e++) {
1594
- const i = k[e], s = i < h, a = i >= f, m = s || a || i >= r && i <= n, d = T.get($ + i);
1606
+ const i = k[e], s = i < h, a = i >= f, m = s || a || i >= n && i <= r, d = T.get($ + i);
1595
1607
  if (d ? d.rowIndex === o && d.colIndex === i : N && m) {
1596
- const r = d ? Q(d, u) : o + 1, n = d ? J(d, p) : i + 1, m = r - o, h = n - i, f = m > 1, g = h > 1, y = f || g;
1608
+ const n = d ? J(d, u) : o + 1, r = d ? X(d, p) : i + 1, m = n - o, h = r - i, f = m > 1, g = h > 1, y = f || g;
1597
1609
  let v, N;
1598
- O = b(O, r);
1599
- const w = s ? t.$getItemOffset(i) : null, $ = a ? t.$getItemOffset(p) - t.$getItemOffset(n) : null;
1610
+ O = b(O, n);
1611
+ const w = s ? t.$getItemOffset(i) : null, $ = a ? t.$getItemOffset(p) - t.$getItemOffset(r) : null;
1600
1612
  !1 !== F || f || (v = o, F = !0), !1 !== V[e] || g || (N = i, V[e] = !0);
1601
1613
  const R = l ? "columnheader" : i === S && (s || z) ? "rowheader" : "cell", x = y ? m : void 0, k = y ? h : void 0, C = "cell" !== R && c && c.rowIndex === o && c.colIndex === i ? c.order : void 0;
1602
1614
  let T;
1603
- if (P) {
1604
- const e = P.length;
1605
- for (;q < e && P[q].$col < i; ) q++;
1606
- q < e && P[q].$col === i && (T = P[q]);
1615
+ if (I) {
1616
+ const e = I.length;
1617
+ for (;q < e && I[q].$col < i; ) q++;
1618
+ q < e && I[q].$col === i && (T = I[q]);
1607
1619
  }
1608
1620
  if (!T || T.$rowSpan !== x || T.$colSpan !== k || T.$start !== w || T.$end !== $ || T.$measureRow !== v || T.$measureCol !== N || T.$role !== R || T.$sort !== C) {
1609
1621
  let e = "1/l" + i;
1610
- y && (e += "/l" + r + "/l" + n);
1622
+ y && (e += "/l" + n + "/l" + r);
1611
1623
  const t = {
1612
1624
  contain: "layout style",
1613
1625
  display: "grid",
@@ -1628,31 +1640,31 @@ var pe = class t {
1628
1640
  $end: $
1629
1641
  }, _ = !0;
1630
1642
  }
1631
- I.push(T);
1643
+ P.push(T);
1632
1644
  }
1633
1645
  }
1634
- if (E.push(F), I.length) {
1635
- const e = R && !_ && R.$cells.length === I.length && R.$top === w ? R : {
1646
+ if (E.push(F), P.length) {
1647
+ const e = R && !_ && R.$cells.length === P.length && R.$top === w ? R : {
1636
1648
  $row: o,
1637
- $cells: I,
1638
- $style: Y(o, O, w, "top", 3),
1649
+ $cells: P,
1650
+ $style: U(o, O, w, "top", 3),
1639
1651
  $top: w
1640
1652
  };
1641
- j.set(o, e), D.push(e);
1653
+ W.set(o, e), D.push(e);
1642
1654
  }
1643
1655
  }
1644
- return W.set(e, j), {
1645
- $rowTemplate: X(e, F, E, I(M), "max-content", u),
1646
- $colTemplate: X(t, k, V, I(_), "minmax(max-content,auto)", p),
1647
- $groups: K
1656
+ return B.set(e, W), {
1657
+ $rowTemplate: Y(e, F, E, P(M), "max-content", u),
1658
+ $colTemplate: Y(t, k, V, P(_), "minmax(max-content,auto)", p),
1659
+ $groups: L
1648
1660
  };
1649
- })(this.F, this.k, this.I.$getRange(this.bufferSize()), this.q.$getRange(this.bufferSize()), this.T(), this.sectionRows(), this.keepMounted(), this.ariaSort())));
1661
+ })(this.k, this.O, this.q.$getRange(this.bufferSize()), this.F.$getRange(this.bufferSize()), this.M(), this.sectionRows(), this.keepMounted(), this.ariaSort())));
1650
1662
  rowItem(e) {
1651
- return D(this.rows(), e);
1663
+ return G(this.rows(), e);
1652
1664
  }
1653
1665
  containerStyle=u(() => {
1654
- this.R();
1655
- const {$rowTemplate: e, $colTemplate: t} = this.plan(), i = this.I.$getItemOffset(0), s = this.q.$getItemOffset(0);
1666
+ this.I();
1667
+ const {$rowTemplate: e, $colTemplate: t} = this.plan(), i = this.q.$getItemOffset(0), s = this.F.$getItemOffset(0);
1656
1668
  return {
1657
1669
  contain: "size style",
1658
1670
  "overflow-anchor": "none",
@@ -1663,20 +1675,19 @@ var pe = class t {
1663
1675
  gap: this.gap() + "px",
1664
1676
  "margin-top": i + "px",
1665
1677
  "margin-inline-start": s + "px",
1666
- height: M(this.I) - i + "px",
1667
- "pointer-events": this.I.$isScrolling() || this.q.$isScrolling() ? "none" : void 0
1678
+ height: M(this.q) - i + "px",
1679
+ "pointer-events": this.q.$isScrolling() || this.F.$isScrolling() ? "none" : void 0
1668
1680
  };
1669
1681
  });
1670
1682
  constructor() {
1671
1683
  m(() => {
1672
- const e = this.rows(), t = this.cols(), i = this.headerRows(), s = this.footerRows(), r = this.headerCols(), n = this.footerCols();
1673
- if (!this.I) return;
1674
- const o = this.O(), l = this.C();
1684
+ const e = this.rows(), t = this.cols(), i = this.headerRows(), s = this.footerRows(), n = this.headerCols(), r = this.footerCols();
1685
+ if (!this.q) return;
1686
+ const o = this.C(), l = this.T();
1675
1687
  S(() => {
1676
- this.F.$setPinned(i, s), this.k.$setPinned(r, n);
1677
- const a = K(e), c = K(t);
1678
- a !== this.I.$getItemsLength() && this.I.$update(5, [ a ]), c !== this.q.$getItemsLength() && this.q.$update(5, [ c ]),
1679
- this.I.$update(9, this.F.$relayout(o, this.I.$getVisibleOffset())), this.q.$update(9, this.k.$relayout(l, this.q.$getVisibleOffset()));
1688
+ this.k.$setPinned(i, s), this.O.$setPinned(n, r);
1689
+ const a = D(e), c = D(t);
1690
+ this.q.$update(5, a), this.F.$update(5, c), _(this.q, this.k, o), _(this.F, this.O, l);
1680
1691
  });
1681
1692
  }), a({
1682
1693
  read: () => {
@@ -1684,115 +1695,115 @@ var pe = class t {
1684
1695
  }
1685
1696
  }), c({
1686
1697
  read: () => {
1687
- this.R(), this.driver.$effect();
1698
+ this.I(), this.driver.$effect();
1688
1699
  }
1689
1700
  }), d(s).onDestroy(() => {
1690
- this.I?.$dispose(), this.q?.$dispose(), this.driver?.$dispose();
1701
+ this.q?.$dispose(), this.F?.$dispose(), this.driver?.$dispose();
1691
1702
  });
1692
1703
  }
1693
1704
  ngOnInit() {
1694
- const e = this.N;
1705
+ const e = this.$;
1695
1706
  e.setAttribute("style", "display:block;overflow:auto;contain:strict;width:100%;height:100%;" + (e.getAttribute("style") || ""));
1696
- const t = this.gap(), i = this.F = G(this.rows(), this.rowHeight(), t), s = this.k = G(this.cols(), this.colWidth(), t), r = this.I = _(i), n = this.q = _(s);
1697
- this.driver = ((e, t) => {
1698
- let i, s, r, n = k(), o = !0;
1699
- const l = /* @__PURE__ */ new WeakMap, a = /* @__PURE__ */ new WeakMap, c = U(n => {
1700
- const c = [], u = [];
1701
- for (const {target: p, contentRect: {width: m, height: d}} of n) if (p === i) m || d ? (o || (s.u(),
1702
- r.u()), o = !0, e.$update(4, d), t.$update(4, m)) : o = !1; else if (p.offsetParent) {
1703
- const e = l.get(p), t = a.get(p);
1704
- null != e && c.push([ e, d ]), null != t && u.push([ t, m ]);
1707
+ const t = this.gap(), i = this.k = W(this.rows(), this.rowHeight(), t), s = this.O = W(this.cols(), this.colWidth(), t), n = this.q = V(i), r = this.F = V(s);
1708
+ this.driver = ((e, t, i, s) => {
1709
+ let n, r, o, l = k(), a = !0;
1710
+ const c = /* @__PURE__ */ new WeakMap, u = /* @__PURE__ */ new WeakMap, p = Z(l => {
1711
+ const p = [], m = [];
1712
+ for (const {target: d, contentRect: {width: h, height: f}} of l) if (d === n) h || f ? (a || (r.p(),
1713
+ o.p()), a = !0, e.$update(4, f), t.$update(4, h)) : a = !1; else if (d.offsetParent) {
1714
+ const e = c.get(d), t = u.get(d);
1715
+ null == e || i.$isSizeEqual(e, f) || p.push([ e, f ]), null == t || s.$isSizeEqual(t, h) || m.push([ t, h ]);
1705
1716
  }
1706
- c.length && e.$update(3, c), u.length && t.$update(3, u);
1717
+ e.$update(3, p), t.$update(3, m);
1707
1718
  });
1708
1719
  return {
1709
1720
  async $scroll(e, t) {
1710
- await n[0] && (e ? r : s).m(t);
1721
+ await l[0] && (e ? o : r).h(t);
1711
1722
  },
1712
- $observe(o, l = o.parentElement) {
1713
- c.i(i = l);
1714
- const a = (e, t) => Z(e, l, l, t, t && "rtl" === getComputedStyle(l).direction, () => {
1715
- const e = t ? "overflowX" : "overflowY", i = l.style, s = i[e];
1716
- i[e] = "hidden", x(() => {
1717
- i[e] = s;
1723
+ $observe(a, c = a.parentElement) {
1724
+ p.o(n = c);
1725
+ const u = (e, t, i) => ee(e, t, c, c, i, i && "rtl" === getComputedStyle(c).direction, () => {
1726
+ const e = i ? "overflowX" : "overflowY", t = c.style, s = t[e];
1727
+ t[e] = "hidden", x(() => {
1728
+ t[e] = s;
1718
1729
  });
1719
1730
  });
1720
- s = a(e, !1), r = a(t, !0), n[1](!0);
1731
+ r = u(e, i, !1), o = u(t, s, !0), l[1](!0);
1721
1732
  },
1722
1733
  $dispose() {
1723
- c.l(), s && s.l(), r && r.l(), n[1](!1), n = k();
1734
+ p.u(), r && r.u(), o && o.u(), l[1](!1), l = k();
1724
1735
  },
1725
- $observeItem: (e, t, i) => (null != t && l.set(e, t), null != i && a.set(e, i),
1726
- c.i(e), () => {
1727
- l.delete(e), a.delete(e), c.o(e);
1736
+ $observeItem: (e, t, i) => (null != t && c.set(e, t), null != i && u.set(e, i),
1737
+ p.o(e), () => {
1738
+ c.delete(e), u.delete(e), p.l(e);
1728
1739
  }),
1729
1740
  $effect() {
1730
- s && s.p(), r && r.p();
1741
+ r && r.m(), o && o.m();
1731
1742
  }
1732
1743
  };
1733
- })(r, n);
1744
+ })(n, r, i, s);
1734
1745
  const o = e => {
1735
- this.R.set(r.$getStateVersion() + n.$getStateVersion()), e && this.$.tick();
1746
+ this.I.set(n.$getStateVersion() + r.$getStateVersion()), e && this.R.tick();
1736
1747
  };
1737
- r.$subscribe(1, o), n.$subscribe(1, o);
1748
+ n.$subscribe(1, o), r.$subscribe(1, o);
1738
1749
  let l = !1;
1739
- r.$subscribe(4, () => {
1740
- l = !0, this.verticalScrolled.emit(r.$getScrollOffset());
1741
- }), n.$subscribe(4, () => {
1742
- l = !0, this.horizontalScrolled.emit(n.$getScrollOffset());
1750
+ n.$subscribe(4, () => {
1751
+ l = !0, this.verticalScrolled.emit(n.$getScrollOffset());
1752
+ }), r.$subscribe(4, () => {
1753
+ l = !0, this.horizontalScrolled.emit(r.$getScrollOffset());
1743
1754
  });
1744
1755
  const a = () => {
1745
- !l || r.$isScrolling() || n.$isScrolling() || (l = !1, this.scrollEnded.emit());
1756
+ !l || n.$isScrolling() || r.$isScrolling() || (l = !1, this.scrollEnded.emit());
1746
1757
  };
1747
1758
  let c;
1748
- r.$subscribe(8, a), n.$subscribe(8, a);
1759
+ n.$subscribe(8, a), r.$subscribe(8, a);
1749
1760
  const u = () => {
1750
1761
  c || (c = !0, F(() => {
1751
1762
  c = !1, this.resized.emit();
1752
1763
  }));
1753
1764
  };
1754
- r.$subscribe(2, u), n.$subscribe(2, u), o();
1765
+ n.$subscribe(2, u), r.$subscribe(2, u), o();
1755
1766
  }
1756
1767
  get verticalScrollOffset() {
1757
- return this.I.$getScrollOffset();
1768
+ return this.q.$getScrollOffset();
1758
1769
  }
1759
1770
  get horizontalScrollOffset() {
1760
- return this.q.$getScrollOffset();
1771
+ return this.F.$getScrollOffset();
1761
1772
  }
1762
1773
  get scrollHeight() {
1763
- return M(this.I);
1774
+ return M(this.q);
1764
1775
  }
1765
1776
  get scrollWidth() {
1766
- return M(this.q);
1777
+ return M(this.F);
1767
1778
  }
1768
1779
  get viewportHeight() {
1769
- return this.I.$getViewportSize();
1780
+ return this.q.$getViewportSize();
1770
1781
  }
1771
1782
  get viewportWidth() {
1772
- return this.q.$getViewportSize();
1783
+ return this.F.$getViewportSize();
1773
1784
  }
1774
1785
  findRowIndex(e) {
1775
- return this.F.$findIndex(e);
1786
+ return this.k.$findIndex(e);
1776
1787
  }
1777
1788
  findColIndex(e) {
1778
- return this.k.$findIndex(e);
1789
+ return this.O.$findIndex(e);
1779
1790
  }
1780
1791
  getRowOffset(e) {
1781
- return this.I.$getItemOffset(e);
1792
+ return this.q.$getItemOffset(e);
1782
1793
  }
1783
1794
  getColOffset(e) {
1784
- return this.q.$getItemOffset(e);
1795
+ return this.F.$getItemOffset(e);
1785
1796
  }
1786
1797
  getRowSize(e) {
1787
- return this.I.$getItemSize(e);
1798
+ return this.k.$getItemSize(e);
1788
1799
  }
1789
1800
  getColSize(e) {
1790
- return this.q.$getItemSize(e);
1801
+ return this.O.$getItemSize(e);
1791
1802
  }
1792
1803
  scrollToIndex(e) {
1793
- ((e, t, i, s, r, n = N, {rowIndex: o, colIndex: l, rowAlign: a, colAlign: c}) => {
1794
- null != o && re(e, t, s, n, o, a, !1), null != l && re(e, i, r, N, l, c, !0);
1795
- })(this.driver, this.I, this.q, this.F, this.k, this.sectionRows(), e);
1804
+ ((e, t, i, s, n, r = N, {rowIndex: o, colIndex: l, rowAlign: a, colAlign: c}) => {
1805
+ null != o && re(e, t, s, r, o, a, !1), null != l && re(e, i, n, N, l, c, !0);
1806
+ })(this.driver, this.q, this.F, this.k, this.O, this.sectionRows(), e);
1796
1807
  }
1797
1808
  scrollTo({vertical: e, horizontal: t}) {
1798
1809
  ((e, t, i) => {
@@ -1800,16 +1811,16 @@ var pe = class t {
1800
1811
  })(this.driver, e, t);
1801
1812
  }
1802
1813
  scrollBy({vertical: e, horizontal: t}) {
1803
- ((e, t, i, s, r) => {
1814
+ ((e, t, i, s, n) => {
1804
1815
  if (null != s) {
1805
1816
  const i = s + t.$getScrollOffset();
1806
1817
  e.$scroll(!1, () => i);
1807
1818
  }
1808
- if (null != r) {
1809
- const t = r + i.$getScrollOffset();
1819
+ if (null != n) {
1820
+ const t = n + i.$getScrollOffset();
1810
1821
  e.$scroll(!0, () => t);
1811
1822
  }
1812
- })(this.driver, this.I, this.q, e, t);
1823
+ })(this.driver, this.q, this.F, e, t);
1813
1824
  }
1814
1825
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
1815
1826
  minVersion: "12.0.0",
@@ -1961,12 +1972,12 @@ var pe = class t {
1961
1972
  isInline: !0,
1962
1973
  dependencies: [ {
1963
1974
  kind: "directive",
1964
- type: e.forwardRef(() => de),
1975
+ type: e.forwardRef(() => he),
1965
1976
  selector: "div[virtuaGridRowGroup]",
1966
1977
  inputs: [ "state", "template", "rows", "cols", "resizer" ]
1967
1978
  }, {
1968
1979
  kind: "directive",
1969
- type: e.forwardRef(() => me),
1980
+ type: e.forwardRef(() => de),
1970
1981
  selector: "div[virtuaGridRow]",
1971
1982
  inputs: [ "state", "template", "row", "cols", "resizer" ]
1972
1983
  } ],
@@ -1976,7 +1987,7 @@ var pe = class t {
1976
1987
 
1977
1988
  i.OnPush, i.OnPush, i.OnPush;
1978
1989
 
1979
- var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class t {
1990
+ var ge = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", Se = class t {
1980
1991
  index=h.required();
1981
1992
  offset=h.required();
1982
1993
  crossOffset=h.required();
@@ -1992,7 +2003,7 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
1992
2003
  visibility: this.hide() ? "hidden" : void 0
1993
2004
  }));
1994
2005
  constructor() {
1995
- const e = d(r).nativeElement;
2006
+ const e = d(n).nativeElement;
1996
2007
  let t;
1997
2008
  c({
1998
2009
  read: () => {
@@ -2068,9 +2079,9 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2068
2079
  },
2069
2080
  ngImport: e
2070
2081
  });
2071
- }, Se = class i {
2082
+ }, ye = class i {
2072
2083
  data=h.required();
2073
- getKey=h(oe);
2084
+ getKey=h(le);
2074
2085
  lanes=h.required();
2075
2086
  gap=h();
2076
2087
  itemSize=h();
@@ -2084,25 +2095,25 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2084
2095
  resized=f();
2085
2096
  template=p.required(l);
2086
2097
  container=y.required("container");
2087
- S;
2088
2098
  v;
2099
+ N;
2089
2100
  driver;
2090
- N=d(r).nativeElement;
2091
- $=d(t);
2092
- R=g(void 0);
2101
+ $=d(n).nativeElement;
2102
+ R=d(t);
2103
+ I=g(void 0);
2093
2104
  P=u(() => {
2094
- this.R();
2095
- const e = this.data().length, [t, i] = this.S.$getRange(this.bufferSize()), s = this.keepMounted(), r = [];
2105
+ this.I();
2106
+ const e = this.data().length, [t, i] = this.v.$getRange(this.bufferSize()), s = this.keepMounted(), n = [];
2096
2107
  if (s) {
2097
- const n = new Set(s);
2098
- for (let e = t; e <= i; e++) n.add(e);
2099
- for (const t of I([ ...n ])) t < e && r.push(t);
2100
- } else for (let e = t; e <= i; e++) r.push(e);
2101
- return r;
2108
+ const r = new Set(s);
2109
+ for (let e = t; e <= i; e++) r.add(e);
2110
+ for (const t of P([ ...r ])) t < e && n.push(t);
2111
+ } else for (let e = t; e <= i; e++) n.push(e);
2112
+ return n;
2102
2113
  });
2103
2114
  items=u(() => {
2104
- this.R();
2105
- const e = this.S, t = this.v, i = this.data(), s = this.getKey(), r = t.$getGap(), n = t.$getLanes(), o = fe(1 / n, r / n - r), l = [];
2115
+ this.I();
2116
+ const e = this.v, t = this.N, i = this.data(), s = this.getKey(), n = t.$getGap(), r = t.$getLanes(), o = ge(1 / r, n / r - n), l = [];
2106
2117
  for (const a of this.P()) {
2107
2118
  const c = i[a], u = t.$getItemLane(a);
2108
2119
  l.push({
@@ -2110,32 +2121,32 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2110
2121
  index: a,
2111
2122
  data: c,
2112
2123
  offset: e.$getItemOffset(a),
2113
- crossOffset: fe(u / n, u * r / n),
2124
+ crossOffset: ge(u / r, u * n / r),
2114
2125
  crossSize: o,
2115
- hide: e.$isUnmeasuredItem(a)
2126
+ hide: t.$isSizeEqual(a)
2116
2127
  });
2117
2128
  }
2118
2129
  return l;
2119
2130
  });
2120
- containerStyle=u(() => (this.R(), {
2131
+ containerStyle=u(() => (this.I(), {
2121
2132
  contain: "size style",
2122
2133
  "overflow-anchor": "none",
2123
2134
  flex: "none",
2124
2135
  position: "relative",
2125
2136
  width: "100%",
2126
- height: this.S.$getTotalSize() + "px",
2127
- "pointer-events": this.S.$isScrolling() ? "none" : void 0
2137
+ height: this.v.$getTotalSize() + "px",
2138
+ "pointer-events": this.v.$isScrolling() ? "none" : void 0
2128
2139
  }));
2129
2140
  constructor() {
2130
2141
  m(() => {
2131
2142
  const e = this.data();
2132
- this.S && S(() => {
2133
- e.length !== this.S.$getItemsLength() && this.S.$update(5, [ e.length ]);
2143
+ this.v && S(() => {
2144
+ this.v.$update(5, e.length);
2134
2145
  });
2135
2146
  }), m(() => {
2136
2147
  const e = this.lanes(), t = this.gap();
2137
- this.S && S(() => {
2138
- this.S.$update(9, this.v.$relayout(e, t, this.S.$getVisibleOffset()));
2148
+ this.v && S(() => {
2149
+ _(this.v, this.N, e, t);
2139
2150
  });
2140
2151
  }), a({
2141
2152
  read: () => {
@@ -2143,125 +2154,116 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2143
2154
  }
2144
2155
  }), c({
2145
2156
  read: () => {
2146
- this.R(), this.driver.$effect();
2157
+ this.I(), this.driver.$effect();
2147
2158
  }
2148
2159
  }), d(s).onDestroy(() => {
2149
- this.S?.$dispose(), this.driver?.$dispose();
2160
+ this.v?.$dispose(), this.driver?.$dispose();
2150
2161
  });
2151
2162
  }
2152
2163
  ngOnInit() {
2153
- const e = this.N;
2164
+ const e = this.$;
2154
2165
  e.setAttribute("style", "display:block;overflow-y:auto;contain:strict;width:100%;height:100%;" + (e.getAttribute("style") || ""));
2155
- const t = this.v = ((e, t, i = 0, s, r) => {
2156
- let n = b(t, 1), o = r && r[1] || s || 40, l = -1, a = s ? void 0 : /* @__PURE__ */ new Set, c = !s;
2157
- const u = r && r[0], p = u ? V(u.slice(0, w(e, u.length)), b(0, e - u.length)) : V([], e), m = [], d = [], h = [], f = e => {
2158
- const t = p[e];
2166
+ const t = this.N = ((e, t, i = 0, s, n) => {
2167
+ let r = b(t, 1), o = n && n[1] || s || 40, l = -1, a = s ? void 0 : /* @__PURE__ */ new Set, c = !s;
2168
+ const u = n ? n[0].slice(0, e) : [];
2169
+ E(u, e - u.length);
2170
+ const p = [], m = [], d = [ 0 ], h = e => {
2171
+ const t = u[e];
2159
2172
  return -1 === t ? o : t;
2160
- }, g = t => {
2161
- if (t = w(t, e - 1), l >= t) return;
2162
- const s = [], r = [];
2163
- for (let e = 0; e < n; e++) s.push(0), r.push(-1);
2164
- for (let e = l, t = n; e >= 0 && t; e--) {
2165
- const i = d[e];
2166
- -1 === r[i] && (r[i] = e, s[i] = m[e] + f(e), t--);
2173
+ }, f = () => {
2174
+ if (l >= e - 1) return;
2175
+ const t = [], s = [];
2176
+ for (let e = 0; e < r; e++) t.push(0), s.push(-1);
2177
+ for (let e = l, n = r; e >= 0 && n; e--) {
2178
+ const r = m[e];
2179
+ -1 === s[r] && (s[r] = e, t[r] = p[e] + h(e) + i, n--);
2167
2180
  }
2168
- for (;l < t; ) {
2181
+ for (;l < e - 1; ) {
2169
2182
  const e = ++l;
2170
- let t = 0, o = 1 / 0, a = 1 / 0;
2171
- for (let e = 0; e < n; e++) {
2172
- const n = s[e] + (r[e] >= 0 ? i : 0);
2173
- (n < o || n === o && r[e] < a) && (t = e, o = n, a = r[e]);
2183
+ let n = 0, o = 1 / 0, a = 1 / 0;
2184
+ for (let e = 0; e < r; e++) {
2185
+ const i = t[e];
2186
+ (i < o || i === o && s[e] < a) && (n = e, o = i, a = s[e]);
2174
2187
  }
2175
- m[e] = o, d[e] = t, s[t] = o + f(e), r[t] = e, h[e] = b(e ? h[e - 1] : 0, s[t]);
2188
+ const c = o + h(e);
2189
+ p[e] = o, m[e] = n, t[n] = c + i, s[n] = e, d[e + 1] = b(d[e], c);
2176
2190
  }
2177
- }, S = t => t >= e ? v() : (g(t), m[t]), y = e => (g(e), h[e]), v = () => e ? y(e - 1) : 0, z = t => {
2178
- if (!e) return 0;
2179
- const i = E(y, e, t);
2180
- return y(i) <= t ? i + 1 : i;
2181
- };
2191
+ }, g = t => t >= e ? y() : (f(), p[t]), S = e => (f(), d[e]), y = () => S(e), v = t => K(S, e + 1, t);
2182
2192
  return {
2183
2193
  $getRange: (t, i) => {
2184
- const s = E(S, e, i);
2185
- return [ w(z(t), s), s ];
2194
+ const s = K(g, e, i);
2195
+ return [ w(v(t), s), s ];
2186
2196
  },
2187
- $getItemOffset: S,
2188
- $getItemSize: f,
2189
- $isSizeEqual: (e, t = -1) => p[e] === t,
2190
- $resize: (t, s, r, u) => {
2191
- let m = z(r);
2192
- for (;m > 0 && !s(m - 1); ) m--;
2193
- for (;m < e && s(m); ) m++;
2194
- const d = S(m);
2195
- for (const [e, i] of t) p[e] = i, a && a.add(e), l = w(e - 1, l);
2196
- let h = S(m) - d;
2197
- if (a && u) {
2197
+ $findIndex: v,
2198
+ $getItemOffset: g,
2199
+ $getItemSize: h,
2200
+ $isSizeEqual: (e, t = -1) => u[e] === t,
2201
+ $setItemSizes: (e, t) => {
2202
+ for (const [t, i] of e) u[t] = i, a && a.add(t), l = w(t - 1, l);
2203
+ if (a && t) {
2198
2204
  const e = [];
2199
- let t = 0;
2200
- if (a.forEach(s => {
2201
- const r = p[s];
2202
- r > 0 && (e.push(r), t += r + i);
2203
- }), t > u * n) {
2204
- I(e);
2205
- const t = e.length, i = t / 2 | 0, s = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], n = z(r + h), u = S(n);
2206
- o = s, l = -1, h += S(n) - u, a = void 0, c = !1;
2205
+ let s = 0;
2206
+ if (a.forEach(t => {
2207
+ const n = u[t];
2208
+ -1 !== n && n && (e.push(n), s += n + i);
2209
+ }), s > t * r) {
2210
+ P(e);
2211
+ const t = e.length, i = t / 2 | 0;
2212
+ o = t % 2 == 0 ? (e[i - 1] + e[i]) / 2 : e[i], l = -1, a = void 0, c = !1;
2207
2213
  }
2208
2214
  }
2209
- return h;
2210
2215
  },
2211
- $getTotalSize: v,
2216
+ $getTotalSize: y,
2212
2217
  $getLength: () => e,
2213
2218
  $setLength: t => {
2214
2219
  const i = t - e;
2215
- return l = w(t - 1, l), e = t, i > 0 ? V(p, i) : p.splice(i), 0;
2216
- },
2217
- $relayout: (e, t = 0, r) => {
2218
- if ((e = b(e, 1)) === n && t === i) return;
2219
- const o = z(r), c = S(o);
2220
- return n = e, i = t, l = -1, a = s ? void 0 : /* @__PURE__ */ new Set, S(o) - c;
2220
+ l = w(t - 1, l), e = t, i > 0 ? E(u, i) : u.splice(i);
2221
2221
  },
2222
+ $relayout: (e, t = 0) => ((e = b(e, 1)) !== r || t !== i) && (r = e, i = t, l = -1,
2223
+ a = s ? void 0 : /* @__PURE__ */ new Set, !0),
2222
2224
  $isEstimating: () => c,
2223
- $snapshot: () => [ p.slice(), o ],
2224
- $getLanes: () => n,
2225
+ $snapshot: () => [ u.slice(), o ],
2226
+ $getLanes: () => r,
2225
2227
  $getGap: () => i,
2226
- $getItemLane: e => (g(e), d[e])
2228
+ $getItemLane: e => (f(), m[e])
2227
2229
  };
2228
- })(this.data().length, this.lanes(), this.gap(), this.itemSize(), this.cacheProp()), i = this.S = _(t);
2229
- this.driver = ee(i, !1), i.$subscribe(1, e => {
2230
- this.R.set(i.$getStateVersion()), e && this.$.tick();
2230
+ })(this.data().length, this.lanes(), this.gap(), this.itemSize(), this.cacheProp()), i = this.v = V(t);
2231
+ this.driver = te(i, t, !1), i.$subscribe(1, e => {
2232
+ this.I.set(i.$getStateVersion()), e && this.R.tick();
2231
2233
  }), i.$subscribe(4, () => {
2232
2234
  this.scrolled.emit(i.$getScrollOffset());
2233
2235
  }), i.$subscribe(8, () => {
2234
2236
  this.scrollEnded.emit();
2235
2237
  }), i.$subscribe(2, () => {
2236
2238
  this.resized.emit();
2237
- }), this.R.set(i.$getStateVersion());
2239
+ }), this.I.set(i.$getStateVersion());
2238
2240
  }
2239
2241
  get cache() {
2240
- return this.v.$snapshot();
2242
+ return this.N.$snapshot();
2241
2243
  }
2242
2244
  get scrollOffset() {
2243
- return this.S.$getScrollOffset();
2245
+ return this.v.$getScrollOffset();
2244
2246
  }
2245
2247
  get scrollSize() {
2246
- return M(this.S);
2248
+ return M(this.v);
2247
2249
  }
2248
2250
  get viewportSize() {
2249
- return this.S.$getViewportSize();
2251
+ return this.v.$getViewportSize();
2250
2252
  }
2251
2253
  getItemOffset(e) {
2252
- return this.S.$getItemOffset(e);
2254
+ return this.v.$getItemOffset(e);
2253
2255
  }
2254
2256
  getItemSize(e) {
2255
- return this.S.$getItemSize(e);
2257
+ return this.N.$getItemSize(e);
2256
2258
  }
2257
2259
  scrollToIndex(e, t) {
2258
- se(this.driver, this.S, e, t);
2260
+ ne(this.driver, this.v, this.N, e, t);
2259
2261
  }
2260
2262
  scrollTo(e) {
2261
- te(this.driver, e);
2263
+ ie(this.driver, e);
2262
2264
  }
2263
2265
  scrollBy(e) {
2264
- ie(this.driver, this.S, e);
2266
+ se(this.driver, this.v, e);
2265
2267
  }
2266
2268
  static ɵfac=/*@__PURE__*/ e.ɵɵngDeclareFactory({
2267
2269
  minVersion: "12.0.0",
@@ -2361,7 +2363,7 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2361
2363
  isInline: !0,
2362
2364
  dependencies: [ {
2363
2365
  kind: "directive",
2364
- type: e.forwardRef(() => ge),
2366
+ type: e.forwardRef(() => Se),
2365
2367
  selector: "div[virtuaMasonryItem]",
2366
2368
  inputs: [ "index", "offset", "crossOffset", "crossSize", "hide", "resizer" ]
2367
2369
  }, {
@@ -2376,5 +2378,5 @@ var fe = (e, t) => t ? `calc(${100 * e}% + ${t}px)` : 100 * e + "%", ge = class
2376
2378
 
2377
2379
  i.OnPush;
2378
2380
 
2379
- export { he as VGrid, ce as VList, Se as VMasonry, ae as Virtualizer, ue as WindowVirtualizer };
2381
+ export { fe as VGrid, ue as VList, ye as VMasonry, ce as Virtualizer, pe as WindowVirtualizer };
2380
2382
  //# sourceMappingURL=index.js.map