@cagatayfdn/flora-components 0.0.166 → 0.0.167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ErrorLogModal-DJd2j2Qz.js → ErrorLogModal-BILc779f.js} +1 -1
- package/dist/ReactToastify.css +1 -1
- package/dist/Table.css +1 -1
- package/dist/Table.module-CGdiBxq5.js +37 -0
- package/dist/components/ErrorLogModal/ErrorLogModal.js +1 -1
- package/dist/components/RealtimeLogModal/RealtimeLogModal.js +2 -2
- package/dist/components/Table/Table.js +259 -205
- package/dist/components/Table/TableHeader.js +1 -1
- package/dist/components/Table/TableSort.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index-CXhMrx5k.js +3095 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/main.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/table.js +1 -1
- package/package.json +1 -1
- package/dist/Table.module-rFa4-NE2.js +0 -29
- package/dist/index-Bkqwn3Ht.js +0 -3311
|
@@ -0,0 +1,3095 @@
|
|
|
1
|
+
import { j as N } from "./jsx-runtime-BcAkpsdy.js";
|
|
2
|
+
import B, { createElement as ut } from "react";
|
|
3
|
+
import Jo from "react-dom";
|
|
4
|
+
const vt = 0, Ee = 1, _e = 2, vo = 4;
|
|
5
|
+
function Zt(e) {
|
|
6
|
+
return () => e;
|
|
7
|
+
}
|
|
8
|
+
function Qo(e) {
|
|
9
|
+
e();
|
|
10
|
+
}
|
|
11
|
+
function xo(e, t) {
|
|
12
|
+
return (o) => e(t(o));
|
|
13
|
+
}
|
|
14
|
+
function Jt(e, t) {
|
|
15
|
+
return () => e(t);
|
|
16
|
+
}
|
|
17
|
+
function en(e, t) {
|
|
18
|
+
return (o) => e(t, o);
|
|
19
|
+
}
|
|
20
|
+
function Ot(e) {
|
|
21
|
+
return e !== void 0;
|
|
22
|
+
}
|
|
23
|
+
function tn(...e) {
|
|
24
|
+
return () => {
|
|
25
|
+
e.map(Qo);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function tt() {
|
|
29
|
+
}
|
|
30
|
+
function xt(e, t) {
|
|
31
|
+
return t(e), e;
|
|
32
|
+
}
|
|
33
|
+
function on(e, t) {
|
|
34
|
+
return t(e);
|
|
35
|
+
}
|
|
36
|
+
function J(...e) {
|
|
37
|
+
return e;
|
|
38
|
+
}
|
|
39
|
+
function q(e, t) {
|
|
40
|
+
return e(Ee, t);
|
|
41
|
+
}
|
|
42
|
+
function j(e, t) {
|
|
43
|
+
e(vt, t);
|
|
44
|
+
}
|
|
45
|
+
function Wt(e) {
|
|
46
|
+
e(_e);
|
|
47
|
+
}
|
|
48
|
+
function ee(e) {
|
|
49
|
+
return e(vo);
|
|
50
|
+
}
|
|
51
|
+
function k(e, t) {
|
|
52
|
+
return q(e, en(t, vt));
|
|
53
|
+
}
|
|
54
|
+
function Ie(e, t) {
|
|
55
|
+
const o = e(Ee, (n) => {
|
|
56
|
+
o(), t(n);
|
|
57
|
+
});
|
|
58
|
+
return o;
|
|
59
|
+
}
|
|
60
|
+
function Qt(e) {
|
|
61
|
+
let t, o;
|
|
62
|
+
return (n) => (r) => {
|
|
63
|
+
t = r, o && clearTimeout(o), o = setTimeout(() => {
|
|
64
|
+
n(t);
|
|
65
|
+
}, e);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function Io(e, t) {
|
|
69
|
+
return e === t;
|
|
70
|
+
}
|
|
71
|
+
function Z(e = Io) {
|
|
72
|
+
let t;
|
|
73
|
+
return (o) => (n) => {
|
|
74
|
+
e(t, n) || (t = n, o(n));
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function W(e) {
|
|
78
|
+
return (t) => (o) => {
|
|
79
|
+
e(o) && t(o);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function b(e) {
|
|
83
|
+
return (t) => xo(t, e);
|
|
84
|
+
}
|
|
85
|
+
function Se(e) {
|
|
86
|
+
return (t) => () => {
|
|
87
|
+
t(e);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function p(e, ...t) {
|
|
91
|
+
const o = nn(...t);
|
|
92
|
+
return (n, r) => {
|
|
93
|
+
switch (n) {
|
|
94
|
+
case _e:
|
|
95
|
+
Wt(e);
|
|
96
|
+
return;
|
|
97
|
+
case Ee:
|
|
98
|
+
return q(e, o(r));
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function Ce(e, t) {
|
|
103
|
+
return (o) => (n) => {
|
|
104
|
+
o(t = e(t, n));
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function Pe(e) {
|
|
108
|
+
return (t) => (o) => {
|
|
109
|
+
e > 0 ? e-- : t(o);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function ye(e) {
|
|
113
|
+
let t = null, o;
|
|
114
|
+
return (n) => (r) => {
|
|
115
|
+
t = r, !o && (o = setTimeout(() => {
|
|
116
|
+
o = void 0, n(t);
|
|
117
|
+
}, e));
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function D(...e) {
|
|
121
|
+
const t = new Array(e.length);
|
|
122
|
+
let o = 0, n = null;
|
|
123
|
+
const r = Math.pow(2, e.length) - 1;
|
|
124
|
+
return e.forEach((i, l) => {
|
|
125
|
+
const s = Math.pow(2, l);
|
|
126
|
+
q(i, (c) => {
|
|
127
|
+
const a = o;
|
|
128
|
+
o = o | s, t[l] = c, a !== r && o === r && n && (n(), n = null);
|
|
129
|
+
});
|
|
130
|
+
}), (i) => (l) => {
|
|
131
|
+
const s = () => {
|
|
132
|
+
i([l].concat(t));
|
|
133
|
+
};
|
|
134
|
+
o === r ? s() : n = s;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function nn(...e) {
|
|
138
|
+
return (t) => e.reduceRight(on, t);
|
|
139
|
+
}
|
|
140
|
+
function rn(e) {
|
|
141
|
+
let t, o;
|
|
142
|
+
const n = () => t == null ? void 0 : t();
|
|
143
|
+
return function(r, i) {
|
|
144
|
+
switch (r) {
|
|
145
|
+
case Ee:
|
|
146
|
+
return i ? o === i ? void 0 : (n(), o = i, t = q(e, i), t) : (n(), tt);
|
|
147
|
+
case _e:
|
|
148
|
+
n(), o = null;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function S(e) {
|
|
154
|
+
let t = e;
|
|
155
|
+
const o = F();
|
|
156
|
+
return (n, r) => {
|
|
157
|
+
switch (n) {
|
|
158
|
+
case vt:
|
|
159
|
+
t = r;
|
|
160
|
+
break;
|
|
161
|
+
case Ee: {
|
|
162
|
+
r(t);
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
case vo:
|
|
166
|
+
return t;
|
|
167
|
+
}
|
|
168
|
+
return o(n, r);
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function se(e, t) {
|
|
172
|
+
return xt(S(t), (o) => k(e, o));
|
|
173
|
+
}
|
|
174
|
+
function F() {
|
|
175
|
+
const e = [];
|
|
176
|
+
return (t, o) => {
|
|
177
|
+
switch (t) {
|
|
178
|
+
case vt:
|
|
179
|
+
e.slice().forEach((n) => {
|
|
180
|
+
n(o);
|
|
181
|
+
});
|
|
182
|
+
return;
|
|
183
|
+
case _e:
|
|
184
|
+
e.splice(0, e.length);
|
|
185
|
+
return;
|
|
186
|
+
case Ee:
|
|
187
|
+
return e.push(o), () => {
|
|
188
|
+
const n = e.indexOf(o);
|
|
189
|
+
n > -1 && e.splice(n, 1);
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function he(e) {
|
|
195
|
+
return xt(F(), (t) => k(e, t));
|
|
196
|
+
}
|
|
197
|
+
function U(e, t = [], { singleton: o } = { singleton: !0 }) {
|
|
198
|
+
return {
|
|
199
|
+
constructor: e,
|
|
200
|
+
dependencies: t,
|
|
201
|
+
id: ln(),
|
|
202
|
+
singleton: o
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const ln = () => Symbol();
|
|
206
|
+
function sn(e) {
|
|
207
|
+
const t = /* @__PURE__ */ new Map(), o = ({ constructor: n, dependencies: r, id: i, singleton: l }) => {
|
|
208
|
+
if (l && t.has(i))
|
|
209
|
+
return t.get(i);
|
|
210
|
+
const s = n(r.map((c) => o(c)));
|
|
211
|
+
return l && t.set(i, s), s;
|
|
212
|
+
};
|
|
213
|
+
return o(e);
|
|
214
|
+
}
|
|
215
|
+
function te(...e) {
|
|
216
|
+
const t = F(), o = new Array(e.length);
|
|
217
|
+
let n = 0;
|
|
218
|
+
const r = Math.pow(2, e.length) - 1;
|
|
219
|
+
return e.forEach((i, l) => {
|
|
220
|
+
const s = Math.pow(2, l);
|
|
221
|
+
q(i, (c) => {
|
|
222
|
+
o[l] = c, n = n | s, n === r && j(t, o);
|
|
223
|
+
});
|
|
224
|
+
}), function(i, l) {
|
|
225
|
+
switch (i) {
|
|
226
|
+
case _e: {
|
|
227
|
+
Wt(t);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
case Ee:
|
|
231
|
+
return n === r && l(o), q(t, l);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function O(e, t = Io) {
|
|
236
|
+
return p(e, Z(t));
|
|
237
|
+
}
|
|
238
|
+
function Rt(...e) {
|
|
239
|
+
return function(t, o) {
|
|
240
|
+
switch (t) {
|
|
241
|
+
case _e:
|
|
242
|
+
return;
|
|
243
|
+
case Ee:
|
|
244
|
+
return tn(...e.map((n) => q(n, o)));
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
var ue = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(ue || {});
|
|
249
|
+
const cn = {
|
|
250
|
+
0: "debug",
|
|
251
|
+
3: "error",
|
|
252
|
+
1: "log",
|
|
253
|
+
2: "warn"
|
|
254
|
+
}, an = () => typeof globalThis > "u" ? window : globalThis, ke = U(
|
|
255
|
+
() => {
|
|
256
|
+
const e = S(
|
|
257
|
+
3
|
|
258
|
+
/* ERROR */
|
|
259
|
+
);
|
|
260
|
+
return {
|
|
261
|
+
log: S((t, o, n = 1) => {
|
|
262
|
+
var r;
|
|
263
|
+
const i = (r = an().VIRTUOSO_LOG_LEVEL) != null ? r : ee(e);
|
|
264
|
+
n >= i && console[cn[n]](
|
|
265
|
+
"%creact-virtuoso: %c%s %o",
|
|
266
|
+
"color: #0253b3; font-weight: bold",
|
|
267
|
+
"color: initial",
|
|
268
|
+
t,
|
|
269
|
+
o
|
|
270
|
+
);
|
|
271
|
+
}),
|
|
272
|
+
logLevel: e
|
|
273
|
+
};
|
|
274
|
+
},
|
|
275
|
+
[],
|
|
276
|
+
{ singleton: !0 }
|
|
277
|
+
);
|
|
278
|
+
function je(e, t, o) {
|
|
279
|
+
return At(e, t, o).callbackRef;
|
|
280
|
+
}
|
|
281
|
+
function At(e, t, o) {
|
|
282
|
+
const n = B.useRef(null);
|
|
283
|
+
let r = (l) => {
|
|
284
|
+
};
|
|
285
|
+
const i = B.useMemo(() => typeof ResizeObserver < "u" ? new ResizeObserver((l) => {
|
|
286
|
+
const s = () => {
|
|
287
|
+
const c = l[0].target;
|
|
288
|
+
c.offsetParent !== null && e(c);
|
|
289
|
+
};
|
|
290
|
+
o ? s() : requestAnimationFrame(s);
|
|
291
|
+
}) : null, [e, o]);
|
|
292
|
+
return r = (l) => {
|
|
293
|
+
l && t ? (i == null || i.observe(l), n.current = l) : (n.current && (i == null || i.unobserve(n.current)), n.current = null);
|
|
294
|
+
}, { callbackRef: r, ref: n };
|
|
295
|
+
}
|
|
296
|
+
function un(e, t, o, n, r, i, l, s, c) {
|
|
297
|
+
const a = B.useCallback(
|
|
298
|
+
(m) => {
|
|
299
|
+
const I = dn(m.children, t, s ? "offsetWidth" : "offsetHeight", r);
|
|
300
|
+
let g = m.parentElement;
|
|
301
|
+
for (; !g.dataset.virtuosoScroller; )
|
|
302
|
+
g = g.parentElement;
|
|
303
|
+
const x = g.lastElementChild.dataset.viewportType === "window";
|
|
304
|
+
let H;
|
|
305
|
+
x && (H = g.ownerDocument.defaultView);
|
|
306
|
+
const z = l ? s ? l.scrollLeft : l.scrollTop : x ? s ? H.scrollX || H.document.documentElement.scrollLeft : H.scrollY || H.document.documentElement.scrollTop : s ? g.scrollLeft : g.scrollTop, v = l ? s ? l.scrollWidth : l.scrollHeight : x ? s ? H.document.documentElement.scrollWidth : H.document.documentElement.scrollHeight : s ? g.scrollWidth : g.scrollHeight, f = l ? s ? l.offsetWidth : l.offsetHeight : x ? s ? H.innerWidth : H.innerHeight : s ? g.offsetWidth : g.offsetHeight;
|
|
307
|
+
n({
|
|
308
|
+
scrollHeight: v,
|
|
309
|
+
scrollTop: Math.max(z, 0),
|
|
310
|
+
viewportHeight: f
|
|
311
|
+
}), i == null || i(
|
|
312
|
+
s ? eo("column-gap", getComputedStyle(m).columnGap, r) : eo("row-gap", getComputedStyle(m).rowGap, r)
|
|
313
|
+
), I !== null && e(I);
|
|
314
|
+
},
|
|
315
|
+
[e, t, r, i, l, n, s]
|
|
316
|
+
);
|
|
317
|
+
return At(a, o, c);
|
|
318
|
+
}
|
|
319
|
+
function dn(e, t, o, n) {
|
|
320
|
+
const r = e.length;
|
|
321
|
+
if (r === 0)
|
|
322
|
+
return null;
|
|
323
|
+
const i = [];
|
|
324
|
+
for (let l = 0; l < r; l++) {
|
|
325
|
+
const s = e.item(l);
|
|
326
|
+
if (s.dataset.index === void 0)
|
|
327
|
+
continue;
|
|
328
|
+
const c = parseInt(s.dataset.index), a = parseFloat(s.dataset.knownSize), m = t(s, o);
|
|
329
|
+
if (m === 0 && n("Zero-sized element, this should not happen", { child: s }, ue.ERROR), m === a)
|
|
330
|
+
continue;
|
|
331
|
+
const I = i[i.length - 1];
|
|
332
|
+
i.length === 0 || I.size !== m || I.endIndex !== c - 1 ? i.push({ endIndex: c, size: m, startIndex: c }) : i[i.length - 1].endIndex++;
|
|
333
|
+
}
|
|
334
|
+
return i;
|
|
335
|
+
}
|
|
336
|
+
function eo(e, t, o) {
|
|
337
|
+
return t !== "normal" && !(t != null && t.endsWith("px")) && o(`${e} was not resolved to pixel value correctly`, t, ue.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
338
|
+
}
|
|
339
|
+
function To(e, t, o) {
|
|
340
|
+
const n = B.useRef(null), r = B.useCallback(
|
|
341
|
+
(c) => {
|
|
342
|
+
if (!(c != null && c.offsetParent))
|
|
343
|
+
return;
|
|
344
|
+
const a = c.getBoundingClientRect(), m = a.width;
|
|
345
|
+
let I, g;
|
|
346
|
+
if (t) {
|
|
347
|
+
const x = t.getBoundingClientRect(), H = a.top - x.top;
|
|
348
|
+
g = x.height - Math.max(0, H), I = H + t.scrollTop;
|
|
349
|
+
} else {
|
|
350
|
+
const x = l.current.ownerDocument.defaultView;
|
|
351
|
+
g = x.innerHeight - Math.max(0, a.top), I = a.top + x.scrollY;
|
|
352
|
+
}
|
|
353
|
+
n.current = {
|
|
354
|
+
offsetTop: I,
|
|
355
|
+
visibleHeight: g,
|
|
356
|
+
visibleWidth: m
|
|
357
|
+
}, e(n.current);
|
|
358
|
+
},
|
|
359
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
360
|
+
[e, t]
|
|
361
|
+
), { callbackRef: i, ref: l } = At(r, !0, o), s = B.useCallback(() => {
|
|
362
|
+
r(l.current);
|
|
363
|
+
}, [r, l]);
|
|
364
|
+
return B.useEffect(() => {
|
|
365
|
+
var c;
|
|
366
|
+
if (t) {
|
|
367
|
+
t.addEventListener("scroll", s);
|
|
368
|
+
const a = new ResizeObserver(() => {
|
|
369
|
+
requestAnimationFrame(s);
|
|
370
|
+
});
|
|
371
|
+
return a.observe(t), () => {
|
|
372
|
+
t.removeEventListener("scroll", s), a.unobserve(t);
|
|
373
|
+
};
|
|
374
|
+
} else {
|
|
375
|
+
const a = (c = l.current) == null ? void 0 : c.ownerDocument.defaultView;
|
|
376
|
+
return a == null || a.addEventListener("scroll", s), a == null || a.addEventListener("resize", s), () => {
|
|
377
|
+
a == null || a.removeEventListener("scroll", s), a == null || a.removeEventListener("resize", s);
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
}, [s, t, l]), i;
|
|
381
|
+
}
|
|
382
|
+
const ce = U(
|
|
383
|
+
() => {
|
|
384
|
+
const e = F(), t = F(), o = S(0), n = F(), r = S(0), i = F(), l = F(), s = S(0), c = S(0), a = S(0), m = S(0), I = F(), g = F(), x = S(!1), H = S(!1), z = S(!1);
|
|
385
|
+
return k(
|
|
386
|
+
p(
|
|
387
|
+
e,
|
|
388
|
+
b(({ scrollTop: v }) => v)
|
|
389
|
+
),
|
|
390
|
+
t
|
|
391
|
+
), k(
|
|
392
|
+
p(
|
|
393
|
+
e,
|
|
394
|
+
b(({ scrollHeight: v }) => v)
|
|
395
|
+
),
|
|
396
|
+
l
|
|
397
|
+
), k(t, r), {
|
|
398
|
+
deviation: o,
|
|
399
|
+
fixedFooterHeight: a,
|
|
400
|
+
fixedHeaderHeight: c,
|
|
401
|
+
footerHeight: m,
|
|
402
|
+
headerHeight: s,
|
|
403
|
+
horizontalDirection: H,
|
|
404
|
+
scrollBy: g,
|
|
405
|
+
// input
|
|
406
|
+
scrollContainerState: e,
|
|
407
|
+
scrollHeight: l,
|
|
408
|
+
scrollingInProgress: x,
|
|
409
|
+
// signals
|
|
410
|
+
scrollTo: I,
|
|
411
|
+
scrollTop: t,
|
|
412
|
+
skipAnimationFrameInResizeObserver: z,
|
|
413
|
+
smoothScrollTargetReached: n,
|
|
414
|
+
// state
|
|
415
|
+
statefulScrollTop: r,
|
|
416
|
+
viewportHeight: i
|
|
417
|
+
};
|
|
418
|
+
},
|
|
419
|
+
[],
|
|
420
|
+
{ singleton: !0 }
|
|
421
|
+
), Xe = { lvl: 0 };
|
|
422
|
+
function wo(e, t) {
|
|
423
|
+
const o = e.length;
|
|
424
|
+
if (o === 0)
|
|
425
|
+
return [];
|
|
426
|
+
let { index: n, value: r } = t(e[0]);
|
|
427
|
+
const i = [];
|
|
428
|
+
for (let l = 1; l < o; l++) {
|
|
429
|
+
const { index: s, value: c } = t(e[l]);
|
|
430
|
+
i.push({ end: s - 1, start: n, value: r }), n = s, r = c;
|
|
431
|
+
}
|
|
432
|
+
return i.push({ end: 1 / 0, start: n, value: r }), i;
|
|
433
|
+
}
|
|
434
|
+
function K(e) {
|
|
435
|
+
return e === Xe;
|
|
436
|
+
}
|
|
437
|
+
function Ze(e, t) {
|
|
438
|
+
if (!K(e))
|
|
439
|
+
return t === e.k ? e.v : t < e.k ? Ze(e.l, t) : Ze(e.r, t);
|
|
440
|
+
}
|
|
441
|
+
function Te(e, t, o = "k") {
|
|
442
|
+
if (K(e))
|
|
443
|
+
return [-1 / 0, void 0];
|
|
444
|
+
if (Number(e[o]) === t)
|
|
445
|
+
return [e.k, e.v];
|
|
446
|
+
if (Number(e[o]) < t) {
|
|
447
|
+
const n = Te(e.r, t, o);
|
|
448
|
+
return n[0] === -1 / 0 ? [e.k, e.v] : n;
|
|
449
|
+
}
|
|
450
|
+
return Te(e.l, t, o);
|
|
451
|
+
}
|
|
452
|
+
function de(e, t, o) {
|
|
453
|
+
return K(e) ? Ho(t, o, 1) : t === e.k ? oe(e, { k: t, v: o }) : t < e.k ? to(oe(e, { l: de(e.l, t, o) })) : to(oe(e, { r: de(e.r, t, o) }));
|
|
454
|
+
}
|
|
455
|
+
function Ne() {
|
|
456
|
+
return Xe;
|
|
457
|
+
}
|
|
458
|
+
function It(e, t, o) {
|
|
459
|
+
if (K(e))
|
|
460
|
+
return [];
|
|
461
|
+
const n = Te(e, t)[0];
|
|
462
|
+
return hn(Et(e, n, o));
|
|
463
|
+
}
|
|
464
|
+
function Bt(e, t) {
|
|
465
|
+
if (K(e))
|
|
466
|
+
return Xe;
|
|
467
|
+
const { k: o, l: n, r } = e;
|
|
468
|
+
if (t === o) {
|
|
469
|
+
if (K(n))
|
|
470
|
+
return r;
|
|
471
|
+
if (K(r))
|
|
472
|
+
return n;
|
|
473
|
+
{
|
|
474
|
+
const [i, l] = Co(n);
|
|
475
|
+
return dt(oe(e, { k: i, l: So(n), v: l }));
|
|
476
|
+
}
|
|
477
|
+
} else
|
|
478
|
+
return t < o ? dt(oe(e, { l: Bt(n, t) })) : dt(oe(e, { r: Bt(r, t) }));
|
|
479
|
+
}
|
|
480
|
+
function Ae(e) {
|
|
481
|
+
return K(e) ? [] : [...Ae(e.l), { k: e.k, v: e.v }, ...Ae(e.r)];
|
|
482
|
+
}
|
|
483
|
+
function Et(e, t, o) {
|
|
484
|
+
if (K(e))
|
|
485
|
+
return [];
|
|
486
|
+
const { k: n, l: r, r: i, v: l } = e;
|
|
487
|
+
let s = [];
|
|
488
|
+
return n > t && (s = s.concat(Et(r, t, o))), n >= t && n <= o && s.push({ k: n, v: l }), n <= o && (s = s.concat(Et(i, t, o))), s;
|
|
489
|
+
}
|
|
490
|
+
function dt(e) {
|
|
491
|
+
const { l: t, lvl: o, r: n } = e;
|
|
492
|
+
if (n.lvl >= o - 1 && t.lvl >= o - 1)
|
|
493
|
+
return e;
|
|
494
|
+
if (o > n.lvl + 1) {
|
|
495
|
+
if (Ct(t))
|
|
496
|
+
return zo(oe(e, { lvl: o - 1 }));
|
|
497
|
+
if (!K(t) && !K(t.r))
|
|
498
|
+
return oe(t.r, {
|
|
499
|
+
l: oe(t, { r: t.r.l }),
|
|
500
|
+
lvl: o,
|
|
501
|
+
r: oe(e, {
|
|
502
|
+
l: t.r.r,
|
|
503
|
+
lvl: o - 1
|
|
504
|
+
})
|
|
505
|
+
});
|
|
506
|
+
throw new Error("Unexpected empty nodes");
|
|
507
|
+
} else {
|
|
508
|
+
if (Ct(e))
|
|
509
|
+
return kt(oe(e, { lvl: o - 1 }));
|
|
510
|
+
if (!K(n) && !K(n.l)) {
|
|
511
|
+
const r = n.l, i = Ct(r) ? n.lvl - 1 : n.lvl;
|
|
512
|
+
return oe(r, {
|
|
513
|
+
l: oe(e, {
|
|
514
|
+
lvl: o - 1,
|
|
515
|
+
r: r.l
|
|
516
|
+
}),
|
|
517
|
+
lvl: r.lvl + 1,
|
|
518
|
+
r: kt(oe(n, { l: r.r, lvl: i }))
|
|
519
|
+
});
|
|
520
|
+
} else
|
|
521
|
+
throw new Error("Unexpected empty nodes");
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
function oe(e, t) {
|
|
525
|
+
return Ho(
|
|
526
|
+
t.k !== void 0 ? t.k : e.k,
|
|
527
|
+
t.v !== void 0 ? t.v : e.v,
|
|
528
|
+
t.lvl !== void 0 ? t.lvl : e.lvl,
|
|
529
|
+
t.l !== void 0 ? t.l : e.l,
|
|
530
|
+
t.r !== void 0 ? t.r : e.r
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
function So(e) {
|
|
534
|
+
return K(e.r) ? e.l : dt(oe(e, { r: So(e.r) }));
|
|
535
|
+
}
|
|
536
|
+
function Ct(e) {
|
|
537
|
+
return K(e) || e.lvl > e.r.lvl;
|
|
538
|
+
}
|
|
539
|
+
function Co(e) {
|
|
540
|
+
return K(e.r) ? [e.k, e.v] : Co(e.r);
|
|
541
|
+
}
|
|
542
|
+
function Ho(e, t, o, n = Xe, r = Xe) {
|
|
543
|
+
return { k: e, l: n, lvl: o, r, v: t };
|
|
544
|
+
}
|
|
545
|
+
function to(e) {
|
|
546
|
+
return kt(zo(e));
|
|
547
|
+
}
|
|
548
|
+
function zo(e) {
|
|
549
|
+
const { l: t } = e;
|
|
550
|
+
return !K(t) && t.lvl === e.lvl ? oe(t, { r: oe(e, { l: t.r }) }) : e;
|
|
551
|
+
}
|
|
552
|
+
function kt(e) {
|
|
553
|
+
const { lvl: t, r: o } = e;
|
|
554
|
+
return !K(o) && !K(o.r) && o.lvl === t && o.r.lvl === t ? oe(o, { l: oe(e, { r: o.l }), lvl: t + 1 }) : e;
|
|
555
|
+
}
|
|
556
|
+
function hn(e) {
|
|
557
|
+
return wo(e, ({ k: t, v: o }) => ({ index: t, value: o }));
|
|
558
|
+
}
|
|
559
|
+
function yo(e, t) {
|
|
560
|
+
return !!(e && e.startIndex === t.startIndex && e.endIndex === t.endIndex);
|
|
561
|
+
}
|
|
562
|
+
function Je(e, t) {
|
|
563
|
+
return !!(e && e[0] === t[0] && e[1] === t[1]);
|
|
564
|
+
}
|
|
565
|
+
const Pt = U(
|
|
566
|
+
() => ({ recalcInProgress: S(!1) }),
|
|
567
|
+
[],
|
|
568
|
+
{ singleton: !0 }
|
|
569
|
+
);
|
|
570
|
+
function bo(e, t, o) {
|
|
571
|
+
return e[ft(e, t, o)];
|
|
572
|
+
}
|
|
573
|
+
function ft(e, t, o, n = 0) {
|
|
574
|
+
let r = e.length - 1;
|
|
575
|
+
for (; n <= r; ) {
|
|
576
|
+
const i = Math.floor((n + r) / 2), l = e[i], s = o(l, t);
|
|
577
|
+
if (s === 0)
|
|
578
|
+
return i;
|
|
579
|
+
if (s === -1) {
|
|
580
|
+
if (r - n < 2)
|
|
581
|
+
return i - 1;
|
|
582
|
+
r = i - 1;
|
|
583
|
+
} else {
|
|
584
|
+
if (r === n)
|
|
585
|
+
return i;
|
|
586
|
+
n = i + 1;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`);
|
|
590
|
+
}
|
|
591
|
+
function fn(e, t, o, n) {
|
|
592
|
+
const r = ft(e, t, n), i = ft(e, o, n, r);
|
|
593
|
+
return e.slice(r, i + 1);
|
|
594
|
+
}
|
|
595
|
+
function Be(e, t) {
|
|
596
|
+
return Math.round(e.getBoundingClientRect()[t]);
|
|
597
|
+
}
|
|
598
|
+
function Tt(e) {
|
|
599
|
+
return !K(e.groupOffsetTree);
|
|
600
|
+
}
|
|
601
|
+
function jt({ index: e }, t) {
|
|
602
|
+
return t === e ? 0 : t < e ? -1 : 1;
|
|
603
|
+
}
|
|
604
|
+
function mn() {
|
|
605
|
+
return {
|
|
606
|
+
groupIndices: [],
|
|
607
|
+
groupOffsetTree: Ne(),
|
|
608
|
+
lastIndex: 0,
|
|
609
|
+
lastOffset: 0,
|
|
610
|
+
lastSize: 0,
|
|
611
|
+
offsetTree: [],
|
|
612
|
+
sizeTree: Ne()
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
function gn(e, t) {
|
|
616
|
+
let o = K(e) ? 0 : 1 / 0;
|
|
617
|
+
for (const n of t) {
|
|
618
|
+
const { endIndex: r, size: i, startIndex: l } = n;
|
|
619
|
+
if (o = Math.min(o, l), K(e)) {
|
|
620
|
+
e = de(e, 0, i);
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
const s = It(e, l - 1, r + 1);
|
|
624
|
+
if (s.some(Sn(n)))
|
|
625
|
+
continue;
|
|
626
|
+
let c = !1, a = !1;
|
|
627
|
+
for (const { end: m, start: I, value: g } of s)
|
|
628
|
+
c ? (r >= I || i === g) && (e = Bt(e, I)) : (a = g !== i, c = !0), m > r && r >= I && g !== i && (e = de(e, r + 1, g));
|
|
629
|
+
a && (e = de(e, l, i));
|
|
630
|
+
}
|
|
631
|
+
return [e, o];
|
|
632
|
+
}
|
|
633
|
+
function pn(e) {
|
|
634
|
+
return typeof e.groupIndex < "u";
|
|
635
|
+
}
|
|
636
|
+
function vn({ offset: e }, t) {
|
|
637
|
+
return t === e ? 0 : t < e ? -1 : 1;
|
|
638
|
+
}
|
|
639
|
+
function Qe(e, t, o) {
|
|
640
|
+
if (t.length === 0)
|
|
641
|
+
return 0;
|
|
642
|
+
const { index: n, offset: r, size: i } = bo(t, e, jt), l = e - n, s = i * l + (l - 1) * o + r;
|
|
643
|
+
return s > 0 ? s + o : s;
|
|
644
|
+
}
|
|
645
|
+
function Ro(e, t) {
|
|
646
|
+
if (!Tt(t))
|
|
647
|
+
return e;
|
|
648
|
+
let o = 0;
|
|
649
|
+
for (; t.groupIndices[o] <= e + o; )
|
|
650
|
+
o++;
|
|
651
|
+
return e + o;
|
|
652
|
+
}
|
|
653
|
+
function Bo(e, t, o) {
|
|
654
|
+
if (pn(e))
|
|
655
|
+
return t.groupIndices[e.groupIndex] + 1;
|
|
656
|
+
{
|
|
657
|
+
const n = e.index === "LAST" ? o : e.index;
|
|
658
|
+
let r = Ro(n, t);
|
|
659
|
+
return r = Math.max(0, r, Math.min(o, r)), r;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
function xn(e, t, o, n = 0) {
|
|
663
|
+
return n > 0 && (t = Math.max(t, bo(e, n, jt).offset)), wo(fn(e, t, o, vn), wn);
|
|
664
|
+
}
|
|
665
|
+
function In(e, [t, o, n, r]) {
|
|
666
|
+
t.length > 0 && n("received item sizes", t, ue.DEBUG);
|
|
667
|
+
const i = e.sizeTree;
|
|
668
|
+
let l = i, s = 0;
|
|
669
|
+
if (o.length > 0 && K(i) && t.length === 2) {
|
|
670
|
+
const g = t[0].size, x = t[1].size;
|
|
671
|
+
l = o.reduce((H, z) => de(de(H, z, g), z + 1, x), l);
|
|
672
|
+
} else
|
|
673
|
+
[l, s] = gn(l, t);
|
|
674
|
+
if (l === i)
|
|
675
|
+
return e;
|
|
676
|
+
const { lastIndex: c, lastOffset: a, lastSize: m, offsetTree: I } = Lt(e.offsetTree, s, l, r);
|
|
677
|
+
return {
|
|
678
|
+
groupIndices: o,
|
|
679
|
+
groupOffsetTree: o.reduce((g, x) => de(g, x, Qe(x, I, r)), Ne()),
|
|
680
|
+
lastIndex: c,
|
|
681
|
+
lastOffset: a,
|
|
682
|
+
lastSize: m,
|
|
683
|
+
offsetTree: I,
|
|
684
|
+
sizeTree: l
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
function Tn(e) {
|
|
688
|
+
return Ae(e).map(({ k: t, v: o }, n, r) => {
|
|
689
|
+
const i = r[n + 1];
|
|
690
|
+
return { endIndex: i ? i.k - 1 : 1 / 0, size: o, startIndex: t };
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
function oo(e, t) {
|
|
694
|
+
let o = 0, n = 0;
|
|
695
|
+
for (; o < e; )
|
|
696
|
+
o += t[n + 1] - t[n] - 1, n++;
|
|
697
|
+
return n - (o === e ? 0 : 1);
|
|
698
|
+
}
|
|
699
|
+
function Lt(e, t, o, n) {
|
|
700
|
+
let r = e, i = 0, l = 0, s = 0, c = 0;
|
|
701
|
+
if (t !== 0) {
|
|
702
|
+
c = ft(r, t - 1, jt), s = r[c].offset;
|
|
703
|
+
const a = Te(o, t - 1);
|
|
704
|
+
i = a[0], l = a[1], r.length && r[c].size === Te(o, t)[1] && (c -= 1), r = r.slice(0, c + 1);
|
|
705
|
+
} else
|
|
706
|
+
r = [];
|
|
707
|
+
for (const { start: a, value: m } of It(o, t, 1 / 0)) {
|
|
708
|
+
const I = a - i, g = I * l + s + I * n;
|
|
709
|
+
r.push({
|
|
710
|
+
index: a,
|
|
711
|
+
offset: g,
|
|
712
|
+
size: m
|
|
713
|
+
}), i = a, s = g, l = m;
|
|
714
|
+
}
|
|
715
|
+
return {
|
|
716
|
+
lastIndex: i,
|
|
717
|
+
lastOffset: s,
|
|
718
|
+
lastSize: l,
|
|
719
|
+
offsetTree: r
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
function wn(e) {
|
|
723
|
+
return { index: e.index, value: e };
|
|
724
|
+
}
|
|
725
|
+
function Sn(e) {
|
|
726
|
+
const { endIndex: t, size: o, startIndex: n } = e;
|
|
727
|
+
return (r) => r.start === n && (r.end === t || r.end === 1 / 0) && r.value === o;
|
|
728
|
+
}
|
|
729
|
+
const Cn = {
|
|
730
|
+
offsetHeight: "height",
|
|
731
|
+
offsetWidth: "width"
|
|
732
|
+
}, He = U(
|
|
733
|
+
([{ log: e }, { recalcInProgress: t }]) => {
|
|
734
|
+
const o = F(), n = F(), r = se(n, 0), i = F(), l = F(), s = S(0), c = S([]), a = S(void 0), m = S(void 0), I = S((h, u) => Be(h, Cn[u])), g = S(void 0), x = S(0), H = mn(), z = se(
|
|
735
|
+
p(o, D(c, e, x), Ce(In, H), Z()),
|
|
736
|
+
H
|
|
737
|
+
), v = se(
|
|
738
|
+
p(
|
|
739
|
+
c,
|
|
740
|
+
Z(),
|
|
741
|
+
Ce((h, u) => ({ current: u, prev: h.current }), {
|
|
742
|
+
current: [],
|
|
743
|
+
prev: []
|
|
744
|
+
}),
|
|
745
|
+
b(({ prev: h }) => h)
|
|
746
|
+
),
|
|
747
|
+
[]
|
|
748
|
+
);
|
|
749
|
+
k(
|
|
750
|
+
p(
|
|
751
|
+
c,
|
|
752
|
+
W((h) => h.length > 0),
|
|
753
|
+
D(z, x),
|
|
754
|
+
b(([h, u, T]) => {
|
|
755
|
+
const y = h.reduce((L, M, A) => de(L, M, Qe(M, u.offsetTree, T) || A), Ne());
|
|
756
|
+
return {
|
|
757
|
+
...u,
|
|
758
|
+
groupIndices: h,
|
|
759
|
+
groupOffsetTree: y
|
|
760
|
+
};
|
|
761
|
+
})
|
|
762
|
+
),
|
|
763
|
+
z
|
|
764
|
+
), k(
|
|
765
|
+
p(
|
|
766
|
+
n,
|
|
767
|
+
D(z),
|
|
768
|
+
W(([h, { lastIndex: u }]) => h < u),
|
|
769
|
+
b(([h, { lastIndex: u, lastSize: T }]) => [
|
|
770
|
+
{
|
|
771
|
+
endIndex: u,
|
|
772
|
+
size: T,
|
|
773
|
+
startIndex: h
|
|
774
|
+
}
|
|
775
|
+
])
|
|
776
|
+
),
|
|
777
|
+
o
|
|
778
|
+
), k(a, m);
|
|
779
|
+
const f = se(
|
|
780
|
+
p(
|
|
781
|
+
a,
|
|
782
|
+
b((h) => h === void 0)
|
|
783
|
+
),
|
|
784
|
+
!0
|
|
785
|
+
);
|
|
786
|
+
k(
|
|
787
|
+
p(
|
|
788
|
+
m,
|
|
789
|
+
W((h) => h !== void 0 && K(ee(z).sizeTree)),
|
|
790
|
+
b((h) => [{ endIndex: 0, size: h, startIndex: 0 }])
|
|
791
|
+
),
|
|
792
|
+
o
|
|
793
|
+
);
|
|
794
|
+
const d = he(
|
|
795
|
+
p(
|
|
796
|
+
o,
|
|
797
|
+
D(z),
|
|
798
|
+
Ce(
|
|
799
|
+
({ sizes: h }, [u, T]) => ({
|
|
800
|
+
changed: T !== h,
|
|
801
|
+
sizes: T
|
|
802
|
+
}),
|
|
803
|
+
{ changed: !1, sizes: H }
|
|
804
|
+
),
|
|
805
|
+
b((h) => h.changed)
|
|
806
|
+
)
|
|
807
|
+
);
|
|
808
|
+
q(
|
|
809
|
+
p(
|
|
810
|
+
s,
|
|
811
|
+
Ce(
|
|
812
|
+
(h, u) => ({ diff: h.prev - u, prev: u }),
|
|
813
|
+
{ diff: 0, prev: 0 }
|
|
814
|
+
),
|
|
815
|
+
b((h) => h.diff)
|
|
816
|
+
),
|
|
817
|
+
(h) => {
|
|
818
|
+
const { groupIndices: u } = ee(z);
|
|
819
|
+
if (h > 0)
|
|
820
|
+
j(t, !0), j(i, h + oo(h, u));
|
|
821
|
+
else if (h < 0) {
|
|
822
|
+
const T = ee(v);
|
|
823
|
+
T.length > 0 && (h -= oo(-h, T)), j(l, h);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
), q(p(s, D(e)), ([h, u]) => {
|
|
827
|
+
h < 0 && u(
|
|
828
|
+
"`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
|
|
829
|
+
{ firstItemIndex: s },
|
|
830
|
+
ue.ERROR
|
|
831
|
+
);
|
|
832
|
+
});
|
|
833
|
+
const C = he(i);
|
|
834
|
+
k(
|
|
835
|
+
p(
|
|
836
|
+
i,
|
|
837
|
+
D(z),
|
|
838
|
+
b(([h, u]) => {
|
|
839
|
+
const T = u.groupIndices.length > 0, y = [], L = u.lastSize;
|
|
840
|
+
if (T) {
|
|
841
|
+
const M = Ze(u.sizeTree, 0);
|
|
842
|
+
let A = 0, G = 0;
|
|
843
|
+
for (; A < h; ) {
|
|
844
|
+
const E = u.groupIndices[G], _ = u.groupIndices.length === G + 1 ? 1 / 0 : u.groupIndices[G + 1] - E - 1;
|
|
845
|
+
y.push({
|
|
846
|
+
endIndex: E,
|
|
847
|
+
size: M,
|
|
848
|
+
startIndex: E
|
|
849
|
+
}), y.push({
|
|
850
|
+
endIndex: E + 1 + _ - 1,
|
|
851
|
+
size: L,
|
|
852
|
+
startIndex: E + 1
|
|
853
|
+
}), G++, A += _ + 1;
|
|
854
|
+
}
|
|
855
|
+
const $ = Ae(u.sizeTree);
|
|
856
|
+
return A !== h && $.shift(), $.reduce(
|
|
857
|
+
(E, { k: _, v: ne }) => {
|
|
858
|
+
let fe = E.ranges;
|
|
859
|
+
return E.prevSize !== 0 && (fe = [
|
|
860
|
+
...E.ranges,
|
|
861
|
+
{
|
|
862
|
+
endIndex: _ + h - 1,
|
|
863
|
+
size: E.prevSize,
|
|
864
|
+
startIndex: E.prevIndex
|
|
865
|
+
}
|
|
866
|
+
]), {
|
|
867
|
+
prevIndex: _ + h,
|
|
868
|
+
prevSize: ne,
|
|
869
|
+
ranges: fe
|
|
870
|
+
};
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
prevIndex: h,
|
|
874
|
+
prevSize: 0,
|
|
875
|
+
ranges: y
|
|
876
|
+
}
|
|
877
|
+
).ranges;
|
|
878
|
+
}
|
|
879
|
+
return Ae(u.sizeTree).reduce(
|
|
880
|
+
(M, { k: A, v: G }) => ({
|
|
881
|
+
prevIndex: A + h,
|
|
882
|
+
prevSize: G,
|
|
883
|
+
ranges: [...M.ranges, { endIndex: A + h - 1, size: M.prevSize, startIndex: M.prevIndex }]
|
|
884
|
+
}),
|
|
885
|
+
{
|
|
886
|
+
prevIndex: 0,
|
|
887
|
+
prevSize: L,
|
|
888
|
+
ranges: []
|
|
889
|
+
}
|
|
890
|
+
).ranges;
|
|
891
|
+
})
|
|
892
|
+
),
|
|
893
|
+
o
|
|
894
|
+
);
|
|
895
|
+
const R = he(
|
|
896
|
+
p(
|
|
897
|
+
l,
|
|
898
|
+
D(z, x),
|
|
899
|
+
b(([h, { offsetTree: u }, T]) => {
|
|
900
|
+
const y = -h;
|
|
901
|
+
return Qe(y, u, T);
|
|
902
|
+
})
|
|
903
|
+
)
|
|
904
|
+
);
|
|
905
|
+
return k(
|
|
906
|
+
p(
|
|
907
|
+
l,
|
|
908
|
+
D(z, x),
|
|
909
|
+
b(([h, u, T]) => {
|
|
910
|
+
if (u.groupIndices.length > 0) {
|
|
911
|
+
if (K(u.sizeTree))
|
|
912
|
+
return u;
|
|
913
|
+
let y = Ne();
|
|
914
|
+
const L = ee(v);
|
|
915
|
+
let M = 0, A = 0, G = 0;
|
|
916
|
+
for (; M < -h; ) {
|
|
917
|
+
G = L[A];
|
|
918
|
+
const $ = L[A + 1] - G - 1;
|
|
919
|
+
A++, M += $ + 1;
|
|
920
|
+
}
|
|
921
|
+
if (y = Ae(u.sizeTree).reduce(($, { k: E, v: _ }) => de($, Math.max(0, E + h), _), y), M !== -h) {
|
|
922
|
+
const $ = Ze(u.sizeTree, G);
|
|
923
|
+
y = de(y, 0, $);
|
|
924
|
+
const E = Te(u.sizeTree, -h + 1)[1];
|
|
925
|
+
y = de(y, 1, E);
|
|
926
|
+
}
|
|
927
|
+
return {
|
|
928
|
+
...u,
|
|
929
|
+
sizeTree: y,
|
|
930
|
+
...Lt(u.offsetTree, 0, y, T)
|
|
931
|
+
};
|
|
932
|
+
} else {
|
|
933
|
+
const y = Ae(u.sizeTree).reduce((L, { k: M, v: A }) => de(L, Math.max(0, M + h), A), Ne());
|
|
934
|
+
return {
|
|
935
|
+
...u,
|
|
936
|
+
sizeTree: y,
|
|
937
|
+
...Lt(u.offsetTree, 0, y, T)
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
})
|
|
941
|
+
),
|
|
942
|
+
z
|
|
943
|
+
), {
|
|
944
|
+
beforeUnshiftWith: C,
|
|
945
|
+
// input
|
|
946
|
+
data: g,
|
|
947
|
+
defaultItemSize: m,
|
|
948
|
+
firstItemIndex: s,
|
|
949
|
+
fixedItemSize: a,
|
|
950
|
+
gap: x,
|
|
951
|
+
groupIndices: c,
|
|
952
|
+
itemSize: I,
|
|
953
|
+
listRefresh: d,
|
|
954
|
+
shiftWith: l,
|
|
955
|
+
shiftWithOffset: R,
|
|
956
|
+
sizeRanges: o,
|
|
957
|
+
// output
|
|
958
|
+
sizes: z,
|
|
959
|
+
statefulTotalCount: r,
|
|
960
|
+
totalCount: n,
|
|
961
|
+
trackItemSizes: f,
|
|
962
|
+
unshiftWith: i
|
|
963
|
+
};
|
|
964
|
+
},
|
|
965
|
+
J(ke, Pt),
|
|
966
|
+
{ singleton: !0 }
|
|
967
|
+
);
|
|
968
|
+
function Hn(e) {
|
|
969
|
+
return e.reduce(
|
|
970
|
+
(t, o) => (t.groupIndices.push(t.totalCount), t.totalCount += o + 1, t),
|
|
971
|
+
{
|
|
972
|
+
groupIndices: [],
|
|
973
|
+
totalCount: 0
|
|
974
|
+
}
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
const Eo = U(
|
|
978
|
+
([{ groupIndices: e, sizes: t, totalCount: o }, { headerHeight: n, scrollTop: r }]) => {
|
|
979
|
+
const i = F(), l = F(), s = he(p(i, b(Hn)));
|
|
980
|
+
return k(
|
|
981
|
+
p(
|
|
982
|
+
s,
|
|
983
|
+
b((c) => c.totalCount)
|
|
984
|
+
),
|
|
985
|
+
o
|
|
986
|
+
), k(
|
|
987
|
+
p(
|
|
988
|
+
s,
|
|
989
|
+
b((c) => c.groupIndices)
|
|
990
|
+
),
|
|
991
|
+
e
|
|
992
|
+
), k(
|
|
993
|
+
p(
|
|
994
|
+
te(r, t, n),
|
|
995
|
+
W(([c, a]) => Tt(a)),
|
|
996
|
+
b(([c, a, m]) => Te(a.groupOffsetTree, Math.max(c - m, 0), "v")[0]),
|
|
997
|
+
Z(),
|
|
998
|
+
b((c) => [c])
|
|
999
|
+
),
|
|
1000
|
+
l
|
|
1001
|
+
), { groupCounts: i, topItemsIndexes: l };
|
|
1002
|
+
},
|
|
1003
|
+
J(He, ce)
|
|
1004
|
+
), Le = U(
|
|
1005
|
+
([{ log: e }]) => {
|
|
1006
|
+
const t = S(!1), o = he(
|
|
1007
|
+
p(
|
|
1008
|
+
t,
|
|
1009
|
+
W((n) => n),
|
|
1010
|
+
Z()
|
|
1011
|
+
)
|
|
1012
|
+
);
|
|
1013
|
+
return q(t, (n) => {
|
|
1014
|
+
n && ee(e)("props updated", {}, ue.DEBUG);
|
|
1015
|
+
}), { didMount: o, propsReady: t };
|
|
1016
|
+
},
|
|
1017
|
+
J(ke),
|
|
1018
|
+
{ singleton: !0 }
|
|
1019
|
+
), zn = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
|
|
1020
|
+
function ko(e) {
|
|
1021
|
+
const t = typeof e == "number" ? { index: e } : e;
|
|
1022
|
+
return t.align || (t.align = "start"), (!t.behavior || !zn) && (t.behavior = "auto"), t.offset || (t.offset = 0), t;
|
|
1023
|
+
}
|
|
1024
|
+
const ot = U(
|
|
1025
|
+
([
|
|
1026
|
+
{ gap: e, listRefresh: t, sizes: o, totalCount: n },
|
|
1027
|
+
{
|
|
1028
|
+
fixedFooterHeight: r,
|
|
1029
|
+
fixedHeaderHeight: i,
|
|
1030
|
+
footerHeight: l,
|
|
1031
|
+
headerHeight: s,
|
|
1032
|
+
scrollingInProgress: c,
|
|
1033
|
+
scrollTo: a,
|
|
1034
|
+
smoothScrollTargetReached: m,
|
|
1035
|
+
viewportHeight: I
|
|
1036
|
+
},
|
|
1037
|
+
{ log: g }
|
|
1038
|
+
]) => {
|
|
1039
|
+
const x = F(), H = F(), z = S(0);
|
|
1040
|
+
let v = null, f = null, d = null;
|
|
1041
|
+
function C() {
|
|
1042
|
+
v && (v(), v = null), d && (d(), d = null), f && (clearTimeout(f), f = null), j(c, !1);
|
|
1043
|
+
}
|
|
1044
|
+
return k(
|
|
1045
|
+
p(
|
|
1046
|
+
x,
|
|
1047
|
+
D(o, I, n, z, s, l, g),
|
|
1048
|
+
D(e, i, r),
|
|
1049
|
+
b(
|
|
1050
|
+
([
|
|
1051
|
+
[R, h, u, T, y, L, M, A],
|
|
1052
|
+
G,
|
|
1053
|
+
$,
|
|
1054
|
+
E
|
|
1055
|
+
]) => {
|
|
1056
|
+
const _ = ko(R), { align: ne, behavior: fe, offset: pe } = _, ve = T - 1, ae = Bo(_, h, ve);
|
|
1057
|
+
let le = Qe(ae, h.offsetTree, G) + L;
|
|
1058
|
+
ne === "end" ? (le += $ + Te(h.sizeTree, ae)[1] - u + E, ae === ve && (le += M)) : ne === "center" ? le += ($ + Te(h.sizeTree, ae)[1] - u + E) / 2 : le -= y, pe && (le += pe);
|
|
1059
|
+
const Me = (xe) => {
|
|
1060
|
+
C(), xe ? (A("retrying to scroll to", { location: R }, ue.DEBUG), j(x, R)) : (j(H, !0), A("list did not change, scroll successful", {}, ue.DEBUG));
|
|
1061
|
+
};
|
|
1062
|
+
if (C(), fe === "smooth") {
|
|
1063
|
+
let xe = !1;
|
|
1064
|
+
d = q(t, (qe) => {
|
|
1065
|
+
xe = xe || qe;
|
|
1066
|
+
}), v = Ie(m, () => {
|
|
1067
|
+
Me(xe);
|
|
1068
|
+
});
|
|
1069
|
+
} else
|
|
1070
|
+
v = Ie(p(t, yn(150)), Me);
|
|
1071
|
+
return f = setTimeout(() => {
|
|
1072
|
+
C();
|
|
1073
|
+
}, 1200), j(c, !0), A("scrolling from index to", { behavior: fe, index: ae, top: le }, ue.DEBUG), { behavior: fe, top: le };
|
|
1074
|
+
}
|
|
1075
|
+
)
|
|
1076
|
+
),
|
|
1077
|
+
a
|
|
1078
|
+
), {
|
|
1079
|
+
scrollTargetReached: H,
|
|
1080
|
+
scrollToIndex: x,
|
|
1081
|
+
topListHeight: z
|
|
1082
|
+
};
|
|
1083
|
+
},
|
|
1084
|
+
J(He, ce, ke),
|
|
1085
|
+
{ singleton: !0 }
|
|
1086
|
+
);
|
|
1087
|
+
function yn(e) {
|
|
1088
|
+
return (t) => {
|
|
1089
|
+
const o = setTimeout(() => {
|
|
1090
|
+
t(!1);
|
|
1091
|
+
}, e);
|
|
1092
|
+
return (n) => {
|
|
1093
|
+
n && (t(!0), clearTimeout(o));
|
|
1094
|
+
};
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
function Dt(e, t) {
|
|
1098
|
+
e == 0 ? t() : requestAnimationFrame(() => {
|
|
1099
|
+
Dt(e - 1, t);
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
function Vt(e, t) {
|
|
1103
|
+
const o = t - 1;
|
|
1104
|
+
return typeof e == "number" ? e : e.index === "LAST" ? o : e.index;
|
|
1105
|
+
}
|
|
1106
|
+
const nt = U(
|
|
1107
|
+
([{ defaultItemSize: e, listRefresh: t, sizes: o }, { scrollTop: n }, { scrollTargetReached: r, scrollToIndex: i }, { didMount: l }]) => {
|
|
1108
|
+
const s = S(!0), c = S(0), a = S(!0);
|
|
1109
|
+
return k(
|
|
1110
|
+
p(
|
|
1111
|
+
l,
|
|
1112
|
+
D(c),
|
|
1113
|
+
W(([m, I]) => !!I),
|
|
1114
|
+
Se(!1)
|
|
1115
|
+
),
|
|
1116
|
+
s
|
|
1117
|
+
), k(
|
|
1118
|
+
p(
|
|
1119
|
+
l,
|
|
1120
|
+
D(c),
|
|
1121
|
+
W(([m, I]) => !!I),
|
|
1122
|
+
Se(!1)
|
|
1123
|
+
),
|
|
1124
|
+
a
|
|
1125
|
+
), q(
|
|
1126
|
+
p(
|
|
1127
|
+
te(t, l),
|
|
1128
|
+
D(s, o, e, a),
|
|
1129
|
+
W(([[, m], I, { sizeTree: g }, x, H]) => m && (!K(g) || Ot(x)) && !I && !H),
|
|
1130
|
+
D(c)
|
|
1131
|
+
),
|
|
1132
|
+
([, m]) => {
|
|
1133
|
+
Ie(r, () => {
|
|
1134
|
+
j(a, !0);
|
|
1135
|
+
}), Dt(4, () => {
|
|
1136
|
+
Ie(n, () => {
|
|
1137
|
+
j(s, !0);
|
|
1138
|
+
}), j(i, m);
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
), {
|
|
1142
|
+
initialItemFinalLocationReached: a,
|
|
1143
|
+
initialTopMostItemIndex: c,
|
|
1144
|
+
scrolledToInitialItem: s
|
|
1145
|
+
};
|
|
1146
|
+
},
|
|
1147
|
+
J(He, ce, ot, Le),
|
|
1148
|
+
{ singleton: !0 }
|
|
1149
|
+
);
|
|
1150
|
+
function Lo(e, t) {
|
|
1151
|
+
return Math.abs(e - t) < 1.01;
|
|
1152
|
+
}
|
|
1153
|
+
const et = "up", $e = "down", bn = "none", Rn = {
|
|
1154
|
+
atBottom: !1,
|
|
1155
|
+
notAtBottomBecause: "NOT_SHOWING_LAST_ITEM",
|
|
1156
|
+
state: {
|
|
1157
|
+
offsetBottom: 0,
|
|
1158
|
+
scrollHeight: 0,
|
|
1159
|
+
scrollTop: 0,
|
|
1160
|
+
viewportHeight: 0
|
|
1161
|
+
}
|
|
1162
|
+
}, Bn = 0, rt = U(([{ footerHeight: e, headerHeight: t, scrollBy: o, scrollContainerState: n, scrollTop: r, viewportHeight: i }]) => {
|
|
1163
|
+
const l = S(!1), s = S(!0), c = F(), a = F(), m = S(4), I = S(Bn), g = se(
|
|
1164
|
+
p(
|
|
1165
|
+
Rt(p(O(r), Pe(1), Se(!0)), p(O(r), Pe(1), Se(!1), Qt(100))),
|
|
1166
|
+
Z()
|
|
1167
|
+
),
|
|
1168
|
+
!1
|
|
1169
|
+
), x = se(
|
|
1170
|
+
p(Rt(p(o, Se(!0)), p(o, Se(!1), Qt(200))), Z()),
|
|
1171
|
+
!1
|
|
1172
|
+
);
|
|
1173
|
+
k(
|
|
1174
|
+
p(
|
|
1175
|
+
te(O(r), O(I)),
|
|
1176
|
+
b(([d, C]) => d <= C),
|
|
1177
|
+
Z()
|
|
1178
|
+
),
|
|
1179
|
+
s
|
|
1180
|
+
), k(p(s, ye(50)), a);
|
|
1181
|
+
const H = he(
|
|
1182
|
+
p(
|
|
1183
|
+
te(n, O(i), O(t), O(e), O(m)),
|
|
1184
|
+
Ce((d, [{ scrollHeight: C, scrollTop: R }, h, u, T, y]) => {
|
|
1185
|
+
const L = R + h - C > -y, M = {
|
|
1186
|
+
scrollHeight: C,
|
|
1187
|
+
scrollTop: R,
|
|
1188
|
+
viewportHeight: h
|
|
1189
|
+
};
|
|
1190
|
+
if (L) {
|
|
1191
|
+
let G, $;
|
|
1192
|
+
return R > d.state.scrollTop ? (G = "SCROLLED_DOWN", $ = d.state.scrollTop - R) : (G = "SIZE_DECREASED", $ = d.state.scrollTop - R || d.scrollTopDelta), {
|
|
1193
|
+
atBottom: !0,
|
|
1194
|
+
atBottomBecause: G,
|
|
1195
|
+
scrollTopDelta: $,
|
|
1196
|
+
state: M
|
|
1197
|
+
};
|
|
1198
|
+
}
|
|
1199
|
+
let A;
|
|
1200
|
+
return M.scrollHeight > d.state.scrollHeight ? A = "SIZE_INCREASED" : h < d.state.viewportHeight ? A = "VIEWPORT_HEIGHT_DECREASING" : R < d.state.scrollTop ? A = "SCROLLING_UPWARDS" : A = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
1201
|
+
atBottom: !1,
|
|
1202
|
+
notAtBottomBecause: A,
|
|
1203
|
+
state: M
|
|
1204
|
+
};
|
|
1205
|
+
}, Rn),
|
|
1206
|
+
Z((d, C) => d && d.atBottom === C.atBottom)
|
|
1207
|
+
)
|
|
1208
|
+
), z = se(
|
|
1209
|
+
p(
|
|
1210
|
+
n,
|
|
1211
|
+
Ce(
|
|
1212
|
+
(d, { scrollHeight: C, scrollTop: R, viewportHeight: h }) => {
|
|
1213
|
+
if (Lo(d.scrollHeight, C))
|
|
1214
|
+
return {
|
|
1215
|
+
changed: !1,
|
|
1216
|
+
jump: 0,
|
|
1217
|
+
scrollHeight: C,
|
|
1218
|
+
scrollTop: R
|
|
1219
|
+
};
|
|
1220
|
+
{
|
|
1221
|
+
const u = C - (R + h) < 1;
|
|
1222
|
+
return d.scrollTop !== R && u ? {
|
|
1223
|
+
changed: !0,
|
|
1224
|
+
jump: d.scrollTop - R,
|
|
1225
|
+
scrollHeight: C,
|
|
1226
|
+
scrollTop: R
|
|
1227
|
+
} : {
|
|
1228
|
+
changed: !0,
|
|
1229
|
+
jump: 0,
|
|
1230
|
+
scrollHeight: C,
|
|
1231
|
+
scrollTop: R
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
},
|
|
1235
|
+
{ changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
|
|
1236
|
+
),
|
|
1237
|
+
W((d) => d.changed),
|
|
1238
|
+
b((d) => d.jump)
|
|
1239
|
+
),
|
|
1240
|
+
0
|
|
1241
|
+
);
|
|
1242
|
+
k(
|
|
1243
|
+
p(
|
|
1244
|
+
H,
|
|
1245
|
+
b((d) => d.atBottom)
|
|
1246
|
+
),
|
|
1247
|
+
l
|
|
1248
|
+
), k(p(l, ye(50)), c);
|
|
1249
|
+
const v = S($e);
|
|
1250
|
+
k(
|
|
1251
|
+
p(
|
|
1252
|
+
n,
|
|
1253
|
+
b(({ scrollTop: d }) => d),
|
|
1254
|
+
Z(),
|
|
1255
|
+
Ce(
|
|
1256
|
+
(d, C) => ee(x) ? { direction: d.direction, prevScrollTop: C } : { direction: C < d.prevScrollTop ? et : $e, prevScrollTop: C },
|
|
1257
|
+
{ direction: $e, prevScrollTop: 0 }
|
|
1258
|
+
),
|
|
1259
|
+
b((d) => d.direction)
|
|
1260
|
+
),
|
|
1261
|
+
v
|
|
1262
|
+
), k(p(n, ye(50), Se(bn)), v);
|
|
1263
|
+
const f = S(0);
|
|
1264
|
+
return k(
|
|
1265
|
+
p(
|
|
1266
|
+
g,
|
|
1267
|
+
W((d) => !d),
|
|
1268
|
+
Se(0)
|
|
1269
|
+
),
|
|
1270
|
+
f
|
|
1271
|
+
), k(
|
|
1272
|
+
p(
|
|
1273
|
+
r,
|
|
1274
|
+
ye(100),
|
|
1275
|
+
D(g),
|
|
1276
|
+
W(([d, C]) => !!C),
|
|
1277
|
+
Ce(([d, C], [R]) => [C, R], [0, 0]),
|
|
1278
|
+
b(([d, C]) => C - d)
|
|
1279
|
+
),
|
|
1280
|
+
f
|
|
1281
|
+
), {
|
|
1282
|
+
atBottomState: H,
|
|
1283
|
+
atBottomStateChange: c,
|
|
1284
|
+
atBottomThreshold: m,
|
|
1285
|
+
atTopStateChange: a,
|
|
1286
|
+
atTopThreshold: I,
|
|
1287
|
+
isAtBottom: l,
|
|
1288
|
+
isAtTop: s,
|
|
1289
|
+
isScrolling: g,
|
|
1290
|
+
lastJumpDueToItemResize: z,
|
|
1291
|
+
scrollDirection: v,
|
|
1292
|
+
scrollVelocity: f
|
|
1293
|
+
};
|
|
1294
|
+
}, J(ce)), mt = "top", gt = "bottom", no = "none";
|
|
1295
|
+
function ro(e, t, o) {
|
|
1296
|
+
return typeof e == "number" ? o === et && t === mt || o === $e && t === gt ? e : 0 : o === et ? t === mt ? e.main : e.reverse : t === gt ? e.main : e.reverse;
|
|
1297
|
+
}
|
|
1298
|
+
function io(e, t) {
|
|
1299
|
+
var o;
|
|
1300
|
+
return typeof e == "number" ? e : (o = e[t]) != null ? o : 0;
|
|
1301
|
+
}
|
|
1302
|
+
const Ft = U(
|
|
1303
|
+
([{ deviation: e, fixedHeaderHeight: t, headerHeight: o, scrollTop: n, viewportHeight: r }]) => {
|
|
1304
|
+
const i = F(), l = S(0), s = S(0), c = S(0), a = se(
|
|
1305
|
+
p(
|
|
1306
|
+
te(
|
|
1307
|
+
O(n),
|
|
1308
|
+
O(r),
|
|
1309
|
+
O(o),
|
|
1310
|
+
O(i, Je),
|
|
1311
|
+
O(c),
|
|
1312
|
+
O(l),
|
|
1313
|
+
O(t),
|
|
1314
|
+
O(e),
|
|
1315
|
+
O(s)
|
|
1316
|
+
),
|
|
1317
|
+
b(
|
|
1318
|
+
([
|
|
1319
|
+
m,
|
|
1320
|
+
I,
|
|
1321
|
+
g,
|
|
1322
|
+
[x, H],
|
|
1323
|
+
z,
|
|
1324
|
+
v,
|
|
1325
|
+
f,
|
|
1326
|
+
d,
|
|
1327
|
+
C
|
|
1328
|
+
]) => {
|
|
1329
|
+
const R = m - d, h = v + f, u = Math.max(g - R, 0);
|
|
1330
|
+
let T = no;
|
|
1331
|
+
const y = io(C, mt), L = io(C, gt);
|
|
1332
|
+
return x -= d, x += g + f, H += g + f, H -= d, x > m + h - y && (T = et), H < m - u + I + L && (T = $e), T !== no ? [
|
|
1333
|
+
Math.max(R - g - ro(z, mt, T) - y, 0),
|
|
1334
|
+
R - u - f + I + ro(z, gt, T) + L
|
|
1335
|
+
] : null;
|
|
1336
|
+
}
|
|
1337
|
+
),
|
|
1338
|
+
W((m) => m != null),
|
|
1339
|
+
Z(Je)
|
|
1340
|
+
),
|
|
1341
|
+
[0, 0]
|
|
1342
|
+
);
|
|
1343
|
+
return {
|
|
1344
|
+
increaseViewportBy: s,
|
|
1345
|
+
// input
|
|
1346
|
+
listBoundary: i,
|
|
1347
|
+
overscan: c,
|
|
1348
|
+
topListHeight: l,
|
|
1349
|
+
// output
|
|
1350
|
+
visibleRange: a
|
|
1351
|
+
};
|
|
1352
|
+
},
|
|
1353
|
+
J(ce),
|
|
1354
|
+
{ singleton: !0 }
|
|
1355
|
+
);
|
|
1356
|
+
function En(e, t, o) {
|
|
1357
|
+
if (Tt(t)) {
|
|
1358
|
+
const n = Ro(e, t);
|
|
1359
|
+
return [
|
|
1360
|
+
{ index: Te(t.groupOffsetTree, n)[0], offset: 0, size: 0 },
|
|
1361
|
+
{ data: o == null ? void 0 : o[0], index: n, offset: 0, size: 0 }
|
|
1362
|
+
];
|
|
1363
|
+
}
|
|
1364
|
+
return [{ data: o == null ? void 0 : o[0], index: e, offset: 0, size: 0 }];
|
|
1365
|
+
}
|
|
1366
|
+
const Ht = {
|
|
1367
|
+
bottom: 0,
|
|
1368
|
+
firstItemIndex: 0,
|
|
1369
|
+
items: [],
|
|
1370
|
+
offsetBottom: 0,
|
|
1371
|
+
offsetTop: 0,
|
|
1372
|
+
top: 0,
|
|
1373
|
+
topItems: [],
|
|
1374
|
+
topListHeight: 0,
|
|
1375
|
+
totalCount: 0
|
|
1376
|
+
};
|
|
1377
|
+
function ht(e, t, o, n, r, i) {
|
|
1378
|
+
const { lastIndex: l, lastOffset: s, lastSize: c } = r;
|
|
1379
|
+
let a = 0, m = 0;
|
|
1380
|
+
if (e.length > 0) {
|
|
1381
|
+
a = e[0].offset;
|
|
1382
|
+
const z = e[e.length - 1];
|
|
1383
|
+
m = z.offset + z.size;
|
|
1384
|
+
}
|
|
1385
|
+
const I = o - l, g = s + I * c + (I - 1) * n, x = a, H = g - m;
|
|
1386
|
+
return {
|
|
1387
|
+
bottom: m,
|
|
1388
|
+
firstItemIndex: i,
|
|
1389
|
+
items: lo(e, r, i),
|
|
1390
|
+
offsetBottom: H,
|
|
1391
|
+
offsetTop: a,
|
|
1392
|
+
top: x,
|
|
1393
|
+
topItems: lo(t, r, i),
|
|
1394
|
+
topListHeight: t.reduce((z, v) => v.size + z, 0),
|
|
1395
|
+
totalCount: o
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
function Mo(e, t, o, n, r, i) {
|
|
1399
|
+
let l = 0;
|
|
1400
|
+
if (o.groupIndices.length > 0)
|
|
1401
|
+
for (const m of o.groupIndices) {
|
|
1402
|
+
if (m - l >= e)
|
|
1403
|
+
break;
|
|
1404
|
+
l++;
|
|
1405
|
+
}
|
|
1406
|
+
const s = e + l, c = Vt(t, s), a = Array.from({ length: s }).map((m, I) => ({
|
|
1407
|
+
data: i[I + c],
|
|
1408
|
+
index: I + c,
|
|
1409
|
+
offset: 0,
|
|
1410
|
+
size: 0
|
|
1411
|
+
}));
|
|
1412
|
+
return ht(a, [], s, r, o, n);
|
|
1413
|
+
}
|
|
1414
|
+
function lo(e, t, o) {
|
|
1415
|
+
if (e.length === 0)
|
|
1416
|
+
return [];
|
|
1417
|
+
if (!Tt(t))
|
|
1418
|
+
return e.map((a) => ({ ...a, index: a.index + o, originalIndex: a.index }));
|
|
1419
|
+
const n = e[0].index, r = e[e.length - 1].index, i = [], l = It(t.groupOffsetTree, n, r);
|
|
1420
|
+
let s, c = 0;
|
|
1421
|
+
for (const a of e) {
|
|
1422
|
+
(!s || s.end < a.index) && (s = l.shift(), c = t.groupIndices.indexOf(s.start));
|
|
1423
|
+
let m;
|
|
1424
|
+
a.index === s.start ? m = {
|
|
1425
|
+
index: c,
|
|
1426
|
+
type: "group"
|
|
1427
|
+
} : m = {
|
|
1428
|
+
groupIndex: c,
|
|
1429
|
+
index: a.index - (c + 1) + o
|
|
1430
|
+
}, i.push({
|
|
1431
|
+
...m,
|
|
1432
|
+
data: a.data,
|
|
1433
|
+
offset: a.offset,
|
|
1434
|
+
originalIndex: a.index,
|
|
1435
|
+
size: a.size
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
return i;
|
|
1439
|
+
}
|
|
1440
|
+
const De = U(
|
|
1441
|
+
([
|
|
1442
|
+
{ data: e, firstItemIndex: t, gap: o, sizes: n, totalCount: r },
|
|
1443
|
+
i,
|
|
1444
|
+
{ listBoundary: l, topListHeight: s, visibleRange: c },
|
|
1445
|
+
{ initialTopMostItemIndex: a, scrolledToInitialItem: m },
|
|
1446
|
+
{ topListHeight: I },
|
|
1447
|
+
g,
|
|
1448
|
+
{ didMount: x },
|
|
1449
|
+
{ recalcInProgress: H }
|
|
1450
|
+
]) => {
|
|
1451
|
+
const z = S([]), v = S(0), f = F();
|
|
1452
|
+
k(i.topItemsIndexes, z);
|
|
1453
|
+
const d = se(
|
|
1454
|
+
p(
|
|
1455
|
+
te(
|
|
1456
|
+
x,
|
|
1457
|
+
H,
|
|
1458
|
+
O(c, Je),
|
|
1459
|
+
O(r),
|
|
1460
|
+
O(n),
|
|
1461
|
+
O(a),
|
|
1462
|
+
m,
|
|
1463
|
+
O(z),
|
|
1464
|
+
O(t),
|
|
1465
|
+
O(o),
|
|
1466
|
+
e
|
|
1467
|
+
),
|
|
1468
|
+
W(([u, T, , y, , , , , , , L]) => {
|
|
1469
|
+
const M = L && L.length !== y;
|
|
1470
|
+
return u && !T && !M;
|
|
1471
|
+
}),
|
|
1472
|
+
b(
|
|
1473
|
+
([
|
|
1474
|
+
,
|
|
1475
|
+
,
|
|
1476
|
+
[u, T],
|
|
1477
|
+
y,
|
|
1478
|
+
L,
|
|
1479
|
+
M,
|
|
1480
|
+
A,
|
|
1481
|
+
G,
|
|
1482
|
+
$,
|
|
1483
|
+
E,
|
|
1484
|
+
_
|
|
1485
|
+
]) => {
|
|
1486
|
+
const ne = L, { offsetTree: fe, sizeTree: pe } = ne, ve = ee(v);
|
|
1487
|
+
if (y === 0)
|
|
1488
|
+
return { ...Ht, totalCount: y };
|
|
1489
|
+
if (u === 0 && T === 0)
|
|
1490
|
+
return ve === 0 ? { ...Ht, totalCount: y } : Mo(ve, M, L, $, E, _ || []);
|
|
1491
|
+
if (K(pe))
|
|
1492
|
+
return ve > 0 ? null : ht(
|
|
1493
|
+
En(Vt(M, y), ne, _),
|
|
1494
|
+
[],
|
|
1495
|
+
y,
|
|
1496
|
+
E,
|
|
1497
|
+
ne,
|
|
1498
|
+
$
|
|
1499
|
+
);
|
|
1500
|
+
const ae = [];
|
|
1501
|
+
if (G.length > 0) {
|
|
1502
|
+
const Ve = G[0], we = G[G.length - 1];
|
|
1503
|
+
let ze = 0;
|
|
1504
|
+
for (const w of It(pe, Ve, we)) {
|
|
1505
|
+
const V = w.value, Y = Math.max(w.start, Ve), re = Math.min(w.end, we);
|
|
1506
|
+
for (let Q = Y; Q <= re; Q++)
|
|
1507
|
+
ae.push({ data: _ == null ? void 0 : _[Q], index: Q, offset: ze, size: V }), ze += V;
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
if (!A)
|
|
1511
|
+
return ht([], ae, y, E, ne, $);
|
|
1512
|
+
const le = G.length > 0 ? G[G.length - 1] + 1 : 0, Me = xn(fe, u, T, le);
|
|
1513
|
+
if (Me.length === 0)
|
|
1514
|
+
return null;
|
|
1515
|
+
const xe = y - 1, qe = xt([], (Ve) => {
|
|
1516
|
+
for (const we of Me) {
|
|
1517
|
+
const ze = we.value;
|
|
1518
|
+
let w = ze.offset, V = we.start;
|
|
1519
|
+
const Y = ze.size;
|
|
1520
|
+
if (ze.offset < u) {
|
|
1521
|
+
V += Math.floor((u - ze.offset + E) / (Y + E));
|
|
1522
|
+
const Q = V - we.start;
|
|
1523
|
+
w += Q * Y + Q * E;
|
|
1524
|
+
}
|
|
1525
|
+
V < le && (w += (le - V) * Y, V = le);
|
|
1526
|
+
const re = Math.min(we.end, xe);
|
|
1527
|
+
for (let Q = V; Q <= re && !(w >= T); Q++)
|
|
1528
|
+
Ve.push({ data: _ == null ? void 0 : _[Q], index: Q, offset: w, size: Y }), w += Y + E;
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
return ht(qe, ae, y, E, ne, $);
|
|
1532
|
+
}
|
|
1533
|
+
),
|
|
1534
|
+
//@ts-expect-error filter needs to be fixed
|
|
1535
|
+
W((u) => u !== null),
|
|
1536
|
+
Z()
|
|
1537
|
+
),
|
|
1538
|
+
Ht
|
|
1539
|
+
);
|
|
1540
|
+
k(
|
|
1541
|
+
p(
|
|
1542
|
+
e,
|
|
1543
|
+
W(Ot),
|
|
1544
|
+
b((u) => u == null ? void 0 : u.length)
|
|
1545
|
+
),
|
|
1546
|
+
r
|
|
1547
|
+
), k(
|
|
1548
|
+
p(
|
|
1549
|
+
d,
|
|
1550
|
+
b((u) => u.topListHeight)
|
|
1551
|
+
),
|
|
1552
|
+
I
|
|
1553
|
+
), k(I, s), k(
|
|
1554
|
+
p(
|
|
1555
|
+
d,
|
|
1556
|
+
b((u) => [u.top, u.bottom])
|
|
1557
|
+
),
|
|
1558
|
+
l
|
|
1559
|
+
), k(
|
|
1560
|
+
p(
|
|
1561
|
+
d,
|
|
1562
|
+
b((u) => u.items)
|
|
1563
|
+
),
|
|
1564
|
+
f
|
|
1565
|
+
);
|
|
1566
|
+
const C = he(
|
|
1567
|
+
p(
|
|
1568
|
+
d,
|
|
1569
|
+
W(({ items: u }) => u.length > 0),
|
|
1570
|
+
D(r, e),
|
|
1571
|
+
W(([{ items: u }, T]) => u[u.length - 1].originalIndex === T - 1),
|
|
1572
|
+
b(([, u, T]) => [u - 1, T]),
|
|
1573
|
+
Z(Je),
|
|
1574
|
+
b(([u]) => u)
|
|
1575
|
+
)
|
|
1576
|
+
), R = he(
|
|
1577
|
+
p(
|
|
1578
|
+
d,
|
|
1579
|
+
ye(200),
|
|
1580
|
+
W(({ items: u, topItems: T }) => u.length > 0 && u[0].originalIndex === T.length),
|
|
1581
|
+
b(({ items: u }) => u[0].index),
|
|
1582
|
+
Z()
|
|
1583
|
+
)
|
|
1584
|
+
), h = he(
|
|
1585
|
+
p(
|
|
1586
|
+
d,
|
|
1587
|
+
W(({ items: u }) => u.length > 0),
|
|
1588
|
+
b(({ items: u }) => {
|
|
1589
|
+
let T = 0, y = u.length - 1;
|
|
1590
|
+
for (; u[T].type === "group" && T < y; )
|
|
1591
|
+
T++;
|
|
1592
|
+
for (; u[y].type === "group" && y > T; )
|
|
1593
|
+
y--;
|
|
1594
|
+
return {
|
|
1595
|
+
endIndex: u[y].index,
|
|
1596
|
+
startIndex: u[T].index
|
|
1597
|
+
};
|
|
1598
|
+
}),
|
|
1599
|
+
Z(yo)
|
|
1600
|
+
)
|
|
1601
|
+
);
|
|
1602
|
+
return { endReached: C, initialItemCount: v, itemsRendered: f, listState: d, rangeChanged: h, startReached: R, topItemsIndexes: z, ...g };
|
|
1603
|
+
},
|
|
1604
|
+
J(
|
|
1605
|
+
He,
|
|
1606
|
+
Eo,
|
|
1607
|
+
Ft,
|
|
1608
|
+
nt,
|
|
1609
|
+
ot,
|
|
1610
|
+
rt,
|
|
1611
|
+
Le,
|
|
1612
|
+
Pt
|
|
1613
|
+
),
|
|
1614
|
+
{ singleton: !0 }
|
|
1615
|
+
), Oo = U(
|
|
1616
|
+
([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: o, headerHeight: n }, { listState: r }]) => {
|
|
1617
|
+
const i = F(), l = se(
|
|
1618
|
+
p(
|
|
1619
|
+
te(o, e, n, t, r),
|
|
1620
|
+
b(([s, c, a, m, I]) => s + c + a + m + I.offsetBottom + I.bottom)
|
|
1621
|
+
),
|
|
1622
|
+
0
|
|
1623
|
+
);
|
|
1624
|
+
return k(O(l), i), { totalListHeight: l, totalListHeightChanged: i };
|
|
1625
|
+
},
|
|
1626
|
+
J(ce, De),
|
|
1627
|
+
{ singleton: !0 }
|
|
1628
|
+
), kn = U(
|
|
1629
|
+
([{ viewportHeight: e }, { totalListHeight: t }]) => {
|
|
1630
|
+
const o = S(!1), n = se(
|
|
1631
|
+
p(
|
|
1632
|
+
te(o, e, t),
|
|
1633
|
+
W(([r]) => r),
|
|
1634
|
+
b(([, r, i]) => Math.max(0, r - i)),
|
|
1635
|
+
ye(0),
|
|
1636
|
+
Z()
|
|
1637
|
+
),
|
|
1638
|
+
0
|
|
1639
|
+
);
|
|
1640
|
+
return { alignToBottom: o, paddingTopAddition: n };
|
|
1641
|
+
},
|
|
1642
|
+
J(ce, Oo),
|
|
1643
|
+
{ singleton: !0 }
|
|
1644
|
+
), Wo = U(() => ({
|
|
1645
|
+
context: S(null)
|
|
1646
|
+
})), Ln = ({
|
|
1647
|
+
itemBottom: e,
|
|
1648
|
+
itemTop: t,
|
|
1649
|
+
locationParams: { align: o, behavior: n, ...r },
|
|
1650
|
+
viewportBottom: i,
|
|
1651
|
+
viewportTop: l
|
|
1652
|
+
}) => t < l ? { ...r, align: o ?? "start", behavior: n } : e > i ? { ...r, align: o ?? "end", behavior: n } : null, Ao = U(
|
|
1653
|
+
([
|
|
1654
|
+
{ gap: e, sizes: t, totalCount: o },
|
|
1655
|
+
{ fixedFooterHeight: n, fixedHeaderHeight: r, headerHeight: i, scrollingInProgress: l, scrollTop: s, viewportHeight: c },
|
|
1656
|
+
{ scrollToIndex: a }
|
|
1657
|
+
]) => {
|
|
1658
|
+
const m = F();
|
|
1659
|
+
return k(
|
|
1660
|
+
p(
|
|
1661
|
+
m,
|
|
1662
|
+
D(t, c, o, i, r, n, s),
|
|
1663
|
+
D(e),
|
|
1664
|
+
b(([[I, g, x, H, z, v, f, d], C]) => {
|
|
1665
|
+
const { align: R, behavior: h, calculateViewLocation: u = Ln, done: T, ...y } = I, L = Bo(I, g, H - 1), M = Qe(L, g.offsetTree, C) + z + v, A = M + Te(g.sizeTree, L)[1], G = d + v, $ = d + x - f, E = u({
|
|
1666
|
+
itemBottom: A,
|
|
1667
|
+
itemTop: M,
|
|
1668
|
+
locationParams: { align: R, behavior: h, ...y },
|
|
1669
|
+
viewportBottom: $,
|
|
1670
|
+
viewportTop: G
|
|
1671
|
+
});
|
|
1672
|
+
return E ? T && Ie(
|
|
1673
|
+
p(
|
|
1674
|
+
l,
|
|
1675
|
+
W((_) => !_),
|
|
1676
|
+
// skips the initial publish of false, and the cleanup call.
|
|
1677
|
+
// but if scrollingInProgress is true, we skip the initial publish.
|
|
1678
|
+
Pe(ee(l) ? 1 : 2)
|
|
1679
|
+
),
|
|
1680
|
+
T
|
|
1681
|
+
) : T && T(), E;
|
|
1682
|
+
}),
|
|
1683
|
+
W((I) => I !== null)
|
|
1684
|
+
),
|
|
1685
|
+
a
|
|
1686
|
+
), {
|
|
1687
|
+
scrollIntoView: m
|
|
1688
|
+
};
|
|
1689
|
+
},
|
|
1690
|
+
J(He, ce, ot, De, ke),
|
|
1691
|
+
{ singleton: !0 }
|
|
1692
|
+
);
|
|
1693
|
+
function so(e) {
|
|
1694
|
+
return e ? e === "smooth" ? "smooth" : "auto" : !1;
|
|
1695
|
+
}
|
|
1696
|
+
const Mn = (e, t) => typeof e == "function" ? so(e(t)) : t && so(e), On = U(
|
|
1697
|
+
([
|
|
1698
|
+
{ listRefresh: e, totalCount: t, fixedItemSize: o, data: n },
|
|
1699
|
+
{ atBottomState: r, isAtBottom: i },
|
|
1700
|
+
{ scrollToIndex: l },
|
|
1701
|
+
{ scrolledToInitialItem: s },
|
|
1702
|
+
{ didMount: c, propsReady: a },
|
|
1703
|
+
{ log: m },
|
|
1704
|
+
{ scrollingInProgress: I },
|
|
1705
|
+
{ context: g },
|
|
1706
|
+
{ scrollIntoView: x }
|
|
1707
|
+
]) => {
|
|
1708
|
+
const H = S(!1), z = F();
|
|
1709
|
+
let v = null;
|
|
1710
|
+
function f(h) {
|
|
1711
|
+
j(l, {
|
|
1712
|
+
align: "end",
|
|
1713
|
+
behavior: h,
|
|
1714
|
+
index: "LAST"
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
q(
|
|
1718
|
+
p(
|
|
1719
|
+
te(p(O(t), Pe(1)), c),
|
|
1720
|
+
D(O(H), i, s, I),
|
|
1721
|
+
b(([[h, u], T, y, L, M]) => {
|
|
1722
|
+
let A = u && L, G = "auto";
|
|
1723
|
+
return A && (G = Mn(T, y || M), A = A && !!G), { followOutputBehavior: G, shouldFollow: A, totalCount: h };
|
|
1724
|
+
}),
|
|
1725
|
+
W(({ shouldFollow: h }) => h)
|
|
1726
|
+
),
|
|
1727
|
+
({ followOutputBehavior: h, totalCount: u }) => {
|
|
1728
|
+
v && (v(), v = null), ee(o) ? requestAnimationFrame(() => {
|
|
1729
|
+
ee(m)("following output to ", { totalCount: u }, ue.DEBUG), f(h);
|
|
1730
|
+
}) : v = Ie(e, () => {
|
|
1731
|
+
ee(m)("following output to ", { totalCount: u }, ue.DEBUG), f(h), v = null;
|
|
1732
|
+
});
|
|
1733
|
+
}
|
|
1734
|
+
);
|
|
1735
|
+
function d(h) {
|
|
1736
|
+
const u = Ie(r, (T) => {
|
|
1737
|
+
h && !T.atBottom && T.notAtBottomBecause === "SIZE_INCREASED" && !v && (ee(m)("scrolling to bottom due to increased size", {}, ue.DEBUG), f("auto"));
|
|
1738
|
+
});
|
|
1739
|
+
setTimeout(u, 100);
|
|
1740
|
+
}
|
|
1741
|
+
q(
|
|
1742
|
+
p(
|
|
1743
|
+
te(O(H), t, a),
|
|
1744
|
+
W(([h, , u]) => h && u),
|
|
1745
|
+
Ce(
|
|
1746
|
+
({ value: h }, [, u]) => ({ refreshed: h === u, value: u }),
|
|
1747
|
+
{ refreshed: !1, value: 0 }
|
|
1748
|
+
),
|
|
1749
|
+
W(({ refreshed: h }) => h),
|
|
1750
|
+
D(H, t)
|
|
1751
|
+
),
|
|
1752
|
+
([, h]) => {
|
|
1753
|
+
ee(s) && d(h !== !1);
|
|
1754
|
+
}
|
|
1755
|
+
), q(z, () => {
|
|
1756
|
+
d(ee(H) !== !1);
|
|
1757
|
+
}), q(te(O(H), r), ([h, u]) => {
|
|
1758
|
+
h && !u.atBottom && u.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && f("auto");
|
|
1759
|
+
});
|
|
1760
|
+
const C = S(null), R = F();
|
|
1761
|
+
return k(
|
|
1762
|
+
Rt(
|
|
1763
|
+
p(
|
|
1764
|
+
O(n),
|
|
1765
|
+
b((h) => {
|
|
1766
|
+
var u;
|
|
1767
|
+
return (u = h == null ? void 0 : h.length) != null ? u : 0;
|
|
1768
|
+
})
|
|
1769
|
+
),
|
|
1770
|
+
p(O(t))
|
|
1771
|
+
),
|
|
1772
|
+
R
|
|
1773
|
+
), q(
|
|
1774
|
+
p(
|
|
1775
|
+
te(p(R, Pe(1)), c),
|
|
1776
|
+
D(O(C), s, I, g),
|
|
1777
|
+
b(([[h, u], T, y, L, M]) => u && y && (T == null ? void 0 : T({ context: M, totalCount: h, scrollingInProgress: L }))),
|
|
1778
|
+
W((h) => !!h),
|
|
1779
|
+
ye(0)
|
|
1780
|
+
),
|
|
1781
|
+
(h) => {
|
|
1782
|
+
v && (v(), v = null), ee(o) ? requestAnimationFrame(() => {
|
|
1783
|
+
ee(m)("scrolling into view", {}), j(x, h);
|
|
1784
|
+
}) : v = Ie(e, () => {
|
|
1785
|
+
ee(m)("scrolling into view", {}), j(x, h), v = null;
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
), { autoscrollToBottom: z, followOutput: H, scrollIntoViewOnChange: C };
|
|
1789
|
+
},
|
|
1790
|
+
J(
|
|
1791
|
+
He,
|
|
1792
|
+
rt,
|
|
1793
|
+
ot,
|
|
1794
|
+
nt,
|
|
1795
|
+
Le,
|
|
1796
|
+
ke,
|
|
1797
|
+
ce,
|
|
1798
|
+
Wo,
|
|
1799
|
+
Ao
|
|
1800
|
+
)
|
|
1801
|
+
), Wn = U(
|
|
1802
|
+
([{ data: e, firstItemIndex: t, gap: o, sizes: n }, { initialTopMostItemIndex: r }, { initialItemCount: i, listState: l }, { didMount: s }]) => (k(
|
|
1803
|
+
p(
|
|
1804
|
+
s,
|
|
1805
|
+
D(i),
|
|
1806
|
+
W(([, c]) => c !== 0),
|
|
1807
|
+
D(r, n, t, o, e),
|
|
1808
|
+
b(([[, c], a, m, I, g, x = []]) => Mo(c, a, m, I, g, x))
|
|
1809
|
+
),
|
|
1810
|
+
l
|
|
1811
|
+
), {}),
|
|
1812
|
+
J(He, nt, De, Le),
|
|
1813
|
+
{ singleton: !0 }
|
|
1814
|
+
), An = U(
|
|
1815
|
+
([{ didMount: e }, { scrollTo: t }, { listState: o }]) => {
|
|
1816
|
+
const n = S(0);
|
|
1817
|
+
return q(
|
|
1818
|
+
p(
|
|
1819
|
+
e,
|
|
1820
|
+
D(n),
|
|
1821
|
+
W(([, r]) => r !== 0),
|
|
1822
|
+
b(([, r]) => ({ top: r }))
|
|
1823
|
+
),
|
|
1824
|
+
(r) => {
|
|
1825
|
+
Ie(
|
|
1826
|
+
p(
|
|
1827
|
+
o,
|
|
1828
|
+
Pe(1),
|
|
1829
|
+
W((i) => i.items.length > 1)
|
|
1830
|
+
),
|
|
1831
|
+
() => {
|
|
1832
|
+
requestAnimationFrame(() => {
|
|
1833
|
+
j(t, r);
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
);
|
|
1837
|
+
}
|
|
1838
|
+
), {
|
|
1839
|
+
initialScrollTop: n
|
|
1840
|
+
};
|
|
1841
|
+
},
|
|
1842
|
+
J(Le, ce, De),
|
|
1843
|
+
{ singleton: !0 }
|
|
1844
|
+
), Po = U(
|
|
1845
|
+
([{ scrollVelocity: e }]) => {
|
|
1846
|
+
const t = S(!1), o = F(), n = S(!1);
|
|
1847
|
+
return k(
|
|
1848
|
+
p(
|
|
1849
|
+
e,
|
|
1850
|
+
D(n, t, o),
|
|
1851
|
+
W(([r, i]) => !!i),
|
|
1852
|
+
b(([r, i, l, s]) => {
|
|
1853
|
+
const { enter: c, exit: a } = i;
|
|
1854
|
+
if (l) {
|
|
1855
|
+
if (a(r, s))
|
|
1856
|
+
return !1;
|
|
1857
|
+
} else if (c(r, s))
|
|
1858
|
+
return !0;
|
|
1859
|
+
return l;
|
|
1860
|
+
}),
|
|
1861
|
+
Z()
|
|
1862
|
+
),
|
|
1863
|
+
t
|
|
1864
|
+
), q(
|
|
1865
|
+
p(te(t, e, o), D(n)),
|
|
1866
|
+
([[r, i, l], s]) => {
|
|
1867
|
+
r && s && s.change && s.change(i, l);
|
|
1868
|
+
}
|
|
1869
|
+
), { isSeeking: t, scrollSeekConfiguration: n, scrollSeekRangeChanged: o, scrollVelocity: e };
|
|
1870
|
+
},
|
|
1871
|
+
J(rt),
|
|
1872
|
+
{ singleton: !0 }
|
|
1873
|
+
), Gt = U(([{ scrollContainerState: e, scrollTo: t }]) => {
|
|
1874
|
+
const o = F(), n = F(), r = F(), i = S(!1), l = S(void 0);
|
|
1875
|
+
return k(
|
|
1876
|
+
p(
|
|
1877
|
+
te(o, n),
|
|
1878
|
+
b(([{ scrollHeight: s, scrollTop: c, viewportHeight: a }, { offsetTop: m }]) => ({
|
|
1879
|
+
scrollHeight: s,
|
|
1880
|
+
scrollTop: Math.max(0, c - m),
|
|
1881
|
+
viewportHeight: a
|
|
1882
|
+
}))
|
|
1883
|
+
),
|
|
1884
|
+
e
|
|
1885
|
+
), k(
|
|
1886
|
+
p(
|
|
1887
|
+
t,
|
|
1888
|
+
D(n),
|
|
1889
|
+
b(([s, { offsetTop: c }]) => ({
|
|
1890
|
+
...s,
|
|
1891
|
+
top: s.top + c
|
|
1892
|
+
}))
|
|
1893
|
+
),
|
|
1894
|
+
r
|
|
1895
|
+
), {
|
|
1896
|
+
customScrollParent: l,
|
|
1897
|
+
// config
|
|
1898
|
+
useWindowScroll: i,
|
|
1899
|
+
// input
|
|
1900
|
+
windowScrollContainerState: o,
|
|
1901
|
+
// signals
|
|
1902
|
+
windowScrollTo: r,
|
|
1903
|
+
windowViewportRect: n
|
|
1904
|
+
};
|
|
1905
|
+
}, J(ce)), Pn = U(
|
|
1906
|
+
([
|
|
1907
|
+
{ sizeRanges: e, sizes: t },
|
|
1908
|
+
{ headerHeight: o, scrollTop: n },
|
|
1909
|
+
{ initialTopMostItemIndex: r },
|
|
1910
|
+
{ didMount: i },
|
|
1911
|
+
{ useWindowScroll: l, windowScrollContainerState: s, windowViewportRect: c }
|
|
1912
|
+
]) => {
|
|
1913
|
+
const a = F(), m = S(void 0), I = S(null), g = S(null);
|
|
1914
|
+
return k(s, I), k(c, g), q(
|
|
1915
|
+
p(
|
|
1916
|
+
a,
|
|
1917
|
+
D(t, n, l, I, g, o)
|
|
1918
|
+
),
|
|
1919
|
+
([x, H, z, v, f, d, C]) => {
|
|
1920
|
+
const R = Tn(H.sizeTree);
|
|
1921
|
+
v && f !== null && d !== null && (z = f.scrollTop - d.offsetTop), z -= C, x({ ranges: R, scrollTop: z });
|
|
1922
|
+
}
|
|
1923
|
+
), k(p(m, W(Ot), b(jn)), r), k(
|
|
1924
|
+
p(
|
|
1925
|
+
i,
|
|
1926
|
+
D(m),
|
|
1927
|
+
W(([, x]) => x !== void 0),
|
|
1928
|
+
Z(),
|
|
1929
|
+
b(([, x]) => x.ranges)
|
|
1930
|
+
),
|
|
1931
|
+
e
|
|
1932
|
+
), {
|
|
1933
|
+
getState: a,
|
|
1934
|
+
restoreStateFrom: m
|
|
1935
|
+
};
|
|
1936
|
+
},
|
|
1937
|
+
J(He, ce, nt, Le, Gt)
|
|
1938
|
+
);
|
|
1939
|
+
function jn(e) {
|
|
1940
|
+
return { align: "start", index: 0, offset: e.scrollTop };
|
|
1941
|
+
}
|
|
1942
|
+
const Dn = U(([{ topItemsIndexes: e }]) => {
|
|
1943
|
+
const t = S(0);
|
|
1944
|
+
return k(
|
|
1945
|
+
p(
|
|
1946
|
+
t,
|
|
1947
|
+
W((o) => o >= 0),
|
|
1948
|
+
b((o) => Array.from({ length: o }).map((n, r) => r))
|
|
1949
|
+
),
|
|
1950
|
+
e
|
|
1951
|
+
), { topItemCount: t };
|
|
1952
|
+
}, J(De));
|
|
1953
|
+
function jo(e) {
|
|
1954
|
+
let t = !1, o;
|
|
1955
|
+
return () => (t || (t = !0, o = e()), o);
|
|
1956
|
+
}
|
|
1957
|
+
const Vn = jo(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), Fn = U(
|
|
1958
|
+
([
|
|
1959
|
+
{ deviation: e, scrollBy: t, scrollingInProgress: o, scrollTop: n },
|
|
1960
|
+
{ isAtBottom: r, isScrolling: i, lastJumpDueToItemResize: l, scrollDirection: s },
|
|
1961
|
+
{ listState: c },
|
|
1962
|
+
{ beforeUnshiftWith: a, gap: m, shiftWithOffset: I, sizes: g },
|
|
1963
|
+
{ log: x },
|
|
1964
|
+
{ recalcInProgress: H }
|
|
1965
|
+
]) => {
|
|
1966
|
+
const z = he(
|
|
1967
|
+
p(
|
|
1968
|
+
c,
|
|
1969
|
+
D(l),
|
|
1970
|
+
Ce(
|
|
1971
|
+
([, f, d, C], [{ bottom: R, items: h, offsetBottom: u, totalCount: T }, y]) => {
|
|
1972
|
+
const L = R + u;
|
|
1973
|
+
let M = 0;
|
|
1974
|
+
return d === T && f.length > 0 && h.length > 0 && (h[0].originalIndex === 0 && f[0].originalIndex === 0 || (M = L - C, M !== 0 && (M += y))), [M, h, T, L];
|
|
1975
|
+
},
|
|
1976
|
+
[0, [], 0, 0]
|
|
1977
|
+
),
|
|
1978
|
+
W(([f]) => f !== 0),
|
|
1979
|
+
D(n, s, o, r, x, H),
|
|
1980
|
+
W(([, f, d, C, , , R]) => !R && !C && f !== 0 && d === et),
|
|
1981
|
+
b(([[f], , , , , d]) => (d("Upward scrolling compensation", { amount: f }, ue.DEBUG), f))
|
|
1982
|
+
)
|
|
1983
|
+
);
|
|
1984
|
+
function v(f) {
|
|
1985
|
+
f > 0 ? (j(t, { behavior: "auto", top: -f }), j(e, 0)) : (j(e, 0), j(t, { behavior: "auto", top: -f }));
|
|
1986
|
+
}
|
|
1987
|
+
return q(p(z, D(e, i)), ([f, d, C]) => {
|
|
1988
|
+
C && Vn() ? j(e, d - f) : v(-f);
|
|
1989
|
+
}), q(
|
|
1990
|
+
p(
|
|
1991
|
+
te(se(i, !1), e, H),
|
|
1992
|
+
W(([f, d, C]) => !f && !C && d !== 0),
|
|
1993
|
+
b(([f, d]) => d),
|
|
1994
|
+
ye(1)
|
|
1995
|
+
),
|
|
1996
|
+
v
|
|
1997
|
+
), k(
|
|
1998
|
+
p(
|
|
1999
|
+
I,
|
|
2000
|
+
b((f) => ({ top: -f }))
|
|
2001
|
+
),
|
|
2002
|
+
t
|
|
2003
|
+
), q(
|
|
2004
|
+
p(
|
|
2005
|
+
a,
|
|
2006
|
+
D(g, m),
|
|
2007
|
+
b(([f, { groupIndices: d, lastSize: C, sizeTree: R }, h]) => {
|
|
2008
|
+
function u(T) {
|
|
2009
|
+
return T * (C + h);
|
|
2010
|
+
}
|
|
2011
|
+
if (d.length === 0)
|
|
2012
|
+
return u(f);
|
|
2013
|
+
{
|
|
2014
|
+
let T = 0;
|
|
2015
|
+
const y = Ze(R, 0);
|
|
2016
|
+
let L = 0, M = 0;
|
|
2017
|
+
for (; L < f; ) {
|
|
2018
|
+
L++, T += y;
|
|
2019
|
+
let A = d.length === M + 1 ? 1 / 0 : d[M + 1] - d[M] - 1;
|
|
2020
|
+
L + A > f && (T -= y, A = f - L + 1), L += A, T += u(A), M++;
|
|
2021
|
+
}
|
|
2022
|
+
return T;
|
|
2023
|
+
}
|
|
2024
|
+
})
|
|
2025
|
+
),
|
|
2026
|
+
(f) => {
|
|
2027
|
+
j(e, f), requestAnimationFrame(() => {
|
|
2028
|
+
j(t, { top: f }), requestAnimationFrame(() => {
|
|
2029
|
+
j(e, 0), j(H, !1);
|
|
2030
|
+
});
|
|
2031
|
+
});
|
|
2032
|
+
}
|
|
2033
|
+
), { deviation: e };
|
|
2034
|
+
},
|
|
2035
|
+
J(ce, rt, De, He, ke, Pt)
|
|
2036
|
+
), Gn = U(
|
|
2037
|
+
([
|
|
2038
|
+
e,
|
|
2039
|
+
t,
|
|
2040
|
+
o,
|
|
2041
|
+
n,
|
|
2042
|
+
r,
|
|
2043
|
+
i,
|
|
2044
|
+
l,
|
|
2045
|
+
s,
|
|
2046
|
+
c,
|
|
2047
|
+
a,
|
|
2048
|
+
m
|
|
2049
|
+
]) => ({
|
|
2050
|
+
...e,
|
|
2051
|
+
...t,
|
|
2052
|
+
...o,
|
|
2053
|
+
...n,
|
|
2054
|
+
...r,
|
|
2055
|
+
...i,
|
|
2056
|
+
...l,
|
|
2057
|
+
...s,
|
|
2058
|
+
...c,
|
|
2059
|
+
...a,
|
|
2060
|
+
...m
|
|
2061
|
+
}),
|
|
2062
|
+
J(
|
|
2063
|
+
Ft,
|
|
2064
|
+
Wn,
|
|
2065
|
+
Le,
|
|
2066
|
+
Po,
|
|
2067
|
+
Oo,
|
|
2068
|
+
An,
|
|
2069
|
+
kn,
|
|
2070
|
+
Gt,
|
|
2071
|
+
Ao,
|
|
2072
|
+
ke,
|
|
2073
|
+
Wo
|
|
2074
|
+
)
|
|
2075
|
+
), Nn = U(
|
|
2076
|
+
([
|
|
2077
|
+
{
|
|
2078
|
+
data: e,
|
|
2079
|
+
defaultItemSize: t,
|
|
2080
|
+
firstItemIndex: o,
|
|
2081
|
+
fixedItemSize: n,
|
|
2082
|
+
gap: r,
|
|
2083
|
+
groupIndices: i,
|
|
2084
|
+
itemSize: l,
|
|
2085
|
+
sizeRanges: s,
|
|
2086
|
+
sizes: c,
|
|
2087
|
+
statefulTotalCount: a,
|
|
2088
|
+
totalCount: m,
|
|
2089
|
+
trackItemSizes: I
|
|
2090
|
+
},
|
|
2091
|
+
{ initialItemFinalLocationReached: g, initialTopMostItemIndex: x, scrolledToInitialItem: H },
|
|
2092
|
+
z,
|
|
2093
|
+
v,
|
|
2094
|
+
f,
|
|
2095
|
+
{ listState: d, topItemsIndexes: C, ...R },
|
|
2096
|
+
{ scrollToIndex: h },
|
|
2097
|
+
u,
|
|
2098
|
+
{ topItemCount: T },
|
|
2099
|
+
{ groupCounts: y },
|
|
2100
|
+
L
|
|
2101
|
+
]) => (k(R.rangeChanged, L.scrollSeekRangeChanged), k(
|
|
2102
|
+
p(
|
|
2103
|
+
L.windowViewportRect,
|
|
2104
|
+
b((M) => M.visibleHeight)
|
|
2105
|
+
),
|
|
2106
|
+
z.viewportHeight
|
|
2107
|
+
), {
|
|
2108
|
+
data: e,
|
|
2109
|
+
defaultItemHeight: t,
|
|
2110
|
+
firstItemIndex: o,
|
|
2111
|
+
fixedItemHeight: n,
|
|
2112
|
+
gap: r,
|
|
2113
|
+
groupCounts: y,
|
|
2114
|
+
initialItemFinalLocationReached: g,
|
|
2115
|
+
initialTopMostItemIndex: x,
|
|
2116
|
+
scrolledToInitialItem: H,
|
|
2117
|
+
sizeRanges: s,
|
|
2118
|
+
topItemCount: T,
|
|
2119
|
+
topItemsIndexes: C,
|
|
2120
|
+
// input
|
|
2121
|
+
totalCount: m,
|
|
2122
|
+
...f,
|
|
2123
|
+
groupIndices: i,
|
|
2124
|
+
itemSize: l,
|
|
2125
|
+
listState: d,
|
|
2126
|
+
scrollToIndex: h,
|
|
2127
|
+
// output
|
|
2128
|
+
statefulTotalCount: a,
|
|
2129
|
+
trackItemSizes: I,
|
|
2130
|
+
// exported from stateFlagsSystem
|
|
2131
|
+
...R,
|
|
2132
|
+
// the bag of IO from featureGroup1System
|
|
2133
|
+
...L,
|
|
2134
|
+
...z,
|
|
2135
|
+
sizes: c,
|
|
2136
|
+
...v
|
|
2137
|
+
}),
|
|
2138
|
+
J(
|
|
2139
|
+
He,
|
|
2140
|
+
nt,
|
|
2141
|
+
ce,
|
|
2142
|
+
Pn,
|
|
2143
|
+
On,
|
|
2144
|
+
De,
|
|
2145
|
+
ot,
|
|
2146
|
+
Fn,
|
|
2147
|
+
Dn,
|
|
2148
|
+
Eo,
|
|
2149
|
+
Gn
|
|
2150
|
+
)
|
|
2151
|
+
);
|
|
2152
|
+
function _n(e, t) {
|
|
2153
|
+
const o = {}, n = {};
|
|
2154
|
+
let r = 0;
|
|
2155
|
+
const i = e.length;
|
|
2156
|
+
for (; r < i; )
|
|
2157
|
+
n[e[r]] = 1, r += 1;
|
|
2158
|
+
for (const l in t)
|
|
2159
|
+
Object.hasOwn(n, l) || (o[l] = t[l]);
|
|
2160
|
+
return o;
|
|
2161
|
+
}
|
|
2162
|
+
const ct = typeof document < "u" ? B.useLayoutEffect : B.useEffect;
|
|
2163
|
+
function Do(e, t, o) {
|
|
2164
|
+
const n = Object.keys(t.required || {}), r = Object.keys(t.optional || {}), i = Object.keys(t.methods || {}), l = Object.keys(t.events || {}), s = B.createContext({});
|
|
2165
|
+
function c(v, f) {
|
|
2166
|
+
v.propsReady && j(v.propsReady, !1);
|
|
2167
|
+
for (const d of n) {
|
|
2168
|
+
const C = v[t.required[d]];
|
|
2169
|
+
j(C, f[d]);
|
|
2170
|
+
}
|
|
2171
|
+
for (const d of r)
|
|
2172
|
+
if (d in f) {
|
|
2173
|
+
const C = v[t.optional[d]];
|
|
2174
|
+
j(C, f[d]);
|
|
2175
|
+
}
|
|
2176
|
+
v.propsReady && j(v.propsReady, !0);
|
|
2177
|
+
}
|
|
2178
|
+
function a(v) {
|
|
2179
|
+
return i.reduce((f, d) => (f[d] = (C) => {
|
|
2180
|
+
const R = v[t.methods[d]];
|
|
2181
|
+
j(R, C);
|
|
2182
|
+
}, f), {});
|
|
2183
|
+
}
|
|
2184
|
+
function m(v) {
|
|
2185
|
+
return l.reduce((f, d) => (f[d] = rn(v[t.events[d]]), f), {});
|
|
2186
|
+
}
|
|
2187
|
+
const I = B.forwardRef((v, f) => {
|
|
2188
|
+
const { children: d, ...C } = v, [R] = B.useState(() => xt(sn(e), (T) => {
|
|
2189
|
+
c(T, C);
|
|
2190
|
+
})), [h] = B.useState(Jt(m, R));
|
|
2191
|
+
ct(() => {
|
|
2192
|
+
for (const T of l)
|
|
2193
|
+
T in C && q(h[T], C[T]);
|
|
2194
|
+
return () => {
|
|
2195
|
+
Object.values(h).map(Wt);
|
|
2196
|
+
};
|
|
2197
|
+
}, [C, h, R]), ct(() => {
|
|
2198
|
+
c(R, C);
|
|
2199
|
+
}), B.useImperativeHandle(f, Zt(a(R)));
|
|
2200
|
+
const u = o;
|
|
2201
|
+
return /* @__PURE__ */ N.jsx(s.Provider, { value: R, children: o ? /* @__PURE__ */ N.jsx(u, { ..._n([...n, ...r, ...l], C), children: d }) : d });
|
|
2202
|
+
}), g = (v) => {
|
|
2203
|
+
const f = B.useContext(s);
|
|
2204
|
+
return B.useCallback(
|
|
2205
|
+
(d) => {
|
|
2206
|
+
j(f[v], d);
|
|
2207
|
+
},
|
|
2208
|
+
[f, v]
|
|
2209
|
+
);
|
|
2210
|
+
}, x = (v) => {
|
|
2211
|
+
const f = B.useContext(s)[v], d = B.useCallback(
|
|
2212
|
+
(C) => q(f, C),
|
|
2213
|
+
[f]
|
|
2214
|
+
);
|
|
2215
|
+
return B.useSyncExternalStore(
|
|
2216
|
+
d,
|
|
2217
|
+
() => ee(f),
|
|
2218
|
+
() => ee(f)
|
|
2219
|
+
);
|
|
2220
|
+
}, H = (v) => {
|
|
2221
|
+
const f = B.useContext(s)[v], [d, C] = B.useState(Jt(ee, f));
|
|
2222
|
+
return ct(
|
|
2223
|
+
() => q(f, (R) => {
|
|
2224
|
+
R !== d && C(Zt(R));
|
|
2225
|
+
}),
|
|
2226
|
+
[f, d]
|
|
2227
|
+
), d;
|
|
2228
|
+
}, z = B.version.startsWith("18") ? x : H;
|
|
2229
|
+
return {
|
|
2230
|
+
Component: I,
|
|
2231
|
+
useEmitter: (v, f) => {
|
|
2232
|
+
const d = B.useContext(s)[v];
|
|
2233
|
+
ct(() => q(d, f), [f, d]);
|
|
2234
|
+
},
|
|
2235
|
+
useEmitterValue: z,
|
|
2236
|
+
usePublisher: g
|
|
2237
|
+
};
|
|
2238
|
+
}
|
|
2239
|
+
const Vo = B.createContext(void 0), Fo = B.createContext(void 0), Go = typeof document < "u" ? B.useLayoutEffect : B.useEffect;
|
|
2240
|
+
function zt(e) {
|
|
2241
|
+
return "self" in e;
|
|
2242
|
+
}
|
|
2243
|
+
function qn(e) {
|
|
2244
|
+
return "body" in e;
|
|
2245
|
+
}
|
|
2246
|
+
function No(e, t, o, n = tt, r, i) {
|
|
2247
|
+
const l = B.useRef(null), s = B.useRef(null), c = B.useRef(null), a = B.useCallback(
|
|
2248
|
+
(g) => {
|
|
2249
|
+
let x, H, z;
|
|
2250
|
+
const v = g.target;
|
|
2251
|
+
if (qn(v) || zt(v)) {
|
|
2252
|
+
const d = zt(v) ? v : v.defaultView;
|
|
2253
|
+
z = i ? d.scrollX : d.scrollY, x = i ? d.document.documentElement.scrollWidth : d.document.documentElement.scrollHeight, H = i ? d.innerWidth : d.innerHeight;
|
|
2254
|
+
} else
|
|
2255
|
+
z = i ? v.scrollLeft : v.scrollTop, x = i ? v.scrollWidth : v.scrollHeight, H = i ? v.offsetWidth : v.offsetHeight;
|
|
2256
|
+
const f = () => {
|
|
2257
|
+
e({
|
|
2258
|
+
scrollHeight: x,
|
|
2259
|
+
scrollTop: Math.max(z, 0),
|
|
2260
|
+
viewportHeight: H
|
|
2261
|
+
});
|
|
2262
|
+
};
|
|
2263
|
+
g.suppressFlushSync ? f() : Jo.flushSync(f), s.current !== null && (z === s.current || z <= 0 || z === x - H) && (s.current = null, t(!0), c.current && (clearTimeout(c.current), c.current = null));
|
|
2264
|
+
},
|
|
2265
|
+
[e, t, i]
|
|
2266
|
+
);
|
|
2267
|
+
B.useEffect(() => {
|
|
2268
|
+
const g = r || l.current;
|
|
2269
|
+
return n(r || l.current), a({ suppressFlushSync: !0, target: g }), g.addEventListener("scroll", a, { passive: !0 }), () => {
|
|
2270
|
+
n(null), g.removeEventListener("scroll", a);
|
|
2271
|
+
};
|
|
2272
|
+
}, [l, a, o, n, r]);
|
|
2273
|
+
function m(g) {
|
|
2274
|
+
const x = l.current;
|
|
2275
|
+
if (!x || (i ? "offsetWidth" in x && x.offsetWidth === 0 : "offsetHeight" in x && x.offsetHeight === 0))
|
|
2276
|
+
return;
|
|
2277
|
+
const H = g.behavior === "smooth";
|
|
2278
|
+
let z, v, f;
|
|
2279
|
+
zt(x) ? (v = Math.max(
|
|
2280
|
+
Be(x.document.documentElement, i ? "width" : "height"),
|
|
2281
|
+
i ? x.document.documentElement.scrollWidth : x.document.documentElement.scrollHeight
|
|
2282
|
+
), z = i ? x.innerWidth : x.innerHeight, f = i ? window.scrollX : window.scrollY) : (v = x[i ? "scrollWidth" : "scrollHeight"], z = Be(x, i ? "width" : "height"), f = x[i ? "scrollLeft" : "scrollTop"]);
|
|
2283
|
+
const d = v - z;
|
|
2284
|
+
if (g.top = Math.ceil(Math.max(Math.min(d, g.top), 0)), Lo(z, v) || g.top === f) {
|
|
2285
|
+
e({ scrollHeight: v, scrollTop: f, viewportHeight: z }), H && t(!0);
|
|
2286
|
+
return;
|
|
2287
|
+
}
|
|
2288
|
+
H ? (s.current = g.top, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
2289
|
+
c.current = null, s.current = null, t(!0);
|
|
2290
|
+
}, 1e3)) : s.current = null, i && (g = { behavior: g.behavior, left: g.top }), x.scrollTo(g);
|
|
2291
|
+
}
|
|
2292
|
+
function I(g) {
|
|
2293
|
+
i && (g = { behavior: g.behavior, left: g.top }), l.current.scrollBy(g);
|
|
2294
|
+
}
|
|
2295
|
+
return { scrollByCallback: I, scrollerRef: l, scrollToCallback: m };
|
|
2296
|
+
}
|
|
2297
|
+
const yt = "-webkit-sticky", co = "sticky", Nt = jo(() => {
|
|
2298
|
+
if (typeof document > "u")
|
|
2299
|
+
return co;
|
|
2300
|
+
const e = document.createElement("div");
|
|
2301
|
+
return e.style.position = yt, e.style.position === yt ? yt : co;
|
|
2302
|
+
});
|
|
2303
|
+
function _o(e) {
|
|
2304
|
+
return e;
|
|
2305
|
+
}
|
|
2306
|
+
const Un = /* @__PURE__ */ U(() => {
|
|
2307
|
+
const e = S((s) => `Item ${s}`), t = S((s) => `Group ${s}`), o = S({}), n = S(_o), r = S("div"), i = S(tt), l = (s, c = null) => se(
|
|
2308
|
+
p(
|
|
2309
|
+
o,
|
|
2310
|
+
b((a) => a[s]),
|
|
2311
|
+
Z()
|
|
2312
|
+
),
|
|
2313
|
+
c
|
|
2314
|
+
);
|
|
2315
|
+
return {
|
|
2316
|
+
components: o,
|
|
2317
|
+
computeItemKey: n,
|
|
2318
|
+
EmptyPlaceholder: l("EmptyPlaceholder"),
|
|
2319
|
+
FooterComponent: l("Footer"),
|
|
2320
|
+
GroupComponent: l("Group", "div"),
|
|
2321
|
+
groupContent: t,
|
|
2322
|
+
HeaderComponent: l("Header"),
|
|
2323
|
+
HeaderFooterTag: r,
|
|
2324
|
+
ItemComponent: l("Item", "div"),
|
|
2325
|
+
itemContent: e,
|
|
2326
|
+
ListComponent: l("List", "div"),
|
|
2327
|
+
ScrollerComponent: l("Scroller", "div"),
|
|
2328
|
+
scrollerRef: i,
|
|
2329
|
+
ScrollSeekPlaceholder: l("ScrollSeekPlaceholder"),
|
|
2330
|
+
TopItemListComponent: l("TopItemList")
|
|
2331
|
+
};
|
|
2332
|
+
}), Kn = /* @__PURE__ */ U(
|
|
2333
|
+
([e, t]) => ({ ...e, ...t }),
|
|
2334
|
+
J(Nn, Un)
|
|
2335
|
+
), $n = ({ height: e }) => /* @__PURE__ */ N.jsx("div", { style: { height: e } }), Yn = { overflowAnchor: "none", position: Nt(), zIndex: 1 }, qo = { overflowAnchor: "none" }, Xn = { ...qo, display: "inline-block", height: "100%" }, ao = /* @__PURE__ */ B.memo(function({ showTopList: e = !1 }) {
|
|
2336
|
+
const t = P("listState"), o = me("sizeRanges"), n = P("useWindowScroll"), r = P("customScrollParent"), i = me("windowScrollContainerState"), l = me("scrollContainerState"), s = r || n ? i : l, c = P("itemContent"), a = P("context"), m = P("groupContent"), I = P("trackItemSizes"), g = P("itemSize"), x = P("log"), H = me("gap"), z = P("horizontalDirection"), { callbackRef: v } = un(
|
|
2337
|
+
o,
|
|
2338
|
+
g,
|
|
2339
|
+
I,
|
|
2340
|
+
e ? tt : s,
|
|
2341
|
+
x,
|
|
2342
|
+
H,
|
|
2343
|
+
r,
|
|
2344
|
+
z,
|
|
2345
|
+
P("skipAnimationFrameInResizeObserver")
|
|
2346
|
+
), [f, d] = B.useState(0);
|
|
2347
|
+
_t("deviation", (E) => {
|
|
2348
|
+
f !== E && d(E);
|
|
2349
|
+
});
|
|
2350
|
+
const C = P("EmptyPlaceholder"), R = P("ScrollSeekPlaceholder") || $n, h = P("ListComponent"), u = P("ItemComponent"), T = P("GroupComponent"), y = P("computeItemKey"), L = P("isSeeking"), M = P("groupIndices").length > 0, A = P("alignToBottom"), G = P("initialItemFinalLocationReached"), $ = e ? {} : {
|
|
2351
|
+
boxSizing: "border-box",
|
|
2352
|
+
...z ? {
|
|
2353
|
+
display: "inline-block",
|
|
2354
|
+
height: "100%",
|
|
2355
|
+
marginLeft: f !== 0 ? f : A ? "auto" : 0,
|
|
2356
|
+
paddingLeft: t.offsetTop,
|
|
2357
|
+
paddingRight: t.offsetBottom,
|
|
2358
|
+
whiteSpace: "nowrap"
|
|
2359
|
+
} : {
|
|
2360
|
+
marginTop: f !== 0 ? f : A ? "auto" : 0,
|
|
2361
|
+
paddingBottom: t.offsetBottom,
|
|
2362
|
+
paddingTop: t.offsetTop
|
|
2363
|
+
},
|
|
2364
|
+
...G ? {} : { visibility: "hidden" }
|
|
2365
|
+
};
|
|
2366
|
+
return !e && t.totalCount === 0 && C ? /* @__PURE__ */ N.jsx(C, { ...ie(C, a) }) : /* @__PURE__ */ N.jsx(
|
|
2367
|
+
h,
|
|
2368
|
+
{
|
|
2369
|
+
...ie(h, a),
|
|
2370
|
+
"data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
|
|
2371
|
+
ref: v,
|
|
2372
|
+
style: $,
|
|
2373
|
+
children: (e ? t.topItems : t.items).map((E) => {
|
|
2374
|
+
const _ = E.originalIndex, ne = y(_ + t.firstItemIndex, E.data, a);
|
|
2375
|
+
return L ? /* @__PURE__ */ ut(
|
|
2376
|
+
R,
|
|
2377
|
+
{
|
|
2378
|
+
...ie(R, a),
|
|
2379
|
+
height: E.size,
|
|
2380
|
+
index: E.index,
|
|
2381
|
+
key: ne,
|
|
2382
|
+
type: E.type || "item",
|
|
2383
|
+
...E.type === "group" ? {} : { groupIndex: E.groupIndex }
|
|
2384
|
+
}
|
|
2385
|
+
) : E.type === "group" ? /* @__PURE__ */ ut(
|
|
2386
|
+
T,
|
|
2387
|
+
{
|
|
2388
|
+
...ie(T, a),
|
|
2389
|
+
"data-index": _,
|
|
2390
|
+
"data-item-index": E.index,
|
|
2391
|
+
"data-known-size": E.size,
|
|
2392
|
+
key: ne,
|
|
2393
|
+
style: Yn
|
|
2394
|
+
},
|
|
2395
|
+
m(E.index, a)
|
|
2396
|
+
) : /* @__PURE__ */ ut(
|
|
2397
|
+
u,
|
|
2398
|
+
{
|
|
2399
|
+
...ie(u, a),
|
|
2400
|
+
...er(u, E.data),
|
|
2401
|
+
"data-index": _,
|
|
2402
|
+
"data-item-group-index": E.groupIndex,
|
|
2403
|
+
"data-item-index": E.index,
|
|
2404
|
+
"data-known-size": E.size,
|
|
2405
|
+
key: ne,
|
|
2406
|
+
style: z ? Xn : qo
|
|
2407
|
+
},
|
|
2408
|
+
M ? c(E.index, E.groupIndex, E.data, a) : c(E.index, E.data, a)
|
|
2409
|
+
);
|
|
2410
|
+
})
|
|
2411
|
+
}
|
|
2412
|
+
);
|
|
2413
|
+
}), Zn = {
|
|
2414
|
+
height: "100%",
|
|
2415
|
+
outline: "none",
|
|
2416
|
+
overflowY: "auto",
|
|
2417
|
+
position: "relative",
|
|
2418
|
+
WebkitOverflowScrolling: "touch"
|
|
2419
|
+
}, Jn = {
|
|
2420
|
+
outline: "none",
|
|
2421
|
+
overflowX: "auto",
|
|
2422
|
+
position: "relative"
|
|
2423
|
+
}, wt = (e) => ({
|
|
2424
|
+
height: "100%",
|
|
2425
|
+
position: "absolute",
|
|
2426
|
+
top: 0,
|
|
2427
|
+
width: "100%",
|
|
2428
|
+
...e ? { display: "flex", flexDirection: "column" } : {}
|
|
2429
|
+
}), Qn = {
|
|
2430
|
+
position: Nt(),
|
|
2431
|
+
top: 0,
|
|
2432
|
+
width: "100%",
|
|
2433
|
+
zIndex: 1
|
|
2434
|
+
};
|
|
2435
|
+
function ie(e, t) {
|
|
2436
|
+
if (typeof e != "string")
|
|
2437
|
+
return { context: t };
|
|
2438
|
+
}
|
|
2439
|
+
function er(e, t) {
|
|
2440
|
+
return { item: typeof e == "string" ? void 0 : t };
|
|
2441
|
+
}
|
|
2442
|
+
const tr = /* @__PURE__ */ B.memo(function() {
|
|
2443
|
+
const e = P("HeaderComponent"), t = me("headerHeight"), o = P("HeaderFooterTag"), n = je(
|
|
2444
|
+
B.useMemo(
|
|
2445
|
+
() => (i) => {
|
|
2446
|
+
t(Be(i, "height"));
|
|
2447
|
+
},
|
|
2448
|
+
[t]
|
|
2449
|
+
),
|
|
2450
|
+
!0,
|
|
2451
|
+
P("skipAnimationFrameInResizeObserver")
|
|
2452
|
+
), r = P("context");
|
|
2453
|
+
return e ? /* @__PURE__ */ N.jsx(o, { ref: n, children: /* @__PURE__ */ N.jsx(e, { ...ie(e, r) }) }) : null;
|
|
2454
|
+
}), or = /* @__PURE__ */ B.memo(function() {
|
|
2455
|
+
const e = P("FooterComponent"), t = me("footerHeight"), o = P("HeaderFooterTag"), n = je(
|
|
2456
|
+
B.useMemo(
|
|
2457
|
+
() => (i) => {
|
|
2458
|
+
t(Be(i, "height"));
|
|
2459
|
+
},
|
|
2460
|
+
[t]
|
|
2461
|
+
),
|
|
2462
|
+
!0,
|
|
2463
|
+
P("skipAnimationFrameInResizeObserver")
|
|
2464
|
+
), r = P("context");
|
|
2465
|
+
return e ? /* @__PURE__ */ N.jsx(o, { ref: n, children: /* @__PURE__ */ N.jsx(e, { ...ie(e, r) }) }) : null;
|
|
2466
|
+
});
|
|
2467
|
+
function Uo({ useEmitter: e, useEmitterValue: t, usePublisher: o }) {
|
|
2468
|
+
return B.memo(function({ children: n, style: r, context: i, ...l }) {
|
|
2469
|
+
const s = o("scrollContainerState"), c = t("ScrollerComponent"), a = o("smoothScrollTargetReached"), m = t("scrollerRef"), I = t("horizontalDirection") || !1, { scrollByCallback: g, scrollerRef: x, scrollToCallback: H } = No(
|
|
2470
|
+
s,
|
|
2471
|
+
a,
|
|
2472
|
+
c,
|
|
2473
|
+
m,
|
|
2474
|
+
void 0,
|
|
2475
|
+
I
|
|
2476
|
+
);
|
|
2477
|
+
return e("scrollTo", H), e("scrollBy", g), /* @__PURE__ */ N.jsx(
|
|
2478
|
+
c,
|
|
2479
|
+
{
|
|
2480
|
+
"data-testid": "virtuoso-scroller",
|
|
2481
|
+
"data-virtuoso-scroller": !0,
|
|
2482
|
+
ref: x,
|
|
2483
|
+
style: { ...I ? Jn : Zn, ...r },
|
|
2484
|
+
tabIndex: 0,
|
|
2485
|
+
...l,
|
|
2486
|
+
...ie(c, i),
|
|
2487
|
+
children: n
|
|
2488
|
+
}
|
|
2489
|
+
);
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
function Ko({ useEmitter: e, useEmitterValue: t, usePublisher: o }) {
|
|
2493
|
+
return B.memo(function({ children: n, style: r, context: i, ...l }) {
|
|
2494
|
+
const s = o("windowScrollContainerState"), c = t("ScrollerComponent"), a = o("smoothScrollTargetReached"), m = t("totalListHeight"), I = t("deviation"), g = t("customScrollParent"), x = B.useRef(null), H = t("scrollerRef"), { scrollByCallback: z, scrollerRef: v, scrollToCallback: f } = No(
|
|
2495
|
+
s,
|
|
2496
|
+
a,
|
|
2497
|
+
c,
|
|
2498
|
+
H,
|
|
2499
|
+
g
|
|
2500
|
+
);
|
|
2501
|
+
return Go(() => {
|
|
2502
|
+
var d;
|
|
2503
|
+
return v.current = g || ((d = x.current) == null ? void 0 : d.ownerDocument.defaultView), () => {
|
|
2504
|
+
v.current = null;
|
|
2505
|
+
};
|
|
2506
|
+
}, [v, g]), e("windowScrollTo", f), e("scrollBy", z), /* @__PURE__ */ N.jsx(
|
|
2507
|
+
c,
|
|
2508
|
+
{
|
|
2509
|
+
ref: x,
|
|
2510
|
+
"data-virtuoso-scroller": !0,
|
|
2511
|
+
style: { position: "relative", ...r, ...m !== 0 ? { height: m + I } : {} },
|
|
2512
|
+
...l,
|
|
2513
|
+
...ie(c, i),
|
|
2514
|
+
children: n
|
|
2515
|
+
}
|
|
2516
|
+
);
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2519
|
+
const nr = ({ children: e }) => {
|
|
2520
|
+
const t = B.useContext(Vo), o = me("viewportHeight"), n = me("fixedItemHeight"), r = P("alignToBottom"), i = P("horizontalDirection"), l = B.useMemo(
|
|
2521
|
+
() => xo(o, (c) => Be(c, i ? "width" : "height")),
|
|
2522
|
+
[o, i]
|
|
2523
|
+
), s = je(l, !0, P("skipAnimationFrameInResizeObserver"));
|
|
2524
|
+
return B.useEffect(() => {
|
|
2525
|
+
t && (o(t.viewportHeight), n(t.itemHeight));
|
|
2526
|
+
}, [t, o, n]), /* @__PURE__ */ N.jsx("div", { "data-viewport-type": "element", ref: s, style: wt(r), children: e });
|
|
2527
|
+
}, rr = ({ children: e }) => {
|
|
2528
|
+
const t = B.useContext(Vo), o = me("windowViewportRect"), n = me("fixedItemHeight"), r = P("customScrollParent"), i = To(
|
|
2529
|
+
o,
|
|
2530
|
+
r,
|
|
2531
|
+
P("skipAnimationFrameInResizeObserver")
|
|
2532
|
+
), l = P("alignToBottom");
|
|
2533
|
+
return B.useEffect(() => {
|
|
2534
|
+
t && (n(t.itemHeight), o({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
|
|
2535
|
+
}, [t, o, n]), /* @__PURE__ */ N.jsx("div", { "data-viewport-type": "window", ref: i, style: wt(l), children: e });
|
|
2536
|
+
}, ir = ({ children: e }) => {
|
|
2537
|
+
const t = P("TopItemListComponent") || "div", o = P("headerHeight"), n = { ...Qn, marginTop: `${o}px` }, r = P("context");
|
|
2538
|
+
return /* @__PURE__ */ N.jsx(t, { style: n, ...ie(t, r), children: e });
|
|
2539
|
+
}, lr = /* @__PURE__ */ B.memo(function(e) {
|
|
2540
|
+
const t = P("useWindowScroll"), o = P("topItemsIndexes").length > 0, n = P("customScrollParent"), r = P("context");
|
|
2541
|
+
return /* @__PURE__ */ N.jsxs(n || t ? ar : cr, { ...e, context: r, children: [
|
|
2542
|
+
o && /* @__PURE__ */ N.jsx(ir, { children: /* @__PURE__ */ N.jsx(ao, { showTopList: !0 }) }),
|
|
2543
|
+
/* @__PURE__ */ N.jsxs(n || t ? rr : nr, { children: [
|
|
2544
|
+
/* @__PURE__ */ N.jsx(tr, {}),
|
|
2545
|
+
/* @__PURE__ */ N.jsx(ao, {}),
|
|
2546
|
+
/* @__PURE__ */ N.jsx(or, {})
|
|
2547
|
+
] })
|
|
2548
|
+
] });
|
|
2549
|
+
}), {
|
|
2550
|
+
Component: sr,
|
|
2551
|
+
useEmitter: _t,
|
|
2552
|
+
useEmitterValue: P,
|
|
2553
|
+
usePublisher: me
|
|
2554
|
+
} = /* @__PURE__ */ Do(
|
|
2555
|
+
Kn,
|
|
2556
|
+
{
|
|
2557
|
+
required: {},
|
|
2558
|
+
optional: {
|
|
2559
|
+
restoreStateFrom: "restoreStateFrom",
|
|
2560
|
+
context: "context",
|
|
2561
|
+
followOutput: "followOutput",
|
|
2562
|
+
scrollIntoViewOnChange: "scrollIntoViewOnChange",
|
|
2563
|
+
itemContent: "itemContent",
|
|
2564
|
+
groupContent: "groupContent",
|
|
2565
|
+
overscan: "overscan",
|
|
2566
|
+
increaseViewportBy: "increaseViewportBy",
|
|
2567
|
+
totalCount: "totalCount",
|
|
2568
|
+
groupCounts: "groupCounts",
|
|
2569
|
+
topItemCount: "topItemCount",
|
|
2570
|
+
firstItemIndex: "firstItemIndex",
|
|
2571
|
+
initialTopMostItemIndex: "initialTopMostItemIndex",
|
|
2572
|
+
components: "components",
|
|
2573
|
+
atBottomThreshold: "atBottomThreshold",
|
|
2574
|
+
atTopThreshold: "atTopThreshold",
|
|
2575
|
+
computeItemKey: "computeItemKey",
|
|
2576
|
+
defaultItemHeight: "defaultItemHeight",
|
|
2577
|
+
fixedItemHeight: "fixedItemHeight",
|
|
2578
|
+
itemSize: "itemSize",
|
|
2579
|
+
scrollSeekConfiguration: "scrollSeekConfiguration",
|
|
2580
|
+
headerFooterTag: "HeaderFooterTag",
|
|
2581
|
+
data: "data",
|
|
2582
|
+
initialItemCount: "initialItemCount",
|
|
2583
|
+
initialScrollTop: "initialScrollTop",
|
|
2584
|
+
alignToBottom: "alignToBottom",
|
|
2585
|
+
useWindowScroll: "useWindowScroll",
|
|
2586
|
+
customScrollParent: "customScrollParent",
|
|
2587
|
+
scrollerRef: "scrollerRef",
|
|
2588
|
+
logLevel: "logLevel",
|
|
2589
|
+
horizontalDirection: "horizontalDirection",
|
|
2590
|
+
skipAnimationFrameInResizeObserver: "skipAnimationFrameInResizeObserver"
|
|
2591
|
+
},
|
|
2592
|
+
methods: {
|
|
2593
|
+
scrollToIndex: "scrollToIndex",
|
|
2594
|
+
scrollIntoView: "scrollIntoView",
|
|
2595
|
+
scrollTo: "scrollTo",
|
|
2596
|
+
scrollBy: "scrollBy",
|
|
2597
|
+
autoscrollToBottom: "autoscrollToBottom",
|
|
2598
|
+
getState: "getState"
|
|
2599
|
+
},
|
|
2600
|
+
events: {
|
|
2601
|
+
isScrolling: "isScrolling",
|
|
2602
|
+
endReached: "endReached",
|
|
2603
|
+
startReached: "startReached",
|
|
2604
|
+
rangeChanged: "rangeChanged",
|
|
2605
|
+
atBottomStateChange: "atBottomStateChange",
|
|
2606
|
+
atTopStateChange: "atTopStateChange",
|
|
2607
|
+
totalListHeightChanged: "totalListHeightChanged",
|
|
2608
|
+
itemsRendered: "itemsRendered",
|
|
2609
|
+
groupIndices: "groupIndices"
|
|
2610
|
+
}
|
|
2611
|
+
},
|
|
2612
|
+
lr
|
|
2613
|
+
), cr = /* @__PURE__ */ Uo({ useEmitter: _t, useEmitterValue: P, usePublisher: me }), ar = /* @__PURE__ */ Ko({ useEmitter: _t, useEmitterValue: P, usePublisher: me }), br = sr;
|
|
2614
|
+
Nt();
|
|
2615
|
+
const uo = {
|
|
2616
|
+
bottom: 0,
|
|
2617
|
+
itemHeight: 0,
|
|
2618
|
+
items: [],
|
|
2619
|
+
itemWidth: 0,
|
|
2620
|
+
offsetBottom: 0,
|
|
2621
|
+
offsetTop: 0,
|
|
2622
|
+
top: 0
|
|
2623
|
+
}, ur = {
|
|
2624
|
+
bottom: 0,
|
|
2625
|
+
itemHeight: 0,
|
|
2626
|
+
items: [{ index: 0 }],
|
|
2627
|
+
itemWidth: 0,
|
|
2628
|
+
offsetBottom: 0,
|
|
2629
|
+
offsetTop: 0,
|
|
2630
|
+
top: 0
|
|
2631
|
+
}, { ceil: ho, floor: pt, max: Ye, min: bt, round: fo } = Math;
|
|
2632
|
+
function mo(e, t, o) {
|
|
2633
|
+
return Array.from({ length: t - e + 1 }).map((n, r) => ({ data: o === null ? null : o[r + e], index: r + e }));
|
|
2634
|
+
}
|
|
2635
|
+
function dr(e) {
|
|
2636
|
+
return {
|
|
2637
|
+
...ur,
|
|
2638
|
+
items: e
|
|
2639
|
+
};
|
|
2640
|
+
}
|
|
2641
|
+
function at(e, t) {
|
|
2642
|
+
return e && e.width === t.width && e.height === t.height;
|
|
2643
|
+
}
|
|
2644
|
+
function hr(e, t) {
|
|
2645
|
+
return e && e.column === t.column && e.row === t.row;
|
|
2646
|
+
}
|
|
2647
|
+
const fr = /* @__PURE__ */ U(
|
|
2648
|
+
([
|
|
2649
|
+
{ increaseViewportBy: e, listBoundary: t, overscan: o, visibleRange: n },
|
|
2650
|
+
{ footerHeight: r, headerHeight: i, scrollBy: l, scrollContainerState: s, scrollTo: c, scrollTop: a, smoothScrollTargetReached: m, viewportHeight: I },
|
|
2651
|
+
g,
|
|
2652
|
+
x,
|
|
2653
|
+
{ didMount: H, propsReady: z },
|
|
2654
|
+
{ customScrollParent: v, useWindowScroll: f, windowScrollContainerState: d, windowScrollTo: C, windowViewportRect: R },
|
|
2655
|
+
h
|
|
2656
|
+
]) => {
|
|
2657
|
+
const u = S(0), T = S(0), y = S(uo), L = S({ height: 0, width: 0 }), M = S({ height: 0, width: 0 }), A = F(), G = F(), $ = S(0), E = S(null), _ = S({ column: 0, row: 0 }), ne = F(), fe = F(), pe = S(!1), ve = S(0), ae = S(!0), le = S(!1), Me = S(!1);
|
|
2658
|
+
q(
|
|
2659
|
+
p(
|
|
2660
|
+
H,
|
|
2661
|
+
D(ve),
|
|
2662
|
+
W(([w, V]) => !!V)
|
|
2663
|
+
),
|
|
2664
|
+
() => {
|
|
2665
|
+
j(ae, !1);
|
|
2666
|
+
}
|
|
2667
|
+
), q(
|
|
2668
|
+
p(
|
|
2669
|
+
te(H, ae, M, L, ve, le),
|
|
2670
|
+
W(([w, V, Y, re, , Q]) => w && !V && Y.height !== 0 && re.height !== 0 && !Q)
|
|
2671
|
+
),
|
|
2672
|
+
([, , , , w]) => {
|
|
2673
|
+
j(le, !0), Dt(1, () => {
|
|
2674
|
+
j(A, w);
|
|
2675
|
+
}), Ie(p(a), () => {
|
|
2676
|
+
j(t, [0, 0]), j(ae, !0);
|
|
2677
|
+
});
|
|
2678
|
+
}
|
|
2679
|
+
), k(
|
|
2680
|
+
p(
|
|
2681
|
+
fe,
|
|
2682
|
+
W((w) => w != null && w.scrollTop > 0),
|
|
2683
|
+
Se(0)
|
|
2684
|
+
),
|
|
2685
|
+
T
|
|
2686
|
+
), q(
|
|
2687
|
+
p(
|
|
2688
|
+
H,
|
|
2689
|
+
D(fe),
|
|
2690
|
+
W(([, w]) => w != null)
|
|
2691
|
+
),
|
|
2692
|
+
([, w]) => {
|
|
2693
|
+
w && (j(L, w.viewport), j(M, w.item), j(_, w.gap), w.scrollTop > 0 && (j(pe, !0), Ie(p(a, Pe(1)), (V) => {
|
|
2694
|
+
j(pe, !1);
|
|
2695
|
+
}), j(c, { top: w.scrollTop })));
|
|
2696
|
+
}
|
|
2697
|
+
), k(
|
|
2698
|
+
p(
|
|
2699
|
+
L,
|
|
2700
|
+
b(({ height: w }) => w)
|
|
2701
|
+
),
|
|
2702
|
+
I
|
|
2703
|
+
), k(
|
|
2704
|
+
p(
|
|
2705
|
+
te(
|
|
2706
|
+
O(L, at),
|
|
2707
|
+
O(M, at),
|
|
2708
|
+
O(_, (w, V) => w && w.column === V.column && w.row === V.row),
|
|
2709
|
+
O(a)
|
|
2710
|
+
),
|
|
2711
|
+
b(([w, V, Y, re]) => ({
|
|
2712
|
+
gap: Y,
|
|
2713
|
+
item: V,
|
|
2714
|
+
scrollTop: re,
|
|
2715
|
+
viewport: w
|
|
2716
|
+
}))
|
|
2717
|
+
),
|
|
2718
|
+
ne
|
|
2719
|
+
), k(
|
|
2720
|
+
p(
|
|
2721
|
+
te(
|
|
2722
|
+
O(u),
|
|
2723
|
+
n,
|
|
2724
|
+
O(_, hr),
|
|
2725
|
+
O(M, at),
|
|
2726
|
+
O(L, at),
|
|
2727
|
+
O(E),
|
|
2728
|
+
O(T),
|
|
2729
|
+
O(pe),
|
|
2730
|
+
O(ae),
|
|
2731
|
+
O(ve)
|
|
2732
|
+
),
|
|
2733
|
+
W(([, , , , , , , w]) => !w),
|
|
2734
|
+
b(
|
|
2735
|
+
([
|
|
2736
|
+
w,
|
|
2737
|
+
[V, Y],
|
|
2738
|
+
re,
|
|
2739
|
+
Q,
|
|
2740
|
+
Oe,
|
|
2741
|
+
Ue,
|
|
2742
|
+
Fe,
|
|
2743
|
+
,
|
|
2744
|
+
it,
|
|
2745
|
+
be
|
|
2746
|
+
]) => {
|
|
2747
|
+
const { column: Re, row: Ke } = re, { height: lt, width: St } = Q, { width: qt } = Oe;
|
|
2748
|
+
if (Fe === 0 && (w === 0 || qt === 0))
|
|
2749
|
+
return uo;
|
|
2750
|
+
if (St === 0) {
|
|
2751
|
+
const Xt = Vt(be, w), Zo = Xt + Math.max(Fe - 1, 0);
|
|
2752
|
+
return dr(mo(Xt, Zo, Ue));
|
|
2753
|
+
}
|
|
2754
|
+
const st = $o(qt, St, Re);
|
|
2755
|
+
let Ge, We;
|
|
2756
|
+
it ? V === 0 && Y === 0 && Fe > 0 ? (Ge = 0, We = Fe - 1) : (Ge = st * pt((V + Ke) / (lt + Ke)), We = st * ho((Y + Ke) / (lt + Ke)) - 1, We = bt(w - 1, Ye(We, st - 1)), Ge = bt(We, Ye(0, Ge))) : (Ge = 0, We = -1);
|
|
2757
|
+
const Ut = mo(Ge, We, Ue), { bottom: Kt, top: $t } = go(Oe, re, Q, Ut), Yt = ho(w / st), Xo = Yt * lt + (Yt - 1) * Ke - Kt;
|
|
2758
|
+
return { bottom: Kt, itemHeight: lt, items: Ut, itemWidth: St, offsetBottom: Xo, offsetTop: $t, top: $t };
|
|
2759
|
+
}
|
|
2760
|
+
)
|
|
2761
|
+
),
|
|
2762
|
+
y
|
|
2763
|
+
), k(
|
|
2764
|
+
p(
|
|
2765
|
+
E,
|
|
2766
|
+
W((w) => w !== null),
|
|
2767
|
+
b((w) => w.length)
|
|
2768
|
+
),
|
|
2769
|
+
u
|
|
2770
|
+
), k(
|
|
2771
|
+
p(
|
|
2772
|
+
te(L, M, y, _),
|
|
2773
|
+
W(([w, V, { items: Y }]) => Y.length > 0 && V.height !== 0 && w.height !== 0),
|
|
2774
|
+
b(([w, V, { items: Y }, re]) => {
|
|
2775
|
+
const { bottom: Q, top: Oe } = go(w, re, V, Y);
|
|
2776
|
+
return [Oe, Q];
|
|
2777
|
+
}),
|
|
2778
|
+
Z(Je)
|
|
2779
|
+
),
|
|
2780
|
+
t
|
|
2781
|
+
);
|
|
2782
|
+
const xe = S(!1);
|
|
2783
|
+
k(
|
|
2784
|
+
p(
|
|
2785
|
+
a,
|
|
2786
|
+
D(xe),
|
|
2787
|
+
b(([w, V]) => V || w !== 0)
|
|
2788
|
+
),
|
|
2789
|
+
xe
|
|
2790
|
+
);
|
|
2791
|
+
const qe = he(
|
|
2792
|
+
p(
|
|
2793
|
+
te(y, u),
|
|
2794
|
+
W(([{ items: w }]) => w.length > 0),
|
|
2795
|
+
D(xe),
|
|
2796
|
+
W(([[w, V], Y]) => {
|
|
2797
|
+
const re = w.items[w.items.length - 1].index === V - 1;
|
|
2798
|
+
return (Y || w.bottom > 0 && w.itemHeight > 0 && w.offsetBottom === 0 && w.items.length === V) && re;
|
|
2799
|
+
}),
|
|
2800
|
+
b(([[, w]]) => w - 1),
|
|
2801
|
+
Z()
|
|
2802
|
+
)
|
|
2803
|
+
), Ve = he(
|
|
2804
|
+
p(
|
|
2805
|
+
O(y),
|
|
2806
|
+
W(({ items: w }) => w.length > 0 && w[0].index === 0),
|
|
2807
|
+
Se(0),
|
|
2808
|
+
Z()
|
|
2809
|
+
)
|
|
2810
|
+
), we = he(
|
|
2811
|
+
p(
|
|
2812
|
+
O(y),
|
|
2813
|
+
D(pe),
|
|
2814
|
+
W(([{ items: w }, V]) => w.length > 0 && !V),
|
|
2815
|
+
b(([{ items: w }]) => ({
|
|
2816
|
+
endIndex: w[w.length - 1].index,
|
|
2817
|
+
startIndex: w[0].index
|
|
2818
|
+
})),
|
|
2819
|
+
Z(yo),
|
|
2820
|
+
ye(0)
|
|
2821
|
+
)
|
|
2822
|
+
);
|
|
2823
|
+
k(we, x.scrollSeekRangeChanged), k(
|
|
2824
|
+
p(
|
|
2825
|
+
A,
|
|
2826
|
+
D(L, M, u, _),
|
|
2827
|
+
b(([w, V, Y, re, Q]) => {
|
|
2828
|
+
const Oe = ko(w), { align: Ue, behavior: Fe, offset: it } = Oe;
|
|
2829
|
+
let be = Oe.index;
|
|
2830
|
+
be === "LAST" && (be = re - 1), be = Ye(0, be, bt(re - 1, be));
|
|
2831
|
+
let Re = Mt(V, Q, Y, be);
|
|
2832
|
+
return Ue === "end" ? Re = fo(Re - V.height + Y.height) : Ue === "center" && (Re = fo(Re - V.height / 2 + Y.height / 2)), it && (Re += it), { behavior: Fe, top: Re };
|
|
2833
|
+
})
|
|
2834
|
+
),
|
|
2835
|
+
c
|
|
2836
|
+
);
|
|
2837
|
+
const ze = se(
|
|
2838
|
+
p(
|
|
2839
|
+
y,
|
|
2840
|
+
b((w) => w.offsetBottom + w.bottom)
|
|
2841
|
+
),
|
|
2842
|
+
0
|
|
2843
|
+
);
|
|
2844
|
+
return k(
|
|
2845
|
+
p(
|
|
2846
|
+
R,
|
|
2847
|
+
b((w) => ({ height: w.visibleHeight, width: w.visibleWidth }))
|
|
2848
|
+
),
|
|
2849
|
+
L
|
|
2850
|
+
), {
|
|
2851
|
+
customScrollParent: v,
|
|
2852
|
+
// input
|
|
2853
|
+
data: E,
|
|
2854
|
+
deviation: $,
|
|
2855
|
+
footerHeight: r,
|
|
2856
|
+
gap: _,
|
|
2857
|
+
headerHeight: i,
|
|
2858
|
+
increaseViewportBy: e,
|
|
2859
|
+
initialItemCount: T,
|
|
2860
|
+
itemDimensions: M,
|
|
2861
|
+
overscan: o,
|
|
2862
|
+
restoreStateFrom: fe,
|
|
2863
|
+
scrollBy: l,
|
|
2864
|
+
scrollContainerState: s,
|
|
2865
|
+
scrollHeight: G,
|
|
2866
|
+
scrollTo: c,
|
|
2867
|
+
scrollToIndex: A,
|
|
2868
|
+
scrollTop: a,
|
|
2869
|
+
smoothScrollTargetReached: m,
|
|
2870
|
+
totalCount: u,
|
|
2871
|
+
useWindowScroll: f,
|
|
2872
|
+
viewportDimensions: L,
|
|
2873
|
+
windowScrollContainerState: d,
|
|
2874
|
+
windowScrollTo: C,
|
|
2875
|
+
windowViewportRect: R,
|
|
2876
|
+
...x,
|
|
2877
|
+
// output
|
|
2878
|
+
gridState: y,
|
|
2879
|
+
horizontalDirection: Me,
|
|
2880
|
+
initialTopMostItemIndex: ve,
|
|
2881
|
+
totalListHeight: ze,
|
|
2882
|
+
...g,
|
|
2883
|
+
endReached: qe,
|
|
2884
|
+
propsReady: z,
|
|
2885
|
+
rangeChanged: we,
|
|
2886
|
+
startReached: Ve,
|
|
2887
|
+
stateChanged: ne,
|
|
2888
|
+
stateRestoreInProgress: pe,
|
|
2889
|
+
...h
|
|
2890
|
+
};
|
|
2891
|
+
},
|
|
2892
|
+
J(Ft, ce, rt, Po, Le, Gt, ke)
|
|
2893
|
+
);
|
|
2894
|
+
function $o(e, t, o) {
|
|
2895
|
+
return Ye(1, pt((e + o) / (pt(t) + o)));
|
|
2896
|
+
}
|
|
2897
|
+
function go(e, t, o, n) {
|
|
2898
|
+
const { height: r } = o;
|
|
2899
|
+
if (r === void 0 || n.length === 0)
|
|
2900
|
+
return { bottom: 0, top: 0 };
|
|
2901
|
+
const i = Mt(e, t, o, n[0].index);
|
|
2902
|
+
return { bottom: Mt(e, t, o, n[n.length - 1].index) + r, top: i };
|
|
2903
|
+
}
|
|
2904
|
+
function Mt(e, t, o, n) {
|
|
2905
|
+
const r = $o(e.width, o.width, t.column), i = pt(n / r), l = i * o.height + Ye(0, i - 1) * t.row;
|
|
2906
|
+
return l > 0 ? l + t.row : l;
|
|
2907
|
+
}
|
|
2908
|
+
const mr = /* @__PURE__ */ U(() => {
|
|
2909
|
+
const e = S((I) => `Item ${I}`), t = S({}), o = S(null), n = S("virtuoso-grid-item"), r = S("virtuoso-grid-list"), i = S(_o), l = S("div"), s = S(tt), c = (I, g = null) => se(
|
|
2910
|
+
p(
|
|
2911
|
+
t,
|
|
2912
|
+
b((x) => x[I]),
|
|
2913
|
+
Z()
|
|
2914
|
+
),
|
|
2915
|
+
g
|
|
2916
|
+
), a = S(!1), m = S(!1);
|
|
2917
|
+
return k(O(m), a), {
|
|
2918
|
+
components: t,
|
|
2919
|
+
computeItemKey: i,
|
|
2920
|
+
context: o,
|
|
2921
|
+
FooterComponent: c("Footer"),
|
|
2922
|
+
HeaderComponent: c("Header"),
|
|
2923
|
+
headerFooterTag: l,
|
|
2924
|
+
itemClassName: n,
|
|
2925
|
+
ItemComponent: c("Item", "div"),
|
|
2926
|
+
itemContent: e,
|
|
2927
|
+
listClassName: r,
|
|
2928
|
+
ListComponent: c("List", "div"),
|
|
2929
|
+
readyStateChanged: a,
|
|
2930
|
+
reportReadyState: m,
|
|
2931
|
+
ScrollerComponent: c("Scroller", "div"),
|
|
2932
|
+
scrollerRef: s,
|
|
2933
|
+
ScrollSeekPlaceholder: c("ScrollSeekPlaceholder", "div")
|
|
2934
|
+
};
|
|
2935
|
+
}), gr = /* @__PURE__ */ U(
|
|
2936
|
+
([e, t]) => ({ ...e, ...t }),
|
|
2937
|
+
J(fr, mr)
|
|
2938
|
+
), pr = /* @__PURE__ */ B.memo(function() {
|
|
2939
|
+
const e = X("gridState"), t = X("listClassName"), o = X("itemClassName"), n = X("itemContent"), r = X("computeItemKey"), i = X("isSeeking"), l = ge("scrollHeight"), s = X("ItemComponent"), c = X("ListComponent"), a = X("ScrollSeekPlaceholder"), m = X("context"), I = ge("itemDimensions"), g = ge("gap"), x = X("log"), H = X("stateRestoreInProgress"), z = ge("reportReadyState"), v = je(
|
|
2940
|
+
B.useMemo(
|
|
2941
|
+
() => (f) => {
|
|
2942
|
+
const d = f.parentElement.parentElement.scrollHeight;
|
|
2943
|
+
l(d);
|
|
2944
|
+
const C = f.firstChild;
|
|
2945
|
+
if (C) {
|
|
2946
|
+
const { height: R, width: h } = C.getBoundingClientRect();
|
|
2947
|
+
I({ height: R, width: h });
|
|
2948
|
+
}
|
|
2949
|
+
g({
|
|
2950
|
+
column: po("column-gap", getComputedStyle(f).columnGap, x),
|
|
2951
|
+
row: po("row-gap", getComputedStyle(f).rowGap, x)
|
|
2952
|
+
});
|
|
2953
|
+
},
|
|
2954
|
+
[l, I, g, x]
|
|
2955
|
+
),
|
|
2956
|
+
!0,
|
|
2957
|
+
!1
|
|
2958
|
+
);
|
|
2959
|
+
return Go(() => {
|
|
2960
|
+
e.itemHeight > 0 && e.itemWidth > 0 && z(!0);
|
|
2961
|
+
}, [e]), H ? null : /* @__PURE__ */ N.jsx(
|
|
2962
|
+
c,
|
|
2963
|
+
{
|
|
2964
|
+
className: t,
|
|
2965
|
+
ref: v,
|
|
2966
|
+
...ie(c, m),
|
|
2967
|
+
"data-testid": "virtuoso-item-list",
|
|
2968
|
+
style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
|
|
2969
|
+
children: e.items.map((f) => {
|
|
2970
|
+
const d = r(f.index, f.data, m);
|
|
2971
|
+
return i ? /* @__PURE__ */ N.jsx(
|
|
2972
|
+
a,
|
|
2973
|
+
{
|
|
2974
|
+
...ie(a, m),
|
|
2975
|
+
height: e.itemHeight,
|
|
2976
|
+
index: f.index,
|
|
2977
|
+
width: e.itemWidth
|
|
2978
|
+
},
|
|
2979
|
+
d
|
|
2980
|
+
) : /* @__PURE__ */ ut(
|
|
2981
|
+
s,
|
|
2982
|
+
{
|
|
2983
|
+
...ie(s, m),
|
|
2984
|
+
className: o,
|
|
2985
|
+
"data-index": f.index,
|
|
2986
|
+
key: d
|
|
2987
|
+
},
|
|
2988
|
+
n(f.index, f.data, m)
|
|
2989
|
+
);
|
|
2990
|
+
})
|
|
2991
|
+
}
|
|
2992
|
+
);
|
|
2993
|
+
}), vr = B.memo(function() {
|
|
2994
|
+
const e = X("HeaderComponent"), t = ge("headerHeight"), o = X("headerFooterTag"), n = je(
|
|
2995
|
+
B.useMemo(
|
|
2996
|
+
() => (i) => {
|
|
2997
|
+
t(Be(i, "height"));
|
|
2998
|
+
},
|
|
2999
|
+
[t]
|
|
3000
|
+
),
|
|
3001
|
+
!0,
|
|
3002
|
+
!1
|
|
3003
|
+
), r = X("context");
|
|
3004
|
+
return e ? /* @__PURE__ */ N.jsx(o, { ref: n, children: /* @__PURE__ */ N.jsx(e, { ...ie(e, r) }) }) : null;
|
|
3005
|
+
}), xr = B.memo(function() {
|
|
3006
|
+
const e = X("FooterComponent"), t = ge("footerHeight"), o = X("headerFooterTag"), n = je(
|
|
3007
|
+
B.useMemo(
|
|
3008
|
+
() => (i) => {
|
|
3009
|
+
t(Be(i, "height"));
|
|
3010
|
+
},
|
|
3011
|
+
[t]
|
|
3012
|
+
),
|
|
3013
|
+
!0,
|
|
3014
|
+
!1
|
|
3015
|
+
), r = X("context");
|
|
3016
|
+
return e ? /* @__PURE__ */ N.jsx(o, { ref: n, children: /* @__PURE__ */ N.jsx(e, { ...ie(e, r) }) }) : null;
|
|
3017
|
+
}), Ir = ({ children: e }) => {
|
|
3018
|
+
const t = B.useContext(Fo), o = ge("itemDimensions"), n = ge("viewportDimensions"), r = je(
|
|
3019
|
+
B.useMemo(
|
|
3020
|
+
() => (i) => {
|
|
3021
|
+
n(i.getBoundingClientRect());
|
|
3022
|
+
},
|
|
3023
|
+
[n]
|
|
3024
|
+
),
|
|
3025
|
+
!0,
|
|
3026
|
+
!1
|
|
3027
|
+
);
|
|
3028
|
+
return B.useEffect(() => {
|
|
3029
|
+
t && (n({ height: t.viewportHeight, width: t.viewportWidth }), o({ height: t.itemHeight, width: t.itemWidth }));
|
|
3030
|
+
}, [t, n, o]), /* @__PURE__ */ N.jsx("div", { ref: r, style: wt(!1), children: e });
|
|
3031
|
+
}, Tr = ({ children: e }) => {
|
|
3032
|
+
const t = B.useContext(Fo), o = ge("windowViewportRect"), n = ge("itemDimensions"), r = X("customScrollParent"), i = To(o, r, !1);
|
|
3033
|
+
return B.useEffect(() => {
|
|
3034
|
+
t && (n({ height: t.itemHeight, width: t.itemWidth }), o({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
|
|
3035
|
+
}, [t, o, n]), /* @__PURE__ */ N.jsx("div", { ref: i, style: wt(!1), children: e });
|
|
3036
|
+
}, wr = /* @__PURE__ */ B.memo(function({ ...e }) {
|
|
3037
|
+
const t = X("useWindowScroll"), o = X("customScrollParent"), n = o || t ? Cr : Sr, r = o || t ? Tr : Ir, i = X("context");
|
|
3038
|
+
return /* @__PURE__ */ N.jsx(n, { ...e, ...ie(n, i), children: /* @__PURE__ */ N.jsxs(r, { children: [
|
|
3039
|
+
/* @__PURE__ */ N.jsx(vr, {}),
|
|
3040
|
+
/* @__PURE__ */ N.jsx(pr, {}),
|
|
3041
|
+
/* @__PURE__ */ N.jsx(xr, {})
|
|
3042
|
+
] }) });
|
|
3043
|
+
}), {
|
|
3044
|
+
Component: Rr,
|
|
3045
|
+
useEmitter: Yo,
|
|
3046
|
+
useEmitterValue: X,
|
|
3047
|
+
usePublisher: ge
|
|
3048
|
+
} = /* @__PURE__ */ Do(
|
|
3049
|
+
gr,
|
|
3050
|
+
{
|
|
3051
|
+
optional: {
|
|
3052
|
+
context: "context",
|
|
3053
|
+
totalCount: "totalCount",
|
|
3054
|
+
overscan: "overscan",
|
|
3055
|
+
itemContent: "itemContent",
|
|
3056
|
+
components: "components",
|
|
3057
|
+
computeItemKey: "computeItemKey",
|
|
3058
|
+
data: "data",
|
|
3059
|
+
initialItemCount: "initialItemCount",
|
|
3060
|
+
scrollSeekConfiguration: "scrollSeekConfiguration",
|
|
3061
|
+
headerFooterTag: "headerFooterTag",
|
|
3062
|
+
listClassName: "listClassName",
|
|
3063
|
+
itemClassName: "itemClassName",
|
|
3064
|
+
useWindowScroll: "useWindowScroll",
|
|
3065
|
+
customScrollParent: "customScrollParent",
|
|
3066
|
+
scrollerRef: "scrollerRef",
|
|
3067
|
+
logLevel: "logLevel",
|
|
3068
|
+
restoreStateFrom: "restoreStateFrom",
|
|
3069
|
+
initialTopMostItemIndex: "initialTopMostItemIndex",
|
|
3070
|
+
increaseViewportBy: "increaseViewportBy"
|
|
3071
|
+
},
|
|
3072
|
+
methods: {
|
|
3073
|
+
scrollTo: "scrollTo",
|
|
3074
|
+
scrollBy: "scrollBy",
|
|
3075
|
+
scrollToIndex: "scrollToIndex"
|
|
3076
|
+
},
|
|
3077
|
+
events: {
|
|
3078
|
+
isScrolling: "isScrolling",
|
|
3079
|
+
endReached: "endReached",
|
|
3080
|
+
startReached: "startReached",
|
|
3081
|
+
rangeChanged: "rangeChanged",
|
|
3082
|
+
atBottomStateChange: "atBottomStateChange",
|
|
3083
|
+
atTopStateChange: "atTopStateChange",
|
|
3084
|
+
stateChanged: "stateChanged",
|
|
3085
|
+
readyStateChanged: "readyStateChanged"
|
|
3086
|
+
}
|
|
3087
|
+
},
|
|
3088
|
+
wr
|
|
3089
|
+
), Sr = /* @__PURE__ */ Uo({ useEmitter: Yo, useEmitterValue: X, usePublisher: ge }), Cr = /* @__PURE__ */ Ko({ useEmitter: Yo, useEmitterValue: X, usePublisher: ge });
|
|
3090
|
+
function po(e, t, o) {
|
|
3091
|
+
return t !== "normal" && !(t != null && t.endsWith("px")) && o(`${e} was not resolved to pixel value correctly`, t, ue.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
3092
|
+
}
|
|
3093
|
+
export {
|
|
3094
|
+
br as q
|
|
3095
|
+
};
|