@wyxos/vibe 5.16.9 → 5.17.0
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/README.md +2 -0
- package/lib/components/VibeControlledReel.vue.d.ts +24 -0
- package/lib/core/controlledReel.d.ts +41 -0
- package/lib/core/reelScrollTransition.d.ts +2 -1
- package/lib/core/reelViewport.d.ts +2 -0
- package/lib/index.cjs +2 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1211 -1037
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, Transition as n, computed as r, createApp as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p,
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, computed as r, createApp as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p, isRef as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, openBlock as x, reactive as S, renderList as C, renderSlot as w, resolveDynamicComponent as T, shallowRef as E, toDisplayString as D, unref as O, useId as k, watch as A, withCtx as j, withKeys as M, withModifiers as N } from "vue";
|
|
2
2
|
//#region src/core/mediaType.ts
|
|
3
|
-
var
|
|
4
|
-
function
|
|
3
|
+
var P = /\.(aac|flac|m4a|mp3|oga|ogg|opus|wav)$/i, F = /\.(m4v|mkv|mov|mp4|ogv|webm)$/i;
|
|
4
|
+
function I(e) {
|
|
5
5
|
try {
|
|
6
6
|
return new URL(e).pathname;
|
|
7
7
|
} catch {
|
|
8
8
|
return e.split(/[?#]/)[0] ?? e;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
let t =
|
|
13
|
-
return
|
|
11
|
+
function L(e) {
|
|
12
|
+
let t = I(e);
|
|
13
|
+
return P.test(t) ? "audio" : F.test(t) ? "video" : "image";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return e ??
|
|
15
|
+
function R(e, t) {
|
|
16
|
+
return e ?? L(t);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function z(e, t) {
|
|
19
|
+
return R(e, t) !== "image";
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/core/mediaAsset.ts
|
|
23
|
-
function
|
|
23
|
+
function B(e) {
|
|
24
24
|
return {
|
|
25
25
|
height: e.height,
|
|
26
26
|
src: e.src,
|
|
@@ -28,9 +28,9 @@ function R(e) {
|
|
|
28
28
|
width: e.width
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function V(e, t) {
|
|
32
32
|
if (t === "preview" && e.preview) {
|
|
33
|
-
let t =
|
|
33
|
+
let t = R(e.type, e.src) === "audio" ? R(e.preview.type, e.preview.src) : e.preview.type ?? e.type;
|
|
34
34
|
return {
|
|
35
35
|
...e.preview,
|
|
36
36
|
type: t
|
|
@@ -39,45 +39,45 @@ function z(e, t) {
|
|
|
39
39
|
return t === "mobile" && e.mobile ? {
|
|
40
40
|
...e.mobile,
|
|
41
41
|
type: e.mobile.type ?? e.type
|
|
42
|
-
} :
|
|
42
|
+
} : B(e);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function H(e) {
|
|
45
45
|
let t = e.preview;
|
|
46
|
-
return !t?.src || t.src === e.src ||
|
|
46
|
+
return !t?.src || t.src === e.src || R(t.type, t.src) !== "image" ? null : {
|
|
47
47
|
...t,
|
|
48
48
|
type: "image"
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
51
|
+
function U(e, t) {
|
|
52
|
+
return R(e.type, e.src) === "audio" ? t === "mobile" && e.mobile && R(e.mobile.type, e.mobile.src) === "audio" ? {
|
|
53
53
|
...e.mobile,
|
|
54
54
|
type: "audio"
|
|
55
55
|
} : {
|
|
56
|
-
...
|
|
56
|
+
...B(e),
|
|
57
57
|
type: "audio"
|
|
58
|
-
} :
|
|
58
|
+
} : V(e, t);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function W(e) {
|
|
61
61
|
return [e, ...e.items];
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function G(e, t) {
|
|
64
64
|
return Math.min(e.items.length, Math.max(0, t));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function K(e, t) {
|
|
67
|
+
return W(e)[G(e, t)] ?? e;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function q(e, t) {
|
|
70
70
|
return `${String(e)}:${t}`;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/core/runtime.ts
|
|
74
|
-
function
|
|
74
|
+
function ee(e) {
|
|
75
75
|
return r(() => Object.freeze([...e.items]));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return n(
|
|
77
|
+
function J(e, t, n) {
|
|
78
|
+
return n(Y(e, t.value)), A(() => Y(e, t.value), n, { flush: "post" });
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function Y(e, t = [...e.items]) {
|
|
81
81
|
return {
|
|
82
82
|
activeReelPostId: e.activeReelPostId,
|
|
83
83
|
autoScroll: { ...e.autoScroll },
|
|
@@ -107,17 +107,17 @@ function te(e, t = [...e.items]) {
|
|
|
107
107
|
}
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/components/GalleryFooter.vue?vue&type=script&setup=true&lang.ts
|
|
110
|
-
var
|
|
110
|
+
var te = {
|
|
111
111
|
key: 0,
|
|
112
112
|
class: "gallery-footer"
|
|
113
|
-
},
|
|
113
|
+
}, ne = {
|
|
114
114
|
key: 0,
|
|
115
115
|
class: "load-more-status",
|
|
116
116
|
role: "status"
|
|
117
|
-
},
|
|
117
|
+
}, re = ["disabled"], ie = {
|
|
118
118
|
key: 2,
|
|
119
119
|
class: "end-feed"
|
|
120
|
-
},
|
|
120
|
+
}, ae = ["disabled"], oe = /* @__PURE__ */ d({
|
|
121
121
|
__name: "GalleryFooter",
|
|
122
122
|
props: {
|
|
123
123
|
canRetryEnd: { type: Boolean },
|
|
@@ -133,14 +133,14 @@ var q = {
|
|
|
133
133
|
function i() {
|
|
134
134
|
n.loadMoreLocked || (n.hasNext ? r("loadMore") : r("retryEnd"));
|
|
135
135
|
}
|
|
136
|
-
return (t, n) => e.isLoading || e.hasError || e.hasNext && e.showLoadMore || !e.hasNext && e.canRetryEnd ? (
|
|
136
|
+
return (t, n) => e.isLoading || e.hasError || e.hasNext && e.showLoadMore || !e.hasNext && e.canRetryEnd ? (x(), s("footer", te, [e.isLoading ? (x(), s("p", ne, " Loading more… ")) : e.hasError || e.hasNext && e.showLoadMore ? (x(), s("button", {
|
|
137
137
|
key: 1,
|
|
138
138
|
"data-test": "load-more",
|
|
139
139
|
class: "load-more-button",
|
|
140
140
|
type: "button",
|
|
141
141
|
disabled: e.loadMoreLocked,
|
|
142
142
|
onClick: i
|
|
143
|
-
},
|
|
143
|
+
}, D(e.hasError ? "Try again" : e.loadMoreLocked ? "Loading paused" : "Load more"), 9, re)) : (x(), s("div", ie, [n[1] ||= c("p", {
|
|
144
144
|
class: "end-feed-message",
|
|
145
145
|
role: "status"
|
|
146
146
|
}, " You've reached the end. ", -1), c("button", {
|
|
@@ -149,9 +149,9 @@ var q = {
|
|
|
149
149
|
type: "button",
|
|
150
150
|
disabled: e.loadMoreLocked,
|
|
151
151
|
onClick: n[0] ||= (e) => t.$emit("retryEnd")
|
|
152
|
-
}, " Check for more ", 8,
|
|
152
|
+
}, " Check for more ", 8, ae)]))])) : o("", !0);
|
|
153
153
|
}
|
|
154
|
-
}),
|
|
154
|
+
}), se = /* @__PURE__ */ d({
|
|
155
155
|
__name: "FeedFooter",
|
|
156
156
|
props: {
|
|
157
157
|
actions: {},
|
|
@@ -173,7 +173,7 @@ var q = {
|
|
|
173
173
|
function o() {
|
|
174
174
|
n.actions?.retry();
|
|
175
175
|
}
|
|
176
|
-
return (t, n) => e.feedFooter && e.actions && e.state ? (
|
|
176
|
+
return (t, n) => e.feedFooter && e.actions && e.state ? (x(), a(T(e.feedFooter.component), {
|
|
177
177
|
key: 0,
|
|
178
178
|
actions: e.actions,
|
|
179
179
|
"can-retry-end": e.canRetryEnd,
|
|
@@ -188,7 +188,7 @@ var q = {
|
|
|
188
188
|
"can-retry-end",
|
|
189
189
|
"show-load-more",
|
|
190
190
|
"state"
|
|
191
|
-
])) : (
|
|
191
|
+
])) : (x(), a(oe, {
|
|
192
192
|
key: 1,
|
|
193
193
|
"can-retry-end": e.canRetryEnd,
|
|
194
194
|
"has-error": e.hasError,
|
|
@@ -207,7 +207,7 @@ var q = {
|
|
|
207
207
|
"show-load-more"
|
|
208
208
|
]));
|
|
209
209
|
}
|
|
210
|
-
}),
|
|
210
|
+
}), ce = ["role"], X = { class: "gallery-status" }, le = /* @__PURE__ */ d({
|
|
211
211
|
__name: "FeedStatus",
|
|
212
212
|
props: {
|
|
213
213
|
actions: {},
|
|
@@ -218,10 +218,10 @@ var q = {
|
|
|
218
218
|
emits: ["loadMore", "retryEnd"],
|
|
219
219
|
setup(t, { emit: n }) {
|
|
220
220
|
let r = t, i = n;
|
|
221
|
-
return (n, u) => (
|
|
221
|
+
return (n, u) => (x(), s("main", {
|
|
222
222
|
class: "gallery-shell",
|
|
223
223
|
role: r.state.error ? "alert" : r.state.isLoading || r.state.isLoadingMore ? "status" : void 0
|
|
224
|
-
}, [c("p",
|
|
224
|
+
}, [c("p", X, [r.state.error ? (x(), s(e, { key: 0 }, [l(" Unable to load media. ")], 64)) : r.state.isLoading || r.state.isLoadingMore ? (x(), s(e, { key: 1 }, [l(" Loading media… ")], 64)) : (x(), s(e, { key: 2 }, [l(" No media found. ")], 64))]), t.feedFooter ? (x(), a(se, {
|
|
225
225
|
key: 0,
|
|
226
226
|
actions: t.actions,
|
|
227
227
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -243,37 +243,37 @@ var q = {
|
|
|
243
243
|
"is-loading",
|
|
244
244
|
"load-more-locked",
|
|
245
245
|
"state"
|
|
246
|
-
])) : o("", !0)], 8,
|
|
246
|
+
])) : o("", !0)], 8, ce));
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
|
-
function
|
|
249
|
+
function ue(e, t = 240) {
|
|
250
250
|
return e.scrollHeight - e.scrollTop - e.clientHeight <= t;
|
|
251
251
|
}
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region src/core/masonry.ts
|
|
254
|
-
function
|
|
254
|
+
function Z(e) {
|
|
255
255
|
let t = e.preview?.width ?? e.width, n = e.preview?.height ?? e.height;
|
|
256
256
|
return !t || !n || t <= 0 || n <= 0 ? 1 : n / t;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function de(e) {
|
|
259
259
|
return e.reduce((t, n, r) => n < e[t] ? r : t, 0);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function fe(e) {
|
|
262
262
|
return Math.max(0, e.containerHeight) + Math.max(0, e.gap);
|
|
263
263
|
}
|
|
264
|
-
var
|
|
265
|
-
function
|
|
264
|
+
var pe = .8, Q = .5;
|
|
265
|
+
function me(e, t, n) {
|
|
266
266
|
let r = Math.max(0, n.viewportHeight);
|
|
267
267
|
if (r === 0) return [];
|
|
268
268
|
let i = n.scrollTop, a = i + r;
|
|
269
269
|
return t.filter((t) => {
|
|
270
270
|
let n = e[t];
|
|
271
271
|
if (!n || n.height <= 0) return !1;
|
|
272
|
-
let o = Math.max(0, Math.min(n.y + n.height, a) - Math.max(n.y, i)), s = n.height <= r ? n.height : r *
|
|
273
|
-
return o +
|
|
272
|
+
let o = Math.max(0, Math.min(n.y + n.height, a) - Math.max(n.y, i)), s = n.height <= r ? n.height : r * pe;
|
|
273
|
+
return o + Q >= s;
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function he(e, t) {
|
|
277
277
|
if (e <= 0) return null;
|
|
278
278
|
let n = Math.max(0, t.gap), r = Number.isFinite(t.additionalHeight) ? Math.max(0, t.additionalHeight ?? 0) : 0, i = Math.max(1, t.minColumnWidth), a = Math.max(1, Math.floor((e + n) / (i + n)));
|
|
279
279
|
return {
|
|
@@ -283,8 +283,8 @@ function Q(e, t) {
|
|
|
283
283
|
itemWidth: (e - n * (a - 1)) / a
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
let r =
|
|
286
|
+
function ge(e, t, n) {
|
|
287
|
+
let r = de(t), i = n.itemWidth * Z(e) + n.additionalHeight, a = {
|
|
288
288
|
x: r * (n.itemWidth + n.gap),
|
|
289
289
|
y: t[r],
|
|
290
290
|
width: n.itemWidth,
|
|
@@ -292,48 +292,48 @@ function me(e, t, n) {
|
|
|
292
292
|
};
|
|
293
293
|
return t[r] += i + n.gap, a;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function _e(e, t) {
|
|
296
296
|
let n = Array.from({ length: t.columns }, () => 0), r = t.itemWidth + t.gap;
|
|
297
297
|
return e.forEach((e) => {
|
|
298
298
|
let i = r === 0 ? 0 : Math.round(e.x / r);
|
|
299
299
|
i < 0 || i >= t.columns || (n[i] = Math.max(n[i], e.y + e.height + t.gap));
|
|
300
300
|
}), n;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function ve(e, t) {
|
|
303
303
|
return e.length === 0 ? 0 : Math.max(0, Math.max(...e) - t);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
let r =
|
|
305
|
+
function ye(e, t, n) {
|
|
306
|
+
let r = he(t, n);
|
|
307
307
|
if (!r || e.length === 0) return {
|
|
308
308
|
columns: 0,
|
|
309
309
|
height: 0,
|
|
310
310
|
items: []
|
|
311
311
|
};
|
|
312
|
-
let i = Array.from({ length: r.columns }, () => 0), a = e.map((e) =>
|
|
312
|
+
let i = Array.from({ length: r.columns }, () => 0), a = e.map((e) => ge(e, i, r));
|
|
313
313
|
return {
|
|
314
314
|
columns: r.columns,
|
|
315
|
-
height:
|
|
315
|
+
height: ve(i, r.gap),
|
|
316
316
|
items: a
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
let o =
|
|
319
|
+
function be(e, t, n, r, i, a) {
|
|
320
|
+
let o = he(t, n);
|
|
321
321
|
if (!o || e.length === 0) return {
|
|
322
322
|
columns: 0,
|
|
323
323
|
height: 0,
|
|
324
324
|
items: []
|
|
325
325
|
};
|
|
326
|
-
if (r.columns !== o.columns || i > 0 && r.items.length < i) return
|
|
327
|
-
let s = Math.max(0, i), c = a?.untilIndex ?? e.length, l = a?.untilBottom, u = a?.throughIndex ?? s, d = s === 0 ? [] : r.items.slice(0, s), f = s === 0 ? Array.from({ length: o.columns }, () => 0) :
|
|
328
|
-
for (let t = s; t < e.length && t < c && !(l !== void 0 && t > s && t > u && f.every((e) => e >= l)); t += 1) d.push(
|
|
326
|
+
if (r.columns !== o.columns || i > 0 && r.items.length < i) return ye(e, t, n);
|
|
327
|
+
let s = Math.max(0, i), c = a?.untilIndex ?? e.length, l = a?.untilBottom, u = a?.throughIndex ?? s, d = s === 0 ? [] : r.items.slice(0, s), f = s === 0 ? Array.from({ length: o.columns }, () => 0) : _e(d, o);
|
|
328
|
+
for (let t = s; t < e.length && t < c && !(l !== void 0 && t > s && t > u && f.every((e) => e >= l)); t += 1) d.push(ge(e[t], f, o));
|
|
329
329
|
return {
|
|
330
330
|
columns: o.columns,
|
|
331
|
-
height:
|
|
331
|
+
height: ve(f, o.gap),
|
|
332
332
|
items: d
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
let o =
|
|
335
|
+
function xe(e, t, n, r, i, a) {
|
|
336
|
+
let o = he(t, n);
|
|
337
337
|
if (!o || e.length === 0) return {
|
|
338
338
|
columns: 0,
|
|
339
339
|
fromIndex: 0,
|
|
@@ -342,7 +342,7 @@ function ye(e, t, n, r, i, a) {
|
|
|
342
342
|
retainedIndices: []
|
|
343
343
|
};
|
|
344
344
|
if (r.items.length !== e.length || r.columns !== o.columns) {
|
|
345
|
-
let a = e.map((e, t) => t).filter((e) => !i(e)), o =
|
|
345
|
+
let a = e.map((e, t) => t).filter((e) => !i(e)), o = ye(a.map((t) => e[t]), t, n), s = e.map((e, t) => r.items[t] ?? {
|
|
346
346
|
height: 0,
|
|
347
347
|
width: 0,
|
|
348
348
|
x: 0,
|
|
@@ -367,10 +367,10 @@ function ye(e, t, n, r, i, a) {
|
|
|
367
367
|
};
|
|
368
368
|
let c = r.items.slice(), l = [];
|
|
369
369
|
for (let e = 0; e < s; e += 1) l.push(e);
|
|
370
|
-
let u = a?.untilBottom, d = a?.throughIndex ?? s, f =
|
|
370
|
+
let u = a?.untilBottom, d = a?.throughIndex ?? s, f = _e(c.slice(0, s), o);
|
|
371
371
|
for (let t = s; t < e.length; t += 1) if (!i(t)) {
|
|
372
372
|
if (u !== void 0 && l.length > s && t > d && f.every((e) => e >= u)) break;
|
|
373
|
-
c[t] =
|
|
373
|
+
c[t] = ge(e[t], f, o), l.push(t);
|
|
374
374
|
}
|
|
375
375
|
let p = new Set(l);
|
|
376
376
|
for (let t = s; t < e.length; t += 1) i(t) || p.has(t) || (c[t] = {
|
|
@@ -382,17 +382,17 @@ function ye(e, t, n, r, i, a) {
|
|
|
382
382
|
return {
|
|
383
383
|
columns: o.columns,
|
|
384
384
|
fromIndex: s,
|
|
385
|
-
height:
|
|
385
|
+
height: ve(f, o.gap),
|
|
386
386
|
items: c,
|
|
387
387
|
retainedIndices: l
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
390
|
//#endregion
|
|
391
391
|
//#region src/core/masonryViewportIndex.ts
|
|
392
|
-
function
|
|
392
|
+
function Se(e) {
|
|
393
393
|
return { columns: [...e.entries()].sort(([e], [t]) => e - t).map(([, e]) => e.sort((e, t) => e.top - t.top || e.index - t.index)) };
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Ce(e, t, n) {
|
|
396
396
|
let r = e.get(t.x) ?? [];
|
|
397
397
|
r.push({
|
|
398
398
|
bottom: t.y + t.height,
|
|
@@ -400,14 +400,14 @@ function xe(e, t, n) {
|
|
|
400
400
|
top: t.y
|
|
401
401
|
}), e.set(t.x, r);
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function we(e, t) {
|
|
404
404
|
let n = /* @__PURE__ */ new Map();
|
|
405
405
|
return e.forEach((e, r) => {
|
|
406
|
-
|
|
407
|
-
}),
|
|
406
|
+
Ce(n, e, t?.[r] ?? r);
|
|
407
|
+
}), Se(n);
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
if (n <= 0) return
|
|
409
|
+
function Te(e, t, n, r) {
|
|
410
|
+
if (n <= 0) return we(e, r);
|
|
411
411
|
let i = /* @__PURE__ */ new Map();
|
|
412
412
|
t.columns.forEach((t) => {
|
|
413
413
|
t.forEach((t) => {
|
|
@@ -418,11 +418,11 @@ function Ce(e, t, n, r) {
|
|
|
418
418
|
a.push(t), i.set(r.x, a);
|
|
419
419
|
});
|
|
420
420
|
});
|
|
421
|
-
for (let t = n; t < e.length; t += 1)
|
|
422
|
-
return
|
|
421
|
+
for (let t = n; t < e.length; t += 1) Ce(i, e[t], r?.[t] ?? t);
|
|
422
|
+
return Se(i);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
if (r <= 0) return
|
|
424
|
+
function Ee(e, t, n, r) {
|
|
425
|
+
if (r <= 0) return we(t.map((t) => e[t]), t);
|
|
426
426
|
let i = /* @__PURE__ */ new Map();
|
|
427
427
|
return n.columns.forEach((t) => {
|
|
428
428
|
t.forEach((t) => {
|
|
@@ -433,10 +433,10 @@ function we(e, t, n, r) {
|
|
|
433
433
|
a.push(t), i.set(n.x, a);
|
|
434
434
|
});
|
|
435
435
|
}), t.forEach((t) => {
|
|
436
|
-
t < r ||
|
|
437
|
-
}),
|
|
436
|
+
t < r || Ce(i, e[t], t);
|
|
437
|
+
}), Se(i);
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function De(e, t) {
|
|
440
440
|
let n = 0, r = 0, i = e.length;
|
|
441
441
|
for (; r < i;) {
|
|
442
442
|
let a = Math.floor((r + i) / 2);
|
|
@@ -447,10 +447,10 @@ function Te(e, t) {
|
|
|
447
447
|
inspected: n
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Oe(e, t) {
|
|
451
451
|
let n = Math.max(0, t.overscan), r = t.scrollTop - n, i = t.scrollTop + Math.max(0, t.viewportHeight) + n, a = [], o = 0;
|
|
452
452
|
return e.columns.forEach((e) => {
|
|
453
|
-
let t =
|
|
453
|
+
let t = De(e, r);
|
|
454
454
|
o += t.inspected;
|
|
455
455
|
for (let n = t.index; n < e.length; n += 1) {
|
|
456
456
|
let t = e[n];
|
|
@@ -462,14 +462,14 @@ function Ee(e, t) {
|
|
|
462
462
|
inspected: o
|
|
463
463
|
};
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function ke(e) {
|
|
466
466
|
return e?.minColumnWidth ?? 240;
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function Ae(e, t) {
|
|
469
469
|
let n = e?.overscan?.minimumPx ?? 800, r = e?.overscan?.viewportMultiplier ?? 1.5, i = Math.max(n, t * r), a = e?.overscan?.maximumPx;
|
|
470
470
|
return a === void 0 ? i : Math.min(i, a);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function je(e) {
|
|
473
473
|
for (let t of ["bottomSpacePx", "loadMoreThresholdPx"]) {
|
|
474
474
|
let n = e?.[t];
|
|
475
475
|
if (n !== void 0 && (!Number.isFinite(n) || n < 0)) throw TypeError(`Vibe masonry ${t} must be a finite non-negative number.`);
|
|
@@ -487,10 +487,10 @@ function ke(e) {
|
|
|
487
487
|
}
|
|
488
488
|
//#endregion
|
|
489
489
|
//#region src/core/scrollbar.ts
|
|
490
|
-
function
|
|
490
|
+
function Me(e, t, n) {
|
|
491
491
|
return Math.min(n, Math.max(t, e));
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Ne({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize: r, viewportSize: i }) {
|
|
494
494
|
let a = Math.max(0, e), o = Math.max(0, r), s = Math.max(0, i), c = Math.max(0, a - s);
|
|
495
495
|
if (!(c > 0 && o > 0)) return {
|
|
496
496
|
maximumScrollPosition: c,
|
|
@@ -499,23 +499,23 @@ function je({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize:
|
|
|
499
499
|
thumbSize: o,
|
|
500
500
|
thumbTravel: 0
|
|
501
501
|
};
|
|
502
|
-
let l =
|
|
502
|
+
let l = Me(s / a * o, Math.min(Math.max(0, t), o), o), u = Math.max(0, o - l);
|
|
503
503
|
return {
|
|
504
504
|
maximumScrollPosition: c,
|
|
505
505
|
scrollable: !0,
|
|
506
|
-
thumbOffset: u * (
|
|
506
|
+
thumbOffset: u * (Me(n, 0, c) / c),
|
|
507
507
|
thumbSize: l,
|
|
508
508
|
thumbTravel: u
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
//#endregion
|
|
512
512
|
//#region src/components/GalleryScrollbar.vue?vue&type=script&setup=true&lang.ts
|
|
513
|
-
var
|
|
513
|
+
var Pe = ["aria-hidden"], Fe = [
|
|
514
514
|
"aria-controls",
|
|
515
515
|
"aria-valuemax",
|
|
516
516
|
"aria-valuenow",
|
|
517
517
|
"tabindex"
|
|
518
|
-
],
|
|
518
|
+
], Ie = 32, Le = 40, Re = 120, ze = /* @__PURE__ */ d({
|
|
519
519
|
__name: "GalleryScrollbar",
|
|
520
520
|
props: {
|
|
521
521
|
contentSize: {},
|
|
@@ -530,23 +530,23 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
530
530
|
thumbOffset: 0,
|
|
531
531
|
thumbSize: 0,
|
|
532
532
|
thumbTravel: 0
|
|
533
|
-
}, i =
|
|
533
|
+
}, i = E(null), a = E(n), o = E(!1), l = E(!1), u = E(!1), d = null, f = 0, p = 0, m = null, _ = null, b = null, S = null, C = !1, w = null, T = r(() => a.value.scrollable && !t.suspended), D = r(() => ({
|
|
534
534
|
height: `${a.value.thumbSize}px`,
|
|
535
535
|
transform: `translate3d(0, ${a.value.thumbOffset}px, 0)`
|
|
536
536
|
}));
|
|
537
|
-
function
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
},
|
|
537
|
+
function O() {
|
|
538
|
+
m !== null && clearTimeout(m), m = setTimeout(() => {
|
|
539
|
+
m = null, o.value || (l.value = !1);
|
|
540
|
+
}, Re);
|
|
541
541
|
}
|
|
542
|
-
function
|
|
543
|
-
l.value = !0,
|
|
542
|
+
function k() {
|
|
543
|
+
l.value = !0, O();
|
|
544
544
|
}
|
|
545
545
|
function j() {
|
|
546
546
|
let e = t.scrollElement, r = i.value;
|
|
547
|
-
return !e || !r ? n :
|
|
547
|
+
return !e || !r ? n : Ne({
|
|
548
548
|
contentSize: e.scrollHeight,
|
|
549
|
-
minimumThumbSize:
|
|
549
|
+
minimumThumbSize: Ie,
|
|
550
550
|
scrollPosition: e.scrollTop,
|
|
551
551
|
trackSize: r.clientHeight,
|
|
552
552
|
viewportSize: e.clientHeight
|
|
@@ -567,27 +567,27 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
567
567
|
};
|
|
568
568
|
return;
|
|
569
569
|
}
|
|
570
|
-
a.value = j(), !(u.value ||
|
|
571
|
-
|
|
570
|
+
a.value = j(), !(u.value || _ !== null) && (_ = requestAnimationFrame(() => {
|
|
571
|
+
_ = null, u.value = !0;
|
|
572
572
|
}));
|
|
573
573
|
}
|
|
574
574
|
function N() {
|
|
575
|
-
|
|
575
|
+
k(), M("scroll");
|
|
576
576
|
}
|
|
577
577
|
function P(e) {
|
|
578
578
|
let n = t.scrollElement;
|
|
579
579
|
n && (n.scrollTop = Math.min(a.value.maximumScrollPosition, Math.max(0, e)), M("scroll"));
|
|
580
580
|
}
|
|
581
581
|
function F(e) {
|
|
582
|
-
if (!
|
|
582
|
+
if (!T.value || e.target !== e.currentTarget) return;
|
|
583
583
|
let t = i.value;
|
|
584
584
|
if (!t || a.value.thumbTravel <= 0) return;
|
|
585
|
-
e.preventDefault(),
|
|
585
|
+
e.preventDefault(), k();
|
|
586
586
|
let n = e.clientY - t.getBoundingClientRect().top - a.value.thumbSize / 2;
|
|
587
587
|
P(Math.min(1, Math.max(0, n / a.value.thumbTravel)) * a.value.maximumScrollPosition);
|
|
588
588
|
}
|
|
589
589
|
function I(e) {
|
|
590
|
-
|
|
590
|
+
T.value && (e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture?.(e.pointerId), d = e.pointerId, f = e.clientY, p = t.scrollElement?.scrollTop ?? 0, o.value = !0, l.value = !0, m !== null && clearTimeout(m), m = null);
|
|
591
591
|
}
|
|
592
592
|
function L(e) {
|
|
593
593
|
if (!o.value || e.pointerId !== d || (e.preventDefault(), a.value.thumbTravel <= 0)) return;
|
|
@@ -595,12 +595,12 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
595
595
|
P(p + t);
|
|
596
596
|
}
|
|
597
597
|
function R(e) {
|
|
598
|
-
!o.value || e.pointerId !== d || (e.currentTarget.releasePointerCapture?.(e.pointerId), d = null, o.value = !1, C && (C = !1, M("content")),
|
|
598
|
+
!o.value || e.pointerId !== d || (e.currentTarget.releasePointerCapture?.(e.pointerId), d = null, o.value = !1, C && (C = !1, M("content")), O());
|
|
599
599
|
}
|
|
600
600
|
function z(e) {
|
|
601
|
-
if (!
|
|
602
|
-
let n = t.scrollElement?.clientHeight ?? 0, r = t.scrollElement?.scrollTop ?? 0, i = e.key === "ArrowUp" ? r -
|
|
603
|
-
i !== null && (e.preventDefault(),
|
|
601
|
+
if (!T.value) return;
|
|
602
|
+
let n = t.scrollElement?.clientHeight ?? 0, r = t.scrollElement?.scrollTop ?? 0, i = e.key === "ArrowUp" ? r - Le : e.key === "ArrowDown" ? r + Le : e.key === "PageUp" ? r - n : e.key === "PageDown" ? r + n : e.key === "Home" ? 0 : e.key === "End" ? a.value.maximumScrollPosition : null;
|
|
603
|
+
i !== null && (e.preventDefault(), k(), P(i));
|
|
604
604
|
}
|
|
605
605
|
function B(e) {
|
|
606
606
|
if (S?.disconnect(), !(typeof ResizeObserver > "u")) {
|
|
@@ -608,26 +608,26 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
608
608
|
for (let t of e.children) S.observe(t);
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
return
|
|
612
|
-
t?.removeEventListener("scroll", N),
|
|
613
|
-
|
|
614
|
-
}),
|
|
611
|
+
return A(() => t.scrollElement, (e, t) => {
|
|
612
|
+
t?.removeEventListener("scroll", N), b?.disconnect(), b = null, S?.disconnect(), S = null, w?.disconnect(), w = null, e?.addEventListener("scroll", N, { passive: !0 }), e && typeof ResizeObserver < "u" && (w = new ResizeObserver(() => {
|
|
613
|
+
k(), M("resize");
|
|
614
|
+
}), w.observe(e), B(e)), e && typeof MutationObserver < "u" && (b = new MutationObserver(() => {
|
|
615
615
|
B(e), M("content");
|
|
616
|
-
}),
|
|
617
|
-
}, { immediate: !0 }),
|
|
618
|
-
|
|
619
|
-
}),
|
|
620
|
-
t.scrollElement?.removeEventListener("scroll", N),
|
|
621
|
-
}), (t, n) => (
|
|
616
|
+
}), b.observe(e, { childList: !0 })), h(() => M("resize"));
|
|
617
|
+
}, { immediate: !0 }), A(() => t.contentSize, () => {
|
|
618
|
+
h(() => M("content"));
|
|
619
|
+
}), y(() => {
|
|
620
|
+
t.scrollElement?.removeEventListener("scroll", N), b?.disconnect(), S?.disconnect(), w?.disconnect(), m !== null && clearTimeout(m), _ !== null && cancelAnimationFrame(_);
|
|
621
|
+
}), (t, n) => (x(), s("div", {
|
|
622
622
|
ref_key: "trackElement",
|
|
623
623
|
ref: i,
|
|
624
|
-
class:
|
|
624
|
+
class: g(["gallery-scrollbar", {
|
|
625
625
|
"gallery-scrollbar--dragging": o.value,
|
|
626
626
|
"gallery-scrollbar--interacting": l.value,
|
|
627
627
|
"gallery-scrollbar--ready": u.value,
|
|
628
|
-
"gallery-scrollbar--visible":
|
|
628
|
+
"gallery-scrollbar--visible": T.value
|
|
629
629
|
}]),
|
|
630
|
-
"aria-hidden": !
|
|
630
|
+
"aria-hidden": !T.value || void 0,
|
|
631
631
|
onPointerdown: F
|
|
632
632
|
}, [c("div", {
|
|
633
633
|
class: "gallery-scrollbar-thumb",
|
|
@@ -638,22 +638,22 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
638
638
|
"aria-valuemin": "0",
|
|
639
639
|
"aria-valuenow": Math.round(e.scrollElement?.scrollTop ?? 0),
|
|
640
640
|
role: "scrollbar",
|
|
641
|
-
style:
|
|
642
|
-
tabindex:
|
|
641
|
+
style: v(D.value),
|
|
642
|
+
tabindex: T.value ? 0 : -1,
|
|
643
643
|
onKeydown: z,
|
|
644
644
|
onPointercancel: R,
|
|
645
645
|
onPointerdown: I,
|
|
646
646
|
onPointermove: L,
|
|
647
647
|
onPointerup: R
|
|
648
|
-
}, null, 44,
|
|
648
|
+
}, null, 44, Fe)], 42, Pe));
|
|
649
649
|
}
|
|
650
|
-
}),
|
|
650
|
+
}), Be = (e) => {
|
|
651
651
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
652
652
|
return !1;
|
|
653
|
-
},
|
|
654
|
-
let t =
|
|
653
|
+
}, Ve = (e) => e === "", He = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), Ue = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), We = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), Ge = (e) => {
|
|
654
|
+
let t = We(e);
|
|
655
655
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
656
|
-
},
|
|
656
|
+
}, Ke = {
|
|
657
657
|
xmlns: "http://www.w3.org/2000/svg",
|
|
658
658
|
width: 24,
|
|
659
659
|
height: 24,
|
|
@@ -663,27 +663,27 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
663
663
|
"stroke-width": 2,
|
|
664
664
|
"stroke-linecap": "round",
|
|
665
665
|
"stroke-linejoin": "round"
|
|
666
|
-
},
|
|
667
|
-
...
|
|
666
|
+
}, qe = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = Ke.width, color: s = Ke.stroke, ...c }, { slots: l }) => p("svg", {
|
|
667
|
+
...Ke,
|
|
668
668
|
...c,
|
|
669
669
|
width: o,
|
|
670
670
|
height: o,
|
|
671
671
|
stroke: s,
|
|
672
|
-
"stroke-width":
|
|
673
|
-
class:
|
|
674
|
-
...!l.default && !
|
|
675
|
-
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]),
|
|
672
|
+
"stroke-width": Ve(n) || Ve(r) || n === !0 || r === !0 ? Number(i || a || Ke["stroke-width"]) * 24 / Number(o) : i || a || Ke["stroke-width"],
|
|
673
|
+
class: He("lucide", c.class, ...e ? [`lucide-${Ue(Ge(e))}-icon`, `lucide-${Ue(e)}`] : ["lucide-icon"]),
|
|
674
|
+
...!l.default && !Be(c) && { "aria-hidden": "true" }
|
|
675
|
+
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), Je = (e, t) => (n, { slots: r, attrs: i }) => p(qe, {
|
|
676
676
|
...i,
|
|
677
677
|
...n,
|
|
678
678
|
iconNode: t,
|
|
679
679
|
name: e
|
|
680
|
-
}, r),
|
|
680
|
+
}, r), Ye = Je("chevron-left", [["path", {
|
|
681
681
|
d: "m15 18-6-6 6-6",
|
|
682
682
|
key: "1wnfg3"
|
|
683
|
-
}]]),
|
|
683
|
+
}]]), Xe = Je("chevron-right", [["path", {
|
|
684
684
|
d: "m9 18 6-6-6-6",
|
|
685
685
|
key: "mthhwq"
|
|
686
|
-
}]]),
|
|
686
|
+
}]]), Ze = Je("disc-3", [
|
|
687
687
|
["circle", {
|
|
688
688
|
cx: "12",
|
|
689
689
|
cy: "12",
|
|
@@ -704,7 +704,7 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
704
704
|
d: "M18 12c0 1.7-.7 3.2-1.8 4.2",
|
|
705
705
|
key: "1eah9h"
|
|
706
706
|
}]
|
|
707
|
-
]),
|
|
707
|
+
]), Qe = Je("pause", [["rect", {
|
|
708
708
|
x: "14",
|
|
709
709
|
y: "3",
|
|
710
710
|
width: "5",
|
|
@@ -718,10 +718,10 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
718
718
|
height: "18",
|
|
719
719
|
rx: "1",
|
|
720
720
|
key: "1wsw3u"
|
|
721
|
-
}]]),
|
|
721
|
+
}]]), $e = Je("play", [["path", {
|
|
722
722
|
d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
|
|
723
723
|
key: "10ikf1"
|
|
724
|
-
}]]),
|
|
724
|
+
}]]), et = Je("volume-2", [
|
|
725
725
|
["path", {
|
|
726
726
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
727
727
|
key: "uqj9uw"
|
|
@@ -734,7 +734,7 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
734
734
|
d: "M19.364 18.364a9 9 0 0 0 0-12.728",
|
|
735
735
|
key: "ijwkga"
|
|
736
736
|
}]
|
|
737
|
-
]),
|
|
737
|
+
]), tt = Je("volume-x", [
|
|
738
738
|
["path", {
|
|
739
739
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
740
740
|
key: "uqj9uw"
|
|
@@ -753,22 +753,22 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
753
753
|
y2: "15",
|
|
754
754
|
key: "5ykzw1"
|
|
755
755
|
}]
|
|
756
|
-
]),
|
|
756
|
+
]), nt = {
|
|
757
757
|
401: "Authentication required",
|
|
758
758
|
403: "Access forbidden",
|
|
759
759
|
404: "Preview not found",
|
|
760
760
|
419: "Session expired",
|
|
761
761
|
500: "Server error"
|
|
762
762
|
};
|
|
763
|
-
function
|
|
763
|
+
function rt(e) {
|
|
764
764
|
return e.match(/\/demo-errors\/(401|403|404|419|500)\//)?.[1] ?? "Error";
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
return
|
|
766
|
+
function it(e) {
|
|
767
|
+
return nt[rt(e)] ?? "Preview unavailable";
|
|
768
768
|
}
|
|
769
769
|
//#endregion
|
|
770
770
|
//#region src/components/CardRegion.vue
|
|
771
|
-
var
|
|
771
|
+
var at = /* @__PURE__ */ d({
|
|
772
772
|
__name: "CardRegion",
|
|
773
773
|
props: {
|
|
774
774
|
index: {},
|
|
@@ -783,17 +783,17 @@ var rt = /* @__PURE__ */ d({
|
|
|
783
783
|
total: {}
|
|
784
784
|
},
|
|
785
785
|
setup(e) {
|
|
786
|
-
let t = e, n = r(() =>
|
|
786
|
+
let t = e, n = r(() => G(t.item, t.mediaIndex)), i = r(() => W(t.item)), o = r(() => K(t.item, n.value)), c = r(() => ({
|
|
787
787
|
height: `${t.region.height}px`,
|
|
788
788
|
paddingBlock: t.style?.paddingY === void 0 ? void 0 : `${t.style.paddingY}px`,
|
|
789
789
|
paddingInline: t.style?.paddingX === void 0 ? void 0 : `${t.style.paddingX}px`
|
|
790
790
|
})), l = r(() => t.style?.background ?? t.region.background);
|
|
791
|
-
return (t, r) => (
|
|
792
|
-
class:
|
|
793
|
-
style:
|
|
794
|
-
onClick: r[0] ||=
|
|
795
|
-
onKeydown: r[1] ||=
|
|
796
|
-
}, [(
|
|
791
|
+
return (t, r) => (x(), s("div", {
|
|
792
|
+
class: g(["media-card-region", [`media-card-${e.placement}`, { "media-card-region--transparent": l.value === "transparent" }]]),
|
|
793
|
+
style: v(c.value),
|
|
794
|
+
onClick: r[0] ||= N(() => {}, ["stop"]),
|
|
795
|
+
onKeydown: r[1] ||= N(() => {}, ["stop"])
|
|
796
|
+
}, [(x(), a(T(e.region.component), {
|
|
797
797
|
index: e.index,
|
|
798
798
|
item: e.item,
|
|
799
799
|
layout: e.layout,
|
|
@@ -815,7 +815,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
815
815
|
"total"
|
|
816
816
|
]))], 38));
|
|
817
817
|
}
|
|
818
|
-
}),
|
|
818
|
+
}), ot = ["aria-busy", "aria-label"], st = { class: "media-error-code" }, ct = ["disabled"], lt = /* @__PURE__ */ d({
|
|
819
819
|
__name: "MediaError",
|
|
820
820
|
props: {
|
|
821
821
|
component: {},
|
|
@@ -829,18 +829,18 @@ var rt = /* @__PURE__ */ d({
|
|
|
829
829
|
function o() {
|
|
830
830
|
r.retrying || i("retry");
|
|
831
831
|
}
|
|
832
|
-
return (n, r) => (
|
|
832
|
+
return (n, r) => (x(), s("div", {
|
|
833
833
|
"data-test": "media-error",
|
|
834
834
|
class: "media-error",
|
|
835
835
|
role: "group",
|
|
836
836
|
"aria-busy": t.retrying,
|
|
837
837
|
"aria-label": `${t.status} ${t.label}`
|
|
838
|
-
}, [t.component ? (
|
|
838
|
+
}, [t.component ? (x(), s("div", {
|
|
839
839
|
key: 0,
|
|
840
840
|
class: "media-error-component",
|
|
841
|
-
onClick: r[0] ||=
|
|
842
|
-
onKeydown: r[1] ||=
|
|
843
|
-
}, [(
|
|
841
|
+
onClick: r[0] ||= N(() => {}, ["stop"]),
|
|
842
|
+
onKeydown: r[1] ||= N(() => {}, ["stop"])
|
|
843
|
+
}, [(x(), a(T(t.component), {
|
|
844
844
|
label: t.label,
|
|
845
845
|
retry: o,
|
|
846
846
|
retrying: t.retrying,
|
|
@@ -849,36 +849,36 @@ var rt = /* @__PURE__ */ d({
|
|
|
849
849
|
"label",
|
|
850
850
|
"retrying",
|
|
851
851
|
"status"
|
|
852
|
-
]))], 32)) : (
|
|
853
|
-
c("strong",
|
|
854
|
-
c("span", null,
|
|
852
|
+
]))], 32)) : (x(), s(e, { key: 1 }, [
|
|
853
|
+
c("strong", st, D(t.status), 1),
|
|
854
|
+
c("span", null, D(t.label), 1),
|
|
855
855
|
c("button", {
|
|
856
856
|
"data-test": "media-retry",
|
|
857
857
|
class: "media-error-retry",
|
|
858
858
|
type: "button",
|
|
859
859
|
disabled: t.retrying,
|
|
860
|
-
onClick:
|
|
861
|
-
onKeydown: r[2] ||=
|
|
862
|
-
},
|
|
863
|
-
], 64))], 8,
|
|
860
|
+
onClick: N(o, ["stop"]),
|
|
861
|
+
onKeydown: r[2] ||= N(() => {}, ["stop"])
|
|
862
|
+
}, D(t.retrying ? "Retrying…" : "Retry"), 41, ct)
|
|
863
|
+
], 64))], 8, ot));
|
|
864
864
|
}
|
|
865
|
-
}),
|
|
865
|
+
}), ut = ["aria-label"], dt = [
|
|
866
866
|
"max",
|
|
867
867
|
"value",
|
|
868
868
|
"aria-label",
|
|
869
869
|
"aria-valuetext",
|
|
870
870
|
"disabled"
|
|
871
|
-
],
|
|
871
|
+
], ft = {
|
|
872
872
|
key: 0,
|
|
873
873
|
class: "media-controls-row"
|
|
874
|
-
},
|
|
874
|
+
}, pt = ["aria-label", "title"], mt = { class: "media-controls-audio" }, ht = ["aria-label", "title"], gt = [
|
|
875
875
|
"value",
|
|
876
876
|
"aria-label",
|
|
877
877
|
"aria-valuetext"
|
|
878
|
-
],
|
|
878
|
+
], _t = {
|
|
879
879
|
class: "media-control-time",
|
|
880
880
|
"aria-live": "off"
|
|
881
|
-
},
|
|
881
|
+
}, vt = /* @__PURE__ */ d({
|
|
882
882
|
__name: "MediaControls",
|
|
883
883
|
props: {
|
|
884
884
|
currentTime: {},
|
|
@@ -910,75 +910,75 @@ var rt = /* @__PURE__ */ d({
|
|
|
910
910
|
function f(e) {
|
|
911
911
|
e.key !== "Escape" && e.stopPropagation();
|
|
912
912
|
}
|
|
913
|
-
let p = r(() => Math.max(0, n.duration)), m = r(() => n.mediaType === "audio" ? "audio" : "video"),
|
|
914
|
-
return (t, n) => (
|
|
915
|
-
class:
|
|
913
|
+
let p = r(() => Math.max(0, n.duration)), m = r(() => n.mediaType === "audio" ? "audio" : "video"), h = r(() => n.mediaType === "audio" ? "Audio" : "Video"), _ = r(() => l(n.currentTime, p.value)), y = r(() => ({ "--media-range-progress": `${p.value > 0 ? _.value / p.value * 100 : 0}%` })), b = r(() => ({ "--media-range-progress": `${l(n.volume) * 100}%` }));
|
|
914
|
+
return (t, n) => (x(), s("div", {
|
|
915
|
+
class: g(["media-controls", `media-controls--${e.layout}`]),
|
|
916
916
|
role: "group",
|
|
917
|
-
"aria-label": `${
|
|
918
|
-
onClick: n[4] ||=
|
|
919
|
-
onDblclick: n[5] ||=
|
|
917
|
+
"aria-label": `${h.value} controls`,
|
|
918
|
+
onClick: n[4] ||= N(() => {}, ["stop"]),
|
|
919
|
+
onDblclick: n[5] ||= N(() => {}, ["stop"]),
|
|
920
920
|
onKeydown: f,
|
|
921
|
-
onWheel: n[6] ||=
|
|
921
|
+
onWheel: n[6] ||= N(() => {}, ["stop"])
|
|
922
922
|
}, [c("input", {
|
|
923
923
|
class: "media-control-range media-control-seek",
|
|
924
924
|
type: "range",
|
|
925
925
|
min: "0",
|
|
926
926
|
max: p.value || 0,
|
|
927
927
|
step: "0.1",
|
|
928
|
-
value:
|
|
929
|
-
style:
|
|
928
|
+
value: _.value,
|
|
929
|
+
style: v(y.value),
|
|
930
930
|
"aria-label": `Seek ${m.value}`,
|
|
931
|
-
"aria-valuetext": `${u(
|
|
931
|
+
"aria-valuetext": `${u(_.value)} of ${u(p.value)}`,
|
|
932
932
|
disabled: p.value <= 0,
|
|
933
933
|
onInput: n[0] ||= (e) => i("seek", d(e))
|
|
934
|
-
}, null, 44,
|
|
934
|
+
}, null, 44, dt), e.layout === "reel" ? (x(), s("div", ft, [
|
|
935
935
|
c("button", {
|
|
936
936
|
type: "button",
|
|
937
937
|
class: "media-control-button media-control-playback",
|
|
938
938
|
"aria-label": e.playing ? `Pause ${m.value}` : `Play ${m.value}`,
|
|
939
939
|
title: e.playing ? "Pause" : "Play",
|
|
940
940
|
onClick: n[1] ||= (e) => i("togglePlayback")
|
|
941
|
-
}, [e.playing ? (
|
|
941
|
+
}, [e.playing ? (x(), a(O(Qe), {
|
|
942
942
|
key: 0,
|
|
943
943
|
size: 18,
|
|
944
944
|
fill: "currentColor"
|
|
945
|
-
})) : (
|
|
945
|
+
})) : (x(), a(O($e), {
|
|
946
946
|
key: 1,
|
|
947
947
|
size: 18,
|
|
948
948
|
fill: "currentColor"
|
|
949
|
-
}))], 8,
|
|
950
|
-
c("div",
|
|
949
|
+
}))], 8, pt),
|
|
950
|
+
c("div", mt, [c("button", {
|
|
951
951
|
type: "button",
|
|
952
952
|
class: "media-control-button",
|
|
953
953
|
"aria-label": e.muted ? `Unmute ${m.value}` : `Mute ${m.value}`,
|
|
954
954
|
title: e.muted ? "Unmute" : "Mute",
|
|
955
955
|
onClick: n[2] ||= (e) => i("toggleMute")
|
|
956
|
-
}, [e.muted || e.volume === 0 ? (
|
|
956
|
+
}, [e.muted || e.volume === 0 ? (x(), a(O(tt), {
|
|
957
957
|
key: 0,
|
|
958
958
|
size: 18
|
|
959
|
-
})) : (
|
|
959
|
+
})) : (x(), a(O(et), {
|
|
960
960
|
key: 1,
|
|
961
961
|
size: 18
|
|
962
|
-
}))], 8,
|
|
962
|
+
}))], 8, ht), c("input", {
|
|
963
963
|
class: "media-control-range media-control-volume",
|
|
964
964
|
type: "range",
|
|
965
965
|
min: "0",
|
|
966
966
|
max: "1",
|
|
967
967
|
step: "0.05",
|
|
968
968
|
value: e.volume,
|
|
969
|
-
style:
|
|
970
|
-
"aria-label": `${
|
|
969
|
+
style: v(b.value),
|
|
970
|
+
"aria-label": `${h.value} volume`,
|
|
971
971
|
"aria-valuetext": `${Math.round(e.volume * 100)} percent`,
|
|
972
972
|
onInput: n[3] ||= (e) => i("volumeChange", d(e))
|
|
973
|
-
}, null, 44,
|
|
974
|
-
c("output",
|
|
975
|
-
])) : o("", !0)], 42,
|
|
973
|
+
}, null, 44, gt)]),
|
|
974
|
+
c("output", _t, D(u(_.value)) + " / " + D(u(p.value)), 1)
|
|
975
|
+
])) : o("", !0)], 42, ut));
|
|
976
976
|
}
|
|
977
|
-
}),
|
|
977
|
+
}), yt = {
|
|
978
978
|
key: 0,
|
|
979
979
|
class: "media-card-overlay-host",
|
|
980
980
|
"data-test": "media-card-overlay"
|
|
981
|
-
},
|
|
981
|
+
}, bt = /* @__PURE__ */ d({
|
|
982
982
|
__name: "MediaContextOverlay",
|
|
983
983
|
props: {
|
|
984
984
|
item: {},
|
|
@@ -988,7 +988,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
988
988
|
mediaSource: {}
|
|
989
989
|
},
|
|
990
990
|
setup(e) {
|
|
991
|
-
return (t, n) => e.mediaCard?.overlay?.component ? (
|
|
991
|
+
return (t, n) => e.mediaCard?.overlay?.component ? (x(), s("div", yt, [(x(), a(T(e.mediaCard.overlay.component), {
|
|
992
992
|
item: e.item,
|
|
993
993
|
"media-index": e.mediaIndex,
|
|
994
994
|
"media-item": e.mediaItem,
|
|
@@ -1000,26 +1000,26 @@ var rt = /* @__PURE__ */ d({
|
|
|
1000
1000
|
"media-source"
|
|
1001
1001
|
]))])) : o("", !0);
|
|
1002
1002
|
}
|
|
1003
|
-
}),
|
|
1004
|
-
function
|
|
1005
|
-
let t =
|
|
1003
|
+
}), xt = 40, St = 160, Ct = 24;
|
|
1004
|
+
function wt(e) {
|
|
1005
|
+
let t = E("next"), n = null, r = 0, i = !1, a = null, o = null;
|
|
1006
1006
|
function s(n, r) {
|
|
1007
|
-
let i =
|
|
1007
|
+
let i = W(e.item()).length, a = (n + i) % i;
|
|
1008
1008
|
a !== e.mediaIndex() && (t.value = n < e.mediaIndex() ? "previous" : "next", e.onChange(a), r?.detail && r.detail > 0 && r.currentTarget?.blur());
|
|
1009
1009
|
}
|
|
1010
1010
|
function c() {
|
|
1011
1011
|
r = 0, i = !1, n !== null && clearTimeout(n), n = null;
|
|
1012
1012
|
}
|
|
1013
1013
|
function l() {
|
|
1014
|
-
n !== null && clearTimeout(n), n = setTimeout(c,
|
|
1014
|
+
n !== null && clearTimeout(n), n = setTimeout(c, St);
|
|
1015
1015
|
}
|
|
1016
1016
|
function u(e, t, n) {
|
|
1017
1017
|
return t === 1 ? e * 16 : t === 2 ? e * n : e;
|
|
1018
1018
|
}
|
|
1019
1019
|
function d(t) {
|
|
1020
|
-
if (
|
|
1020
|
+
if (W(e.item()).length <= 1) return;
|
|
1021
1021
|
let n = t.currentTarget, a = u(t.deltaX, t.deltaMode, n?.clientWidth || 1);
|
|
1022
|
-
if (a === 0 || (t.preventDefault(), l(), i) || (r += a, Math.abs(r) <
|
|
1022
|
+
if (a === 0 || (t.preventDefault(), l(), i) || (r += a, Math.abs(r) < Ct)) return;
|
|
1023
1023
|
let o = Math.sign(r);
|
|
1024
1024
|
r = 0, i = !0, s(e.mediaIndex() + o);
|
|
1025
1025
|
}
|
|
@@ -1031,9 +1031,9 @@ function St(e) {
|
|
|
1031
1031
|
let n = t.changedTouches[0];
|
|
1032
1032
|
if (a === null || o === null || !n) return;
|
|
1033
1033
|
let r = a - n.clientX, i = o - n.clientY;
|
|
1034
|
-
a = null, o = null, !(Math.abs(r) <= Math.abs(i)) && (Math.abs(r) <
|
|
1034
|
+
a = null, o = null, !(Math.abs(r) <= Math.abs(i)) && (Math.abs(r) < xt || s(e.mediaIndex() + Math.sign(r)));
|
|
1035
1035
|
}
|
|
1036
|
-
return
|
|
1036
|
+
return y(c), {
|
|
1037
1037
|
change: s,
|
|
1038
1038
|
direction: t,
|
|
1039
1039
|
onTouchEnd: p,
|
|
@@ -1041,14 +1041,14 @@ function St(e) {
|
|
|
1041
1041
|
onWheel: d
|
|
1042
1042
|
};
|
|
1043
1043
|
}
|
|
1044
|
-
var
|
|
1045
|
-
function
|
|
1044
|
+
var Tt = /* @__PURE__ */ new Map(), Et = [], Dt = 0, Ot = 0;
|
|
1045
|
+
function kt(e, t) {
|
|
1046
1046
|
return `${t ? "timed" : "image"}:${e}`;
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1049
|
-
let r =
|
|
1048
|
+
function At(e, t, n) {
|
|
1049
|
+
let r = W(e);
|
|
1050
1050
|
if (r.length < 2) return [];
|
|
1051
|
-
let i =
|
|
1051
|
+
let i = G(e, t), a = [];
|
|
1052
1052
|
for (let e = 1; e < r.length; e += 1) {
|
|
1053
1053
|
let t = i + e, n = i - e;
|
|
1054
1054
|
t < r.length && a.push(t), n >= 0 && a.push(n);
|
|
@@ -1057,9 +1057,9 @@ function Ot(e, t, n) {
|
|
|
1057
1057
|
return a.flatMap((e) => {
|
|
1058
1058
|
let t = r[e];
|
|
1059
1059
|
if (!t) return [];
|
|
1060
|
-
let i =
|
|
1060
|
+
let i = R(t.type, t.src) === "audio" ? H(t) : V(t, n);
|
|
1061
1061
|
if (!i) return [];
|
|
1062
|
-
let a =
|
|
1062
|
+
let a = z(i.type, i.src), s = kt(i.src, a);
|
|
1063
1063
|
return o.has(s) ? [] : (o.add(s), [{
|
|
1064
1064
|
key: s,
|
|
1065
1065
|
src: i.src,
|
|
@@ -1067,22 +1067,22 @@ function Ot(e, t, n) {
|
|
|
1067
1067
|
}]);
|
|
1068
1068
|
});
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function jt(e) {
|
|
1071
1071
|
let t = e.element;
|
|
1072
1072
|
e.element = null, t && (t instanceof HTMLVideoElement ? (t.pause(), t.removeAttribute("src"), t.load()) : t.removeAttribute("src"));
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1075
|
-
|
|
1076
|
-
let t =
|
|
1077
|
-
t >= 0 &&
|
|
1074
|
+
function Mt(e) {
|
|
1075
|
+
Tt.delete(e.key);
|
|
1076
|
+
let t = Et.indexOf(e);
|
|
1077
|
+
t >= 0 && Et.splice(t, 1), e.cancel?.(), e.cancel = null, jt(e);
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1080
|
-
e.state = "loading",
|
|
1079
|
+
function Nt(e) {
|
|
1080
|
+
e.state = "loading", Dt += 1, e.timed && (Ot += 1);
|
|
1081
1081
|
let t = !1, n = () => void 0, r = (r) => {
|
|
1082
|
-
t || (t = !0, n(), --
|
|
1082
|
+
t || (t = !0, n(), --Dt, e.timed && --Ot, e.cancel = null, e.state = r, r === "failed" && jt(e), e.refs === 0 && Mt(e), Pt());
|
|
1083
1083
|
};
|
|
1084
1084
|
if (e.cancel = () => {
|
|
1085
|
-
t || (t = !0, n(), --
|
|
1085
|
+
t || (t = !0, n(), --Dt, e.timed && --Ot, jt(e), Pt());
|
|
1086
1086
|
}, e.timed) {
|
|
1087
1087
|
let t = document.createElement("video"), i = () => r("ready"), a = () => r("failed");
|
|
1088
1088
|
n = () => {
|
|
@@ -1101,50 +1101,50 @@ function jt(e) {
|
|
|
1101
1101
|
i.removeEventListener("load", a), i.removeEventListener("error", o);
|
|
1102
1102
|
}, i.addEventListener("load", a, { once: !0 }), i.addEventListener("error", o, { once: !0 }), i.decoding = "async", i.fetchPriority = "low", i.src = e.src, e.element = i;
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1105
|
-
for (;
|
|
1106
|
-
let e =
|
|
1104
|
+
function Pt() {
|
|
1105
|
+
for (; Dt < 6;) {
|
|
1106
|
+
let e = Et.findIndex((e) => e.refs > 0 && e.state === "queued" && (!e.timed || Ot < 2));
|
|
1107
1107
|
if (e < 0) return;
|
|
1108
|
-
let [t] =
|
|
1109
|
-
t &&
|
|
1108
|
+
let [t] = Et.splice(e, 1);
|
|
1109
|
+
t && Nt(t);
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1113
|
-
let t =
|
|
1112
|
+
function Ft(e) {
|
|
1113
|
+
let t = Tt.get(e.key);
|
|
1114
1114
|
t || (t = {
|
|
1115
1115
|
...e,
|
|
1116
1116
|
cancel: null,
|
|
1117
1117
|
element: null,
|
|
1118
1118
|
refs: 0,
|
|
1119
1119
|
state: "queued"
|
|
1120
|
-
},
|
|
1120
|
+
}, Tt.set(t.key, t), Et.push(t)), t.refs += 1, Pt();
|
|
1121
1121
|
let n = !1;
|
|
1122
1122
|
return () => {
|
|
1123
|
-
n || (n = !0, --t.refs, t.refs === 0 &&
|
|
1123
|
+
n || (n = !0, --t.refs, t.refs === 0 && Mt(t));
|
|
1124
1124
|
};
|
|
1125
1125
|
}
|
|
1126
1126
|
//#endregion
|
|
1127
1127
|
//#region src/components/useVisiblePostPreload.ts
|
|
1128
|
-
function
|
|
1129
|
-
let t = r(() => e.layout() === "masonry" && e.inViewport() && e.mediaReady() && e.mediaCard()?.feedPreload === "visible-post"), n = r(() => t.value ?
|
|
1128
|
+
function It(e) {
|
|
1129
|
+
let t = r(() => e.layout() === "masonry" && e.inViewport() && e.mediaReady() && e.mediaCard()?.feedPreload === "visible-post"), n = r(() => t.value ? At(e.item(), e.mediaIndex(), e.mediaSource()) : []), i = /* @__PURE__ */ new Map();
|
|
1130
1130
|
function a() {
|
|
1131
1131
|
let e = new Map(n.value.map((e) => [e.key, e]));
|
|
1132
1132
|
i.forEach((t, n) => {
|
|
1133
1133
|
e.has(n) || (t(), i.delete(n));
|
|
1134
1134
|
}), n.value.forEach((e) => {
|
|
1135
|
-
i.has(e.key) || i.set(e.key,
|
|
1135
|
+
i.has(e.key) || i.set(e.key, Ft(e));
|
|
1136
1136
|
});
|
|
1137
1137
|
}
|
|
1138
|
-
|
|
1138
|
+
A(() => n.value.map(({ key: e }) => e).join("\n"), a, { immediate: !0 }), y(() => {
|
|
1139
1139
|
i.forEach((e) => e()), i.clear();
|
|
1140
1140
|
});
|
|
1141
1141
|
}
|
|
1142
1142
|
//#endregion
|
|
1143
1143
|
//#region src/components/useMediaLoading.ts
|
|
1144
|
-
function
|
|
1145
|
-
let t = r(() =>
|
|
1146
|
-
return
|
|
1147
|
-
n !== "none" || t === "none" ||
|
|
1144
|
+
function Lt(e) {
|
|
1145
|
+
let t = r(() => z(e.mediaType(), e.mediaSource())), n = r(() => e.layout() === "masonry" && e.fetchPriority() === "low" ? "lazy" : "eager"), i = r(() => e.layout() === "reel" && !e.active() ? "none" : e.fetchPriority() === "high" ? "auto" : e.layout() === "masonry" ? "none" : "metadata");
|
|
1146
|
+
return A(i, (t, n) => {
|
|
1147
|
+
n !== "none" || t === "none" || h(() => {
|
|
1148
1148
|
let t = e.mediaElement.value;
|
|
1149
1149
|
!t || e.playbackAllowed() || i.value === "none" || t.load();
|
|
1150
1150
|
});
|
|
@@ -1156,58 +1156,58 @@ function Ft(e) {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
//#endregion
|
|
1158
1158
|
//#region src/components/useMediaReadiness.ts
|
|
1159
|
-
function
|
|
1160
|
-
let t =
|
|
1161
|
-
function
|
|
1159
|
+
function Rt(e) {
|
|
1160
|
+
let t = E(null), n = E(null), i = E(0), a = E(0), o = E(!0), s = E(!1), c = E(!1), l = null, u = !1, d = !1, f = !1, p = r(() => c.value || s.value ? "error" : o.value ? "loading" : e.previewState());
|
|
1161
|
+
function m() {
|
|
1162
1162
|
l !== null && clearTimeout(l), l = null;
|
|
1163
1163
|
}
|
|
1164
1164
|
function g(e) {
|
|
1165
1165
|
return Number(e.currentTarget.dataset.sourceGeneration) === i.value;
|
|
1166
1166
|
}
|
|
1167
1167
|
function _() {
|
|
1168
|
-
|
|
1168
|
+
m(), l = setTimeout(() => x(), 15e3);
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1171
|
-
t && !g(t) || (
|
|
1170
|
+
function v(t) {
|
|
1171
|
+
t && !g(t) || (m(), o.value = !1, s.value = !1, c.value = !1, e.onReady(e.mediaIndex()));
|
|
1172
1172
|
}
|
|
1173
1173
|
function b() {
|
|
1174
1174
|
if (f) return;
|
|
1175
1175
|
let e = t.value;
|
|
1176
1176
|
if (e?.complete) {
|
|
1177
|
-
e.naturalWidth > 0 ?
|
|
1177
|
+
e.naturalWidth > 0 ? v() : x(void 0, !0);
|
|
1178
1178
|
return;
|
|
1179
1179
|
}
|
|
1180
1180
|
let r = n.value;
|
|
1181
1181
|
if (r && r.readyState >= HTMLMediaElement.HAVE_METADATA) {
|
|
1182
|
-
|
|
1182
|
+
v();
|
|
1183
1183
|
return;
|
|
1184
1184
|
}
|
|
1185
1185
|
_();
|
|
1186
1186
|
}
|
|
1187
1187
|
function x(t, n = !1) {
|
|
1188
1188
|
if (!f && !(t && !g(t)) && !(s.value && !c.value && (!t || d))) {
|
|
1189
|
-
if (
|
|
1190
|
-
a.value = 1, i.value += 1, o.value = !0,
|
|
1189
|
+
if (m(), !t && a.value === 0) {
|
|
1190
|
+
a.value = 1, i.value += 1, o.value = !0, h(b);
|
|
1191
1191
|
return;
|
|
1192
1192
|
}
|
|
1193
1193
|
o.value = !1, s.value = !0, c.value = !1, d = !!t || n, e.onError(e.mediaIndex(), d);
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
1196
|
function S() {
|
|
1197
|
-
c.value || p.value !== "error" || (d = !1, a.value = 0, s.value = !0, o.value = !0, c.value = !0, i.value += 1,
|
|
1197
|
+
c.value || p.value !== "error" || (d = !1, a.value = 0, s.value = !0, o.value = !0, c.value = !0, i.value += 1, h(b));
|
|
1198
1198
|
}
|
|
1199
1199
|
function C(e) {
|
|
1200
1200
|
g(e) && o.value && _();
|
|
1201
1201
|
}
|
|
1202
|
-
return
|
|
1203
|
-
|
|
1204
|
-
}, { immediate: !0 }),
|
|
1205
|
-
f = !0,
|
|
1202
|
+
return A(e.identity, () => {
|
|
1203
|
+
m(), i.value += 1, d = !1, a.value = 0, o.value = u || e.previewState() === "loading", s.value = !1, c.value = !1, u = !0, h(b);
|
|
1204
|
+
}, { immediate: !0 }), y(() => {
|
|
1205
|
+
f = !0, m();
|
|
1206
1206
|
}), {
|
|
1207
1207
|
effectivePreviewState: p,
|
|
1208
1208
|
failSourceAttempt: x,
|
|
1209
1209
|
imageElement: t,
|
|
1210
|
-
markSourceReady:
|
|
1210
|
+
markSourceReady: v,
|
|
1211
1211
|
noteSourceActivity: C,
|
|
1212
1212
|
retrySource: S,
|
|
1213
1213
|
retrying: c,
|
|
@@ -1217,30 +1217,30 @@ function It(e) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
//#endregion
|
|
1219
1219
|
//#region src/core/reelAudio.ts
|
|
1220
|
-
var
|
|
1220
|
+
var zt = {
|
|
1221
1221
|
lastAudibleVolume: 1,
|
|
1222
1222
|
muted: !1,
|
|
1223
1223
|
volume: 1
|
|
1224
1224
|
};
|
|
1225
|
-
function
|
|
1225
|
+
function Bt(e, t) {
|
|
1226
1226
|
return typeof e == "number" && Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : t;
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1229
|
-
let n =
|
|
1228
|
+
function Vt(e, t = zt) {
|
|
1229
|
+
let n = Bt(e?.volume, t.volume), r = Bt(e?.lastAudibleVolume, n > 0 ? n : t.lastAudibleVolume);
|
|
1230
1230
|
return {
|
|
1231
|
-
lastAudibleVolume: r > 0 ? r :
|
|
1231
|
+
lastAudibleVolume: r > 0 ? r : zt.lastAudibleVolume,
|
|
1232
1232
|
muted: typeof e?.muted == "boolean" ? e.muted : n === 0 || t.muted,
|
|
1233
1233
|
volume: n
|
|
1234
1234
|
};
|
|
1235
1235
|
}
|
|
1236
1236
|
//#endregion
|
|
1237
1237
|
//#region src/components/useMediaCardAudio.ts
|
|
1238
|
-
function
|
|
1239
|
-
let t =
|
|
1238
|
+
function Ht(e) {
|
|
1239
|
+
let t = Vt(e.reelAudioState()), n = e.layout() === "reel" && e.reelAudioState(), r = E(n ? t.muted : e.mediaCard()?.videoMuted ?? e.layout() === "masonry"), i = E(n ? t.volume : 1), a = n ? t.lastAudibleVolume : 1;
|
|
1240
1240
|
function o() {
|
|
1241
1241
|
let t = e.mediaElement.value, n = e.reelAudioState();
|
|
1242
1242
|
if (!t || e.layout() !== "reel" || !n) return;
|
|
1243
|
-
let o =
|
|
1243
|
+
let o = Vt(n);
|
|
1244
1244
|
a = o.lastAudibleVolume, i.value = o.volume, r.value = o.muted, t.volume = o.volume, t.muted = e.active() === !1 ? !0 : o.muted;
|
|
1245
1245
|
}
|
|
1246
1246
|
function s(e, t) {
|
|
@@ -1248,7 +1248,7 @@ function Bt(e) {
|
|
|
1248
1248
|
}
|
|
1249
1249
|
function c(t) {
|
|
1250
1250
|
if (e.layout() !== "reel") return;
|
|
1251
|
-
let n =
|
|
1251
|
+
let n = Vt({
|
|
1252
1252
|
lastAudibleVolume: a,
|
|
1253
1253
|
muted: t.muted,
|
|
1254
1254
|
volume: t.volume
|
|
@@ -1265,7 +1265,7 @@ function Bt(e) {
|
|
|
1265
1265
|
let t = e.mediaElement.value;
|
|
1266
1266
|
t && (t.muted && t.volume === 0 && (t.volume = a), t.muted = !t.muted, s(t, !0), c(t));
|
|
1267
1267
|
}
|
|
1268
|
-
return
|
|
1268
|
+
return A([
|
|
1269
1269
|
e.active,
|
|
1270
1270
|
e.layout,
|
|
1271
1271
|
() => e.reelAudioState()?.lastAudibleVolume,
|
|
@@ -1283,7 +1283,7 @@ function Bt(e) {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
//#endregion
|
|
1285
1285
|
//#region src/components/useReelVideoActivity.ts
|
|
1286
|
-
function
|
|
1286
|
+
function Ut(e) {
|
|
1287
1287
|
let t = r(() => e.layout() === "reel" ? e.active() === !0 : e.inViewport()), n = r(() => t.value ? e.mediaIsMuted.value : !0);
|
|
1288
1288
|
function i() {
|
|
1289
1289
|
if (!t.value) {
|
|
@@ -1292,13 +1292,13 @@ function Vt(e) {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
e.mediaIsPlaying.value = !0;
|
|
1294
1294
|
}
|
|
1295
|
-
return
|
|
1295
|
+
return A(t, (n) => {
|
|
1296
1296
|
let r = e.mediaElement.value;
|
|
1297
1297
|
if (!n) {
|
|
1298
1298
|
r?.pause(), r && (r.muted = !0), e.mediaIsPlaying.value = !1;
|
|
1299
1299
|
return;
|
|
1300
1300
|
}
|
|
1301
|
-
|
|
1301
|
+
h().then(async () => {
|
|
1302
1302
|
let n = e.mediaElement.value;
|
|
1303
1303
|
if (!(!n || !t.value)) {
|
|
1304
1304
|
n.muted = e.mediaIsMuted.value;
|
|
@@ -1317,18 +1317,18 @@ function Vt(e) {
|
|
|
1317
1317
|
}
|
|
1318
1318
|
//#endregion
|
|
1319
1319
|
//#region src/components/useTimedMediaCard.ts
|
|
1320
|
-
function
|
|
1320
|
+
function Wt(e) {
|
|
1321
1321
|
return Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1324
|
-
let t =
|
|
1323
|
+
function Gt(e) {
|
|
1324
|
+
let t = E(0), n = E(0), r = E(!1), { apply: i, setVolume: a, sync: o, toggleMute: s, videoIsMuted: c, videoVolume: l } = Ht({
|
|
1325
1325
|
active: e.active,
|
|
1326
1326
|
layout: e.layout,
|
|
1327
1327
|
mediaCard: e.mediaCard,
|
|
1328
1328
|
mediaElement: e.mediaElement,
|
|
1329
1329
|
onChange: e.onAudioChange,
|
|
1330
1330
|
reelAudioState: e.reelAudioState
|
|
1331
|
-
}), { effectiveMuted: u, onPlaying: d, playbackAllowed: f } =
|
|
1331
|
+
}), { effectiveMuted: u, onPlaying: d, playbackAllowed: f } = Ut({
|
|
1332
1332
|
active: e.active,
|
|
1333
1333
|
inViewport: e.inViewport,
|
|
1334
1334
|
layout: e.layout,
|
|
@@ -1338,7 +1338,7 @@ function Ut(e) {
|
|
|
1338
1338
|
});
|
|
1339
1339
|
function p(r) {
|
|
1340
1340
|
let i = r?.currentTarget ?? e.mediaElement.value;
|
|
1341
|
-
i && (t.value =
|
|
1341
|
+
i && (t.value = Wt(i.currentTime), n.value = Wt(i.duration), o(i, f.value));
|
|
1342
1342
|
}
|
|
1343
1343
|
function m(t) {
|
|
1344
1344
|
i(), p(t), e.onReady(t);
|
|
@@ -1348,7 +1348,7 @@ function Ut(e) {
|
|
|
1348
1348
|
}
|
|
1349
1349
|
function g(n) {
|
|
1350
1350
|
let r = e.mediaElement.value;
|
|
1351
|
-
!r || !Number.isFinite(n) || (r.currentTime = Math.min(
|
|
1351
|
+
!r || !Number.isFinite(n) || (r.currentTime = Math.min(Wt(r.duration), Math.max(0, n)), t.value = r.currentTime);
|
|
1352
1352
|
}
|
|
1353
1353
|
async function _() {
|
|
1354
1354
|
let t = e.mediaElement.value;
|
|
@@ -1364,7 +1364,7 @@ function Ut(e) {
|
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
|
-
return
|
|
1367
|
+
return A(e.mediaElement, () => {
|
|
1368
1368
|
t.value = 0, n.value = 0, r.value = !1;
|
|
1369
1369
|
}, { flush: "sync" }), {
|
|
1370
1370
|
currentTime: t,
|
|
@@ -1386,7 +1386,7 @@ function Ut(e) {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
//#endregion
|
|
1388
1388
|
//#region src/components/MediaCard.vue?vue&type=script&setup=true&lang.ts
|
|
1389
|
-
var
|
|
1389
|
+
var Kt = [
|
|
1390
1390
|
"data-post-id",
|
|
1391
1391
|
"data-media-index",
|
|
1392
1392
|
"aria-hidden",
|
|
@@ -1394,19 +1394,19 @@ var Wt = [
|
|
|
1394
1394
|
"inert",
|
|
1395
1395
|
"role",
|
|
1396
1396
|
"tabindex"
|
|
1397
|
-
],
|
|
1397
|
+
], qt = { class: "media-card-content" }, Jt = ["data-media-direction"], Yt = ["data-media-index"], Xt = {
|
|
1398
1398
|
key: 0,
|
|
1399
1399
|
"data-test": "media-loading",
|
|
1400
1400
|
class: "media-loading",
|
|
1401
1401
|
"aria-hidden": "true"
|
|
1402
|
-
},
|
|
1402
|
+
}, Zt = [
|
|
1403
1403
|
"data-source-generation",
|
|
1404
1404
|
"src",
|
|
1405
1405
|
"autoplay",
|
|
1406
1406
|
"loop",
|
|
1407
1407
|
"muted",
|
|
1408
1408
|
"preload"
|
|
1409
|
-
],
|
|
1409
|
+
], Qt = ["aria-label", "disabled"], $t = [
|
|
1410
1410
|
"data-cover-identity",
|
|
1411
1411
|
"data-source-generation",
|
|
1412
1412
|
"src",
|
|
@@ -1414,11 +1414,11 @@ var Wt = [
|
|
|
1414
1414
|
"height",
|
|
1415
1415
|
"fetchpriority",
|
|
1416
1416
|
"loading"
|
|
1417
|
-
],
|
|
1417
|
+
], en = {
|
|
1418
1418
|
key: 1,
|
|
1419
1419
|
class: "media-audio-fallback",
|
|
1420
1420
|
"aria-hidden": "true"
|
|
1421
|
-
},
|
|
1421
|
+
}, tn = [
|
|
1422
1422
|
"data-source-generation",
|
|
1423
1423
|
"src",
|
|
1424
1424
|
"width",
|
|
@@ -1427,14 +1427,14 @@ var Wt = [
|
|
|
1427
1427
|
"loop",
|
|
1428
1428
|
"muted",
|
|
1429
1429
|
"preload"
|
|
1430
|
-
],
|
|
1430
|
+
], nn = [
|
|
1431
1431
|
"data-source-generation",
|
|
1432
1432
|
"src",
|
|
1433
1433
|
"width",
|
|
1434
1434
|
"height",
|
|
1435
1435
|
"fetchpriority",
|
|
1436
1436
|
"loading"
|
|
1437
|
-
],
|
|
1437
|
+
], rn = ["aria-label"], an = ["aria-label"], on = ["aria-label"], sn = /* @__PURE__ */ d({
|
|
1438
1438
|
__name: "MediaCard",
|
|
1439
1439
|
props: {
|
|
1440
1440
|
active: { type: Boolean },
|
|
@@ -1474,105 +1474,105 @@ var Wt = [
|
|
|
1474
1474
|
function f(e = !1, t = "pointer") {
|
|
1475
1475
|
e && d("activate", t);
|
|
1476
1476
|
}
|
|
1477
|
-
let p = r(() =>
|
|
1478
|
-
identity: () => `${l.item.postId}:${
|
|
1479
|
-
mediaIndex: () =>
|
|
1477
|
+
let p = r(() => W(l.item)), m = r(() => G(l.item, l.mediaIndex)), _ = r(() => K(l.item, m.value)), y = r(() => V(_.value, l.mediaSource ?? "preview")), b = r(() => R(_.value.type, _.value.src)), S = r(() => b.value === "audio"), C = r(() => U(_.value, l.mediaSource ?? "preview")), w = r(() => S.value ? C.value : y.value), T = r(() => w.value.src), D = r(() => R(w.value.type, w.value.src)), k = r(() => y.value.width), P = r(() => y.value.height), F = r(() => H(_.value)), I = r(() => `${l.item.postId}:${m.value}:${F.value?.src ?? ""}`), L = E(!1), z = r(() => L.value ? null : F.value), { effectivePreviewState: B, failSourceAttempt: q, imageElement: ee, markSourceReady: J, noteSourceActivity: Y, retrySource: te, retrying: ne, sourceGeneration: re, mediaElement: ie } = Rt({
|
|
1478
|
+
identity: () => `${l.item.postId}:${m.value}:${l.mediaSource ?? "preview"}:${T.value}:${D.value ?? ""}`,
|
|
1479
|
+
mediaIndex: () => m.value,
|
|
1480
1480
|
onError: (e, t) => {
|
|
1481
1481
|
if (d("error", e), !t) return;
|
|
1482
1482
|
let n = l.mediaSource ?? "preview";
|
|
1483
1483
|
d("mediaError", {
|
|
1484
1484
|
mediaIndex: e,
|
|
1485
|
-
source: n === "preview" && !S.value &&
|
|
1486
|
-
src:
|
|
1485
|
+
source: n === "preview" && !S.value && _.value.preview ? "preview" : n === "mobile" && T.value === _.value.mobile?.src ? "mobile" : "original",
|
|
1486
|
+
src: T.value
|
|
1487
1487
|
});
|
|
1488
1488
|
},
|
|
1489
1489
|
onReady: (e) => d("ready", e),
|
|
1490
1490
|
previewState: () => l.previewState
|
|
1491
1491
|
});
|
|
1492
|
-
|
|
1492
|
+
It({
|
|
1493
1493
|
inViewport: () => l.inViewport === !0,
|
|
1494
1494
|
item: () => l.item,
|
|
1495
1495
|
layout: () => l.layout,
|
|
1496
1496
|
mediaCard: () => l.mediaCard,
|
|
1497
|
-
mediaIndex: () =>
|
|
1498
|
-
mediaReady: () =>
|
|
1497
|
+
mediaIndex: () => m.value,
|
|
1498
|
+
mediaReady: () => B.value === "ready",
|
|
1499
1499
|
mediaSource: () => l.mediaSource ?? "preview"
|
|
1500
1500
|
});
|
|
1501
|
-
let { currentTime:
|
|
1501
|
+
let { currentTime: ae, duration: oe, effectiveMuted: se, isMuted: ce, isPlaying: X, onEnded: le, onLoadedMetadata: ue, onPlaying: Z, playbackAllowed: de, seek: fe, setVolume: pe, sync: Q, toggleMute: me, togglePlayback: he, volume: ge } = Gt({
|
|
1502
1502
|
active: () => l.active,
|
|
1503
1503
|
inViewport: () => l.inViewport === !0,
|
|
1504
1504
|
layout: () => l.layout,
|
|
1505
1505
|
mediaCard: () => l.mediaCard,
|
|
1506
|
-
mediaElement:
|
|
1506
|
+
mediaElement: ie,
|
|
1507
1507
|
onAudioChange: (e) => d("reelAudioChange", e),
|
|
1508
|
-
onEnded: () => d("ended",
|
|
1509
|
-
onReady:
|
|
1508
|
+
onEnded: () => d("ended", m.value),
|
|
1509
|
+
onReady: J,
|
|
1510
1510
|
reelAudioState: () => l.reelAudioState
|
|
1511
1511
|
}), _e = r(() => l.interactive && !!(l.cardHeader || l.cardFooter));
|
|
1512
1512
|
function ve(e) {
|
|
1513
1513
|
return e.detail === 0 ? "keyboard" : "pointer";
|
|
1514
1514
|
}
|
|
1515
|
-
let { change: ye, direction: be, onTouchEnd: xe, onTouchStart: Se, onWheel: Ce } =
|
|
1515
|
+
let { change: ye, direction: be, onTouchEnd: xe, onTouchStart: Se, onWheel: Ce } = wt({
|
|
1516
1516
|
item: () => l.item,
|
|
1517
1517
|
layout: () => l.layout,
|
|
1518
|
-
mediaIndex: () =>
|
|
1518
|
+
mediaIndex: () => m.value,
|
|
1519
1519
|
onChange: (e) => d("mediaChange", e)
|
|
1520
|
-
}), { imageLoading: we, mediaIsTimed: Te, timedMediaPreload: Ee } =
|
|
1520
|
+
}), { imageLoading: we, mediaIsTimed: Te, timedMediaPreload: Ee } = Lt({
|
|
1521
1521
|
active: () => l.active,
|
|
1522
1522
|
fetchPriority: () => l.fetchPriority,
|
|
1523
1523
|
layout: () => l.layout,
|
|
1524
|
-
mediaSource: () =>
|
|
1525
|
-
mediaType: () =>
|
|
1526
|
-
mediaElement:
|
|
1524
|
+
mediaSource: () => T.value,
|
|
1525
|
+
mediaType: () => D.value,
|
|
1526
|
+
mediaElement: ie,
|
|
1527
1527
|
playbackAllowed: () => de.value
|
|
1528
|
-
}), De = r(() => l.layout === "reel" && l.stationaryReelControls === !0), Oe = r(() => Te.value && (!S.value || l.layout === "reel") &&
|
|
1528
|
+
}), De = r(() => l.layout === "reel" && l.stationaryReelControls === !0), Oe = r(() => Te.value && (!S.value || l.layout === "reel") && B.value === "ready" && (!De.value || !!(l.active && l.reelControlsTarget))), ke = r(() => `${l.item.postId}:${m.value}:${T.value}`);
|
|
1529
1529
|
function Ae(e) {
|
|
1530
1530
|
l.layout === "reel" && (e.stopPropagation(), he());
|
|
1531
1531
|
}
|
|
1532
1532
|
function je(e) {
|
|
1533
|
-
e.currentTarget.dataset.coverIdentity !==
|
|
1534
|
-
mediaIndex:
|
|
1533
|
+
e.currentTarget.dataset.coverIdentity !== I.value || L.value || (d("mediaError", {
|
|
1534
|
+
mediaIndex: m.value,
|
|
1535
1535
|
source: "preview",
|
|
1536
1536
|
src: F.value?.src ?? ""
|
|
1537
|
-
}),
|
|
1537
|
+
}), L.value = !0, l.layout === "masonry" && J());
|
|
1538
1538
|
}
|
|
1539
|
-
return
|
|
1540
|
-
|
|
1541
|
-
}),
|
|
1539
|
+
return A(I, () => {
|
|
1540
|
+
L.value = !1;
|
|
1541
|
+
}), A([
|
|
1542
1542
|
S,
|
|
1543
1543
|
() => l.layout,
|
|
1544
|
-
|
|
1544
|
+
z
|
|
1545
1545
|
], ([e, t, n]) => {
|
|
1546
|
-
e && t === "masonry" && !n &&
|
|
1547
|
-
}, { immediate: !0 }), (r, i) => (
|
|
1546
|
+
e && t === "masonry" && !n && h(() => J());
|
|
1547
|
+
}, { immediate: !0 }), (r, i) => (x(), s("article", {
|
|
1548
1548
|
"data-post-id": e.item.postId,
|
|
1549
|
-
"data-media-index":
|
|
1550
|
-
class:
|
|
1549
|
+
"data-media-index": m.value,
|
|
1550
|
+
class: g(["media-card", {
|
|
1551
1551
|
"media-card--entering": e.entering,
|
|
1552
1552
|
"media-card--leaving": e.leaving,
|
|
1553
|
-
"media-card--error":
|
|
1553
|
+
"media-card--error": O(B) === "error",
|
|
1554
1554
|
"media-card--transparent-chrome": e.mediaCard?.header?.background === "transparent" || e.mediaCard?.footer?.background === "transparent" || e.cardHeader?.background === "transparent" || e.cardFooter?.background === "transparent"
|
|
1555
1555
|
}]),
|
|
1556
|
-
style:
|
|
1556
|
+
style: v(e.itemStyle),
|
|
1557
1557
|
"aria-hidden": e.leaving || void 0,
|
|
1558
|
-
"aria-busy":
|
|
1558
|
+
"aria-busy": O(B) === "loading" || O(ne),
|
|
1559
1559
|
inert: e.leaving || void 0,
|
|
1560
1560
|
role: e.interactive && !e.leaving && !_e.value ? "button" : void 0,
|
|
1561
1561
|
tabindex: e.interactive && !e.leaving && !_e.value ? 0 : void 0,
|
|
1562
1562
|
onClick: i[34] ||= (t) => f(e.interactive && !_e.value, ve(t)),
|
|
1563
|
-
onKeydown: [i[35] ||=
|
|
1564
|
-
}, [c("div",
|
|
1565
|
-
e.cardHeader ? (
|
|
1563
|
+
onKeydown: [i[35] ||= M((t) => f(e.interactive && !_e.value, "keyboard"), ["enter"]), i[36] ||= M(N((t) => f(e.interactive && !_e.value, "keyboard"), ["prevent"]), ["space"])]
|
|
1564
|
+
}, [c("div", qt, [
|
|
1565
|
+
e.cardHeader ? (x(), a(at, {
|
|
1566
1566
|
key: 0,
|
|
1567
1567
|
index: e.index,
|
|
1568
1568
|
item: e.item,
|
|
1569
1569
|
layout: e.layout,
|
|
1570
1570
|
"loaded-count": e.loadedCount,
|
|
1571
|
-
"media-index":
|
|
1571
|
+
"media-index": m.value,
|
|
1572
1572
|
"media-source": e.mediaSource,
|
|
1573
1573
|
placement: "header",
|
|
1574
1574
|
region: e.cardHeader,
|
|
1575
|
-
style:
|
|
1575
|
+
style: v(e.mediaCard?.header),
|
|
1576
1576
|
total: e.total
|
|
1577
1577
|
}, null, 8, [
|
|
1578
1578
|
"index",
|
|
@@ -1586,28 +1586,28 @@ var Wt = [
|
|
|
1586
1586
|
"total"
|
|
1587
1587
|
])) : o("", !0),
|
|
1588
1588
|
c("div", {
|
|
1589
|
-
class:
|
|
1590
|
-
"data-media-direction":
|
|
1591
|
-
onWheel: i[31] ||= (...e) =>
|
|
1592
|
-
onTouchstartPassive: i[32] ||= (...e) =>
|
|
1593
|
-
onTouchendPassive: i[33] ||= (...e) =>
|
|
1589
|
+
class: g(["media-card-media", { "media-card-media--carousel": e.layout === "reel" && p.value.length > 1 }]),
|
|
1590
|
+
"data-media-direction": O(be),
|
|
1591
|
+
onWheel: i[31] ||= (...e) => O(Ce) && O(Ce)(...e),
|
|
1592
|
+
onTouchstartPassive: i[32] ||= (...e) => O(Se) && O(Se)(...e),
|
|
1593
|
+
onTouchendPassive: i[33] ||= (...e) => O(xe) && O(xe)(...e)
|
|
1594
1594
|
}, [
|
|
1595
1595
|
u(n, {
|
|
1596
|
-
css: !
|
|
1597
|
-
name: `media-slide-${
|
|
1596
|
+
css: !O(ne),
|
|
1597
|
+
name: `media-slide-${O(be)}`
|
|
1598
1598
|
}, {
|
|
1599
|
-
default:
|
|
1600
|
-
key: `${e.item.postId}:${
|
|
1599
|
+
default: j(() => [(x(), s("div", {
|
|
1600
|
+
key: `${e.item.postId}:${_.value.src}:${e.mediaSource ?? "preview"}:${O(re)}`,
|
|
1601
1601
|
class: "media-card-frame",
|
|
1602
|
-
"data-media-index":
|
|
1602
|
+
"data-media-index": m.value
|
|
1603
1603
|
}, [
|
|
1604
|
-
|
|
1604
|
+
O(B) === "loading" ? (x(), s("div", Xt, [...i[37] ||= [c("span", { class: "media-loading-shimmer" }, null, -1)]])) : O(B) === "error" ? (x(), a(lt, {
|
|
1605
1605
|
key: 1,
|
|
1606
1606
|
component: e.mediaCard?.error?.component,
|
|
1607
|
-
label:
|
|
1608
|
-
retrying:
|
|
1609
|
-
status:
|
|
1610
|
-
onRetry:
|
|
1607
|
+
label: O(it)(T.value),
|
|
1608
|
+
retrying: O(ne),
|
|
1609
|
+
status: O(rt)(T.value),
|
|
1610
|
+
onRetry: O(te)
|
|
1611
1611
|
}, null, 8, [
|
|
1612
1612
|
"component",
|
|
1613
1613
|
"label",
|
|
@@ -1615,106 +1615,106 @@ var Wt = [
|
|
|
1615
1615
|
"status",
|
|
1616
1616
|
"onRetry"
|
|
1617
1617
|
])) : o("", !0),
|
|
1618
|
-
S.value && e.layout === "reel" ? (
|
|
1618
|
+
S.value && e.layout === "reel" ? (x(), s("audio", {
|
|
1619
1619
|
key: 2,
|
|
1620
1620
|
ref_key: "mediaElement",
|
|
1621
|
-
ref:
|
|
1622
|
-
"data-source-generation":
|
|
1621
|
+
ref: ie,
|
|
1622
|
+
"data-source-generation": O(re),
|
|
1623
1623
|
class: "media-audio-element",
|
|
1624
|
-
src:
|
|
1625
|
-
autoplay:
|
|
1624
|
+
src: T.value,
|
|
1625
|
+
autoplay: O(de),
|
|
1626
1626
|
loop: !e.advanceOnMediaEnd,
|
|
1627
|
-
muted:
|
|
1628
|
-
preload:
|
|
1629
|
-
onLoadedmetadata: i[0] ||= (...e) =>
|
|
1630
|
-
onProgress: i[1] ||= (...e) =>
|
|
1631
|
-
onLoadeddata: i[2] ||= (...e) =>
|
|
1632
|
-
onCanplay: i[3] ||= (...e) =>
|
|
1633
|
-
onDurationchange: i[4] ||= (...e) =>
|
|
1634
|
-
onTimeupdate: i[5] ||= (...e) =>
|
|
1635
|
-
onVolumechange: i[6] ||= (...e) =>
|
|
1636
|
-
onPlaying: i[7] ||= (...e) =>
|
|
1637
|
-
onPause: i[8] ||= (e) =>
|
|
1638
|
-
onEnded: i[9] ||= (...e) =>
|
|
1639
|
-
onError: i[10] ||= (...e) =>
|
|
1640
|
-
}, null, 40,
|
|
1641
|
-
S.value ? (
|
|
1627
|
+
muted: O(se),
|
|
1628
|
+
preload: O(Ee),
|
|
1629
|
+
onLoadedmetadata: i[0] ||= (...e) => O(ue) && O(ue)(...e),
|
|
1630
|
+
onProgress: i[1] ||= (...e) => O(Y) && O(Y)(...e),
|
|
1631
|
+
onLoadeddata: i[2] ||= (...e) => O(Y) && O(Y)(...e),
|
|
1632
|
+
onCanplay: i[3] ||= (...e) => O(Y) && O(Y)(...e),
|
|
1633
|
+
onDurationchange: i[4] ||= (...e) => O(Q) && O(Q)(...e),
|
|
1634
|
+
onTimeupdate: i[5] ||= (...e) => O(Q) && O(Q)(...e),
|
|
1635
|
+
onVolumechange: i[6] ||= (...e) => O(Q) && O(Q)(...e),
|
|
1636
|
+
onPlaying: i[7] ||= (...e) => O(Z) && O(Z)(...e),
|
|
1637
|
+
onPause: i[8] ||= (e) => X.value = !1,
|
|
1638
|
+
onEnded: i[9] ||= (...e) => O(le) && O(le)(...e),
|
|
1639
|
+
onError: i[10] ||= (...e) => O(q) && O(q)(...e)
|
|
1640
|
+
}, null, 40, Zt)) : o("", !0),
|
|
1641
|
+
S.value ? (x(), s("button", {
|
|
1642
1642
|
key: 3,
|
|
1643
1643
|
type: "button",
|
|
1644
|
-
class:
|
|
1645
|
-
"aria-label": e.layout === "reel" ?
|
|
1644
|
+
class: g(["media-audio-artwork media-preview", { "media-preview--ready": O(B) === "ready" }]),
|
|
1645
|
+
"aria-label": e.layout === "reel" ? O(X) ? "Pause audio" : "Play audio" : "Audio",
|
|
1646
1646
|
disabled: e.layout !== "reel",
|
|
1647
1647
|
onClick: Ae
|
|
1648
|
-
}, [
|
|
1649
|
-
key:
|
|
1650
|
-
"data-cover-identity":
|
|
1651
|
-
"data-source-generation":
|
|
1648
|
+
}, [z.value ? (x(), s("img", {
|
|
1649
|
+
key: I.value,
|
|
1650
|
+
"data-cover-identity": I.value,
|
|
1651
|
+
"data-source-generation": O(re),
|
|
1652
1652
|
class: "media-audio-cover",
|
|
1653
|
-
src:
|
|
1654
|
-
width:
|
|
1655
|
-
height:
|
|
1653
|
+
src: z.value.src,
|
|
1654
|
+
width: z.value.width ?? void 0,
|
|
1655
|
+
height: z.value.height ?? void 0,
|
|
1656
1656
|
fetchpriority: e.fetchPriority,
|
|
1657
1657
|
alt: "",
|
|
1658
1658
|
decoding: "async",
|
|
1659
|
-
loading:
|
|
1660
|
-
onLoad: i[11] ||= (t) => e.layout === "masonry" &&
|
|
1659
|
+
loading: O(we),
|
|
1660
|
+
onLoad: i[11] ||= (t) => e.layout === "masonry" && O(J)(t),
|
|
1661
1661
|
onError: je
|
|
1662
|
-
}, null, 40,
|
|
1662
|
+
}, null, 40, $t)) : (x(), s("span", en, [u(O(Ze), {
|
|
1663
1663
|
size: 64,
|
|
1664
1664
|
"stroke-width": 1.5
|
|
1665
|
-
})]))], 10,
|
|
1665
|
+
})]))], 10, Qt)) : O(Te) ? (x(), s("video", {
|
|
1666
1666
|
key: 4,
|
|
1667
1667
|
ref_key: "mediaElement",
|
|
1668
|
-
ref:
|
|
1669
|
-
"data-source-generation":
|
|
1670
|
-
class:
|
|
1671
|
-
"media-preview--ready":
|
|
1668
|
+
ref: ie,
|
|
1669
|
+
"data-source-generation": O(re),
|
|
1670
|
+
class: g(["media-preview", {
|
|
1671
|
+
"media-preview--ready": O(B) === "ready",
|
|
1672
1672
|
"media-preview--reel-video": e.layout === "reel"
|
|
1673
1673
|
}]),
|
|
1674
|
-
src:
|
|
1675
|
-
width:
|
|
1674
|
+
src: T.value,
|
|
1675
|
+
width: k.value ?? void 0,
|
|
1676
1676
|
height: P.value ?? void 0,
|
|
1677
|
-
autoplay:
|
|
1677
|
+
autoplay: O(de),
|
|
1678
1678
|
loop: !e.advanceOnMediaEnd,
|
|
1679
|
-
muted:
|
|
1679
|
+
muted: O(se),
|
|
1680
1680
|
playsinline: "",
|
|
1681
|
-
preload:
|
|
1682
|
-
onLoadedmetadata: i[12] ||= (...e) =>
|
|
1683
|
-
onProgress: i[13] ||= (...e) =>
|
|
1684
|
-
onLoadeddata: i[14] ||= (...e) =>
|
|
1685
|
-
onCanplay: i[15] ||= (...e) =>
|
|
1686
|
-
onDurationchange: i[16] ||= (...e) =>
|
|
1687
|
-
onTimeupdate: i[17] ||= (...e) =>
|
|
1688
|
-
onVolumechange: i[18] ||= (...e) =>
|
|
1689
|
-
onPlaying: i[19] ||= (...e) =>
|
|
1690
|
-
onPause: i[20] ||= (e) =>
|
|
1691
|
-
onEnded: i[21] ||= (...e) =>
|
|
1681
|
+
preload: O(Ee),
|
|
1682
|
+
onLoadedmetadata: i[12] ||= (...e) => O(ue) && O(ue)(...e),
|
|
1683
|
+
onProgress: i[13] ||= (...e) => O(Y) && O(Y)(...e),
|
|
1684
|
+
onLoadeddata: i[14] ||= (...e) => O(Y) && O(Y)(...e),
|
|
1685
|
+
onCanplay: i[15] ||= (...e) => O(Y) && O(Y)(...e),
|
|
1686
|
+
onDurationchange: i[16] ||= (...e) => O(Q) && O(Q)(...e),
|
|
1687
|
+
onTimeupdate: i[17] ||= (...e) => O(Q) && O(Q)(...e),
|
|
1688
|
+
onVolumechange: i[18] ||= (...e) => O(Q) && O(Q)(...e),
|
|
1689
|
+
onPlaying: i[19] ||= (...e) => O(Z) && O(Z)(...e),
|
|
1690
|
+
onPause: i[20] ||= (e) => X.value = !1,
|
|
1691
|
+
onEnded: i[21] ||= (...e) => O(le) && O(le)(...e),
|
|
1692
1692
|
onClick: Ae,
|
|
1693
|
-
onError: i[22] ||= (...e) =>
|
|
1694
|
-
}, null, 42,
|
|
1693
|
+
onError: i[22] ||= (...e) => O(q) && O(q)(...e)
|
|
1694
|
+
}, null, 42, tn)) : S.value ? o("", !0) : (x(), s("img", {
|
|
1695
1695
|
key: 5,
|
|
1696
1696
|
ref_key: "imageElement",
|
|
1697
|
-
ref:
|
|
1698
|
-
"data-source-generation":
|
|
1699
|
-
class:
|
|
1700
|
-
src:
|
|
1701
|
-
width:
|
|
1697
|
+
ref: ee,
|
|
1698
|
+
"data-source-generation": O(re),
|
|
1699
|
+
class: g(["media-preview", { "media-preview--ready": O(B) === "ready" }]),
|
|
1700
|
+
src: T.value,
|
|
1701
|
+
width: k.value ?? void 0,
|
|
1702
1702
|
height: P.value ?? void 0,
|
|
1703
1703
|
fetchpriority: e.fetchPriority,
|
|
1704
1704
|
alt: "",
|
|
1705
1705
|
decoding: "async",
|
|
1706
|
-
loading:
|
|
1707
|
-
onLoad: i[23] ||= (...e) =>
|
|
1708
|
-
onError: i[24] ||= (...e) =>
|
|
1709
|
-
}, null, 42,
|
|
1710
|
-
], 8,
|
|
1706
|
+
loading: O(we),
|
|
1707
|
+
onLoad: i[23] ||= (...e) => O(J) && O(J)(...e),
|
|
1708
|
+
onError: i[24] ||= (...e) => O(q) && O(q)(...e)
|
|
1709
|
+
}, null, 42, nn))
|
|
1710
|
+
], 8, Yt))]),
|
|
1711
1711
|
_: 1
|
|
1712
1712
|
}, 8, ["css", "name"]),
|
|
1713
|
-
u(
|
|
1713
|
+
u(bt, {
|
|
1714
1714
|
item: e.item,
|
|
1715
1715
|
"media-card": e.mediaCard,
|
|
1716
|
-
"media-index":
|
|
1717
|
-
"media-item":
|
|
1716
|
+
"media-index": m.value,
|
|
1717
|
+
"media-item": _.value,
|
|
1718
1718
|
"media-source": e.mediaSource ?? "preview"
|
|
1719
1719
|
}, null, 8, [
|
|
1720
1720
|
"item",
|
|
@@ -1723,27 +1723,27 @@ var Wt = [
|
|
|
1723
1723
|
"media-item",
|
|
1724
1724
|
"media-source"
|
|
1725
1725
|
]),
|
|
1726
|
-
(
|
|
1726
|
+
(x(), a(t, {
|
|
1727
1727
|
disabled: !De.value || !e.reelControlsTarget,
|
|
1728
1728
|
to: e.reelControlsTarget ?? "body"
|
|
1729
1729
|
}, [u(n, {
|
|
1730
1730
|
name: "vibe-reel-media-controls",
|
|
1731
1731
|
css: De.value
|
|
1732
1732
|
}, {
|
|
1733
|
-
default:
|
|
1733
|
+
default: j(() => [Oe.value ? (x(), a(vt, {
|
|
1734
1734
|
key: ke.value,
|
|
1735
|
-
"current-time":
|
|
1735
|
+
"current-time": O(ae),
|
|
1736
1736
|
"data-control-post-id": De.value ? e.item.postId : void 0,
|
|
1737
|
-
duration:
|
|
1737
|
+
duration: O(oe),
|
|
1738
1738
|
layout: e.layout,
|
|
1739
1739
|
"media-type": S.value ? "audio" : "video",
|
|
1740
|
-
muted:
|
|
1741
|
-
playing:
|
|
1742
|
-
volume:
|
|
1743
|
-
onSeek:
|
|
1744
|
-
onToggleMute:
|
|
1745
|
-
onTogglePlayback:
|
|
1746
|
-
onVolumeChange:
|
|
1740
|
+
muted: O(ce),
|
|
1741
|
+
playing: O(X),
|
|
1742
|
+
volume: O(ge),
|
|
1743
|
+
onSeek: O(fe),
|
|
1744
|
+
onToggleMute: O(me),
|
|
1745
|
+
onTogglePlayback: O(he),
|
|
1746
|
+
onVolumeChange: O(pe)
|
|
1747
1747
|
}, null, 8, [
|
|
1748
1748
|
"current-time",
|
|
1749
1749
|
"data-control-post-id",
|
|
@@ -1760,43 +1760,43 @@ var Wt = [
|
|
|
1760
1760
|
])) : o("", !0)]),
|
|
1761
1761
|
_: 1
|
|
1762
1762
|
}, 8, ["css"])], 8, ["disabled", "to"])),
|
|
1763
|
-
p.value.length > 1 ? (
|
|
1763
|
+
p.value.length > 1 ? (x(), s("div", {
|
|
1764
1764
|
key: 0,
|
|
1765
|
-
class:
|
|
1765
|
+
class: g(["media-carousel-controls", { "media-carousel-controls--persistent": e.layout === "reel" }]),
|
|
1766
1766
|
"aria-label": "Media navigation"
|
|
1767
1767
|
}, [c("button", {
|
|
1768
1768
|
type: "button",
|
|
1769
1769
|
class: "media-carousel-control media-carousel-control--previous",
|
|
1770
1770
|
"aria-label": `Previous media for post ${e.item.postId}`,
|
|
1771
|
-
onClick: i[25] ||=
|
|
1772
|
-
onKeydown: i[26] ||=
|
|
1773
|
-
}, [u(
|
|
1771
|
+
onClick: i[25] ||= N((e) => O(ye)(m.value - 1, e), ["stop"]),
|
|
1772
|
+
onKeydown: i[26] ||= N(() => {}, ["stop"])
|
|
1773
|
+
}, [u(O(Ye), { size: 20 })], 40, rn), c("button", {
|
|
1774
1774
|
type: "button",
|
|
1775
1775
|
class: "media-carousel-control media-carousel-control--next",
|
|
1776
1776
|
"aria-label": `Next media for post ${e.item.postId}`,
|
|
1777
|
-
onClick: i[27] ||=
|
|
1778
|
-
onKeydown: i[28] ||=
|
|
1779
|
-
}, [u(
|
|
1780
|
-
_e.value ? (
|
|
1777
|
+
onClick: i[27] ||= N((e) => O(ye)(m.value + 1, e), ["stop"]),
|
|
1778
|
+
onKeydown: i[28] ||= N(() => {}, ["stop"])
|
|
1779
|
+
}, [u(O(Xe), { size: 20 })], 40, an)], 2)) : o("", !0),
|
|
1780
|
+
_e.value ? (x(), s("button", {
|
|
1781
1781
|
key: 1,
|
|
1782
1782
|
class: "media-card-activator",
|
|
1783
1783
|
type: "button",
|
|
1784
1784
|
"aria-label": `Open post ${e.item.postId}`,
|
|
1785
|
-
onClick: i[29] ||=
|
|
1786
|
-
onKeydown: i[30] ||=
|
|
1787
|
-
}, null, 40,
|
|
1788
|
-
], 42,
|
|
1789
|
-
e.cardFooter ? (
|
|
1785
|
+
onClick: i[29] ||= N((e) => r.$emit("activate", ve(e)), ["stop"]),
|
|
1786
|
+
onKeydown: i[30] ||= N(() => {}, ["stop"])
|
|
1787
|
+
}, null, 40, on)) : o("", !0)
|
|
1788
|
+
], 42, Jt),
|
|
1789
|
+
e.cardFooter ? (x(), a(at, {
|
|
1790
1790
|
key: 1,
|
|
1791
1791
|
index: e.index,
|
|
1792
1792
|
item: e.item,
|
|
1793
1793
|
layout: e.layout,
|
|
1794
1794
|
"loaded-count": e.loadedCount,
|
|
1795
|
-
"media-index":
|
|
1795
|
+
"media-index": m.value,
|
|
1796
1796
|
"media-source": e.mediaSource,
|
|
1797
1797
|
placement: "footer",
|
|
1798
1798
|
region: e.cardFooter,
|
|
1799
|
-
style:
|
|
1799
|
+
style: v(e.mediaCard?.footer),
|
|
1800
1800
|
total: e.total
|
|
1801
1801
|
}, null, 8, [
|
|
1802
1802
|
"index",
|
|
@@ -1809,17 +1809,17 @@ var Wt = [
|
|
|
1809
1809
|
"style",
|
|
1810
1810
|
"total"
|
|
1811
1811
|
])) : o("", !0)
|
|
1812
|
-
])], 46,
|
|
1812
|
+
])], 46, Kt));
|
|
1813
1813
|
}
|
|
1814
1814
|
});
|
|
1815
1815
|
//#endregion
|
|
1816
1816
|
//#region src/components/useMasonryMediaVisibility.ts
|
|
1817
|
-
function
|
|
1817
|
+
function cn(e) {
|
|
1818
1818
|
function t(t) {
|
|
1819
1819
|
return t.flatMap((t) => {
|
|
1820
1820
|
let n = e.items()[t];
|
|
1821
1821
|
if (!n) return [];
|
|
1822
|
-
let r = e.mediaIndices().get(n.postId) ?? 0, i =
|
|
1822
|
+
let r = e.mediaIndices().get(n.postId) ?? 0, i = q(n.postId, r);
|
|
1823
1823
|
return e.previewStates().get(i) === "ready" ? [{
|
|
1824
1824
|
key: i,
|
|
1825
1825
|
mediaIndex: r,
|
|
@@ -1829,7 +1829,7 @@ function on(e) {
|
|
|
1829
1829
|
}
|
|
1830
1830
|
function n(e, n) {
|
|
1831
1831
|
let r = /* @__PURE__ */ new Set();
|
|
1832
|
-
|
|
1832
|
+
A(() => t(e()), (e) => {
|
|
1833
1833
|
let t = new Set(e.map(({ key: e }) => e));
|
|
1834
1834
|
e.forEach(({ key: e, mediaIndex: t, postId: i }) => {
|
|
1835
1835
|
r.has(e) || n(i, t);
|
|
@@ -1843,14 +1843,14 @@ function on(e) {
|
|
|
1843
1843
|
}
|
|
1844
1844
|
//#endregion
|
|
1845
1845
|
//#region src/components/useSettledMasonryFeedLayout.ts
|
|
1846
|
-
var
|
|
1847
|
-
function
|
|
1848
|
-
let t =
|
|
1846
|
+
var ln = 1500;
|
|
1847
|
+
function un(e) {
|
|
1848
|
+
let t = E(0), n = 0, i = null, a = 0, o = 0, s = null, c = 0, l = null, u = null, d = 0;
|
|
1849
1849
|
function f() {
|
|
1850
1850
|
s !== null && (cancelAnimationFrame(s), s = null);
|
|
1851
1851
|
}
|
|
1852
1852
|
function p(e, t, n, r) {
|
|
1853
|
-
return i = e, l = t.slice(), u =
|
|
1853
|
+
return i = e, l = t.slice(), u = Te(e.items, u ?? we(r.items), n), c = e.items.length < t.length ? Math.max(c, r.height, e.height) : 0, e.items.length < t.length && e.items.length > n && m(), e;
|
|
1854
1854
|
}
|
|
1855
1855
|
function m() {
|
|
1856
1856
|
s === null && (s = requestAnimationFrame(() => {
|
|
@@ -1858,13 +1858,13 @@ function cn(e) {
|
|
|
1858
1858
|
let n = e.items(), r = i;
|
|
1859
1859
|
if (!r || r.items.length >= n.length) return;
|
|
1860
1860
|
let a = r.items.length;
|
|
1861
|
-
p(
|
|
1861
|
+
p(be(n, e.width.value, {
|
|
1862
1862
|
additionalHeight: e.additionalHeight.value,
|
|
1863
1863
|
gap: e.gap.value,
|
|
1864
1864
|
minColumnWidth: e.minColumnWidth.value
|
|
1865
1865
|
}, r, a, {
|
|
1866
1866
|
throughIndex: e.packThroughIndex(),
|
|
1867
|
-
untilIndex: a +
|
|
1867
|
+
untilIndex: a + ln
|
|
1868
1868
|
}), n, a, r), t.value += 1;
|
|
1869
1869
|
}));
|
|
1870
1870
|
}
|
|
@@ -1878,22 +1878,22 @@ function cn(e) {
|
|
|
1878
1878
|
if (g && l && d === s && a === h.gap && n === h.additionalHeight && o === h.minColumnWidth) {
|
|
1879
1879
|
let t = 0, n = l, i = Math.min(n.length, r.length);
|
|
1880
1880
|
for (; t < i && n[t] === r[t];) t += 1;
|
|
1881
|
-
return t === r.length && t === n.length ? (g.items.length > 0 && g.items.length < r.length && m(), g) : (f(), p(
|
|
1881
|
+
return t === r.length && t === n.length ? (g.items.length > 0 && g.items.length < r.length && m(), g) : (f(), p(be(r, s, h, g, t, {
|
|
1882
1882
|
throughIndex: e.packThroughIndex(),
|
|
1883
1883
|
untilBottom: e.packUntilBottom()
|
|
1884
1884
|
}), r, t, g));
|
|
1885
1885
|
}
|
|
1886
1886
|
f();
|
|
1887
|
-
let _ =
|
|
1888
|
-
return i = _, l = r.slice(), d = s, a = h.gap, n = h.additionalHeight, o = h.minColumnWidth, u =
|
|
1889
|
-
}), g = r(() => (h.value, u ??
|
|
1890
|
-
return
|
|
1887
|
+
let _ = ye(r, s, h);
|
|
1888
|
+
return i = _, l = r.slice(), d = s, a = h.gap, n = h.additionalHeight, o = h.minColumnWidth, u = we(_.items), c = 0, _;
|
|
1889
|
+
}), g = r(() => (h.value, u ?? we(h.value.items)));
|
|
1890
|
+
return y(f), {
|
|
1891
1891
|
ensurePackedThrough(n) {
|
|
1892
1892
|
let r = e.items(), a = i;
|
|
1893
1893
|
if (!a || a.items.length >= r.length || a.height >= n) return;
|
|
1894
1894
|
f();
|
|
1895
1895
|
let o = a.items.length;
|
|
1896
|
-
p(
|
|
1896
|
+
p(be(r, e.width.value, {
|
|
1897
1897
|
additionalHeight: e.additionalHeight.value,
|
|
1898
1898
|
gap: e.gap.value,
|
|
1899
1899
|
minColumnWidth: e.minColumnWidth.value
|
|
@@ -1909,10 +1909,10 @@ function cn(e) {
|
|
|
1909
1909
|
}
|
|
1910
1910
|
//#endregion
|
|
1911
1911
|
//#region src/components/MasonryFeed.vue?vue&type=script&setup=true&lang.ts
|
|
1912
|
-
var
|
|
1912
|
+
var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
1913
1913
|
key: 0,
|
|
1914
1914
|
class: "masonry-feed-status-overlay"
|
|
1915
|
-
},
|
|
1915
|
+
}, mn = 6, hn = 12, gn = 250, _n = /* @__PURE__ */ d({
|
|
1916
1916
|
__name: "MasonryFeed",
|
|
1917
1917
|
props: {
|
|
1918
1918
|
enteringPostIds: {},
|
|
@@ -1951,31 +1951,31 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
1951
1951
|
"visible"
|
|
1952
1952
|
],
|
|
1953
1953
|
setup(t, { expose: n, emit: i }) {
|
|
1954
|
-
let l = 0, d = t, f = i, p =
|
|
1954
|
+
let l = 0, d = t, f = i, p = E(null), m = `vibe-masonry-${k()}`, h = E(null), _ = E(0), b = E(mn), S = E(0), w = E(0), T = E(0), D = E([]), j = E([]), M = E([]), N = 0, P = null, F = null, I = null, L = null, R = r(() => ({
|
|
1955
1955
|
additionalHeight: (d.cardHeader?.height ?? 0) + (d.cardFooter?.height ?? 0),
|
|
1956
|
-
gap:
|
|
1957
|
-
minColumnWidth:
|
|
1956
|
+
gap: b.value,
|
|
1957
|
+
minColumnWidth: ke(d.masonry)
|
|
1958
1958
|
})), z = [];
|
|
1959
1959
|
function B() {
|
|
1960
|
-
let e = N -
|
|
1960
|
+
let e = N - T.value + S.value + Ae(d.masonry, S.value), t = M.value.reduce((e, t) => {
|
|
1961
1961
|
let n = z[t];
|
|
1962
1962
|
return n ? Math.max(e, n.y + n.height) : e;
|
|
1963
1963
|
}, 0);
|
|
1964
1964
|
return Math.max(e, t);
|
|
1965
1965
|
}
|
|
1966
|
-
function
|
|
1966
|
+
function V() {
|
|
1967
1967
|
return M.value.reduce((e, t) => Math.max(e, t), -1);
|
|
1968
1968
|
}
|
|
1969
|
-
let
|
|
1969
|
+
let H = un({
|
|
1970
1970
|
additionalHeight: r(() => R.value.additionalHeight),
|
|
1971
|
-
gap:
|
|
1971
|
+
gap: b,
|
|
1972
1972
|
items: () => d.items,
|
|
1973
1973
|
minColumnWidth: r(() => R.value.minColumnWidth),
|
|
1974
|
-
packThroughIndex:
|
|
1974
|
+
packThroughIndex: V,
|
|
1975
1975
|
packUntilBottom: B,
|
|
1976
|
-
width:
|
|
1977
|
-
}),
|
|
1978
|
-
throughIndex:
|
|
1976
|
+
width: _
|
|
1977
|
+
}), U = H.layout, W = H.viewportIndex, G = r(() => d.leavingPostIds.size === 0 ? null : xe(d.items, _.value, R.value, U.value, (e) => d.leavingPostIds.has(d.items[e].postId), {
|
|
1978
|
+
throughIndex: V(),
|
|
1979
1979
|
untilBottom: B()
|
|
1980
1980
|
})), K = r(() => {
|
|
1981
1981
|
let e = G.value;
|
|
@@ -1983,33 +1983,33 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
1983
1983
|
columns: e.columns,
|
|
1984
1984
|
height: e.height,
|
|
1985
1985
|
items: e.items
|
|
1986
|
-
} :
|
|
1987
|
-
}),
|
|
1986
|
+
} : U.value;
|
|
1987
|
+
}), ee = r(() => {
|
|
1988
1988
|
let e = G.value;
|
|
1989
|
-
return e ?
|
|
1990
|
-
}),
|
|
1989
|
+
return e ? Ee(e.items, e.retainedIndices, W.value, e.fromIndex) : null;
|
|
1990
|
+
}), J = r(() => (U.value, Math.max(w.value, H.reservedHeight(), d.leavingPostIds.size === 0 ? K.value.height : U.value.height))), Y = r(() => ({ height: `${J.value}px` })), te = r(() => !d.infiniteScroll || S.value > 0 && T.value + K.value.height <= S.value + 1), ne = r(() => new Set(j.value)), re = r(() => M.value.flatMap((e) => {
|
|
1991
1991
|
let t = d.items[e], n = K.value.items[e];
|
|
1992
1992
|
return !t || !n || n.width <= 0 || n.height <= 0 ? [] : [{
|
|
1993
|
-
fetchPriority:
|
|
1993
|
+
fetchPriority: ne.value.has(e) ? "high" : "low",
|
|
1994
1994
|
index: e,
|
|
1995
1995
|
item: t
|
|
1996
1996
|
}];
|
|
1997
1997
|
}));
|
|
1998
|
-
function
|
|
1998
|
+
function ie(e, t) {
|
|
1999
1999
|
return [...new Set([...e, ...t])].sort((e, t) => e - t);
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2001
|
+
function ae(e, t) {
|
|
2002
2002
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
2003
2003
|
}
|
|
2004
|
-
function
|
|
2004
|
+
function oe(e) {
|
|
2005
2005
|
let t = {
|
|
2006
|
-
scrollTop: N -
|
|
2007
|
-
viewportHeight:
|
|
2008
|
-
}, n =
|
|
2006
|
+
scrollTop: N - T.value,
|
|
2007
|
+
viewportHeight: S.value
|
|
2008
|
+
}, n = ee.value, r = Oe(n ?? W.value, {
|
|
2009
2009
|
...t,
|
|
2010
2010
|
overscan: e
|
|
2011
2011
|
}).indices;
|
|
2012
|
-
return
|
|
2012
|
+
return ie(r, d.leavingPostIds.size === 0 ? [] : Oe(W.value, {
|
|
2013
2013
|
...t,
|
|
2014
2014
|
overscan: e
|
|
2015
2015
|
}).indices.filter((e) => {
|
|
@@ -2017,28 +2017,28 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2017
2017
|
return t !== void 0 && d.leavingPostIds.has(t.postId);
|
|
2018
2018
|
}));
|
|
2019
2019
|
}
|
|
2020
|
-
function
|
|
2021
|
-
let e =
|
|
2022
|
-
|
|
2023
|
-
let n =
|
|
2020
|
+
function ce() {
|
|
2021
|
+
let e = oe(0), t = oe(Ae(d.masonry, S.value));
|
|
2022
|
+
ae(j.value, e) || (j.value = e);
|
|
2023
|
+
let n = me(K.value.items, e.filter((e) => {
|
|
2024
2024
|
let t = d.items[e];
|
|
2025
2025
|
return t && !d.leavingPostIds.has(t.postId);
|
|
2026
2026
|
}), {
|
|
2027
|
-
scrollTop: N -
|
|
2028
|
-
viewportHeight:
|
|
2027
|
+
scrollTop: N - T.value,
|
|
2028
|
+
viewportHeight: S.value
|
|
2029
2029
|
});
|
|
2030
|
-
|
|
2030
|
+
ae(D.value, n) || (D.value = n), ae(M.value, t) || (M.value = t);
|
|
2031
2031
|
}
|
|
2032
2032
|
function X() {
|
|
2033
2033
|
if (L !== null) return;
|
|
2034
2034
|
L = -1;
|
|
2035
2035
|
let e = requestAnimationFrame(() => {
|
|
2036
|
-
L = null,
|
|
2036
|
+
L = null, ce();
|
|
2037
2037
|
});
|
|
2038
2038
|
L !== null && (L = e);
|
|
2039
2039
|
}
|
|
2040
|
-
|
|
2041
|
-
fullyVisibleIndices: () =>
|
|
2040
|
+
cn({
|
|
2041
|
+
fullyVisibleIndices: () => D.value,
|
|
2042
2042
|
items: () => d.items,
|
|
2043
2043
|
mediaIndices: () => d.mediaIndices,
|
|
2044
2044
|
onFullyVisible: (e, t) => f("fullyVisible", e, t),
|
|
@@ -2046,12 +2046,12 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2046
2046
|
previewStates: () => d.previewStates,
|
|
2047
2047
|
visibleIndices: () => j.value
|
|
2048
2048
|
});
|
|
2049
|
-
function
|
|
2049
|
+
function le(e) {
|
|
2050
2050
|
let t = K.value.items[e], n = d.items[e]?.postId;
|
|
2051
2051
|
if (!t || t.width <= 0 || t.height <= 0) return {};
|
|
2052
|
-
let r = n !== void 0 && d.enteringPostIds.has(n), i = n !== void 0 && d.leavingPostIds.has(n), a = r || i ?
|
|
2053
|
-
containerHeight: Math.max(
|
|
2054
|
-
gap:
|
|
2052
|
+
let r = n !== void 0 && d.enteringPostIds.has(n), i = n !== void 0 && d.leavingPostIds.has(n), a = r || i ? fe({
|
|
2053
|
+
containerHeight: Math.max(w.value, U.value.height),
|
|
2054
|
+
gap: b.value
|
|
2055
2055
|
}) : 0, o = n === void 0 ? 0 : i ? d.removalDelays.get(n) ?? 0 : r ? d.entryDelays.get(n) ?? 0 : 0;
|
|
2056
2056
|
return {
|
|
2057
2057
|
"--masonry-entry-delay": `${o}ms`,
|
|
@@ -2060,70 +2060,70 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2060
2060
|
transform: `translate3d(${t.x}px, ${t.y + a}px, 0)`
|
|
2061
2061
|
};
|
|
2062
2062
|
}
|
|
2063
|
-
function
|
|
2063
|
+
function Z() {
|
|
2064
2064
|
let e = p.value;
|
|
2065
2065
|
if (!e) return;
|
|
2066
|
-
N = e.scrollTop,
|
|
2066
|
+
N = e.scrollTop, S.value = e.clientHeight;
|
|
2067
2067
|
let t = e.ownerDocument.defaultView?.getComputedStyle(e), n = (Number.parseFloat(t?.paddingTop ?? "") || 0) + (Number.parseFloat(t?.paddingBottom ?? "") || 0);
|
|
2068
|
-
|
|
2069
|
-
let r =
|
|
2070
|
-
r && (
|
|
2068
|
+
w.value = Math.max(0, e.clientHeight - n);
|
|
2069
|
+
let r = h.value;
|
|
2070
|
+
r && (T.value = r.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop, ce());
|
|
2071
2071
|
}
|
|
2072
|
-
function
|
|
2072
|
+
function de(e) {
|
|
2073
2073
|
let t = e.ownerDocument.documentElement.clientWidth;
|
|
2074
|
-
|
|
2074
|
+
_.value = e.clientWidth, b.value = Math.min(hn, Math.max(mn, t * .0075)), Z();
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2076
|
+
function pe(e) {
|
|
2077
2077
|
let t = e.currentTarget;
|
|
2078
|
-
t && (N = t.scrollTop,
|
|
2078
|
+
t && (N = t.scrollTop, H.ensurePackedThrough(B()), X(), Date.now() >= l && !d.loadMoreLocked && d.infiniteScroll && ue(t, d.masonry?.loadMoreThresholdPx) && f("loadMore"));
|
|
2079
2079
|
}
|
|
2080
|
-
function
|
|
2080
|
+
function Q() {
|
|
2081
2081
|
let e = p.value;
|
|
2082
|
-
Date.now() >= l && !d.loadMoreLocked && e &&
|
|
2082
|
+
Date.now() >= l && !d.loadMoreLocked && e && ue(e, d.masonry?.loadMoreThresholdPx) && f("loadMore");
|
|
2083
2083
|
}
|
|
2084
|
-
|
|
2085
|
-
e > 0 && e < t && (l = Date.now() +
|
|
2084
|
+
A(() => d.items.length, (e, t) => {
|
|
2085
|
+
e > 0 && e < t && (l = Date.now() + gn);
|
|
2086
2086
|
});
|
|
2087
2087
|
function he() {
|
|
2088
2088
|
return p.value;
|
|
2089
2089
|
}
|
|
2090
|
-
return
|
|
2091
|
-
P?.disconnect(), P = null, I !== null && cancelAnimationFrame(I), e && (
|
|
2090
|
+
return A(h, (e) => {
|
|
2091
|
+
P?.disconnect(), P = null, I !== null && cancelAnimationFrame(I), e && (de(e), !(typeof ResizeObserver > "u") && (P = new ResizeObserver(([t]) => {
|
|
2092
2092
|
let n = t?.contentRect.width ?? e.clientWidth;
|
|
2093
|
-
Math.abs(n -
|
|
2094
|
-
I = null,
|
|
2093
|
+
Math.abs(n - _.value) < .5 || (I = requestAnimationFrame(() => {
|
|
2094
|
+
I = null, de(e);
|
|
2095
2095
|
}));
|
|
2096
2096
|
}), P.observe(e)));
|
|
2097
|
-
}),
|
|
2098
|
-
F?.disconnect(), F = null, e && (
|
|
2099
|
-
}),
|
|
2097
|
+
}), A(p, (e) => {
|
|
2098
|
+
F?.disconnect(), F = null, e && (Z(), !(typeof ResizeObserver > "u") && (F = new ResizeObserver(Z), F.observe(e)));
|
|
2099
|
+
}), A(K, (e) => {
|
|
2100
2100
|
z = e.items;
|
|
2101
|
-
}, { flush: "sync" }),
|
|
2102
|
-
|
|
2101
|
+
}, { flush: "sync" }), A([
|
|
2102
|
+
U,
|
|
2103
2103
|
K,
|
|
2104
2104
|
() => d.masonry
|
|
2105
|
-
],
|
|
2105
|
+
], ce, { flush: "post" }), y(() => {
|
|
2106
2106
|
P?.disconnect(), F?.disconnect(), I !== null && cancelAnimationFrame(I), L !== null && cancelAnimationFrame(L);
|
|
2107
2107
|
}), n({
|
|
2108
2108
|
getScrollElement: he,
|
|
2109
|
-
loadIfNearBottom:
|
|
2110
|
-
}), (n, r) => (
|
|
2109
|
+
loadIfNearBottom: Q
|
|
2110
|
+
}), (n, r) => (x(), s("div", dn, [
|
|
2111
2111
|
c("main", {
|
|
2112
2112
|
id: m,
|
|
2113
2113
|
ref_key: "galleryElement",
|
|
2114
2114
|
ref: p,
|
|
2115
|
-
class:
|
|
2115
|
+
class: g(["gallery-shell masonry-feed", { "masonry-feed--suspended": t.suspended }]),
|
|
2116
2116
|
"data-layout-mode": "masonry",
|
|
2117
2117
|
"aria-hidden": t.suspended || void 0,
|
|
2118
2118
|
inert: t.suspended || void 0,
|
|
2119
|
-
onScrollPassive:
|
|
2119
|
+
onScrollPassive: pe
|
|
2120
2120
|
}, [c("section", {
|
|
2121
2121
|
ref_key: "masonryElement",
|
|
2122
|
-
ref:
|
|
2123
|
-
class:
|
|
2124
|
-
style:
|
|
2122
|
+
ref: h,
|
|
2123
|
+
class: g(["masonry", { "masonry--ready": _.value > 0 }]),
|
|
2124
|
+
style: v(Y.value),
|
|
2125
2125
|
"aria-label": "Media gallery"
|
|
2126
|
-
}, [(
|
|
2126
|
+
}, [(x(!0), s(e, null, C(re.value, ({ fetchPriority: e, item: n, index: r }) => (x(), a(sn, {
|
|
2127
2127
|
key: n.postId,
|
|
2128
2128
|
class: "masonry-item",
|
|
2129
2129
|
entering: t.enteringPostIds.has(n.postId),
|
|
@@ -2132,15 +2132,15 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2132
2132
|
"card-footer": t.cardFooter,
|
|
2133
2133
|
"card-header": t.cardHeader,
|
|
2134
2134
|
"media-card": t.mediaCard,
|
|
2135
|
-
"in-viewport":
|
|
2135
|
+
"in-viewport": ne.value.has(r),
|
|
2136
2136
|
index: r,
|
|
2137
2137
|
item: n,
|
|
2138
|
-
"item-style":
|
|
2138
|
+
"item-style": le(r),
|
|
2139
2139
|
interactive: "",
|
|
2140
2140
|
layout: "masonry",
|
|
2141
2141
|
"loaded-count": t.items.length,
|
|
2142
2142
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2143
|
-
"preview-state": t.previewStates.get(
|
|
2143
|
+
"preview-state": t.previewStates.get(O(q)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2144
2144
|
total: t.total,
|
|
2145
2145
|
onActivate: (e) => f("activate", n.postId, e),
|
|
2146
2146
|
onMediaChange: (e) => f("mediaChange", n.postId, e),
|
|
@@ -2167,13 +2167,13 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2167
2167
|
"onReady",
|
|
2168
2168
|
"onError",
|
|
2169
2169
|
"onMediaError"
|
|
2170
|
-
]))), 128))], 6), t.masonry?.bottomSpacePx ? (
|
|
2170
|
+
]))), 128))], 6), t.masonry?.bottomSpacePx ? (x(), s("div", {
|
|
2171
2171
|
key: 0,
|
|
2172
2172
|
class: "masonry-bottom-space",
|
|
2173
2173
|
"aria-hidden": "true",
|
|
2174
|
-
style:
|
|
2175
|
-
}, null, 4)) : o("", !0)], 42,
|
|
2176
|
-
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext &&
|
|
2174
|
+
style: v({ flex: `0 0 ${t.masonry.bottomSpacePx}px` })
|
|
2175
|
+
}, null, 4)) : o("", !0)], 42, fn),
|
|
2176
|
+
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext && te.value || !t.hasNext && t.canRetryEnd ? (x(), s("div", pn, [u(se, {
|
|
2177
2177
|
actions: t.feedFooterActions,
|
|
2178
2178
|
"can-retry-end": t.canRetryEnd,
|
|
2179
2179
|
"feed-footer": t.feedFooter,
|
|
@@ -2181,7 +2181,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2181
2181
|
"has-next": t.hasNext,
|
|
2182
2182
|
"is-loading": t.isLoadingMore,
|
|
2183
2183
|
"load-more-locked": t.loadMoreLocked,
|
|
2184
|
-
"show-load-more":
|
|
2184
|
+
"show-load-more": te.value,
|
|
2185
2185
|
state: t.state,
|
|
2186
2186
|
onLoadMore: r[0] ||= (e) => f("loadMore"),
|
|
2187
2187
|
onRetryEnd: r[1] ||= (e) => f("retryEnd")
|
|
@@ -2196,7 +2196,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2196
2196
|
"show-load-more",
|
|
2197
2197
|
"state"
|
|
2198
2198
|
])])) : o("", !0),
|
|
2199
|
-
u(
|
|
2199
|
+
u(ze, {
|
|
2200
2200
|
"content-size": K.value.height,
|
|
2201
2201
|
"controls-id": m,
|
|
2202
2202
|
"scroll-element": p.value,
|
|
@@ -2208,28 +2208,41 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2208
2208
|
])
|
|
2209
2209
|
]));
|
|
2210
2210
|
}
|
|
2211
|
-
}),
|
|
2212
|
-
function
|
|
2213
|
-
|
|
2214
|
-
|
|
2211
|
+
}), vn = 300;
|
|
2212
|
+
function yn() {
|
|
2213
|
+
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2214
|
+
}
|
|
2215
|
+
function bn(e, t, n, r) {
|
|
2216
|
+
if (r?.aborted) return Promise.resolve();
|
|
2217
|
+
let i = e.scrollTop;
|
|
2218
|
+
if (n || Math.abs(i - t) <= 1) return e.scrollTop = t, Promise.resolve();
|
|
2215
2219
|
e.setAttribute("data-transitioning", "");
|
|
2216
|
-
let
|
|
2220
|
+
let a = performance.now(), o = 0, s = 0;
|
|
2217
2221
|
return new Promise((n) => {
|
|
2218
|
-
let
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2222
|
+
let c = () => {
|
|
2223
|
+
cancelAnimationFrame(s), r?.removeEventListener("abort", c), e.removeAttribute("data-transitioning"), n();
|
|
2224
|
+
};
|
|
2225
|
+
r?.addEventListener("abort", c, { once: !0 });
|
|
2226
|
+
let l = (n) => {
|
|
2227
|
+
o += 1;
|
|
2228
|
+
let r = Math.max(n - a, 1e3 / 60 * o), u = Math.min(1, r / vn), d = 1 - (1 - u) ** 3;
|
|
2229
|
+
if (e.scrollTop = i + (t - i) * d, u < 1) {
|
|
2230
|
+
s = requestAnimationFrame(l);
|
|
2223
2231
|
return;
|
|
2224
2232
|
}
|
|
2225
|
-
e.
|
|
2233
|
+
e.scrollTop = t, c();
|
|
2226
2234
|
};
|
|
2227
|
-
requestAnimationFrame(
|
|
2235
|
+
s = requestAnimationFrame(l);
|
|
2228
2236
|
});
|
|
2229
2237
|
}
|
|
2230
2238
|
//#endregion
|
|
2239
|
+
//#region src/core/reelViewport.ts
|
|
2240
|
+
function xn(e, t, n) {
|
|
2241
|
+
return t <= 0 || n <= 0 ? 0 : Math.min(n - 1, Math.max(0, Math.round(e / t)));
|
|
2242
|
+
}
|
|
2243
|
+
//#endregion
|
|
2231
2244
|
//#region src/components/ReelAutoAdvanceProgress.vue?vue&type=script&setup=true&lang.ts
|
|
2232
|
-
var
|
|
2245
|
+
var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
2233
2246
|
__name: "ReelAutoAdvanceProgress",
|
|
2234
2247
|
props: {
|
|
2235
2248
|
durationMs: {},
|
|
@@ -2238,18 +2251,18 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2238
2251
|
emits: ["complete"],
|
|
2239
2252
|
setup(e, { emit: t }) {
|
|
2240
2253
|
let n = e, i = t, a = r(() => ({ "--vibe-reel-auto-advance-duration": `${n.durationMs}ms` }));
|
|
2241
|
-
return (t, n) => (
|
|
2254
|
+
return (t, n) => (x(), s("div", {
|
|
2242
2255
|
class: "reel-auto-advance",
|
|
2243
2256
|
"data-test": "reel-auto-advance",
|
|
2244
2257
|
role: "timer",
|
|
2245
2258
|
"aria-label": e.label
|
|
2246
2259
|
}, [c("span", {
|
|
2247
2260
|
class: "reel-auto-advance-progress",
|
|
2248
|
-
style:
|
|
2261
|
+
style: v(a.value),
|
|
2249
2262
|
onAnimationend: n[0] ||= (e) => i("complete")
|
|
2250
|
-
}, null, 36)], 8,
|
|
2263
|
+
}, null, 36)], 8, Sn));
|
|
2251
2264
|
}
|
|
2252
|
-
}),
|
|
2265
|
+
}), wn = { class: "reel-viewport" }, Tn = ["data-active-post-id", "data-active-media-index"], En = ["role", "data-status"], Dn = ["disabled"], On = 300, kn = 250, An = /* @__PURE__ */ d({
|
|
2253
2266
|
__name: "ReelFeed",
|
|
2254
2267
|
props: {
|
|
2255
2268
|
initialPostId: {},
|
|
@@ -2289,163 +2302,160 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2289
2302
|
"retryForward"
|
|
2290
2303
|
],
|
|
2291
2304
|
setup(t, { expose: n, emit: i }) {
|
|
2292
|
-
let l = 0, u = t, d = i, f =
|
|
2293
|
-
let e = Math.max(0,
|
|
2305
|
+
let l = 0, u = t, d = i, f = E(null), p = E(null), m = u.initialPostId === null || u.initialPostId === void 0 ? -1 : u.items.findIndex((e) => e.postId === u.initialPostId), _ = E(Math.max(0, m)), S = E(!1), w = E(!1), T = 0, k = null, j = null, M = null, N = r(() => ({ gridTemplateRows: `repeat(${u.items.length}, 100cqh)` })), P = r(() => {
|
|
2306
|
+
let e = Math.max(0, _.value - 2), t = Math.min(u.items.length - 1, _.value + 2);
|
|
2294
2307
|
return u.items.slice(e, t + 1).map((t, n) => ({
|
|
2295
|
-
fetchPriority: e + n ===
|
|
2308
|
+
fetchPriority: e + n === _.value ? "high" : "low",
|
|
2296
2309
|
index: e + n,
|
|
2297
2310
|
item: t
|
|
2298
2311
|
}));
|
|
2299
|
-
}), F = r(() => u.items[
|
|
2312
|
+
}), F = r(() => u.items[_.value]?.postId), I = r(() => u.items[_.value]), L = r(() => {
|
|
2300
2313
|
let e = F.value;
|
|
2301
2314
|
return e === void 0 ? 0 : u.mediaIndices.get(e) ?? 0;
|
|
2302
|
-
}),
|
|
2315
|
+
}), R = r(() => {
|
|
2303
2316
|
let e = F.value;
|
|
2304
|
-
return e === void 0 ? "loading" : u.previewStates.get(
|
|
2305
|
-
}), B = r(() => I.value ?
|
|
2317
|
+
return e === void 0 ? "loading" : u.previewStates.get(q(e, L.value)) ?? "loading";
|
|
2318
|
+
}), B = r(() => I.value ? K(I.value, L.value) : null), V = r(() => B.value ? U(B.value, u.mediaSource ?? "preview") : null), H = r(() => R.value === "ready" && !!(V.value && z(V.value.type, V.value.src))), G = r(() => [
|
|
2306
2319
|
F.value,
|
|
2307
|
-
|
|
2320
|
+
L.value,
|
|
2308
2321
|
u.items.length,
|
|
2309
2322
|
u.loadMoreLocked,
|
|
2310
2323
|
u.reelAutoAdvance.enabled,
|
|
2311
2324
|
u.reelAutoAdvance.includePostItems,
|
|
2312
2325
|
u.reelAutoAdvance.intervalMs
|
|
2313
|
-
].join(":")),
|
|
2314
|
-
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems &&
|
|
2326
|
+
].join(":")), ee = r(() => {
|
|
2327
|
+
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems && L.value < W(e).length - 1), n = u.reelAutoAdvance.intervalMs / 1e3;
|
|
2315
2328
|
return `Auto advance to the next ${t ? "post item" : "post"} in ${n}s`;
|
|
2316
|
-
}),
|
|
2317
|
-
function
|
|
2329
|
+
}), J = r(() => u.reelAutoAdvance.enabled && u.reelForward.status === "idle" && I.value !== void 0 && R.value !== "loading" && !H.value), Y = r(() => !u.infiniteScroll || u.items.length <= 1), te = r(() => u.reelForward.status === "end" && u.hasNext && !u.infiniteScroll && !u.loadMoreLocked), ne = r(() => u.reelForward.status === "loading" ? "Loading the next media…" : u.reelForward.status === "error" ? "Unable to load the next media." : te.value ? "Load the next page to continue." : "You reached the end of this feed.");
|
|
2330
|
+
function re(e) {
|
|
2318
2331
|
return { gridRow: `${e + 1}` };
|
|
2319
2332
|
}
|
|
2320
|
-
function
|
|
2321
|
-
let t =
|
|
2322
|
-
return
|
|
2333
|
+
function ie(e) {
|
|
2334
|
+
let t = T || e.clientHeight;
|
|
2335
|
+
return xn(e.scrollTop, t, u.items.length);
|
|
2323
2336
|
}
|
|
2324
|
-
function
|
|
2337
|
+
function ae(e) {
|
|
2325
2338
|
let t = e.currentTarget;
|
|
2326
2339
|
if (!t) return;
|
|
2327
|
-
let n =
|
|
2328
|
-
|
|
2340
|
+
let n = T || t.clientHeight, r = Math.max(0, u.items.length - 1) * n;
|
|
2341
|
+
S.value = u.items.length > 0 && t.scrollTop > r + 1, w.value || (_.value = ie(t)), Date.now() >= l && !u.loadMoreLocked && u.infiniteScroll && ue(t) && d("loadMore");
|
|
2329
2342
|
}
|
|
2330
|
-
function
|
|
2343
|
+
function oe() {
|
|
2331
2344
|
let e = f.value;
|
|
2332
|
-
e && (
|
|
2333
|
-
e.scrollTop =
|
|
2334
|
-
}),
|
|
2345
|
+
e && (S.value = !1, le(!0), T = e.clientHeight, e.scrollTop = _.value * T, j !== null && cancelAnimationFrame(j), j = requestAnimationFrame(() => {
|
|
2346
|
+
e.scrollTop = _.value * e.clientHeight, T = e.clientHeight, j = null;
|
|
2347
|
+
}), ce());
|
|
2335
2348
|
}
|
|
2336
|
-
function
|
|
2349
|
+
function ce() {
|
|
2337
2350
|
M !== null && clearTimeout(M), M = setTimeout(() => {
|
|
2338
2351
|
M = null;
|
|
2339
2352
|
let e = f.value;
|
|
2340
|
-
e && (
|
|
2353
|
+
e && (T = e.clientHeight, e.scrollTop = _.value * T), le(!1);
|
|
2341
2354
|
}, 120);
|
|
2342
2355
|
}
|
|
2343
2356
|
function X() {
|
|
2344
|
-
|
|
2357
|
+
le(!0);
|
|
2345
2358
|
let e = f.value;
|
|
2346
|
-
e && (
|
|
2359
|
+
e && (T = e.clientHeight, e.scrollTop = _.value * T), ce();
|
|
2347
2360
|
}
|
|
2348
|
-
function
|
|
2349
|
-
|
|
2361
|
+
function le(e) {
|
|
2362
|
+
w.value = e, f.value?.toggleAttribute("data-resizing", e);
|
|
2350
2363
|
}
|
|
2351
|
-
function
|
|
2364
|
+
function Z() {
|
|
2352
2365
|
let e = f.value;
|
|
2353
|
-
Date.now() >= l && !u.loadMoreLocked && e &&
|
|
2366
|
+
Date.now() >= l && !u.loadMoreLocked && e && ue(e) && d("loadMore");
|
|
2354
2367
|
}
|
|
2355
|
-
|
|
2356
|
-
e > 0 && e < t && (l = Date.now() +
|
|
2368
|
+
A(() => u.items.length, (e, t) => {
|
|
2369
|
+
e > 0 && e < t && (l = Date.now() + kn);
|
|
2357
2370
|
});
|
|
2358
2371
|
function de(e) {
|
|
2359
2372
|
let t = I.value;
|
|
2360
2373
|
if (!t) return !1;
|
|
2361
|
-
let n =
|
|
2374
|
+
let n = W(t).length;
|
|
2362
2375
|
if (n <= 1) return !1;
|
|
2363
|
-
let r = (
|
|
2376
|
+
let r = (L.value + e + n) % n;
|
|
2364
2377
|
return d("mediaChange", t.postId, r), !0;
|
|
2365
2378
|
}
|
|
2366
2379
|
function fe(e) {
|
|
2367
|
-
let t =
|
|
2368
|
-
return !f.value || t < 0 || t >= u.items.length ? !1 : (
|
|
2380
|
+
let t = _.value + e;
|
|
2381
|
+
return !f.value || t < 0 || t >= u.items.length ? !1 : (me(t), !0);
|
|
2369
2382
|
}
|
|
2370
2383
|
function pe(e, t) {
|
|
2371
2384
|
let n = u.items.findIndex((t) => t.postId === e), r = u.items[n];
|
|
2372
|
-
return !f.value || !r || t < 0 || t > r.items.length ? !1 : ((u.mediaIndices.get(e) ?? 0) !== t && d("mediaChange", e, t), n !==
|
|
2385
|
+
return !f.value || !r || t < 0 || t > r.items.length ? !1 : ((u.mediaIndices.get(e) ?? 0) !== t && d("mediaChange", e, t), n !== _.value && me(n), !0);
|
|
2373
2386
|
}
|
|
2374
|
-
function Q() {
|
|
2375
|
-
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2376
|
-
}
|
|
2377
|
-
function me(e) {
|
|
2387
|
+
function Q(e) {
|
|
2378
2388
|
let t = f.value;
|
|
2379
2389
|
if (!t) return Promise.resolve();
|
|
2380
|
-
let n = e * (
|
|
2381
|
-
return
|
|
2390
|
+
let n = e * (T || t.clientHeight);
|
|
2391
|
+
return _.value = e, bn(t, n, yn());
|
|
2382
2392
|
}
|
|
2383
|
-
function
|
|
2384
|
-
|
|
2393
|
+
function me(e) {
|
|
2394
|
+
Q(e);
|
|
2385
2395
|
}
|
|
2386
|
-
async function
|
|
2396
|
+
async function he(e) {
|
|
2387
2397
|
let t = u.items.findIndex((t) => t.postId === e);
|
|
2388
|
-
return t < 0 || t ===
|
|
2398
|
+
return t < 0 || t === _.value ? !1 : (await Q(t), !0);
|
|
2389
2399
|
}
|
|
2390
|
-
async function
|
|
2391
|
-
return de(e) ? (
|
|
2400
|
+
async function ge(e) {
|
|
2401
|
+
return de(e) ? (yn() || await new Promise((e) => setTimeout(e, On)), !0) : !1;
|
|
2392
2402
|
}
|
|
2393
|
-
function
|
|
2403
|
+
function _e() {
|
|
2394
2404
|
if (!u.reelAutoAdvance.enabled) return;
|
|
2395
2405
|
let e = I.value;
|
|
2396
2406
|
if (!e) return;
|
|
2397
|
-
if (u.reelAutoAdvance.includePostItems &&
|
|
2398
|
-
d("mediaChange", e.postId,
|
|
2407
|
+
if (u.reelAutoAdvance.includePostItems && L.value < W(e).length - 1) {
|
|
2408
|
+
d("mediaChange", e.postId, L.value + 1);
|
|
2399
2409
|
return;
|
|
2400
2410
|
}
|
|
2401
|
-
let t =
|
|
2411
|
+
let t = _.value + 1, n = u.items[t];
|
|
2402
2412
|
if (!n) {
|
|
2403
2413
|
u.hasNext && u.infiniteScroll && !u.loadMoreLocked && d("loadMore");
|
|
2404
2414
|
return;
|
|
2405
2415
|
}
|
|
2406
|
-
u.reelAutoAdvance.includePostItems && (u.mediaIndices.get(n.postId) ?? 0) !== 0 && d("mediaChange", n.postId, 0),
|
|
2416
|
+
u.reelAutoAdvance.includePostItems && (u.mediaIndices.get(n.postId) ?? 0) !== 0 && d("mediaChange", n.postId, 0), me(t);
|
|
2407
2417
|
}
|
|
2408
|
-
function
|
|
2409
|
-
!u.reelAutoAdvance.enabled || e !== F.value || t !==
|
|
2418
|
+
function ve(e, t) {
|
|
2419
|
+
!u.reelAutoAdvance.enabled || e !== F.value || t !== L.value || !H.value || _e();
|
|
2410
2420
|
}
|
|
2411
|
-
return
|
|
2412
|
-
|
|
2413
|
-
}),
|
|
2421
|
+
return A(f, (e) => {
|
|
2422
|
+
k?.disconnect(), k = null, e && (T = e.clientHeight, !(typeof ResizeObserver > "u") && (k = new ResizeObserver(oe), k.observe(e)));
|
|
2423
|
+
}), A(() => u.items.length, async (e) => {
|
|
2414
2424
|
let t = u.initialPostId, n = t == null ? -1 : u.items.findIndex(({ postId: e }) => e === t);
|
|
2415
|
-
|
|
2416
|
-
}),
|
|
2425
|
+
_.value = n >= 0 ? n : Math.min(_.value, Math.max(0, e - 1)), await h(), oe();
|
|
2426
|
+
}), A(F, (e) => {
|
|
2417
2427
|
e !== void 0 && d("activeChange", e);
|
|
2418
|
-
}, { immediate: !0 }),
|
|
2419
|
-
window.addEventListener("resize", X), window.addEventListener("orientationchange", X),
|
|
2420
|
-
}),
|
|
2421
|
-
window.removeEventListener("resize", X), window.removeEventListener("orientationchange", X),
|
|
2428
|
+
}, { immediate: !0 }), b(() => {
|
|
2429
|
+
window.addEventListener("resize", X), window.addEventListener("orientationchange", X), m >= 0 && h(oe);
|
|
2430
|
+
}), y(() => {
|
|
2431
|
+
window.removeEventListener("resize", X), window.removeEventListener("orientationchange", X), k?.disconnect(), j !== null && cancelAnimationFrame(j), M !== null && clearTimeout(M);
|
|
2422
2432
|
}), n({
|
|
2423
|
-
activeIndex:
|
|
2433
|
+
activeIndex: _,
|
|
2424
2434
|
activePostId: F,
|
|
2425
2435
|
changeActiveMedia: de,
|
|
2426
|
-
loadIfNearBottom:
|
|
2436
|
+
loadIfNearBottom: Z,
|
|
2427
2437
|
moveActivePost: fe,
|
|
2428
2438
|
navigateToItem: pe,
|
|
2429
|
-
transitionActiveMedia:
|
|
2430
|
-
transitionActivePost:
|
|
2431
|
-
}), (n, r) => (
|
|
2432
|
-
class:
|
|
2439
|
+
transitionActiveMedia: ge,
|
|
2440
|
+
transitionActivePost: he
|
|
2441
|
+
}), (n, r) => (x(), s("main", {
|
|
2442
|
+
class: g(["reel-shell", {
|
|
2433
2443
|
"reel-shell--has-footer": !!t.cardFooter,
|
|
2434
2444
|
"reel-shell--has-header": !!t.cardHeader
|
|
2435
2445
|
}]),
|
|
2436
2446
|
"data-layout-mode": "reel"
|
|
2437
2447
|
}, [
|
|
2438
|
-
t.cardHeader && I.value && t.reelForward.status === "idle" ? (
|
|
2448
|
+
t.cardHeader && I.value && t.reelForward.status === "idle" ? (x(), a(at, {
|
|
2439
2449
|
key: 0,
|
|
2440
|
-
index:
|
|
2450
|
+
index: _.value,
|
|
2441
2451
|
item: I.value,
|
|
2442
2452
|
layout: "reel",
|
|
2443
2453
|
"loaded-count": t.items.length,
|
|
2444
|
-
"media-index":
|
|
2454
|
+
"media-index": L.value,
|
|
2445
2455
|
"media-source": t.mediaSource,
|
|
2446
2456
|
placement: "header",
|
|
2447
2457
|
region: t.cardHeader,
|
|
2448
|
-
style:
|
|
2458
|
+
style: v(t.mediaCard?.header),
|
|
2449
2459
|
total: t.total
|
|
2450
2460
|
}, null, 8, [
|
|
2451
2461
|
"index",
|
|
@@ -2457,40 +2467,40 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2457
2467
|
"style",
|
|
2458
2468
|
"total"
|
|
2459
2469
|
])) : o("", !0),
|
|
2460
|
-
c("div",
|
|
2470
|
+
c("div", wn, [c("div", {
|
|
2461
2471
|
ref_key: "galleryElement",
|
|
2462
2472
|
ref: f,
|
|
2463
2473
|
class: "gallery-shell reel-feed",
|
|
2464
2474
|
"data-active-post-id": F.value,
|
|
2465
|
-
"data-active-media-index":
|
|
2466
|
-
onScrollPassive:
|
|
2467
|
-
}, [t.reelForward.status === "idle" ? (
|
|
2475
|
+
"data-active-media-index": L.value,
|
|
2476
|
+
onScrollPassive: ae
|
|
2477
|
+
}, [t.reelForward.status === "idle" ? (x(), s("section", {
|
|
2468
2478
|
key: 1,
|
|
2469
2479
|
class: "reel-track",
|
|
2470
|
-
style:
|
|
2480
|
+
style: v(N.value),
|
|
2471
2481
|
"aria-label": "Media gallery"
|
|
2472
|
-
}, [(
|
|
2482
|
+
}, [(x(!0), s(e, null, C(P.value, ({ fetchPriority: e, item: n, index: i }) => (x(), a(sn, {
|
|
2473
2483
|
key: n.postId,
|
|
2474
|
-
active: i ===
|
|
2475
|
-
"advance-on-media-end": u.reelAutoAdvance.enabled && i ===
|
|
2484
|
+
active: i === _.value && !S.value,
|
|
2485
|
+
"advance-on-media-end": u.reelAutoAdvance.enabled && i === _.value,
|
|
2476
2486
|
class: "reel-item",
|
|
2477
2487
|
entering: !1,
|
|
2478
2488
|
"fetch-priority": e,
|
|
2479
2489
|
index: i,
|
|
2480
2490
|
item: n,
|
|
2481
|
-
"item-style":
|
|
2491
|
+
"item-style": re(i),
|
|
2482
2492
|
"media-card": t.mediaCard,
|
|
2483
2493
|
layout: "reel",
|
|
2484
2494
|
"loaded-count": t.items.length,
|
|
2485
2495
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2486
2496
|
"media-source": t.mediaSource,
|
|
2487
|
-
"preview-state": t.previewStates.get(
|
|
2497
|
+
"preview-state": t.previewStates.get(O(q)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2488
2498
|
"reel-controls-target": p.value,
|
|
2489
2499
|
"reel-audio-state": t.reelAudioState,
|
|
2490
2500
|
"stationary-reel-controls": "",
|
|
2491
2501
|
total: t.total,
|
|
2492
2502
|
onMediaChange: (e) => d("mediaChange", n.postId, e),
|
|
2493
|
-
onEnded: (e) =>
|
|
2503
|
+
onEnded: (e) => ve(n.postId, e),
|
|
2494
2504
|
onReady: (e) => d("ready", n.postId, e),
|
|
2495
2505
|
onReelAudioChange: r[1] ||= (e) => d("reelAudioChange", e),
|
|
2496
2506
|
onError: (e) => d("error", n.postId, e),
|
|
@@ -2515,18 +2525,18 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2515
2525
|
"onReady",
|
|
2516
2526
|
"onError",
|
|
2517
2527
|
"onMediaError"
|
|
2518
|
-
]))), 128))], 4)) : (
|
|
2528
|
+
]))), 128))], 4)) : (x(), s("div", {
|
|
2519
2529
|
key: 0,
|
|
2520
2530
|
class: "reel-forward-status",
|
|
2521
2531
|
role: t.reelForward.status === "error" ? "alert" : "status",
|
|
2522
2532
|
"data-status": t.reelForward.status
|
|
2523
|
-
}, [c("p", null,
|
|
2533
|
+
}, [c("p", null, D(ne.value), 1), t.reelForward.status === "error" || t.reelForward.status === "end" ? (x(), s("button", {
|
|
2524
2534
|
key: 0,
|
|
2525
2535
|
class: "reel-forward-retry",
|
|
2526
2536
|
type: "button",
|
|
2527
2537
|
disabled: t.loadMoreLocked,
|
|
2528
2538
|
onClick: r[0] ||= (e) => d("retryForward")
|
|
2529
|
-
},
|
|
2539
|
+
}, D(te.value ? "Load more" : "Retry"), 9, Dn)) : o("", !0)], 8, En)), t.reelForward.status === "idle" ? (x(), a(se, {
|
|
2530
2540
|
key: 2,
|
|
2531
2541
|
actions: t.feedFooterActions,
|
|
2532
2542
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -2535,7 +2545,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2535
2545
|
"has-next": t.hasNext,
|
|
2536
2546
|
"is-loading": t.isLoadingMore,
|
|
2537
2547
|
"load-more-locked": t.loadMoreLocked,
|
|
2538
|
-
"show-load-more":
|
|
2548
|
+
"show-load-more": Y.value,
|
|
2539
2549
|
state: t.state,
|
|
2540
2550
|
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2541
2551
|
onRetryEnd: r[3] ||= (e) => d("retryEnd")
|
|
@@ -2549,23 +2559,23 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2549
2559
|
"load-more-locked",
|
|
2550
2560
|
"show-load-more",
|
|
2551
2561
|
"state"
|
|
2552
|
-
])) : o("", !0)], 40,
|
|
2562
|
+
])) : o("", !0)], 40, Tn), c("div", {
|
|
2553
2563
|
ref_key: "reelControlsElement",
|
|
2554
2564
|
ref: p,
|
|
2555
2565
|
class: "reel-media-controls-host",
|
|
2556
2566
|
"data-test": "reel-media-controls-host"
|
|
2557
2567
|
}, null, 512)]),
|
|
2558
|
-
t.cardFooter && I.value && t.reelForward.status === "idle" ? (
|
|
2568
|
+
t.cardFooter && I.value && t.reelForward.status === "idle" ? (x(), a(at, {
|
|
2559
2569
|
key: 1,
|
|
2560
|
-
index:
|
|
2570
|
+
index: _.value,
|
|
2561
2571
|
item: I.value,
|
|
2562
2572
|
layout: "reel",
|
|
2563
2573
|
"loaded-count": t.items.length,
|
|
2564
|
-
"media-index":
|
|
2574
|
+
"media-index": L.value,
|
|
2565
2575
|
"media-source": t.mediaSource,
|
|
2566
2576
|
placement: "footer",
|
|
2567
2577
|
region: t.cardFooter,
|
|
2568
|
-
style:
|
|
2578
|
+
style: v(t.mediaCard?.footer),
|
|
2569
2579
|
total: t.total
|
|
2570
2580
|
}, null, 8, [
|
|
2571
2581
|
"index",
|
|
@@ -2577,24 +2587,24 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2577
2587
|
"style",
|
|
2578
2588
|
"total"
|
|
2579
2589
|
])) : o("", !0),
|
|
2580
|
-
|
|
2581
|
-
key:
|
|
2590
|
+
J.value ? (x(), a(Cn, {
|
|
2591
|
+
key: G.value,
|
|
2582
2592
|
"duration-ms": t.reelAutoAdvance.intervalMs,
|
|
2583
|
-
label:
|
|
2584
|
-
onComplete:
|
|
2593
|
+
label: ee.value,
|
|
2594
|
+
onComplete: _e
|
|
2585
2595
|
}, null, 8, ["duration-ms", "label"])) : o("", !0)
|
|
2586
2596
|
], 2));
|
|
2587
2597
|
}
|
|
2588
|
-
}),
|
|
2598
|
+
}), jn = ["data-info-sheet-open", "data-info-sheet-mode"], Mn = ["aria-hidden", "inert"], Nn = {
|
|
2589
2599
|
key: 0,
|
|
2590
2600
|
class: "reel-info-sheet-layer",
|
|
2591
2601
|
"data-test": "reel-info-sheet"
|
|
2592
|
-
},
|
|
2602
|
+
}, Pn = [
|
|
2593
2603
|
"role",
|
|
2594
2604
|
"aria-modal",
|
|
2595
2605
|
"tabindex",
|
|
2596
2606
|
"data-active-post-id"
|
|
2597
|
-
],
|
|
2607
|
+
], Fn = /* @__PURE__ */ d({
|
|
2598
2608
|
__name: "ReelLayout",
|
|
2599
2609
|
props: {
|
|
2600
2610
|
forwardIndex: { default: null },
|
|
@@ -2641,23 +2651,23 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2641
2651
|
"retryForward"
|
|
2642
2652
|
],
|
|
2643
2653
|
setup(e, { expose: t, emit: i }) {
|
|
2644
|
-
let l = e, d = i, p =
|
|
2654
|
+
let l = e, d = i, p = E(null), m = E(null), v = null, b = r(() => {
|
|
2645
2655
|
let e = l.initialPostId === null || l.initialPostId === void 0 ? -1 : l.items.findIndex((e) => e.postId === l.initialPostId);
|
|
2646
2656
|
return Math.max(0, e);
|
|
2647
|
-
}), S = r(() => l.items[
|
|
2648
|
-
let e =
|
|
2657
|
+
}), S = r(() => l.items[b.value]), C = r(() => S.value ?? (l.reelForward.status === "idle" ? void 0 : l.forwardItem ?? void 0)), w = r(() => S.value ? b.value : l.forwardIndex ?? 0), D = r(() => {
|
|
2658
|
+
let e = C.value?.postId;
|
|
2649
2659
|
return e === void 0 ? 0 : l.mediaIndices.get(e) ?? 0;
|
|
2650
|
-
}),
|
|
2651
|
-
let e =
|
|
2660
|
+
}), O = r(() => !!(l.infoSheet && l.infoSheetEnabled && C.value)), k = r(() => {
|
|
2661
|
+
let e = C.value;
|
|
2652
2662
|
return e ? {
|
|
2653
2663
|
close: M,
|
|
2654
|
-
index:
|
|
2664
|
+
index: w.value,
|
|
2655
2665
|
item: e,
|
|
2656
2666
|
layout: "reel",
|
|
2657
2667
|
loadedCount: l.items.length,
|
|
2658
|
-
mediaCount:
|
|
2668
|
+
mediaCount: W(e).length,
|
|
2659
2669
|
mediaIndex: D.value,
|
|
2660
|
-
mediaItem:
|
|
2670
|
+
mediaItem: K(e, D.value),
|
|
2661
2671
|
mediaSource: l.mediaSource ?? "preview",
|
|
2662
2672
|
origin: l.origin,
|
|
2663
2673
|
total: l.total
|
|
@@ -2690,23 +2700,23 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2690
2700
|
function B(e, t) {
|
|
2691
2701
|
d("mediaChange", e, t);
|
|
2692
2702
|
}
|
|
2693
|
-
function
|
|
2703
|
+
function V(e, t) {
|
|
2694
2704
|
d("ready", e, t);
|
|
2695
2705
|
}
|
|
2696
|
-
return
|
|
2706
|
+
return A(() => ({
|
|
2697
2707
|
overlay: l.infoSheetOverlay,
|
|
2698
|
-
visible:
|
|
2708
|
+
visible: O.value
|
|
2699
2709
|
}), async (e, t) => {
|
|
2700
2710
|
if (e.visible && !t?.visible) {
|
|
2701
|
-
|
|
2711
|
+
v = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.overlay && (await h(), m.value?.focus({ preventScroll: !0 }));
|
|
2702
2712
|
return;
|
|
2703
2713
|
}
|
|
2704
|
-
if (!e.visible && t?.visible &&
|
|
2705
|
-
let e =
|
|
2706
|
-
|
|
2714
|
+
if (!e.visible && t?.visible && v?.isConnected) {
|
|
2715
|
+
let e = v;
|
|
2716
|
+
v = null, await h(), e.focus({ preventScroll: !0 });
|
|
2707
2717
|
}
|
|
2708
|
-
}),
|
|
2709
|
-
|
|
2718
|
+
}), y(() => {
|
|
2719
|
+
v = null;
|
|
2710
2720
|
}), t({
|
|
2711
2721
|
changeActiveMedia: N,
|
|
2712
2722
|
loadIfNearBottom: P,
|
|
@@ -2714,15 +2724,15 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2714
2724
|
navigateToItem: I,
|
|
2715
2725
|
transitionActiveMedia: L,
|
|
2716
2726
|
transitionActivePost: R
|
|
2717
|
-
}), (t, r) => (
|
|
2718
|
-
class:
|
|
2719
|
-
"data-info-sheet-open":
|
|
2727
|
+
}), (t, r) => (x(), s("section", {
|
|
2728
|
+
class: g(["reel-layout", `reel-layout--${e.infoSheetOverlay ? "overlay" : "layout"}`]),
|
|
2729
|
+
"data-info-sheet-open": O.value || void 0,
|
|
2720
2730
|
"data-info-sheet-mode": e.infoSheetOverlay ? "overlay" : "layout"
|
|
2721
2731
|
}, [c("div", {
|
|
2722
2732
|
class: "reel-layout-main",
|
|
2723
|
-
"aria-hidden": e.infoSheetOverlay &&
|
|
2724
|
-
inert: e.infoSheetOverlay &&
|
|
2725
|
-
}, [u(
|
|
2733
|
+
"aria-hidden": e.infoSheetOverlay && O.value || void 0,
|
|
2734
|
+
inert: e.infoSheetOverlay && O.value || void 0
|
|
2735
|
+
}, [u(An, {
|
|
2726
2736
|
ref_key: "reelFeed",
|
|
2727
2737
|
ref: p,
|
|
2728
2738
|
"can-retry-end": e.canRetryEnd,
|
|
@@ -2751,7 +2761,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2751
2761
|
onMediaError: r[1] ||= (e, t) => d("mediaError", e, t),
|
|
2752
2762
|
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2753
2763
|
onMediaChange: B,
|
|
2754
|
-
onReady:
|
|
2764
|
+
onReady: V,
|
|
2755
2765
|
onRetryEnd: r[3] ||= (e) => d("retryEnd"),
|
|
2756
2766
|
onRetryForward: r[4] ||= (e) => d("retryForward"),
|
|
2757
2767
|
onReelAudioChange: r[5] ||= (e) => d("reelAudioChange", e)
|
|
@@ -2777,27 +2787,27 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2777
2787
|
"reel-forward",
|
|
2778
2788
|
"state",
|
|
2779
2789
|
"total"
|
|
2780
|
-
])], 8,
|
|
2781
|
-
default:
|
|
2790
|
+
])], 8, Mn), u(n, { name: "vibe-info-sheet" }, {
|
|
2791
|
+
default: j(() => [O.value && e.infoSheet && k.value ? (x(), s("div", Nn, [c("aside", {
|
|
2782
2792
|
ref_key: "sheetElement",
|
|
2783
|
-
ref:
|
|
2793
|
+
ref: m,
|
|
2784
2794
|
class: "reel-info-sheet",
|
|
2785
2795
|
role: e.infoSheetOverlay ? "dialog" : "complementary",
|
|
2786
2796
|
"aria-label": "Reel information",
|
|
2787
2797
|
"aria-modal": e.infoSheetOverlay ? "true" : void 0,
|
|
2788
2798
|
tabindex: e.infoSheetOverlay ? -1 : void 0,
|
|
2789
|
-
"data-active-post-id":
|
|
2790
|
-
}, [(
|
|
2799
|
+
"data-active-post-id": C.value?.postId
|
|
2800
|
+
}, [(x(), a(T(e.infoSheet.component), _(f(k.value)), null, 16))], 8, Pn)])) : o("", !0)]),
|
|
2791
2801
|
_: 1
|
|
2792
|
-
})], 10,
|
|
2802
|
+
})], 10, jn));
|
|
2793
2803
|
}
|
|
2794
2804
|
});
|
|
2795
2805
|
//#endregion
|
|
2796
2806
|
//#region src/core/mediaLifecycle.ts
|
|
2797
|
-
function
|
|
2807
|
+
function In(e, t, n, r, i) {
|
|
2798
2808
|
let a = e.items.findIndex((e) => e.postId === t), o = e.items[a];
|
|
2799
2809
|
if (!o) return null;
|
|
2800
|
-
let s =
|
|
2810
|
+
let s = G(o, n), c = K(o, s);
|
|
2801
2811
|
return {
|
|
2802
2812
|
item: o,
|
|
2803
2813
|
layout: r,
|
|
@@ -2810,8 +2820,8 @@ function Mn(e, t, n, r, i) {
|
|
|
2810
2820
|
postIndex: a
|
|
2811
2821
|
};
|
|
2812
2822
|
}
|
|
2813
|
-
function
|
|
2814
|
-
|
|
2823
|
+
function Ln(e, t) {
|
|
2824
|
+
A(() => {
|
|
2815
2825
|
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null;
|
|
2816
2826
|
return {
|
|
2817
2827
|
mediaIndex: t === null ? 0 : e.mediaIndices.get(t) ?? 0,
|
|
@@ -2820,23 +2830,23 @@ function Nn(e, t) {
|
|
|
2820
2830
|
};
|
|
2821
2831
|
}, (n, r) => {
|
|
2822
2832
|
if (n.postId === null || n.postId === r?.postId && n.mediaIndex === r.mediaIndex && n.origin === r.origin) return;
|
|
2823
|
-
let i =
|
|
2833
|
+
let i = In(e, n.postId, n.mediaIndex, "reel", n.origin);
|
|
2824
2834
|
i && t(i);
|
|
2825
2835
|
}, { flush: "sync" });
|
|
2826
2836
|
}
|
|
2827
2837
|
//#endregion
|
|
2828
2838
|
//#region src/components/useMediaLifecycle.ts
|
|
2829
|
-
function
|
|
2830
|
-
let n = /* @__PURE__ */ new Set(), i =
|
|
2839
|
+
function Rn(e, t) {
|
|
2840
|
+
let n = /* @__PURE__ */ new Set(), i = E(/* @__PURE__ */ new Map()), a = E(/* @__PURE__ */ new Map()), o = E(/* @__PURE__ */ new Map()), s = () => e.reelMediaSource === "preview" ? i : e.reelMediaSource === "mobile" ? o : a, c = r(() => s().value), l = /* @__PURE__ */ new Set();
|
|
2831
2841
|
function u() {
|
|
2832
2842
|
n.clear(), l.clear(), i.value = /* @__PURE__ */ new Map(), a.value = /* @__PURE__ */ new Map(), o.value = /* @__PURE__ */ new Map();
|
|
2833
2843
|
}
|
|
2834
2844
|
function d(e, t, n, r) {
|
|
2835
|
-
let i =
|
|
2845
|
+
let i = q(t, n);
|
|
2836
2846
|
e.value.get(i) !== r && (e.value = new Map(e.value).set(i, r));
|
|
2837
2847
|
}
|
|
2838
2848
|
function f(t, n, r, i) {
|
|
2839
|
-
return
|
|
2849
|
+
return In(e, t, n, r, i);
|
|
2840
2850
|
}
|
|
2841
2851
|
function p(e, n, r, i) {
|
|
2842
2852
|
let a = f(e, n, r, i);
|
|
@@ -2862,13 +2872,13 @@ function Pn(e, t) {
|
|
|
2862
2872
|
d(s(), t, n, "ready"), p(t, n, "reel", e.reelOrigin ?? "reel");
|
|
2863
2873
|
}
|
|
2864
2874
|
function y(e, n) {
|
|
2865
|
-
let r =
|
|
2875
|
+
let r = q(e, n);
|
|
2866
2876
|
if (l.has(r)) return;
|
|
2867
2877
|
let i = f(e, n, "masonry", null);
|
|
2868
2878
|
i && (l.add(r), t.visible(i));
|
|
2869
2879
|
}
|
|
2870
2880
|
function b(e, r, i, a) {
|
|
2871
|
-
let o = [i,
|
|
2881
|
+
let o = [i, q(e, r)].join(":");
|
|
2872
2882
|
if (n.has(o)) return;
|
|
2873
2883
|
let s = f(e, r, i, a);
|
|
2874
2884
|
s && (n.add(o), t.fullyVisible(s));
|
|
@@ -2876,13 +2886,13 @@ function Pn(e, t) {
|
|
|
2876
2886
|
function x(e, t) {
|
|
2877
2887
|
b(e, t, "masonry", null);
|
|
2878
2888
|
}
|
|
2879
|
-
return
|
|
2889
|
+
return Ln(e, t.reelChange), A(() => {
|
|
2880
2890
|
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null, n = t === null ? 0 : e.mediaIndices.get(t) ?? 0;
|
|
2881
2891
|
return {
|
|
2882
2892
|
mediaIndex: n,
|
|
2883
2893
|
origin: e.reelOrigin ?? "reel",
|
|
2884
2894
|
postId: t,
|
|
2885
|
-
ready: t !== null && c.value.get(
|
|
2895
|
+
ready: t !== null && c.value.get(q(t, n)) === "ready"
|
|
2886
2896
|
};
|
|
2887
2897
|
}, (e, t) => {
|
|
2888
2898
|
e.postId === null || !e.ready || t?.ready && t.postId === e.postId && t.mediaIndex === e.mediaIndex && t.origin === e.origin || b(e.postId, e.mediaIndex, "reel", e.origin);
|
|
@@ -2902,16 +2912,16 @@ function Pn(e, t) {
|
|
|
2902
2912
|
}
|
|
2903
2913
|
//#endregion
|
|
2904
2914
|
//#region src/core/reelEscapeStack.ts
|
|
2905
|
-
var
|
|
2906
|
-
function
|
|
2907
|
-
return
|
|
2908
|
-
let t =
|
|
2909
|
-
t >= 0 &&
|
|
2915
|
+
var zn = [];
|
|
2916
|
+
function Bn(e) {
|
|
2917
|
+
return zn.push(e), () => {
|
|
2918
|
+
let t = zn.indexOf(e);
|
|
2919
|
+
t >= 0 && zn.splice(t, 1);
|
|
2910
2920
|
};
|
|
2911
2921
|
}
|
|
2912
|
-
function
|
|
2922
|
+
function Vn(e) {
|
|
2913
2923
|
if (!e.isActive()) return !1;
|
|
2914
|
-
let t =
|
|
2924
|
+
let t = zn.filter((e) => e.isActive()), n = e.element();
|
|
2915
2925
|
return n !== null && t.some((t) => {
|
|
2916
2926
|
if (t === e) return !1;
|
|
2917
2927
|
let r = t.element();
|
|
@@ -2927,14 +2937,14 @@ function Ln(e) {
|
|
|
2927
2937
|
}
|
|
2928
2938
|
//#endregion
|
|
2929
2939
|
//#region src/components/useReelKeyboard.ts
|
|
2930
|
-
function
|
|
2940
|
+
function Hn(e) {
|
|
2931
2941
|
let t = {
|
|
2932
2942
|
element: e.element,
|
|
2933
2943
|
isActive: () => e.state.layout === "reel" || e.state.reelOrigin === "masonry"
|
|
2934
2944
|
}, n = null;
|
|
2935
2945
|
function r(n) {
|
|
2936
2946
|
let r = t.isActive();
|
|
2937
|
-
if (n.key === "Escape" && r && !
|
|
2947
|
+
if (n.key === "Escape" && r && !Vn(t)) return;
|
|
2938
2948
|
if (n.key === "Escape" && e.state.reelOrigin === "masonry") {
|
|
2939
2949
|
n.preventDefault(), e.state.reelInfoSheetOverlay && e.state.reelInfoSheet.enabled && e.setReelInfoSheet(!1), e.closeMasonryReel();
|
|
2940
2950
|
return;
|
|
@@ -2953,15 +2963,15 @@ function Rn(e) {
|
|
|
2953
2963
|
let a = n.key === "ArrowLeft" ? -1 : n.key === "ArrowRight" ? 1 : 0;
|
|
2954
2964
|
a !== 0 && e.reelRenderer()?.changeActiveMedia?.(a) && n.preventDefault();
|
|
2955
2965
|
}
|
|
2956
|
-
|
|
2957
|
-
n =
|
|
2958
|
-
}),
|
|
2966
|
+
b(() => {
|
|
2967
|
+
n = Bn(t), window.addEventListener("keydown", r);
|
|
2968
|
+
}), y(() => {
|
|
2959
2969
|
window.removeEventListener("keydown", r), n?.(), n = null;
|
|
2960
2970
|
});
|
|
2961
2971
|
}
|
|
2962
2972
|
//#endregion
|
|
2963
2973
|
//#region src/components/VibeSurface.vue?vue&type=script&setup=true&lang.ts
|
|
2964
|
-
var
|
|
2974
|
+
var Un = 35, Wn = 420, Gn = /* @__PURE__ */ d({
|
|
2965
2975
|
__name: "VibeSurface",
|
|
2966
2976
|
props: {
|
|
2967
2977
|
canRetryEnd: { type: Boolean },
|
|
@@ -2991,69 +3001,69 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
2991
3001
|
"retryForward"
|
|
2992
3002
|
],
|
|
2993
3003
|
setup(t, { expose: i, emit: c }) {
|
|
2994
|
-
let l = t, d = c, f =
|
|
3004
|
+
let l = t, d = c, f = E(null), p = E(null), m = E(null), g = E(null), _ = E(!1), v = E(/* @__PURE__ */ new Set()), b = E(/* @__PURE__ */ new Map()), S = E(/* @__PURE__ */ new Set()), C = E(/* @__PURE__ */ new Map()), w = r(() => Object.freeze([...l.state.items])), T = r(() => Y(l.state, w.value)), { markMediaError: D, markMasonryFullyVisible: k, markMasonryVisible: M, markPreviewError: N, markPreviewReady: P, markReelError: F, markReelReady: I, originalStates: L, previewStates: R, reelStates: z, resetMediaLifecycle: B } = Rn(l.state, {
|
|
2995
3005
|
error: (e) => d("mediaError", e),
|
|
2996
3006
|
fullyVisible: (e) => d("mediaFullyVisible", e),
|
|
2997
3007
|
ready: (e) => d("mediaReady", e),
|
|
2998
3008
|
reelChange: (e) => d("reelMediaChange", e),
|
|
2999
3009
|
visible: (e) => d("mediaVisible", e)
|
|
3000
|
-
}),
|
|
3001
|
-
function
|
|
3010
|
+
}), V = new Set(l.state.items.map((e) => e.postId)), H = null, U = null, K = !1;
|
|
3011
|
+
function q() {
|
|
3002
3012
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
3003
3013
|
}
|
|
3004
|
-
function
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3014
|
+
function ee() {
|
|
3015
|
+
H !== null && cancelAnimationFrame(H), H = requestAnimationFrame(() => {
|
|
3016
|
+
H = requestAnimationFrame(() => {
|
|
3017
|
+
H = null, v.value = /* @__PURE__ */ new Set();
|
|
3008
3018
|
});
|
|
3009
3019
|
});
|
|
3010
3020
|
}
|
|
3011
3021
|
function J(e, t) {
|
|
3012
3022
|
let n = l.state.items.find((t) => t.postId === e);
|
|
3013
3023
|
if (!n) return;
|
|
3014
|
-
let r =
|
|
3024
|
+
let r = G(n, t);
|
|
3015
3025
|
(l.state.mediaIndices.get(e) ?? 0) !== r && (l.state.mediaIndices = new Map(l.state.mediaIndices).set(e, r));
|
|
3016
3026
|
}
|
|
3017
|
-
async function
|
|
3018
|
-
await
|
|
3027
|
+
async function te() {
|
|
3028
|
+
await h(), (l.state.layout === "reel" || l.state.reelOrigin === "masonry" ? p.value : f.value)?.loadIfNearBottom();
|
|
3019
3029
|
}
|
|
3020
|
-
function
|
|
3030
|
+
function ne(e) {
|
|
3021
3031
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.changeActiveMedia?.(e) ?? !1;
|
|
3022
3032
|
}
|
|
3023
|
-
function
|
|
3033
|
+
function re(e) {
|
|
3024
3034
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.moveActivePost?.(e) ?? !1;
|
|
3025
3035
|
}
|
|
3026
|
-
function
|
|
3036
|
+
function ie(e) {
|
|
3027
3037
|
if (!(l.state.layout === "reel" || l.state.reelOrigin === "masonry") || l.state.isLoading) return "reel-inactive";
|
|
3028
3038
|
let t = l.state.items.find((t) => t.postId === e.postId);
|
|
3029
3039
|
if (!t) return "not-found";
|
|
3030
|
-
let n =
|
|
3040
|
+
let n = W(t).findIndex((t) => t.mediaId === e.mediaId);
|
|
3031
3041
|
return n < 0 ? "not-found" : p.value?.navigateToItem?.(e.postId, n) ? "navigated" : "reel-inactive";
|
|
3032
3042
|
}
|
|
3033
|
-
function
|
|
3043
|
+
function ae() {
|
|
3034
3044
|
return l.state.layout !== "masonry" || l.state.reelOrigin === "masonry" ? null : f.value?.getScrollElement?.() ?? null;
|
|
3035
3045
|
}
|
|
3036
|
-
function
|
|
3037
|
-
|
|
3046
|
+
function oe(e, t) {
|
|
3047
|
+
U = e, K = t === "keyboard", d("openReel", e), h(() => m.value?.focus());
|
|
3038
3048
|
}
|
|
3039
|
-
function
|
|
3049
|
+
function se(e) {
|
|
3040
3050
|
let t = g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [];
|
|
3041
3051
|
return Array.from(t).find((t) => t.dataset.postId === String(e)) ?? null;
|
|
3042
3052
|
}
|
|
3043
|
-
function
|
|
3044
|
-
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null ||
|
|
3053
|
+
function ce(e, t) {
|
|
3054
|
+
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null || q()) return 0;
|
|
3045
3055
|
let n = [...new Set(e)], r = new Set(Array.from(g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [], (e) => e.dataset.postId)), i = n.filter((e) => r.has(String(e)));
|
|
3046
3056
|
if (i.length === 0) return 0;
|
|
3047
|
-
let a = new Map(C.value), o = t?.staggerMs ??
|
|
3057
|
+
let a = new Map(C.value), o = t?.staggerMs ?? Un;
|
|
3048
3058
|
return i.forEach((e, t) => {
|
|
3049
3059
|
a.set(e, t * o);
|
|
3050
|
-
}),
|
|
3060
|
+
}), v.value = new Set([...v.value].filter((e) => !i.includes(e))), S.value = new Set([...S.value, ...n]), C.value = a, Wn + (i.length - 1) * o;
|
|
3051
3061
|
}
|
|
3052
3062
|
function X() {
|
|
3053
3063
|
S.value = /* @__PURE__ */ new Set(), C.value = /* @__PURE__ */ new Map();
|
|
3054
3064
|
}
|
|
3055
|
-
async function
|
|
3056
|
-
if (t.aborted ||
|
|
3065
|
+
async function ue(e, t) {
|
|
3066
|
+
if (t.aborted || ce(e, { staggerMs: 0 }) === 0 || (await h(), t.aborted)) return;
|
|
3057
3067
|
let n = g.value?.querySelectorAll(".masonry-feed .media-card--leaving") ?? [], r = Array.from(n).flatMap((e) => (getComputedStyle(e).opacity, e.getAnimations?.().filter((e) => e.effect?.getTiming().iterations !== Infinity) ?? []));
|
|
3058
3068
|
await new Promise((e) => {
|
|
3059
3069
|
let n = () => {
|
|
@@ -3062,60 +3072,60 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3062
3072
|
t.addEventListener("abort", n, { once: !0 }), t.aborted ? n() : Promise.allSettled(r.map((e) => e.finished)).then(n);
|
|
3063
3073
|
});
|
|
3064
3074
|
}
|
|
3065
|
-
function
|
|
3066
|
-
let n =
|
|
3075
|
+
function Z(e, t) {
|
|
3076
|
+
let n = se(e), r = n?.querySelector(".media-card-activator") ?? n;
|
|
3067
3077
|
r && (r.classList.toggle("media-card-focus-silent", !t), t || r.addEventListener("blur", () => {
|
|
3068
3078
|
r.classList.remove("media-card-focus-silent");
|
|
3069
3079
|
}, { once: !0 }), r?.focus({ preventScroll: !0 }));
|
|
3070
3080
|
}
|
|
3071
3081
|
function de() {
|
|
3072
|
-
l.state.reelOrigin === "masonry" && (
|
|
3082
|
+
l.state.reelOrigin === "masonry" && (U ??= l.state.activeReelPostId, _.value = !0, d("closeReel"));
|
|
3073
3083
|
}
|
|
3074
3084
|
function fe() {
|
|
3075
|
-
let e =
|
|
3076
|
-
_.value = !1,
|
|
3077
|
-
e !== null &&
|
|
3085
|
+
let e = U, t = K;
|
|
3086
|
+
_.value = !1, U = null, K = !1, h(() => {
|
|
3087
|
+
e !== null && Z(e, t);
|
|
3078
3088
|
});
|
|
3079
3089
|
}
|
|
3080
|
-
return
|
|
3090
|
+
return Hn({
|
|
3081
3091
|
closeMasonryReel: de,
|
|
3082
3092
|
element: () => g.value,
|
|
3083
3093
|
isReelLeaving: () => _.value,
|
|
3084
3094
|
reelRenderer: () => p.value,
|
|
3085
3095
|
setReelInfoSheet: (e) => d("reelInfoSheetChange", e),
|
|
3086
3096
|
state: l.state
|
|
3087
|
-
}),
|
|
3097
|
+
}), A(() => {
|
|
3088
3098
|
let e = l.state.items;
|
|
3089
3099
|
return [e, e.length];
|
|
3090
3100
|
}, ([e]) => {
|
|
3091
|
-
let t = e.map((e) => e.postId), n = t.filter((e) => !
|
|
3092
|
-
if (
|
|
3101
|
+
let t = e.map((e) => e.postId), n = t.filter((e) => !V.has(e)), r = new Set(t);
|
|
3102
|
+
if (V = new Set(t), S.value = new Set([...S.value].filter((e) => r.has(e))), C.value = new Map([...C.value].filter(([e]) => r.has(e))), n.length === 0 || q()) return;
|
|
3093
3103
|
let i = /* @__PURE__ */ new Map();
|
|
3094
3104
|
t.forEach((e) => {
|
|
3095
|
-
let t =
|
|
3105
|
+
let t = b.value.get(e);
|
|
3096
3106
|
t !== void 0 && i.set(e, t);
|
|
3097
3107
|
}), n.forEach((e, t) => {
|
|
3098
|
-
i.set(e, t *
|
|
3099
|
-
}),
|
|
3100
|
-
}, { flush: "sync" }),
|
|
3101
|
-
|
|
3108
|
+
i.set(e, t * Un);
|
|
3109
|
+
}), b.value = i, v.value = new Set([...v.value, ...n]), ee();
|
|
3110
|
+
}, { flush: "sync" }), y(() => {
|
|
3111
|
+
H !== null && cancelAnimationFrame(H);
|
|
3102
3112
|
}), i({
|
|
3103
|
-
animateItemRemoval:
|
|
3113
|
+
animateItemRemoval: ue,
|
|
3104
3114
|
cancelItemRemoval: X,
|
|
3105
|
-
changeActiveReelMedia:
|
|
3106
|
-
getAutoScrollElement:
|
|
3107
|
-
loadIfNearBottom:
|
|
3108
|
-
moveActiveReelPost:
|
|
3109
|
-
navigateToReelItem:
|
|
3115
|
+
changeActiveReelMedia: ne,
|
|
3116
|
+
getAutoScrollElement: ae,
|
|
3117
|
+
loadIfNearBottom: te,
|
|
3118
|
+
moveActiveReelPost: re,
|
|
3119
|
+
navigateToReelItem: ie,
|
|
3110
3120
|
resetMediaLifecycle: B,
|
|
3111
|
-
startItemRemoval:
|
|
3121
|
+
startItemRemoval: ce,
|
|
3112
3122
|
transitionActiveReelMedia: (e) => p.value?.transitionActiveMedia?.(e) ?? Promise.resolve(!1),
|
|
3113
3123
|
transitionActiveReelPost: (e) => p.value?.transitionActivePost?.(e) ?? Promise.resolve(!1)
|
|
3114
|
-
}), (r, i) => (
|
|
3124
|
+
}), (r, i) => (x(), s("div", {
|
|
3115
3125
|
ref_key: "surfaceElement",
|
|
3116
3126
|
ref: g,
|
|
3117
3127
|
class: "vibe-surface"
|
|
3118
|
-
}, [t.state.layout === "reel" && (t.state.items.length > 0 || t.state.reelForward.status !== "idle") ? (
|
|
3128
|
+
}, [t.state.layout === "reel" && (t.state.items.length > 0 || t.state.reelForward.status !== "idle") ? (x(), a(Fn, {
|
|
3119
3129
|
key: 0,
|
|
3120
3130
|
ref_key: "reelRenderer",
|
|
3121
3131
|
ref: p,
|
|
@@ -3140,28 +3150,28 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3140
3150
|
"info-sheet-overlay": t.state.reelInfoSheetOverlay,
|
|
3141
3151
|
"next-page-error": !!t.state.nextPageError,
|
|
3142
3152
|
origin: "reel",
|
|
3143
|
-
"preview-states":
|
|
3153
|
+
"preview-states": O(z),
|
|
3144
3154
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
3145
3155
|
"reel-audio-state": t.reelAudioState,
|
|
3146
3156
|
"reel-forward": t.state.reelForward,
|
|
3147
|
-
state:
|
|
3157
|
+
state: T.value,
|
|
3148
3158
|
total: t.state.total,
|
|
3149
3159
|
onActiveChange: i[0] ||= (e) => d("activeReelChange", e),
|
|
3150
3160
|
onCloseInfoSheet: i[1] ||= (e) => d("reelInfoSheetChange", !1),
|
|
3151
|
-
onError:
|
|
3152
|
-
onMediaError: i[2] ||= (e, t) =>
|
|
3161
|
+
onError: O(F),
|
|
3162
|
+
onMediaError: i[2] ||= (e, t) => O(D)(e, t, "reel"),
|
|
3153
3163
|
onLoadMore: i[3] ||= (e) => d("loadMore"),
|
|
3154
3164
|
onMediaChange: J,
|
|
3155
|
-
onReady:
|
|
3165
|
+
onReady: O(I),
|
|
3156
3166
|
onRetryEnd: i[4] ||= (e) => d("retryEnd"),
|
|
3157
3167
|
onRetryForward: i[5] ||= (e) => d("retryForward"),
|
|
3158
3168
|
onReelAudioChange: i[6] ||= (e) => d("reelAudioChange", e)
|
|
3159
|
-
}, null, 8, /* @__PURE__ */ "can-retry-end.has-next.card-footer.card-header.feed-footer.feed-footer-actions.forward-index.forward-item.media-card.infinite-scroll.is-loading-more.items.load-more-locked.media-source.media-indices.initial-post-id.info-sheet.info-sheet-enabled.info-sheet-overlay.next-page-error.preview-states.reel-auto-advance.reel-audio-state.reel-forward.state.total.onError.onReady".split("."))) : t.state.error || t.state.isLoading || t.state.items.length === 0 && t.state.reelForward.status === "idle" ? (
|
|
3169
|
+
}, null, 8, /* @__PURE__ */ "can-retry-end.has-next.card-footer.card-header.feed-footer.feed-footer-actions.forward-index.forward-item.media-card.infinite-scroll.is-loading-more.items.load-more-locked.media-source.media-indices.initial-post-id.info-sheet.info-sheet-enabled.info-sheet-overlay.next-page-error.preview-states.reel-auto-advance.reel-audio-state.reel-forward.state.total.onError.onReady".split("."))) : t.state.error || t.state.isLoading || t.state.items.length === 0 && t.state.reelForward.status === "idle" ? (x(), a(le, {
|
|
3160
3170
|
key: 1,
|
|
3161
3171
|
actions: t.feedFooterActions,
|
|
3162
3172
|
"can-retry-end": t.canRetryEnd,
|
|
3163
3173
|
"feed-footer": t.feedFooter,
|
|
3164
|
-
state:
|
|
3174
|
+
state: T.value,
|
|
3165
3175
|
onLoadMore: i[7] ||= (e) => d("loadMore"),
|
|
3166
3176
|
onRetryEnd: i[8] ||= (e) => d("retryEnd")
|
|
3167
3177
|
}, null, 8, [
|
|
@@ -3169,12 +3179,12 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3169
3179
|
"can-retry-end",
|
|
3170
3180
|
"feed-footer",
|
|
3171
3181
|
"state"
|
|
3172
|
-
])) : (
|
|
3182
|
+
])) : (x(), s(e, { key: 2 }, [u(_n, {
|
|
3173
3183
|
ref_key: "masonryRenderer",
|
|
3174
3184
|
ref: f,
|
|
3175
3185
|
"can-retry-end": t.canRetryEnd,
|
|
3176
|
-
"entering-post-ids":
|
|
3177
|
-
"entry-delays":
|
|
3186
|
+
"entering-post-ids": v.value,
|
|
3187
|
+
"entry-delays": b.value,
|
|
3178
3188
|
"leaving-post-ids": S.value,
|
|
3179
3189
|
"removal-delays": C.value,
|
|
3180
3190
|
"card-footer": t.cardFooter,
|
|
@@ -3190,33 +3200,33 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3190
3200
|
"load-more-locked": t.state.loadMoreLocked,
|
|
3191
3201
|
"media-indices": t.state.mediaIndices,
|
|
3192
3202
|
"next-page-error": !!t.state.nextPageError,
|
|
3193
|
-
"preview-states":
|
|
3203
|
+
"preview-states": O(R),
|
|
3194
3204
|
suspended: t.state.reelOrigin === "masonry" || _.value,
|
|
3195
|
-
state:
|
|
3205
|
+
state: T.value,
|
|
3196
3206
|
total: t.state.total,
|
|
3197
|
-
onActivate:
|
|
3198
|
-
onError:
|
|
3199
|
-
onMediaError: i[9] ||= (e, t) =>
|
|
3200
|
-
onFullyVisible:
|
|
3207
|
+
onActivate: oe,
|
|
3208
|
+
onError: O(N),
|
|
3209
|
+
onMediaError: i[9] ||= (e, t) => O(D)(e, t, "masonry"),
|
|
3210
|
+
onFullyVisible: O(k),
|
|
3201
3211
|
onLoadMore: i[10] ||= (e) => d("loadMore"),
|
|
3202
3212
|
onMediaChange: J,
|
|
3203
|
-
onReady:
|
|
3213
|
+
onReady: O(P),
|
|
3204
3214
|
onRetryEnd: i[11] ||= (e) => d("retryEnd"),
|
|
3205
|
-
onVisible:
|
|
3215
|
+
onVisible: O(M)
|
|
3206
3216
|
}, null, 8, /* @__PURE__ */ "can-retry-end.entering-post-ids.entry-delays.leaving-post-ids.removal-delays.card-footer.card-header.feed-footer.feed-footer-actions.media-card.masonry.has-next.infinite-scroll.is-loading-more.items.load-more-locked.media-indices.next-page-error.preview-states.suspended.state.total.onError.onFullyVisible.onReady.onVisible".split(".")), u(n, {
|
|
3207
3217
|
name: "vibe-reel-viewer",
|
|
3208
3218
|
onAfterLeave: fe
|
|
3209
3219
|
}, {
|
|
3210
|
-
default:
|
|
3220
|
+
default: j(() => [t.state.reelOrigin === "masonry" ? (x(), s("section", {
|
|
3211
3221
|
key: 0,
|
|
3212
3222
|
ref_key: "reelOverlay",
|
|
3213
|
-
ref:
|
|
3223
|
+
ref: m,
|
|
3214
3224
|
class: "vibe-reel-overlay",
|
|
3215
3225
|
role: "dialog",
|
|
3216
3226
|
"aria-label": "Media viewer",
|
|
3217
3227
|
"aria-modal": "true",
|
|
3218
3228
|
tabindex: "-1"
|
|
3219
|
-
}, [u(
|
|
3229
|
+
}, [u(Fn, {
|
|
3220
3230
|
ref_key: "reelRenderer",
|
|
3221
3231
|
ref: p,
|
|
3222
3232
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -3240,19 +3250,19 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3240
3250
|
"media-source": "original",
|
|
3241
3251
|
"next-page-error": !!t.state.nextPageError,
|
|
3242
3252
|
origin: "masonry",
|
|
3243
|
-
"preview-states":
|
|
3253
|
+
"preview-states": O(L),
|
|
3244
3254
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
3245
3255
|
"reel-audio-state": t.reelAudioState,
|
|
3246
3256
|
"reel-forward": t.state.reelForward,
|
|
3247
|
-
state:
|
|
3257
|
+
state: T.value,
|
|
3248
3258
|
total: t.state.total,
|
|
3249
3259
|
onActiveChange: i[12] ||= (e) => d("activeReelChange", e),
|
|
3250
3260
|
onCloseInfoSheet: i[13] ||= (e) => d("reelInfoSheetChange", !1),
|
|
3251
|
-
onError:
|
|
3252
|
-
onMediaError: i[14] ||= (e, t) =>
|
|
3261
|
+
onError: O(F),
|
|
3262
|
+
onMediaError: i[14] ||= (e, t) => O(D)(e, t, "reel"),
|
|
3253
3263
|
onLoadMore: i[15] ||= (e) => d("loadMore"),
|
|
3254
3264
|
onMediaChange: J,
|
|
3255
|
-
onReady:
|
|
3265
|
+
onReady: O(I),
|
|
3256
3266
|
onRetryEnd: i[16] ||= (e) => d("retryEnd"),
|
|
3257
3267
|
onRetryForward: i[17] ||= (e) => d("retryForward"),
|
|
3258
3268
|
onReelAudioChange: i[18] ||= (e) => d("reelAudioChange", e)
|
|
@@ -3263,7 +3273,7 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3263
3273
|
});
|
|
3264
3274
|
//#endregion
|
|
3265
3275
|
//#region src/core/page.ts
|
|
3266
|
-
function
|
|
3276
|
+
function Kn(e) {
|
|
3267
3277
|
if (!e || typeof e != "object" || !Array.isArray(e.items)) throw TypeError("Vibe loadPage must resolve to a page with an items array.");
|
|
3268
3278
|
if (e.current !== void 0 && e.current !== null && typeof e.current != "string" && typeof e.current != "number") throw TypeError("Vibe page current must be a string, number, null, or undefined.");
|
|
3269
3279
|
if (e.next !== null && typeof e.next != "string" && typeof e.next != "number") throw TypeError("Vibe page next must be a string, number, or null.");
|
|
@@ -3274,22 +3284,22 @@ function $(e, t) {
|
|
|
3274
3284
|
let n = new Set(e.map((e) => e.postId));
|
|
3275
3285
|
return [...e, ...t.filter((e) => n.has(e.postId) ? !1 : (n.add(e.postId), !0))];
|
|
3276
3286
|
}
|
|
3277
|
-
function
|
|
3287
|
+
function qn(e) {
|
|
3278
3288
|
return `${typeof e}:${String(e)}`;
|
|
3279
3289
|
}
|
|
3280
|
-
function
|
|
3281
|
-
return e.mediaId === void 0 ? `source:${e.src}\u0000${e.preview?.src ?? ""}` : `id:${
|
|
3290
|
+
function Jn(e) {
|
|
3291
|
+
return e.mediaId === void 0 ? `source:${e.src}\u0000${e.preview?.src ?? ""}` : `id:${qn(e.mediaId)}`;
|
|
3282
3292
|
}
|
|
3283
|
-
function
|
|
3284
|
-
let n = [...e], r = new Map(e.map((e, t) => [
|
|
3293
|
+
function Yn(e, t) {
|
|
3294
|
+
let n = [...e], r = new Map(e.map((e, t) => [qn(e.postId), t]));
|
|
3285
3295
|
return t.forEach((e) => {
|
|
3286
|
-
let t =
|
|
3296
|
+
let t = qn(e.postId), i = r.get(t);
|
|
3287
3297
|
if (i === void 0) {
|
|
3288
3298
|
r.set(t, n.length), n.push(e);
|
|
3289
3299
|
return;
|
|
3290
3300
|
}
|
|
3291
|
-
let a = n[i], o = new Set([a, ...a.items].map(
|
|
3292
|
-
let t =
|
|
3301
|
+
let a = n[i], o = new Set([a, ...a.items].map(Jn)), s = [e, ...e.items].filter((e) => {
|
|
3302
|
+
let t = Jn(e);
|
|
3293
3303
|
return o.has(t) ? !1 : (o.add(t), !0);
|
|
3294
3304
|
});
|
|
3295
3305
|
s.length > 0 && (n[i] = {
|
|
@@ -3298,14 +3308,14 @@ function Gn(e, t) {
|
|
|
3298
3308
|
});
|
|
3299
3309
|
}), n;
|
|
3300
3310
|
}
|
|
3301
|
-
function
|
|
3311
|
+
function Xn(e) {
|
|
3302
3312
|
return Object.prototype.hasOwnProperty.call(e, "current") ? e.current ?? null : e.next;
|
|
3303
3313
|
}
|
|
3304
3314
|
//#endregion
|
|
3305
3315
|
//#region src/core/appendPage.ts
|
|
3306
|
-
function
|
|
3307
|
-
let i =
|
|
3308
|
-
t.items =
|
|
3316
|
+
function Zn(e, t, n, r) {
|
|
3317
|
+
let i = Kn(e), a = n.filterItems(i.items), o = Xn(i);
|
|
3318
|
+
t.items = Yn(t.items, a), t.next = i.next, i.total !== void 0 && (t.total = i.total), r(o), n.recordPages([{
|
|
3309
3319
|
contributionIds: a.map(({ postId: e }) => e),
|
|
3310
3320
|
cursor: o,
|
|
3311
3321
|
next: i.next,
|
|
@@ -3314,32 +3324,32 @@ function qn(e, t, n, r) {
|
|
|
3314
3324
|
}
|
|
3315
3325
|
//#endregion
|
|
3316
3326
|
//#region src/core/requestDelay.ts
|
|
3317
|
-
var
|
|
3327
|
+
var Qn = 2e3, $n = 1e4, er = 250, tr = {
|
|
3318
3328
|
delayRemainingMs: null,
|
|
3319
3329
|
nextRequestAt: null
|
|
3320
3330
|
};
|
|
3321
|
-
function
|
|
3331
|
+
function nr(e, t) {
|
|
3322
3332
|
return e === void 0 ? t : Math.floor(e);
|
|
3323
3333
|
}
|
|
3324
|
-
function
|
|
3334
|
+
function rr(e, t) {
|
|
3325
3335
|
for (let [n, r] of [["delayStepMs", e.delayStepMs], ["delayMaxMs", e.delayMaxMs]]) if (r !== void 0 && (!Number.isFinite(r) || r < 0)) throw TypeError(`Vibe ${t} ${n} must be a non-negative number.`);
|
|
3326
3336
|
}
|
|
3327
|
-
function
|
|
3328
|
-
let n =
|
|
3337
|
+
function ir(e, t = {}) {
|
|
3338
|
+
let n = nr(t.delayStepMs, Qn), r = nr(t.delayMaxMs, $n);
|
|
3329
3339
|
return Math.min(Math.max(0, e) * n, r);
|
|
3330
3340
|
}
|
|
3331
|
-
function
|
|
3332
|
-
if (e == null || !Number.isFinite(e)) return { ...
|
|
3341
|
+
function ar(e) {
|
|
3342
|
+
if (e == null || !Number.isFinite(e)) return { ...tr };
|
|
3333
3343
|
let t = Math.max(0, Math.floor(e - Date.now()));
|
|
3334
3344
|
return t > 0 ? {
|
|
3335
3345
|
delayRemainingMs: t,
|
|
3336
3346
|
nextRequestAt: e
|
|
3337
|
-
} : { ...
|
|
3347
|
+
} : { ...tr };
|
|
3338
3348
|
}
|
|
3339
|
-
async function
|
|
3349
|
+
async function or({ delayMs: e, onChange: t, signal: n }) {
|
|
3340
3350
|
if (n.aborted) throw new DOMException("Aborted", "AbortError");
|
|
3341
3351
|
if (e <= 0) {
|
|
3342
|
-
t({ ...
|
|
3352
|
+
t({ ...tr });
|
|
3343
3353
|
return;
|
|
3344
3354
|
}
|
|
3345
3355
|
let r = Date.now() + e;
|
|
@@ -3347,9 +3357,9 @@ async function nr({ delayMs: e, onChange: t, signal: n }) {
|
|
|
3347
3357
|
delayRemainingMs: e,
|
|
3348
3358
|
nextRequestAt: r
|
|
3349
3359
|
}), await new Promise((i, a) => {
|
|
3350
|
-
let o = !1, s = setInterval(f,
|
|
3360
|
+
let o = !1, s = setInterval(f, er), c = setTimeout(() => u(), e);
|
|
3351
3361
|
function l() {
|
|
3352
|
-
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...
|
|
3362
|
+
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...tr });
|
|
3353
3363
|
}
|
|
3354
3364
|
function u(e) {
|
|
3355
3365
|
o || (o = !0, l(), e ? a(e) : i());
|
|
@@ -3358,42 +3368,42 @@ async function nr({ delayMs: e, onChange: t, signal: n }) {
|
|
|
3358
3368
|
u(new DOMException("Aborted", "AbortError"));
|
|
3359
3369
|
}
|
|
3360
3370
|
function f() {
|
|
3361
|
-
let e =
|
|
3371
|
+
let e = ar(r);
|
|
3362
3372
|
t(e), e.delayRemainingMs === null && u();
|
|
3363
3373
|
}
|
|
3364
3374
|
n.addEventListener("abort", d, { once: !0 });
|
|
3365
3375
|
});
|
|
3366
3376
|
}
|
|
3367
|
-
var
|
|
3377
|
+
var sr = class {
|
|
3368
3378
|
interval = null;
|
|
3369
3379
|
constructor(e) {
|
|
3370
3380
|
this.onChange = e;
|
|
3371
3381
|
}
|
|
3372
3382
|
clear() {
|
|
3373
|
-
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...
|
|
3383
|
+
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...tr });
|
|
3374
3384
|
}
|
|
3375
3385
|
sync(e) {
|
|
3376
3386
|
this.clear();
|
|
3377
|
-
let t =
|
|
3387
|
+
let t = ar(e);
|
|
3378
3388
|
this.onChange(t), t.delayRemainingMs !== null && (this.interval = setInterval(() => {
|
|
3379
|
-
let t =
|
|
3389
|
+
let t = ar(e);
|
|
3380
3390
|
this.onChange(t), t.delayRemainingMs === null && this.clear();
|
|
3381
|
-
},
|
|
3391
|
+
}, er));
|
|
3382
3392
|
}
|
|
3383
3393
|
};
|
|
3384
|
-
function
|
|
3394
|
+
function cr(e, t = !0) {
|
|
3385
3395
|
return e.maxAdditionalPages === "unlimited" ? Infinity : (e.maxAdditionalPages ?? 10) + (t ? 1 : 0);
|
|
3386
3396
|
}
|
|
3387
|
-
function
|
|
3397
|
+
function lr(e) {
|
|
3388
3398
|
return `${typeof e}:${String(e)}`;
|
|
3389
3399
|
}
|
|
3390
|
-
function
|
|
3400
|
+
function ur(e, t) {
|
|
3391
3401
|
if (!Number.isInteger(e) || e <= 0) throw TypeError(`Vibe ${t} must be a positive integer.`);
|
|
3392
3402
|
}
|
|
3393
|
-
function
|
|
3403
|
+
function dr(e) {
|
|
3394
3404
|
if (!e) return;
|
|
3395
|
-
if (
|
|
3396
|
-
|
|
3405
|
+
if (ur(e.pageSize, "autofill pageSize"), e.strategy === "frontend") {
|
|
3406
|
+
rr(e, "frontend autofill");
|
|
3397
3407
|
let t = e.maxAdditionalPages;
|
|
3398
3408
|
if (t !== void 0 && t !== "unlimited" && (!Number.isInteger(t) || t < 0)) throw TypeError("Vibe autofill maxAdditionalPages must be a non-negative integer or \"unlimited\".");
|
|
3399
3409
|
return;
|
|
@@ -3405,7 +3415,7 @@ function sr(e) {
|
|
|
3405
3415
|
if (t.pageSize !== e.pageSize) throw TypeError("Vibe backend autofill initialSession pageSize must match autofill pageSize.");
|
|
3406
3416
|
}
|
|
3407
3417
|
}
|
|
3408
|
-
function
|
|
3418
|
+
function fr(e, t, n = !0) {
|
|
3409
3419
|
if (!e) return {
|
|
3410
3420
|
cycleId: null,
|
|
3411
3421
|
delayRemainingMs: null,
|
|
@@ -3422,7 +3432,7 @@ function cr(e, t, n = !0) {
|
|
|
3422
3432
|
status: "idle",
|
|
3423
3433
|
strategy: null
|
|
3424
3434
|
};
|
|
3425
|
-
let r = e.strategy === "backend" ? t ?? (n ? e.initialSession : void 0) : void 0, i = r?.received ?? 0, a =
|
|
3435
|
+
let r = e.strategy === "backend" ? t ?? (n ? e.initialSession : void 0) : void 0, i = r?.received ?? 0, a = ar(r?.nextRequestAt);
|
|
3426
3436
|
return {
|
|
3427
3437
|
cycleId: r?.cycleId ?? null,
|
|
3428
3438
|
...a,
|
|
@@ -3439,7 +3449,7 @@ function cr(e, t, n = !0) {
|
|
|
3439
3449
|
strategy: e.strategy
|
|
3440
3450
|
};
|
|
3441
3451
|
}
|
|
3442
|
-
function
|
|
3452
|
+
function pr(e) {
|
|
3443
3453
|
return [
|
|
3444
3454
|
"cancelling",
|
|
3445
3455
|
"filling",
|
|
@@ -3447,9 +3457,9 @@ function lr(e) {
|
|
|
3447
3457
|
"waiting"
|
|
3448
3458
|
].includes(e.status);
|
|
3449
3459
|
}
|
|
3450
|
-
async function
|
|
3460
|
+
async function mr(e, t, n) {
|
|
3451
3461
|
let r = t.autofill;
|
|
3452
|
-
if (!
|
|
3462
|
+
if (!pr(r) || !r.cycleId) return;
|
|
3453
3463
|
let i = {
|
|
3454
3464
|
cycleId: r.cycleId,
|
|
3455
3465
|
feedKey: r.feedKey ?? "",
|
|
@@ -3462,16 +3472,16 @@ async function ur(e, t, n) {
|
|
|
3462
3472
|
throw r.error = e, r.status = "error", e;
|
|
3463
3473
|
}
|
|
3464
3474
|
}
|
|
3465
|
-
function
|
|
3475
|
+
function hr(e, t, n) {
|
|
3466
3476
|
return e?.strategy === "backend" && t.feedKey === e.feedKey && t.sessionId === n.sessionId;
|
|
3467
3477
|
}
|
|
3468
|
-
async function
|
|
3469
|
-
let f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = r ??
|
|
3478
|
+
async function gr({ existingItems: e, initialCursor: t, loadPage: n, maximumRequests: r, onCollection: i, onDelayChange: a, onProgress: o, options: s, receivedOffset: c = 0, requestOffset: l = 0, shouldPause: u = () => !1, signal: d }) {
|
|
3479
|
+
let f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = r ?? cr(s), g = t, _ = t, v = t, y = 0, b = [], x;
|
|
3470
3480
|
for (; y < h;) {
|
|
3471
|
-
let e =
|
|
3481
|
+
let e = lr(g);
|
|
3472
3482
|
if (m.has(e)) throw Error("Vibe autofill received a repeated cursor.");
|
|
3473
|
-
if (m.add(e), await
|
|
3474
|
-
delayMs:
|
|
3483
|
+
if (m.add(e), await or({
|
|
3484
|
+
delayMs: ir(l + y, s),
|
|
3475
3485
|
onChange: a,
|
|
3476
3486
|
signal: d
|
|
3477
3487
|
}), y > 0 && u()) return {
|
|
@@ -3485,7 +3495,7 @@ async function fr({ existingItems: e, initialCursor: t, loadPage: n, maximumRequ
|
|
|
3485
3495
|
status: "paused",
|
|
3486
3496
|
total: x
|
|
3487
3497
|
};
|
|
3488
|
-
let t =
|
|
3498
|
+
let t = Kn(await n({
|
|
3489
3499
|
cursor: g,
|
|
3490
3500
|
signal: d
|
|
3491
3501
|
}));
|
|
@@ -3542,12 +3552,12 @@ async function fr({ existingItems: e, initialCursor: t, loadPage: n, maximumRequ
|
|
|
3542
3552
|
}
|
|
3543
3553
|
//#endregion
|
|
3544
3554
|
//#region src/core/autofillController.ts
|
|
3545
|
-
var
|
|
3555
|
+
var _r = class {
|
|
3546
3556
|
collection = null;
|
|
3547
3557
|
cycle = 0;
|
|
3548
3558
|
delayCountdown;
|
|
3549
3559
|
constructor(e) {
|
|
3550
|
-
this.context = e, this.delayCountdown = new
|
|
3560
|
+
this.context = e, this.delayCountdown = new sr((t) => Object.assign(e.state.autofill, t)), this.syncCountdown();
|
|
3551
3561
|
}
|
|
3552
3562
|
beginCycle() {
|
|
3553
3563
|
let { options: e, state: t } = this.context;
|
|
@@ -3555,14 +3565,14 @@ var pr = class {
|
|
|
3555
3565
|
this.clear();
|
|
3556
3566
|
let n = `vibe-autofill-${Date.now().toString(36)}-${++this.cycle}`;
|
|
3557
3567
|
return t.autofill = {
|
|
3558
|
-
...
|
|
3568
|
+
...fr(e, void 0, !1),
|
|
3559
3569
|
cycleId: n,
|
|
3560
3570
|
status: "filling"
|
|
3561
3571
|
}, n;
|
|
3562
3572
|
}
|
|
3563
3573
|
async cancel() {
|
|
3564
3574
|
let { cancelRequest: e, options: t, state: n } = this.context;
|
|
3565
|
-
await
|
|
3575
|
+
await mr(t, n, e), this.commitCollection();
|
|
3566
3576
|
}
|
|
3567
3577
|
captureCollection(e, t) {
|
|
3568
3578
|
t && (this.collection = e);
|
|
@@ -3590,30 +3600,30 @@ var pr = class {
|
|
|
3590
3600
|
requests: r.requests
|
|
3591
3601
|
}), !0) : !1;
|
|
3592
3602
|
}
|
|
3593
|
-
},
|
|
3594
|
-
function
|
|
3603
|
+
}, vr = 100;
|
|
3604
|
+
function yr(e, t) {
|
|
3595
3605
|
if (!Number.isFinite(t) || t <= 0) throw TypeError(`Vibe ${e} must be a positive number.`);
|
|
3596
3606
|
}
|
|
3597
|
-
function
|
|
3607
|
+
function br(e, t, n) {
|
|
3598
3608
|
return Math.min(n, Math.max(t, e));
|
|
3599
3609
|
}
|
|
3600
|
-
function
|
|
3610
|
+
function xr(e) {
|
|
3601
3611
|
if (!e) return;
|
|
3602
3612
|
let t = e.minSpeedPxPerSecond ?? 20, n = e.maxSpeedPxPerSecond ?? 240;
|
|
3603
|
-
if (
|
|
3604
|
-
e.speedPxPerSecond !== void 0 &&
|
|
3613
|
+
if (yr("autoScroll.minSpeedPxPerSecond", t), yr("autoScroll.maxSpeedPxPerSecond", n), t > n) throw TypeError("Vibe autoScroll.minSpeedPxPerSecond cannot exceed maxSpeedPxPerSecond.");
|
|
3614
|
+
e.speedPxPerSecond !== void 0 && yr("autoScroll.speedPxPerSecond", e.speedPxPerSecond);
|
|
3605
3615
|
}
|
|
3606
|
-
function
|
|
3616
|
+
function Sr(e) {
|
|
3607
3617
|
let t = e?.minSpeedPxPerSecond ?? 20, n = e?.maxSpeedPxPerSecond ?? 240;
|
|
3608
3618
|
return {
|
|
3609
3619
|
enabled: e?.enabled ?? !1,
|
|
3610
3620
|
maxSpeedPxPerSecond: n,
|
|
3611
3621
|
minSpeedPxPerSecond: t,
|
|
3612
3622
|
paused: !1,
|
|
3613
|
-
speedPxPerSecond:
|
|
3623
|
+
speedPxPerSecond: br(e?.speedPxPerSecond ?? 80, t, n)
|
|
3614
3624
|
};
|
|
3615
3625
|
}
|
|
3616
|
-
var
|
|
3626
|
+
var Cr = class {
|
|
3617
3627
|
frame = null;
|
|
3618
3628
|
lastTimestamp = null;
|
|
3619
3629
|
mounted = !1;
|
|
@@ -3633,9 +3643,9 @@ var yr = class {
|
|
|
3633
3643
|
this.options.state.enabled && (this.options.state.paused = e, this.lastTimestamp = null, e ? this.cancelFrame() : this.schedule());
|
|
3634
3644
|
}
|
|
3635
3645
|
setSpeed(e) {
|
|
3636
|
-
|
|
3646
|
+
yr("auto-scroll speed", e);
|
|
3637
3647
|
let t = this.options.state;
|
|
3638
|
-
t.speedPxPerSecond =
|
|
3648
|
+
t.speedPxPerSecond = br(e, t.minSpeedPxPerSecond, t.maxSpeedPxPerSecond);
|
|
3639
3649
|
}
|
|
3640
3650
|
tick = (e) => {
|
|
3641
3651
|
this.frame = null;
|
|
@@ -3647,7 +3657,7 @@ var yr = class {
|
|
|
3647
3657
|
return;
|
|
3648
3658
|
}
|
|
3649
3659
|
if (this.lastTimestamp !== null) {
|
|
3650
|
-
let r = Math.min(
|
|
3660
|
+
let r = Math.min(vr, Math.max(0, e - this.lastTimestamp)), i = Math.max(0, n.scrollHeight - n.clientHeight);
|
|
3651
3661
|
n.scrollTop = Math.min(i, n.scrollTop + t.speedPxPerSecond * r / 1e3);
|
|
3652
3662
|
}
|
|
3653
3663
|
this.lastTimestamp = e, this.schedule();
|
|
@@ -3661,13 +3671,13 @@ var yr = class {
|
|
|
3661
3671
|
};
|
|
3662
3672
|
//#endregion
|
|
3663
3673
|
//#region src/core/backendAutofill.ts
|
|
3664
|
-
async function
|
|
3674
|
+
async function wr(e, t, n, r) {
|
|
3665
3675
|
let i = await e.onUnderfilled(n);
|
|
3666
3676
|
if (!r()) return;
|
|
3667
3677
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend autofill requires a sessionId.");
|
|
3668
3678
|
let a = Math.max(n.received, i.received ?? n.received);
|
|
3669
3679
|
Object.assign(t.autofill, {
|
|
3670
|
-
...
|
|
3680
|
+
...ar(i.nextRequestAt),
|
|
3671
3681
|
missing: Math.max(0, e.pageSize - a),
|
|
3672
3682
|
received: a,
|
|
3673
3683
|
sequence: i.sequence ?? 0,
|
|
@@ -3675,19 +3685,19 @@ async function br(e, t, n, r) {
|
|
|
3675
3685
|
status: "waiting"
|
|
3676
3686
|
});
|
|
3677
3687
|
}
|
|
3678
|
-
function
|
|
3688
|
+
function Tr(e, t) {
|
|
3679
3689
|
["complete", "exhausted"].includes(t.status) && t.items && (e.items = $(e.items, t.items)), t.next !== void 0 && (e.next = t.next), t.total !== void 0 && (e.total = t.total);
|
|
3680
3690
|
}
|
|
3681
|
-
function
|
|
3691
|
+
function Er(e, t, n) {
|
|
3682
3692
|
let r = t.autofill;
|
|
3683
|
-
return !
|
|
3693
|
+
return !hr(e, n, r) || n.sequence <= r.sequence || ["cancelled", "cancelling"].includes(r.status) || ["complete", "exhausted"].includes(n.status) && n.next === void 0 ? !1 : (Tr(t, n), Object.assign(r, ar(n.status === "waiting" ? n.nextRequestAt : null)), r.error = n.error ?? null, r.missing = Math.max(0, (r.pageSize ?? 0) - n.received), r.received = n.received, n.requests !== void 0 && (r.requests = n.requests), r.sequence = n.sequence, r.status = n.status, !0);
|
|
3684
3694
|
}
|
|
3685
|
-
function
|
|
3686
|
-
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill =
|
|
3695
|
+
function Dr(e, t, n) {
|
|
3696
|
+
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill = fr(e, n), Tr(t, n), !0);
|
|
3687
3697
|
}
|
|
3688
3698
|
//#endregion
|
|
3689
3699
|
//#region src/core/backlogRestore.ts
|
|
3690
|
-
async function
|
|
3700
|
+
async function Or(e, t, n) {
|
|
3691
3701
|
if (!e) return;
|
|
3692
3702
|
let r = new AbortController();
|
|
3693
3703
|
n(r);
|
|
@@ -3702,7 +3712,7 @@ async function wr(e, t, n) {
|
|
|
3702
3712
|
}
|
|
3703
3713
|
//#endregion
|
|
3704
3714
|
//#region src/core/initialAutofill.ts
|
|
3705
|
-
async function
|
|
3715
|
+
async function kr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r, onPages: i, options: a, signal: o, state: s }) {
|
|
3706
3716
|
let c = a.autofill;
|
|
3707
3717
|
if (!c) return;
|
|
3708
3718
|
let l = s.items.length;
|
|
@@ -3715,7 +3725,7 @@ async function Tr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
3715
3725
|
return;
|
|
3716
3726
|
}
|
|
3717
3727
|
if (c.strategy === "backend") {
|
|
3718
|
-
await
|
|
3728
|
+
await wr(c, s, {
|
|
3719
3729
|
cycleId: e,
|
|
3720
3730
|
feedKey: c.feedKey,
|
|
3721
3731
|
items: [...s.items],
|
|
@@ -3732,11 +3742,11 @@ async function Tr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
3732
3742
|
s.autofill.status = "exhausted";
|
|
3733
3743
|
return;
|
|
3734
3744
|
}
|
|
3735
|
-
let u = await
|
|
3745
|
+
let u = await gr({
|
|
3736
3746
|
existingItems: s.items,
|
|
3737
3747
|
initialCursor: s.next,
|
|
3738
3748
|
loadPage: a.loadPage,
|
|
3739
|
-
maximumRequests:
|
|
3749
|
+
maximumRequests: cr(c, !1),
|
|
3740
3750
|
onCollection: n,
|
|
3741
3751
|
onDelayChange: (e) => {
|
|
3742
3752
|
t() && Object.assign(s.autofill, e);
|
|
@@ -3759,13 +3769,13 @@ async function Tr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
3759
3769
|
}
|
|
3760
3770
|
//#endregion
|
|
3761
3771
|
//#region src/core/fill.ts
|
|
3762
|
-
function
|
|
3772
|
+
function Ar(e) {
|
|
3763
3773
|
return "items" in e ? { items: e.items } : "pages" in e ? { pages: e.pages } : { until: "end" };
|
|
3764
3774
|
}
|
|
3765
|
-
function
|
|
3775
|
+
function jr(e) {
|
|
3766
3776
|
return `${typeof e}:${String(e)}`;
|
|
3767
3777
|
}
|
|
3768
|
-
function
|
|
3778
|
+
function Mr(e) {
|
|
3769
3779
|
if (!e || typeof e != "object") throw TypeError("Vibe fill target must be an object.");
|
|
3770
3780
|
if ("pages" in e) {
|
|
3771
3781
|
if (!Number.isInteger(e.pages) || e.pages <= 0) throw TypeError("Vibe fill pages must be a positive integer.");
|
|
@@ -3778,21 +3788,21 @@ function Or(e) {
|
|
|
3778
3788
|
if ("until" in e && e.until === "end") return { until: "end" };
|
|
3779
3789
|
throw TypeError("Vibe fill target must be { items }, { pages }, or { until: 'end' }.");
|
|
3780
3790
|
}
|
|
3781
|
-
function
|
|
3791
|
+
function Nr(e) {
|
|
3782
3792
|
if (!e) return;
|
|
3783
3793
|
if (e.strategy === "frontend") {
|
|
3784
|
-
|
|
3794
|
+
rr(e, "frontend fill");
|
|
3785
3795
|
return;
|
|
3786
3796
|
}
|
|
3787
3797
|
if (!e.feedKey.trim()) throw TypeError("Vibe backend fill requires a feedKey.");
|
|
3788
3798
|
let t = e.initialSession;
|
|
3789
3799
|
if (t) {
|
|
3790
3800
|
if (t.feedKey !== e.feedKey) throw TypeError("Vibe backend fill initialSession feedKey must match fill feedKey.");
|
|
3791
|
-
|
|
3801
|
+
Mr(t.target);
|
|
3792
3802
|
}
|
|
3793
3803
|
}
|
|
3794
|
-
function
|
|
3795
|
-
let r = e?.strategy === "backend" && n ? e.initialSession : void 0, i = t ?? r, a =
|
|
3804
|
+
function Pr(e, t, n = !0) {
|
|
3805
|
+
let r = e?.strategy === "backend" && n ? e.initialSession : void 0, i = t ?? r, a = ar(i?.nextRequestAt);
|
|
3796
3806
|
return {
|
|
3797
3807
|
completedPages: i?.completedPages ?? 0,
|
|
3798
3808
|
cycleId: i?.cycleId ?? null,
|
|
@@ -3805,10 +3815,10 @@ function Ar(e, t, n = !0) {
|
|
|
3805
3815
|
sessionId: i?.sessionId ?? null,
|
|
3806
3816
|
status: i?.status ?? "idle",
|
|
3807
3817
|
strategy: e?.strategy ?? null,
|
|
3808
|
-
target: i ?
|
|
3818
|
+
target: i ? Ar(i.target) : null
|
|
3809
3819
|
};
|
|
3810
3820
|
}
|
|
3811
|
-
function
|
|
3821
|
+
function Fr(e) {
|
|
3812
3822
|
return [
|
|
3813
3823
|
"cancelling",
|
|
3814
3824
|
"filling",
|
|
@@ -3816,7 +3826,7 @@ function jr(e) {
|
|
|
3816
3826
|
"waiting"
|
|
3817
3827
|
].includes(e.status);
|
|
3818
3828
|
}
|
|
3819
|
-
async function
|
|
3829
|
+
async function Ir({ existingItems: e, getLoadedItemCount: t, initialCursor: n, loadPage: r, onCollection: i = () => void 0, onDelayChange: a, onProgress: o, options: s, shouldPause: c = () => !1, signal: l, target: u }) {
|
|
3820
3830
|
let d = [], f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = 0, g = n, _ = n, v = n, y = 0, b, x = () => t?.() ?? p.length;
|
|
3821
3831
|
if ("items" in u && x() >= u.items) return {
|
|
3822
3832
|
completedPages: h,
|
|
@@ -3828,10 +3838,10 @@ async function Mr({ existingItems: e, getLoadedItemCount: t, initialCursor: n, l
|
|
|
3828
3838
|
status: "complete"
|
|
3829
3839
|
};
|
|
3830
3840
|
for (; v !== null;) {
|
|
3831
|
-
let e =
|
|
3841
|
+
let e = jr(g);
|
|
3832
3842
|
if (m.has(e)) throw Error("Vibe fill received a repeated cursor.");
|
|
3833
|
-
if (m.add(e), await
|
|
3834
|
-
delayMs:
|
|
3843
|
+
if (m.add(e), await or({
|
|
3844
|
+
delayMs: ir(h, s),
|
|
3835
3845
|
onChange: a,
|
|
3836
3846
|
signal: l
|
|
3837
3847
|
}), h > 0 && c()) return {
|
|
@@ -3844,7 +3854,7 @@ async function Mr({ existingItems: e, getLoadedItemCount: t, initialCursor: n, l
|
|
|
3844
3854
|
status: "paused",
|
|
3845
3855
|
total: b
|
|
3846
3856
|
};
|
|
3847
|
-
let t =
|
|
3857
|
+
let t = Kn(await r({
|
|
3848
3858
|
cursor: g,
|
|
3849
3859
|
signal: l
|
|
3850
3860
|
}));
|
|
@@ -3912,12 +3922,12 @@ async function Mr({ existingItems: e, getLoadedItemCount: t, initialCursor: n, l
|
|
|
3912
3922
|
}
|
|
3913
3923
|
//#endregion
|
|
3914
3924
|
//#region src/core/backendFill.ts
|
|
3915
|
-
async function
|
|
3925
|
+
async function Lr(e, t, n, r) {
|
|
3916
3926
|
let i = await e.onStart(n);
|
|
3917
3927
|
if (r()) {
|
|
3918
3928
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend fill requires a sessionId.");
|
|
3919
3929
|
Object.assign(t.fill, {
|
|
3920
|
-
...
|
|
3930
|
+
...ar(i.nextRequestAt),
|
|
3921
3931
|
completedPages: i.completedPages ?? 0,
|
|
3922
3932
|
received: i.received ?? 0,
|
|
3923
3933
|
sequence: i.sequence ?? 0,
|
|
@@ -3926,23 +3936,23 @@ async function Nr(e, t, n, r) {
|
|
|
3926
3936
|
});
|
|
3927
3937
|
}
|
|
3928
3938
|
}
|
|
3929
|
-
function
|
|
3939
|
+
function Rr(e, t, n) {
|
|
3930
3940
|
return e?.strategy === "backend" && n.feedKey === e.feedKey && n.sessionId === t.fill.sessionId;
|
|
3931
3941
|
}
|
|
3932
|
-
function
|
|
3942
|
+
function zr(e) {
|
|
3933
3943
|
return Number.isInteger(e.completedPages) && e.completedPages >= 0 && Number.isInteger(e.received) && e.received >= 0 && Number.isInteger(e.sequence) && e.sequence >= 0;
|
|
3934
3944
|
}
|
|
3935
|
-
function
|
|
3945
|
+
function Br(e, t) {
|
|
3936
3946
|
if (!["complete", "exhausted"].includes(t.status)) return !0;
|
|
3937
3947
|
let n = e.fill.target;
|
|
3938
3948
|
return !n || !Array.isArray(t.items) || t.next === void 0 || t.lastCursor === void 0 ? !1 : t.status === "exhausted" ? "pages" in n && t.completedPages < n.pages && t.next === null : "pages" in n ? t.completedPages === n.pages : t.next === null;
|
|
3939
3949
|
}
|
|
3940
|
-
function
|
|
3950
|
+
function Vr(e, t, n) {
|
|
3941
3951
|
t.total !== void 0 && (e.total = t.total), ["complete", "exhausted"].includes(t.status) && (e.items = $(e.items, t.items ?? []), e.next = t.next ?? null, n(t.lastCursor ?? null));
|
|
3942
3952
|
}
|
|
3943
|
-
function
|
|
3944
|
-
return !
|
|
3945
|
-
...
|
|
3953
|
+
function Hr(e, t, n, r) {
|
|
3954
|
+
return !Rr(e, t, n) || !zr(n) || n.sequence <= t.fill.sequence || ["cancelled", "cancelling"].includes(t.fill.status) || !Br(t, n) ? !1 : (Vr(t, n, r), Object.assign(t.fill, {
|
|
3955
|
+
...ar(n.status === "waiting" ? n.nextRequestAt : null),
|
|
3946
3956
|
completedPages: n.completedPages,
|
|
3947
3957
|
error: n.error ?? null,
|
|
3948
3958
|
received: n.received,
|
|
@@ -3950,45 +3960,45 @@ function Rr(e, t, n, r) {
|
|
|
3950
3960
|
status: n.status
|
|
3951
3961
|
}), !0);
|
|
3952
3962
|
}
|
|
3953
|
-
function
|
|
3963
|
+
function Ur(e, t, n, r) {
|
|
3954
3964
|
if (e?.strategy !== "backend" || n.feedKey !== e.feedKey) return !1;
|
|
3955
3965
|
let i = t.fill;
|
|
3956
|
-
return t.fill =
|
|
3966
|
+
return t.fill = Pr(e, n), !zr(n) || !Br(t, n) ? (t.fill = i, !1) : (Vr(t, n, r), !0);
|
|
3957
3967
|
}
|
|
3958
3968
|
//#endregion
|
|
3959
3969
|
//#region src/core/fillController.ts
|
|
3960
|
-
var
|
|
3970
|
+
var Wr = class {
|
|
3961
3971
|
abortController = null;
|
|
3962
3972
|
cycle = 0;
|
|
3963
3973
|
delayCountdown;
|
|
3964
3974
|
requestVersion = 0;
|
|
3965
3975
|
collection = null;
|
|
3966
3976
|
constructor(e) {
|
|
3967
|
-
this.options = e, this.delayCountdown = new
|
|
3977
|
+
this.options = e, this.delayCountdown = new sr((e) => {
|
|
3968
3978
|
Object.assign(this.options.state.fill, e);
|
|
3969
3979
|
}), this.syncBackendCountdown();
|
|
3970
3980
|
}
|
|
3971
3981
|
isActive() {
|
|
3972
|
-
return
|
|
3982
|
+
return Fr(this.options.state.fill);
|
|
3973
3983
|
}
|
|
3974
3984
|
applyUpdate(e) {
|
|
3975
|
-
let t =
|
|
3985
|
+
let t = Hr(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
3976
3986
|
return t && this.syncBackendCountdown(), t;
|
|
3977
3987
|
}
|
|
3978
3988
|
restoreSession(e) {
|
|
3979
|
-
let t =
|
|
3989
|
+
let t = Ur(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
3980
3990
|
return t && this.syncBackendCountdown(), t;
|
|
3981
3991
|
}
|
|
3982
3992
|
async start(e, t = {}) {
|
|
3983
3993
|
let n = this.options.fill;
|
|
3984
3994
|
if (!n) throw Error("Vibe fill is not configured.");
|
|
3985
3995
|
if (this.isActive()) throw Error("Vibe fill is already active.");
|
|
3986
|
-
let r =
|
|
3996
|
+
let r = Mr(e), i = Mr(t.target ?? r), a = t.progressOffset ?? {
|
|
3987
3997
|
completedPages: 0,
|
|
3988
3998
|
received: 0
|
|
3989
3999
|
}, o = t.cycleId ?? `vibe-fill-${Date.now().toString(36)}-${++this.cycle}`;
|
|
3990
4000
|
if (this.options.state.fill = {
|
|
3991
|
-
...
|
|
4001
|
+
...Pr(n, void 0, !1),
|
|
3992
4002
|
completedPages: a.completedPages,
|
|
3993
4003
|
cycleId: o,
|
|
3994
4004
|
received: a.received,
|
|
@@ -4001,7 +4011,7 @@ var Br = class {
|
|
|
4001
4011
|
let s = ++this.requestVersion, c = new AbortController();
|
|
4002
4012
|
this.abortController = c;
|
|
4003
4013
|
try {
|
|
4004
|
-
n.strategy === "frontend" ? await this.startFrontend(n, r, c, s, t.prepareFrontend !== !1, a) : (await
|
|
4014
|
+
n.strategy === "frontend" ? await this.startFrontend(n, r, c, s, t.prepareFrontend !== !1, a) : (await Lr(n, this.options.state, {
|
|
4005
4015
|
cycleId: o,
|
|
4006
4016
|
feedKey: n.feedKey,
|
|
4007
4017
|
items: [...this.options.state.items],
|
|
@@ -4019,7 +4029,7 @@ var Br = class {
|
|
|
4019
4029
|
}
|
|
4020
4030
|
async cancel() {
|
|
4021
4031
|
let { fill: e, state: t } = this.options;
|
|
4022
|
-
if (!
|
|
4032
|
+
if (!Fr(t.fill) || !t.fill.cycleId) return;
|
|
4023
4033
|
let n = {
|
|
4024
4034
|
cycleId: t.fill.cycleId,
|
|
4025
4035
|
feedKey: t.fill.feedKey ?? "",
|
|
@@ -4063,7 +4073,7 @@ var Br = class {
|
|
|
4063
4073
|
});
|
|
4064
4074
|
}
|
|
4065
4075
|
reset() {
|
|
4066
|
-
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill =
|
|
4076
|
+
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill = Pr(this.options.fill, void 0, !1), this.collection = null;
|
|
4067
4077
|
}
|
|
4068
4078
|
destroy() {
|
|
4069
4079
|
this.abortLocalRequest(), this.delayCountdown.clear();
|
|
@@ -4098,7 +4108,7 @@ var Br = class {
|
|
|
4098
4108
|
s.fill.status = "until" in t ? "complete" : "exhausted";
|
|
4099
4109
|
return;
|
|
4100
4110
|
}
|
|
4101
|
-
let c = await
|
|
4111
|
+
let c = await Ir({
|
|
4102
4112
|
existingItems: s.items,
|
|
4103
4113
|
getLoadedItemCount: () => s.items.length,
|
|
4104
4114
|
initialCursor: s.next,
|
|
@@ -4150,7 +4160,7 @@ var Br = class {
|
|
|
4150
4160
|
};
|
|
4151
4161
|
//#endregion
|
|
4152
4162
|
//#region src/core/fillReconciliation.ts
|
|
4153
|
-
async function
|
|
4163
|
+
async function Gr({ controller: e, isCurrent: t, loadPage: n, onDelayChange: r, pauseWhenManual: i = !1, setLastCursor: a, signal: o, state: s }) {
|
|
4154
4164
|
if (!e.needsReconciliation(s.items)) return "skipped";
|
|
4155
4165
|
let c = await e.reconcile({
|
|
4156
4166
|
existingItems: s.items,
|
|
@@ -4163,7 +4173,7 @@ async function Vr({ controller: e, isCurrent: t, loadPage: n, onDelayChange: r,
|
|
|
4163
4173
|
}
|
|
4164
4174
|
//#endregion
|
|
4165
4175
|
//#region src/core/feedFooter.ts
|
|
4166
|
-
function
|
|
4176
|
+
function Kr(e) {
|
|
4167
4177
|
return {
|
|
4168
4178
|
cancelAutofill: () => e.cancelAutofill(),
|
|
4169
4179
|
loadMore: () => e.loadNext(),
|
|
@@ -4175,46 +4185,46 @@ function Hr(e) {
|
|
|
4175
4185
|
retryFill: () => e.retryFill()
|
|
4176
4186
|
};
|
|
4177
4187
|
}
|
|
4178
|
-
function
|
|
4188
|
+
function qr(e) {
|
|
4179
4189
|
if (!Number.isFinite(e) || e <= 0) throw TypeError("Vibe reelAutoAdvance.intervalMs must be a positive number.");
|
|
4180
4190
|
}
|
|
4181
|
-
function
|
|
4182
|
-
e?.intervalMs !== void 0 &&
|
|
4191
|
+
function Jr(e) {
|
|
4192
|
+
e?.intervalMs !== void 0 && qr(e.intervalMs);
|
|
4183
4193
|
}
|
|
4184
|
-
function
|
|
4194
|
+
function Yr(e) {
|
|
4185
4195
|
return {
|
|
4186
4196
|
enabled: e?.enabled ?? !1,
|
|
4187
4197
|
includePostItems: e?.includePostItems ?? !1,
|
|
4188
4198
|
intervalMs: e?.intervalMs ?? 5e3
|
|
4189
4199
|
};
|
|
4190
4200
|
}
|
|
4191
|
-
function
|
|
4201
|
+
function Xr(e, t) {
|
|
4192
4202
|
if (typeof t == "boolean") {
|
|
4193
4203
|
e.enabled = t;
|
|
4194
4204
|
return;
|
|
4195
4205
|
}
|
|
4196
|
-
|
|
4206
|
+
Jr(t), t.enabled !== void 0 && (e.enabled = t.enabled), t.includePostItems !== void 0 && (e.includePostItems = t.includePostItems), t.intervalMs !== void 0 && (e.intervalMs = t.intervalMs);
|
|
4197
4207
|
}
|
|
4198
4208
|
//#endregion
|
|
4199
4209
|
//#region src/core/reelInfoSheet.ts
|
|
4200
|
-
function
|
|
4210
|
+
function Zr(e) {
|
|
4201
4211
|
return { enabled: e?.enabled ?? !1 };
|
|
4202
4212
|
}
|
|
4203
|
-
function
|
|
4213
|
+
function Qr(e, t, n) {
|
|
4204
4214
|
if (n && !t) throw Error("Vibe cannot enable reelInfoSheet without a configured component.");
|
|
4205
4215
|
e.enabled = n;
|
|
4206
4216
|
}
|
|
4207
4217
|
//#endregion
|
|
4208
4218
|
//#region src/core/initialRuntimeState.ts
|
|
4209
|
-
function
|
|
4219
|
+
function $r(e, t) {
|
|
4210
4220
|
let n = e.initialPage;
|
|
4211
4221
|
return {
|
|
4212
4222
|
activeReelPostId: null,
|
|
4213
|
-
autoScroll:
|
|
4214
|
-
autofill:
|
|
4223
|
+
autoScroll: Sr(e.autoScroll),
|
|
4224
|
+
autofill: fr(e.autofill),
|
|
4215
4225
|
current: n?.current ?? null,
|
|
4216
4226
|
error: null,
|
|
4217
|
-
fill:
|
|
4227
|
+
fill: Pr(e.fill),
|
|
4218
4228
|
infiniteScroll: e.infiniteScroll ?? !0,
|
|
4219
4229
|
isLoading: !n,
|
|
4220
4230
|
isLoadingMore: !1,
|
|
@@ -4225,14 +4235,14 @@ function Yr(e, t) {
|
|
|
4225
4235
|
next: n?.next ?? null,
|
|
4226
4236
|
nextPageError: null,
|
|
4227
4237
|
phoneMode: !1,
|
|
4228
|
-
reelAutoAdvance:
|
|
4238
|
+
reelAutoAdvance: Yr(e.reelAutoAdvance),
|
|
4229
4239
|
reelForward: {
|
|
4230
4240
|
error: null,
|
|
4231
4241
|
status: "idle"
|
|
4232
4242
|
},
|
|
4233
4243
|
reelForwardIndex: null,
|
|
4234
4244
|
reelForwardItem: null,
|
|
4235
|
-
reelInfoSheet:
|
|
4245
|
+
reelInfoSheet: Zr(e.reelInfoSheet),
|
|
4236
4246
|
reelInfoSheetOverlay: !1,
|
|
4237
4247
|
reelMediaSource: "original",
|
|
4238
4248
|
reelOrigin: null,
|
|
@@ -4241,21 +4251,21 @@ function Yr(e, t) {
|
|
|
4241
4251
|
}
|
|
4242
4252
|
//#endregion
|
|
4243
4253
|
//#region src/core/options.ts
|
|
4244
|
-
function
|
|
4254
|
+
function ei(e, t) {
|
|
4245
4255
|
if (t) {
|
|
4246
4256
|
if (!Number.isFinite(t.height) || t.height <= 0) throw TypeError(`Vibe ${e} height must be a positive number.`);
|
|
4247
4257
|
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe ${e} background must be "default" or "transparent".`);
|
|
4248
4258
|
}
|
|
4249
4259
|
}
|
|
4250
|
-
function
|
|
4260
|
+
function ti(e, t) {
|
|
4251
4261
|
if (t) {
|
|
4252
4262
|
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe mediaCard ${e} background must be "default" or "transparent".`);
|
|
4253
4263
|
for (let [n, r] of [["paddingX", t.paddingX], ["paddingY", t.paddingY]]) if (r !== void 0 && (!Number.isFinite(r) || r < 0)) throw TypeError(`Vibe mediaCard ${e} ${n} must be a non-negative number.`);
|
|
4254
4264
|
}
|
|
4255
4265
|
}
|
|
4256
|
-
function
|
|
4257
|
-
if (
|
|
4258
|
-
if (
|
|
4266
|
+
function ni(e) {
|
|
4267
|
+
if (xr(e.autoScroll), ei("cardHeader", e.cardHeader), ei("cardFooter", e.cardFooter), ti("header", e.mediaCard?.header), ti("footer", e.mediaCard?.footer), e.mediaCard?.feedPreload !== void 0 && e.mediaCard.feedPreload !== "none" && e.mediaCard.feedPreload !== "visible-post") throw TypeError("Vibe mediaCard feedPreload must be \"none\" or \"visible-post\".");
|
|
4268
|
+
if (dr(e.autofill), Nr(e.fill), je(e.masonry), Jr(e.reelAutoAdvance), e.removalReconciliation) {
|
|
4259
4269
|
if (!Number.isInteger(e.removalReconciliation.pageSize) || e.removalReconciliation.pageSize <= 0) throw TypeError("Vibe removalReconciliation pageSize must be a positive integer.");
|
|
4260
4270
|
let t = e.removalReconciliation.maxReplayPages ?? 5;
|
|
4261
4271
|
if (!Number.isInteger(t) || t <= 0) throw TypeError("Vibe removalReconciliation maxReplayPages must be a positive integer.");
|
|
@@ -4270,7 +4280,7 @@ function Qr(e) {
|
|
|
4270
4280
|
if (e.fill?.strategy === "frontend" && !e.loadPage) throw TypeError("Vibe frontend fill requires loadPage.");
|
|
4271
4281
|
if (e.fill?.strategy === "backend" && e.fill.initialSession && !e.initialPage) throw TypeError("Vibe backend fill restoration requires initialPage.");
|
|
4272
4282
|
}
|
|
4273
|
-
function
|
|
4283
|
+
function ri(e) {
|
|
4274
4284
|
if (typeof e != "string") return e;
|
|
4275
4285
|
if (typeof document > "u") throw Error("Vibe cannot resolve a selector without a document.");
|
|
4276
4286
|
let t = document.querySelector(e);
|
|
@@ -4279,7 +4289,7 @@ function $r(e) {
|
|
|
4279
4289
|
}
|
|
4280
4290
|
//#endregion
|
|
4281
4291
|
//#region src/core/pageRequest.ts
|
|
4282
|
-
async function
|
|
4292
|
+
async function ii({ append: e, autofillController: t, cursor: n, isCurrent: r, loadPage: i, onLastCursor: a, onPages: o, options: s, signal: c, state: l }) {
|
|
4283
4293
|
let u = s.autofill, d = e && u?.strategy === "frontend" && (l.autofill.status === "paused" || l.autofill.status === "error"), f = d ? {
|
|
4284
4294
|
received: l.autofill.received,
|
|
4285
4295
|
requests: l.autofill.requests
|
|
@@ -4291,11 +4301,11 @@ async function ei({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4291
4301
|
let m = !1;
|
|
4292
4302
|
try {
|
|
4293
4303
|
if (u?.strategy === "frontend") {
|
|
4294
|
-
let s = await
|
|
4304
|
+
let s = await gr({
|
|
4295
4305
|
existingItems: e ? l.items : [],
|
|
4296
4306
|
initialCursor: n,
|
|
4297
4307
|
loadPage: i,
|
|
4298
|
-
maximumRequests: f ? Math.max(0,
|
|
4308
|
+
maximumRequests: f ? Math.max(0, cr(u) - f.requests) : void 0,
|
|
4299
4309
|
onCollection: (e) => t.captureCollection(e, r()),
|
|
4300
4310
|
onDelayChange: (e) => {
|
|
4301
4311
|
r() && Object.assign(l.autofill, e);
|
|
@@ -4318,7 +4328,7 @@ async function ei({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4318
4328
|
}), o(s.pages), t.clearCollection();
|
|
4319
4329
|
return;
|
|
4320
4330
|
}
|
|
4321
|
-
let s =
|
|
4331
|
+
let s = Kn(await i({
|
|
4322
4332
|
cursor: n,
|
|
4323
4333
|
signal: c
|
|
4324
4334
|
}));
|
|
@@ -4338,7 +4348,7 @@ async function ei({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4338
4348
|
l.autofill.status = "complete";
|
|
4339
4349
|
return;
|
|
4340
4350
|
}
|
|
4341
|
-
await
|
|
4351
|
+
await wr(u, l, {
|
|
4342
4352
|
cycleId: p,
|
|
4343
4353
|
feedKey: u.feedKey,
|
|
4344
4354
|
items: h.slice(d.length),
|
|
@@ -4360,7 +4370,7 @@ async function ei({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4360
4370
|
}
|
|
4361
4371
|
//#endregion
|
|
4362
4372
|
//#region src/core/pageReplacement.ts
|
|
4363
|
-
var
|
|
4373
|
+
var ai = class {
|
|
4364
4374
|
controller = null;
|
|
4365
4375
|
constructor(e) {
|
|
4366
4376
|
this.options = e;
|
|
@@ -4372,7 +4382,7 @@ var ti = class {
|
|
|
4372
4382
|
this.controller?.abort(), this.controller = null, this.options.surface()?.cancelItemRemoval();
|
|
4373
4383
|
}
|
|
4374
4384
|
async replace(e, t) {
|
|
4375
|
-
let n =
|
|
4385
|
+
let n = Kn(e);
|
|
4376
4386
|
this.cancel();
|
|
4377
4387
|
let r = new AbortController();
|
|
4378
4388
|
this.controller = r;
|
|
@@ -4392,7 +4402,7 @@ var ti = class {
|
|
|
4392
4402
|
let e = this.options.surface()?.getAutoScrollElement();
|
|
4393
4403
|
e && (e.scrollTop = 0);
|
|
4394
4404
|
}
|
|
4395
|
-
e.mediaIndices = new Map(a.map((t) => [t.postId,
|
|
4405
|
+
e.mediaIndices = new Map(a.map((t) => [t.postId, G(t, e.mediaIndices.get(t.postId) ?? 0)])), e.activeReelPostId !== null && !o.has(String(e.activeReelPostId)) && (e.activeReelPostId = null, e.reelOrigin = null), e.items = a, e.next = n.next, e.total = n.total ?? null, e.error = null, e.nextPageError = null, this.options.commit({
|
|
4396
4406
|
...n,
|
|
4397
4407
|
items: a
|
|
4398
4408
|
});
|
|
@@ -4403,7 +4413,7 @@ var ti = class {
|
|
|
4403
4413
|
};
|
|
4404
4414
|
//#endregion
|
|
4405
4415
|
//#region src/core/loadingLock.ts
|
|
4406
|
-
function
|
|
4416
|
+
function oi(e, t, n) {
|
|
4407
4417
|
if (e.loadMoreLocked !== t && (e.loadMoreLocked = t, !t)) {
|
|
4408
4418
|
if (e.fill.status === "paused" && e.fill.target) {
|
|
4409
4419
|
n.resumeFill();
|
|
@@ -4414,21 +4424,21 @@ function ni(e, t, n) {
|
|
|
4414
4424
|
e ? e.finally(() => {
|
|
4415
4425
|
n.loadNext();
|
|
4416
4426
|
}) : n.loadNext();
|
|
4417
|
-
} else e.infiniteScroll &&
|
|
4427
|
+
} else e.infiniteScroll && h(n.loadIfNearBottom);
|
|
4418
4428
|
}
|
|
4419
4429
|
}
|
|
4420
4430
|
//#endregion
|
|
4421
4431
|
//#region src/core/removalReconciliationController.ts
|
|
4422
|
-
function
|
|
4432
|
+
function si(e) {
|
|
4423
4433
|
return `${typeof e}:${String(e)}`;
|
|
4424
4434
|
}
|
|
4425
|
-
function
|
|
4435
|
+
function ci(e) {
|
|
4426
4436
|
return `${typeof e}:${String(e)}`;
|
|
4427
4437
|
}
|
|
4428
|
-
function
|
|
4438
|
+
function li(e) {
|
|
4429
4439
|
return e.map(({ postId: e }) => e);
|
|
4430
4440
|
}
|
|
4431
|
-
var
|
|
4441
|
+
var ui = class {
|
|
4432
4442
|
delay;
|
|
4433
4443
|
enabled;
|
|
4434
4444
|
maxReplayPages;
|
|
@@ -4447,7 +4457,7 @@ var oi = class {
|
|
|
4447
4457
|
e.status === "complete" && (this.pages = [...this.pages.slice(0, e.replaceFrom), ...e.pages].slice(-this.maxReplayPages), this.pending = null);
|
|
4448
4458
|
}
|
|
4449
4459
|
filterItems(e) {
|
|
4450
|
-
return this.tombstones.size === 0 ? [...e] : e.filter(({ postId: e }) => !this.tombstones.has(
|
|
4460
|
+
return this.tombstones.size === 0 ? [...e] : e.filter(({ postId: e }) => !this.tombstones.has(si(e)));
|
|
4451
4461
|
}
|
|
4452
4462
|
needsReconciliation(e) {
|
|
4453
4463
|
return this.pending !== null || this.findUnderfilledPage(e) >= 0;
|
|
@@ -4460,45 +4470,45 @@ var oi = class {
|
|
|
4460
4470
|
}
|
|
4461
4471
|
recordInitialPage(e) {
|
|
4462
4472
|
e && this.recordPages([{
|
|
4463
|
-
contributionIds:
|
|
4464
|
-
cursor:
|
|
4473
|
+
contributionIds: li(e.items),
|
|
4474
|
+
cursor: Xn(e),
|
|
4465
4475
|
next: e.next,
|
|
4466
|
-
returnedIds:
|
|
4476
|
+
returnedIds: li(e.items)
|
|
4467
4477
|
}]);
|
|
4468
4478
|
}
|
|
4469
4479
|
remove(e) {
|
|
4470
|
-
e.forEach((e) => this.tombstones.add(
|
|
4480
|
+
e.forEach((e) => this.tombstones.add(si(e)));
|
|
4471
4481
|
}
|
|
4472
4482
|
reset() {
|
|
4473
4483
|
this.pages = [], this.pending = null, this.tombstones.clear();
|
|
4474
4484
|
}
|
|
4475
4485
|
restore(e) {
|
|
4476
|
-
e.forEach((e) => this.tombstones.delete(
|
|
4486
|
+
e.forEach((e) => this.tombstones.delete(si(e)));
|
|
4477
4487
|
}
|
|
4478
4488
|
async reconcile({ existingItems: e, loadPage: t, onDelayChange: n = () => void 0, shouldPause: r = () => !1, signal: i }) {
|
|
4479
4489
|
let a = this.pending ?? this.createSession(e);
|
|
4480
4490
|
for (this.pending = a; a.remainingRequests > 0;) {
|
|
4481
|
-
let e =
|
|
4491
|
+
let e = ci(a.cursor);
|
|
4482
4492
|
if (a.seenCursors.has(e)) throw Error("Vibe removal reconciliation received a repeated cursor.");
|
|
4483
|
-
if (await
|
|
4484
|
-
delayMs:
|
|
4493
|
+
if (await or({
|
|
4494
|
+
delayMs: ir(a.pages.length, this.delay),
|
|
4485
4495
|
onChange: n,
|
|
4486
4496
|
signal: i
|
|
4487
4497
|
}), a.pages.length > 0 && r()) return this.result(a, "paused");
|
|
4488
|
-
let o =
|
|
4498
|
+
let o = Kn(await t({
|
|
4489
4499
|
cursor: a.cursor,
|
|
4490
4500
|
signal: i
|
|
4491
4501
|
}));
|
|
4492
4502
|
a.seenCursors.add(e);
|
|
4493
4503
|
let s = this.filterItems(o.items), c = [];
|
|
4494
4504
|
if (s.forEach((e) => {
|
|
4495
|
-
let t =
|
|
4505
|
+
let t = si(e.postId);
|
|
4496
4506
|
a.attributed.has(t) || (a.attributed.add(t), c.push(e.postId)), a.appended.has(t) || (a.appended.add(t), a.items.push(e));
|
|
4497
4507
|
}), a.pages.push({
|
|
4498
4508
|
contributionIds: c,
|
|
4499
4509
|
cursor: a.cursor,
|
|
4500
4510
|
next: o.next,
|
|
4501
|
-
returnedIds:
|
|
4511
|
+
returnedIds: li(s)
|
|
4502
4512
|
}), a.lastCursor = a.cursor, a.next = o.next, --a.remainingRequests, o.total !== void 0 && (a.total = o.total), a.next === null ? a.remainingRequests = 0 : a.cursor = a.next, a.remainingRequests > 0 && r()) return this.result(a, "paused");
|
|
4503
4513
|
}
|
|
4504
4514
|
return this.result(a, "complete");
|
|
@@ -4506,9 +4516,9 @@ var oi = class {
|
|
|
4506
4516
|
createSession(e) {
|
|
4507
4517
|
let t = this.findUnderfilledPage(e), n = t < 0 ? [] : this.pages.slice(t), r = n[0];
|
|
4508
4518
|
if (!r) throw Error("Vibe has no underfilled provider page to reconcile.");
|
|
4509
|
-
let i = new Set(n.flatMap(({ contributionIds: e }) => e.map(
|
|
4519
|
+
let i = new Set(n.flatMap(({ contributionIds: e }) => e.map(si))), a = new Set(e.map(({ postId: e }) => si(e)).filter((e) => !i.has(e)));
|
|
4510
4520
|
return {
|
|
4511
|
-
appended: new Set(e.map(({ postId: e }) =>
|
|
4521
|
+
appended: new Set(e.map(({ postId: e }) => si(e))),
|
|
4512
4522
|
attributed: new Set(a),
|
|
4513
4523
|
cursor: r.cursor,
|
|
4514
4524
|
items: [],
|
|
@@ -4533,11 +4543,11 @@ var oi = class {
|
|
|
4533
4543
|
}
|
|
4534
4544
|
findUnderfilledPage(e) {
|
|
4535
4545
|
if (!this.enabled || this.pages.length === 0) return -1;
|
|
4536
|
-
let t = new Set(e.map(({ postId: e }) =>
|
|
4537
|
-
return this.pages.findIndex(({ contributionIds: e }) => e.filter((e) => t.has(
|
|
4546
|
+
let t = new Set(e.map(({ postId: e }) => si(e)));
|
|
4547
|
+
return this.pages.findIndex(({ contributionIds: e }) => e.filter((e) => t.has(si(e))).length < this.pageSize);
|
|
4538
4548
|
}
|
|
4539
4549
|
recordPage(e) {
|
|
4540
|
-
let t =
|
|
4550
|
+
let t = ci(e.cursor), n = this.pages.findIndex(({ cursor: e }) => ci(e) === t);
|
|
4541
4551
|
n >= 0 && (this.pages = this.pages.slice(0, n)), this.pages.push({
|
|
4542
4552
|
...e,
|
|
4543
4553
|
contributionIds: [...e.contributionIds],
|
|
@@ -4547,7 +4557,7 @@ var oi = class {
|
|
|
4547
4557
|
};
|
|
4548
4558
|
//#endregion
|
|
4549
4559
|
//#region src/core/activeItemRemoval.ts
|
|
4550
|
-
function
|
|
4560
|
+
function di(e, t, n, r, i) {
|
|
4551
4561
|
let a = new Set(t.map(({ item: e }) => e.postId));
|
|
4552
4562
|
if (e.activeReelPostId === null || !a.has(e.activeReelPostId)) return;
|
|
4553
4563
|
let o = e.items[Math.max(n, 0)];
|
|
@@ -4560,7 +4570,7 @@ function si(e, t, n, r, i) {
|
|
|
4560
4570
|
}
|
|
4561
4571
|
//#endregion
|
|
4562
4572
|
//#region src/core/exactMediaRemovalController.ts
|
|
4563
|
-
function
|
|
4573
|
+
function fi(e, t) {
|
|
4564
4574
|
let [n, ...r] = t;
|
|
4565
4575
|
if (!n) throw Error("Vibe items must contain at least one media asset.");
|
|
4566
4576
|
return {
|
|
@@ -4569,10 +4579,10 @@ function ci(e, t) {
|
|
|
4569
4579
|
items: r
|
|
4570
4580
|
};
|
|
4571
4581
|
}
|
|
4572
|
-
function
|
|
4582
|
+
function pi(e) {
|
|
4573
4583
|
if (!Number.isInteger(e.mediaIndex) || e.mediaIndex < 0) throw TypeError("Vibe mediaIndex must be a non-negative integer.");
|
|
4574
4584
|
}
|
|
4575
|
-
var
|
|
4585
|
+
var mi = class {
|
|
4576
4586
|
generation = 0;
|
|
4577
4587
|
metadata = /* @__PURE__ */ new WeakMap();
|
|
4578
4588
|
state;
|
|
@@ -4580,10 +4590,10 @@ var ui = class {
|
|
|
4580
4590
|
this.options = e, this.state = e.state;
|
|
4581
4591
|
}
|
|
4582
4592
|
remove(e) {
|
|
4583
|
-
|
|
4593
|
+
pi(e);
|
|
4584
4594
|
let t = this.state.items.findIndex(({ postId: t }) => t === e.postId), n = this.state.items[t];
|
|
4585
4595
|
if (!n) return null;
|
|
4586
|
-
let r = [...
|
|
4596
|
+
let r = [...W(n)], i = r[e.mediaIndex];
|
|
4587
4597
|
if (!i) return null;
|
|
4588
4598
|
let a = Object.freeze({
|
|
4589
4599
|
media: i,
|
|
@@ -4597,7 +4607,7 @@ var ui = class {
|
|
|
4597
4607
|
restored: !1
|
|
4598
4608
|
});
|
|
4599
4609
|
let o = this.state.mediaIndices.get(n.postId) ?? 0, s = this.isReelOpen() && this.state.activeReelPostId === n.postId, c = s && o === e.mediaIndex;
|
|
4600
|
-
return r.splice(e.mediaIndex, 1), r.length > 0 ? (this.state.items[t] =
|
|
4610
|
+
return r.splice(e.mediaIndex, 1), r.length > 0 ? (this.state.items[t] = fi(n, r), this.updateMediaIndexAfterRemoval(n.postId, e.mediaIndex, c), a) : (this.state.items.splice(t, 1), this.options.onPostRemoved(n.postId), this.state.mediaIndices.delete(n.postId), s && this.advanceFromRemovedPost(a, n), a);
|
|
4601
4611
|
}
|
|
4602
4612
|
reset() {
|
|
4603
4613
|
this.generation += 1;
|
|
@@ -4622,32 +4632,32 @@ var ui = class {
|
|
|
4622
4632
|
return this.state.layout === "reel" || this.state.reelOrigin === "masonry";
|
|
4623
4633
|
}
|
|
4624
4634
|
restoreIntoPost(e, t) {
|
|
4625
|
-
let n = this.state.items[e], r = [...
|
|
4626
|
-
if (r.splice(i, 0, t.media), this.state.items[e] =
|
|
4635
|
+
let n = this.state.items[e], r = [...W(n)], i = Math.min(t.mediaIndex, r.length);
|
|
4636
|
+
if (r.splice(i, 0, t.media), this.state.items[e] = fi(n, r), this.state.activeReelPostId !== t.postId) return;
|
|
4627
4637
|
let a = this.state.mediaIndices.get(t.postId) ?? 0;
|
|
4628
4638
|
a >= i && this.state.mediaIndices.set(t.postId, a + 1);
|
|
4629
4639
|
}
|
|
4630
4640
|
updateMediaIndexAfterRemoval(e, t, n) {
|
|
4631
4641
|
let r = this.state.items.find((t) => t.postId === e);
|
|
4632
4642
|
if (!r) return;
|
|
4633
|
-
let i =
|
|
4643
|
+
let i = W(r).length, a = this.state.mediaIndices.get(e) ?? 0, o = a;
|
|
4634
4644
|
n ? o = t < i ? t : 0 : t < a && (o = a - 1), this.state.mediaIndices.set(e, Math.min(o, i - 1));
|
|
4635
4645
|
}
|
|
4636
4646
|
};
|
|
4637
4647
|
//#endregion
|
|
4638
4648
|
//#region src/core/itemPlacement.ts
|
|
4639
|
-
function
|
|
4649
|
+
function hi(e, t) {
|
|
4640
4650
|
let n = new Set(t);
|
|
4641
4651
|
return e.flatMap((e, t) => n.has(e.postId) ? [{
|
|
4642
4652
|
index: t,
|
|
4643
4653
|
item: e
|
|
4644
4654
|
}] : []);
|
|
4645
4655
|
}
|
|
4646
|
-
function
|
|
4656
|
+
function gi(e, t) {
|
|
4647
4657
|
let n = new Set(t.map(({ item: e }) => e.postId));
|
|
4648
4658
|
return e.filter((e) => !n.has(e.postId));
|
|
4649
4659
|
}
|
|
4650
|
-
function
|
|
4660
|
+
function _i(e, t) {
|
|
4651
4661
|
t.forEach(({ index: e }) => {
|
|
4652
4662
|
if (!Number.isInteger(e) || e < 0) throw Error("Vibe item restore indexes must be non-negative integers.");
|
|
4653
4663
|
});
|
|
@@ -4658,7 +4668,7 @@ function pi(e, t) {
|
|
|
4658
4668
|
}
|
|
4659
4669
|
//#endregion
|
|
4660
4670
|
//#region src/core/itemRemovalController.ts
|
|
4661
|
-
var
|
|
4671
|
+
var vi = 20, yi = class {
|
|
4662
4672
|
generation = 0;
|
|
4663
4673
|
historyLimit;
|
|
4664
4674
|
metadata = /* @__PURE__ */ new WeakMap();
|
|
@@ -4667,7 +4677,7 @@ var mi = 20, hi = class {
|
|
|
4667
4677
|
itemOrder;
|
|
4668
4678
|
stopItemsWatcher;
|
|
4669
4679
|
constructor(e) {
|
|
4670
|
-
this.options = e, this.historyLimit = e.historyLimit ??
|
|
4680
|
+
this.options = e, this.historyLimit = e.historyLimit ?? vi, this.state = e.state, this.itemOrder = this.state.items.map(({ postId: e }) => e), this.stopItemsWatcher = A(() => this.state.items, (e) => this.appendUnknownItems(e), { flush: "sync" });
|
|
4671
4681
|
}
|
|
4672
4682
|
destroy() {
|
|
4673
4683
|
this.reset(), this.stopItemsWatcher();
|
|
@@ -4681,7 +4691,7 @@ var mi = 20, hi = class {
|
|
|
4681
4691
|
let a = this.options.startRemoval(i, t);
|
|
4682
4692
|
if (a > 0 && await new Promise((e) => setTimeout(e, a)), this.metadata.get(r)?.generation !== this.generation) return r;
|
|
4683
4693
|
let o = this.state.items.findIndex((e) => e.postId === this.state.activeReelPostId), s = new Set(n.map(({ item: e }) => e.postId)), c = o < 0 ? 0 : this.state.items.slice(0, o).filter(({ postId: e }) => s.has(e)).length, l = Math.max(o - c, 0);
|
|
4684
|
-
return this.state.items =
|
|
4694
|
+
return this.state.items = gi(this.state.items, n), this.options.onItemsRemoved(r, n, l), this.record(r), r;
|
|
4685
4695
|
}
|
|
4686
4696
|
reset() {
|
|
4687
4697
|
this.generation += 1, this.history = [], this.itemOrder = [];
|
|
@@ -4692,7 +4702,7 @@ var mi = 20, hi = class {
|
|
|
4692
4702
|
this.restoreRemoval(t);
|
|
4693
4703
|
return;
|
|
4694
4704
|
}
|
|
4695
|
-
let n = new Set(this.state.items.map(({ postId: e }) => e)), r = e.filter(({ item: e }) => n.has(e.postId) ? !1 : (n.add(e.postId), !0)), i =
|
|
4705
|
+
let n = new Set(this.state.items.map(({ postId: e }) => e)), r = e.filter(({ item: e }) => n.has(e.postId) ? !1 : (n.add(e.postId), !0)), i = _i(this.state.items, r);
|
|
4696
4706
|
this.registerExternalPlacements(r), this.state.items = i, r.length > 0 && this.options.onRemovalRestored(r);
|
|
4697
4707
|
}
|
|
4698
4708
|
restoreRemoval(e) {
|
|
@@ -4718,7 +4728,7 @@ var mi = 20, hi = class {
|
|
|
4718
4728
|
}
|
|
4719
4729
|
collectOrderedPlacements(e) {
|
|
4720
4730
|
let t = new Map(this.itemOrder.map((e, t) => [e, t]));
|
|
4721
|
-
return
|
|
4731
|
+
return hi(this.state.items, e).map((e) => ({
|
|
4722
4732
|
index: t.get(e.item.postId) ?? e.index,
|
|
4723
4733
|
item: e.item
|
|
4724
4734
|
}));
|
|
@@ -4749,7 +4759,7 @@ var mi = 20, hi = class {
|
|
|
4749
4759
|
let r = new Map(this.itemOrder.map((e, t) => [e, t]));
|
|
4750
4760
|
return this.state.items = [...this.state.items, ...n].sort((e, t) => (r.get(e.postId) ?? 2 ** 53 - 1) - (r.get(t.postId) ?? 2 ** 53 - 1)), !0;
|
|
4751
4761
|
}
|
|
4752
|
-
},
|
|
4762
|
+
}, bi = class {
|
|
4753
4763
|
forward = null;
|
|
4754
4764
|
forwardPromise = null;
|
|
4755
4765
|
forwardVersion = 0;
|
|
@@ -4845,7 +4855,7 @@ var mi = 20, hi = class {
|
|
|
4845
4855
|
}
|
|
4846
4856
|
}
|
|
4847
4857
|
}
|
|
4848
|
-
},
|
|
4858
|
+
}, xi = class {
|
|
4849
4859
|
generation = 0;
|
|
4850
4860
|
pending = Promise.resolve();
|
|
4851
4861
|
constructor(e) {
|
|
@@ -4862,7 +4872,7 @@ var mi = 20, hi = class {
|
|
|
4862
4872
|
if (!n) return;
|
|
4863
4873
|
let r = t.mediaIndices.get(e.postId) ?? 0;
|
|
4864
4874
|
if (e.mediaIndex === r) {
|
|
4865
|
-
if (
|
|
4875
|
+
if (W(n).length > 1) {
|
|
4866
4876
|
await this.options.transitionMedia(1);
|
|
4867
4877
|
return;
|
|
4868
4878
|
}
|
|
@@ -4895,24 +4905,24 @@ var mi = 20, hi = class {
|
|
|
4895
4905
|
};
|
|
4896
4906
|
//#endregion
|
|
4897
4907
|
//#region src/core/removalControllers.ts
|
|
4898
|
-
function
|
|
4899
|
-
let t = new
|
|
4908
|
+
function Si(e) {
|
|
4909
|
+
let t = new bi(e), n = new xi({
|
|
4900
4910
|
state: e.state,
|
|
4901
4911
|
transitionMedia: (t) => e.surface()?.transitionActiveReelMedia(t) ?? Promise.resolve(!1),
|
|
4902
4912
|
transitionPost: (t) => e.surface()?.transitionActiveReelPost(t) ?? Promise.resolve(!1)
|
|
4903
4913
|
});
|
|
4904
4914
|
return {
|
|
4905
|
-
exactMediaRemoval: new
|
|
4915
|
+
exactMediaRemoval: new mi({
|
|
4906
4916
|
onActivate: e.onActivate,
|
|
4907
4917
|
onPostRemoved: (t) => e.onItemsRemoved([t]),
|
|
4908
4918
|
onPostRestored: (t) => e.onItemsRestored([t]),
|
|
4909
4919
|
reelForward: t,
|
|
4910
4920
|
state: e.state
|
|
4911
4921
|
}),
|
|
4912
|
-
itemRemoval: new
|
|
4922
|
+
itemRemoval: new yi({
|
|
4913
4923
|
historyLimit: e.historyLimit,
|
|
4914
4924
|
onItemsRemoved: (n, r, i) => {
|
|
4915
|
-
e.onItemsRemoved(r.map(({ item: e }) => e.postId)),
|
|
4925
|
+
e.onItemsRemoved(r.map(({ item: e }) => e.postId)), di(e.state, r, i, e.onActivate, (e, r) => t.start(n, e, r));
|
|
4916
4926
|
},
|
|
4917
4927
|
onRemovalRestored: (n) => {
|
|
4918
4928
|
e.onItemsRestored(n.map(({ item: e }) => e.postId));
|
|
@@ -4927,17 +4937,17 @@ function vi(e) {
|
|
|
4927
4937
|
reelRemoval: n
|
|
4928
4938
|
};
|
|
4929
4939
|
}
|
|
4930
|
-
var
|
|
4931
|
-
function
|
|
4940
|
+
var Ci = 1.5;
|
|
4941
|
+
function wi(e) {
|
|
4932
4942
|
let t = Math.min(e.screenWidth, e.screenHeight);
|
|
4933
4943
|
if (t > 0 && t < 600) return !0;
|
|
4934
|
-
let n = Math.min(e.viewportWidth, e.viewportHeight), r = t >= n *
|
|
4944
|
+
let n = Math.min(e.viewportWidth, e.viewportHeight), r = t >= n * Ci;
|
|
4935
4945
|
return !e.hasHover && n > 0 && n < 600 && r;
|
|
4936
4946
|
}
|
|
4937
|
-
function
|
|
4938
|
-
return
|
|
4947
|
+
function Ti(e) {
|
|
4948
|
+
return wi(e) ? "reel" : "masonry";
|
|
4939
4949
|
}
|
|
4940
|
-
function
|
|
4950
|
+
function Ei(e) {
|
|
4941
4951
|
let t = e.ownerDocument.defaultView, n = e.ownerDocument.documentElement;
|
|
4942
4952
|
return {
|
|
4943
4953
|
hasHover: typeof t?.matchMedia == "function" && t.matchMedia("(hover: hover)").matches,
|
|
@@ -4947,15 +4957,15 @@ function Si(e) {
|
|
|
4947
4957
|
viewportWidth: n.clientWidth
|
|
4948
4958
|
};
|
|
4949
4959
|
}
|
|
4950
|
-
function
|
|
4951
|
-
return
|
|
4960
|
+
function Di(e) {
|
|
4961
|
+
return wi(Ei(e));
|
|
4952
4962
|
}
|
|
4953
|
-
function
|
|
4954
|
-
return
|
|
4963
|
+
function Oi(e) {
|
|
4964
|
+
return Ti(Ei(e));
|
|
4955
4965
|
}
|
|
4956
4966
|
//#endregion
|
|
4957
4967
|
//#region src/core/responsiveLayoutController.ts
|
|
4958
|
-
var
|
|
4968
|
+
var ki = class {
|
|
4959
4969
|
layoutMode;
|
|
4960
4970
|
resizeObserver = null;
|
|
4961
4971
|
target = null;
|
|
@@ -4980,13 +4990,13 @@ var Ti = class {
|
|
|
4980
4990
|
}
|
|
4981
4991
|
handleResponsiveLayout = () => {
|
|
4982
4992
|
if (!this.target) return;
|
|
4983
|
-
let e =
|
|
4984
|
-
this.state.phoneMode =
|
|
4993
|
+
let e = Oi(this.target);
|
|
4994
|
+
this.state.phoneMode = Di(this.target), this.state.reelInfoSheetOverlay = this.state.phoneMode, this.state.reelMediaSource = this.state.phoneMode ? "mobile" : "original", this.layoutMode === "responsive" && this.applyLayout(e);
|
|
4985
4995
|
};
|
|
4986
|
-
},
|
|
4996
|
+
}, Ai = class {
|
|
4987
4997
|
state;
|
|
4988
4998
|
constructor(e) {
|
|
4989
|
-
this.options = e, this.state =
|
|
4999
|
+
this.options = e, this.state = S(Vt({
|
|
4990
5000
|
...e.initialReelAudioState,
|
|
4991
5001
|
muted: e.initialReelAudioState?.muted ?? e.mediaCard?.videoMuted ?? !1
|
|
4992
5002
|
}));
|
|
@@ -4995,9 +5005,9 @@ var Ti = class {
|
|
|
4995
5005
|
return { ...this.state };
|
|
4996
5006
|
}
|
|
4997
5007
|
set(e, t = !1) {
|
|
4998
|
-
Object.assign(this.state,
|
|
5008
|
+
Object.assign(this.state, Vt(e, this.state)), t && this.options.onReelAudioStateChange?.(this.get());
|
|
4999
5009
|
}
|
|
5000
|
-
},
|
|
5010
|
+
}, ji = class {
|
|
5001
5011
|
routedReelPostId = null;
|
|
5002
5012
|
reelRouteIsActive = !1;
|
|
5003
5013
|
constructor(e, t) {
|
|
@@ -5027,30 +5037,30 @@ var Ti = class {
|
|
|
5027
5037
|
};
|
|
5028
5038
|
//#endregion
|
|
5029
5039
|
//#region src/core/updateItems.ts
|
|
5030
|
-
function
|
|
5040
|
+
function Mi(e) {
|
|
5031
5041
|
return String(e);
|
|
5032
5042
|
}
|
|
5033
|
-
function
|
|
5034
|
-
let n =
|
|
5043
|
+
function Ni(e, t) {
|
|
5044
|
+
let n = W(t).length;
|
|
5035
5045
|
(e.mediaIndices.get(t.postId) ?? 0) >= n && e.mediaIndices.set(t.postId, Math.max(0, n - 1));
|
|
5036
5046
|
}
|
|
5037
|
-
function
|
|
5047
|
+
function Pi(e, t) {
|
|
5038
5048
|
let n = /* @__PURE__ */ new Map();
|
|
5039
|
-
if (t.forEach((e) => n.set(
|
|
5049
|
+
if (t.forEach((e) => n.set(Mi(e.postId), e)), n.size === 0) return [];
|
|
5040
5050
|
let r = [], i = e.items.map((t) => {
|
|
5041
|
-
let i = n.get(
|
|
5051
|
+
let i = n.get(Mi(t.postId));
|
|
5042
5052
|
if (!i) return t;
|
|
5043
5053
|
let a = {
|
|
5044
5054
|
...i,
|
|
5045
5055
|
postId: t.postId
|
|
5046
5056
|
};
|
|
5047
|
-
return
|
|
5057
|
+
return Ni(e, a), e.reelForwardItem && Mi(e.reelForwardItem.postId) === Mi(t.postId) && (e.reelForwardItem = a), r.push(t.postId), a;
|
|
5048
5058
|
});
|
|
5049
5059
|
return r.length > 0 && (e.items = i), r;
|
|
5050
5060
|
}
|
|
5051
5061
|
//#endregion
|
|
5052
5062
|
//#region src/core/createVibe.ts
|
|
5053
|
-
var
|
|
5063
|
+
var Fi = class {
|
|
5054
5064
|
app = null;
|
|
5055
5065
|
autoScroll;
|
|
5056
5066
|
autofillController;
|
|
@@ -5074,25 +5084,25 @@ var ji = class {
|
|
|
5074
5084
|
state;
|
|
5075
5085
|
pageReplacement;
|
|
5076
5086
|
constructor(e) {
|
|
5077
|
-
this.options = e,
|
|
5087
|
+
this.options = e, ni(e);
|
|
5078
5088
|
let t = e.layout ?? "masonry";
|
|
5079
|
-
this.state =
|
|
5089
|
+
this.state = S($r(e, t)), this.reelAudio = new Ai(e), this.lastLoadedCursor = e.initialPage ? Xn(e.initialPage) : null, this.notificationItems = ee(this.state), this.autoScroll = new Cr({
|
|
5080
5090
|
getScrollElement: () => this.surface?.getAutoScrollElement() ?? null,
|
|
5081
5091
|
state: this.state.autoScroll
|
|
5082
|
-
}), this.autofillController = new
|
|
5092
|
+
}), this.autofillController = new _r({
|
|
5083
5093
|
cancelRequest: () => this.cancelRequest(!this.pageReplacement?.isActive()),
|
|
5084
5094
|
onLastCursor: (e) => this.setCurrentCursor(e),
|
|
5085
5095
|
onPages: (e) => this.removalReconciliation.recordPages(e),
|
|
5086
5096
|
options: e.autofill,
|
|
5087
5097
|
state: this.state
|
|
5088
|
-
}), this.removalReconciliation = new
|
|
5098
|
+
}), this.removalReconciliation = new ui(e), this.removalReconciliation.recordInitialPage(e.initialPage), this.fillController = new Wr({
|
|
5089
5099
|
filterItems: (e) => this.removalReconciliation.filterItems(e),
|
|
5090
5100
|
fill: e.fill,
|
|
5091
5101
|
loadPage: e.loadPage ? (e) => this.loadFilteredPage(e) : void 0,
|
|
5092
5102
|
needsFrontendPreparation: () => this.removalReconciliation.needsReconciliation(this.state.items),
|
|
5093
5103
|
onLastCursor: (e) => this.setCurrentCursor(e),
|
|
5094
5104
|
onPages: (e) => this.removalReconciliation.recordPages(e),
|
|
5095
|
-
prepareFrontend: ({ isCurrent: t, onDelayChange: n, signal: r }) =>
|
|
5105
|
+
prepareFrontend: ({ isCurrent: t, onDelayChange: n, signal: r }) => Gr({
|
|
5096
5106
|
controller: this.removalReconciliation,
|
|
5097
5107
|
isCurrent: t,
|
|
5098
5108
|
loadPage: e.loadPage,
|
|
@@ -5102,8 +5112,8 @@ var ji = class {
|
|
|
5102
5112
|
state: this.state
|
|
5103
5113
|
}),
|
|
5104
5114
|
state: this.state
|
|
5105
|
-
}), this.routing = new
|
|
5106
|
-
let n =
|
|
5115
|
+
}), this.routing = new ji(e.routing, this.state);
|
|
5116
|
+
let n = Si({
|
|
5107
5117
|
historyLimit: e.removalHistoryLimit,
|
|
5108
5118
|
onActivate: (e) => this.setActiveReelPost(e),
|
|
5109
5119
|
onCloseReel: () => this.closeMasonryReel(),
|
|
@@ -5113,29 +5123,29 @@ var ji = class {
|
|
|
5113
5123
|
state: this.state,
|
|
5114
5124
|
surface: () => this.surface
|
|
5115
5125
|
});
|
|
5116
|
-
this.exactMediaRemoval = n.exactMediaRemoval, this.itemRemoval = n.itemRemoval, this.reelForward = n.reelForward, this.reelRemoval = n.reelRemoval, this.pageReplacement = new
|
|
5126
|
+
this.exactMediaRemoval = n.exactMediaRemoval, this.itemRemoval = n.itemRemoval, this.reelForward = n.reelForward, this.reelRemoval = n.reelRemoval, this.pageReplacement = new ai({
|
|
5117
5127
|
state: this.state,
|
|
5118
5128
|
surface: () => this.surface,
|
|
5119
5129
|
prepare: async () => {
|
|
5120
|
-
this.cancelRequest(!1),
|
|
5130
|
+
this.cancelRequest(!1), pr(this.state.autofill) && await this.cancelAutofill(), this.fillController.isActive() && await this.cancelFill();
|
|
5121
5131
|
},
|
|
5122
5132
|
commit: (e) => {
|
|
5123
|
-
this.resetFeedVisit(), this.setCurrentCursor(
|
|
5133
|
+
this.resetFeedVisit(), this.setCurrentCursor(Xn(e)), this.removalReconciliation.recordInitialPage(e), this.state.reelOrigin === null && this.routing.syncFeed();
|
|
5124
5134
|
}
|
|
5125
|
-
}), this.responsiveLayout = new
|
|
5135
|
+
}), this.responsiveLayout = new ki(t, this.state, () => {
|
|
5126
5136
|
this.routing.syncFeed();
|
|
5127
5137
|
}), this.startStateNotifications();
|
|
5128
5138
|
}
|
|
5129
5139
|
async mount() {
|
|
5130
5140
|
if (this.app) throw Error("Vibe is already mounted.");
|
|
5131
5141
|
this.startStateNotifications();
|
|
5132
|
-
let e =
|
|
5133
|
-
this.responsiveLayout.mount(e), this.app = i(
|
|
5142
|
+
let e = ri(this.options.target);
|
|
5143
|
+
this.responsiveLayout.mount(e), this.app = i(Gn, {
|
|
5134
5144
|
canRetryEnd: !!this.options.loadPage,
|
|
5135
5145
|
cardFooter: this.options.cardFooter,
|
|
5136
5146
|
cardHeader: this.options.cardHeader,
|
|
5137
5147
|
feedFooter: this.options.feedFooter,
|
|
5138
|
-
feedFooterActions:
|
|
5148
|
+
feedFooterActions: Kr(this),
|
|
5139
5149
|
mediaCard: this.options.mediaCard,
|
|
5140
5150
|
masonry: this.options.masonry,
|
|
5141
5151
|
onMediaFullyVisible: this.options.onMediaFullyVisible,
|
|
@@ -5162,7 +5172,7 @@ var ji = class {
|
|
|
5162
5172
|
onRetryForward: () => {
|
|
5163
5173
|
this.retryReelForward();
|
|
5164
5174
|
}
|
|
5165
|
-
}), this.surface = this.app.mount(e), this.autoScroll.mount(), await
|
|
5175
|
+
}), this.surface = this.app.mount(e), this.autoScroll.mount(), await Or(this.options.restoreBacklog, (e) => this.appendPage(e), (e) => {
|
|
5166
5176
|
this.restoreController = e;
|
|
5167
5177
|
}), !this.options.initialPage && this.state.items.length === 0 ? await this.reload() : this.options.autofill && this.state.autofill.status === "idle" && !this.fillController.isActive() && !this.state.loadMoreLocked && await this.startInitialAutofill();
|
|
5168
5178
|
}
|
|
@@ -5170,7 +5180,7 @@ var ji = class {
|
|
|
5170
5180
|
this.restoreController?.abort(), this.restoreController = null, this.autoScroll.destroy(), this.fillController.destroy(), this.cancelRequest(), this.reelForward.reset(), this.reelRemoval.reset(), this.exactMediaRemoval.reset(), this.itemRemoval.destroy(), this.removalReconciliation.reset(), this.responsiveLayout.destroy(), this.stopStateWatcher?.(), this.stopStateWatcher = null, this.app?.unmount(), this.app = null, this.surface = null;
|
|
5171
5181
|
}
|
|
5172
5182
|
getState() {
|
|
5173
|
-
return
|
|
5183
|
+
return Y(this.state);
|
|
5174
5184
|
}
|
|
5175
5185
|
getReelAudioState() {
|
|
5176
5186
|
return this.reelAudio.get();
|
|
@@ -5197,7 +5207,7 @@ var ji = class {
|
|
|
5197
5207
|
return this.itemRemoval.restoreRemoval(e);
|
|
5198
5208
|
}
|
|
5199
5209
|
updateItems(e) {
|
|
5200
|
-
return
|
|
5210
|
+
return Pi(this.state, e);
|
|
5201
5211
|
}
|
|
5202
5212
|
retryReelForward() {
|
|
5203
5213
|
return this.reelForward.retry();
|
|
@@ -5236,7 +5246,7 @@ var ji = class {
|
|
|
5236
5246
|
this.autoScroll.setSpeed(e);
|
|
5237
5247
|
}
|
|
5238
5248
|
applyAutofillUpdate(e) {
|
|
5239
|
-
let t =
|
|
5249
|
+
let t = Er(this.options.autofill, this.state, e);
|
|
5240
5250
|
return t && this.autofillController.syncCountdown(), t;
|
|
5241
5251
|
}
|
|
5242
5252
|
cancelAutofill() {
|
|
@@ -5247,7 +5257,7 @@ var ji = class {
|
|
|
5247
5257
|
await this.cancelFill();
|
|
5248
5258
|
return;
|
|
5249
5259
|
}
|
|
5250
|
-
if (
|
|
5260
|
+
if (pr(this.state.autofill)) {
|
|
5251
5261
|
await this.cancelAutofill();
|
|
5252
5262
|
return;
|
|
5253
5263
|
}
|
|
@@ -5260,12 +5270,12 @@ var ji = class {
|
|
|
5260
5270
|
}
|
|
5261
5271
|
async fill(e) {
|
|
5262
5272
|
if (!(this.state.loadMoreLocked || this.pageReplacement.isActive())) {
|
|
5263
|
-
if (this.pendingRequest ||
|
|
5273
|
+
if (this.pendingRequest || pr(this.state.autofill)) throw Error("Vibe cannot fill while another page operation is active.");
|
|
5264
5274
|
await this.fillController.start(e);
|
|
5265
5275
|
}
|
|
5266
5276
|
}
|
|
5267
5277
|
restoreAutofillSession(e) {
|
|
5268
|
-
let t =
|
|
5278
|
+
let t = Dr(this.options.autofill, this.state, e);
|
|
5269
5279
|
return t && this.autofillController.syncCountdown(), t;
|
|
5270
5280
|
}
|
|
5271
5281
|
restoreFillSession(e) {
|
|
@@ -5275,7 +5285,7 @@ var ji = class {
|
|
|
5275
5285
|
return this.startLoadMore(() => this.loadNextSequence());
|
|
5276
5286
|
}
|
|
5277
5287
|
appendPage(e) {
|
|
5278
|
-
|
|
5288
|
+
Zn(e, this.state, this.removalReconciliation, (e) => this.setCurrentCursor(e));
|
|
5279
5289
|
}
|
|
5280
5290
|
replenishAfterRemoval(e = !0) {
|
|
5281
5291
|
return this.startLoadMore(() => this.replenishAfterRemovalSequence(e));
|
|
@@ -5283,7 +5293,7 @@ var ji = class {
|
|
|
5283
5293
|
async startLoadMore(e) {
|
|
5284
5294
|
if (this.pageReplacement.isActive()) return;
|
|
5285
5295
|
if (this.pendingRequest) return this.pendingRequest;
|
|
5286
|
-
if (this.state.loadMoreLocked ||
|
|
5296
|
+
if (this.state.loadMoreLocked || pr(this.state.autofill) || this.fillController.isActive() || !this.options.loadPage || this.state.next === null && !this.removalReconciliation.needsReconciliation(this.state.items)) return;
|
|
5287
5297
|
this.state.isLoadingMore = !0, this.state.nextPageError = null;
|
|
5288
5298
|
let t = e();
|
|
5289
5299
|
return this.pendingRequest = t, t.finally(() => {
|
|
@@ -5301,15 +5311,15 @@ var ji = class {
|
|
|
5301
5311
|
}
|
|
5302
5312
|
async replaceFeed(e, t) {
|
|
5303
5313
|
if (!this.options.loadPage) throw Error(`Vibe cannot ${t} without loadPage.`);
|
|
5304
|
-
return
|
|
5314
|
+
return pr(this.state.autofill) && await this.cancelAutofill(), this.fillController.isActive() && await this.cancelFill(), this.cancelRequest(), this.resetFeedVisit(), this.surface?.resetMediaLifecycle(), this.state.error = null, this.state.current = null, this.state.isLoading = !0, this.state.items = [], this.state.next = null, this.state.nextPageError = null, this.state.total = null, this.startRequest(e, !1);
|
|
5305
5315
|
}
|
|
5306
5316
|
resetFeedVisit() {
|
|
5307
|
-
this.state.autofill =
|
|
5317
|
+
this.state.autofill = fr(this.options.autofill, void 0, !1), this.fillController.reset(), this.reelForward.reset(), this.reelRemoval.reset(), this.exactMediaRemoval.reset(), this.itemRemoval.reset(), this.removalReconciliation.reset();
|
|
5308
5318
|
}
|
|
5309
5319
|
async loadFilteredPage(e) {
|
|
5310
5320
|
let t = this.options.loadPage;
|
|
5311
5321
|
if (!t) throw Error("Vibe cannot load a page without loadPage.");
|
|
5312
|
-
let n =
|
|
5322
|
+
let n = Kn(await t(e));
|
|
5313
5323
|
return {
|
|
5314
5324
|
...n,
|
|
5315
5325
|
items: this.removalReconciliation.filterItems(n.items)
|
|
@@ -5329,7 +5339,7 @@ var ji = class {
|
|
|
5329
5339
|
let n = ++this.requestVersion, r = new AbortController();
|
|
5330
5340
|
this.abortController = r;
|
|
5331
5341
|
try {
|
|
5332
|
-
let i = await
|
|
5342
|
+
let i = await Gr({
|
|
5333
5343
|
controller: this.removalReconciliation,
|
|
5334
5344
|
isCurrent: () => n === this.requestVersion,
|
|
5335
5345
|
loadPage: t,
|
|
@@ -5349,14 +5359,14 @@ var ji = class {
|
|
|
5349
5359
|
async retryEnd() {
|
|
5350
5360
|
if (!this.pageReplacement.isActive()) {
|
|
5351
5361
|
if (this.pendingRequest) return this.pendingRequest;
|
|
5352
|
-
if (!this.state.loadMoreLocked && !(
|
|
5362
|
+
if (!this.state.loadMoreLocked && !(pr(this.state.autofill) || this.fillController.isActive()) && !(this.state.next !== null || !this.options.loadPage)) return this.state.isLoadingMore = !0, this.state.nextPageError = null, this.startRequest(this.lastLoadedCursor, !0);
|
|
5353
5363
|
}
|
|
5354
5364
|
}
|
|
5355
5365
|
setInfiniteScroll(e) {
|
|
5356
|
-
this.state.infiniteScroll = e, e &&
|
|
5366
|
+
this.state.infiniteScroll = e, e && h(() => this.surface?.loadIfNearBottom());
|
|
5357
5367
|
}
|
|
5358
5368
|
setLoadMoreLocked(e) {
|
|
5359
|
-
|
|
5369
|
+
oi(this.state, e, {
|
|
5360
5370
|
getPending: () => this.pendingRequest,
|
|
5361
5371
|
hasPendingSession: () => this.removalReconciliation.hasPendingSession(),
|
|
5362
5372
|
loadNext: () => this.loadNext(),
|
|
@@ -5369,10 +5379,10 @@ var ji = class {
|
|
|
5369
5379
|
this.state.total = e;
|
|
5370
5380
|
}
|
|
5371
5381
|
setReelAutoAdvance(e) {
|
|
5372
|
-
|
|
5382
|
+
Xr(this.state.reelAutoAdvance, e);
|
|
5373
5383
|
}
|
|
5374
5384
|
setReelInfoSheet(e) {
|
|
5375
|
-
|
|
5385
|
+
Qr(this.state.reelInfoSheet, this.options.reelInfoSheet, e);
|
|
5376
5386
|
}
|
|
5377
5387
|
setLayout(e) {
|
|
5378
5388
|
this.responsiveLayout.setLayout(e);
|
|
@@ -5392,7 +5402,7 @@ var ji = class {
|
|
|
5392
5402
|
async fetchPage(e, t) {
|
|
5393
5403
|
if (!this.options.loadPage) return;
|
|
5394
5404
|
let n = ++this.requestVersion, r = new AbortController();
|
|
5395
|
-
this.abortController = r, await
|
|
5405
|
+
this.abortController = r, await ii({
|
|
5396
5406
|
append: t,
|
|
5397
5407
|
autofillController: this.autofillController,
|
|
5398
5408
|
cursor: e,
|
|
@@ -5414,7 +5424,7 @@ var ji = class {
|
|
|
5414
5424
|
startInitialAutofill() {
|
|
5415
5425
|
let e = ++this.requestVersion, t = new AbortController(), n = this.autofillController.beginCycle();
|
|
5416
5426
|
this.abortController = t, this.state.isLoadingMore = !0;
|
|
5417
|
-
let r =
|
|
5427
|
+
let r = kr({
|
|
5418
5428
|
cycleId: n,
|
|
5419
5429
|
isCurrent: () => e === this.requestVersion,
|
|
5420
5430
|
onCollection: (t) => this.autofillController.captureCollection(t, e === this.requestVersion),
|
|
@@ -5432,11 +5442,175 @@ var ji = class {
|
|
|
5432
5442
|
}
|
|
5433
5443
|
startStateNotifications() {
|
|
5434
5444
|
let e = this.options.onStateChange;
|
|
5435
|
-
!e || this.stopStateWatcher || (this.stopStateWatcher =
|
|
5445
|
+
!e || this.stopStateWatcher || (this.stopStateWatcher = J(this.state, this.notificationItems, e));
|
|
5436
5446
|
}
|
|
5437
5447
|
setCurrentCursor(e) {
|
|
5438
5448
|
this.lastLoadedCursor = this.state.current = e;
|
|
5439
5449
|
}
|
|
5440
|
-
},
|
|
5450
|
+
}, Ii = (e) => new Fi(e);
|
|
5451
|
+
//#endregion
|
|
5452
|
+
//#region src/core/controlledReel.ts
|
|
5453
|
+
function Li(e, t) {
|
|
5454
|
+
let { signal: n } = t;
|
|
5455
|
+
return new Promise((r, i) => {
|
|
5456
|
+
let a = () => r(!1);
|
|
5457
|
+
n.addEventListener("abort", a, { once: !0 });
|
|
5458
|
+
let o = () => n.removeEventListener("abort", a);
|
|
5459
|
+
Promise.resolve().then(() => n.aborted ? !1 : e(t)).then((e) => {
|
|
5460
|
+
o(), r(e);
|
|
5461
|
+
}, (e) => {
|
|
5462
|
+
o(), i(e);
|
|
5463
|
+
}), n.aborted && (o(), r(!1));
|
|
5464
|
+
});
|
|
5465
|
+
}
|
|
5466
|
+
//#endregion
|
|
5467
|
+
//#region src/components/VibeControlledReel.vue?vue&type=script&setup=true&lang.ts
|
|
5468
|
+
var Ri = [
|
|
5469
|
+
"aria-label",
|
|
5470
|
+
"aria-busy",
|
|
5471
|
+
"data-current-id",
|
|
5472
|
+
"data-pending"
|
|
5473
|
+
], zi = {
|
|
5474
|
+
key: 0,
|
|
5475
|
+
class: "vibe-controlled-reel-frame",
|
|
5476
|
+
"aria-hidden": "true",
|
|
5477
|
+
inert: ""
|
|
5478
|
+
}, Bi = ["src"], Vi = { class: "vibe-controlled-reel-frame vibe-controlled-reel-current" }, Hi = {
|
|
5479
|
+
key: 1,
|
|
5480
|
+
class: "vibe-controlled-reel-frame",
|
|
5481
|
+
"aria-hidden": "true",
|
|
5482
|
+
inert: ""
|
|
5483
|
+
}, Ui = ["src"], Wi = {
|
|
5484
|
+
class: "vibe-controlled-reel-status",
|
|
5485
|
+
"aria-live": "polite"
|
|
5486
|
+
}, Gi = /* @__PURE__ */ d({
|
|
5487
|
+
__name: "VibeControlledReel",
|
|
5488
|
+
props: {
|
|
5489
|
+
state: {},
|
|
5490
|
+
onNavigate: {},
|
|
5491
|
+
label: { default: "Media queue" }
|
|
5492
|
+
},
|
|
5493
|
+
emits: ["navigationError"],
|
|
5494
|
+
setup(e, { expose: t, emit: n }) {
|
|
5495
|
+
let i = e, a = n, l = E(null), u = E(!1), d = null, f = null, p = !1, h = !1, g = !1, _ = r(() => i.state.current && i.state.canPrevious ? 1 : 0), v = [
|
|
5496
|
+
() => i.state.revision,
|
|
5497
|
+
() => i.state.current?.id,
|
|
5498
|
+
() => i.state.canPrevious,
|
|
5499
|
+
() => i.state.canNext
|
|
5500
|
+
], S = r(() => {
|
|
5501
|
+
let { position: e, total: t } = i.state;
|
|
5502
|
+
return e === void 0 ? "" : `${e + 1}${t === void 0 ? "" : ` of ${t}`}`;
|
|
5503
|
+
});
|
|
5504
|
+
function C() {
|
|
5505
|
+
let e = l.value;
|
|
5506
|
+
e && (e.scrollTop = _.value * e.clientHeight);
|
|
5507
|
+
}
|
|
5508
|
+
function T() {
|
|
5509
|
+
h && (g = !0), d?.abort(), d = null, u.value = !1;
|
|
5510
|
+
}
|
|
5511
|
+
async function k(e, t) {
|
|
5512
|
+
let n = l.value, r = i.state;
|
|
5513
|
+
if (!n || p || u.value || !r.current || !(e === "next" ? r.canNext : r.canPrevious)) return;
|
|
5514
|
+
let o = new AbortController();
|
|
5515
|
+
d = o, u.value = !0;
|
|
5516
|
+
let s = {
|
|
5517
|
+
direction: e,
|
|
5518
|
+
snapshot: Object.freeze({
|
|
5519
|
+
...r,
|
|
5520
|
+
current: Object.freeze({ ...r.current }),
|
|
5521
|
+
previous: r.previous ? Object.freeze({ ...r.previous }) : r.previous,
|
|
5522
|
+
next: r.next ? Object.freeze({ ...r.next }) : r.next
|
|
5523
|
+
}),
|
|
5524
|
+
signal: o.signal
|
|
5525
|
+
};
|
|
5526
|
+
try {
|
|
5527
|
+
if (t && await bn(n, (_.value + (e === "next" ? 1 : -1)) * n.clientHeight, yn(), o.signal), o.signal.aborted) return;
|
|
5528
|
+
await Li(i.onNavigate, s);
|
|
5529
|
+
} catch (e) {
|
|
5530
|
+
o.signal.aborted || a("navigationError", e);
|
|
5531
|
+
} finally {
|
|
5532
|
+
d === o && (await bn(n, _.value * n.clientHeight, yn(), o.signal), d === o && (d = null, u.value = !1));
|
|
5533
|
+
}
|
|
5534
|
+
}
|
|
5535
|
+
function j(e) {
|
|
5536
|
+
return k(e, !0);
|
|
5537
|
+
}
|
|
5538
|
+
function M() {
|
|
5539
|
+
let e = l.value;
|
|
5540
|
+
if (g) {
|
|
5541
|
+
C();
|
|
5542
|
+
return;
|
|
5543
|
+
}
|
|
5544
|
+
if (!e || u.value || e.clientHeight <= 0) return;
|
|
5545
|
+
let t = xn(e.scrollTop, e.clientHeight, _.value + 1 + (i.state.canNext ? 1 : 0));
|
|
5546
|
+
t !== _.value && k(t > _.value ? "next" : "previous", !1);
|
|
5547
|
+
}
|
|
5548
|
+
function N() {
|
|
5549
|
+
h = !0, g = !1;
|
|
5550
|
+
}
|
|
5551
|
+
function P() {
|
|
5552
|
+
h = !1, g && C();
|
|
5553
|
+
}
|
|
5554
|
+
function F(e) {
|
|
5555
|
+
if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
|
|
5556
|
+
let t = e.target;
|
|
5557
|
+
if (t instanceof HTMLElement && (t.isContentEditable || [
|
|
5558
|
+
"INPUT",
|
|
5559
|
+
"SELECT",
|
|
5560
|
+
"TEXTAREA",
|
|
5561
|
+
"BUTTON",
|
|
5562
|
+
"A",
|
|
5563
|
+
"VIDEO",
|
|
5564
|
+
"AUDIO"
|
|
5565
|
+
].includes(t.tagName))) return;
|
|
5566
|
+
let n = e.key === "ArrowDown" || e.key === "PageDown" ? "next" : e.key === "ArrowUp" || e.key === "PageUp" ? "previous" : null;
|
|
5567
|
+
n && (e.preventDefault(), j(n));
|
|
5568
|
+
}
|
|
5569
|
+
return A(v, T, { flush: "sync" }), A(v, C, { flush: "post" }), b(() => {
|
|
5570
|
+
C(), typeof ResizeObserver < "u" && (f = new ResizeObserver(C), l.value && f.observe(l.value));
|
|
5571
|
+
}), y(() => {
|
|
5572
|
+
p = !0, d?.abort(), d = null, f?.disconnect();
|
|
5573
|
+
}), t({ navigate: j }), (t, n) => (x(), s("section", {
|
|
5574
|
+
ref_key: "viewport",
|
|
5575
|
+
ref: l,
|
|
5576
|
+
class: "vibe-controlled-reel",
|
|
5577
|
+
"aria-label": e.label,
|
|
5578
|
+
"aria-busy": u.value,
|
|
5579
|
+
"data-current-id": e.state.current?.id,
|
|
5580
|
+
"data-pending": u.value || void 0,
|
|
5581
|
+
tabindex: "0",
|
|
5582
|
+
onScrollPassive: M,
|
|
5583
|
+
onTouchstartPassive: N,
|
|
5584
|
+
onTouchendPassive: P,
|
|
5585
|
+
onTouchcancelPassive: P,
|
|
5586
|
+
onWheelPassive: n[0] ||= (e) => !O(h) && (m(g) ? g.value = !1 : g = !1),
|
|
5587
|
+
onKeydown: F
|
|
5588
|
+
}, [
|
|
5589
|
+
e.state.current && e.state.canPrevious ? (x(), s("div", zi, [w(t.$slots, "previous", {
|
|
5590
|
+
item: e.state.previous ?? null,
|
|
5591
|
+
pending: u.value
|
|
5592
|
+
}, () => [e.state.previous?.artwork ? (x(), s("img", {
|
|
5593
|
+
key: 0,
|
|
5594
|
+
src: e.state.previous.artwork,
|
|
5595
|
+
alt: "",
|
|
5596
|
+
draggable: "false"
|
|
5597
|
+
}, null, 8, Bi)) : o("", !0)])])) : o("", !0),
|
|
5598
|
+
c("div", Vi, [w(t.$slots, "default", {
|
|
5599
|
+
item: e.state.current,
|
|
5600
|
+
pending: u.value
|
|
5601
|
+
})]),
|
|
5602
|
+
e.state.current && e.state.canNext ? (x(), s("div", Hi, [w(t.$slots, "next", {
|
|
5603
|
+
item: e.state.next ?? null,
|
|
5604
|
+
pending: u.value
|
|
5605
|
+
}, () => [e.state.next?.artwork ? (x(), s("img", {
|
|
5606
|
+
key: 0,
|
|
5607
|
+
src: e.state.next.artwork,
|
|
5608
|
+
alt: "",
|
|
5609
|
+
draggable: "false"
|
|
5610
|
+
}, null, 8, Ui)) : o("", !0)])])) : o("", !0),
|
|
5611
|
+
c("span", Wi, D(S.value), 1)
|
|
5612
|
+
], 40, Ri));
|
|
5613
|
+
}
|
|
5614
|
+
});
|
|
5441
5615
|
//#endregion
|
|
5442
|
-
export {
|
|
5616
|
+
export { Gi as VibeControlledReel, Ii as createVibe };
|