@wyxos/vibe 3.0.11 → 3.0.14

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,8 +3,8 @@ import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i,
3
3
  var B = (e) => {
4
4
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
5
5
  return !1;
6
- }, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), U = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), W = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), ee = (e) => {
7
- let t = W(e);
6
+ }, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), U = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), W = (e) => {
7
+ let t = U(e);
8
8
  return t.charAt(0).toUpperCase() + t.slice(1);
9
9
  }, G = {
10
10
  xmlns: "http://www.w3.org/2000/svg",
@@ -23,7 +23,7 @@ var B = (e) => {
23
23
  height: o,
24
24
  stroke: s,
25
25
  "stroke-width": V(n) || V(r) || n === !0 || r === !0 ? Number(i || a || G["stroke-width"]) * 24 / Number(o) : i || a || G["stroke-width"],
26
- class: H("lucide", c.class, ...e ? [`lucide-${U(ee(e))}-icon`, `lucide-${U(e)}`] : ["lucide-icon"]),
26
+ class: H("lucide", c.class, ...e ? [`lucide-${ee(W(e))}-icon`, `lucide-${ee(e)}`] : ["lucide-icon"]),
27
27
  ...!l.default && !B(c) && { "aria-hidden": "true" }
28
28
  }, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), q = (e, t) => (n, { slots: r, attrs: i }) => p(K, {
29
29
  ...i,
@@ -36,7 +36,7 @@ var B = (e) => {
36
36
  }], ["path", {
37
37
  d: "M19 12H5",
38
38
  key: "x3x0zl"
39
- }]]), Y = q("audio-lines", [
39
+ }]]), te = q("audio-lines", [
40
40
  ["path", {
41
41
  d: "M2 10v3",
42
42
  key: "1fnikh"
@@ -61,7 +61,7 @@ var B = (e) => {
61
61
  d: "M22 10v3",
62
62
  key: "154ddg"
63
63
  }]
64
- ]), X = q("clapperboard", [
64
+ ]), Y = q("clapperboard", [
65
65
  ["path", {
66
66
  d: "m12.296 3.464 3.02 3.956",
67
67
  key: "qash78"
@@ -78,13 +78,13 @@ var B = (e) => {
78
78
  d: "m6.18 5.276 3.1 3.899",
79
79
  key: "zjj9t3"
80
80
  }]
81
- ]), te = q("file", [["path", {
81
+ ]), ne = q("file", [["path", {
82
82
  d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
83
83
  key: "1oefj6"
84
84
  }], ["path", {
85
85
  d: "M14 2v5a1 1 0 0 0 1 1h5",
86
86
  key: "wfsgrz"
87
- }]]), ne = q("image-plus", [
87
+ }]]), re = q("image-plus", [
88
88
  ["path", {
89
89
  d: "M16 5h6",
90
90
  key: "1vod17"
@@ -107,10 +107,10 @@ var B = (e) => {
107
107
  r: "2",
108
108
  key: "af1f0g"
109
109
  }]
110
- ]), re = q("loader-circle", [["path", {
110
+ ]), ie = q("loader-circle", [["path", {
111
111
  d: "M21 12a9 9 0 1 1-6.219-8.56",
112
112
  key: "13zald"
113
- }]]), ie = q("pause", [["rect", {
113
+ }]]), ae = q("pause", [["rect", {
114
114
  x: "14",
115
115
  y: "3",
116
116
  width: "5",
@@ -124,10 +124,10 @@ var B = (e) => {
124
124
  height: "18",
125
125
  rx: "1",
126
126
  key: "1wsw3u"
127
- }]]), ae = q("play", [["path", {
127
+ }]]), oe = q("play", [["path", {
128
128
  d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
129
129
  key: "10ikf1"
130
- }]]), oe = q("triangle-alert", [
130
+ }]]), se = q("triangle-alert", [
131
131
  ["path", {
132
132
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
133
133
  key: "wmoenq"
@@ -141,10 +141,10 @@ var B = (e) => {
141
141
  key: "p32p05"
142
142
  }]
143
143
  ]);
144
- function se(e, t = 150) {
144
+ function ce(e, t = 150) {
145
145
  return le(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
146
146
  }
147
- function ce(e, t = 150) {
147
+ function X(e, t = 150) {
148
148
  return le(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
149
149
  }
150
150
  function le(e, t, n) {
@@ -181,9 +181,21 @@ function ue(e) {
181
181
  function de(e) {
182
182
  return e instanceof HTMLElement && !!e.closest("[data-swipe-lock], input, textarea, select, a");
183
183
  }
184
+ function fe(e) {
185
+ return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
186
+ }
187
+ function pe(e) {
188
+ return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
189
+ }
190
+ function me(e) {
191
+ return e ?? "__vibe_initial_cursor__";
192
+ }
193
+ function he(e, t, n) {
194
+ return Math.min(Math.max(e, t), n);
195
+ }
184
196
  //#endregion
185
197
  //#region src/components/viewer-core/removalState.ts
186
- function fe() {
198
+ function ge() {
187
199
  let e = T(/* @__PURE__ */ new Set()), t = T([]);
188
200
  function n(n) {
189
201
  let r = Z(n).filter((t) => !e.value.has(t));
@@ -230,12 +242,12 @@ function Z(e) {
230
242
  }
231
243
  //#endregion
232
244
  //#region src/components/viewer-core/itemIdentity.ts
233
- var pe = "__vibeOccurrenceKey";
245
+ var _e = "__vibeOccurrenceKey";
234
246
  function Q(e) {
235
- let t = e[pe];
247
+ let t = e[_e];
236
248
  return typeof t == "string" && t.length > 0 ? t : e.id;
237
249
  }
238
- function me(e, t, n) {
250
+ function ve(e, t, n) {
239
251
  let r = /* @__PURE__ */ new Map(), i = [], a = n;
240
252
  for (let e of t) {
241
253
  let t = r.get(e.id), n = Q(e);
@@ -243,73 +255,61 @@ function me(e, t, n) {
243
255
  }
244
256
  for (let t of e) {
245
257
  let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
246
- i.push(he(t, e));
258
+ i.push(ye(t, e));
247
259
  }
248
260
  return {
249
261
  items: i,
250
262
  nextSequence: a
251
263
  };
252
264
  }
253
- function he(e, t) {
265
+ function ye(e, t) {
254
266
  return Q(e) === t ? e : {
255
267
  ...e,
256
- [pe]: t
268
+ [_e]: t
257
269
  };
258
270
  }
259
271
  //#endregion
260
272
  //#region src/components/viewer-core/autoBuckets.ts
261
- function ge(e) {
273
+ function be(e) {
262
274
  return e.flatMap((e) => e.items);
263
275
  }
264
- function _e(e, t) {
276
+ function xe(e, t) {
265
277
  return t.size ? e.filter((e) => !t.has(e.id)) : e;
266
278
  }
267
- function ve(e, t) {
268
- return _e(e.items, t);
279
+ function Se(e, t) {
280
+ return xe(e.items, t);
269
281
  }
270
- function ye(e, t) {
271
- return ve(e, t).length;
282
+ function Ce(e, t) {
283
+ return Se(e, t).length;
272
284
  }
273
- function be(e, t, n) {
285
+ function we(e, t, n) {
274
286
  if (n < 0) return null;
275
287
  let r = 0;
276
288
  for (let i of e) {
277
- let e = ve(i, t), a = r + e.length;
289
+ let e = Se(i, t), a = r + e.length;
278
290
  if (n < a) return i.cursor;
279
291
  r = a;
280
292
  }
281
293
  return null;
282
294
  }
283
- function xe(e, t, n) {
295
+ function Te(e, t, n) {
284
296
  let r = [...e], i = r.findIndex((e) => e.cursor === t);
285
297
  return i >= 0 && r.splice(i, 1, n), r;
286
298
  }
287
- function Se(e, t, n) {
288
- let r = me(e, t, n);
299
+ function Ee(e, t, n) {
300
+ let r = ve(e, t, n);
289
301
  return {
290
302
  items: r.items,
291
303
  nextSequence: r.nextSequence
292
304
  };
293
305
  }
294
- function Ce(e) {
295
- return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
296
- }
297
- function we(e) {
298
- return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
299
- }
300
- function Te(e) {
301
- return e ?? "__vibe_initial_cursor__";
302
- }
303
- function Ee(e, t, n) {
304
- return Math.min(Math.max(e, t), n);
305
- }
306
306
  //#endregion
307
307
  //#region src/components/viewer-core/autoResolveState.ts
308
308
  function De(e) {
309
309
  return e instanceof DOMException && e.name === "AbortError" || e instanceof Error && (e.name === "AbortError" || e.name === "CanceledError") ? !0 : typeof e == "object" && !!e && "code" in e && e.code === "ERR_CANCELED";
310
310
  }
311
311
  function Oe(e) {
312
- let t = Se(e.nextItems, e.previousItems, e.sequence);
312
+ let t = Ee(e.nextItems, e.previousItems, e.sequence);
313
313
  return {
314
314
  bucket: {
315
315
  cursor: e.cursor,
@@ -330,7 +330,7 @@ function ke(e, t, n, r) {
330
330
  return {
331
331
  buckets: i,
332
332
  canceled: r,
333
- visibleCount: i.reduce((e, t) => e + ye(t, n), 0)
333
+ visibleCount: i.reduce((e, t) => e + Ce(t, n), 0)
334
334
  };
335
335
  }
336
336
  function Ae(e) {
@@ -341,24 +341,24 @@ function Ae(e) {
341
341
  previousCursor: e.initialState.previousCursor ?? null,
342
342
  previousItems: [],
343
343
  sequence: e.sequence
344
- }), n = _e(t.bucket.items, e.removedIds);
344
+ }), n = xe(t.bucket.items, e.removedIds);
345
345
  return {
346
- activeIndex: Ee(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
346
+ activeIndex: he(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
347
347
  buckets: [t.bucket],
348
348
  nextSequence: t.nextSequence
349
349
  };
350
350
  }
351
351
  function je(e, t) {
352
- let n = e[Ee(t, 0, Math.max(0, e.length - 1))];
352
+ let n = e[he(t, 0, Math.max(0, e.length - 1))];
353
353
  return n ? Q(n) : null;
354
354
  }
355
355
  function Me(e, t, n = null) {
356
356
  if (!e.length) return 0;
357
357
  let r = n ? e.findIndex((e) => Q(e) === n) : -1;
358
- return r >= 0 ? r : Ee(t, 0, e.length - 1);
358
+ return r >= 0 ? r : he(t, 0, e.length - 1);
359
359
  }
360
360
  function Ne(e, t, n) {
361
- return e ? ye(e, t) < n : !1;
361
+ return e ? Ce(e, t) < n : !1;
362
362
  }
363
363
  //#endregion
364
364
  //#region src/components/viewer-core/fillDelay.ts
@@ -399,22 +399,22 @@ function ze() {
399
399
  //#endregion
400
400
  //#region src/components/viewer-core/useAutoResolveSource.ts
401
401
  function Be(e) {
402
- let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u = ze(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = T(!1), g = /* @__PURE__ */ new Set(), _ = null, v = null, y = 0, S = 0, C = i(() => Re(e.fillDelayMs, Pe)), w = i(() => Re(e.fillDelayStepMs, Fe)), E = i(() => typeof e.resolve == "function"), D = i(() => e.mode ?? "dynamic"), O = i(() => we(e.pageSize)), k = i(() => ge(n.value)), A = i(() => _e(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => Ce(c.value) || p.value), N = i(() => Ve(n.value, e.removedIds.value)), P = i(() => He(n.value, e.removedIds.value)), I = i(() => P.value?.nextCursor ?? null), L = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!I.value), z = i(() => !!L.value), B = i(() => E.value && n.value.length > 0), V = i(() => _e(ge(a.value), e.removedIds.value)), H = i(() => be(n.value, e.removedIds.value, j.value)), U = i(() => !A.value.length && !M.value && !!s.value);
402
+ let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u = ze(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = T(!1), g = /* @__PURE__ */ new Set(), _ = null, v = null, y = 0, S = 0, C = i(() => Re(e.fillDelayMs, Pe)), w = i(() => Re(e.fillDelayStepMs, Fe)), E = i(() => typeof e.resolve == "function"), D = i(() => e.mode ?? "dynamic"), O = i(() => pe(e.pageSize)), k = i(() => be(n.value)), A = i(() => xe(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => fe(c.value) || p.value), N = i(() => Ve(n.value, e.removedIds.value)), P = i(() => He(n.value, e.removedIds.value)), I = i(() => P.value?.nextCursor ?? null), L = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!I.value), z = i(() => !!L.value), B = i(() => E.value && n.value.length > 0), V = i(() => xe(be(a.value), e.removedIds.value)), H = i(() => we(n.value, e.removedIds.value, j.value)), ee = i(() => !A.value.length && !M.value && !!s.value);
403
403
  F(() => A.value.length, (e) => {
404
404
  if (e === 0) {
405
405
  r.value = 0;
406
406
  return;
407
407
  }
408
- o.value &&= (he(), !1), r.value > e - 1 && (r.value = e - 1);
408
+ o.value &&= (Se(), !1), r.value > e - 1 && (r.value = e - 1);
409
409
  }), F(() => r.value, () => {
410
- m.value && se();
410
+ m.value && ce();
411
411
  }), x(() => {
412
- pe() || e.resolve && W();
412
+ _e() || e.resolve && U();
413
413
  }), b(() => {
414
414
  _?.abort(), _ = null, u.clear(!0);
415
415
  });
416
- async function W() {
417
- v = W;
416
+ async function U() {
417
+ v = U;
418
418
  let t = await de({
419
419
  continueUntilFilled: D.value === "dynamic",
420
420
  cursor: e.initialCursor ?? null,
@@ -423,73 +423,90 @@ function Be(e) {
423
423
  });
424
424
  t && (n.value = t.buckets, r.value = 0, Z());
425
425
  }
426
- async function ee() {
426
+ async function W() {
427
427
  if (!(h.value || M.value)) {
428
428
  if (!R.value) return B.value ? ue("trailing") : void 0;
429
- if (D.value === "static" && me("trailing")) return ue("trailing");
430
- await ce(I.value);
429
+ if (D.value === "static" && ye("trailing")) return ue("trailing");
430
+ await X(I.value);
431
431
  }
432
432
  }
433
433
  async function G() {
434
434
  if (!(h.value || !z.value || M.value)) {
435
- if (D.value === "static" && me("leading")) return ue("leading");
435
+ if (D.value === "static" && ye("leading")) return ue("leading");
436
436
  await le(L.value);
437
437
  }
438
438
  }
439
439
  async function K() {
440
- if (U.value) {
441
- if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = E.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, g.clear(), _?.abort(), _ = null, u.clear(!0), pe()) {
440
+ if (ee.value) {
441
+ if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = E.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, g.clear(), _?.abort(), _ = null, u.clear(!0), _e()) {
442
442
  Z();
443
443
  return;
444
444
  }
445
- await W();
445
+ await U();
446
446
  }
447
447
  }
448
448
  async function q() {
449
- if (U.value) return K();
449
+ if (ee.value) return K();
450
450
  h.value || c.value !== "failed" || !v || (s.value = null, await v());
451
451
  }
452
452
  async function J() {
453
453
  if (!a.value.length) return p.value = !1, Z();
454
454
  n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Z();
455
455
  }
456
- function Y(t) {
456
+ function te(t) {
457
457
  let n = A.value;
458
458
  if (!n.length) return;
459
- let i = Ee(t, 0, n.length - 1);
459
+ let i = he(t, 0, n.length - 1);
460
460
  i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
461
461
  }
462
- function X(e) {
462
+ function Y(e) {
463
463
  m.value = e;
464
464
  }
465
- function te() {
465
+ function ne() {
466
466
  h.value = !0, u.clear(!0);
467
467
  }
468
- function ne() {
468
+ function re() {
469
469
  h.value = !1;
470
470
  }
471
- function re() {
471
+ function ie() {
472
472
  y += 1, _?.abort(), _ = null, u.clear(!0), g.clear(), s.value = null, l.value = null, f.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), p.value = !1, o.value = !1, Z();
473
473
  }
474
- function ie() {
474
+ function ae() {
475
475
  return je(A.value, j.value);
476
476
  }
477
- function ae(e = null) {
477
+ function oe(e = null, t = {}) {
478
478
  if (A.value.length === 0) {
479
- r.value = 0, n.value.length > 0 && (o.value = !0);
479
+ r.value = 0, !t.preserveTrailingPlaceholder && n.value.length > 0 && (o.value = !0);
480
+ return;
481
+ }
482
+ if (e) {
483
+ let t = A.value.findIndex((t) => Q(t) === e);
484
+ if (t >= 0) {
485
+ r.value = t;
486
+ return;
487
+ }
488
+ }
489
+ if (t.preserveTrailingPlaceholder && r.value >= A.value.length) {
490
+ r.value = A.value.length;
480
491
  return;
481
492
  }
482
493
  r.value = Me(A.value, j.value, e);
483
494
  }
484
- function oe() {
495
+ function se() {
485
496
  a.value.length > 0 && !V.value.length && J();
486
497
  }
487
- async function se() {
488
- !A.value.length || Q() || (z.value && r.value < 3 && await G(), R.value && r.value >= A.value.length - 3 && await ee());
498
+ async function ce() {
499
+ if (!(!m.value || ve())) {
500
+ if (!A.value.length) {
501
+ R.value && await W();
502
+ return;
503
+ }
504
+ z.value && r.value < 3 && await G(), R.value && r.value >= A.value.length - 3 && await W();
505
+ }
489
506
  }
490
- async function ce(e) {
507
+ async function X(e) {
491
508
  v = async () => {
492
- await ce(e);
509
+ await X(e);
493
510
  };
494
511
  let t = await de({
495
512
  continueUntilFilled: D.value === "dynamic",
@@ -514,8 +531,8 @@ function Be(e) {
514
531
  phase: "loading"
515
532
  });
516
533
  if (!t) return;
517
- let r = ie();
518
- n.value = [...t.buckets, ...n.value], ae(r), Z();
534
+ let r = ae();
535
+ n.value = [...t.buckets, ...n.value], oe(r), Z();
519
536
  }
520
537
  async function ue(t) {
521
538
  if (v = async () => {
@@ -523,7 +540,7 @@ function Be(e) {
523
540
  }, !e.resolve) return;
524
541
  let r = t === "leading" ? N.value : P.value;
525
542
  if (!r) return;
526
- let i = Te(r.cursor);
543
+ let i = me(r.cursor);
527
544
  if (g.has(i)) return;
528
545
  g.add(i), s.value = null, c.value = "refreshing", l.value = null, f.value = null;
529
546
  let a = ++y, o = typeof AbortController > "u" ? null : new AbortController();
@@ -535,14 +552,14 @@ function Be(e) {
535
552
  signal: o?.signal
536
553
  });
537
554
  if (a !== y) return Z();
538
- let i = fe({
555
+ let i = ge({
539
556
  cursor: r.cursor,
540
557
  nextCursor: t.nextPage,
541
558
  nextItems: t.items,
542
559
  previousCursor: t.previousPage ?? null,
543
560
  previousItems: r.items
544
- }), s = ie();
545
- n.value = xe(n.value, r.cursor, i), ae(s), Z();
561
+ }), s = ae();
562
+ n.value = Te(n.value, r.cursor, i), oe(s), Z();
546
563
  } catch (e) {
547
564
  if (De(e) || a !== y) {
548
565
  Z();
@@ -559,7 +576,7 @@ function Be(e) {
559
576
  for (s.value = null, c.value = t.phase, l.value = null, f.value = null;;) {
560
577
  if (n !== y) return ke(i, t.direction, e.removedIds.value, !0);
561
578
  if (i.length > 0 && h.value) return ke(i, t.direction, e.removedIds.value, !1);
562
- let d = Te(a);
579
+ let d = me(a);
563
580
  if (r.has(d) || g.has(d)) break;
564
581
  r.add(d), g.add(d);
565
582
  let p = typeof AbortController > "u" ? null : new AbortController();
@@ -571,7 +588,7 @@ function Be(e) {
571
588
  signal: p?.signal
572
589
  });
573
590
  if (n !== y) return ke(i, t.direction, e.removedIds.value, !0);
574
- let s = fe({
591
+ let s = ge({
575
592
  cursor: a,
576
593
  nextCursor: r.nextPage,
577
594
  nextItems: r.items,
@@ -579,7 +596,7 @@ function Be(e) {
579
596
  previousItems: []
580
597
  });
581
598
  i.push(s);
582
- let d = i.reduce((t, n) => t + ye(n, e.removedIds.value), 0), m = t.direction === "forward" ? s.nextCursor : s.previousCursor;
599
+ let d = i.reduce((t, n) => t + Ce(n, e.removedIds.value), 0), m = t.direction === "forward" ? s.nextCursor : s.previousCursor;
583
600
  if (!t.continueUntilFilled || d >= O.value || !m) return {
584
601
  canceled: !1,
585
602
  buckets: t.direction === "backward" ? [...i].reverse() : i,
@@ -598,7 +615,7 @@ function Be(e) {
598
615
  }
599
616
  return ke(i, t.direction, e.removedIds.value, !1);
600
617
  }
601
- function fe(e) {
618
+ function ge(e) {
602
619
  let t = Oe({
603
620
  cursor: e.cursor,
604
621
  nextCursor: e.nextCursor,
@@ -612,7 +629,7 @@ function Be(e) {
612
629
  function Z() {
613
630
  c.value = "idle", l.value = null, f.value = null, u.clear();
614
631
  }
615
- function pe() {
632
+ function _e() {
616
633
  if (!e.initialState || !e.initialState.items.length) return !1;
617
634
  let t = Ae({
618
635
  initialState: e.initialState,
@@ -621,17 +638,17 @@ function Be(e) {
621
638
  });
622
639
  return n.value = t.buckets, r.value = t.activeIndex, S = t.nextSequence, o.value = !1, s.value = null, a.value = [], p.value = !1, !0;
623
640
  }
624
- function Q() {
641
+ function ve() {
625
642
  return c.value === "initializing";
626
643
  }
627
- function me(t) {
644
+ function ye(t) {
628
645
  return Ne(t === "leading" ? N.value : P.value, e.removedIds.value, O.value);
629
646
  }
630
- function he() {
631
- let t = n.value.findIndex((t) => ye(t, e.removedIds.value) > 0);
647
+ function Se() {
648
+ let t = n.value.findIndex((t) => Ce(t, e.removedIds.value) > 0);
632
649
  if (t < 0) return;
633
650
  let r = t;
634
- for (let i = n.value.length - 1; i >= t; --i) if (ye(n.value[i], e.removedIds.value) > 0) {
651
+ for (let i = n.value.length - 1; i >= t; --i) if (Ce(n.value[i], e.removedIds.value) > 0) {
635
652
  r = i;
636
653
  break;
637
654
  }
@@ -639,8 +656,8 @@ function Be(e) {
639
656
  }
640
657
  return {
641
658
  activeIndex: j,
642
- canRetryInitialLoad: U,
643
- cancel: re,
659
+ canRetryInitialLoad: ee,
660
+ cancel: ie,
644
661
  canRefreshTrailingBoundary: B,
645
662
  commitPendingAppend: J,
646
663
  currentCursor: H,
@@ -650,41 +667,43 @@ function Be(e) {
650
667
  fillTargetCount: f,
651
668
  hasNextPage: R,
652
669
  hasPreviousPage: z,
670
+ isAutoPrefetchEnabled: m,
653
671
  isPageLoadingLocked: h,
654
672
  items: A,
655
- lockPageLoading: te,
673
+ lockPageLoading: ne,
656
674
  loading: M,
657
675
  mode: D,
676
+ maybePrefetchAround: ce,
658
677
  nextCursor: I,
659
678
  pendingAppendItems: V,
660
679
  phase: c,
661
- prefetchNextPage: ee,
680
+ prefetchNextPage: W,
662
681
  prefetchPreviousPage: G,
663
682
  previousCursor: L,
664
683
  retryInitialLoad: K,
665
684
  retry: q,
666
- setActiveIndex: Y,
667
- setAutoPrefetchEnabled: X,
668
- syncActiveIndexAfterVisibilityChange: ae,
669
- unlockPageLoading: ne,
670
- getActiveOccurrenceKey: ie,
671
- maybeCommitPendingAppendWhenFilteredOut: oe
685
+ setActiveIndex: te,
686
+ setAutoPrefetchEnabled: Y,
687
+ syncActiveIndexAfterVisibilityChange: oe,
688
+ unlockPageLoading: re,
689
+ getActiveOccurrenceKey: ae,
690
+ maybeCommitPendingAppendWhenFilteredOut: se
672
691
  };
673
692
  }
674
693
  function Ve(e, t) {
675
- return e.find((e) => ye(e, t) > 0) ?? e[0] ?? null;
694
+ return e.find((e) => Ce(e, t) > 0) ?? e[0] ?? null;
676
695
  }
677
696
  function He(e, t) {
678
697
  for (let n = e.length - 1; n >= 0; --n) {
679
698
  let r = e[n];
680
- if (ye(r, t) > 0) return r;
699
+ if (Ce(r, t) > 0) return r;
681
700
  }
682
701
  return e[e.length - 1] ?? null;
683
702
  }
684
703
  //#endregion
685
704
  //#region src/components/viewer-core/useDataSource.ts
686
705
  function Ue(e, t) {
687
- let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = fe(), l = Be({
706
+ let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = ge(), l = Be({
688
707
  emit: t,
689
708
  fillDelayMs: e.fillDelayMs,
690
709
  fillDelayStepMs: e.fillDelayStepMs,
@@ -700,8 +719,8 @@ function Ue(e, t) {
700
719
  t.length && l.setActiveIndex(C(e, 0, t.length - 1));
701
720
  }
702
721
  function y(e) {
703
- let t = l.getActiveOccurrenceKey(), n = a(e);
704
- return n.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t), n) : n;
722
+ let t = l.getActiveOccurrenceKey(), n = u.value[d.value] ?? null, r = Array.isArray(e) ? e : [e], i = !!(n && r.includes(n.id) && l.isAutoPrefetchEnabled.value && d.value >= u.value.length - 3), o = !!(n && r.includes(n.id) && l.hasNextPage.value && d.value === u.value.length - 1), s = a(e);
723
+ return s.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t, { preserveTrailingPlaceholder: o }), i && l.maybePrefetchAround(), s) : s;
705
724
  }
706
725
  function b(e) {
707
726
  let t = l.getActiveOccurrenceKey(), n = s(e);
@@ -800,8 +819,13 @@ function Ge(e, t) {
800
819
  m();
801
820
  }), F([c, () => n.pendingAppendItems.value.length], ([e, t]) => {
802
821
  e === "list" || t <= 0 || n.commitPendingAppend();
803
- }), F(() => n.items.value.length, (e) => {
804
- !s.value || e > 0 || a.value === "list" || (a.value = "list", t("update:surfaceMode", "list"));
822
+ }), F([
823
+ () => n.items.value.length,
824
+ () => n.loading.value,
825
+ () => n.hasNextPage.value,
826
+ () => n.pendingAppendItems.value.length
827
+ ], ([e, n, r, i]) => {
828
+ !s.value || e > 0 || a.value === "list" || n || r || i > 0 || (a.value = "list", t("update:surfaceMode", "list"));
805
829
  }), F(c, (e) => {
806
830
  n.setAutoPrefetchEnabled(e === "fullscreen");
807
831
  }, { immediate: !0 }), I(() => {
@@ -895,7 +919,7 @@ var Ke = {
895
919
  "data-testid": "vibe-pagination",
896
920
  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]"
897
921
  }, ot = { class: "whitespace-nowrap" }, st = {
898
- key: 0,
922
+ key: 1,
899
923
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
900
924
  }, ct = {
901
925
  key: 0,
@@ -904,6 +928,7 @@ var Ke = {
904
928
  __name: "FullscreenHeader",
905
929
  props: {
906
930
  currentIndex: {},
931
+ loading: { type: Boolean },
907
932
  paginationDetail: {},
908
933
  showBackToList: { type: Boolean },
909
934
  showEndBadge: { type: Boolean },
@@ -923,13 +948,22 @@ var Ke = {
923
948
  }, [u(j(J), {
924
949
  class: "h-4 w-4 stroke-[2.2]",
925
950
  "aria-hidden": "true"
926
- })])) : o("", !0), n.title ? (S(), s("h2", rt, k(n.title), 1)) : o("", !0)]), c("div", it, [c("span", at, [c("span", ot, k(n.currentIndex + 1) + " / " + k(n.total), 1), n.paginationDetail ? (S(), s("span", st, k(n.paginationDetail), 1)) : o("", !0)]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", ct, [...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)]));
951
+ })])) : o("", !0), n.title ? (S(), s("h2", rt, k(n.title), 1)) : o("", !0)]), c("div", it, [c("span", at, [
952
+ n.loading ? (S(), a(j(ie), {
953
+ key: 0,
954
+ "data-testid": "vibe-pagination-spinner",
955
+ class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
956
+ "aria-hidden": "true"
957
+ })) : o("", !0),
958
+ c("span", ot, k(n.currentIndex + 1) + " / " + k(n.total), 1),
959
+ n.paginationDetail ? (S(), s("span", st, k(n.paginationDetail), 1)) : o("", !0)
960
+ ]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", ct, [...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)]));
927
961
  }
928
962
  }), ut = {
929
- image: ne,
930
- video: X,
931
- audio: Y,
932
- other: te
963
+ image: re,
964
+ video: Y,
965
+ audio: te,
966
+ other: ne
933
967
  }, dt = {
934
968
  image: "Image",
935
969
  video: "Video",
@@ -1155,6 +1189,8 @@ function It(e) {
1155
1189
  await x();
1156
1190
  }), F(() => e.itemCount.value, async () => {
1157
1191
  await x();
1192
+ }), F(() => e.loopFullscreenVideo.value, async () => {
1193
+ await x();
1158
1194
  });
1159
1195
  function _(e, t) {
1160
1196
  if (t instanceof HTMLVideoElement) {
@@ -1183,12 +1219,12 @@ function It(e) {
1183
1219
  }
1184
1220
  await g();
1185
1221
  let t = l.value;
1186
- for (let [e, n] of o.entries()) {
1187
- if (e !== t || r.value[e]?.errorKind) {
1188
- z(n, e);
1222
+ for (let [n, i] of o.entries()) {
1223
+ if (n !== t || r.value[n]?.errorKind) {
1224
+ z(i, n);
1189
1225
  continue;
1190
1226
  }
1191
- n.muted = !0, n.loop = !1, n.playsInline = !0, Ft(n), H(e, n);
1227
+ i.muted = !0, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, Ft(i), H(n, i);
1192
1228
  }
1193
1229
  for (let [e, n] of s.entries()) {
1194
1230
  if (e !== t || r.value[e]?.errorKind) {
@@ -1223,7 +1259,7 @@ function It(e) {
1223
1259
  });
1224
1260
  }
1225
1261
  async function E(t, n) {
1226
- let r = W(t), i = V(t), a = q(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1262
+ let r = U(t), i = V(t), a = q(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1227
1263
  if (r) {
1228
1264
  r.pause();
1229
1265
  try {
@@ -1244,15 +1280,15 @@ function It(e) {
1244
1280
  e.button !== 0 || Date.now() < n || G(o.get(t) ?? null);
1245
1281
  }
1246
1282
  function O(e, t, n) {
1247
- e.button !== 0 || Date.now() < n || G(W(t));
1283
+ e.button !== 0 || Date.now() < n || G(U(t));
1248
1284
  }
1249
1285
  function k(e) {
1250
- let t = ee(), n = u.value;
1286
+ let t = W(), n = u.value;
1251
1287
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1252
1288
  let r = Number.parseFloat(e.target.value);
1253
1289
  if (!Number.isFinite(r)) return;
1254
1290
  let i = Lt(r, 0, p.value || 0);
1255
- U(n, i, t), t.currentTime = i;
1291
+ ee(n, i, t), t.currentTime = i;
1256
1292
  }
1257
1293
  function A(e) {
1258
1294
  return !!t.value[e] && !n.value[e];
@@ -1281,7 +1317,7 @@ function It(e) {
1281
1317
  t.value[e] = !1, n.value[e] = null;
1282
1318
  let r = V(e);
1283
1319
  r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
1284
- let i = W(e);
1320
+ let i = U(e);
1285
1321
  i && z(i, e), c.forEach((t) => {
1286
1322
  t.startsWith(`${e}|`) && c.delete(t);
1287
1323
  }), a.value[e] = (a.value[e] ?? 0) + 1, await g(), await x();
@@ -1303,15 +1339,15 @@ function It(e) {
1303
1339
  function H(e, t, n) {
1304
1340
  Dt(V(e), t, n);
1305
1341
  }
1306
- function U(e, t, n) {
1342
+ function ee(e, t, n) {
1307
1343
  let r = V(e);
1308
1344
  r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.paused = n.paused;
1309
1345
  }
1310
- function W(e) {
1346
+ function U(e) {
1311
1347
  return o.get(e) ?? s.get(e) ?? null;
1312
1348
  }
1313
- function ee() {
1314
- return u.value ? W(u.value) : null;
1349
+ function W() {
1350
+ return u.value ? U(u.value) : null;
1315
1351
  }
1316
1352
  function G(e) {
1317
1353
  if (e) {
@@ -1395,173 +1431,223 @@ function Bt(e, t, n, r, i) {
1395
1431
  //#endregion
1396
1432
  //#region src/components/viewer-core/useViewer.ts
1397
1433
  function Vt(e, t, n = {}) {
1398
- 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.paginationDetail ?? null), u = i(() => xt({
1434
+ let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => xt({
1399
1435
  itemCount: r.value.length,
1400
1436
  loading: s.value,
1401
1437
  phase: e.phase
1402
- })), d = i(() => !1), f = T(null), p = T(0), m = T(!1), h = T(1), g = n.enabled ?? i(() => !0), _ = null, v = 0, y = 0, b = 0, x = i(() => r.value.length === 0 ? 0 : N(a.value, 0, r.value.length - 1)), S = i(() => r.value[x.value] ?? null), C = i(() => S.value?.type === "audio" || S.value?.type === "video" ? S.value : null), w = It({
1438
+ })), f = i(() => !1), p = T(null), m = T(0), h = T(!1), g = T(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), E = It({
1403
1439
  items: r,
1404
- activeItem: S,
1405
- activeMediaItem: C,
1406
- isEnabled: g,
1440
+ activeItem: C,
1441
+ activeMediaItem: w,
1442
+ isEnabled: _,
1407
1443
  itemCount: i(() => r.value.length),
1444
+ loopFullscreenVideo: l,
1408
1445
  onAssetError: n.onAssetError,
1409
1446
  onAssetLoad: n.onAssetLoad
1410
- }), E = i(() => r.value.length > 0 && x.value === r.value.length - 1), D = i(() => St({
1447
+ }), D = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => St({
1411
1448
  errorMessage: o.value,
1412
1449
  hasItems: r.value.length > 0,
1413
1450
  hasNextPage: c.value,
1414
- phase: u.value,
1451
+ phase: d.value,
1415
1452
  surface: "fullscreen"
1416
- })), O = i(() => D.value?.kind ?? null), k = i(() => D.value?.message ?? null), A = i(() => Math.min(96, h.value * .15 || 96)), j = i(() => Rt(x.value, r.value.length)), M = i(() => zt(r.value, x.value));
1453
+ })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => Rt(S.value, r.value.length)), N = i(() => zt(r.value, S.value));
1417
1454
  Ct({
1418
- enabled: g,
1455
+ enabled: _,
1419
1456
  onDisable() {
1420
- U(), w.resetMediaState();
1457
+ U(), E.resetMediaState();
1421
1458
  },
1422
1459
  onEnable() {
1423
- return w.syncMediaPlayback();
1460
+ return E.syncMediaPlayback();
1424
1461
  },
1425
- onKeydown: ee,
1426
- onResize: P
1462
+ onKeydown: G,
1463
+ onResize: F
1427
1464
  });
1428
- function N(e, t, n) {
1465
+ function P(e, t, n) {
1429
1466
  return Math.min(Math.max(e, t), n);
1430
1467
  }
1431
- function P() {
1432
- h.value = f.value?.clientHeight || window.innerHeight || 1;
1433
- }
1434
- function F(e) {
1435
- return r.value.length === 0 ? !1 : N(x.value + e, 0, r.value.length - 1) !== x.value;
1468
+ function F() {
1469
+ g.value = p.value?.clientHeight || window.innerHeight || 1;
1436
1470
  }
1437
1471
  function I(e) {
1438
- if (r.value.length === 0) return;
1439
- let n = N(x.value + e, 0, r.value.length - 1);
1440
- n !== x.value && t("update:activeIndex", n);
1472
+ return r.value.length === 0 ? !1 : P(S.value + e, 0, r.value.length - 1) !== S.value;
1441
1473
  }
1442
1474
  function L(e) {
1443
- let t = e > 0, n = e < 0;
1444
- return t && !F(-1) || n && !F(1) ? e * .24 : e;
1475
+ if (r.value.length === 0) return;
1476
+ let n = P(S.value + e, 0, r.value.length - 1);
1477
+ n !== S.value && t("update:activeIndex", n);
1445
1478
  }
1446
1479
  function R(e) {
1447
- !g.value || r.value.length === 0 || e.pointerType === "mouse" || de(e.target) || (_ = e.pointerId, v = e.clientY, p.value = 0, m.value = !0, f.value?.setPointerCapture?.(e.pointerId));
1480
+ let t = e > 0, n = e < 0;
1481
+ return t && !I(-1) || n && !I(1) ? e * .24 : e;
1448
1482
  }
1449
1483
  function z(e) {
1450
- !g.value || !m.value || _ !== e.pointerId || (p.value = L(e.clientY - v));
1484
+ !_.value || r.value.length === 0 || e.pointerType === "mouse" || de(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
1451
1485
  }
1452
1486
  function B(e) {
1453
- !g.value || _ !== e.pointerId || (f.value?.releasePointerCapture?.(e.pointerId), H());
1487
+ !_.value || !h.value || v !== e.pointerId || (m.value = R(e.clientY - y));
1454
1488
  }
1455
1489
  function V(e) {
1456
- !g.value || _ !== e.pointerId || (f.value?.releasePointerCapture?.(e.pointerId), U());
1490
+ !_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), ee());
1457
1491
  }
1458
- function H() {
1459
- Math.abs(p.value) >= A.value && (b = Date.now() + 250, I(p.value < 0 ? 1 : -1)), U();
1492
+ function H(e) {
1493
+ !_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), U());
1494
+ }
1495
+ function ee() {
1496
+ Math.abs(m.value) >= j.value && (x = Date.now() + 250, L(m.value < 0 ? 1 : -1)), U();
1460
1497
  }
1461
1498
  function U() {
1462
- p.value = 0, m.value = !1, _ = null;
1499
+ m.value = 0, h.value = !1, v = null;
1463
1500
  }
1464
1501
  function W(e) {
1465
- if (!g.value || r.value.length === 0 || m.value || de(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
1502
+ if (!_.value || r.value.length === 0 || h.value || de(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
1466
1503
  e.preventDefault();
1467
1504
  let t = Date.now();
1468
- t < y || (y = t + 400, I(e.deltaY > 0 ? 1 : -1));
1469
- }
1470
- function ee(e) {
1471
- !g.value || r.value.length === 0 || ue(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), I(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), I(-1)));
1505
+ t < b || (b = t + 400, L(e.deltaY > 0 ? 1 : -1));
1472
1506
  }
1473
- function G(e, t) {
1474
- w.onVideoClick(e, t, b);
1507
+ function G(e) {
1508
+ !_.value || r.value.length === 0 || ue(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), L(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), L(-1)));
1475
1509
  }
1476
1510
  function K(e, t) {
1477
- w.onAudioCoverClick(e, t, b);
1511
+ E.onVideoClick(e, t, x);
1478
1512
  }
1479
- function q(e) {
1480
- w.onMediaSeekInput(e);
1513
+ function q(e, t) {
1514
+ E.onAudioCoverClick(e, t, x);
1481
1515
  }
1482
1516
  function J(e) {
1517
+ E.onMediaSeekInput(e);
1518
+ }
1519
+ function te(e) {
1483
1520
  return e.type === "image" || e.type === "video";
1484
1521
  }
1485
1522
  function Y(e) {
1486
1523
  return e.type === "audio";
1487
1524
  }
1488
- function X(e) {
1489
- return Bt(e, x.value, h.value, p.value, m.value);
1525
+ function ne(e) {
1526
+ return Bt(e, S.value, g.value, m.value, h.value);
1490
1527
  }
1491
1528
  return {
1492
- activeItem: S,
1493
- activeAssetErrorKind: w.activeAssetErrorKind,
1494
- activeMediaDuration: w.activeMediaDuration,
1495
- activeMediaItem: C,
1496
- activeMediaProgress: w.activeMediaProgress,
1497
- activeMediaState: w.activeMediaState,
1498
- canRetryAsset: w.canRetryAsset,
1499
- canRetryInitialLoad: d,
1529
+ activeItem: C,
1530
+ activeAssetErrorKind: E.activeAssetErrorKind,
1531
+ activeMediaDuration: E.activeMediaDuration,
1532
+ activeMediaItem: w,
1533
+ activeMediaProgress: E.activeMediaProgress,
1534
+ activeMediaState: E.activeMediaState,
1535
+ canRetryAsset: E.canRetryAsset,
1536
+ canRetryInitialLoad: f,
1500
1537
  errorMessage: o,
1501
- getAssetErrorKind: w.getAssetErrorKind,
1502
- getAssetErrorLabel: w.getAssetErrorLabel,
1503
- getAssetRenderKey: w.getAssetRenderKey,
1538
+ getAssetErrorKind: E.getAssetErrorKind,
1539
+ getAssetErrorLabel: E.getAssetErrorLabel,
1540
+ getAssetRenderKey: E.getAssetRenderKey,
1504
1541
  formatPlaybackTime: bt,
1505
- getImageSource: w.getImageSource,
1506
- getSlideStyle: X,
1542
+ getImageSource: E.getImageSource,
1543
+ getSlideStyle: ne,
1507
1544
  hasNextPage: c,
1508
- isAtEnd: E,
1545
+ isAtEnd: D,
1509
1546
  isAudio: Y,
1510
- isVisual: J,
1547
+ isVisual: te,
1511
1548
  items: r,
1512
1549
  loading: s,
1513
- mediaStates: w.mediaStates,
1514
- isImageReady: w.isImageReady,
1515
- isMediaReady: w.isMediaReady,
1516
- onAudioCoverClick: K,
1517
- onImageError: w.onImageError,
1518
- onImageLoad: w.onImageLoad,
1519
- onMediaEvent: w.onMediaEvent,
1520
- onMediaError: w.onMediaError,
1521
- onMediaSeekInput: q,
1522
- onPointerCancel: V,
1523
- onPointerDown: R,
1524
- onPointerMove: z,
1525
- onPointerUp: B,
1526
- onVideoClick: G,
1550
+ mediaStates: E.mediaStates,
1551
+ isImageReady: E.isImageReady,
1552
+ isMediaReady: E.isMediaReady,
1553
+ onAudioCoverClick: q,
1554
+ onImageError: E.onImageError,
1555
+ onImageLoad: E.onImageLoad,
1556
+ onMediaEvent: E.onMediaEvent,
1557
+ onMediaError: E.onMediaError,
1558
+ onMediaSeekInput: J,
1559
+ onPointerCancel: H,
1560
+ onPointerDown: z,
1561
+ onPointerMove: B,
1562
+ onPointerUp: V,
1563
+ onVideoClick: K,
1527
1564
  onWheel: W,
1528
- registerAudioElement: w.registerAudioElement,
1529
- registerImageElement: w.registerImageElement,
1530
- registerVideoElement: w.registerVideoElement,
1531
- renderedItems: M,
1532
- renderedRange: j,
1533
- resolvedActiveIndex: x,
1565
+ registerAudioElement: E.registerAudioElement,
1566
+ registerImageElement: E.registerImageElement,
1567
+ registerVideoElement: E.registerVideoElement,
1568
+ renderedItems: N,
1569
+ renderedRange: M,
1570
+ resolvedActiveIndex: S,
1534
1571
  retryInitialLoad: async () => {},
1535
- retryAsset: w.retryAsset,
1536
- stageRef: f,
1537
- statusKind: O,
1538
- statusMessage: k,
1539
- paginationDetail: l,
1540
- phase: u
1572
+ retryAsset: E.retryAsset,
1573
+ stageRef: p,
1574
+ statusKind: k,
1575
+ statusMessage: A,
1576
+ paginationDetail: u,
1577
+ phase: d
1541
1578
  };
1542
1579
  }
1543
1580
  //#endregion
1544
1581
  //#region src/components/viewer-core/theme.ts
1545
- var Ht = {
1546
- image: "bg-[radial-gradient(circle_at_top_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
1547
- video: "bg-[radial-gradient(circle_at_top_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
1548
- audio: "bg-[radial-gradient(circle_at_top_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
1549
- other: "bg-[radial-gradient(circle_at_top_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
1550
- }, Ut = {
1551
- image: "bg-[radial-gradient(circle_at_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
1552
- video: "bg-[radial-gradient(circle_at_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
1553
- audio: "bg-[radial-gradient(circle_at_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
1554
- other: "bg-[radial-gradient(circle_at_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
1582
+ var Ht = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", Ut = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", Wt = {
1583
+ image: !0,
1584
+ video: !0,
1585
+ audio: !0,
1586
+ other: !0
1555
1587
  };
1556
- function Wt(e) {
1557
- return Ht[e];
1558
- }
1559
1588
  function Gt(e) {
1560
- return Ut[e];
1589
+ return Wt[e], Ht;
1590
+ }
1591
+ function Kt(e) {
1592
+ return Wt[e], Ut;
1593
+ }
1594
+ //#endregion
1595
+ //#region src/components/viewer-core/dominantImageTone.ts
1596
+ function qt(e) {
1597
+ if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
1598
+ let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
1599
+ if (!n) return null;
1600
+ t.width = 24, t.height = 24;
1601
+ try {
1602
+ n.drawImage(e, 0, 0, 24, 24);
1603
+ let { data: t } = n.getImageData(0, 0, 24, 24), r = 0, i = 0, a = 0, o = 0;
1604
+ for (let e = 0; e < t.length; e += 4) {
1605
+ let n = t[e + 3] / 255;
1606
+ if (n <= .05) continue;
1607
+ let s = t[e], c = t[e + 1], l = t[e + 2], u = Math.max(s, c, l), d = n * (.65 + (u === 0 ? 0 : (u - Math.min(s, c, l)) / u) * .7);
1608
+ r += d, i += s * d, a += c * d, o += l * d;
1609
+ }
1610
+ return r <= 0 ? null : {
1611
+ r: Jt(Math.round(i / r)),
1612
+ g: Jt(Math.round(a / r)),
1613
+ b: Jt(Math.round(o / r))
1614
+ };
1615
+ } catch {
1616
+ return null;
1617
+ }
1618
+ }
1619
+ function Jt(e) {
1620
+ return Math.min(235, Math.max(26, e));
1621
+ }
1622
+ //#endregion
1623
+ //#region src/components/viewer-core/useFullscreenDominantTone.ts
1624
+ function Yt(e) {
1625
+ let t = T({}), n = i(() => e.activeItem.value ? e.getItemKey(e.activeItem.value) : null), r = i(() => !e.showDominantImageTone.value || e.activeItem.value?.type !== "image" || !n.value || !e.isImageReady(n.value) ? null : t.value[n.value] ?? null), a = i(() => {
1626
+ if (!r.value) return;
1627
+ let { r: e, g: t, b: n } = r.value;
1628
+ return { background: `radial-gradient(circle at top center, rgba(${e},${t},${n},0.34) 0%, transparent 44%), linear-gradient(180deg,#0a0b10,#05060a)` };
1629
+ }), o = i(() => {
1630
+ if (!r.value) return;
1631
+ let { r: e, g: t, b: n } = r.value;
1632
+ return { background: `radial-gradient(circle at center, rgba(${e},${t},${n},0.42) 0%, transparent 44%), linear-gradient(180deg,#0b0c11,#06070b)` };
1633
+ });
1634
+ F(() => e.showDominantImageTone.value, (e) => {
1635
+ e || (t.value = {});
1636
+ });
1637
+ function s(n, r) {
1638
+ if (!e.showDominantImageTone.value) return;
1639
+ let i = qt(r);
1640
+ i && (t.value[n] = i);
1641
+ }
1642
+ return {
1643
+ activeStageToneStyle: a,
1644
+ activeSlideToneStyle: o,
1645
+ updateFromImageElement: s
1646
+ };
1561
1647
  }
1562
1648
  //#endregion
1563
1649
  //#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
1564
- var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1650
+ var Xt = ["data-surface"], Zt = ["data-surface"], Qt = /* @__PURE__ */ d({
1565
1651
  inheritAttrs: !1,
1566
1652
  __name: "SurfaceEmptyState",
1567
1653
  props: {
@@ -1575,31 +1661,32 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1575
1661
  "data-testid": "vibe-empty-state-inline",
1576
1662
  "data-surface": e.surface,
1577
1663
  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)]"]
1578
- }), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16, Kt)) : (S(), s("div", h({ key: 1 }, j(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [D(n.$slots, "default", {}, () => [c("span", {
1664
+ }), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16, Xt)) : (S(), s("div", h({ key: 1 }, j(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [D(n.$slots, "default", {}, () => [c("span", {
1579
1665
  "data-testid": "vibe-empty-state-badge",
1580
1666
  "data-surface": e.surface,
1581
1667
  class: _(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
1582
- }, k(e.message), 11, qt)])], 16));
1668
+ }, k(e.message), 11, Zt)])], 16));
1583
1669
  }
1584
- }), Yt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Xt = {
1670
+ }), $t = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, en = {
1585
1671
  key: 0,
1586
1672
  class: "relative h-full min-h-0"
1587
- }, Zt = [
1673
+ }, tn = [
1588
1674
  "data-item-id",
1589
1675
  "data-occurrence-key",
1590
1676
  "data-index",
1591
1677
  "data-active",
1592
1678
  "aria-hidden"
1593
- ], Qt = {
1679
+ ], nn = {
1594
1680
  key: 0,
1595
1681
  "data-testid": "vibe-asset-spinner",
1596
1682
  class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
1597
- }, $t = { 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]" }, en = ["data-kind"], tn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, nn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, rn = ["onClick"], an = [
1683
+ }, rn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, an = ["data-kind"], on = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, sn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, cn = ["onClick"], ln = [
1598
1684
  "src",
1599
1685
  "alt",
1600
1686
  "onLoad",
1601
1687
  "onError"
1602
- ], on = [
1688
+ ], un = [
1689
+ "loop",
1603
1690
  "src",
1604
1691
  "preload",
1605
1692
  "onClick",
@@ -1616,15 +1703,15 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1616
1703
  "onStalled",
1617
1704
  "onTimeupdate",
1618
1705
  "onWaiting"
1619
- ], sn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, cn = [
1706
+ ], dn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, fn = [
1620
1707
  "aria-label",
1621
1708
  "disabled",
1622
1709
  "onClick"
1623
- ], ln = { class: "relative z-[1] inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-emerald-500/12 p-4 backdrop-blur-[20px]" }, un = { 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]" }, dn = {
1710
+ ], pn = { 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]" }, mn = { 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]" }, hn = {
1624
1711
  key: 0,
1625
1712
  "data-testid": "vibe-asset-spinner",
1626
1713
  class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
1627
- }, fn = { 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]" }, pn = ["data-kind"], mn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, hn = ["onClick"], gn = [
1714
+ }, gn = { 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]" }, _n = ["data-kind"], vn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, yn = ["onClick"], bn = [
1628
1715
  "src",
1629
1716
  "preload",
1630
1717
  "onCanplay",
@@ -1640,21 +1727,25 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1640
1727
  "onStalled",
1641
1728
  "onTimeupdate",
1642
1729
  "onWaiting"
1643
- ], _n = {
1730
+ ], xn = {
1644
1731
  key: 2,
1645
1732
  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"
1646
- }, vn = { 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]" }, yn = {
1733
+ }, Sn = { 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]" }, Cn = {
1647
1734
  key: 0,
1648
1735
  class: "pointer-events-none absolute inset-0 z-[4]"
1649
- }, bn = { class: "h-full w-full" }, xn = {
1736
+ }, wn = { class: "h-full w-full" }, Tn = {
1737
+ key: 1,
1738
+ "data-testid": "vibe-forward-fill-placeholder",
1739
+ class: "grid h-full min-h-0 place-items-center px-6 text-center"
1740
+ }, En = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, Dn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)]" }, On = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, kn = {
1650
1741
  key: 0,
1651
1742
  "data-testid": "vibe-fullscreen-aside",
1652
1743
  class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
1653
- }, Sn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Cn = {
1744
+ }, An = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, jn = {
1654
1745
  key: 0,
1655
1746
  "data-testid": "vibe-fullscreen-aside",
1656
1747
  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]"
1657
- }, wn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Tn = 1280, En = /* @__PURE__ */ d({
1748
+ }, Mn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Nn = 1280, Pn = /* @__PURE__ */ d({
1658
1749
  __name: "FullscreenSurface",
1659
1750
  props: {
1660
1751
  active: {
@@ -1673,6 +1764,10 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1673
1764
  type: Boolean,
1674
1765
  default: !1
1675
1766
  },
1767
+ loopFullscreenVideo: {
1768
+ type: Boolean,
1769
+ default: !0
1770
+ },
1676
1771
  paginationDetail: { default: null },
1677
1772
  phase: { default: null },
1678
1773
  reportAssetError: {
@@ -1683,6 +1778,10 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1683
1778
  type: [Function, null],
1684
1779
  default: null
1685
1780
  },
1781
+ showDominantImageTone: {
1782
+ type: Boolean,
1783
+ default: !0
1784
+ },
1686
1785
  showBackToList: {
1687
1786
  type: Boolean,
1688
1787
  default: !1
@@ -1704,11 +1803,16 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1704
1803
  enabled: A(d, "active"),
1705
1804
  onAssetError: d.reportAssetError ?? void 0,
1706
1805
  onAssetLoad: d.reportAssetLoad ?? void 0
1707
- }), C = T(typeof window > "u" ? Tn : window.innerWidth || Tn), w = ht({
1806
+ }), C = T(typeof window > "u" ? Nn : window.innerWidth || Nn), w = ht({
1708
1807
  active: A(d, "active"),
1709
1808
  resolvedActiveIndex: g.resolvedActiveIndex,
1710
1809
  viewer: g
1711
- }), M = i(() => Wt(g.activeItem.value?.type ?? "image")), P = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), F = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), I = i(() => F.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), R = i(() => {
1810
+ }), M = i(() => Gt(g.activeItem.value?.type ?? "image")), { activeSlideToneStyle: P, activeStageToneStyle: F, updateFromImageElement: I } = Yt({
1811
+ activeItem: g.activeItem,
1812
+ getItemKey: w.getItemKey,
1813
+ isImageReady: g.isImageReady,
1814
+ showDominantImageTone: A(d, "showDominantImageTone")
1815
+ }), R = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), B = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), V = i(() => B.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), H = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), ee = i(() => d.hasNextPage ? "Loading more items" : g.statusMessage.value ?? "Loading more items"), U = i(() => {
1712
1816
  let e = g.activeItem.value;
1713
1817
  return e ? {
1714
1818
  hasNextPage: d.hasNextPage,
@@ -1718,14 +1822,14 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1718
1822
  paginationDetail: d.paginationDetail,
1719
1823
  total: d.items.length
1720
1824
  } : null;
1721
- }), B = i(() => !R.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](R.value)), V = i(() => !R.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](R.value)), H = i(() => !d.showStatusBadges || !R.value || !g.statusKind.value || !g.statusMessage.value ? null : {
1722
- ...R.value,
1825
+ }), W = i(() => !U.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](U.value)), G = i(() => !U.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](U.value)), K = i(() => !d.showStatusBadges || !U.value || !g.statusKind.value || !g.statusMessage.value ? null : {
1826
+ ...U.value,
1723
1827
  kind: g.statusKind.value,
1724
1828
  message: g.statusMessage.value
1725
- }), U = i(() => !H.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](H.value)), W = i(() => ({
1726
- gridTemplateColumns: K.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
1829
+ }), q = i(() => !K.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](K.value)), J = i(() => ({
1830
+ gridTemplateColumns: ne.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
1727
1831
  transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
1728
- })), ee = i(() => gt(B.value)), G = i(() => gt(V.value)), K = i(() => G.value && C.value >= Tn), q = i(() => G.value && !K.value), J = i(() => gt(U.value)), { emptyStateProps: Y, showBadgeEmptyState: X, showCustomEmptyState: te, showInlineEmptyState: ne } = yt({
1832
+ })), te = i(() => gt(W.value)), Y = i(() => gt(G.value)), ne = i(() => Y.value && C.value >= Nn), re = i(() => Y.value && !ne.value), ce = i(() => gt(q.value)), { emptyStateProps: X, showBadgeEmptyState: le, showCustomEmptyState: ue, showInlineEmptyState: de } = yt({
1729
1833
  emptyStateMode: A(d, "emptyStateMode"),
1730
1834
  itemCount: i(() => d.items.length),
1731
1835
  loading: A(d, "loading"),
@@ -1733,18 +1837,32 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1733
1837
  surface: "fullscreen"
1734
1838
  });
1735
1839
  x(() => {
1736
- window.addEventListener("resize", se);
1840
+ window.addEventListener("resize", fe);
1737
1841
  }), b(() => {
1738
- window.removeEventListener("resize", se);
1842
+ window.removeEventListener("resize", fe);
1739
1843
  });
1740
- function se() {
1741
- C.value = window.innerWidth || Tn;
1844
+ function fe() {
1845
+ C.value = window.innerWidth || Nn;
1846
+ }
1847
+ function pe(e, t, n) {
1848
+ g.onImageLoad(t, n);
1849
+ let r = e.currentTarget;
1850
+ r instanceof HTMLImageElement && he(t, r);
1851
+ }
1852
+ function me(e, t) {
1853
+ g.registerImageElement(e, t), t instanceof HTMLImageElement && he(e, t);
1742
1854
  }
1743
- return (e, n) => (S(), s("div", Yt, [
1744
- c("div", { class: _(["absolute inset-0 transition-[background] duration-200", M.value]) }, null, 2),
1855
+ function he(e, t) {
1856
+ I(e, t);
1857
+ }
1858
+ return (e, n) => (S(), s("div", $t, [
1859
+ c("div", {
1860
+ class: _(["absolute inset-0 transition-[background] duration-200", M.value]),
1861
+ style: y(j(F))
1862
+ }, null, 6),
1745
1863
  c("div", {
1746
1864
  class: "relative z-[1] grid h-full min-h-0",
1747
- style: y(W.value)
1865
+ style: y(J.value)
1748
1866
  }, [c("div", {
1749
1867
  ref: "viewer.stageRef",
1750
1868
  "data-testid": "vibe-stage",
@@ -1754,7 +1872,7 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1754
1872
  onPointerup: n[3] ||= (...e) => j(g).onPointerUp && j(g).onPointerUp(...e),
1755
1873
  onPointercancel: n[4] ||= (...e) => j(g).onPointerCancel && j(g).onPointerCancel(...e),
1756
1874
  onWheel: n[5] ||= (...e) => j(g).onWheel && j(g).onWheel(...e)
1757
- }, [j(g).items.value.length > 0 ? (S(), s("div", Xt, [
1875
+ }, [j(g).activeItem.value ? (S(), s("div", en, [
1758
1876
  (S(!0), s(t, null, E(j(g).renderedItems.value, ({ item: r, index: i }) => (S(), s("article", {
1759
1877
  key: j(w).getItemKey(r),
1760
1878
  "data-testid": "vibe-slide",
@@ -1765,10 +1883,13 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1765
1883
  "aria-hidden": i === j(g).resolvedActiveIndex.value ? "false" : "true",
1766
1884
  class: _(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === j(g).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
1767
1885
  style: y(j(g).getSlideStyle(i))
1768
- }, [c("div", { class: _(["absolute inset-0 opacity-85", j(Gt)(r.type)]) }, null, 2), j(g).isVisual(r) ? (S(), s("div", {
1886
+ }, [c("div", {
1887
+ class: _(["absolute inset-0 opacity-85", j(Kt)(r.type)]),
1888
+ style: y(i === j(g).resolvedActiveIndex.value && r.type === "image" ? j(P) : void 0)
1889
+ }, null, 6), j(g).isVisual(r) ? (S(), s("div", {
1769
1890
  key: 0,
1770
- class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? I.value : ""])
1771
- }, [j(w).isAssetLoading(i, r) ? (S(), s("div", Qt, [c("span", $t, [u(j(re), {
1891
+ class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? V.value : ""])
1892
+ }, [j(w).isAssetLoading(i, r) ? (S(), s("div", nn, [c("span", rn, [u(j(ie), {
1772
1893
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
1773
1894
  "aria-hidden": "true"
1774
1895
  })])])) : o("", !0), j(w).isAssetErrored(i, r) ? (S(), s("div", {
@@ -1776,33 +1897,35 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1776
1897
  "data-testid": "vibe-asset-error",
1777
1898
  "data-kind": j(w).getAssetErrorKind(r),
1778
1899
  class: "grid h-full w-full place-items-center"
1779
- }, [c("div", tn, [
1780
- u(j(oe), {
1900
+ }, [c("div", on, [
1901
+ u(j(se), {
1781
1902
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
1782
1903
  "aria-hidden": "true"
1783
1904
  }),
1784
- c("p", nn, k(j(w).getAssetErrorLabel(r)), 1),
1905
+ c("p", sn, k(j(w).getAssetErrorLabel(r)), 1),
1785
1906
  j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
1786
1907
  key: 0,
1787
1908
  type: "button",
1788
1909
  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",
1789
1910
  onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
1790
- }, " Retry ", 8, rn)) : o("", !0)
1791
- ])], 8, en)) : r.type === "image" ? (S(), s("img", {
1911
+ }, " Retry ", 8, cn)) : o("", !0)
1912
+ ])], 8, an)) : r.type === "image" ? (S(), s("img", {
1792
1913
  key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
1793
1914
  src: j(w).getFullscreenImageSource(i, r),
1794
1915
  alt: r.title ?? "",
1916
+ crossorigin: "anonymous",
1795
1917
  draggable: "false",
1796
1918
  class: _(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isImageReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
1797
1919
  ref_for: !0,
1798
- ref: (e) => j(g).registerImageElement(j(w).getItemKey(r), e),
1799
- onLoad: (e) => j(g).onImageLoad(j(w).getItemKey(r), r.url),
1920
+ ref: (e) => me(j(w).getItemKey(r), e),
1921
+ onLoad: (e) => pe(e, j(w).getItemKey(r), r.url),
1800
1922
  onError: (e) => j(g).onImageError(j(w).getItemKey(r), r.url)
1801
- }, null, 42, an)) : (S(), s("video", {
1923
+ }, null, 42, ln)) : (S(), s("video", {
1802
1924
  key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
1803
1925
  class: _(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isMediaReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
1804
1926
  playsinline: "",
1805
1927
  muted: "",
1928
+ loop: d.loopFullscreenVideo,
1806
1929
  src: j(w).getFullscreenMediaSource(i, r),
1807
1930
  preload: j(w).shouldPreloadSlideAsset(i) ? "metadata" : "none",
1808
1931
  ref_for: !0,
@@ -1821,10 +1944,10 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1821
1944
  onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1822
1945
  onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1823
1946
  onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
1824
- }, null, 42, on))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
1947
+ }, null, 42, un))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
1825
1948
  key: 1,
1826
- class: _(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === j(g).resolvedActiveIndex.value ? I.value : ""])
1827
- }, [c("div", sn, [
1949
+ class: _(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === j(g).resolvedActiveIndex.value ? V.value : ""])
1950
+ }, [c("div", dn, [
1828
1951
  c("button", {
1829
1952
  type: "button",
1830
1953
  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]",
@@ -1834,19 +1957,19 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1834
1957
  }, [
1835
1958
  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),
1836
1959
  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),
1837
- c("span", ln, [D(e.$slots, "item-icon", {
1960
+ c("span", pn, [D(e.$slots, "item-icon", {
1838
1961
  icon: j(ft)(r.type),
1839
1962
  item: r
1840
1963
  }, () => [(S(), a(O(j(ft)(r.type)), {
1841
1964
  class: "h-6 w-6 stroke-[1.9]",
1842
1965
  "aria-hidden": "true"
1843
1966
  }))])]),
1844
- c("span", un, [(S(), a(O(j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
1967
+ c("span", mn, [(S(), a(O(j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(oe) : j(ae)), {
1845
1968
  class: "h-4 w-4 stroke-2",
1846
1969
  "aria-hidden": "true"
1847
1970
  }))])
1848
- ], 8, cn),
1849
- j(w).isAssetLoading(i, r) ? (S(), s("div", dn, [c("span", fn, [u(j(re), {
1971
+ ], 8, fn),
1972
+ j(w).isAssetLoading(i, r) ? (S(), s("div", hn, [c("span", gn, [u(j(ie), {
1850
1973
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
1851
1974
  "aria-hidden": "true"
1852
1975
  })])])) : o("", !0),
@@ -1855,18 +1978,18 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1855
1978
  "data-kind": j(w).getAssetErrorKind(r),
1856
1979
  class: "relative z-[1] grid justify-items-center gap-4"
1857
1980
  }, [
1858
- u(j(oe), {
1981
+ u(j(se), {
1859
1982
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
1860
1983
  "aria-hidden": "true"
1861
1984
  }),
1862
- c("p", mn, k(j(w).getAssetErrorLabel(r)), 1),
1985
+ c("p", vn, k(j(w).getAssetErrorLabel(r)), 1),
1863
1986
  j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
1864
1987
  key: 0,
1865
1988
  type: "button",
1866
1989
  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",
1867
1990
  onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
1868
- }, " Retry ", 8, hn)) : o("", !0)
1869
- ], 8, pn)], 64)) : o("", !0)
1991
+ }, " Retry ", 8, yn)) : o("", !0)
1992
+ ], 8, _n)], 64)) : o("", !0)
1870
1993
  ]), (S(), s("audio", {
1871
1994
  key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
1872
1995
  src: j(w).getFullscreenMediaSource(i, r),
@@ -1887,36 +2010,38 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1887
2010
  onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1888
2011
  onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1889
2012
  onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
1890
- }, null, 40, gn))], 2)) : (S(), s("div", _n, [c("div", vn, [D(e.$slots, "item-icon", {
2013
+ }, null, 40, bn))], 2)) : (S(), s("div", xn, [c("div", Sn, [D(e.$slots, "item-icon", {
1891
2014
  icon: j(ft)(r.type),
1892
2015
  item: r
1893
2016
  }, () => [(S(), a(O(j(ft)(r.type)), {
1894
2017
  class: "h-6 w-6 stroke-[1.9]",
1895
2018
  "aria-hidden": "true"
1896
- }))])])]))], 14, Zt))), 128)),
1897
- R.value && p["fullscreen-overlay"] ? (S(), s("div", yn, [c("div", bn, [D(e.$slots, "fullscreen-overlay", v(f(R.value)))])])) : o("", !0),
2019
+ }))])])]))], 14, tn))), 128)),
2020
+ U.value && p["fullscreen-overlay"] ? (S(), s("div", Cn, [c("div", wn, [D(e.$slots, "fullscreen-overlay", v(f(U.value)))])])) : o("", !0),
1898
2021
  j(g).activeItem.value ? (S(), a(lt, {
1899
2022
  key: 1,
1900
2023
  "current-index": j(g).resolvedActiveIndex.value,
2024
+ loading: d.loading,
1901
2025
  "pagination-detail": j(g).paginationDetail.value,
1902
2026
  "show-back-to-list": d.showBackToList,
1903
2027
  "show-end-badge": d.showEndBadge && j(g).isAtEnd.value && !j(g).hasNextPage.value && !j(g).loading.value,
1904
2028
  title: j(g).activeItem.value.title ?? null,
1905
2029
  total: j(g).items.value.length,
1906
2030
  onBackToList: n[0] ||= (e) => m("back-to-list")
1907
- }, l({ _: 2 }, [ee.value && R.value ? {
2031
+ }, l({ _: 2 }, [te.value && U.value ? {
1908
2032
  name: "actions",
1909
- fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(R.value)))]),
2033
+ fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(U.value)))]),
1910
2034
  key: "0"
1911
2035
  } : void 0]), 1032, [
1912
2036
  "current-index",
2037
+ "loading",
1913
2038
  "pagination-detail",
1914
2039
  "show-back-to-list",
1915
2040
  "show-end-badge",
1916
2041
  "title",
1917
2042
  "total"
1918
2043
  ])) : o("", !0),
1919
- F.value ? (S(), a(Qe, {
2044
+ B.value ? (S(), a(Qe, {
1920
2045
  key: 2,
1921
2046
  "current-time": j(g).activeMediaState.value.currentTime,
1922
2047
  "current-time-label": j(g).formatPlaybackTime(j(g).activeMediaState.value.currentTime),
@@ -1932,33 +2057,36 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1932
2057
  "progress",
1933
2058
  "onSeekInput"
1934
2059
  ])) : o("", !0),
1935
- H.value ? (S(), s("div", {
2060
+ K.value ? (S(), s("div", {
1936
2061
  key: 3,
1937
- class: _(["absolute left-1/2 z-[4] -translate-x-1/2", P.value])
1938
- }, [J.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, H.value))) : (S(), s("div", {
2062
+ class: _(["absolute left-1/2 z-[4] -translate-x-1/2", R.value])
2063
+ }, [ce.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, K.value))) : (S(), s("div", {
1939
2064
  key: 1,
1940
2065
  "data-testid": "vibe-fullscreen-status-badge",
1941
- class: _(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", H.value.kind === "end" ? "border-amber-300/35 text-amber-200" : H.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
1942
- }, k(H.value.message), 3))], 2)) : o("", !0)
1943
- ])) : j(ne) && j(Y) ? (S(), a(Jt, {
1944
- key: 1,
1945
- message: j(Y).message,
1946
- mode: j(Y).mode,
1947
- surface: j(Y).surface
2066
+ class: _(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", K.value.kind === "end" ? "border-amber-300/35 text-amber-200" : K.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2067
+ }, k(K.value.message), 3))], 2)) : o("", !0)
2068
+ ])) : H.value ? (S(), s("div", Tn, [c("div", En, [c("span", Dn, [u(j(ie), {
2069
+ class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2070
+ "aria-hidden": "true"
2071
+ })]), c("p", On, k(ee.value), 1)])])) : j(de) && j(X) ? (S(), a(Qt, {
2072
+ key: 2,
2073
+ message: j(X).message,
2074
+ mode: j(X).mode,
2075
+ surface: j(X).surface
1948
2076
  }, {
1949
- default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(Y)))) : o("", !0)]),
2077
+ default: L(() => [j(ue) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(X)))) : o("", !0)]),
1950
2078
  _: 3
1951
2079
  }, 8, [
1952
2080
  "message",
1953
2081
  "mode",
1954
2082
  "surface"
1955
- ])) : o("", !0), j(X) && j(Y) ? (S(), a(Jt, {
1956
- key: 2,
1957
- message: j(Y).message,
1958
- mode: j(Y).mode,
1959
- surface: j(Y).surface
2083
+ ])) : o("", !0), j(le) && j(X) ? (S(), a(Qt, {
2084
+ key: 3,
2085
+ message: j(X).message,
2086
+ mode: j(X).mode,
2087
+ surface: j(X).surface
1960
2088
  }, {
1961
- default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(Y)))) : o("", !0)]),
2089
+ default: L(() => [j(ue) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(X)))) : o("", !0)]),
1962
2090
  _: 3
1963
2091
  }, 8, [
1964
2092
  "message",
@@ -1972,7 +2100,7 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1972
2100
  "leave-from-class": "translate-x-0 opacity-100",
1973
2101
  "leave-to-class": "translate-x-full opacity-0"
1974
2102
  }, {
1975
- default: L(() => [K.value && R.value ? (S(), s("aside", xn, [c("div", Sn, [D(e.$slots, "fullscreen-aside", v(f(R.value)))])])) : o("", !0)]),
2103
+ default: L(() => [ne.value && U.value ? (S(), s("aside", kn, [c("div", An, [D(e.$slots, "fullscreen-aside", v(f(U.value)))])])) : o("", !0)]),
1976
2104
  _: 3
1977
2105
  })], 4),
1978
2106
  u(r, {
@@ -1983,29 +2111,29 @@ var Kt = ["data-surface"], qt = ["data-surface"], Jt = /* @__PURE__ */ d({
1983
2111
  "leave-from-class": "translate-x-0 opacity-100",
1984
2112
  "leave-to-class": "translate-x-full opacity-0"
1985
2113
  }, {
1986
- default: L(() => [q.value && R.value ? (S(), s("aside", Cn, [c("div", wn, [D(e.$slots, "fullscreen-aside", v(f(R.value)))])])) : o("", !0)]),
2114
+ default: L(() => [re.value && U.value ? (S(), s("aside", jn, [c("div", Mn, [D(e.$slots, "fullscreen-aside", v(f(U.value)))])])) : o("", !0)]),
1987
2115
  _: 3
1988
2116
  })
1989
2117
  ]));
1990
2118
  }
1991
- }), Dn = 1, On = .5;
1992
- function kn(e) {
2119
+ }), Fn = 1, In = .5;
2120
+ function Ln(e) {
1993
2121
  if (e.type !== "image" && e.type !== "video") return {
1994
- width: Dn,
1995
- height: Dn,
2122
+ width: Fn,
2123
+ height: Fn,
1996
2124
  source: "fallback"
1997
2125
  };
1998
2126
  let t = e.preview?.width, n = e.preview?.height;
1999
- if (In(t) && In(n)) {
2000
- let r = Ln(e, t, n);
2127
+ if (Wn(t) && Wn(n)) {
2128
+ let r = Gn(e, t, n);
2001
2129
  return {
2002
2130
  width: r.width,
2003
2131
  height: r.height,
2004
2132
  source: "preview"
2005
2133
  };
2006
2134
  }
2007
- if (In(e.width) && In(e.height)) {
2008
- let t = Ln(e, e.width, e.height);
2135
+ if (Wn(e.width) && Wn(e.height)) {
2136
+ let t = Gn(e, e.width, e.height);
2009
2137
  return {
2010
2138
  width: t.width,
2011
2139
  height: t.height,
@@ -2013,31 +2141,31 @@ function kn(e) {
2013
2141
  };
2014
2142
  }
2015
2143
  return {
2016
- width: Dn,
2017
- height: Dn,
2144
+ width: Fn,
2145
+ height: Fn,
2018
2146
  source: "fallback"
2019
2147
  };
2020
2148
  }
2021
- function An(e, t) {
2149
+ function Rn(e, t) {
2022
2150
  return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
2023
2151
  }
2024
- function jn(e, t, n, r = 0) {
2152
+ function zn(e, t, n, r = 0) {
2025
2153
  if (!e || e <= 0 || !t || t <= 0) return n;
2026
2154
  let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
2027
2155
  return !a || a <= 0 ? n : a / t;
2028
2156
  }
2029
- function Mn(e, t) {
2030
- let n = kn(e);
2157
+ function Bn(e, t) {
2158
+ let n = Ln(e);
2031
2159
  return n.height / n.width * t;
2032
2160
  }
2033
- function Nn(e, t) {
2161
+ function Vn(e, t) {
2034
2162
  let n = Array.from({ length: t.columnCount }, () => 0), r = Array(e.length), i = Array(e.length), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = 0;
2035
2163
  for (let c = 0; c < e.length; c += 1) {
2036
2164
  let l = e[c];
2037
2165
  o.set(Q(l), c);
2038
2166
  let u = 0;
2039
2167
  for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
2040
- let d = u * (t.columnWidth + t.gapX), f = n[u], p = Mn(l, t.columnWidth);
2168
+ let d = u * (t.columnWidth + t.gapX), f = n[u], p = Bn(l, t.columnWidth);
2041
2169
  r[c] = {
2042
2170
  x: d,
2043
2171
  y: f
@@ -2056,7 +2184,7 @@ function Nn(e, t) {
2056
2184
  indexById: o
2057
2185
  };
2058
2186
  }
2059
- function Pn(e) {
2187
+ function Hn(e) {
2060
2188
  if (e.itemCount <= 0) return [];
2061
2189
  if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
2062
2190
  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();
@@ -2066,7 +2194,7 @@ function Pn(e) {
2066
2194
  }
2067
2195
  return Array.from(a).sort((e, t) => e - t);
2068
2196
  }
2069
- function Fn(e, t, n) {
2197
+ function Un(e, t, n) {
2070
2198
  let r = /* @__PURE__ */ new Map();
2071
2199
  for (let i of e) {
2072
2200
  let e = t.get(Q(i));
@@ -2076,11 +2204,11 @@ function Fn(e, t, n) {
2076
2204
  }
2077
2205
  return r;
2078
2206
  }
2079
- function In(e) {
2207
+ function Wn(e) {
2080
2208
  return typeof e == "number" && Number.isFinite(e) && e > 0;
2081
2209
  }
2082
- function Ln(e, t, n) {
2083
- return e.type !== "image" || n / t >= On ? {
2210
+ function Gn(e, t, n) {
2211
+ return e.type !== "image" || n / t >= In ? {
2084
2212
  width: t,
2085
2213
  height: n
2086
2214
  } : {
@@ -2090,21 +2218,21 @@ function Ln(e, t, n) {
2090
2218
  }
2091
2219
  //#endregion
2092
2220
  //#region src/components/viewer-core/useMasonryMotion.ts
2093
- var Rn = 300, zn = 600, Bn = 40, Vn = 300, Hn = 400;
2094
- function Un(e, t) {
2221
+ var Kn = 300, qn = 600, Jn = 40, Yn = 300, Xn = 400;
2222
+ function Zn(e, t) {
2095
2223
  return t === "top" ? [...e].reverse() : e;
2096
2224
  }
2097
- function Wn(e) {
2098
- return e <= 0 ? zn : zn + Math.min((e - 1) * Bn, Hn);
2225
+ function Qn(e) {
2226
+ return e <= 0 ? qn : qn + Math.min((e - 1) * Jn, Xn);
2099
2227
  }
2100
- function Gn() {
2101
- return Vn;
2228
+ function $n() {
2229
+ return Yn;
2102
2230
  }
2103
- function Kn(e) {
2231
+ function er(e) {
2104
2232
  let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
2105
2233
  return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
2106
2234
  }
2107
- function qn(e) {
2235
+ function tr(e) {
2108
2236
  let t = T(/* @__PURE__ */ new Set()), n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), o = T(/* @__PURE__ */ new Map()), s = T(/* @__PURE__ */ new Set()), c = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Map()), u = T(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
2109
2237
  F(e.visibleIndices, (i) => {
2110
2238
  if (!i.length) return;
@@ -2114,20 +2242,20 @@ function qn(e) {
2114
2242
  !r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
2115
2243
  }
2116
2244
  if (!o.length) return;
2117
- let s = Un(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2118
- for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Bn, Hn));
2119
- r.value = c, Jn(() => {
2245
+ let s = Zn(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2246
+ for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Jn, Xn));
2247
+ r.value = c, nr(() => {
2120
2248
  let e = new Set(n.value);
2121
2249
  for (let t of o) e.add(t);
2122
2250
  n.value = e;
2123
- }), Yn(() => {
2251
+ }), rr(() => {
2124
2252
  let e = new Set(t.value);
2125
2253
  for (let t of o) e.delete(t);
2126
2254
  t.value = e, S(() => {
2127
2255
  let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
2128
2256
  for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
2129
2257
  n.value = e, r.value = t, a.value = i;
2130
- }, Wn(o.length));
2258
+ }, Qn(o.length));
2131
2259
  });
2132
2260
  }, { flush: "post" }), F(() => e.items.value.map((e) => Q(e)), (e) => {
2133
2261
  if (!e.length || !o.value.size) return;
@@ -2154,7 +2282,7 @@ function qn(e) {
2154
2282
  let e = Q(t.item);
2155
2283
  p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
2156
2284
  }
2157
- o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Jn(() => {
2285
+ o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, nr(() => {
2158
2286
  let e = new Set(s.value);
2159
2287
  for (let t of p) e.add(t);
2160
2288
  s.value = e;
@@ -2162,9 +2290,9 @@ function qn(e) {
2162
2290
  let e = new Map(o.value), t = new Set(s.value);
2163
2291
  for (let n of p) e.delete(n), t.delete(n);
2164
2292
  o.value = e, s.value = t;
2165
- }, Vn);
2293
+ }, Yn);
2166
2294
  }
2167
- function g(t, n, r = Rn) {
2295
+ function g(t, n, r = Kn) {
2168
2296
  if (!t.size) return;
2169
2297
  let i = /* @__PURE__ */ new Map(), a = [];
2170
2298
  for (let [r, o] of t.entries()) {
@@ -2183,8 +2311,8 @@ function qn(e) {
2183
2311
  c.value = i, u.value = /* @__PURE__ */ new Set();
2184
2312
  let o = new Map(l.value);
2185
2313
  for (let e of a) o.set(e, r);
2186
- l.value = o, Jn(() => {
2187
- u.value = new Set(a), Jn(() => {
2314
+ l.value = o, nr(() => {
2315
+ u.value = new Set(a), nr(() => {
2188
2316
  c.value = /* @__PURE__ */ new Map();
2189
2317
  });
2190
2318
  }), S(() => {
@@ -2195,8 +2323,8 @@ function qn(e) {
2195
2323
  }, r);
2196
2324
  }
2197
2325
  function _(e) {
2198
- if (n.value.has(e)) return `transform ${zn}ms ease-out`;
2199
- if (u.value.has(e)) return `transform ${l.value.get(e) ?? Rn}ms ease-out`;
2326
+ if (n.value.has(e)) return `transform ${qn}ms ease-out`;
2327
+ if (u.value.has(e)) return `transform ${l.value.get(e) ?? Kn}ms ease-out`;
2200
2328
  }
2201
2329
  function v(e) {
2202
2330
  if (!n.value.has(e)) return;
@@ -2213,7 +2341,7 @@ function qn(e) {
2213
2341
  } : {
2214
2342
  dx: 0,
2215
2343
  dy: 0
2216
- }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Kn({
2344
+ }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? er({
2217
2345
  columnWidth: e.columnWidth.value,
2218
2346
  direction: u,
2219
2347
  itemHeight: o,
@@ -2227,14 +2355,14 @@ function qn(e) {
2227
2355
  if (!r) return {
2228
2356
  opacity: "0",
2229
2357
  transform: "translate3d(0, 0, 0) scale(0.96)",
2230
- transition: `opacity ${Vn}ms ease-out, transform ${Vn}ms ease-out`
2358
+ transition: `opacity ${Yn}ms ease-out, transform ${Yn}ms ease-out`
2231
2359
  };
2232
2360
  let i = s.value.has(n);
2233
2361
  return {
2234
2362
  height: `${r.height}px`,
2235
2363
  opacity: i ? "0" : "1",
2236
2364
  transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
2237
- transition: `opacity ${Vn}ms ease-out, transform ${Vn}ms ease-out`,
2365
+ transition: `opacity ${Yn}ms ease-out, transform ${Yn}ms ease-out`,
2238
2366
  width: `${e.columnWidth.value}px`
2239
2367
  };
2240
2368
  }
@@ -2255,28 +2383,28 @@ function qn(e) {
2255
2383
  playFlipMoveAnimation: g
2256
2384
  };
2257
2385
  }
2258
- function Jn(e) {
2386
+ function nr(e) {
2259
2387
  if (typeof requestAnimationFrame == "function") {
2260
2388
  requestAnimationFrame(() => e());
2261
2389
  return;
2262
2390
  }
2263
2391
  setTimeout(e, 0);
2264
2392
  }
2265
- function Yn(e) {
2266
- Jn(() => Jn(e));
2393
+ function rr(e) {
2394
+ nr(() => nr(e));
2267
2395
  }
2268
2396
  //#endregion
2269
2397
  //#region src/components/viewer-core/masonryViewport.ts
2270
- function Xn(e, t) {
2398
+ function ir(e, t) {
2271
2399
  return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
2272
2400
  }
2273
- function Zn(e, t, n) {
2401
+ function ar(e, t, n) {
2274
2402
  return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
2275
2403
  }
2276
- function Qn(e, t, n, r) {
2404
+ function or(e, t, n, r) {
2277
2405
  return (e?.scrollHeight ?? r) - (t + n);
2278
2406
  }
2279
- function $n(e, t) {
2407
+ function sr(e, t) {
2280
2408
  return {
2281
2409
  height: `${e}px`,
2282
2410
  transform: `translate3d(0, ${t}px, 0)`
@@ -2284,8 +2412,8 @@ function $n(e, t) {
2284
2412
  }
2285
2413
  //#endregion
2286
2414
  //#region src/components/viewer-core/useEdgeBoundary.ts
2287
- var er = 250, tr = 1e3;
2288
- function nr(e) {
2415
+ var cr = 250, lr = 1e3;
2416
+ function ur(e) {
2289
2417
  let t = T(!1), n = T(!1), r = T(0), i = T(0), a = T(!1), o = T(!1), s = 0, c = null;
2290
2418
  b(() => {
2291
2419
  y();
@@ -2301,7 +2429,7 @@ function nr(e) {
2301
2429
  function u(t) {
2302
2430
  if (!x(t) || !e.isAtBoundary()) return;
2303
2431
  let n = Date.now();
2304
- n < s || (s = n + er, m());
2432
+ n < s || (s = n + cr, m());
2305
2433
  }
2306
2434
  function d() {
2307
2435
  if (!g()) return;
@@ -2335,7 +2463,7 @@ function nr(e) {
2335
2463
  return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2336
2464
  }
2337
2465
  function _() {
2338
- o.value = !1, v(tr);
2466
+ o.value = !1, v(lr);
2339
2467
  }
2340
2468
  function v(e) {
2341
2469
  y(), a.value = !0, c = setTimeout(() => {
@@ -2358,30 +2486,30 @@ function nr(e) {
2358
2486
  }
2359
2487
  //#endregion
2360
2488
  //#region src/components/viewer-core/useMasonryList.ts
2361
- var rr = 600, $ = 24, ir = 16, ar = 300, or = 200, sr = 200, cr = 200, lr = 300, ur = 24, dr = 48, fr = 500, pr = 1e3;
2362
- function mr(e) {
2363
- let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || ar), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = T(null), p = T(!1), m = i(() => Math.max(ar, a.value - $ * 2)), h = i(() => An(m.value, ar)), _ = i(() => jn(m.value, h.value, ar, ir)), v = i(() => hr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Pn({
2489
+ var dr = 600, $ = 24, fr = 16, pr = 300, mr = 200, hr = 200, gr = 200, _r = 300, vr = 24, yr = 48, br = 500, xr = 1e3;
2490
+ function Sr(e) {
2491
+ let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || pr), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = T(null), p = T(!1), m = i(() => Math.max(pr, a.value - $ * 2)), h = i(() => Rn(m.value, pr)), _ = i(() => zn(m.value, h.value, pr, fr)), v = i(() => Cr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Hn({
2364
2492
  itemCount: e.items.value.length,
2365
2493
  viewportHeight: r.value,
2366
2494
  scrollTop: n.value,
2367
- overscanPx: or,
2368
- bucketPx: rr,
2495
+ overscanPx: mr,
2496
+ bucketPx: dr,
2369
2497
  buckets: c.value
2370
2498
  })), S = i(() => y.value.map((t) => ({
2371
2499
  item: e.items.value[t],
2372
2500
  index: t
2373
2501
  }))), C = i(() => {
2374
2502
  let e = l.value + $ * 2, t = d.value ?? 0;
2375
- return Math.max(e, t, r.value) + cr;
2376
- }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), D = i(() => Math.max(0, r.value - ur * 2)), O = i(() => C.value > r.value + 1 && D.value > 0), k = i(() => {
2503
+ return Math.max(e, t, r.value) + gr;
2504
+ }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), D = i(() => Math.max(0, r.value - vr * 2)), O = i(() => C.value > r.value + 1 && D.value > 0), k = i(() => {
2377
2505
  if (!O.value) return 0;
2378
2506
  let e = r.value / C.value * D.value;
2379
- return Math.min(D.value, Math.max(dr, e));
2507
+ return Math.min(D.value, Math.max(yr, e));
2380
2508
  }), A = i(() => {
2381
- if (!O.value) return ur;
2509
+ if (!O.value) return vr;
2382
2510
  let e = Math.max(0, C.value - r.value);
2383
- return ur + Math.max(0, D.value - k.value) * (e > 0 ? hr(n.value / e, 0, 1) : 0);
2384
- }), j = qn({
2511
+ return vr + Math.max(0, D.value - k.value) * (e > 0 ? Cr(n.value / e, 0, 1) : 0);
2512
+ }), j = tr({
2385
2513
  items: e.items,
2386
2514
  visibleIndices: y,
2387
2515
  positions: o,
@@ -2390,27 +2518,27 @@ function mr(e) {
2390
2518
  columnWidth: _,
2391
2519
  scrollTop: n,
2392
2520
  viewportHeight: r
2393
- }), M = nr({
2521
+ }), M = ur({
2394
2522
  direction: "top",
2395
2523
  getAnimationLockMs(e) {
2396
- return Math.max(fr, Wn(e)) + pr;
2524
+ return Math.max(br, Qn(e)) + xr;
2397
2525
  },
2398
2526
  hasPage: e.hasPreviousPage,
2399
2527
  interactionLocked: p,
2400
2528
  isAtBoundary() {
2401
- return n.value <= $ + ir;
2529
+ return n.value <= $ + fr;
2402
2530
  },
2403
2531
  loading: e.loading,
2404
2532
  requestPage: e.requestPreviousPage
2405
- }), N = nr({
2533
+ }), N = ur({
2406
2534
  direction: "bottom",
2407
2535
  getAnimationLockMs(e) {
2408
- return Wn(e) + pr;
2536
+ return Qn(e) + xr;
2409
2537
  },
2410
2538
  hasPage: w,
2411
2539
  interactionLocked: p,
2412
2540
  isAtBoundary() {
2413
- return re() <= sr;
2541
+ return ie() <= hr;
2414
2542
  },
2415
2543
  loading: e.loading,
2416
2544
  requestPage: e.requestNextPage
@@ -2420,7 +2548,7 @@ function mr(e) {
2420
2548
  h,
2421
2549
  _
2422
2550
  ], async ([t], [r = []]) => {
2423
- let i = t.map((e) => Q(e)), a = r ?? [], s = a.map((e) => Q(e)), c = Fn(a, u.value, o.value), l = oe(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has(Q(e))), m = a.flatMap((e) => {
2551
+ let i = t.map((e) => Q(e)), a = r ?? [], s = a.map((e) => Q(e)), c = Un(a, u.value, o.value), l = se(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has(Q(e))), m = a.flatMap((e) => {
2424
2552
  let t = Q(e);
2425
2553
  if (f.has(t)) return [];
2426
2554
  let n = c.get(t), r = l.get(t);
@@ -2429,15 +2557,15 @@ function mr(e) {
2429
2557
  item: e,
2430
2558
  position: n
2431
2559
  }];
2432
- }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > $ + ir, b = h && n.value > $ + ir ? t[v.value] : null, x = b ? Q(b) : null;
2433
- y && K(Gn() + pr), _ && G(), B(), m.length > 0 && j.markLeave(m), p.length > 0 && (j.markEnter(p, h ? "top" : "bottom"), h ? M.onItemsMutated(p.length) : N.onItemsMutated(p.length)), j.playFlipMoveAnimation(c, new Set(p.map((e) => Q(e))), h ? fr : void 0), x ? (await g(), ee(x, c)) : e.active.value && s.length > 0 && J();
2560
+ }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > $ + fr, b = h && n.value > $ + fr ? t[v.value] : null, x = b ? Q(b) : null;
2561
+ y && K($n() + xr), _ && G(), B(), m.length > 0 && j.markLeave(m), p.length > 0 && (j.markEnter(p, h ? "top" : "bottom"), h ? M.onItemsMutated(p.length) : N.onItemsMutated(p.length)), j.playFlipMoveAnimation(c, new Set(p.map((e) => Q(e))), h ? br : void 0), x ? (await g(), W(x, c)) : e.active.value && s.length > 0 && J();
2434
2562
  }, { immediate: !0 }), F([
2435
2563
  () => e.pendingAppendItems.value.map((e) => Q(e)),
2436
2564
  h,
2437
2565
  _,
2438
2566
  r
2439
2567
  ], ([t]) => {
2440
- ce(), t.length && (d.value = ae([...e.items.value, ...e.pendingAppendItems.value]), se());
2568
+ X(), t.length && (d.value = oe([...e.items.value, ...e.pendingAppendItems.value]), ce());
2441
2569
  }, { immediate: !0 }), F(() => e.active.value, async (e, i) => {
2442
2570
  let a = t.value;
2443
2571
  if (!a) return;
@@ -2447,24 +2575,24 @@ function mr(e) {
2447
2575
  }
2448
2576
  if (i !== !1 || f.value == null) return;
2449
2577
  await g();
2450
- let o = Math.max(0, C.value - r.value), s = hr(f.value, 0, o);
2578
+ let o = Math.max(0, C.value - r.value), s = Cr(f.value, 0, o);
2451
2579
  a.scrollTop = s, n.value = s, M.syncBoundary(), N.syncBoundary();
2452
2580
  }), F(() => e.loading.value, async (t) => {
2453
2581
  !t && !e.pendingAppendItems.value.length && !L && !z && (d.value = null), M.onLoadingChange(t), N.onLoadingChange(t), await g();
2454
2582
  }), x(async () => {
2455
- X(), await g(), v.value > 0 ? W(v.value, "center") : q(), M.syncBoundary(), N.syncBoundary(), typeof ResizeObserver < "u" ? (P = new ResizeObserver(() => {
2456
- X();
2457
- }), t.value && P.observe(t.value)) : window.addEventListener("resize", X);
2583
+ Y(), await g(), v.value > 0 ? U(v.value, "center") : q(), M.syncBoundary(), N.syncBoundary(), typeof ResizeObserver < "u" ? (P = new ResizeObserver(() => {
2584
+ Y();
2585
+ }), t.value && P.observe(t.value)) : window.addEventListener("resize", Y);
2458
2586
  }), b(() => {
2459
- P?.disconnect(), P = null, window.removeEventListener("resize", X), ce(), le(), I &&= (cancelAnimationFrame(I), 0);
2587
+ P?.disconnect(), P = null, window.removeEventListener("resize", Y), X(), le(), I &&= (cancelAnimationFrame(I), 0);
2460
2588
  });
2461
2589
  function B() {
2462
- let t = Nn(e.items.value, {
2590
+ let t = Vn(e.items.value, {
2463
2591
  columnCount: h.value,
2464
2592
  columnWidth: _.value,
2465
- gapX: ir,
2466
- gapY: ir,
2467
- bucketPx: rr
2593
+ gapX: fr,
2594
+ gapY: fr,
2595
+ bucketPx: dr
2468
2596
  });
2469
2597
  o.value = t.positions.map((e) => ({
2470
2598
  x: e.x + $,
@@ -2472,14 +2600,14 @@ function mr(e) {
2472
2600
  })), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
2473
2601
  }
2474
2602
  function V() {
2475
- e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = te(), M.syncBoundary(), N.syncBoundary(), Y(), !J() && (I ||= requestAnimationFrame(() => {
2603
+ e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = ne(), M.syncBoundary(), N.syncBoundary(), te(), !J() && (I ||= requestAnimationFrame(() => {
2476
2604
  I = 0, q();
2477
2605
  })));
2478
2606
  }
2479
2607
  function H(t) {
2480
- e.active.value && (M.onWheel(t), N.onWheel(t), Y());
2608
+ e.active.value && (M.onWheel(t), N.onWheel(t), te());
2481
2609
  }
2482
- function U(t) {
2610
+ function ee(t) {
2483
2611
  let n = e.items.value[t], r = n ? Q(n) : "";
2484
2612
  return {
2485
2613
  height: `${s.value[t] ?? _.value}px`,
@@ -2489,13 +2617,13 @@ function mr(e) {
2489
2617
  transform: j.getCardTransform(t)
2490
2618
  };
2491
2619
  }
2492
- function W(e, i) {
2620
+ function U(e, i) {
2493
2621
  let a = t.value, c = o.value[e], l = s.value[e];
2494
2622
  if (!a || !c || !l) return;
2495
2623
  let u = a.scrollTop, d = Math.max(0, C.value - r.value);
2496
- i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - $ : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + $), a.scrollTop = hr(u, 0, d), n.value = a.scrollTop, q();
2624
+ i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - $ : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + $), a.scrollTop = Cr(u, 0, d), n.value = a.scrollTop, q();
2497
2625
  }
2498
- function ee(e, r) {
2626
+ function W(e, r) {
2499
2627
  let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
2500
2628
  if (!i || !a || !c) return;
2501
2629
  let l = c.y - a.y;
@@ -2526,37 +2654,37 @@ function mr(e) {
2526
2654
  e.setActiveIndex(i);
2527
2655
  }
2528
2656
  function J() {
2529
- let t = n.value <= $ + ir, r = re() <= sr;
2657
+ let t = n.value <= $ + fr, r = ie() <= hr;
2530
2658
  return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
2531
2659
  }
2532
- function Y() {
2660
+ function te() {
2533
2661
  M.maybeRequestPage(), N.maybeRequestPage();
2534
2662
  }
2535
- function X() {
2536
- r.value = te(), a.value = ne();
2537
- }
2538
- function te() {
2539
- return Xn(t.value, r.value);
2663
+ function Y() {
2664
+ r.value = ne(), a.value = re();
2540
2665
  }
2541
2666
  function ne() {
2542
- return Zn(t.value, a.value, ar);
2667
+ return ir(t.value, r.value);
2543
2668
  }
2544
2669
  function re() {
2545
- return Qn(t.value, n.value, r.value, C.value);
2670
+ return ar(t.value, a.value, pr);
2546
2671
  }
2547
2672
  function ie() {
2548
- return $n(k.value, A.value);
2673
+ return or(t.value, n.value, r.value, C.value);
2674
+ }
2675
+ function ae() {
2676
+ return sr(k.value, A.value);
2549
2677
  }
2550
- function ae(e) {
2551
- return e.length ? Nn(e, {
2678
+ function oe(e) {
2679
+ return e.length ? Vn(e, {
2552
2680
  columnCount: h.value,
2553
2681
  columnWidth: _.value,
2554
- gapX: ir,
2555
- gapY: ir,
2556
- bucketPx: rr
2682
+ gapX: fr,
2683
+ gapY: fr,
2684
+ bucketPx: dr
2557
2685
  }).contentHeight + $ * 2 : 0;
2558
2686
  }
2559
- function oe(e) {
2687
+ function se(e) {
2560
2688
  let t = /* @__PURE__ */ new Map();
2561
2689
  for (let n of e) {
2562
2690
  let e = Q(n), r = u.value.get(e);
@@ -2566,7 +2694,7 @@ function mr(e) {
2566
2694
  }
2567
2695
  return t;
2568
2696
  }
2569
- function se() {
2697
+ function ce() {
2570
2698
  let t = e.commitPendingAppend.value;
2571
2699
  typeof t == "function" && (L = setTimeout(async () => {
2572
2700
  L = null, z = !0;
@@ -2576,9 +2704,9 @@ function mr(e) {
2576
2704
  } finally {
2577
2705
  d.value = null, z = !1;
2578
2706
  }
2579
- }, lr));
2707
+ }, _r));
2580
2708
  }
2581
- function ce() {
2709
+ function X() {
2582
2710
  L &&= (clearTimeout(L), null);
2583
2711
  }
2584
2712
  function le() {
@@ -2587,31 +2715,31 @@ function mr(e) {
2587
2715
  return {
2588
2716
  columnWidth: _,
2589
2717
  containerHeight: C,
2590
- getCardStyle: U,
2718
+ getCardStyle: ee,
2591
2719
  getLeavingCardStyle: j.getLeavingCardStyle,
2592
- getScrollbarThumbStyle: ie,
2720
+ getScrollbarThumbStyle: ae,
2593
2721
  leavingItems: j.leavingItems,
2594
2722
  onScroll: V,
2595
2723
  onWheel: H,
2596
2724
  paginationLabel: E,
2597
2725
  renderedItems: S,
2598
2726
  resolvedActiveIndex: v,
2599
- scrollToIndex: W,
2727
+ scrollToIndex: U,
2600
2728
  showScrollbar: O,
2601
2729
  scrollViewportRef: t
2602
2730
  };
2603
2731
  }
2604
- function hr(e, t, n) {
2732
+ function Cr(e, t, n) {
2605
2733
  return Math.min(Math.max(e, t), n);
2606
2734
  }
2607
2735
  //#endregion
2608
2736
  //#region src/components/viewer-core/listCardAsset.ts
2609
- function gr(e) {
2737
+ function wr(e) {
2610
2738
  if (e) try {
2611
2739
  e.removeAttribute("src"), e.src = "";
2612
2740
  } catch {}
2613
2741
  }
2614
- function _r(e) {
2742
+ function Tr(e) {
2615
2743
  if (e) {
2616
2744
  try {
2617
2745
  e.currentTime = 0;
@@ -2622,12 +2750,12 @@ function _r(e) {
2622
2750
  } catch {}
2623
2751
  }
2624
2752
  }
2625
- function vr(e, t) {
2753
+ function Er(e, t) {
2626
2754
  if (t) return e.bottom > t.top && e.top < t.bottom;
2627
2755
  let n = window.innerHeight || document.documentElement.clientHeight || 0;
2628
2756
  return e.bottom > 0 && e.top < n;
2629
2757
  }
2630
- function yr(e) {
2758
+ function Dr(e) {
2631
2759
  if (!e) return null;
2632
2760
  try {
2633
2761
  return new URL(e, window.location.href).href;
@@ -2637,22 +2765,22 @@ function yr(e) {
2637
2765
  }
2638
2766
  //#endregion
2639
2767
  //#region src/components/viewer-core/listPreview.ts
2640
- var br = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, xr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
2641
- function Sr(e) {
2642
- let t = e.preview?.url ?? e.url, n = kn(e), r = e.title?.trim() || pt(e.type);
2768
+ var Or = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, kr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
2769
+ function Ar(e) {
2770
+ let t = e.preview?.url ?? e.url, n = Ln(e), r = e.title?.trim() || pt(e.type);
2643
2771
  return e.type !== "image" && e.type !== "video" ? {
2644
2772
  kind: "fallback",
2645
2773
  url: null,
2646
2774
  width: n.width,
2647
2775
  height: n.height,
2648
2776
  label: r
2649
- } : wr(e, t) ? {
2777
+ } : Mr(e, t) ? {
2650
2778
  kind: "video",
2651
2779
  url: t,
2652
2780
  width: n.width,
2653
2781
  height: n.height,
2654
2782
  label: r
2655
- } : Cr(e, t) ? {
2783
+ } : jr(e, t) ? {
2656
2784
  kind: "image",
2657
2785
  url: t,
2658
2786
  width: n.width,
@@ -2666,28 +2794,28 @@ function Sr(e) {
2666
2794
  label: r
2667
2795
  };
2668
2796
  }
2669
- function Cr(e, t) {
2670
- return e.type !== "image" || typeof t != "string" ? !1 : br.test(t) || Tr(t);
2797
+ function jr(e, t) {
2798
+ return e.type !== "image" || typeof t != "string" ? !1 : Or.test(t) || Nr(t);
2671
2799
  }
2672
- function wr(e, t) {
2673
- return e.type === "video" && typeof t == "string" && xr.test(t);
2800
+ function Mr(e, t) {
2801
+ return e.type === "video" && typeof t == "string" && kr.test(t);
2674
2802
  }
2675
- function Tr(e) {
2803
+ function Nr(e) {
2676
2804
  return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
2677
2805
  }
2678
2806
  //#endregion
2679
2807
  //#region src/components/viewer-core/useAssetLoadQueue.ts
2680
- var Er = {
2808
+ var Pr = {
2681
2809
  maxGlobal: 10,
2682
2810
  maxPerDomain: 4,
2683
2811
  maxVideoPerDomain: 2
2684
2812
  };
2685
- function Dr(e = Er) {
2813
+ function Fr(e = Pr) {
2686
2814
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
2687
2815
  function i(e) {
2688
2816
  let i = {
2689
2817
  ...e,
2690
- domain: Ar(e.url),
2818
+ domain: Rr(e.url),
2691
2819
  enqueuedAt: r,
2692
2820
  id: `vibe-asset-load-${r += 1}`
2693
2821
  };
@@ -2706,7 +2834,7 @@ function Dr(e = Er) {
2706
2834
  function a() {
2707
2835
  if (n.size === 0) return;
2708
2836
  let r = [...n.values()].sort((e, t) => {
2709
- let n = kr(e) - kr(t);
2837
+ let n = Lr(e) - Lr(t);
2710
2838
  return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
2711
2839
  });
2712
2840
  for (let i of r) {
@@ -2727,8 +2855,8 @@ function Dr(e = Er) {
2727
2855
  }
2728
2856
  return { request: i };
2729
2857
  }
2730
- var Or = Dr();
2731
- function kr(e) {
2858
+ var Ir = Fr();
2859
+ function Lr(e) {
2732
2860
  try {
2733
2861
  let t = e.getPriority();
2734
2862
  return Number.isFinite(t) ? t : Infinity;
@@ -2736,7 +2864,7 @@ function kr(e) {
2736
2864
  return Infinity;
2737
2865
  }
2738
2866
  }
2739
- function Ar(e) {
2867
+ function Rr(e) {
2740
2868
  try {
2741
2869
  return new URL(e).hostname || "local";
2742
2870
  } catch {
@@ -2745,14 +2873,14 @@ function Ar(e) {
2745
2873
  }
2746
2874
  //#endregion
2747
2875
  //#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
2748
- var jr = ["aria-label"], Mr = {
2876
+ var zr = ["aria-label"], Br = {
2749
2877
  key: 0,
2750
2878
  "data-testid": "vibe-list-card-spinner",
2751
2879
  class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
2752
- }, Nr = { 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]" }, Pr = ["src", "alt"], Fr = ["src"], Ir = ["data-kind"], Lr = { class: "grid justify-items-center gap-3 px-4 text-center" }, Rr = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, zr = {
2880
+ }, Vr = { 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]" }, Hr = ["src", "alt"], Ur = ["src"], Wr = ["data-kind"], Gr = { class: "grid justify-items-center gap-3 px-4 text-center" }, Kr = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, qr = {
2753
2881
  key: 4,
2754
2882
  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))]"
2755
- }, Br = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Vr = { class: "pointer-events-none absolute inset-0 z-[3]" }, Hr = /* @__PURE__ */ d({
2883
+ }, Jr = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Yr = { class: "pointer-events-none absolute inset-0 z-[3]" }, Xr = /* @__PURE__ */ d({
2756
2884
  __name: "ListCard",
2757
2885
  props: {
2758
2886
  active: {
@@ -2776,7 +2904,7 @@ var jr = ["aria-label"], Mr = {
2776
2904
  },
2777
2905
  emits: ["open"],
2778
2906
  setup(e, { emit: t }) {
2779
- let n = e, r = t, l = i(() => Sr(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(null), g = T(null), v = T(null), y = T(null), C = T(null), w = T(l.value.kind === "fallback"), E = i(() => w.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), A = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), P = i(() => !!h.value), I = i(() => jt(h.value)), L = i(() => A.value && !h.value && (!w.value || !m.value)), R = null, B = null, V = /* @__PURE__ */ new Set();
2907
+ let n = e, r = t, l = i(() => Ar(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(null), g = T(null), v = T(null), y = T(null), C = T(null), w = T(l.value.kind === "fallback"), E = i(() => w.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), A = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), P = i(() => !!h.value), I = i(() => jt(h.value)), L = i(() => A.value && !h.value && (!w.value || !m.value)), R = null, B = null, V = /* @__PURE__ */ new Set();
2780
2908
  F([E, () => l.value.kind], () => {
2781
2909
  let e = l.value.kind === "fallback";
2782
2910
  m.value = e, h.value = null, e && (w.value = !0);
@@ -2794,7 +2922,7 @@ var jr = ["aria-label"], Mr = {
2794
2922
  return;
2795
2923
  }
2796
2924
  requestAnimationFrame(() => {
2797
- Y(), G(), K();
2925
+ te(), G(), K();
2798
2926
  });
2799
2927
  }), x(() => {
2800
2928
  if (!v.value || typeof IntersectionObserver > "u") {
@@ -2802,7 +2930,7 @@ var jr = ["aria-label"], Mr = {
2802
2930
  return;
2803
2931
  }
2804
2932
  y.value = v.value.closest("[data-testid=\"vibe-list-scroll\"]"), R = new IntersectionObserver((e) => {
2805
- for (let t of e) t.target === v.value && (n.surfaceActive && Y(t), G(), K());
2933
+ for (let t of e) t.target === v.value && (n.surfaceActive && te(t), G(), K());
2806
2934
  }, {
2807
2935
  root: y.value,
2808
2936
  threshold: [0, 1]
@@ -2811,10 +2939,10 @@ var jr = ["aria-label"], Mr = {
2811
2939
  q(), R?.disconnect(), R = null;
2812
2940
  });
2813
2941
  function H() {
2814
- se(g.value) && (m.value = !0, h.value = null, X(E.value ?? n.item.url), J());
2942
+ ce(g.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), J());
2815
2943
  }
2816
- async function U() {
2817
- if (!se(g.value)) return;
2944
+ async function ee() {
2945
+ if (!ce(g.value)) return;
2818
2946
  let e = E.value ?? n.item.url;
2819
2947
  m.value = !1, h.value = "generic";
2820
2948
  let t = await Mt(e);
@@ -2826,11 +2954,11 @@ var jr = ["aria-label"], Mr = {
2826
2954
  surface: "grid"
2827
2955
  }), J();
2828
2956
  }
2829
- function W() {
2830
- se(C.value) && (m.value = !0, h.value = null, X(E.value ?? n.item.url), J(), K());
2957
+ function U() {
2958
+ ce(C.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), J(), K());
2831
2959
  }
2832
- function ee() {
2833
- se(C.value) && (m.value = !1);
2960
+ function W() {
2961
+ ce(C.value) && (m.value = !1);
2834
2962
  }
2835
2963
  function G() {
2836
2964
  if (l.value.kind === "fallback") {
@@ -2849,9 +2977,9 @@ var jr = ["aria-label"], Mr = {
2849
2977
  B?.refresh();
2850
2978
  return;
2851
2979
  }
2852
- B = Or.request({
2980
+ B = Ir.request({
2853
2981
  assetType: l.value.kind,
2854
- getPriority: ae,
2982
+ getPriority: oe,
2855
2983
  onGrant() {
2856
2984
  w.value = !0, m.value = !1, h.value = null;
2857
2985
  },
@@ -2876,20 +3004,20 @@ var jr = ["aria-label"], Mr = {
2876
3004
  }
2877
3005
  }
2878
3006
  function q(e = !0) {
2879
- w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (ne(), ie()), J();
3007
+ w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (re(), ae()), J();
2880
3008
  }
2881
3009
  function J() {
2882
3010
  B?.release(), B = null;
2883
3011
  }
2884
- function Y(e) {
3012
+ function te(e) {
2885
3013
  let t = v.value;
2886
3014
  if (!t) {
2887
3015
  d.value = !0;
2888
3016
  return;
2889
3017
  }
2890
- d.value = vr(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? y.value?.getBoundingClientRect() ?? null);
3018
+ d.value = Er(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? y.value?.getBoundingClientRect() ?? null);
2891
3019
  }
2892
- function X(e) {
3020
+ function Y(e) {
2893
3021
  if (!e) return;
2894
3022
  let t = Q(n.item), r = `${t}|${e}`;
2895
3023
  V.has(r) || (V.add(r), n.reportAssetLoad?.({
@@ -2899,20 +3027,20 @@ var jr = ["aria-label"], Mr = {
2899
3027
  url: e
2900
3028
  }));
2901
3029
  }
2902
- function te() {
3030
+ function ne() {
2903
3031
  if (!I.value) return;
2904
3032
  let e = Q(n.item);
2905
3033
  V.forEach((t) => {
2906
3034
  t.startsWith(`${e}|`) && V.delete(t);
2907
3035
  }), h.value = null, m.value = !1, w.value = !1, J(), G();
2908
3036
  }
2909
- function ne() {
2910
- gr(g.value);
2911
- }
2912
- function ie() {
2913
- _r(C.value);
3037
+ function re() {
3038
+ wr(g.value);
2914
3039
  }
2915
3040
  function ae() {
3041
+ Tr(C.value);
3042
+ }
3043
+ function oe() {
2916
3044
  let e = v.value;
2917
3045
  if (!e) return Infinity;
2918
3046
  let t = e.getBoundingClientRect();
@@ -2923,11 +3051,11 @@ var jr = ["aria-label"], Mr = {
2923
3051
  let n = window.innerHeight / 2;
2924
3052
  return Math.abs((t.top + t.bottom) / 2 - n);
2925
3053
  }
2926
- function se(e) {
2927
- let t = yr(E.value);
2928
- return !e || !t ? !1 : yr("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3054
+ function ce(e) {
3055
+ let t = Dr(E.value);
3056
+ return !e || !t ? !1 : Dr("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
2929
3057
  }
2930
- function ce() {
3058
+ function X() {
2931
3059
  r("open");
2932
3060
  }
2933
3061
  function le() {
@@ -2952,9 +3080,9 @@ var jr = ["aria-label"], Mr = {
2952
3080
  "data-testid": "vibe-list-card-open",
2953
3081
  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]",
2954
3082
  "aria-label": n.item.title || `Open item ${n.index + 1}`,
2955
- onClick: ce
2956
- }, null, 8, jr),
2957
- L.value ? (S(), s("div", Mr, [c("span", Nr, [u(j(re), {
3083
+ onClick: X
3084
+ }, null, 8, zr),
3085
+ L.value ? (S(), s("div", Br, [c("span", Vr, [u(j(ie), {
2958
3086
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2959
3087
  "aria-hidden": "true"
2960
3088
  })])])) : o("", !0),
@@ -2967,8 +3095,8 @@ var jr = ["aria-label"], Mr = {
2967
3095
  draggable: "false",
2968
3096
  class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
2969
3097
  onLoad: H,
2970
- onError: U
2971
- }, null, 42, Pr)) : N.value && E.value && !P.value ? (S(), s("video", {
3098
+ onError: ee
3099
+ }, null, 42, Hr)) : N.value && E.value && !P.value ? (S(), s("video", {
2972
3100
  key: 2,
2973
3101
  ref_key: "videoRef",
2974
3102
  ref: C,
@@ -2978,64 +3106,64 @@ var jr = ["aria-label"], Mr = {
2978
3106
  playsinline: "",
2979
3107
  preload: "metadata",
2980
3108
  class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
2981
- onCanplay: W,
2982
- onError: U,
2983
- onLoadstart: ee,
2984
- onPlaying: W,
2985
- onStalled: ee,
2986
- onWaiting: ee
2987
- }, null, 42, Fr)) : P.value ? (S(), s("div", {
3109
+ onCanplay: U,
3110
+ onError: ee,
3111
+ onLoadstart: W,
3112
+ onPlaying: U,
3113
+ onStalled: W,
3114
+ onWaiting: W
3115
+ }, null, 42, Ur)) : P.value ? (S(), s("div", {
2988
3116
  key: 3,
2989
3117
  "data-testid": "vibe-list-card-error",
2990
3118
  "data-kind": h.value,
2991
3119
  class: "relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
2992
- }, [c("div", Lr, [
2993
- u(j(oe), {
3120
+ }, [c("div", Gr, [
3121
+ u(j(se), {
2994
3122
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
2995
3123
  "aria-hidden": "true"
2996
3124
  }),
2997
- c("span", Rr, k(j(At)(h.value)), 1),
3125
+ c("span", Kr, k(j(At)(h.value)), 1),
2998
3126
  I.value ? (S(), s("button", {
2999
3127
  key: 0,
3000
3128
  type: "button",
3001
3129
  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",
3002
- onClick: z(te, ["stop"])
3130
+ onClick: z(ne, ["stop"])
3003
3131
  }, " Retry ")) : o("", !0)
3004
- ])], 8, Ir)) : (S(), s("div", zr, [c("div", Br, [D(e.$slots, "item-icon", {
3132
+ ])], 8, Wr)) : (S(), s("div", qr, [c("div", Jr, [D(e.$slots, "item-icon", {
3005
3133
  icon: j(ft)(n.item.type),
3006
3134
  item: n.item
3007
3135
  }, () => [(S(), a(O(j(ft)(n.item.type)), {
3008
3136
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3009
3137
  "aria-hidden": "true"
3010
3138
  }))])])])),
3011
- c("div", Vr, [D(e.$slots, "grid-item-overlay", {
3139
+ c("div", Yr, [D(e.$slots, "grid-item-overlay", {
3012
3140
  active: n.active,
3013
3141
  focused: f.value,
3014
3142
  hovered: p.value,
3015
3143
  index: n.index,
3016
3144
  item: n.item,
3017
- openFullscreen: ce
3145
+ openFullscreen: X
3018
3146
  })])
3019
3147
  ], 34));
3020
3148
  }
3021
- }), Ur = { 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)]" }, Wr = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Gr = {
3149
+ }), Zr = { 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)]" }, Qr = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, $r = {
3022
3150
  "data-testid": "vibe-pagination",
3023
3151
  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]"
3024
- }, Kr = { class: "whitespace-nowrap" }, qr = {
3152
+ }, ei = { class: "whitespace-nowrap" }, ti = {
3025
3153
  key: 0,
3026
3154
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
3027
- }, Jr = [
3155
+ }, ni = [
3028
3156
  "data-active",
3029
3157
  "data-index",
3030
3158
  "data-item-id",
3031
3159
  "data-occurrence-key"
3032
- ], Yr = ["data-item-id"], Xr = {
3160
+ ], ri = ["data-item-id"], ii = {
3033
3161
  key: 0,
3034
3162
  class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
3035
- }, Zr = {
3163
+ }, ai = {
3036
3164
  key: 1,
3037
3165
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
3038
- }, Qr = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, $r = /* @__PURE__ */ d({
3166
+ }, oi = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, si = /* @__PURE__ */ d({
3039
3167
  __name: "ListSurface",
3040
3168
  props: {
3041
3169
  active: {
@@ -3092,7 +3220,7 @@ var jr = ["aria-label"], Mr = {
3092
3220
  },
3093
3221
  emits: ["open-fullscreen", "update:activeIndex"],
3094
3222
  setup(e, { emit: n }) {
3095
- let r = e, d = N(), f = n, p = mr({
3223
+ let r = e, d = N(), f = n, p = Sr({
3096
3224
  active: A(r, "active"),
3097
3225
  allowExhaustedNextPageRefresh: A(r, "allowExhaustedNextPageRefresh"),
3098
3226
  items: A(r, "items"),
@@ -3132,8 +3260,8 @@ var jr = ["aria-label"], Mr = {
3132
3260
  renderSlot: d["empty-state"],
3133
3261
  surface: "grid"
3134
3262
  });
3135
- return (e, n) => (S(), s("div", Ur, [
3136
- c("div", Wr, [c("span", Gr, [c("span", Kr, k(j(p).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", qr, k(r.paginationDetail), 1)) : o("", !0)])]),
3263
+ return (e, n) => (S(), s("div", Zr, [
3264
+ c("div", Qr, [c("span", $r, [c("span", ei, k(j(p).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", ti, k(r.paginationDetail), 1)) : o("", !0)])]),
3137
3265
  c("div", {
3138
3266
  ref: j(p).scrollViewportRef,
3139
3267
  "data-testid": "vibe-list-scroll",
@@ -3154,7 +3282,7 @@ var jr = ["aria-label"], Mr = {
3154
3282
  "data-occurrence-key": j(Q)(t),
3155
3283
  class: "absolute will-change-transform",
3156
3284
  style: y(j(p).getCardStyle(n))
3157
- }, [u(Hr, {
3285
+ }, [u(Xr, {
3158
3286
  active: n === j(p).resolvedActiveIndex.value,
3159
3287
  index: n,
3160
3288
  item: t,
@@ -3178,14 +3306,14 @@ var jr = ["aria-label"], Mr = {
3178
3306
  "report-asset-load",
3179
3307
  "surface-active",
3180
3308
  "onOpen"
3181
- ])], 12, Jr))), 128)),
3309
+ ])], 12, ni))), 128)),
3182
3310
  (S(!0), s(t, null, E(j(p).leavingItems.value, (t) => (S(), s("article", {
3183
3311
  key: `leaving-${j(Q)(t.item)}`,
3184
3312
  "data-testid": "vibe-list-card-leaving",
3185
3313
  "data-item-id": t.item.id,
3186
3314
  class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
3187
3315
  style: y(j(p).getLeavingCardStyle(t.item))
3188
- }, [u(Hr, {
3316
+ }, [u(Xr, {
3189
3317
  active: !1,
3190
3318
  index: -1,
3191
3319
  item: t.item,
@@ -3200,8 +3328,8 @@ var jr = ["aria-label"], Mr = {
3200
3328
  "item",
3201
3329
  "report-asset-error",
3202
3330
  "report-asset-load"
3203
- ])], 12, Yr))), 128)),
3204
- j(P) && j(T) ? (S(), a(Jt, {
3331
+ ])], 12, ri))), 128)),
3332
+ j(P) && j(T) ? (S(), a(Qt, {
3205
3333
  key: 0,
3206
3334
  message: j(T).message,
3207
3335
  mode: j(T).mode,
@@ -3215,12 +3343,12 @@ var jr = ["aria-label"], Mr = {
3215
3343
  "surface"
3216
3344
  ])) : o("", !0)
3217
3345
  ], 4)], 544),
3218
- j(p).showScrollbar.value ? (S(), s("div", Xr, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3346
+ j(p).showScrollbar.value ? (S(), s("div", ii, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3219
3347
  "data-testid": "vibe-list-scrollbar-thumb",
3220
3348
  class: _(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out", r.loading ? "bg-white/52" : "bg-white/34"]),
3221
3349
  style: y(j(p).getScrollbarThumbStyle())
3222
3350
  }, null, 6)])) : o("", !0),
3223
- d["grid-footer"] ? (S(), s("div", Zr, [c("div", Qr, [D(e.$slots, "grid-footer")])])) : o("", !0),
3351
+ d["grid-footer"] ? (S(), s("div", ai, [c("div", oi, [D(e.$slots, "grid-footer")])])) : o("", !0),
3224
3352
  b.value ? (S(), s("div", {
3225
3353
  key: 2,
3226
3354
  class: _(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
@@ -3229,7 +3357,7 @@ var jr = ["aria-label"], Mr = {
3229
3357
  "data-testid": "vibe-grid-status-badge",
3230
3358
  class: _(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", b.value.kind === "end" ? "border-amber-300/35 text-amber-200" : b.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
3231
3359
  }, k(b.value.message), 3))], 2)) : o("", !0),
3232
- j(O) && j(T) ? (S(), a(Jt, {
3360
+ j(O) && j(T) ? (S(), a(Qt, {
3233
3361
  key: 3,
3234
3362
  class: _(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
3235
3363
  message: j(T).message,
@@ -3246,13 +3374,13 @@ var jr = ["aria-label"], Mr = {
3246
3374
  ])) : o("", !0)
3247
3375
  ]));
3248
3376
  }
3249
- }), ei = ["data-surface-mode"], ti = {
3377
+ }), ci = ["data-surface-mode"], li = {
3250
3378
  key: 1,
3251
3379
  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"
3252
- }, ni = ["data-visible", "inert"], ri = ["data-visible", "inert"], ii = {
3380
+ }, ui = ["data-visible", "inert"], di = ["data-visible", "inert"], fi = {
3253
3381
  key: 3,
3254
3382
  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"
3255
- }, ai = /* @__PURE__ */ d({
3383
+ }, pi = /* @__PURE__ */ d({
3256
3384
  name: "VibeLayout",
3257
3385
  __name: "Layout",
3258
3386
  props: {
@@ -3261,10 +3389,12 @@ var jr = ["aria-label"], Mr = {
3261
3389
  fillDelayStepMs: {},
3262
3390
  initialCursor: {},
3263
3391
  initialState: {},
3392
+ loopFullscreenVideo: { type: Boolean },
3264
3393
  mode: {},
3265
3394
  pageSize: {},
3266
3395
  paginationDetail: {},
3267
3396
  resolve: { type: Function },
3397
+ showDominantImageTone: { type: Boolean },
3268
3398
  showEndBadge: { type: Boolean },
3269
3399
  showStatusBadges: { type: Boolean },
3270
3400
  surfaceMode: {}
@@ -3276,9 +3406,9 @@ var jr = ["aria-label"], Mr = {
3276
3406
  "update:surfaceMode"
3277
3407
  ],
3278
3408
  setup(e, { expose: n, emit: i }) {
3279
- let d = e, p = N(), m = i, h = Ge(d, m), g = se((e) => {
3409
+ let d = e, p = N(), m = i, h = Ge(d, m), g = ce((e) => {
3280
3410
  m("asset-errors", e);
3281
- }), _ = ce((e) => {
3411
+ }), _ = X((e) => {
3282
3412
  m("asset-loads", e);
3283
3413
  });
3284
3414
  return b(() => {
@@ -3305,7 +3435,7 @@ var jr = ["aria-label"], Mr = {
3305
3435
  type: "button",
3306
3436
  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",
3307
3437
  onClick: n[0] ||= (...e) => j(h).retryInitialLoad && j(h).retryInitialLoad(...e)
3308
- }, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", ti, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).isDesktop.value ? (S(), s(t, { key: 2 }, [u(r, {
3438
+ }, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", li, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).isDesktop.value ? (S(), s(t, { key: 2 }, [u(r, {
3309
3439
  appear: "",
3310
3440
  "enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
3311
3441
  "enter-from-class": "translate-y-3 opacity-0",
@@ -3319,7 +3449,7 @@ var jr = ["aria-label"], Mr = {
3319
3449
  "data-visible": j(h).surfaceMode.value === "list" ? "true" : "false",
3320
3450
  inert: j(h).surfaceMode.value !== "list",
3321
3451
  class: "absolute inset-0 z-[2]"
3322
- }, [u($r, {
3452
+ }, [u(si, {
3323
3453
  active: j(h).surfaceMode.value === "list",
3324
3454
  "allow-exhausted-next-page-refresh": j(h).canRefreshExhaustedNextPage.value,
3325
3455
  items: j(h).items.value,
@@ -3387,7 +3517,7 @@ var jr = ["aria-label"], Mr = {
3387
3517
  "show-status-badges",
3388
3518
  "onOpenFullscreen",
3389
3519
  "onUpdate:activeIndex"
3390
- ])], 8, ni), [[P, j(h).surfaceMode.value === "list"]])]),
3520
+ ])], 8, ui), [[P, j(h).surfaceMode.value === "list"]])]),
3391
3521
  _: 3
3392
3522
  }), u(r, {
3393
3523
  appear: "",
@@ -3403,7 +3533,7 @@ var jr = ["aria-label"], Mr = {
3403
3533
  "data-visible": j(h).surfaceMode.value === "fullscreen" ? "true" : "false",
3404
3534
  inert: j(h).surfaceMode.value !== "fullscreen",
3405
3535
  class: "absolute inset-0 z-[3]"
3406
- }, [u(En, {
3536
+ }, [u(Pn, {
3407
3537
  items: j(h).items.value,
3408
3538
  active: j(h).surfaceMode.value === "fullscreen",
3409
3539
  "active-index": j(h).activeIndex.value,
@@ -3415,6 +3545,8 @@ var jr = ["aria-label"], Mr = {
3415
3545
  "report-asset-error": j(g).report,
3416
3546
  "report-asset-load": j(_).report,
3417
3547
  "empty-state-mode": d.emptyStateMode,
3548
+ "loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
3549
+ "show-dominant-image-tone": d.showDominantImageTone ?? !0,
3418
3550
  "show-end-badge": d.showEndBadge ?? !0,
3419
3551
  "show-status-badges": d.showStatusBadges ?? !0,
3420
3552
  "show-back-to-list": j(h).showBackToList.value,
@@ -3463,17 +3595,19 @@ var jr = ["aria-label"], Mr = {
3463
3595
  "report-asset-error",
3464
3596
  "report-asset-load",
3465
3597
  "empty-state-mode",
3598
+ "loop-fullscreen-video",
3599
+ "show-dominant-image-tone",
3466
3600
  "show-end-badge",
3467
3601
  "show-status-badges",
3468
3602
  "show-back-to-list",
3469
3603
  "onBackToList",
3470
3604
  "onUpdate:activeIndex"
3471
- ])], 8, ri), [[P, j(h).surfaceMode.value === "fullscreen"]])]),
3605
+ ])], 8, di), [[P, j(h).surfaceMode.value === "fullscreen"]])]),
3472
3606
  _: 3
3473
- })], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div", ii, [u(j(re), {
3607
+ })], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div", fi, [u(j(ie), {
3474
3608
  class: "size-10 animate-spin text-[#f7f1ea]/82",
3475
3609
  "aria-hidden": "true"
3476
- }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(En, {
3610
+ }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(Pn, {
3477
3611
  key: 4,
3478
3612
  items: j(h).items.value,
3479
3613
  active: !0,
@@ -3486,6 +3620,8 @@ var jr = ["aria-label"], Mr = {
3486
3620
  "report-asset-error": j(g).report,
3487
3621
  "report-asset-load": j(_).report,
3488
3622
  "empty-state-mode": d.emptyStateMode,
3623
+ "loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
3624
+ "show-dominant-image-tone": d.showDominantImageTone ?? !0,
3489
3625
  "show-end-badge": d.showEndBadge ?? !0,
3490
3626
  "show-status-badges": d.showStatusBadges ?? !0,
3491
3627
  "show-back-to-list": !1,
@@ -3533,14 +3669,16 @@ var jr = ["aria-label"], Mr = {
3533
3669
  "report-asset-error",
3534
3670
  "report-asset-load",
3535
3671
  "empty-state-mode",
3672
+ "loop-fullscreen-video",
3673
+ "show-dominant-image-tone",
3536
3674
  "show-end-badge",
3537
3675
  "show-status-badges",
3538
3676
  "onBackToList",
3539
3677
  "onUpdate:activeIndex"
3540
- ]))], 8, ei));
3678
+ ]))], 8, ci));
3541
3679
  }
3542
- }), oi = { install(e) {
3543
- e.component("VibeLayout", ai);
3680
+ }), mi = { install(e) {
3681
+ e.component("VibeLayout", pi);
3544
3682
  } };
3545
3683
  //#endregion
3546
- export { ai as VibeLayout, oi as VibePlugin, oi as default };
3684
+ export { pi as VibeLayout, mi as VibePlugin, mi as default };