@wyxos/vibe 5.4.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +1 -1
- package/lib/index.js +191 -177
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -146,7 +146,7 @@ var R = {
|
|
|
146
146
|
"show-load-more"
|
|
147
147
|
]));
|
|
148
148
|
}
|
|
149
|
-
}),
|
|
149
|
+
}), ee = ["role"], G = { class: "gallery-status" }, te = /* @__PURE__ */ d({
|
|
150
150
|
__name: "FeedStatus",
|
|
151
151
|
props: {
|
|
152
152
|
actions: {},
|
|
@@ -160,7 +160,7 @@ var R = {
|
|
|
160
160
|
return (n, u) => (b(), s("main", {
|
|
161
161
|
class: "gallery-shell",
|
|
162
162
|
role: r.state.error ? "alert" : r.state.isLoading ? "status" : void 0
|
|
163
|
-
}, [c("p",
|
|
163
|
+
}, [c("p", G, [r.state.error ? (b(), s(e, { key: 0 }, [l(" Unable to load media. ")], 64)) : r.state.isLoading ? (b(), s(e, { key: 1 }, [l(" Loading media… ")], 64)) : (b(), s(e, { key: 2 }, [l(" No media found. ")], 64))]), t.feedFooter ? (b(), a(W, {
|
|
164
164
|
key: 0,
|
|
165
165
|
actions: t.actions,
|
|
166
166
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -182,36 +182,36 @@ var R = {
|
|
|
182
182
|
"is-loading",
|
|
183
183
|
"load-more-locked",
|
|
184
184
|
"state"
|
|
185
|
-
])) : o("", !0)], 8,
|
|
185
|
+
])) : o("", !0)], 8, ee));
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
|
-
function
|
|
188
|
+
function K(e) {
|
|
189
189
|
return e.scrollHeight - e.scrollTop - e.clientHeight <= 240;
|
|
190
190
|
}
|
|
191
191
|
//#endregion
|
|
192
192
|
//#region src/core/masonry.ts
|
|
193
|
-
function
|
|
193
|
+
function ne(e) {
|
|
194
194
|
let t = e.preview.width ?? e.width, n = e.preview.height ?? e.height;
|
|
195
195
|
return !t || !n || t <= 0 || n <= 0 ? 1 : n / t;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function q(e) {
|
|
198
198
|
return e.reduce((t, n, r) => n < e[t] ? r : t, 0);
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function re(e) {
|
|
201
201
|
return Math.max(0, e.containerHeight) + Math.max(0, e.gap);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function ie(e, t) {
|
|
204
204
|
let n = Math.max(0, t.overscan), r = t.scrollTop - n, i = t.scrollTop + Math.max(0, t.viewportHeight) + n;
|
|
205
205
|
return e.reduce((e, t, n) => (t.y + t.height >= r && t.y <= i && e.push(n), e), []);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function ae(e, t, n) {
|
|
208
208
|
if (t <= 0 || e.length === 0) return {
|
|
209
209
|
columns: 0,
|
|
210
210
|
height: 0,
|
|
211
211
|
items: []
|
|
212
212
|
};
|
|
213
213
|
let r = Math.max(0, n.gap), i = Number.isFinite(n.additionalHeight) ? Math.max(0, n.additionalHeight ?? 0) : 0, a = Math.max(1, n.minColumnWidth), o = Math.max(1, Math.floor((t + r) / (a + r))), s = (t - r * (o - 1)) / o, c = Array.from({ length: o }, () => 0), l = e.map((e) => {
|
|
214
|
-
let t =
|
|
214
|
+
let t = q(c), n = s * ne(e) + i, a = {
|
|
215
215
|
x: t * (s + r),
|
|
216
216
|
y: c[t],
|
|
217
217
|
width: s,
|
|
@@ -225,11 +225,11 @@ function re(e, t, n) {
|
|
|
225
225
|
items: l
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function oe(e, t) {
|
|
229
229
|
let n = e?.overscan?.minimumPx ?? 800, r = e?.overscan?.viewportMultiplier ?? 1.5, i = Math.max(n, t * r), a = e?.overscan?.maximumPx;
|
|
230
230
|
return a === void 0 ? i : Math.min(i, a);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function J(e) {
|
|
233
233
|
let t = e?.overscan;
|
|
234
234
|
if (t) {
|
|
235
235
|
for (let [e, n] of [
|
|
@@ -242,10 +242,10 @@ function ae(e) {
|
|
|
242
242
|
}
|
|
243
243
|
//#endregion
|
|
244
244
|
//#region src/core/scrollbar.ts
|
|
245
|
-
function
|
|
245
|
+
function se(e, t, n) {
|
|
246
246
|
return Math.min(n, Math.max(t, e));
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Y({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize: r, viewportSize: i }) {
|
|
249
249
|
let a = Math.max(0, e), o = Math.max(0, r), s = Math.max(0, i), c = Math.max(0, a - s);
|
|
250
250
|
if (!(c > 0 && o > 0)) return {
|
|
251
251
|
maximumScrollPosition: c,
|
|
@@ -254,11 +254,11 @@ function se({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize:
|
|
|
254
254
|
thumbSize: o,
|
|
255
255
|
thumbTravel: 0
|
|
256
256
|
};
|
|
257
|
-
let l =
|
|
257
|
+
let l = se(s / a * o, Math.min(Math.max(0, t), o), o), u = Math.max(0, o - l);
|
|
258
258
|
return {
|
|
259
259
|
maximumScrollPosition: c,
|
|
260
260
|
scrollable: !0,
|
|
261
|
-
thumbOffset: u * (
|
|
261
|
+
thumbOffset: u * (se(n, 0, c) / c),
|
|
262
262
|
thumbSize: l,
|
|
263
263
|
thumbTravel: u
|
|
264
264
|
};
|
|
@@ -299,7 +299,7 @@ var ce = ["aria-hidden"], le = [
|
|
|
299
299
|
}
|
|
300
300
|
function j() {
|
|
301
301
|
let e = t.scrollElement, r = i.value;
|
|
302
|
-
return !e || !r ? n :
|
|
302
|
+
return !e || !r ? n : Y({
|
|
303
303
|
contentSize: e.scrollHeight,
|
|
304
304
|
minimumThumbSize: ue,
|
|
305
305
|
scrollPosition: e.scrollTop,
|
|
@@ -773,47 +773,47 @@ var We = [
|
|
|
773
773
|
function S(e = !1, t = "pointer") {
|
|
774
774
|
e && x("activate", t);
|
|
775
775
|
}
|
|
776
|
-
let C = r(() => M(l.item)), D = r(() => N(l.item, l.mediaIndex)), O = r(() => P(l.item, D.value)), F = r(() => l.mediaSource === "original" ? O.value.src : O.value.preview.src), I = r(() => l.mediaSource === "original" ? O.value.width : O.value.preview.width), L = r(() => l.mediaSource === "original" ? O.value.height : O.value.preview.height), R = w(null), z = w(0), B = w(0), V = w(l.mediaCard?.videoMuted ?? l.layout === "masonry"), H = w(!1), U = w(1), W = 1, { effectiveMuted:
|
|
776
|
+
let C = r(() => M(l.item)), D = r(() => N(l.item, l.mediaIndex)), O = r(() => P(l.item, D.value)), F = r(() => l.mediaSource === "original" ? O.value.src : O.value.preview.src), I = r(() => l.mediaSource === "original" ? O.value.width : O.value.preview.width), L = r(() => l.mediaSource === "original" ? O.value.height : O.value.preview.height), R = w(null), z = w(0), B = w(0), V = w(l.mediaCard?.videoMuted ?? l.layout === "masonry"), H = w(!1), U = w(1), W = 1, { effectiveMuted: ee, onPlaying: G, playbackAllowed: te } = Be({
|
|
777
777
|
active: () => l.active,
|
|
778
778
|
layout: () => l.layout,
|
|
779
779
|
videoElement: R,
|
|
780
780
|
videoIsMuted: V,
|
|
781
781
|
videoIsPlaying: H
|
|
782
|
-
}),
|
|
783
|
-
function
|
|
782
|
+
}), K = r(() => l.interactive && !!(l.cardHeader || l.cardFooter));
|
|
783
|
+
function ne(e) {
|
|
784
784
|
return e.detail === 0 ? "keyboard" : "pointer";
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function q(e, t) {
|
|
787
787
|
let n = C.value.length, r = (e + n) % n;
|
|
788
788
|
r !== D.value && (y.value = e < D.value ? "previous" : "next", x("mediaChange", r), t && t.detail > 0 && t.currentTarget?.blur());
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function re(e, t, n) {
|
|
791
791
|
return t === 1 ? e * 16 : t === 2 ? e * n : e;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function ie() {
|
|
794
794
|
f = 0, p = !1, d !== null && clearTimeout(d), d = null;
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
d !== null && clearTimeout(d), d = setTimeout(
|
|
796
|
+
function ae() {
|
|
797
|
+
d !== null && clearTimeout(d), d = setTimeout(ie, rt);
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function oe(e) {
|
|
800
800
|
if (C.value.length <= 1) return;
|
|
801
|
-
let t = e.currentTarget?.clientWidth || 1, n =
|
|
802
|
-
if (n === 0 || (e.preventDefault(),
|
|
801
|
+
let t = e.currentTarget?.clientWidth || 1, n = re(e.deltaX, e.deltaMode, t);
|
|
802
|
+
if (n === 0 || (e.preventDefault(), ae(), p) || (f += n, Math.abs(f) < it)) return;
|
|
803
803
|
let r = Math.sign(f);
|
|
804
|
-
f = 0, p = !0,
|
|
804
|
+
f = 0, p = !0, q(D.value + r);
|
|
805
805
|
}
|
|
806
|
-
function
|
|
806
|
+
function J(e) {
|
|
807
807
|
let t = e.touches[0];
|
|
808
808
|
l.layout !== "reel" || !t || (m = t.clientX, g = t.clientY);
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function se(e) {
|
|
811
811
|
let t = e.changedTouches[0];
|
|
812
812
|
if (m === null || g === null || !t) return;
|
|
813
813
|
let n = m - t.clientX, r = g - t.clientY;
|
|
814
|
-
m = null, g = null, !(Math.abs(n) <= Math.abs(r)) && (Math.abs(n) < nt ||
|
|
814
|
+
m = null, g = null, !(Math.abs(n) <= Math.abs(r)) && (Math.abs(n) < nt || q(D.value + Math.sign(n)));
|
|
815
815
|
}
|
|
816
|
-
let { imageLoading:
|
|
816
|
+
let { imageLoading: Y, mediaIsTimed: ce, videoPreload: le } = Ue({
|
|
817
817
|
fetchPriority: () => l.fetchPriority,
|
|
818
818
|
layout: () => l.layout,
|
|
819
819
|
mediaSource: () => F.value,
|
|
@@ -823,7 +823,7 @@ var We = [
|
|
|
823
823
|
l.layout === "reel" && (e.stopPropagation(), me());
|
|
824
824
|
}
|
|
825
825
|
async function me() {
|
|
826
|
-
if (!(!R.value || !
|
|
826
|
+
if (!(!R.value || !te.value)) {
|
|
827
827
|
if (H.value) {
|
|
828
828
|
R.value.pause();
|
|
829
829
|
return;
|
|
@@ -840,7 +840,7 @@ var We = [
|
|
|
840
840
|
}
|
|
841
841
|
function X(e) {
|
|
842
842
|
let t = e?.currentTarget ?? R.value;
|
|
843
|
-
t && (z.value = he(t.currentTime), B.value = he(t.duration),
|
|
843
|
+
t && (z.value = he(t.currentTime), B.value = he(t.duration), te.value && (V.value = t.muted), U.value = t.volume, t.volume > 0 && (W = t.volume));
|
|
844
844
|
}
|
|
845
845
|
function ge(e) {
|
|
846
846
|
X(e), x("ready", D.value);
|
|
@@ -863,7 +863,7 @@ var We = [
|
|
|
863
863
|
e && (e.muted && e.volume === 0 && (e.volume = W), e.muted = !e.muted, X());
|
|
864
864
|
}
|
|
865
865
|
return v(() => {
|
|
866
|
-
|
|
866
|
+
ie();
|
|
867
867
|
}), (r, i) => (b(), s("article", {
|
|
868
868
|
"data-post-id": e.item.postId,
|
|
869
869
|
"data-media-index": D.value,
|
|
@@ -877,10 +877,10 @@ var We = [
|
|
|
877
877
|
"aria-hidden": e.leaving || void 0,
|
|
878
878
|
"aria-busy": e.previewState === "loading",
|
|
879
879
|
inert: e.leaving || void 0,
|
|
880
|
-
role: e.interactive && !e.leaving && !
|
|
881
|
-
tabindex: e.interactive && !e.leaving && !
|
|
882
|
-
onClick: i[11] ||= (t) => S(e.interactive && !
|
|
883
|
-
onKeydown: [i[12] ||= A((t) => S(e.interactive && !
|
|
880
|
+
role: e.interactive && !e.leaving && !K.value ? "button" : void 0,
|
|
881
|
+
tabindex: e.interactive && !e.leaving && !K.value ? 0 : void 0,
|
|
882
|
+
onClick: i[11] ||= (t) => S(e.interactive && !K.value, ne(t)),
|
|
883
|
+
onKeydown: [i[12] ||= A((t) => S(e.interactive && !K.value, "keyboard"), ["enter"]), i[13] ||= A(j((t) => S(e.interactive && !K.value, "keyboard"), ["prevent"]), ["space"])]
|
|
884
884
|
}, [c("div", Ge, [
|
|
885
885
|
e.cardHeader ? (b(), a(je, {
|
|
886
886
|
key: 0,
|
|
@@ -908,9 +908,9 @@ var We = [
|
|
|
908
908
|
c("div", {
|
|
909
909
|
class: h(["media-card-media", { "media-card-media--carousel": e.layout === "reel" && C.value.length > 1 }]),
|
|
910
910
|
"data-media-direction": y.value,
|
|
911
|
-
onWheel:
|
|
912
|
-
onTouchstartPassive:
|
|
913
|
-
onTouchendPassive:
|
|
911
|
+
onWheel: oe,
|
|
912
|
+
onTouchstartPassive: J,
|
|
913
|
+
onTouchendPassive: se
|
|
914
914
|
}, [
|
|
915
915
|
u(n, { name: `media-slide-${y.value}` }, {
|
|
916
916
|
default: k(() => [(b(), s("div", {
|
|
@@ -934,16 +934,16 @@ var We = [
|
|
|
934
934
|
src: F.value,
|
|
935
935
|
width: I.value ?? void 0,
|
|
936
936
|
height: L.value ?? void 0,
|
|
937
|
-
autoplay: E(
|
|
937
|
+
autoplay: E(te),
|
|
938
938
|
loop: !e.advanceOnMediaEnd,
|
|
939
|
-
muted: E(
|
|
939
|
+
muted: E(ee),
|
|
940
940
|
playsinline: "",
|
|
941
941
|
preload: E(le),
|
|
942
942
|
onLoadedmetadata: ge,
|
|
943
943
|
onDurationchange: X,
|
|
944
944
|
onTimeupdate: X,
|
|
945
945
|
onVolumechange: X,
|
|
946
|
-
onPlaying: i[0] ||= (...e) => E(
|
|
946
|
+
onPlaying: i[0] ||= (...e) => E(G) && E(G)(...e),
|
|
947
947
|
onPause: i[1] ||= (e) => H.value = !1,
|
|
948
948
|
onEnded: _e,
|
|
949
949
|
onClick: pe,
|
|
@@ -957,7 +957,7 @@ var We = [
|
|
|
957
957
|
fetchpriority: e.fetchPriority,
|
|
958
958
|
alt: "",
|
|
959
959
|
decoding: "async",
|
|
960
|
-
loading: E(
|
|
960
|
+
loading: E(Y),
|
|
961
961
|
onLoad: i[3] ||= (e) => r.$emit("ready", D.value),
|
|
962
962
|
onError: i[4] ||= (e) => r.$emit("error", D.value)
|
|
963
963
|
}, null, 42, Qe))], 8, qe))]),
|
|
@@ -1002,21 +1002,21 @@ var We = [
|
|
|
1002
1002
|
type: "button",
|
|
1003
1003
|
class: "media-carousel-control media-carousel-control--previous",
|
|
1004
1004
|
"aria-label": `Previous media for post ${e.item.postId}`,
|
|
1005
|
-
onClick: i[5] ||= j((e) =>
|
|
1005
|
+
onClick: i[5] ||= j((e) => q(D.value - 1, e), ["stop"]),
|
|
1006
1006
|
onKeydown: i[6] ||= j(() => {}, ["stop"])
|
|
1007
1007
|
}, [u(E(Se), { size: 20 })], 40, $e), c("button", {
|
|
1008
1008
|
type: "button",
|
|
1009
1009
|
class: "media-carousel-control media-carousel-control--next",
|
|
1010
1010
|
"aria-label": `Next media for post ${e.item.postId}`,
|
|
1011
|
-
onClick: i[7] ||= j((e) =>
|
|
1011
|
+
onClick: i[7] ||= j((e) => q(D.value + 1, e), ["stop"]),
|
|
1012
1012
|
onKeydown: i[8] ||= j(() => {}, ["stop"])
|
|
1013
1013
|
}, [u(E(Ce), { size: 20 })], 40, et)], 2)) : o("", !0),
|
|
1014
|
-
|
|
1014
|
+
K.value ? (b(), s("button", {
|
|
1015
1015
|
key: 1,
|
|
1016
1016
|
class: "media-card-activator",
|
|
1017
1017
|
type: "button",
|
|
1018
1018
|
"aria-label": `Open post ${e.item.postId}`,
|
|
1019
|
-
onClick: i[9] ||= j((e) => r.$emit("activate",
|
|
1019
|
+
onClick: i[9] ||= j((e) => r.$emit("activate", ne(e)), ["stop"]),
|
|
1020
1020
|
onKeydown: i[10] ||= j(() => {}, ["stop"])
|
|
1021
1021
|
}, null, 40, tt)) : o("", !0)
|
|
1022
1022
|
], 42, Ke),
|
|
@@ -1084,14 +1084,14 @@ var We = [
|
|
|
1084
1084
|
"visible"
|
|
1085
1085
|
],
|
|
1086
1086
|
setup(t, { expose: n, emit: i }) {
|
|
1087
|
-
let l = t, d = i, f = w(null), p = `vibe-masonry-${D()}`, m = w(null), g = w(0), y = w(ut), x = w(0), C = w(0), T = w(0), k =
|
|
1087
|
+
let l = t, d = i, f = w(null), p = `vibe-masonry-${D()}`, m = w(null), g = w(0), y = w(ut), x = w(0), C = w(0), T = w(0), k = w([]), A = w([]), j = 0, M = null, N = null, P = null, I = null, L = r(() => ae(l.items, g.value, {
|
|
1088
1088
|
additionalHeight: (l.cardHeader?.height ?? 0) + (l.cardFooter?.height ?? 0),
|
|
1089
1089
|
gap: y.value,
|
|
1090
1090
|
minColumnWidth: lt
|
|
1091
|
-
})),
|
|
1092
|
-
let e =
|
|
1091
|
+
})), R = r(() => {
|
|
1092
|
+
let e = L.value;
|
|
1093
1093
|
if (l.leavingPostIds.size === 0) return e;
|
|
1094
|
-
let t = l.items.filter((e) => !l.leavingPostIds.has(e.postId)), n =
|
|
1094
|
+
let t = l.items.filter((e) => !l.leavingPostIds.has(e.postId)), n = ae(t, g.value, {
|
|
1095
1095
|
additionalHeight: (l.cardHeader?.height ?? 0) + (l.cardFooter?.height ?? 0),
|
|
1096
1096
|
gap: y.value,
|
|
1097
1097
|
minColumnWidth: lt
|
|
@@ -1100,40 +1100,47 @@ var We = [
|
|
|
1100
1100
|
...n,
|
|
1101
1101
|
items: l.items.map((t, n) => l.leavingPostIds.has(t.postId) ? e.items[n] : r.get(t.postId) ?? e.items[n])
|
|
1102
1102
|
};
|
|
1103
|
-
}),
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
return
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1103
|
+
}), z = r(() => Math.max(C.value, l.leavingPostIds.size === 0 ? R.value.height : L.value.height)), B = r(() => ({ height: `${z.value}px` })), V = r(() => !l.infiniteScroll || x.value > 0 && T.value + R.value.height <= x.value + 1), H = r(() => new Set(k.value)), U = r(() => A.value.flatMap((e) => {
|
|
1104
|
+
let t = l.items[e];
|
|
1105
|
+
return t ? [{
|
|
1106
|
+
fetchPriority: H.value.has(e) ? "high" : "low",
|
|
1107
|
+
index: e,
|
|
1108
|
+
item: t
|
|
1109
|
+
}] : [];
|
|
1110
|
+
}));
|
|
1111
|
+
function ee(e, t) {
|
|
1112
|
+
return [...new Set([...e, ...t])].sort((e, t) => e - t);
|
|
1113
|
+
}
|
|
1114
|
+
function G(e, t) {
|
|
1115
|
+
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
1116
|
+
}
|
|
1117
|
+
function te(e) {
|
|
1118
|
+
let t = {
|
|
1119
|
+
scrollTop: j - T.value,
|
|
1120
|
+
viewportHeight: x.value
|
|
1121
|
+
};
|
|
1122
|
+
return ee(ie(R.value.items, {
|
|
1121
1123
|
...t,
|
|
1122
1124
|
overscan: e
|
|
1123
|
-
}),
|
|
1125
|
+
}), l.leavingPostIds.size === 0 ? [] : ie(L.value.items, {
|
|
1124
1126
|
...t,
|
|
1125
1127
|
overscan: e
|
|
1128
|
+
}));
|
|
1129
|
+
}
|
|
1130
|
+
function ne() {
|
|
1131
|
+
let e = l.suspended ? [] : te(0), t = te(oe(l.masonry, x.value));
|
|
1132
|
+
G(k.value, e) || (k.value = e), G(A.value, t) || (A.value = t);
|
|
1133
|
+
}
|
|
1134
|
+
function q() {
|
|
1135
|
+
if (I !== null) return;
|
|
1136
|
+
I = -1;
|
|
1137
|
+
let e = requestAnimationFrame(() => {
|
|
1138
|
+
I = null, ne();
|
|
1126
1139
|
});
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
index: e,
|
|
1132
|
-
item: t
|
|
1133
|
-
}] : [];
|
|
1134
|
-
});
|
|
1135
|
-
}), z = /* @__PURE__ */ new Set();
|
|
1136
|
-
O(() => [...L.value].flatMap((e) => {
|
|
1140
|
+
I !== null && (I = e);
|
|
1141
|
+
}
|
|
1142
|
+
let J = /* @__PURE__ */ new Set();
|
|
1143
|
+
O(() => [...H.value].flatMap((e) => {
|
|
1137
1144
|
let t = l.items[e];
|
|
1138
1145
|
if (!t) return [];
|
|
1139
1146
|
let n = l.mediaIndices.get(t.postId) ?? 0, r = F(t.postId, n);
|
|
@@ -1145,17 +1152,17 @@ var We = [
|
|
|
1145
1152
|
}), (e) => {
|
|
1146
1153
|
let t = new Set(e.map(({ key: e }) => e));
|
|
1147
1154
|
e.forEach(({ key: e, mediaIndex: t, postId: n }) => {
|
|
1148
|
-
|
|
1149
|
-
}),
|
|
1155
|
+
J.has(e) || d("visible", n, t);
|
|
1156
|
+
}), J = t;
|
|
1150
1157
|
}, {
|
|
1151
1158
|
immediate: !0,
|
|
1152
1159
|
flush: "post"
|
|
1153
1160
|
});
|
|
1154
|
-
function
|
|
1155
|
-
let t =
|
|
1161
|
+
function se(e) {
|
|
1162
|
+
let t = R.value.items[e], n = l.items[e]?.postId;
|
|
1156
1163
|
if (!t) return {};
|
|
1157
|
-
let r = n !== void 0 && l.enteringPostIds.has(n), i = n !== void 0 && l.leavingPostIds.has(n), a = r || i ?
|
|
1158
|
-
containerHeight:
|
|
1164
|
+
let r = n !== void 0 && l.enteringPostIds.has(n), i = n !== void 0 && l.leavingPostIds.has(n), a = r || i ? re({
|
|
1165
|
+
containerHeight: Math.max(C.value, L.value.height),
|
|
1159
1166
|
gap: y.value
|
|
1160
1167
|
}) : 0, o = n === void 0 ? 0 : i ? l.removalDelays.get(n) ?? 0 : r ? l.entryDelays.get(n) ?? 0 : 0;
|
|
1161
1168
|
return {
|
|
@@ -1165,42 +1172,49 @@ var We = [
|
|
|
1165
1172
|
transform: `translate3d(${t.x}px, ${t.y + a}px, 0)`
|
|
1166
1173
|
};
|
|
1167
1174
|
}
|
|
1168
|
-
function
|
|
1175
|
+
function Y() {
|
|
1169
1176
|
let e = f.value;
|
|
1170
1177
|
if (!e) return;
|
|
1171
|
-
|
|
1172
|
-
let t =
|
|
1173
|
-
|
|
1178
|
+
j = e.scrollTop, x.value = e.clientHeight;
|
|
1179
|
+
let t = e.ownerDocument.defaultView?.getComputedStyle(e), n = (Number.parseFloat(t?.paddingTop ?? "") || 0) + (Number.parseFloat(t?.paddingBottom ?? "") || 0);
|
|
1180
|
+
C.value = Math.max(0, e.clientHeight - n);
|
|
1181
|
+
let r = m.value;
|
|
1182
|
+
r && (T.value = r.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop, ne());
|
|
1174
1183
|
}
|
|
1175
|
-
function
|
|
1184
|
+
function ce(e) {
|
|
1176
1185
|
let t = e.ownerDocument.documentElement.clientWidth;
|
|
1177
|
-
g.value = e.clientWidth, y.value = Math.min(dt, Math.max(ut, t * .0075)),
|
|
1186
|
+
g.value = e.clientWidth, y.value = Math.min(dt, Math.max(ut, t * .0075)), Y();
|
|
1178
1187
|
}
|
|
1179
|
-
function
|
|
1188
|
+
function le(e) {
|
|
1180
1189
|
let t = e.currentTarget;
|
|
1181
|
-
t && (
|
|
1190
|
+
t && (j = t.scrollTop, q(), !l.loadMoreLocked && l.infiniteScroll && K(t) && d("loadMore"));
|
|
1182
1191
|
}
|
|
1183
|
-
function
|
|
1192
|
+
function ue() {
|
|
1184
1193
|
let e = f.value;
|
|
1185
|
-
!l.loadMoreLocked && e &&
|
|
1194
|
+
!l.loadMoreLocked && e && K(e) && d("loadMore");
|
|
1186
1195
|
}
|
|
1187
|
-
function
|
|
1196
|
+
function de() {
|
|
1188
1197
|
return f.value;
|
|
1189
1198
|
}
|
|
1190
1199
|
return O(m, (e) => {
|
|
1191
|
-
|
|
1200
|
+
M?.disconnect(), M = null, P !== null && cancelAnimationFrame(P), e && (ce(e), !(typeof ResizeObserver > "u") && (M = new ResizeObserver(([t]) => {
|
|
1192
1201
|
let n = t?.contentRect.width ?? e.clientWidth;
|
|
1193
|
-
Math.abs(n - g.value) < .5 || (
|
|
1194
|
-
|
|
1202
|
+
Math.abs(n - g.value) < .5 || (P = requestAnimationFrame(() => {
|
|
1203
|
+
P = null, ce(e);
|
|
1195
1204
|
}));
|
|
1196
|
-
}),
|
|
1205
|
+
}), M.observe(e)));
|
|
1197
1206
|
}), O(f, (e) => {
|
|
1198
|
-
|
|
1199
|
-
}),
|
|
1200
|
-
|
|
1207
|
+
N?.disconnect(), N = null, e && (Y(), !(typeof ResizeObserver > "u") && (N = new ResizeObserver(Y), N.observe(e)));
|
|
1208
|
+
}), O([
|
|
1209
|
+
L,
|
|
1210
|
+
R,
|
|
1211
|
+
() => l.suspended,
|
|
1212
|
+
() => l.masonry
|
|
1213
|
+
], ne, { flush: "post" }), v(() => {
|
|
1214
|
+
M?.disconnect(), N?.disconnect(), P !== null && cancelAnimationFrame(P), I !== null && cancelAnimationFrame(I);
|
|
1201
1215
|
}), n({
|
|
1202
|
-
getScrollElement:
|
|
1203
|
-
loadIfNearBottom:
|
|
1216
|
+
getScrollElement: de,
|
|
1217
|
+
loadIfNearBottom: ue
|
|
1204
1218
|
}), (n, r) => (b(), s("div", ot, [
|
|
1205
1219
|
c("main", {
|
|
1206
1220
|
id: p,
|
|
@@ -1210,14 +1224,14 @@ var We = [
|
|
|
1210
1224
|
"data-layout-mode": "masonry",
|
|
1211
1225
|
"aria-hidden": t.suspended || void 0,
|
|
1212
1226
|
inert: t.suspended || void 0,
|
|
1213
|
-
onScrollPassive:
|
|
1227
|
+
onScrollPassive: le
|
|
1214
1228
|
}, [c("section", {
|
|
1215
1229
|
ref_key: "masonryElement",
|
|
1216
1230
|
ref: m,
|
|
1217
1231
|
class: h(["masonry", { "masonry--ready": g.value > 0 }]),
|
|
1218
|
-
style: _(
|
|
1232
|
+
style: _(B.value),
|
|
1219
1233
|
"aria-label": "Media gallery"
|
|
1220
|
-
}, [(b(!0), s(e, null, S(
|
|
1234
|
+
}, [(b(!0), s(e, null, S(U.value, ({ fetchPriority: e, item: n, index: r }) => (b(), a(at, {
|
|
1221
1235
|
key: n.postId,
|
|
1222
1236
|
class: "masonry-item",
|
|
1223
1237
|
entering: t.enteringPostIds.has(n.postId),
|
|
@@ -1228,7 +1242,7 @@ var We = [
|
|
|
1228
1242
|
"media-card": t.mediaCard,
|
|
1229
1243
|
index: r,
|
|
1230
1244
|
item: n,
|
|
1231
|
-
"item-style":
|
|
1245
|
+
"item-style": se(r),
|
|
1232
1246
|
interactive: "",
|
|
1233
1247
|
layout: "masonry",
|
|
1234
1248
|
"loaded-count": t.items.length,
|
|
@@ -1258,7 +1272,7 @@ var We = [
|
|
|
1258
1272
|
"onReady",
|
|
1259
1273
|
"onError"
|
|
1260
1274
|
]))), 128))], 6)], 42, st),
|
|
1261
|
-
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext &&
|
|
1275
|
+
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext && V.value || !t.hasNext && t.canRetryEnd ? (b(), s("div", ct, [u(W, {
|
|
1262
1276
|
actions: t.feedFooterActions,
|
|
1263
1277
|
"can-retry-end": t.canRetryEnd,
|
|
1264
1278
|
"feed-footer": t.feedFooter,
|
|
@@ -1266,7 +1280,7 @@ var We = [
|
|
|
1266
1280
|
"has-next": t.hasNext,
|
|
1267
1281
|
"is-loading": t.isLoadingMore,
|
|
1268
1282
|
"load-more-locked": t.loadMoreLocked,
|
|
1269
|
-
"show-load-more":
|
|
1283
|
+
"show-load-more": V.value,
|
|
1270
1284
|
state: t.state,
|
|
1271
1285
|
onLoadMore: r[0] ||= (e) => d("loadMore"),
|
|
1272
1286
|
onRetryEnd: r[1] ||= (e) => d("retryEnd")
|
|
@@ -1282,7 +1296,7 @@ var We = [
|
|
|
1282
1296
|
"state"
|
|
1283
1297
|
])])) : o("", !0),
|
|
1284
1298
|
u(pe, {
|
|
1285
|
-
"content-size":
|
|
1299
|
+
"content-size": R.value.height,
|
|
1286
1300
|
"controls-id": p,
|
|
1287
1301
|
"scroll-element": f.value,
|
|
1288
1302
|
suspended: t.suspended
|
|
@@ -1397,47 +1411,47 @@ var ht = ["aria-label"], gt = /* @__PURE__ */ d({
|
|
|
1397
1411
|
l.reelAutoAdvance.enabled,
|
|
1398
1412
|
l.reelAutoAdvance.includePostItems,
|
|
1399
1413
|
l.reelAutoAdvance.intervalMs
|
|
1400
|
-
].join(":")),
|
|
1414
|
+
].join(":")), ee = r(() => {
|
|
1401
1415
|
let e = R.value, t = !!(e && l.reelAutoAdvance.includePostItems && z.value < M(e).length - 1), n = l.reelAutoAdvance.intervalMs / 1e3;
|
|
1402
1416
|
return `Auto advance to the next ${t ? "post item" : "post"} in ${n}s`;
|
|
1403
|
-
}),
|
|
1404
|
-
function
|
|
1417
|
+
}), G = r(() => l.reelAutoAdvance.enabled && l.reelForward.status === "idle" && R.value !== void 0 && B.value !== "loading" && !H.value), te = r(() => !l.infiniteScroll || l.items.length <= 1), ne = r(() => l.reelForward.status === "loading" ? "Loading the next media…" : l.reelForward.status === "error" ? "Unable to load the next media." : "You reached the end of this feed.");
|
|
1418
|
+
function q(e) {
|
|
1405
1419
|
return { gridRow: `${e + 1}` };
|
|
1406
1420
|
}
|
|
1407
|
-
function
|
|
1421
|
+
function re(e) {
|
|
1408
1422
|
let t = D || e.clientHeight;
|
|
1409
1423
|
return t <= 0 || l.items.length === 0 ? 0 : Math.min(l.items.length - 1, Math.max(0, Math.round(e.scrollTop / t)));
|
|
1410
1424
|
}
|
|
1411
|
-
function
|
|
1425
|
+
function ie(e) {
|
|
1412
1426
|
let t = e.currentTarget;
|
|
1413
1427
|
if (!t) return;
|
|
1414
1428
|
let n = D || t.clientHeight, r = Math.max(0, l.items.length - 1) * n;
|
|
1415
|
-
x.value = l.items.length > 0 && t.scrollTop > r + 1, C.value || (g.value =
|
|
1429
|
+
x.value = l.items.length > 0 && t.scrollTop > r + 1, C.value || (g.value = re(t)), !l.loadMoreLocked && l.infiniteScroll && K(t) && u("loadMore");
|
|
1416
1430
|
}
|
|
1417
|
-
function
|
|
1431
|
+
function ae() {
|
|
1418
1432
|
let e = d.value;
|
|
1419
|
-
e && (x.value = !1,
|
|
1433
|
+
e && (x.value = !1, se(!0), D = e.clientHeight, e.scrollTop = g.value * D, A !== null && cancelAnimationFrame(A), A = requestAnimationFrame(() => {
|
|
1420
1434
|
e.scrollTop = g.value * e.clientHeight, D = e.clientHeight, A = null;
|
|
1421
|
-
}),
|
|
1435
|
+
}), oe());
|
|
1422
1436
|
}
|
|
1423
|
-
function
|
|
1437
|
+
function oe() {
|
|
1424
1438
|
j !== null && clearTimeout(j), j = setTimeout(() => {
|
|
1425
1439
|
j = null;
|
|
1426
1440
|
let e = d.value;
|
|
1427
|
-
e && (D = e.clientHeight, e.scrollTop = g.value * D),
|
|
1441
|
+
e && (D = e.clientHeight, e.scrollTop = g.value * D), se(!1);
|
|
1428
1442
|
}, 120);
|
|
1429
1443
|
}
|
|
1430
|
-
function
|
|
1431
|
-
|
|
1444
|
+
function J() {
|
|
1445
|
+
se(!0);
|
|
1432
1446
|
let e = d.value;
|
|
1433
|
-
e && (D = e.clientHeight, e.scrollTop = g.value * D),
|
|
1447
|
+
e && (D = e.clientHeight, e.scrollTop = g.value * D), oe();
|
|
1434
1448
|
}
|
|
1435
|
-
function
|
|
1449
|
+
function se(e) {
|
|
1436
1450
|
C.value = e, d.value?.toggleAttribute("data-resizing", e);
|
|
1437
1451
|
}
|
|
1438
|
-
function
|
|
1452
|
+
function Y() {
|
|
1439
1453
|
let e = d.value;
|
|
1440
|
-
!l.loadMoreLocked && e &&
|
|
1454
|
+
!l.loadMoreLocked && e && K(e) && u("loadMore");
|
|
1441
1455
|
}
|
|
1442
1456
|
function ce(e) {
|
|
1443
1457
|
let t = R.value;
|
|
@@ -1493,21 +1507,21 @@ var ht = ["aria-label"], gt = /* @__PURE__ */ d({
|
|
|
1493
1507
|
!l.reelAutoAdvance.enabled || e !== L.value || t !== z.value || !H.value || X();
|
|
1494
1508
|
}
|
|
1495
1509
|
return O(d, (e) => {
|
|
1496
|
-
k?.disconnect(), k = null, e && (D = e.clientHeight, !(typeof ResizeObserver > "u") && (k = new ResizeObserver(
|
|
1510
|
+
k?.disconnect(), k = null, e && (D = e.clientHeight, !(typeof ResizeObserver > "u") && (k = new ResizeObserver(ae), k.observe(e)));
|
|
1497
1511
|
}), O(() => l.items.length, async (e) => {
|
|
1498
1512
|
let t = l.initialPostId, n = t == null ? -1 : l.items.findIndex(({ postId: e }) => e === t);
|
|
1499
|
-
g.value = n >= 0 ? n : Math.min(g.value, Math.max(0, e - 1)), await m(),
|
|
1513
|
+
g.value = n >= 0 ? n : Math.min(g.value, Math.max(0, e - 1)), await m(), ae();
|
|
1500
1514
|
}), O(L, (e) => {
|
|
1501
1515
|
e !== void 0 && u("activeChange", e);
|
|
1502
1516
|
}, { immediate: !0 }), y(() => {
|
|
1503
|
-
window.addEventListener("resize",
|
|
1517
|
+
window.addEventListener("resize", J), window.addEventListener("orientationchange", J), p >= 0 && m(ae);
|
|
1504
1518
|
}), v(() => {
|
|
1505
|
-
window.removeEventListener("resize",
|
|
1519
|
+
window.removeEventListener("resize", J), window.removeEventListener("orientationchange", J), k?.disconnect(), A !== null && cancelAnimationFrame(A), j !== null && clearTimeout(j);
|
|
1506
1520
|
}), n({
|
|
1507
1521
|
activeIndex: g,
|
|
1508
1522
|
activePostId: L,
|
|
1509
1523
|
changeActiveMedia: ce,
|
|
1510
|
-
loadIfNearBottom:
|
|
1524
|
+
loadIfNearBottom: Y,
|
|
1511
1525
|
moveActivePost: le,
|
|
1512
1526
|
navigateToItem: ue,
|
|
1513
1527
|
transitionActiveMedia: he,
|
|
@@ -1547,7 +1561,7 @@ var ht = ["aria-label"], gt = /* @__PURE__ */ d({
|
|
|
1547
1561
|
class: "gallery-shell reel-feed",
|
|
1548
1562
|
"data-active-post-id": L.value,
|
|
1549
1563
|
"data-active-media-index": z.value,
|
|
1550
|
-
onScrollPassive:
|
|
1564
|
+
onScrollPassive: ie
|
|
1551
1565
|
}, [t.reelForward.status === "idle" ? (b(), s("section", {
|
|
1552
1566
|
key: 1,
|
|
1553
1567
|
class: "reel-track",
|
|
@@ -1562,7 +1576,7 @@ var ht = ["aria-label"], gt = /* @__PURE__ */ d({
|
|
|
1562
1576
|
"fetch-priority": e,
|
|
1563
1577
|
index: r,
|
|
1564
1578
|
item: n,
|
|
1565
|
-
"item-style":
|
|
1579
|
+
"item-style": q(r),
|
|
1566
1580
|
"media-card": t.mediaCard,
|
|
1567
1581
|
layout: "reel",
|
|
1568
1582
|
"loaded-count": t.items.length,
|
|
@@ -1599,7 +1613,7 @@ var ht = ["aria-label"], gt = /* @__PURE__ */ d({
|
|
|
1599
1613
|
class: "reel-forward-status",
|
|
1600
1614
|
role: t.reelForward.status === "error" ? "alert" : "status",
|
|
1601
1615
|
"data-status": t.reelForward.status
|
|
1602
|
-
}, [c("p", null, T(
|
|
1616
|
+
}, [c("p", null, T(ne.value), 1), t.reelForward.status === "error" || t.reelForward.status === "end" ? (b(), s("button", {
|
|
1603
1617
|
key: 0,
|
|
1604
1618
|
class: "reel-forward-retry",
|
|
1605
1619
|
type: "button",
|
|
@@ -1613,7 +1627,7 @@ var ht = ["aria-label"], gt = /* @__PURE__ */ d({
|
|
|
1613
1627
|
"has-next": t.hasNext,
|
|
1614
1628
|
"is-loading": t.isLoadingMore,
|
|
1615
1629
|
"load-more-locked": t.loadMoreLocked,
|
|
1616
|
-
"show-load-more":
|
|
1630
|
+
"show-load-more": te.value,
|
|
1617
1631
|
state: t.state,
|
|
1618
1632
|
onLoadMore: r[1] ||= (e) => u("loadMore"),
|
|
1619
1633
|
onRetryEnd: r[2] ||= (e) => u("retryEnd")
|
|
@@ -1655,10 +1669,10 @@ var ht = ["aria-label"], gt = /* @__PURE__ */ d({
|
|
|
1655
1669
|
"style",
|
|
1656
1670
|
"total"
|
|
1657
1671
|
])) : o("", !0),
|
|
1658
|
-
|
|
1672
|
+
G.value ? (b(), a(gt, {
|
|
1659
1673
|
key: U.value,
|
|
1660
1674
|
"duration-ms": t.reelAutoAdvance.intervalMs,
|
|
1661
|
-
label:
|
|
1675
|
+
label: ee.value,
|
|
1662
1676
|
onComplete: X
|
|
1663
1677
|
}, null, 8, ["duration-ms", "label"])) : o("", !0)
|
|
1664
1678
|
], 2));
|
|
@@ -2040,52 +2054,52 @@ var Ft = 35, It = 420, Lt = /* @__PURE__ */ d({
|
|
|
2040
2054
|
ready: (e) => d("mediaReady", e),
|
|
2041
2055
|
reelChange: (e) => d("reelMediaChange", e),
|
|
2042
2056
|
visible: (e) => d("mediaVisible", e)
|
|
2043
|
-
}), U = new Set(l.state.items.map((e) => e.postId)), W = null,
|
|
2044
|
-
function
|
|
2057
|
+
}), U = new Set(l.state.items.map((e) => e.postId)), W = null, ee = null, G = !1;
|
|
2058
|
+
function K() {
|
|
2045
2059
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2046
2060
|
}
|
|
2047
|
-
function
|
|
2061
|
+
function ne() {
|
|
2048
2062
|
W !== null && cancelAnimationFrame(W), W = requestAnimationFrame(() => {
|
|
2049
2063
|
W = requestAnimationFrame(() => {
|
|
2050
2064
|
W = null, S.value = /* @__PURE__ */ new Set();
|
|
2051
2065
|
});
|
|
2052
2066
|
});
|
|
2053
2067
|
}
|
|
2054
|
-
function
|
|
2068
|
+
function q(e, t) {
|
|
2055
2069
|
let n = l.state.items.find((t) => t.postId === e);
|
|
2056
2070
|
if (!n) return;
|
|
2057
2071
|
let r = N(n, t);
|
|
2058
2072
|
(l.state.mediaIndices.get(e) ?? 0) !== r && (l.state.mediaIndices = new Map(l.state.mediaIndices).set(e, r));
|
|
2059
2073
|
}
|
|
2060
|
-
async function
|
|
2074
|
+
async function re() {
|
|
2061
2075
|
await m(), (l.state.layout === "reel" || l.state.reelOrigin === "masonry" ? p.value : f.value)?.loadIfNearBottom();
|
|
2062
2076
|
}
|
|
2063
|
-
function
|
|
2077
|
+
function ie(e) {
|
|
2064
2078
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.changeActiveMedia?.(e) ?? !1;
|
|
2065
2079
|
}
|
|
2066
|
-
function
|
|
2080
|
+
function ae(e) {
|
|
2067
2081
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.moveActivePost?.(e) ?? !1;
|
|
2068
2082
|
}
|
|
2069
|
-
function
|
|
2083
|
+
function oe(e) {
|
|
2070
2084
|
if (!(l.state.layout === "reel" || l.state.reelOrigin === "masonry") || l.state.isLoading) return "reel-inactive";
|
|
2071
2085
|
let t = l.state.items.find((t) => t.postId === e.postId);
|
|
2072
2086
|
if (!t) return "not-found";
|
|
2073
2087
|
let n = M(t).findIndex((t) => t.mediaId === e.mediaId);
|
|
2074
2088
|
return n < 0 ? "not-found" : p.value?.navigateToItem?.(e.postId, n) ? "navigated" : "reel-inactive";
|
|
2075
2089
|
}
|
|
2076
|
-
function
|
|
2090
|
+
function J() {
|
|
2077
2091
|
return l.state.layout !== "masonry" || l.state.reelOrigin === "masonry" ? null : f.value?.getScrollElement?.() ?? null;
|
|
2078
2092
|
}
|
|
2079
|
-
function
|
|
2080
|
-
|
|
2093
|
+
function se(e, t) {
|
|
2094
|
+
ee = e, G = t === "keyboard", y.value = ue(e), d("openReel", e), m(() => h.value?.focus());
|
|
2081
2095
|
}
|
|
2082
|
-
function
|
|
2096
|
+
function Y(e) {
|
|
2083
2097
|
let t = g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [];
|
|
2084
2098
|
return Array.from(t).find((t) => t.dataset.postId === String(e)) ?? null;
|
|
2085
2099
|
}
|
|
2086
2100
|
function ce(e) {
|
|
2087
|
-
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null ||
|
|
2088
|
-
let t = [...new Set(e)], n = t.filter(
|
|
2101
|
+
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null || K()) return 0;
|
|
2102
|
+
let t = [...new Set(e)], n = t.filter(Y);
|
|
2089
2103
|
if (n.length === 0) return 0;
|
|
2090
2104
|
let r = new Map(D.value);
|
|
2091
2105
|
return n.forEach((e, t) => {
|
|
@@ -2093,13 +2107,13 @@ var Ft = 35, It = 420, Lt = /* @__PURE__ */ d({
|
|
|
2093
2107
|
}), S.value = new Set([...S.value].filter((e) => !n.includes(e))), T.value = new Set([...T.value, ...t]), D.value = r, It + (n.length - 1) * Ft;
|
|
2094
2108
|
}
|
|
2095
2109
|
function le(e, t) {
|
|
2096
|
-
let n =
|
|
2110
|
+
let n = Y(e), r = n?.querySelector(".media-card-activator") ?? n;
|
|
2097
2111
|
r && (r.classList.toggle("media-card-focus-silent", !t), t || r.addEventListener("blur", () => {
|
|
2098
2112
|
r.classList.remove("media-card-focus-silent");
|
|
2099
2113
|
}, { once: !0 }), r?.focus({ preventScroll: !0 }));
|
|
2100
2114
|
}
|
|
2101
2115
|
function ue(e) {
|
|
2102
|
-
let t = g.value, n =
|
|
2116
|
+
let t = g.value, n = Y(e);
|
|
2103
2117
|
if (t === null || n === null) return {};
|
|
2104
2118
|
let r = t.getBoundingClientRect(), i = n.getBoundingClientRect();
|
|
2105
2119
|
return {
|
|
@@ -2110,11 +2124,11 @@ var Ft = 35, It = 420, Lt = /* @__PURE__ */ d({
|
|
|
2110
2124
|
};
|
|
2111
2125
|
}
|
|
2112
2126
|
function de() {
|
|
2113
|
-
l.state.reelOrigin === "masonry" && (
|
|
2127
|
+
l.state.reelOrigin === "masonry" && (ee ??= l.state.activeReelPostId, x.value = !0, d("closeReel"));
|
|
2114
2128
|
}
|
|
2115
2129
|
function fe() {
|
|
2116
|
-
let e =
|
|
2117
|
-
x.value = !1,
|
|
2130
|
+
let e = ee, t = G;
|
|
2131
|
+
x.value = !1, ee = null, G = !1, y.value = {}, m(() => {
|
|
2118
2132
|
e !== null && le(e, t);
|
|
2119
2133
|
});
|
|
2120
2134
|
}
|
|
@@ -2127,22 +2141,22 @@ var Ft = 35, It = 420, Lt = /* @__PURE__ */ d({
|
|
|
2127
2141
|
state: l.state
|
|
2128
2142
|
}), O(() => l.state.items.map((e) => e.postId), (e) => {
|
|
2129
2143
|
let t = e.filter((e) => !U.has(e)), n = new Set(e);
|
|
2130
|
-
if (U = new Set(e), T.value = new Set([...T.value].filter((e) => n.has(e))), D.value = new Map([...D.value].filter(([e]) => n.has(e))), t.length === 0 ||
|
|
2144
|
+
if (U = new Set(e), T.value = new Set([...T.value].filter((e) => n.has(e))), D.value = new Map([...D.value].filter(([e]) => n.has(e))), t.length === 0 || K()) return;
|
|
2131
2145
|
let r = /* @__PURE__ */ new Map();
|
|
2132
2146
|
e.forEach((e) => {
|
|
2133
2147
|
let t = C.value.get(e);
|
|
2134
2148
|
t !== void 0 && r.set(e, t);
|
|
2135
2149
|
}), t.forEach((e, t) => {
|
|
2136
2150
|
r.set(e, t * Ft);
|
|
2137
|
-
}), C.value = r, S.value = new Set([...S.value, ...t]),
|
|
2151
|
+
}), C.value = r, S.value = new Set([...S.value, ...t]), ne();
|
|
2138
2152
|
}, { flush: "sync" }), v(() => {
|
|
2139
2153
|
W !== null && cancelAnimationFrame(W);
|
|
2140
2154
|
}), i({
|
|
2141
|
-
changeActiveReelMedia:
|
|
2142
|
-
getAutoScrollElement:
|
|
2143
|
-
loadIfNearBottom:
|
|
2144
|
-
moveActiveReelPost:
|
|
2145
|
-
navigateToReelItem:
|
|
2155
|
+
changeActiveReelMedia: ie,
|
|
2156
|
+
getAutoScrollElement: J,
|
|
2157
|
+
loadIfNearBottom: re,
|
|
2158
|
+
moveActiveReelPost: ae,
|
|
2159
|
+
navigateToReelItem: oe,
|
|
2146
2160
|
startItemRemoval: ce,
|
|
2147
2161
|
transitionActiveReelMedia: (e) => p.value?.transitionActiveMedia?.(e) ?? Promise.resolve(!1),
|
|
2148
2162
|
transitionActiveReelPost: (e) => p.value?.transitionActivePost?.(e) ?? Promise.resolve(!1)
|
|
@@ -2184,11 +2198,11 @@ var Ft = 35, It = 420, Lt = /* @__PURE__ */ d({
|
|
|
2184
2198
|
onCloseInfoSheet: i[1] ||= (e) => d("reelInfoSheetChange", !1),
|
|
2185
2199
|
onError: E(R),
|
|
2186
2200
|
onLoadMore: i[2] ||= (e) => d("loadMore"),
|
|
2187
|
-
onMediaChange:
|
|
2201
|
+
onMediaChange: q,
|
|
2188
2202
|
onReady: E(z),
|
|
2189
2203
|
onRetryEnd: i[3] ||= (e) => d("retryEnd"),
|
|
2190
2204
|
onRetryForward: i[4] ||= (e) => d("retryForward")
|
|
2191
|
-
}, 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-forward.state.total.onError.onReady".split("."))) : t.state.error || t.state.isLoading || t.state.items.length === 0 && t.state.reelForward.status === "idle" ? (b(), a(
|
|
2205
|
+
}, 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-forward.state.total.onError.onReady".split("."))) : t.state.error || t.state.isLoading || t.state.items.length === 0 && t.state.reelForward.status === "idle" ? (b(), a(te, {
|
|
2192
2206
|
key: 1,
|
|
2193
2207
|
actions: t.feedFooterActions,
|
|
2194
2208
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -2226,10 +2240,10 @@ var Ft = 35, It = 420, Lt = /* @__PURE__ */ d({
|
|
|
2226
2240
|
suspended: t.state.reelOrigin === "masonry" || x.value,
|
|
2227
2241
|
state: j.value,
|
|
2228
2242
|
total: t.state.total,
|
|
2229
|
-
onActivate:
|
|
2243
|
+
onActivate: se,
|
|
2230
2244
|
onError: E(F),
|
|
2231
2245
|
onLoadMore: i[7] ||= (e) => d("loadMore"),
|
|
2232
|
-
onMediaChange:
|
|
2246
|
+
onMediaChange: q,
|
|
2233
2247
|
onReady: E(I),
|
|
2234
2248
|
onRetryEnd: i[8] ||= (e) => d("retryEnd"),
|
|
2235
2249
|
onVisible: E(P)
|
|
@@ -2306,7 +2320,7 @@ var Ft = 35, It = 420, Lt = /* @__PURE__ */ d({
|
|
|
2306
2320
|
onCloseInfoSheet: i[10] ||= (e) => d("reelInfoSheetChange", !1),
|
|
2307
2321
|
onError: E(R),
|
|
2308
2322
|
onLoadMore: i[11] ||= (e) => d("loadMore"),
|
|
2309
|
-
onMediaChange:
|
|
2323
|
+
onMediaChange: q,
|
|
2310
2324
|
onReady: E(z),
|
|
2311
2325
|
onRetryEnd: i[12] ||= (e) => d("retryEnd"),
|
|
2312
2326
|
onRetryForward: i[13] ||= (e) => d("retryForward")
|
|
@@ -3157,7 +3171,7 @@ function Bn(e, t) {
|
|
|
3157
3171
|
}
|
|
3158
3172
|
}
|
|
3159
3173
|
function Vn(e) {
|
|
3160
|
-
if (cn(e.autoScroll), zn("cardHeader", e.cardHeader), zn("cardFooter", e.cardFooter), Bn("header", e.mediaCard?.header), Bn("footer", e.mediaCard?.footer), Zt(e.autofill), yn(e.fill),
|
|
3174
|
+
if (cn(e.autoScroll), zn("cardHeader", e.cardHeader), zn("cardFooter", e.cardFooter), Bn("header", e.mediaCard?.header), Bn("footer", e.mediaCard?.footer), Zt(e.autofill), yn(e.fill), J(e.masonry), Nn(e.reelAutoAdvance), e.removalReconciliation) {
|
|
3161
3175
|
if (!Number.isInteger(e.removalReconciliation.pageSize) || e.removalReconciliation.pageSize <= 0) throw TypeError("Vibe removalReconciliation pageSize must be a positive integer.");
|
|
3162
3176
|
let t = e.removalReconciliation.maxReplayPages ?? 5;
|
|
3163
3177
|
if (!Number.isInteger(t) || t <= 0) throw TypeError("Vibe removalReconciliation maxReplayPages must be a positive integer.");
|