New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@virtuoso.dev/message-list

Package Overview
Dependencies
Maintainers
2
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@virtuoso.dev/message-list - npm Package Compare versions

Comparing version 1.0.0 to 1.2.0

CHANGELOG.md

21

dist/index.d.ts
/// <reference types="react" />
import { default as default_2 } from 'react';
import { JSX as JSX_2 } from 'react/jsx-runtime';
import { default as React_2 } from 'react';

@@ -83,2 +83,10 @@ /**

/**
* The previous data item (if available).
*/
prevData: Data | null;
/**
* The next data item (if available).
*/
nextData: Data | null;
/**
* The value of the `context` prop passed to the list.

@@ -183,2 +191,7 @@ */

/**
* Lets you access the currently rendered data items.
*/
export declare function useCurrentlyRenderedData<Data>(): Data[];
/**
* Lets you access the current scroll location of the message list component from its child components. See {@link ListScrollLocation} for the available properties.

@@ -200,4 +213,4 @@ */

export declare const VirtuosoMessageList: <Data, Context>(props: VirtuosoMessageListProps<Data, Context> & {
ref?: NoInfer<React_2.Ref<VirtuosoMessageListMethods<Data, Context>>>;
}) => React_2.ReactElement;
ref?: NoInfer<default_2.Ref<VirtuosoMessageListMethods<Data, Context>>>;
}) => default_2.ReactElement;

@@ -215,3 +228,3 @@ /**

licenseKey: string;
children: React_2.ReactNode;
children: default_2.ReactNode;
}): JSX_2.Element;

@@ -218,0 +231,0 @@ /* Excluded from this release type: displayName */

960

dist/index.js

@@ -1,5 +0,5 @@

import { jsxs as $t, jsx as b, Fragment as bn } from "react/jsx-runtime";
import { jsxs as Tt, jsx as b, Fragment as bn } from "react/jsx-runtime";
import k from "react";
import { Cell as l, Signal as x, withLatestFrom as I, map as p, mapTo as C, delayWithMicrotask as he, filter as m, throttleTime as ee, onNext as Ze, once as bt, debounceTime as Ve, scan as _, useRealm as at, useCellValue as F, Realm as kn, RealmContext as yn, useCellValues as In } from "@mdxeditor/gurx";
function le(e, t) {
import { Cell as l, Signal as x, withLatestFrom as S, map as a, mapTo as A, delayWithMicrotask as he, filter as m, throttleTime as te, onNext as Ze, once as bt, debounceTime as We, scan as _, useRealm as at, useCellValue as O, Realm as kn, RealmContext as yn, useCellValues as In } from "@mdxeditor/gurx";
function ne(e, t) {
const n = l(e, (o) => {

@@ -10,15 +10,15 @@ o.link(t(o), n);

}
const de = { lvl: 0 };
function Et(e, t, n, o = de, s = de) {
const ge = { lvl: 0 };
function Et(e, t, n, o = ge, s = ge) {
return { k: e, l: o, lvl: n, r: s, v: t };
}
function v(e) {
return e === de;
return e === ge;
}
function me() {
return de;
return ge;
}
function Je(e, t) {
if (v(e))
return de;
return ge;
const { k: n, l: o, r: s } = e;

@@ -32,8 +32,8 @@ if (t === n) {

const [i, r] = Mt(o);
return Le(y(e, { k: i, l: Lt(o), v: r }));
return we(I(e, { k: i, l: Lt(o), v: r }));
}
} else
return t < n ? Le(y(e, { l: Je(o, t) })) : Le(y(e, { r: Je(s, t) }));
return t < n ? we(I(e, { l: Je(o, t) })) : we(I(e, { r: Je(s, t) }));
}
function se(e, t, n = "k") {
function ie(e, t, n = "k") {
if (v(e))

@@ -44,9 +44,9 @@ return [-1 / 0, void 0];

if (e[n] < t) {
const o = se(e.r, t, n);
const o = ie(e.r, t, n);
return o[0] === -1 / 0 ? [e.k, e.v] : o;
}
return se(e.l, t, n);
return ie(e.l, t, n);
}
function j(e, t, n) {
return v(e) ? Et(t, n, 1) : t === e.k ? y(e, { k: t, v: n }) : t < e.k ? kt(y(e, { l: j(e.l, t, n) })) : kt(y(e, { r: j(e.r, t, n) }));
return v(e) ? Et(t, n, 1) : t === e.k ? I(e, { k: t, v: n }) : t < e.k ? kt(I(e, { l: j(e.l, t, n) })) : kt(I(e, { r: j(e.r, t, n) }));
}

@@ -57,7 +57,7 @@ function Xe(e, t, n) {

const { k: o, v: s, l: i, r } = e;
let c = [];
return o > t && (c = c.concat(Xe(i, t, n))), o >= t && o <= n && c.push({ k: o, v: s }), o <= n && (c = c.concat(Xe(r, t, n))), c;
let u = [];
return o > t && (u = u.concat(Xe(i, t, n))), o >= t && o <= n && u.push({ k: o, v: s }), o <= n && (u = u.concat(Xe(r, t, n))), u;
}
function ge(e) {
return v(e) ? [] : [...ge(e.l), { k: e.k, v: e.v }, ...ge(e.r)];
function de(e) {
return v(e) ? [] : [...de(e.l), { k: e.k, v: e.v }, ...de(e.r)];
}

@@ -68,5 +68,5 @@ function Mt(e) {

function Lt(e) {
return v(e.r) ? e.l : Le(y(e, { r: Lt(e.r) }));
return v(e.r) ? e.l : we(I(e, { r: Lt(e.r) }));
}
function y(e, t) {
function I(e, t) {
return Et(t.k ?? e.k, t.v ?? e.v, t.lvl ?? e.lvl, t.l ?? e.l, t.r ?? e.r);

@@ -80,3 +80,3 @@ }

}
function Le(e) {
function we(e) {
const { l: t, r: n, lvl: o } = e;

@@ -87,8 +87,8 @@ if (n.lvl >= o - 1 && t.lvl >= o - 1)

if (je(t))
return Rt(y(e, { lvl: o - 1 }));
return Rt(I(e, { lvl: o - 1 }));
if (!v(t) && !v(t.r))
return y(t.r, {
l: y(t, { r: t.r.l }),
return I(t.r, {
l: I(t, { r: t.r.l }),
lvl: o,
r: y(e, {
r: I(e, {
l: t.r.r,

@@ -101,7 +101,7 @@ lvl: o - 1

if (je(e))
return Qe(y(e, { lvl: o - 1 }));
return Qe(I(e, { lvl: o - 1 }));
if (!v(n) && !v(n.l)) {
const s = n.l, i = je(s) ? n.lvl - 1 : n.lvl;
return y(s, {
l: y(e, {
return I(s, {
l: I(e, {
lvl: o - 1,

@@ -111,3 +111,3 @@ r: s.l

lvl: s.lvl + 1,
r: Qe(y(n, { l: s.r, lvl: i }))
r: Qe(I(n, { l: s.r, lvl: i }))
});

@@ -121,6 +121,6 @@ } else

return [];
const o = se(e, t)[0];
const o = ie(e, t)[0];
return Sn(Xe(e, o, n));
}
function At(e, t) {
function Dt(e, t) {
const n = e.length;

@@ -132,4 +132,4 @@ if (n === 0)

for (let r = 1; r < n; r++) {
const { index: c, value: u } = t(e[r]);
i.push({ end: c - 1, start: o, value: s }), o = c, s = u;
const { index: u, value: c } = t(e[r]);
i.push({ end: u - 1, start: o, value: s }), o = u, s = c;
}

@@ -139,11 +139,11 @@ return i.push({ end: 1 / 0, start: o, value: s }), i;

function Sn(e) {
return At(e, ({ k: t, v: n }) => ({ index: t, value: n }));
return Dt(e, ({ k: t, v: n }) => ({ index: t, value: n }));
}
function Qe(e) {
const { r: t, lvl: n } = e;
return !v(t) && !v(t.r) && t.lvl === n && t.r.lvl === n ? y(t, { l: y(e, { r: t.l }), lvl: n + 1 }) : e;
return !v(t) && !v(t.r) && t.lvl === n && t.r.lvl === n ? I(t, { l: I(e, { r: t.l }), lvl: n + 1 }) : e;
}
function Rt(e) {
const { l: t } = e;
return !v(t) && t.lvl === e.lvl ? y(t, { r: y(e, { l: t.r }) }) : e;
return !v(t) && t.lvl === e.lvl ? I(t, { r: I(e, { l: t.r }) }) : e;
}

@@ -154,3 +154,3 @@ function xn(e) {

}
function Tn(e, t) {
function $n(e, t) {
let n = v(e) ? 0 : 1 / 0;

@@ -163,8 +163,8 @@ for (const o of t) {

}
const c = wt(e, i - 1, r + 1);
if (c.some(xn(o)))
const u = wt(e, i - 1, r + 1);
if (u.some(xn(o)))
continue;
let u = !1, f = !1;
for (const { start: h, end: a, value: d } of c)
u ? (r >= h || s === d) && (e = Je(e, h)) : (f = d !== s, u = !0), a > r && r >= h && d !== s && (e = j(e, r + 1, d));
let c = !1, f = !1;
for (const { start: h, end: p, value: g } of u)
c ? (r >= h || s === g) && (e = Je(e, h)) : (f = g !== s, c = !0), p > r && r >= h && g !== s && (e = j(e, r + 1, g));
f && (e = j(e, i, s));

@@ -175,3 +175,3 @@ }

const pt = [me(), 0];
function $n(e, [t, n]) {
function Tn(e, [t, n]) {
if (n.length > 0 && v(e) && t.length === 2) {

@@ -184,3 +184,3 @@ const o = t[0].size, s = t[1].size;

} else
return Tn(e, t);
return $n(e, t);
}

@@ -190,6 +190,6 @@ function Ce(e, t, n, o = 0) {

for (; o <= s; ) {
const i = Math.floor((o + s) / 2), r = e[i], c = n(r, t);
if (c === 0)
const i = Math.floor((o + s) / 2), r = e[i], u = n(r, t);
if (u === 0)
return i;
if (c === -1) {
if (u === -1) {
if (s - o < 2)

@@ -206,3 +206,3 @@ return i - 1;

}
function Ct(e, t, n) {
function At(e, t, n) {
return e[Ce(e, t, n)];

@@ -224,16 +224,16 @@ }

function wn(e, t, n, o = 0) {
return o > 0 && (t = Math.max(t, Ct(e, o, ft).offset)), t = Math.max(0, t), At(En(e, t, n, Mn), Ln);
return o > 0 && (t = Math.max(t, At(e, o, ft).offset)), t = Math.max(0, t), Dt(En(e, t, n, Mn), Ln);
}
const ie = [[], 0, 0, 0];
function An(e, [t, n]) {
const re = [[], 0, 0, 0];
function Dn(e, [t, n]) {
let o = 0, s = 0, i = 0, r = 0;
if (n !== 0) {
r = Ce(e, n - 1, ft), i = e[r].offset;
const u = se(t, n - 1);
o = u[0], s = u[1], e.length && e[r].height === se(t, n)[1] && (r -= 1), e = e.slice(0, r + 1);
const c = ie(t, n - 1);
o = c[0], s = c[1], e.length && e[r].height === ie(t, n)[1] && (r -= 1), e = e.slice(0, r + 1);
} else
e = [];
for (const { start: c, value: u } of wt(t, n, 1 / 0)) {
const f = (c - o) * s + i;
e.push({ height: u, index: c, offset: f }), o = c, i = f, s = u;
for (const { start: u, value: c } of wt(t, n, 1 / 0)) {
const f = (u - o) * s + i;
e.push({ height: c, index: u, offset: f }), o = u, i = f, s = c;
}

@@ -245,9 +245,9 @@ return [e, s, i, o];

return [0, 0];
const { offset: n, index: o, height: s } = Ct(t, e, ft);
const { offset: n, index: o, height: s } = At(t, e, ft);
return [s * (e - o) + n, s];
}
function Cn(e, t) {
function An(e, t) {
return Rn(e, t)[0];
}
function Dt(e, t) {
function Ct(e, t) {
if (typeof e == "number")

@@ -276,23 +276,23 @@ return {

headerHeight: r,
stickyHeaderHeight: c,
stickyFooterHeight: u
stickyHeaderHeight: u,
stickyFooterHeight: c
}) {
const { align: f, behavior: h, offset: a, index: d } = Dt(e, s - 1);
const { align: f, behavior: h, offset: p, index: g } = Ct(e, s - 1);
function w() {
const D = se(t, d)[1];
if (D === void 0)
throw new Error(`Item at index ${d} not found`);
return D;
const C = ie(t, g)[1];
if (C === void 0)
throw new Error(`Item at index ${g} not found`);
return C;
}
i -= c + u;
let T = Cn(d, n) + r - c;
f === "end" ? T = T - i + w() : f === "center" && (T = T - i / 2 + w() / 2), a && (T += a);
let O = 0;
return f === "start" && (O = Math.max(0, Math.min(T - (o - i)))), { top: T, behavior: h, align: f, forceBottomSpace: O };
i -= u + c;
let $ = An(g, n) + r - u;
f === "end" ? $ = $ - i + w() : f === "center" && ($ = $ - i / 2 + w() / 2), p && ($ += p);
let V = 0;
return f === "start" && (V = Math.max(0, Math.min($ - (o - i)))), { top: $, behavior: h, align: f, forceBottomSpace: V };
}
const qe = l(null), Dn = l(!1), Ue = l(!0), K = x((e) => {
const qe = l(null), Cn = l(!1), Ue = l(!0), K = x((e) => {
e.link(K, qe), e.link(
e.pipe(
K,
I(
S(
P,

@@ -302,8 +302,8 @@ ht,

U,
gt,
Se,
dt,
xe,
Te,
ue
),
p(
a(
([

@@ -316,4 +316,4 @@ t,

r,
u,
c,
u,
f

@@ -328,18 +328,18 @@ ]) => Ht({

headerHeight: r,
stickyHeaderHeight: c,
stickyFooterHeight: u
stickyHeaderHeight: u,
stickyFooterHeight: c
})
)
),
re
), e.link(e.pipe(K, C(!1)), Ue), e.link(e.pipe(K, C(!1)), Dn), e.link(
le
), e.link(e.pipe(K, A(!1)), Ue), e.link(e.pipe(K, A(!1)), Cn), e.link(
e.pipe(
P,
he(),
I(Ue, qe),
S(Ue, qe),
m(([, t, n]) => !t && n !== null),
p(([, , t]) => t)
a(([, , t]) => t)
),
K
), e.sub(e.pipe(Oe, ee(20)), () => {
), e.sub(e.pipe(Ve, te(20)), () => {
e.pubIn({

@@ -351,7 +351,7 @@ [qe]: null,

e.pipe(
Re,
Ae,
// wait for the list to render with the specified scrollOffset, so that enough space is available to scroll by
he(),
m((t) => t !== 0),
p((t) => ({ top: t }))
a((t) => ({ top: t }))
),

@@ -361,19 +361,19 @@ q

e.pipe(
Re,
Ze(S),
p(() => 0)
Ae,
Ze(y),
a(() => 0)
),
Re
Ae
);
}), De = l(null), He = l(null, (e) => {
}), He = l(null), Be = l(null, (e) => {
e.link(
e.pipe(
He,
Be,
m((n) => n !== null),
bt()
),
De
He
);
const t = e.pipe(
e.combine(He, P),
e.combine(Be, P),
m(([n, o]) => n !== null && !v(o)),

@@ -383,3 +383,3 @@ bt(),

he(),
p(([[n]]) => n)
a(([[n]]) => n)
);

@@ -391,11 +391,11 @@ e.link(e.pipe(t, he()), K), e.link(

e.pipe(
ye,
Ie,
m((n) => !n)
)
),
C(null),
A(null),
// unset the location after the scroll completes
Ve(10)
We(10)
),
De
He
);

@@ -407,18 +407,28 @@ });

const s = [];
ge(e).forEach(({ k: r, v: c }) => {
var h, a;
de(e).forEach(({ k: r, v: u }) => {
var h, p;
for (; n.length && n[0] < r; )
n.shift(), o++;
const u = Math.max(0, r - o), f = ((h = s.at(-1)) == null ? void 0 : h.k) ?? -1;
u === f ? (((a = s.at(-2)) == null ? void 0 : a.v) ?? -1) === c ? s.pop() : s[s.length - 1].v = c : s.push({ k: u, v: c });
const c = Math.max(0, r - o), f = ((h = s.at(-1)) == null ? void 0 : h.k) ?? -1;
c === f ? (((p = s.at(-2)) == null ? void 0 : p.v) ?? -1) === u ? s.pop() : s[s.length - 1].v = u : s.push({ k: c, v: u });
});
let i = me();
return s.forEach(({ k: r, v: c }) => {
i = j(i, r, c);
return s.forEach(({ k: r, v: u }) => {
i = j(i, r, u);
}), i;
}
function Bn(e, t) {
return [{ data: t == null ? void 0 : t[e], height: 0, index: e, offset: 0, type: "flat" }];
return [
{
data: t == null ? void 0 : t[e],
prevData: (t == null ? void 0 : t[e - 1]) ?? null,
nextData: (t == null ? void 0 : t[e + 1]) ?? null,
height: 0,
index: e,
offset: 0,
type: "flat"
}
];
}
const On = [], Me = {
const On = [], Le = {
items: On,

@@ -432,7 +442,7 @@ listBottom: 0,

data: null
}, We = l(Me, (e) => {
}, be = l(Le, (e) => {
e.link(
e.pipe(
e.combine(
Yn,
Kn,
vt,

@@ -444,11 +454,11 @@ P,

Y,
Re,
Ae,
Be,
He,
De,
$e,
xe,
Se,
Te,
R,
X,
A
Q,
D
),

@@ -466,23 +476,23 @@ m((t) => {

r,
u,
c,
u,
f,
h,
a,
d,
p,
g,
w,
T,
O
$,
V
]) => {
var Ee;
if ((u == null ? void 0 : u.length) === 0)
return Me;
var Me;
if ((c == null ? void 0 : c.length) === 0)
return Le;
if (v(s)) {
let g = 0;
return h !== null && (g = Dt(h, r - 1).index), { ...Me, items: Bn(g, u), offsetTree: i, totalCount: r, data: u };
let d = 0;
return h !== null && (d = Ct(h, r - 1).index), { ...Le, items: Bn(d, c), offsetTree: i, totalCount: r, data: c };
}
let D = 0;
a !== null && n === 0 && (D = Ht({
totalHeight: c,
location: a,
let C = 0;
p !== null && n === 0 && (C = Ht({
totalHeight: u,
location: p,
sizeTree: s,

@@ -492,41 +502,51 @@ offsetTree: i,

viewportHeight: e.getValue(U),
headerHeight: e.getValue(gt),
headerHeight: e.getValue(dt),
stickyHeaderHeight: w,
stickyFooterHeight: T
stickyFooterHeight: $
}).top ?? 0);
const N = Math.max(
n + D + f - O - d,
n + C + f - V - g,
0
), H = N + o;
if (t.offsetTree === i && t.totalCount === r && t.data === u && N >= t.listTop && H <= t.listBottom)
if (t.offsetTree === i && t.totalCount === r && t.data === c && N >= t.listTop && H <= t.listBottom)
return t;
const B = [], V = r - 1, te = 0, Pe = wn(i, N, H, te);
let W = 0, $e = 0, z = !1;
for (const g of Pe) {
const B = [], W = r - 1, oe = 0, Pe = wn(i, N, H, oe);
let F = 0, Ee = 0, z = !1;
for (const d of Pe) {
const {
value: { offset: ae, height: G }
} = g;
let Z = g.start;
W = ae, ae < N && (Z += Math.floor((N - ae) / G), W += (Z - g.start) * G), Z < te && (W += (te - Z) * G, Z = te);
const Ye = Math.min(g.end, V);
for (let ne = Z; ne <= Ye && !(W >= H); ne++) {
} = d;
let Z = d.start;
F = ae, ae < N && (Z += Math.floor((N - ae) / G), F += (Z - d.start) * G), Z < oe && (F += (oe - Z) * G, Z = oe);
const Ye = Math.min(d.end, W);
for (let J = Z; J <= Ye && !(F >= H); J++) {
const Ke = {
data: u == null ? void 0 : u[ne],
data: c == null ? void 0 : c[J],
prevData: (c == null ? void 0 : c[J - 1]) ?? null,
nextData: (c == null ? void 0 : c[J + 1]) ?? null,
height: G,
index: ne,
offset: W,
index: J,
offset: F,
type: "flat"
};
z || (z = !0, $e = W), B.push(Ke), W += G;
z || (z = !0, Ee = F), B.push(Ke), F += G;
}
}
const Ne = c - W, ze = ((Ee = B[0]) == null ? void 0 : Ee.offset) || 0;
return { items: B, listBottom: W, listTop: $e, offsetTree: i, paddingBottom: Ne, paddingTop: ze, totalCount: r, data: u };
const Ne = u - F, ze = ((Me = B[0]) == null ? void 0 : Me.offset) || 0;
return { items: B, listBottom: F, listTop: Ee, offsetTree: i, paddingBottom: Ne, paddingTop: ze, totalCount: r, data: c };
},
Me
Le
)
),
We
be
);
});
}), Vn = ne([], (e) => e.pipe(
e.combine(be, y),
a(([t, n]) => {
const o = t.items.slice();
for (; o.length > 0 && o[0].offset + o[0].height < n; )
o.shift();
return o.map((s) => s.data);
})
));
function Bt(e, t) {

@@ -538,3 +558,3 @@ return Math.abs(e - t) < 1.01;

}
const Vt = "up", Ge = "down", Vn = "none", Wn = {
const Vt = "up", Ge = "down", Wn = "none", Fn = {
atBottom: !1,

@@ -549,3 +569,3 @@ notAtBottomBecause: "NOT_SHOWING_LAST_ITEM",

}
}, Fn = 0;
}, _n = 0;
function yt(e) {

@@ -562,9 +582,9 @@ return (t, n) => {

x();
const _n = x((e) => {
e.link(e.pipe(Wt, ee(50)), _n);
}), Pn = l(4), Nn = l(Fn, (e) => {
const Pn = x((e) => {
e.link(e.pipe(Wt, te(50)), Pn);
}), Nn = l(4), zn = l(_n, (e) => {
e.link(
e.pipe(
e.combine(S, Nn),
p(([t, n]) => t <= n)
e.combine(y, zn),
a(([t, n]) => t <= n)
),

@@ -574,6 +594,6 @@ Wt

}), ve = l(!1, (e) => {
e.link(e.pipe(S, yt(1), C(!0)), ve), e.link(e.pipe(S, yt(1), C(!1), Ve(100)), ve);
e.link(e.pipe(y, yt(1), A(!0)), ve), e.link(e.pipe(y, yt(1), A(!1), We(100)), ve);
}), et = l(!1, (e) => {
e.link(e.pipe(q, C(!0)), et), e.link(e.pipe(q, C(!1), Ve(200)), et);
}), Ft = l(!1), we = l(
e.link(e.pipe(q, A(!0)), et), e.link(e.pipe(q, A(!1), We(200)), et);
}), Ft = l(!1), De = l(
null,

@@ -583,6 +603,6 @@ (e) => {

e.pipe(
e.combine(Ie, S, U, qt, Pn, Fe, P),
e.combine(Se, y, U, qt, Nn, Fe, P),
m(([, , , , , , t]) => !v(t)),
_((t, [n, o, s, i, r]) => {
const u = o + s - n > -r, f = {
const c = o + s - n > -r, f = {
viewportWidth: i,

@@ -593,9 +613,9 @@ viewportHeight: s,

};
if (u) {
let a, d;
return o > t.state.scrollTop ? (a = "SCROLLED_DOWN", d = t.state.scrollTop - o) : (a = n === s ? "LIST_TOO_SHORT" : "SIZE_DECREASED", d = t.state.scrollTop - o || t.scrollTopDelta), {
if (c) {
let p, g;
return o > t.state.scrollTop ? (p = "SCROLLED_DOWN", g = t.state.scrollTop - o) : (p = n === s ? "LIST_TOO_SHORT" : "SIZE_DECREASED", g = t.state.scrollTop - o || t.scrollTopDelta), {
atBottom: !0,
state: f,
atBottomBecause: a,
scrollTopDelta: d
atBottomBecause: p,
scrollTopDelta: g
};

@@ -609,9 +629,9 @@ }

};
}, Wn)
}, Fn)
),
we
De
), e.link(
e.pipe(
we,
ee(10),
De,
te(10),
// withLatestFrom(scrollToInProgress$),

@@ -629,3 +649,3 @@ // filter(([, inProgress]) => !inProgress),

),
p(({ shouldScroll: t }) => t)
a(({ shouldScroll: t }) => t)
),

@@ -636,3 +656,3 @@ Ft

U,
I(we),
S(De),
_(

@@ -655,3 +675,3 @@ (t, [n, o]) => {

e.pipe(
e.combine(S, Ie, U),
e.combine(y, Se, U),
_(

@@ -684,3 +704,3 @@ (t, [n, o, s]) => {

m((t) => t.changed),
p((t) => t.jump)
a((t) => t.jump)
),

@@ -692,3 +712,3 @@ _t

e.pipe(
S,
y,
_(

@@ -698,6 +718,6 @@ (t, n) => e.getValue(et) ? { direction: t.direction, prevScrollTop: n } : { direction: n < t.prevScrollTop ? Vt : Ge, prevScrollTop: n },

),
p((t) => t.direction)
a((t) => t.direction)
),
tt
), e.link(e.pipe(S, ee(50), C(Vn)), tt);
), e.link(e.pipe(y, te(50), A(Wn)), tt);
}), It = l(0, (e) => {

@@ -708,3 +728,3 @@ e.link(

m((t) => !t),
C(0)
A(0)
),

@@ -714,22 +734,22 @@ It

e.pipe(
S,
ee(100),
I(ve),
y,
te(100),
S(ve),
m(([, t]) => !!t),
_(([, t], [n]) => [t, n], [0, 0]),
p(([t, n]) => n - t)
a(([t, n]) => n - t)
),
It
);
}), A = l(!1), Ae = x((e) => {
}), D = l(!1), Re = x((e) => {
e.link(
e.pipe(
We,
I(_t, X),
be,
S(_t, Q),
m(([, , t]) => !t),
_(
([, t, n, o], [{ items: s, totalCount: i, listBottom: r, paddingBottom: c }, u]) => {
const f = r + c;
([, t, n, o], [{ items: s, totalCount: i, listBottom: r, paddingBottom: u }, c]) => {
const f = r + u;
let h = 0;
return n === i && t.length > 0 && s.length > 0 && (h = f - o, h !== 0 && (h += u)), [h, s, i, f];
return n === i && t.length > 0 && s.length > 0 && (h = f - o, h !== 0 && (h += c)), [h, s, i, f];
},

@@ -739,35 +759,35 @@ [0, [], 0, 0]

m(([t]) => t !== 0),
I(S, tt, ye),
S(y, tt, Ie),
m(([, t, n, o]) => !o && t !== 0 && n === Vt),
p(([[t]]) => t)
a(([[t]]) => t)
),
Ae
), Ot() ? (e.sub(e.pipe(Ae, I(R, S)), ([t, n]) => {
Re
), Ot() ? (e.sub(e.pipe(Re, S(R, y)), ([t, n]) => {
e.pub(R, n - t);
}), e.sub(e.pipe(e.combine(S, R, X)), ([t, n, o]) => {
o || (n > 0 && t < n ? (e.pub(A, !0), e.pub(re, { top: 0, behavior: "instant" }), setTimeout(() => {
}), e.sub(e.pipe(e.combine(y, R, Q)), ([t, n, o]) => {
o || (n > 0 && t < n ? (e.pub(D, !0), e.pub(le, { top: 0, behavior: "instant" }), setTimeout(() => {
e.pubIn({
[A]: !1,
[D]: !1,
[R]: 0
});
})) : n < 0 && t <= 0 && (e.pubIn({
[A]: !0,
[D]: !0,
[R]: 0
}), setTimeout(() => {
e.pub(re, { top: 0, behavior: "instant" }), e.pub(A, !1);
e.pub(le, { top: 0, behavior: "instant" }), e.pub(D, !1);
})));
}), e.sub(
e.pipe(
e.combine(ve, R, A, X),
e.combine(ve, R, D, Q),
m(([t, n, o, s]) => !t && n !== 0 && !o && !s),
ee(100)
te(100)
),
([, t]) => {
e.pub(A, !0), t < 0 ? requestAnimationFrame(() => {
e.pub(D, !0), t < 0 ? requestAnimationFrame(() => {
e.pub(q, { top: -t, behavior: "instant" }), requestAnimationFrame(() => {
e.pub(R, 0), e.pub(A, !1);
e.pub(R, 0), e.pub(D, !1);
});
}) : requestAnimationFrame(() => {
e.pub(q, { top: -t, behavior: "instant" }), requestAnimationFrame(() => {
e.pub(R, 0), e.pub(A, !1);
e.pub(R, 0), e.pub(D, !1);
});

@@ -778,8 +798,8 @@ });

e.pipe(
Ae,
p((t) => ({ top: t, behavior: "auto" }))
Re,
a((t) => ({ top: t, behavior: "auto" }))
),
q
);
}), ce = l(0), Be = l(null), Y = l(null, (e) => {
}), ce = l(0), Oe = l(null), Y = l(null, (e) => {
e.link(

@@ -789,21 +809,21 @@ e.pipe(

m((t) => t !== null),
p((t) => t.length)
a((t) => t.length)
),
ce
);
}), zn = 4, Q = x((e) => {
e.link(e.pipe(Q, C(!0)), X);
}), Yn = 4, ee = x((e) => {
e.link(e.pipe(ee, A(!0)), Q);
const t = Ot();
e.link(
e.pipe(
Q,
I(oe),
p(([n, o]) => o * n.length)
ee,
S(se),
a(([n, o]) => o * n.length)
),
R
), e.link(e.pipe(Q, C(t)), A), e.sub(
), e.link(e.pipe(ee, A(t)), D), e.sub(
e.pipe(
Q,
I(oe),
p(([n, o]) => ({
ee,
S(se),
a(([n, o]) => ({
top: o * n.length,

@@ -818,17 +838,17 @@ behavior: "instant"

}), t ? setTimeout(() => {
e.pub(R, 0), e.pub(X, !1), e.pub(A, !1);
e.pub(R, 0), e.pub(Q, !1), e.pub(D, !1);
}, 100) : requestAnimationFrame(() => {
e.pub(R, 0), e.pub(X, !1);
e.pub(R, 0), e.pub(Q, !1);
});
}
), e.changeWith(Y, Q, (n, o) => n ? [...o, ...n] : o.slice()), e.link(
), e.changeWith(Y, ee, (n, o) => n ? [...o, ...n] : o.slice()), e.link(
e.pipe(
Q,
I(P, oe),
p(([n, o, s]) => {
ee,
S(P, se),
a(([n, o, s]) => {
const i = n.length, r = s;
return ge(o).reduce(
(c, { k: u, v: f }) => ({
ranges: [...c.ranges, { startIndex: c.prevIndex, endIndex: u + i - 1, size: c.prevSize }],
prevIndex: u + i,
return de(o).reduce(
(u, { k: c, v: f }) => ({
ranges: [...u.ranges, { startIndex: u.prevIndex, endIndex: c + i - 1, size: u.prevSize }],
prevIndex: c + i,
prevSize: f

@@ -844,3 +864,3 @@ }),

),
be
ke
);

@@ -851,20 +871,20 @@ }), Pt = x((e) => {

Pt,
I(mt, st, Be, P),
S(mt, st, Oe, P),
m(([, , , , t]) => !v(t)),
p(([{ data: t, scrollToBottom: n }, o, s, i]) => {
a(([{ data: t, scrollToBottom: n }, o, s, i]) => {
if (n === !1 || n === void 0)
return null;
let r = "auto";
const c = o.bottomOffset < zn;
const u = o.bottomOffset < Yn;
if (typeof n == "function") {
const u = n({ data: t, scrollLocation: o, scrollInProgress: s, context: i, atBottom: c });
if (!u)
const c = n({ data: t, scrollLocation: o, scrollInProgress: s, context: i, atBottom: u });
if (!c)
return null;
if (typeof u == "object")
return u;
if (typeof u == "number")
return { index: u, align: "end", behavior: "auto" };
r = u;
if (typeof c == "object")
return c;
if (typeof c == "number")
return { index: c, align: "end", behavior: "auto" };
r = c;
} else {
if (!c && !(n === "smooth" && s))
if (!u && !(n === "smooth" && s))
return null;

@@ -876,3 +896,3 @@ r = n;

m((t) => t !== null),
Ve(1)
We(1)
),

@@ -884,3 +904,3 @@ K

}), St = x((e) => {
e.changeWith(Y, St, (t, n) => t ? t.slice(n) : []), e.changeWith(ke, St, ([t], n) => [ge(t).reduce((s, { k: i, v: r }) => j(s, Math.max(0, i - n), r), me()), 0]);
e.changeWith(Y, St, (t, n) => t ? t.slice(n) : []), e.changeWith(ye, St, ([t], n) => [de(t).reduce((s, { k: i, v: r }) => j(s, Math.max(0, i - n), r), me()), 0]);
}), xt = x((e) => {

@@ -890,4 +910,4 @@ e.changeWith(Y, xt, (t, n) => t ? t.slice(0, t.length - n) : []), e.link(

xt,
I(ce, oe),
p(([, t, n]) => [
S(ce, se),
a(([, t, n]) => [
{

@@ -900,3 +920,3 @@ size: n,

),
be
ke
);

@@ -906,4 +926,4 @@ }), Nt = x((e) => {

Nt,
I(Y),
p(([n, o]) => {
S(Y),
a(([n, o]) => {
if (!o)

@@ -917,3 +937,3 @@ return [];

);
e.changeWith(Y, t, (n, o) => n ? n.filter((s, i) => !o.includes(i)) : []), e.changeWith(ke, t, ([n], o) => [Hn(n, o), 0]);
e.changeWith(Y, t, (n, o) => n ? n.filter((s, i) => !o.includes(i)) : []), e.changeWith(ye, t, ([n], o) => [Hn(n, o), 0]);
}), ot = x((e) => {

@@ -923,10 +943,10 @@ e.changeWith(Y, ot, (t, { mapper: n }) => t ? t.map(n) : []), e.link(

ot,
ee(40),
I(Ft),
te(40),
S(Ft),
m(([{ autoscrollToBottomBehavior: t }, n]) => n && !!t),
p(([{ autoscrollToBottomBehavior: t }]) => ({ index: "LAST", align: "end", behavior: t }))
a(([{ autoscrollToBottomBehavior: t }]) => ({ index: "LAST", align: "end", behavior: t }))
),
K
);
}), be = x();
}), ke = x();
l([]);

@@ -938,11 +958,11 @@ l([]);

l(NaN);
const X = l(!1), ke = l(pt, (e) => {
const Q = l(!1), ye = l(pt, (e) => {
e.link(
e.pipe(
be,
ke,
m((t) => t.length > 0),
I(P),
p(([t, n]) => $n(n, [t, []]))
S(P),
a(([t, n]) => Tn(n, [t, []]))
),
ke
ye
);

@@ -952,4 +972,4 @@ }), P = l(pt[0], (e) => {

e.pipe(
ke,
p(([t]) => t)
ye,
a(([t]) => t)
),

@@ -959,4 +979,4 @@ P

e.pipe(
be,
I(P),
ke,
S(P),
_(

@@ -969,3 +989,3 @@ ({ sizeTree: t }, [, n]) => ({

),
p((t) => t.changed)
a((t) => t.changed)
),

@@ -977,13 +997,13 @@ zt

e.pipe(
ke,
p(([, t]) => t)
ye,
a(([, t]) => t)
),
Yt
);
}), oe = l(ie[1]), ht = l(ie[0]), fe = l(ie, (e) => {
}), se = l(re[1]), ht = l(re[0]), fe = l(re, (e) => {
e.link(
e.pipe(
P,
I(Yt),
_(([t], [n, o]) => An(t, [n, o]), ie)
S(Yt),
_(([t], [n, o]) => Dn(t, [n, o]), re)
),

@@ -994,25 +1014,25 @@ fe

fe,
p(([, t]) => t)
a(([, t]) => t)
),
oe
se
), e.link(
e.pipe(
fe,
p(([t]) => t)
a(([t]) => t)
),
ht
);
}), Kt = l(ie[2], (e) => {
}), Kt = l(re[2], (e) => {
e.link(
e.pipe(
fe,
p(([, , t]) => t)
a(([, , t]) => t)
),
Kt
);
}), jt = l(ie[3], (e) => {
}), jt = l(re[3], (e) => {
e.link(
e.pipe(
fe,
p(([, , , t]) => t)
a(([, , , t]) => t)
),

@@ -1024,27 +1044,27 @@ jt

e.pipe(
e.combine(ce, jt, Kt, oe),
p(([t, n, o, s]) => o + (t - n) * s)
e.combine(ce, jt, Kt, se),
a(([t, n, o, s]) => o + (t - n) * s)
),
ue
);
}), ye = x(), st = l(!1), Oe = x((e) => {
e.link(e.pipe(Oe, C(!1)), ye);
}), S = l(0), U = l(0), qt = l(0), Ie = l(0), Yn = S, Re = l(0), Se = l(0), xe = l(0), Te = l(0), dt = l(0), it = l(null), gt = le(0, (e) => e.pipe(
e.combine(Se, xe),
p(([t, n]) => t + n)
)), Kn = le(0, (e) => e.pipe(
e.combine(Te, dt),
p(([t, n]) => t + n)
)), jn = le(0, (e) => e.pipe(
e.combine(Se, xe, S),
p(([t, n, o]) => t + Math.max(n - o, 0))
)), qn = le(0, (e) => e.pipe(
e.combine(Te, dt, S, U, Ie),
p(([t, n, o, s, i]) => {
}), Ie = x(), st = l(!1), Ve = x((e) => {
e.link(e.pipe(Ve, A(!1)), Ie);
}), y = l(0), U = l(0), qt = l(0), Se = l(0), Kn = y, Ae = l(0), xe = l(0), $e = l(0), Te = l(0), gt = l(0), it = l(null), dt = ne(0, (e) => e.pipe(
e.combine(xe, $e),
a(([t, n]) => t + n)
)), jn = ne(0, (e) => e.pipe(
e.combine(Te, gt),
a(([t, n]) => t + n)
)), qn = ne(0, (e) => e.pipe(
e.combine(xe, $e, y),
a(([t, n, o]) => t + Math.max(n - o, 0))
)), Un = ne(0, (e) => e.pipe(
e.combine(Te, gt, y, U, Se),
a(([t, n, o, s, i]) => {
const r = Math.max(n - (i - (o + s)), 0);
return t + r;
})
)), vt = le(0, (e) => e.pipe(
e.combine(U, jn, qn),
p(([t, n, o]) => t - n - o)
)), vt = ne(0, (e) => e.pipe(
e.combine(U, qn, Un),
a(([t, n, o]) => t - n - o)
)), Fe = l(0), Ut = l(0, (e) => {

@@ -1054,11 +1074,11 @@ e.link(

e.combine(Ut, ue, U),
p(([t, n, o]) => Math.max(0, Math.min(t - (n - o))))
a(([t, n, o]) => Math.max(0, Math.min(t - (n - o))))
),
Fe
);
}), re = x((e) => {
}), le = x((e) => {
e.link(
e.pipe(
re,
p((t) => t.align === "start" ? t.top ?? 0 : 0)
le,
a((t) => t.align === "start" ? t.top ?? 0 : 0)
),

@@ -1068,10 +1088,10 @@ Ut

e.pipe(
re,
I(S),
le,
S(y),
m(([t, n]) => t.top !== n),
C(!0)
A(!0)
),
ye
Ie
);
}), mt = le(
}), mt = ne(
{

@@ -1085,18 +1105,18 @@ listOffset: 0,

e.combine(
S,
gt,
Kn,
xe,
y,
dt,
jn,
$e,
vt,
Ie,
Se,
Fe,
X,
De,
A
Q,
He,
D
),
m(([, , , , , , , t, n, o]) => !t && n === null && !o),
p(([t, n, o, s, i, r, c]) => {
const u = r - n - o, f = -t + s, h = c === 0 ? u + Math.min(0, f) - i : -c;
a(([t, n, o, s, i, r, u]) => {
const c = r - n - o, f = -t + s, h = u === 0 ? c + Math.min(0, f) - i : -u;
return {
scrollHeight: u,
scrollHeight: c,
listOffset: f,

@@ -1111,6 +1131,6 @@ visibleListHeight: i,

e.pipe(
S,
I(mt),
y,
S(mt),
m(([, t]) => t.scrollHeight > 0),
p(([, t]) => t)
a(([, t]) => t)
),

@@ -1120,12 +1140,12 @@ rt

}), q = x(), R = l(0), lt = l(0), Gt = l("");
function Un(e) {
function Gn(e) {
const t = k.useRef(null), n = k.useRef(null), o = at(), s = k.useCallback(
(a) => {
const d = t.current;
if (d) {
(p) => {
const g = t.current;
if (g) {
if (n.current !== null) {
const w = d.scrollHeight - d.clientHeight;
Bt(d.scrollTop, Math.min(w, n.current)) && (n.current = null, o.pub(st, !1), o.pub(Oe, d.scrollTop));
const w = g.scrollHeight - g.clientHeight;
Bt(g.scrollTop, Math.min(w, n.current)) && (n.current = null, o.pub(st, !1), o.pub(Ve, g.scrollTop));
}
e(d, a);
e(g, p);
}

@@ -1141,35 +1161,35 @@ },

});
}, [s]), r = k.useRef(null), c = k.useCallback(
(a) => {
a ? (r.current = a, i == null || i.observe(a, { box: "border-box" })) : r.current && (i == null || i.unobserve(r.current), r.current = null);
}, [s]), r = k.useRef(null), u = k.useCallback(
(p) => {
p ? (r.current = p, i == null || i.observe(p, { box: "border-box" })) : r.current && (i == null || i.unobserve(r.current), r.current = null);
},
[i]
), u = k.useCallback(
(a) => {
a ? (o.pub(it, a), t.current = a, a.addEventListener("scroll", () => {
), c = k.useCallback(
(p) => {
p ? (o.pub(it, p), t.current = p, p.addEventListener("scroll", () => {
s("scroll");
}), i == null || i.observe(a, { box: "border-box" })) : t.current && (o.pub(it, null), i == null || i.unobserve(t.current), t.current = null);
}), i == null || i.observe(p, { box: "border-box" })) : t.current && (o.pub(it, null), i == null || i.unobserve(t.current), t.current = null);
},
[i, s, o]
), f = k.useCallback(
(a) => {
var d, w, T, O;
if (a.top === ((d = t.current) == null ? void 0 : d.scrollTop)) {
o.pub(Oe, (w = t.current) == null ? void 0 : w.scrollTop);
(p) => {
var g, w, $, V;
if (p.top === ((g = t.current) == null ? void 0 : g.scrollTop)) {
o.pub(Ve, (w = t.current) == null ? void 0 : w.scrollTop);
return;
}
if (a.top !== void 0 && (n.current = a.top, o.pub(st, !0)), a.forceBottomSpace !== void 0) {
const D = (T = t.current) == null ? void 0 : T.querySelector('[data-role="virtuoso-list"]');
D && (D.style.paddingBottom = a.forceBottomSpace + "px");
if (p.top !== void 0 && (n.current = p.top, o.pub(st, !0)), p.forceBottomSpace !== void 0) {
const C = ($ = t.current) == null ? void 0 : $.querySelector('[data-role="virtuoso-list"]');
C && (C.style.paddingBottom = `${p.forceBottomSpace}px`);
}
(O = t.current) == null || O.scrollTo(a);
(V = t.current) == null || V.scrollTo(p);
},
[o]
), h = k.useCallback((a) => {
var d;
(d = t.current) == null || d.scrollBy(a);
), h = k.useCallback((p) => {
var g;
(g = t.current) == null || g.scrollBy(p);
}, []);
return { elRef: t, callbackRef: u, listCallbackRef: c, scrollTo: f, scrollBy: h };
return { elRef: t, callbackRef: c, listCallbackRef: u, scrollTo: f, scrollBy: h };
}
function Gn(e) {
function Zn(e) {
const t = e.length, n = [];

@@ -1180,21 +1200,21 @@ for (let o = 0; o < t; o++) {

continue;
const i = parseInt(s.dataset.index), r = parseFloat(s.dataset.knownSize ?? ""), c = s.getBoundingClientRect().height;
if (c === r)
const i = parseInt(s.dataset.index), r = parseFloat(s.dataset.knownSize ?? ""), u = s.getBoundingClientRect().height;
if (u === r)
continue;
const u = n[n.length - 1];
n.length === 0 || u.size !== c || u.endIndex !== i - 1 ? n.push({ endIndex: i, size: c, startIndex: i }) : n[n.length - 1].endIndex++;
const c = n[n.length - 1];
n.length === 0 || c.size !== u || c.endIndex !== i - 1 ? n.push({ endIndex: i, size: u, startIndex: i }) : n[n.length - 1].endIndex++;
}
return n;
}
const Zt = ({ index: e }) => /* @__PURE__ */ $t("div", { children: [
const Zt = ({ index: e }) => /* @__PURE__ */ Tt("div", { children: [
"Item ",
e
] }), Jt = ({ index: e }) => e, ct = l(Zt), Xt = l(Jt), Qt = l(null), en = l(null), tn = l(null), nn = l(null), on = l(null), Zn = {
] }), Jt = ({ index: e }) => e, ct = l(Zt), Xt = l(Jt), Qt = l(null), en = l(null), tn = l(null), nn = l(null), on = l(null), Jn = {
position: "sticky",
top: 0,
zIndex: 1
}, Jn = {
}, Xn = {
position: "sticky",
bottom: 0
}, sn = (e) => /* @__PURE__ */ b("div", { style: { zIndex: 1 }, ...e }), rn = (e) => /* @__PURE__ */ b("div", { ...e }), ln = (e) => /* @__PURE__ */ b("div", { ...e, style: Zn }), cn = (e) => /* @__PURE__ */ b("div", { ...e, style: Jn }), un = l(sn), an = l(ln), pn = l(rn), fn = l(cn), ut = l("top", (e) => {
}, sn = (e) => /* @__PURE__ */ b("div", { style: { zIndex: 1 }, ...e }), rn = (e) => /* @__PURE__ */ b("div", { ...e }), ln = (e) => /* @__PURE__ */ b("div", { ...e, style: Jn }), cn = (e) => /* @__PURE__ */ b("div", { ...e, style: Xn }), un = l(sn), an = l(ln), pn = l(rn), fn = l(cn), ut = l("top", (e) => {
e.link(

@@ -1204,3 +1224,3 @@ e.pipe(

m(([, , t]) => t === "bottom" || t === "bottom-smooth"),
p(([t, n]) => Math.max(0, n - t))
a(([t, n]) => Math.max(0, n - t))
),

@@ -1216,3 +1236,3 @@ lt

),
p(([t, n]) => t > 0 && n > 0 ? "margin-top 0.1s ease-out" : "")
a(([t, n]) => t > 0 && n > 0 ? "margin-top 0.1s ease-out" : "")
),

@@ -1222,6 +1242,6 @@ Gt

});
function Xn(e) {
return Qn(to(no(eo(e), 8 * e.length))).toLowerCase();
function Qn(e) {
return eo(no(oo(to(e), 8 * e.length))).toLowerCase();
}
function Qn(e) {
function eo(e) {
for (var t, n = "0123456789ABCDEF", o = "", s = 0; s < e.length; s++)

@@ -1231,3 +1251,3 @@ t = e.charCodeAt(s), o += n.charAt(t >>> 4 & 15) + n.charAt(15 & t);

}
function eo(e) {
function to(e) {
for (var t = Array(e.length >> 2), n = 0; n < t.length; n++)

@@ -1239,3 +1259,3 @@ t[n] = 0;

}
function to(e) {
function no(e) {
for (var t = "", n = 0; n < 32 * e.length; n += 8)

@@ -1245,6 +1265,6 @@ t += String.fromCharCode(e[n >> 5] >>> n % 32 & 255);

}
function no(e, t) {
function oo(e, t) {
e[t >> 5] |= 128 << t % 32, e[14 + (t + 64 >>> 9 << 4)] = t;
for (var n = 1732584193, o = -271733879, s = -1732584194, i = 271733878, r = 0; r < e.length; r += 16) {
const c = n, u = o, f = s, h = i;
const u = n, c = o, f = s, h = i;
o = L(

@@ -1262,10 +1282,10 @@ o = L(

o = E(
o = $(
o = $(
o = $(
o = $(
o = T(
o = T(
o = T(
o = T(
o,
s = $(
s = T(
s,
i = $(i, n = $(n, o, s, i, e[r + 0], 7, -680876936), o, s, e[r + 1], 12, -389564586),
i = T(i, n = T(n, o, s, i, e[r + 0], 7, -680876936), o, s, e[r + 1], 12, -389564586),
n,

@@ -1283,5 +1303,5 @@ o,

),
s = $(
s = T(
s,
i = $(i, n = $(n, o, s, i, e[r + 4], 7, -176418897), o, s, e[r + 5], 12, 1200080426),
i = T(i, n = T(n, o, s, i, e[r + 4], 7, -176418897), o, s, e[r + 5], 12, 1200080426),
n,

@@ -1299,5 +1319,5 @@ o,

),
s = $(
s = T(
s,
i = $(i, n = $(n, o, s, i, e[r + 8], 7, 1770035416), o, s, e[r + 9], 12, -1958414417),
i = T(i, n = T(n, o, s, i, e[r + 8], 7, 1770035416), o, s, e[r + 9], 12, -1958414417),
n,

@@ -1315,5 +1335,5 @@ o,

),
s = $(
s = T(
s,
i = $(i, n = $(n, o, s, i, e[r + 12], 7, 1804603682), o, s, e[r + 13], 12, -40341101),
i = T(i, n = T(n, o, s, i, e[r + 12], 7, 1804603682), o, s, e[r + 13], 12, -40341101),
n,

@@ -1510,3 +1530,3 @@ o,

-343485551
), n = J(n, c), o = J(o, u), s = J(s, f), i = J(i, h);
), n = X(n, u), o = X(o, c), s = X(s, f), i = X(i, h);
}

@@ -1516,5 +1536,5 @@ return [n, o, s, i];

function _e(e, t, n, o, s, i) {
return J(oo(J(J(t, e), J(o, i)), s), n);
return X(so(X(X(t, e), X(o, i)), s), n);
}
function $(e, t, n, o, s, i, r) {
function T(e, t, n, o, s, i, r) {
return _e(t & n | ~t & o, e, t, s, i, r);

@@ -1531,72 +1551,72 @@ }

}
function J(e, t) {
function X(e, t) {
const n = (65535 & e) + (65535 & t);
return (e >> 16) + (t >> 16) + (n >> 16) << 16 | 65535 & n;
}
function oo(e, t) {
function so(e, t) {
return e << t | e >>> 32 - t;
}
const hn = Symbol("INVALID_KEY");
function so(e) {
function io(e) {
const t = e.slice(0, 32), n = e.slice(32), o = atob(n);
if (t !== Xn(n))
if (t !== Qn(n))
return hn;
const [s, i] = o.split(";"), r = s.slice(2), c = new Date(Number(i.slice(2)));
return { orderNumber: r, expiryDate: c };
const [s, i] = o.split(";"), r = s.slice(2), u = new Date(Number(i.slice(2)));
return { orderNumber: r, expiryDate: u };
}
const io = {
const ro = {
valid: !1,
consoleMessage: "The VirtuosoMessageList license wrapper component is missing. Enclose the VirtuosoMessageList with VirtuosoMessageListLicense and add your key at the lisenceKey property.",
watermarkMessage: "The VirtuosoMessageList license wrapper component is missing. Enclose the VirtuosoMessageList with VirtuosoMessageListLicense and add your key at the lisenceKey property."
}, ro = {
}, lo = {
valid: !1,
consoleMessage: "Your VirtuosoMessageListLicense is missing a license key. Purchase one from https://virtuoso.dev/pricing/",
watermarkMessage: "Your VirtuosoMessageListLicense is missing a license key. Purchase one from https://virtuoso.dev/pricing/"
}, lo = {
}, co = {
valid: !1,
consoleMessage: "Your VirtuosoMessageListLicense component is missing a license key - this component will not work if deployed in production. Purchase a key from https://virtuoso.dev/pricing/ before you deploy to production."
}, dn = {
}, gn = {
valid: !0
}, co = {
}, uo = {
valid: !1,
consoleMessage: "Your Virtuoso Message List license key is invalid. Ensure that you have copy-pasted the key from the purchase email correctly.",
watermarkMessage: "Your Virtuoso Message List license key is invalid"
}, uo = {
}, ao = {
valid: !1,
consoleMessage: "Your annual license key to use Virtuoso Message List in non-production environments has expired. You can still use it in production. To keep using it in development, purchase a new key from https://virtuoso.dev/pricing/",
watermarkMessage: "Your annual license key to use Virtuoso Message List in non-production environments has expired. You can still use it in production. To keep using it in development, purchase a new key from https://virtuoso.dev/pricing/"
}, ao = {
}, po = {
valid: !1,
consoleMessage: "You have installed a version of `@virtuoso.dev/message-list` that is newer than the period of your license key. Either downgrade to a supported version, or purchase a new license from https://virtuoso.dev/pricing/",
watermarkMessage: "You have installed a version of `@virtuoso.dev/message-list` that is newer than the period of your license key. Either downgrade to a supported version, or purchase a new license from https://virtuoso.dev/pricing/"
}, po = dn, fo = /^(?:127\.0\.0\.1|localhost|0\.0\.0\.0)$/, ho = ["virtuoso.dev", "csb.app", "codesandbox.io"];
function go({ licenseKey: e, now: t, hostname: n, packageTimestamp: o }) {
const s = n.match(fo), i = ho.some((r) => n.endsWith(r));
}, fo = gn, ho = /^(?:127\.0\.0\.1|localhost|0\.0\.0\.0)$/, go = ["virtuoso.dev", "csb.app", "codesandbox.io"];
function vo({ licenseKey: e, now: t, hostname: n, packageTimestamp: o }) {
const s = n.match(ho), i = go.some((r) => n.endsWith(r));
if (e) {
const r = so(e);
const r = io(e);
if (r === hn)
return co;
return uo;
if (r.expiryDate.getTime() < t.getTime()) {
if (s)
return uo;
return ao;
if (r.expiryDate.getTime() < o)
return ao;
return po;
}
} else
return i ? po : s ? lo : ro;
return dn;
return i ? fo : s ? co : lo;
return gn;
}
const gn = k.createContext(io), vo = ({
const dn = k.createContext(ro), mo = ({
licenseKey: e,
children: t
}) => {
const n = go({
const n = vo({
licenseKey: e,
hostname: typeof window < "u" ? window.location.hostname : "localhost",
now: /* @__PURE__ */ new Date(),
packageTimestamp: 1712147920652
packageTimestamp: 1712469380082
});
return /* @__PURE__ */ b(gn.Provider, { value: n, children: t });
return /* @__PURE__ */ b(dn.Provider, { value: n, children: t });
};
vo.displayName = Math.random().toString(36).slice(2, 8);
mo.displayName = Math.random().toString(36).slice(2, 8);
function vn(e) {

@@ -1606,3 +1626,3 @@ return {

prepend: (t) => {
e.pub(Q, t);
e.pub(ee, t);
},

@@ -1631,11 +1651,14 @@ append: (t, n) => {

}
function So() {
return F(mt);
function xo() {
return O(mt);
}
function xo() {
function $o() {
return O(Vn);
}
function To() {
const e = at();
return k.useMemo(() => vn(e), [e]);
}
let Tt = !1;
const mo = k.forwardRef(
let $t = !1;
const bo = k.forwardRef(
({

@@ -1649,42 +1672,42 @@ initialData: e = [],

ItemContent: r = Zt,
Header: c = null,
StickyHeader: u = null,
Header: u = null,
StickyHeader: c = null,
Footer: f = null,
StickyFooter: h = null,
EmptyPlaceholder: a = null,
HeaderWrapper: d = sn,
EmptyPlaceholder: p = null,
HeaderWrapper: g = sn,
StickyHeaderWrapper: w = ln,
FooterWrapper: T = rn,
StickyFooterWrapper: O = cn,
...D
FooterWrapper: $ = rn,
StickyFooterWrapper: V = cn,
...C
}, N) => {
const H = k.useMemo(() => {
const V = new kn();
return V.register(We), V.register(ye), V.register(Ae), V.register(we), V.pubIn({
const W = new kn();
return W.register(be), W.register(Ie), W.register(Re), W.register(De), W.pubIn({
[Y]: e.slice(),
[Be]: n,
[Oe]: n,
[Xt]: t,
[He]: o,
[Be]: o,
[ct]: r,
[Qt]: c,
[Qt]: u,
[tn]: f,
[en]: u,
[en]: c,
[nn]: h,
[on]: a,
[fn]: O,
[on]: p,
[fn]: V,
[an]: w,
[pn]: T,
[un]: d,
[pn]: $,
[un]: g,
[ut]: s
}), V.singletonSub(rt, i), V;
}), W.singletonSub(rt, i), W;
}, []);
k.useImperativeHandle(N, () => vn(H), [H]), k.useEffect(() => {
H.pubIn({
[Be]: n,
[Oe]: n,
[ct]: r
}), H.singletonSub(rt, i);
});
const B = k.useContext(gn);
const B = k.useContext(dn);
return k.useEffect(() => {
B.consoleMessage && (Tt || (Tt = !0, console.error(B.consoleMessage)));
B.consoleMessage && ($t || ($t = !0, console.error(B.consoleMessage)));
}, [B]), typeof window < "u" && B.watermarkMessage ? /* @__PURE__ */ b(

@@ -1699,10 +1722,10 @@ "div",

}
) : /* @__PURE__ */ b(yn.Provider, { value: H, children: /* @__PURE__ */ b(bo, { ...D }) });
) : /* @__PURE__ */ b(yn.Provider, { value: H, children: /* @__PURE__ */ b(ko, { ...C }) });
}
);
mo.displayName = "VirtuosoMessageList";
bo.displayName = "VirtuosoMessageList";
function pe(e) {
return e ? e.getBoundingClientRect().height : 0;
}
const bo = ({ style: e, ...t }) => {
const ko = ({ style: e, ...t }) => {
const n = at(), [

@@ -1713,8 +1736,8 @@ o,

r,
u,
c,
u,
f,
h,
a,
d
p,
g
] = In(

@@ -1732,13 +1755,13 @@ Qt,

), w = k.useCallback(
(g, ae) => {
const G = g.querySelector('[data-role="virtuoso-list"]'), Z = g.querySelector('[data-role="virtuoso-header"]'), Ye = g.querySelector('[data-role="virtuoso-sticky-header"]'), ne = g.querySelector('[data-role="virtuoso-footer"]'), Ke = g.querySelector('[data-role="virtuoso-sticky-footer"]'), mn = G && ae === "resize" ? Gn(G.children) : [];
(d, ae) => {
const G = d.querySelector('[data-role="virtuoso-list"]'), Z = d.querySelector('[data-role="virtuoso-header"]'), Ye = d.querySelector('[data-role="virtuoso-sticky-header"]'), J = d.querySelector('[data-role="virtuoso-footer"]'), Ke = d.querySelector('[data-role="virtuoso-sticky-footer"]'), mn = G && ae === "resize" ? Zn(G.children) : [];
n.pubIn({
[be]: mn,
[S]: g.scrollTop,
[Ie]: g.scrollHeight,
[U]: pe(g),
[qt]: g.clientWidth,
[xe]: pe(Z),
[Se]: pe(Ye),
[dt]: pe(ne),
[ke]: mn,
[y]: d.scrollTop,
[Se]: d.scrollHeight,
[U]: pe(d),
[qt]: d.clientWidth,
[$e]: pe(Z),
[xe]: pe(Ye),
[gt]: pe(J),
[Te]: pe(Ke)

@@ -1748,16 +1771,16 @@ });

[n]
), { elRef: T, callbackRef: O, listCallbackRef: D, scrollBy: N, scrollTo: H } = Un(w), { items: B } = F(We);
), { elRef: $, callbackRef: V, listCallbackRef: C, scrollBy: N, scrollTo: H } = Gn(w), { items: B } = O(be);
k.useLayoutEffect(() => {
const g = T.current;
g && w(g, "resize");
}, [B, T, w, a]), k.useLayoutEffect(() => n.sub(re, H), [H, n]), k.useLayoutEffect(() => n.sub(q, N), [N, n]);
const V = F(R), te = F(A), Pe = F(lt), W = F(Fe), $e = F(Gt), z = F(Be), Ne = F(Xt), ze = F(ce), Ee = F(ue);
return /* @__PURE__ */ b(bn, { children: /* @__PURE__ */ $t(
const d = $.current;
d && w(d, "resize");
}, [B, $, w, p]), k.useLayoutEffect(() => n.sub(le, H), [H, n]), k.useLayoutEffect(() => n.sub(q, N), [N, n]);
const W = O(R), oe = O(D), Pe = O(lt), F = O(Fe), Ee = O(Gt), z = O(Oe), Ne = O(Xt), ze = O(ce), Me = O(ue);
return /* @__PURE__ */ b(bn, { children: /* @__PURE__ */ Tt(
"div",
{
...t,
ref: O,
ref: V,
"data-testid": "virtuoso-scroller",
style: {
overflowY: te ? "hidden" : "auto",
overflowY: oe ? "hidden" : "auto",
boxSizing: "border-box",

@@ -1772,3 +1795,3 @@ ...e

{
ref: D,
ref: C,
"data-role": "virtuoso-list",

@@ -1778,15 +1801,15 @@ "data-testid": "virtuoso-list",

boxSizing: "content-box",
height: Ee,
paddingBottom: W,
height: Me,
paddingBottom: F,
overflowAnchor: "none",
marginTop: Pe,
transition: $e,
transition: Ee,
position: "relative",
transform: `translateY(${V}px)`
transform: `translateY(${W}px)`
},
children: B.map((g) => /* @__PURE__ */ b(
children: B.map((d) => /* @__PURE__ */ b(
"div",
{
"data-index": g.index,
"data-known-size": g.height,
"data-index": d.index,
"data-known-size": d.height,
style: {

@@ -1796,12 +1819,12 @@ overflowAnchor: "none",

width: "100%",
top: g.offset
top: d.offset
},
children: /* @__PURE__ */ b(a, { index: g.index, data: g.data, context: z })
children: /* @__PURE__ */ b(p, { index: d.index, prevData: d.prevData, nextData: d.nextData, data: d.data, context: z })
},
Ne({ index: g.index, data: g.data, context: z })
Ne({ index: d.index, data: d.data, context: z })
))
}
) : d ? /* @__PURE__ */ b(d, { context: z }) : null,
c && /* @__PURE__ */ b(f, { "data-role": "virtuoso-footer", children: /* @__PURE__ */ b(c, { context: z }) }),
u && /* @__PURE__ */ b(h, { "data-role": "virtuoso-sticky-footer", children: /* @__PURE__ */ b(u, { context: z }) })
) : g ? /* @__PURE__ */ b(g, { context: z }) : null,
u && /* @__PURE__ */ b(f, { "data-role": "virtuoso-footer", children: /* @__PURE__ */ b(u, { context: z }) }),
c && /* @__PURE__ */ b(h, { "data-role": "virtuoso-sticky-footer", children: /* @__PURE__ */ b(c, { context: z }) })
]

@@ -1812,6 +1835,7 @@ }

export {
mo as VirtuosoMessageList,
vo as VirtuosoMessageListLicense,
So as useVirtuosoLocation,
xo as useVirtuosoMethods
bo as VirtuosoMessageList,
mo as VirtuosoMessageListLicense,
$o as useCurrentlyRenderedData,
xo as useVirtuosoLocation,
To as useVirtuosoMethods
};

@@ -23,3 +23,3 @@ {

},
"version": "1.0.0",
"version": "1.2.0",
"type": "module",

@@ -57,2 +57,21 @@ "module": "dist/index.js",

}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
]
}
]
]

@@ -69,2 +88,4 @@ },

"@playwright/test": "^1.42.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@testing-library/jest-dom": "^6.4.2",

@@ -103,4 +124,5 @@ "@testing-library/react": "^14.2.1",

"files": [
"dist"
"dist",
"CHANGELOG.md"
]
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc