@wyxos/vibe 3.1.26 → 3.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -3,10 +3,10 @@ import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i,
3
3
  var U = (e) => {
4
4
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
5
5
  return !1;
6
- }, te = (e) => e === "", W = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), G = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), K = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), q = (e) => {
7
- let t = K(e);
6
+ }, te = (e) => e === "", W = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), G = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ne = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), K = (e) => {
7
+ let t = ne(e);
8
8
  return t.charAt(0).toUpperCase() + t.slice(1);
9
- }, J = {
9
+ }, q = {
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
11
  width: 24,
12
12
  height: 24,
@@ -16,27 +16,27 @@ var U = (e) => {
16
16
  "stroke-width": 2,
17
17
  "stroke-linecap": "round",
18
18
  "stroke-linejoin": "round"
19
- }, ne = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = J.width, color: s = J.stroke, ...c }, { slots: l }) => m("svg", {
20
- ...J,
19
+ }, re = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = q.width, color: s = q.stroke, ...c }, { slots: l }) => m("svg", {
20
+ ...q,
21
21
  ...c,
22
22
  width: o,
23
23
  height: o,
24
24
  stroke: s,
25
- "stroke-width": te(n) || te(r) || n === !0 || r === !0 ? Number(i || a || J["stroke-width"]) * 24 / Number(o) : i || a || J["stroke-width"],
26
- class: W("lucide", c.class, ...e ? [`lucide-${G(q(e))}-icon`, `lucide-${G(e)}`] : ["lucide-icon"]),
25
+ "stroke-width": te(n) || te(r) || n === !0 || r === !0 ? Number(i || a || q["stroke-width"]) * 24 / Number(o) : i || a || q["stroke-width"],
26
+ class: W("lucide", c.class, ...e ? [`lucide-${G(K(e))}-icon`, `lucide-${G(e)}`] : ["lucide-icon"]),
27
27
  ...!l.default && !U(c) && { "aria-hidden": "true" }
28
- }, [...t.map((e) => m(...e)), ...l.default ? [l.default()] : []]), Y = (e, t) => (n, { slots: r, attrs: i }) => m(ne, {
28
+ }, [...t.map((e) => m(...e)), ...l.default ? [l.default()] : []]), J = (e, t) => (n, { slots: r, attrs: i }) => m(re, {
29
29
  ...i,
30
30
  ...n,
31
31
  iconNode: t,
32
32
  name: e
33
- }, r), X = Y("arrow-left", [["path", {
33
+ }, r), Y = J("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
- }]]), re = Y("audio-lines", [
39
+ }]]), ie = J("audio-lines", [
40
40
  ["path", {
41
41
  d: "M2 10v3",
42
42
  key: "1fnikh"
@@ -61,7 +61,7 @@ var U = (e) => {
61
61
  d: "M22 10v3",
62
62
  key: "154ddg"
63
63
  }]
64
- ]), ie = Y("clapperboard", [
64
+ ]), ae = J("clapperboard", [
65
65
  ["path", {
66
66
  d: "m12.296 3.464 3.02 3.956",
67
67
  key: "qash78"
@@ -78,13 +78,13 @@ var U = (e) => {
78
78
  d: "m6.18 5.276 3.1 3.899",
79
79
  key: "zjj9t3"
80
80
  }]
81
- ]), ae = Y("file", [["path", {
81
+ ]), oe = J("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
- }]]), Z = Y("image-plus", [
87
+ }]]), se = J("image-plus", [
88
88
  ["path", {
89
89
  d: "M16 5h6",
90
90
  key: "1vod17"
@@ -107,10 +107,27 @@ var U = (e) => {
107
107
  r: "2",
108
108
  key: "af1f0g"
109
109
  }]
110
- ]), oe = Y("loader-circle", [["path", {
110
+ ]), ce = J("loader-circle", [["path", {
111
111
  d: "M21 12a9 9 0 1 1-6.219-8.56",
112
112
  key: "13zald"
113
- }]]), se = Y("pause", [["rect", {
113
+ }]]), X = J("maximize-2", [
114
+ ["path", {
115
+ d: "M15 3h6v6",
116
+ key: "1q9fwt"
117
+ }],
118
+ ["path", {
119
+ d: "m21 3-7 7",
120
+ key: "1l2asr"
121
+ }],
122
+ ["path", {
123
+ d: "m3 21 7-7",
124
+ key: "tjx5ai"
125
+ }],
126
+ ["path", {
127
+ d: "M9 21H3v-6",
128
+ key: "wtvkvv"
129
+ }]
130
+ ]), le = J("pause", [["rect", {
114
131
  x: "14",
115
132
  y: "3",
116
133
  width: "5",
@@ -124,10 +141,10 @@ var U = (e) => {
124
141
  height: "18",
125
142
  rx: "1",
126
143
  key: "1wsw3u"
127
- }]]), ce = Y("play", [["path", {
144
+ }]]), ue = J("play", [["path", {
128
145
  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
146
  key: "10ikf1"
130
- }]]), le = Y("triangle-alert", [
147
+ }]]), de = J("triangle-alert", [
131
148
  ["path", {
132
149
  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
150
  key: "wmoenq"
@@ -140,13 +157,13 @@ var U = (e) => {
140
157
  d: "M12 17h.01",
141
158
  key: "p32p05"
142
159
  }]
143
- ]), ue = Y("volume-1", [["path", {
160
+ ]), fe = J("volume-1", [["path", {
144
161
  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
162
  key: "uqj9uw"
146
163
  }], ["path", {
147
164
  d: "M16 9a5 5 0 0 1 0 6",
148
165
  key: "1q6k2b"
149
- }]]), de = Y("volume-2", [
166
+ }]]), pe = J("volume-2", [
150
167
  ["path", {
151
168
  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
169
  key: "uqj9uw"
@@ -159,7 +176,7 @@ var U = (e) => {
159
176
  d: "M19.364 18.364a9 9 0 0 0 0-12.728",
160
177
  key: "ijwkga"
161
178
  }]
162
- ]), fe = Y("volume-x", [
179
+ ]), me = J("volume-x", [
163
180
  ["path", {
164
181
  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
182
  key: "uqj9uw"
@@ -179,13 +196,13 @@ var U = (e) => {
179
196
  key: "5ykzw1"
180
197
  }]
181
198
  ]);
182
- function pe(e, t = 150) {
183
- return he(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
199
+ function he(e, t = 150) {
200
+ return _e(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
184
201
  }
185
- function me(e, t = 150) {
186
- return he(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
202
+ function ge(e, t = 150) {
203
+ return _e(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
187
204
  }
188
- function he(e, t, n) {
205
+ function _e(e, t, n) {
189
206
  let r = [], i = /* @__PURE__ */ new Set(), a = null;
190
207
  function o(e) {
191
208
  let o = t(e);
@@ -209,36 +226,36 @@ function he(e, t, n) {
209
226
  }
210
227
  //#endregion
211
228
  //#region src/components/viewer-core/dom.ts
212
- function ge(e) {
229
+ function ve(e) {
213
230
  return e instanceof HTMLElement && [
214
231
  "INPUT",
215
232
  "TEXTAREA",
216
233
  "SELECT"
217
234
  ].includes(e.tagName);
218
235
  }
219
- function Q(e) {
236
+ function Z(e) {
220
237
  return e instanceof HTMLElement && !!e.closest("[data-swipe-lock], input, textarea, select, a");
221
238
  }
222
- function _e(e) {
239
+ function ye(e) {
223
240
  return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
224
241
  }
225
- function ve(e) {
242
+ function be(e) {
226
243
  return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
227
244
  }
228
- function ye(e) {
245
+ function xe(e) {
229
246
  return e ?? "__vibe_initial_cursor__";
230
247
  }
231
- function be(e, t, n) {
248
+ function Se(e, t, n) {
232
249
  return Math.min(Math.max(e, t), n);
233
250
  }
234
251
  //#endregion
235
252
  //#region src/components/viewer-core/itemIdentity.ts
236
- var xe = "__vibeOccurrenceKey";
253
+ var Q = "__vibeOccurrenceKey";
237
254
  function $(e) {
238
- let t = e[xe];
255
+ let t = e[Q];
239
256
  return typeof t == "string" && t.length > 0 ? t : e.id;
240
257
  }
241
- function Se(e, t, n) {
258
+ function Ce(e, t, n) {
242
259
  let r = /* @__PURE__ */ new Map(), i = [], a = n;
243
260
  for (let e of t) {
244
261
  let t = r.get(e.id), n = $(e);
@@ -246,32 +263,32 @@ function Se(e, t, n) {
246
263
  }
247
264
  for (let t of e) {
248
265
  let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
249
- i.push(Ce(t, e));
266
+ i.push(we(t, e));
250
267
  }
251
268
  return {
252
269
  items: i,
253
270
  nextSequence: a
254
271
  };
255
272
  }
256
- function Ce(e, t) {
273
+ function we(e, t) {
257
274
  return $(e) === t ? e : {
258
275
  ...e,
259
- [xe]: t
276
+ [Q]: t
260
277
  };
261
278
  }
262
279
  //#endregion
263
280
  //#region src/components/viewer-core/removalState.ts
264
- function we() {
281
+ function Te() {
265
282
  let e = D(/* @__PURE__ */ new Set()), t = D([]);
266
283
  function n(n) {
267
- let r = Te(n).filter((t) => !e.value.has(t));
284
+ let r = Ee(n).filter((t) => !e.value.has(t));
268
285
  if (!r.length) return { ids: [] };
269
286
  let i = new Set(e.value);
270
287
  for (let e of r) i.add(e);
271
288
  return e.value = i, t.value = [...t.value, r], { ids: r };
272
289
  }
273
290
  function r(t) {
274
- let n = Te(t).filter((t) => e.value.has(t));
291
+ let n = Ee(t).filter((t) => e.value.has(t));
275
292
  if (!n.length) return { ids: [] };
276
293
  let r = new Set(e.value);
277
294
  for (let e of n) r.delete(e);
@@ -302,46 +319,46 @@ function we() {
302
319
  undo: i
303
320
  };
304
321
  }
305
- function Te(e) {
322
+ function Ee(e) {
306
323
  let t = Array.isArray(e) ? e : [e];
307
324
  return Array.from(new Set(t.filter((e) => typeof e == "string" && e.length > 0)));
308
325
  }
309
326
  //#endregion
310
327
  //#region src/components/viewer-core/autoBuckets.ts
311
- function Ee(e) {
328
+ function De(e) {
312
329
  return e.flatMap((e) => e.items);
313
330
  }
314
- function De(e, t) {
315
- return t.size ? e.filter((e) => !t.has(e.id)) : e;
316
- }
317
331
  function Oe(e, t) {
318
- return De(e.items, t);
332
+ return t.size ? e.filter((e) => !t.has(e.id)) : e;
319
333
  }
320
334
  function ke(e, t) {
321
- return Oe(e, t).length;
335
+ return Oe(e.items, t);
322
336
  }
323
- function Ae(e, t, n) {
337
+ function Ae(e, t) {
338
+ return ke(e, t).length;
339
+ }
340
+ function je(e, t, n) {
324
341
  if (n < 0) return null;
325
342
  let r = 0;
326
343
  for (let i of e) {
327
- let e = Oe(i, t), a = r + e.length;
344
+ let e = ke(i, t), a = r + e.length;
328
345
  if (n < a) return i.cursor;
329
346
  r = a;
330
347
  }
331
348
  return null;
332
349
  }
333
- function je(e, t, n) {
350
+ function Me(e, t, n) {
334
351
  let r = [...e], i = r.findIndex((e) => e.cursor === t);
335
352
  return i >= 0 && r.splice(i, 1, n), r;
336
353
  }
337
- function Me(e, t, n) {
338
- let r = Se(e, t, n);
354
+ function Ne(e, t, n) {
355
+ let r = Ce(e, t, n);
339
356
  return {
340
357
  items: r.items,
341
358
  nextSequence: r.nextSequence
342
359
  };
343
360
  }
344
- function Ne(e, t, n) {
361
+ function Pe(e, t, n) {
345
362
  let r = /* @__PURE__ */ new Map(), i = e.map((e) => ({
346
363
  item: e,
347
364
  matchIndex: null,
@@ -360,10 +377,10 @@ function Ne(e, t, n) {
360
377
  }
361
378
  for (let e of i) {
362
379
  if (e.matchIndex !== null && e.occurrenceKey) {
363
- a.set(e.matchIndex, Pe(e.item, e.occurrenceKey));
380
+ a.set(e.matchIndex, Fe(e.item, e.occurrenceKey));
364
381
  continue;
365
382
  }
366
- let t = Pe(e.item, `vibe-occurrence-${s += 1}`);
383
+ let t = Fe(e.item, `vibe-occurrence-${s += 1}`);
367
384
  o.push(t);
368
385
  }
369
386
  let c = t.map((e, t) => a.get(t) ?? e);
@@ -373,7 +390,7 @@ function Ne(e, t, n) {
373
390
  nextSequence: s
374
391
  };
375
392
  }
376
- function Pe(e, t) {
393
+ function Fe(e, t) {
377
394
  return $(e) === t ? e : {
378
395
  ...e,
379
396
  __vibeOccurrenceKey: t
@@ -381,11 +398,11 @@ function Pe(e, t) {
381
398
  }
382
399
  //#endregion
383
400
  //#region src/components/viewer-core/autoResolveState.ts
384
- function Fe(e) {
401
+ function Ie(e) {
385
402
  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";
386
403
  }
387
- function Ie(e) {
388
- let t = Me(e.nextItems, e.previousItems, e.sequence);
404
+ function Le(e) {
405
+ let t = Ne(e.nextItems, e.previousItems, e.sequence);
389
406
  return {
390
407
  bucket: {
391
408
  cursor: e.cursor,
@@ -397,8 +414,8 @@ function Ie(e) {
397
414
  nextSequence: t.nextSequence
398
415
  };
399
416
  }
400
- function Le(e) {
401
- let t = Ne(e.nextItems, e.previousItems, e.sequence);
417
+ function Re(e) {
418
+ let t = Pe(e.nextItems, e.previousItems, e.sequence);
402
419
  return {
403
420
  bucket: {
404
421
  cursor: e.cursor,
@@ -411,7 +428,7 @@ function Le(e) {
411
428
  nextSequence: t.nextSequence
412
429
  };
413
430
  }
414
- function Re(e, t, n, r) {
431
+ function ze(e, t, n, r) {
415
432
  if (!e.length) return r ? null : {
416
433
  buckets: [],
417
434
  canceled: r,
@@ -421,11 +438,11 @@ function Re(e, t, n, r) {
421
438
  return {
422
439
  buckets: i,
423
440
  canceled: r,
424
- visibleCount: i.reduce((e, t) => e + ke(t, n), 0)
441
+ visibleCount: i.reduce((e, t) => e + Ae(t, n), 0)
425
442
  };
426
443
  }
427
- function ze(e) {
428
- let t = Ie({
444
+ function Be(e) {
445
+ let t = Le({
429
446
  cursor: e.initialState.cursor,
430
447
  nextCursor: e.initialState.nextCursor ?? null,
431
448
  nextCursorExhausted: !1,
@@ -433,30 +450,30 @@ function ze(e) {
433
450
  previousCursor: e.initialState.previousCursor ?? null,
434
451
  previousItems: [],
435
452
  sequence: e.sequence
436
- }), n = De(t.bucket.items, e.removedIds);
453
+ }), n = Oe(t.bucket.items, e.removedIds);
437
454
  return {
438
- activeIndex: be(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
455
+ activeIndex: Se(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
439
456
  buckets: [t.bucket],
440
457
  nextSequence: t.nextSequence
441
458
  };
442
459
  }
443
- function Be(e, t) {
444
- let n = e[be(t, 0, Math.max(0, e.length - 1))];
460
+ function Ve(e, t) {
461
+ let n = e[Se(t, 0, Math.max(0, e.length - 1))];
445
462
  return n ? $(n) : null;
446
463
  }
447
- function Ve(e, t, n = null) {
464
+ function He(e, t, n = null) {
448
465
  if (!e.length) return 0;
449
466
  let r = n ? e.findIndex((e) => $(e) === n) : -1;
450
- return r >= 0 ? r : be(t, 0, e.length - 1);
467
+ return r >= 0 ? r : Se(t, 0, e.length - 1);
451
468
  }
452
- function He(e, t, n) {
453
- return e ? ke(e, t) < n : !1;
469
+ function Ue(e, t, n) {
470
+ return e ? Ae(e, t) < n : !1;
454
471
  }
455
472
  //#endregion
456
473
  //#region src/components/viewer-core/autoResolveBucketFactory.ts
457
- function Ue(e) {
474
+ function We(e) {
458
475
  return (t) => {
459
- let n = Ie({
476
+ let n = Le({
460
477
  cursor: t.cursor,
461
478
  nextCursor: t.nextCursor,
462
479
  nextCursorExhausted: t.nextCursorExhausted ?? !1,
@@ -470,26 +487,26 @@ function Ue(e) {
470
487
  }
471
488
  //#endregion
472
489
  //#region src/components/viewer-core/autoResolveCursors.ts
473
- function We(e, t) {
474
- return e.find((e) => ke(e, t) > 0) ?? e[0] ?? null;
475
- }
476
490
  function Ge(e, t) {
491
+ return e.find((e) => Ae(e, t) > 0) ?? e[0] ?? null;
492
+ }
493
+ function Ke(e, t) {
477
494
  for (let n = e.length - 1; n >= 0; --n) {
478
495
  let r = e[n];
479
- if (ke(r, t) > 0) return r;
496
+ if (Ae(r, t) > 0) return r;
480
497
  }
481
498
  return e[e.length - 1] ?? null;
482
499
  }
483
- function Ke(e) {
500
+ function qe(e) {
484
501
  return !e?.nextCursor || !e.nextCursorExhausted ? null : e.nextCursor;
485
502
  }
486
- function qe(e, t, n, r) {
503
+ function Je(e, t, n, r) {
487
504
  return t === void 0 || n === null ? e : e.map((e) => e.cursor !== t || e.nextCursor !== n ? e : {
488
505
  ...e,
489
506
  nextCursorExhausted: r
490
507
  });
491
508
  }
492
- function Je(e, t, n) {
509
+ function Ye(e, t, n) {
493
510
  return n || e !== "forward" || t === null ? {
494
511
  cursor: n,
495
512
  exhausted: !1
@@ -498,7 +515,7 @@ function Je(e, t, n) {
498
515
  exhausted: !0
499
516
  };
500
517
  }
501
- function Ye(e, t) {
518
+ function Xe(e, t) {
502
519
  if (t) return {
503
520
  cursor: t,
504
521
  exhausted: !1
@@ -509,11 +526,11 @@ function Ye(e, t) {
509
526
  exhausted: !!n
510
527
  };
511
528
  }
512
- function Xe(e, t) {
513
- let n = e.findIndex((e) => ke(e, t) > 0);
529
+ function Ze(e, t) {
530
+ let n = e.findIndex((e) => Ae(e, t) > 0);
514
531
  if (n < 0) return e;
515
532
  let r = n;
516
- for (let i = e.length - 1; i >= n; --i) if (ke(e[i], t) > 0) {
533
+ for (let i = e.length - 1; i >= n; --i) if (Ae(e[i], t) > 0) {
517
534
  r = i;
518
535
  break;
519
536
  }
@@ -521,7 +538,7 @@ function Xe(e, t) {
521
538
  }
522
539
  //#endregion
523
540
  //#region src/components/viewer-core/autoResolveFillUntil.ts
524
- function Ze(e) {
541
+ function Qe(e) {
525
542
  async function t(t) {
526
543
  if (typeof t == "number") {
527
544
  await i(t);
@@ -536,7 +553,7 @@ function Ze(e) {
536
553
  e.isFillUntilActive.value = !1, e.fillMode.value = "idle";
537
554
  }
538
555
  async function i(t) {
539
- let n = Qe(t);
556
+ let n = $e(t);
540
557
  n <= 0 || await a("count", () => e.getHasNextPage() && n > 0, () => {
541
558
  --n;
542
559
  }, n);
@@ -562,7 +579,7 @@ function Ze(e) {
562
579
  });
563
580
  let r = e.getResolve();
564
581
  if (!r) return !1;
565
- let i = ye(t);
582
+ let i = xe(t);
566
583
  if (e.inFlightCursors.has(i)) return !1;
567
584
  let a = e.nextOperationId(), s = typeof AbortController > "u" ? null : new AbortController();
568
585
  e.inFlightCursors.add(i), e.setActiveResolveController(s), e.errorMessage.value = null, e.operationPhase.value = "filling", e.fillCollectedCount.value = e.getVisibleItemCount(), e.fillCursor.value = t, e.fillTargetCount.value = null, e.pendingAppendBuckets.value = [], e.isAwaitingAppendCommit.value = !1;
@@ -573,8 +590,8 @@ function Ze(e) {
573
590
  signal: s?.signal
574
591
  });
575
592
  if (!e.getOperationIsCurrent(a)) return e.finishLoadPhase(), !1;
576
- if (u(i.total), !i.items.length) return e.autoBuckets.value = i.nextPage ? et(e.autoBuckets.value, n, t, i.nextPage) : qe(e.autoBuckets.value, n, t, !0), c(), e.finishLoadPhase(), !0;
577
- let o = Je("forward", t, i.nextPage);
593
+ if (u(i.total), !i.items.length) return e.autoBuckets.value = i.nextPage ? tt(e.autoBuckets.value, n, t, i.nextPage) : Je(e.autoBuckets.value, n, t, !0), c(), e.finishLoadPhase(), !0;
594
+ let o = Ye("forward", t, i.nextPage);
578
595
  return e.autoBuckets.value = [...e.autoBuckets.value, e.createBucket({
579
596
  cursor: t,
580
597
  nextCursor: o.cursor,
@@ -584,7 +601,7 @@ function Ze(e) {
584
601
  previousItems: []
585
602
  })], c(), e.finishLoadPhase(), !0;
586
603
  } catch (t) {
587
- return Fe(t) || !e.getOperationIsCurrent(a) ? (e.finishLoadPhase(), !1) : (e.errorMessage.value = t instanceof Error ? t.message : "The viewer could not load items.", e.operationPhase.value = "failed", e.fillCollectedCount.value = null, e.fillCursor.value = null, e.fillTargetCount.value = null, !1);
604
+ return Ie(t) || !e.getOperationIsCurrent(a) ? (e.finishLoadPhase(), !1) : (e.errorMessage.value = t instanceof Error ? t.message : "The viewer could not load items.", e.operationPhase.value = "failed", e.fillCollectedCount.value = null, e.fillCursor.value = null, e.fillTargetCount.value = null, !1);
588
605
  } finally {
589
606
  e.clearActiveResolveController(s), e.inFlightCursors.delete(i);
590
607
  }
@@ -598,7 +615,7 @@ function Ze(e) {
598
615
  function l() {
599
616
  if (e.fillMode.value === "count") {
600
617
  let t = e.fillTargetCalls.value;
601
- e.fillProgress.value = t && t > 0 ? $e(e.fillCompletedCalls.value / t) : null;
618
+ e.fillProgress.value = t && t > 0 ? et(e.fillCompletedCalls.value / t) : null;
602
619
  return;
603
620
  }
604
621
  if (e.fillMode.value === "end") {
@@ -607,7 +624,7 @@ function Ze(e) {
607
624
  e.fillProgress.value = null;
608
625
  return;
609
626
  }
610
- e.fillProgress.value = t <= 0 ? 1 : $e(e.fillLoadedCount.value / t);
627
+ e.fillProgress.value = t <= 0 ? 1 : et(e.fillLoadedCount.value / t);
611
628
  return;
612
629
  }
613
630
  e.fillProgress.value = null;
@@ -621,13 +638,13 @@ function Ze(e) {
621
638
  fillUntilEnd: n
622
639
  };
623
640
  }
624
- function Qe(e) {
641
+ function $e(e) {
625
642
  return Number.isFinite(e) && e > 0 ? Math.floor(e) : 0;
626
643
  }
627
- function $e(e) {
644
+ function et(e) {
628
645
  return Math.min(Math.max(e, 0), 1);
629
646
  }
630
- function et(e, t, n, r) {
647
+ function tt(e, t, n, r) {
631
648
  return t === void 0 ? e : e.map((e) => e.cursor === t && e.nextCursor === n ? {
632
649
  ...e,
633
650
  nextCursor: r,
@@ -636,11 +653,11 @@ function et(e, t, n, r) {
636
653
  }
637
654
  //#endregion
638
655
  //#region src/components/viewer-core/autoResolveLoading.ts
639
- function tt(e) {
656
+ function nt(e) {
640
657
  async function t(t) {
641
658
  let n = e.getResolve(), r = e.getBoundaryBucket(t);
642
659
  if (!n || !r) return null;
643
- let i = ye(r.cursor);
660
+ let i = xe(r.cursor);
644
661
  if (e.inFlightCursors.has(i)) return null;
645
662
  e.inFlightCursors.add(i), e.errorMessage.value = null, e.operationPhase.value = "refreshing", e.clearFillState();
646
663
  let a = e.nextOperationId(), o = typeof AbortController > "u" ? null : new AbortController();
@@ -652,7 +669,7 @@ function tt(e) {
652
669
  signal: o?.signal
653
670
  });
654
671
  if (!e.getOperationIsCurrent(a)) return e.finishLoadPhase(), null;
655
- let s = Ye(r, i.nextPage), c = Le({
672
+ let s = Xe(r, i.nextPage), c = Re({
656
673
  cursor: r.cursor,
657
674
  nextCursor: s.cursor,
658
675
  nextCursorExhausted: s.exhausted,
@@ -663,12 +680,12 @@ function tt(e) {
663
680
  });
664
681
  e.setSequence(c.nextSequence);
665
682
  let l = e.getActiveOccurrenceKey();
666
- return e.autoBuckets.value = je(e.autoBuckets.value, r.cursor, c.bucket), e.syncActiveIndexAfterVisibilityChange(l), e.finishLoadPhase(), {
683
+ return e.autoBuckets.value = Me(e.autoBuckets.value, r.cursor, c.bucket), e.syncActiveIndexAfterVisibilityChange(l), e.finishLoadPhase(), {
667
684
  followCursor: t === "leading" ? i.previousPage ?? null : i.nextPage,
668
685
  itemsInserted: c.insertedCount
669
686
  };
670
687
  } catch (t) {
671
- return Fe(t) || !e.getOperationIsCurrent(a) ? (e.finishLoadPhase(), null) : (e.errorMessage.value = t instanceof Error ? t.message : "The viewer could not load items.", e.operationPhase.value = "failed", e.clearFillState(), null);
688
+ return Ie(t) || !e.getOperationIsCurrent(a) ? (e.finishLoadPhase(), null) : (e.errorMessage.value = t instanceof Error ? t.message : "The viewer could not load items.", e.operationPhase.value = "failed", e.clearFillState(), null);
672
689
  } finally {
673
690
  e.clearActiveResolveController(o), e.inFlightCursors.delete(i);
674
691
  }
@@ -678,9 +695,9 @@ function tt(e) {
678
695
  if (!n) return null;
679
696
  let r = e.nextOperationId(), i = /* @__PURE__ */ new Set(), a = [], o = t.cursor, s = 0;
680
697
  for (e.errorMessage.value = null, e.operationPhase.value = t.phase, e.clearFillState();;) {
681
- if (!e.getOperationIsCurrent(r)) return Re(a, t.direction, e.removedIds.value, !0);
682
- if (a.length > 0 && e.isManualPageLoadingLocked.value) return Re(a, t.direction, e.removedIds.value, !1);
683
- let c = ye(o);
698
+ if (!e.getOperationIsCurrent(r)) return ze(a, t.direction, e.removedIds.value, !0);
699
+ if (a.length > 0 && e.isManualPageLoadingLocked.value) return ze(a, t.direction, e.removedIds.value, !1);
700
+ let c = xe(o);
684
701
  if (i.has(c) || e.inFlightCursors.has(c)) break;
685
702
  i.add(c), e.inFlightCursors.add(c);
686
703
  let l = typeof AbortController > "u" ? null : new AbortController();
@@ -691,8 +708,8 @@ function tt(e) {
691
708
  pageSize: e.getPageSize(),
692
709
  signal: l?.signal
693
710
  });
694
- if (!e.getOperationIsCurrent(r)) return Re(a, t.direction, e.removedIds.value, !0);
695
- let c = Je(t.direction, o, i.nextPage), u = e.createBucket({
711
+ if (!e.getOperationIsCurrent(r)) return ze(a, t.direction, e.removedIds.value, !0);
712
+ let c = Ye(t.direction, o, i.nextPage), u = e.createBucket({
696
713
  cursor: o,
697
714
  nextCursor: c.cursor,
698
715
  nextCursorExhausted: c.exhausted,
@@ -701,18 +718,18 @@ function tt(e) {
701
718
  previousItems: []
702
719
  });
703
720
  a.push(u);
704
- let d = a.reduce((t, n) => t + ke(n, e.removedIds.value), 0), f = t.direction === "forward" ? u.nextCursorExhausted ? null : u.nextCursor : u.previousCursor;
705
- if (!t.continueUntilFilled || d >= e.getPageSize() || !f) return e.fillCursor.value = null, Re(a, t.direction, e.removedIds.value, !1);
706
- if (e.isManualPageLoadingLocked.value) return Re(a, t.direction, e.removedIds.value, !1);
707
- if (e.operationPhase.value = "filling", e.fillCollectedCount.value = d, e.fillCursor.value = f, e.fillTargetCount.value = e.getPageSize(), s += 1, await e.waitFillDelay(e.getFillDelayMs(s)), !e.getOperationIsCurrent(r)) return Re(a, t.direction, e.removedIds.value, !0);
721
+ let d = a.reduce((t, n) => t + Ae(n, e.removedIds.value), 0), f = t.direction === "forward" ? u.nextCursorExhausted ? null : u.nextCursor : u.previousCursor;
722
+ if (!t.continueUntilFilled || d >= e.getPageSize() || !f) return e.fillCursor.value = null, ze(a, t.direction, e.removedIds.value, !1);
723
+ if (e.isManualPageLoadingLocked.value) return ze(a, t.direction, e.removedIds.value, !1);
724
+ if (e.operationPhase.value = "filling", e.fillCollectedCount.value = d, e.fillCursor.value = f, e.fillTargetCount.value = e.getPageSize(), s += 1, await e.waitFillDelay(e.getFillDelayMs(s)), !e.getOperationIsCurrent(r)) return ze(a, t.direction, e.removedIds.value, !0);
708
725
  o = f;
709
726
  } catch (n) {
710
- return Fe(n) || !e.getOperationIsCurrent(r) ? Re(a, t.direction, e.removedIds.value, !0) : (e.errorMessage.value = n instanceof Error ? n.message : "The viewer could not load items.", e.operationPhase.value = "failed", e.clearFillState(), null);
727
+ return Ie(n) || !e.getOperationIsCurrent(r) ? ze(a, t.direction, e.removedIds.value, !0) : (e.errorMessage.value = n instanceof Error ? n.message : "The viewer could not load items.", e.operationPhase.value = "failed", e.clearFillState(), null);
711
728
  } finally {
712
729
  e.clearActiveResolveController(l), e.inFlightCursors.delete(c);
713
730
  }
714
731
  }
715
- return Re(a, t.direction, e.removedIds.value, !1);
732
+ return ze(a, t.direction, e.removedIds.value, !1);
716
733
  }
717
734
  return {
718
735
  collectBuckets: n,
@@ -721,7 +738,7 @@ function tt(e) {
721
738
  }
722
739
  //#endregion
723
740
  //#region src/components/viewer-core/fillProgress.ts
724
- function nt(e) {
741
+ function rt(e) {
725
742
  let t = {
726
743
  fillCompletedCalls: D(0),
727
744
  fillLoadedCount: D(0),
@@ -740,7 +757,7 @@ function nt(e) {
740
757
  }
741
758
  //#endregion
742
759
  //#region src/components/viewer-core/emptyVisiblePrefetch.ts
743
- function rt(e) {
760
+ function it(e) {
744
761
  let t = null, n = !1, r = !1;
745
762
  function i() {
746
763
  t = null;
@@ -782,14 +799,14 @@ function rt(e) {
782
799
  }
783
800
  //#endregion
784
801
  //#region src/components/viewer-core/fillDelay.ts
785
- var it = 2e3, at = 1e3, ot = 100;
786
- function st(e, t = it, n = at) {
802
+ var at = 2e3, ot = 1e3, st = 100;
803
+ function ct(e, t = at, n = ot) {
787
804
  return t + Math.max(0, e - 1) * n;
788
805
  }
789
- function ct(e, t) {
806
+ function lt(e, t) {
790
807
  return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
791
808
  }
792
- function lt() {
809
+ function ut() {
793
810
  let e = D(null), t = null, n = null, r = null;
794
811
  function i(i = !1) {
795
812
  if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
@@ -807,7 +824,7 @@ function lt() {
807
824
  let t = Math.max(0, a - (Date.now() - s));
808
825
  e.value = t, t <= 0 && l();
809
826
  };
810
- t = setInterval(u, ot), n = setTimeout(l, a), u();
827
+ t = setInterval(u, st), n = setTimeout(l, a), u();
811
828
  }));
812
829
  }
813
830
  return {
@@ -818,13 +835,13 @@ function lt() {
818
835
  }
819
836
  //#endregion
820
837
  //#region src/components/viewer-core/useAutoResolveSource.ts
821
- function ut(e) {
822
- let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d = lt(), f = d.remainingMs, p = D(null), m = D(!1), h = D(!0), g = D(!1), _ = D(!1), v = /* @__PURE__ */ new Set(), y = null, b = null, C = 0, w = 0, T = Ue({
838
+ function dt(e) {
839
+ let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d = ut(), f = d.remainingMs, p = D(null), m = D(!1), h = D(!0), g = D(!1), _ = D(!1), v = /* @__PURE__ */ new Set(), y = null, b = null, C = 0, w = 0, T = We({
823
840
  getSequence: () => w,
824
841
  setSequence: (e) => {
825
842
  w = e;
826
843
  }
827
- }), E = i(() => ct(e.fillDelayMs, it)), O = i(() => ct(e.fillDelayStepMs, at)), k = i(() => typeof e.resolve == "function"), A = i(() => ve(e.pageSize)), j = i(() => Ee(n.value)), M = nt(() => j.value.length), N = i(() => De(j.value, e.removedIds.value)), P = i(() => r.value), F = i(() => _e(c.value) || m.value), I = i(() => We(n.value, e.removedIds.value)), L = i(() => Ge(n.value, e.removedIds.value)), R = i(() => L.value?.nextCursor ?? null), ee = i(() => o.value ? null : I.value?.previousCursor ?? null), B = i(() => !!R.value && L.value?.nextCursorExhausted !== !0), V = i(() => !!ee.value), H = i(() => _.value || g.value), U = i(() => k.value && !!L.value?.items.length), te = i(() => De(Ee(a.value), e.removedIds.value)), W = i(() => Ae(n.value, e.removedIds.value, P.value)), G = i(() => !N.value.length && !F.value && !!s.value), K = Ze({
844
+ }), E = i(() => lt(e.fillDelayMs, at)), O = i(() => lt(e.fillDelayStepMs, ot)), k = i(() => typeof e.resolve == "function"), A = i(() => be(e.pageSize)), j = i(() => De(n.value)), M = rt(() => j.value.length), N = i(() => Oe(j.value, e.removedIds.value)), P = i(() => r.value), F = i(() => ye(c.value) || m.value), I = i(() => Ge(n.value, e.removedIds.value)), L = i(() => Ke(n.value, e.removedIds.value)), R = i(() => L.value?.nextCursor ?? null), ee = i(() => o.value ? null : I.value?.previousCursor ?? null), B = i(() => !!R.value && L.value?.nextCursorExhausted !== !0), V = i(() => !!ee.value), H = i(() => _.value || g.value), U = i(() => k.value && !!L.value?.items.length), te = i(() => Oe(De(a.value), e.removedIds.value)), W = i(() => je(n.value, e.removedIds.value, P.value)), G = i(() => !N.value.length && !F.value && !!s.value), ne = Qe({
828
845
  autoBuckets: n,
829
846
  clearActiveResolveController(e) {
830
847
  y === e && (y = null);
@@ -836,8 +853,8 @@ function ut(e) {
836
853
  fillCursor: u,
837
854
  fillTargetCount: p,
838
855
  ...M.refs,
839
- finishLoadPhase: Se,
840
- getFillDelayMs: (e) => st(e, E.value, O.value),
856
+ finishLoadPhase: Q,
857
+ getFillDelayMs: (e) => ct(e, E.value, O.value),
841
858
  getHasNextPage: () => B.value,
842
859
  getIsLoading: () => F.value,
843
860
  getIsManualPageLoadingLocked: () => _.value,
@@ -861,17 +878,17 @@ function ut(e) {
861
878
  b = e;
862
879
  },
863
880
  waitFillDelay: (e) => d.wait(e)
864
- }), q = rt({
881
+ }), K = it({
865
882
  canRefreshTrailingBoundary: U,
866
883
  hasNextPage: B,
867
884
  isInitialLoading: Te,
868
885
  isPageLoadingLocked: H,
869
886
  items: N,
870
887
  loading: F,
871
- prefetchNextPage: Y,
888
+ prefetchNextPage: J,
872
889
  removedIds: e.removedIds,
873
890
  trailingBoundaryBucket: L
874
- }), J = tt({
891
+ }), q = nt({
875
892
  autoBuckets: n,
876
893
  clearActiveResolveController(e) {
877
894
  y === e && (y = null);
@@ -882,10 +899,10 @@ function ut(e) {
882
899
  fillCollectedCount: l,
883
900
  fillCursor: u,
884
901
  fillTargetCount: p,
885
- finishLoadPhase: Se,
886
- getActiveOccurrenceKey: fe,
902
+ finishLoadPhase: Q,
903
+ getActiveOccurrenceKey: pe,
887
904
  getBoundaryBucket: (e) => e === "leading" ? I.value : L.value,
888
- getFillDelayMs: (e) => st(e, E.value, O.value),
905
+ getFillDelayMs: (e) => ct(e, E.value, O.value),
889
906
  getOperationIsCurrent: (e) => e === C,
890
907
  getPageSize: () => A.value,
891
908
  getResolve: () => e.resolve,
@@ -901,115 +918,115 @@ function ut(e) {
901
918
  setSequence: (e) => {
902
919
  w = e;
903
920
  },
904
- syncActiveIndexAfterVisibilityChange: pe,
921
+ syncActiveIndexAfterVisibilityChange: me,
905
922
  waitFillDelay: (e) => d.wait(e)
906
923
  });
907
924
  z(() => N.value.length, (e) => {
908
925
  if (e === 0) {
909
- r.value = 0, q.schedule();
926
+ r.value = 0, K.schedule();
910
927
  return;
911
928
  }
912
- q.resetRefreshAttempt(), o.value &&= (ke(), !1), r.value > e - 1 && (r.value = e - 1);
929
+ K.resetRefreshAttempt(), o.value &&= (ke(), !1), r.value > e - 1 && (r.value = e - 1);
913
930
  }), z(() => r.value, () => {
914
- h.value && he();
931
+ h.value && ge();
915
932
  }), S(() => {
916
- we() || e.resolve && ne();
933
+ we() || e.resolve && re();
917
934
  }), x(() => {
918
935
  y?.abort(), y = null, d.clear(!0);
919
936
  });
920
- async function ne() {
921
- b = ne;
937
+ async function re() {
938
+ b = re;
922
939
  let t = await xe({
923
940
  continueUntilFilled: !0,
924
941
  cursor: e.initialCursor ?? null,
925
942
  direction: "forward",
926
943
  phase: "initializing"
927
944
  });
928
- t && (n.value = t.buckets, r.value = 0, Se());
945
+ t && (n.value = t.buckets, r.value = 0, Q());
929
946
  }
930
- async function Y() {
947
+ async function J() {
931
948
  if (H.value || F.value) return;
932
949
  let e = !N.value.length, t = L.value, n = {
933
950
  commitImmediately: e,
934
951
  originCursor: t?.cursor ?? null
935
- }, r = Ke(t);
936
- if (Oe("trailing")) {
952
+ }, r = qe(t);
953
+ if (Ee("trailing")) {
937
954
  if (!U.value) return;
938
- let e = await ye("trailing");
939
- e?.followCursor && (e.itemsInserted === 0 || Oe("trailing")) && await ge(e.followCursor, n);
955
+ let e = await Z("trailing");
956
+ e?.followCursor && (e.itemsInserted === 0 || Ee("trailing")) && await _e(e.followCursor, n);
940
957
  return;
941
958
  }
942
959
  if (r) {
943
960
  if (t?.cursor === r) {
944
- let e = await ye("trailing");
945
- e?.followCursor && e.itemsInserted === 0 && await ge(e.followCursor, n);
961
+ let e = await Z("trailing");
962
+ e?.followCursor && e.itemsInserted === 0 && await _e(e.followCursor, n);
946
963
  return;
947
964
  }
948
- await ge(r, n);
965
+ await _e(r, n);
949
966
  return;
950
967
  }
951
968
  if (!B.value) {
952
- let e = U.value ? await ye("trailing") : null;
953
- e?.followCursor && e.itemsInserted === 0 && await ge(e.followCursor, n);
969
+ let e = U.value ? await Z("trailing") : null;
970
+ e?.followCursor && e.itemsInserted === 0 && await _e(e.followCursor, n);
954
971
  return;
955
972
  }
956
- await ge(R.value, n);
973
+ await _e(R.value, n);
957
974
  }
958
- async function X() {
975
+ async function Y() {
959
976
  if (!(H.value || !V.value || F.value)) {
960
- if (Oe("leading")) {
961
- let e = await ye("leading");
962
- e?.itemsInserted === 0 && e.followCursor && await Q(e.followCursor);
977
+ if (Ee("leading")) {
978
+ let e = await Z("leading");
979
+ e?.itemsInserted === 0 && e.followCursor && await ve(e.followCursor);
963
980
  return;
964
981
  }
965
- await Q(ee.value);
982
+ await ve(ee.value);
966
983
  }
967
984
  }
968
- async function re() {
985
+ async function ie() {
969
986
  if (G.value) {
970
987
  if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = k.value ? "initializing" : "idle", Ce(), M.reset(), m.value = !1, v.clear(), y?.abort(), y = null, d.clear(!0), we()) {
971
- Se();
988
+ Q();
972
989
  return;
973
990
  }
974
- await ne();
991
+ await re();
975
992
  }
976
993
  }
977
- async function ie() {
978
- if (G.value) return re();
994
+ async function ae() {
995
+ if (G.value) return ie();
979
996
  H.value || c.value !== "failed" || !b || (s.value = null, await b());
980
997
  }
981
- async function ae() {
982
- if (!a.value.length) return m.value = !1, Se();
983
- n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Se();
998
+ async function oe() {
999
+ if (!a.value.length) return m.value = !1, Q();
1000
+ n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Q();
984
1001
  }
985
- function Z(t) {
1002
+ function se(t) {
986
1003
  let n = N.value;
987
1004
  if (!n.length) return;
988
- let i = be(t, 0, n.length - 1);
1005
+ let i = Se(t, 0, n.length - 1);
989
1006
  i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
990
1007
  }
991
- function oe(e) {
992
- h.value = e, q.schedule();
1008
+ function ce(e) {
1009
+ h.value = e, K.schedule();
993
1010
  }
994
- function se() {
1011
+ function X() {
995
1012
  _.value = !0, d.clear(!0);
996
1013
  }
997
- function ce() {
998
- _.value = !1, q.schedule();
999
- }
1000
1014
  function le() {
1001
- de(), s.value = null, Ce(), K.cancel(), a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), m.value = !1, o.value = !1, Se();
1015
+ _.value = !1, K.schedule();
1002
1016
  }
1003
1017
  function ue() {
1004
- g.value && (de(), Ce(), K.cancel(), m.value = !1, Se());
1018
+ fe(), s.value = null, Ce(), ne.cancel(), a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), m.value = !1, o.value = !1, Q();
1005
1019
  }
1006
1020
  function de() {
1007
- C += 1, y?.abort(), y = null, d.clear(!0), v.clear();
1021
+ g.value && (fe(), Ce(), ne.cancel(), m.value = !1, Q());
1008
1022
  }
1009
1023
  function fe() {
1010
- return Be(N.value, P.value);
1024
+ C += 1, y?.abort(), y = null, d.clear(!0), v.clear();
1025
+ }
1026
+ function pe() {
1027
+ return Ve(N.value, P.value);
1011
1028
  }
1012
- function pe(e = null, t = {}) {
1029
+ function me(e = null, t = {}) {
1013
1030
  if (N.value.length === 0) {
1014
1031
  r.value = 0, !t.preserveTrailingPlaceholder && n.value.length > 0 && (o.value = !0);
1015
1032
  return;
@@ -1025,23 +1042,23 @@ function ut(e) {
1025
1042
  r.value = N.value.length;
1026
1043
  return;
1027
1044
  }
1028
- r.value = Ve(N.value, P.value, e);
1045
+ r.value = He(N.value, P.value, e);
1029
1046
  }
1030
- function me() {
1031
- a.value.length > 0 && (!te.value.length || !N.value.length) && ae();
1047
+ function he() {
1048
+ a.value.length > 0 && (!te.value.length || !N.value.length) && oe();
1032
1049
  }
1033
- async function he() {
1050
+ async function ge() {
1034
1051
  if (!(!h.value || Te())) {
1035
1052
  if (!N.value.length) {
1036
- (B.value || U.value) && await Y();
1053
+ (B.value || U.value) && await J();
1037
1054
  return;
1038
1055
  }
1039
- V.value && r.value < 3 && await X(), B.value && r.value >= N.value.length - 3 && await Y();
1056
+ V.value && r.value < 3 && await Y(), B.value && r.value >= N.value.length - 3 && await J();
1040
1057
  }
1041
1058
  }
1042
- async function ge(e, t = {}) {
1059
+ async function _e(e, t = {}) {
1043
1060
  b = async () => {
1044
- await ge(e, t);
1061
+ await _e(e, t);
1045
1062
  };
1046
1063
  let r = await xe({
1047
1064
  continueUntilFilled: !0,
@@ -1050,15 +1067,15 @@ function ut(e) {
1050
1067
  phase: "loading"
1051
1068
  });
1052
1069
  if (r) {
1053
- if (!r.visibleCount) return n.value = qe(n.value, t.originCursor, e, !0), a.value = [], m.value = !1, Se();
1054
- if (r.canceled) return n.value = [...n.value, ...r.buckets], a.value = [], m.value = !1, Se();
1055
- if (a.value = r.buckets, t.commitImmediately || !N.value.length || !te.value.length) return n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Se();
1070
+ if (!r.visibleCount) return n.value = Je(n.value, t.originCursor, e, !0), a.value = [], m.value = !1, Q();
1071
+ if (r.canceled) return n.value = [...n.value, ...r.buckets], a.value = [], m.value = !1, Q();
1072
+ if (a.value = r.buckets, t.commitImmediately || !N.value.length || !te.value.length) return n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Q();
1056
1073
  m.value = !0;
1057
1074
  }
1058
1075
  }
1059
- async function Q(e) {
1076
+ async function ve(e) {
1060
1077
  b = async () => {
1061
- await Q(e);
1078
+ await ve(e);
1062
1079
  };
1063
1080
  let t = await xe({
1064
1081
  continueUntilFilled: !0,
@@ -1067,26 +1084,26 @@ function ut(e) {
1067
1084
  phase: "loading"
1068
1085
  });
1069
1086
  if (!t) return;
1070
- let r = fe();
1071
- n.value = [...t.buckets, ...n.value], pe(r), Se();
1087
+ let r = pe();
1088
+ n.value = [...t.buckets, ...n.value], me(r), Q();
1072
1089
  }
1073
- async function ye(e) {
1090
+ async function Z(e) {
1074
1091
  return b = async () => {
1075
- await ye(e);
1076
- }, J.reloadBoundaryBucket(e);
1092
+ await Z(e);
1093
+ }, q.reloadBoundaryBucket(e);
1077
1094
  }
1078
1095
  function xe(e) {
1079
- return J.collectBuckets(e);
1096
+ return q.collectBuckets(e);
1080
1097
  }
1081
- function Se() {
1082
- c.value = "idle", Ce(), d.clear(), q.schedule();
1098
+ function Q() {
1099
+ c.value = "idle", Ce(), d.clear(), K.schedule();
1083
1100
  }
1084
1101
  function Ce() {
1085
1102
  l.value = null, u.value = null, p.value = null;
1086
1103
  }
1087
1104
  function we() {
1088
1105
  if (!e.initialState || !e.initialState.items.length) return !1;
1089
- let t = ze({
1106
+ let t = Be({
1090
1107
  initialState: e.initialState,
1091
1108
  removedIds: e.removedIds.value,
1092
1109
  sequence: w
@@ -1096,19 +1113,19 @@ function ut(e) {
1096
1113
  function Te() {
1097
1114
  return c.value === "initializing";
1098
1115
  }
1099
- function Oe(t) {
1100
- return He(t === "leading" ? I.value : L.value, e.removedIds.value, A.value);
1116
+ function Ee(t) {
1117
+ return Ue(t === "leading" ? I.value : L.value, e.removedIds.value, A.value);
1101
1118
  }
1102
1119
  function ke() {
1103
- n.value = Xe(n.value, e.removedIds.value);
1120
+ n.value = Ze(n.value, e.removedIds.value);
1104
1121
  }
1105
1122
  return {
1106
1123
  activeIndex: P,
1107
1124
  canRetryInitialLoad: G,
1108
- cancel: le,
1109
- cancelFill: ue,
1125
+ cancel: ue,
1126
+ cancelFill: de,
1110
1127
  canRefreshTrailingBoundary: U,
1111
- commitPendingAppend: ae,
1128
+ commitPendingAppend: oe,
1112
1129
  currentCursor: W,
1113
1130
  errorMessage: s,
1114
1131
  fillCollectedCount: l,
@@ -1116,36 +1133,36 @@ function ut(e) {
1116
1133
  fillDelayRemainingMs: f,
1117
1134
  fillTargetCount: p,
1118
1135
  ...M.refs,
1119
- fillUntil: K.fillUntil,
1120
- fillUntilEnd: K.fillUntilEnd,
1136
+ fillUntil: ne.fillUntil,
1137
+ fillUntilEnd: ne.fillUntilEnd,
1121
1138
  hasNextPage: B,
1122
1139
  hasPreviousPage: V,
1123
1140
  isAutoPrefetchEnabled: h,
1124
1141
  isPageLoadingLocked: H,
1125
1142
  items: N,
1126
- lockPageLoading: se,
1143
+ lockPageLoading: X,
1127
1144
  loading: F,
1128
- maybePrefetchAround: he,
1145
+ maybePrefetchAround: ge,
1129
1146
  nextCursor: R,
1130
1147
  pendingAppendItems: te,
1131
1148
  phase: c,
1132
- prefetchNextPage: Y,
1133
- prefetchPreviousPage: X,
1149
+ prefetchNextPage: J,
1150
+ prefetchPreviousPage: Y,
1134
1151
  previousCursor: ee,
1135
- retryInitialLoad: re,
1136
- retry: ie,
1137
- setActiveIndex: Z,
1138
- setAutoPrefetchEnabled: oe,
1139
- syncActiveIndexAfterVisibilityChange: pe,
1140
- unlockPageLoading: ce,
1141
- getActiveOccurrenceKey: fe,
1142
- maybeCommitPendingAppendWhenFilteredOut: me
1152
+ retryInitialLoad: ie,
1153
+ retry: ae,
1154
+ setActiveIndex: se,
1155
+ setAutoPrefetchEnabled: ce,
1156
+ syncActiveIndexAfterVisibilityChange: me,
1157
+ unlockPageLoading: le,
1158
+ getActiveOccurrenceKey: pe,
1159
+ maybeCommitPendingAppendWhenFilteredOut: he
1143
1160
  };
1144
1161
  }
1145
1162
  //#endregion
1146
1163
  //#region src/components/viewer-core/useDataSource.ts
1147
- function dt(e, t) {
1148
- let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = we(), l = ut({
1164
+ function ft(e, t) {
1165
+ let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = Te(), l = dt({
1149
1166
  emit: t,
1150
1167
  fillDelayMs: e.fillDelayMs,
1151
1168
  fillDelayStepMs: e.fillDelayStepMs,
@@ -1252,9 +1269,9 @@ function dt(e, t) {
1252
1269
  }
1253
1270
  //#endregion
1254
1271
  //#region src/components/viewer-core/useController.ts
1255
- var ft = 1024;
1256
- function pt(e, t) {
1257
- let n = dt(e, t), r = T({
1272
+ var pt = 1024;
1273
+ function mt(e, t) {
1274
+ let n = ft(e, t), r = T({
1258
1275
  nextBoundaryLoadProgress: 0,
1259
1276
  previousBoundaryLoadProgress: 0
1260
1277
  }), a = D(0), o = D("list"), s = T({
@@ -1284,7 +1301,7 @@ function pt(e, t) {
1284
1301
  removedCount: 0,
1285
1302
  removedIds: [],
1286
1303
  surfaceMode: "list"
1287
- }), c = i(() => a.value >= ft), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
1304
+ }), c = i(() => a.value >= pt), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
1288
1305
  z(c, (e) => {
1289
1306
  e && h();
1290
1307
  }), z(() => e.surfaceMode, () => {
@@ -1314,7 +1331,7 @@ function pt(e, t) {
1314
1331
  !c.value || o.value === "list" || (o.value = "list", t("update:surfaceMode", "list"));
1315
1332
  }
1316
1333
  function p(e) {
1317
- e.defaultPrevented || e.key !== "Escape" || !c.value || l.value !== "fullscreen" || ge(e.target) || (e.preventDefault(), f());
1334
+ e.defaultPrevented || e.key !== "Escape" || !c.value || l.value !== "fullscreen" || ve(e.target) || (e.preventDefault(), f());
1318
1335
  }
1319
1336
  function m() {
1320
1337
  a.value = window.innerWidth || 0;
@@ -1323,7 +1340,7 @@ function pt(e, t) {
1323
1340
  !c.value || !e.surfaceMode || e.surfaceMode === o.value || (o.value = e.surfaceMode);
1324
1341
  }
1325
1342
  function g(e) {
1326
- r.nextBoundaryLoadProgress = mt(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = mt(e.previousBoundaryLoadProgress);
1343
+ r.nextBoundaryLoadProgress = ht(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = ht(e.previousBoundaryLoadProgress);
1327
1344
  }
1328
1345
  return {
1329
1346
  ...n,
@@ -1342,26 +1359,26 @@ function pt(e, t) {
1342
1359
  unlockPageLoading: n.unlockPageLoading
1343
1360
  };
1344
1361
  }
1345
- function mt(e) {
1362
+ function ht(e) {
1346
1363
  return Math.min(Math.max(e, 0), 1);
1347
1364
  }
1348
1365
  //#endregion
1349
1366
  //#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
1350
- var ht = {
1367
+ var gt = {
1351
1368
  "data-testid": "vibe-media-bar",
1352
1369
  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]"
1353
- }, gt = { 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]" }, _t = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, vt = { class: "relative h-4 w-full" }, yt = [
1370
+ }, _t = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, vt = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, yt = { class: "relative h-4 w-full" }, bt = [
1354
1371
  "max",
1355
1372
  "value",
1356
1373
  "disabled"
1357
- ], bt = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, xt = ["data-layout"], St = {
1374
+ ], xt = { class: "flex items-center justify-end gap-3" }, St = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ct = ["data-layout"], wt = {
1358
1375
  key: 0,
1359
1376
  "data-testid": "vibe-media-volume-popover",
1360
1377
  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]"
1361
- }, Ct = { class: "relative flex h-28 w-4 items-center justify-center" }, wt = ["value"], Tt = { class: "flex items-center gap-3" }, Et = ["aria-label"], Dt = {
1378
+ }, Tt = { class: "relative flex h-28 w-4 items-center justify-center" }, Et = ["value"], Dt = { class: "flex items-center gap-3" }, Ot = ["aria-label"], kt = {
1362
1379
  key: 0,
1363
1380
  class: "relative h-4 w-24"
1364
- }, Ot = ["value"], kt = /* @__PURE__ */ d({
1381
+ }, At = ["value"], jt = /* @__PURE__ */ d({
1365
1382
  __name: "FullscreenMediaBar",
1366
1383
  props: {
1367
1384
  currentTime: {},
@@ -1370,44 +1387,49 @@ var ht = {
1370
1387
  durationLabel: {},
1371
1388
  muted: { type: Boolean },
1372
1389
  progress: {},
1390
+ showFullscreenControl: {
1391
+ type: Boolean,
1392
+ default: !1
1393
+ },
1373
1394
  volume: {},
1374
1395
  volumeControlLayout: {}
1375
1396
  },
1376
1397
  emits: [
1398
+ "fullscreen-request",
1377
1399
  "seek-input",
1378
1400
  "volume-input",
1379
1401
  "volume-toggle"
1380
1402
  ],
1381
1403
  setup(e, { emit: t }) {
1382
- let n = e, r = t, l = D(null), u = D(!1), d = i(() => n.volumeControlLayout === "vertical"), f = i(() => C(n.volume, 0, 1)), p = i(() => Math.round(f.value * 100)), m = i(() => n.muted || f.value <= 0 ? fe : f.value < .5 ? ue : de), 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}%` });
1383
- z(d, (e) => {
1384
- e || (u.value = !1);
1404
+ let n = e, r = t, l = D(null), d = D(!1), f = i(() => n.volumeControlLayout === "vertical"), p = i(() => T(n.volume, 0, 1)), m = i(() => Math.round(p.value * 100)), h = i(() => n.muted || p.value <= 0 ? me : p.value < .5 ? fe : pe), g = i(() => n.muted || p.value <= 0 ? "Unmute active media" : "Mute active media"), _ = i(() => f.value && !d.value ? "Show volume controls" : g.value), v = i(() => n.volumeControlLayout === "vertical" ? { height: `${m.value}%` } : { width: `${m.value}%` });
1405
+ z(f, (e) => {
1406
+ e || (d.value = !1);
1385
1407
  }), S(() => {
1386
- document.addEventListener("pointerdown", v);
1408
+ document.addEventListener("pointerdown", y);
1387
1409
  }), x(() => {
1388
- document.removeEventListener("pointerdown", v);
1410
+ document.removeEventListener("pointerdown", y);
1389
1411
  });
1390
- function v(e) {
1391
- !d.value || !u.value || l.value && e.target instanceof Node && !l.value.contains(e.target) && (u.value = !1);
1412
+ function y(e) {
1413
+ !f.value || !d.value || l.value && e.target instanceof Node && !l.value.contains(e.target) && (d.value = !1);
1392
1414
  }
1393
- function y() {
1394
- if (!d.value) {
1415
+ function C() {
1416
+ if (!f.value) {
1395
1417
  r("volume-toggle");
1396
1418
  return;
1397
1419
  }
1398
- if (!u.value) {
1399
- u.value = !0;
1420
+ if (!d.value) {
1421
+ d.value = !0;
1400
1422
  return;
1401
1423
  }
1402
1424
  r("volume-toggle");
1403
1425
  }
1404
- function C(e, t, n) {
1426
+ function T(e, t, n) {
1405
1427
  return Math.min(Math.max(e, t), n);
1406
1428
  }
1407
- return (e, t) => (w(), s("div", ht, [c("div", gt, [
1408
- c("span", _t, M(n.currentTimeLabel), 1),
1409
- c("div", vt, [
1410
- t[3] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
1429
+ return (e, t) => (w(), s("div", gt, [c("div", _t, [
1430
+ c("span", vt, M(n.currentTimeLabel), 1),
1431
+ c("div", yt, [
1432
+ t[4] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
1411
1433
  c("div", {
1412
1434
  class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
1413
1435
  style: b({ width: `${n.progress}%` })
@@ -1423,77 +1445,90 @@ var ht = {
1423
1445
  disabled: n.duration <= 0,
1424
1446
  class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
1425
1447
  onInput: t[0] ||= (e) => r("seek-input", e)
1426
- }, null, 40, yt)
1448
+ }, null, 40, bt)
1427
1449
  ]),
1428
- c("span", bt, M(n.durationLabel), 1),
1429
- c("div", {
1430
- ref_key: "rootRef",
1431
- ref: l,
1432
- "data-testid": "vibe-media-volume",
1433
- "data-layout": n.volumeControlLayout,
1434
- class: "relative flex items-center justify-end"
1435
- }, [d.value && u.value ? (w(), s("div", St, [c("div", Ct, [
1436
- t[4] ||= c("div", { class: "absolute bottom-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/12" }, null, -1),
1437
- c("div", {
1438
- class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
1439
- style: b(_.value)
1440
- }, null, 4),
1441
- c("input", {
1442
- "data-testid": "vibe-media-volume-slider",
1443
- "data-swipe-lock": "true",
1444
- type: "range",
1445
- "aria-label": "Adjust active media volume",
1446
- min: "0",
1447
- max: "1",
1448
- step: "0.05",
1449
- value: f.value,
1450
- 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",
1451
- onInput: t[1] ||= (e) => r("volume-input", e)
1452
- }, null, 40, wt)
1453
- ])])) : o("", !0), c("div", Tt, [c("button", {
1454
- type: "button",
1455
- "data-testid": "vibe-media-volume-button",
1456
- "aria-label": g.value,
1457
- 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",
1458
- onClick: y
1459
- }, [(w(), a(A(m.value), {
1460
- class: "h-4 w-4 stroke-[1.9]",
1461
- "aria-hidden": "true"
1462
- }))], 8, Et), n.volumeControlLayout === "horizontal" ? (w(), s("div", Dt, [
1463
- t[5] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
1450
+ c("div", xt, [
1451
+ c("span", St, M(n.durationLabel), 1),
1452
+ n.showFullscreenControl ? (w(), s("button", {
1453
+ key: 0,
1454
+ type: "button",
1455
+ "data-testid": "vibe-media-fullscreen-button",
1456
+ 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",
1457
+ "aria-label": "Open active video fullscreen",
1458
+ onClick: t[1] ||= (e) => r("fullscreen-request")
1459
+ }, [u(F(X), {
1460
+ class: "h-4 w-4 stroke-[1.9]",
1461
+ "aria-hidden": "true"
1462
+ })])) : o("", !0),
1464
1463
  c("div", {
1465
- class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
1466
- style: b(_.value)
1467
- }, null, 4),
1468
- c("input", {
1469
- "data-testid": "vibe-media-volume-slider",
1470
- "data-swipe-lock": "true",
1471
- type: "range",
1472
- "aria-label": "Adjust active media volume",
1473
- min: "0",
1474
- max: "1",
1475
- step: "0.05",
1476
- value: f.value,
1477
- class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
1478
- onInput: t[2] ||= (e) => r("volume-input", e)
1479
- }, null, 40, Ot)
1480
- ])) : o("", !0)])], 8, xt)
1464
+ ref_key: "rootRef",
1465
+ ref: l,
1466
+ "data-testid": "vibe-media-volume",
1467
+ "data-layout": n.volumeControlLayout,
1468
+ class: "relative flex items-center justify-end"
1469
+ }, [f.value && d.value ? (w(), s("div", wt, [c("div", Tt, [
1470
+ t[5] ||= c("div", { class: "absolute bottom-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/12" }, null, -1),
1471
+ c("div", {
1472
+ class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
1473
+ style: b(v.value)
1474
+ }, null, 4),
1475
+ c("input", {
1476
+ "data-testid": "vibe-media-volume-slider",
1477
+ "data-swipe-lock": "true",
1478
+ type: "range",
1479
+ "aria-label": "Adjust active media volume",
1480
+ min: "0",
1481
+ max: "1",
1482
+ step: "0.05",
1483
+ value: p.value,
1484
+ 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",
1485
+ onInput: t[2] ||= (e) => r("volume-input", e)
1486
+ }, null, 40, Et)
1487
+ ])])) : o("", !0), c("div", Dt, [c("button", {
1488
+ type: "button",
1489
+ "data-testid": "vibe-media-volume-button",
1490
+ "aria-label": _.value,
1491
+ 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",
1492
+ onClick: C
1493
+ }, [(w(), a(A(h.value), {
1494
+ class: "h-4 w-4 stroke-[1.9]",
1495
+ "aria-hidden": "true"
1496
+ }))], 8, Ot), n.volumeControlLayout === "horizontal" ? (w(), s("div", kt, [
1497
+ t[6] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
1498
+ c("div", {
1499
+ class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
1500
+ style: b(v.value)
1501
+ }, null, 4),
1502
+ c("input", {
1503
+ "data-testid": "vibe-media-volume-slider",
1504
+ "data-swipe-lock": "true",
1505
+ type: "range",
1506
+ "aria-label": "Adjust active media volume",
1507
+ min: "0",
1508
+ max: "1",
1509
+ step: "0.05",
1510
+ value: p.value,
1511
+ class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
1512
+ onInput: t[3] ||= (e) => r("volume-input", e)
1513
+ }, null, 40, At)
1514
+ ])) : o("", !0)])], 8, Ct)
1515
+ ])
1481
1516
  ])]));
1482
1517
  }
1483
- }), At = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, jt = { class: "grid gap-4" }, Mt = { class: "flex min-h-11 items-center justify-between gap-4" }, Nt = { class: "min-w-0 flex flex-1 items-center gap-3" }, Pt = {
1518
+ }), Mt = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, Nt = { class: "grid gap-4" }, Pt = { class: "flex min-h-11 items-center justify-between gap-4" }, Ft = { class: "min-w-0 flex flex-1 items-center gap-3" }, It = {
1484
1519
  key: 1,
1485
1520
  "data-testid": "vibe-title",
1486
1521
  class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
1487
- }, Ft = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, It = {
1522
+ }, Lt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, Rt = {
1488
1523
  "data-testid": "vibe-pagination",
1489
1524
  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]"
1490
- }, Lt = { class: "whitespace-nowrap" }, Rt = {
1525
+ }, zt = { class: "whitespace-nowrap" }, Bt = {
1491
1526
  key: 1,
1492
1527
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
1493
- }, zt = {
1528
+ }, Vt = {
1494
1529
  key: 0,
1495
1530
  class: "grid gap-2 max-[720px]:justify-items-start"
1496
- }, Bt = /* @__PURE__ */ d({
1531
+ }, Ht = /* @__PURE__ */ d({
1497
1532
  __name: "FullscreenHeader",
1498
1533
  props: {
1499
1534
  currentIndex: {},
@@ -1507,47 +1542,47 @@ var ht = {
1507
1542
  emits: ["back-to-list"],
1508
1543
  setup(e, { emit: t }) {
1509
1544
  let n = e, r = t;
1510
- return (e, t) => (w(), s("div", At, [c("div", jt, [c("div", Mt, [c("div", Nt, [n.showBackToList ? (w(), s("button", {
1545
+ return (e, t) => (w(), s("div", Mt, [c("div", Nt, [c("div", Pt, [c("div", Ft, [n.showBackToList ? (w(), s("button", {
1511
1546
  key: 0,
1512
1547
  type: "button",
1513
1548
  "data-testid": "vibe-back-to-list",
1514
1549
  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",
1515
1550
  "aria-label": "Back to list",
1516
1551
  onClick: t[0] ||= (e) => r("back-to-list")
1517
- }, [u(F(X), {
1552
+ }, [u(F(Y), {
1518
1553
  class: "h-4 w-4 stroke-[2.2]",
1519
1554
  "aria-hidden": "true"
1520
- })])) : o("", !0), n.title ? (w(), s("h2", Pt, M(n.title), 1)) : o("", !0)]), c("div", Ft, [c("span", It, [
1521
- n.loading ? (w(), a(F(oe), {
1555
+ })])) : o("", !0), n.title ? (w(), s("h2", It, M(n.title), 1)) : o("", !0)]), c("div", Lt, [c("span", Rt, [
1556
+ n.loading ? (w(), a(F(ce), {
1522
1557
  key: 0,
1523
1558
  "data-testid": "vibe-pagination-spinner",
1524
1559
  class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
1525
1560
  "aria-hidden": "true"
1526
1561
  })) : o("", !0),
1527
- c("span", Lt, M(n.currentIndex + 1) + " / " + M(n.total), 1),
1528
- n.paginationDetail ? (w(), s("span", Rt, M(n.paginationDetail), 1)) : o("", !0)
1529
- ]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div", zt, [...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)]));
1530
- }
1531
- }), Vt = {
1532
- image: Z,
1533
- video: ie,
1534
- audio: re,
1535
- other: ae
1536
- }, Ht = {
1562
+ c("span", zt, M(n.currentIndex + 1) + " / " + M(n.total), 1),
1563
+ n.paginationDetail ? (w(), s("span", Bt, M(n.paginationDetail), 1)) : o("", !0)
1564
+ ]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), 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)]));
1565
+ }
1566
+ }), Ut = {
1567
+ image: se,
1568
+ video: ae,
1569
+ audio: ie,
1570
+ other: oe
1571
+ }, Wt = {
1537
1572
  image: "Image",
1538
1573
  video: "Video",
1539
1574
  audio: "Audio",
1540
1575
  other: "File"
1541
1576
  };
1542
- function Ut(e) {
1543
- return Vt[e];
1577
+ function Gt(e) {
1578
+ return Ut[e];
1544
1579
  }
1545
- function Wt(e) {
1546
- return Ht[e];
1580
+ function Kt(e) {
1581
+ return Wt[e];
1547
1582
  }
1548
1583
  //#endregion
1549
1584
  //#region src/components/viewer-core/useAssetLoadQueue.ts
1550
- function Gt() {
1585
+ function qt() {
1551
1586
  let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = 0;
1552
1587
  function r(r) {
1553
1588
  let a = {
@@ -1570,7 +1605,7 @@ function Gt() {
1570
1605
  function i() {
1571
1606
  if (t.size === 0) return;
1572
1607
  let n = [...t.values()].sort((e, t) => {
1573
- let n = qt(e) - qt(t);
1608
+ let n = Yt(e) - Yt(t);
1574
1609
  return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
1575
1610
  });
1576
1611
  for (let r of n) {
@@ -1584,8 +1619,8 @@ function Gt() {
1584
1619
  }
1585
1620
  return { request: r };
1586
1621
  }
1587
- var Kt = Gt();
1588
- function qt(e) {
1622
+ var Jt = qt();
1623
+ function Yt(e) {
1589
1624
  try {
1590
1625
  let t = e.getPriority();
1591
1626
  return Number.isFinite(t) ? t : Infinity;
@@ -1595,19 +1630,19 @@ function qt(e) {
1595
1630
  }
1596
1631
  //#endregion
1597
1632
  //#region src/components/viewer-core/useFullscreenPreloadController.ts
1598
- var Jt = [
1633
+ var Xt = [
1599
1634
  0,
1600
1635
  1,
1601
1636
  2,
1602
1637
  3
1603
- ], Yt = {
1638
+ ], Zt = {
1604
1639
  0: 0,
1605
1640
  1: 1,
1606
1641
  2: 2,
1607
1642
  3: 3
1608
1643
  };
1609
- function Xt(e) {
1610
- let t = D({}), n = Gt(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
1644
+ function Qt(e) {
1645
+ let t = D({}), n = qt(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
1611
1646
  z([
1612
1647
  e.active,
1613
1648
  e.items,
@@ -1628,14 +1663,14 @@ function Xt(e) {
1628
1663
  }
1629
1664
  function l(e, t) {
1630
1665
  if (t instanceof HTMLImageElement) {
1631
- i.set(e, t), Qt(t) && d(e);
1666
+ i.set(e, t), en(t) && d(e);
1632
1667
  return;
1633
1668
  }
1634
1669
  i.delete(e);
1635
1670
  }
1636
1671
  function u(e, t) {
1637
1672
  if (t instanceof HTMLMediaElement) {
1638
- a.set(e, t), $t(t) && d(e);
1673
+ a.set(e, t), tn(t) && d(e);
1639
1674
  return;
1640
1675
  }
1641
1676
  a.delete(e);
@@ -1676,7 +1711,7 @@ function Xt(e) {
1676
1711
  assetType: s.item.type === "image" ? "image" : "video",
1677
1712
  getPriority: () => g(o.index),
1678
1713
  onGrant: () => {
1679
- y(s.key, !0), (e.isAssetReady(s.key, s.item) || Zt(s.key, i, a)) && d(s.key);
1714
+ y(s.key, !0), (e.isAssetReady(s.key, s.item) || $t(s.key, i, a)) && d(s.key);
1680
1715
  },
1681
1716
  url: s.item.url
1682
1717
  })
@@ -1687,14 +1722,14 @@ function Xt(e) {
1687
1722
  }
1688
1723
  function h() {
1689
1724
  let t = e.resolvedActiveIndex.value;
1690
- return Jt.map((e) => _(t + e)).filter((e) => !!e);
1725
+ return Xt.map((e) => _(t + e)).filter((e) => !!e);
1691
1726
  }
1692
1727
  function g(t) {
1693
- return e.active.value ? Yt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
1728
+ return e.active.value ? Zt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
1694
1729
  }
1695
1730
  function _(t) {
1696
1731
  let n = e.items.value[t];
1697
- return !n || !en(n) ? null : {
1732
+ return !n || !nn(n) ? null : {
1698
1733
  index: t,
1699
1734
  item: n,
1700
1735
  key: e.getItemKey(n)
@@ -1743,26 +1778,26 @@ function Xt(e) {
1743
1778
  shouldAttachSlideAsset: s
1744
1779
  };
1745
1780
  }
1746
- function Zt(e, t, n) {
1781
+ function $t(e, t, n) {
1747
1782
  let r = t.get(e);
1748
- if (r) return Qt(r);
1783
+ if (r) return en(r);
1749
1784
  let i = n.get(e);
1750
- return i ? $t(i) : !1;
1785
+ return i ? tn(i) : !1;
1751
1786
  }
1752
- function Qt(e) {
1787
+ function en(e) {
1753
1788
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
1754
1789
  }
1755
- function $t(e) {
1790
+ function tn(e) {
1756
1791
  let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
1757
1792
  return e.readyState >= t;
1758
1793
  }
1759
- function en(e) {
1794
+ function nn(e) {
1760
1795
  return e.type === "image" || e.type === "video" || e.type === "audio";
1761
1796
  }
1762
1797
  //#endregion
1763
1798
  //#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
1764
- function tn(e) {
1765
- let t = Xt({
1799
+ function rn(e) {
1800
+ let t = Qt({
1766
1801
  active: e.active,
1767
1802
  getItemKey: r,
1768
1803
  isAssetReady: m,
@@ -1772,7 +1807,7 @@ function tn(e) {
1772
1807
  });
1773
1808
  function n(e, t) {
1774
1809
  let n = t.title?.trim();
1775
- return n ? `${e} ${n}` : `${e} ${Wt(t.type).toLowerCase()}`;
1810
+ return n ? `${e} ${n}` : `${e} ${Kt(t.type).toLowerCase()}`;
1776
1811
  }
1777
1812
  function r(e) {
1778
1813
  return $(e);
@@ -1835,11 +1870,11 @@ function tn(e) {
1835
1870
  }
1836
1871
  //#endregion
1837
1872
  //#region src/components/viewer-core/slotContent.ts
1838
- function nn(e) {
1873
+ function an(e) {
1839
1874
  if (!Array.isArray(e)) return !1;
1840
1875
  for (let t of e) {
1841
1876
  if (Array.isArray(t)) {
1842
- if (nn(t)) return !0;
1877
+ if (an(t)) return !0;
1843
1878
  continue;
1844
1879
  }
1845
1880
  if (!h(t)) {
@@ -1850,20 +1885,20 @@ function nn(e) {
1850
1885
  if (t != null && t !== !1) return !0;
1851
1886
  continue;
1852
1887
  }
1853
- if (!rn(t)) return !0;
1888
+ if (!on(t)) return !0;
1854
1889
  }
1855
1890
  return !1;
1856
1891
  }
1857
- function rn(r) {
1858
- return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !nn(r.children) : !1;
1892
+ function on(r) {
1893
+ return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !an(r.children) : !1;
1859
1894
  }
1860
1895
  //#endregion
1861
1896
  //#region src/components/viewer-core/useSurfaceEmptyState.ts
1862
- var an = "no items available";
1863
- function on(e) {
1897
+ var sn = "no items available";
1898
+ function cn(e) {
1864
1899
  let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
1865
1900
  loading: !!e.loading.value,
1866
- message: an,
1901
+ message: sn,
1867
1902
  mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
1868
1903
  surface: e.surface,
1869
1904
  total: e.itemCount.value
@@ -1871,23 +1906,23 @@ function on(e) {
1871
1906
  return {
1872
1907
  emptyStateProps: t,
1873
1908
  showBadgeEmptyState: i(() => t.value?.mode === "badge"),
1874
- showCustomEmptyState: i(() => nn(n.value)),
1909
+ showCustomEmptyState: i(() => an(n.value)),
1875
1910
  showInlineEmptyState: i(() => t.value?.mode === "inline")
1876
1911
  };
1877
1912
  }
1878
1913
  //#endregion
1879
1914
  //#region src/components/viewer-core/format.ts
1880
- function sn(e) {
1915
+ function ln(e) {
1881
1916
  if (!Number.isFinite(e) || e <= 0) return "0:00";
1882
1917
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
1883
1918
  return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
1884
1919
  }
1885
1920
  //#endregion
1886
1921
  //#region src/components/viewer-core/surfaceStatus.ts
1887
- function cn(e) {
1922
+ function un(e) {
1888
1923
  return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
1889
1924
  }
1890
- function ln(e) {
1925
+ function dn(e) {
1891
1926
  return e.phase === "failed" ? {
1892
1927
  kind: "failed",
1893
1928
  message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
@@ -1910,7 +1945,7 @@ function ln(e) {
1910
1945
  }
1911
1946
  //#endregion
1912
1947
  //#region src/components/viewer-core/useActivation.ts
1913
- function un(e) {
1948
+ function fn(e) {
1914
1949
  let t = !1;
1915
1950
  z(e.enabled, async (t) => {
1916
1951
  if (n(t), t) {
@@ -1933,7 +1968,7 @@ function un(e) {
1933
1968
  }
1934
1969
  //#endregion
1935
1970
  //#region src/components/viewer-core/assetState.ts
1936
- var dn = {
1971
+ var pn = {
1937
1972
  currentTime: 0,
1938
1973
  duration: 0,
1939
1974
  errorKind: null,
@@ -1942,38 +1977,38 @@ var dn = {
1942
1977
  ready: !1,
1943
1978
  volume: 1
1944
1979
  };
1945
- function fn() {
1946
- return { ...dn };
1980
+ function mn() {
1981
+ return { ...pn };
1947
1982
  }
1948
- function pn(e) {
1983
+ function hn(e) {
1949
1984
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
1950
1985
  }
1951
- function mn(e, t, n) {
1952
- 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 = hn(t, n);
1986
+ function gn(e, t, n) {
1987
+ 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 = _n(t, n);
1953
1988
  }
1954
- function hn(e, t) {
1989
+ function _n(e, t) {
1955
1990
  return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
1956
1991
  }
1957
1992
  //#endregion
1958
1993
  //#region src/components/viewer-core/loadError.ts
1959
- var gn = /* @__PURE__ */ new Map();
1960
- function _n(e) {
1994
+ var vn = /* @__PURE__ */ new Map();
1995
+ function yn(e) {
1961
1996
  return e === "not-found" ? "404" : "Load error";
1962
1997
  }
1963
- function vn(e) {
1998
+ function bn(e) {
1964
1999
  return e === "generic";
1965
2000
  }
1966
- function yn(e) {
1967
- return bn(e).then((e) => e ?? "generic");
2001
+ function xn(e) {
2002
+ return Sn(e).then((e) => e ?? "generic");
1968
2003
  }
1969
- function bn(e) {
1970
- let t = gn.get(e);
2004
+ function Sn(e) {
2005
+ let t = vn.get(e);
1971
2006
  if (t) return t;
1972
- let n = xn(e);
1973
- return gn.set(e, n), n;
2007
+ let n = Cn(e);
2008
+ return vn.set(e, n), n;
1974
2009
  }
1975
- async function xn(e) {
1976
- if (!Sn(e)) return null;
2010
+ async function Cn(e) {
2011
+ if (!wn(e)) return null;
1977
2012
  try {
1978
2013
  let t = await fetch(e, { method: "HEAD" });
1979
2014
  return t.ok ? null : t.status === 404 ? "not-found" : "generic";
@@ -1981,25 +2016,45 @@ async function xn(e) {
1981
2016
  return "generic";
1982
2017
  }
1983
2018
  }
1984
- function Sn(e) {
2019
+ function wn(e) {
1985
2020
  return /^(https?:\/\/|\/)/i.test(e);
1986
2021
  }
1987
2022
  //#endregion
1988
2023
  //#region src/components/viewer-core/mediaPlayback.ts
1989
- function Cn(e) {
2024
+ function Tn(e) {
1990
2025
  try {
1991
2026
  let t = e.play();
1992
2027
  t && typeof t.catch == "function" && t.catch(() => {});
1993
2028
  } catch {}
1994
2029
  }
1995
2030
  //#endregion
2031
+ //#region src/components/viewer-core/nativeVideoFullscreen.ts
2032
+ function En(e) {
2033
+ let t = typeof document > "u" ? null : document;
2034
+ return typeof document < "u" && typeof HTMLVideoElement < "u" && e instanceof HTMLVideoElement && (document.fullscreenElement === e || t?.webkitFullscreenElement === e);
2035
+ }
2036
+ function Dn(e) {
2037
+ let t = e.requestFullscreen?.bind(e);
2038
+ if (t) {
2039
+ let e = t();
2040
+ e && typeof e.catch == "function" && e.catch(() => {});
2041
+ return;
2042
+ }
2043
+ let n = e;
2044
+ if (n.webkitEnterFullscreen) {
2045
+ n.webkitEnterFullscreen();
2046
+ return;
2047
+ }
2048
+ n.webkitRequestFullscreen?.();
2049
+ }
2050
+ //#endregion
1996
2051
  //#region src/components/viewer-core/useMedia.ts
1997
- function wn(e) {
2052
+ function On(e) {
1998
2053
  let t = D({}), n = D({}), r = D({}), a = D({}), o = D({}), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = i(() => e.activeItem.value ? $(e.activeItem.value) : null), d = i(() => e.activeMediaItem.value ? $(e.activeMediaItem.value) : null), f = i(() => {
1999
2054
  let t = /* @__PURE__ */ new Map();
2000
2055
  for (let n of e.items.value) t.set($(n), n);
2001
2056
  return t;
2002
- }), p = i(() => d.value ? r.value[d.value] ?? dn : dn), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : Tn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? L(u.value) : null);
2057
+ }), p = i(() => d.value ? r.value[d.value] ?? pn : pn), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : kn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? L(u.value) : null);
2003
2058
  z(() => u.value, async () => {
2004
2059
  await C();
2005
2060
  }), z(() => e.itemCount.value, async () => {
@@ -2022,7 +2077,7 @@ function wn(e) {
2022
2077
  c.delete(e);
2023
2078
  }
2024
2079
  function b(e, r) {
2025
- r instanceof HTMLImageElement && pn(r) && (t.value[e] = !0, n.value[e] = null, Y(e, r.currentSrc || r.src || re(e)));
2080
+ r instanceof HTMLImageElement && hn(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
2026
2081
  }
2027
2082
  function x() {
2028
2083
  U(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
@@ -2044,14 +2099,14 @@ function wn(e) {
2044
2099
  H(i, n);
2045
2100
  continue;
2046
2101
  }
2047
- i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, Cn(i), W(n, i);
2102
+ i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, Tn(i), W(n, i);
2048
2103
  }
2049
2104
  for (let [e, n] of c.entries()) {
2050
2105
  if (e !== t || r.value[e]?.errorKind) {
2051
2106
  H(n, e);
2052
2107
  continue;
2053
2108
  }
2054
- Cn(n), W(e, n);
2109
+ Tn(n), W(e, n);
2055
2110
  }
2056
2111
  }
2057
2112
  function w(e, t) {
@@ -2060,16 +2115,16 @@ function wn(e) {
2060
2115
  let i = r.value[e]?.ready ?? !1;
2061
2116
  W(e, n, t.type);
2062
2117
  let a = r.value[e]?.ready ?? !1;
2063
- !i && a && Y(e, n.currentSrc || n.src || re(e));
2118
+ !i && a && J(e, n.currentSrc || n.src || ie(e));
2064
2119
  }
2065
2120
  }
2066
2121
  function T(e, r) {
2067
- t.value[e] = !0, n.value[e] = null, Y(e, r);
2122
+ t.value[e] = !0, n.value[e] = null, J(e, r);
2068
2123
  }
2069
2124
  async function E(r, i) {
2070
- let a = X(r) ?? e.activeItem.value;
2125
+ let a = Y(r) ?? e.activeItem.value;
2071
2126
  t.value[r] = !1, n.value[r] = "generic";
2072
- let o = await yn(i);
2127
+ let o = await xn(i);
2073
2128
  n.value[r] = o, a && e.onAssetError?.({
2074
2129
  item: a,
2075
2130
  occurrenceKey: r,
@@ -2079,7 +2134,7 @@ function wn(e) {
2079
2134
  });
2080
2135
  }
2081
2136
  async function O(t, n) {
2082
- let r = q(t), i = te(t), a = X(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
2137
+ let r = K(t), i = te(t), a = Y(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
2083
2138
  if (r) {
2084
2139
  r.pause();
2085
2140
  try {
@@ -2087,7 +2142,7 @@ function wn(e) {
2087
2142
  } catch {}
2088
2143
  }
2089
2144
  i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
2090
- let o = await yn(n);
2145
+ let o = await xn(n);
2091
2146
  i.errorKind = o, a && e.onAssetError?.({
2092
2147
  item: a,
2093
2148
  occurrenceKey: t,
@@ -2097,28 +2152,28 @@ function wn(e) {
2097
2152
  });
2098
2153
  }
2099
2154
  function k(e, t, n) {
2100
- e.button !== 0 || Date.now() < n || ne(s.get(t) ?? null);
2155
+ e.button !== 0 || Date.now() < n || En(e.currentTarget) || re(s.get(t) ?? null);
2101
2156
  }
2102
2157
  function A(e, t, n) {
2103
- e.button !== 0 || Date.now() < n || ne(q(t));
2158
+ e.button !== 0 || Date.now() < n || re(K(t));
2104
2159
  }
2105
2160
  function j(e) {
2106
- let t = J(), n = d.value;
2161
+ let t = q(), n = d.value;
2107
2162
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
2108
2163
  let r = Number.parseFloat(e.target.value);
2109
2164
  if (!Number.isFinite(r)) return;
2110
- let i = Tn(r, 0, m.value || 0);
2165
+ let i = kn(r, 0, m.value || 0);
2111
2166
  G(n, i, t), t.currentTime = i;
2112
2167
  }
2113
2168
  function M(e) {
2114
- let t = J(), n = d.value;
2169
+ let t = q(), n = d.value;
2115
2170
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
2116
- let r = Tn(Number.parseFloat(e.target.value), 0, 1);
2171
+ let r = kn(Number.parseFloat(e.target.value), 0, 1);
2117
2172
  t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
2118
2173
  }
2119
2174
  function N() {
2120
- let e = J(), t = d.value;
2121
- !e || !t || (e.muted || e.volume <= 0 ? (e.volume = K(t), e.muted = !1, o.value[t] = e.volume) : (o.value[t] = e.volume, e.muted = !0), W(t, e));
2175
+ let e = q(), t = d.value;
2176
+ !e || !t || (e.muted || e.volume <= 0 ? (e.volume = ne(t), e.muted = !1, o.value[t] = e.volume) : (o.value[t] = e.volume, e.muted = !0), W(t, e));
2122
2177
  }
2123
2178
  function P(e) {
2124
2179
  return !!t.value[e] && !n.value[e];
@@ -2134,10 +2189,10 @@ function wn(e) {
2134
2189
  }
2135
2190
  function R(e) {
2136
2191
  let t = L(e);
2137
- return t ? _n(t) : null;
2192
+ return t ? yn(t) : null;
2138
2193
  }
2139
2194
  function ee(e) {
2140
- return vn(L(e));
2195
+ return bn(L(e));
2141
2196
  }
2142
2197
  function B(e) {
2143
2198
  return `${e}:${a.value[e] ?? 0}`;
@@ -2147,7 +2202,7 @@ function wn(e) {
2147
2202
  t.value[e] = !1, n.value[e] = null;
2148
2203
  let r = te(e);
2149
2204
  r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
2150
- let i = q(e);
2205
+ let i = K(e);
2151
2206
  i && H(i, e), l.forEach((t) => {
2152
2207
  t.startsWith(`${e}|`) && l.delete(t);
2153
2208
  }), a.value[e] = (a.value[e] ?? 0) + 1, await _(), await C();
@@ -2164,35 +2219,35 @@ function wn(e) {
2164
2219
  for (let [e, t] of c.entries()) H(t, e);
2165
2220
  }
2166
2221
  function te(e) {
2167
- return r.value[e] || (r.value[e] = fn()), r.value[e];
2222
+ return r.value[e] || (r.value[e] = mn()), r.value[e];
2168
2223
  }
2169
2224
  function W(e, t, n) {
2170
- mn(te(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
2225
+ gn(te(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
2171
2226
  }
2172
2227
  function G(e, t, n) {
2173
2228
  let r = te(e);
2174
2229
  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;
2175
2230
  }
2176
- function K(e) {
2177
- return Tn(o.value[e] ?? 1, 0, 1);
2231
+ function ne(e) {
2232
+ return kn(o.value[e] ?? 1, 0, 1);
2178
2233
  }
2179
- function q(e) {
2234
+ function K(e) {
2180
2235
  return s.get(e) ?? c.get(e) ?? null;
2181
2236
  }
2182
- function J() {
2183
- return d.value ? q(d.value) : null;
2237
+ function q() {
2238
+ return d.value ? K(d.value) : null;
2184
2239
  }
2185
- function ne(e) {
2240
+ function re(e) {
2186
2241
  if (e) {
2187
2242
  if (e.paused) {
2188
- Cn(e);
2243
+ Tn(e);
2189
2244
  return;
2190
2245
  }
2191
2246
  e.pause();
2192
2247
  }
2193
2248
  }
2194
- function Y(t, n) {
2195
- let r = X(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
2249
+ function J(t, n) {
2250
+ let r = Y(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
2196
2251
  if (!r || !n) return;
2197
2252
  let i = `${t}|${n}`;
2198
2253
  l.has(i) || (l.add(i), e.onAssetLoad?.({
@@ -2202,11 +2257,11 @@ function wn(e) {
2202
2257
  url: n
2203
2258
  }));
2204
2259
  }
2205
- function X(e) {
2260
+ function Y(e) {
2206
2261
  return f.value.get(e) ?? null;
2207
2262
  }
2208
- function re(e) {
2209
- return X(e)?.url ?? null;
2263
+ function ie(e) {
2264
+ return Y(e)?.url ?? null;
2210
2265
  }
2211
2266
  return {
2212
2267
  activeAssetErrorKind: g,
@@ -2239,16 +2294,16 @@ function wn(e) {
2239
2294
  syncMediaPlayback: C
2240
2295
  };
2241
2296
  }
2242
- function Tn(e, t, n) {
2297
+ function kn(e, t, n) {
2243
2298
  return Math.min(Math.max(e, t), n);
2244
2299
  }
2245
2300
  //#endregion
2246
2301
  //#region src/components/viewer-core/virtualization.ts
2247
- var En = {
2302
+ var An = {
2248
2303
  backward: 1,
2249
2304
  forward: 3
2250
2305
  };
2251
- function Dn(e, t, n = En) {
2306
+ function jn(e, t, n = An) {
2252
2307
  return t <= 0 ? {
2253
2308
  start: 0,
2254
2309
  end: -1
@@ -2257,14 +2312,14 @@ function Dn(e, t, n = En) {
2257
2312
  end: Math.min(t - 1, e + n.forward)
2258
2313
  };
2259
2314
  }
2260
- function On(e, t, n = En) {
2261
- let r = Dn(t, e.length, n);
2315
+ function Mn(e, t, n = An) {
2316
+ let r = jn(t, e.length, n);
2262
2317
  return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
2263
2318
  item: e,
2264
2319
  index: r.start + t
2265
2320
  }));
2266
2321
  }
2267
- function kn(e, t, n, r, i) {
2322
+ function Nn(e, t, n, r, i) {
2268
2323
  return {
2269
2324
  transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
2270
2325
  transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
@@ -2272,12 +2327,12 @@ function kn(e, t, n, r, i) {
2272
2327
  }
2273
2328
  //#endregion
2274
2329
  //#region src/components/viewer-core/useViewer.ts
2275
- function An(e, t, n = {}) {
2276
- 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(() => cn({
2330
+ function Pn(e, t, n = {}) {
2331
+ 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(() => un({
2277
2332
  itemCount: r.value.length,
2278
2333
  loading: s.value,
2279
2334
  phase: e.phase
2280
- })), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T = wn({
2335
+ })), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T = On({
2281
2336
  items: r,
2282
2337
  activeItem: C,
2283
2338
  activeMediaItem: w,
@@ -2286,14 +2341,14 @@ function An(e, t, n = {}) {
2286
2341
  loopFullscreenVideo: l,
2287
2342
  onAssetError: n.onAssetError,
2288
2343
  onAssetLoad: n.onAssetLoad
2289
- }), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => ln({
2344
+ }), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => dn({
2290
2345
  errorMessage: o.value,
2291
2346
  hasItems: r.value.length > 0,
2292
2347
  hasNextPage: c.value,
2293
2348
  phase: d.value,
2294
2349
  surface: "fullscreen"
2295
- })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => Dn(S.value, r.value.length)), N = i(() => On(r.value, S.value));
2296
- un({
2350
+ })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => jn(S.value, r.value.length)), N = i(() => Mn(r.value, S.value));
2351
+ fn({
2297
2352
  enabled: _,
2298
2353
  onDisable() {
2299
2354
  U(), T.resetMediaState();
@@ -2323,7 +2378,7 @@ function An(e, t, n = {}) {
2323
2378
  return t && !I(-1) || n && !I(1) ? e * .24 : e;
2324
2379
  }
2325
2380
  function z(e) {
2326
- !_.value || r.value.length === 0 || e.pointerType === "mouse" || Q(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
2381
+ !_.value || r.value.length === 0 || e.pointerType === "mouse" || Z(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
2327
2382
  }
2328
2383
  function ee(e) {
2329
2384
  !_.value || !h.value || v !== e.pointerId || (m.value = R(e.clientY - y));
@@ -2341,37 +2396,37 @@ function An(e, t, n = {}) {
2341
2396
  m.value = 0, h.value = !1, v = null;
2342
2397
  }
2343
2398
  function te(e) {
2344
- if (!_.value || r.value.length === 0 || h.value || Q(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
2399
+ if (!_.value || r.value.length === 0 || h.value || Z(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
2345
2400
  e.preventDefault();
2346
2401
  let t = Date.now();
2347
2402
  t < b || (b = t + 400, L(e.deltaY > 0 ? 1 : -1));
2348
2403
  }
2349
2404
  function W(e) {
2350
- !_.value || r.value.length === 0 || ge(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), L(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), L(-1)));
2405
+ !_.value || r.value.length === 0 || ve(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), L(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), L(-1)));
2351
2406
  }
2352
2407
  function G(e, t) {
2353
2408
  T.onVideoClick(e, t, x);
2354
2409
  }
2355
- function K(e, t) {
2410
+ function ne(e, t) {
2356
2411
  T.onAudioCoverClick(e, t, x);
2357
2412
  }
2358
- function q(e) {
2413
+ function K(e) {
2359
2414
  T.onMediaSeekInput(e);
2360
2415
  }
2361
- function J(e) {
2416
+ function q(e) {
2362
2417
  T.onMediaVolumeInput(e);
2363
2418
  }
2364
- function ne() {
2419
+ function re() {
2365
2420
  T.onMediaVolumeToggle();
2366
2421
  }
2367
- function Y(e) {
2422
+ function J(e) {
2368
2423
  return e.type === "image" || e.type === "video";
2369
2424
  }
2370
- function X(e) {
2425
+ function Y(e) {
2371
2426
  return e.type === "audio";
2372
2427
  }
2373
- function re(e) {
2374
- return kn(e, S.value, g.value, m.value, h.value);
2428
+ function ie(e) {
2429
+ return Nn(e, S.value, g.value, m.value, h.value);
2375
2430
  }
2376
2431
  return {
2377
2432
  activeItem: C,
@@ -2386,26 +2441,26 @@ function An(e, t, n = {}) {
2386
2441
  getAssetErrorKind: T.getAssetErrorKind,
2387
2442
  getAssetErrorLabel: T.getAssetErrorLabel,
2388
2443
  getAssetRenderKey: T.getAssetRenderKey,
2389
- formatPlaybackTime: sn,
2444
+ formatPlaybackTime: ln,
2390
2445
  getImageSource: T.getImageSource,
2391
- getSlideStyle: re,
2446
+ getSlideStyle: ie,
2392
2447
  hasNextPage: c,
2393
2448
  isAtEnd: E,
2394
- isAudio: X,
2395
- isVisual: Y,
2449
+ isAudio: Y,
2450
+ isVisual: J,
2396
2451
  items: r,
2397
2452
  loading: s,
2398
2453
  mediaStates: T.mediaStates,
2399
2454
  isImageReady: T.isImageReady,
2400
2455
  isMediaReady: T.isMediaReady,
2401
- onAudioCoverClick: K,
2456
+ onAudioCoverClick: ne,
2402
2457
  onImageError: T.onImageError,
2403
2458
  onImageLoad: T.onImageLoad,
2404
2459
  onMediaEvent: T.onMediaEvent,
2405
2460
  onMediaError: T.onMediaError,
2406
- onMediaSeekInput: q,
2407
- onMediaVolumeInput: J,
2408
- onMediaVolumeToggle: ne,
2461
+ onMediaSeekInput: K,
2462
+ onMediaVolumeInput: q,
2463
+ onMediaVolumeToggle: re,
2409
2464
  onPointerCancel: V,
2410
2465
  onPointerDown: z,
2411
2466
  onPointerMove: ee,
@@ -2430,21 +2485,21 @@ function An(e, t, n = {}) {
2430
2485
  }
2431
2486
  //#endregion
2432
2487
  //#region src/components/viewer-core/theme.ts
2433
- var jn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", Mn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", Nn = {
2488
+ var Fn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", In = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", Ln = {
2434
2489
  image: !0,
2435
2490
  video: !0,
2436
2491
  audio: !0,
2437
2492
  other: !0
2438
2493
  };
2439
- function Pn(e) {
2440
- return Nn[e], jn;
2494
+ function Rn(e) {
2495
+ return Ln[e], Fn;
2441
2496
  }
2442
- function Fn(e) {
2443
- return Nn[e], Mn;
2497
+ function zn(e) {
2498
+ return Ln[e], In;
2444
2499
  }
2445
2500
  //#endregion
2446
2501
  //#region src/components/viewer-core/useFullscreenAssetEvents.ts
2447
- function In(e) {
2502
+ function Bn(e) {
2448
2503
  function t(t, n) {
2449
2504
  return e.fullscreenMedia.shouldHandleSlideAssetEvent(t, n) ? e.fullscreenMedia.getItemKey(n) : null;
2450
2505
  }
@@ -2477,7 +2532,7 @@ function In(e) {
2477
2532
  }
2478
2533
  //#endregion
2479
2534
  //#region src/components/viewer-core/dominantImageTone.ts
2480
- function Ln(e) {
2535
+ function Vn(e) {
2481
2536
  if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
2482
2537
  let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
2483
2538
  if (!n) return null;
@@ -2492,20 +2547,20 @@ function Ln(e) {
2492
2547
  r += d, i += s * d, a += c * d, o += l * d;
2493
2548
  }
2494
2549
  return r <= 0 ? null : {
2495
- r: Rn(Math.round(i / r)),
2496
- g: Rn(Math.round(a / r)),
2497
- b: Rn(Math.round(o / r))
2550
+ r: Hn(Math.round(i / r)),
2551
+ g: Hn(Math.round(a / r)),
2552
+ b: Hn(Math.round(o / r))
2498
2553
  };
2499
2554
  } catch {
2500
2555
  return null;
2501
2556
  }
2502
2557
  }
2503
- function Rn(e) {
2558
+ function Hn(e) {
2504
2559
  return Math.min(235, Math.max(26, e));
2505
2560
  }
2506
2561
  //#endregion
2507
2562
  //#region src/components/viewer-core/useFullscreenDominantTone.ts
2508
- function zn(e) {
2563
+ function Un(e) {
2509
2564
  let t = D({}), n = i(() => e.activeItem.value ? e.getItemKey(e.activeItem.value) : null), r = i(() => !e.showDominantImageTone.value || e.activeItem.value?.type !== "image" || !n.value || !e.isImageReady(n.value) ? null : t.value[n.value] ?? null), a = i(() => {
2510
2565
  if (!r.value) return;
2511
2566
  let { r: e, g: t, b: n } = r.value;
@@ -2520,7 +2575,7 @@ function zn(e) {
2520
2575
  });
2521
2576
  function s(n, r) {
2522
2577
  if (!e.showDominantImageTone.value) return;
2523
- let i = Ln(r);
2578
+ let i = Vn(r);
2524
2579
  i && (t.value[n] = i);
2525
2580
  }
2526
2581
  return {
@@ -2530,8 +2585,318 @@ function zn(e) {
2530
2585
  };
2531
2586
  }
2532
2587
  //#endregion
2533
- //#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
2534
- var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2588
+ //#region src/components/viewer-core/useVideoFullscreen.ts
2589
+ function Wn(e) {
2590
+ let t = /* @__PURE__ */ new Map();
2591
+ function n(e, n) {
2592
+ if (n instanceof HTMLVideoElement) {
2593
+ t.set(e, n);
2594
+ return;
2595
+ }
2596
+ t.delete(e);
2597
+ }
2598
+ function r() {
2599
+ let n = e.activeItem.value, r = n?.type === "video" ? t.get(e.getItemKey(n)) : null;
2600
+ r && Dn(r);
2601
+ }
2602
+ return {
2603
+ registerElement: n,
2604
+ request: r
2605
+ };
2606
+ }
2607
+ //#endregion
2608
+ //#region src/components/viewer-core/masonryLayout.ts
2609
+ var Gn = 1, Kn = .5;
2610
+ function qn(e) {
2611
+ if (e.type !== "image" && e.type !== "video") return {
2612
+ width: Gn,
2613
+ height: Gn,
2614
+ source: "fallback"
2615
+ };
2616
+ let t = e.preview?.width, n = e.preview?.height;
2617
+ if (nr(t) && nr(n)) {
2618
+ let r = rr(e, t, n);
2619
+ return {
2620
+ width: r.width,
2621
+ height: r.height,
2622
+ source: "preview"
2623
+ };
2624
+ }
2625
+ if (nr(e.width) && nr(e.height)) {
2626
+ let t = rr(e, e.width, e.height);
2627
+ return {
2628
+ width: t.width,
2629
+ height: t.height,
2630
+ source: "original"
2631
+ };
2632
+ }
2633
+ return {
2634
+ width: Gn,
2635
+ height: Gn,
2636
+ source: "fallback"
2637
+ };
2638
+ }
2639
+ function Jn(e, t) {
2640
+ return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
2641
+ }
2642
+ function Yn(e, t, n, r = 0) {
2643
+ if (!e || e <= 0 || !t || t <= 0) return n;
2644
+ let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
2645
+ return !a || a <= 0 ? n : a / t;
2646
+ }
2647
+ function Xn(e, t) {
2648
+ let n = qn(e);
2649
+ return n.height / n.width * t;
2650
+ }
2651
+ function Zn(e, t) {
2652
+ let n = Array.from({ length: t.columnCount }, () => 0), r = {
2653
+ positions: Array(e.length),
2654
+ heights: Array(e.length),
2655
+ buckets: /* @__PURE__ */ new Map(),
2656
+ contentHeight: 0,
2657
+ indexById: /* @__PURE__ */ new Map(),
2658
+ columnHeights: n
2659
+ };
2660
+ return Qn(r, e, {
2661
+ ...t,
2662
+ startIndex: 0
2663
+ }), r;
2664
+ }
2665
+ function Qn(e, t, n) {
2666
+ for (let r = 0; r < t.length; r += 1) {
2667
+ let i = t[r], a = n.startIndex + r;
2668
+ e.indexById.set($(i), a);
2669
+ let o = 0;
2670
+ for (let t = 1; t < e.columnHeights.length; t += 1) e.columnHeights[t] < e.columnHeights[o] && (o = t);
2671
+ let s = o * (n.columnWidth + n.gapX), c = e.columnHeights[o], l = Xn(i, n.columnWidth);
2672
+ e.positions[a] = {
2673
+ x: s + (n.positionOffsetX ?? 0),
2674
+ y: c + (n.positionOffsetY ?? 0)
2675
+ }, e.heights[a] = l, e.columnHeights[o] = c + l + n.gapY, e.contentHeight = Math.max(e.contentHeight, c + l);
2676
+ let u = Math.floor(c / n.bucketPx), d = Math.floor((c + l) / n.bucketPx);
2677
+ for (let t = u; t <= d; t += 1) {
2678
+ let n = e.buckets.get(t);
2679
+ n ? e.buckets.set(t, [...n, a]) : e.buckets.set(t, [a]);
2680
+ }
2681
+ }
2682
+ return e;
2683
+ }
2684
+ function $n(e, t) {
2685
+ let n = [...t.columnHeights], r = t.contentHeight;
2686
+ for (let i of e) {
2687
+ let e = 0;
2688
+ for (let t = 1; t < n.length; t += 1) n[t] < n[e] && (e = t);
2689
+ let a = n[e], o = Xn(i, t.columnWidth);
2690
+ n[e] = a + o + t.gapY, r = Math.max(r, a + o);
2691
+ }
2692
+ return r;
2693
+ }
2694
+ function er(e) {
2695
+ return e.addedItems.length === 0 || e.removedItemCount > 0 || e.isPrepend || e.previousItems.length === 0 || e.layoutItemCount !== e.previousItems.length || e.columnHeights.length !== e.columnCount || e.currentItems.length !== e.previousItems.length + e.addedItems.length ? !1 : e.previousItems.every((t, n) => $(t) === $(e.currentItems[n]));
2696
+ }
2697
+ function tr(e) {
2698
+ if (e.itemCount <= 0) return [];
2699
+ if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
2700
+ 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();
2701
+ for (let t = r; t <= i; t += 1) {
2702
+ let n = e.buckets.get(t);
2703
+ if (n) for (let e of n) a.add(e);
2704
+ }
2705
+ return Array.from(a).sort((e, t) => e - t);
2706
+ }
2707
+ function nr(e) {
2708
+ return typeof e == "number" && Number.isFinite(e) && e > 0;
2709
+ }
2710
+ function rr(e, t, n) {
2711
+ return e.type !== "image" || n / t >= Kn ? {
2712
+ width: t,
2713
+ height: n
2714
+ } : {
2715
+ width: t,
2716
+ height: t
2717
+ };
2718
+ }
2719
+ //#endregion
2720
+ //#region src/components/viewer-core/listPreview.ts
2721
+ var ir = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, ar = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, or = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
2722
+ function sr(e) {
2723
+ let t = cr(e), n = t?.url, r = qn(e), i = e.title?.trim() || Kt(e.type);
2724
+ return t?.mediaType === "video" && typeof n == "string" ? {
2725
+ kind: "video",
2726
+ url: n,
2727
+ width: r.width,
2728
+ height: r.height,
2729
+ label: i
2730
+ } : t?.mediaType === "image" && typeof n == "string" ? {
2731
+ kind: "image",
2732
+ url: n,
2733
+ width: r.width,
2734
+ height: r.height,
2735
+ label: i
2736
+ } : e.type !== "image" && e.type !== "video" ? {
2737
+ kind: "fallback",
2738
+ url: null,
2739
+ width: r.width,
2740
+ height: r.height,
2741
+ label: i
2742
+ } : typeof n == "string" && ur(e, n) ? {
2743
+ kind: "video",
2744
+ url: n,
2745
+ width: r.width,
2746
+ height: r.height,
2747
+ label: i
2748
+ } : typeof n == "string" && lr(e, n) ? {
2749
+ kind: "image",
2750
+ url: n,
2751
+ width: r.width,
2752
+ height: r.height,
2753
+ label: i
2754
+ } : {
2755
+ kind: "fallback",
2756
+ url: null,
2757
+ width: r.width,
2758
+ height: r.height,
2759
+ label: i
2760
+ };
2761
+ }
2762
+ function cr(e) {
2763
+ return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
2764
+ }
2765
+ function lr(e, t) {
2766
+ return e.type !== "image" || typeof t != "string" ? !1 : ir.test(t) || dr(t);
2767
+ }
2768
+ function ur(e, t) {
2769
+ return e.type !== "video" || typeof t != "string" ? !1 : ar.test(t) || fr(t);
2770
+ }
2771
+ function dr(e) {
2772
+ return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
2773
+ }
2774
+ function fr(e) {
2775
+ return or.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
2776
+ }
2777
+ //#endregion
2778
+ //#region src/components/FullscreenPreviewRail.vue?vue&type=script&setup=true&lang.ts
2779
+ var pr = {
2780
+ key: 0,
2781
+ "data-testid": "vibe-fullscreen-next-previews",
2782
+ class: "pointer-events-auto absolute right-[clamp(1.25rem,2.6vw,2.25rem)] top-[clamp(5.75rem,7vw,7rem)] z-[4] grid gap-2 max-[860px]:hidden"
2783
+ }, mr = [
2784
+ "data-index",
2785
+ "aria-label",
2786
+ "title",
2787
+ "onClick"
2788
+ ], hr = [
2789
+ "src",
2790
+ "onError",
2791
+ "onLoad"
2792
+ ], gr = [
2793
+ "src",
2794
+ "onError",
2795
+ "onLoadedmetadata"
2796
+ ], _r = {
2797
+ key: 2,
2798
+ class: "grid h-full w-full place-items-center bg-white/6",
2799
+ "aria-hidden": "true"
2800
+ }, vr = {
2801
+ key: 3,
2802
+ class: "pointer-events-none absolute left-2 top-2 inline-flex h-6 w-6 items-center justify-center border border-white/14 bg-black/55 backdrop-blur-[14px]",
2803
+ "aria-hidden": "true"
2804
+ }, yr = {
2805
+ key: 4,
2806
+ "data-testid": "vibe-fullscreen-next-preview-spinner",
2807
+ class: "pointer-events-none absolute inset-0 grid place-items-center bg-black/18",
2808
+ "aria-hidden": "true"
2809
+ }, br = { class: "inline-flex h-9 w-9 items-center justify-center rounded-full bg-black/50 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, xr = { class: "pointer-events-none absolute bottom-1.5 right-1.5 border border-white/14 bg-black/58 px-1.5 py-1 text-[0.56rem] font-bold leading-none tracking-[0.12em] text-[#f7f1ea]/78 backdrop-blur-[14px]" }, Sr = /* @__PURE__ */ d({
2810
+ __name: "FullscreenPreviewRail",
2811
+ props: {
2812
+ activeIndex: {},
2813
+ items: {},
2814
+ maxItems: { default: 2 }
2815
+ },
2816
+ emits: ["select"],
2817
+ setup(e, { emit: n }) {
2818
+ let r = e, l = n, d = D({}), f = i(() => {
2819
+ let e = Math.min(Math.max(r.activeIndex + 1, 0), r.items.length);
2820
+ return r.items.slice(e, e + r.maxItems).map((t, n) => ({
2821
+ asset: sr(t),
2822
+ index: e + n,
2823
+ item: t
2824
+ }));
2825
+ });
2826
+ z(f, (e) => {
2827
+ let t = {};
2828
+ for (let n of e) {
2829
+ let e = p(n);
2830
+ _(n) && (t[e] = d.value[e] ?? "loading");
2831
+ }
2832
+ d.value = t;
2833
+ }, { immediate: !0 });
2834
+ function p(e) {
2835
+ return `${e.item.id}:${e.index}:${e.asset.url ?? "fallback"}`;
2836
+ }
2837
+ function m(e) {
2838
+ return `Open item ${e.index + 1} of ${r.items.length}: ${e.asset.label}`;
2839
+ }
2840
+ function h(e) {
2841
+ return g(e) ? "object-cover" : "object-contain";
2842
+ }
2843
+ function g(e) {
2844
+ if (e.width <= 0 || e.height <= 0) return !1;
2845
+ let t = e.width / e.height;
2846
+ return (t >= 1 ? 1 - 1 / t : 1 - t) >= .3;
2847
+ }
2848
+ function _(e) {
2849
+ return !!e.asset.url && (e.asset.kind === "image" || e.asset.kind === "video");
2850
+ }
2851
+ function y(e) {
2852
+ return _(e) && d.value[p(e)] === "loading";
2853
+ }
2854
+ function b(e, t) {
2855
+ return d.value[p(e)] === "ready" ? `${t} group-hover:opacity-100` : "opacity-0";
2856
+ }
2857
+ function x(e, t) {
2858
+ d.value = {
2859
+ ...d.value,
2860
+ [p(e)]: t
2861
+ };
2862
+ }
2863
+ return (e, n) => f.value.length ? (w(), s("div", pr, [(w(!0), s(t, null, O(f.value, (e) => (w(), s("button", {
2864
+ key: `${e.item.id}-${e.index}`,
2865
+ type: "button",
2866
+ "data-testid": "vibe-fullscreen-next-preview",
2867
+ "data-index": e.index,
2868
+ "aria-label": m(e),
2869
+ title: e.asset.label,
2870
+ class: "group relative h-[150px] w-[150px] overflow-hidden border border-white/14 bg-black/45 text-[#f7f1ea] shadow-[0_20px_50px_-30px_rgba(0,0,0,0.9)] backdrop-blur-[18px] transition hover:border-white/34 hover:bg-black/58 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
2871
+ onClick: (t) => l("select", e.index)
2872
+ }, [
2873
+ e.asset.kind === "image" ? (w(), s("img", {
2874
+ key: 0,
2875
+ src: e.asset.url ?? void 0,
2876
+ alt: "",
2877
+ "aria-hidden": "true",
2878
+ draggable: "false",
2879
+ loading: "lazy",
2880
+ class: v(["h-full w-full bg-black/18 object-center transition-[opacity,transform] duration-300 group-hover:scale-[1.04]", [h(e.asset), b(e, "opacity-[0.82]")]]),
2881
+ onError: (t) => x(e, "error"),
2882
+ onLoad: (t) => x(e, "ready")
2883
+ }, null, 42, hr)) : e.asset.kind === "video" ? (w(), s("video", {
2884
+ key: 1,
2885
+ src: e.asset.url ?? void 0,
2886
+ "aria-hidden": "true",
2887
+ class: v(["h-full w-full bg-black/18 object-center transition-[opacity,transform] duration-300 group-hover:scale-[1.04]", [h(e.asset), b(e, "opacity-[0.78]")]]),
2888
+ muted: "",
2889
+ playsinline: "",
2890
+ preload: "metadata",
2891
+ onError: (t) => x(e, "error"),
2892
+ onLoadedmetadata: (t) => x(e, "ready")
2893
+ }, null, 42, gr)) : (w(), s("span", _r, [(w(), a(A(F(Gt)(e.item.type)), { class: "h-5 w-5 stroke-[1.9] text-[#f7f1ea]/70" }))])),
2894
+ e.asset.kind === "video" ? (w(), s("span", vr, [(w(), a(A(F(Gt)(e.item.type)), { class: "h-3.5 w-3.5 stroke-[2]" }))])) : o("", !0),
2895
+ y(e) ? (w(), s("span", yr, [c("span", br, [u(F(ce), { class: "h-4 w-4 animate-spin stroke-[1.9] text-[#f7f1ea]/82" })])])) : o("", !0),
2896
+ c("span", xr, M(e.index + 1) + " / " + M(r.items.length), 1)
2897
+ ], 8, mr))), 128))])) : o("", !0);
2898
+ }
2899
+ }), Cr = ["data-surface"], wr = ["data-surface"], Tr = /* @__PURE__ */ d({
2535
2900
  inheritAttrs: !1,
2536
2901
  __name: "SurfaceEmptyState",
2537
2902
  props: {
@@ -2545,31 +2910,31 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2545
2910
  "data-testid": "vibe-empty-state-inline",
2546
2911
  "data-surface": e.surface,
2547
2912
  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)]"]
2548
- }), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, M(e.message), 3)])], 16, Bn)) : (w(), s("div", g({ key: 1 }, F(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
2913
+ }), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, M(e.message), 3)])], 16, Cr)) : (w(), s("div", g({ key: 1 }, F(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
2549
2914
  "data-testid": "vibe-empty-state-badge",
2550
2915
  "data-surface": e.surface,
2551
2916
  class: v(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
2552
- }, M(e.message), 11, Vn)])], 16));
2917
+ }, M(e.message), 11, wr)])], 16));
2553
2918
  }
2554
- }), Un = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Wn = {
2919
+ }), Er = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Dr = {
2555
2920
  key: 0,
2556
2921
  class: "relative h-full min-h-0"
2557
- }, Gn = [
2922
+ }, Or = [
2558
2923
  "data-item-id",
2559
2924
  "data-occurrence-key",
2560
2925
  "data-index",
2561
2926
  "data-active",
2562
2927
  "aria-hidden"
2563
- ], Kn = {
2928
+ ], kr = {
2564
2929
  key: 0,
2565
2930
  "data-testid": "vibe-asset-spinner",
2566
2931
  class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
2567
- }, qn = { 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]" }, Jn = ["data-kind"], Yn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Xn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Zn = ["onClick"], Qn = [
2932
+ }, Ar = { 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]" }, jr = ["data-kind"], Mr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Nr = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Pr = ["onClick"], Fr = [
2568
2933
  "src",
2569
2934
  "alt",
2570
2935
  "onLoad",
2571
2936
  "onError"
2572
- ], $n = [
2937
+ ], Ir = [
2573
2938
  "loop",
2574
2939
  "src",
2575
2940
  "preload",
@@ -2588,15 +2953,15 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2588
2953
  "onStalled",
2589
2954
  "onTimeupdate",
2590
2955
  "onWaiting"
2591
- ], er = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, tr = [
2956
+ ], Lr = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Rr = [
2592
2957
  "aria-label",
2593
2958
  "disabled",
2594
2959
  "onClick"
2595
- ], nr = { 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]" }, rr = { 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]" }, ir = {
2960
+ ], zr = { 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]" }, Br = { 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]" }, Vr = {
2596
2961
  key: 0,
2597
2962
  "data-testid": "vibe-asset-spinner",
2598
2963
  class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
2599
- }, ar = { 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]" }, or = ["data-kind"], sr = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, cr = ["onClick"], lr = [
2964
+ }, Hr = { 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]" }, Ur = ["data-kind"], Wr = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Gr = ["onClick"], Kr = [
2600
2965
  "src",
2601
2966
  "preload",
2602
2967
  "onCanplay",
@@ -2612,26 +2977,26 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2612
2977
  "onStalled",
2613
2978
  "onTimeupdate",
2614
2979
  "onWaiting"
2615
- ], ur = {
2980
+ ], qr = {
2616
2981
  key: 2,
2617
2982
  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"
2618
- }, dr = { 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]" }, fr = {
2983
+ }, Jr = { 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]" }, Yr = {
2619
2984
  key: 0,
2620
2985
  "data-testid": "vibe-fullscreen-overlay",
2621
2986
  class: "pointer-events-none absolute inset-0 z-[6]"
2622
- }, pr = { class: "h-full w-full" }, mr = {
2987
+ }, Xr = { class: "h-full w-full" }, Zr = {
2623
2988
  key: 1,
2624
2989
  "data-testid": "vibe-forward-fill-placeholder",
2625
2990
  class: "grid h-full min-h-0 place-items-center px-6 text-center"
2626
- }, hr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, gr = { 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)]" }, _r = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, vr = {
2991
+ }, Qr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, $r = { 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)]" }, ei = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, ti = {
2627
2992
  key: 0,
2628
2993
  "data-testid": "vibe-fullscreen-aside",
2629
2994
  class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
2630
- }, yr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, br = {
2995
+ }, ni = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, ri = {
2631
2996
  key: 0,
2632
2997
  "data-testid": "vibe-fullscreen-aside",
2633
2998
  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]"
2634
- }, xr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Sr = 1280, Cr = 768, wr = /* @__PURE__ */ d({
2999
+ }, ii = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, ai = 1280, oi = 768, si = /* @__PURE__ */ d({
2635
3000
  __name: "FullscreenSurface",
2636
3001
  props: {
2637
3002
  active: {
@@ -2683,27 +3048,30 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2683
3048
  },
2684
3049
  emits: ["back-to-list", "update:activeIndex"],
2685
3050
  setup(e, { emit: n }) {
2686
- let d = e, f = L(), m = n, h = An(d, (e, t) => {
3051
+ let d = e, f = L(), m = n, h = Pn(d, (e, t) => {
2687
3052
  m("update:activeIndex", t);
2688
3053
  }, {
2689
3054
  enabled: N(d, "active"),
2690
3055
  onAssetError: d.reportAssetError ?? void 0,
2691
3056
  onAssetLoad: d.reportAssetLoad ?? void 0
2692
- }), _ = D(typeof window > "u" ? Sr : window.innerWidth || Sr), C = tn({
3057
+ }), _ = D(typeof window > "u" ? ai : window.innerWidth || ai), C = rn({
2693
3058
  active: N(d, "active"),
2694
3059
  items: h.items,
2695
3060
  resolvedActiveIndex: h.resolvedActiveIndex,
2696
3061
  viewer: h
2697
- }), T = i(() => Pn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: j, updateFromImageElement: P } = zn({
3062
+ }), T = Wn({
3063
+ activeItem: h.activeItem,
3064
+ getItemKey: C.getItemKey
3065
+ }), E = i(() => Rn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: j, activeStageToneStyle: P, updateFromImageElement: I } = Un({
2698
3066
  activeItem: h.activeItem,
2699
3067
  getItemKey: C.getItemKey,
2700
3068
  isImageReady: h.isImageReady,
2701
3069
  showDominantImageTone: N(d, "showDominantImageTone")
2702
- }), I = In({
3070
+ }), R = Bn({
2703
3071
  fullscreenMedia: C,
2704
- updateDominantToneFromImageElement: _e,
3072
+ updateDominantToneFromImageElement: ye,
2705
3073
  viewer: h
2706
- }), R = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), z = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), ee = i(() => _.value < Cr ? "vertical" : "horizontal"), V = i(() => z.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), U = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), te = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), W = i(() => {
3074
+ }), z = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), ee = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), V = i(() => _.value < oi ? "vertical" : "horizontal"), U = i(() => ee.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), te = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), W = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), G = i(() => {
2707
3075
  let e = h.activeItem.value;
2708
3076
  return e ? {
2709
3077
  hasNextPage: d.hasNextPage,
@@ -2713,14 +3081,14 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2713
3081
  paginationDetail: d.paginationDetail,
2714
3082
  total: d.items.length
2715
3083
  } : null;
2716
- }), G = i(() => !W.value || !f["fullscreen-header-actions"] ? [] : f["fullscreen-header-actions"](W.value)), K = i(() => !W.value || !f["fullscreen-aside"] ? [] : f["fullscreen-aside"](W.value)), q = i(() => !d.showStatusBadges || !W.value || !h.statusKind.value || !h.statusMessage.value ? null : {
2717
- ...W.value,
3084
+ }), ne = i(() => !G.value || !f["fullscreen-header-actions"] ? [] : f["fullscreen-header-actions"](G.value)), K = i(() => !G.value || !f["fullscreen-aside"] ? [] : f["fullscreen-aside"](G.value)), q = i(() => !d.showStatusBadges || !G.value || !h.statusKind.value || !h.statusMessage.value ? null : {
3085
+ ...G.value,
2718
3086
  kind: h.statusKind.value,
2719
3087
  message: h.statusMessage.value
2720
- }), J = i(() => !q.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](q.value)), ne = i(() => ({
2721
- gridTemplateColumns: re.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
3088
+ }), re = i(() => !q.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](q.value)), J = i(() => ({
3089
+ gridTemplateColumns: ae.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
2722
3090
  transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
2723
- })), Y = i(() => nn(G.value)), X = i(() => nn(K.value)), re = i(() => X.value && _.value >= Sr), ie = i(() => X.value && !re.value), ae = i(() => nn(J.value)), { emptyStateProps: Z, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = on({
3091
+ })), Y = i(() => an(ne.value)), ie = i(() => an(K.value)), ae = i(() => ie.value && _.value >= ai), oe = i(() => ie.value && !ae.value), se = i(() => an(re.value)), { emptyStateProps: X, showBadgeEmptyState: fe, showCustomEmptyState: pe, showInlineEmptyState: me } = cn({
2724
3092
  emptyStateMode: N(d, "emptyStateMode"),
2725
3093
  itemCount: i(() => d.items.length),
2726
3094
  loading: N(d, "loading"),
@@ -2728,31 +3096,31 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2728
3096
  surface: "fullscreen"
2729
3097
  });
2730
3098
  S(() => {
2731
- window.addEventListener("resize", pe);
3099
+ window.addEventListener("resize", he);
2732
3100
  }), x(() => {
2733
- window.removeEventListener("resize", pe);
3101
+ window.removeEventListener("resize", he);
2734
3102
  });
2735
- function pe() {
2736
- _.value = window.innerWidth || Sr;
3103
+ function he() {
3104
+ _.value = window.innerWidth || ai;
2737
3105
  }
2738
- function me(e, t) {
2739
- C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && _e(e, t);
3106
+ function ge(e, t) {
3107
+ C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && ye(e, t);
2740
3108
  }
2741
- function he(e, t) {
2742
- C.registerMediaElement(e, t), h.registerVideoElement(e, t);
3109
+ function _e(e, t) {
3110
+ C.registerMediaElement(e, t), h.registerVideoElement(e, t), T.registerElement(e, t);
2743
3111
  }
2744
- function ge(e, t) {
3112
+ function ve(e, t) {
2745
3113
  C.registerMediaElement(e, t), h.registerAudioElement(e, t);
2746
3114
  }
2747
- function Q(e, t, n) {
2748
- let r = I.onFullscreenMediaEvent(e, t, n), i = n.currentTarget, a = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
3115
+ function Z(e, t, n) {
3116
+ let r = R.onFullscreenMediaEvent(e, t, n), i = n.currentTarget, a = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
2749
3117
  r && i instanceof HTMLMediaElement && i.readyState >= a && C.settleAssetPreload(r);
2750
3118
  }
2751
- function _e(e, t) {
2752
- P(e, t);
3119
+ function ye(e, t) {
3120
+ I(e, t);
2753
3121
  }
2754
- function ve(e, t, n) {
2755
- let r = I.getHandledItemKey(t, n);
3122
+ function be(e, t, n) {
3123
+ let r = R.getHandledItemKey(t, n);
2756
3124
  if (!r || (h.onMediaEvent(r, e), !d.loopFullscreenVideo)) return;
2757
3125
  let i = e.currentTarget;
2758
3126
  if (!(i instanceof HTMLVideoElement)) return;
@@ -2762,24 +3130,24 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2762
3130
  let a = i.play();
2763
3131
  a && typeof a.catch == "function" && a.catch(() => {});
2764
3132
  }
2765
- return (e, n) => (w(), s("div", Un, [
3133
+ return (e, n) => (w(), s("div", Er, [
2766
3134
  c("div", {
2767
- class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
2768
- style: b(F(j))
3135
+ class: v(["absolute inset-0 transition-[background] duration-200", E.value]),
3136
+ style: b(F(P))
2769
3137
  }, null, 6),
2770
3138
  c("div", {
2771
3139
  class: "relative z-[1] grid h-full min-h-0",
2772
- style: b(ne.value)
3140
+ style: b(J.value)
2773
3141
  }, [c("div", {
2774
3142
  ref: "viewer.stageRef",
2775
3143
  "data-testid": "vibe-stage",
2776
3144
  class: "relative h-full min-h-0 touch-none overflow-hidden",
2777
- onPointerdown: n[1] ||= (...e) => F(h).onPointerDown && F(h).onPointerDown(...e),
2778
- onPointermove: n[2] ||= (...e) => F(h).onPointerMove && F(h).onPointerMove(...e),
2779
- onPointerup: n[3] ||= (...e) => F(h).onPointerUp && F(h).onPointerUp(...e),
2780
- onPointercancel: n[4] ||= (...e) => F(h).onPointerCancel && F(h).onPointerCancel(...e),
2781
- onWheel: n[5] ||= (...e) => F(h).onWheel && F(h).onWheel(...e)
2782
- }, [F(h).activeItem.value ? (w(), s("div", Wn, [
3145
+ onPointerdown: n[2] ||= (...e) => F(h).onPointerDown && F(h).onPointerDown(...e),
3146
+ onPointermove: n[3] ||= (...e) => F(h).onPointerMove && F(h).onPointerMove(...e),
3147
+ onPointerup: n[4] ||= (...e) => F(h).onPointerUp && F(h).onPointerUp(...e),
3148
+ onPointercancel: n[5] ||= (...e) => F(h).onPointerCancel && F(h).onPointerCancel(...e),
3149
+ onWheel: n[6] ||= (...e) => F(h).onWheel && F(h).onWheel(...e)
3150
+ }, [F(h).activeItem.value ? (w(), s("div", Dr, [
2783
3151
  (w(!0), s(t, null, O(F(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
2784
3152
  key: F(C).getItemKey(r),
2785
3153
  "data-testid": "vibe-slide",
@@ -2791,12 +3159,12 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2791
3159
  class: v(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === F(h).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
2792
3160
  style: b(F(h).getSlideStyle(i))
2793
3161
  }, [c("div", {
2794
- class: v(["absolute inset-0 opacity-85", F(Fn)(r.type)]),
2795
- style: b(i === F(h).resolvedActiveIndex.value && r.type === "image" ? F(E) : void 0)
3162
+ class: v(["absolute inset-0 opacity-85", F(zn)(r.type)]),
3163
+ style: b(i === F(h).resolvedActiveIndex.value && r.type === "image" ? F(j) : void 0)
2796
3164
  }, null, 6), F(h).isVisual(r) ? (w(), s("div", {
2797
3165
  key: 0,
2798
- class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === F(h).resolvedActiveIndex.value ? V.value : ""])
2799
- }, [F(C).isAssetLoading(i, r) ? (w(), s("div", Kn, [c("span", qn, [u(F(oe), {
3166
+ class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === F(h).resolvedActiveIndex.value ? U.value : ""])
3167
+ }, [F(C).isAssetLoading(i, r) ? (w(), s("div", kr, [c("span", Ar, [u(F(ce), {
2800
3168
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2801
3169
  "aria-hidden": "true"
2802
3170
  })])])) : o("", !0), F(C).isAssetErrored(i, r) ? (w(), s("div", {
@@ -2804,19 +3172,19 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2804
3172
  "data-testid": "vibe-asset-error",
2805
3173
  "data-kind": F(C).getAssetErrorKind(r),
2806
3174
  class: "grid h-full w-full place-items-center"
2807
- }, [c("div", Yn, [
2808
- u(F(le), {
3175
+ }, [c("div", Mr, [
3176
+ u(F(de), {
2809
3177
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2810
3178
  "aria-hidden": "true"
2811
3179
  }),
2812
- c("p", Xn, M(F(C).getAssetErrorLabel(r)), 1),
3180
+ c("p", Nr, M(F(C).getAssetErrorLabel(r)), 1),
2813
3181
  F(h).canRetryAsset(F(C).getItemKey(r)) ? (w(), s("button", {
2814
3182
  key: 0,
2815
3183
  type: "button",
2816
3184
  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",
2817
3185
  onClick: H((e) => F(h).retryAsset(F(C).getItemKey(r)), ["stop"])
2818
- }, " Retry ", 8, Zn)) : o("", !0)
2819
- ])], 8, Jn)) : r.type === "image" ? (w(), s("img", {
3186
+ }, " Retry ", 8, Pr)) : o("", !0)
3187
+ ])], 8, jr)) : r.type === "image" ? (w(), s("img", {
2820
3188
  key: F(h).getAssetRenderKey(F(C).getItemKey(r)),
2821
3189
  src: F(C).getFullscreenImageSource(i, r),
2822
3190
  alt: r.title ?? "",
@@ -2824,10 +3192,10 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2824
3192
  draggable: "false",
2825
3193
  class: v(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", F(h).isImageReady(F(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
2826
3194
  ref_for: !0,
2827
- ref: (e) => me(F(C).getItemKey(r), e),
2828
- onLoad: (e) => F(I).onFullscreenImageLoad(e, i, r),
2829
- onError: (e) => F(I).onFullscreenImageError(i, r)
2830
- }, null, 42, Qn)) : (w(), s("video", {
3195
+ ref: (e) => ge(F(C).getItemKey(r), e),
3196
+ onLoad: (e) => F(R).onFullscreenImageLoad(e, i, r),
3197
+ onError: (e) => F(R).onFullscreenImageError(i, r)
3198
+ }, null, 42, Fr)) : (w(), s("video", {
2831
3199
  key: F(h).getAssetRenderKey(F(C).getItemKey(r)),
2832
3200
  class: v(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", F(h).isMediaReady(F(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
2833
3201
  playsinline: "",
@@ -2835,26 +3203,26 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2835
3203
  src: F(C).getFullscreenMediaSource(i, r),
2836
3204
  preload: F(C).getFullscreenMediaPreload(i),
2837
3205
  ref_for: !0,
2838
- ref: (e) => he(F(C).getItemKey(r), e),
3206
+ ref: (e) => _e(F(C).getItemKey(r), e),
2839
3207
  onClick: H((e) => F(h).onVideoClick(e, F(C).getItemKey(r)), ["stop"]),
2840
- onCanplay: (e) => Q(i, r, e),
2841
- onDurationchange: (e) => Q(i, r, e),
2842
- onEnded: (e) => ve(e, i, r),
2843
- onError: (e) => F(I).onFullscreenMediaError(i, r),
2844
- onLoadstart: (e) => Q(i, r, e),
2845
- onLoadedmetadata: (e) => Q(i, r, e),
2846
- onPause: (e) => Q(i, r, e),
2847
- onPlay: (e) => Q(i, r, e),
2848
- onPlaying: (e) => Q(i, r, e),
2849
- onSeeking: (e) => Q(i, r, e),
2850
- onSeeked: (e) => Q(i, r, e),
2851
- onStalled: (e) => Q(i, r, e),
2852
- onTimeupdate: (e) => Q(i, r, e),
2853
- onWaiting: (e) => Q(i, r, e)
2854
- }, null, 42, $n))], 2)) : F(h).isAudio(r) ? (w(), s("div", {
3208
+ onCanplay: (e) => Z(i, r, e),
3209
+ onDurationchange: (e) => Z(i, r, e),
3210
+ onEnded: (e) => be(e, i, r),
3211
+ onError: (e) => F(R).onFullscreenMediaError(i, r),
3212
+ onLoadstart: (e) => Z(i, r, e),
3213
+ onLoadedmetadata: (e) => Z(i, r, e),
3214
+ onPause: (e) => Z(i, r, e),
3215
+ onPlay: (e) => Z(i, r, e),
3216
+ onPlaying: (e) => Z(i, r, e),
3217
+ onSeeking: (e) => Z(i, r, e),
3218
+ onSeeked: (e) => Z(i, r, e),
3219
+ onStalled: (e) => Z(i, r, e),
3220
+ onTimeupdate: (e) => Z(i, r, e),
3221
+ onWaiting: (e) => Z(i, r, e)
3222
+ }, null, 42, Ir))], 2)) : F(h).isAudio(r) ? (w(), s("div", {
2855
3223
  key: 1,
2856
- class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === F(h).resolvedActiveIndex.value ? V.value : ""])
2857
- }, [c("div", er, [
3224
+ class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === F(h).resolvedActiveIndex.value ? U.value : ""])
3225
+ }, [c("div", Lr, [
2858
3226
  c("button", {
2859
3227
  type: "button",
2860
3228
  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]",
@@ -2862,70 +3230,70 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2862
3230
  disabled: !!F(C).getAssetErrorKind(r),
2863
3231
  onClick: (e) => F(h).onAudioCoverClick(e, F(C).getItemKey(r))
2864
3232
  }, [
2865
- 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),
2866
- 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),
2867
- c("span", nr, [k(e.$slots, "item-icon", {
2868
- icon: F(Ut)(r.type),
3233
+ n[7] ||= 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),
3234
+ n[8] ||= 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),
3235
+ c("span", zr, [k(e.$slots, "item-icon", {
3236
+ icon: F(Gt)(r.type),
2869
3237
  item: r
2870
- }, () => [(w(), a(A(F(Ut)(r.type)), {
3238
+ }, () => [(w(), a(A(F(Gt)(r.type)), {
2871
3239
  class: "h-6 w-6 stroke-[1.9]",
2872
3240
  "aria-hidden": "true"
2873
3241
  }))])]),
2874
- c("span", rr, [(w(), a(A(F(h).mediaStates.value[F(C).getItemKey(r)]?.paused ?? !0 ? F(ce) : F(se)), {
3242
+ c("span", Br, [(w(), a(A(F(h).mediaStates.value[F(C).getItemKey(r)]?.paused ?? !0 ? F(ue) : F(le)), {
2875
3243
  class: "h-4 w-4 stroke-2",
2876
3244
  "aria-hidden": "true"
2877
3245
  }))])
2878
- ], 8, tr),
2879
- F(C).isAssetLoading(i, r) ? (w(), s("div", ir, [c("span", ar, [u(F(oe), {
3246
+ ], 8, Rr),
3247
+ F(C).isAssetLoading(i, r) ? (w(), s("div", Vr, [c("span", Hr, [u(F(ce), {
2880
3248
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2881
3249
  "aria-hidden": "true"
2882
3250
  })])])) : o("", !0),
2883
- F(C).getAssetErrorKind(r) ? (w(), s(t, { key: 1 }, [n[8] ||= c("div", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(239,68,68,0.12),transparent_66%)]" }, null, -1), c("div", {
3251
+ F(C).getAssetErrorKind(r) ? (w(), s(t, { key: 1 }, [n[9] ||= c("div", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(239,68,68,0.12),transparent_66%)]" }, null, -1), c("div", {
2884
3252
  "data-testid": "vibe-asset-error",
2885
3253
  "data-kind": F(C).getAssetErrorKind(r),
2886
3254
  class: "relative z-[1] grid justify-items-center gap-4"
2887
3255
  }, [
2888
- u(F(le), {
3256
+ u(F(de), {
2889
3257
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2890
3258
  "aria-hidden": "true"
2891
3259
  }),
2892
- c("p", sr, M(F(C).getAssetErrorLabel(r)), 1),
3260
+ c("p", Wr, M(F(C).getAssetErrorLabel(r)), 1),
2893
3261
  F(h).canRetryAsset(F(C).getItemKey(r)) ? (w(), s("button", {
2894
3262
  key: 0,
2895
3263
  type: "button",
2896
3264
  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",
2897
3265
  onClick: H((e) => F(h).retryAsset(F(C).getItemKey(r)), ["stop"])
2898
- }, " Retry ", 8, cr)) : o("", !0)
2899
- ], 8, or)], 64)) : o("", !0)
3266
+ }, " Retry ", 8, Gr)) : o("", !0)
3267
+ ], 8, Ur)], 64)) : o("", !0)
2900
3268
  ]), (w(), s("audio", {
2901
3269
  key: F(h).getAssetRenderKey(F(C).getItemKey(r)),
2902
3270
  src: F(C).getFullscreenMediaSource(i, r),
2903
3271
  preload: F(C).getFullscreenMediaPreload(i),
2904
3272
  class: "pointer-events-none absolute h-px w-px opacity-0",
2905
3273
  ref_for: !0,
2906
- ref: (e) => ge(F(C).getItemKey(r), e),
2907
- onCanplay: (e) => Q(i, r, e),
2908
- onDurationchange: (e) => Q(i, r, e),
2909
- onError: (e) => F(I).onFullscreenMediaError(i, r),
2910
- onLoadstart: (e) => Q(i, r, e),
2911
- onLoadedmetadata: (e) => Q(i, r, e),
2912
- onPause: (e) => Q(i, r, e),
2913
- onPlay: (e) => Q(i, r, e),
2914
- onPlaying: (e) => Q(i, r, e),
2915
- onSeeking: (e) => Q(i, r, e),
2916
- onSeeked: (e) => Q(i, r, e),
2917
- onStalled: (e) => Q(i, r, e),
2918
- onTimeupdate: (e) => Q(i, r, e),
2919
- onWaiting: (e) => Q(i, r, e)
2920
- }, null, 40, lr))], 2)) : (w(), s("div", ur, [c("div", dr, [k(e.$slots, "item-icon", {
2921
- icon: F(Ut)(r.type),
3274
+ ref: (e) => ve(F(C).getItemKey(r), e),
3275
+ onCanplay: (e) => Z(i, r, e),
3276
+ onDurationchange: (e) => Z(i, r, e),
3277
+ onError: (e) => F(R).onFullscreenMediaError(i, r),
3278
+ onLoadstart: (e) => Z(i, r, e),
3279
+ onLoadedmetadata: (e) => Z(i, r, e),
3280
+ onPause: (e) => Z(i, r, e),
3281
+ onPlay: (e) => Z(i, r, e),
3282
+ onPlaying: (e) => Z(i, r, e),
3283
+ onSeeking: (e) => Z(i, r, e),
3284
+ onSeeked: (e) => Z(i, r, e),
3285
+ onStalled: (e) => Z(i, r, e),
3286
+ onTimeupdate: (e) => Z(i, r, e),
3287
+ onWaiting: (e) => Z(i, r, e)
3288
+ }, null, 40, Kr))], 2)) : (w(), s("div", qr, [c("div", Jr, [k(e.$slots, "item-icon", {
3289
+ icon: F(Gt)(r.type),
2922
3290
  item: r
2923
- }, () => [(w(), a(A(F(Ut)(r.type)), {
3291
+ }, () => [(w(), a(A(F(Gt)(r.type)), {
2924
3292
  class: "h-6 w-6 stroke-[1.9]",
2925
3293
  "aria-hidden": "true"
2926
- }))])])]))], 14, Gn))), 128)),
2927
- W.value && f["fullscreen-overlay"] ? (w(), s("div", fr, [c("div", pr, [k(e.$slots, "fullscreen-overlay", y(p(W.value)))])])) : o("", !0),
2928
- F(h).activeItem.value ? (w(), a(Bt, {
3294
+ }))])])]))], 14, Or))), 128)),
3295
+ G.value && f["fullscreen-overlay"] ? (w(), s("div", Yr, [c("div", Xr, [k(e.$slots, "fullscreen-overlay", y(p(G.value)))])])) : o("", !0),
3296
+ F(h).activeItem.value ? (w(), a(Ht, {
2929
3297
  key: 1,
2930
3298
  "current-index": F(h).resolvedActiveIndex.value,
2931
3299
  loading: d.loading,
@@ -2935,9 +3303,9 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2935
3303
  title: F(h).activeItem.value.title ?? null,
2936
3304
  total: F(h).items.value.length,
2937
3305
  onBackToList: n[0] ||= (e) => m("back-to-list")
2938
- }, l({ _: 2 }, [Y.value && W.value ? {
3306
+ }, l({ _: 2 }, [Y.value && G.value ? {
2939
3307
  name: "actions",
2940
- fn: B(() => [k(e.$slots, "fullscreen-header-actions", y(p(W.value)))]),
3308
+ fn: B(() => [k(e.$slots, "fullscreen-header-actions", y(p(G.value)))]),
2941
3309
  key: "0"
2942
3310
  } : void 0]), 1032, [
2943
3311
  "current-index",
@@ -2948,7 +3316,12 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2948
3316
  "title",
2949
3317
  "total"
2950
3318
  ])) : o("", !0),
2951
- z.value ? (w(), a(kt, {
3319
+ u(Sr, {
3320
+ "active-index": F(h).resolvedActiveIndex.value,
3321
+ items: F(h).items.value,
3322
+ onSelect: n[1] ||= (e) => m("update:activeIndex", e)
3323
+ }, null, 8, ["active-index", "items"]),
3324
+ ee.value ? (w(), a(jt, {
2952
3325
  key: 2,
2953
3326
  "current-time": F(h).activeMediaState.value.currentTime,
2954
3327
  "current-time-label": F(h).formatPlaybackTime(F(h).activeMediaState.value.currentTime),
@@ -2956,8 +3329,10 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2956
3329
  "duration-label": F(h).formatPlaybackTime(F(h).activeMediaDuration.value),
2957
3330
  muted: F(h).activeMediaState.value.muted,
2958
3331
  progress: F(h).activeMediaProgress.value,
3332
+ "show-fullscreen-control": F(h).activeMediaItem.value?.type === "video",
2959
3333
  volume: F(h).activeMediaState.value.volume,
2960
- "volume-control-layout": ee.value,
3334
+ "volume-control-layout": V.value,
3335
+ onFullscreenRequest: F(T).request,
2961
3336
  onSeekInput: F(h).onMediaSeekInput,
2962
3337
  onVolumeInput: F(h).onMediaVolumeInput,
2963
3338
  onVolumeToggle: F(h).onMediaVolumeToggle
@@ -2968,42 +3343,44 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
2968
3343
  "duration-label",
2969
3344
  "muted",
2970
3345
  "progress",
3346
+ "show-fullscreen-control",
2971
3347
  "volume",
2972
3348
  "volume-control-layout",
3349
+ "onFullscreenRequest",
2973
3350
  "onSeekInput",
2974
3351
  "onVolumeInput",
2975
3352
  "onVolumeToggle"
2976
3353
  ])) : o("", !0),
2977
3354
  q.value ? (w(), s("div", {
2978
3355
  key: 3,
2979
- class: v(["absolute left-1/2 z-[4] -translate-x-1/2", R.value])
2980
- }, [ae.value ? k(e.$slots, "fullscreen-status", y(g({ key: 0 }, q.value))) : (w(), s("div", {
3356
+ class: v(["absolute left-1/2 z-[4] -translate-x-1/2", z.value])
3357
+ }, [se.value ? k(e.$slots, "fullscreen-status", y(g({ key: 0 }, q.value))) : (w(), s("div", {
2981
3358
  key: 1,
2982
3359
  "data-testid": "vibe-fullscreen-status-badge",
2983
3360
  class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", q.value.kind === "end" ? "border-amber-300/35 text-amber-200" : q.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2984
3361
  }, M(q.value.message), 3))], 2)) : o("", !0)
2985
- ])) : U.value ? (w(), s("div", mr, [c("div", hr, [c("span", gr, [u(F(oe), {
3362
+ ])) : te.value ? (w(), s("div", Zr, [c("div", Qr, [c("span", $r, [u(F(ce), {
2986
3363
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2987
3364
  "aria-hidden": "true"
2988
- })]), c("p", _r, M(te.value), 1)])])) : F(fe) && F(Z) ? (w(), a(Hn, {
3365
+ })]), c("p", ei, M(W.value), 1)])])) : F(me) && F(X) ? (w(), a(Tr, {
2989
3366
  key: 2,
2990
- message: F(Z).message,
2991
- mode: F(Z).mode,
2992
- surface: F(Z).surface
3367
+ message: F(X).message,
3368
+ mode: F(X).mode,
3369
+ surface: F(X).surface
2993
3370
  }, {
2994
- default: B(() => [F(de) ? k(e.$slots, "empty-state", y(g({ key: 0 }, F(Z)))) : o("", !0)]),
3371
+ default: B(() => [F(pe) ? k(e.$slots, "empty-state", y(g({ key: 0 }, F(X)))) : o("", !0)]),
2995
3372
  _: 3
2996
3373
  }, 8, [
2997
3374
  "message",
2998
3375
  "mode",
2999
3376
  "surface"
3000
- ])) : o("", !0), F(ue) && F(Z) ? (w(), a(Hn, {
3377
+ ])) : o("", !0), F(fe) && F(X) ? (w(), a(Tr, {
3001
3378
  key: 3,
3002
- message: F(Z).message,
3003
- mode: F(Z).mode,
3004
- surface: F(Z).surface
3379
+ message: F(X).message,
3380
+ mode: F(X).mode,
3381
+ surface: F(X).surface
3005
3382
  }, {
3006
- default: B(() => [F(de) ? k(e.$slots, "empty-state", y(g({ key: 0 }, F(Z)))) : o("", !0)]),
3383
+ default: B(() => [F(pe) ? k(e.$slots, "empty-state", y(g({ key: 0 }, F(X)))) : o("", !0)]),
3007
3384
  _: 3
3008
3385
  }, 8, [
3009
3386
  "message",
@@ -3017,7 +3394,7 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
3017
3394
  "leave-from-class": "translate-x-0 opacity-100",
3018
3395
  "leave-to-class": "translate-x-full opacity-0"
3019
3396
  }, {
3020
- default: B(() => [re.value && W.value ? (w(), s("aside", vr, [c("div", yr, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
3397
+ default: B(() => [ae.value && G.value ? (w(), s("aside", ti, [c("div", ni, [k(e.$slots, "fullscreen-aside", y(p(G.value)))])])) : o("", !0)]),
3021
3398
  _: 3
3022
3399
  })], 4),
3023
3400
  u(r, {
@@ -3028,127 +3405,18 @@ var Bn = ["data-surface"], Vn = ["data-surface"], Hn = /* @__PURE__ */ d({
3028
3405
  "leave-from-class": "translate-x-0 opacity-100",
3029
3406
  "leave-to-class": "translate-x-full opacity-0"
3030
3407
  }, {
3031
- default: B(() => [ie.value && W.value ? (w(), s("aside", br, [c("div", xr, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
3408
+ default: B(() => [oe.value && G.value ? (w(), s("aside", ri, [c("div", ii, [k(e.$slots, "fullscreen-aside", y(p(G.value)))])])) : o("", !0)]),
3032
3409
  _: 3
3033
3410
  })
3034
3411
  ]));
3035
3412
  }
3036
- }), Tr = 1, Er = .5;
3037
- function Dr(e) {
3038
- if (e.type !== "image" && e.type !== "video") return {
3039
- width: Tr,
3040
- height: Tr,
3041
- source: "fallback"
3042
- };
3043
- let t = e.preview?.width, n = e.preview?.height;
3044
- if (Ir(t) && Ir(n)) {
3045
- let r = Lr(e, t, n);
3046
- return {
3047
- width: r.width,
3048
- height: r.height,
3049
- source: "preview"
3050
- };
3051
- }
3052
- if (Ir(e.width) && Ir(e.height)) {
3053
- let t = Lr(e, e.width, e.height);
3054
- return {
3055
- width: t.width,
3056
- height: t.height,
3057
- source: "original"
3058
- };
3059
- }
3060
- return {
3061
- width: Tr,
3062
- height: Tr,
3063
- source: "fallback"
3064
- };
3065
- }
3066
- function Or(e, t) {
3067
- return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
3068
- }
3069
- function kr(e, t, n, r = 0) {
3070
- if (!e || e <= 0 || !t || t <= 0) return n;
3071
- let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
3072
- return !a || a <= 0 ? n : a / t;
3073
- }
3074
- function Ar(e, t) {
3075
- let n = Dr(e);
3076
- return n.height / n.width * t;
3077
- }
3078
- function jr(e, t) {
3079
- let n = Array.from({ length: t.columnCount }, () => 0), r = {
3080
- positions: Array(e.length),
3081
- heights: Array(e.length),
3082
- buckets: /* @__PURE__ */ new Map(),
3083
- contentHeight: 0,
3084
- indexById: /* @__PURE__ */ new Map(),
3085
- columnHeights: n
3086
- };
3087
- return Mr(r, e, {
3088
- ...t,
3089
- startIndex: 0
3090
- }), r;
3091
- }
3092
- function Mr(e, t, n) {
3093
- for (let r = 0; r < t.length; r += 1) {
3094
- let i = t[r], a = n.startIndex + r;
3095
- e.indexById.set($(i), a);
3096
- let o = 0;
3097
- for (let t = 1; t < e.columnHeights.length; t += 1) e.columnHeights[t] < e.columnHeights[o] && (o = t);
3098
- let s = o * (n.columnWidth + n.gapX), c = e.columnHeights[o], l = Ar(i, n.columnWidth);
3099
- e.positions[a] = {
3100
- x: s + (n.positionOffsetX ?? 0),
3101
- y: c + (n.positionOffsetY ?? 0)
3102
- }, e.heights[a] = l, e.columnHeights[o] = c + l + n.gapY, e.contentHeight = Math.max(e.contentHeight, c + l);
3103
- let u = Math.floor(c / n.bucketPx), d = Math.floor((c + l) / n.bucketPx);
3104
- for (let t = u; t <= d; t += 1) {
3105
- let n = e.buckets.get(t);
3106
- n ? e.buckets.set(t, [...n, a]) : e.buckets.set(t, [a]);
3107
- }
3108
- }
3109
- return e;
3110
- }
3111
- function Nr(e, t) {
3112
- let n = [...t.columnHeights], r = t.contentHeight;
3113
- for (let i of e) {
3114
- let e = 0;
3115
- for (let t = 1; t < n.length; t += 1) n[t] < n[e] && (e = t);
3116
- let a = n[e], o = Ar(i, t.columnWidth);
3117
- n[e] = a + o + t.gapY, r = Math.max(r, a + o);
3118
- }
3119
- return r;
3120
- }
3121
- function Pr(e) {
3122
- return e.addedItems.length === 0 || e.removedItemCount > 0 || e.isPrepend || e.previousItems.length === 0 || e.layoutItemCount !== e.previousItems.length || e.columnHeights.length !== e.columnCount || e.currentItems.length !== e.previousItems.length + e.addedItems.length ? !1 : e.previousItems.every((t, n) => $(t) === $(e.currentItems[n]));
3123
- }
3124
- function Fr(e) {
3125
- if (e.itemCount <= 0) return [];
3126
- if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
3127
- 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();
3128
- for (let t = r; t <= i; t += 1) {
3129
- let n = e.buckets.get(t);
3130
- if (n) for (let e of n) a.add(e);
3131
- }
3132
- return Array.from(a).sort((e, t) => e - t);
3133
- }
3134
- function Ir(e) {
3135
- return typeof e == "number" && Number.isFinite(e) && e > 0;
3136
- }
3137
- function Lr(e, t, n) {
3138
- return e.type !== "image" || n / t >= Er ? {
3139
- width: t,
3140
- height: n
3141
- } : {
3142
- width: t,
3143
- height: t
3144
- };
3145
- }
3413
+ });
3146
3414
  //#endregion
3147
3415
  //#region src/components/viewer-core/masonryLayoutState.ts
3148
- function Rr(e) {
3416
+ function ci(e) {
3149
3417
  let t = j([]), n = j([]), r = j(/* @__PURE__ */ new Map()), i = j(0), a = j(/* @__PURE__ */ new Map()), o = j([]);
3150
3418
  function s(s, c, l) {
3151
- let u = jr(s, {
3419
+ let u = Zn(s, {
3152
3420
  columnCount: c,
3153
3421
  columnWidth: l,
3154
3422
  gapX: e.gapPx,
@@ -3158,7 +3426,7 @@ function Rr(e) {
3158
3426
  t.value = u.positions.map(d), n.value = u.heights, r.value = u.buckets, i.value = u.contentHeight, a.value = u.indexById, o.value = u.columnHeights;
3159
3427
  }
3160
3428
  function c(s, c, l, d) {
3161
- i.value = Mr(u(), s, {
3429
+ i.value = Qn(u(), s, {
3162
3430
  columnCount: l,
3163
3431
  columnWidth: d,
3164
3432
  gapX: e.gapPx,
@@ -3170,7 +3438,7 @@ function Rr(e) {
3170
3438
  }).contentHeight, P(t), P(n), P(r), P(a), P(o);
3171
3439
  }
3172
3440
  function l(e, n, r, i) {
3173
- return Pr({
3441
+ return er({
3174
3442
  addedItems: r.addedItems,
3175
3443
  columnCount: i,
3176
3444
  columnHeights: o.value,
@@ -3211,21 +3479,21 @@ function Rr(e) {
3211
3479
  }
3212
3480
  //#endregion
3213
3481
  //#region src/components/viewer-core/useMasonryMotion.ts
3214
- var zr = 300, Br = 600, Vr = 40, Hr = 300, Ur = 400;
3215
- function Wr(e, t) {
3482
+ var li = 300, ui = 600, di = 40, fi = 300, pi = 400;
3483
+ function mi(e, t) {
3216
3484
  return t === "top" ? [...e].reverse() : e;
3217
3485
  }
3218
- function Gr(e) {
3219
- return e <= 0 ? Br : Br + Math.min((e - 1) * Vr, Ur);
3486
+ function hi(e) {
3487
+ return e <= 0 ? ui : ui + Math.min((e - 1) * di, pi);
3220
3488
  }
3221
- function Kr() {
3222
- return Hr;
3489
+ function gi() {
3490
+ return fi;
3223
3491
  }
3224
- function qr(e) {
3492
+ function _i(e) {
3225
3493
  let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
3226
3494
  return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
3227
3495
  }
3228
- function Jr(e) {
3496
+ function vi(e) {
3229
3497
  let t = D(/* @__PURE__ */ new Set()), n = D(/* @__PURE__ */ new Set()), r = D(/* @__PURE__ */ new Map()), a = D(/* @__PURE__ */ new Map()), o = D(/* @__PURE__ */ new Map()), s = D(/* @__PURE__ */ new Set()), c = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Map()), u = D(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
3230
3498
  z(e.visibleIndices, (i) => {
3231
3499
  if (!i.length) return;
@@ -3235,20 +3503,20 @@ function Jr(e) {
3235
3503
  !r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
3236
3504
  }
3237
3505
  if (!o.length) return;
3238
- let s = Wr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
3239
- for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Vr, Ur));
3240
- r.value = c, Yr(() => {
3506
+ let s = mi(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
3507
+ for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * di, pi));
3508
+ r.value = c, yi(() => {
3241
3509
  let e = new Set(n.value);
3242
3510
  for (let t of o) e.add(t);
3243
3511
  n.value = e;
3244
- }), Xr(() => {
3512
+ }), bi(() => {
3245
3513
  let e = new Set(t.value);
3246
3514
  for (let t of o) e.delete(t);
3247
3515
  t.value = e, S(() => {
3248
3516
  let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
3249
3517
  for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
3250
3518
  n.value = e, r.value = t, a.value = i;
3251
- }, Gr(o.length));
3519
+ }, hi(o.length));
3252
3520
  });
3253
3521
  }, { flush: "post" }), z(() => e.items.value.map((e) => $(e)), (e) => {
3254
3522
  if (!e.length || !o.value.size) return;
@@ -3275,7 +3543,7 @@ function Jr(e) {
3275
3543
  let e = $(t.item);
3276
3544
  p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
3277
3545
  }
3278
- o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Yr(() => {
3546
+ o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, yi(() => {
3279
3547
  let e = new Set(s.value);
3280
3548
  for (let t of p) e.add(t);
3281
3549
  s.value = e;
@@ -3283,9 +3551,9 @@ function Jr(e) {
3283
3551
  let e = new Map(o.value), t = new Set(s.value);
3284
3552
  for (let n of p) e.delete(n), t.delete(n);
3285
3553
  o.value = e, s.value = t;
3286
- }, Hr);
3554
+ }, fi);
3287
3555
  }
3288
- function g(t, n, r = zr) {
3556
+ function g(t, n, r = li) {
3289
3557
  if (!t.size) return;
3290
3558
  let i = /* @__PURE__ */ new Map(), a = [];
3291
3559
  for (let [r, o] of t.entries()) {
@@ -3304,8 +3572,8 @@ function Jr(e) {
3304
3572
  c.value = i, u.value = /* @__PURE__ */ new Set();
3305
3573
  let o = new Map(l.value);
3306
3574
  for (let e of a) o.set(e, r);
3307
- l.value = o, Yr(() => {
3308
- u.value = new Set(a), Yr(() => {
3575
+ l.value = o, yi(() => {
3576
+ u.value = new Set(a), yi(() => {
3309
3577
  c.value = /* @__PURE__ */ new Map();
3310
3578
  });
3311
3579
  }), S(() => {
@@ -3316,8 +3584,8 @@ function Jr(e) {
3316
3584
  }, r);
3317
3585
  }
3318
3586
  function _(e) {
3319
- if (n.value.has(e)) return `transform ${Br}ms ease-out`;
3320
- if (u.value.has(e)) return `transform ${l.value.get(e) ?? zr}ms ease-out`;
3587
+ if (n.value.has(e)) return `transform ${ui}ms ease-out`;
3588
+ if (u.value.has(e)) return `transform ${l.value.get(e) ?? li}ms ease-out`;
3321
3589
  }
3322
3590
  function v(e) {
3323
3591
  if (!n.value.has(e)) return;
@@ -3334,7 +3602,7 @@ function Jr(e) {
3334
3602
  } : {
3335
3603
  dx: 0,
3336
3604
  dy: 0
3337
- }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? qr({
3605
+ }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? _i({
3338
3606
  columnWidth: e.columnWidth.value,
3339
3607
  direction: u,
3340
3608
  itemHeight: o,
@@ -3348,14 +3616,14 @@ function Jr(e) {
3348
3616
  if (!r) return {
3349
3617
  opacity: "0",
3350
3618
  transform: "translate3d(0, 0, 0) scale(0.96)",
3351
- transition: `opacity ${Hr}ms ease-out, transform ${Hr}ms ease-out`
3619
+ transition: `opacity ${fi}ms ease-out, transform ${fi}ms ease-out`
3352
3620
  };
3353
3621
  let i = s.value.has(n);
3354
3622
  return {
3355
3623
  height: `${r.height}px`,
3356
3624
  opacity: i ? "0" : "1",
3357
3625
  transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
3358
- transition: `opacity ${Hr}ms ease-out, transform ${Hr}ms ease-out`,
3626
+ transition: `opacity ${fi}ms ease-out, transform ${fi}ms ease-out`,
3359
3627
  width: `${e.columnWidth.value}px`
3360
3628
  };
3361
3629
  }
@@ -3376,28 +3644,28 @@ function Jr(e) {
3376
3644
  playFlipMoveAnimation: g
3377
3645
  };
3378
3646
  }
3379
- function Yr(e) {
3647
+ function yi(e) {
3380
3648
  if (typeof requestAnimationFrame == "function") {
3381
3649
  requestAnimationFrame(() => e());
3382
3650
  return;
3383
3651
  }
3384
3652
  setTimeout(e, 0);
3385
3653
  }
3386
- function Xr(e) {
3387
- Yr(() => Yr(e));
3654
+ function bi(e) {
3655
+ yi(() => yi(e));
3388
3656
  }
3389
3657
  //#endregion
3390
3658
  //#region src/components/viewer-core/masonryViewport.ts
3391
- function Zr(e, t) {
3659
+ function xi(e, t) {
3392
3660
  return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
3393
3661
  }
3394
- function Qr(e, t, n) {
3662
+ function Si(e, t, n) {
3395
3663
  return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
3396
3664
  }
3397
- function $r(e, t, n, r) {
3665
+ function Ci(e, t, n, r) {
3398
3666
  return Math.max(e?.scrollHeight ?? 0, r) - (t + n);
3399
3667
  }
3400
- function ei(e, t) {
3668
+ function wi(e, t) {
3401
3669
  return {
3402
3670
  height: `${e}px`,
3403
3671
  transform: `translate3d(0, ${t}px, 0)`
@@ -3405,11 +3673,11 @@ function ei(e, t) {
3405
3673
  }
3406
3674
  //#endregion
3407
3675
  //#region src/components/viewer-core/masonryScrollBehavior.ts
3408
- var ti = 24, ni = 48;
3409
- function ri(e) {
3676
+ var Ti = 24, Ei = 48;
3677
+ function Di(e) {
3410
3678
  let t = D(0), n = 0, r = 0;
3411
3679
  function i(e) {
3412
- if (t.value = ci(e), t.value <= 0) {
3680
+ if (t.value = Mi(e), t.value <= 0) {
3413
3681
  o();
3414
3682
  return;
3415
3683
  }
@@ -3429,7 +3697,7 @@ function ri(e) {
3429
3697
  let s = e.getViewport();
3430
3698
  if (s && r > 0) {
3431
3699
  let n = Math.min(Math.max(0, i - r), 250), a = t.value * n / 1e3;
3432
- s.scrollTop = li(s.scrollTop + a, 0, e.getMaxScrollTop()), e.onScroll();
3700
+ s.scrollTop = Ni(s.scrollTop + a, 0, e.getMaxScrollTop()), e.onScroll();
3433
3701
  }
3434
3702
  r = i, a();
3435
3703
  }
@@ -3439,44 +3707,44 @@ function ri(e) {
3439
3707
  stop: o
3440
3708
  };
3441
3709
  }
3442
- function ii(e) {
3710
+ function Oi(e) {
3443
3711
  if (!e.active || !e.triggerEnabled) return 0;
3444
3712
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3445
- return t <= 0 ? 1 : li(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3713
+ return t <= 0 ? 1 : Ni(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3446
3714
  }
3447
- function ai(e) {
3715
+ function ki(e) {
3448
3716
  if (!e.active || !e.triggerEnabled) return 0;
3449
3717
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3450
- return t <= 0 ? 1 : li(e.progressDistancePx / t, 0, 1);
3718
+ return t <= 0 ? 1 : Ni(e.progressDistancePx / t, 0, 1);
3451
3719
  }
3452
- function oi(e) {
3453
- let t = i(() => Math.max(0, e.viewportHeight.value - ti * 2)), n = i(() => e.containerHeight.value > e.viewportHeight.value + 1 && t.value > 0), r = i(() => {
3720
+ function Ai(e) {
3721
+ let t = i(() => Math.max(0, e.viewportHeight.value - Ti * 2)), n = i(() => e.containerHeight.value > e.viewportHeight.value + 1 && t.value > 0), r = i(() => {
3454
3722
  if (!n.value) return 0;
3455
3723
  let r = e.viewportHeight.value / e.containerHeight.value * t.value;
3456
- return Math.min(t.value, Math.max(ni, r));
3724
+ return Math.min(t.value, Math.max(Ei, r));
3457
3725
  }), a = i(() => {
3458
- if (!n.value) return ti;
3726
+ if (!n.value) return Ti;
3459
3727
  let i = Math.max(0, e.containerHeight.value - e.viewportHeight.value);
3460
- return ti + Math.max(0, t.value - r.value) * (i > 0 ? li(e.scrollTop.value / i, 0, 1) : 0);
3728
+ return Ti + Math.max(0, t.value - r.value) * (i > 0 ? Ni(e.scrollTop.value / i, 0, 1) : 0);
3461
3729
  });
3462
3730
  return {
3463
- getScrollbarThumbStyle: () => ei(r.value, a.value),
3731
+ getScrollbarThumbStyle: () => wi(r.value, a.value),
3464
3732
  showScrollbar: n
3465
3733
  };
3466
3734
  }
3467
- function si(e) {
3735
+ function ji(e) {
3468
3736
  return typeof e == "number" && Number.isFinite(e) ? Math.max(0, e) : 0;
3469
3737
  }
3470
- function ci(e) {
3738
+ function Mi(e) {
3471
3739
  return Number.isFinite(e) ? Math.max(0, e) : 0;
3472
3740
  }
3473
- function li(e, t, n) {
3741
+ function Ni(e, t, n) {
3474
3742
  return Math.min(Math.max(e, t), n);
3475
3743
  }
3476
3744
  //#endregion
3477
3745
  //#region src/components/viewer-core/useEdgeBoundary.ts
3478
- var ui = 250, di = 1e3;
3479
- function fi(e) {
3746
+ var Pi = 250, Fi = 1e3;
3747
+ function Ii(e) {
3480
3748
  let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = D(!1), c = 0, l = null;
3481
3749
  x(() => {
3482
3750
  S();
@@ -3499,7 +3767,7 @@ function fi(e) {
3499
3767
  if (!C(t) || !e.isAtBoundary()) return;
3500
3768
  let n = Date.now();
3501
3769
  if (!(n < c)) {
3502
- if (c = n + ui, a.value) {
3770
+ if (c = n + Pi, a.value) {
3503
3771
  s.value = !0;
3504
3772
  return;
3505
3773
  }
@@ -3538,7 +3806,7 @@ function fi(e) {
3538
3806
  return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
3539
3807
  }
3540
3808
  function v() {
3541
- o.value = !1, y(di);
3809
+ o.value = !1, y(Fi);
3542
3810
  }
3543
3811
  function y(e) {
3544
3812
  S(), a.value = !0, l = setTimeout(() => {
@@ -3570,7 +3838,7 @@ function fi(e) {
3570
3838
  }
3571
3839
  //#endregion
3572
3840
  //#region src/components/viewer-core/masonryBoundaryLock.ts
3573
- function pi() {
3841
+ function Li() {
3574
3842
  let e = D(!1), t = null;
3575
3843
  x(() => {
3576
3844
  r();
@@ -3591,8 +3859,8 @@ function pi() {
3591
3859
  }
3592
3860
  //#endregion
3593
3861
  //#region src/components/viewer-core/masonryItemMutation.ts
3594
- function mi(e) {
3595
- let t = e.currentItems.map((e) => $(e)), n = e.previousItems.map((e) => $(e)), r = gi(e.previousItems, e.layoutIndexById, e.layoutHeights), i = _i(e.previousItems, e.layoutIndexById, e.layoutPositions), a = new Set(n), o = new Set(t), s = e.currentItems.filter((e) => !a.has($(e))), c = hi(e.previousItems, o, r, i), l = t.length > n.length && n.length > 0 && t[0] !== n[0], u = e.scrollTop > e.contentInsetPx + e.gapPx, d = l && u ? e.currentItems[e.activeIndex] : null;
3862
+ function Ri(e) {
3863
+ let t = e.currentItems.map((e) => $(e)), n = e.previousItems.map((e) => $(e)), r = Bi(e.previousItems, e.layoutIndexById, e.layoutHeights), i = Vi(e.previousItems, e.layoutIndexById, e.layoutPositions), a = new Set(n), o = new Set(t), s = e.currentItems.filter((e) => !a.has($(e))), c = zi(e.previousItems, o, r, i), l = t.length > n.length && n.length > 0 && t[0] !== n[0], u = e.scrollTop > e.contentInsetPx + e.gapPx, d = l && u ? e.currentItems[e.activeIndex] : null;
3596
3864
  return {
3597
3865
  addedItems: s,
3598
3866
  anchorId: d ? $(d) : null,
@@ -3604,7 +3872,7 @@ function mi(e) {
3604
3872
  shouldResetScrollForEmptyRemoval: e.currentItems.length === 0 && e.previousItems.length > 0 && c.length > 0 && e.scrollTop > 0
3605
3873
  };
3606
3874
  }
3607
- function hi(e, t, n, r) {
3875
+ function zi(e, t, n, r) {
3608
3876
  return e.flatMap((e) => {
3609
3877
  let i = $(e);
3610
3878
  if (t.has(i)) return [];
@@ -3616,7 +3884,7 @@ function hi(e, t, n, r) {
3616
3884
  }] : [];
3617
3885
  });
3618
3886
  }
3619
- function gi(e, t, n) {
3887
+ function Bi(e, t, n) {
3620
3888
  let r = /* @__PURE__ */ new Map();
3621
3889
  for (let i of e) {
3622
3890
  let e = $(i), a = t.get(e), o = a == null ? void 0 : n[a];
@@ -3624,7 +3892,7 @@ function gi(e, t, n) {
3624
3892
  }
3625
3893
  return r;
3626
3894
  }
3627
- function _i(e, t, n) {
3895
+ function Vi(e, t, n) {
3628
3896
  let r = /* @__PURE__ */ new Map();
3629
3897
  for (let i of e) {
3630
3898
  let e = $(i), a = t.get(e), o = a == null ? void 0 : n[a];
@@ -3634,7 +3902,7 @@ function _i(e, t, n) {
3634
3902
  }
3635
3903
  //#endregion
3636
3904
  //#region src/components/viewer-core/masonryPendingAppend.ts
3637
- function vi(e) {
3905
+ function Hi(e) {
3638
3906
  let t = D(null), n = D(!1), r = null;
3639
3907
  function i() {
3640
3908
  o(), e.pendingAppendItems.value.length && (t.value = c([...e.items.value, ...e.pendingAppendItems.value]), s());
@@ -3657,12 +3925,12 @@ function vi(e) {
3657
3925
  }, 300));
3658
3926
  }
3659
3927
  function c(t) {
3660
- return t.length ? e.pendingAppendItems.value.length && e.columnHeights.value.length === e.columnCount.value ? Nr(e.pendingAppendItems.value, {
3928
+ return t.length ? e.pendingAppendItems.value.length && e.columnHeights.value.length === e.columnCount.value ? $n(e.pendingAppendItems.value, {
3661
3929
  columnHeights: e.columnHeights.value,
3662
3930
  columnWidth: e.columnWidth.value,
3663
3931
  contentHeight: e.contentHeight.value,
3664
3932
  gapY: e.gapPx
3665
- }) + e.contentInsetPx * 2 : jr(t, {
3933
+ }) + e.contentInsetPx * 2 : Zn(t, {
3666
3934
  bucketPx: e.bucketPx,
3667
3935
  columnCount: e.columnCount.value,
3668
3936
  columnWidth: e.columnWidth.value,
@@ -3679,42 +3947,42 @@ function vi(e) {
3679
3947
  }
3680
3948
  //#endregion
3681
3949
  //#region src/components/viewer-core/useMasonryList.ts
3682
- var yi = 600, bi = 24, xi = 16, Si = 300, Ci = 200, wi = 0, Ti = 1, Ei = bi + xi, Di = 200, Oi = 500, ki = 1e3;
3683
- function Ai(e) {
3684
- let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Si), o = Rr({
3685
- bucketPx: yi,
3686
- contentInsetPx: bi,
3687
- gapPx: xi
3688
- }), { buckets: s, columnHeights: c, contentHeight: l, heights: u, indexById: d, positions: f } = o, p = D(null), m = pi(), h = i(() => Math.max(Si, a.value - bi * 2)), g = i(() => Or(h.value, Si)), v = i(() => kr(h.value, g.value, Si, xi)), y = i(() => si(e.bottomLoadBufferPx.value)), b = i(() => ji(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), C = i(() => Fr({
3950
+ var Ui = 600, Wi = 24, Gi = 16, Ki = 300, qi = 200, Ji = 0, Yi = 1, Xi = Wi + Gi, Zi = 200, Qi = 500, $i = 1e3;
3951
+ function ea(e) {
3952
+ let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Ki), o = ci({
3953
+ bucketPx: Ui,
3954
+ contentInsetPx: Wi,
3955
+ gapPx: Gi
3956
+ }), { buckets: s, columnHeights: c, contentHeight: l, heights: u, indexById: d, positions: f } = o, p = D(null), m = Li(), h = i(() => Math.max(Ki, a.value - Wi * 2)), g = i(() => Jn(h.value, Ki)), v = i(() => Yn(h.value, g.value, Ki, Gi)), y = i(() => ji(e.bottomLoadBufferPx.value)), b = i(() => ta(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), C = i(() => tr({
3689
3957
  itemCount: e.items.value.length,
3690
3958
  viewportHeight: r.value,
3691
3959
  scrollTop: n.value,
3692
- overscanPx: Ci,
3693
- bucketPx: yi,
3960
+ overscanPx: qi,
3961
+ bucketPx: Ui,
3694
3962
  buckets: s.value
3695
3963
  })), w = i(() => C.value.map((t) => ({
3696
3964
  item: e.items.value[t],
3697
3965
  index: t
3698
3966
  }))), T = i(() => {
3699
- let e = l.value + bi * 2, t = I.reservedContentHeight.value ?? 0;
3700
- return Math.max(e, t, r.value) + Di + y.value;
3701
- }), E = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), O = i(() => ai({
3967
+ let e = l.value + Wi * 2, t = I.reservedContentHeight.value ?? 0;
3968
+ return Math.max(e, t, r.value) + Zi + y.value;
3969
+ }), E = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), O = i(() => ki({
3702
3970
  active: e.active.value,
3703
- maxScrollTop: X(),
3971
+ maxScrollTop: Y(),
3704
3972
  progressDistancePx: n.value,
3705
- thresholdPx: wi,
3973
+ thresholdPx: Ji,
3706
3974
  triggerEnabled: E.value
3707
- })), k = i(() => e.items.value.length > 0 ? `${b.value + 1} / ${e.items.value.length}` : "0 / 0"), A = i(() => ii({
3975
+ })), k = i(() => e.items.value.length > 0 ? `${b.value + 1} / ${e.items.value.length}` : "0 / 0"), A = i(() => Oi({
3708
3976
  active: e.active.value,
3709
- maxScrollTop: X(),
3977
+ maxScrollTop: Y(),
3710
3978
  progressDistancePx: n.value,
3711
- thresholdPx: Ei,
3979
+ thresholdPx: Xi,
3712
3980
  triggerEnabled: e.hasPreviousPage.value
3713
- })), j = oi({
3981
+ })), j = Ai({
3714
3982
  containerHeight: T,
3715
3983
  scrollTop: n,
3716
3984
  viewportHeight: r
3717
- }), M = Jr({
3985
+ }), M = vi({
3718
3986
  items: e.items,
3719
3987
  visibleIndices: C,
3720
3988
  positions: f,
@@ -3723,44 +3991,44 @@ function Ai(e) {
3723
3991
  columnWidth: v,
3724
3992
  scrollTop: n,
3725
3993
  viewportHeight: r
3726
- }), N = fi({
3994
+ }), N = Ii({
3727
3995
  direction: "top",
3728
3996
  getAnimationLockMs(e) {
3729
- return Math.max(Oi, Gr(e)) + ki;
3997
+ return Math.max(Qi, hi(e)) + $i;
3730
3998
  },
3731
3999
  hasPage: e.hasPreviousPage,
3732
4000
  interactionLocked: m.isBoundaryInteractionLocked,
3733
4001
  isAtBoundary() {
3734
- return n.value <= Ei;
4002
+ return n.value <= Xi;
3735
4003
  },
3736
4004
  loading: e.loading,
3737
4005
  requestPage: e.requestPreviousPage
3738
- }), P = fi({
4006
+ }), P = Ii({
3739
4007
  direction: "bottom",
3740
4008
  getAnimationLockMs(e) {
3741
- return Gr(e) + ki;
4009
+ return hi(e) + $i;
3742
4010
  },
3743
4011
  hasPage: E,
3744
4012
  interactionLocked: m.isBoundaryInteractionLocked,
3745
4013
  isAtBoundary() {
3746
- return Y() <= Ti;
4014
+ return J() <= Yi;
3747
4015
  },
3748
4016
  loading: e.loading,
3749
4017
  requestPage: e.requestNextPage
3750
- }), F = ri({
4018
+ }), F = Di({
3751
4019
  active: e.active,
3752
- getMaxScrollTop: X,
4020
+ getMaxScrollTop: Y,
3753
4021
  getViewport: () => t.value,
3754
4022
  onScroll: ee
3755
- }), I = vi({
3756
- bucketPx: yi,
4023
+ }), I = Hi({
4024
+ bucketPx: Ui,
3757
4025
  columnHeights: c,
3758
4026
  columnCount: g,
3759
4027
  columnWidth: v,
3760
4028
  commitPendingAppend: e.commitPendingAppend,
3761
4029
  contentHeight: l,
3762
- contentInsetPx: bi,
3763
- gapPx: xi,
4030
+ contentInsetPx: Wi,
4031
+ gapPx: Gi,
3764
4032
  items: e.items,
3765
4033
  pendingAppendItems: e.pendingAppendItems
3766
4034
  }), L = null, R = 0;
@@ -3769,20 +4037,20 @@ function Ai(e) {
3769
4037
  g,
3770
4038
  v
3771
4039
  ], async ([t], [r = []]) => {
3772
- let i = mi({
4040
+ let i = Ri({
3773
4041
  activeIndex: b.value,
3774
- contentInsetPx: bi,
4042
+ contentInsetPx: Wi,
3775
4043
  currentItems: t,
3776
- gapPx: xi,
4044
+ gapPx: Gi,
3777
4045
  layoutHeights: u.value,
3778
4046
  layoutIndexById: d.value,
3779
4047
  layoutPositions: f.value,
3780
4048
  previousItems: r ?? [],
3781
4049
  scrollTop: n.value
3782
4050
  });
3783
- i.shouldLockBoundaryInteractionForRemoval && m.lockBoundaryInteraction(Kr() + ki), i.shouldResetScrollForEmptyRemoval && te();
4051
+ i.shouldLockBoundaryInteractionForRemoval && m.lockBoundaryInteraction(gi() + $i), i.shouldResetScrollForEmptyRemoval && te();
3784
4052
  let a = r ?? [];
3785
- o.canAppend(t, a, i, g.value) ? o.append(i.addedItems, a.length, g.value, v.value) : o.rebuild(t, g.value, v.value), i.removedItems.length > 0 && M.markLeave(i.removedItems), i.addedItems.length > 0 && (M.markEnter(i.addedItems, i.isPrepend ? "top" : "bottom"), i.isPrepend ? N.onItemsMutated(i.addedItems.length) : P.onItemsMutated(i.addedItems.length)), M.playFlipMoveAnimation(i.oldPositionsById, new Set(i.addedItems.map((e) => $(e))), i.isPrepend ? Oi : void 0), i.anchorId ? (await _(), U(i.anchorId, i.oldPositionsById)) : e.active.value && i.previousIds.length > 0 && G();
4053
+ o.canAppend(t, a, i, g.value) ? o.append(i.addedItems, a.length, g.value, v.value) : o.rebuild(t, g.value, v.value), i.removedItems.length > 0 && M.markLeave(i.removedItems), i.addedItems.length > 0 && (M.markEnter(i.addedItems, i.isPrepend ? "top" : "bottom"), i.isPrepend ? N.onItemsMutated(i.addedItems.length) : P.onItemsMutated(i.addedItems.length)), M.playFlipMoveAnimation(i.oldPositionsById, new Set(i.addedItems.map((e) => $(e))), i.isPrepend ? Qi : void 0), i.anchorId ? (await _(), U(i.anchorId, i.oldPositionsById)) : e.active.value && i.previousIds.length > 0 && G();
3786
4054
  }, { immediate: !0 }), z([
3787
4055
  () => e.pendingAppendItems.value.map((e) => $(e)),
3788
4056
  g,
@@ -3796,24 +4064,24 @@ function Ai(e) {
3796
4064
  }
3797
4065
  if (F.start(), !a || i !== !1 || p.value == null) return;
3798
4066
  await _();
3799
- let o = Math.max(0, T.value - r.value), s = ji(p.value, 0, o);
4067
+ let o = Math.max(0, T.value - r.value), s = ta(p.value, 0, o);
3800
4068
  a.scrollTop = s, n.value = s, N.syncBoundary(), P.syncBoundary();
3801
4069
  }), z(() => e.loading.value, async (e) => {
3802
4070
  I.clearReservedHeightWhenIdle(e), N.onLoadingChange(e), P.onLoadingChange(e), await _();
3803
4071
  }), S(async () => {
3804
- q(), await _(), b.value > 0 ? H(b.value, "center") : W(), N.syncBoundary(), P.syncBoundary(), typeof ResizeObserver < "u" ? (L = new ResizeObserver(() => {
3805
- q();
3806
- }), t.value && L.observe(t.value)) : window.addEventListener("resize", q);
4072
+ K(), await _(), b.value > 0 ? H(b.value, "center") : W(), N.syncBoundary(), P.syncBoundary(), typeof ResizeObserver < "u" ? (L = new ResizeObserver(() => {
4073
+ K();
4074
+ }), t.value && L.observe(t.value)) : window.addEventListener("resize", K);
3807
4075
  }), x(() => {
3808
- L?.disconnect(), L = null, window.removeEventListener("resize", q), I.clearAppendCommitTimer(), m.clearBoundaryInteractionReleaseTimer(), R &&= (cancelAnimationFrame(R), 0), F.stop();
4076
+ L?.disconnect(), L = null, window.removeEventListener("resize", K), I.clearAppendCommitTimer(), m.clearBoundaryInteractionReleaseTimer(), R &&= (cancelAnimationFrame(R), 0), F.stop();
3809
4077
  });
3810
4078
  function ee() {
3811
- e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = J(), N.syncBoundary("scroll"), P.syncBoundary("scroll"), K(), !G() && (R ||= requestAnimationFrame(() => {
4079
+ e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = q(), N.syncBoundary("scroll"), P.syncBoundary("scroll"), ne(), !G() && (R ||= requestAnimationFrame(() => {
3812
4080
  R = 0, W();
3813
4081
  })));
3814
4082
  }
3815
4083
  function B(t) {
3816
- e.active.value && (N.onWheel(t), P.onWheel(t), K());
4084
+ e.active.value && (N.onWheel(t), P.onWheel(t), ne());
3817
4085
  }
3818
4086
  function V(t) {
3819
4087
  let n = e.items.value[t], r = n ? $(n) : "";
@@ -3829,7 +4097,7 @@ function Ai(e) {
3829
4097
  let a = t.value, o = f.value[e], s = u.value[e];
3830
4098
  if (!a || !o || !s) return;
3831
4099
  let c = a.scrollTop, l = Math.max(0, T.value - r.value);
3832
- i === "center" ? c = o.y - (r.value - s) / 2 : o.y < a.scrollTop ? c = o.y - bi : o.y + s > a.scrollTop + r.value && (c = o.y + s - r.value + bi), a.scrollTop = ji(c, 0, l), n.value = a.scrollTop, W();
4100
+ i === "center" ? c = o.y - (r.value - s) / 2 : o.y < a.scrollTop ? c = o.y - Wi : o.y + s > a.scrollTop + r.value && (c = o.y + s - r.value + Wi), a.scrollTop = ta(c, 0, l), n.value = a.scrollTop, W();
3833
4101
  }
3834
4102
  function U(e, r) {
3835
4103
  let i = t.value, a = r.get(e), o = d.value.get(e), s = o == null ? null : f.value[o];
@@ -3857,25 +4125,25 @@ function Ai(e) {
3857
4125
  e.setActiveIndex(i);
3858
4126
  }
3859
4127
  function G() {
3860
- let t = n.value <= Ei, r = Y() <= Ti;
4128
+ let t = n.value <= Xi, r = J() <= Yi;
3861
4129
  return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
3862
4130
  }
3863
- function K() {
4131
+ function ne() {
3864
4132
  N.maybeRequestPage(), P.maybeRequestPage();
3865
4133
  }
4134
+ function K() {
4135
+ r.value = q(), a.value = re();
4136
+ }
3866
4137
  function q() {
3867
- r.value = J(), a.value = ne();
4138
+ return xi(t.value, r.value);
3868
4139
  }
3869
- function J() {
3870
- return Zr(t.value, r.value);
4140
+ function re() {
4141
+ return Si(t.value, a.value, Ki);
3871
4142
  }
3872
- function ne() {
3873
- return Qr(t.value, a.value, Si);
4143
+ function J() {
4144
+ return Ci(t.value, n.value, r.value, T.value);
3874
4145
  }
3875
4146
  function Y() {
3876
- return $r(t.value, n.value, r.value, T.value);
3877
- }
3878
- function X() {
3879
4147
  let e = Math.max(t.value?.scrollHeight ?? 0, T.value);
3880
4148
  return Math.max(0, e - r.value);
3881
4149
  }
@@ -3899,17 +4167,17 @@ function Ai(e) {
3899
4167
  scrollViewportRef: t
3900
4168
  };
3901
4169
  }
3902
- function ji(e, t, n) {
4170
+ function ta(e, t, n) {
3903
4171
  return Math.min(Math.max(e, t), n);
3904
4172
  }
3905
4173
  //#endregion
3906
4174
  //#region src/components/viewer-core/listCardAsset.ts
3907
- function Mi(e) {
4175
+ function na(e) {
3908
4176
  if (e) try {
3909
4177
  e.removeAttribute("src"), e.src = "";
3910
4178
  } catch {}
3911
4179
  }
3912
- function Ni(e) {
4180
+ function ra(e) {
3913
4181
  if (e) {
3914
4182
  try {
3915
4183
  e.currentTime = 0;
@@ -3920,12 +4188,12 @@ function Ni(e) {
3920
4188
  } catch {}
3921
4189
  }
3922
4190
  }
3923
- function Pi(e, t) {
4191
+ function ia(e, t) {
3924
4192
  if (t) return e.bottom > t.top && e.top < t.bottom;
3925
4193
  let n = window.innerHeight || document.documentElement.clientHeight || 0;
3926
4194
  return e.bottom > 0 && e.top < n;
3927
4195
  }
3928
- function Fi(e) {
4196
+ function aa(e) {
3929
4197
  if (!e) return null;
3930
4198
  try {
3931
4199
  return new URL(e, window.location.href).href;
@@ -3934,68 +4202,10 @@ function Fi(e) {
3934
4202
  }
3935
4203
  }
3936
4204
  //#endregion
3937
- //#region src/components/viewer-core/listPreview.ts
3938
- var Ii = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, Li = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, Ri = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
3939
- function zi(e) {
3940
- let t = Bi(e), n = t?.url, r = Dr(e), i = e.title?.trim() || Wt(e.type);
3941
- return t?.mediaType === "video" && typeof n == "string" ? {
3942
- kind: "video",
3943
- url: n,
3944
- width: r.width,
3945
- height: r.height,
3946
- label: i
3947
- } : t?.mediaType === "image" && typeof n == "string" ? {
3948
- kind: "image",
3949
- url: n,
3950
- width: r.width,
3951
- height: r.height,
3952
- label: i
3953
- } : e.type !== "image" && e.type !== "video" ? {
3954
- kind: "fallback",
3955
- url: null,
3956
- width: r.width,
3957
- height: r.height,
3958
- label: i
3959
- } : typeof n == "string" && Hi(e, n) ? {
3960
- kind: "video",
3961
- url: n,
3962
- width: r.width,
3963
- height: r.height,
3964
- label: i
3965
- } : typeof n == "string" && Vi(e, n) ? {
3966
- kind: "image",
3967
- url: n,
3968
- width: r.width,
3969
- height: r.height,
3970
- label: i
3971
- } : {
3972
- kind: "fallback",
3973
- url: null,
3974
- width: r.width,
3975
- height: r.height,
3976
- label: i
3977
- };
3978
- }
3979
- function Bi(e) {
3980
- return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
3981
- }
3982
- function Vi(e, t) {
3983
- return e.type !== "image" || typeof t != "string" ? !1 : Ii.test(t) || Ui(t);
3984
- }
3985
- function Hi(e, t) {
3986
- return e.type !== "video" || typeof t != "string" ? !1 : Li.test(t) || Wi(t);
3987
- }
3988
- function Ui(e) {
3989
- return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
3990
- }
3991
- function Wi(e) {
3992
- return Ri.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3993
- }
3994
- //#endregion
3995
4205
  //#region src/components/viewer-core/useListCardHealthCheck.ts
3996
- function Gi(e) {
4206
+ function oa(e) {
3997
4207
  let t = D(null), n = i(() => {
3998
- let t = typeof e.item.value.healthCheck?.url == "string" ? Fi(e.item.value.healthCheck.url) : null;
4208
+ let t = typeof e.item.value.healthCheck?.url == "string" ? aa(e.item.value.healthCheck.url) : null;
3999
4209
  return !t || t === e.attachedAssetUrl.value ? null : t;
4000
4210
  }), r = null, a = 0, o = /* @__PURE__ */ new Map();
4001
4211
  z(n, (e, n) => {
@@ -4027,7 +4237,7 @@ function Gi(e) {
4027
4237
  r.refresh();
4028
4238
  return;
4029
4239
  }
4030
- r = Kt.request({
4240
+ r = Jt.request({
4031
4241
  assetType: "probe",
4032
4242
  getPriority: e.getPriority,
4033
4243
  onGrant() {
@@ -4037,7 +4247,7 @@ function Gi(e) {
4037
4247
  return;
4038
4248
  }
4039
4249
  let i = ++a;
4040
- bn(r).then((s) => {
4250
+ Sn(r).then((s) => {
4041
4251
  if (!(i !== a || n.value !== r)) {
4042
4252
  if (o.set(r, s ?? null), !s) {
4043
4253
  t.value = null;
@@ -4073,14 +4283,14 @@ function Gi(e) {
4073
4283
  }
4074
4284
  //#endregion
4075
4285
  //#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
4076
- var Ki = ["aria-label"], qi = {
4286
+ var sa = ["aria-label"], ca = {
4077
4287
  key: 0,
4078
4288
  "data-testid": "vibe-list-card-spinner",
4079
4289
  class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
4080
- }, Ji = { 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]" }, Yi = ["src", "alt"], Xi = ["src"], Zi = ["data-kind"], Qi = { class: "grid justify-items-center gap-3 px-4 text-center" }, $i = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, ea = {
4290
+ }, la = { 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]" }, ua = ["src", "alt"], da = ["src"], fa = ["data-kind"], pa = { class: "grid justify-items-center gap-3 px-4 text-center" }, ma = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, ha = {
4081
4291
  key: 4,
4082
4292
  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))]"
4083
- }, ta = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, na = { class: "pointer-events-none absolute inset-0 z-[3]" }, ra = /* @__PURE__ */ d({
4293
+ }, ga = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, _a = { class: "pointer-events-none absolute inset-0 z-[3]" }, va = /* @__PURE__ */ d({
4084
4294
  __name: "ListCard",
4085
4295
  props: {
4086
4296
  active: {
@@ -4104,98 +4314,98 @@ var Ki = ["aria-label"], qi = {
4104
4314
  },
4105
4315
  emits: ["open"],
4106
4316
  setup(e, { emit: t }) {
4107
- let n = e, r = t, l = i(() => zi(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), j = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), P = Gi({
4317
+ let n = e, r = t, l = i(() => sr(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), j = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), P = oa({
4108
4318
  attachedAssetUrl: E,
4109
- getPriority: se,
4319
+ getPriority: X,
4110
4320
  isInView: d,
4111
4321
  isReady: m,
4112
4322
  item: i(() => n.item),
4113
4323
  loadErrorKind: g,
4114
4324
  reportAssetError: n.reportAssetError,
4115
4325
  surfaceActive: i(() => n.surfaceActive)
4116
- }), I = i(() => P.errorKind.value ?? g.value), L = i(() => !!I.value), R = i(() => vn(I.value)), ee = i(() => O.value && !g.value && (!T.value || !m.value)), B = null, V = null, U = /* @__PURE__ */ new Set();
4326
+ }), I = i(() => P.errorKind.value ?? g.value), L = i(() => !!I.value), R = i(() => bn(I.value)), ee = i(() => O.value && !g.value && (!T.value || !m.value)), B = null, V = null, U = /* @__PURE__ */ new Set();
4117
4327
  z([E, () => l.value.kind], () => {
4118
4328
  let e = l.value.kind === "fallback";
4119
4329
  m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
4120
4330
  }), z(O, () => {
4121
- q();
4331
+ K();
4122
4332
  }), z([
4123
4333
  d,
4124
4334
  m,
4125
4335
  E
4126
4336
  ], () => {
4127
- J();
4337
+ q();
4128
4338
  }), z(() => n.surfaceActive, (e) => {
4129
4339
  if (!e) {
4130
- Y(), J();
4340
+ J(), q();
4131
4341
  return;
4132
4342
  }
4133
4343
  requestAnimationFrame(() => {
4134
- X(), q(), J();
4344
+ Y(), K(), q();
4135
4345
  });
4136
4346
  }), S(() => {
4137
4347
  if (!y.value || typeof IntersectionObserver > "u") {
4138
- b.value = null, d.value = !0, q();
4348
+ b.value = null, d.value = !0, K();
4139
4349
  return;
4140
4350
  }
4141
4351
  b.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"), B = new IntersectionObserver((e) => {
4142
- for (let t of e) t.target === y.value && (n.surfaceActive && X(t), q(), J());
4352
+ for (let t of e) t.target === y.value && (n.surfaceActive && Y(t), K(), q());
4143
4353
  }, {
4144
4354
  root: b.value,
4145
4355
  threshold: [0, 1]
4146
4356
  }), B.observe(y.value);
4147
4357
  }), x(() => {
4148
- ne(), P.release(), B?.disconnect(), B = null;
4358
+ re(), P.release(), B?.disconnect(), B = null;
4149
4359
  });
4150
4360
  function te() {
4151
- ce(_.value) && (m.value = !0, g.value = null, re(E.value ?? n.item.url), Y());
4361
+ le(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url), J());
4152
4362
  }
4153
4363
  async function W() {
4154
- if (!ce(_.value)) return;
4364
+ if (!le(_.value)) return;
4155
4365
  let e = E.value ?? n.item.url;
4156
4366
  m.value = !1, g.value = "generic";
4157
- let t = await yn(e);
4367
+ let t = await xn(e);
4158
4368
  g.value = t, n.reportAssetError?.({
4159
4369
  item: n.item,
4160
4370
  occurrenceKey: $(n.item),
4161
4371
  url: e,
4162
4372
  kind: t,
4163
4373
  surface: "grid"
4164
- }), Y();
4374
+ }), J();
4165
4375
  }
4166
4376
  function G() {
4167
- ce(C.value) && (h.value = !0, m.value = !0, g.value = null, re(E.value ?? n.item.url), Y(), J());
4377
+ le(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url), J(), q());
4168
4378
  }
4169
- function K() {
4170
- ce(C.value) && (h.value || (m.value = !1));
4379
+ function ne() {
4380
+ le(C.value) && (h.value || (m.value = !1));
4171
4381
  }
4172
- function q() {
4382
+ function K() {
4173
4383
  if (l.value.kind === "fallback") {
4174
- ne(!1);
4384
+ re(!1);
4175
4385
  return;
4176
4386
  }
4177
4387
  if (!n.surfaceActive) {
4178
- Y();
4388
+ J();
4179
4389
  return;
4180
4390
  }
4181
4391
  if (!O.value) {
4182
- ne();
4392
+ re();
4183
4393
  return;
4184
4394
  }
4185
4395
  if (T.value || V) {
4186
4396
  V?.refresh();
4187
4397
  return;
4188
4398
  }
4189
- V = Kt.request({
4399
+ V = Jt.request({
4190
4400
  assetType: l.value.kind,
4191
- getPriority: se,
4401
+ getPriority: X,
4192
4402
  onGrant() {
4193
4403
  T.value = !0, m.value = !1, g.value = null;
4194
4404
  },
4195
4405
  url: l.value.url ?? n.item.url
4196
4406
  });
4197
4407
  }
4198
- function J() {
4408
+ function q() {
4199
4409
  let e = C.value;
4200
4410
  if (!(!e || l.value.kind !== "video")) {
4201
4411
  if (I.value) {
@@ -4203,7 +4413,7 @@ var Ki = ["aria-label"], qi = {
4203
4413
  return;
4204
4414
  }
4205
4415
  if (E.value && d.value && m.value) {
4206
- e.muted = !0, e.loop = !0, e.playsInline = !0, Cn(e);
4416
+ e.muted = !0, e.loop = !0, e.playsInline = !0, Tn(e);
4207
4417
  return;
4208
4418
  }
4209
4419
  try {
@@ -4212,21 +4422,21 @@ var Ki = ["aria-label"], qi = {
4212
4422
  e.pause();
4213
4423
  }
4214
4424
  }
4215
- function ne(e = !0) {
4216
- T.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (ae(), Z()), Y();
4425
+ function re(e = !0) {
4426
+ T.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (oe(), se()), J();
4217
4427
  }
4218
- function Y() {
4428
+ function J() {
4219
4429
  V?.release(), V = null;
4220
4430
  }
4221
- function X(e) {
4431
+ function Y(e) {
4222
4432
  let t = y.value;
4223
4433
  if (!t) {
4224
4434
  d.value = !0;
4225
4435
  return;
4226
4436
  }
4227
- d.value = Pi(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
4437
+ d.value = ia(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
4228
4438
  }
4229
- function re(e) {
4439
+ function ie(e) {
4230
4440
  if (!e) return;
4231
4441
  let t = $(n.item), r = `${t}|${e}`;
4232
4442
  U.has(r) || (U.add(r), n.reportAssetLoad?.({
@@ -4236,20 +4446,20 @@ var Ki = ["aria-label"], qi = {
4236
4446
  url: e
4237
4447
  }));
4238
4448
  }
4239
- function ie() {
4449
+ function ae() {
4240
4450
  if (!R.value || P.retry()) return;
4241
4451
  let e = $(n.item);
4242
4452
  U.forEach((t) => {
4243
4453
  t.startsWith(`${e}|`) && U.delete(t);
4244
- }), g.value = null, m.value = !1, T.value = !1, Y(), q();
4454
+ }), g.value = null, m.value = !1, T.value = !1, J(), K();
4245
4455
  }
4246
- function ae() {
4247
- Mi(_.value);
4248
- }
4249
- function Z() {
4250
- Ni(C.value);
4456
+ function oe() {
4457
+ na(_.value);
4251
4458
  }
4252
4459
  function se() {
4460
+ ra(C.value);
4461
+ }
4462
+ function X() {
4253
4463
  let e = y.value;
4254
4464
  if (!e) return Infinity;
4255
4465
  let t = e.getBoundingClientRect();
@@ -4260,17 +4470,17 @@ var Ki = ["aria-label"], qi = {
4260
4470
  let n = window.innerHeight / 2;
4261
4471
  return Math.abs((t.top + t.bottom) / 2 - n);
4262
4472
  }
4263
- function ce(e) {
4264
- let t = Fi(E.value);
4265
- return !e || !t ? !1 : Fi("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
4473
+ function le(e) {
4474
+ let t = aa(E.value);
4475
+ return !e || !t ? !1 : aa("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
4266
4476
  }
4267
4477
  function ue() {
4268
4478
  r("open");
4269
4479
  }
4270
- function de() {
4480
+ function fe() {
4271
4481
  f.value = !0;
4272
4482
  }
4273
- function fe(e) {
4483
+ function pe(e) {
4274
4484
  let t = e.relatedTarget;
4275
4485
  y.value && t instanceof Node && y.value.contains(t) || (f.value = !1);
4276
4486
  }
@@ -4279,8 +4489,8 @@ var Ki = ["aria-label"], qi = {
4279
4489
  ref: y,
4280
4490
  "data-testid": "vibe-list-card-inner",
4281
4491
  class: v(["group relative h-full w-full overflow-hidden border bg-[#0a0b0f] text-[#f7f1ea] transition-[border-color,transform] duration-300", n.active ? "border-white/28" : "border-white/12 hover:border-white/24"]),
4282
- onFocusin: de,
4283
- onFocusout: fe,
4492
+ onFocusin: fe,
4493
+ onFocusout: pe,
4284
4494
  onPointerenter: t[0] ||= (e) => p.value = !0,
4285
4495
  onPointerleave: t[1] ||= (e) => p.value = !1
4286
4496
  }, [
@@ -4290,8 +4500,8 @@ var Ki = ["aria-label"], qi = {
4290
4500
  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]",
4291
4501
  "aria-label": n.item.title || `Open item ${n.index + 1}`,
4292
4502
  onClick: ue
4293
- }, null, 8, Ki),
4294
- ee.value ? (w(), s("div", qi, [c("span", Ji, [u(F(oe), {
4503
+ }, null, 8, sa),
4504
+ ee.value ? (w(), s("div", ca, [c("span", la, [u(F(ce), {
4295
4505
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
4296
4506
  "aria-hidden": "true"
4297
4507
  })])])) : o("", !0),
@@ -4305,7 +4515,7 @@ var Ki = ["aria-label"], qi = {
4305
4515
  class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
4306
4516
  onLoad: te,
4307
4517
  onError: W
4308
- }, null, 42, Yi)) : N.value && E.value && !L.value ? (w(), s("video", {
4518
+ }, null, 42, ua)) : N.value && E.value && !L.value ? (w(), s("video", {
4309
4519
  key: 2,
4310
4520
  ref_key: "videoRef",
4311
4521
  ref: C,
@@ -4317,35 +4527,35 @@ var Ki = ["aria-label"], qi = {
4317
4527
  class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
4318
4528
  onCanplay: G,
4319
4529
  onError: W,
4320
- onLoadstart: K,
4530
+ onLoadstart: ne,
4321
4531
  onPlaying: G,
4322
- onStalled: K,
4323
- onWaiting: K
4324
- }, null, 42, Xi)) : L.value ? (w(), s("div", {
4532
+ onStalled: ne,
4533
+ onWaiting: ne
4534
+ }, null, 42, da)) : L.value ? (w(), s("div", {
4325
4535
  key: 3,
4326
4536
  "data-testid": "vibe-list-card-error",
4327
4537
  "data-kind": I.value,
4328
4538
  class: "pointer-events-none relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
4329
- }, [c("div", Qi, [
4330
- u(F(le), {
4539
+ }, [c("div", pa, [
4540
+ u(F(de), {
4331
4541
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
4332
4542
  "aria-hidden": "true"
4333
4543
  }),
4334
- c("span", $i, M(F(_n)(I.value)), 1),
4544
+ c("span", ma, M(F(yn)(I.value)), 1),
4335
4545
  R.value ? (w(), s("button", {
4336
4546
  key: 0,
4337
4547
  type: "button",
4338
4548
  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",
4339
- onClick: H(ie, ["stop"])
4549
+ onClick: H(ae, ["stop"])
4340
4550
  }, " Retry ")) : o("", !0)
4341
- ])], 8, Zi)) : (w(), s("div", ea, [c("div", ta, [k(e.$slots, "item-icon", {
4342
- icon: F(Ut)(n.item.type),
4551
+ ])], 8, fa)) : (w(), s("div", ha, [c("div", ga, [k(e.$slots, "item-icon", {
4552
+ icon: F(Gt)(n.item.type),
4343
4553
  item: n.item
4344
- }, () => [(w(), a(A(F(Ut)(n.item.type)), {
4554
+ }, () => [(w(), a(A(F(Gt)(n.item.type)), {
4345
4555
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
4346
4556
  "aria-hidden": "true"
4347
4557
  }))])])])),
4348
- c("div", na, [k(e.$slots, "grid-item-overlay", {
4558
+ c("div", _a, [k(e.$slots, "grid-item-overlay", {
4349
4559
  active: n.active,
4350
4560
  focused: f.value,
4351
4561
  hovered: p.value,
@@ -4355,24 +4565,24 @@ var Ki = ["aria-label"], qi = {
4355
4565
  })])
4356
4566
  ], 34));
4357
4567
  }
4358
- }), ia = { 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)]" }, aa = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, oa = {
4568
+ }), ya = { 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)]" }, ba = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, xa = {
4359
4569
  "data-testid": "vibe-pagination",
4360
4570
  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]"
4361
- }, sa = { class: "whitespace-nowrap" }, ca = {
4571
+ }, Sa = { class: "whitespace-nowrap" }, Ca = {
4362
4572
  key: 0,
4363
4573
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
4364
- }, la = [
4574
+ }, wa = [
4365
4575
  "data-active",
4366
4576
  "data-index",
4367
4577
  "data-item-id",
4368
4578
  "data-occurrence-key"
4369
- ], ua = ["data-item-id"], da = {
4579
+ ], Ta = ["data-item-id"], Ea = {
4370
4580
  key: 0,
4371
4581
  class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
4372
- }, fa = {
4582
+ }, Da = {
4373
4583
  key: 1,
4374
4584
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
4375
- }, pa = { class: "mx-auto flex w-full justify-center" }, ma = /* @__PURE__ */ d({
4585
+ }, Oa = { class: "mx-auto flex w-full justify-center" }, ka = /* @__PURE__ */ d({
4376
4586
  __name: "ListSurface",
4377
4587
  props: {
4378
4588
  active: {
@@ -4434,7 +4644,7 @@ var Ki = ["aria-label"], qi = {
4434
4644
  "update:activeIndex"
4435
4645
  ],
4436
4646
  setup(e, { expose: n, emit: r }) {
4437
- let d = e, f = L(), p = r, m = Ai({
4647
+ let d = e, f = L(), p = r, m = ea({
4438
4648
  active: N(d, "active"),
4439
4649
  allowExhaustedNextPageRefresh: N(d, "allowExhaustedNextPageRefresh"),
4440
4650
  bottomLoadBufferPx: N(d, "bottomLoadBufferPx"),
@@ -4453,11 +4663,11 @@ var Ki = ["aria-label"], qi = {
4453
4663
  }
4454
4664
  });
4455
4665
  n({ autoScroll: m.autoScroll });
4456
- let h = i(() => cn({
4666
+ let h = i(() => un({
4457
4667
  itemCount: d.items.length,
4458
4668
  loading: d.loading,
4459
4669
  phase: d.phase
4460
- })), _ = i(() => ln({
4670
+ })), _ = i(() => dn({
4461
4671
  errorMessage: d.errorMessage,
4462
4672
  hasItems: d.items.length > 0,
4463
4673
  hasNextPage: d.hasNextPage,
@@ -4470,7 +4680,7 @@ var Ki = ["aria-label"], qi = {
4470
4680
  message: _.value.message,
4471
4681
  paginationDetail: d.paginationDetail,
4472
4682
  total: d.items.length
4473
- }), S = i(() => !x.value || !f["grid-status"] ? [] : f["grid-status"](x.value)), C = i(() => nn(S.value)), T = i(() => d.items.length + m.leavingItems.value.length), { emptyStateProps: E, showBadgeEmptyState: D, showCustomEmptyState: A, showInlineEmptyState: j } = on({
4683
+ }), S = i(() => !x.value || !f["grid-status"] ? [] : f["grid-status"](x.value)), C = i(() => an(S.value)), T = i(() => d.items.length + m.leavingItems.value.length), { emptyStateProps: E, showBadgeEmptyState: D, showCustomEmptyState: A, showInlineEmptyState: j } = cn({
4474
4684
  emptyStateMode: N(d, "emptyStateMode"),
4475
4685
  itemCount: T,
4476
4686
  loading: N(d, "loading"),
@@ -4482,8 +4692,8 @@ var Ki = ["aria-label"], qi = {
4482
4692
  nextBoundaryLoadProgress: e,
4483
4693
  previousBoundaryLoadProgress: t
4484
4694
  });
4485
- }, { immediate: !0 }), (e, n) => (w(), s("div", ia, [
4486
- c("div", aa, [c("span", oa, [c("span", sa, M(F(m).paginationLabel.value), 1), d.paginationDetail ? (w(), s("span", ca, M(d.paginationDetail), 1)) : o("", !0)])]),
4695
+ }, { immediate: !0 }), (e, n) => (w(), s("div", ya, [
4696
+ c("div", ba, [c("span", xa, [c("span", Sa, M(F(m).paginationLabel.value), 1), d.paginationDetail ? (w(), s("span", Ca, M(d.paginationDetail), 1)) : o("", !0)])]),
4487
4697
  c("div", {
4488
4698
  ref: F(m).scrollViewportRef,
4489
4699
  "data-testid": "vibe-list-scroll",
@@ -4504,7 +4714,7 @@ var Ki = ["aria-label"], qi = {
4504
4714
  "data-occurrence-key": F($)(t),
4505
4715
  class: "absolute will-change-transform",
4506
4716
  style: b(F(m).getCardStyle(n))
4507
- }, [u(ra, {
4717
+ }, [u(va, {
4508
4718
  active: n === F(m).resolvedActiveIndex.value,
4509
4719
  index: n,
4510
4720
  item: t,
@@ -4528,14 +4738,14 @@ var Ki = ["aria-label"], qi = {
4528
4738
  "report-asset-load",
4529
4739
  "surface-active",
4530
4740
  "onOpen"
4531
- ])], 12, la))), 128)),
4741
+ ])], 12, wa))), 128)),
4532
4742
  (w(!0), s(t, null, O(F(m).leavingItems.value, (t) => (w(), s("article", {
4533
4743
  key: `leaving-${F($)(t.item)}`,
4534
4744
  "data-testid": "vibe-list-card-leaving",
4535
4745
  "data-item-id": t.item.id,
4536
4746
  class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
4537
4747
  style: b(F(m).getLeavingCardStyle(t.item))
4538
- }, [u(ra, {
4748
+ }, [u(va, {
4539
4749
  active: !1,
4540
4750
  index: -1,
4541
4751
  item: t.item,
@@ -4550,8 +4760,8 @@ var Ki = ["aria-label"], qi = {
4550
4760
  "item",
4551
4761
  "report-asset-error",
4552
4762
  "report-asset-load"
4553
- ])], 12, ua))), 128)),
4554
- F(j) && F(E) ? (w(), a(Hn, {
4763
+ ])], 12, Ta))), 128)),
4764
+ F(j) && F(E) ? (w(), a(Tr, {
4555
4765
  key: 0,
4556
4766
  message: F(E).message,
4557
4767
  mode: F(E).mode,
@@ -4565,12 +4775,12 @@ var Ki = ["aria-label"], qi = {
4565
4775
  "surface"
4566
4776
  ])) : o("", !0)
4567
4777
  ], 4)], 544),
4568
- F(m).showScrollbar.value ? (w(), s("div", da, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
4778
+ F(m).showScrollbar.value ? (w(), s("div", Ea, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
4569
4779
  "data-testid": "vibe-list-scrollbar-thumb",
4570
4780
  class: v(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out", d.loading ? "bg-white/52" : "bg-white/34"]),
4571
4781
  style: b(F(m).getScrollbarThumbStyle())
4572
4782
  }, null, 6)])) : o("", !0),
4573
- f["grid-footer"] ? (w(), s("div", fa, [c("div", pa, [k(e.$slots, "grid-footer")])])) : o("", !0),
4783
+ f["grid-footer"] ? (w(), s("div", Da, [c("div", Oa, [k(e.$slots, "grid-footer")])])) : o("", !0),
4574
4784
  x.value ? (w(), s("div", {
4575
4785
  key: 2,
4576
4786
  class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", f["grid-footer"] ? "pb-24" : "pb-6"])
@@ -4579,7 +4789,7 @@ var Ki = ["aria-label"], qi = {
4579
4789
  "data-testid": "vibe-grid-status-badge",
4580
4790
  class: v(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", x.value.kind === "end" ? "border-amber-300/35 text-amber-200" : x.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
4581
4791
  }, M(x.value.message), 3))], 2)) : o("", !0),
4582
- F(D) && F(E) ? (w(), a(Hn, {
4792
+ F(D) && F(E) ? (w(), a(Tr, {
4583
4793
  key: 3,
4584
4794
  class: v(["z-[3]", f["grid-footer"] ? "pb-24" : "pb-6"]),
4585
4795
  message: F(E).message,
@@ -4596,13 +4806,13 @@ var Ki = ["aria-label"], qi = {
4596
4806
  ])) : o("", !0)
4597
4807
  ]));
4598
4808
  }
4599
- }), ha = ["data-surface-mode"], ga = {
4809
+ }), Aa = ["data-surface-mode"], ja = {
4600
4810
  key: 1,
4601
4811
  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"
4602
- }, _a = ["data-visible", "inert"], va = ["data-visible", "inert"], ya = {
4812
+ }, Ma = ["data-visible", "inert"], Na = ["data-visible", "inert"], Pa = {
4603
4813
  key: 3,
4604
4814
  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"
4605
- }, ba = /* @__PURE__ */ d({
4815
+ }, Fa = /* @__PURE__ */ d({
4606
4816
  name: "VibeLayout",
4607
4817
  __name: "Layout",
4608
4818
  props: {
@@ -4629,9 +4839,9 @@ var Ki = ["aria-label"], qi = {
4629
4839
  "update:surfaceMode"
4630
4840
  ],
4631
4841
  setup(e, { expose: n, emit: i }) {
4632
- let d = e, f = L(), m = i, h = pt(d, m), g = D(null), _ = pe((e) => {
4842
+ let d = e, f = L(), m = i, h = mt(d, m), g = D(null), _ = he((e) => {
4633
4843
  m("asset-errors", e);
4634
- }), v = me((e) => {
4844
+ }), v = ge((e) => {
4635
4845
  m("asset-loads", e);
4636
4846
  });
4637
4847
  x(() => {
@@ -4670,7 +4880,7 @@ var Ki = ["aria-label"], qi = {
4670
4880
  type: "button",
4671
4881
  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",
4672
4882
  onClick: n[0] ||= (...e) => F(h).retryInitialLoad && F(h).retryInitialLoad(...e)
4673
- }, " Retry ")) : F(h).errorMessage.value && F(h).items.value.length > 0 ? (w(), s("div", ga, M(F(h).errorMessage.value), 1)) : o("", !0), F(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
4883
+ }, " Retry ")) : F(h).errorMessage.value && F(h).items.value.length > 0 ? (w(), s("div", ja, M(F(h).errorMessage.value), 1)) : o("", !0), F(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
4674
4884
  appear: "",
4675
4885
  "enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
4676
4886
  "enter-from-class": "translate-y-3 opacity-0",
@@ -4684,7 +4894,7 @@ var Ki = ["aria-label"], qi = {
4684
4894
  "data-visible": F(h).surfaceMode.value === "list" ? "true" : "false",
4685
4895
  inert: F(h).surfaceMode.value !== "list",
4686
4896
  class: "absolute inset-0 z-[2]"
4687
- }, [u(ma, {
4897
+ }, [u(ka, {
4688
4898
  ref_key: "listSurfaceRef",
4689
4899
  ref: g,
4690
4900
  active: F(h).surfaceMode.value === "list",
@@ -4758,7 +4968,7 @@ var Ki = ["aria-label"], qi = {
4758
4968
  "onBoundaryLoadProgress",
4759
4969
  "onOpenFullscreen",
4760
4970
  "onUpdate:activeIndex"
4761
- ])], 8, _a), [[R, F(h).surfaceMode.value === "list"]])]),
4971
+ ])], 8, Ma), [[R, F(h).surfaceMode.value === "list"]])]),
4762
4972
  _: 3
4763
4973
  }), u(r, {
4764
4974
  appear: "",
@@ -4774,7 +4984,7 @@ var Ki = ["aria-label"], qi = {
4774
4984
  "data-visible": F(h).surfaceMode.value === "fullscreen" ? "true" : "false",
4775
4985
  inert: F(h).surfaceMode.value !== "fullscreen",
4776
4986
  class: "absolute inset-0 z-[3]"
4777
- }, [u(wr, {
4987
+ }, [u(si, {
4778
4988
  items: F(h).items.value,
4779
4989
  active: F(h).surfaceMode.value === "fullscreen",
4780
4990
  "active-index": F(h).activeIndex.value,
@@ -4843,12 +5053,12 @@ var Ki = ["aria-label"], qi = {
4843
5053
  "show-back-to-list",
4844
5054
  "onBackToList",
4845
5055
  "onUpdate:activeIndex"
4846
- ])], 8, va), [[R, F(h).surfaceMode.value === "fullscreen"]])]),
5056
+ ])], 8, Na), [[R, F(h).surfaceMode.value === "fullscreen"]])]),
4847
5057
  _: 3
4848
- })], 64)) : F(h).items.value.length === 0 && F(h).loading.value ? (w(), s("div", ya, [u(F(oe), {
5058
+ })], 64)) : F(h).items.value.length === 0 && F(h).loading.value ? (w(), s("div", Pa, [u(F(ce), {
4849
5059
  class: "size-10 animate-spin text-[#f7f1ea]/82",
4850
5060
  "aria-hidden": "true"
4851
- }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(wr, {
5061
+ }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(si, {
4852
5062
  key: 4,
4853
5063
  items: F(h).items.value,
4854
5064
  active: !0,
@@ -4916,10 +5126,10 @@ var Ki = ["aria-label"], qi = {
4916
5126
  "show-status-badges",
4917
5127
  "onBackToList",
4918
5128
  "onUpdate:activeIndex"
4919
- ]))], 8, ha));
5129
+ ]))], 8, Aa));
4920
5130
  }
4921
- }), xa = { install(e) {
4922
- e.component("VibeLayout", ba);
5131
+ }), Ia = { install(e) {
5132
+ e.component("VibeLayout", Fa);
4923
5133
  } };
4924
5134
  //#endregion
4925
- export { ba as VibeLayout, xa as VibePlugin, xa as default };
5135
+ export { Fa as VibeLayout, Ia as VibePlugin, Ia as default };