@wyxos/vibe 1.6.12 → 1.6.14

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