@wyxos/vibe 1.6.27 → 1.6.28

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,22 +1,22 @@
1
- import { nextTick as X, ref as W, computed as K, defineComponent as _e, onMounted as Xe, onUnmounted as Ge, watch as ee, createElementBlock as q, openBlock as Y, createCommentVNode as te, createElementVNode as U, normalizeStyle as he, renderSlot as J, normalizeClass as re, withModifiers as Ae, toDisplayString as Pe, unref as G, Fragment as Re, renderList as Oe, createVNode as Se, withCtx as ve, mergeProps as fe, TransitionGroup as It } from "vue";
1
+ import { nextTick as C, ref as F, computed as Q, defineComponent as Xe, onMounted as Ge, onUnmounted as qe, watch as te, createElementBlock as U, openBlock as _, createCommentVNode as ae, createElementVNode as G, normalizeStyle as he, renderSlot as J, normalizeClass as ie, withModifiers as Re, toDisplayString as Ee, unref as q, Fragment as Ce, renderList as Oe, createVNode as Le, withCtx as ve, mergeProps as fe, TransitionGroup as Pt } from "vue";
2
2
  let ke = null;
3
- function Lt() {
3
+ function It() {
4
4
  if (ke != null) return ke;
5
5
  const e = document.createElement("div");
6
6
  e.style.visibility = "hidden", e.style.overflow = "scroll", e.style.msOverflowStyle = "scrollbar", e.style.width = "100px", e.style.height = "100px", document.body.appendChild(e);
7
- const n = document.createElement("div");
8
- n.style.width = "100%", e.appendChild(n);
9
- const i = e.offsetWidth - n.offsetWidth;
7
+ const l = document.createElement("div");
8
+ l.style.width = "100%", e.appendChild(l);
9
+ const i = e.offsetWidth - l.offsetWidth;
10
10
  return document.body.removeChild(e), ke = i, i;
11
11
  }
12
- function Ce(e, n, i, a = {}) {
12
+ function Ae(e, l, i, a = {}) {
13
13
  const {
14
- gutterX: m = 0,
14
+ gutterX: g = 0,
15
15
  gutterY: d = 0,
16
- header: f = 0,
16
+ header: v = 0,
17
17
  footer: o = 0,
18
- paddingLeft: c = 0,
19
- paddingRight: y = 0,
18
+ paddingLeft: s = 0,
19
+ paddingRight: w = 0,
20
20
  sizes: t = {
21
21
  base: 1,
22
22
  sm: 2,
@@ -25,190 +25,190 @@ function Ce(e, n, i, a = {}) {
25
25
  xl: 5,
26
26
  "2xl": 6
27
27
  },
28
- placement: w = "masonry"
28
+ placement: x = "masonry"
29
29
  } = a;
30
- let T = 0, p = 0;
30
+ let T = 0, y = 0;
31
31
  try {
32
- if (n && n.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
33
- const k = window.getComputedStyle(n);
34
- T = parseFloat(k.paddingLeft) || 0, p = parseFloat(k.paddingRight) || 0;
32
+ if (l && l.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
33
+ const k = window.getComputedStyle(l);
34
+ T = parseFloat(k.paddingLeft) || 0, y = parseFloat(k.paddingRight) || 0;
35
35
  }
36
36
  } catch {
37
37
  }
38
- const h = (c || 0) + T, I = (y || 0) + p, S = n.offsetWidth - n.clientWidth, v = S > 0 ? S + 2 : Lt() + 2, r = n.offsetWidth - v - h - I, s = m * (i - 1), L = Math.floor((r - s) / i), M = e.map((k) => {
39
- const N = k.width, A = k.height;
40
- return Math.round(L * A / N) + o + f;
38
+ const h = (s || 0) + T, P = (w || 0) + y, I = l.offsetWidth - l.clientWidth, f = I > 0 ? I + 2 : It() + 2, r = l.offsetWidth - f - h - P, u = g * (i - 1), L = Math.floor((r - u) / i), M = e.map((k) => {
39
+ const B = k.width, R = k.height;
40
+ return Math.round(L * R / B) + o + v;
41
41
  });
42
- if (w === "sequential-balanced") {
42
+ if (x === "sequential-balanced") {
43
43
  const k = M.length;
44
44
  if (k === 0) return [];
45
- const N = (b, H, R) => b + (H > 0 ? d : 0) + R;
46
- let A = Math.max(...M), P = M.reduce((b, H) => b + H, 0) + d * Math.max(0, k - 1);
47
- const z = (b) => {
48
- let H = 1, R = 0, ne = 0;
49
- for (let _ = 0; _ < k; _++) {
50
- const ie = M[_], Q = N(R, ne, ie);
51
- if (Q <= b)
52
- R = Q, ne++;
53
- else if (H++, R = ie, ne = 1, ie > b || H > i) return !1;
45
+ const B = (b, E, O) => b + (E > 0 ? d : 0) + O;
46
+ let R = Math.max(...M), $ = M.reduce((b, E) => b + E, 0) + d * Math.max(0, k - 1);
47
+ const W = (b) => {
48
+ let E = 1, O = 0, ne = 0;
49
+ for (let X = 0; X < k; X++) {
50
+ const Z = M[X], K = B(O, ne, Z);
51
+ if (K <= b)
52
+ O = K, ne++;
53
+ else if (E++, O = Z, ne = 1, Z > b || E > i) return !1;
54
54
  }
55
- return H <= i;
55
+ return E <= i;
56
56
  };
57
- for (; A < P; ) {
58
- const b = Math.floor((A + P) / 2);
59
- z(b) ? P = b : A = b + 1;
57
+ for (; R < $; ) {
58
+ const b = Math.floor((R + $) / 2);
59
+ W(b) ? $ = b : R = b + 1;
60
60
  }
61
- const F = P, l = new Array(i).fill(0);
62
- let x = i - 1, E = 0, D = 0;
61
+ const H = $, n = new Array(i).fill(0);
62
+ let p = i - 1, S = 0, z = 0;
63
63
  for (let b = k - 1; b >= 0; b--) {
64
- const H = M[b], R = b < x;
65
- !(N(E, D, H) <= F) || R ? (l[x] = b + 1, x--, E = H, D = 1) : (E = N(E, D, H), D++);
64
+ const E = M[b], O = b < p;
65
+ !(B(S, z, E) <= H) || O ? (n[p] = b + 1, p--, S = E, z = 1) : (S = B(S, z, E), z++);
66
66
  }
67
- l[0] = 0;
68
- const V = [], C = new Array(i).fill(0);
67
+ n[0] = 0;
68
+ const V = [], Y = new Array(i).fill(0);
69
69
  for (let b = 0; b < i; b++) {
70
- const H = l[b], R = b + 1 < i ? l[b + 1] : k, ne = b * (L + m);
71
- for (let _ = H; _ < R; _++) {
72
- const Q = {
73
- ...e[_],
70
+ const E = n[b], O = b + 1 < i ? n[b + 1] : k, ne = b * (L + g);
71
+ for (let X = E; X < O; X++) {
72
+ const K = {
73
+ ...e[X],
74
74
  columnWidth: L,
75
75
  imageHeight: 0,
76
76
  columnHeight: 0,
77
77
  left: 0,
78
78
  top: 0
79
79
  };
80
- Q.imageHeight = M[_] - (o + f), Q.columnHeight = M[_], Q.left = ne, Q.top = C[b], C[b] += Q.columnHeight + (_ + 1 < R ? d : 0), V.push(Q);
80
+ K.imageHeight = M[X] - (o + v), K.columnHeight = M[X], K.left = ne, K.top = Y[b], Y[b] += K.columnHeight + (X + 1 < O ? d : 0), V.push(K);
81
81
  }
82
82
  }
83
83
  return V;
84
84
  }
85
- const g = new Array(i).fill(0), $ = [];
85
+ const m = new Array(i).fill(0), N = [];
86
86
  for (let k = 0; k < e.length; k++) {
87
- const N = e[k], A = {
88
- ...N,
87
+ const B = e[k], R = {
88
+ ...B,
89
89
  columnWidth: 0,
90
90
  imageHeight: 0,
91
91
  columnHeight: 0,
92
92
  left: 0,
93
93
  top: 0
94
- }, P = g.indexOf(Math.min(...g)), z = N.width, F = N.height;
95
- A.columnWidth = L, A.left = P * (L + m), A.imageHeight = Math.round(L * F / z), A.columnHeight = A.imageHeight + o + f, A.top = g[P], g[P] += A.columnHeight + d, $.push(A);
94
+ }, $ = m.indexOf(Math.min(...m)), W = B.width, H = B.height;
95
+ R.columnWidth = L, R.left = $ * (L + g), R.imageHeight = Math.round(L * H / W), R.columnHeight = R.imageHeight + o + v, R.top = m[$], m[$] += R.columnHeight + d, N.push(R);
96
96
  }
97
- return $;
97
+ return N;
98
98
  }
99
- var St = typeof global == "object" && global && global.Object === Object && global, kt = typeof self == "object" && self && self.Object === Object && self, Je = St || kt || Function("return this")(), we = Je.Symbol, Ke = Object.prototype, Et = Ke.hasOwnProperty, Pt = Ke.toString, de = we ? we.toStringTag : void 0;
99
+ var Lt = typeof global == "object" && global && global.Object === Object && global, kt = typeof self == "object" && self && self.Object === Object && self, Je = Lt || kt || Function("return this")(), we = Je.Symbol, Ke = Object.prototype, St = Ke.hasOwnProperty, Et = Ke.toString, de = we ? we.toStringTag : void 0;
100
100
  function Ht(e) {
101
- var n = Et.call(e, de), i = e[de];
101
+ var l = St.call(e, de), i = e[de];
102
102
  try {
103
103
  e[de] = void 0;
104
104
  var a = !0;
105
105
  } catch {
106
106
  }
107
- var m = Pt.call(e);
108
- return a && (n ? e[de] = i : delete e[de]), m;
107
+ var g = Et.call(e);
108
+ return a && (l ? e[de] = i : delete e[de]), g;
109
109
  }
110
- var $t = Object.prototype, Ft = $t.toString;
110
+ var $t = Object.prototype, Nt = $t.toString;
111
111
  function zt(e) {
112
- return Ft.call(e);
112
+ return Nt.call(e);
113
113
  }
114
114
  var Dt = "[object Null]", Bt = "[object Undefined]", Ve = we ? we.toStringTag : void 0;
115
- function Nt(e) {
115
+ function Wt(e) {
116
116
  return e == null ? e === void 0 ? Bt : Dt : Ve && Ve in Object(e) ? Ht(e) : zt(e);
117
117
  }
118
- function Wt(e) {
118
+ function Ft(e) {
119
119
  return e != null && typeof e == "object";
120
120
  }
121
- var At = "[object Symbol]";
122
- function Rt(e) {
123
- return typeof e == "symbol" || Wt(e) && Nt(e) == At;
121
+ var Rt = "[object Symbol]";
122
+ function Ct(e) {
123
+ return typeof e == "symbol" || Ft(e) && Wt(e) == Rt;
124
124
  }
125
125
  var Ot = /\s/;
126
- function Ct(e) {
127
- for (var n = e.length; n-- && Ot.test(e.charAt(n)); )
126
+ function At(e) {
127
+ for (var l = e.length; l-- && Ot.test(e.charAt(l)); )
128
128
  ;
129
- return n;
129
+ return l;
130
130
  }
131
131
  var Vt = /^\s+/;
132
132
  function jt(e) {
133
- return e && e.slice(0, Ct(e) + 1).replace(Vt, "");
133
+ return e && e.slice(0, At(e) + 1).replace(Vt, "");
134
134
  }
135
135
  function He(e) {
136
- var n = typeof e;
137
- return e != null && (n == "object" || n == "function");
136
+ var l = typeof e;
137
+ return e != null && (l == "object" || l == "function");
138
138
  }
139
- var je = NaN, qt = /^[-+]0x[0-9a-f]+$/i, Yt = /^0b[01]+$/i, Ut = /^0o[0-7]+$/i, _t = parseInt;
140
- function qe(e) {
139
+ var je = NaN, Yt = /^[-+]0x[0-9a-f]+$/i, Ut = /^0b[01]+$/i, _t = /^0o[0-7]+$/i, Xt = parseInt;
140
+ function Ye(e) {
141
141
  if (typeof e == "number")
142
142
  return e;
143
- if (Rt(e))
143
+ if (Ct(e))
144
144
  return je;
145
145
  if (He(e)) {
146
- var n = typeof e.valueOf == "function" ? e.valueOf() : e;
147
- e = He(n) ? n + "" : n;
146
+ var l = typeof e.valueOf == "function" ? e.valueOf() : e;
147
+ e = He(l) ? l + "" : l;
148
148
  }
149
149
  if (typeof e != "string")
150
150
  return e === 0 ? e : +e;
151
151
  e = jt(e);
152
- var i = Yt.test(e);
153
- return i || Ut.test(e) ? _t(e.slice(2), i ? 2 : 8) : qt.test(e) ? je : +e;
152
+ var i = Ut.test(e);
153
+ return i || _t.test(e) ? Xt(e.slice(2), i ? 2 : 8) : Yt.test(e) ? je : +e;
154
154
  }
155
- var Ee = function() {
155
+ var Se = function() {
156
156
  return Je.Date.now();
157
- }, Xt = "Expected a function", Gt = Math.max, Jt = Math.min;
158
- function Ye(e, n, i) {
159
- var a, m, d, f, o, c, y = 0, t = !1, w = !1, T = !0;
157
+ }, Gt = "Expected a function", qt = Math.max, Jt = Math.min;
158
+ function Ue(e, l, i) {
159
+ var a, g, d, v, o, s, w = 0, t = !1, x = !1, T = !0;
160
160
  if (typeof e != "function")
161
- throw new TypeError(Xt);
162
- n = qe(n) || 0, He(i) && (t = !!i.leading, w = "maxWait" in i, d = w ? Gt(qe(i.maxWait) || 0, n) : d, T = "trailing" in i ? !!i.trailing : T);
163
- function p(g) {
164
- var $ = a, k = m;
165
- return a = m = void 0, y = g, f = e.apply(k, $), f;
161
+ throw new TypeError(Gt);
162
+ l = Ye(l) || 0, He(i) && (t = !!i.leading, x = "maxWait" in i, d = x ? qt(Ye(i.maxWait) || 0, l) : d, T = "trailing" in i ? !!i.trailing : T);
163
+ function y(m) {
164
+ var N = a, k = g;
165
+ return a = g = void 0, w = m, v = e.apply(k, N), v;
166
166
  }
167
- function h(g) {
168
- return y = g, o = setTimeout(v, n), t ? p(g) : f;
167
+ function h(m) {
168
+ return w = m, o = setTimeout(f, l), t ? y(m) : v;
169
169
  }
170
- function I(g) {
171
- var $ = g - c, k = g - y, N = n - $;
172
- return w ? Jt(N, d - k) : N;
170
+ function P(m) {
171
+ var N = m - s, k = m - w, B = l - N;
172
+ return x ? Jt(B, d - k) : B;
173
173
  }
174
- function S(g) {
175
- var $ = g - c, k = g - y;
176
- return c === void 0 || $ >= n || $ < 0 || w && k >= d;
174
+ function I(m) {
175
+ var N = m - s, k = m - w;
176
+ return s === void 0 || N >= l || N < 0 || x && k >= d;
177
177
  }
178
- function v() {
179
- var g = Ee();
180
- if (S(g))
181
- return r(g);
182
- o = setTimeout(v, I(g));
178
+ function f() {
179
+ var m = Se();
180
+ if (I(m))
181
+ return r(m);
182
+ o = setTimeout(f, P(m));
183
183
  }
184
- function r(g) {
185
- return o = void 0, T && a ? p(g) : (a = m = void 0, f);
184
+ function r(m) {
185
+ return o = void 0, T && a ? y(m) : (a = g = void 0, v);
186
186
  }
187
- function s() {
188
- o !== void 0 && clearTimeout(o), y = 0, a = c = m = o = void 0;
187
+ function u() {
188
+ o !== void 0 && clearTimeout(o), w = 0, a = s = g = o = void 0;
189
189
  }
190
190
  function L() {
191
- return o === void 0 ? f : r(Ee());
191
+ return o === void 0 ? v : r(Se());
192
192
  }
193
193
  function M() {
194
- var g = Ee(), $ = S(g);
195
- if (a = arguments, m = this, c = g, $) {
194
+ var m = Se(), N = I(m);
195
+ if (a = arguments, g = this, s = m, N) {
196
196
  if (o === void 0)
197
- return h(c);
198
- if (w)
199
- return clearTimeout(o), o = setTimeout(v, n), p(c);
197
+ return h(s);
198
+ if (x)
199
+ return clearTimeout(o), o = setTimeout(f, l), y(s);
200
200
  }
201
- return o === void 0 && (o = setTimeout(v, n)), f;
201
+ return o === void 0 && (o = setTimeout(f, l)), v;
202
202
  }
203
- return M.cancel = s, M.flush = L, M;
203
+ return M.cancel = u, M.flush = L, M;
204
204
  }
205
- function se(e, n) {
206
- const i = n ?? (typeof window < "u" ? window.innerWidth : 1024), a = e.sizes;
205
+ function se(e, l) {
206
+ const i = l ?? (typeof window < "u" ? window.innerWidth : 1024), a = e.sizes;
207
207
  return i >= 1536 && a["2xl"] ? a["2xl"] : i >= 1280 && a.xl ? a.xl : i >= 1024 && a.lg ? a.lg : i >= 768 && a.md ? a.md : i >= 640 && a.sm ? a.sm : a.base;
208
208
  }
209
209
  function Kt(e) {
210
- const n = e ?? (typeof window < "u" ? window.innerWidth : 1024);
211
- return n >= 1536 ? "2xl" : n >= 1280 ? "xl" : n >= 1024 ? "lg" : n >= 768 ? "md" : n >= 640 ? "sm" : "base";
210
+ const l = e ?? (typeof window < "u" ? window.innerWidth : 1024);
211
+ return l >= 1536 ? "2xl" : l >= 1280 ? "xl" : l >= 1024 ? "lg" : l >= 768 ? "md" : l >= 640 ? "sm" : "base";
212
212
  }
213
213
  function Qt(e) {
214
214
  return e.reduce((i, a) => Math.max(i, a.top + a.columnHeight), 0) + 500;
@@ -222,673 +222,706 @@ function Zt(e) {
222
222
  height: `${e.columnHeight}px`
223
223
  };
224
224
  }
225
- function ea(e, n = 0) {
225
+ function ea(e, l = 0) {
226
226
  return {
227
227
  style: Zt(e),
228
228
  "data-top": e.top,
229
229
  "data-left": e.left,
230
230
  "data-id": `${e.page}-${e.id}`,
231
- "data-index": n
231
+ "data-index": l
232
232
  };
233
233
  }
234
- function $e(e, n) {
235
- if (!e.length || n <= 0)
236
- return new Array(Math.max(1, n)).fill(0);
237
- const a = Array.from(new Set(e.map((f) => f.left))).sort((f, o) => f - o).slice(0, n), m = /* @__PURE__ */ new Map();
238
- for (let f = 0; f < a.length; f++) m.set(a[f], f);
234
+ function $e(e, l) {
235
+ if (!e.length || l <= 0)
236
+ return new Array(Math.max(1, l)).fill(0);
237
+ const a = Array.from(new Set(e.map((v) => v.left))).sort((v, o) => v - o).slice(0, l), g = /* @__PURE__ */ new Map();
238
+ for (let v = 0; v < a.length; v++) g.set(a[v], v);
239
239
  const d = new Array(a.length).fill(0);
240
- for (const f of e) {
241
- const o = m.get(f.left);
242
- o != null && (d[o] = Math.max(d[o], f.top + f.columnHeight));
240
+ for (const v of e) {
241
+ const o = g.get(v.left);
242
+ o != null && (d[o] = Math.max(d[o], v.top + v.columnHeight));
243
243
  }
244
- for (; d.length < n; ) d.push(0);
244
+ for (; d.length < l; ) d.push(0);
245
245
  return d;
246
246
  }
247
- function ta(e, n) {
247
+ function ta(e, l) {
248
248
  let i = 0, a = 0;
249
- const m = 1e3;
250
- function d(t, w) {
249
+ const g = 1e3;
250
+ function d(t, x) {
251
251
  var h;
252
252
  const T = (h = e.container) == null ? void 0 : h.value;
253
253
  if (T) {
254
- const I = T.scrollTop, S = T.clientHeight;
255
- i = I - m, a = I + S + m;
254
+ const P = T.scrollTop, I = T.clientHeight;
255
+ i = P - g, a = P + I + g;
256
256
  }
257
- return t + w >= i && t <= a;
257
+ return t + x >= i && t <= a;
258
258
  }
259
- function f(t, w) {
260
- var r;
261
- const T = parseInt(t.dataset.left || "0", 10), p = parseInt(t.dataset.top || "0", 10), h = parseInt(t.dataset.index || "0", 10), I = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
262
- if ((r = n == null ? void 0 : n.virtualizing) != null && r.value) {
263
- t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${p}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
264
- t.style.transition = "", w();
265
- });
259
+ function v(t, x) {
260
+ var u;
261
+ const T = parseInt(t.dataset.left || "0", 10), y = parseInt(t.dataset.top || "0", 10), h = parseInt(t.dataset.index || "0", 10), P = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
262
+ if ((u = l == null ? void 0 : l.virtualizing) != null && u.value) {
263
+ t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${y}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), t.style.transition = "", x();
266
264
  return;
267
265
  }
268
- if (!d(p, I)) {
269
- t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${p}px, 0) scale(1)`, t.style.transition = "none", w();
266
+ if (!d(y, P)) {
267
+ t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${y}px, 0) scale(1)`, t.style.transition = "none", x();
270
268
  return;
271
269
  }
272
- const S = Math.min(h * 20, 160), v = t.style.getPropertyValue("--masonry-opacity-delay");
273
- t.style.setProperty("--masonry-opacity-delay", `${S}ms`), requestAnimationFrame(() => {
274
- t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${p}px, 0) scale(1)`;
275
- const s = () => {
276
- v ? t.style.setProperty("--masonry-opacity-delay", v) : t.style.removeProperty("--masonry-opacity-delay"), t.removeEventListener("transitionend", s), w();
277
- };
278
- t.addEventListener("transitionend", s);
279
- });
270
+ const I = Math.min(h * 20, 160), f = t.style.getPropertyValue("--masonry-opacity-delay");
271
+ t.style.setProperty("--masonry-opacity-delay", `${I}ms`), t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${y}px, 0) scale(1)`;
272
+ const r = () => {
273
+ f ? t.style.setProperty("--masonry-opacity-delay", f) : t.style.removeProperty("--masonry-opacity-delay"), t.removeEventListener("transitionend", r), x();
274
+ };
275
+ t.addEventListener("transitionend", r);
280
276
  }
281
277
  function o(t) {
282
- var p;
283
- const w = parseInt(t.dataset.left || "0", 10), T = parseInt(t.dataset.top || "0", 10);
284
- if ((p = n == null ? void 0 : n.virtualizing) != null && p.value) {
285
- t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${w}px, ${T}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay");
278
+ var y;
279
+ const x = parseInt(t.dataset.left || "0", 10), T = parseInt(t.dataset.top || "0", 10);
280
+ if ((y = l == null ? void 0 : l.virtualizing) != null && y.value) {
281
+ t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${x}px, ${T}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay");
286
282
  return;
287
283
  }
288
- t.style.opacity = "0", t.style.transform = `translate3d(${w}px, ${T + 10}px, 0) scale(0.985)`;
284
+ t.style.opacity = "0", t.style.transform = `translate3d(${x}px, ${T + 10}px, 0) scale(0.985)`;
289
285
  }
290
- function c(t) {
286
+ function s(t) {
291
287
  var h;
292
- const w = parseInt(t.dataset.left || "0", 10), T = parseInt(t.dataset.top || "0", 10), p = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
293
- if (!((h = n == null ? void 0 : n.virtualizing) != null && h.value)) {
294
- if (!d(T, p)) {
288
+ const x = parseInt(t.dataset.left || "0", 10), T = parseInt(t.dataset.top || "0", 10), y = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
289
+ if (!((h = l == null ? void 0 : l.virtualizing) != null && h.value)) {
290
+ if (!d(T, y)) {
295
291
  t.style.transition = "none";
296
292
  return;
297
293
  }
298
- t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${w}px, ${T}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
299
- t.style.transition = "";
300
- });
294
+ t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${x}px, ${T}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), t.style.transition = "";
301
295
  }
302
296
  }
303
- function y(t, w) {
297
+ function w(t, x) {
304
298
  var M;
305
- const T = parseInt(t.dataset.left || "0", 10), p = parseInt(t.dataset.top || "0", 10), h = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
306
- if ((M = n == null ? void 0 : n.virtualizing) != null && M.value) {
307
- w();
299
+ const T = parseInt(t.dataset.left || "0", 10), y = parseInt(t.dataset.top || "0", 10), h = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
300
+ if ((M = l == null ? void 0 : l.virtualizing) != null && M.value) {
301
+ x();
308
302
  return;
309
303
  }
310
- if (!d(p, h)) {
311
- t.style.transition = "none", t.style.opacity = "0", w();
304
+ if (!d(y, h)) {
305
+ t.style.transition = "none", t.style.opacity = "0", x();
312
306
  return;
313
307
  }
314
- const I = typeof (n == null ? void 0 : n.leaveDurationMs) == "number" ? n.leaveDurationMs : Number.NaN;
315
- let S = Number.isFinite(I) && I > 0 ? I : Number.NaN;
316
- if (!Number.isFinite(S)) {
317
- const $ = getComputedStyle(t).getPropertyValue("--masonry-leave-duration") || "", k = parseFloat($);
318
- S = Number.isFinite(k) && k > 0 ? k : 200;
308
+ const P = typeof (l == null ? void 0 : l.leaveDurationMs) == "number" ? l.leaveDurationMs : Number.NaN;
309
+ let I = Number.isFinite(P) && P > 0 ? P : Number.NaN;
310
+ if (!Number.isFinite(I)) {
311
+ const N = getComputedStyle(t).getPropertyValue("--masonry-leave-duration") || "", k = parseFloat(N);
312
+ I = Number.isFinite(k) && k > 0 ? k : 200;
319
313
  }
320
- const v = t.style.transitionDuration, r = () => {
321
- t.removeEventListener("transitionend", s), clearTimeout(L), t.style.transitionDuration = v || "";
322
- }, s = (g) => {
323
- (!g || g.target === t) && (r(), w());
314
+ const f = t.style.transitionDuration, r = () => {
315
+ t.removeEventListener("transitionend", u), clearTimeout(L), t.style.transitionDuration = f || "";
316
+ }, u = (m) => {
317
+ (!m || m.target === t) && (r(), x());
324
318
  }, L = setTimeout(() => {
325
- r(), w();
326
- }, S + 100);
327
- requestAnimationFrame(() => {
328
- t.style.transitionDuration = `${S}ms`, t.style.opacity = "0", t.style.transform = `translate3d(${T}px, ${p + 10}px, 0) scale(0.985)`, t.addEventListener("transitionend", s);
329
- });
319
+ r(), x();
320
+ }, I + 100);
321
+ t.style.transitionDuration = `${I}ms`, t.style.opacity = "0", t.style.transform = `translate3d(${T}px, ${y + 10}px, 0) scale(0.985)`, t.addEventListener("transitionend", u);
330
322
  }
331
323
  return {
332
- onEnter: f,
324
+ onEnter: v,
333
325
  onBeforeEnter: o,
334
- onBeforeLeave: c,
335
- onLeave: y
326
+ onBeforeLeave: s,
327
+ onLeave: w
336
328
  };
337
329
  }
338
330
  function aa({
339
331
  container: e,
340
- masonry: n,
332
+ masonry: l,
341
333
  columns: i,
342
334
  containerHeight: a,
343
- isLoading: m,
335
+ isLoading: g,
344
336
  pageSize: d,
345
- refreshLayout: f,
337
+ refreshLayout: v,
346
338
  setItemsRaw: o,
347
- loadNext: c,
348
- loadThresholdPx: y
339
+ loadNext: s,
340
+ loadThresholdPx: w
349
341
  }) {
350
342
  let t = 0;
351
- async function w(T, p = !1) {
343
+ async function x(T, y = !1) {
352
344
  if (!e.value) return;
353
- const h = T ?? $e(n.value, i.value), I = h.length ? Math.max(...h) : 0, S = e.value.scrollTop + e.value.clientHeight, v = e.value.scrollTop > t + 1;
345
+ const h = T ?? $e(l.value, i.value), P = h.length ? Math.max(...h) : 0, I = e.value.scrollTop + e.value.clientHeight, f = e.value.scrollTop > t + 1;
354
346
  t = e.value.scrollTop;
355
- const r = typeof y == "number" ? y : 200, s = r >= 0 ? Math.max(0, I - r) : Math.max(0, I + r);
356
- if (S >= s && (v || p) && !m.value) {
357
- await c(), await X();
347
+ const r = typeof w == "number" ? w : 200, u = r >= 0 ? Math.max(0, P - r) : Math.max(0, P + r);
348
+ if (I >= u && (f || y) && !g.value) {
349
+ await s(), await C();
358
350
  return;
359
351
  }
360
352
  }
361
353
  return {
362
- handleScroll: w
354
+ handleScroll: x
363
355
  };
364
356
  }
365
357
  function na(e) {
366
- const { useSwipeMode: n, masonry: i, isLoading: a, loadNext: m, loadPage: d, paginationHistory: f } = e, o = W(0), c = W(0), y = W(!1), t = W(0), w = W(0), T = W(null), p = K(() => {
367
- if (!n.value || i.value.length === 0) return null;
368
- const P = Math.max(0, Math.min(o.value, i.value.length - 1));
369
- return i.value[P] || null;
370
- }), h = K(() => {
371
- if (!n.value || !p.value) return null;
372
- const P = o.value + 1;
373
- return P >= i.value.length ? null : i.value[P] || null;
374
- }), I = K(() => {
375
- if (!n.value || !p.value) return null;
376
- const P = o.value - 1;
377
- return P < 0 ? null : i.value[P] || null;
358
+ const { useSwipeMode: l, masonry: i, isLoading: a, loadNext: g, loadPage: d, paginationHistory: v } = e, o = F(0), s = F(0), w = F(!1), t = F(0), x = F(0), T = F(null), y = Q(() => {
359
+ if (!l.value || i.value.length === 0) return null;
360
+ const $ = Math.max(0, Math.min(o.value, i.value.length - 1));
361
+ return i.value[$] || null;
362
+ }), h = Q(() => {
363
+ if (!l.value || !y.value) return null;
364
+ const $ = o.value + 1;
365
+ return $ >= i.value.length ? null : i.value[$] || null;
366
+ }), P = Q(() => {
367
+ if (!l.value || !y.value) return null;
368
+ const $ = o.value - 1;
369
+ return $ < 0 ? null : i.value[$] || null;
378
370
  });
379
- function S() {
371
+ function I() {
380
372
  if (!T.value) return;
381
- const P = T.value.clientHeight;
382
- c.value = -o.value * P;
373
+ const $ = T.value.clientHeight;
374
+ s.value = -o.value * $;
383
375
  }
384
- function v() {
376
+ function f() {
385
377
  if (!h.value) {
386
- m();
378
+ g();
387
379
  return;
388
380
  }
389
- o.value++, S(), o.value >= i.value.length - 5 && m();
381
+ o.value++, I(), o.value >= i.value.length - 5 && g();
390
382
  }
391
383
  function r() {
392
- I.value && (o.value--, S());
384
+ P.value && (o.value--, I());
393
385
  }
394
- function s(P) {
395
- n.value && (y.value = !0, t.value = P.touches[0].clientY, w.value = c.value, P.preventDefault());
386
+ function u($) {
387
+ l.value && (w.value = !0, t.value = $.touches[0].clientY, x.value = s.value, $.preventDefault());
396
388
  }
397
- function L(P) {
398
- if (!n.value || !y.value) return;
399
- const z = P.touches[0].clientY - t.value;
400
- c.value = w.value + z, P.preventDefault();
389
+ function L($) {
390
+ if (!l.value || !w.value) return;
391
+ const W = $.touches[0].clientY - t.value;
392
+ s.value = x.value + W, $.preventDefault();
401
393
  }
402
- function M(P) {
403
- if (!n.value || !y.value) return;
404
- y.value = !1;
405
- const z = c.value - w.value;
406
- Math.abs(z) > 100 ? z > 0 && I.value ? r() : z < 0 && h.value ? v() : S() : S(), P.preventDefault();
394
+ function M($) {
395
+ if (!l.value || !w.value) return;
396
+ w.value = !1;
397
+ const W = s.value - x.value;
398
+ Math.abs(W) > 100 ? W > 0 && P.value ? r() : W < 0 && h.value ? f() : I() : I(), $.preventDefault();
407
399
  }
408
- function g(P) {
409
- n.value && (y.value = !0, t.value = P.clientY, w.value = c.value, P.preventDefault());
400
+ function m($) {
401
+ l.value && (w.value = !0, t.value = $.clientY, x.value = s.value, $.preventDefault());
410
402
  }
411
- function $(P) {
412
- if (!n.value || !y.value) return;
413
- const z = P.clientY - t.value;
414
- c.value = w.value + z, P.preventDefault();
403
+ function N($) {
404
+ if (!l.value || !w.value) return;
405
+ const W = $.clientY - t.value;
406
+ s.value = x.value + W, $.preventDefault();
415
407
  }
416
- function k(P) {
417
- if (!n.value || !y.value) return;
418
- y.value = !1;
419
- const z = c.value - w.value;
420
- Math.abs(z) > 100 ? z > 0 && I.value ? r() : z < 0 && h.value ? v() : S() : S(), P.preventDefault();
408
+ function k($) {
409
+ if (!l.value || !w.value) return;
410
+ w.value = !1;
411
+ const W = s.value - x.value;
412
+ Math.abs(W) > 100 ? W > 0 && P.value ? r() : W < 0 && h.value ? f() : I() : I(), $.preventDefault();
421
413
  }
422
- function N() {
423
- !n.value && o.value > 0 && (o.value = 0, c.value = 0), n.value && i.value.length === 0 && !a.value && d(f.value[0]), n.value && S();
414
+ function B() {
415
+ !l.value && o.value > 0 && (o.value = 0, s.value = 0), l.value && i.value.length === 0 && !a.value && d(v.value[0]), l.value && I();
424
416
  }
425
- function A() {
426
- o.value = 0, c.value = 0, y.value = !1;
417
+ function R() {
418
+ o.value = 0, s.value = 0, w.value = !1;
427
419
  }
428
420
  return {
429
421
  // State
430
422
  currentSwipeIndex: o,
431
- swipeOffset: c,
432
- isDragging: y,
423
+ swipeOffset: s,
424
+ isDragging: w,
433
425
  swipeContainer: T,
434
426
  // Computed
435
- currentItem: p,
427
+ currentItem: y,
436
428
  nextItem: h,
437
- previousItem: I,
429
+ previousItem: P,
438
430
  // Functions
439
- handleTouchStart: s,
431
+ handleTouchStart: u,
440
432
  handleTouchMove: L,
441
433
  handleTouchEnd: M,
442
- handleMouseDown: g,
443
- handleMouseMove: $,
434
+ handleMouseDown: m,
435
+ handleMouseMove: N,
444
436
  handleMouseUp: k,
445
- goToNextItem: v,
437
+ goToNextItem: f,
446
438
  goToPreviousItem: r,
447
- snapToCurrentItem: S,
448
- handleWindowResize: N,
449
- reset: A
439
+ snapToCurrentItem: I,
440
+ handleWindowResize: B,
441
+ reset: R
450
442
  };
451
443
  }
452
- function me(e) {
444
+ function ge(e) {
453
445
  return e instanceof Error ? e : new Error(String(e));
454
446
  }
455
447
  function la(e) {
456
448
  const {
457
- getPage: n,
449
+ getPage: l,
458
450
  context: i,
459
451
  masonry: a,
460
- isLoading: m,
452
+ isLoading: g,
461
453
  hasReachedEnd: d,
462
- loadError: f,
454
+ loadError: v,
463
455
  currentPage: o,
464
- paginationHistory: c,
465
- refreshLayout: y,
456
+ paginationHistory: s,
457
+ refreshLayout: w,
466
458
  retryMaxAttempts: t,
467
- retryInitialDelayMs: w,
459
+ retryInitialDelayMs: x,
468
460
  retryBackoffStepMs: T,
469
- mode: p,
461
+ mode: y,
470
462
  backfillDelayMs: h,
471
- backfillMaxCalls: I,
472
- pageSize: S,
473
- emits: v
474
- } = e, r = W(!1);
475
- let s = !1;
476
- function L(F) {
477
- return a.value.filter((l) => l.page === F).length;
463
+ backfillMaxCalls: P,
464
+ pageSize: I,
465
+ emits: f
466
+ } = e, r = F(!1);
467
+ let u = !1;
468
+ function L(H) {
469
+ return a.value.filter((n) => n.page === H).length;
478
470
  }
479
- function M(F, l) {
480
- return new Promise((x) => {
481
- const E = Math.max(0, F | 0), D = Date.now();
482
- l(E, E);
471
+ function M(H, n) {
472
+ return new Promise((p) => {
473
+ const S = Math.max(0, H | 0), z = Date.now();
474
+ n(S, S);
483
475
  const V = setInterval(() => {
484
476
  if (r.value) {
485
- clearInterval(V), x();
477
+ clearInterval(V), p();
486
478
  return;
487
479
  }
488
- const C = Date.now() - D, b = Math.max(0, E - C);
489
- l(b, E), b <= 0 && (clearInterval(V), x());
480
+ const Y = Date.now() - z, b = Math.max(0, S - Y);
481
+ n(b, S), b <= 0 && (clearInterval(V), p());
490
482
  }, 100);
491
483
  });
492
484
  }
493
- async function g(F) {
494
- let l = 0;
495
- const x = t;
496
- let E = w;
485
+ async function m(H) {
486
+ let n = 0;
487
+ const p = t;
488
+ let S = x;
497
489
  for (; ; )
498
490
  try {
499
- const D = await F();
500
- return l > 0 && v("retry:stop", { attempt: l, success: !0 }), D;
501
- } catch (D) {
502
- if (l++, l > x)
503
- throw v("retry:stop", { attempt: l - 1, success: !1 }), D;
504
- v("retry:start", { attempt: l, max: x, totalMs: E }), await M(E, (V, C) => {
505
- v("retry:tick", { attempt: l, remainingMs: V, totalMs: C });
506
- }), E += T;
491
+ const z = await H();
492
+ return n > 0 && f("retry:stop", { attempt: n, success: !0 }), z;
493
+ } catch (z) {
494
+ if (n++, n > p)
495
+ throw f("retry:stop", { attempt: n - 1, success: !1 }), z;
496
+ f("retry:start", { attempt: n, max: p, totalMs: S }), await M(S, (V, Y) => {
497
+ f("retry:tick", { attempt: n, remainingMs: V, totalMs: Y });
498
+ }), S += T;
507
499
  }
508
500
  }
509
- async function $(F) {
501
+ async function N(H) {
510
502
  try {
511
- const l = await g(() => n(F, i == null ? void 0 : i.value));
512
- return y([...a.value, ...l.items]), l;
513
- } catch (l) {
514
- throw l;
503
+ const n = await m(() => l(H, i == null ? void 0 : i.value)), p = [...a.value, ...n.items];
504
+ return a.value = p, await C(), await C(), await C(), w(p), n;
505
+ } catch (n) {
506
+ throw n;
515
507
  }
516
508
  }
517
- async function k(F, l = !1) {
518
- if (!l && p !== "backfill" || s || r.value || d.value) return;
519
- const x = (F || 0) + (S || 0);
520
- if (!S || S <= 0) return;
521
- if (c.value[c.value.length - 1] == null) {
509
+ async function k(H, n = !1) {
510
+ if (!n && y !== "backfill" || u || r.value || d.value) return;
511
+ const p = (H || 0) + (I || 0);
512
+ if (!I || I <= 0) return;
513
+ if (s.value[s.value.length - 1] == null) {
522
514
  d.value = !0;
523
515
  return;
524
516
  }
525
- if (!(a.value.length >= x)) {
526
- s = !0, m.value || (m.value = !0, v("loading:start"));
517
+ if (!(a.value.length >= p)) {
518
+ u = !0, g.value || (g.value = !0, f("loading:start"));
527
519
  try {
528
- let D = 0;
529
- for (v("backfill:start", { target: x, fetched: a.value.length, calls: D }); a.value.length < x && D < I && c.value[c.value.length - 1] != null && !r.value && !d.value && s && (await M(h, (C, b) => {
530
- v("backfill:tick", {
531
- fetched: a.value.length,
532
- target: x,
533
- calls: D,
534
- remainingMs: C,
535
- totalMs: b
536
- });
537
- }), !(r.value || !s)); ) {
538
- const V = c.value[c.value.length - 1];
539
- if (V == null) {
520
+ let z = 0;
521
+ const V = o.value, Y = s.value[s.value.length - 1];
522
+ for (f("backfill:start", {
523
+ target: p,
524
+ fetched: a.value.length,
525
+ calls: z,
526
+ currentPage: V,
527
+ nextPage: Y
528
+ }); a.value.length < p && z < P && s.value[s.value.length - 1] != null && !r.value && !d.value && u; ) {
529
+ const O = o.value, ne = s.value[s.value.length - 1];
530
+ if (await M(h, (Z, K) => {
531
+ f("backfill:tick", {
532
+ fetched: a.value.length,
533
+ target: p,
534
+ calls: z,
535
+ remainingMs: Z,
536
+ totalMs: K,
537
+ currentPage: O,
538
+ nextPage: ne
539
+ });
540
+ }), r.value || !u) break;
541
+ const X = s.value[s.value.length - 1];
542
+ if (X == null) {
540
543
  d.value = !0;
541
544
  break;
542
545
  }
543
546
  try {
544
- if (r.value || !s) break;
545
- const C = await $(V);
546
- if (r.value || !s) break;
547
- f.value = null, c.value.push(C.nextPage), C.nextPage == null && (d.value = !0);
548
- } catch (C) {
549
- if (r.value || !s) break;
550
- f.value = me(C);
547
+ if (r.value || !u) break;
548
+ const Z = await N(X);
549
+ if (r.value || !u) break;
550
+ v.value = null, o.value = X, s.value.push(Z.nextPage), Z.nextPage == null && (d.value = !0);
551
+ } catch (Z) {
552
+ if (r.value || !u) break;
553
+ v.value = ge(Z);
551
554
  }
552
- D++;
555
+ z++;
553
556
  }
554
- v("backfill:stop", { fetched: a.value.length, calls: D });
557
+ const b = o.value, E = s.value[s.value.length - 1];
558
+ f("backfill:stop", {
559
+ fetched: a.value.length,
560
+ calls: z,
561
+ currentPage: b,
562
+ nextPage: E
563
+ });
555
564
  } finally {
556
- s = !1, m.value = !1, v("loading:stop", { fetched: a.value.length });
565
+ u = !1, g.value = !1;
566
+ const z = o.value, V = s.value[s.value.length - 1];
567
+ f("loading:stop", {
568
+ fetched: a.value.length,
569
+ currentPage: z,
570
+ nextPage: V
571
+ });
557
572
  }
558
573
  }
559
574
  }
560
- async function N(F) {
561
- if (!m.value) {
562
- r.value = !1, m.value || (m.value = !0, v("loading:start")), d.value = !1, f.value = null;
575
+ async function B(H) {
576
+ if (!g.value) {
577
+ r.value = !1, g.value || (g.value = !0, f("loading:start")), d.value = !1, v.value = null;
563
578
  try {
564
- const l = a.value.length;
579
+ const n = a.value.length;
565
580
  if (r.value) return;
566
- const x = await $(F);
567
- return r.value ? void 0 : (f.value = null, o.value = F, c.value.push(x.nextPage), x.nextPage == null && (d.value = !0), await k(l), x);
568
- } catch (l) {
569
- throw f.value = me(l), l;
581
+ const p = await N(H);
582
+ return r.value ? void 0 : (v.value = null, o.value = H, s.value.push(p.nextPage), p.nextPage == null && (d.value = !0), await k(n), p);
583
+ } catch (n) {
584
+ throw v.value = ge(n), n;
570
585
  } finally {
571
- m.value = !1;
586
+ g.value = !1;
572
587
  }
573
588
  }
574
589
  }
575
- async function A() {
576
- if (!m.value && !d.value) {
577
- r.value = !1, m.value || (m.value = !0, v("loading:start")), f.value = null;
590
+ async function R() {
591
+ if (!g.value && !d.value) {
592
+ r.value = !1, g.value || (g.value = !0, f("loading:start")), v.value = null;
578
593
  try {
579
- const F = a.value.length;
594
+ const H = a.value.length;
580
595
  if (r.value) return;
581
- if (p === "refresh" && o.value != null && L(o.value) < S) {
582
- const D = await g(() => n(o.value, i == null ? void 0 : i.value));
596
+ if (y === "refresh" && o.value != null && L(o.value) < I) {
597
+ const z = await m(() => l(o.value, i == null ? void 0 : i.value));
583
598
  if (r.value) return;
584
- const V = [...a.value], C = D.items.filter((H) => !H || H.id == null || H.page == null ? !1 : !V.some((R) => R && R.id === H.id && R.page === H.page));
585
- if (C.length > 0) {
586
- const H = [...a.value, ...C];
587
- y(H), await new Promise((R) => setTimeout(R, 0));
599
+ const V = [...a.value], Y = z.items.filter((E) => !E || E.id == null || E.page == null ? !1 : !V.some((O) => O && O.id === E.id && O.page === E.page));
600
+ if (Y.length > 0) {
601
+ const E = [...a.value, ...Y];
602
+ a.value = E, await C(), await C(), await C(), w(E);
588
603
  }
589
- if (f.value = null, C.length === 0) {
590
- const H = c.value[c.value.length - 1];
591
- if (H == null) {
604
+ if (v.value = null, Y.length === 0) {
605
+ const E = s.value[s.value.length - 1];
606
+ if (E == null) {
592
607
  d.value = !0;
593
608
  return;
594
609
  }
595
- const R = await $(H);
596
- return r.value ? void 0 : (f.value = null, o.value = H, c.value.push(R.nextPage), R.nextPage == null && (d.value = !0), await k(F), R);
610
+ const O = await N(E);
611
+ return r.value ? void 0 : (v.value = null, o.value = E, s.value.push(O.nextPage), O.nextPage == null && (d.value = !0), await k(H), O);
597
612
  }
598
- if (L(o.value) >= S) {
599
- const H = c.value[c.value.length - 1];
600
- if (H == null) {
613
+ if (L(o.value) >= I) {
614
+ const E = s.value[s.value.length - 1];
615
+ if (E == null) {
601
616
  d.value = !0;
602
617
  return;
603
618
  }
604
- const R = await $(H);
605
- return r.value ? void 0 : (f.value = null, o.value = H, c.value.push(R.nextPage), R.nextPage == null && (d.value = !0), await k(F), R);
619
+ const O = await N(E);
620
+ return r.value ? void 0 : (v.value = null, o.value = E, s.value.push(O.nextPage), O.nextPage == null && (d.value = !0), await k(H), O);
606
621
  } else
607
- return D;
622
+ return z;
608
623
  }
609
- const l = c.value[c.value.length - 1];
610
- if (l == null) {
624
+ const n = s.value[s.value.length - 1];
625
+ if (n == null) {
611
626
  d.value = !0;
612
627
  return;
613
628
  }
614
- const x = await $(l);
615
- return r.value ? void 0 : (f.value = null, o.value = l, c.value.push(x.nextPage), x.nextPage == null && (d.value = !0), await k(F), x);
616
- } catch (F) {
617
- throw f.value = me(F), F;
629
+ const p = await N(n);
630
+ return r.value ? void 0 : (v.value = null, o.value = n, s.value.push(p.nextPage), p.nextPage == null && (d.value = !0), await k(H), p);
631
+ } catch (H) {
632
+ throw v.value = ge(H), H;
618
633
  } finally {
619
- m.value = !1, v("loading:stop", { fetched: a.value.length });
634
+ g.value = !1;
635
+ const H = o.value, n = s.value[s.value.length - 1];
636
+ f("loading:stop", {
637
+ fetched: a.value.length,
638
+ currentPage: H,
639
+ nextPage: n
640
+ });
620
641
  }
621
642
  }
622
643
  }
623
- async function P() {
624
- if (!m.value) {
625
- r.value = !1, m.value = !0, v("loading:start");
644
+ async function $() {
645
+ if (!g.value) {
646
+ r.value = !1, g.value = !0, f("loading:start");
626
647
  try {
627
- const F = o.value;
628
- if (F == null) {
629
- console.warn("[Masonry] No current page to refresh - currentPage:", o.value, "paginationHistory:", c.value);
648
+ const H = o.value;
649
+ if (H == null) {
650
+ console.warn("[Masonry] No current page to refresh - currentPage:", o.value, "paginationHistory:", s.value);
630
651
  return;
631
652
  }
632
- a.value = [], d.value = !1, f.value = null, c.value = [F];
633
- const l = await $(F);
653
+ a.value = [], d.value = !1, v.value = null, s.value = [H];
654
+ const n = await N(H);
634
655
  if (r.value) return;
635
- f.value = null, o.value = F, c.value.push(l.nextPage), l.nextPage == null && (d.value = !0);
636
- const x = a.value.length;
637
- return await k(x), l;
638
- } catch (F) {
639
- throw f.value = me(F), F;
656
+ v.value = null, o.value = H, s.value.push(n.nextPage), n.nextPage == null && (d.value = !0);
657
+ const p = a.value.length;
658
+ return await k(p), n;
659
+ } catch (H) {
660
+ throw v.value = ge(H), H;
640
661
  } finally {
641
- m.value = !1, v("loading:stop", { fetched: a.value.length });
662
+ g.value = !1;
663
+ const H = o.value, n = s.value[s.value.length - 1];
664
+ f("loading:stop", {
665
+ fetched: a.value.length,
666
+ currentPage: H,
667
+ nextPage: n
668
+ });
642
669
  }
643
670
  }
644
671
  }
645
- function z() {
646
- const F = s;
647
- r.value = !0, m.value = !1, s = !1, F && v("backfill:stop", { fetched: a.value.length, calls: 0, cancelled: !0 }), v("loading:stop", { fetched: a.value.length });
672
+ function W() {
673
+ const H = u;
674
+ r.value = !0, g.value = !1, u = !1;
675
+ const n = o.value, p = s.value[s.value.length - 1];
676
+ H && f("backfill:stop", {
677
+ fetched: a.value.length,
678
+ calls: 0,
679
+ cancelled: !0,
680
+ currentPage: n,
681
+ nextPage: p
682
+ }), f("loading:stop", {
683
+ fetched: a.value.length,
684
+ currentPage: n,
685
+ nextPage: p
686
+ });
648
687
  }
649
688
  return {
650
- loadPage: N,
651
- loadNext: A,
652
- refreshCurrentPage: P,
653
- cancelLoad: z,
689
+ loadPage: B,
690
+ loadNext: R,
691
+ refreshCurrentPage: $,
692
+ cancelLoad: W,
654
693
  maybeBackfillToTarget: k,
655
- getContent: $
694
+ getContent: N
656
695
  };
657
696
  }
658
697
  function oa(e) {
659
698
  const {
660
- masonry: n,
699
+ masonry: l,
661
700
  useSwipeMode: i,
662
701
  refreshLayout: a,
663
- loadNext: m,
702
+ loadNext: g,
664
703
  maybeBackfillToTarget: d,
665
- paginationHistory: f
704
+ paginationHistory: v
666
705
  } = e;
667
- let o = /* @__PURE__ */ new Set(), c = null, y = !1;
706
+ let o = /* @__PURE__ */ new Set(), s = null, w = !1;
668
707
  async function t() {
669
- if (o.size === 0 || y) return;
670
- y = !0;
671
- const v = Array.from(o);
672
- o.clear(), c = null, await T(v), y = !1;
708
+ if (o.size === 0 || w) return;
709
+ w = !0;
710
+ const f = Array.from(o);
711
+ o.clear(), s = null, await T(f), w = !1;
673
712
  }
674
- async function w(v) {
675
- o.add(v), c && clearTimeout(c), c = setTimeout(() => {
713
+ async function x(f) {
714
+ o.add(f), s && clearTimeout(s), s = setTimeout(() => {
676
715
  t();
677
716
  }, 16);
678
717
  }
679
- async function T(v) {
680
- if (!v || v.length === 0) return;
681
- const r = new Set(v.map((L) => L.id)), s = n.value.filter((L) => !r.has(L.id));
682
- if (n.value = s, await X(), s.length === 0 && f.value.length > 0) {
718
+ async function T(f) {
719
+ if (!f || f.length === 0) return;
720
+ const r = new Set(f.map((L) => L.id)), u = l.value.filter((L) => !r.has(L.id));
721
+ if (l.value = u, await C(), u.length === 0 && v.value.length > 0) {
683
722
  try {
684
- await m(), await d(0, !0);
723
+ await g(), await d(0, !0);
685
724
  } catch {
686
725
  }
687
726
  return;
688
727
  }
689
- await new Promise((L) => requestAnimationFrame(() => L())), requestAnimationFrame(() => {
690
- a(s);
691
- });
728
+ await C(), await C(), a(u);
692
729
  }
693
- async function p(v) {
694
- !v || v.length === 0 || (v.forEach((r) => o.add(r)), c && clearTimeout(c), c = setTimeout(() => {
730
+ async function y(f) {
731
+ !f || f.length === 0 || (f.forEach((r) => o.add(r)), s && clearTimeout(s), s = setTimeout(() => {
695
732
  t();
696
733
  }, 16));
697
734
  }
698
- async function h(v, r) {
699
- if (!v) return;
700
- const s = n.value;
701
- if (s.findIndex(($) => $.id === v.id) !== -1) return;
702
- const M = [...s], g = Math.min(r, M.length);
703
- M.splice(g, 0, v), n.value = M, await X(), i.value || (await new Promise(($) => requestAnimationFrame(() => $())), requestAnimationFrame(() => {
704
- a(M);
705
- }));
735
+ async function h(f, r) {
736
+ if (!f) return;
737
+ const u = l.value;
738
+ if (u.findIndex((N) => N.id === f.id) !== -1) return;
739
+ const M = [...u], m = Math.min(r, M.length);
740
+ M.splice(m, 0, f), l.value = M, await C(), i.value || (await C(), await C(), a(M));
706
741
  }
707
- async function I(v, r) {
708
- var P;
709
- if (!v || v.length === 0) return;
710
- if (!r || r.length !== v.length) {
742
+ async function P(f, r) {
743
+ var $;
744
+ if (!f || f.length === 0) return;
745
+ if (!r || r.length !== f.length) {
711
746
  console.warn("[Masonry] restoreMany: items and indices arrays must have the same length");
712
747
  return;
713
748
  }
714
- const s = n.value, L = new Set(s.map((z) => z.id)), M = [];
715
- for (let z = 0; z < v.length; z++)
716
- L.has((P = v[z]) == null ? void 0 : P.id) || M.push({ item: v[z], index: r[z] });
749
+ const u = l.value, L = new Set(u.map((W) => W.id)), M = [];
750
+ for (let W = 0; W < f.length; W++)
751
+ L.has(($ = f[W]) == null ? void 0 : $.id) || M.push({ item: f[W], index: r[W] });
717
752
  if (M.length === 0) return;
718
- const g = /* @__PURE__ */ new Map();
719
- for (const { item: z, index: F } of M)
720
- g.set(F, z);
721
- const $ = M.length > 0 ? Math.max(...M.map(({ index: z }) => z)) : -1, k = Math.max(s.length - 1, $), N = [];
722
- let A = 0;
723
- for (let z = 0; z <= k; z++)
724
- g.has(z) ? N.push(g.get(z)) : A < s.length && (N.push(s[A]), A++);
725
- for (; A < s.length; )
726
- N.push(s[A]), A++;
727
- n.value = N, await X(), i.value || (await new Promise((z) => requestAnimationFrame(() => z())), requestAnimationFrame(() => {
728
- a(N);
729
- }));
753
+ const m = /* @__PURE__ */ new Map();
754
+ for (const { item: W, index: H } of M)
755
+ m.set(H, W);
756
+ const N = M.length > 0 ? Math.max(...M.map(({ index: W }) => W)) : -1, k = Math.max(u.length - 1, N), B = [];
757
+ let R = 0;
758
+ for (let W = 0; W <= k; W++)
759
+ m.has(W) ? B.push(m.get(W)) : R < u.length && (B.push(u[R]), R++);
760
+ for (; R < u.length; )
761
+ B.push(u[R]), R++;
762
+ l.value = B, await C(), i.value || (await C(), await C(), a(B));
730
763
  }
731
- async function S() {
732
- n.value = [];
764
+ async function I() {
765
+ l.value = [];
733
766
  }
734
767
  return {
735
- remove: w,
736
- removeMany: p,
768
+ remove: x,
769
+ removeMany: y,
737
770
  restore: h,
738
- restoreMany: I,
739
- removeAll: S
771
+ restoreMany: P,
772
+ removeAll: I
740
773
  };
741
774
  }
742
775
  function ra(e) {
743
776
  const {
744
- masonry: n,
777
+ masonry: l,
745
778
  useSwipeMode: i,
746
779
  container: a,
747
- columns: m,
780
+ columns: g,
748
781
  containerWidth: d,
749
- masonryContentHeight: f,
782
+ masonryContentHeight: v,
750
783
  layout: o,
751
- fixedDimensions: c,
752
- checkItemDimensions: y
784
+ fixedDimensions: s,
785
+ checkItemDimensions: w
753
786
  } = e;
754
787
  let t = [];
755
- function w(I) {
756
- const S = Qt(I);
757
- let v = 0;
788
+ function x(P) {
789
+ const I = Qt(P);
790
+ let f = 0;
758
791
  if (a.value) {
759
- const { scrollTop: r, clientHeight: s } = a.value;
760
- v = r + s + 100;
792
+ const { scrollTop: r, clientHeight: u } = a.value;
793
+ f = r + u + 100;
761
794
  }
762
- f.value = Math.max(S, v);
795
+ v.value = Math.max(I, f);
763
796
  }
764
- function T(I) {
765
- var s, L;
797
+ function T(P) {
798
+ var u, L;
766
799
  if (i.value) {
767
- n.value = I;
800
+ l.value = P;
768
801
  return;
769
802
  }
770
- if (n.value = I, !a.value) return;
771
- if (y(I, "refreshLayout"), I.length > 1e3 && t.length > I.length && t.length - I.length < 100) {
803
+ if (l.value = P, !a.value) return;
804
+ if (w(P, "refreshLayout"), P.length > 1e3 && t.length > P.length && t.length - P.length < 100) {
772
805
  let M = !0;
773
- for (let g = 0; g < I.length; g++)
774
- if (((s = I[g]) == null ? void 0 : s.id) !== ((L = t[g]) == null ? void 0 : L.id)) {
806
+ for (let m = 0; m < P.length; m++)
807
+ if (((u = P[m]) == null ? void 0 : u.id) !== ((L = t[m]) == null ? void 0 : L.id)) {
775
808
  M = !1;
776
809
  break;
777
810
  }
778
811
  if (M) {
779
- const g = I.map(($, k) => ({
812
+ const m = P.map((N, k) => ({
780
813
  ...t[k],
781
814
  originalIndex: k
782
815
  }));
783
- w(g), n.value = g, t = g;
816
+ x(m), l.value = m, t = m;
784
817
  return;
785
818
  }
786
819
  }
787
- const v = I.map((M, g) => ({
820
+ const f = P.map((M, m) => ({
788
821
  ...M,
789
- originalIndex: g
822
+ originalIndex: m
790
823
  })), r = a.value;
791
- if (c.value && c.value.width !== void 0) {
792
- const M = r.style.width, g = r.style.boxSizing;
793
- r.style.boxSizing = "border-box", r.style.width = `${c.value.width}px`, r.offsetWidth;
794
- const $ = Ce(v, r, m.value, o.value);
795
- r.style.width = M, r.style.boxSizing = g, w($), n.value = $, t = $;
824
+ if (s.value && s.value.width !== void 0) {
825
+ const M = r.style.width, m = r.style.boxSizing;
826
+ r.style.boxSizing = "border-box", r.style.width = `${s.value.width}px`, r.offsetWidth;
827
+ const N = Ae(f, r, g.value, o.value);
828
+ r.style.width = M, r.style.boxSizing = m, x(N), l.value = N, t = N;
796
829
  } else {
797
- const M = Ce(v, r, m.value, o.value);
798
- w(M), n.value = M, t = M;
830
+ const M = Ae(f, r, g.value, o.value);
831
+ x(M), l.value = M, t = M;
799
832
  }
800
833
  }
801
- function p(I, S) {
802
- c.value = I, I && (I.width !== void 0 && (d.value = I.width), !i.value && a.value && n.value.length > 0 && X(() => {
803
- m.value = se(o.value, d.value), T(n.value), S && S();
834
+ function y(P, I) {
835
+ s.value = P, P && (P.width !== void 0 && (d.value = P.width), !i.value && a.value && l.value.length > 0 && C(() => {
836
+ g.value = se(o.value, d.value), T(l.value), I && I();
804
837
  }));
805
838
  }
806
839
  function h() {
807
- m.value = se(o.value, d.value), T(n.value);
840
+ g.value = se(o.value, d.value), T(l.value);
808
841
  }
809
842
  return {
810
843
  refreshLayout: T,
811
- setFixedDimensions: p,
844
+ setFixedDimensions: y,
812
845
  onResize: h,
813
- calculateHeight: w
846
+ calculateHeight: x
814
847
  };
815
848
  }
816
849
  function ia(e) {
817
850
  const {
818
- masonry: n,
851
+ masonry: l,
819
852
  container: i,
820
853
  columns: a,
821
- virtualBufferPx: m,
854
+ virtualBufferPx: g,
822
855
  loadThresholdPx: d
823
- } = e, f = W(e.handleScroll), o = W(0), c = W(0), y = m, t = W(!1), w = W({
856
+ } = e, v = F(e.handleScroll), o = F(0), s = F(0), w = g, t = F(!1), x = F({
824
857
  distanceToTrigger: 0,
825
858
  isNearTrigger: !1
826
- }), T = K(() => {
827
- const S = o.value - y, v = o.value + c.value + y, r = n.value;
859
+ }), T = Q(() => {
860
+ const I = o.value - w, f = o.value + s.value + w, r = l.value;
828
861
  return !r || r.length === 0 ? [] : r.filter((L) => {
829
862
  if (typeof L.top != "number" || typeof L.columnHeight != "number")
830
863
  return !0;
831
864
  const M = L.top;
832
- return L.top + L.columnHeight >= S && M <= v;
865
+ return L.top + L.columnHeight >= I && M <= f;
833
866
  });
834
867
  });
835
- function p(S) {
868
+ function y(I) {
836
869
  if (!i.value) return;
837
- const { scrollTop: v, clientHeight: r } = i.value, s = v + r, L = S ?? $e(n.value, a.value), M = L.length ? Math.max(...L) : 0, g = typeof d == "number" ? d : 200, $ = g >= 0 ? Math.max(0, M - g) : Math.max(0, M + g), k = Math.max(0, $ - s), N = k <= 100;
838
- w.value = {
870
+ const { scrollTop: f, clientHeight: r } = i.value, u = f + r, L = I ?? $e(l.value, a.value), M = L.length ? Math.max(...L) : 0, m = typeof d == "number" ? d : 200, N = m >= 0 ? Math.max(0, M - m) : Math.max(0, M + m), k = Math.max(0, N - u), B = k <= 100;
871
+ x.value = {
839
872
  distanceToTrigger: Math.round(k),
840
- isNearTrigger: N
873
+ isNearTrigger: B
841
874
  };
842
875
  }
843
876
  async function h() {
844
877
  if (i.value) {
845
- const v = i.value.scrollTop, r = i.value.clientHeight || window.innerHeight, s = r > 0 ? r : window.innerHeight;
846
- o.value = v, c.value = s;
878
+ const f = i.value.scrollTop, r = i.value.clientHeight || window.innerHeight, u = r > 0 ? r : window.innerHeight;
879
+ o.value = f, s.value = u;
847
880
  }
848
- t.value = !0, await X(), await new Promise((v) => requestAnimationFrame(() => v())), t.value = !1;
849
- const S = $e(n.value, a.value);
850
- f.value(S), p(S);
881
+ t.value = !0, await C(), await C(), t.value = !1;
882
+ const I = $e(l.value, a.value);
883
+ v.value(I), y(I);
851
884
  }
852
- function I() {
853
- o.value = 0, c.value = 0, t.value = !1, w.value = {
885
+ function P() {
886
+ o.value = 0, s.value = 0, t.value = !1, x.value = {
854
887
  distanceToTrigger: 0,
855
888
  isNearTrigger: !1
856
889
  };
857
890
  }
858
891
  return {
859
892
  viewportTop: o,
860
- viewportHeight: c,
893
+ viewportHeight: s,
861
894
  virtualizing: t,
862
- scrollProgress: w,
895
+ scrollProgress: x,
863
896
  visibleMasonry: T,
864
- updateScrollProgress: p,
897
+ updateScrollProgress: y,
865
898
  updateViewport: h,
866
- reset: I,
867
- handleScroll: f
899
+ reset: P,
900
+ handleScroll: v
868
901
  };
869
902
  }
870
903
  function sa(e) {
871
- const { masonry: n } = e, i = W(/* @__PURE__ */ new Set());
872
- function a(f) {
873
- return typeof f == "number" && f > 0 && Number.isFinite(f);
904
+ const { masonry: l } = e, i = F(/* @__PURE__ */ new Set());
905
+ function a(v) {
906
+ return typeof v == "number" && v > 0 && Number.isFinite(v);
874
907
  }
875
- function m(f, o) {
908
+ function g(v, o) {
876
909
  try {
877
- if (!Array.isArray(f) || f.length === 0) return;
878
- const c = f.filter((t) => !a(t == null ? void 0 : t.width) || !a(t == null ? void 0 : t.height));
879
- if (c.length === 0) return;
880
- const y = [];
881
- for (const t of c) {
882
- const w = (t == null ? void 0 : t.id) ?? `idx:${n.value.indexOf(t)}`;
883
- i.value.has(w) || (i.value.add(w), y.push(w));
910
+ if (!Array.isArray(v) || v.length === 0) return;
911
+ const s = v.filter((t) => !a(t == null ? void 0 : t.width) || !a(t == null ? void 0 : t.height));
912
+ if (s.length === 0) return;
913
+ const w = [];
914
+ for (const t of s) {
915
+ const x = (t == null ? void 0 : t.id) ?? `idx:${l.value.indexOf(t)}`;
916
+ i.value.has(x) || (i.value.add(x), w.push(x));
884
917
  }
885
- if (y.length > 0) {
886
- const t = y.slice(0, 10);
918
+ if (w.length > 0) {
919
+ const t = w.slice(0, 10);
887
920
  console.warn(
888
921
  "[Masonry] Items missing width/height detected:",
889
922
  {
890
923
  context: o,
891
- count: y.length,
924
+ count: w.length,
892
925
  sampleIds: t,
893
926
  hint: "Ensure each item has positive width and height. Consider providing fallbacks (e.g., 512x512) at the data layer."
894
927
  }
@@ -901,7 +934,7 @@ function sa(e) {
901
934
  i.value.clear();
902
935
  }
903
936
  return {
904
- checkItemDimensions: m,
937
+ checkItemDimensions: g,
905
938
  invalidDimensionIds: i,
906
939
  reset: d
907
940
  };
@@ -912,13 +945,13 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
912
945
  }, fa = {
913
946
  key: 1,
914
947
  class: "relative w-full h-full"
915
- }, 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 = {
948
+ }, da = ["src"], ga = ["src", "autoplay", "controls"], ha = { class: "w-12 h-12 rounded-full bg-white/80 backdrop-blur-sm flex items-center justify-center shadow-sm" }, ma = {
916
949
  key: 3,
917
950
  class: "absolute bottom-2 left-1/2 transform -translate-x-1/2 flex items-center justify-center z-10"
918
951
  }, pa = {
919
952
  key: 4,
920
953
  class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-50 text-slate-400 text-sm p-4 text-center"
921
- }, xe = /* @__PURE__ */ _e({
954
+ }, xe = /* @__PURE__ */ Xe({
922
955
  __name: "MasonryItem",
923
956
  props: {
924
957
  item: {},
@@ -932,230 +965,226 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
932
965
  preloadThreshold: { default: 1 }
933
966
  },
934
967
  emits: ["preload:success", "preload:error", "mouse-enter", "mouse-leave", "in-view", "in-view-and-loaded"],
935
- setup(e, { emit: n }) {
936
- const i = e, a = n, m = W(!1), d = W(!1), f = W(null), o = W(!1), c = W(!1), y = W(null), t = W(!1), w = W(!1), T = W(!1), p = W(!1), h = W(!1), I = W(null), S = W(null);
937
- let v = null;
938
- const r = K(() => {
939
- var l;
940
- return i.type ?? ((l = i.item) == null ? void 0 : l.type) ?? "image";
941
- }), s = K(() => {
942
- var l;
943
- return i.notFound ?? ((l = i.item) == null ? void 0 : l.notFound) ?? !1;
944
- }), L = K(() => !!i.inSwipeMode);
945
- function M(l, x) {
946
- const E = l === "image" ? m.value : o.value;
947
- w.value && E && !T.value && (T.value = !0, a("in-view-and-loaded", { item: i.item, type: l, src: x }));
968
+ setup(e, { emit: l }) {
969
+ const i = e, a = l, g = F(!1), d = F(!1), v = F(null), o = F(!1), s = F(!1), w = F(null), t = F(!1), x = F(!1), T = F(!1), y = F(!1), h = F(!1), P = F(null), I = F(null);
970
+ let f = null;
971
+ const r = Q(() => {
972
+ var n;
973
+ return i.type ?? ((n = i.item) == null ? void 0 : n.type) ?? "image";
974
+ }), u = Q(() => {
975
+ var n;
976
+ return i.notFound ?? ((n = i.item) == null ? void 0 : n.notFound) ?? !1;
977
+ }), L = Q(() => !!i.inSwipeMode);
978
+ function M(n, p) {
979
+ const S = n === "image" ? g.value : o.value;
980
+ x.value && S && !T.value && (T.value = !0, a("in-view-and-loaded", { item: i.item, type: n, src: p }));
948
981
  }
949
- function g(l) {
950
- a("mouse-enter", { item: i.item, type: l });
982
+ function m(n) {
983
+ a("mouse-enter", { item: i.item, type: n });
951
984
  }
952
- function $(l) {
953
- a("mouse-leave", { item: i.item, type: l });
985
+ function N(n) {
986
+ a("mouse-leave", { item: i.item, type: n });
954
987
  }
955
- function k(l) {
988
+ function k(n) {
956
989
  if (L.value) return;
957
- const x = l.target;
958
- x && (x.paused ? x.play() : x.pause());
990
+ const p = n.target;
991
+ p && (p.paused ? p.play() : p.pause());
959
992
  }
960
- function N(l) {
961
- const x = l.target;
962
- x && (L.value || x.play(), g("video"));
993
+ function B(n) {
994
+ const p = n.target;
995
+ p && (L.value || p.play(), m("video"));
963
996
  }
964
- function A(l) {
965
- const x = l.target;
966
- x && (L.value || x.pause(), $("video"));
997
+ function R(n) {
998
+ const p = n.target;
999
+ p && (L.value || p.pause(), N("video"));
967
1000
  }
968
- function P(l) {
969
- return new Promise((x, E) => {
970
- if (!l) {
1001
+ function $(n) {
1002
+ return new Promise((p, S) => {
1003
+ if (!n) {
971
1004
  const b = new Error("No image source provided");
972
- a("preload:error", { item: i.item, type: "image", src: l, error: b }), E(b);
1005
+ a("preload:error", { item: i.item, type: "image", src: n, error: b }), S(b);
973
1006
  return;
974
1007
  }
975
- const D = new Image(), V = Date.now(), C = 300;
976
- D.onload = () => {
977
- const b = Date.now() - V, H = Math.max(0, C - b);
1008
+ const z = new Image(), V = Date.now(), Y = 300;
1009
+ z.onload = () => {
1010
+ const b = Date.now() - V, E = Math.max(0, Y - b);
978
1011
  setTimeout(async () => {
979
- m.value = !0, d.value = !1, p.value = !1, await X(), await new Promise((R) => setTimeout(R, 100)), h.value = !0, a("preload:success", { item: i.item, type: "image", src: l }), M("image", l), x();
980
- }, H);
981
- }, D.onerror = () => {
982
- d.value = !0, m.value = !1, p.value = !1;
1012
+ g.value = !0, d.value = !1, y.value = !1, await C(), await new Promise((O) => setTimeout(O, 100)), h.value = !0, a("preload:success", { item: i.item, type: "image", src: n }), M("image", n), p();
1013
+ }, E);
1014
+ }, z.onerror = () => {
1015
+ d.value = !0, g.value = !1, y.value = !1;
983
1016
  const b = new Error("Failed to load image");
984
- a("preload:error", { item: i.item, type: "image", src: l, error: b }), E(b);
985
- }, D.src = l;
1017
+ a("preload:error", { item: i.item, type: "image", src: n, error: b }), S(b);
1018
+ }, z.src = n;
986
1019
  });
987
1020
  }
988
- function z(l) {
989
- return new Promise((x, E) => {
990
- if (!l) {
1021
+ function W(n) {
1022
+ return new Promise((p, S) => {
1023
+ if (!n) {
991
1024
  const b = new Error("No video source provided");
992
- a("preload:error", { item: i.item, type: "video", src: l, error: b }), E(b);
1025
+ a("preload:error", { item: i.item, type: "video", src: n, error: b }), S(b);
993
1026
  return;
994
1027
  }
995
- const D = document.createElement("video"), V = Date.now(), C = 300;
996
- D.preload = "metadata", D.muted = !0, D.onloadedmetadata = () => {
997
- const b = Date.now() - V, H = Math.max(0, C - b);
1028
+ const z = document.createElement("video"), V = Date.now(), Y = 300;
1029
+ z.preload = "metadata", z.muted = !0, z.onloadedmetadata = () => {
1030
+ const b = Date.now() - V, E = Math.max(0, Y - b);
998
1031
  setTimeout(async () => {
999
- o.value = !0, c.value = !1, p.value = !1, await X(), await new Promise((R) => setTimeout(R, 100)), h.value = !0, a("preload:success", { item: i.item, type: "video", src: l }), M("video", l), x();
1000
- }, H);
1001
- }, D.onerror = () => {
1002
- c.value = !0, o.value = !1, p.value = !1;
1032
+ o.value = !0, s.value = !1, y.value = !1, await C(), await new Promise((O) => setTimeout(O, 100)), h.value = !0, a("preload:success", { item: i.item, type: "video", src: n }), M("video", n), p();
1033
+ }, E);
1034
+ }, z.onerror = () => {
1035
+ s.value = !0, o.value = !1, y.value = !1;
1003
1036
  const b = new Error("Failed to load video");
1004
- a("preload:error", { item: i.item, type: "video", src: l, error: b }), E(b);
1005
- }, D.src = l;
1037
+ a("preload:error", { item: i.item, type: "video", src: n, error: b }), S(b);
1038
+ }, z.src = n;
1006
1039
  });
1007
1040
  }
1008
- async function F() {
1009
- var x;
1010
- if (!t.value || p.value || s.value || r.value === "video" && o.value || r.value === "image" && m.value)
1041
+ async function H() {
1042
+ var p;
1043
+ if (!t.value || y.value || u.value || r.value === "video" && o.value || r.value === "image" && g.value)
1011
1044
  return;
1012
- const l = (x = i.item) == null ? void 0 : x.src;
1013
- if (l)
1014
- if (p.value = !0, h.value = !1, r.value === "video") {
1015
- y.value = l, o.value = !1, c.value = !1;
1045
+ const n = (p = i.item) == null ? void 0 : p.src;
1046
+ if (n)
1047
+ if (y.value = !0, h.value = !1, r.value === "video") {
1048
+ w.value = n, o.value = !1, s.value = !1;
1016
1049
  try {
1017
- await z(l);
1050
+ await W(n);
1018
1051
  } catch {
1019
1052
  }
1020
1053
  } else {
1021
- f.value = l, m.value = !1, d.value = !1;
1054
+ v.value = n, g.value = !1, d.value = !1;
1022
1055
  try {
1023
- await P(l);
1056
+ await $(n);
1024
1057
  } catch {
1025
1058
  }
1026
1059
  }
1027
1060
  }
1028
- return Xe(async () => {
1029
- if (!I.value) return;
1030
- const l = [i.preloadThreshold, 1].filter((E, D, V) => V.indexOf(E) === D).sort((E, D) => E - D);
1031
- v = new IntersectionObserver(
1032
- (E) => {
1033
- E.forEach((D) => {
1034
- const V = D.intersectionRatio, C = V >= 1, b = V >= i.preloadThreshold;
1035
- if (C && !w.value) {
1036
- w.value = !0, a("in-view", { item: i.item, type: r.value });
1037
- const H = r.value === "image" ? f.value : y.value, R = r.value === "image" ? m.value : o.value;
1038
- H && R && M(r.value, H);
1061
+ return Ge(async () => {
1062
+ if (!P.value) return;
1063
+ const n = [i.preloadThreshold, 1].filter((S, z, V) => V.indexOf(S) === z).sort((S, z) => S - z);
1064
+ f = new IntersectionObserver(
1065
+ (S) => {
1066
+ S.forEach((z) => {
1067
+ const V = z.intersectionRatio, Y = V >= 1, b = V >= i.preloadThreshold;
1068
+ if (Y && !x.value) {
1069
+ x.value = !0, a("in-view", { item: i.item, type: r.value });
1070
+ const E = r.value === "image" ? v.value : w.value, O = r.value === "image" ? g.value : o.value;
1071
+ E && O && M(r.value, E);
1039
1072
  }
1040
- b && !t.value ? (t.value = !0, F()) : D.isIntersecting;
1073
+ b && !t.value ? (t.value = !0, H()) : z.isIntersecting;
1041
1074
  });
1042
1075
  },
1043
1076
  {
1044
1077
  // Trigger at both preloadThreshold and 1.0 (fully in view)
1045
- threshold: l
1078
+ threshold: n
1046
1079
  }
1047
- ), v.observe(I.value), await X(), requestAnimationFrame(() => {
1048
- requestAnimationFrame(() => {
1049
- x();
1050
- });
1051
- }), setTimeout(() => {
1052
- x();
1080
+ ), f.observe(P.value), await C(), await C(), await C(), p(), setTimeout(() => {
1081
+ p();
1053
1082
  }, 100);
1054
- function x() {
1055
- if (!I.value || w.value) return;
1056
- const E = I.value.getBoundingClientRect(), D = window.innerHeight, V = window.innerWidth;
1057
- if (E.top >= 0 && E.bottom <= D && E.left >= 0 && E.right <= V && E.height > 0 && E.width > 0) {
1058
- w.value = !0, a("in-view", { item: i.item, type: r.value });
1059
- const b = r.value === "image" ? f.value : y.value, H = r.value === "image" ? m.value : o.value;
1060
- b && H && M(r.value, b);
1083
+ function p() {
1084
+ if (!P.value || x.value) return;
1085
+ const S = P.value.getBoundingClientRect(), z = window.innerHeight, V = window.innerWidth;
1086
+ if (S.top >= 0 && S.bottom <= z && S.left >= 0 && S.right <= V && S.height > 0 && S.width > 0) {
1087
+ x.value = !0, a("in-view", { item: i.item, type: r.value });
1088
+ const b = r.value === "image" ? v.value : w.value, E = r.value === "image" ? g.value : o.value;
1089
+ b && E && M(r.value, b);
1061
1090
  }
1062
1091
  }
1063
- }), Ge(() => {
1064
- v && (v.disconnect(), v = null);
1065
- }), ee(
1092
+ }), qe(() => {
1093
+ f && (f.disconnect(), f = null);
1094
+ }), te(
1066
1095
  () => {
1067
- var l;
1068
- return (l = i.item) == null ? void 0 : l.src;
1096
+ var n;
1097
+ return (n = i.item) == null ? void 0 : n.src;
1069
1098
  },
1070
- async (l) => {
1071
- if (!(!l || s.value)) {
1099
+ async (n) => {
1100
+ if (!(!n || u.value)) {
1072
1101
  if (r.value === "video") {
1073
- if (l !== y.value && (o.value = !1, c.value = !1, y.value = l, t.value)) {
1074
- p.value = !0;
1102
+ if (n !== w.value && (o.value = !1, s.value = !1, w.value = n, t.value)) {
1103
+ y.value = !0;
1075
1104
  try {
1076
- await z(l);
1105
+ await W(n);
1077
1106
  } catch {
1078
1107
  }
1079
1108
  }
1080
- } else if (l !== f.value && (m.value = !1, d.value = !1, f.value = l, t.value)) {
1081
- p.value = !0;
1109
+ } else if (n !== v.value && (g.value = !1, d.value = !1, v.value = n, t.value)) {
1110
+ y.value = !0;
1082
1111
  try {
1083
- await P(l);
1112
+ await $(n);
1084
1113
  } catch {
1085
1114
  }
1086
1115
  }
1087
1116
  }
1088
1117
  }
1089
- ), ee(
1118
+ ), te(
1090
1119
  () => i.isActive,
1091
- (l) => {
1092
- !L.value || !S.value || (l ? S.value.play() : S.value.pause());
1120
+ (n) => {
1121
+ !L.value || !I.value || (n ? I.value.play() : I.value.pause());
1093
1122
  }
1094
- ), (l, x) => (Y(), q("div", {
1123
+ ), (n, p) => (_(), U("div", {
1095
1124
  ref_key: "containerRef",
1096
- ref: I,
1125
+ ref: P,
1097
1126
  class: "relative w-full h-full flex flex-col"
1098
1127
  }, [
1099
- l.headerHeight > 0 ? (Y(), q("div", {
1128
+ n.headerHeight > 0 ? (_(), U("div", {
1100
1129
  key: 0,
1101
1130
  class: "relative z-10",
1102
- style: he({ height: `${l.headerHeight}px` })
1131
+ style: he({ height: `${n.headerHeight}px` })
1103
1132
  }, [
1104
- J(l.$slots, "header", {
1105
- item: l.item,
1106
- remove: l.remove,
1107
- imageLoaded: m.value,
1133
+ J(n.$slots, "header", {
1134
+ item: n.item,
1135
+ remove: n.remove,
1136
+ imageLoaded: g.value,
1108
1137
  imageError: d.value,
1109
1138
  videoLoaded: o.value,
1110
- videoError: c.value,
1111
- showNotFound: s.value,
1112
- isLoading: p.value,
1139
+ videoError: s.value,
1140
+ showNotFound: u.value,
1141
+ isLoading: y.value,
1113
1142
  mediaType: r.value,
1114
- isFullyInView: w.value
1143
+ isFullyInView: x.value
1115
1144
  })
1116
- ], 4)) : te("", !0),
1117
- U("div", ua, [
1118
- J(l.$slots, "default", {
1119
- item: l.item,
1120
- remove: l.remove,
1121
- imageLoaded: m.value,
1145
+ ], 4)) : ae("", !0),
1146
+ G("div", ua, [
1147
+ J(n.$slots, "default", {
1148
+ item: n.item,
1149
+ remove: n.remove,
1150
+ imageLoaded: g.value,
1122
1151
  imageError: d.value,
1123
1152
  videoLoaded: o.value,
1124
- videoError: c.value,
1125
- showNotFound: s.value,
1126
- isLoading: p.value,
1153
+ videoError: s.value,
1154
+ showNotFound: u.value,
1155
+ isLoading: y.value,
1127
1156
  mediaType: r.value,
1128
- imageSrc: f.value,
1129
- videoSrc: y.value,
1157
+ imageSrc: v.value,
1158
+ videoSrc: w.value,
1130
1159
  showMedia: h.value,
1131
- isFullyInView: w.value
1160
+ isFullyInView: x.value
1132
1161
  }, () => [
1133
- U("div", ca, [
1134
- s.value ? (Y(), q("div", va, x[3] || (x[3] = [
1135
- U("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
1136
- U("span", { class: "font-medium" }, "Not Found", -1),
1137
- U("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
1138
- ]))) : (Y(), q("div", fa, [
1139
- r.value === "image" && f.value ? (Y(), q("img", {
1162
+ G("div", ca, [
1163
+ u.value ? (_(), U("div", va, p[3] || (p[3] = [
1164
+ G("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
1165
+ G("span", { class: "font-medium" }, "Not Found", -1),
1166
+ G("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
1167
+ ]))) : (_(), U("div", fa, [
1168
+ r.value === "image" && v.value ? (_(), U("img", {
1140
1169
  key: 0,
1141
- src: f.value,
1142
- class: re([
1170
+ src: v.value,
1171
+ class: ie([
1143
1172
  "w-full h-full object-cover transition-opacity duration-700 ease-in-out",
1144
- m.value && h.value ? "opacity-100" : "opacity-0"
1173
+ g.value && h.value ? "opacity-100" : "opacity-0"
1145
1174
  ]),
1146
1175
  style: { position: "absolute", top: "0", left: "0" },
1147
1176
  loading: "lazy",
1148
1177
  decoding: "async",
1149
1178
  alt: "",
1150
- onMouseenter: x[0] || (x[0] = (E) => g("image")),
1151
- onMouseleave: x[1] || (x[1] = (E) => $("image"))
1152
- }, null, 42, da)) : te("", !0),
1153
- r.value === "video" && y.value ? (Y(), q("video", {
1179
+ onMouseenter: p[0] || (p[0] = (S) => m("image")),
1180
+ onMouseleave: p[1] || (p[1] = (S) => N("image"))
1181
+ }, null, 42, da)) : ae("", !0),
1182
+ r.value === "video" && w.value ? (_(), U("video", {
1154
1183
  key: 1,
1155
1184
  ref_key: "videoEl",
1156
- ref: S,
1157
- src: y.value,
1158
- class: re([
1185
+ ref: I,
1186
+ src: w.value,
1187
+ class: ie([
1159
1188
  "w-full h-full object-cover transition-opacity duration-700 ease-in-out",
1160
1189
  o.value && h.value ? "opacity-100" : "opacity-0"
1161
1190
  ]),
@@ -1165,60 +1194,60 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1165
1194
  playsinline: "",
1166
1195
  autoplay: L.value && i.isActive,
1167
1196
  controls: L.value,
1168
- onClick: Ae(k, ["stop"]),
1169
- onTouchend: Ae(k, ["stop", "prevent"]),
1170
- onMouseenter: N,
1171
- onMouseleave: A,
1172
- onError: x[2] || (x[2] = (E) => c.value = !0)
1173
- }, null, 42, ma)) : te("", !0),
1174
- !m.value && !o.value && !d.value && !c.value ? (Y(), q("div", {
1197
+ onClick: Re(k, ["stop"]),
1198
+ onTouchend: Re(k, ["stop", "prevent"]),
1199
+ onMouseenter: B,
1200
+ onMouseleave: R,
1201
+ onError: p[2] || (p[2] = (S) => s.value = !0)
1202
+ }, null, 42, ga)) : ae("", !0),
1203
+ !g.value && !o.value && !d.value && !s.value ? (_(), U("div", {
1175
1204
  key: 2,
1176
- class: re([
1205
+ class: ie([
1177
1206
  "absolute inset-0 bg-slate-100 flex items-center justify-center transition-opacity duration-500",
1178
1207
  h.value ? "opacity-0 pointer-events-none" : "opacity-100"
1179
1208
  ])
1180
1209
  }, [
1181
- U("div", ha, [
1182
- J(l.$slots, "placeholder-icon", { mediaType: r.value }, () => [
1183
- U("i", {
1184
- class: re(r.value === "video" ? "fas fa-video text-xl text-slate-400" : "fas fa-image text-xl text-slate-400")
1210
+ G("div", ha, [
1211
+ J(n.$slots, "placeholder-icon", { mediaType: r.value }, () => [
1212
+ G("i", {
1213
+ class: ie(r.value === "video" ? "fas fa-video text-xl text-slate-400" : "fas fa-image text-xl text-slate-400")
1185
1214
  }, null, 2)
1186
1215
  ])
1187
1216
  ])
1188
- ], 2)) : te("", !0),
1189
- p.value ? (Y(), q("div", ga, x[4] || (x[4] = [
1190
- U("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
1191
- U("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
1217
+ ], 2)) : ae("", !0),
1218
+ y.value ? (_(), U("div", ma, p[4] || (p[4] = [
1219
+ G("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
1220
+ G("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
1192
1221
  ], -1)
1193
- ]))) : te("", !0),
1194
- r.value === "image" && d.value || r.value === "video" && c.value ? (Y(), q("div", pa, [
1195
- U("i", {
1196
- class: re(r.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
1222
+ ]))) : ae("", !0),
1223
+ r.value === "image" && d.value || r.value === "video" && s.value ? (_(), U("div", pa, [
1224
+ G("i", {
1225
+ class: ie(r.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
1197
1226
  }, null, 2),
1198
- U("span", null, "Failed to load " + Pe(r.value), 1)
1199
- ])) : te("", !0)
1227
+ G("span", null, "Failed to load " + Ee(r.value), 1)
1228
+ ])) : ae("", !0)
1200
1229
  ]))
1201
1230
  ])
1202
1231
  ])
1203
1232
  ]),
1204
- l.footerHeight > 0 ? (Y(), q("div", {
1233
+ n.footerHeight > 0 ? (_(), U("div", {
1205
1234
  key: 1,
1206
1235
  class: "relative z-10",
1207
- style: he({ height: `${l.footerHeight}px` })
1236
+ style: he({ height: `${n.footerHeight}px` })
1208
1237
  }, [
1209
- J(l.$slots, "footer", {
1210
- item: l.item,
1211
- remove: l.remove,
1212
- imageLoaded: m.value,
1238
+ J(n.$slots, "footer", {
1239
+ item: n.item,
1240
+ remove: n.remove,
1241
+ imageLoaded: g.value,
1213
1242
  imageError: d.value,
1214
1243
  videoLoaded: o.value,
1215
- videoError: c.value,
1216
- showNotFound: s.value,
1217
- isLoading: p.value,
1244
+ videoError: s.value,
1245
+ showNotFound: u.value,
1246
+ isLoading: y.value,
1218
1247
  mediaType: r.value,
1219
- isFullyInView: w.value
1248
+ isFullyInView: x.value
1220
1249
  })
1221
- ], 4)) : te("", !0)
1250
+ ], 4)) : ae("", !0)
1222
1251
  ], 512));
1223
1252
  }
1224
1253
  }), ya = {
@@ -1230,13 +1259,13 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1230
1259
  }, Ma = {
1231
1260
  key: 1,
1232
1261
  class: "w-full py-8 text-center"
1233
- }, Ta = { class: "text-red-500 dark:text-red-400" }, Ia = {
1262
+ }, Ta = { class: "text-red-500 dark:text-red-400" }, Pa = {
1234
1263
  key: 0,
1235
1264
  class: "w-full py-8 text-center"
1236
- }, La = {
1265
+ }, Ia = {
1237
1266
  key: 1,
1238
1267
  class: "w-full py-8 text-center"
1239
- }, Sa = { class: "text-red-500 dark:text-red-400" }, ka = /* @__PURE__ */ _e({
1268
+ }, La = { class: "text-red-500 dark:text-red-400" }, ka = /* @__PURE__ */ Xe({
1240
1269
  __name: "Masonry",
1241
1270
  props: {
1242
1271
  getPage: {
@@ -1361,8 +1390,8 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1361
1390
  "item:mouse-leave",
1362
1391
  "update:context"
1363
1392
  ],
1364
- setup(e, { expose: n, emit: i }) {
1365
- const a = e, m = {
1393
+ setup(e, { expose: l, emit: i }) {
1394
+ const a = e, g = {
1366
1395
  sizes: { base: 1, sm: 2, md: 3, lg: 4, xl: 5, "2xl": 6 },
1367
1396
  gutterX: 10,
1368
1397
  gutterY: 10,
@@ -1371,79 +1400,79 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1371
1400
  paddingLeft: 0,
1372
1401
  paddingRight: 0,
1373
1402
  placement: "masonry"
1374
- }, d = K(() => {
1375
- var u;
1403
+ }, d = Q(() => {
1404
+ var c;
1376
1405
  return {
1377
- ...m,
1406
+ ...g,
1378
1407
  ...a.layout,
1379
1408
  sizes: {
1380
- ...m.sizes,
1381
- ...((u = a.layout) == null ? void 0 : u.sizes) || {}
1409
+ ...g.sizes,
1410
+ ...((c = a.layout) == null ? void 0 : c.sizes) || {}
1382
1411
  }
1383
1412
  };
1384
- }), f = W(null), o = W(typeof window < "u" ? window.innerWidth : 1024), c = W(typeof window < "u" ? window.innerHeight : 768), y = W(null);
1413
+ }), v = F(null), o = F(typeof window < "u" ? window.innerWidth : 1024), s = F(typeof window < "u" ? window.innerHeight : 768), w = F(null);
1385
1414
  let t = null;
1386
- function w(u) {
1415
+ function x(c) {
1387
1416
  return {
1388
1417
  sm: 640,
1389
1418
  md: 768,
1390
1419
  lg: 1024,
1391
1420
  xl: 1280,
1392
1421
  "2xl": 1536
1393
- }[u] || 768;
1422
+ }[c] || 768;
1394
1423
  }
1395
- const T = K(() => {
1424
+ const T = Q(() => {
1396
1425
  if (a.layoutMode === "masonry") return !1;
1397
1426
  if (a.layoutMode === "swipe") return !0;
1398
- const u = typeof a.mobileBreakpoint == "string" ? w(a.mobileBreakpoint) : a.mobileBreakpoint;
1399
- return o.value < u;
1400
- }), p = i, h = K({
1427
+ const c = typeof a.mobileBreakpoint == "string" ? x(a.mobileBreakpoint) : a.mobileBreakpoint;
1428
+ return o.value < c;
1429
+ }), y = i, h = Q({
1401
1430
  get: () => a.items,
1402
- set: (u) => p("update:items", u)
1403
- }), I = K({
1431
+ set: (c) => y("update:items", c)
1432
+ }), P = Q({
1404
1433
  get: () => a.context,
1405
- set: (u) => p("update:context", u)
1434
+ set: (c) => y("update:context", c)
1406
1435
  });
1407
- function S(u) {
1408
- I.value = u;
1436
+ function I(c) {
1437
+ P.value = c;
1409
1438
  }
1410
- const v = K(() => {
1411
- const u = h.value;
1412
- return (u == null ? void 0 : u.length) ?? 0;
1413
- }), r = W(7), s = W(null), L = W([]), M = W(null), g = W(!1), $ = W(0), k = W(!1), N = W(null), A = W(!1), P = K(() => Kt(o.value)), z = sa({
1439
+ const f = Q(() => {
1440
+ const c = h.value;
1441
+ return (c == null ? void 0 : c.length) ?? 0;
1442
+ }), r = F(7), u = F(null), L = F([]), M = F(null), m = F(!1), N = F(0), k = F(!1), B = F(null), R = F(!1), $ = Q(() => Kt(o.value)), W = sa({
1414
1443
  masonry: h
1415
- }), { checkItemDimensions: F, reset: l } = z, x = ra({
1444
+ }), { checkItemDimensions: H, reset: n } = W, p = ra({
1416
1445
  masonry: h,
1417
1446
  useSwipeMode: T,
1418
- container: s,
1447
+ container: u,
1419
1448
  columns: r,
1420
1449
  containerWidth: o,
1421
- masonryContentHeight: $,
1450
+ masonryContentHeight: N,
1422
1451
  layout: d,
1423
- fixedDimensions: y,
1424
- checkItemDimensions: F
1425
- }), { refreshLayout: E, setFixedDimensions: D, onResize: V } = x, C = ia({
1452
+ fixedDimensions: w,
1453
+ checkItemDimensions: H
1454
+ }), { refreshLayout: S, setFixedDimensions: z, onResize: V } = p, Y = ia({
1426
1455
  masonry: h,
1427
- container: s,
1456
+ container: u,
1428
1457
  columns: r,
1429
1458
  virtualBufferPx: a.virtualBufferPx,
1430
1459
  loadThresholdPx: a.loadThresholdPx,
1431
1460
  handleScroll: () => {
1432
1461
  }
1433
1462
  // Will be set after pagination is initialized
1434
- }), { viewportTop: b, viewportHeight: H, virtualizing: R, visibleMasonry: ne, updateScrollProgress: _, updateViewport: ie, reset: Q } = C, { onEnter: Qe, onBeforeEnter: Ze, onBeforeLeave: et, onLeave: tt } = ta(
1435
- { container: s },
1436
- { leaveDurationMs: a.leaveDurationMs, virtualizing: R }
1463
+ }), { viewportTop: b, viewportHeight: E, virtualizing: O, visibleMasonry: ne, updateScrollProgress: X, updateViewport: Z, reset: K } = Y, { onEnter: Qe, onBeforeEnter: Ze, onBeforeLeave: et, onLeave: tt } = ta(
1464
+ { container: u },
1465
+ { leaveDurationMs: a.leaveDurationMs, virtualizing: O }
1437
1466
  ), at = Qe, nt = Ze, lt = et, ot = tt, rt = la({
1438
1467
  getPage: a.getPage,
1439
- context: I,
1468
+ context: P,
1440
1469
  masonry: h,
1441
- isLoading: g,
1470
+ isLoading: m,
1442
1471
  hasReachedEnd: k,
1443
- loadError: N,
1472
+ loadError: B,
1444
1473
  currentPage: M,
1445
1474
  paginationHistory: L,
1446
- refreshLayout: E,
1475
+ refreshLayout: S,
1447
1476
  retryMaxAttempts: a.retryMaxAttempts,
1448
1477
  retryInitialDelayMs: a.retryInitialDelayMs,
1449
1478
  retryBackoffStepMs: a.retryBackoffStepMs,
@@ -1451,51 +1480,51 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1451
1480
  backfillDelayMs: a.backfillDelayMs,
1452
1481
  backfillMaxCalls: a.backfillMaxCalls,
1453
1482
  pageSize: a.pageSize,
1454
- emits: p
1455
- }), { loadPage: be, loadNext: ge, refreshCurrentPage: it, cancelLoad: Me, maybeBackfillToTarget: st } = rt, Z = na({
1483
+ emits: y
1484
+ }), { loadPage: be, loadNext: me, refreshCurrentPage: it, cancelLoad: Me, maybeBackfillToTarget: st } = rt, ee = na({
1456
1485
  useSwipeMode: T,
1457
1486
  masonry: h,
1458
- isLoading: g,
1459
- loadNext: ge,
1487
+ isLoading: m,
1488
+ loadNext: me,
1460
1489
  loadPage: be,
1461
1490
  paginationHistory: L
1462
1491
  }), { handleScroll: ut } = aa({
1463
- container: s,
1492
+ container: u,
1464
1493
  masonry: h,
1465
1494
  columns: r,
1466
- containerHeight: $,
1467
- isLoading: g,
1495
+ containerHeight: N,
1496
+ isLoading: m,
1468
1497
  pageSize: a.pageSize,
1469
- refreshLayout: E,
1470
- setItemsRaw: (u) => {
1471
- h.value = u;
1498
+ refreshLayout: S,
1499
+ setItemsRaw: (c) => {
1500
+ h.value = c;
1472
1501
  },
1473
- loadNext: ge,
1502
+ loadNext: me,
1474
1503
  loadThresholdPx: a.loadThresholdPx
1475
1504
  });
1476
- C.handleScroll.value = ut;
1505
+ Y.handleScroll.value = ut;
1477
1506
  const ct = oa({
1478
1507
  masonry: h,
1479
1508
  useSwipeMode: T,
1480
- refreshLayout: E,
1481
- loadNext: ge,
1509
+ refreshLayout: S,
1510
+ loadNext: me,
1482
1511
  maybeBackfillToTarget: st,
1483
1512
  paginationHistory: L
1484
- }), { remove: ue, removeMany: vt, restore: ft, restoreMany: dt, removeAll: mt } = ct;
1485
- function ht(u) {
1486
- D(u, _), !u && f.value && (o.value = f.value.clientWidth, c.value = f.value.clientHeight);
1513
+ }), { remove: ue, removeMany: vt, restore: ft, restoreMany: dt, removeAll: gt } = ct;
1514
+ function ht(c) {
1515
+ z(c, X), !c && v.value && (o.value = v.value.clientWidth, s.value = v.value.clientHeight);
1487
1516
  }
1488
- n({
1517
+ l({
1489
1518
  // Cancels any ongoing load operations (page loads, backfills, etc.)
1490
1519
  cancelLoad: Me,
1491
1520
  // Opaque caller context passed through to getPage(page, context). Useful for including filters, service selection, tabId, etc.
1492
- context: I,
1521
+ context: P,
1493
1522
  // Container height (wrapper element) in pixels
1494
- containerHeight: c,
1523
+ containerHeight: s,
1495
1524
  // Container width (wrapper element) in pixels
1496
1525
  containerWidth: o,
1497
1526
  // Current Tailwind breakpoint name (base, sm, md, lg, xl, 2xl) based on containerWidth
1498
- currentBreakpoint: P,
1527
+ currentBreakpoint: $,
1499
1528
  // Current page number or cursor being displayed
1500
1529
  currentPage: M,
1501
1530
  // Completely destroys the component, clearing all state and resetting to initial state
@@ -1505,13 +1534,13 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1505
1534
  // Initializes the component with items, page, and next page cursor. Use this for manual init mode.
1506
1535
  initialize: Tt,
1507
1536
  // Boolean indicating if the component has been initialized (first content has loaded)
1508
- isInitialized: A,
1537
+ isInitialized: R,
1509
1538
  // Boolean indicating if a page load or backfill operation is currently in progress
1510
- isLoading: g,
1539
+ isLoading: m,
1511
1540
  // Error object if the last load operation failed, null otherwise
1512
- loadError: N,
1541
+ loadError: B,
1513
1542
  // Loads the next page of items asynchronously
1514
- loadNext: ge,
1543
+ loadNext: me,
1515
1544
  // Loads a specific page number or cursor asynchronously
1516
1545
  loadPage: be,
1517
1546
  // Array tracking pagination history (pages/cursors that have been loaded)
@@ -1519,11 +1548,11 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1519
1548
  // Refreshes the current page by clearing items and reloading from the current page
1520
1549
  refreshCurrentPage: it,
1521
1550
  // Recalculates the layout positions for all items. Call this after manually modifying items.
1522
- refreshLayout: E,
1551
+ refreshLayout: S,
1523
1552
  // Removes a single item from the masonry
1524
1553
  remove: ue,
1525
1554
  // Removes all items from the masonry
1526
- removeAll: mt,
1555
+ removeAll: gt,
1527
1556
  // Removes multiple items from the masonry in a single operation
1528
1557
  removeMany: vt,
1529
1558
  // Resets the component to initial state (clears items, resets pagination, scrolls to top)
@@ -1537,171 +1566,171 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1537
1566
  // Scrolls the container to the top
1538
1567
  scrollToTop: yt,
1539
1568
  // Sets the opaque caller context (alternative to v-model:context)
1540
- setContext: S,
1569
+ setContext: I,
1541
1570
  // Sets fixed dimensions for the container, overriding ResizeObserver. Pass null to restore automatic sizing.
1542
1571
  setFixedDimensions: ht,
1543
1572
  // Computed property returning the total number of items currently in the masonry
1544
- totalItems: K(() => h.value.length)
1573
+ totalItems: Q(() => h.value.length)
1545
1574
  });
1546
- const ce = Z.currentSwipeIndex, pe = Z.swipeOffset, ye = Z.isDragging, le = Z.swipeContainer, Fe = Z.handleTouchStart, ze = Z.handleTouchMove, De = Z.handleTouchEnd, Be = Z.handleMouseDown, Te = Z.handleMouseMove, Ie = Z.handleMouseUp, Le = Z.snapToCurrentItem;
1547
- function gt(u) {
1548
- const B = v.value, j = typeof u == "string" ? parseInt(u, 10) : u;
1549
- return B > 0 ? `${j * (100 / B)}%` : "0%";
1575
+ const ce = ee.currentSwipeIndex, pe = ee.swipeOffset, ye = ee.isDragging, oe = ee.swipeContainer, Ne = ee.handleTouchStart, ze = ee.handleTouchMove, De = ee.handleTouchEnd, Be = ee.handleMouseDown, Te = ee.handleMouseMove, Pe = ee.handleMouseUp, Ie = ee.snapToCurrentItem;
1576
+ function mt(c) {
1577
+ const D = f.value, j = typeof c == "string" ? parseInt(c, 10) : c;
1578
+ return D > 0 ? `${j * (100 / D)}%` : "0%";
1550
1579
  }
1551
1580
  function pt() {
1552
- const u = v.value;
1553
- return u > 0 ? `${100 / u}%` : "0%";
1581
+ const c = f.value;
1582
+ return c > 0 ? `${100 / c}%` : "0%";
1554
1583
  }
1555
- function yt(u) {
1556
- s.value && s.value.scrollTo({
1584
+ function yt(c) {
1585
+ u.value && u.value.scrollTo({
1557
1586
  top: 0,
1558
- behavior: (u == null ? void 0 : u.behavior) ?? "smooth",
1559
- ...u
1587
+ behavior: (c == null ? void 0 : c.behavior) ?? "smooth",
1588
+ ...c
1560
1589
  });
1561
1590
  }
1562
- function wt(u) {
1563
- s.value && (s.value.scrollTo({
1564
- top: u.top ?? s.value.scrollTop,
1565
- left: u.left ?? s.value.scrollLeft,
1566
- behavior: u.behavior ?? "auto"
1567
- }), s.value && (b.value = s.value.scrollTop, H.value = s.value.clientHeight || window.innerHeight));
1591
+ function wt(c) {
1592
+ u.value && (u.value.scrollTo({
1593
+ top: c.top ?? u.value.scrollTop,
1594
+ left: c.left ?? u.value.scrollLeft,
1595
+ behavior: c.behavior ?? "auto"
1596
+ }), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight || window.innerHeight));
1568
1597
  }
1569
1598
  function xt() {
1570
- V(), s.value && (b.value = s.value.scrollTop, H.value = s.value.clientHeight);
1599
+ V(), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight);
1571
1600
  }
1572
1601
  function bt() {
1573
- Me(), s.value && s.value.scrollTo({
1602
+ Me(), u.value && u.value.scrollTo({
1574
1603
  top: 0,
1575
1604
  behavior: "smooth"
1576
- }), h.value = [], c.value = 0, M.value = a.loadAtPage, L.value = [a.loadAtPage], k.value = !1, N.value = null, A.value = !1, Q();
1605
+ }), h.value = [], s.value = 0, M.value = a.loadAtPage, L.value = [a.loadAtPage], k.value = !1, B.value = null, R.value = !1, K();
1577
1606
  }
1578
1607
  function Mt() {
1579
- Me(), h.value = [], $.value = 0, M.value = null, L.value = [], k.value = !1, N.value = null, g.value = !1, A.value = !1, ce.value = 0, pe.value = 0, ye.value = !1, Q(), l(), s.value && s.value.scrollTo({
1608
+ Me(), h.value = [], N.value = 0, M.value = null, L.value = [], k.value = !1, B.value = null, m.value = !1, R.value = !1, ce.value = 0, pe.value = 0, ye.value = !1, K(), n(), u.value && u.value.scrollTo({
1580
1609
  top: 0,
1581
1610
  behavior: "auto"
1582
1611
  // Instant scroll for destroy
1583
1612
  });
1584
1613
  }
1585
- const oe = Ye(async () => {
1586
- T.value || await ie();
1587
- }, 200), Ne = Ye(xt, 200);
1588
- function We() {
1589
- Z.handleWindowResize();
1614
+ const re = Ue(async () => {
1615
+ T.value || await Z();
1616
+ }, 200), We = Ue(xt, 200);
1617
+ function Fe() {
1618
+ ee.handleWindowResize();
1590
1619
  }
1591
- function Tt(u, B, j) {
1592
- M.value = B, L.value = [B], j != null && L.value.push(j), k.value = j === null, F(u, "initialize");
1593
- const ae = h.value, O = ae.length === 0 ? u : [...ae, ...u];
1594
- h.value = O, T.value ? ce.value === 0 && h.value.length > 0 && (pe.value = 0) : (E(O), s.value && (b.value = s.value.scrollTop, H.value = s.value.clientHeight || window.innerHeight), X(() => {
1595
- s.value && (b.value = s.value.scrollTop, H.value = s.value.clientHeight || window.innerHeight, _());
1596
- })), u && u.length > 0 && (A.value = !0);
1620
+ async function Tt(c, D, j) {
1621
+ M.value = D, L.value = [D], j != null && L.value.push(j), k.value = j === null, H(c, "initialize");
1622
+ const le = h.value, A = le.length === 0 ? c : [...le, ...c];
1623
+ h.value = A, await C(), T.value ? ce.value === 0 && h.value.length > 0 && (pe.value = 0) : (await C(), await C(), S(A), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight || window.innerHeight), C(() => {
1624
+ u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight || window.innerHeight, X());
1625
+ })), c && c.length > 0 && (R.value = !0);
1597
1626
  }
1598
- return ee(
1627
+ return te(
1599
1628
  d,
1600
1629
  () => {
1601
- T.value || s.value && (r.value = se(d.value, o.value), E(h.value));
1630
+ T.value || u.value && (r.value = se(d.value, o.value), S(h.value));
1602
1631
  },
1603
1632
  { deep: !0 }
1604
- ), ee(() => a.layoutMode, () => {
1605
- y.value && y.value.width !== void 0 ? o.value = y.value.width : f.value && (o.value = f.value.clientWidth);
1606
- }), ee(s, (u) => {
1607
- u && !T.value ? (u.removeEventListener("scroll", oe), u.addEventListener("scroll", oe, { passive: !0 })) : u && u.removeEventListener("scroll", oe);
1608
- }, { immediate: !0 }), ee(
1633
+ ), te(() => a.layoutMode, () => {
1634
+ w.value && w.value.width !== void 0 ? o.value = w.value.width : v.value && (o.value = v.value.clientWidth);
1635
+ }), te(u, (c) => {
1636
+ c && !T.value ? (c.removeEventListener("scroll", re), c.addEventListener("scroll", re, { passive: !0 })) : c && c.removeEventListener("scroll", re);
1637
+ }, { immediate: !0 }), te(
1609
1638
  () => h.value.length,
1610
- (u, B) => {
1611
- a.init === "manual" && !A.value && u > 0 && B === 0 && (A.value = !0);
1639
+ (c, D) => {
1640
+ a.init === "manual" && !R.value && c > 0 && D === 0 && (R.value = !0);
1612
1641
  },
1613
1642
  { immediate: !1 }
1614
- ), ee(T, (u, B) => {
1615
- B === void 0 && u === !1 || X(() => {
1616
- u ? (document.addEventListener("mousemove", Te), document.addEventListener("mouseup", Ie), s.value && s.value.removeEventListener("scroll", oe), ce.value = 0, pe.value = 0, h.value.length > 0 && Le()) : (document.removeEventListener("mousemove", Te), document.removeEventListener("mouseup", Ie), s.value && f.value && (y.value && y.value.width !== void 0 ? o.value = y.value.width : o.value = f.value.clientWidth, s.value.removeEventListener("scroll", oe), s.value.addEventListener("scroll", oe, { passive: !0 }), h.value.length > 0 && (r.value = se(d.value, o.value), E(h.value), b.value = s.value.scrollTop, H.value = s.value.clientHeight, _())));
1643
+ ), te(T, (c, D) => {
1644
+ D === void 0 && c === !1 || C(() => {
1645
+ c ? (document.addEventListener("mousemove", Te), document.addEventListener("mouseup", Pe), u.value && u.value.removeEventListener("scroll", re), ce.value = 0, pe.value = 0, h.value.length > 0 && Ie()) : (document.removeEventListener("mousemove", Te), document.removeEventListener("mouseup", Pe), u.value && v.value && (w.value && w.value.width !== void 0 ? o.value = w.value.width : o.value = v.value.clientWidth, u.value.removeEventListener("scroll", re), u.value.addEventListener("scroll", re, { passive: !0 }), h.value.length > 0 && (r.value = se(d.value, o.value), S(h.value), b.value = u.value.scrollTop, E.value = u.value.clientHeight, X())));
1617
1646
  });
1618
- }, { immediate: !0 }), ee(le, (u) => {
1619
- u && (u.addEventListener("touchstart", Fe, { passive: !1 }), u.addEventListener("touchmove", ze, { passive: !1 }), u.addEventListener("touchend", De), u.addEventListener("mousedown", Be));
1620
- }), ee(() => h.value.length, (u, B) => {
1621
- T.value && u > 0 && B === 0 && (ce.value = 0, X(() => Le()));
1622
- }), ee(f, (u) => {
1623
- t && (t.disconnect(), t = null), u && typeof ResizeObserver < "u" ? (t = new ResizeObserver((B) => {
1624
- if (!y.value)
1625
- for (const j of B) {
1626
- const ae = j.contentRect.width, O = j.contentRect.height;
1627
- o.value !== ae && (o.value = ae), c.value !== O && (c.value = O);
1647
+ }, { immediate: !0 }), te(oe, (c) => {
1648
+ c && (c.addEventListener("touchstart", Ne, { passive: !1 }), c.addEventListener("touchmove", ze, { passive: !1 }), c.addEventListener("touchend", De), c.addEventListener("mousedown", Be));
1649
+ }), te(() => h.value.length, (c, D) => {
1650
+ T.value && c > 0 && D === 0 && (ce.value = 0, C(() => Ie()));
1651
+ }), te(v, (c) => {
1652
+ t && (t.disconnect(), t = null), c && typeof ResizeObserver < "u" ? (t = new ResizeObserver((D) => {
1653
+ if (!w.value)
1654
+ for (const j of D) {
1655
+ const le = j.contentRect.width, A = j.contentRect.height;
1656
+ o.value !== le && (o.value = le), s.value !== A && (s.value = A);
1628
1657
  }
1629
- }), t.observe(u), y.value || (o.value = u.clientWidth, c.value = u.clientHeight)) : u && (y.value || (o.value = u.clientWidth, c.value = u.clientHeight));
1630
- }, { immediate: !0 }), ee(o, (u, B) => {
1631
- u !== B && u > 0 && !T.value && s.value && h.value.length > 0 && X(() => {
1632
- r.value = se(d.value, u), E(h.value), _();
1658
+ }), t.observe(c), w.value || (o.value = c.clientWidth, s.value = c.clientHeight)) : c && (w.value || (o.value = c.clientWidth, s.value = c.clientHeight));
1659
+ }, { immediate: !0 }), te(o, (c, D) => {
1660
+ c !== D && c > 0 && !T.value && u.value && h.value.length > 0 && C(() => {
1661
+ r.value = se(d.value, c), S(h.value), X();
1633
1662
  });
1634
- }), Xe(async () => {
1663
+ }), Ge(async () => {
1635
1664
  try {
1636
- await X(), f.value && !t && (o.value = f.value.clientWidth, c.value = f.value.clientHeight), T.value || (r.value = se(d.value, o.value), s.value && (b.value = s.value.scrollTop, H.value = s.value.clientHeight));
1637
- const u = a.loadAtPage;
1638
- if (L.value = [u], a.init === "auto") {
1639
- A.value = !0, await X();
1665
+ await C(), v.value && !t && (o.value = v.value.clientWidth, s.value = v.value.clientHeight), T.value || (r.value = se(d.value, o.value), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight));
1666
+ const c = a.loadAtPage;
1667
+ if (a.init === "auto" && L.value.length === 0 && (L.value = [c]), a.init === "auto") {
1668
+ R.value = !0, await C();
1640
1669
  try {
1641
- await be(u);
1670
+ await be(c);
1642
1671
  } catch {
1643
1672
  }
1644
1673
  }
1645
- T.value ? X(() => Le()) : _();
1646
- } catch (u) {
1647
- N.value || (console.error("Error during component initialization:", u), N.value = me(u)), g.value = !1;
1674
+ T.value ? C(() => Ie()) : X();
1675
+ } catch (c) {
1676
+ B.value || (console.error("Error during component initialization:", c), B.value = ge(c)), m.value = !1;
1648
1677
  }
1649
- window.addEventListener("resize", Ne), window.addEventListener("resize", We);
1650
- }), Ge(() => {
1651
- var u;
1652
- t && (t.disconnect(), t = null), (u = s.value) == null || u.removeEventListener("scroll", oe), window.removeEventListener("resize", Ne), window.removeEventListener("resize", We), le.value && (le.value.removeEventListener("touchstart", Fe), le.value.removeEventListener("touchmove", ze), le.value.removeEventListener("touchend", De), le.value.removeEventListener("mousedown", Be)), document.removeEventListener("mousemove", Te), document.removeEventListener("mouseup", Ie);
1653
- }), (u, B) => (Y(), q("div", {
1678
+ window.addEventListener("resize", We), window.addEventListener("resize", Fe);
1679
+ }), qe(() => {
1680
+ var c;
1681
+ t && (t.disconnect(), t = null), (c = u.value) == null || c.removeEventListener("scroll", re), window.removeEventListener("resize", We), window.removeEventListener("resize", Fe), oe.value && (oe.value.removeEventListener("touchstart", Ne), oe.value.removeEventListener("touchmove", ze), oe.value.removeEventListener("touchend", De), oe.value.removeEventListener("mousedown", Be)), document.removeEventListener("mousemove", Te), document.removeEventListener("mouseup", Pe);
1682
+ }), (c, D) => (_(), U("div", {
1654
1683
  ref_key: "wrapper",
1655
- ref: f,
1684
+ ref: v,
1656
1685
  class: "w-full h-full flex flex-col relative"
1657
1686
  }, [
1658
- A.value ? T.value ? (Y(), q("div", {
1687
+ R.value ? T.value ? (_(), U("div", {
1659
1688
  key: 1,
1660
- class: re(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion": a.forceMotion, "cursor-grab": !G(ye), "cursor-grabbing": G(ye) }]),
1689
+ class: ie(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion": a.forceMotion, "cursor-grab": !q(ye), "cursor-grabbing": q(ye) }]),
1661
1690
  ref_key: "swipeContainer",
1662
- ref: le,
1691
+ ref: oe,
1663
1692
  style: { height: "100%", "max-height": "100%", position: "relative" }
1664
1693
  }, [
1665
- U("div", {
1694
+ G("div", {
1666
1695
  class: "relative w-full",
1667
1696
  style: he({
1668
- transform: `translateY(${G(pe)}px)`,
1669
- transition: G(ye) ? "none" : `transform ${e.transitionDurationMs}ms ${e.transitionEasing}`,
1670
- height: `${v.value * 100}%`
1697
+ transform: `translateY(${q(pe)}px)`,
1698
+ transition: q(ye) ? "none" : `transform ${e.transitionDurationMs}ms ${e.transitionEasing}`,
1699
+ height: `${f.value * 100}%`
1671
1700
  })
1672
1701
  }, [
1673
- (Y(!0), q(Re, null, Oe(h.value, (j, ae) => (Y(), q("div", {
1702
+ (_(!0), U(Ce, null, Oe(h.value, (j, le) => (_(), U("div", {
1674
1703
  key: `${j.page}-${j.id}`,
1675
1704
  class: "absolute top-0 left-0 w-full",
1676
1705
  style: he({
1677
- top: gt(ae),
1706
+ top: mt(le),
1678
1707
  height: pt()
1679
1708
  })
1680
1709
  }, [
1681
- U("div", wa, [
1682
- U("div", xa, [
1683
- J(u.$slots, "default", {
1710
+ G("div", wa, [
1711
+ G("div", xa, [
1712
+ J(c.$slots, "default", {
1684
1713
  item: j,
1685
- remove: G(ue),
1714
+ remove: q(ue),
1686
1715
  index: j.originalIndex ?? h.value.indexOf(j)
1687
1716
  }, () => [
1688
- Se(xe, {
1717
+ Le(xe, {
1689
1718
  item: j,
1690
- remove: G(ue),
1719
+ remove: q(ue),
1691
1720
  "header-height": d.value.header,
1692
1721
  "footer-height": d.value.footer,
1693
1722
  "in-swipe-mode": !0,
1694
- "is-active": ae === G(ce),
1695
- "onPreload:success": B[0] || (B[0] = (O) => p("item:preload:success", O)),
1696
- "onPreload:error": B[1] || (B[1] = (O) => p("item:preload:error", O)),
1697
- onMouseEnter: B[2] || (B[2] = (O) => p("item:mouse-enter", O)),
1698
- onMouseLeave: B[3] || (B[3] = (O) => p("item:mouse-leave", O))
1723
+ "is-active": le === q(ce),
1724
+ "onPreload:success": D[0] || (D[0] = (A) => y("item:preload:success", A)),
1725
+ "onPreload:error": D[1] || (D[1] = (A) => y("item:preload:error", A)),
1726
+ onMouseEnter: D[2] || (D[2] = (A) => y("item:mouse-enter", A)),
1727
+ onMouseLeave: D[3] || (D[3] = (A) => y("item:mouse-leave", A))
1699
1728
  }, {
1700
- header: ve((O) => [
1701
- J(u.$slots, "item-header", fe({ ref_for: !0 }, O), void 0, !0)
1729
+ header: ve((A) => [
1730
+ J(c.$slots, "item-header", fe({ ref_for: !0 }, A), void 0, !0)
1702
1731
  ]),
1703
- footer: ve((O) => [
1704
- J(u.$slots, "item-footer", fe({ ref_for: !0 }, O), void 0, !0)
1732
+ footer: ve((A) => [
1733
+ J(c.$slots, "item-footer", fe({ ref_for: !0 }, A), void 0, !0)
1705
1734
  ]),
1706
1735
  _: 2
1707
1736
  }, 1032, ["item", "remove", "header-height", "footer-height", "is-active"])
@@ -1710,62 +1739,62 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1710
1739
  ])
1711
1740
  ], 4))), 128))
1712
1741
  ], 4),
1713
- k.value && h.value.length > 0 ? (Y(), q("div", ba, [
1714
- J(u.$slots, "end-message", {}, () => [
1715
- B[9] || (B[9] = U("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1742
+ k.value && h.value.length > 0 ? (_(), U("div", ba, [
1743
+ J(c.$slots, "end-message", {}, () => [
1744
+ D[9] || (D[9] = G("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1716
1745
  ], !0)
1717
- ])) : te("", !0),
1718
- N.value && h.value.length > 0 ? (Y(), q("div", Ma, [
1719
- J(u.$slots, "error-message", { error: N.value }, () => [
1720
- U("p", Ta, "Failed to load content: " + Pe(N.value.message), 1)
1746
+ ])) : ae("", !0),
1747
+ B.value && h.value.length > 0 ? (_(), U("div", Ma, [
1748
+ J(c.$slots, "error-message", { error: B.value }, () => [
1749
+ G("p", Ta, "Failed to load content: " + Ee(B.value.message), 1)
1721
1750
  ], !0)
1722
- ])) : te("", !0)
1723
- ], 2)) : (Y(), q("div", {
1751
+ ])) : ae("", !0)
1752
+ ], 2)) : (_(), U("div", {
1724
1753
  key: 2,
1725
- class: re(["overflow-auto w-full flex-1 masonry-container", { "force-motion": a.forceMotion }]),
1754
+ class: ie(["overflow-auto w-full flex-1 masonry-container", { "force-motion": a.forceMotion }]),
1726
1755
  ref_key: "container",
1727
- ref: s
1756
+ ref: u
1728
1757
  }, [
1729
- U("div", {
1758
+ G("div", {
1730
1759
  class: "relative",
1731
- style: he({ height: `${$.value}px`, "--masonry-duration": `${e.transitionDurationMs}ms`, "--masonry-leave-duration": `${e.leaveDurationMs}ms`, "--masonry-ease": e.transitionEasing })
1760
+ style: he({ height: `${N.value}px`, "--masonry-duration": `${e.transitionDurationMs}ms`, "--masonry-leave-duration": `${e.leaveDurationMs}ms`, "--masonry-ease": e.transitionEasing })
1732
1761
  }, [
1733
- Se(It, {
1762
+ Le(Pt, {
1734
1763
  name: "masonry",
1735
1764
  css: !1,
1736
- onEnter: G(at),
1737
- onBeforeEnter: G(nt),
1738
- onLeave: G(ot),
1739
- onBeforeLeave: G(lt)
1765
+ onEnter: q(at),
1766
+ onBeforeEnter: q(nt),
1767
+ onLeave: q(ot),
1768
+ onBeforeLeave: q(lt)
1740
1769
  }, {
1741
1770
  default: ve(() => [
1742
- (Y(!0), q(Re, null, Oe(G(ne), (j, ae) => (Y(), q("div", fe({
1771
+ (_(!0), U(Ce, null, Oe(q(ne), (j, le) => (_(), U("div", fe({
1743
1772
  key: `${j.page}-${j.id}`,
1744
1773
  class: "absolute masonry-item",
1745
1774
  ref_for: !0
1746
- }, G(ea)(j, ae)), [
1747
- J(u.$slots, "default", {
1775
+ }, q(ea)(j, le)), [
1776
+ J(c.$slots, "default", {
1748
1777
  item: j,
1749
- remove: G(ue),
1778
+ remove: q(ue),
1750
1779
  index: j.originalIndex ?? h.value.indexOf(j)
1751
1780
  }, () => [
1752
- Se(xe, {
1781
+ Le(xe, {
1753
1782
  item: j,
1754
- remove: G(ue),
1783
+ remove: q(ue),
1755
1784
  "header-height": d.value.header,
1756
1785
  "footer-height": d.value.footer,
1757
1786
  "in-swipe-mode": !1,
1758
1787
  "is-active": !1,
1759
- "onPreload:success": B[4] || (B[4] = (O) => p("item:preload:success", O)),
1760
- "onPreload:error": B[5] || (B[5] = (O) => p("item:preload:error", O)),
1761
- onMouseEnter: B[6] || (B[6] = (O) => p("item:mouse-enter", O)),
1762
- onMouseLeave: B[7] || (B[7] = (O) => p("item:mouse-leave", O))
1788
+ "onPreload:success": D[4] || (D[4] = (A) => y("item:preload:success", A)),
1789
+ "onPreload:error": D[5] || (D[5] = (A) => y("item:preload:error", A)),
1790
+ onMouseEnter: D[6] || (D[6] = (A) => y("item:mouse-enter", A)),
1791
+ onMouseLeave: D[7] || (D[7] = (A) => y("item:mouse-leave", A))
1763
1792
  }, {
1764
- header: ve((O) => [
1765
- J(u.$slots, "item-header", fe({ ref_for: !0 }, O), void 0, !0)
1793
+ header: ve((A) => [
1794
+ J(c.$slots, "item-header", fe({ ref_for: !0 }, A), void 0, !0)
1766
1795
  ]),
1767
- footer: ve((O) => [
1768
- J(u.$slots, "item-footer", fe({ ref_for: !0 }, O), void 0, !0)
1796
+ footer: ve((A) => [
1797
+ J(c.$slots, "item-footer", fe({ ref_for: !0 }, A), void 0, !0)
1769
1798
  ]),
1770
1799
  _: 2
1771
1800
  }, 1032, ["item", "remove", "header-height", "footer-height"])
@@ -1775,35 +1804,35 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1775
1804
  _: 3
1776
1805
  }, 8, ["onEnter", "onBeforeEnter", "onLeave", "onBeforeLeave"])
1777
1806
  ], 4),
1778
- k.value && h.value.length > 0 ? (Y(), q("div", Ia, [
1779
- J(u.$slots, "end-message", {}, () => [
1780
- B[10] || (B[10] = U("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1807
+ k.value && h.value.length > 0 ? (_(), U("div", Pa, [
1808
+ J(c.$slots, "end-message", {}, () => [
1809
+ D[10] || (D[10] = G("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1781
1810
  ], !0)
1782
- ])) : te("", !0),
1783
- N.value && h.value.length > 0 ? (Y(), q("div", La, [
1784
- J(u.$slots, "error-message", { error: N.value }, () => [
1785
- U("p", Sa, "Failed to load content: " + Pe(N.value.message), 1)
1811
+ ])) : ae("", !0),
1812
+ B.value && h.value.length > 0 ? (_(), U("div", Ia, [
1813
+ J(c.$slots, "error-message", { error: B.value }, () => [
1814
+ G("p", La, "Failed to load content: " + Ee(B.value.message), 1)
1786
1815
  ], !0)
1787
- ])) : te("", !0)
1788
- ], 2)) : (Y(), q("div", ya, [
1789
- J(u.$slots, "loading-message", {}, () => [
1790
- B[8] || (B[8] = U("p", { class: "text-gray-500 dark:text-gray-400" }, "Waiting for content to load...", -1))
1816
+ ])) : ae("", !0)
1817
+ ], 2)) : (_(), U("div", ya, [
1818
+ J(c.$slots, "loading-message", {}, () => [
1819
+ D[8] || (D[8] = G("p", { class: "text-gray-500 dark:text-gray-400" }, "Waiting for content to load...", -1))
1791
1820
  ], !0)
1792
1821
  ]))
1793
1822
  ], 512));
1794
1823
  }
1795
- }), Ea = (e, n) => {
1824
+ }), Sa = (e, l) => {
1796
1825
  const i = e.__vccOpts || e;
1797
- for (const [a, m] of n)
1798
- i[a] = m;
1826
+ for (const [a, g] of l)
1827
+ i[a] = g;
1799
1828
  return i;
1800
- }, Ue = /* @__PURE__ */ Ea(ka, [["__scopeId", "data-v-ce75570c"]]), Ha = {
1829
+ }, _e = /* @__PURE__ */ Sa(ka, [["__scopeId", "data-v-a7ad9844"]]), Ha = {
1801
1830
  install(e) {
1802
- e.component("WyxosMasonry", Ue), e.component("WMasonry", Ue), e.component("WyxosMasonryItem", xe), e.component("WMasonryItem", xe);
1831
+ e.component("WyxosMasonry", _e), e.component("WMasonry", _e), e.component("WyxosMasonryItem", xe), e.component("WMasonryItem", xe);
1803
1832
  }
1804
1833
  };
1805
1834
  export {
1806
- Ue as Masonry,
1835
+ _e as Masonry,
1807
1836
  xe as MasonryItem,
1808
1837
  Ha as default
1809
1838
  };