@wyxos/vibe 3.1.20 → 3.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/viewer-core/emptyVisiblePrefetch.d.ts +18 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +554 -501
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -180,12 +180,12 @@ var te = (e) => {
|
|
|
180
180
|
}]
|
|
181
181
|
]);
|
|
182
182
|
function fe(e, t = 150) {
|
|
183
|
-
return
|
|
183
|
+
return Z(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
return
|
|
185
|
+
function pe(e, t = 150) {
|
|
186
|
+
return Z(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function Z(e, t, n) {
|
|
189
189
|
let r = [], i = /* @__PURE__ */ new Set(), a = null;
|
|
190
190
|
function o(e) {
|
|
191
191
|
let o = t(e);
|
|
@@ -504,15 +504,57 @@ function qe(e, t) {
|
|
|
504
504
|
return e.slice(n, r + 1);
|
|
505
505
|
}
|
|
506
506
|
//#endregion
|
|
507
|
+
//#region src/components/viewer-core/emptyVisiblePrefetch.ts
|
|
508
|
+
function Je(e) {
|
|
509
|
+
let t = null, n = !1, r = !1;
|
|
510
|
+
function i() {
|
|
511
|
+
t = null;
|
|
512
|
+
}
|
|
513
|
+
function a() {
|
|
514
|
+
r || n || (r = !0, _().then(o));
|
|
515
|
+
}
|
|
516
|
+
async function o() {
|
|
517
|
+
if (r = !1, s()) {
|
|
518
|
+
if (!e.hasNextPage.value) {
|
|
519
|
+
let e = c();
|
|
520
|
+
if (t === e) return;
|
|
521
|
+
t = e;
|
|
522
|
+
}
|
|
523
|
+
n = !0;
|
|
524
|
+
try {
|
|
525
|
+
await e.prefetchNextPage();
|
|
526
|
+
} finally {
|
|
527
|
+
n = !1, s() && a();
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function s() {
|
|
532
|
+
return !e.items.value.length && !e.loading.value && !e.isInitialLoading() && !e.isPageLoadingLocked.value && (e.hasNextPage.value || e.canRefreshTrailingBoundary.value);
|
|
533
|
+
}
|
|
534
|
+
function c() {
|
|
535
|
+
let t = e.trailingBoundaryBucket.value;
|
|
536
|
+
return [
|
|
537
|
+
t?.cursor ?? "",
|
|
538
|
+
t?.nextCursor ?? "",
|
|
539
|
+
t?.items.map((e) => e.id).join("") ?? "",
|
|
540
|
+
e.removedIds.value.size
|
|
541
|
+
].join("");
|
|
542
|
+
}
|
|
543
|
+
return {
|
|
544
|
+
resetRefreshAttempt: i,
|
|
545
|
+
schedule: a
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
//#endregion
|
|
507
549
|
//#region src/components/viewer-core/fillDelay.ts
|
|
508
|
-
var
|
|
509
|
-
function
|
|
550
|
+
var Ye = 2e3, Xe = 1e3, Ze = 100;
|
|
551
|
+
function Qe(e, t = Ye, n = Xe) {
|
|
510
552
|
return t + Math.max(0, e - 1) * n;
|
|
511
553
|
}
|
|
512
|
-
function
|
|
554
|
+
function $e(e, t) {
|
|
513
555
|
return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
|
|
514
556
|
}
|
|
515
|
-
function
|
|
557
|
+
function et() {
|
|
516
558
|
let e = D(null), t = null, n = null, r = null;
|
|
517
559
|
function i(i = !1) {
|
|
518
560
|
if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
|
|
@@ -530,7 +572,7 @@ function $e() {
|
|
|
530
572
|
let t = Math.max(0, a - (Date.now() - s));
|
|
531
573
|
e.value = t, t <= 0 && l();
|
|
532
574
|
};
|
|
533
|
-
t = setInterval(u,
|
|
575
|
+
t = setInterval(u, Ze), n = setTimeout(l, a), u();
|
|
534
576
|
}));
|
|
535
577
|
}
|
|
536
578
|
return {
|
|
@@ -541,26 +583,34 @@ function $e() {
|
|
|
541
583
|
}
|
|
542
584
|
//#endregion
|
|
543
585
|
//#region src/components/viewer-core/useAutoResolveSource.ts
|
|
544
|
-
function
|
|
545
|
-
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 =
|
|
586
|
+
function tt(e) {
|
|
587
|
+
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 = et(), 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(() => $e(e.fillDelayMs, Ye)), T = i(() => $e(e.fillDelayStepMs, Xe)), 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(() => Ve(n.value, e.removedIds.value)), P = i(() => He(n.value, e.removedIds.value)), F = i(() => P.value?.nextCursor ?? null), I = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!F.value && P.value?.nextCursorExhausted !== !0), z = i(() => !!I.value), B = i(() => E.value && !!P.value?.items.length), 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), H = Je({
|
|
588
|
+
canRefreshTrailingBoundary: B,
|
|
589
|
+
hasNextPage: R,
|
|
590
|
+
isInitialLoading: he,
|
|
591
|
+
isPageLoadingLocked: g,
|
|
592
|
+
items: A,
|
|
593
|
+
loading: M,
|
|
594
|
+
prefetchNextPage: W,
|
|
595
|
+
removedIds: e.removedIds,
|
|
596
|
+
trailingBoundaryBucket: P
|
|
597
|
+
});
|
|
546
598
|
L(() => A.value.length, (e) => {
|
|
547
599
|
if (e === 0) {
|
|
548
|
-
r.value = 0;
|
|
600
|
+
r.value = 0, H.schedule();
|
|
549
601
|
return;
|
|
550
602
|
}
|
|
551
|
-
o.value &&= (
|
|
603
|
+
H.resetRefreshAttempt(), o.value &&= (be(), !1), r.value > e - 1 && (r.value = e - 1);
|
|
552
604
|
}), L(() => r.value, () => {
|
|
553
|
-
h.value &&
|
|
554
|
-
}), L(() => F.value, (e) => {
|
|
555
|
-
e && !A.value.length && c.value === "idle" && ce();
|
|
605
|
+
h.value && le();
|
|
556
606
|
}), S(() => {
|
|
557
|
-
|
|
607
|
+
me() || e.resolve && U();
|
|
558
608
|
}), x(() => {
|
|
559
609
|
v?.abort(), v = null, d.clear(!0);
|
|
560
610
|
});
|
|
561
|
-
async function
|
|
562
|
-
y =
|
|
563
|
-
let t = await
|
|
611
|
+
async function U() {
|
|
612
|
+
y = U;
|
|
613
|
+
let t = await fe({
|
|
564
614
|
continueUntilFilled: !0,
|
|
565
615
|
cursor: e.initialCursor ?? null,
|
|
566
616
|
direction: "forward",
|
|
@@ -568,83 +618,83 @@ function et(e) {
|
|
|
568
618
|
});
|
|
569
619
|
t && (n.value = t.buckets, r.value = 0, Z());
|
|
570
620
|
}
|
|
571
|
-
async function
|
|
621
|
+
async function W() {
|
|
572
622
|
if (g.value || M.value) return;
|
|
573
623
|
let e = !A.value.length, t = P.value, n = {
|
|
574
624
|
commitImmediately: e,
|
|
575
625
|
originCursor: t?.cursor ?? null
|
|
576
626
|
}, r = Ue(t);
|
|
577
|
-
if (
|
|
627
|
+
if (ye("trailing")) {
|
|
578
628
|
if (!B.value) return;
|
|
579
|
-
let e = await
|
|
580
|
-
e?.followCursor && (e.itemsInserted === 0 ||
|
|
629
|
+
let e = await de("trailing");
|
|
630
|
+
e?.followCursor && (e.itemsInserted === 0 || ye("trailing")) && await ue(e.followCursor, n);
|
|
581
631
|
return;
|
|
582
632
|
}
|
|
583
633
|
if (r) {
|
|
584
634
|
if (t?.cursor === r) {
|
|
585
|
-
let e = await
|
|
586
|
-
e?.followCursor && e.itemsInserted === 0 && await
|
|
635
|
+
let e = await de("trailing");
|
|
636
|
+
e?.followCursor && e.itemsInserted === 0 && await ue(e.followCursor, n);
|
|
587
637
|
return;
|
|
588
638
|
}
|
|
589
|
-
await
|
|
639
|
+
await ue(r, n);
|
|
590
640
|
return;
|
|
591
641
|
}
|
|
592
642
|
if (!R.value) {
|
|
593
|
-
let e = B.value ? await
|
|
594
|
-
e?.followCursor && e.itemsInserted === 0 && await
|
|
643
|
+
let e = B.value ? await de("trailing") : null;
|
|
644
|
+
e?.followCursor && e.itemsInserted === 0 && await ue(e.followCursor, n);
|
|
595
645
|
return;
|
|
596
646
|
}
|
|
597
|
-
await
|
|
647
|
+
await ue(F.value, n);
|
|
598
648
|
}
|
|
599
|
-
async function
|
|
649
|
+
async function ne() {
|
|
600
650
|
if (!(g.value || !z.value || M.value)) {
|
|
601
|
-
if (
|
|
602
|
-
let e = await
|
|
603
|
-
e?.itemsInserted === 0 && e.followCursor && await
|
|
651
|
+
if (ye("leading")) {
|
|
652
|
+
let e = await de("leading");
|
|
653
|
+
e?.itemsInserted === 0 && e.followCursor && await X(e.followCursor);
|
|
604
654
|
return;
|
|
605
655
|
}
|
|
606
|
-
await
|
|
656
|
+
await X(I.value);
|
|
607
657
|
}
|
|
608
658
|
}
|
|
609
|
-
async function
|
|
659
|
+
async function G() {
|
|
610
660
|
if (V.value) {
|
|
611
|
-
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = E.value ? "initializing" : "idle", l.value = null, u.value = null, p.value = null, m.value = !1, _.clear(), v?.abort(), v = null, d.clear(!0),
|
|
661
|
+
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = E.value ? "initializing" : "idle", l.value = null, u.value = null, p.value = null, m.value = !1, _.clear(), v?.abort(), v = null, d.clear(!0), me()) {
|
|
612
662
|
Z();
|
|
613
663
|
return;
|
|
614
664
|
}
|
|
615
|
-
await
|
|
665
|
+
await U();
|
|
616
666
|
}
|
|
617
667
|
}
|
|
618
|
-
async function
|
|
619
|
-
if (V.value) return
|
|
668
|
+
async function K() {
|
|
669
|
+
if (V.value) return G();
|
|
620
670
|
g.value || c.value !== "failed" || !y || (s.value = null, await y());
|
|
621
671
|
}
|
|
622
|
-
async function
|
|
672
|
+
async function q() {
|
|
623
673
|
if (!a.value.length) return m.value = !1, Z();
|
|
624
674
|
n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Z();
|
|
625
675
|
}
|
|
626
|
-
function
|
|
676
|
+
function re(t) {
|
|
627
677
|
let n = A.value;
|
|
628
678
|
if (!n.length) return;
|
|
629
679
|
let i = ve(t, 0, n.length - 1);
|
|
630
680
|
i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
|
|
631
681
|
}
|
|
632
|
-
function
|
|
633
|
-
h.value = e;
|
|
634
|
-
}
|
|
635
|
-
function J() {
|
|
636
|
-
g.value = !0, d.clear(!0);
|
|
682
|
+
function J(e) {
|
|
683
|
+
h.value = e, H.schedule();
|
|
637
684
|
}
|
|
638
685
|
function Y() {
|
|
639
|
-
g.value = !
|
|
686
|
+
g.value = !0, d.clear(!0);
|
|
640
687
|
}
|
|
641
688
|
function ie() {
|
|
642
|
-
|
|
689
|
+
g.value = !1, H.schedule();
|
|
643
690
|
}
|
|
644
691
|
function ae() {
|
|
692
|
+
b += 1, v?.abort(), v = null, d.clear(!0), _.clear(), s.value = null, l.value = null, u.value = null, p.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), m.value = !1, o.value = !1, Z();
|
|
693
|
+
}
|
|
694
|
+
function oe() {
|
|
645
695
|
return Re(A.value, j.value);
|
|
646
696
|
}
|
|
647
|
-
function
|
|
697
|
+
function se(e = null, t = {}) {
|
|
648
698
|
if (A.value.length === 0) {
|
|
649
699
|
r.value = 0, !t.preserveTrailingPlaceholder && n.value.length > 0 && (o.value = !0);
|
|
650
700
|
return;
|
|
@@ -662,23 +712,23 @@ function et(e) {
|
|
|
662
712
|
}
|
|
663
713
|
r.value = ze(A.value, j.value, e);
|
|
664
714
|
}
|
|
665
|
-
function
|
|
666
|
-
a.value.length > 0 && (!ee.value.length || !A.value.length) &&
|
|
715
|
+
function ce() {
|
|
716
|
+
a.value.length > 0 && (!ee.value.length || !A.value.length) && q();
|
|
667
717
|
}
|
|
668
|
-
async function
|
|
669
|
-
if (!(!h.value ||
|
|
718
|
+
async function le() {
|
|
719
|
+
if (!(!h.value || he())) {
|
|
670
720
|
if (!A.value.length) {
|
|
671
|
-
(R.value || B.value) && await
|
|
721
|
+
(R.value || B.value) && await W();
|
|
672
722
|
return;
|
|
673
723
|
}
|
|
674
|
-
z.value && r.value < 3 && await
|
|
724
|
+
z.value && r.value < 3 && await ne(), R.value && r.value >= A.value.length - 3 && await W();
|
|
675
725
|
}
|
|
676
726
|
}
|
|
677
|
-
async function
|
|
727
|
+
async function ue(e, t = {}) {
|
|
678
728
|
y = async () => {
|
|
679
|
-
await
|
|
729
|
+
await ue(e, t);
|
|
680
730
|
};
|
|
681
|
-
let r = await
|
|
731
|
+
let r = await fe({
|
|
682
732
|
continueUntilFilled: !0,
|
|
683
733
|
cursor: e,
|
|
684
734
|
direction: "forward",
|
|
@@ -687,27 +737,27 @@ function et(e) {
|
|
|
687
737
|
if (r) {
|
|
688
738
|
if (!r.visibleCount) return n.value = We(n.value, t.originCursor, e, !0), a.value = [], m.value = !1, Z();
|
|
689
739
|
if (r.canceled) return n.value = [...n.value, ...r.buckets], a.value = [], m.value = !1, Z();
|
|
690
|
-
if (a.value = r.buckets, t.commitImmediately || !ee.value.length) return n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Z();
|
|
740
|
+
if (a.value = r.buckets, t.commitImmediately || !A.value.length || !ee.value.length) return n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Z();
|
|
691
741
|
m.value = !0;
|
|
692
742
|
}
|
|
693
743
|
}
|
|
694
|
-
async function
|
|
744
|
+
async function X(e) {
|
|
695
745
|
y = async () => {
|
|
696
|
-
await
|
|
746
|
+
await X(e);
|
|
697
747
|
};
|
|
698
|
-
let t = await
|
|
748
|
+
let t = await fe({
|
|
699
749
|
continueUntilFilled: !0,
|
|
700
750
|
cursor: e,
|
|
701
751
|
direction: "backward",
|
|
702
752
|
phase: "loading"
|
|
703
753
|
});
|
|
704
754
|
if (!t) return;
|
|
705
|
-
let r =
|
|
706
|
-
n.value = [...t.buckets, ...n.value],
|
|
755
|
+
let r = oe();
|
|
756
|
+
n.value = [...t.buckets, ...n.value], se(r), Z();
|
|
707
757
|
}
|
|
708
|
-
async function
|
|
758
|
+
async function de(t) {
|
|
709
759
|
if (y = async () => {
|
|
710
|
-
await
|
|
760
|
+
await de(t);
|
|
711
761
|
}, !e.resolve) return null;
|
|
712
762
|
let r = t === "leading" ? N.value : P.value;
|
|
713
763
|
if (!r) return null;
|
|
@@ -733,8 +783,8 @@ function et(e) {
|
|
|
733
783
|
sequence: C
|
|
734
784
|
});
|
|
735
785
|
C = c.nextSequence;
|
|
736
|
-
let l =
|
|
737
|
-
return n.value = ke(n.value, r.cursor, c.bucket),
|
|
786
|
+
let l = oe();
|
|
787
|
+
return n.value = ke(n.value, r.cursor, c.bucket), se(l), Z(), {
|
|
738
788
|
followCursor: t === "leading" ? i.previousPage ?? null : i.nextPage,
|
|
739
789
|
itemsInserted: c.insertedCount
|
|
740
790
|
};
|
|
@@ -744,7 +794,7 @@ function et(e) {
|
|
|
744
794
|
v === o && (v = null), _.delete(i);
|
|
745
795
|
}
|
|
746
796
|
}
|
|
747
|
-
async function
|
|
797
|
+
async function fe(t) {
|
|
748
798
|
if (!e.resolve) return null;
|
|
749
799
|
let n = ++b, r = /* @__PURE__ */ new Set(), i = [], a = t.cursor, o = 0;
|
|
750
800
|
for (s.value = null, c.value = t.phase, l.value = null, u.value = null, p.value = null;;) {
|
|
@@ -762,7 +812,7 @@ function et(e) {
|
|
|
762
812
|
signal: m?.signal
|
|
763
813
|
});
|
|
764
814
|
if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
765
|
-
let s = Ge(t.direction, a, r.nextPage), f =
|
|
815
|
+
let s = Ge(t.direction, a, r.nextPage), f = pe({
|
|
766
816
|
cursor: a,
|
|
767
817
|
nextCursor: s.cursor,
|
|
768
818
|
nextCursorExhausted: s.exhausted,
|
|
@@ -779,7 +829,7 @@ function et(e) {
|
|
|
779
829
|
};
|
|
780
830
|
if (g.value) return Ie(i, t.direction, e.removedIds.value, !1);
|
|
781
831
|
c.value = "filling", l.value = h, u.value = _, p.value = O.value, o += 1;
|
|
782
|
-
let v =
|
|
832
|
+
let v = Qe(o, w.value, T.value);
|
|
783
833
|
if (await d.wait(v), n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
784
834
|
a = _;
|
|
785
835
|
} catch (r) {
|
|
@@ -790,7 +840,7 @@ function et(e) {
|
|
|
790
840
|
}
|
|
791
841
|
return Ie(i, t.direction, e.removedIds.value, !1);
|
|
792
842
|
}
|
|
793
|
-
function
|
|
843
|
+
function pe(e) {
|
|
794
844
|
let t = Pe({
|
|
795
845
|
cursor: e.cursor,
|
|
796
846
|
nextCursor: e.nextCursor,
|
|
@@ -803,9 +853,9 @@ function et(e) {
|
|
|
803
853
|
return C = t.nextSequence, t.bucket;
|
|
804
854
|
}
|
|
805
855
|
function Z() {
|
|
806
|
-
c.value = "idle", l.value = null, u.value = null, p.value = null, d.clear();
|
|
856
|
+
c.value = "idle", l.value = null, u.value = null, p.value = null, d.clear(), H.schedule();
|
|
807
857
|
}
|
|
808
|
-
function
|
|
858
|
+
function me() {
|
|
809
859
|
if (!e.initialState || !e.initialState.items.length) return !1;
|
|
810
860
|
let t = Le({
|
|
811
861
|
initialState: e.initialState,
|
|
@@ -814,21 +864,21 @@ function et(e) {
|
|
|
814
864
|
});
|
|
815
865
|
return n.value = t.buckets, r.value = t.activeIndex, C = t.nextSequence, o.value = !1, s.value = null, a.value = [], m.value = !1, !0;
|
|
816
866
|
}
|
|
817
|
-
function
|
|
867
|
+
function he() {
|
|
818
868
|
return c.value === "initializing";
|
|
819
869
|
}
|
|
820
|
-
function
|
|
870
|
+
function ye(t) {
|
|
821
871
|
return Be(t === "leading" ? N.value : P.value, e.removedIds.value, O.value);
|
|
822
872
|
}
|
|
823
|
-
function
|
|
873
|
+
function be() {
|
|
824
874
|
n.value = qe(n.value, e.removedIds.value);
|
|
825
875
|
}
|
|
826
876
|
return {
|
|
827
877
|
activeIndex: j,
|
|
828
878
|
canRetryInitialLoad: V,
|
|
829
|
-
cancel:
|
|
879
|
+
cancel: ae,
|
|
830
880
|
canRefreshTrailingBoundary: B,
|
|
831
|
-
commitPendingAppend:
|
|
881
|
+
commitPendingAppend: q,
|
|
832
882
|
currentCursor: te,
|
|
833
883
|
errorMessage: s,
|
|
834
884
|
fillCollectedCount: l,
|
|
@@ -840,29 +890,29 @@ function et(e) {
|
|
|
840
890
|
isAutoPrefetchEnabled: h,
|
|
841
891
|
isPageLoadingLocked: g,
|
|
842
892
|
items: A,
|
|
843
|
-
lockPageLoading:
|
|
893
|
+
lockPageLoading: Y,
|
|
844
894
|
loading: M,
|
|
845
|
-
maybePrefetchAround:
|
|
895
|
+
maybePrefetchAround: le,
|
|
846
896
|
nextCursor: F,
|
|
847
897
|
pendingAppendItems: ee,
|
|
848
898
|
phase: c,
|
|
849
|
-
prefetchNextPage:
|
|
850
|
-
prefetchPreviousPage:
|
|
899
|
+
prefetchNextPage: W,
|
|
900
|
+
prefetchPreviousPage: ne,
|
|
851
901
|
previousCursor: I,
|
|
852
|
-
retryInitialLoad:
|
|
853
|
-
retry:
|
|
854
|
-
setActiveIndex:
|
|
855
|
-
setAutoPrefetchEnabled:
|
|
856
|
-
syncActiveIndexAfterVisibilityChange:
|
|
857
|
-
unlockPageLoading:
|
|
858
|
-
getActiveOccurrenceKey:
|
|
859
|
-
maybeCommitPendingAppendWhenFilteredOut:
|
|
902
|
+
retryInitialLoad: G,
|
|
903
|
+
retry: K,
|
|
904
|
+
setActiveIndex: re,
|
|
905
|
+
setAutoPrefetchEnabled: J,
|
|
906
|
+
syncActiveIndexAfterVisibilityChange: se,
|
|
907
|
+
unlockPageLoading: ie,
|
|
908
|
+
getActiveOccurrenceKey: oe,
|
|
909
|
+
maybeCommitPendingAppendWhenFilteredOut: ce
|
|
860
910
|
};
|
|
861
911
|
}
|
|
862
912
|
//#endregion
|
|
863
913
|
//#region src/components/viewer-core/useDataSource.ts
|
|
864
|
-
function
|
|
865
|
-
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = Se(), l =
|
|
914
|
+
function nt(e, t) {
|
|
915
|
+
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = Se(), l = tt({
|
|
866
916
|
emit: t,
|
|
867
917
|
fillDelayMs: e.fillDelayMs,
|
|
868
918
|
fillDelayStepMs: e.fillDelayStepMs,
|
|
@@ -871,54 +921,57 @@ function tt(e, t) {
|
|
|
871
921
|
pageSize: e.pageSize,
|
|
872
922
|
removedIds: o,
|
|
873
923
|
resolve: e.resolve
|
|
874
|
-
}), 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),
|
|
875
|
-
function
|
|
924
|
+
}), 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), v = i(() => !l.hasNextPage.value && l.canRefreshTrailingBoundary.value);
|
|
925
|
+
function y(e) {
|
|
876
926
|
let t = u.value;
|
|
877
|
-
t.length && l.setActiveIndex(
|
|
927
|
+
t.length && l.setActiveIndex(D(e, 0, t.length - 1));
|
|
878
928
|
}
|
|
879
|
-
function
|
|
929
|
+
function b(e) {
|
|
880
930
|
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);
|
|
881
|
-
return s.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t, { preserveTrailingPlaceholder: o }),
|
|
931
|
+
return s.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t, { preserveTrailingPlaceholder: o }), i && x(), s) : s;
|
|
882
932
|
}
|
|
883
|
-
function
|
|
933
|
+
function x() {
|
|
934
|
+
_().then(() => l.maybePrefetchAround());
|
|
935
|
+
}
|
|
936
|
+
function S(e) {
|
|
884
937
|
let t = l.getActiveOccurrenceKey(), n = s(e);
|
|
885
938
|
return n.ids.length && l.syncActiveIndexAfterVisibilityChange(t), n;
|
|
886
939
|
}
|
|
887
|
-
function
|
|
940
|
+
function C() {
|
|
888
941
|
let e = l.getActiveOccurrenceKey(), t = c();
|
|
889
942
|
return t?.ids.length && l.syncActiveIndexAfterVisibilityChange(e), t;
|
|
890
943
|
}
|
|
891
|
-
function
|
|
944
|
+
function w() {
|
|
892
945
|
let e = l.getActiveOccurrenceKey();
|
|
893
946
|
n(), l.syncActiveIndexAfterVisibilityChange(e);
|
|
894
947
|
}
|
|
895
|
-
function
|
|
948
|
+
function T() {
|
|
896
949
|
return [...u.value];
|
|
897
950
|
}
|
|
898
|
-
function
|
|
951
|
+
function E(e) {
|
|
899
952
|
return u.value.find((t) => $(t) === e) ?? null;
|
|
900
953
|
}
|
|
901
|
-
function
|
|
954
|
+
function D(e, t, n) {
|
|
902
955
|
return Math.min(Math.max(e, t), n);
|
|
903
956
|
}
|
|
904
|
-
function
|
|
957
|
+
function O() {
|
|
905
958
|
l.cancel();
|
|
906
959
|
}
|
|
907
|
-
async function
|
|
960
|
+
async function k() {
|
|
908
961
|
await l.prefetchNextPage();
|
|
909
962
|
}
|
|
910
|
-
async function
|
|
963
|
+
async function A() {
|
|
911
964
|
await l.prefetchPreviousPage();
|
|
912
965
|
}
|
|
913
|
-
async function
|
|
966
|
+
async function j() {
|
|
914
967
|
await l.retry();
|
|
915
968
|
}
|
|
916
969
|
return {
|
|
917
970
|
activeIndex: d,
|
|
918
|
-
canRefreshExhaustedNextPage:
|
|
971
|
+
canRefreshExhaustedNextPage: v,
|
|
919
972
|
canRetryInitialLoad: l.canRetryInitialLoad,
|
|
920
|
-
cancel:
|
|
921
|
-
clearRemoved:
|
|
973
|
+
cancel: O,
|
|
974
|
+
clearRemoved: w,
|
|
922
975
|
commitPendingAppend: l.commitPendingAppend,
|
|
923
976
|
currentCursor: l.currentCursor,
|
|
924
977
|
errorMessage: l.errorMessage,
|
|
@@ -926,8 +979,8 @@ function tt(e, t) {
|
|
|
926
979
|
fillCursor: l.fillCursor,
|
|
927
980
|
fillDelayRemainingMs: l.fillDelayRemainingMs,
|
|
928
981
|
fillTargetCount: l.fillTargetCount,
|
|
929
|
-
getItemByOccurrenceKey:
|
|
930
|
-
getItems:
|
|
982
|
+
getItemByOccurrenceKey: E,
|
|
983
|
+
getItems: T,
|
|
931
984
|
getRemovedIds: r,
|
|
932
985
|
hasNextPage: p,
|
|
933
986
|
hasPreviousPage: m,
|
|
@@ -935,8 +988,8 @@ function tt(e, t) {
|
|
|
935
988
|
items: u,
|
|
936
989
|
lockPageLoading: l.lockPageLoading,
|
|
937
990
|
loading: f,
|
|
938
|
-
loadNext:
|
|
939
|
-
loadPrevious:
|
|
991
|
+
loadNext: k,
|
|
992
|
+
loadPrevious: A,
|
|
940
993
|
nextCursor: l.nextCursor,
|
|
941
994
|
paginationDetail: g,
|
|
942
995
|
pendingAppendItems: l.pendingAppendItems,
|
|
@@ -945,21 +998,21 @@ function tt(e, t) {
|
|
|
945
998
|
prefetchPreviousPage: l.prefetchPreviousPage,
|
|
946
999
|
previousCursor: l.previousCursor,
|
|
947
1000
|
removedCount: h,
|
|
948
|
-
remove:
|
|
949
|
-
restore:
|
|
950
|
-
retry:
|
|
1001
|
+
remove: b,
|
|
1002
|
+
restore: S,
|
|
1003
|
+
retry: j,
|
|
951
1004
|
retryInitialLoad: l.retryInitialLoad,
|
|
952
|
-
setActiveIndex:
|
|
1005
|
+
setActiveIndex: y,
|
|
953
1006
|
setAutoPrefetchEnabled: l.setAutoPrefetchEnabled,
|
|
954
|
-
undo:
|
|
1007
|
+
undo: C,
|
|
955
1008
|
unlockPageLoading: l.unlockPageLoading
|
|
956
1009
|
};
|
|
957
1010
|
}
|
|
958
1011
|
//#endregion
|
|
959
1012
|
//#region src/components/viewer-core/useController.ts
|
|
960
|
-
var
|
|
961
|
-
function
|
|
962
|
-
let n =
|
|
1013
|
+
var rt = 1024;
|
|
1014
|
+
function it(e, t) {
|
|
1015
|
+
let n = nt(e, t), r = T({
|
|
963
1016
|
nextBoundaryLoadProgress: 0,
|
|
964
1017
|
previousBoundaryLoadProgress: 0
|
|
965
1018
|
}), a = D(0), o = D("list"), s = T({
|
|
@@ -983,7 +1036,7 @@ function rt(e, t) {
|
|
|
983
1036
|
removedCount: 0,
|
|
984
1037
|
removedIds: [],
|
|
985
1038
|
surfaceMode: "list"
|
|
986
|
-
}), c = i(() => a.value >=
|
|
1039
|
+
}), c = i(() => a.value >= rt), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
|
|
987
1040
|
L(c, (e) => {
|
|
988
1041
|
e && h();
|
|
989
1042
|
}), L(() => e.surfaceMode, () => {
|
|
@@ -1022,7 +1075,7 @@ function rt(e, t) {
|
|
|
1022
1075
|
!c.value || !e.surfaceMode || e.surfaceMode === o.value || (o.value = e.surfaceMode);
|
|
1023
1076
|
}
|
|
1024
1077
|
function g(e) {
|
|
1025
|
-
r.nextBoundaryLoadProgress =
|
|
1078
|
+
r.nextBoundaryLoadProgress = at(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = at(e.previousBoundaryLoadProgress);
|
|
1026
1079
|
}
|
|
1027
1080
|
return {
|
|
1028
1081
|
...n,
|
|
@@ -1041,26 +1094,26 @@ function rt(e, t) {
|
|
|
1041
1094
|
unlockPageLoading: n.unlockPageLoading
|
|
1042
1095
|
};
|
|
1043
1096
|
}
|
|
1044
|
-
function
|
|
1097
|
+
function at(e) {
|
|
1045
1098
|
return Math.min(Math.max(e, 0), 1);
|
|
1046
1099
|
}
|
|
1047
1100
|
//#endregion
|
|
1048
1101
|
//#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
|
|
1049
|
-
var
|
|
1102
|
+
var ot = {
|
|
1050
1103
|
"data-testid": "vibe-media-bar",
|
|
1051
1104
|
class: "absolute inset-x-0 bottom-0 z-[5] bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.42)_24%,rgba(0,0,0,0.78))] px-[clamp(1rem,2.6vw,2.25rem)] pt-4 pb-[1.15rem]"
|
|
1052
|
-
},
|
|
1105
|
+
}, st = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, ct = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, lt = { class: "relative h-4 w-full" }, ut = [
|
|
1053
1106
|
"max",
|
|
1054
1107
|
"value",
|
|
1055
1108
|
"disabled"
|
|
1056
|
-
],
|
|
1109
|
+
], dt = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, ft = ["data-layout"], pt = {
|
|
1057
1110
|
key: 0,
|
|
1058
1111
|
"data-testid": "vibe-media-volume-popover",
|
|
1059
1112
|
class: "absolute bottom-[calc(100%+0.8rem)] right-0 grid justify-items-center gap-3 border border-white/12 bg-black/82 px-3 py-4 shadow-[0_20px_50px_-20px_rgba(0,0,0,0.85)] backdrop-blur-[18px]"
|
|
1060
|
-
},
|
|
1113
|
+
}, mt = { class: "relative flex h-28 w-4 items-center justify-center" }, ht = ["value"], gt = { class: "flex items-center gap-3" }, _t = ["aria-label"], vt = {
|
|
1061
1114
|
key: 0,
|
|
1062
1115
|
class: "relative h-4 w-24"
|
|
1063
|
-
},
|
|
1116
|
+
}, yt = ["value"], bt = /* @__PURE__ */ d({
|
|
1064
1117
|
__name: "FullscreenMediaBar",
|
|
1065
1118
|
props: {
|
|
1066
1119
|
currentTime: {},
|
|
@@ -1103,9 +1156,9 @@ var at = {
|
|
|
1103
1156
|
function C(e, t, n) {
|
|
1104
1157
|
return Math.min(Math.max(e, t), n);
|
|
1105
1158
|
}
|
|
1106
|
-
return (e, t) => (w(), s("div",
|
|
1107
|
-
c("span",
|
|
1108
|
-
c("div",
|
|
1159
|
+
return (e, t) => (w(), s("div", ot, [c("div", st, [
|
|
1160
|
+
c("span", ct, j(n.currentTimeLabel), 1),
|
|
1161
|
+
c("div", lt, [
|
|
1109
1162
|
t[3] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
1110
1163
|
c("div", {
|
|
1111
1164
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -1122,16 +1175,16 @@ var at = {
|
|
|
1122
1175
|
disabled: n.duration <= 0,
|
|
1123
1176
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
|
|
1124
1177
|
onInput: t[0] ||= (e) => r("seek-input", e)
|
|
1125
|
-
}, null, 40,
|
|
1178
|
+
}, null, 40, ut)
|
|
1126
1179
|
]),
|
|
1127
|
-
c("span",
|
|
1180
|
+
c("span", dt, j(n.durationLabel), 1),
|
|
1128
1181
|
c("div", {
|
|
1129
1182
|
ref_key: "rootRef",
|
|
1130
1183
|
ref: l,
|
|
1131
1184
|
"data-testid": "vibe-media-volume",
|
|
1132
1185
|
"data-layout": n.volumeControlLayout,
|
|
1133
1186
|
class: "relative flex items-center justify-end"
|
|
1134
|
-
}, [d.value && u.value ? (w(), s("div",
|
|
1187
|
+
}, [d.value && u.value ? (w(), s("div", pt, [c("div", mt, [
|
|
1135
1188
|
t[4] ||= c("div", { class: "absolute bottom-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/12" }, null, -1),
|
|
1136
1189
|
c("div", {
|
|
1137
1190
|
class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
|
|
@@ -1148,8 +1201,8 @@ var at = {
|
|
|
1148
1201
|
value: f.value,
|
|
1149
1202
|
class: "vibe-media-slider absolute left-1/2 top-1/2 h-4 w-28 -translate-x-1/2 -translate-y-1/2 -rotate-90 bg-transparent",
|
|
1150
1203
|
onInput: t[1] ||= (e) => r("volume-input", e)
|
|
1151
|
-
}, null, 40,
|
|
1152
|
-
])])) : o("", !0), c("div",
|
|
1204
|
+
}, null, 40, ht)
|
|
1205
|
+
])])) : o("", !0), c("div", gt, [c("button", {
|
|
1153
1206
|
type: "button",
|
|
1154
1207
|
"data-testid": "vibe-media-volume-button",
|
|
1155
1208
|
"aria-label": g.value,
|
|
@@ -1158,7 +1211,7 @@ var at = {
|
|
|
1158
1211
|
}, [(w(), a(A(m.value), {
|
|
1159
1212
|
class: "h-4 w-4 stroke-[1.9]",
|
|
1160
1213
|
"aria-hidden": "true"
|
|
1161
|
-
}))], 8,
|
|
1214
|
+
}))], 8, _t), n.volumeControlLayout === "horizontal" ? (w(), s("div", vt, [
|
|
1162
1215
|
t[5] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
1163
1216
|
c("div", {
|
|
1164
1217
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -1175,24 +1228,24 @@ var at = {
|
|
|
1175
1228
|
value: f.value,
|
|
1176
1229
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
|
|
1177
1230
|
onInput: t[2] ||= (e) => r("volume-input", e)
|
|
1178
|
-
}, null, 40,
|
|
1179
|
-
])) : o("", !0)])], 8,
|
|
1231
|
+
}, null, 40, yt)
|
|
1232
|
+
])) : o("", !0)])], 8, ft)
|
|
1180
1233
|
])]));
|
|
1181
1234
|
}
|
|
1182
|
-
}),
|
|
1235
|
+
}), xt = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, St = { class: "grid gap-4" }, Ct = { class: "flex min-h-11 items-center justify-between gap-4" }, wt = { class: "min-w-0 flex flex-1 items-center gap-3" }, Tt = {
|
|
1183
1236
|
key: 1,
|
|
1184
1237
|
"data-testid": "vibe-title",
|
|
1185
1238
|
class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
|
|
1186
|
-
},
|
|
1239
|
+
}, Et = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, Dt = {
|
|
1187
1240
|
"data-testid": "vibe-pagination",
|
|
1188
1241
|
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]"
|
|
1189
|
-
},
|
|
1242
|
+
}, Ot = { class: "whitespace-nowrap" }, kt = {
|
|
1190
1243
|
key: 1,
|
|
1191
1244
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
1192
|
-
},
|
|
1245
|
+
}, At = {
|
|
1193
1246
|
key: 0,
|
|
1194
1247
|
class: "grid gap-2 max-[720px]:justify-items-start"
|
|
1195
|
-
},
|
|
1248
|
+
}, jt = /* @__PURE__ */ d({
|
|
1196
1249
|
__name: "FullscreenHeader",
|
|
1197
1250
|
props: {
|
|
1198
1251
|
currentIndex: {},
|
|
@@ -1206,7 +1259,7 @@ var at = {
|
|
|
1206
1259
|
emits: ["back-to-list"],
|
|
1207
1260
|
setup(e, { emit: t }) {
|
|
1208
1261
|
let n = e, r = t;
|
|
1209
|
-
return (e, t) => (w(), s("div",
|
|
1262
|
+
return (e, t) => (w(), s("div", xt, [c("div", St, [c("div", Ct, [c("div", wt, [n.showBackToList ? (w(), s("button", {
|
|
1210
1263
|
key: 0,
|
|
1211
1264
|
type: "button",
|
|
1212
1265
|
"data-testid": "vibe-back-to-list",
|
|
@@ -1216,37 +1269,37 @@ var at = {
|
|
|
1216
1269
|
}, [u(N(re), {
|
|
1217
1270
|
class: "h-4 w-4 stroke-[2.2]",
|
|
1218
1271
|
"aria-hidden": "true"
|
|
1219
|
-
})])) : o("", !0), n.title ? (w(), s("h2",
|
|
1272
|
+
})])) : o("", !0), n.title ? (w(), s("h2", Tt, j(n.title), 1)) : o("", !0)]), c("div", Et, [c("span", Dt, [
|
|
1220
1273
|
n.loading ? (w(), a(N(oe), {
|
|
1221
1274
|
key: 0,
|
|
1222
1275
|
"data-testid": "vibe-pagination-spinner",
|
|
1223
1276
|
class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
|
|
1224
1277
|
"aria-hidden": "true"
|
|
1225
1278
|
})) : o("", !0),
|
|
1226
|
-
c("span",
|
|
1227
|
-
n.paginationDetail ? (w(), s("span",
|
|
1228
|
-
]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div",
|
|
1279
|
+
c("span", Ot, j(n.currentIndex + 1) + " / " + j(n.total), 1),
|
|
1280
|
+
n.paginationDetail ? (w(), s("span", kt, j(n.paginationDetail), 1)) : o("", !0)
|
|
1281
|
+
]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div", At, [...t[1] ||= [c("span", { class: "inline-flex items-center border border-amber-300/35 bg-black/40 px-4 py-3 text-[0.74rem] font-bold uppercase tracking-[0.2em] text-amber-200 backdrop-blur-[18px]" }, " End reached ", -1)]])) : o("", !0)]));
|
|
1229
1282
|
}
|
|
1230
|
-
}),
|
|
1283
|
+
}), Mt = {
|
|
1231
1284
|
image: ae,
|
|
1232
1285
|
video: Y,
|
|
1233
1286
|
audio: J,
|
|
1234
1287
|
other: ie
|
|
1235
|
-
},
|
|
1288
|
+
}, Nt = {
|
|
1236
1289
|
image: "Image",
|
|
1237
1290
|
video: "Video",
|
|
1238
1291
|
audio: "Audio",
|
|
1239
1292
|
other: "File"
|
|
1240
1293
|
};
|
|
1241
|
-
function Nt(e) {
|
|
1242
|
-
return jt[e];
|
|
1243
|
-
}
|
|
1244
1294
|
function Pt(e) {
|
|
1245
1295
|
return Mt[e];
|
|
1246
1296
|
}
|
|
1297
|
+
function Ft(e) {
|
|
1298
|
+
return Nt[e];
|
|
1299
|
+
}
|
|
1247
1300
|
//#endregion
|
|
1248
1301
|
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
1249
|
-
function
|
|
1302
|
+
function It() {
|
|
1250
1303
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = 0;
|
|
1251
1304
|
function r(r) {
|
|
1252
1305
|
let a = {
|
|
@@ -1269,7 +1322,7 @@ function Ft() {
|
|
|
1269
1322
|
function i() {
|
|
1270
1323
|
if (t.size === 0) return;
|
|
1271
1324
|
let n = [...t.values()].sort((e, t) => {
|
|
1272
|
-
let n =
|
|
1325
|
+
let n = Rt(e) - Rt(t);
|
|
1273
1326
|
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
1274
1327
|
});
|
|
1275
1328
|
for (let r of n) {
|
|
@@ -1283,8 +1336,8 @@ function Ft() {
|
|
|
1283
1336
|
}
|
|
1284
1337
|
return { request: r };
|
|
1285
1338
|
}
|
|
1286
|
-
var
|
|
1287
|
-
function
|
|
1339
|
+
var Lt = It();
|
|
1340
|
+
function Rt(e) {
|
|
1288
1341
|
try {
|
|
1289
1342
|
let t = e.getPriority();
|
|
1290
1343
|
return Number.isFinite(t) ? t : Infinity;
|
|
@@ -1294,19 +1347,19 @@ function Lt(e) {
|
|
|
1294
1347
|
}
|
|
1295
1348
|
//#endregion
|
|
1296
1349
|
//#region src/components/viewer-core/useFullscreenPreloadController.ts
|
|
1297
|
-
var
|
|
1350
|
+
var zt = [
|
|
1298
1351
|
0,
|
|
1299
1352
|
1,
|
|
1300
1353
|
2,
|
|
1301
1354
|
3
|
|
1302
|
-
],
|
|
1355
|
+
], Bt = {
|
|
1303
1356
|
0: 0,
|
|
1304
1357
|
1: 1,
|
|
1305
1358
|
2: 2,
|
|
1306
1359
|
3: 3
|
|
1307
1360
|
};
|
|
1308
|
-
function
|
|
1309
|
-
let t = D({}), n =
|
|
1361
|
+
function Vt(e) {
|
|
1362
|
+
let t = D({}), n = It(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
|
|
1310
1363
|
L([
|
|
1311
1364
|
e.active,
|
|
1312
1365
|
e.items,
|
|
@@ -1327,14 +1380,14 @@ function Bt(e) {
|
|
|
1327
1380
|
}
|
|
1328
1381
|
function l(e, t) {
|
|
1329
1382
|
if (t instanceof HTMLImageElement) {
|
|
1330
|
-
i.set(e, t),
|
|
1383
|
+
i.set(e, t), Ut(t) && d(e);
|
|
1331
1384
|
return;
|
|
1332
1385
|
}
|
|
1333
1386
|
i.delete(e);
|
|
1334
1387
|
}
|
|
1335
1388
|
function u(e, t) {
|
|
1336
1389
|
if (t instanceof HTMLMediaElement) {
|
|
1337
|
-
a.set(e, t),
|
|
1390
|
+
a.set(e, t), Wt(t) && d(e);
|
|
1338
1391
|
return;
|
|
1339
1392
|
}
|
|
1340
1393
|
a.delete(e);
|
|
@@ -1375,7 +1428,7 @@ function Bt(e) {
|
|
|
1375
1428
|
assetType: s.item.type === "image" ? "image" : "video",
|
|
1376
1429
|
getPriority: () => g(o.index),
|
|
1377
1430
|
onGrant: () => {
|
|
1378
|
-
y(s.key, !0), (e.isAssetReady(s.key, s.item) ||
|
|
1431
|
+
y(s.key, !0), (e.isAssetReady(s.key, s.item) || Ht(s.key, i, a)) && d(s.key);
|
|
1379
1432
|
},
|
|
1380
1433
|
url: s.item.url
|
|
1381
1434
|
})
|
|
@@ -1386,14 +1439,14 @@ function Bt(e) {
|
|
|
1386
1439
|
}
|
|
1387
1440
|
function h() {
|
|
1388
1441
|
let t = e.resolvedActiveIndex.value;
|
|
1389
|
-
return
|
|
1442
|
+
return zt.map((e) => _(t + e)).filter((e) => !!e);
|
|
1390
1443
|
}
|
|
1391
1444
|
function g(t) {
|
|
1392
|
-
return e.active.value ?
|
|
1445
|
+
return e.active.value ? Bt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
|
|
1393
1446
|
}
|
|
1394
1447
|
function _(t) {
|
|
1395
1448
|
let n = e.items.value[t];
|
|
1396
|
-
return !n || !
|
|
1449
|
+
return !n || !Gt(n) ? null : {
|
|
1397
1450
|
index: t,
|
|
1398
1451
|
item: n,
|
|
1399
1452
|
key: e.getItemKey(n)
|
|
@@ -1442,26 +1495,26 @@ function Bt(e) {
|
|
|
1442
1495
|
shouldAttachSlideAsset: s
|
|
1443
1496
|
};
|
|
1444
1497
|
}
|
|
1445
|
-
function
|
|
1498
|
+
function Ht(e, t, n) {
|
|
1446
1499
|
let r = t.get(e);
|
|
1447
|
-
if (r) return
|
|
1500
|
+
if (r) return Ut(r);
|
|
1448
1501
|
let i = n.get(e);
|
|
1449
|
-
return i ?
|
|
1502
|
+
return i ? Wt(i) : !1;
|
|
1450
1503
|
}
|
|
1451
|
-
function
|
|
1504
|
+
function Ut(e) {
|
|
1452
1505
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1453
1506
|
}
|
|
1454
|
-
function
|
|
1507
|
+
function Wt(e) {
|
|
1455
1508
|
let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
1456
1509
|
return e.readyState >= t;
|
|
1457
1510
|
}
|
|
1458
|
-
function
|
|
1511
|
+
function Gt(e) {
|
|
1459
1512
|
return e.type === "image" || e.type === "video" || e.type === "audio";
|
|
1460
1513
|
}
|
|
1461
1514
|
//#endregion
|
|
1462
1515
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
1463
|
-
function
|
|
1464
|
-
let t =
|
|
1516
|
+
function Kt(e) {
|
|
1517
|
+
let t = Vt({
|
|
1465
1518
|
active: e.active,
|
|
1466
1519
|
getItemKey: r,
|
|
1467
1520
|
isAssetReady: m,
|
|
@@ -1471,7 +1524,7 @@ function Gt(e) {
|
|
|
1471
1524
|
});
|
|
1472
1525
|
function n(e, t) {
|
|
1473
1526
|
let n = t.title?.trim();
|
|
1474
|
-
return n ? `${e} ${n}` : `${e} ${
|
|
1527
|
+
return n ? `${e} ${n}` : `${e} ${Ft(t.type).toLowerCase()}`;
|
|
1475
1528
|
}
|
|
1476
1529
|
function r(e) {
|
|
1477
1530
|
return $(e);
|
|
@@ -1534,11 +1587,11 @@ function Gt(e) {
|
|
|
1534
1587
|
}
|
|
1535
1588
|
//#endregion
|
|
1536
1589
|
//#region src/components/viewer-core/slotContent.ts
|
|
1537
|
-
function
|
|
1590
|
+
function qt(e) {
|
|
1538
1591
|
if (!Array.isArray(e)) return !1;
|
|
1539
1592
|
for (let t of e) {
|
|
1540
1593
|
if (Array.isArray(t)) {
|
|
1541
|
-
if (
|
|
1594
|
+
if (qt(t)) return !0;
|
|
1542
1595
|
continue;
|
|
1543
1596
|
}
|
|
1544
1597
|
if (!h(t)) {
|
|
@@ -1549,20 +1602,20 @@ function Kt(e) {
|
|
|
1549
1602
|
if (t != null && t !== !1) return !0;
|
|
1550
1603
|
continue;
|
|
1551
1604
|
}
|
|
1552
|
-
if (!
|
|
1605
|
+
if (!Jt(t)) return !0;
|
|
1553
1606
|
}
|
|
1554
1607
|
return !1;
|
|
1555
1608
|
}
|
|
1556
|
-
function
|
|
1557
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1609
|
+
function Jt(r) {
|
|
1610
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !qt(r.children) : !1;
|
|
1558
1611
|
}
|
|
1559
1612
|
//#endregion
|
|
1560
1613
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1561
|
-
var
|
|
1562
|
-
function
|
|
1614
|
+
var Yt = "no items available";
|
|
1615
|
+
function Xt(e) {
|
|
1563
1616
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1564
1617
|
loading: !!e.loading.value,
|
|
1565
|
-
message:
|
|
1618
|
+
message: Yt,
|
|
1566
1619
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1567
1620
|
surface: e.surface,
|
|
1568
1621
|
total: e.itemCount.value
|
|
@@ -1570,23 +1623,23 @@ function Yt(e) {
|
|
|
1570
1623
|
return {
|
|
1571
1624
|
emptyStateProps: t,
|
|
1572
1625
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1573
|
-
showCustomEmptyState: i(() =>
|
|
1626
|
+
showCustomEmptyState: i(() => qt(n.value)),
|
|
1574
1627
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1575
1628
|
};
|
|
1576
1629
|
}
|
|
1577
1630
|
//#endregion
|
|
1578
1631
|
//#region src/components/viewer-core/format.ts
|
|
1579
|
-
function
|
|
1632
|
+
function Zt(e) {
|
|
1580
1633
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1581
1634
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1582
1635
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1583
1636
|
}
|
|
1584
1637
|
//#endregion
|
|
1585
1638
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1586
|
-
function
|
|
1639
|
+
function Qt(e) {
|
|
1587
1640
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1588
1641
|
}
|
|
1589
|
-
function
|
|
1642
|
+
function $t(e) {
|
|
1590
1643
|
return e.phase === "failed" ? {
|
|
1591
1644
|
kind: "failed",
|
|
1592
1645
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1609,7 +1662,7 @@ function Qt(e) {
|
|
|
1609
1662
|
}
|
|
1610
1663
|
//#endregion
|
|
1611
1664
|
//#region src/components/viewer-core/useActivation.ts
|
|
1612
|
-
function
|
|
1665
|
+
function en(e) {
|
|
1613
1666
|
let t = !1;
|
|
1614
1667
|
L(e.enabled, async (t) => {
|
|
1615
1668
|
if (n(t), t) {
|
|
@@ -1632,7 +1685,7 @@ function $t(e) {
|
|
|
1632
1685
|
}
|
|
1633
1686
|
//#endregion
|
|
1634
1687
|
//#region src/components/viewer-core/assetState.ts
|
|
1635
|
-
var
|
|
1688
|
+
var tn = {
|
|
1636
1689
|
currentTime: 0,
|
|
1637
1690
|
duration: 0,
|
|
1638
1691
|
errorKind: null,
|
|
@@ -1641,38 +1694,38 @@ var en = {
|
|
|
1641
1694
|
ready: !1,
|
|
1642
1695
|
volume: 1
|
|
1643
1696
|
};
|
|
1644
|
-
function
|
|
1645
|
-
return { ...
|
|
1697
|
+
function nn() {
|
|
1698
|
+
return { ...tn };
|
|
1646
1699
|
}
|
|
1647
|
-
function
|
|
1700
|
+
function rn(e) {
|
|
1648
1701
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1649
1702
|
}
|
|
1650
|
-
function
|
|
1651
|
-
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready =
|
|
1703
|
+
function an(e, t, n) {
|
|
1704
|
+
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready = on(t, n);
|
|
1652
1705
|
}
|
|
1653
|
-
function
|
|
1706
|
+
function on(e, t) {
|
|
1654
1707
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1655
1708
|
}
|
|
1656
1709
|
//#endregion
|
|
1657
1710
|
//#region src/components/viewer-core/loadError.ts
|
|
1658
|
-
var
|
|
1659
|
-
function sn(e) {
|
|
1660
|
-
return e === "not-found" ? "404" : "Load error";
|
|
1661
|
-
}
|
|
1711
|
+
var sn = /* @__PURE__ */ new Map();
|
|
1662
1712
|
function cn(e) {
|
|
1663
|
-
return e === "
|
|
1713
|
+
return e === "not-found" ? "404" : "Load error";
|
|
1664
1714
|
}
|
|
1665
1715
|
function ln(e) {
|
|
1666
|
-
return
|
|
1716
|
+
return e === "generic";
|
|
1667
1717
|
}
|
|
1668
1718
|
function un(e) {
|
|
1669
|
-
|
|
1719
|
+
return dn(e).then((e) => e ?? "generic");
|
|
1720
|
+
}
|
|
1721
|
+
function dn(e) {
|
|
1722
|
+
let t = sn.get(e);
|
|
1670
1723
|
if (t) return t;
|
|
1671
|
-
let n =
|
|
1672
|
-
return
|
|
1724
|
+
let n = fn(e);
|
|
1725
|
+
return sn.set(e, n), n;
|
|
1673
1726
|
}
|
|
1674
|
-
async function
|
|
1675
|
-
if (!
|
|
1727
|
+
async function fn(e) {
|
|
1728
|
+
if (!pn(e)) return null;
|
|
1676
1729
|
try {
|
|
1677
1730
|
let t = await fetch(e, { method: "HEAD" });
|
|
1678
1731
|
return t.ok ? null : t.status === 404 ? "not-found" : "generic";
|
|
@@ -1680,12 +1733,12 @@ async function dn(e) {
|
|
|
1680
1733
|
return "generic";
|
|
1681
1734
|
}
|
|
1682
1735
|
}
|
|
1683
|
-
function
|
|
1736
|
+
function pn(e) {
|
|
1684
1737
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1685
1738
|
}
|
|
1686
1739
|
//#endregion
|
|
1687
1740
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1688
|
-
function
|
|
1741
|
+
function mn(e) {
|
|
1689
1742
|
try {
|
|
1690
1743
|
let t = e.play();
|
|
1691
1744
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1693,12 +1746,12 @@ function pn(e) {
|
|
|
1693
1746
|
}
|
|
1694
1747
|
//#endregion
|
|
1695
1748
|
//#region src/components/viewer-core/useMedia.ts
|
|
1696
|
-
function
|
|
1749
|
+
function hn(e) {
|
|
1697
1750
|
let t = D({}), n = D({}), r = D({}), a = D({}), o = D({}), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = i(() => e.activeItem.value ? $(e.activeItem.value) : null), d = i(() => e.activeMediaItem.value ? $(e.activeMediaItem.value) : null), f = i(() => {
|
|
1698
1751
|
let t = /* @__PURE__ */ new Map();
|
|
1699
1752
|
for (let n of e.items.value) t.set($(n), n);
|
|
1700
1753
|
return t;
|
|
1701
|
-
}), p = i(() => d.value ? r.value[d.value] ??
|
|
1754
|
+
}), p = i(() => d.value ? r.value[d.value] ?? tn : tn), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : gn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
|
|
1702
1755
|
L(() => u.value, async () => {
|
|
1703
1756
|
await C();
|
|
1704
1757
|
}), L(() => e.itemCount.value, async () => {
|
|
@@ -1721,7 +1774,7 @@ function mn(e) {
|
|
|
1721
1774
|
c.delete(e);
|
|
1722
1775
|
}
|
|
1723
1776
|
function b(e, r) {
|
|
1724
|
-
r instanceof HTMLImageElement &&
|
|
1777
|
+
r instanceof HTMLImageElement && rn(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
|
|
1725
1778
|
}
|
|
1726
1779
|
function x() {
|
|
1727
1780
|
H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
|
|
@@ -1743,14 +1796,14 @@ function mn(e) {
|
|
|
1743
1796
|
V(i, n);
|
|
1744
1797
|
continue;
|
|
1745
1798
|
}
|
|
1746
|
-
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0,
|
|
1799
|
+
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, mn(i), W(n, i);
|
|
1747
1800
|
}
|
|
1748
1801
|
for (let [e, n] of c.entries()) {
|
|
1749
1802
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1750
1803
|
V(n, e);
|
|
1751
1804
|
continue;
|
|
1752
1805
|
}
|
|
1753
|
-
|
|
1806
|
+
mn(n), W(e, n);
|
|
1754
1807
|
}
|
|
1755
1808
|
}
|
|
1756
1809
|
function w(e, t) {
|
|
@@ -1768,7 +1821,7 @@ function mn(e) {
|
|
|
1768
1821
|
async function E(r, i) {
|
|
1769
1822
|
let a = Y(r) ?? e.activeItem.value;
|
|
1770
1823
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1771
|
-
let o = await
|
|
1824
|
+
let o = await un(i);
|
|
1772
1825
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1773
1826
|
item: a,
|
|
1774
1827
|
occurrenceKey: r,
|
|
@@ -1786,7 +1839,7 @@ function mn(e) {
|
|
|
1786
1839
|
} catch {}
|
|
1787
1840
|
}
|
|
1788
1841
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1789
|
-
let o = await
|
|
1842
|
+
let o = await un(n);
|
|
1790
1843
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1791
1844
|
item: a,
|
|
1792
1845
|
occurrenceKey: t,
|
|
@@ -1806,13 +1859,13 @@ function mn(e) {
|
|
|
1806
1859
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1807
1860
|
let r = Number.parseFloat(e.target.value);
|
|
1808
1861
|
if (!Number.isFinite(r)) return;
|
|
1809
|
-
let i =
|
|
1862
|
+
let i = gn(r, 0, m.value || 0);
|
|
1810
1863
|
ne(n, i, t), t.currentTime = i;
|
|
1811
1864
|
}
|
|
1812
1865
|
function M(e) {
|
|
1813
1866
|
let t = q(), n = d.value;
|
|
1814
1867
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1815
|
-
let r =
|
|
1868
|
+
let r = gn(Number.parseFloat(e.target.value), 0, 1);
|
|
1816
1869
|
t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
|
|
1817
1870
|
}
|
|
1818
1871
|
function N() {
|
|
@@ -1833,10 +1886,10 @@ function mn(e) {
|
|
|
1833
1886
|
}
|
|
1834
1887
|
function z(e) {
|
|
1835
1888
|
let t = R(e);
|
|
1836
|
-
return t ?
|
|
1889
|
+
return t ? cn(t) : null;
|
|
1837
1890
|
}
|
|
1838
1891
|
function B(e) {
|
|
1839
|
-
return
|
|
1892
|
+
return ln(R(e));
|
|
1840
1893
|
}
|
|
1841
1894
|
function ee(e) {
|
|
1842
1895
|
return `${e}:${a.value[e] ?? 0}`;
|
|
@@ -1863,17 +1916,17 @@ function mn(e) {
|
|
|
1863
1916
|
for (let [e, t] of c.entries()) V(t, e);
|
|
1864
1917
|
}
|
|
1865
1918
|
function U(e) {
|
|
1866
|
-
return r.value[e] || (r.value[e] =
|
|
1919
|
+
return r.value[e] || (r.value[e] = nn()), r.value[e];
|
|
1867
1920
|
}
|
|
1868
1921
|
function W(e, t, n) {
|
|
1869
|
-
|
|
1922
|
+
an(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
|
|
1870
1923
|
}
|
|
1871
1924
|
function ne(e, t, n) {
|
|
1872
1925
|
let r = U(e);
|
|
1873
1926
|
r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.muted = n.muted, r.paused = n.paused, r.volume = Number.isFinite(n.volume) ? n.volume : r.volume;
|
|
1874
1927
|
}
|
|
1875
1928
|
function G(e) {
|
|
1876
|
-
return
|
|
1929
|
+
return gn(o.value[e] ?? 1, 0, 1);
|
|
1877
1930
|
}
|
|
1878
1931
|
function K(e) {
|
|
1879
1932
|
return s.get(e) ?? c.get(e) ?? null;
|
|
@@ -1884,7 +1937,7 @@ function mn(e) {
|
|
|
1884
1937
|
function re(e) {
|
|
1885
1938
|
if (e) {
|
|
1886
1939
|
if (e.paused) {
|
|
1887
|
-
|
|
1940
|
+
mn(e);
|
|
1888
1941
|
return;
|
|
1889
1942
|
}
|
|
1890
1943
|
e.pause();
|
|
@@ -1938,16 +1991,16 @@ function mn(e) {
|
|
|
1938
1991
|
syncMediaPlayback: C
|
|
1939
1992
|
};
|
|
1940
1993
|
}
|
|
1941
|
-
function
|
|
1994
|
+
function gn(e, t, n) {
|
|
1942
1995
|
return Math.min(Math.max(e, t), n);
|
|
1943
1996
|
}
|
|
1944
1997
|
//#endregion
|
|
1945
1998
|
//#region src/components/viewer-core/virtualization.ts
|
|
1946
|
-
var
|
|
1999
|
+
var _n = {
|
|
1947
2000
|
backward: 1,
|
|
1948
2001
|
forward: 3
|
|
1949
2002
|
};
|
|
1950
|
-
function
|
|
2003
|
+
function vn(e, t, n = _n) {
|
|
1951
2004
|
return t <= 0 ? {
|
|
1952
2005
|
start: 0,
|
|
1953
2006
|
end: -1
|
|
@@ -1956,14 +2009,14 @@ function _n(e, t, n = gn) {
|
|
|
1956
2009
|
end: Math.min(t - 1, e + n.forward)
|
|
1957
2010
|
};
|
|
1958
2011
|
}
|
|
1959
|
-
function
|
|
1960
|
-
let r =
|
|
2012
|
+
function yn(e, t, n = _n) {
|
|
2013
|
+
let r = vn(t, e.length, n);
|
|
1961
2014
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1962
2015
|
item: e,
|
|
1963
2016
|
index: r.start + t
|
|
1964
2017
|
}));
|
|
1965
2018
|
}
|
|
1966
|
-
function
|
|
2019
|
+
function bn(e, t, n, r, i) {
|
|
1967
2020
|
return {
|
|
1968
2021
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1969
2022
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1971,12 +2024,12 @@ function yn(e, t, n, r, i) {
|
|
|
1971
2024
|
}
|
|
1972
2025
|
//#endregion
|
|
1973
2026
|
//#region src/components/viewer-core/useViewer.ts
|
|
1974
|
-
function
|
|
1975
|
-
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() =>
|
|
2027
|
+
function xn(e, t, n = {}) {
|
|
2028
|
+
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => Qt({
|
|
1976
2029
|
itemCount: r.value.length,
|
|
1977
2030
|
loading: s.value,
|
|
1978
2031
|
phase: e.phase
|
|
1979
|
-
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T =
|
|
2032
|
+
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T = hn({
|
|
1980
2033
|
items: r,
|
|
1981
2034
|
activeItem: C,
|
|
1982
2035
|
activeMediaItem: w,
|
|
@@ -1985,14 +2038,14 @@ function bn(e, t, n = {}) {
|
|
|
1985
2038
|
loopFullscreenVideo: l,
|
|
1986
2039
|
onAssetError: n.onAssetError,
|
|
1987
2040
|
onAssetLoad: n.onAssetLoad
|
|
1988
|
-
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() =>
|
|
2041
|
+
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => $t({
|
|
1989
2042
|
errorMessage: o.value,
|
|
1990
2043
|
hasItems: r.value.length > 0,
|
|
1991
2044
|
hasNextPage: c.value,
|
|
1992
2045
|
phase: d.value,
|
|
1993
2046
|
surface: "fullscreen"
|
|
1994
|
-
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() =>
|
|
1995
|
-
|
|
2047
|
+
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => vn(S.value, r.value.length)), N = i(() => yn(r.value, S.value));
|
|
2048
|
+
en({
|
|
1996
2049
|
enabled: _,
|
|
1997
2050
|
onDisable() {
|
|
1998
2051
|
H(), T.resetMediaState();
|
|
@@ -2070,7 +2123,7 @@ function bn(e, t, n = {}) {
|
|
|
2070
2123
|
return e.type === "audio";
|
|
2071
2124
|
}
|
|
2072
2125
|
function ie(e) {
|
|
2073
|
-
return
|
|
2126
|
+
return bn(e, S.value, g.value, m.value, h.value);
|
|
2074
2127
|
}
|
|
2075
2128
|
return {
|
|
2076
2129
|
activeItem: C,
|
|
@@ -2085,7 +2138,7 @@ function bn(e, t, n = {}) {
|
|
|
2085
2138
|
getAssetErrorKind: T.getAssetErrorKind,
|
|
2086
2139
|
getAssetErrorLabel: T.getAssetErrorLabel,
|
|
2087
2140
|
getAssetRenderKey: T.getAssetRenderKey,
|
|
2088
|
-
formatPlaybackTime:
|
|
2141
|
+
formatPlaybackTime: Zt,
|
|
2089
2142
|
getImageSource: T.getImageSource,
|
|
2090
2143
|
getSlideStyle: ie,
|
|
2091
2144
|
hasNextPage: c,
|
|
@@ -2129,21 +2182,21 @@ function bn(e, t, n = {}) {
|
|
|
2129
2182
|
}
|
|
2130
2183
|
//#endregion
|
|
2131
2184
|
//#region src/components/viewer-core/theme.ts
|
|
2132
|
-
var
|
|
2185
|
+
var Sn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", Cn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", wn = {
|
|
2133
2186
|
image: !0,
|
|
2134
2187
|
video: !0,
|
|
2135
2188
|
audio: !0,
|
|
2136
2189
|
other: !0
|
|
2137
2190
|
};
|
|
2138
|
-
function wn(e) {
|
|
2139
|
-
return Cn[e], xn;
|
|
2140
|
-
}
|
|
2141
2191
|
function Tn(e) {
|
|
2142
|
-
return
|
|
2192
|
+
return wn[e], Sn;
|
|
2193
|
+
}
|
|
2194
|
+
function En(e) {
|
|
2195
|
+
return wn[e], Cn;
|
|
2143
2196
|
}
|
|
2144
2197
|
//#endregion
|
|
2145
2198
|
//#region src/components/viewer-core/useFullscreenAssetEvents.ts
|
|
2146
|
-
function
|
|
2199
|
+
function Dn(e) {
|
|
2147
2200
|
function t(t, n) {
|
|
2148
2201
|
return e.fullscreenMedia.shouldHandleSlideAssetEvent(t, n) ? e.fullscreenMedia.getItemKey(n) : null;
|
|
2149
2202
|
}
|
|
@@ -2176,7 +2229,7 @@ function En(e) {
|
|
|
2176
2229
|
}
|
|
2177
2230
|
//#endregion
|
|
2178
2231
|
//#region src/components/viewer-core/dominantImageTone.ts
|
|
2179
|
-
function
|
|
2232
|
+
function On(e) {
|
|
2180
2233
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
2181
2234
|
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
2182
2235
|
if (!n) return null;
|
|
@@ -2191,20 +2244,20 @@ function Dn(e) {
|
|
|
2191
2244
|
r += d, i += s * d, a += c * d, o += l * d;
|
|
2192
2245
|
}
|
|
2193
2246
|
return r <= 0 ? null : {
|
|
2194
|
-
r:
|
|
2195
|
-
g:
|
|
2196
|
-
b:
|
|
2247
|
+
r: kn(Math.round(i / r)),
|
|
2248
|
+
g: kn(Math.round(a / r)),
|
|
2249
|
+
b: kn(Math.round(o / r))
|
|
2197
2250
|
};
|
|
2198
2251
|
} catch {
|
|
2199
2252
|
return null;
|
|
2200
2253
|
}
|
|
2201
2254
|
}
|
|
2202
|
-
function
|
|
2255
|
+
function kn(e) {
|
|
2203
2256
|
return Math.min(235, Math.max(26, e));
|
|
2204
2257
|
}
|
|
2205
2258
|
//#endregion
|
|
2206
2259
|
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
2207
|
-
function
|
|
2260
|
+
function An(e) {
|
|
2208
2261
|
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(() => {
|
|
2209
2262
|
if (!r.value) return;
|
|
2210
2263
|
let { r: e, g: t, b: n } = r.value;
|
|
@@ -2219,7 +2272,7 @@ function kn(e) {
|
|
|
2219
2272
|
});
|
|
2220
2273
|
function s(n, r) {
|
|
2221
2274
|
if (!e.showDominantImageTone.value) return;
|
|
2222
|
-
let i =
|
|
2275
|
+
let i = On(r);
|
|
2223
2276
|
i && (t.value[n] = i);
|
|
2224
2277
|
}
|
|
2225
2278
|
return {
|
|
@@ -2230,7 +2283,7 @@ function kn(e) {
|
|
|
2230
2283
|
}
|
|
2231
2284
|
//#endregion
|
|
2232
2285
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
2233
|
-
var
|
|
2286
|
+
var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
2234
2287
|
inheritAttrs: !1,
|
|
2235
2288
|
__name: "SurfaceEmptyState",
|
|
2236
2289
|
props: {
|
|
@@ -2244,31 +2297,31 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2244
2297
|
"data-testid": "vibe-empty-state-inline",
|
|
2245
2298
|
"data-surface": e.surface,
|
|
2246
2299
|
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)]"]
|
|
2247
|
-
}), [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,
|
|
2300
|
+
}), [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, jn)) : (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", {
|
|
2248
2301
|
"data-testid": "vibe-empty-state-badge",
|
|
2249
2302
|
"data-surface": e.surface,
|
|
2250
2303
|
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"])
|
|
2251
|
-
}, j(e.message), 11,
|
|
2304
|
+
}, j(e.message), 11, Mn)])], 16));
|
|
2252
2305
|
}
|
|
2253
|
-
}),
|
|
2306
|
+
}), Pn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Fn = {
|
|
2254
2307
|
key: 0,
|
|
2255
2308
|
class: "relative h-full min-h-0"
|
|
2256
|
-
},
|
|
2309
|
+
}, In = [
|
|
2257
2310
|
"data-item-id",
|
|
2258
2311
|
"data-occurrence-key",
|
|
2259
2312
|
"data-index",
|
|
2260
2313
|
"data-active",
|
|
2261
2314
|
"aria-hidden"
|
|
2262
|
-
],
|
|
2315
|
+
], Ln = {
|
|
2263
2316
|
key: 0,
|
|
2264
2317
|
"data-testid": "vibe-asset-spinner",
|
|
2265
2318
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
2266
|
-
},
|
|
2319
|
+
}, Rn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, zn = ["data-kind"], Bn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Vn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Hn = ["onClick"], Un = [
|
|
2267
2320
|
"src",
|
|
2268
2321
|
"alt",
|
|
2269
2322
|
"onLoad",
|
|
2270
2323
|
"onError"
|
|
2271
|
-
],
|
|
2324
|
+
], Wn = [
|
|
2272
2325
|
"loop",
|
|
2273
2326
|
"src",
|
|
2274
2327
|
"preload",
|
|
@@ -2287,15 +2340,15 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2287
2340
|
"onStalled",
|
|
2288
2341
|
"onTimeupdate",
|
|
2289
2342
|
"onWaiting"
|
|
2290
|
-
],
|
|
2343
|
+
], Gn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Kn = [
|
|
2291
2344
|
"aria-label",
|
|
2292
2345
|
"disabled",
|
|
2293
2346
|
"onClick"
|
|
2294
|
-
],
|
|
2347
|
+
], qn = { 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]" }, Jn = { 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]" }, Yn = {
|
|
2295
2348
|
key: 0,
|
|
2296
2349
|
"data-testid": "vibe-asset-spinner",
|
|
2297
2350
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
2298
|
-
},
|
|
2351
|
+
}, Xn = { 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]" }, Zn = ["data-kind"], Qn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, $n = ["onClick"], er = [
|
|
2299
2352
|
"src",
|
|
2300
2353
|
"preload",
|
|
2301
2354
|
"onCanplay",
|
|
@@ -2311,26 +2364,26 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2311
2364
|
"onStalled",
|
|
2312
2365
|
"onTimeupdate",
|
|
2313
2366
|
"onWaiting"
|
|
2314
|
-
],
|
|
2367
|
+
], tr = {
|
|
2315
2368
|
key: 2,
|
|
2316
2369
|
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"
|
|
2317
|
-
},
|
|
2370
|
+
}, nr = { 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]" }, rr = {
|
|
2318
2371
|
key: 0,
|
|
2319
2372
|
"data-testid": "vibe-fullscreen-overlay",
|
|
2320
2373
|
class: "pointer-events-none absolute inset-0 z-[6]"
|
|
2321
|
-
},
|
|
2374
|
+
}, ir = { class: "h-full w-full" }, ar = {
|
|
2322
2375
|
key: 1,
|
|
2323
2376
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
2324
2377
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
2325
|
-
},
|
|
2378
|
+
}, or = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, sr = { 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)]" }, cr = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, lr = {
|
|
2326
2379
|
key: 0,
|
|
2327
2380
|
"data-testid": "vibe-fullscreen-aside",
|
|
2328
2381
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
2329
|
-
},
|
|
2382
|
+
}, ur = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, dr = {
|
|
2330
2383
|
key: 0,
|
|
2331
2384
|
"data-testid": "vibe-fullscreen-aside",
|
|
2332
2385
|
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]"
|
|
2333
|
-
},
|
|
2386
|
+
}, fr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, pr = 1280, mr = 768, hr = /* @__PURE__ */ d({
|
|
2334
2387
|
__name: "FullscreenSurface",
|
|
2335
2388
|
props: {
|
|
2336
2389
|
active: {
|
|
@@ -2382,27 +2435,27 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2382
2435
|
},
|
|
2383
2436
|
emits: ["back-to-list", "update:activeIndex"],
|
|
2384
2437
|
setup(e, { emit: n }) {
|
|
2385
|
-
let d = e, f = F(), m = n, h =
|
|
2438
|
+
let d = e, f = F(), m = n, h = xn(d, (e, t) => {
|
|
2386
2439
|
m("update:activeIndex", t);
|
|
2387
2440
|
}, {
|
|
2388
2441
|
enabled: M(d, "active"),
|
|
2389
2442
|
onAssetError: d.reportAssetError ?? void 0,
|
|
2390
2443
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
2391
|
-
}), _ = D(typeof window > "u" ?
|
|
2444
|
+
}), _ = D(typeof window > "u" ? pr : window.innerWidth || pr), C = Kt({
|
|
2392
2445
|
active: M(d, "active"),
|
|
2393
2446
|
items: h.items,
|
|
2394
2447
|
resolvedActiveIndex: h.resolvedActiveIndex,
|
|
2395
2448
|
viewer: h
|
|
2396
|
-
}), T = i(() =>
|
|
2449
|
+
}), T = i(() => Tn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = An({
|
|
2397
2450
|
activeItem: h.activeItem,
|
|
2398
2451
|
getItemKey: C.getItemKey,
|
|
2399
2452
|
isImageReady: h.isImageReady,
|
|
2400
2453
|
showDominantImageTone: M(d, "showDominantImageTone")
|
|
2401
|
-
}), L =
|
|
2454
|
+
}), L = Dn({
|
|
2402
2455
|
fullscreenMedia: C,
|
|
2403
2456
|
updateDominantToneFromImageElement: _e,
|
|
2404
2457
|
viewer: h
|
|
2405
|
-
}), 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 <
|
|
2458
|
+
}), 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 < mr ? "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(() => {
|
|
2406
2459
|
let e = h.activeItem.value;
|
|
2407
2460
|
return e ? {
|
|
2408
2461
|
hasNextPage: d.hasNextPage,
|
|
@@ -2419,7 +2472,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2419
2472
|
}), q = i(() => !K.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](K.value)), re = i(() => ({
|
|
2420
2473
|
gridTemplateColumns: ie.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
2421
2474
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
2422
|
-
})), J = i(() =>
|
|
2475
|
+
})), J = i(() => qt(ne.value)), Y = i(() => qt(G.value)), ie = i(() => Y.value && _.value >= pr), ae = i(() => Y.value && !ie.value), ue = i(() => qt(q.value)), { emptyStateProps: X, showBadgeEmptyState: de, showCustomEmptyState: fe, showInlineEmptyState: pe } = Xt({
|
|
2423
2476
|
emptyStateMode: M(d, "emptyStateMode"),
|
|
2424
2477
|
itemCount: i(() => d.items.length),
|
|
2425
2478
|
loading: M(d, "loading"),
|
|
@@ -2427,12 +2480,12 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2427
2480
|
surface: "fullscreen"
|
|
2428
2481
|
});
|
|
2429
2482
|
S(() => {
|
|
2430
|
-
window.addEventListener("resize",
|
|
2483
|
+
window.addEventListener("resize", Z);
|
|
2431
2484
|
}), x(() => {
|
|
2432
|
-
window.removeEventListener("resize",
|
|
2485
|
+
window.removeEventListener("resize", Z);
|
|
2433
2486
|
});
|
|
2434
|
-
function
|
|
2435
|
-
_.value = window.innerWidth ||
|
|
2487
|
+
function Z() {
|
|
2488
|
+
_.value = window.innerWidth || pr;
|
|
2436
2489
|
}
|
|
2437
2490
|
function me(e, t) {
|
|
2438
2491
|
C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && _e(e, t);
|
|
@@ -2461,7 +2514,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2461
2514
|
let a = i.play();
|
|
2462
2515
|
a && typeof a.catch == "function" && a.catch(() => {});
|
|
2463
2516
|
}
|
|
2464
|
-
return (e, n) => (w(), s("div",
|
|
2517
|
+
return (e, n) => (w(), s("div", Pn, [
|
|
2465
2518
|
c("div", {
|
|
2466
2519
|
class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
|
|
2467
2520
|
style: b(N(P))
|
|
@@ -2478,7 +2531,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2478
2531
|
onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
|
|
2479
2532
|
onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
|
|
2480
2533
|
onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
|
|
2481
|
-
}, [N(h).activeItem.value ? (w(), s("div",
|
|
2534
|
+
}, [N(h).activeItem.value ? (w(), s("div", Fn, [
|
|
2482
2535
|
(w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
|
|
2483
2536
|
key: N(C).getItemKey(r),
|
|
2484
2537
|
"data-testid": "vibe-slide",
|
|
@@ -2490,12 +2543,12 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2490
2543
|
class: v(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === N(h).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
|
|
2491
2544
|
style: b(N(h).getSlideStyle(i))
|
|
2492
2545
|
}, [c("div", {
|
|
2493
|
-
class: v(["absolute inset-0 opacity-85", N(
|
|
2546
|
+
class: v(["absolute inset-0 opacity-85", N(En)(r.type)]),
|
|
2494
2547
|
style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
|
|
2495
2548
|
}, null, 6), N(h).isVisual(r) ? (w(), s("div", {
|
|
2496
2549
|
key: 0,
|
|
2497
2550
|
class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? V.value : ""])
|
|
2498
|
-
}, [N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2551
|
+
}, [N(C).isAssetLoading(i, r) ? (w(), s("div", Ln, [c("span", Rn, [u(N(oe), {
|
|
2499
2552
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2500
2553
|
"aria-hidden": "true"
|
|
2501
2554
|
})])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
|
|
@@ -2503,19 +2556,19 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2503
2556
|
"data-testid": "vibe-asset-error",
|
|
2504
2557
|
"data-kind": N(C).getAssetErrorKind(r),
|
|
2505
2558
|
class: "grid h-full w-full place-items-center"
|
|
2506
|
-
}, [c("div",
|
|
2559
|
+
}, [c("div", Bn, [
|
|
2507
2560
|
u(N(le), {
|
|
2508
2561
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2509
2562
|
"aria-hidden": "true"
|
|
2510
2563
|
}),
|
|
2511
|
-
c("p",
|
|
2564
|
+
c("p", Vn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2512
2565
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2513
2566
|
key: 0,
|
|
2514
2567
|
type: "button",
|
|
2515
2568
|
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",
|
|
2516
2569
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2517
|
-
}, " Retry ", 8,
|
|
2518
|
-
])], 8,
|
|
2570
|
+
}, " Retry ", 8, Hn)) : o("", !0)
|
|
2571
|
+
])], 8, zn)) : r.type === "image" ? (w(), s("img", {
|
|
2519
2572
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2520
2573
|
src: N(C).getFullscreenImageSource(i, r),
|
|
2521
2574
|
alt: r.title ?? "",
|
|
@@ -2526,7 +2579,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2526
2579
|
ref: (e) => me(N(C).getItemKey(r), e),
|
|
2527
2580
|
onLoad: (e) => N(L).onFullscreenImageLoad(e, i, r),
|
|
2528
2581
|
onError: (e) => N(L).onFullscreenImageError(i, r)
|
|
2529
|
-
}, null, 42,
|
|
2582
|
+
}, null, 42, Un)) : (w(), s("video", {
|
|
2530
2583
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2531
2584
|
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"]),
|
|
2532
2585
|
playsinline: "",
|
|
@@ -2550,10 +2603,10 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2550
2603
|
onStalled: (e) => Q(i, r, e),
|
|
2551
2604
|
onTimeupdate: (e) => Q(i, r, e),
|
|
2552
2605
|
onWaiting: (e) => Q(i, r, e)
|
|
2553
|
-
}, null, 42,
|
|
2606
|
+
}, null, 42, Wn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
|
|
2554
2607
|
key: 1,
|
|
2555
2608
|
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 : ""])
|
|
2556
|
-
}, [c("div",
|
|
2609
|
+
}, [c("div", Gn, [
|
|
2557
2610
|
c("button", {
|
|
2558
2611
|
type: "button",
|
|
2559
2612
|
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]",
|
|
@@ -2563,19 +2616,19 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2563
2616
|
}, [
|
|
2564
2617
|
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),
|
|
2565
2618
|
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),
|
|
2566
|
-
c("span",
|
|
2567
|
-
icon: N(
|
|
2619
|
+
c("span", qn, [k(e.$slots, "item-icon", {
|
|
2620
|
+
icon: N(Pt)(r.type),
|
|
2568
2621
|
item: r
|
|
2569
|
-
}, () => [(w(), a(A(N(
|
|
2622
|
+
}, () => [(w(), a(A(N(Pt)(r.type)), {
|
|
2570
2623
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2571
2624
|
"aria-hidden": "true"
|
|
2572
2625
|
}))])]),
|
|
2573
|
-
c("span",
|
|
2626
|
+
c("span", Jn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
|
|
2574
2627
|
class: "h-4 w-4 stroke-2",
|
|
2575
2628
|
"aria-hidden": "true"
|
|
2576
2629
|
}))])
|
|
2577
|
-
], 8,
|
|
2578
|
-
N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2630
|
+
], 8, Kn),
|
|
2631
|
+
N(C).isAssetLoading(i, r) ? (w(), s("div", Yn, [c("span", Xn, [u(N(oe), {
|
|
2579
2632
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2580
2633
|
"aria-hidden": "true"
|
|
2581
2634
|
})])])) : o("", !0),
|
|
@@ -2588,14 +2641,14 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2588
2641
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2589
2642
|
"aria-hidden": "true"
|
|
2590
2643
|
}),
|
|
2591
|
-
c("p",
|
|
2644
|
+
c("p", Qn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2592
2645
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2593
2646
|
key: 0,
|
|
2594
2647
|
type: "button",
|
|
2595
2648
|
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",
|
|
2596
2649
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2597
|
-
}, " Retry ", 8,
|
|
2598
|
-
], 8,
|
|
2650
|
+
}, " Retry ", 8, $n)) : o("", !0)
|
|
2651
|
+
], 8, Zn)], 64)) : o("", !0)
|
|
2599
2652
|
]), (w(), s("audio", {
|
|
2600
2653
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2601
2654
|
src: N(C).getFullscreenMediaSource(i, r),
|
|
@@ -2616,15 +2669,15 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2616
2669
|
onStalled: (e) => Q(i, r, e),
|
|
2617
2670
|
onTimeupdate: (e) => Q(i, r, e),
|
|
2618
2671
|
onWaiting: (e) => Q(i, r, e)
|
|
2619
|
-
}, null, 40,
|
|
2620
|
-
icon: N(
|
|
2672
|
+
}, null, 40, er))], 2)) : (w(), s("div", tr, [c("div", nr, [k(e.$slots, "item-icon", {
|
|
2673
|
+
icon: N(Pt)(r.type),
|
|
2621
2674
|
item: r
|
|
2622
|
-
}, () => [(w(), a(A(N(
|
|
2675
|
+
}, () => [(w(), a(A(N(Pt)(r.type)), {
|
|
2623
2676
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2624
2677
|
"aria-hidden": "true"
|
|
2625
|
-
}))])])]))], 14,
|
|
2626
|
-
W.value && f["fullscreen-overlay"] ? (w(), s("div",
|
|
2627
|
-
N(h).activeItem.value ? (w(), a(
|
|
2678
|
+
}))])])]))], 14, In))), 128)),
|
|
2679
|
+
W.value && f["fullscreen-overlay"] ? (w(), s("div", rr, [c("div", ir, [k(e.$slots, "fullscreen-overlay", y(p(W.value)))])])) : o("", !0),
|
|
2680
|
+
N(h).activeItem.value ? (w(), a(jt, {
|
|
2628
2681
|
key: 1,
|
|
2629
2682
|
"current-index": N(h).resolvedActiveIndex.value,
|
|
2630
2683
|
loading: d.loading,
|
|
@@ -2647,7 +2700,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2647
2700
|
"title",
|
|
2648
2701
|
"total"
|
|
2649
2702
|
])) : o("", !0),
|
|
2650
|
-
B.value ? (w(), a(
|
|
2703
|
+
B.value ? (w(), a(bt, {
|
|
2651
2704
|
key: 2,
|
|
2652
2705
|
"current-time": N(h).activeMediaState.value.currentTime,
|
|
2653
2706
|
"current-time-label": N(h).formatPlaybackTime(N(h).activeMediaState.value.currentTime),
|
|
@@ -2681,10 +2734,10 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2681
2734
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
2682
2735
|
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" : ""])
|
|
2683
2736
|
}, j(K.value.message), 3))], 2)) : o("", !0)
|
|
2684
|
-
])) : H.value ? (w(), s("div",
|
|
2737
|
+
])) : H.value ? (w(), s("div", ar, [c("div", or, [c("span", sr, [u(N(oe), {
|
|
2685
2738
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2686
2739
|
"aria-hidden": "true"
|
|
2687
|
-
})]), c("p",
|
|
2740
|
+
})]), c("p", cr, j(U.value), 1)])])) : N(pe) && N(X) ? (w(), a(Nn, {
|
|
2688
2741
|
key: 2,
|
|
2689
2742
|
message: N(X).message,
|
|
2690
2743
|
mode: N(X).mode,
|
|
@@ -2696,7 +2749,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2696
2749
|
"message",
|
|
2697
2750
|
"mode",
|
|
2698
2751
|
"surface"
|
|
2699
|
-
])) : o("", !0), N(de) && N(X) ? (w(), a(
|
|
2752
|
+
])) : o("", !0), N(de) && N(X) ? (w(), a(Nn, {
|
|
2700
2753
|
key: 3,
|
|
2701
2754
|
message: N(X).message,
|
|
2702
2755
|
mode: N(X).mode,
|
|
@@ -2716,7 +2769,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2716
2769
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2717
2770
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2718
2771
|
}, {
|
|
2719
|
-
default: z(() => [ie.value && W.value ? (w(), s("aside",
|
|
2772
|
+
default: z(() => [ie.value && W.value ? (w(), s("aside", lr, [c("div", ur, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
|
|
2720
2773
|
_: 3
|
|
2721
2774
|
})], 4),
|
|
2722
2775
|
u(r, {
|
|
@@ -2727,29 +2780,29 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2727
2780
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2728
2781
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2729
2782
|
}, {
|
|
2730
|
-
default: z(() => [ae.value && W.value ? (w(), s("aside",
|
|
2783
|
+
default: z(() => [ae.value && W.value ? (w(), s("aside", dr, [c("div", fr, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
|
|
2731
2784
|
_: 3
|
|
2732
2785
|
})
|
|
2733
2786
|
]));
|
|
2734
2787
|
}
|
|
2735
|
-
}),
|
|
2736
|
-
function
|
|
2788
|
+
}), gr = 1, _r = .5;
|
|
2789
|
+
function vr(e) {
|
|
2737
2790
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2738
|
-
width:
|
|
2739
|
-
height:
|
|
2791
|
+
width: gr,
|
|
2792
|
+
height: gr,
|
|
2740
2793
|
source: "fallback"
|
|
2741
2794
|
};
|
|
2742
2795
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2743
|
-
if (
|
|
2744
|
-
let r =
|
|
2796
|
+
if (Tr(t) && Tr(n)) {
|
|
2797
|
+
let r = Er(e, t, n);
|
|
2745
2798
|
return {
|
|
2746
2799
|
width: r.width,
|
|
2747
2800
|
height: r.height,
|
|
2748
2801
|
source: "preview"
|
|
2749
2802
|
};
|
|
2750
2803
|
}
|
|
2751
|
-
if (
|
|
2752
|
-
let t =
|
|
2804
|
+
if (Tr(e.width) && Tr(e.height)) {
|
|
2805
|
+
let t = Er(e, e.width, e.height);
|
|
2753
2806
|
return {
|
|
2754
2807
|
width: t.width,
|
|
2755
2808
|
height: t.height,
|
|
@@ -2757,31 +2810,31 @@ function _r(e) {
|
|
|
2757
2810
|
};
|
|
2758
2811
|
}
|
|
2759
2812
|
return {
|
|
2760
|
-
width:
|
|
2761
|
-
height:
|
|
2813
|
+
width: gr,
|
|
2814
|
+
height: gr,
|
|
2762
2815
|
source: "fallback"
|
|
2763
2816
|
};
|
|
2764
2817
|
}
|
|
2765
|
-
function
|
|
2818
|
+
function yr(e, t) {
|
|
2766
2819
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2767
2820
|
}
|
|
2768
|
-
function
|
|
2821
|
+
function br(e, t, n, r = 0) {
|
|
2769
2822
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2770
2823
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2771
2824
|
return !a || a <= 0 ? n : a / t;
|
|
2772
2825
|
}
|
|
2773
|
-
function
|
|
2774
|
-
let n =
|
|
2826
|
+
function xr(e, t) {
|
|
2827
|
+
let n = vr(e);
|
|
2775
2828
|
return n.height / n.width * t;
|
|
2776
2829
|
}
|
|
2777
|
-
function
|
|
2830
|
+
function Sr(e, t) {
|
|
2778
2831
|
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;
|
|
2779
2832
|
for (let c = 0; c < e.length; c += 1) {
|
|
2780
2833
|
let l = e[c];
|
|
2781
2834
|
o.set($(l), c);
|
|
2782
2835
|
let u = 0;
|
|
2783
2836
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2784
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
2837
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = xr(l, t.columnWidth);
|
|
2785
2838
|
r[c] = {
|
|
2786
2839
|
x: d,
|
|
2787
2840
|
y: f
|
|
@@ -2800,7 +2853,7 @@ function xr(e, t) {
|
|
|
2800
2853
|
indexById: o
|
|
2801
2854
|
};
|
|
2802
2855
|
}
|
|
2803
|
-
function
|
|
2856
|
+
function Cr(e) {
|
|
2804
2857
|
if (e.itemCount <= 0) return [];
|
|
2805
2858
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2806
2859
|
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();
|
|
@@ -2810,7 +2863,7 @@ function Sr(e) {
|
|
|
2810
2863
|
}
|
|
2811
2864
|
return Array.from(a).sort((e, t) => e - t);
|
|
2812
2865
|
}
|
|
2813
|
-
function
|
|
2866
|
+
function wr(e, t, n) {
|
|
2814
2867
|
let r = /* @__PURE__ */ new Map();
|
|
2815
2868
|
for (let i of e) {
|
|
2816
2869
|
let e = t.get($(i));
|
|
@@ -2820,11 +2873,11 @@ function Cr(e, t, n) {
|
|
|
2820
2873
|
}
|
|
2821
2874
|
return r;
|
|
2822
2875
|
}
|
|
2823
|
-
function
|
|
2876
|
+
function Tr(e) {
|
|
2824
2877
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2825
2878
|
}
|
|
2826
|
-
function
|
|
2827
|
-
return e.type !== "image" || n / t >=
|
|
2879
|
+
function Er(e, t, n) {
|
|
2880
|
+
return e.type !== "image" || n / t >= _r ? {
|
|
2828
2881
|
width: t,
|
|
2829
2882
|
height: n
|
|
2830
2883
|
} : {
|
|
@@ -2834,21 +2887,21 @@ function Tr(e, t, n) {
|
|
|
2834
2887
|
}
|
|
2835
2888
|
//#endregion
|
|
2836
2889
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2837
|
-
var
|
|
2838
|
-
function
|
|
2890
|
+
var Dr = 300, Or = 600, kr = 40, Ar = 300, jr = 400;
|
|
2891
|
+
function Mr(e, t) {
|
|
2839
2892
|
return t === "top" ? [...e].reverse() : e;
|
|
2840
2893
|
}
|
|
2841
|
-
function
|
|
2842
|
-
return e <= 0 ?
|
|
2894
|
+
function Nr(e) {
|
|
2895
|
+
return e <= 0 ? Or : Or + Math.min((e - 1) * kr, jr);
|
|
2843
2896
|
}
|
|
2844
|
-
function
|
|
2845
|
-
return
|
|
2897
|
+
function Pr() {
|
|
2898
|
+
return Ar;
|
|
2846
2899
|
}
|
|
2847
|
-
function
|
|
2900
|
+
function Fr(e) {
|
|
2848
2901
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2849
2902
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2850
2903
|
}
|
|
2851
|
-
function
|
|
2904
|
+
function Ir(e) {
|
|
2852
2905
|
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()));
|
|
2853
2906
|
L(e.visibleIndices, (i) => {
|
|
2854
2907
|
if (!i.length) return;
|
|
@@ -2858,20 +2911,20 @@ function Fr(e) {
|
|
|
2858
2911
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2859
2912
|
}
|
|
2860
2913
|
if (!o.length) return;
|
|
2861
|
-
let s =
|
|
2862
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2863
|
-
r.value = c,
|
|
2914
|
+
let s = Mr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
2915
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * kr, jr));
|
|
2916
|
+
r.value = c, Lr(() => {
|
|
2864
2917
|
let e = new Set(n.value);
|
|
2865
2918
|
for (let t of o) e.add(t);
|
|
2866
2919
|
n.value = e;
|
|
2867
|
-
}),
|
|
2920
|
+
}), Rr(() => {
|
|
2868
2921
|
let e = new Set(t.value);
|
|
2869
2922
|
for (let t of o) e.delete(t);
|
|
2870
2923
|
t.value = e, S(() => {
|
|
2871
2924
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2872
2925
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2873
2926
|
n.value = e, r.value = t, a.value = i;
|
|
2874
|
-
},
|
|
2927
|
+
}, Nr(o.length));
|
|
2875
2928
|
});
|
|
2876
2929
|
}, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
|
|
2877
2930
|
if (!e.length || !o.value.size) return;
|
|
@@ -2898,7 +2951,7 @@ function Fr(e) {
|
|
|
2898
2951
|
let e = $(t.item);
|
|
2899
2952
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2900
2953
|
}
|
|
2901
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
2954
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Lr(() => {
|
|
2902
2955
|
let e = new Set(s.value);
|
|
2903
2956
|
for (let t of p) e.add(t);
|
|
2904
2957
|
s.value = e;
|
|
@@ -2906,9 +2959,9 @@ function Fr(e) {
|
|
|
2906
2959
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2907
2960
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2908
2961
|
o.value = e, s.value = t;
|
|
2909
|
-
},
|
|
2962
|
+
}, Ar);
|
|
2910
2963
|
}
|
|
2911
|
-
function g(t, n, r =
|
|
2964
|
+
function g(t, n, r = Dr) {
|
|
2912
2965
|
if (!t.size) return;
|
|
2913
2966
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2914
2967
|
for (let [r, o] of t.entries()) {
|
|
@@ -2927,8 +2980,8 @@ function Fr(e) {
|
|
|
2927
2980
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2928
2981
|
let o = new Map(l.value);
|
|
2929
2982
|
for (let e of a) o.set(e, r);
|
|
2930
|
-
l.value = o,
|
|
2931
|
-
u.value = new Set(a),
|
|
2983
|
+
l.value = o, Lr(() => {
|
|
2984
|
+
u.value = new Set(a), Lr(() => {
|
|
2932
2985
|
c.value = /* @__PURE__ */ new Map();
|
|
2933
2986
|
});
|
|
2934
2987
|
}), S(() => {
|
|
@@ -2939,8 +2992,8 @@ function Fr(e) {
|
|
|
2939
2992
|
}, r);
|
|
2940
2993
|
}
|
|
2941
2994
|
function _(e) {
|
|
2942
|
-
if (n.value.has(e)) return `transform ${
|
|
2943
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
2995
|
+
if (n.value.has(e)) return `transform ${Or}ms ease-out`;
|
|
2996
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? Dr}ms ease-out`;
|
|
2944
2997
|
}
|
|
2945
2998
|
function v(e) {
|
|
2946
2999
|
if (!n.value.has(e)) return;
|
|
@@ -2957,7 +3010,7 @@ function Fr(e) {
|
|
|
2957
3010
|
} : {
|
|
2958
3011
|
dx: 0,
|
|
2959
3012
|
dy: 0
|
|
2960
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
3013
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Fr({
|
|
2961
3014
|
columnWidth: e.columnWidth.value,
|
|
2962
3015
|
direction: u,
|
|
2963
3016
|
itemHeight: o,
|
|
@@ -2971,14 +3024,14 @@ function Fr(e) {
|
|
|
2971
3024
|
if (!r) return {
|
|
2972
3025
|
opacity: "0",
|
|
2973
3026
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2974
|
-
transition: `opacity ${
|
|
3027
|
+
transition: `opacity ${Ar}ms ease-out, transform ${Ar}ms ease-out`
|
|
2975
3028
|
};
|
|
2976
3029
|
let i = s.value.has(n);
|
|
2977
3030
|
return {
|
|
2978
3031
|
height: `${r.height}px`,
|
|
2979
3032
|
opacity: i ? "0" : "1",
|
|
2980
3033
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
2981
|
-
transition: `opacity ${
|
|
3034
|
+
transition: `opacity ${Ar}ms ease-out, transform ${Ar}ms ease-out`,
|
|
2982
3035
|
width: `${e.columnWidth.value}px`
|
|
2983
3036
|
};
|
|
2984
3037
|
}
|
|
@@ -2999,28 +3052,28 @@ function Fr(e) {
|
|
|
2999
3052
|
playFlipMoveAnimation: g
|
|
3000
3053
|
};
|
|
3001
3054
|
}
|
|
3002
|
-
function
|
|
3055
|
+
function Lr(e) {
|
|
3003
3056
|
if (typeof requestAnimationFrame == "function") {
|
|
3004
3057
|
requestAnimationFrame(() => e());
|
|
3005
3058
|
return;
|
|
3006
3059
|
}
|
|
3007
3060
|
setTimeout(e, 0);
|
|
3008
3061
|
}
|
|
3009
|
-
function
|
|
3010
|
-
|
|
3062
|
+
function Rr(e) {
|
|
3063
|
+
Lr(() => Lr(e));
|
|
3011
3064
|
}
|
|
3012
3065
|
//#endregion
|
|
3013
3066
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
3014
|
-
function
|
|
3067
|
+
function zr(e, t) {
|
|
3015
3068
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
3016
3069
|
}
|
|
3017
|
-
function
|
|
3070
|
+
function Br(e, t, n) {
|
|
3018
3071
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
3019
3072
|
}
|
|
3020
|
-
function
|
|
3073
|
+
function Vr(e, t, n, r) {
|
|
3021
3074
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
3022
3075
|
}
|
|
3023
|
-
function
|
|
3076
|
+
function Hr(e, t) {
|
|
3024
3077
|
return {
|
|
3025
3078
|
height: `${e}px`,
|
|
3026
3079
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -3028,8 +3081,8 @@ function Vr(e, t) {
|
|
|
3028
3081
|
}
|
|
3029
3082
|
//#endregion
|
|
3030
3083
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
3031
|
-
var
|
|
3032
|
-
function
|
|
3084
|
+
var Ur = 250, Wr = 1e3;
|
|
3085
|
+
function Gr(e) {
|
|
3033
3086
|
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
|
|
3034
3087
|
x(() => {
|
|
3035
3088
|
y();
|
|
@@ -3045,7 +3098,7 @@ function Wr(e) {
|
|
|
3045
3098
|
function u(t) {
|
|
3046
3099
|
if (!b(t) || !e.isAtBoundary()) return;
|
|
3047
3100
|
let n = Date.now();
|
|
3048
|
-
n < s || (s = n +
|
|
3101
|
+
n < s || (s = n + Ur, m());
|
|
3049
3102
|
}
|
|
3050
3103
|
function d() {
|
|
3051
3104
|
if (!g()) return;
|
|
@@ -3079,7 +3132,7 @@ function Wr(e) {
|
|
|
3079
3132
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
3080
3133
|
}
|
|
3081
3134
|
function _() {
|
|
3082
|
-
o.value = !1, v(
|
|
3135
|
+
o.value = !1, v(Wr);
|
|
3083
3136
|
}
|
|
3084
3137
|
function v(e) {
|
|
3085
3138
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -3102,42 +3155,42 @@ function Wr(e) {
|
|
|
3102
3155
|
}
|
|
3103
3156
|
//#endregion
|
|
3104
3157
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
3105
|
-
var
|
|
3106
|
-
function
|
|
3107
|
-
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth ||
|
|
3158
|
+
var Kr = 600, qr = 24, Jr = 16, Yr = 300, Xr = 200, Zr = 200, Qr = qr + Jr, $r = 200, ei = 300, ti = 24, ni = 48, ri = 500, ii = 1e3;
|
|
3159
|
+
function ai(e) {
|
|
3160
|
+
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Yr), 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(Yr, a.value - qr * 2)), h = i(() => yr(m.value, Yr)), g = i(() => br(m.value, h.value, Yr, Jr)), v = i(() => oi(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Cr({
|
|
3108
3161
|
itemCount: e.items.value.length,
|
|
3109
3162
|
viewportHeight: r.value,
|
|
3110
3163
|
scrollTop: n.value,
|
|
3111
|
-
overscanPx:
|
|
3112
|
-
bucketPx:
|
|
3164
|
+
overscanPx: Xr,
|
|
3165
|
+
bucketPx: Kr,
|
|
3113
3166
|
buckets: c.value
|
|
3114
3167
|
})), b = i(() => y.value.map((t) => ({
|
|
3115
3168
|
item: e.items.value[t],
|
|
3116
3169
|
index: t
|
|
3117
3170
|
}))), C = i(() => {
|
|
3118
|
-
let e = l.value +
|
|
3119
|
-
return Math.max(e, t, r.value) +
|
|
3120
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() =>
|
|
3171
|
+
let e = l.value + qr * 2, t = d.value ?? 0;
|
|
3172
|
+
return Math.max(e, t, r.value) + $r;
|
|
3173
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => ci({
|
|
3121
3174
|
active: e.active.value,
|
|
3122
3175
|
maxScrollTop: se(),
|
|
3123
3176
|
progressDistancePx: n.value,
|
|
3124
|
-
thresholdPx:
|
|
3177
|
+
thresholdPx: Zr,
|
|
3125
3178
|
triggerEnabled: w.value
|
|
3126
|
-
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() =>
|
|
3179
|
+
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => si({
|
|
3127
3180
|
active: e.active.value,
|
|
3128
3181
|
maxScrollTop: se(),
|
|
3129
3182
|
progressDistancePx: n.value,
|
|
3130
|
-
thresholdPx:
|
|
3183
|
+
thresholdPx: Qr,
|
|
3131
3184
|
triggerEnabled: e.hasPreviousPage.value
|
|
3132
|
-
})), k = i(() => Math.max(0, r.value -
|
|
3185
|
+
})), k = i(() => Math.max(0, r.value - ti * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
|
|
3133
3186
|
if (!A.value) return 0;
|
|
3134
3187
|
let e = r.value / C.value * k.value;
|
|
3135
|
-
return Math.min(k.value, Math.max(
|
|
3188
|
+
return Math.min(k.value, Math.max(ni, e));
|
|
3136
3189
|
}), M = i(() => {
|
|
3137
|
-
if (!A.value) return
|
|
3190
|
+
if (!A.value) return ti;
|
|
3138
3191
|
let e = Math.max(0, C.value - r.value);
|
|
3139
|
-
return
|
|
3140
|
-
}), N =
|
|
3192
|
+
return ti + Math.max(0, k.value - j.value) * (e > 0 ? oi(n.value / e, 0, 1) : 0);
|
|
3193
|
+
}), N = Ir({
|
|
3141
3194
|
items: e.items,
|
|
3142
3195
|
visibleIndices: y,
|
|
3143
3196
|
positions: o,
|
|
@@ -3146,27 +3199,27 @@ function ii(e) {
|
|
|
3146
3199
|
columnWidth: g,
|
|
3147
3200
|
scrollTop: n,
|
|
3148
3201
|
viewportHeight: r
|
|
3149
|
-
}), P =
|
|
3202
|
+
}), P = Gr({
|
|
3150
3203
|
direction: "top",
|
|
3151
3204
|
getAnimationLockMs(e) {
|
|
3152
|
-
return Math.max(
|
|
3205
|
+
return Math.max(ri, Nr(e)) + ii;
|
|
3153
3206
|
},
|
|
3154
3207
|
hasPage: e.hasPreviousPage,
|
|
3155
3208
|
interactionLocked: p,
|
|
3156
3209
|
isAtBoundary() {
|
|
3157
|
-
return n.value <=
|
|
3210
|
+
return n.value <= Qr;
|
|
3158
3211
|
},
|
|
3159
3212
|
loading: e.loading,
|
|
3160
3213
|
requestPage: e.requestPreviousPage
|
|
3161
|
-
}), F =
|
|
3214
|
+
}), F = Gr({
|
|
3162
3215
|
direction: "bottom",
|
|
3163
3216
|
getAnimationLockMs(e) {
|
|
3164
|
-
return
|
|
3217
|
+
return Nr(e) + ii;
|
|
3165
3218
|
},
|
|
3166
3219
|
hasPage: w,
|
|
3167
3220
|
interactionLocked: p,
|
|
3168
3221
|
isAtBoundary() {
|
|
3169
|
-
return oe() <=
|
|
3222
|
+
return oe() <= Zr;
|
|
3170
3223
|
},
|
|
3171
3224
|
loading: e.loading,
|
|
3172
3225
|
requestPage: e.requestNextPage
|
|
@@ -3176,7 +3229,7 @@ function ii(e) {
|
|
|
3176
3229
|
h,
|
|
3177
3230
|
g
|
|
3178
3231
|
], async ([t], [r = []]) => {
|
|
3179
|
-
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c =
|
|
3232
|
+
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = wr(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) => {
|
|
3180
3233
|
let t = $(e);
|
|
3181
3234
|
if (f.has(t)) return [];
|
|
3182
3235
|
let n = c.get(t), r = l.get(t);
|
|
@@ -3185,8 +3238,8 @@ function ii(e) {
|
|
|
3185
3238
|
item: e,
|
|
3186
3239
|
position: n
|
|
3187
3240
|
}];
|
|
3188
|
-
}), 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 >
|
|
3189
|
-
y && K(
|
|
3241
|
+
}), 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 > qr + Jr, b = h && n.value > qr + Jr ? t[v.value] : null, x = b ? $(b) : null;
|
|
3242
|
+
y && K(Pr() + ii), 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 ? ri : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
|
|
3190
3243
|
}, { immediate: !0 }), L([
|
|
3191
3244
|
() => e.pendingAppendItems.value.map((e) => $(e)),
|
|
3192
3245
|
h,
|
|
@@ -3203,7 +3256,7 @@ function ii(e) {
|
|
|
3203
3256
|
}
|
|
3204
3257
|
if (i !== !1 || f.value == null) return;
|
|
3205
3258
|
await _();
|
|
3206
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
3259
|
+
let o = Math.max(0, C.value - r.value), s = oi(f.value, 0, o);
|
|
3207
3260
|
a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
|
|
3208
3261
|
}), L(() => e.loading.value, async (t) => {
|
|
3209
3262
|
!t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
|
|
@@ -3215,16 +3268,16 @@ function ii(e) {
|
|
|
3215
3268
|
I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
|
|
3216
3269
|
});
|
|
3217
3270
|
function te() {
|
|
3218
|
-
let t =
|
|
3271
|
+
let t = Sr(e.items.value, {
|
|
3219
3272
|
columnCount: h.value,
|
|
3220
3273
|
columnWidth: g.value,
|
|
3221
|
-
gapX:
|
|
3222
|
-
gapY:
|
|
3223
|
-
bucketPx:
|
|
3274
|
+
gapX: Jr,
|
|
3275
|
+
gapY: Jr,
|
|
3276
|
+
bucketPx: Kr
|
|
3224
3277
|
});
|
|
3225
3278
|
o.value = t.positions.map((e) => ({
|
|
3226
|
-
x: e.x +
|
|
3227
|
-
y: e.y +
|
|
3279
|
+
x: e.x + qr,
|
|
3280
|
+
y: e.y + qr
|
|
3228
3281
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
3229
3282
|
}
|
|
3230
3283
|
function V() {
|
|
@@ -3249,7 +3302,7 @@ function ii(e) {
|
|
|
3249
3302
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
3250
3303
|
if (!a || !c || !l) return;
|
|
3251
3304
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
3252
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
3305
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - qr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + qr), a.scrollTop = oi(u, 0, d), n.value = a.scrollTop, q();
|
|
3253
3306
|
}
|
|
3254
3307
|
function ne(e, r) {
|
|
3255
3308
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
@@ -3282,7 +3335,7 @@ function ii(e) {
|
|
|
3282
3335
|
e.setActiveIndex(i);
|
|
3283
3336
|
}
|
|
3284
3337
|
function re() {
|
|
3285
|
-
let t = n.value <=
|
|
3338
|
+
let t = n.value <= Qr, r = oe() <= Zr;
|
|
3286
3339
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
3287
3340
|
}
|
|
3288
3341
|
function J() {
|
|
@@ -3292,29 +3345,29 @@ function ii(e) {
|
|
|
3292
3345
|
r.value = ie(), a.value = ae();
|
|
3293
3346
|
}
|
|
3294
3347
|
function ie() {
|
|
3295
|
-
return
|
|
3348
|
+
return zr(t.value, r.value);
|
|
3296
3349
|
}
|
|
3297
3350
|
function ae() {
|
|
3298
|
-
return
|
|
3351
|
+
return Br(t.value, a.value, Yr);
|
|
3299
3352
|
}
|
|
3300
3353
|
function oe() {
|
|
3301
|
-
return
|
|
3354
|
+
return Vr(t.value, n.value, r.value, C.value);
|
|
3302
3355
|
}
|
|
3303
3356
|
function se() {
|
|
3304
3357
|
let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
|
|
3305
3358
|
return Math.max(0, e - r.value);
|
|
3306
3359
|
}
|
|
3307
3360
|
function ce() {
|
|
3308
|
-
return
|
|
3361
|
+
return Hr(j.value, M.value);
|
|
3309
3362
|
}
|
|
3310
3363
|
function le(e) {
|
|
3311
|
-
return e.length ?
|
|
3364
|
+
return e.length ? Sr(e, {
|
|
3312
3365
|
columnCount: h.value,
|
|
3313
3366
|
columnWidth: g.value,
|
|
3314
|
-
gapX:
|
|
3315
|
-
gapY:
|
|
3316
|
-
bucketPx:
|
|
3317
|
-
}).contentHeight +
|
|
3367
|
+
gapX: Jr,
|
|
3368
|
+
gapY: Jr,
|
|
3369
|
+
bucketPx: Kr
|
|
3370
|
+
}).contentHeight + qr * 2 : 0;
|
|
3318
3371
|
}
|
|
3319
3372
|
function ue(e) {
|
|
3320
3373
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3336,7 +3389,7 @@ function ii(e) {
|
|
|
3336
3389
|
} finally {
|
|
3337
3390
|
d.value = null, ee = !1;
|
|
3338
3391
|
}
|
|
3339
|
-
},
|
|
3392
|
+
}, ei));
|
|
3340
3393
|
}
|
|
3341
3394
|
function de() {
|
|
3342
3395
|
z &&= (clearTimeout(z), null);
|
|
@@ -3363,27 +3416,27 @@ function ii(e) {
|
|
|
3363
3416
|
scrollViewportRef: t
|
|
3364
3417
|
};
|
|
3365
3418
|
}
|
|
3366
|
-
function
|
|
3419
|
+
function oi(e, t, n) {
|
|
3367
3420
|
return Math.min(Math.max(e, t), n);
|
|
3368
3421
|
}
|
|
3369
|
-
function
|
|
3422
|
+
function si(e) {
|
|
3370
3423
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3371
3424
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3372
|
-
return t <= 0 ? 1 :
|
|
3425
|
+
return t <= 0 ? 1 : oi(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
|
|
3373
3426
|
}
|
|
3374
|
-
function
|
|
3427
|
+
function ci(e) {
|
|
3375
3428
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3376
3429
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3377
|
-
return t <= 0 ? 1 :
|
|
3430
|
+
return t <= 0 ? 1 : oi(e.progressDistancePx / t, 0, 1);
|
|
3378
3431
|
}
|
|
3379
3432
|
//#endregion
|
|
3380
3433
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
3381
|
-
function
|
|
3434
|
+
function li(e) {
|
|
3382
3435
|
if (e) try {
|
|
3383
3436
|
e.removeAttribute("src"), e.src = "";
|
|
3384
3437
|
} catch {}
|
|
3385
3438
|
}
|
|
3386
|
-
function
|
|
3439
|
+
function ui(e) {
|
|
3387
3440
|
if (e) {
|
|
3388
3441
|
try {
|
|
3389
3442
|
e.currentTime = 0;
|
|
@@ -3394,12 +3447,12 @@ function li(e) {
|
|
|
3394
3447
|
} catch {}
|
|
3395
3448
|
}
|
|
3396
3449
|
}
|
|
3397
|
-
function
|
|
3450
|
+
function di(e, t) {
|
|
3398
3451
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
3399
3452
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
3400
3453
|
return e.bottom > 0 && e.top < n;
|
|
3401
3454
|
}
|
|
3402
|
-
function
|
|
3455
|
+
function fi(e) {
|
|
3403
3456
|
if (!e) return null;
|
|
3404
3457
|
try {
|
|
3405
3458
|
return new URL(e, window.location.href).href;
|
|
@@ -3409,9 +3462,9 @@ function di(e) {
|
|
|
3409
3462
|
}
|
|
3410
3463
|
//#endregion
|
|
3411
3464
|
//#region src/components/viewer-core/listPreview.ts
|
|
3412
|
-
var
|
|
3413
|
-
function
|
|
3414
|
-
let t =
|
|
3465
|
+
var pi = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, mi = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, hi = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
|
|
3466
|
+
function gi(e) {
|
|
3467
|
+
let t = _i(e), n = t?.url, r = vr(e), i = e.title?.trim() || Ft(e.type);
|
|
3415
3468
|
return t?.mediaType === "video" && typeof n == "string" ? {
|
|
3416
3469
|
kind: "video",
|
|
3417
3470
|
url: n,
|
|
@@ -3430,13 +3483,13 @@ function hi(e) {
|
|
|
3430
3483
|
width: r.width,
|
|
3431
3484
|
height: r.height,
|
|
3432
3485
|
label: i
|
|
3433
|
-
} : typeof n == "string" &&
|
|
3486
|
+
} : typeof n == "string" && yi(e, n) ? {
|
|
3434
3487
|
kind: "video",
|
|
3435
3488
|
url: n,
|
|
3436
3489
|
width: r.width,
|
|
3437
3490
|
height: r.height,
|
|
3438
3491
|
label: i
|
|
3439
|
-
} : typeof n == "string" &&
|
|
3492
|
+
} : typeof n == "string" && vi(e, n) ? {
|
|
3440
3493
|
kind: "image",
|
|
3441
3494
|
url: n,
|
|
3442
3495
|
width: r.width,
|
|
@@ -3450,26 +3503,26 @@ function hi(e) {
|
|
|
3450
3503
|
label: i
|
|
3451
3504
|
};
|
|
3452
3505
|
}
|
|
3453
|
-
function
|
|
3506
|
+
function _i(e) {
|
|
3454
3507
|
return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
|
|
3455
3508
|
}
|
|
3456
|
-
function _i(e, t) {
|
|
3457
|
-
return e.type !== "image" || typeof t != "string" ? !1 : fi.test(t) || yi(t);
|
|
3458
|
-
}
|
|
3459
3509
|
function vi(e, t) {
|
|
3460
|
-
return e.type !== "
|
|
3510
|
+
return e.type !== "image" || typeof t != "string" ? !1 : pi.test(t) || bi(t);
|
|
3461
3511
|
}
|
|
3462
|
-
function yi(e) {
|
|
3463
|
-
return
|
|
3512
|
+
function yi(e, t) {
|
|
3513
|
+
return e.type !== "video" || typeof t != "string" ? !1 : mi.test(t) || xi(t);
|
|
3464
3514
|
}
|
|
3465
3515
|
function bi(e) {
|
|
3466
|
-
return
|
|
3516
|
+
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
3517
|
+
}
|
|
3518
|
+
function xi(e) {
|
|
3519
|
+
return hi.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
|
|
3467
3520
|
}
|
|
3468
3521
|
//#endregion
|
|
3469
3522
|
//#region src/components/viewer-core/useListCardHealthCheck.ts
|
|
3470
|
-
function
|
|
3523
|
+
function Si(e) {
|
|
3471
3524
|
let t = D(null), n = i(() => {
|
|
3472
|
-
let t = typeof e.item.value.healthCheck?.url == "string" ?
|
|
3525
|
+
let t = typeof e.item.value.healthCheck?.url == "string" ? fi(e.item.value.healthCheck.url) : null;
|
|
3473
3526
|
return !t || t === e.attachedAssetUrl.value ? null : t;
|
|
3474
3527
|
}), r = null, a = 0, o = /* @__PURE__ */ new Map();
|
|
3475
3528
|
L(n, (e, n) => {
|
|
@@ -3501,7 +3554,7 @@ function xi(e) {
|
|
|
3501
3554
|
r.refresh();
|
|
3502
3555
|
return;
|
|
3503
3556
|
}
|
|
3504
|
-
r =
|
|
3557
|
+
r = Lt.request({
|
|
3505
3558
|
assetType: "probe",
|
|
3506
3559
|
getPriority: e.getPriority,
|
|
3507
3560
|
onGrant() {
|
|
@@ -3511,7 +3564,7 @@ function xi(e) {
|
|
|
3511
3564
|
return;
|
|
3512
3565
|
}
|
|
3513
3566
|
let i = ++a;
|
|
3514
|
-
|
|
3567
|
+
dn(r).then((s) => {
|
|
3515
3568
|
if (!(i !== a || n.value !== r)) {
|
|
3516
3569
|
if (o.set(r, s ?? null), !s) {
|
|
3517
3570
|
t.value = null;
|
|
@@ -3547,14 +3600,14 @@ function xi(e) {
|
|
|
3547
3600
|
}
|
|
3548
3601
|
//#endregion
|
|
3549
3602
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
3550
|
-
var
|
|
3603
|
+
var Ci = ["aria-label"], wi = {
|
|
3551
3604
|
key: 0,
|
|
3552
3605
|
"data-testid": "vibe-list-card-spinner",
|
|
3553
3606
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
3554
|
-
},
|
|
3607
|
+
}, Ti = { 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]" }, Ei = ["src", "alt"], Di = ["src"], Oi = ["data-kind"], ki = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ai = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, ji = {
|
|
3555
3608
|
key: 4,
|
|
3556
3609
|
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))]"
|
|
3557
|
-
},
|
|
3610
|
+
}, Mi = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Ni = { class: "pointer-events-none absolute inset-0 z-[3]" }, Pi = /* @__PURE__ */ d({
|
|
3558
3611
|
__name: "ListCard",
|
|
3559
3612
|
props: {
|
|
3560
3613
|
active: {
|
|
@@ -3578,7 +3631,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3578
3631
|
},
|
|
3579
3632
|
emits: ["open"],
|
|
3580
3633
|
setup(e, { emit: t }) {
|
|
3581
|
-
let n = e, r = t, l = i(() =>
|
|
3634
|
+
let n = e, r = t, l = i(() => gi(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 = Si({
|
|
3582
3635
|
attachedAssetUrl: E,
|
|
3583
3636
|
getPriority: ue,
|
|
3584
3637
|
isInView: d,
|
|
@@ -3587,7 +3640,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3587
3640
|
loadErrorKind: g,
|
|
3588
3641
|
reportAssetError: n.reportAssetError,
|
|
3589
3642
|
surfaceActive: i(() => n.surfaceActive)
|
|
3590
|
-
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() =>
|
|
3643
|
+
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => ln(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
|
|
3591
3644
|
L([E, () => l.value.kind], () => {
|
|
3592
3645
|
let e = l.value.kind === "fallback";
|
|
3593
3646
|
m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
|
|
@@ -3628,7 +3681,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3628
3681
|
if (!X(_.value)) return;
|
|
3629
3682
|
let e = E.value ?? n.item.url;
|
|
3630
3683
|
m.value = !1, g.value = "generic";
|
|
3631
|
-
let t = await
|
|
3684
|
+
let t = await un(e);
|
|
3632
3685
|
g.value = t, n.reportAssetError?.({
|
|
3633
3686
|
item: n.item,
|
|
3634
3687
|
occurrenceKey: $(n.item),
|
|
@@ -3660,7 +3713,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3660
3713
|
V?.refresh();
|
|
3661
3714
|
return;
|
|
3662
3715
|
}
|
|
3663
|
-
V =
|
|
3716
|
+
V = Lt.request({
|
|
3664
3717
|
assetType: l.value.kind,
|
|
3665
3718
|
getPriority: ue,
|
|
3666
3719
|
onGrant() {
|
|
@@ -3677,7 +3730,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3677
3730
|
return;
|
|
3678
3731
|
}
|
|
3679
3732
|
if (E.value && d.value && m.value) {
|
|
3680
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
3733
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, mn(e);
|
|
3681
3734
|
return;
|
|
3682
3735
|
}
|
|
3683
3736
|
try {
|
|
@@ -3698,7 +3751,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3698
3751
|
d.value = !0;
|
|
3699
3752
|
return;
|
|
3700
3753
|
}
|
|
3701
|
-
d.value =
|
|
3754
|
+
d.value = di(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
|
|
3702
3755
|
}
|
|
3703
3756
|
function ie(e) {
|
|
3704
3757
|
if (!e) return;
|
|
@@ -3718,10 +3771,10 @@ var Si = ["aria-label"], Ci = {
|
|
|
3718
3771
|
}), g.value = null, m.value = !1, T.value = !1, J(), K();
|
|
3719
3772
|
}
|
|
3720
3773
|
function se() {
|
|
3721
|
-
|
|
3774
|
+
li(_.value);
|
|
3722
3775
|
}
|
|
3723
3776
|
function ce() {
|
|
3724
|
-
|
|
3777
|
+
ui(C.value);
|
|
3725
3778
|
}
|
|
3726
3779
|
function ue() {
|
|
3727
3780
|
let e = y.value;
|
|
@@ -3735,8 +3788,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
3735
3788
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3736
3789
|
}
|
|
3737
3790
|
function X(e) {
|
|
3738
|
-
let t =
|
|
3739
|
-
return !e || !t ? !1 :
|
|
3791
|
+
let t = fi(E.value);
|
|
3792
|
+
return !e || !t ? !1 : fi("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3740
3793
|
}
|
|
3741
3794
|
function de() {
|
|
3742
3795
|
r("open");
|
|
@@ -3744,7 +3797,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3744
3797
|
function fe() {
|
|
3745
3798
|
f.value = !0;
|
|
3746
3799
|
}
|
|
3747
|
-
function
|
|
3800
|
+
function pe(e) {
|
|
3748
3801
|
let t = e.relatedTarget;
|
|
3749
3802
|
y.value && t instanceof Node && y.value.contains(t) || (f.value = !1);
|
|
3750
3803
|
}
|
|
@@ -3754,7 +3807,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3754
3807
|
"data-testid": "vibe-list-card-inner",
|
|
3755
3808
|
class: v(["group relative h-full w-full overflow-hidden border bg-[#0a0b0f] text-[#f7f1ea] transition-[border-color,transform] duration-300", n.active ? "border-white/28" : "border-white/12 hover:border-white/24"]),
|
|
3756
3809
|
onFocusin: fe,
|
|
3757
|
-
onFocusout:
|
|
3810
|
+
onFocusout: pe,
|
|
3758
3811
|
onPointerenter: t[0] ||= (e) => p.value = !0,
|
|
3759
3812
|
onPointerleave: t[1] ||= (e) => p.value = !1
|
|
3760
3813
|
}, [
|
|
@@ -3764,8 +3817,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
3764
3817
|
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]",
|
|
3765
3818
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3766
3819
|
onClick: de
|
|
3767
|
-
}, null, 8,
|
|
3768
|
-
B.value ? (w(), s("div",
|
|
3820
|
+
}, null, 8, Ci),
|
|
3821
|
+
B.value ? (w(), s("div", wi, [c("span", Ti, [u(N(oe), {
|
|
3769
3822
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3770
3823
|
"aria-hidden": "true"
|
|
3771
3824
|
})])])) : o("", !0),
|
|
@@ -3779,7 +3832,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3779
3832
|
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"]),
|
|
3780
3833
|
onLoad: U,
|
|
3781
3834
|
onError: W
|
|
3782
|
-
}, null, 42,
|
|
3835
|
+
}, null, 42, Ei)) : P.value && E.value && !R.value ? (w(), s("video", {
|
|
3783
3836
|
key: 2,
|
|
3784
3837
|
ref_key: "videoRef",
|
|
3785
3838
|
ref: C,
|
|
@@ -3795,31 +3848,31 @@ var Si = ["aria-label"], Ci = {
|
|
|
3795
3848
|
onPlaying: ne,
|
|
3796
3849
|
onStalled: G,
|
|
3797
3850
|
onWaiting: G
|
|
3798
|
-
}, null, 42,
|
|
3851
|
+
}, null, 42, Di)) : R.value ? (w(), s("div", {
|
|
3799
3852
|
key: 3,
|
|
3800
3853
|
"data-testid": "vibe-list-card-error",
|
|
3801
3854
|
"data-kind": I.value,
|
|
3802
3855
|
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))]"
|
|
3803
|
-
}, [c("div",
|
|
3856
|
+
}, [c("div", ki, [
|
|
3804
3857
|
u(N(le), {
|
|
3805
3858
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3806
3859
|
"aria-hidden": "true"
|
|
3807
3860
|
}),
|
|
3808
|
-
c("span",
|
|
3861
|
+
c("span", Ai, j(N(cn)(I.value)), 1),
|
|
3809
3862
|
z.value ? (w(), s("button", {
|
|
3810
3863
|
key: 0,
|
|
3811
3864
|
type: "button",
|
|
3812
3865
|
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",
|
|
3813
3866
|
onClick: ee(ae, ["stop"])
|
|
3814
3867
|
}, " Retry ")) : o("", !0)
|
|
3815
|
-
])], 8,
|
|
3816
|
-
icon: N(
|
|
3868
|
+
])], 8, Oi)) : (w(), s("div", ji, [c("div", Mi, [k(e.$slots, "item-icon", {
|
|
3869
|
+
icon: N(Pt)(n.item.type),
|
|
3817
3870
|
item: n.item
|
|
3818
|
-
}, () => [(w(), a(A(N(
|
|
3871
|
+
}, () => [(w(), a(A(N(Pt)(n.item.type)), {
|
|
3819
3872
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3820
3873
|
"aria-hidden": "true"
|
|
3821
3874
|
}))])])])),
|
|
3822
|
-
c("div",
|
|
3875
|
+
c("div", Ni, [k(e.$slots, "grid-item-overlay", {
|
|
3823
3876
|
active: n.active,
|
|
3824
3877
|
focused: f.value,
|
|
3825
3878
|
hovered: p.value,
|
|
@@ -3829,24 +3882,24 @@ var Si = ["aria-label"], Ci = {
|
|
|
3829
3882
|
})])
|
|
3830
3883
|
], 34));
|
|
3831
3884
|
}
|
|
3832
|
-
}),
|
|
3885
|
+
}), Fi = { 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)]" }, Ii = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Li = {
|
|
3833
3886
|
"data-testid": "vibe-pagination",
|
|
3834
3887
|
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]"
|
|
3835
|
-
},
|
|
3888
|
+
}, Ri = { class: "whitespace-nowrap" }, zi = {
|
|
3836
3889
|
key: 0,
|
|
3837
3890
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3838
|
-
},
|
|
3891
|
+
}, Bi = [
|
|
3839
3892
|
"data-active",
|
|
3840
3893
|
"data-index",
|
|
3841
3894
|
"data-item-id",
|
|
3842
3895
|
"data-occurrence-key"
|
|
3843
|
-
],
|
|
3896
|
+
], Vi = ["data-item-id"], Hi = {
|
|
3844
3897
|
key: 0,
|
|
3845
3898
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3846
|
-
},
|
|
3899
|
+
}, Ui = {
|
|
3847
3900
|
key: 1,
|
|
3848
3901
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3849
|
-
},
|
|
3902
|
+
}, Wi = { class: "mx-auto flex w-full justify-center" }, Gi = /* @__PURE__ */ d({
|
|
3850
3903
|
__name: "ListSurface",
|
|
3851
3904
|
props: {
|
|
3852
3905
|
active: {
|
|
@@ -3907,7 +3960,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3907
3960
|
"update:activeIndex"
|
|
3908
3961
|
],
|
|
3909
3962
|
setup(e, { emit: n }) {
|
|
3910
|
-
let r = e, d = F(), f = n, p =
|
|
3963
|
+
let r = e, d = F(), f = n, p = ai({
|
|
3911
3964
|
active: M(r, "active"),
|
|
3912
3965
|
allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
|
|
3913
3966
|
items: M(r, "items"),
|
|
@@ -3923,11 +3976,11 @@ var Si = ["aria-label"], Ci = {
|
|
|
3923
3976
|
setActiveIndex(e) {
|
|
3924
3977
|
f("update:activeIndex", e);
|
|
3925
3978
|
}
|
|
3926
|
-
}), m = i(() =>
|
|
3979
|
+
}), m = i(() => Qt({
|
|
3927
3980
|
itemCount: r.items.length,
|
|
3928
3981
|
loading: r.loading,
|
|
3929
3982
|
phase: r.phase
|
|
3930
|
-
})), h = i(() =>
|
|
3983
|
+
})), h = i(() => $t({
|
|
3931
3984
|
errorMessage: r.errorMessage,
|
|
3932
3985
|
hasItems: r.items.length > 0,
|
|
3933
3986
|
hasNextPage: r.hasNextPage,
|
|
@@ -3940,7 +3993,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3940
3993
|
message: h.value.message,
|
|
3941
3994
|
paginationDetail: r.paginationDetail,
|
|
3942
3995
|
total: r.items.length
|
|
3943
|
-
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() =>
|
|
3996
|
+
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => qt(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Xt({
|
|
3944
3997
|
emptyStateMode: M(r, "emptyStateMode"),
|
|
3945
3998
|
itemCount: C,
|
|
3946
3999
|
loading: M(r, "loading"),
|
|
@@ -3952,8 +4005,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
3952
4005
|
nextBoundaryLoadProgress: e,
|
|
3953
4006
|
previousBoundaryLoadProgress: t
|
|
3954
4007
|
});
|
|
3955
|
-
}, { immediate: !0 }), (e, n) => (w(), s("div",
|
|
3956
|
-
c("div",
|
|
4008
|
+
}, { immediate: !0 }), (e, n) => (w(), s("div", Fi, [
|
|
4009
|
+
c("div", Ii, [c("span", Li, [c("span", Ri, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", zi, j(r.paginationDetail), 1)) : o("", !0)])]),
|
|
3957
4010
|
c("div", {
|
|
3958
4011
|
ref: N(p).scrollViewportRef,
|
|
3959
4012
|
"data-testid": "vibe-list-scroll",
|
|
@@ -3974,7 +4027,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3974
4027
|
"data-occurrence-key": N($)(t),
|
|
3975
4028
|
class: "absolute will-change-transform",
|
|
3976
4029
|
style: b(N(p).getCardStyle(n))
|
|
3977
|
-
}, [u(
|
|
4030
|
+
}, [u(Pi, {
|
|
3978
4031
|
active: n === N(p).resolvedActiveIndex.value,
|
|
3979
4032
|
index: n,
|
|
3980
4033
|
item: t,
|
|
@@ -3998,14 +4051,14 @@ var Si = ["aria-label"], Ci = {
|
|
|
3998
4051
|
"report-asset-load",
|
|
3999
4052
|
"surface-active",
|
|
4000
4053
|
"onOpen"
|
|
4001
|
-
])], 12,
|
|
4054
|
+
])], 12, Bi))), 128)),
|
|
4002
4055
|
(w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
|
|
4003
4056
|
key: `leaving-${N($)(t.item)}`,
|
|
4004
4057
|
"data-testid": "vibe-list-card-leaving",
|
|
4005
4058
|
"data-item-id": t.item.id,
|
|
4006
4059
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
4007
4060
|
style: b(N(p).getLeavingCardStyle(t.item))
|
|
4008
|
-
}, [u(
|
|
4061
|
+
}, [u(Pi, {
|
|
4009
4062
|
active: !1,
|
|
4010
4063
|
index: -1,
|
|
4011
4064
|
item: t.item,
|
|
@@ -4020,8 +4073,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
4020
4073
|
"item",
|
|
4021
4074
|
"report-asset-error",
|
|
4022
4075
|
"report-asset-load"
|
|
4023
|
-
])], 12,
|
|
4024
|
-
N(A) && N(T) ? (w(), a(
|
|
4076
|
+
])], 12, Vi))), 128)),
|
|
4077
|
+
N(A) && N(T) ? (w(), a(Nn, {
|
|
4025
4078
|
key: 0,
|
|
4026
4079
|
message: N(T).message,
|
|
4027
4080
|
mode: N(T).mode,
|
|
@@ -4035,12 +4088,12 @@ var Si = ["aria-label"], Ci = {
|
|
|
4035
4088
|
"surface"
|
|
4036
4089
|
])) : o("", !0)
|
|
4037
4090
|
], 4)], 544),
|
|
4038
|
-
N(p).showScrollbar.value ? (w(), s("div",
|
|
4091
|
+
N(p).showScrollbar.value ? (w(), s("div", Hi, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
4039
4092
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
4040
4093
|
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"]),
|
|
4041
4094
|
style: b(N(p).getScrollbarThumbStyle())
|
|
4042
4095
|
}, null, 6)])) : o("", !0),
|
|
4043
|
-
d["grid-footer"] ? (w(), s("div",
|
|
4096
|
+
d["grid-footer"] ? (w(), s("div", Ui, [c("div", Wi, [k(e.$slots, "grid-footer")])])) : o("", !0),
|
|
4044
4097
|
_.value ? (w(), s("div", {
|
|
4045
4098
|
key: 2,
|
|
4046
4099
|
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"])
|
|
@@ -4049,7 +4102,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
4049
4102
|
"data-testid": "vibe-grid-status-badge",
|
|
4050
4103
|
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" : ""])
|
|
4051
4104
|
}, j(_.value.message), 3))], 2)) : o("", !0),
|
|
4052
|
-
N(E) && N(T) ? (w(), a(
|
|
4105
|
+
N(E) && N(T) ? (w(), a(Nn, {
|
|
4053
4106
|
key: 3,
|
|
4054
4107
|
class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
4055
4108
|
message: N(T).message,
|
|
@@ -4066,13 +4119,13 @@ var Si = ["aria-label"], Ci = {
|
|
|
4066
4119
|
])) : o("", !0)
|
|
4067
4120
|
]));
|
|
4068
4121
|
}
|
|
4069
|
-
}),
|
|
4122
|
+
}), Ki = ["data-surface-mode"], qi = {
|
|
4070
4123
|
key: 1,
|
|
4071
4124
|
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"
|
|
4072
|
-
},
|
|
4125
|
+
}, Ji = ["data-visible", "inert"], Yi = ["data-visible", "inert"], Xi = {
|
|
4073
4126
|
key: 3,
|
|
4074
4127
|
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"
|
|
4075
|
-
},
|
|
4128
|
+
}, Zi = /* @__PURE__ */ d({
|
|
4076
4129
|
name: "VibeLayout",
|
|
4077
4130
|
__name: "Layout",
|
|
4078
4131
|
props: {
|
|
@@ -4098,9 +4151,9 @@ var Si = ["aria-label"], Ci = {
|
|
|
4098
4151
|
"update:surfaceMode"
|
|
4099
4152
|
],
|
|
4100
4153
|
setup(e, { expose: n, emit: i }) {
|
|
4101
|
-
let d = e, f = F(), m = i, h =
|
|
4154
|
+
let d = e, f = F(), m = i, h = it(d, m), g = fe((e) => {
|
|
4102
4155
|
m("asset-errors", e);
|
|
4103
|
-
}), _ =
|
|
4156
|
+
}), _ = pe((e) => {
|
|
4104
4157
|
m("asset-loads", e);
|
|
4105
4158
|
});
|
|
4106
4159
|
return x(() => {
|
|
@@ -4131,7 +4184,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
4131
4184
|
type: "button",
|
|
4132
4185
|
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",
|
|
4133
4186
|
onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
|
|
4134
|
-
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div",
|
|
4187
|
+
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", qi, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
|
|
4135
4188
|
appear: "",
|
|
4136
4189
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
4137
4190
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -4145,7 +4198,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
4145
4198
|
"data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
|
|
4146
4199
|
inert: N(h).surfaceMode.value !== "list",
|
|
4147
4200
|
class: "absolute inset-0 z-[2]"
|
|
4148
|
-
}, [u(
|
|
4201
|
+
}, [u(Gi, {
|
|
4149
4202
|
active: N(h).surfaceMode.value === "list",
|
|
4150
4203
|
"allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
|
|
4151
4204
|
items: N(h).items.value,
|
|
@@ -4215,7 +4268,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
4215
4268
|
"onBoundaryLoadProgress",
|
|
4216
4269
|
"onOpenFullscreen",
|
|
4217
4270
|
"onUpdate:activeIndex"
|
|
4218
|
-
])], 8,
|
|
4271
|
+
])], 8, Ji), [[I, N(h).surfaceMode.value === "list"]])]),
|
|
4219
4272
|
_: 3
|
|
4220
4273
|
}), u(r, {
|
|
4221
4274
|
appear: "",
|
|
@@ -4231,7 +4284,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
4231
4284
|
"data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
4232
4285
|
inert: N(h).surfaceMode.value !== "fullscreen",
|
|
4233
4286
|
class: "absolute inset-0 z-[3]"
|
|
4234
|
-
}, [u(
|
|
4287
|
+
}, [u(hr, {
|
|
4235
4288
|
items: N(h).items.value,
|
|
4236
4289
|
active: N(h).surfaceMode.value === "fullscreen",
|
|
4237
4290
|
"active-index": N(h).activeIndex.value,
|
|
@@ -4300,12 +4353,12 @@ var Si = ["aria-label"], Ci = {
|
|
|
4300
4353
|
"show-back-to-list",
|
|
4301
4354
|
"onBackToList",
|
|
4302
4355
|
"onUpdate:activeIndex"
|
|
4303
|
-
])], 8,
|
|
4356
|
+
])], 8, Yi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
|
|
4304
4357
|
_: 3
|
|
4305
|
-
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div",
|
|
4358
|
+
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Xi, [u(N(oe), {
|
|
4306
4359
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
4307
4360
|
"aria-hidden": "true"
|
|
4308
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(
|
|
4361
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(hr, {
|
|
4309
4362
|
key: 4,
|
|
4310
4363
|
items: N(h).items.value,
|
|
4311
4364
|
active: !0,
|
|
@@ -4373,10 +4426,10 @@ var Si = ["aria-label"], Ci = {
|
|
|
4373
4426
|
"show-status-badges",
|
|
4374
4427
|
"onBackToList",
|
|
4375
4428
|
"onUpdate:activeIndex"
|
|
4376
|
-
]))], 8,
|
|
4429
|
+
]))], 8, Ki));
|
|
4377
4430
|
}
|
|
4378
|
-
}),
|
|
4379
|
-
e.component("VibeLayout",
|
|
4431
|
+
}), Qi = { install(e) {
|
|
4432
|
+
e.component("VibeLayout", Zi);
|
|
4380
4433
|
} };
|
|
4381
4434
|
//#endregion
|
|
4382
|
-
export {
|
|
4435
|
+
export { Zi as VibeLayout, Qi as VibePlugin, Qi as default };
|