@wyxos/vibe 1.6.27 → 1.6.29

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