@wyxos/vibe 3.1.11 → 3.1.12

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: Pt(e.url),
1198
+ domain: Ft(e.url),
1199
1199
  enqueuedAt: r,
1200
1200
  id: `vibe-asset-load-${r += 1}`
1201
1201
  };
@@ -1230,6 +1230,7 @@ function jt(e = At) {
1230
1230
  }
1231
1231
  }
1232
1232
  function o(n) {
1233
+ if (!Pt(n)) return !1;
1233
1234
  let r = [...t.values()].filter((e) => e.domain === n.domain);
1234
1235
  return !(r.length >= e.maxPerDomain || n.assetType === "video" && r.filter((e) => e.assetType === "video").length >= e.maxVideoPerDomain);
1235
1236
  }
@@ -1245,6 +1246,13 @@ function Nt(e) {
1245
1246
  }
1246
1247
  }
1247
1248
  function Pt(e) {
1249
+ try {
1250
+ return e.canGrant?.() ?? !0;
1251
+ } catch {
1252
+ return !1;
1253
+ }
1254
+ }
1255
+ function Ft(e) {
1248
1256
  try {
1249
1257
  return new URL(e).hostname || "local";
1250
1258
  } catch {
@@ -1253,73 +1261,81 @@ function Pt(e) {
1253
1261
  }
1254
1262
  //#endregion
1255
1263
  //#region src/components/viewer-core/useFullscreenPreloadController.ts
1256
- var Ft = 2, It = {
1264
+ var It = [
1265
+ -1,
1266
+ 1,
1267
+ 2
1268
+ ], Lt = [-1, 1], Rt = {
1269
+ [-1]: 0,
1257
1270
  1: 0,
1258
- 2: 1,
1259
- 3: 2,
1260
- [-1]: 3
1271
+ 2: 1
1261
1272
  };
1262
- function Lt(e) {
1273
+ function zt(e) {
1263
1274
  let t = D({}), n = jt({
1264
- maxGlobal: 1,
1265
- maxPerDomain: 1,
1266
- maxVideoPerDomain: 1
1267
- }), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
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();
1268
1279
  L([
1269
1280
  e.active,
1270
1281
  e.items,
1271
1282
  e.resolvedActiveIndex
1272
1283
  ], () => {
1273
- p();
1284
+ m();
1274
1285
  }, { immediate: !0 }), f() && C(() => {
1275
- d();
1286
+ p();
1276
1287
  });
1277
- function s(n) {
1288
+ function c(n) {
1278
1289
  if (!e.active.value) return !1;
1279
1290
  let r = e.items.value[n];
1280
- if (!r || !Vt(r)) return !1;
1291
+ if (!r || !Ut(r)) return !1;
1281
1292
  let i = e.getItemKey(r);
1282
- return i === h() || !!t.value[i];
1293
+ return i === g() || !!t.value[i];
1283
1294
  }
1284
- function c(e, t) {
1295
+ function l(e, t) {
1285
1296
  if (t instanceof HTMLImageElement) {
1286
- i.set(e, t), zt(t) && u(e);
1297
+ i.set(e, t), Vt(t) && b(e);
1287
1298
  return;
1288
1299
  }
1289
1300
  i.delete(e);
1290
1301
  }
1291
- function l(e, t) {
1302
+ function u(e, t) {
1292
1303
  if (t instanceof HTMLMediaElement) {
1293
- a.set(e, t), Bt(t) && u(e);
1304
+ a.set(e, t), Ht(t) && b(e);
1294
1305
  return;
1295
1306
  }
1296
1307
  a.delete(e);
1297
1308
  }
1298
- function u(e) {
1309
+ function d(e) {
1310
+ o.add(e);
1299
1311
  let t = r.get(e);
1300
- t && (t.lease.release(), r.delete(e));
1312
+ if (!t) {
1313
+ x();
1314
+ return;
1315
+ }
1316
+ t.lease.release(), r.delete(e);
1301
1317
  }
1302
- function d() {
1318
+ function p() {
1303
1319
  for (let e of r.values()) e.lease.release();
1304
- r.clear(), t.value = {}, _();
1320
+ r.clear(), t.value = {}, S();
1305
1321
  }
1306
- function p() {
1322
+ function m() {
1307
1323
  if (!e.active.value) {
1308
- d();
1324
+ p();
1309
1325
  return;
1310
1326
  }
1311
- let s = m(), c = new Set(s.map((e) => e.key)), l = h();
1312
- for (let e of o) e !== l && c.has(e) && v(e, !0);
1313
- for (let e of Object.keys(t.value)) c.has(e) || v(e, !1);
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);
1314
1330
  for (let [e, t] of r.entries()) {
1315
1331
  if (!c.has(e)) {
1316
1332
  t.lease.release(), r.delete(e);
1317
1333
  continue;
1318
1334
  }
1319
- let n = s.find((t) => t.key === e);
1335
+ let n = o.find((t) => t.key === e);
1320
1336
  n && (t.index = n.index);
1321
1337
  }
1322
- for (let e of s) {
1338
+ for (let e of o) {
1323
1339
  if (r.has(e.key) || t.value[e.key]) continue;
1324
1340
  let o;
1325
1341
  o = {
@@ -1327,55 +1343,57 @@ function Lt(e) {
1327
1343
  key: e.key,
1328
1344
  lease: n.request({
1329
1345
  assetType: e.item.type === "image" ? "image" : "video",
1330
- getPriority: () => g(o.index),
1346
+ canGrant: () => v(o.index),
1347
+ getPriority: () => _(o.index),
1331
1348
  onGrant: () => {
1332
- v(e.key, !0), Rt(e.key, i, a) && u(e.key);
1349
+ w(e.key, !0), Bt(e.key, i, a) && d(e.key);
1333
1350
  },
1334
1351
  url: e.item.url
1335
1352
  })
1336
1353
  }, r.set(e.key, o);
1337
1354
  }
1338
1355
  for (let e of r.values()) e.lease.refresh();
1339
- _();
1340
- }
1341
- function m() {
1342
- let n = e.resolvedActiveIndex.value, i = e.items.value.map((t, n) => Vt(t) ? {
1343
- index: n,
1344
- item: t,
1345
- key: e.getItemKey(t)
1346
- } : null).filter((e) => !!e), a = new Map(i.map((e) => [e.key, e])), o = /* @__PURE__ */ new Set(), s = [], c = (e) => {
1347
- !e || o.has(e.key) || (o.add(e.key), s.push(e));
1348
- }, l = /* @__PURE__ */ new Map();
1349
- for (let e of Object.keys(t.value)) {
1350
- let t = a.get(e);
1351
- t && t.index > n && l.set(e, t);
1352
- }
1353
- for (let e of r.values()) {
1354
- if (e.index <= n) continue;
1355
- let t = a.get(e.key);
1356
- t && l.set(e.key, t);
1357
- }
1358
- let u = [...l.values()].sort((e, t) => e.index - t.index);
1359
- for (let e of u) c(e);
1360
- let d = u.reduce((e, t) => Math.max(e, t.index), n), f = 0;
1361
- for (let e of i) if (!(e.index <= d || o.has(e.key)) && (c(e), f += 1, f >= Ft)) break;
1362
- return c(i.find((e) => e.index === n - 1)), s;
1356
+ S();
1363
1357
  }
1364
1358
  function h() {
1359
+ let t = e.resolvedActiveIndex.value;
1360
+ return It.map((e) => y(t + e)).filter((e) => !!e);
1361
+ }
1362
+ function g() {
1365
1363
  let t = e.items.value[e.resolvedActiveIndex.value];
1366
- return !e.active.value || !t || !Vt(t) ? null : e.getItemKey(t);
1364
+ return !e.active.value || !t || !Ut(t) ? null : e.getItemKey(t);
1365
+ }
1366
+ 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
+ let n = e.items.value[t];
1377
+ return !n || !Ut(n) ? null : {
1378
+ index: t,
1379
+ item: n,
1380
+ key: e.getItemKey(n)
1381
+ };
1382
+ }
1383
+ function b(e) {
1384
+ d(e);
1367
1385
  }
1368
- function g(t) {
1369
- return e.active.value ? It[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
1386
+ function x() {
1387
+ for (let e of r.values()) e.lease.refresh();
1370
1388
  }
1371
- function _() {
1372
- let n = /* @__PURE__ */ new Set(), r = h();
1389
+ function S() {
1390
+ let n = /* @__PURE__ */ new Set(), r = g();
1373
1391
  r && n.add(r);
1374
1392
  for (let e of Object.keys(t.value)) n.add(e);
1375
- for (let t of o) n.has(t) || (y(t), e.onResetAssetState(t));
1376
- o = n;
1393
+ for (let t of s) n.has(t) || (o.delete(t), T(t), e.onResetAssetState(t));
1394
+ s = n;
1377
1395
  }
1378
- function v(e, n) {
1396
+ function w(e, n) {
1379
1397
  if (n) {
1380
1398
  if (t.value[e]) return;
1381
1399
  t.value = {
@@ -1388,7 +1406,7 @@ function Lt(e) {
1388
1406
  let r = { ...t.value };
1389
1407
  delete r[e], t.value = r;
1390
1408
  }
1391
- function y(e) {
1409
+ function T(e) {
1392
1410
  let t = i.get(e);
1393
1411
  if (t) try {
1394
1412
  t.removeAttribute("src"), t.src = "";
@@ -1405,33 +1423,33 @@ function Lt(e) {
1405
1423
  }
1406
1424
  }
1407
1425
  return {
1408
- clearBackgroundPreloads: d,
1409
- registerImageElement: c,
1410
- registerMediaElement: l,
1411
- settleBackgroundPreload: u,
1412
- shouldAttachSlideAsset: s
1426
+ clearBackgroundPreloads: p,
1427
+ registerImageElement: l,
1428
+ registerMediaElement: u,
1429
+ settleBackgroundPreload: d,
1430
+ shouldAttachSlideAsset: c
1413
1431
  };
1414
1432
  }
1415
- function Rt(e, t, n) {
1433
+ function Bt(e, t, n) {
1416
1434
  let r = t.get(e);
1417
- if (r) return zt(r);
1435
+ if (r) return Vt(r);
1418
1436
  let i = n.get(e);
1419
- return i ? Bt(i) : !1;
1437
+ return i ? Ht(i) : !1;
1420
1438
  }
1421
- function zt(e) {
1439
+ function Vt(e) {
1422
1440
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
1423
1441
  }
1424
- function Bt(e) {
1442
+ function Ht(e) {
1425
1443
  let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
1426
1444
  return e.readyState >= t;
1427
1445
  }
1428
- function Vt(e) {
1446
+ function Ut(e) {
1429
1447
  return e.type === "image" || e.type === "video" || e.type === "audio";
1430
1448
  }
1431
1449
  //#endregion
1432
1450
  //#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
1433
- function Ht(e) {
1434
- let t = Lt({
1451
+ function Wt(e) {
1452
+ let t = zt({
1435
1453
  active: e.active,
1436
1454
  getItemKey: r,
1437
1455
  items: e.items,
@@ -1488,11 +1506,11 @@ function Ht(e) {
1488
1506
  }
1489
1507
  //#endregion
1490
1508
  //#region src/components/viewer-core/slotContent.ts
1491
- function Ut(e) {
1509
+ function Gt(e) {
1492
1510
  if (!Array.isArray(e)) return !1;
1493
1511
  for (let t of e) {
1494
1512
  if (Array.isArray(t)) {
1495
- if (Ut(t)) return !0;
1513
+ if (Gt(t)) return !0;
1496
1514
  continue;
1497
1515
  }
1498
1516
  if (!h(t)) {
@@ -1503,20 +1521,20 @@ function Ut(e) {
1503
1521
  if (t != null && t !== !1) return !0;
1504
1522
  continue;
1505
1523
  }
1506
- if (!Wt(t)) return !0;
1524
+ if (!Kt(t)) return !0;
1507
1525
  }
1508
1526
  return !1;
1509
1527
  }
1510
- function Wt(r) {
1511
- 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;
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;
1512
1530
  }
1513
1531
  //#endregion
1514
1532
  //#region src/components/viewer-core/useSurfaceEmptyState.ts
1515
- var Gt = "no items available";
1516
- function Kt(e) {
1533
+ var qt = "no items available";
1534
+ function Jt(e) {
1517
1535
  let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
1518
1536
  loading: !!e.loading.value,
1519
- message: Gt,
1537
+ message: qt,
1520
1538
  mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
1521
1539
  surface: e.surface,
1522
1540
  total: e.itemCount.value
@@ -1524,23 +1542,23 @@ function Kt(e) {
1524
1542
  return {
1525
1543
  emptyStateProps: t,
1526
1544
  showBadgeEmptyState: i(() => t.value?.mode === "badge"),
1527
- showCustomEmptyState: i(() => Ut(n.value)),
1545
+ showCustomEmptyState: i(() => Gt(n.value)),
1528
1546
  showInlineEmptyState: i(() => t.value?.mode === "inline")
1529
1547
  };
1530
1548
  }
1531
1549
  //#endregion
1532
1550
  //#region src/components/viewer-core/format.ts
1533
- function qt(e) {
1551
+ function Yt(e) {
1534
1552
  if (!Number.isFinite(e) || e <= 0) return "0:00";
1535
1553
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
1536
1554
  return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
1537
1555
  }
1538
1556
  //#endregion
1539
1557
  //#region src/components/viewer-core/surfaceStatus.ts
1540
- function Jt(e) {
1558
+ function Xt(e) {
1541
1559
  return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
1542
1560
  }
1543
- function Yt(e) {
1561
+ function Zt(e) {
1544
1562
  return e.phase === "failed" ? {
1545
1563
  kind: "failed",
1546
1564
  message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
@@ -1563,7 +1581,7 @@ function Yt(e) {
1563
1581
  }
1564
1582
  //#endregion
1565
1583
  //#region src/components/viewer-core/useActivation.ts
1566
- function Xt(e) {
1584
+ function Qt(e) {
1567
1585
  let t = !1;
1568
1586
  L(e.enabled, async (t) => {
1569
1587
  if (n(t), t) {
@@ -1586,7 +1604,7 @@ function Xt(e) {
1586
1604
  }
1587
1605
  //#endregion
1588
1606
  //#region src/components/viewer-core/assetState.ts
1589
- var Zt = {
1607
+ var $t = {
1590
1608
  currentTime: 0,
1591
1609
  duration: 0,
1592
1610
  errorKind: null,
@@ -1595,38 +1613,38 @@ var Zt = {
1595
1613
  ready: !1,
1596
1614
  volume: 1
1597
1615
  };
1598
- function Qt() {
1599
- return { ...Zt };
1616
+ function en() {
1617
+ return { ...$t };
1600
1618
  }
1601
- function $t(e) {
1619
+ function tn(e) {
1602
1620
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
1603
1621
  }
1604
- function en(e, t, n) {
1605
- 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);
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);
1606
1624
  }
1607
- function tn(e, t) {
1625
+ function rn(e, t) {
1608
1626
  return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
1609
1627
  }
1610
1628
  //#endregion
1611
1629
  //#region src/components/viewer-core/loadError.ts
1612
- var nn = /* @__PURE__ */ new Map();
1613
- function rn(e) {
1630
+ var an = /* @__PURE__ */ new Map();
1631
+ function on(e) {
1614
1632
  return e === "not-found" ? "404" : "Load error";
1615
1633
  }
1616
- function an(e) {
1634
+ function sn(e) {
1617
1635
  return e === "generic";
1618
1636
  }
1619
- function on(e) {
1620
- return sn(e).then((e) => e ?? "generic");
1637
+ function cn(e) {
1638
+ return ln(e).then((e) => e ?? "generic");
1621
1639
  }
1622
- function sn(e) {
1623
- let t = nn.get(e);
1640
+ function ln(e) {
1641
+ let t = an.get(e);
1624
1642
  if (t) return t;
1625
- let n = cn(e);
1626
- return nn.set(e, n), n;
1643
+ let n = un(e);
1644
+ return an.set(e, n), n;
1627
1645
  }
1628
- async function cn(e) {
1629
- if (!ln(e)) return null;
1646
+ async function un(e) {
1647
+ if (!dn(e)) return null;
1630
1648
  try {
1631
1649
  let t = await fetch(e, { method: "HEAD" });
1632
1650
  return t.ok ? null : t.status === 404 ? "not-found" : "generic";
@@ -1634,12 +1652,12 @@ async function cn(e) {
1634
1652
  return "generic";
1635
1653
  }
1636
1654
  }
1637
- function ln(e) {
1655
+ function dn(e) {
1638
1656
  return /^(https?:\/\/|\/)/i.test(e);
1639
1657
  }
1640
1658
  //#endregion
1641
1659
  //#region src/components/viewer-core/mediaPlayback.ts
1642
- function un(e) {
1660
+ function fn(e) {
1643
1661
  try {
1644
1662
  let t = e.play();
1645
1663
  t && typeof t.catch == "function" && t.catch(() => {});
@@ -1647,12 +1665,12 @@ function un(e) {
1647
1665
  }
1648
1666
  //#endregion
1649
1667
  //#region src/components/viewer-core/useMedia.ts
1650
- function dn(e) {
1668
+ function pn(e) {
1651
1669
  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(() => {
1652
1670
  let t = /* @__PURE__ */ new Map();
1653
1671
  for (let n of e.items.value) t.set($(n), n);
1654
1672
  return t;
1655
- }), 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);
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
1674
  L(() => u.value, async () => {
1657
1675
  await C();
1658
1676
  }), L(() => e.itemCount.value, async () => {
@@ -1675,7 +1693,7 @@ function dn(e) {
1675
1693
  c.delete(e);
1676
1694
  }
1677
1695
  function b(e, r) {
1678
- r instanceof HTMLImageElement && $t(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
1696
+ r instanceof HTMLImageElement && tn(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
1679
1697
  }
1680
1698
  function x() {
1681
1699
  H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
@@ -1697,14 +1715,14 @@ function dn(e) {
1697
1715
  V(i, n);
1698
1716
  continue;
1699
1717
  }
1700
- i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, un(i), W(n, i);
1718
+ i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, fn(i), W(n, i);
1701
1719
  }
1702
1720
  for (let [e, n] of c.entries()) {
1703
1721
  if (e !== t || r.value[e]?.errorKind) {
1704
1722
  V(n, e);
1705
1723
  continue;
1706
1724
  }
1707
- un(n), W(e, n);
1725
+ fn(n), W(e, n);
1708
1726
  }
1709
1727
  }
1710
1728
  function w(e, t) {
@@ -1722,7 +1740,7 @@ function dn(e) {
1722
1740
  async function E(r, i) {
1723
1741
  let a = Y(r) ?? e.activeItem.value;
1724
1742
  t.value[r] = !1, n.value[r] = "generic";
1725
- let o = await on(i);
1743
+ let o = await cn(i);
1726
1744
  n.value[r] = o, a && e.onAssetError?.({
1727
1745
  item: a,
1728
1746
  occurrenceKey: r,
@@ -1740,7 +1758,7 @@ function dn(e) {
1740
1758
  } catch {}
1741
1759
  }
1742
1760
  i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
1743
- let o = await on(n);
1761
+ let o = await cn(n);
1744
1762
  i.errorKind = o, a && e.onAssetError?.({
1745
1763
  item: a,
1746
1764
  occurrenceKey: t,
@@ -1760,13 +1778,13 @@ function dn(e) {
1760
1778
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1761
1779
  let r = Number.parseFloat(e.target.value);
1762
1780
  if (!Number.isFinite(r)) return;
1763
- let i = fn(r, 0, m.value || 0);
1781
+ let i = mn(r, 0, m.value || 0);
1764
1782
  ne(n, i, t), t.currentTime = i;
1765
1783
  }
1766
1784
  function M(e) {
1767
1785
  let t = q(), n = d.value;
1768
1786
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1769
- let r = fn(Number.parseFloat(e.target.value), 0, 1);
1787
+ let r = mn(Number.parseFloat(e.target.value), 0, 1);
1770
1788
  t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
1771
1789
  }
1772
1790
  function N() {
@@ -1787,10 +1805,10 @@ function dn(e) {
1787
1805
  }
1788
1806
  function z(e) {
1789
1807
  let t = R(e);
1790
- return t ? rn(t) : null;
1808
+ return t ? on(t) : null;
1791
1809
  }
1792
1810
  function B(e) {
1793
- return an(R(e));
1811
+ return sn(R(e));
1794
1812
  }
1795
1813
  function ee(e) {
1796
1814
  return `${e}:${a.value[e] ?? 0}`;
@@ -1817,17 +1835,17 @@ function dn(e) {
1817
1835
  for (let [e, t] of c.entries()) V(t, e);
1818
1836
  }
1819
1837
  function U(e) {
1820
- return r.value[e] || (r.value[e] = Qt()), r.value[e];
1838
+ return r.value[e] || (r.value[e] = en()), r.value[e];
1821
1839
  }
1822
1840
  function W(e, t, n) {
1823
- en(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
1841
+ nn(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
1824
1842
  }
1825
1843
  function ne(e, t, n) {
1826
1844
  let r = U(e);
1827
1845
  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;
1828
1846
  }
1829
1847
  function G(e) {
1830
- return fn(o.value[e] ?? 1, 0, 1);
1848
+ return mn(o.value[e] ?? 1, 0, 1);
1831
1849
  }
1832
1850
  function K(e) {
1833
1851
  return s.get(e) ?? c.get(e) ?? null;
@@ -1838,7 +1856,7 @@ function dn(e) {
1838
1856
  function re(e) {
1839
1857
  if (e) {
1840
1858
  if (e.paused) {
1841
- un(e);
1859
+ fn(e);
1842
1860
  return;
1843
1861
  }
1844
1862
  e.pause();
@@ -1892,10 +1910,10 @@ function dn(e) {
1892
1910
  syncMediaPlayback: C
1893
1911
  };
1894
1912
  }
1895
- function fn(e, t, n) {
1913
+ function mn(e, t, n) {
1896
1914
  return Math.min(Math.max(e, t), n);
1897
1915
  }
1898
- function pn(e, t, n = 2) {
1916
+ function hn(e, t, n = 2) {
1899
1917
  return t <= 0 ? {
1900
1918
  start: 0,
1901
1919
  end: -1
@@ -1904,14 +1922,14 @@ function pn(e, t, n = 2) {
1904
1922
  end: Math.min(t - 1, e + n)
1905
1923
  };
1906
1924
  }
1907
- function mn(e, t, n = 2) {
1908
- let r = pn(t, e.length, n);
1925
+ function gn(e, t, n = 2) {
1926
+ let r = hn(t, e.length, n);
1909
1927
  return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
1910
1928
  item: e,
1911
1929
  index: r.start + t
1912
1930
  }));
1913
1931
  }
1914
- function hn(e, t, n, r, i) {
1932
+ function _n(e, t, n, r, i) {
1915
1933
  return {
1916
1934
  transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
1917
1935
  transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
@@ -1919,12 +1937,12 @@ function hn(e, t, n, r, i) {
1919
1937
  }
1920
1938
  //#endregion
1921
1939
  //#region src/components/viewer-core/useViewer.ts
1922
- function gn(e, t, n = {}) {
1923
- 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({
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({
1924
1942
  itemCount: r.value.length,
1925
1943
  loading: s.value,
1926
1944
  phase: e.phase
1927
- })), 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({
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({
1928
1946
  items: r,
1929
1947
  activeItem: C,
1930
1948
  activeMediaItem: w,
@@ -1933,14 +1951,14 @@ function gn(e, t, n = {}) {
1933
1951
  loopFullscreenVideo: l,
1934
1952
  onAssetError: n.onAssetError,
1935
1953
  onAssetLoad: n.onAssetLoad
1936
- }), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Yt({
1954
+ }), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Zt({
1937
1955
  errorMessage: o.value,
1938
1956
  hasItems: r.value.length > 0,
1939
1957
  hasNextPage: c.value,
1940
1958
  phase: d.value,
1941
1959
  surface: "fullscreen"
1942
- })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => pn(S.value, r.value.length)), N = i(() => mn(r.value, S.value));
1943
- Xt({
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({
1944
1962
  enabled: _,
1945
1963
  onDisable() {
1946
1964
  H(), T.resetMediaState();
@@ -2018,7 +2036,7 @@ function gn(e, t, n = {}) {
2018
2036
  return e.type === "audio";
2019
2037
  }
2020
2038
  function ie(e) {
2021
- return hn(e, S.value, g.value, m.value, h.value);
2039
+ return _n(e, S.value, g.value, m.value, h.value);
2022
2040
  }
2023
2041
  return {
2024
2042
  activeItem: C,
@@ -2033,7 +2051,7 @@ function gn(e, t, n = {}) {
2033
2051
  getAssetErrorKind: T.getAssetErrorKind,
2034
2052
  getAssetErrorLabel: T.getAssetErrorLabel,
2035
2053
  getAssetRenderKey: T.getAssetRenderKey,
2036
- formatPlaybackTime: qt,
2054
+ formatPlaybackTime: Yt,
2037
2055
  getImageSource: T.getImageSource,
2038
2056
  getSlideStyle: ie,
2039
2057
  hasNextPage: c,
@@ -2077,21 +2095,21 @@ function gn(e, t, n = {}) {
2077
2095
  }
2078
2096
  //#endregion
2079
2097
  //#region src/components/viewer-core/theme.ts
2080
- var _n = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", vn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", yn = {
2098
+ var yn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", bn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", xn = {
2081
2099
  image: !0,
2082
2100
  video: !0,
2083
2101
  audio: !0,
2084
2102
  other: !0
2085
2103
  };
2086
- function bn(e) {
2087
- return yn[e], _n;
2104
+ function Sn(e) {
2105
+ return xn[e], yn;
2088
2106
  }
2089
- function xn(e) {
2090
- return yn[e], vn;
2107
+ function Cn(e) {
2108
+ return xn[e], bn;
2091
2109
  }
2092
2110
  //#endregion
2093
2111
  //#region src/components/viewer-core/dominantImageTone.ts
2094
- function Sn(e) {
2112
+ function wn(e) {
2095
2113
  if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
2096
2114
  let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
2097
2115
  if (!n) return null;
@@ -2106,20 +2124,20 @@ function Sn(e) {
2106
2124
  r += d, i += s * d, a += c * d, o += l * d;
2107
2125
  }
2108
2126
  return r <= 0 ? null : {
2109
- r: Cn(Math.round(i / r)),
2110
- g: Cn(Math.round(a / r)),
2111
- b: Cn(Math.round(o / r))
2127
+ r: Tn(Math.round(i / r)),
2128
+ g: Tn(Math.round(a / r)),
2129
+ b: Tn(Math.round(o / r))
2112
2130
  };
2113
2131
  } catch {
2114
2132
  return null;
2115
2133
  }
2116
2134
  }
2117
- function Cn(e) {
2135
+ function Tn(e) {
2118
2136
  return Math.min(235, Math.max(26, e));
2119
2137
  }
2120
2138
  //#endregion
2121
2139
  //#region src/components/viewer-core/useFullscreenDominantTone.ts
2122
- function wn(e) {
2140
+ function En(e) {
2123
2141
  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(() => {
2124
2142
  if (!r.value) return;
2125
2143
  let { r: e, g: t, b: n } = r.value;
@@ -2134,7 +2152,7 @@ function wn(e) {
2134
2152
  });
2135
2153
  function s(n, r) {
2136
2154
  if (!e.showDominantImageTone.value) return;
2137
- let i = Sn(r);
2155
+ let i = wn(r);
2138
2156
  i && (t.value[n] = i);
2139
2157
  }
2140
2158
  return {
@@ -2145,7 +2163,7 @@ function wn(e) {
2145
2163
  }
2146
2164
  //#endregion
2147
2165
  //#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
2148
- var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2166
+ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
2149
2167
  inheritAttrs: !1,
2150
2168
  __name: "SurfaceEmptyState",
2151
2169
  props: {
@@ -2159,31 +2177,31 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2159
2177
  "data-testid": "vibe-empty-state-inline",
2160
2178
  "data-surface": e.surface,
2161
2179
  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)]"]
2162
- }), [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, Tn)) : (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", {
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", {
2163
2181
  "data-testid": "vibe-empty-state-badge",
2164
2182
  "data-surface": e.surface,
2165
2183
  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"])
2166
- }, j(e.message), 11, En)])], 16));
2184
+ }, j(e.message), 11, On)])], 16));
2167
2185
  }
2168
- }), On = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, kn = {
2186
+ }), An = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, jn = {
2169
2187
  key: 0,
2170
2188
  class: "relative h-full min-h-0"
2171
- }, An = [
2189
+ }, Mn = [
2172
2190
  "data-item-id",
2173
2191
  "data-occurrence-key",
2174
2192
  "data-index",
2175
2193
  "data-active",
2176
2194
  "aria-hidden"
2177
- ], jn = {
2195
+ ], Nn = {
2178
2196
  key: 0,
2179
2197
  "data-testid": "vibe-asset-spinner",
2180
2198
  class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
2181
- }, Mn = { 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]" }, Nn = ["data-kind"], Pn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Fn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, In = ["onClick"], Ln = [
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 = [
2182
2200
  "src",
2183
2201
  "alt",
2184
2202
  "onLoad",
2185
2203
  "onError"
2186
- ], Rn = [
2204
+ ], Bn = [
2187
2205
  "loop",
2188
2206
  "src",
2189
2207
  "preload",
@@ -2202,15 +2220,15 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2202
2220
  "onStalled",
2203
2221
  "onTimeupdate",
2204
2222
  "onWaiting"
2205
- ], zn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Bn = [
2223
+ ], Vn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Hn = [
2206
2224
  "aria-label",
2207
2225
  "disabled",
2208
2226
  "onClick"
2209
- ], Vn = { 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]" }, Hn = { 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]" }, Un = {
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 = {
2210
2228
  key: 0,
2211
2229
  "data-testid": "vibe-asset-spinner",
2212
2230
  class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
2213
- }, Wn = { 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]" }, Gn = ["data-kind"], Kn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, qn = ["onClick"], Jn = [
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 = [
2214
2232
  "src",
2215
2233
  "preload",
2216
2234
  "onCanplay",
@@ -2226,26 +2244,26 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2226
2244
  "onStalled",
2227
2245
  "onTimeupdate",
2228
2246
  "onWaiting"
2229
- ], Yn = {
2247
+ ], Zn = {
2230
2248
  key: 2,
2231
2249
  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"
2232
- }, Xn = { 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]" }, Zn = {
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 = {
2233
2251
  key: 0,
2234
2252
  "data-testid": "vibe-fullscreen-overlay",
2235
2253
  class: "pointer-events-none absolute inset-0 z-[6]"
2236
- }, Qn = { class: "h-full w-full" }, $n = {
2254
+ }, er = { class: "h-full w-full" }, tr = {
2237
2255
  key: 1,
2238
2256
  "data-testid": "vibe-forward-fill-placeholder",
2239
2257
  class: "grid h-full min-h-0 place-items-center px-6 text-center"
2240
- }, er = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, tr = { 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)]" }, nr = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, rr = {
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 = {
2241
2259
  key: 0,
2242
2260
  "data-testid": "vibe-fullscreen-aside",
2243
2261
  class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
2244
- }, ir = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, ar = {
2262
+ }, or = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, sr = {
2245
2263
  key: 0,
2246
2264
  "data-testid": "vibe-fullscreen-aside",
2247
2265
  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]"
2248
- }, or = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, sr = 1280, cr = 768, lr = /* @__PURE__ */ d({
2266
+ }, cr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, lr = 1280, ur = 768, dr = /* @__PURE__ */ d({
2249
2267
  __name: "FullscreenSurface",
2250
2268
  props: {
2251
2269
  active: {
@@ -2297,23 +2315,23 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2297
2315
  },
2298
2316
  emits: ["back-to-list", "update:activeIndex"],
2299
2317
  setup(e, { emit: n }) {
2300
- let d = e, f = F(), m = n, h = gn(d, (e, t) => {
2318
+ let d = e, f = F(), m = n, h = vn(d, (e, t) => {
2301
2319
  m("update:activeIndex", t);
2302
2320
  }, {
2303
2321
  enabled: M(d, "active"),
2304
2322
  onAssetError: d.reportAssetError ?? void 0,
2305
2323
  onAssetLoad: d.reportAssetLoad ?? void 0
2306
- }), _ = D(typeof window > "u" ? sr : window.innerWidth || sr), C = Ht({
2324
+ }), _ = D(typeof window > "u" ? lr : window.innerWidth || lr), C = Wt({
2307
2325
  active: M(d, "active"),
2308
2326
  items: h.items,
2309
2327
  resolvedActiveIndex: h.resolvedActiveIndex,
2310
2328
  viewer: h
2311
- }), T = i(() => bn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = wn({
2329
+ }), T = i(() => Sn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = En({
2312
2330
  activeItem: h.activeItem,
2313
2331
  getItemKey: C.getItemKey,
2314
2332
  isImageReady: h.isImageReady,
2315
2333
  showDominantImageTone: M(d, "showDominantImageTone")
2316
- }), 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 < cr ? "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(() => {
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(() => {
2317
2335
  let e = h.activeItem.value;
2318
2336
  return e ? {
2319
2337
  hasNextPage: d.hasNextPage,
@@ -2330,7 +2348,7 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2330
2348
  }), K = i(() => !G.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](G.value)), q = i(() => ({
2331
2349
  gridTemplateColumns: Y.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
2332
2350
  transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
2333
- })), re = i(() => Ut(W.value)), J = i(() => Ut(ne.value)), Y = i(() => J.value && _.value >= sr), ie = i(() => J.value && !Y.value), ae = i(() => Ut(K.value)), { emptyStateProps: X, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = Kt({
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({
2334
2352
  emptyStateMode: M(d, "emptyStateMode"),
2335
2353
  itemCount: i(() => d.items.length),
2336
2354
  loading: M(d, "loading"),
@@ -2343,7 +2361,7 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2343
2361
  window.removeEventListener("resize", Z);
2344
2362
  });
2345
2363
  function Z() {
2346
- _.value = window.innerWidth || sr;
2364
+ _.value = window.innerWidth || lr;
2347
2365
  }
2348
2366
  function pe(e, t, n) {
2349
2367
  C.settleBackgroundPreload(t), h.onImageLoad(t, n);
@@ -2383,7 +2401,7 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2383
2401
  let r = n.play();
2384
2402
  r && typeof r.catch == "function" && r.catch(() => {});
2385
2403
  }
2386
- return (e, n) => (w(), s("div", On, [
2404
+ return (e, n) => (w(), s("div", An, [
2387
2405
  c("div", {
2388
2406
  class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
2389
2407
  style: b(N(P))
@@ -2400,7 +2418,7 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2400
2418
  onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
2401
2419
  onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
2402
2420
  onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
2403
- }, [N(h).activeItem.value ? (w(), s("div", kn, [
2421
+ }, [N(h).activeItem.value ? (w(), s("div", jn, [
2404
2422
  (w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
2405
2423
  key: N(C).getItemKey(r),
2406
2424
  "data-testid": "vibe-slide",
@@ -2412,12 +2430,12 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2412
2430
  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"]),
2413
2431
  style: b(N(h).getSlideStyle(i))
2414
2432
  }, [c("div", {
2415
- class: v(["absolute inset-0 opacity-85", N(xn)(r.type)]),
2433
+ class: v(["absolute inset-0 opacity-85", N(Cn)(r.type)]),
2416
2434
  style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
2417
2435
  }, null, 6), N(h).isVisual(r) ? (w(), s("div", {
2418
2436
  key: 0,
2419
2437
  class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? te.value : ""])
2420
- }, [N(C).isAssetLoading(i, r) ? (w(), s("div", jn, [c("span", Mn, [u(N(oe), {
2438
+ }, [N(C).isAssetLoading(i, r) ? (w(), s("div", Nn, [c("span", Pn, [u(N(oe), {
2421
2439
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2422
2440
  "aria-hidden": "true"
2423
2441
  })])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
@@ -2425,19 +2443,19 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2425
2443
  "data-testid": "vibe-asset-error",
2426
2444
  "data-kind": N(C).getAssetErrorKind(r),
2427
2445
  class: "grid h-full w-full place-items-center"
2428
- }, [c("div", Pn, [
2446
+ }, [c("div", In, [
2429
2447
  u(N(le), {
2430
2448
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2431
2449
  "aria-hidden": "true"
2432
2450
  }),
2433
- c("p", Fn, j(N(C).getAssetErrorLabel(r)), 1),
2451
+ c("p", Ln, j(N(C).getAssetErrorLabel(r)), 1),
2434
2452
  N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
2435
2453
  key: 0,
2436
2454
  type: "button",
2437
2455
  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",
2438
2456
  onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
2439
- }, " Retry ", 8, In)) : o("", !0)
2440
- ])], 8, Nn)) : r.type === "image" ? (w(), s("img", {
2457
+ }, " Retry ", 8, Rn)) : o("", !0)
2458
+ ])], 8, Fn)) : r.type === "image" ? (w(), s("img", {
2441
2459
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2442
2460
  src: N(C).getFullscreenImageSource(i, r),
2443
2461
  alt: r.title ?? "",
@@ -2448,7 +2466,7 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2448
2466
  ref: (e) => he(N(C).getItemKey(r), e),
2449
2467
  onLoad: (e) => pe(e, N(C).getItemKey(r), r.url),
2450
2468
  onError: (e) => me(N(C).getItemKey(r), r.url)
2451
- }, null, 42, Ln)) : (w(), s("video", {
2469
+ }, null, 42, zn)) : (w(), s("video", {
2452
2470
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2453
2471
  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"]),
2454
2472
  playsinline: "",
@@ -2472,10 +2490,10 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2472
2490
  onStalled: (e) => Q(N(C).getItemKey(r), e),
2473
2491
  onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
2474
2492
  onWaiting: (e) => Q(N(C).getItemKey(r), e)
2475
- }, null, 42, Rn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
2493
+ }, null, 42, Bn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
2476
2494
  key: 1,
2477
2495
  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 : ""])
2478
- }, [c("div", zn, [
2496
+ }, [c("div", Vn, [
2479
2497
  c("button", {
2480
2498
  type: "button",
2481
2499
  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]",
@@ -2485,19 +2503,19 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2485
2503
  }, [
2486
2504
  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),
2487
2505
  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),
2488
- c("span", Vn, [k(e.$slots, "item-icon", {
2506
+ c("span", Un, [k(e.$slots, "item-icon", {
2489
2507
  icon: N(Ot)(r.type),
2490
2508
  item: r
2491
2509
  }, () => [(w(), a(A(N(Ot)(r.type)), {
2492
2510
  class: "h-6 w-6 stroke-[1.9]",
2493
2511
  "aria-hidden": "true"
2494
2512
  }))])]),
2495
- c("span", Hn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
2513
+ c("span", Wn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
2496
2514
  class: "h-4 w-4 stroke-2",
2497
2515
  "aria-hidden": "true"
2498
2516
  }))])
2499
- ], 8, Bn),
2500
- N(C).isAssetLoading(i, r) ? (w(), s("div", Un, [c("span", Wn, [u(N(oe), {
2517
+ ], 8, Hn),
2518
+ N(C).isAssetLoading(i, r) ? (w(), s("div", Gn, [c("span", Kn, [u(N(oe), {
2501
2519
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2502
2520
  "aria-hidden": "true"
2503
2521
  })])])) : o("", !0),
@@ -2510,14 +2528,14 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2510
2528
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2511
2529
  "aria-hidden": "true"
2512
2530
  }),
2513
- c("p", Kn, j(N(C).getAssetErrorLabel(r)), 1),
2531
+ c("p", Jn, j(N(C).getAssetErrorLabel(r)), 1),
2514
2532
  N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
2515
2533
  key: 0,
2516
2534
  type: "button",
2517
2535
  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",
2518
2536
  onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
2519
- }, " Retry ", 8, qn)) : o("", !0)
2520
- ], 8, Gn)], 64)) : o("", !0)
2537
+ }, " Retry ", 8, Yn)) : o("", !0)
2538
+ ], 8, qn)], 64)) : o("", !0)
2521
2539
  ]), (w(), s("audio", {
2522
2540
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2523
2541
  src: N(C).getFullscreenMediaSource(i, r),
@@ -2538,14 +2556,14 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2538
2556
  onStalled: (e) => Q(N(C).getItemKey(r), e),
2539
2557
  onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
2540
2558
  onWaiting: (e) => Q(N(C).getItemKey(r), e)
2541
- }, null, 40, Jn))], 2)) : (w(), s("div", Yn, [c("div", Xn, [k(e.$slots, "item-icon", {
2559
+ }, null, 40, Xn))], 2)) : (w(), s("div", Zn, [c("div", Qn, [k(e.$slots, "item-icon", {
2542
2560
  icon: N(Ot)(r.type),
2543
2561
  item: r
2544
2562
  }, () => [(w(), a(A(N(Ot)(r.type)), {
2545
2563
  class: "h-6 w-6 stroke-[1.9]",
2546
2564
  "aria-hidden": "true"
2547
- }))])])]))], 14, An))), 128)),
2548
- U.value && f["fullscreen-overlay"] ? (w(), s("div", Zn, [c("div", Qn, [k(e.$slots, "fullscreen-overlay", y(p(U.value)))])])) : o("", !0),
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),
2549
2567
  N(h).activeItem.value ? (w(), a(Tt, {
2550
2568
  key: 1,
2551
2569
  "current-index": N(h).resolvedActiveIndex.value,
@@ -2603,10 +2621,10 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2603
2621
  "data-testid": "vibe-fullscreen-status-badge",
2604
2622
  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" : ""])
2605
2623
  }, j(G.value.message), 3))], 2)) : o("", !0)
2606
- ])) : V.value ? (w(), s("div", $n, [c("div", er, [c("span", tr, [u(N(oe), {
2624
+ ])) : V.value ? (w(), s("div", tr, [c("div", nr, [c("span", rr, [u(N(oe), {
2607
2625
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2608
2626
  "aria-hidden": "true"
2609
- })]), c("p", nr, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(Dn, {
2627
+ })]), c("p", ir, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(kn, {
2610
2628
  key: 2,
2611
2629
  message: N(X).message,
2612
2630
  mode: N(X).mode,
@@ -2618,7 +2636,7 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2618
2636
  "message",
2619
2637
  "mode",
2620
2638
  "surface"
2621
- ])) : o("", !0), N(ue) && N(X) ? (w(), a(Dn, {
2639
+ ])) : o("", !0), N(ue) && N(X) ? (w(), a(kn, {
2622
2640
  key: 3,
2623
2641
  message: N(X).message,
2624
2642
  mode: N(X).mode,
@@ -2638,7 +2656,7 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2638
2656
  "leave-from-class": "translate-x-0 opacity-100",
2639
2657
  "leave-to-class": "translate-x-full opacity-0"
2640
2658
  }, {
2641
- default: z(() => [Y.value && U.value ? (w(), s("aside", rr, [c("div", ir, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
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)]),
2642
2660
  _: 3
2643
2661
  })], 4),
2644
2662
  u(r, {
@@ -2649,29 +2667,29 @@ var Tn = ["data-surface"], En = ["data-surface"], Dn = /* @__PURE__ */ d({
2649
2667
  "leave-from-class": "translate-x-0 opacity-100",
2650
2668
  "leave-to-class": "translate-x-full opacity-0"
2651
2669
  }, {
2652
- default: z(() => [ie.value && U.value ? (w(), s("aside", ar, [c("div", or, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
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)]),
2653
2671
  _: 3
2654
2672
  })
2655
2673
  ]));
2656
2674
  }
2657
- }), ur = 1, dr = .5;
2658
- function fr(e) {
2675
+ }), fr = 1, pr = .5;
2676
+ function mr(e) {
2659
2677
  if (e.type !== "image" && e.type !== "video") return {
2660
- width: ur,
2661
- height: ur,
2678
+ width: fr,
2679
+ height: fr,
2662
2680
  source: "fallback"
2663
2681
  };
2664
2682
  let t = e.preview?.width, n = e.preview?.height;
2665
- if (yr(t) && yr(n)) {
2666
- let r = br(e, t, n);
2683
+ if (xr(t) && xr(n)) {
2684
+ let r = Sr(e, t, n);
2667
2685
  return {
2668
2686
  width: r.width,
2669
2687
  height: r.height,
2670
2688
  source: "preview"
2671
2689
  };
2672
2690
  }
2673
- if (yr(e.width) && yr(e.height)) {
2674
- let t = br(e, e.width, e.height);
2691
+ if (xr(e.width) && xr(e.height)) {
2692
+ let t = Sr(e, e.width, e.height);
2675
2693
  return {
2676
2694
  width: t.width,
2677
2695
  height: t.height,
@@ -2679,31 +2697,31 @@ function fr(e) {
2679
2697
  };
2680
2698
  }
2681
2699
  return {
2682
- width: ur,
2683
- height: ur,
2700
+ width: fr,
2701
+ height: fr,
2684
2702
  source: "fallback"
2685
2703
  };
2686
2704
  }
2687
- function pr(e, t) {
2705
+ function hr(e, t) {
2688
2706
  return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
2689
2707
  }
2690
- function mr(e, t, n, r = 0) {
2708
+ function gr(e, t, n, r = 0) {
2691
2709
  if (!e || e <= 0 || !t || t <= 0) return n;
2692
2710
  let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
2693
2711
  return !a || a <= 0 ? n : a / t;
2694
2712
  }
2695
- function hr(e, t) {
2696
- let n = fr(e);
2713
+ function _r(e, t) {
2714
+ let n = mr(e);
2697
2715
  return n.height / n.width * t;
2698
2716
  }
2699
- function gr(e, t) {
2717
+ function vr(e, t) {
2700
2718
  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;
2701
2719
  for (let c = 0; c < e.length; c += 1) {
2702
2720
  let l = e[c];
2703
2721
  o.set($(l), c);
2704
2722
  let u = 0;
2705
2723
  for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
2706
- let d = u * (t.columnWidth + t.gapX), f = n[u], p = hr(l, t.columnWidth);
2724
+ let d = u * (t.columnWidth + t.gapX), f = n[u], p = _r(l, t.columnWidth);
2707
2725
  r[c] = {
2708
2726
  x: d,
2709
2727
  y: f
@@ -2722,7 +2740,7 @@ function gr(e, t) {
2722
2740
  indexById: o
2723
2741
  };
2724
2742
  }
2725
- function _r(e) {
2743
+ function yr(e) {
2726
2744
  if (e.itemCount <= 0) return [];
2727
2745
  if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
2728
2746
  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();
@@ -2732,7 +2750,7 @@ function _r(e) {
2732
2750
  }
2733
2751
  return Array.from(a).sort((e, t) => e - t);
2734
2752
  }
2735
- function vr(e, t, n) {
2753
+ function br(e, t, n) {
2736
2754
  let r = /* @__PURE__ */ new Map();
2737
2755
  for (let i of e) {
2738
2756
  let e = t.get($(i));
@@ -2742,11 +2760,11 @@ function vr(e, t, n) {
2742
2760
  }
2743
2761
  return r;
2744
2762
  }
2745
- function yr(e) {
2763
+ function xr(e) {
2746
2764
  return typeof e == "number" && Number.isFinite(e) && e > 0;
2747
2765
  }
2748
- function br(e, t, n) {
2749
- return e.type !== "image" || n / t >= dr ? {
2766
+ function Sr(e, t, n) {
2767
+ return e.type !== "image" || n / t >= pr ? {
2750
2768
  width: t,
2751
2769
  height: n
2752
2770
  } : {
@@ -2756,21 +2774,21 @@ function br(e, t, n) {
2756
2774
  }
2757
2775
  //#endregion
2758
2776
  //#region src/components/viewer-core/useMasonryMotion.ts
2759
- var xr = 300, Sr = 600, Cr = 40, wr = 300, Tr = 400;
2760
- function Er(e, t) {
2777
+ var Cr = 300, wr = 600, Tr = 40, Er = 300, Dr = 400;
2778
+ function Or(e, t) {
2761
2779
  return t === "top" ? [...e].reverse() : e;
2762
2780
  }
2763
- function Dr(e) {
2764
- return e <= 0 ? Sr : Sr + Math.min((e - 1) * Cr, Tr);
2781
+ function kr(e) {
2782
+ return e <= 0 ? wr : wr + Math.min((e - 1) * Tr, Dr);
2765
2783
  }
2766
- function Or() {
2767
- return wr;
2784
+ function Ar() {
2785
+ return Er;
2768
2786
  }
2769
- function kr(e) {
2787
+ function jr(e) {
2770
2788
  let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
2771
2789
  return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
2772
2790
  }
2773
- function Ar(e) {
2791
+ function Mr(e) {
2774
2792
  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()));
2775
2793
  L(e.visibleIndices, (i) => {
2776
2794
  if (!i.length) return;
@@ -2780,20 +2798,20 @@ function Ar(e) {
2780
2798
  !r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
2781
2799
  }
2782
2800
  if (!o.length) return;
2783
- let s = Er(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2784
- for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Cr, Tr));
2785
- r.value = c, jr(() => {
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(() => {
2786
2804
  let e = new Set(n.value);
2787
2805
  for (let t of o) e.add(t);
2788
2806
  n.value = e;
2789
- }), Mr(() => {
2807
+ }), Pr(() => {
2790
2808
  let e = new Set(t.value);
2791
2809
  for (let t of o) e.delete(t);
2792
2810
  t.value = e, S(() => {
2793
2811
  let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
2794
2812
  for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
2795
2813
  n.value = e, r.value = t, a.value = i;
2796
- }, Dr(o.length));
2814
+ }, kr(o.length));
2797
2815
  });
2798
2816
  }, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
2799
2817
  if (!e.length || !o.value.size) return;
@@ -2820,7 +2838,7 @@ function Ar(e) {
2820
2838
  let e = $(t.item);
2821
2839
  p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
2822
2840
  }
2823
- o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, jr(() => {
2841
+ o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Nr(() => {
2824
2842
  let e = new Set(s.value);
2825
2843
  for (let t of p) e.add(t);
2826
2844
  s.value = e;
@@ -2828,9 +2846,9 @@ function Ar(e) {
2828
2846
  let e = new Map(o.value), t = new Set(s.value);
2829
2847
  for (let n of p) e.delete(n), t.delete(n);
2830
2848
  o.value = e, s.value = t;
2831
- }, wr);
2849
+ }, Er);
2832
2850
  }
2833
- function g(t, n, r = xr) {
2851
+ function g(t, n, r = Cr) {
2834
2852
  if (!t.size) return;
2835
2853
  let i = /* @__PURE__ */ new Map(), a = [];
2836
2854
  for (let [r, o] of t.entries()) {
@@ -2849,8 +2867,8 @@ function Ar(e) {
2849
2867
  c.value = i, u.value = /* @__PURE__ */ new Set();
2850
2868
  let o = new Map(l.value);
2851
2869
  for (let e of a) o.set(e, r);
2852
- l.value = o, jr(() => {
2853
- u.value = new Set(a), jr(() => {
2870
+ l.value = o, Nr(() => {
2871
+ u.value = new Set(a), Nr(() => {
2854
2872
  c.value = /* @__PURE__ */ new Map();
2855
2873
  });
2856
2874
  }), S(() => {
@@ -2861,8 +2879,8 @@ function Ar(e) {
2861
2879
  }, r);
2862
2880
  }
2863
2881
  function _(e) {
2864
- if (n.value.has(e)) return `transform ${Sr}ms ease-out`;
2865
- if (u.value.has(e)) return `transform ${l.value.get(e) ?? xr}ms ease-out`;
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`;
2866
2884
  }
2867
2885
  function v(e) {
2868
2886
  if (!n.value.has(e)) return;
@@ -2879,7 +2897,7 @@ function Ar(e) {
2879
2897
  } : {
2880
2898
  dx: 0,
2881
2899
  dy: 0
2882
- }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? kr({
2900
+ }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? jr({
2883
2901
  columnWidth: e.columnWidth.value,
2884
2902
  direction: u,
2885
2903
  itemHeight: o,
@@ -2893,14 +2911,14 @@ function Ar(e) {
2893
2911
  if (!r) return {
2894
2912
  opacity: "0",
2895
2913
  transform: "translate3d(0, 0, 0) scale(0.96)",
2896
- transition: `opacity ${wr}ms ease-out, transform ${wr}ms ease-out`
2914
+ transition: `opacity ${Er}ms ease-out, transform ${Er}ms ease-out`
2897
2915
  };
2898
2916
  let i = s.value.has(n);
2899
2917
  return {
2900
2918
  height: `${r.height}px`,
2901
2919
  opacity: i ? "0" : "1",
2902
2920
  transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
2903
- transition: `opacity ${wr}ms ease-out, transform ${wr}ms ease-out`,
2921
+ transition: `opacity ${Er}ms ease-out, transform ${Er}ms ease-out`,
2904
2922
  width: `${e.columnWidth.value}px`
2905
2923
  };
2906
2924
  }
@@ -2921,28 +2939,28 @@ function Ar(e) {
2921
2939
  playFlipMoveAnimation: g
2922
2940
  };
2923
2941
  }
2924
- function jr(e) {
2942
+ function Nr(e) {
2925
2943
  if (typeof requestAnimationFrame == "function") {
2926
2944
  requestAnimationFrame(() => e());
2927
2945
  return;
2928
2946
  }
2929
2947
  setTimeout(e, 0);
2930
2948
  }
2931
- function Mr(e) {
2932
- jr(() => jr(e));
2949
+ function Pr(e) {
2950
+ Nr(() => Nr(e));
2933
2951
  }
2934
2952
  //#endregion
2935
2953
  //#region src/components/viewer-core/masonryViewport.ts
2936
- function Nr(e, t) {
2954
+ function Fr(e, t) {
2937
2955
  return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
2938
2956
  }
2939
- function Pr(e, t, n) {
2957
+ function Ir(e, t, n) {
2940
2958
  return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
2941
2959
  }
2942
- function Fr(e, t, n, r) {
2960
+ function Lr(e, t, n, r) {
2943
2961
  return (e?.scrollHeight ?? r) - (t + n);
2944
2962
  }
2945
- function Ir(e, t) {
2963
+ function Rr(e, t) {
2946
2964
  return {
2947
2965
  height: `${e}px`,
2948
2966
  transform: `translate3d(0, ${t}px, 0)`
@@ -2950,8 +2968,8 @@ function Ir(e, t) {
2950
2968
  }
2951
2969
  //#endregion
2952
2970
  //#region src/components/viewer-core/useEdgeBoundary.ts
2953
- var Lr = 250, Rr = 1e3;
2954
- function zr(e) {
2971
+ var zr = 250, Br = 1e3;
2972
+ function Vr(e) {
2955
2973
  let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
2956
2974
  x(() => {
2957
2975
  y();
@@ -2967,7 +2985,7 @@ function zr(e) {
2967
2985
  function u(t) {
2968
2986
  if (!b(t) || !e.isAtBoundary()) return;
2969
2987
  let n = Date.now();
2970
- n < s || (s = n + Lr, m());
2988
+ n < s || (s = n + zr, m());
2971
2989
  }
2972
2990
  function d() {
2973
2991
  if (!g()) return;
@@ -3001,7 +3019,7 @@ function zr(e) {
3001
3019
  return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
3002
3020
  }
3003
3021
  function _() {
3004
- o.value = !1, v(Rr);
3022
+ o.value = !1, v(Br);
3005
3023
  }
3006
3024
  function v(e) {
3007
3025
  y(), a.value = !0, c = setTimeout(() => {
@@ -3024,42 +3042,42 @@ function zr(e) {
3024
3042
  }
3025
3043
  //#endregion
3026
3044
  //#region src/components/viewer-core/useMasonryList.ts
3027
- var Br = 600, Vr = 24, Hr = 16, Ur = 300, Wr = 200, Gr = 200, Kr = Vr + Hr, qr = 200, Jr = 300, Yr = 24, Xr = 48, Zr = 500, Qr = 1e3;
3028
- function $r(e) {
3029
- let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Ur), 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(Ur, a.value - Vr * 2)), h = i(() => pr(m.value, Ur)), g = i(() => mr(m.value, h.value, Ur, Hr)), v = i(() => ei(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => _r({
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({
3030
3048
  itemCount: e.items.value.length,
3031
3049
  viewportHeight: r.value,
3032
3050
  scrollTop: n.value,
3033
- overscanPx: Wr,
3034
- bucketPx: Br,
3051
+ overscanPx: Kr,
3052
+ bucketPx: Hr,
3035
3053
  buckets: c.value
3036
3054
  })), b = i(() => y.value.map((t) => ({
3037
3055
  item: e.items.value[t],
3038
3056
  index: t
3039
3057
  }))), C = i(() => {
3040
- let e = l.value + Vr * 2, t = d.value ?? 0;
3041
- return Math.max(e, t, r.value) + qr;
3042
- }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => ni({
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({
3043
3061
  active: e.active.value,
3044
3062
  maxScrollTop: se(),
3045
3063
  progressDistancePx: n.value,
3046
- thresholdPx: Gr,
3064
+ thresholdPx: qr,
3047
3065
  triggerEnabled: w.value
3048
- })), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ti({
3066
+ })), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ri({
3049
3067
  active: e.active.value,
3050
3068
  maxScrollTop: se(),
3051
3069
  progressDistancePx: n.value,
3052
- thresholdPx: Kr,
3070
+ thresholdPx: Jr,
3053
3071
  triggerEnabled: e.hasPreviousPage.value
3054
- })), k = i(() => Math.max(0, r.value - Yr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
3072
+ })), k = i(() => Math.max(0, r.value - Zr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
3055
3073
  if (!A.value) return 0;
3056
3074
  let e = r.value / C.value * k.value;
3057
- return Math.min(k.value, Math.max(Xr, e));
3075
+ return Math.min(k.value, Math.max(Qr, e));
3058
3076
  }), M = i(() => {
3059
- if (!A.value) return Yr;
3077
+ if (!A.value) return Zr;
3060
3078
  let e = Math.max(0, C.value - r.value);
3061
- return Yr + Math.max(0, k.value - j.value) * (e > 0 ? ei(n.value / e, 0, 1) : 0);
3062
- }), N = Ar({
3079
+ return Zr + Math.max(0, k.value - j.value) * (e > 0 ? ni(n.value / e, 0, 1) : 0);
3080
+ }), N = Mr({
3063
3081
  items: e.items,
3064
3082
  visibleIndices: y,
3065
3083
  positions: o,
@@ -3068,27 +3086,27 @@ function $r(e) {
3068
3086
  columnWidth: g,
3069
3087
  scrollTop: n,
3070
3088
  viewportHeight: r
3071
- }), P = zr({
3089
+ }), P = Vr({
3072
3090
  direction: "top",
3073
3091
  getAnimationLockMs(e) {
3074
- return Math.max(Zr, Dr(e)) + Qr;
3092
+ return Math.max($r, kr(e)) + ei;
3075
3093
  },
3076
3094
  hasPage: e.hasPreviousPage,
3077
3095
  interactionLocked: p,
3078
3096
  isAtBoundary() {
3079
- return n.value <= Kr;
3097
+ return n.value <= Jr;
3080
3098
  },
3081
3099
  loading: e.loading,
3082
3100
  requestPage: e.requestPreviousPage
3083
- }), F = zr({
3101
+ }), F = Vr({
3084
3102
  direction: "bottom",
3085
3103
  getAnimationLockMs(e) {
3086
- return Dr(e) + Qr;
3104
+ return kr(e) + ei;
3087
3105
  },
3088
3106
  hasPage: w,
3089
3107
  interactionLocked: p,
3090
3108
  isAtBoundary() {
3091
- return oe() <= Gr;
3109
+ return oe() <= qr;
3092
3110
  },
3093
3111
  loading: e.loading,
3094
3112
  requestPage: e.requestNextPage
@@ -3098,7 +3116,7 @@ function $r(e) {
3098
3116
  h,
3099
3117
  g
3100
3118
  ], async ([t], [r = []]) => {
3101
- let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = vr(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) => {
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) => {
3102
3120
  let t = $(e);
3103
3121
  if (f.has(t)) return [];
3104
3122
  let n = c.get(t), r = l.get(t);
@@ -3107,8 +3125,8 @@ function $r(e) {
3107
3125
  item: e,
3108
3126
  position: n
3109
3127
  }];
3110
- }), 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 > Vr + Hr, b = h && n.value > Vr + Hr ? t[v.value] : null, x = b ? $(b) : null;
3111
- y && K(Or() + Qr), 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 ? Zr : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
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();
3112
3130
  }, { immediate: !0 }), L([
3113
3131
  () => e.pendingAppendItems.value.map((e) => $(e)),
3114
3132
  h,
@@ -3125,7 +3143,7 @@ function $r(e) {
3125
3143
  }
3126
3144
  if (i !== !1 || f.value == null) return;
3127
3145
  await _();
3128
- let o = Math.max(0, C.value - r.value), s = ei(f.value, 0, o);
3146
+ let o = Math.max(0, C.value - r.value), s = ni(f.value, 0, o);
3129
3147
  a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
3130
3148
  }), L(() => e.loading.value, async (t) => {
3131
3149
  !t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
@@ -3137,16 +3155,16 @@ function $r(e) {
3137
3155
  I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
3138
3156
  });
3139
3157
  function te() {
3140
- let t = gr(e.items.value, {
3158
+ let t = vr(e.items.value, {
3141
3159
  columnCount: h.value,
3142
3160
  columnWidth: g.value,
3143
- gapX: Hr,
3144
- gapY: Hr,
3145
- bucketPx: Br
3161
+ gapX: Wr,
3162
+ gapY: Wr,
3163
+ bucketPx: Hr
3146
3164
  });
3147
3165
  o.value = t.positions.map((e) => ({
3148
- x: e.x + Vr,
3149
- y: e.y + Vr
3166
+ x: e.x + Ur,
3167
+ y: e.y + Ur
3150
3168
  })), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
3151
3169
  }
3152
3170
  function V() {
@@ -3171,7 +3189,7 @@ function $r(e) {
3171
3189
  let a = t.value, c = o.value[e], l = s.value[e];
3172
3190
  if (!a || !c || !l) return;
3173
3191
  let u = a.scrollTop, d = Math.max(0, C.value - r.value);
3174
- i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Vr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Vr), a.scrollTop = ei(u, 0, d), n.value = a.scrollTop, q();
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();
3175
3193
  }
3176
3194
  function ne(e, r) {
3177
3195
  let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
@@ -3204,7 +3222,7 @@ function $r(e) {
3204
3222
  e.setActiveIndex(i);
3205
3223
  }
3206
3224
  function re() {
3207
- let t = n.value <= Kr, r = oe() <= Gr;
3225
+ let t = n.value <= Jr, r = oe() <= qr;
3208
3226
  return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
3209
3227
  }
3210
3228
  function J() {
@@ -3214,29 +3232,29 @@ function $r(e) {
3214
3232
  r.value = ie(), a.value = ae();
3215
3233
  }
3216
3234
  function ie() {
3217
- return Nr(t.value, r.value);
3235
+ return Fr(t.value, r.value);
3218
3236
  }
3219
3237
  function ae() {
3220
- return Pr(t.value, a.value, Ur);
3238
+ return Ir(t.value, a.value, Gr);
3221
3239
  }
3222
3240
  function oe() {
3223
- return Fr(t.value, n.value, r.value, C.value);
3241
+ return Lr(t.value, n.value, r.value, C.value);
3224
3242
  }
3225
3243
  function se() {
3226
3244
  let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
3227
3245
  return Math.max(0, e - r.value);
3228
3246
  }
3229
3247
  function ce() {
3230
- return Ir(j.value, M.value);
3248
+ return Rr(j.value, M.value);
3231
3249
  }
3232
3250
  function le(e) {
3233
- return e.length ? gr(e, {
3251
+ return e.length ? vr(e, {
3234
3252
  columnCount: h.value,
3235
3253
  columnWidth: g.value,
3236
- gapX: Hr,
3237
- gapY: Hr,
3238
- bucketPx: Br
3239
- }).contentHeight + Vr * 2 : 0;
3254
+ gapX: Wr,
3255
+ gapY: Wr,
3256
+ bucketPx: Hr
3257
+ }).contentHeight + Ur * 2 : 0;
3240
3258
  }
3241
3259
  function X(e) {
3242
3260
  let t = /* @__PURE__ */ new Map();
@@ -3258,7 +3276,7 @@ function $r(e) {
3258
3276
  } finally {
3259
3277
  d.value = null, ee = !1;
3260
3278
  }
3261
- }, Jr));
3279
+ }, Xr));
3262
3280
  }
3263
3281
  function de() {
3264
3282
  z &&= (clearTimeout(z), null);
@@ -3285,27 +3303,27 @@ function $r(e) {
3285
3303
  scrollViewportRef: t
3286
3304
  };
3287
3305
  }
3288
- function ei(e, t, n) {
3306
+ function ni(e, t, n) {
3289
3307
  return Math.min(Math.max(e, t), n);
3290
3308
  }
3291
- function ti(e) {
3309
+ function ri(e) {
3292
3310
  if (!e.active || !e.triggerEnabled) return 0;
3293
3311
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3294
- return t <= 0 ? 1 : ei(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3312
+ return t <= 0 ? 1 : ni(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3295
3313
  }
3296
- function ni(e) {
3314
+ function ii(e) {
3297
3315
  if (!e.active || !e.triggerEnabled) return 0;
3298
3316
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3299
- return t <= 0 ? 1 : ei(e.progressDistancePx / t, 0, 1);
3317
+ return t <= 0 ? 1 : ni(e.progressDistancePx / t, 0, 1);
3300
3318
  }
3301
3319
  //#endregion
3302
3320
  //#region src/components/viewer-core/listCardAsset.ts
3303
- function ri(e) {
3321
+ function ai(e) {
3304
3322
  if (e) try {
3305
3323
  e.removeAttribute("src"), e.src = "";
3306
3324
  } catch {}
3307
3325
  }
3308
- function ii(e) {
3326
+ function oi(e) {
3309
3327
  if (e) {
3310
3328
  try {
3311
3329
  e.currentTime = 0;
@@ -3316,12 +3334,12 @@ function ii(e) {
3316
3334
  } catch {}
3317
3335
  }
3318
3336
  }
3319
- function ai(e, t) {
3337
+ function si(e, t) {
3320
3338
  if (t) return e.bottom > t.top && e.top < t.bottom;
3321
3339
  let n = window.innerHeight || document.documentElement.clientHeight || 0;
3322
3340
  return e.bottom > 0 && e.top < n;
3323
3341
  }
3324
- function oi(e) {
3342
+ function ci(e) {
3325
3343
  if (!e) return null;
3326
3344
  try {
3327
3345
  return new URL(e, window.location.href).href;
@@ -3331,9 +3349,9 @@ function oi(e) {
3331
3349
  }
3332
3350
  //#endregion
3333
3351
  //#region src/components/viewer-core/listPreview.ts
3334
- var si = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, ci = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, li = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
3335
- function ui(e) {
3336
- let t = di(e), n = t?.url, r = fr(e), i = e.title?.trim() || kt(e.type);
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);
3337
3355
  return t?.mediaType === "video" && typeof n == "string" ? {
3338
3356
  kind: "video",
3339
3357
  url: n,
@@ -3352,13 +3370,13 @@ function ui(e) {
3352
3370
  width: r.width,
3353
3371
  height: r.height,
3354
3372
  label: i
3355
- } : typeof n == "string" && pi(e, n) ? {
3373
+ } : typeof n == "string" && hi(e, n) ? {
3356
3374
  kind: "video",
3357
3375
  url: n,
3358
3376
  width: r.width,
3359
3377
  height: r.height,
3360
3378
  label: i
3361
- } : typeof n == "string" && fi(e, n) ? {
3379
+ } : typeof n == "string" && mi(e, n) ? {
3362
3380
  kind: "image",
3363
3381
  url: n,
3364
3382
  width: r.width,
@@ -3372,26 +3390,26 @@ function ui(e) {
3372
3390
  label: i
3373
3391
  };
3374
3392
  }
3375
- function di(e) {
3393
+ function pi(e) {
3376
3394
  return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
3377
3395
  }
3378
- function fi(e, t) {
3379
- return e.type !== "image" || typeof t != "string" ? !1 : si.test(t) || mi(t);
3396
+ function mi(e, t) {
3397
+ return e.type !== "image" || typeof t != "string" ? !1 : li.test(t) || gi(t);
3380
3398
  }
3381
- function pi(e, t) {
3382
- return e.type !== "video" || typeof t != "string" ? !1 : ci.test(t) || hi(t);
3399
+ function hi(e, t) {
3400
+ return e.type !== "video" || typeof t != "string" ? !1 : ui.test(t) || _i(t);
3383
3401
  }
3384
- function mi(e) {
3402
+ function gi(e) {
3385
3403
  return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
3386
3404
  }
3387
- function hi(e) {
3388
- return li.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3405
+ function _i(e) {
3406
+ return di.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3389
3407
  }
3390
3408
  //#endregion
3391
3409
  //#region src/components/viewer-core/useListCardHealthCheck.ts
3392
- function gi(e) {
3410
+ function vi(e) {
3393
3411
  let t = D(null), n = i(() => {
3394
- let t = typeof e.item.value.healthCheck?.url == "string" ? oi(e.item.value.healthCheck.url) : null;
3412
+ let t = typeof e.item.value.healthCheck?.url == "string" ? ci(e.item.value.healthCheck.url) : null;
3395
3413
  return !t || t === e.attachedAssetUrl.value ? null : t;
3396
3414
  }), r = null, a = 0, o = /* @__PURE__ */ new Map();
3397
3415
  L(n, (e, n) => {
@@ -3433,7 +3451,7 @@ function gi(e) {
3433
3451
  return;
3434
3452
  }
3435
3453
  let i = ++a;
3436
- sn(r).then((s) => {
3454
+ ln(r).then((s) => {
3437
3455
  if (!(i !== a || n.value !== r)) {
3438
3456
  if (o.set(r, s ?? null), !s) {
3439
3457
  t.value = null;
@@ -3469,14 +3487,14 @@ function gi(e) {
3469
3487
  }
3470
3488
  //#endregion
3471
3489
  //#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
3472
- var _i = ["aria-label"], vi = {
3490
+ var yi = ["aria-label"], bi = {
3473
3491
  key: 0,
3474
3492
  "data-testid": "vibe-list-card-spinner",
3475
3493
  class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
3476
- }, yi = { 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]" }, bi = ["src", "alt"], xi = ["src"], Si = ["data-kind"], Ci = { class: "grid justify-items-center gap-3 px-4 text-center" }, wi = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Ti = {
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 = {
3477
3495
  key: 4,
3478
3496
  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))]"
3479
- }, Ei = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Di = { class: "pointer-events-none absolute inset-0 z-[3]" }, Oi = /* @__PURE__ */ d({
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({
3480
3498
  __name: "ListCard",
3481
3499
  props: {
3482
3500
  active: {
@@ -3500,7 +3518,7 @@ var _i = ["aria-label"], vi = {
3500
3518
  },
3501
3519
  emits: ["open"],
3502
3520
  setup(e, { emit: t }) {
3503
- let n = e, r = t, l = i(() => ui(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 = gi({
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({
3504
3522
  attachedAssetUrl: E,
3505
3523
  getPriority: X,
3506
3524
  isInView: d,
@@ -3509,7 +3527,7 @@ var _i = ["aria-label"], vi = {
3509
3527
  loadErrorKind: g,
3510
3528
  reportAssetError: n.reportAssetError,
3511
3529
  surfaceActive: i(() => n.surfaceActive)
3512
- }), 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();
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();
3513
3531
  L([E, () => l.value.kind], () => {
3514
3532
  let e = l.value.kind === "fallback";
3515
3533
  m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
@@ -3550,7 +3568,7 @@ var _i = ["aria-label"], vi = {
3550
3568
  if (!ue(_.value)) return;
3551
3569
  let e = E.value ?? n.item.url;
3552
3570
  m.value = !1, g.value = "generic";
3553
- let t = await on(e);
3571
+ let t = await cn(e);
3554
3572
  g.value = t, n.reportAssetError?.({
3555
3573
  item: n.item,
3556
3574
  occurrenceKey: $(n.item),
@@ -3599,7 +3617,7 @@ var _i = ["aria-label"], vi = {
3599
3617
  return;
3600
3618
  }
3601
3619
  if (E.value && d.value && m.value) {
3602
- e.muted = !0, e.loop = !0, e.playsInline = !0, un(e);
3620
+ e.muted = !0, e.loop = !0, e.playsInline = !0, fn(e);
3603
3621
  return;
3604
3622
  }
3605
3623
  try {
@@ -3620,7 +3638,7 @@ var _i = ["aria-label"], vi = {
3620
3638
  d.value = !0;
3621
3639
  return;
3622
3640
  }
3623
- d.value = ai(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
3641
+ d.value = si(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
3624
3642
  }
3625
3643
  function ie(e) {
3626
3644
  if (!e) return;
@@ -3640,10 +3658,10 @@ var _i = ["aria-label"], vi = {
3640
3658
  }), g.value = null, m.value = !1, T.value = !1, J(), K();
3641
3659
  }
3642
3660
  function se() {
3643
- ri(_.value);
3661
+ ai(_.value);
3644
3662
  }
3645
3663
  function ce() {
3646
- ii(C.value);
3664
+ oi(C.value);
3647
3665
  }
3648
3666
  function X() {
3649
3667
  let e = y.value;
@@ -3657,8 +3675,8 @@ var _i = ["aria-label"], vi = {
3657
3675
  return Math.abs((t.top + t.bottom) / 2 - n);
3658
3676
  }
3659
3677
  function ue(e) {
3660
- let t = oi(E.value);
3661
- return !e || !t ? !1 : oi("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3678
+ let t = ci(E.value);
3679
+ return !e || !t ? !1 : ci("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3662
3680
  }
3663
3681
  function de() {
3664
3682
  r("open");
@@ -3686,8 +3704,8 @@ var _i = ["aria-label"], vi = {
3686
3704
  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]",
3687
3705
  "aria-label": n.item.title || `Open item ${n.index + 1}`,
3688
3706
  onClick: de
3689
- }, null, 8, _i),
3690
- B.value ? (w(), s("div", vi, [c("span", yi, [u(N(oe), {
3707
+ }, null, 8, yi),
3708
+ B.value ? (w(), s("div", bi, [c("span", xi, [u(N(oe), {
3691
3709
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
3692
3710
  "aria-hidden": "true"
3693
3711
  })])])) : o("", !0),
@@ -3701,7 +3719,7 @@ var _i = ["aria-label"], vi = {
3701
3719
  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"]),
3702
3720
  onLoad: U,
3703
3721
  onError: W
3704
- }, null, 42, bi)) : P.value && E.value && !R.value ? (w(), s("video", {
3722
+ }, null, 42, Si)) : P.value && E.value && !R.value ? (w(), s("video", {
3705
3723
  key: 2,
3706
3724
  ref_key: "videoRef",
3707
3725
  ref: C,
@@ -3717,31 +3735,31 @@ var _i = ["aria-label"], vi = {
3717
3735
  onPlaying: ne,
3718
3736
  onStalled: G,
3719
3737
  onWaiting: G
3720
- }, null, 42, xi)) : R.value ? (w(), s("div", {
3738
+ }, null, 42, Ci)) : R.value ? (w(), s("div", {
3721
3739
  key: 3,
3722
3740
  "data-testid": "vibe-list-card-error",
3723
3741
  "data-kind": I.value,
3724
3742
  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))]"
3725
- }, [c("div", Ci, [
3743
+ }, [c("div", Ti, [
3726
3744
  u(N(le), {
3727
3745
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3728
3746
  "aria-hidden": "true"
3729
3747
  }),
3730
- c("span", wi, j(N(rn)(I.value)), 1),
3748
+ c("span", Ei, j(N(on)(I.value)), 1),
3731
3749
  z.value ? (w(), s("button", {
3732
3750
  key: 0,
3733
3751
  type: "button",
3734
3752
  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",
3735
3753
  onClick: ee(ae, ["stop"])
3736
3754
  }, " Retry ")) : o("", !0)
3737
- ])], 8, Si)) : (w(), s("div", Ti, [c("div", Ei, [k(e.$slots, "item-icon", {
3755
+ ])], 8, wi)) : (w(), s("div", Di, [c("div", Oi, [k(e.$slots, "item-icon", {
3738
3756
  icon: N(Ot)(n.item.type),
3739
3757
  item: n.item
3740
3758
  }, () => [(w(), a(A(N(Ot)(n.item.type)), {
3741
3759
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3742
3760
  "aria-hidden": "true"
3743
3761
  }))])])])),
3744
- c("div", Di, [k(e.$slots, "grid-item-overlay", {
3762
+ c("div", ki, [k(e.$slots, "grid-item-overlay", {
3745
3763
  active: n.active,
3746
3764
  focused: f.value,
3747
3765
  hovered: p.value,
@@ -3751,24 +3769,24 @@ var _i = ["aria-label"], vi = {
3751
3769
  })])
3752
3770
  ], 34));
3753
3771
  }
3754
- }), ki = { 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)]" }, Ai = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, ji = {
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 = {
3755
3773
  "data-testid": "vibe-pagination",
3756
3774
  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]"
3757
- }, Mi = { class: "whitespace-nowrap" }, Ni = {
3775
+ }, Pi = { class: "whitespace-nowrap" }, Fi = {
3758
3776
  key: 0,
3759
3777
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
3760
- }, Pi = [
3778
+ }, Ii = [
3761
3779
  "data-active",
3762
3780
  "data-index",
3763
3781
  "data-item-id",
3764
3782
  "data-occurrence-key"
3765
- ], Fi = ["data-item-id"], Ii = {
3783
+ ], Li = ["data-item-id"], Ri = {
3766
3784
  key: 0,
3767
3785
  class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
3768
- }, Li = {
3786
+ }, zi = {
3769
3787
  key: 1,
3770
3788
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
3771
- }, Ri = { class: "mx-auto flex w-full justify-center" }, zi = /* @__PURE__ */ d({
3789
+ }, Bi = { class: "mx-auto flex w-full justify-center" }, Vi = /* @__PURE__ */ d({
3772
3790
  __name: "ListSurface",
3773
3791
  props: {
3774
3792
  active: {
@@ -3829,7 +3847,7 @@ var _i = ["aria-label"], vi = {
3829
3847
  "update:activeIndex"
3830
3848
  ],
3831
3849
  setup(e, { emit: n }) {
3832
- let r = e, d = F(), f = n, p = $r({
3850
+ let r = e, d = F(), f = n, p = ti({
3833
3851
  active: M(r, "active"),
3834
3852
  allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
3835
3853
  items: M(r, "items"),
@@ -3845,11 +3863,11 @@ var _i = ["aria-label"], vi = {
3845
3863
  setActiveIndex(e) {
3846
3864
  f("update:activeIndex", e);
3847
3865
  }
3848
- }), m = i(() => Jt({
3866
+ }), m = i(() => Xt({
3849
3867
  itemCount: r.items.length,
3850
3868
  loading: r.loading,
3851
3869
  phase: r.phase
3852
- })), h = i(() => Yt({
3870
+ })), h = i(() => Zt({
3853
3871
  errorMessage: r.errorMessage,
3854
3872
  hasItems: r.items.length > 0,
3855
3873
  hasNextPage: r.hasNextPage,
@@ -3862,7 +3880,7 @@ var _i = ["aria-label"], vi = {
3862
3880
  message: h.value.message,
3863
3881
  paginationDetail: r.paginationDetail,
3864
3882
  total: r.items.length
3865
- }), 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({
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({
3866
3884
  emptyStateMode: M(r, "emptyStateMode"),
3867
3885
  itemCount: C,
3868
3886
  loading: M(r, "loading"),
@@ -3874,8 +3892,8 @@ var _i = ["aria-label"], vi = {
3874
3892
  nextBoundaryLoadProgress: e,
3875
3893
  previousBoundaryLoadProgress: t
3876
3894
  });
3877
- }, { immediate: !0 }), (e, n) => (w(), s("div", ki, [
3878
- c("div", Ai, [c("span", ji, [c("span", Mi, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Ni, j(r.paginationDetail), 1)) : o("", !0)])]),
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)])]),
3879
3897
  c("div", {
3880
3898
  ref: N(p).scrollViewportRef,
3881
3899
  "data-testid": "vibe-list-scroll",
@@ -3896,7 +3914,7 @@ var _i = ["aria-label"], vi = {
3896
3914
  "data-occurrence-key": N($)(t),
3897
3915
  class: "absolute will-change-transform",
3898
3916
  style: b(N(p).getCardStyle(n))
3899
- }, [u(Oi, {
3917
+ }, [u(Ai, {
3900
3918
  active: n === N(p).resolvedActiveIndex.value,
3901
3919
  index: n,
3902
3920
  item: t,
@@ -3920,14 +3938,14 @@ var _i = ["aria-label"], vi = {
3920
3938
  "report-asset-load",
3921
3939
  "surface-active",
3922
3940
  "onOpen"
3923
- ])], 12, Pi))), 128)),
3941
+ ])], 12, Ii))), 128)),
3924
3942
  (w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
3925
3943
  key: `leaving-${N($)(t.item)}`,
3926
3944
  "data-testid": "vibe-list-card-leaving",
3927
3945
  "data-item-id": t.item.id,
3928
3946
  class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
3929
3947
  style: b(N(p).getLeavingCardStyle(t.item))
3930
- }, [u(Oi, {
3948
+ }, [u(Ai, {
3931
3949
  active: !1,
3932
3950
  index: -1,
3933
3951
  item: t.item,
@@ -3942,8 +3960,8 @@ var _i = ["aria-label"], vi = {
3942
3960
  "item",
3943
3961
  "report-asset-error",
3944
3962
  "report-asset-load"
3945
- ])], 12, Fi))), 128)),
3946
- N(A) && N(T) ? (w(), a(Dn, {
3963
+ ])], 12, Li))), 128)),
3964
+ N(A) && N(T) ? (w(), a(kn, {
3947
3965
  key: 0,
3948
3966
  message: N(T).message,
3949
3967
  mode: N(T).mode,
@@ -3957,12 +3975,12 @@ var _i = ["aria-label"], vi = {
3957
3975
  "surface"
3958
3976
  ])) : o("", !0)
3959
3977
  ], 4)], 544),
3960
- N(p).showScrollbar.value ? (w(), s("div", Ii, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
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", {
3961
3979
  "data-testid": "vibe-list-scrollbar-thumb",
3962
3980
  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"]),
3963
3981
  style: b(N(p).getScrollbarThumbStyle())
3964
3982
  }, null, 6)])) : o("", !0),
3965
- d["grid-footer"] ? (w(), s("div", Li, [c("div", Ri, [k(e.$slots, "grid-footer")])])) : o("", !0),
3983
+ d["grid-footer"] ? (w(), s("div", zi, [c("div", Bi, [k(e.$slots, "grid-footer")])])) : o("", !0),
3966
3984
  _.value ? (w(), s("div", {
3967
3985
  key: 2,
3968
3986
  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"])
@@ -3971,7 +3989,7 @@ var _i = ["aria-label"], vi = {
3971
3989
  "data-testid": "vibe-grid-status-badge",
3972
3990
  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" : ""])
3973
3991
  }, j(_.value.message), 3))], 2)) : o("", !0),
3974
- N(E) && N(T) ? (w(), a(Dn, {
3992
+ N(E) && N(T) ? (w(), a(kn, {
3975
3993
  key: 3,
3976
3994
  class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
3977
3995
  message: N(T).message,
@@ -3988,13 +4006,13 @@ var _i = ["aria-label"], vi = {
3988
4006
  ])) : o("", !0)
3989
4007
  ]));
3990
4008
  }
3991
- }), Bi = ["data-surface-mode"], Vi = {
4009
+ }), Hi = ["data-surface-mode"], Ui = {
3992
4010
  key: 1,
3993
4011
  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"
3994
- }, Hi = ["data-visible", "inert"], Ui = ["data-visible", "inert"], Wi = {
4012
+ }, Wi = ["data-visible", "inert"], Gi = ["data-visible", "inert"], Ki = {
3995
4013
  key: 3,
3996
4014
  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"
3997
- }, Gi = /* @__PURE__ */ d({
4015
+ }, qi = /* @__PURE__ */ d({
3998
4016
  name: "VibeLayout",
3999
4017
  __name: "Layout",
4000
4018
  props: {
@@ -4048,7 +4066,7 @@ var _i = ["aria-label"], vi = {
4048
4066
  type: "button",
4049
4067
  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",
4050
4068
  onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
4051
- }, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Vi, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
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, {
4052
4070
  appear: "",
4053
4071
  "enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
4054
4072
  "enter-from-class": "translate-y-3 opacity-0",
@@ -4062,7 +4080,7 @@ var _i = ["aria-label"], vi = {
4062
4080
  "data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
4063
4081
  inert: N(h).surfaceMode.value !== "list",
4064
4082
  class: "absolute inset-0 z-[2]"
4065
- }, [u(zi, {
4083
+ }, [u(Vi, {
4066
4084
  active: N(h).surfaceMode.value === "list",
4067
4085
  "allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
4068
4086
  items: N(h).items.value,
@@ -4132,7 +4150,7 @@ var _i = ["aria-label"], vi = {
4132
4150
  "onBoundaryLoadProgress",
4133
4151
  "onOpenFullscreen",
4134
4152
  "onUpdate:activeIndex"
4135
- ])], 8, Hi), [[I, N(h).surfaceMode.value === "list"]])]),
4153
+ ])], 8, Wi), [[I, N(h).surfaceMode.value === "list"]])]),
4136
4154
  _: 3
4137
4155
  }), u(r, {
4138
4156
  appear: "",
@@ -4148,7 +4166,7 @@ var _i = ["aria-label"], vi = {
4148
4166
  "data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
4149
4167
  inert: N(h).surfaceMode.value !== "fullscreen",
4150
4168
  class: "absolute inset-0 z-[3]"
4151
- }, [u(lr, {
4169
+ }, [u(dr, {
4152
4170
  items: N(h).items.value,
4153
4171
  active: N(h).surfaceMode.value === "fullscreen",
4154
4172
  "active-index": N(h).activeIndex.value,
@@ -4217,12 +4235,12 @@ var _i = ["aria-label"], vi = {
4217
4235
  "show-back-to-list",
4218
4236
  "onBackToList",
4219
4237
  "onUpdate:activeIndex"
4220
- ])], 8, Ui), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
4238
+ ])], 8, Gi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
4221
4239
  _: 3
4222
- })], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Wi, [u(N(oe), {
4240
+ })], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Ki, [u(N(oe), {
4223
4241
  class: "size-10 animate-spin text-[#f7f1ea]/82",
4224
4242
  "aria-hidden": "true"
4225
- }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(lr, {
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, {
4226
4244
  key: 4,
4227
4245
  items: N(h).items.value,
4228
4246
  active: !0,
@@ -4290,10 +4308,10 @@ var _i = ["aria-label"], vi = {
4290
4308
  "show-status-badges",
4291
4309
  "onBackToList",
4292
4310
  "onUpdate:activeIndex"
4293
- ]))], 8, Bi));
4311
+ ]))], 8, Hi));
4294
4312
  }
4295
- }), Ki = { install(e) {
4296
- e.component("VibeLayout", Gi);
4313
+ }), Ji = { install(e) {
4314
+ e.component("VibeLayout", qi);
4297
4315
  } };
4298
4316
  //#endregion
4299
- export { Gi as VibeLayout, Ki as VibePlugin, Ki as default };
4317
+ export { qi as VibeLayout, Ji as VibePlugin, Ji as default };