@wyxos/vibe 3.0.14 → 3.0.16
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/FullscreenMediaBar.vue.d.ts +7 -0
- package/lib/components/viewer-core/assetState.d.ts +2 -0
- package/lib/components/viewer-core/useMedia.d.ts +2 -0
- package/lib/components/viewer-core/useViewer.d.ts +2 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +950 -788
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
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, guardReactiveProps as f, h as p, isVNode as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, reactive as C, readonly as w, ref as T, renderList as E, renderSlot as D, resolveDynamicComponent as O, toDisplayString as k, toRef as A, unref as j, useAttrs as M, useSlots as N, vShow as P, watch as F, watchEffect as I, withCtx as L, withDirectives as R, withModifiers as z } from "vue";
|
|
2
2
|
//#region node_modules/lucide-vue-next/dist/esm/shared/src/utils/hasA11yProp.js
|
|
3
|
-
var
|
|
3
|
+
var ee = (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
|
+
}, B = (e) => e === "", V = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), te = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), H = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), U = (e) => {
|
|
7
|
+
let t = H(e);
|
|
8
8
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
9
|
-
},
|
|
9
|
+
}, W = {
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
11
|
width: 24,
|
|
12
12
|
height: 24,
|
|
@@ -16,27 +16,27 @@ var B = (e) => {
|
|
|
16
16
|
"stroke-width": 2,
|
|
17
17
|
"stroke-linecap": "round",
|
|
18
18
|
"stroke-linejoin": "round"
|
|
19
|
-
},
|
|
20
|
-
...
|
|
19
|
+
}, G = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = W.width, color: s = W.stroke, ...c }, { slots: l }) => p("svg", {
|
|
20
|
+
...W,
|
|
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) => p(...e)), ...l.default ? [l.default()] : []]),
|
|
25
|
+
"stroke-width": B(n) || B(r) || n === !0 || r === !0 ? Number(i || a || W["stroke-width"]) * 24 / Number(o) : i || a || W["stroke-width"],
|
|
26
|
+
class: V("lucide", c.class, ...e ? [`lucide-${te(U(e))}-icon`, `lucide-${te(e)}`] : ["lucide-icon"]),
|
|
27
|
+
...!l.default && !ee(c) && { "aria-hidden": "true" }
|
|
28
|
+
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), K = (e, t) => (n, { slots: r, attrs: i }) => p(G, {
|
|
29
29
|
...i,
|
|
30
30
|
...n,
|
|
31
31
|
iconNode: t,
|
|
32
32
|
name: e
|
|
33
|
-
}, r),
|
|
33
|
+
}, r), q = K("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
|
-
}]]),
|
|
39
|
+
}]]), J = K("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
|
-
]), Y =
|
|
64
|
+
]), Y = K("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
|
+
]), X = K("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
|
+
}]]), ne = K("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
|
+
]), re = K("loader-circle", [["path", {
|
|
111
111
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
112
112
|
key: "13zald"
|
|
113
|
-
}]]),
|
|
113
|
+
}]]), ie = K("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
|
+
}]]), ae = K("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
|
+
}]]), oe = K("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,14 +140,52 @@ var B = (e) => {
|
|
|
140
140
|
d: "M12 17h.01",
|
|
141
141
|
key: "p32p05"
|
|
142
142
|
}]
|
|
143
|
+
]), se = K("volume-1", [["path", {
|
|
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
|
+
key: "uqj9uw"
|
|
146
|
+
}], ["path", {
|
|
147
|
+
d: "M16 9a5 5 0 0 1 0 6",
|
|
148
|
+
key: "1q6k2b"
|
|
149
|
+
}]]), ce = K("volume-2", [
|
|
150
|
+
["path", {
|
|
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
|
+
key: "uqj9uw"
|
|
153
|
+
}],
|
|
154
|
+
["path", {
|
|
155
|
+
d: "M16 9a5 5 0 0 1 0 6",
|
|
156
|
+
key: "1q6k2b"
|
|
157
|
+
}],
|
|
158
|
+
["path", {
|
|
159
|
+
d: "M19.364 18.364a9 9 0 0 0 0-12.728",
|
|
160
|
+
key: "ijwkga"
|
|
161
|
+
}]
|
|
162
|
+
]), Z = K("volume-x", [
|
|
163
|
+
["path", {
|
|
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
|
+
key: "uqj9uw"
|
|
166
|
+
}],
|
|
167
|
+
["line", {
|
|
168
|
+
x1: "22",
|
|
169
|
+
x2: "16",
|
|
170
|
+
y1: "9",
|
|
171
|
+
y2: "15",
|
|
172
|
+
key: "1ewh16"
|
|
173
|
+
}],
|
|
174
|
+
["line", {
|
|
175
|
+
x1: "16",
|
|
176
|
+
x2: "22",
|
|
177
|
+
y1: "9",
|
|
178
|
+
y2: "15",
|
|
179
|
+
key: "5ykzw1"
|
|
180
|
+
}]
|
|
143
181
|
]);
|
|
144
|
-
function
|
|
145
|
-
return
|
|
182
|
+
function le(e, t = 150) {
|
|
183
|
+
return de(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
|
|
146
184
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
185
|
+
function ue(e, t = 150) {
|
|
186
|
+
return de(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
|
|
149
187
|
}
|
|
150
|
-
function
|
|
188
|
+
function de(e, t, n) {
|
|
151
189
|
let r = [], i = /* @__PURE__ */ new Set(), a = null;
|
|
152
190
|
function o(e) {
|
|
153
191
|
let o = t(e);
|
|
@@ -171,41 +209,41 @@ function le(e, t, n) {
|
|
|
171
209
|
}
|
|
172
210
|
//#endregion
|
|
173
211
|
//#region src/components/viewer-core/dom.ts
|
|
174
|
-
function
|
|
212
|
+
function Q(e) {
|
|
175
213
|
return e instanceof HTMLElement && [
|
|
176
214
|
"INPUT",
|
|
177
215
|
"TEXTAREA",
|
|
178
216
|
"SELECT"
|
|
179
217
|
].includes(e.tagName);
|
|
180
218
|
}
|
|
181
|
-
function
|
|
219
|
+
function fe(e) {
|
|
182
220
|
return e instanceof HTMLElement && !!e.closest("[data-swipe-lock], input, textarea, select, a");
|
|
183
221
|
}
|
|
184
|
-
function
|
|
222
|
+
function pe(e) {
|
|
185
223
|
return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
|
|
186
224
|
}
|
|
187
|
-
function
|
|
225
|
+
function me(e) {
|
|
188
226
|
return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
|
|
189
227
|
}
|
|
190
|
-
function
|
|
228
|
+
function he(e) {
|
|
191
229
|
return e ?? "__vibe_initial_cursor__";
|
|
192
230
|
}
|
|
193
|
-
function
|
|
231
|
+
function ge(e, t, n) {
|
|
194
232
|
return Math.min(Math.max(e, t), n);
|
|
195
233
|
}
|
|
196
234
|
//#endregion
|
|
197
235
|
//#region src/components/viewer-core/removalState.ts
|
|
198
|
-
function
|
|
236
|
+
function _e() {
|
|
199
237
|
let e = T(/* @__PURE__ */ new Set()), t = T([]);
|
|
200
238
|
function n(n) {
|
|
201
|
-
let r =
|
|
239
|
+
let r = ve(n).filter((t) => !e.value.has(t));
|
|
202
240
|
if (!r.length) return { ids: [] };
|
|
203
241
|
let i = new Set(e.value);
|
|
204
242
|
for (let e of r) i.add(e);
|
|
205
243
|
return e.value = i, t.value = [...t.value, r], { ids: r };
|
|
206
244
|
}
|
|
207
245
|
function r(t) {
|
|
208
|
-
let n =
|
|
246
|
+
let n = ve(t).filter((t) => e.value.has(t));
|
|
209
247
|
if (!n.length) return { ids: [] };
|
|
210
248
|
let r = new Set(e.value);
|
|
211
249
|
for (let e of n) r.delete(e);
|
|
@@ -236,68 +274,68 @@ function ge() {
|
|
|
236
274
|
undo: i
|
|
237
275
|
};
|
|
238
276
|
}
|
|
239
|
-
function
|
|
277
|
+
function ve(e) {
|
|
240
278
|
let t = Array.isArray(e) ? e : [e];
|
|
241
279
|
return Array.from(new Set(t.filter((e) => typeof e == "string" && e.length > 0)));
|
|
242
280
|
}
|
|
243
281
|
//#endregion
|
|
244
282
|
//#region src/components/viewer-core/itemIdentity.ts
|
|
245
|
-
var
|
|
246
|
-
function
|
|
247
|
-
let t = e[
|
|
283
|
+
var ye = "__vibeOccurrenceKey";
|
|
284
|
+
function $(e) {
|
|
285
|
+
let t = e[ye];
|
|
248
286
|
return typeof t == "string" && t.length > 0 ? t : e.id;
|
|
249
287
|
}
|
|
250
|
-
function
|
|
288
|
+
function be(e, t, n) {
|
|
251
289
|
let r = /* @__PURE__ */ new Map(), i = [], a = n;
|
|
252
290
|
for (let e of t) {
|
|
253
|
-
let t = r.get(e.id), n =
|
|
291
|
+
let t = r.get(e.id), n = $(e);
|
|
254
292
|
t ? t.push(n) : r.set(e.id, [n]);
|
|
255
293
|
}
|
|
256
294
|
for (let t of e) {
|
|
257
295
|
let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
|
|
258
|
-
i.push(
|
|
296
|
+
i.push(xe(t, e));
|
|
259
297
|
}
|
|
260
298
|
return {
|
|
261
299
|
items: i,
|
|
262
300
|
nextSequence: a
|
|
263
301
|
};
|
|
264
302
|
}
|
|
265
|
-
function
|
|
266
|
-
return
|
|
303
|
+
function xe(e, t) {
|
|
304
|
+
return $(e) === t ? e : {
|
|
267
305
|
...e,
|
|
268
|
-
[
|
|
306
|
+
[ye]: t
|
|
269
307
|
};
|
|
270
308
|
}
|
|
271
309
|
//#endregion
|
|
272
310
|
//#region src/components/viewer-core/autoBuckets.ts
|
|
273
|
-
function
|
|
311
|
+
function Se(e) {
|
|
274
312
|
return e.flatMap((e) => e.items);
|
|
275
313
|
}
|
|
276
|
-
function
|
|
314
|
+
function Ce(e, t) {
|
|
277
315
|
return t.size ? e.filter((e) => !t.has(e.id)) : e;
|
|
278
316
|
}
|
|
279
|
-
function
|
|
280
|
-
return
|
|
317
|
+
function we(e, t) {
|
|
318
|
+
return Ce(e.items, t);
|
|
281
319
|
}
|
|
282
|
-
function
|
|
283
|
-
return
|
|
320
|
+
function Te(e, t) {
|
|
321
|
+
return we(e, t).length;
|
|
284
322
|
}
|
|
285
|
-
function
|
|
323
|
+
function Ee(e, t, n) {
|
|
286
324
|
if (n < 0) return null;
|
|
287
325
|
let r = 0;
|
|
288
326
|
for (let i of e) {
|
|
289
|
-
let e =
|
|
327
|
+
let e = we(i, t), a = r + e.length;
|
|
290
328
|
if (n < a) return i.cursor;
|
|
291
329
|
r = a;
|
|
292
330
|
}
|
|
293
331
|
return null;
|
|
294
332
|
}
|
|
295
|
-
function
|
|
333
|
+
function De(e, t, n) {
|
|
296
334
|
let r = [...e], i = r.findIndex((e) => e.cursor === t);
|
|
297
335
|
return i >= 0 && r.splice(i, 1, n), r;
|
|
298
336
|
}
|
|
299
|
-
function
|
|
300
|
-
let r =
|
|
337
|
+
function Oe(e, t, n) {
|
|
338
|
+
let r = be(e, t, n);
|
|
301
339
|
return {
|
|
302
340
|
items: r.items,
|
|
303
341
|
nextSequence: r.nextSequence
|
|
@@ -305,11 +343,11 @@ function Ee(e, t, n) {
|
|
|
305
343
|
}
|
|
306
344
|
//#endregion
|
|
307
345
|
//#region src/components/viewer-core/autoResolveState.ts
|
|
308
|
-
function
|
|
346
|
+
function ke(e) {
|
|
309
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";
|
|
310
348
|
}
|
|
311
|
-
function
|
|
312
|
-
let t =
|
|
349
|
+
function Ae(e) {
|
|
350
|
+
let t = Oe(e.nextItems, e.previousItems, e.sequence);
|
|
313
351
|
return {
|
|
314
352
|
bucket: {
|
|
315
353
|
cursor: e.cursor,
|
|
@@ -320,7 +358,7 @@ function Oe(e) {
|
|
|
320
358
|
nextSequence: t.nextSequence
|
|
321
359
|
};
|
|
322
360
|
}
|
|
323
|
-
function
|
|
361
|
+
function je(e, t, n, r) {
|
|
324
362
|
if (!e.length) return r ? null : {
|
|
325
363
|
buckets: [],
|
|
326
364
|
canceled: r,
|
|
@@ -330,46 +368,46 @@ function ke(e, t, n, r) {
|
|
|
330
368
|
return {
|
|
331
369
|
buckets: i,
|
|
332
370
|
canceled: r,
|
|
333
|
-
visibleCount: i.reduce((e, t) => e +
|
|
371
|
+
visibleCount: i.reduce((e, t) => e + Te(t, n), 0)
|
|
334
372
|
};
|
|
335
373
|
}
|
|
336
|
-
function
|
|
337
|
-
let t =
|
|
374
|
+
function Me(e) {
|
|
375
|
+
let t = Ae({
|
|
338
376
|
cursor: e.initialState.cursor,
|
|
339
377
|
nextCursor: e.initialState.nextCursor ?? null,
|
|
340
378
|
nextItems: e.initialState.items,
|
|
341
379
|
previousCursor: e.initialState.previousCursor ?? null,
|
|
342
380
|
previousItems: [],
|
|
343
381
|
sequence: e.sequence
|
|
344
|
-
}), n =
|
|
382
|
+
}), n = Ce(t.bucket.items, e.removedIds);
|
|
345
383
|
return {
|
|
346
|
-
activeIndex:
|
|
384
|
+
activeIndex: ge(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
|
|
347
385
|
buckets: [t.bucket],
|
|
348
386
|
nextSequence: t.nextSequence
|
|
349
387
|
};
|
|
350
388
|
}
|
|
351
|
-
function
|
|
352
|
-
let n = e[
|
|
353
|
-
return n ?
|
|
389
|
+
function Ne(e, t) {
|
|
390
|
+
let n = e[ge(t, 0, Math.max(0, e.length - 1))];
|
|
391
|
+
return n ? $(n) : null;
|
|
354
392
|
}
|
|
355
|
-
function
|
|
393
|
+
function Pe(e, t, n = null) {
|
|
356
394
|
if (!e.length) return 0;
|
|
357
|
-
let r = n ? e.findIndex((e) =>
|
|
358
|
-
return r >= 0 ? r :
|
|
395
|
+
let r = n ? e.findIndex((e) => $(e) === n) : -1;
|
|
396
|
+
return r >= 0 ? r : ge(t, 0, e.length - 1);
|
|
359
397
|
}
|
|
360
|
-
function
|
|
361
|
-
return e ?
|
|
398
|
+
function Fe(e, t, n) {
|
|
399
|
+
return e ? Te(e, t) < n : !1;
|
|
362
400
|
}
|
|
363
401
|
//#endregion
|
|
364
402
|
//#region src/components/viewer-core/fillDelay.ts
|
|
365
|
-
var
|
|
366
|
-
function
|
|
403
|
+
var Ie = 2e3, Le = 1e3, Re = 100;
|
|
404
|
+
function ze(e, t = Ie, n = Le) {
|
|
367
405
|
return t + Math.max(0, e - 1) * n;
|
|
368
406
|
}
|
|
369
|
-
function
|
|
407
|
+
function Be(e, t) {
|
|
370
408
|
return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
|
|
371
409
|
}
|
|
372
|
-
function
|
|
410
|
+
function Ve() {
|
|
373
411
|
let e = T(null), t = null, n = null, r = null;
|
|
374
412
|
function i(i = !1) {
|
|
375
413
|
if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
|
|
@@ -387,7 +425,7 @@ function ze() {
|
|
|
387
425
|
let t = Math.max(0, a - (Date.now() - s));
|
|
388
426
|
e.value = t, t <= 0 && l();
|
|
389
427
|
};
|
|
390
|
-
t = setInterval(u,
|
|
428
|
+
t = setInterval(u, Re), n = setTimeout(l, a), u();
|
|
391
429
|
}));
|
|
392
430
|
}
|
|
393
431
|
return {
|
|
@@ -398,89 +436,89 @@ function ze() {
|
|
|
398
436
|
}
|
|
399
437
|
//#endregion
|
|
400
438
|
//#region src/components/viewer-core/useAutoResolveSource.ts
|
|
401
|
-
function
|
|
402
|
-
let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u =
|
|
439
|
+
function He(e) {
|
|
440
|
+
let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u = Ve(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = T(!1), g = /* @__PURE__ */ new Set(), _ = null, v = null, y = 0, S = 0, C = i(() => Be(e.fillDelayMs, Ie)), w = i(() => Be(e.fillDelayStepMs, Le)), E = i(() => typeof e.resolve == "function"), D = i(() => e.mode ?? "dynamic"), O = i(() => me(e.pageSize)), k = i(() => Se(n.value)), A = i(() => Ce(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => pe(c.value) || p.value), N = i(() => Ue(n.value, e.removedIds.value)), P = i(() => We(n.value, e.removedIds.value)), I = i(() => P.value?.nextCursor ?? null), L = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!I.value), z = i(() => !!L.value), ee = i(() => E.value && n.value.length > 0), B = i(() => Ce(Se(a.value), e.removedIds.value)), V = i(() => Ee(n.value, e.removedIds.value, j.value)), te = i(() => !A.value.length && !M.value && !!s.value);
|
|
403
441
|
F(() => A.value.length, (e) => {
|
|
404
442
|
if (e === 0) {
|
|
405
443
|
r.value = 0;
|
|
406
444
|
return;
|
|
407
445
|
}
|
|
408
|
-
o.value &&= (
|
|
446
|
+
o.value &&= (ye(), !1), r.value > e - 1 && (r.value = e - 1);
|
|
409
447
|
}), F(() => r.value, () => {
|
|
410
|
-
m.value &&
|
|
448
|
+
m.value && se();
|
|
411
449
|
}), x(() => {
|
|
412
|
-
|
|
450
|
+
fe() || e.resolve && H();
|
|
413
451
|
}), b(() => {
|
|
414
452
|
_?.abort(), _ = null, u.clear(!0);
|
|
415
453
|
});
|
|
416
|
-
async function
|
|
417
|
-
v =
|
|
418
|
-
let t = await
|
|
454
|
+
async function H() {
|
|
455
|
+
v = H;
|
|
456
|
+
let t = await ue({
|
|
419
457
|
continueUntilFilled: D.value === "dynamic",
|
|
420
458
|
cursor: e.initialCursor ?? null,
|
|
421
459
|
direction: "forward",
|
|
422
460
|
phase: "initializing"
|
|
423
461
|
});
|
|
424
|
-
t && (n.value = t.buckets, r.value = 0,
|
|
462
|
+
t && (n.value = t.buckets, r.value = 0, Q());
|
|
425
463
|
}
|
|
426
|
-
async function
|
|
464
|
+
async function U() {
|
|
427
465
|
if (!(h.value || M.value)) {
|
|
428
|
-
if (!R.value) return
|
|
429
|
-
if (D.value === "static" &&
|
|
430
|
-
await
|
|
466
|
+
if (!R.value) return ee.value ? le("trailing") : void 0;
|
|
467
|
+
if (D.value === "static" && ve("trailing")) return le("trailing");
|
|
468
|
+
await ce(I.value);
|
|
431
469
|
}
|
|
432
470
|
}
|
|
433
|
-
async function
|
|
471
|
+
async function W() {
|
|
434
472
|
if (!(h.value || !z.value || M.value)) {
|
|
435
|
-
if (D.value === "static" &&
|
|
436
|
-
await
|
|
473
|
+
if (D.value === "static" && ve("leading")) return le("leading");
|
|
474
|
+
await Z(L.value);
|
|
437
475
|
}
|
|
438
476
|
}
|
|
439
|
-
async function
|
|
440
|
-
if (
|
|
441
|
-
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = E.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, g.clear(), _?.abort(), _ = null, u.clear(!0),
|
|
442
|
-
|
|
477
|
+
async function G() {
|
|
478
|
+
if (te.value) {
|
|
479
|
+
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = E.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, g.clear(), _?.abort(), _ = null, u.clear(!0), fe()) {
|
|
480
|
+
Q();
|
|
443
481
|
return;
|
|
444
482
|
}
|
|
445
|
-
await
|
|
483
|
+
await H();
|
|
446
484
|
}
|
|
447
485
|
}
|
|
448
|
-
async function
|
|
449
|
-
if (
|
|
486
|
+
async function K() {
|
|
487
|
+
if (te.value) return G();
|
|
450
488
|
h.value || c.value !== "failed" || !v || (s.value = null, await v());
|
|
451
489
|
}
|
|
452
|
-
async function
|
|
453
|
-
if (!a.value.length) return p.value = !1,
|
|
454
|
-
n.value = [...n.value, ...a.value], a.value = [], p.value = !1,
|
|
490
|
+
async function q() {
|
|
491
|
+
if (!a.value.length) return p.value = !1, Q();
|
|
492
|
+
n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Q();
|
|
455
493
|
}
|
|
456
|
-
function
|
|
494
|
+
function J(t) {
|
|
457
495
|
let n = A.value;
|
|
458
496
|
if (!n.length) return;
|
|
459
|
-
let i =
|
|
497
|
+
let i = ge(t, 0, n.length - 1);
|
|
460
498
|
i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
|
|
461
499
|
}
|
|
462
500
|
function Y(e) {
|
|
463
501
|
m.value = e;
|
|
464
502
|
}
|
|
465
|
-
function
|
|
503
|
+
function X() {
|
|
466
504
|
h.value = !0, u.clear(!0);
|
|
467
505
|
}
|
|
468
|
-
function
|
|
506
|
+
function ne() {
|
|
469
507
|
h.value = !1;
|
|
470
508
|
}
|
|
471
|
-
function
|
|
472
|
-
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,
|
|
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();
|
|
473
511
|
}
|
|
474
|
-
function
|
|
475
|
-
return
|
|
512
|
+
function ie() {
|
|
513
|
+
return Ne(A.value, j.value);
|
|
476
514
|
}
|
|
477
|
-
function
|
|
515
|
+
function ae(e = null, t = {}) {
|
|
478
516
|
if (A.value.length === 0) {
|
|
479
517
|
r.value = 0, !t.preserveTrailingPlaceholder && n.value.length > 0 && (o.value = !0);
|
|
480
518
|
return;
|
|
481
519
|
}
|
|
482
520
|
if (e) {
|
|
483
|
-
let t = A.value.findIndex((t) =>
|
|
521
|
+
let t = A.value.findIndex((t) => $(t) === e);
|
|
484
522
|
if (t >= 0) {
|
|
485
523
|
r.value = t;
|
|
486
524
|
return;
|
|
@@ -490,57 +528,57 @@ function Be(e) {
|
|
|
490
528
|
r.value = A.value.length;
|
|
491
529
|
return;
|
|
492
530
|
}
|
|
493
|
-
r.value =
|
|
531
|
+
r.value = Pe(A.value, j.value, e);
|
|
494
532
|
}
|
|
495
|
-
function
|
|
496
|
-
a.value.length > 0 && !
|
|
533
|
+
function oe() {
|
|
534
|
+
a.value.length > 0 && !B.value.length && q();
|
|
497
535
|
}
|
|
498
|
-
async function
|
|
499
|
-
if (!(!m.value ||
|
|
536
|
+
async function se() {
|
|
537
|
+
if (!(!m.value || _e())) {
|
|
500
538
|
if (!A.value.length) {
|
|
501
|
-
R.value && await
|
|
539
|
+
R.value && await U();
|
|
502
540
|
return;
|
|
503
541
|
}
|
|
504
|
-
z.value && r.value < 3 && await
|
|
542
|
+
z.value && r.value < 3 && await W(), R.value && r.value >= A.value.length - 3 && await U();
|
|
505
543
|
}
|
|
506
544
|
}
|
|
507
|
-
async function
|
|
545
|
+
async function ce(e) {
|
|
508
546
|
v = async () => {
|
|
509
|
-
await
|
|
547
|
+
await ce(e);
|
|
510
548
|
};
|
|
511
|
-
let t = await
|
|
549
|
+
let t = await ue({
|
|
512
550
|
continueUntilFilled: D.value === "dynamic",
|
|
513
551
|
cursor: e,
|
|
514
552
|
direction: "forward",
|
|
515
553
|
phase: "loading"
|
|
516
554
|
});
|
|
517
555
|
if (t) {
|
|
518
|
-
if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], p.value = !1,
|
|
519
|
-
if (a.value = t.buckets, !
|
|
556
|
+
if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], p.value = !1, Q();
|
|
557
|
+
if (a.value = t.buckets, !B.value.length) return n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Q();
|
|
520
558
|
p.value = !0;
|
|
521
559
|
}
|
|
522
560
|
}
|
|
523
|
-
async function
|
|
561
|
+
async function Z(e) {
|
|
524
562
|
v = async () => {
|
|
525
|
-
await
|
|
563
|
+
await Z(e);
|
|
526
564
|
};
|
|
527
|
-
let t = await
|
|
565
|
+
let t = await ue({
|
|
528
566
|
continueUntilFilled: D.value === "dynamic",
|
|
529
567
|
cursor: e,
|
|
530
568
|
direction: "backward",
|
|
531
569
|
phase: "loading"
|
|
532
570
|
});
|
|
533
571
|
if (!t) return;
|
|
534
|
-
let r =
|
|
535
|
-
n.value = [...t.buckets, ...n.value],
|
|
572
|
+
let r = ie();
|
|
573
|
+
n.value = [...t.buckets, ...n.value], ae(r), Q();
|
|
536
574
|
}
|
|
537
|
-
async function
|
|
575
|
+
async function le(t) {
|
|
538
576
|
if (v = async () => {
|
|
539
|
-
await
|
|
577
|
+
await le(t);
|
|
540
578
|
}, !e.resolve) return;
|
|
541
579
|
let r = t === "leading" ? N.value : P.value;
|
|
542
580
|
if (!r) return;
|
|
543
|
-
let i =
|
|
581
|
+
let i = he(r.cursor);
|
|
544
582
|
if (g.has(i)) return;
|
|
545
583
|
g.add(i), s.value = null, c.value = "refreshing", l.value = null, f.value = null;
|
|
546
584
|
let a = ++y, o = typeof AbortController > "u" ? null : new AbortController();
|
|
@@ -551,18 +589,18 @@ function Be(e) {
|
|
|
551
589
|
pageSize: O.value,
|
|
552
590
|
signal: o?.signal
|
|
553
591
|
});
|
|
554
|
-
if (a !== y) return
|
|
555
|
-
let i =
|
|
592
|
+
if (a !== y) return Q();
|
|
593
|
+
let i = de({
|
|
556
594
|
cursor: r.cursor,
|
|
557
595
|
nextCursor: t.nextPage,
|
|
558
596
|
nextItems: t.items,
|
|
559
597
|
previousCursor: t.previousPage ?? null,
|
|
560
598
|
previousItems: r.items
|
|
561
|
-
}), s =
|
|
562
|
-
n.value =
|
|
599
|
+
}), s = ie();
|
|
600
|
+
n.value = De(n.value, r.cursor, i), ae(s), Q();
|
|
563
601
|
} catch (e) {
|
|
564
|
-
if (
|
|
565
|
-
|
|
602
|
+
if (ke(e) || a !== y) {
|
|
603
|
+
Q();
|
|
566
604
|
return;
|
|
567
605
|
}
|
|
568
606
|
s.value = e instanceof Error ? e.message : "The viewer could not load items.", c.value = "failed", l.value = null, f.value = null;
|
|
@@ -570,13 +608,13 @@ function Be(e) {
|
|
|
570
608
|
_ === o && (_ = null), g.delete(i);
|
|
571
609
|
}
|
|
572
610
|
}
|
|
573
|
-
async function
|
|
611
|
+
async function ue(t) {
|
|
574
612
|
if (!e.resolve) return null;
|
|
575
613
|
let n = ++y, r = /* @__PURE__ */ new Set(), i = [], a = t.cursor, o = 0;
|
|
576
614
|
for (s.value = null, c.value = t.phase, l.value = null, f.value = null;;) {
|
|
577
|
-
if (n !== y) return
|
|
578
|
-
if (i.length > 0 && h.value) return
|
|
579
|
-
let d =
|
|
615
|
+
if (n !== y) return je(i, t.direction, e.removedIds.value, !0);
|
|
616
|
+
if (i.length > 0 && h.value) return je(i, t.direction, e.removedIds.value, !1);
|
|
617
|
+
let d = he(a);
|
|
580
618
|
if (r.has(d) || g.has(d)) break;
|
|
581
619
|
r.add(d), g.add(d);
|
|
582
620
|
let p = typeof AbortController > "u" ? null : new AbortController();
|
|
@@ -587,8 +625,8 @@ function Be(e) {
|
|
|
587
625
|
pageSize: O.value,
|
|
588
626
|
signal: p?.signal
|
|
589
627
|
});
|
|
590
|
-
if (n !== y) return
|
|
591
|
-
let s =
|
|
628
|
+
if (n !== y) return je(i, t.direction, e.removedIds.value, !0);
|
|
629
|
+
let s = de({
|
|
592
630
|
cursor: a,
|
|
593
631
|
nextCursor: r.nextPage,
|
|
594
632
|
nextItems: r.items,
|
|
@@ -596,27 +634,27 @@ function Be(e) {
|
|
|
596
634
|
previousItems: []
|
|
597
635
|
});
|
|
598
636
|
i.push(s);
|
|
599
|
-
let d = i.reduce((t, n) => t +
|
|
637
|
+
let d = i.reduce((t, n) => t + Te(n, e.removedIds.value), 0), m = t.direction === "forward" ? s.nextCursor : s.previousCursor;
|
|
600
638
|
if (!t.continueUntilFilled || d >= O.value || !m) return {
|
|
601
639
|
canceled: !1,
|
|
602
640
|
buckets: t.direction === "backward" ? [...i].reverse() : i,
|
|
603
641
|
visibleCount: d
|
|
604
642
|
};
|
|
605
|
-
if (h.value) return
|
|
643
|
+
if (h.value) return je(i, t.direction, e.removedIds.value, !1);
|
|
606
644
|
c.value = "filling", l.value = d, f.value = O.value, o += 1;
|
|
607
|
-
let g =
|
|
608
|
-
if (await u.wait(g), n !== y) return
|
|
645
|
+
let g = ze(o, C.value, w.value);
|
|
646
|
+
if (await u.wait(g), n !== y) return je(i, t.direction, e.removedIds.value, !0);
|
|
609
647
|
a = m;
|
|
610
648
|
} catch (r) {
|
|
611
|
-
return
|
|
649
|
+
return ke(r) || n !== y ? je(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);
|
|
612
650
|
} finally {
|
|
613
651
|
_ === p && (_ = null), g.delete(d);
|
|
614
652
|
}
|
|
615
653
|
}
|
|
616
|
-
return
|
|
654
|
+
return je(i, t.direction, e.removedIds.value, !1);
|
|
617
655
|
}
|
|
618
|
-
function
|
|
619
|
-
let t =
|
|
656
|
+
function de(e) {
|
|
657
|
+
let t = Ae({
|
|
620
658
|
cursor: e.cursor,
|
|
621
659
|
nextCursor: e.nextCursor,
|
|
622
660
|
nextItems: e.nextItems,
|
|
@@ -626,29 +664,29 @@ function Be(e) {
|
|
|
626
664
|
});
|
|
627
665
|
return S = t.nextSequence, t.bucket;
|
|
628
666
|
}
|
|
629
|
-
function
|
|
667
|
+
function Q() {
|
|
630
668
|
c.value = "idle", l.value = null, f.value = null, u.clear();
|
|
631
669
|
}
|
|
632
|
-
function
|
|
670
|
+
function fe() {
|
|
633
671
|
if (!e.initialState || !e.initialState.items.length) return !1;
|
|
634
|
-
let t =
|
|
672
|
+
let t = Me({
|
|
635
673
|
initialState: e.initialState,
|
|
636
674
|
removedIds: e.removedIds.value,
|
|
637
675
|
sequence: S
|
|
638
676
|
});
|
|
639
677
|
return n.value = t.buckets, r.value = t.activeIndex, S = t.nextSequence, o.value = !1, s.value = null, a.value = [], p.value = !1, !0;
|
|
640
678
|
}
|
|
641
|
-
function
|
|
679
|
+
function _e() {
|
|
642
680
|
return c.value === "initializing";
|
|
643
681
|
}
|
|
644
|
-
function
|
|
645
|
-
return
|
|
682
|
+
function ve(t) {
|
|
683
|
+
return Fe(t === "leading" ? N.value : P.value, e.removedIds.value, O.value);
|
|
646
684
|
}
|
|
647
|
-
function
|
|
648
|
-
let t = n.value.findIndex((t) =>
|
|
685
|
+
function ye() {
|
|
686
|
+
let t = n.value.findIndex((t) => Te(t, e.removedIds.value) > 0);
|
|
649
687
|
if (t < 0) return;
|
|
650
688
|
let r = t;
|
|
651
|
-
for (let i = n.value.length - 1; i >= t; --i) if (
|
|
689
|
+
for (let i = n.value.length - 1; i >= t; --i) if (Te(n.value[i], e.removedIds.value) > 0) {
|
|
652
690
|
r = i;
|
|
653
691
|
break;
|
|
654
692
|
}
|
|
@@ -656,11 +694,11 @@ function Be(e) {
|
|
|
656
694
|
}
|
|
657
695
|
return {
|
|
658
696
|
activeIndex: j,
|
|
659
|
-
canRetryInitialLoad:
|
|
660
|
-
cancel:
|
|
661
|
-
canRefreshTrailingBoundary:
|
|
662
|
-
commitPendingAppend:
|
|
663
|
-
currentCursor:
|
|
697
|
+
canRetryInitialLoad: te,
|
|
698
|
+
cancel: re,
|
|
699
|
+
canRefreshTrailingBoundary: ee,
|
|
700
|
+
commitPendingAppend: q,
|
|
701
|
+
currentCursor: V,
|
|
664
702
|
errorMessage: s,
|
|
665
703
|
fillCollectedCount: l,
|
|
666
704
|
fillDelayRemainingMs: d,
|
|
@@ -670,40 +708,40 @@ function Be(e) {
|
|
|
670
708
|
isAutoPrefetchEnabled: m,
|
|
671
709
|
isPageLoadingLocked: h,
|
|
672
710
|
items: A,
|
|
673
|
-
lockPageLoading:
|
|
711
|
+
lockPageLoading: X,
|
|
674
712
|
loading: M,
|
|
675
713
|
mode: D,
|
|
676
|
-
maybePrefetchAround:
|
|
714
|
+
maybePrefetchAround: se,
|
|
677
715
|
nextCursor: I,
|
|
678
|
-
pendingAppendItems:
|
|
716
|
+
pendingAppendItems: B,
|
|
679
717
|
phase: c,
|
|
680
|
-
prefetchNextPage:
|
|
681
|
-
prefetchPreviousPage:
|
|
718
|
+
prefetchNextPage: U,
|
|
719
|
+
prefetchPreviousPage: W,
|
|
682
720
|
previousCursor: L,
|
|
683
|
-
retryInitialLoad:
|
|
684
|
-
retry:
|
|
685
|
-
setActiveIndex:
|
|
721
|
+
retryInitialLoad: G,
|
|
722
|
+
retry: K,
|
|
723
|
+
setActiveIndex: J,
|
|
686
724
|
setAutoPrefetchEnabled: Y,
|
|
687
|
-
syncActiveIndexAfterVisibilityChange:
|
|
688
|
-
unlockPageLoading:
|
|
689
|
-
getActiveOccurrenceKey:
|
|
690
|
-
maybeCommitPendingAppendWhenFilteredOut:
|
|
725
|
+
syncActiveIndexAfterVisibilityChange: ae,
|
|
726
|
+
unlockPageLoading: ne,
|
|
727
|
+
getActiveOccurrenceKey: ie,
|
|
728
|
+
maybeCommitPendingAppendWhenFilteredOut: oe
|
|
691
729
|
};
|
|
692
730
|
}
|
|
693
|
-
function
|
|
694
|
-
return e.find((e) =>
|
|
731
|
+
function Ue(e, t) {
|
|
732
|
+
return e.find((e) => Te(e, t) > 0) ?? e[0] ?? null;
|
|
695
733
|
}
|
|
696
|
-
function
|
|
734
|
+
function We(e, t) {
|
|
697
735
|
for (let n = e.length - 1; n >= 0; --n) {
|
|
698
736
|
let r = e[n];
|
|
699
|
-
if (
|
|
737
|
+
if (Te(r, t) > 0) return r;
|
|
700
738
|
}
|
|
701
739
|
return e[e.length - 1] ?? null;
|
|
702
740
|
}
|
|
703
741
|
//#endregion
|
|
704
742
|
//#region src/components/viewer-core/useDataSource.ts
|
|
705
|
-
function
|
|
706
|
-
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } =
|
|
743
|
+
function Ge(e, t) {
|
|
744
|
+
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = _e(), l = He({
|
|
707
745
|
emit: t,
|
|
708
746
|
fillDelayMs: e.fillDelayMs,
|
|
709
747
|
fillDelayStepMs: e.fillDelayStepMs,
|
|
@@ -791,9 +829,9 @@ function Ue(e, t) {
|
|
|
791
829
|
}
|
|
792
830
|
//#endregion
|
|
793
831
|
//#region src/components/viewer-core/useController.ts
|
|
794
|
-
var
|
|
795
|
-
function
|
|
796
|
-
let n =
|
|
832
|
+
var Ke = 1024;
|
|
833
|
+
function qe(e, t) {
|
|
834
|
+
let n = Ge(e, t), r = T(0), a = T("list"), o = C({
|
|
797
835
|
activeIndex: 0,
|
|
798
836
|
currentCursor: null,
|
|
799
837
|
errorMessage: null,
|
|
@@ -812,7 +850,7 @@ function Ge(e, t) {
|
|
|
812
850
|
removedCount: 0,
|
|
813
851
|
removedIds: [],
|
|
814
852
|
surfaceMode: "list"
|
|
815
|
-
}), s = i(() => r.value >=
|
|
853
|
+
}), s = i(() => r.value >= Ke), c = i(() => s.value ? a.value : "fullscreen"), l = i(() => s.value && c.value === "fullscreen");
|
|
816
854
|
F(s, (e) => {
|
|
817
855
|
e && m();
|
|
818
856
|
}), F(() => e.surfaceMode, () => {
|
|
@@ -842,7 +880,7 @@ function Ge(e, t) {
|
|
|
842
880
|
!s.value || a.value === "list" || (a.value = "list", t("update:surfaceMode", "list"));
|
|
843
881
|
}
|
|
844
882
|
function f(e) {
|
|
845
|
-
e.defaultPrevented || e.key !== "Escape" || !s.value || c.value !== "fullscreen" ||
|
|
883
|
+
e.defaultPrevented || e.key !== "Escape" || !s.value || c.value !== "fullscreen" || Q(e.target) || (e.preventDefault(), d());
|
|
846
884
|
}
|
|
847
885
|
function p() {
|
|
848
886
|
r.value = window.innerWidth || 0;
|
|
@@ -868,29 +906,67 @@ function Ge(e, t) {
|
|
|
868
906
|
}
|
|
869
907
|
//#endregion
|
|
870
908
|
//#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
|
|
871
|
-
var
|
|
909
|
+
var Je = {
|
|
872
910
|
"data-testid": "vibe-media-bar",
|
|
873
911
|
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]"
|
|
874
|
-
},
|
|
912
|
+
}, Ye = { 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]" }, Xe = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ze = { class: "relative h-4 w-full" }, Qe = [
|
|
875
913
|
"max",
|
|
876
914
|
"value",
|
|
877
915
|
"disabled"
|
|
878
|
-
],
|
|
916
|
+
], $e = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, et = ["data-layout"], tt = {
|
|
917
|
+
key: 0,
|
|
918
|
+
"data-testid": "vibe-media-volume-popover",
|
|
919
|
+
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]"
|
|
920
|
+
}, nt = { class: "relative flex h-28 w-4 items-center justify-center" }, rt = ["value"], it = { class: "flex items-center gap-3" }, at = ["aria-label"], ot = {
|
|
921
|
+
key: 0,
|
|
922
|
+
class: "relative h-4 w-24"
|
|
923
|
+
}, st = ["value"], ct = /* @__PURE__ */ d({
|
|
879
924
|
__name: "FullscreenMediaBar",
|
|
880
925
|
props: {
|
|
881
926
|
currentTime: {},
|
|
882
927
|
currentTimeLabel: {},
|
|
883
928
|
duration: {},
|
|
884
929
|
durationLabel: {},
|
|
885
|
-
|
|
930
|
+
muted: { type: Boolean },
|
|
931
|
+
progress: {},
|
|
932
|
+
volume: {},
|
|
933
|
+
volumeControlLayout: {}
|
|
886
934
|
},
|
|
887
|
-
emits: [
|
|
935
|
+
emits: [
|
|
936
|
+
"seek-input",
|
|
937
|
+
"volume-input",
|
|
938
|
+
"volume-toggle"
|
|
939
|
+
],
|
|
888
940
|
setup(e, { emit: t }) {
|
|
889
|
-
let n = e, r = t;
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
941
|
+
let n = e, r = t, l = T(null), u = T(!1), d = i(() => n.volumeControlLayout === "vertical"), f = i(() => w(n.volume, 0, 1)), p = i(() => Math.round(f.value * 100)), m = i(() => n.muted || f.value <= 0 ? Z : f.value < .5 ? se : ce), 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}%` });
|
|
942
|
+
F(d, (e) => {
|
|
943
|
+
e || (u.value = !1);
|
|
944
|
+
}), x(() => {
|
|
945
|
+
document.addEventListener("pointerdown", v);
|
|
946
|
+
}), b(() => {
|
|
947
|
+
document.removeEventListener("pointerdown", v);
|
|
948
|
+
});
|
|
949
|
+
function v(e) {
|
|
950
|
+
!d.value || !u.value || l.value && e.target instanceof Node && !l.value.contains(e.target) && (u.value = !1);
|
|
951
|
+
}
|
|
952
|
+
function C() {
|
|
953
|
+
if (!d.value) {
|
|
954
|
+
r("volume-toggle");
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
if (!u.value) {
|
|
958
|
+
u.value = !0;
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
r("volume-toggle");
|
|
962
|
+
}
|
|
963
|
+
function w(e, t, n) {
|
|
964
|
+
return Math.min(Math.max(e, t), n);
|
|
965
|
+
}
|
|
966
|
+
return (e, t) => (S(), s("div", Je, [c("div", Ye, [
|
|
967
|
+
c("span", Xe, k(n.currentTimeLabel), 1),
|
|
968
|
+
c("div", Ze, [
|
|
969
|
+
t[3] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
894
970
|
c("div", {
|
|
895
971
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
896
972
|
style: y({ width: `${n.progress}%` })
|
|
@@ -906,25 +982,77 @@ var Ke = {
|
|
|
906
982
|
disabled: n.duration <= 0,
|
|
907
983
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
|
|
908
984
|
onInput: t[0] ||= (e) => r("seek-input", e)
|
|
909
|
-
}, null, 40,
|
|
985
|
+
}, null, 40, Qe)
|
|
910
986
|
]),
|
|
911
|
-
c("span",
|
|
987
|
+
c("span", $e, k(n.durationLabel), 1),
|
|
988
|
+
c("div", {
|
|
989
|
+
ref_key: "rootRef",
|
|
990
|
+
ref: l,
|
|
991
|
+
"data-testid": "vibe-media-volume",
|
|
992
|
+
"data-layout": n.volumeControlLayout,
|
|
993
|
+
class: "relative flex items-center justify-end"
|
|
994
|
+
}, [d.value && u.value ? (S(), s("div", tt, [c("div", nt, [
|
|
995
|
+
t[4] ||= c("div", { class: "absolute bottom-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/12" }, null, -1),
|
|
996
|
+
c("div", {
|
|
997
|
+
class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
|
|
998
|
+
style: y(_.value)
|
|
999
|
+
}, null, 4),
|
|
1000
|
+
c("input", {
|
|
1001
|
+
"data-testid": "vibe-media-volume-slider",
|
|
1002
|
+
"data-swipe-lock": "true",
|
|
1003
|
+
type: "range",
|
|
1004
|
+
"aria-label": "Adjust active media volume",
|
|
1005
|
+
min: "0",
|
|
1006
|
+
max: "1",
|
|
1007
|
+
step: "0.05",
|
|
1008
|
+
value: f.value,
|
|
1009
|
+
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",
|
|
1010
|
+
onInput: t[1] ||= (e) => r("volume-input", e)
|
|
1011
|
+
}, null, 40, rt)
|
|
1012
|
+
])])) : o("", !0), c("div", it, [c("button", {
|
|
1013
|
+
type: "button",
|
|
1014
|
+
"data-testid": "vibe-media-volume-button",
|
|
1015
|
+
"aria-label": g.value,
|
|
1016
|
+
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",
|
|
1017
|
+
onClick: C
|
|
1018
|
+
}, [(S(), a(O(m.value), {
|
|
1019
|
+
class: "h-4 w-4 stroke-[1.9]",
|
|
1020
|
+
"aria-hidden": "true"
|
|
1021
|
+
}))], 8, at), n.volumeControlLayout === "horizontal" ? (S(), s("div", ot, [
|
|
1022
|
+
t[5] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
1023
|
+
c("div", {
|
|
1024
|
+
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
1025
|
+
style: y(_.value)
|
|
1026
|
+
}, null, 4),
|
|
1027
|
+
c("input", {
|
|
1028
|
+
"data-testid": "vibe-media-volume-slider",
|
|
1029
|
+
"data-swipe-lock": "true",
|
|
1030
|
+
type: "range",
|
|
1031
|
+
"aria-label": "Adjust active media volume",
|
|
1032
|
+
min: "0",
|
|
1033
|
+
max: "1",
|
|
1034
|
+
step: "0.05",
|
|
1035
|
+
value: f.value,
|
|
1036
|
+
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
|
|
1037
|
+
onInput: t[2] ||= (e) => r("volume-input", e)
|
|
1038
|
+
}, null, 40, st)
|
|
1039
|
+
])) : o("", !0)])], 8, et)
|
|
912
1040
|
])]));
|
|
913
1041
|
}
|
|
914
|
-
}),
|
|
1042
|
+
}), lt = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, ut = { class: "grid gap-4" }, dt = { class: "flex min-h-11 items-center justify-between gap-4" }, ft = { class: "min-w-0 flex flex-1 items-center gap-3" }, pt = {
|
|
915
1043
|
key: 1,
|
|
916
1044
|
"data-testid": "vibe-title",
|
|
917
1045
|
class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
|
|
918
|
-
},
|
|
1046
|
+
}, mt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, ht = {
|
|
919
1047
|
"data-testid": "vibe-pagination",
|
|
920
1048
|
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]"
|
|
921
|
-
},
|
|
1049
|
+
}, gt = { class: "whitespace-nowrap" }, _t = {
|
|
922
1050
|
key: 1,
|
|
923
1051
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
924
|
-
},
|
|
1052
|
+
}, vt = {
|
|
925
1053
|
key: 0,
|
|
926
1054
|
class: "grid gap-2 max-[720px]:justify-items-start"
|
|
927
|
-
},
|
|
1055
|
+
}, yt = /* @__PURE__ */ d({
|
|
928
1056
|
__name: "FullscreenHeader",
|
|
929
1057
|
props: {
|
|
930
1058
|
currentIndex: {},
|
|
@@ -938,58 +1066,58 @@ var Ke = {
|
|
|
938
1066
|
emits: ["back-to-list"],
|
|
939
1067
|
setup(e, { emit: t }) {
|
|
940
1068
|
let n = e, r = t;
|
|
941
|
-
return (e, t) => (S(), s("div",
|
|
1069
|
+
return (e, t) => (S(), s("div", lt, [c("div", ut, [c("div", dt, [c("div", ft, [n.showBackToList ? (S(), s("button", {
|
|
942
1070
|
key: 0,
|
|
943
1071
|
type: "button",
|
|
944
1072
|
"data-testid": "vibe-back-to-list",
|
|
945
1073
|
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",
|
|
946
1074
|
"aria-label": "Back to list",
|
|
947
1075
|
onClick: t[0] ||= (e) => r("back-to-list")
|
|
948
|
-
}, [u(j(
|
|
1076
|
+
}, [u(j(q), {
|
|
949
1077
|
class: "h-4 w-4 stroke-[2.2]",
|
|
950
1078
|
"aria-hidden": "true"
|
|
951
|
-
})])) : o("", !0), n.title ? (S(), s("h2",
|
|
952
|
-
n.loading ? (S(), a(j(
|
|
1079
|
+
})])) : o("", !0), n.title ? (S(), s("h2", pt, k(n.title), 1)) : o("", !0)]), c("div", mt, [c("span", ht, [
|
|
1080
|
+
n.loading ? (S(), a(j(re), {
|
|
953
1081
|
key: 0,
|
|
954
1082
|
"data-testid": "vibe-pagination-spinner",
|
|
955
1083
|
class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
|
|
956
1084
|
"aria-hidden": "true"
|
|
957
1085
|
})) : o("", !0),
|
|
958
|
-
c("span",
|
|
959
|
-
n.paginationDetail ? (S(), s("span",
|
|
960
|
-
]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div",
|
|
1086
|
+
c("span", gt, k(n.currentIndex + 1) + " / " + k(n.total), 1),
|
|
1087
|
+
n.paginationDetail ? (S(), s("span", _t, k(n.paginationDetail), 1)) : o("", !0)
|
|
1088
|
+
]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", vt, [...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)]));
|
|
961
1089
|
}
|
|
962
|
-
}),
|
|
963
|
-
image:
|
|
1090
|
+
}), bt = {
|
|
1091
|
+
image: ne,
|
|
964
1092
|
video: Y,
|
|
965
|
-
audio:
|
|
966
|
-
other:
|
|
967
|
-
},
|
|
1093
|
+
audio: J,
|
|
1094
|
+
other: X
|
|
1095
|
+
}, xt = {
|
|
968
1096
|
image: "Image",
|
|
969
1097
|
video: "Video",
|
|
970
1098
|
audio: "Audio",
|
|
971
1099
|
other: "File"
|
|
972
1100
|
};
|
|
973
|
-
function
|
|
974
|
-
return
|
|
1101
|
+
function St(e) {
|
|
1102
|
+
return bt[e];
|
|
975
1103
|
}
|
|
976
|
-
function
|
|
977
|
-
return
|
|
1104
|
+
function Ct(e) {
|
|
1105
|
+
return xt[e];
|
|
978
1106
|
}
|
|
979
1107
|
//#endregion
|
|
980
1108
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
981
|
-
var
|
|
982
|
-
function
|
|
1109
|
+
var wt = 1, Tt = 2;
|
|
1110
|
+
function Et(e) {
|
|
983
1111
|
function t(e, t) {
|
|
984
1112
|
let n = t.title?.trim();
|
|
985
|
-
return n ? `${e} ${n}` : `${e} ${
|
|
1113
|
+
return n ? `${e} ${n}` : `${e} ${Ct(t.type).toLowerCase()}`;
|
|
986
1114
|
}
|
|
987
1115
|
function n(e) {
|
|
988
|
-
return
|
|
1116
|
+
return $(e);
|
|
989
1117
|
}
|
|
990
1118
|
function r(t) {
|
|
991
1119
|
let n = e.resolvedActiveIndex.value;
|
|
992
|
-
return !!e.active.value && t >= n && t <= n +
|
|
1120
|
+
return !!e.active.value && t >= n - wt && t <= n + Tt;
|
|
993
1121
|
}
|
|
994
1122
|
function i(t, i) {
|
|
995
1123
|
let a = n(i);
|
|
@@ -1024,11 +1152,11 @@ function ht(e) {
|
|
|
1024
1152
|
}
|
|
1025
1153
|
//#endregion
|
|
1026
1154
|
//#region src/components/viewer-core/slotContent.ts
|
|
1027
|
-
function
|
|
1155
|
+
function Dt(e) {
|
|
1028
1156
|
if (!Array.isArray(e)) return !1;
|
|
1029
1157
|
for (let t of e) {
|
|
1030
1158
|
if (Array.isArray(t)) {
|
|
1031
|
-
if (
|
|
1159
|
+
if (Dt(t)) return !0;
|
|
1032
1160
|
continue;
|
|
1033
1161
|
}
|
|
1034
1162
|
if (!m(t)) {
|
|
@@ -1039,20 +1167,20 @@ function gt(e) {
|
|
|
1039
1167
|
if (t != null && t !== !1) return !0;
|
|
1040
1168
|
continue;
|
|
1041
1169
|
}
|
|
1042
|
-
if (!
|
|
1170
|
+
if (!Ot(t)) return !0;
|
|
1043
1171
|
}
|
|
1044
1172
|
return !1;
|
|
1045
1173
|
}
|
|
1046
|
-
function
|
|
1047
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1174
|
+
function Ot(r) {
|
|
1175
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Dt(r.children) : !1;
|
|
1048
1176
|
}
|
|
1049
1177
|
//#endregion
|
|
1050
1178
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1051
|
-
var
|
|
1052
|
-
function
|
|
1179
|
+
var kt = "no items available";
|
|
1180
|
+
function At(e) {
|
|
1053
1181
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1054
1182
|
loading: !!e.loading.value,
|
|
1055
|
-
message:
|
|
1183
|
+
message: kt,
|
|
1056
1184
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1057
1185
|
surface: e.surface,
|
|
1058
1186
|
total: e.itemCount.value
|
|
@@ -1060,23 +1188,23 @@ function yt(e) {
|
|
|
1060
1188
|
return {
|
|
1061
1189
|
emptyStateProps: t,
|
|
1062
1190
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1063
|
-
showCustomEmptyState: i(() =>
|
|
1191
|
+
showCustomEmptyState: i(() => Dt(n.value)),
|
|
1064
1192
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1065
1193
|
};
|
|
1066
1194
|
}
|
|
1067
1195
|
//#endregion
|
|
1068
1196
|
//#region src/components/viewer-core/format.ts
|
|
1069
|
-
function
|
|
1197
|
+
function jt(e) {
|
|
1070
1198
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1071
1199
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1072
1200
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1073
1201
|
}
|
|
1074
1202
|
//#endregion
|
|
1075
1203
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1076
|
-
function
|
|
1204
|
+
function Mt(e) {
|
|
1077
1205
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1078
1206
|
}
|
|
1079
|
-
function
|
|
1207
|
+
function Nt(e) {
|
|
1080
1208
|
return e.phase === "failed" ? {
|
|
1081
1209
|
kind: "failed",
|
|
1082
1210
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1099,7 +1227,7 @@ function St(e) {
|
|
|
1099
1227
|
}
|
|
1100
1228
|
//#endregion
|
|
1101
1229
|
//#region src/components/viewer-core/useActivation.ts
|
|
1102
|
-
function
|
|
1230
|
+
function Pt(e) {
|
|
1103
1231
|
let t = !1;
|
|
1104
1232
|
F(e.enabled, async (t) => {
|
|
1105
1233
|
if (n(t), t) {
|
|
@@ -1122,42 +1250,44 @@ function Ct(e) {
|
|
|
1122
1250
|
}
|
|
1123
1251
|
//#endregion
|
|
1124
1252
|
//#region src/components/viewer-core/assetState.ts
|
|
1125
|
-
var
|
|
1253
|
+
var Ft = {
|
|
1126
1254
|
currentTime: 0,
|
|
1127
1255
|
duration: 0,
|
|
1128
1256
|
errorKind: null,
|
|
1257
|
+
muted: !1,
|
|
1129
1258
|
paused: !0,
|
|
1130
|
-
ready: !1
|
|
1259
|
+
ready: !1,
|
|
1260
|
+
volume: 1
|
|
1131
1261
|
};
|
|
1132
|
-
function
|
|
1133
|
-
return { ...
|
|
1262
|
+
function It() {
|
|
1263
|
+
return { ...Ft };
|
|
1134
1264
|
}
|
|
1135
|
-
function
|
|
1265
|
+
function Lt(e) {
|
|
1136
1266
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1137
1267
|
}
|
|
1138
|
-
function
|
|
1139
|
-
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.paused = t.paused, n && n !== "error" && (e.errorKind = null), e.ready =
|
|
1268
|
+
function Rt(e, t, n) {
|
|
1269
|
+
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);
|
|
1140
1270
|
}
|
|
1141
|
-
function
|
|
1271
|
+
function zt(e, t) {
|
|
1142
1272
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1143
1273
|
}
|
|
1144
1274
|
//#endregion
|
|
1145
1275
|
//#region src/components/viewer-core/loadError.ts
|
|
1146
|
-
var
|
|
1147
|
-
function
|
|
1276
|
+
var Bt = /* @__PURE__ */ new Map();
|
|
1277
|
+
function Vt(e) {
|
|
1148
1278
|
return e === "not-found" ? "404" : "Load error";
|
|
1149
1279
|
}
|
|
1150
|
-
function
|
|
1280
|
+
function Ht(e) {
|
|
1151
1281
|
return e === "generic";
|
|
1152
1282
|
}
|
|
1153
|
-
function
|
|
1154
|
-
let t =
|
|
1283
|
+
function Ut(e) {
|
|
1284
|
+
let t = Bt.get(e);
|
|
1155
1285
|
if (t) return t;
|
|
1156
|
-
let n =
|
|
1157
|
-
return
|
|
1286
|
+
let n = Wt(e);
|
|
1287
|
+
return Bt.set(e, n), n;
|
|
1158
1288
|
}
|
|
1159
|
-
async function
|
|
1160
|
-
if (!
|
|
1289
|
+
async function Wt(e) {
|
|
1290
|
+
if (!Gt(e)) return "generic";
|
|
1161
1291
|
try {
|
|
1162
1292
|
let t = await fetch(e, { method: "HEAD" });
|
|
1163
1293
|
if (!t.ok && t.status === 404) return "not-found";
|
|
@@ -1166,12 +1296,12 @@ async function Nt(e) {
|
|
|
1166
1296
|
}
|
|
1167
1297
|
return "generic";
|
|
1168
1298
|
}
|
|
1169
|
-
function
|
|
1299
|
+
function Gt(e) {
|
|
1170
1300
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1171
1301
|
}
|
|
1172
1302
|
//#endregion
|
|
1173
1303
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1174
|
-
function
|
|
1304
|
+
function Kt(e) {
|
|
1175
1305
|
try {
|
|
1176
1306
|
let t = e.play();
|
|
1177
1307
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1179,77 +1309,77 @@ function Ft(e) {
|
|
|
1179
1309
|
}
|
|
1180
1310
|
//#endregion
|
|
1181
1311
|
//#region src/components/viewer-core/useMedia.ts
|
|
1182
|
-
function
|
|
1183
|
-
let t = T({}), n = T({}), r = T({}), a = T({}), o = /* @__PURE__ */ new Map(),
|
|
1312
|
+
function qt(e) {
|
|
1313
|
+
let t = T({}), n = T({}), r = T({}), a = T({}), o = T({}), 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(() => {
|
|
1184
1314
|
let t = /* @__PURE__ */ new Map();
|
|
1185
|
-
for (let n of e.items.value) t.set(
|
|
1315
|
+
for (let n of e.items.value) t.set($(n), n);
|
|
1186
1316
|
return t;
|
|
1187
|
-
}),
|
|
1188
|
-
F(() =>
|
|
1189
|
-
await
|
|
1317
|
+
}), p = i(() => d.value ? r.value[d.value] ?? Ft : Ft), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : Jt(p.value.currentTime / m.value * 100, 0, 100)), _ = i(() => u.value ? L(u.value) : null);
|
|
1318
|
+
F(() => u.value, async () => {
|
|
1319
|
+
await S();
|
|
1190
1320
|
}), F(() => e.itemCount.value, async () => {
|
|
1191
|
-
await
|
|
1321
|
+
await S();
|
|
1192
1322
|
}), F(() => e.loopFullscreenVideo.value, async () => {
|
|
1193
|
-
await
|
|
1323
|
+
await S();
|
|
1194
1324
|
});
|
|
1195
|
-
function
|
|
1325
|
+
function v(e, t) {
|
|
1196
1326
|
if (t instanceof HTMLVideoElement) {
|
|
1197
|
-
|
|
1327
|
+
s.set(e, t), U(e, t);
|
|
1198
1328
|
return;
|
|
1199
1329
|
}
|
|
1200
|
-
|
|
1330
|
+
s.delete(e);
|
|
1201
1331
|
}
|
|
1202
|
-
function
|
|
1332
|
+
function y(e, t) {
|
|
1203
1333
|
if (t instanceof HTMLAudioElement) {
|
|
1204
|
-
|
|
1334
|
+
c.set(e, t), U(e, t);
|
|
1205
1335
|
return;
|
|
1206
1336
|
}
|
|
1207
|
-
|
|
1337
|
+
c.delete(e);
|
|
1208
1338
|
}
|
|
1209
|
-
function
|
|
1210
|
-
r instanceof HTMLImageElement &&
|
|
1339
|
+
function b(e, r) {
|
|
1340
|
+
r instanceof HTMLImageElement && Lt(r) && (t.value[e] = !0, n.value[e] = null, Y(e, r.currentSrc || r.src || ne(e)));
|
|
1211
1341
|
}
|
|
1212
|
-
function
|
|
1213
|
-
|
|
1342
|
+
function x() {
|
|
1343
|
+
te(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
|
|
1214
1344
|
}
|
|
1215
|
-
async function
|
|
1345
|
+
async function S() {
|
|
1216
1346
|
if (!e.isEnabled.value) {
|
|
1217
|
-
|
|
1347
|
+
te();
|
|
1218
1348
|
return;
|
|
1219
1349
|
}
|
|
1220
1350
|
await g();
|
|
1221
|
-
let t =
|
|
1222
|
-
for (let [n, i] of
|
|
1351
|
+
let t = u.value;
|
|
1352
|
+
for (let [n, i] of s.entries()) {
|
|
1223
1353
|
if (n !== t || r.value[n]?.errorKind) {
|
|
1224
|
-
|
|
1354
|
+
V(i, n);
|
|
1225
1355
|
continue;
|
|
1226
1356
|
}
|
|
1227
|
-
i.muted = !
|
|
1357
|
+
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, Kt(i), U(n, i);
|
|
1228
1358
|
}
|
|
1229
|
-
for (let [e, n] of
|
|
1359
|
+
for (let [e, n] of c.entries()) {
|
|
1230
1360
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1231
|
-
|
|
1361
|
+
V(n, e);
|
|
1232
1362
|
continue;
|
|
1233
1363
|
}
|
|
1234
|
-
|
|
1364
|
+
Kt(n), U(e, n);
|
|
1235
1365
|
}
|
|
1236
1366
|
}
|
|
1237
|
-
function
|
|
1367
|
+
function C(e, t) {
|
|
1238
1368
|
let n = t.currentTarget instanceof HTMLMediaElement ? t.currentTarget : t.target instanceof HTMLMediaElement ? t.target : null;
|
|
1239
1369
|
if (n) {
|
|
1240
1370
|
let i = r.value[e]?.ready ?? !1;
|
|
1241
|
-
|
|
1371
|
+
U(e, n, t.type);
|
|
1242
1372
|
let a = r.value[e]?.ready ?? !1;
|
|
1243
|
-
!i && a &&
|
|
1373
|
+
!i && a && Y(e, n.currentSrc || n.src || ne(e));
|
|
1244
1374
|
}
|
|
1245
1375
|
}
|
|
1246
|
-
function
|
|
1247
|
-
t.value[e] = !0, n.value[e] = null,
|
|
1376
|
+
function w(e, r) {
|
|
1377
|
+
t.value[e] = !0, n.value[e] = null, Y(e, r);
|
|
1248
1378
|
}
|
|
1249
|
-
async function
|
|
1250
|
-
let a =
|
|
1379
|
+
async function E(r, i) {
|
|
1380
|
+
let a = X(r) ?? e.activeItem.value;
|
|
1251
1381
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1252
|
-
let o = await
|
|
1382
|
+
let o = await Ut(i);
|
|
1253
1383
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1254
1384
|
item: a,
|
|
1255
1385
|
occurrenceKey: r,
|
|
@@ -1258,8 +1388,8 @@ function It(e) {
|
|
|
1258
1388
|
surface: "fullscreen"
|
|
1259
1389
|
});
|
|
1260
1390
|
}
|
|
1261
|
-
async function
|
|
1262
|
-
let r =
|
|
1391
|
+
async function D(t, n) {
|
|
1392
|
+
let r = K(t), i = H(t), a = X(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1263
1393
|
if (r) {
|
|
1264
1394
|
r.pause();
|
|
1265
1395
|
try {
|
|
@@ -1267,7 +1397,7 @@ function It(e) {
|
|
|
1267
1397
|
} catch {}
|
|
1268
1398
|
}
|
|
1269
1399
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1270
|
-
let o = await
|
|
1400
|
+
let o = await Ut(n);
|
|
1271
1401
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1272
1402
|
item: a,
|
|
1273
1403
|
occurrenceKey: t,
|
|
@@ -1276,137 +1406,152 @@ function It(e) {
|
|
|
1276
1406
|
surface: "fullscreen"
|
|
1277
1407
|
});
|
|
1278
1408
|
}
|
|
1279
|
-
function D(e, t, n) {
|
|
1280
|
-
e.button !== 0 || Date.now() < n || G(o.get(t) ?? null);
|
|
1281
|
-
}
|
|
1282
1409
|
function O(e, t, n) {
|
|
1283
|
-
e.button !== 0 || Date.now() < n ||
|
|
1410
|
+
e.button !== 0 || Date.now() < n || J(s.get(t) ?? null);
|
|
1411
|
+
}
|
|
1412
|
+
function k(e, t, n) {
|
|
1413
|
+
e.button !== 0 || Date.now() < n || J(K(t));
|
|
1284
1414
|
}
|
|
1285
|
-
function
|
|
1286
|
-
let t =
|
|
1415
|
+
function A(e) {
|
|
1416
|
+
let t = q(), n = d.value;
|
|
1287
1417
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1288
1418
|
let r = Number.parseFloat(e.target.value);
|
|
1289
1419
|
if (!Number.isFinite(r)) return;
|
|
1290
|
-
let i =
|
|
1291
|
-
|
|
1292
|
-
}
|
|
1293
|
-
function A(e) {
|
|
1294
|
-
return !!t.value[e] && !n.value[e];
|
|
1420
|
+
let i = Jt(r, 0, m.value || 0);
|
|
1421
|
+
W(n, i, t), t.currentTime = i;
|
|
1295
1422
|
}
|
|
1296
1423
|
function j(e) {
|
|
1297
|
-
|
|
1424
|
+
let t = q(), n = d.value;
|
|
1425
|
+
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1426
|
+
let r = Jt(Number.parseFloat(e.target.value), 0, 1);
|
|
1427
|
+
t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), U(n, t);
|
|
1298
1428
|
}
|
|
1299
|
-
function M(
|
|
1300
|
-
|
|
1429
|
+
function M() {
|
|
1430
|
+
let e = q(), t = d.value;
|
|
1431
|
+
!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), U(t, e));
|
|
1301
1432
|
}
|
|
1302
1433
|
function N(e) {
|
|
1303
|
-
return
|
|
1434
|
+
return !!t.value[e] && !n.value[e];
|
|
1304
1435
|
}
|
|
1305
1436
|
function P(e) {
|
|
1306
|
-
|
|
1307
|
-
return t ? At(t) : null;
|
|
1437
|
+
return (r.value[e]?.ready ?? !1) && !r.value[e]?.errorKind;
|
|
1308
1438
|
}
|
|
1309
1439
|
function I(e) {
|
|
1310
|
-
return
|
|
1440
|
+
return e.url;
|
|
1311
1441
|
}
|
|
1312
1442
|
function L(e) {
|
|
1443
|
+
return n.value[e] ?? r.value[e]?.errorKind ?? null;
|
|
1444
|
+
}
|
|
1445
|
+
function R(e) {
|
|
1446
|
+
let t = L(e);
|
|
1447
|
+
return t ? Vt(t) : null;
|
|
1448
|
+
}
|
|
1449
|
+
function z(e) {
|
|
1450
|
+
return Ht(L(e));
|
|
1451
|
+
}
|
|
1452
|
+
function ee(e) {
|
|
1313
1453
|
return `${e}:${a.value[e] ?? 0}`;
|
|
1314
1454
|
}
|
|
1315
|
-
async function
|
|
1316
|
-
if (!
|
|
1455
|
+
async function B(e) {
|
|
1456
|
+
if (!z(e)) return;
|
|
1317
1457
|
t.value[e] = !1, n.value[e] = null;
|
|
1318
|
-
let r =
|
|
1458
|
+
let r = H(e);
|
|
1319
1459
|
r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
|
|
1320
|
-
let i =
|
|
1321
|
-
i &&
|
|
1322
|
-
t.startsWith(`${e}|`) &&
|
|
1323
|
-
}), a.value[e] = (a.value[e] ?? 0) + 1, await g(), await
|
|
1460
|
+
let i = K(e);
|
|
1461
|
+
i && V(i, e), l.forEach((t) => {
|
|
1462
|
+
t.startsWith(`${e}|`) && l.delete(t);
|
|
1463
|
+
}), a.value[e] = (a.value[e] ?? 0) + 1, await g(), await S();
|
|
1324
1464
|
}
|
|
1325
|
-
function
|
|
1465
|
+
function V(e, t) {
|
|
1326
1466
|
e.pause();
|
|
1327
1467
|
try {
|
|
1328
1468
|
e.currentTime = 0;
|
|
1329
1469
|
} catch {}
|
|
1330
|
-
|
|
1470
|
+
U(t, e);
|
|
1331
1471
|
}
|
|
1332
|
-
function
|
|
1333
|
-
for (let [e, t] of
|
|
1334
|
-
for (let [e, t] of
|
|
1472
|
+
function te() {
|
|
1473
|
+
for (let [e, t] of s.entries()) V(t, e);
|
|
1474
|
+
for (let [e, t] of c.entries()) V(t, e);
|
|
1335
1475
|
}
|
|
1336
|
-
function
|
|
1337
|
-
return r.value[e] || (r.value[e] =
|
|
1476
|
+
function H(e) {
|
|
1477
|
+
return r.value[e] || (r.value[e] = It()), r.value[e];
|
|
1338
1478
|
}
|
|
1339
|
-
function
|
|
1340
|
-
|
|
1479
|
+
function U(e, t, n) {
|
|
1480
|
+
Rt(H(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
|
|
1341
1481
|
}
|
|
1342
|
-
function
|
|
1343
|
-
let r =
|
|
1344
|
-
r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.paused = n.paused;
|
|
1482
|
+
function W(e, t, n) {
|
|
1483
|
+
let r = H(e);
|
|
1484
|
+
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;
|
|
1345
1485
|
}
|
|
1346
|
-
function
|
|
1347
|
-
return o.
|
|
1486
|
+
function G(e) {
|
|
1487
|
+
return Jt(o.value[e] ?? 1, 0, 1);
|
|
1348
1488
|
}
|
|
1349
|
-
function
|
|
1350
|
-
return
|
|
1489
|
+
function K(e) {
|
|
1490
|
+
return s.get(e) ?? c.get(e) ?? null;
|
|
1351
1491
|
}
|
|
1352
|
-
function
|
|
1492
|
+
function q() {
|
|
1493
|
+
return d.value ? K(d.value) : null;
|
|
1494
|
+
}
|
|
1495
|
+
function J(e) {
|
|
1353
1496
|
if (e) {
|
|
1354
1497
|
if (e.paused) {
|
|
1355
|
-
|
|
1498
|
+
Kt(e);
|
|
1356
1499
|
return;
|
|
1357
1500
|
}
|
|
1358
1501
|
e.pause();
|
|
1359
1502
|
}
|
|
1360
1503
|
}
|
|
1361
|
-
function
|
|
1362
|
-
let r =
|
|
1504
|
+
function Y(t, n) {
|
|
1505
|
+
let r = X(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1363
1506
|
if (!r || !n) return;
|
|
1364
1507
|
let i = `${t}|${n}`;
|
|
1365
|
-
|
|
1508
|
+
l.has(i) || (l.add(i), e.onAssetLoad?.({
|
|
1366
1509
|
item: r,
|
|
1367
1510
|
occurrenceKey: t,
|
|
1368
1511
|
surface: "fullscreen",
|
|
1369
1512
|
url: n
|
|
1370
1513
|
}));
|
|
1371
1514
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return
|
|
1515
|
+
function X(e) {
|
|
1516
|
+
return f.value.get(e) ?? null;
|
|
1374
1517
|
}
|
|
1375
|
-
function
|
|
1376
|
-
return
|
|
1518
|
+
function ne(e) {
|
|
1519
|
+
return X(e)?.url ?? null;
|
|
1377
1520
|
}
|
|
1378
1521
|
return {
|
|
1379
|
-
activeAssetErrorKind:
|
|
1380
|
-
activeMediaDuration:
|
|
1381
|
-
activeMediaProgress:
|
|
1382
|
-
activeMediaState:
|
|
1383
|
-
getAssetErrorKind:
|
|
1384
|
-
getAssetErrorLabel:
|
|
1385
|
-
getAssetRenderKey:
|
|
1386
|
-
getImageSource:
|
|
1387
|
-
isImageReady:
|
|
1388
|
-
isMediaReady:
|
|
1389
|
-
canRetryAsset:
|
|
1522
|
+
activeAssetErrorKind: _,
|
|
1523
|
+
activeMediaDuration: m,
|
|
1524
|
+
activeMediaProgress: h,
|
|
1525
|
+
activeMediaState: p,
|
|
1526
|
+
getAssetErrorKind: L,
|
|
1527
|
+
getAssetErrorLabel: R,
|
|
1528
|
+
getAssetRenderKey: ee,
|
|
1529
|
+
getImageSource: I,
|
|
1530
|
+
isImageReady: N,
|
|
1531
|
+
isMediaReady: P,
|
|
1532
|
+
canRetryAsset: z,
|
|
1390
1533
|
mediaStates: r,
|
|
1391
|
-
onAudioCoverClick:
|
|
1392
|
-
onImageError:
|
|
1393
|
-
onImageLoad:
|
|
1394
|
-
onMediaError:
|
|
1395
|
-
onMediaEvent:
|
|
1396
|
-
onMediaSeekInput:
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1534
|
+
onAudioCoverClick: k,
|
|
1535
|
+
onImageError: E,
|
|
1536
|
+
onImageLoad: w,
|
|
1537
|
+
onMediaError: D,
|
|
1538
|
+
onMediaEvent: C,
|
|
1539
|
+
onMediaSeekInput: A,
|
|
1540
|
+
onMediaVolumeInput: j,
|
|
1541
|
+
onMediaVolumeToggle: M,
|
|
1542
|
+
onVideoClick: O,
|
|
1543
|
+
registerAudioElement: y,
|
|
1544
|
+
registerImageElement: b,
|
|
1545
|
+
registerVideoElement: v,
|
|
1546
|
+
resetMediaState: x,
|
|
1547
|
+
retryAsset: B,
|
|
1548
|
+
syncMediaPlayback: S
|
|
1404
1549
|
};
|
|
1405
1550
|
}
|
|
1406
|
-
function
|
|
1551
|
+
function Jt(e, t, n) {
|
|
1407
1552
|
return Math.min(Math.max(e, t), n);
|
|
1408
1553
|
}
|
|
1409
|
-
function
|
|
1554
|
+
function Yt(e, t, n = 2) {
|
|
1410
1555
|
return t <= 0 ? {
|
|
1411
1556
|
start: 0,
|
|
1412
1557
|
end: -1
|
|
@@ -1415,14 +1560,14 @@ function Rt(e, t, n = 2) {
|
|
|
1415
1560
|
end: Math.min(t - 1, e + n)
|
|
1416
1561
|
};
|
|
1417
1562
|
}
|
|
1418
|
-
function
|
|
1419
|
-
let r =
|
|
1563
|
+
function Xt(e, t, n = 2) {
|
|
1564
|
+
let r = Yt(t, e.length, n);
|
|
1420
1565
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1421
1566
|
item: e,
|
|
1422
1567
|
index: r.start + t
|
|
1423
1568
|
}));
|
|
1424
1569
|
}
|
|
1425
|
-
function
|
|
1570
|
+
function Zt(e, t, n, r, i) {
|
|
1426
1571
|
return {
|
|
1427
1572
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1428
1573
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1430,12 +1575,12 @@ function Bt(e, t, n, r, i) {
|
|
|
1430
1575
|
}
|
|
1431
1576
|
//#endregion
|
|
1432
1577
|
//#region src/components/viewer-core/useViewer.ts
|
|
1433
|
-
function
|
|
1434
|
-
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(() =>
|
|
1578
|
+
function Qt(e, t, n = {}) {
|
|
1579
|
+
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(() => Mt({
|
|
1435
1580
|
itemCount: r.value.length,
|
|
1436
1581
|
loading: s.value,
|
|
1437
1582
|
phase: e.phase
|
|
1438
|
-
})), f = i(() => !1), p = T(null), m = T(0), h = T(!1), g = T(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), E =
|
|
1583
|
+
})), f = i(() => !1), p = T(null), m = T(0), h = T(!1), g = T(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), E = qt({
|
|
1439
1584
|
items: r,
|
|
1440
1585
|
activeItem: C,
|
|
1441
1586
|
activeMediaItem: w,
|
|
@@ -1444,22 +1589,22 @@ function Vt(e, t, n = {}) {
|
|
|
1444
1589
|
loopFullscreenVideo: l,
|
|
1445
1590
|
onAssetError: n.onAssetError,
|
|
1446
1591
|
onAssetLoad: n.onAssetLoad
|
|
1447
|
-
}), D = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() =>
|
|
1592
|
+
}), D = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Nt({
|
|
1448
1593
|
errorMessage: o.value,
|
|
1449
1594
|
hasItems: r.value.length > 0,
|
|
1450
1595
|
hasNextPage: c.value,
|
|
1451
1596
|
phase: d.value,
|
|
1452
1597
|
surface: "fullscreen"
|
|
1453
|
-
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() =>
|
|
1454
|
-
|
|
1598
|
+
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => Yt(S.value, r.value.length)), N = i(() => Xt(r.value, S.value));
|
|
1599
|
+
Pt({
|
|
1455
1600
|
enabled: _,
|
|
1456
1601
|
onDisable() {
|
|
1457
|
-
|
|
1602
|
+
H(), E.resetMediaState();
|
|
1458
1603
|
},
|
|
1459
1604
|
onEnable() {
|
|
1460
1605
|
return E.syncMediaPlayback();
|
|
1461
1606
|
},
|
|
1462
|
-
onKeydown:
|
|
1607
|
+
onKeydown: W,
|
|
1463
1608
|
onResize: F
|
|
1464
1609
|
});
|
|
1465
1610
|
function P(e, t, n) {
|
|
@@ -1481,49 +1626,55 @@ function Vt(e, t, n = {}) {
|
|
|
1481
1626
|
return t && !I(-1) || n && !I(1) ? e * .24 : e;
|
|
1482
1627
|
}
|
|
1483
1628
|
function z(e) {
|
|
1484
|
-
!_.value || r.value.length === 0 || e.pointerType === "mouse" ||
|
|
1629
|
+
!_.value || r.value.length === 0 || e.pointerType === "mouse" || fe(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
|
|
1485
1630
|
}
|
|
1486
|
-
function
|
|
1631
|
+
function ee(e) {
|
|
1487
1632
|
!_.value || !h.value || v !== e.pointerId || (m.value = R(e.clientY - y));
|
|
1488
1633
|
}
|
|
1489
|
-
function
|
|
1490
|
-
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId),
|
|
1634
|
+
function B(e) {
|
|
1635
|
+
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), te());
|
|
1491
1636
|
}
|
|
1492
|
-
function
|
|
1493
|
-
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId),
|
|
1637
|
+
function V(e) {
|
|
1638
|
+
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), H());
|
|
1494
1639
|
}
|
|
1495
|
-
function
|
|
1496
|
-
Math.abs(m.value) >= j.value && (x = Date.now() + 250, L(m.value < 0 ? 1 : -1)),
|
|
1640
|
+
function te() {
|
|
1641
|
+
Math.abs(m.value) >= j.value && (x = Date.now() + 250, L(m.value < 0 ? 1 : -1)), H();
|
|
1497
1642
|
}
|
|
1498
|
-
function
|
|
1643
|
+
function H() {
|
|
1499
1644
|
m.value = 0, h.value = !1, v = null;
|
|
1500
1645
|
}
|
|
1501
|
-
function
|
|
1502
|
-
if (!_.value || r.value.length === 0 || h.value ||
|
|
1646
|
+
function U(e) {
|
|
1647
|
+
if (!_.value || r.value.length === 0 || h.value || fe(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
|
|
1503
1648
|
e.preventDefault();
|
|
1504
1649
|
let t = Date.now();
|
|
1505
1650
|
t < b || (b = t + 400, L(e.deltaY > 0 ? 1 : -1));
|
|
1506
1651
|
}
|
|
1507
|
-
function
|
|
1508
|
-
!_.value || r.value.length === 0 ||
|
|
1652
|
+
function W(e) {
|
|
1653
|
+
!_.value || r.value.length === 0 || Q(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), L(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), L(-1)));
|
|
1509
1654
|
}
|
|
1510
|
-
function
|
|
1655
|
+
function G(e, t) {
|
|
1511
1656
|
E.onVideoClick(e, t, x);
|
|
1512
1657
|
}
|
|
1513
|
-
function
|
|
1658
|
+
function K(e, t) {
|
|
1514
1659
|
E.onAudioCoverClick(e, t, x);
|
|
1515
1660
|
}
|
|
1516
|
-
function
|
|
1661
|
+
function q(e) {
|
|
1517
1662
|
E.onMediaSeekInput(e);
|
|
1518
1663
|
}
|
|
1519
|
-
function
|
|
1664
|
+
function J(e) {
|
|
1665
|
+
E.onMediaVolumeInput(e);
|
|
1666
|
+
}
|
|
1667
|
+
function Y() {
|
|
1668
|
+
E.onMediaVolumeToggle();
|
|
1669
|
+
}
|
|
1670
|
+
function X(e) {
|
|
1520
1671
|
return e.type === "image" || e.type === "video";
|
|
1521
1672
|
}
|
|
1522
|
-
function
|
|
1673
|
+
function ne(e) {
|
|
1523
1674
|
return e.type === "audio";
|
|
1524
1675
|
}
|
|
1525
|
-
function
|
|
1526
|
-
return
|
|
1676
|
+
function re(e) {
|
|
1677
|
+
return Zt(e, S.value, g.value, m.value, h.value);
|
|
1527
1678
|
}
|
|
1528
1679
|
return {
|
|
1529
1680
|
activeItem: C,
|
|
@@ -1538,30 +1689,32 @@ function Vt(e, t, n = {}) {
|
|
|
1538
1689
|
getAssetErrorKind: E.getAssetErrorKind,
|
|
1539
1690
|
getAssetErrorLabel: E.getAssetErrorLabel,
|
|
1540
1691
|
getAssetRenderKey: E.getAssetRenderKey,
|
|
1541
|
-
formatPlaybackTime:
|
|
1692
|
+
formatPlaybackTime: jt,
|
|
1542
1693
|
getImageSource: E.getImageSource,
|
|
1543
|
-
getSlideStyle:
|
|
1694
|
+
getSlideStyle: re,
|
|
1544
1695
|
hasNextPage: c,
|
|
1545
1696
|
isAtEnd: D,
|
|
1546
|
-
isAudio:
|
|
1547
|
-
isVisual:
|
|
1697
|
+
isAudio: ne,
|
|
1698
|
+
isVisual: X,
|
|
1548
1699
|
items: r,
|
|
1549
1700
|
loading: s,
|
|
1550
1701
|
mediaStates: E.mediaStates,
|
|
1551
1702
|
isImageReady: E.isImageReady,
|
|
1552
1703
|
isMediaReady: E.isMediaReady,
|
|
1553
|
-
onAudioCoverClick:
|
|
1704
|
+
onAudioCoverClick: K,
|
|
1554
1705
|
onImageError: E.onImageError,
|
|
1555
1706
|
onImageLoad: E.onImageLoad,
|
|
1556
1707
|
onMediaEvent: E.onMediaEvent,
|
|
1557
1708
|
onMediaError: E.onMediaError,
|
|
1558
|
-
onMediaSeekInput:
|
|
1559
|
-
|
|
1709
|
+
onMediaSeekInput: q,
|
|
1710
|
+
onMediaVolumeInput: J,
|
|
1711
|
+
onMediaVolumeToggle: Y,
|
|
1712
|
+
onPointerCancel: V,
|
|
1560
1713
|
onPointerDown: z,
|
|
1561
|
-
onPointerMove:
|
|
1562
|
-
onPointerUp:
|
|
1563
|
-
onVideoClick:
|
|
1564
|
-
onWheel:
|
|
1714
|
+
onPointerMove: ee,
|
|
1715
|
+
onPointerUp: B,
|
|
1716
|
+
onVideoClick: G,
|
|
1717
|
+
onWheel: U,
|
|
1565
1718
|
registerAudioElement: E.registerAudioElement,
|
|
1566
1719
|
registerImageElement: E.registerImageElement,
|
|
1567
1720
|
registerVideoElement: E.registerVideoElement,
|
|
@@ -1579,21 +1732,21 @@ function Vt(e, t, n = {}) {
|
|
|
1579
1732
|
}
|
|
1580
1733
|
//#endregion
|
|
1581
1734
|
//#region src/components/viewer-core/theme.ts
|
|
1582
|
-
var
|
|
1735
|
+
var $t = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", en = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", tn = {
|
|
1583
1736
|
image: !0,
|
|
1584
1737
|
video: !0,
|
|
1585
1738
|
audio: !0,
|
|
1586
1739
|
other: !0
|
|
1587
1740
|
};
|
|
1588
|
-
function
|
|
1589
|
-
return
|
|
1741
|
+
function nn(e) {
|
|
1742
|
+
return tn[e], $t;
|
|
1590
1743
|
}
|
|
1591
|
-
function
|
|
1592
|
-
return
|
|
1744
|
+
function rn(e) {
|
|
1745
|
+
return tn[e], en;
|
|
1593
1746
|
}
|
|
1594
1747
|
//#endregion
|
|
1595
1748
|
//#region src/components/viewer-core/dominantImageTone.ts
|
|
1596
|
-
function
|
|
1749
|
+
function an(e) {
|
|
1597
1750
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
1598
1751
|
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
1599
1752
|
if (!n) return null;
|
|
@@ -1608,20 +1761,20 @@ function qt(e) {
|
|
|
1608
1761
|
r += d, i += s * d, a += c * d, o += l * d;
|
|
1609
1762
|
}
|
|
1610
1763
|
return r <= 0 ? null : {
|
|
1611
|
-
r:
|
|
1612
|
-
g:
|
|
1613
|
-
b:
|
|
1764
|
+
r: on(Math.round(i / r)),
|
|
1765
|
+
g: on(Math.round(a / r)),
|
|
1766
|
+
b: on(Math.round(o / r))
|
|
1614
1767
|
};
|
|
1615
1768
|
} catch {
|
|
1616
1769
|
return null;
|
|
1617
1770
|
}
|
|
1618
1771
|
}
|
|
1619
|
-
function
|
|
1772
|
+
function on(e) {
|
|
1620
1773
|
return Math.min(235, Math.max(26, e));
|
|
1621
1774
|
}
|
|
1622
1775
|
//#endregion
|
|
1623
1776
|
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
1624
|
-
function
|
|
1777
|
+
function sn(e) {
|
|
1625
1778
|
let t = T({}), 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(() => {
|
|
1626
1779
|
if (!r.value) return;
|
|
1627
1780
|
let { r: e, g: t, b: n } = r.value;
|
|
@@ -1636,7 +1789,7 @@ function Yt(e) {
|
|
|
1636
1789
|
});
|
|
1637
1790
|
function s(n, r) {
|
|
1638
1791
|
if (!e.showDominantImageTone.value) return;
|
|
1639
|
-
let i =
|
|
1792
|
+
let i = an(r);
|
|
1640
1793
|
i && (t.value[n] = i);
|
|
1641
1794
|
}
|
|
1642
1795
|
return {
|
|
@@ -1647,7 +1800,7 @@ function Yt(e) {
|
|
|
1647
1800
|
}
|
|
1648
1801
|
//#endregion
|
|
1649
1802
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
1650
|
-
var
|
|
1803
|
+
var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
|
|
1651
1804
|
inheritAttrs: !1,
|
|
1652
1805
|
__name: "SurfaceEmptyState",
|
|
1653
1806
|
props: {
|
|
@@ -1661,31 +1814,31 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1661
1814
|
"data-testid": "vibe-empty-state-inline",
|
|
1662
1815
|
"data-surface": e.surface,
|
|
1663
1816
|
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)]"]
|
|
1664
|
-
}), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16,
|
|
1817
|
+
}), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16, cn)) : (S(), s("div", h({ key: 1 }, j(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]"] }), [D(n.$slots, "default", {}, () => [c("span", {
|
|
1665
1818
|
"data-testid": "vibe-empty-state-badge",
|
|
1666
1819
|
"data-surface": e.surface,
|
|
1667
1820
|
class: _(["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"])
|
|
1668
|
-
}, k(e.message), 11,
|
|
1821
|
+
}, k(e.message), 11, ln)])], 16));
|
|
1669
1822
|
}
|
|
1670
|
-
}),
|
|
1823
|
+
}), dn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, fn = {
|
|
1671
1824
|
key: 0,
|
|
1672
1825
|
class: "relative h-full min-h-0"
|
|
1673
|
-
},
|
|
1826
|
+
}, pn = [
|
|
1674
1827
|
"data-item-id",
|
|
1675
1828
|
"data-occurrence-key",
|
|
1676
1829
|
"data-index",
|
|
1677
1830
|
"data-active",
|
|
1678
1831
|
"aria-hidden"
|
|
1679
|
-
],
|
|
1832
|
+
], mn = {
|
|
1680
1833
|
key: 0,
|
|
1681
1834
|
"data-testid": "vibe-asset-spinner",
|
|
1682
1835
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
1683
|
-
},
|
|
1836
|
+
}, hn = { 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]" }, gn = ["data-kind"], _n = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, vn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, yn = ["onClick"], bn = [
|
|
1684
1837
|
"src",
|
|
1685
1838
|
"alt",
|
|
1686
1839
|
"onLoad",
|
|
1687
1840
|
"onError"
|
|
1688
|
-
],
|
|
1841
|
+
], xn = [
|
|
1689
1842
|
"loop",
|
|
1690
1843
|
"src",
|
|
1691
1844
|
"preload",
|
|
@@ -1703,15 +1856,15 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1703
1856
|
"onStalled",
|
|
1704
1857
|
"onTimeupdate",
|
|
1705
1858
|
"onWaiting"
|
|
1706
|
-
],
|
|
1859
|
+
], Sn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Cn = [
|
|
1707
1860
|
"aria-label",
|
|
1708
1861
|
"disabled",
|
|
1709
1862
|
"onClick"
|
|
1710
|
-
],
|
|
1863
|
+
], wn = { 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]" }, Tn = { 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]" }, En = {
|
|
1711
1864
|
key: 0,
|
|
1712
1865
|
"data-testid": "vibe-asset-spinner",
|
|
1713
1866
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
1714
|
-
},
|
|
1867
|
+
}, Dn = { 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]" }, On = ["data-kind"], kn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, An = ["onClick"], jn = [
|
|
1715
1868
|
"src",
|
|
1716
1869
|
"preload",
|
|
1717
1870
|
"onCanplay",
|
|
@@ -1727,25 +1880,25 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1727
1880
|
"onStalled",
|
|
1728
1881
|
"onTimeupdate",
|
|
1729
1882
|
"onWaiting"
|
|
1730
|
-
],
|
|
1883
|
+
], Mn = {
|
|
1731
1884
|
key: 2,
|
|
1732
1885
|
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"
|
|
1733
|
-
},
|
|
1886
|
+
}, Nn = { 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]" }, Pn = {
|
|
1734
1887
|
key: 0,
|
|
1735
1888
|
class: "pointer-events-none absolute inset-0 z-[4]"
|
|
1736
|
-
},
|
|
1889
|
+
}, Fn = { class: "h-full w-full" }, In = {
|
|
1737
1890
|
key: 1,
|
|
1738
1891
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
1739
1892
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
1740
|
-
},
|
|
1893
|
+
}, Ln = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, Rn = { 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)]" }, zn = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, Bn = {
|
|
1741
1894
|
key: 0,
|
|
1742
1895
|
"data-testid": "vibe-fullscreen-aside",
|
|
1743
1896
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
1744
|
-
},
|
|
1897
|
+
}, Vn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Hn = {
|
|
1745
1898
|
key: 0,
|
|
1746
1899
|
"data-testid": "vibe-fullscreen-aside",
|
|
1747
1900
|
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]"
|
|
1748
|
-
},
|
|
1901
|
+
}, Un = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Wn = 1280, Gn = 768, Kn = /* @__PURE__ */ d({
|
|
1749
1902
|
__name: "FullscreenSurface",
|
|
1750
1903
|
props: {
|
|
1751
1904
|
active: {
|
|
@@ -1797,22 +1950,22 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1797
1950
|
},
|
|
1798
1951
|
emits: ["back-to-list", "update:activeIndex"],
|
|
1799
1952
|
setup(e, { emit: n }) {
|
|
1800
|
-
let d = e, p = N(), m = n, g =
|
|
1953
|
+
let d = e, p = N(), m = n, g = Qt(d, (e, t) => {
|
|
1801
1954
|
m("update:activeIndex", t);
|
|
1802
1955
|
}, {
|
|
1803
1956
|
enabled: A(d, "active"),
|
|
1804
1957
|
onAssetError: d.reportAssetError ?? void 0,
|
|
1805
1958
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
1806
|
-
}), C = T(typeof window > "u" ?
|
|
1959
|
+
}), C = T(typeof window > "u" ? Wn : window.innerWidth || Wn), w = Et({
|
|
1807
1960
|
active: A(d, "active"),
|
|
1808
1961
|
resolvedActiveIndex: g.resolvedActiveIndex,
|
|
1809
1962
|
viewer: g
|
|
1810
|
-
}), M = i(() =>
|
|
1963
|
+
}), M = i(() => nn(g.activeItem.value?.type ?? "image")), { activeSlideToneStyle: P, activeStageToneStyle: F, updateFromImageElement: I } = sn({
|
|
1811
1964
|
activeItem: g.activeItem,
|
|
1812
1965
|
getItemKey: w.getItemKey,
|
|
1813
1966
|
isImageReady: g.isImageReady,
|
|
1814
1967
|
showDominantImageTone: A(d, "showDominantImageTone")
|
|
1815
|
-
}), R = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"),
|
|
1968
|
+
}), R = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), ee = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), B = i(() => C.value < Gn ? "vertical" : "horizontal"), V = i(() => ee.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), te = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), H = i(() => d.hasNextPage ? "Loading more items" : g.statusMessage.value ?? "Loading more items"), U = i(() => {
|
|
1816
1969
|
let e = g.activeItem.value;
|
|
1817
1970
|
return e ? {
|
|
1818
1971
|
hasNextPage: d.hasNextPage,
|
|
@@ -1829,7 +1982,7 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1829
1982
|
}), q = i(() => !K.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](K.value)), J = i(() => ({
|
|
1830
1983
|
gridTemplateColumns: ne.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
1831
1984
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
1832
|
-
})),
|
|
1985
|
+
})), Y = i(() => Dt(W.value)), X = i(() => Dt(G.value)), ne = i(() => X.value && C.value >= Wn), se = i(() => X.value && !ne.value), ce = i(() => Dt(q.value)), { emptyStateProps: Z, showBadgeEmptyState: le, showCustomEmptyState: ue, showInlineEmptyState: de } = At({
|
|
1833
1986
|
emptyStateMode: A(d, "emptyStateMode"),
|
|
1834
1987
|
itemCount: i(() => d.items.length),
|
|
1835
1988
|
loading: A(d, "loading"),
|
|
@@ -1837,25 +1990,25 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1837
1990
|
surface: "fullscreen"
|
|
1838
1991
|
});
|
|
1839
1992
|
x(() => {
|
|
1840
|
-
window.addEventListener("resize",
|
|
1993
|
+
window.addEventListener("resize", Q);
|
|
1841
1994
|
}), b(() => {
|
|
1842
|
-
window.removeEventListener("resize",
|
|
1995
|
+
window.removeEventListener("resize", Q);
|
|
1843
1996
|
});
|
|
1844
|
-
function
|
|
1845
|
-
C.value = window.innerWidth ||
|
|
1997
|
+
function Q() {
|
|
1998
|
+
C.value = window.innerWidth || Wn;
|
|
1846
1999
|
}
|
|
1847
|
-
function
|
|
2000
|
+
function fe(e, t, n) {
|
|
1848
2001
|
g.onImageLoad(t, n);
|
|
1849
2002
|
let r = e.currentTarget;
|
|
1850
|
-
r instanceof HTMLImageElement &&
|
|
2003
|
+
r instanceof HTMLImageElement && me(t, r);
|
|
1851
2004
|
}
|
|
1852
|
-
function
|
|
1853
|
-
g.registerImageElement(e, t), t instanceof HTMLImageElement &&
|
|
2005
|
+
function pe(e, t) {
|
|
2006
|
+
g.registerImageElement(e, t), t instanceof HTMLImageElement && me(e, t);
|
|
1854
2007
|
}
|
|
1855
|
-
function
|
|
2008
|
+
function me(e, t) {
|
|
1856
2009
|
I(e, t);
|
|
1857
2010
|
}
|
|
1858
|
-
return (e, n) => (S(), s("div",
|
|
2011
|
+
return (e, n) => (S(), s("div", dn, [
|
|
1859
2012
|
c("div", {
|
|
1860
2013
|
class: _(["absolute inset-0 transition-[background] duration-200", M.value]),
|
|
1861
2014
|
style: y(j(F))
|
|
@@ -1872,7 +2025,7 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1872
2025
|
onPointerup: n[3] ||= (...e) => j(g).onPointerUp && j(g).onPointerUp(...e),
|
|
1873
2026
|
onPointercancel: n[4] ||= (...e) => j(g).onPointerCancel && j(g).onPointerCancel(...e),
|
|
1874
2027
|
onWheel: n[5] ||= (...e) => j(g).onWheel && j(g).onWheel(...e)
|
|
1875
|
-
}, [j(g).activeItem.value ? (S(), s("div",
|
|
2028
|
+
}, [j(g).activeItem.value ? (S(), s("div", fn, [
|
|
1876
2029
|
(S(!0), s(t, null, E(j(g).renderedItems.value, ({ item: r, index: i }) => (S(), s("article", {
|
|
1877
2030
|
key: j(w).getItemKey(r),
|
|
1878
2031
|
"data-testid": "vibe-slide",
|
|
@@ -1884,12 +2037,12 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1884
2037
|
class: _(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === j(g).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
|
|
1885
2038
|
style: y(j(g).getSlideStyle(i))
|
|
1886
2039
|
}, [c("div", {
|
|
1887
|
-
class: _(["absolute inset-0 opacity-85", j(
|
|
2040
|
+
class: _(["absolute inset-0 opacity-85", j(rn)(r.type)]),
|
|
1888
2041
|
style: y(i === j(g).resolvedActiveIndex.value && r.type === "image" ? j(P) : void 0)
|
|
1889
2042
|
}, null, 6), j(g).isVisual(r) ? (S(), s("div", {
|
|
1890
2043
|
key: 0,
|
|
1891
2044
|
class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? V.value : ""])
|
|
1892
|
-
}, [j(w).isAssetLoading(i, r) ? (S(), s("div",
|
|
2045
|
+
}, [j(w).isAssetLoading(i, r) ? (S(), s("div", mn, [c("span", hn, [u(j(re), {
|
|
1893
2046
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
1894
2047
|
"aria-hidden": "true"
|
|
1895
2048
|
})])])) : o("", !0), j(w).isAssetErrored(i, r) ? (S(), s("div", {
|
|
@@ -1897,19 +2050,19 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1897
2050
|
"data-testid": "vibe-asset-error",
|
|
1898
2051
|
"data-kind": j(w).getAssetErrorKind(r),
|
|
1899
2052
|
class: "grid h-full w-full place-items-center"
|
|
1900
|
-
}, [c("div",
|
|
1901
|
-
u(j(
|
|
2053
|
+
}, [c("div", _n, [
|
|
2054
|
+
u(j(oe), {
|
|
1902
2055
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
1903
2056
|
"aria-hidden": "true"
|
|
1904
2057
|
}),
|
|
1905
|
-
c("p",
|
|
2058
|
+
c("p", vn, k(j(w).getAssetErrorLabel(r)), 1),
|
|
1906
2059
|
j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
|
|
1907
2060
|
key: 0,
|
|
1908
2061
|
type: "button",
|
|
1909
2062
|
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",
|
|
1910
2063
|
onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
|
|
1911
|
-
}, " Retry ", 8,
|
|
1912
|
-
])], 8,
|
|
2064
|
+
}, " Retry ", 8, yn)) : o("", !0)
|
|
2065
|
+
])], 8, gn)) : r.type === "image" ? (S(), s("img", {
|
|
1913
2066
|
key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
|
|
1914
2067
|
src: j(w).getFullscreenImageSource(i, r),
|
|
1915
2068
|
alt: r.title ?? "",
|
|
@@ -1917,14 +2070,13 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1917
2070
|
draggable: "false",
|
|
1918
2071
|
class: _(["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", j(g).isImageReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
1919
2072
|
ref_for: !0,
|
|
1920
|
-
ref: (e) =>
|
|
1921
|
-
onLoad: (e) =>
|
|
2073
|
+
ref: (e) => pe(j(w).getItemKey(r), e),
|
|
2074
|
+
onLoad: (e) => fe(e, j(w).getItemKey(r), r.url),
|
|
1922
2075
|
onError: (e) => j(g).onImageError(j(w).getItemKey(r), r.url)
|
|
1923
|
-
}, null, 42,
|
|
2076
|
+
}, null, 42, bn)) : (S(), s("video", {
|
|
1924
2077
|
key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
|
|
1925
2078
|
class: _(["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", j(g).isMediaReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
1926
2079
|
playsinline: "",
|
|
1927
|
-
muted: "",
|
|
1928
2080
|
loop: d.loopFullscreenVideo,
|
|
1929
2081
|
src: j(w).getFullscreenMediaSource(i, r),
|
|
1930
2082
|
preload: j(w).shouldPreloadSlideAsset(i) ? "metadata" : "none",
|
|
@@ -1944,10 +2096,10 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1944
2096
|
onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1945
2097
|
onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
1946
2098
|
onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
|
|
1947
|
-
}, null, 42,
|
|
2099
|
+
}, null, 42, xn))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
|
|
1948
2100
|
key: 1,
|
|
1949
2101
|
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", i === j(g).resolvedActiveIndex.value ? V.value : ""])
|
|
1950
|
-
}, [c("div",
|
|
2102
|
+
}, [c("div", Sn, [
|
|
1951
2103
|
c("button", {
|
|
1952
2104
|
type: "button",
|
|
1953
2105
|
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]",
|
|
@@ -1957,19 +2109,19 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1957
2109
|
}, [
|
|
1958
2110
|
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),
|
|
1959
2111
|
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),
|
|
1960
|
-
c("span",
|
|
1961
|
-
icon: j(
|
|
2112
|
+
c("span", wn, [D(e.$slots, "item-icon", {
|
|
2113
|
+
icon: j(St)(r.type),
|
|
1962
2114
|
item: r
|
|
1963
|
-
}, () => [(S(), a(O(j(
|
|
2115
|
+
}, () => [(S(), a(O(j(St)(r.type)), {
|
|
1964
2116
|
class: "h-6 w-6 stroke-[1.9]",
|
|
1965
2117
|
"aria-hidden": "true"
|
|
1966
2118
|
}))])]),
|
|
1967
|
-
c("span",
|
|
2119
|
+
c("span", Tn, [(S(), a(O(j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
|
|
1968
2120
|
class: "h-4 w-4 stroke-2",
|
|
1969
2121
|
"aria-hidden": "true"
|
|
1970
2122
|
}))])
|
|
1971
|
-
], 8,
|
|
1972
|
-
j(w).isAssetLoading(i, r) ? (S(), s("div",
|
|
2123
|
+
], 8, Cn),
|
|
2124
|
+
j(w).isAssetLoading(i, r) ? (S(), s("div", En, [c("span", Dn, [u(j(re), {
|
|
1973
2125
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
1974
2126
|
"aria-hidden": "true"
|
|
1975
2127
|
})])])) : o("", !0),
|
|
@@ -1978,18 +2130,18 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
1978
2130
|
"data-kind": j(w).getAssetErrorKind(r),
|
|
1979
2131
|
class: "relative z-[1] grid justify-items-center gap-4"
|
|
1980
2132
|
}, [
|
|
1981
|
-
u(j(
|
|
2133
|
+
u(j(oe), {
|
|
1982
2134
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
1983
2135
|
"aria-hidden": "true"
|
|
1984
2136
|
}),
|
|
1985
|
-
c("p",
|
|
2137
|
+
c("p", kn, k(j(w).getAssetErrorLabel(r)), 1),
|
|
1986
2138
|
j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
|
|
1987
2139
|
key: 0,
|
|
1988
2140
|
type: "button",
|
|
1989
2141
|
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",
|
|
1990
2142
|
onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
|
|
1991
|
-
}, " Retry ", 8,
|
|
1992
|
-
], 8,
|
|
2143
|
+
}, " Retry ", 8, An)) : o("", !0)
|
|
2144
|
+
], 8, On)], 64)) : o("", !0)
|
|
1993
2145
|
]), (S(), s("audio", {
|
|
1994
2146
|
key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
|
|
1995
2147
|
src: j(w).getFullscreenMediaSource(i, r),
|
|
@@ -2010,15 +2162,15 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
2010
2162
|
onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
2011
2163
|
onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
|
|
2012
2164
|
onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
|
|
2013
|
-
}, null, 40,
|
|
2014
|
-
icon: j(
|
|
2165
|
+
}, null, 40, jn))], 2)) : (S(), s("div", Mn, [c("div", Nn, [D(e.$slots, "item-icon", {
|
|
2166
|
+
icon: j(St)(r.type),
|
|
2015
2167
|
item: r
|
|
2016
|
-
}, () => [(S(), a(O(j(
|
|
2168
|
+
}, () => [(S(), a(O(j(St)(r.type)), {
|
|
2017
2169
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2018
2170
|
"aria-hidden": "true"
|
|
2019
|
-
}))])])]))], 14,
|
|
2020
|
-
U.value && p["fullscreen-overlay"] ? (S(), s("div",
|
|
2021
|
-
j(g).activeItem.value ? (S(), a(
|
|
2171
|
+
}))])])]))], 14, pn))), 128)),
|
|
2172
|
+
U.value && p["fullscreen-overlay"] ? (S(), s("div", Pn, [c("div", Fn, [D(e.$slots, "fullscreen-overlay", v(f(U.value)))])])) : o("", !0),
|
|
2173
|
+
j(g).activeItem.value ? (S(), a(yt, {
|
|
2022
2174
|
key: 1,
|
|
2023
2175
|
"current-index": j(g).resolvedActiveIndex.value,
|
|
2024
2176
|
loading: d.loading,
|
|
@@ -2028,7 +2180,7 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
2028
2180
|
title: j(g).activeItem.value.title ?? null,
|
|
2029
2181
|
total: j(g).items.value.length,
|
|
2030
2182
|
onBackToList: n[0] ||= (e) => m("back-to-list")
|
|
2031
|
-
}, l({ _: 2 }, [
|
|
2183
|
+
}, l({ _: 2 }, [Y.value && U.value ? {
|
|
2032
2184
|
name: "actions",
|
|
2033
2185
|
fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(U.value)))]),
|
|
2034
2186
|
key: "0"
|
|
@@ -2041,21 +2193,31 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
2041
2193
|
"title",
|
|
2042
2194
|
"total"
|
|
2043
2195
|
])) : o("", !0),
|
|
2044
|
-
|
|
2196
|
+
ee.value ? (S(), a(ct, {
|
|
2045
2197
|
key: 2,
|
|
2046
2198
|
"current-time": j(g).activeMediaState.value.currentTime,
|
|
2047
2199
|
"current-time-label": j(g).formatPlaybackTime(j(g).activeMediaState.value.currentTime),
|
|
2048
2200
|
duration: j(g).activeMediaDuration.value,
|
|
2049
2201
|
"duration-label": j(g).formatPlaybackTime(j(g).activeMediaDuration.value),
|
|
2202
|
+
muted: j(g).activeMediaState.value.muted,
|
|
2050
2203
|
progress: j(g).activeMediaProgress.value,
|
|
2051
|
-
|
|
2204
|
+
volume: j(g).activeMediaState.value.volume,
|
|
2205
|
+
"volume-control-layout": B.value,
|
|
2206
|
+
onSeekInput: j(g).onMediaSeekInput,
|
|
2207
|
+
onVolumeInput: j(g).onMediaVolumeInput,
|
|
2208
|
+
onVolumeToggle: j(g).onMediaVolumeToggle
|
|
2052
2209
|
}, null, 8, [
|
|
2053
2210
|
"current-time",
|
|
2054
2211
|
"current-time-label",
|
|
2055
2212
|
"duration",
|
|
2056
2213
|
"duration-label",
|
|
2214
|
+
"muted",
|
|
2057
2215
|
"progress",
|
|
2058
|
-
"
|
|
2216
|
+
"volume",
|
|
2217
|
+
"volume-control-layout",
|
|
2218
|
+
"onSeekInput",
|
|
2219
|
+
"onVolumeInput",
|
|
2220
|
+
"onVolumeToggle"
|
|
2059
2221
|
])) : o("", !0),
|
|
2060
2222
|
K.value ? (S(), s("div", {
|
|
2061
2223
|
key: 3,
|
|
@@ -2065,28 +2227,28 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
2065
2227
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
2066
2228
|
class: _(["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", K.value.kind === "end" ? "border-amber-300/35 text-amber-200" : K.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
2067
2229
|
}, k(K.value.message), 3))], 2)) : o("", !0)
|
|
2068
|
-
])) :
|
|
2230
|
+
])) : te.value ? (S(), s("div", In, [c("div", Ln, [c("span", Rn, [u(j(re), {
|
|
2069
2231
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2070
2232
|
"aria-hidden": "true"
|
|
2071
|
-
})]), c("p",
|
|
2233
|
+
})]), c("p", zn, k(H.value), 1)])])) : j(de) && j(Z) ? (S(), a(un, {
|
|
2072
2234
|
key: 2,
|
|
2073
|
-
message: j(
|
|
2074
|
-
mode: j(
|
|
2075
|
-
surface: j(
|
|
2235
|
+
message: j(Z).message,
|
|
2236
|
+
mode: j(Z).mode,
|
|
2237
|
+
surface: j(Z).surface
|
|
2076
2238
|
}, {
|
|
2077
|
-
default: L(() => [j(ue) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(
|
|
2239
|
+
default: L(() => [j(ue) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(Z)))) : o("", !0)]),
|
|
2078
2240
|
_: 3
|
|
2079
2241
|
}, 8, [
|
|
2080
2242
|
"message",
|
|
2081
2243
|
"mode",
|
|
2082
2244
|
"surface"
|
|
2083
|
-
])) : o("", !0), j(le) && j(
|
|
2245
|
+
])) : o("", !0), j(le) && j(Z) ? (S(), a(un, {
|
|
2084
2246
|
key: 3,
|
|
2085
|
-
message: j(
|
|
2086
|
-
mode: j(
|
|
2087
|
-
surface: j(
|
|
2247
|
+
message: j(Z).message,
|
|
2248
|
+
mode: j(Z).mode,
|
|
2249
|
+
surface: j(Z).surface
|
|
2088
2250
|
}, {
|
|
2089
|
-
default: L(() => [j(ue) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(
|
|
2251
|
+
default: L(() => [j(ue) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(Z)))) : o("", !0)]),
|
|
2090
2252
|
_: 3
|
|
2091
2253
|
}, 8, [
|
|
2092
2254
|
"message",
|
|
@@ -2100,7 +2262,7 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
2100
2262
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2101
2263
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2102
2264
|
}, {
|
|
2103
|
-
default: L(() => [ne.value && U.value ? (S(), s("aside",
|
|
2265
|
+
default: L(() => [ne.value && U.value ? (S(), s("aside", Bn, [c("div", Vn, [D(e.$slots, "fullscreen-aside", v(f(U.value)))])])) : o("", !0)]),
|
|
2104
2266
|
_: 3
|
|
2105
2267
|
})], 4),
|
|
2106
2268
|
u(r, {
|
|
@@ -2111,29 +2273,29 @@ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
|
|
|
2111
2273
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2112
2274
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2113
2275
|
}, {
|
|
2114
|
-
default: L(() => [
|
|
2276
|
+
default: L(() => [se.value && U.value ? (S(), s("aside", Hn, [c("div", Un, [D(e.$slots, "fullscreen-aside", v(f(U.value)))])])) : o("", !0)]),
|
|
2115
2277
|
_: 3
|
|
2116
2278
|
})
|
|
2117
2279
|
]));
|
|
2118
2280
|
}
|
|
2119
|
-
}),
|
|
2120
|
-
function
|
|
2281
|
+
}), qn = 1, Jn = .5;
|
|
2282
|
+
function Yn(e) {
|
|
2121
2283
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2122
|
-
width:
|
|
2123
|
-
height:
|
|
2284
|
+
width: qn,
|
|
2285
|
+
height: qn,
|
|
2124
2286
|
source: "fallback"
|
|
2125
2287
|
};
|
|
2126
2288
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2127
|
-
if (
|
|
2128
|
-
let r =
|
|
2289
|
+
if (nr(t) && nr(n)) {
|
|
2290
|
+
let r = rr(e, t, n);
|
|
2129
2291
|
return {
|
|
2130
2292
|
width: r.width,
|
|
2131
2293
|
height: r.height,
|
|
2132
2294
|
source: "preview"
|
|
2133
2295
|
};
|
|
2134
2296
|
}
|
|
2135
|
-
if (
|
|
2136
|
-
let t =
|
|
2297
|
+
if (nr(e.width) && nr(e.height)) {
|
|
2298
|
+
let t = rr(e, e.width, e.height);
|
|
2137
2299
|
return {
|
|
2138
2300
|
width: t.width,
|
|
2139
2301
|
height: t.height,
|
|
@@ -2141,31 +2303,31 @@ function Ln(e) {
|
|
|
2141
2303
|
};
|
|
2142
2304
|
}
|
|
2143
2305
|
return {
|
|
2144
|
-
width:
|
|
2145
|
-
height:
|
|
2306
|
+
width: qn,
|
|
2307
|
+
height: qn,
|
|
2146
2308
|
source: "fallback"
|
|
2147
2309
|
};
|
|
2148
2310
|
}
|
|
2149
|
-
function
|
|
2311
|
+
function Xn(e, t) {
|
|
2150
2312
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2151
2313
|
}
|
|
2152
|
-
function
|
|
2314
|
+
function Zn(e, t, n, r = 0) {
|
|
2153
2315
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2154
2316
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2155
2317
|
return !a || a <= 0 ? n : a / t;
|
|
2156
2318
|
}
|
|
2157
|
-
function
|
|
2158
|
-
let n =
|
|
2319
|
+
function Qn(e, t) {
|
|
2320
|
+
let n = Yn(e);
|
|
2159
2321
|
return n.height / n.width * t;
|
|
2160
2322
|
}
|
|
2161
|
-
function
|
|
2323
|
+
function $n(e, t) {
|
|
2162
2324
|
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;
|
|
2163
2325
|
for (let c = 0; c < e.length; c += 1) {
|
|
2164
2326
|
let l = e[c];
|
|
2165
|
-
o.set(
|
|
2327
|
+
o.set($(l), c);
|
|
2166
2328
|
let u = 0;
|
|
2167
2329
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2168
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
2330
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = Qn(l, t.columnWidth);
|
|
2169
2331
|
r[c] = {
|
|
2170
2332
|
x: d,
|
|
2171
2333
|
y: f
|
|
@@ -2184,7 +2346,7 @@ function Vn(e, t) {
|
|
|
2184
2346
|
indexById: o
|
|
2185
2347
|
};
|
|
2186
2348
|
}
|
|
2187
|
-
function
|
|
2349
|
+
function er(e) {
|
|
2188
2350
|
if (e.itemCount <= 0) return [];
|
|
2189
2351
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2190
2352
|
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();
|
|
@@ -2194,21 +2356,21 @@ function Hn(e) {
|
|
|
2194
2356
|
}
|
|
2195
2357
|
return Array.from(a).sort((e, t) => e - t);
|
|
2196
2358
|
}
|
|
2197
|
-
function
|
|
2359
|
+
function tr(e, t, n) {
|
|
2198
2360
|
let r = /* @__PURE__ */ new Map();
|
|
2199
2361
|
for (let i of e) {
|
|
2200
|
-
let e = t.get(
|
|
2362
|
+
let e = t.get($(i));
|
|
2201
2363
|
if (e == null) continue;
|
|
2202
2364
|
let a = n[e];
|
|
2203
|
-
a && r.set(
|
|
2365
|
+
a && r.set($(i), a);
|
|
2204
2366
|
}
|
|
2205
2367
|
return r;
|
|
2206
2368
|
}
|
|
2207
|
-
function
|
|
2369
|
+
function nr(e) {
|
|
2208
2370
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2209
2371
|
}
|
|
2210
|
-
function
|
|
2211
|
-
return e.type !== "image" || n / t >=
|
|
2372
|
+
function rr(e, t, n) {
|
|
2373
|
+
return e.type !== "image" || n / t >= Jn ? {
|
|
2212
2374
|
width: t,
|
|
2213
2375
|
height: n
|
|
2214
2376
|
} : {
|
|
@@ -2218,46 +2380,46 @@ function Gn(e, t, n) {
|
|
|
2218
2380
|
}
|
|
2219
2381
|
//#endregion
|
|
2220
2382
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2221
|
-
var
|
|
2222
|
-
function
|
|
2383
|
+
var ir = 300, ar = 600, or = 40, sr = 300, cr = 400;
|
|
2384
|
+
function lr(e, t) {
|
|
2223
2385
|
return t === "top" ? [...e].reverse() : e;
|
|
2224
2386
|
}
|
|
2225
|
-
function
|
|
2226
|
-
return e <= 0 ?
|
|
2387
|
+
function ur(e) {
|
|
2388
|
+
return e <= 0 ? ar : ar + Math.min((e - 1) * or, cr);
|
|
2227
2389
|
}
|
|
2228
|
-
function
|
|
2229
|
-
return
|
|
2390
|
+
function dr() {
|
|
2391
|
+
return sr;
|
|
2230
2392
|
}
|
|
2231
|
-
function
|
|
2393
|
+
function fr(e) {
|
|
2232
2394
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2233
2395
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2234
2396
|
}
|
|
2235
|
-
function
|
|
2397
|
+
function pr(e) {
|
|
2236
2398
|
let t = T(/* @__PURE__ */ new Set()), n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), o = T(/* @__PURE__ */ new Map()), s = T(/* @__PURE__ */ new Set()), c = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Map()), u = T(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
|
|
2237
2399
|
F(e.visibleIndices, (i) => {
|
|
2238
2400
|
if (!i.length) return;
|
|
2239
2401
|
let o = [];
|
|
2240
2402
|
for (let n of i) {
|
|
2241
|
-
let r = e.items.value[n] ?
|
|
2403
|
+
let r = e.items.value[n] ? $(e.items.value[n]) : null;
|
|
2242
2404
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2243
2405
|
}
|
|
2244
2406
|
if (!o.length) return;
|
|
2245
|
-
let s =
|
|
2246
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2247
|
-
r.value = c,
|
|
2407
|
+
let s = lr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
2408
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * or, cr));
|
|
2409
|
+
r.value = c, mr(() => {
|
|
2248
2410
|
let e = new Set(n.value);
|
|
2249
2411
|
for (let t of o) e.add(t);
|
|
2250
2412
|
n.value = e;
|
|
2251
|
-
}),
|
|
2413
|
+
}), hr(() => {
|
|
2252
2414
|
let e = new Set(t.value);
|
|
2253
2415
|
for (let t of o) e.delete(t);
|
|
2254
2416
|
t.value = e, S(() => {
|
|
2255
2417
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2256
2418
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2257
2419
|
n.value = e, r.value = t, a.value = i;
|
|
2258
|
-
},
|
|
2420
|
+
}, ur(o.length));
|
|
2259
2421
|
});
|
|
2260
|
-
}, { flush: "post" }), F(() => e.items.value.map((e) =>
|
|
2422
|
+
}, { flush: "post" }), F(() => e.items.value.map((e) => $(e)), (e) => {
|
|
2261
2423
|
if (!e.length || !o.value.size) return;
|
|
2262
2424
|
let t = new Set(e), n = null, r = null;
|
|
2263
2425
|
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));
|
|
@@ -2270,7 +2432,7 @@ function tr(e) {
|
|
|
2270
2432
|
if (!e.length) return;
|
|
2271
2433
|
let r = new Set(t.value), i = new Map(a.value);
|
|
2272
2434
|
for (let t of e) {
|
|
2273
|
-
let e =
|
|
2435
|
+
let e = $(t);
|
|
2274
2436
|
r.add(e), i.set(e, n);
|
|
2275
2437
|
}
|
|
2276
2438
|
t.value = r, a.value = i;
|
|
@@ -2279,10 +2441,10 @@ function tr(e) {
|
|
|
2279
2441
|
if (!e.length) return;
|
|
2280
2442
|
let i = new Map(o.value), c = new Set(t.value), l = new Set(n.value), u = new Map(r.value), f = new Map(a.value), p = [];
|
|
2281
2443
|
for (let t of e) {
|
|
2282
|
-
let e =
|
|
2444
|
+
let e = $(t.item);
|
|
2283
2445
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2284
2446
|
}
|
|
2285
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
2447
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, mr(() => {
|
|
2286
2448
|
let e = new Set(s.value);
|
|
2287
2449
|
for (let t of p) e.add(t);
|
|
2288
2450
|
s.value = e;
|
|
@@ -2290,9 +2452,9 @@ function tr(e) {
|
|
|
2290
2452
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2291
2453
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2292
2454
|
o.value = e, s.value = t;
|
|
2293
|
-
},
|
|
2455
|
+
}, sr);
|
|
2294
2456
|
}
|
|
2295
|
-
function g(t, n, r =
|
|
2457
|
+
function g(t, n, r = ir) {
|
|
2296
2458
|
if (!t.size) return;
|
|
2297
2459
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2298
2460
|
for (let [r, o] of t.entries()) {
|
|
@@ -2311,8 +2473,8 @@ function tr(e) {
|
|
|
2311
2473
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2312
2474
|
let o = new Map(l.value);
|
|
2313
2475
|
for (let e of a) o.set(e, r);
|
|
2314
|
-
l.value = o,
|
|
2315
|
-
u.value = new Set(a),
|
|
2476
|
+
l.value = o, mr(() => {
|
|
2477
|
+
u.value = new Set(a), mr(() => {
|
|
2316
2478
|
c.value = /* @__PURE__ */ new Map();
|
|
2317
2479
|
});
|
|
2318
2480
|
}), S(() => {
|
|
@@ -2323,8 +2485,8 @@ function tr(e) {
|
|
|
2323
2485
|
}, r);
|
|
2324
2486
|
}
|
|
2325
2487
|
function _(e) {
|
|
2326
|
-
if (n.value.has(e)) return `transform ${
|
|
2327
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
2488
|
+
if (n.value.has(e)) return `transform ${ar}ms ease-out`;
|
|
2489
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? ir}ms ease-out`;
|
|
2328
2490
|
}
|
|
2329
2491
|
function v(e) {
|
|
2330
2492
|
if (!n.value.has(e)) return;
|
|
@@ -2335,13 +2497,13 @@ function tr(e) {
|
|
|
2335
2497
|
let r = e.items.value[n], i = e.positions.value[n] ?? {
|
|
2336
2498
|
x: 0,
|
|
2337
2499
|
y: 0
|
|
2338
|
-
}, o = e.heights.value[n] ?? e.columnWidth.value, s = r ?
|
|
2500
|
+
}, o = e.heights.value[n] ?? e.columnWidth.value, s = r ? $(r) : null, l = s ? c.value.get(s) ?? {
|
|
2339
2501
|
dx: 0,
|
|
2340
2502
|
dy: 0
|
|
2341
2503
|
} : {
|
|
2342
2504
|
dx: 0,
|
|
2343
2505
|
dy: 0
|
|
2344
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
2506
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? fr({
|
|
2345
2507
|
columnWidth: e.columnWidth.value,
|
|
2346
2508
|
direction: u,
|
|
2347
2509
|
itemHeight: o,
|
|
@@ -2351,18 +2513,18 @@ function tr(e) {
|
|
|
2351
2513
|
return `translate3d(${i.x + l.dx}px, ${d + l.dy}px, 0)`;
|
|
2352
2514
|
}
|
|
2353
2515
|
function x(t) {
|
|
2354
|
-
let n =
|
|
2516
|
+
let n = $(t), r = o.value.get(n);
|
|
2355
2517
|
if (!r) return {
|
|
2356
2518
|
opacity: "0",
|
|
2357
2519
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2358
|
-
transition: `opacity ${
|
|
2520
|
+
transition: `opacity ${sr}ms ease-out, transform ${sr}ms ease-out`
|
|
2359
2521
|
};
|
|
2360
2522
|
let i = s.value.has(n);
|
|
2361
2523
|
return {
|
|
2362
2524
|
height: `${r.height}px`,
|
|
2363
2525
|
opacity: i ? "0" : "1",
|
|
2364
2526
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
2365
|
-
transition: `opacity ${
|
|
2527
|
+
transition: `opacity ${sr}ms ease-out, transform ${sr}ms ease-out`,
|
|
2366
2528
|
width: `${e.columnWidth.value}px`
|
|
2367
2529
|
};
|
|
2368
2530
|
}
|
|
@@ -2383,28 +2545,28 @@ function tr(e) {
|
|
|
2383
2545
|
playFlipMoveAnimation: g
|
|
2384
2546
|
};
|
|
2385
2547
|
}
|
|
2386
|
-
function
|
|
2548
|
+
function mr(e) {
|
|
2387
2549
|
if (typeof requestAnimationFrame == "function") {
|
|
2388
2550
|
requestAnimationFrame(() => e());
|
|
2389
2551
|
return;
|
|
2390
2552
|
}
|
|
2391
2553
|
setTimeout(e, 0);
|
|
2392
2554
|
}
|
|
2393
|
-
function
|
|
2394
|
-
|
|
2555
|
+
function hr(e) {
|
|
2556
|
+
mr(() => mr(e));
|
|
2395
2557
|
}
|
|
2396
2558
|
//#endregion
|
|
2397
2559
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
2398
|
-
function
|
|
2560
|
+
function gr(e, t) {
|
|
2399
2561
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
2400
2562
|
}
|
|
2401
|
-
function
|
|
2563
|
+
function _r(e, t, n) {
|
|
2402
2564
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
2403
2565
|
}
|
|
2404
|
-
function
|
|
2566
|
+
function vr(e, t, n, r) {
|
|
2405
2567
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
2406
2568
|
}
|
|
2407
|
-
function
|
|
2569
|
+
function yr(e, t) {
|
|
2408
2570
|
return {
|
|
2409
2571
|
height: `${e}px`,
|
|
2410
2572
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -2412,8 +2574,8 @@ function sr(e, t) {
|
|
|
2412
2574
|
}
|
|
2413
2575
|
//#endregion
|
|
2414
2576
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
2415
|
-
var
|
|
2416
|
-
function
|
|
2577
|
+
var br = 250, xr = 1e3;
|
|
2578
|
+
function Sr(e) {
|
|
2417
2579
|
let t = T(!1), n = T(!1), r = T(0), i = T(0), a = T(!1), o = T(!1), s = 0, c = null;
|
|
2418
2580
|
b(() => {
|
|
2419
2581
|
y();
|
|
@@ -2429,7 +2591,7 @@ function ur(e) {
|
|
|
2429
2591
|
function u(t) {
|
|
2430
2592
|
if (!x(t) || !e.isAtBoundary()) return;
|
|
2431
2593
|
let n = Date.now();
|
|
2432
|
-
n < s || (s = n +
|
|
2594
|
+
n < s || (s = n + br, m());
|
|
2433
2595
|
}
|
|
2434
2596
|
function d() {
|
|
2435
2597
|
if (!g()) return;
|
|
@@ -2463,7 +2625,7 @@ function ur(e) {
|
|
|
2463
2625
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
2464
2626
|
}
|
|
2465
2627
|
function _() {
|
|
2466
|
-
o.value = !1, v(
|
|
2628
|
+
o.value = !1, v(xr);
|
|
2467
2629
|
}
|
|
2468
2630
|
function v(e) {
|
|
2469
2631
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -2486,30 +2648,30 @@ function ur(e) {
|
|
|
2486
2648
|
}
|
|
2487
2649
|
//#endregion
|
|
2488
2650
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
2489
|
-
var
|
|
2490
|
-
function
|
|
2491
|
-
let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth ||
|
|
2651
|
+
var Cr = 600, wr = 24, Tr = 16, Er = 300, Dr = 200, Or = 200, kr = 200, Ar = 300, jr = 24, Mr = 48, Nr = 500, Pr = 1e3;
|
|
2652
|
+
function Fr(e) {
|
|
2653
|
+
let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || Er), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = T(null), p = T(!1), m = i(() => Math.max(Er, a.value - wr * 2)), h = i(() => Xn(m.value, Er)), _ = i(() => Zn(m.value, h.value, Er, Tr)), v = i(() => Ir(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => er({
|
|
2492
2654
|
itemCount: e.items.value.length,
|
|
2493
2655
|
viewportHeight: r.value,
|
|
2494
2656
|
scrollTop: n.value,
|
|
2495
|
-
overscanPx:
|
|
2496
|
-
bucketPx:
|
|
2657
|
+
overscanPx: Dr,
|
|
2658
|
+
bucketPx: Cr,
|
|
2497
2659
|
buckets: c.value
|
|
2498
2660
|
})), S = i(() => y.value.map((t) => ({
|
|
2499
2661
|
item: e.items.value[t],
|
|
2500
2662
|
index: t
|
|
2501
2663
|
}))), C = i(() => {
|
|
2502
|
-
let e = l.value +
|
|
2503
|
-
return Math.max(e, t, r.value) +
|
|
2504
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), D = i(() => Math.max(0, r.value -
|
|
2664
|
+
let e = l.value + wr * 2, t = d.value ?? 0;
|
|
2665
|
+
return Math.max(e, t, r.value) + kr;
|
|
2666
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), D = i(() => Math.max(0, r.value - jr * 2)), O = i(() => C.value > r.value + 1 && D.value > 0), k = i(() => {
|
|
2505
2667
|
if (!O.value) return 0;
|
|
2506
2668
|
let e = r.value / C.value * D.value;
|
|
2507
|
-
return Math.min(D.value, Math.max(
|
|
2669
|
+
return Math.min(D.value, Math.max(Mr, e));
|
|
2508
2670
|
}), A = i(() => {
|
|
2509
|
-
if (!O.value) return
|
|
2671
|
+
if (!O.value) return jr;
|
|
2510
2672
|
let e = Math.max(0, C.value - r.value);
|
|
2511
|
-
return
|
|
2512
|
-
}), j =
|
|
2673
|
+
return jr + Math.max(0, D.value - k.value) * (e > 0 ? Ir(n.value / e, 0, 1) : 0);
|
|
2674
|
+
}), j = pr({
|
|
2513
2675
|
items: e.items,
|
|
2514
2676
|
visibleIndices: y,
|
|
2515
2677
|
positions: o,
|
|
@@ -2518,27 +2680,27 @@ function Sr(e) {
|
|
|
2518
2680
|
columnWidth: _,
|
|
2519
2681
|
scrollTop: n,
|
|
2520
2682
|
viewportHeight: r
|
|
2521
|
-
}), M =
|
|
2683
|
+
}), M = Sr({
|
|
2522
2684
|
direction: "top",
|
|
2523
2685
|
getAnimationLockMs(e) {
|
|
2524
|
-
return Math.max(
|
|
2686
|
+
return Math.max(Nr, ur(e)) + Pr;
|
|
2525
2687
|
},
|
|
2526
2688
|
hasPage: e.hasPreviousPage,
|
|
2527
2689
|
interactionLocked: p,
|
|
2528
2690
|
isAtBoundary() {
|
|
2529
|
-
return n.value <=
|
|
2691
|
+
return n.value <= wr + Tr;
|
|
2530
2692
|
},
|
|
2531
2693
|
loading: e.loading,
|
|
2532
2694
|
requestPage: e.requestPreviousPage
|
|
2533
|
-
}), N =
|
|
2695
|
+
}), N = Sr({
|
|
2534
2696
|
direction: "bottom",
|
|
2535
2697
|
getAnimationLockMs(e) {
|
|
2536
|
-
return
|
|
2698
|
+
return ur(e) + Pr;
|
|
2537
2699
|
},
|
|
2538
2700
|
hasPage: w,
|
|
2539
2701
|
interactionLocked: p,
|
|
2540
2702
|
isAtBoundary() {
|
|
2541
|
-
return
|
|
2703
|
+
return re() <= Or;
|
|
2542
2704
|
},
|
|
2543
2705
|
loading: e.loading,
|
|
2544
2706
|
requestPage: e.requestNextPage
|
|
@@ -2548,8 +2710,8 @@ function Sr(e) {
|
|
|
2548
2710
|
h,
|
|
2549
2711
|
_
|
|
2550
2712
|
], async ([t], [r = []]) => {
|
|
2551
|
-
let i = t.map((e) =>
|
|
2552
|
-
let t =
|
|
2713
|
+
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = tr(a, u.value, o.value), l = oe(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
|
|
2714
|
+
let t = $(e);
|
|
2553
2715
|
if (f.has(t)) return [];
|
|
2554
2716
|
let n = c.get(t), r = l.get(t);
|
|
2555
2717
|
return !n || r == null ? [] : [{
|
|
@@ -2557,15 +2719,15 @@ function Sr(e) {
|
|
|
2557
2719
|
item: e,
|
|
2558
2720
|
position: n
|
|
2559
2721
|
}];
|
|
2560
|
-
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value >
|
|
2561
|
-
y &&
|
|
2722
|
+
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > wr + Tr, b = h && n.value > wr + Tr ? t[v.value] : null, x = b ? $(b) : null;
|
|
2723
|
+
y && G(dr() + Pr), _ && W(), ee(), m.length > 0 && j.markLeave(m), p.length > 0 && (j.markEnter(p, h ? "top" : "bottom"), h ? M.onItemsMutated(p.length) : N.onItemsMutated(p.length)), j.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? Nr : void 0), x ? (await g(), U(x, c)) : e.active.value && s.length > 0 && q();
|
|
2562
2724
|
}, { immediate: !0 }), F([
|
|
2563
|
-
() => e.pendingAppendItems.value.map((e) =>
|
|
2725
|
+
() => e.pendingAppendItems.value.map((e) => $(e)),
|
|
2564
2726
|
h,
|
|
2565
2727
|
_,
|
|
2566
2728
|
r
|
|
2567
2729
|
], ([t]) => {
|
|
2568
|
-
|
|
2730
|
+
ce(), t.length && (d.value = ae([...e.items.value, ...e.pendingAppendItems.value]), se());
|
|
2569
2731
|
}, { immediate: !0 }), F(() => e.active.value, async (e, i) => {
|
|
2570
2732
|
let a = t.value;
|
|
2571
2733
|
if (!a) return;
|
|
@@ -2575,40 +2737,40 @@ function Sr(e) {
|
|
|
2575
2737
|
}
|
|
2576
2738
|
if (i !== !1 || f.value == null) return;
|
|
2577
2739
|
await g();
|
|
2578
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
2740
|
+
let o = Math.max(0, C.value - r.value), s = Ir(f.value, 0, o);
|
|
2579
2741
|
a.scrollTop = s, n.value = s, M.syncBoundary(), N.syncBoundary();
|
|
2580
2742
|
}), F(() => e.loading.value, async (t) => {
|
|
2581
2743
|
!t && !e.pendingAppendItems.value.length && !L && !z && (d.value = null), M.onLoadingChange(t), N.onLoadingChange(t), await g();
|
|
2582
2744
|
}), x(async () => {
|
|
2583
|
-
Y(), await g(), v.value > 0 ?
|
|
2745
|
+
Y(), await g(), v.value > 0 ? H(v.value, "center") : K(), M.syncBoundary(), N.syncBoundary(), typeof ResizeObserver < "u" ? (P = new ResizeObserver(() => {
|
|
2584
2746
|
Y();
|
|
2585
2747
|
}), t.value && P.observe(t.value)) : window.addEventListener("resize", Y);
|
|
2586
2748
|
}), b(() => {
|
|
2587
|
-
P?.disconnect(), P = null, window.removeEventListener("resize", Y),
|
|
2749
|
+
P?.disconnect(), P = null, window.removeEventListener("resize", Y), ce(), Z(), I &&= (cancelAnimationFrame(I), 0);
|
|
2588
2750
|
});
|
|
2589
|
-
function
|
|
2590
|
-
let t =
|
|
2751
|
+
function ee() {
|
|
2752
|
+
let t = $n(e.items.value, {
|
|
2591
2753
|
columnCount: h.value,
|
|
2592
2754
|
columnWidth: _.value,
|
|
2593
|
-
gapX:
|
|
2594
|
-
gapY:
|
|
2595
|
-
bucketPx:
|
|
2755
|
+
gapX: Tr,
|
|
2756
|
+
gapY: Tr,
|
|
2757
|
+
bucketPx: Cr
|
|
2596
2758
|
});
|
|
2597
2759
|
o.value = t.positions.map((e) => ({
|
|
2598
|
-
x: e.x +
|
|
2599
|
-
y: e.y +
|
|
2760
|
+
x: e.x + wr,
|
|
2761
|
+
y: e.y + wr
|
|
2600
2762
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
2601
2763
|
}
|
|
2602
|
-
function
|
|
2603
|
-
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value =
|
|
2604
|
-
I = 0,
|
|
2764
|
+
function B() {
|
|
2765
|
+
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = X(), M.syncBoundary(), N.syncBoundary(), J(), !q() && (I ||= requestAnimationFrame(() => {
|
|
2766
|
+
I = 0, K();
|
|
2605
2767
|
})));
|
|
2606
2768
|
}
|
|
2607
|
-
function
|
|
2608
|
-
e.active.value && (M.onWheel(t), N.onWheel(t),
|
|
2769
|
+
function V(t) {
|
|
2770
|
+
e.active.value && (M.onWheel(t), N.onWheel(t), J());
|
|
2609
2771
|
}
|
|
2610
|
-
function
|
|
2611
|
-
let n = e.items.value[t], r = n ?
|
|
2772
|
+
function te(t) {
|
|
2773
|
+
let n = e.items.value[t], r = n ? $(n) : "";
|
|
2612
2774
|
return {
|
|
2613
2775
|
height: `${s.value[t] ?? _.value}px`,
|
|
2614
2776
|
width: `${_.value}px`,
|
|
@@ -2617,19 +2779,19 @@ function Sr(e) {
|
|
|
2617
2779
|
transform: j.getCardTransform(t)
|
|
2618
2780
|
};
|
|
2619
2781
|
}
|
|
2620
|
-
function
|
|
2782
|
+
function H(e, i) {
|
|
2621
2783
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
2622
2784
|
if (!a || !c || !l) return;
|
|
2623
2785
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
2624
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
2786
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - wr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + wr), a.scrollTop = Ir(u, 0, d), n.value = a.scrollTop, K();
|
|
2625
2787
|
}
|
|
2626
|
-
function
|
|
2788
|
+
function U(e, r) {
|
|
2627
2789
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
2628
2790
|
if (!i || !a || !c) return;
|
|
2629
2791
|
let l = c.y - a.y;
|
|
2630
2792
|
i.scrollTop += l, n.value = i.scrollTop;
|
|
2631
2793
|
}
|
|
2632
|
-
function
|
|
2794
|
+
function W() {
|
|
2633
2795
|
let e = t.value;
|
|
2634
2796
|
if (!e) {
|
|
2635
2797
|
n.value = 0;
|
|
@@ -2637,13 +2799,13 @@ function Sr(e) {
|
|
|
2637
2799
|
}
|
|
2638
2800
|
e.scrollTop = 0, n.value = 0, M.syncBoundary(), N.syncBoundary();
|
|
2639
2801
|
}
|
|
2640
|
-
function
|
|
2641
|
-
|
|
2802
|
+
function G(e) {
|
|
2803
|
+
Z(), p.value = !0, R = setTimeout(() => {
|
|
2642
2804
|
R = null, p.value = !1;
|
|
2643
2805
|
}, Math.max(0, e));
|
|
2644
2806
|
}
|
|
2645
|
-
function
|
|
2646
|
-
if (!y.value.length ||
|
|
2807
|
+
function K() {
|
|
2808
|
+
if (!y.value.length || q()) return;
|
|
2647
2809
|
let t = n.value + r.value / 2, i = v.value, a = Infinity;
|
|
2648
2810
|
for (let e of y.value) {
|
|
2649
2811
|
let n = o.value[e], r = s.value[e];
|
|
@@ -2653,48 +2815,48 @@ function Sr(e) {
|
|
|
2653
2815
|
}
|
|
2654
2816
|
e.setActiveIndex(i);
|
|
2655
2817
|
}
|
|
2656
|
-
function
|
|
2657
|
-
let t = n.value <=
|
|
2818
|
+
function q() {
|
|
2819
|
+
let t = n.value <= wr + Tr, r = re() <= Or;
|
|
2658
2820
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
2659
2821
|
}
|
|
2660
|
-
function
|
|
2822
|
+
function J() {
|
|
2661
2823
|
M.maybeRequestPage(), N.maybeRequestPage();
|
|
2662
2824
|
}
|
|
2663
2825
|
function Y() {
|
|
2664
|
-
r.value =
|
|
2826
|
+
r.value = X(), a.value = ne();
|
|
2827
|
+
}
|
|
2828
|
+
function X() {
|
|
2829
|
+
return gr(t.value, r.value);
|
|
2665
2830
|
}
|
|
2666
2831
|
function ne() {
|
|
2667
|
-
return
|
|
2832
|
+
return _r(t.value, a.value, Er);
|
|
2668
2833
|
}
|
|
2669
2834
|
function re() {
|
|
2670
|
-
return
|
|
2835
|
+
return vr(t.value, n.value, r.value, C.value);
|
|
2671
2836
|
}
|
|
2672
2837
|
function ie() {
|
|
2673
|
-
return
|
|
2674
|
-
}
|
|
2675
|
-
function ae() {
|
|
2676
|
-
return sr(k.value, A.value);
|
|
2838
|
+
return yr(k.value, A.value);
|
|
2677
2839
|
}
|
|
2678
|
-
function
|
|
2679
|
-
return e.length ?
|
|
2840
|
+
function ae(e) {
|
|
2841
|
+
return e.length ? $n(e, {
|
|
2680
2842
|
columnCount: h.value,
|
|
2681
2843
|
columnWidth: _.value,
|
|
2682
|
-
gapX:
|
|
2683
|
-
gapY:
|
|
2684
|
-
bucketPx:
|
|
2685
|
-
}).contentHeight +
|
|
2844
|
+
gapX: Tr,
|
|
2845
|
+
gapY: Tr,
|
|
2846
|
+
bucketPx: Cr
|
|
2847
|
+
}).contentHeight + wr * 2 : 0;
|
|
2686
2848
|
}
|
|
2687
|
-
function
|
|
2849
|
+
function oe(e) {
|
|
2688
2850
|
let t = /* @__PURE__ */ new Map();
|
|
2689
2851
|
for (let n of e) {
|
|
2690
|
-
let e =
|
|
2852
|
+
let e = $(n), r = u.value.get(e);
|
|
2691
2853
|
if (r == null) continue;
|
|
2692
2854
|
let i = s.value[r];
|
|
2693
2855
|
i != null && t.set(e, i);
|
|
2694
2856
|
}
|
|
2695
2857
|
return t;
|
|
2696
2858
|
}
|
|
2697
|
-
function
|
|
2859
|
+
function se() {
|
|
2698
2860
|
let t = e.commitPendingAppend.value;
|
|
2699
2861
|
typeof t == "function" && (L = setTimeout(async () => {
|
|
2700
2862
|
L = null, z = !0;
|
|
@@ -2704,42 +2866,42 @@ function Sr(e) {
|
|
|
2704
2866
|
} finally {
|
|
2705
2867
|
d.value = null, z = !1;
|
|
2706
2868
|
}
|
|
2707
|
-
},
|
|
2869
|
+
}, Ar));
|
|
2708
2870
|
}
|
|
2709
|
-
function
|
|
2871
|
+
function ce() {
|
|
2710
2872
|
L &&= (clearTimeout(L), null);
|
|
2711
2873
|
}
|
|
2712
|
-
function
|
|
2874
|
+
function Z() {
|
|
2713
2875
|
R && (clearTimeout(R), R = null, p.value = !1);
|
|
2714
2876
|
}
|
|
2715
2877
|
return {
|
|
2716
2878
|
columnWidth: _,
|
|
2717
2879
|
containerHeight: C,
|
|
2718
|
-
getCardStyle:
|
|
2880
|
+
getCardStyle: te,
|
|
2719
2881
|
getLeavingCardStyle: j.getLeavingCardStyle,
|
|
2720
|
-
getScrollbarThumbStyle:
|
|
2882
|
+
getScrollbarThumbStyle: ie,
|
|
2721
2883
|
leavingItems: j.leavingItems,
|
|
2722
|
-
onScroll:
|
|
2723
|
-
onWheel:
|
|
2884
|
+
onScroll: B,
|
|
2885
|
+
onWheel: V,
|
|
2724
2886
|
paginationLabel: E,
|
|
2725
2887
|
renderedItems: S,
|
|
2726
2888
|
resolvedActiveIndex: v,
|
|
2727
|
-
scrollToIndex:
|
|
2889
|
+
scrollToIndex: H,
|
|
2728
2890
|
showScrollbar: O,
|
|
2729
2891
|
scrollViewportRef: t
|
|
2730
2892
|
};
|
|
2731
2893
|
}
|
|
2732
|
-
function
|
|
2894
|
+
function Ir(e, t, n) {
|
|
2733
2895
|
return Math.min(Math.max(e, t), n);
|
|
2734
2896
|
}
|
|
2735
2897
|
//#endregion
|
|
2736
2898
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
2737
|
-
function
|
|
2899
|
+
function Lr(e) {
|
|
2738
2900
|
if (e) try {
|
|
2739
2901
|
e.removeAttribute("src"), e.src = "";
|
|
2740
2902
|
} catch {}
|
|
2741
2903
|
}
|
|
2742
|
-
function
|
|
2904
|
+
function Rr(e) {
|
|
2743
2905
|
if (e) {
|
|
2744
2906
|
try {
|
|
2745
2907
|
e.currentTime = 0;
|
|
@@ -2750,12 +2912,12 @@ function Tr(e) {
|
|
|
2750
2912
|
} catch {}
|
|
2751
2913
|
}
|
|
2752
2914
|
}
|
|
2753
|
-
function
|
|
2915
|
+
function zr(e, t) {
|
|
2754
2916
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
2755
2917
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
2756
2918
|
return e.bottom > 0 && e.top < n;
|
|
2757
2919
|
}
|
|
2758
|
-
function
|
|
2920
|
+
function Br(e) {
|
|
2759
2921
|
if (!e) return null;
|
|
2760
2922
|
try {
|
|
2761
2923
|
return new URL(e, window.location.href).href;
|
|
@@ -2765,22 +2927,22 @@ function Dr(e) {
|
|
|
2765
2927
|
}
|
|
2766
2928
|
//#endregion
|
|
2767
2929
|
//#region src/components/viewer-core/listPreview.ts
|
|
2768
|
-
var
|
|
2769
|
-
function
|
|
2770
|
-
let t = e.preview?.url ?? e.url, n =
|
|
2930
|
+
var Vr = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, Hr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
|
|
2931
|
+
function Ur(e) {
|
|
2932
|
+
let t = e.preview?.url ?? e.url, n = Yn(e), r = e.title?.trim() || Ct(e.type);
|
|
2771
2933
|
return e.type !== "image" && e.type !== "video" ? {
|
|
2772
2934
|
kind: "fallback",
|
|
2773
2935
|
url: null,
|
|
2774
2936
|
width: n.width,
|
|
2775
2937
|
height: n.height,
|
|
2776
2938
|
label: r
|
|
2777
|
-
} :
|
|
2939
|
+
} : Gr(e, t) ? {
|
|
2778
2940
|
kind: "video",
|
|
2779
2941
|
url: t,
|
|
2780
2942
|
width: n.width,
|
|
2781
2943
|
height: n.height,
|
|
2782
2944
|
label: r
|
|
2783
|
-
} :
|
|
2945
|
+
} : Wr(e, t) ? {
|
|
2784
2946
|
kind: "image",
|
|
2785
2947
|
url: t,
|
|
2786
2948
|
width: n.width,
|
|
@@ -2794,28 +2956,28 @@ function Ar(e) {
|
|
|
2794
2956
|
label: r
|
|
2795
2957
|
};
|
|
2796
2958
|
}
|
|
2797
|
-
function
|
|
2798
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
2959
|
+
function Wr(e, t) {
|
|
2960
|
+
return e.type !== "image" || typeof t != "string" ? !1 : Vr.test(t) || Kr(t);
|
|
2799
2961
|
}
|
|
2800
|
-
function
|
|
2801
|
-
return e.type === "video" && typeof t == "string" &&
|
|
2962
|
+
function Gr(e, t) {
|
|
2963
|
+
return e.type === "video" && typeof t == "string" && Hr.test(t);
|
|
2802
2964
|
}
|
|
2803
|
-
function
|
|
2965
|
+
function Kr(e) {
|
|
2804
2966
|
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
2805
2967
|
}
|
|
2806
2968
|
//#endregion
|
|
2807
2969
|
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
2808
|
-
var
|
|
2970
|
+
var qr = {
|
|
2809
2971
|
maxGlobal: 10,
|
|
2810
2972
|
maxPerDomain: 4,
|
|
2811
2973
|
maxVideoPerDomain: 2
|
|
2812
2974
|
};
|
|
2813
|
-
function
|
|
2975
|
+
function Jr(e = qr) {
|
|
2814
2976
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
|
|
2815
2977
|
function i(e) {
|
|
2816
2978
|
let i = {
|
|
2817
2979
|
...e,
|
|
2818
|
-
domain:
|
|
2980
|
+
domain: Zr(e.url),
|
|
2819
2981
|
enqueuedAt: r,
|
|
2820
2982
|
id: `vibe-asset-load-${r += 1}`
|
|
2821
2983
|
};
|
|
@@ -2834,7 +2996,7 @@ function Fr(e = Pr) {
|
|
|
2834
2996
|
function a() {
|
|
2835
2997
|
if (n.size === 0) return;
|
|
2836
2998
|
let r = [...n.values()].sort((e, t) => {
|
|
2837
|
-
let n =
|
|
2999
|
+
let n = Xr(e) - Xr(t);
|
|
2838
3000
|
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
2839
3001
|
});
|
|
2840
3002
|
for (let i of r) {
|
|
@@ -2855,8 +3017,8 @@ function Fr(e = Pr) {
|
|
|
2855
3017
|
}
|
|
2856
3018
|
return { request: i };
|
|
2857
3019
|
}
|
|
2858
|
-
var
|
|
2859
|
-
function
|
|
3020
|
+
var Yr = Jr();
|
|
3021
|
+
function Xr(e) {
|
|
2860
3022
|
try {
|
|
2861
3023
|
let t = e.getPriority();
|
|
2862
3024
|
return Number.isFinite(t) ? t : Infinity;
|
|
@@ -2864,7 +3026,7 @@ function Lr(e) {
|
|
|
2864
3026
|
return Infinity;
|
|
2865
3027
|
}
|
|
2866
3028
|
}
|
|
2867
|
-
function
|
|
3029
|
+
function Zr(e) {
|
|
2868
3030
|
try {
|
|
2869
3031
|
return new URL(e).hostname || "local";
|
|
2870
3032
|
} catch {
|
|
@@ -2873,14 +3035,14 @@ function Rr(e) {
|
|
|
2873
3035
|
}
|
|
2874
3036
|
//#endregion
|
|
2875
3037
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
2876
|
-
var
|
|
3038
|
+
var Qr = ["aria-label"], $r = {
|
|
2877
3039
|
key: 0,
|
|
2878
3040
|
"data-testid": "vibe-list-card-spinner",
|
|
2879
3041
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
2880
|
-
},
|
|
3042
|
+
}, ei = { 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]" }, ti = ["src", "alt"], ni = ["src"], ri = ["data-kind"], ii = { class: "grid justify-items-center gap-3 px-4 text-center" }, ai = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, oi = {
|
|
2881
3043
|
key: 4,
|
|
2882
3044
|
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))]"
|
|
2883
|
-
},
|
|
3045
|
+
}, 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]" }, li = /* @__PURE__ */ d({
|
|
2884
3046
|
__name: "ListCard",
|
|
2885
3047
|
props: {
|
|
2886
3048
|
active: {
|
|
@@ -2904,16 +3066,16 @@ var zr = ["aria-label"], Br = {
|
|
|
2904
3066
|
},
|
|
2905
3067
|
emits: ["open"],
|
|
2906
3068
|
setup(e, { emit: t }) {
|
|
2907
|
-
let n = e, r = t, l = i(() =>
|
|
2908
|
-
F([
|
|
3069
|
+
let n = e, r = t, l = i(() => Ur(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(!1), g = T(null), v = T(null), y = T(null), C = T(null), w = T(null), E = T(l.value.kind === "fallback"), A = i(() => E.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), M = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), N = i(() => l.value.kind === "image" && !!A.value), P = i(() => l.value.kind === "video" && !!A.value), I = i(() => !!g.value), L = i(() => Ht(g.value)), R = i(() => M.value && !g.value && (!E.value || !m.value)), ee = null, B = null, V = /* @__PURE__ */ new Set();
|
|
3070
|
+
F([A, () => l.value.kind], () => {
|
|
2909
3071
|
let e = l.value.kind === "fallback";
|
|
2910
|
-
m.value = e, h.value = null, e && (
|
|
2911
|
-
}), F(
|
|
3072
|
+
m.value = e, h.value = !1, g.value = null, e && (E.value = !0);
|
|
3073
|
+
}), F(M, () => {
|
|
2912
3074
|
G();
|
|
2913
3075
|
}), F([
|
|
2914
3076
|
d,
|
|
2915
3077
|
m,
|
|
2916
|
-
|
|
3078
|
+
A
|
|
2917
3079
|
], () => {
|
|
2918
3080
|
K();
|
|
2919
3081
|
}), F(() => n.surfaceActive, (e) => {
|
|
@@ -2922,43 +3084,43 @@ var zr = ["aria-label"], Br = {
|
|
|
2922
3084
|
return;
|
|
2923
3085
|
}
|
|
2924
3086
|
requestAnimationFrame(() => {
|
|
2925
|
-
|
|
3087
|
+
Y(), G(), K();
|
|
2926
3088
|
});
|
|
2927
3089
|
}), x(() => {
|
|
2928
|
-
if (!
|
|
2929
|
-
|
|
3090
|
+
if (!y.value || typeof IntersectionObserver > "u") {
|
|
3091
|
+
C.value = null, d.value = !0, G();
|
|
2930
3092
|
return;
|
|
2931
3093
|
}
|
|
2932
|
-
|
|
2933
|
-
for (let t of e) t.target ===
|
|
3094
|
+
C.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"), ee = new IntersectionObserver((e) => {
|
|
3095
|
+
for (let t of e) t.target === y.value && (n.surfaceActive && Y(t), G(), K());
|
|
2934
3096
|
}, {
|
|
2935
|
-
root:
|
|
3097
|
+
root: C.value,
|
|
2936
3098
|
threshold: [0, 1]
|
|
2937
|
-
}),
|
|
3099
|
+
}), ee.observe(y.value);
|
|
2938
3100
|
}), b(() => {
|
|
2939
|
-
q(),
|
|
3101
|
+
q(), ee?.disconnect(), ee = null;
|
|
2940
3102
|
});
|
|
2941
|
-
function
|
|
2942
|
-
ce(
|
|
2943
|
-
}
|
|
2944
|
-
async function
|
|
2945
|
-
if (!ce(
|
|
2946
|
-
let e =
|
|
2947
|
-
m.value = !1,
|
|
2948
|
-
let t = await
|
|
2949
|
-
|
|
3103
|
+
function te() {
|
|
3104
|
+
ce(v.value) && (m.value = !0, g.value = null, X(A.value ?? n.item.url), J());
|
|
3105
|
+
}
|
|
3106
|
+
async function H() {
|
|
3107
|
+
if (!ce(v.value)) return;
|
|
3108
|
+
let e = A.value ?? n.item.url;
|
|
3109
|
+
m.value = !1, g.value = "generic";
|
|
3110
|
+
let t = await Ut(e);
|
|
3111
|
+
g.value = t, n.reportAssetError?.({
|
|
2950
3112
|
item: n.item,
|
|
2951
|
-
occurrenceKey:
|
|
3113
|
+
occurrenceKey: $(n.item),
|
|
2952
3114
|
url: e,
|
|
2953
3115
|
kind: t,
|
|
2954
3116
|
surface: "grid"
|
|
2955
3117
|
}), J();
|
|
2956
3118
|
}
|
|
2957
3119
|
function U() {
|
|
2958
|
-
ce(
|
|
3120
|
+
ce(w.value) && (h.value = !0, m.value = !0, g.value = null, X(A.value ?? n.item.url), J(), K());
|
|
2959
3121
|
}
|
|
2960
3122
|
function W() {
|
|
2961
|
-
ce(
|
|
3123
|
+
ce(w.value) && (h.value || (m.value = !1));
|
|
2962
3124
|
}
|
|
2963
3125
|
function G() {
|
|
2964
3126
|
if (l.value.kind === "fallback") {
|
|
@@ -2969,32 +3131,32 @@ var zr = ["aria-label"], Br = {
|
|
|
2969
3131
|
J();
|
|
2970
3132
|
return;
|
|
2971
3133
|
}
|
|
2972
|
-
if (!
|
|
3134
|
+
if (!M.value) {
|
|
2973
3135
|
q();
|
|
2974
3136
|
return;
|
|
2975
3137
|
}
|
|
2976
|
-
if (
|
|
3138
|
+
if (E.value || B) {
|
|
2977
3139
|
B?.refresh();
|
|
2978
3140
|
return;
|
|
2979
3141
|
}
|
|
2980
|
-
B =
|
|
3142
|
+
B = Yr.request({
|
|
2981
3143
|
assetType: l.value.kind,
|
|
2982
|
-
getPriority:
|
|
3144
|
+
getPriority: se,
|
|
2983
3145
|
onGrant() {
|
|
2984
|
-
|
|
3146
|
+
E.value = !0, m.value = !1, g.value = null;
|
|
2985
3147
|
},
|
|
2986
3148
|
url: l.value.url ?? n.item.url
|
|
2987
3149
|
});
|
|
2988
3150
|
}
|
|
2989
3151
|
function K() {
|
|
2990
|
-
let e =
|
|
3152
|
+
let e = w.value;
|
|
2991
3153
|
if (!(!e || l.value.kind !== "video")) {
|
|
2992
|
-
if (
|
|
3154
|
+
if (g.value) {
|
|
2993
3155
|
e.pause();
|
|
2994
3156
|
return;
|
|
2995
3157
|
}
|
|
2996
|
-
if (
|
|
2997
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
3158
|
+
if (A.value && d.value && m.value) {
|
|
3159
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, Kt(e);
|
|
2998
3160
|
return;
|
|
2999
3161
|
}
|
|
3000
3162
|
try {
|
|
@@ -3004,22 +3166,22 @@ var zr = ["aria-label"], Br = {
|
|
|
3004
3166
|
}
|
|
3005
3167
|
}
|
|
3006
3168
|
function q(e = !0) {
|
|
3007
|
-
|
|
3169
|
+
E.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (ie(), ae()), J();
|
|
3008
3170
|
}
|
|
3009
3171
|
function J() {
|
|
3010
3172
|
B?.release(), B = null;
|
|
3011
3173
|
}
|
|
3012
|
-
function
|
|
3013
|
-
let t =
|
|
3174
|
+
function Y(e) {
|
|
3175
|
+
let t = y.value;
|
|
3014
3176
|
if (!t) {
|
|
3015
3177
|
d.value = !0;
|
|
3016
3178
|
return;
|
|
3017
3179
|
}
|
|
3018
|
-
d.value =
|
|
3180
|
+
d.value = zr(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? C.value?.getBoundingClientRect() ?? null);
|
|
3019
3181
|
}
|
|
3020
|
-
function
|
|
3182
|
+
function X(e) {
|
|
3021
3183
|
if (!e) return;
|
|
3022
|
-
let t =
|
|
3184
|
+
let t = $(n.item), r = `${t}|${e}`;
|
|
3023
3185
|
V.has(r) || (V.add(r), n.reportAssetLoad?.({
|
|
3024
3186
|
item: n.item,
|
|
3025
3187
|
occurrenceKey: t,
|
|
@@ -3028,34 +3190,34 @@ var zr = ["aria-label"], Br = {
|
|
|
3028
3190
|
}));
|
|
3029
3191
|
}
|
|
3030
3192
|
function ne() {
|
|
3031
|
-
if (!
|
|
3032
|
-
let e =
|
|
3193
|
+
if (!L.value) return;
|
|
3194
|
+
let e = $(n.item);
|
|
3033
3195
|
V.forEach((t) => {
|
|
3034
3196
|
t.startsWith(`${e}|`) && V.delete(t);
|
|
3035
|
-
}),
|
|
3197
|
+
}), g.value = null, m.value = !1, E.value = !1, J(), G();
|
|
3036
3198
|
}
|
|
3037
|
-
function
|
|
3038
|
-
|
|
3199
|
+
function ie() {
|
|
3200
|
+
Lr(v.value);
|
|
3039
3201
|
}
|
|
3040
3202
|
function ae() {
|
|
3041
|
-
|
|
3203
|
+
Rr(w.value);
|
|
3042
3204
|
}
|
|
3043
|
-
function
|
|
3044
|
-
let e =
|
|
3205
|
+
function se() {
|
|
3206
|
+
let e = y.value;
|
|
3045
3207
|
if (!e) return Infinity;
|
|
3046
3208
|
let t = e.getBoundingClientRect();
|
|
3047
|
-
if (
|
|
3048
|
-
let e =
|
|
3209
|
+
if (C.value) {
|
|
3210
|
+
let e = C.value.getBoundingClientRect(), n = e.top + e.height / 2;
|
|
3049
3211
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3050
3212
|
}
|
|
3051
3213
|
let n = window.innerHeight / 2;
|
|
3052
3214
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3053
3215
|
}
|
|
3054
3216
|
function ce(e) {
|
|
3055
|
-
let t =
|
|
3056
|
-
return !e || !t ? !1 :
|
|
3217
|
+
let t = Br(A.value);
|
|
3218
|
+
return !e || !t ? !1 : Br("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3057
3219
|
}
|
|
3058
|
-
function
|
|
3220
|
+
function Z() {
|
|
3059
3221
|
r("open");
|
|
3060
3222
|
}
|
|
3061
3223
|
function le() {
|
|
@@ -3063,11 +3225,11 @@ var zr = ["aria-label"], Br = {
|
|
|
3063
3225
|
}
|
|
3064
3226
|
function ue(e) {
|
|
3065
3227
|
let t = e.relatedTarget;
|
|
3066
|
-
|
|
3228
|
+
y.value && t instanceof Node && y.value.contains(t) || (f.value = !1);
|
|
3067
3229
|
}
|
|
3068
3230
|
return (e, t) => (S(), s("div", {
|
|
3069
3231
|
ref_key: "rootRef",
|
|
3070
|
-
ref:
|
|
3232
|
+
ref: y,
|
|
3071
3233
|
"data-testid": "vibe-list-card-inner",
|
|
3072
3234
|
class: _(["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"]),
|
|
3073
3235
|
onFocusin: le,
|
|
@@ -3080,90 +3242,90 @@ var zr = ["aria-label"], Br = {
|
|
|
3080
3242
|
"data-testid": "vibe-list-card-open",
|
|
3081
3243
|
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]",
|
|
3082
3244
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3083
|
-
onClick:
|
|
3084
|
-
}, null, 8,
|
|
3085
|
-
|
|
3245
|
+
onClick: Z
|
|
3246
|
+
}, null, 8, Qr),
|
|
3247
|
+
R.value ? (S(), s("div", $r, [c("span", ei, [u(j(re), {
|
|
3086
3248
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3087
3249
|
"aria-hidden": "true"
|
|
3088
3250
|
})])])) : o("", !0),
|
|
3089
|
-
|
|
3251
|
+
N.value && A.value && !I.value ? (S(), s("img", {
|
|
3090
3252
|
key: 1,
|
|
3091
3253
|
ref_key: "imageRef",
|
|
3092
|
-
ref:
|
|
3093
|
-
src:
|
|
3254
|
+
ref: v,
|
|
3255
|
+
src: A.value,
|
|
3094
3256
|
alt: l.value.label,
|
|
3095
3257
|
draggable: "false",
|
|
3096
3258
|
class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3097
|
-
onLoad:
|
|
3098
|
-
onError:
|
|
3099
|
-
}, null, 42,
|
|
3259
|
+
onLoad: te,
|
|
3260
|
+
onError: H
|
|
3261
|
+
}, null, 42, ti)) : P.value && A.value && !I.value ? (S(), s("video", {
|
|
3100
3262
|
key: 2,
|
|
3101
3263
|
ref_key: "videoRef",
|
|
3102
|
-
ref:
|
|
3103
|
-
src:
|
|
3264
|
+
ref: w,
|
|
3265
|
+
src: A.value,
|
|
3104
3266
|
muted: "",
|
|
3105
3267
|
loop: "",
|
|
3106
3268
|
playsinline: "",
|
|
3107
3269
|
preload: "metadata",
|
|
3108
3270
|
class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3109
3271
|
onCanplay: U,
|
|
3110
|
-
onError:
|
|
3272
|
+
onError: H,
|
|
3111
3273
|
onLoadstart: W,
|
|
3112
3274
|
onPlaying: U,
|
|
3113
3275
|
onStalled: W,
|
|
3114
3276
|
onWaiting: W
|
|
3115
|
-
}, null, 42,
|
|
3277
|
+
}, null, 42, ni)) : I.value ? (S(), s("div", {
|
|
3116
3278
|
key: 3,
|
|
3117
3279
|
"data-testid": "vibe-list-card-error",
|
|
3118
|
-
"data-kind":
|
|
3280
|
+
"data-kind": g.value,
|
|
3119
3281
|
class: "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))]"
|
|
3120
|
-
}, [c("div",
|
|
3121
|
-
u(j(
|
|
3282
|
+
}, [c("div", ii, [
|
|
3283
|
+
u(j(oe), {
|
|
3122
3284
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3123
3285
|
"aria-hidden": "true"
|
|
3124
3286
|
}),
|
|
3125
|
-
c("span",
|
|
3126
|
-
|
|
3287
|
+
c("span", ai, k(j(Vt)(g.value)), 1),
|
|
3288
|
+
L.value ? (S(), s("button", {
|
|
3127
3289
|
key: 0,
|
|
3128
3290
|
type: "button",
|
|
3129
3291
|
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",
|
|
3130
3292
|
onClick: z(ne, ["stop"])
|
|
3131
3293
|
}, " Retry ")) : o("", !0)
|
|
3132
|
-
])], 8,
|
|
3133
|
-
icon: j(
|
|
3294
|
+
])], 8, ri)) : (S(), s("div", oi, [c("div", si, [D(e.$slots, "item-icon", {
|
|
3295
|
+
icon: j(St)(n.item.type),
|
|
3134
3296
|
item: n.item
|
|
3135
|
-
}, () => [(S(), a(O(j(
|
|
3297
|
+
}, () => [(S(), a(O(j(St)(n.item.type)), {
|
|
3136
3298
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3137
3299
|
"aria-hidden": "true"
|
|
3138
3300
|
}))])])])),
|
|
3139
|
-
c("div",
|
|
3301
|
+
c("div", ci, [D(e.$slots, "grid-item-overlay", {
|
|
3140
3302
|
active: n.active,
|
|
3141
3303
|
focused: f.value,
|
|
3142
3304
|
hovered: p.value,
|
|
3143
3305
|
index: n.index,
|
|
3144
3306
|
item: n.item,
|
|
3145
|
-
openFullscreen:
|
|
3307
|
+
openFullscreen: Z
|
|
3146
3308
|
})])
|
|
3147
3309
|
], 34));
|
|
3148
3310
|
}
|
|
3149
|
-
}),
|
|
3311
|
+
}), ui = { 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)]" }, di = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, fi = {
|
|
3150
3312
|
"data-testid": "vibe-pagination",
|
|
3151
3313
|
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]"
|
|
3152
|
-
},
|
|
3314
|
+
}, pi = { class: "whitespace-nowrap" }, mi = {
|
|
3153
3315
|
key: 0,
|
|
3154
3316
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3155
|
-
},
|
|
3317
|
+
}, hi = [
|
|
3156
3318
|
"data-active",
|
|
3157
3319
|
"data-index",
|
|
3158
3320
|
"data-item-id",
|
|
3159
3321
|
"data-occurrence-key"
|
|
3160
|
-
],
|
|
3322
|
+
], gi = ["data-item-id"], _i = {
|
|
3161
3323
|
key: 0,
|
|
3162
3324
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3163
|
-
},
|
|
3325
|
+
}, vi = {
|
|
3164
3326
|
key: 1,
|
|
3165
3327
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3166
|
-
},
|
|
3328
|
+
}, yi = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, bi = /* @__PURE__ */ d({
|
|
3167
3329
|
__name: "ListSurface",
|
|
3168
3330
|
props: {
|
|
3169
3331
|
active: {
|
|
@@ -3220,7 +3382,7 @@ var zr = ["aria-label"], Br = {
|
|
|
3220
3382
|
},
|
|
3221
3383
|
emits: ["open-fullscreen", "update:activeIndex"],
|
|
3222
3384
|
setup(e, { emit: n }) {
|
|
3223
|
-
let r = e, d = N(), f = n, p =
|
|
3385
|
+
let r = e, d = N(), f = n, p = Fr({
|
|
3224
3386
|
active: A(r, "active"),
|
|
3225
3387
|
allowExhaustedNextPageRefresh: A(r, "allowExhaustedNextPageRefresh"),
|
|
3226
3388
|
items: A(r, "items"),
|
|
@@ -3236,11 +3398,11 @@ var zr = ["aria-label"], Br = {
|
|
|
3236
3398
|
setActiveIndex(e) {
|
|
3237
3399
|
f("update:activeIndex", e);
|
|
3238
3400
|
}
|
|
3239
|
-
}), m = i(() =>
|
|
3401
|
+
}), m = i(() => Mt({
|
|
3240
3402
|
itemCount: r.items.length,
|
|
3241
3403
|
loading: r.loading,
|
|
3242
3404
|
phase: r.phase
|
|
3243
|
-
})), g = i(() =>
|
|
3405
|
+
})), g = i(() => Nt({
|
|
3244
3406
|
errorMessage: r.errorMessage,
|
|
3245
3407
|
hasItems: r.items.length > 0,
|
|
3246
3408
|
hasNextPage: r.hasNextPage,
|
|
@@ -3253,15 +3415,15 @@ var zr = ["aria-label"], Br = {
|
|
|
3253
3415
|
message: g.value.message,
|
|
3254
3416
|
paginationDetail: r.paginationDetail,
|
|
3255
3417
|
total: r.items.length
|
|
3256
|
-
}), x = i(() => !b.value || !d["grid-status"] ? [] : d["grid-status"](b.value)), C = i(() =>
|
|
3418
|
+
}), x = i(() => !b.value || !d["grid-status"] ? [] : d["grid-status"](b.value)), C = i(() => Dt(x.value)), w = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: O, showCustomEmptyState: M, showInlineEmptyState: P } = At({
|
|
3257
3419
|
emptyStateMode: A(r, "emptyStateMode"),
|
|
3258
3420
|
itemCount: w,
|
|
3259
3421
|
loading: A(r, "loading"),
|
|
3260
3422
|
renderSlot: d["empty-state"],
|
|
3261
3423
|
surface: "grid"
|
|
3262
3424
|
});
|
|
3263
|
-
return (e, n) => (S(), s("div",
|
|
3264
|
-
c("div",
|
|
3425
|
+
return (e, n) => (S(), s("div", ui, [
|
|
3426
|
+
c("div", di, [c("span", fi, [c("span", pi, k(j(p).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", mi, k(r.paginationDetail), 1)) : o("", !0)])]),
|
|
3265
3427
|
c("div", {
|
|
3266
3428
|
ref: j(p).scrollViewportRef,
|
|
3267
3429
|
"data-testid": "vibe-list-scroll",
|
|
@@ -3274,15 +3436,15 @@ var zr = ["aria-label"], Br = {
|
|
|
3274
3436
|
style: y({ height: `${j(p).containerHeight.value}px` })
|
|
3275
3437
|
}, [
|
|
3276
3438
|
(S(!0), s(t, null, E(j(p).renderedItems.value, ({ item: t, index: n }) => (S(), s("article", {
|
|
3277
|
-
key: j(
|
|
3439
|
+
key: j($)(t),
|
|
3278
3440
|
"data-testid": "vibe-list-card",
|
|
3279
3441
|
"data-active": n === j(p).resolvedActiveIndex.value ? "true" : "false",
|
|
3280
3442
|
"data-index": n,
|
|
3281
3443
|
"data-item-id": t.id,
|
|
3282
|
-
"data-occurrence-key": j(
|
|
3444
|
+
"data-occurrence-key": j($)(t),
|
|
3283
3445
|
class: "absolute will-change-transform",
|
|
3284
3446
|
style: y(j(p).getCardStyle(n))
|
|
3285
|
-
}, [u(
|
|
3447
|
+
}, [u(li, {
|
|
3286
3448
|
active: n === j(p).resolvedActiveIndex.value,
|
|
3287
3449
|
index: n,
|
|
3288
3450
|
item: t,
|
|
@@ -3306,14 +3468,14 @@ var zr = ["aria-label"], Br = {
|
|
|
3306
3468
|
"report-asset-load",
|
|
3307
3469
|
"surface-active",
|
|
3308
3470
|
"onOpen"
|
|
3309
|
-
])], 12,
|
|
3471
|
+
])], 12, hi))), 128)),
|
|
3310
3472
|
(S(!0), s(t, null, E(j(p).leavingItems.value, (t) => (S(), s("article", {
|
|
3311
|
-
key: `leaving-${j(
|
|
3473
|
+
key: `leaving-${j($)(t.item)}`,
|
|
3312
3474
|
"data-testid": "vibe-list-card-leaving",
|
|
3313
3475
|
"data-item-id": t.item.id,
|
|
3314
3476
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
3315
3477
|
style: y(j(p).getLeavingCardStyle(t.item))
|
|
3316
|
-
}, [u(
|
|
3478
|
+
}, [u(li, {
|
|
3317
3479
|
active: !1,
|
|
3318
3480
|
index: -1,
|
|
3319
3481
|
item: t.item,
|
|
@@ -3328,8 +3490,8 @@ var zr = ["aria-label"], Br = {
|
|
|
3328
3490
|
"item",
|
|
3329
3491
|
"report-asset-error",
|
|
3330
3492
|
"report-asset-load"
|
|
3331
|
-
])], 12,
|
|
3332
|
-
j(P) && j(T) ? (S(), a(
|
|
3493
|
+
])], 12, gi))), 128)),
|
|
3494
|
+
j(P) && j(T) ? (S(), a(un, {
|
|
3333
3495
|
key: 0,
|
|
3334
3496
|
message: j(T).message,
|
|
3335
3497
|
mode: j(T).mode,
|
|
@@ -3343,12 +3505,12 @@ var zr = ["aria-label"], Br = {
|
|
|
3343
3505
|
"surface"
|
|
3344
3506
|
])) : o("", !0)
|
|
3345
3507
|
], 4)], 544),
|
|
3346
|
-
j(p).showScrollbar.value ? (S(), s("div",
|
|
3508
|
+
j(p).showScrollbar.value ? (S(), s("div", _i, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
3347
3509
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
3348
3510
|
class: _(["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"]),
|
|
3349
3511
|
style: y(j(p).getScrollbarThumbStyle())
|
|
3350
3512
|
}, null, 6)])) : o("", !0),
|
|
3351
|
-
d["grid-footer"] ? (S(), s("div",
|
|
3513
|
+
d["grid-footer"] ? (S(), s("div", vi, [c("div", yi, [D(e.$slots, "grid-footer")])])) : o("", !0),
|
|
3352
3514
|
b.value ? (S(), s("div", {
|
|
3353
3515
|
key: 2,
|
|
3354
3516
|
class: _(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
|
|
@@ -3357,7 +3519,7 @@ var zr = ["aria-label"], Br = {
|
|
|
3357
3519
|
"data-testid": "vibe-grid-status-badge",
|
|
3358
3520
|
class: _(["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]", b.value.kind === "end" ? "border-amber-300/35 text-amber-200" : b.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
3359
3521
|
}, k(b.value.message), 3))], 2)) : o("", !0),
|
|
3360
|
-
j(O) && j(T) ? (S(), a(
|
|
3522
|
+
j(O) && j(T) ? (S(), a(un, {
|
|
3361
3523
|
key: 3,
|
|
3362
3524
|
class: _(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
3363
3525
|
message: j(T).message,
|
|
@@ -3374,13 +3536,13 @@ var zr = ["aria-label"], Br = {
|
|
|
3374
3536
|
])) : o("", !0)
|
|
3375
3537
|
]));
|
|
3376
3538
|
}
|
|
3377
|
-
}),
|
|
3539
|
+
}), xi = ["data-surface-mode"], Si = {
|
|
3378
3540
|
key: 1,
|
|
3379
3541
|
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"
|
|
3380
|
-
},
|
|
3542
|
+
}, Ci = ["data-visible", "inert"], wi = ["data-visible", "inert"], Ti = {
|
|
3381
3543
|
key: 3,
|
|
3382
3544
|
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"
|
|
3383
|
-
},
|
|
3545
|
+
}, Ei = /* @__PURE__ */ d({
|
|
3384
3546
|
name: "VibeLayout",
|
|
3385
3547
|
__name: "Layout",
|
|
3386
3548
|
props: {
|
|
@@ -3406,9 +3568,9 @@ var zr = ["aria-label"], Br = {
|
|
|
3406
3568
|
"update:surfaceMode"
|
|
3407
3569
|
],
|
|
3408
3570
|
setup(e, { expose: n, emit: i }) {
|
|
3409
|
-
let d = e, p = N(), m = i, h =
|
|
3571
|
+
let d = e, p = N(), m = i, h = qe(d, m), g = le((e) => {
|
|
3410
3572
|
m("asset-errors", e);
|
|
3411
|
-
}), _ =
|
|
3573
|
+
}), _ = ue((e) => {
|
|
3412
3574
|
m("asset-loads", e);
|
|
3413
3575
|
});
|
|
3414
3576
|
return b(() => {
|
|
@@ -3435,7 +3597,7 @@ var zr = ["aria-label"], Br = {
|
|
|
3435
3597
|
type: "button",
|
|
3436
3598
|
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",
|
|
3437
3599
|
onClick: n[0] ||= (...e) => j(h).retryInitialLoad && j(h).retryInitialLoad(...e)
|
|
3438
|
-
}, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div",
|
|
3600
|
+
}, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", Si, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).isDesktop.value ? (S(), s(t, { key: 2 }, [u(r, {
|
|
3439
3601
|
appear: "",
|
|
3440
3602
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
3441
3603
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -3449,7 +3611,7 @@ var zr = ["aria-label"], Br = {
|
|
|
3449
3611
|
"data-visible": j(h).surfaceMode.value === "list" ? "true" : "false",
|
|
3450
3612
|
inert: j(h).surfaceMode.value !== "list",
|
|
3451
3613
|
class: "absolute inset-0 z-[2]"
|
|
3452
|
-
}, [u(
|
|
3614
|
+
}, [u(bi, {
|
|
3453
3615
|
active: j(h).surfaceMode.value === "list",
|
|
3454
3616
|
"allow-exhausted-next-page-refresh": j(h).canRefreshExhaustedNextPage.value,
|
|
3455
3617
|
items: j(h).items.value,
|
|
@@ -3517,7 +3679,7 @@ var zr = ["aria-label"], Br = {
|
|
|
3517
3679
|
"show-status-badges",
|
|
3518
3680
|
"onOpenFullscreen",
|
|
3519
3681
|
"onUpdate:activeIndex"
|
|
3520
|
-
])], 8,
|
|
3682
|
+
])], 8, Ci), [[P, j(h).surfaceMode.value === "list"]])]),
|
|
3521
3683
|
_: 3
|
|
3522
3684
|
}), u(r, {
|
|
3523
3685
|
appear: "",
|
|
@@ -3533,7 +3695,7 @@ var zr = ["aria-label"], Br = {
|
|
|
3533
3695
|
"data-visible": j(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
3534
3696
|
inert: j(h).surfaceMode.value !== "fullscreen",
|
|
3535
3697
|
class: "absolute inset-0 z-[3]"
|
|
3536
|
-
}, [u(
|
|
3698
|
+
}, [u(Kn, {
|
|
3537
3699
|
items: j(h).items.value,
|
|
3538
3700
|
active: j(h).surfaceMode.value === "fullscreen",
|
|
3539
3701
|
"active-index": j(h).activeIndex.value,
|
|
@@ -3602,12 +3764,12 @@ var zr = ["aria-label"], Br = {
|
|
|
3602
3764
|
"show-back-to-list",
|
|
3603
3765
|
"onBackToList",
|
|
3604
3766
|
"onUpdate:activeIndex"
|
|
3605
|
-
])], 8,
|
|
3767
|
+
])], 8, wi), [[P, j(h).surfaceMode.value === "fullscreen"]])]),
|
|
3606
3768
|
_: 3
|
|
3607
|
-
})], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div",
|
|
3769
|
+
})], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div", Ti, [u(j(re), {
|
|
3608
3770
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
3609
3771
|
"aria-hidden": "true"
|
|
3610
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(
|
|
3772
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(Kn, {
|
|
3611
3773
|
key: 4,
|
|
3612
3774
|
items: j(h).items.value,
|
|
3613
3775
|
active: !0,
|
|
@@ -3675,10 +3837,10 @@ var zr = ["aria-label"], Br = {
|
|
|
3675
3837
|
"show-status-badges",
|
|
3676
3838
|
"onBackToList",
|
|
3677
3839
|
"onUpdate:activeIndex"
|
|
3678
|
-
]))], 8,
|
|
3840
|
+
]))], 8, xi));
|
|
3679
3841
|
}
|
|
3680
|
-
}),
|
|
3681
|
-
e.component("VibeLayout",
|
|
3842
|
+
}), Di = { install(e) {
|
|
3843
|
+
e.component("VibeLayout", Ei);
|
|
3682
3844
|
} };
|
|
3683
3845
|
//#endregion
|
|
3684
|
-
export {
|
|
3846
|
+
export { Ei as VibeLayout, Di as VibePlugin, Di as default };
|