@wyxos/vibe 1.6.19 → 1.6.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,21 +1,21 @@
1
- import { nextTick as J, defineComponent as tt, ref as T, computed as Z, onMounted as at, onUnmounted as nt, watch as re, createElementBlock as D, openBlock as F, createCommentVNode as ne, createElementVNode as O, normalizeStyle as we, renderSlot as Q, normalizeClass as ue, withModifiers as _e, toDisplayString as He, Fragment as Ue, renderList as Ge, createVNode as $e, withCtx as ge, mergeProps as pe, TransitionGroup as Tt, unref as Lt } from "vue";
2
- let Se = null;
3
- function kt() {
4
- if (Se != null) return Se;
1
+ import { nextTick as G, defineComponent as lt, ref as T, computed as te, onMounted as rt, onUnmounted as ot, watch as oe, createElementBlock as B, openBlock as D, createCommentVNode as le, createElementVNode as j, normalizeStyle as Me, renderSlot as ee, normalizeClass as de, withModifiers as Xe, toDisplayString as Ae, Fragment as Je, renderList as Ke, createVNode as He, withCtx as we, mergeProps as xe, TransitionGroup as St, unref as $t } from "vue";
2
+ let Ne = null;
3
+ function Ht() {
4
+ if (Ne != null) return Ne;
5
5
  const t = document.createElement("div");
6
6
  t.style.visibility = "hidden", t.style.overflow = "scroll", t.style.msOverflowStyle = "scrollbar", t.style.width = "100px", t.style.height = "100px", document.body.appendChild(t);
7
7
  const v = document.createElement("div");
8
8
  v.style.width = "100%", t.appendChild(v);
9
9
  const c = t.offsetWidth - v.offsetWidth;
10
- return document.body.removeChild(t), Se = c, c;
10
+ return document.body.removeChild(t), Ne = c, c;
11
11
  }
12
- function Xe(t, v, c, r = {}) {
12
+ function Qe(t, v, c, i = {}) {
13
13
  const {
14
- gutterX: L = 0,
14
+ gutterX: I = 0,
15
15
  gutterY: p = 0,
16
- header: l = 0,
17
- footer: s = 0,
18
- paddingLeft: b = 0,
16
+ header: r = 0,
17
+ footer: u = 0,
18
+ paddingLeft: x = 0,
19
19
  paddingRight: E = 0,
20
20
  sizes: S = {
21
21
  base: 1,
@@ -25,195 +25,195 @@ function Xe(t, v, c, r = {}) {
25
25
  xl: 5,
26
26
  "2xl": 6
27
27
  },
28
- placement: I = "masonry"
29
- } = r;
30
- let d = 0, W = 0;
28
+ placement: k = "masonry"
29
+ } = i;
30
+ let d = 0, A = 0;
31
31
  try {
32
32
  if (v && v.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
33
33
  const w = window.getComputedStyle(v);
34
- d = parseFloat(w.paddingLeft) || 0, W = parseFloat(w.paddingRight) || 0;
34
+ d = parseFloat(w.paddingLeft) || 0, A = parseFloat(w.paddingRight) || 0;
35
35
  }
36
36
  } catch {
37
37
  }
38
- const R = (b || 0) + d, q = (E || 0) + W, g = v.offsetWidth - v.clientWidth, o = g > 0 ? g + 2 : kt() + 2, $ = v.offsetWidth - o - R - q, y = L * (c - 1), x = Math.floor(($ - y) / c), H = t.map((w) => {
39
- const M = w.width, j = w.height;
40
- return Math.round(x * j / M) + s + l;
38
+ const C = (x || 0) + d, U = (E || 0) + A, g = v.offsetWidth - v.clientWidth, o = g > 0 ? g + 2 : Ht() + 2, P = v.offsetWidth - o - C - U, y = I * (c - 1), b = Math.floor((P - y) / c), H = t.map((w) => {
39
+ const M = w.width, q = w.height;
40
+ return Math.round(b * q / M) + u + r;
41
41
  });
42
- if (I === "sequential-balanced") {
42
+ if (k === "sequential-balanced") {
43
43
  const w = H.length;
44
44
  if (w === 0) return [];
45
- const M = (k, z, K) => k + (z > 0 ? p : 0) + K;
46
- let j = Math.max(...H), n = H.reduce((k, z) => k + z, 0) + p * Math.max(0, w - 1);
47
- const f = (k) => {
48
- let z = 1, K = 0, G = 0;
49
- for (let X = 0; X < w; X++) {
50
- const ee = H[X], te = M(K, G, ee);
51
- if (te <= k)
52
- K = te, G++;
53
- else if (z++, K = ee, G = 1, ee > k || z > c) return !1;
45
+ const M = (L, O, Q) => L + (O > 0 ? p : 0) + Q;
46
+ let q = Math.max(...H), n = H.reduce((L, O) => L + O, 0) + p * Math.max(0, w - 1);
47
+ const f = (L) => {
48
+ let O = 1, Q = 0, J = 0;
49
+ for (let K = 0; K < w; K++) {
50
+ const ae = H[K], ne = M(Q, J, ae);
51
+ if (ne <= L)
52
+ Q = ne, J++;
53
+ else if (O++, Q = ae, J = 1, ae > L || O > c) return !1;
54
54
  }
55
- return z <= c;
55
+ return O <= c;
56
56
  };
57
- for (; j < n; ) {
58
- const k = Math.floor((j + n) / 2);
59
- f(k) ? n = k : j = k + 1;
57
+ for (; q < n; ) {
58
+ const L = Math.floor((q + n) / 2);
59
+ f(L) ? n = L : q = L + 1;
60
60
  }
61
- const P = n, A = new Array(c).fill(0);
62
- let U = c - 1, C = 0, N = 0;
63
- for (let k = w - 1; k >= 0; k--) {
64
- const z = H[k], K = k < U;
65
- !(M(C, N, z) <= P) || K ? (A[U] = k + 1, U--, C = z, N = 1) : (C = M(C, N, z), N++);
61
+ const $ = n, R = new Array(c).fill(0);
62
+ let X = c - 1, Y = 0, N = 0;
63
+ for (let L = w - 1; L >= 0; L--) {
64
+ const O = H[L], Q = L < X;
65
+ !(M(Y, N, O) <= $) || Q ? (R[X] = L + 1, X--, Y = O, N = 1) : (Y = M(Y, N, O), N++);
66
66
  }
67
- A[0] = 0;
68
- const oe = [], ie = new Array(c).fill(0);
69
- for (let k = 0; k < c; k++) {
70
- const z = A[k], K = k + 1 < c ? A[k + 1] : w, G = k * (x + L);
71
- for (let X = z; X < K; X++) {
72
- const te = {
73
- ...t[X],
74
- columnWidth: x,
67
+ R[0] = 0;
68
+ const ie = [], se = new Array(c).fill(0);
69
+ for (let L = 0; L < c; L++) {
70
+ const O = R[L], Q = L + 1 < c ? R[L + 1] : w, J = L * (b + I);
71
+ for (let K = O; K < Q; K++) {
72
+ const ne = {
73
+ ...t[K],
74
+ columnWidth: b,
75
75
  imageHeight: 0,
76
76
  columnHeight: 0,
77
77
  left: 0,
78
78
  top: 0
79
79
  };
80
- te.imageHeight = H[X] - (s + l), te.columnHeight = H[X], te.left = G, te.top = ie[k], ie[k] += te.columnHeight + (X + 1 < K ? p : 0), oe.push(te);
80
+ ne.imageHeight = H[K] - (u + r), ne.columnHeight = H[K], ne.left = J, ne.top = se[L], se[L] += ne.columnHeight + (K + 1 < Q ? p : 0), ie.push(ne);
81
81
  }
82
82
  }
83
- return oe;
83
+ return ie;
84
84
  }
85
- const h = new Array(c).fill(0), B = [];
85
+ const h = new Array(c).fill(0), z = [];
86
86
  for (let w = 0; w < t.length; w++) {
87
- const M = t[w], j = {
87
+ const M = t[w], q = {
88
88
  ...M,
89
89
  columnWidth: 0,
90
90
  imageHeight: 0,
91
91
  columnHeight: 0,
92
92
  left: 0,
93
93
  top: 0
94
- }, n = h.indexOf(Math.min(...h)), f = M.width, P = M.height;
95
- j.columnWidth = x, j.left = n * (x + L), j.imageHeight = Math.round(x * P / f), j.columnHeight = j.imageHeight + s + l, j.top = h[n], h[n] += j.columnHeight + p, B.push(j);
94
+ }, n = h.indexOf(Math.min(...h)), f = M.width, $ = M.height;
95
+ q.columnWidth = b, q.left = n * (b + I), q.imageHeight = Math.round(b * $ / f), q.columnHeight = q.imageHeight + u + r, q.top = h[n], h[n] += q.columnHeight + p, z.push(q);
96
96
  }
97
- return B;
97
+ return z;
98
98
  }
99
- var It = typeof global == "object" && global && global.Object === Object && global, $t = typeof self == "object" && self && self.Object === Object && self, lt = It || $t || Function("return this")(), xe = lt.Symbol, rt = Object.prototype, St = rt.hasOwnProperty, Pt = rt.toString, ye = xe ? xe.toStringTag : void 0;
100
- function Ht(t) {
101
- var v = St.call(t, ye), c = t[ye];
99
+ var Nt = typeof global == "object" && global && global.Object === Object && global, Ft = typeof self == "object" && self && self.Object === Object && self, it = Nt || Ft || Function("return this")(), Te = it.Symbol, st = Object.prototype, At = st.hasOwnProperty, Wt = st.toString, be = Te ? Te.toStringTag : void 0;
100
+ function Bt(t) {
101
+ var v = At.call(t, be), c = t[be];
102
102
  try {
103
- t[ye] = void 0;
104
- var r = !0;
103
+ t[be] = void 0;
104
+ var i = !0;
105
105
  } catch {
106
106
  }
107
- var L = Pt.call(t);
108
- return r && (v ? t[ye] = c : delete t[ye]), L;
107
+ var I = Wt.call(t);
108
+ return i && (v ? t[be] = c : delete t[be]), I;
109
109
  }
110
- var Nt = Object.prototype, Wt = Nt.toString;
111
- function Dt(t) {
112
- return Wt.call(t);
110
+ var Dt = Object.prototype, zt = Dt.toString;
111
+ function Ot(t) {
112
+ return zt.call(t);
113
113
  }
114
- var Ft = "[object Null]", Bt = "[object Undefined]", Je = xe ? xe.toStringTag : void 0;
115
- function zt(t) {
116
- return t == null ? t === void 0 ? Bt : Ft : Je && Je in Object(t) ? Ht(t) : Dt(t);
114
+ var Rt = "[object Null]", jt = "[object Undefined]", Ze = Te ? Te.toStringTag : void 0;
115
+ function Ct(t) {
116
+ return t == null ? t === void 0 ? jt : Rt : Ze && Ze in Object(t) ? Bt(t) : Ot(t);
117
117
  }
118
- function At(t) {
118
+ function qt(t) {
119
119
  return t != null && typeof t == "object";
120
120
  }
121
- var Ot = "[object Symbol]";
122
- function Rt(t) {
123
- return typeof t == "symbol" || At(t) && zt(t) == Ot;
121
+ var Yt = "[object Symbol]";
122
+ function Vt(t) {
123
+ return typeof t == "symbol" || qt(t) && Ct(t) == Yt;
124
124
  }
125
- var jt = /\s/;
126
- function Ct(t) {
127
- for (var v = t.length; v-- && jt.test(t.charAt(v)); )
125
+ var Ut = /\s/;
126
+ function _t(t) {
127
+ for (var v = t.length; v-- && Ut.test(t.charAt(v)); )
128
128
  ;
129
129
  return v;
130
130
  }
131
- var Yt = /^\s+/;
132
- function qt(t) {
133
- return t && t.slice(0, Ct(t) + 1).replace(Yt, "");
131
+ var Gt = /^\s+/;
132
+ function Xt(t) {
133
+ return t && t.slice(0, _t(t) + 1).replace(Gt, "");
134
134
  }
135
- function Ne(t) {
135
+ function We(t) {
136
136
  var v = typeof t;
137
137
  return t != null && (v == "object" || v == "function");
138
138
  }
139
- var Ke = NaN, Vt = /^[-+]0x[0-9a-f]+$/i, _t = /^0b[01]+$/i, Ut = /^0o[0-7]+$/i, Gt = parseInt;
140
- function Qe(t) {
139
+ var et = NaN, Jt = /^[-+]0x[0-9a-f]+$/i, Kt = /^0b[01]+$/i, Qt = /^0o[0-7]+$/i, Zt = parseInt;
140
+ function tt(t) {
141
141
  if (typeof t == "number")
142
142
  return t;
143
- if (Rt(t))
144
- return Ke;
145
- if (Ne(t)) {
143
+ if (Vt(t))
144
+ return et;
145
+ if (We(t)) {
146
146
  var v = typeof t.valueOf == "function" ? t.valueOf() : t;
147
- t = Ne(v) ? v + "" : v;
147
+ t = We(v) ? v + "" : v;
148
148
  }
149
149
  if (typeof t != "string")
150
150
  return t === 0 ? t : +t;
151
- t = qt(t);
152
- var c = _t.test(t);
153
- return c || Ut.test(t) ? Gt(t.slice(2), c ? 2 : 8) : Vt.test(t) ? Ke : +t;
151
+ t = Xt(t);
152
+ var c = Kt.test(t);
153
+ return c || Qt.test(t) ? Zt(t.slice(2), c ? 2 : 8) : Jt.test(t) ? et : +t;
154
154
  }
155
- var Pe = function() {
156
- return lt.Date.now();
157
- }, Xt = "Expected a function", Jt = Math.max, Kt = Math.min;
158
- function Ze(t, v, c) {
159
- var r, L, p, l, s, b, E = 0, S = !1, I = !1, d = !0;
155
+ var Fe = function() {
156
+ return it.Date.now();
157
+ }, ea = "Expected a function", ta = Math.max, aa = Math.min;
158
+ function at(t, v, c) {
159
+ var i, I, p, r, u, x, E = 0, S = !1, k = !1, d = !0;
160
160
  if (typeof t != "function")
161
- throw new TypeError(Xt);
162
- v = Qe(v) || 0, Ne(c) && (S = !!c.leading, I = "maxWait" in c, p = I ? Jt(Qe(c.maxWait) || 0, v) : p, d = "trailing" in c ? !!c.trailing : d);
163
- function W(h) {
164
- var B = r, w = L;
165
- return r = L = void 0, E = h, l = t.apply(w, B), l;
161
+ throw new TypeError(ea);
162
+ v = tt(v) || 0, We(c) && (S = !!c.leading, k = "maxWait" in c, p = k ? ta(tt(c.maxWait) || 0, v) : p, d = "trailing" in c ? !!c.trailing : d);
163
+ function A(h) {
164
+ var z = i, w = I;
165
+ return i = I = void 0, E = h, r = t.apply(w, z), r;
166
166
  }
167
- function R(h) {
168
- return E = h, s = setTimeout(o, v), S ? W(h) : l;
167
+ function C(h) {
168
+ return E = h, u = setTimeout(o, v), S ? A(h) : r;
169
169
  }
170
- function q(h) {
171
- var B = h - b, w = h - E, M = v - B;
172
- return I ? Kt(M, p - w) : M;
170
+ function U(h) {
171
+ var z = h - x, w = h - E, M = v - z;
172
+ return k ? aa(M, p - w) : M;
173
173
  }
174
174
  function g(h) {
175
- var B = h - b, w = h - E;
176
- return b === void 0 || B >= v || B < 0 || I && w >= p;
175
+ var z = h - x, w = h - E;
176
+ return x === void 0 || z >= v || z < 0 || k && w >= p;
177
177
  }
178
178
  function o() {
179
- var h = Pe();
179
+ var h = Fe();
180
180
  if (g(h))
181
- return $(h);
182
- s = setTimeout(o, q(h));
181
+ return P(h);
182
+ u = setTimeout(o, U(h));
183
183
  }
184
- function $(h) {
185
- return s = void 0, d && r ? W(h) : (r = L = void 0, l);
184
+ function P(h) {
185
+ return u = void 0, d && i ? A(h) : (i = I = void 0, r);
186
186
  }
187
187
  function y() {
188
- s !== void 0 && clearTimeout(s), E = 0, r = b = L = s = void 0;
188
+ u !== void 0 && clearTimeout(u), E = 0, i = x = I = u = void 0;
189
189
  }
190
- function x() {
191
- return s === void 0 ? l : $(Pe());
190
+ function b() {
191
+ return u === void 0 ? r : P(Fe());
192
192
  }
193
193
  function H() {
194
- var h = Pe(), B = g(h);
195
- if (r = arguments, L = this, b = h, B) {
196
- if (s === void 0)
197
- return R(b);
198
- if (I)
199
- return clearTimeout(s), s = setTimeout(o, v), W(b);
194
+ var h = Fe(), z = g(h);
195
+ if (i = arguments, I = this, x = h, z) {
196
+ if (u === void 0)
197
+ return C(x);
198
+ if (k)
199
+ return clearTimeout(u), u = setTimeout(o, v), A(x);
200
200
  }
201
- return s === void 0 && (s = setTimeout(o, v)), l;
201
+ return u === void 0 && (u = setTimeout(o, v)), r;
202
202
  }
203
- return H.cancel = y, H.flush = x, H;
203
+ return H.cancel = y, H.flush = b, H;
204
204
  }
205
- function fe(t, v) {
206
- const c = v ?? (typeof window < "u" ? window.innerWidth : 1024), r = t.sizes;
207
- return c >= 1536 && r["2xl"] ? r["2xl"] : c >= 1280 && r.xl ? r.xl : c >= 1024 && r.lg ? r.lg : c >= 768 && r.md ? r.md : c >= 640 && r.sm ? r.sm : r.base;
205
+ function he(t, v) {
206
+ const c = v ?? (typeof window < "u" ? window.innerWidth : 1024), i = t.sizes;
207
+ return c >= 1536 && i["2xl"] ? i["2xl"] : c >= 1280 && i.xl ? i.xl : c >= 1024 && i.lg ? i.lg : c >= 768 && i.md ? i.md : c >= 640 && i.sm ? i.sm : i.base;
208
208
  }
209
- function Qt(t) {
209
+ function na(t) {
210
210
  const v = t ?? (typeof window < "u" ? window.innerWidth : 1024);
211
211
  return v >= 1536 ? "2xl" : v >= 1280 ? "xl" : v >= 1024 ? "lg" : v >= 768 ? "md" : v >= 640 ? "sm" : "base";
212
212
  }
213
- function Zt(t) {
214
- return t.reduce((c, r) => Math.max(c, r.top + r.columnHeight), 0) + 500;
213
+ function la(t) {
214
+ return t.reduce((c, i) => Math.max(c, i.top + i.columnHeight), 0) + 500;
215
215
  }
216
- function ea(t) {
216
+ function ra(t) {
217
217
  return {
218
218
  transform: `translate3d(${t.left}px, ${t.top}px, 0)`,
219
219
  top: "0px",
@@ -222,114 +222,114 @@ function ea(t) {
222
222
  height: `${t.columnHeight}px`
223
223
  };
224
224
  }
225
- function ta(t, v = 0) {
225
+ function oa(t, v = 0) {
226
226
  return {
227
- style: ea(t),
227
+ style: ra(t),
228
228
  "data-top": t.top,
229
229
  "data-left": t.left,
230
230
  "data-id": `${t.page}-${t.id}`,
231
231
  "data-index": v
232
232
  };
233
233
  }
234
- function We(t, v) {
234
+ function Be(t, v) {
235
235
  if (!t.length || v <= 0)
236
236
  return new Array(Math.max(1, v)).fill(0);
237
- const r = Array.from(new Set(t.map((l) => l.left))).sort((l, s) => l - s).slice(0, v), L = /* @__PURE__ */ new Map();
238
- for (let l = 0; l < r.length; l++) L.set(r[l], l);
239
- const p = new Array(r.length).fill(0);
240
- for (const l of t) {
241
- const s = L.get(l.left);
242
- s != null && (p[s] = Math.max(p[s], l.top + l.columnHeight));
237
+ const i = Array.from(new Set(t.map((r) => r.left))).sort((r, u) => r - u).slice(0, v), I = /* @__PURE__ */ new Map();
238
+ for (let r = 0; r < i.length; r++) I.set(i[r], r);
239
+ const p = new Array(i.length).fill(0);
240
+ for (const r of t) {
241
+ const u = I.get(r.left);
242
+ u != null && (p[u] = Math.max(p[u], r.top + r.columnHeight));
243
243
  }
244
244
  for (; p.length < v; ) p.push(0);
245
245
  return p;
246
246
  }
247
- function aa(t, v) {
248
- function c(l, s) {
249
- const b = parseInt(l.dataset.left || "0", 10), E = parseInt(l.dataset.top || "0", 10), S = parseInt(l.dataset.index || "0", 10), I = Math.min(S * 20, 160), d = l.style.getPropertyValue("--masonry-opacity-delay");
250
- l.style.setProperty("--masonry-opacity-delay", `${I}ms`), requestAnimationFrame(() => {
251
- l.style.opacity = "1", l.style.transform = `translate3d(${b}px, ${E}px, 0) scale(1)`;
252
- const W = () => {
253
- d ? l.style.setProperty("--masonry-opacity-delay", d) : l.style.removeProperty("--masonry-opacity-delay"), l.removeEventListener("transitionend", W), s();
247
+ function ia(t, v) {
248
+ function c(r, u) {
249
+ const x = parseInt(r.dataset.left || "0", 10), E = parseInt(r.dataset.top || "0", 10), S = parseInt(r.dataset.index || "0", 10), k = Math.min(S * 20, 160), d = r.style.getPropertyValue("--masonry-opacity-delay");
250
+ r.style.setProperty("--masonry-opacity-delay", `${k}ms`), requestAnimationFrame(() => {
251
+ r.style.opacity = "1", r.style.transform = `translate3d(${x}px, ${E}px, 0) scale(1)`;
252
+ const A = () => {
253
+ d ? r.style.setProperty("--masonry-opacity-delay", d) : r.style.removeProperty("--masonry-opacity-delay"), r.removeEventListener("transitionend", A), u();
254
254
  };
255
- l.addEventListener("transitionend", W);
255
+ r.addEventListener("transitionend", A);
256
256
  });
257
257
  }
258
- function r(l) {
259
- const s = parseInt(l.dataset.left || "0", 10), b = parseInt(l.dataset.top || "0", 10);
260
- l.style.opacity = "0", l.style.transform = `translate3d(${s}px, ${b + 10}px, 0) scale(0.985)`;
258
+ function i(r) {
259
+ const u = parseInt(r.dataset.left || "0", 10), x = parseInt(r.dataset.top || "0", 10);
260
+ r.style.opacity = "0", r.style.transform = `translate3d(${u}px, ${x + 10}px, 0) scale(0.985)`;
261
261
  }
262
- function L(l) {
263
- const s = parseInt(l.dataset.left || "0", 10), b = parseInt(l.dataset.top || "0", 10);
264
- l.style.transition = "none", l.style.opacity = "1", l.style.transform = `translate3d(${s}px, ${b}px, 0) scale(1)`, l.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
265
- l.style.transition = "";
262
+ function I(r) {
263
+ const u = parseInt(r.dataset.left || "0", 10), x = parseInt(r.dataset.top || "0", 10);
264
+ r.style.transition = "none", r.style.opacity = "1", r.style.transform = `translate3d(${u}px, ${x}px, 0) scale(1)`, r.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
265
+ r.style.transition = "";
266
266
  });
267
267
  }
268
- function p(l, s) {
269
- const b = parseInt(l.dataset.left || "0", 10), E = parseInt(l.dataset.top || "0", 10), S = typeof (v == null ? void 0 : v.leaveDurationMs) == "number" ? v.leaveDurationMs : NaN;
270
- let I = Number.isFinite(S) && S > 0 ? S : NaN;
271
- if (!Number.isFinite(I)) {
272
- const o = getComputedStyle(l).getPropertyValue("--masonry-leave-duration") || "", $ = parseFloat(o);
273
- I = Number.isFinite($) && $ > 0 ? $ : 200;
268
+ function p(r, u) {
269
+ const x = parseInt(r.dataset.left || "0", 10), E = parseInt(r.dataset.top || "0", 10), S = typeof (v == null ? void 0 : v.leaveDurationMs) == "number" ? v.leaveDurationMs : NaN;
270
+ let k = Number.isFinite(S) && S > 0 ? S : NaN;
271
+ if (!Number.isFinite(k)) {
272
+ const o = getComputedStyle(r).getPropertyValue("--masonry-leave-duration") || "", P = parseFloat(o);
273
+ k = Number.isFinite(P) && P > 0 ? P : 200;
274
274
  }
275
- const d = l.style.transitionDuration, W = () => {
276
- l.removeEventListener("transitionend", R), clearTimeout(q), l.style.transitionDuration = d || "";
277
- }, R = (g) => {
278
- (!g || g.target === l) && (W(), s());
279
- }, q = setTimeout(() => {
280
- W(), s();
281
- }, I + 100);
275
+ const d = r.style.transitionDuration, A = () => {
276
+ r.removeEventListener("transitionend", C), clearTimeout(U), r.style.transitionDuration = d || "";
277
+ }, C = (g) => {
278
+ (!g || g.target === r) && (A(), u());
279
+ }, U = setTimeout(() => {
280
+ A(), u();
281
+ }, k + 100);
282
282
  requestAnimationFrame(() => {
283
- l.style.transitionDuration = `${I}ms`, l.style.opacity = "0", l.style.transform = `translate3d(${b}px, ${E + 10}px, 0) scale(0.985)`, l.addEventListener("transitionend", R);
283
+ r.style.transitionDuration = `${k}ms`, r.style.opacity = "0", r.style.transform = `translate3d(${x}px, ${E + 10}px, 0) scale(0.985)`, r.addEventListener("transitionend", C);
284
284
  });
285
285
  }
286
286
  return {
287
287
  onEnter: c,
288
- onBeforeEnter: r,
289
- onBeforeLeave: L,
288
+ onBeforeEnter: i,
289
+ onBeforeLeave: I,
290
290
  onLeave: p
291
291
  };
292
292
  }
293
- function na({
293
+ function sa({
294
294
  container: t,
295
295
  masonry: v,
296
296
  columns: c,
297
- containerHeight: r,
298
- isLoading: L,
297
+ containerHeight: i,
298
+ isLoading: I,
299
299
  pageSize: p,
300
- refreshLayout: l,
301
- setItemsRaw: s,
302
- loadNext: b,
300
+ refreshLayout: r,
301
+ setItemsRaw: u,
302
+ loadNext: x,
303
303
  loadThresholdPx: E
304
304
  }) {
305
305
  let S = 0;
306
- async function I(d) {
306
+ async function k(d) {
307
307
  if (!t.value) return;
308
- const W = d ?? We(v.value, c.value), R = W.length ? Math.max(...W) : 0, q = t.value.scrollTop + t.value.clientHeight, g = t.value.scrollTop > S + 1;
308
+ const A = d ?? Be(v.value, c.value), C = A.length ? Math.max(...A) : 0, U = t.value.scrollTop + t.value.clientHeight, g = t.value.scrollTop > S + 1;
309
309
  S = t.value.scrollTop;
310
- const o = typeof E == "number" ? E : 200, $ = o >= 0 ? Math.max(0, R - o) : Math.max(0, R + o);
311
- if (q >= $ && g && !L.value) {
312
- await b(), await J();
310
+ const o = typeof E == "number" ? E : 200, P = o >= 0 ? Math.max(0, C - o) : Math.max(0, C + o);
311
+ if (U >= P && g && !I.value) {
312
+ await x(), await G();
313
313
  return;
314
314
  }
315
315
  }
316
316
  return {
317
- handleScroll: I
317
+ handleScroll: k
318
318
  };
319
319
  }
320
- const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full rounded-xl overflow-hidden shadow-sm transition-all duration-300 bg-white relative" }, oa = {
320
+ const ua = { class: "flex-1 relative min-h-0" }, va = { class: "w-full h-full rounded-xl overflow-hidden shadow-sm transition-all duration-300 bg-white relative" }, ca = {
321
321
  key: 0,
322
322
  class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-100 text-slate-400 text-sm p-4 text-center"
323
- }, ia = {
323
+ }, fa = {
324
324
  key: 1,
325
325
  class: "relative w-full h-full"
326
- }, sa = ["src"], ua = ["src", "autoplay", "controls"], va = { class: "w-12 h-12 rounded-full bg-white/80 backdrop-blur-sm flex items-center justify-center shadow-sm" }, ca = {
326
+ }, da = ["src"], ma = ["src", "autoplay", "controls"], ha = { class: "w-12 h-12 rounded-full bg-white/80 backdrop-blur-sm flex items-center justify-center shadow-sm" }, ga = {
327
327
  key: 3,
328
328
  class: "absolute bottom-2 left-1/2 transform -translate-x-1/2 flex items-center justify-center z-10"
329
- }, fa = {
329
+ }, pa = {
330
330
  key: 4,
331
331
  class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-50 text-slate-400 text-sm p-4 text-center"
332
- }, Me = /* @__PURE__ */ tt({
332
+ }, Ie = /* @__PURE__ */ lt({
333
333
  __name: "MasonryItem",
334
334
  props: {
335
335
  item: {},
@@ -343,109 +343,109 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
343
343
  },
344
344
  emits: ["preload:success", "preload:error", "mouse-enter", "mouse-leave"],
345
345
  setup(t, { emit: v }) {
346
- const c = t, r = v, L = T(!1), p = T(!1), l = T(null), s = T(!1), b = T(!1), E = T(null), S = T(!1), I = T(!1), d = T(!1), W = T(null), R = T(null);
347
- let q = null;
348
- const g = Z(() => {
346
+ const c = t, i = v, I = T(!1), p = T(!1), r = T(null), u = T(!1), x = T(!1), E = T(null), S = T(!1), k = T(!1), d = T(!1), A = T(null), C = T(null);
347
+ let U = null;
348
+ const g = te(() => {
349
349
  var n;
350
350
  return c.type ?? ((n = c.item) == null ? void 0 : n.type) ?? "image";
351
- }), o = Z(() => {
351
+ }), o = te(() => {
352
352
  var n;
353
353
  return c.notFound ?? ((n = c.item) == null ? void 0 : n.notFound) ?? !1;
354
- }), $ = Z(() => !!c.inSwipeMode);
354
+ }), P = te(() => !!c.inSwipeMode);
355
355
  function y(n) {
356
- r("mouse-enter", { item: c.item, type: n });
356
+ i("mouse-enter", { item: c.item, type: n });
357
357
  }
358
- function x(n) {
359
- r("mouse-leave", { item: c.item, type: n });
358
+ function b(n) {
359
+ i("mouse-leave", { item: c.item, type: n });
360
360
  }
361
361
  function H(n) {
362
- if ($.value) return;
362
+ if (P.value) return;
363
363
  const f = n.target;
364
364
  f && (f.paused ? f.play() : f.pause());
365
365
  }
366
366
  function h(n) {
367
367
  const f = n.target;
368
- f && ($.value || f.play(), y("video"));
368
+ f && (P.value || f.play(), y("video"));
369
369
  }
370
- function B(n) {
370
+ function z(n) {
371
371
  const f = n.target;
372
- f && ($.value || f.pause(), x("video"));
372
+ f && (P.value || f.pause(), b("video"));
373
373
  }
374
374
  function w(n) {
375
- return new Promise((f, P) => {
375
+ return new Promise((f, $) => {
376
376
  if (!n) {
377
377
  const N = new Error("No image source provided");
378
- r("preload:error", { item: c.item, type: "image", src: n, error: N }), P(N);
378
+ i("preload:error", { item: c.item, type: "image", src: n, error: N }), $(N);
379
379
  return;
380
380
  }
381
- const A = new Image(), U = Date.now(), C = 300;
382
- A.onload = () => {
383
- const N = Date.now() - U, oe = Math.max(0, C - N);
381
+ const R = new Image(), X = Date.now(), Y = 300;
382
+ R.onload = () => {
383
+ const N = Date.now() - X, ie = Math.max(0, Y - N);
384
384
  setTimeout(async () => {
385
- L.value = !0, p.value = !1, I.value = !1, await J(), await new Promise((ie) => setTimeout(ie, 100)), d.value = !0, r("preload:success", { item: c.item, type: "image", src: n }), f();
386
- }, oe);
387
- }, A.onerror = () => {
388
- p.value = !0, L.value = !1, I.value = !1;
385
+ I.value = !0, p.value = !1, k.value = !1, await G(), await new Promise((se) => setTimeout(se, 100)), d.value = !0, i("preload:success", { item: c.item, type: "image", src: n }), f();
386
+ }, ie);
387
+ }, R.onerror = () => {
388
+ p.value = !0, I.value = !1, k.value = !1;
389
389
  const N = new Error("Failed to load image");
390
- r("preload:error", { item: c.item, type: "image", src: n, error: N }), P(N);
391
- }, A.src = n;
390
+ i("preload:error", { item: c.item, type: "image", src: n, error: N }), $(N);
391
+ }, R.src = n;
392
392
  });
393
393
  }
394
394
  function M(n) {
395
- return new Promise((f, P) => {
395
+ return new Promise((f, $) => {
396
396
  if (!n) {
397
397
  const N = new Error("No video source provided");
398
- r("preload:error", { item: c.item, type: "video", src: n, error: N }), P(N);
398
+ i("preload:error", { item: c.item, type: "video", src: n, error: N }), $(N);
399
399
  return;
400
400
  }
401
- const A = document.createElement("video"), U = Date.now(), C = 300;
402
- A.preload = "metadata", A.muted = !0, A.onloadedmetadata = () => {
403
- const N = Date.now() - U, oe = Math.max(0, C - N);
401
+ const R = document.createElement("video"), X = Date.now(), Y = 300;
402
+ R.preload = "metadata", R.muted = !0, R.onloadedmetadata = () => {
403
+ const N = Date.now() - X, ie = Math.max(0, Y - N);
404
404
  setTimeout(async () => {
405
- s.value = !0, b.value = !1, I.value = !1, await J(), await new Promise((ie) => setTimeout(ie, 100)), d.value = !0, r("preload:success", { item: c.item, type: "video", src: n }), f();
406
- }, oe);
407
- }, A.onerror = () => {
408
- b.value = !0, s.value = !1, I.value = !1;
405
+ u.value = !0, x.value = !1, k.value = !1, await G(), await new Promise((se) => setTimeout(se, 100)), d.value = !0, i("preload:success", { item: c.item, type: "video", src: n }), f();
406
+ }, ie);
407
+ }, R.onerror = () => {
408
+ x.value = !0, u.value = !1, k.value = !1;
409
409
  const N = new Error("Failed to load video");
410
- r("preload:error", { item: c.item, type: "video", src: n, error: N }), P(N);
411
- }, A.src = n;
410
+ i("preload:error", { item: c.item, type: "video", src: n, error: N }), $(N);
411
+ }, R.src = n;
412
412
  });
413
413
  }
414
- async function j() {
414
+ async function q() {
415
415
  var f;
416
- if (!S.value || I.value || o.value || g.value === "video" && s.value || g.value === "image" && L.value)
416
+ if (!S.value || k.value || o.value || g.value === "video" && u.value || g.value === "image" && I.value)
417
417
  return;
418
418
  const n = (f = c.item) == null ? void 0 : f.src;
419
419
  if (n)
420
- if (I.value = !0, d.value = !1, g.value === "video") {
421
- E.value = n, s.value = !1, b.value = !1;
420
+ if (k.value = !0, d.value = !1, g.value === "video") {
421
+ E.value = n, u.value = !1, x.value = !1;
422
422
  try {
423
423
  await M(n);
424
424
  } catch {
425
425
  }
426
426
  } else {
427
- l.value = n, L.value = !1, p.value = !1;
427
+ r.value = n, I.value = !1, p.value = !1;
428
428
  try {
429
429
  await w(n);
430
430
  } catch {
431
431
  }
432
432
  }
433
433
  }
434
- return at(() => {
435
- W.value && (q = new IntersectionObserver(
434
+ return rt(() => {
435
+ A.value && (U = new IntersectionObserver(
436
436
  (n) => {
437
437
  n.forEach((f) => {
438
- f.isIntersecting && f.intersectionRatio >= 1 ? S.value || (S.value = !0, j()) : f.isIntersecting;
438
+ f.isIntersecting && f.intersectionRatio >= 1 ? S.value || (S.value = !0, q()) : f.isIntersecting;
439
439
  });
440
440
  },
441
441
  {
442
442
  // Only trigger when item is 100% visible (full height in view)
443
443
  threshold: [1]
444
444
  }
445
- ), q.observe(W.value));
446
- }), nt(() => {
447
- q && (q.disconnect(), q = null);
448
- }), re(
445
+ ), U.observe(A.value));
446
+ }), ot(() => {
447
+ U && (U.disconnect(), U = null);
448
+ }), oe(
449
449
  () => {
450
450
  var n;
451
451
  return (n = c.item) == null ? void 0 : n.src;
@@ -453,15 +453,15 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
453
453
  async (n) => {
454
454
  if (!(!n || o.value)) {
455
455
  if (g.value === "video") {
456
- if (n !== E.value && (s.value = !1, b.value = !1, E.value = n, S.value)) {
457
- I.value = !0;
456
+ if (n !== E.value && (u.value = !1, x.value = !1, E.value = n, S.value)) {
457
+ k.value = !0;
458
458
  try {
459
459
  await M(n);
460
460
  } catch {
461
461
  }
462
462
  }
463
- } else if (n !== l.value && (L.value = !1, p.value = !1, l.value = n, S.value)) {
464
- I.value = !0;
463
+ } else if (n !== r.value && (I.value = !1, p.value = !1, r.value = n, S.value)) {
464
+ k.value = !0;
465
465
  try {
466
466
  await w(n);
467
467
  } catch {
@@ -469,149 +469,149 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
469
469
  }
470
470
  }
471
471
  }
472
- ), re(
472
+ ), oe(
473
473
  () => c.isActive,
474
474
  (n) => {
475
- !$.value || !R.value || (n ? R.value.play() : R.value.pause());
475
+ !P.value || !C.value || (n ? C.value.play() : C.value.pause());
476
476
  }
477
- ), (n, f) => (F(), D("div", {
477
+ ), (n, f) => (D(), B("div", {
478
478
  ref_key: "containerRef",
479
- ref: W,
479
+ ref: A,
480
480
  class: "relative w-full h-full flex flex-col"
481
481
  }, [
482
- n.headerHeight > 0 ? (F(), D("div", {
482
+ n.headerHeight > 0 ? (D(), B("div", {
483
483
  key: 0,
484
484
  class: "relative z-10",
485
- style: we({ height: `${n.headerHeight}px` })
485
+ style: Me({ height: `${n.headerHeight}px` })
486
486
  }, [
487
- Q(n.$slots, "header", {
487
+ ee(n.$slots, "header", {
488
488
  item: n.item,
489
489
  remove: n.remove,
490
- imageLoaded: L.value,
490
+ imageLoaded: I.value,
491
491
  imageError: p.value,
492
- videoLoaded: s.value,
493
- videoError: b.value,
492
+ videoLoaded: u.value,
493
+ videoError: x.value,
494
494
  showNotFound: o.value,
495
- isLoading: I.value,
495
+ isLoading: k.value,
496
496
  mediaType: g.value
497
497
  })
498
- ], 4)) : ne("", !0),
499
- O("div", la, [
500
- Q(n.$slots, "default", {
498
+ ], 4)) : le("", !0),
499
+ j("div", ua, [
500
+ ee(n.$slots, "default", {
501
501
  item: n.item,
502
502
  remove: n.remove,
503
- imageLoaded: L.value,
503
+ imageLoaded: I.value,
504
504
  imageError: p.value,
505
- videoLoaded: s.value,
506
- videoError: b.value,
505
+ videoLoaded: u.value,
506
+ videoError: x.value,
507
507
  showNotFound: o.value,
508
- isLoading: I.value,
508
+ isLoading: k.value,
509
509
  mediaType: g.value,
510
- imageSrc: l.value,
510
+ imageSrc: r.value,
511
511
  videoSrc: E.value,
512
512
  showMedia: d.value
513
513
  }, () => [
514
- O("div", ra, [
515
- o.value ? (F(), D("div", oa, f[3] || (f[3] = [
516
- O("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
517
- O("span", { class: "font-medium" }, "Not Found", -1),
518
- O("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
519
- ]))) : (F(), D("div", ia, [
520
- g.value === "image" && l.value ? (F(), D("img", {
514
+ j("div", va, [
515
+ o.value ? (D(), B("div", ca, f[3] || (f[3] = [
516
+ j("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
517
+ j("span", { class: "font-medium" }, "Not Found", -1),
518
+ j("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
519
+ ]))) : (D(), B("div", fa, [
520
+ g.value === "image" && r.value ? (D(), B("img", {
521
521
  key: 0,
522
- src: l.value,
523
- class: ue([
522
+ src: r.value,
523
+ class: de([
524
524
  "w-full h-full object-cover transition-opacity duration-700 ease-in-out",
525
- L.value && d.value ? "opacity-100" : "opacity-0"
525
+ I.value && d.value ? "opacity-100" : "opacity-0"
526
526
  ]),
527
527
  style: { position: "absolute", top: "0", left: "0" },
528
528
  loading: "lazy",
529
529
  decoding: "async",
530
530
  alt: "",
531
- onMouseenter: f[0] || (f[0] = (P) => y("image")),
532
- onMouseleave: f[1] || (f[1] = (P) => x("image"))
533
- }, null, 42, sa)) : ne("", !0),
534
- g.value === "video" && E.value ? (F(), D("video", {
531
+ onMouseenter: f[0] || (f[0] = ($) => y("image")),
532
+ onMouseleave: f[1] || (f[1] = ($) => b("image"))
533
+ }, null, 42, da)) : le("", !0),
534
+ g.value === "video" && E.value ? (D(), B("video", {
535
535
  key: 1,
536
536
  ref_key: "videoEl",
537
- ref: R,
537
+ ref: C,
538
538
  src: E.value,
539
- class: ue([
539
+ class: de([
540
540
  "w-full h-full object-cover transition-opacity duration-700 ease-in-out",
541
- s.value && d.value ? "opacity-100" : "opacity-0"
541
+ u.value && d.value ? "opacity-100" : "opacity-0"
542
542
  ]),
543
543
  style: { position: "absolute", top: "0", left: "0" },
544
544
  muted: "",
545
545
  loop: "",
546
546
  playsinline: "",
547
- autoplay: $.value && c.isActive,
548
- controls: $.value,
549
- onClick: _e(H, ["stop"]),
550
- onTouchend: _e(H, ["stop", "prevent"]),
547
+ autoplay: P.value && c.isActive,
548
+ controls: P.value,
549
+ onClick: Xe(H, ["stop"]),
550
+ onTouchend: Xe(H, ["stop", "prevent"]),
551
551
  onMouseenter: h,
552
- onMouseleave: B,
553
- onError: f[2] || (f[2] = (P) => b.value = !0)
554
- }, null, 42, ua)) : ne("", !0),
555
- !L.value && !s.value && !p.value && !b.value ? (F(), D("div", {
552
+ onMouseleave: z,
553
+ onError: f[2] || (f[2] = ($) => x.value = !0)
554
+ }, null, 42, ma)) : le("", !0),
555
+ !I.value && !u.value && !p.value && !x.value ? (D(), B("div", {
556
556
  key: 2,
557
- class: ue([
557
+ class: de([
558
558
  "absolute inset-0 bg-slate-100 flex items-center justify-center transition-opacity duration-500",
559
559
  d.value ? "opacity-0 pointer-events-none" : "opacity-100"
560
560
  ])
561
561
  }, [
562
- O("div", va, [
563
- O("i", {
564
- class: ue(g.value === "video" ? "fas fa-video text-xl text-slate-400" : "fas fa-image text-xl text-slate-400")
562
+ j("div", ha, [
563
+ j("i", {
564
+ class: de(g.value === "video" ? "fas fa-video text-xl text-slate-400" : "fas fa-image text-xl text-slate-400")
565
565
  }, null, 2)
566
566
  ])
567
- ], 2)) : ne("", !0),
568
- I.value ? (F(), D("div", ca, f[4] || (f[4] = [
569
- O("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
570
- O("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
567
+ ], 2)) : le("", !0),
568
+ k.value ? (D(), B("div", ga, f[4] || (f[4] = [
569
+ j("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
570
+ j("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
571
571
  ], -1)
572
- ]))) : ne("", !0),
573
- g.value === "image" && p.value || g.value === "video" && b.value ? (F(), D("div", fa, [
574
- O("i", {
575
- class: ue(g.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
572
+ ]))) : le("", !0),
573
+ g.value === "image" && p.value || g.value === "video" && x.value ? (D(), B("div", pa, [
574
+ j("i", {
575
+ class: de(g.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
576
576
  }, null, 2),
577
- O("span", null, "Failed to load " + He(g.value), 1)
578
- ])) : ne("", !0)
577
+ j("span", null, "Failed to load " + Ae(g.value), 1)
578
+ ])) : le("", !0)
579
579
  ]))
580
580
  ])
581
581
  ])
582
582
  ]),
583
- n.footerHeight > 0 ? (F(), D("div", {
583
+ n.footerHeight > 0 ? (D(), B("div", {
584
584
  key: 1,
585
585
  class: "relative z-10",
586
- style: we({ height: `${n.footerHeight}px` })
586
+ style: Me({ height: `${n.footerHeight}px` })
587
587
  }, [
588
- Q(n.$slots, "footer", {
588
+ ee(n.$slots, "footer", {
589
589
  item: n.item,
590
590
  remove: n.remove,
591
- imageLoaded: L.value,
591
+ imageLoaded: I.value,
592
592
  imageError: p.value,
593
- videoLoaded: s.value,
594
- videoError: b.value,
593
+ videoLoaded: u.value,
594
+ videoError: x.value,
595
595
  showNotFound: o.value,
596
- isLoading: I.value,
596
+ isLoading: k.value,
597
597
  mediaType: g.value
598
598
  })
599
- ], 4)) : ne("", !0)
599
+ ], 4)) : le("", !0)
600
600
  ], 512));
601
601
  }
602
- }), da = { class: "w-full h-full flex items-center justify-center p-4" }, ma = { class: "w-full h-full max-w-full max-h-full relative" }, ha = {
602
+ }), ya = { class: "w-full h-full flex items-center justify-center p-4" }, wa = { class: "w-full h-full max-w-full max-h-full relative" }, xa = {
603
603
  key: 0,
604
604
  class: "w-full py-8 text-center"
605
- }, ga = {
605
+ }, ba = {
606
606
  key: 1,
607
607
  class: "w-full py-8 text-center"
608
- }, pa = { class: "text-red-500 dark:text-red-400" }, ya = {
608
+ }, Ma = { class: "text-red-500 dark:text-red-400" }, Ea = {
609
609
  key: 0,
610
610
  class: "w-full py-8 text-center"
611
- }, wa = {
611
+ }, Ta = {
612
612
  key: 1,
613
613
  class: "w-full py-8 text-center"
614
- }, ba = { class: "text-red-500 dark:text-red-400" }, xa = /* @__PURE__ */ tt({
614
+ }, Ia = { class: "text-red-500 dark:text-red-400" }, La = /* @__PURE__ */ lt({
615
615
  __name: "Masonry",
616
616
  props: {
617
617
  getNextPage: {
@@ -730,7 +730,7 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
730
730
  "item:mouse-leave"
731
731
  ],
732
732
  setup(t, { expose: v, emit: c }) {
733
- const r = t, L = {
733
+ const i = t, I = {
734
734
  sizes: { base: 1, sm: 2, md: 3, lg: 4, xl: 5, "2xl": 6 },
735
735
  gutterX: 10,
736
736
  gutterY: 10,
@@ -739,19 +739,19 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
739
739
  paddingLeft: 0,
740
740
  paddingRight: 0,
741
741
  placement: "masonry"
742
- }, p = Z(() => {
742
+ }, p = te(() => {
743
743
  var e;
744
744
  return {
745
- ...L,
746
- ...r.layout,
745
+ ...I,
746
+ ...i.layout,
747
747
  sizes: {
748
- ...L.sizes,
749
- ...((e = r.layout) == null ? void 0 : e.sizes) || {}
748
+ ...I.sizes,
749
+ ...((e = i.layout) == null ? void 0 : e.sizes) || {}
750
750
  }
751
751
  };
752
- }), l = T(null), s = T(typeof window < "u" ? window.innerWidth : 1024), b = T(typeof window < "u" ? window.innerHeight : 768), E = T(null);
752
+ }), r = T(null), u = T(typeof window < "u" ? window.innerWidth : 1024), x = T(typeof window < "u" ? window.innerHeight : 768), E = T(null);
753
753
  let S = null;
754
- function I(e) {
754
+ function k(e) {
755
755
  return {
756
756
  sm: 640,
757
757
  md: 768,
@@ -760,48 +760,48 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
760
760
  "2xl": 1536
761
761
  }[e] || 768;
762
762
  }
763
- const d = Z(() => {
764
- if (r.layoutMode === "masonry") return !1;
765
- if (r.layoutMode === "swipe") return !0;
766
- const e = typeof r.mobileBreakpoint == "string" ? I(r.mobileBreakpoint) : r.mobileBreakpoint;
767
- return s.value < e;
768
- }), W = Z(() => {
763
+ const d = te(() => {
764
+ if (i.layoutMode === "masonry") return !1;
765
+ if (i.layoutMode === "swipe") return !0;
766
+ const e = typeof i.mobileBreakpoint == "string" ? k(i.mobileBreakpoint) : i.mobileBreakpoint;
767
+ return u.value < e;
768
+ }), A = te(() => {
769
769
  if (!d.value || o.value.length === 0) return null;
770
770
  const e = Math.max(0, Math.min(n.value, o.value.length - 1));
771
771
  return o.value[e] || null;
772
- }), R = Z(() => {
773
- if (!d.value || !W.value) return null;
772
+ }), C = te(() => {
773
+ if (!d.value || !A.value) return null;
774
774
  const e = n.value + 1;
775
775
  return e >= o.value.length ? null : o.value[e] || null;
776
- }), q = Z(() => {
777
- if (!d.value || !W.value) return null;
776
+ }), U = te(() => {
777
+ if (!d.value || !A.value) return null;
778
778
  const e = n.value - 1;
779
779
  return e < 0 ? null : o.value[e] || null;
780
- }), g = c, o = Z({
781
- get: () => r.items,
780
+ }), g = c, o = te({
781
+ get: () => i.items,
782
782
  set: (e) => g("update:items", e)
783
- }), $ = T(7), y = T(null), x = T([]), H = T(null), h = T(!1), B = T(0), w = T(!1), M = T(null), j = Z(() => Qt(s.value)), n = T(0), f = T(0), P = T(!1), A = T(0), U = T(0), C = T(null), N = T(/* @__PURE__ */ new Set());
784
- function oe(e) {
783
+ }), P = T(7), y = T(null), b = T([]), H = T(null), h = T(!1), z = T(0), w = T(!1), M = T(null), q = te(() => na(u.value)), n = T(0), f = T(0), $ = T(!1), R = T(0), X = T(0), Y = T(null), N = T(/* @__PURE__ */ new Set());
784
+ function ie(e) {
785
785
  return typeof e == "number" && Number.isFinite(e) && e > 0;
786
786
  }
787
- function ie(e, a) {
787
+ function se(e, a) {
788
788
  try {
789
789
  if (!Array.isArray(e) || e.length === 0) return;
790
- const i = e.filter((u) => !oe(u == null ? void 0 : u.width) || !oe(u == null ? void 0 : u.height));
791
- if (i.length === 0) return;
790
+ const l = e.filter((s) => !ie(s == null ? void 0 : s.width) || !ie(s == null ? void 0 : s.height));
791
+ if (l.length === 0) return;
792
792
  const m = [];
793
- for (const u of i) {
794
- const Y = (u == null ? void 0 : u.id) ?? `idx:${e.indexOf(u)}`;
795
- N.value.has(Y) || (N.value.add(Y), m.push(Y));
793
+ for (const s of l) {
794
+ const F = (s == null ? void 0 : s.id) ?? `idx:${e.indexOf(s)}`;
795
+ N.value.has(F) || (N.value.add(F), m.push(F));
796
796
  }
797
797
  if (m.length > 0) {
798
- const u = m.slice(0, 10);
798
+ const s = m.slice(0, 10);
799
799
  console.warn(
800
800
  "[Masonry] Items missing width/height detected:",
801
801
  {
802
802
  context: a,
803
803
  count: m.length,
804
- sampleIds: u,
804
+ sampleIds: s,
805
805
  hint: "Ensure each item has positive width and height. Consider providing fallbacks (e.g., 512x512) at the data layer."
806
806
  }
807
807
  );
@@ -809,72 +809,72 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
809
809
  } catch {
810
810
  }
811
811
  }
812
- const k = T(0), z = T(0), K = r.virtualBufferPx, G = T(!1), X = T({
812
+ const L = T(0), O = T(0), Q = i.virtualBufferPx, J = T(!1), K = T({
813
813
  distanceToTrigger: 0,
814
814
  isNearTrigger: !1
815
- }), ee = (e) => {
815
+ }), ae = (e) => {
816
816
  if (!y.value) return;
817
- const { scrollTop: a, clientHeight: i } = y.value, m = a + i, u = e ?? We(o.value, $.value), Y = u.length ? Math.max(...u) : 0, _ = typeof r.loadThresholdPx == "number" ? r.loadThresholdPx : 200, ce = _ >= 0 ? Math.max(0, Y - _) : Math.max(0, Y + _), Ve = Math.max(0, ce - m), Et = Ve <= 100;
818
- X.value = {
819
- distanceToTrigger: Math.round(Ve),
820
- isNearTrigger: Et
817
+ const { scrollTop: a, clientHeight: l } = y.value, m = a + l, s = e ?? Be(o.value, P.value), F = s.length ? Math.max(...s) : 0, W = typeof i.loadThresholdPx == "number" ? i.loadThresholdPx : 200, ue = W >= 0 ? Math.max(0, F - W) : Math.max(0, F + W), ve = Math.max(0, ue - m), ce = ve <= 100;
818
+ K.value = {
819
+ distanceToTrigger: Math.round(ve),
820
+ isNearTrigger: ce
821
821
  };
822
- }, { onEnter: te, onBeforeEnter: ot, onBeforeLeave: it, onLeave: st } = aa(o, { leaveDurationMs: r.leaveDurationMs });
823
- function ut(e, a) {
824
- if (G.value) {
825
- const i = parseInt(e.dataset.left || "0", 10), m = parseInt(e.dataset.top || "0", 10);
826
- e.style.transition = "none", e.style.opacity = "1", e.style.transform = `translate3d(${i}px, ${m}px, 0) scale(1)`, e.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
822
+ }, { onEnter: ne, onBeforeEnter: ut, onBeforeLeave: vt, onLeave: ct } = ia(o, { leaveDurationMs: i.leaveDurationMs });
823
+ function ft(e, a) {
824
+ if (J.value) {
825
+ const l = parseInt(e.dataset.left || "0", 10), m = parseInt(e.dataset.top || "0", 10);
826
+ e.style.transition = "none", e.style.opacity = "1", e.style.transform = `translate3d(${l}px, ${m}px, 0) scale(1)`, e.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
827
827
  e.style.transition = "", a();
828
828
  });
829
829
  } else
830
- te(e, a);
830
+ ne(e, a);
831
831
  }
832
- function vt(e) {
833
- if (G.value) {
834
- const a = parseInt(e.dataset.left || "0", 10), i = parseInt(e.dataset.top || "0", 10);
835
- e.style.transition = "none", e.style.opacity = "1", e.style.transform = `translate3d(${a}px, ${i}px, 0) scale(1)`, e.style.removeProperty("--masonry-opacity-delay");
832
+ function dt(e) {
833
+ if (J.value) {
834
+ const a = parseInt(e.dataset.left || "0", 10), l = parseInt(e.dataset.top || "0", 10);
835
+ e.style.transition = "none", e.style.opacity = "1", e.style.transform = `translate3d(${a}px, ${l}px, 0) scale(1)`, e.style.removeProperty("--masonry-opacity-delay");
836
836
  } else
837
- ot(e);
837
+ ut(e);
838
838
  }
839
- function ct(e) {
840
- G.value || it(e);
839
+ function mt(e) {
840
+ J.value || vt(e);
841
841
  }
842
- function ft(e, a) {
843
- G.value ? a() : st(e, a);
842
+ function ht(e, a) {
843
+ J.value ? a() : ct(e, a);
844
844
  }
845
- const dt = Z(() => {
846
- const e = k.value - K, a = k.value + z.value + K, i = o.value;
847
- return !i || i.length === 0 ? [] : i.filter((m) => {
848
- const u = m.top;
849
- return m.top + m.columnHeight >= e && u <= a;
845
+ const gt = te(() => {
846
+ const e = L.value - Q, a = L.value + O.value + Q, l = o.value;
847
+ return !l || l.length === 0 ? [] : l.filter((m) => {
848
+ const s = m.top;
849
+ return m.top + m.columnHeight >= e && s <= a;
850
850
  });
851
- }), { handleScroll: mt } = na({
851
+ }), { handleScroll: pt } = sa({
852
852
  container: y,
853
853
  masonry: o,
854
- columns: $,
855
- containerHeight: B,
854
+ columns: P,
855
+ containerHeight: z,
856
856
  isLoading: h,
857
- pageSize: r.pageSize,
858
- refreshLayout: ae,
857
+ pageSize: i.pageSize,
858
+ refreshLayout: Z,
859
859
  setItemsRaw: (e) => {
860
860
  o.value = e;
861
861
  },
862
- loadNext: ve,
863
- loadThresholdPx: r.loadThresholdPx
862
+ loadNext: me,
863
+ loadThresholdPx: i.loadThresholdPx
864
864
  });
865
- function ht(e) {
866
- E.value = e, e ? (e.width !== void 0 && (s.value = e.width), e.height !== void 0 && (b.value = e.height), !d.value && y.value && o.value.length > 0 && J(() => {
867
- $.value = fe(p.value, s.value), ae(o.value), ee();
868
- })) : l.value && (s.value = l.value.clientWidth, b.value = l.value.clientHeight);
865
+ function yt(e) {
866
+ E.value = e, e ? (e.width !== void 0 && (u.value = e.width), e.height !== void 0 && (x.value = e.height), !d.value && y.value && o.value.length > 0 && G(() => {
867
+ P.value = he(p.value, u.value), Z(o.value), ae();
868
+ })) : r.value && (u.value = r.value.clientWidth, x.value = r.value.clientHeight);
869
869
  }
870
870
  v({
871
871
  isLoading: h,
872
- refreshLayout: ae,
872
+ refreshLayout: Z,
873
873
  // Container dimensions (wrapper element)
874
- containerWidth: s,
875
- containerHeight: b,
874
+ containerWidth: u,
875
+ containerHeight: x,
876
876
  // Masonry content height (for backward compatibility, old containerHeight)
877
- contentHeight: B,
877
+ contentHeight: z,
878
878
  // Current page
879
879
  currentPage: H,
880
880
  // End of list tracking
@@ -882,98 +882,100 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
882
882
  // Load error tracking
883
883
  loadError: M,
884
884
  // Set fixed dimensions (overrides ResizeObserver)
885
- setFixedDimensions: ht,
886
- remove: de,
887
- removeMany: pt,
888
- removeAll: yt,
889
- loadNext: ve,
890
- loadPage: Ee,
891
- refreshCurrentPage: Te,
892
- reset: bt,
893
- destroy: xt,
894
- init: Mt,
895
- paginationHistory: x,
896
- cancelLoad: Le,
897
- scrollToTop: Be,
898
- totalItems: Z(() => o.value.length),
899
- currentBreakpoint: j
885
+ setFixedDimensions: yt,
886
+ remove: ge,
887
+ removeMany: xt,
888
+ removeAll: Et,
889
+ restore: bt,
890
+ restoreMany: Mt,
891
+ loadNext: me,
892
+ loadPage: Le,
893
+ refreshCurrentPage: ke,
894
+ reset: It,
895
+ destroy: Lt,
896
+ init: kt,
897
+ paginationHistory: b,
898
+ cancelLoad: Pe,
899
+ scrollToTop: Oe,
900
+ totalItems: te(() => o.value.length),
901
+ currentBreakpoint: q
900
902
  });
901
903
  function De(e) {
902
- const a = Zt(e);
903
- let i = 0;
904
+ const a = la(e);
905
+ let l = 0;
904
906
  if (y.value) {
905
- const { scrollTop: m, clientHeight: u } = y.value;
906
- i = m + u + 100;
907
+ const { scrollTop: m, clientHeight: s } = y.value;
908
+ l = m + s + 100;
907
909
  }
908
- B.value = Math.max(a, i);
910
+ z.value = Math.max(a, l);
909
911
  }
910
- function ae(e) {
912
+ function Z(e) {
911
913
  if (d.value) {
912
914
  o.value = e;
913
915
  return;
914
916
  }
915
917
  if (!y.value) return;
916
- ie(e, "refreshLayout");
917
- const a = e.map((m, u) => ({
918
+ se(e, "refreshLayout");
919
+ const a = e.map((m, s) => ({
918
920
  ...m,
919
- originalIndex: m.originalIndex ?? u
920
- })), i = y.value;
921
+ originalIndex: s
922
+ })), l = y.value;
921
923
  if (E.value && E.value.width !== void 0) {
922
- const m = i.style.width, u = i.style.boxSizing;
923
- i.style.boxSizing = "border-box", i.style.width = `${E.value.width}px`, i.offsetWidth;
924
- const Y = Xe(a, i, $.value, p.value);
925
- i.style.width = m, i.style.boxSizing = u, De(Y), o.value = Y;
924
+ const m = l.style.width, s = l.style.boxSizing;
925
+ l.style.boxSizing = "border-box", l.style.width = `${E.value.width}px`, l.offsetWidth;
926
+ const F = Qe(a, l, P.value, p.value);
927
+ l.style.width = m, l.style.boxSizing = s, De(F), o.value = F;
926
928
  } else {
927
- const m = Xe(a, i, $.value, p.value);
929
+ const m = Qe(a, l, P.value, p.value);
928
930
  De(m), o.value = m;
929
931
  }
930
932
  }
931
- function Fe(e, a) {
932
- return new Promise((i) => {
933
- const m = Math.max(0, e | 0), u = Date.now();
933
+ function ze(e, a) {
934
+ return new Promise((l) => {
935
+ const m = Math.max(0, e | 0), s = Date.now();
934
936
  a(m, m);
935
- const Y = setInterval(() => {
936
- if (V.value) {
937
- clearInterval(Y), i();
937
+ const F = setInterval(() => {
938
+ if (_.value) {
939
+ clearInterval(F), l();
938
940
  return;
939
941
  }
940
- const _ = Date.now() - u, ce = Math.max(0, m - _);
941
- a(ce, m), ce <= 0 && (clearInterval(Y), i());
942
+ const W = Date.now() - s, ue = Math.max(0, m - W);
943
+ a(ue, m), ue <= 0 && (clearInterval(F), l());
942
944
  }, 100);
943
945
  });
944
946
  }
945
- async function be(e) {
947
+ async function Ee(e) {
946
948
  try {
947
- const a = await gt(() => r.getNextPage(e));
948
- return ae([...o.value, ...a.items]), a;
949
+ const a = await wt(() => i.getNextPage(e));
950
+ return Z([...o.value, ...a.items]), a;
949
951
  } catch (a) {
950
952
  throw console.error("Error in getContent:", a), a;
951
953
  }
952
954
  }
953
- async function gt(e) {
955
+ async function wt(e) {
954
956
  let a = 0;
955
- const i = r.retryMaxAttempts;
956
- let m = r.retryInitialDelayMs;
957
+ const l = i.retryMaxAttempts;
958
+ let m = i.retryInitialDelayMs;
957
959
  for (; ; )
958
960
  try {
959
- const u = await e();
960
- return a > 0 && g("retry:stop", { attempt: a, success: !0 }), u;
961
- } catch (u) {
962
- if (a++, a > i)
963
- throw g("retry:stop", { attempt: a - 1, success: !1 }), u;
964
- g("retry:start", { attempt: a, max: i, totalMs: m }), await Fe(m, (Y, _) => {
965
- g("retry:tick", { attempt: a, remainingMs: Y, totalMs: _ });
966
- }), m += r.retryBackoffStepMs;
961
+ const s = await e();
962
+ return a > 0 && g("retry:stop", { attempt: a, success: !0 }), s;
963
+ } catch (s) {
964
+ if (a++, a > l)
965
+ throw g("retry:stop", { attempt: a - 1, success: !1 }), s;
966
+ g("retry:start", { attempt: a, max: l, totalMs: m }), await ze(m, (F, W) => {
967
+ g("retry:tick", { attempt: a, remainingMs: F, totalMs: W });
968
+ }), m += i.retryBackoffStepMs;
967
969
  }
968
970
  }
969
- async function Ee(e) {
971
+ async function Le(e) {
970
972
  if (!h.value) {
971
- V.value = !1, h.value = !0, w.value = !1, M.value = null;
973
+ _.value = !1, h.value = !0, w.value = !1, M.value = null;
972
974
  try {
973
975
  const a = o.value.length;
974
- if (V.value) return;
975
- const i = await be(e);
976
- return V.value ? void 0 : (M.value = null, H.value = e, x.value.push(i.nextPage), i.nextPage == null && (w.value = !0), await he(a), i);
976
+ if (_.value) return;
977
+ const l = await Ee(e);
978
+ return _.value ? void 0 : (M.value = null, H.value = e, b.value.push(l.nextPage), l.nextPage == null && (w.value = !0), await ye(a), l);
977
979
  } catch (a) {
978
980
  throw console.error("Error loading page:", a), M.value = a instanceof Error ? a : new Error(String(a)), a;
979
981
  } finally {
@@ -981,19 +983,19 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
981
983
  }
982
984
  }
983
985
  }
984
- async function ve() {
986
+ async function me() {
985
987
  if (!h.value && !w.value) {
986
- V.value = !1, h.value = !0, M.value = null;
988
+ _.value = !1, h.value = !0, M.value = null;
987
989
  try {
988
990
  const e = o.value.length;
989
- if (V.value) return;
990
- const a = x.value[x.value.length - 1];
991
+ if (_.value) return;
992
+ const a = b.value[b.value.length - 1];
991
993
  if (a == null) {
992
994
  w.value = !0, h.value = !1;
993
995
  return;
994
996
  }
995
- const i = await be(a);
996
- return V.value ? void 0 : (M.value = null, H.value = a, x.value.push(i.nextPage), i.nextPage == null && (w.value = !0), await he(e), i);
997
+ const l = await Ee(a);
998
+ return _.value ? void 0 : (M.value = null, H.value = a, b.value.push(l.nextPage), l.nextPage == null && (w.value = !0), await ye(e), l);
997
999
  } catch (e) {
998
1000
  throw console.error("Error loading next page:", e), M.value = e instanceof Error ? e : new Error(String(e)), e;
999
1001
  } finally {
@@ -1001,21 +1003,21 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
1001
1003
  }
1002
1004
  }
1003
1005
  }
1004
- async function Te() {
1006
+ async function ke() {
1005
1007
  if (!h.value) {
1006
- V.value = !1, h.value = !0;
1008
+ _.value = !1, h.value = !0;
1007
1009
  try {
1008
1010
  const e = H.value;
1009
1011
  if (e == null) {
1010
- console.warn("[Masonry] No current page to refresh - currentPage:", H.value, "paginationHistory:", x.value);
1012
+ console.warn("[Masonry] No current page to refresh - currentPage:", H.value, "paginationHistory:", b.value);
1011
1013
  return;
1012
1014
  }
1013
- o.value = [], B.value = 0, w.value = !1, M.value = null, x.value = [e], await J();
1014
- const a = await be(e);
1015
- if (V.value) return;
1016
- M.value = null, H.value = e, x.value.push(a.nextPage), a.nextPage == null && (w.value = !0);
1017
- const i = o.value.length;
1018
- return await he(i), a;
1015
+ o.value = [], z.value = 0, w.value = !1, M.value = null, b.value = [e], await G();
1016
+ const a = await Ee(e);
1017
+ if (_.value) return;
1018
+ M.value = null, H.value = e, b.value.push(a.nextPage), a.nextPage == null && (w.value = !0);
1019
+ const l = o.value.length;
1020
+ return await ye(l), a;
1019
1021
  } catch (e) {
1020
1022
  throw console.error("[Masonry] Error refreshing current page:", e), M.value = e instanceof Error ? e : new Error(String(e)), e;
1021
1023
  } finally {
@@ -1023,112 +1025,142 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
1023
1025
  }
1024
1026
  }
1025
1027
  }
1026
- async function de(e) {
1027
- const a = o.value.filter((i) => i.id !== e.id);
1028
- if (o.value = a, await J(), a.length === 0 && x.value.length > 0) {
1029
- if (r.autoRefreshOnEmpty)
1030
- await Te();
1028
+ async function ge(e) {
1029
+ const a = o.value.filter((l) => l.id !== e.id);
1030
+ if (o.value = a, await G(), a.length === 0 && b.value.length > 0) {
1031
+ if (i.autoRefreshOnEmpty)
1032
+ await ke();
1031
1033
  else
1032
1034
  try {
1033
- await ve(), await he(0, !0);
1035
+ await me(), await ye(0, !0);
1034
1036
  } catch {
1035
1037
  }
1036
1038
  return;
1037
1039
  }
1038
- await new Promise((i) => requestAnimationFrame(() => i())), requestAnimationFrame(() => {
1039
- ae(a);
1040
+ await new Promise((l) => requestAnimationFrame(() => l())), requestAnimationFrame(() => {
1041
+ Z(a);
1040
1042
  });
1041
1043
  }
1042
- async function pt(e) {
1044
+ async function xt(e) {
1043
1045
  if (!e || e.length === 0) return;
1044
- const a = new Set(e.map((m) => m.id)), i = o.value.filter((m) => !a.has(m.id));
1045
- if (o.value = i, await J(), i.length === 0 && x.value.length > 0) {
1046
- if (r.autoRefreshOnEmpty)
1047
- await Te();
1046
+ const a = new Set(e.map((m) => m.id)), l = o.value.filter((m) => !a.has(m.id));
1047
+ if (o.value = l, await G(), l.length === 0 && b.value.length > 0) {
1048
+ if (i.autoRefreshOnEmpty)
1049
+ await ke();
1048
1050
  else
1049
1051
  try {
1050
- await ve(), await he(0, !0);
1052
+ await me(), await ye(0, !0);
1051
1053
  } catch {
1052
1054
  }
1053
1055
  return;
1054
1056
  }
1055
1057
  await new Promise((m) => requestAnimationFrame(() => m())), requestAnimationFrame(() => {
1056
- ae(i);
1058
+ Z(l);
1057
1059
  });
1058
1060
  }
1059
- function Be(e) {
1061
+ async function bt(e, a) {
1062
+ if (!e) return;
1063
+ const l = o.value;
1064
+ if (l.findIndex((W) => W.id === e.id) !== -1) return;
1065
+ const s = [...l], F = Math.min(a, s.length);
1066
+ s.splice(F, 0, e), o.value = s, await G(), d.value || (await new Promise((W) => requestAnimationFrame(() => W())), requestAnimationFrame(() => {
1067
+ Z(s);
1068
+ }));
1069
+ }
1070
+ async function Mt(e, a) {
1071
+ var Ge;
1072
+ if (!e || e.length === 0) return;
1073
+ if (!a || a.length !== e.length) {
1074
+ console.warn("[Masonry] restoreMany: items and indices arrays must have the same length");
1075
+ return;
1076
+ }
1077
+ const l = o.value, m = new Set(l.map((V) => V.id)), s = [];
1078
+ for (let V = 0; V < e.length; V++)
1079
+ m.has((Ge = e[V]) == null ? void 0 : Ge.id) || s.push({ item: e[V], index: a[V] });
1080
+ if (s.length === 0) return;
1081
+ const F = /* @__PURE__ */ new Map();
1082
+ for (const { item: V, index: Pt } of s)
1083
+ F.set(Pt, V);
1084
+ const W = s.length > 0 ? Math.max(...s.map(({ index: V }) => V)) : -1, ue = Math.max(l.length - 1, W), ve = [];
1085
+ let ce = 0;
1086
+ for (let V = 0; V <= ue; V++)
1087
+ F.has(V) ? ve.push(F.get(V)) : ce < l.length && (ve.push(l[ce]), ce++);
1088
+ for (; ce < l.length; )
1089
+ ve.push(l[ce]), ce++;
1090
+ o.value = ve, await G(), d.value || (await new Promise((V) => requestAnimationFrame(() => V())), requestAnimationFrame(() => {
1091
+ Z(ve);
1092
+ }));
1093
+ }
1094
+ function Oe(e) {
1060
1095
  y.value && y.value.scrollTo({
1061
1096
  top: 0,
1062
1097
  behavior: (e == null ? void 0 : e.behavior) ?? "smooth",
1063
1098
  ...e
1064
1099
  });
1065
1100
  }
1066
- async function yt() {
1067
- Be({ behavior: "smooth" }), o.value = [], b.value = 0, await J(), g("remove-all:complete");
1101
+ async function Et() {
1102
+ Oe({ behavior: "smooth" }), o.value = [], x.value = 0, await G(), g("remove-all:complete");
1068
1103
  }
1069
- function wt() {
1070
- $.value = fe(p.value, s.value), ae(o.value), y.value && (k.value = y.value.scrollTop, z.value = y.value.clientHeight);
1104
+ function Tt() {
1105
+ P.value = he(p.value, u.value), Z(o.value), y.value && (L.value = y.value.scrollTop, O.value = y.value.clientHeight);
1071
1106
  }
1072
- let me = !1;
1073
- const V = T(!1);
1074
- async function he(e, a = !1) {
1075
- if (!a && !r.backfillEnabled || me || V.value || w.value) return;
1076
- const i = (e || 0) + (r.pageSize || 0);
1077
- if (!r.pageSize || r.pageSize <= 0) return;
1078
- if (x.value[x.value.length - 1] == null) {
1107
+ let pe = !1;
1108
+ const _ = T(!1);
1109
+ async function ye(e, a = !1) {
1110
+ if (!a && !i.backfillEnabled || pe || _.value || w.value) return;
1111
+ const l = (e || 0) + (i.pageSize || 0);
1112
+ if (!i.pageSize || i.pageSize <= 0) return;
1113
+ if (b.value[b.value.length - 1] == null) {
1079
1114
  w.value = !0;
1080
1115
  return;
1081
1116
  }
1082
- if (!(o.value.length >= i)) {
1083
- me = !0;
1117
+ if (!(o.value.length >= l)) {
1118
+ pe = !0, h.value = !0;
1084
1119
  try {
1085
- let u = 0;
1086
- for (g("backfill:start", { target: i, fetched: o.value.length, calls: u }); o.value.length < i && u < r.backfillMaxCalls && x.value[x.value.length - 1] != null && !V.value && !w.value && (await Fe(r.backfillDelayMs, (_, ce) => {
1120
+ let s = 0;
1121
+ for (g("backfill:start", { target: l, fetched: o.value.length, calls: s }); o.value.length < l && s < i.backfillMaxCalls && b.value[b.value.length - 1] != null && !_.value && !w.value && (await ze(i.backfillDelayMs, (W, ue) => {
1087
1122
  g("backfill:tick", {
1088
1123
  fetched: o.value.length,
1089
- target: i,
1090
- calls: u,
1091
- remainingMs: _,
1092
- totalMs: ce
1124
+ target: l,
1125
+ calls: s,
1126
+ remainingMs: W,
1127
+ totalMs: ue
1093
1128
  });
1094
- }), !V.value); ) {
1095
- const Y = x.value[x.value.length - 1];
1096
- if (Y == null) {
1129
+ }), !_.value); ) {
1130
+ const F = b.value[b.value.length - 1];
1131
+ if (F == null) {
1097
1132
  w.value = !0;
1098
1133
  break;
1099
1134
  }
1100
1135
  try {
1101
- h.value = !0;
1102
- const _ = await be(Y);
1103
- if (V.value) break;
1104
- M.value = null, x.value.push(_.nextPage), _.nextPage == null && (w.value = !0);
1105
- } catch (_) {
1106
- M.value = _ instanceof Error ? _ : new Error(String(_));
1107
- } finally {
1108
- h.value = !1;
1136
+ const W = await Ee(F);
1137
+ if (_.value) break;
1138
+ M.value = null, b.value.push(W.nextPage), W.nextPage == null && (w.value = !0);
1139
+ } catch (W) {
1140
+ M.value = W instanceof Error ? W : new Error(String(W));
1109
1141
  }
1110
- u++;
1142
+ s++;
1111
1143
  }
1112
- g("backfill:stop", { fetched: o.value.length, calls: u });
1144
+ g("backfill:stop", { fetched: o.value.length, calls: s });
1113
1145
  } finally {
1114
- me = !1;
1146
+ pe = !1, h.value = !1;
1115
1147
  }
1116
1148
  }
1117
1149
  }
1118
- function Le() {
1119
- V.value = !0, h.value = !1, me = !1;
1150
+ function Pe() {
1151
+ _.value = !0, h.value = !1, pe = !1;
1120
1152
  }
1121
- function bt() {
1122
- Le(), V.value = !1, y.value && y.value.scrollTo({
1153
+ function It() {
1154
+ Pe(), _.value = !1, y.value && y.value.scrollTo({
1123
1155
  top: 0,
1124
1156
  behavior: "smooth"
1125
- }), o.value = [], b.value = 0, H.value = r.loadAtPage, x.value = [r.loadAtPage], w.value = !1, M.value = null, X.value = {
1157
+ }), o.value = [], x.value = 0, H.value = i.loadAtPage, b.value = [i.loadAtPage], w.value = !1, M.value = null, K.value = {
1126
1158
  distanceToTrigger: 0,
1127
1159
  isNearTrigger: !1
1128
1160
  };
1129
1161
  }
1130
- function xt() {
1131
- Le(), o.value = [], B.value = 0, H.value = null, x.value = [], w.value = !1, M.value = null, h.value = !1, me = !1, V.value = !1, n.value = 0, f.value = 0, P.value = !1, k.value = 0, z.value = 0, G.value = !1, X.value = {
1162
+ function Lt() {
1163
+ Pe(), o.value = [], z.value = 0, H.value = null, b.value = [], w.value = !1, M.value = null, h.value = !1, pe = !1, _.value = !1, n.value = 0, f.value = 0, $.value = !1, L.value = 0, O.value = 0, J.value = !1, K.value = {
1132
1164
  distanceToTrigger: 0,
1133
1165
  isNearTrigger: !1
1134
1166
  }, N.value.clear(), y.value && y.value.scrollTo({
@@ -1137,154 +1169,155 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
1137
1169
  // Instant scroll for destroy
1138
1170
  });
1139
1171
  }
1140
- const se = Ze(async () => {
1172
+ const fe = at(async () => {
1141
1173
  if (d.value) return;
1142
- y.value && (k.value = y.value.scrollTop, z.value = y.value.clientHeight), G.value = !0, await J(), await new Promise((a) => requestAnimationFrame(() => a())), G.value = !1;
1143
- const e = We(o.value, $.value);
1144
- mt(e), ee(e);
1145
- }, 200), ze = Ze(wt, 200);
1146
- function Ae(e) {
1147
- d.value && (P.value = !0, A.value = e.touches[0].clientY, U.value = f.value, e.preventDefault());
1174
+ y.value && (L.value = y.value.scrollTop, O.value = y.value.clientHeight), J.value = !0, await G(), await new Promise((a) => requestAnimationFrame(() => a())), J.value = !1;
1175
+ const e = Be(o.value, P.value);
1176
+ pt(e), ae(e);
1177
+ }, 200), Re = at(Tt, 200);
1178
+ function je(e) {
1179
+ d.value && ($.value = !0, R.value = e.touches[0].clientY, X.value = f.value, e.preventDefault());
1148
1180
  }
1149
- function Oe(e) {
1150
- if (!d.value || !P.value) return;
1151
- const a = e.touches[0].clientY - A.value;
1152
- f.value = U.value + a, e.preventDefault();
1181
+ function Ce(e) {
1182
+ if (!d.value || !$.value) return;
1183
+ const a = e.touches[0].clientY - R.value;
1184
+ f.value = X.value + a, e.preventDefault();
1153
1185
  }
1154
- function Re(e) {
1155
- if (!d.value || !P.value) return;
1156
- P.value = !1;
1157
- const a = f.value - U.value;
1158
- Math.abs(a) > 100 ? a > 0 && q.value ? Ye() : a < 0 && R.value ? Ce() : le() : le(), e.preventDefault();
1186
+ function qe(e) {
1187
+ if (!d.value || !$.value) return;
1188
+ $.value = !1;
1189
+ const a = f.value - X.value;
1190
+ Math.abs(a) > 100 ? a > 0 && U.value ? Ue() : a < 0 && C.value ? Ve() : re() : re(), e.preventDefault();
1159
1191
  }
1160
- function je(e) {
1161
- d.value && (P.value = !0, A.value = e.clientY, U.value = f.value, e.preventDefault());
1192
+ function Ye(e) {
1193
+ d.value && ($.value = !0, R.value = e.clientY, X.value = f.value, e.preventDefault());
1162
1194
  }
1163
- function ke(e) {
1164
- if (!d.value || !P.value) return;
1165
- const a = e.clientY - A.value;
1166
- f.value = U.value + a, e.preventDefault();
1195
+ function Se(e) {
1196
+ if (!d.value || !$.value) return;
1197
+ const a = e.clientY - R.value;
1198
+ f.value = X.value + a, e.preventDefault();
1167
1199
  }
1168
- function Ie(e) {
1169
- if (!d.value || !P.value) return;
1170
- P.value = !1;
1171
- const a = f.value - U.value;
1172
- Math.abs(a) > 100 ? a > 0 && q.value ? Ye() : a < 0 && R.value ? Ce() : le() : le(), e.preventDefault();
1200
+ function $e(e) {
1201
+ if (!d.value || !$.value) return;
1202
+ $.value = !1;
1203
+ const a = f.value - X.value;
1204
+ Math.abs(a) > 100 ? a > 0 && U.value ? Ue() : a < 0 && C.value ? Ve() : re() : re(), e.preventDefault();
1173
1205
  }
1174
- function Ce() {
1175
- if (!R.value) {
1176
- ve();
1206
+ function Ve() {
1207
+ if (!C.value) {
1208
+ me();
1177
1209
  return;
1178
1210
  }
1179
- n.value++, le(), n.value >= o.value.length - 5 && ve();
1211
+ n.value++, re(), n.value >= o.value.length - 5 && me();
1180
1212
  }
1181
- function Ye() {
1182
- q.value && (n.value--, le());
1213
+ function Ue() {
1214
+ U.value && (n.value--, re());
1183
1215
  }
1184
- function le() {
1185
- if (!C.value) return;
1186
- const e = C.value.clientHeight;
1216
+ function re() {
1217
+ if (!Y.value) return;
1218
+ const e = Y.value.clientHeight;
1187
1219
  f.value = -n.value * e;
1188
1220
  }
1189
- function qe() {
1190
- !d.value && n.value > 0 && (n.value = 0, f.value = 0), d.value && o.value.length === 0 && !h.value && Ee(x.value[0]), d.value && le();
1221
+ function _e() {
1222
+ !d.value && n.value > 0 && (n.value = 0, f.value = 0), d.value && o.value.length === 0 && !h.value && Le(b.value[0]), d.value && re();
1191
1223
  }
1192
- function Mt(e, a, i) {
1193
- H.value = a, x.value = [a], x.value.push(i), w.value = i == null, ie(e, "init"), d.value ? (o.value = [...o.value, ...e], n.value === 0 && o.value.length > 0 && (f.value = 0)) : (ae([...o.value, ...e]), ee());
1224
+ function kt(e, a, l) {
1225
+ H.value = a, b.value = [a], b.value.push(l), w.value = l == null, se(e, "init"), d.value ? (o.value = [...o.value, ...e], n.value === 0 && o.value.length > 0 && (f.value = 0)) : (Z([...o.value, ...e]), ae());
1194
1226
  }
1195
- return re(
1227
+ return oe(
1196
1228
  p,
1197
1229
  () => {
1198
- d.value || y.value && ($.value = fe(p.value, s.value), ae(o.value));
1230
+ d.value || y.value && (P.value = he(p.value, u.value), Z(o.value));
1199
1231
  },
1200
1232
  { deep: !0 }
1201
- ), re(() => r.layoutMode, () => {
1202
- E.value && E.value.width !== void 0 ? s.value = E.value.width : l.value && (s.value = l.value.clientWidth);
1203
- }), re(y, (e) => {
1204
- e && !d.value ? (e.removeEventListener("scroll", se), e.addEventListener("scroll", se, { passive: !0 })) : e && e.removeEventListener("scroll", se);
1205
- }, { immediate: !0 }), re(d, (e, a) => {
1206
- a === void 0 && e === !1 || J(() => {
1207
- e ? (document.addEventListener("mousemove", ke), document.addEventListener("mouseup", Ie), y.value && y.value.removeEventListener("scroll", se), n.value = 0, f.value = 0, o.value.length > 0 && le()) : (document.removeEventListener("mousemove", ke), document.removeEventListener("mouseup", Ie), y.value && l.value && (E.value && E.value.width !== void 0 ? s.value = E.value.width : s.value = l.value.clientWidth, y.value.removeEventListener("scroll", se), y.value.addEventListener("scroll", se, { passive: !0 }), o.value.length > 0 && ($.value = fe(p.value, s.value), ae(o.value), k.value = y.value.scrollTop, z.value = y.value.clientHeight, ee())));
1233
+ ), oe(() => i.layoutMode, () => {
1234
+ E.value && E.value.width !== void 0 ? u.value = E.value.width : r.value && (u.value = r.value.clientWidth);
1235
+ }), oe(y, (e) => {
1236
+ e && !d.value ? (e.removeEventListener("scroll", fe), e.addEventListener("scroll", fe, { passive: !0 })) : e && e.removeEventListener("scroll", fe);
1237
+ }, { immediate: !0 }), oe(d, (e, a) => {
1238
+ a === void 0 && e === !1 || G(() => {
1239
+ e ? (document.addEventListener("mousemove", Se), document.addEventListener("mouseup", $e), y.value && y.value.removeEventListener("scroll", fe), n.value = 0, f.value = 0, o.value.length > 0 && re()) : (document.removeEventListener("mousemove", Se), document.removeEventListener("mouseup", $e), y.value && r.value && (E.value && E.value.width !== void 0 ? u.value = E.value.width : u.value = r.value.clientWidth, y.value.removeEventListener("scroll", fe), y.value.addEventListener("scroll", fe, { passive: !0 }), o.value.length > 0 && (P.value = he(p.value, u.value), Z(o.value), L.value = y.value.scrollTop, O.value = y.value.clientHeight, ae())));
1208
1240
  });
1209
- }, { immediate: !0 }), re(C, (e) => {
1210
- e && (e.addEventListener("touchstart", Ae, { passive: !1 }), e.addEventListener("touchmove", Oe, { passive: !1 }), e.addEventListener("touchend", Re), e.addEventListener("mousedown", je));
1211
- }), re(() => o.value.length, (e, a) => {
1212
- d.value && e > 0 && a === 0 && (n.value = 0, J(() => le()));
1213
- }), re(l, (e) => {
1241
+ }, { immediate: !0 }), oe(Y, (e) => {
1242
+ e && (e.addEventListener("touchstart", je, { passive: !1 }), e.addEventListener("touchmove", Ce, { passive: !1 }), e.addEventListener("touchend", qe), e.addEventListener("mousedown", Ye));
1243
+ }), oe(() => o.value.length, (e, a) => {
1244
+ d.value && e > 0 && a === 0 && (n.value = 0, G(() => re()));
1245
+ }), oe(r, (e) => {
1214
1246
  S && (S.disconnect(), S = null), e && typeof ResizeObserver < "u" ? (S = new ResizeObserver((a) => {
1215
1247
  if (!E.value)
1216
- for (const i of a) {
1217
- const m = i.contentRect.width, u = i.contentRect.height;
1218
- s.value !== m && (s.value = m), b.value !== u && (b.value = u);
1248
+ for (const l of a) {
1249
+ const m = l.contentRect.width, s = l.contentRect.height;
1250
+ u.value !== m && (u.value = m), x.value !== s && (x.value = s);
1219
1251
  }
1220
- }), S.observe(e), E.value || (s.value = e.clientWidth, b.value = e.clientHeight)) : e && (E.value || (s.value = e.clientWidth, b.value = e.clientHeight));
1221
- }, { immediate: !0 }), re(s, (e, a) => {
1222
- e !== a && e > 0 && !d.value && y.value && o.value.length > 0 && J(() => {
1223
- $.value = fe(p.value, e), ae(o.value), ee();
1252
+ }), S.observe(e), E.value || (u.value = e.clientWidth, x.value = e.clientHeight)) : e && (E.value || (u.value = e.clientWidth, x.value = e.clientHeight));
1253
+ }, { immediate: !0 }), oe(u, (e, a) => {
1254
+ e !== a && e > 0 && !d.value && y.value && o.value.length > 0 && G(() => {
1255
+ P.value = he(p.value, e), Z(o.value), ae();
1224
1256
  });
1225
- }), at(async () => {
1257
+ }), rt(async () => {
1226
1258
  try {
1227
- await J(), l.value && !S && (s.value = l.value.clientWidth, b.value = l.value.clientHeight), d.value || ($.value = fe(p.value, s.value), y.value && (k.value = y.value.scrollTop, z.value = y.value.clientHeight));
1228
- const e = r.loadAtPage;
1229
- x.value = [e], r.skipInitialLoad || await Ee(x.value[0]), d.value ? J(() => le()) : ee();
1259
+ await G(), r.value && !S && (u.value = r.value.clientWidth, x.value = r.value.clientHeight), d.value || (P.value = he(p.value, u.value), y.value && (L.value = y.value.scrollTop, O.value = y.value.clientHeight));
1260
+ const e = i.loadAtPage;
1261
+ b.value = [e], i.skipInitialLoad || await Le(b.value[0]), d.value ? G(() => re()) : ae();
1230
1262
  } catch (e) {
1231
1263
  console.error("Error during component initialization:", e), h.value = !1;
1232
1264
  }
1233
- window.addEventListener("resize", ze), window.addEventListener("resize", qe);
1234
- }), nt(() => {
1265
+ window.addEventListener("resize", Re), window.addEventListener("resize", _e);
1266
+ }), ot(() => {
1235
1267
  var e;
1236
- S && (S.disconnect(), S = null), (e = y.value) == null || e.removeEventListener("scroll", se), window.removeEventListener("resize", ze), window.removeEventListener("resize", qe), C.value && (C.value.removeEventListener("touchstart", Ae), C.value.removeEventListener("touchmove", Oe), C.value.removeEventListener("touchend", Re), C.value.removeEventListener("mousedown", je)), document.removeEventListener("mousemove", ke), document.removeEventListener("mouseup", Ie);
1237
- }), (e, a) => (F(), D("div", {
1268
+ S && (S.disconnect(), S = null), (e = y.value) == null || e.removeEventListener("scroll", fe), window.removeEventListener("resize", Re), window.removeEventListener("resize", _e), Y.value && (Y.value.removeEventListener("touchstart", je), Y.value.removeEventListener("touchmove", Ce), Y.value.removeEventListener("touchend", qe), Y.value.removeEventListener("mousedown", Ye)), document.removeEventListener("mousemove", Se), document.removeEventListener("mouseup", $e);
1269
+ }), (e, a) => (D(), B("div", {
1238
1270
  ref_key: "wrapper",
1239
- ref: l,
1271
+ ref: r,
1240
1272
  class: "w-full h-full flex flex-col relative"
1241
1273
  }, [
1242
- d.value ? (F(), D("div", {
1274
+ d.value ? (D(), B("div", {
1243
1275
  key: 0,
1244
- class: ue(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion": r.forceMotion, "cursor-grab": !P.value, "cursor-grabbing": P.value }]),
1276
+ class: de(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion": i.forceMotion, "cursor-grab": !$.value, "cursor-grabbing": $.value }]),
1245
1277
  ref_key: "swipeContainer",
1246
- ref: C,
1278
+ ref: Y,
1247
1279
  style: { height: "100%", "max-height": "100%", position: "relative" }
1248
1280
  }, [
1249
- O("div", {
1281
+ j("div", {
1250
1282
  class: "relative w-full",
1251
- style: we({
1283
+ style: Me({
1252
1284
  transform: `translateY(${f.value}px)`,
1253
- transition: P.value ? "none" : `transform ${t.transitionDurationMs}ms ${t.transitionEasing}`,
1285
+ transition: $.value ? "none" : `transform ${t.transitionDurationMs}ms ${t.transitionEasing}`,
1254
1286
  height: `${o.value.length * 100}%`
1255
1287
  })
1256
1288
  }, [
1257
- (F(!0), D(Ue, null, Ge(o.value, (i, m) => (F(), D("div", {
1258
- key: `${i.page}-${i.id}`,
1289
+ (D(!0), B(Je, null, Ke(o.value, (l, m) => (D(), B("div", {
1290
+ key: `${l.page}-${l.id}`,
1259
1291
  class: "absolute top-0 left-0 w-full",
1260
- style: we({
1292
+ style: Me({
1261
1293
  top: `${m * (100 / o.value.length)}%`,
1262
1294
  height: `${100 / o.value.length}%`
1263
1295
  })
1264
1296
  }, [
1265
- O("div", da, [
1266
- O("div", ma, [
1267
- Q(e.$slots, "default", {
1268
- item: i,
1269
- remove: de
1297
+ j("div", ya, [
1298
+ j("div", wa, [
1299
+ ee(e.$slots, "default", {
1300
+ item: l,
1301
+ remove: ge,
1302
+ index: l.originalIndex ?? i.items.indexOf(l)
1270
1303
  }, () => [
1271
- $e(Me, {
1272
- item: i,
1273
- remove: de,
1304
+ He(Ie, {
1305
+ item: l,
1306
+ remove: ge,
1274
1307
  "header-height": p.value.header,
1275
1308
  "footer-height": p.value.footer,
1276
1309
  "in-swipe-mode": !0,
1277
1310
  "is-active": m === n.value,
1278
- "onPreload:success": a[0] || (a[0] = (u) => g("item:preload:success", u)),
1279
- "onPreload:error": a[1] || (a[1] = (u) => g("item:preload:error", u)),
1280
- onMouseEnter: a[2] || (a[2] = (u) => g("item:mouse-enter", u)),
1281
- onMouseLeave: a[3] || (a[3] = (u) => g("item:mouse-leave", u))
1311
+ "onPreload:success": a[0] || (a[0] = (s) => g("item:preload:success", s)),
1312
+ "onPreload:error": a[1] || (a[1] = (s) => g("item:preload:error", s)),
1313
+ onMouseEnter: a[2] || (a[2] = (s) => g("item:mouse-enter", s)),
1314
+ onMouseLeave: a[3] || (a[3] = (s) => g("item:mouse-leave", s))
1282
1315
  }, {
1283
- header: ge((u) => [
1284
- Q(e.$slots, "item-header", pe({ ref_for: !0 }, u), void 0, !0)
1316
+ header: we((s) => [
1317
+ ee(e.$slots, "item-header", xe({ ref_for: !0 }, s), void 0, !0)
1285
1318
  ]),
1286
- footer: ge((u) => [
1287
- Q(e.$slots, "item-footer", pe({ ref_for: !0 }, u), void 0, !0)
1319
+ footer: we((s) => [
1320
+ ee(e.$slots, "item-footer", xe({ ref_for: !0 }, s), void 0, !0)
1288
1321
  ]),
1289
1322
  _: 2
1290
1323
  }, 1032, ["item", "header-height", "footer-height", "is-active"])
@@ -1293,61 +1326,62 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
1293
1326
  ])
1294
1327
  ], 4))), 128))
1295
1328
  ], 4),
1296
- w.value && o.value.length > 0 ? (F(), D("div", ha, [
1297
- Q(e.$slots, "end-message", {}, () => [
1298
- a[8] || (a[8] = O("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1329
+ w.value && o.value.length > 0 ? (D(), B("div", xa, [
1330
+ ee(e.$slots, "end-message", {}, () => [
1331
+ a[8] || (a[8] = j("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1299
1332
  ], !0)
1300
- ])) : ne("", !0),
1301
- M.value && o.value.length > 0 ? (F(), D("div", ga, [
1302
- Q(e.$slots, "error-message", { error: M.value }, () => [
1303
- O("p", pa, "Failed to load content: " + He(M.value.message), 1)
1333
+ ])) : le("", !0),
1334
+ M.value && o.value.length > 0 ? (D(), B("div", ba, [
1335
+ ee(e.$slots, "error-message", { error: M.value }, () => [
1336
+ j("p", Ma, "Failed to load content: " + Ae(M.value.message), 1)
1304
1337
  ], !0)
1305
- ])) : ne("", !0)
1306
- ], 2)) : (F(), D("div", {
1338
+ ])) : le("", !0)
1339
+ ], 2)) : (D(), B("div", {
1307
1340
  key: 1,
1308
- class: ue(["overflow-auto w-full flex-1 masonry-container", { "force-motion": r.forceMotion }]),
1341
+ class: de(["overflow-auto w-full flex-1 masonry-container", { "force-motion": i.forceMotion }]),
1309
1342
  ref_key: "container",
1310
1343
  ref: y
1311
1344
  }, [
1312
- O("div", {
1345
+ j("div", {
1313
1346
  class: "relative",
1314
- style: we({ height: `${B.value}px`, "--masonry-duration": `${t.transitionDurationMs}ms`, "--masonry-leave-duration": `${t.leaveDurationMs}ms`, "--masonry-ease": t.transitionEasing })
1347
+ style: Me({ height: `${z.value}px`, "--masonry-duration": `${t.transitionDurationMs}ms`, "--masonry-leave-duration": `${t.leaveDurationMs}ms`, "--masonry-ease": t.transitionEasing })
1315
1348
  }, [
1316
- $e(Tt, {
1349
+ He(St, {
1317
1350
  name: "masonry",
1318
1351
  css: !1,
1319
- onEnter: ut,
1320
- onBeforeEnter: vt,
1321
- onLeave: ft,
1322
- onBeforeLeave: ct
1352
+ onEnter: ft,
1353
+ onBeforeEnter: dt,
1354
+ onLeave: ht,
1355
+ onBeforeLeave: mt
1323
1356
  }, {
1324
- default: ge(() => [
1325
- (F(!0), D(Ue, null, Ge(dt.value, (i, m) => (F(), D("div", pe({
1326
- key: `${i.page}-${i.id}`,
1357
+ default: we(() => [
1358
+ (D(!0), B(Je, null, Ke(gt.value, (l, m) => (D(), B("div", xe({
1359
+ key: `${l.page}-${l.id}`,
1327
1360
  class: "absolute masonry-item",
1328
1361
  ref_for: !0
1329
- }, Lt(ta)(i, m)), [
1330
- Q(e.$slots, "default", {
1331
- item: i,
1332
- remove: de
1362
+ }, $t(oa)(l, m)), [
1363
+ ee(e.$slots, "default", {
1364
+ item: l,
1365
+ remove: ge,
1366
+ index: l.originalIndex ?? t.items.indexOf(l)
1333
1367
  }, () => [
1334
- $e(Me, {
1335
- item: i,
1336
- remove: de,
1368
+ He(Ie, {
1369
+ item: l,
1370
+ remove: ge,
1337
1371
  "header-height": p.value.header,
1338
1372
  "footer-height": p.value.footer,
1339
1373
  "in-swipe-mode": !1,
1340
1374
  "is-active": !1,
1341
- "onPreload:success": a[4] || (a[4] = (u) => g("item:preload:success", u)),
1342
- "onPreload:error": a[5] || (a[5] = (u) => g("item:preload:error", u)),
1343
- onMouseEnter: a[6] || (a[6] = (u) => g("item:mouse-enter", u)),
1344
- onMouseLeave: a[7] || (a[7] = (u) => g("item:mouse-leave", u))
1375
+ "onPreload:success": a[4] || (a[4] = (s) => g("item:preload:success", s)),
1376
+ "onPreload:error": a[5] || (a[5] = (s) => g("item:preload:error", s)),
1377
+ onMouseEnter: a[6] || (a[6] = (s) => g("item:mouse-enter", s)),
1378
+ onMouseLeave: a[7] || (a[7] = (s) => g("item:mouse-leave", s))
1345
1379
  }, {
1346
- header: ge((u) => [
1347
- Q(e.$slots, "item-header", pe({ ref_for: !0 }, u), void 0, !0)
1380
+ header: we((s) => [
1381
+ ee(e.$slots, "item-header", xe({ ref_for: !0 }, s), void 0, !0)
1348
1382
  ]),
1349
- footer: ge((u) => [
1350
- Q(e.$slots, "item-footer", pe({ ref_for: !0 }, u), void 0, !0)
1383
+ footer: we((s) => [
1384
+ ee(e.$slots, "item-footer", xe({ ref_for: !0 }, s), void 0, !0)
1351
1385
  ]),
1352
1386
  _: 2
1353
1387
  }, 1032, ["item", "header-height", "footer-height"])
@@ -1357,31 +1391,31 @@ const la = { class: "flex-1 relative min-h-0" }, ra = { class: "w-full h-full ro
1357
1391
  _: 3
1358
1392
  })
1359
1393
  ], 4),
1360
- w.value && o.value.length > 0 ? (F(), D("div", ya, [
1361
- Q(e.$slots, "end-message", {}, () => [
1362
- a[9] || (a[9] = O("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1394
+ w.value && o.value.length > 0 ? (D(), B("div", Ea, [
1395
+ ee(e.$slots, "end-message", {}, () => [
1396
+ a[9] || (a[9] = j("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1363
1397
  ], !0)
1364
- ])) : ne("", !0),
1365
- M.value && o.value.length > 0 ? (F(), D("div", wa, [
1366
- Q(e.$slots, "error-message", { error: M.value }, () => [
1367
- O("p", ba, "Failed to load content: " + He(M.value.message), 1)
1398
+ ])) : le("", !0),
1399
+ M.value && o.value.length > 0 ? (D(), B("div", Ta, [
1400
+ ee(e.$slots, "error-message", { error: M.value }, () => [
1401
+ j("p", Ia, "Failed to load content: " + Ae(M.value.message), 1)
1368
1402
  ], !0)
1369
- ])) : ne("", !0)
1403
+ ])) : le("", !0)
1370
1404
  ], 2))
1371
1405
  ], 512));
1372
1406
  }
1373
- }), Ma = (t, v) => {
1407
+ }), ka = (t, v) => {
1374
1408
  const c = t.__vccOpts || t;
1375
- for (const [r, L] of v)
1376
- c[r] = L;
1409
+ for (const [i, I] of v)
1410
+ c[i] = I;
1377
1411
  return c;
1378
- }, et = /* @__PURE__ */ Ma(xa, [["__scopeId", "data-v-01598521"]]), Ta = {
1412
+ }, nt = /* @__PURE__ */ ka(La, [["__scopeId", "data-v-2168600e"]]), Sa = {
1379
1413
  install(t) {
1380
- t.component("WyxosMasonry", et), t.component("WMasonry", et), t.component("WyxosMasonryItem", Me), t.component("WMasonryItem", Me);
1414
+ t.component("WyxosMasonry", nt), t.component("WMasonry", nt), t.component("WyxosMasonryItem", Ie), t.component("WMasonryItem", Ie);
1381
1415
  }
1382
1416
  };
1383
1417
  export {
1384
- et as Masonry,
1385
- Me as MasonryItem,
1386
- Ta as default
1418
+ nt as Masonry,
1419
+ Ie as MasonryItem,
1420
+ Sa as default
1387
1421
  };