@burdenoff/microfe-eventfullymanaged 2026.1123.4 → 2026.1123.5
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/eventfullymanaged/api/virtualEngagementApi.d.ts +74 -0
- package/dist/eventfullymanaged/api/virtualEngagementApi.js +87 -0
- package/dist/eventfullymanaged/api/virtualEngagementApi.js.map +1 -0
- package/dist/eventfullymanaged/pages/events/VirtualEngagementPanel.d.ts +4 -0
- package/dist/eventfullymanaged/pages/events/VirtualEngagementPanel.js +324 -0
- package/dist/eventfullymanaged/pages/events/VirtualEngagementPanel.js.map +1 -0
- package/dist/eventfullymanaged/pages/events/VirtualSessionPage.js +151 -146
- package/dist/eventfullymanaged/pages/events/VirtualSessionPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useMutation, useQuery } from '@apollo/client/react';
|
|
2
|
+
export interface VirtualPoll {
|
|
3
|
+
id: string;
|
|
4
|
+
prompt: string;
|
|
5
|
+
options: string[];
|
|
6
|
+
status: 'OPEN' | 'CLOSED';
|
|
7
|
+
voteCounts: number[];
|
|
8
|
+
myOptionIndex: number | null;
|
|
9
|
+
}
|
|
10
|
+
export interface VirtualQuestion {
|
|
11
|
+
id: string;
|
|
12
|
+
text: string;
|
|
13
|
+
status: 'PENDING' | 'APPROVED' | 'REJECTED';
|
|
14
|
+
isOwn: boolean;
|
|
15
|
+
}
|
|
16
|
+
type SessionVariables = {
|
|
17
|
+
sessionId: string;
|
|
18
|
+
};
|
|
19
|
+
type PageVariables = SessionVariables & {
|
|
20
|
+
limit: number;
|
|
21
|
+
offset: number;
|
|
22
|
+
};
|
|
23
|
+
type Page<T> = {
|
|
24
|
+
items: T[];
|
|
25
|
+
hasMore: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare const liveVirtualPollsDocument: import('graphql').DocumentNode;
|
|
28
|
+
export declare const liveVirtualQuestionsDocument: import('graphql').DocumentNode;
|
|
29
|
+
export declare const openVirtualPollDocument: import('graphql').DocumentNode;
|
|
30
|
+
export declare const closeVirtualPollDocument: import('graphql').DocumentNode;
|
|
31
|
+
export declare const voteVirtualPollDocument: import('graphql').DocumentNode;
|
|
32
|
+
export declare const askVirtualQuestionDocument: import('graphql').DocumentNode;
|
|
33
|
+
export declare const moderateVirtualQuestionDocument: import('graphql').DocumentNode;
|
|
34
|
+
export declare const virtualEngagementChangedSubscription = "\n subscription VirtualEngagementChanged($sessionId: ID!) {\n eventfullyManagedVirtualEngagementChanged(sessionId: $sessionId)\n }\n";
|
|
35
|
+
export declare const useLiveVirtualPolls: (variables: PageVariables) => useQuery.Result<{
|
|
36
|
+
polls: Page<VirtualPoll>;
|
|
37
|
+
}, PageVariables, "empty" | "complete" | "streaming", PageVariables, undefined>;
|
|
38
|
+
export declare const useLiveVirtualQuestions: (variables: PageVariables) => useQuery.Result<{
|
|
39
|
+
questions: Page<VirtualQuestion>;
|
|
40
|
+
}, PageVariables, "empty" | "complete" | "streaming", PageVariables, undefined>;
|
|
41
|
+
export declare const useOpenVirtualPoll: () => useMutation.ResultTuple<{
|
|
42
|
+
poll: VirtualPoll;
|
|
43
|
+
}, {
|
|
44
|
+
sessionId: string;
|
|
45
|
+
prompt: string;
|
|
46
|
+
options: string[];
|
|
47
|
+
}, import('@apollo/client').ApolloCache, undefined>;
|
|
48
|
+
export declare const useCloseVirtualPoll: () => useMutation.ResultTuple<{
|
|
49
|
+
poll: VirtualPoll;
|
|
50
|
+
}, {
|
|
51
|
+
sessionId: string;
|
|
52
|
+
pollId: string;
|
|
53
|
+
}, import('@apollo/client').ApolloCache, undefined>;
|
|
54
|
+
export declare const useVoteVirtualPoll: () => useMutation.ResultTuple<{
|
|
55
|
+
poll: VirtualPoll;
|
|
56
|
+
}, {
|
|
57
|
+
sessionId: string;
|
|
58
|
+
pollId: string;
|
|
59
|
+
optionIndex: number;
|
|
60
|
+
}, import('@apollo/client').ApolloCache, undefined>;
|
|
61
|
+
export declare const useAskVirtualQuestion: () => useMutation.ResultTuple<{
|
|
62
|
+
question: VirtualQuestion;
|
|
63
|
+
}, {
|
|
64
|
+
text: string;
|
|
65
|
+
sessionId: string;
|
|
66
|
+
}, import('@apollo/client').ApolloCache, undefined>;
|
|
67
|
+
export declare const useModerateVirtualQuestion: () => useMutation.ResultTuple<{
|
|
68
|
+
question: VirtualQuestion;
|
|
69
|
+
}, {
|
|
70
|
+
sessionId: string;
|
|
71
|
+
questionId: string;
|
|
72
|
+
decision: "APPROVE" | "REJECT";
|
|
73
|
+
}, import('@apollo/client').ApolloCache, undefined>;
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { gql as e } from "../../node_modules/graphql-tag/lib/index.js";
|
|
2
|
+
import { useMutation as t } from "../../node_modules/@apollo/client/react/hooks/useMutation.js";
|
|
3
|
+
import { useQuery as n } from "../../node_modules/@apollo/client/react/hooks/useQuery.js";
|
|
4
|
+
// src/eventfullymanaged/api/virtualEngagementApi.ts
|
|
5
|
+
var r = e`
|
|
6
|
+
fragment LiveVirtualPoll on EventfullyManagedVirtualPoll {
|
|
7
|
+
id
|
|
8
|
+
prompt
|
|
9
|
+
options
|
|
10
|
+
status
|
|
11
|
+
voteCounts
|
|
12
|
+
myOptionIndex
|
|
13
|
+
}
|
|
14
|
+
`, i = e`
|
|
15
|
+
fragment LiveVirtualQuestion on EventfullyManagedVirtualQuestion {
|
|
16
|
+
id
|
|
17
|
+
text
|
|
18
|
+
status
|
|
19
|
+
isOwn
|
|
20
|
+
}
|
|
21
|
+
`, a = e`
|
|
22
|
+
query LiveVirtualPolls($sessionId: ID!, $limit: Int!, $offset: Int!) {
|
|
23
|
+
polls: eventfullyManagedVirtualPolls(sessionId: $sessionId, limit: $limit, offset: $offset) {
|
|
24
|
+
items {
|
|
25
|
+
...LiveVirtualPoll
|
|
26
|
+
}
|
|
27
|
+
hasMore
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
${r}
|
|
31
|
+
`, o = e`
|
|
32
|
+
query LiveVirtualQuestions($sessionId: ID!, $limit: Int!, $offset: Int!) {
|
|
33
|
+
questions: eventfullyManagedVirtualQuestions(sessionId: $sessionId, limit: $limit, offset: $offset) {
|
|
34
|
+
items {
|
|
35
|
+
...LiveVirtualQuestion
|
|
36
|
+
}
|
|
37
|
+
hasMore
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
${i}
|
|
41
|
+
`, s = e`
|
|
42
|
+
mutation OpenVirtualPoll($sessionId: ID!, $prompt: String!, $options: [String!]!) {
|
|
43
|
+
poll: eventfullyManagedOpenVirtualPoll(sessionId: $sessionId, prompt: $prompt, options: $options) {
|
|
44
|
+
...LiveVirtualPoll
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
${r}
|
|
48
|
+
`, c = e`
|
|
49
|
+
mutation CloseVirtualPoll($sessionId: ID!, $pollId: ID!) {
|
|
50
|
+
poll: eventfullyManagedCloseVirtualPoll(sessionId: $sessionId, pollId: $pollId) {
|
|
51
|
+
...LiveVirtualPoll
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
${r}
|
|
55
|
+
`, l = e`
|
|
56
|
+
mutation VoteVirtualPoll($sessionId: ID!, $pollId: ID!, $optionIndex: Int!) {
|
|
57
|
+
poll: eventfullyManagedVoteVirtualPoll(sessionId: $sessionId, pollId: $pollId, optionIndex: $optionIndex) {
|
|
58
|
+
...LiveVirtualPoll
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
${r}
|
|
62
|
+
`, u = e`
|
|
63
|
+
mutation AskVirtualQuestion($sessionId: ID!, $text: String!) {
|
|
64
|
+
question: eventfullyManagedAskVirtualQuestion(sessionId: $sessionId, text: $text) {
|
|
65
|
+
...LiveVirtualQuestion
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
${i}
|
|
69
|
+
`, d = e`
|
|
70
|
+
mutation ModerateVirtualQuestion(
|
|
71
|
+
$sessionId: ID!
|
|
72
|
+
$questionId: ID!
|
|
73
|
+
$decision: EventfullyManagedVirtualQuestionDecision!
|
|
74
|
+
) {
|
|
75
|
+
question: eventfullyManagedModerateVirtualQuestion(
|
|
76
|
+
sessionId: $sessionId
|
|
77
|
+
questionId: $questionId
|
|
78
|
+
decision: $decision
|
|
79
|
+
) {
|
|
80
|
+
...LiveVirtualQuestion
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
${i}
|
|
84
|
+
`, f = "\n subscription VirtualEngagementChanged($sessionId: ID!) {\n eventfullyManagedVirtualEngagementChanged(sessionId: $sessionId)\n }\n", p = (e) => n(a, { variables: e }), m = (e) => n(o, { variables: e }), h = () => t(s), g = () => t(c), _ = () => t(l), v = () => t(u), y = () => t(d);
|
|
85
|
+
export { u as askVirtualQuestionDocument, c as closeVirtualPollDocument, a as liveVirtualPollsDocument, o as liveVirtualQuestionsDocument, d as moderateVirtualQuestionDocument, s as openVirtualPollDocument, v as useAskVirtualQuestion, g as useCloseVirtualPoll, p as useLiveVirtualPolls, m as useLiveVirtualQuestions, y as useModerateVirtualQuestion, h as useOpenVirtualPoll, _ as useVoteVirtualPoll, f as virtualEngagementChangedSubscription, l as voteVirtualPollDocument };
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=virtualEngagementApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtualEngagementApi.js","names":["pollFields","questionFields","liveVirtualPollsDocument","liveVirtualQuestionsDocument","openVirtualPollDocument","closeVirtualPollDocument","voteVirtualPollDocument","askVirtualQuestionDocument","moderateVirtualQuestionDocument","virtualEngagementChangedSubscription","useLiveVirtualPolls","useQuery","useLiveVirtualQuestions","useOpenVirtualPoll","useMutation","useCloseVirtualPoll","useVoteVirtualPoll","useAskVirtualQuestion","useModerateVirtualQuestion"],"sources":["../../../src/eventfullymanaged/api/virtualEngagementApi.ts"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\n\nexport interface VirtualPoll {\n id: string;\n prompt: string;\n options: string[];\n status: 'OPEN' | 'CLOSED';\n voteCounts: number[];\n myOptionIndex: number | null;\n}\n\nexport interface VirtualQuestion {\n id: string;\n text: string;\n status: 'PENDING' | 'APPROVED' | 'REJECTED';\n isOwn: boolean;\n}\n\ntype SessionVariables = { sessionId: string };\ntype PollVariables = SessionVariables & { pollId: string };\ntype PageVariables = SessionVariables & { limit: number; offset: number };\ntype Page<T> = { items: T[]; hasMore: boolean };\n\nconst pollFields = gql`\n fragment LiveVirtualPoll on EventfullyManagedVirtualPoll {\n id\n prompt\n options\n status\n voteCounts\n myOptionIndex\n }\n`;\n\nconst questionFields = gql`\n fragment LiveVirtualQuestion on EventfullyManagedVirtualQuestion {\n id\n text\n status\n isOwn\n }\n`;\n\nexport const liveVirtualPollsDocument = gql`\n query LiveVirtualPolls($sessionId: ID!, $limit: Int!, $offset: Int!) {\n polls: eventfullyManagedVirtualPolls(sessionId: $sessionId, limit: $limit, offset: $offset) {\n items {\n ...LiveVirtualPoll\n }\n hasMore\n }\n }\n ${pollFields}\n`;\n\nexport const liveVirtualQuestionsDocument = gql`\n query LiveVirtualQuestions($sessionId: ID!, $limit: Int!, $offset: Int!) {\n questions: eventfullyManagedVirtualQuestions(sessionId: $sessionId, limit: $limit, offset: $offset) {\n items {\n ...LiveVirtualQuestion\n }\n hasMore\n }\n }\n ${questionFields}\n`;\n\nexport const openVirtualPollDocument = gql`\n mutation OpenVirtualPoll($sessionId: ID!, $prompt: String!, $options: [String!]!) {\n poll: eventfullyManagedOpenVirtualPoll(sessionId: $sessionId, prompt: $prompt, options: $options) {\n ...LiveVirtualPoll\n }\n }\n ${pollFields}\n`;\n\nexport const closeVirtualPollDocument = gql`\n mutation CloseVirtualPoll($sessionId: ID!, $pollId: ID!) {\n poll: eventfullyManagedCloseVirtualPoll(sessionId: $sessionId, pollId: $pollId) {\n ...LiveVirtualPoll\n }\n }\n ${pollFields}\n`;\n\nexport const voteVirtualPollDocument = gql`\n mutation VoteVirtualPoll($sessionId: ID!, $pollId: ID!, $optionIndex: Int!) {\n poll: eventfullyManagedVoteVirtualPoll(sessionId: $sessionId, pollId: $pollId, optionIndex: $optionIndex) {\n ...LiveVirtualPoll\n }\n }\n ${pollFields}\n`;\n\nexport const askVirtualQuestionDocument = gql`\n mutation AskVirtualQuestion($sessionId: ID!, $text: String!) {\n question: eventfullyManagedAskVirtualQuestion(sessionId: $sessionId, text: $text) {\n ...LiveVirtualQuestion\n }\n }\n ${questionFields}\n`;\n\nexport const moderateVirtualQuestionDocument = gql`\n mutation ModerateVirtualQuestion(\n $sessionId: ID!\n $questionId: ID!\n $decision: EventfullyManagedVirtualQuestionDecision!\n ) {\n question: eventfullyManagedModerateVirtualQuestion(\n sessionId: $sessionId\n questionId: $questionId\n decision: $decision\n ) {\n ...LiveVirtualQuestion\n }\n }\n ${questionFields}\n`;\n\nexport const virtualEngagementChangedSubscription = `\n subscription VirtualEngagementChanged($sessionId: ID!) {\n eventfullyManagedVirtualEngagementChanged(sessionId: $sessionId)\n }\n`;\n\nexport const useLiveVirtualPolls = (variables: PageVariables) =>\n useQuery<{ polls: Page<VirtualPoll> }, PageVariables>(liveVirtualPollsDocument, { variables });\n\nexport const useLiveVirtualQuestions = (variables: PageVariables) =>\n useQuery<{ questions: Page<VirtualQuestion> }, PageVariables>(liveVirtualQuestionsDocument, { variables });\n\nexport const useOpenVirtualPoll = () =>\n useMutation<{ poll: VirtualPoll }, SessionVariables & { prompt: string; options: string[] }>(openVirtualPollDocument);\n\nexport const useCloseVirtualPoll = () => useMutation<{ poll: VirtualPoll }, PollVariables>(closeVirtualPollDocument);\n\nexport const useVoteVirtualPoll = () =>\n useMutation<{ poll: VirtualPoll }, PollVariables & { optionIndex: number }>(voteVirtualPollDocument);\n\nexport const useAskVirtualQuestion = () =>\n useMutation<{ question: VirtualQuestion }, SessionVariables & { text: string }>(askVirtualQuestionDocument);\n\nexport const useModerateVirtualQuestion = () =>\n useMutation<{ question: VirtualQuestion }, SessionVariables & { questionId: string; decision: 'APPROVE' | 'REJECT' }>(\n moderateVirtualQuestionDocument\n );\n"],"mappings":";;;;AAwBA,IAAMA,IAAa,CAAG;;;;;;;;;GAWhBC,IAAiB,CAAG;;;;;;;GASbC,IAA2B,CAAG;;;;;;;;;IASvCF,EAAW;GAGFG,IAA+B,CAAG;;;;;;;;;IAS3CF,EAAe;GAGNG,IAA0B,CAAG;;;;;;IAMtCJ,EAAW;GAGFK,IAA2B,CAAG;;;;;;IAMvCL,EAAW;GAGFM,IAA0B,CAAG;;;;;;IAMtCN,EAAW;GAGFO,IAA6B,CAAG;;;;;;IAMzCN,EAAe;GAGNO,IAAkC,CAAG;;;;;;;;;;;;;;IAc9CP,EAAe;GAGNQ,IAAuC,6IAMvCC,KAAuB,MAClCC,EAAsDT,GAA0B,EAAE,aAAU,CAAC,GAElFU,KAA2B,MACtCD,EAA8DR,GAA8B,EAAE,aAAU,CAAC,GAE9FU,UACXC,EAA6FV,CAAuB,GAEzGW,UAA4BD,EAAkDT,CAAwB,GAEtGW,UACXF,EAA4ER,CAAuB,GAExFW,UACXH,EAAgFP,CAA0B,GAE/FW,UACXJ,EACEN,CACF"}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
|
+
import { useAskVirtualQuestion as t, useCloseVirtualPoll as n, useLiveVirtualPolls as r, useLiveVirtualQuestions as i, useModerateVirtualQuestion as a, useOpenVirtualPoll as o, useVoteVirtualPoll as s, virtualEngagementChangedSubscription as c } from "../../api/virtualEngagementApi.js";
|
|
3
|
+
import { useEvmSubscription as l } from "../../hooks/useEvmSubscription.js";
|
|
4
|
+
import { describeError as u, mutationSucceeded as d } from "../../lib/mutationResult.js";
|
|
5
|
+
import { notify as f } from "../../lib/toast.js";
|
|
6
|
+
import { useId as p, useState as m } from "react";
|
|
7
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
import { Badge as _, Button as v, GlassCard as y, Label as b, Skeleton as x, Textarea as S } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
// src/eventfullymanaged/pages/events/VirtualEngagementPanel.tsx
|
|
10
|
+
var C = 15;
|
|
11
|
+
function w({ offset: t, hasMore: n, disabled: r, onChange: i }) {
|
|
12
|
+
let a = e();
|
|
13
|
+
return t === 0 && !n ? null : /* @__PURE__ */ g("div", {
|
|
14
|
+
className: "flex gap-2",
|
|
15
|
+
children: [/* @__PURE__ */ h(v, {
|
|
16
|
+
type: "button",
|
|
17
|
+
size: "sm",
|
|
18
|
+
variant: "outline",
|
|
19
|
+
disabled: r || t === 0,
|
|
20
|
+
onClick: () => i(t - C),
|
|
21
|
+
children: a("eventfullymanaged.engagement.previous", "Previous")
|
|
22
|
+
}), /* @__PURE__ */ h(v, {
|
|
23
|
+
type: "button",
|
|
24
|
+
size: "sm",
|
|
25
|
+
variant: "outline",
|
|
26
|
+
disabled: r || !n,
|
|
27
|
+
onClick: () => i(t + C),
|
|
28
|
+
children: a("eventfullymanaged.engagement.next", "Next")
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function T({ sessionId: T, canModerate: E }) {
|
|
33
|
+
let D = e(), O = p(), [k, A] = m(0), [j, M] = m(0), [N, P] = m(""), [F, I] = m(""), [L, R] = m(""), z = r({
|
|
34
|
+
sessionId: T,
|
|
35
|
+
limit: C,
|
|
36
|
+
offset: k
|
|
37
|
+
}), B = i({
|
|
38
|
+
sessionId: T,
|
|
39
|
+
limit: C,
|
|
40
|
+
offset: j
|
|
41
|
+
}), [V, { loading: H }] = o(), [U, { loading: W }] = n(), [G, { loading: K }] = s(), [q, { loading: J }] = t(), [Y, { loading: X }] = a(), Z = async () => {
|
|
42
|
+
await Promise.allSettled([z.refetch(), B.refetch()]);
|
|
43
|
+
};
|
|
44
|
+
l({
|
|
45
|
+
query: c,
|
|
46
|
+
variables: { sessionId: T },
|
|
47
|
+
operationName: "VirtualEngagementChanged",
|
|
48
|
+
onData: (e) => {
|
|
49
|
+
e.eventfullyManagedVirtualEngagementChanged && Z();
|
|
50
|
+
},
|
|
51
|
+
pollFn: Z
|
|
52
|
+
});
|
|
53
|
+
let Q = async () => {
|
|
54
|
+
let e = D("eventfullymanaged.engagement.openFailed", "Could not open the poll"), t = F.split("\n").map((e) => e.trim()).filter(Boolean);
|
|
55
|
+
try {
|
|
56
|
+
let n = await V({ variables: {
|
|
57
|
+
sessionId: T,
|
|
58
|
+
prompt: N.trim(),
|
|
59
|
+
options: t
|
|
60
|
+
} });
|
|
61
|
+
if (!d(n, n.data?.poll?.id, e)) return;
|
|
62
|
+
P(""), I(""), A(0), await z.refetch({
|
|
63
|
+
sessionId: T,
|
|
64
|
+
limit: C,
|
|
65
|
+
offset: 0
|
|
66
|
+
});
|
|
67
|
+
} catch (t) {
|
|
68
|
+
f.error(e, u(t));
|
|
69
|
+
}
|
|
70
|
+
}, ee = async (e) => {
|
|
71
|
+
let t = D("eventfullymanaged.engagement.closeFailed", "Could not close the poll");
|
|
72
|
+
try {
|
|
73
|
+
let n = await U({ variables: {
|
|
74
|
+
sessionId: T,
|
|
75
|
+
pollId: e
|
|
76
|
+
} });
|
|
77
|
+
d(n, n.data?.poll?.id, t) && await z.refetch();
|
|
78
|
+
} catch (e) {
|
|
79
|
+
f.error(t, u(e));
|
|
80
|
+
}
|
|
81
|
+
}, te = async (e, t) => {
|
|
82
|
+
let n = D("eventfullymanaged.engagement.voteFailed", "Could not record your vote");
|
|
83
|
+
try {
|
|
84
|
+
let r = await G({ variables: {
|
|
85
|
+
sessionId: T,
|
|
86
|
+
pollId: e,
|
|
87
|
+
optionIndex: t
|
|
88
|
+
} });
|
|
89
|
+
d(r, r.data?.poll?.id, n) && await z.refetch();
|
|
90
|
+
} catch (e) {
|
|
91
|
+
f.error(n, u(e));
|
|
92
|
+
}
|
|
93
|
+
}, ne = async () => {
|
|
94
|
+
let e = D("eventfullymanaged.engagement.askFailed", "Could not submit the question");
|
|
95
|
+
try {
|
|
96
|
+
let t = await q({ variables: {
|
|
97
|
+
sessionId: T,
|
|
98
|
+
text: L.trim()
|
|
99
|
+
} });
|
|
100
|
+
if (!d(t, t.data?.question?.id, e)) return;
|
|
101
|
+
R(""), M(0), await B.refetch({
|
|
102
|
+
sessionId: T,
|
|
103
|
+
limit: C,
|
|
104
|
+
offset: 0
|
|
105
|
+
});
|
|
106
|
+
} catch (t) {
|
|
107
|
+
f.error(e, u(t));
|
|
108
|
+
}
|
|
109
|
+
}, $ = async (e, t) => {
|
|
110
|
+
let n = D("eventfullymanaged.engagement.moderateFailed", "Could not moderate the question");
|
|
111
|
+
try {
|
|
112
|
+
let r = await Y({ variables: {
|
|
113
|
+
sessionId: T,
|
|
114
|
+
questionId: e,
|
|
115
|
+
decision: t
|
|
116
|
+
} });
|
|
117
|
+
d(r, r.data?.question?.id, n) && await B.refetch();
|
|
118
|
+
} catch (e) {
|
|
119
|
+
f.error(n, u(e));
|
|
120
|
+
}
|
|
121
|
+
}, re = {
|
|
122
|
+
PENDING: D("eventfullymanaged.engagement.pending", "Pending approval"),
|
|
123
|
+
APPROVED: D("eventfullymanaged.engagement.approved", "Approved"),
|
|
124
|
+
REJECTED: D("eventfullymanaged.engagement.rejected", "Rejected")
|
|
125
|
+
};
|
|
126
|
+
return /* @__PURE__ */ g("div", {
|
|
127
|
+
className: "grid gap-4 lg:grid-cols-2",
|
|
128
|
+
children: [/* @__PURE__ */ g(y, {
|
|
129
|
+
treatment: "plain",
|
|
130
|
+
className: "space-y-4 border-border-seam p-4",
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ h("h2", {
|
|
133
|
+
className: "text-sm font-semibold text-text-primary",
|
|
134
|
+
children: D("eventfullymanaged.engagement.livePolls", "Live polls")
|
|
135
|
+
}),
|
|
136
|
+
E && /* @__PURE__ */ g("form", {
|
|
137
|
+
className: "grid gap-2 border-b border-border-seam pb-4",
|
|
138
|
+
onSubmit: (e) => {
|
|
139
|
+
e.preventDefault(), Q();
|
|
140
|
+
},
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ h(b, {
|
|
143
|
+
htmlFor: `${O}-prompt`,
|
|
144
|
+
children: D("eventfullymanaged.engagement.pollPrompt", "Poll question")
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ h(S, {
|
|
147
|
+
id: `${O}-prompt`,
|
|
148
|
+
value: N,
|
|
149
|
+
maxLength: 300,
|
|
150
|
+
rows: 2,
|
|
151
|
+
onChange: (e) => P(e.target.value)
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ h(b, {
|
|
154
|
+
htmlFor: `${O}-options`,
|
|
155
|
+
children: D("eventfullymanaged.engagement.pollOptions", "Answers, one per line")
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ h(S, {
|
|
158
|
+
id: `${O}-options`,
|
|
159
|
+
value: F,
|
|
160
|
+
maxLength: 2010,
|
|
161
|
+
rows: 3,
|
|
162
|
+
onChange: (e) => I(e.target.value)
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ h(v, {
|
|
165
|
+
type: "submit",
|
|
166
|
+
size: "sm",
|
|
167
|
+
className: "justify-self-start",
|
|
168
|
+
disabled: H || !N.trim() || !F.trim(),
|
|
169
|
+
children: D("eventfullymanaged.engagement.openPoll", "Open poll")
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
}),
|
|
173
|
+
z.error && /* @__PURE__ */ h("p", {
|
|
174
|
+
role: "alert",
|
|
175
|
+
className: "text-sm text-status-danger",
|
|
176
|
+
children: D("eventfullymanaged.engagement.pollLoadError", "Could not load live polls.")
|
|
177
|
+
}),
|
|
178
|
+
z.loading && !z.data && /* @__PURE__ */ h(x, { className: "h-12 w-full" }),
|
|
179
|
+
z.data?.polls.items.length === 0 && /* @__PURE__ */ h("p", {
|
|
180
|
+
className: "text-sm text-text-muted",
|
|
181
|
+
children: D("eventfullymanaged.engagement.noPolls", "No polls yet.")
|
|
182
|
+
}),
|
|
183
|
+
z.data?.polls.items.map((e) => /* @__PURE__ */ g("article", {
|
|
184
|
+
className: "grid gap-2 rounded-card border border-border-seam p-3",
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ g("div", {
|
|
187
|
+
className: "flex items-start justify-between gap-2",
|
|
188
|
+
children: [/* @__PURE__ */ h("h3", {
|
|
189
|
+
className: "text-sm font-semibold text-text-primary",
|
|
190
|
+
children: e.prompt
|
|
191
|
+
}), /* @__PURE__ */ h(_, {
|
|
192
|
+
variant: e.status === "OPEN" ? "success" : "secondary",
|
|
193
|
+
children: e.status === "OPEN" ? D("eventfullymanaged.engagement.open", "Open") : D("eventfullymanaged.engagement.closed", "Closed")
|
|
194
|
+
})]
|
|
195
|
+
}),
|
|
196
|
+
e.options.map((t, n) => /* @__PURE__ */ g(v, {
|
|
197
|
+
type: "button",
|
|
198
|
+
size: "sm",
|
|
199
|
+
variant: e.myOptionIndex === n ? "secondary" : "outline",
|
|
200
|
+
className: "h-auto min-h-8 justify-between gap-3 whitespace-normal text-start",
|
|
201
|
+
"aria-pressed": e.myOptionIndex === n,
|
|
202
|
+
disabled: e.status !== "OPEN" || e.myOptionIndex !== null || K,
|
|
203
|
+
onClick: () => void te(e.id, n),
|
|
204
|
+
children: [/* @__PURE__ */ h("span", { children: t }), /* @__PURE__ */ h("span", { children: e.voteCounts[n] ?? 0 })]
|
|
205
|
+
}, t)),
|
|
206
|
+
e.myOptionIndex !== null && /* @__PURE__ */ h("p", {
|
|
207
|
+
className: "text-xs text-text-muted",
|
|
208
|
+
children: D("eventfullymanaged.engagement.voteRecorded", "Your vote was recorded.")
|
|
209
|
+
}),
|
|
210
|
+
E && e.status === "OPEN" && /* @__PURE__ */ h(v, {
|
|
211
|
+
type: "button",
|
|
212
|
+
size: "sm",
|
|
213
|
+
variant: "outline",
|
|
214
|
+
disabled: W,
|
|
215
|
+
onClick: () => void ee(e.id),
|
|
216
|
+
className: "justify-self-start",
|
|
217
|
+
children: D("eventfullymanaged.engagement.closePoll", "Close poll")
|
|
218
|
+
})
|
|
219
|
+
]
|
|
220
|
+
}, e.id)),
|
|
221
|
+
/* @__PURE__ */ h(w, {
|
|
222
|
+
offset: k,
|
|
223
|
+
hasMore: z.data?.polls.hasMore ?? !1,
|
|
224
|
+
disabled: z.loading,
|
|
225
|
+
onChange: A
|
|
226
|
+
})
|
|
227
|
+
]
|
|
228
|
+
}), /* @__PURE__ */ g(y, {
|
|
229
|
+
treatment: "plain",
|
|
230
|
+
className: "space-y-4 border-border-seam p-4",
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ h("h2", {
|
|
233
|
+
className: "text-sm font-semibold text-text-primary",
|
|
234
|
+
children: D("eventfullymanaged.engagement.questions", "Questions and answers")
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ g("form", {
|
|
237
|
+
className: "grid gap-2 border-b border-border-seam pb-4",
|
|
238
|
+
onSubmit: (e) => {
|
|
239
|
+
e.preventDefault(), ne();
|
|
240
|
+
},
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ h(b, {
|
|
243
|
+
htmlFor: `${O}-question`,
|
|
244
|
+
children: D("eventfullymanaged.engagement.yourQuestion", "Your question")
|
|
245
|
+
}),
|
|
246
|
+
/* @__PURE__ */ h(S, {
|
|
247
|
+
id: `${O}-question`,
|
|
248
|
+
rows: 3,
|
|
249
|
+
maxLength: 500,
|
|
250
|
+
value: L,
|
|
251
|
+
onChange: (e) => R(e.target.value)
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ h("p", {
|
|
254
|
+
className: "text-xs text-text-muted",
|
|
255
|
+
children: D("eventfullymanaged.engagement.moderationExplanation", "The host reviews questions before other attendees can see them.")
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ h(v, {
|
|
258
|
+
type: "submit",
|
|
259
|
+
size: "sm",
|
|
260
|
+
className: "justify-self-start",
|
|
261
|
+
disabled: J || !L.trim(),
|
|
262
|
+
children: D("eventfullymanaged.engagement.askQuestion", "Submit question")
|
|
263
|
+
})
|
|
264
|
+
]
|
|
265
|
+
}),
|
|
266
|
+
B.error && /* @__PURE__ */ h("p", {
|
|
267
|
+
role: "alert",
|
|
268
|
+
className: "text-sm text-status-danger",
|
|
269
|
+
children: D("eventfullymanaged.engagement.questionLoadError", "Could not load questions.")
|
|
270
|
+
}),
|
|
271
|
+
B.loading && !B.data && /* @__PURE__ */ h(x, { className: "h-12 w-full" }),
|
|
272
|
+
B.data?.questions.items.length === 0 && /* @__PURE__ */ h("p", {
|
|
273
|
+
className: "text-sm text-text-muted",
|
|
274
|
+
children: D("eventfullymanaged.engagement.noQuestions", "No questions yet.")
|
|
275
|
+
}),
|
|
276
|
+
B.data?.questions.items.map((e) => /* @__PURE__ */ g("article", {
|
|
277
|
+
className: "space-y-2 rounded-card border border-border-seam p-3",
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ g("div", {
|
|
280
|
+
className: "flex flex-wrap items-center gap-2",
|
|
281
|
+
children: [(E || e.isOwn) && /* @__PURE__ */ h(_, {
|
|
282
|
+
variant: e.status === "APPROVED" ? "success" : "secondary",
|
|
283
|
+
children: re[e.status]
|
|
284
|
+
}), e.isOwn && /* @__PURE__ */ h("span", {
|
|
285
|
+
className: "text-xs text-text-muted",
|
|
286
|
+
children: D("eventfullymanaged.engagement.you", "You")
|
|
287
|
+
})]
|
|
288
|
+
}),
|
|
289
|
+
/* @__PURE__ */ h("p", {
|
|
290
|
+
className: "whitespace-pre-wrap break-words text-sm text-text-primary",
|
|
291
|
+
children: e.text
|
|
292
|
+
}),
|
|
293
|
+
E && e.status === "PENDING" && /* @__PURE__ */ g("div", {
|
|
294
|
+
className: "flex flex-wrap gap-2",
|
|
295
|
+
children: [/* @__PURE__ */ h(v, {
|
|
296
|
+
type: "button",
|
|
297
|
+
size: "sm",
|
|
298
|
+
disabled: X,
|
|
299
|
+
onClick: () => void $(e.id, "APPROVE"),
|
|
300
|
+
children: D("eventfullymanaged.engagement.approve", "Approve")
|
|
301
|
+
}), /* @__PURE__ */ h(v, {
|
|
302
|
+
type: "button",
|
|
303
|
+
size: "sm",
|
|
304
|
+
variant: "outline",
|
|
305
|
+
disabled: X,
|
|
306
|
+
onClick: () => void $(e.id, "REJECT"),
|
|
307
|
+
children: D("eventfullymanaged.engagement.reject", "Reject")
|
|
308
|
+
})]
|
|
309
|
+
})
|
|
310
|
+
]
|
|
311
|
+
}, e.id)),
|
|
312
|
+
/* @__PURE__ */ h(w, {
|
|
313
|
+
offset: j,
|
|
314
|
+
hasMore: B.data?.questions.hasMore ?? !1,
|
|
315
|
+
disabled: B.loading,
|
|
316
|
+
onChange: M
|
|
317
|
+
})
|
|
318
|
+
]
|
|
319
|
+
})]
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
export { T as VirtualEngagementPanel };
|
|
323
|
+
|
|
324
|
+
//# sourceMappingURL=VirtualEngagementPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualEngagementPanel.js","names":["pageSize","ResultsPager","tr","useTr","offset","hasMore","Button","disabled","onChange","VirtualEngagementPanel","id","useId","pollOffset","setPollOffset","useState","questionOffset","setQuestionOffset","prompt","setPrompt","pollOptions","setPollOptions","questionText","setQuestionText","polls","useLiveVirtualPolls","questions","useLiveVirtualQuestions","openPoll","opening","useOpenVirtualPoll","closePoll","closing","useCloseVirtualPoll","votePoll","voting","useVoteVirtualPoll","askQuestion","asking","useAskVirtualQuestion","moderateQuestion","moderating","useModerateVirtualQuestion","refresh","virtualEngagementChangedSubscription","data","open","failure","options","option","result","mutationSucceeded","error","describeError","close","vote","ask","moderate","questionLabels","GlassCard","canModerate","event","Label","Textarea","Skeleton","poll","Badge","optionIndex","question"],"sources":["../../../../src/eventfullymanaged/pages/events/VirtualEngagementPanel.tsx"],"sourcesContent":["import { Badge, Button, GlassCard, Label, Skeleton, Textarea } from '@burdenoff/fe-libs/ui';\nimport { useId, useState } from 'react';\n\nimport { useTr } from '../../../shared/hooks/useTr';\nimport {\n useAskVirtualQuestion,\n useCloseVirtualPoll,\n useLiveVirtualPolls,\n useLiveVirtualQuestions,\n useModerateVirtualQuestion,\n useOpenVirtualPoll,\n useVoteVirtualPoll,\n virtualEngagementChangedSubscription,\n} from '../../api/virtualEngagementApi';\nimport { useEvmSubscription } from '../../hooks/useEvmSubscription';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\nconst pageSize = 15;\n\nfunction ResultsPager({\n offset,\n hasMore,\n disabled,\n onChange,\n}: {\n offset: number;\n hasMore: boolean;\n disabled: boolean;\n onChange: (offset: number) => void;\n}) {\n const tr = useTr();\n if (offset === 0 && !hasMore) return null;\n return (\n <div className=\"flex gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={disabled || offset === 0}\n onClick={() => onChange(offset - pageSize)}\n >\n {tr('eventfullymanaged.engagement.previous', 'Previous')}\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={disabled || !hasMore}\n onClick={() => onChange(offset + pageSize)}\n >\n {tr('eventfullymanaged.engagement.next', 'Next')}\n </Button>\n </div>\n );\n}\n\nexport function VirtualEngagementPanel({ sessionId, canModerate }: { sessionId: string; canModerate: boolean }) {\n const tr = useTr();\n const id = useId();\n const [pollOffset, setPollOffset] = useState(0);\n const [questionOffset, setQuestionOffset] = useState(0);\n const [prompt, setPrompt] = useState('');\n const [pollOptions, setPollOptions] = useState('');\n const [questionText, setQuestionText] = useState('');\n const polls = useLiveVirtualPolls({ sessionId, limit: pageSize, offset: pollOffset });\n const questions = useLiveVirtualQuestions({ sessionId, limit: pageSize, offset: questionOffset });\n const [openPoll, { loading: opening }] = useOpenVirtualPoll();\n const [closePoll, { loading: closing }] = useCloseVirtualPoll();\n const [votePoll, { loading: voting }] = useVoteVirtualPoll();\n const [askQuestion, { loading: asking }] = useAskVirtualQuestion();\n const [moderateQuestion, { loading: moderating }] = useModerateVirtualQuestion();\n\n const refresh = async () => {\n await Promise.allSettled([polls.refetch(), questions.refetch()]);\n };\n\n useEvmSubscription<{ eventfullyManagedVirtualEngagementChanged: boolean | null }>({\n query: virtualEngagementChangedSubscription,\n variables: { sessionId },\n operationName: 'VirtualEngagementChanged',\n onData: (data) => {\n if (data.eventfullyManagedVirtualEngagementChanged) void refresh();\n },\n pollFn: refresh,\n });\n\n const open = async () => {\n const failure = tr('eventfullymanaged.engagement.openFailed', 'Could not open the poll');\n const options = pollOptions\n .split('\\n')\n .map((option) => option.trim())\n .filter(Boolean);\n try {\n const result = await openPoll({ variables: { sessionId, prompt: prompt.trim(), options } });\n if (!mutationSucceeded(result, result.data?.poll?.id, failure)) return;\n setPrompt('');\n setPollOptions('');\n setPollOffset(0);\n await polls.refetch({ sessionId, limit: pageSize, offset: 0 });\n } catch (error) {\n notify.error(failure, describeError(error));\n }\n };\n\n const close = async (pollId: string) => {\n const failure = tr('eventfullymanaged.engagement.closeFailed', 'Could not close the poll');\n try {\n const result = await closePoll({ variables: { sessionId, pollId } });\n if (mutationSucceeded(result, result.data?.poll?.id, failure)) await polls.refetch();\n } catch (error) {\n notify.error(failure, describeError(error));\n }\n };\n\n const vote = async (pollId: string, optionIndex: number) => {\n const failure = tr('eventfullymanaged.engagement.voteFailed', 'Could not record your vote');\n try {\n const result = await votePoll({ variables: { sessionId, pollId, optionIndex } });\n if (mutationSucceeded(result, result.data?.poll?.id, failure)) await polls.refetch();\n } catch (error) {\n notify.error(failure, describeError(error));\n }\n };\n\n const ask = async () => {\n const failure = tr('eventfullymanaged.engagement.askFailed', 'Could not submit the question');\n try {\n const result = await askQuestion({ variables: { sessionId, text: questionText.trim() } });\n if (!mutationSucceeded(result, result.data?.question?.id, failure)) return;\n setQuestionText('');\n setQuestionOffset(0);\n await questions.refetch({ sessionId, limit: pageSize, offset: 0 });\n } catch (error) {\n notify.error(failure, describeError(error));\n }\n };\n\n const moderate = async (questionId: string, decision: 'APPROVE' | 'REJECT') => {\n const failure = tr('eventfullymanaged.engagement.moderateFailed', 'Could not moderate the question');\n try {\n const result = await moderateQuestion({ variables: { sessionId, questionId, decision } });\n if (mutationSucceeded(result, result.data?.question?.id, failure)) await questions.refetch();\n } catch (error) {\n notify.error(failure, describeError(error));\n }\n };\n\n const questionLabels = {\n PENDING: tr('eventfullymanaged.engagement.pending', 'Pending approval'),\n APPROVED: tr('eventfullymanaged.engagement.approved', 'Approved'),\n REJECTED: tr('eventfullymanaged.engagement.rejected', 'Rejected'),\n };\n\n return (\n <div className=\"grid gap-4 lg:grid-cols-2\">\n <GlassCard treatment=\"plain\" className=\"space-y-4 border-border-seam p-4\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n {tr('eventfullymanaged.engagement.livePolls', 'Live polls')}\n </h2>\n {canModerate && (\n <form\n className=\"grid gap-2 border-b border-border-seam pb-4\"\n onSubmit={(event) => {\n event.preventDefault();\n void open();\n }}\n >\n <Label htmlFor={`${id}-prompt`}>{tr('eventfullymanaged.engagement.pollPrompt', 'Poll question')}</Label>\n <Textarea\n id={`${id}-prompt`}\n value={prompt}\n maxLength={300}\n rows={2}\n onChange={(event) => setPrompt(event.target.value)}\n />\n <Label htmlFor={`${id}-options`}>\n {tr('eventfullymanaged.engagement.pollOptions', 'Answers, one per line')}\n </Label>\n <Textarea\n id={`${id}-options`}\n value={pollOptions}\n maxLength={2010}\n rows={3}\n onChange={(event) => setPollOptions(event.target.value)}\n />\n <Button\n type=\"submit\"\n size=\"sm\"\n className=\"justify-self-start\"\n disabled={opening || !prompt.trim() || !pollOptions.trim()}\n >\n {tr('eventfullymanaged.engagement.openPoll', 'Open poll')}\n </Button>\n </form>\n )}\n {polls.error && (\n <p role=\"alert\" className=\"text-sm text-status-danger\">\n {tr('eventfullymanaged.engagement.pollLoadError', 'Could not load live polls.')}\n </p>\n )}\n {polls.loading && !polls.data && <Skeleton className=\"h-12 w-full\" />}\n {polls.data?.polls.items.length === 0 && (\n <p className=\"text-sm text-text-muted\">{tr('eventfullymanaged.engagement.noPolls', 'No polls yet.')}</p>\n )}\n {polls.data?.polls.items.map((poll) => (\n <article key={poll.id} className=\"grid gap-2 rounded-card border border-border-seam p-3\">\n <div className=\"flex items-start justify-between gap-2\">\n <h3 className=\"text-sm font-semibold text-text-primary\">{poll.prompt}</h3>\n <Badge variant={poll.status === 'OPEN' ? 'success' : 'secondary'}>\n {poll.status === 'OPEN'\n ? tr('eventfullymanaged.engagement.open', 'Open')\n : tr('eventfullymanaged.engagement.closed', 'Closed')}\n </Badge>\n </div>\n {poll.options.map((option, optionIndex) => (\n <Button\n key={option}\n type=\"button\"\n size=\"sm\"\n variant={poll.myOptionIndex === optionIndex ? 'secondary' : 'outline'}\n className=\"h-auto min-h-8 justify-between gap-3 whitespace-normal text-start\"\n aria-pressed={poll.myOptionIndex === optionIndex}\n disabled={poll.status !== 'OPEN' || poll.myOptionIndex !== null || voting}\n onClick={() => void vote(poll.id, optionIndex)}\n >\n <span>{option}</span>\n <span>{poll.voteCounts[optionIndex] ?? 0}</span>\n </Button>\n ))}\n {poll.myOptionIndex !== null && (\n <p className=\"text-xs text-text-muted\">\n {tr('eventfullymanaged.engagement.voteRecorded', 'Your vote was recorded.')}\n </p>\n )}\n {canModerate && poll.status === 'OPEN' && (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={closing}\n onClick={() => void close(poll.id)}\n className=\"justify-self-start\"\n >\n {tr('eventfullymanaged.engagement.closePoll', 'Close poll')}\n </Button>\n )}\n </article>\n ))}\n <ResultsPager\n offset={pollOffset}\n hasMore={polls.data?.polls.hasMore ?? false}\n disabled={polls.loading}\n onChange={setPollOffset}\n />\n </GlassCard>\n\n <GlassCard treatment=\"plain\" className=\"space-y-4 border-border-seam p-4\">\n <h2 className=\"text-sm font-semibold text-text-primary\">\n {tr('eventfullymanaged.engagement.questions', 'Questions and answers')}\n </h2>\n <form\n className=\"grid gap-2 border-b border-border-seam pb-4\"\n onSubmit={(event) => {\n event.preventDefault();\n void ask();\n }}\n >\n <Label htmlFor={`${id}-question`}>{tr('eventfullymanaged.engagement.yourQuestion', 'Your question')}</Label>\n <Textarea\n id={`${id}-question`}\n rows={3}\n maxLength={500}\n value={questionText}\n onChange={(event) => setQuestionText(event.target.value)}\n />\n <p className=\"text-xs text-text-muted\">\n {tr(\n 'eventfullymanaged.engagement.moderationExplanation',\n 'The host reviews questions before other attendees can see them.'\n )}\n </p>\n <Button type=\"submit\" size=\"sm\" className=\"justify-self-start\" disabled={asking || !questionText.trim()}>\n {tr('eventfullymanaged.engagement.askQuestion', 'Submit question')}\n </Button>\n </form>\n {questions.error && (\n <p role=\"alert\" className=\"text-sm text-status-danger\">\n {tr('eventfullymanaged.engagement.questionLoadError', 'Could not load questions.')}\n </p>\n )}\n {questions.loading && !questions.data && <Skeleton className=\"h-12 w-full\" />}\n {questions.data?.questions.items.length === 0 && (\n <p className=\"text-sm text-text-muted\">\n {tr('eventfullymanaged.engagement.noQuestions', 'No questions yet.')}\n </p>\n )}\n {questions.data?.questions.items.map((question) => (\n <article key={question.id} className=\"space-y-2 rounded-card border border-border-seam p-3\">\n <div className=\"flex flex-wrap items-center gap-2\">\n {(canModerate || question.isOwn) && (\n <Badge variant={question.status === 'APPROVED' ? 'success' : 'secondary'}>\n {questionLabels[question.status]}\n </Badge>\n )}\n {question.isOwn && (\n <span className=\"text-xs text-text-muted\">{tr('eventfullymanaged.engagement.you', 'You')}</span>\n )}\n </div>\n <p className=\"whitespace-pre-wrap break-words text-sm text-text-primary\">{question.text}</p>\n {canModerate && question.status === 'PENDING' && (\n <div className=\"flex flex-wrap gap-2\">\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={moderating}\n onClick={() => void moderate(question.id, 'APPROVE')}\n >\n {tr('eventfullymanaged.engagement.approve', 'Approve')}\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={moderating}\n onClick={() => void moderate(question.id, 'REJECT')}\n >\n {tr('eventfullymanaged.engagement.reject', 'Reject')}\n </Button>\n </div>\n )}\n </article>\n ))}\n <ResultsPager\n offset={questionOffset}\n hasMore={questions.data?.questions.hasMore ?? false}\n disabled={questions.loading}\n onChange={setQuestionOffset}\n />\n </GlassCard>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAMA,IAAW;AAEjB,SAASC,EAAa,EACpB,WACA,YACA,aACA,eAMC;CACD,IAAMC,IAAKC,EAAM;CAEjB,OADIC,MAAW,KAAK,CAACC,IAAgB,OAEnC,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAACC,GAAD;GACE,MAAK;GACL,MAAK;GACL,SAAQ;GACR,UAAUC,KAAYH,MAAW;GACjC,eAAeI,EAASJ,IAASJ,CAAQ;GAExC,UAAAE,EAAG,yCAAyC,UAAU;EACjD,CAAA,GACR,kBAACI,GAAD;GACE,MAAK;GACL,MAAK;GACL,SAAQ;GACR,UAAUC,KAAY,CAACF;GACvB,eAAeG,EAASJ,IAASJ,CAAQ;GAExC,UAAAE,EAAG,qCAAqC,MAAM;EACzC,CAAA,CACL;;AAET;AAEA,SAAgBO,EAAuB,EAAE,cAAW,kBAA4D;CAC9G,IAAMP,IAAKC,EAAM,GACXO,IAAKC,EAAM,GACX,CAACC,GAAYC,KAAiBC,EAAS,CAAC,GACxC,CAACC,GAAgBC,KAAqBF,EAAS,CAAC,GAChD,CAACG,GAAQC,KAAaJ,EAAS,EAAE,GACjC,CAACK,GAAaC,KAAkBN,EAAS,EAAE,GAC3C,CAACO,GAAcC,KAAmBR,EAAS,EAAE,GAC7CS,IAAQC,EAAoB;EAAE;EAAW,OAAOxB;EAAU,QAAQY;CAAW,CAAC,GAC9Ea,IAAYC,EAAwB;EAAE;EAAW,OAAO1B;EAAU,QAAQe;CAAe,CAAC,GAC1F,CAACY,GAAU,EAAE,SAASC,OAAaC,EAAmB,GACtD,CAACC,GAAW,EAAE,SAASC,OAAaC,EAAoB,GACxD,CAACC,GAAU,EAAE,SAASC,OAAYC,EAAmB,GACrD,CA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ERA,EAAS,SACR,kBAAC,QAAD;QAAM,WAAU;QAA2B,UAAAjE,EAAG,oCAAoC,KAAK;OAAQ,CAAA,CAE9F;;MACL,kBAAC,KAAD;OAAG,WAAU;OAA6D,UAAAiE,EAAS;MAAQ,CAAA;MAC1FR,KAAeQ,EAAS,WAAW,aAClC,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC7D,GAAD;QACE,MAAK;QACL,MAAK;QACL,UAAUkC;QACV,eAAe,KAAKgB,EAASW,EAAS,IAAI,SAAS;QAElD,UAAAjE,EAAG,wCAAwC,SAAS;OAC/C,CAAA,GACR,kBAACI,GAAD;QACE,MAAK;QACL,MAAK;QACL,SAAQ;QACR,UAAUkC;QACV,eAAe,KAAKgB,EAASW,EAAS,IAAI,QAAQ;QAEjD,UAAAjE,EAAG,uCAAuC,QAAQ;OAC7C,CAAA,CACL;;KAEA;IAjCK,GAAAiE,EAAS,EAiCd,CACV;IACD,kBAAClE,GAAD;KACE,QAAQc;KACR,SAASU,EAAU,MAAM,UAAU,WAAW;KAC9C,UAAUA,EAAU;KACpB,UAAUT;IACX,CAAA;GACQ;EACR,CAAA,CAAA;;AAET"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { VIRTUAL_PARTICIPANTS_CHANGED_SUBSCRIPTION_SDL as e, VIRTUAL_SIGNAL_SUBSCRIPTION_SDL as t, useEndVirtualSessionMutation as n, useEventQuery as r, useHostVirtualSessionMutation as i, useJoinVirtualSessionMutation as a, useLeaveVirtualSessionMutation as o, usePromoteVirtualPresenterMutation as s, useSendVirtualSignalMutation as ee, useSetVirtualMuteMutation as te, useSetVirtualVideoMutation as
|
|
2
|
-
import { useEventfullyManaged as
|
|
1
|
+
import { VIRTUAL_PARTICIPANTS_CHANGED_SUBSCRIPTION_SDL as e, VIRTUAL_SIGNAL_SUBSCRIPTION_SDL as t, useEndVirtualSessionMutation as n, useEventQuery as r, useHostVirtualSessionMutation as i, useJoinVirtualSessionMutation as a, useLeaveVirtualSessionMutation as o, usePromoteVirtualPresenterMutation as s, useSendVirtualSignalMutation as ee, useSetVirtualMuteMutation as te, useSetVirtualVideoMutation as c, useVirtualSessionQuery as l } from "../../api/eventApi.js";
|
|
2
|
+
import { useEventfullyManaged as ne } from "../../context/EventfullyManagedContext.js";
|
|
3
3
|
import { useEvmSubscription as u } from "../../hooks/useEvmSubscription.js";
|
|
4
4
|
import { useVirtualCall as re } from "../../hooks/useVirtualCall.js";
|
|
5
5
|
import { describeError as d, mutationSucceeded as f } from "../../lib/mutationResult.js";
|
|
6
6
|
import { notify as p } from "../../lib/toast.js";
|
|
7
|
-
import {
|
|
7
|
+
import { VirtualEngagementPanel as m } from "./VirtualEngagementPanel.js";
|
|
8
|
+
import { useCallback as ie, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
8
9
|
import { useParams as ae } from "react-router";
|
|
9
|
-
import { Fragment as oe, jsx as
|
|
10
|
-
import { ArrowLeft as
|
|
11
|
-
import { Badge as
|
|
10
|
+
import { Fragment as oe, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
11
|
+
import { ArrowLeft as x, Mic as S, MicOff as C, PhoneOff as se, Radio as ce, ScreenShare as le, Users as ue, Video as w, VideoOff as de } from "lucide-react";
|
|
12
|
+
import { Badge as T, Button as E, EmphasisPanel as fe, GlassCard as D, GradientText as pe, IllustratedEmptyState as O, PagePurpose as me, Select as he, SelectContent as ge, SelectItem as k, SelectTrigger as _e, SelectValue as ve, Skeleton as A } from "@burdenoff/fe-libs/ui";
|
|
12
13
|
// src/eventfullymanaged/pages/events/VirtualSessionPage.tsx
|
|
13
14
|
function j(e) {
|
|
14
15
|
return e.slice(0, 2).toUpperCase();
|
|
@@ -17,32 +18,32 @@ function M(e) {
|
|
|
17
18
|
return e === "connected" ? "bg-status-success" : e === "connecting" || e === "new" ? "bg-status-warning" : e === "failed" || e === "disconnected" || e === "closed" ? "bg-status-danger" : "bg-text-muted";
|
|
18
19
|
}
|
|
19
20
|
function N({ actorId: e, role: t, isLocal: n, stream: r, muted: i, videoEnabled: a, connectionState: o }) {
|
|
20
|
-
let s =
|
|
21
|
-
return
|
|
21
|
+
let s = _(null);
|
|
22
|
+
return h(() => {
|
|
22
23
|
s.current && (s.current.srcObject = r);
|
|
23
|
-
}, [r]), /* @__PURE__ */
|
|
24
|
+
}, [r]), /* @__PURE__ */ b("div", {
|
|
24
25
|
className: "relative aspect-video overflow-hidden rounded-card border border-border-seam bg-bg-sunken",
|
|
25
|
-
children: [r && a ? /* @__PURE__ */
|
|
26
|
+
children: [r && a ? /* @__PURE__ */ y("video", {
|
|
26
27
|
ref: s,
|
|
27
28
|
autoPlay: !0,
|
|
28
29
|
playsInline: !0,
|
|
29
30
|
muted: n,
|
|
30
31
|
className: "h-full w-full object-cover",
|
|
31
32
|
style: n ? { transform: "scaleX(-1)" } : void 0
|
|
32
|
-
}) : /* @__PURE__ */
|
|
33
|
+
}) : /* @__PURE__ */ y("div", {
|
|
33
34
|
className: "flex h-full w-full items-center justify-center",
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ y("span", {
|
|
35
36
|
className: "flex h-12 w-12 items-center justify-center rounded-full bg-accent-primary/10 text-sm font-semibold text-accent-primary",
|
|
36
37
|
children: j(e)
|
|
37
38
|
})
|
|
38
|
-
}), /* @__PURE__ */
|
|
39
|
+
}), /* @__PURE__ */ b("div", {
|
|
39
40
|
className: "absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-gradient-to-t from-bg-overlay to-transparent p-2",
|
|
40
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ b("span", {
|
|
41
42
|
className: "truncate text-xs font-medium text-action-primary-text",
|
|
42
43
|
children: [n ? "You" : `Participant ${e.slice(0, 6)}`, t === "HOST" ? " · Host" : t === "PRESENTER" ? " · Presenter" : ""]
|
|
43
|
-
}), /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ b("span", {
|
|
44
45
|
className: "flex items-center gap-1.5",
|
|
45
|
-
children: [i ? /* @__PURE__ */
|
|
46
|
+
children: [i ? /* @__PURE__ */ y(C, { className: "h-3.5 w-3.5 text-action-primary-text" }) : null, n ? null : /* @__PURE__ */ y("span", {
|
|
46
47
|
className: `h-2 w-2 rounded-full ${M(o)}`,
|
|
47
48
|
title: o ?? "connecting"
|
|
48
49
|
})]
|
|
@@ -51,296 +52,300 @@ function N({ actorId: e, role: t, isLocal: n, stream: r, muted: i, videoEnabled:
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
function P() {
|
|
54
|
-
let { id:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
sessionId:
|
|
55
|
+
let { id: _ = "" } = ae(), { navigate: j, currentUser: P } = ne(), F = P?.id ?? "", { data: ye, loading: be } = r(_), I = l({ eventId: _ }), L = I.data?.virtualSession ?? null, [R, xe] = v("MEETING"), [Se, { loading: z }] = i(), [Ce, { loading: B }] = a(), [we, { loading: V }] = o(), [Te, { loading: H }] = n(), [Ee] = te(), [De] = c(), [Oe] = s(), [U] = ee(), W = g(() => L?.participants.find((e) => e.actorId === F && !e.leftAt) ?? null, [L, F]), G = g(() => (L?.participants ?? []).filter((e) => !e.leftAt), [L]), [K, q] = v(!1), [J, Y] = v(!1);
|
|
56
|
+
h(() => {
|
|
57
|
+
W && (q(W.muted), Y(!W.videoEnabled));
|
|
58
|
+
}, [W?.muted, W?.videoEnabled]);
|
|
59
|
+
let ke = ie(async (e) => {
|
|
60
|
+
L && await U({ variables: {
|
|
61
|
+
sessionId: L.id,
|
|
61
62
|
toActorId: e.toActorId,
|
|
62
63
|
signalType: e.signalType,
|
|
63
64
|
payload: e.payload
|
|
64
65
|
} });
|
|
65
|
-
}, [
|
|
66
|
-
sessionId:
|
|
66
|
+
}, [L, U]), X = re({
|
|
67
|
+
sessionId: W ? L?.id : null,
|
|
67
68
|
selfActorId: F,
|
|
68
|
-
mode:
|
|
69
|
-
selfRole:
|
|
70
|
-
participants:
|
|
69
|
+
mode: L?.mode ?? "MEETING",
|
|
70
|
+
selfRole: W?.role ?? null,
|
|
71
|
+
participants: G.map((e) => ({
|
|
71
72
|
actorId: e.actorId,
|
|
72
73
|
role: e.role
|
|
73
74
|
})),
|
|
74
|
-
sendSignal:
|
|
75
|
-
muted:
|
|
76
|
-
videoEnabled: !
|
|
75
|
+
sendSignal: ke,
|
|
76
|
+
muted: K,
|
|
77
|
+
videoEnabled: !J
|
|
77
78
|
});
|
|
78
79
|
u({
|
|
79
80
|
query: t,
|
|
80
|
-
variables: { sessionId:
|
|
81
|
+
variables: { sessionId: L?.id },
|
|
81
82
|
operationName: "EventfullymanagedVirtualSignal",
|
|
82
|
-
enabled: !!(
|
|
83
|
+
enabled: !!(W && L),
|
|
83
84
|
onData: (e) => {
|
|
84
85
|
let t = e.eventfullyManagedVirtualSignal;
|
|
85
|
-
t &&
|
|
86
|
+
t && X.handleIncomingSignal(t);
|
|
86
87
|
},
|
|
87
88
|
pollFn: () => {},
|
|
88
89
|
pollIntervalMs: 15e3
|
|
89
90
|
}), u({
|
|
90
91
|
query: e,
|
|
91
|
-
variables: { sessionId:
|
|
92
|
+
variables: { sessionId: L?.id },
|
|
92
93
|
operationName: "EventfullymanagedVirtualParticipantsChanged",
|
|
93
|
-
enabled: !!
|
|
94
|
+
enabled: !!L,
|
|
94
95
|
onData: () => {
|
|
95
|
-
|
|
96
|
+
I.refetch();
|
|
96
97
|
},
|
|
97
98
|
pollFn: () => {
|
|
98
|
-
|
|
99
|
+
I.refetch();
|
|
99
100
|
},
|
|
100
101
|
pollIntervalMs: 5e3
|
|
101
102
|
});
|
|
102
|
-
let
|
|
103
|
+
let Ae = async (e) => {
|
|
103
104
|
try {
|
|
104
|
-
let t = await
|
|
105
|
-
eventId:
|
|
105
|
+
let t = await Se({ variables: {
|
|
106
|
+
eventId: _,
|
|
106
107
|
mode: e
|
|
107
108
|
} });
|
|
108
109
|
if (!f(t, t.data?.hostVirtualSession?.id, "Could not start session")) return;
|
|
109
|
-
p.success("Session started", e === "WEBINAR" ? "Hosting as a webinar." : "Hosting a meeting."), await
|
|
110
|
+
p.success("Session started", e === "WEBINAR" ? "Hosting as a webinar." : "Hosting a meeting."), await I.refetch();
|
|
110
111
|
} catch (e) {
|
|
111
112
|
p.error("Could not start session", d(e));
|
|
112
113
|
}
|
|
113
|
-
},
|
|
114
|
+
}, je = async () => {
|
|
114
115
|
try {
|
|
115
|
-
let e = await
|
|
116
|
+
let e = await Ce({ variables: { eventId: _ } });
|
|
116
117
|
if (!f(e, e.data?.joinVirtualSession?.id, "Could not join session")) return;
|
|
117
|
-
await
|
|
118
|
+
await I.refetch();
|
|
118
119
|
} catch (e) {
|
|
119
120
|
p.error("Could not join session", d(e));
|
|
120
121
|
}
|
|
121
|
-
},
|
|
122
|
-
if (
|
|
123
|
-
await
|
|
122
|
+
}, Me = async () => {
|
|
123
|
+
if (L) try {
|
|
124
|
+
await we({ variables: { sessionId: L.id } }), p.success("Left session", "You are no longer in the virtual session."), await I.refetch();
|
|
124
125
|
} catch (e) {
|
|
125
126
|
p.error("Could not leave session", d(e));
|
|
126
127
|
}
|
|
127
|
-
},
|
|
128
|
-
if (
|
|
129
|
-
await
|
|
128
|
+
}, Z = async () => {
|
|
129
|
+
if (L) try {
|
|
130
|
+
await Te({ variables: { sessionId: L.id } }), p.success("Session ended", "The virtual session has been ended for everyone."), await I.refetch();
|
|
130
131
|
} catch (e) {
|
|
131
132
|
p.error("Could not end session", d(e));
|
|
132
133
|
}
|
|
133
|
-
},
|
|
134
|
-
if (!
|
|
135
|
-
let e = !
|
|
136
|
-
|
|
134
|
+
}, Ne = async () => {
|
|
135
|
+
if (!L) return;
|
|
136
|
+
let e = !K;
|
|
137
|
+
q(e);
|
|
137
138
|
try {
|
|
138
|
-
await
|
|
139
|
-
sessionId:
|
|
139
|
+
await Ee({ variables: {
|
|
140
|
+
sessionId: L.id,
|
|
140
141
|
muted: e
|
|
141
142
|
} });
|
|
142
143
|
} catch (t) {
|
|
143
|
-
|
|
144
|
+
q(!e), p.error("Could not update mute state", d(t));
|
|
144
145
|
}
|
|
145
|
-
},
|
|
146
|
-
if (!
|
|
147
|
-
let e = !
|
|
148
|
-
|
|
146
|
+
}, Pe = async () => {
|
|
147
|
+
if (!L) return;
|
|
148
|
+
let e = !J;
|
|
149
|
+
Y(e);
|
|
149
150
|
try {
|
|
150
|
-
await
|
|
151
|
-
sessionId:
|
|
151
|
+
await De({ variables: {
|
|
152
|
+
sessionId: L.id,
|
|
152
153
|
videoEnabled: !e
|
|
153
154
|
} });
|
|
154
155
|
} catch (t) {
|
|
155
|
-
|
|
156
|
+
Y(!e), p.error("Could not update camera state", d(t));
|
|
156
157
|
}
|
|
157
|
-
},
|
|
158
|
-
if (
|
|
159
|
-
await
|
|
160
|
-
sessionId:
|
|
158
|
+
}, Fe = async (e) => {
|
|
159
|
+
if (L) try {
|
|
160
|
+
await Oe({ variables: {
|
|
161
|
+
sessionId: L.id,
|
|
161
162
|
actorId: e.actorId
|
|
162
|
-
} }), p.success("Promoted to presenter", `Participant ${e.actorId.slice(0, 6)} can now broadcast.`), await
|
|
163
|
+
} }), p.success("Promoted to presenter", `Participant ${e.actorId.slice(0, 6)} can now broadcast.`), await I.refetch();
|
|
163
164
|
} catch (e) {
|
|
164
165
|
p.error("Could not promote participant", d(e));
|
|
165
166
|
}
|
|
166
|
-
}, Q =
|
|
167
|
-
return
|
|
167
|
+
}, Q = W?.role === "HOST", $ = z || B || V || H;
|
|
168
|
+
return be || I.loading ? /* @__PURE__ */ b("div", {
|
|
168
169
|
className: "space-y-4 p-6",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
170
|
-
}) : /* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ y(A, { className: "h-8 w-64" }), /* @__PURE__ */ y(A, { className: "h-64 w-full" })]
|
|
171
|
+
}) : /* @__PURE__ */ b("div", {
|
|
171
172
|
className: "space-y-6 p-6",
|
|
172
173
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ b(E, {
|
|
174
175
|
type: "button",
|
|
175
176
|
variant: "ghost",
|
|
176
177
|
size: "sm",
|
|
177
|
-
onClick: () => j(`/events/${
|
|
178
|
-
children: [/* @__PURE__ */
|
|
178
|
+
onClick: () => j(`/events/${_}`),
|
|
179
|
+
children: [/* @__PURE__ */ y(x, { className: "h-4 w-4" }), "Back to Event"]
|
|
179
180
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ y(me, { children: "A virtual session is a real, browser-native WebRTC room for this event — no external meeting link. Hosts start a Meeting (small mesh, up to 8 people all connected directly) or a Webinar (up to 30 attendees who see and hear only the host/presenters). Signaling is relayed through EventfullyManaged; media never touches our servers." }),
|
|
182
|
+
/* @__PURE__ */ b(fe, {
|
|
182
183
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
|
|
184
185
|
className: "text-2xl font-bold text-text-primary",
|
|
185
|
-
children: /* @__PURE__ */
|
|
186
|
-
}), /* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ y(pe, { children: "Virtual Session" })
|
|
187
|
+
}), /* @__PURE__ */ y("p", {
|
|
187
188
|
className: "mt-1 text-sm text-text-secondary",
|
|
188
|
-
children:
|
|
189
|
-
})] }),
|
|
190
|
-
variant:
|
|
189
|
+
children: ye?.event?.name ?? "Event"
|
|
190
|
+
})] }), L ? /* @__PURE__ */ b(T, {
|
|
191
|
+
variant: L.status === "ACTIVE" ? "success" : "secondary",
|
|
191
192
|
className: "uppercase",
|
|
192
193
|
children: [
|
|
193
|
-
|
|
194
|
+
L.mode,
|
|
194
195
|
" · ",
|
|
195
|
-
|
|
196
|
+
L.status
|
|
196
197
|
]
|
|
197
198
|
}) : null]
|
|
198
199
|
}),
|
|
199
|
-
!
|
|
200
|
+
!L || L.status !== "ACTIVE" ? /* @__PURE__ */ b(D, {
|
|
200
201
|
treatment: "plain",
|
|
201
202
|
className: "border-border-seam p-8",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ y(O, {
|
|
203
204
|
illustration: "empty-data",
|
|
204
205
|
title: "No live virtual session",
|
|
205
206
|
description: "Start a session to host attendees over WebRTC, or join once someone else has started one.",
|
|
206
207
|
className: "py-6"
|
|
207
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ b("div", {
|
|
208
209
|
className: "mt-4 flex flex-wrap items-center justify-center gap-2",
|
|
209
|
-
children: [/* @__PURE__ */
|
|
210
|
-
value:
|
|
211
|
-
onValueChange: (e) =>
|
|
212
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ b(he, {
|
|
211
|
+
value: R,
|
|
212
|
+
onValueChange: (e) => xe(e),
|
|
213
|
+
children: [/* @__PURE__ */ y(_e, {
|
|
213
214
|
"aria-label": "Session mode",
|
|
214
215
|
className: "w-48",
|
|
215
|
-
children: /* @__PURE__ */
|
|
216
|
-
}), /* @__PURE__ */
|
|
216
|
+
children: /* @__PURE__ */ y(ve, {})
|
|
217
|
+
}), /* @__PURE__ */ b(ge, { children: [/* @__PURE__ */ y(k, {
|
|
217
218
|
value: "MEETING",
|
|
218
219
|
children: "Meeting (up to 8)"
|
|
219
|
-
}), /* @__PURE__ */
|
|
220
|
+
}), /* @__PURE__ */ y(k, {
|
|
220
221
|
value: "WEBINAR",
|
|
221
222
|
children: "Webinar (up to 30)"
|
|
222
223
|
})] })]
|
|
223
|
-
}), /* @__PURE__ */
|
|
224
|
+
}), /* @__PURE__ */ b(E, {
|
|
224
225
|
type: "button",
|
|
225
|
-
onClick: () =>
|
|
226
|
+
onClick: () => Ae(R),
|
|
226
227
|
disabled: $,
|
|
227
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ y(ce, { className: "h-4 w-4" }), z ? "Starting…" : "Start session"]
|
|
228
229
|
})]
|
|
229
230
|
})]
|
|
230
|
-
}) :
|
|
231
|
-
|
|
231
|
+
}) : W ? /* @__PURE__ */ b(oe, { children: [
|
|
232
|
+
X.mediaError ? /* @__PURE__ */ b(D, {
|
|
232
233
|
treatment: "plain",
|
|
233
234
|
className: "border-status-danger/40 bg-status-danger/5 p-4 text-sm text-status-danger",
|
|
234
235
|
children: [
|
|
235
236
|
"Camera/microphone unavailable: ",
|
|
236
|
-
|
|
237
|
+
X.mediaError,
|
|
237
238
|
". You are still connected to the session and can see other participants, but others will not see or hear you."
|
|
238
239
|
]
|
|
239
240
|
}) : null,
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ b("div", {
|
|
241
242
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ y(N, {
|
|
243
244
|
actorId: F,
|
|
244
|
-
role:
|
|
245
|
+
role: W.role,
|
|
245
246
|
isLocal: !0,
|
|
246
|
-
stream:
|
|
247
|
-
muted:
|
|
248
|
-
videoEnabled: !
|
|
249
|
-
}),
|
|
247
|
+
stream: X.localStream,
|
|
248
|
+
muted: K,
|
|
249
|
+
videoEnabled: !J
|
|
250
|
+
}), G.filter((e) => e.actorId !== F).map((e) => /* @__PURE__ */ y(N, {
|
|
250
251
|
actorId: e.actorId,
|
|
251
252
|
role: e.role,
|
|
252
253
|
isLocal: !1,
|
|
253
|
-
stream:
|
|
254
|
+
stream: X.remoteStreams.get(e.actorId) ?? null,
|
|
254
255
|
muted: e.muted,
|
|
255
256
|
videoEnabled: e.videoEnabled,
|
|
256
|
-
connectionState:
|
|
257
|
+
connectionState: X.connectionStates.get(e.actorId)
|
|
257
258
|
}, e.actorId))]
|
|
258
259
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ b(D, {
|
|
260
261
|
treatment: "plain",
|
|
261
262
|
className: "flex flex-wrap items-center justify-center gap-2 border-border-seam p-4",
|
|
262
263
|
children: [
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ b(E, {
|
|
264
265
|
type: "button",
|
|
265
|
-
variant:
|
|
266
|
-
onClick:
|
|
267
|
-
children: [
|
|
266
|
+
variant: K ? "outline" : "secondary",
|
|
267
|
+
onClick: Ne,
|
|
268
|
+
children: [y(K ? C : S, { className: "h-4 w-4" }), K ? "Unmute" : "Mute"]
|
|
268
269
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ b(E, {
|
|
270
271
|
type: "button",
|
|
271
|
-
variant:
|
|
272
|
-
onClick:
|
|
273
|
-
children: [
|
|
272
|
+
variant: J ? "outline" : "secondary",
|
|
273
|
+
onClick: Pe,
|
|
274
|
+
children: [y(J ? de : w, { className: "h-4 w-4" }), J ? "Start Video" : "Stop Video"]
|
|
274
275
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ b(E, {
|
|
276
277
|
type: "button",
|
|
277
278
|
variant: "outline",
|
|
278
|
-
onClick:
|
|
279
|
+
onClick: Me,
|
|
279
280
|
disabled: $,
|
|
280
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ y(se, { className: "h-4 w-4" }), V ? "Leaving…" : "Leave"]
|
|
281
282
|
}),
|
|
282
|
-
Q ? /* @__PURE__ */
|
|
283
|
+
Q ? /* @__PURE__ */ b(E, {
|
|
283
284
|
type: "button",
|
|
284
285
|
variant: "destructive",
|
|
285
|
-
onClick:
|
|
286
|
+
onClick: Z,
|
|
286
287
|
disabled: $,
|
|
287
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ y(le, { className: "h-4 w-4" }), H ? "Ending…" : "End for everyone"]
|
|
288
289
|
}) : null
|
|
289
290
|
]
|
|
290
291
|
}),
|
|
291
|
-
/* @__PURE__ */ y(
|
|
292
|
+
/* @__PURE__ */ y(m, {
|
|
293
|
+
sessionId: L.id,
|
|
294
|
+
canModerate: !!W && L.hostId === F
|
|
295
|
+
}, L.id),
|
|
296
|
+
/* @__PURE__ */ b(D, {
|
|
292
297
|
treatment: "plain",
|
|
293
298
|
className: "border-border-seam p-4",
|
|
294
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
295
300
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
296
301
|
children: [
|
|
297
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ y(ue, { className: "h-4 w-4 text-accent-primary" }),
|
|
298
303
|
"Participants (",
|
|
299
|
-
|
|
304
|
+
G.length,
|
|
300
305
|
"/",
|
|
301
|
-
|
|
306
|
+
L.maxParticipants,
|
|
302
307
|
")"
|
|
303
308
|
]
|
|
304
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ y("div", {
|
|
305
310
|
className: "mt-3 space-y-2",
|
|
306
|
-
children:
|
|
311
|
+
children: G.map((e) => /* @__PURE__ */ b("div", {
|
|
307
312
|
className: "flex items-center justify-between gap-2 text-sm",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ b("span", {
|
|
309
314
|
className: "flex items-center gap-2 text-text-secondary",
|
|
310
315
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ y("span", { className: `h-2 w-2 rounded-full ${e.actorId === F ? "bg-status-success" : M(X.connectionStates.get(e.actorId))}` }),
|
|
312
317
|
e.actorId === F ? "You" : `Participant ${e.actorId.slice(0, 6)}`,
|
|
313
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ y(T, {
|
|
314
319
|
variant: "secondary",
|
|
315
320
|
className: "uppercase",
|
|
316
321
|
children: e.role
|
|
317
322
|
})
|
|
318
323
|
]
|
|
319
|
-
}), Q &&
|
|
324
|
+
}), Q && L.mode === "WEBINAR" && e.role === "ATTENDEE" ? /* @__PURE__ */ y(E, {
|
|
320
325
|
type: "button",
|
|
321
326
|
variant: "ghost",
|
|
322
327
|
size: "sm",
|
|
323
|
-
onClick: () =>
|
|
328
|
+
onClick: () => Fe(e),
|
|
324
329
|
children: "Promote to presenter"
|
|
325
330
|
}) : null]
|
|
326
331
|
}, e.id))
|
|
327
332
|
})]
|
|
328
333
|
})
|
|
329
|
-
] }) : /* @__PURE__ */
|
|
334
|
+
] }) : /* @__PURE__ */ b(D, {
|
|
330
335
|
treatment: "plain",
|
|
331
336
|
className: "border-border-seam p-8",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ y(O, {
|
|
333
338
|
illustration: "empty-people",
|
|
334
339
|
title: "A session is live",
|
|
335
|
-
description: `${
|
|
340
|
+
description: `${L.participantCount} of ${L.maxParticipants} seats in use. Join to turn on your camera and mic.`,
|
|
336
341
|
className: "py-6"
|
|
337
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ y("div", {
|
|
338
343
|
className: "mt-4 flex justify-center",
|
|
339
|
-
children: /* @__PURE__ */
|
|
344
|
+
children: /* @__PURE__ */ b(E, {
|
|
340
345
|
type: "button",
|
|
341
|
-
onClick:
|
|
346
|
+
onClick: je,
|
|
342
347
|
disabled: $,
|
|
343
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ y(w, { className: "h-4 w-4" }), B ? "Joining…" : "Join session"]
|
|
344
349
|
})
|
|
345
350
|
})]
|
|
346
351
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualSessionPage.js","names":["Badge","_Fragment","Badge$1","initials","id","connectionDotClass","state","VideoTile","videoRef","useRef","useEffect","stream","videoEnabled","isLocal","actorId","role","muted","MicOff","connectionState","VirtualSessionPage","eventId","useParams","useEventfullyManaged","selfActorId","currentUser","eventData","eventLoading","useEventQuery","sessionQuery","useVirtualSessionQuery","session","mode","setMode","useState","hostSession","hosting","useHostVirtualSessionMutation","joinSession","joining","useJoinVirtualSessionMutation","leaveSession","leaving","useLeaveVirtualSessionMutation","endSession","ending","useEndVirtualSessionMutation","setMuteMutation","useSetVirtualMuteMutation","setVideoMutation","useSetVirtualVideoMutation","promotePresenter","usePromoteVirtualPresenterMutation","sendSignalMutation","useSendVirtualSignalMutation","selfParticipant","useMemo","p","activeParticipants","localMuted","setLocalMuted","localVideoOff","setLocalVideoOff","sendSignal","useCallback","args","call","useVirtualCall","useEvmSubscription","VIRTUAL_SIGNAL_SUBSCRIPTION_SDL","signal","data","VIRTUAL_PARTICIPANTS_CHANGED_SUBSCRIPTION_SDL","onHost","response","chosenMode","mutationSucceeded","notify","error","describeError","onJoin","onLeave","onEnd","toggleMute","next","toggleVideo","onPromote","participant","isHost","busy","Skeleton","Button","navigate","ArrowLeft","PagePurpose","EmphasisPanel","GradientText","GlassCard","IllustratedEmptyState","Select","value","SelectTrigger","SelectValue","SelectContent","SelectItem","Radio","Fragment","jsx","Mic","VideoOff","Video","PhoneOff","ScreenShare","Users"],"sources":["../../../../src/eventfullymanaged/pages/events/VirtualSessionPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/set-state-in-effect -- mirrors server-confirmed mute/video state into local toggle state, same established pattern as the fleet's *FormPage.tsx entity-hydration effects */\n/**\n * VirtualSessionPage (BOFF-4318)\n *\n * Real join/host flow for an event's virtual/hybrid session, backed by\n * `wspace-eventfullymanaged-svc`'s bounded browser-native WebRTC core\n * (`VirtualSessionService`). MEETING mode is a full mesh (cap 8);\n * WEBINAR mode is a host/presenter-broadcast star (cap 30) — attendees\n * only peer with the host/presenters, never each other. See\n * `useVirtualCall` for the exact topology and signaling logic.\n *\n * Large-audience broadcast (hundreds+ viewers) needs a real SFU/media\n * server and is explicit deferred follow-up — not built here.\n */\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n} from '@burdenoff/fe-libs/ui';\nimport { ArrowLeft, Mic, MicOff, PhoneOff, Radio, ScreenShare, Users, Video, VideoOff } from 'lucide-react';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useParams } from 'react-router';\n\nimport {\n useEndVirtualSessionMutation,\n useEventQuery,\n useHostVirtualSessionMutation,\n useJoinVirtualSessionMutation,\n useLeaveVirtualSessionMutation,\n usePromoteVirtualPresenterMutation,\n useSendVirtualSignalMutation,\n useSetVirtualMuteMutation,\n useSetVirtualVideoMutation,\n useVirtualSessionQuery,\n VIRTUAL_PARTICIPANTS_CHANGED_SUBSCRIPTION_SDL,\n VIRTUAL_SIGNAL_SUBSCRIPTION_SDL,\n type VirtualParticipantGql,\n} from '../../api/eventApi';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { useEvmSubscription } from '../../hooks/useEvmSubscription';\nimport { type IncomingVirtualSignal, type VirtualCallRole, useVirtualCall } from '../../hooks/useVirtualCall';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\nfunction initials(id: string): string {\n return id.slice(0, 2).toUpperCase();\n}\n\nfunction connectionDotClass(state: RTCPeerConnectionState | undefined): string {\n if (state === 'connected') return 'bg-status-success';\n if (state === 'connecting' || state === 'new') return 'bg-status-warning';\n if (state === 'failed' || state === 'disconnected' || state === 'closed') return 'bg-status-danger';\n return 'bg-text-muted';\n}\n\ninterface VideoTileProps {\n actorId: string;\n role: VirtualCallRole;\n isLocal: boolean;\n stream: MediaStream | null;\n /** Muted/videoEnabled reflect the persisted participant state (server-confirmed for remotes, local toggle for self). */\n muted: boolean;\n videoEnabled: boolean;\n connectionState?: RTCPeerConnectionState;\n}\n\nfunction VideoTile({ actorId, role, isLocal, stream, muted, videoEnabled, connectionState }: VideoTileProps) {\n const videoRef = useRef<HTMLVideoElement>(null);\n useEffect(() => {\n if (videoRef.current) videoRef.current.srcObject = stream;\n }, [stream]);\n\n const showVideo = Boolean(stream) && videoEnabled;\n\n return (\n <div className=\"relative aspect-video overflow-hidden rounded-card border border-border-seam bg-bg-sunken\">\n {showVideo ? (\n <video\n ref={videoRef}\n autoPlay\n playsInline\n muted={isLocal}\n className=\"h-full w-full object-cover\"\n style={isLocal ? { transform: 'scaleX(-1)' } : undefined}\n />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center\">\n <span className=\"flex h-12 w-12 items-center justify-center rounded-full bg-accent-primary/10 text-sm font-semibold text-accent-primary\">\n {initials(actorId)}\n </span>\n </div>\n )}\n <div className=\"absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-gradient-to-t from-bg-overlay to-transparent p-2\">\n <span className=\"truncate text-xs font-medium text-action-primary-text\">\n {isLocal ? 'You' : `Participant ${actorId.slice(0, 6)}`}\n {role === 'HOST' ? ' · Host' : role === 'PRESENTER' ? ' · Presenter' : ''}\n </span>\n <span className=\"flex items-center gap-1.5\">\n {muted ? <MicOff className=\"h-3.5 w-3.5 text-action-primary-text\" /> : null}\n {!isLocal ? (\n <span\n className={`h-2 w-2 rounded-full ${connectionDotClass(connectionState)}`}\n title={connectionState ?? 'connecting'}\n />\n ) : null}\n </span>\n </div>\n </div>\n );\n}\n\nexport default function VirtualSessionPage() {\n const { id: eventId = '' } = useParams<{ id: string }>();\n const { navigate, currentUser } = useEventfullyManaged();\n const selfActorId = currentUser?.id ?? '';\n\n const { data: eventData, loading: eventLoading } = useEventQuery(eventId);\n const sessionQuery = useVirtualSessionQuery({ eventId });\n const session = sessionQuery.data?.virtualSession ?? null;\n\n const [mode, setMode] = useState<'MEETING' | 'WEBINAR'>('MEETING');\n const [hostSession, { loading: hosting }] = useHostVirtualSessionMutation();\n const [joinSession, { loading: joining }] = useJoinVirtualSessionMutation();\n const [leaveSession, { loading: leaving }] = useLeaveVirtualSessionMutation();\n const [endSession, { loading: ending }] = useEndVirtualSessionMutation();\n const [setMuteMutation] = useSetVirtualMuteMutation();\n const [setVideoMutation] = useSetVirtualVideoMutation();\n const [promotePresenter] = usePromoteVirtualPresenterMutation();\n const [sendSignalMutation] = useSendVirtualSignalMutation();\n\n const selfParticipant = useMemo(\n () => session?.participants.find((p) => p.actorId === selfActorId && !p.leftAt) ?? null,\n [session, selfActorId]\n );\n const activeParticipants = useMemo(() => (session?.participants ?? []).filter((p) => !p.leftAt), [session]);\n\n const [localMuted, setLocalMuted] = useState(false);\n const [localVideoOff, setLocalVideoOff] = useState(false);\n useEffect(() => {\n if (selfParticipant) {\n setLocalMuted(selfParticipant.muted);\n setLocalVideoOff(!selfParticipant.videoEnabled);\n }\n }, [selfParticipant?.muted, selfParticipant?.videoEnabled]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const sendSignal = useCallback(\n async (args: { toActorId: string; signalType: 'OFFER' | 'ANSWER' | 'ICE_CANDIDATE'; payload: unknown }) => {\n if (!session) return;\n await sendSignalMutation({\n variables: {\n sessionId: session.id,\n toActorId: args.toActorId,\n signalType: args.signalType,\n payload: args.payload,\n },\n });\n },\n [session, sendSignalMutation]\n );\n\n const call = useVirtualCall({\n sessionId: selfParticipant ? session?.id : null,\n selfActorId,\n mode: session?.mode ?? 'MEETING',\n selfRole: selfParticipant?.role ?? null,\n participants: activeParticipants.map((p) => ({ actorId: p.actorId, role: p.role })),\n sendSignal,\n muted: localMuted,\n videoEnabled: !localVideoOff,\n });\n\n useEvmSubscription<{ eventfullyManagedVirtualSignal: IncomingVirtualSignal }>({\n query: VIRTUAL_SIGNAL_SUBSCRIPTION_SDL,\n variables: { sessionId: session?.id },\n operationName: 'EventfullymanagedVirtualSignal',\n enabled: Boolean(selfParticipant && session),\n onData: (data) => {\n const signal = data.eventfullyManagedVirtualSignal;\n if (signal) call.handleIncomingSignal(signal);\n },\n // No real polling substitute exists for signaling — a missed signal is\n // simply a missed negotiation step. The fallback here just retries the\n // subscription's own reconnect path via re-render, kept as a no-op.\n pollFn: () => {},\n pollIntervalMs: 15_000,\n });\n\n useEvmSubscription<{ eventfullyManagedVirtualParticipantsChanged: unknown }>({\n query: VIRTUAL_PARTICIPANTS_CHANGED_SUBSCRIPTION_SDL,\n variables: { sessionId: session?.id },\n operationName: 'EventfullymanagedVirtualParticipantsChanged',\n enabled: Boolean(session),\n onData: () => {\n void sessionQuery.refetch();\n },\n pollFn: () => {\n void sessionQuery.refetch();\n },\n pollIntervalMs: 5_000,\n });\n\n const onHost = async (chosenMode: 'MEETING' | 'WEBINAR') => {\n try {\n const response = await hostSession({ variables: { eventId, mode: chosenMode } });\n if (!mutationSucceeded(response, response.data?.hostVirtualSession?.id, 'Could not start session')) {\n return;\n }\n notify.success('Session started', chosenMode === 'WEBINAR' ? 'Hosting as a webinar.' : 'Hosting a meeting.');\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not start session', describeError(error));\n }\n };\n\n const onJoin = async () => {\n try {\n const response = await joinSession({ variables: { eventId } });\n if (!mutationSucceeded(response, response.data?.joinVirtualSession?.id, 'Could not join session')) {\n return;\n }\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not join session', describeError(error));\n }\n };\n\n const onLeave = async () => {\n if (!session) return;\n try {\n await leaveSession({ variables: { sessionId: session.id } });\n notify.success('Left session', 'You are no longer in the virtual session.');\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not leave session', describeError(error));\n }\n };\n\n const onEnd = async () => {\n if (!session) return;\n try {\n await endSession({ variables: { sessionId: session.id } });\n notify.success('Session ended', 'The virtual session has been ended for everyone.');\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not end session', describeError(error));\n }\n };\n\n const toggleMute = async () => {\n if (!session) return;\n const next = !localMuted;\n setLocalMuted(next);\n try {\n await setMuteMutation({ variables: { sessionId: session.id, muted: next } });\n } catch (error) {\n setLocalMuted(!next);\n notify.error('Could not update mute state', describeError(error));\n }\n };\n\n const toggleVideo = async () => {\n if (!session) return;\n const next = !localVideoOff;\n setLocalVideoOff(next);\n try {\n await setVideoMutation({ variables: { sessionId: session.id, videoEnabled: !next } });\n } catch (error) {\n setLocalVideoOff(!next);\n notify.error('Could not update camera state', describeError(error));\n }\n };\n\n const onPromote = async (participant: VirtualParticipantGql) => {\n if (!session) return;\n try {\n await promotePresenter({ variables: { sessionId: session.id, actorId: participant.actorId } });\n notify.success('Promoted to presenter', `Participant ${participant.actorId.slice(0, 6)} can now broadcast.`);\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not promote participant', describeError(error));\n }\n };\n\n const isHost = selfParticipant?.role === 'HOST';\n const busy = hosting || joining || leaving || ending;\n\n if (eventLoading || sessionQuery.loading) {\n return (\n <div className=\"space-y-4 p-6\">\n <Skeleton className=\"h-8 w-64\" />\n <Skeleton className=\"h-64 w-full\" />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6\">\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => navigate(`/events/${eventId}`)}>\n <ArrowLeft className=\"h-4 w-4\" />\n Back to Event\n </Button>\n\n <PagePurpose>\n A virtual session is a real, browser-native WebRTC room for this event — no external meeting link. Hosts start a\n Meeting (small mesh, up to 8 people all connected directly) or a Webinar (up to 30 attendees who see and hear\n only the host/presenters). Signaling is relayed through EventfullyManaged; media never touches our servers.\n </PagePurpose>\n\n <EmphasisPanel className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Virtual Session</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">{eventData?.event?.name ?? 'Event'}</p>\n </div>\n {session ? (\n <Badge variant={session.status === 'ACTIVE' ? 'success' : 'secondary'} className=\"uppercase\">\n {session.mode} · {session.status}\n </Badge>\n ) : null}\n </EmphasisPanel>\n\n {!session || session.status !== 'ACTIVE' ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-8\">\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No live virtual session\"\n description=\"Start a session to host attendees over WebRTC, or join once someone else has started one.\"\n className=\"py-6\"\n />\n <div className=\"mt-4 flex flex-wrap items-center justify-center gap-2\">\n <Select value={mode} onValueChange={(value) => setMode(value as 'MEETING' | 'WEBINAR')}>\n <SelectTrigger aria-label=\"Session mode\" className=\"w-48\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"MEETING\">Meeting (up to 8)</SelectItem>\n <SelectItem value=\"WEBINAR\">Webinar (up to 30)</SelectItem>\n </SelectContent>\n </Select>\n <Button type=\"button\" onClick={() => onHost(mode)} disabled={busy}>\n <Radio className=\"h-4 w-4\" />\n {hosting ? 'Starting…' : 'Start session'}\n </Button>\n </div>\n </GlassCard>\n ) : !selfParticipant ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-8\">\n <IllustratedEmptyState\n illustration=\"empty-people\"\n title=\"A session is live\"\n description={`${session.participantCount} of ${session.maxParticipants} seats in use. Join to turn on your camera and mic.`}\n className=\"py-6\"\n />\n <div className=\"mt-4 flex justify-center\">\n <Button type=\"button\" onClick={onJoin} disabled={busy}>\n <Video className=\"h-4 w-4\" />\n {joining ? 'Joining…' : 'Join session'}\n </Button>\n </div>\n </GlassCard>\n ) : (\n <>\n {call.mediaError ? (\n <GlassCard\n treatment=\"plain\"\n className=\"border-status-danger/40 bg-status-danger/5 p-4 text-sm text-status-danger\"\n >\n Camera/microphone unavailable: {call.mediaError}. You are still connected to the session and can see other\n participants, but others will not see or hear you.\n </GlassCard>\n ) : null}\n\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3\">\n <VideoTile\n actorId={selfActorId}\n role={selfParticipant.role}\n isLocal\n stream={call.localStream}\n muted={localMuted}\n videoEnabled={!localVideoOff}\n />\n {activeParticipants\n .filter((p) => p.actorId !== selfActorId)\n .map((participant) => (\n <VideoTile\n key={participant.actorId}\n actorId={participant.actorId}\n role={participant.role}\n isLocal={false}\n stream={call.remoteStreams.get(participant.actorId) ?? null}\n muted={participant.muted}\n videoEnabled={participant.videoEnabled}\n connectionState={call.connectionStates.get(participant.actorId)}\n />\n ))}\n </div>\n\n <GlassCard\n treatment=\"plain\"\n className=\"flex flex-wrap items-center justify-center gap-2 border-border-seam p-4\"\n >\n <Button type=\"button\" variant={localMuted ? 'outline' : 'secondary'} onClick={toggleMute}>\n {localMuted ? <MicOff className=\"h-4 w-4\" /> : <Mic className=\"h-4 w-4\" />}\n {localMuted ? 'Unmute' : 'Mute'}\n </Button>\n <Button type=\"button\" variant={localVideoOff ? 'outline' : 'secondary'} onClick={toggleVideo}>\n {localVideoOff ? <VideoOff className=\"h-4 w-4\" /> : <Video className=\"h-4 w-4\" />}\n {localVideoOff ? 'Start Video' : 'Stop Video'}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={onLeave} disabled={busy}>\n <PhoneOff className=\"h-4 w-4\" />\n {leaving ? 'Leaving…' : 'Leave'}\n </Button>\n {isHost ? (\n <Button type=\"button\" variant=\"destructive\" onClick={onEnd} disabled={busy}>\n <ScreenShare className=\"h-4 w-4\" />\n {ending ? 'Ending…' : 'End for everyone'}\n </Button>\n ) : null}\n </GlassCard>\n\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-4\">\n <h2 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Users className=\"h-4 w-4 text-accent-primary\" />\n Participants ({activeParticipants.length}/{session.maxParticipants})\n </h2>\n <div className=\"mt-3 space-y-2\">\n {activeParticipants.map((participant) => (\n <div key={participant.id} className=\"flex items-center justify-between gap-2 text-sm\">\n <span className=\"flex items-center gap-2 text-text-secondary\">\n <span\n className={`h-2 w-2 rounded-full ${\n participant.actorId === selfActorId\n ? 'bg-status-success'\n : connectionDotClass(call.connectionStates.get(participant.actorId))\n }`}\n />\n {participant.actorId === selfActorId ? 'You' : `Participant ${participant.actorId.slice(0, 6)}`}\n <Badge variant=\"secondary\" className=\"uppercase\">\n {participant.role}\n </Badge>\n </span>\n {isHost && session.mode === 'WEBINAR' && participant.role === 'ATTENDEE' ? (\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => onPromote(participant)}>\n Promote to presenter\n </Button>\n ) : null}\n </div>\n ))}\n </div>\n </GlassCard>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAsDA,SAASG,EAAS,GAAoB;CACpC,OAAOC,EAAG,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY;AACpC;AAEA,SAASC,EAAmB,GAAmD;CAI7E,OAHIC,MAAU,cAAoB,sBAC9BA,MAAU,gBAAgBA,MAAU,QAAc,sBAClDA,MAAU,YAAYA,MAAU,kBAAkBA,MAAU,WAAiB,qBAC1E;AACT;AAaA,SAASC,EAAU,EAAE,YAAS,SAAM,YAAS,WAAQ,UAAO,iBAAc,sBAAmC;CAC3G,IAAMC,IAAWC,EAAyB,IAAI;CAO9C,OANAC,QAAgB;EACd,AAAIF,EAAS,YAAS,EAAS,QAAQ,YAAYG;CACrD,GAAG,CAACA,CAAM,CAAC,GAKT,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CAHwBA,KAAWC,IAK/B,kBAAC,SAAD;GACE,KAAKJ;GACL,UAAA;GACA,aAAA;GACA,OAAOK;GACP,WAAU;GACV,OAAOA,IAAU,EAAE,WAAW,aAAa,IAAI,KAAA;EAChD,CAAA,IAED,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAAC,QAAD;IAAM,WAAU;IACb,UAAAV,EAASW,CAAO;GACb,CAAA;EACH,CAAA,GAEP,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACGD,IAAU,QAAQ,eAAeC,EAAQ,MAAM,GAAG,CAAC,KACnDC,MAAS,SAAS,YAAYA,MAAS,cAAc,iBAAiB,EACnE;GACN,CAAA,GAAA,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACGC,IAAQ,kB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AA,GAC3BvE,IAAU,aAAa,cAClB;;IACL,CAAA,CACI;GAEX,CAAA;EA4FC;;AAET"}
|
|
1
|
+
{"version":3,"file":"VirtualSessionPage.js","names":["Badge","_Fragment","Badge$1","initials","id","connectionDotClass","state","VideoTile","videoRef","useRef","useEffect","stream","videoEnabled","isLocal","actorId","role","muted","MicOff","connectionState","VirtualSessionPage","eventId","useParams","useEventfullyManaged","selfActorId","currentUser","eventData","eventLoading","useEventQuery","sessionQuery","useVirtualSessionQuery","session","mode","setMode","useState","hostSession","hosting","useHostVirtualSessionMutation","joinSession","joining","useJoinVirtualSessionMutation","leaveSession","leaving","useLeaveVirtualSessionMutation","endSession","ending","useEndVirtualSessionMutation","setMuteMutation","useSetVirtualMuteMutation","setVideoMutation","useSetVirtualVideoMutation","promotePresenter","usePromoteVirtualPresenterMutation","sendSignalMutation","useSendVirtualSignalMutation","selfParticipant","useMemo","p","activeParticipants","localMuted","setLocalMuted","localVideoOff","setLocalVideoOff","sendSignal","useCallback","args","call","useVirtualCall","useEvmSubscription","VIRTUAL_SIGNAL_SUBSCRIPTION_SDL","signal","data","VIRTUAL_PARTICIPANTS_CHANGED_SUBSCRIPTION_SDL","onHost","response","chosenMode","mutationSucceeded","notify","error","describeError","onJoin","onLeave","onEnd","toggleMute","next","toggleVideo","onPromote","participant","isHost","busy","Skeleton","Button","navigate","ArrowLeft","PagePurpose","EmphasisPanel","GradientText","GlassCard","IllustratedEmptyState","Select","value","SelectTrigger","SelectValue","SelectContent","SelectItem","Radio","Fragment","jsx","Mic","VideoOff","Video","PhoneOff","ScreenShare","VirtualEngagementPanel","Users"],"sources":["../../../../src/eventfullymanaged/pages/events/VirtualSessionPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/set-state-in-effect -- mirrors server-confirmed mute/video state into local toggle state, same established pattern as the fleet's *FormPage.tsx entity-hydration effects */\n/**\n * VirtualSessionPage (BOFF-4318)\n *\n * Real join/host flow for an event's virtual/hybrid session, backed by\n * `wspace-eventfullymanaged-svc`'s bounded browser-native WebRTC core\n * (`VirtualSessionService`). MEETING mode is a full mesh (cap 8);\n * WEBINAR mode is a host/presenter-broadcast star (cap 30) — attendees\n * only peer with the host/presenters, never each other. See\n * `useVirtualCall` for the exact topology and signaling logic.\n *\n * Large-audience broadcast (hundreds+ viewers) needs a real SFU/media\n * server and is explicit deferred follow-up — not built here.\n */\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n} from '@burdenoff/fe-libs/ui';\nimport { ArrowLeft, Mic, MicOff, PhoneOff, Radio, ScreenShare, Users, Video, VideoOff } from 'lucide-react';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useParams } from 'react-router';\n\nimport {\n useEndVirtualSessionMutation,\n useEventQuery,\n useHostVirtualSessionMutation,\n useJoinVirtualSessionMutation,\n useLeaveVirtualSessionMutation,\n usePromoteVirtualPresenterMutation,\n useSendVirtualSignalMutation,\n useSetVirtualMuteMutation,\n useSetVirtualVideoMutation,\n useVirtualSessionQuery,\n VIRTUAL_PARTICIPANTS_CHANGED_SUBSCRIPTION_SDL,\n VIRTUAL_SIGNAL_SUBSCRIPTION_SDL,\n type VirtualParticipantGql,\n} from '../../api/eventApi';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { useEvmSubscription } from '../../hooks/useEvmSubscription';\nimport { type IncomingVirtualSignal, type VirtualCallRole, useVirtualCall } from '../../hooks/useVirtualCall';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\nimport { VirtualEngagementPanel } from './VirtualEngagementPanel';\n\nfunction initials(id: string): string {\n return id.slice(0, 2).toUpperCase();\n}\n\nfunction connectionDotClass(state: RTCPeerConnectionState | undefined): string {\n if (state === 'connected') return 'bg-status-success';\n if (state === 'connecting' || state === 'new') return 'bg-status-warning';\n if (state === 'failed' || state === 'disconnected' || state === 'closed') return 'bg-status-danger';\n return 'bg-text-muted';\n}\n\ninterface VideoTileProps {\n actorId: string;\n role: VirtualCallRole;\n isLocal: boolean;\n stream: MediaStream | null;\n /** Muted/videoEnabled reflect the persisted participant state (server-confirmed for remotes, local toggle for self). */\n muted: boolean;\n videoEnabled: boolean;\n connectionState?: RTCPeerConnectionState;\n}\n\nfunction VideoTile({ actorId, role, isLocal, stream, muted, videoEnabled, connectionState }: VideoTileProps) {\n const videoRef = useRef<HTMLVideoElement>(null);\n useEffect(() => {\n if (videoRef.current) videoRef.current.srcObject = stream;\n }, [stream]);\n\n const showVideo = Boolean(stream) && videoEnabled;\n\n return (\n <div className=\"relative aspect-video overflow-hidden rounded-card border border-border-seam bg-bg-sunken\">\n {showVideo ? (\n <video\n ref={videoRef}\n autoPlay\n playsInline\n muted={isLocal}\n className=\"h-full w-full object-cover\"\n style={isLocal ? { transform: 'scaleX(-1)' } : undefined}\n />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center\">\n <span className=\"flex h-12 w-12 items-center justify-center rounded-full bg-accent-primary/10 text-sm font-semibold text-accent-primary\">\n {initials(actorId)}\n </span>\n </div>\n )}\n <div className=\"absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-gradient-to-t from-bg-overlay to-transparent p-2\">\n <span className=\"truncate text-xs font-medium text-action-primary-text\">\n {isLocal ? 'You' : `Participant ${actorId.slice(0, 6)}`}\n {role === 'HOST' ? ' · Host' : role === 'PRESENTER' ? ' · Presenter' : ''}\n </span>\n <span className=\"flex items-center gap-1.5\">\n {muted ? <MicOff className=\"h-3.5 w-3.5 text-action-primary-text\" /> : null}\n {!isLocal ? (\n <span\n className={`h-2 w-2 rounded-full ${connectionDotClass(connectionState)}`}\n title={connectionState ?? 'connecting'}\n />\n ) : null}\n </span>\n </div>\n </div>\n );\n}\n\nexport default function VirtualSessionPage() {\n const { id: eventId = '' } = useParams<{ id: string }>();\n const { navigate, currentUser } = useEventfullyManaged();\n const selfActorId = currentUser?.id ?? '';\n\n const { data: eventData, loading: eventLoading } = useEventQuery(eventId);\n const sessionQuery = useVirtualSessionQuery({ eventId });\n const session = sessionQuery.data?.virtualSession ?? null;\n\n const [mode, setMode] = useState<'MEETING' | 'WEBINAR'>('MEETING');\n const [hostSession, { loading: hosting }] = useHostVirtualSessionMutation();\n const [joinSession, { loading: joining }] = useJoinVirtualSessionMutation();\n const [leaveSession, { loading: leaving }] = useLeaveVirtualSessionMutation();\n const [endSession, { loading: ending }] = useEndVirtualSessionMutation();\n const [setMuteMutation] = useSetVirtualMuteMutation();\n const [setVideoMutation] = useSetVirtualVideoMutation();\n const [promotePresenter] = usePromoteVirtualPresenterMutation();\n const [sendSignalMutation] = useSendVirtualSignalMutation();\n\n const selfParticipant = useMemo(\n () => session?.participants.find((p) => p.actorId === selfActorId && !p.leftAt) ?? null,\n [session, selfActorId]\n );\n const activeParticipants = useMemo(() => (session?.participants ?? []).filter((p) => !p.leftAt), [session]);\n\n const [localMuted, setLocalMuted] = useState(false);\n const [localVideoOff, setLocalVideoOff] = useState(false);\n useEffect(() => {\n if (selfParticipant) {\n setLocalMuted(selfParticipant.muted);\n setLocalVideoOff(!selfParticipant.videoEnabled);\n }\n }, [selfParticipant?.muted, selfParticipant?.videoEnabled]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const sendSignal = useCallback(\n async (args: { toActorId: string; signalType: 'OFFER' | 'ANSWER' | 'ICE_CANDIDATE'; payload: unknown }) => {\n if (!session) return;\n await sendSignalMutation({\n variables: {\n sessionId: session.id,\n toActorId: args.toActorId,\n signalType: args.signalType,\n payload: args.payload,\n },\n });\n },\n [session, sendSignalMutation]\n );\n\n const call = useVirtualCall({\n sessionId: selfParticipant ? session?.id : null,\n selfActorId,\n mode: session?.mode ?? 'MEETING',\n selfRole: selfParticipant?.role ?? null,\n participants: activeParticipants.map((p) => ({ actorId: p.actorId, role: p.role })),\n sendSignal,\n muted: localMuted,\n videoEnabled: !localVideoOff,\n });\n\n useEvmSubscription<{ eventfullyManagedVirtualSignal: IncomingVirtualSignal }>({\n query: VIRTUAL_SIGNAL_SUBSCRIPTION_SDL,\n variables: { sessionId: session?.id },\n operationName: 'EventfullymanagedVirtualSignal',\n enabled: Boolean(selfParticipant && session),\n onData: (data) => {\n const signal = data.eventfullyManagedVirtualSignal;\n if (signal) call.handleIncomingSignal(signal);\n },\n // No real polling substitute exists for signaling — a missed signal is\n // simply a missed negotiation step. The fallback here just retries the\n // subscription's own reconnect path via re-render, kept as a no-op.\n pollFn: () => {},\n pollIntervalMs: 15_000,\n });\n\n useEvmSubscription<{ eventfullyManagedVirtualParticipantsChanged: unknown }>({\n query: VIRTUAL_PARTICIPANTS_CHANGED_SUBSCRIPTION_SDL,\n variables: { sessionId: session?.id },\n operationName: 'EventfullymanagedVirtualParticipantsChanged',\n enabled: Boolean(session),\n onData: () => {\n void sessionQuery.refetch();\n },\n pollFn: () => {\n void sessionQuery.refetch();\n },\n pollIntervalMs: 5_000,\n });\n\n const onHost = async (chosenMode: 'MEETING' | 'WEBINAR') => {\n try {\n const response = await hostSession({ variables: { eventId, mode: chosenMode } });\n if (!mutationSucceeded(response, response.data?.hostVirtualSession?.id, 'Could not start session')) {\n return;\n }\n notify.success('Session started', chosenMode === 'WEBINAR' ? 'Hosting as a webinar.' : 'Hosting a meeting.');\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not start session', describeError(error));\n }\n };\n\n const onJoin = async () => {\n try {\n const response = await joinSession({ variables: { eventId } });\n if (!mutationSucceeded(response, response.data?.joinVirtualSession?.id, 'Could not join session')) {\n return;\n }\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not join session', describeError(error));\n }\n };\n\n const onLeave = async () => {\n if (!session) return;\n try {\n await leaveSession({ variables: { sessionId: session.id } });\n notify.success('Left session', 'You are no longer in the virtual session.');\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not leave session', describeError(error));\n }\n };\n\n const onEnd = async () => {\n if (!session) return;\n try {\n await endSession({ variables: { sessionId: session.id } });\n notify.success('Session ended', 'The virtual session has been ended for everyone.');\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not end session', describeError(error));\n }\n };\n\n const toggleMute = async () => {\n if (!session) return;\n const next = !localMuted;\n setLocalMuted(next);\n try {\n await setMuteMutation({ variables: { sessionId: session.id, muted: next } });\n } catch (error) {\n setLocalMuted(!next);\n notify.error('Could not update mute state', describeError(error));\n }\n };\n\n const toggleVideo = async () => {\n if (!session) return;\n const next = !localVideoOff;\n setLocalVideoOff(next);\n try {\n await setVideoMutation({ variables: { sessionId: session.id, videoEnabled: !next } });\n } catch (error) {\n setLocalVideoOff(!next);\n notify.error('Could not update camera state', describeError(error));\n }\n };\n\n const onPromote = async (participant: VirtualParticipantGql) => {\n if (!session) return;\n try {\n await promotePresenter({ variables: { sessionId: session.id, actorId: participant.actorId } });\n notify.success('Promoted to presenter', `Participant ${participant.actorId.slice(0, 6)} can now broadcast.`);\n await sessionQuery.refetch();\n } catch (error) {\n notify.error('Could not promote participant', describeError(error));\n }\n };\n\n const isHost = selfParticipant?.role === 'HOST';\n const busy = hosting || joining || leaving || ending;\n\n if (eventLoading || sessionQuery.loading) {\n return (\n <div className=\"space-y-4 p-6\">\n <Skeleton className=\"h-8 w-64\" />\n <Skeleton className=\"h-64 w-full\" />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6\">\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => navigate(`/events/${eventId}`)}>\n <ArrowLeft className=\"h-4 w-4\" />\n Back to Event\n </Button>\n\n <PagePurpose>\n A virtual session is a real, browser-native WebRTC room for this event — no external meeting link. Hosts start a\n Meeting (small mesh, up to 8 people all connected directly) or a Webinar (up to 30 attendees who see and hear\n only the host/presenters). Signaling is relayed through EventfullyManaged; media never touches our servers.\n </PagePurpose>\n\n <EmphasisPanel className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Virtual Session</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">{eventData?.event?.name ?? 'Event'}</p>\n </div>\n {session ? (\n <Badge variant={session.status === 'ACTIVE' ? 'success' : 'secondary'} className=\"uppercase\">\n {session.mode} · {session.status}\n </Badge>\n ) : null}\n </EmphasisPanel>\n\n {!session || session.status !== 'ACTIVE' ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-8\">\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No live virtual session\"\n description=\"Start a session to host attendees over WebRTC, or join once someone else has started one.\"\n className=\"py-6\"\n />\n <div className=\"mt-4 flex flex-wrap items-center justify-center gap-2\">\n <Select value={mode} onValueChange={(value) => setMode(value as 'MEETING' | 'WEBINAR')}>\n <SelectTrigger aria-label=\"Session mode\" className=\"w-48\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"MEETING\">Meeting (up to 8)</SelectItem>\n <SelectItem value=\"WEBINAR\">Webinar (up to 30)</SelectItem>\n </SelectContent>\n </Select>\n <Button type=\"button\" onClick={() => onHost(mode)} disabled={busy}>\n <Radio className=\"h-4 w-4\" />\n {hosting ? 'Starting…' : 'Start session'}\n </Button>\n </div>\n </GlassCard>\n ) : !selfParticipant ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-8\">\n <IllustratedEmptyState\n illustration=\"empty-people\"\n title=\"A session is live\"\n description={`${session.participantCount} of ${session.maxParticipants} seats in use. Join to turn on your camera and mic.`}\n className=\"py-6\"\n />\n <div className=\"mt-4 flex justify-center\">\n <Button type=\"button\" onClick={onJoin} disabled={busy}>\n <Video className=\"h-4 w-4\" />\n {joining ? 'Joining…' : 'Join session'}\n </Button>\n </div>\n </GlassCard>\n ) : (\n <>\n {call.mediaError ? (\n <GlassCard\n treatment=\"plain\"\n className=\"border-status-danger/40 bg-status-danger/5 p-4 text-sm text-status-danger\"\n >\n Camera/microphone unavailable: {call.mediaError}. You are still connected to the session and can see other\n participants, but others will not see or hear you.\n </GlassCard>\n ) : null}\n\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3\">\n <VideoTile\n actorId={selfActorId}\n role={selfParticipant.role}\n isLocal\n stream={call.localStream}\n muted={localMuted}\n videoEnabled={!localVideoOff}\n />\n {activeParticipants\n .filter((p) => p.actorId !== selfActorId)\n .map((participant) => (\n <VideoTile\n key={participant.actorId}\n actorId={participant.actorId}\n role={participant.role}\n isLocal={false}\n stream={call.remoteStreams.get(participant.actorId) ?? null}\n muted={participant.muted}\n videoEnabled={participant.videoEnabled}\n connectionState={call.connectionStates.get(participant.actorId)}\n />\n ))}\n </div>\n\n <GlassCard\n treatment=\"plain\"\n className=\"flex flex-wrap items-center justify-center gap-2 border-border-seam p-4\"\n >\n <Button type=\"button\" variant={localMuted ? 'outline' : 'secondary'} onClick={toggleMute}>\n {localMuted ? <MicOff className=\"h-4 w-4\" /> : <Mic className=\"h-4 w-4\" />}\n {localMuted ? 'Unmute' : 'Mute'}\n </Button>\n <Button type=\"button\" variant={localVideoOff ? 'outline' : 'secondary'} onClick={toggleVideo}>\n {localVideoOff ? <VideoOff className=\"h-4 w-4\" /> : <Video className=\"h-4 w-4\" />}\n {localVideoOff ? 'Start Video' : 'Stop Video'}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={onLeave} disabled={busy}>\n <PhoneOff className=\"h-4 w-4\" />\n {leaving ? 'Leaving…' : 'Leave'}\n </Button>\n {isHost ? (\n <Button type=\"button\" variant=\"destructive\" onClick={onEnd} disabled={busy}>\n <ScreenShare className=\"h-4 w-4\" />\n {ending ? 'Ending…' : 'End for everyone'}\n </Button>\n ) : null}\n </GlassCard>\n\n <VirtualEngagementPanel\n key={session.id}\n sessionId={session.id}\n canModerate={Boolean(selfParticipant) && session.hostId === selfActorId}\n />\n\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-4\">\n <h2 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Users className=\"h-4 w-4 text-accent-primary\" />\n Participants ({activeParticipants.length}/{session.maxParticipants})\n </h2>\n <div className=\"mt-3 space-y-2\">\n {activeParticipants.map((participant) => (\n <div key={participant.id} className=\"flex items-center justify-between gap-2 text-sm\">\n <span className=\"flex items-center gap-2 text-text-secondary\">\n <span\n className={`h-2 w-2 rounded-full ${\n participant.actorId === selfActorId\n ? 'bg-status-success'\n : connectionDotClass(call.connectionStates.get(participant.actorId))\n }`}\n />\n {participant.actorId === selfActorId ? 'You' : `Participant ${participant.actorId.slice(0, 6)}`}\n <Badge variant=\"secondary\" className=\"uppercase\">\n {participant.role}\n </Badge>\n </span>\n {isHost && session.mode === 'WEBINAR' && participant.role === 'ATTENDEE' ? (\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => onPromote(participant)}>\n Promote to presenter\n </Button>\n ) : null}\n </div>\n ))}\n </div>\n </GlassCard>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAuDA,SAASG,EAAS,GAAoB;CACpC,OAAOC,EAAG,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY;AACpC;AAEA,SAASC,EAAmB,GAAmD;CAI7E,OAHIC,MAAU,cAAoB,sBAC9BA,MAAU,gBAAgBA,MAAU,QAAc,sBAClDA,MAAU,YAAYA,MAAU,kBAAkBA,MAAU,WAAiB,qBAC1E;AACT;AAaA,SAASC,EAAU,EAAE,YAAS,SAAM,YAAS,WAAQ,UAAO,iBAAc,sBAAmC;CAC3G,IAAMC,IAAWC,EAAyB,IAAI;CAO9C,OANAC,QAAgB;EACd,AAAIF,EAAS,YAAS,EAAS,QAAQ,YAAYG;CACrD,GAAG,CAACA,CAAM,CAAC,GAKT,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CAHwBA,KAAWC,IAK/B,kBAAC,SAAD;GACE,KAAKJ;GACL,UAAA;GACA,aAAA;GACA,OAAOK;GACP,WAAU;GACV,OAAOA,IAAU,EAAE,WAAW,aAAa,IAA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