@wyxos/vibe 3.1.9 → 3.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +1 -1
- package/lib/index.js +340 -331
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -466,7 +466,7 @@ function We(e) {
|
|
|
466
466
|
if (he("trailing") || !R.value) {
|
|
467
467
|
if (!B.value) return;
|
|
468
468
|
let e = await ue("trailing");
|
|
469
|
-
e?.
|
|
469
|
+
e?.followCursor && he("trailing") && await le(e.followCursor);
|
|
470
470
|
return;
|
|
471
471
|
}
|
|
472
472
|
await le(F.value);
|
|
@@ -1192,12 +1192,13 @@ function jt(e) {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
//#endregion
|
|
1194
1194
|
//#region src/components/viewer-core/useFullscreenPreloadController.ts
|
|
1195
|
-
var Mt = {
|
|
1195
|
+
var Mt = 2, Nt = {
|
|
1196
1196
|
1: 0,
|
|
1197
1197
|
2: 1,
|
|
1198
|
-
|
|
1198
|
+
3: 2,
|
|
1199
|
+
[-1]: 3
|
|
1199
1200
|
};
|
|
1200
|
-
function
|
|
1201
|
+
function Pt(e) {
|
|
1201
1202
|
let t = D({}), n = Ot({
|
|
1202
1203
|
maxGlobal: 1,
|
|
1203
1204
|
maxPerDomain: 1,
|
|
@@ -1215,20 +1216,20 @@ function Nt(e) {
|
|
|
1215
1216
|
function s(n) {
|
|
1216
1217
|
if (!e.active.value) return !1;
|
|
1217
1218
|
let r = e.items.value[n];
|
|
1218
|
-
if (!r || !
|
|
1219
|
+
if (!r || !Rt(r)) return !1;
|
|
1219
1220
|
let i = e.getItemKey(r);
|
|
1220
1221
|
return i === h() || !!t.value[i];
|
|
1221
1222
|
}
|
|
1222
1223
|
function c(e, t) {
|
|
1223
1224
|
if (t instanceof HTMLImageElement) {
|
|
1224
|
-
i.set(e, t),
|
|
1225
|
+
i.set(e, t), It(t) && u(e);
|
|
1225
1226
|
return;
|
|
1226
1227
|
}
|
|
1227
1228
|
i.delete(e);
|
|
1228
1229
|
}
|
|
1229
1230
|
function l(e, t) {
|
|
1230
1231
|
if (t instanceof HTMLMediaElement) {
|
|
1231
|
-
a.set(e, t),
|
|
1232
|
+
a.set(e, t), Lt(t) && u(e);
|
|
1232
1233
|
return;
|
|
1233
1234
|
}
|
|
1234
1235
|
a.delete(e);
|
|
@@ -1267,7 +1268,7 @@ function Nt(e) {
|
|
|
1267
1268
|
assetType: e.item.type === "image" ? "image" : "video",
|
|
1268
1269
|
getPriority: () => g(o.index),
|
|
1269
1270
|
onGrant: () => {
|
|
1270
|
-
v(e.key, !0),
|
|
1271
|
+
v(e.key, !0), Ft(e.key, i, a) && u(e.key);
|
|
1271
1272
|
},
|
|
1272
1273
|
url: e.item.url
|
|
1273
1274
|
})
|
|
@@ -1277,26 +1278,34 @@ function Nt(e) {
|
|
|
1277
1278
|
_();
|
|
1278
1279
|
}
|
|
1279
1280
|
function m() {
|
|
1280
|
-
let
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1281
|
+
let n = e.resolvedActiveIndex.value, i = e.items.value.map((t, n) => Rt(t) ? {
|
|
1282
|
+
index: n,
|
|
1283
|
+
item: t,
|
|
1284
|
+
key: e.getItemKey(t)
|
|
1285
|
+
} : null).filter((e) => !!e), a = new Map(i.map((e) => [e.key, e])), o = /* @__PURE__ */ new Set(), s = [], c = (e) => {
|
|
1286
|
+
!e || o.has(e.key) || (o.add(e.key), s.push(e));
|
|
1287
|
+
}, l = /* @__PURE__ */ new Map();
|
|
1288
|
+
for (let e of Object.keys(t.value)) {
|
|
1289
|
+
let t = a.get(e);
|
|
1290
|
+
t && t.index > n && l.set(e, t);
|
|
1291
|
+
}
|
|
1292
|
+
for (let e of r.values()) {
|
|
1293
|
+
if (e.index <= n) continue;
|
|
1294
|
+
let t = a.get(e.key);
|
|
1295
|
+
t && l.set(e.key, t);
|
|
1296
|
+
}
|
|
1297
|
+
let u = [...l.values()].sort((e, t) => e.index - t.index);
|
|
1298
|
+
for (let e of u) c(e);
|
|
1299
|
+
let d = u.reduce((e, t) => Math.max(e, t.index), n), f = 0;
|
|
1300
|
+
for (let e of i) if (!(e.index <= d || o.has(e.key)) && (c(e), f += 1, f >= Mt)) break;
|
|
1301
|
+
return c(i.find((e) => e.index === n - 1)), s;
|
|
1293
1302
|
}
|
|
1294
1303
|
function h() {
|
|
1295
1304
|
let t = e.items.value[e.resolvedActiveIndex.value];
|
|
1296
|
-
return !e.active.value || !t || !
|
|
1305
|
+
return !e.active.value || !t || !Rt(t) ? null : e.getItemKey(t);
|
|
1297
1306
|
}
|
|
1298
1307
|
function g(t) {
|
|
1299
|
-
return e.active.value ?
|
|
1308
|
+
return e.active.value ? Nt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
|
|
1300
1309
|
}
|
|
1301
1310
|
function _() {
|
|
1302
1311
|
let n = /* @__PURE__ */ new Set(), r = h();
|
|
@@ -1342,26 +1351,26 @@ function Nt(e) {
|
|
|
1342
1351
|
shouldAttachSlideAsset: s
|
|
1343
1352
|
};
|
|
1344
1353
|
}
|
|
1345
|
-
function
|
|
1354
|
+
function Ft(e, t, n) {
|
|
1346
1355
|
let r = t.get(e);
|
|
1347
|
-
if (r) return
|
|
1356
|
+
if (r) return It(r);
|
|
1348
1357
|
let i = n.get(e);
|
|
1349
|
-
return i ?
|
|
1358
|
+
return i ? Lt(i) : !1;
|
|
1350
1359
|
}
|
|
1351
|
-
function
|
|
1360
|
+
function It(e) {
|
|
1352
1361
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1353
1362
|
}
|
|
1354
|
-
function
|
|
1363
|
+
function Lt(e) {
|
|
1355
1364
|
let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
1356
1365
|
return e.readyState >= t;
|
|
1357
1366
|
}
|
|
1358
|
-
function
|
|
1367
|
+
function Rt(e) {
|
|
1359
1368
|
return e.type === "image" || e.type === "video" || e.type === "audio";
|
|
1360
1369
|
}
|
|
1361
1370
|
//#endregion
|
|
1362
1371
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
1363
|
-
function
|
|
1364
|
-
let t =
|
|
1372
|
+
function zt(e) {
|
|
1373
|
+
let t = Pt({
|
|
1365
1374
|
active: e.active,
|
|
1366
1375
|
getItemKey: r,
|
|
1367
1376
|
items: e.items,
|
|
@@ -1418,11 +1427,11 @@ function Rt(e) {
|
|
|
1418
1427
|
}
|
|
1419
1428
|
//#endregion
|
|
1420
1429
|
//#region src/components/viewer-core/slotContent.ts
|
|
1421
|
-
function
|
|
1430
|
+
function Bt(e) {
|
|
1422
1431
|
if (!Array.isArray(e)) return !1;
|
|
1423
1432
|
for (let t of e) {
|
|
1424
1433
|
if (Array.isArray(t)) {
|
|
1425
|
-
if (
|
|
1434
|
+
if (Bt(t)) return !0;
|
|
1426
1435
|
continue;
|
|
1427
1436
|
}
|
|
1428
1437
|
if (!h(t)) {
|
|
@@ -1433,20 +1442,20 @@ function zt(e) {
|
|
|
1433
1442
|
if (t != null && t !== !1) return !0;
|
|
1434
1443
|
continue;
|
|
1435
1444
|
}
|
|
1436
|
-
if (!
|
|
1445
|
+
if (!Vt(t)) return !0;
|
|
1437
1446
|
}
|
|
1438
1447
|
return !1;
|
|
1439
1448
|
}
|
|
1440
|
-
function
|
|
1441
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1449
|
+
function Vt(r) {
|
|
1450
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Bt(r.children) : !1;
|
|
1442
1451
|
}
|
|
1443
1452
|
//#endregion
|
|
1444
1453
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1445
|
-
var
|
|
1446
|
-
function
|
|
1454
|
+
var Ht = "no items available";
|
|
1455
|
+
function Ut(e) {
|
|
1447
1456
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1448
1457
|
loading: !!e.loading.value,
|
|
1449
|
-
message:
|
|
1458
|
+
message: Ht,
|
|
1450
1459
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1451
1460
|
surface: e.surface,
|
|
1452
1461
|
total: e.itemCount.value
|
|
@@ -1454,23 +1463,23 @@ function Ht(e) {
|
|
|
1454
1463
|
return {
|
|
1455
1464
|
emptyStateProps: t,
|
|
1456
1465
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1457
|
-
showCustomEmptyState: i(() =>
|
|
1466
|
+
showCustomEmptyState: i(() => Bt(n.value)),
|
|
1458
1467
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1459
1468
|
};
|
|
1460
1469
|
}
|
|
1461
1470
|
//#endregion
|
|
1462
1471
|
//#region src/components/viewer-core/format.ts
|
|
1463
|
-
function
|
|
1472
|
+
function Wt(e) {
|
|
1464
1473
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1465
1474
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1466
1475
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1467
1476
|
}
|
|
1468
1477
|
//#endregion
|
|
1469
1478
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1470
|
-
function
|
|
1479
|
+
function Gt(e) {
|
|
1471
1480
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1472
1481
|
}
|
|
1473
|
-
function
|
|
1482
|
+
function Kt(e) {
|
|
1474
1483
|
return e.phase === "failed" ? {
|
|
1475
1484
|
kind: "failed",
|
|
1476
1485
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1493,7 +1502,7 @@ function Gt(e) {
|
|
|
1493
1502
|
}
|
|
1494
1503
|
//#endregion
|
|
1495
1504
|
//#region src/components/viewer-core/useActivation.ts
|
|
1496
|
-
function
|
|
1505
|
+
function qt(e) {
|
|
1497
1506
|
let t = !1;
|
|
1498
1507
|
L(e.enabled, async (t) => {
|
|
1499
1508
|
if (n(t), t) {
|
|
@@ -1516,7 +1525,7 @@ function Kt(e) {
|
|
|
1516
1525
|
}
|
|
1517
1526
|
//#endregion
|
|
1518
1527
|
//#region src/components/viewer-core/assetState.ts
|
|
1519
|
-
var
|
|
1528
|
+
var Jt = {
|
|
1520
1529
|
currentTime: 0,
|
|
1521
1530
|
duration: 0,
|
|
1522
1531
|
errorKind: null,
|
|
@@ -1525,38 +1534,38 @@ var qt = {
|
|
|
1525
1534
|
ready: !1,
|
|
1526
1535
|
volume: 1
|
|
1527
1536
|
};
|
|
1528
|
-
function
|
|
1529
|
-
return { ...
|
|
1537
|
+
function Yt() {
|
|
1538
|
+
return { ...Jt };
|
|
1530
1539
|
}
|
|
1531
|
-
function
|
|
1540
|
+
function Xt(e) {
|
|
1532
1541
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1533
1542
|
}
|
|
1534
|
-
function
|
|
1535
|
-
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 =
|
|
1543
|
+
function Zt(e, t, n) {
|
|
1544
|
+
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 = Qt(t, n);
|
|
1536
1545
|
}
|
|
1537
|
-
function
|
|
1546
|
+
function Qt(e, t) {
|
|
1538
1547
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1539
1548
|
}
|
|
1540
1549
|
//#endregion
|
|
1541
1550
|
//#region src/components/viewer-core/loadError.ts
|
|
1542
|
-
var
|
|
1543
|
-
function $t(e) {
|
|
1544
|
-
return e === "not-found" ? "404" : "Load error";
|
|
1545
|
-
}
|
|
1551
|
+
var $t = /* @__PURE__ */ new Map();
|
|
1546
1552
|
function en(e) {
|
|
1547
|
-
return e === "
|
|
1553
|
+
return e === "not-found" ? "404" : "Load error";
|
|
1548
1554
|
}
|
|
1549
1555
|
function tn(e) {
|
|
1550
|
-
return
|
|
1556
|
+
return e === "generic";
|
|
1551
1557
|
}
|
|
1552
1558
|
function nn(e) {
|
|
1553
|
-
|
|
1559
|
+
return rn(e).then((e) => e ?? "generic");
|
|
1560
|
+
}
|
|
1561
|
+
function rn(e) {
|
|
1562
|
+
let t = $t.get(e);
|
|
1554
1563
|
if (t) return t;
|
|
1555
|
-
let n =
|
|
1556
|
-
return
|
|
1564
|
+
let n = an(e);
|
|
1565
|
+
return $t.set(e, n), n;
|
|
1557
1566
|
}
|
|
1558
|
-
async function
|
|
1559
|
-
if (!
|
|
1567
|
+
async function an(e) {
|
|
1568
|
+
if (!on(e)) return null;
|
|
1560
1569
|
try {
|
|
1561
1570
|
let t = await fetch(e, { method: "HEAD" });
|
|
1562
1571
|
return t.ok ? null : t.status === 404 ? "not-found" : "generic";
|
|
@@ -1564,12 +1573,12 @@ async function rn(e) {
|
|
|
1564
1573
|
return "generic";
|
|
1565
1574
|
}
|
|
1566
1575
|
}
|
|
1567
|
-
function
|
|
1576
|
+
function on(e) {
|
|
1568
1577
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1569
1578
|
}
|
|
1570
1579
|
//#endregion
|
|
1571
1580
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1572
|
-
function
|
|
1581
|
+
function sn(e) {
|
|
1573
1582
|
try {
|
|
1574
1583
|
let t = e.play();
|
|
1575
1584
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1577,12 +1586,12 @@ function on(e) {
|
|
|
1577
1586
|
}
|
|
1578
1587
|
//#endregion
|
|
1579
1588
|
//#region src/components/viewer-core/useMedia.ts
|
|
1580
|
-
function
|
|
1589
|
+
function cn(e) {
|
|
1581
1590
|
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(() => {
|
|
1582
1591
|
let t = /* @__PURE__ */ new Map();
|
|
1583
1592
|
for (let n of e.items.value) t.set($(n), n);
|
|
1584
1593
|
return t;
|
|
1585
|
-
}), p = i(() => d.value ? r.value[d.value] ??
|
|
1594
|
+
}), p = i(() => d.value ? r.value[d.value] ?? Jt : Jt), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : ln(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
|
|
1586
1595
|
L(() => u.value, async () => {
|
|
1587
1596
|
await C();
|
|
1588
1597
|
}), L(() => e.itemCount.value, async () => {
|
|
@@ -1605,7 +1614,7 @@ function sn(e) {
|
|
|
1605
1614
|
c.delete(e);
|
|
1606
1615
|
}
|
|
1607
1616
|
function b(e, r) {
|
|
1608
|
-
r instanceof HTMLImageElement &&
|
|
1617
|
+
r instanceof HTMLImageElement && Xt(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
|
|
1609
1618
|
}
|
|
1610
1619
|
function x() {
|
|
1611
1620
|
H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
|
|
@@ -1627,14 +1636,14 @@ function sn(e) {
|
|
|
1627
1636
|
V(i, n);
|
|
1628
1637
|
continue;
|
|
1629
1638
|
}
|
|
1630
|
-
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0,
|
|
1639
|
+
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, sn(i), W(n, i);
|
|
1631
1640
|
}
|
|
1632
1641
|
for (let [e, n] of c.entries()) {
|
|
1633
1642
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1634
1643
|
V(n, e);
|
|
1635
1644
|
continue;
|
|
1636
1645
|
}
|
|
1637
|
-
|
|
1646
|
+
sn(n), W(e, n);
|
|
1638
1647
|
}
|
|
1639
1648
|
}
|
|
1640
1649
|
function w(e, t) {
|
|
@@ -1652,7 +1661,7 @@ function sn(e) {
|
|
|
1652
1661
|
async function E(r, i) {
|
|
1653
1662
|
let a = Y(r) ?? e.activeItem.value;
|
|
1654
1663
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1655
|
-
let o = await
|
|
1664
|
+
let o = await nn(i);
|
|
1656
1665
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1657
1666
|
item: a,
|
|
1658
1667
|
occurrenceKey: r,
|
|
@@ -1670,7 +1679,7 @@ function sn(e) {
|
|
|
1670
1679
|
} catch {}
|
|
1671
1680
|
}
|
|
1672
1681
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1673
|
-
let o = await
|
|
1682
|
+
let o = await nn(n);
|
|
1674
1683
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1675
1684
|
item: a,
|
|
1676
1685
|
occurrenceKey: t,
|
|
@@ -1690,13 +1699,13 @@ function sn(e) {
|
|
|
1690
1699
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1691
1700
|
let r = Number.parseFloat(e.target.value);
|
|
1692
1701
|
if (!Number.isFinite(r)) return;
|
|
1693
|
-
let i =
|
|
1702
|
+
let i = ln(r, 0, m.value || 0);
|
|
1694
1703
|
ne(n, i, t), t.currentTime = i;
|
|
1695
1704
|
}
|
|
1696
1705
|
function M(e) {
|
|
1697
1706
|
let t = q(), n = d.value;
|
|
1698
1707
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1699
|
-
let r =
|
|
1708
|
+
let r = ln(Number.parseFloat(e.target.value), 0, 1);
|
|
1700
1709
|
t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
|
|
1701
1710
|
}
|
|
1702
1711
|
function N() {
|
|
@@ -1717,10 +1726,10 @@ function sn(e) {
|
|
|
1717
1726
|
}
|
|
1718
1727
|
function z(e) {
|
|
1719
1728
|
let t = R(e);
|
|
1720
|
-
return t ?
|
|
1729
|
+
return t ? en(t) : null;
|
|
1721
1730
|
}
|
|
1722
1731
|
function B(e) {
|
|
1723
|
-
return
|
|
1732
|
+
return tn(R(e));
|
|
1724
1733
|
}
|
|
1725
1734
|
function ee(e) {
|
|
1726
1735
|
return `${e}:${a.value[e] ?? 0}`;
|
|
@@ -1747,17 +1756,17 @@ function sn(e) {
|
|
|
1747
1756
|
for (let [e, t] of c.entries()) V(t, e);
|
|
1748
1757
|
}
|
|
1749
1758
|
function U(e) {
|
|
1750
|
-
return r.value[e] || (r.value[e] =
|
|
1759
|
+
return r.value[e] || (r.value[e] = Yt()), r.value[e];
|
|
1751
1760
|
}
|
|
1752
1761
|
function W(e, t, n) {
|
|
1753
|
-
|
|
1762
|
+
Zt(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
|
|
1754
1763
|
}
|
|
1755
1764
|
function ne(e, t, n) {
|
|
1756
1765
|
let r = U(e);
|
|
1757
1766
|
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;
|
|
1758
1767
|
}
|
|
1759
1768
|
function G(e) {
|
|
1760
|
-
return
|
|
1769
|
+
return ln(o.value[e] ?? 1, 0, 1);
|
|
1761
1770
|
}
|
|
1762
1771
|
function K(e) {
|
|
1763
1772
|
return s.get(e) ?? c.get(e) ?? null;
|
|
@@ -1768,7 +1777,7 @@ function sn(e) {
|
|
|
1768
1777
|
function re(e) {
|
|
1769
1778
|
if (e) {
|
|
1770
1779
|
if (e.paused) {
|
|
1771
|
-
|
|
1780
|
+
sn(e);
|
|
1772
1781
|
return;
|
|
1773
1782
|
}
|
|
1774
1783
|
e.pause();
|
|
@@ -1822,10 +1831,10 @@ function sn(e) {
|
|
|
1822
1831
|
syncMediaPlayback: C
|
|
1823
1832
|
};
|
|
1824
1833
|
}
|
|
1825
|
-
function
|
|
1834
|
+
function ln(e, t, n) {
|
|
1826
1835
|
return Math.min(Math.max(e, t), n);
|
|
1827
1836
|
}
|
|
1828
|
-
function
|
|
1837
|
+
function un(e, t, n = 2) {
|
|
1829
1838
|
return t <= 0 ? {
|
|
1830
1839
|
start: 0,
|
|
1831
1840
|
end: -1
|
|
@@ -1834,14 +1843,14 @@ function ln(e, t, n = 2) {
|
|
|
1834
1843
|
end: Math.min(t - 1, e + n)
|
|
1835
1844
|
};
|
|
1836
1845
|
}
|
|
1837
|
-
function
|
|
1838
|
-
let r =
|
|
1846
|
+
function dn(e, t, n = 2) {
|
|
1847
|
+
let r = un(t, e.length, n);
|
|
1839
1848
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1840
1849
|
item: e,
|
|
1841
1850
|
index: r.start + t
|
|
1842
1851
|
}));
|
|
1843
1852
|
}
|
|
1844
|
-
function
|
|
1853
|
+
function fn(e, t, n, r, i) {
|
|
1845
1854
|
return {
|
|
1846
1855
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1847
1856
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1849,12 +1858,12 @@ function dn(e, t, n, r, i) {
|
|
|
1849
1858
|
}
|
|
1850
1859
|
//#endregion
|
|
1851
1860
|
//#region src/components/viewer-core/useViewer.ts
|
|
1852
|
-
function
|
|
1853
|
-
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(() =>
|
|
1861
|
+
function pn(e, t, n = {}) {
|
|
1862
|
+
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(() => Gt({
|
|
1854
1863
|
itemCount: r.value.length,
|
|
1855
1864
|
loading: s.value,
|
|
1856
1865
|
phase: e.phase
|
|
1857
|
-
})), 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 =
|
|
1866
|
+
})), 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 = cn({
|
|
1858
1867
|
items: r,
|
|
1859
1868
|
activeItem: C,
|
|
1860
1869
|
activeMediaItem: w,
|
|
@@ -1863,14 +1872,14 @@ function fn(e, t, n = {}) {
|
|
|
1863
1872
|
loopFullscreenVideo: l,
|
|
1864
1873
|
onAssetError: n.onAssetError,
|
|
1865
1874
|
onAssetLoad: n.onAssetLoad
|
|
1866
|
-
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() =>
|
|
1875
|
+
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Kt({
|
|
1867
1876
|
errorMessage: o.value,
|
|
1868
1877
|
hasItems: r.value.length > 0,
|
|
1869
1878
|
hasNextPage: c.value,
|
|
1870
1879
|
phase: d.value,
|
|
1871
1880
|
surface: "fullscreen"
|
|
1872
|
-
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() =>
|
|
1873
|
-
|
|
1881
|
+
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => un(S.value, r.value.length)), N = i(() => dn(r.value, S.value));
|
|
1882
|
+
qt({
|
|
1874
1883
|
enabled: _,
|
|
1875
1884
|
onDisable() {
|
|
1876
1885
|
H(), T.resetMediaState();
|
|
@@ -1948,7 +1957,7 @@ function fn(e, t, n = {}) {
|
|
|
1948
1957
|
return e.type === "audio";
|
|
1949
1958
|
}
|
|
1950
1959
|
function ie(e) {
|
|
1951
|
-
return
|
|
1960
|
+
return fn(e, S.value, g.value, m.value, h.value);
|
|
1952
1961
|
}
|
|
1953
1962
|
return {
|
|
1954
1963
|
activeItem: C,
|
|
@@ -1963,7 +1972,7 @@ function fn(e, t, n = {}) {
|
|
|
1963
1972
|
getAssetErrorKind: T.getAssetErrorKind,
|
|
1964
1973
|
getAssetErrorLabel: T.getAssetErrorLabel,
|
|
1965
1974
|
getAssetRenderKey: T.getAssetRenderKey,
|
|
1966
|
-
formatPlaybackTime:
|
|
1975
|
+
formatPlaybackTime: Wt,
|
|
1967
1976
|
getImageSource: T.getImageSource,
|
|
1968
1977
|
getSlideStyle: ie,
|
|
1969
1978
|
hasNextPage: c,
|
|
@@ -2007,21 +2016,21 @@ function fn(e, t, n = {}) {
|
|
|
2007
2016
|
}
|
|
2008
2017
|
//#endregion
|
|
2009
2018
|
//#region src/components/viewer-core/theme.ts
|
|
2010
|
-
var
|
|
2019
|
+
var mn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", hn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", gn = {
|
|
2011
2020
|
image: !0,
|
|
2012
2021
|
video: !0,
|
|
2013
2022
|
audio: !0,
|
|
2014
2023
|
other: !0
|
|
2015
2024
|
};
|
|
2016
|
-
function gn(e) {
|
|
2017
|
-
return hn[e], pn;
|
|
2018
|
-
}
|
|
2019
2025
|
function _n(e) {
|
|
2020
|
-
return
|
|
2026
|
+
return gn[e], mn;
|
|
2027
|
+
}
|
|
2028
|
+
function vn(e) {
|
|
2029
|
+
return gn[e], hn;
|
|
2021
2030
|
}
|
|
2022
2031
|
//#endregion
|
|
2023
2032
|
//#region src/components/viewer-core/dominantImageTone.ts
|
|
2024
|
-
function
|
|
2033
|
+
function yn(e) {
|
|
2025
2034
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
2026
2035
|
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
2027
2036
|
if (!n) return null;
|
|
@@ -2036,20 +2045,20 @@ function vn(e) {
|
|
|
2036
2045
|
r += d, i += s * d, a += c * d, o += l * d;
|
|
2037
2046
|
}
|
|
2038
2047
|
return r <= 0 ? null : {
|
|
2039
|
-
r:
|
|
2040
|
-
g:
|
|
2041
|
-
b:
|
|
2048
|
+
r: bn(Math.round(i / r)),
|
|
2049
|
+
g: bn(Math.round(a / r)),
|
|
2050
|
+
b: bn(Math.round(o / r))
|
|
2042
2051
|
};
|
|
2043
2052
|
} catch {
|
|
2044
2053
|
return null;
|
|
2045
2054
|
}
|
|
2046
2055
|
}
|
|
2047
|
-
function
|
|
2056
|
+
function bn(e) {
|
|
2048
2057
|
return Math.min(235, Math.max(26, e));
|
|
2049
2058
|
}
|
|
2050
2059
|
//#endregion
|
|
2051
2060
|
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
2052
|
-
function
|
|
2061
|
+
function xn(e) {
|
|
2053
2062
|
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(() => {
|
|
2054
2063
|
if (!r.value) return;
|
|
2055
2064
|
let { r: e, g: t, b: n } = r.value;
|
|
@@ -2064,7 +2073,7 @@ function bn(e) {
|
|
|
2064
2073
|
});
|
|
2065
2074
|
function s(n, r) {
|
|
2066
2075
|
if (!e.showDominantImageTone.value) return;
|
|
2067
|
-
let i =
|
|
2076
|
+
let i = yn(r);
|
|
2068
2077
|
i && (t.value[n] = i);
|
|
2069
2078
|
}
|
|
2070
2079
|
return {
|
|
@@ -2075,7 +2084,7 @@ function bn(e) {
|
|
|
2075
2084
|
}
|
|
2076
2085
|
//#endregion
|
|
2077
2086
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
2078
|
-
var
|
|
2087
|
+
var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
2079
2088
|
inheritAttrs: !1,
|
|
2080
2089
|
__name: "SurfaceEmptyState",
|
|
2081
2090
|
props: {
|
|
@@ -2089,31 +2098,31 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2089
2098
|
"data-testid": "vibe-empty-state-inline",
|
|
2090
2099
|
"data-surface": e.surface,
|
|
2091
2100
|
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)]"]
|
|
2092
|
-
}), [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,
|
|
2101
|
+
}), [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, Sn)) : (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", {
|
|
2093
2102
|
"data-testid": "vibe-empty-state-badge",
|
|
2094
2103
|
"data-surface": e.surface,
|
|
2095
2104
|
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"])
|
|
2096
|
-
}, j(e.message), 11,
|
|
2105
|
+
}, j(e.message), 11, Cn)])], 16));
|
|
2097
2106
|
}
|
|
2098
|
-
}),
|
|
2107
|
+
}), Tn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, En = {
|
|
2099
2108
|
key: 0,
|
|
2100
2109
|
class: "relative h-full min-h-0"
|
|
2101
|
-
},
|
|
2110
|
+
}, Dn = [
|
|
2102
2111
|
"data-item-id",
|
|
2103
2112
|
"data-occurrence-key",
|
|
2104
2113
|
"data-index",
|
|
2105
2114
|
"data-active",
|
|
2106
2115
|
"aria-hidden"
|
|
2107
|
-
],
|
|
2116
|
+
], On = {
|
|
2108
2117
|
key: 0,
|
|
2109
2118
|
"data-testid": "vibe-asset-spinner",
|
|
2110
2119
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
2111
|
-
},
|
|
2120
|
+
}, kn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, An = ["data-kind"], jn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Mn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Nn = ["onClick"], Pn = [
|
|
2112
2121
|
"src",
|
|
2113
2122
|
"alt",
|
|
2114
2123
|
"onLoad",
|
|
2115
2124
|
"onError"
|
|
2116
|
-
],
|
|
2125
|
+
], Fn = [
|
|
2117
2126
|
"loop",
|
|
2118
2127
|
"src",
|
|
2119
2128
|
"preload",
|
|
@@ -2132,15 +2141,15 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2132
2141
|
"onStalled",
|
|
2133
2142
|
"onTimeupdate",
|
|
2134
2143
|
"onWaiting"
|
|
2135
|
-
],
|
|
2144
|
+
], In = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Ln = [
|
|
2136
2145
|
"aria-label",
|
|
2137
2146
|
"disabled",
|
|
2138
2147
|
"onClick"
|
|
2139
|
-
],
|
|
2148
|
+
], Rn = { 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]" }, zn = { 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]" }, Bn = {
|
|
2140
2149
|
key: 0,
|
|
2141
2150
|
"data-testid": "vibe-asset-spinner",
|
|
2142
2151
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
2143
|
-
},
|
|
2152
|
+
}, Vn = { 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]" }, Hn = ["data-kind"], Un = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Wn = ["onClick"], Gn = [
|
|
2144
2153
|
"src",
|
|
2145
2154
|
"preload",
|
|
2146
2155
|
"onCanplay",
|
|
@@ -2156,26 +2165,26 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2156
2165
|
"onStalled",
|
|
2157
2166
|
"onTimeupdate",
|
|
2158
2167
|
"onWaiting"
|
|
2159
|
-
],
|
|
2168
|
+
], Kn = {
|
|
2160
2169
|
key: 2,
|
|
2161
2170
|
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"
|
|
2162
|
-
},
|
|
2171
|
+
}, qn = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, Jn = {
|
|
2163
2172
|
key: 0,
|
|
2164
2173
|
"data-testid": "vibe-fullscreen-overlay",
|
|
2165
2174
|
class: "pointer-events-none absolute inset-0 z-[6]"
|
|
2166
|
-
},
|
|
2175
|
+
}, Yn = { class: "h-full w-full" }, Xn = {
|
|
2167
2176
|
key: 1,
|
|
2168
2177
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
2169
2178
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
2170
|
-
},
|
|
2179
|
+
}, Zn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, Qn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)]" }, $n = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, er = {
|
|
2171
2180
|
key: 0,
|
|
2172
2181
|
"data-testid": "vibe-fullscreen-aside",
|
|
2173
2182
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
2174
|
-
},
|
|
2183
|
+
}, tr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, nr = {
|
|
2175
2184
|
key: 0,
|
|
2176
2185
|
"data-testid": "vibe-fullscreen-aside",
|
|
2177
2186
|
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]"
|
|
2178
|
-
},
|
|
2187
|
+
}, rr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, ir = 1280, ar = 768, or = /* @__PURE__ */ d({
|
|
2179
2188
|
__name: "FullscreenSurface",
|
|
2180
2189
|
props: {
|
|
2181
2190
|
active: {
|
|
@@ -2227,23 +2236,23 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2227
2236
|
},
|
|
2228
2237
|
emits: ["back-to-list", "update:activeIndex"],
|
|
2229
2238
|
setup(e, { emit: n }) {
|
|
2230
|
-
let d = e, f = F(), m = n, h =
|
|
2239
|
+
let d = e, f = F(), m = n, h = pn(d, (e, t) => {
|
|
2231
2240
|
m("update:activeIndex", t);
|
|
2232
2241
|
}, {
|
|
2233
2242
|
enabled: M(d, "active"),
|
|
2234
2243
|
onAssetError: d.reportAssetError ?? void 0,
|
|
2235
2244
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
2236
|
-
}), _ = D(typeof window > "u" ?
|
|
2245
|
+
}), _ = D(typeof window > "u" ? ir : window.innerWidth || ir), C = zt({
|
|
2237
2246
|
active: M(d, "active"),
|
|
2238
2247
|
items: h.items,
|
|
2239
2248
|
resolvedActiveIndex: h.resolvedActiveIndex,
|
|
2240
2249
|
viewer: h
|
|
2241
|
-
}), T = i(() =>
|
|
2250
|
+
}), T = i(() => _n(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = xn({
|
|
2242
2251
|
activeItem: h.activeItem,
|
|
2243
2252
|
getItemKey: C.getItemKey,
|
|
2244
2253
|
isImageReady: h.isImageReady,
|
|
2245
2254
|
showDominantImageTone: M(d, "showDominantImageTone")
|
|
2246
|
-
}), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value <
|
|
2255
|
+
}), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value < ar ? "vertical" : "horizontal"), te = i(() => R.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), V = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), H = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), U = i(() => {
|
|
2247
2256
|
let e = h.activeItem.value;
|
|
2248
2257
|
return e ? {
|
|
2249
2258
|
hasNextPage: d.hasNextPage,
|
|
@@ -2260,7 +2269,7 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2260
2269
|
}), K = i(() => !G.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](G.value)), q = i(() => ({
|
|
2261
2270
|
gridTemplateColumns: Y.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
2262
2271
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
2263
|
-
})), re = i(() =>
|
|
2272
|
+
})), re = i(() => Bt(W.value)), J = i(() => Bt(ne.value)), Y = i(() => J.value && _.value >= ir), ie = i(() => J.value && !Y.value), ae = i(() => Bt(K.value)), { emptyStateProps: X, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = Ut({
|
|
2264
2273
|
emptyStateMode: M(d, "emptyStateMode"),
|
|
2265
2274
|
itemCount: i(() => d.items.length),
|
|
2266
2275
|
loading: M(d, "loading"),
|
|
@@ -2273,7 +2282,7 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2273
2282
|
window.removeEventListener("resize", Z);
|
|
2274
2283
|
});
|
|
2275
2284
|
function Z() {
|
|
2276
|
-
_.value = window.innerWidth ||
|
|
2285
|
+
_.value = window.innerWidth || ir;
|
|
2277
2286
|
}
|
|
2278
2287
|
function pe(e, t, n) {
|
|
2279
2288
|
C.settleBackgroundPreload(t), h.onImageLoad(t, n);
|
|
@@ -2313,7 +2322,7 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2313
2322
|
let r = n.play();
|
|
2314
2323
|
r && typeof r.catch == "function" && r.catch(() => {});
|
|
2315
2324
|
}
|
|
2316
|
-
return (e, n) => (w(), s("div",
|
|
2325
|
+
return (e, n) => (w(), s("div", Tn, [
|
|
2317
2326
|
c("div", {
|
|
2318
2327
|
class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
|
|
2319
2328
|
style: b(N(P))
|
|
@@ -2330,7 +2339,7 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2330
2339
|
onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
|
|
2331
2340
|
onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
|
|
2332
2341
|
onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
|
|
2333
|
-
}, [N(h).activeItem.value ? (w(), s("div",
|
|
2342
|
+
}, [N(h).activeItem.value ? (w(), s("div", En, [
|
|
2334
2343
|
(w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
|
|
2335
2344
|
key: N(C).getItemKey(r),
|
|
2336
2345
|
"data-testid": "vibe-slide",
|
|
@@ -2342,12 +2351,12 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2342
2351
|
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"]),
|
|
2343
2352
|
style: b(N(h).getSlideStyle(i))
|
|
2344
2353
|
}, [c("div", {
|
|
2345
|
-
class: v(["absolute inset-0 opacity-85", N(
|
|
2354
|
+
class: v(["absolute inset-0 opacity-85", N(vn)(r.type)]),
|
|
2346
2355
|
style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
|
|
2347
2356
|
}, null, 6), N(h).isVisual(r) ? (w(), s("div", {
|
|
2348
2357
|
key: 0,
|
|
2349
2358
|
class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? te.value : ""])
|
|
2350
|
-
}, [N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2359
|
+
}, [N(C).isAssetLoading(i, r) ? (w(), s("div", On, [c("span", kn, [u(N(oe), {
|
|
2351
2360
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2352
2361
|
"aria-hidden": "true"
|
|
2353
2362
|
})])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
|
|
@@ -2355,19 +2364,19 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2355
2364
|
"data-testid": "vibe-asset-error",
|
|
2356
2365
|
"data-kind": N(C).getAssetErrorKind(r),
|
|
2357
2366
|
class: "grid h-full w-full place-items-center"
|
|
2358
|
-
}, [c("div",
|
|
2367
|
+
}, [c("div", jn, [
|
|
2359
2368
|
u(N(le), {
|
|
2360
2369
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2361
2370
|
"aria-hidden": "true"
|
|
2362
2371
|
}),
|
|
2363
|
-
c("p",
|
|
2372
|
+
c("p", Mn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2364
2373
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2365
2374
|
key: 0,
|
|
2366
2375
|
type: "button",
|
|
2367
2376
|
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",
|
|
2368
2377
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2369
|
-
}, " Retry ", 8,
|
|
2370
|
-
])], 8,
|
|
2378
|
+
}, " Retry ", 8, Nn)) : o("", !0)
|
|
2379
|
+
])], 8, An)) : r.type === "image" ? (w(), s("img", {
|
|
2371
2380
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2372
2381
|
src: N(C).getFullscreenImageSource(i, r),
|
|
2373
2382
|
alt: r.title ?? "",
|
|
@@ -2378,7 +2387,7 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2378
2387
|
ref: (e) => he(N(C).getItemKey(r), e),
|
|
2379
2388
|
onLoad: (e) => pe(e, N(C).getItemKey(r), r.url),
|
|
2380
2389
|
onError: (e) => me(N(C).getItemKey(r), r.url)
|
|
2381
|
-
}, null, 42,
|
|
2390
|
+
}, null, 42, Pn)) : (w(), s("video", {
|
|
2382
2391
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2383
2392
|
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"]),
|
|
2384
2393
|
playsinline: "",
|
|
@@ -2402,10 +2411,10 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2402
2411
|
onStalled: (e) => Q(N(C).getItemKey(r), e),
|
|
2403
2412
|
onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
|
|
2404
2413
|
onWaiting: (e) => Q(N(C).getItemKey(r), e)
|
|
2405
|
-
}, null, 42,
|
|
2414
|
+
}, null, 42, Fn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
|
|
2406
2415
|
key: 1,
|
|
2407
2416
|
class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? te.value : ""])
|
|
2408
|
-
}, [c("div",
|
|
2417
|
+
}, [c("div", In, [
|
|
2409
2418
|
c("button", {
|
|
2410
2419
|
type: "button",
|
|
2411
2420
|
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]",
|
|
@@ -2415,19 +2424,19 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2415
2424
|
}, [
|
|
2416
2425
|
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),
|
|
2417
2426
|
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),
|
|
2418
|
-
c("span",
|
|
2427
|
+
c("span", Rn, [k(e.$slots, "item-icon", {
|
|
2419
2428
|
icon: N(Tt)(r.type),
|
|
2420
2429
|
item: r
|
|
2421
2430
|
}, () => [(w(), a(A(N(Tt)(r.type)), {
|
|
2422
2431
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2423
2432
|
"aria-hidden": "true"
|
|
2424
2433
|
}))])]),
|
|
2425
|
-
c("span",
|
|
2434
|
+
c("span", zn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
|
|
2426
2435
|
class: "h-4 w-4 stroke-2",
|
|
2427
2436
|
"aria-hidden": "true"
|
|
2428
2437
|
}))])
|
|
2429
|
-
], 8,
|
|
2430
|
-
N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2438
|
+
], 8, Ln),
|
|
2439
|
+
N(C).isAssetLoading(i, r) ? (w(), s("div", Bn, [c("span", Vn, [u(N(oe), {
|
|
2431
2440
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2432
2441
|
"aria-hidden": "true"
|
|
2433
2442
|
})])])) : o("", !0),
|
|
@@ -2440,14 +2449,14 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2440
2449
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2441
2450
|
"aria-hidden": "true"
|
|
2442
2451
|
}),
|
|
2443
|
-
c("p",
|
|
2452
|
+
c("p", Un, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2444
2453
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2445
2454
|
key: 0,
|
|
2446
2455
|
type: "button",
|
|
2447
2456
|
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",
|
|
2448
2457
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2449
|
-
}, " Retry ", 8,
|
|
2450
|
-
], 8,
|
|
2458
|
+
}, " Retry ", 8, Wn)) : o("", !0)
|
|
2459
|
+
], 8, Hn)], 64)) : o("", !0)
|
|
2451
2460
|
]), (w(), s("audio", {
|
|
2452
2461
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2453
2462
|
src: N(C).getFullscreenMediaSource(i, r),
|
|
@@ -2468,14 +2477,14 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2468
2477
|
onStalled: (e) => Q(N(C).getItemKey(r), e),
|
|
2469
2478
|
onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
|
|
2470
2479
|
onWaiting: (e) => Q(N(C).getItemKey(r), e)
|
|
2471
|
-
}, null, 40,
|
|
2480
|
+
}, null, 40, Gn))], 2)) : (w(), s("div", Kn, [c("div", qn, [k(e.$slots, "item-icon", {
|
|
2472
2481
|
icon: N(Tt)(r.type),
|
|
2473
2482
|
item: r
|
|
2474
2483
|
}, () => [(w(), a(A(N(Tt)(r.type)), {
|
|
2475
2484
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2476
2485
|
"aria-hidden": "true"
|
|
2477
|
-
}))])])]))], 14,
|
|
2478
|
-
U.value && f["fullscreen-overlay"] ? (w(), s("div",
|
|
2486
|
+
}))])])]))], 14, Dn))), 128)),
|
|
2487
|
+
U.value && f["fullscreen-overlay"] ? (w(), s("div", Jn, [c("div", Yn, [k(e.$slots, "fullscreen-overlay", y(p(U.value)))])])) : o("", !0),
|
|
2479
2488
|
N(h).activeItem.value ? (w(), a(St, {
|
|
2480
2489
|
key: 1,
|
|
2481
2490
|
"current-index": N(h).resolvedActiveIndex.value,
|
|
@@ -2533,10 +2542,10 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2533
2542
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
2534
2543
|
class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", G.value.kind === "end" ? "border-amber-300/35 text-amber-200" : G.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
2535
2544
|
}, j(G.value.message), 3))], 2)) : o("", !0)
|
|
2536
|
-
])) : V.value ? (w(), s("div",
|
|
2545
|
+
])) : V.value ? (w(), s("div", Xn, [c("div", Zn, [c("span", Qn, [u(N(oe), {
|
|
2537
2546
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2538
2547
|
"aria-hidden": "true"
|
|
2539
|
-
})]), c("p",
|
|
2548
|
+
})]), c("p", $n, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(wn, {
|
|
2540
2549
|
key: 2,
|
|
2541
2550
|
message: N(X).message,
|
|
2542
2551
|
mode: N(X).mode,
|
|
@@ -2548,7 +2557,7 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2548
2557
|
"message",
|
|
2549
2558
|
"mode",
|
|
2550
2559
|
"surface"
|
|
2551
|
-
])) : o("", !0), N(ue) && N(X) ? (w(), a(
|
|
2560
|
+
])) : o("", !0), N(ue) && N(X) ? (w(), a(wn, {
|
|
2552
2561
|
key: 3,
|
|
2553
2562
|
message: N(X).message,
|
|
2554
2563
|
mode: N(X).mode,
|
|
@@ -2568,7 +2577,7 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2568
2577
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2569
2578
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2570
2579
|
}, {
|
|
2571
|
-
default: z(() => [Y.value && U.value ? (w(), s("aside",
|
|
2580
|
+
default: z(() => [Y.value && U.value ? (w(), s("aside", er, [c("div", tr, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
|
|
2572
2581
|
_: 3
|
|
2573
2582
|
})], 4),
|
|
2574
2583
|
u(r, {
|
|
@@ -2579,29 +2588,29 @@ var xn = ["data-surface"], Sn = ["data-surface"], Cn = /* @__PURE__ */ d({
|
|
|
2579
2588
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2580
2589
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2581
2590
|
}, {
|
|
2582
|
-
default: z(() => [ie.value && U.value ? (w(), s("aside",
|
|
2591
|
+
default: z(() => [ie.value && U.value ? (w(), s("aside", nr, [c("div", rr, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
|
|
2583
2592
|
_: 3
|
|
2584
2593
|
})
|
|
2585
2594
|
]));
|
|
2586
2595
|
}
|
|
2587
|
-
}),
|
|
2588
|
-
function
|
|
2596
|
+
}), sr = 1, cr = .5;
|
|
2597
|
+
function lr(e) {
|
|
2589
2598
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2590
|
-
width:
|
|
2591
|
-
height:
|
|
2599
|
+
width: sr,
|
|
2600
|
+
height: sr,
|
|
2592
2601
|
source: "fallback"
|
|
2593
2602
|
};
|
|
2594
2603
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2595
|
-
if (
|
|
2596
|
-
let r =
|
|
2604
|
+
if (gr(t) && gr(n)) {
|
|
2605
|
+
let r = _r(e, t, n);
|
|
2597
2606
|
return {
|
|
2598
2607
|
width: r.width,
|
|
2599
2608
|
height: r.height,
|
|
2600
2609
|
source: "preview"
|
|
2601
2610
|
};
|
|
2602
2611
|
}
|
|
2603
|
-
if (
|
|
2604
|
-
let t =
|
|
2612
|
+
if (gr(e.width) && gr(e.height)) {
|
|
2613
|
+
let t = _r(e, e.width, e.height);
|
|
2605
2614
|
return {
|
|
2606
2615
|
width: t.width,
|
|
2607
2616
|
height: t.height,
|
|
@@ -2609,31 +2618,31 @@ function cr(e) {
|
|
|
2609
2618
|
};
|
|
2610
2619
|
}
|
|
2611
2620
|
return {
|
|
2612
|
-
width:
|
|
2613
|
-
height:
|
|
2621
|
+
width: sr,
|
|
2622
|
+
height: sr,
|
|
2614
2623
|
source: "fallback"
|
|
2615
2624
|
};
|
|
2616
2625
|
}
|
|
2617
|
-
function
|
|
2626
|
+
function ur(e, t) {
|
|
2618
2627
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2619
2628
|
}
|
|
2620
|
-
function
|
|
2629
|
+
function dr(e, t, n, r = 0) {
|
|
2621
2630
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2622
2631
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2623
2632
|
return !a || a <= 0 ? n : a / t;
|
|
2624
2633
|
}
|
|
2625
|
-
function
|
|
2626
|
-
let n =
|
|
2634
|
+
function fr(e, t) {
|
|
2635
|
+
let n = lr(e);
|
|
2627
2636
|
return n.height / n.width * t;
|
|
2628
2637
|
}
|
|
2629
|
-
function
|
|
2638
|
+
function pr(e, t) {
|
|
2630
2639
|
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;
|
|
2631
2640
|
for (let c = 0; c < e.length; c += 1) {
|
|
2632
2641
|
let l = e[c];
|
|
2633
2642
|
o.set($(l), c);
|
|
2634
2643
|
let u = 0;
|
|
2635
2644
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2636
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
2645
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = fr(l, t.columnWidth);
|
|
2637
2646
|
r[c] = {
|
|
2638
2647
|
x: d,
|
|
2639
2648
|
y: f
|
|
@@ -2652,7 +2661,7 @@ function fr(e, t) {
|
|
|
2652
2661
|
indexById: o
|
|
2653
2662
|
};
|
|
2654
2663
|
}
|
|
2655
|
-
function
|
|
2664
|
+
function mr(e) {
|
|
2656
2665
|
if (e.itemCount <= 0) return [];
|
|
2657
2666
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2658
2667
|
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();
|
|
@@ -2662,7 +2671,7 @@ function pr(e) {
|
|
|
2662
2671
|
}
|
|
2663
2672
|
return Array.from(a).sort((e, t) => e - t);
|
|
2664
2673
|
}
|
|
2665
|
-
function
|
|
2674
|
+
function hr(e, t, n) {
|
|
2666
2675
|
let r = /* @__PURE__ */ new Map();
|
|
2667
2676
|
for (let i of e) {
|
|
2668
2677
|
let e = t.get($(i));
|
|
@@ -2672,11 +2681,11 @@ function mr(e, t, n) {
|
|
|
2672
2681
|
}
|
|
2673
2682
|
return r;
|
|
2674
2683
|
}
|
|
2675
|
-
function
|
|
2684
|
+
function gr(e) {
|
|
2676
2685
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2677
2686
|
}
|
|
2678
|
-
function
|
|
2679
|
-
return e.type !== "image" || n / t >=
|
|
2687
|
+
function _r(e, t, n) {
|
|
2688
|
+
return e.type !== "image" || n / t >= cr ? {
|
|
2680
2689
|
width: t,
|
|
2681
2690
|
height: n
|
|
2682
2691
|
} : {
|
|
@@ -2686,21 +2695,21 @@ function gr(e, t, n) {
|
|
|
2686
2695
|
}
|
|
2687
2696
|
//#endregion
|
|
2688
2697
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2689
|
-
var
|
|
2690
|
-
function
|
|
2698
|
+
var vr = 300, yr = 600, br = 40, xr = 300, Sr = 400;
|
|
2699
|
+
function Cr(e, t) {
|
|
2691
2700
|
return t === "top" ? [...e].reverse() : e;
|
|
2692
2701
|
}
|
|
2693
|
-
function
|
|
2694
|
-
return e <= 0 ?
|
|
2702
|
+
function wr(e) {
|
|
2703
|
+
return e <= 0 ? yr : yr + Math.min((e - 1) * br, Sr);
|
|
2695
2704
|
}
|
|
2696
|
-
function
|
|
2697
|
-
return
|
|
2705
|
+
function Tr() {
|
|
2706
|
+
return xr;
|
|
2698
2707
|
}
|
|
2699
|
-
function
|
|
2708
|
+
function Er(e) {
|
|
2700
2709
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2701
2710
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2702
2711
|
}
|
|
2703
|
-
function
|
|
2712
|
+
function Dr(e) {
|
|
2704
2713
|
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()));
|
|
2705
2714
|
L(e.visibleIndices, (i) => {
|
|
2706
2715
|
if (!i.length) return;
|
|
@@ -2710,20 +2719,20 @@ function Er(e) {
|
|
|
2710
2719
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2711
2720
|
}
|
|
2712
2721
|
if (!o.length) return;
|
|
2713
|
-
let s =
|
|
2714
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2715
|
-
r.value = c,
|
|
2722
|
+
let s = Cr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
2723
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * br, Sr));
|
|
2724
|
+
r.value = c, Or(() => {
|
|
2716
2725
|
let e = new Set(n.value);
|
|
2717
2726
|
for (let t of o) e.add(t);
|
|
2718
2727
|
n.value = e;
|
|
2719
|
-
}),
|
|
2728
|
+
}), kr(() => {
|
|
2720
2729
|
let e = new Set(t.value);
|
|
2721
2730
|
for (let t of o) e.delete(t);
|
|
2722
2731
|
t.value = e, S(() => {
|
|
2723
2732
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2724
2733
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2725
2734
|
n.value = e, r.value = t, a.value = i;
|
|
2726
|
-
},
|
|
2735
|
+
}, wr(o.length));
|
|
2727
2736
|
});
|
|
2728
2737
|
}, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
|
|
2729
2738
|
if (!e.length || !o.value.size) return;
|
|
@@ -2750,7 +2759,7 @@ function Er(e) {
|
|
|
2750
2759
|
let e = $(t.item);
|
|
2751
2760
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2752
2761
|
}
|
|
2753
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
2762
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Or(() => {
|
|
2754
2763
|
let e = new Set(s.value);
|
|
2755
2764
|
for (let t of p) e.add(t);
|
|
2756
2765
|
s.value = e;
|
|
@@ -2758,9 +2767,9 @@ function Er(e) {
|
|
|
2758
2767
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2759
2768
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2760
2769
|
o.value = e, s.value = t;
|
|
2761
|
-
},
|
|
2770
|
+
}, xr);
|
|
2762
2771
|
}
|
|
2763
|
-
function g(t, n, r =
|
|
2772
|
+
function g(t, n, r = vr) {
|
|
2764
2773
|
if (!t.size) return;
|
|
2765
2774
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2766
2775
|
for (let [r, o] of t.entries()) {
|
|
@@ -2779,8 +2788,8 @@ function Er(e) {
|
|
|
2779
2788
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2780
2789
|
let o = new Map(l.value);
|
|
2781
2790
|
for (let e of a) o.set(e, r);
|
|
2782
|
-
l.value = o,
|
|
2783
|
-
u.value = new Set(a),
|
|
2791
|
+
l.value = o, Or(() => {
|
|
2792
|
+
u.value = new Set(a), Or(() => {
|
|
2784
2793
|
c.value = /* @__PURE__ */ new Map();
|
|
2785
2794
|
});
|
|
2786
2795
|
}), S(() => {
|
|
@@ -2791,8 +2800,8 @@ function Er(e) {
|
|
|
2791
2800
|
}, r);
|
|
2792
2801
|
}
|
|
2793
2802
|
function _(e) {
|
|
2794
|
-
if (n.value.has(e)) return `transform ${
|
|
2795
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
2803
|
+
if (n.value.has(e)) return `transform ${yr}ms ease-out`;
|
|
2804
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? vr}ms ease-out`;
|
|
2796
2805
|
}
|
|
2797
2806
|
function v(e) {
|
|
2798
2807
|
if (!n.value.has(e)) return;
|
|
@@ -2809,7 +2818,7 @@ function Er(e) {
|
|
|
2809
2818
|
} : {
|
|
2810
2819
|
dx: 0,
|
|
2811
2820
|
dy: 0
|
|
2812
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
2821
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Er({
|
|
2813
2822
|
columnWidth: e.columnWidth.value,
|
|
2814
2823
|
direction: u,
|
|
2815
2824
|
itemHeight: o,
|
|
@@ -2823,14 +2832,14 @@ function Er(e) {
|
|
|
2823
2832
|
if (!r) return {
|
|
2824
2833
|
opacity: "0",
|
|
2825
2834
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2826
|
-
transition: `opacity ${
|
|
2835
|
+
transition: `opacity ${xr}ms ease-out, transform ${xr}ms ease-out`
|
|
2827
2836
|
};
|
|
2828
2837
|
let i = s.value.has(n);
|
|
2829
2838
|
return {
|
|
2830
2839
|
height: `${r.height}px`,
|
|
2831
2840
|
opacity: i ? "0" : "1",
|
|
2832
2841
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
2833
|
-
transition: `opacity ${
|
|
2842
|
+
transition: `opacity ${xr}ms ease-out, transform ${xr}ms ease-out`,
|
|
2834
2843
|
width: `${e.columnWidth.value}px`
|
|
2835
2844
|
};
|
|
2836
2845
|
}
|
|
@@ -2851,28 +2860,28 @@ function Er(e) {
|
|
|
2851
2860
|
playFlipMoveAnimation: g
|
|
2852
2861
|
};
|
|
2853
2862
|
}
|
|
2854
|
-
function
|
|
2863
|
+
function Or(e) {
|
|
2855
2864
|
if (typeof requestAnimationFrame == "function") {
|
|
2856
2865
|
requestAnimationFrame(() => e());
|
|
2857
2866
|
return;
|
|
2858
2867
|
}
|
|
2859
2868
|
setTimeout(e, 0);
|
|
2860
2869
|
}
|
|
2861
|
-
function
|
|
2862
|
-
|
|
2870
|
+
function kr(e) {
|
|
2871
|
+
Or(() => Or(e));
|
|
2863
2872
|
}
|
|
2864
2873
|
//#endregion
|
|
2865
2874
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
2866
|
-
function
|
|
2875
|
+
function Ar(e, t) {
|
|
2867
2876
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
2868
2877
|
}
|
|
2869
|
-
function
|
|
2878
|
+
function jr(e, t, n) {
|
|
2870
2879
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
2871
2880
|
}
|
|
2872
|
-
function
|
|
2881
|
+
function Mr(e, t, n, r) {
|
|
2873
2882
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
2874
2883
|
}
|
|
2875
|
-
function
|
|
2884
|
+
function Nr(e, t) {
|
|
2876
2885
|
return {
|
|
2877
2886
|
height: `${e}px`,
|
|
2878
2887
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -2880,8 +2889,8 @@ function Mr(e, t) {
|
|
|
2880
2889
|
}
|
|
2881
2890
|
//#endregion
|
|
2882
2891
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
2883
|
-
var
|
|
2884
|
-
function
|
|
2892
|
+
var Pr = 250, Fr = 1e3;
|
|
2893
|
+
function Ir(e) {
|
|
2885
2894
|
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
|
|
2886
2895
|
x(() => {
|
|
2887
2896
|
y();
|
|
@@ -2897,7 +2906,7 @@ function Fr(e) {
|
|
|
2897
2906
|
function u(t) {
|
|
2898
2907
|
if (!b(t) || !e.isAtBoundary()) return;
|
|
2899
2908
|
let n = Date.now();
|
|
2900
|
-
n < s || (s = n +
|
|
2909
|
+
n < s || (s = n + Pr, m());
|
|
2901
2910
|
}
|
|
2902
2911
|
function d() {
|
|
2903
2912
|
if (!g()) return;
|
|
@@ -2931,7 +2940,7 @@ function Fr(e) {
|
|
|
2931
2940
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
2932
2941
|
}
|
|
2933
2942
|
function _() {
|
|
2934
|
-
o.value = !1, v(
|
|
2943
|
+
o.value = !1, v(Fr);
|
|
2935
2944
|
}
|
|
2936
2945
|
function v(e) {
|
|
2937
2946
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -2954,42 +2963,42 @@ function Fr(e) {
|
|
|
2954
2963
|
}
|
|
2955
2964
|
//#endregion
|
|
2956
2965
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
2957
|
-
var
|
|
2958
|
-
function
|
|
2959
|
-
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth ||
|
|
2966
|
+
var Lr = 600, Rr = 24, zr = 16, Br = 300, Vr = 200, Hr = 200, Ur = Rr + zr, Wr = 200, Gr = 300, Kr = 24, qr = 48, Jr = 500, Yr = 1e3;
|
|
2967
|
+
function Xr(e) {
|
|
2968
|
+
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Br), 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(Br, a.value - Rr * 2)), h = i(() => ur(m.value, Br)), g = i(() => dr(m.value, h.value, Br, zr)), v = i(() => Zr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => mr({
|
|
2960
2969
|
itemCount: e.items.value.length,
|
|
2961
2970
|
viewportHeight: r.value,
|
|
2962
2971
|
scrollTop: n.value,
|
|
2963
|
-
overscanPx:
|
|
2964
|
-
bucketPx:
|
|
2972
|
+
overscanPx: Vr,
|
|
2973
|
+
bucketPx: Lr,
|
|
2965
2974
|
buckets: c.value
|
|
2966
2975
|
})), b = i(() => y.value.map((t) => ({
|
|
2967
2976
|
item: e.items.value[t],
|
|
2968
2977
|
index: t
|
|
2969
2978
|
}))), C = i(() => {
|
|
2970
|
-
let e = l.value +
|
|
2971
|
-
return Math.max(e, t, r.value) +
|
|
2972
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() =>
|
|
2979
|
+
let e = l.value + Rr * 2, t = d.value ?? 0;
|
|
2980
|
+
return Math.max(e, t, r.value) + Wr;
|
|
2981
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => $r({
|
|
2973
2982
|
active: e.active.value,
|
|
2974
2983
|
maxScrollTop: se(),
|
|
2975
2984
|
progressDistancePx: n.value,
|
|
2976
|
-
thresholdPx:
|
|
2985
|
+
thresholdPx: Hr,
|
|
2977
2986
|
triggerEnabled: w.value
|
|
2978
|
-
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() =>
|
|
2987
|
+
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => Qr({
|
|
2979
2988
|
active: e.active.value,
|
|
2980
2989
|
maxScrollTop: se(),
|
|
2981
2990
|
progressDistancePx: n.value,
|
|
2982
|
-
thresholdPx:
|
|
2991
|
+
thresholdPx: Ur,
|
|
2983
2992
|
triggerEnabled: e.hasPreviousPage.value
|
|
2984
|
-
})), k = i(() => Math.max(0, r.value -
|
|
2993
|
+
})), k = i(() => Math.max(0, r.value - Kr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
|
|
2985
2994
|
if (!A.value) return 0;
|
|
2986
2995
|
let e = r.value / C.value * k.value;
|
|
2987
|
-
return Math.min(k.value, Math.max(
|
|
2996
|
+
return Math.min(k.value, Math.max(qr, e));
|
|
2988
2997
|
}), M = i(() => {
|
|
2989
|
-
if (!A.value) return
|
|
2998
|
+
if (!A.value) return Kr;
|
|
2990
2999
|
let e = Math.max(0, C.value - r.value);
|
|
2991
|
-
return
|
|
2992
|
-
}), N =
|
|
3000
|
+
return Kr + Math.max(0, k.value - j.value) * (e > 0 ? Zr(n.value / e, 0, 1) : 0);
|
|
3001
|
+
}), N = Dr({
|
|
2993
3002
|
items: e.items,
|
|
2994
3003
|
visibleIndices: y,
|
|
2995
3004
|
positions: o,
|
|
@@ -2998,27 +3007,27 @@ function Yr(e) {
|
|
|
2998
3007
|
columnWidth: g,
|
|
2999
3008
|
scrollTop: n,
|
|
3000
3009
|
viewportHeight: r
|
|
3001
|
-
}), P =
|
|
3010
|
+
}), P = Ir({
|
|
3002
3011
|
direction: "top",
|
|
3003
3012
|
getAnimationLockMs(e) {
|
|
3004
|
-
return Math.max(
|
|
3013
|
+
return Math.max(Jr, wr(e)) + Yr;
|
|
3005
3014
|
},
|
|
3006
3015
|
hasPage: e.hasPreviousPage,
|
|
3007
3016
|
interactionLocked: p,
|
|
3008
3017
|
isAtBoundary() {
|
|
3009
|
-
return n.value <=
|
|
3018
|
+
return n.value <= Ur;
|
|
3010
3019
|
},
|
|
3011
3020
|
loading: e.loading,
|
|
3012
3021
|
requestPage: e.requestPreviousPage
|
|
3013
|
-
}), F =
|
|
3022
|
+
}), F = Ir({
|
|
3014
3023
|
direction: "bottom",
|
|
3015
3024
|
getAnimationLockMs(e) {
|
|
3016
|
-
return
|
|
3025
|
+
return wr(e) + Yr;
|
|
3017
3026
|
},
|
|
3018
3027
|
hasPage: w,
|
|
3019
3028
|
interactionLocked: p,
|
|
3020
3029
|
isAtBoundary() {
|
|
3021
|
-
return oe() <=
|
|
3030
|
+
return oe() <= Hr;
|
|
3022
3031
|
},
|
|
3023
3032
|
loading: e.loading,
|
|
3024
3033
|
requestPage: e.requestNextPage
|
|
@@ -3028,7 +3037,7 @@ function Yr(e) {
|
|
|
3028
3037
|
h,
|
|
3029
3038
|
g
|
|
3030
3039
|
], async ([t], [r = []]) => {
|
|
3031
|
-
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c =
|
|
3040
|
+
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = hr(a, u.value, o.value), l = X(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
|
|
3032
3041
|
let t = $(e);
|
|
3033
3042
|
if (f.has(t)) return [];
|
|
3034
3043
|
let n = c.get(t), r = l.get(t);
|
|
@@ -3037,8 +3046,8 @@ function Yr(e) {
|
|
|
3037
3046
|
item: e,
|
|
3038
3047
|
position: n
|
|
3039
3048
|
}];
|
|
3040
|
-
}), 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 >
|
|
3041
|
-
y && K(
|
|
3049
|
+
}), 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 > Rr + zr, b = h && n.value > Rr + zr ? t[v.value] : null, x = b ? $(b) : null;
|
|
3050
|
+
y && K(Tr() + Yr), 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 ? Jr : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
|
|
3042
3051
|
}, { immediate: !0 }), L([
|
|
3043
3052
|
() => e.pendingAppendItems.value.map((e) => $(e)),
|
|
3044
3053
|
h,
|
|
@@ -3055,7 +3064,7 @@ function Yr(e) {
|
|
|
3055
3064
|
}
|
|
3056
3065
|
if (i !== !1 || f.value == null) return;
|
|
3057
3066
|
await _();
|
|
3058
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
3067
|
+
let o = Math.max(0, C.value - r.value), s = Zr(f.value, 0, o);
|
|
3059
3068
|
a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
|
|
3060
3069
|
}), L(() => e.loading.value, async (t) => {
|
|
3061
3070
|
!t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
|
|
@@ -3067,16 +3076,16 @@ function Yr(e) {
|
|
|
3067
3076
|
I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
|
|
3068
3077
|
});
|
|
3069
3078
|
function te() {
|
|
3070
|
-
let t =
|
|
3079
|
+
let t = pr(e.items.value, {
|
|
3071
3080
|
columnCount: h.value,
|
|
3072
3081
|
columnWidth: g.value,
|
|
3073
|
-
gapX:
|
|
3074
|
-
gapY:
|
|
3075
|
-
bucketPx:
|
|
3082
|
+
gapX: zr,
|
|
3083
|
+
gapY: zr,
|
|
3084
|
+
bucketPx: Lr
|
|
3076
3085
|
});
|
|
3077
3086
|
o.value = t.positions.map((e) => ({
|
|
3078
|
-
x: e.x +
|
|
3079
|
-
y: e.y +
|
|
3087
|
+
x: e.x + Rr,
|
|
3088
|
+
y: e.y + Rr
|
|
3080
3089
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
3081
3090
|
}
|
|
3082
3091
|
function V() {
|
|
@@ -3101,7 +3110,7 @@ function Yr(e) {
|
|
|
3101
3110
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
3102
3111
|
if (!a || !c || !l) return;
|
|
3103
3112
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
3104
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
3113
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Rr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Rr), a.scrollTop = Zr(u, 0, d), n.value = a.scrollTop, q();
|
|
3105
3114
|
}
|
|
3106
3115
|
function ne(e, r) {
|
|
3107
3116
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
@@ -3134,7 +3143,7 @@ function Yr(e) {
|
|
|
3134
3143
|
e.setActiveIndex(i);
|
|
3135
3144
|
}
|
|
3136
3145
|
function re() {
|
|
3137
|
-
let t = n.value <=
|
|
3146
|
+
let t = n.value <= Ur, r = oe() <= Hr;
|
|
3138
3147
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
3139
3148
|
}
|
|
3140
3149
|
function J() {
|
|
@@ -3144,29 +3153,29 @@ function Yr(e) {
|
|
|
3144
3153
|
r.value = ie(), a.value = ae();
|
|
3145
3154
|
}
|
|
3146
3155
|
function ie() {
|
|
3147
|
-
return
|
|
3156
|
+
return Ar(t.value, r.value);
|
|
3148
3157
|
}
|
|
3149
3158
|
function ae() {
|
|
3150
|
-
return
|
|
3159
|
+
return jr(t.value, a.value, Br);
|
|
3151
3160
|
}
|
|
3152
3161
|
function oe() {
|
|
3153
|
-
return
|
|
3162
|
+
return Mr(t.value, n.value, r.value, C.value);
|
|
3154
3163
|
}
|
|
3155
3164
|
function se() {
|
|
3156
3165
|
let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
|
|
3157
3166
|
return Math.max(0, e - r.value);
|
|
3158
3167
|
}
|
|
3159
3168
|
function ce() {
|
|
3160
|
-
return
|
|
3169
|
+
return Nr(j.value, M.value);
|
|
3161
3170
|
}
|
|
3162
3171
|
function le(e) {
|
|
3163
|
-
return e.length ?
|
|
3172
|
+
return e.length ? pr(e, {
|
|
3164
3173
|
columnCount: h.value,
|
|
3165
3174
|
columnWidth: g.value,
|
|
3166
|
-
gapX:
|
|
3167
|
-
gapY:
|
|
3168
|
-
bucketPx:
|
|
3169
|
-
}).contentHeight +
|
|
3175
|
+
gapX: zr,
|
|
3176
|
+
gapY: zr,
|
|
3177
|
+
bucketPx: Lr
|
|
3178
|
+
}).contentHeight + Rr * 2 : 0;
|
|
3170
3179
|
}
|
|
3171
3180
|
function X(e) {
|
|
3172
3181
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3188,7 +3197,7 @@ function Yr(e) {
|
|
|
3188
3197
|
} finally {
|
|
3189
3198
|
d.value = null, ee = !1;
|
|
3190
3199
|
}
|
|
3191
|
-
},
|
|
3200
|
+
}, Gr));
|
|
3192
3201
|
}
|
|
3193
3202
|
function de() {
|
|
3194
3203
|
z &&= (clearTimeout(z), null);
|
|
@@ -3215,27 +3224,27 @@ function Yr(e) {
|
|
|
3215
3224
|
scrollViewportRef: t
|
|
3216
3225
|
};
|
|
3217
3226
|
}
|
|
3218
|
-
function
|
|
3227
|
+
function Zr(e, t, n) {
|
|
3219
3228
|
return Math.min(Math.max(e, t), n);
|
|
3220
3229
|
}
|
|
3221
|
-
function
|
|
3230
|
+
function Qr(e) {
|
|
3222
3231
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3223
3232
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3224
|
-
return t <= 0 ? 1 :
|
|
3233
|
+
return t <= 0 ? 1 : Zr(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
|
|
3225
3234
|
}
|
|
3226
|
-
function
|
|
3235
|
+
function $r(e) {
|
|
3227
3236
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3228
3237
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3229
|
-
return t <= 0 ? 1 :
|
|
3238
|
+
return t <= 0 ? 1 : Zr(e.progressDistancePx / t, 0, 1);
|
|
3230
3239
|
}
|
|
3231
3240
|
//#endregion
|
|
3232
3241
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
3233
|
-
function
|
|
3242
|
+
function ei(e) {
|
|
3234
3243
|
if (e) try {
|
|
3235
3244
|
e.removeAttribute("src"), e.src = "";
|
|
3236
3245
|
} catch {}
|
|
3237
3246
|
}
|
|
3238
|
-
function
|
|
3247
|
+
function ti(e) {
|
|
3239
3248
|
if (e) {
|
|
3240
3249
|
try {
|
|
3241
3250
|
e.currentTime = 0;
|
|
@@ -3246,12 +3255,12 @@ function ei(e) {
|
|
|
3246
3255
|
} catch {}
|
|
3247
3256
|
}
|
|
3248
3257
|
}
|
|
3249
|
-
function
|
|
3258
|
+
function ni(e, t) {
|
|
3250
3259
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
3251
3260
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
3252
3261
|
return e.bottom > 0 && e.top < n;
|
|
3253
3262
|
}
|
|
3254
|
-
function
|
|
3263
|
+
function ri(e) {
|
|
3255
3264
|
if (!e) return null;
|
|
3256
3265
|
try {
|
|
3257
3266
|
return new URL(e, window.location.href).href;
|
|
@@ -3261,9 +3270,9 @@ function ni(e) {
|
|
|
3261
3270
|
}
|
|
3262
3271
|
//#endregion
|
|
3263
3272
|
//#region src/components/viewer-core/listPreview.ts
|
|
3264
|
-
var
|
|
3265
|
-
function
|
|
3266
|
-
let t =
|
|
3273
|
+
var ii = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, ai = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, oi = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
|
|
3274
|
+
function si(e) {
|
|
3275
|
+
let t = ci(e), n = t?.url, r = lr(e), i = e.title?.trim() || Et(e.type);
|
|
3267
3276
|
return t?.mediaType === "video" && typeof n == "string" ? {
|
|
3268
3277
|
kind: "video",
|
|
3269
3278
|
url: n,
|
|
@@ -3282,13 +3291,13 @@ function oi(e) {
|
|
|
3282
3291
|
width: r.width,
|
|
3283
3292
|
height: r.height,
|
|
3284
3293
|
label: i
|
|
3285
|
-
} : typeof n == "string" &&
|
|
3294
|
+
} : typeof n == "string" && ui(e, n) ? {
|
|
3286
3295
|
kind: "video",
|
|
3287
3296
|
url: n,
|
|
3288
3297
|
width: r.width,
|
|
3289
3298
|
height: r.height,
|
|
3290
3299
|
label: i
|
|
3291
|
-
} : typeof n == "string" &&
|
|
3300
|
+
} : typeof n == "string" && li(e, n) ? {
|
|
3292
3301
|
kind: "image",
|
|
3293
3302
|
url: n,
|
|
3294
3303
|
width: r.width,
|
|
@@ -3302,26 +3311,26 @@ function oi(e) {
|
|
|
3302
3311
|
label: i
|
|
3303
3312
|
};
|
|
3304
3313
|
}
|
|
3305
|
-
function
|
|
3314
|
+
function ci(e) {
|
|
3306
3315
|
return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
|
|
3307
3316
|
}
|
|
3308
|
-
function ci(e, t) {
|
|
3309
|
-
return e.type !== "image" || typeof t != "string" ? !1 : ri.test(t) || ui(t);
|
|
3310
|
-
}
|
|
3311
3317
|
function li(e, t) {
|
|
3312
|
-
return e.type !== "
|
|
3318
|
+
return e.type !== "image" || typeof t != "string" ? !1 : ii.test(t) || di(t);
|
|
3313
3319
|
}
|
|
3314
|
-
function ui(e) {
|
|
3315
|
-
return
|
|
3320
|
+
function ui(e, t) {
|
|
3321
|
+
return e.type !== "video" || typeof t != "string" ? !1 : ai.test(t) || fi(t);
|
|
3316
3322
|
}
|
|
3317
3323
|
function di(e) {
|
|
3318
|
-
return
|
|
3324
|
+
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
3325
|
+
}
|
|
3326
|
+
function fi(e) {
|
|
3327
|
+
return oi.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
|
|
3319
3328
|
}
|
|
3320
3329
|
//#endregion
|
|
3321
3330
|
//#region src/components/viewer-core/useListCardHealthCheck.ts
|
|
3322
|
-
function
|
|
3331
|
+
function pi(e) {
|
|
3323
3332
|
let t = D(null), n = i(() => {
|
|
3324
|
-
let t = typeof e.item.value.healthCheck?.url == "string" ?
|
|
3333
|
+
let t = typeof e.item.value.healthCheck?.url == "string" ? ri(e.item.value.healthCheck.url) : null;
|
|
3325
3334
|
return !t || t === e.attachedAssetUrl.value ? null : t;
|
|
3326
3335
|
}), r = null, a = 0, o = /* @__PURE__ */ new Map();
|
|
3327
3336
|
L(n, (e, n) => {
|
|
@@ -3363,7 +3372,7 @@ function fi(e) {
|
|
|
3363
3372
|
return;
|
|
3364
3373
|
}
|
|
3365
3374
|
let i = ++a;
|
|
3366
|
-
|
|
3375
|
+
rn(r).then((s) => {
|
|
3367
3376
|
if (!(i !== a || n.value !== r)) {
|
|
3368
3377
|
if (o.set(r, s ?? null), !s) {
|
|
3369
3378
|
t.value = null;
|
|
@@ -3399,14 +3408,14 @@ function fi(e) {
|
|
|
3399
3408
|
}
|
|
3400
3409
|
//#endregion
|
|
3401
3410
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
3402
|
-
var
|
|
3411
|
+
var mi = ["aria-label"], hi = {
|
|
3403
3412
|
key: 0,
|
|
3404
3413
|
"data-testid": "vibe-list-card-spinner",
|
|
3405
3414
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
3406
|
-
},
|
|
3415
|
+
}, gi = { 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]" }, _i = ["src", "alt"], vi = ["src"], yi = ["data-kind"], bi = { class: "grid justify-items-center gap-3 px-4 text-center" }, xi = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Si = {
|
|
3407
3416
|
key: 4,
|
|
3408
3417
|
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))]"
|
|
3409
|
-
},
|
|
3418
|
+
}, Ci = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, wi = { class: "pointer-events-none absolute inset-0 z-[3]" }, Ti = /* @__PURE__ */ d({
|
|
3410
3419
|
__name: "ListCard",
|
|
3411
3420
|
props: {
|
|
3412
3421
|
active: {
|
|
@@ -3430,7 +3439,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3430
3439
|
},
|
|
3431
3440
|
emits: ["open"],
|
|
3432
3441
|
setup(e, { emit: t }) {
|
|
3433
|
-
let n = e, r = t, l = i(() =>
|
|
3442
|
+
let n = e, r = t, l = i(() => si(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 = pi({
|
|
3434
3443
|
attachedAssetUrl: E,
|
|
3435
3444
|
getPriority: X,
|
|
3436
3445
|
isInView: d,
|
|
@@ -3439,7 +3448,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3439
3448
|
loadErrorKind: g,
|
|
3440
3449
|
reportAssetError: n.reportAssetError,
|
|
3441
3450
|
surfaceActive: i(() => n.surfaceActive)
|
|
3442
|
-
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() =>
|
|
3451
|
+
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => tn(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
|
|
3443
3452
|
L([E, () => l.value.kind], () => {
|
|
3444
3453
|
let e = l.value.kind === "fallback";
|
|
3445
3454
|
m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
|
|
@@ -3480,7 +3489,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3480
3489
|
if (!ue(_.value)) return;
|
|
3481
3490
|
let e = E.value ?? n.item.url;
|
|
3482
3491
|
m.value = !1, g.value = "generic";
|
|
3483
|
-
let t = await
|
|
3492
|
+
let t = await nn(e);
|
|
3484
3493
|
g.value = t, n.reportAssetError?.({
|
|
3485
3494
|
item: n.item,
|
|
3486
3495
|
occurrenceKey: $(n.item),
|
|
@@ -3529,7 +3538,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3529
3538
|
return;
|
|
3530
3539
|
}
|
|
3531
3540
|
if (E.value && d.value && m.value) {
|
|
3532
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
3541
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, sn(e);
|
|
3533
3542
|
return;
|
|
3534
3543
|
}
|
|
3535
3544
|
try {
|
|
@@ -3550,7 +3559,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3550
3559
|
d.value = !0;
|
|
3551
3560
|
return;
|
|
3552
3561
|
}
|
|
3553
|
-
d.value =
|
|
3562
|
+
d.value = ni(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
|
|
3554
3563
|
}
|
|
3555
3564
|
function ie(e) {
|
|
3556
3565
|
if (!e) return;
|
|
@@ -3570,10 +3579,10 @@ var pi = ["aria-label"], mi = {
|
|
|
3570
3579
|
}), g.value = null, m.value = !1, T.value = !1, J(), K();
|
|
3571
3580
|
}
|
|
3572
3581
|
function se() {
|
|
3573
|
-
|
|
3582
|
+
ei(_.value);
|
|
3574
3583
|
}
|
|
3575
3584
|
function ce() {
|
|
3576
|
-
|
|
3585
|
+
ti(C.value);
|
|
3577
3586
|
}
|
|
3578
3587
|
function X() {
|
|
3579
3588
|
let e = y.value;
|
|
@@ -3587,8 +3596,8 @@ var pi = ["aria-label"], mi = {
|
|
|
3587
3596
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3588
3597
|
}
|
|
3589
3598
|
function ue(e) {
|
|
3590
|
-
let t =
|
|
3591
|
-
return !e || !t ? !1 :
|
|
3599
|
+
let t = ri(E.value);
|
|
3600
|
+
return !e || !t ? !1 : ri("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3592
3601
|
}
|
|
3593
3602
|
function de() {
|
|
3594
3603
|
r("open");
|
|
@@ -3616,8 +3625,8 @@ var pi = ["aria-label"], mi = {
|
|
|
3616
3625
|
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]",
|
|
3617
3626
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3618
3627
|
onClick: de
|
|
3619
|
-
}, null, 8,
|
|
3620
|
-
B.value ? (w(), s("div",
|
|
3628
|
+
}, null, 8, mi),
|
|
3629
|
+
B.value ? (w(), s("div", hi, [c("span", gi, [u(N(oe), {
|
|
3621
3630
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3622
3631
|
"aria-hidden": "true"
|
|
3623
3632
|
})])])) : o("", !0),
|
|
@@ -3631,7 +3640,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3631
3640
|
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"]),
|
|
3632
3641
|
onLoad: U,
|
|
3633
3642
|
onError: W
|
|
3634
|
-
}, null, 42,
|
|
3643
|
+
}, null, 42, _i)) : P.value && E.value && !R.value ? (w(), s("video", {
|
|
3635
3644
|
key: 2,
|
|
3636
3645
|
ref_key: "videoRef",
|
|
3637
3646
|
ref: C,
|
|
@@ -3647,31 +3656,31 @@ var pi = ["aria-label"], mi = {
|
|
|
3647
3656
|
onPlaying: ne,
|
|
3648
3657
|
onStalled: G,
|
|
3649
3658
|
onWaiting: G
|
|
3650
|
-
}, null, 42,
|
|
3659
|
+
}, null, 42, vi)) : R.value ? (w(), s("div", {
|
|
3651
3660
|
key: 3,
|
|
3652
3661
|
"data-testid": "vibe-list-card-error",
|
|
3653
3662
|
"data-kind": I.value,
|
|
3654
3663
|
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))]"
|
|
3655
|
-
}, [c("div",
|
|
3664
|
+
}, [c("div", bi, [
|
|
3656
3665
|
u(N(le), {
|
|
3657
3666
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3658
3667
|
"aria-hidden": "true"
|
|
3659
3668
|
}),
|
|
3660
|
-
c("span",
|
|
3669
|
+
c("span", xi, j(N(en)(I.value)), 1),
|
|
3661
3670
|
z.value ? (w(), s("button", {
|
|
3662
3671
|
key: 0,
|
|
3663
3672
|
type: "button",
|
|
3664
3673
|
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",
|
|
3665
3674
|
onClick: ee(ae, ["stop"])
|
|
3666
3675
|
}, " Retry ")) : o("", !0)
|
|
3667
|
-
])], 8,
|
|
3676
|
+
])], 8, yi)) : (w(), s("div", Si, [c("div", Ci, [k(e.$slots, "item-icon", {
|
|
3668
3677
|
icon: N(Tt)(n.item.type),
|
|
3669
3678
|
item: n.item
|
|
3670
3679
|
}, () => [(w(), a(A(N(Tt)(n.item.type)), {
|
|
3671
3680
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3672
3681
|
"aria-hidden": "true"
|
|
3673
3682
|
}))])])])),
|
|
3674
|
-
c("div",
|
|
3683
|
+
c("div", wi, [k(e.$slots, "grid-item-overlay", {
|
|
3675
3684
|
active: n.active,
|
|
3676
3685
|
focused: f.value,
|
|
3677
3686
|
hovered: p.value,
|
|
@@ -3681,24 +3690,24 @@ var pi = ["aria-label"], mi = {
|
|
|
3681
3690
|
})])
|
|
3682
3691
|
], 34));
|
|
3683
3692
|
}
|
|
3684
|
-
}),
|
|
3693
|
+
}), Ei = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, Di = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Oi = {
|
|
3685
3694
|
"data-testid": "vibe-pagination",
|
|
3686
3695
|
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]"
|
|
3687
|
-
},
|
|
3696
|
+
}, ki = { class: "whitespace-nowrap" }, Ai = {
|
|
3688
3697
|
key: 0,
|
|
3689
3698
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3690
|
-
},
|
|
3699
|
+
}, ji = [
|
|
3691
3700
|
"data-active",
|
|
3692
3701
|
"data-index",
|
|
3693
3702
|
"data-item-id",
|
|
3694
3703
|
"data-occurrence-key"
|
|
3695
|
-
],
|
|
3704
|
+
], Mi = ["data-item-id"], Ni = {
|
|
3696
3705
|
key: 0,
|
|
3697
3706
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3698
|
-
},
|
|
3707
|
+
}, Pi = {
|
|
3699
3708
|
key: 1,
|
|
3700
3709
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3701
|
-
},
|
|
3710
|
+
}, Fi = { class: "mx-auto flex w-full justify-center" }, Ii = /* @__PURE__ */ d({
|
|
3702
3711
|
__name: "ListSurface",
|
|
3703
3712
|
props: {
|
|
3704
3713
|
active: {
|
|
@@ -3759,7 +3768,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3759
3768
|
"update:activeIndex"
|
|
3760
3769
|
],
|
|
3761
3770
|
setup(e, { emit: n }) {
|
|
3762
|
-
let r = e, d = F(), f = n, p =
|
|
3771
|
+
let r = e, d = F(), f = n, p = Xr({
|
|
3763
3772
|
active: M(r, "active"),
|
|
3764
3773
|
allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
|
|
3765
3774
|
items: M(r, "items"),
|
|
@@ -3775,11 +3784,11 @@ var pi = ["aria-label"], mi = {
|
|
|
3775
3784
|
setActiveIndex(e) {
|
|
3776
3785
|
f("update:activeIndex", e);
|
|
3777
3786
|
}
|
|
3778
|
-
}), m = i(() =>
|
|
3787
|
+
}), m = i(() => Gt({
|
|
3779
3788
|
itemCount: r.items.length,
|
|
3780
3789
|
loading: r.loading,
|
|
3781
3790
|
phase: r.phase
|
|
3782
|
-
})), h = i(() =>
|
|
3791
|
+
})), h = i(() => Kt({
|
|
3783
3792
|
errorMessage: r.errorMessage,
|
|
3784
3793
|
hasItems: r.items.length > 0,
|
|
3785
3794
|
hasNextPage: r.hasNextPage,
|
|
@@ -3792,7 +3801,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3792
3801
|
message: h.value.message,
|
|
3793
3802
|
paginationDetail: r.paginationDetail,
|
|
3794
3803
|
total: r.items.length
|
|
3795
|
-
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() =>
|
|
3804
|
+
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => Bt(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Ut({
|
|
3796
3805
|
emptyStateMode: M(r, "emptyStateMode"),
|
|
3797
3806
|
itemCount: C,
|
|
3798
3807
|
loading: M(r, "loading"),
|
|
@@ -3804,8 +3813,8 @@ var pi = ["aria-label"], mi = {
|
|
|
3804
3813
|
nextBoundaryLoadProgress: e,
|
|
3805
3814
|
previousBoundaryLoadProgress: t
|
|
3806
3815
|
});
|
|
3807
|
-
}, { immediate: !0 }), (e, n) => (w(), s("div",
|
|
3808
|
-
c("div",
|
|
3816
|
+
}, { immediate: !0 }), (e, n) => (w(), s("div", Ei, [
|
|
3817
|
+
c("div", Di, [c("span", Oi, [c("span", ki, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Ai, j(r.paginationDetail), 1)) : o("", !0)])]),
|
|
3809
3818
|
c("div", {
|
|
3810
3819
|
ref: N(p).scrollViewportRef,
|
|
3811
3820
|
"data-testid": "vibe-list-scroll",
|
|
@@ -3826,7 +3835,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3826
3835
|
"data-occurrence-key": N($)(t),
|
|
3827
3836
|
class: "absolute will-change-transform",
|
|
3828
3837
|
style: b(N(p).getCardStyle(n))
|
|
3829
|
-
}, [u(
|
|
3838
|
+
}, [u(Ti, {
|
|
3830
3839
|
active: n === N(p).resolvedActiveIndex.value,
|
|
3831
3840
|
index: n,
|
|
3832
3841
|
item: t,
|
|
@@ -3850,14 +3859,14 @@ var pi = ["aria-label"], mi = {
|
|
|
3850
3859
|
"report-asset-load",
|
|
3851
3860
|
"surface-active",
|
|
3852
3861
|
"onOpen"
|
|
3853
|
-
])], 12,
|
|
3862
|
+
])], 12, ji))), 128)),
|
|
3854
3863
|
(w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
|
|
3855
3864
|
key: `leaving-${N($)(t.item)}`,
|
|
3856
3865
|
"data-testid": "vibe-list-card-leaving",
|
|
3857
3866
|
"data-item-id": t.item.id,
|
|
3858
3867
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
3859
3868
|
style: b(N(p).getLeavingCardStyle(t.item))
|
|
3860
|
-
}, [u(
|
|
3869
|
+
}, [u(Ti, {
|
|
3861
3870
|
active: !1,
|
|
3862
3871
|
index: -1,
|
|
3863
3872
|
item: t.item,
|
|
@@ -3872,8 +3881,8 @@ var pi = ["aria-label"], mi = {
|
|
|
3872
3881
|
"item",
|
|
3873
3882
|
"report-asset-error",
|
|
3874
3883
|
"report-asset-load"
|
|
3875
|
-
])], 12,
|
|
3876
|
-
N(A) && N(T) ? (w(), a(
|
|
3884
|
+
])], 12, Mi))), 128)),
|
|
3885
|
+
N(A) && N(T) ? (w(), a(wn, {
|
|
3877
3886
|
key: 0,
|
|
3878
3887
|
message: N(T).message,
|
|
3879
3888
|
mode: N(T).mode,
|
|
@@ -3887,12 +3896,12 @@ var pi = ["aria-label"], mi = {
|
|
|
3887
3896
|
"surface"
|
|
3888
3897
|
])) : o("", !0)
|
|
3889
3898
|
], 4)], 544),
|
|
3890
|
-
N(p).showScrollbar.value ? (w(), s("div",
|
|
3899
|
+
N(p).showScrollbar.value ? (w(), s("div", Ni, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
3891
3900
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
3892
3901
|
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"]),
|
|
3893
3902
|
style: b(N(p).getScrollbarThumbStyle())
|
|
3894
3903
|
}, null, 6)])) : o("", !0),
|
|
3895
|
-
d["grid-footer"] ? (w(), s("div",
|
|
3904
|
+
d["grid-footer"] ? (w(), s("div", Pi, [c("div", Fi, [k(e.$slots, "grid-footer")])])) : o("", !0),
|
|
3896
3905
|
_.value ? (w(), s("div", {
|
|
3897
3906
|
key: 2,
|
|
3898
3907
|
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"])
|
|
@@ -3901,7 +3910,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3901
3910
|
"data-testid": "vibe-grid-status-badge",
|
|
3902
3911
|
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" : ""])
|
|
3903
3912
|
}, j(_.value.message), 3))], 2)) : o("", !0),
|
|
3904
|
-
N(E) && N(T) ? (w(), a(
|
|
3913
|
+
N(E) && N(T) ? (w(), a(wn, {
|
|
3905
3914
|
key: 3,
|
|
3906
3915
|
class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
3907
3916
|
message: N(T).message,
|
|
@@ -3918,13 +3927,13 @@ var pi = ["aria-label"], mi = {
|
|
|
3918
3927
|
])) : o("", !0)
|
|
3919
3928
|
]));
|
|
3920
3929
|
}
|
|
3921
|
-
}),
|
|
3930
|
+
}), Li = ["data-surface-mode"], Ri = {
|
|
3922
3931
|
key: 1,
|
|
3923
3932
|
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"
|
|
3924
|
-
},
|
|
3933
|
+
}, zi = ["data-visible", "inert"], Bi = ["data-visible", "inert"], Vi = {
|
|
3925
3934
|
key: 3,
|
|
3926
3935
|
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"
|
|
3927
|
-
},
|
|
3936
|
+
}, Hi = /* @__PURE__ */ d({
|
|
3928
3937
|
name: "VibeLayout",
|
|
3929
3938
|
__name: "Layout",
|
|
3930
3939
|
props: {
|
|
@@ -3978,7 +3987,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3978
3987
|
type: "button",
|
|
3979
3988
|
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",
|
|
3980
3989
|
onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
|
|
3981
|
-
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div",
|
|
3990
|
+
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Ri, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
|
|
3982
3991
|
appear: "",
|
|
3983
3992
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
3984
3993
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -3992,7 +4001,7 @@ var pi = ["aria-label"], mi = {
|
|
|
3992
4001
|
"data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
|
|
3993
4002
|
inert: N(h).surfaceMode.value !== "list",
|
|
3994
4003
|
class: "absolute inset-0 z-[2]"
|
|
3995
|
-
}, [u(
|
|
4004
|
+
}, [u(Ii, {
|
|
3996
4005
|
active: N(h).surfaceMode.value === "list",
|
|
3997
4006
|
"allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
|
|
3998
4007
|
items: N(h).items.value,
|
|
@@ -4062,7 +4071,7 @@ var pi = ["aria-label"], mi = {
|
|
|
4062
4071
|
"onBoundaryLoadProgress",
|
|
4063
4072
|
"onOpenFullscreen",
|
|
4064
4073
|
"onUpdate:activeIndex"
|
|
4065
|
-
])], 8,
|
|
4074
|
+
])], 8, zi), [[I, N(h).surfaceMode.value === "list"]])]),
|
|
4066
4075
|
_: 3
|
|
4067
4076
|
}), u(r, {
|
|
4068
4077
|
appear: "",
|
|
@@ -4078,7 +4087,7 @@ var pi = ["aria-label"], mi = {
|
|
|
4078
4087
|
"data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
4079
4088
|
inert: N(h).surfaceMode.value !== "fullscreen",
|
|
4080
4089
|
class: "absolute inset-0 z-[3]"
|
|
4081
|
-
}, [u(
|
|
4090
|
+
}, [u(or, {
|
|
4082
4091
|
items: N(h).items.value,
|
|
4083
4092
|
active: N(h).surfaceMode.value === "fullscreen",
|
|
4084
4093
|
"active-index": N(h).activeIndex.value,
|
|
@@ -4147,12 +4156,12 @@ var pi = ["aria-label"], mi = {
|
|
|
4147
4156
|
"show-back-to-list",
|
|
4148
4157
|
"onBackToList",
|
|
4149
4158
|
"onUpdate:activeIndex"
|
|
4150
|
-
])], 8,
|
|
4159
|
+
])], 8, Bi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
|
|
4151
4160
|
_: 3
|
|
4152
|
-
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div",
|
|
4161
|
+
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Vi, [u(N(oe), {
|
|
4153
4162
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
4154
4163
|
"aria-hidden": "true"
|
|
4155
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(
|
|
4164
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(or, {
|
|
4156
4165
|
key: 4,
|
|
4157
4166
|
items: N(h).items.value,
|
|
4158
4167
|
active: !0,
|
|
@@ -4220,10 +4229,10 @@ var pi = ["aria-label"], mi = {
|
|
|
4220
4229
|
"show-status-badges",
|
|
4221
4230
|
"onBackToList",
|
|
4222
4231
|
"onUpdate:activeIndex"
|
|
4223
|
-
]))], 8,
|
|
4232
|
+
]))], 8, Li));
|
|
4224
4233
|
}
|
|
4225
|
-
}),
|
|
4226
|
-
e.component("VibeLayout",
|
|
4234
|
+
}), Ui = { install(e) {
|
|
4235
|
+
e.component("VibeLayout", Hi);
|
|
4227
4236
|
} };
|
|
4228
4237
|
//#endregion
|
|
4229
|
-
export {
|
|
4238
|
+
export { Hi as VibeLayout, Ui as VibePlugin, Ui as default };
|