@wyxos/vibe 2.1.8 → 2.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/index.cjs +1 -1
  2. package/lib/index.js +538 -533
  3. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as Se, ref as p, computed as S, onMounted as He, onUnmounted as Pt, createElementBlock as I, openBlock as k, normalizeStyle as $, createCommentVNode as j, createElementVNode as T, normalizeClass as ht, mergeDefaults as Ut, useAttrs as Kt, shallowRef as gt, provide as Jt, watch as ne, mergeProps as Qt, renderSlot as Zt, toDisplayString as pt, Fragment as yt, renderList as wt, createVNode as X, unref as ce, nextTick as xt, inject as en } from "vue";
2
- const tn = {
1
+ import { defineComponent as Ie, ref as p, computed as M, onMounted as qe, onUnmounted as _t, createElementBlock as S, openBlock as I, normalizeStyle as Y, createCommentVNode as W, createElementVNode as T, normalizeClass as pt, mergeDefaults as Zt, useAttrs as en, shallowRef as yt, provide as tn, watch as le, mergeProps as nn, renderSlot as ln, toDisplayString as wt, Fragment as xt, renderList as bt, createVNode as j, unref as fe, nextTick as Mt, inject as on } from "vue";
2
+ const an = {
3
3
  mode: "default",
4
4
  pageSize: 20,
5
5
  backfillRequestDelayMs: 2e3,
@@ -12,15 +12,15 @@ const tn = {
12
12
  headerHeight: 0,
13
13
  footerHeight: 0,
14
14
  overscanPx: 600
15
- }, nn = {
15
+ }, sn = {
16
16
  key: 0,
17
17
  "data-testid": "masonry-loader-spinner",
18
18
  class: "absolute inset-0 flex items-center justify-center"
19
- }, ln = {
19
+ }, rn = {
20
20
  key: 1,
21
21
  "data-testid": "masonry-loader-error",
22
22
  class: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-3"
23
- }, an = ["src", "width", "height", "alt"], on = ["poster"], sn = ["src"], bt = /* @__PURE__ */ Se({
23
+ }, un = ["src", "width", "height", "alt"], cn = ["poster"], fn = ["src"], St = /* @__PURE__ */ Ie({
24
24
  __name: "MasonryLoader",
25
25
  props: {
26
26
  item: {},
@@ -28,58 +28,58 @@ const tn = {
28
28
  },
29
29
  emits: ["success", "error"],
30
30
  setup(l, { emit: y }) {
31
- const u = l, s = y, i = p(null), m = p(!1), c = p(!1), r = p(!1), h = p(0), g = S(() => {
32
- const _ = u.item?.width, P = u.item?.height;
33
- return { aspectRatio: `${_} / ${P}` };
34
- }), M = S(() => u.item?.type === "image");
35
- let F = null, A = null;
31
+ const c = l, s = y, i = p(null), m = p(!1), f = p(!1), r = p(!1), h = p(0), g = M(() => {
32
+ const _ = c.item?.width, F = c.item?.height;
33
+ return { aspectRatio: `${_} / ${F}` };
34
+ }), x = M(() => c.item?.type === "image");
35
+ let k = null, E = null;
36
36
  function N() {
37
- A != null && (window.clearTimeout(A), A = null);
37
+ E != null && (window.clearTimeout(E), E = null);
38
38
  }
39
- function E() {
39
+ function R() {
40
40
  N();
41
- const _ = typeof u.timeoutMs == "number" && Number.isFinite(u.timeoutMs) ? u.timeoutMs : 0;
42
- _ <= 0 || (A = window.setTimeout(() => {
43
- m.value && (c.value || r.value || W(new Error("timeout")));
41
+ const _ = typeof c.timeoutMs == "number" && Number.isFinite(c.timeoutMs) ? c.timeoutMs : 0;
42
+ _ <= 0 || (E = window.setTimeout(() => {
43
+ m.value && (f.value || r.value || G(new Error("timeout")));
44
44
  }, _));
45
45
  }
46
- function L() {
47
- m.value || (m.value = !0, c.value = !1, r.value = !1, E());
46
+ function z() {
47
+ m.value || (m.value = !0, f.value = !1, r.value = !1, R());
48
48
  }
49
- He(() => {
49
+ qe(() => {
50
50
  if (typeof IntersectionObserver > "u") {
51
- L();
51
+ z();
52
52
  return;
53
53
  }
54
- F = new IntersectionObserver(
54
+ k = new IntersectionObserver(
55
55
  (_) => {
56
- for (const P of _)
57
- if (P.isIntersecting && !((P.intersectionRatio ?? 0) < 0.5)) {
58
- L(), F?.disconnect(), F = null;
56
+ for (const F of _)
57
+ if (F.isIntersecting && !((F.intersectionRatio ?? 0) < 0.5)) {
58
+ z(), k?.disconnect(), k = null;
59
59
  return;
60
60
  }
61
61
  },
62
62
  { threshold: [0, 0.5, 1] }
63
- ), i.value && F.observe(i.value);
64
- }), Pt(() => {
65
- F?.disconnect(), F = null, N();
63
+ ), i.value && k.observe(i.value);
64
+ }), _t(() => {
65
+ k?.disconnect(), k = null, N();
66
66
  });
67
- function C() {
68
- c.value || (c.value = !0, r.value = !1, N(), s("success", u.item));
67
+ function H() {
68
+ f.value || (f.value = !0, r.value = !1, N(), s("success", c.item));
69
69
  }
70
- function W(_) {
71
- r.value || (c.value = !1, r.value = !0, N(), s("error", { item: u.item, error: _ }));
70
+ function G(_) {
71
+ r.value || (f.value = !1, r.value = !0, N(), s("error", { item: c.item, error: _ }));
72
72
  }
73
73
  function O() {
74
- m.value && (c.value = !1, r.value = !1, h.value += 1, E());
74
+ m.value && (f.value = !1, r.value = !1, h.value += 1, R());
75
75
  }
76
- return (_, P) => (k(), I("div", {
76
+ return (_, F) => (I(), S("div", {
77
77
  ref_key: "rootEl",
78
78
  ref: i,
79
79
  class: "relative bg-slate-100",
80
- style: $(g.value)
80
+ style: Y(g.value)
81
81
  }, [
82
- m.value && !c.value && !r.value ? (k(), I("div", nn, P[2] || (P[2] = [
82
+ m.value && !f.value && !r.value ? (I(), S("div", sn, F[2] || (F[2] = [
83
83
  T("svg", {
84
84
  class: "h-5 w-5 animate-spin text-slate-500",
85
85
  viewBox: "0 0 24 24",
@@ -100,89 +100,89 @@ const tn = {
100
100
  d: "M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4z"
101
101
  })
102
102
  ], -1)
103
- ]))) : m.value && r.value ? (k(), I("div", ln, [
104
- P[3] || (P[3] = T("p", { class: "text-center text-xs font-medium text-red-700" }, "Failed to load", -1)),
103
+ ]))) : m.value && r.value ? (I(), S("div", rn, [
104
+ F[3] || (F[3] = T("p", { class: "text-center text-xs font-medium text-red-700" }, "Failed to load", -1)),
105
105
  T("button", {
106
106
  type: "button",
107
107
  "data-testid": "masonry-loader-retry",
108
108
  class: "inline-flex items-center rounded-md border border-slate-200 bg-white px-2 py-1 text-xs font-medium text-slate-700",
109
109
  onClick: O
110
110
  }, " Retry ")
111
- ])) : j("", !0),
112
- m.value && M.value && !r.value ? (k(), I("img", {
113
- key: u.item.id + ":img:" + h.value,
114
- class: ht([
111
+ ])) : W("", !0),
112
+ m.value && x.value && !r.value ? (I(), S("img", {
113
+ key: c.item.id + ":img:" + h.value,
114
+ class: pt([
115
115
  "h-full w-full object-cover transition-opacity duration-300",
116
- c.value ? "opacity-100" : "opacity-0"
116
+ f.value ? "opacity-100" : "opacity-0"
117
117
  ]),
118
- src: u.item.preview,
119
- width: u.item.width,
120
- height: u.item.height,
118
+ src: c.item.preview,
119
+ width: c.item.width,
120
+ height: c.item.height,
121
121
  loading: "lazy",
122
- alt: u.item.id,
123
- onLoad: C,
124
- onError: P[0] || (P[0] = (q) => W(q))
125
- }, null, 42, an)) : m.value && !r.value ? (k(), I("video", {
126
- key: u.item.id + ":vid:" + h.value,
127
- class: ht([
122
+ alt: c.item.id,
123
+ onLoad: H,
124
+ onError: F[0] || (F[0] = (q) => G(q))
125
+ }, null, 42, un)) : m.value && !r.value ? (I(), S("video", {
126
+ key: c.item.id + ":vid:" + h.value,
127
+ class: pt([
128
128
  "h-full w-full object-cover transition-opacity duration-300",
129
- c.value ? "opacity-100" : "opacity-0"
129
+ f.value ? "opacity-100" : "opacity-0"
130
130
  ]),
131
- poster: u.item.preview,
131
+ poster: c.item.preview,
132
132
  controls: "",
133
133
  preload: "metadata",
134
- onLoadedmetadata: C,
135
- onError: P[1] || (P[1] = (q) => W(q))
134
+ onLoadedmetadata: H,
135
+ onError: F[1] || (F[1] = (q) => G(q))
136
136
  }, [
137
137
  T("source", {
138
- src: u.item.original,
138
+ src: c.item.original,
139
139
  type: "video/mp4"
140
- }, null, 8, sn)
141
- ], 42, on)) : j("", !0)
140
+ }, null, 8, fn)
141
+ ], 42, cn)) : W("", !0)
142
142
  ], 4));
143
143
  }
144
- }), Tt = Symbol("masonryItemRegistry");
145
- function rn(l, y) {
144
+ }), Bt = Symbol("masonryItemRegistry");
145
+ function dn(l, y) {
146
146
  return !l || l <= 0 || !y || y <= 0 ? 1 : Math.max(1, Math.floor(l / y));
147
147
  }
148
- function un(l, y, u, s = 0) {
149
- if (!l || l <= 0 || !y || y <= 0) return u;
150
- const i = typeof s == "number" && s > 0 ? s : 0, m = Math.max(0, y - 1) * i, c = l - m;
151
- return !c || c <= 0 ? u : c / y;
148
+ function vn(l, y, c, s = 0) {
149
+ if (!l || l <= 0 || !y || y <= 0) return c;
150
+ const i = typeof s == "number" && s > 0 ? s : 0, m = Math.max(0, y - 1) * i, f = l - m;
151
+ return !f || f <= 0 ? c : f / y;
152
152
  }
153
- function cn(l, y) {
154
- const u = l?.width, s = l?.height;
155
- return typeof u == "number" && typeof s == "number" && u > 0 && s > 0 ? s / u * y : y;
153
+ function mn(l, y) {
154
+ const c = l?.width, s = l?.height;
155
+ return typeof c == "number" && typeof s == "number" && c > 0 && s > 0 ? s / c * y : y;
156
156
  }
157
- function _t(l) {
157
+ function At(l) {
158
158
  return Number.isFinite(l) && l > 0 ? Math.floor(l) : 1;
159
159
  }
160
- function Le(l) {
160
+ function De(l) {
161
161
  return Number.isFinite(l) && l > 0 ? Math.floor(l) : 0;
162
162
  }
163
- function fn(l) {
163
+ function hn(l) {
164
164
  async function y(s) {
165
- const i = Le(s);
165
+ const i = De(s);
166
166
  if (i <= 0) return;
167
167
  l.stats.value = {
168
168
  ...l.stats.value,
169
169
  cooldownMsTotal: i,
170
170
  cooldownMsRemaining: i
171
171
  };
172
- const m = Date.now(), c = 100;
172
+ const m = Date.now(), f = 100;
173
173
  await new Promise((r) => {
174
174
  const h = setInterval(() => {
175
- const g = Date.now() - m, M = Math.max(0, i - g);
175
+ const g = Date.now() - m, x = Math.max(0, i - g);
176
176
  l.stats.value = {
177
177
  ...l.stats.value,
178
178
  cooldownMsTotal: i,
179
- cooldownMsRemaining: M
180
- }, M <= 0 && (clearInterval(h), r());
181
- }, c);
179
+ cooldownMsRemaining: x
180
+ }, x <= 0 && (clearInterval(h), r());
181
+ }, f);
182
182
  });
183
183
  }
184
- async function u(s) {
185
- const i = _t(l.getPageSize()), m = l.isEnabled(), c = Le(l.getRequestDelayMs()), r = [];
184
+ async function c(s) {
185
+ const i = At(l.getPageSize()), m = l.isEnabled(), f = De(l.getRequestDelayMs()), r = [];
186
186
  let h = 0;
187
187
  l.buffer.value.length && (h = l.buffer.value.length, r.push(...l.buffer.value), l.buffer.value = []), l.stats.value = {
188
188
  ...l.stats.value,
@@ -190,7 +190,7 @@ function fn(l) {
190
190
  isBackfillActive: !1,
191
191
  isRequestInFlight: !1,
192
192
  requestPage: null,
193
- cooldownMsTotal: c,
193
+ cooldownMsTotal: f,
194
194
  cooldownMsRemaining: 0,
195
195
  progress: {
196
196
  collected: 0,
@@ -200,31 +200,31 @@ function fn(l) {
200
200
  bufferSize: 0
201
201
  };
202
202
  const g = [];
203
- let M = s, F = 0, A = !1;
204
- for (; r.length < i && M != null; ) {
205
- const L = M;
206
- A && (l.stats.value = {
203
+ let x = s, k = 0, E = !1;
204
+ for (; r.length < i && x != null; ) {
205
+ const z = x;
206
+ E && (l.stats.value = {
207
207
  ...l.stats.value,
208
208
  enabled: m,
209
209
  isBackfillActive: !0,
210
210
  isRequestInFlight: !0,
211
- requestPage: L,
211
+ requestPage: z,
212
212
  progress: {
213
213
  collected: Math.min(r.length, i),
214
214
  target: i
215
215
  },
216
- cooldownMsTotal: c,
216
+ cooldownMsTotal: f,
217
217
  cooldownMsRemaining: 0,
218
218
  pageSize: i
219
219
  });
220
- const C = await l.getContent(L);
221
- g.push(L), A && (l.stats.value = {
220
+ const H = await l.getContent(z);
221
+ g.push(z), E && (l.stats.value = {
222
222
  ...l.stats.value,
223
223
  enabled: m,
224
224
  isBackfillActive: !0,
225
225
  isRequestInFlight: !1,
226
226
  requestPage: null
227
- }), F += C.items.length, l.markEnterFromLeft(C.items), r.push(...C.items), M = C.nextPage, !A && r.length < i && M != null ? (A = !0, l.stats.value = {
227
+ }), k += H.items.length, l.markEnterFromLeft(H.items), r.push(...H.items), x = H.nextPage, !E && r.length < i && x != null ? (E = !0, l.stats.value = {
228
228
  ...l.stats.value,
229
229
  enabled: m,
230
230
  isBackfillActive: !0,
@@ -234,10 +234,10 @@ function fn(l) {
234
234
  collected: Math.min(r.length, i),
235
235
  target: i
236
236
  },
237
- cooldownMsTotal: c,
237
+ cooldownMsTotal: f,
238
238
  cooldownMsRemaining: 0,
239
239
  pageSize: i
240
- }) : A && (l.stats.value = {
240
+ }) : E && (l.stats.value = {
241
241
  ...l.stats.value,
242
242
  enabled: m,
243
243
  isBackfillActive: !0,
@@ -245,10 +245,10 @@ function fn(l) {
245
245
  collected: Math.min(r.length, i),
246
246
  target: i
247
247
  }
248
- }), A && r.length < i && M != null && await y(c);
248
+ }), E && r.length < i && x != null && await y(f);
249
249
  }
250
- const N = r.slice(0, i), E = r.slice(i);
251
- return l.buffer.value = E, l.stats.value = {
250
+ const N = r.slice(0, i), R = r.slice(i);
251
+ return l.buffer.value = R, l.stats.value = {
252
252
  ...l.stats.value,
253
253
  enabled: m,
254
254
  isBackfillActive: !1,
@@ -258,78 +258,78 @@ function fn(l) {
258
258
  collected: 0,
259
259
  target: 0
260
260
  },
261
- cooldownMsTotal: c,
261
+ cooldownMsTotal: f,
262
262
  cooldownMsRemaining: 0,
263
263
  pageSize: i,
264
- bufferSize: E.length,
264
+ bufferSize: R.length,
265
265
  lastBatch: {
266
266
  startPage: s,
267
267
  pages: g,
268
268
  usedFromBuffer: h,
269
- fetchedFromNetwork: F,
269
+ fetchedFromNetwork: k,
270
270
  collectedTotal: r.length,
271
271
  emitted: N.length,
272
- carried: E.length
272
+ carried: R.length
273
273
  },
274
274
  totals: {
275
275
  pagesFetched: l.stats.value.totals.pagesFetched + g.length,
276
- itemsFetchedFromNetwork: l.stats.value.totals.itemsFetchedFromNetwork + F
276
+ itemsFetchedFromNetwork: l.stats.value.totals.itemsFetchedFromNetwork + k
277
277
  }
278
- }, { batchItems: N, pages: g, nextPage: M };
278
+ }, { batchItems: N, pages: g, nextPage: x };
279
279
  }
280
- return { loadBackfillBatch: u };
280
+ return { loadBackfillBatch: c };
281
281
  }
282
- function dn(l) {
283
- const y = l.columnCount, u = l.columnWidth, s = l.gapX, i = l.gapY, m = l.headerHeight, c = l.footerHeight, r = l.bucketPx, h = Array.from({ length: y }, () => 0), g = new Array(l.items.length), M = new Array(l.items.length), F = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
282
+ function gn(l) {
283
+ const y = l.columnCount, c = l.columnWidth, s = l.gapX, i = l.gapY, m = l.headerHeight, f = l.footerHeight, r = l.bucketPx, h = Array.from({ length: y }, () => 0), g = new Array(l.items.length), x = new Array(l.items.length), k = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
284
284
  let N = 0;
285
- for (let E = 0; E < l.items.length; E += 1) {
286
- const L = l.items[E];
287
- L?.id && A.set(L.id, E);
288
- let C = 0;
289
- for (let H = 1; H < h.length; H += 1)
290
- h[H] < h[C] && (C = H);
291
- const W = C * (u + s), O = h[C], _ = cn(L, u) + m + c;
292
- g[E] = { x: W, y: O }, M[E] = _, h[C] = O + _ + i, N = Math.max(N, O + _);
293
- const P = Math.floor(O / r), q = Math.floor((O + _) / r);
294
- for (let H = P; H <= q; H += 1) {
295
- const le = F.get(H);
296
- le ? le.push(E) : F.set(H, [E]);
285
+ for (let R = 0; R < l.items.length; R += 1) {
286
+ const z = l.items[R];
287
+ z?.id && E.set(z.id, R);
288
+ let H = 0;
289
+ for (let L = 1; L < h.length; L += 1)
290
+ h[L] < h[H] && (H = L);
291
+ const G = H * (c + s), O = h[H], _ = mn(z, c) + m + f;
292
+ g[R] = { x: G, y: O }, x[R] = _, h[H] = O + _ + i, N = Math.max(N, O + _);
293
+ const F = Math.floor(O / r), q = Math.floor((O + _) / r);
294
+ for (let L = F; L <= q; L += 1) {
295
+ const oe = k.get(L);
296
+ oe ? oe.push(R) : k.set(L, [R]);
297
297
  }
298
298
  }
299
- return { positions: g, heights: M, buckets: F, contentHeight: N, indexById: A };
299
+ return { positions: g, heights: x, buckets: k, contentHeight: N, indexById: E };
300
300
  }
301
- function vn(l) {
301
+ function pn(l) {
302
302
  const y = l.itemCount;
303
303
  if (!y) return [];
304
304
  if (l.viewportHeight <= 0) return Array.from({ length: y }, (h, g) => g);
305
- const u = Math.max(0, l.scrollTop - l.overscanPx), s = l.scrollTop + l.viewportHeight + l.overscanPx, i = Math.floor(u / l.bucketPx), m = Math.floor(s / l.bucketPx), c = /* @__PURE__ */ new Set();
305
+ const c = Math.max(0, l.scrollTop - l.overscanPx), s = l.scrollTop + l.viewportHeight + l.overscanPx, i = Math.floor(c / l.bucketPx), m = Math.floor(s / l.bucketPx), f = /* @__PURE__ */ new Set();
306
306
  for (let h = i; h <= m; h += 1) {
307
307
  const g = l.buckets.get(h);
308
308
  if (g)
309
- for (const M of g) c.add(M);
309
+ for (const x of g) f.add(x);
310
310
  }
311
- const r = Array.from(c);
311
+ const r = Array.from(f);
312
312
  return r.sort((h, g) => h - g), r;
313
313
  }
314
- const mn = { class: "hidden" }, hn = {
314
+ const yn = { class: "hidden" }, wn = {
315
315
  key: 0,
316
316
  class: "flex h-full items-center justify-center"
317
- }, gn = {
317
+ }, xn = {
318
318
  key: 1,
319
319
  class: "text-sm font-medium text-red-700"
320
- }, pn = { class: "relative" }, yn = {
320
+ }, bn = { class: "relative" }, Mn = {
321
321
  key: 0,
322
322
  class: "pointer-events-auto absolute inset-0"
323
- }, wn = { class: "relative" }, xn = {
323
+ }, Sn = { class: "relative" }, In = {
324
324
  key: 0,
325
325
  class: "pointer-events-auto absolute inset-0"
326
- }, bn = { class: "mt-4 pb-2 text-center text-xs text-slate-600" }, Mn = {
326
+ }, kn = { class: "mt-4 pb-2 text-center text-xs text-slate-600" }, Fn = {
327
327
  key: 0,
328
328
  class: "inline-flex items-center justify-center gap-2"
329
- }, Sn = { key: 1 }, In = { key: 2 }, Mt = 100, kn = 200, St = 600, It = 300, kt = 600, Ft = 600, Fn = 400, Pn = 5, Tn = 1e3, _n = /* @__PURE__ */ Se({
329
+ }, Pn = { key: 1 }, Tn = { key: 2 }, It = 100, _n = 200, kt = 600, Ft = 300, Pt = 600, Tt = 600, Bn = 400, An = 5, En = 1e3, Rn = /* @__PURE__ */ Ie({
330
330
  inheritAttrs: !1,
331
331
  __name: "Masonry",
332
- props: /* @__PURE__ */ Ut({
332
+ props: /* @__PURE__ */ Zt({
333
333
  getContent: {},
334
334
  mode: {},
335
335
  pageSize: {},
@@ -345,10 +345,10 @@ const mn = { class: "hidden" }, hn = {
345
345
  headerHeight: {},
346
346
  footerHeight: {},
347
347
  overscanPx: {}
348
- }, tn),
348
+ }, an),
349
349
  emits: ["update:items", "preloaded", "failures"],
350
- setup(l, { expose: y, emit: u }) {
351
- const s = l, i = u, m = Kt(), c = Se({
350
+ setup(l, { expose: y, emit: c }) {
351
+ const s = l, i = c, m = en(), f = Ie({
352
352
  name: "SlotRenderer",
353
353
  props: {
354
354
  slotFn: {
@@ -366,13 +366,13 @@ const mn = { class: "hidden" }, hn = {
366
366
  return t ? t(e.slotProps) : null;
367
367
  };
368
368
  }
369
- }), r = gt(null);
370
- Jt(Tt, (e) => {
369
+ }), r = yt(null);
370
+ tn(Bt, (e) => {
371
371
  r.value || (r.value = e);
372
372
  });
373
373
  const h = [], g = [];
374
- let M = null, F = null;
375
- function A() {
374
+ let x = null, k = null;
375
+ function E() {
376
376
  if (!h.length) return;
377
377
  const e = h.splice(0, h.length);
378
378
  i("preloaded", e);
@@ -382,255 +382,255 @@ const mn = { class: "hidden" }, hn = {
382
382
  const e = g.splice(0, g.length);
383
383
  i("failures", e);
384
384
  }
385
- function E() {
386
- M || (M = setTimeout(() => {
387
- M = null, A();
388
- }, Mt));
385
+ function R() {
386
+ x || (x = setTimeout(() => {
387
+ x = null, E();
388
+ }, It));
389
389
  }
390
- function L() {
391
- F || (F = setTimeout(() => {
392
- F = null, N();
393
- }, Mt));
390
+ function z() {
391
+ k || (k = setTimeout(() => {
392
+ k = null, N();
393
+ }, It));
394
394
  }
395
- function C(e) {
396
- r.value?.onPreloaded?.(e), h.push(e), E();
395
+ function H(e) {
396
+ r.value?.onPreloaded?.(e), h.push(e), R();
397
397
  }
398
- function W(e) {
399
- r.value?.onFailed?.(e), g.push(e), L();
398
+ function G(e) {
399
+ r.value?.onFailed?.(e), g.push(e), z();
400
400
  }
401
- He(() => {
401
+ qe(() => {
402
402
  if (!r.value)
403
403
  throw new Error("[Masonry] Missing <MasonryItem> definition. Add <MasonryItem> as a child of <Masonry>.");
404
404
  });
405
- const O = S(() => {
405
+ const O = M(() => {
406
406
  const { class: e, ...t } = m;
407
407
  return t;
408
- }), _ = p(null), P = p(0), q = p(0), H = p(0);
409
- let le;
410
- const ae = S(() => s.gapX), ze = S(() => s.gapY);
411
- function qe(e) {
408
+ }), _ = p(null), F = p(0), q = p(0), L = p(0);
409
+ let oe;
410
+ const ae = M(() => s.gapX), Oe = M(() => s.gapY);
411
+ function Ye(e) {
412
412
  if (!e) return 0;
413
413
  const t = Math.max(0, ae.value);
414
414
  return Math.max(0, e.clientWidth - t);
415
415
  }
416
- const oe = S(() => s.headerHeight), se = S(() => s.footerHeight), Ie = S(() => r.value?.header), ke = S(() => r.value?.footer), Fe = S(() => r.value?.overlay), De = S(() => !!Ie.value), Oe = S(() => !!ke.value), $e = S(() => !!Fe.value), Ve = S(() => {
417
- if (oe.value > 0) return { height: `${oe.value}px` };
418
- }), Ye = S(() => {
416
+ const se = M(() => s.headerHeight), re = M(() => s.footerHeight), ke = M(() => r.value?.header), Fe = M(() => r.value?.footer), Pe = M(() => r.value?.overlay), $e = M(() => !!ke.value), Ve = M(() => !!Fe.value), Xe = M(() => !!Pe.value), je = M(() => {
419
417
  if (se.value > 0) return { height: `${se.value}px` };
420
- }), fe = p([]), Pe = p([]), Xe = p(/* @__PURE__ */ new Map()), je = p(0), pe = p(/* @__PURE__ */ new Map());
421
- function We(e) {
418
+ }), We = M(() => {
419
+ if (re.value > 0) return { height: `${re.value}px` };
420
+ }), de = p([]), Te = p([]), Ge = p(/* @__PURE__ */ new Map()), Ue = p(0), pe = p(/* @__PURE__ */ new Map());
421
+ function Et(e) {
422
422
  const t = typeof e == "number" && Number.isFinite(e) ? e : 0;
423
- return rt.value + Math.max(0, t);
423
+ return ut.value + Math.max(0, t);
424
424
  }
425
- const G = p(/* @__PURE__ */ new Set()), U = p(/* @__PURE__ */ new Set()), ye = /* @__PURE__ */ new Set(), de = p(/* @__PURE__ */ new Map());
426
- function Bt(e) {
425
+ const U = p(/* @__PURE__ */ new Set()), K = p(/* @__PURE__ */ new Set()), ye = /* @__PURE__ */ new Set(), ve = p(/* @__PURE__ */ new Map());
426
+ function Rt(e) {
427
427
  return Number.isFinite(e) ? Math.max(0, Math.min(250, e)) : 0;
428
428
  }
429
- function At(e) {
430
- if (!U.value.has(e)) return;
431
- const t = de.value.get(e) ?? 0;
429
+ function Ct(e) {
430
+ if (!K.value.has(e)) return;
431
+ const t = ve.value.get(e) ?? 0;
432
432
  if (!(t <= 0))
433
433
  return `${t}ms`;
434
434
  }
435
- const we = p(/* @__PURE__ */ new Map()), V = p(/* @__PURE__ */ new Set()), Y = p([]);
436
- function Et(e) {
435
+ const we = p(/* @__PURE__ */ new Map()), $ = p(/* @__PURE__ */ new Set()), V = p([]);
436
+ function Ht(e) {
437
437
  const t = we.value.get(e);
438
438
  return t || { dx: 0, dy: 0 };
439
439
  }
440
- function Rt(e) {
441
- if (U.value.has(e)) return `transform ${kt}ms ease-out`;
442
- if (V.value.has(e)) return `transform ${It}ms ease-out`;
440
+ function Nt(e) {
441
+ if (K.value.has(e)) return `transform ${Pt}ms ease-out`;
442
+ if ($.value.has(e)) return `transform ${Ft}ms ease-out`;
443
443
  }
444
- function Ct(e) {
445
- const n = d.value[e]?.id, a = fe.value[e] ?? { x: 0, y: 0 }, o = Pe.value[e] ?? 0, f = o > 0 ? o : he.value, v = a.x, x = n && G.value.has(n) ? We(f) : a.y, b = n ? Et(n) : { dx: 0, dy: 0 };
446
- return `translate3d(${v + b.dx}px,${x + b.dy}px,0)`;
444
+ function Lt(e) {
445
+ const n = v.value[e]?.id, o = de.value[e] ?? { x: 0, y: 0 }, a = Te.value[e] ?? 0, u = a > 0 ? a : ge.value, d = o.x, b = n && U.value.has(n) ? Et(u) : o.y, B = n ? Ht(n) : { dx: 0, dy: 0 };
446
+ return `translate3d(${d + B.dx}px,${b + B.dy}px,0)`;
447
447
  }
448
- function re(e) {
448
+ function ie(e) {
449
449
  (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (n) => setTimeout(() => n(0), 0))(() => e());
450
450
  }
451
- function Nt(e) {
452
- re(() => re(e));
451
+ function zt(e) {
452
+ ie(() => ie(e));
453
453
  }
454
- const Ge = /* @__PURE__ */ new Set();
455
- function Ue(e) {
454
+ const Ke = /* @__PURE__ */ new Set();
455
+ function Je(e) {
456
456
  return typeof e == "number" && Number.isFinite(e) && e > 0;
457
457
  }
458
- function Te(e) {
458
+ function _e(e) {
459
459
  if (!Array.isArray(e) || e.length === 0) return;
460
- const t = new Set(G.value);
460
+ const t = new Set(U.value);
461
461
  let n = !1;
462
- for (const a of e) {
463
- const o = a?.id;
464
- if (o) {
465
- if (!Ge.has(o)) {
466
- const f = a?.width, v = a?.height;
467
- (!Ue(f) || !Ue(v)) && (Ge.add(o), console.warn(
468
- `[Masonry] Item "${o}" has invalid dimensions (width=${String(f)}, height=${String(
469
- v
462
+ for (const o of e) {
463
+ const a = o?.id;
464
+ if (a) {
465
+ if (!Ke.has(a)) {
466
+ const u = o?.width, d = o?.height;
467
+ (!Je(u) || !Je(d)) && (Ke.add(a), console.warn(
468
+ `[Masonry] Item "${a}" has invalid dimensions (width=${String(u)}, height=${String(
469
+ d
470
470
  )}); layout expects { id, width, height }.`
471
471
  ));
472
472
  }
473
- t.has(o) || (t.add(o), n = !0);
473
+ t.has(a) || (t.add(a), n = !0);
474
474
  }
475
475
  }
476
- n && (G.value = t);
476
+ n && (U.value = t);
477
477
  }
478
- function Ke() {
478
+ function Qe() {
479
479
  const e = /* @__PURE__ */ new Map();
480
- for (const t of Re.value) {
481
- const a = d.value[t]?.id;
482
- if (!a) continue;
483
- const o = fe.value[t];
484
- o && e.set(a, { x: o.x, y: o.y });
480
+ for (const t of Ne.value) {
481
+ const o = v.value[t]?.id;
482
+ if (!o) continue;
483
+ const a = de.value[t];
484
+ a && e.set(o, { x: a.x, y: a.y });
485
485
  }
486
486
  return e;
487
487
  }
488
- function Je(e, t) {
488
+ function Ze(e, t) {
489
489
  if (!e.size) return;
490
- const n = /* @__PURE__ */ new Map(), a = [];
491
- for (const [f, v] of e.entries()) {
492
- if (t?.has(f)) continue;
493
- const x = pe.value.get(f);
494
- if (x == null) continue;
495
- const b = fe.value[x];
496
- if (!b) continue;
497
- const w = v.x - b.x, z = v.y - b.y;
498
- (w || z) && (n.set(f, { dx: w, dy: z }), a.push(f));
490
+ const n = /* @__PURE__ */ new Map(), o = [];
491
+ for (const [u, d] of e.entries()) {
492
+ if (t?.has(u)) continue;
493
+ const b = pe.value.get(u);
494
+ if (b == null) continue;
495
+ const B = de.value[b];
496
+ if (!B) continue;
497
+ const P = d.x - B.x, w = d.y - B.y;
498
+ (P || w) && (n.set(u, { dx: P, dy: w }), o.push(u));
499
499
  }
500
500
  if (!n.size) return;
501
501
  we.value = n;
502
- const o = new Set(V.value);
503
- for (const f of a) o.delete(f);
504
- V.value = o, re(() => {
505
- V.value = /* @__PURE__ */ new Set([...V.value, ...a]), re(() => {
502
+ const a = new Set($.value);
503
+ for (const u of o) a.delete(u);
504
+ $.value = a, ie(() => {
505
+ $.value = /* @__PURE__ */ new Set([...$.value, ...o]), ie(() => {
506
506
  we.value = /* @__PURE__ */ new Map();
507
507
  });
508
508
  }), setTimeout(() => {
509
- const f = new Set(V.value);
510
- for (const v of a) f.delete(v);
511
- V.value = f;
512
- }, It);
509
+ const u = new Set($.value);
510
+ for (const d of o) u.delete(d);
511
+ $.value = u;
512
+ }, Ft);
513
513
  }
514
- const K = p(!0), J = p(!1), ie = p("");
515
- let R = 0;
516
- function Qe(e) {
514
+ const J = p(!0), Q = p(!1), ue = p("");
515
+ let C = 0, Be = 0, Ae = 0;
516
+ function et(e) {
517
517
  return e instanceof Error && e.name === "AbortError";
518
518
  }
519
- function Ze() {
519
+ function tt() {
520
520
  const e = new Error("aborted");
521
521
  return e.name = "AbortError", e;
522
522
  }
523
- function Ht(e) {
523
+ function qt(e) {
524
524
  return new Promise((t) => setTimeout(t, e));
525
525
  }
526
- async function et(e, t) {
526
+ async function nt(e, t) {
527
527
  let n = 0;
528
528
  for (; ; ) {
529
- if (t !== R) throw Ze();
529
+ if (t !== C) throw tt();
530
530
  try {
531
531
  return await s.getContent(e);
532
- } catch (a) {
533
- if (t !== R) throw Ze();
534
- if (n >= Pn) throw a;
535
- n += 1, await Ht(n * Tn);
532
+ } catch (o) {
533
+ if (t !== C) throw tt();
534
+ if (n >= An) throw o;
535
+ n += 1, await qt(n * En);
536
536
  }
537
537
  }
538
538
  }
539
- const D = p([]), tt = p([]), _e = p([]), B = p(s.page), xe = p([]);
540
- let Q = null, Z = null, be = 0;
541
- function Lt(e) {
539
+ const D = p([]), lt = p([]), Ee = p([]), A = p(s.page), xe = p([]);
540
+ let Z = null, ee = null, be = 0;
541
+ function Dt(e) {
542
542
  let t = -1;
543
543
  for (const n of e) {
544
- const a = n?.originalIndex;
545
- ve(a) && a > t && (t = a);
544
+ const o = n?.originalIndex;
545
+ me(o) && o > t && (t = o);
546
546
  }
547
547
  be = t + 1;
548
548
  }
549
- function ue(e) {
549
+ function ce(e) {
550
550
  for (const t of e)
551
551
  !t || typeof t != "object" || t.id && t.originalIndex == null && (t.originalIndex = be, be += 1);
552
552
  }
553
- const ee = /* @__PURE__ */ new Map(), te = [];
554
- function ve(e) {
553
+ const te = /* @__PURE__ */ new Map(), ne = [];
554
+ function me(e) {
555
555
  return typeof e == "number" && Number.isFinite(e);
556
556
  }
557
- function zt(e, t) {
557
+ function Ot(e, t) {
558
558
  if (!t.length) return e;
559
559
  const n = /* @__PURE__ */ new Set();
560
- for (const v of e) {
561
- const x = v?.id;
562
- x && n.add(x);
560
+ for (const d of e) {
561
+ const b = d?.id;
562
+ b && n.add(b);
563
563
  }
564
- const a = [];
565
- for (const v of t) {
566
- const x = v?.id;
567
- x && (n.has(x) || (a.push(v), n.add(x)));
564
+ const o = [];
565
+ for (const d of t) {
566
+ const b = d?.id;
567
+ b && (n.has(b) || (o.push(d), n.add(b)));
568
568
  }
569
- if (!a.length) return e;
570
- const o = a.slice().sort((v, x) => {
571
- const b = ve(v.originalIndex) ? v.originalIndex : Number.POSITIVE_INFINITY, w = ve(x.originalIndex) ? x.originalIndex : Number.POSITIVE_INFINITY;
572
- return b - w;
573
- }), f = e.slice();
574
- for (const v of o) {
575
- const x = v.originalIndex;
576
- if (!ve(x)) {
577
- f.push(v);
569
+ if (!o.length) return e;
570
+ const a = o.slice().sort((d, b) => {
571
+ const B = me(d.originalIndex) ? d.originalIndex : Number.POSITIVE_INFINITY, P = me(b.originalIndex) ? b.originalIndex : Number.POSITIVE_INFINITY;
572
+ return B - P;
573
+ }), u = e.slice();
574
+ for (const d of a) {
575
+ const b = d.originalIndex;
576
+ if (!me(b)) {
577
+ u.push(d);
578
578
  continue;
579
579
  }
580
- let b = 0, w = f.length;
581
- for (; b < w; ) {
582
- const z = b + w >> 1, ge = f[z]?.originalIndex;
583
- (ve(ge) ? ge : Number.POSITIVE_INFINITY) <= x ? b = z + 1 : w = z;
580
+ let B = 0, P = u.length;
581
+ for (; B < P; ) {
582
+ const w = B + P >> 1, X = u[w]?.originalIndex;
583
+ (me(X) ? X : Number.POSITIVE_INFINITY) <= b ? B = w + 1 : P = w;
584
584
  }
585
- f.splice(b, 0, v);
585
+ u.splice(B, 0, d);
586
586
  }
587
- return f;
587
+ return u;
588
588
  }
589
- async function nt(e) {
589
+ async function ot(e) {
590
590
  if (!e.length) return;
591
- Te(e);
592
- const t = Ke();
593
- d.value = zt(d.value, e), await xt(), Je(t);
591
+ _e(e);
592
+ const t = Qe();
593
+ v.value = Ot(v.value, e), await Mt(), Ze(t);
594
594
  }
595
- async function qt(e) {
596
- const n = (Array.isArray(e) ? e : [e]).map(Ae).filter(Boolean);
595
+ async function Yt(e) {
596
+ const n = (Array.isArray(e) ? e : [e]).map(Ce).filter(Boolean);
597
597
  if (!n.length) return;
598
- const a = [];
599
- for (const o of n) {
600
- const f = ee.get(o);
601
- f && a.push(f);
598
+ const o = [];
599
+ for (const a of n) {
600
+ const u = te.get(a);
601
+ u && o.push(u);
602
602
  }
603
- if (a.length) {
604
- await nt(a);
605
- for (const o of a)
606
- o?.id && ee.delete(o.id);
603
+ if (o.length) {
604
+ await ot(o);
605
+ for (const a of o)
606
+ a?.id && te.delete(a.id);
607
607
  }
608
608
  }
609
- async function Dt() {
610
- const e = te.pop();
609
+ async function $t() {
610
+ const e = ne.pop();
611
611
  if (!e?.length) return;
612
612
  const t = [];
613
613
  for (const n of e) {
614
- const a = ee.get(n);
615
- a && t.push(a);
614
+ const o = te.get(n);
615
+ o && t.push(o);
616
616
  }
617
617
  if (t.length) {
618
- await nt(t);
618
+ await ot(t);
619
619
  for (const n of t)
620
- n?.id && ee.delete(n.id);
620
+ n?.id && te.delete(n.id);
621
621
  }
622
622
  }
623
- function Ot(e) {
624
- const n = (Array.isArray(e) ? e : [e]).map(Ae).filter(Boolean);
623
+ function Vt(e) {
624
+ const n = (Array.isArray(e) ? e : [e]).map(Ce).filter(Boolean);
625
625
  if (!n.length) return;
626
- const a = new Set(n);
627
- for (const o of a) ee.delete(o);
628
- for (let o = te.length - 1; o >= 0; o -= 1) {
629
- const v = te[o].filter((x) => !a.has(x));
630
- v.length ? te[o] = v : te.splice(o, 1);
626
+ const o = new Set(n);
627
+ for (const a of o) te.delete(a);
628
+ for (let a = ne.length - 1; a >= 0; a -= 1) {
629
+ const d = ne[a].filter((b) => !o.has(b));
630
+ d.length ? ne[a] = d : ne.splice(a, 1);
631
631
  }
632
632
  }
633
- const Be = gt({
633
+ const Re = yt({
634
634
  enabled: !1,
635
635
  isBackfillActive: !1,
636
636
  isRequestInFlight: !1,
@@ -648,92 +648,93 @@ const mn = { class: "hidden" }, hn = {
648
648
  pagesFetched: 0,
649
649
  itemsFetchedFromNetwork: 0
650
650
  }
651
- }), lt = fn({
652
- getContent: (e) => et(e, R),
653
- markEnterFromLeft: Te,
651
+ }), at = hn({
652
+ getContent: (e) => nt(e, C),
653
+ markEnterFromLeft: _e,
654
654
  buffer: xe,
655
- stats: Be,
655
+ stats: Re,
656
656
  isEnabled: () => s.mode === "backfill",
657
657
  getPageSize: () => s.pageSize,
658
658
  getRequestDelayMs: () => s.backfillRequestDelayMs
659
- }), Me = S(() => s.items !== void 0);
660
- ne(
659
+ }), Me = M(() => s.items !== void 0);
660
+ le(
661
661
  () => s.items,
662
662
  (e) => {
663
- Me.value && (_e.value = Array.isArray(e) ? e : []);
663
+ Me.value && (Ee.value = Array.isArray(e) ? e : []);
664
664
  },
665
665
  { immediate: !0 }
666
666
  );
667
- const d = S({
667
+ const v = M({
668
668
  get() {
669
- return Me.value ? _e.value : tt.value;
669
+ return Me.value ? Ee.value : lt.value;
670
670
  },
671
671
  set(e) {
672
- Me.value ? (_e.value = e, i("update:items", e)) : tt.value = e;
672
+ Me.value ? (Ee.value = e, i("update:items", e)) : lt.value = e;
673
673
  }
674
- }), me = p(!1);
675
- async function at(e) {
676
- const t = await et(e, R);
677
- return ue(t.items), Te(t.items), { items: t.items, nextPage: t.nextPage };
674
+ }), he = p(!1);
675
+ async function st(e) {
676
+ const t = await nt(e, C);
677
+ return ce(t.items), _e(t.items), { items: t.items, nextPage: t.nextPage };
678
678
  }
679
- function Ae(e) {
679
+ function Ce(e) {
680
680
  return e ? typeof e == "string" ? e : e?.id : null;
681
681
  }
682
- async function ot(e) {
683
- const n = (Array.isArray(e) ? e : [e]).map(Ae).filter(Boolean);
682
+ async function rt(e) {
683
+ const n = (Array.isArray(e) ? e : [e]).map(Ce).filter(Boolean);
684
684
  if (!n.length) return;
685
- const a = new Set(n), o = [];
686
- for (const b of a) {
687
- const w = pe.value.get(b);
685
+ const o = new Set(n), a = [];
686
+ for (const P of o) {
687
+ const w = pe.value.get(P);
688
688
  if (w == null) continue;
689
- const z = d.value[w];
690
- z && (ee.set(b, z), o.push(b));
689
+ const X = v.value[w];
690
+ X && (te.set(P, X), a.push(P));
691
691
  }
692
- o.length && te.push(o);
693
- const f = Ke(), v = he.value, x = [];
694
- for (const b of a) {
695
- const w = pe.value.get(b);
692
+ a.length && ne.push(a);
693
+ const u = Qe(), d = ge.value, b = L.value + q.value, B = [];
694
+ for (const P of o) {
695
+ const w = pe.value.get(P);
696
696
  if (w == null) continue;
697
- const z = d.value[w];
698
- if (!z) continue;
699
- const ge = fe.value[w] ?? { x: 0, y: 0 }, mt = Pe.value[w] ?? v;
700
- x.push({
701
- id: b,
702
- item: z,
703
- fromX: ge.x,
704
- fromY: ge.y,
705
- width: v,
706
- height: mt,
697
+ const X = v.value[w];
698
+ if (!X) continue;
699
+ const Se = de.value[w] ?? { x: 0, y: 0 }, gt = Te.value[w] ?? d, Qt = Math.max(Se.y, b);
700
+ B.push({
701
+ id: P,
702
+ item: X,
703
+ fromX: Se.x,
704
+ fromY: Se.y,
705
+ toY: Qt + Math.max(0, gt),
706
+ width: d,
707
+ height: gt,
707
708
  leaving: !0
708
709
  });
709
710
  }
710
- if (x.length && (Y.value = [...Y.value, ...x]), d.value = d.value.filter((b) => {
711
- const w = b?.id;
712
- return !w || !a.has(w);
713
- }), await xt(), Je(f, a), x.length) {
714
- const b = new Set(x.map((w) => w.id));
715
- re(() => {
716
- Y.value = Y.value.map(
717
- (w) => b.has(w.id) ? { ...w, leaving: !1 } : w
711
+ if (B.length && (V.value = [...V.value, ...B]), v.value = v.value.filter((P) => {
712
+ const w = P?.id;
713
+ return !w || !o.has(w);
714
+ }), await Mt(), Ze(u, o), B.length) {
715
+ const P = new Set(B.map((w) => w.id));
716
+ ie(() => {
717
+ V.value = V.value.map(
718
+ (w) => P.has(w.id) ? { ...w, leaving: !1 } : w
718
719
  ), setTimeout(() => {
719
- Y.value = Y.value.filter((w) => !b.has(w.id));
720
- }, Ft);
720
+ V.value = V.value.filter((w) => !P.has(w.id));
721
+ }, Tt);
721
722
  });
722
723
  }
723
724
  }
724
- async function Ee(e) {
725
- return ot(e);
725
+ async function He(e) {
726
+ return rt(e);
726
727
  }
727
- function $t() {
728
- R += 1, Q = null, Z = null, K.value = !1, J.value = !1;
728
+ function Xt() {
729
+ C += 1, Z = null, ee = null, J.value = !1, Q.value = !1;
729
730
  }
730
731
  y({
731
- remove: ot,
732
- restore: qt,
733
- undo: Dt,
734
- forget: Ot,
735
- loadNextPage: it,
736
- cancel: $t,
732
+ remove: rt,
733
+ restore: Yt,
734
+ undo: $t,
735
+ forget: Vt,
736
+ loadNextPage: ct,
737
+ cancel: Xt,
737
738
  get pagesLoaded() {
738
739
  return D.value;
739
740
  },
@@ -741,123 +742,127 @@ const mn = { class: "hidden" }, hn = {
741
742
  D.value = e;
742
743
  },
743
744
  get nextPage() {
744
- return B.value;
745
+ return A.value;
745
746
  },
746
747
  set nextPage(e) {
747
- B.value = e;
748
+ A.value = e;
748
749
  },
749
750
  get isLoading() {
750
- return K.value || J.value;
751
+ return J.value || Q.value;
751
752
  },
752
753
  get hasReachedEnd() {
753
- return s.mode !== "backfill" ? B.value == null : B.value == null && xe.value.length === 0;
754
+ return s.mode !== "backfill" ? A.value == null : A.value == null && xe.value.length === 0;
754
755
  },
755
756
  get backfillStats() {
756
- return Be.value;
757
+ return Re.value;
757
758
  }
758
759
  });
759
- function st() {
760
- const e = dn({
761
- items: d.value,
762
- columnCount: Ne.value,
763
- columnWidth: he.value,
760
+ function it() {
761
+ const e = gn({
762
+ items: v.value,
763
+ columnCount: ze.value,
764
+ columnWidth: ge.value,
764
765
  gapX: ae.value,
765
- gapY: ze.value,
766
- headerHeight: oe.value,
767
- footerHeight: se.value,
768
- bucketPx: St
766
+ gapY: Oe.value,
767
+ headerHeight: se.value,
768
+ footerHeight: re.value,
769
+ bucketPx: kt
769
770
  });
770
- fe.value = e.positions, Pe.value = e.heights, Xe.value = e.buckets, je.value = e.contentHeight, pe.value = e.indexById;
771
+ de.value = e.positions, Te.value = e.heights, Ge.value = e.buckets, Ue.value = e.contentHeight, pe.value = e.indexById;
771
772
  }
772
- const rt = S(() => Math.max(je.value, q.value) + kn), Re = S(() => vn({
773
- itemCount: d.value.length,
773
+ const ut = M(() => Math.max(Ue.value, q.value) + _n), Ne = M(() => pn({
774
+ itemCount: v.value.length,
774
775
  viewportHeight: q.value,
775
- scrollTop: H.value,
776
+ scrollTop: L.value,
776
777
  overscanPx: s.overscanPx,
777
- bucketPx: St,
778
- buckets: Xe.value
778
+ bucketPx: kt,
779
+ buckets: Ge.value
779
780
  }));
780
- ne(
781
- Re,
781
+ le(
782
+ Ne,
782
783
  (e) => {
783
784
  if (!e?.length) return;
784
785
  const t = [];
785
- for (const a of e) {
786
- const o = d.value[a]?.id;
787
- o && G.value.has(o) && (ye.has(o) || (ye.add(o), t.push(o)));
786
+ for (const o of e) {
787
+ const a = v.value[o]?.id;
788
+ a && U.value.has(a) && (ye.has(a) || (ye.add(a), t.push(a)));
788
789
  }
789
790
  if (!t.length) return;
790
- const n = t.length > 1 ? Bt(s.enterStaggerMs) : 0;
791
+ const n = t.length > 1 ? Rt(s.enterStaggerMs) : 0;
791
792
  if (n > 0) {
792
- const a = new Map(de.value);
793
- for (let o = 0; o < t.length; o += 1) {
794
- const f = t[o], v = Math.min(o * n, Fn);
795
- a.set(f, v);
793
+ const o = new Map(ve.value);
794
+ for (let a = 0; a < t.length; a += 1) {
795
+ const u = t[a], d = Math.min(a * n, Bn);
796
+ o.set(u, d);
796
797
  }
797
- de.value = a;
798
+ ve.value = o;
798
799
  }
799
- re(() => {
800
- const a = new Set(U.value);
801
- for (const o of t) a.add(o);
802
- U.value = a;
803
- }), Nt(() => {
804
- const a = new Set(G.value);
805
- for (const o of t) a.delete(o);
806
- G.value = a, setTimeout(() => {
807
- const o = new Set(U.value), f = new Map(de.value);
808
- for (const v of t)
809
- o.delete(v), ye.delete(v), f.delete(v);
810
- U.value = o, de.value = f;
811
- }, kt);
800
+ ie(() => {
801
+ const o = new Set(K.value);
802
+ for (const a of t) o.add(a);
803
+ K.value = o;
804
+ }), zt(() => {
805
+ const o = new Set(U.value);
806
+ for (const a of t) o.delete(a);
807
+ U.value = o, setTimeout(() => {
808
+ const a = new Set(K.value), u = new Map(ve.value);
809
+ for (const d of t)
810
+ a.delete(d), ye.delete(d), u.delete(d);
811
+ K.value = a, ve.value = u;
812
+ }, Pt);
812
813
  });
813
814
  },
814
815
  { flush: "post" }
815
816
  );
816
- async function it() {
817
- if (Q) return Q;
818
- if (K.value || J.value || s.mode !== "backfill" && B.value == null || s.mode === "backfill" && B.value == null && xe.value.length === 0)
817
+ async function ct() {
818
+ if (Z) return Z;
819
+ if (J.value || Q.value || s.mode !== "backfill" && A.value == null || s.mode === "backfill" && A.value == null && xe.value.length === 0)
819
820
  return;
820
- const e = R;
821
+ const e = C;
821
822
  let t = null;
822
823
  return t = (async () => {
823
824
  try {
824
- if (J.value = !0, ie.value = "", s.mode === "backfill") {
825
- const o = await lt.loadBackfillBatch(B.value);
826
- if (e !== R) return;
827
- o.pages.length && (D.value = [...D.value, ...o.pages]), ue(o.batchItems), d.value = [...d.value, ...o.batchItems], B.value = o.nextPage;
825
+ if (Q.value = !0, ue.value = "", s.mode === "backfill") {
826
+ const a = await at.loadBackfillBatch(A.value);
827
+ if (e !== C) return;
828
+ a.pages.length && (D.value = [...D.value, ...a.pages]), ce(a.batchItems), v.value = [...v.value, ...a.batchItems], A.value = a.nextPage;
828
829
  return;
829
830
  }
830
- const n = B.value;
831
+ const n = A.value;
831
832
  if (n == null) return;
832
- const a = await at(n);
833
- if (e !== R) return;
834
- D.value = [...D.value, n], ue(a.items), d.value = [...d.value, ...a.items], B.value = a.nextPage;
833
+ const o = await st(n);
834
+ if (e !== C) return;
835
+ D.value = [...D.value, n], ce(o.items), v.value = [...v.value, ...o.items], A.value = o.nextPage;
835
836
  } catch (n) {
836
- if (e !== R || Qe(n)) return;
837
- ie.value = n instanceof Error ? n.message : String(n);
837
+ if (e !== C || et(n)) return;
838
+ ue.value = n instanceof Error ? n.message : String(n);
838
839
  } finally {
839
- e === R && (J.value = !1), Q === t && (Q = null);
840
+ e === C && (Q.value = !1), Z === t && (Z = null);
840
841
  }
841
- })(), Q = t, t;
842
+ })(), Z = t, t;
842
843
  }
843
- function Vt() {
844
+ function jt() {
844
845
  const e = _.value;
845
846
  if (!e) return;
846
- H.value = e.scrollTop, q.value = e.clientHeight, e.scrollHeight - (e.scrollTop + e.clientHeight) <= s.prefetchThresholdPx && it();
847
+ const t = e.scrollTop, n = e.clientHeight, o = e.scrollHeight;
848
+ L.value = t, q.value = n;
849
+ const a = Be, u = Ae, d = u > 0 && o < u;
850
+ if (Be = t, Ae = o, d && t <= a) return;
851
+ o - (t + n) <= s.prefetchThresholdPx && ct();
847
852
  }
848
- function ut() {
853
+ function ft() {
849
854
  return _.value;
850
855
  }
851
- function ct(e) {
852
- P.value = qe(e), q.value = e.clientHeight;
856
+ function dt(e) {
857
+ F.value = Ye(e), q.value = e.clientHeight;
853
858
  }
854
- function Yt() {
855
- typeof ResizeObserver > "u" || (le = new ResizeObserver(() => {
856
- const e = ut();
857
- e && ct(e);
859
+ function Wt() {
860
+ typeof ResizeObserver > "u" || (oe = new ResizeObserver(() => {
861
+ const e = ft();
862
+ e && dt(e);
858
863
  }));
859
864
  }
860
- function Xt() {
865
+ function Gt() {
861
866
  return {
862
867
  enabled: s.mode === "backfill",
863
868
  isBackfillActive: !1,
@@ -868,8 +873,8 @@ const mn = { class: "hidden" }, hn = {
868
873
  target: 0
869
874
  },
870
875
  cooldownMsRemaining: 0,
871
- cooldownMsTotal: Le(s.backfillRequestDelayMs),
872
- pageSize: _t(s.pageSize),
876
+ cooldownMsTotal: De(s.backfillRequestDelayMs),
877
+ pageSize: At(s.pageSize),
873
878
  bufferSize: 0,
874
879
  lastBatch: null,
875
880
  totals: {
@@ -878,120 +883,120 @@ const mn = { class: "hidden" }, hn = {
878
883
  }
879
884
  };
880
885
  }
881
- function ft() {
882
- R += 1, Q = null, Z = null, be = 0, ee.clear(), te.length = 0, G.value = /* @__PURE__ */ new Set(), U.value = /* @__PURE__ */ new Set(), ye.clear(), we.value = /* @__PURE__ */ new Map(), V.value = /* @__PURE__ */ new Set(), Y.value = [], D.value = [], B.value = null, xe.value = [], Be.value = Xt(), K.value = !0, J.value = !1, ie.value = "";
886
+ function vt() {
887
+ C += 1, Z = null, ee = null, Be = 0, Ae = 0, be = 0, te.clear(), ne.length = 0, U.value = /* @__PURE__ */ new Set(), K.value = /* @__PURE__ */ new Set(), ye.clear(), we.value = /* @__PURE__ */ new Map(), $.value = /* @__PURE__ */ new Set(), V.value = [], D.value = [], A.value = null, xe.value = [], Re.value = Gt(), J.value = !0, Q.value = !1, ue.value = "";
883
888
  }
884
- function dt(e) {
885
- ft(), d.value = [], B.value = e;
889
+ function mt(e) {
890
+ vt(), v.value = [], A.value = e;
886
891
  }
887
- function jt(e) {
888
- const t = Array.isArray(e) ? e : [e], n = [], a = /* @__PURE__ */ new Set();
889
- for (const o of t) {
890
- if (o == null) continue;
891
- const f = typeof o == "string" ? `s:${o}` : `n:${String(o)}`;
892
- a.has(f) || (a.add(f), n.push(o));
892
+ function Ut(e) {
893
+ const t = Array.isArray(e) ? e : [e], n = [], o = /* @__PURE__ */ new Set();
894
+ for (const a of t) {
895
+ if (a == null) continue;
896
+ const u = typeof a == "string" ? `s:${a}` : `n:${String(a)}`;
897
+ o.has(u) || (o.add(u), n.push(a));
893
898
  }
894
899
  return n;
895
900
  }
896
- function Ce(e) {
897
- ft(), D.value = e ? jt(e) : [], B.value = s.page, K.value = !1, Lt(d.value), ue(d.value);
901
+ function Le(e) {
902
+ vt(), D.value = e ? Ut(e) : [], A.value = s.page, J.value = !1, Dt(v.value), ce(v.value);
898
903
  }
899
- async function vt(e) {
900
- if (Z) return Z;
901
- const t = R;
904
+ async function ht(e) {
905
+ if (ee) return ee;
906
+ const t = C;
902
907
  let n = null;
903
908
  return n = (async () => {
904
909
  try {
905
910
  if (s.mode === "backfill") {
906
- const a = await lt.loadBackfillBatch(e);
907
- if (t !== R) return;
908
- D.value = a.pages.length ? a.pages : [e], ue(a.batchItems), d.value = a.batchItems, B.value = a.nextPage;
911
+ const o = await at.loadBackfillBatch(e);
912
+ if (t !== C) return;
913
+ D.value = o.pages.length ? o.pages : [e], ce(o.batchItems), v.value = o.batchItems, A.value = o.nextPage;
909
914
  } else {
910
- const a = await at(e);
911
- if (t !== R) return;
912
- D.value = [e], ue(a.items), d.value = a.items, B.value = a.nextPage;
915
+ const o = await st(e);
916
+ if (t !== C) return;
917
+ D.value = [e], ce(o.items), v.value = o.items, A.value = o.nextPage;
913
918
  }
914
- } catch (a) {
915
- if (t !== R || Qe(a)) return;
916
- ie.value = a instanceof Error ? a.message : String(a);
919
+ } catch (o) {
920
+ if (t !== C || et(o)) return;
921
+ ue.value = o instanceof Error ? o.message : String(o);
917
922
  } finally {
918
- t === R && (K.value = !1), Z === n && (Z = null);
923
+ t === C && (J.value = !1), ee === n && (ee = null);
919
924
  }
920
- })(), Z = n, n;
925
+ })(), ee = n, n;
921
926
  }
922
- function Wt() {
923
- const e = ut();
924
- e && (ct(e), H.value = e.scrollTop, le?.observe(e));
927
+ function Kt() {
928
+ const e = ft();
929
+ e && (dt(e), L.value = e.scrollTop, oe?.observe(e));
925
930
  }
926
- He(async () => {
927
- if (Yt(), Wt(), s.restoredPages != null) {
928
- me.value = !0, Ce(s.restoredPages);
931
+ qe(async () => {
932
+ if (Wt(), Kt(), s.restoredPages != null) {
933
+ he.value = !0, Le(s.restoredPages);
929
934
  return;
930
935
  }
931
- if (Me.value && d.value.length > 0) {
932
- me.value = !0, Ce();
936
+ if (Me.value && v.value.length > 0) {
937
+ he.value = !0, Le();
933
938
  return;
934
939
  }
935
- me.value = !1, dt(s.page), await vt(s.page);
936
- }), Pt(() => {
937
- le?.disconnect(), M && (clearTimeout(M), M = null), F && (clearTimeout(F), F = null), A(), N();
938
- }), ne(
940
+ he.value = !1, mt(s.page), await ht(s.page);
941
+ }), _t(() => {
942
+ oe?.disconnect(), x && (clearTimeout(x), x = null), k && (clearTimeout(k), k = null), E(), N();
943
+ }), le(
939
944
  () => s.page,
940
945
  async (e) => {
941
- if (me.value) {
942
- B.value = e;
946
+ if (he.value) {
947
+ A.value = e;
943
948
  return;
944
949
  }
945
- dt(e), await vt(e);
950
+ mt(e), await ht(e);
946
951
  }
947
- ), ne(
952
+ ), le(
948
953
  () => s.restoredPages,
949
954
  (e) => {
950
- e && (me.value = !0, Ce(e));
955
+ e && (he.value = !0, Le(e));
951
956
  }
952
- ), ne(
957
+ ), le(
953
958
  ae,
954
959
  () => {
955
960
  const e = _.value;
956
- e && (P.value = qe(e));
961
+ e && (F.value = Ye(e));
957
962
  },
958
963
  { immediate: !1 }
959
964
  );
960
- const Ne = S(() => rn(P.value, s.itemWidth)), he = S(
961
- () => un(P.value, Ne.value, s.itemWidth, ae.value)
965
+ const ze = M(() => dn(F.value, s.itemWidth)), ge = M(
966
+ () => vn(F.value, ze.value, s.itemWidth, ae.value)
962
967
  );
963
- ne(
964
- [Ne, he, ae, ze, oe, se],
968
+ le(
969
+ [ze, ge, ae, Oe, se, re],
965
970
  () => {
966
- st();
971
+ it();
967
972
  },
968
973
  { immediate: !0 }
969
- ), ne(
974
+ ), le(
970
975
  // Performance note: this component targets very large arrays (e.g. 10k items).
971
976
  // Avoid deep watchers over items; rebuild layout only when the list structure
972
977
  // changes (new array reference or length change). This keeps metadata-only
973
978
  // updates (e.g. reactions) cheap.
974
- () => [d.value, d.value.length],
975
- () => st(),
979
+ () => [v.value, v.value.length],
980
+ () => it(),
976
981
  { immediate: !0 }
977
982
  );
978
- const Gt = S(() => [
983
+ const Jt = M(() => [
979
984
  "mt-8 flex min-h-0 flex-1 flex-col rounded-2xl border border-slate-200/70 bg-white/70 p-5 shadow-sm backdrop-blur",
980
985
  m.class
981
986
  ]);
982
- return (e, t) => (k(), I("section", Qt(O.value, { class: Gt.value }), [
983
- T("div", mn, [
984
- Zt(e.$slots, "default")
987
+ return (e, t) => (I(), S("section", nn(O.value, { class: Jt.value }), [
988
+ T("div", yn, [
989
+ ln(e.$slots, "default")
985
990
  ]),
986
991
  T("div", {
987
992
  ref_key: "scrollViewportRef",
988
993
  ref: _,
989
994
  "data-testid": "items-scroll-container",
990
995
  class: "mt-4 min-h-0 flex-1 overflow-auto",
991
- style: $({ paddingRight: ae.value + "px" }),
992
- onScroll: Vt
996
+ style: Y({ paddingRight: ae.value + "px" }),
997
+ onScroll: jt
993
998
  }, [
994
- K.value ? (k(), I("div", hn, t[0] || (t[0] = [
999
+ J.value ? (I(), S("div", wn, t[0] || (t[0] = [
995
1000
  T("div", { class: "inline-flex items-center gap-3 text-sm text-slate-600" }, [
996
1001
  T("svg", {
997
1002
  class: "h-5 w-5 animate-spin text-slate-500",
@@ -1015,108 +1020,108 @@ const mn = { class: "hidden" }, hn = {
1015
1020
  ]),
1016
1021
  T("span", null, "Loading…")
1017
1022
  ], -1)
1018
- ]))) : ie.value ? (k(), I("p", gn, "Error: " + pt(ie.value), 1)) : (k(), I("div", {
1023
+ ]))) : ue.value ? (I(), S("p", xn, "Error: " + wt(ue.value), 1)) : (I(), S("div", {
1019
1024
  key: 2,
1020
1025
  class: "relative",
1021
- style: $({ height: rt.value + "px" })
1026
+ style: Y({ height: ut.value + "px" })
1022
1027
  }, [
1023
- (k(!0), I(yt, null, wt(Re.value, (n) => (k(), I("article", {
1024
- key: d.value[n].id,
1028
+ (I(!0), S(xt, null, bt(Ne.value, (n) => (I(), S("article", {
1029
+ key: v.value[n].id,
1025
1030
  "data-testid": "item-card",
1026
1031
  class: "absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
1027
- style: $({
1028
- width: he.value + "px",
1029
- transition: Rt(d.value[n].id),
1030
- transitionDelay: At(d.value[n].id),
1031
- transform: Ct(n)
1032
+ style: Y({
1033
+ width: ge.value + "px",
1034
+ transition: Nt(v.value[n].id),
1035
+ transitionDelay: Ct(v.value[n].id),
1036
+ transform: Lt(n)
1032
1037
  })
1033
1038
  }, [
1034
- De.value || oe.value > 0 ? (k(), I("div", {
1039
+ $e.value || se.value > 0 ? (I(), S("div", {
1035
1040
  key: 0,
1036
1041
  "data-testid": "item-header-container",
1037
1042
  class: "w-full",
1038
- style: $(Ve.value)
1043
+ style: Y(je.value)
1039
1044
  }, [
1040
- X(ce(c), {
1041
- "slot-fn": Ie.value,
1042
- "slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
1045
+ j(fe(f), {
1046
+ "slot-fn": ke.value,
1047
+ "slot-props": { item: v.value[n], remove: () => He(v.value[n]) }
1043
1048
  }, null, 8, ["slot-fn", "slot-props"])
1044
- ], 4)) : j("", !0),
1045
- T("div", pn, [
1046
- X(bt, {
1047
- item: d.value[n],
1048
- onSuccess: C,
1049
- onError: W
1049
+ ], 4)) : W("", !0),
1050
+ T("div", bn, [
1051
+ j(St, {
1052
+ item: v.value[n],
1053
+ onSuccess: H,
1054
+ onError: G
1050
1055
  }, null, 8, ["item"]),
1051
- $e.value ? (k(), I("div", yn, [
1052
- X(ce(c), {
1053
- "slot-fn": Fe.value,
1054
- "slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
1056
+ Xe.value ? (I(), S("div", Mn, [
1057
+ j(fe(f), {
1058
+ "slot-fn": Pe.value,
1059
+ "slot-props": { item: v.value[n], remove: () => He(v.value[n]) }
1055
1060
  }, null, 8, ["slot-fn", "slot-props"])
1056
- ])) : j("", !0)
1061
+ ])) : W("", !0)
1057
1062
  ]),
1058
- Oe.value || se.value > 0 ? (k(), I("div", {
1063
+ Ve.value || re.value > 0 ? (I(), S("div", {
1059
1064
  key: 1,
1060
1065
  "data-testid": "item-footer-container",
1061
1066
  class: "w-full",
1062
- style: $(Ye.value)
1067
+ style: Y(We.value)
1063
1068
  }, [
1064
- X(ce(c), {
1065
- "slot-fn": ke.value,
1066
- "slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
1069
+ j(fe(f), {
1070
+ "slot-fn": Fe.value,
1071
+ "slot-props": { item: v.value[n], remove: () => He(v.value[n]) }
1067
1072
  }, null, 8, ["slot-fn", "slot-props"])
1068
- ], 4)) : j("", !0)
1073
+ ], 4)) : W("", !0)
1069
1074
  ], 4))), 128)),
1070
- (k(!0), I(yt, null, wt(Y.value, (n) => (k(), I("article", {
1075
+ (I(!0), S(xt, null, bt(V.value, (n) => (I(), S("article", {
1071
1076
  key: n.id + ":leaving",
1072
1077
  "data-testid": "item-card-leaving",
1073
1078
  class: "pointer-events-none absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
1074
- style: $({
1079
+ style: Y({
1075
1080
  width: n.width + "px",
1076
- transition: "transform " + Ft + "ms ease-out",
1077
- transform: n.leaving ? "translate3d(" + n.fromX + "px," + n.fromY + "px,0)" : "translate3d(" + n.fromX + "px," + We(n.height) + "px,0)"
1081
+ transition: "transform " + Tt + "ms ease-out",
1082
+ transform: n.leaving ? "translate3d(" + n.fromX + "px," + n.fromY + "px,0)" : "translate3d(" + n.fromX + "px," + n.toY + "px,0)"
1078
1083
  })
1079
1084
  }, [
1080
- De.value || oe.value > 0 ? (k(), I("div", {
1085
+ $e.value || se.value > 0 ? (I(), S("div", {
1081
1086
  key: 0,
1082
1087
  "data-testid": "item-header-container",
1083
1088
  class: "w-full",
1084
- style: $(Ve.value)
1089
+ style: Y(je.value)
1085
1090
  }, [
1086
- X(ce(c), {
1087
- "slot-fn": Ie.value,
1091
+ j(fe(f), {
1092
+ "slot-fn": ke.value,
1088
1093
  "slot-props": { item: n.item, remove: () => {
1089
1094
  } }
1090
1095
  }, null, 8, ["slot-fn", "slot-props"])
1091
- ], 4)) : j("", !0),
1092
- T("div", wn, [
1093
- X(bt, {
1096
+ ], 4)) : W("", !0),
1097
+ T("div", Sn, [
1098
+ j(St, {
1094
1099
  item: n.item
1095
1100
  }, null, 8, ["item"]),
1096
- $e.value ? (k(), I("div", xn, [
1097
- X(ce(c), {
1098
- "slot-fn": Fe.value,
1101
+ Xe.value ? (I(), S("div", In, [
1102
+ j(fe(f), {
1103
+ "slot-fn": Pe.value,
1099
1104
  "slot-props": { item: n.item, remove: () => {
1100
1105
  } }
1101
1106
  }, null, 8, ["slot-fn", "slot-props"])
1102
- ])) : j("", !0)
1107
+ ])) : W("", !0)
1103
1108
  ]),
1104
- Oe.value || se.value > 0 ? (k(), I("div", {
1109
+ Ve.value || re.value > 0 ? (I(), S("div", {
1105
1110
  key: 1,
1106
1111
  "data-testid": "item-footer-container",
1107
1112
  class: "w-full",
1108
- style: $(Ye.value)
1113
+ style: Y(We.value)
1109
1114
  }, [
1110
- X(ce(c), {
1111
- "slot-fn": ke.value,
1115
+ j(fe(f), {
1116
+ "slot-fn": Fe.value,
1112
1117
  "slot-props": { item: n.item, remove: () => {
1113
1118
  } }
1114
1119
  }, null, 8, ["slot-fn", "slot-props"])
1115
- ], 4)) : j("", !0)
1120
+ ], 4)) : W("", !0)
1116
1121
  ], 4))), 128))
1117
1122
  ], 4)),
1118
- T("div", bn, [
1119
- J.value ? (k(), I("span", Mn, t[1] || (t[1] = [
1123
+ T("div", kn, [
1124
+ Q.value ? (I(), S("span", Fn, t[1] || (t[1] = [
1120
1125
  T("svg", {
1121
1126
  class: "h-4 w-4 animate-spin text-slate-500",
1122
1127
  viewBox: "0 0 24 24",
@@ -1138,21 +1143,21 @@ const mn = { class: "hidden" }, hn = {
1138
1143
  })
1139
1144
  ], -1),
1140
1145
  T("span", null, "Loading more…", -1)
1141
- ]))) : B.value == null ? (k(), I("span", Sn, "End of list")) : (k(), I("span", In, "Scroll to load page " + pt(B.value), 1))
1146
+ ]))) : A.value == null ? (I(), S("span", Pn, "End of list")) : (I(), S("span", Tn, "Scroll to load page " + wt(A.value), 1))
1142
1147
  ])
1143
1148
  ], 36)
1144
1149
  ], 16));
1145
1150
  }
1146
- }), Bn = Se({
1151
+ }), Cn = Ie({
1147
1152
  name: "MasonryItem",
1148
- setup(l, { slots: y, attrs: u }) {
1149
- const s = en(Tt, null);
1153
+ setup(l, { slots: y, attrs: c }) {
1154
+ const s = on(Bt, null);
1150
1155
  if (!s)
1151
1156
  return () => null;
1152
- const i = u.onPreloaded, m = u.onFailed, c = y.overlay, r = y.default;
1157
+ const i = c.onPreloaded, m = c.onFailed, f = y.overlay, r = y.default;
1153
1158
  return s({
1154
1159
  header: y.header,
1155
- overlay: c ?? r,
1160
+ overlay: f ?? r,
1156
1161
  footer: y.footer,
1157
1162
  onPreloaded: typeof i == "function" ? i : Array.isArray(i) ? (h) => {
1158
1163
  for (const g of i)
@@ -1164,14 +1169,14 @@ const mn = { class: "hidden" }, hn = {
1164
1169
  } : void 0
1165
1170
  }), () => null;
1166
1171
  }
1167
- }), En = {
1172
+ }), Nn = {
1168
1173
  install(l) {
1169
- l.component("Masonry", _n), l.component("MasonryItem", Bn);
1174
+ l.component("Masonry", Rn), l.component("MasonryItem", Cn);
1170
1175
  }
1171
1176
  };
1172
1177
  export {
1173
- _n as Masonry,
1174
- Bn as MasonryItem,
1175
- En as VibePlugin,
1176
- tn as masonryDefaults
1178
+ Rn as Masonry,
1179
+ Cn as MasonryItem,
1180
+ Nn as VibePlugin,
1181
+ an as masonryDefaults
1177
1182
  };