@wyxos/vibe 2.1.17 → 2.2.1
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/components/Masonry.vue.d.ts +8 -0
- package/lib/components/MasonryLoader.vue.d.ts +0 -2
- package/lib/components/masonryItemRegistry.d.ts +0 -1
- package/lib/index.cjs +1 -1
- package/lib/index.js +846 -884
- package/lib/manifest.json +41 -41
- package/lib/masonry/backfill.d.ts +3 -1
- package/lib/masonry/types.d.ts +2 -2
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as xe, ref as v, computed as k, createElementBlock as T, openBlock as _, createElementVNode as C, normalizeStyle as U, watch as oe, onMounted as Qe, onUnmounted as zt, createCommentVNode as Z, createBlock as Ft, unref as le, toDisplayString as Ze, normalizeClass as _t, createVNode as Q, mergeDefaults as fn, useAttrs as dn, shallowRef as Tt, provide as vn, mergeProps as mn, renderSlot as hn, Fragment as Pt, renderList as Et, nextTick as Bt, inject as gn } from "vue";
|
|
2
|
+
const pn = {
|
|
3
3
|
mode: "default",
|
|
4
4
|
pageSize: 20,
|
|
5
5
|
backfillRequestDelayMs: 2e3,
|
|
@@ -12,7 +12,7 @@ const hn = {
|
|
|
12
12
|
headerHeight: 0,
|
|
13
13
|
footerHeight: 0,
|
|
14
14
|
overscanPx: 600
|
|
15
|
-
},
|
|
15
|
+
}, yn = ["aria-label", "aria-valuemax", "aria-valuenow"], Lt = /* @__PURE__ */ xe({
|
|
16
16
|
__name: "MasonryVideoControls",
|
|
17
17
|
props: {
|
|
18
18
|
currentTime: {},
|
|
@@ -22,154 +22,152 @@ const hn = {
|
|
|
22
22
|
keyboardStep: { default: 5 }
|
|
23
23
|
},
|
|
24
24
|
emits: ["seek"],
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
() => Number.isFinite(
|
|
28
|
-
),
|
|
29
|
-
() => Number.isFinite(
|
|
30
|
-
),
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
}),
|
|
34
|
-
() =>
|
|
25
|
+
setup(o, { expose: M, emit: i }) {
|
|
26
|
+
const a = o, f = i, y = v(null), w = v(null), g = v(null), d = v(!1), p = k(
|
|
27
|
+
() => Number.isFinite(a.step) ? Math.max(0, a.step) : 0
|
|
28
|
+
), b = k(
|
|
29
|
+
() => Number.isFinite(a.duration) ? Math.max(0, a.duration) : 0
|
|
30
|
+
), S = k(() => {
|
|
31
|
+
const u = Number.isFinite(a.currentTime) ? a.currentTime : 0;
|
|
32
|
+
return P(u, 0, b.value);
|
|
33
|
+
}), N = k(
|
|
34
|
+
() => b.value > 0 ? S.value / b.value : 0
|
|
35
35
|
);
|
|
36
|
-
function
|
|
37
|
-
return Math.min(
|
|
38
|
-
}
|
|
39
|
-
function F(
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
function
|
|
62
|
-
if (!
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
function
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
let
|
|
71
|
-
switch (
|
|
36
|
+
function P(u, I, B) {
|
|
37
|
+
return Math.min(B, Math.max(I, u));
|
|
38
|
+
}
|
|
39
|
+
function F(u) {
|
|
40
|
+
return p.value <= 0 ? u : Math.round(u / p.value) * p.value;
|
|
41
|
+
}
|
|
42
|
+
function L(u) {
|
|
43
|
+
const I = P(u, 0, b.value);
|
|
44
|
+
f("seek", F(I));
|
|
45
|
+
}
|
|
46
|
+
function R(u) {
|
|
47
|
+
const I = w.value;
|
|
48
|
+
if (!I) return;
|
|
49
|
+
const B = I.getBoundingClientRect();
|
|
50
|
+
if (!B.width) return;
|
|
51
|
+
const j = P((u - B.left) / B.width, 0, 1);
|
|
52
|
+
L(j * b.value);
|
|
53
|
+
}
|
|
54
|
+
function X(u) {
|
|
55
|
+
const I = w.value;
|
|
56
|
+
I && (d.value = !0, I.setPointerCapture && I.setPointerCapture(u.pointerId), R(u.clientX));
|
|
57
|
+
}
|
|
58
|
+
function $(u) {
|
|
59
|
+
d.value && R(u.clientX);
|
|
60
|
+
}
|
|
61
|
+
function H(u) {
|
|
62
|
+
if (!d.value) return;
|
|
63
|
+
d.value = !1;
|
|
64
|
+
const I = w.value;
|
|
65
|
+
I?.releasePointerCapture && I.releasePointerCapture(u.pointerId);
|
|
66
|
+
}
|
|
67
|
+
function q(u) {
|
|
68
|
+
if (b.value <= 0) return;
|
|
69
|
+
const I = Number.isFinite(a.keyboardStep) ? a.keyboardStep : 1;
|
|
70
|
+
let B = S.value;
|
|
71
|
+
switch (u.key) {
|
|
72
72
|
case "ArrowLeft":
|
|
73
73
|
case "ArrowDown":
|
|
74
|
-
|
|
74
|
+
B -= I;
|
|
75
75
|
break;
|
|
76
76
|
case "ArrowRight":
|
|
77
77
|
case "ArrowUp":
|
|
78
|
-
|
|
78
|
+
B += I;
|
|
79
79
|
break;
|
|
80
80
|
case "Home":
|
|
81
|
-
|
|
81
|
+
B = 0;
|
|
82
82
|
break;
|
|
83
83
|
case "End":
|
|
84
|
-
|
|
84
|
+
B = b.value;
|
|
85
85
|
break;
|
|
86
86
|
default:
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
u.preventDefault(), L(B);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
91
|
+
function ae() {
|
|
92
|
+
y.value?.focus();
|
|
93
93
|
}
|
|
94
94
|
return M({
|
|
95
|
-
focus:
|
|
96
|
-
seekTo:
|
|
97
|
-
percent:
|
|
98
|
-
currentValue:
|
|
99
|
-
maxValue:
|
|
100
|
-
isDragging:
|
|
101
|
-
rootEl:
|
|
102
|
-
trackEl:
|
|
103
|
-
thumbEl:
|
|
104
|
-
}), (
|
|
95
|
+
focus: ae,
|
|
96
|
+
seekTo: L,
|
|
97
|
+
percent: N,
|
|
98
|
+
currentValue: S,
|
|
99
|
+
maxValue: b,
|
|
100
|
+
isDragging: d,
|
|
101
|
+
rootEl: y,
|
|
102
|
+
trackEl: w,
|
|
103
|
+
thumbEl: g
|
|
104
|
+
}), (u, I) => (_(), T("div", {
|
|
105
105
|
ref_key: "rootEl",
|
|
106
|
-
ref:
|
|
106
|
+
ref: y,
|
|
107
107
|
class: "w-full select-none",
|
|
108
108
|
role: "slider",
|
|
109
109
|
tabindex: "0",
|
|
110
|
-
"aria-label":
|
|
110
|
+
"aria-label": a.ariaLabel,
|
|
111
111
|
"aria-valuemin": 0,
|
|
112
|
-
"aria-valuemax":
|
|
113
|
-
"aria-valuenow":
|
|
114
|
-
onKeydown:
|
|
112
|
+
"aria-valuemax": b.value,
|
|
113
|
+
"aria-valuenow": S.value,
|
|
114
|
+
onKeydown: q
|
|
115
115
|
}, [
|
|
116
|
-
|
|
116
|
+
C("div", {
|
|
117
117
|
ref_key: "trackEl",
|
|
118
|
-
ref:
|
|
118
|
+
ref: w,
|
|
119
119
|
class: "relative h-2 w-full cursor-pointer rounded-full bg-slate-200",
|
|
120
|
-
onPointerdown:
|
|
121
|
-
onPointermove:
|
|
122
|
-
onPointerup:
|
|
123
|
-
onPointercancel:
|
|
124
|
-
onPointerleave:
|
|
120
|
+
onPointerdown: X,
|
|
121
|
+
onPointermove: $,
|
|
122
|
+
onPointerup: H,
|
|
123
|
+
onPointercancel: H,
|
|
124
|
+
onPointerleave: H
|
|
125
125
|
}, [
|
|
126
|
-
|
|
126
|
+
C("div", {
|
|
127
127
|
class: "absolute inset-y-0 left-0 rounded-full bg-slate-500",
|
|
128
|
-
style: U({ width: `${
|
|
128
|
+
style: U({ width: `${N.value * 100}%` })
|
|
129
129
|
}, null, 4),
|
|
130
|
-
|
|
130
|
+
C("div", {
|
|
131
131
|
ref_key: "thumbEl",
|
|
132
|
-
ref:
|
|
132
|
+
ref: g,
|
|
133
133
|
class: "absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full bg-slate-700 shadow",
|
|
134
|
-
style: U({ left: `${
|
|
134
|
+
style: U({ left: `${N.value * 100}%` }),
|
|
135
135
|
"aria-hidden": "true"
|
|
136
136
|
}, null, 4)
|
|
137
137
|
], 544)
|
|
138
|
-
], 40,
|
|
138
|
+
], 40, yn));
|
|
139
139
|
}
|
|
140
|
-
}),
|
|
140
|
+
}), wn = {
|
|
141
141
|
key: 0,
|
|
142
142
|
"data-testid": "masonry-loader-spinner",
|
|
143
143
|
class: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-1"
|
|
144
|
-
},
|
|
144
|
+
}, bn = {
|
|
145
145
|
key: 1,
|
|
146
146
|
class: "h-5 w-5 animate-spin text-slate-500",
|
|
147
147
|
viewBox: "0 0 24 24",
|
|
148
148
|
"aria-hidden": "true"
|
|
149
|
-
},
|
|
150
|
-
key: 2,
|
|
151
|
-
"data-testid": "masonry-loader-retry-status",
|
|
152
|
-
class: "text-xs font-medium text-slate-600"
|
|
153
|
-
}, bn = {
|
|
149
|
+
}, xn = {
|
|
154
150
|
key: 1,
|
|
155
151
|
"data-testid": "masonry-loader-error",
|
|
156
152
|
class: "absolute inset-0 z-20 grid place-items-center p-3 pointer-events-none"
|
|
157
|
-
},
|
|
153
|
+
}, kn = { class: "pointer-events-auto flex flex-col items-center justify-center gap-2" }, Mn = {
|
|
154
|
+
key: 1,
|
|
155
|
+
class: "text-center text-xs font-medium text-red-700"
|
|
156
|
+
}, Sn = ["src", "width", "height", "alt"], In = ["poster"], Fn = ["src"], _n = {
|
|
158
157
|
key: 4,
|
|
159
158
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-20 px-2 pb-2 opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100"
|
|
160
|
-
},
|
|
159
|
+
}, Rt = /* @__PURE__ */ xe({
|
|
161
160
|
__name: "MasonryLoader",
|
|
162
161
|
props: {
|
|
163
162
|
item: {},
|
|
164
163
|
remove: {},
|
|
165
164
|
loaderSlotFn: {},
|
|
166
165
|
errorSlotFn: {},
|
|
167
|
-
timeoutSeconds: { default: 15 },
|
|
168
166
|
hovered: { type: Boolean, default: !1 }
|
|
169
167
|
},
|
|
170
168
|
emits: ["success", "error"],
|
|
171
|
-
setup(
|
|
172
|
-
const i =
|
|
169
|
+
setup(o, { emit: M }) {
|
|
170
|
+
const i = o, a = M, f = xe({
|
|
173
171
|
name: "SlotRenderer",
|
|
174
172
|
props: {
|
|
175
173
|
slotFn: {
|
|
@@ -181,177 +179,130 @@ const hn = {
|
|
|
181
179
|
required: !0
|
|
182
180
|
}
|
|
183
181
|
},
|
|
184
|
-
setup(
|
|
182
|
+
setup(s) {
|
|
185
183
|
return () => {
|
|
186
|
-
const
|
|
187
|
-
return
|
|
184
|
+
const x = s.slotFn;
|
|
185
|
+
return x ? x(s.slotProps) : null;
|
|
188
186
|
};
|
|
189
187
|
}
|
|
190
|
-
}),
|
|
191
|
-
if (!
|
|
192
|
-
const
|
|
193
|
-
if (!(typeof
|
|
194
|
-
return
|
|
195
|
-
}),
|
|
196
|
-
if (!
|
|
197
|
-
const
|
|
198
|
-
if (typeof
|
|
199
|
-
return
|
|
200
|
-
const
|
|
201
|
-
if (typeof
|
|
202
|
-
}),
|
|
203
|
-
|
|
204
|
-
return typeof a == "number" && Number.isFinite(a) ? a : typeof i.timeoutSeconds == "number" && Number.isFinite(i.timeoutSeconds) ? i.timeoutSeconds : 0;
|
|
205
|
-
});
|
|
206
|
-
function N() {
|
|
188
|
+
}), y = v(null), w = v(null), g = v(null), d = v(!1), p = v(!1), b = v(!1), S = v(null), N = k(() => i.item?.type === "video"), P = k(() => {
|
|
189
|
+
if (!N.value) return;
|
|
190
|
+
const s = i.item?.preview, x = i.item?.original;
|
|
191
|
+
if (!(typeof s != "string" || !s) && !(typeof x == "string" && s === x) && !/\.(mp4|webm)(\?|#|$)/i.test(s) && /\.(png|jpe?g|gif|webp)(\?|#|$)/i.test(s))
|
|
192
|
+
return s;
|
|
193
|
+
}), F = k(() => {
|
|
194
|
+
if (!N.value) return;
|
|
195
|
+
const s = i.item?.preview;
|
|
196
|
+
if (typeof s == "string" && s && !/\.(png|jpe?g|gif|webp)(\?|#|$)/i.test(s))
|
|
197
|
+
return s;
|
|
198
|
+
const x = i.item?.original;
|
|
199
|
+
if (typeof x == "string" && x) return x;
|
|
200
|
+
}), L = v(!1), R = k(() => !!i.hovered), X = v(0), $ = v(0);
|
|
201
|
+
function H() {
|
|
207
202
|
i.remove?.();
|
|
208
203
|
}
|
|
209
|
-
const
|
|
210
|
-
const
|
|
211
|
-
return { aspectRatio: `${
|
|
212
|
-
}),
|
|
213
|
-
let
|
|
214
|
-
function
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
function
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
function
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
224
|
-
const f = a * 1e3;
|
|
225
|
-
X = window.setTimeout(() => {
|
|
226
|
-
v.value && (p.value || k.value || (Re(), ke(new Error("timeout"))));
|
|
227
|
-
}, f);
|
|
228
|
-
}
|
|
229
|
-
function Re() {
|
|
230
|
-
const a = b.value;
|
|
231
|
-
a && (a.removeAttribute("src"), a.src = "");
|
|
232
|
-
const f = u.value;
|
|
233
|
-
if (!f) return;
|
|
234
|
-
f.pause();
|
|
235
|
-
const D = y.value;
|
|
236
|
-
D && D.removeAttribute("src"), f.removeAttribute("src"), f.load();
|
|
237
|
-
}
|
|
238
|
-
function Ne() {
|
|
239
|
-
if (!v.value) return;
|
|
240
|
-
if (F.value >= At) {
|
|
241
|
-
_.value = !1;
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
ce();
|
|
245
|
-
const a = F.value + 1;
|
|
246
|
-
F.value = a, _.value = !0;
|
|
247
|
-
const f = (a - 1) * 1e3;
|
|
248
|
-
O = window.setTimeout(() => {
|
|
249
|
-
O = null, v.value && Ae({ resetAutoRetry: !1 });
|
|
250
|
-
}, f);
|
|
251
|
-
}
|
|
252
|
-
function be() {
|
|
253
|
-
v.value || (v.value = !0, p.value = !1, k.value = !1, we());
|
|
254
|
-
}
|
|
255
|
-
function xe(a) {
|
|
256
|
-
ee.value = Number.isFinite(a.duration) ? a.duration : 0, h.value = Number.isFinite(a.currentTime) ? a.currentTime : 0;
|
|
257
|
-
}
|
|
258
|
-
async function Se() {
|
|
259
|
-
if (!A.value || !Z.value || !v.value || !p.value || !q.value) return;
|
|
260
|
-
const a = u.value;
|
|
261
|
-
if (a)
|
|
204
|
+
const q = k(() => {
|
|
205
|
+
const s = i.item?.width, x = i.item?.height;
|
|
206
|
+
return { aspectRatio: `${s} / ${x}` };
|
|
207
|
+
}), ae = k(() => i.item?.type === "image");
|
|
208
|
+
let u = null, I = null;
|
|
209
|
+
function B() {
|
|
210
|
+
d.value || (d.value = !0, p.value = !1, b.value = !1, S.value = null);
|
|
211
|
+
}
|
|
212
|
+
function j(s) {
|
|
213
|
+
X.value = Number.isFinite(s.duration) ? s.duration : 0, $.value = Number.isFinite(s.currentTime) ? s.currentTime : 0;
|
|
214
|
+
}
|
|
215
|
+
async function re() {
|
|
216
|
+
if (!N.value || !R.value || !d.value || !p.value || !L.value) return;
|
|
217
|
+
const s = g.value;
|
|
218
|
+
if (s)
|
|
262
219
|
try {
|
|
263
|
-
|
|
220
|
+
s.muted = !0, await s.play();
|
|
264
221
|
} catch {
|
|
265
222
|
}
|
|
266
223
|
}
|
|
267
|
-
function
|
|
268
|
-
const
|
|
269
|
-
|
|
224
|
+
function ee() {
|
|
225
|
+
const s = g.value;
|
|
226
|
+
s && (s.paused || s.pause());
|
|
270
227
|
}
|
|
271
|
-
function
|
|
272
|
-
const
|
|
273
|
-
|
|
228
|
+
function Pe() {
|
|
229
|
+
const s = g.value;
|
|
230
|
+
s && (s.paused || s.pause());
|
|
274
231
|
}
|
|
275
|
-
|
|
232
|
+
oe(
|
|
276
233
|
() => i.hovered,
|
|
277
|
-
(
|
|
278
|
-
if (
|
|
279
|
-
|
|
234
|
+
(s) => {
|
|
235
|
+
if (s) {
|
|
236
|
+
B(), re();
|
|
280
237
|
return;
|
|
281
238
|
}
|
|
282
|
-
|
|
239
|
+
ee();
|
|
283
240
|
}
|
|
284
241
|
);
|
|
285
|
-
function
|
|
286
|
-
const
|
|
287
|
-
|
|
242
|
+
function Ee(s) {
|
|
243
|
+
const x = g.value;
|
|
244
|
+
x && Number.isFinite(s) && (x.currentTime = Math.max(0, Math.min(s, Number.isFinite(x.duration) ? x.duration : s)), j(x));
|
|
288
245
|
}
|
|
289
|
-
|
|
246
|
+
Qe(() => {
|
|
290
247
|
if (typeof IntersectionObserver > "u") {
|
|
291
|
-
|
|
248
|
+
B();
|
|
292
249
|
return;
|
|
293
250
|
}
|
|
294
|
-
if (
|
|
295
|
-
(
|
|
296
|
-
for (const
|
|
297
|
-
if (
|
|
298
|
-
|
|
251
|
+
if (u = new IntersectionObserver(
|
|
252
|
+
(s) => {
|
|
253
|
+
for (const x of s)
|
|
254
|
+
if (x.isIntersecting && !((x.intersectionRatio ?? 0) < 0.5)) {
|
|
255
|
+
B(), u?.disconnect(), u = null;
|
|
299
256
|
return;
|
|
300
257
|
}
|
|
301
258
|
},
|
|
302
259
|
{ threshold: [0, 0.5, 1] }
|
|
303
|
-
),
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
(
|
|
307
|
-
for (const
|
|
308
|
-
const
|
|
309
|
-
|
|
260
|
+
), y.value && u.observe(y.value), N.value && y.value) {
|
|
261
|
+
const s = y.value.closest('[data-testid="items-scroll-container"]');
|
|
262
|
+
I = new IntersectionObserver(
|
|
263
|
+
(x) => {
|
|
264
|
+
for (const J of x) {
|
|
265
|
+
const Be = J.intersectionRatio ?? 0, Me = !!J.isIntersecting && Be >= 0.5;
|
|
266
|
+
L.value = Me, Me ? R.value && re() : Pe();
|
|
310
267
|
}
|
|
311
268
|
},
|
|
312
269
|
{
|
|
313
|
-
root:
|
|
270
|
+
root: s ?? void 0,
|
|
314
271
|
threshold: [0, 0.25, 0.5, 0.75, 1]
|
|
315
272
|
}
|
|
316
|
-
),
|
|
273
|
+
), I.observe(y.value);
|
|
317
274
|
}
|
|
318
|
-
}),
|
|
319
|
-
|
|
275
|
+
}), zt(() => {
|
|
276
|
+
u?.disconnect(), u = null, I?.disconnect(), I = null;
|
|
320
277
|
});
|
|
321
|
-
function
|
|
322
|
-
p.value || (p.value = !0,
|
|
323
|
-
}
|
|
324
|
-
function ke(a) {
|
|
325
|
-
k.value || (p.value = !1, k.value = !0, H.value = a, ne(), s("error", { item: i.item, error: a }), Ne());
|
|
326
|
-
}
|
|
327
|
-
function Ae({ resetAutoRetry: a }) {
|
|
328
|
-
v.value && (p.value = !1, k.value = !1, H.value = null, C.value += 1, a && (ce(), _.value = !1, F.value = 0), we());
|
|
278
|
+
function G() {
|
|
279
|
+
p.value || (p.value = !0, b.value = !1, S.value = null, a("success", i.item));
|
|
329
280
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
281
|
+
function K(s) {
|
|
282
|
+
b.value || (p.value = !1, b.value = !0, S.value = s, a("error", { item: i.item, error: s }));
|
|
332
283
|
}
|
|
333
|
-
function
|
|
334
|
-
|
|
335
|
-
const
|
|
336
|
-
|
|
284
|
+
function ke() {
|
|
285
|
+
G();
|
|
286
|
+
const s = g.value;
|
|
287
|
+
s && j(s), re();
|
|
337
288
|
}
|
|
338
|
-
function
|
|
339
|
-
const
|
|
340
|
-
|
|
289
|
+
function ge() {
|
|
290
|
+
const s = g.value;
|
|
291
|
+
s && j(s);
|
|
341
292
|
}
|
|
342
|
-
return (
|
|
293
|
+
return (s, x) => (_(), T("div", {
|
|
343
294
|
ref_key: "rootEl",
|
|
344
|
-
ref:
|
|
295
|
+
ref: y,
|
|
345
296
|
class: "relative bg-slate-100",
|
|
346
|
-
style: U(
|
|
297
|
+
style: U(q.value)
|
|
347
298
|
}, [
|
|
348
|
-
|
|
349
|
-
i.loaderSlotFn ? (
|
|
299
|
+
d.value && !p.value && !b.value ? (_(), T("div", wn, [
|
|
300
|
+
i.loaderSlotFn ? (_(), Ft(le(f), {
|
|
350
301
|
key: 0,
|
|
351
302
|
"slot-fn": i.loaderSlotFn,
|
|
352
|
-
"slot-props": { item: i.item, remove:
|
|
353
|
-
}, null, 8, ["slot-fn", "slot-props"])) : (
|
|
354
|
-
|
|
303
|
+
"slot-props": { item: i.item, remove: H }
|
|
304
|
+
}, null, 8, ["slot-fn", "slot-props"])) : (_(), T("svg", bn, x[2] || (x[2] = [
|
|
305
|
+
C("circle", {
|
|
355
306
|
class: "opacity-25",
|
|
356
307
|
cx: "12",
|
|
357
308
|
cy: "12",
|
|
@@ -360,35 +311,26 @@ const hn = {
|
|
|
360
311
|
stroke: "currentColor",
|
|
361
312
|
"stroke-width": "4"
|
|
362
313
|
}, null, -1),
|
|
363
|
-
|
|
314
|
+
C("path", {
|
|
364
315
|
class: "opacity-75",
|
|
365
316
|
fill: "currentColor",
|
|
366
317
|
d: "M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4z"
|
|
367
318
|
}, null, -1)
|
|
368
|
-
])))
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
i.errorSlotFn ? (I(), _t(se(d), {
|
|
319
|
+
])))
|
|
320
|
+
])) : d.value && b.value ? (_(), T("div", xn, [
|
|
321
|
+
C("div", kn, [
|
|
322
|
+
i.errorSlotFn ? (_(), Ft(le(f), {
|
|
373
323
|
key: 0,
|
|
374
324
|
"slot-fn": i.errorSlotFn,
|
|
375
|
-
"slot-props": { item: i.item, remove:
|
|
376
|
-
}, null, 8, ["slot-fn", "slot-props"])) : (
|
|
377
|
-
R("p", Sn, "Error " + je(H.value), 1),
|
|
378
|
-
R("button", {
|
|
379
|
-
type: "button",
|
|
380
|
-
"data-testid": "masonry-loader-retry",
|
|
381
|
-
class: "inline-flex items-center rounded-md border border-slate-200 bg-white px-2 py-1 text-xs font-medium text-slate-700",
|
|
382
|
-
onClick: de
|
|
383
|
-
}, " Retry ")
|
|
384
|
-
], 64))
|
|
325
|
+
"slot-props": { item: i.item, remove: H, error: S.value }
|
|
326
|
+
}, null, 8, ["slot-fn", "slot-props"])) : (_(), T("p", Mn, "Error " + Ze(S.value), 1))
|
|
385
327
|
])
|
|
386
|
-
])) :
|
|
387
|
-
|
|
388
|
-
key: i.item.id + ":img
|
|
328
|
+
])) : Z("", !0),
|
|
329
|
+
d.value && ae.value && !b.value ? (_(), T("img", {
|
|
330
|
+
key: i.item.id + ":img",
|
|
389
331
|
ref_key: "imgEl",
|
|
390
|
-
ref:
|
|
391
|
-
class:
|
|
332
|
+
ref: w,
|
|
333
|
+
class: _t([
|
|
392
334
|
"h-full w-full object-cover transition-opacity duration-300",
|
|
393
335
|
p.value ? "opacity-100" : "opacity-0"
|
|
394
336
|
]),
|
|
@@ -397,231 +339,243 @@ const hn = {
|
|
|
397
339
|
height: i.item.height,
|
|
398
340
|
loading: "lazy",
|
|
399
341
|
alt: i.item.id,
|
|
400
|
-
onLoad:
|
|
401
|
-
onError:
|
|
402
|
-
}, null, 42,
|
|
403
|
-
key: i.item.id + ":vid
|
|
404
|
-
class:
|
|
342
|
+
onLoad: G,
|
|
343
|
+
onError: x[0] || (x[0] = (J) => K(J))
|
|
344
|
+
}, null, 42, Sn)) : d.value && !b.value ? (_(), T("video", {
|
|
345
|
+
key: i.item.id + ":vid",
|
|
346
|
+
class: _t([
|
|
405
347
|
"h-full w-full object-cover transition-opacity duration-300",
|
|
406
348
|
p.value ? "opacity-100" : "opacity-0"
|
|
407
349
|
]),
|
|
408
|
-
poster:
|
|
350
|
+
poster: P.value,
|
|
409
351
|
ref_key: "videoEl",
|
|
410
|
-
ref:
|
|
352
|
+
ref: g,
|
|
411
353
|
playsinline: "",
|
|
412
354
|
loop: "",
|
|
413
355
|
preload: "metadata",
|
|
414
|
-
onLoadedmetadata:
|
|
415
|
-
onTimeupdate:
|
|
416
|
-
onDurationchange:
|
|
417
|
-
onLoadeddata:
|
|
418
|
-
onError:
|
|
356
|
+
onLoadedmetadata: ke,
|
|
357
|
+
onTimeupdate: ge,
|
|
358
|
+
onDurationchange: ge,
|
|
359
|
+
onLoadeddata: ge,
|
|
360
|
+
onError: x[1] || (x[1] = (J) => K(J))
|
|
419
361
|
}, [
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
ref: y,
|
|
423
|
-
src: Y.value,
|
|
362
|
+
C("source", {
|
|
363
|
+
src: F.value,
|
|
424
364
|
type: "video/mp4"
|
|
425
|
-
}, null, 8,
|
|
426
|
-
], 42,
|
|
427
|
-
|
|
428
|
-
Q(
|
|
429
|
-
duration:
|
|
430
|
-
"current-time":
|
|
431
|
-
onSeek:
|
|
365
|
+
}, null, 8, Fn)
|
|
366
|
+
], 42, In)) : Z("", !0),
|
|
367
|
+
d.value && N.value && !b.value ? (_(), T("div", _n, [
|
|
368
|
+
Q(Lt, {
|
|
369
|
+
duration: X.value,
|
|
370
|
+
"current-time": $.value,
|
|
371
|
+
onSeek: Ee
|
|
432
372
|
}, null, 8, ["duration", "current-time"])
|
|
433
|
-
])) :
|
|
373
|
+
])) : Z("", !0)
|
|
434
374
|
], 4));
|
|
435
375
|
}
|
|
436
|
-
}),
|
|
437
|
-
function
|
|
438
|
-
return !
|
|
376
|
+
}), $t = Symbol("masonryItemRegistry");
|
|
377
|
+
function Tn(o, M) {
|
|
378
|
+
return !o || o <= 0 || !M || M <= 0 ? 1 : Math.max(1, Math.floor(o / M));
|
|
379
|
+
}
|
|
380
|
+
function Pn(o, M, i, a = 0) {
|
|
381
|
+
if (!o || o <= 0 || !M || M <= 0) return i;
|
|
382
|
+
const f = typeof a == "number" && a > 0 ? a : 0, y = Math.max(0, M - 1) * f, w = o - y;
|
|
383
|
+
return !w || w <= 0 ? i : w / M;
|
|
439
384
|
}
|
|
440
|
-
function
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
return !b || b <= 0 ? i : b / M;
|
|
385
|
+
function En(o, M) {
|
|
386
|
+
const i = o?.width, a = o?.height;
|
|
387
|
+
return typeof i == "number" && typeof a == "number" && i > 0 && a > 0 ? a / i * M : M;
|
|
444
388
|
}
|
|
445
|
-
function
|
|
446
|
-
|
|
447
|
-
return typeof i == "number" && typeof s == "number" && i > 0 && s > 0 ? s / i * M : M;
|
|
389
|
+
function Dt(o) {
|
|
390
|
+
return Number.isFinite(o) && o > 0 ? Math.floor(o) : 1;
|
|
448
391
|
}
|
|
449
|
-
function
|
|
450
|
-
return Number.isFinite(
|
|
392
|
+
function et(o) {
|
|
393
|
+
return Number.isFinite(o) && o > 0 ? Math.floor(o) : 0;
|
|
451
394
|
}
|
|
452
|
-
function
|
|
453
|
-
|
|
395
|
+
function Bn() {
|
|
396
|
+
const o = new Error("aborted");
|
|
397
|
+
return o.name = "AbortError", o;
|
|
454
398
|
}
|
|
455
|
-
function
|
|
456
|
-
async function M(
|
|
457
|
-
const
|
|
458
|
-
if (
|
|
459
|
-
|
|
460
|
-
...
|
|
461
|
-
cooldownMsTotal:
|
|
462
|
-
cooldownMsRemaining:
|
|
399
|
+
function Rn(o) {
|
|
400
|
+
async function M(a) {
|
|
401
|
+
const f = et(a);
|
|
402
|
+
if (f <= 0) return;
|
|
403
|
+
o.stats.value = {
|
|
404
|
+
...o.stats.value,
|
|
405
|
+
cooldownMsTotal: f,
|
|
406
|
+
cooldownMsRemaining: f
|
|
463
407
|
};
|
|
464
|
-
const
|
|
465
|
-
await new Promise((
|
|
466
|
-
const
|
|
467
|
-
const
|
|
468
|
-
|
|
469
|
-
...
|
|
470
|
-
cooldownMsTotal:
|
|
471
|
-
cooldownMsRemaining:
|
|
472
|
-
},
|
|
473
|
-
},
|
|
408
|
+
const y = Date.now(), w = 100;
|
|
409
|
+
await new Promise((g) => {
|
|
410
|
+
const d = setInterval(() => {
|
|
411
|
+
const p = Date.now() - y, b = Math.max(0, f - p);
|
|
412
|
+
o.stats.value = {
|
|
413
|
+
...o.stats.value,
|
|
414
|
+
cooldownMsTotal: f,
|
|
415
|
+
cooldownMsRemaining: b
|
|
416
|
+
}, b <= 0 && (clearInterval(d), g());
|
|
417
|
+
}, w);
|
|
474
418
|
});
|
|
475
419
|
}
|
|
476
|
-
async function i(
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
420
|
+
async function i(a) {
|
|
421
|
+
const f = Dt(o.getPageSize()), y = o.isEnabled(), w = et(o.getRequestDelayMs()), g = o.stats.value.page ?? null, d = o.getCancelToken?.() ?? null, p = () => d !== null && o.getCancelToken && o.getCancelToken() !== d, b = () => {
|
|
422
|
+
if (p()) throw Bn();
|
|
423
|
+
}, S = [];
|
|
424
|
+
let N = 0;
|
|
425
|
+
o.buffer.value.length && (N = o.buffer.value.length, S.push(...o.buffer.value), o.buffer.value = []), o.stats.value = {
|
|
426
|
+
...o.stats.value,
|
|
427
|
+
enabled: y,
|
|
482
428
|
isBackfillActive: !1,
|
|
483
429
|
isRequestInFlight: !1,
|
|
484
|
-
|
|
485
|
-
|
|
430
|
+
page: g ?? a,
|
|
431
|
+
next: a,
|
|
432
|
+
cooldownMsTotal: w,
|
|
486
433
|
cooldownMsRemaining: 0,
|
|
487
434
|
progress: {
|
|
488
435
|
collected: 0,
|
|
489
436
|
target: 0
|
|
490
437
|
},
|
|
491
|
-
pageSize:
|
|
438
|
+
pageSize: f,
|
|
492
439
|
bufferSize: 0
|
|
493
440
|
};
|
|
494
|
-
const
|
|
495
|
-
let
|
|
496
|
-
for (;
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
441
|
+
const P = [];
|
|
442
|
+
let F = a, L = 0, R = !1;
|
|
443
|
+
for (; S.length < f && F != null; ) {
|
|
444
|
+
b();
|
|
445
|
+
const H = F;
|
|
446
|
+
R && (o.stats.value = {
|
|
447
|
+
...o.stats.value,
|
|
448
|
+
enabled: y,
|
|
501
449
|
isBackfillActive: !0,
|
|
502
450
|
isRequestInFlight: !0,
|
|
503
|
-
|
|
451
|
+
page: H,
|
|
452
|
+
next: null,
|
|
504
453
|
progress: {
|
|
505
|
-
collected: Math.min(
|
|
506
|
-
target:
|
|
454
|
+
collected: Math.min(S.length, f),
|
|
455
|
+
target: f
|
|
507
456
|
},
|
|
508
|
-
cooldownMsTotal:
|
|
457
|
+
cooldownMsTotal: w,
|
|
509
458
|
cooldownMsRemaining: 0,
|
|
510
|
-
pageSize:
|
|
459
|
+
pageSize: f
|
|
511
460
|
});
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
...
|
|
515
|
-
enabled:
|
|
461
|
+
const q = await o.getContent(H);
|
|
462
|
+
b(), P.push(H), R && (o.stats.value = {
|
|
463
|
+
...o.stats.value,
|
|
464
|
+
enabled: y,
|
|
516
465
|
isBackfillActive: !0,
|
|
517
466
|
isRequestInFlight: !1,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
467
|
+
page: H,
|
|
468
|
+
next: q.nextPage
|
|
469
|
+
}), L += q.items.length, o.markEnterFromLeft(q.items), S.push(...q.items), F = q.nextPage, !R && S.length < f && F != null ? (R = !0, o.stats.value = {
|
|
470
|
+
...o.stats.value,
|
|
471
|
+
enabled: y,
|
|
522
472
|
isBackfillActive: !0,
|
|
523
473
|
isRequestInFlight: !1,
|
|
524
|
-
|
|
474
|
+
page: H,
|
|
475
|
+
next: F,
|
|
525
476
|
progress: {
|
|
526
|
-
collected: Math.min(
|
|
527
|
-
target:
|
|
477
|
+
collected: Math.min(S.length, f),
|
|
478
|
+
target: f
|
|
528
479
|
},
|
|
529
|
-
cooldownMsTotal:
|
|
480
|
+
cooldownMsTotal: w,
|
|
530
481
|
cooldownMsRemaining: 0,
|
|
531
|
-
pageSize:
|
|
532
|
-
}) :
|
|
533
|
-
...
|
|
534
|
-
enabled:
|
|
482
|
+
pageSize: f
|
|
483
|
+
}) : R && (o.stats.value = {
|
|
484
|
+
...o.stats.value,
|
|
485
|
+
enabled: y,
|
|
535
486
|
isBackfillActive: !0,
|
|
487
|
+
page: H,
|
|
488
|
+
next: F,
|
|
536
489
|
progress: {
|
|
537
|
-
collected: Math.min(
|
|
538
|
-
target:
|
|
490
|
+
collected: Math.min(S.length, f),
|
|
491
|
+
target: f
|
|
539
492
|
}
|
|
540
|
-
}),
|
|
493
|
+
}), R && S.length < f && F != null && (await M(w), b());
|
|
541
494
|
}
|
|
542
|
-
const
|
|
543
|
-
return
|
|
544
|
-
...
|
|
545
|
-
enabled:
|
|
495
|
+
const X = S.slice(0, f), $ = S.slice(f);
|
|
496
|
+
return o.buffer.value = $, o.stats.value = {
|
|
497
|
+
...o.stats.value,
|
|
498
|
+
enabled: y,
|
|
546
499
|
isBackfillActive: !1,
|
|
547
500
|
isRequestInFlight: !1,
|
|
548
|
-
|
|
501
|
+
page: P.length ? P[P.length - 1] : g ?? a,
|
|
502
|
+
next: F,
|
|
549
503
|
progress: {
|
|
550
504
|
collected: 0,
|
|
551
505
|
target: 0
|
|
552
506
|
},
|
|
553
|
-
cooldownMsTotal:
|
|
507
|
+
cooldownMsTotal: w,
|
|
554
508
|
cooldownMsRemaining: 0,
|
|
555
|
-
pageSize:
|
|
556
|
-
bufferSize:
|
|
509
|
+
pageSize: f,
|
|
510
|
+
bufferSize: $.length,
|
|
557
511
|
lastBatch: {
|
|
558
|
-
startPage:
|
|
559
|
-
pages:
|
|
560
|
-
usedFromBuffer:
|
|
561
|
-
fetchedFromNetwork:
|
|
562
|
-
collectedTotal:
|
|
563
|
-
emitted:
|
|
564
|
-
carried:
|
|
512
|
+
startPage: a,
|
|
513
|
+
pages: P,
|
|
514
|
+
usedFromBuffer: N,
|
|
515
|
+
fetchedFromNetwork: L,
|
|
516
|
+
collectedTotal: S.length,
|
|
517
|
+
emitted: X.length,
|
|
518
|
+
carried: $.length
|
|
565
519
|
},
|
|
566
520
|
totals: {
|
|
567
|
-
pagesFetched:
|
|
568
|
-
itemsFetchedFromNetwork:
|
|
521
|
+
pagesFetched: o.stats.value.totals.pagesFetched + P.length,
|
|
522
|
+
itemsFetchedFromNetwork: o.stats.value.totals.itemsFetchedFromNetwork + L
|
|
569
523
|
}
|
|
570
|
-
}, { batchItems:
|
|
524
|
+
}, { batchItems: X, pages: P, nextPage: F };
|
|
571
525
|
}
|
|
572
526
|
return { loadBackfillBatch: i };
|
|
573
527
|
}
|
|
574
|
-
function
|
|
575
|
-
const M =
|
|
576
|
-
let
|
|
577
|
-
for (let F = 0; F <
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
let
|
|
581
|
-
for (let
|
|
582
|
-
|
|
583
|
-
const
|
|
584
|
-
|
|
585
|
-
const
|
|
586
|
-
for (let
|
|
587
|
-
const
|
|
588
|
-
|
|
528
|
+
function An(o) {
|
|
529
|
+
const M = o.columnCount, i = o.columnWidth, a = o.gapX, f = o.gapY, y = o.headerHeight, w = o.footerHeight, g = o.bucketPx, d = Array.from({ length: M }, () => 0), p = new Array(o.items.length), b = new Array(o.items.length), S = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
|
|
530
|
+
let P = 0;
|
|
531
|
+
for (let F = 0; F < o.items.length; F += 1) {
|
|
532
|
+
const L = o.items[F];
|
|
533
|
+
L?.id && N.set(L.id, F);
|
|
534
|
+
let R = 0;
|
|
535
|
+
for (let u = 1; u < d.length; u += 1)
|
|
536
|
+
d[u] < d[R] && (R = u);
|
|
537
|
+
const X = R * (i + a), $ = d[R], H = En(L, i) + y + w;
|
|
538
|
+
p[F] = { x: X, y: $ }, b[F] = H, d[R] = $ + H + f, P = Math.max(P, $ + H);
|
|
539
|
+
const q = Math.floor($ / g), ae = Math.floor(($ + H) / g);
|
|
540
|
+
for (let u = q; u <= ae; u += 1) {
|
|
541
|
+
const I = S.get(u);
|
|
542
|
+
I ? I.push(F) : S.set(u, [F]);
|
|
589
543
|
}
|
|
590
544
|
}
|
|
591
|
-
return { positions:
|
|
545
|
+
return { positions: p, heights: b, buckets: S, contentHeight: P, indexById: N };
|
|
592
546
|
}
|
|
593
|
-
function
|
|
594
|
-
const M =
|
|
547
|
+
function Cn(o) {
|
|
548
|
+
const M = o.itemCount;
|
|
595
549
|
if (!M) return [];
|
|
596
|
-
if (
|
|
597
|
-
const i = Math.max(0,
|
|
598
|
-
for (let
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
601
|
-
for (const
|
|
550
|
+
if (o.viewportHeight <= 0) return Array.from({ length: M }, (d, p) => p);
|
|
551
|
+
const i = Math.max(0, o.scrollTop - o.overscanPx), a = o.scrollTop + o.viewportHeight + o.overscanPx, f = Math.floor(i / o.bucketPx), y = Math.floor(a / o.bucketPx), w = /* @__PURE__ */ new Set();
|
|
552
|
+
for (let d = f; d <= y; d += 1) {
|
|
553
|
+
const p = o.buckets.get(d);
|
|
554
|
+
if (p)
|
|
555
|
+
for (const b of p) w.add(b);
|
|
602
556
|
}
|
|
603
|
-
const
|
|
604
|
-
return
|
|
557
|
+
const g = Array.from(w);
|
|
558
|
+
return g.sort((d, p) => d - p), g;
|
|
605
559
|
}
|
|
606
|
-
const
|
|
560
|
+
const Nn = { class: "hidden" }, Hn = {
|
|
607
561
|
key: 0,
|
|
608
562
|
class: "flex h-full items-center justify-center"
|
|
609
|
-
},
|
|
563
|
+
}, Vn = {
|
|
610
564
|
key: 1,
|
|
611
565
|
class: "text-sm font-medium text-red-700"
|
|
612
|
-
},
|
|
566
|
+
}, zn = ["onMouseenter", "onMouseleave"], Ln = {
|
|
613
567
|
key: 0,
|
|
614
568
|
class: "pointer-events-auto absolute inset-0 z-10"
|
|
615
|
-
},
|
|
569
|
+
}, $n = { class: "relative" }, Dn = {
|
|
616
570
|
key: 0,
|
|
617
571
|
class: "pointer-events-auto absolute inset-0 z-10"
|
|
618
|
-
},
|
|
572
|
+
}, On = { class: "mt-4 pb-2 text-center text-xs text-slate-600" }, Yn = {
|
|
619
573
|
key: 0,
|
|
620
574
|
class: "inline-flex items-center justify-center gap-2"
|
|
621
|
-
}, qn = { key: 1 },
|
|
575
|
+
}, qn = { key: 1 }, Xn = { key: 2 }, At = 100, jn = 200, Ct = 600, Nt = 300, Ht = 600, Vt = 600, Un = 400, Wn = 5, Gn = 1e3, Kn = /* @__PURE__ */ xe({
|
|
622
576
|
inheritAttrs: !1,
|
|
623
577
|
__name: "Masonry",
|
|
624
|
-
props: /* @__PURE__ */
|
|
578
|
+
props: /* @__PURE__ */ fn({
|
|
625
579
|
getContent: {},
|
|
626
580
|
mode: {},
|
|
627
581
|
pageSize: {},
|
|
@@ -637,10 +591,10 @@ const Bn = { class: "hidden" }, Cn = {
|
|
|
637
591
|
headerHeight: {},
|
|
638
592
|
footerHeight: {},
|
|
639
593
|
overscanPx: {}
|
|
640
|
-
},
|
|
641
|
-
emits: ["update:items", "preloaded", "failures"],
|
|
642
|
-
setup(
|
|
643
|
-
const
|
|
594
|
+
}, pn),
|
|
595
|
+
emits: ["update:items", "preloaded", "failures", "removed"],
|
|
596
|
+
setup(o, { expose: M, emit: i }) {
|
|
597
|
+
const a = o, f = i, y = dn(), w = xe({
|
|
644
598
|
name: "SlotRenderer",
|
|
645
599
|
props: {
|
|
646
600
|
slotFn: {
|
|
@@ -658,281 +612,282 @@ const Bn = { class: "hidden" }, Cn = {
|
|
|
658
612
|
return n ? n(e.slotProps) : null;
|
|
659
613
|
};
|
|
660
614
|
}
|
|
661
|
-
}),
|
|
662
|
-
function v(e) {
|
|
663
|
-
y.value = e;
|
|
664
|
-
}
|
|
615
|
+
}), g = Tt(null), d = v(null);
|
|
665
616
|
function p(e) {
|
|
666
|
-
|
|
617
|
+
d.value = e;
|
|
667
618
|
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
});
|
|
671
|
-
const k = [], _ = [];
|
|
672
|
-
let C = null, F = null;
|
|
673
|
-
function H() {
|
|
674
|
-
if (!k.length) return;
|
|
675
|
-
const e = k.splice(0, k.length);
|
|
676
|
-
d("preloaded", e);
|
|
677
|
-
}
|
|
678
|
-
function A() {
|
|
679
|
-
if (!_.length) return;
|
|
680
|
-
const e = _.splice(0, _.length);
|
|
681
|
-
d("failures", e);
|
|
682
|
-
}
|
|
683
|
-
function ie() {
|
|
684
|
-
C || (C = setTimeout(() => {
|
|
685
|
-
C = null, H();
|
|
686
|
-
}, Ct));
|
|
619
|
+
function b(e) {
|
|
620
|
+
d.value === e && (d.value = null);
|
|
687
621
|
}
|
|
688
|
-
|
|
622
|
+
vn($t, (e) => {
|
|
623
|
+
g.value || (g.value = e);
|
|
624
|
+
});
|
|
625
|
+
const S = [], N = [];
|
|
626
|
+
let P = null, F = null;
|
|
627
|
+
function L() {
|
|
628
|
+
if (!S.length) return;
|
|
629
|
+
const e = S.splice(0, S.length);
|
|
630
|
+
f("preloaded", e);
|
|
631
|
+
}
|
|
632
|
+
function R() {
|
|
633
|
+
if (!N.length) return;
|
|
634
|
+
const e = N.splice(0, N.length);
|
|
635
|
+
f("failures", e);
|
|
636
|
+
}
|
|
637
|
+
function X() {
|
|
638
|
+
P || (P = setTimeout(() => {
|
|
639
|
+
P = null, L();
|
|
640
|
+
}, At));
|
|
641
|
+
}
|
|
642
|
+
function $() {
|
|
689
643
|
F || (F = setTimeout(() => {
|
|
690
|
-
F = null,
|
|
691
|
-
},
|
|
644
|
+
F = null, R();
|
|
645
|
+
}, At));
|
|
692
646
|
}
|
|
693
|
-
function
|
|
694
|
-
|
|
647
|
+
function H(e) {
|
|
648
|
+
g.value?.onPreloaded?.(e), S.push(e), X();
|
|
695
649
|
}
|
|
696
|
-
function
|
|
697
|
-
|
|
650
|
+
function q(e) {
|
|
651
|
+
g.value?.onFailed?.(e), N.push(e), $();
|
|
698
652
|
}
|
|
699
|
-
|
|
700
|
-
if (!
|
|
653
|
+
Qe(() => {
|
|
654
|
+
if (!g.value)
|
|
701
655
|
throw new Error("[Masonry] Missing <MasonryItem> definition. Add <MasonryItem> as a child of <Masonry>.");
|
|
702
656
|
});
|
|
703
|
-
const
|
|
704
|
-
const { class: e, ...n } =
|
|
657
|
+
const ae = k(() => {
|
|
658
|
+
const { class: e, ...n } = y;
|
|
705
659
|
return n;
|
|
706
|
-
}),
|
|
707
|
-
let
|
|
708
|
-
const
|
|
709
|
-
function
|
|
660
|
+
}), u = v(null), I = v(0), B = v(0), j = v(0);
|
|
661
|
+
let re;
|
|
662
|
+
const ee = k(() => a.gapX), Pe = k(() => a.gapY);
|
|
663
|
+
function Ee(e) {
|
|
710
664
|
if (!e) return 0;
|
|
711
|
-
const n = Math.max(0,
|
|
665
|
+
const n = Math.max(0, ee.value);
|
|
712
666
|
return Math.max(0, e.clientWidth - n);
|
|
713
667
|
}
|
|
714
|
-
const
|
|
715
|
-
if (
|
|
716
|
-
}),
|
|
717
|
-
if (
|
|
718
|
-
}),
|
|
719
|
-
function
|
|
668
|
+
const G = k(() => a.headerHeight), K = k(() => a.footerHeight), ke = k(() => g.value?.header), ge = k(() => g.value?.loader), s = k(() => g.value?.footer), x = k(() => g.value?.overlay), J = k(() => g.value?.error), Be = k(() => !!ke.value), Me = k(() => !!s.value), tt = k(() => !!x.value), nt = k(() => {
|
|
669
|
+
if (G.value > 0) return { height: `${G.value}px` };
|
|
670
|
+
}), ot = k(() => {
|
|
671
|
+
if (K.value > 0) return { height: `${K.value}px` };
|
|
672
|
+
}), Se = v([]), Oe = v([]), lt = v(/* @__PURE__ */ new Map()), at = v(0), Re = v(/* @__PURE__ */ new Map());
|
|
673
|
+
function Ot(e) {
|
|
720
674
|
const n = typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
721
|
-
return
|
|
675
|
+
return j.value + B.value + Math.max(0, n);
|
|
722
676
|
}
|
|
723
|
-
const
|
|
724
|
-
function
|
|
677
|
+
const se = v(/* @__PURE__ */ new Set()), ie = v(/* @__PURE__ */ new Set()), Ae = /* @__PURE__ */ new Set(), Ie = v(/* @__PURE__ */ new Map());
|
|
678
|
+
function Yt(e) {
|
|
725
679
|
return Number.isFinite(e) ? Math.max(0, Math.min(250, e)) : 0;
|
|
726
680
|
}
|
|
727
|
-
function
|
|
728
|
-
if (!
|
|
729
|
-
const n =
|
|
681
|
+
function qt(e) {
|
|
682
|
+
if (!ie.value.has(e)) return;
|
|
683
|
+
const n = Ie.value.get(e) ?? 0;
|
|
730
684
|
if (!(n <= 0))
|
|
731
685
|
return `${n}ms`;
|
|
732
686
|
}
|
|
733
|
-
const
|
|
734
|
-
function
|
|
735
|
-
const n =
|
|
687
|
+
const Ce = v(/* @__PURE__ */ new Map()), te = v(/* @__PURE__ */ new Set()), ne = v([]);
|
|
688
|
+
function Xt(e) {
|
|
689
|
+
const n = Ce.value.get(e);
|
|
736
690
|
return n || { dx: 0, dy: 0 };
|
|
737
691
|
}
|
|
738
|
-
function
|
|
739
|
-
if (
|
|
740
|
-
if (
|
|
692
|
+
function jt(e) {
|
|
693
|
+
if (ie.value.has(e)) return `transform ${Ht}ms ease-out`;
|
|
694
|
+
if (te.value.has(e)) return `transform ${Nt}ms ease-out`;
|
|
741
695
|
}
|
|
742
|
-
function
|
|
743
|
-
const t =
|
|
744
|
-
return `translate3d(${
|
|
696
|
+
function Ut(e) {
|
|
697
|
+
const t = m.value[e]?.id, l = Se.value[e] ?? { x: 0, y: 0 }, r = Oe.value[e] ?? 0, c = r > 0 ? r : Te.value, h = l.x, E = t && se.value.has(t) ? Ot(c) : l.y, O = t ? Xt(t) : { dx: 0, dy: 0 };
|
|
698
|
+
return `translate3d(${h + O.dx}px,${E + O.dy}px,0)`;
|
|
745
699
|
}
|
|
746
|
-
function
|
|
700
|
+
function pe(e) {
|
|
747
701
|
(typeof requestAnimationFrame == "function" ? requestAnimationFrame : (t) => setTimeout(() => t(0), 0))(() => e());
|
|
748
702
|
}
|
|
749
|
-
function
|
|
750
|
-
|
|
703
|
+
function Wt(e) {
|
|
704
|
+
pe(() => pe(e));
|
|
751
705
|
}
|
|
752
|
-
const
|
|
753
|
-
function
|
|
706
|
+
const rt = /* @__PURE__ */ new Set();
|
|
707
|
+
function st(e) {
|
|
754
708
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
755
709
|
}
|
|
756
|
-
function
|
|
710
|
+
function Ne(e) {
|
|
757
711
|
if (!Array.isArray(e) || e.length === 0) return;
|
|
758
|
-
const n = new Set(
|
|
712
|
+
const n = new Set(se.value);
|
|
759
713
|
let t = !1;
|
|
760
|
-
for (const
|
|
761
|
-
const r =
|
|
714
|
+
for (const l of e) {
|
|
715
|
+
const r = l?.id;
|
|
762
716
|
if (r) {
|
|
763
|
-
if (!
|
|
764
|
-
const
|
|
765
|
-
(!
|
|
766
|
-
`[Masonry] Item "${r}" has invalid dimensions (width=${String(
|
|
767
|
-
|
|
717
|
+
if (!rt.has(r)) {
|
|
718
|
+
const c = l?.width, h = l?.height;
|
|
719
|
+
(!st(c) || !st(h)) && (rt.add(r), console.warn(
|
|
720
|
+
`[Masonry] Item "${r}" has invalid dimensions (width=${String(c)}, height=${String(
|
|
721
|
+
h
|
|
768
722
|
)}); layout expects { id, width, height }.`
|
|
769
723
|
));
|
|
770
724
|
}
|
|
771
725
|
n.has(r) || (n.add(r), t = !0);
|
|
772
726
|
}
|
|
773
727
|
}
|
|
774
|
-
t && (
|
|
728
|
+
t && (se.value = n);
|
|
775
729
|
}
|
|
776
|
-
function
|
|
730
|
+
function it() {
|
|
777
731
|
const e = /* @__PURE__ */ new Map();
|
|
778
|
-
for (const n of
|
|
779
|
-
const
|
|
780
|
-
if (!
|
|
781
|
-
const r =
|
|
782
|
-
r && e.set(
|
|
732
|
+
for (const n of We.value) {
|
|
733
|
+
const l = m.value[n]?.id;
|
|
734
|
+
if (!l) continue;
|
|
735
|
+
const r = Se.value[n];
|
|
736
|
+
r && e.set(l, { x: r.x, y: r.y });
|
|
783
737
|
}
|
|
784
738
|
return e;
|
|
785
739
|
}
|
|
786
|
-
function
|
|
740
|
+
function ut(e, n) {
|
|
787
741
|
if (!e.size) return;
|
|
788
|
-
const t = /* @__PURE__ */ new Map(),
|
|
789
|
-
for (const [
|
|
790
|
-
if (n?.has(
|
|
791
|
-
const
|
|
792
|
-
if (
|
|
793
|
-
const
|
|
794
|
-
if (!
|
|
795
|
-
const
|
|
796
|
-
(
|
|
742
|
+
const t = /* @__PURE__ */ new Map(), l = [];
|
|
743
|
+
for (const [c, h] of e.entries()) {
|
|
744
|
+
if (n?.has(c)) continue;
|
|
745
|
+
const E = Re.value.get(c);
|
|
746
|
+
if (E == null) continue;
|
|
747
|
+
const O = Se.value[E];
|
|
748
|
+
if (!O) continue;
|
|
749
|
+
const Y = h.x - O.x, z = h.y - O.y;
|
|
750
|
+
(Y || z) && (t.set(c, { dx: Y, dy: z }), l.push(c));
|
|
797
751
|
}
|
|
798
752
|
if (!t.size) return;
|
|
799
|
-
|
|
800
|
-
const r = new Set(
|
|
801
|
-
for (const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
753
|
+
Ce.value = t;
|
|
754
|
+
const r = new Set(te.value);
|
|
755
|
+
for (const c of l) r.delete(c);
|
|
756
|
+
te.value = r, pe(() => {
|
|
757
|
+
te.value = /* @__PURE__ */ new Set([...te.value, ...l]), pe(() => {
|
|
758
|
+
Ce.value = /* @__PURE__ */ new Map();
|
|
805
759
|
});
|
|
806
760
|
}), setTimeout(() => {
|
|
807
|
-
const
|
|
808
|
-
for (const
|
|
809
|
-
|
|
810
|
-
},
|
|
811
|
-
}
|
|
812
|
-
const
|
|
813
|
-
let
|
|
814
|
-
function
|
|
761
|
+
const c = new Set(te.value);
|
|
762
|
+
for (const h of l) c.delete(h);
|
|
763
|
+
te.value = c;
|
|
764
|
+
}, Nt);
|
|
765
|
+
}
|
|
766
|
+
const ue = v(!0), ce = v(!1), ye = v("");
|
|
767
|
+
let D = 0, Ye = 0, He = 0, Ve = 0, Fe = !1;
|
|
768
|
+
function ct(e) {
|
|
815
769
|
return e instanceof Error && e.name === "AbortError";
|
|
816
770
|
}
|
|
817
|
-
function
|
|
771
|
+
function ft() {
|
|
818
772
|
const e = new Error("aborted");
|
|
819
773
|
return e.name = "AbortError", e;
|
|
820
774
|
}
|
|
821
|
-
function
|
|
775
|
+
function Gt(e) {
|
|
822
776
|
return new Promise((n) => setTimeout(n, e));
|
|
823
777
|
}
|
|
824
|
-
async function
|
|
778
|
+
async function dt(e, n) {
|
|
825
779
|
let t = 0;
|
|
826
780
|
for (; ; ) {
|
|
827
|
-
if (n !==
|
|
781
|
+
if (n !== D) throw ft();
|
|
828
782
|
try {
|
|
829
|
-
return await
|
|
830
|
-
} catch (
|
|
831
|
-
if (n !==
|
|
832
|
-
if (t >=
|
|
833
|
-
t += 1, await
|
|
783
|
+
return await a.getContent(e);
|
|
784
|
+
} catch (l) {
|
|
785
|
+
if (n !== D) throw ft();
|
|
786
|
+
if (t >= Wn) throw l;
|
|
787
|
+
t += 1, await Gt(t * Gn);
|
|
834
788
|
}
|
|
835
789
|
}
|
|
836
790
|
}
|
|
837
|
-
const W =
|
|
838
|
-
let
|
|
839
|
-
function
|
|
791
|
+
const W = v([]), vt = v([]), qe = v([]), V = v(a.page), ze = v([]);
|
|
792
|
+
let fe = null, de = null, Le = 0;
|
|
793
|
+
function Kt(e) {
|
|
840
794
|
let n = -1;
|
|
841
795
|
for (const t of e) {
|
|
842
|
-
const
|
|
843
|
-
|
|
796
|
+
const l = t?.originalIndex;
|
|
797
|
+
_e(l) && l > n && (n = l);
|
|
844
798
|
}
|
|
845
|
-
|
|
799
|
+
Le = n + 1;
|
|
846
800
|
}
|
|
847
|
-
function
|
|
801
|
+
function we(e) {
|
|
848
802
|
for (const n of e)
|
|
849
|
-
!n || typeof n != "object" || n.id && n.originalIndex == null && (n.originalIndex =
|
|
803
|
+
!n || typeof n != "object" || n.id && n.originalIndex == null && (n.originalIndex = Le, Le += 1);
|
|
850
804
|
}
|
|
851
|
-
const
|
|
852
|
-
function
|
|
805
|
+
const ve = /* @__PURE__ */ new Map(), me = [];
|
|
806
|
+
function _e(e) {
|
|
853
807
|
return typeof e == "number" && Number.isFinite(e);
|
|
854
808
|
}
|
|
855
|
-
function
|
|
809
|
+
function Jt(e, n) {
|
|
856
810
|
if (!n.length) return e;
|
|
857
811
|
const t = /* @__PURE__ */ new Set();
|
|
858
|
-
for (const
|
|
859
|
-
const
|
|
860
|
-
|
|
812
|
+
for (const h of e) {
|
|
813
|
+
const E = h?.id;
|
|
814
|
+
E && t.add(E);
|
|
861
815
|
}
|
|
862
|
-
const
|
|
863
|
-
for (const
|
|
864
|
-
const
|
|
865
|
-
|
|
816
|
+
const l = [];
|
|
817
|
+
for (const h of n) {
|
|
818
|
+
const E = h?.id;
|
|
819
|
+
E && (t.has(E) || (l.push(h), t.add(E)));
|
|
866
820
|
}
|
|
867
|
-
if (!
|
|
868
|
-
const r =
|
|
869
|
-
const
|
|
870
|
-
return
|
|
871
|
-
}),
|
|
872
|
-
for (const
|
|
873
|
-
const
|
|
874
|
-
if (!
|
|
875
|
-
|
|
821
|
+
if (!l.length) return e;
|
|
822
|
+
const r = l.slice().sort((h, E) => {
|
|
823
|
+
const O = _e(h.originalIndex) ? h.originalIndex : Number.POSITIVE_INFINITY, Y = _e(E.originalIndex) ? E.originalIndex : Number.POSITIVE_INFINITY;
|
|
824
|
+
return O - Y;
|
|
825
|
+
}), c = e.slice();
|
|
826
|
+
for (const h of r) {
|
|
827
|
+
const E = h.originalIndex;
|
|
828
|
+
if (!_e(E)) {
|
|
829
|
+
c.push(h);
|
|
876
830
|
continue;
|
|
877
831
|
}
|
|
878
|
-
let
|
|
879
|
-
for (;
|
|
880
|
-
const
|
|
881
|
-
(
|
|
832
|
+
let O = 0, Y = c.length;
|
|
833
|
+
for (; O < Y; ) {
|
|
834
|
+
const z = O + Y >> 1, A = c[z]?.originalIndex;
|
|
835
|
+
(_e(A) ? A : Number.POSITIVE_INFINITY) <= E ? O = z + 1 : Y = z;
|
|
882
836
|
}
|
|
883
|
-
|
|
837
|
+
c.splice(O, 0, h);
|
|
884
838
|
}
|
|
885
|
-
return
|
|
839
|
+
return c;
|
|
886
840
|
}
|
|
887
|
-
async function
|
|
841
|
+
async function mt(e) {
|
|
888
842
|
if (!e.length) return;
|
|
889
|
-
|
|
890
|
-
const n =
|
|
891
|
-
|
|
843
|
+
Fe = !0, Ne(e);
|
|
844
|
+
const n = it();
|
|
845
|
+
m.value = Jt(m.value, e), await Bt(), ut(n);
|
|
892
846
|
}
|
|
893
|
-
async function
|
|
894
|
-
const t = (Array.isArray(e) ? e : [e]).map(
|
|
847
|
+
async function Qt(e) {
|
|
848
|
+
const t = (Array.isArray(e) ? e : [e]).map(Ue).filter(Boolean);
|
|
895
849
|
if (!t.length) return;
|
|
896
|
-
const
|
|
850
|
+
const l = [];
|
|
897
851
|
for (const r of t) {
|
|
898
|
-
const
|
|
899
|
-
|
|
852
|
+
const c = ve.get(r);
|
|
853
|
+
c && l.push(c);
|
|
900
854
|
}
|
|
901
|
-
if (
|
|
902
|
-
await
|
|
903
|
-
for (const r of
|
|
904
|
-
r?.id &&
|
|
855
|
+
if (l.length) {
|
|
856
|
+
await mt(l);
|
|
857
|
+
for (const r of l)
|
|
858
|
+
r?.id && ve.delete(r.id);
|
|
905
859
|
}
|
|
906
860
|
}
|
|
907
|
-
async function
|
|
908
|
-
const e =
|
|
861
|
+
async function Zt() {
|
|
862
|
+
const e = me.pop();
|
|
909
863
|
if (!e?.length) return;
|
|
910
864
|
const n = [];
|
|
911
865
|
for (const t of e) {
|
|
912
|
-
const
|
|
913
|
-
|
|
866
|
+
const l = ve.get(t);
|
|
867
|
+
l && n.push(l);
|
|
914
868
|
}
|
|
915
869
|
if (n.length) {
|
|
916
|
-
await
|
|
870
|
+
await mt(n);
|
|
917
871
|
for (const t of n)
|
|
918
|
-
t?.id &&
|
|
872
|
+
t?.id && ve.delete(t.id);
|
|
919
873
|
}
|
|
920
874
|
}
|
|
921
|
-
function
|
|
922
|
-
const t = (Array.isArray(e) ? e : [e]).map(
|
|
875
|
+
function en(e) {
|
|
876
|
+
const t = (Array.isArray(e) ? e : [e]).map(Ue).filter(Boolean);
|
|
923
877
|
if (!t.length) return;
|
|
924
|
-
const
|
|
925
|
-
for (const r of
|
|
926
|
-
for (let r =
|
|
927
|
-
const
|
|
928
|
-
|
|
878
|
+
const l = new Set(t);
|
|
879
|
+
for (const r of l) ve.delete(r);
|
|
880
|
+
for (let r = me.length - 1; r >= 0; r -= 1) {
|
|
881
|
+
const h = me[r].filter((E) => !l.has(E));
|
|
882
|
+
h.length ? me[r] = h : me.splice(r, 1);
|
|
929
883
|
}
|
|
930
884
|
}
|
|
931
|
-
const
|
|
885
|
+
const Xe = Tt({
|
|
932
886
|
enabled: !1,
|
|
933
887
|
isBackfillActive: !1,
|
|
934
888
|
isRequestInFlight: !1,
|
|
935
|
-
|
|
889
|
+
page: a.page,
|
|
890
|
+
next: a.page,
|
|
936
891
|
progress: {
|
|
937
892
|
collected: 0,
|
|
938
893
|
target: 0
|
|
@@ -946,93 +901,95 @@ const Bn = { class: "hidden" }, Cn = {
|
|
|
946
901
|
pagesFetched: 0,
|
|
947
902
|
itemsFetchedFromNetwork: 0
|
|
948
903
|
}
|
|
949
|
-
}),
|
|
950
|
-
getContent: (e) =>
|
|
951
|
-
markEnterFromLeft:
|
|
952
|
-
buffer:
|
|
953
|
-
stats:
|
|
954
|
-
isEnabled: () =>
|
|
955
|
-
getPageSize: () =>
|
|
956
|
-
getRequestDelayMs: () =>
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
904
|
+
}), ht = Rn({
|
|
905
|
+
getContent: (e) => dt(e, D),
|
|
906
|
+
markEnterFromLeft: Ne,
|
|
907
|
+
buffer: ze,
|
|
908
|
+
stats: Xe,
|
|
909
|
+
isEnabled: () => a.mode === "backfill",
|
|
910
|
+
getPageSize: () => a.pageSize,
|
|
911
|
+
getRequestDelayMs: () => a.backfillRequestDelayMs,
|
|
912
|
+
getCancelToken: () => Ye
|
|
913
|
+
}), $e = k(() => a.items !== void 0);
|
|
914
|
+
oe(
|
|
915
|
+
() => a.items,
|
|
960
916
|
(e) => {
|
|
961
|
-
|
|
917
|
+
$e.value && (qe.value = Array.isArray(e) ? e : []);
|
|
962
918
|
},
|
|
963
919
|
{ immediate: !0 }
|
|
964
920
|
);
|
|
965
|
-
const
|
|
921
|
+
const m = k({
|
|
966
922
|
get() {
|
|
967
|
-
return
|
|
923
|
+
return $e.value ? qe.value : vt.value;
|
|
968
924
|
},
|
|
969
925
|
set(e) {
|
|
970
|
-
|
|
926
|
+
$e.value ? (qe.value = e, f("update:items", e)) : vt.value = e;
|
|
971
927
|
}
|
|
972
|
-
}),
|
|
973
|
-
async function
|
|
974
|
-
const n = await
|
|
975
|
-
return
|
|
928
|
+
}), be = v(!1), je = v(!1);
|
|
929
|
+
async function gt(e) {
|
|
930
|
+
const n = await dt(e, D);
|
|
931
|
+
return we(n.items), Ne(n.items), { items: n.items, nextPage: n.nextPage };
|
|
976
932
|
}
|
|
977
|
-
function
|
|
933
|
+
function Ue(e) {
|
|
978
934
|
return e ? typeof e == "string" ? e : e?.id : null;
|
|
979
935
|
}
|
|
980
|
-
async function
|
|
981
|
-
const t = (Array.isArray(e) ? e : [e]).map(
|
|
936
|
+
async function pt(e) {
|
|
937
|
+
const t = (Array.isArray(e) ? e : [e]).map(Ue).filter(Boolean);
|
|
982
938
|
if (!t.length) return;
|
|
983
|
-
const
|
|
984
|
-
for (const
|
|
985
|
-
const
|
|
986
|
-
if (
|
|
987
|
-
const
|
|
988
|
-
|
|
939
|
+
const l = new Set(t), r = [], c = [];
|
|
940
|
+
for (const z of l) {
|
|
941
|
+
const A = Re.value.get(z);
|
|
942
|
+
if (A == null) continue;
|
|
943
|
+
const he = m.value[A];
|
|
944
|
+
he && (ve.set(z, he), c.push(z), r.push(he));
|
|
989
945
|
}
|
|
990
|
-
|
|
991
|
-
const
|
|
992
|
-
for (const
|
|
993
|
-
const
|
|
994
|
-
if (
|
|
995
|
-
const
|
|
996
|
-
if (!
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
id:
|
|
1000
|
-
item:
|
|
1001
|
-
fromX:
|
|
1002
|
-
fromY:
|
|
1003
|
-
toY:
|
|
1004
|
-
width:
|
|
1005
|
-
height:
|
|
946
|
+
c.length && (me.push(c), Fe = !0);
|
|
947
|
+
const h = it(), E = Te.value, O = j.value + B.value, Y = [];
|
|
948
|
+
for (const z of l) {
|
|
949
|
+
const A = Re.value.get(z);
|
|
950
|
+
if (A == null) continue;
|
|
951
|
+
const he = m.value[A];
|
|
952
|
+
if (!he) continue;
|
|
953
|
+
const Je = Se.value[A] ?? { x: 0, y: 0 }, It = Oe.value[A] ?? E, cn = Math.max(Je.y, O);
|
|
954
|
+
Y.push({
|
|
955
|
+
id: z,
|
|
956
|
+
item: he,
|
|
957
|
+
fromX: Je.x,
|
|
958
|
+
fromY: Je.y,
|
|
959
|
+
toY: cn + Math.max(0, It),
|
|
960
|
+
width: E,
|
|
961
|
+
height: It,
|
|
1006
962
|
leaving: !0
|
|
1007
963
|
});
|
|
1008
964
|
}
|
|
1009
|
-
if (
|
|
1010
|
-
const
|
|
1011
|
-
return !
|
|
1012
|
-
}), await
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
(
|
|
965
|
+
if (Y.length && (ne.value = [...ne.value, ...Y]), m.value = m.value.filter((z) => {
|
|
966
|
+
const A = z?.id;
|
|
967
|
+
return !A || !l.has(A);
|
|
968
|
+
}), await Bt(), ut(h, l), Y.length) {
|
|
969
|
+
const z = new Set(Y.map((A) => A.id));
|
|
970
|
+
pe(() => {
|
|
971
|
+
ne.value = ne.value.map(
|
|
972
|
+
(A) => z.has(A.id) ? { ...A, leaving: !1 } : A
|
|
1017
973
|
), setTimeout(() => {
|
|
1018
|
-
|
|
974
|
+
ne.value = ne.value.filter((A) => !z.has(A.id));
|
|
1019
975
|
}, Vt);
|
|
1020
976
|
});
|
|
1021
977
|
}
|
|
978
|
+
r.length && f("removed", { items: r, ids: c });
|
|
1022
979
|
}
|
|
1023
|
-
async function
|
|
1024
|
-
return
|
|
980
|
+
async function De(e) {
|
|
981
|
+
return pt(e);
|
|
1025
982
|
}
|
|
1026
|
-
function
|
|
1027
|
-
|
|
983
|
+
function tn() {
|
|
984
|
+
D += 1, Ye += 1, fe = null, de = null, ue.value = !1, ce.value = !1;
|
|
1028
985
|
}
|
|
1029
986
|
M({
|
|
1030
|
-
remove:
|
|
1031
|
-
restore:
|
|
1032
|
-
undo:
|
|
1033
|
-
forget:
|
|
1034
|
-
loadNextPage:
|
|
1035
|
-
cancel:
|
|
987
|
+
remove: pt,
|
|
988
|
+
restore: Qt,
|
|
989
|
+
undo: Zt,
|
|
990
|
+
forget: en,
|
|
991
|
+
loadNextPage: wt,
|
|
992
|
+
cancel: tn,
|
|
1036
993
|
get pagesLoaded() {
|
|
1037
994
|
return W.value;
|
|
1038
995
|
},
|
|
@@ -1040,147 +997,152 @@ const Bn = { class: "hidden" }, Cn = {
|
|
|
1040
997
|
W.value = e;
|
|
1041
998
|
},
|
|
1042
999
|
get nextPage() {
|
|
1043
|
-
return
|
|
1000
|
+
return V.value;
|
|
1044
1001
|
},
|
|
1045
1002
|
set nextPage(e) {
|
|
1046
|
-
|
|
1003
|
+
V.value = e;
|
|
1047
1004
|
},
|
|
1048
1005
|
get isLoading() {
|
|
1049
|
-
return
|
|
1006
|
+
return ue.value || ce.value;
|
|
1050
1007
|
},
|
|
1051
1008
|
get hasReachedEnd() {
|
|
1052
|
-
return
|
|
1009
|
+
return a.mode !== "backfill" ? V.value == null : V.value == null && ze.value.length === 0;
|
|
1053
1010
|
},
|
|
1054
1011
|
get backfillStats() {
|
|
1055
|
-
return
|
|
1012
|
+
return Xe.value;
|
|
1056
1013
|
}
|
|
1057
1014
|
});
|
|
1058
|
-
function
|
|
1059
|
-
const e =
|
|
1060
|
-
items:
|
|
1061
|
-
columnCount:
|
|
1062
|
-
columnWidth:
|
|
1063
|
-
gapX:
|
|
1064
|
-
gapY:
|
|
1065
|
-
headerHeight:
|
|
1066
|
-
footerHeight:
|
|
1067
|
-
bucketPx:
|
|
1015
|
+
function yt() {
|
|
1016
|
+
const e = An({
|
|
1017
|
+
items: m.value,
|
|
1018
|
+
columnCount: Ke.value,
|
|
1019
|
+
columnWidth: Te.value,
|
|
1020
|
+
gapX: ee.value,
|
|
1021
|
+
gapY: Pe.value,
|
|
1022
|
+
headerHeight: G.value,
|
|
1023
|
+
footerHeight: K.value,
|
|
1024
|
+
bucketPx: Ct
|
|
1068
1025
|
});
|
|
1069
|
-
|
|
1070
|
-
}
|
|
1071
|
-
const
|
|
1072
|
-
itemCount:
|
|
1073
|
-
viewportHeight:
|
|
1074
|
-
scrollTop:
|
|
1075
|
-
overscanPx:
|
|
1076
|
-
bucketPx:
|
|
1077
|
-
buckets:
|
|
1026
|
+
Se.value = e.positions, Oe.value = e.heights, lt.value = e.buckets, at.value = e.contentHeight, Re.value = e.indexById;
|
|
1027
|
+
}
|
|
1028
|
+
const nn = k(() => Math.max(at.value, B.value) + jn), We = k(() => Cn({
|
|
1029
|
+
itemCount: m.value.length,
|
|
1030
|
+
viewportHeight: B.value,
|
|
1031
|
+
scrollTop: j.value,
|
|
1032
|
+
overscanPx: a.overscanPx,
|
|
1033
|
+
bucketPx: Ct,
|
|
1034
|
+
buckets: lt.value
|
|
1078
1035
|
}));
|
|
1079
|
-
|
|
1080
|
-
|
|
1036
|
+
oe(
|
|
1037
|
+
We,
|
|
1081
1038
|
(e) => {
|
|
1082
1039
|
if (!e?.length) return;
|
|
1083
|
-
if (
|
|
1084
|
-
const
|
|
1040
|
+
if (be.value && !je.value) {
|
|
1041
|
+
const l = [];
|
|
1085
1042
|
for (const r of e) {
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1043
|
+
const c = m.value[r];
|
|
1044
|
+
c && l.push(c);
|
|
1088
1045
|
}
|
|
1089
|
-
|
|
1046
|
+
l.length && Ne(l), je.value = !0;
|
|
1090
1047
|
}
|
|
1091
1048
|
const n = [];
|
|
1092
|
-
for (const
|
|
1093
|
-
const r =
|
|
1094
|
-
r &&
|
|
1049
|
+
for (const l of e) {
|
|
1050
|
+
const r = m.value[l]?.id;
|
|
1051
|
+
r && se.value.has(r) && (Ae.has(r) || (Ae.add(r), n.push(r)));
|
|
1095
1052
|
}
|
|
1096
1053
|
if (!n.length) return;
|
|
1097
|
-
const t = n.length > 1 ?
|
|
1054
|
+
const t = n.length > 1 ? Yt(a.enterStaggerMs) : 0;
|
|
1098
1055
|
if (t > 0) {
|
|
1099
|
-
const
|
|
1056
|
+
const l = new Map(Ie.value);
|
|
1100
1057
|
for (let r = 0; r < n.length; r += 1) {
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1058
|
+
const c = n[r], h = Math.min(r * t, Un);
|
|
1059
|
+
l.set(c, h);
|
|
1103
1060
|
}
|
|
1104
|
-
|
|
1061
|
+
Ie.value = l;
|
|
1105
1062
|
}
|
|
1106
|
-
|
|
1107
|
-
const
|
|
1108
|
-
for (const r of n)
|
|
1109
|
-
|
|
1110
|
-
}),
|
|
1111
|
-
const
|
|
1112
|
-
for (const r of n)
|
|
1113
|
-
|
|
1114
|
-
const r = new Set(
|
|
1115
|
-
for (const
|
|
1116
|
-
r.delete(
|
|
1117
|
-
|
|
1118
|
-
},
|
|
1063
|
+
pe(() => {
|
|
1064
|
+
const l = new Set(ie.value);
|
|
1065
|
+
for (const r of n) l.add(r);
|
|
1066
|
+
ie.value = l;
|
|
1067
|
+
}), Wt(() => {
|
|
1068
|
+
const l = new Set(se.value);
|
|
1069
|
+
for (const r of n) l.delete(r);
|
|
1070
|
+
se.value = l, setTimeout(() => {
|
|
1071
|
+
const r = new Set(ie.value), c = new Map(Ie.value);
|
|
1072
|
+
for (const h of n)
|
|
1073
|
+
r.delete(h), Ae.delete(h), c.delete(h);
|
|
1074
|
+
ie.value = r, Ie.value = c;
|
|
1075
|
+
}, Ht);
|
|
1119
1076
|
});
|
|
1120
1077
|
},
|
|
1121
1078
|
{ flush: "post" }
|
|
1122
1079
|
);
|
|
1123
|
-
async function
|
|
1124
|
-
if (
|
|
1125
|
-
if (
|
|
1080
|
+
async function wt() {
|
|
1081
|
+
if (fe) return fe;
|
|
1082
|
+
if (ue.value || ce.value || a.mode !== "backfill" && V.value == null || a.mode === "backfill" && V.value == null && ze.value.length === 0)
|
|
1126
1083
|
return;
|
|
1127
|
-
const e =
|
|
1084
|
+
const e = D;
|
|
1128
1085
|
let n = null;
|
|
1129
1086
|
return n = (async () => {
|
|
1130
1087
|
try {
|
|
1131
|
-
if (
|
|
1132
|
-
const r = await
|
|
1133
|
-
if (e !==
|
|
1134
|
-
r.pages.length && (W.value = [...W.value, ...r.pages]),
|
|
1088
|
+
if (ce.value = !0, ye.value = "", a.mode === "backfill") {
|
|
1089
|
+
const r = await ht.loadBackfillBatch(V.value);
|
|
1090
|
+
if (e !== D) return;
|
|
1091
|
+
r.pages.length && (W.value = [...W.value, ...r.pages]), we(r.batchItems), m.value = [...m.value, ...r.batchItems], V.value = r.nextPage;
|
|
1135
1092
|
return;
|
|
1136
1093
|
}
|
|
1137
|
-
const t =
|
|
1094
|
+
const t = V.value;
|
|
1138
1095
|
if (t == null) return;
|
|
1139
|
-
const
|
|
1140
|
-
if (e !==
|
|
1141
|
-
W.value = [...W.value, t],
|
|
1096
|
+
const l = await gt(t);
|
|
1097
|
+
if (e !== D) return;
|
|
1098
|
+
W.value = [...W.value, t], we(l.items), m.value = [...m.value, ...l.items], V.value = l.nextPage;
|
|
1142
1099
|
} catch (t) {
|
|
1143
|
-
if (e !==
|
|
1144
|
-
|
|
1100
|
+
if (e !== D || ct(t)) return;
|
|
1101
|
+
ye.value = t instanceof Error ? t.message : String(t);
|
|
1145
1102
|
} finally {
|
|
1146
|
-
e ===
|
|
1103
|
+
e === D && (ce.value = !1), fe === n && (fe = null);
|
|
1147
1104
|
}
|
|
1148
|
-
})(),
|
|
1105
|
+
})(), fe = n, n;
|
|
1149
1106
|
}
|
|
1150
|
-
function
|
|
1151
|
-
const e =
|
|
1107
|
+
function on() {
|
|
1108
|
+
const e = u.value;
|
|
1152
1109
|
if (!e) return;
|
|
1153
|
-
const n = e.scrollTop, t = e.clientHeight,
|
|
1154
|
-
|
|
1155
|
-
const r =
|
|
1156
|
-
if (
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1110
|
+
const n = e.scrollTop, t = e.clientHeight, l = e.scrollHeight;
|
|
1111
|
+
j.value = n, B.value = t;
|
|
1112
|
+
const r = He, c = Ve, h = n > r, E = c > 0 && l < c;
|
|
1113
|
+
if (He = n, Ve = l, Fe) {
|
|
1114
|
+
if (!h) return;
|
|
1115
|
+
Fe = !1;
|
|
1116
|
+
}
|
|
1117
|
+
if (E && !h) return;
|
|
1118
|
+
l - (n + t) <= a.prefetchThresholdPx && wt();
|
|
1119
|
+
}
|
|
1120
|
+
function bt() {
|
|
1121
|
+
return u.value;
|
|
1122
|
+
}
|
|
1123
|
+
function xt(e) {
|
|
1124
|
+
I.value = Ee(e), B.value = e.clientHeight;
|
|
1125
|
+
}
|
|
1126
|
+
function ln() {
|
|
1127
|
+
typeof ResizeObserver > "u" || (re = new ResizeObserver(() => {
|
|
1128
|
+
const e = bt();
|
|
1129
|
+
e && xt(e);
|
|
1169
1130
|
}));
|
|
1170
1131
|
}
|
|
1171
|
-
function
|
|
1132
|
+
function an() {
|
|
1172
1133
|
return {
|
|
1173
|
-
enabled:
|
|
1134
|
+
enabled: a.mode === "backfill",
|
|
1174
1135
|
isBackfillActive: !1,
|
|
1175
1136
|
isRequestInFlight: !1,
|
|
1176
|
-
|
|
1137
|
+
page: a.page,
|
|
1138
|
+
next: a.page,
|
|
1177
1139
|
progress: {
|
|
1178
1140
|
collected: 0,
|
|
1179
1141
|
target: 0
|
|
1180
1142
|
},
|
|
1181
1143
|
cooldownMsRemaining: 0,
|
|
1182
|
-
cooldownMsTotal:
|
|
1183
|
-
pageSize:
|
|
1144
|
+
cooldownMsTotal: et(a.backfillRequestDelayMs),
|
|
1145
|
+
pageSize: Dt(a.pageSize),
|
|
1184
1146
|
bufferSize: 0,
|
|
1185
1147
|
lastBatch: null,
|
|
1186
1148
|
totals: {
|
|
@@ -1189,127 +1151,127 @@ const Bn = { class: "hidden" }, Cn = {
|
|
|
1189
1151
|
}
|
|
1190
1152
|
};
|
|
1191
1153
|
}
|
|
1192
|
-
function
|
|
1193
|
-
|
|
1154
|
+
function kt() {
|
|
1155
|
+
D += 1, Ye += 1, fe = null, de = null, He = 0, Ve = 0, Fe = !1, Le = 0, ve.clear(), me.length = 0, se.value = /* @__PURE__ */ new Set(), ie.value = /* @__PURE__ */ new Set(), Ae.clear(), Ce.value = /* @__PURE__ */ new Map(), te.value = /* @__PURE__ */ new Set(), ne.value = [], W.value = [], V.value = null, ze.value = [], Xe.value = an(), ue.value = !0, ce.value = !1, ye.value = "", je.value = !1;
|
|
1194
1156
|
}
|
|
1195
|
-
function
|
|
1196
|
-
|
|
1157
|
+
function Mt(e) {
|
|
1158
|
+
kt(), m.value = [], V.value = e;
|
|
1197
1159
|
}
|
|
1198
|
-
function
|
|
1199
|
-
const n = Array.isArray(e) ? e : [e], t = [],
|
|
1160
|
+
function rn(e) {
|
|
1161
|
+
const n = Array.isArray(e) ? e : [e], t = [], l = /* @__PURE__ */ new Set();
|
|
1200
1162
|
for (const r of n) {
|
|
1201
1163
|
if (r == null) continue;
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1164
|
+
const c = typeof r == "string" ? `s:${r}` : `n:${String(r)}`;
|
|
1165
|
+
l.has(c) || (l.add(c), t.push(r));
|
|
1204
1166
|
}
|
|
1205
1167
|
return t;
|
|
1206
1168
|
}
|
|
1207
|
-
function
|
|
1208
|
-
|
|
1169
|
+
function Ge(e) {
|
|
1170
|
+
kt(), W.value = e ? rn(e) : [], V.value = a.page, ue.value = !1, Kt(m.value), we(m.value);
|
|
1209
1171
|
}
|
|
1210
|
-
async function
|
|
1211
|
-
if (
|
|
1212
|
-
const n =
|
|
1172
|
+
async function St(e) {
|
|
1173
|
+
if (de) return de;
|
|
1174
|
+
const n = D;
|
|
1213
1175
|
let t = null;
|
|
1214
1176
|
return t = (async () => {
|
|
1215
1177
|
try {
|
|
1216
|
-
if (
|
|
1217
|
-
const
|
|
1218
|
-
if (n !==
|
|
1219
|
-
W.value =
|
|
1178
|
+
if (a.mode === "backfill") {
|
|
1179
|
+
const l = await ht.loadBackfillBatch(e);
|
|
1180
|
+
if (n !== D) return;
|
|
1181
|
+
W.value = l.pages.length ? l.pages : [e], we(l.batchItems), m.value = l.batchItems, V.value = l.nextPage;
|
|
1220
1182
|
} else {
|
|
1221
|
-
const
|
|
1222
|
-
if (n !==
|
|
1223
|
-
W.value = [e],
|
|
1183
|
+
const l = await gt(e);
|
|
1184
|
+
if (n !== D) return;
|
|
1185
|
+
W.value = [e], we(l.items), m.value = l.items, V.value = l.nextPage;
|
|
1224
1186
|
}
|
|
1225
|
-
} catch (
|
|
1226
|
-
if (n !==
|
|
1227
|
-
|
|
1187
|
+
} catch (l) {
|
|
1188
|
+
if (n !== D || ct(l)) return;
|
|
1189
|
+
ye.value = l instanceof Error ? l.message : String(l);
|
|
1228
1190
|
} finally {
|
|
1229
|
-
n ===
|
|
1191
|
+
n === D && (ue.value = !1), de === t && (de = null);
|
|
1230
1192
|
}
|
|
1231
|
-
})(),
|
|
1193
|
+
})(), de = t, t;
|
|
1232
1194
|
}
|
|
1233
|
-
function
|
|
1234
|
-
const e =
|
|
1235
|
-
e && (
|
|
1195
|
+
function sn() {
|
|
1196
|
+
const e = bt();
|
|
1197
|
+
e && (xt(e), j.value = e.scrollTop, He = e.scrollTop, Ve = e.scrollHeight, re?.observe(e));
|
|
1236
1198
|
}
|
|
1237
|
-
|
|
1238
|
-
if (
|
|
1239
|
-
|
|
1199
|
+
Qe(async () => {
|
|
1200
|
+
if (ln(), sn(), a.restoredPages != null) {
|
|
1201
|
+
be.value = !0, Ge(a.restoredPages);
|
|
1240
1202
|
return;
|
|
1241
1203
|
}
|
|
1242
|
-
if (
|
|
1243
|
-
|
|
1204
|
+
if ($e.value && m.value.length > 0) {
|
|
1205
|
+
be.value = !0, Ge();
|
|
1244
1206
|
return;
|
|
1245
1207
|
}
|
|
1246
|
-
|
|
1247
|
-
}),
|
|
1248
|
-
|
|
1249
|
-
}),
|
|
1250
|
-
() =>
|
|
1208
|
+
be.value = !1, Mt(a.page), await St(a.page);
|
|
1209
|
+
}), zt(() => {
|
|
1210
|
+
re?.disconnect(), P && (clearTimeout(P), P = null), F && (clearTimeout(F), F = null), L(), R();
|
|
1211
|
+
}), oe(
|
|
1212
|
+
() => a.page,
|
|
1251
1213
|
async (e) => {
|
|
1252
|
-
if (
|
|
1253
|
-
|
|
1214
|
+
if (be.value) {
|
|
1215
|
+
V.value = e;
|
|
1254
1216
|
return;
|
|
1255
1217
|
}
|
|
1256
|
-
|
|
1218
|
+
Mt(e), await St(e);
|
|
1257
1219
|
}
|
|
1258
|
-
),
|
|
1259
|
-
() =>
|
|
1220
|
+
), oe(
|
|
1221
|
+
() => a.restoredPages,
|
|
1260
1222
|
(e) => {
|
|
1261
|
-
e && (
|
|
1223
|
+
e && (be.value = !0, Ge(e));
|
|
1262
1224
|
}
|
|
1263
|
-
),
|
|
1264
|
-
|
|
1225
|
+
), oe(
|
|
1226
|
+
ee,
|
|
1265
1227
|
() => {
|
|
1266
|
-
const e =
|
|
1267
|
-
e && (
|
|
1228
|
+
const e = u.value;
|
|
1229
|
+
e && (I.value = Ee(e));
|
|
1268
1230
|
},
|
|
1269
1231
|
{ immediate: !1 }
|
|
1270
1232
|
);
|
|
1271
|
-
const
|
|
1272
|
-
() =>
|
|
1233
|
+
const Ke = k(() => Tn(I.value, a.itemWidth)), Te = k(
|
|
1234
|
+
() => Pn(I.value, Ke.value, a.itemWidth, ee.value)
|
|
1273
1235
|
);
|
|
1274
|
-
|
|
1275
|
-
[
|
|
1236
|
+
oe(
|
|
1237
|
+
[Ke, Te, ee, Pe, G, K],
|
|
1276
1238
|
() => {
|
|
1277
|
-
|
|
1239
|
+
yt();
|
|
1278
1240
|
},
|
|
1279
1241
|
{ immediate: !0 }
|
|
1280
|
-
),
|
|
1242
|
+
), oe(
|
|
1281
1243
|
// Performance note: this component targets very large arrays (e.g. 10k items).
|
|
1282
1244
|
// Avoid deep watchers over items; rebuild layout only when the list structure
|
|
1283
1245
|
// changes (new array reference or length change). This keeps metadata-only
|
|
1284
1246
|
// updates (e.g. reactions) cheap.
|
|
1285
|
-
() => [
|
|
1286
|
-
() =>
|
|
1247
|
+
() => [m.value, m.value.length],
|
|
1248
|
+
() => yt(),
|
|
1287
1249
|
{ immediate: !0 }
|
|
1288
1250
|
);
|
|
1289
|
-
const
|
|
1251
|
+
const un = k(() => [
|
|
1290
1252
|
"mt-8 flex min-h-0 flex-1 flex-col rounded-2xl border border-slate-200/70 bg-white/70 p-5 shadow-sm backdrop-blur",
|
|
1291
|
-
|
|
1253
|
+
y.class
|
|
1292
1254
|
]);
|
|
1293
|
-
return (e, n) => (
|
|
1294
|
-
|
|
1295
|
-
|
|
1255
|
+
return (e, n) => (_(), T("section", mn(ae.value, { class: un.value }), [
|
|
1256
|
+
C("div", Nn, [
|
|
1257
|
+
hn(e.$slots, "default")
|
|
1296
1258
|
]),
|
|
1297
|
-
|
|
1259
|
+
C("div", {
|
|
1298
1260
|
ref_key: "scrollViewportRef",
|
|
1299
|
-
ref:
|
|
1261
|
+
ref: u,
|
|
1300
1262
|
"data-testid": "items-scroll-container",
|
|
1301
1263
|
class: "mt-4 min-h-0 flex-1 overflow-auto",
|
|
1302
|
-
style: U({ paddingRight:
|
|
1303
|
-
onScroll:
|
|
1264
|
+
style: U({ paddingRight: ee.value + "px" }),
|
|
1265
|
+
onScroll: on
|
|
1304
1266
|
}, [
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1267
|
+
ue.value ? (_(), T("div", Hn, n[0] || (n[0] = [
|
|
1268
|
+
C("div", { class: "inline-flex items-center gap-3 text-sm text-slate-600" }, [
|
|
1269
|
+
C("svg", {
|
|
1308
1270
|
class: "h-5 w-5 animate-spin text-slate-500",
|
|
1309
1271
|
viewBox: "0 0 24 24",
|
|
1310
1272
|
"aria-hidden": "true"
|
|
1311
1273
|
}, [
|
|
1312
|
-
|
|
1274
|
+
C("circle", {
|
|
1313
1275
|
class: "opacity-25",
|
|
1314
1276
|
cx: "12",
|
|
1315
1277
|
cy: "12",
|
|
@@ -1318,75 +1280,75 @@ const Bn = { class: "hidden" }, Cn = {
|
|
|
1318
1280
|
stroke: "currentColor",
|
|
1319
1281
|
"stroke-width": "4"
|
|
1320
1282
|
}),
|
|
1321
|
-
|
|
1283
|
+
C("path", {
|
|
1322
1284
|
class: "opacity-75",
|
|
1323
1285
|
fill: "currentColor",
|
|
1324
1286
|
d: "M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4z"
|
|
1325
1287
|
})
|
|
1326
1288
|
]),
|
|
1327
|
-
|
|
1289
|
+
C("span", null, "Loading…")
|
|
1328
1290
|
], -1)
|
|
1329
|
-
]))) :
|
|
1291
|
+
]))) : ye.value ? (_(), T("p", Vn, "Error: " + Ze(ye.value), 1)) : (_(), T("div", {
|
|
1330
1292
|
key: 2,
|
|
1331
1293
|
class: "relative",
|
|
1332
|
-
style: U({ height:
|
|
1294
|
+
style: U({ height: nn.value + "px" })
|
|
1333
1295
|
}, [
|
|
1334
|
-
(
|
|
1335
|
-
key:
|
|
1296
|
+
(_(!0), T(Pt, null, Et(We.value, (t) => (_(), T("article", {
|
|
1297
|
+
key: m.value[t].id,
|
|
1336
1298
|
"data-testid": "item-card",
|
|
1337
1299
|
class: "absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
|
|
1338
1300
|
style: U({
|
|
1339
|
-
width:
|
|
1340
|
-
transition:
|
|
1341
|
-
transitionDelay:
|
|
1342
|
-
transform:
|
|
1301
|
+
width: Te.value + "px",
|
|
1302
|
+
transition: jt(m.value[t].id),
|
|
1303
|
+
transitionDelay: qt(m.value[t].id),
|
|
1304
|
+
transform: Ut(t)
|
|
1343
1305
|
})
|
|
1344
1306
|
}, [
|
|
1345
|
-
|
|
1307
|
+
Be.value || G.value > 0 ? (_(), T("div", {
|
|
1346
1308
|
key: 0,
|
|
1347
1309
|
"data-testid": "item-header-container",
|
|
1348
1310
|
class: "w-full",
|
|
1349
|
-
style: U(
|
|
1311
|
+
style: U(nt.value)
|
|
1350
1312
|
}, [
|
|
1351
|
-
Q(
|
|
1352
|
-
"slot-fn":
|
|
1353
|
-
"slot-props": { item:
|
|
1313
|
+
Q(le(w), {
|
|
1314
|
+
"slot-fn": ke.value,
|
|
1315
|
+
"slot-props": { item: m.value[t], remove: () => De(m.value[t]) }
|
|
1354
1316
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1355
|
-
], 4)) :
|
|
1356
|
-
|
|
1317
|
+
], 4)) : Z("", !0),
|
|
1318
|
+
C("div", {
|
|
1357
1319
|
class: "group relative",
|
|
1358
|
-
onMouseenter: (
|
|
1359
|
-
onMouseleave: (
|
|
1320
|
+
onMouseenter: (l) => p(m.value[t].id),
|
|
1321
|
+
onMouseleave: (l) => b(m.value[t].id)
|
|
1360
1322
|
}, [
|
|
1361
|
-
Q(
|
|
1362
|
-
item:
|
|
1363
|
-
remove: () =>
|
|
1364
|
-
"loader-slot-fn":
|
|
1365
|
-
"error-slot-fn":
|
|
1366
|
-
hovered:
|
|
1367
|
-
onSuccess:
|
|
1368
|
-
onError:
|
|
1323
|
+
Q(Rt, {
|
|
1324
|
+
item: m.value[t],
|
|
1325
|
+
remove: () => De(m.value[t]),
|
|
1326
|
+
"loader-slot-fn": ge.value,
|
|
1327
|
+
"error-slot-fn": J.value,
|
|
1328
|
+
hovered: d.value === m.value[t].id,
|
|
1329
|
+
onSuccess: H,
|
|
1330
|
+
onError: q
|
|
1369
1331
|
}, null, 8, ["item", "remove", "loader-slot-fn", "error-slot-fn", "hovered"]),
|
|
1370
|
-
|
|
1371
|
-
Q(
|
|
1372
|
-
"slot-fn":
|
|
1373
|
-
"slot-props": { item:
|
|
1332
|
+
tt.value ? (_(), T("div", Ln, [
|
|
1333
|
+
Q(le(w), {
|
|
1334
|
+
"slot-fn": x.value,
|
|
1335
|
+
"slot-props": { item: m.value[t], remove: () => De(m.value[t]) }
|
|
1374
1336
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1375
|
-
])) :
|
|
1376
|
-
], 40,
|
|
1377
|
-
|
|
1337
|
+
])) : Z("", !0)
|
|
1338
|
+
], 40, zn),
|
|
1339
|
+
Me.value || K.value > 0 ? (_(), T("div", {
|
|
1378
1340
|
key: 1,
|
|
1379
1341
|
"data-testid": "item-footer-container",
|
|
1380
1342
|
class: "w-full",
|
|
1381
|
-
style: U(
|
|
1343
|
+
style: U(ot.value)
|
|
1382
1344
|
}, [
|
|
1383
|
-
Q(
|
|
1384
|
-
"slot-fn":
|
|
1385
|
-
"slot-props": { item:
|
|
1345
|
+
Q(le(w), {
|
|
1346
|
+
"slot-fn": s.value,
|
|
1347
|
+
"slot-props": { item: m.value[t], remove: () => De(m.value[t]) }
|
|
1386
1348
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1387
|
-
], 4)) :
|
|
1349
|
+
], 4)) : Z("", !0)
|
|
1388
1350
|
], 4))), 128)),
|
|
1389
|
-
(
|
|
1351
|
+
(_(!0), T(Pt, null, Et(ne.value, (t) => (_(), T("article", {
|
|
1390
1352
|
key: t.id + ":leaving",
|
|
1391
1353
|
"data-testid": "item-card-leaving",
|
|
1392
1354
|
class: "pointer-events-none absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
|
|
@@ -1396,57 +1358,57 @@ const Bn = { class: "hidden" }, Cn = {
|
|
|
1396
1358
|
transform: t.leaving ? "translate3d(" + t.fromX + "px," + t.fromY + "px,0)" : "translate3d(" + t.fromX + "px," + t.toY + "px,0)"
|
|
1397
1359
|
})
|
|
1398
1360
|
}, [
|
|
1399
|
-
|
|
1361
|
+
Be.value || G.value > 0 ? (_(), T("div", {
|
|
1400
1362
|
key: 0,
|
|
1401
1363
|
"data-testid": "item-header-container",
|
|
1402
1364
|
class: "w-full",
|
|
1403
|
-
style: U(
|
|
1365
|
+
style: U(nt.value)
|
|
1404
1366
|
}, [
|
|
1405
|
-
Q(
|
|
1406
|
-
"slot-fn":
|
|
1367
|
+
Q(le(w), {
|
|
1368
|
+
"slot-fn": ke.value,
|
|
1407
1369
|
"slot-props": { item: t.item, remove: () => {
|
|
1408
1370
|
} }
|
|
1409
1371
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1410
|
-
], 4)) :
|
|
1411
|
-
|
|
1412
|
-
Q(
|
|
1372
|
+
], 4)) : Z("", !0),
|
|
1373
|
+
C("div", $n, [
|
|
1374
|
+
Q(Rt, {
|
|
1413
1375
|
item: t.item,
|
|
1414
1376
|
remove: () => {
|
|
1415
1377
|
},
|
|
1416
|
-
"loader-slot-fn":
|
|
1417
|
-
"error-slot-fn":
|
|
1378
|
+
"loader-slot-fn": ge.value,
|
|
1379
|
+
"error-slot-fn": J.value,
|
|
1418
1380
|
hovered: !1
|
|
1419
1381
|
}, null, 8, ["item", "loader-slot-fn", "error-slot-fn"]),
|
|
1420
|
-
|
|
1421
|
-
Q(
|
|
1422
|
-
"slot-fn":
|
|
1382
|
+
tt.value ? (_(), T("div", Dn, [
|
|
1383
|
+
Q(le(w), {
|
|
1384
|
+
"slot-fn": x.value,
|
|
1423
1385
|
"slot-props": { item: t.item, remove: () => {
|
|
1424
1386
|
} }
|
|
1425
1387
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1426
|
-
])) :
|
|
1388
|
+
])) : Z("", !0)
|
|
1427
1389
|
]),
|
|
1428
|
-
|
|
1390
|
+
Me.value || K.value > 0 ? (_(), T("div", {
|
|
1429
1391
|
key: 1,
|
|
1430
1392
|
"data-testid": "item-footer-container",
|
|
1431
1393
|
class: "w-full",
|
|
1432
|
-
style: U(
|
|
1394
|
+
style: U(ot.value)
|
|
1433
1395
|
}, [
|
|
1434
|
-
Q(
|
|
1435
|
-
"slot-fn":
|
|
1396
|
+
Q(le(w), {
|
|
1397
|
+
"slot-fn": s.value,
|
|
1436
1398
|
"slot-props": { item: t.item, remove: () => {
|
|
1437
1399
|
} }
|
|
1438
1400
|
}, null, 8, ["slot-fn", "slot-props"])
|
|
1439
|
-
], 4)) :
|
|
1401
|
+
], 4)) : Z("", !0)
|
|
1440
1402
|
], 4))), 128))
|
|
1441
1403
|
], 4)),
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1404
|
+
C("div", On, [
|
|
1405
|
+
ce.value ? (_(), T("span", Yn, n[1] || (n[1] = [
|
|
1406
|
+
C("svg", {
|
|
1445
1407
|
class: "h-4 w-4 animate-spin text-slate-500",
|
|
1446
1408
|
viewBox: "0 0 24 24",
|
|
1447
1409
|
"aria-hidden": "true"
|
|
1448
1410
|
}, [
|
|
1449
|
-
|
|
1411
|
+
C("circle", {
|
|
1450
1412
|
class: "opacity-25",
|
|
1451
1413
|
cx: "12",
|
|
1452
1414
|
cy: "12",
|
|
@@ -1455,50 +1417,50 @@ const Bn = { class: "hidden" }, Cn = {
|
|
|
1455
1417
|
stroke: "currentColor",
|
|
1456
1418
|
"stroke-width": "4"
|
|
1457
1419
|
}),
|
|
1458
|
-
|
|
1420
|
+
C("path", {
|
|
1459
1421
|
class: "opacity-75",
|
|
1460
1422
|
fill: "currentColor",
|
|
1461
1423
|
d: "M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4z"
|
|
1462
1424
|
})
|
|
1463
1425
|
], -1),
|
|
1464
|
-
|
|
1465
|
-
]))) :
|
|
1426
|
+
C("span", null, "Loading more…", -1)
|
|
1427
|
+
]))) : V.value == null ? (_(), T("span", qn, "End of list")) : (_(), T("span", Xn, "Scroll to load page " + Ze(V.value), 1))
|
|
1466
1428
|
])
|
|
1467
1429
|
], 36)
|
|
1468
1430
|
], 16));
|
|
1469
1431
|
}
|
|
1470
|
-
}),
|
|
1432
|
+
}), Jn = xe({
|
|
1471
1433
|
name: "MasonryItem",
|
|
1472
|
-
setup(
|
|
1473
|
-
const
|
|
1474
|
-
if (!
|
|
1434
|
+
setup(o, { slots: M, attrs: i }) {
|
|
1435
|
+
const a = gn($t, null);
|
|
1436
|
+
if (!a)
|
|
1475
1437
|
return () => null;
|
|
1476
|
-
const
|
|
1477
|
-
return
|
|
1438
|
+
const f = i.onPreloaded, y = i.onFailed, w = M.overlay, g = M.default;
|
|
1439
|
+
return a({
|
|
1478
1440
|
header: M.header,
|
|
1479
1441
|
loader: M.loader,
|
|
1480
|
-
overlay:
|
|
1442
|
+
overlay: w ?? g,
|
|
1481
1443
|
error: M.error,
|
|
1482
1444
|
footer: M.footer,
|
|
1483
|
-
onPreloaded: typeof
|
|
1484
|
-
for (const
|
|
1485
|
-
typeof
|
|
1445
|
+
onPreloaded: typeof f == "function" ? f : Array.isArray(f) ? (d) => {
|
|
1446
|
+
for (const p of f)
|
|
1447
|
+
typeof p == "function" && p(d);
|
|
1486
1448
|
} : void 0,
|
|
1487
|
-
onFailed: typeof
|
|
1488
|
-
for (const
|
|
1489
|
-
typeof
|
|
1449
|
+
onFailed: typeof y == "function" ? y : Array.isArray(y) ? (d) => {
|
|
1450
|
+
for (const p of y)
|
|
1451
|
+
typeof p == "function" && p(d);
|
|
1490
1452
|
} : void 0
|
|
1491
1453
|
}), () => null;
|
|
1492
1454
|
}
|
|
1493
|
-
}),
|
|
1494
|
-
install(
|
|
1495
|
-
|
|
1455
|
+
}), Zn = {
|
|
1456
|
+
install(o) {
|
|
1457
|
+
o.component("Masonry", Kn), o.component("MasonryItem", Jn), o.component("MasonryVideoControls", Lt);
|
|
1496
1458
|
}
|
|
1497
1459
|
};
|
|
1498
1460
|
export {
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1461
|
+
Kn as Masonry,
|
|
1462
|
+
Jn as MasonryItem,
|
|
1463
|
+
Lt as MasonryVideoControls,
|
|
1464
|
+
Zn as VibePlugin,
|
|
1465
|
+
pn as masonryDefaults
|
|
1504
1466
|
};
|