@wyxos/vibe 3.1.14 → 3.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -140,13 +140,13 @@ var te = (e) => {
140
140
  d: "M12 17h.01",
141
141
  key: "p32p05"
142
142
  }]
143
- ]), X = q("volume-1", [["path", {
143
+ ]), ue = q("volume-1", [["path", {
144
144
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
145
145
  key: "uqj9uw"
146
146
  }], ["path", {
147
147
  d: "M16 9a5 5 0 0 1 0 6",
148
148
  key: "1q6k2b"
149
- }]]), ue = q("volume-2", [
149
+ }]]), X = q("volume-2", [
150
150
  ["path", {
151
151
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
152
152
  key: "uqj9uw"
@@ -222,28 +222,56 @@ function he(e) {
222
222
  function ge(e) {
223
223
  return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
224
224
  }
225
- function _e(e) {
225
+ function Q(e) {
226
226
  return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
227
227
  }
228
- function ve(e) {
228
+ function _e(e) {
229
229
  return e ?? "__vibe_initial_cursor__";
230
230
  }
231
- function Q(e, t, n) {
231
+ function ve(e, t, n) {
232
232
  return Math.min(Math.max(e, t), n);
233
233
  }
234
234
  //#endregion
235
+ //#region src/components/viewer-core/itemIdentity.ts
236
+ var ye = "__vibeOccurrenceKey";
237
+ function $(e) {
238
+ let t = e[ye];
239
+ return typeof t == "string" && t.length > 0 ? t : e.id;
240
+ }
241
+ function be(e, t, n) {
242
+ let r = /* @__PURE__ */ new Map(), i = [], a = n;
243
+ for (let e of t) {
244
+ let t = r.get(e.id), n = $(e);
245
+ t ? t.push(n) : r.set(e.id, [n]);
246
+ }
247
+ for (let t of e) {
248
+ let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
249
+ i.push(xe(t, e));
250
+ }
251
+ return {
252
+ items: i,
253
+ nextSequence: a
254
+ };
255
+ }
256
+ function xe(e, t) {
257
+ return $(e) === t ? e : {
258
+ ...e,
259
+ [ye]: t
260
+ };
261
+ }
262
+ //#endregion
235
263
  //#region src/components/viewer-core/removalState.ts
236
- function ye() {
264
+ function Se() {
237
265
  let e = D(/* @__PURE__ */ new Set()), t = D([]);
238
266
  function n(n) {
239
- let r = be(n).filter((t) => !e.value.has(t));
267
+ let r = Ce(n).filter((t) => !e.value.has(t));
240
268
  if (!r.length) return { ids: [] };
241
269
  let i = new Set(e.value);
242
270
  for (let e of r) i.add(e);
243
271
  return e.value = i, t.value = [...t.value, r], { ids: r };
244
272
  }
245
273
  function r(t) {
246
- let n = be(t).filter((t) => e.value.has(t));
274
+ let n = Ce(t).filter((t) => e.value.has(t));
247
275
  if (!n.length) return { ids: [] };
248
276
  let r = new Set(e.value);
249
277
  for (let e of n) r.delete(e);
@@ -274,39 +302,11 @@ function ye() {
274
302
  undo: i
275
303
  };
276
304
  }
277
- function be(e) {
305
+ function Ce(e) {
278
306
  let t = Array.isArray(e) ? e : [e];
279
307
  return Array.from(new Set(t.filter((e) => typeof e == "string" && e.length > 0)));
280
308
  }
281
309
  //#endregion
282
- //#region src/components/viewer-core/itemIdentity.ts
283
- var xe = "__vibeOccurrenceKey";
284
- function $(e) {
285
- let t = e[xe];
286
- return typeof t == "string" && t.length > 0 ? t : e.id;
287
- }
288
- function Se(e, t, n) {
289
- let r = /* @__PURE__ */ new Map(), i = [], a = n;
290
- for (let e of t) {
291
- let t = r.get(e.id), n = $(e);
292
- t ? t.push(n) : r.set(e.id, [n]);
293
- }
294
- for (let t of e) {
295
- let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
296
- i.push(Ce(t, e));
297
- }
298
- return {
299
- items: i,
300
- nextSequence: a
301
- };
302
- }
303
- function Ce(e, t) {
304
- return $(e) === t ? e : {
305
- ...e,
306
- [xe]: t
307
- };
308
- }
309
- //#endregion
310
310
  //#region src/components/viewer-core/autoBuckets.ts
311
311
  function we(e) {
312
312
  return e.flatMap((e) => e.items);
@@ -335,7 +335,7 @@ function ke(e, t, n) {
335
335
  return i >= 0 && r.splice(i, 1, n), r;
336
336
  }
337
337
  function Ae(e, t, n) {
338
- let r = Se(e, t, n);
338
+ let r = be(e, t, n);
339
339
  return {
340
340
  items: r.items,
341
341
  nextSequence: r.nextSequence
@@ -438,19 +438,19 @@ function Le(e) {
438
438
  sequence: e.sequence
439
439
  }), n = Te(t.bucket.items, e.removedIds);
440
440
  return {
441
- activeIndex: Q(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
441
+ activeIndex: ve(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
442
442
  buckets: [t.bucket],
443
443
  nextSequence: t.nextSequence
444
444
  };
445
445
  }
446
446
  function Re(e, t) {
447
- let n = e[Q(t, 0, Math.max(0, e.length - 1))];
447
+ let n = e[ve(t, 0, Math.max(0, e.length - 1))];
448
448
  return n ? $(n) : null;
449
449
  }
450
450
  function ze(e, t, n = null) {
451
451
  if (!e.length) return 0;
452
452
  let r = n ? e.findIndex((e) => $(e) === n) : -1;
453
- return r >= 0 ? r : Q(t, 0, e.length - 1);
453
+ return r >= 0 ? r : ve(t, 0, e.length - 1);
454
454
  }
455
455
  function Be(e, t, n) {
456
456
  return e ? De(e, t) < n : !1;
@@ -494,7 +494,7 @@ function Ke() {
494
494
  //#endregion
495
495
  //#region src/components/viewer-core/useAutoResolveSource.ts
496
496
  function qe(e) {
497
- let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d = Ke(), f = d.remainingMs, p = D(null), m = D(!1), h = D(!0), g = D(!1), _ = /* @__PURE__ */ new Set(), v = null, y = null, b = 0, C = 0, w = i(() => Ge(e.fillDelayMs, Ve)), T = i(() => Ge(e.fillDelayStepMs, He)), E = i(() => typeof e.resolve == "function"), O = i(() => _e(e.pageSize)), k = i(() => we(n.value)), A = i(() => Te(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => ge(c.value) || m.value), N = i(() => Je(n.value, e.removedIds.value)), P = i(() => Ye(n.value, e.removedIds.value)), F = i(() => P.value?.nextCursor ?? null), I = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!F.value), z = i(() => !!I.value), B = i(() => E.value && n.value.length > 0), ee = i(() => Te(we(a.value), e.removedIds.value)), te = i(() => Oe(n.value, e.removedIds.value, j.value)), V = i(() => !A.value.length && !M.value && !!s.value);
497
+ let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d = Ke(), f = d.remainingMs, p = D(null), m = D(!1), h = D(!0), g = D(!1), _ = /* @__PURE__ */ new Set(), v = null, y = null, b = 0, C = 0, w = i(() => Ge(e.fillDelayMs, Ve)), T = i(() => Ge(e.fillDelayStepMs, He)), E = i(() => typeof e.resolve == "function"), O = i(() => Q(e.pageSize)), k = i(() => we(n.value)), A = i(() => Te(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => ge(c.value) || m.value), N = i(() => Je(n.value, e.removedIds.value)), P = i(() => Ye(n.value, e.removedIds.value)), F = i(() => P.value?.nextCursor ?? null), I = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!F.value), z = i(() => !!I.value), B = i(() => E.value && n.value.length > 0), ee = i(() => Te(we(a.value), e.removedIds.value)), te = i(() => Oe(n.value, e.removedIds.value, j.value)), V = i(() => !A.value.length && !M.value && !!s.value);
498
498
  L(() => A.value.length, (e) => {
499
499
  if (e === 0) {
500
500
  r.value = 0;
@@ -503,6 +503,8 @@ function qe(e) {
503
503
  o.value &&= (ye(), !1), r.value > e - 1 && (r.value = e - 1);
504
504
  }), L(() => r.value, () => {
505
505
  h.value && ce();
506
+ }), L(() => F.value, (e) => {
507
+ e && !A.value.length && c.value === "idle" && ce();
506
508
  }), S(() => {
507
509
  pe() || e.resolve && H();
508
510
  }), x(() => {
@@ -519,24 +521,24 @@ function qe(e) {
519
521
  t && (n.value = t.buckets, r.value = 0, Z());
520
522
  }
521
523
  async function U() {
522
- if (!(g.value || M.value)) {
523
- if (he("trailing") || !R.value) {
524
- if (!B.value) return;
525
- let e = await ue("trailing");
526
- e?.followCursor && he("trailing") && await le(e.followCursor);
527
- return;
528
- }
529
- await le(F.value);
524
+ if (g.value || M.value) return;
525
+ let e = !A.value.length;
526
+ if (he("trailing") || !R.value) {
527
+ if (!B.value) return;
528
+ let t = await X("trailing");
529
+ t?.followCursor && he("trailing") && await le(t.followCursor, { commitImmediately: e });
530
+ return;
530
531
  }
532
+ await le(F.value, { commitImmediately: e });
531
533
  }
532
534
  async function W() {
533
535
  if (!(g.value || !z.value || M.value)) {
534
536
  if (he("leading")) {
535
- let e = await ue("leading");
536
- e?.itemsLoaded === 0 && e.followCursor && await X(e.followCursor);
537
+ let e = await X("leading");
538
+ e?.itemsLoaded === 0 && e.followCursor && await ue(e.followCursor);
537
539
  return;
538
540
  }
539
- await X(I.value);
541
+ await ue(I.value);
540
542
  }
541
543
  }
542
544
  async function ne() {
@@ -559,7 +561,7 @@ function qe(e) {
559
561
  function q(t) {
560
562
  let n = A.value;
561
563
  if (!n.length) return;
562
- let i = Q(t, 0, n.length - 1);
564
+ let i = ve(t, 0, n.length - 1);
563
565
  i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
564
566
  }
565
567
  function re(e) {
@@ -596,36 +598,36 @@ function qe(e) {
596
598
  r.value = ze(A.value, j.value, e);
597
599
  }
598
600
  function se() {
599
- a.value.length > 0 && !ee.value.length && K();
601
+ a.value.length > 0 && (!ee.value.length || !A.value.length) && K();
600
602
  }
601
603
  async function ce() {
602
604
  if (!(!h.value || me())) {
603
605
  if (!A.value.length) {
604
- R.value && await U();
606
+ (R.value || B.value) && await U();
605
607
  return;
606
608
  }
607
609
  z.value && r.value < 3 && await W(), R.value && r.value >= A.value.length - 3 && await U();
608
610
  }
609
611
  }
610
- async function le(e) {
612
+ async function le(e, t = {}) {
611
613
  y = async () => {
612
- await le(e);
614
+ await le(e, t);
613
615
  };
614
- let t = await de({
616
+ let r = await de({
615
617
  continueUntilFilled: !0,
616
618
  cursor: e,
617
619
  direction: "forward",
618
620
  phase: "loading"
619
621
  });
620
- if (t) {
621
- if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], m.value = !1, Z();
622
- if (a.value = t.buckets, !ee.value.length) return n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Z();
622
+ if (r) {
623
+ if (r.canceled) return n.value = [...n.value, ...r.buckets], a.value = [], m.value = !1, Z();
624
+ if (a.value = r.buckets, t.commitImmediately || !ee.value.length) return n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Z();
623
625
  m.value = !0;
624
626
  }
625
627
  }
626
- async function X(e) {
628
+ async function ue(e) {
627
629
  y = async () => {
628
- await X(e);
630
+ await ue(e);
629
631
  };
630
632
  let t = await de({
631
633
  continueUntilFilled: !0,
@@ -637,13 +639,13 @@ function qe(e) {
637
639
  let r = ae();
638
640
  n.value = [...t.buckets, ...n.value], oe(r), Z();
639
641
  }
640
- async function ue(t) {
642
+ async function X(t) {
641
643
  if (y = async () => {
642
- await ue(t);
644
+ await X(t);
643
645
  }, !e.resolve) return null;
644
646
  let r = t === "leading" ? N.value : P.value;
645
647
  if (!r) return null;
646
- let i = ve(r.cursor);
648
+ let i = _e(r.cursor);
647
649
  if (_.has(i)) return null;
648
650
  _.add(i), s.value = null, c.value = "refreshing", l.value = null, u.value = null, p.value = null;
649
651
  let a = ++b, o = typeof AbortController > "u" ? null : new AbortController();
@@ -682,7 +684,7 @@ function qe(e) {
682
684
  for (s.value = null, c.value = t.phase, l.value = null, u.value = null, p.value = null;;) {
683
685
  if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
684
686
  if (i.length > 0 && g.value) return Ie(i, t.direction, e.removedIds.value, !1);
685
- let f = ve(a);
687
+ let f = _e(a);
686
688
  if (r.has(f) || _.has(f)) break;
687
689
  r.add(f), _.add(f);
688
690
  let m = typeof AbortController > "u" ? null : new AbortController();
@@ -809,7 +811,7 @@ function Ye(e, t) {
809
811
  //#endregion
810
812
  //#region src/components/viewer-core/useDataSource.ts
811
813
  function Xe(e, t) {
812
- let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = ye(), l = qe({
814
+ let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = Se(), l = qe({
813
815
  emit: t,
814
816
  fillDelayMs: e.fillDelayMs,
815
817
  fillDelayStepMs: e.fillDelayStepMs,
@@ -821,11 +823,11 @@ function Xe(e, t) {
821
823
  }), u = l.items, d = l.activeIndex, f = l.loading, p = l.hasNextPage, m = l.hasPreviousPage, h = i(() => o.value.size), g = i(() => e.paginationDetail ?? null), _ = i(() => !l.hasNextPage.value && l.canRefreshTrailingBoundary.value);
822
824
  function v(e) {
823
825
  let t = u.value;
824
- t.length && l.setActiveIndex(C(e, 0, t.length - 1));
826
+ t.length && l.setActiveIndex(T(e, 0, t.length - 1));
825
827
  }
826
828
  function y(e) {
827
829
  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);
828
- return s.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t, { preserveTrailingPlaceholder: o }), i && l.maybePrefetchAround(), s) : s;
830
+ return s.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t, { preserveTrailingPlaceholder: o }), (i || !u.value.length) && l.maybePrefetchAround(), s) : s;
829
831
  }
830
832
  function b(e) {
831
833
  let t = l.getActiveOccurrenceKey(), n = s(e);
@@ -839,26 +841,32 @@ function Xe(e, t) {
839
841
  let e = l.getActiveOccurrenceKey();
840
842
  n(), l.syncActiveIndexAfterVisibilityChange(e);
841
843
  }
842
- function C(e, t, n) {
844
+ function C() {
845
+ return [...u.value];
846
+ }
847
+ function w(e) {
848
+ return u.value.find((t) => $(t) === e) ?? null;
849
+ }
850
+ function T(e, t, n) {
843
851
  return Math.min(Math.max(e, t), n);
844
852
  }
845
- function w() {
853
+ function E() {
846
854
  l.cancel();
847
855
  }
848
- async function T() {
856
+ async function D() {
849
857
  await l.prefetchNextPage();
850
858
  }
851
- async function E() {
859
+ async function O() {
852
860
  await l.prefetchPreviousPage();
853
861
  }
854
- async function D() {
862
+ async function k() {
855
863
  await l.retry();
856
864
  }
857
865
  return {
858
866
  activeIndex: d,
859
867
  canRefreshExhaustedNextPage: _,
860
868
  canRetryInitialLoad: l.canRetryInitialLoad,
861
- cancel: w,
869
+ cancel: E,
862
870
  clearRemoved: S,
863
871
  commitPendingAppend: l.commitPendingAppend,
864
872
  currentCursor: l.currentCursor,
@@ -867,6 +875,8 @@ function Xe(e, t) {
867
875
  fillCursor: l.fillCursor,
868
876
  fillDelayRemainingMs: l.fillDelayRemainingMs,
869
877
  fillTargetCount: l.fillTargetCount,
878
+ getItemByOccurrenceKey: w,
879
+ getItems: C,
870
880
  getRemovedIds: r,
871
881
  hasNextPage: p,
872
882
  hasPreviousPage: m,
@@ -874,8 +884,8 @@ function Xe(e, t) {
874
884
  items: u,
875
885
  lockPageLoading: l.lockPageLoading,
876
886
  loading: f,
877
- loadNext: T,
878
- loadPrevious: E,
887
+ loadNext: D,
888
+ loadPrevious: O,
879
889
  nextCursor: l.nextCursor,
880
890
  paginationDetail: g,
881
891
  pendingAppendItems: l.pendingAppendItems,
@@ -886,7 +896,7 @@ function Xe(e, t) {
886
896
  removedCount: h,
887
897
  remove: y,
888
898
  restore: b,
889
- retry: D,
899
+ retry: k,
890
900
  retryInitialLoad: l.retryInitialLoad,
891
901
  setActiveIndex: v,
892
902
  setAutoPrefetchEnabled: l.setAutoPrefetchEnabled,
@@ -1017,7 +1027,7 @@ var et = {
1017
1027
  "volume-toggle"
1018
1028
  ],
1019
1029
  setup(e, { emit: t }) {
1020
- let n = e, r = t, l = D(null), u = D(!1), d = i(() => n.volumeControlLayout === "vertical"), f = i(() => C(n.volume, 0, 1)), p = i(() => Math.round(f.value * 100)), m = i(() => n.muted || f.value <= 0 ? de : f.value < .5 ? X : ue), h = i(() => n.muted || f.value <= 0 ? "Unmute active media" : "Mute active media"), g = i(() => d.value && !u.value ? "Show volume controls" : h.value), _ = i(() => n.volumeControlLayout === "vertical" ? { height: `${p.value}%` } : { width: `${p.value}%` });
1030
+ let n = e, r = t, l = D(null), u = D(!1), d = i(() => n.volumeControlLayout === "vertical"), f = i(() => C(n.volume, 0, 1)), p = i(() => Math.round(f.value * 100)), m = i(() => n.muted || f.value <= 0 ? de : f.value < .5 ? ue : X), h = i(() => n.muted || f.value <= 0 ? "Unmute active media" : "Mute active media"), g = i(() => d.value && !u.value ? "Show volume controls" : h.value), _ = i(() => n.volumeControlLayout === "vertical" ? { height: `${p.value}%` } : { width: `${p.value}%` });
1021
1031
  L(d, (e) => {
1022
1032
  e || (u.value = !1);
1023
1033
  }), S(() => {
@@ -1427,7 +1437,7 @@ function Ht(e) {
1427
1437
  let t = Lt({
1428
1438
  active: e.active,
1429
1439
  getItemKey: r,
1430
- isAssetReady: p,
1440
+ isAssetReady: m,
1431
1441
  items: e.items,
1432
1442
  onResetAssetState: e.viewer.resetAssetState,
1433
1443
  resolvedActiveIndex: e.resolvedActiveIndex
@@ -1442,48 +1452,56 @@ function Ht(e) {
1442
1452
  function i(e) {
1443
1453
  return t.shouldAttachSlideAsset(e);
1444
1454
  }
1445
- function a(e) {
1455
+ function a(e, t) {
1456
+ return h(e, t) && i(e);
1457
+ }
1458
+ function o(e) {
1446
1459
  return t.getSlidePreloadState(e);
1447
1460
  }
1448
- function o(t, n) {
1449
- let i = r(n), o = a(t);
1450
- return o === "idle" || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(i) ? !1 : o !== "ready";
1461
+ function s(t, n) {
1462
+ let i = r(n), a = o(t);
1463
+ return a === "idle" || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(i) ? !1 : a !== "ready";
1451
1464
  }
1452
- function s(t) {
1465
+ function c(t) {
1453
1466
  return e.viewer.getAssetErrorKind(r(t));
1454
1467
  }
1455
- function c(t) {
1468
+ function l(t) {
1456
1469
  return e.viewer.getAssetErrorLabel(r(t)) ?? "Load error";
1457
1470
  }
1458
- function l(t, n) {
1459
- return a(t) !== "idle" && t === e.resolvedActiveIndex.value && !!s(n);
1460
- }
1461
1471
  function u(t, n) {
1472
+ return o(t) !== "idle" && t === e.resolvedActiveIndex.value && !!c(n);
1473
+ }
1474
+ function d(t, n) {
1462
1475
  return i(t) ? e.viewer.getImageSource(n) : void 0;
1463
1476
  }
1464
- function d(e) {
1477
+ function f(e) {
1465
1478
  return i(e) ? "metadata" : "none";
1466
1479
  }
1467
- function f(e, t) {
1480
+ function p(e, t) {
1468
1481
  return i(e) ? t.url : void 0;
1469
1482
  }
1470
- function p(t, n) {
1483
+ function m(t, n) {
1471
1484
  return n.type === "image" ? e.viewer.isImageReady(t) : n.type === "video" || n.type === "audio" ? e.viewer.isMediaReady(t) : !1;
1472
1485
  }
1486
+ function h(t, n) {
1487
+ let i = e.items.value[t];
1488
+ return !!i && r(i) === r(n);
1489
+ }
1473
1490
  return {
1474
- getAssetErrorKind: s,
1475
- getAssetErrorLabel: c,
1476
- getFullscreenImageSource: u,
1477
- getFullscreenMediaPreload: d,
1478
- getFullscreenMediaSource: f,
1491
+ getAssetErrorKind: c,
1492
+ getAssetErrorLabel: l,
1493
+ getFullscreenImageSource: d,
1494
+ getFullscreenMediaPreload: f,
1495
+ getFullscreenMediaSource: p,
1479
1496
  getItemKey: r,
1480
1497
  getMediaActionLabel: n,
1481
- getSlidePreloadState: a,
1482
- isAssetErrored: l,
1483
- isAssetLoading: o,
1498
+ getSlidePreloadState: o,
1499
+ isAssetErrored: u,
1500
+ isAssetLoading: s,
1484
1501
  registerImageElement: t.registerImageElement,
1485
1502
  registerMediaElement: t.registerMediaElement,
1486
1503
  settleAssetPreload: t.settleAssetPreload,
1504
+ shouldHandleSlideAssetEvent: a,
1487
1505
  shouldPreloadSlideAsset: i
1488
1506
  };
1489
1507
  }
@@ -2097,8 +2115,41 @@ function Sn(e) {
2097
2115
  return bn[e], yn;
2098
2116
  }
2099
2117
  //#endregion
2100
- //#region src/components/viewer-core/dominantImageTone.ts
2118
+ //#region src/components/viewer-core/useFullscreenAssetEvents.ts
2101
2119
  function Cn(e) {
2120
+ function t(t, n) {
2121
+ return e.fullscreenMedia.shouldHandleSlideAssetEvent(t, n) ? e.fullscreenMedia.getItemKey(n) : null;
2122
+ }
2123
+ function n(n, r, i) {
2124
+ let a = t(r, i);
2125
+ if (!a) return;
2126
+ e.fullscreenMedia.settleAssetPreload(a), e.viewer.onImageLoad(a, i.url);
2127
+ let o = n.currentTarget;
2128
+ o instanceof HTMLImageElement && e.updateDominantToneFromImageElement(a, o);
2129
+ }
2130
+ async function r(n, r) {
2131
+ let i = t(n, r);
2132
+ i && (e.fullscreenMedia.settleAssetPreload(i), await e.viewer.onImageError(i, r.url));
2133
+ }
2134
+ function i(n, r, i) {
2135
+ let a = t(n, r);
2136
+ return a ? (e.viewer.onMediaEvent(a, i), a) : null;
2137
+ }
2138
+ async function a(n, r) {
2139
+ let i = t(n, r);
2140
+ i && (e.fullscreenMedia.settleAssetPreload(i), await e.viewer.onMediaError(i, r.url));
2141
+ }
2142
+ return {
2143
+ getHandledItemKey: t,
2144
+ onFullscreenImageError: r,
2145
+ onFullscreenImageLoad: n,
2146
+ onFullscreenMediaError: a,
2147
+ onFullscreenMediaEvent: i
2148
+ };
2149
+ }
2150
+ //#endregion
2151
+ //#region src/components/viewer-core/dominantImageTone.ts
2152
+ function wn(e) {
2102
2153
  if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
2103
2154
  let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
2104
2155
  if (!n) return null;
@@ -2113,20 +2164,20 @@ function Cn(e) {
2113
2164
  r += d, i += s * d, a += c * d, o += l * d;
2114
2165
  }
2115
2166
  return r <= 0 ? null : {
2116
- r: wn(Math.round(i / r)),
2117
- g: wn(Math.round(a / r)),
2118
- b: wn(Math.round(o / r))
2167
+ r: Tn(Math.round(i / r)),
2168
+ g: Tn(Math.round(a / r)),
2169
+ b: Tn(Math.round(o / r))
2119
2170
  };
2120
2171
  } catch {
2121
2172
  return null;
2122
2173
  }
2123
2174
  }
2124
- function wn(e) {
2175
+ function Tn(e) {
2125
2176
  return Math.min(235, Math.max(26, e));
2126
2177
  }
2127
2178
  //#endregion
2128
2179
  //#region src/components/viewer-core/useFullscreenDominantTone.ts
2129
- function Tn(e) {
2180
+ function En(e) {
2130
2181
  let t = D({}), n = i(() => e.activeItem.value ? e.getItemKey(e.activeItem.value) : null), r = i(() => !e.showDominantImageTone.value || e.activeItem.value?.type !== "image" || !n.value || !e.isImageReady(n.value) ? null : t.value[n.value] ?? null), a = i(() => {
2131
2182
  if (!r.value) return;
2132
2183
  let { r: e, g: t, b: n } = r.value;
@@ -2141,7 +2192,7 @@ function Tn(e) {
2141
2192
  });
2142
2193
  function s(n, r) {
2143
2194
  if (!e.showDominantImageTone.value) return;
2144
- let i = Cn(r);
2195
+ let i = wn(r);
2145
2196
  i && (t.value[n] = i);
2146
2197
  }
2147
2198
  return {
@@ -2152,7 +2203,7 @@ function Tn(e) {
2152
2203
  }
2153
2204
  //#endregion
2154
2205
  //#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
2155
- var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2206
+ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2156
2207
  inheritAttrs: !1,
2157
2208
  __name: "SurfaceEmptyState",
2158
2209
  props: {
@@ -2166,31 +2217,31 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2166
2217
  "data-testid": "vibe-empty-state-inline",
2167
2218
  "data-surface": e.surface,
2168
2219
  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)]"]
2169
- }), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, En)) : (w(), s("div", g({ key: 1 }, N(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
2220
+ }), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, Dn)) : (w(), s("div", g({ key: 1 }, N(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
2170
2221
  "data-testid": "vibe-empty-state-badge",
2171
2222
  "data-surface": e.surface,
2172
2223
  class: v(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
2173
- }, j(e.message), 11, Dn)])], 16));
2224
+ }, j(e.message), 11, On)])], 16));
2174
2225
  }
2175
- }), kn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, An = {
2226
+ }), An = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, jn = {
2176
2227
  key: 0,
2177
2228
  class: "relative h-full min-h-0"
2178
- }, jn = [
2229
+ }, Mn = [
2179
2230
  "data-item-id",
2180
2231
  "data-occurrence-key",
2181
2232
  "data-index",
2182
2233
  "data-active",
2183
2234
  "aria-hidden"
2184
- ], Mn = {
2235
+ ], Nn = {
2185
2236
  key: 0,
2186
2237
  "data-testid": "vibe-asset-spinner",
2187
2238
  class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
2188
- }, Nn = { 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"], Fn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, In = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Ln = ["onClick"], Rn = [
2239
+ }, Pn = { 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]" }, Fn = ["data-kind"], In = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Ln = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Rn = ["onClick"], zn = [
2189
2240
  "src",
2190
2241
  "alt",
2191
2242
  "onLoad",
2192
2243
  "onError"
2193
- ], zn = [
2244
+ ], Bn = [
2194
2245
  "loop",
2195
2246
  "src",
2196
2247
  "preload",
@@ -2209,15 +2260,15 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2209
2260
  "onStalled",
2210
2261
  "onTimeupdate",
2211
2262
  "onWaiting"
2212
- ], Bn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Vn = [
2263
+ ], Vn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Hn = [
2213
2264
  "aria-label",
2214
2265
  "disabled",
2215
2266
  "onClick"
2216
- ], Hn = { 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]" }, Wn = {
2267
+ ], Un = { 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]" }, Wn = { 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]" }, Gn = {
2217
2268
  key: 0,
2218
2269
  "data-testid": "vibe-asset-spinner",
2219
2270
  class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
2220
- }, 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]" }, Kn = ["data-kind"], qn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Jn = ["onClick"], Yn = [
2271
+ }, Kn = { 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]" }, qn = ["data-kind"], Jn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Yn = ["onClick"], Xn = [
2221
2272
  "src",
2222
2273
  "preload",
2223
2274
  "onCanplay",
@@ -2233,26 +2284,26 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2233
2284
  "onStalled",
2234
2285
  "onTimeupdate",
2235
2286
  "onWaiting"
2236
- ], Xn = {
2287
+ ], Zn = {
2237
2288
  key: 2,
2238
2289
  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"
2239
- }, Zn = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, Qn = {
2290
+ }, Qn = { 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]" }, $n = {
2240
2291
  key: 0,
2241
2292
  "data-testid": "vibe-fullscreen-overlay",
2242
2293
  class: "pointer-events-none absolute inset-0 z-[6]"
2243
- }, $n = { class: "h-full w-full" }, er = {
2294
+ }, er = { class: "h-full w-full" }, tr = {
2244
2295
  key: 1,
2245
2296
  "data-testid": "vibe-forward-fill-placeholder",
2246
2297
  class: "grid h-full min-h-0 place-items-center px-6 text-center"
2247
- }, tr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, 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)]" }, rr = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, ir = {
2298
+ }, nr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, rr = { 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)]" }, ir = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, ar = {
2248
2299
  key: 0,
2249
2300
  "data-testid": "vibe-fullscreen-aside",
2250
2301
  class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
2251
- }, ar = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, or = {
2302
+ }, or = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, sr = {
2252
2303
  key: 0,
2253
2304
  "data-testid": "vibe-fullscreen-aside",
2254
2305
  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]"
2255
- }, sr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, cr = 1280, lr = 768, ur = /* @__PURE__ */ d({
2306
+ }, cr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, lr = 1280, ur = 768, dr = /* @__PURE__ */ d({
2256
2307
  __name: "FullscreenSurface",
2257
2308
  props: {
2258
2309
  active: {
@@ -2310,17 +2361,21 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2310
2361
  enabled: M(d, "active"),
2311
2362
  onAssetError: d.reportAssetError ?? void 0,
2312
2363
  onAssetLoad: d.reportAssetLoad ?? void 0
2313
- }), _ = D(typeof window > "u" ? cr : window.innerWidth || cr), C = Ht({
2364
+ }), _ = D(typeof window > "u" ? lr : window.innerWidth || lr), C = Ht({
2314
2365
  active: M(d, "active"),
2315
2366
  items: h.items,
2316
2367
  resolvedActiveIndex: h.resolvedActiveIndex,
2317
2368
  viewer: h
2318
- }), T = i(() => xn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = Tn({
2369
+ }), T = i(() => xn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = En({
2319
2370
  activeItem: h.activeItem,
2320
2371
  getItemKey: C.getItemKey,
2321
2372
  isImageReady: h.isImageReady,
2322
2373
  showDominantImageTone: M(d, "showDominantImageTone")
2323
- }), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value < lr ? "vertical" : "horizontal"), te = i(() => R.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), V = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), H = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), U = i(() => {
2374
+ }), L = Cn({
2375
+ fullscreenMedia: C,
2376
+ updateDominantToneFromImageElement: _e,
2377
+ viewer: h
2378
+ }), R = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), B = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), te = i(() => _.value < ur ? "vertical" : "horizontal"), V = i(() => B.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), H = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), U = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), W = i(() => {
2324
2379
  let e = h.activeItem.value;
2325
2380
  return e ? {
2326
2381
  hasNextPage: d.hasNextPage,
@@ -2330,14 +2385,14 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2330
2385
  paginationDetail: d.paginationDetail,
2331
2386
  total: d.items.length
2332
2387
  } : null;
2333
- }), W = i(() => !U.value || !f["fullscreen-header-actions"] ? [] : f["fullscreen-header-actions"](U.value)), ne = i(() => !U.value || !f["fullscreen-aside"] ? [] : f["fullscreen-aside"](U.value)), G = i(() => !d.showStatusBadges || !U.value || !h.statusKind.value || !h.statusMessage.value ? null : {
2334
- ...U.value,
2388
+ }), ne = i(() => !W.value || !f["fullscreen-header-actions"] ? [] : f["fullscreen-header-actions"](W.value)), G = i(() => !W.value || !f["fullscreen-aside"] ? [] : f["fullscreen-aside"](W.value)), K = i(() => !d.showStatusBadges || !W.value || !h.statusKind.value || !h.statusMessage.value ? null : {
2389
+ ...W.value,
2335
2390
  kind: h.statusKind.value,
2336
2391
  message: h.statusMessage.value
2337
- }), K = i(() => !G.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](G.value)), q = i(() => ({
2338
- gridTemplateColumns: Y.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
2392
+ }), q = i(() => !K.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](K.value)), re = i(() => ({
2393
+ gridTemplateColumns: ie.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
2339
2394
  transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
2340
- })), re = i(() => Ut(W.value)), J = i(() => Ut(ne.value)), Y = i(() => J.value && _.value >= cr), ie = i(() => J.value && !Y.value), ae = i(() => Ut(K.value)), { emptyStateProps: X, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = Kt({
2395
+ })), J = i(() => Ut(ne.value)), Y = i(() => Ut(G.value)), ie = i(() => Y.value && _.value >= lr), ae = i(() => Y.value && !ie.value), ue = i(() => Ut(q.value)), { emptyStateProps: X, showBadgeEmptyState: de, showCustomEmptyState: fe, showInlineEmptyState: Z } = Kt({
2341
2396
  emptyStateMode: M(d, "emptyStateMode"),
2342
2397
  itemCount: i(() => d.items.length),
2343
2398
  loading: M(d, "loading"),
@@ -2345,59 +2400,48 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2345
2400
  surface: "fullscreen"
2346
2401
  });
2347
2402
  S(() => {
2348
- window.addEventListener("resize", Z);
2403
+ window.addEventListener("resize", pe);
2349
2404
  }), x(() => {
2350
- window.removeEventListener("resize", Z);
2405
+ window.removeEventListener("resize", pe);
2351
2406
  });
2352
- function Z() {
2353
- _.value = window.innerWidth || cr;
2354
- }
2355
- function pe(e, t, n) {
2356
- C.settleAssetPreload(t), h.onImageLoad(t, n);
2357
- let r = e.currentTarget;
2358
- r instanceof HTMLImageElement && ye(t, r);
2407
+ function pe() {
2408
+ _.value = window.innerWidth || lr;
2359
2409
  }
2360
- async function me(e, t) {
2361
- C.settleAssetPreload(e), await h.onImageError(e, t);
2410
+ function me(e, t) {
2411
+ C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && _e(e, t);
2362
2412
  }
2363
2413
  function he(e, t) {
2364
- C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && ye(e, t);
2365
- }
2366
- function ge(e, t) {
2367
2414
  C.registerMediaElement(e, t), h.registerVideoElement(e, t);
2368
2415
  }
2369
- function _e(e, t) {
2416
+ function ge(e, t) {
2370
2417
  C.registerMediaElement(e, t), h.registerAudioElement(e, t);
2371
2418
  }
2372
- async function ve(e, t) {
2373
- C.settleAssetPreload(e), await h.onMediaError(e, t);
2419
+ function Q(e, t, n) {
2420
+ let r = L.onFullscreenMediaEvent(e, t, n), i = n.currentTarget, a = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
2421
+ r && i instanceof HTMLMediaElement && i.readyState >= a && C.settleAssetPreload(r);
2374
2422
  }
2375
- function Q(e, t) {
2376
- h.onMediaEvent(e, t);
2377
- let n = t.currentTarget, r = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
2378
- n instanceof HTMLMediaElement && n.readyState >= r && C.settleAssetPreload(e);
2379
- }
2380
- function ye(e, t) {
2423
+ function _e(e, t) {
2381
2424
  I(e, t);
2382
2425
  }
2383
- function be(e, t) {
2384
- if (Q(t, e), !d.loopFullscreenVideo) return;
2385
- let n = e.currentTarget;
2386
- if (!(n instanceof HTMLVideoElement)) return;
2426
+ function ve(e, t, n) {
2427
+ let r = L.getHandledItemKey(t, n);
2428
+ if (!r || (h.onMediaEvent(r, e), !d.loopFullscreenVideo)) return;
2429
+ let i = e.currentTarget;
2430
+ if (!(i instanceof HTMLVideoElement)) return;
2387
2431
  try {
2388
- n.currentTime = 0;
2432
+ i.currentTime = 0;
2389
2433
  } catch {}
2390
- let r = n.play();
2391
- r && typeof r.catch == "function" && r.catch(() => {});
2434
+ let a = i.play();
2435
+ a && typeof a.catch == "function" && a.catch(() => {});
2392
2436
  }
2393
- return (e, n) => (w(), s("div", kn, [
2437
+ return (e, n) => (w(), s("div", An, [
2394
2438
  c("div", {
2395
2439
  class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
2396
2440
  style: b(N(P))
2397
2441
  }, null, 6),
2398
2442
  c("div", {
2399
2443
  class: "relative z-[1] grid h-full min-h-0",
2400
- style: b(q.value)
2444
+ style: b(re.value)
2401
2445
  }, [c("div", {
2402
2446
  ref: "viewer.stageRef",
2403
2447
  "data-testid": "vibe-stage",
@@ -2407,7 +2451,7 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2407
2451
  onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
2408
2452
  onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
2409
2453
  onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
2410
- }, [N(h).activeItem.value ? (w(), s("div", An, [
2454
+ }, [N(h).activeItem.value ? (w(), s("div", jn, [
2411
2455
  (w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
2412
2456
  key: N(C).getItemKey(r),
2413
2457
  "data-testid": "vibe-slide",
@@ -2423,8 +2467,8 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2423
2467
  style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
2424
2468
  }, null, 6), N(h).isVisual(r) ? (w(), s("div", {
2425
2469
  key: 0,
2426
- class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? te.value : ""])
2427
- }, [N(C).isAssetLoading(i, r) ? (w(), s("div", Mn, [c("span", Nn, [u(N(oe), {
2470
+ class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? V.value : ""])
2471
+ }, [N(C).isAssetLoading(i, r) ? (w(), s("div", Nn, [c("span", Pn, [u(N(oe), {
2428
2472
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2429
2473
  "aria-hidden": "true"
2430
2474
  })])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
@@ -2432,19 +2476,19 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2432
2476
  "data-testid": "vibe-asset-error",
2433
2477
  "data-kind": N(C).getAssetErrorKind(r),
2434
2478
  class: "grid h-full w-full place-items-center"
2435
- }, [c("div", Fn, [
2479
+ }, [c("div", In, [
2436
2480
  u(N(le), {
2437
2481
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2438
2482
  "aria-hidden": "true"
2439
2483
  }),
2440
- c("p", In, j(N(C).getAssetErrorLabel(r)), 1),
2484
+ c("p", Ln, j(N(C).getAssetErrorLabel(r)), 1),
2441
2485
  N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
2442
2486
  key: 0,
2443
2487
  type: "button",
2444
2488
  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",
2445
2489
  onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
2446
- }, " Retry ", 8, Ln)) : o("", !0)
2447
- ])], 8, Pn)) : r.type === "image" ? (w(), s("img", {
2490
+ }, " Retry ", 8, Rn)) : o("", !0)
2491
+ ])], 8, Fn)) : r.type === "image" ? (w(), s("img", {
2448
2492
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2449
2493
  src: N(C).getFullscreenImageSource(i, r),
2450
2494
  alt: r.title ?? "",
@@ -2452,10 +2496,10 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2452
2496
  draggable: "false",
2453
2497
  class: v(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", N(h).isImageReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
2454
2498
  ref_for: !0,
2455
- ref: (e) => he(N(C).getItemKey(r), e),
2456
- onLoad: (e) => pe(e, N(C).getItemKey(r), r.url),
2457
- onError: (e) => me(N(C).getItemKey(r), r.url)
2458
- }, null, 42, Rn)) : (w(), s("video", {
2499
+ ref: (e) => me(N(C).getItemKey(r), e),
2500
+ onLoad: (e) => N(L).onFullscreenImageLoad(e, i, r),
2501
+ onError: (e) => N(L).onFullscreenImageError(i, r)
2502
+ }, null, 42, zn)) : (w(), s("video", {
2459
2503
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2460
2504
  class: v(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", N(h).isMediaReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
2461
2505
  playsinline: "",
@@ -2463,26 +2507,26 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2463
2507
  src: N(C).getFullscreenMediaSource(i, r),
2464
2508
  preload: N(C).getFullscreenMediaPreload(i),
2465
2509
  ref_for: !0,
2466
- ref: (e) => ge(N(C).getItemKey(r), e),
2510
+ ref: (e) => he(N(C).getItemKey(r), e),
2467
2511
  onClick: ee((e) => N(h).onVideoClick(e, N(C).getItemKey(r)), ["stop"]),
2468
- onCanplay: (e) => Q(N(C).getItemKey(r), e),
2469
- onDurationchange: (e) => Q(N(C).getItemKey(r), e),
2470
- onEnded: (e) => be(e, N(C).getItemKey(r)),
2471
- onError: (e) => ve(N(C).getItemKey(r), r.url),
2472
- onLoadstart: (e) => Q(N(C).getItemKey(r), e),
2473
- onLoadedmetadata: (e) => Q(N(C).getItemKey(r), e),
2474
- onPause: (e) => Q(N(C).getItemKey(r), e),
2475
- onPlay: (e) => Q(N(C).getItemKey(r), e),
2476
- onPlaying: (e) => Q(N(C).getItemKey(r), e),
2477
- onSeeking: (e) => Q(N(C).getItemKey(r), e),
2478
- onSeeked: (e) => Q(N(C).getItemKey(r), e),
2479
- onStalled: (e) => Q(N(C).getItemKey(r), e),
2480
- onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
2481
- onWaiting: (e) => Q(N(C).getItemKey(r), e)
2482
- }, null, 42, zn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
2512
+ onCanplay: (e) => Q(i, r, e),
2513
+ onDurationchange: (e) => Q(i, r, e),
2514
+ onEnded: (e) => ve(e, i, r),
2515
+ onError: (e) => N(L).onFullscreenMediaError(i, r),
2516
+ onLoadstart: (e) => Q(i, r, e),
2517
+ onLoadedmetadata: (e) => Q(i, r, e),
2518
+ onPause: (e) => Q(i, r, e),
2519
+ onPlay: (e) => Q(i, r, e),
2520
+ onPlaying: (e) => Q(i, r, e),
2521
+ onSeeking: (e) => Q(i, r, e),
2522
+ onSeeked: (e) => Q(i, r, e),
2523
+ onStalled: (e) => Q(i, r, e),
2524
+ onTimeupdate: (e) => Q(i, r, e),
2525
+ onWaiting: (e) => Q(i, r, e)
2526
+ }, null, 42, Bn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
2483
2527
  key: 1,
2484
- class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? te.value : ""])
2485
- }, [c("div", Bn, [
2528
+ class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? V.value : ""])
2529
+ }, [c("div", Vn, [
2486
2530
  c("button", {
2487
2531
  type: "button",
2488
2532
  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]",
@@ -2492,19 +2536,19 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2492
2536
  }, [
2493
2537
  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),
2494
2538
  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),
2495
- c("span", Hn, [k(e.$slots, "item-icon", {
2539
+ c("span", Un, [k(e.$slots, "item-icon", {
2496
2540
  icon: N(Ot)(r.type),
2497
2541
  item: r
2498
2542
  }, () => [(w(), a(A(N(Ot)(r.type)), {
2499
2543
  class: "h-6 w-6 stroke-[1.9]",
2500
2544
  "aria-hidden": "true"
2501
2545
  }))])]),
2502
- c("span", Un, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
2546
+ c("span", Wn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
2503
2547
  class: "h-4 w-4 stroke-2",
2504
2548
  "aria-hidden": "true"
2505
2549
  }))])
2506
- ], 8, Vn),
2507
- N(C).isAssetLoading(i, r) ? (w(), s("div", Wn, [c("span", Gn, [u(N(oe), {
2550
+ ], 8, Hn),
2551
+ N(C).isAssetLoading(i, r) ? (w(), s("div", Gn, [c("span", Kn, [u(N(oe), {
2508
2552
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2509
2553
  "aria-hidden": "true"
2510
2554
  })])])) : o("", !0),
@@ -2517,42 +2561,42 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2517
2561
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2518
2562
  "aria-hidden": "true"
2519
2563
  }),
2520
- c("p", qn, j(N(C).getAssetErrorLabel(r)), 1),
2564
+ c("p", Jn, j(N(C).getAssetErrorLabel(r)), 1),
2521
2565
  N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
2522
2566
  key: 0,
2523
2567
  type: "button",
2524
2568
  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",
2525
2569
  onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
2526
- }, " Retry ", 8, Jn)) : o("", !0)
2527
- ], 8, Kn)], 64)) : o("", !0)
2570
+ }, " Retry ", 8, Yn)) : o("", !0)
2571
+ ], 8, qn)], 64)) : o("", !0)
2528
2572
  ]), (w(), s("audio", {
2529
2573
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2530
2574
  src: N(C).getFullscreenMediaSource(i, r),
2531
2575
  preload: N(C).getFullscreenMediaPreload(i),
2532
2576
  class: "pointer-events-none absolute h-px w-px opacity-0",
2533
2577
  ref_for: !0,
2534
- ref: (e) => _e(N(C).getItemKey(r), e),
2535
- onCanplay: (e) => Q(N(C).getItemKey(r), e),
2536
- onDurationchange: (e) => Q(N(C).getItemKey(r), e),
2537
- onError: (e) => ve(N(C).getItemKey(r), r.url),
2538
- onLoadstart: (e) => Q(N(C).getItemKey(r), e),
2539
- onLoadedmetadata: (e) => Q(N(C).getItemKey(r), e),
2540
- onPause: (e) => Q(N(C).getItemKey(r), e),
2541
- onPlay: (e) => Q(N(C).getItemKey(r), e),
2542
- onPlaying: (e) => Q(N(C).getItemKey(r), e),
2543
- onSeeking: (e) => Q(N(C).getItemKey(r), e),
2544
- onSeeked: (e) => Q(N(C).getItemKey(r), e),
2545
- onStalled: (e) => Q(N(C).getItemKey(r), e),
2546
- onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
2547
- onWaiting: (e) => Q(N(C).getItemKey(r), e)
2548
- }, null, 40, Yn))], 2)) : (w(), s("div", Xn, [c("div", Zn, [k(e.$slots, "item-icon", {
2578
+ ref: (e) => ge(N(C).getItemKey(r), e),
2579
+ onCanplay: (e) => Q(i, r, e),
2580
+ onDurationchange: (e) => Q(i, r, e),
2581
+ onError: (e) => N(L).onFullscreenMediaError(i, r),
2582
+ onLoadstart: (e) => Q(i, r, e),
2583
+ onLoadedmetadata: (e) => Q(i, r, e),
2584
+ onPause: (e) => Q(i, r, e),
2585
+ onPlay: (e) => Q(i, r, e),
2586
+ onPlaying: (e) => Q(i, r, e),
2587
+ onSeeking: (e) => Q(i, r, e),
2588
+ onSeeked: (e) => Q(i, r, e),
2589
+ onStalled: (e) => Q(i, r, e),
2590
+ onTimeupdate: (e) => Q(i, r, e),
2591
+ onWaiting: (e) => Q(i, r, e)
2592
+ }, null, 40, Xn))], 2)) : (w(), s("div", Zn, [c("div", Qn, [k(e.$slots, "item-icon", {
2549
2593
  icon: N(Ot)(r.type),
2550
2594
  item: r
2551
2595
  }, () => [(w(), a(A(N(Ot)(r.type)), {
2552
2596
  class: "h-6 w-6 stroke-[1.9]",
2553
2597
  "aria-hidden": "true"
2554
- }))])])]))], 14, jn))), 128)),
2555
- U.value && f["fullscreen-overlay"] ? (w(), s("div", Qn, [c("div", $n, [k(e.$slots, "fullscreen-overlay", y(p(U.value)))])])) : o("", !0),
2598
+ }))])])]))], 14, Mn))), 128)),
2599
+ W.value && f["fullscreen-overlay"] ? (w(), s("div", $n, [c("div", er, [k(e.$slots, "fullscreen-overlay", y(p(W.value)))])])) : o("", !0),
2556
2600
  N(h).activeItem.value ? (w(), a(Tt, {
2557
2601
  key: 1,
2558
2602
  "current-index": N(h).resolvedActiveIndex.value,
@@ -2563,9 +2607,9 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2563
2607
  title: N(h).activeItem.value.title ?? null,
2564
2608
  total: N(h).items.value.length,
2565
2609
  onBackToList: n[0] ||= (e) => m("back-to-list")
2566
- }, l({ _: 2 }, [re.value && U.value ? {
2610
+ }, l({ _: 2 }, [J.value && W.value ? {
2567
2611
  name: "actions",
2568
- fn: z(() => [k(e.$slots, "fullscreen-header-actions", y(p(U.value)))]),
2612
+ fn: z(() => [k(e.$slots, "fullscreen-header-actions", y(p(W.value)))]),
2569
2613
  key: "0"
2570
2614
  } : void 0]), 1032, [
2571
2615
  "current-index",
@@ -2576,7 +2620,7 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2576
2620
  "title",
2577
2621
  "total"
2578
2622
  ])) : o("", !0),
2579
- R.value ? (w(), a(mt, {
2623
+ B.value ? (w(), a(mt, {
2580
2624
  key: 2,
2581
2625
  "current-time": N(h).activeMediaState.value.currentTime,
2582
2626
  "current-time-label": N(h).formatPlaybackTime(N(h).activeMediaState.value.currentTime),
@@ -2585,7 +2629,7 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2585
2629
  muted: N(h).activeMediaState.value.muted,
2586
2630
  progress: N(h).activeMediaProgress.value,
2587
2631
  volume: N(h).activeMediaState.value.volume,
2588
- "volume-control-layout": B.value,
2632
+ "volume-control-layout": te.value,
2589
2633
  onSeekInput: N(h).onMediaSeekInput,
2590
2634
  onVolumeInput: N(h).onMediaVolumeInput,
2591
2635
  onVolumeToggle: N(h).onMediaVolumeToggle
@@ -2602,36 +2646,36 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2602
2646
  "onVolumeInput",
2603
2647
  "onVolumeToggle"
2604
2648
  ])) : o("", !0),
2605
- G.value ? (w(), s("div", {
2649
+ K.value ? (w(), s("div", {
2606
2650
  key: 3,
2607
- class: v(["absolute left-1/2 z-[4] -translate-x-1/2", L.value])
2608
- }, [ae.value ? k(e.$slots, "fullscreen-status", y(g({ key: 0 }, G.value))) : (w(), s("div", {
2651
+ class: v(["absolute left-1/2 z-[4] -translate-x-1/2", R.value])
2652
+ }, [ue.value ? k(e.$slots, "fullscreen-status", y(g({ key: 0 }, K.value))) : (w(), s("div", {
2609
2653
  key: 1,
2610
2654
  "data-testid": "vibe-fullscreen-status-badge",
2611
- class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", G.value.kind === "end" ? "border-amber-300/35 text-amber-200" : G.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2612
- }, j(G.value.message), 3))], 2)) : o("", !0)
2613
- ])) : V.value ? (w(), s("div", er, [c("div", tr, [c("span", nr, [u(N(oe), {
2655
+ class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", K.value.kind === "end" ? "border-amber-300/35 text-amber-200" : K.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2656
+ }, j(K.value.message), 3))], 2)) : o("", !0)
2657
+ ])) : H.value ? (w(), s("div", tr, [c("div", nr, [c("span", rr, [u(N(oe), {
2614
2658
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2615
2659
  "aria-hidden": "true"
2616
- })]), c("p", rr, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(On, {
2660
+ })]), c("p", ir, j(U.value), 1)])])) : N(Z) && N(X) ? (w(), a(kn, {
2617
2661
  key: 2,
2618
2662
  message: N(X).message,
2619
2663
  mode: N(X).mode,
2620
2664
  surface: N(X).surface
2621
2665
  }, {
2622
- default: z(() => [N(de) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
2666
+ default: z(() => [N(fe) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
2623
2667
  _: 3
2624
2668
  }, 8, [
2625
2669
  "message",
2626
2670
  "mode",
2627
2671
  "surface"
2628
- ])) : o("", !0), N(ue) && N(X) ? (w(), a(On, {
2672
+ ])) : o("", !0), N(de) && N(X) ? (w(), a(kn, {
2629
2673
  key: 3,
2630
2674
  message: N(X).message,
2631
2675
  mode: N(X).mode,
2632
2676
  surface: N(X).surface
2633
2677
  }, {
2634
- default: z(() => [N(de) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
2678
+ default: z(() => [N(fe) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
2635
2679
  _: 3
2636
2680
  }, 8, [
2637
2681
  "message",
@@ -2645,7 +2689,7 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2645
2689
  "leave-from-class": "translate-x-0 opacity-100",
2646
2690
  "leave-to-class": "translate-x-full opacity-0"
2647
2691
  }, {
2648
- default: z(() => [Y.value && U.value ? (w(), s("aside", ir, [c("div", ar, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
2692
+ default: z(() => [ie.value && W.value ? (w(), s("aside", ar, [c("div", or, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
2649
2693
  _: 3
2650
2694
  })], 4),
2651
2695
  u(r, {
@@ -2656,29 +2700,29 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2656
2700
  "leave-from-class": "translate-x-0 opacity-100",
2657
2701
  "leave-to-class": "translate-x-full opacity-0"
2658
2702
  }, {
2659
- default: z(() => [ie.value && U.value ? (w(), s("aside", or, [c("div", sr, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
2703
+ default: z(() => [ae.value && W.value ? (w(), s("aside", sr, [c("div", cr, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
2660
2704
  _: 3
2661
2705
  })
2662
2706
  ]));
2663
2707
  }
2664
- }), dr = 1, fr = .5;
2665
- function pr(e) {
2708
+ }), fr = 1, pr = .5;
2709
+ function mr(e) {
2666
2710
  if (e.type !== "image" && e.type !== "video") return {
2667
- width: dr,
2668
- height: dr,
2711
+ width: fr,
2712
+ height: fr,
2669
2713
  source: "fallback"
2670
2714
  };
2671
2715
  let t = e.preview?.width, n = e.preview?.height;
2672
- if (br(t) && br(n)) {
2673
- let r = xr(e, t, n);
2716
+ if (xr(t) && xr(n)) {
2717
+ let r = Sr(e, t, n);
2674
2718
  return {
2675
2719
  width: r.width,
2676
2720
  height: r.height,
2677
2721
  source: "preview"
2678
2722
  };
2679
2723
  }
2680
- if (br(e.width) && br(e.height)) {
2681
- let t = xr(e, e.width, e.height);
2724
+ if (xr(e.width) && xr(e.height)) {
2725
+ let t = Sr(e, e.width, e.height);
2682
2726
  return {
2683
2727
  width: t.width,
2684
2728
  height: t.height,
@@ -2686,31 +2730,31 @@ function pr(e) {
2686
2730
  };
2687
2731
  }
2688
2732
  return {
2689
- width: dr,
2690
- height: dr,
2733
+ width: fr,
2734
+ height: fr,
2691
2735
  source: "fallback"
2692
2736
  };
2693
2737
  }
2694
- function mr(e, t) {
2738
+ function hr(e, t) {
2695
2739
  return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
2696
2740
  }
2697
- function hr(e, t, n, r = 0) {
2741
+ function gr(e, t, n, r = 0) {
2698
2742
  if (!e || e <= 0 || !t || t <= 0) return n;
2699
2743
  let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
2700
2744
  return !a || a <= 0 ? n : a / t;
2701
2745
  }
2702
- function gr(e, t) {
2703
- let n = pr(e);
2746
+ function _r(e, t) {
2747
+ let n = mr(e);
2704
2748
  return n.height / n.width * t;
2705
2749
  }
2706
- function _r(e, t) {
2750
+ function vr(e, t) {
2707
2751
  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;
2708
2752
  for (let c = 0; c < e.length; c += 1) {
2709
2753
  let l = e[c];
2710
2754
  o.set($(l), c);
2711
2755
  let u = 0;
2712
2756
  for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
2713
- let d = u * (t.columnWidth + t.gapX), f = n[u], p = gr(l, t.columnWidth);
2757
+ let d = u * (t.columnWidth + t.gapX), f = n[u], p = _r(l, t.columnWidth);
2714
2758
  r[c] = {
2715
2759
  x: d,
2716
2760
  y: f
@@ -2729,7 +2773,7 @@ function _r(e, t) {
2729
2773
  indexById: o
2730
2774
  };
2731
2775
  }
2732
- function vr(e) {
2776
+ function yr(e) {
2733
2777
  if (e.itemCount <= 0) return [];
2734
2778
  if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
2735
2779
  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();
@@ -2739,7 +2783,7 @@ function vr(e) {
2739
2783
  }
2740
2784
  return Array.from(a).sort((e, t) => e - t);
2741
2785
  }
2742
- function yr(e, t, n) {
2786
+ function br(e, t, n) {
2743
2787
  let r = /* @__PURE__ */ new Map();
2744
2788
  for (let i of e) {
2745
2789
  let e = t.get($(i));
@@ -2749,11 +2793,11 @@ function yr(e, t, n) {
2749
2793
  }
2750
2794
  return r;
2751
2795
  }
2752
- function br(e) {
2796
+ function xr(e) {
2753
2797
  return typeof e == "number" && Number.isFinite(e) && e > 0;
2754
2798
  }
2755
- function xr(e, t, n) {
2756
- return e.type !== "image" || n / t >= fr ? {
2799
+ function Sr(e, t, n) {
2800
+ return e.type !== "image" || n / t >= pr ? {
2757
2801
  width: t,
2758
2802
  height: n
2759
2803
  } : {
@@ -2763,21 +2807,21 @@ function xr(e, t, n) {
2763
2807
  }
2764
2808
  //#endregion
2765
2809
  //#region src/components/viewer-core/useMasonryMotion.ts
2766
- var Sr = 300, Cr = 600, wr = 40, Tr = 300, Er = 400;
2767
- function Dr(e, t) {
2810
+ var Cr = 300, wr = 600, Tr = 40, Er = 300, Dr = 400;
2811
+ function Or(e, t) {
2768
2812
  return t === "top" ? [...e].reverse() : e;
2769
2813
  }
2770
- function Or(e) {
2771
- return e <= 0 ? Cr : Cr + Math.min((e - 1) * wr, Er);
2814
+ function kr(e) {
2815
+ return e <= 0 ? wr : wr + Math.min((e - 1) * Tr, Dr);
2772
2816
  }
2773
- function kr() {
2774
- return Tr;
2817
+ function Ar() {
2818
+ return Er;
2775
2819
  }
2776
- function Ar(e) {
2820
+ function jr(e) {
2777
2821
  let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
2778
2822
  return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
2779
2823
  }
2780
- function jr(e) {
2824
+ function Mr(e) {
2781
2825
  let t = D(/* @__PURE__ */ new Set()), n = D(/* @__PURE__ */ new Set()), r = D(/* @__PURE__ */ new Map()), a = D(/* @__PURE__ */ new Map()), o = D(/* @__PURE__ */ new Map()), s = D(/* @__PURE__ */ new Set()), c = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Map()), u = D(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
2782
2826
  L(e.visibleIndices, (i) => {
2783
2827
  if (!i.length) return;
@@ -2787,20 +2831,20 @@ function jr(e) {
2787
2831
  !r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
2788
2832
  }
2789
2833
  if (!o.length) return;
2790
- let s = Dr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2791
- for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * wr, Er));
2792
- r.value = c, Mr(() => {
2834
+ let s = Or(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2835
+ for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Tr, Dr));
2836
+ r.value = c, Nr(() => {
2793
2837
  let e = new Set(n.value);
2794
2838
  for (let t of o) e.add(t);
2795
2839
  n.value = e;
2796
- }), Nr(() => {
2840
+ }), Pr(() => {
2797
2841
  let e = new Set(t.value);
2798
2842
  for (let t of o) e.delete(t);
2799
2843
  t.value = e, S(() => {
2800
2844
  let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
2801
2845
  for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
2802
2846
  n.value = e, r.value = t, a.value = i;
2803
- }, Or(o.length));
2847
+ }, kr(o.length));
2804
2848
  });
2805
2849
  }, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
2806
2850
  if (!e.length || !o.value.size) return;
@@ -2827,7 +2871,7 @@ function jr(e) {
2827
2871
  let e = $(t.item);
2828
2872
  p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
2829
2873
  }
2830
- o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Mr(() => {
2874
+ o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Nr(() => {
2831
2875
  let e = new Set(s.value);
2832
2876
  for (let t of p) e.add(t);
2833
2877
  s.value = e;
@@ -2835,9 +2879,9 @@ function jr(e) {
2835
2879
  let e = new Map(o.value), t = new Set(s.value);
2836
2880
  for (let n of p) e.delete(n), t.delete(n);
2837
2881
  o.value = e, s.value = t;
2838
- }, Tr);
2882
+ }, Er);
2839
2883
  }
2840
- function g(t, n, r = Sr) {
2884
+ function g(t, n, r = Cr) {
2841
2885
  if (!t.size) return;
2842
2886
  let i = /* @__PURE__ */ new Map(), a = [];
2843
2887
  for (let [r, o] of t.entries()) {
@@ -2856,8 +2900,8 @@ function jr(e) {
2856
2900
  c.value = i, u.value = /* @__PURE__ */ new Set();
2857
2901
  let o = new Map(l.value);
2858
2902
  for (let e of a) o.set(e, r);
2859
- l.value = o, Mr(() => {
2860
- u.value = new Set(a), Mr(() => {
2903
+ l.value = o, Nr(() => {
2904
+ u.value = new Set(a), Nr(() => {
2861
2905
  c.value = /* @__PURE__ */ new Map();
2862
2906
  });
2863
2907
  }), S(() => {
@@ -2868,8 +2912,8 @@ function jr(e) {
2868
2912
  }, r);
2869
2913
  }
2870
2914
  function _(e) {
2871
- if (n.value.has(e)) return `transform ${Cr}ms ease-out`;
2872
- if (u.value.has(e)) return `transform ${l.value.get(e) ?? Sr}ms ease-out`;
2915
+ if (n.value.has(e)) return `transform ${wr}ms ease-out`;
2916
+ if (u.value.has(e)) return `transform ${l.value.get(e) ?? Cr}ms ease-out`;
2873
2917
  }
2874
2918
  function v(e) {
2875
2919
  if (!n.value.has(e)) return;
@@ -2886,7 +2930,7 @@ function jr(e) {
2886
2930
  } : {
2887
2931
  dx: 0,
2888
2932
  dy: 0
2889
- }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Ar({
2933
+ }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? jr({
2890
2934
  columnWidth: e.columnWidth.value,
2891
2935
  direction: u,
2892
2936
  itemHeight: o,
@@ -2900,14 +2944,14 @@ function jr(e) {
2900
2944
  if (!r) return {
2901
2945
  opacity: "0",
2902
2946
  transform: "translate3d(0, 0, 0) scale(0.96)",
2903
- transition: `opacity ${Tr}ms ease-out, transform ${Tr}ms ease-out`
2947
+ transition: `opacity ${Er}ms ease-out, transform ${Er}ms ease-out`
2904
2948
  };
2905
2949
  let i = s.value.has(n);
2906
2950
  return {
2907
2951
  height: `${r.height}px`,
2908
2952
  opacity: i ? "0" : "1",
2909
2953
  transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
2910
- transition: `opacity ${Tr}ms ease-out, transform ${Tr}ms ease-out`,
2954
+ transition: `opacity ${Er}ms ease-out, transform ${Er}ms ease-out`,
2911
2955
  width: `${e.columnWidth.value}px`
2912
2956
  };
2913
2957
  }
@@ -2928,28 +2972,28 @@ function jr(e) {
2928
2972
  playFlipMoveAnimation: g
2929
2973
  };
2930
2974
  }
2931
- function Mr(e) {
2975
+ function Nr(e) {
2932
2976
  if (typeof requestAnimationFrame == "function") {
2933
2977
  requestAnimationFrame(() => e());
2934
2978
  return;
2935
2979
  }
2936
2980
  setTimeout(e, 0);
2937
2981
  }
2938
- function Nr(e) {
2939
- Mr(() => Mr(e));
2982
+ function Pr(e) {
2983
+ Nr(() => Nr(e));
2940
2984
  }
2941
2985
  //#endregion
2942
2986
  //#region src/components/viewer-core/masonryViewport.ts
2943
- function Pr(e, t) {
2987
+ function Fr(e, t) {
2944
2988
  return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
2945
2989
  }
2946
- function Fr(e, t, n) {
2990
+ function Ir(e, t, n) {
2947
2991
  return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
2948
2992
  }
2949
- function Ir(e, t, n, r) {
2993
+ function Lr(e, t, n, r) {
2950
2994
  return (e?.scrollHeight ?? r) - (t + n);
2951
2995
  }
2952
- function Lr(e, t) {
2996
+ function Rr(e, t) {
2953
2997
  return {
2954
2998
  height: `${e}px`,
2955
2999
  transform: `translate3d(0, ${t}px, 0)`
@@ -2957,8 +3001,8 @@ function Lr(e, t) {
2957
3001
  }
2958
3002
  //#endregion
2959
3003
  //#region src/components/viewer-core/useEdgeBoundary.ts
2960
- var Rr = 250, zr = 1e3;
2961
- function Br(e) {
3004
+ var zr = 250, Br = 1e3;
3005
+ function Vr(e) {
2962
3006
  let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
2963
3007
  x(() => {
2964
3008
  y();
@@ -2974,7 +3018,7 @@ function Br(e) {
2974
3018
  function u(t) {
2975
3019
  if (!b(t) || !e.isAtBoundary()) return;
2976
3020
  let n = Date.now();
2977
- n < s || (s = n + Rr, m());
3021
+ n < s || (s = n + zr, m());
2978
3022
  }
2979
3023
  function d() {
2980
3024
  if (!g()) return;
@@ -3008,7 +3052,7 @@ function Br(e) {
3008
3052
  return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
3009
3053
  }
3010
3054
  function _() {
3011
- o.value = !1, v(zr);
3055
+ o.value = !1, v(Br);
3012
3056
  }
3013
3057
  function v(e) {
3014
3058
  y(), a.value = !0, c = setTimeout(() => {
@@ -3031,42 +3075,42 @@ function Br(e) {
3031
3075
  }
3032
3076
  //#endregion
3033
3077
  //#region src/components/viewer-core/useMasonryList.ts
3034
- var Vr = 600, Hr = 24, Ur = 16, Wr = 300, Gr = 200, Kr = 200, qr = Hr + Ur, Jr = 200, Yr = 300, Xr = 24, Zr = 48, Qr = 500, $r = 1e3;
3035
- function ei(e) {
3036
- let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Wr), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = D(null), p = D(!1), m = i(() => Math.max(Wr, a.value - Hr * 2)), h = i(() => mr(m.value, Wr)), g = i(() => hr(m.value, h.value, Wr, Ur)), v = i(() => ti(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => vr({
3078
+ var Hr = 600, Ur = 24, Wr = 16, Gr = 300, Kr = 200, qr = 200, Jr = Ur + Wr, Yr = 200, Xr = 300, Zr = 24, Qr = 48, $r = 500, ei = 1e3;
3079
+ function ti(e) {
3080
+ let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Gr), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = D(null), p = D(!1), m = i(() => Math.max(Gr, a.value - Ur * 2)), h = i(() => hr(m.value, Gr)), g = i(() => gr(m.value, h.value, Gr, Wr)), v = i(() => ni(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => yr({
3037
3081
  itemCount: e.items.value.length,
3038
3082
  viewportHeight: r.value,
3039
3083
  scrollTop: n.value,
3040
- overscanPx: Gr,
3041
- bucketPx: Vr,
3084
+ overscanPx: Kr,
3085
+ bucketPx: Hr,
3042
3086
  buckets: c.value
3043
3087
  })), b = i(() => y.value.map((t) => ({
3044
3088
  item: e.items.value[t],
3045
3089
  index: t
3046
3090
  }))), C = i(() => {
3047
- let e = l.value + Hr * 2, t = d.value ?? 0;
3048
- return Math.max(e, t, r.value) + Jr;
3049
- }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => ri({
3091
+ let e = l.value + Ur * 2, t = d.value ?? 0;
3092
+ return Math.max(e, t, r.value) + Yr;
3093
+ }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => ii({
3050
3094
  active: e.active.value,
3051
3095
  maxScrollTop: se(),
3052
3096
  progressDistancePx: n.value,
3053
- thresholdPx: Kr,
3097
+ thresholdPx: qr,
3054
3098
  triggerEnabled: w.value
3055
- })), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ni({
3099
+ })), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ri({
3056
3100
  active: e.active.value,
3057
3101
  maxScrollTop: se(),
3058
3102
  progressDistancePx: n.value,
3059
- thresholdPx: qr,
3103
+ thresholdPx: Jr,
3060
3104
  triggerEnabled: e.hasPreviousPage.value
3061
- })), k = i(() => Math.max(0, r.value - Xr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
3105
+ })), k = i(() => Math.max(0, r.value - Zr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
3062
3106
  if (!A.value) return 0;
3063
3107
  let e = r.value / C.value * k.value;
3064
- return Math.min(k.value, Math.max(Zr, e));
3108
+ return Math.min(k.value, Math.max(Qr, e));
3065
3109
  }), M = i(() => {
3066
- if (!A.value) return Xr;
3110
+ if (!A.value) return Zr;
3067
3111
  let e = Math.max(0, C.value - r.value);
3068
- return Xr + Math.max(0, k.value - j.value) * (e > 0 ? ti(n.value / e, 0, 1) : 0);
3069
- }), N = jr({
3112
+ return Zr + Math.max(0, k.value - j.value) * (e > 0 ? ni(n.value / e, 0, 1) : 0);
3113
+ }), N = Mr({
3070
3114
  items: e.items,
3071
3115
  visibleIndices: y,
3072
3116
  positions: o,
@@ -3075,27 +3119,27 @@ function ei(e) {
3075
3119
  columnWidth: g,
3076
3120
  scrollTop: n,
3077
3121
  viewportHeight: r
3078
- }), P = Br({
3122
+ }), P = Vr({
3079
3123
  direction: "top",
3080
3124
  getAnimationLockMs(e) {
3081
- return Math.max(Qr, Or(e)) + $r;
3125
+ return Math.max($r, kr(e)) + ei;
3082
3126
  },
3083
3127
  hasPage: e.hasPreviousPage,
3084
3128
  interactionLocked: p,
3085
3129
  isAtBoundary() {
3086
- return n.value <= qr;
3130
+ return n.value <= Jr;
3087
3131
  },
3088
3132
  loading: e.loading,
3089
3133
  requestPage: e.requestPreviousPage
3090
- }), F = Br({
3134
+ }), F = Vr({
3091
3135
  direction: "bottom",
3092
3136
  getAnimationLockMs(e) {
3093
- return Or(e) + $r;
3137
+ return kr(e) + ei;
3094
3138
  },
3095
3139
  hasPage: w,
3096
3140
  interactionLocked: p,
3097
3141
  isAtBoundary() {
3098
- return oe() <= Kr;
3142
+ return oe() <= qr;
3099
3143
  },
3100
3144
  loading: e.loading,
3101
3145
  requestPage: e.requestNextPage
@@ -3105,7 +3149,7 @@ function ei(e) {
3105
3149
  h,
3106
3150
  g
3107
3151
  ], async ([t], [r = []]) => {
3108
- let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = yr(a, u.value, o.value), l = X(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
3152
+ let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = br(a, u.value, o.value), l = ue(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
3109
3153
  let t = $(e);
3110
3154
  if (f.has(t)) return [];
3111
3155
  let n = c.get(t), r = l.get(t);
@@ -3114,15 +3158,15 @@ function ei(e) {
3114
3158
  item: e,
3115
3159
  position: n
3116
3160
  }];
3117
- }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > Hr + Ur, b = h && n.value > Hr + Ur ? t[v.value] : null, x = b ? $(b) : null;
3118
- y && K(kr() + $r), g && G(), te(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : F.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? Qr : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
3161
+ }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > Ur + Wr, b = h && n.value > Ur + Wr ? t[v.value] : null, x = b ? $(b) : null;
3162
+ y && K(Ar() + ei), g && G(), te(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : F.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? $r : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
3119
3163
  }, { immediate: !0 }), L([
3120
3164
  () => e.pendingAppendItems.value.map((e) => $(e)),
3121
3165
  h,
3122
3166
  g,
3123
3167
  r
3124
3168
  ], ([t]) => {
3125
- de(), t.length && (d.value = le([...e.items.value, ...e.pendingAppendItems.value]), ue());
3169
+ de(), t.length && (d.value = le([...e.items.value, ...e.pendingAppendItems.value]), X());
3126
3170
  }, { immediate: !0 }), L(() => e.active.value, async (e, i) => {
3127
3171
  let a = t.value;
3128
3172
  if (!a) return;
@@ -3132,7 +3176,7 @@ function ei(e) {
3132
3176
  }
3133
3177
  if (i !== !1 || f.value == null) return;
3134
3178
  await _();
3135
- let o = Math.max(0, C.value - r.value), s = ti(f.value, 0, o);
3179
+ let o = Math.max(0, C.value - r.value), s = ni(f.value, 0, o);
3136
3180
  a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
3137
3181
  }), L(() => e.loading.value, async (t) => {
3138
3182
  !t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
@@ -3144,16 +3188,16 @@ function ei(e) {
3144
3188
  I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
3145
3189
  });
3146
3190
  function te() {
3147
- let t = _r(e.items.value, {
3191
+ let t = vr(e.items.value, {
3148
3192
  columnCount: h.value,
3149
3193
  columnWidth: g.value,
3150
- gapX: Ur,
3151
- gapY: Ur,
3152
- bucketPx: Vr
3194
+ gapX: Wr,
3195
+ gapY: Wr,
3196
+ bucketPx: Hr
3153
3197
  });
3154
3198
  o.value = t.positions.map((e) => ({
3155
- x: e.x + Hr,
3156
- y: e.y + Hr
3199
+ x: e.x + Ur,
3200
+ y: e.y + Ur
3157
3201
  })), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
3158
3202
  }
3159
3203
  function V() {
@@ -3178,7 +3222,7 @@ function ei(e) {
3178
3222
  let a = t.value, c = o.value[e], l = s.value[e];
3179
3223
  if (!a || !c || !l) return;
3180
3224
  let u = a.scrollTop, d = Math.max(0, C.value - r.value);
3181
- i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Hr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Hr), a.scrollTop = ti(u, 0, d), n.value = a.scrollTop, q();
3225
+ i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Ur : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Ur), a.scrollTop = ni(u, 0, d), n.value = a.scrollTop, q();
3182
3226
  }
3183
3227
  function ne(e, r) {
3184
3228
  let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
@@ -3211,7 +3255,7 @@ function ei(e) {
3211
3255
  e.setActiveIndex(i);
3212
3256
  }
3213
3257
  function re() {
3214
- let t = n.value <= qr, r = oe() <= Kr;
3258
+ let t = n.value <= Jr, r = oe() <= qr;
3215
3259
  return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
3216
3260
  }
3217
3261
  function J() {
@@ -3221,31 +3265,31 @@ function ei(e) {
3221
3265
  r.value = ie(), a.value = ae();
3222
3266
  }
3223
3267
  function ie() {
3224
- return Pr(t.value, r.value);
3268
+ return Fr(t.value, r.value);
3225
3269
  }
3226
3270
  function ae() {
3227
- return Fr(t.value, a.value, Wr);
3271
+ return Ir(t.value, a.value, Gr);
3228
3272
  }
3229
3273
  function oe() {
3230
- return Ir(t.value, n.value, r.value, C.value);
3274
+ return Lr(t.value, n.value, r.value, C.value);
3231
3275
  }
3232
3276
  function se() {
3233
3277
  let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
3234
3278
  return Math.max(0, e - r.value);
3235
3279
  }
3236
3280
  function ce() {
3237
- return Lr(j.value, M.value);
3281
+ return Rr(j.value, M.value);
3238
3282
  }
3239
3283
  function le(e) {
3240
- return e.length ? _r(e, {
3284
+ return e.length ? vr(e, {
3241
3285
  columnCount: h.value,
3242
3286
  columnWidth: g.value,
3243
- gapX: Ur,
3244
- gapY: Ur,
3245
- bucketPx: Vr
3246
- }).contentHeight + Hr * 2 : 0;
3287
+ gapX: Wr,
3288
+ gapY: Wr,
3289
+ bucketPx: Hr
3290
+ }).contentHeight + Ur * 2 : 0;
3247
3291
  }
3248
- function X(e) {
3292
+ function ue(e) {
3249
3293
  let t = /* @__PURE__ */ new Map();
3250
3294
  for (let n of e) {
3251
3295
  let e = $(n), r = u.value.get(e);
@@ -3255,7 +3299,7 @@ function ei(e) {
3255
3299
  }
3256
3300
  return t;
3257
3301
  }
3258
- function ue() {
3302
+ function X() {
3259
3303
  let t = e.commitPendingAppend.value;
3260
3304
  typeof t == "function" && (z = setTimeout(async () => {
3261
3305
  z = null, ee = !0;
@@ -3265,7 +3309,7 @@ function ei(e) {
3265
3309
  } finally {
3266
3310
  d.value = null, ee = !1;
3267
3311
  }
3268
- }, Yr));
3312
+ }, Xr));
3269
3313
  }
3270
3314
  function de() {
3271
3315
  z &&= (clearTimeout(z), null);
@@ -3292,27 +3336,27 @@ function ei(e) {
3292
3336
  scrollViewportRef: t
3293
3337
  };
3294
3338
  }
3295
- function ti(e, t, n) {
3339
+ function ni(e, t, n) {
3296
3340
  return Math.min(Math.max(e, t), n);
3297
3341
  }
3298
- function ni(e) {
3342
+ function ri(e) {
3299
3343
  if (!e.active || !e.triggerEnabled) return 0;
3300
3344
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3301
- return t <= 0 ? 1 : ti(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3345
+ return t <= 0 ? 1 : ni(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3302
3346
  }
3303
- function ri(e) {
3347
+ function ii(e) {
3304
3348
  if (!e.active || !e.triggerEnabled) return 0;
3305
3349
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3306
- return t <= 0 ? 1 : ti(e.progressDistancePx / t, 0, 1);
3350
+ return t <= 0 ? 1 : ni(e.progressDistancePx / t, 0, 1);
3307
3351
  }
3308
3352
  //#endregion
3309
3353
  //#region src/components/viewer-core/listCardAsset.ts
3310
- function ii(e) {
3354
+ function ai(e) {
3311
3355
  if (e) try {
3312
3356
  e.removeAttribute("src"), e.src = "";
3313
3357
  } catch {}
3314
3358
  }
3315
- function ai(e) {
3359
+ function oi(e) {
3316
3360
  if (e) {
3317
3361
  try {
3318
3362
  e.currentTime = 0;
@@ -3323,12 +3367,12 @@ function ai(e) {
3323
3367
  } catch {}
3324
3368
  }
3325
3369
  }
3326
- function oi(e, t) {
3370
+ function si(e, t) {
3327
3371
  if (t) return e.bottom > t.top && e.top < t.bottom;
3328
3372
  let n = window.innerHeight || document.documentElement.clientHeight || 0;
3329
3373
  return e.bottom > 0 && e.top < n;
3330
3374
  }
3331
- function si(e) {
3375
+ function ci(e) {
3332
3376
  if (!e) return null;
3333
3377
  try {
3334
3378
  return new URL(e, window.location.href).href;
@@ -3338,9 +3382,9 @@ function si(e) {
3338
3382
  }
3339
3383
  //#endregion
3340
3384
  //#region src/components/viewer-core/listPreview.ts
3341
- var ci = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, li = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, ui = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
3342
- function di(e) {
3343
- let t = fi(e), n = t?.url, r = pr(e), i = e.title?.trim() || kt(e.type);
3385
+ var li = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, ui = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, di = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
3386
+ function fi(e) {
3387
+ let t = pi(e), n = t?.url, r = mr(e), i = e.title?.trim() || kt(e.type);
3344
3388
  return t?.mediaType === "video" && typeof n == "string" ? {
3345
3389
  kind: "video",
3346
3390
  url: n,
@@ -3359,13 +3403,13 @@ function di(e) {
3359
3403
  width: r.width,
3360
3404
  height: r.height,
3361
3405
  label: i
3362
- } : typeof n == "string" && mi(e, n) ? {
3406
+ } : typeof n == "string" && hi(e, n) ? {
3363
3407
  kind: "video",
3364
3408
  url: n,
3365
3409
  width: r.width,
3366
3410
  height: r.height,
3367
3411
  label: i
3368
- } : typeof n == "string" && pi(e, n) ? {
3412
+ } : typeof n == "string" && mi(e, n) ? {
3369
3413
  kind: "image",
3370
3414
  url: n,
3371
3415
  width: r.width,
@@ -3379,26 +3423,26 @@ function di(e) {
3379
3423
  label: i
3380
3424
  };
3381
3425
  }
3382
- function fi(e) {
3426
+ function pi(e) {
3383
3427
  return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
3384
3428
  }
3385
- function pi(e, t) {
3386
- return e.type !== "image" || typeof t != "string" ? !1 : ci.test(t) || hi(t);
3387
- }
3388
3429
  function mi(e, t) {
3389
- return e.type !== "video" || typeof t != "string" ? !1 : li.test(t) || gi(t);
3430
+ return e.type !== "image" || typeof t != "string" ? !1 : li.test(t) || gi(t);
3390
3431
  }
3391
- function hi(e) {
3392
- return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
3432
+ function hi(e, t) {
3433
+ return e.type !== "video" || typeof t != "string" ? !1 : ui.test(t) || _i(t);
3393
3434
  }
3394
3435
  function gi(e) {
3395
- return ui.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3436
+ return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
3437
+ }
3438
+ function _i(e) {
3439
+ return di.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3396
3440
  }
3397
3441
  //#endregion
3398
3442
  //#region src/components/viewer-core/useListCardHealthCheck.ts
3399
- function _i(e) {
3443
+ function vi(e) {
3400
3444
  let t = D(null), n = i(() => {
3401
- let t = typeof e.item.value.healthCheck?.url == "string" ? si(e.item.value.healthCheck.url) : null;
3445
+ let t = typeof e.item.value.healthCheck?.url == "string" ? ci(e.item.value.healthCheck.url) : null;
3402
3446
  return !t || t === e.attachedAssetUrl.value ? null : t;
3403
3447
  }), r = null, a = 0, o = /* @__PURE__ */ new Map();
3404
3448
  L(n, (e, n) => {
@@ -3476,14 +3520,14 @@ function _i(e) {
3476
3520
  }
3477
3521
  //#endregion
3478
3522
  //#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
3479
- var vi = ["aria-label"], yi = {
3523
+ var yi = ["aria-label"], bi = {
3480
3524
  key: 0,
3481
3525
  "data-testid": "vibe-list-card-spinner",
3482
3526
  class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
3483
- }, bi = { 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]" }, xi = ["src", "alt"], Si = ["src"], Ci = ["data-kind"], wi = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ti = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Ei = {
3527
+ }, xi = { 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]" }, Si = ["src", "alt"], Ci = ["src"], wi = ["data-kind"], Ti = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ei = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Di = {
3484
3528
  key: 4,
3485
3529
  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))]"
3486
- }, Di = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Oi = { class: "pointer-events-none absolute inset-0 z-[3]" }, ki = /* @__PURE__ */ d({
3530
+ }, Oi = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, ki = { class: "pointer-events-none absolute inset-0 z-[3]" }, Ai = /* @__PURE__ */ d({
3487
3531
  __name: "ListCard",
3488
3532
  props: {
3489
3533
  active: {
@@ -3507,9 +3551,9 @@ var vi = ["aria-label"], yi = {
3507
3551
  },
3508
3552
  emits: ["open"],
3509
3553
  setup(e, { emit: t }) {
3510
- let n = e, r = t, l = i(() => di(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = _i({
3554
+ let n = e, r = t, l = i(() => fi(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = vi({
3511
3555
  attachedAssetUrl: E,
3512
- getPriority: X,
3556
+ getPriority: ue,
3513
3557
  isInView: d,
3514
3558
  isReady: m,
3515
3559
  item: i(() => n.item),
@@ -3551,10 +3595,10 @@ var vi = ["aria-label"], yi = {
3551
3595
  re(), F.release(), te?.disconnect(), te = null;
3552
3596
  });
3553
3597
  function U() {
3554
- ue(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url), J());
3598
+ X(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url), J());
3555
3599
  }
3556
3600
  async function W() {
3557
- if (!ue(_.value)) return;
3601
+ if (!X(_.value)) return;
3558
3602
  let e = E.value ?? n.item.url;
3559
3603
  m.value = !1, g.value = "generic";
3560
3604
  let t = await on(e);
@@ -3567,10 +3611,10 @@ var vi = ["aria-label"], yi = {
3567
3611
  }), J();
3568
3612
  }
3569
3613
  function ne() {
3570
- ue(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url), J(), q());
3614
+ X(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url), J(), q());
3571
3615
  }
3572
3616
  function G() {
3573
- ue(C.value) && (h.value || (m.value = !1));
3617
+ X(C.value) && (h.value || (m.value = !1));
3574
3618
  }
3575
3619
  function K() {
3576
3620
  if (l.value.kind === "fallback") {
@@ -3591,7 +3635,7 @@ var vi = ["aria-label"], yi = {
3591
3635
  }
3592
3636
  V = Mt.request({
3593
3637
  assetType: l.value.kind,
3594
- getPriority: X,
3638
+ getPriority: ue,
3595
3639
  onGrant() {
3596
3640
  T.value = !0, m.value = !1, g.value = null;
3597
3641
  },
@@ -3627,7 +3671,7 @@ var vi = ["aria-label"], yi = {
3627
3671
  d.value = !0;
3628
3672
  return;
3629
3673
  }
3630
- d.value = oi(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
3674
+ d.value = si(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
3631
3675
  }
3632
3676
  function ie(e) {
3633
3677
  if (!e) return;
@@ -3647,12 +3691,12 @@ var vi = ["aria-label"], yi = {
3647
3691
  }), g.value = null, m.value = !1, T.value = !1, J(), K();
3648
3692
  }
3649
3693
  function se() {
3650
- ii(_.value);
3694
+ ai(_.value);
3651
3695
  }
3652
3696
  function ce() {
3653
- ai(C.value);
3697
+ oi(C.value);
3654
3698
  }
3655
- function X() {
3699
+ function ue() {
3656
3700
  let e = y.value;
3657
3701
  if (!e) return Infinity;
3658
3702
  let t = e.getBoundingClientRect();
@@ -3663,9 +3707,9 @@ var vi = ["aria-label"], yi = {
3663
3707
  let n = window.innerHeight / 2;
3664
3708
  return Math.abs((t.top + t.bottom) / 2 - n);
3665
3709
  }
3666
- function ue(e) {
3667
- let t = si(E.value);
3668
- return !e || !t ? !1 : si("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3710
+ function X(e) {
3711
+ let t = ci(E.value);
3712
+ return !e || !t ? !1 : ci("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3669
3713
  }
3670
3714
  function de() {
3671
3715
  r("open");
@@ -3693,8 +3737,8 @@ var vi = ["aria-label"], yi = {
3693
3737
  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]",
3694
3738
  "aria-label": n.item.title || `Open item ${n.index + 1}`,
3695
3739
  onClick: de
3696
- }, null, 8, vi),
3697
- B.value ? (w(), s("div", yi, [c("span", bi, [u(N(oe), {
3740
+ }, null, 8, yi),
3741
+ B.value ? (w(), s("div", bi, [c("span", xi, [u(N(oe), {
3698
3742
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
3699
3743
  "aria-hidden": "true"
3700
3744
  })])])) : o("", !0),
@@ -3708,7 +3752,7 @@ var vi = ["aria-label"], yi = {
3708
3752
  class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
3709
3753
  onLoad: U,
3710
3754
  onError: W
3711
- }, null, 42, xi)) : P.value && E.value && !R.value ? (w(), s("video", {
3755
+ }, null, 42, Si)) : P.value && E.value && !R.value ? (w(), s("video", {
3712
3756
  key: 2,
3713
3757
  ref_key: "videoRef",
3714
3758
  ref: C,
@@ -3724,31 +3768,31 @@ var vi = ["aria-label"], yi = {
3724
3768
  onPlaying: ne,
3725
3769
  onStalled: G,
3726
3770
  onWaiting: G
3727
- }, null, 42, Si)) : R.value ? (w(), s("div", {
3771
+ }, null, 42, Ci)) : R.value ? (w(), s("div", {
3728
3772
  key: 3,
3729
3773
  "data-testid": "vibe-list-card-error",
3730
3774
  "data-kind": I.value,
3731
3775
  class: "pointer-events-none relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
3732
- }, [c("div", wi, [
3776
+ }, [c("div", Ti, [
3733
3777
  u(N(le), {
3734
3778
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3735
3779
  "aria-hidden": "true"
3736
3780
  }),
3737
- c("span", Ti, j(N(rn)(I.value)), 1),
3781
+ c("span", Ei, j(N(rn)(I.value)), 1),
3738
3782
  z.value ? (w(), s("button", {
3739
3783
  key: 0,
3740
3784
  type: "button",
3741
3785
  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",
3742
3786
  onClick: ee(ae, ["stop"])
3743
3787
  }, " Retry ")) : o("", !0)
3744
- ])], 8, Ci)) : (w(), s("div", Ei, [c("div", Di, [k(e.$slots, "item-icon", {
3788
+ ])], 8, wi)) : (w(), s("div", Di, [c("div", Oi, [k(e.$slots, "item-icon", {
3745
3789
  icon: N(Ot)(n.item.type),
3746
3790
  item: n.item
3747
3791
  }, () => [(w(), a(A(N(Ot)(n.item.type)), {
3748
3792
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3749
3793
  "aria-hidden": "true"
3750
3794
  }))])])])),
3751
- c("div", Oi, [k(e.$slots, "grid-item-overlay", {
3795
+ c("div", ki, [k(e.$slots, "grid-item-overlay", {
3752
3796
  active: n.active,
3753
3797
  focused: f.value,
3754
3798
  hovered: p.value,
@@ -3758,24 +3802,24 @@ var vi = ["aria-label"], yi = {
3758
3802
  })])
3759
3803
  ], 34));
3760
3804
  }
3761
- }), Ai = { 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)]" }, ji = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Mi = {
3805
+ }), ji = { 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)]" }, Mi = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Ni = {
3762
3806
  "data-testid": "vibe-pagination",
3763
3807
  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]"
3764
- }, Ni = { class: "whitespace-nowrap" }, Pi = {
3808
+ }, Pi = { class: "whitespace-nowrap" }, Fi = {
3765
3809
  key: 0,
3766
3810
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
3767
- }, Fi = [
3811
+ }, Ii = [
3768
3812
  "data-active",
3769
3813
  "data-index",
3770
3814
  "data-item-id",
3771
3815
  "data-occurrence-key"
3772
- ], Ii = ["data-item-id"], Li = {
3816
+ ], Li = ["data-item-id"], Ri = {
3773
3817
  key: 0,
3774
3818
  class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
3775
- }, Ri = {
3819
+ }, zi = {
3776
3820
  key: 1,
3777
3821
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
3778
- }, zi = { class: "mx-auto flex w-full justify-center" }, Bi = /* @__PURE__ */ d({
3822
+ }, Bi = { class: "mx-auto flex w-full justify-center" }, Vi = /* @__PURE__ */ d({
3779
3823
  __name: "ListSurface",
3780
3824
  props: {
3781
3825
  active: {
@@ -3836,7 +3880,7 @@ var vi = ["aria-label"], yi = {
3836
3880
  "update:activeIndex"
3837
3881
  ],
3838
3882
  setup(e, { emit: n }) {
3839
- let r = e, d = F(), f = n, p = ei({
3883
+ let r = e, d = F(), f = n, p = ti({
3840
3884
  active: M(r, "active"),
3841
3885
  allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
3842
3886
  items: M(r, "items"),
@@ -3881,8 +3925,8 @@ var vi = ["aria-label"], yi = {
3881
3925
  nextBoundaryLoadProgress: e,
3882
3926
  previousBoundaryLoadProgress: t
3883
3927
  });
3884
- }, { immediate: !0 }), (e, n) => (w(), s("div", Ai, [
3885
- c("div", ji, [c("span", Mi, [c("span", Ni, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Pi, j(r.paginationDetail), 1)) : o("", !0)])]),
3928
+ }, { immediate: !0 }), (e, n) => (w(), s("div", ji, [
3929
+ c("div", Mi, [c("span", Ni, [c("span", Pi, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Fi, j(r.paginationDetail), 1)) : o("", !0)])]),
3886
3930
  c("div", {
3887
3931
  ref: N(p).scrollViewportRef,
3888
3932
  "data-testid": "vibe-list-scroll",
@@ -3903,7 +3947,7 @@ var vi = ["aria-label"], yi = {
3903
3947
  "data-occurrence-key": N($)(t),
3904
3948
  class: "absolute will-change-transform",
3905
3949
  style: b(N(p).getCardStyle(n))
3906
- }, [u(ki, {
3950
+ }, [u(Ai, {
3907
3951
  active: n === N(p).resolvedActiveIndex.value,
3908
3952
  index: n,
3909
3953
  item: t,
@@ -3927,14 +3971,14 @@ var vi = ["aria-label"], yi = {
3927
3971
  "report-asset-load",
3928
3972
  "surface-active",
3929
3973
  "onOpen"
3930
- ])], 12, Fi))), 128)),
3974
+ ])], 12, Ii))), 128)),
3931
3975
  (w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
3932
3976
  key: `leaving-${N($)(t.item)}`,
3933
3977
  "data-testid": "vibe-list-card-leaving",
3934
3978
  "data-item-id": t.item.id,
3935
3979
  class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
3936
3980
  style: b(N(p).getLeavingCardStyle(t.item))
3937
- }, [u(ki, {
3981
+ }, [u(Ai, {
3938
3982
  active: !1,
3939
3983
  index: -1,
3940
3984
  item: t.item,
@@ -3949,8 +3993,8 @@ var vi = ["aria-label"], yi = {
3949
3993
  "item",
3950
3994
  "report-asset-error",
3951
3995
  "report-asset-load"
3952
- ])], 12, Ii))), 128)),
3953
- N(A) && N(T) ? (w(), a(On, {
3996
+ ])], 12, Li))), 128)),
3997
+ N(A) && N(T) ? (w(), a(kn, {
3954
3998
  key: 0,
3955
3999
  message: N(T).message,
3956
4000
  mode: N(T).mode,
@@ -3964,12 +4008,12 @@ var vi = ["aria-label"], yi = {
3964
4008
  "surface"
3965
4009
  ])) : o("", !0)
3966
4010
  ], 4)], 544),
3967
- N(p).showScrollbar.value ? (w(), s("div", Li, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
4011
+ N(p).showScrollbar.value ? (w(), s("div", Ri, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3968
4012
  "data-testid": "vibe-list-scrollbar-thumb",
3969
4013
  class: v(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out", r.loading ? "bg-white/52" : "bg-white/34"]),
3970
4014
  style: b(N(p).getScrollbarThumbStyle())
3971
4015
  }, null, 6)])) : o("", !0),
3972
- d["grid-footer"] ? (w(), s("div", Ri, [c("div", zi, [k(e.$slots, "grid-footer")])])) : o("", !0),
4016
+ d["grid-footer"] ? (w(), s("div", zi, [c("div", Bi, [k(e.$slots, "grid-footer")])])) : o("", !0),
3973
4017
  _.value ? (w(), s("div", {
3974
4018
  key: 2,
3975
4019
  class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
@@ -3978,7 +4022,7 @@ var vi = ["aria-label"], yi = {
3978
4022
  "data-testid": "vibe-grid-status-badge",
3979
4023
  class: v(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", _.value.kind === "end" ? "border-amber-300/35 text-amber-200" : _.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
3980
4024
  }, j(_.value.message), 3))], 2)) : o("", !0),
3981
- N(E) && N(T) ? (w(), a(On, {
4025
+ N(E) && N(T) ? (w(), a(kn, {
3982
4026
  key: 3,
3983
4027
  class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
3984
4028
  message: N(T).message,
@@ -3995,13 +4039,13 @@ var vi = ["aria-label"], yi = {
3995
4039
  ])) : o("", !0)
3996
4040
  ]));
3997
4041
  }
3998
- }), Vi = ["data-surface-mode"], Hi = {
4042
+ }), Hi = ["data-surface-mode"], Ui = {
3999
4043
  key: 1,
4000
4044
  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"
4001
- }, Ui = ["data-visible", "inert"], Wi = ["data-visible", "inert"], Gi = {
4045
+ }, Wi = ["data-visible", "inert"], Gi = ["data-visible", "inert"], Ki = {
4002
4046
  key: 3,
4003
4047
  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"
4004
- }, Ki = /* @__PURE__ */ d({
4048
+ }, qi = /* @__PURE__ */ d({
4005
4049
  name: "VibeLayout",
4006
4050
  __name: "Layout",
4007
4051
  props: {
@@ -4036,6 +4080,8 @@ var vi = ["aria-label"], yi = {
4036
4080
  }), n({
4037
4081
  cancel: h.cancel,
4038
4082
  clearRemoved: h.clearRemoved,
4083
+ getItemByOccurrenceKey: h.getItemByOccurrenceKey,
4084
+ getItems: h.getItems,
4039
4085
  getRemovedIds: h.getRemovedIds,
4040
4086
  lockPageLoading: h.lockPageLoading,
4041
4087
  loadNext: h.loadNext,
@@ -4055,7 +4101,7 @@ var vi = ["aria-label"], yi = {
4055
4101
  type: "button",
4056
4102
  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",
4057
4103
  onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
4058
- }, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Hi, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
4104
+ }, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Ui, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
4059
4105
  appear: "",
4060
4106
  "enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
4061
4107
  "enter-from-class": "translate-y-3 opacity-0",
@@ -4069,7 +4115,7 @@ var vi = ["aria-label"], yi = {
4069
4115
  "data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
4070
4116
  inert: N(h).surfaceMode.value !== "list",
4071
4117
  class: "absolute inset-0 z-[2]"
4072
- }, [u(Bi, {
4118
+ }, [u(Vi, {
4073
4119
  active: N(h).surfaceMode.value === "list",
4074
4120
  "allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
4075
4121
  items: N(h).items.value,
@@ -4139,7 +4185,7 @@ var vi = ["aria-label"], yi = {
4139
4185
  "onBoundaryLoadProgress",
4140
4186
  "onOpenFullscreen",
4141
4187
  "onUpdate:activeIndex"
4142
- ])], 8, Ui), [[I, N(h).surfaceMode.value === "list"]])]),
4188
+ ])], 8, Wi), [[I, N(h).surfaceMode.value === "list"]])]),
4143
4189
  _: 3
4144
4190
  }), u(r, {
4145
4191
  appear: "",
@@ -4155,7 +4201,7 @@ var vi = ["aria-label"], yi = {
4155
4201
  "data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
4156
4202
  inert: N(h).surfaceMode.value !== "fullscreen",
4157
4203
  class: "absolute inset-0 z-[3]"
4158
- }, [u(ur, {
4204
+ }, [u(dr, {
4159
4205
  items: N(h).items.value,
4160
4206
  active: N(h).surfaceMode.value === "fullscreen",
4161
4207
  "active-index": N(h).activeIndex.value,
@@ -4224,12 +4270,12 @@ var vi = ["aria-label"], yi = {
4224
4270
  "show-back-to-list",
4225
4271
  "onBackToList",
4226
4272
  "onUpdate:activeIndex"
4227
- ])], 8, Wi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
4273
+ ])], 8, Gi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
4228
4274
  _: 3
4229
- })], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Gi, [u(N(oe), {
4275
+ })], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Ki, [u(N(oe), {
4230
4276
  class: "size-10 animate-spin text-[#f7f1ea]/82",
4231
4277
  "aria-hidden": "true"
4232
- }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(ur, {
4278
+ }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(dr, {
4233
4279
  key: 4,
4234
4280
  items: N(h).items.value,
4235
4281
  active: !0,
@@ -4297,10 +4343,10 @@ var vi = ["aria-label"], yi = {
4297
4343
  "show-status-badges",
4298
4344
  "onBackToList",
4299
4345
  "onUpdate:activeIndex"
4300
- ]))], 8, Vi));
4346
+ ]))], 8, Hi));
4301
4347
  }
4302
- }), qi = { install(e) {
4303
- e.component("VibeLayout", Ki);
4348
+ }), Ji = { install(e) {
4349
+ e.component("VibeLayout", qi);
4304
4350
  } };
4305
4351
  //#endregion
4306
- export { Ki as VibeLayout, qi as VibePlugin, qi as default };
4352
+ export { qi as VibeLayout, Ji as VibePlugin, Ji as default };