@hadoku/watchparty-ui 0.44.8 → 0.44.9
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/dist/chunks/{AdminPanel-Bwn6LIOC.js → AdminPanel-CfOBoGAb.js} +4 -4
- package/dist/chunks/{AdminPanel-Bwn6LIOC.js.map → AdminPanel-CfOBoGAb.js.map} +1 -1
- package/dist/chunks/{CharacterModal-BHb04Fee.js → CharacterModal-B6cG2NmX.js} +2 -2
- package/dist/chunks/{CharacterModal-BHb04Fee.js.map → CharacterModal-B6cG2NmX.js.map} +1 -1
- package/dist/chunks/{GameModule-D2TSoCac.js → GameModule-CrRHc04o.js} +4 -4
- package/dist/chunks/{GameModule-D2TSoCac.js.map → GameModule-CrRHc04o.js.map} +1 -1
- package/dist/chunks/{MapEditor-Dd3OijeD.js → MapEditor-Bvr-tvKQ.js} +2 -2
- package/dist/chunks/{MapEditor-Dd3OijeD.js.map → MapEditor-Bvr-tvKQ.js.map} +1 -1
- package/dist/chunks/{MediaDrawer-Bq4rhXGa.js → MediaDrawer-CY__KXu5.js} +4 -4
- package/dist/chunks/{MediaDrawer-Bq4rhXGa.js.map → MediaDrawer-CY__KXu5.js.map} +1 -1
- package/dist/chunks/{PlaylistPanel-BOU78K3d.js → PlaylistPanel-hV9B8oQl.js} +3 -3
- package/dist/chunks/{PlaylistPanel-BOU78K3d.js.map → PlaylistPanel-hV9B8oQl.js.map} +1 -1
- package/dist/chunks/{Room-DXyTphDD.js → Room-B6ODdfkE.js} +4 -4
- package/dist/chunks/{Room-DXyTphDD.js.map → Room-B6ODdfkE.js.map} +1 -1
- package/dist/chunks/{index-D8nwgvG0.js → index-CFH_9amZ.js} +423 -421
- package/dist/chunks/index-CFH_9amZ.js.map +1 -0
- package/dist/chunks/{submissionsApi-BHPcbZrP.js → submissionsApi-BsiozhpM.js} +2 -2
- package/dist/chunks/{submissionsApi-BHPcbZrP.js.map → submissionsApi-BsiozhpM.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/room-chrome.js +258 -256
- package/dist/room-chrome.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/index-D8nwgvG0.js.map +0 -1
package/dist/room-chrome.js
CHANGED
|
@@ -484,32 +484,36 @@ const nn = [
|
|
|
484
484
|
]
|
|
485
485
|
}
|
|
486
486
|
], yt = 8, rt = nn.flatMap((e) => e.characters), Le = rt.map((e) => e.id), fr = Object.fromEntries(rt.map((e) => [e.id, e.color])), hr = Object.fromEntries(rt.map((e) => [e.id, "rev" in e ? e.rev : 1]));
|
|
487
|
+
function gr(e) {
|
|
488
|
+
const t = hr[e];
|
|
489
|
+
return `/media/sprites/square_${e}.png${t > 1 ? `?v=${t}` : ""}`;
|
|
490
|
+
}
|
|
487
491
|
function fe(e) {
|
|
488
492
|
return !!e && Le.includes(e);
|
|
489
493
|
}
|
|
490
|
-
const
|
|
491
|
-
function yr(e) {
|
|
492
|
-
return typeof e == "string" && br.includes(e);
|
|
493
|
-
}
|
|
494
|
+
const br = 5e3, rn = { mode: "off", percent: 0 }, yr = ["off", "on", "ab"];
|
|
494
495
|
function vr(e) {
|
|
495
|
-
|
|
496
|
-
return { mode: n, percent: i };
|
|
496
|
+
return typeof e == "string" && yr.includes(e);
|
|
497
497
|
}
|
|
498
498
|
function Sr(e) {
|
|
499
|
+
const t = e && typeof e == "object" ? e : {}, n = vr(t.mode) ? t.mode : rn.mode, o = Number(t.percent), i = Number.isFinite(o) ? Math.min(100, Math.max(0, Math.round(o))) : 0;
|
|
500
|
+
return { mode: n, percent: i };
|
|
501
|
+
}
|
|
502
|
+
function wr(e) {
|
|
499
503
|
let t = 2166136261;
|
|
500
504
|
for (let n = 0; n < e.length; n++)
|
|
501
505
|
t ^= e.charCodeAt(n), t = Math.imul(t, 16777619) >>> 0;
|
|
502
506
|
return t >>> 0;
|
|
503
507
|
}
|
|
504
|
-
function
|
|
508
|
+
function _r(e, t, n) {
|
|
505
509
|
if (n === !0)
|
|
506
510
|
return "fragment";
|
|
507
511
|
if (n === !1)
|
|
508
512
|
return "range";
|
|
509
|
-
const o =
|
|
510
|
-
return o.mode === "on" ? "fragment" : o.mode === "off" || o.percent <= 0 ? "range" : o.percent >= 100 || t &&
|
|
513
|
+
const o = Sr(e);
|
|
514
|
+
return o.mode === "on" ? "fragment" : o.mode === "off" || o.percent <= 0 ? "range" : o.percent >= 100 || t && wr(t) % 100 < o.percent ? "fragment" : "range";
|
|
511
515
|
}
|
|
512
|
-
const on = r.enum(["url", "magnet", "upload"]),
|
|
516
|
+
const on = r.enum(["url", "magnet", "upload"]), xr = r.enum([
|
|
513
517
|
"pending",
|
|
514
518
|
"approved",
|
|
515
519
|
"fetching",
|
|
@@ -527,7 +531,7 @@ const on = r.enum(["url", "magnet", "upload"]), _r = r.enum([
|
|
|
527
531
|
failed: ["approved"]
|
|
528
532
|
};
|
|
529
533
|
Object.keys(vt).filter((e) => vt[e].length === 0);
|
|
530
|
-
const
|
|
534
|
+
const Cr = r.object({
|
|
531
535
|
id: r.string().min(1),
|
|
532
536
|
/** Stable userId from whoami. Never the raw `X-User-Key`. */
|
|
533
537
|
ownerUserId: r.string().min(1),
|
|
@@ -546,7 +550,7 @@ const xr = r.object({
|
|
|
546
550
|
* misroute the copy.
|
|
547
551
|
*/
|
|
548
552
|
series: r.string().optional(),
|
|
549
|
-
state:
|
|
553
|
+
state: xr,
|
|
550
554
|
createdAt: r.number().int().nonnegative(),
|
|
551
555
|
updatedAt: r.number().int().nonnegative(),
|
|
552
556
|
/** Why it failed, or why an operator rejected it. */
|
|
@@ -554,19 +558,19 @@ const xr = r.object({
|
|
|
554
558
|
/** Size once known. 0 means "known to be empty"; absent means "not yet known" —
|
|
555
559
|
* the same distinction `chatImages` draws for image dimensions. */
|
|
556
560
|
bytes: r.number().int().nonnegative().optional()
|
|
557
|
-
}),
|
|
561
|
+
}), kr = 4096, an = 300, Ir = 100;
|
|
558
562
|
r.object({
|
|
559
563
|
kind: on,
|
|
560
|
-
source: r.string().min(1).max(
|
|
564
|
+
source: r.string().min(1).max(kr),
|
|
561
565
|
title: r.string().min(1).max(an).optional(),
|
|
562
566
|
/** Required for `kind: 'magnet'` by `checkSource`; ignored for `url`/`upload`. */
|
|
563
|
-
series: r.string().min(1).max(
|
|
567
|
+
series: r.string().min(1).max(Ir).optional()
|
|
564
568
|
});
|
|
565
569
|
r.object({
|
|
566
570
|
reason: r.string().min(1).max(an).optional()
|
|
567
571
|
});
|
|
568
572
|
r.object({
|
|
569
|
-
submissions: r.array(
|
|
573
|
+
submissions: r.array(Cr)
|
|
570
574
|
});
|
|
571
575
|
r.object({
|
|
572
576
|
error: r.literal("submissions/quota_exceeded"),
|
|
@@ -575,8 +579,8 @@ r.object({
|
|
|
575
579
|
/** The cap that was applied, from the server's config. */
|
|
576
580
|
capBytes: r.number().int().nonnegative()
|
|
577
581
|
});
|
|
578
|
-
const
|
|
579
|
-
function
|
|
582
|
+
const Tr = /^[a-z0-9][a-z0-9-]{0,31}$/, St = "https://game-catalog.invalid";
|
|
583
|
+
function Er(e) {
|
|
580
584
|
if (!e.startsWith("/") || e.startsWith("//") || /[\\\s]/.test(e) || [...e].some((t) => t.charCodeAt(0) < 32 || t.charCodeAt(0) === 127))
|
|
581
585
|
return !1;
|
|
582
586
|
try {
|
|
@@ -585,18 +589,18 @@ function Tr(e) {
|
|
|
585
589
|
return !1;
|
|
586
590
|
}
|
|
587
591
|
}
|
|
588
|
-
const sn = r.string().min(2).max(512).refine(
|
|
592
|
+
const sn = r.string().min(2).max(512).refine(Er, {
|
|
589
593
|
message: "must be a root-relative path on the page origin (e.g. /cardtable/embed/x.js)"
|
|
590
594
|
}), wt = {
|
|
591
|
-
id: r.string().regex(
|
|
595
|
+
id: r.string().regex(Tr),
|
|
592
596
|
name: r.string().min(1).max(64),
|
|
593
597
|
cover: sn.optional()
|
|
594
|
-
},
|
|
598
|
+
}, Ar = r.discriminatedUnion("kind", [
|
|
595
599
|
r.object({ ...wt, kind: r.literal("iframe") }).strict(),
|
|
596
600
|
r.object({ ...wt, kind: r.literal("module"), url: sn }).strict()
|
|
597
601
|
]);
|
|
598
|
-
r.array(
|
|
599
|
-
const ot = r.enum(["anilist", "tmdb"]),
|
|
602
|
+
r.array(Ar).max(32).refine((e) => new Set(e.map((t) => t.id)).size === e.length, { message: "game ids must be unique" });
|
|
603
|
+
const ot = r.enum(["anilist", "tmdb"]), Nr = r.object({
|
|
600
604
|
source: ot,
|
|
601
605
|
/** The provider's own id, as a string (AniList and TMDB both use integers). */
|
|
602
606
|
id: r.string(),
|
|
@@ -618,11 +622,11 @@ const ot = r.enum(["anilist", "tmdb"]), Ar = r.object({
|
|
|
618
622
|
addable: r.boolean()
|
|
619
623
|
});
|
|
620
624
|
r.object({
|
|
621
|
-
results: r.array(
|
|
625
|
+
results: r.array(Nr),
|
|
622
626
|
/** Providers that answered. TMDB is absent when no token is configured. */
|
|
623
627
|
sources: r.array(ot)
|
|
624
628
|
});
|
|
625
|
-
const
|
|
629
|
+
const Pr = r.object({
|
|
626
630
|
id: r.string(),
|
|
627
631
|
url: r.string(),
|
|
628
632
|
title: r.string(),
|
|
@@ -630,14 +634,14 @@ const Nr = r.object({
|
|
|
630
634
|
durationS: r.number().nullable(),
|
|
631
635
|
thumb: r.string().nullable()
|
|
632
636
|
});
|
|
633
|
-
r.object({ results: r.array(
|
|
637
|
+
r.object({ results: r.array(Pr) });
|
|
634
638
|
r.object({
|
|
635
639
|
source: ot,
|
|
636
640
|
id: r.string().regex(/^\d{1,12}$/)
|
|
637
641
|
});
|
|
638
642
|
r.object({ series: r.string(), title: r.string() });
|
|
639
643
|
let ve = null, ln = qt;
|
|
640
|
-
function
|
|
644
|
+
function Mr(e) {
|
|
641
645
|
e.cdnBase && (ln = e.cdnBase);
|
|
642
646
|
}
|
|
643
647
|
function cn() {
|
|
@@ -650,7 +654,7 @@ function je() {
|
|
|
650
654
|
function Pe(e) {
|
|
651
655
|
return !et(e) || !cn() ? null : je().urlFor(e);
|
|
652
656
|
}
|
|
653
|
-
function
|
|
657
|
+
function Or(e) {
|
|
654
658
|
return e.kind === "file";
|
|
655
659
|
}
|
|
656
660
|
class dn extends Error {
|
|
@@ -678,42 +682,42 @@ function ke(e) {
|
|
|
678
682
|
return "Image upload failed";
|
|
679
683
|
}
|
|
680
684
|
}
|
|
681
|
-
function
|
|
685
|
+
function Rr(e) {
|
|
682
686
|
return e instanceof ze ? ke(e.reason) : e instanceof dn ? e.message : "Image upload failed";
|
|
683
687
|
}
|
|
684
|
-
function
|
|
688
|
+
function Dr(e) {
|
|
685
689
|
const t = e.type.toLowerCase().split(";")[0].trim();
|
|
686
690
|
return t && Un(t) !== "image" ? ke("unsupported-type") : e.size > Fn.image ? ke("too-large") : e.size === 0 ? ke("invalid") : null;
|
|
687
691
|
}
|
|
688
|
-
function
|
|
692
|
+
function Lr(e) {
|
|
689
693
|
return $n(e);
|
|
690
694
|
}
|
|
691
|
-
function
|
|
695
|
+
function jr(e) {
|
|
692
696
|
return Bn(e);
|
|
693
697
|
}
|
|
694
|
-
async function
|
|
698
|
+
async function Ur(e) {
|
|
695
699
|
const t = await Hn(e);
|
|
696
700
|
return { w: t?.width ?? 0, h: t?.height ?? 0 };
|
|
697
701
|
}
|
|
698
|
-
async function
|
|
702
|
+
async function Fr(e, t = {}) {
|
|
699
703
|
const n = await je().upload(e, { signal: t.signal });
|
|
700
704
|
if (!et(n.key))
|
|
701
705
|
throw new dn("Image upload returned an unusable key");
|
|
702
706
|
return { key: n.key, deduplicated: n.deduplicated === !0 };
|
|
703
707
|
}
|
|
704
|
-
async function
|
|
708
|
+
async function Hr(e, t = {}) {
|
|
705
709
|
const n = [];
|
|
706
710
|
for (const o of e) {
|
|
707
711
|
if (o.kind === "remote") {
|
|
708
712
|
n.push({ key: o.key, w: o.w, h: o.h, ...o.title ? { title: o.title } : {} });
|
|
709
713
|
continue;
|
|
710
714
|
}
|
|
711
|
-
const { key: i } = await
|
|
715
|
+
const { key: i } = await Fr(o.file, t);
|
|
712
716
|
n.push({ key: i, w: o.w, h: o.h });
|
|
713
717
|
}
|
|
714
718
|
return n;
|
|
715
719
|
}
|
|
716
|
-
function
|
|
720
|
+
function $r(e) {
|
|
717
721
|
return {
|
|
718
722
|
error: e instanceof Error ? e.message : String(e),
|
|
719
723
|
name: e instanceof Error ? e.name : typeof e,
|
|
@@ -721,16 +725,16 @@ function Hr(e) {
|
|
|
721
725
|
status: e instanceof ze ? e.status : void 0
|
|
722
726
|
};
|
|
723
727
|
}
|
|
724
|
-
const Ye = 240, Z = 8,
|
|
725
|
-
function
|
|
728
|
+
const Ye = 240, Z = 8, Br = 28, un = 240;
|
|
729
|
+
function Gr(e, t, n) {
|
|
726
730
|
let o = t.left - Ye - Z;
|
|
727
731
|
o < Z && (o = t.right + Z), o = Math.min(o, n.width - Ye - Z), o = Math.max(Z, o);
|
|
728
|
-
const i = un +
|
|
732
|
+
const i = un + Br;
|
|
729
733
|
let s = e.top + e.height / 2 - i / 2;
|
|
730
734
|
return s = Math.min(s, n.height - i - Z), s = Math.max(Z, s), { left: o, top: s };
|
|
731
735
|
}
|
|
732
|
-
const mn = "/dataplatform/api/memes",
|
|
733
|
-
function
|
|
736
|
+
const mn = "/dataplatform/api/memes", Wr = 120;
|
|
737
|
+
function Kr({ onClose: e, onPick: t, onUnavailable: n }) {
|
|
734
738
|
const [o, i] = P(""), s = J(null), a = J(null), c = je(), { items: f, loading: g, error: p, hasMore: D, loadMore: M } = Xn(
|
|
735
739
|
c,
|
|
736
740
|
mn,
|
|
@@ -748,12 +752,12 @@ function Wr({ onClose: e, onPick: t, onUnavailable: n }) {
|
|
|
748
752
|
if (!F) return;
|
|
749
753
|
const W = () => _({
|
|
750
754
|
item: S,
|
|
751
|
-
...
|
|
755
|
+
...Gr(R.getBoundingClientRect(), F.getBoundingClientRect(), {
|
|
752
756
|
width: window.innerWidth,
|
|
753
757
|
height: window.innerHeight
|
|
754
758
|
})
|
|
755
759
|
});
|
|
756
|
-
k(), L ? W() : w.current = window.setTimeout(W,
|
|
760
|
+
k(), L ? W() : w.current = window.setTimeout(W, Wr);
|
|
757
761
|
},
|
|
758
762
|
[k]
|
|
759
763
|
);
|
|
@@ -895,8 +899,8 @@ function Wr({ onClose: e, onPick: t, onUnavailable: n }) {
|
|
|
895
899
|
}
|
|
896
900
|
);
|
|
897
901
|
}
|
|
898
|
-
function
|
|
899
|
-
return e ? /* @__PURE__ */ l(
|
|
902
|
+
function qr({ open: e, ...t }) {
|
|
903
|
+
return e ? /* @__PURE__ */ l(Kr, { ...t }) : null;
|
|
900
904
|
}
|
|
901
905
|
const it = {
|
|
902
906
|
serverOrigin: `http://localhost:${tt}`,
|
|
@@ -904,17 +908,17 @@ const it = {
|
|
|
904
908
|
cdnBase: qt
|
|
905
909
|
};
|
|
906
910
|
let Ie = { ...it };
|
|
907
|
-
function
|
|
911
|
+
function Vr(e) {
|
|
908
912
|
const t = Object.fromEntries(
|
|
909
913
|
Object.entries(e).filter(([n, o]) => o !== void 0)
|
|
910
914
|
);
|
|
911
|
-
Ie = { ...Ie, ...t },
|
|
915
|
+
Ie = { ...Ie, ...t }, Mr({ cdnBase: Ie.cdnBase });
|
|
912
916
|
}
|
|
913
917
|
function he() {
|
|
914
918
|
return Ie;
|
|
915
919
|
}
|
|
916
920
|
const pn = Gt(it);
|
|
917
|
-
function
|
|
921
|
+
function zr() {
|
|
918
922
|
return Wt(pn);
|
|
919
923
|
}
|
|
920
924
|
function fn(e) {
|
|
@@ -924,7 +928,7 @@ function hn() {
|
|
|
924
928
|
return fn(he());
|
|
925
929
|
}
|
|
926
930
|
const gn = Gt(null);
|
|
927
|
-
function
|
|
931
|
+
function Yr() {
|
|
928
932
|
return Wt(gn);
|
|
929
933
|
}
|
|
930
934
|
const oe = {
|
|
@@ -955,7 +959,7 @@ function at(e, t) {
|
|
|
955
959
|
return !1;
|
|
956
960
|
}
|
|
957
961
|
}
|
|
958
|
-
function
|
|
962
|
+
function Xr() {
|
|
959
963
|
try {
|
|
960
964
|
const e = Ue();
|
|
961
965
|
if (!e) return [];
|
|
@@ -975,7 +979,7 @@ function Me(e) {
|
|
|
975
979
|
} catch {
|
|
976
980
|
}
|
|
977
981
|
}
|
|
978
|
-
function
|
|
982
|
+
function Jr(e) {
|
|
979
983
|
const t = G(e);
|
|
980
984
|
return t === null ? null : t === "true" ? !0 : t === "false" ? !1 : null;
|
|
981
985
|
}
|
|
@@ -984,16 +988,16 @@ let yn = !1;
|
|
|
984
988
|
function Fe(e, t) {
|
|
985
989
|
bn.set(e, t), yn && vn(e, t);
|
|
986
990
|
}
|
|
987
|
-
function
|
|
991
|
+
function Zr() {
|
|
988
992
|
yn = !0;
|
|
989
993
|
for (const [e, t] of bn) vn(e, t);
|
|
990
994
|
}
|
|
991
995
|
function vn(e, t) {
|
|
992
996
|
typeof window > "u" || (window[e] = t);
|
|
993
997
|
}
|
|
994
|
-
const de = [],
|
|
998
|
+
const de = [], Qr = 500;
|
|
995
999
|
let Te = [], Xe = null;
|
|
996
|
-
const
|
|
1000
|
+
const eo = 1e3, to = 200;
|
|
997
1001
|
let Je = null;
|
|
998
1002
|
function Sn(e) {
|
|
999
1003
|
Je = e;
|
|
@@ -1001,19 +1005,19 @@ function Sn(e) {
|
|
|
1001
1005
|
function wn() {
|
|
1002
1006
|
return G(oe.REPORT_LOGS_FLAG) === "true";
|
|
1003
1007
|
}
|
|
1004
|
-
function
|
|
1008
|
+
function no() {
|
|
1005
1009
|
if (typeof window > "u") return !1;
|
|
1006
1010
|
if (window.__WP_DEBUG__ || new URLSearchParams(window.location.search).get("debug") === "true") return !0;
|
|
1007
1011
|
const t = G(oe.DEBUG_FLAG);
|
|
1008
1012
|
return t !== null && t !== "false";
|
|
1009
1013
|
}
|
|
1010
|
-
function
|
|
1014
|
+
function ro() {
|
|
1011
1015
|
const e = G(oe.DEBUG_FLAG);
|
|
1012
1016
|
if (!e || e === "true") return null;
|
|
1013
1017
|
const t = e.split(",").map((n) => n.trim().toLowerCase()).filter(Boolean);
|
|
1014
1018
|
return t.length > 0 ? new Set(t) : null;
|
|
1015
1019
|
}
|
|
1016
|
-
function
|
|
1020
|
+
function oo() {
|
|
1017
1021
|
return (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
|
|
1018
1022
|
hour12: !1,
|
|
1019
1023
|
hour: "2-digit",
|
|
@@ -1022,8 +1026,8 @@ function ro() {
|
|
|
1022
1026
|
fractionalSecondDigits: 3
|
|
1023
1027
|
});
|
|
1024
1028
|
}
|
|
1025
|
-
function
|
|
1026
|
-
de.push(e), de.length >
|
|
1029
|
+
function io(e) {
|
|
1030
|
+
de.push(e), de.length > Qr && de.shift();
|
|
1027
1031
|
}
|
|
1028
1032
|
const $e = {
|
|
1029
1033
|
debug: "color: #64748b; font-weight: normal;",
|
|
@@ -1032,7 +1036,7 @@ const $e = {
|
|
|
1032
1036
|
category: "color: #3b82f6; font-weight: bold;",
|
|
1033
1037
|
time: "color: #6b7280; font-weight: normal;"
|
|
1034
1038
|
};
|
|
1035
|
-
function
|
|
1039
|
+
function ao(e) {
|
|
1036
1040
|
try {
|
|
1037
1041
|
return JSON.stringify(e);
|
|
1038
1042
|
} catch {
|
|
@@ -1047,12 +1051,12 @@ function st(e, t, n, o, i, s, a) {
|
|
|
1047
1051
|
data: a,
|
|
1048
1052
|
timestamp: Date.now()
|
|
1049
1053
|
};
|
|
1050
|
-
if (
|
|
1051
|
-
if (!
|
|
1052
|
-
const p =
|
|
1054
|
+
if (io(c), (n || wn()) && _t(c), !o) {
|
|
1055
|
+
if (!no()) return;
|
|
1056
|
+
const p = ro();
|
|
1053
1057
|
if (p && !p.has(i.toLowerCase())) return;
|
|
1054
1058
|
}
|
|
1055
|
-
const f =
|
|
1059
|
+
const f = oo(), g = a !== void 0 ? " " + ao(a) : "";
|
|
1056
1060
|
t(
|
|
1057
1061
|
`%c[${f}]%c [${i}]%c ${s}${g}`,
|
|
1058
1062
|
$e.time,
|
|
@@ -1069,25 +1073,25 @@ function A(e, t, n) {
|
|
|
1069
1073
|
function ue(e, t, n) {
|
|
1070
1074
|
st("error", console.error, !0, !0, e, t, n);
|
|
1071
1075
|
}
|
|
1072
|
-
function
|
|
1076
|
+
function so() {
|
|
1073
1077
|
return [...de];
|
|
1074
1078
|
}
|
|
1075
|
-
function
|
|
1079
|
+
function lo() {
|
|
1076
1080
|
de.length = 0;
|
|
1077
1081
|
}
|
|
1078
|
-
function
|
|
1082
|
+
function co(e) {
|
|
1079
1083
|
const t = e && e.length > 0 ? e.join(",") : "true";
|
|
1080
1084
|
at(oe.DEBUG_FLAG, t), console.log("[wp] Debug mode enabled");
|
|
1081
1085
|
}
|
|
1082
|
-
function
|
|
1086
|
+
function uo() {
|
|
1083
1087
|
Me(oe.DEBUG_FLAG), console.log("[wp] Debug mode disabled");
|
|
1084
1088
|
}
|
|
1085
|
-
const
|
|
1086
|
-
function
|
|
1089
|
+
const mo = 1024, po = 5e4;
|
|
1090
|
+
function fo(e) {
|
|
1087
1091
|
if (e == null) return e;
|
|
1088
1092
|
try {
|
|
1089
1093
|
const t = JSON.stringify(e);
|
|
1090
|
-
if (t.length <=
|
|
1094
|
+
if (t.length <= mo) return e;
|
|
1091
1095
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
1092
1096
|
const n = {};
|
|
1093
1097
|
for (const [o, i] of Object.entries(e)) {
|
|
@@ -1101,7 +1105,7 @@ function po(e) {
|
|
|
1101
1105
|
return "[unserializable]";
|
|
1102
1106
|
}
|
|
1103
1107
|
}
|
|
1104
|
-
async function
|
|
1108
|
+
async function ho() {
|
|
1105
1109
|
if (Te.length === 0) return;
|
|
1106
1110
|
const e = Te;
|
|
1107
1111
|
Te = [], Xe = null;
|
|
@@ -1115,7 +1119,7 @@ async function fo() {
|
|
|
1115
1119
|
level: c.level,
|
|
1116
1120
|
category: c.category,
|
|
1117
1121
|
message: c.message,
|
|
1118
|
-
data:
|
|
1122
|
+
data: fo(c.data),
|
|
1119
1123
|
timestamp: c.timestamp,
|
|
1120
1124
|
url: typeof window < "u" ? window.location.href : void 0,
|
|
1121
1125
|
userAgent: typeof navigator < "u" ? navigator.userAgent : void 0,
|
|
@@ -1125,7 +1129,7 @@ async function fo() {
|
|
|
1125
1129
|
let s = [], a = 0;
|
|
1126
1130
|
for (const c of i) {
|
|
1127
1131
|
const f = JSON.stringify(c).length + 1;
|
|
1128
|
-
a + f >
|
|
1132
|
+
a + f > po && s.length > 0 && (await fetch(o, {
|
|
1129
1133
|
method: "POST",
|
|
1130
1134
|
headers: { "Content-Type": "application/json" },
|
|
1131
1135
|
body: JSON.stringify({ logs: s })
|
|
@@ -1142,18 +1146,18 @@ async function fo() {
|
|
|
1142
1146
|
}
|
|
1143
1147
|
function _t(e) {
|
|
1144
1148
|
if (Te.push(e), !Xe) {
|
|
1145
|
-
const t = wn() ?
|
|
1146
|
-
Xe = setTimeout(
|
|
1149
|
+
const t = wn() ? to : eo;
|
|
1150
|
+
Xe = setTimeout(ho, t);
|
|
1147
1151
|
}
|
|
1148
1152
|
}
|
|
1149
1153
|
function ge(e) {
|
|
1150
1154
|
return e instanceof Error ? { error: e.message, name: e.name } : { error: String(e), name: typeof e };
|
|
1151
1155
|
}
|
|
1152
1156
|
Fe("__wpDebug", {
|
|
1153
|
-
enable:
|
|
1154
|
-
disable:
|
|
1155
|
-
history:
|
|
1156
|
-
clear:
|
|
1157
|
+
enable: co,
|
|
1158
|
+
disable: uo,
|
|
1159
|
+
history: so,
|
|
1160
|
+
clear: lo
|
|
1157
1161
|
});
|
|
1158
1162
|
const X = {
|
|
1159
1163
|
resolved: !1,
|
|
@@ -1163,16 +1167,16 @@ const X = {
|
|
|
1163
1167
|
function lt() {
|
|
1164
1168
|
return X.accountId ? X.accountId : X.resolved && X.userType === "public" ? "anon" : null;
|
|
1165
1169
|
}
|
|
1166
|
-
function
|
|
1170
|
+
function go(e) {
|
|
1167
1171
|
X.resolved = !0, e.userType && (X.userType = e.userType), e.userId !== void 0 && (X.accountId = e.userId && e.userId !== "public" ? e.userId : null);
|
|
1168
1172
|
}
|
|
1169
1173
|
function ct() {
|
|
1170
1174
|
return X.accountId ?? "public";
|
|
1171
1175
|
}
|
|
1172
|
-
function
|
|
1176
|
+
function bo() {
|
|
1173
1177
|
return lt() ?? "unscoped";
|
|
1174
1178
|
}
|
|
1175
|
-
function
|
|
1179
|
+
function yo() {
|
|
1176
1180
|
return nn.flatMap((e) => {
|
|
1177
1181
|
const t = e.characters.map((o) => o.id), n = [];
|
|
1178
1182
|
for (let o = 0; o < t.length; o += yt)
|
|
@@ -1188,12 +1192,10 @@ function _n(e) {
|
|
|
1188
1192
|
return fe(e) ? fr[e] : "var(--color-neutral-bg)";
|
|
1189
1193
|
}
|
|
1190
1194
|
function He(e) {
|
|
1191
|
-
|
|
1192
|
-
const t = he().serverOrigin.replace(/\/$/, ""), n = hr[e];
|
|
1193
|
-
return `${t}/media/sprites/square_${e}.png${n > 1 ? `?v=${n}` : ""}`;
|
|
1195
|
+
return fe(e) ? `${he().serverOrigin.replace(/\/$/, "")}${gr(e)}` : void 0;
|
|
1194
1196
|
}
|
|
1195
1197
|
let pe = null, Se = null;
|
|
1196
|
-
function
|
|
1198
|
+
function vo() {
|
|
1197
1199
|
return pe ? Promise.resolve() : Se || (Se = (async () => {
|
|
1198
1200
|
try {
|
|
1199
1201
|
const e = he().serverOrigin.replace(/\/$/, ""), t = await fetch(`${e}/media/sprites/names.json`, { cache: "no-cache" });
|
|
@@ -1212,7 +1214,7 @@ function ne(e) {
|
|
|
1212
1214
|
const t = e.toLowerCase();
|
|
1213
1215
|
return Le.some((n) => n === t) ? !0 : pe ? Object.values(pe).some((n) => n.toLowerCase() === t) : !1;
|
|
1214
1216
|
}
|
|
1215
|
-
const
|
|
1217
|
+
const So = r.object({
|
|
1216
1218
|
// Identity. There is deliberately NO `name`: a person's name is their
|
|
1217
1219
|
// hadoku key-registry name, resolved by the server from whoami and renamed
|
|
1218
1220
|
// through hadoku_site's POST /session/name (operator decision 2026-10-08).
|
|
@@ -1233,13 +1235,13 @@ const vo = r.object({
|
|
|
1233
1235
|
subtitleStyle: r.string().optional()
|
|
1234
1236
|
}), me = Wn({
|
|
1235
1237
|
appId: "watchparty",
|
|
1236
|
-
schema:
|
|
1237
|
-
}),
|
|
1238
|
+
schema: So
|
|
1239
|
+
}), wo = /* @__PURE__ */ new Set(["theme", "themeMode"]);
|
|
1238
1240
|
function Oe(e) {
|
|
1239
1241
|
const t = lt();
|
|
1240
1242
|
return t ? `prefs-cache:${t}:${e}` : null;
|
|
1241
1243
|
}
|
|
1242
|
-
function
|
|
1244
|
+
function _o() {
|
|
1243
1245
|
return lt() === null;
|
|
1244
1246
|
}
|
|
1245
1247
|
function Ct(e) {
|
|
@@ -1253,9 +1255,9 @@ function Ct(e) {
|
|
|
1253
1255
|
return {};
|
|
1254
1256
|
}
|
|
1255
1257
|
}
|
|
1256
|
-
function
|
|
1258
|
+
function xo() {
|
|
1257
1259
|
let e = 0;
|
|
1258
|
-
for (const t of
|
|
1260
|
+
for (const t of Xr()) {
|
|
1259
1261
|
const n = t.startsWith("prefs-cache:") && t.endsWith(":watchparty"), o = t === Re || t.startsWith(`${Re}:`) && !t.endsWith(":_serverSynced_v1");
|
|
1260
1262
|
if (!n && !o) continue;
|
|
1261
1263
|
const i = G(t);
|
|
@@ -1276,7 +1278,7 @@ function _o() {
|
|
|
1276
1278
|
let xn = null, Cn = null;
|
|
1277
1279
|
const kt = /* @__PURE__ */ new Set();
|
|
1278
1280
|
function dt() {
|
|
1279
|
-
if (
|
|
1281
|
+
if (_o())
|
|
1280
1282
|
return d("preferences", "Boot read deferred — session pending, identity unresolved"), {};
|
|
1281
1283
|
const e = Ct("portfolio"), t = Ct("watchparty"), n = Object.keys(e).length > 0 ? e : xn ?? {}, o = Object.keys(t).length > 0 ? t : Cn ?? {}, i = ct() || "public";
|
|
1282
1284
|
if (kt.has(i))
|
|
@@ -1301,15 +1303,15 @@ function dt() {
|
|
|
1301
1303
|
}), a;
|
|
1302
1304
|
}
|
|
1303
1305
|
let kn = !1;
|
|
1304
|
-
function
|
|
1306
|
+
function Co() {
|
|
1305
1307
|
const e = ct();
|
|
1306
1308
|
return !e || e === "public";
|
|
1307
1309
|
}
|
|
1308
1310
|
function K(e, t) {
|
|
1309
|
-
|
|
1311
|
+
Co() && (kn = !0), wo.has(e) ? ce.save({ [e]: t }, { scope: "device" }).catch((n) => A("preferences", "themePrefs.save failed", { key: e, err: n?.message })) : me.save({ [e]: t }).catch((n) => A("preferences", "watchpartyPrefs.save failed", { key: e, err: n?.message })), d("preferences", "Saved (via SDK)", { key: e, value: t });
|
|
1310
1312
|
}
|
|
1311
1313
|
let we = null, It = !1;
|
|
1312
|
-
function
|
|
1314
|
+
function ko() {
|
|
1313
1315
|
return we || (we = (async () => {
|
|
1314
1316
|
if (typeof window > "u") return !1;
|
|
1315
1317
|
try {
|
|
@@ -1337,7 +1339,7 @@ function Co() {
|
|
|
1337
1339
|
// Post-fetch cache state: should be non-zero if SDK wrote it.
|
|
1338
1340
|
sdkThemeBytesPost: i?.length ?? 0,
|
|
1339
1341
|
sdkAppBytesPost: s?.length ?? 0
|
|
1340
|
-
}), await
|
|
1342
|
+
}), await Io(e, t), kn ? (d("preferences", "Promoting this load's pre-auth picks to the signed-in user"), await Promise.all([
|
|
1341
1343
|
ce.promoteAnonPrefsToUser().catch(() => {
|
|
1342
1344
|
}),
|
|
1343
1345
|
me.promoteAnonPrefsToUser().catch(() => {
|
|
@@ -1349,7 +1351,7 @@ function Co() {
|
|
|
1349
1351
|
})(), we);
|
|
1350
1352
|
}
|
|
1351
1353
|
const Re = "watchparty_preferences";
|
|
1352
|
-
|
|
1354
|
+
xo();
|
|
1353
1355
|
function Ze() {
|
|
1354
1356
|
const e = ct();
|
|
1355
1357
|
return !e || e === "public" ? Re : `${Re}:${e}`;
|
|
@@ -1367,7 +1369,7 @@ function In() {
|
|
|
1367
1369
|
function Tt() {
|
|
1368
1370
|
Me(Ze()), Me(`${Ze()}:_serverSynced_v1`);
|
|
1369
1371
|
}
|
|
1370
|
-
async function
|
|
1372
|
+
async function Io(e, t) {
|
|
1371
1373
|
const n = In();
|
|
1372
1374
|
if (!n || Object.keys(n).length === 0) return;
|
|
1373
1375
|
const o = Object.keys(e ?? {}).length > 0, i = Object.keys(t ?? {}).length > 0, s = {}, a = {};
|
|
@@ -1424,16 +1426,16 @@ function Nt(e) {
|
|
|
1424
1426
|
}
|
|
1425
1427
|
}).catch((t) => A("preferences", "store import failed", { reason: e, err: t?.message }));
|
|
1426
1428
|
}
|
|
1427
|
-
const Tn = 320, De = 240, ut = 640,
|
|
1429
|
+
const Tn = 320, De = 240, ut = 640, To = 320, Eo = 36, Pt = 16;
|
|
1428
1430
|
function V(e, t) {
|
|
1429
1431
|
if (!Number.isFinite(e)) return Tn;
|
|
1430
1432
|
let n = ut;
|
|
1431
|
-
return t !== void 0 && Number.isFinite(t) && t > 0 && (n = Math.min(n, t -
|
|
1433
|
+
return t !== void 0 && Number.isFinite(t) && t > 0 && (n = Math.min(n, t - To)), n = Math.max(n, De), Math.round(Math.min(n, Math.max(De, e)));
|
|
1432
1434
|
}
|
|
1433
1435
|
function Mt(e, t, n, o) {
|
|
1434
1436
|
return V(e + (t - n), o);
|
|
1435
1437
|
}
|
|
1436
|
-
function
|
|
1438
|
+
function Ao(e, t, n) {
|
|
1437
1439
|
switch (t) {
|
|
1438
1440
|
case "ArrowLeft":
|
|
1439
1441
|
return V(e + Pt, n);
|
|
@@ -1447,8 +1449,8 @@ function Eo(e, t, n) {
|
|
|
1447
1449
|
return null;
|
|
1448
1450
|
}
|
|
1449
1451
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return { collapsed: e, width: e ?
|
|
1452
|
+
function No(e, t) {
|
|
1453
|
+
return { collapsed: e, width: e ? Eo : t };
|
|
1452
1454
|
}
|
|
1453
1455
|
const q = dt(), m = Gn((e, t) => ({
|
|
1454
1456
|
ready: !1,
|
|
@@ -1693,18 +1695,18 @@ const En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1693
1695
|
__proto__: null,
|
|
1694
1696
|
useAppStore: m
|
|
1695
1697
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1696
|
-
function
|
|
1698
|
+
function Po(e) {
|
|
1697
1699
|
return `${hn()}/media/${e}`.replace(/\\/g, "/");
|
|
1698
1700
|
}
|
|
1699
|
-
function
|
|
1700
|
-
return
|
|
1701
|
+
function Mo(e, t) {
|
|
1702
|
+
return Po(t ?? `${e}/poster.jpg`);
|
|
1701
1703
|
}
|
|
1702
|
-
function
|
|
1704
|
+
function Oo(e) {
|
|
1703
1705
|
return `${hn()}${e}`.replace(/\\/g, "/");
|
|
1704
1706
|
}
|
|
1705
|
-
async function
|
|
1707
|
+
async function Ro(e) {
|
|
1706
1708
|
try {
|
|
1707
|
-
const t = await fetch(
|
|
1709
|
+
const t = await fetch(Oo("/api/tierlist"));
|
|
1708
1710
|
if (!t.ok)
|
|
1709
1711
|
return A("tierlist", "Board fetch failed", { status: t.status }), null;
|
|
1710
1712
|
const n = await t.json();
|
|
@@ -1718,43 +1720,43 @@ async function Oo(e) {
|
|
|
1718
1720
|
}
|
|
1719
1721
|
}
|
|
1720
1722
|
let Ot = !1;
|
|
1721
|
-
function
|
|
1723
|
+
function Do() {
|
|
1722
1724
|
if (Ot || typeof Image > "u") return;
|
|
1723
1725
|
const e = m.getState().tierlist;
|
|
1724
1726
|
if (!(!e || e.items.length === 0)) {
|
|
1725
1727
|
Ot = !0;
|
|
1726
1728
|
for (const t of e.items) {
|
|
1727
1729
|
const n = new Image();
|
|
1728
|
-
n.decoding = "async", n.src =
|
|
1730
|
+
n.decoding = "async", n.src = Mo(t.id, t.thumbnail);
|
|
1729
1731
|
}
|
|
1730
1732
|
d("tierlist", "Warming posters", { count: e.items.length });
|
|
1731
1733
|
}
|
|
1732
1734
|
}
|
|
1733
|
-
function
|
|
1735
|
+
function Lo() {
|
|
1734
1736
|
const e = m.getState(), t = new Set(Object.values(e.roster).map((s) => s.sprite).filter(Boolean)), n = Le.find((s) => !t.has(s));
|
|
1735
1737
|
if (!n)
|
|
1736
1738
|
return A("socket", "sprite_taken: no available sprites to retry with"), null;
|
|
1737
1739
|
const o = !!e.name && !ne(e.name), i = o ? e.name : te(n);
|
|
1738
1740
|
return d("socket", "sprite_taken: retrying with next available", { from: e.sprite, to: n, name: i, keptCustomName: o }), e.setSessionIdentity(i, n), { name: i, sprite: n };
|
|
1739
1741
|
}
|
|
1740
|
-
function
|
|
1742
|
+
function jo(e) {
|
|
1741
1743
|
const t = m.getState(), n = e ? t.roster[e] : void 0;
|
|
1742
1744
|
return !n || !!n.sprite && n.sprite === t.sprite;
|
|
1743
1745
|
}
|
|
1744
|
-
const
|
|
1745
|
-
function
|
|
1746
|
+
const Uo = 10;
|
|
1747
|
+
function Fo(e = typeof window < "u" ? window : void 0) {
|
|
1746
1748
|
if (!e) return { framed: !1, depth: 0 };
|
|
1747
1749
|
try {
|
|
1748
1750
|
let t = 0, n = e;
|
|
1749
|
-
for (; n !== n.parent && t <
|
|
1751
|
+
for (; n !== n.parent && t < Uo; )
|
|
1750
1752
|
t++, n = n.parent;
|
|
1751
1753
|
return { framed: e.top ? e.top !== e.self : t > 0, depth: t };
|
|
1752
1754
|
} catch {
|
|
1753
1755
|
return { framed: !1, depth: 0 };
|
|
1754
1756
|
}
|
|
1755
1757
|
}
|
|
1756
|
-
const
|
|
1757
|
-
function
|
|
1758
|
+
const Ho = "watchparty_fragment_delivery";
|
|
1759
|
+
function $o() {
|
|
1758
1760
|
if (typeof window > "u") return null;
|
|
1759
1761
|
try {
|
|
1760
1762
|
const e = new URLSearchParams(window.location.search).get("fragmentDelivery");
|
|
@@ -1762,27 +1764,27 @@ function Ho() {
|
|
|
1762
1764
|
if (e === "0" || e === "false") return !1;
|
|
1763
1765
|
} catch {
|
|
1764
1766
|
}
|
|
1765
|
-
return
|
|
1767
|
+
return Jr(Ho);
|
|
1766
1768
|
}
|
|
1767
|
-
let
|
|
1769
|
+
let Bo = { ...rn }, Be = null;
|
|
1768
1770
|
const Rt = "watchparty_delivery_client_id";
|
|
1769
|
-
function
|
|
1771
|
+
function Go() {
|
|
1770
1772
|
const e = G(Rt);
|
|
1771
1773
|
if (e) return e;
|
|
1772
1774
|
const t = globalThis.crypto?.randomUUID?.() ?? `d${Math.random().toString(36).slice(2)}`;
|
|
1773
1775
|
return at(Rt, t) ? t : "";
|
|
1774
1776
|
}
|
|
1775
|
-
function Go() {
|
|
1776
|
-
return Be === null && (Be = wr($o, Bo(), Ho())), Be;
|
|
1777
|
-
}
|
|
1778
1777
|
function Wo() {
|
|
1779
|
-
return Go();
|
|
1778
|
+
return Be === null && (Be = _r(Bo, Go(), $o())), Be;
|
|
1779
|
+
}
|
|
1780
|
+
function Ko() {
|
|
1781
|
+
return Wo();
|
|
1780
1782
|
}
|
|
1781
1783
|
let Ee;
|
|
1782
1784
|
function An() {
|
|
1783
1785
|
return G(qn) || void 0;
|
|
1784
1786
|
}
|
|
1785
|
-
function
|
|
1787
|
+
function qo() {
|
|
1786
1788
|
if (Ee) return;
|
|
1787
1789
|
const e = An();
|
|
1788
1790
|
if (e) {
|
|
@@ -1795,10 +1797,10 @@ function Ko() {
|
|
|
1795
1797
|
d("identity", "device id unavailable — joining without one");
|
|
1796
1798
|
});
|
|
1797
1799
|
}
|
|
1798
|
-
function
|
|
1800
|
+
function Vo() {
|
|
1799
1801
|
return Ee ??= An();
|
|
1800
1802
|
}
|
|
1801
|
-
function
|
|
1803
|
+
function zo(e, t) {
|
|
1802
1804
|
let n = 0;
|
|
1803
1805
|
for (const o of e.videos) {
|
|
1804
1806
|
const i = oe.voteKey(t, e.id, o.mediaId);
|
|
@@ -1806,49 +1808,49 @@ function Vo(e, t) {
|
|
|
1806
1808
|
}
|
|
1807
1809
|
return n;
|
|
1808
1810
|
}
|
|
1809
|
-
const
|
|
1810
|
-
function
|
|
1811
|
+
const Yo = 2e4, Xo = 1e4;
|
|
1812
|
+
function Jo() {
|
|
1811
1813
|
return { unansweredSince: null, lastPongAt: null, lastTickAt: null };
|
|
1812
1814
|
}
|
|
1813
|
-
function
|
|
1815
|
+
function Zo(e, t) {
|
|
1814
1816
|
e.lastPongAt = t, e.unansweredSince = null;
|
|
1815
1817
|
}
|
|
1816
|
-
function
|
|
1817
|
-
const o = e.lastTickAt !== null && t - e.lastTickAt >
|
|
1818
|
-
return e.lastTickAt = t, n ? o || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince >
|
|
1818
|
+
function Qo(e, t, n) {
|
|
1819
|
+
const o = e.lastTickAt !== null && t - e.lastTickAt > Xo;
|
|
1820
|
+
return e.lastTickAt = t, n ? o || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince > Yo : (e.unansweredSince = null, !1);
|
|
1819
1821
|
}
|
|
1820
|
-
function
|
|
1822
|
+
function ei(e, t) {
|
|
1821
1823
|
return e.lastPongAt === null ? void 0 : Math.max(0, t - e.lastPongAt);
|
|
1822
1824
|
}
|
|
1823
1825
|
let x = null, $ = null, Ae = null, B = null, z = null;
|
|
1824
|
-
const
|
|
1826
|
+
const ti = oi(), ee = Jo();
|
|
1825
1827
|
let _e = null, Ge = null, Dt = 0, mt = null, Qe = !1, pt = !1, le = !1, Nn = null;
|
|
1826
|
-
function
|
|
1828
|
+
function ni(e) {
|
|
1827
1829
|
const t = ie(), n = m.getState();
|
|
1828
1830
|
if (n.me.clientId && n.roster[n.me.clientId])
|
|
1829
1831
|
return (e.name || e.sprite) && (d("socket", "Identity update (already joined)", { name: e.name, sprite: e.sprite }), t.emit(I.IDENTITY_UPDATE, { name: e.name, sprite: e.sprite })), t;
|
|
1830
|
-
const o =
|
|
1832
|
+
const o = ri(e);
|
|
1831
1833
|
return z = o, mt = { name: o.name, sprite: o.sprite }, t.connected ? (d("socket", "Emitting join", o), t.emit(I.JOIN, o)) : t.once("connect", () => {
|
|
1832
1834
|
d("socket", "Emitting join", o), t.emit(I.JOIN, o);
|
|
1833
1835
|
}), t;
|
|
1834
1836
|
}
|
|
1835
|
-
function
|
|
1837
|
+
function ri(e) {
|
|
1836
1838
|
return {
|
|
1837
1839
|
room_key: e.room_key,
|
|
1838
1840
|
name: e.name,
|
|
1839
1841
|
sprite: e.sprite,
|
|
1840
1842
|
// Entry-path telemetry — see lib/embedContext.ts. Sent on every join AND
|
|
1841
1843
|
// rejoin (lastJoinPayload carries it), so a reconnect keeps the attribution.
|
|
1842
|
-
embed:
|
|
1843
|
-
delivery_arm:
|
|
1844
|
+
embed: Fo(),
|
|
1845
|
+
delivery_arm: Ko(),
|
|
1844
1846
|
// Identity tier input — see lib/deviceId.ts. Sent on every join AND rejoin
|
|
1845
1847
|
// (lastJoinPayload carries it) so a reconnect lands on the same
|
|
1846
1848
|
// ParticipantId rather than minting a new person.
|
|
1847
|
-
device_id:
|
|
1848
|
-
tab_id:
|
|
1849
|
+
device_id: Vo(),
|
|
1850
|
+
tab_id: ti
|
|
1849
1851
|
};
|
|
1850
1852
|
}
|
|
1851
|
-
function
|
|
1853
|
+
function oi() {
|
|
1852
1854
|
const e = globalThis.crypto;
|
|
1853
1855
|
if (e && typeof e.randomUUID == "function") return e.randomUUID();
|
|
1854
1856
|
const t = new Uint8Array(16);
|
|
@@ -1865,15 +1867,15 @@ function ie() {
|
|
|
1865
1867
|
}
|
|
1866
1868
|
const n = new URL(t.startsWith("http") ? t : `${window.location.origin}${t}`).origin;
|
|
1867
1869
|
x = Vn(n, { path: Jn, transports: ["websocket", "polling"] }), d("socket", "Socket initialized", { origin: t }), Fe("__SOCKET__", x), B && (clearTimeout(B), B = null), $ = null, Ae = setInterval(() => {
|
|
1868
|
-
if (
|
|
1870
|
+
if (Qo(ee, Date.now(), !!x?.connected)) {
|
|
1869
1871
|
A("socket", "PONG-WATCHDOG no time_pong for 20s — replacing the connection", {
|
|
1870
1872
|
sid: x?.id,
|
|
1871
|
-
lastPongAgeMs:
|
|
1873
|
+
lastPongAgeMs: ei(ee, Date.now()) ?? null
|
|
1872
1874
|
}), Ge = "pong-watchdog", ee.unansweredSince = null, x?.io.engine?.close();
|
|
1873
1875
|
return;
|
|
1874
1876
|
}
|
|
1875
|
-
|
|
1876
|
-
},
|
|
1877
|
+
hi();
|
|
1878
|
+
}, br), x.on("connect", () => {
|
|
1877
1879
|
pt = !1;
|
|
1878
1880
|
const o = x?.id;
|
|
1879
1881
|
if (d("socket", "Connected", { id: o, isReconnect: le }), o)
|
|
@@ -1909,7 +1911,7 @@ function ie() {
|
|
|
1909
1911
|
le = !0;
|
|
1910
1912
|
}), x.on("disconnect", (o) => {
|
|
1911
1913
|
Sn(null), _e = { reason: Ge ?? o, at: Date.now() }, Ge = null, d("socket", "Disconnected", { reason: o });
|
|
1912
|
-
}), x.on("connect_error", (o) => ue("socket", "Connection error", { message: o?.message })), x.on("reconnect_attempt", (o) => A("socket", "Reconnect attempt", { attempt: o })), x.on("reconnect_failed", () => ue("socket", "Reconnect failed")),
|
|
1914
|
+
}), x.on("connect_error", (o) => ue("socket", "Connection error", { message: o?.message })), x.on("reconnect_attempt", (o) => A("socket", "Reconnect attempt", { attempt: o })), x.on("reconnect_failed", () => ue("socket", "Reconnect failed")), pi(x);
|
|
1913
1915
|
}
|
|
1914
1916
|
return x;
|
|
1915
1917
|
}
|
|
@@ -1933,7 +1935,7 @@ function Lt(e, t) {
|
|
|
1933
1935
|
systemType: e.systemType
|
|
1934
1936
|
};
|
|
1935
1937
|
}
|
|
1936
|
-
function
|
|
1938
|
+
function ii(e) {
|
|
1937
1939
|
e.on(I.SNAPSHOT, (t) => {
|
|
1938
1940
|
e.emit(tn.SYNC), m.getState().applySnapshot({
|
|
1939
1941
|
roomId: t.room_id ?? null,
|
|
@@ -1986,7 +1988,7 @@ function oi(e) {
|
|
|
1986
1988
|
}), e.on(I.CONTROL_ACK, (t) => {
|
|
1987
1989
|
typeof t?.client_seq == "number" && typeof t?.server_seq == "number" && d("socket", "Control ack received", t);
|
|
1988
1990
|
}), e.on(I.TIME_PONG, (t) => {
|
|
1989
|
-
if (
|
|
1991
|
+
if (Zo(ee, Date.now()), $ && $.ts) {
|
|
1990
1992
|
const n = Date.now() - $.ts;
|
|
1991
1993
|
m.getState().addRttSample(n, t?.server_ts, $.ts), $ = null, B && (clearTimeout(B), B = null), d("socket", "Time sync RTT", { rtt: n, offset: m.getState().drift.offsetMs });
|
|
1992
1994
|
}
|
|
@@ -1996,7 +1998,7 @@ function oi(e) {
|
|
|
1996
1998
|
m.getState().setReadiness({ mediaId: n, ready: s, readyCount: o, total: i }), d("socket", "Ready state received", { mediaId: n, readyCount: o, total: i, ready: s });
|
|
1997
1999
|
});
|
|
1998
2000
|
}
|
|
1999
|
-
function
|
|
2001
|
+
function ai(e) {
|
|
2000
2002
|
e.on(I.PRESENCE, (t) => {
|
|
2001
2003
|
if (!t) return;
|
|
2002
2004
|
if (Array.isArray(t.users)) {
|
|
@@ -2030,7 +2032,7 @@ function ii(e) {
|
|
|
2030
2032
|
}
|
|
2031
2033
|
});
|
|
2032
2034
|
}
|
|
2033
|
-
function
|
|
2035
|
+
function si(e) {
|
|
2034
2036
|
e.on(I.CHAT_BROADCAST, (t) => {
|
|
2035
2037
|
const n = Lt(t, t.server_seq);
|
|
2036
2038
|
m.getState().appendChat(n), d("chat", "Message received", n);
|
|
@@ -2040,7 +2042,7 @@ function ai(e) {
|
|
|
2040
2042
|
m.getState().setChat(n), d("chat", "History loaded", { count: n.length });
|
|
2041
2043
|
});
|
|
2042
2044
|
}
|
|
2043
|
-
function
|
|
2045
|
+
function li(e) {
|
|
2044
2046
|
e.on(ye.STATE, (t) => {
|
|
2045
2047
|
m.getState().applyPlaylistState({
|
|
2046
2048
|
playlist: t?.playlist ?? null,
|
|
@@ -2053,54 +2055,54 @@ function si(e) {
|
|
|
2053
2055
|
m.getState().setPlaylistResults(t ?? null), d("playlist", "Results received", { playlistId: t?.playlist?.id, update: t?.update === !0 });
|
|
2054
2056
|
}), e.on(ye.VOTES_CLEARED, (t) => {
|
|
2055
2057
|
if (!t?.playlistId || !Array.isArray(t.mediaIds)) return;
|
|
2056
|
-
const n =
|
|
2058
|
+
const n = zo(
|
|
2057
2059
|
{ id: t.playlistId, videos: t.mediaIds.map((i) => ({ mediaId: i })) },
|
|
2058
|
-
|
|
2060
|
+
bo()
|
|
2059
2061
|
), o = m.getState();
|
|
2060
2062
|
o.playlist?.id === t.playlistId && o.applyPlaylistState({ playlist: o.playlist, activeIndex: o.activePlaylistIndex, myVotes: {} }), d("playlist", "Votes cleared by leader", { playlistId: t.playlistId, removed: n });
|
|
2061
2063
|
});
|
|
2062
2064
|
}
|
|
2063
|
-
function
|
|
2065
|
+
function ci(e) {
|
|
2064
2066
|
e.on(dr.UPDATED, () => {
|
|
2065
|
-
d("tierlist", "Someone saved — refreshing the board"),
|
|
2067
|
+
d("tierlist", "Someone saved — refreshing the board"), Ro(!1);
|
|
2066
2068
|
});
|
|
2067
2069
|
}
|
|
2068
|
-
function
|
|
2070
|
+
function di(e) {
|
|
2069
2071
|
e.on(ur.STATE, (t) => {
|
|
2070
2072
|
if (!t || typeof t.active != "boolean") return;
|
|
2071
2073
|
const n = Array.isArray(t.ready) ? t.ready.filter((o) => typeof o == "string") : [];
|
|
2072
2074
|
m.getState().setReadyCheckState({ active: t.active, ready: n }), d("ready-check", "State received", { active: t.active, readyCount: n.length });
|
|
2073
2075
|
});
|
|
2074
2076
|
}
|
|
2075
|
-
function
|
|
2077
|
+
function ui(e) {
|
|
2076
2078
|
e.on(tn.ACTIVE, (t) => {
|
|
2077
2079
|
const n = typeof t?.gameId == "string" ? t.gameId : null;
|
|
2078
2080
|
m.getState().setActiveGameId(n), t?.sessionWins && typeof t.sessionWins == "object" ? m.getState().setGameSessionWins(t.sessionWins) : n === null && m.getState().setGameSessionWins({}), typeof t?.botCount == "number" ? m.getState().setGameBotCount(t.botCount) : n === null && m.getState().setGameBotCount(0), d("game", "game_active", { gameId: n, sessionWins: t?.sessionWins, botCount: t?.botCount });
|
|
2079
2081
|
});
|
|
2080
2082
|
}
|
|
2081
|
-
function
|
|
2083
|
+
function mi(e) {
|
|
2082
2084
|
e.on(I.HEALTH_SNAPSHOT, (t) => {
|
|
2083
2085
|
m.getState().setHealthSnapshot(t);
|
|
2084
2086
|
}), e.on(I.BUFFER_STATUS, (t) => {
|
|
2085
2087
|
m.getState().setBufferStatus(t);
|
|
2086
2088
|
});
|
|
2087
2089
|
}
|
|
2088
|
-
function
|
|
2089
|
-
|
|
2090
|
+
function pi(e) {
|
|
2091
|
+
ii(e), ai(e), si(e), mi(e), li(e), ci(e), di(e), ui(e), e.on(I.ERROR, (t) => {
|
|
2090
2092
|
const n = t?.code || "error/unknown";
|
|
2091
2093
|
if (n === "conflict" && t?.message === "sprite_held_by_you") {
|
|
2092
2094
|
pt = !0, d("socket", "sprite held by this account's other connection: keeping the server-assigned sprite");
|
|
2093
2095
|
return;
|
|
2094
2096
|
}
|
|
2095
2097
|
if (n === "conflict" && t?.message === "sprite_taken") {
|
|
2096
|
-
if (
|
|
2098
|
+
if (jo(x?.id)) {
|
|
2097
2099
|
d("socket", "sprite_taken: stale, the server already has our sprite");
|
|
2098
2100
|
return;
|
|
2099
2101
|
}
|
|
2100
2102
|
Qe = !0;
|
|
2101
2103
|
let a;
|
|
2102
2104
|
try {
|
|
2103
|
-
a =
|
|
2105
|
+
a = Lo();
|
|
2104
2106
|
} finally {
|
|
2105
2107
|
Qe = !1;
|
|
2106
2108
|
}
|
|
@@ -2131,15 +2133,15 @@ function mi(e) {
|
|
|
2131
2133
|
(n.startsWith("auth/") ? A : ue)("socket", `Server error: ${i}`, { code: n, raw: t }), m.getState().pushToast("error", i);
|
|
2132
2134
|
});
|
|
2133
2135
|
}
|
|
2134
|
-
function
|
|
2136
|
+
function fi(e, t) {
|
|
2135
2137
|
ie().emit(I.CHAT_SEND, t?.length ? { text: e, images: t } : { text: e });
|
|
2136
2138
|
}
|
|
2137
|
-
function
|
|
2139
|
+
function hi() {
|
|
2138
2140
|
$ || ($ = { ts: Date.now() }, ie().emit(I.TIME_PING, {}), B = setTimeout(() => {
|
|
2139
2141
|
$ && (d("socket", "Time ping timed out after 10s, clearing inflight"), $ = null), B = null;
|
|
2140
2142
|
}, 1e4));
|
|
2141
2143
|
}
|
|
2142
|
-
function
|
|
2144
|
+
function gi(e, t) {
|
|
2143
2145
|
const n = {};
|
|
2144
2146
|
e && (n.name = e), t && (n.sprite = t), !(!n.name && !n.sprite) && (d("socket", "Sending identity update", n), ie().emit(I.IDENTITY_UPDATE, n));
|
|
2145
2147
|
}
|
|
@@ -2155,14 +2157,14 @@ m.subscribe((e, t) => {
|
|
|
2155
2157
|
const a = {};
|
|
2156
2158
|
i && (a.name = e.name, xe.name = e.name), s && (a.sprite = e.sprite, xe.sprite = e.sprite), d("socket", "Identity reassert (store change)", a), x?.connected ? x.emit(I.IDENTITY_UPDATE, a) : ie().emit(I.IDENTITY_UPDATE, a);
|
|
2157
2159
|
});
|
|
2158
|
-
function
|
|
2160
|
+
function bi() {
|
|
2159
2161
|
Ae && (clearInterval(Ae), Ae = null), B && (clearTimeout(B), B = null), $ = null, ee.unansweredSince = null, ee.lastTickAt = null;
|
|
2160
2162
|
}
|
|
2161
|
-
function
|
|
2163
|
+
function yi() {
|
|
2162
2164
|
d("socket", "clearJoinState called", { hadPayload: z !== null, room_key: z?.room_key }), z = null, le = !1, Nn = null;
|
|
2163
2165
|
}
|
|
2164
2166
|
function jt() {
|
|
2165
|
-
d("socket", "leaveRoom called", { room_key: z?.room_key }),
|
|
2167
|
+
d("socket", "leaveRoom called", { room_key: z?.room_key }), yi(), bi(), x && (x.disconnect(), x = null), m.setState({
|
|
2166
2168
|
me: { clientId: null, nextClientSeq: 1 },
|
|
2167
2169
|
roster: {},
|
|
2168
2170
|
snapshot: { roomId: null, mediaId: null, playheadMs: 0, playing: !1, serverSeq: 0, leaderId: null },
|
|
@@ -2178,20 +2180,20 @@ function jt() {
|
|
|
2178
2180
|
gameSessionWins: {}
|
|
2179
2181
|
});
|
|
2180
2182
|
}
|
|
2181
|
-
function
|
|
2183
|
+
function vi() {
|
|
2182
2184
|
d("chat", "Emitting recap_request"), ie().emit("recap_request");
|
|
2183
2185
|
}
|
|
2184
|
-
function
|
|
2186
|
+
function Si(e) {
|
|
2185
2187
|
return !(e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey);
|
|
2186
2188
|
}
|
|
2187
|
-
function
|
|
2189
|
+
function wi({ src: e, title: t, onClose: n }) {
|
|
2188
2190
|
O(() => {
|
|
2189
2191
|
const s = (a) => {
|
|
2190
2192
|
a.key === "Escape" && (a.stopPropagation(), n());
|
|
2191
2193
|
};
|
|
2192
2194
|
return document.addEventListener("keydown", s, !0), () => document.removeEventListener("keydown", s, !0);
|
|
2193
2195
|
}, [n]);
|
|
2194
|
-
const o =
|
|
2196
|
+
const o = Yr(), i = typeof document > "u" ? null : document.fullscreenElement ?? o ?? document.body;
|
|
2195
2197
|
return i ? Yn(
|
|
2196
2198
|
/* @__PURE__ */ b(
|
|
2197
2199
|
"div",
|
|
@@ -2230,11 +2232,11 @@ function Si({ src: e, title: t, onClose: n }) {
|
|
|
2230
2232
|
i
|
|
2231
2233
|
) : null;
|
|
2232
2234
|
}
|
|
2233
|
-
const Ke = 240,
|
|
2234
|
-
function
|
|
2235
|
+
const Ke = 240, _i = 320;
|
|
2236
|
+
function xi({ image: e }) {
|
|
2235
2237
|
const [t, n] = P(!1), o = Pe(e.key);
|
|
2236
2238
|
if (!o) return null;
|
|
2237
|
-
const i = e.w > 0 && e.h > 0, s = i ? Math.min(1,
|
|
2239
|
+
const i = e.w > 0 && e.h > 0, s = i ? Math.min(1, _i / e.w, Ke / e.h) : 1;
|
|
2238
2240
|
return /* @__PURE__ */ b(Ne, { children: [
|
|
2239
2241
|
/* @__PURE__ */ l(
|
|
2240
2242
|
"a",
|
|
@@ -2245,7 +2247,7 @@ function _i({ image: e }) {
|
|
|
2245
2247
|
className: "block max-w-full cursor-zoom-in",
|
|
2246
2248
|
"data-testid": "chat-image",
|
|
2247
2249
|
onClick: (a) => {
|
|
2248
|
-
|
|
2250
|
+
Si(a) && (a.preventDefault(), n(!0));
|
|
2249
2251
|
},
|
|
2250
2252
|
children: /* @__PURE__ */ l(
|
|
2251
2253
|
"img",
|
|
@@ -2263,7 +2265,7 @@ function _i({ image: e }) {
|
|
|
2263
2265
|
}
|
|
2264
2266
|
),
|
|
2265
2267
|
t && /* @__PURE__ */ l(
|
|
2266
|
-
|
|
2268
|
+
wi,
|
|
2267
2269
|
{
|
|
2268
2270
|
src: o,
|
|
2269
2271
|
title: e.title,
|
|
@@ -2272,17 +2274,17 @@ function _i({ image: e }) {
|
|
|
2272
2274
|
)
|
|
2273
2275
|
] });
|
|
2274
2276
|
}
|
|
2275
|
-
function
|
|
2276
|
-
return e?.length ? /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1 mt-1", "data-testid": "chat-images", children: e.map((t, n) => /* @__PURE__ */ l(
|
|
2277
|
+
function Ci({ images: e }) {
|
|
2278
|
+
return e?.length ? /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1 mt-1", "data-testid": "chat-images", children: e.map((t, n) => /* @__PURE__ */ l(xi, { image: t }, `${t.key}-${n}`)) }) : null;
|
|
2277
2279
|
}
|
|
2278
|
-
function
|
|
2280
|
+
function ki(e, t) {
|
|
2279
2281
|
return e.author && t.author ? e.author === t.author : !!t.clientId && e.clientId === t.clientId;
|
|
2280
2282
|
}
|
|
2281
2283
|
function qe(e) {
|
|
2282
2284
|
return new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
2283
2285
|
}
|
|
2284
|
-
const
|
|
2285
|
-
const n = m((a) => a.me.clientId), o = m((a) => a.me.clientId ? a.roster[a.me.clientId]?.author : void 0), i =
|
|
2286
|
+
const Ii = Bt.memo(function({ message: t }) {
|
|
2287
|
+
const n = m((a) => a.me.clientId), o = m((a) => a.me.clientId ? a.roster[a.me.clientId]?.author : void 0), i = ki(t, { clientId: n, author: o });
|
|
2286
2288
|
if (t.isSystem && t.systemType === "recap")
|
|
2287
2289
|
return /* @__PURE__ */ l("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ b("div", { className: "border-l-2 border-border-light pl-2.5 py-0.5", children: [
|
|
2288
2290
|
/* @__PURE__ */ b("div", { className: "text-[10px] uppercase tracking-wide text-text-muted mb-0.5", children: [
|
|
@@ -2311,11 +2313,11 @@ const ki = Bt.memo(function({ message: t }) {
|
|
|
2311
2313
|
/* @__PURE__ */ l("span", { className: "font-medium text-[13px]", style: { color: s }, children: t.name }),
|
|
2312
2314
|
/* @__PURE__ */ l("span", { className: "text-[10px] text-text-muted opacity-60 ml-1.5", children: qe(t.ts) }),
|
|
2313
2315
|
t.text && /* @__PURE__ */ l("p", { className: "text-[13px] text-text break-words leading-snug m-0", children: t.text }),
|
|
2314
|
-
/* @__PURE__ */ l(
|
|
2316
|
+
/* @__PURE__ */ l(Ci, { images: t.images })
|
|
2315
2317
|
] })
|
|
2316
2318
|
] });
|
|
2317
2319
|
});
|
|
2318
|
-
function
|
|
2320
|
+
function Ti() {
|
|
2319
2321
|
const e = m((i) => i.chat), t = J(null), n = J(!1), o = N(() => {
|
|
2320
2322
|
const i = t.current;
|
|
2321
2323
|
if (!i) return;
|
|
@@ -2339,7 +2341,7 @@ function Ii() {
|
|
|
2339
2341
|
/* @__PURE__ */ l("span", { className: "text-[10px] text-text-muted whitespace-nowrap", children: new Date(i.ts).toLocaleDateString([], { weekday: "short", month: "short", day: "numeric" }) }),
|
|
2340
2342
|
/* @__PURE__ */ l("div", { className: "flex-1 h-px bg-border" })
|
|
2341
2343
|
] }),
|
|
2342
|
-
/* @__PURE__ */ l(
|
|
2344
|
+
/* @__PURE__ */ l(Ii, { message: i })
|
|
2343
2345
|
] }, i.id);
|
|
2344
2346
|
}) })
|
|
2345
2347
|
}
|
|
@@ -2372,12 +2374,12 @@ const ft = [
|
|
|
2372
2374
|
scope: "local"
|
|
2373
2375
|
}
|
|
2374
2376
|
], re = "/";
|
|
2375
|
-
function
|
|
2377
|
+
function Ei(e) {
|
|
2376
2378
|
if (!e.startsWith(re)) return null;
|
|
2377
2379
|
const t = e.slice(re.length);
|
|
2378
2380
|
return /\s/.test(t) ? null : t.toLowerCase();
|
|
2379
2381
|
}
|
|
2380
|
-
function
|
|
2382
|
+
function Ai(e, t = ft) {
|
|
2381
2383
|
const n = e.toLowerCase();
|
|
2382
2384
|
if (!n) return [...t].sort((i, s) => i.name.localeCompare(s.name));
|
|
2383
2385
|
const o = [];
|
|
@@ -2387,23 +2389,23 @@ function Ei(e, t = ft) {
|
|
|
2387
2389
|
}
|
|
2388
2390
|
return o.sort((i, s) => i.rank - s.rank || i.cmd.name.localeCompare(s.cmd.name)).map((i) => i.cmd);
|
|
2389
2391
|
}
|
|
2390
|
-
function
|
|
2392
|
+
function Ni(e) {
|
|
2391
2393
|
return `${re}${e.name} `;
|
|
2392
2394
|
}
|
|
2393
2395
|
function Ve(e, t) {
|
|
2394
2396
|
return t <= 0 ? 0 : (e % t + t) % t;
|
|
2395
2397
|
}
|
|
2396
|
-
function
|
|
2398
|
+
function Pi(e, t = ft) {
|
|
2397
2399
|
const n = e.trim();
|
|
2398
2400
|
if (!n) return null;
|
|
2399
2401
|
if (!n.startsWith(re)) return { kind: "chat", text: n };
|
|
2400
2402
|
const o = n.slice(re.length), i = o.search(/\s/), s = (i === -1 ? o : o.slice(0, i)).toLowerCase(), a = i === -1 ? "" : o.slice(i).trim(), c = t.find((f) => f.name.toLowerCase() === s);
|
|
2401
2403
|
return c ? { kind: "command", command: c, args: a } : { kind: "chat", text: n };
|
|
2402
2404
|
}
|
|
2403
|
-
function
|
|
2405
|
+
function Mi(e, t) {
|
|
2404
2406
|
return e.requiresMedia && !t.hasMedia ? `${re}${e.name} needs an episode loaded.` : null;
|
|
2405
2407
|
}
|
|
2406
|
-
function
|
|
2408
|
+
function Oi({
|
|
2407
2409
|
commands: e,
|
|
2408
2410
|
activeIndex: t,
|
|
2409
2411
|
hasMedia: n,
|
|
@@ -2445,7 +2447,7 @@ function Mi({
|
|
|
2445
2447
|
}
|
|
2446
2448
|
);
|
|
2447
2449
|
}
|
|
2448
|
-
function
|
|
2450
|
+
function Ri({
|
|
2449
2451
|
pending: e,
|
|
2450
2452
|
uploading: t,
|
|
2451
2453
|
onRemove: n
|
|
@@ -2472,24 +2474,24 @@ function Oi({
|
|
|
2472
2474
|
)
|
|
2473
2475
|
] }, o.id)) }) : null;
|
|
2474
2476
|
}
|
|
2475
|
-
function
|
|
2477
|
+
function Di() {
|
|
2476
2478
|
const [e, t] = P([]), [n, o] = P(!1), i = m((h) => h.pushToast), s = J(/* @__PURE__ */ new Set());
|
|
2477
2479
|
O(() => () => {
|
|
2478
2480
|
for (const h of s.current) URL.revokeObjectURL(h);
|
|
2479
2481
|
s.current.clear();
|
|
2480
2482
|
}, []);
|
|
2481
2483
|
const a = N((h) => {
|
|
2482
|
-
|
|
2484
|
+
Or(h) && (URL.revokeObjectURL(h.previewUrl), s.current.delete(h.previewUrl));
|
|
2483
2485
|
}, []), c = N(async (h) => {
|
|
2484
2486
|
if (!h.length) return;
|
|
2485
2487
|
const _ = [];
|
|
2486
2488
|
for (const w of h) {
|
|
2487
|
-
const k =
|
|
2489
|
+
const k = Dr(w);
|
|
2488
2490
|
if (k) {
|
|
2489
2491
|
i("error", k);
|
|
2490
2492
|
continue;
|
|
2491
2493
|
}
|
|
2492
|
-
const { w: u, h: v } = await
|
|
2494
|
+
const { w: u, h: v } = await Ur(w), E = URL.createObjectURL(w);
|
|
2493
2495
|
s.current.add(E), _.push({
|
|
2494
2496
|
kind: "file",
|
|
2495
2497
|
id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
@@ -2536,10 +2538,10 @@ function Ri() {
|
|
|
2536
2538
|
return [];
|
|
2537
2539
|
});
|
|
2538
2540
|
}, [a]), D = N((h) => {
|
|
2539
|
-
const _ =
|
|
2541
|
+
const _ = Lr(h.clipboardData);
|
|
2540
2542
|
_.length && (h.preventDefault(), c(_));
|
|
2541
2543
|
}, [c]), M = N((h) => {
|
|
2542
|
-
const _ =
|
|
2544
|
+
const _ = jr(h.dataTransfer);
|
|
2543
2545
|
_.length && (h.preventDefault(), c(_));
|
|
2544
2546
|
}, [c]), T = N((h) => {
|
|
2545
2547
|
h.dataTransfer?.types?.includes("Files") && h.preventDefault();
|
|
@@ -2547,9 +2549,9 @@ function Ri() {
|
|
|
2547
2549
|
if (!e.length) return [];
|
|
2548
2550
|
o(!0);
|
|
2549
2551
|
try {
|
|
2550
|
-
return await
|
|
2552
|
+
return await Hr(e);
|
|
2551
2553
|
} catch (h) {
|
|
2552
|
-
return A("chat", "Image upload failed",
|
|
2554
|
+
return A("chat", "Image upload failed", $r(h)), i("error", Rr(h)), null;
|
|
2553
2555
|
} finally {
|
|
2554
2556
|
o(!1);
|
|
2555
2557
|
}
|
|
@@ -2567,16 +2569,16 @@ function Ri() {
|
|
|
2567
2569
|
onDragOver: T
|
|
2568
2570
|
};
|
|
2569
2571
|
}
|
|
2570
|
-
const Ut = Yt,
|
|
2571
|
-
function
|
|
2572
|
-
const [t, n] = P(""), [o, i] = P(!1), [s, a] = P({ q: null, i: 0 }), [c, f] = P(!1), g = J(null), p = On(), [D, M] = P(!1), [T, C] = P(!1), h =
|
|
2573
|
-
() => E === null ? [] :
|
|
2572
|
+
const Ut = Yt, Li = Zn;
|
|
2573
|
+
function ji({ commands: e = ft }) {
|
|
2574
|
+
const [t, n] = P(""), [o, i] = P(!1), [s, a] = P({ q: null, i: 0 }), [c, f] = P(!1), g = J(null), p = On(), [D, M] = P(!1), [T, C] = P(!1), h = Di(), _ = m((y) => y.snapshot.mediaId), w = m((y) => y.pushToast), k = m((y) => y.setTierlistOpen), u = m((y) => y.setCharacterModalOpen), v = !!_, E = Ei(t), U = Q(
|
|
2575
|
+
() => E === null ? [] : Ai(E, e),
|
|
2574
2576
|
[E, e]
|
|
2575
2577
|
), H = E !== null && !c && U.length > 0, S = s.q === E ? Ve(s.i, U.length) : 0, R = N(
|
|
2576
2578
|
(y) => a({ q: E, i: y }),
|
|
2577
2579
|
[E]
|
|
2578
2580
|
), L = N((y, j) => {
|
|
2579
|
-
const ae =
|
|
2581
|
+
const ae = Mi(y, { hasMedia: v });
|
|
2580
2582
|
if (ae) {
|
|
2581
2583
|
w("info", ae);
|
|
2582
2584
|
return;
|
|
@@ -2586,10 +2588,10 @@ function Li({ commands: e = ft }) {
|
|
|
2586
2588
|
w("info", e.map((Mn) => Mn.usage).join(" "));
|
|
2587
2589
|
break;
|
|
2588
2590
|
case "recap":
|
|
2589
|
-
|
|
2591
|
+
vi();
|
|
2590
2592
|
break;
|
|
2591
2593
|
case "tierlist":
|
|
2592
|
-
|
|
2594
|
+
Do(), k(!0);
|
|
2593
2595
|
break;
|
|
2594
2596
|
case "character":
|
|
2595
2597
|
u(!0);
|
|
@@ -2598,10 +2600,10 @@ function Li({ commands: e = ft }) {
|
|
|
2598
2600
|
w("info", `${y.usage} is not implemented yet.`);
|
|
2599
2601
|
}
|
|
2600
2602
|
}, [v, w, e, k, u]), F = N((y) => {
|
|
2601
|
-
n(
|
|
2603
|
+
n(Ni(y)), f(!1), g.current?.focus();
|
|
2602
2604
|
}, []), W = N(async (y) => {
|
|
2603
2605
|
if (y.preventDefault(), o || h.uploading) return;
|
|
2604
|
-
const j =
|
|
2606
|
+
const j = Pi(t, e);
|
|
2605
2607
|
if (!j && !h.pending.length) return;
|
|
2606
2608
|
if (j?.kind === "command" && h.pending.length) {
|
|
2607
2609
|
w("info", "Send images on their own, not with a command.");
|
|
@@ -2612,7 +2614,7 @@ function Li({ commands: e = ft }) {
|
|
|
2612
2614
|
return;
|
|
2613
2615
|
}
|
|
2614
2616
|
const ae = await h.uploadPending();
|
|
2615
|
-
ae !== null && (
|
|
2617
|
+
ae !== null && (fi(j?.text ?? "", ae), n(""), h.clear(), i(!0), setTimeout(() => i(!1), Li), !document.hidden && document.hasFocus() && g.current?.focus());
|
|
2616
2618
|
}, [t, o, L, h, w, e]), Pn = N((y) => {
|
|
2617
2619
|
if (y.key === "Escape" && H) {
|
|
2618
2620
|
y.preventDefault(), f(!0);
|
|
@@ -2652,10 +2654,10 @@ function Li({ commands: e = ft }) {
|
|
|
2652
2654
|
onDragOver: h.onDragOver,
|
|
2653
2655
|
className: "p-2 border-t border-border",
|
|
2654
2656
|
children: [
|
|
2655
|
-
/* @__PURE__ */ l(
|
|
2657
|
+
/* @__PURE__ */ l(Ri, { pending: h.pending, uploading: h.uploading, onRemove: h.remove }),
|
|
2656
2658
|
/* @__PURE__ */ b("div", { className: "relative", children: [
|
|
2657
2659
|
H && /* @__PURE__ */ l(
|
|
2658
|
-
|
|
2660
|
+
Oi,
|
|
2659
2661
|
{
|
|
2660
2662
|
commands: U,
|
|
2661
2663
|
activeIndex: S,
|
|
@@ -2666,7 +2668,7 @@ function Li({ commands: e = ft }) {
|
|
|
2666
2668
|
}
|
|
2667
2669
|
),
|
|
2668
2670
|
/* @__PURE__ */ l(
|
|
2669
|
-
|
|
2671
|
+
qr,
|
|
2670
2672
|
{
|
|
2671
2673
|
open: D,
|
|
2672
2674
|
onClose: () => M(!1),
|
|
@@ -2719,7 +2721,7 @@ function Li({ commands: e = ft }) {
|
|
|
2719
2721
|
}
|
|
2720
2722
|
);
|
|
2721
2723
|
}
|
|
2722
|
-
function
|
|
2724
|
+
function Ui() {
|
|
2723
2725
|
const e = m((n) => n.roster), t = Object.values(e);
|
|
2724
2726
|
return t.length ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: t.map((n) => {
|
|
2725
2727
|
const o = _n(n.sprite);
|
|
@@ -2738,7 +2740,7 @@ function ji() {
|
|
|
2738
2740
|
] }, n.clientId);
|
|
2739
2741
|
}) }) : /* @__PURE__ */ l("div", { className: "text-xs text-text-muted", children: "No users online" });
|
|
2740
2742
|
}
|
|
2741
|
-
function
|
|
2743
|
+
function Fi() {
|
|
2742
2744
|
const e = m((i) => Object.keys(i.roster).length), [t, n] = P(!1), o = J(null);
|
|
2743
2745
|
return O(() => {
|
|
2744
2746
|
if (!t) return;
|
|
@@ -2766,11 +2768,11 @@ function Ui() {
|
|
|
2766
2768
|
e,
|
|
2767
2769
|
" online"
|
|
2768
2770
|
] }),
|
|
2769
|
-
/* @__PURE__ */ l(
|
|
2771
|
+
/* @__PURE__ */ l(Ui, {})
|
|
2770
2772
|
] })
|
|
2771
2773
|
] });
|
|
2772
2774
|
}
|
|
2773
|
-
function
|
|
2775
|
+
function Hi() {
|
|
2774
2776
|
const e = m((n) => n.sprite), t = m((n) => n.setCharacterModalOpen);
|
|
2775
2777
|
return /* @__PURE__ */ l(
|
|
2776
2778
|
"button",
|
|
@@ -2793,9 +2795,9 @@ function Fi() {
|
|
|
2793
2795
|
}
|
|
2794
2796
|
);
|
|
2795
2797
|
}
|
|
2796
|
-
const se =
|
|
2797
|
-
function
|
|
2798
|
-
const i =
|
|
2798
|
+
const se = yo();
|
|
2799
|
+
function $i({ open: e, onClose: t, roomKey: n, tierlist: o }) {
|
|
2800
|
+
const i = zr(), { name: s, sprite: a, setIdentity: c } = m(), f = m((u) => !!(u.me.clientId && u.roster[u.me.clientId]?.registryName)), [g, p] = P(a), [D, M] = P(/* @__PURE__ */ new Set()), [T, C] = P(() => xt(se, a));
|
|
2799
2801
|
O(() => {
|
|
2800
2802
|
e && (p(a), C(xt(se, a)));
|
|
2801
2803
|
}, [e, a]), O(() => {
|
|
@@ -2807,7 +2809,7 @@ function Hi({ open: e, onClose: t, roomKey: n, tierlist: o }) {
|
|
|
2807
2809
|
}, [e, n]);
|
|
2808
2810
|
const h = () => {
|
|
2809
2811
|
const u = f || !g ? s : te(g);
|
|
2810
|
-
d("character", "Updating identity", { name: u, sprite: g }), c(u, g),
|
|
2812
|
+
d("character", "Updating identity", { name: u, sprite: g }), c(u, g), gi(u, g || void 0), t();
|
|
2811
2813
|
}, _ = (u) => u === a ? !0 : !D.has(u), w = (u) => {
|
|
2812
2814
|
u.target === u.currentTarget && t();
|
|
2813
2815
|
};
|
|
@@ -2954,38 +2956,38 @@ function Ht({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
|
|
|
2954
2956
|
}, [t, n]), /* @__PURE__ */ l("div", { className: `${e} flex flex-col gap-2 z-50`, children: t.map((o) => /* @__PURE__ */ l("div", { className: `px-3 py-2 rounded text-sm shadow font-medium border ${o.kind === "error" ? "bg-danger-bg text-on-danger-bg border-danger" : "bg-bg-card border-border-light text-text"}`, children: o.msg }, o.id)) });
|
|
2955
2957
|
}
|
|
2956
2958
|
const $t = (e) => typeof e == "string" && Dn.includes(e);
|
|
2957
|
-
function
|
|
2959
|
+
function Bi(e, t, n) {
|
|
2958
2960
|
return e || ($t(t) ? t : $t(n) ? n : "dark");
|
|
2959
2961
|
}
|
|
2960
|
-
function
|
|
2962
|
+
function Gi(e, t) {
|
|
2961
2963
|
if (t(e.clientWidth), typeof ResizeObserver > "u") return () => {
|
|
2962
2964
|
};
|
|
2963
2965
|
const n = new ResizeObserver(() => t(e.clientWidth));
|
|
2964
2966
|
return n.observe(e), () => n.disconnect();
|
|
2965
2967
|
}
|
|
2966
|
-
function
|
|
2968
|
+
function Wi(e) {
|
|
2967
2969
|
const t = e?.trim() ?? "";
|
|
2968
2970
|
return t ? { source: "host", name: t } : { source: "auto" };
|
|
2969
2971
|
}
|
|
2970
|
-
function
|
|
2972
|
+
function Ki(e) {
|
|
2971
2973
|
if (e.source !== "host") return;
|
|
2972
2974
|
const { setSessionIdentity: t, sprite: n } = m.getState();
|
|
2973
2975
|
t(e.name, n);
|
|
2974
2976
|
}
|
|
2975
|
-
function
|
|
2977
|
+
function qi({ className: e = "w-4 h-4" }) {
|
|
2976
2978
|
return /* @__PURE__ */ b("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
2977
2979
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v16" }),
|
|
2978
2980
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12l-5 4v-8l5 4z" })
|
|
2979
2981
|
] });
|
|
2980
2982
|
}
|
|
2981
|
-
function
|
|
2983
|
+
function Vi({ className: e = "w-4 h-4" }) {
|
|
2982
2984
|
return /* @__PURE__ */ b("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
2983
2985
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 4v16" }),
|
|
2984
2986
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l5 4v-8l-5 4z" })
|
|
2985
2987
|
] });
|
|
2986
2988
|
}
|
|
2987
|
-
const
|
|
2988
|
-
function
|
|
2989
|
+
const zi = 1500;
|
|
2990
|
+
function sa({
|
|
2989
2991
|
roomKey: e,
|
|
2990
2992
|
serverOrigin: t,
|
|
2991
2993
|
userType: n,
|
|
@@ -2998,8 +3000,8 @@ function aa({
|
|
|
2998
3000
|
debug: g,
|
|
2999
3001
|
children: p
|
|
3000
3002
|
}) {
|
|
3001
|
-
const [D, M] = P(null), { setFrame: T, ...C } =
|
|
3002
|
-
() =>
|
|
3003
|
+
const [D, M] = P(null), { setFrame: T, ...C } = Yi(c, f), h = m((S) => S.characterModalOpen), _ = m((S) => S.setCharacterModalOpen), w = Kt(() => s), k = Q(() => (go({ userType: n, userId: o ?? null }), dt().theme), [n, o]), u = Ln(), v = u?.theme, E = Q(
|
|
3004
|
+
() => Bi(i, v, k),
|
|
3003
3005
|
[i, v, k]
|
|
3004
3006
|
);
|
|
3005
3007
|
O(() => {
|
|
@@ -3009,30 +3011,30 @@ function aa({
|
|
|
3009
3011
|
[t, e]
|
|
3010
3012
|
);
|
|
3011
3013
|
return O(() => {
|
|
3012
|
-
g &&
|
|
3014
|
+
g && Zr();
|
|
3013
3015
|
}, [g]), O(() => {
|
|
3014
|
-
|
|
3016
|
+
Vr({ serverOrigin: t, defaultRoomKey: e }), m.getState().rehydrateFromPrefs(), qo();
|
|
3015
3017
|
let S = !1;
|
|
3016
|
-
const R =
|
|
3018
|
+
const R = vo();
|
|
3017
3019
|
return (async () => {
|
|
3018
3020
|
try {
|
|
3019
3021
|
await Promise.race([
|
|
3020
3022
|
Promise.all([
|
|
3021
3023
|
R,
|
|
3022
|
-
|
|
3024
|
+
ko().then((W) => {
|
|
3023
3025
|
W && m.getState().rehydrateFromPrefs();
|
|
3024
3026
|
})
|
|
3025
3027
|
]),
|
|
3026
|
-
new Promise((W) => setTimeout(W,
|
|
3028
|
+
new Promise((W) => setTimeout(W, zi))
|
|
3027
3029
|
]);
|
|
3028
3030
|
} catch (W) {
|
|
3029
3031
|
A("room-chrome", "pre-join wait threw, proceeding anyway", ge(W));
|
|
3030
3032
|
}
|
|
3031
3033
|
if (S) return;
|
|
3032
|
-
const L =
|
|
3033
|
-
m.getState().ensureAutoIdentity(),
|
|
3034
|
+
const L = Wi(w());
|
|
3035
|
+
m.getState().ensureAutoIdentity(), Ki(L);
|
|
3034
3036
|
const F = m.getState();
|
|
3035
|
-
d("room-chrome", "Joining room", { roomKey: e, name: F.name, sprite: F.sprite }),
|
|
3037
|
+
d("room-chrome", "Joining room", { roomKey: e, name: F.name, sprite: F.sprite }), ni({ room_key: e, name: F.name || void 0, sprite: F.sprite || void 0 });
|
|
3036
3038
|
})(), () => {
|
|
3037
3039
|
S = !0, jt();
|
|
3038
3040
|
};
|
|
@@ -3056,7 +3058,7 @@ function aa({
|
|
|
3056
3058
|
title: "Show chat",
|
|
3057
3059
|
"aria-label": "Show chat",
|
|
3058
3060
|
"aria-expanded": !1,
|
|
3059
|
-
children: /* @__PURE__ */ l(
|
|
3061
|
+
children: /* @__PURE__ */ l(Vi, {})
|
|
3060
3062
|
}
|
|
3061
3063
|
),
|
|
3062
3064
|
/* @__PURE__ */ l(Ht, { className: "absolute bottom-2 right-full mr-2 w-72" })
|
|
@@ -3081,8 +3083,8 @@ function aa({
|
|
|
3081
3083
|
}
|
|
3082
3084
|
),
|
|
3083
3085
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-1 px-2 py-1.5 border-b border-border", children: [
|
|
3084
|
-
/* @__PURE__ */ l(Ui, {}),
|
|
3085
3086
|
/* @__PURE__ */ l(Fi, {}),
|
|
3087
|
+
/* @__PURE__ */ l(Hi, {}),
|
|
3086
3088
|
/* @__PURE__ */ l("div", { className: "flex-1" }),
|
|
3087
3089
|
a && /* @__PURE__ */ l(
|
|
3088
3090
|
"button",
|
|
@@ -3104,27 +3106,27 @@ function aa({
|
|
|
3104
3106
|
title: "Hide chat",
|
|
3105
3107
|
"aria-label": "Hide chat",
|
|
3106
3108
|
"aria-expanded": !0,
|
|
3107
|
-
children: /* @__PURE__ */ l(
|
|
3109
|
+
children: /* @__PURE__ */ l(qi, {})
|
|
3108
3110
|
}
|
|
3109
3111
|
)
|
|
3110
3112
|
] }),
|
|
3111
|
-
/* @__PURE__ */ l(
|
|
3112
|
-
/* @__PURE__ */ l(
|
|
3113
|
+
/* @__PURE__ */ l(Ti, {}),
|
|
3114
|
+
/* @__PURE__ */ l(ji, { commands: [] }),
|
|
3113
3115
|
/* @__PURE__ */ l(Ht, { className: "absolute bottom-14 left-2 right-2" })
|
|
3114
3116
|
] }),
|
|
3115
|
-
h && /* @__PURE__ */ l(
|
|
3117
|
+
h && /* @__PURE__ */ l($i, { open: !0, onClose: () => _(!1), roomKey: e })
|
|
3116
3118
|
]
|
|
3117
3119
|
}
|
|
3118
3120
|
)
|
|
3119
3121
|
] }) }) });
|
|
3120
3122
|
}
|
|
3121
|
-
function
|
|
3123
|
+
function Yi(e, t) {
|
|
3122
3124
|
const n = m((u) => u.chromeChatCollapsed) && t, o = m((u) => u.chromeChatWidth), i = m((u) => u.toggleChromeChatCollapsed), s = m((u) => u.setChromeChatWidth), [a, c] = P(null), [f, g] = P(void 0), [p, D] = P(null);
|
|
3123
3125
|
O(() => {
|
|
3124
3126
|
if (a)
|
|
3125
|
-
return
|
|
3127
|
+
return Gi(a, g);
|
|
3126
3128
|
}, [a]);
|
|
3127
|
-
const M = V(p?.current ?? o, f), T = Q(() =>
|
|
3129
|
+
const M = V(p?.current ?? o, f), T = Q(() => No(n, M), [n, M]), C = Kt((u) => e?.(u));
|
|
3128
3130
|
return O(() => {
|
|
3129
3131
|
C(T);
|
|
3130
3132
|
}, [T]), {
|
|
@@ -3145,12 +3147,12 @@ function zi(e, t) {
|
|
|
3145
3147
|
D(null), v !== o && s(v);
|
|
3146
3148
|
},
|
|
3147
3149
|
onKeyDown: (u) => {
|
|
3148
|
-
const v =
|
|
3150
|
+
const v = Ao(M, u.key, f);
|
|
3149
3151
|
v !== null && (u.preventDefault(), v !== o && s(v));
|
|
3150
3152
|
}
|
|
3151
3153
|
};
|
|
3152
3154
|
}
|
|
3153
3155
|
export {
|
|
3154
|
-
|
|
3156
|
+
sa as RoomChrome
|
|
3155
3157
|
};
|
|
3156
3158
|
//# sourceMappingURL=room-chrome.js.map
|