@wyxos/vibe 3.1.6 → 3.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/ListCard.vue.d.ts +1 -1
- package/lib/components/viewer-core/useFullscreenPreloadController.d.ts +15 -0
- package/lib/components/viewer-core/useFullscreenSurfaceMedia.d.ts +6 -0
- package/lib/components/viewer-core/useMedia.d.ts +1 -0
- package/lib/components/viewer-core/useViewer.d.ts +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +1431 -1226
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d,
|
|
1
|
+
import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d, getCurrentScope as f, guardReactiveProps as p, h as m, isVNode as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, onScopeDispose as C, openBlock as w, reactive as T, readonly as E, ref as D, renderList as O, renderSlot as k, resolveDynamicComponent as A, toDisplayString as j, toRef as M, unref as N, useAttrs as P, useSlots as F, vShow as I, watch as L, watchEffect as R, withCtx as z, withDirectives as B, withModifiers as ee } from "vue";
|
|
2
2
|
//#region node_modules/lucide-vue-next/dist/esm/shared/src/utils/hasA11yProp.js
|
|
3
|
-
var
|
|
3
|
+
var te = (e) => {
|
|
4
4
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
5
5
|
return !1;
|
|
6
|
-
},
|
|
7
|
-
let t =
|
|
6
|
+
}, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), U = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), W = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), ne = (e) => {
|
|
7
|
+
let t = W(e);
|
|
8
8
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
9
9
|
}, G = {
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -16,27 +16,27 @@ var B = (e) => {
|
|
|
16
16
|
"stroke-width": 2,
|
|
17
17
|
"stroke-linecap": "round",
|
|
18
18
|
"stroke-linejoin": "round"
|
|
19
|
-
},
|
|
19
|
+
}, K = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = G.width, color: s = G.stroke, ...c }, { slots: l }) => m("svg", {
|
|
20
20
|
...G,
|
|
21
21
|
...c,
|
|
22
22
|
width: o,
|
|
23
23
|
height: o,
|
|
24
24
|
stroke: s,
|
|
25
|
-
"stroke-width":
|
|
26
|
-
class:
|
|
27
|
-
...!l.default && !
|
|
28
|
-
}, [...t.map((e) =>
|
|
25
|
+
"stroke-width": V(n) || V(r) || n === !0 || r === !0 ? Number(i || a || G["stroke-width"]) * 24 / Number(o) : i || a || G["stroke-width"],
|
|
26
|
+
class: H("lucide", c.class, ...e ? [`lucide-${U(ne(e))}-icon`, `lucide-${U(e)}`] : ["lucide-icon"]),
|
|
27
|
+
...!l.default && !te(c) && { "aria-hidden": "true" }
|
|
28
|
+
}, [...t.map((e) => m(...e)), ...l.default ? [l.default()] : []]), q = (e, t) => (n, { slots: r, attrs: i }) => m(K, {
|
|
29
29
|
...i,
|
|
30
30
|
...n,
|
|
31
31
|
iconNode: t,
|
|
32
32
|
name: e
|
|
33
|
-
}, r),
|
|
33
|
+
}, r), re = q("arrow-left", [["path", {
|
|
34
34
|
d: "m12 19-7-7 7-7",
|
|
35
35
|
key: "1l729n"
|
|
36
36
|
}], ["path", {
|
|
37
37
|
d: "M19 12H5",
|
|
38
38
|
key: "x3x0zl"
|
|
39
|
-
}]]), J =
|
|
39
|
+
}]]), J = q("audio-lines", [
|
|
40
40
|
["path", {
|
|
41
41
|
d: "M2 10v3",
|
|
42
42
|
key: "1fnikh"
|
|
@@ -61,7 +61,7 @@ var B = (e) => {
|
|
|
61
61
|
d: "M22 10v3",
|
|
62
62
|
key: "154ddg"
|
|
63
63
|
}]
|
|
64
|
-
]),
|
|
64
|
+
]), Y = q("clapperboard", [
|
|
65
65
|
["path", {
|
|
66
66
|
d: "m12.296 3.464 3.02 3.956",
|
|
67
67
|
key: "qash78"
|
|
@@ -78,13 +78,13 @@ var B = (e) => {
|
|
|
78
78
|
d: "m6.18 5.276 3.1 3.899",
|
|
79
79
|
key: "zjj9t3"
|
|
80
80
|
}]
|
|
81
|
-
]),
|
|
81
|
+
]), ie = q("file", [["path", {
|
|
82
82
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
83
83
|
key: "1oefj6"
|
|
84
84
|
}], ["path", {
|
|
85
85
|
d: "M14 2v5a1 1 0 0 0 1 1h5",
|
|
86
86
|
key: "wfsgrz"
|
|
87
|
-
}]]),
|
|
87
|
+
}]]), ae = q("image-plus", [
|
|
88
88
|
["path", {
|
|
89
89
|
d: "M16 5h6",
|
|
90
90
|
key: "1vod17"
|
|
@@ -107,10 +107,10 @@ var B = (e) => {
|
|
|
107
107
|
r: "2",
|
|
108
108
|
key: "af1f0g"
|
|
109
109
|
}]
|
|
110
|
-
]),
|
|
110
|
+
]), oe = q("loader-circle", [["path", {
|
|
111
111
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
112
112
|
key: "13zald"
|
|
113
|
-
}]]),
|
|
113
|
+
}]]), se = q("pause", [["rect", {
|
|
114
114
|
x: "14",
|
|
115
115
|
y: "3",
|
|
116
116
|
width: "5",
|
|
@@ -124,10 +124,10 @@ var B = (e) => {
|
|
|
124
124
|
height: "18",
|
|
125
125
|
rx: "1",
|
|
126
126
|
key: "1wsw3u"
|
|
127
|
-
}]]),
|
|
127
|
+
}]]), ce = q("play", [["path", {
|
|
128
128
|
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",
|
|
129
129
|
key: "10ikf1"
|
|
130
|
-
}]]),
|
|
130
|
+
}]]), le = q("triangle-alert", [
|
|
131
131
|
["path", {
|
|
132
132
|
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
133
133
|
key: "wmoenq"
|
|
@@ -140,13 +140,13 @@ var B = (e) => {
|
|
|
140
140
|
d: "M12 17h.01",
|
|
141
141
|
key: "p32p05"
|
|
142
142
|
}]
|
|
143
|
-
]),
|
|
143
|
+
]), X = q("volume-1", [["path", {
|
|
144
144
|
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",
|
|
145
145
|
key: "uqj9uw"
|
|
146
146
|
}], ["path", {
|
|
147
147
|
d: "M16 9a5 5 0 0 1 0 6",
|
|
148
148
|
key: "1q6k2b"
|
|
149
|
-
}]]),
|
|
149
|
+
}]]), ue = q("volume-2", [
|
|
150
150
|
["path", {
|
|
151
151
|
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",
|
|
152
152
|
key: "uqj9uw"
|
|
@@ -159,7 +159,7 @@ var B = (e) => {
|
|
|
159
159
|
d: "M19.364 18.364a9 9 0 0 0 0-12.728",
|
|
160
160
|
key: "ijwkga"
|
|
161
161
|
}]
|
|
162
|
-
]),
|
|
162
|
+
]), de = q("volume-x", [
|
|
163
163
|
["path", {
|
|
164
164
|
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",
|
|
165
165
|
key: "uqj9uw"
|
|
@@ -179,13 +179,13 @@ var B = (e) => {
|
|
|
179
179
|
key: "5ykzw1"
|
|
180
180
|
}]
|
|
181
181
|
]);
|
|
182
|
-
function
|
|
183
|
-
return
|
|
182
|
+
function fe(e, t = 150) {
|
|
183
|
+
return pe(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
return
|
|
185
|
+
function Z(e, t = 150) {
|
|
186
|
+
return pe(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function pe(e, t, n) {
|
|
189
189
|
let r = [], i = /* @__PURE__ */ new Set(), a = null;
|
|
190
190
|
function o(e) {
|
|
191
191
|
let o = t(e);
|
|
@@ -209,41 +209,41 @@ function de(e, t, n) {
|
|
|
209
209
|
}
|
|
210
210
|
//#endregion
|
|
211
211
|
//#region src/components/viewer-core/dom.ts
|
|
212
|
-
function
|
|
212
|
+
function me(e) {
|
|
213
213
|
return e instanceof HTMLElement && [
|
|
214
214
|
"INPUT",
|
|
215
215
|
"TEXTAREA",
|
|
216
216
|
"SELECT"
|
|
217
217
|
].includes(e.tagName);
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function he(e) {
|
|
220
220
|
return e instanceof HTMLElement && !!e.closest("[data-swipe-lock], input, textarea, select, a");
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function ge(e) {
|
|
223
223
|
return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function _e(e) {
|
|
226
226
|
return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function ve(e) {
|
|
229
229
|
return e ?? "__vibe_initial_cursor__";
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function Q(e, t, n) {
|
|
232
232
|
return Math.min(Math.max(e, t), n);
|
|
233
233
|
}
|
|
234
234
|
//#endregion
|
|
235
235
|
//#region src/components/viewer-core/removalState.ts
|
|
236
|
-
function
|
|
237
|
-
let e =
|
|
236
|
+
function ye() {
|
|
237
|
+
let e = D(/* @__PURE__ */ new Set()), t = D([]);
|
|
238
238
|
function n(n) {
|
|
239
|
-
let r =
|
|
239
|
+
let r = be(n).filter((t) => !e.value.has(t));
|
|
240
240
|
if (!r.length) return { ids: [] };
|
|
241
241
|
let i = new Set(e.value);
|
|
242
242
|
for (let e of r) i.add(e);
|
|
243
243
|
return e.value = i, t.value = [...t.value, r], { ids: r };
|
|
244
244
|
}
|
|
245
245
|
function r(t) {
|
|
246
|
-
let n =
|
|
246
|
+
let n = be(t).filter((t) => e.value.has(t));
|
|
247
247
|
if (!n.length) return { ids: [] };
|
|
248
248
|
let r = new Set(e.value);
|
|
249
249
|
for (let e of n) r.delete(e);
|
|
@@ -274,18 +274,18 @@ function _e() {
|
|
|
274
274
|
undo: i
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function be(e) {
|
|
278
278
|
let t = Array.isArray(e) ? e : [e];
|
|
279
279
|
return Array.from(new Set(t.filter((e) => typeof e == "string" && e.length > 0)));
|
|
280
280
|
}
|
|
281
281
|
//#endregion
|
|
282
282
|
//#region src/components/viewer-core/itemIdentity.ts
|
|
283
|
-
var
|
|
283
|
+
var xe = "__vibeOccurrenceKey";
|
|
284
284
|
function $(e) {
|
|
285
|
-
let t = e[
|
|
285
|
+
let t = e[xe];
|
|
286
286
|
return typeof t == "string" && t.length > 0 ? t : e.id;
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function Se(e, t, n) {
|
|
289
289
|
let r = /* @__PURE__ */ new Map(), i = [], a = n;
|
|
290
290
|
for (let e of t) {
|
|
291
291
|
let t = r.get(e.id), n = $(e);
|
|
@@ -293,49 +293,49 @@ function be(e, t, n) {
|
|
|
293
293
|
}
|
|
294
294
|
for (let t of e) {
|
|
295
295
|
let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
|
|
296
|
-
i.push(
|
|
296
|
+
i.push(Ce(t, e));
|
|
297
297
|
}
|
|
298
298
|
return {
|
|
299
299
|
items: i,
|
|
300
300
|
nextSequence: a
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Ce(e, t) {
|
|
304
304
|
return $(e) === t ? e : {
|
|
305
305
|
...e,
|
|
306
|
-
[
|
|
306
|
+
[xe]: t
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
//#endregion
|
|
310
310
|
//#region src/components/viewer-core/autoBuckets.ts
|
|
311
|
-
function
|
|
311
|
+
function we(e) {
|
|
312
312
|
return e.flatMap((e) => e.items);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function Te(e, t) {
|
|
315
315
|
return t.size ? e.filter((e) => !t.has(e.id)) : e;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
return
|
|
317
|
+
function Ee(e, t) {
|
|
318
|
+
return Te(e.items, t);
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
return
|
|
320
|
+
function De(e, t) {
|
|
321
|
+
return Ee(e, t).length;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function Oe(e, t, n) {
|
|
324
324
|
if (n < 0) return null;
|
|
325
325
|
let r = 0;
|
|
326
326
|
for (let i of e) {
|
|
327
|
-
let e =
|
|
327
|
+
let e = Ee(i, t), a = r + e.length;
|
|
328
328
|
if (n < a) return i.cursor;
|
|
329
329
|
r = a;
|
|
330
330
|
}
|
|
331
331
|
return null;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function ke(e, t, n) {
|
|
334
334
|
let r = [...e], i = r.findIndex((e) => e.cursor === t);
|
|
335
335
|
return i >= 0 && r.splice(i, 1, n), r;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
let r =
|
|
337
|
+
function Ae(e, t, n) {
|
|
338
|
+
let r = Se(e, t, n);
|
|
339
339
|
return {
|
|
340
340
|
items: r.items,
|
|
341
341
|
nextSequence: r.nextSequence
|
|
@@ -343,11 +343,11 @@ function Oe(e, t, n) {
|
|
|
343
343
|
}
|
|
344
344
|
//#endregion
|
|
345
345
|
//#region src/components/viewer-core/autoResolveState.ts
|
|
346
|
-
function
|
|
346
|
+
function je(e) {
|
|
347
347
|
return e instanceof DOMException && e.name === "AbortError" || e instanceof Error && (e.name === "AbortError" || e.name === "CanceledError") ? !0 : typeof e == "object" && !!e && "code" in e && e.code === "ERR_CANCELED";
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
let t =
|
|
349
|
+
function Me(e) {
|
|
350
|
+
let t = Ae(e.nextItems, e.previousItems, e.sequence);
|
|
351
351
|
return {
|
|
352
352
|
bucket: {
|
|
353
353
|
cursor: e.cursor,
|
|
@@ -358,7 +358,7 @@ function Ae(e) {
|
|
|
358
358
|
nextSequence: t.nextSequence
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Ne(e, t, n, r) {
|
|
362
362
|
if (!e.length) return r ? null : {
|
|
363
363
|
buckets: [],
|
|
364
364
|
canceled: r,
|
|
@@ -368,47 +368,47 @@ function je(e, t, n, r) {
|
|
|
368
368
|
return {
|
|
369
369
|
buckets: i,
|
|
370
370
|
canceled: r,
|
|
371
|
-
visibleCount: i.reduce((e, t) => e +
|
|
371
|
+
visibleCount: i.reduce((e, t) => e + De(t, n), 0)
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
let t =
|
|
374
|
+
function Pe(e) {
|
|
375
|
+
let t = Me({
|
|
376
376
|
cursor: e.initialState.cursor,
|
|
377
377
|
nextCursor: e.initialState.nextCursor ?? null,
|
|
378
378
|
nextItems: e.initialState.items,
|
|
379
379
|
previousCursor: e.initialState.previousCursor ?? null,
|
|
380
380
|
previousItems: [],
|
|
381
381
|
sequence: e.sequence
|
|
382
|
-
}), n =
|
|
382
|
+
}), n = Te(t.bucket.items, e.removedIds);
|
|
383
383
|
return {
|
|
384
|
-
activeIndex:
|
|
384
|
+
activeIndex: Q(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
|
|
385
385
|
buckets: [t.bucket],
|
|
386
386
|
nextSequence: t.nextSequence
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
let n = e[
|
|
389
|
+
function Fe(e, t) {
|
|
390
|
+
let n = e[Q(t, 0, Math.max(0, e.length - 1))];
|
|
391
391
|
return n ? $(n) : null;
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function Ie(e, t, n = null) {
|
|
394
394
|
if (!e.length) return 0;
|
|
395
395
|
let r = n ? e.findIndex((e) => $(e) === n) : -1;
|
|
396
|
-
return r >= 0 ? r :
|
|
396
|
+
return r >= 0 ? r : Q(t, 0, e.length - 1);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return e ?
|
|
398
|
+
function Le(e, t, n) {
|
|
399
|
+
return e ? De(e, t) < n : !1;
|
|
400
400
|
}
|
|
401
401
|
//#endregion
|
|
402
402
|
//#region src/components/viewer-core/fillDelay.ts
|
|
403
|
-
var
|
|
404
|
-
function
|
|
403
|
+
var Re = 2e3, ze = 1e3, Be = 100;
|
|
404
|
+
function Ve(e, t = Re, n = ze) {
|
|
405
405
|
return t + Math.max(0, e - 1) * n;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function He(e, t) {
|
|
408
408
|
return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
|
|
409
409
|
}
|
|
410
|
-
function
|
|
411
|
-
let e =
|
|
410
|
+
function Ue() {
|
|
411
|
+
let e = D(null), t = null, n = null, r = null;
|
|
412
412
|
function i(i = !1) {
|
|
413
413
|
if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
|
|
414
414
|
let e = r;
|
|
@@ -425,7 +425,7 @@ function Ve() {
|
|
|
425
425
|
let t = Math.max(0, a - (Date.now() - s));
|
|
426
426
|
e.value = t, t <= 0 && l();
|
|
427
427
|
};
|
|
428
|
-
t = setInterval(u,
|
|
428
|
+
t = setInterval(u, Be), n = setTimeout(l, a), u();
|
|
429
429
|
}));
|
|
430
430
|
}
|
|
431
431
|
return {
|
|
@@ -436,83 +436,83 @@ function Ve() {
|
|
|
436
436
|
}
|
|
437
437
|
//#endregion
|
|
438
438
|
//#region src/components/viewer-core/useAutoResolveSource.ts
|
|
439
|
-
function
|
|
440
|
-
let t = !!e.initialState?.items.length, n =
|
|
441
|
-
|
|
439
|
+
function We(e) {
|
|
440
|
+
let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = Ue(), d = u.remainingMs, f = D(null), p = D(!1), m = D(!0), h = D(!1), g = /* @__PURE__ */ new Set(), _ = null, v = null, y = 0, b = 0, C = i(() => He(e.fillDelayMs, Re)), w = i(() => He(e.fillDelayStepMs, ze)), T = i(() => typeof e.resolve == "function"), E = i(() => e.mode ?? "dynamic"), O = i(() => _e(e.pageSize)), k = i(() => we(n.value)), A = i(() => Te(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => ge(c.value) || p.value), N = i(() => Ge(n.value, e.removedIds.value)), P = i(() => Ke(n.value, e.removedIds.value)), F = i(() => P.value?.nextCursor ?? null), I = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!F.value), z = i(() => !!I.value), B = i(() => T.value && n.value.length > 0), ee = i(() => Te(we(a.value), e.removedIds.value)), te = i(() => Oe(n.value, e.removedIds.value, j.value)), V = i(() => !A.value.length && !M.value && !!s.value);
|
|
441
|
+
L(() => A.value.length, (e) => {
|
|
442
442
|
if (e === 0) {
|
|
443
443
|
r.value = 0;
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
446
446
|
o.value &&= (ye(), !1), r.value > e - 1 && (r.value = e - 1);
|
|
447
|
-
}),
|
|
448
|
-
m.value &&
|
|
447
|
+
}), L(() => r.value, () => {
|
|
448
|
+
m.value && ce();
|
|
449
|
+
}), S(() => {
|
|
450
|
+
pe() || e.resolve && H();
|
|
449
451
|
}), x(() => {
|
|
450
|
-
fe() || e.resolve && U();
|
|
451
|
-
}), b(() => {
|
|
452
452
|
_?.abort(), _ = null, u.clear(!0);
|
|
453
453
|
});
|
|
454
|
-
async function
|
|
455
|
-
v =
|
|
456
|
-
let t = await
|
|
457
|
-
continueUntilFilled:
|
|
454
|
+
async function H() {
|
|
455
|
+
v = H;
|
|
456
|
+
let t = await de({
|
|
457
|
+
continueUntilFilled: E.value === "dynamic",
|
|
458
458
|
cursor: e.initialCursor ?? null,
|
|
459
459
|
direction: "forward",
|
|
460
460
|
phase: "initializing"
|
|
461
461
|
});
|
|
462
|
-
t && (n.value = t.buckets, r.value = 0,
|
|
462
|
+
t && (n.value = t.buckets, r.value = 0, Z());
|
|
463
463
|
}
|
|
464
|
-
async function
|
|
464
|
+
async function U() {
|
|
465
465
|
if (!(h.value || M.value)) {
|
|
466
|
-
if (!R.value) return B.value ?
|
|
467
|
-
if (
|
|
468
|
-
await
|
|
466
|
+
if (!R.value) return B.value ? ue("trailing") : void 0;
|
|
467
|
+
if (E.value === "static" && he("trailing")) return ue("trailing");
|
|
468
|
+
await le(F.value);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
async function
|
|
471
|
+
async function W() {
|
|
472
472
|
if (!(h.value || !z.value || M.value)) {
|
|
473
|
-
if (
|
|
474
|
-
await
|
|
473
|
+
if (E.value === "static" && he("leading")) return ue("leading");
|
|
474
|
+
await X(I.value);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
async function
|
|
478
|
-
if (
|
|
479
|
-
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value =
|
|
480
|
-
|
|
477
|
+
async function ne() {
|
|
478
|
+
if (V.value) {
|
|
479
|
+
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = T.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, g.clear(), _?.abort(), _ = null, u.clear(!0), pe()) {
|
|
480
|
+
Z();
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
483
|
-
await
|
|
483
|
+
await H();
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
async function
|
|
487
|
-
if (
|
|
486
|
+
async function G() {
|
|
487
|
+
if (V.value) return ne();
|
|
488
488
|
h.value || c.value !== "failed" || !v || (s.value = null, await v());
|
|
489
489
|
}
|
|
490
|
-
async function
|
|
491
|
-
if (!a.value.length) return p.value = !1,
|
|
492
|
-
n.value = [...n.value, ...a.value], a.value = [], p.value = !1,
|
|
490
|
+
async function K() {
|
|
491
|
+
if (!a.value.length) return p.value = !1, Z();
|
|
492
|
+
n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Z();
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function q(t) {
|
|
495
495
|
let n = A.value;
|
|
496
496
|
if (!n.length) return;
|
|
497
|
-
let i =
|
|
497
|
+
let i = Q(t, 0, n.length - 1);
|
|
498
498
|
i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function re(e) {
|
|
501
501
|
m.value = e;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function J() {
|
|
504
504
|
h.value = !0, u.clear(!0);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Y() {
|
|
507
507
|
h.value = !1;
|
|
508
508
|
}
|
|
509
|
-
function re() {
|
|
510
|
-
y += 1, _?.abort(), _ = null, u.clear(!0), g.clear(), s.value = null, l.value = null, f.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), p.value = !1, o.value = !1, Q();
|
|
511
|
-
}
|
|
512
509
|
function ie() {
|
|
513
|
-
|
|
510
|
+
y += 1, _?.abort(), _ = null, u.clear(!0), g.clear(), s.value = null, l.value = null, f.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), p.value = !1, o.value = !1, Z();
|
|
514
511
|
}
|
|
515
|
-
function ae(
|
|
512
|
+
function ae() {
|
|
513
|
+
return Fe(A.value, j.value);
|
|
514
|
+
}
|
|
515
|
+
function oe(e = null, t = {}) {
|
|
516
516
|
if (A.value.length === 0) {
|
|
517
517
|
r.value = 0, !t.preserveTrailingPlaceholder && n.value.length > 0 && (o.value = !0);
|
|
518
518
|
return;
|
|
@@ -528,57 +528,57 @@ function He(e) {
|
|
|
528
528
|
r.value = A.value.length;
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
|
-
r.value =
|
|
531
|
+
r.value = Ie(A.value, j.value, e);
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
a.value.length > 0 && !ee.value.length &&
|
|
533
|
+
function se() {
|
|
534
|
+
a.value.length > 0 && !ee.value.length && K();
|
|
535
535
|
}
|
|
536
|
-
async function
|
|
537
|
-
if (!(!m.value ||
|
|
536
|
+
async function ce() {
|
|
537
|
+
if (!(!m.value || me())) {
|
|
538
538
|
if (!A.value.length) {
|
|
539
|
-
R.value && await
|
|
539
|
+
R.value && await U();
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
|
-
z.value && r.value < 3 && await
|
|
542
|
+
z.value && r.value < 3 && await W(), R.value && r.value >= A.value.length - 3 && await U();
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
async function
|
|
545
|
+
async function le(e) {
|
|
546
546
|
v = async () => {
|
|
547
|
-
await
|
|
547
|
+
await le(e);
|
|
548
548
|
};
|
|
549
|
-
let t = await
|
|
550
|
-
continueUntilFilled:
|
|
549
|
+
let t = await de({
|
|
550
|
+
continueUntilFilled: E.value === "dynamic",
|
|
551
551
|
cursor: e,
|
|
552
552
|
direction: "forward",
|
|
553
553
|
phase: "loading"
|
|
554
554
|
});
|
|
555
555
|
if (t) {
|
|
556
|
-
if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], p.value = !1,
|
|
557
|
-
if (a.value = t.buckets, !ee.value.length) return n.value = [...n.value, ...a.value], a.value = [], p.value = !1,
|
|
556
|
+
if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], p.value = !1, Z();
|
|
557
|
+
if (a.value = t.buckets, !ee.value.length) return n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Z();
|
|
558
558
|
p.value = !0;
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
-
async function
|
|
561
|
+
async function X(e) {
|
|
562
562
|
v = async () => {
|
|
563
|
-
await
|
|
563
|
+
await X(e);
|
|
564
564
|
};
|
|
565
|
-
let t = await
|
|
566
|
-
continueUntilFilled:
|
|
565
|
+
let t = await de({
|
|
566
|
+
continueUntilFilled: E.value === "dynamic",
|
|
567
567
|
cursor: e,
|
|
568
568
|
direction: "backward",
|
|
569
569
|
phase: "loading"
|
|
570
570
|
});
|
|
571
571
|
if (!t) return;
|
|
572
|
-
let r =
|
|
573
|
-
n.value = [...t.buckets, ...n.value],
|
|
572
|
+
let r = ae();
|
|
573
|
+
n.value = [...t.buckets, ...n.value], oe(r), Z();
|
|
574
574
|
}
|
|
575
|
-
async function
|
|
575
|
+
async function ue(t) {
|
|
576
576
|
if (v = async () => {
|
|
577
|
-
await
|
|
577
|
+
await ue(t);
|
|
578
578
|
}, !e.resolve) return;
|
|
579
579
|
let r = t === "leading" ? N.value : P.value;
|
|
580
580
|
if (!r) return;
|
|
581
|
-
let i =
|
|
581
|
+
let i = ve(r.cursor);
|
|
582
582
|
if (g.has(i)) return;
|
|
583
583
|
g.add(i), s.value = null, c.value = "refreshing", l.value = null, f.value = null;
|
|
584
584
|
let a = ++y, o = typeof AbortController > "u" ? null : new AbortController();
|
|
@@ -589,18 +589,18 @@ function He(e) {
|
|
|
589
589
|
pageSize: O.value,
|
|
590
590
|
signal: o?.signal
|
|
591
591
|
});
|
|
592
|
-
if (a !== y) return
|
|
593
|
-
let i =
|
|
592
|
+
if (a !== y) return Z();
|
|
593
|
+
let i = fe({
|
|
594
594
|
cursor: r.cursor,
|
|
595
595
|
nextCursor: t.nextPage,
|
|
596
596
|
nextItems: t.items,
|
|
597
597
|
previousCursor: t.previousPage ?? null,
|
|
598
598
|
previousItems: r.items
|
|
599
|
-
}), s =
|
|
600
|
-
n.value =
|
|
599
|
+
}), s = ae();
|
|
600
|
+
n.value = ke(n.value, r.cursor, i), oe(s), Z();
|
|
601
601
|
} catch (e) {
|
|
602
|
-
if (
|
|
603
|
-
|
|
602
|
+
if (je(e) || a !== y) {
|
|
603
|
+
Z();
|
|
604
604
|
return;
|
|
605
605
|
}
|
|
606
606
|
s.value = e instanceof Error ? e.message : "The viewer could not load items.", c.value = "failed", l.value = null, f.value = null;
|
|
@@ -608,13 +608,13 @@ function He(e) {
|
|
|
608
608
|
_ === o && (_ = null), g.delete(i);
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
async function
|
|
611
|
+
async function de(t) {
|
|
612
612
|
if (!e.resolve) return null;
|
|
613
613
|
let n = ++y, r = /* @__PURE__ */ new Set(), i = [], a = t.cursor, o = 0;
|
|
614
614
|
for (s.value = null, c.value = t.phase, l.value = null, f.value = null;;) {
|
|
615
|
-
if (n !== y) return
|
|
616
|
-
if (i.length > 0 && h.value) return
|
|
617
|
-
let d =
|
|
615
|
+
if (n !== y) return Ne(i, t.direction, e.removedIds.value, !0);
|
|
616
|
+
if (i.length > 0 && h.value) return Ne(i, t.direction, e.removedIds.value, !1);
|
|
617
|
+
let d = ve(a);
|
|
618
618
|
if (r.has(d) || g.has(d)) break;
|
|
619
619
|
r.add(d), g.add(d);
|
|
620
620
|
let p = typeof AbortController > "u" ? null : new AbortController();
|
|
@@ -625,8 +625,8 @@ function He(e) {
|
|
|
625
625
|
pageSize: O.value,
|
|
626
626
|
signal: p?.signal
|
|
627
627
|
});
|
|
628
|
-
if (n !== y) return
|
|
629
|
-
let s =
|
|
628
|
+
if (n !== y) return Ne(i, t.direction, e.removedIds.value, !0);
|
|
629
|
+
let s = fe({
|
|
630
630
|
cursor: a,
|
|
631
631
|
nextCursor: r.nextPage,
|
|
632
632
|
nextItems: r.items,
|
|
@@ -634,59 +634,59 @@ function He(e) {
|
|
|
634
634
|
previousItems: []
|
|
635
635
|
});
|
|
636
636
|
i.push(s);
|
|
637
|
-
let d = i.reduce((t, n) => t +
|
|
637
|
+
let d = i.reduce((t, n) => t + De(n, e.removedIds.value), 0), m = t.direction === "forward" ? s.nextCursor : s.previousCursor;
|
|
638
638
|
if (!t.continueUntilFilled || d >= O.value || !m) return {
|
|
639
639
|
canceled: !1,
|
|
640
640
|
buckets: t.direction === "backward" ? [...i].reverse() : i,
|
|
641
641
|
visibleCount: d
|
|
642
642
|
};
|
|
643
|
-
if (h.value) return
|
|
643
|
+
if (h.value) return Ne(i, t.direction, e.removedIds.value, !1);
|
|
644
644
|
c.value = "filling", l.value = d, f.value = O.value, o += 1;
|
|
645
|
-
let g =
|
|
646
|
-
if (await u.wait(g), n !== y) return
|
|
645
|
+
let g = Ve(o, C.value, w.value);
|
|
646
|
+
if (await u.wait(g), n !== y) return Ne(i, t.direction, e.removedIds.value, !0);
|
|
647
647
|
a = m;
|
|
648
648
|
} catch (r) {
|
|
649
|
-
return
|
|
649
|
+
return je(r) || n !== y ? Ne(i, t.direction, e.removedIds.value, !0) : (s.value = r instanceof Error ? r.message : "The viewer could not load items.", c.value = "failed", l.value = null, f.value = null, null);
|
|
650
650
|
} finally {
|
|
651
651
|
_ === p && (_ = null), g.delete(d);
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
return
|
|
654
|
+
return Ne(i, t.direction, e.removedIds.value, !1);
|
|
655
655
|
}
|
|
656
|
-
function
|
|
657
|
-
let t =
|
|
656
|
+
function fe(e) {
|
|
657
|
+
let t = Me({
|
|
658
658
|
cursor: e.cursor,
|
|
659
659
|
nextCursor: e.nextCursor,
|
|
660
660
|
nextItems: e.nextItems,
|
|
661
661
|
previousCursor: e.previousCursor,
|
|
662
662
|
previousItems: e.previousItems,
|
|
663
|
-
sequence:
|
|
663
|
+
sequence: b
|
|
664
664
|
});
|
|
665
|
-
return
|
|
665
|
+
return b = t.nextSequence, t.bucket;
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function Z() {
|
|
668
668
|
c.value = "idle", l.value = null, f.value = null, u.clear();
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function pe() {
|
|
671
671
|
if (!e.initialState || !e.initialState.items.length) return !1;
|
|
672
|
-
let t =
|
|
672
|
+
let t = Pe({
|
|
673
673
|
initialState: e.initialState,
|
|
674
674
|
removedIds: e.removedIds.value,
|
|
675
|
-
sequence:
|
|
675
|
+
sequence: b
|
|
676
676
|
});
|
|
677
|
-
return n.value = t.buckets, r.value = t.activeIndex,
|
|
677
|
+
return n.value = t.buckets, r.value = t.activeIndex, b = t.nextSequence, o.value = !1, s.value = null, a.value = [], p.value = !1, !0;
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function me() {
|
|
680
680
|
return c.value === "initializing";
|
|
681
681
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
682
|
+
function he(t) {
|
|
683
|
+
return Le(t === "leading" ? N.value : P.value, e.removedIds.value, O.value);
|
|
684
684
|
}
|
|
685
685
|
function ye() {
|
|
686
|
-
let t = n.value.findIndex((t) =>
|
|
686
|
+
let t = n.value.findIndex((t) => De(t, e.removedIds.value) > 0);
|
|
687
687
|
if (t < 0) return;
|
|
688
688
|
let r = t;
|
|
689
|
-
for (let i = n.value.length - 1; i >= t; --i) if (
|
|
689
|
+
for (let i = n.value.length - 1; i >= t; --i) if (De(n.value[i], e.removedIds.value) > 0) {
|
|
690
690
|
r = i;
|
|
691
691
|
break;
|
|
692
692
|
}
|
|
@@ -694,11 +694,11 @@ function He(e) {
|
|
|
694
694
|
}
|
|
695
695
|
return {
|
|
696
696
|
activeIndex: j,
|
|
697
|
-
canRetryInitialLoad:
|
|
698
|
-
cancel:
|
|
697
|
+
canRetryInitialLoad: V,
|
|
698
|
+
cancel: ie,
|
|
699
699
|
canRefreshTrailingBoundary: B,
|
|
700
|
-
commitPendingAppend:
|
|
701
|
-
currentCursor:
|
|
700
|
+
commitPendingAppend: K,
|
|
701
|
+
currentCursor: te,
|
|
702
702
|
errorMessage: s,
|
|
703
703
|
fillCollectedCount: l,
|
|
704
704
|
fillDelayRemainingMs: d,
|
|
@@ -708,40 +708,40 @@ function He(e) {
|
|
|
708
708
|
isAutoPrefetchEnabled: m,
|
|
709
709
|
isPageLoadingLocked: h,
|
|
710
710
|
items: A,
|
|
711
|
-
lockPageLoading:
|
|
711
|
+
lockPageLoading: J,
|
|
712
712
|
loading: M,
|
|
713
|
-
mode:
|
|
714
|
-
maybePrefetchAround:
|
|
715
|
-
nextCursor:
|
|
713
|
+
mode: E,
|
|
714
|
+
maybePrefetchAround: ce,
|
|
715
|
+
nextCursor: F,
|
|
716
716
|
pendingAppendItems: ee,
|
|
717
717
|
phase: c,
|
|
718
|
-
prefetchNextPage:
|
|
719
|
-
prefetchPreviousPage:
|
|
720
|
-
previousCursor:
|
|
721
|
-
retryInitialLoad:
|
|
722
|
-
retry:
|
|
723
|
-
setActiveIndex:
|
|
724
|
-
setAutoPrefetchEnabled:
|
|
725
|
-
syncActiveIndexAfterVisibilityChange:
|
|
726
|
-
unlockPageLoading:
|
|
727
|
-
getActiveOccurrenceKey:
|
|
728
|
-
maybeCommitPendingAppendWhenFilteredOut:
|
|
718
|
+
prefetchNextPage: U,
|
|
719
|
+
prefetchPreviousPage: W,
|
|
720
|
+
previousCursor: I,
|
|
721
|
+
retryInitialLoad: ne,
|
|
722
|
+
retry: G,
|
|
723
|
+
setActiveIndex: q,
|
|
724
|
+
setAutoPrefetchEnabled: re,
|
|
725
|
+
syncActiveIndexAfterVisibilityChange: oe,
|
|
726
|
+
unlockPageLoading: Y,
|
|
727
|
+
getActiveOccurrenceKey: ae,
|
|
728
|
+
maybeCommitPendingAppendWhenFilteredOut: se
|
|
729
729
|
};
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
return e.find((e) =>
|
|
731
|
+
function Ge(e, t) {
|
|
732
|
+
return e.find((e) => De(e, t) > 0) ?? e[0] ?? null;
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function Ke(e, t) {
|
|
735
735
|
for (let n = e.length - 1; n >= 0; --n) {
|
|
736
736
|
let r = e[n];
|
|
737
|
-
if (
|
|
737
|
+
if (De(r, t) > 0) return r;
|
|
738
738
|
}
|
|
739
739
|
return e[e.length - 1] ?? null;
|
|
740
740
|
}
|
|
741
741
|
//#endregion
|
|
742
742
|
//#region src/components/viewer-core/useDataSource.ts
|
|
743
|
-
function
|
|
744
|
-
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } =
|
|
743
|
+
function qe(e, t) {
|
|
744
|
+
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = ye(), l = We({
|
|
745
745
|
emit: t,
|
|
746
746
|
fillDelayMs: e.fillDelayMs,
|
|
747
747
|
fillDelayStepMs: e.fillDelayStepMs,
|
|
@@ -829,12 +829,12 @@ function Ge(e, t) {
|
|
|
829
829
|
}
|
|
830
830
|
//#endregion
|
|
831
831
|
//#region src/components/viewer-core/useController.ts
|
|
832
|
-
var
|
|
833
|
-
function
|
|
834
|
-
let n =
|
|
832
|
+
var Je = 1024;
|
|
833
|
+
function Ye(e, t) {
|
|
834
|
+
let n = qe(e, t), r = T({
|
|
835
835
|
nextBoundaryLoadProgress: 0,
|
|
836
836
|
previousBoundaryLoadProgress: 0
|
|
837
|
-
}), a =
|
|
837
|
+
}), a = D(0), o = D("list"), s = T({
|
|
838
838
|
activeIndex: 0,
|
|
839
839
|
currentCursor: null,
|
|
840
840
|
errorMessage: null,
|
|
@@ -855,27 +855,27 @@ function qe(e, t) {
|
|
|
855
855
|
removedCount: 0,
|
|
856
856
|
removedIds: [],
|
|
857
857
|
surfaceMode: "list"
|
|
858
|
-
}), c = i(() => a.value >=
|
|
859
|
-
|
|
858
|
+
}), c = i(() => a.value >= Je), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
|
|
859
|
+
L(c, (e) => {
|
|
860
860
|
e && h();
|
|
861
|
-
}),
|
|
861
|
+
}), L(() => e.surfaceMode, () => {
|
|
862
862
|
h();
|
|
863
|
-
}),
|
|
863
|
+
}), L([l, () => n.pendingAppendItems.value.length], ([e, t]) => {
|
|
864
864
|
e === "list" || t <= 0 || n.commitPendingAppend();
|
|
865
|
-
}),
|
|
865
|
+
}), L([
|
|
866
866
|
() => n.items.value.length,
|
|
867
867
|
() => n.loading.value,
|
|
868
868
|
() => n.hasNextPage.value,
|
|
869
869
|
() => n.pendingAppendItems.value.length
|
|
870
870
|
], ([e, n, r, i]) => {
|
|
871
871
|
!c.value || e > 0 || o.value === "list" || n || r || i > 0 || (o.value = "list", t("update:surfaceMode", "list"));
|
|
872
|
-
}),
|
|
872
|
+
}), L(l, (e) => {
|
|
873
873
|
n.setAutoPrefetchEnabled(e === "fullscreen");
|
|
874
|
-
}, { immediate: !0 }),
|
|
874
|
+
}, { immediate: !0 }), R(() => {
|
|
875
875
|
s.activeIndex = n.activeIndex.value, s.currentCursor = n.currentCursor.value, s.errorMessage = n.errorMessage.value, s.fillCollectedCount = n.fillCollectedCount.value, s.fillDelayRemainingMs = n.fillDelayRemainingMs.value, s.fillTargetCount = n.fillTargetCount.value, s.hasNextPage = n.hasNextPage.value, s.hasPreviousPage = n.hasPreviousPage.value, s.itemCount = n.items.value.length, s.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", s.mode = n.mode.value, s.nextBoundaryLoadProgress = r.nextBoundaryLoadProgress, s.nextCursor = n.nextCursor.value, s.pageLoadingLocked = n.isPageLoadingLocked.value, s.phase = n.phase.value, s.previousBoundaryLoadProgress = r.previousBoundaryLoadProgress, s.previousCursor = n.previousCursor.value, s.removedCount = n.removedCount.value, s.removedIds = n.getRemovedIds(), s.surfaceMode = l.value;
|
|
876
|
-
}),
|
|
876
|
+
}), S(() => {
|
|
877
877
|
m(), h(), window.addEventListener("keydown", p), window.addEventListener("resize", m);
|
|
878
|
-
}),
|
|
878
|
+
}), x(() => {
|
|
879
879
|
window.removeEventListener("keydown", p), window.removeEventListener("resize", m);
|
|
880
880
|
});
|
|
881
881
|
function d(e) {
|
|
@@ -885,7 +885,7 @@ function qe(e, t) {
|
|
|
885
885
|
!c.value || o.value === "list" || (o.value = "list", t("update:surfaceMode", "list"));
|
|
886
886
|
}
|
|
887
887
|
function p(e) {
|
|
888
|
-
e.defaultPrevented || e.key !== "Escape" || !c.value || l.value !== "fullscreen" ||
|
|
888
|
+
e.defaultPrevented || e.key !== "Escape" || !c.value || l.value !== "fullscreen" || me(e.target) || (e.preventDefault(), f());
|
|
889
889
|
}
|
|
890
890
|
function m() {
|
|
891
891
|
a.value = window.innerWidth || 0;
|
|
@@ -894,7 +894,7 @@ function qe(e, t) {
|
|
|
894
894
|
!c.value || !e.surfaceMode || e.surfaceMode === o.value || (o.value = e.surfaceMode);
|
|
895
895
|
}
|
|
896
896
|
function g(e) {
|
|
897
|
-
r.nextBoundaryLoadProgress =
|
|
897
|
+
r.nextBoundaryLoadProgress = Xe(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = Xe(e.previousBoundaryLoadProgress);
|
|
898
898
|
}
|
|
899
899
|
return {
|
|
900
900
|
...n,
|
|
@@ -908,31 +908,31 @@ function qe(e, t) {
|
|
|
908
908
|
retry: n.retry,
|
|
909
909
|
setBoundaryLoadProgress: g,
|
|
910
910
|
showBackToList: u,
|
|
911
|
-
status:
|
|
911
|
+
status: E(s),
|
|
912
912
|
surfaceMode: l,
|
|
913
913
|
unlockPageLoading: n.unlockPageLoading
|
|
914
914
|
};
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function Xe(e) {
|
|
917
917
|
return Math.min(Math.max(e, 0), 1);
|
|
918
918
|
}
|
|
919
919
|
//#endregion
|
|
920
920
|
//#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
|
|
921
|
-
var
|
|
921
|
+
var Ze = {
|
|
922
922
|
"data-testid": "vibe-media-bar",
|
|
923
923
|
class: "absolute inset-x-0 bottom-0 z-[5] bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.42)_24%,rgba(0,0,0,0.78))] px-[clamp(1rem,2.6vw,2.25rem)] pt-4 pb-[1.15rem]"
|
|
924
|
-
},
|
|
924
|
+
}, Qe = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, $e = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, et = { class: "relative h-4 w-full" }, tt = [
|
|
925
925
|
"max",
|
|
926
926
|
"value",
|
|
927
927
|
"disabled"
|
|
928
|
-
],
|
|
928
|
+
], nt = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, rt = ["data-layout"], it = {
|
|
929
929
|
key: 0,
|
|
930
930
|
"data-testid": "vibe-media-volume-popover",
|
|
931
931
|
class: "absolute bottom-[calc(100%+0.8rem)] right-0 grid justify-items-center gap-3 border border-white/12 bg-black/82 px-3 py-4 shadow-[0_20px_50px_-20px_rgba(0,0,0,0.85)] backdrop-blur-[18px]"
|
|
932
|
-
},
|
|
932
|
+
}, at = { class: "relative flex h-28 w-4 items-center justify-center" }, ot = ["value"], st = { class: "flex items-center gap-3" }, ct = ["aria-label"], lt = {
|
|
933
933
|
key: 0,
|
|
934
934
|
class: "relative h-4 w-24"
|
|
935
|
-
},
|
|
935
|
+
}, ut = ["value"], dt = /* @__PURE__ */ d({
|
|
936
936
|
__name: "FullscreenMediaBar",
|
|
937
937
|
props: {
|
|
938
938
|
currentTime: {},
|
|
@@ -950,18 +950,18 @@ var Ye = {
|
|
|
950
950
|
"volume-toggle"
|
|
951
951
|
],
|
|
952
952
|
setup(e, { emit: t }) {
|
|
953
|
-
let n = e, r = t, l =
|
|
954
|
-
|
|
953
|
+
let n = e, r = t, l = D(null), u = D(!1), d = i(() => n.volumeControlLayout === "vertical"), f = i(() => C(n.volume, 0, 1)), p = i(() => Math.round(f.value * 100)), m = i(() => n.muted || f.value <= 0 ? de : f.value < .5 ? X : ue), h = i(() => n.muted || f.value <= 0 ? "Unmute active media" : "Mute active media"), g = i(() => d.value && !u.value ? "Show volume controls" : h.value), _ = i(() => n.volumeControlLayout === "vertical" ? { height: `${p.value}%` } : { width: `${p.value}%` });
|
|
954
|
+
L(d, (e) => {
|
|
955
955
|
e || (u.value = !1);
|
|
956
|
-
}),
|
|
956
|
+
}), S(() => {
|
|
957
957
|
document.addEventListener("pointerdown", v);
|
|
958
|
-
}),
|
|
958
|
+
}), x(() => {
|
|
959
959
|
document.removeEventListener("pointerdown", v);
|
|
960
960
|
});
|
|
961
961
|
function v(e) {
|
|
962
962
|
!d.value || !u.value || l.value && e.target instanceof Node && !l.value.contains(e.target) && (u.value = !1);
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function y() {
|
|
965
965
|
if (!d.value) {
|
|
966
966
|
r("volume-toggle");
|
|
967
967
|
return;
|
|
@@ -972,16 +972,16 @@ var Ye = {
|
|
|
972
972
|
}
|
|
973
973
|
r("volume-toggle");
|
|
974
974
|
}
|
|
975
|
-
function
|
|
975
|
+
function C(e, t, n) {
|
|
976
976
|
return Math.min(Math.max(e, t), n);
|
|
977
977
|
}
|
|
978
|
-
return (e, t) => (
|
|
979
|
-
c("span",
|
|
980
|
-
c("div",
|
|
978
|
+
return (e, t) => (w(), s("div", Ze, [c("div", Qe, [
|
|
979
|
+
c("span", $e, j(n.currentTimeLabel), 1),
|
|
980
|
+
c("div", et, [
|
|
981
981
|
t[3] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
982
982
|
c("div", {
|
|
983
983
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
984
|
-
style:
|
|
984
|
+
style: b({ width: `${n.progress}%` })
|
|
985
985
|
}, null, 4),
|
|
986
986
|
c("input", {
|
|
987
987
|
"data-swipe-lock": "true",
|
|
@@ -994,20 +994,20 @@ var Ye = {
|
|
|
994
994
|
disabled: n.duration <= 0,
|
|
995
995
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
|
|
996
996
|
onInput: t[0] ||= (e) => r("seek-input", e)
|
|
997
|
-
}, null, 40,
|
|
997
|
+
}, null, 40, tt)
|
|
998
998
|
]),
|
|
999
|
-
c("span",
|
|
999
|
+
c("span", nt, j(n.durationLabel), 1),
|
|
1000
1000
|
c("div", {
|
|
1001
1001
|
ref_key: "rootRef",
|
|
1002
1002
|
ref: l,
|
|
1003
1003
|
"data-testid": "vibe-media-volume",
|
|
1004
1004
|
"data-layout": n.volumeControlLayout,
|
|
1005
1005
|
class: "relative flex items-center justify-end"
|
|
1006
|
-
}, [d.value && u.value ? (
|
|
1006
|
+
}, [d.value && u.value ? (w(), s("div", it, [c("div", at, [
|
|
1007
1007
|
t[4] ||= c("div", { class: "absolute bottom-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/12" }, null, -1),
|
|
1008
1008
|
c("div", {
|
|
1009
1009
|
class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
|
|
1010
|
-
style:
|
|
1010
|
+
style: b(_.value)
|
|
1011
1011
|
}, null, 4),
|
|
1012
1012
|
c("input", {
|
|
1013
1013
|
"data-testid": "vibe-media-volume-slider",
|
|
@@ -1020,21 +1020,21 @@ var Ye = {
|
|
|
1020
1020
|
value: f.value,
|
|
1021
1021
|
class: "vibe-media-slider absolute left-1/2 top-1/2 h-4 w-28 -translate-x-1/2 -translate-y-1/2 -rotate-90 bg-transparent",
|
|
1022
1022
|
onInput: t[1] ||= (e) => r("volume-input", e)
|
|
1023
|
-
}, null, 40,
|
|
1024
|
-
])])) : o("", !0), c("div",
|
|
1023
|
+
}, null, 40, ot)
|
|
1024
|
+
])])) : o("", !0), c("div", st, [c("button", {
|
|
1025
1025
|
type: "button",
|
|
1026
1026
|
"data-testid": "vibe-media-volume-button",
|
|
1027
1027
|
"aria-label": g.value,
|
|
1028
1028
|
class: "inline-flex h-10 w-10 items-center justify-center border border-white/14 bg-black/50 text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/65",
|
|
1029
|
-
onClick:
|
|
1030
|
-
}, [(
|
|
1029
|
+
onClick: y
|
|
1030
|
+
}, [(w(), a(A(m.value), {
|
|
1031
1031
|
class: "h-4 w-4 stroke-[1.9]",
|
|
1032
1032
|
"aria-hidden": "true"
|
|
1033
|
-
}))], 8,
|
|
1033
|
+
}))], 8, ct), n.volumeControlLayout === "horizontal" ? (w(), s("div", lt, [
|
|
1034
1034
|
t[5] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
1035
1035
|
c("div", {
|
|
1036
1036
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
1037
|
-
style:
|
|
1037
|
+
style: b(_.value)
|
|
1038
1038
|
}, null, 4),
|
|
1039
1039
|
c("input", {
|
|
1040
1040
|
"data-testid": "vibe-media-volume-slider",
|
|
@@ -1047,24 +1047,24 @@ var Ye = {
|
|
|
1047
1047
|
value: f.value,
|
|
1048
1048
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
|
|
1049
1049
|
onInput: t[2] ||= (e) => r("volume-input", e)
|
|
1050
|
-
}, null, 40,
|
|
1051
|
-
])) : o("", !0)])], 8,
|
|
1050
|
+
}, null, 40, ut)
|
|
1051
|
+
])) : o("", !0)])], 8, rt)
|
|
1052
1052
|
])]));
|
|
1053
1053
|
}
|
|
1054
|
-
}),
|
|
1054
|
+
}), ft = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, pt = { class: "grid gap-4" }, mt = { class: "flex min-h-11 items-center justify-between gap-4" }, ht = { class: "min-w-0 flex flex-1 items-center gap-3" }, gt = {
|
|
1055
1055
|
key: 1,
|
|
1056
1056
|
"data-testid": "vibe-title",
|
|
1057
1057
|
class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
|
|
1058
|
-
},
|
|
1058
|
+
}, _t = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, vt = {
|
|
1059
1059
|
"data-testid": "vibe-pagination",
|
|
1060
1060
|
class: "inline-flex shrink-0 items-center gap-2 whitespace-nowrap border border-white/14 bg-black/40 px-3 py-2 text-[0.63rem] font-bold uppercase tracking-[0.12em] text-[#f7f1ea]/72 backdrop-blur-[18px] min-[721px]:gap-3 min-[721px]:px-4 min-[721px]:py-3 min-[721px]:text-[0.74rem] min-[721px]:tracking-[0.2em]"
|
|
1061
|
-
},
|
|
1061
|
+
}, yt = { class: "whitespace-nowrap" }, bt = {
|
|
1062
1062
|
key: 1,
|
|
1063
1063
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
1064
|
-
},
|
|
1064
|
+
}, xt = {
|
|
1065
1065
|
key: 0,
|
|
1066
1066
|
class: "grid gap-2 max-[720px]:justify-items-start"
|
|
1067
|
-
},
|
|
1067
|
+
}, St = /* @__PURE__ */ d({
|
|
1068
1068
|
__name: "FullscreenHeader",
|
|
1069
1069
|
props: {
|
|
1070
1070
|
currentIndex: {},
|
|
@@ -1078,100 +1078,348 @@ var Ye = {
|
|
|
1078
1078
|
emits: ["back-to-list"],
|
|
1079
1079
|
setup(e, { emit: t }) {
|
|
1080
1080
|
let n = e, r = t;
|
|
1081
|
-
return (e, t) => (
|
|
1081
|
+
return (e, t) => (w(), s("div", ft, [c("div", pt, [c("div", mt, [c("div", ht, [n.showBackToList ? (w(), s("button", {
|
|
1082
1082
|
key: 0,
|
|
1083
1083
|
type: "button",
|
|
1084
1084
|
"data-testid": "vibe-back-to-list",
|
|
1085
1085
|
class: "pointer-events-auto inline-flex h-11 w-11 shrink-0 items-center justify-center border border-white/14 bg-black/40 text-[#f7f1ea]/78 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/55",
|
|
1086
1086
|
"aria-label": "Back to list",
|
|
1087
1087
|
onClick: t[0] ||= (e) => r("back-to-list")
|
|
1088
|
-
}, [u(
|
|
1088
|
+
}, [u(N(re), {
|
|
1089
1089
|
class: "h-4 w-4 stroke-[2.2]",
|
|
1090
1090
|
"aria-hidden": "true"
|
|
1091
|
-
})])) : o("", !0), n.title ? (
|
|
1092
|
-
n.loading ? (
|
|
1091
|
+
})])) : o("", !0), n.title ? (w(), s("h2", gt, j(n.title), 1)) : o("", !0)]), c("div", _t, [c("span", vt, [
|
|
1092
|
+
n.loading ? (w(), a(N(oe), {
|
|
1093
1093
|
key: 0,
|
|
1094
1094
|
"data-testid": "vibe-pagination-spinner",
|
|
1095
1095
|
class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
|
|
1096
1096
|
"aria-hidden": "true"
|
|
1097
1097
|
})) : o("", !0),
|
|
1098
|
-
c("span",
|
|
1099
|
-
n.paginationDetail ? (
|
|
1100
|
-
]),
|
|
1098
|
+
c("span", yt, j(n.currentIndex + 1) + " / " + j(n.total), 1),
|
|
1099
|
+
n.paginationDetail ? (w(), s("span", bt, j(n.paginationDetail), 1)) : o("", !0)
|
|
1100
|
+
]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div", xt, [...t[1] ||= [c("span", { class: "inline-flex items-center border border-amber-300/35 bg-black/40 px-4 py-3 text-[0.74rem] font-bold uppercase tracking-[0.2em] text-amber-200 backdrop-blur-[18px]" }, " End reached ", -1)]])) : o("", !0)]));
|
|
1101
1101
|
}
|
|
1102
|
-
}),
|
|
1103
|
-
image:
|
|
1104
|
-
video:
|
|
1102
|
+
}), Ct = {
|
|
1103
|
+
image: ae,
|
|
1104
|
+
video: Y,
|
|
1105
1105
|
audio: J,
|
|
1106
|
-
other:
|
|
1107
|
-
},
|
|
1106
|
+
other: ie
|
|
1107
|
+
}, wt = {
|
|
1108
1108
|
image: "Image",
|
|
1109
1109
|
video: "Video",
|
|
1110
1110
|
audio: "Audio",
|
|
1111
1111
|
other: "File"
|
|
1112
1112
|
};
|
|
1113
|
-
function
|
|
1114
|
-
return
|
|
1113
|
+
function Tt(e) {
|
|
1114
|
+
return Ct[e];
|
|
1115
|
+
}
|
|
1116
|
+
function Et(e) {
|
|
1117
|
+
return wt[e];
|
|
1118
|
+
}
|
|
1119
|
+
//#endregion
|
|
1120
|
+
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
1121
|
+
var Dt = {
|
|
1122
|
+
maxGlobal: 10,
|
|
1123
|
+
maxPerDomain: 4,
|
|
1124
|
+
maxVideoPerDomain: 2
|
|
1125
|
+
};
|
|
1126
|
+
function Ot(e = Dt) {
|
|
1127
|
+
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
|
|
1128
|
+
function i(e) {
|
|
1129
|
+
let i = {
|
|
1130
|
+
...e,
|
|
1131
|
+
domain: jt(e.url),
|
|
1132
|
+
enqueuedAt: r,
|
|
1133
|
+
id: `vibe-asset-load-${r += 1}`
|
|
1134
|
+
};
|
|
1135
|
+
return n.set(i.id, i), a(), {
|
|
1136
|
+
cancel() {
|
|
1137
|
+
(n.delete(i.id) || t.delete(i.id)) && a();
|
|
1138
|
+
},
|
|
1139
|
+
refresh() {
|
|
1140
|
+
a();
|
|
1141
|
+
},
|
|
1142
|
+
release() {
|
|
1143
|
+
(t.delete(i.id) || n.delete(i.id)) && a();
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
function a() {
|
|
1148
|
+
if (n.size === 0) return;
|
|
1149
|
+
let r = [...n.values()].sort((e, t) => {
|
|
1150
|
+
let n = At(e) - At(t);
|
|
1151
|
+
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
1152
|
+
});
|
|
1153
|
+
for (let i of r) {
|
|
1154
|
+
if (t.size >= e.maxGlobal) return;
|
|
1155
|
+
if (o(i)) {
|
|
1156
|
+
n.delete(i.id), t.set(i.id, i);
|
|
1157
|
+
try {
|
|
1158
|
+
i.onGrant();
|
|
1159
|
+
} catch {
|
|
1160
|
+
t.delete(i.id);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
function o(n) {
|
|
1166
|
+
let r = [...t.values()].filter((e) => e.domain === n.domain);
|
|
1167
|
+
return !(r.length >= e.maxPerDomain || n.assetType === "video" && r.filter((e) => e.assetType === "video").length >= e.maxVideoPerDomain);
|
|
1168
|
+
}
|
|
1169
|
+
return { request: i };
|
|
1170
|
+
}
|
|
1171
|
+
var kt = Ot();
|
|
1172
|
+
function At(e) {
|
|
1173
|
+
try {
|
|
1174
|
+
let t = e.getPriority();
|
|
1175
|
+
return Number.isFinite(t) ? t : Infinity;
|
|
1176
|
+
} catch {
|
|
1177
|
+
return Infinity;
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
function jt(e) {
|
|
1181
|
+
try {
|
|
1182
|
+
return new URL(e).hostname || "local";
|
|
1183
|
+
} catch {
|
|
1184
|
+
return "local";
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region src/components/viewer-core/useFullscreenPreloadController.ts
|
|
1189
|
+
var Mt = {
|
|
1190
|
+
1: 0,
|
|
1191
|
+
2: 1,
|
|
1192
|
+
[-1]: 2
|
|
1193
|
+
};
|
|
1194
|
+
function Nt(e) {
|
|
1195
|
+
let t = D({}), n = Ot({
|
|
1196
|
+
maxGlobal: 1,
|
|
1197
|
+
maxPerDomain: 1,
|
|
1198
|
+
maxVideoPerDomain: 1
|
|
1199
|
+
}), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
|
|
1200
|
+
L([
|
|
1201
|
+
e.active,
|
|
1202
|
+
e.items,
|
|
1203
|
+
e.resolvedActiveIndex
|
|
1204
|
+
], () => {
|
|
1205
|
+
p();
|
|
1206
|
+
}, { immediate: !0 }), f() && C(() => {
|
|
1207
|
+
d();
|
|
1208
|
+
});
|
|
1209
|
+
function s(n) {
|
|
1210
|
+
if (!e.active.value) return !1;
|
|
1211
|
+
let r = e.items.value[n];
|
|
1212
|
+
if (!r || !Lt(r)) return !1;
|
|
1213
|
+
let i = e.getItemKey(r);
|
|
1214
|
+
return i === h() || !!t.value[i];
|
|
1215
|
+
}
|
|
1216
|
+
function c(e, t) {
|
|
1217
|
+
if (t instanceof HTMLImageElement) {
|
|
1218
|
+
i.set(e, t), Ft(t) && u(e);
|
|
1219
|
+
return;
|
|
1220
|
+
}
|
|
1221
|
+
i.delete(e);
|
|
1222
|
+
}
|
|
1223
|
+
function l(e, t) {
|
|
1224
|
+
if (t instanceof HTMLMediaElement) {
|
|
1225
|
+
a.set(e, t), It(t) && u(e);
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
a.delete(e);
|
|
1229
|
+
}
|
|
1230
|
+
function u(e) {
|
|
1231
|
+
let t = r.get(e);
|
|
1232
|
+
t && (t.lease.release(), r.delete(e));
|
|
1233
|
+
}
|
|
1234
|
+
function d() {
|
|
1235
|
+
for (let e of r.values()) e.lease.release();
|
|
1236
|
+
r.clear(), t.value = {}, _();
|
|
1237
|
+
}
|
|
1238
|
+
function p() {
|
|
1239
|
+
if (!e.active.value) {
|
|
1240
|
+
d();
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
let s = m(), c = new Set(s.map((e) => e.key)), l = h();
|
|
1244
|
+
for (let e of o) e !== l && c.has(e) && v(e, !0);
|
|
1245
|
+
for (let e of Object.keys(t.value)) c.has(e) || v(e, !1);
|
|
1246
|
+
for (let [e, t] of r.entries()) {
|
|
1247
|
+
if (!c.has(e)) {
|
|
1248
|
+
t.lease.release(), r.delete(e);
|
|
1249
|
+
continue;
|
|
1250
|
+
}
|
|
1251
|
+
let n = s.find((t) => t.key === e);
|
|
1252
|
+
n && (t.index = n.index);
|
|
1253
|
+
}
|
|
1254
|
+
for (let e of s) {
|
|
1255
|
+
if (r.has(e.key) || t.value[e.key]) continue;
|
|
1256
|
+
let o;
|
|
1257
|
+
o = {
|
|
1258
|
+
index: e.index,
|
|
1259
|
+
key: e.key,
|
|
1260
|
+
lease: n.request({
|
|
1261
|
+
assetType: e.item.type === "image" ? "image" : "video",
|
|
1262
|
+
getPriority: () => g(o.index),
|
|
1263
|
+
onGrant: () => {
|
|
1264
|
+
v(e.key, !0), Pt(e.key, i, a) && u(e.key);
|
|
1265
|
+
},
|
|
1266
|
+
url: e.item.url
|
|
1267
|
+
})
|
|
1268
|
+
}, r.set(e.key, o);
|
|
1269
|
+
}
|
|
1270
|
+
for (let e of r.values()) e.lease.refresh();
|
|
1271
|
+
_();
|
|
1272
|
+
}
|
|
1273
|
+
function m() {
|
|
1274
|
+
let t = e.resolvedActiveIndex.value;
|
|
1275
|
+
return [
|
|
1276
|
+
1,
|
|
1277
|
+
2,
|
|
1278
|
+
-1
|
|
1279
|
+
].map((n) => {
|
|
1280
|
+
let r = t + n, i = e.items.value[r];
|
|
1281
|
+
return !i || !Lt(i) ? null : {
|
|
1282
|
+
index: r,
|
|
1283
|
+
item: i,
|
|
1284
|
+
key: e.getItemKey(i)
|
|
1285
|
+
};
|
|
1286
|
+
}).filter((e) => !!e);
|
|
1287
|
+
}
|
|
1288
|
+
function h() {
|
|
1289
|
+
let t = e.items.value[e.resolvedActiveIndex.value];
|
|
1290
|
+
return !e.active.value || !t || !Lt(t) ? null : e.getItemKey(t);
|
|
1291
|
+
}
|
|
1292
|
+
function g(t) {
|
|
1293
|
+
return e.active.value ? Mt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
|
|
1294
|
+
}
|
|
1295
|
+
function _() {
|
|
1296
|
+
let n = /* @__PURE__ */ new Set(), r = h();
|
|
1297
|
+
r && n.add(r);
|
|
1298
|
+
for (let e of Object.keys(t.value)) n.add(e);
|
|
1299
|
+
for (let t of o) n.has(t) || (y(t), e.onResetAssetState(t));
|
|
1300
|
+
o = n;
|
|
1301
|
+
}
|
|
1302
|
+
function v(e, n) {
|
|
1303
|
+
if (n) {
|
|
1304
|
+
if (t.value[e]) return;
|
|
1305
|
+
t.value = {
|
|
1306
|
+
...t.value,
|
|
1307
|
+
[e]: !0
|
|
1308
|
+
};
|
|
1309
|
+
return;
|
|
1310
|
+
}
|
|
1311
|
+
if (!t.value[e]) return;
|
|
1312
|
+
let r = { ...t.value };
|
|
1313
|
+
delete r[e], t.value = r;
|
|
1314
|
+
}
|
|
1315
|
+
function y(e) {
|
|
1316
|
+
let t = i.get(e);
|
|
1317
|
+
if (t) try {
|
|
1318
|
+
t.removeAttribute("src"), t.src = "";
|
|
1319
|
+
} catch {}
|
|
1320
|
+
let n = a.get(e);
|
|
1321
|
+
if (n) {
|
|
1322
|
+
try {
|
|
1323
|
+
n.currentTime = 0;
|
|
1324
|
+
} catch {}
|
|
1325
|
+
n.pause();
|
|
1326
|
+
try {
|
|
1327
|
+
n.removeAttribute("src"), n.load();
|
|
1328
|
+
} catch {}
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
return {
|
|
1332
|
+
clearBackgroundPreloads: d,
|
|
1333
|
+
registerImageElement: c,
|
|
1334
|
+
registerMediaElement: l,
|
|
1335
|
+
settleBackgroundPreload: u,
|
|
1336
|
+
shouldAttachSlideAsset: s
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
function Pt(e, t, n) {
|
|
1340
|
+
let r = t.get(e);
|
|
1341
|
+
if (r) return Ft(r);
|
|
1342
|
+
let i = n.get(e);
|
|
1343
|
+
return i ? It(i) : !1;
|
|
1344
|
+
}
|
|
1345
|
+
function Ft(e) {
|
|
1346
|
+
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1347
|
+
}
|
|
1348
|
+
function It(e) {
|
|
1349
|
+
let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
1350
|
+
return e.readyState >= t;
|
|
1115
1351
|
}
|
|
1116
|
-
function
|
|
1117
|
-
return
|
|
1352
|
+
function Lt(e) {
|
|
1353
|
+
return e.type === "image" || e.type === "video" || e.type === "audio";
|
|
1118
1354
|
}
|
|
1119
1355
|
//#endregion
|
|
1120
1356
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1357
|
+
function Rt(e) {
|
|
1358
|
+
let t = Nt({
|
|
1359
|
+
active: e.active,
|
|
1360
|
+
getItemKey: r,
|
|
1361
|
+
items: e.items,
|
|
1362
|
+
onResetAssetState: e.viewer.resetAssetState,
|
|
1363
|
+
resolvedActiveIndex: e.resolvedActiveIndex
|
|
1364
|
+
});
|
|
1365
|
+
function n(e, t) {
|
|
1124
1366
|
let n = t.title?.trim();
|
|
1125
|
-
return n ? `${e} ${n}` : `${e} ${
|
|
1367
|
+
return n ? `${e} ${n}` : `${e} ${Et(t.type).toLowerCase()}`;
|
|
1126
1368
|
}
|
|
1127
|
-
function
|
|
1369
|
+
function r(e) {
|
|
1128
1370
|
return $(e);
|
|
1129
1371
|
}
|
|
1130
|
-
function
|
|
1131
|
-
|
|
1132
|
-
return !!e.active.value && t >= n - Tt && t <= n + Et;
|
|
1133
|
-
}
|
|
1134
|
-
function i(t, i) {
|
|
1135
|
-
let a = n(i);
|
|
1136
|
-
return !r(t) || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(a) ? !1 : i.type === "image" ? !e.viewer.isImageReady(a) : i.type === "video" || i.type === "audio" ? !e.viewer.isMediaReady(a) : !1;
|
|
1372
|
+
function i(e) {
|
|
1373
|
+
return t.shouldAttachSlideAsset(e);
|
|
1137
1374
|
}
|
|
1138
|
-
function a(t) {
|
|
1139
|
-
|
|
1375
|
+
function a(t, n) {
|
|
1376
|
+
let a = r(n);
|
|
1377
|
+
return !i(t) || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(a) ? !1 : n.type === "image" ? !e.viewer.isImageReady(a) : n.type === "video" || n.type === "audio" ? !e.viewer.isMediaReady(a) : !1;
|
|
1140
1378
|
}
|
|
1141
1379
|
function o(t) {
|
|
1142
|
-
return e.viewer.
|
|
1380
|
+
return e.viewer.getAssetErrorKind(r(t));
|
|
1143
1381
|
}
|
|
1144
|
-
function s(t
|
|
1145
|
-
return r(t)
|
|
1382
|
+
function s(t) {
|
|
1383
|
+
return e.viewer.getAssetErrorLabel(r(t)) ?? "Load error";
|
|
1146
1384
|
}
|
|
1147
1385
|
function c(t, n) {
|
|
1148
|
-
return
|
|
1386
|
+
return i(t) && t === e.resolvedActiveIndex.value && !!o(n);
|
|
1149
1387
|
}
|
|
1150
|
-
function l(
|
|
1151
|
-
return
|
|
1388
|
+
function l(t, n) {
|
|
1389
|
+
return i(t) ? e.viewer.getImageSource(n) : void 0;
|
|
1390
|
+
}
|
|
1391
|
+
function u(e) {
|
|
1392
|
+
return i(e) ? "metadata" : "none";
|
|
1393
|
+
}
|
|
1394
|
+
function d(e, t) {
|
|
1395
|
+
return i(e) ? t.url : void 0;
|
|
1152
1396
|
}
|
|
1153
1397
|
return {
|
|
1154
|
-
getAssetErrorKind:
|
|
1155
|
-
getAssetErrorLabel:
|
|
1156
|
-
getFullscreenImageSource:
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1398
|
+
getAssetErrorKind: o,
|
|
1399
|
+
getAssetErrorLabel: s,
|
|
1400
|
+
getFullscreenImageSource: l,
|
|
1401
|
+
getFullscreenMediaPreload: u,
|
|
1402
|
+
getFullscreenMediaSource: d,
|
|
1403
|
+
getItemKey: r,
|
|
1404
|
+
getMediaActionLabel: n,
|
|
1405
|
+
isAssetErrored: c,
|
|
1406
|
+
isAssetLoading: a,
|
|
1407
|
+
registerImageElement: t.registerImageElement,
|
|
1408
|
+
registerMediaElement: t.registerMediaElement,
|
|
1409
|
+
settleBackgroundPreload: t.settleBackgroundPreload,
|
|
1410
|
+
shouldPreloadSlideAsset: i
|
|
1163
1411
|
};
|
|
1164
1412
|
}
|
|
1165
1413
|
//#endregion
|
|
1166
1414
|
//#region src/components/viewer-core/slotContent.ts
|
|
1167
|
-
function
|
|
1415
|
+
function zt(e) {
|
|
1168
1416
|
if (!Array.isArray(e)) return !1;
|
|
1169
1417
|
for (let t of e) {
|
|
1170
1418
|
if (Array.isArray(t)) {
|
|
1171
|
-
if (
|
|
1419
|
+
if (zt(t)) return !0;
|
|
1172
1420
|
continue;
|
|
1173
1421
|
}
|
|
1174
|
-
if (!
|
|
1422
|
+
if (!h(t)) {
|
|
1175
1423
|
if (typeof t == "string") {
|
|
1176
1424
|
if (t.trim().length > 0) return !0;
|
|
1177
1425
|
continue;
|
|
@@ -1179,20 +1427,20 @@ function Ot(e) {
|
|
|
1179
1427
|
if (t != null && t !== !1) return !0;
|
|
1180
1428
|
continue;
|
|
1181
1429
|
}
|
|
1182
|
-
if (!
|
|
1430
|
+
if (!Bt(t)) return !0;
|
|
1183
1431
|
}
|
|
1184
1432
|
return !1;
|
|
1185
1433
|
}
|
|
1186
|
-
function
|
|
1187
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1434
|
+
function Bt(r) {
|
|
1435
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !zt(r.children) : !1;
|
|
1188
1436
|
}
|
|
1189
1437
|
//#endregion
|
|
1190
1438
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1191
|
-
var
|
|
1192
|
-
function
|
|
1439
|
+
var Vt = "no items available";
|
|
1440
|
+
function Ht(e) {
|
|
1193
1441
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1194
1442
|
loading: !!e.loading.value,
|
|
1195
|
-
message:
|
|
1443
|
+
message: Vt,
|
|
1196
1444
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1197
1445
|
surface: e.surface,
|
|
1198
1446
|
total: e.itemCount.value
|
|
@@ -1200,23 +1448,23 @@ function jt(e) {
|
|
|
1200
1448
|
return {
|
|
1201
1449
|
emptyStateProps: t,
|
|
1202
1450
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1203
|
-
showCustomEmptyState: i(() =>
|
|
1451
|
+
showCustomEmptyState: i(() => zt(n.value)),
|
|
1204
1452
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1205
1453
|
};
|
|
1206
1454
|
}
|
|
1207
1455
|
//#endregion
|
|
1208
1456
|
//#region src/components/viewer-core/format.ts
|
|
1209
|
-
function
|
|
1457
|
+
function Ut(e) {
|
|
1210
1458
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1211
1459
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1212
1460
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1213
1461
|
}
|
|
1214
1462
|
//#endregion
|
|
1215
1463
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1216
|
-
function
|
|
1464
|
+
function Wt(e) {
|
|
1217
1465
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1218
1466
|
}
|
|
1219
|
-
function
|
|
1467
|
+
function Gt(e) {
|
|
1220
1468
|
return e.phase === "failed" ? {
|
|
1221
1469
|
kind: "failed",
|
|
1222
1470
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1239,17 +1487,17 @@ function Pt(e) {
|
|
|
1239
1487
|
}
|
|
1240
1488
|
//#endregion
|
|
1241
1489
|
//#region src/components/viewer-core/useActivation.ts
|
|
1242
|
-
function
|
|
1490
|
+
function Kt(e) {
|
|
1243
1491
|
let t = !1;
|
|
1244
|
-
|
|
1492
|
+
L(e.enabled, async (t) => {
|
|
1245
1493
|
if (n(t), t) {
|
|
1246
1494
|
e.onResize(), await e.onEnable();
|
|
1247
1495
|
return;
|
|
1248
1496
|
}
|
|
1249
1497
|
e.onDisable();
|
|
1250
|
-
}, { immediate: !0 }),
|
|
1498
|
+
}, { immediate: !0 }), S(() => {
|
|
1251
1499
|
e.onResize(), e.enabled.value && e.onEnable();
|
|
1252
|
-
}),
|
|
1500
|
+
}), x(() => {
|
|
1253
1501
|
n(!1), e.onDisable();
|
|
1254
1502
|
});
|
|
1255
1503
|
function n(n) {
|
|
@@ -1262,7 +1510,7 @@ function Ft(e) {
|
|
|
1262
1510
|
}
|
|
1263
1511
|
//#endregion
|
|
1264
1512
|
//#region src/components/viewer-core/assetState.ts
|
|
1265
|
-
var
|
|
1513
|
+
var qt = {
|
|
1266
1514
|
currentTime: 0,
|
|
1267
1515
|
duration: 0,
|
|
1268
1516
|
errorKind: null,
|
|
@@ -1271,38 +1519,38 @@ var It = {
|
|
|
1271
1519
|
ready: !1,
|
|
1272
1520
|
volume: 1
|
|
1273
1521
|
};
|
|
1274
|
-
function
|
|
1275
|
-
return { ...
|
|
1522
|
+
function Jt() {
|
|
1523
|
+
return { ...qt };
|
|
1276
1524
|
}
|
|
1277
|
-
function
|
|
1525
|
+
function Yt(e) {
|
|
1278
1526
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1279
1527
|
}
|
|
1280
|
-
function
|
|
1281
|
-
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready =
|
|
1528
|
+
function Xt(e, t, n) {
|
|
1529
|
+
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready = Zt(t, n);
|
|
1282
1530
|
}
|
|
1283
|
-
function
|
|
1531
|
+
function Zt(e, t) {
|
|
1284
1532
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1285
1533
|
}
|
|
1286
1534
|
//#endregion
|
|
1287
1535
|
//#region src/components/viewer-core/loadError.ts
|
|
1288
|
-
var
|
|
1289
|
-
function
|
|
1536
|
+
var Qt = /* @__PURE__ */ new Map();
|
|
1537
|
+
function $t(e) {
|
|
1290
1538
|
return e === "not-found" ? "404" : "Load error";
|
|
1291
1539
|
}
|
|
1292
|
-
function
|
|
1540
|
+
function en(e) {
|
|
1293
1541
|
return e === "generic";
|
|
1294
1542
|
}
|
|
1295
|
-
function
|
|
1296
|
-
return
|
|
1543
|
+
function tn(e) {
|
|
1544
|
+
return nn(e).then((e) => e ?? "generic");
|
|
1297
1545
|
}
|
|
1298
|
-
function
|
|
1299
|
-
let t =
|
|
1546
|
+
function nn(e) {
|
|
1547
|
+
let t = Qt.get(e);
|
|
1300
1548
|
if (t) return t;
|
|
1301
|
-
let n =
|
|
1302
|
-
return
|
|
1549
|
+
let n = rn(e);
|
|
1550
|
+
return Qt.set(e, n), n;
|
|
1303
1551
|
}
|
|
1304
|
-
async function
|
|
1305
|
-
if (!
|
|
1552
|
+
async function rn(e) {
|
|
1553
|
+
if (!an(e)) return null;
|
|
1306
1554
|
try {
|
|
1307
1555
|
let t = await fetch(e, { method: "HEAD" });
|
|
1308
1556
|
return t.ok ? null : t.status === 404 ? "not-found" : "generic";
|
|
@@ -1310,12 +1558,12 @@ async function Kt(e) {
|
|
|
1310
1558
|
return "generic";
|
|
1311
1559
|
}
|
|
1312
1560
|
}
|
|
1313
|
-
function
|
|
1561
|
+
function an(e) {
|
|
1314
1562
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1315
1563
|
}
|
|
1316
1564
|
//#endregion
|
|
1317
1565
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1318
|
-
function
|
|
1566
|
+
function on(e) {
|
|
1319
1567
|
try {
|
|
1320
1568
|
let t = e.play();
|
|
1321
1569
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1323,18 +1571,18 @@ function Jt(e) {
|
|
|
1323
1571
|
}
|
|
1324
1572
|
//#endregion
|
|
1325
1573
|
//#region src/components/viewer-core/useMedia.ts
|
|
1326
|
-
function
|
|
1327
|
-
let t =
|
|
1574
|
+
function sn(e) {
|
|
1575
|
+
let t = D({}), n = D({}), r = D({}), a = D({}), o = D({}), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = i(() => e.activeItem.value ? $(e.activeItem.value) : null), d = i(() => e.activeMediaItem.value ? $(e.activeMediaItem.value) : null), f = i(() => {
|
|
1328
1576
|
let t = /* @__PURE__ */ new Map();
|
|
1329
1577
|
for (let n of e.items.value) t.set($(n), n);
|
|
1330
1578
|
return t;
|
|
1331
|
-
}), p = i(() => d.value ? r.value[d.value] ??
|
|
1332
|
-
|
|
1333
|
-
await
|
|
1334
|
-
}),
|
|
1335
|
-
await
|
|
1336
|
-
}),
|
|
1337
|
-
await
|
|
1579
|
+
}), p = i(() => d.value ? r.value[d.value] ?? qt : qt), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : cn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
|
|
1580
|
+
L(() => u.value, async () => {
|
|
1581
|
+
await C();
|
|
1582
|
+
}), L(() => e.itemCount.value, async () => {
|
|
1583
|
+
await C();
|
|
1584
|
+
}), L(() => e.loopFullscreenVideo.value, async () => {
|
|
1585
|
+
await C();
|
|
1338
1586
|
});
|
|
1339
1587
|
function v(e, t) {
|
|
1340
1588
|
if (t instanceof HTMLVideoElement) {
|
|
@@ -1351,49 +1599,54 @@ function Yt(e) {
|
|
|
1351
1599
|
c.delete(e);
|
|
1352
1600
|
}
|
|
1353
1601
|
function b(e, r) {
|
|
1354
|
-
r instanceof HTMLImageElement &&
|
|
1602
|
+
r instanceof HTMLImageElement && Yt(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
|
|
1355
1603
|
}
|
|
1356
1604
|
function x() {
|
|
1357
1605
|
H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
|
|
1358
1606
|
}
|
|
1359
|
-
|
|
1607
|
+
function S(e) {
|
|
1608
|
+
delete t.value[e], delete n.value[e], delete o.value[e], delete r.value[e], l.forEach((t) => {
|
|
1609
|
+
t.startsWith(`${e}|`) && l.delete(t);
|
|
1610
|
+
});
|
|
1611
|
+
}
|
|
1612
|
+
async function C() {
|
|
1360
1613
|
if (!e.isEnabled.value) {
|
|
1361
1614
|
H();
|
|
1362
1615
|
return;
|
|
1363
1616
|
}
|
|
1364
|
-
await
|
|
1617
|
+
await _();
|
|
1365
1618
|
let t = u.value;
|
|
1366
1619
|
for (let [n, i] of s.entries()) {
|
|
1367
1620
|
if (n !== t || r.value[n]?.errorKind) {
|
|
1368
1621
|
V(i, n);
|
|
1369
1622
|
continue;
|
|
1370
1623
|
}
|
|
1371
|
-
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0,
|
|
1624
|
+
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, on(i), W(n, i);
|
|
1372
1625
|
}
|
|
1373
1626
|
for (let [e, n] of c.entries()) {
|
|
1374
1627
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1375
1628
|
V(n, e);
|
|
1376
1629
|
continue;
|
|
1377
1630
|
}
|
|
1378
|
-
|
|
1631
|
+
on(n), W(e, n);
|
|
1379
1632
|
}
|
|
1380
1633
|
}
|
|
1381
|
-
function
|
|
1634
|
+
function w(e, t) {
|
|
1382
1635
|
let n = t.currentTarget instanceof HTMLMediaElement ? t.currentTarget : t.target instanceof HTMLMediaElement ? t.target : null;
|
|
1383
1636
|
if (n) {
|
|
1384
1637
|
let i = r.value[e]?.ready ?? !1;
|
|
1385
1638
|
W(e, n, t.type);
|
|
1386
1639
|
let a = r.value[e]?.ready ?? !1;
|
|
1387
|
-
!i && a &&
|
|
1640
|
+
!i && a && J(e, n.currentSrc || n.src || ie(e));
|
|
1388
1641
|
}
|
|
1389
1642
|
}
|
|
1390
|
-
function
|
|
1391
|
-
t.value[e] = !0, n.value[e] = null,
|
|
1643
|
+
function T(e, r) {
|
|
1644
|
+
t.value[e] = !0, n.value[e] = null, J(e, r);
|
|
1392
1645
|
}
|
|
1393
1646
|
async function E(r, i) {
|
|
1394
1647
|
let a = Y(r) ?? e.activeItem.value;
|
|
1395
1648
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1396
|
-
let o = await
|
|
1649
|
+
let o = await tn(i);
|
|
1397
1650
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1398
1651
|
item: a,
|
|
1399
1652
|
occurrenceKey: r,
|
|
@@ -1402,7 +1655,7 @@ function Yt(e) {
|
|
|
1402
1655
|
surface: "fullscreen"
|
|
1403
1656
|
});
|
|
1404
1657
|
}
|
|
1405
|
-
async function
|
|
1658
|
+
async function O(t, n) {
|
|
1406
1659
|
let r = K(t), i = U(t), a = Y(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1407
1660
|
if (r) {
|
|
1408
1661
|
r.pause();
|
|
@@ -1411,7 +1664,7 @@ function Yt(e) {
|
|
|
1411
1664
|
} catch {}
|
|
1412
1665
|
}
|
|
1413
1666
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1414
|
-
let o = await
|
|
1667
|
+
let o = await tn(n);
|
|
1415
1668
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1416
1669
|
item: a,
|
|
1417
1670
|
occurrenceKey: t,
|
|
@@ -1420,61 +1673,61 @@ function Yt(e) {
|
|
|
1420
1673
|
surface: "fullscreen"
|
|
1421
1674
|
});
|
|
1422
1675
|
}
|
|
1423
|
-
function O(e, t, n) {
|
|
1424
|
-
e.button !== 0 || Date.now() < n || J(s.get(t) ?? null);
|
|
1425
|
-
}
|
|
1426
1676
|
function k(e, t, n) {
|
|
1427
|
-
e.button !== 0 || Date.now() < n ||
|
|
1677
|
+
e.button !== 0 || Date.now() < n || re(s.get(t) ?? null);
|
|
1678
|
+
}
|
|
1679
|
+
function A(e, t, n) {
|
|
1680
|
+
e.button !== 0 || Date.now() < n || re(K(t));
|
|
1428
1681
|
}
|
|
1429
|
-
function
|
|
1682
|
+
function j(e) {
|
|
1430
1683
|
let t = q(), n = d.value;
|
|
1431
1684
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1432
1685
|
let r = Number.parseFloat(e.target.value);
|
|
1433
1686
|
if (!Number.isFinite(r)) return;
|
|
1434
|
-
let i =
|
|
1435
|
-
|
|
1687
|
+
let i = cn(r, 0, m.value || 0);
|
|
1688
|
+
ne(n, i, t), t.currentTime = i;
|
|
1436
1689
|
}
|
|
1437
|
-
function
|
|
1690
|
+
function M(e) {
|
|
1438
1691
|
let t = q(), n = d.value;
|
|
1439
1692
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1440
|
-
let r =
|
|
1693
|
+
let r = cn(Number.parseFloat(e.target.value), 0, 1);
|
|
1441
1694
|
t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
|
|
1442
1695
|
}
|
|
1443
|
-
function
|
|
1696
|
+
function N() {
|
|
1444
1697
|
let e = q(), t = d.value;
|
|
1445
|
-
!e || !t || (e.muted || e.volume <= 0 ? (e.volume =
|
|
1698
|
+
!e || !t || (e.muted || e.volume <= 0 ? (e.volume = G(t), e.muted = !1, o.value[t] = e.volume) : (o.value[t] = e.volume, e.muted = !0), W(t, e));
|
|
1446
1699
|
}
|
|
1447
|
-
function
|
|
1700
|
+
function P(e) {
|
|
1448
1701
|
return !!t.value[e] && !n.value[e];
|
|
1449
1702
|
}
|
|
1450
|
-
function
|
|
1703
|
+
function F(e) {
|
|
1451
1704
|
return (r.value[e]?.ready ?? !1) && !r.value[e]?.errorKind;
|
|
1452
1705
|
}
|
|
1453
1706
|
function I(e) {
|
|
1454
1707
|
return e.url;
|
|
1455
1708
|
}
|
|
1456
|
-
function L(e) {
|
|
1457
|
-
return n.value[e] ?? r.value[e]?.errorKind ?? null;
|
|
1458
|
-
}
|
|
1459
1709
|
function R(e) {
|
|
1460
|
-
|
|
1461
|
-
return t ? Ht(t) : null;
|
|
1710
|
+
return n.value[e] ?? r.value[e]?.errorKind ?? null;
|
|
1462
1711
|
}
|
|
1463
1712
|
function z(e) {
|
|
1464
|
-
|
|
1713
|
+
let t = R(e);
|
|
1714
|
+
return t ? $t(t) : null;
|
|
1465
1715
|
}
|
|
1466
1716
|
function B(e) {
|
|
1717
|
+
return en(R(e));
|
|
1718
|
+
}
|
|
1719
|
+
function ee(e) {
|
|
1467
1720
|
return `${e}:${a.value[e] ?? 0}`;
|
|
1468
1721
|
}
|
|
1469
|
-
async function
|
|
1470
|
-
if (!
|
|
1722
|
+
async function te(e) {
|
|
1723
|
+
if (!B(e)) return;
|
|
1471
1724
|
t.value[e] = !1, n.value[e] = null;
|
|
1472
1725
|
let r = U(e);
|
|
1473
1726
|
r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
|
|
1474
1727
|
let i = K(e);
|
|
1475
1728
|
i && V(i, e), l.forEach((t) => {
|
|
1476
1729
|
t.startsWith(`${e}|`) && l.delete(t);
|
|
1477
|
-
}), a.value[e] = (a.value[e] ?? 0) + 1, await
|
|
1730
|
+
}), a.value[e] = (a.value[e] ?? 0) + 1, await _(), await C();
|
|
1478
1731
|
}
|
|
1479
1732
|
function V(e, t) {
|
|
1480
1733
|
e.pause();
|
|
@@ -1488,17 +1741,17 @@ function Yt(e) {
|
|
|
1488
1741
|
for (let [e, t] of c.entries()) V(t, e);
|
|
1489
1742
|
}
|
|
1490
1743
|
function U(e) {
|
|
1491
|
-
return r.value[e] || (r.value[e] =
|
|
1744
|
+
return r.value[e] || (r.value[e] = Jt()), r.value[e];
|
|
1492
1745
|
}
|
|
1493
1746
|
function W(e, t, n) {
|
|
1494
|
-
|
|
1747
|
+
Xt(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
|
|
1495
1748
|
}
|
|
1496
|
-
function
|
|
1749
|
+
function ne(e, t, n) {
|
|
1497
1750
|
let r = U(e);
|
|
1498
1751
|
r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.muted = n.muted, r.paused = n.paused, r.volume = Number.isFinite(n.volume) ? n.volume : r.volume;
|
|
1499
1752
|
}
|
|
1500
|
-
function
|
|
1501
|
-
return
|
|
1753
|
+
function G(e) {
|
|
1754
|
+
return cn(o.value[e] ?? 1, 0, 1);
|
|
1502
1755
|
}
|
|
1503
1756
|
function K(e) {
|
|
1504
1757
|
return s.get(e) ?? c.get(e) ?? null;
|
|
@@ -1506,16 +1759,16 @@ function Yt(e) {
|
|
|
1506
1759
|
function q() {
|
|
1507
1760
|
return d.value ? K(d.value) : null;
|
|
1508
1761
|
}
|
|
1509
|
-
function
|
|
1762
|
+
function re(e) {
|
|
1510
1763
|
if (e) {
|
|
1511
1764
|
if (e.paused) {
|
|
1512
|
-
|
|
1765
|
+
on(e);
|
|
1513
1766
|
return;
|
|
1514
1767
|
}
|
|
1515
1768
|
e.pause();
|
|
1516
1769
|
}
|
|
1517
1770
|
}
|
|
1518
|
-
function
|
|
1771
|
+
function J(t, n) {
|
|
1519
1772
|
let r = Y(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1520
1773
|
if (!r || !n) return;
|
|
1521
1774
|
let i = `${t}|${n}`;
|
|
@@ -1529,43 +1782,44 @@ function Yt(e) {
|
|
|
1529
1782
|
function Y(e) {
|
|
1530
1783
|
return f.value.get(e) ?? null;
|
|
1531
1784
|
}
|
|
1532
|
-
function
|
|
1785
|
+
function ie(e) {
|
|
1533
1786
|
return Y(e)?.url ?? null;
|
|
1534
1787
|
}
|
|
1535
1788
|
return {
|
|
1536
|
-
activeAssetErrorKind:
|
|
1789
|
+
activeAssetErrorKind: g,
|
|
1537
1790
|
activeMediaDuration: m,
|
|
1538
1791
|
activeMediaProgress: h,
|
|
1539
1792
|
activeMediaState: p,
|
|
1540
|
-
getAssetErrorKind:
|
|
1541
|
-
getAssetErrorLabel:
|
|
1542
|
-
getAssetRenderKey:
|
|
1793
|
+
getAssetErrorKind: R,
|
|
1794
|
+
getAssetErrorLabel: z,
|
|
1795
|
+
getAssetRenderKey: ee,
|
|
1543
1796
|
getImageSource: I,
|
|
1544
|
-
isImageReady:
|
|
1545
|
-
isMediaReady:
|
|
1546
|
-
canRetryAsset:
|
|
1797
|
+
isImageReady: P,
|
|
1798
|
+
isMediaReady: F,
|
|
1799
|
+
canRetryAsset: B,
|
|
1547
1800
|
mediaStates: r,
|
|
1548
|
-
onAudioCoverClick:
|
|
1801
|
+
onAudioCoverClick: A,
|
|
1549
1802
|
onImageError: E,
|
|
1550
|
-
onImageLoad:
|
|
1551
|
-
onMediaError:
|
|
1552
|
-
onMediaEvent:
|
|
1553
|
-
onMediaSeekInput:
|
|
1554
|
-
onMediaVolumeInput:
|
|
1555
|
-
onMediaVolumeToggle:
|
|
1556
|
-
onVideoClick:
|
|
1803
|
+
onImageLoad: T,
|
|
1804
|
+
onMediaError: O,
|
|
1805
|
+
onMediaEvent: w,
|
|
1806
|
+
onMediaSeekInput: j,
|
|
1807
|
+
onMediaVolumeInput: M,
|
|
1808
|
+
onMediaVolumeToggle: N,
|
|
1809
|
+
onVideoClick: k,
|
|
1557
1810
|
registerAudioElement: y,
|
|
1558
1811
|
registerImageElement: b,
|
|
1559
1812
|
registerVideoElement: v,
|
|
1813
|
+
resetAssetState: S,
|
|
1560
1814
|
resetMediaState: x,
|
|
1561
|
-
retryAsset:
|
|
1562
|
-
syncMediaPlayback:
|
|
1815
|
+
retryAsset: te,
|
|
1816
|
+
syncMediaPlayback: C
|
|
1563
1817
|
};
|
|
1564
1818
|
}
|
|
1565
|
-
function
|
|
1819
|
+
function cn(e, t, n) {
|
|
1566
1820
|
return Math.min(Math.max(e, t), n);
|
|
1567
1821
|
}
|
|
1568
|
-
function
|
|
1822
|
+
function ln(e, t, n = 2) {
|
|
1569
1823
|
return t <= 0 ? {
|
|
1570
1824
|
start: 0,
|
|
1571
1825
|
end: -1
|
|
@@ -1574,14 +1828,14 @@ function Zt(e, t, n = 2) {
|
|
|
1574
1828
|
end: Math.min(t - 1, e + n)
|
|
1575
1829
|
};
|
|
1576
1830
|
}
|
|
1577
|
-
function
|
|
1578
|
-
let r =
|
|
1831
|
+
function un(e, t, n = 2) {
|
|
1832
|
+
let r = ln(t, e.length, n);
|
|
1579
1833
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1580
1834
|
item: e,
|
|
1581
1835
|
index: r.start + t
|
|
1582
1836
|
}));
|
|
1583
1837
|
}
|
|
1584
|
-
function
|
|
1838
|
+
function dn(e, t, n, r, i) {
|
|
1585
1839
|
return {
|
|
1586
1840
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1587
1841
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1589,12 +1843,12 @@ function $t(e, t, n, r, i) {
|
|
|
1589
1843
|
}
|
|
1590
1844
|
//#endregion
|
|
1591
1845
|
//#region src/components/viewer-core/useViewer.ts
|
|
1592
|
-
function
|
|
1593
|
-
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() =>
|
|
1846
|
+
function fn(e, t, n = {}) {
|
|
1847
|
+
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => Wt({
|
|
1594
1848
|
itemCount: r.value.length,
|
|
1595
1849
|
loading: s.value,
|
|
1596
1850
|
phase: e.phase
|
|
1597
|
-
})), f = i(() => !1), p =
|
|
1851
|
+
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T = sn({
|
|
1598
1852
|
items: r,
|
|
1599
1853
|
activeItem: C,
|
|
1600
1854
|
activeMediaItem: w,
|
|
@@ -1603,22 +1857,22 @@ function en(e, t, n = {}) {
|
|
|
1603
1857
|
loopFullscreenVideo: l,
|
|
1604
1858
|
onAssetError: n.onAssetError,
|
|
1605
1859
|
onAssetLoad: n.onAssetLoad
|
|
1606
|
-
}),
|
|
1860
|
+
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Gt({
|
|
1607
1861
|
errorMessage: o.value,
|
|
1608
1862
|
hasItems: r.value.length > 0,
|
|
1609
1863
|
hasNextPage: c.value,
|
|
1610
1864
|
phase: d.value,
|
|
1611
1865
|
surface: "fullscreen"
|
|
1612
|
-
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() =>
|
|
1613
|
-
|
|
1866
|
+
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => ln(S.value, r.value.length)), N = i(() => un(r.value, S.value));
|
|
1867
|
+
Kt({
|
|
1614
1868
|
enabled: _,
|
|
1615
1869
|
onDisable() {
|
|
1616
|
-
|
|
1870
|
+
H(), T.resetMediaState();
|
|
1617
1871
|
},
|
|
1618
1872
|
onEnable() {
|
|
1619
|
-
return
|
|
1873
|
+
return T.syncMediaPlayback();
|
|
1620
1874
|
},
|
|
1621
|
-
onKeydown:
|
|
1875
|
+
onKeydown: W,
|
|
1622
1876
|
onResize: F
|
|
1623
1877
|
});
|
|
1624
1878
|
function P(e, t, n) {
|
|
@@ -1640,103 +1894,104 @@ function en(e, t, n = {}) {
|
|
|
1640
1894
|
return t && !I(-1) || n && !I(1) ? e * .24 : e;
|
|
1641
1895
|
}
|
|
1642
1896
|
function z(e) {
|
|
1643
|
-
!_.value || r.value.length === 0 || e.pointerType === "mouse" ||
|
|
1897
|
+
!_.value || r.value.length === 0 || e.pointerType === "mouse" || he(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
|
|
1644
1898
|
}
|
|
1645
1899
|
function B(e) {
|
|
1646
1900
|
!_.value || !h.value || v !== e.pointerId || (m.value = R(e.clientY - y));
|
|
1647
1901
|
}
|
|
1648
1902
|
function ee(e) {
|
|
1903
|
+
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), V());
|
|
1904
|
+
}
|
|
1905
|
+
function te(e) {
|
|
1649
1906
|
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), H());
|
|
1650
1907
|
}
|
|
1651
|
-
function V(
|
|
1652
|
-
|
|
1908
|
+
function V() {
|
|
1909
|
+
Math.abs(m.value) >= j.value && (x = Date.now() + 250, L(m.value < 0 ? 1 : -1)), H();
|
|
1653
1910
|
}
|
|
1654
1911
|
function H() {
|
|
1655
|
-
Math.abs(m.value) >= j.value && (x = Date.now() + 250, L(m.value < 0 ? 1 : -1)), U();
|
|
1656
|
-
}
|
|
1657
|
-
function U() {
|
|
1658
1912
|
m.value = 0, h.value = !1, v = null;
|
|
1659
1913
|
}
|
|
1660
|
-
function
|
|
1661
|
-
if (!_.value || r.value.length === 0 || h.value ||
|
|
1914
|
+
function U(e) {
|
|
1915
|
+
if (!_.value || r.value.length === 0 || h.value || he(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
|
|
1662
1916
|
e.preventDefault();
|
|
1663
1917
|
let t = Date.now();
|
|
1664
1918
|
t < b || (b = t + 400, L(e.deltaY > 0 ? 1 : -1));
|
|
1665
1919
|
}
|
|
1666
|
-
function
|
|
1667
|
-
!_.value || r.value.length === 0 ||
|
|
1920
|
+
function W(e) {
|
|
1921
|
+
!_.value || r.value.length === 0 || me(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), L(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), L(-1)));
|
|
1668
1922
|
}
|
|
1669
|
-
function
|
|
1670
|
-
|
|
1923
|
+
function ne(e, t) {
|
|
1924
|
+
T.onVideoClick(e, t, x);
|
|
1671
1925
|
}
|
|
1672
|
-
function
|
|
1673
|
-
|
|
1926
|
+
function G(e, t) {
|
|
1927
|
+
T.onAudioCoverClick(e, t, x);
|
|
1674
1928
|
}
|
|
1675
|
-
function
|
|
1676
|
-
|
|
1929
|
+
function K(e) {
|
|
1930
|
+
T.onMediaSeekInput(e);
|
|
1677
1931
|
}
|
|
1678
|
-
function
|
|
1679
|
-
|
|
1932
|
+
function q(e) {
|
|
1933
|
+
T.onMediaVolumeInput(e);
|
|
1680
1934
|
}
|
|
1681
|
-
function
|
|
1682
|
-
|
|
1935
|
+
function re() {
|
|
1936
|
+
T.onMediaVolumeToggle();
|
|
1683
1937
|
}
|
|
1684
|
-
function
|
|
1938
|
+
function J(e) {
|
|
1685
1939
|
return e.type === "image" || e.type === "video";
|
|
1686
1940
|
}
|
|
1687
|
-
function
|
|
1941
|
+
function Y(e) {
|
|
1688
1942
|
return e.type === "audio";
|
|
1689
1943
|
}
|
|
1690
|
-
function
|
|
1691
|
-
return
|
|
1944
|
+
function ie(e) {
|
|
1945
|
+
return dn(e, S.value, g.value, m.value, h.value);
|
|
1692
1946
|
}
|
|
1693
1947
|
return {
|
|
1694
1948
|
activeItem: C,
|
|
1695
|
-
activeAssetErrorKind:
|
|
1696
|
-
activeMediaDuration:
|
|
1949
|
+
activeAssetErrorKind: T.activeAssetErrorKind,
|
|
1950
|
+
activeMediaDuration: T.activeMediaDuration,
|
|
1697
1951
|
activeMediaItem: w,
|
|
1698
|
-
activeMediaProgress:
|
|
1699
|
-
activeMediaState:
|
|
1700
|
-
canRetryAsset:
|
|
1952
|
+
activeMediaProgress: T.activeMediaProgress,
|
|
1953
|
+
activeMediaState: T.activeMediaState,
|
|
1954
|
+
canRetryAsset: T.canRetryAsset,
|
|
1701
1955
|
canRetryInitialLoad: f,
|
|
1702
1956
|
errorMessage: o,
|
|
1703
|
-
getAssetErrorKind:
|
|
1704
|
-
getAssetErrorLabel:
|
|
1705
|
-
getAssetRenderKey:
|
|
1706
|
-
formatPlaybackTime:
|
|
1707
|
-
getImageSource:
|
|
1708
|
-
getSlideStyle:
|
|
1957
|
+
getAssetErrorKind: T.getAssetErrorKind,
|
|
1958
|
+
getAssetErrorLabel: T.getAssetErrorLabel,
|
|
1959
|
+
getAssetRenderKey: T.getAssetRenderKey,
|
|
1960
|
+
formatPlaybackTime: Ut,
|
|
1961
|
+
getImageSource: T.getImageSource,
|
|
1962
|
+
getSlideStyle: ie,
|
|
1709
1963
|
hasNextPage: c,
|
|
1710
|
-
isAtEnd:
|
|
1711
|
-
isAudio:
|
|
1712
|
-
isVisual:
|
|
1964
|
+
isAtEnd: E,
|
|
1965
|
+
isAudio: Y,
|
|
1966
|
+
isVisual: J,
|
|
1713
1967
|
items: r,
|
|
1714
1968
|
loading: s,
|
|
1715
|
-
mediaStates:
|
|
1716
|
-
isImageReady:
|
|
1717
|
-
isMediaReady:
|
|
1718
|
-
onAudioCoverClick:
|
|
1719
|
-
onImageError:
|
|
1720
|
-
onImageLoad:
|
|
1721
|
-
onMediaEvent:
|
|
1722
|
-
onMediaError:
|
|
1723
|
-
onMediaSeekInput:
|
|
1724
|
-
onMediaVolumeInput:
|
|
1725
|
-
onMediaVolumeToggle:
|
|
1726
|
-
onPointerCancel:
|
|
1969
|
+
mediaStates: T.mediaStates,
|
|
1970
|
+
isImageReady: T.isImageReady,
|
|
1971
|
+
isMediaReady: T.isMediaReady,
|
|
1972
|
+
onAudioCoverClick: G,
|
|
1973
|
+
onImageError: T.onImageError,
|
|
1974
|
+
onImageLoad: T.onImageLoad,
|
|
1975
|
+
onMediaEvent: T.onMediaEvent,
|
|
1976
|
+
onMediaError: T.onMediaError,
|
|
1977
|
+
onMediaSeekInput: K,
|
|
1978
|
+
onMediaVolumeInput: q,
|
|
1979
|
+
onMediaVolumeToggle: re,
|
|
1980
|
+
onPointerCancel: te,
|
|
1727
1981
|
onPointerDown: z,
|
|
1728
1982
|
onPointerMove: B,
|
|
1729
1983
|
onPointerUp: ee,
|
|
1730
|
-
onVideoClick:
|
|
1731
|
-
onWheel:
|
|
1732
|
-
registerAudioElement:
|
|
1733
|
-
registerImageElement:
|
|
1734
|
-
registerVideoElement:
|
|
1984
|
+
onVideoClick: ne,
|
|
1985
|
+
onWheel: U,
|
|
1986
|
+
registerAudioElement: T.registerAudioElement,
|
|
1987
|
+
registerImageElement: T.registerImageElement,
|
|
1988
|
+
registerVideoElement: T.registerVideoElement,
|
|
1735
1989
|
renderedItems: N,
|
|
1736
1990
|
renderedRange: M,
|
|
1737
1991
|
resolvedActiveIndex: S,
|
|
1992
|
+
resetAssetState: T.resetAssetState,
|
|
1738
1993
|
retryInitialLoad: async () => {},
|
|
1739
|
-
retryAsset:
|
|
1994
|
+
retryAsset: T.retryAsset,
|
|
1740
1995
|
stageRef: p,
|
|
1741
1996
|
statusKind: k,
|
|
1742
1997
|
statusMessage: A,
|
|
@@ -1746,21 +2001,21 @@ function en(e, t, n = {}) {
|
|
|
1746
2001
|
}
|
|
1747
2002
|
//#endregion
|
|
1748
2003
|
//#region src/components/viewer-core/theme.ts
|
|
1749
|
-
var
|
|
2004
|
+
var pn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", mn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", hn = {
|
|
1750
2005
|
image: !0,
|
|
1751
2006
|
video: !0,
|
|
1752
2007
|
audio: !0,
|
|
1753
2008
|
other: !0
|
|
1754
2009
|
};
|
|
1755
|
-
function
|
|
1756
|
-
return
|
|
2010
|
+
function gn(e) {
|
|
2011
|
+
return hn[e], pn;
|
|
1757
2012
|
}
|
|
1758
|
-
function
|
|
1759
|
-
return
|
|
2013
|
+
function _n(e) {
|
|
2014
|
+
return hn[e], mn;
|
|
1760
2015
|
}
|
|
1761
2016
|
//#endregion
|
|
1762
2017
|
//#region src/components/viewer-core/dominantImageTone.ts
|
|
1763
|
-
function
|
|
2018
|
+
function vn(e) {
|
|
1764
2019
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
1765
2020
|
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
1766
2021
|
if (!n) return null;
|
|
@@ -1775,21 +2030,21 @@ function sn(e) {
|
|
|
1775
2030
|
r += d, i += s * d, a += c * d, o += l * d;
|
|
1776
2031
|
}
|
|
1777
2032
|
return r <= 0 ? null : {
|
|
1778
|
-
r:
|
|
1779
|
-
g:
|
|
1780
|
-
b:
|
|
2033
|
+
r: yn(Math.round(i / r)),
|
|
2034
|
+
g: yn(Math.round(a / r)),
|
|
2035
|
+
b: yn(Math.round(o / r))
|
|
1781
2036
|
};
|
|
1782
2037
|
} catch {
|
|
1783
2038
|
return null;
|
|
1784
2039
|
}
|
|
1785
2040
|
}
|
|
1786
|
-
function
|
|
2041
|
+
function yn(e) {
|
|
1787
2042
|
return Math.min(235, Math.max(26, e));
|
|
1788
2043
|
}
|
|
1789
2044
|
//#endregion
|
|
1790
2045
|
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
1791
|
-
function
|
|
1792
|
-
let t =
|
|
2046
|
+
function bn(e) {
|
|
2047
|
+
let t = D({}), n = i(() => e.activeItem.value ? e.getItemKey(e.activeItem.value) : null), r = i(() => !e.showDominantImageTone.value || e.activeItem.value?.type !== "image" || !n.value || !e.isImageReady(n.value) ? null : t.value[n.value] ?? null), a = i(() => {
|
|
1793
2048
|
if (!r.value) return;
|
|
1794
2049
|
let { r: e, g: t, b: n } = r.value;
|
|
1795
2050
|
return { background: `radial-gradient(circle at top center, rgba(${e},${t},${n},0.34) 0%, transparent 44%), linear-gradient(180deg,#0a0b10,#05060a)` };
|
|
@@ -1798,12 +2053,12 @@ function ln(e) {
|
|
|
1798
2053
|
let { r: e, g: t, b: n } = r.value;
|
|
1799
2054
|
return { background: `radial-gradient(circle at center, rgba(${e},${t},${n},0.42) 0%, transparent 44%), linear-gradient(180deg,#0b0c11,#06070b)` };
|
|
1800
2055
|
});
|
|
1801
|
-
|
|
2056
|
+
L(() => e.showDominantImageTone.value, (e) => {
|
|
1802
2057
|
e || (t.value = {});
|
|
1803
2058
|
});
|
|
1804
2059
|
function s(n, r) {
|
|
1805
2060
|
if (!e.showDominantImageTone.value) return;
|
|
1806
|
-
let i =
|
|
2061
|
+
let i = vn(r);
|
|
1807
2062
|
i && (t.value[n] = i);
|
|
1808
2063
|
}
|
|
1809
2064
|
return {
|
|
@@ -1814,7 +2069,7 @@ function ln(e) {
|
|
|
1814
2069
|
}
|
|
1815
2070
|
//#endregion
|
|
1816
2071
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
1817
|
-
var
|
|
2072
|
+
var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
1818
2073
|
inheritAttrs: !1,
|
|
1819
2074
|
__name: "SurfaceEmptyState",
|
|
1820
2075
|
props: {
|
|
@@ -1823,36 +2078,36 @@ var un = ["data-surface"], dn = ["data-surface"], fn = /* @__PURE__ */ d({
|
|
|
1823
2078
|
surface: {}
|
|
1824
2079
|
},
|
|
1825
2080
|
setup(e) {
|
|
1826
|
-
let t =
|
|
1827
|
-
return (n, r) => e.mode === "inline" ? (
|
|
2081
|
+
let t = P();
|
|
2082
|
+
return (n, r) => e.mode === "inline" ? (w(), s("div", g({ key: 0 }, N(t), {
|
|
1828
2083
|
"data-testid": "vibe-empty-state-inline",
|
|
1829
2084
|
"data-surface": e.surface,
|
|
1830
2085
|
class: ["pointer-events-none absolute z-[4] text-center", e.surface === "grid" ? "inset-x-0 top-[clamp(6rem,22vh,11rem)] flex justify-center px-6" : "inset-0 grid place-items-center px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)]"]
|
|
1831
|
-
}), [
|
|
2086
|
+
}), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, xn)) : (w(), s("div", g({ key: 1 }, N(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
|
|
1832
2087
|
"data-testid": "vibe-empty-state-badge",
|
|
1833
2088
|
"data-surface": e.surface,
|
|
1834
|
-
class:
|
|
1835
|
-
},
|
|
2089
|
+
class: v(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
|
|
2090
|
+
}, j(e.message), 11, Sn)])], 16));
|
|
1836
2091
|
}
|
|
1837
|
-
}),
|
|
2092
|
+
}), wn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Tn = {
|
|
1838
2093
|
key: 0,
|
|
1839
2094
|
class: "relative h-full min-h-0"
|
|
1840
|
-
},
|
|
2095
|
+
}, En = [
|
|
1841
2096
|
"data-item-id",
|
|
1842
2097
|
"data-occurrence-key",
|
|
1843
2098
|
"data-index",
|
|
1844
2099
|
"data-active",
|
|
1845
2100
|
"aria-hidden"
|
|
1846
|
-
],
|
|
2101
|
+
], Dn = {
|
|
1847
2102
|
key: 0,
|
|
1848
2103
|
"data-testid": "vibe-asset-spinner",
|
|
1849
2104
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
1850
|
-
},
|
|
2105
|
+
}, On = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, kn = ["data-kind"], An = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, jn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Mn = ["onClick"], Nn = [
|
|
1851
2106
|
"src",
|
|
1852
2107
|
"alt",
|
|
1853
2108
|
"onLoad",
|
|
1854
2109
|
"onError"
|
|
1855
|
-
],
|
|
2110
|
+
], Pn = [
|
|
1856
2111
|
"loop",
|
|
1857
2112
|
"src",
|
|
1858
2113
|
"preload",
|
|
@@ -1871,15 +2126,15 @@ var un = ["data-surface"], dn = ["data-surface"], fn = /* @__PURE__ */ d({
|
|
|
1871
2126
|
"onStalled",
|
|
1872
2127
|
"onTimeupdate",
|
|
1873
2128
|
"onWaiting"
|
|
1874
|
-
],
|
|
2129
|
+
], Fn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, In = [
|
|
1875
2130
|
"aria-label",
|
|
1876
2131
|
"disabled",
|
|
1877
2132
|
"onClick"
|
|
1878
|
-
],
|
|
2133
|
+
], Ln = { class: "relative z-[1] inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-emerald-500/12 p-4 backdrop-blur-[20px]" }, Rn = { class: "pointer-events-none absolute bottom-4 right-4 inline-flex h-10 w-10 items-center justify-center border border-white/14 bg-black/50 backdrop-blur-[18px]" }, zn = {
|
|
1879
2134
|
key: 0,
|
|
1880
2135
|
"data-testid": "vibe-asset-spinner",
|
|
1881
2136
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
1882
|
-
},
|
|
2137
|
+
}, Bn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Vn = ["data-kind"], Hn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Un = ["onClick"], Wn = [
|
|
1883
2138
|
"src",
|
|
1884
2139
|
"preload",
|
|
1885
2140
|
"onCanplay",
|
|
@@ -1895,26 +2150,26 @@ var un = ["data-surface"], dn = ["data-surface"], fn = /* @__PURE__ */ d({
|
|
|
1895
2150
|
"onStalled",
|
|
1896
2151
|
"onTimeupdate",
|
|
1897
2152
|
"onWaiting"
|
|
1898
|
-
],
|
|
2153
|
+
], Gn = {
|
|
1899
2154
|
key: 2,
|
|
1900
2155
|
class: "relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center"
|
|
1901
|
-
},
|
|
2156
|
+
}, Kn = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, qn = {
|
|
1902
2157
|
key: 0,
|
|
1903
2158
|
"data-testid": "vibe-fullscreen-overlay",
|
|
1904
2159
|
class: "pointer-events-none absolute inset-0 z-[6]"
|
|
1905
|
-
},
|
|
2160
|
+
}, Jn = { class: "h-full w-full" }, Yn = {
|
|
1906
2161
|
key: 1,
|
|
1907
2162
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
1908
2163
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
1909
|
-
},
|
|
2164
|
+
}, Xn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, Zn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)]" }, Qn = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, $n = {
|
|
1910
2165
|
key: 0,
|
|
1911
2166
|
"data-testid": "vibe-fullscreen-aside",
|
|
1912
2167
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
1913
|
-
},
|
|
2168
|
+
}, er = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, tr = {
|
|
1914
2169
|
key: 0,
|
|
1915
2170
|
"data-testid": "vibe-fullscreen-aside",
|
|
1916
2171
|
class: "absolute inset-y-0 right-0 z-[6] w-full max-w-[22rem] overflow-hidden border-l border-white/10 bg-black/82 backdrop-blur-[18px]"
|
|
1917
|
-
},
|
|
2172
|
+
}, nr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, rr = 1280, ir = 768, ar = /* @__PURE__ */ d({
|
|
1918
2173
|
__name: "FullscreenSurface",
|
|
1919
2174
|
props: {
|
|
1920
2175
|
active: {
|
|
@@ -1966,66 +2221,84 @@ var un = ["data-surface"], dn = ["data-surface"], fn = /* @__PURE__ */ d({
|
|
|
1966
2221
|
},
|
|
1967
2222
|
emits: ["back-to-list", "update:activeIndex"],
|
|
1968
2223
|
setup(e, { emit: n }) {
|
|
1969
|
-
let d = e,
|
|
2224
|
+
let d = e, f = F(), m = n, h = fn(d, (e, t) => {
|
|
1970
2225
|
m("update:activeIndex", t);
|
|
1971
2226
|
}, {
|
|
1972
|
-
enabled:
|
|
2227
|
+
enabled: M(d, "active"),
|
|
1973
2228
|
onAssetError: d.reportAssetError ?? void 0,
|
|
1974
2229
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
1975
|
-
}),
|
|
1976
|
-
active:
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2230
|
+
}), _ = D(typeof window > "u" ? rr : window.innerWidth || rr), C = Rt({
|
|
2231
|
+
active: M(d, "active"),
|
|
2232
|
+
items: h.items,
|
|
2233
|
+
resolvedActiveIndex: h.resolvedActiveIndex,
|
|
2234
|
+
viewer: h
|
|
2235
|
+
}), T = i(() => gn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = bn({
|
|
2236
|
+
activeItem: h.activeItem,
|
|
2237
|
+
getItemKey: C.getItemKey,
|
|
2238
|
+
isImageReady: h.isImageReady,
|
|
2239
|
+
showDominantImageTone: M(d, "showDominantImageTone")
|
|
2240
|
+
}), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value < ir ? "vertical" : "horizontal"), te = i(() => R.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), V = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), H = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), U = i(() => {
|
|
2241
|
+
let e = h.activeItem.value;
|
|
1986
2242
|
return e ? {
|
|
1987
2243
|
hasNextPage: d.hasNextPage,
|
|
1988
|
-
index:
|
|
2244
|
+
index: h.resolvedActiveIndex.value,
|
|
1989
2245
|
item: e,
|
|
1990
2246
|
loading: d.loading,
|
|
1991
2247
|
paginationDetail: d.paginationDetail,
|
|
1992
2248
|
total: d.items.length
|
|
1993
2249
|
} : null;
|
|
1994
|
-
}),
|
|
1995
|
-
...
|
|
1996
|
-
kind:
|
|
1997
|
-
message:
|
|
1998
|
-
}),
|
|
1999
|
-
gridTemplateColumns:
|
|
2250
|
+
}), W = i(() => !U.value || !f["fullscreen-header-actions"] ? [] : f["fullscreen-header-actions"](U.value)), ne = i(() => !U.value || !f["fullscreen-aside"] ? [] : f["fullscreen-aside"](U.value)), G = i(() => !d.showStatusBadges || !U.value || !h.statusKind.value || !h.statusMessage.value ? null : {
|
|
2251
|
+
...U.value,
|
|
2252
|
+
kind: h.statusKind.value,
|
|
2253
|
+
message: h.statusMessage.value
|
|
2254
|
+
}), K = i(() => !G.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](G.value)), q = i(() => ({
|
|
2255
|
+
gridTemplateColumns: Y.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
2000
2256
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
2001
|
-
})),
|
|
2002
|
-
emptyStateMode:
|
|
2257
|
+
})), re = i(() => zt(W.value)), J = i(() => zt(ne.value)), Y = i(() => J.value && _.value >= rr), ie = i(() => J.value && !Y.value), ae = i(() => zt(K.value)), { emptyStateProps: X, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = Ht({
|
|
2258
|
+
emptyStateMode: M(d, "emptyStateMode"),
|
|
2003
2259
|
itemCount: i(() => d.items.length),
|
|
2004
|
-
loading:
|
|
2005
|
-
renderSlot:
|
|
2260
|
+
loading: M(d, "loading"),
|
|
2261
|
+
renderSlot: f["empty-state"],
|
|
2006
2262
|
surface: "fullscreen"
|
|
2007
2263
|
});
|
|
2008
|
-
|
|
2009
|
-
window.addEventListener("resize",
|
|
2010
|
-
}),
|
|
2011
|
-
window.removeEventListener("resize",
|
|
2264
|
+
S(() => {
|
|
2265
|
+
window.addEventListener("resize", Z);
|
|
2266
|
+
}), x(() => {
|
|
2267
|
+
window.removeEventListener("resize", Z);
|
|
2012
2268
|
});
|
|
2013
|
-
function
|
|
2014
|
-
|
|
2269
|
+
function Z() {
|
|
2270
|
+
_.value = window.innerWidth || rr;
|
|
2015
2271
|
}
|
|
2016
|
-
function
|
|
2017
|
-
|
|
2272
|
+
function pe(e, t, n) {
|
|
2273
|
+
C.settleBackgroundPreload(t), h.onImageLoad(t, n);
|
|
2018
2274
|
let r = e.currentTarget;
|
|
2019
|
-
r instanceof HTMLImageElement &&
|
|
2275
|
+
r instanceof HTMLImageElement && ye(t, r);
|
|
2276
|
+
}
|
|
2277
|
+
async function me(e, t) {
|
|
2278
|
+
C.settleBackgroundPreload(e), await h.onImageError(e, t);
|
|
2279
|
+
}
|
|
2280
|
+
function he(e, t) {
|
|
2281
|
+
C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && ye(e, t);
|
|
2282
|
+
}
|
|
2283
|
+
function ge(e, t) {
|
|
2284
|
+
C.registerMediaElement(e, t), h.registerVideoElement(e, t);
|
|
2285
|
+
}
|
|
2286
|
+
function _e(e, t) {
|
|
2287
|
+
C.registerMediaElement(e, t), h.registerAudioElement(e, t);
|
|
2020
2288
|
}
|
|
2021
|
-
function
|
|
2022
|
-
|
|
2289
|
+
async function ve(e, t) {
|
|
2290
|
+
C.settleBackgroundPreload(e), await h.onMediaError(e, t);
|
|
2023
2291
|
}
|
|
2024
|
-
function
|
|
2292
|
+
function Q(e, t) {
|
|
2293
|
+
h.onMediaEvent(e, t);
|
|
2294
|
+
let n = t.currentTarget, r = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
2295
|
+
n instanceof HTMLMediaElement && n.readyState >= r && C.settleBackgroundPreload(e);
|
|
2296
|
+
}
|
|
2297
|
+
function ye(e, t) {
|
|
2025
2298
|
I(e, t);
|
|
2026
2299
|
}
|
|
2027
|
-
function
|
|
2028
|
-
if (
|
|
2300
|
+
function be(e, t) {
|
|
2301
|
+
if (Q(t, e), !d.loopFullscreenVideo) return;
|
|
2029
2302
|
let n = e.currentTarget;
|
|
2030
2303
|
if (!(n instanceof HTMLVideoElement)) return;
|
|
2031
2304
|
try {
|
|
@@ -2034,182 +2307,182 @@ var un = ["data-surface"], dn = ["data-surface"], fn = /* @__PURE__ */ d({
|
|
|
2034
2307
|
let r = n.play();
|
|
2035
2308
|
r && typeof r.catch == "function" && r.catch(() => {});
|
|
2036
2309
|
}
|
|
2037
|
-
return (e, n) => (
|
|
2310
|
+
return (e, n) => (w(), s("div", wn, [
|
|
2038
2311
|
c("div", {
|
|
2039
|
-
class:
|
|
2040
|
-
style:
|
|
2312
|
+
class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
|
|
2313
|
+
style: b(N(P))
|
|
2041
2314
|
}, null, 6),
|
|
2042
2315
|
c("div", {
|
|
2043
2316
|
class: "relative z-[1] grid h-full min-h-0",
|
|
2044
|
-
style:
|
|
2317
|
+
style: b(q.value)
|
|
2045
2318
|
}, [c("div", {
|
|
2046
2319
|
ref: "viewer.stageRef",
|
|
2047
2320
|
"data-testid": "vibe-stage",
|
|
2048
2321
|
class: "relative h-full min-h-0 touch-none overflow-hidden",
|
|
2049
|
-
onPointerdown: n[1] ||= (...e) =>
|
|
2050
|
-
onPointermove: n[2] ||= (...e) =>
|
|
2051
|
-
onPointerup: n[3] ||= (...e) =>
|
|
2052
|
-
onPointercancel: n[4] ||= (...e) =>
|
|
2053
|
-
onWheel: n[5] ||= (...e) =>
|
|
2054
|
-
}, [
|
|
2055
|
-
(
|
|
2056
|
-
key:
|
|
2322
|
+
onPointerdown: n[1] ||= (...e) => N(h).onPointerDown && N(h).onPointerDown(...e),
|
|
2323
|
+
onPointermove: n[2] ||= (...e) => N(h).onPointerMove && N(h).onPointerMove(...e),
|
|
2324
|
+
onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
|
|
2325
|
+
onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
|
|
2326
|
+
onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
|
|
2327
|
+
}, [N(h).activeItem.value ? (w(), s("div", Tn, [
|
|
2328
|
+
(w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
|
|
2329
|
+
key: N(C).getItemKey(r),
|
|
2057
2330
|
"data-testid": "vibe-slide",
|
|
2058
2331
|
"data-item-id": r.id,
|
|
2059
|
-
"data-occurrence-key":
|
|
2332
|
+
"data-occurrence-key": N(C).getItemKey(r),
|
|
2060
2333
|
"data-index": i,
|
|
2061
|
-
"data-active": i ===
|
|
2062
|
-
"aria-hidden": i ===
|
|
2063
|
-
class:
|
|
2064
|
-
style:
|
|
2334
|
+
"data-active": i === N(h).resolvedActiveIndex.value,
|
|
2335
|
+
"aria-hidden": i === N(h).resolvedActiveIndex.value ? "false" : "true",
|
|
2336
|
+
class: v(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === N(h).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
|
|
2337
|
+
style: b(N(h).getSlideStyle(i))
|
|
2065
2338
|
}, [c("div", {
|
|
2066
|
-
class:
|
|
2067
|
-
style:
|
|
2068
|
-
}, null, 6),
|
|
2339
|
+
class: v(["absolute inset-0 opacity-85", N(_n)(r.type)]),
|
|
2340
|
+
style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
|
|
2341
|
+
}, null, 6), N(h).isVisual(r) ? (w(), s("div", {
|
|
2069
2342
|
key: 0,
|
|
2070
|
-
class:
|
|
2071
|
-
}, [
|
|
2343
|
+
class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? te.value : ""])
|
|
2344
|
+
}, [N(C).isAssetLoading(i, r) ? (w(), s("div", Dn, [c("span", On, [u(N(oe), {
|
|
2072
2345
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2073
2346
|
"aria-hidden": "true"
|
|
2074
|
-
})])])) : o("", !0),
|
|
2347
|
+
})])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
|
|
2075
2348
|
key: 1,
|
|
2076
2349
|
"data-testid": "vibe-asset-error",
|
|
2077
|
-
"data-kind":
|
|
2350
|
+
"data-kind": N(C).getAssetErrorKind(r),
|
|
2078
2351
|
class: "grid h-full w-full place-items-center"
|
|
2079
|
-
}, [c("div",
|
|
2080
|
-
u(
|
|
2352
|
+
}, [c("div", An, [
|
|
2353
|
+
u(N(le), {
|
|
2081
2354
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2082
2355
|
"aria-hidden": "true"
|
|
2083
2356
|
}),
|
|
2084
|
-
c("p",
|
|
2085
|
-
|
|
2357
|
+
c("p", jn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2358
|
+
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2086
2359
|
key: 0,
|
|
2087
2360
|
type: "button",
|
|
2088
2361
|
class: "inline-flex items-center justify-center border border-white/14 bg-black/35 px-4 py-2 text-[0.64rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
|
|
2089
|
-
onClick:
|
|
2090
|
-
}, " Retry ", 8,
|
|
2091
|
-
])], 8,
|
|
2092
|
-
key:
|
|
2093
|
-
src:
|
|
2362
|
+
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2363
|
+
}, " Retry ", 8, Mn)) : o("", !0)
|
|
2364
|
+
])], 8, kn)) : r.type === "image" ? (w(), s("img", {
|
|
2365
|
+
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2366
|
+
src: N(C).getFullscreenImageSource(i, r),
|
|
2094
2367
|
alt: r.title ?? "",
|
|
2095
2368
|
crossorigin: "anonymous",
|
|
2096
2369
|
draggable: "false",
|
|
2097
|
-
class:
|
|
2370
|
+
class: v(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", N(h).isImageReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
2098
2371
|
ref_for: !0,
|
|
2099
|
-
ref: (e) =>
|
|
2100
|
-
onLoad: (e) =>
|
|
2101
|
-
onError: (e) =>
|
|
2102
|
-
}, null, 42,
|
|
2103
|
-
key:
|
|
2104
|
-
class:
|
|
2372
|
+
ref: (e) => he(N(C).getItemKey(r), e),
|
|
2373
|
+
onLoad: (e) => pe(e, N(C).getItemKey(r), r.url),
|
|
2374
|
+
onError: (e) => me(N(C).getItemKey(r), r.url)
|
|
2375
|
+
}, null, 42, Nn)) : (w(), s("video", {
|
|
2376
|
+
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2377
|
+
class: v(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", N(h).isMediaReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
2105
2378
|
playsinline: "",
|
|
2106
2379
|
loop: d.loopFullscreenVideo,
|
|
2107
|
-
src:
|
|
2108
|
-
preload:
|
|
2380
|
+
src: N(C).getFullscreenMediaSource(i, r),
|
|
2381
|
+
preload: N(C).getFullscreenMediaPreload(i),
|
|
2109
2382
|
ref_for: !0,
|
|
2110
|
-
ref: (e) =>
|
|
2111
|
-
onClick:
|
|
2112
|
-
onCanplay: (e) =>
|
|
2113
|
-
onDurationchange: (e) =>
|
|
2114
|
-
onEnded: (e) =>
|
|
2115
|
-
onError: (e) =>
|
|
2116
|
-
onLoadstart: (e) =>
|
|
2117
|
-
onLoadedmetadata: (e) =>
|
|
2118
|
-
onPause: (e) =>
|
|
2119
|
-
onPlay: (e) =>
|
|
2120
|
-
onPlaying: (e) =>
|
|
2121
|
-
onSeeking: (e) =>
|
|
2122
|
-
onSeeked: (e) =>
|
|
2123
|
-
onStalled: (e) =>
|
|
2124
|
-
onTimeupdate: (e) =>
|
|
2125
|
-
onWaiting: (e) =>
|
|
2126
|
-
}, null, 42,
|
|
2383
|
+
ref: (e) => ge(N(C).getItemKey(r), e),
|
|
2384
|
+
onClick: ee((e) => N(h).onVideoClick(e, N(C).getItemKey(r)), ["stop"]),
|
|
2385
|
+
onCanplay: (e) => Q(N(C).getItemKey(r), e),
|
|
2386
|
+
onDurationchange: (e) => Q(N(C).getItemKey(r), e),
|
|
2387
|
+
onEnded: (e) => be(e, N(C).getItemKey(r)),
|
|
2388
|
+
onError: (e) => ve(N(C).getItemKey(r), r.url),
|
|
2389
|
+
onLoadstart: (e) => Q(N(C).getItemKey(r), e),
|
|
2390
|
+
onLoadedmetadata: (e) => Q(N(C).getItemKey(r), e),
|
|
2391
|
+
onPause: (e) => Q(N(C).getItemKey(r), e),
|
|
2392
|
+
onPlay: (e) => Q(N(C).getItemKey(r), e),
|
|
2393
|
+
onPlaying: (e) => Q(N(C).getItemKey(r), e),
|
|
2394
|
+
onSeeking: (e) => Q(N(C).getItemKey(r), e),
|
|
2395
|
+
onSeeked: (e) => Q(N(C).getItemKey(r), e),
|
|
2396
|
+
onStalled: (e) => Q(N(C).getItemKey(r), e),
|
|
2397
|
+
onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
|
|
2398
|
+
onWaiting: (e) => Q(N(C).getItemKey(r), e)
|
|
2399
|
+
}, null, 42, Pn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
|
|
2127
2400
|
key: 1,
|
|
2128
|
-
class:
|
|
2129
|
-
}, [c("div",
|
|
2401
|
+
class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? te.value : ""])
|
|
2402
|
+
}, [c("div", Fn, [
|
|
2130
2403
|
c("button", {
|
|
2131
2404
|
type: "button",
|
|
2132
2405
|
class: "relative grid h-full w-full place-items-center border border-white/12 bg-[linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02)),radial-gradient(circle_at_center,rgba(16,185,129,0.14),transparent_58%)] text-[#f7f1ea] transition-[border-color,background] duration-200 hover:border-white/30 hover:bg-[linear-gradient(180deg,rgba(255,255,255,0.07),rgba(255,255,255,0.03)),radial-gradient(circle_at_center,rgba(16,185,129,0.18),transparent_58%)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
|
|
2133
|
-
"aria-label":
|
|
2134
|
-
disabled: !!
|
|
2135
|
-
onClick: (e) =>
|
|
2406
|
+
"aria-label": N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(C).getMediaActionLabel("Play", r) : N(C).getMediaActionLabel("Pause", r),
|
|
2407
|
+
disabled: !!N(C).getAssetErrorKind(r),
|
|
2408
|
+
onClick: (e) => N(h).onAudioCoverClick(e, N(C).getItemKey(r))
|
|
2136
2409
|
}, [
|
|
2137
2410
|
n[6] ||= c("span", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(16,185,129,0.16),transparent_66%)]" }, null, -1),
|
|
2138
2411
|
n[7] ||= c("span", { class: "pointer-events-none absolute h-[clamp(220px,30vw,360px)] w-[clamp(220px,30vw,360px)] border border-white/8 bg-[radial-gradient(circle,rgba(255,255,255,0.08),transparent_62%)]" }, null, -1),
|
|
2139
|
-
c("span",
|
|
2140
|
-
icon:
|
|
2412
|
+
c("span", Ln, [k(e.$slots, "item-icon", {
|
|
2413
|
+
icon: N(Tt)(r.type),
|
|
2141
2414
|
item: r
|
|
2142
|
-
}, () => [(
|
|
2415
|
+
}, () => [(w(), a(A(N(Tt)(r.type)), {
|
|
2143
2416
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2144
2417
|
"aria-hidden": "true"
|
|
2145
2418
|
}))])]),
|
|
2146
|
-
c("span",
|
|
2419
|
+
c("span", Rn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
|
|
2147
2420
|
class: "h-4 w-4 stroke-2",
|
|
2148
2421
|
"aria-hidden": "true"
|
|
2149
2422
|
}))])
|
|
2150
|
-
], 8,
|
|
2151
|
-
|
|
2423
|
+
], 8, In),
|
|
2424
|
+
N(C).isAssetLoading(i, r) ? (w(), s("div", zn, [c("span", Bn, [u(N(oe), {
|
|
2152
2425
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2153
2426
|
"aria-hidden": "true"
|
|
2154
2427
|
})])])) : o("", !0),
|
|
2155
|
-
|
|
2428
|
+
N(C).getAssetErrorKind(r) ? (w(), s(t, { key: 1 }, [n[8] ||= c("div", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(239,68,68,0.12),transparent_66%)]" }, null, -1), c("div", {
|
|
2156
2429
|
"data-testid": "vibe-asset-error",
|
|
2157
|
-
"data-kind":
|
|
2430
|
+
"data-kind": N(C).getAssetErrorKind(r),
|
|
2158
2431
|
class: "relative z-[1] grid justify-items-center gap-4"
|
|
2159
2432
|
}, [
|
|
2160
|
-
u(
|
|
2433
|
+
u(N(le), {
|
|
2161
2434
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2162
2435
|
"aria-hidden": "true"
|
|
2163
2436
|
}),
|
|
2164
|
-
c("p",
|
|
2165
|
-
|
|
2437
|
+
c("p", Hn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2438
|
+
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2166
2439
|
key: 0,
|
|
2167
2440
|
type: "button",
|
|
2168
2441
|
class: "pointer-events-auto inline-flex items-center justify-center border border-white/14 bg-black/35 px-4 py-2 text-[0.64rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
|
|
2169
|
-
onClick:
|
|
2170
|
-
}, " Retry ", 8,
|
|
2171
|
-
], 8,
|
|
2172
|
-
]), (
|
|
2173
|
-
key:
|
|
2174
|
-
src:
|
|
2175
|
-
preload:
|
|
2442
|
+
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2443
|
+
}, " Retry ", 8, Un)) : o("", !0)
|
|
2444
|
+
], 8, Vn)], 64)) : o("", !0)
|
|
2445
|
+
]), (w(), s("audio", {
|
|
2446
|
+
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2447
|
+
src: N(C).getFullscreenMediaSource(i, r),
|
|
2448
|
+
preload: N(C).getFullscreenMediaPreload(i),
|
|
2176
2449
|
class: "pointer-events-none absolute h-px w-px opacity-0",
|
|
2177
2450
|
ref_for: !0,
|
|
2178
|
-
ref: (e) =>
|
|
2179
|
-
onCanplay: (e) =>
|
|
2180
|
-
onDurationchange: (e) =>
|
|
2181
|
-
onError: (e) =>
|
|
2182
|
-
onLoadstart: (e) =>
|
|
2183
|
-
onLoadedmetadata: (e) =>
|
|
2184
|
-
onPause: (e) =>
|
|
2185
|
-
onPlay: (e) =>
|
|
2186
|
-
onPlaying: (e) =>
|
|
2187
|
-
onSeeking: (e) =>
|
|
2188
|
-
onSeeked: (e) =>
|
|
2189
|
-
onStalled: (e) =>
|
|
2190
|
-
onTimeupdate: (e) =>
|
|
2191
|
-
onWaiting: (e) =>
|
|
2192
|
-
}, null, 40,
|
|
2193
|
-
icon:
|
|
2451
|
+
ref: (e) => _e(N(C).getItemKey(r), e),
|
|
2452
|
+
onCanplay: (e) => Q(N(C).getItemKey(r), e),
|
|
2453
|
+
onDurationchange: (e) => Q(N(C).getItemKey(r), e),
|
|
2454
|
+
onError: (e) => ve(N(C).getItemKey(r), r.url),
|
|
2455
|
+
onLoadstart: (e) => Q(N(C).getItemKey(r), e),
|
|
2456
|
+
onLoadedmetadata: (e) => Q(N(C).getItemKey(r), e),
|
|
2457
|
+
onPause: (e) => Q(N(C).getItemKey(r), e),
|
|
2458
|
+
onPlay: (e) => Q(N(C).getItemKey(r), e),
|
|
2459
|
+
onPlaying: (e) => Q(N(C).getItemKey(r), e),
|
|
2460
|
+
onSeeking: (e) => Q(N(C).getItemKey(r), e),
|
|
2461
|
+
onSeeked: (e) => Q(N(C).getItemKey(r), e),
|
|
2462
|
+
onStalled: (e) => Q(N(C).getItemKey(r), e),
|
|
2463
|
+
onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
|
|
2464
|
+
onWaiting: (e) => Q(N(C).getItemKey(r), e)
|
|
2465
|
+
}, null, 40, Wn))], 2)) : (w(), s("div", Gn, [c("div", Kn, [k(e.$slots, "item-icon", {
|
|
2466
|
+
icon: N(Tt)(r.type),
|
|
2194
2467
|
item: r
|
|
2195
|
-
}, () => [(
|
|
2468
|
+
}, () => [(w(), a(A(N(Tt)(r.type)), {
|
|
2196
2469
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2197
2470
|
"aria-hidden": "true"
|
|
2198
|
-
}))])])]))], 14,
|
|
2199
|
-
|
|
2200
|
-
|
|
2471
|
+
}))])])]))], 14, En))), 128)),
|
|
2472
|
+
U.value && f["fullscreen-overlay"] ? (w(), s("div", qn, [c("div", Jn, [k(e.$slots, "fullscreen-overlay", y(p(U.value)))])])) : o("", !0),
|
|
2473
|
+
N(h).activeItem.value ? (w(), a(St, {
|
|
2201
2474
|
key: 1,
|
|
2202
|
-
"current-index":
|
|
2475
|
+
"current-index": N(h).resolvedActiveIndex.value,
|
|
2203
2476
|
loading: d.loading,
|
|
2204
|
-
"pagination-detail":
|
|
2477
|
+
"pagination-detail": N(h).paginationDetail.value,
|
|
2205
2478
|
"show-back-to-list": d.showBackToList,
|
|
2206
|
-
"show-end-badge": d.showEndBadge &&
|
|
2207
|
-
title:
|
|
2208
|
-
total:
|
|
2479
|
+
"show-end-badge": d.showEndBadge && N(h).isAtEnd.value && !N(h).hasNextPage.value && !N(h).loading.value,
|
|
2480
|
+
title: N(h).activeItem.value.title ?? null,
|
|
2481
|
+
total: N(h).items.value.length,
|
|
2209
2482
|
onBackToList: n[0] ||= (e) => m("back-to-list")
|
|
2210
|
-
}, l({ _: 2 }, [
|
|
2483
|
+
}, l({ _: 2 }, [re.value && U.value ? {
|
|
2211
2484
|
name: "actions",
|
|
2212
|
-
fn:
|
|
2485
|
+
fn: z(() => [k(e.$slots, "fullscreen-header-actions", y(p(U.value)))]),
|
|
2213
2486
|
key: "0"
|
|
2214
2487
|
} : void 0]), 1032, [
|
|
2215
2488
|
"current-index",
|
|
@@ -2220,19 +2493,19 @@ var un = ["data-surface"], dn = ["data-surface"], fn = /* @__PURE__ */ d({
|
|
|
2220
2493
|
"title",
|
|
2221
2494
|
"total"
|
|
2222
2495
|
])) : o("", !0),
|
|
2223
|
-
|
|
2496
|
+
R.value ? (w(), a(dt, {
|
|
2224
2497
|
key: 2,
|
|
2225
|
-
"current-time":
|
|
2226
|
-
"current-time-label":
|
|
2227
|
-
duration:
|
|
2228
|
-
"duration-label":
|
|
2229
|
-
muted:
|
|
2230
|
-
progress:
|
|
2231
|
-
volume:
|
|
2232
|
-
"volume-control-layout":
|
|
2233
|
-
onSeekInput:
|
|
2234
|
-
onVolumeInput:
|
|
2235
|
-
onVolumeToggle:
|
|
2498
|
+
"current-time": N(h).activeMediaState.value.currentTime,
|
|
2499
|
+
"current-time-label": N(h).formatPlaybackTime(N(h).activeMediaState.value.currentTime),
|
|
2500
|
+
duration: N(h).activeMediaDuration.value,
|
|
2501
|
+
"duration-label": N(h).formatPlaybackTime(N(h).activeMediaDuration.value),
|
|
2502
|
+
muted: N(h).activeMediaState.value.muted,
|
|
2503
|
+
progress: N(h).activeMediaProgress.value,
|
|
2504
|
+
volume: N(h).activeMediaState.value.volume,
|
|
2505
|
+
"volume-control-layout": B.value,
|
|
2506
|
+
onSeekInput: N(h).onMediaSeekInput,
|
|
2507
|
+
onVolumeInput: N(h).onMediaVolumeInput,
|
|
2508
|
+
onVolumeToggle: N(h).onMediaVolumeToggle
|
|
2236
2509
|
}, null, 8, [
|
|
2237
2510
|
"current-time",
|
|
2238
2511
|
"current-time-label",
|
|
@@ -2246,36 +2519,36 @@ var un = ["data-surface"], dn = ["data-surface"], fn = /* @__PURE__ */ d({
|
|
|
2246
2519
|
"onVolumeInput",
|
|
2247
2520
|
"onVolumeToggle"
|
|
2248
2521
|
])) : o("", !0),
|
|
2249
|
-
|
|
2522
|
+
G.value ? (w(), s("div", {
|
|
2250
2523
|
key: 3,
|
|
2251
|
-
class:
|
|
2252
|
-
}, [
|
|
2524
|
+
class: v(["absolute left-1/2 z-[4] -translate-x-1/2", L.value])
|
|
2525
|
+
}, [ae.value ? k(e.$slots, "fullscreen-status", y(g({ key: 0 }, G.value))) : (w(), s("div", {
|
|
2253
2526
|
key: 1,
|
|
2254
2527
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
2255
|
-
class:
|
|
2256
|
-
},
|
|
2257
|
-
])) :
|
|
2528
|
+
class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", G.value.kind === "end" ? "border-amber-300/35 text-amber-200" : G.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
2529
|
+
}, j(G.value.message), 3))], 2)) : o("", !0)
|
|
2530
|
+
])) : V.value ? (w(), s("div", Yn, [c("div", Xn, [c("span", Zn, [u(N(oe), {
|
|
2258
2531
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2259
2532
|
"aria-hidden": "true"
|
|
2260
|
-
})]), c("p",
|
|
2533
|
+
})]), c("p", Qn, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(Cn, {
|
|
2261
2534
|
key: 2,
|
|
2262
|
-
message:
|
|
2263
|
-
mode:
|
|
2264
|
-
surface:
|
|
2535
|
+
message: N(X).message,
|
|
2536
|
+
mode: N(X).mode,
|
|
2537
|
+
surface: N(X).surface
|
|
2265
2538
|
}, {
|
|
2266
|
-
default:
|
|
2539
|
+
default: z(() => [N(de) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
|
|
2267
2540
|
_: 3
|
|
2268
2541
|
}, 8, [
|
|
2269
2542
|
"message",
|
|
2270
2543
|
"mode",
|
|
2271
2544
|
"surface"
|
|
2272
|
-
])) : o("", !0),
|
|
2545
|
+
])) : o("", !0), N(ue) && N(X) ? (w(), a(Cn, {
|
|
2273
2546
|
key: 3,
|
|
2274
|
-
message:
|
|
2275
|
-
mode:
|
|
2276
|
-
surface:
|
|
2547
|
+
message: N(X).message,
|
|
2548
|
+
mode: N(X).mode,
|
|
2549
|
+
surface: N(X).surface
|
|
2277
2550
|
}, {
|
|
2278
|
-
default:
|
|
2551
|
+
default: z(() => [N(de) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
|
|
2279
2552
|
_: 3
|
|
2280
2553
|
}, 8, [
|
|
2281
2554
|
"message",
|
|
@@ -2289,7 +2562,7 @@ var un = ["data-surface"], dn = ["data-surface"], fn = /* @__PURE__ */ d({
|
|
|
2289
2562
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2290
2563
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2291
2564
|
}, {
|
|
2292
|
-
default:
|
|
2565
|
+
default: z(() => [Y.value && U.value ? (w(), s("aside", $n, [c("div", er, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
|
|
2293
2566
|
_: 3
|
|
2294
2567
|
})], 4),
|
|
2295
2568
|
u(r, {
|
|
@@ -2300,29 +2573,29 @@ var un = ["data-surface"], dn = ["data-surface"], fn = /* @__PURE__ */ d({
|
|
|
2300
2573
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2301
2574
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2302
2575
|
}, {
|
|
2303
|
-
default:
|
|
2576
|
+
default: z(() => [ie.value && U.value ? (w(), s("aside", tr, [c("div", nr, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
|
|
2304
2577
|
_: 3
|
|
2305
2578
|
})
|
|
2306
2579
|
]));
|
|
2307
2580
|
}
|
|
2308
|
-
}),
|
|
2309
|
-
function
|
|
2581
|
+
}), or = 1, sr = .5;
|
|
2582
|
+
function cr(e) {
|
|
2310
2583
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2311
|
-
width:
|
|
2312
|
-
height:
|
|
2584
|
+
width: or,
|
|
2585
|
+
height: or,
|
|
2313
2586
|
source: "fallback"
|
|
2314
2587
|
};
|
|
2315
2588
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2316
|
-
if (
|
|
2317
|
-
let r =
|
|
2589
|
+
if (hr(t) && hr(n)) {
|
|
2590
|
+
let r = gr(e, t, n);
|
|
2318
2591
|
return {
|
|
2319
2592
|
width: r.width,
|
|
2320
2593
|
height: r.height,
|
|
2321
2594
|
source: "preview"
|
|
2322
2595
|
};
|
|
2323
2596
|
}
|
|
2324
|
-
if (
|
|
2325
|
-
let t =
|
|
2597
|
+
if (hr(e.width) && hr(e.height)) {
|
|
2598
|
+
let t = gr(e, e.width, e.height);
|
|
2326
2599
|
return {
|
|
2327
2600
|
width: t.width,
|
|
2328
2601
|
height: t.height,
|
|
@@ -2330,31 +2603,31 @@ function Zn(e) {
|
|
|
2330
2603
|
};
|
|
2331
2604
|
}
|
|
2332
2605
|
return {
|
|
2333
|
-
width:
|
|
2334
|
-
height:
|
|
2606
|
+
width: or,
|
|
2607
|
+
height: or,
|
|
2335
2608
|
source: "fallback"
|
|
2336
2609
|
};
|
|
2337
2610
|
}
|
|
2338
|
-
function
|
|
2611
|
+
function lr(e, t) {
|
|
2339
2612
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2340
2613
|
}
|
|
2341
|
-
function
|
|
2614
|
+
function ur(e, t, n, r = 0) {
|
|
2342
2615
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2343
2616
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2344
2617
|
return !a || a <= 0 ? n : a / t;
|
|
2345
2618
|
}
|
|
2346
|
-
function
|
|
2347
|
-
let n =
|
|
2619
|
+
function dr(e, t) {
|
|
2620
|
+
let n = cr(e);
|
|
2348
2621
|
return n.height / n.width * t;
|
|
2349
2622
|
}
|
|
2350
|
-
function
|
|
2623
|
+
function fr(e, t) {
|
|
2351
2624
|
let n = Array.from({ length: t.columnCount }, () => 0), r = Array(e.length), i = Array(e.length), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = 0;
|
|
2352
2625
|
for (let c = 0; c < e.length; c += 1) {
|
|
2353
2626
|
let l = e[c];
|
|
2354
2627
|
o.set($(l), c);
|
|
2355
2628
|
let u = 0;
|
|
2356
2629
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2357
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
2630
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = dr(l, t.columnWidth);
|
|
2358
2631
|
r[c] = {
|
|
2359
2632
|
x: d,
|
|
2360
2633
|
y: f
|
|
@@ -2373,7 +2646,7 @@ function tr(e, t) {
|
|
|
2373
2646
|
indexById: o
|
|
2374
2647
|
};
|
|
2375
2648
|
}
|
|
2376
|
-
function
|
|
2649
|
+
function pr(e) {
|
|
2377
2650
|
if (e.itemCount <= 0) return [];
|
|
2378
2651
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2379
2652
|
let t = Math.max(0, e.scrollTop - e.overscanPx), n = e.scrollTop + e.viewportHeight + e.overscanPx, r = Math.floor(t / e.bucketPx), i = Math.floor(n / e.bucketPx), a = /* @__PURE__ */ new Set();
|
|
@@ -2383,7 +2656,7 @@ function nr(e) {
|
|
|
2383
2656
|
}
|
|
2384
2657
|
return Array.from(a).sort((e, t) => e - t);
|
|
2385
2658
|
}
|
|
2386
|
-
function
|
|
2659
|
+
function mr(e, t, n) {
|
|
2387
2660
|
let r = /* @__PURE__ */ new Map();
|
|
2388
2661
|
for (let i of e) {
|
|
2389
2662
|
let e = t.get($(i));
|
|
@@ -2393,11 +2666,11 @@ function rr(e, t, n) {
|
|
|
2393
2666
|
}
|
|
2394
2667
|
return r;
|
|
2395
2668
|
}
|
|
2396
|
-
function
|
|
2669
|
+
function hr(e) {
|
|
2397
2670
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2398
2671
|
}
|
|
2399
|
-
function
|
|
2400
|
-
return e.type !== "image" || n / t >=
|
|
2672
|
+
function gr(e, t, n) {
|
|
2673
|
+
return e.type !== "image" || n / t >= sr ? {
|
|
2401
2674
|
width: t,
|
|
2402
2675
|
height: n
|
|
2403
2676
|
} : {
|
|
@@ -2407,23 +2680,23 @@ function ar(e, t, n) {
|
|
|
2407
2680
|
}
|
|
2408
2681
|
//#endregion
|
|
2409
2682
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2410
|
-
var
|
|
2411
|
-
function
|
|
2683
|
+
var _r = 300, vr = 600, yr = 40, br = 300, xr = 400;
|
|
2684
|
+
function Sr(e, t) {
|
|
2412
2685
|
return t === "top" ? [...e].reverse() : e;
|
|
2413
2686
|
}
|
|
2414
|
-
function
|
|
2415
|
-
return e <= 0 ?
|
|
2687
|
+
function Cr(e) {
|
|
2688
|
+
return e <= 0 ? vr : vr + Math.min((e - 1) * yr, xr);
|
|
2416
2689
|
}
|
|
2417
|
-
function
|
|
2418
|
-
return
|
|
2690
|
+
function wr() {
|
|
2691
|
+
return br;
|
|
2419
2692
|
}
|
|
2420
|
-
function
|
|
2693
|
+
function Tr(e) {
|
|
2421
2694
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2422
2695
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2423
2696
|
}
|
|
2424
|
-
function
|
|
2425
|
-
let t =
|
|
2426
|
-
|
|
2697
|
+
function Er(e) {
|
|
2698
|
+
let t = D(/* @__PURE__ */ new Set()), n = D(/* @__PURE__ */ new Set()), r = D(/* @__PURE__ */ new Map()), a = D(/* @__PURE__ */ new Map()), o = D(/* @__PURE__ */ new Map()), s = D(/* @__PURE__ */ new Set()), c = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Map()), u = D(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
|
|
2699
|
+
L(e.visibleIndices, (i) => {
|
|
2427
2700
|
if (!i.length) return;
|
|
2428
2701
|
let o = [];
|
|
2429
2702
|
for (let n of i) {
|
|
@@ -2431,27 +2704,27 @@ function hr(e) {
|
|
|
2431
2704
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2432
2705
|
}
|
|
2433
2706
|
if (!o.length) return;
|
|
2434
|
-
let s =
|
|
2435
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2436
|
-
r.value = c,
|
|
2707
|
+
let s = Sr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
2708
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * yr, xr));
|
|
2709
|
+
r.value = c, Dr(() => {
|
|
2437
2710
|
let e = new Set(n.value);
|
|
2438
2711
|
for (let t of o) e.add(t);
|
|
2439
2712
|
n.value = e;
|
|
2440
|
-
}),
|
|
2713
|
+
}), Or(() => {
|
|
2441
2714
|
let e = new Set(t.value);
|
|
2442
2715
|
for (let t of o) e.delete(t);
|
|
2443
2716
|
t.value = e, S(() => {
|
|
2444
2717
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2445
2718
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2446
2719
|
n.value = e, r.value = t, a.value = i;
|
|
2447
|
-
},
|
|
2720
|
+
}, Cr(o.length));
|
|
2448
2721
|
});
|
|
2449
|
-
}, { flush: "post" }),
|
|
2722
|
+
}, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
|
|
2450
2723
|
if (!e.length || !o.value.size) return;
|
|
2451
2724
|
let t = new Set(e), n = null, r = null;
|
|
2452
2725
|
for (let e of o.value.keys()) t.has(e) && (n ||= new Map(o.value), r ||= new Set(s.value), n.delete(e), r.delete(e));
|
|
2453
2726
|
n && (o.value = n), r && (s.value = r);
|
|
2454
|
-
}),
|
|
2727
|
+
}), x(() => {
|
|
2455
2728
|
for (let e of f) clearTimeout(e);
|
|
2456
2729
|
f.clear();
|
|
2457
2730
|
});
|
|
@@ -2471,7 +2744,7 @@ function hr(e) {
|
|
|
2471
2744
|
let e = $(t.item);
|
|
2472
2745
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2473
2746
|
}
|
|
2474
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
2747
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Dr(() => {
|
|
2475
2748
|
let e = new Set(s.value);
|
|
2476
2749
|
for (let t of p) e.add(t);
|
|
2477
2750
|
s.value = e;
|
|
@@ -2479,9 +2752,9 @@ function hr(e) {
|
|
|
2479
2752
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2480
2753
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2481
2754
|
o.value = e, s.value = t;
|
|
2482
|
-
},
|
|
2755
|
+
}, br);
|
|
2483
2756
|
}
|
|
2484
|
-
function g(t, n, r =
|
|
2757
|
+
function g(t, n, r = _r) {
|
|
2485
2758
|
if (!t.size) return;
|
|
2486
2759
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2487
2760
|
for (let [r, o] of t.entries()) {
|
|
@@ -2500,8 +2773,8 @@ function hr(e) {
|
|
|
2500
2773
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2501
2774
|
let o = new Map(l.value);
|
|
2502
2775
|
for (let e of a) o.set(e, r);
|
|
2503
|
-
l.value = o,
|
|
2504
|
-
u.value = new Set(a),
|
|
2776
|
+
l.value = o, Dr(() => {
|
|
2777
|
+
u.value = new Set(a), Dr(() => {
|
|
2505
2778
|
c.value = /* @__PURE__ */ new Map();
|
|
2506
2779
|
});
|
|
2507
2780
|
}), S(() => {
|
|
@@ -2512,8 +2785,8 @@ function hr(e) {
|
|
|
2512
2785
|
}, r);
|
|
2513
2786
|
}
|
|
2514
2787
|
function _(e) {
|
|
2515
|
-
if (n.value.has(e)) return `transform ${
|
|
2516
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
2788
|
+
if (n.value.has(e)) return `transform ${vr}ms ease-out`;
|
|
2789
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? _r}ms ease-out`;
|
|
2517
2790
|
}
|
|
2518
2791
|
function v(e) {
|
|
2519
2792
|
if (!n.value.has(e)) return;
|
|
@@ -2530,7 +2803,7 @@ function hr(e) {
|
|
|
2530
2803
|
} : {
|
|
2531
2804
|
dx: 0,
|
|
2532
2805
|
dy: 0
|
|
2533
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
2806
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Tr({
|
|
2534
2807
|
columnWidth: e.columnWidth.value,
|
|
2535
2808
|
direction: u,
|
|
2536
2809
|
itemHeight: o,
|
|
@@ -2539,19 +2812,19 @@ function hr(e) {
|
|
|
2539
2812
|
}) : i.y;
|
|
2540
2813
|
return `translate3d(${i.x + l.dx}px, ${d + l.dy}px, 0)`;
|
|
2541
2814
|
}
|
|
2542
|
-
function
|
|
2815
|
+
function b(t) {
|
|
2543
2816
|
let n = $(t), r = o.value.get(n);
|
|
2544
2817
|
if (!r) return {
|
|
2545
2818
|
opacity: "0",
|
|
2546
2819
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2547
|
-
transition: `opacity ${
|
|
2820
|
+
transition: `opacity ${br}ms ease-out, transform ${br}ms ease-out`
|
|
2548
2821
|
};
|
|
2549
2822
|
let i = s.value.has(n);
|
|
2550
2823
|
return {
|
|
2551
2824
|
height: `${r.height}px`,
|
|
2552
2825
|
opacity: i ? "0" : "1",
|
|
2553
2826
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
2554
|
-
transition: `opacity ${
|
|
2827
|
+
transition: `opacity ${br}ms ease-out, transform ${br}ms ease-out`,
|
|
2555
2828
|
width: `${e.columnWidth.value}px`
|
|
2556
2829
|
};
|
|
2557
2830
|
}
|
|
@@ -2565,35 +2838,35 @@ function hr(e) {
|
|
|
2565
2838
|
getCardTransform: y,
|
|
2566
2839
|
getCardTransition: _,
|
|
2567
2840
|
getCardTransitionDelay: v,
|
|
2568
|
-
getLeavingCardStyle:
|
|
2841
|
+
getLeavingCardStyle: b,
|
|
2569
2842
|
leavingItems: p,
|
|
2570
2843
|
markEnter: m,
|
|
2571
2844
|
markLeave: h,
|
|
2572
2845
|
playFlipMoveAnimation: g
|
|
2573
2846
|
};
|
|
2574
2847
|
}
|
|
2575
|
-
function
|
|
2848
|
+
function Dr(e) {
|
|
2576
2849
|
if (typeof requestAnimationFrame == "function") {
|
|
2577
2850
|
requestAnimationFrame(() => e());
|
|
2578
2851
|
return;
|
|
2579
2852
|
}
|
|
2580
2853
|
setTimeout(e, 0);
|
|
2581
2854
|
}
|
|
2582
|
-
function
|
|
2583
|
-
|
|
2855
|
+
function Or(e) {
|
|
2856
|
+
Dr(() => Dr(e));
|
|
2584
2857
|
}
|
|
2585
2858
|
//#endregion
|
|
2586
2859
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
2587
|
-
function
|
|
2860
|
+
function kr(e, t) {
|
|
2588
2861
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
2589
2862
|
}
|
|
2590
|
-
function
|
|
2863
|
+
function Ar(e, t, n) {
|
|
2591
2864
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
2592
2865
|
}
|
|
2593
|
-
function
|
|
2866
|
+
function jr(e, t, n, r) {
|
|
2594
2867
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
2595
2868
|
}
|
|
2596
|
-
function
|
|
2869
|
+
function Mr(e, t) {
|
|
2597
2870
|
return {
|
|
2598
2871
|
height: `${e}px`,
|
|
2599
2872
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -2601,10 +2874,10 @@ function xr(e, t) {
|
|
|
2601
2874
|
}
|
|
2602
2875
|
//#endregion
|
|
2603
2876
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
2604
|
-
var
|
|
2605
|
-
function
|
|
2606
|
-
let t =
|
|
2607
|
-
|
|
2877
|
+
var Nr = 250, Pr = 1e3;
|
|
2878
|
+
function Fr(e) {
|
|
2879
|
+
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
|
|
2880
|
+
x(() => {
|
|
2608
2881
|
y();
|
|
2609
2882
|
});
|
|
2610
2883
|
function l() {
|
|
@@ -2616,9 +2889,9 @@ function wr(e) {
|
|
|
2616
2889
|
!r && n.value && m();
|
|
2617
2890
|
}
|
|
2618
2891
|
function u(t) {
|
|
2619
|
-
if (!
|
|
2892
|
+
if (!b(t) || !e.isAtBoundary()) return;
|
|
2620
2893
|
let n = Date.now();
|
|
2621
|
-
n < s || (s = n +
|
|
2894
|
+
n < s || (s = n + Nr, m());
|
|
2622
2895
|
}
|
|
2623
2896
|
function d() {
|
|
2624
2897
|
if (!g()) return;
|
|
@@ -2652,7 +2925,7 @@ function wr(e) {
|
|
|
2652
2925
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
2653
2926
|
}
|
|
2654
2927
|
function _() {
|
|
2655
|
-
o.value = !1, v(
|
|
2928
|
+
o.value = !1, v(Pr);
|
|
2656
2929
|
}
|
|
2657
2930
|
function v(e) {
|
|
2658
2931
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -2662,7 +2935,7 @@ function wr(e) {
|
|
|
2662
2935
|
function y() {
|
|
2663
2936
|
c &&= (clearTimeout(c), null);
|
|
2664
2937
|
}
|
|
2665
|
-
function
|
|
2938
|
+
function b(t) {
|
|
2666
2939
|
return e.direction === "top" ? t.deltaY < 0 : t.deltaY > 0;
|
|
2667
2940
|
}
|
|
2668
2941
|
return {
|
|
@@ -2675,81 +2948,81 @@ function wr(e) {
|
|
|
2675
2948
|
}
|
|
2676
2949
|
//#endregion
|
|
2677
2950
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
2678
|
-
var
|
|
2679
|
-
function
|
|
2680
|
-
let t =
|
|
2951
|
+
var Ir = 600, Lr = 24, Rr = 16, zr = 300, Br = 200, Vr = 200, Hr = Lr + Rr, Ur = 200, Wr = 300, Gr = 24, Kr = 48, qr = 500, Jr = 1e3;
|
|
2952
|
+
function Yr(e) {
|
|
2953
|
+
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || zr), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = D(null), p = D(!1), m = i(() => Math.max(zr, a.value - Lr * 2)), h = i(() => lr(m.value, zr)), g = i(() => ur(m.value, h.value, zr, Rr)), v = i(() => Xr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => pr({
|
|
2681
2954
|
itemCount: e.items.value.length,
|
|
2682
2955
|
viewportHeight: r.value,
|
|
2683
2956
|
scrollTop: n.value,
|
|
2684
|
-
overscanPx:
|
|
2685
|
-
bucketPx:
|
|
2957
|
+
overscanPx: Br,
|
|
2958
|
+
bucketPx: Ir,
|
|
2686
2959
|
buckets: c.value
|
|
2687
|
-
})),
|
|
2960
|
+
})), b = i(() => y.value.map((t) => ({
|
|
2688
2961
|
item: e.items.value[t],
|
|
2689
2962
|
index: t
|
|
2690
2963
|
}))), C = i(() => {
|
|
2691
|
-
let e = l.value +
|
|
2692
|
-
return Math.max(e, t, r.value) +
|
|
2693
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value),
|
|
2964
|
+
let e = l.value + Lr * 2, t = d.value ?? 0;
|
|
2965
|
+
return Math.max(e, t, r.value) + Ur;
|
|
2966
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => Qr({
|
|
2694
2967
|
active: e.active.value,
|
|
2695
|
-
maxScrollTop:
|
|
2968
|
+
maxScrollTop: se(),
|
|
2696
2969
|
progressDistancePx: n.value,
|
|
2697
|
-
thresholdPx:
|
|
2970
|
+
thresholdPx: Vr,
|
|
2698
2971
|
triggerEnabled: w.value
|
|
2699
|
-
})),
|
|
2972
|
+
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => Zr({
|
|
2700
2973
|
active: e.active.value,
|
|
2701
|
-
maxScrollTop:
|
|
2974
|
+
maxScrollTop: se(),
|
|
2702
2975
|
progressDistancePx: n.value,
|
|
2703
|
-
thresholdPx:
|
|
2976
|
+
thresholdPx: Hr,
|
|
2704
2977
|
triggerEnabled: e.hasPreviousPage.value
|
|
2705
|
-
})), k = i(() => Math.max(0, r.value -
|
|
2978
|
+
})), k = i(() => Math.max(0, r.value - Gr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
|
|
2706
2979
|
if (!A.value) return 0;
|
|
2707
2980
|
let e = r.value / C.value * k.value;
|
|
2708
|
-
return Math.min(k.value, Math.max(
|
|
2981
|
+
return Math.min(k.value, Math.max(Kr, e));
|
|
2709
2982
|
}), M = i(() => {
|
|
2710
|
-
if (!A.value) return
|
|
2983
|
+
if (!A.value) return Gr;
|
|
2711
2984
|
let e = Math.max(0, C.value - r.value);
|
|
2712
|
-
return
|
|
2713
|
-
}), N =
|
|
2985
|
+
return Gr + Math.max(0, k.value - j.value) * (e > 0 ? Xr(n.value / e, 0, 1) : 0);
|
|
2986
|
+
}), N = Er({
|
|
2714
2987
|
items: e.items,
|
|
2715
2988
|
visibleIndices: y,
|
|
2716
2989
|
positions: o,
|
|
2717
2990
|
heights: s,
|
|
2718
2991
|
indexById: u,
|
|
2719
|
-
columnWidth:
|
|
2992
|
+
columnWidth: g,
|
|
2720
2993
|
scrollTop: n,
|
|
2721
2994
|
viewportHeight: r
|
|
2722
|
-
}), P =
|
|
2995
|
+
}), P = Fr({
|
|
2723
2996
|
direction: "top",
|
|
2724
2997
|
getAnimationLockMs(e) {
|
|
2725
|
-
return Math.max(
|
|
2998
|
+
return Math.max(qr, Cr(e)) + Jr;
|
|
2726
2999
|
},
|
|
2727
3000
|
hasPage: e.hasPreviousPage,
|
|
2728
3001
|
interactionLocked: p,
|
|
2729
3002
|
isAtBoundary() {
|
|
2730
|
-
return n.value <=
|
|
3003
|
+
return n.value <= Hr;
|
|
2731
3004
|
},
|
|
2732
3005
|
loading: e.loading,
|
|
2733
3006
|
requestPage: e.requestPreviousPage
|
|
2734
|
-
}),
|
|
3007
|
+
}), F = Fr({
|
|
2735
3008
|
direction: "bottom",
|
|
2736
3009
|
getAnimationLockMs(e) {
|
|
2737
|
-
return
|
|
3010
|
+
return Cr(e) + Jr;
|
|
2738
3011
|
},
|
|
2739
3012
|
hasPage: w,
|
|
2740
3013
|
interactionLocked: p,
|
|
2741
3014
|
isAtBoundary() {
|
|
2742
|
-
return
|
|
3015
|
+
return oe() <= Vr;
|
|
2743
3016
|
},
|
|
2744
3017
|
loading: e.loading,
|
|
2745
3018
|
requestPage: e.requestNextPage
|
|
2746
|
-
}),
|
|
2747
|
-
|
|
3019
|
+
}), I = null, R = 0, z = null, B = null, ee = !1;
|
|
3020
|
+
L([
|
|
2748
3021
|
() => e.items.value,
|
|
2749
3022
|
h,
|
|
2750
|
-
|
|
3023
|
+
g
|
|
2751
3024
|
], async ([t], [r = []]) => {
|
|
2752
|
-
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c =
|
|
3025
|
+
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = mr(a, u.value, o.value), l = X(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
|
|
2753
3026
|
let t = $(e);
|
|
2754
3027
|
if (f.has(t)) return [];
|
|
2755
3028
|
let n = c.get(t), r = l.get(t);
|
|
@@ -2758,16 +3031,16 @@ function Rr(e) {
|
|
|
2758
3031
|
item: e,
|
|
2759
3032
|
position: n
|
|
2760
3033
|
}];
|
|
2761
|
-
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0],
|
|
2762
|
-
y &&
|
|
2763
|
-
}, { immediate: !0 }),
|
|
3034
|
+
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > Lr + Rr, b = h && n.value > Lr + Rr ? t[v.value] : null, x = b ? $(b) : null;
|
|
3035
|
+
y && K(wr() + Jr), g && G(), te(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : F.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? qr : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
|
|
3036
|
+
}, { immediate: !0 }), L([
|
|
2764
3037
|
() => e.pendingAppendItems.value.map((e) => $(e)),
|
|
2765
3038
|
h,
|
|
2766
|
-
|
|
3039
|
+
g,
|
|
2767
3040
|
r
|
|
2768
3041
|
], ([t]) => {
|
|
2769
|
-
|
|
2770
|
-
}, { immediate: !0 }),
|
|
3042
|
+
de(), t.length && (d.value = le([...e.items.value, ...e.pendingAppendItems.value]), ue());
|
|
3043
|
+
}, { immediate: !0 }), L(() => e.active.value, async (e, i) => {
|
|
2771
3044
|
let a = t.value;
|
|
2772
3045
|
if (!a) return;
|
|
2773
3046
|
if (!e) {
|
|
@@ -2775,76 +3048,76 @@ function Rr(e) {
|
|
|
2775
3048
|
return;
|
|
2776
3049
|
}
|
|
2777
3050
|
if (i !== !1 || f.value == null) return;
|
|
2778
|
-
await
|
|
2779
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
2780
|
-
a.scrollTop = s, n.value = s, P.syncBoundary(),
|
|
2781
|
-
}),
|
|
2782
|
-
!t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t),
|
|
2783
|
-
}),
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
}), t.value &&
|
|
2787
|
-
}),
|
|
2788
|
-
|
|
3051
|
+
await _();
|
|
3052
|
+
let o = Math.max(0, C.value - r.value), s = Xr(f.value, 0, o);
|
|
3053
|
+
a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
|
|
3054
|
+
}), L(() => e.loading.value, async (t) => {
|
|
3055
|
+
!t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
|
|
3056
|
+
}), S(async () => {
|
|
3057
|
+
Y(), await _(), v.value > 0 ? W(v.value, "center") : q(), P.syncBoundary(), F.syncBoundary(), typeof ResizeObserver < "u" ? (I = new ResizeObserver(() => {
|
|
3058
|
+
Y();
|
|
3059
|
+
}), t.value && I.observe(t.value)) : window.addEventListener("resize", Y);
|
|
3060
|
+
}), x(() => {
|
|
3061
|
+
I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
|
|
2789
3062
|
});
|
|
2790
|
-
function
|
|
2791
|
-
let t =
|
|
3063
|
+
function te() {
|
|
3064
|
+
let t = fr(e.items.value, {
|
|
2792
3065
|
columnCount: h.value,
|
|
2793
|
-
columnWidth:
|
|
2794
|
-
gapX:
|
|
2795
|
-
gapY:
|
|
2796
|
-
bucketPx:
|
|
3066
|
+
columnWidth: g.value,
|
|
3067
|
+
gapX: Rr,
|
|
3068
|
+
gapY: Rr,
|
|
3069
|
+
bucketPx: Ir
|
|
2797
3070
|
});
|
|
2798
3071
|
o.value = t.positions.map((e) => ({
|
|
2799
|
-
x: e.x +
|
|
2800
|
-
y: e.y +
|
|
3072
|
+
x: e.x + Lr,
|
|
3073
|
+
y: e.y + Lr
|
|
2801
3074
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
2802
3075
|
}
|
|
2803
|
-
function
|
|
2804
|
-
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value =
|
|
2805
|
-
R = 0,
|
|
3076
|
+
function V() {
|
|
3077
|
+
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = ie(), P.syncBoundary(), F.syncBoundary(), J(), !re() && (R ||= requestAnimationFrame(() => {
|
|
3078
|
+
R = 0, q();
|
|
2806
3079
|
})));
|
|
2807
3080
|
}
|
|
2808
|
-
function
|
|
2809
|
-
e.active.value && (P.onWheel(t),
|
|
3081
|
+
function H(t) {
|
|
3082
|
+
e.active.value && (P.onWheel(t), F.onWheel(t), J());
|
|
2810
3083
|
}
|
|
2811
|
-
function
|
|
3084
|
+
function U(t) {
|
|
2812
3085
|
let n = e.items.value[t], r = n ? $(n) : "";
|
|
2813
3086
|
return {
|
|
2814
|
-
height: `${s.value[t] ??
|
|
2815
|
-
width: `${
|
|
3087
|
+
height: `${s.value[t] ?? g.value}px`,
|
|
3088
|
+
width: `${g.value}px`,
|
|
2816
3089
|
transition: r ? N.getCardTransition(r) : void 0,
|
|
2817
3090
|
transitionDelay: r ? N.getCardTransitionDelay(r) : void 0,
|
|
2818
3091
|
transform: N.getCardTransform(t)
|
|
2819
3092
|
};
|
|
2820
3093
|
}
|
|
2821
|
-
function
|
|
3094
|
+
function W(e, i) {
|
|
2822
3095
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
2823
3096
|
if (!a || !c || !l) return;
|
|
2824
3097
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
2825
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
3098
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Lr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Lr), a.scrollTop = Xr(u, 0, d), n.value = a.scrollTop, q();
|
|
2826
3099
|
}
|
|
2827
|
-
function
|
|
3100
|
+
function ne(e, r) {
|
|
2828
3101
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
2829
3102
|
if (!i || !a || !c) return;
|
|
2830
3103
|
let l = c.y - a.y;
|
|
2831
3104
|
i.scrollTop += l, n.value = i.scrollTop;
|
|
2832
3105
|
}
|
|
2833
|
-
function
|
|
3106
|
+
function G() {
|
|
2834
3107
|
let e = t.value;
|
|
2835
3108
|
if (!e) {
|
|
2836
3109
|
n.value = 0;
|
|
2837
3110
|
return;
|
|
2838
3111
|
}
|
|
2839
|
-
e.scrollTop = 0, n.value = 0, P.syncBoundary(),
|
|
3112
|
+
e.scrollTop = 0, n.value = 0, P.syncBoundary(), F.syncBoundary();
|
|
2840
3113
|
}
|
|
2841
|
-
function
|
|
2842
|
-
|
|
3114
|
+
function K(e) {
|
|
3115
|
+
fe(), p.value = !0, B = setTimeout(() => {
|
|
2843
3116
|
B = null, p.value = !1;
|
|
2844
3117
|
}, Math.max(0, e));
|
|
2845
3118
|
}
|
|
2846
|
-
function
|
|
2847
|
-
if (!y.value.length ||
|
|
3119
|
+
function q() {
|
|
3120
|
+
if (!y.value.length || re()) return;
|
|
2848
3121
|
let t = n.value + r.value / 2, i = v.value, a = Infinity;
|
|
2849
3122
|
for (let e of y.value) {
|
|
2850
3123
|
let n = o.value[e], r = s.value[e];
|
|
@@ -2854,42 +3127,42 @@ function Rr(e) {
|
|
|
2854
3127
|
}
|
|
2855
3128
|
e.setActiveIndex(i);
|
|
2856
3129
|
}
|
|
2857
|
-
function
|
|
2858
|
-
let t = n.value <=
|
|
3130
|
+
function re() {
|
|
3131
|
+
let t = n.value <= Hr, r = oe() <= Vr;
|
|
2859
3132
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
2860
3133
|
}
|
|
2861
|
-
function
|
|
2862
|
-
P.maybeRequestPage(),
|
|
2863
|
-
}
|
|
2864
|
-
function X() {
|
|
2865
|
-
r.value = re(), a.value = ie();
|
|
3134
|
+
function J() {
|
|
3135
|
+
P.maybeRequestPage(), F.maybeRequestPage();
|
|
2866
3136
|
}
|
|
2867
|
-
function
|
|
2868
|
-
|
|
3137
|
+
function Y() {
|
|
3138
|
+
r.value = ie(), a.value = ae();
|
|
2869
3139
|
}
|
|
2870
3140
|
function ie() {
|
|
2871
|
-
return
|
|
3141
|
+
return kr(t.value, r.value);
|
|
2872
3142
|
}
|
|
2873
3143
|
function ae() {
|
|
2874
|
-
return
|
|
3144
|
+
return Ar(t.value, a.value, zr);
|
|
2875
3145
|
}
|
|
2876
3146
|
function oe() {
|
|
3147
|
+
return jr(t.value, n.value, r.value, C.value);
|
|
3148
|
+
}
|
|
3149
|
+
function se() {
|
|
2877
3150
|
let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
|
|
2878
3151
|
return Math.max(0, e - r.value);
|
|
2879
3152
|
}
|
|
2880
|
-
function
|
|
2881
|
-
return
|
|
3153
|
+
function ce() {
|
|
3154
|
+
return Mr(j.value, M.value);
|
|
2882
3155
|
}
|
|
2883
|
-
function
|
|
2884
|
-
return e.length ?
|
|
3156
|
+
function le(e) {
|
|
3157
|
+
return e.length ? fr(e, {
|
|
2885
3158
|
columnCount: h.value,
|
|
2886
|
-
columnWidth:
|
|
2887
|
-
gapX:
|
|
2888
|
-
gapY:
|
|
2889
|
-
bucketPx:
|
|
2890
|
-
}).contentHeight +
|
|
3159
|
+
columnWidth: g.value,
|
|
3160
|
+
gapX: Rr,
|
|
3161
|
+
gapY: Rr,
|
|
3162
|
+
bucketPx: Ir
|
|
3163
|
+
}).contentHeight + Lr * 2 : 0;
|
|
2891
3164
|
}
|
|
2892
|
-
function
|
|
3165
|
+
function X(e) {
|
|
2893
3166
|
let t = /* @__PURE__ */ new Map();
|
|
2894
3167
|
for (let n of e) {
|
|
2895
3168
|
let e = $(n), r = u.value.get(e);
|
|
@@ -2899,64 +3172,64 @@ function Rr(e) {
|
|
|
2899
3172
|
}
|
|
2900
3173
|
return t;
|
|
2901
3174
|
}
|
|
2902
|
-
function
|
|
3175
|
+
function ue() {
|
|
2903
3176
|
let t = e.commitPendingAppend.value;
|
|
2904
3177
|
typeof t == "function" && (z = setTimeout(async () => {
|
|
2905
3178
|
z = null, ee = !0;
|
|
2906
3179
|
try {
|
|
2907
3180
|
if (!e.pendingAppendItems.value.length) return;
|
|
2908
|
-
await t(), await
|
|
3181
|
+
await t(), await _(), await _();
|
|
2909
3182
|
} finally {
|
|
2910
3183
|
d.value = null, ee = !1;
|
|
2911
3184
|
}
|
|
2912
|
-
},
|
|
3185
|
+
}, Wr));
|
|
2913
3186
|
}
|
|
2914
|
-
function
|
|
3187
|
+
function de() {
|
|
2915
3188
|
z &&= (clearTimeout(z), null);
|
|
2916
3189
|
}
|
|
2917
|
-
function
|
|
3190
|
+
function fe() {
|
|
2918
3191
|
B && (clearTimeout(B), B = null, p.value = !1);
|
|
2919
3192
|
}
|
|
2920
3193
|
return {
|
|
2921
|
-
columnWidth:
|
|
3194
|
+
columnWidth: g,
|
|
2922
3195
|
containerHeight: C,
|
|
2923
|
-
getCardStyle:
|
|
3196
|
+
getCardStyle: U,
|
|
2924
3197
|
getLeavingCardStyle: N.getLeavingCardStyle,
|
|
2925
|
-
getScrollbarThumbStyle:
|
|
3198
|
+
getScrollbarThumbStyle: ce,
|
|
2926
3199
|
leavingItems: N.leavingItems,
|
|
2927
|
-
nextBoundaryLoadProgress:
|
|
2928
|
-
onScroll:
|
|
2929
|
-
onWheel:
|
|
2930
|
-
paginationLabel:
|
|
3200
|
+
nextBoundaryLoadProgress: T,
|
|
3201
|
+
onScroll: V,
|
|
3202
|
+
onWheel: H,
|
|
3203
|
+
paginationLabel: E,
|
|
2931
3204
|
previousBoundaryLoadProgress: O,
|
|
2932
|
-
renderedItems:
|
|
3205
|
+
renderedItems: b,
|
|
2933
3206
|
resolvedActiveIndex: v,
|
|
2934
|
-
scrollToIndex:
|
|
3207
|
+
scrollToIndex: W,
|
|
2935
3208
|
showScrollbar: A,
|
|
2936
3209
|
scrollViewportRef: t
|
|
2937
3210
|
};
|
|
2938
3211
|
}
|
|
2939
|
-
function
|
|
3212
|
+
function Xr(e, t, n) {
|
|
2940
3213
|
return Math.min(Math.max(e, t), n);
|
|
2941
3214
|
}
|
|
2942
|
-
function
|
|
3215
|
+
function Zr(e) {
|
|
2943
3216
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
2944
3217
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
2945
|
-
return t <= 0 ? 1 :
|
|
3218
|
+
return t <= 0 ? 1 : Xr(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
|
|
2946
3219
|
}
|
|
2947
|
-
function
|
|
3220
|
+
function Qr(e) {
|
|
2948
3221
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
2949
3222
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
2950
|
-
return t <= 0 ? 1 :
|
|
3223
|
+
return t <= 0 ? 1 : Xr(e.progressDistancePx / t, 0, 1);
|
|
2951
3224
|
}
|
|
2952
3225
|
//#endregion
|
|
2953
3226
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
2954
|
-
function
|
|
3227
|
+
function $r(e) {
|
|
2955
3228
|
if (e) try {
|
|
2956
3229
|
e.removeAttribute("src"), e.src = "";
|
|
2957
3230
|
} catch {}
|
|
2958
3231
|
}
|
|
2959
|
-
function
|
|
3232
|
+
function ei(e) {
|
|
2960
3233
|
if (e) {
|
|
2961
3234
|
try {
|
|
2962
3235
|
e.currentTime = 0;
|
|
@@ -2967,12 +3240,12 @@ function Ur(e) {
|
|
|
2967
3240
|
} catch {}
|
|
2968
3241
|
}
|
|
2969
3242
|
}
|
|
2970
|
-
function
|
|
3243
|
+
function ti(e, t) {
|
|
2971
3244
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
2972
3245
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
2973
3246
|
return e.bottom > 0 && e.top < n;
|
|
2974
3247
|
}
|
|
2975
|
-
function
|
|
3248
|
+
function ni(e) {
|
|
2976
3249
|
if (!e) return null;
|
|
2977
3250
|
try {
|
|
2978
3251
|
return new URL(e, window.location.href).href;
|
|
@@ -2982,9 +3255,9 @@ function Gr(e) {
|
|
|
2982
3255
|
}
|
|
2983
3256
|
//#endregion
|
|
2984
3257
|
//#region src/components/viewer-core/listPreview.ts
|
|
2985
|
-
var
|
|
2986
|
-
function
|
|
2987
|
-
let t =
|
|
3258
|
+
var ri = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, ii = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, ai = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
|
|
3259
|
+
function oi(e) {
|
|
3260
|
+
let t = si(e), n = t?.url, r = cr(e), i = e.title?.trim() || Et(e.type);
|
|
2988
3261
|
return t?.mediaType === "video" && typeof n == "string" ? {
|
|
2989
3262
|
kind: "video",
|
|
2990
3263
|
url: n,
|
|
@@ -3003,13 +3276,13 @@ function Yr(e) {
|
|
|
3003
3276
|
width: r.width,
|
|
3004
3277
|
height: r.height,
|
|
3005
3278
|
label: i
|
|
3006
|
-
} : typeof n == "string" &&
|
|
3279
|
+
} : typeof n == "string" && li(e, n) ? {
|
|
3007
3280
|
kind: "video",
|
|
3008
3281
|
url: n,
|
|
3009
3282
|
width: r.width,
|
|
3010
3283
|
height: r.height,
|
|
3011
3284
|
label: i
|
|
3012
|
-
} : typeof n == "string" &&
|
|
3285
|
+
} : typeof n == "string" && ci(e, n) ? {
|
|
3013
3286
|
kind: "image",
|
|
3014
3287
|
url: n,
|
|
3015
3288
|
width: r.width,
|
|
@@ -3023,99 +3296,31 @@ function Yr(e) {
|
|
|
3023
3296
|
label: i
|
|
3024
3297
|
};
|
|
3025
3298
|
}
|
|
3026
|
-
function
|
|
3299
|
+
function si(e) {
|
|
3027
3300
|
return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
|
|
3028
3301
|
}
|
|
3029
|
-
function
|
|
3030
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
3302
|
+
function ci(e, t) {
|
|
3303
|
+
return e.type !== "image" || typeof t != "string" ? !1 : ri.test(t) || ui(t);
|
|
3031
3304
|
}
|
|
3032
|
-
function
|
|
3033
|
-
return e.type !== "video" || typeof t != "string" ? !1 :
|
|
3305
|
+
function li(e, t) {
|
|
3306
|
+
return e.type !== "video" || typeof t != "string" ? !1 : ii.test(t) || di(t);
|
|
3034
3307
|
}
|
|
3035
|
-
function
|
|
3308
|
+
function ui(e) {
|
|
3036
3309
|
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
3037
3310
|
}
|
|
3038
|
-
function
|
|
3039
|
-
return
|
|
3040
|
-
}
|
|
3041
|
-
//#endregion
|
|
3042
|
-
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
3043
|
-
var ti = {
|
|
3044
|
-
maxGlobal: 10,
|
|
3045
|
-
maxPerDomain: 4,
|
|
3046
|
-
maxVideoPerDomain: 2
|
|
3047
|
-
};
|
|
3048
|
-
function ni(e = ti) {
|
|
3049
|
-
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
|
|
3050
|
-
function i(e) {
|
|
3051
|
-
let i = {
|
|
3052
|
-
...e,
|
|
3053
|
-
domain: ai(e.url),
|
|
3054
|
-
enqueuedAt: r,
|
|
3055
|
-
id: `vibe-asset-load-${r += 1}`
|
|
3056
|
-
};
|
|
3057
|
-
return n.set(i.id, i), a(), {
|
|
3058
|
-
cancel() {
|
|
3059
|
-
(n.delete(i.id) || t.delete(i.id)) && a();
|
|
3060
|
-
},
|
|
3061
|
-
refresh() {
|
|
3062
|
-
a();
|
|
3063
|
-
},
|
|
3064
|
-
release() {
|
|
3065
|
-
(t.delete(i.id) || n.delete(i.id)) && a();
|
|
3066
|
-
}
|
|
3067
|
-
};
|
|
3068
|
-
}
|
|
3069
|
-
function a() {
|
|
3070
|
-
if (n.size === 0) return;
|
|
3071
|
-
let r = [...n.values()].sort((e, t) => {
|
|
3072
|
-
let n = ii(e) - ii(t);
|
|
3073
|
-
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
3074
|
-
});
|
|
3075
|
-
for (let i of r) {
|
|
3076
|
-
if (t.size >= e.maxGlobal) return;
|
|
3077
|
-
if (o(i)) {
|
|
3078
|
-
n.delete(i.id), t.set(i.id, i);
|
|
3079
|
-
try {
|
|
3080
|
-
i.onGrant();
|
|
3081
|
-
} catch {
|
|
3082
|
-
t.delete(i.id);
|
|
3083
|
-
}
|
|
3084
|
-
}
|
|
3085
|
-
}
|
|
3086
|
-
}
|
|
3087
|
-
function o(n) {
|
|
3088
|
-
let r = [...t.values()].filter((e) => e.domain === n.domain);
|
|
3089
|
-
return !(r.length >= e.maxPerDomain || n.assetType === "video" && r.filter((e) => e.assetType === "video").length >= e.maxVideoPerDomain);
|
|
3090
|
-
}
|
|
3091
|
-
return { request: i };
|
|
3092
|
-
}
|
|
3093
|
-
var ri = ni();
|
|
3094
|
-
function ii(e) {
|
|
3095
|
-
try {
|
|
3096
|
-
let t = e.getPriority();
|
|
3097
|
-
return Number.isFinite(t) ? t : Infinity;
|
|
3098
|
-
} catch {
|
|
3099
|
-
return Infinity;
|
|
3100
|
-
}
|
|
3101
|
-
}
|
|
3102
|
-
function ai(e) {
|
|
3103
|
-
try {
|
|
3104
|
-
return new URL(e).hostname || "local";
|
|
3105
|
-
} catch {
|
|
3106
|
-
return "local";
|
|
3107
|
-
}
|
|
3311
|
+
function di(e) {
|
|
3312
|
+
return ai.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
|
|
3108
3313
|
}
|
|
3109
3314
|
//#endregion
|
|
3110
3315
|
//#region src/components/viewer-core/useListCardHealthCheck.ts
|
|
3111
|
-
function
|
|
3112
|
-
let t =
|
|
3113
|
-
let t = typeof e.item.value.healthCheck?.url == "string" ?
|
|
3316
|
+
function fi(e) {
|
|
3317
|
+
let t = D(null), n = i(() => {
|
|
3318
|
+
let t = typeof e.item.value.healthCheck?.url == "string" ? ni(e.item.value.healthCheck.url) : null;
|
|
3114
3319
|
return !t || t === e.attachedAssetUrl.value ? null : t;
|
|
3115
3320
|
}), r = null, a = 0, o = /* @__PURE__ */ new Map();
|
|
3116
|
-
|
|
3321
|
+
L(n, (e, n) => {
|
|
3117
3322
|
e !== n && (t.value = null, l(), a += 1);
|
|
3118
|
-
}),
|
|
3323
|
+
}), L([
|
|
3119
3324
|
n,
|
|
3120
3325
|
e.surfaceActive,
|
|
3121
3326
|
e.isInView,
|
|
@@ -3142,7 +3347,7 @@ function oi(e) {
|
|
|
3142
3347
|
r.refresh();
|
|
3143
3348
|
return;
|
|
3144
3349
|
}
|
|
3145
|
-
r =
|
|
3350
|
+
r = kt.request({
|
|
3146
3351
|
assetType: "probe",
|
|
3147
3352
|
getPriority: e.getPriority,
|
|
3148
3353
|
onGrant() {
|
|
@@ -3152,7 +3357,7 @@ function oi(e) {
|
|
|
3152
3357
|
return;
|
|
3153
3358
|
}
|
|
3154
3359
|
let i = ++a;
|
|
3155
|
-
|
|
3360
|
+
nn(r).then((s) => {
|
|
3156
3361
|
if (!(i !== a || n.value !== r)) {
|
|
3157
3362
|
if (o.set(r, s ?? null), !s) {
|
|
3158
3363
|
t.value = null;
|
|
@@ -3188,14 +3393,14 @@ function oi(e) {
|
|
|
3188
3393
|
}
|
|
3189
3394
|
//#endregion
|
|
3190
3395
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
3191
|
-
var
|
|
3396
|
+
var pi = ["aria-label"], mi = {
|
|
3192
3397
|
key: 0,
|
|
3193
3398
|
"data-testid": "vibe-list-card-spinner",
|
|
3194
3399
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
3195
|
-
},
|
|
3400
|
+
}, hi = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, gi = ["src", "alt"], _i = ["src"], vi = ["data-kind"], yi = { class: "grid justify-items-center gap-3 px-4 text-center" }, bi = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, xi = {
|
|
3196
3401
|
key: 4,
|
|
3197
3402
|
class: "grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.08),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
|
|
3198
|
-
},
|
|
3403
|
+
}, Si = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Ci = { class: "pointer-events-none absolute inset-0 z-[3]" }, wi = /* @__PURE__ */ d({
|
|
3199
3404
|
__name: "ListCard",
|
|
3200
3405
|
props: {
|
|
3201
3406
|
active: {
|
|
@@ -3219,106 +3424,106 @@ var si = ["aria-label"], ci = {
|
|
|
3219
3424
|
},
|
|
3220
3425
|
emits: ["open"],
|
|
3221
3426
|
setup(e, { emit: t }) {
|
|
3222
|
-
let n = e, r = t, l = i(() =>
|
|
3223
|
-
attachedAssetUrl:
|
|
3224
|
-
getPriority:
|
|
3427
|
+
let n = e, r = t, l = i(() => oi(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = fi({
|
|
3428
|
+
attachedAssetUrl: E,
|
|
3429
|
+
getPriority: X,
|
|
3225
3430
|
isInView: d,
|
|
3226
3431
|
isReady: m,
|
|
3227
3432
|
item: i(() => n.item),
|
|
3228
3433
|
loadErrorKind: g,
|
|
3229
3434
|
reportAssetError: n.reportAssetError,
|
|
3230
3435
|
surfaceActive: i(() => n.surfaceActive)
|
|
3231
|
-
}),
|
|
3232
|
-
|
|
3436
|
+
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => en(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
|
|
3437
|
+
L([E, () => l.value.kind], () => {
|
|
3233
3438
|
let e = l.value.kind === "fallback";
|
|
3234
|
-
m.value = e, h.value = !1, g.value = null, e && (
|
|
3235
|
-
}),
|
|
3236
|
-
|
|
3237
|
-
}),
|
|
3439
|
+
m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
|
|
3440
|
+
}), L(O, () => {
|
|
3441
|
+
K();
|
|
3442
|
+
}), L([
|
|
3238
3443
|
d,
|
|
3239
3444
|
m,
|
|
3240
|
-
|
|
3445
|
+
E
|
|
3241
3446
|
], () => {
|
|
3242
|
-
|
|
3243
|
-
}),
|
|
3447
|
+
q();
|
|
3448
|
+
}), L(() => n.surfaceActive, (e) => {
|
|
3244
3449
|
if (!e) {
|
|
3245
|
-
|
|
3450
|
+
J(), q();
|
|
3246
3451
|
return;
|
|
3247
3452
|
}
|
|
3248
3453
|
requestAnimationFrame(() => {
|
|
3249
|
-
|
|
3454
|
+
Y(), K(), q();
|
|
3250
3455
|
});
|
|
3251
|
-
}),
|
|
3456
|
+
}), S(() => {
|
|
3252
3457
|
if (!y.value || typeof IntersectionObserver > "u") {
|
|
3253
|
-
|
|
3458
|
+
b.value = null, d.value = !0, K();
|
|
3254
3459
|
return;
|
|
3255
3460
|
}
|
|
3256
|
-
|
|
3257
|
-
for (let t of e) t.target === y.value && (n.surfaceActive &&
|
|
3461
|
+
b.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"), te = new IntersectionObserver((e) => {
|
|
3462
|
+
for (let t of e) t.target === y.value && (n.surfaceActive && Y(t), K(), q());
|
|
3258
3463
|
}, {
|
|
3259
|
-
root:
|
|
3464
|
+
root: b.value,
|
|
3260
3465
|
threshold: [0, 1]
|
|
3261
|
-
}),
|
|
3262
|
-
}),
|
|
3263
|
-
|
|
3466
|
+
}), te.observe(y.value);
|
|
3467
|
+
}), x(() => {
|
|
3468
|
+
re(), F.release(), te?.disconnect(), te = null;
|
|
3264
3469
|
});
|
|
3265
|
-
function
|
|
3266
|
-
|
|
3470
|
+
function U() {
|
|
3471
|
+
ue(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url), J());
|
|
3267
3472
|
}
|
|
3268
|
-
async function
|
|
3269
|
-
if (!
|
|
3270
|
-
let e =
|
|
3473
|
+
async function W() {
|
|
3474
|
+
if (!ue(_.value)) return;
|
|
3475
|
+
let e = E.value ?? n.item.url;
|
|
3271
3476
|
m.value = !1, g.value = "generic";
|
|
3272
|
-
let t = await
|
|
3477
|
+
let t = await tn(e);
|
|
3273
3478
|
g.value = t, n.reportAssetError?.({
|
|
3274
3479
|
item: n.item,
|
|
3275
3480
|
occurrenceKey: $(n.item),
|
|
3276
3481
|
url: e,
|
|
3277
3482
|
kind: t,
|
|
3278
3483
|
surface: "grid"
|
|
3279
|
-
}),
|
|
3484
|
+
}), J();
|
|
3280
3485
|
}
|
|
3281
|
-
function
|
|
3282
|
-
|
|
3486
|
+
function ne() {
|
|
3487
|
+
ue(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url), J(), q());
|
|
3283
3488
|
}
|
|
3284
|
-
function
|
|
3285
|
-
|
|
3489
|
+
function G() {
|
|
3490
|
+
ue(C.value) && (h.value || (m.value = !1));
|
|
3286
3491
|
}
|
|
3287
|
-
function
|
|
3492
|
+
function K() {
|
|
3288
3493
|
if (l.value.kind === "fallback") {
|
|
3289
|
-
|
|
3494
|
+
re(!1);
|
|
3290
3495
|
return;
|
|
3291
3496
|
}
|
|
3292
3497
|
if (!n.surfaceActive) {
|
|
3293
|
-
|
|
3498
|
+
J();
|
|
3294
3499
|
return;
|
|
3295
3500
|
}
|
|
3296
|
-
if (!
|
|
3297
|
-
|
|
3501
|
+
if (!O.value) {
|
|
3502
|
+
re();
|
|
3298
3503
|
return;
|
|
3299
3504
|
}
|
|
3300
|
-
if (
|
|
3301
|
-
|
|
3505
|
+
if (T.value || V) {
|
|
3506
|
+
V?.refresh();
|
|
3302
3507
|
return;
|
|
3303
3508
|
}
|
|
3304
|
-
|
|
3509
|
+
V = kt.request({
|
|
3305
3510
|
assetType: l.value.kind,
|
|
3306
|
-
getPriority:
|
|
3511
|
+
getPriority: X,
|
|
3307
3512
|
onGrant() {
|
|
3308
|
-
|
|
3513
|
+
T.value = !0, m.value = !1, g.value = null;
|
|
3309
3514
|
},
|
|
3310
3515
|
url: l.value.url ?? n.item.url
|
|
3311
3516
|
});
|
|
3312
3517
|
}
|
|
3313
|
-
function
|
|
3314
|
-
let e =
|
|
3518
|
+
function q() {
|
|
3519
|
+
let e = C.value;
|
|
3315
3520
|
if (!(!e || l.value.kind !== "video")) {
|
|
3316
|
-
if (
|
|
3521
|
+
if (I.value) {
|
|
3317
3522
|
e.pause();
|
|
3318
3523
|
return;
|
|
3319
3524
|
}
|
|
3320
|
-
if (
|
|
3321
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
3525
|
+
if (E.value && d.value && m.value) {
|
|
3526
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, on(e);
|
|
3322
3527
|
return;
|
|
3323
3528
|
}
|
|
3324
3529
|
try {
|
|
@@ -3327,24 +3532,24 @@ var si = ["aria-label"], ci = {
|
|
|
3327
3532
|
e.pause();
|
|
3328
3533
|
}
|
|
3329
3534
|
}
|
|
3330
|
-
function
|
|
3331
|
-
|
|
3535
|
+
function re(e = !0) {
|
|
3536
|
+
T.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (se(), ce()), J();
|
|
3332
3537
|
}
|
|
3333
|
-
function
|
|
3334
|
-
|
|
3538
|
+
function J() {
|
|
3539
|
+
V?.release(), V = null;
|
|
3335
3540
|
}
|
|
3336
|
-
function
|
|
3541
|
+
function Y(e) {
|
|
3337
3542
|
let t = y.value;
|
|
3338
3543
|
if (!t) {
|
|
3339
3544
|
d.value = !0;
|
|
3340
3545
|
return;
|
|
3341
3546
|
}
|
|
3342
|
-
d.value =
|
|
3547
|
+
d.value = ti(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
|
|
3343
3548
|
}
|
|
3344
3549
|
function ie(e) {
|
|
3345
3550
|
if (!e) return;
|
|
3346
3551
|
let t = $(n.item), r = `${t}|${e}`;
|
|
3347
|
-
|
|
3552
|
+
H.has(r) || (H.add(r), n.reportAssetLoad?.({
|
|
3348
3553
|
item: n.item,
|
|
3349
3554
|
occurrenceKey: t,
|
|
3350
3555
|
surface: "grid",
|
|
@@ -3352,50 +3557,50 @@ var si = ["aria-label"], ci = {
|
|
|
3352
3557
|
}));
|
|
3353
3558
|
}
|
|
3354
3559
|
function ae() {
|
|
3355
|
-
if (!
|
|
3560
|
+
if (!z.value || F.retry()) return;
|
|
3356
3561
|
let e = $(n.item);
|
|
3357
|
-
|
|
3358
|
-
t.startsWith(`${e}|`) &&
|
|
3359
|
-
}), g.value = null, m.value = !1,
|
|
3562
|
+
H.forEach((t) => {
|
|
3563
|
+
t.startsWith(`${e}|`) && H.delete(t);
|
|
3564
|
+
}), g.value = null, m.value = !1, T.value = !1, J(), K();
|
|
3360
3565
|
}
|
|
3361
3566
|
function se() {
|
|
3362
|
-
|
|
3567
|
+
$r(_.value);
|
|
3363
3568
|
}
|
|
3364
3569
|
function ce() {
|
|
3365
|
-
|
|
3570
|
+
ei(C.value);
|
|
3366
3571
|
}
|
|
3367
|
-
function
|
|
3572
|
+
function X() {
|
|
3368
3573
|
let e = y.value;
|
|
3369
3574
|
if (!e) return Infinity;
|
|
3370
3575
|
let t = e.getBoundingClientRect();
|
|
3371
|
-
if (
|
|
3372
|
-
let e =
|
|
3576
|
+
if (b.value) {
|
|
3577
|
+
let e = b.value.getBoundingClientRect(), n = e.top + e.height / 2;
|
|
3373
3578
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3374
3579
|
}
|
|
3375
3580
|
let n = window.innerHeight / 2;
|
|
3376
3581
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3377
3582
|
}
|
|
3378
|
-
function
|
|
3379
|
-
let t =
|
|
3380
|
-
return !e || !t ? !1 :
|
|
3583
|
+
function ue(e) {
|
|
3584
|
+
let t = ni(E.value);
|
|
3585
|
+
return !e || !t ? !1 : ni("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3381
3586
|
}
|
|
3382
|
-
function
|
|
3587
|
+
function de() {
|
|
3383
3588
|
r("open");
|
|
3384
3589
|
}
|
|
3385
|
-
function
|
|
3590
|
+
function fe() {
|
|
3386
3591
|
f.value = !0;
|
|
3387
3592
|
}
|
|
3388
|
-
function
|
|
3593
|
+
function Z(e) {
|
|
3389
3594
|
let t = e.relatedTarget;
|
|
3390
3595
|
y.value && t instanceof Node && y.value.contains(t) || (f.value = !1);
|
|
3391
3596
|
}
|
|
3392
|
-
return (e, t) => (
|
|
3597
|
+
return (e, t) => (w(), s("div", {
|
|
3393
3598
|
ref_key: "rootRef",
|
|
3394
3599
|
ref: y,
|
|
3395
3600
|
"data-testid": "vibe-list-card-inner",
|
|
3396
|
-
class:
|
|
3397
|
-
onFocusin:
|
|
3398
|
-
onFocusout:
|
|
3601
|
+
class: v(["group relative h-full w-full overflow-hidden border bg-[#0a0b0f] text-[#f7f1ea] transition-[border-color,transform] duration-300", n.active ? "border-white/28" : "border-white/12 hover:border-white/24"]),
|
|
3602
|
+
onFocusin: fe,
|
|
3603
|
+
onFocusout: Z,
|
|
3399
3604
|
onPointerenter: t[0] ||= (e) => p.value = !0,
|
|
3400
3605
|
onPointerleave: t[1] ||= (e) => p.value = !1
|
|
3401
3606
|
}, [
|
|
@@ -3404,90 +3609,90 @@ var si = ["aria-label"], ci = {
|
|
|
3404
3609
|
"data-testid": "vibe-list-card-open",
|
|
3405
3610
|
class: "absolute inset-0 z-[1] block h-full w-full cursor-pointer text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
|
|
3406
3611
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3407
|
-
onClick:
|
|
3408
|
-
}, null, 8,
|
|
3409
|
-
|
|
3612
|
+
onClick: de
|
|
3613
|
+
}, null, 8, pi),
|
|
3614
|
+
B.value ? (w(), s("div", mi, [c("span", hi, [u(N(oe), {
|
|
3410
3615
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3411
3616
|
"aria-hidden": "true"
|
|
3412
3617
|
})])])) : o("", !0),
|
|
3413
|
-
|
|
3618
|
+
M.value && E.value && !R.value ? (w(), s("img", {
|
|
3414
3619
|
key: 1,
|
|
3415
3620
|
ref_key: "imageRef",
|
|
3416
|
-
ref:
|
|
3417
|
-
src:
|
|
3621
|
+
ref: _,
|
|
3622
|
+
src: E.value,
|
|
3418
3623
|
alt: l.value.label,
|
|
3419
3624
|
draggable: "false",
|
|
3420
|
-
class:
|
|
3421
|
-
onLoad:
|
|
3422
|
-
onError:
|
|
3423
|
-
}, null, 42,
|
|
3625
|
+
class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3626
|
+
onLoad: U,
|
|
3627
|
+
onError: W
|
|
3628
|
+
}, null, 42, gi)) : P.value && E.value && !R.value ? (w(), s("video", {
|
|
3424
3629
|
key: 2,
|
|
3425
3630
|
ref_key: "videoRef",
|
|
3426
|
-
ref:
|
|
3427
|
-
src:
|
|
3631
|
+
ref: C,
|
|
3632
|
+
src: E.value,
|
|
3428
3633
|
muted: "",
|
|
3429
3634
|
loop: "",
|
|
3430
3635
|
playsinline: "",
|
|
3431
3636
|
preload: "metadata",
|
|
3432
|
-
class:
|
|
3433
|
-
onCanplay:
|
|
3434
|
-
onError:
|
|
3435
|
-
onLoadstart:
|
|
3436
|
-
onPlaying:
|
|
3437
|
-
onStalled:
|
|
3438
|
-
onWaiting:
|
|
3439
|
-
}, null, 42,
|
|
3637
|
+
class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3638
|
+
onCanplay: ne,
|
|
3639
|
+
onError: W,
|
|
3640
|
+
onLoadstart: G,
|
|
3641
|
+
onPlaying: ne,
|
|
3642
|
+
onStalled: G,
|
|
3643
|
+
onWaiting: G
|
|
3644
|
+
}, null, 42, _i)) : R.value ? (w(), s("div", {
|
|
3440
3645
|
key: 3,
|
|
3441
3646
|
"data-testid": "vibe-list-card-error",
|
|
3442
|
-
"data-kind":
|
|
3647
|
+
"data-kind": I.value,
|
|
3443
3648
|
class: "pointer-events-none relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
|
|
3444
|
-
}, [c("div",
|
|
3445
|
-
u(
|
|
3649
|
+
}, [c("div", yi, [
|
|
3650
|
+
u(N(le), {
|
|
3446
3651
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3447
3652
|
"aria-hidden": "true"
|
|
3448
3653
|
}),
|
|
3449
|
-
c("span",
|
|
3450
|
-
|
|
3654
|
+
c("span", bi, j(N($t)(I.value)), 1),
|
|
3655
|
+
z.value ? (w(), s("button", {
|
|
3451
3656
|
key: 0,
|
|
3452
3657
|
type: "button",
|
|
3453
3658
|
class: "pointer-events-auto inline-flex items-center justify-center border border-white/14 bg-black/35 px-3 py-2 text-[0.62rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
|
|
3454
|
-
onClick:
|
|
3659
|
+
onClick: ee(ae, ["stop"])
|
|
3455
3660
|
}, " Retry ")) : o("", !0)
|
|
3456
|
-
])], 8,
|
|
3457
|
-
icon:
|
|
3661
|
+
])], 8, vi)) : (w(), s("div", xi, [c("div", Si, [k(e.$slots, "item-icon", {
|
|
3662
|
+
icon: N(Tt)(n.item.type),
|
|
3458
3663
|
item: n.item
|
|
3459
|
-
}, () => [(
|
|
3664
|
+
}, () => [(w(), a(A(N(Tt)(n.item.type)), {
|
|
3460
3665
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3461
3666
|
"aria-hidden": "true"
|
|
3462
3667
|
}))])])])),
|
|
3463
|
-
c("div",
|
|
3668
|
+
c("div", Ci, [k(e.$slots, "grid-item-overlay", {
|
|
3464
3669
|
active: n.active,
|
|
3465
3670
|
focused: f.value,
|
|
3466
3671
|
hovered: p.value,
|
|
3467
3672
|
index: n.index,
|
|
3468
3673
|
item: n.item,
|
|
3469
|
-
openFullscreen:
|
|
3674
|
+
openFullscreen: de
|
|
3470
3675
|
})])
|
|
3471
3676
|
], 34));
|
|
3472
3677
|
}
|
|
3473
|
-
}),
|
|
3678
|
+
}), Ti = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, Ei = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Di = {
|
|
3474
3679
|
"data-testid": "vibe-pagination",
|
|
3475
3680
|
class: "inline-flex shrink-0 items-center gap-2 whitespace-nowrap border border-white/14 bg-black/40 px-3 py-2 text-[0.63rem] font-bold uppercase tracking-[0.12em] text-[#f7f1ea]/72 backdrop-blur-[18px] min-[721px]:gap-3 min-[721px]:px-4 min-[721px]:py-3 min-[721px]:text-[0.74rem] min-[721px]:tracking-[0.2em]"
|
|
3476
|
-
},
|
|
3681
|
+
}, Oi = { class: "whitespace-nowrap" }, ki = {
|
|
3477
3682
|
key: 0,
|
|
3478
3683
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3479
|
-
},
|
|
3684
|
+
}, Ai = [
|
|
3480
3685
|
"data-active",
|
|
3481
3686
|
"data-index",
|
|
3482
3687
|
"data-item-id",
|
|
3483
3688
|
"data-occurrence-key"
|
|
3484
|
-
],
|
|
3689
|
+
], ji = ["data-item-id"], Mi = {
|
|
3485
3690
|
key: 0,
|
|
3486
3691
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3487
|
-
},
|
|
3692
|
+
}, Ni = {
|
|
3488
3693
|
key: 1,
|
|
3489
3694
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3490
|
-
},
|
|
3695
|
+
}, Pi = { class: "mx-auto flex w-full justify-center" }, Fi = /* @__PURE__ */ d({
|
|
3491
3696
|
__name: "ListSurface",
|
|
3492
3697
|
props: {
|
|
3493
3698
|
active: {
|
|
@@ -3548,75 +3753,75 @@ var si = ["aria-label"], ci = {
|
|
|
3548
3753
|
"update:activeIndex"
|
|
3549
3754
|
],
|
|
3550
3755
|
setup(e, { emit: n }) {
|
|
3551
|
-
let r = e, d =
|
|
3552
|
-
active:
|
|
3553
|
-
allowExhaustedNextPageRefresh:
|
|
3554
|
-
items:
|
|
3555
|
-
activeIndex:
|
|
3556
|
-
loading:
|
|
3557
|
-
hasNextPage:
|
|
3558
|
-
hasPreviousPage:
|
|
3559
|
-
paginationDetail:
|
|
3560
|
-
pendingAppendItems:
|
|
3561
|
-
commitPendingAppend:
|
|
3562
|
-
requestNextPage:
|
|
3563
|
-
requestPreviousPage:
|
|
3756
|
+
let r = e, d = F(), f = n, p = Yr({
|
|
3757
|
+
active: M(r, "active"),
|
|
3758
|
+
allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
|
|
3759
|
+
items: M(r, "items"),
|
|
3760
|
+
activeIndex: M(r, "activeIndex"),
|
|
3761
|
+
loading: M(r, "loading"),
|
|
3762
|
+
hasNextPage: M(r, "hasNextPage"),
|
|
3763
|
+
hasPreviousPage: M(r, "hasPreviousPage"),
|
|
3764
|
+
paginationDetail: M(r, "paginationDetail"),
|
|
3765
|
+
pendingAppendItems: M(r, "pendingAppendItems"),
|
|
3766
|
+
commitPendingAppend: M(r, "commitPendingAppend"),
|
|
3767
|
+
requestNextPage: M(r, "requestNextPage"),
|
|
3768
|
+
requestPreviousPage: M(r, "requestPreviousPage"),
|
|
3564
3769
|
setActiveIndex(e) {
|
|
3565
3770
|
f("update:activeIndex", e);
|
|
3566
3771
|
}
|
|
3567
|
-
}), m = i(() =>
|
|
3772
|
+
}), m = i(() => Wt({
|
|
3568
3773
|
itemCount: r.items.length,
|
|
3569
3774
|
loading: r.loading,
|
|
3570
3775
|
phase: r.phase
|
|
3571
|
-
})),
|
|
3776
|
+
})), h = i(() => Gt({
|
|
3572
3777
|
errorMessage: r.errorMessage,
|
|
3573
3778
|
hasItems: r.items.length > 0,
|
|
3574
3779
|
hasNextPage: r.hasNextPage,
|
|
3575
3780
|
phase: m.value,
|
|
3576
3781
|
surface: "grid"
|
|
3577
|
-
})),
|
|
3782
|
+
})), _ = i(() => !r.showStatusBadges || !h.value ? null : {
|
|
3578
3783
|
activeIndex: p.resolvedActiveIndex.value,
|
|
3579
|
-
kind:
|
|
3784
|
+
kind: h.value.kind,
|
|
3580
3785
|
loading: r.loading,
|
|
3581
|
-
message:
|
|
3786
|
+
message: h.value.message,
|
|
3582
3787
|
paginationDetail: r.paginationDetail,
|
|
3583
3788
|
total: r.items.length
|
|
3584
|
-
}), x = i(() => !
|
|
3585
|
-
emptyStateMode:
|
|
3586
|
-
itemCount:
|
|
3587
|
-
loading:
|
|
3789
|
+
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => zt(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Ht({
|
|
3790
|
+
emptyStateMode: M(r, "emptyStateMode"),
|
|
3791
|
+
itemCount: C,
|
|
3792
|
+
loading: M(r, "loading"),
|
|
3588
3793
|
renderSlot: d["empty-state"],
|
|
3589
3794
|
surface: "grid"
|
|
3590
3795
|
});
|
|
3591
|
-
return
|
|
3796
|
+
return L([p.nextBoundaryLoadProgress, p.previousBoundaryLoadProgress], ([e, t]) => {
|
|
3592
3797
|
f("boundary-load-progress", {
|
|
3593
3798
|
nextBoundaryLoadProgress: e,
|
|
3594
3799
|
previousBoundaryLoadProgress: t
|
|
3595
3800
|
});
|
|
3596
|
-
}, { immediate: !0 }), (e, n) => (
|
|
3597
|
-
c("div",
|
|
3801
|
+
}, { immediate: !0 }), (e, n) => (w(), s("div", Ti, [
|
|
3802
|
+
c("div", Ei, [c("span", Di, [c("span", Oi, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", ki, j(r.paginationDetail), 1)) : o("", !0)])]),
|
|
3598
3803
|
c("div", {
|
|
3599
|
-
ref:
|
|
3804
|
+
ref: N(p).scrollViewportRef,
|
|
3600
3805
|
"data-testid": "vibe-list-scroll",
|
|
3601
3806
|
class: "h-full min-h-0 overflow-y-auto overflow-x-hidden [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
3602
|
-
onScroll: n[0] ||= (...e) =>
|
|
3603
|
-
onWheel: n[1] ||= (...e) =>
|
|
3807
|
+
onScroll: n[0] ||= (...e) => N(p).onScroll && N(p).onScroll(...e),
|
|
3808
|
+
onWheel: n[1] ||= (...e) => N(p).onWheel && N(p).onWheel(...e)
|
|
3604
3809
|
}, [c("div", {
|
|
3605
3810
|
"data-testid": "vibe-list-content",
|
|
3606
3811
|
class: "relative",
|
|
3607
|
-
style:
|
|
3812
|
+
style: b({ height: `${N(p).containerHeight.value}px` })
|
|
3608
3813
|
}, [
|
|
3609
|
-
(
|
|
3610
|
-
key:
|
|
3814
|
+
(w(!0), s(t, null, O(N(p).renderedItems.value, ({ item: t, index: n }) => (w(), s("article", {
|
|
3815
|
+
key: N($)(t),
|
|
3611
3816
|
"data-testid": "vibe-list-card",
|
|
3612
|
-
"data-active": n ===
|
|
3817
|
+
"data-active": n === N(p).resolvedActiveIndex.value ? "true" : "false",
|
|
3613
3818
|
"data-index": n,
|
|
3614
3819
|
"data-item-id": t.id,
|
|
3615
|
-
"data-occurrence-key":
|
|
3820
|
+
"data-occurrence-key": N($)(t),
|
|
3616
3821
|
class: "absolute will-change-transform",
|
|
3617
|
-
style:
|
|
3618
|
-
}, [u(
|
|
3619
|
-
active: n ===
|
|
3822
|
+
style: b(N(p).getCardStyle(n))
|
|
3823
|
+
}, [u(wi, {
|
|
3824
|
+
active: n === N(p).resolvedActiveIndex.value,
|
|
3620
3825
|
index: n,
|
|
3621
3826
|
item: t,
|
|
3622
3827
|
"report-asset-error": r.reportAssetError,
|
|
@@ -3625,11 +3830,11 @@ var si = ["aria-label"], ci = {
|
|
|
3625
3830
|
onOpen: (e) => f("open-fullscreen", n)
|
|
3626
3831
|
}, l({ _: 2 }, [d["grid-item-overlay"] ? {
|
|
3627
3832
|
name: "grid-item-overlay",
|
|
3628
|
-
fn:
|
|
3833
|
+
fn: z((t) => [k(e.$slots, "grid-item-overlay", g({ ref_for: !0 }, t))]),
|
|
3629
3834
|
key: "0"
|
|
3630
3835
|
} : void 0, d["item-icon"] ? {
|
|
3631
3836
|
name: "item-icon",
|
|
3632
|
-
fn:
|
|
3837
|
+
fn: z((t) => [k(e.$slots, "item-icon", g({ ref_for: !0 }, t))]),
|
|
3633
3838
|
key: "1"
|
|
3634
3839
|
} : void 0]), 1032, [
|
|
3635
3840
|
"active",
|
|
@@ -3639,14 +3844,14 @@ var si = ["aria-label"], ci = {
|
|
|
3639
3844
|
"report-asset-load",
|
|
3640
3845
|
"surface-active",
|
|
3641
3846
|
"onOpen"
|
|
3642
|
-
])], 12,
|
|
3643
|
-
(
|
|
3644
|
-
key: `leaving-${
|
|
3847
|
+
])], 12, Ai))), 128)),
|
|
3848
|
+
(w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
|
|
3849
|
+
key: `leaving-${N($)(t.item)}`,
|
|
3645
3850
|
"data-testid": "vibe-list-card-leaving",
|
|
3646
3851
|
"data-item-id": t.item.id,
|
|
3647
3852
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
3648
|
-
style:
|
|
3649
|
-
}, [u(
|
|
3853
|
+
style: b(N(p).getLeavingCardStyle(t.item))
|
|
3854
|
+
}, [u(wi, {
|
|
3650
3855
|
active: !1,
|
|
3651
3856
|
index: -1,
|
|
3652
3857
|
item: t.item,
|
|
@@ -3655,20 +3860,20 @@ var si = ["aria-label"], ci = {
|
|
|
3655
3860
|
"surface-active": !1
|
|
3656
3861
|
}, l({ _: 2 }, [d["item-icon"] ? {
|
|
3657
3862
|
name: "item-icon",
|
|
3658
|
-
fn:
|
|
3863
|
+
fn: z((t) => [k(e.$slots, "item-icon", g({ ref_for: !0 }, t))]),
|
|
3659
3864
|
key: "0"
|
|
3660
3865
|
} : void 0]), 1032, [
|
|
3661
3866
|
"item",
|
|
3662
3867
|
"report-asset-error",
|
|
3663
3868
|
"report-asset-load"
|
|
3664
|
-
])], 12,
|
|
3665
|
-
|
|
3869
|
+
])], 12, ji))), 128)),
|
|
3870
|
+
N(A) && N(T) ? (w(), a(Cn, {
|
|
3666
3871
|
key: 0,
|
|
3667
|
-
message:
|
|
3668
|
-
mode:
|
|
3669
|
-
surface:
|
|
3872
|
+
message: N(T).message,
|
|
3873
|
+
mode: N(T).mode,
|
|
3874
|
+
surface: N(T).surface
|
|
3670
3875
|
}, {
|
|
3671
|
-
default:
|
|
3876
|
+
default: z(() => [N(D) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(T)))) : o("", !0)]),
|
|
3672
3877
|
_: 3
|
|
3673
3878
|
}, 8, [
|
|
3674
3879
|
"message",
|
|
@@ -3676,28 +3881,28 @@ var si = ["aria-label"], ci = {
|
|
|
3676
3881
|
"surface"
|
|
3677
3882
|
])) : o("", !0)
|
|
3678
3883
|
], 4)], 544),
|
|
3679
|
-
|
|
3884
|
+
N(p).showScrollbar.value ? (w(), s("div", Mi, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
3680
3885
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
3681
|
-
class:
|
|
3682
|
-
style:
|
|
3886
|
+
class: v(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out", r.loading ? "bg-white/52" : "bg-white/34"]),
|
|
3887
|
+
style: b(N(p).getScrollbarThumbStyle())
|
|
3683
3888
|
}, null, 6)])) : o("", !0),
|
|
3684
|
-
d["grid-footer"] ? (
|
|
3685
|
-
|
|
3889
|
+
d["grid-footer"] ? (w(), s("div", Ni, [c("div", Pi, [k(e.$slots, "grid-footer")])])) : o("", !0),
|
|
3890
|
+
_.value ? (w(), s("div", {
|
|
3686
3891
|
key: 2,
|
|
3687
|
-
class:
|
|
3688
|
-
}, [
|
|
3892
|
+
class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
|
|
3893
|
+
}, [S.value ? k(e.$slots, "grid-status", y(g({ key: 0 }, _.value))) : (w(), s("span", {
|
|
3689
3894
|
key: 1,
|
|
3690
3895
|
"data-testid": "vibe-grid-status-badge",
|
|
3691
|
-
class:
|
|
3692
|
-
},
|
|
3693
|
-
|
|
3896
|
+
class: v(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", _.value.kind === "end" ? "border-amber-300/35 text-amber-200" : _.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
3897
|
+
}, j(_.value.message), 3))], 2)) : o("", !0),
|
|
3898
|
+
N(E) && N(T) ? (w(), a(Cn, {
|
|
3694
3899
|
key: 3,
|
|
3695
|
-
class:
|
|
3696
|
-
message:
|
|
3697
|
-
mode:
|
|
3698
|
-
surface:
|
|
3900
|
+
class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
3901
|
+
message: N(T).message,
|
|
3902
|
+
mode: N(T).mode,
|
|
3903
|
+
surface: N(T).surface
|
|
3699
3904
|
}, {
|
|
3700
|
-
default:
|
|
3905
|
+
default: z(() => [N(D) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(T)))) : o("", !0)]),
|
|
3701
3906
|
_: 3
|
|
3702
3907
|
}, 8, [
|
|
3703
3908
|
"class",
|
|
@@ -3707,13 +3912,13 @@ var si = ["aria-label"], ci = {
|
|
|
3707
3912
|
])) : o("", !0)
|
|
3708
3913
|
]));
|
|
3709
3914
|
}
|
|
3710
|
-
}),
|
|
3915
|
+
}), Ii = ["data-surface-mode"], Li = {
|
|
3711
3916
|
key: 1,
|
|
3712
3917
|
class: "absolute left-5 top-5 z-30 border border-amber-400/45 bg-black/35 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-amber-100 backdrop-blur"
|
|
3713
|
-
},
|
|
3918
|
+
}, Ri = ["data-visible", "inert"], zi = ["data-visible", "inert"], Bi = {
|
|
3714
3919
|
key: 3,
|
|
3715
3920
|
class: "relative z-[1] grid h-full w-full content-center justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center"
|
|
3716
|
-
},
|
|
3921
|
+
}, Vi = /* @__PURE__ */ d({
|
|
3717
3922
|
name: "VibeLayout",
|
|
3718
3923
|
__name: "Layout",
|
|
3719
3924
|
props: {
|
|
@@ -3739,12 +3944,12 @@ var si = ["aria-label"], ci = {
|
|
|
3739
3944
|
"update:surfaceMode"
|
|
3740
3945
|
],
|
|
3741
3946
|
setup(e, { expose: n, emit: i }) {
|
|
3742
|
-
let d = e,
|
|
3947
|
+
let d = e, f = F(), m = i, h = Ye(d, m), g = fe((e) => {
|
|
3743
3948
|
m("asset-errors", e);
|
|
3744
|
-
}), _ =
|
|
3949
|
+
}), _ = Z((e) => {
|
|
3745
3950
|
m("asset-loads", e);
|
|
3746
3951
|
});
|
|
3747
|
-
return
|
|
3952
|
+
return x(() => {
|
|
3748
3953
|
g.stop(), _.stop();
|
|
3749
3954
|
}), n({
|
|
3750
3955
|
cancel: h.cancel,
|
|
@@ -3759,16 +3964,16 @@ var si = ["aria-label"], ci = {
|
|
|
3759
3964
|
status: h.status,
|
|
3760
3965
|
undo: h.undo,
|
|
3761
3966
|
unlockPageLoading: h.unlockPageLoading
|
|
3762
|
-
}), (e, n) => (
|
|
3967
|
+
}), (e, n) => (w(), s("section", {
|
|
3763
3968
|
"data-testid": "vibe",
|
|
3764
|
-
"data-surface-mode":
|
|
3969
|
+
"data-surface-mode": N(h).surfaceMode.value,
|
|
3765
3970
|
class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]"
|
|
3766
|
-
}, [
|
|
3971
|
+
}, [N(h).canRetryInitialLoad.value ? (w(), s("button", {
|
|
3767
3972
|
key: 0,
|
|
3768
3973
|
type: "button",
|
|
3769
3974
|
class: "absolute left-5 top-5 z-30 inline-flex items-center border border-rose-400/55 bg-rose-500/18 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-white backdrop-blur transition hover:bg-rose-500/28",
|
|
3770
|
-
onClick: n[0] ||= (...e) =>
|
|
3771
|
-
}, " Retry ")) :
|
|
3975
|
+
onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
|
|
3976
|
+
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Li, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
|
|
3772
3977
|
appear: "",
|
|
3773
3978
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
3774
3979
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -3777,57 +3982,57 @@ var si = ["aria-label"], ci = {
|
|
|
3777
3982
|
"leave-from-class": "translate-y-0 opacity-100",
|
|
3778
3983
|
"leave-to-class": "translate-y-3 opacity-0"
|
|
3779
3984
|
}, {
|
|
3780
|
-
default:
|
|
3985
|
+
default: z(() => [B(c("div", {
|
|
3781
3986
|
"data-testid": "vibe-list-surface",
|
|
3782
|
-
"data-visible":
|
|
3783
|
-
inert:
|
|
3987
|
+
"data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
|
|
3988
|
+
inert: N(h).surfaceMode.value !== "list",
|
|
3784
3989
|
class: "absolute inset-0 z-[2]"
|
|
3785
|
-
}, [u(
|
|
3786
|
-
active:
|
|
3787
|
-
"allow-exhausted-next-page-refresh":
|
|
3788
|
-
items:
|
|
3789
|
-
"active-index":
|
|
3790
|
-
"error-message":
|
|
3791
|
-
loading:
|
|
3792
|
-
"has-next-page":
|
|
3793
|
-
"has-previous-page":
|
|
3794
|
-
"pending-append-items":
|
|
3795
|
-
phase:
|
|
3796
|
-
"commit-pending-append":
|
|
3797
|
-
"pagination-detail":
|
|
3798
|
-
"report-asset-error":
|
|
3799
|
-
"report-asset-load":
|
|
3800
|
-
"request-next-page":
|
|
3801
|
-
"request-previous-page":
|
|
3990
|
+
}, [u(Fi, {
|
|
3991
|
+
active: N(h).surfaceMode.value === "list",
|
|
3992
|
+
"allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
|
|
3993
|
+
items: N(h).items.value,
|
|
3994
|
+
"active-index": N(h).activeIndex.value,
|
|
3995
|
+
"error-message": N(h).errorMessage.value,
|
|
3996
|
+
loading: N(h).loading.value,
|
|
3997
|
+
"has-next-page": N(h).hasNextPage.value,
|
|
3998
|
+
"has-previous-page": N(h).hasPreviousPage.value,
|
|
3999
|
+
"pending-append-items": N(h).pendingAppendItems.value,
|
|
4000
|
+
phase: N(h).phase.value,
|
|
4001
|
+
"commit-pending-append": N(h).commitPendingAppend,
|
|
4002
|
+
"pagination-detail": N(h).paginationDetail.value,
|
|
4003
|
+
"report-asset-error": N(g).report,
|
|
4004
|
+
"report-asset-load": N(_).report,
|
|
4005
|
+
"request-next-page": N(h).prefetchNextPage,
|
|
4006
|
+
"request-previous-page": N(h).prefetchPreviousPage,
|
|
3802
4007
|
"empty-state-mode": d.emptyStateMode,
|
|
3803
4008
|
"show-status-badges": d.showStatusBadges ?? !0,
|
|
3804
|
-
onBoundaryLoadProgress:
|
|
3805
|
-
onOpenFullscreen:
|
|
3806
|
-
"onUpdate:activeIndex":
|
|
4009
|
+
onBoundaryLoadProgress: N(h).setBoundaryLoadProgress,
|
|
4010
|
+
onOpenFullscreen: N(h).openFullscreen,
|
|
4011
|
+
"onUpdate:activeIndex": N(h).setActiveIndex
|
|
3807
4012
|
}, l({ _: 2 }, [
|
|
3808
|
-
|
|
4013
|
+
f["empty-state"] ? {
|
|
3809
4014
|
name: "empty-state",
|
|
3810
|
-
fn:
|
|
4015
|
+
fn: z((t) => [k(e.$slots, "empty-state", y(p(t)))]),
|
|
3811
4016
|
key: "0"
|
|
3812
4017
|
} : void 0,
|
|
3813
|
-
|
|
4018
|
+
f["grid-footer"] ? {
|
|
3814
4019
|
name: "grid-footer",
|
|
3815
|
-
fn:
|
|
4020
|
+
fn: z(() => [k(e.$slots, "grid-footer")]),
|
|
3816
4021
|
key: "1"
|
|
3817
4022
|
} : void 0,
|
|
3818
|
-
|
|
4023
|
+
f["grid-item-overlay"] ? {
|
|
3819
4024
|
name: "grid-item-overlay",
|
|
3820
|
-
fn:
|
|
4025
|
+
fn: z((t) => [k(e.$slots, "grid-item-overlay", y(p(t)))]),
|
|
3821
4026
|
key: "2"
|
|
3822
4027
|
} : void 0,
|
|
3823
|
-
|
|
4028
|
+
f["grid-status"] ? {
|
|
3824
4029
|
name: "grid-status",
|
|
3825
|
-
fn:
|
|
4030
|
+
fn: z((t) => [k(e.$slots, "grid-status", y(p(t)))]),
|
|
3826
4031
|
key: "3"
|
|
3827
4032
|
} : void 0,
|
|
3828
|
-
|
|
4033
|
+
f["item-icon"] ? {
|
|
3829
4034
|
name: "item-icon",
|
|
3830
|
-
fn:
|
|
4035
|
+
fn: z((t) => [k(e.$slots, "item-icon", y(p(t)))]),
|
|
3831
4036
|
key: "4"
|
|
3832
4037
|
} : void 0
|
|
3833
4038
|
]), 1032, [
|
|
@@ -3852,7 +4057,7 @@ var si = ["aria-label"], ci = {
|
|
|
3852
4057
|
"onBoundaryLoadProgress",
|
|
3853
4058
|
"onOpenFullscreen",
|
|
3854
4059
|
"onUpdate:activeIndex"
|
|
3855
|
-
])], 8,
|
|
4060
|
+
])], 8, Ri), [[I, N(h).surfaceMode.value === "list"]])]),
|
|
3856
4061
|
_: 3
|
|
3857
4062
|
}), u(r, {
|
|
3858
4063
|
appear: "",
|
|
@@ -3863,59 +4068,59 @@ var si = ["aria-label"], ci = {
|
|
|
3863
4068
|
"leave-from-class": "translate-y-0 opacity-100",
|
|
3864
4069
|
"leave-to-class": "-translate-y-3 opacity-0"
|
|
3865
4070
|
}, {
|
|
3866
|
-
default:
|
|
4071
|
+
default: z(() => [B(c("div", {
|
|
3867
4072
|
"data-testid": "vibe-fullscreen-surface",
|
|
3868
|
-
"data-visible":
|
|
3869
|
-
inert:
|
|
4073
|
+
"data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
4074
|
+
inert: N(h).surfaceMode.value !== "fullscreen",
|
|
3870
4075
|
class: "absolute inset-0 z-[3]"
|
|
3871
|
-
}, [u(
|
|
3872
|
-
items:
|
|
3873
|
-
active:
|
|
3874
|
-
"active-index":
|
|
3875
|
-
"error-message":
|
|
3876
|
-
loading:
|
|
3877
|
-
"has-next-page":
|
|
3878
|
-
"pagination-detail":
|
|
3879
|
-
phase:
|
|
3880
|
-
"report-asset-error":
|
|
3881
|
-
"report-asset-load":
|
|
4076
|
+
}, [u(ar, {
|
|
4077
|
+
items: N(h).items.value,
|
|
4078
|
+
active: N(h).surfaceMode.value === "fullscreen",
|
|
4079
|
+
"active-index": N(h).activeIndex.value,
|
|
4080
|
+
"error-message": N(h).errorMessage.value,
|
|
4081
|
+
loading: N(h).loading.value,
|
|
4082
|
+
"has-next-page": N(h).hasNextPage.value,
|
|
4083
|
+
"pagination-detail": N(h).paginationDetail.value,
|
|
4084
|
+
phase: N(h).phase.value,
|
|
4085
|
+
"report-asset-error": N(g).report,
|
|
4086
|
+
"report-asset-load": N(_).report,
|
|
3882
4087
|
"empty-state-mode": d.emptyStateMode,
|
|
3883
4088
|
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
3884
4089
|
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
3885
4090
|
"show-end-badge": d.showEndBadge ?? !0,
|
|
3886
4091
|
"show-status-badges": d.showStatusBadges ?? !0,
|
|
3887
|
-
"show-back-to-list":
|
|
3888
|
-
onBackToList:
|
|
3889
|
-
"onUpdate:activeIndex":
|
|
4092
|
+
"show-back-to-list": N(h).showBackToList.value,
|
|
4093
|
+
onBackToList: N(h).returnToList,
|
|
4094
|
+
"onUpdate:activeIndex": N(h).setActiveIndex
|
|
3890
4095
|
}, l({ _: 2 }, [
|
|
3891
|
-
|
|
4096
|
+
f["empty-state"] ? {
|
|
3892
4097
|
name: "empty-state",
|
|
3893
|
-
fn:
|
|
4098
|
+
fn: z((t) => [k(e.$slots, "empty-state", y(p(t)))]),
|
|
3894
4099
|
key: "0"
|
|
3895
4100
|
} : void 0,
|
|
3896
|
-
|
|
4101
|
+
f["fullscreen-overlay"] ? {
|
|
3897
4102
|
name: "fullscreen-overlay",
|
|
3898
|
-
fn:
|
|
4103
|
+
fn: z((t) => [k(e.$slots, "fullscreen-overlay", y(p(t)))]),
|
|
3899
4104
|
key: "1"
|
|
3900
4105
|
} : void 0,
|
|
3901
|
-
|
|
4106
|
+
f["fullscreen-aside"] ? {
|
|
3902
4107
|
name: "fullscreen-aside",
|
|
3903
|
-
fn:
|
|
4108
|
+
fn: z((t) => [k(e.$slots, "fullscreen-aside", y(p(t)))]),
|
|
3904
4109
|
key: "2"
|
|
3905
4110
|
} : void 0,
|
|
3906
|
-
|
|
4111
|
+
f["fullscreen-header-actions"] ? {
|
|
3907
4112
|
name: "fullscreen-header-actions",
|
|
3908
|
-
fn:
|
|
4113
|
+
fn: z((t) => [k(e.$slots, "fullscreen-header-actions", y(p(t)))]),
|
|
3909
4114
|
key: "3"
|
|
3910
4115
|
} : void 0,
|
|
3911
|
-
|
|
4116
|
+
f["fullscreen-status"] ? {
|
|
3912
4117
|
name: "fullscreen-status",
|
|
3913
|
-
fn:
|
|
4118
|
+
fn: z((t) => [k(e.$slots, "fullscreen-status", y(p(t)))]),
|
|
3914
4119
|
key: "4"
|
|
3915
4120
|
} : void 0,
|
|
3916
|
-
|
|
4121
|
+
f["item-icon"] ? {
|
|
3917
4122
|
name: "item-icon",
|
|
3918
|
-
fn:
|
|
4123
|
+
fn: z((t) => [k(e.$slots, "item-icon", y(p(t)))]),
|
|
3919
4124
|
key: "5"
|
|
3920
4125
|
} : void 0
|
|
3921
4126
|
]), 1032, [
|
|
@@ -3937,60 +4142,60 @@ var si = ["aria-label"], ci = {
|
|
|
3937
4142
|
"show-back-to-list",
|
|
3938
4143
|
"onBackToList",
|
|
3939
4144
|
"onUpdate:activeIndex"
|
|
3940
|
-
])], 8,
|
|
4145
|
+
])], 8, zi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
|
|
3941
4146
|
_: 3
|
|
3942
|
-
})], 64)) :
|
|
4147
|
+
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Bi, [u(N(oe), {
|
|
3943
4148
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
3944
4149
|
"aria-hidden": "true"
|
|
3945
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (
|
|
4150
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(ar, {
|
|
3946
4151
|
key: 4,
|
|
3947
|
-
items:
|
|
4152
|
+
items: N(h).items.value,
|
|
3948
4153
|
active: !0,
|
|
3949
|
-
"active-index":
|
|
3950
|
-
"error-message":
|
|
3951
|
-
loading:
|
|
3952
|
-
"has-next-page":
|
|
3953
|
-
"pagination-detail":
|
|
3954
|
-
phase:
|
|
3955
|
-
"report-asset-error":
|
|
3956
|
-
"report-asset-load":
|
|
4154
|
+
"active-index": N(h).activeIndex.value,
|
|
4155
|
+
"error-message": N(h).errorMessage.value,
|
|
4156
|
+
loading: N(h).loading.value,
|
|
4157
|
+
"has-next-page": N(h).hasNextPage.value,
|
|
4158
|
+
"pagination-detail": N(h).paginationDetail.value,
|
|
4159
|
+
phase: N(h).phase.value,
|
|
4160
|
+
"report-asset-error": N(g).report,
|
|
4161
|
+
"report-asset-load": N(_).report,
|
|
3957
4162
|
"empty-state-mode": d.emptyStateMode,
|
|
3958
4163
|
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
3959
4164
|
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
3960
4165
|
"show-end-badge": d.showEndBadge ?? !0,
|
|
3961
4166
|
"show-status-badges": d.showStatusBadges ?? !0,
|
|
3962
4167
|
"show-back-to-list": !1,
|
|
3963
|
-
onBackToList:
|
|
3964
|
-
"onUpdate:activeIndex":
|
|
4168
|
+
onBackToList: N(h).returnToList,
|
|
4169
|
+
"onUpdate:activeIndex": N(h).setActiveIndex
|
|
3965
4170
|
}, l({ _: 2 }, [
|
|
3966
|
-
|
|
4171
|
+
f["empty-state"] ? {
|
|
3967
4172
|
name: "empty-state",
|
|
3968
|
-
fn:
|
|
4173
|
+
fn: z((t) => [k(e.$slots, "empty-state", y(p(t)))]),
|
|
3969
4174
|
key: "0"
|
|
3970
4175
|
} : void 0,
|
|
3971
|
-
|
|
4176
|
+
f["fullscreen-overlay"] ? {
|
|
3972
4177
|
name: "fullscreen-overlay",
|
|
3973
|
-
fn:
|
|
4178
|
+
fn: z((t) => [k(e.$slots, "fullscreen-overlay", y(p(t)))]),
|
|
3974
4179
|
key: "1"
|
|
3975
4180
|
} : void 0,
|
|
3976
|
-
|
|
4181
|
+
f["fullscreen-aside"] ? {
|
|
3977
4182
|
name: "fullscreen-aside",
|
|
3978
|
-
fn:
|
|
4183
|
+
fn: z((t) => [k(e.$slots, "fullscreen-aside", y(p(t)))]),
|
|
3979
4184
|
key: "2"
|
|
3980
4185
|
} : void 0,
|
|
3981
|
-
|
|
4186
|
+
f["fullscreen-header-actions"] ? {
|
|
3982
4187
|
name: "fullscreen-header-actions",
|
|
3983
|
-
fn:
|
|
4188
|
+
fn: z((t) => [k(e.$slots, "fullscreen-header-actions", y(p(t)))]),
|
|
3984
4189
|
key: "3"
|
|
3985
4190
|
} : void 0,
|
|
3986
|
-
|
|
4191
|
+
f["fullscreen-status"] ? {
|
|
3987
4192
|
name: "fullscreen-status",
|
|
3988
|
-
fn:
|
|
4193
|
+
fn: z((t) => [k(e.$slots, "fullscreen-status", y(p(t)))]),
|
|
3989
4194
|
key: "4"
|
|
3990
4195
|
} : void 0,
|
|
3991
|
-
|
|
4196
|
+
f["item-icon"] ? {
|
|
3992
4197
|
name: "item-icon",
|
|
3993
|
-
fn:
|
|
4198
|
+
fn: z((t) => [k(e.$slots, "item-icon", y(p(t)))]),
|
|
3994
4199
|
key: "5"
|
|
3995
4200
|
} : void 0
|
|
3996
4201
|
]), 1032, [
|
|
@@ -4010,10 +4215,10 @@ var si = ["aria-label"], ci = {
|
|
|
4010
4215
|
"show-status-badges",
|
|
4011
4216
|
"onBackToList",
|
|
4012
4217
|
"onUpdate:activeIndex"
|
|
4013
|
-
]))], 8,
|
|
4218
|
+
]))], 8, Ii));
|
|
4014
4219
|
}
|
|
4015
|
-
}),
|
|
4016
|
-
e.component("VibeLayout",
|
|
4220
|
+
}), Hi = { install(e) {
|
|
4221
|
+
e.component("VibeLayout", Vi);
|
|
4017
4222
|
} };
|
|
4018
4223
|
//#endregion
|
|
4019
|
-
export {
|
|
4224
|
+
export { Vi as VibeLayout, Hi as VibePlugin, Hi as default };
|