@wyxos/vibe 3.1.12 → 3.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1195,7 +1195,7 @@ function jt(e = At) {
1195
1195
  function i(e) {
1196
1196
  let i = {
1197
1197
  ...e,
1198
- domain: Ft(e.url),
1198
+ domain: Pt(e.url),
1199
1199
  enqueuedAt: r,
1200
1200
  id: `vibe-asset-load-${r += 1}`
1201
1201
  };
@@ -1230,7 +1230,6 @@ function jt(e = At) {
1230
1230
  }
1231
1231
  }
1232
1232
  function o(n) {
1233
- if (!Pt(n)) return !1;
1234
1233
  let r = [...t.values()].filter((e) => e.domain === n.domain);
1235
1234
  return !(r.length >= e.maxPerDomain || n.assetType === "video" && r.filter((e) => e.assetType === "video").length >= e.maxVideoPerDomain);
1236
1235
  }
@@ -1246,13 +1245,6 @@ function Nt(e) {
1246
1245
  }
1247
1246
  }
1248
1247
  function Pt(e) {
1249
- try {
1250
- return e.canGrant?.() ?? !0;
1251
- } catch {
1252
- return !1;
1253
- }
1254
- }
1255
- function Ft(e) {
1256
1248
  try {
1257
1249
  return new URL(e).hostname || "local";
1258
1250
  } catch {
@@ -1261,21 +1253,23 @@ function Ft(e) {
1261
1253
  }
1262
1254
  //#endregion
1263
1255
  //#region src/components/viewer-core/useFullscreenPreloadController.ts
1264
- var It = [
1265
- -1,
1256
+ var Ft = [
1257
+ 0,
1266
1258
  1,
1267
- 2
1268
- ], Lt = [-1, 1], Rt = {
1269
- [-1]: 0,
1270
- 1: 0,
1271
- 2: 1
1259
+ 2,
1260
+ 3
1261
+ ], It = {
1262
+ 0: 0,
1263
+ 1: 1,
1264
+ 2: 2,
1265
+ 3: 3
1272
1266
  };
1273
- function zt(e) {
1267
+ function Lt(e) {
1274
1268
  let t = D({}), n = jt({
1275
- maxGlobal: 2,
1276
- maxPerDomain: 2,
1277
- maxVideoPerDomain: 2
1278
- }), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
1269
+ maxGlobal: 3,
1270
+ maxPerDomain: 3,
1271
+ maxVideoPerDomain: 3
1272
+ }), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
1279
1273
  L([
1280
1274
  e.active,
1281
1275
  e.items,
@@ -1285,115 +1279,95 @@ function zt(e) {
1285
1279
  }, { immediate: !0 }), f() && C(() => {
1286
1280
  p();
1287
1281
  });
1282
+ function s(e) {
1283
+ let t = c(e);
1284
+ return t === "loading" || t === "ready";
1285
+ }
1288
1286
  function c(n) {
1289
- if (!e.active.value) return !1;
1290
- let r = e.items.value[n];
1291
- if (!r || !Ut(r)) return !1;
1292
- let i = e.getItemKey(r);
1293
- return i === g() || !!t.value[i];
1287
+ if (!e.active.value) return "idle";
1288
+ let i = _(n);
1289
+ return i ? t.value[i.key] ? e.isAssetReady(i.key, i.item) ? "ready" : "loading" : r.has(i.key) ? "queued" : "idle" : "idle";
1294
1290
  }
1295
1291
  function l(e, t) {
1296
1292
  if (t instanceof HTMLImageElement) {
1297
- i.set(e, t), Vt(t) && b(e);
1293
+ i.set(e, t), zt(t) && d(e);
1298
1294
  return;
1299
1295
  }
1300
1296
  i.delete(e);
1301
1297
  }
1302
1298
  function u(e, t) {
1303
1299
  if (t instanceof HTMLMediaElement) {
1304
- a.set(e, t), Ht(t) && b(e);
1300
+ a.set(e, t), Bt(t) && d(e);
1305
1301
  return;
1306
1302
  }
1307
1303
  a.delete(e);
1308
1304
  }
1309
1305
  function d(e) {
1310
- o.add(e);
1311
1306
  let t = r.get(e);
1312
- if (!t) {
1313
- x();
1314
- return;
1315
- }
1316
- t.lease.release(), r.delete(e);
1307
+ t && (t.lease.release(), r.delete(e));
1317
1308
  }
1318
1309
  function p() {
1319
- for (let e of r.values()) e.lease.release();
1320
- r.clear(), t.value = {}, S();
1310
+ for (let e of r.values()) e.lease.cancel();
1311
+ r.clear(), t.value = {}, v();
1321
1312
  }
1322
1313
  function m() {
1323
1314
  if (!e.active.value) {
1324
1315
  p();
1325
1316
  return;
1326
1317
  }
1327
- let o = h(), c = new Set(o.map((e) => e.key)), l = g();
1328
- for (let e of s) e !== l && c.has(e) && w(e, !0);
1329
- for (let e of Object.keys(t.value)) c.has(e) || w(e, !1);
1318
+ let o = h(), s = new Map(o.map((e) => [e.key, e])), c = new Set(s.keys());
1319
+ for (let e of Object.keys(t.value)) c.has(e) || y(e, !1);
1330
1320
  for (let [e, t] of r.entries()) {
1331
- if (!c.has(e)) {
1332
- t.lease.release(), r.delete(e);
1321
+ let n = s.get(e);
1322
+ if (!n) {
1323
+ t.lease.cancel(), r.delete(e);
1333
1324
  continue;
1334
1325
  }
1335
- let n = o.find((t) => t.key === e);
1336
- n && (t.index = n.index);
1326
+ t.index = n.index, t.item = n.item;
1337
1327
  }
1338
- for (let e of o) {
1339
- if (r.has(e.key) || t.value[e.key]) continue;
1328
+ for (let s of o) {
1329
+ if (e.isAssetReady(s.key, s.item)) {
1330
+ y(s.key, !0), d(s.key);
1331
+ continue;
1332
+ }
1333
+ if (t.value[s.key] || r.has(s.key)) continue;
1340
1334
  let o;
1341
1335
  o = {
1342
- index: e.index,
1343
- key: e.key,
1336
+ ...s,
1344
1337
  lease: n.request({
1345
- assetType: e.item.type === "image" ? "image" : "video",
1346
- canGrant: () => v(o.index),
1347
- getPriority: () => _(o.index),
1338
+ assetType: s.item.type === "image" ? "image" : "video",
1339
+ getPriority: () => g(o.index),
1348
1340
  onGrant: () => {
1349
- w(e.key, !0), Bt(e.key, i, a) && d(e.key);
1341
+ y(s.key, !0), (e.isAssetReady(s.key, s.item) || Rt(s.key, i, a)) && d(s.key);
1350
1342
  },
1351
- url: e.item.url
1343
+ url: s.item.url
1352
1344
  })
1353
- }, r.set(e.key, o);
1345
+ }, r.set(s.key, o);
1354
1346
  }
1355
1347
  for (let e of r.values()) e.lease.refresh();
1356
- S();
1348
+ v();
1357
1349
  }
1358
1350
  function h() {
1359
1351
  let t = e.resolvedActiveIndex.value;
1360
- return It.map((e) => y(t + e)).filter((e) => !!e);
1352
+ return Ft.map((e) => _(t + e)).filter((e) => !!e);
1361
1353
  }
1362
- function g() {
1363
- let t = e.items.value[e.resolvedActiveIndex.value];
1364
- return !e.active.value || !t || !Ut(t) ? null : e.getItemKey(t);
1354
+ function g(t) {
1355
+ return e.active.value ? It[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
1365
1356
  }
1366
1357
  function _(t) {
1367
- return e.active.value ? Rt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
1368
- }
1369
- function v(t) {
1370
- return t - e.resolvedActiveIndex.value === 2 ? Lt.every((t) => {
1371
- let n = y(e.resolvedActiveIndex.value + t);
1372
- return n ? o.has(n.key) : !0;
1373
- }) : !0;
1374
- }
1375
- function y(t) {
1376
1358
  let n = e.items.value[t];
1377
- return !n || !Ut(n) ? null : {
1359
+ return !n || !Vt(n) ? null : {
1378
1360
  index: t,
1379
1361
  item: n,
1380
1362
  key: e.getItemKey(n)
1381
1363
  };
1382
1364
  }
1383
- function b(e) {
1384
- d(e);
1385
- }
1386
- function x() {
1387
- for (let e of r.values()) e.lease.refresh();
1365
+ function v() {
1366
+ let n = new Set(Object.keys(t.value));
1367
+ for (let t of o) n.has(t) || (b(t), e.onResetAssetState(t));
1368
+ o = n;
1388
1369
  }
1389
- function S() {
1390
- let n = /* @__PURE__ */ new Set(), r = g();
1391
- r && n.add(r);
1392
- for (let e of Object.keys(t.value)) n.add(e);
1393
- for (let t of s) n.has(t) || (o.delete(t), T(t), e.onResetAssetState(t));
1394
- s = n;
1395
- }
1396
- function w(e, n) {
1370
+ function y(e, n) {
1397
1371
  if (n) {
1398
1372
  if (t.value[e]) return;
1399
1373
  t.value = {
@@ -1406,7 +1380,7 @@ function zt(e) {
1406
1380
  let r = { ...t.value };
1407
1381
  delete r[e], t.value = r;
1408
1382
  }
1409
- function T(e) {
1383
+ function b(e) {
1410
1384
  let t = i.get(e);
1411
1385
  if (t) try {
1412
1386
  t.removeAttribute("src"), t.src = "";
@@ -1423,35 +1397,37 @@ function zt(e) {
1423
1397
  }
1424
1398
  }
1425
1399
  return {
1426
- clearBackgroundPreloads: p,
1400
+ clearPreloads: p,
1401
+ getSlidePreloadState: c,
1427
1402
  registerImageElement: l,
1428
1403
  registerMediaElement: u,
1429
- settleBackgroundPreload: d,
1430
- shouldAttachSlideAsset: c
1404
+ settleAssetPreload: d,
1405
+ shouldAttachSlideAsset: s
1431
1406
  };
1432
1407
  }
1433
- function Bt(e, t, n) {
1408
+ function Rt(e, t, n) {
1434
1409
  let r = t.get(e);
1435
- if (r) return Vt(r);
1410
+ if (r) return zt(r);
1436
1411
  let i = n.get(e);
1437
- return i ? Ht(i) : !1;
1412
+ return i ? Bt(i) : !1;
1438
1413
  }
1439
- function Vt(e) {
1414
+ function zt(e) {
1440
1415
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
1441
1416
  }
1442
- function Ht(e) {
1417
+ function Bt(e) {
1443
1418
  let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
1444
1419
  return e.readyState >= t;
1445
1420
  }
1446
- function Ut(e) {
1421
+ function Vt(e) {
1447
1422
  return e.type === "image" || e.type === "video" || e.type === "audio";
1448
1423
  }
1449
1424
  //#endregion
1450
1425
  //#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
1451
- function Wt(e) {
1452
- let t = zt({
1426
+ function Ht(e) {
1427
+ let t = Lt({
1453
1428
  active: e.active,
1454
1429
  getItemKey: r,
1430
+ isAssetReady: p,
1455
1431
  items: e.items,
1456
1432
  onResetAssetState: e.viewer.resetAssetState,
1457
1433
  resolvedActiveIndex: e.resolvedActiveIndex
@@ -1466,51 +1442,58 @@ function Wt(e) {
1466
1442
  function i(e) {
1467
1443
  return t.shouldAttachSlideAsset(e);
1468
1444
  }
1469
- function a(t, n) {
1470
- let a = r(n);
1471
- return !i(t) || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(a) ? !1 : n.type === "image" ? !e.viewer.isImageReady(a) : n.type === "video" || n.type === "audio" ? !e.viewer.isMediaReady(a) : !1;
1445
+ function a(e) {
1446
+ return t.getSlidePreloadState(e);
1472
1447
  }
1473
- function o(t) {
1474
- return e.viewer.getAssetErrorKind(r(t));
1448
+ function o(t, n) {
1449
+ let i = r(n), o = a(t);
1450
+ return o === "idle" || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(i) ? !1 : o !== "ready";
1475
1451
  }
1476
1452
  function s(t) {
1477
- return e.viewer.getAssetErrorLabel(r(t)) ?? "Load error";
1453
+ return e.viewer.getAssetErrorKind(r(t));
1478
1454
  }
1479
- function c(t, n) {
1480
- return i(t) && t === e.resolvedActiveIndex.value && !!o(n);
1455
+ function c(t) {
1456
+ return e.viewer.getAssetErrorLabel(r(t)) ?? "Load error";
1481
1457
  }
1482
1458
  function l(t, n) {
1459
+ return a(t) !== "idle" && t === e.resolvedActiveIndex.value && !!s(n);
1460
+ }
1461
+ function u(t, n) {
1483
1462
  return i(t) ? e.viewer.getImageSource(n) : void 0;
1484
1463
  }
1485
- function u(e) {
1464
+ function d(e) {
1486
1465
  return i(e) ? "metadata" : "none";
1487
1466
  }
1488
- function d(e, t) {
1467
+ function f(e, t) {
1489
1468
  return i(e) ? t.url : void 0;
1490
1469
  }
1470
+ function p(t, n) {
1471
+ return n.type === "image" ? e.viewer.isImageReady(t) : n.type === "video" || n.type === "audio" ? e.viewer.isMediaReady(t) : !1;
1472
+ }
1491
1473
  return {
1492
- getAssetErrorKind: o,
1493
- getAssetErrorLabel: s,
1494
- getFullscreenImageSource: l,
1495
- getFullscreenMediaPreload: u,
1496
- getFullscreenMediaSource: d,
1474
+ getAssetErrorKind: s,
1475
+ getAssetErrorLabel: c,
1476
+ getFullscreenImageSource: u,
1477
+ getFullscreenMediaPreload: d,
1478
+ getFullscreenMediaSource: f,
1497
1479
  getItemKey: r,
1498
1480
  getMediaActionLabel: n,
1499
- isAssetErrored: c,
1500
- isAssetLoading: a,
1481
+ getSlidePreloadState: a,
1482
+ isAssetErrored: l,
1483
+ isAssetLoading: o,
1501
1484
  registerImageElement: t.registerImageElement,
1502
1485
  registerMediaElement: t.registerMediaElement,
1503
- settleBackgroundPreload: t.settleBackgroundPreload,
1486
+ settleAssetPreload: t.settleAssetPreload,
1504
1487
  shouldPreloadSlideAsset: i
1505
1488
  };
1506
1489
  }
1507
1490
  //#endregion
1508
1491
  //#region src/components/viewer-core/slotContent.ts
1509
- function Gt(e) {
1492
+ function Ut(e) {
1510
1493
  if (!Array.isArray(e)) return !1;
1511
1494
  for (let t of e) {
1512
1495
  if (Array.isArray(t)) {
1513
- if (Gt(t)) return !0;
1496
+ if (Ut(t)) return !0;
1514
1497
  continue;
1515
1498
  }
1516
1499
  if (!h(t)) {
@@ -1521,20 +1504,20 @@ function Gt(e) {
1521
1504
  if (t != null && t !== !1) return !0;
1522
1505
  continue;
1523
1506
  }
1524
- if (!Kt(t)) return !0;
1507
+ if (!Wt(t)) return !0;
1525
1508
  }
1526
1509
  return !1;
1527
1510
  }
1528
- function Kt(r) {
1529
- return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Gt(r.children) : !1;
1511
+ function Wt(r) {
1512
+ return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Ut(r.children) : !1;
1530
1513
  }
1531
1514
  //#endregion
1532
1515
  //#region src/components/viewer-core/useSurfaceEmptyState.ts
1533
- var qt = "no items available";
1534
- function Jt(e) {
1516
+ var Gt = "no items available";
1517
+ function Kt(e) {
1535
1518
  let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
1536
1519
  loading: !!e.loading.value,
1537
- message: qt,
1520
+ message: Gt,
1538
1521
  mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
1539
1522
  surface: e.surface,
1540
1523
  total: e.itemCount.value
@@ -1542,23 +1525,23 @@ function Jt(e) {
1542
1525
  return {
1543
1526
  emptyStateProps: t,
1544
1527
  showBadgeEmptyState: i(() => t.value?.mode === "badge"),
1545
- showCustomEmptyState: i(() => Gt(n.value)),
1528
+ showCustomEmptyState: i(() => Ut(n.value)),
1546
1529
  showInlineEmptyState: i(() => t.value?.mode === "inline")
1547
1530
  };
1548
1531
  }
1549
1532
  //#endregion
1550
1533
  //#region src/components/viewer-core/format.ts
1551
- function Yt(e) {
1534
+ function qt(e) {
1552
1535
  if (!Number.isFinite(e) || e <= 0) return "0:00";
1553
1536
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
1554
1537
  return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
1555
1538
  }
1556
1539
  //#endregion
1557
1540
  //#region src/components/viewer-core/surfaceStatus.ts
1558
- function Xt(e) {
1541
+ function Jt(e) {
1559
1542
  return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
1560
1543
  }
1561
- function Zt(e) {
1544
+ function Yt(e) {
1562
1545
  return e.phase === "failed" ? {
1563
1546
  kind: "failed",
1564
1547
  message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
@@ -1581,7 +1564,7 @@ function Zt(e) {
1581
1564
  }
1582
1565
  //#endregion
1583
1566
  //#region src/components/viewer-core/useActivation.ts
1584
- function Qt(e) {
1567
+ function Xt(e) {
1585
1568
  let t = !1;
1586
1569
  L(e.enabled, async (t) => {
1587
1570
  if (n(t), t) {
@@ -1604,7 +1587,7 @@ function Qt(e) {
1604
1587
  }
1605
1588
  //#endregion
1606
1589
  //#region src/components/viewer-core/assetState.ts
1607
- var $t = {
1590
+ var Zt = {
1608
1591
  currentTime: 0,
1609
1592
  duration: 0,
1610
1593
  errorKind: null,
@@ -1613,38 +1596,38 @@ var $t = {
1613
1596
  ready: !1,
1614
1597
  volume: 1
1615
1598
  };
1616
- function en() {
1617
- return { ...$t };
1599
+ function Qt() {
1600
+ return { ...Zt };
1618
1601
  }
1619
- function tn(e) {
1602
+ function $t(e) {
1620
1603
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
1621
1604
  }
1622
- function nn(e, t, n) {
1623
- 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 = rn(t, n);
1605
+ function en(e, t, n) {
1606
+ 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 = tn(t, n);
1624
1607
  }
1625
- function rn(e, t) {
1608
+ function tn(e, t) {
1626
1609
  return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
1627
1610
  }
1628
1611
  //#endregion
1629
1612
  //#region src/components/viewer-core/loadError.ts
1630
- var an = /* @__PURE__ */ new Map();
1631
- function on(e) {
1613
+ var nn = /* @__PURE__ */ new Map();
1614
+ function rn(e) {
1632
1615
  return e === "not-found" ? "404" : "Load error";
1633
1616
  }
1634
- function sn(e) {
1617
+ function an(e) {
1635
1618
  return e === "generic";
1636
1619
  }
1637
- function cn(e) {
1638
- return ln(e).then((e) => e ?? "generic");
1620
+ function on(e) {
1621
+ return sn(e).then((e) => e ?? "generic");
1639
1622
  }
1640
- function ln(e) {
1641
- let t = an.get(e);
1623
+ function sn(e) {
1624
+ let t = nn.get(e);
1642
1625
  if (t) return t;
1643
- let n = un(e);
1644
- return an.set(e, n), n;
1626
+ let n = cn(e);
1627
+ return nn.set(e, n), n;
1645
1628
  }
1646
- async function un(e) {
1647
- if (!dn(e)) return null;
1629
+ async function cn(e) {
1630
+ if (!ln(e)) return null;
1648
1631
  try {
1649
1632
  let t = await fetch(e, { method: "HEAD" });
1650
1633
  return t.ok ? null : t.status === 404 ? "not-found" : "generic";
@@ -1652,12 +1635,12 @@ async function un(e) {
1652
1635
  return "generic";
1653
1636
  }
1654
1637
  }
1655
- function dn(e) {
1638
+ function ln(e) {
1656
1639
  return /^(https?:\/\/|\/)/i.test(e);
1657
1640
  }
1658
1641
  //#endregion
1659
1642
  //#region src/components/viewer-core/mediaPlayback.ts
1660
- function fn(e) {
1643
+ function un(e) {
1661
1644
  try {
1662
1645
  let t = e.play();
1663
1646
  t && typeof t.catch == "function" && t.catch(() => {});
@@ -1665,12 +1648,12 @@ function fn(e) {
1665
1648
  }
1666
1649
  //#endregion
1667
1650
  //#region src/components/viewer-core/useMedia.ts
1668
- function pn(e) {
1651
+ function dn(e) {
1669
1652
  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(() => {
1670
1653
  let t = /* @__PURE__ */ new Map();
1671
1654
  for (let n of e.items.value) t.set($(n), n);
1672
1655
  return t;
1673
- }), p = i(() => d.value ? r.value[d.value] ?? $t : $t), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : mn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
1656
+ }), p = i(() => d.value ? r.value[d.value] ?? Zt : Zt), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : fn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
1674
1657
  L(() => u.value, async () => {
1675
1658
  await C();
1676
1659
  }), L(() => e.itemCount.value, async () => {
@@ -1693,7 +1676,7 @@ function pn(e) {
1693
1676
  c.delete(e);
1694
1677
  }
1695
1678
  function b(e, r) {
1696
- r instanceof HTMLImageElement && tn(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
1679
+ r instanceof HTMLImageElement && $t(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
1697
1680
  }
1698
1681
  function x() {
1699
1682
  H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
@@ -1715,14 +1698,14 @@ function pn(e) {
1715
1698
  V(i, n);
1716
1699
  continue;
1717
1700
  }
1718
- i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, fn(i), W(n, i);
1701
+ i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, un(i), W(n, i);
1719
1702
  }
1720
1703
  for (let [e, n] of c.entries()) {
1721
1704
  if (e !== t || r.value[e]?.errorKind) {
1722
1705
  V(n, e);
1723
1706
  continue;
1724
1707
  }
1725
- fn(n), W(e, n);
1708
+ un(n), W(e, n);
1726
1709
  }
1727
1710
  }
1728
1711
  function w(e, t) {
@@ -1740,7 +1723,7 @@ function pn(e) {
1740
1723
  async function E(r, i) {
1741
1724
  let a = Y(r) ?? e.activeItem.value;
1742
1725
  t.value[r] = !1, n.value[r] = "generic";
1743
- let o = await cn(i);
1726
+ let o = await on(i);
1744
1727
  n.value[r] = o, a && e.onAssetError?.({
1745
1728
  item: a,
1746
1729
  occurrenceKey: r,
@@ -1758,7 +1741,7 @@ function pn(e) {
1758
1741
  } catch {}
1759
1742
  }
1760
1743
  i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
1761
- let o = await cn(n);
1744
+ let o = await on(n);
1762
1745
  i.errorKind = o, a && e.onAssetError?.({
1763
1746
  item: a,
1764
1747
  occurrenceKey: t,
@@ -1778,13 +1761,13 @@ function pn(e) {
1778
1761
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1779
1762
  let r = Number.parseFloat(e.target.value);
1780
1763
  if (!Number.isFinite(r)) return;
1781
- let i = mn(r, 0, m.value || 0);
1764
+ let i = fn(r, 0, m.value || 0);
1782
1765
  ne(n, i, t), t.currentTime = i;
1783
1766
  }
1784
1767
  function M(e) {
1785
1768
  let t = q(), n = d.value;
1786
1769
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1787
- let r = mn(Number.parseFloat(e.target.value), 0, 1);
1770
+ let r = fn(Number.parseFloat(e.target.value), 0, 1);
1788
1771
  t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
1789
1772
  }
1790
1773
  function N() {
@@ -1805,10 +1788,10 @@ function pn(e) {
1805
1788
  }
1806
1789
  function z(e) {
1807
1790
  let t = R(e);
1808
- return t ? on(t) : null;
1791
+ return t ? rn(t) : null;
1809
1792
  }
1810
1793
  function B(e) {
1811
- return sn(R(e));
1794
+ return an(R(e));
1812
1795
  }
1813
1796
  function ee(e) {
1814
1797
  return `${e}:${a.value[e] ?? 0}`;
@@ -1835,17 +1818,17 @@ function pn(e) {
1835
1818
  for (let [e, t] of c.entries()) V(t, e);
1836
1819
  }
1837
1820
  function U(e) {
1838
- return r.value[e] || (r.value[e] = en()), r.value[e];
1821
+ return r.value[e] || (r.value[e] = Qt()), r.value[e];
1839
1822
  }
1840
1823
  function W(e, t, n) {
1841
- nn(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
1824
+ en(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
1842
1825
  }
1843
1826
  function ne(e, t, n) {
1844
1827
  let r = U(e);
1845
1828
  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;
1846
1829
  }
1847
1830
  function G(e) {
1848
- return mn(o.value[e] ?? 1, 0, 1);
1831
+ return fn(o.value[e] ?? 1, 0, 1);
1849
1832
  }
1850
1833
  function K(e) {
1851
1834
  return s.get(e) ?? c.get(e) ?? null;
@@ -1856,7 +1839,7 @@ function pn(e) {
1856
1839
  function re(e) {
1857
1840
  if (e) {
1858
1841
  if (e.paused) {
1859
- fn(e);
1842
+ un(e);
1860
1843
  return;
1861
1844
  }
1862
1845
  e.pause();
@@ -1910,26 +1893,32 @@ function pn(e) {
1910
1893
  syncMediaPlayback: C
1911
1894
  };
1912
1895
  }
1913
- function mn(e, t, n) {
1896
+ function fn(e, t, n) {
1914
1897
  return Math.min(Math.max(e, t), n);
1915
1898
  }
1916
- function hn(e, t, n = 2) {
1899
+ //#endregion
1900
+ //#region src/components/viewer-core/virtualization.ts
1901
+ var pn = {
1902
+ backward: 1,
1903
+ forward: 3
1904
+ };
1905
+ function mn(e, t, n = pn) {
1917
1906
  return t <= 0 ? {
1918
1907
  start: 0,
1919
1908
  end: -1
1920
1909
  } : {
1921
- start: Math.max(0, e - n),
1922
- end: Math.min(t - 1, e + n)
1910
+ start: Math.max(0, e - n.backward),
1911
+ end: Math.min(t - 1, e + n.forward)
1923
1912
  };
1924
1913
  }
1925
- function gn(e, t, n = 2) {
1926
- let r = hn(t, e.length, n);
1914
+ function hn(e, t, n = pn) {
1915
+ let r = mn(t, e.length, n);
1927
1916
  return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
1928
1917
  item: e,
1929
1918
  index: r.start + t
1930
1919
  }));
1931
1920
  }
1932
- function _n(e, t, n, r, i) {
1921
+ function gn(e, t, n, r, i) {
1933
1922
  return {
1934
1923
  transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
1935
1924
  transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
@@ -1937,12 +1926,12 @@ function _n(e, t, n, r, i) {
1937
1926
  }
1938
1927
  //#endregion
1939
1928
  //#region src/components/viewer-core/useViewer.ts
1940
- function vn(e, t, n = {}) {
1941
- let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => Xt({
1929
+ function _n(e, t, n = {}) {
1930
+ 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(() => Jt({
1942
1931
  itemCount: r.value.length,
1943
1932
  loading: s.value,
1944
1933
  phase: e.phase
1945
- })), 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 = pn({
1934
+ })), 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 = dn({
1946
1935
  items: r,
1947
1936
  activeItem: C,
1948
1937
  activeMediaItem: w,
@@ -1951,14 +1940,14 @@ function vn(e, t, n = {}) {
1951
1940
  loopFullscreenVideo: l,
1952
1941
  onAssetError: n.onAssetError,
1953
1942
  onAssetLoad: n.onAssetLoad
1954
- }), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Zt({
1943
+ }), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Yt({
1955
1944
  errorMessage: o.value,
1956
1945
  hasItems: r.value.length > 0,
1957
1946
  hasNextPage: c.value,
1958
1947
  phase: d.value,
1959
1948
  surface: "fullscreen"
1960
- })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => hn(S.value, r.value.length)), N = i(() => gn(r.value, S.value));
1961
- Qt({
1949
+ })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => mn(S.value, r.value.length)), N = i(() => hn(r.value, S.value));
1950
+ Xt({
1962
1951
  enabled: _,
1963
1952
  onDisable() {
1964
1953
  H(), T.resetMediaState();
@@ -2036,7 +2025,7 @@ function vn(e, t, n = {}) {
2036
2025
  return e.type === "audio";
2037
2026
  }
2038
2027
  function ie(e) {
2039
- return _n(e, S.value, g.value, m.value, h.value);
2028
+ return gn(e, S.value, g.value, m.value, h.value);
2040
2029
  }
2041
2030
  return {
2042
2031
  activeItem: C,
@@ -2051,7 +2040,7 @@ function vn(e, t, n = {}) {
2051
2040
  getAssetErrorKind: T.getAssetErrorKind,
2052
2041
  getAssetErrorLabel: T.getAssetErrorLabel,
2053
2042
  getAssetRenderKey: T.getAssetRenderKey,
2054
- formatPlaybackTime: Yt,
2043
+ formatPlaybackTime: qt,
2055
2044
  getImageSource: T.getImageSource,
2056
2045
  getSlideStyle: ie,
2057
2046
  hasNextPage: c,
@@ -2095,21 +2084,21 @@ function vn(e, t, n = {}) {
2095
2084
  }
2096
2085
  //#endregion
2097
2086
  //#region src/components/viewer-core/theme.ts
2098
- var yn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", bn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", xn = {
2087
+ var vn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", yn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", bn = {
2099
2088
  image: !0,
2100
2089
  video: !0,
2101
2090
  audio: !0,
2102
2091
  other: !0
2103
2092
  };
2104
- function Sn(e) {
2105
- return xn[e], yn;
2093
+ function xn(e) {
2094
+ return bn[e], vn;
2106
2095
  }
2107
- function Cn(e) {
2108
- return xn[e], bn;
2096
+ function Sn(e) {
2097
+ return bn[e], yn;
2109
2098
  }
2110
2099
  //#endregion
2111
2100
  //#region src/components/viewer-core/dominantImageTone.ts
2112
- function wn(e) {
2101
+ function Cn(e) {
2113
2102
  if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
2114
2103
  let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
2115
2104
  if (!n) return null;
@@ -2124,20 +2113,20 @@ function wn(e) {
2124
2113
  r += d, i += s * d, a += c * d, o += l * d;
2125
2114
  }
2126
2115
  return r <= 0 ? null : {
2127
- r: Tn(Math.round(i / r)),
2128
- g: Tn(Math.round(a / r)),
2129
- b: Tn(Math.round(o / r))
2116
+ r: wn(Math.round(i / r)),
2117
+ g: wn(Math.round(a / r)),
2118
+ b: wn(Math.round(o / r))
2130
2119
  };
2131
2120
  } catch {
2132
2121
  return null;
2133
2122
  }
2134
2123
  }
2135
- function Tn(e) {
2124
+ function wn(e) {
2136
2125
  return Math.min(235, Math.max(26, e));
2137
2126
  }
2138
2127
  //#endregion
2139
2128
  //#region src/components/viewer-core/useFullscreenDominantTone.ts
2140
- function En(e) {
2129
+ function Tn(e) {
2141
2130
  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(() => {
2142
2131
  if (!r.value) return;
2143
2132
  let { r: e, g: t, b: n } = r.value;
@@ -2152,7 +2141,7 @@ function En(e) {
2152
2141
  });
2153
2142
  function s(n, r) {
2154
2143
  if (!e.showDominantImageTone.value) return;
2155
- let i = wn(r);
2144
+ let i = Cn(r);
2156
2145
  i && (t.value[n] = i);
2157
2146
  }
2158
2147
  return {
@@ -2163,7 +2152,7 @@ function En(e) {
2163
2152
  }
2164
2153
  //#endregion
2165
2154
  //#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
2166
- var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2155
+ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2167
2156
  inheritAttrs: !1,
2168
2157
  __name: "SurfaceEmptyState",
2169
2158
  props: {
@@ -2177,31 +2166,31 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2177
2166
  "data-testid": "vibe-empty-state-inline",
2178
2167
  "data-surface": e.surface,
2179
2168
  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)]"]
2180
- }), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, Dn)) : (w(), s("div", g({ key: 1 }, N(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
2169
+ }), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, En)) : (w(), s("div", g({ key: 1 }, N(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
2181
2170
  "data-testid": "vibe-empty-state-badge",
2182
2171
  "data-surface": e.surface,
2183
2172
  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"])
2184
- }, j(e.message), 11, On)])], 16));
2173
+ }, j(e.message), 11, Dn)])], 16));
2185
2174
  }
2186
- }), An = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, jn = {
2175
+ }), kn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, An = {
2187
2176
  key: 0,
2188
2177
  class: "relative h-full min-h-0"
2189
- }, Mn = [
2178
+ }, jn = [
2190
2179
  "data-item-id",
2191
2180
  "data-occurrence-key",
2192
2181
  "data-index",
2193
2182
  "data-active",
2194
2183
  "aria-hidden"
2195
- ], Nn = {
2184
+ ], Mn = {
2196
2185
  key: 0,
2197
2186
  "data-testid": "vibe-asset-spinner",
2198
2187
  class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
2199
- }, Pn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Fn = ["data-kind"], In = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Ln = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Rn = ["onClick"], zn = [
2188
+ }, Nn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Pn = ["data-kind"], Fn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, In = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Ln = ["onClick"], Rn = [
2200
2189
  "src",
2201
2190
  "alt",
2202
2191
  "onLoad",
2203
2192
  "onError"
2204
- ], Bn = [
2193
+ ], zn = [
2205
2194
  "loop",
2206
2195
  "src",
2207
2196
  "preload",
@@ -2220,15 +2209,15 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2220
2209
  "onStalled",
2221
2210
  "onTimeupdate",
2222
2211
  "onWaiting"
2223
- ], Vn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Hn = [
2212
+ ], Bn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Vn = [
2224
2213
  "aria-label",
2225
2214
  "disabled",
2226
2215
  "onClick"
2227
- ], Un = { class: "relative z-[1] inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-emerald-500/12 p-4 backdrop-blur-[20px]" }, Wn = { class: "pointer-events-none absolute bottom-4 right-4 inline-flex h-10 w-10 items-center justify-center border border-white/14 bg-black/50 backdrop-blur-[18px]" }, Gn = {
2216
+ ], Hn = { class: "relative z-[1] inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-emerald-500/12 p-4 backdrop-blur-[20px]" }, Un = { class: "pointer-events-none absolute bottom-4 right-4 inline-flex h-10 w-10 items-center justify-center border border-white/14 bg-black/50 backdrop-blur-[18px]" }, Wn = {
2228
2217
  key: 0,
2229
2218
  "data-testid": "vibe-asset-spinner",
2230
2219
  class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
2231
- }, Kn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, qn = ["data-kind"], Jn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Yn = ["onClick"], Xn = [
2220
+ }, Gn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Kn = ["data-kind"], qn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Jn = ["onClick"], Yn = [
2232
2221
  "src",
2233
2222
  "preload",
2234
2223
  "onCanplay",
@@ -2244,26 +2233,26 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2244
2233
  "onStalled",
2245
2234
  "onTimeupdate",
2246
2235
  "onWaiting"
2247
- ], Zn = {
2236
+ ], Xn = {
2248
2237
  key: 2,
2249
2238
  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"
2250
- }, Qn = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, $n = {
2239
+ }, Zn = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, Qn = {
2251
2240
  key: 0,
2252
2241
  "data-testid": "vibe-fullscreen-overlay",
2253
2242
  class: "pointer-events-none absolute inset-0 z-[6]"
2254
- }, er = { class: "h-full w-full" }, tr = {
2243
+ }, $n = { class: "h-full w-full" }, er = {
2255
2244
  key: 1,
2256
2245
  "data-testid": "vibe-forward-fill-placeholder",
2257
2246
  class: "grid h-full min-h-0 place-items-center px-6 text-center"
2258
- }, nr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, rr = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)]" }, ir = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, ar = {
2247
+ }, tr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, nr = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)]" }, rr = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, ir = {
2259
2248
  key: 0,
2260
2249
  "data-testid": "vibe-fullscreen-aside",
2261
2250
  class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
2262
- }, or = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, sr = {
2251
+ }, ar = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, or = {
2263
2252
  key: 0,
2264
2253
  "data-testid": "vibe-fullscreen-aside",
2265
2254
  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]"
2266
- }, cr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, lr = 1280, ur = 768, dr = /* @__PURE__ */ d({
2255
+ }, sr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, cr = 1280, lr = 768, ur = /* @__PURE__ */ d({
2267
2256
  __name: "FullscreenSurface",
2268
2257
  props: {
2269
2258
  active: {
@@ -2315,23 +2304,23 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2315
2304
  },
2316
2305
  emits: ["back-to-list", "update:activeIndex"],
2317
2306
  setup(e, { emit: n }) {
2318
- let d = e, f = F(), m = n, h = vn(d, (e, t) => {
2307
+ let d = e, f = F(), m = n, h = _n(d, (e, t) => {
2319
2308
  m("update:activeIndex", t);
2320
2309
  }, {
2321
2310
  enabled: M(d, "active"),
2322
2311
  onAssetError: d.reportAssetError ?? void 0,
2323
2312
  onAssetLoad: d.reportAssetLoad ?? void 0
2324
- }), _ = D(typeof window > "u" ? lr : window.innerWidth || lr), C = Wt({
2313
+ }), _ = D(typeof window > "u" ? cr : window.innerWidth || cr), C = Ht({
2325
2314
  active: M(d, "active"),
2326
2315
  items: h.items,
2327
2316
  resolvedActiveIndex: h.resolvedActiveIndex,
2328
2317
  viewer: h
2329
- }), T = i(() => Sn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = En({
2318
+ }), T = i(() => xn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = Tn({
2330
2319
  activeItem: h.activeItem,
2331
2320
  getItemKey: C.getItemKey,
2332
2321
  isImageReady: h.isImageReady,
2333
2322
  showDominantImageTone: M(d, "showDominantImageTone")
2334
- }), 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 < ur ? "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(() => {
2323
+ }), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value < lr ? "vertical" : "horizontal"), te = i(() => R.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), V = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), H = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), U = i(() => {
2335
2324
  let e = h.activeItem.value;
2336
2325
  return e ? {
2337
2326
  hasNextPage: d.hasNextPage,
@@ -2348,7 +2337,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2348
2337
  }), K = i(() => !G.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](G.value)), q = i(() => ({
2349
2338
  gridTemplateColumns: Y.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
2350
2339
  transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
2351
- })), re = i(() => Gt(W.value)), J = i(() => Gt(ne.value)), Y = i(() => J.value && _.value >= lr), ie = i(() => J.value && !Y.value), ae = i(() => Gt(K.value)), { emptyStateProps: X, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = Jt({
2340
+ })), re = i(() => Ut(W.value)), J = i(() => Ut(ne.value)), Y = i(() => J.value && _.value >= cr), ie = i(() => J.value && !Y.value), ae = i(() => Ut(K.value)), { emptyStateProps: X, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = Kt({
2352
2341
  emptyStateMode: M(d, "emptyStateMode"),
2353
2342
  itemCount: i(() => d.items.length),
2354
2343
  loading: M(d, "loading"),
@@ -2361,15 +2350,15 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2361
2350
  window.removeEventListener("resize", Z);
2362
2351
  });
2363
2352
  function Z() {
2364
- _.value = window.innerWidth || lr;
2353
+ _.value = window.innerWidth || cr;
2365
2354
  }
2366
2355
  function pe(e, t, n) {
2367
- C.settleBackgroundPreload(t), h.onImageLoad(t, n);
2356
+ C.settleAssetPreload(t), h.onImageLoad(t, n);
2368
2357
  let r = e.currentTarget;
2369
2358
  r instanceof HTMLImageElement && ye(t, r);
2370
2359
  }
2371
2360
  async function me(e, t) {
2372
- C.settleBackgroundPreload(e), await h.onImageError(e, t);
2361
+ C.settleAssetPreload(e), await h.onImageError(e, t);
2373
2362
  }
2374
2363
  function he(e, t) {
2375
2364
  C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && ye(e, t);
@@ -2381,12 +2370,12 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2381
2370
  C.registerMediaElement(e, t), h.registerAudioElement(e, t);
2382
2371
  }
2383
2372
  async function ve(e, t) {
2384
- C.settleBackgroundPreload(e), await h.onMediaError(e, t);
2373
+ C.settleAssetPreload(e), await h.onMediaError(e, t);
2385
2374
  }
2386
2375
  function Q(e, t) {
2387
2376
  h.onMediaEvent(e, t);
2388
2377
  let n = t.currentTarget, r = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
2389
- n instanceof HTMLMediaElement && n.readyState >= r && C.settleBackgroundPreload(e);
2378
+ n instanceof HTMLMediaElement && n.readyState >= r && C.settleAssetPreload(e);
2390
2379
  }
2391
2380
  function ye(e, t) {
2392
2381
  I(e, t);
@@ -2401,7 +2390,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2401
2390
  let r = n.play();
2402
2391
  r && typeof r.catch == "function" && r.catch(() => {});
2403
2392
  }
2404
- return (e, n) => (w(), s("div", An, [
2393
+ return (e, n) => (w(), s("div", kn, [
2405
2394
  c("div", {
2406
2395
  class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
2407
2396
  style: b(N(P))
@@ -2418,7 +2407,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2418
2407
  onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
2419
2408
  onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
2420
2409
  onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
2421
- }, [N(h).activeItem.value ? (w(), s("div", jn, [
2410
+ }, [N(h).activeItem.value ? (w(), s("div", An, [
2422
2411
  (w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
2423
2412
  key: N(C).getItemKey(r),
2424
2413
  "data-testid": "vibe-slide",
@@ -2430,12 +2419,12 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2430
2419
  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"]),
2431
2420
  style: b(N(h).getSlideStyle(i))
2432
2421
  }, [c("div", {
2433
- class: v(["absolute inset-0 opacity-85", N(Cn)(r.type)]),
2422
+ class: v(["absolute inset-0 opacity-85", N(Sn)(r.type)]),
2434
2423
  style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
2435
2424
  }, null, 6), N(h).isVisual(r) ? (w(), s("div", {
2436
2425
  key: 0,
2437
2426
  class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? te.value : ""])
2438
- }, [N(C).isAssetLoading(i, r) ? (w(), s("div", Nn, [c("span", Pn, [u(N(oe), {
2427
+ }, [N(C).isAssetLoading(i, r) ? (w(), s("div", Mn, [c("span", Nn, [u(N(oe), {
2439
2428
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2440
2429
  "aria-hidden": "true"
2441
2430
  })])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
@@ -2443,19 +2432,19 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2443
2432
  "data-testid": "vibe-asset-error",
2444
2433
  "data-kind": N(C).getAssetErrorKind(r),
2445
2434
  class: "grid h-full w-full place-items-center"
2446
- }, [c("div", In, [
2435
+ }, [c("div", Fn, [
2447
2436
  u(N(le), {
2448
2437
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2449
2438
  "aria-hidden": "true"
2450
2439
  }),
2451
- c("p", Ln, j(N(C).getAssetErrorLabel(r)), 1),
2440
+ c("p", In, j(N(C).getAssetErrorLabel(r)), 1),
2452
2441
  N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
2453
2442
  key: 0,
2454
2443
  type: "button",
2455
2444
  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",
2456
2445
  onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
2457
- }, " Retry ", 8, Rn)) : o("", !0)
2458
- ])], 8, Fn)) : r.type === "image" ? (w(), s("img", {
2446
+ }, " Retry ", 8, Ln)) : o("", !0)
2447
+ ])], 8, Pn)) : r.type === "image" ? (w(), s("img", {
2459
2448
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2460
2449
  src: N(C).getFullscreenImageSource(i, r),
2461
2450
  alt: r.title ?? "",
@@ -2466,7 +2455,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2466
2455
  ref: (e) => he(N(C).getItemKey(r), e),
2467
2456
  onLoad: (e) => pe(e, N(C).getItemKey(r), r.url),
2468
2457
  onError: (e) => me(N(C).getItemKey(r), r.url)
2469
- }, null, 42, zn)) : (w(), s("video", {
2458
+ }, null, 42, Rn)) : (w(), s("video", {
2470
2459
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2471
2460
  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"]),
2472
2461
  playsinline: "",
@@ -2490,10 +2479,10 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2490
2479
  onStalled: (e) => Q(N(C).getItemKey(r), e),
2491
2480
  onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
2492
2481
  onWaiting: (e) => Q(N(C).getItemKey(r), e)
2493
- }, null, 42, Bn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
2482
+ }, null, 42, zn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
2494
2483
  key: 1,
2495
2484
  class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? te.value : ""])
2496
- }, [c("div", Vn, [
2485
+ }, [c("div", Bn, [
2497
2486
  c("button", {
2498
2487
  type: "button",
2499
2488
  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]",
@@ -2503,19 +2492,19 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2503
2492
  }, [
2504
2493
  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),
2505
2494
  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),
2506
- c("span", Un, [k(e.$slots, "item-icon", {
2495
+ c("span", Hn, [k(e.$slots, "item-icon", {
2507
2496
  icon: N(Ot)(r.type),
2508
2497
  item: r
2509
2498
  }, () => [(w(), a(A(N(Ot)(r.type)), {
2510
2499
  class: "h-6 w-6 stroke-[1.9]",
2511
2500
  "aria-hidden": "true"
2512
2501
  }))])]),
2513
- c("span", Wn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
2502
+ c("span", Un, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
2514
2503
  class: "h-4 w-4 stroke-2",
2515
2504
  "aria-hidden": "true"
2516
2505
  }))])
2517
- ], 8, Hn),
2518
- N(C).isAssetLoading(i, r) ? (w(), s("div", Gn, [c("span", Kn, [u(N(oe), {
2506
+ ], 8, Vn),
2507
+ N(C).isAssetLoading(i, r) ? (w(), s("div", Wn, [c("span", Gn, [u(N(oe), {
2519
2508
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2520
2509
  "aria-hidden": "true"
2521
2510
  })])])) : o("", !0),
@@ -2528,14 +2517,14 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2528
2517
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2529
2518
  "aria-hidden": "true"
2530
2519
  }),
2531
- c("p", Jn, j(N(C).getAssetErrorLabel(r)), 1),
2520
+ c("p", qn, j(N(C).getAssetErrorLabel(r)), 1),
2532
2521
  N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
2533
2522
  key: 0,
2534
2523
  type: "button",
2535
2524
  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",
2536
2525
  onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
2537
- }, " Retry ", 8, Yn)) : o("", !0)
2538
- ], 8, qn)], 64)) : o("", !0)
2526
+ }, " Retry ", 8, Jn)) : o("", !0)
2527
+ ], 8, Kn)], 64)) : o("", !0)
2539
2528
  ]), (w(), s("audio", {
2540
2529
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2541
2530
  src: N(C).getFullscreenMediaSource(i, r),
@@ -2556,14 +2545,14 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2556
2545
  onStalled: (e) => Q(N(C).getItemKey(r), e),
2557
2546
  onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
2558
2547
  onWaiting: (e) => Q(N(C).getItemKey(r), e)
2559
- }, null, 40, Xn))], 2)) : (w(), s("div", Zn, [c("div", Qn, [k(e.$slots, "item-icon", {
2548
+ }, null, 40, Yn))], 2)) : (w(), s("div", Xn, [c("div", Zn, [k(e.$slots, "item-icon", {
2560
2549
  icon: N(Ot)(r.type),
2561
2550
  item: r
2562
2551
  }, () => [(w(), a(A(N(Ot)(r.type)), {
2563
2552
  class: "h-6 w-6 stroke-[1.9]",
2564
2553
  "aria-hidden": "true"
2565
- }))])])]))], 14, Mn))), 128)),
2566
- U.value && f["fullscreen-overlay"] ? (w(), s("div", $n, [c("div", er, [k(e.$slots, "fullscreen-overlay", y(p(U.value)))])])) : o("", !0),
2554
+ }))])])]))], 14, jn))), 128)),
2555
+ U.value && f["fullscreen-overlay"] ? (w(), s("div", Qn, [c("div", $n, [k(e.$slots, "fullscreen-overlay", y(p(U.value)))])])) : o("", !0),
2567
2556
  N(h).activeItem.value ? (w(), a(Tt, {
2568
2557
  key: 1,
2569
2558
  "current-index": N(h).resolvedActiveIndex.value,
@@ -2621,10 +2610,10 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2621
2610
  "data-testid": "vibe-fullscreen-status-badge",
2622
2611
  class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", G.value.kind === "end" ? "border-amber-300/35 text-amber-200" : G.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2623
2612
  }, j(G.value.message), 3))], 2)) : o("", !0)
2624
- ])) : V.value ? (w(), s("div", tr, [c("div", nr, [c("span", rr, [u(N(oe), {
2613
+ ])) : V.value ? (w(), s("div", er, [c("div", tr, [c("span", nr, [u(N(oe), {
2625
2614
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2626
2615
  "aria-hidden": "true"
2627
- })]), c("p", ir, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(kn, {
2616
+ })]), c("p", rr, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(On, {
2628
2617
  key: 2,
2629
2618
  message: N(X).message,
2630
2619
  mode: N(X).mode,
@@ -2636,7 +2625,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2636
2625
  "message",
2637
2626
  "mode",
2638
2627
  "surface"
2639
- ])) : o("", !0), N(ue) && N(X) ? (w(), a(kn, {
2628
+ ])) : o("", !0), N(ue) && N(X) ? (w(), a(On, {
2640
2629
  key: 3,
2641
2630
  message: N(X).message,
2642
2631
  mode: N(X).mode,
@@ -2656,7 +2645,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2656
2645
  "leave-from-class": "translate-x-0 opacity-100",
2657
2646
  "leave-to-class": "translate-x-full opacity-0"
2658
2647
  }, {
2659
- default: z(() => [Y.value && U.value ? (w(), s("aside", ar, [c("div", or, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
2648
+ default: z(() => [Y.value && U.value ? (w(), s("aside", ir, [c("div", ar, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
2660
2649
  _: 3
2661
2650
  })], 4),
2662
2651
  u(r, {
@@ -2667,29 +2656,29 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2667
2656
  "leave-from-class": "translate-x-0 opacity-100",
2668
2657
  "leave-to-class": "translate-x-full opacity-0"
2669
2658
  }, {
2670
- default: z(() => [ie.value && U.value ? (w(), s("aside", sr, [c("div", cr, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
2659
+ default: z(() => [ie.value && U.value ? (w(), s("aside", or, [c("div", sr, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
2671
2660
  _: 3
2672
2661
  })
2673
2662
  ]));
2674
2663
  }
2675
- }), fr = 1, pr = .5;
2676
- function mr(e) {
2664
+ }), dr = 1, fr = .5;
2665
+ function pr(e) {
2677
2666
  if (e.type !== "image" && e.type !== "video") return {
2678
- width: fr,
2679
- height: fr,
2667
+ width: dr,
2668
+ height: dr,
2680
2669
  source: "fallback"
2681
2670
  };
2682
2671
  let t = e.preview?.width, n = e.preview?.height;
2683
- if (xr(t) && xr(n)) {
2684
- let r = Sr(e, t, n);
2672
+ if (br(t) && br(n)) {
2673
+ let r = xr(e, t, n);
2685
2674
  return {
2686
2675
  width: r.width,
2687
2676
  height: r.height,
2688
2677
  source: "preview"
2689
2678
  };
2690
2679
  }
2691
- if (xr(e.width) && xr(e.height)) {
2692
- let t = Sr(e, e.width, e.height);
2680
+ if (br(e.width) && br(e.height)) {
2681
+ let t = xr(e, e.width, e.height);
2693
2682
  return {
2694
2683
  width: t.width,
2695
2684
  height: t.height,
@@ -2697,31 +2686,31 @@ function mr(e) {
2697
2686
  };
2698
2687
  }
2699
2688
  return {
2700
- width: fr,
2701
- height: fr,
2689
+ width: dr,
2690
+ height: dr,
2702
2691
  source: "fallback"
2703
2692
  };
2704
2693
  }
2705
- function hr(e, t) {
2694
+ function mr(e, t) {
2706
2695
  return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
2707
2696
  }
2708
- function gr(e, t, n, r = 0) {
2697
+ function hr(e, t, n, r = 0) {
2709
2698
  if (!e || e <= 0 || !t || t <= 0) return n;
2710
2699
  let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
2711
2700
  return !a || a <= 0 ? n : a / t;
2712
2701
  }
2713
- function _r(e, t) {
2714
- let n = mr(e);
2702
+ function gr(e, t) {
2703
+ let n = pr(e);
2715
2704
  return n.height / n.width * t;
2716
2705
  }
2717
- function vr(e, t) {
2706
+ function _r(e, t) {
2718
2707
  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;
2719
2708
  for (let c = 0; c < e.length; c += 1) {
2720
2709
  let l = e[c];
2721
2710
  o.set($(l), c);
2722
2711
  let u = 0;
2723
2712
  for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
2724
- let d = u * (t.columnWidth + t.gapX), f = n[u], p = _r(l, t.columnWidth);
2713
+ let d = u * (t.columnWidth + t.gapX), f = n[u], p = gr(l, t.columnWidth);
2725
2714
  r[c] = {
2726
2715
  x: d,
2727
2716
  y: f
@@ -2740,7 +2729,7 @@ function vr(e, t) {
2740
2729
  indexById: o
2741
2730
  };
2742
2731
  }
2743
- function yr(e) {
2732
+ function vr(e) {
2744
2733
  if (e.itemCount <= 0) return [];
2745
2734
  if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
2746
2735
  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();
@@ -2750,7 +2739,7 @@ function yr(e) {
2750
2739
  }
2751
2740
  return Array.from(a).sort((e, t) => e - t);
2752
2741
  }
2753
- function br(e, t, n) {
2742
+ function yr(e, t, n) {
2754
2743
  let r = /* @__PURE__ */ new Map();
2755
2744
  for (let i of e) {
2756
2745
  let e = t.get($(i));
@@ -2760,11 +2749,11 @@ function br(e, t, n) {
2760
2749
  }
2761
2750
  return r;
2762
2751
  }
2763
- function xr(e) {
2752
+ function br(e) {
2764
2753
  return typeof e == "number" && Number.isFinite(e) && e > 0;
2765
2754
  }
2766
- function Sr(e, t, n) {
2767
- return e.type !== "image" || n / t >= pr ? {
2755
+ function xr(e, t, n) {
2756
+ return e.type !== "image" || n / t >= fr ? {
2768
2757
  width: t,
2769
2758
  height: n
2770
2759
  } : {
@@ -2774,21 +2763,21 @@ function Sr(e, t, n) {
2774
2763
  }
2775
2764
  //#endregion
2776
2765
  //#region src/components/viewer-core/useMasonryMotion.ts
2777
- var Cr = 300, wr = 600, Tr = 40, Er = 300, Dr = 400;
2778
- function Or(e, t) {
2766
+ var Sr = 300, Cr = 600, wr = 40, Tr = 300, Er = 400;
2767
+ function Dr(e, t) {
2779
2768
  return t === "top" ? [...e].reverse() : e;
2780
2769
  }
2781
- function kr(e) {
2782
- return e <= 0 ? wr : wr + Math.min((e - 1) * Tr, Dr);
2770
+ function Or(e) {
2771
+ return e <= 0 ? Cr : Cr + Math.min((e - 1) * wr, Er);
2783
2772
  }
2784
- function Ar() {
2785
- return Er;
2773
+ function kr() {
2774
+ return Tr;
2786
2775
  }
2787
- function jr(e) {
2776
+ function Ar(e) {
2788
2777
  let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
2789
2778
  return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
2790
2779
  }
2791
- function Mr(e) {
2780
+ function jr(e) {
2792
2781
  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()));
2793
2782
  L(e.visibleIndices, (i) => {
2794
2783
  if (!i.length) return;
@@ -2798,20 +2787,20 @@ function Mr(e) {
2798
2787
  !r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
2799
2788
  }
2800
2789
  if (!o.length) return;
2801
- let s = Or(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2802
- for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Tr, Dr));
2803
- r.value = c, Nr(() => {
2790
+ let s = Dr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2791
+ for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * wr, Er));
2792
+ r.value = c, Mr(() => {
2804
2793
  let e = new Set(n.value);
2805
2794
  for (let t of o) e.add(t);
2806
2795
  n.value = e;
2807
- }), Pr(() => {
2796
+ }), Nr(() => {
2808
2797
  let e = new Set(t.value);
2809
2798
  for (let t of o) e.delete(t);
2810
2799
  t.value = e, S(() => {
2811
2800
  let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
2812
2801
  for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
2813
2802
  n.value = e, r.value = t, a.value = i;
2814
- }, kr(o.length));
2803
+ }, Or(o.length));
2815
2804
  });
2816
2805
  }, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
2817
2806
  if (!e.length || !o.value.size) return;
@@ -2838,7 +2827,7 @@ function Mr(e) {
2838
2827
  let e = $(t.item);
2839
2828
  p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
2840
2829
  }
2841
- o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Nr(() => {
2830
+ o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Mr(() => {
2842
2831
  let e = new Set(s.value);
2843
2832
  for (let t of p) e.add(t);
2844
2833
  s.value = e;
@@ -2846,9 +2835,9 @@ function Mr(e) {
2846
2835
  let e = new Map(o.value), t = new Set(s.value);
2847
2836
  for (let n of p) e.delete(n), t.delete(n);
2848
2837
  o.value = e, s.value = t;
2849
- }, Er);
2838
+ }, Tr);
2850
2839
  }
2851
- function g(t, n, r = Cr) {
2840
+ function g(t, n, r = Sr) {
2852
2841
  if (!t.size) return;
2853
2842
  let i = /* @__PURE__ */ new Map(), a = [];
2854
2843
  for (let [r, o] of t.entries()) {
@@ -2867,8 +2856,8 @@ function Mr(e) {
2867
2856
  c.value = i, u.value = /* @__PURE__ */ new Set();
2868
2857
  let o = new Map(l.value);
2869
2858
  for (let e of a) o.set(e, r);
2870
- l.value = o, Nr(() => {
2871
- u.value = new Set(a), Nr(() => {
2859
+ l.value = o, Mr(() => {
2860
+ u.value = new Set(a), Mr(() => {
2872
2861
  c.value = /* @__PURE__ */ new Map();
2873
2862
  });
2874
2863
  }), S(() => {
@@ -2879,8 +2868,8 @@ function Mr(e) {
2879
2868
  }, r);
2880
2869
  }
2881
2870
  function _(e) {
2882
- if (n.value.has(e)) return `transform ${wr}ms ease-out`;
2883
- if (u.value.has(e)) return `transform ${l.value.get(e) ?? Cr}ms ease-out`;
2871
+ if (n.value.has(e)) return `transform ${Cr}ms ease-out`;
2872
+ if (u.value.has(e)) return `transform ${l.value.get(e) ?? Sr}ms ease-out`;
2884
2873
  }
2885
2874
  function v(e) {
2886
2875
  if (!n.value.has(e)) return;
@@ -2897,7 +2886,7 @@ function Mr(e) {
2897
2886
  } : {
2898
2887
  dx: 0,
2899
2888
  dy: 0
2900
- }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? jr({
2889
+ }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Ar({
2901
2890
  columnWidth: e.columnWidth.value,
2902
2891
  direction: u,
2903
2892
  itemHeight: o,
@@ -2911,14 +2900,14 @@ function Mr(e) {
2911
2900
  if (!r) return {
2912
2901
  opacity: "0",
2913
2902
  transform: "translate3d(0, 0, 0) scale(0.96)",
2914
- transition: `opacity ${Er}ms ease-out, transform ${Er}ms ease-out`
2903
+ transition: `opacity ${Tr}ms ease-out, transform ${Tr}ms ease-out`
2915
2904
  };
2916
2905
  let i = s.value.has(n);
2917
2906
  return {
2918
2907
  height: `${r.height}px`,
2919
2908
  opacity: i ? "0" : "1",
2920
2909
  transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
2921
- transition: `opacity ${Er}ms ease-out, transform ${Er}ms ease-out`,
2910
+ transition: `opacity ${Tr}ms ease-out, transform ${Tr}ms ease-out`,
2922
2911
  width: `${e.columnWidth.value}px`
2923
2912
  };
2924
2913
  }
@@ -2939,28 +2928,28 @@ function Mr(e) {
2939
2928
  playFlipMoveAnimation: g
2940
2929
  };
2941
2930
  }
2942
- function Nr(e) {
2931
+ function Mr(e) {
2943
2932
  if (typeof requestAnimationFrame == "function") {
2944
2933
  requestAnimationFrame(() => e());
2945
2934
  return;
2946
2935
  }
2947
2936
  setTimeout(e, 0);
2948
2937
  }
2949
- function Pr(e) {
2950
- Nr(() => Nr(e));
2938
+ function Nr(e) {
2939
+ Mr(() => Mr(e));
2951
2940
  }
2952
2941
  //#endregion
2953
2942
  //#region src/components/viewer-core/masonryViewport.ts
2954
- function Fr(e, t) {
2943
+ function Pr(e, t) {
2955
2944
  return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
2956
2945
  }
2957
- function Ir(e, t, n) {
2946
+ function Fr(e, t, n) {
2958
2947
  return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
2959
2948
  }
2960
- function Lr(e, t, n, r) {
2949
+ function Ir(e, t, n, r) {
2961
2950
  return (e?.scrollHeight ?? r) - (t + n);
2962
2951
  }
2963
- function Rr(e, t) {
2952
+ function Lr(e, t) {
2964
2953
  return {
2965
2954
  height: `${e}px`,
2966
2955
  transform: `translate3d(0, ${t}px, 0)`
@@ -2968,8 +2957,8 @@ function Rr(e, t) {
2968
2957
  }
2969
2958
  //#endregion
2970
2959
  //#region src/components/viewer-core/useEdgeBoundary.ts
2971
- var zr = 250, Br = 1e3;
2972
- function Vr(e) {
2960
+ var Rr = 250, zr = 1e3;
2961
+ function Br(e) {
2973
2962
  let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
2974
2963
  x(() => {
2975
2964
  y();
@@ -2985,7 +2974,7 @@ function Vr(e) {
2985
2974
  function u(t) {
2986
2975
  if (!b(t) || !e.isAtBoundary()) return;
2987
2976
  let n = Date.now();
2988
- n < s || (s = n + zr, m());
2977
+ n < s || (s = n + Rr, m());
2989
2978
  }
2990
2979
  function d() {
2991
2980
  if (!g()) return;
@@ -3019,7 +3008,7 @@ function Vr(e) {
3019
3008
  return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
3020
3009
  }
3021
3010
  function _() {
3022
- o.value = !1, v(Br);
3011
+ o.value = !1, v(zr);
3023
3012
  }
3024
3013
  function v(e) {
3025
3014
  y(), a.value = !0, c = setTimeout(() => {
@@ -3042,42 +3031,42 @@ function Vr(e) {
3042
3031
  }
3043
3032
  //#endregion
3044
3033
  //#region src/components/viewer-core/useMasonryList.ts
3045
- var Hr = 600, Ur = 24, Wr = 16, Gr = 300, Kr = 200, qr = 200, Jr = Ur + Wr, Yr = 200, Xr = 300, Zr = 24, Qr = 48, $r = 500, ei = 1e3;
3046
- function ti(e) {
3047
- let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Gr), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = D(null), p = D(!1), m = i(() => Math.max(Gr, a.value - Ur * 2)), h = i(() => hr(m.value, Gr)), g = i(() => gr(m.value, h.value, Gr, Wr)), v = i(() => ni(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => yr({
3034
+ var Vr = 600, Hr = 24, Ur = 16, Wr = 300, Gr = 200, Kr = 200, qr = Hr + Ur, Jr = 200, Yr = 300, Xr = 24, Zr = 48, Qr = 500, $r = 1e3;
3035
+ function ei(e) {
3036
+ let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Wr), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = D(null), p = D(!1), m = i(() => Math.max(Wr, a.value - Hr * 2)), h = i(() => mr(m.value, Wr)), g = i(() => hr(m.value, h.value, Wr, Ur)), v = i(() => ti(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => vr({
3048
3037
  itemCount: e.items.value.length,
3049
3038
  viewportHeight: r.value,
3050
3039
  scrollTop: n.value,
3051
- overscanPx: Kr,
3052
- bucketPx: Hr,
3040
+ overscanPx: Gr,
3041
+ bucketPx: Vr,
3053
3042
  buckets: c.value
3054
3043
  })), b = i(() => y.value.map((t) => ({
3055
3044
  item: e.items.value[t],
3056
3045
  index: t
3057
3046
  }))), C = i(() => {
3058
- let e = l.value + Ur * 2, t = d.value ?? 0;
3059
- return Math.max(e, t, r.value) + Yr;
3060
- }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => ii({
3047
+ let e = l.value + Hr * 2, t = d.value ?? 0;
3048
+ return Math.max(e, t, r.value) + Jr;
3049
+ }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => ri({
3061
3050
  active: e.active.value,
3062
3051
  maxScrollTop: se(),
3063
3052
  progressDistancePx: n.value,
3064
- thresholdPx: qr,
3053
+ thresholdPx: Kr,
3065
3054
  triggerEnabled: w.value
3066
- })), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ri({
3055
+ })), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ni({
3067
3056
  active: e.active.value,
3068
3057
  maxScrollTop: se(),
3069
3058
  progressDistancePx: n.value,
3070
- thresholdPx: Jr,
3059
+ thresholdPx: qr,
3071
3060
  triggerEnabled: e.hasPreviousPage.value
3072
- })), k = i(() => Math.max(0, r.value - Zr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
3061
+ })), k = i(() => Math.max(0, r.value - Xr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
3073
3062
  if (!A.value) return 0;
3074
3063
  let e = r.value / C.value * k.value;
3075
- return Math.min(k.value, Math.max(Qr, e));
3064
+ return Math.min(k.value, Math.max(Zr, e));
3076
3065
  }), M = i(() => {
3077
- if (!A.value) return Zr;
3066
+ if (!A.value) return Xr;
3078
3067
  let e = Math.max(0, C.value - r.value);
3079
- return Zr + Math.max(0, k.value - j.value) * (e > 0 ? ni(n.value / e, 0, 1) : 0);
3080
- }), N = Mr({
3068
+ return Xr + Math.max(0, k.value - j.value) * (e > 0 ? ti(n.value / e, 0, 1) : 0);
3069
+ }), N = jr({
3081
3070
  items: e.items,
3082
3071
  visibleIndices: y,
3083
3072
  positions: o,
@@ -3086,27 +3075,27 @@ function ti(e) {
3086
3075
  columnWidth: g,
3087
3076
  scrollTop: n,
3088
3077
  viewportHeight: r
3089
- }), P = Vr({
3078
+ }), P = Br({
3090
3079
  direction: "top",
3091
3080
  getAnimationLockMs(e) {
3092
- return Math.max($r, kr(e)) + ei;
3081
+ return Math.max(Qr, Or(e)) + $r;
3093
3082
  },
3094
3083
  hasPage: e.hasPreviousPage,
3095
3084
  interactionLocked: p,
3096
3085
  isAtBoundary() {
3097
- return n.value <= Jr;
3086
+ return n.value <= qr;
3098
3087
  },
3099
3088
  loading: e.loading,
3100
3089
  requestPage: e.requestPreviousPage
3101
- }), F = Vr({
3090
+ }), F = Br({
3102
3091
  direction: "bottom",
3103
3092
  getAnimationLockMs(e) {
3104
- return kr(e) + ei;
3093
+ return Or(e) + $r;
3105
3094
  },
3106
3095
  hasPage: w,
3107
3096
  interactionLocked: p,
3108
3097
  isAtBoundary() {
3109
- return oe() <= qr;
3098
+ return oe() <= Kr;
3110
3099
  },
3111
3100
  loading: e.loading,
3112
3101
  requestPage: e.requestNextPage
@@ -3116,7 +3105,7 @@ function ti(e) {
3116
3105
  h,
3117
3106
  g
3118
3107
  ], async ([t], [r = []]) => {
3119
- let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = br(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) => {
3108
+ let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = yr(a, u.value, o.value), l = X(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
3120
3109
  let t = $(e);
3121
3110
  if (f.has(t)) return [];
3122
3111
  let n = c.get(t), r = l.get(t);
@@ -3125,8 +3114,8 @@ function ti(e) {
3125
3114
  item: e,
3126
3115
  position: n
3127
3116
  }];
3128
- }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > Ur + Wr, b = h && n.value > Ur + Wr ? t[v.value] : null, x = b ? $(b) : null;
3129
- y && K(Ar() + ei), g && G(), te(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : F.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? $r : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
3117
+ }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > Hr + Ur, b = h && n.value > Hr + Ur ? t[v.value] : null, x = b ? $(b) : null;
3118
+ y && K(kr() + $r), g && G(), te(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : F.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? Qr : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
3130
3119
  }, { immediate: !0 }), L([
3131
3120
  () => e.pendingAppendItems.value.map((e) => $(e)),
3132
3121
  h,
@@ -3143,7 +3132,7 @@ function ti(e) {
3143
3132
  }
3144
3133
  if (i !== !1 || f.value == null) return;
3145
3134
  await _();
3146
- let o = Math.max(0, C.value - r.value), s = ni(f.value, 0, o);
3135
+ let o = Math.max(0, C.value - r.value), s = ti(f.value, 0, o);
3147
3136
  a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
3148
3137
  }), L(() => e.loading.value, async (t) => {
3149
3138
  !t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
@@ -3155,16 +3144,16 @@ function ti(e) {
3155
3144
  I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
3156
3145
  });
3157
3146
  function te() {
3158
- let t = vr(e.items.value, {
3147
+ let t = _r(e.items.value, {
3159
3148
  columnCount: h.value,
3160
3149
  columnWidth: g.value,
3161
- gapX: Wr,
3162
- gapY: Wr,
3163
- bucketPx: Hr
3150
+ gapX: Ur,
3151
+ gapY: Ur,
3152
+ bucketPx: Vr
3164
3153
  });
3165
3154
  o.value = t.positions.map((e) => ({
3166
- x: e.x + Ur,
3167
- y: e.y + Ur
3155
+ x: e.x + Hr,
3156
+ y: e.y + Hr
3168
3157
  })), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
3169
3158
  }
3170
3159
  function V() {
@@ -3189,7 +3178,7 @@ function ti(e) {
3189
3178
  let a = t.value, c = o.value[e], l = s.value[e];
3190
3179
  if (!a || !c || !l) return;
3191
3180
  let u = a.scrollTop, d = Math.max(0, C.value - r.value);
3192
- i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Ur : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Ur), a.scrollTop = ni(u, 0, d), n.value = a.scrollTop, q();
3181
+ i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Hr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Hr), a.scrollTop = ti(u, 0, d), n.value = a.scrollTop, q();
3193
3182
  }
3194
3183
  function ne(e, r) {
3195
3184
  let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
@@ -3222,7 +3211,7 @@ function ti(e) {
3222
3211
  e.setActiveIndex(i);
3223
3212
  }
3224
3213
  function re() {
3225
- let t = n.value <= Jr, r = oe() <= qr;
3214
+ let t = n.value <= qr, r = oe() <= Kr;
3226
3215
  return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
3227
3216
  }
3228
3217
  function J() {
@@ -3232,29 +3221,29 @@ function ti(e) {
3232
3221
  r.value = ie(), a.value = ae();
3233
3222
  }
3234
3223
  function ie() {
3235
- return Fr(t.value, r.value);
3224
+ return Pr(t.value, r.value);
3236
3225
  }
3237
3226
  function ae() {
3238
- return Ir(t.value, a.value, Gr);
3227
+ return Fr(t.value, a.value, Wr);
3239
3228
  }
3240
3229
  function oe() {
3241
- return Lr(t.value, n.value, r.value, C.value);
3230
+ return Ir(t.value, n.value, r.value, C.value);
3242
3231
  }
3243
3232
  function se() {
3244
3233
  let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
3245
3234
  return Math.max(0, e - r.value);
3246
3235
  }
3247
3236
  function ce() {
3248
- return Rr(j.value, M.value);
3237
+ return Lr(j.value, M.value);
3249
3238
  }
3250
3239
  function le(e) {
3251
- return e.length ? vr(e, {
3240
+ return e.length ? _r(e, {
3252
3241
  columnCount: h.value,
3253
3242
  columnWidth: g.value,
3254
- gapX: Wr,
3255
- gapY: Wr,
3256
- bucketPx: Hr
3257
- }).contentHeight + Ur * 2 : 0;
3243
+ gapX: Ur,
3244
+ gapY: Ur,
3245
+ bucketPx: Vr
3246
+ }).contentHeight + Hr * 2 : 0;
3258
3247
  }
3259
3248
  function X(e) {
3260
3249
  let t = /* @__PURE__ */ new Map();
@@ -3276,7 +3265,7 @@ function ti(e) {
3276
3265
  } finally {
3277
3266
  d.value = null, ee = !1;
3278
3267
  }
3279
- }, Xr));
3268
+ }, Yr));
3280
3269
  }
3281
3270
  function de() {
3282
3271
  z &&= (clearTimeout(z), null);
@@ -3303,27 +3292,27 @@ function ti(e) {
3303
3292
  scrollViewportRef: t
3304
3293
  };
3305
3294
  }
3306
- function ni(e, t, n) {
3295
+ function ti(e, t, n) {
3307
3296
  return Math.min(Math.max(e, t), n);
3308
3297
  }
3309
- function ri(e) {
3298
+ function ni(e) {
3310
3299
  if (!e.active || !e.triggerEnabled) return 0;
3311
3300
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3312
- return t <= 0 ? 1 : ni(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3301
+ return t <= 0 ? 1 : ti(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3313
3302
  }
3314
- function ii(e) {
3303
+ function ri(e) {
3315
3304
  if (!e.active || !e.triggerEnabled) return 0;
3316
3305
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3317
- return t <= 0 ? 1 : ni(e.progressDistancePx / t, 0, 1);
3306
+ return t <= 0 ? 1 : ti(e.progressDistancePx / t, 0, 1);
3318
3307
  }
3319
3308
  //#endregion
3320
3309
  //#region src/components/viewer-core/listCardAsset.ts
3321
- function ai(e) {
3310
+ function ii(e) {
3322
3311
  if (e) try {
3323
3312
  e.removeAttribute("src"), e.src = "";
3324
3313
  } catch {}
3325
3314
  }
3326
- function oi(e) {
3315
+ function ai(e) {
3327
3316
  if (e) {
3328
3317
  try {
3329
3318
  e.currentTime = 0;
@@ -3334,12 +3323,12 @@ function oi(e) {
3334
3323
  } catch {}
3335
3324
  }
3336
3325
  }
3337
- function si(e, t) {
3326
+ function oi(e, t) {
3338
3327
  if (t) return e.bottom > t.top && e.top < t.bottom;
3339
3328
  let n = window.innerHeight || document.documentElement.clientHeight || 0;
3340
3329
  return e.bottom > 0 && e.top < n;
3341
3330
  }
3342
- function ci(e) {
3331
+ function si(e) {
3343
3332
  if (!e) return null;
3344
3333
  try {
3345
3334
  return new URL(e, window.location.href).href;
@@ -3349,9 +3338,9 @@ function ci(e) {
3349
3338
  }
3350
3339
  //#endregion
3351
3340
  //#region src/components/viewer-core/listPreview.ts
3352
- var li = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, ui = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, di = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
3353
- function fi(e) {
3354
- let t = pi(e), n = t?.url, r = mr(e), i = e.title?.trim() || kt(e.type);
3341
+ var ci = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, li = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, ui = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
3342
+ function di(e) {
3343
+ let t = fi(e), n = t?.url, r = pr(e), i = e.title?.trim() || kt(e.type);
3355
3344
  return t?.mediaType === "video" && typeof n == "string" ? {
3356
3345
  kind: "video",
3357
3346
  url: n,
@@ -3370,13 +3359,13 @@ function fi(e) {
3370
3359
  width: r.width,
3371
3360
  height: r.height,
3372
3361
  label: i
3373
- } : typeof n == "string" && hi(e, n) ? {
3362
+ } : typeof n == "string" && mi(e, n) ? {
3374
3363
  kind: "video",
3375
3364
  url: n,
3376
3365
  width: r.width,
3377
3366
  height: r.height,
3378
3367
  label: i
3379
- } : typeof n == "string" && mi(e, n) ? {
3368
+ } : typeof n == "string" && pi(e, n) ? {
3380
3369
  kind: "image",
3381
3370
  url: n,
3382
3371
  width: r.width,
@@ -3390,26 +3379,26 @@ function fi(e) {
3390
3379
  label: i
3391
3380
  };
3392
3381
  }
3393
- function pi(e) {
3382
+ function fi(e) {
3394
3383
  return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
3395
3384
  }
3396
- function mi(e, t) {
3397
- return e.type !== "image" || typeof t != "string" ? !1 : li.test(t) || gi(t);
3385
+ function pi(e, t) {
3386
+ return e.type !== "image" || typeof t != "string" ? !1 : ci.test(t) || hi(t);
3398
3387
  }
3399
- function hi(e, t) {
3400
- return e.type !== "video" || typeof t != "string" ? !1 : ui.test(t) || _i(t);
3388
+ function mi(e, t) {
3389
+ return e.type !== "video" || typeof t != "string" ? !1 : li.test(t) || gi(t);
3401
3390
  }
3402
- function gi(e) {
3391
+ function hi(e) {
3403
3392
  return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
3404
3393
  }
3405
- function _i(e) {
3406
- return di.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3394
+ function gi(e) {
3395
+ return ui.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3407
3396
  }
3408
3397
  //#endregion
3409
3398
  //#region src/components/viewer-core/useListCardHealthCheck.ts
3410
- function vi(e) {
3399
+ function _i(e) {
3411
3400
  let t = D(null), n = i(() => {
3412
- let t = typeof e.item.value.healthCheck?.url == "string" ? ci(e.item.value.healthCheck.url) : null;
3401
+ let t = typeof e.item.value.healthCheck?.url == "string" ? si(e.item.value.healthCheck.url) : null;
3413
3402
  return !t || t === e.attachedAssetUrl.value ? null : t;
3414
3403
  }), r = null, a = 0, o = /* @__PURE__ */ new Map();
3415
3404
  L(n, (e, n) => {
@@ -3451,7 +3440,7 @@ function vi(e) {
3451
3440
  return;
3452
3441
  }
3453
3442
  let i = ++a;
3454
- ln(r).then((s) => {
3443
+ sn(r).then((s) => {
3455
3444
  if (!(i !== a || n.value !== r)) {
3456
3445
  if (o.set(r, s ?? null), !s) {
3457
3446
  t.value = null;
@@ -3487,14 +3476,14 @@ function vi(e) {
3487
3476
  }
3488
3477
  //#endregion
3489
3478
  //#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
3490
- var yi = ["aria-label"], bi = {
3479
+ var vi = ["aria-label"], yi = {
3491
3480
  key: 0,
3492
3481
  "data-testid": "vibe-list-card-spinner",
3493
3482
  class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
3494
- }, xi = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Si = ["src", "alt"], Ci = ["src"], wi = ["data-kind"], Ti = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ei = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Di = {
3483
+ }, bi = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, xi = ["src", "alt"], Si = ["src"], Ci = ["data-kind"], wi = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ti = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Ei = {
3495
3484
  key: 4,
3496
3485
  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))]"
3497
- }, Oi = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, ki = { class: "pointer-events-none absolute inset-0 z-[3]" }, Ai = /* @__PURE__ */ d({
3486
+ }, Di = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Oi = { class: "pointer-events-none absolute inset-0 z-[3]" }, ki = /* @__PURE__ */ d({
3498
3487
  __name: "ListCard",
3499
3488
  props: {
3500
3489
  active: {
@@ -3518,7 +3507,7 @@ var yi = ["aria-label"], bi = {
3518
3507
  },
3519
3508
  emits: ["open"],
3520
3509
  setup(e, { emit: t }) {
3521
- let n = e, r = t, l = i(() => fi(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = vi({
3510
+ let n = e, r = t, l = i(() => di(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = _i({
3522
3511
  attachedAssetUrl: E,
3523
3512
  getPriority: X,
3524
3513
  isInView: d,
@@ -3527,7 +3516,7 @@ var yi = ["aria-label"], bi = {
3527
3516
  loadErrorKind: g,
3528
3517
  reportAssetError: n.reportAssetError,
3529
3518
  surfaceActive: i(() => n.surfaceActive)
3530
- }), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => sn(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
3519
+ }), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => an(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
3531
3520
  L([E, () => l.value.kind], () => {
3532
3521
  let e = l.value.kind === "fallback";
3533
3522
  m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
@@ -3568,7 +3557,7 @@ var yi = ["aria-label"], bi = {
3568
3557
  if (!ue(_.value)) return;
3569
3558
  let e = E.value ?? n.item.url;
3570
3559
  m.value = !1, g.value = "generic";
3571
- let t = await cn(e);
3560
+ let t = await on(e);
3572
3561
  g.value = t, n.reportAssetError?.({
3573
3562
  item: n.item,
3574
3563
  occurrenceKey: $(n.item),
@@ -3617,7 +3606,7 @@ var yi = ["aria-label"], bi = {
3617
3606
  return;
3618
3607
  }
3619
3608
  if (E.value && d.value && m.value) {
3620
- e.muted = !0, e.loop = !0, e.playsInline = !0, fn(e);
3609
+ e.muted = !0, e.loop = !0, e.playsInline = !0, un(e);
3621
3610
  return;
3622
3611
  }
3623
3612
  try {
@@ -3638,7 +3627,7 @@ var yi = ["aria-label"], bi = {
3638
3627
  d.value = !0;
3639
3628
  return;
3640
3629
  }
3641
- d.value = si(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
3630
+ d.value = oi(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
3642
3631
  }
3643
3632
  function ie(e) {
3644
3633
  if (!e) return;
@@ -3658,10 +3647,10 @@ var yi = ["aria-label"], bi = {
3658
3647
  }), g.value = null, m.value = !1, T.value = !1, J(), K();
3659
3648
  }
3660
3649
  function se() {
3661
- ai(_.value);
3650
+ ii(_.value);
3662
3651
  }
3663
3652
  function ce() {
3664
- oi(C.value);
3653
+ ai(C.value);
3665
3654
  }
3666
3655
  function X() {
3667
3656
  let e = y.value;
@@ -3675,8 +3664,8 @@ var yi = ["aria-label"], bi = {
3675
3664
  return Math.abs((t.top + t.bottom) / 2 - n);
3676
3665
  }
3677
3666
  function ue(e) {
3678
- let t = ci(E.value);
3679
- return !e || !t ? !1 : ci("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3667
+ let t = si(E.value);
3668
+ return !e || !t ? !1 : si("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3680
3669
  }
3681
3670
  function de() {
3682
3671
  r("open");
@@ -3704,8 +3693,8 @@ var yi = ["aria-label"], bi = {
3704
3693
  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]",
3705
3694
  "aria-label": n.item.title || `Open item ${n.index + 1}`,
3706
3695
  onClick: de
3707
- }, null, 8, yi),
3708
- B.value ? (w(), s("div", bi, [c("span", xi, [u(N(oe), {
3696
+ }, null, 8, vi),
3697
+ B.value ? (w(), s("div", yi, [c("span", bi, [u(N(oe), {
3709
3698
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
3710
3699
  "aria-hidden": "true"
3711
3700
  })])])) : o("", !0),
@@ -3719,7 +3708,7 @@ var yi = ["aria-label"], bi = {
3719
3708
  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"]),
3720
3709
  onLoad: U,
3721
3710
  onError: W
3722
- }, null, 42, Si)) : P.value && E.value && !R.value ? (w(), s("video", {
3711
+ }, null, 42, xi)) : P.value && E.value && !R.value ? (w(), s("video", {
3723
3712
  key: 2,
3724
3713
  ref_key: "videoRef",
3725
3714
  ref: C,
@@ -3735,31 +3724,31 @@ var yi = ["aria-label"], bi = {
3735
3724
  onPlaying: ne,
3736
3725
  onStalled: G,
3737
3726
  onWaiting: G
3738
- }, null, 42, Ci)) : R.value ? (w(), s("div", {
3727
+ }, null, 42, Si)) : R.value ? (w(), s("div", {
3739
3728
  key: 3,
3740
3729
  "data-testid": "vibe-list-card-error",
3741
3730
  "data-kind": I.value,
3742
3731
  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))]"
3743
- }, [c("div", Ti, [
3732
+ }, [c("div", wi, [
3744
3733
  u(N(le), {
3745
3734
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3746
3735
  "aria-hidden": "true"
3747
3736
  }),
3748
- c("span", Ei, j(N(on)(I.value)), 1),
3737
+ c("span", Ti, j(N(rn)(I.value)), 1),
3749
3738
  z.value ? (w(), s("button", {
3750
3739
  key: 0,
3751
3740
  type: "button",
3752
3741
  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",
3753
3742
  onClick: ee(ae, ["stop"])
3754
3743
  }, " Retry ")) : o("", !0)
3755
- ])], 8, wi)) : (w(), s("div", Di, [c("div", Oi, [k(e.$slots, "item-icon", {
3744
+ ])], 8, Ci)) : (w(), s("div", Ei, [c("div", Di, [k(e.$slots, "item-icon", {
3756
3745
  icon: N(Ot)(n.item.type),
3757
3746
  item: n.item
3758
3747
  }, () => [(w(), a(A(N(Ot)(n.item.type)), {
3759
3748
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3760
3749
  "aria-hidden": "true"
3761
3750
  }))])])])),
3762
- c("div", ki, [k(e.$slots, "grid-item-overlay", {
3751
+ c("div", Oi, [k(e.$slots, "grid-item-overlay", {
3763
3752
  active: n.active,
3764
3753
  focused: f.value,
3765
3754
  hovered: p.value,
@@ -3769,24 +3758,24 @@ var yi = ["aria-label"], bi = {
3769
3758
  })])
3770
3759
  ], 34));
3771
3760
  }
3772
- }), ji = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, Mi = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Ni = {
3761
+ }), Ai = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, ji = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Mi = {
3773
3762
  "data-testid": "vibe-pagination",
3774
3763
  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]"
3775
- }, Pi = { class: "whitespace-nowrap" }, Fi = {
3764
+ }, Ni = { class: "whitespace-nowrap" }, Pi = {
3776
3765
  key: 0,
3777
3766
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
3778
- }, Ii = [
3767
+ }, Fi = [
3779
3768
  "data-active",
3780
3769
  "data-index",
3781
3770
  "data-item-id",
3782
3771
  "data-occurrence-key"
3783
- ], Li = ["data-item-id"], Ri = {
3772
+ ], Ii = ["data-item-id"], Li = {
3784
3773
  key: 0,
3785
3774
  class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
3786
- }, zi = {
3775
+ }, Ri = {
3787
3776
  key: 1,
3788
3777
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
3789
- }, Bi = { class: "mx-auto flex w-full justify-center" }, Vi = /* @__PURE__ */ d({
3778
+ }, zi = { class: "mx-auto flex w-full justify-center" }, Bi = /* @__PURE__ */ d({
3790
3779
  __name: "ListSurface",
3791
3780
  props: {
3792
3781
  active: {
@@ -3847,7 +3836,7 @@ var yi = ["aria-label"], bi = {
3847
3836
  "update:activeIndex"
3848
3837
  ],
3849
3838
  setup(e, { emit: n }) {
3850
- let r = e, d = F(), f = n, p = ti({
3839
+ let r = e, d = F(), f = n, p = ei({
3851
3840
  active: M(r, "active"),
3852
3841
  allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
3853
3842
  items: M(r, "items"),
@@ -3863,11 +3852,11 @@ var yi = ["aria-label"], bi = {
3863
3852
  setActiveIndex(e) {
3864
3853
  f("update:activeIndex", e);
3865
3854
  }
3866
- }), m = i(() => Xt({
3855
+ }), m = i(() => Jt({
3867
3856
  itemCount: r.items.length,
3868
3857
  loading: r.loading,
3869
3858
  phase: r.phase
3870
- })), h = i(() => Zt({
3859
+ })), h = i(() => Yt({
3871
3860
  errorMessage: r.errorMessage,
3872
3861
  hasItems: r.items.length > 0,
3873
3862
  hasNextPage: r.hasNextPage,
@@ -3880,7 +3869,7 @@ var yi = ["aria-label"], bi = {
3880
3869
  message: h.value.message,
3881
3870
  paginationDetail: r.paginationDetail,
3882
3871
  total: r.items.length
3883
- }), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => Gt(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Jt({
3872
+ }), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => Ut(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Kt({
3884
3873
  emptyStateMode: M(r, "emptyStateMode"),
3885
3874
  itemCount: C,
3886
3875
  loading: M(r, "loading"),
@@ -3892,8 +3881,8 @@ var yi = ["aria-label"], bi = {
3892
3881
  nextBoundaryLoadProgress: e,
3893
3882
  previousBoundaryLoadProgress: t
3894
3883
  });
3895
- }, { immediate: !0 }), (e, n) => (w(), s("div", ji, [
3896
- c("div", Mi, [c("span", Ni, [c("span", Pi, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Fi, j(r.paginationDetail), 1)) : o("", !0)])]),
3884
+ }, { immediate: !0 }), (e, n) => (w(), s("div", Ai, [
3885
+ c("div", ji, [c("span", Mi, [c("span", Ni, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Pi, j(r.paginationDetail), 1)) : o("", !0)])]),
3897
3886
  c("div", {
3898
3887
  ref: N(p).scrollViewportRef,
3899
3888
  "data-testid": "vibe-list-scroll",
@@ -3914,7 +3903,7 @@ var yi = ["aria-label"], bi = {
3914
3903
  "data-occurrence-key": N($)(t),
3915
3904
  class: "absolute will-change-transform",
3916
3905
  style: b(N(p).getCardStyle(n))
3917
- }, [u(Ai, {
3906
+ }, [u(ki, {
3918
3907
  active: n === N(p).resolvedActiveIndex.value,
3919
3908
  index: n,
3920
3909
  item: t,
@@ -3938,14 +3927,14 @@ var yi = ["aria-label"], bi = {
3938
3927
  "report-asset-load",
3939
3928
  "surface-active",
3940
3929
  "onOpen"
3941
- ])], 12, Ii))), 128)),
3930
+ ])], 12, Fi))), 128)),
3942
3931
  (w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
3943
3932
  key: `leaving-${N($)(t.item)}`,
3944
3933
  "data-testid": "vibe-list-card-leaving",
3945
3934
  "data-item-id": t.item.id,
3946
3935
  class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
3947
3936
  style: b(N(p).getLeavingCardStyle(t.item))
3948
- }, [u(Ai, {
3937
+ }, [u(ki, {
3949
3938
  active: !1,
3950
3939
  index: -1,
3951
3940
  item: t.item,
@@ -3960,8 +3949,8 @@ var yi = ["aria-label"], bi = {
3960
3949
  "item",
3961
3950
  "report-asset-error",
3962
3951
  "report-asset-load"
3963
- ])], 12, Li))), 128)),
3964
- N(A) && N(T) ? (w(), a(kn, {
3952
+ ])], 12, Ii))), 128)),
3953
+ N(A) && N(T) ? (w(), a(On, {
3965
3954
  key: 0,
3966
3955
  message: N(T).message,
3967
3956
  mode: N(T).mode,
@@ -3975,12 +3964,12 @@ var yi = ["aria-label"], bi = {
3975
3964
  "surface"
3976
3965
  ])) : o("", !0)
3977
3966
  ], 4)], 544),
3978
- N(p).showScrollbar.value ? (w(), s("div", Ri, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3967
+ N(p).showScrollbar.value ? (w(), s("div", Li, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3979
3968
  "data-testid": "vibe-list-scrollbar-thumb",
3980
3969
  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"]),
3981
3970
  style: b(N(p).getScrollbarThumbStyle())
3982
3971
  }, null, 6)])) : o("", !0),
3983
- d["grid-footer"] ? (w(), s("div", zi, [c("div", Bi, [k(e.$slots, "grid-footer")])])) : o("", !0),
3972
+ d["grid-footer"] ? (w(), s("div", Ri, [c("div", zi, [k(e.$slots, "grid-footer")])])) : o("", !0),
3984
3973
  _.value ? (w(), s("div", {
3985
3974
  key: 2,
3986
3975
  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"])
@@ -3989,7 +3978,7 @@ var yi = ["aria-label"], bi = {
3989
3978
  "data-testid": "vibe-grid-status-badge",
3990
3979
  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" : ""])
3991
3980
  }, j(_.value.message), 3))], 2)) : o("", !0),
3992
- N(E) && N(T) ? (w(), a(kn, {
3981
+ N(E) && N(T) ? (w(), a(On, {
3993
3982
  key: 3,
3994
3983
  class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
3995
3984
  message: N(T).message,
@@ -4006,13 +3995,13 @@ var yi = ["aria-label"], bi = {
4006
3995
  ])) : o("", !0)
4007
3996
  ]));
4008
3997
  }
4009
- }), Hi = ["data-surface-mode"], Ui = {
3998
+ }), Vi = ["data-surface-mode"], Hi = {
4010
3999
  key: 1,
4011
4000
  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"
4012
- }, Wi = ["data-visible", "inert"], Gi = ["data-visible", "inert"], Ki = {
4001
+ }, Ui = ["data-visible", "inert"], Wi = ["data-visible", "inert"], Gi = {
4013
4002
  key: 3,
4014
4003
  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"
4015
- }, qi = /* @__PURE__ */ d({
4004
+ }, Ki = /* @__PURE__ */ d({
4016
4005
  name: "VibeLayout",
4017
4006
  __name: "Layout",
4018
4007
  props: {
@@ -4066,7 +4055,7 @@ var yi = ["aria-label"], bi = {
4066
4055
  type: "button",
4067
4056
  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",
4068
4057
  onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
4069
- }, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Ui, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
4058
+ }, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Hi, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
4070
4059
  appear: "",
4071
4060
  "enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
4072
4061
  "enter-from-class": "translate-y-3 opacity-0",
@@ -4080,7 +4069,7 @@ var yi = ["aria-label"], bi = {
4080
4069
  "data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
4081
4070
  inert: N(h).surfaceMode.value !== "list",
4082
4071
  class: "absolute inset-0 z-[2]"
4083
- }, [u(Vi, {
4072
+ }, [u(Bi, {
4084
4073
  active: N(h).surfaceMode.value === "list",
4085
4074
  "allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
4086
4075
  items: N(h).items.value,
@@ -4150,7 +4139,7 @@ var yi = ["aria-label"], bi = {
4150
4139
  "onBoundaryLoadProgress",
4151
4140
  "onOpenFullscreen",
4152
4141
  "onUpdate:activeIndex"
4153
- ])], 8, Wi), [[I, N(h).surfaceMode.value === "list"]])]),
4142
+ ])], 8, Ui), [[I, N(h).surfaceMode.value === "list"]])]),
4154
4143
  _: 3
4155
4144
  }), u(r, {
4156
4145
  appear: "",
@@ -4166,7 +4155,7 @@ var yi = ["aria-label"], bi = {
4166
4155
  "data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
4167
4156
  inert: N(h).surfaceMode.value !== "fullscreen",
4168
4157
  class: "absolute inset-0 z-[3]"
4169
- }, [u(dr, {
4158
+ }, [u(ur, {
4170
4159
  items: N(h).items.value,
4171
4160
  active: N(h).surfaceMode.value === "fullscreen",
4172
4161
  "active-index": N(h).activeIndex.value,
@@ -4235,12 +4224,12 @@ var yi = ["aria-label"], bi = {
4235
4224
  "show-back-to-list",
4236
4225
  "onBackToList",
4237
4226
  "onUpdate:activeIndex"
4238
- ])], 8, Gi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
4227
+ ])], 8, Wi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
4239
4228
  _: 3
4240
- })], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Ki, [u(N(oe), {
4229
+ })], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Gi, [u(N(oe), {
4241
4230
  class: "size-10 animate-spin text-[#f7f1ea]/82",
4242
4231
  "aria-hidden": "true"
4243
- }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(dr, {
4232
+ }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(ur, {
4244
4233
  key: 4,
4245
4234
  items: N(h).items.value,
4246
4235
  active: !0,
@@ -4308,10 +4297,10 @@ var yi = ["aria-label"], bi = {
4308
4297
  "show-status-badges",
4309
4298
  "onBackToList",
4310
4299
  "onUpdate:activeIndex"
4311
- ]))], 8, Hi));
4300
+ ]))], 8, Vi));
4312
4301
  }
4313
- }), Ji = { install(e) {
4314
- e.component("VibeLayout", qi);
4302
+ }), qi = { install(e) {
4303
+ e.component("VibeLayout", Ki);
4315
4304
  } };
4316
4305
  //#endregion
4317
- export { qi as VibeLayout, Ji as VibePlugin, Ji as default };
4306
+ export { Ki as VibeLayout, qi as VibePlugin, qi as default };