@wyxos/vibe 2.1.6 → 2.1.8

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