@100mslive/roomkit-react 0.1.7-alpha.0 → 0.1.8-alpha.0
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/AudioLevel/AudioLevel.d.ts +5 -8
- package/dist/AudioLevel/index.d.ts +2 -1
- package/dist/AudioLevel/useBorderAudioLevel.d.ts +8 -0
- package/dist/{HLSView-F5BDZVT2.js → HLSView-IQRPLYNH.js} +8 -6
- package/dist/{HLSView-F5BDZVT2.js.map → HLSView-IQRPLYNH.js.map} +2 -2
- package/dist/Prebuilt/components/Chip.d.ts +12 -0
- package/dist/Prebuilt/components/PrebuiltDialogPortal.d.ts +4 -0
- package/dist/Prebuilt/components/RoleChangeRequest/RequestPrompt.d.ts +9 -0
- package/dist/VideoTile/StyledVideoTile.d.ts +445 -3
- package/dist/{VirtualBackground-THDRYDRA.js → VirtualBackground-GP4ATXD3.js} +3 -3
- package/dist/{chunk-JSH7SKEH.js → chunk-2H5NIZB7.js} +2 -2
- package/dist/{chunk-CDYRVICT.js → chunk-GLYGPYNS.js} +574 -1196
- package/dist/chunk-GLYGPYNS.js.map +7 -0
- package/dist/{chunk-U3G743OY.js → chunk-Z3O2WGWV.js} +2 -2
- package/dist/{chunk-U3G743OY.js.map → chunk-Z3O2WGWV.js.map} +1 -1
- package/dist/{conference-6IVZHILI.js → conference-JD35TNH4.js} +1545 -840
- package/dist/conference-JD35TNH4.js.map +7 -0
- package/dist/index.cjs.js +5975 -5849
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +4 -2
- package/dist/meta.cjs.json +1633 -1399
- package/dist/meta.esbuild.json +1689 -1454
- package/package.json +6 -6
- package/src/AudioLevel/AudioLevel.tsx +79 -30
- package/src/AudioLevel/audio-level.png +0 -0
- package/src/AudioLevel/index.ts +2 -1
- package/src/AudioLevel/useBorderAudioLevel.tsx +34 -0
- package/src/Input/Input.tsx +1 -1
- package/src/Prebuilt/App.tsx +1 -0
- package/src/Prebuilt/components/Chat/ChatBody.jsx +125 -106
- package/src/Prebuilt/components/{Chip.jsx → Chip.tsx} +13 -2
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +24 -13
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +43 -3
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +41 -46
- package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +23 -35
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +3 -2
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +3 -2
- package/src/Prebuilt/components/MwebLandscapePrompt.jsx +58 -0
- package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -2
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +3 -2
- package/src/Prebuilt/components/PrebuiltDialogPortal.tsx +6 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +9 -6
- package/src/Prebuilt/components/RaiseHand.jsx +4 -11
- package/src/Prebuilt/components/RoleChangeModal.jsx +3 -2
- package/src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx +67 -0
- package/src/Prebuilt/components/{RoleChangeRequestModal.tsx → RoleChangeRequest/RoleChangeRequestModal.tsx} +18 -50
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -2
- package/src/Prebuilt/components/Settings/StartRecording.jsx +3 -2
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -2
- package/src/Prebuilt/components/VideoTile.jsx +34 -75
- package/src/Prebuilt/components/conference.jsx +1 -1
- package/src/Prebuilt/components/hooks/useMetadata.jsx +2 -1
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +3 -2
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +4 -29
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +3 -2
- package/src/Prebuilt/layouts/HLSView.jsx +4 -2
- package/src/Prebuilt/layouts/SidePane.tsx +0 -1
- package/src/Prebuilt/primitives/DialogContent.jsx +5 -4
- package/src/VideoTile/StyledVideoTile.tsx +10 -14
- package/dist/chunk-CDYRVICT.js.map +0 -7
- package/dist/conference-6IVZHILI.js.map +0 -7
- /package/dist/Prebuilt/components/{RoleChangeRequestModal.d.ts → RoleChangeRequest/RoleChangeRequestModal.d.ts} +0 -0
- /package/dist/{VirtualBackground-THDRYDRA.js.map → VirtualBackground-GP4ATXD3.js.map} +0 -0
- /package/dist/{chunk-JSH7SKEH.js.map → chunk-2H5NIZB7.js.map} +0 -0
@@ -35,7 +35,7 @@ import {
|
|
35
35
|
textEllipsis,
|
36
36
|
theme,
|
37
37
|
toastAnimation
|
38
|
-
} from "./chunk-
|
38
|
+
} from "./chunk-Z3O2WGWV.js";
|
39
39
|
|
40
40
|
// src/Button/Button.tsx
|
41
41
|
import React2 from "react";
|
@@ -657,7 +657,7 @@ var Input = styled("input", {
|
|
657
657
|
border: "1px solid transparent"
|
658
658
|
},
|
659
659
|
"&::placeholder": {
|
660
|
-
color: "$
|
660
|
+
color: "$on_surface_medium"
|
661
661
|
},
|
662
662
|
variants: {
|
663
663
|
alert_error_default: {
|
@@ -779,19 +779,10 @@ var Info = styled("div", {
|
|
779
779
|
textOverflow: "ellipsis",
|
780
780
|
fontFamily: "$sans"
|
781
781
|
});
|
782
|
-
var AttributeBox = styled("div", __spreadValues({
|
783
|
-
position: "absolute",
|
784
|
-
color: "$on_primary_high",
|
785
|
-
w: "$12",
|
786
|
-
h: "$12",
|
787
|
-
bg: "$secondary_dim",
|
788
|
-
r: "$round"
|
789
|
-
}, flexCenter));
|
790
|
-
var AudioIndicator = styled("div", __spreadProps(__spreadValues({
|
782
|
+
var AttributeBox = styled("div", __spreadProps(__spreadValues({
|
791
783
|
position: "absolute",
|
792
784
|
top: "$4",
|
793
|
-
|
794
|
-
color: "$on_primary_high",
|
785
|
+
color: "$on_secondary_high",
|
795
786
|
bg: "$secondary_dim",
|
796
787
|
borderRadius: "$round",
|
797
788
|
width: "$14",
|
@@ -812,12 +803,18 @@ var AudioIndicator = styled("div", __spreadProps(__spreadValues({
|
|
812
803
|
width: "$13",
|
813
804
|
height: "$13"
|
814
805
|
}
|
806
|
+
},
|
807
|
+
position: {
|
808
|
+
left: { left: "$4" },
|
809
|
+
right: { right: "$4" }
|
815
810
|
}
|
816
811
|
},
|
817
812
|
defaultVariants: {
|
818
|
-
size: "medium"
|
813
|
+
size: "medium",
|
814
|
+
position: "left"
|
819
815
|
}
|
820
816
|
}));
|
817
|
+
var AudioIndicator = styled(AttributeBox, { defaultVariants: { position: "right" } });
|
821
818
|
var FullScreenButton = styled("button", {
|
822
819
|
width: "2.25rem",
|
823
820
|
height: "2.25rem",
|
@@ -854,9 +851,9 @@ var StyledVideoTile = {
|
|
854
851
|
Container,
|
855
852
|
Overlay: Overlay2,
|
856
853
|
Info,
|
857
|
-
AudioIndicator,
|
858
854
|
AvatarContainer,
|
859
855
|
AttributeBox,
|
856
|
+
AudioIndicator,
|
860
857
|
FullScreenButton
|
861
858
|
};
|
862
859
|
|
@@ -1224,7 +1221,7 @@ var StyledMenuTile = {
|
|
1224
1221
|
RemoveItem: RemoveMenuItem
|
1225
1222
|
};
|
1226
1223
|
|
1227
|
-
// src/AudioLevel/
|
1224
|
+
// src/AudioLevel/useBorderAudioLevel.tsx
|
1228
1225
|
import { useCallback as useCallback2, useRef as useRef2 } from "react";
|
1229
1226
|
import { useAudioLevelStyles } from "@100mslive/react-sdk";
|
1230
1227
|
function useBorderAudioLevel(audioTrackId) {
|
@@ -1252,6 +1249,83 @@ var sigmoid = (z) => {
|
|
1252
1249
|
return 1 / (1 + Math.exp(-z));
|
1253
1250
|
};
|
1254
1251
|
|
1252
|
+
// src/AudioLevel/AudioLevel.tsx
|
1253
|
+
import React10, { useEffect as useEffect3, useRef as useRef3 } from "react";
|
1254
|
+
import { selectTrackAudioByID, useHMSVanillaStore } from "@100mslive/react-sdk";
|
1255
|
+
|
1256
|
+
// src/AudioLevel/audio-level.png
|
1257
|
+
var audio_level_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAABABAMAAAAHc7SNAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAtUExURQAAAP///////////////////////////////////////////////////////6FIq5sAAAAOdFJOUwA/QJqbnJ2euLnc3d7+2IFKrQAAAa9JREFUaN7dmcFRxDAMRXNgW4AbV24ZSkgrlAAFUAqlpITtgT0QnB22BnY3iWXHSlYz5H/NoJNO8bP8JTlyVW1k923/MveYdnc623PuUe3jsux37tEDcN24eFR7HJb9TD2qvQ/LfqUexR7a41Xx7bDsMfWo2j+NlnpU7TsBiOKdAOqoeCcAUTwFYFK8pn0GgFLttWVxAEq1pwJo1Z4KoFV7KoBW7YEAT0uK729pfxuAZcX/3Fr2TwAx05cVDwWIu11RPBQg7lZ0XlR7JIDsdkXxCIDp5GXf2v0GBxBP3pTfAIB48qb83h7AWtlhANbKDgOwVnYYgLWywwCsn/u/AO5HMIqwcwOovdNwLESNG8BQioNfKa52YwBsakC04/MF9C1Rw4HdjhU1SCyKqOCvZCGLhXgMgKgGiUWRI9hr+aSG+bU8sP4LyliIxwW4xOI1j8pKZlB/Tjt794ANpKzdAzOgaOzdAzKiCVpmkACWM4MEIFVCyQzfQWXnPao9eA+rG+dxfXB8L1jNB4pN+bCfd4re59Gqoz9alflQ+zzb7ZROwTWlUziEIO8UZCs7hc1+AbiVW6XSE8knAAAAAElFTkSuQmCC";
|
1258
|
+
|
1259
|
+
// src/AudioLevel/AudioLevel.tsx
|
1260
|
+
var positionValues = new Array(101).fill(0).reduce((acc, _, index) => {
|
1261
|
+
acc[index] = Math.round(index / 100 * 4) / 4;
|
1262
|
+
return acc;
|
1263
|
+
}, {});
|
1264
|
+
var barAnimation = keyframes({
|
1265
|
+
from: {
|
1266
|
+
maskSize: "4em .8em",
|
1267
|
+
"-webkit-mask-position-y": ".1em",
|
1268
|
+
maskPosition: "initial .1em"
|
1269
|
+
},
|
1270
|
+
"50%": {
|
1271
|
+
maskSize: "4em 1em",
|
1272
|
+
"-webkit-mask-position-y": 0,
|
1273
|
+
maskPosition: "initial 0"
|
1274
|
+
},
|
1275
|
+
to: {
|
1276
|
+
maskSize: "4em .8em",
|
1277
|
+
"-webkit-mask-position-y": ".1em",
|
1278
|
+
maskPosition: "initial 0"
|
1279
|
+
}
|
1280
|
+
});
|
1281
|
+
var AudioBar = () => {
|
1282
|
+
return /* @__PURE__ */ React10.createElement(
|
1283
|
+
Box,
|
1284
|
+
{
|
1285
|
+
css: {
|
1286
|
+
width: ".25em",
|
1287
|
+
height: "1em",
|
1288
|
+
maskImage: `url(${audio_level_default})`,
|
1289
|
+
"-webkit-mask-repeat": "no-repeat",
|
1290
|
+
backgroundColor: "$on_primary_high",
|
1291
|
+
maskSize: "4em 1em"
|
1292
|
+
}
|
1293
|
+
}
|
1294
|
+
);
|
1295
|
+
};
|
1296
|
+
var AudioLevel = ({ trackId, size }) => {
|
1297
|
+
const ref = useRef3(null);
|
1298
|
+
const vanillaStore = useHMSVanillaStore();
|
1299
|
+
useEffect3(() => {
|
1300
|
+
const unsubscribe = vanillaStore.subscribe((audioLevel) => {
|
1301
|
+
if (ref.current) {
|
1302
|
+
let index = 0;
|
1303
|
+
for (const child of ref.current.children) {
|
1304
|
+
const positionX = `-${positionValues[audioLevel] * (index === 1 ? 2.5 : 1.25)}em`;
|
1305
|
+
child.style["-webkit-mask-position-x"] = positionX;
|
1306
|
+
child.style["mask-position"] = `${positionX} 0`;
|
1307
|
+
child.style["animation"] = positionValues[audioLevel] > 0 ? `${barAnimation} 0.6s steps(3,jump-none) 0s infinite` : "none";
|
1308
|
+
index++;
|
1309
|
+
}
|
1310
|
+
}
|
1311
|
+
}, selectTrackAudioByID(trackId));
|
1312
|
+
return unsubscribe;
|
1313
|
+
}, [vanillaStore, trackId]);
|
1314
|
+
return /* @__PURE__ */ React10.createElement(
|
1315
|
+
Flex,
|
1316
|
+
{
|
1317
|
+
ref,
|
1318
|
+
css: {
|
1319
|
+
fontSize: size === "small" ? "0.75rem" : "1rem",
|
1320
|
+
gap: size === "small" ? "$1" : "$2"
|
1321
|
+
}
|
1322
|
+
},
|
1323
|
+
/* @__PURE__ */ React10.createElement(AudioBar, null),
|
1324
|
+
/* @__PURE__ */ React10.createElement(AudioBar, null),
|
1325
|
+
/* @__PURE__ */ React10.createElement(AudioBar, null)
|
1326
|
+
);
|
1327
|
+
};
|
1328
|
+
|
1255
1329
|
// src/Popover/index.tsx
|
1256
1330
|
import { Arrow as Arrow2, Close as Close2, Content as Content4, Popover as Root12, Portal as Portal3, Trigger as Trigger4 } from "@radix-ui/react-popover";
|
1257
1331
|
var StyledContent2 = styled(Content4, __spreadValues({
|
@@ -1273,7 +1347,7 @@ var Popover2 = {
|
|
1273
1347
|
};
|
1274
1348
|
|
1275
1349
|
// src/Stats/Stats.tsx
|
1276
|
-
import
|
1350
|
+
import React11, { Fragment } from "react";
|
1277
1351
|
import {
|
1278
1352
|
selectConnectionQualityByPeerID,
|
1279
1353
|
selectHMSStats,
|
@@ -1353,7 +1427,7 @@ function VideoTileStats({ videoTrackID, audioTrackID, peerID, isLocal = false })
|
|
1353
1427
|
if (!(audioTrackStats || videoTrackStats)) {
|
1354
1428
|
return null;
|
1355
1429
|
}
|
1356
|
-
return /* @__PURE__ */
|
1430
|
+
return /* @__PURE__ */ React11.createElement(Stats.Root, null, /* @__PURE__ */ React11.createElement("table", null, /* @__PURE__ */ React11.createElement("tbody", null, isLocal ? /* @__PURE__ */ React11.createElement(Fragment, null, /* @__PURE__ */ React11.createElement(
|
1357
1431
|
StatsRow,
|
1358
1432
|
{
|
1359
1433
|
show: isNotNullishAndNot0(availableOutgoingBitrate),
|
@@ -1367,71 +1441,71 @@ function VideoTileStats({ videoTrackID, audioTrackID, peerID, isLocal = false })
|
|
1367
1441
|
return null;
|
1368
1442
|
}
|
1369
1443
|
const layer = stat.rid ? simulcastMapping[stat.rid] : "";
|
1370
|
-
return /* @__PURE__ */
|
1444
|
+
return /* @__PURE__ */ React11.createElement(Fragment, null, layer && /* @__PURE__ */ React11.createElement(StatsRow, { label: layer.toUpperCase(), value: "" }), /* @__PURE__ */ React11.createElement(
|
1371
1445
|
StatsRow,
|
1372
1446
|
{
|
1373
1447
|
show: isNotNullishAndNot0(stat.frameWidth),
|
1374
1448
|
label: "Width",
|
1375
1449
|
value: (_a8 = stat.frameWidth) == null ? void 0 : _a8.toString()
|
1376
1450
|
}
|
1377
|
-
), /* @__PURE__ */
|
1451
|
+
), /* @__PURE__ */ React11.createElement(
|
1378
1452
|
StatsRow,
|
1379
1453
|
{
|
1380
1454
|
show: isNotNullishAndNot0(stat.frameHeight),
|
1381
1455
|
label: "Height",
|
1382
1456
|
value: (_b8 = stat.frameHeight) == null ? void 0 : _b8.toString()
|
1383
1457
|
}
|
1384
|
-
), /* @__PURE__ */
|
1458
|
+
), /* @__PURE__ */ React11.createElement(
|
1385
1459
|
StatsRow,
|
1386
1460
|
{
|
1387
1461
|
show: isNotNullishAndNot0(stat.framesPerSecond),
|
1388
1462
|
label: "FPS",
|
1389
1463
|
value: `${stat.framesPerSecond} ${isNotNullishAndNot0(stat.framesDropped) ? `(${stat.framesDropped} dropped)` : ""}`
|
1390
1464
|
}
|
1391
|
-
), /* @__PURE__ */
|
1465
|
+
), /* @__PURE__ */ React11.createElement(
|
1392
1466
|
StatsRow,
|
1393
1467
|
{
|
1394
1468
|
show: isNotNullish(stat.bitrate),
|
1395
1469
|
label: "Bitrate(V)",
|
1396
1470
|
value: formatBytes(stat.bitrate, "b/s")
|
1397
1471
|
}
|
1398
|
-
), /* @__PURE__ */
|
1399
|
-
})) : /* @__PURE__ */
|
1472
|
+
), /* @__PURE__ */ React11.createElement(Stats.Gap, null));
|
1473
|
+
})) : /* @__PURE__ */ React11.createElement(Fragment, null, /* @__PURE__ */ React11.createElement(
|
1400
1474
|
StatsRow,
|
1401
1475
|
{
|
1402
1476
|
show: isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.frameWidth),
|
1403
1477
|
label: "Width",
|
1404
1478
|
value: (_b7 = videoTrackStats == null ? void 0 : videoTrackStats.frameWidth) == null ? void 0 : _b7.toString()
|
1405
1479
|
}
|
1406
|
-
), /* @__PURE__ */
|
1480
|
+
), /* @__PURE__ */ React11.createElement(
|
1407
1481
|
StatsRow,
|
1408
1482
|
{
|
1409
1483
|
show: isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.frameHeight),
|
1410
1484
|
label: "Height",
|
1411
1485
|
value: (_c = videoTrackStats == null ? void 0 : videoTrackStats.frameHeight) == null ? void 0 : _c.toString()
|
1412
1486
|
}
|
1413
|
-
), /* @__PURE__ */
|
1487
|
+
), /* @__PURE__ */ React11.createElement(
|
1414
1488
|
StatsRow,
|
1415
1489
|
{
|
1416
1490
|
show: isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.framesPerSecond),
|
1417
1491
|
label: "FPS",
|
1418
1492
|
value: `${videoTrackStats == null ? void 0 : videoTrackStats.framesPerSecond} ${isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.framesDropped) ? `(${videoTrackStats == null ? void 0 : videoTrackStats.framesDropped} dropped)` : ""}`
|
1419
1493
|
}
|
1420
|
-
), /* @__PURE__ */
|
1494
|
+
), /* @__PURE__ */ React11.createElement(
|
1421
1495
|
StatsRow,
|
1422
1496
|
{
|
1423
1497
|
show: isNotNullish(videoTrackStats == null ? void 0 : videoTrackStats.bitrate),
|
1424
1498
|
label: "Bitrate(V)",
|
1425
1499
|
value: formatBytes(videoTrackStats == null ? void 0 : videoTrackStats.bitrate, "b/s")
|
1426
1500
|
}
|
1427
|
-
)), /* @__PURE__ */
|
1501
|
+
)), /* @__PURE__ */ React11.createElement(
|
1428
1502
|
StatsRow,
|
1429
1503
|
{
|
1430
1504
|
show: isNotNullish(audioTrackStats == null ? void 0 : audioTrackStats.bitrate),
|
1431
1505
|
label: "Bitrate(A)",
|
1432
1506
|
value: formatBytes(audioTrackStats == null ? void 0 : audioTrackStats.bitrate, "b/s")
|
1433
1507
|
}
|
1434
|
-
), /* @__PURE__ */
|
1508
|
+
), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(downlinkScore), label: "Downlink", value: downlinkScore }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(videoTrackStats == null ? void 0 : videoTrackStats.codec), label: "Codec(V)", value: videoTrackStats == null ? void 0 : videoTrackStats.codec }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(audioTrackStats == null ? void 0 : audioTrackStats.codec), label: "Codec(A)", value: audioTrackStats == null ? void 0 : audioTrackStats.codec }), /* @__PURE__ */ React11.createElement(PacketLostAndJitter, { audioTrackStats, videoTrackStats }))));
|
1435
1509
|
}
|
1436
1510
|
var PacketLostAndJitter = ({
|
1437
1511
|
audioTrackStats,
|
@@ -1441,14 +1515,14 @@ var PacketLostAndJitter = ({
|
|
1441
1515
|
const isLocalPeer = (audioTrackStats == null ? void 0 : audioTrackStats.type.includes("outbound")) || (videoTrackStats == null ? void 0 : videoTrackStats.type.includes("outbound"));
|
1442
1516
|
const audioStats = isLocalPeer ? audioTrackStats == null ? void 0 : audioTrackStats.remote : audioTrackStats;
|
1443
1517
|
const videoStats = isLocalPeer ? videoTrackStats == null ? void 0 : videoTrackStats.remote : videoTrackStats;
|
1444
|
-
return /* @__PURE__ */
|
1518
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(TrackPacketsLostRow, { label: "Packet Loss(V)", stats: videoStats }), /* @__PURE__ */ React11.createElement(TrackPacketsLostRow, { label: "Packet Loss(A)", stats: audioStats }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(videoStats == null ? void 0 : videoStats.jitter), label: "Jitter(V)", value: (_a7 = videoStats == null ? void 0 : videoStats.jitter) == null ? void 0 : _a7.toFixed(4) }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(audioStats == null ? void 0 : audioStats.jitter), label: "Jitter(A)", value: (_b7 = audioStats == null ? void 0 : audioStats.jitter) == null ? void 0 : _b7.toFixed(4) }));
|
1445
1519
|
};
|
1446
1520
|
var TrackPacketsLostRow = ({
|
1447
1521
|
stats,
|
1448
1522
|
label
|
1449
1523
|
}) => {
|
1450
1524
|
const packetsLostRate = `${(stats == null ? void 0 : stats.packetsLostRate) ? stats.packetsLostRate.toFixed(2) : 0}/s`;
|
1451
|
-
return /* @__PURE__ */
|
1525
|
+
return /* @__PURE__ */ React11.createElement(
|
1452
1526
|
StatsRow,
|
1453
1527
|
{
|
1454
1528
|
show: isNotNullishAndNot0(stats == null ? void 0 : stats.packetsLost),
|
@@ -1463,10 +1537,10 @@ var RawStatsRow = ({
|
|
1463
1537
|
tooltip = "",
|
1464
1538
|
show = true
|
1465
1539
|
}) => {
|
1466
|
-
const statsLabel = /* @__PURE__ */
|
1467
|
-
return /* @__PURE__ */
|
1540
|
+
const statsLabel = /* @__PURE__ */ React11.createElement(Stats.Label, { css: { fontWeight: !value ? "$semiBold" : "$regular" } }, label);
|
1541
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, show ? /* @__PURE__ */ React11.createElement(Stats.Row, null, tooltip ? /* @__PURE__ */ React11.createElement(Tooltip, { side: "top", title: tooltip }, statsLabel) : statsLabel, value === "" ? /* @__PURE__ */ React11.createElement(Stats.Value, null) : /* @__PURE__ */ React11.createElement(Stats.Value, null, value)) : null);
|
1468
1542
|
};
|
1469
|
-
var StatsRow =
|
1543
|
+
var StatsRow = React11.memo(RawStatsRow);
|
1470
1544
|
function isNotNullishAndNot0(value) {
|
1471
1545
|
return isNotNullish(value) && value !== 0;
|
1472
1546
|
}
|
@@ -1545,7 +1619,7 @@ var RadioGroup = {
|
|
1545
1619
|
};
|
1546
1620
|
|
1547
1621
|
// src/Toast/Toast.tsx
|
1548
|
-
import
|
1622
|
+
import React12 from "react";
|
1549
1623
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
1550
1624
|
import { CrossIcon as CrossIcon2 } from "@100mslive/react-icons";
|
1551
1625
|
var getToastVariant = (base) => {
|
@@ -1636,7 +1710,7 @@ var ToastViewport = styled(ToastPrimitives.Viewport, {
|
|
1636
1710
|
zIndex: 1e3
|
1637
1711
|
});
|
1638
1712
|
var DefaultClose = ({ css: css2 }) => {
|
1639
|
-
return /* @__PURE__ */
|
1713
|
+
return /* @__PURE__ */ React12.createElement(ToastClose, { css: css2, asChild: true }, /* @__PURE__ */ React12.createElement(IconButton, null, /* @__PURE__ */ React12.createElement(CrossIcon2, null)));
|
1640
1714
|
};
|
1641
1715
|
var HMSToast = (_a7) => {
|
1642
1716
|
var _b7 = _a7, {
|
@@ -1654,7 +1728,7 @@ var HMSToast = (_a7) => {
|
|
1654
1728
|
"action",
|
1655
1729
|
"inlineAction"
|
1656
1730
|
]);
|
1657
|
-
return /* @__PURE__ */
|
1731
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(ToastRoot, __spreadValues({}, props), /* @__PURE__ */ React12.createElement(ToastTitle, null, /* @__PURE__ */ React12.createElement(Flex, { align: "center", css: { gap: "$4", flex: "1 1 0", minWidth: 0 } }, icon ? /* @__PURE__ */ React12.createElement(Box, { css: { w: "$10", h: "$10", alignSelf: "start", mt: "$2" } }, icon) : null, /* @__PURE__ */ React12.createElement(Text, { variant: "sub1", css: { c: "inherit", wordBreak: "break-word" } }, title)), isClosable ? /* @__PURE__ */ React12.createElement(DefaultClose, null) : null, !isClosable && inlineAction && action ? /* @__PURE__ */ React12.createElement(ToastAction, { altText: `${title}Action` }, action) : null), description ? /* @__PURE__ */ React12.createElement(ToastDescription, null, /* @__PURE__ */ React12.createElement(Text, { variant: "body1", css: { fontWeight: "$regular", c: "$on_surface_medium" } }, description)) : null, !inlineAction && action ? /* @__PURE__ */ React12.createElement(ToastAction, { altText: `${title}Action`, css: { mt: "$10" } }, action) : null));
|
1658
1732
|
};
|
1659
1733
|
var Toast = {
|
1660
1734
|
Provider: ToastPrimitives.Provider,
|
@@ -1668,7 +1742,7 @@ var Toast = {
|
|
1668
1742
|
};
|
1669
1743
|
|
1670
1744
|
// src/Accordion/Accordion.tsx
|
1671
|
-
import
|
1745
|
+
import React13 from "react";
|
1672
1746
|
import * as BaseAccordion from "@radix-ui/react-accordion";
|
1673
1747
|
import { ChevronUpIcon } from "@100mslive/react-icons";
|
1674
1748
|
var StyledAccordion = styled(BaseAccordion.Root, {});
|
@@ -1720,14 +1794,14 @@ var StyledChevron = styled(ChevronUpIcon, {
|
|
1720
1794
|
});
|
1721
1795
|
var AccordionRoot = StyledAccordion;
|
1722
1796
|
var AccordionItem = StyledItem;
|
1723
|
-
var AccordionHeader =
|
1797
|
+
var AccordionHeader = React13.forwardRef((_a7, forwardedRef) => {
|
1724
1798
|
var _b7 = _a7, { children, iconStyles, css: css2 } = _b7, props = __objRest(_b7, ["children", "iconStyles", "css"]);
|
1725
|
-
return /* @__PURE__ */
|
1799
|
+
return /* @__PURE__ */ React13.createElement(StyledHeader, { css: css2 }, /* @__PURE__ */ React13.createElement(StyledTrigger3, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }), children, /* @__PURE__ */ React13.createElement(StyledChevron, { "aria-hidden": true, css: iconStyles })));
|
1726
1800
|
});
|
1727
|
-
var AccordionContent =
|
1801
|
+
var AccordionContent = React13.forwardRef(
|
1728
1802
|
(_a7, forwardedRef) => {
|
1729
1803
|
var _b7 = _a7, { children, contentStyles } = _b7, props = __objRest(_b7, ["children", "contentStyles"]);
|
1730
|
-
return /* @__PURE__ */
|
1804
|
+
return /* @__PURE__ */ React13.createElement(StyledContent3, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }), /* @__PURE__ */ React13.createElement(Box, { css: contentStyles }, children));
|
1731
1805
|
}
|
1732
1806
|
);
|
1733
1807
|
|
@@ -1921,14 +1995,14 @@ var Tabs = {
|
|
1921
1995
|
};
|
1922
1996
|
|
1923
1997
|
// src/QRCode/QRCode.tsx
|
1924
|
-
import
|
1998
|
+
import React14 from "react";
|
1925
1999
|
import { QRCodeSVG } from "qrcode.react";
|
1926
2000
|
var QRCode = (props) => {
|
1927
|
-
return /* @__PURE__ */
|
2001
|
+
return /* @__PURE__ */ React14.createElement(QRCodeSVG, __spreadValues({ style: { width: "100%", height: "100%" } }, props));
|
1928
2002
|
};
|
1929
2003
|
|
1930
2004
|
// src/Link/Link.tsx
|
1931
|
-
import
|
2005
|
+
import React15 from "react";
|
1932
2006
|
import * as icons from "@100mslive/react-icons";
|
1933
2007
|
var LinkComponent = styled("a", {
|
1934
2008
|
textDecoration: "none",
|
@@ -1954,9 +2028,9 @@ var LinkComponent = styled("a", {
|
|
1954
2028
|
});
|
1955
2029
|
var Link = (_a7) => {
|
1956
2030
|
var _b7 = _a7, { iconSide = "left", icon, color = "primary", children } = _b7, rest = __objRest(_b7, ["iconSide", "icon", "color", "children"]);
|
1957
|
-
const Icon2 = icon ? icons[icon] :
|
1958
|
-
const renderedIcon = icon ? /* @__PURE__ */
|
1959
|
-
return /* @__PURE__ */
|
2031
|
+
const Icon2 = icon ? icons[icon] : React15.Fragment;
|
2032
|
+
const renderedIcon = icon ? /* @__PURE__ */ React15.createElement(Flex, { as: "span" }, /* @__PURE__ */ React15.createElement(Icon2, { height: 13.33, width: 13.33 }), " ") : null;
|
2033
|
+
return /* @__PURE__ */ React15.createElement(LinkComponent, __spreadProps(__spreadValues({}, rest), { color }), iconSide === "left" && renderedIcon, /* @__PURE__ */ React15.createElement(Text, { as: "span", variant: "body2", css: { color: "inherit" } }, children), iconSide === "right" && renderedIcon);
|
1960
2034
|
};
|
1961
2035
|
|
1962
2036
|
// src/Collapsible/Collapsible.tsx
|
@@ -1990,18 +2064,18 @@ var Collapsible = {
|
|
1990
2064
|
};
|
1991
2065
|
|
1992
2066
|
// src/Prebuilt/App.tsx
|
1993
|
-
import
|
2067
|
+
import React58, { Suspense as Suspense2, useEffect as useEffect28, useRef as useRef10 } from "react";
|
1994
2068
|
import { BrowserRouter, MemoryRouter, Navigate, Route, Routes, useParams as useParams5 } from "react-router-dom";
|
1995
2069
|
import {
|
1996
2070
|
HMSReactiveStore,
|
1997
2071
|
HMSRoomProvider,
|
1998
2072
|
selectIsConnectedToRoom as selectIsConnectedToRoom6,
|
1999
|
-
useHMSActions as
|
2000
|
-
useHMSStore as
|
2073
|
+
useHMSActions as useHMSActions18,
|
2074
|
+
useHMSStore as useHMSStore26
|
2001
2075
|
} from "@100mslive/react-sdk";
|
2002
2076
|
|
2003
2077
|
// src/Prebuilt/components/AppData/AppData.jsx
|
2004
|
-
import
|
2078
|
+
import React16, { useEffect as useEffect4 } from "react";
|
2005
2079
|
import {
|
2006
2080
|
HMSRoomState,
|
2007
2081
|
selectAvailableRoleNames,
|
@@ -2087,7 +2161,7 @@ var useUserPreferences = (key, defaultPreference) => {
|
|
2087
2161
|
|
2088
2162
|
// src/Prebuilt/components/AppData/useSidepane.js
|
2089
2163
|
import { useCallback as useCallback3 } from "react";
|
2090
|
-
import { selectAppData, useHMSActions, useHMSStore as useHMSStore2, useHMSVanillaStore } from "@100mslive/react-sdk";
|
2164
|
+
import { selectAppData, useHMSActions, useHMSStore as useHMSStore2, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
|
2091
2165
|
|
2092
2166
|
// src/Prebuilt/common/constants.js
|
2093
2167
|
import { parsedUserAgent } from "@100mslive/react-sdk";
|
@@ -2185,7 +2259,7 @@ var useSidepaneState = () => {
|
|
2185
2259
|
};
|
2186
2260
|
var useSidepaneToggle = (sidepaneType) => {
|
2187
2261
|
const hmsActions = useHMSActions();
|
2188
|
-
const vanillaStore =
|
2262
|
+
const vanillaStore = useHMSVanillaStore2();
|
2189
2263
|
const toggleSidepane = useCallback3(() => {
|
2190
2264
|
const isOpen = vanillaStore.getState(selectAppData(APP_DATA.sidePane)) === sidepaneType;
|
2191
2265
|
hmsActions.setAppData(APP_DATA.sidePane, !isOpen ? sidepaneType : "");
|
@@ -2211,7 +2285,7 @@ import {
|
|
2211
2285
|
selectVideoTrackByPeerID,
|
2212
2286
|
useHMSActions as useHMSActions2,
|
2213
2287
|
useHMSStore as useHMSStore3,
|
2214
|
-
useHMSVanillaStore as
|
2288
|
+
useHMSVanillaStore as useHMSVanillaStore3
|
2215
2289
|
} from "@100mslive/react-sdk";
|
2216
2290
|
var useUISettings = (uiSettingKey) => {
|
2217
2291
|
const uiSettings = useHMSStore3(selectAppDataByPath(APP_DATA.uiSettings, uiSettingKey));
|
@@ -2291,7 +2365,7 @@ var useSetAppDataByKey = (appDataKey) => {
|
|
2291
2365
|
};
|
2292
2366
|
var useSetAppData = ({ key1, key2 }) => {
|
2293
2367
|
const actions = useHMSActions2();
|
2294
|
-
const store =
|
2368
|
+
const store = useHMSVanillaStore3();
|
2295
2369
|
const [, setPreferences] = useUserPreferences(UserPreferencesKeys.UI_SETTINGS);
|
2296
2370
|
const setValue = useCallback4(
|
2297
2371
|
(value) => {
|
@@ -2356,7 +2430,7 @@ var initialAppData = {
|
|
2356
2430
|
[APP_DATA.activeScreensharePeerId]: "",
|
2357
2431
|
[APP_DATA.disableNotificiations]: false
|
2358
2432
|
};
|
2359
|
-
var AppData =
|
2433
|
+
var AppData = React16.memo(({ appDetails, tokenEndpoint }) => {
|
2360
2434
|
const hmsActions = useHMSActions3();
|
2361
2435
|
const isConnected = useHMSStore4(selectIsConnectedToRoom);
|
2362
2436
|
const sidePane = useSidepaneState();
|
@@ -2366,27 +2440,27 @@ var AppData = React15.memo(({ appDetails, tokenEndpoint }) => {
|
|
2366
2440
|
const rolesMap = useHMSStore4(selectRolesMap);
|
2367
2441
|
const localPeerRole = useHMSStore4(selectLocalPeerRoleName);
|
2368
2442
|
const appData = useHMSStore4(selectFullAppData);
|
2369
|
-
|
2443
|
+
useEffect4(() => {
|
2370
2444
|
if (!isConnected && sidePane && sidePane !== SIDE_PANE_OPTIONS.PARTICIPANTS) {
|
2371
2445
|
resetSidePane();
|
2372
2446
|
}
|
2373
2447
|
}, [isConnected, sidePane, resetSidePane]);
|
2374
|
-
|
2448
|
+
useEffect4(() => {
|
2375
2449
|
hmsActions.initAppData(__spreadValues(__spreadValues({}, initialAppData), appData));
|
2376
2450
|
hmsActions.setFrameworkInfo({
|
2377
2451
|
type: "react-web",
|
2378
2452
|
isPrebuilt: true,
|
2379
|
-
version:
|
2453
|
+
version: React16.version
|
2380
2454
|
});
|
2381
2455
|
}, [hmsActions]);
|
2382
|
-
|
2456
|
+
useEffect4(() => {
|
2383
2457
|
const uiSettings = preferences || {};
|
2384
2458
|
const updatedSettings = __spreadProps(__spreadValues({}, uiSettings), {
|
2385
2459
|
[UI_SETTINGS.uiViewMode]: uiSettings.uiViewMode || UI_MODE_GRID
|
2386
2460
|
});
|
2387
2461
|
hmsActions.setAppData(APP_DATA.uiSettings, updatedSettings, true);
|
2388
2462
|
}, [preferences, hmsActions]);
|
2389
|
-
|
2463
|
+
useEffect4(() => {
|
2390
2464
|
const appData2 = {
|
2391
2465
|
[APP_DATA.tokenEndpoint]: tokenEndpoint,
|
2392
2466
|
[APP_DATA.appConfig]: getAppDetails(appDetails)
|
@@ -2395,19 +2469,19 @@ var AppData = React15.memo(({ appDetails, tokenEndpoint }) => {
|
|
2395
2469
|
hmsActions.setAppData([key], appData2[key]);
|
2396
2470
|
}
|
2397
2471
|
}, [appDetails, tokenEndpoint, hmsActions]);
|
2398
|
-
|
2472
|
+
useEffect4(() => {
|
2399
2473
|
if (!preferences.subscribedNotifications) {
|
2400
2474
|
return;
|
2401
2475
|
}
|
2402
2476
|
hmsActions.setAppData(APP_DATA.subscribedNotifications, preferences.subscribedNotifications, true);
|
2403
2477
|
}, [preferences.subscribedNotifications, hmsActions]);
|
2404
|
-
|
2478
|
+
useEffect4(() => {
|
2405
2479
|
if (localPeerRole) {
|
2406
2480
|
const config2 = normalizeAppPolicyConfig(roleNames, rolesMap);
|
2407
2481
|
hmsActions.setAppData(APP_DATA.appLayout, config2[localPeerRole]);
|
2408
2482
|
}
|
2409
2483
|
}, [roleNames, rolesMap, localPeerRole, hmsActions]);
|
2410
|
-
return /* @__PURE__ */
|
2484
|
+
return /* @__PURE__ */ React16.createElement(ResetStreamingStart, null);
|
2411
2485
|
});
|
2412
2486
|
var ResetStreamingStart = () => {
|
2413
2487
|
const { isHLSRunning, isRTMPRunning, isBrowserRecordingOn } = useRecordingStreaming();
|
@@ -2419,19 +2493,19 @@ var ResetStreamingStart = () => {
|
|
2419
2493
|
const [rtmpStarted, setRTMPStarted] = useSetAppDataByKey(APP_DATA.rtmpStarted);
|
2420
2494
|
const toggleStreaming = useSidepaneToggle(SIDE_PANE_OPTIONS.STREAMING);
|
2421
2495
|
const isStreamingOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.STREAMING);
|
2422
|
-
|
2496
|
+
useEffect4(() => {
|
2423
2497
|
if (isBrowserRecordingOn && recordingStarted) {
|
2424
2498
|
setRecordingStarted(false);
|
2425
2499
|
}
|
2426
2500
|
}, [isBrowserRecordingOn, recordingStarted, setRecordingStarted]);
|
2427
|
-
|
2501
|
+
useEffect4(() => {
|
2428
2502
|
if (roomState === HMSRoomState.Disconnected) {
|
2429
2503
|
setHLSStarted(false);
|
2430
2504
|
setRecordingStarted(false);
|
2431
2505
|
setRTMPStarted(false);
|
2432
2506
|
}
|
2433
2507
|
}, [roomState, setHLSStarted, setRTMPStarted, setRecordingStarted]);
|
2434
|
-
|
2508
|
+
useEffect4(() => {
|
2435
2509
|
if (isHLSRunning || hlsError) {
|
2436
2510
|
if (hlsStarted) {
|
2437
2511
|
setHLSStarted(false);
|
@@ -2441,7 +2515,7 @@ var ResetStreamingStart = () => {
|
|
2441
2515
|
}
|
2442
2516
|
}
|
2443
2517
|
}, [isHLSRunning, hlsStarted, setHLSStarted, hlsError, isStreamingOpen, toggleStreaming]);
|
2444
|
-
|
2518
|
+
useEffect4(() => {
|
2445
2519
|
if (isRTMPRunning || rtmpError || isBrowserRecordingOn) {
|
2446
2520
|
if (rtmpStarted) {
|
2447
2521
|
setRTMPStarted(false);
|
@@ -2455,12 +2529,12 @@ var ResetStreamingStart = () => {
|
|
2455
2529
|
};
|
2456
2530
|
|
2457
2531
|
// src/Prebuilt/components/AuthToken.jsx
|
2458
|
-
import
|
2532
|
+
import React20, { useEffect as useEffect5, useState as useState4 } from "react";
|
2459
2533
|
import { useHMSActions as useHMSActions4 } from "@100mslive/react-sdk";
|
2460
2534
|
|
2461
2535
|
// src/Prebuilt/AppContext.tsx
|
2462
|
-
import
|
2463
|
-
var HMSPrebuiltContext =
|
2536
|
+
import React17, { useContext } from "react";
|
2537
|
+
var HMSPrebuiltContext = React17.createContext({
|
2464
2538
|
roomCode: "",
|
2465
2539
|
userName: "",
|
2466
2540
|
userId: "",
|
@@ -2477,15 +2551,21 @@ var useHMSPrebuiltContext = () => {
|
|
2477
2551
|
};
|
2478
2552
|
|
2479
2553
|
// src/Prebuilt/primitives/DialogContent.jsx
|
2480
|
-
import
|
2554
|
+
import React19, { useRef as useRef4 } from "react";
|
2481
2555
|
import { CheckIcon, CloudUploadIcon, CrossIcon as CrossIcon3 } from "@100mslive/react-icons";
|
2556
|
+
|
2557
|
+
// src/Prebuilt/components/PrebuiltDialogPortal.tsx
|
2558
|
+
import React18 from "react";
|
2559
|
+
var PrebuiltDialogPortal = ({ children }) => /* @__PURE__ */ React18.createElement(Dialog.Portal, { container: document.getElementById("prebuilt-container") }, children);
|
2560
|
+
|
2561
|
+
// src/Prebuilt/primitives/DialogContent.jsx
|
2482
2562
|
var DialogContent = (_a7) => {
|
2483
2563
|
var _b7 = _a7, { Icon: Icon2, title, closeable = true, children, css: css2, iconCSS = {} } = _b7, props = __objRest(_b7, ["Icon", "title", "closeable", "children", "css", "iconCSS"]);
|
2484
|
-
return /* @__PURE__ */
|
2564
|
+
return /* @__PURE__ */ React19.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React19.createElement(Dialog.Overlay, null), /* @__PURE__ */ React19.createElement(Dialog.Content, __spreadValues({ css: __spreadValues({ width: "min(600px, 100%)" }, css2) }, props), /* @__PURE__ */ React19.createElement(Dialog.Title, null, /* @__PURE__ */ React19.createElement(Flex, { justify: "between" }, /* @__PURE__ */ React19.createElement(Flex, { align: "center", css: { mb: "$1" } }, Icon2 ? /* @__PURE__ */ React19.createElement(Box, { css: __spreadValues({ mr: "$2", color: "$on_primary_high" }, iconCSS) }, /* @__PURE__ */ React19.createElement(Icon2, null)) : null, /* @__PURE__ */ React19.createElement(Text, { variant: "h6", inline: true }, title)), closeable && /* @__PURE__ */ React19.createElement(Dialog.DefaultClose, { "data-testid": "dialoge_cross_icon" }))), /* @__PURE__ */ React19.createElement(HorizontalDivider, { css: { mt: "0.8rem" } }), /* @__PURE__ */ React19.createElement(Box, null, children)));
|
2485
2565
|
};
|
2486
2566
|
var ErrorDialog = (_a7) => {
|
2487
2567
|
var _b7 = _a7, { open = true, onOpenChange, title, children } = _b7, props = __objRest(_b7, ["open", "onOpenChange", "title", "children"]);
|
2488
|
-
return /* @__PURE__ */
|
2568
|
+
return /* @__PURE__ */ React19.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React19.createElement(
|
2489
2569
|
DialogContent,
|
2490
2570
|
__spreadValues({
|
2491
2571
|
Icon: CrossIcon3,
|
@@ -2496,10 +2576,10 @@ var ErrorDialog = (_a7) => {
|
|
2496
2576
|
closeable: false,
|
2497
2577
|
iconCSS: { color: "$alert_error_default" }
|
2498
2578
|
}, props),
|
2499
|
-
/* @__PURE__ */
|
2579
|
+
/* @__PURE__ */ React19.createElement(Box, { css: { mt: "$lg" } }, children)
|
2500
2580
|
));
|
2501
2581
|
};
|
2502
|
-
var RequestDialog = ({ open = true, onOpenChange, title, body, actionText = "Accept", onAction, Icon: Icon2 }) => /* @__PURE__ */
|
2582
|
+
var RequestDialog = ({ open = true, onOpenChange, title, body, actionText = "Accept", onAction, Icon: Icon2 }) => /* @__PURE__ */ React19.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React19.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React19.createElement(Dialog.Overlay, null), /* @__PURE__ */ React19.createElement(Dialog.Content, { css: { width: "min(400px,80%)", p: "$10" } }, /* @__PURE__ */ React19.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md" } }, Icon2 ? Icon2 : null, /* @__PURE__ */ React19.createElement(Text, { variant: "h6" }, title)), typeof body === "string" ? /* @__PURE__ */ React19.createElement(
|
2503
2583
|
Text,
|
2504
2584
|
{
|
2505
2585
|
variant: "md",
|
@@ -2511,7 +2591,7 @@ var RequestDialog = ({ open = true, onOpenChange, title, body, actionText = "Acc
|
|
2511
2591
|
}
|
2512
2592
|
},
|
2513
2593
|
body
|
2514
|
-
) : /* @__PURE__ */
|
2594
|
+
) : /* @__PURE__ */ React19.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React19.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md" } }, /* @__PURE__ */ React19.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React19.createElement(Dialog.Close, { css: { width: "100%" } }, /* @__PURE__ */ React19.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%" } }, "Cancel"))), /* @__PURE__ */ React19.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React19.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction }, actionText))))));
|
2515
2595
|
var DialogRow = ({ children, breakSm = false, css: css2, justify = "between" }) => {
|
2516
2596
|
let finalCSS = {
|
2517
2597
|
margin: "$10 0",
|
@@ -2526,7 +2606,7 @@ var DialogRow = ({ children, breakSm = false, css: css2, justify = "between" })
|
|
2526
2606
|
if (css2) {
|
2527
2607
|
finalCSS = Object.assign(finalCSS, css2);
|
2528
2608
|
}
|
2529
|
-
return /* @__PURE__ */
|
2609
|
+
return /* @__PURE__ */ React19.createElement(Flex, { align: "center", justify, css: finalCSS }, children);
|
2530
2610
|
};
|
2531
2611
|
var DialogCol = (_a7) => {
|
2532
2612
|
var _b7 = _a7, { children, breakSm = false, css: css2, align = "center", justify = "between" } = _b7, props = __objRest(_b7, ["children", "breakSm", "css", "align", "justify"]);
|
@@ -2542,20 +2622,20 @@ var DialogCol = (_a7) => {
|
|
2542
2622
|
if (css2) {
|
2543
2623
|
finalCSS = Object.assign(finalCSS, css2);
|
2544
2624
|
}
|
2545
|
-
return /* @__PURE__ */
|
2625
|
+
return /* @__PURE__ */ React19.createElement(Flex, __spreadValues({ direction: "column", align, justify, css: finalCSS }, props), children);
|
2546
2626
|
};
|
2547
2627
|
var DialogSelect = (_a7) => {
|
2548
2628
|
var _b7 = _a7, { title, options, keyField, labelField, selected, onChange } = _b7, props = __objRest(_b7, ["title", "options", "keyField", "labelField", "selected", "onChange"]);
|
2549
|
-
return /* @__PURE__ */
|
2629
|
+
return /* @__PURE__ */ React19.createElement(DialogRow, { breakSm: true }, /* @__PURE__ */ React19.createElement(Label3, null, title), /* @__PURE__ */ React19.createElement(Select.Root, __spreadValues({ "data-testid": `dialog_select_${title}`, css: { width: "70%", "@sm": { width: "100%" } } }, props), /* @__PURE__ */ React19.createElement(Select.DefaultDownIcon, null), /* @__PURE__ */ React19.createElement(Select.Select, { onChange: (e) => onChange(e.target.value), value: selected, css: { width: "100%" } }, options.map((option) => {
|
2550
2630
|
const id = keyField ? option[keyField] : option;
|
2551
2631
|
const label = labelField ? option[labelField] : option;
|
2552
|
-
return /* @__PURE__ */
|
2632
|
+
return /* @__PURE__ */ React19.createElement("option", { value: id, key: id }, label);
|
2553
2633
|
}))));
|
2554
2634
|
};
|
2555
2635
|
var DialogInputFile = (_a7) => {
|
2556
2636
|
var _b7 = _a7, { value, onChange, placeholder, disabled, type } = _b7, props = __objRest(_b7, ["value", "onChange", "placeholder", "disabled", "type"]);
|
2557
|
-
const inputRef =
|
2558
|
-
return /* @__PURE__ */
|
2637
|
+
const inputRef = useRef4();
|
2638
|
+
return /* @__PURE__ */ React19.createElement(
|
2559
2639
|
DialogCol,
|
2560
2640
|
{
|
2561
2641
|
breakSm: true,
|
@@ -2576,7 +2656,7 @@ var DialogInputFile = (_a7) => {
|
|
2576
2656
|
},
|
2577
2657
|
gap: "8"
|
2578
2658
|
},
|
2579
|
-
/* @__PURE__ */
|
2659
|
+
/* @__PURE__ */ React19.createElement(
|
2580
2660
|
IconButton,
|
2581
2661
|
{
|
2582
2662
|
variant: "standard",
|
@@ -2590,7 +2670,7 @@ var DialogInputFile = (_a7) => {
|
|
2590
2670
|
}
|
2591
2671
|
}
|
2592
2672
|
},
|
2593
|
-
/* @__PURE__ */
|
2673
|
+
/* @__PURE__ */ React19.createElement(
|
2594
2674
|
CloudUploadIcon,
|
2595
2675
|
{
|
2596
2676
|
style: {
|
@@ -2600,7 +2680,7 @@ var DialogInputFile = (_a7) => {
|
|
2600
2680
|
}
|
2601
2681
|
)
|
2602
2682
|
),
|
2603
|
-
/* @__PURE__ */
|
2683
|
+
/* @__PURE__ */ React19.createElement(Flex, { direction: "row" }, /* @__PURE__ */ React19.createElement(
|
2604
2684
|
Input,
|
2605
2685
|
__spreadValues({
|
2606
2686
|
ref: inputRef,
|
@@ -2612,7 +2692,7 @@ var DialogInputFile = (_a7) => {
|
|
2612
2692
|
type,
|
2613
2693
|
hidden: true
|
2614
2694
|
}, props)
|
2615
|
-
), /* @__PURE__ */
|
2695
|
+
), /* @__PURE__ */ React19.createElement(
|
2616
2696
|
IconButton,
|
2617
2697
|
{
|
2618
2698
|
variant: "standard",
|
@@ -2626,20 +2706,20 @@ var DialogInputFile = (_a7) => {
|
|
2626
2706
|
}
|
2627
2707
|
}
|
2628
2708
|
},
|
2629
|
-
/* @__PURE__ */
|
2709
|
+
/* @__PURE__ */ React19.createElement(Text, { variant: "md" }, placeholder)
|
2630
2710
|
))
|
2631
2711
|
);
|
2632
2712
|
};
|
2633
2713
|
|
2634
2714
|
// src/Prebuilt/components/AuthToken.jsx
|
2635
|
-
var AuthToken =
|
2715
|
+
var AuthToken = React20.memo(({ authTokenByRoomCodeEndpoint, defaultAuthToken }) => {
|
2636
2716
|
const hmsActions = useHMSActions4();
|
2637
2717
|
const tokenEndpoint = useTokenEndpoint();
|
2638
2718
|
const { roomCode, userId } = useHMSPrebuiltContext();
|
2639
2719
|
const [error, setError] = useState4({ title: "", body: "" });
|
2640
2720
|
let authToken = defaultAuthToken;
|
2641
2721
|
const [, setAuthTokenInAppData] = useSetAppDataByKey(APP_DATA.authToken);
|
2642
|
-
|
2722
|
+
useEffect5(() => {
|
2643
2723
|
if (authToken) {
|
2644
2724
|
setAuthTokenInAppData(authToken);
|
2645
2725
|
return;
|
@@ -2650,7 +2730,7 @@ var AuthToken = React18.memo(({ authTokenByRoomCodeEndpoint, defaultAuthToken })
|
|
2650
2730
|
hmsActions.getAuthTokenByRoomCode({ roomCode, userId }, { endpoint: authTokenByRoomCodeEndpoint }).then((token) => setAuthTokenInAppData(token)).catch((error2) => setError(convertError(error2)));
|
2651
2731
|
}, [hmsActions, tokenEndpoint, authToken, authTokenByRoomCodeEndpoint, setAuthTokenInAppData, roomCode, userId]);
|
2652
2732
|
if (error.title) {
|
2653
|
-
return /* @__PURE__ */
|
2733
|
+
return /* @__PURE__ */ React20.createElement(ErrorDialog, { title: error.title }, error.body);
|
2654
2734
|
}
|
2655
2735
|
return null;
|
2656
2736
|
});
|
@@ -2694,11 +2774,11 @@ var convertError = (error) => {
|
|
2694
2774
|
var Link2 = styled("a", {
|
2695
2775
|
color: "#2f80e1"
|
2696
2776
|
});
|
2697
|
-
var ErrorWithSupportLink = (errorMessage) => /* @__PURE__ */
|
2777
|
+
var ErrorWithSupportLink = (errorMessage) => /* @__PURE__ */ React20.createElement("div", null, errorMessage, " If you think this is a mistake on our side, please create", " ", /* @__PURE__ */ React20.createElement(Link2, { target: "_blank", href: "https://github.com/100mslive/100ms-web/issues", rel: "noreferrer" }, "an issue"), " ", "or reach out over", " ", /* @__PURE__ */ React20.createElement(Link2, { target: "_blank", href: "https://discord.com/invite/kGdmszyzq2", rel: "noreferrer" }, "Discord"), ".");
|
2698
2778
|
var AuthToken_default = AuthToken;
|
2699
2779
|
|
2700
2780
|
// src/Prebuilt/components/ErrorBoundary.jsx
|
2701
|
-
import
|
2781
|
+
import React21, { Component } from "react";
|
2702
2782
|
import { CopyIcon as CopyIcon2 } from "@100mslive/react-icons";
|
2703
2783
|
var ErrorBoundary = class extends Component {
|
2704
2784
|
constructor(props) {
|
@@ -2714,7 +2794,7 @@ var ErrorBoundary = class extends Component {
|
|
2714
2794
|
}
|
2715
2795
|
render() {
|
2716
2796
|
if (this.state.errorInfo) {
|
2717
|
-
return /* @__PURE__ */
|
2797
|
+
return /* @__PURE__ */ React21.createElement(
|
2718
2798
|
Flex,
|
2719
2799
|
{
|
2720
2800
|
align: "center",
|
@@ -2727,7 +2807,7 @@ var ErrorBoundary = class extends Component {
|
|
2727
2807
|
backgroundColor: "$background_default"
|
2728
2808
|
}
|
2729
2809
|
},
|
2730
|
-
/* @__PURE__ */
|
2810
|
+
/* @__PURE__ */ React21.createElement(Box, { css: { position: "relative", overflow: "hidden", r: "$3", height: "100%", width: "100%" } }, /* @__PURE__ */ React21.createElement(
|
2731
2811
|
Flex,
|
2732
2812
|
{
|
2733
2813
|
direction: "column",
|
@@ -2738,8 +2818,8 @@ var ErrorBoundary = class extends Component {
|
|
2738
2818
|
left: 0
|
2739
2819
|
}
|
2740
2820
|
},
|
2741
|
-
/* @__PURE__ */
|
2742
|
-
/* @__PURE__ */
|
2821
|
+
/* @__PURE__ */ React21.createElement("div", { style: { margin: "1.5rem", width: "100%" } }, /* @__PURE__ */ React21.createElement(Text, null, "Something went wrong"), /* @__PURE__ */ React21.createElement(Text, null, "Message: $", this.state.error), /* @__PURE__ */ React21.createElement("br", null), ErrorWithSupportLink(`Please reload to see if it works.`)),
|
2822
|
+
/* @__PURE__ */ React21.createElement(Flex, null, /* @__PURE__ */ React21.createElement(Tooltip, { title: "Reload page" }, /* @__PURE__ */ React21.createElement(
|
2743
2823
|
Button,
|
2744
2824
|
{
|
2745
2825
|
onClick: () => {
|
@@ -2749,7 +2829,7 @@ var ErrorBoundary = class extends Component {
|
|
2749
2829
|
"data-testid": "join_again_btn"
|
2750
2830
|
},
|
2751
2831
|
"Reload"
|
2752
|
-
)), /* @__PURE__ */
|
2832
|
+
)), /* @__PURE__ */ React21.createElement(Tooltip, { title: "Copy error details to clipboard" }, /* @__PURE__ */ React21.createElement(
|
2753
2833
|
Button,
|
2754
2834
|
{
|
2755
2835
|
onClick: () => {
|
@@ -2765,11 +2845,11 @@ var ErrorBoundary = class extends Component {
|
|
2765
2845
|
css: { mx: "$8" },
|
2766
2846
|
"data-testid": "join_again_btn"
|
2767
2847
|
},
|
2768
|
-
/* @__PURE__ */
|
2848
|
+
/* @__PURE__ */ React21.createElement(CopyIcon2, null),
|
2769
2849
|
" ",
|
2770
2850
|
this.state.isErrorCopied ? "Copied" : "Copy Details"
|
2771
2851
|
))),
|
2772
|
-
/* @__PURE__ */
|
2852
|
+
/* @__PURE__ */ React21.createElement("details", { style: { whiteSpace: "pre-wrap", margin: "1.5rem" } }, /* @__PURE__ */ React21.createElement(Text, null, this.state.error && this.state.error.toString()), /* @__PURE__ */ React21.createElement("br", null), /* @__PURE__ */ React21.createElement(Text, null, JSON.stringify(this.state.errorInfo)))
|
2773
2853
|
))
|
2774
2854
|
);
|
2775
2855
|
}
|
@@ -2778,15 +2858,15 @@ var ErrorBoundary = class extends Component {
|
|
2778
2858
|
};
|
2779
2859
|
|
2780
2860
|
// src/Prebuilt/components/FullPageProgress.jsx
|
2781
|
-
import
|
2782
|
-
var FullPageProgress = ({ loaderColor = "$primary_default", text = "", css: css2 = {} }) => /* @__PURE__ */
|
2861
|
+
import React22 from "react";
|
2862
|
+
var FullPageProgress = ({ loaderColor = "$primary_default", text = "", css: css2 = {} }) => /* @__PURE__ */ React22.createElement(Flex, { direction: "column", justify: "center", align: "center", css: __spreadValues({ size: "100%", color: loaderColor }, css2) }, /* @__PURE__ */ React22.createElement(Loading, { color: "currentColor", size: 100 }), text ? /* @__PURE__ */ React22.createElement(Text, { css: { mt: "$10", color: "$on_surface_high" } }, text) : null);
|
2783
2863
|
var FullPageProgress_default = FullPageProgress;
|
2784
2864
|
|
2785
2865
|
// src/Prebuilt/components/init/Init.jsx
|
2786
|
-
import
|
2866
|
+
import React23, { useEffect as useEffect7 } from "react";
|
2787
2867
|
|
2788
2868
|
// src/Prebuilt/services/FeatureFlags.jsx
|
2789
|
-
import { useEffect as
|
2869
|
+
import { useEffect as useEffect6 } from "react";
|
2790
2870
|
import { selectRoomID, useHMSStore as useHMSStore5 } from "@100mslive/react-sdk";
|
2791
2871
|
var FeatureFlags = class {
|
2792
2872
|
static init(roomId) {
|
@@ -2813,7 +2893,7 @@ __publicField(FeatureFlags, "enableStatsForNerds", define_process_env_default.RE
|
|
2813
2893
|
__publicField(FeatureFlags, "enableWhiteboard", define_process_env_default.REACT_APP_ENABLE_WHITEBOARD && define_process_env_default.REACT_APP_PUSHER_APP_KEY && define_process_env_default.REACT_APP_PUSHER_AUTHENDPOINT);
|
2814
2894
|
function FeatureFlagsInit() {
|
2815
2895
|
const roomId = useHMSStore5(selectRoomID);
|
2816
|
-
|
2896
|
+
useEffect6(() => {
|
2817
2897
|
if (roomId) {
|
2818
2898
|
FeatureFlags.init(roomId);
|
2819
2899
|
}
|
@@ -2824,10 +2904,10 @@ function FeatureFlagsInit() {
|
|
2824
2904
|
// src/Prebuilt/components/init/Init.jsx
|
2825
2905
|
var Init = () => {
|
2826
2906
|
const { toggleTheme } = useTheme();
|
2827
|
-
|
2907
|
+
useEffect7(() => {
|
2828
2908
|
window.toggleUiTheme = toggleTheme;
|
2829
2909
|
}, [toggleTheme]);
|
2830
|
-
|
2910
|
+
useEffect7(() => {
|
2831
2911
|
function resetHeight() {
|
2832
2912
|
var _a7;
|
2833
2913
|
document.body.style.height = `${((_a7 = window.visualViewport) == null ? void 0 : _a7.height) || window.innerHeight}px`;
|
@@ -2838,17 +2918,17 @@ var Init = () => {
|
|
2838
2918
|
window.removeEventListener("resize", resetHeight);
|
2839
2919
|
};
|
2840
2920
|
}, []);
|
2841
|
-
return /* @__PURE__ */
|
2921
|
+
return /* @__PURE__ */ React23.createElement(FeatureFlagsInit, null);
|
2842
2922
|
};
|
2843
2923
|
|
2844
2924
|
// src/Prebuilt/components/Input/KeyboardInputManager.js
|
2845
|
-
import { useEffect as
|
2925
|
+
import { useEffect as useEffect8 } from "react";
|
2846
2926
|
import {
|
2847
2927
|
selectAppData as selectAppData3,
|
2848
2928
|
selectIsLocalAudioEnabled,
|
2849
2929
|
selectIsLocalVideoEnabled,
|
2850
2930
|
useHMSActions as useHMSActions5,
|
2851
|
-
useHMSVanillaStore as
|
2931
|
+
useHMSVanillaStore as useHMSVanillaStore4
|
2852
2932
|
} from "@100mslive/react-sdk";
|
2853
2933
|
var isEvenListenersAttached = false;
|
2854
2934
|
var _actions, _store, _toggleAudio, _toggleVideo, _hideSidepane, _toggleStatsForNerds, _toggleHlsStats, _keyDownHandler, _bind, _unbind;
|
@@ -2935,9 +3015,9 @@ _keyDownHandler = new WeakMap();
|
|
2935
3015
|
_bind = new WeakMap();
|
2936
3016
|
_unbind = new WeakMap();
|
2937
3017
|
var KeyboardHandler = () => {
|
2938
|
-
const store =
|
3018
|
+
const store = useHMSVanillaStore4();
|
2939
3019
|
const actions = useHMSActions5();
|
2940
|
-
|
3020
|
+
useEffect8(() => {
|
2941
3021
|
const keyboardManager = new KeyboardInputManager(store, actions);
|
2942
3022
|
keyboardManager.bindAllShortcuts();
|
2943
3023
|
return keyboardManager.unbindAllShortcuts;
|
@@ -2946,7 +3026,7 @@ var KeyboardHandler = () => {
|
|
2946
3026
|
};
|
2947
3027
|
|
2948
3028
|
// src/Prebuilt/components/Notifications/Notifications.jsx
|
2949
|
-
import
|
3029
|
+
import React32, { useCallback as useCallback8, useEffect as useEffect17 } from "react";
|
2950
3030
|
import { useNavigate as useNavigate2, useParams as useParams2 } from "react-router-dom";
|
2951
3031
|
import {
|
2952
3032
|
HMSNotificationTypes as HMSNotificationTypes7,
|
@@ -2956,15 +3036,15 @@ import {
|
|
2956
3036
|
useCustomEvent,
|
2957
3037
|
useHMSNotifications as useHMSNotifications7,
|
2958
3038
|
useHMSStore as useHMSStore7,
|
2959
|
-
useHMSVanillaStore as
|
3039
|
+
useHMSVanillaStore as useHMSVanillaStore5
|
2960
3040
|
} from "@100mslive/react-sdk";
|
2961
3041
|
|
2962
3042
|
// src/Prebuilt/provider/roomLayoutProvider/index.tsx
|
2963
|
-
import
|
3043
|
+
import React24 from "react";
|
2964
3044
|
import merge from "lodash.merge";
|
2965
3045
|
|
2966
3046
|
// src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts
|
2967
|
-
import { useCallback as useCallback5, useEffect as
|
3047
|
+
import { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef5, useState as useState5 } from "react";
|
2968
3048
|
|
2969
3049
|
// src/Prebuilt/provider/roomLayoutProvider/constants/index.ts
|
2970
3050
|
import { JoinForm_JoinBtnType } from "@100mslive/types-prebuilt/elements/join_form";
|
@@ -3033,8 +3113,8 @@ var useFetchRoomLayout = ({
|
|
3033
3113
|
authToken = ""
|
3034
3114
|
}) => {
|
3035
3115
|
const [layout, setLayout] = useState5(void 0);
|
3036
|
-
const layoutResp =
|
3037
|
-
const isFetchInProgress =
|
3116
|
+
const layoutResp = useRef5();
|
3117
|
+
const isFetchInProgress = useRef5(false);
|
3038
3118
|
const updateRoomLayoutForRole = useCallback5((role) => {
|
3039
3119
|
var _a7;
|
3040
3120
|
if (!layoutResp.current) {
|
@@ -3045,7 +3125,7 @@ var useFetchRoomLayout = ({
|
|
3045
3125
|
setLayout(layout2);
|
3046
3126
|
}
|
3047
3127
|
}, []);
|
3048
|
-
|
3128
|
+
useEffect9(() => {
|
3049
3129
|
(() => __async(void 0, null, function* () {
|
3050
3130
|
var _a7, _b7;
|
3051
3131
|
if (isFetchInProgress.current || !authToken) {
|
@@ -3081,7 +3161,7 @@ var useFetchRoomLayout = ({
|
|
3081
3161
|
};
|
3082
3162
|
|
3083
3163
|
// src/Prebuilt/provider/roomLayoutProvider/index.tsx
|
3084
|
-
var RoomLayoutContext =
|
3164
|
+
var RoomLayoutContext = React24.createContext(void 0);
|
3085
3165
|
var RoomLayoutProvider = ({
|
3086
3166
|
children,
|
3087
3167
|
roomLayoutEndpoint,
|
@@ -3090,19 +3170,19 @@ var RoomLayoutProvider = ({
|
|
3090
3170
|
const authToken = useAuthToken();
|
3091
3171
|
const { layout, updateRoomLayoutForRole } = useFetchRoomLayout({ authToken, endpoint: roomLayoutEndpoint });
|
3092
3172
|
const mergedLayout = authToken && layout ? merge(layout, overrideLayout) : layout;
|
3093
|
-
return /* @__PURE__ */
|
3173
|
+
return /* @__PURE__ */ React24.createElement(RoomLayoutContext.Provider, { value: { layout: mergedLayout, updateRoomLayoutForRole } }, children);
|
3094
3174
|
};
|
3095
3175
|
var useRoomLayout = () => {
|
3096
3176
|
var _a7;
|
3097
|
-
return (_a7 =
|
3177
|
+
return (_a7 = React24.useContext(RoomLayoutContext)) == null ? void 0 : _a7.layout;
|
3098
3178
|
};
|
3099
3179
|
var useUpdateRoomLayout = () => {
|
3100
3180
|
var _a7;
|
3101
|
-
return (_a7 =
|
3181
|
+
return (_a7 = React24.useContext(RoomLayoutContext)) == null ? void 0 : _a7.updateRoomLayoutForRole;
|
3102
3182
|
};
|
3103
3183
|
|
3104
3184
|
// src/Prebuilt/components/Toast/ToastConfig.jsx
|
3105
|
-
import
|
3185
|
+
import React25, { useCallback as useCallback6 } from "react";
|
3106
3186
|
import { selectPeerByID, useHMSActions as useHMSActions6, useHMSStore as useHMSStore6 } from "@100mslive/react-sdk";
|
3107
3187
|
import {
|
3108
3188
|
ChatUnreadIcon,
|
@@ -3112,15 +3192,15 @@ import {
|
|
3112
3192
|
PeopleRemoveIcon,
|
3113
3193
|
PoorConnectivityIcon
|
3114
3194
|
} from "@100mslive/react-icons";
|
3115
|
-
var ChatAction =
|
3195
|
+
var ChatAction = React25.forwardRef((_, ref) => {
|
3116
3196
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
3117
3197
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
3118
3198
|
if (isChatOpen) {
|
3119
3199
|
return null;
|
3120
3200
|
}
|
3121
|
-
return /* @__PURE__ */
|
3201
|
+
return /* @__PURE__ */ React25.createElement(Button, { outlined: true, as: "div", variant: "standard", css: { w: "max-content" }, onClick: toggleChat, ref }, "Open Chat");
|
3122
3202
|
});
|
3123
|
-
var HandRaiseAction =
|
3203
|
+
var HandRaiseAction = React25.forwardRef(({ id = "", isSingleHandRaise = true }, ref) => {
|
3124
3204
|
var _a7, _b7, _c;
|
3125
3205
|
const hmsActions = useHMSActions6();
|
3126
3206
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
@@ -3142,7 +3222,7 @@ var HandRaiseAction = React23.forwardRef(({ id = "", isSingleHandRaise = true },
|
|
3142
3222
|
if (isSingleHandRaise && (!peer || !off_stage_roles.includes(peer.roleName))) {
|
3143
3223
|
return null;
|
3144
3224
|
}
|
3145
|
-
return /* @__PURE__ */
|
3225
|
+
return /* @__PURE__ */ React25.createElement(Button, { outlined: true, as: "div", variant: "standard", css: { w: "max-content" }, onClick: onClickHandler, ref }, isSingleHandRaise ? bring_to_stage_label : "View");
|
3146
3226
|
});
|
3147
3227
|
var ToastConfig = {
|
3148
3228
|
PEER_LIST: {
|
@@ -3151,18 +3231,18 @@ var ToastConfig = {
|
|
3151
3231
|
if (notification.data.length === 1) {
|
3152
3232
|
return {
|
3153
3233
|
title: `${(_a7 = notification.data[0]) == null ? void 0 : _a7.name} joined`,
|
3154
|
-
icon: /* @__PURE__ */
|
3234
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3155
3235
|
};
|
3156
3236
|
}
|
3157
3237
|
return {
|
3158
3238
|
title: `${(_b7 = notification.data[notification.data.length - 1]) == null ? void 0 : _b7.name} and ${notification.data.length - 1} others joined`,
|
3159
|
-
icon: /* @__PURE__ */
|
3239
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3160
3240
|
};
|
3161
3241
|
},
|
3162
3242
|
multiple: (notifications) => {
|
3163
3243
|
return {
|
3164
3244
|
title: `${notifications[0].data.name} and ${notifications.length - 1} others joined`,
|
3165
|
-
icon: /* @__PURE__ */
|
3245
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3166
3246
|
};
|
3167
3247
|
}
|
3168
3248
|
},
|
@@ -3171,13 +3251,13 @@ var ToastConfig = {
|
|
3171
3251
|
var _a7;
|
3172
3252
|
return {
|
3173
3253
|
title: `${(_a7 = notification.data) == null ? void 0 : _a7.name} joined`,
|
3174
|
-
icon: /* @__PURE__ */
|
3254
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3175
3255
|
};
|
3176
3256
|
},
|
3177
3257
|
multiple: function(notifications) {
|
3178
3258
|
return {
|
3179
3259
|
title: `${notifications[notifications.length - 1].data.name} and ${notifications.length - 1} others joined`,
|
3180
|
-
icon: /* @__PURE__ */
|
3260
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3181
3261
|
};
|
3182
3262
|
}
|
3183
3263
|
},
|
@@ -3186,13 +3266,13 @@ var ToastConfig = {
|
|
3186
3266
|
var _a7;
|
3187
3267
|
return {
|
3188
3268
|
title: `${(_a7 = notification.data) == null ? void 0 : _a7.name} left`,
|
3189
|
-
icon: /* @__PURE__ */
|
3269
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleRemoveIcon, null)
|
3190
3270
|
};
|
3191
3271
|
},
|
3192
3272
|
multiple: function(notifications) {
|
3193
3273
|
return {
|
3194
3274
|
title: `${notifications[notifications.length - 1].data.name} and ${notifications.length - 1} others left`,
|
3195
|
-
icon: /* @__PURE__ */
|
3275
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleRemoveIcon, null)
|
3196
3276
|
};
|
3197
3277
|
}
|
3198
3278
|
},
|
@@ -3201,8 +3281,8 @@ var ToastConfig = {
|
|
3201
3281
|
var _a7, _b7;
|
3202
3282
|
return {
|
3203
3283
|
title: `${(_a7 = notification.data) == null ? void 0 : _a7.name} raised hand`,
|
3204
|
-
icon: /* @__PURE__ */
|
3205
|
-
action: /* @__PURE__ */
|
3284
|
+
icon: /* @__PURE__ */ React25.createElement(HandIcon, null),
|
3285
|
+
action: /* @__PURE__ */ React25.createElement(HandRaiseAction, { id: (_b7 = notification.data) == null ? void 0 : _b7.id })
|
3206
3286
|
};
|
3207
3287
|
},
|
3208
3288
|
multiple: (notifications) => {
|
@@ -3213,8 +3293,8 @@ var ToastConfig = {
|
|
3213
3293
|
})).size;
|
3214
3294
|
return {
|
3215
3295
|
title: `${(_a7 = notifications[notifications.length - 1].data) == null ? void 0 : _a7.name} ${count > 1 ? `${count} and others` : ""} raised hand`,
|
3216
|
-
icon: /* @__PURE__ */
|
3217
|
-
action: /* @__PURE__ */
|
3296
|
+
icon: /* @__PURE__ */ React25.createElement(HandIcon, null),
|
3297
|
+
action: /* @__PURE__ */ React25.createElement(HandRaiseAction, { isSingleHandRaise: false })
|
3218
3298
|
};
|
3219
3299
|
}
|
3220
3300
|
},
|
@@ -3223,15 +3303,15 @@ var ToastConfig = {
|
|
3223
3303
|
var _a7;
|
3224
3304
|
return {
|
3225
3305
|
title: `New message from ${(_a7 = notification.data) == null ? void 0 : _a7.senderName}`,
|
3226
|
-
icon: /* @__PURE__ */
|
3227
|
-
action: /* @__PURE__ */
|
3306
|
+
icon: /* @__PURE__ */ React25.createElement(ChatUnreadIcon, null),
|
3307
|
+
action: /* @__PURE__ */ React25.createElement(ChatAction, null)
|
3228
3308
|
};
|
3229
3309
|
},
|
3230
3310
|
multiple: (notifications) => {
|
3231
3311
|
return {
|
3232
3312
|
title: `${notifications.length} new messages`,
|
3233
|
-
icon: /* @__PURE__ */
|
3234
|
-
action: /* @__PURE__ */
|
3313
|
+
icon: /* @__PURE__ */ React25.createElement(ChatUnreadIcon, null),
|
3314
|
+
action: /* @__PURE__ */ React25.createElement(ChatAction, null)
|
3235
3315
|
};
|
3236
3316
|
}
|
3237
3317
|
},
|
@@ -3239,7 +3319,7 @@ var ToastConfig = {
|
|
3239
3319
|
single: () => {
|
3240
3320
|
return {
|
3241
3321
|
title: `You are now connected`,
|
3242
|
-
icon: /* @__PURE__ */
|
3322
|
+
icon: /* @__PURE__ */ React25.createElement(ConnectivityIcon, null),
|
3243
3323
|
variant: "success",
|
3244
3324
|
duration: 3e3
|
3245
3325
|
};
|
@@ -3251,7 +3331,7 @@ var ToastConfig = {
|
|
3251
3331
|
title: `You are offline for now. while we try to reconnect, please check
|
3252
3332
|
your internet connection. ${message}.
|
3253
3333
|
`,
|
3254
|
-
icon: /* @__PURE__ */
|
3334
|
+
icon: /* @__PURE__ */ React25.createElement(PoorConnectivityIcon, null),
|
3255
3335
|
variant: "warning",
|
3256
3336
|
duration: 3e4
|
3257
3337
|
};
|
@@ -3356,11 +3436,11 @@ var ToastBatcher = {
|
|
3356
3436
|
ToastManager.addListener(ToastBatcher.syncUItoast.bind(ToastBatcher));
|
3357
3437
|
|
3358
3438
|
// src/Prebuilt/components/Notifications/AutoplayBlockedModal.jsx
|
3359
|
-
import
|
3439
|
+
import React26 from "react";
|
3360
3440
|
import { useAutoplayError } from "@100mslive/react-sdk";
|
3361
3441
|
function AutoplayBlockedModal() {
|
3362
3442
|
const { error, resetError, unblockAudio } = useAutoplayError();
|
3363
|
-
return /* @__PURE__ */
|
3443
|
+
return /* @__PURE__ */ React26.createElement(
|
3364
3444
|
Dialog.Root,
|
3365
3445
|
{
|
3366
3446
|
open: !!error,
|
@@ -3371,7 +3451,7 @@ function AutoplayBlockedModal() {
|
|
3371
3451
|
resetError();
|
3372
3452
|
}
|
3373
3453
|
},
|
3374
|
-
/* @__PURE__ */
|
3454
|
+
/* @__PURE__ */ React26.createElement(DialogContent, { title: "Permission Error", closeable: false }, /* @__PURE__ */ React26.createElement(DialogRow, null, /* @__PURE__ */ React26.createElement(Text, { variant: "md" }, "The browser wants us to get a confirmation for playing the Audio. Please allow audio to proceed.")), /* @__PURE__ */ React26.createElement(DialogRow, { justify: "end" }, /* @__PURE__ */ React26.createElement(
|
3375
3455
|
Button,
|
3376
3456
|
{
|
3377
3457
|
variant: "primary",
|
@@ -3386,11 +3466,11 @@ function AutoplayBlockedModal() {
|
|
3386
3466
|
}
|
3387
3467
|
|
3388
3468
|
// src/Prebuilt/components/Notifications/InitErrorModal.jsx
|
3389
|
-
import
|
3469
|
+
import React27, { useEffect as useEffect10, useState as useState6 } from "react";
|
3390
3470
|
var InitErrorModal = ({ notification }) => {
|
3391
3471
|
const [showModal, setShowModal] = useState6(false);
|
3392
3472
|
const [info, setInfo] = useState6({ title: "Init Error", description: "" });
|
3393
|
-
|
3473
|
+
useEffect10(() => {
|
3394
3474
|
const data = notification == null ? void 0 : notification.data;
|
3395
3475
|
if (!data || data.action !== "INIT") {
|
3396
3476
|
return;
|
@@ -3410,11 +3490,11 @@ var InitErrorModal = ({ notification }) => {
|
|
3410
3490
|
setInfo({ title, description });
|
3411
3491
|
setShowModal(true);
|
3412
3492
|
}, [notification]);
|
3413
|
-
return /* @__PURE__ */
|
3493
|
+
return /* @__PURE__ */ React27.createElement(ErrorDialog, { open: showModal, onOpenChange: setShowModal, title: info.title }, /* @__PURE__ */ React27.createElement(Text, { variant: "sm", css: { wordBreak: "break-word" } }, info.description, " ", /* @__PURE__ */ React27.createElement("br", null), "Current URL - ", window.location.href));
|
3414
3494
|
};
|
3415
3495
|
|
3416
3496
|
// src/Prebuilt/components/Notifications/PeerNotifications.jsx
|
3417
|
-
import { useEffect as
|
3497
|
+
import { useEffect as useEffect11 } from "react";
|
3418
3498
|
import { HMSNotificationTypes, useHMSNotifications } from "@100mslive/react-sdk";
|
3419
3499
|
var notificationTypes = [
|
3420
3500
|
HMSNotificationTypes.PEER_LIST,
|
@@ -3425,7 +3505,7 @@ var PeerNotifications = () => {
|
|
3425
3505
|
const notification = useHMSNotifications(notificationTypes);
|
3426
3506
|
const isPeerJoinSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_JOINED);
|
3427
3507
|
const isPeerLeftSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_LEFT);
|
3428
|
-
|
3508
|
+
useEffect11(() => {
|
3429
3509
|
if (!(notification == null ? void 0 : notification.data)) {
|
3430
3510
|
return;
|
3431
3511
|
}
|
@@ -3455,7 +3535,7 @@ var PeerNotifications = () => {
|
|
3455
3535
|
};
|
3456
3536
|
|
3457
3537
|
// src/Prebuilt/components/Notifications/PermissionErrorModal.jsx
|
3458
|
-
import
|
3538
|
+
import React28, { useEffect as useEffect12, useState as useState7 } from "react";
|
3459
3539
|
import { useMedia } from "react-use";
|
3460
3540
|
import { HMSNotificationTypes as HMSNotificationTypes2, useHMSNotifications as useHMSNotifications2 } from "@100mslive/react-sdk";
|
3461
3541
|
|
@@ -3471,7 +3551,7 @@ function PermissionErrorModal() {
|
|
3471
3551
|
const [deviceType, setDeviceType] = useState7("");
|
3472
3552
|
const [isSystemError, setIsSystemError] = useState7(false);
|
3473
3553
|
const isMobile = useMedia(config.media.md);
|
3474
|
-
|
3554
|
+
useEffect12(() => {
|
3475
3555
|
var _a7, _b7, _c, _d, _e;
|
3476
3556
|
if (!notification || ((_a7 = notification.data) == null ? void 0 : _a7.code) !== 3001 && ((_b7 = notification.data) == null ? void 0 : _b7.code) !== 3011 || ((_c = notification.data) == null ? void 0 : _c.code) === 3001 && ((_d = notification.data) == null ? void 0 : _d.message.includes("screen"))) {
|
3477
3557
|
return;
|
@@ -3492,15 +3572,15 @@ function PermissionErrorModal() {
|
|
3492
3572
|
}
|
3493
3573
|
setIsSystemError(notification.data.code === 3011);
|
3494
3574
|
}, [notification]);
|
3495
|
-
return deviceType ? /* @__PURE__ */
|
3575
|
+
return deviceType ? /* @__PURE__ */ React28.createElement(Dialog.Root, { open: !!deviceType }, /* @__PURE__ */ React28.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React28.createElement(Dialog.Overlay, null), /* @__PURE__ */ React28.createElement(Dialog.Content, { css: { w: "min(380px, 90%)", p: "$8" } }, /* @__PURE__ */ React28.createElement(
|
3496
3576
|
Dialog.Title,
|
3497
3577
|
{
|
3498
3578
|
css: {
|
3499
3579
|
borderBottom: "1px solid $border_default"
|
3500
3580
|
}
|
3501
3581
|
},
|
3502
|
-
isMobile && isIOS ? /* @__PURE__ */
|
3503
|
-
isMobile && isAndroid ? /* @__PURE__ */
|
3582
|
+
isMobile && isIOS ? /* @__PURE__ */ React28.createElement("img", { style: { maxWidth: "100%", maxHeight: "100%" }, src: ios_perm_0_default, alt: "iOS Permission flow" }) : null,
|
3583
|
+
isMobile && isAndroid ? /* @__PURE__ */ React28.createElement(
|
3504
3584
|
"img",
|
3505
3585
|
{
|
3506
3586
|
src: android_perm_1_default,
|
@@ -3508,12 +3588,12 @@ function PermissionErrorModal() {
|
|
3508
3588
|
alt: "Android Permission flow "
|
3509
3589
|
}
|
3510
3590
|
) : null,
|
3511
|
-
/* @__PURE__ */
|
3512
|
-
), /* @__PURE__ */
|
3591
|
+
/* @__PURE__ */ React28.createElement(Text, { variant: "h6" }, "We can't access your ", deviceType)
|
3592
|
+
), /* @__PURE__ */ React28.createElement(Text, { variant: "sm", css: { pt: "$4", pb: "$10", color: "$on_surface_medium" } }, isMobile && isIOS ? 'Enable permissions by reloading this page and clicking "Allow" on the pop-up, or change settings from the address bar.' : null, isMobile && isAndroid ? `To allow other users to see and hear you, click the blocked camera icon in your browser's address bar.` : null, !isMobile ? `Access to ${deviceType} is required. ` : null, isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from sytem settings` : null, !isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from address bar or browser settings.` : null), isMobile && isIOS ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Button, { onClick: () => window.location.reload(), css: { w: "100%", mb: "$6" } }, "Reload"), /* @__PURE__ */ React28.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null, isMobile && isAndroid ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Button, { onClick: () => setDeviceType(""), css: { w: "100%", mb: "$6" } }, "I've allowed access"), /* @__PURE__ */ React28.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null, !isMobile ? /* @__PURE__ */ React28.createElement(Flex, { justify: "end", css: { w: "100%" } }, /* @__PURE__ */ React28.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType("") }, "Dismiss")) : null))) : null;
|
3513
3593
|
}
|
3514
3594
|
|
3515
3595
|
// src/Prebuilt/components/Notifications/ReconnectNotifications.jsx
|
3516
|
-
import
|
3596
|
+
import React29, { useEffect as useEffect13, useState as useState8 } from "react";
|
3517
3597
|
import { HMSNotificationTypes as HMSNotificationTypes3, useHMSNotifications as useHMSNotifications3 } from "@100mslive/react-sdk";
|
3518
3598
|
var notificationTypes2 = [
|
3519
3599
|
HMSNotificationTypes3.RECONNECTED,
|
@@ -3524,7 +3604,7 @@ var notificationId = null;
|
|
3524
3604
|
var ReconnectNotifications = () => {
|
3525
3605
|
const notification = useHMSNotifications3(notificationTypes2);
|
3526
3606
|
const [open, setOpen] = useState8(false);
|
3527
|
-
|
3607
|
+
useEffect13(() => {
|
3528
3608
|
var _a7;
|
3529
3609
|
if ((notification == null ? void 0 : notification.type) === HMSNotificationTypes3.ERROR && ((_a7 = notification == null ? void 0 : notification.data) == null ? void 0 : _a7.isTerminal)) {
|
3530
3610
|
setOpen(false);
|
@@ -3540,7 +3620,7 @@ var ReconnectNotifications = () => {
|
|
3540
3620
|
}, [notification]);
|
3541
3621
|
if (!open)
|
3542
3622
|
return null;
|
3543
|
-
return /* @__PURE__ */
|
3623
|
+
return /* @__PURE__ */ React29.createElement(Dialog.Root, { open, modal: true }, /* @__PURE__ */ React29.createElement(Dialog.Portal, { container: document.getElementById("conferencing") }, /* @__PURE__ */ React29.createElement(Dialog.Overlay, null), /* @__PURE__ */ React29.createElement(
|
3544
3624
|
Dialog.Content,
|
3545
3625
|
{
|
3546
3626
|
css: {
|
@@ -3554,12 +3634,12 @@ var ReconnectNotifications = () => {
|
|
3554
3634
|
animation: "none !important"
|
3555
3635
|
}
|
3556
3636
|
},
|
3557
|
-
/* @__PURE__ */
|
3637
|
+
/* @__PURE__ */ React29.createElement(Flex, { align: "center" }, /* @__PURE__ */ React29.createElement("div", { style: { display: "inline", margin: "0.25rem" } }, /* @__PURE__ */ React29.createElement(Loading, { size: 16 })), /* @__PURE__ */ React29.createElement(Text, { css: { fontSize: "$space$8", color: "$on_surface_high" } }, "You lost your network connection. Trying to reconnect."))
|
3558
3638
|
)));
|
3559
3639
|
};
|
3560
3640
|
|
3561
3641
|
// src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx
|
3562
|
-
import
|
3642
|
+
import React30, { useEffect as useEffect14, useState as useState9 } from "react";
|
3563
3643
|
import { HMSNotificationTypes as HMSNotificationTypes4, useHMSActions as useHMSActions7, useHMSNotifications as useHMSNotifications4 } from "@100mslive/react-sdk";
|
3564
3644
|
import { MicOnIcon } from "@100mslive/react-icons";
|
3565
3645
|
var TrackBulkUnmuteModal = () => {
|
@@ -3570,7 +3650,7 @@ var TrackBulkUnmuteModal = () => {
|
|
3570
3650
|
HMSNotificationTypes4.ROOM_ENDED,
|
3571
3651
|
HMSNotificationTypes4.REMOVED_FROM_ROOM
|
3572
3652
|
]);
|
3573
|
-
|
3653
|
+
useEffect14(() => {
|
3574
3654
|
switch (notification == null ? void 0 : notification.type) {
|
3575
3655
|
case HMSNotificationTypes4.REMOVED_FROM_ROOM:
|
3576
3656
|
case HMSNotificationTypes4.ROOM_ENDED:
|
@@ -3589,7 +3669,7 @@ var TrackBulkUnmuteModal = () => {
|
|
3589
3669
|
return null;
|
3590
3670
|
}
|
3591
3671
|
const { requestedBy: peer, tracks, enabled } = muteNotification;
|
3592
|
-
return /* @__PURE__ */
|
3672
|
+
return /* @__PURE__ */ React30.createElement(
|
3593
3673
|
RequestDialog,
|
3594
3674
|
{
|
3595
3675
|
title: "Track Unmute Request",
|
@@ -3607,7 +3687,7 @@ var TrackBulkUnmuteModal = () => {
|
|
3607
3687
|
};
|
3608
3688
|
|
3609
3689
|
// src/Prebuilt/components/Notifications/TrackNotifications.jsx
|
3610
|
-
import { useEffect as
|
3690
|
+
import { useEffect as useEffect15 } from "react";
|
3611
3691
|
import { HMSNotificationTypes as HMSNotificationTypes5, useHMSNotifications as useHMSNotifications5 } from "@100mslive/react-sdk";
|
3612
3692
|
var notificationTypes3 = [
|
3613
3693
|
HMSNotificationTypes5.TRACK_ADDED,
|
@@ -3617,7 +3697,7 @@ var notificationTypes3 = [
|
|
3617
3697
|
];
|
3618
3698
|
var TrackNotifications = () => {
|
3619
3699
|
const notification = useHMSNotifications5(notificationTypes3);
|
3620
|
-
|
3700
|
+
useEffect15(() => {
|
3621
3701
|
if (notification) {
|
3622
3702
|
console.debug(`[${notification.type}]`, notification);
|
3623
3703
|
}
|
@@ -3626,7 +3706,7 @@ var TrackNotifications = () => {
|
|
3626
3706
|
};
|
3627
3707
|
|
3628
3708
|
// src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx
|
3629
|
-
import
|
3709
|
+
import React31, { useEffect as useEffect16, useState as useState10 } from "react";
|
3630
3710
|
import { HMSNotificationTypes as HMSNotificationTypes6, useHMSActions as useHMSActions8, useHMSNotifications as useHMSNotifications6 } from "@100mslive/react-sdk";
|
3631
3711
|
import { MicOnIcon as MicOnIcon2 } from "@100mslive/react-icons";
|
3632
3712
|
var TrackUnmuteModal = () => {
|
@@ -3637,7 +3717,7 @@ var TrackUnmuteModal = () => {
|
|
3637
3717
|
HMSNotificationTypes6.REMOVED_FROM_ROOM
|
3638
3718
|
]);
|
3639
3719
|
const [muteNotification, setMuteNotification] = useState10(null);
|
3640
|
-
|
3720
|
+
useEffect16(() => {
|
3641
3721
|
switch (notification == null ? void 0 : notification.type) {
|
3642
3722
|
case HMSNotificationTypes6.REMOVED_FROM_ROOM:
|
3643
3723
|
case HMSNotificationTypes6.ROOM_ENDED:
|
@@ -3656,7 +3736,7 @@ var TrackUnmuteModal = () => {
|
|
3656
3736
|
return null;
|
3657
3737
|
}
|
3658
3738
|
const { requestedBy: peer, track, enabled } = muteNotification;
|
3659
|
-
return /* @__PURE__ */
|
3739
|
+
return /* @__PURE__ */ React31.createElement(
|
3660
3740
|
RequestDialog,
|
3661
3741
|
{
|
3662
3742
|
title: "Track Unmute Request",
|
@@ -4176,7 +4256,7 @@ function Notifications() {
|
|
4176
4256
|
const updateRoomLayoutForRole = useUpdateRoomLayout();
|
4177
4257
|
const isNotificationDisabled = useIsNotificationDisabled();
|
4178
4258
|
const { redirectToLeave } = useRedirectToLeave();
|
4179
|
-
const vanillaStore =
|
4259
|
+
const vanillaStore = useHMSVanillaStore5();
|
4180
4260
|
const handleRoleChangeDenied = useCallback8((request) => {
|
4181
4261
|
ToastManager.addToast({
|
4182
4262
|
title: `${request.peerName} denied your request to join the ${request.role.name} role`,
|
@@ -4184,7 +4264,7 @@ function Notifications() {
|
|
4184
4264
|
});
|
4185
4265
|
}, []);
|
4186
4266
|
useCustomEvent({ type: ROLE_CHANGE_DECLINED, onEvent: handleRoleChangeDenied });
|
4187
|
-
|
4267
|
+
useEffect17(() => {
|
4188
4268
|
var _a7, _b7, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
4189
4269
|
if (!notification || isNotificationDisabled) {
|
4190
4270
|
return;
|
@@ -4225,7 +4305,7 @@ function Notifications() {
|
|
4225
4305
|
const toastId = ToastManager.addToast({
|
4226
4306
|
title: ((_f = notification.data) == null ? void 0 : _f.message) || "We couldn\u2019t reconnect you. When you\u2019re back online, try joining the room.",
|
4227
4307
|
inlineAction: true,
|
4228
|
-
action: /* @__PURE__ */
|
4308
|
+
action: /* @__PURE__ */ React32.createElement(
|
4229
4309
|
Button,
|
4230
4310
|
{
|
4231
4311
|
onClick: () => {
|
@@ -4291,35 +4371,35 @@ function Notifications() {
|
|
4291
4371
|
if (isNotificationDisabled) {
|
4292
4372
|
return null;
|
4293
4373
|
}
|
4294
|
-
return /* @__PURE__ */
|
4374
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(TrackUnmuteModal, null), /* @__PURE__ */ React32.createElement(TrackBulkUnmuteModal, null), /* @__PURE__ */ React32.createElement(TrackNotifications, null), roomState === HMSRoomState2.Connected ? /* @__PURE__ */ React32.createElement(PeerNotifications, null) : null, /* @__PURE__ */ React32.createElement(ReconnectNotifications, null), /* @__PURE__ */ React32.createElement(AutoplayBlockedModal, null), /* @__PURE__ */ React32.createElement(PermissionErrorModal, null), /* @__PURE__ */ React32.createElement(InitErrorModal, { notification }));
|
4295
4375
|
}
|
4296
4376
|
|
4297
4377
|
// src/Prebuilt/components/PostLeave.jsx
|
4298
|
-
import
|
4378
|
+
import React39 from "react";
|
4299
4379
|
import { useNavigate as useNavigate3, useParams as useParams3 } from "react-router-dom";
|
4300
4380
|
import { ExitIcon } from "@100mslive/react-icons";
|
4301
4381
|
|
4302
4382
|
// src/Prebuilt/components/Header/Header.tsx
|
4303
|
-
import
|
4383
|
+
import React38 from "react";
|
4304
4384
|
import { useMedia as useMedia3 } from "react-use";
|
4305
4385
|
import { HMSRoomState as HMSRoomState4, selectRoomState as selectRoomState4, useHMSStore as useHMSStore16 } from "@100mslive/react-sdk";
|
4306
4386
|
|
4307
4387
|
// src/Prebuilt/components/Header/HeaderComponents.jsx
|
4308
|
-
import
|
4388
|
+
import React33, { useEffect as useEffect18, useState as useState11 } from "react";
|
4309
4389
|
import { selectDominantSpeaker, useHMSStore as useHMSStore8 } from "@100mslive/react-sdk";
|
4310
4390
|
import { VolumeOneIcon } from "@100mslive/react-icons";
|
4311
4391
|
var SpeakerTag = () => {
|
4312
4392
|
const dominantSpeaker = useHMSStore8(selectDominantSpeaker);
|
4313
|
-
return dominantSpeaker && dominantSpeaker.name && /* @__PURE__ */
|
4393
|
+
return dominantSpeaker && dominantSpeaker.name && /* @__PURE__ */ React33.createElement(
|
4314
4394
|
Flex,
|
4315
4395
|
{
|
4316
4396
|
align: "center",
|
4317
4397
|
justify: "center",
|
4318
4398
|
css: { flex: "1 1 0", color: "$on_primary_high", "@md": { display: "none" } }
|
4319
4399
|
},
|
4320
|
-
/* @__PURE__ */
|
4321
|
-
/* @__PURE__ */
|
4322
|
-
/* @__PURE__ */
|
4400
|
+
/* @__PURE__ */ React33.createElement(VerticalDivider, { css: { ml: "$8" } }),
|
4401
|
+
/* @__PURE__ */ React33.createElement(VolumeOneIcon, null),
|
4402
|
+
/* @__PURE__ */ React33.createElement(Text, { variant: "md", css: __spreadProps(__spreadValues({}, textEllipsis(200)), { ml: "$2" }), title: dominantSpeaker.name }, dominantSpeaker.name)
|
4323
4403
|
);
|
4324
4404
|
};
|
4325
4405
|
var LogoImg = styled("img", {
|
@@ -4335,12 +4415,12 @@ var Logo = () => {
|
|
4335
4415
|
const roomLayout = useRoomLayout();
|
4336
4416
|
const logo = (_a7 = roomLayout == null ? void 0 : roomLayout.logo) == null ? void 0 : _a7.url;
|
4337
4417
|
const [hideImage, setHideImage] = useState11(false);
|
4338
|
-
|
4418
|
+
useEffect18(() => {
|
4339
4419
|
if (hideImage) {
|
4340
4420
|
setHideImage(false);
|
4341
4421
|
}
|
4342
4422
|
}, [logo]);
|
4343
|
-
return logo && !hideImage ? /* @__PURE__ */
|
4423
|
+
return logo && !hideImage ? /* @__PURE__ */ React33.createElement(
|
4344
4424
|
LogoImg,
|
4345
4425
|
{
|
4346
4426
|
src: logo,
|
@@ -4354,7 +4434,7 @@ var Logo = () => {
|
|
4354
4434
|
};
|
4355
4435
|
|
4356
4436
|
// src/Prebuilt/components/Header/StreamActions.tsx
|
4357
|
-
import
|
4437
|
+
import React36, { useCallback as useCallback13, useEffect as useEffect20, useRef as useRef6, useState as useState13 } from "react";
|
4358
4438
|
import { useMedia as useMedia2 } from "react-use";
|
4359
4439
|
import {
|
4360
4440
|
HMSRoomState as HMSRoomState3,
|
@@ -4369,7 +4449,7 @@ import {
|
|
4369
4449
|
import { AlertTriangleIcon, CrossIcon as CrossIcon4, RecordIcon } from "@100mslive/react-icons";
|
4370
4450
|
|
4371
4451
|
// src/Sheet/Sheet.tsx
|
4372
|
-
import
|
4452
|
+
import React34 from "react";
|
4373
4453
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
4374
4454
|
var SheetRoot = styled(DialogPrimitive2.Root, {
|
4375
4455
|
minHeight: "240px",
|
@@ -4443,10 +4523,10 @@ var StyledContent6 = styled(DialogPrimitive2.Content, {
|
|
4443
4523
|
side: "bottom"
|
4444
4524
|
}
|
4445
4525
|
});
|
4446
|
-
var SheetContent =
|
4526
|
+
var SheetContent = React34.forwardRef(
|
4447
4527
|
(_a7, forwardedRef) => {
|
4448
4528
|
var _b7 = _a7, { children } = _b7, props = __objRest(_b7, ["children"]);
|
4449
|
-
return /* @__PURE__ */
|
4529
|
+
return /* @__PURE__ */ React34.createElement(Dialog.Portal, null, /* @__PURE__ */ React34.createElement(StyledOverlay, null), /* @__PURE__ */ React34.createElement(StyledContent6, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }), children));
|
4450
4530
|
}
|
4451
4531
|
);
|
4452
4532
|
var SheetClose = Dialog.Close;
|
@@ -4466,7 +4546,7 @@ var Sheet = {
|
|
4466
4546
|
};
|
4467
4547
|
|
4468
4548
|
// src/Prebuilt/components/Header/AdditionalRoomState.jsx
|
4469
|
-
import
|
4549
|
+
import React35, { useState as useState12 } from "react";
|
4470
4550
|
import { selectLocalPeerID as selectLocalPeerID3, selectPeerSharingVideoPlaylist, useHMSStore as useHMSStore13, useScreenShare } from "@100mslive/react-sdk";
|
4471
4551
|
import {
|
4472
4552
|
AudioPlayerIcon,
|
@@ -4479,7 +4559,7 @@ import {
|
|
4479
4559
|
} from "@100mslive/react-icons";
|
4480
4560
|
|
4481
4561
|
// src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js
|
4482
|
-
import { useCallback as useCallback10, useEffect as
|
4562
|
+
import { useCallback as useCallback10, useEffect as useEffect19, useMemo as useMemo2 } from "react";
|
4483
4563
|
import { selectLocalPeerID as selectLocalPeerID2, selectPeerByCondition, useHMSStore as useHMSStore10 } from "@100mslive/react-sdk";
|
4484
4564
|
|
4485
4565
|
// src/Prebuilt/components/hooks/useMetadata.jsx
|
@@ -4490,12 +4570,12 @@ import {
|
|
4490
4570
|
selectPeerMetadata,
|
4491
4571
|
useHMSActions as useHMSActions9,
|
4492
4572
|
useHMSStore as useHMSStore9,
|
4493
|
-
useHMSVanillaStore as
|
4573
|
+
useHMSVanillaStore as useHMSVanillaStore6
|
4494
4574
|
} from "@100mslive/react-sdk";
|
4495
4575
|
var useMyMetadata = () => {
|
4496
4576
|
const hmsActions = useHMSActions9();
|
4497
4577
|
const localPeerId = useHMSStore9(selectLocalPeerID);
|
4498
|
-
const vanillaStore =
|
4578
|
+
const vanillaStore = useHMSVanillaStore6();
|
4499
4579
|
const metaData = useHMSStore9(selectPeerMetadata(localPeerId));
|
4500
4580
|
const isHandRaised = useHMSStore9(selectHasPeerHandRaised2(localPeerId));
|
4501
4581
|
const update = (updatedFields) => __async(void 0, null, function* () {
|
@@ -4512,11 +4592,12 @@ var useMyMetadata = () => {
|
|
4512
4592
|
yield hmsActions.lowerLocalPeerHand();
|
4513
4593
|
} else {
|
4514
4594
|
yield hmsActions.raiseLocalPeerHand();
|
4595
|
+
yield update({ isBRBOn: false });
|
4515
4596
|
}
|
4516
4597
|
}), [isHandRaised]);
|
4517
4598
|
const toggleBRB = useCallback9(() => __async(void 0, null, function* () {
|
4518
4599
|
const newValue = !(metaData == null ? void 0 : metaData.isBRBOn);
|
4519
|
-
yield update({ isBRBOn:
|
4600
|
+
yield update({ isBRBOn: newValue });
|
4520
4601
|
if (newValue) {
|
4521
4602
|
yield hmsActions.lowerLocalPeerHand();
|
4522
4603
|
}
|
@@ -4560,7 +4641,7 @@ var useWhiteboardMetadata = () => {
|
|
4560
4641
|
console.error("failed to toggle whiteboard to ", !whiteboardOwner, error);
|
4561
4642
|
}
|
4562
4643
|
}), [whiteboardOwner, updateMetaData, amIWhiteboardOwner]);
|
4563
|
-
|
4644
|
+
useEffect19(() => {
|
4564
4645
|
window.toggleWhiteboard = toggleWhiteboard;
|
4565
4646
|
}, [toggleWhiteboard]);
|
4566
4647
|
return {
|
@@ -4674,7 +4755,7 @@ var AdditionalRoomState = () => {
|
|
4674
4755
|
if (isPlaylistInactive && isAudioshareInactive && !shouldShowScreenShareState && !shouldShowVideoState && !whiteboardOwner) {
|
4675
4756
|
return null;
|
4676
4757
|
}
|
4677
|
-
return /* @__PURE__ */
|
4758
|
+
return /* @__PURE__ */ React35.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React35.createElement(Dropdown.Trigger, { asChild: true }, /* @__PURE__ */ React35.createElement(
|
4678
4759
|
Flex,
|
4679
4760
|
{
|
4680
4761
|
align: "center",
|
@@ -4687,13 +4768,13 @@ var AdditionalRoomState = () => {
|
|
4687
4768
|
},
|
4688
4769
|
"data-testid": "record_status_dropdown"
|
4689
4770
|
},
|
4690
|
-
!isAudioshareInactive && /* @__PURE__ */
|
4691
|
-
shouldShowScreenShareState && /* @__PURE__ */
|
4692
|
-
shouldShowVideoState && /* @__PURE__ */
|
4693
|
-
!isPlaylistInactive && /* @__PURE__ */
|
4694
|
-
whiteboardOwner && /* @__PURE__ */
|
4695
|
-
/* @__PURE__ */
|
4696
|
-
)), /* @__PURE__ */
|
4771
|
+
!isAudioshareInactive && /* @__PURE__ */ React35.createElement(Tooltip, { title: "Screenshare Audio" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(MusicIcon, { width: 24, height: 24 }))),
|
4772
|
+
shouldShowScreenShareState && /* @__PURE__ */ React35.createElement(Tooltip, { title: "Screenshare" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(ShareScreenIcon, { width: 24, height: 24 }))),
|
4773
|
+
shouldShowVideoState && /* @__PURE__ */ React35.createElement(Tooltip, { title: "video playlist" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(VideoPlayerIcon, { width: 24, height: 24 }))),
|
4774
|
+
!isPlaylistInactive && /* @__PURE__ */ React35.createElement(Tooltip, { title: "Playlist Music" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(AudioPlayerIcon, { width: 24, height: 24 }))),
|
4775
|
+
whiteboardOwner && /* @__PURE__ */ React35.createElement(Tooltip, { title: "Whiteboard" }, /* @__PURE__ */ React35.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React35.createElement(PencilDrawIcon, { width: 24, height: 24 }))),
|
4776
|
+
/* @__PURE__ */ React35.createElement(Box, { css: { "@lg": { display: "none" }, color: "$on_surface_low" } }, open ? /* @__PURE__ */ React35.createElement(ChevronUpIcon2, null) : /* @__PURE__ */ React35.createElement(ChevronDownIcon2, null))
|
4777
|
+
)), /* @__PURE__ */ React35.createElement(Dropdown.Content, { sideOffset: 5, align: "end", css: { w: "$60" } }, !isPlaylistInactive && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(AudioPlayerIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, "Playlist is playing"), playlist.peer.isLocal ? /* @__PURE__ */ React35.createElement(
|
4697
4778
|
Text,
|
4698
4779
|
{
|
4699
4780
|
variant: "sm",
|
@@ -4704,7 +4785,7 @@ var AdditionalRoomState = () => {
|
|
4704
4785
|
}
|
4705
4786
|
},
|
4706
4787
|
playlist.selection.playing ? "Pause" : "Play"
|
4707
|
-
) : /* @__PURE__ */
|
4788
|
+
) : /* @__PURE__ */ React35.createElement(
|
4708
4789
|
Text,
|
4709
4790
|
{
|
4710
4791
|
variant: "sm",
|
@@ -4715,7 +4796,7 @@ var AdditionalRoomState = () => {
|
|
4715
4796
|
}
|
4716
4797
|
},
|
4717
4798
|
playlist.track.volume === 0 ? "Unmute" : "Mute"
|
4718
|
-
)), !isAudioshareInactive && /* @__PURE__ */
|
4799
|
+
)), !isAudioshareInactive && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(MusicIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, "Music is playing"), /* @__PURE__ */ React35.createElement(
|
4719
4800
|
Text,
|
4720
4801
|
{
|
4721
4802
|
variant: "sm",
|
@@ -4726,7 +4807,7 @@ var AdditionalRoomState = () => {
|
|
4726
4807
|
}
|
4727
4808
|
},
|
4728
4809
|
screenshareAudio.muted ? "Unmute" : "Mute"
|
4729
|
-
)), shouldShowScreenShareState && /* @__PURE__ */
|
4810
|
+
)), shouldShowScreenShareState && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(ShareScreenIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, `Shared by: ${screenSharingPeerId === localPeerID ? "You" : screenSharingPeerName}`)), shouldShowVideoState && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(VideoPlayerIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, `Shared by: ${peerSharingPlaylist.id === localPeerID ? "You" : peerSharingPlaylist.name}`)), whiteboardOwner && /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React35.createElement(PencilDrawIcon, { width: 24, height: 24 }), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, "Whiteboard Owner - ", whiteboardOwner.name, amIWhiteboardOwner && "(You)"), amIWhiteboardOwner && /* @__PURE__ */ React35.createElement(
|
4730
4811
|
Text,
|
4731
4812
|
{
|
4732
4813
|
variant: "sm",
|
@@ -4746,7 +4827,7 @@ var LiveStatus = () => {
|
|
4746
4827
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming2();
|
4747
4828
|
const hlsState = useHMSStore14(selectHLSState2);
|
4748
4829
|
const isMobile = useMedia2(config.media.md);
|
4749
|
-
const intervalRef =
|
4830
|
+
const intervalRef = useRef6(null);
|
4750
4831
|
const [liveTime, setLiveTime] = useState13(0);
|
4751
4832
|
const startTimer = useCallback13(() => {
|
4752
4833
|
intervalRef.current = setInterval(() => {
|
@@ -4756,7 +4837,7 @@ var LiveStatus = () => {
|
|
4756
4837
|
}
|
4757
4838
|
}, 1e3);
|
4758
4839
|
}, [hlsState == null ? void 0 : hlsState.running, hlsState == null ? void 0 : hlsState.variants]);
|
4759
|
-
|
4840
|
+
useEffect20(() => {
|
4760
4841
|
if (hlsState == null ? void 0 : hlsState.running) {
|
4761
4842
|
startTimer();
|
4762
4843
|
}
|
@@ -4772,7 +4853,7 @@ var LiveStatus = () => {
|
|
4772
4853
|
if (!isHLSRunning && !isRTMPRunning) {
|
4773
4854
|
return null;
|
4774
4855
|
}
|
4775
|
-
return /* @__PURE__ */
|
4856
|
+
return /* @__PURE__ */ React36.createElement(
|
4776
4857
|
Flex,
|
4777
4858
|
{
|
4778
4859
|
align: "center",
|
@@ -4783,8 +4864,8 @@ var LiveStatus = () => {
|
|
4783
4864
|
borderRadius: "$1"
|
4784
4865
|
}
|
4785
4866
|
},
|
4786
|
-
/* @__PURE__ */
|
4787
|
-
/* @__PURE__ */
|
4867
|
+
/* @__PURE__ */ React36.createElement(Box, { css: { w: "$4", h: "$4", r: "$round", bg: "$alert_error_default", mr: "$2" } }),
|
4868
|
+
/* @__PURE__ */ React36.createElement(Flex, { align: "center", gap: "2" }, /* @__PURE__ */ React36.createElement(Text, { variant: !isMobile ? "button" : "body2" }, "LIVE"), /* @__PURE__ */ React36.createElement(Text, { variant: "caption" }, ((_a7 = hlsState == null ? void 0 : hlsState.variants) == null ? void 0 : _a7.length) > 0 ? formatTime(liveTime) : ""))
|
4788
4869
|
);
|
4789
4870
|
};
|
4790
4871
|
var RecordingStatus = () => {
|
@@ -4799,7 +4880,7 @@ var RecordingStatus = () => {
|
|
4799
4880
|
if (!(isMobile && isRecordingOn))
|
4800
4881
|
return null;
|
4801
4882
|
}
|
4802
|
-
return /* @__PURE__ */
|
4883
|
+
return /* @__PURE__ */ React36.createElement(
|
4803
4884
|
Tooltip,
|
4804
4885
|
{
|
4805
4886
|
boxCss: { zIndex: 1 },
|
@@ -4809,7 +4890,7 @@ var RecordingStatus = () => {
|
|
4809
4890
|
isHLSRecordingOn
|
4810
4891
|
})
|
4811
4892
|
},
|
4812
|
-
/* @__PURE__ */
|
4893
|
+
/* @__PURE__ */ React36.createElement(
|
4813
4894
|
Flex,
|
4814
4895
|
{
|
4815
4896
|
css: {
|
@@ -4817,7 +4898,7 @@ var RecordingStatus = () => {
|
|
4817
4898
|
alignItems: "center"
|
4818
4899
|
}
|
4819
4900
|
},
|
4820
|
-
/* @__PURE__ */
|
4901
|
+
/* @__PURE__ */ React36.createElement(RecordIcon, { width: 24, height: 24 })
|
4821
4902
|
)
|
4822
4903
|
);
|
4823
4904
|
};
|
@@ -4831,7 +4912,7 @@ var StartRecording = () => {
|
|
4831
4912
|
return null;
|
4832
4913
|
}
|
4833
4914
|
if (isBrowserRecordingOn) {
|
4834
|
-
return /* @__PURE__ */
|
4915
|
+
return /* @__PURE__ */ React36.createElement(Popover2.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React36.createElement(Popover2.Trigger, { asChild: true }, /* @__PURE__ */ React36.createElement(Button, { variant: "danger", "data-testid": "stop_recording", icon: true, outlined: true, onClick: () => setOpen(true) }, /* @__PURE__ */ React36.createElement(RecordIcon, null), /* @__PURE__ */ React36.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, "Stop Recording"))), /* @__PURE__ */ React36.createElement(Popover2.Portal, null, /* @__PURE__ */ React36.createElement(Popover2.Content, { align: "end", sideOffset: 8, css: { w: "$64" } }, /* @__PURE__ */ React36.createElement(Text, { variant: "body1", css: { color: "$on_surface_medium" } }, "Are you sure you want to end the recording?"), /* @__PURE__ */ React36.createElement(
|
4835
4916
|
Button,
|
4836
4917
|
{
|
4837
4918
|
"data-testid": "stop_recording_confirm",
|
@@ -4854,7 +4935,7 @@ var StartRecording = () => {
|
|
4854
4935
|
"Stop"
|
4855
4936
|
))));
|
4856
4937
|
}
|
4857
|
-
return /* @__PURE__ */
|
4938
|
+
return /* @__PURE__ */ React36.createElement(
|
4858
4939
|
Button,
|
4859
4940
|
{
|
4860
4941
|
"data-testid": "start_recording",
|
@@ -4884,21 +4965,21 @@ var StartRecording = () => {
|
|
4884
4965
|
}
|
4885
4966
|
})
|
4886
4967
|
},
|
4887
|
-
recordingStarted ? /* @__PURE__ */
|
4888
|
-
/* @__PURE__ */
|
4968
|
+
recordingStarted ? /* @__PURE__ */ React36.createElement(Loading, { size: 24, color: "currentColor" }) : /* @__PURE__ */ React36.createElement(RecordIcon, null),
|
4969
|
+
/* @__PURE__ */ React36.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, recordingStarted ? "Starting" : "Start", " Recording")
|
4889
4970
|
);
|
4890
4971
|
};
|
4891
4972
|
var StreamActions = () => {
|
4892
4973
|
const isConnected = useHMSStore14(selectIsConnectedToRoom2);
|
4893
4974
|
const isMobile = useMedia2(config.media.md);
|
4894
4975
|
const roomState = useHMSStore14(selectRoomState3);
|
4895
|
-
return /* @__PURE__ */
|
4976
|
+
return /* @__PURE__ */ React36.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React36.createElement(AdditionalRoomState, null), !isMobile && /* @__PURE__ */ React36.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React36.createElement(RecordingStatus, null), roomState !== HMSRoomState3.Preview ? /* @__PURE__ */ React36.createElement(LiveStatus, null) : null), isConnected && !isMobile ? /* @__PURE__ */ React36.createElement(StartRecording, null) : null);
|
4896
4977
|
};
|
4897
4978
|
var StopRecordingInSheet = ({
|
4898
4979
|
onStopRecording,
|
4899
4980
|
onClose
|
4900
4981
|
}) => {
|
4901
|
-
return /* @__PURE__ */
|
4982
|
+
return /* @__PURE__ */ React36.createElement(Sheet.Root, { open: true }, /* @__PURE__ */ React36.createElement(Sheet.Content, null, /* @__PURE__ */ React36.createElement(Sheet.Title, { css: { p: "$10" } }, /* @__PURE__ */ React36.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%", c: "$alert_error_default" } }, /* @__PURE__ */ React36.createElement(Flex, { justify: "start", align: "center", gap: "3" }, /* @__PURE__ */ React36.createElement(AlertTriangleIcon, null), /* @__PURE__ */ React36.createElement(Text, { variant: "h5", css: { c: "$alert_error_default" } }, "Stop Recording")), /* @__PURE__ */ React36.createElement(Sheet.Close, { css: { color: "white" }, onClick: onClose }, /* @__PURE__ */ React36.createElement(CrossIcon4, null)))), /* @__PURE__ */ React36.createElement(HorizontalDivider, null), /* @__PURE__ */ React36.createElement(Box, { as: "div", css: { p: "$10", overflowY: "scroll", maxHeight: "70vh" } }, /* @__PURE__ */ React36.createElement(Text, { variant: "caption", css: { c: "$on_surface_medium", pb: "$8" } }, "Are you sure you want to stop recording? You can\u2019t undo this action."), /* @__PURE__ */ React36.createElement(
|
4902
4983
|
Button,
|
4903
4984
|
{
|
4904
4985
|
variant: "danger",
|
@@ -4912,7 +4993,7 @@ var StopRecordingInSheet = ({
|
|
4912
4993
|
};
|
4913
4994
|
|
4914
4995
|
// src/Prebuilt/components/Header/common.jsx
|
4915
|
-
import
|
4996
|
+
import React37 from "react";
|
4916
4997
|
import {
|
4917
4998
|
DeviceType,
|
4918
4999
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled2,
|
@@ -4933,7 +5014,7 @@ var CamaraFlipActions = () => {
|
|
4933
5014
|
if (!videoInput || !(videoInput == null ? void 0 : videoInput.length) || !(localVideoTrack == null ? void 0 : localVideoTrack.facingMode)) {
|
4934
5015
|
return null;
|
4935
5016
|
}
|
4936
|
-
return /* @__PURE__ */
|
5017
|
+
return /* @__PURE__ */ React37.createElement(Box, null, /* @__PURE__ */ React37.createElement(
|
4937
5018
|
IconButton_default,
|
4938
5019
|
{
|
4939
5020
|
disabled: !isVideoOn,
|
@@ -4948,7 +5029,7 @@ var CamaraFlipActions = () => {
|
|
4948
5029
|
}
|
4949
5030
|
})
|
4950
5031
|
},
|
4951
|
-
/* @__PURE__ */
|
5032
|
+
/* @__PURE__ */ React37.createElement(CameraFlipIcon, null)
|
4952
5033
|
));
|
4953
5034
|
};
|
4954
5035
|
var AudioOutputActions = () => {
|
@@ -4960,7 +5041,7 @@ var AudioOutputActions = () => {
|
|
4960
5041
|
if (!shouldShowAudioOutput || !(audioOutputFiltered == null ? void 0 : audioOutputFiltered.length) > 0) {
|
4961
5042
|
return null;
|
4962
5043
|
}
|
4963
|
-
return /* @__PURE__ */
|
5044
|
+
return /* @__PURE__ */ React37.createElement(
|
4964
5045
|
AudioOutputSelectionSheet,
|
4965
5046
|
{
|
4966
5047
|
outputDevices: audioOutput,
|
@@ -4979,11 +5060,11 @@ var AudioOutputActions = () => {
|
|
4979
5060
|
}
|
4980
5061
|
})
|
4981
5062
|
},
|
4982
|
-
/* @__PURE__ */
|
5063
|
+
/* @__PURE__ */ React37.createElement(Box, null, /* @__PURE__ */ React37.createElement(IconButton_default, null, /* @__PURE__ */ React37.createElement(SpeakerIcon, null)))
|
4983
5064
|
);
|
4984
5065
|
};
|
4985
5066
|
var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, children }) => {
|
4986
|
-
return /* @__PURE__ */
|
5067
|
+
return /* @__PURE__ */ React37.createElement(Sheet.Root, null, /* @__PURE__ */ React37.createElement(Sheet.Trigger, { asChild: true }, children), /* @__PURE__ */ React37.createElement(Sheet.Content, null, /* @__PURE__ */ React37.createElement(Sheet.Title, { css: { py: "$10", px: "$8", alignItems: "center" } }, /* @__PURE__ */ React37.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%" } }, /* @__PURE__ */ React37.createElement(Text, { variant: "h6", css: { display: "flex" } }, "Audio Output"), /* @__PURE__ */ React37.createElement(Sheet.Close, null, /* @__PURE__ */ React37.createElement(IconButton_default, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React37.createElement(CrossIcon5, null))))), /* @__PURE__ */ React37.createElement(HorizontalDivider, null), /* @__PURE__ */ React37.createElement(
|
4987
5068
|
Flex,
|
4988
5069
|
{
|
4989
5070
|
direction: "column",
|
@@ -4994,7 +5075,7 @@ var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, chil
|
|
4994
5075
|
}
|
4995
5076
|
},
|
4996
5077
|
outputDevices.map((audioDevice) => {
|
4997
|
-
return /* @__PURE__ */
|
5078
|
+
return /* @__PURE__ */ React37.createElement(
|
4998
5079
|
SelectWithLabel,
|
4999
5080
|
{
|
5000
5081
|
key: audioDevice.deviceId,
|
@@ -5007,8 +5088,8 @@ var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, chil
|
|
5007
5088
|
})
|
5008
5089
|
)));
|
5009
5090
|
};
|
5010
|
-
var SelectWithLabel = ({ label, icon = /* @__PURE__ */
|
5011
|
-
return /* @__PURE__ */
|
5091
|
+
var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React37.createElement(React37.Fragment, null), checked, id, onChange }) => {
|
5092
|
+
return /* @__PURE__ */ React37.createElement(
|
5012
5093
|
Flex,
|
5013
5094
|
{
|
5014
5095
|
align: "center",
|
@@ -5020,7 +5101,7 @@ var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React35.createElement(Rea
|
|
5020
5101
|
},
|
5021
5102
|
onClick: onChange
|
5022
5103
|
},
|
5023
|
-
/* @__PURE__ */
|
5104
|
+
/* @__PURE__ */ React37.createElement(
|
5024
5105
|
Label3,
|
5025
5106
|
{
|
5026
5107
|
htmlFor: id,
|
@@ -5038,7 +5119,7 @@ var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React35.createElement(Rea
|
|
5038
5119
|
icon,
|
5039
5120
|
label
|
5040
5121
|
),
|
5041
|
-
checked && /* @__PURE__ */
|
5122
|
+
checked && /* @__PURE__ */ React37.createElement(CheckIcon2, { width: 24, height: 24 })
|
5042
5123
|
);
|
5043
5124
|
};
|
5044
5125
|
|
@@ -5047,9 +5128,9 @@ var Header2 = () => {
|
|
5047
5128
|
const roomState = useHMSStore16(selectRoomState4);
|
5048
5129
|
const isMobile = useMedia3(config.media.md);
|
5049
5130
|
if (roomState !== HMSRoomState4.Connected) {
|
5050
|
-
return /* @__PURE__ */
|
5131
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null);
|
5051
5132
|
}
|
5052
|
-
return /* @__PURE__ */
|
5133
|
+
return /* @__PURE__ */ React38.createElement(Flex, { justify: "between", align: "center", css: { position: "relative", height: "100%" } }, /* @__PURE__ */ React38.createElement(Flex, { align: "center", gap: "2", css: { position: "absolute", left: "$10" } }, /* @__PURE__ */ React38.createElement(Logo, null), /* @__PURE__ */ React38.createElement(SpeakerTag, null), isMobile && /* @__PURE__ */ React38.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React38.createElement(LiveStatus, null), /* @__PURE__ */ React38.createElement(RecordingStatus, null))), /* @__PURE__ */ React38.createElement(
|
5053
5134
|
Flex,
|
5054
5135
|
{
|
5055
5136
|
align: "center",
|
@@ -5059,8 +5140,8 @@ var Header2 = () => {
|
|
5059
5140
|
gap: "$4"
|
5060
5141
|
}
|
5061
5142
|
},
|
5062
|
-
/* @__PURE__ */
|
5063
|
-
isMobile ? /* @__PURE__ */
|
5143
|
+
/* @__PURE__ */ React38.createElement(StreamActions, null),
|
5144
|
+
isMobile ? /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(CamaraFlipActions, null), /* @__PURE__ */ React38.createElement(AudioOutputActions, null)) : null
|
5064
5145
|
));
|
5065
5146
|
};
|
5066
5147
|
|
@@ -5071,7 +5152,7 @@ var PostLeave = () => {
|
|
5071
5152
|
const { roomCode } = useHMSPrebuiltContext();
|
5072
5153
|
const { roomId, role } = useParams3();
|
5073
5154
|
const [previewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW, defaultPreviewPreference);
|
5074
|
-
return /* @__PURE__ */
|
5155
|
+
return /* @__PURE__ */ React39.createElement(Flex, { direction: "column", css: { size: "100%" } }, /* @__PURE__ */ React39.createElement(Box, { css: { h: "$18", "@md": { h: "$17" } }, "data-testid": "header" }, /* @__PURE__ */ React39.createElement(Header2, null)), /* @__PURE__ */ React39.createElement(
|
5075
5156
|
Flex,
|
5076
5157
|
{
|
5077
5158
|
justify: "center",
|
@@ -5079,9 +5160,9 @@ var PostLeave = () => {
|
|
5079
5160
|
align: "center",
|
5080
5161
|
css: { bg: "$background_dim", flex: "1 1 0", position: "relative" }
|
5081
5162
|
},
|
5082
|
-
/* @__PURE__ */
|
5083
|
-
/* @__PURE__ */
|
5084
|
-
/* @__PURE__ */
|
5163
|
+
/* @__PURE__ */ React39.createElement(Text, { variant: "h2", css: { fontWeight: "$semiBold" } }, "\u{1F44B}"),
|
5164
|
+
/* @__PURE__ */ React39.createElement(Text, { variant: "h4", css: { color: "$on_surface_high", fontWeight: "$semiBold", mt: "$12" } }, "You left the room"),
|
5165
|
+
/* @__PURE__ */ React39.createElement(
|
5085
5166
|
Text,
|
5086
5167
|
{
|
5087
5168
|
variant: "body1",
|
@@ -5093,10 +5174,10 @@ var PostLeave = () => {
|
|
5093
5174
|
}
|
5094
5175
|
},
|
5095
5176
|
"Have a nice day",
|
5096
|
-
previewPreference.name && /* @__PURE__ */
|
5177
|
+
previewPreference.name && /* @__PURE__ */ React39.createElement(Box, { as: "span", css: __spreadValues({}, textEllipsis(100)) }, ", ", previewPreference.name),
|
5097
5178
|
"!"
|
5098
5179
|
),
|
5099
|
-
/* @__PURE__ */
|
5180
|
+
/* @__PURE__ */ React39.createElement(Flex, { css: { mt: "$14", gap: "$10", alignItems: "center" } }, /* @__PURE__ */ React39.createElement(Text, { variant: "body1", css: { color: "$on_surface_medium", fontWeight: "$regular" } }, "Left by mistake?"), /* @__PURE__ */ React39.createElement(
|
5100
5181
|
Button,
|
5101
5182
|
{
|
5102
5183
|
onClick: () => {
|
@@ -5108,37 +5189,37 @@ var PostLeave = () => {
|
|
5108
5189
|
},
|
5109
5190
|
"data-testid": "join_again_btn"
|
5110
5191
|
},
|
5111
|
-
/* @__PURE__ */
|
5112
|
-
/* @__PURE__ */
|
5192
|
+
/* @__PURE__ */ React39.createElement(ExitIcon, null),
|
5193
|
+
/* @__PURE__ */ React39.createElement(Text, { css: { ml: "$3", fontWeight: "$semiBold", color: "inherit" } }, "Rejoin")
|
5113
5194
|
))
|
5114
5195
|
));
|
5115
5196
|
};
|
5116
5197
|
var PostLeave_default = PostLeave;
|
5117
5198
|
|
5118
5199
|
// src/Prebuilt/components/Preview/PreviewContainer.tsx
|
5119
|
-
import
|
5200
|
+
import React53 from "react";
|
5120
5201
|
import { useNavigate as useNavigate4, useParams as useParams4 } from "react-router-dom";
|
5121
5202
|
import { useSearchParam } from "react-use";
|
5122
5203
|
|
5123
5204
|
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
5124
|
-
import
|
5125
|
-
import { useMedia as
|
5205
|
+
import React52, { Fragment as Fragment4, Suspense, useCallback as useCallback16, useEffect as useEffect23, useState as useState16 } from "react";
|
5206
|
+
import { useMedia as useMedia6 } from "react-use";
|
5126
5207
|
import {
|
5127
5208
|
HMSRoomState as HMSRoomState6,
|
5128
5209
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled5,
|
5129
5210
|
selectLocalPeer,
|
5130
5211
|
selectRoomState as selectRoomState6,
|
5131
|
-
selectVideoTrackByID as
|
5212
|
+
selectVideoTrackByID as selectVideoTrackByID4,
|
5132
5213
|
useAVToggle as useAVToggle2,
|
5133
|
-
useHMSStore as
|
5214
|
+
useHMSStore as useHMSStore21,
|
5134
5215
|
useParticipants,
|
5135
5216
|
usePreviewJoin,
|
5136
5217
|
useRecordingStreaming as useRecordingStreaming4
|
5137
5218
|
} from "@100mslive/react-sdk";
|
5138
|
-
import { MicOffIcon as
|
5219
|
+
import { MicOffIcon as MicOffIcon2, SettingsIcon as SettingsIcon2 } from "@100mslive/react-icons";
|
5139
5220
|
|
5140
5221
|
// src/Prebuilt/components/AudioVideoToggle.jsx
|
5141
|
-
import
|
5222
|
+
import React41, { Fragment as Fragment2 } from "react";
|
5142
5223
|
import {
|
5143
5224
|
DeviceType as DeviceType2,
|
5144
5225
|
HMSRoomState as HMSRoomState5,
|
@@ -5153,7 +5234,7 @@ import {
|
|
5153
5234
|
import { CameraFlipIcon as CameraFlipIcon2, MicOffIcon, MicOnIcon as MicOnIcon3, VideoOffIcon, VideoOnIcon } from "@100mslive/react-icons";
|
5154
5235
|
|
5155
5236
|
// src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx
|
5156
|
-
import
|
5237
|
+
import React40 from "react";
|
5157
5238
|
import { VerticalMenuIcon } from "@100mslive/react-icons";
|
5158
5239
|
var IconSection = styled(IconButton_default, {
|
5159
5240
|
w: "unset",
|
@@ -5205,7 +5286,7 @@ var IconButtonWithOptions = ({
|
|
5205
5286
|
}) => {
|
5206
5287
|
const bgCss = { backgroundColor: disabled ? "$surface_brighter" : active ? "$transparent" : "$secondary_dim" };
|
5207
5288
|
const iconCss = { color: disabled ? "$on_surface_low" : active ? "$on_surface_high" : "$on_primary_high" };
|
5208
|
-
return /* @__PURE__ */
|
5289
|
+
return /* @__PURE__ */ React40.createElement(Flex, null, /* @__PURE__ */ React40.createElement(IconSection, { css: bgCss, onClick }, /* @__PURE__ */ React40.createElement(Tooltip, { disabled: !tooltipMessage, title: tooltipMessage }, /* @__PURE__ */ React40.createElement(Flex, { align: "center", justify: "center", css: iconCss }, icon))), /* @__PURE__ */ React40.createElement(Dropdown.Root, null, /* @__PURE__ */ React40.createElement(
|
5209
5290
|
Dropdown.Trigger,
|
5210
5291
|
{
|
5211
5292
|
asChild: true,
|
@@ -5216,8 +5297,8 @@ var IconButtonWithOptions = ({
|
|
5216
5297
|
}
|
5217
5298
|
}
|
5218
5299
|
},
|
5219
|
-
/* @__PURE__ */
|
5220
|
-
), /* @__PURE__ */
|
5300
|
+
/* @__PURE__ */ React40.createElement(OptionsSection, { css: bgCss }, /* @__PURE__ */ React40.createElement(Tooltip, { title: "View Options" }, /* @__PURE__ */ React40.createElement(Box, { css: iconCss }, /* @__PURE__ */ React40.createElement(VerticalMenuIcon, null))))
|
5301
|
+
), /* @__PURE__ */ React40.createElement(
|
5221
5302
|
Dropdown.Content,
|
5222
5303
|
{
|
5223
5304
|
sideOffset: 5,
|
@@ -5229,7 +5310,7 @@ var IconButtonWithOptions = ({
|
|
5229
5310
|
border: "none"
|
5230
5311
|
}
|
5231
5312
|
},
|
5232
|
-
options.map((option, index) => /* @__PURE__ */
|
5313
|
+
options.map((option, index) => /* @__PURE__ */ React40.createElement(
|
5233
5314
|
Dropdown.Item,
|
5234
5315
|
{
|
5235
5316
|
key: option.title,
|
@@ -5256,7 +5337,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5256
5337
|
const { videoInput, audioInput } = allDevices;
|
5257
5338
|
const formattedVideoInputList = videoInput == null ? void 0 : videoInput.map((videoInput2) => ({
|
5258
5339
|
active: selectedDeviceIDs.videoInput === videoInput2.deviceId,
|
5259
|
-
content: /* @__PURE__ */
|
5340
|
+
content: /* @__PURE__ */ React41.createElement(
|
5260
5341
|
Text,
|
5261
5342
|
{
|
5262
5343
|
variant: "sm",
|
@@ -5272,7 +5353,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5272
5353
|
}));
|
5273
5354
|
const formattedAudioInputList = audioInput == null ? void 0 : audioInput.map((audioInput2) => ({
|
5274
5355
|
active: selectedDeviceIDs.audioInput === audioInput2.deviceId,
|
5275
|
-
content: /* @__PURE__ */
|
5356
|
+
content: /* @__PURE__ */ React41.createElement(
|
5276
5357
|
Text,
|
5277
5358
|
{
|
5278
5359
|
variant: "sm",
|
@@ -5293,7 +5374,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5293
5374
|
const roomState = useHMSStore17(selectRoomState5);
|
5294
5375
|
const hasAudioDevices = (audioInput == null ? void 0 : audioInput.length) > 0;
|
5295
5376
|
const hasVideoDevices = (videoInput == null ? void 0 : videoInput.length) > 0;
|
5296
|
-
return /* @__PURE__ */
|
5377
|
+
return /* @__PURE__ */ React41.createElement(Fragment2, null, toggleAudio ? hideOptions || !hasAudioDevices ? /* @__PURE__ */ React41.createElement(Tooltip, { title: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)` }, /* @__PURE__ */ React41.createElement(
|
5297
5378
|
IconButton_default,
|
5298
5379
|
{
|
5299
5380
|
active: isLocalAudioEnabled,
|
@@ -5303,20 +5384,20 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5303
5384
|
"data-testid": "audio_btn",
|
5304
5385
|
className: "__cancel-drag-event"
|
5305
5386
|
},
|
5306
|
-
!isLocalAudioEnabled ? /* @__PURE__ */
|
5307
|
-
)) : /* @__PURE__ */
|
5387
|
+
!isLocalAudioEnabled ? /* @__PURE__ */ React41.createElement(MicOffIcon, { "data-testid": "audio_off_btn" }) : /* @__PURE__ */ React41.createElement(MicOnIcon3, { "data-testid": "audio_on_btn" })
|
5388
|
+
)) : /* @__PURE__ */ React41.createElement(
|
5308
5389
|
IconButtonWithOptions,
|
5309
5390
|
{
|
5310
5391
|
options: formattedAudioInputList,
|
5311
5392
|
disabled: !toggleAudio,
|
5312
5393
|
onDisabledClick: toggleAudio,
|
5313
5394
|
tooltipMessage: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)`,
|
5314
|
-
icon: !isLocalAudioEnabled ? /* @__PURE__ */
|
5395
|
+
icon: !isLocalAudioEnabled ? /* @__PURE__ */ React41.createElement(MicOffIcon, { "data-testid": "audio_off_btn" }) : /* @__PURE__ */ React41.createElement(MicOnIcon3, { "data-testid": "audio_on_btn" }),
|
5315
5396
|
active: isLocalAudioEnabled,
|
5316
5397
|
onClick: toggleAudio,
|
5317
5398
|
key: "toggleAudio"
|
5318
5399
|
}
|
5319
|
-
) : null, toggleVideo ? hideOptions || !hasVideoDevices ? /* @__PURE__ */
|
5400
|
+
) : null, toggleVideo ? hideOptions || !hasVideoDevices ? /* @__PURE__ */ React41.createElement(Tooltip, { title: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)` }, /* @__PURE__ */ React41.createElement(
|
5320
5401
|
IconButton_default,
|
5321
5402
|
{
|
5322
5403
|
key: "toggleVideo",
|
@@ -5326,20 +5407,20 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5326
5407
|
"data-testid": "video_btn",
|
5327
5408
|
className: "__cancel-drag-event"
|
5328
5409
|
},
|
5329
|
-
!isLocalVideoEnabled ? /* @__PURE__ */
|
5330
|
-
)) : /* @__PURE__ */
|
5410
|
+
!isLocalVideoEnabled ? /* @__PURE__ */ React41.createElement(VideoOffIcon, { "data-testid": "video_off_btn" }) : /* @__PURE__ */ React41.createElement(VideoOnIcon, { "data-testid": "video_on_btn" })
|
5411
|
+
)) : /* @__PURE__ */ React41.createElement(
|
5331
5412
|
IconButtonWithOptions,
|
5332
5413
|
{
|
5333
5414
|
disabled: !toggleVideo,
|
5334
5415
|
onDisabledClick: toggleVideo,
|
5335
5416
|
options: formattedVideoInputList,
|
5336
5417
|
tooltipMessage: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)`,
|
5337
|
-
icon: !isLocalVideoEnabled ? /* @__PURE__ */
|
5418
|
+
icon: !isLocalVideoEnabled ? /* @__PURE__ */ React41.createElement(VideoOffIcon, { "data-testid": "video_off_btn" }) : /* @__PURE__ */ React41.createElement(VideoOnIcon, { "data-testid": "video_on_btn" }),
|
5338
5419
|
key: "toggleVideo",
|
5339
5420
|
active: isLocalVideoEnabled,
|
5340
5421
|
onClick: toggleVideo
|
5341
5422
|
}
|
5342
|
-
) : null, (localVideoTrack == null ? void 0 : localVideoTrack.facingMode) && roomState === HMSRoomState5.Preview ? /* @__PURE__ */
|
5423
|
+
) : null, (localVideoTrack == null ? void 0 : localVideoTrack.facingMode) && roomState === HMSRoomState5.Preview ? /* @__PURE__ */ React41.createElement(Tooltip, { title: "Switch Camera", key: "switchCamera" }, /* @__PURE__ */ React41.createElement(
|
5343
5424
|
IconButton_default,
|
5344
5425
|
{
|
5345
5426
|
onClick: () => __async(void 0, null, function* () {
|
@@ -5353,32 +5434,34 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5353
5434
|
}
|
5354
5435
|
})
|
5355
5436
|
},
|
5356
|
-
/* @__PURE__ */
|
5437
|
+
/* @__PURE__ */ React41.createElement(CameraFlipIcon2, null)
|
5357
5438
|
)) : null);
|
5358
5439
|
};
|
5359
5440
|
|
5360
|
-
// src/Prebuilt/components/Chip.
|
5361
|
-
import
|
5441
|
+
// src/Prebuilt/components/Chip.tsx
|
5442
|
+
import React42 from "react";
|
5362
5443
|
var Chip = ({
|
5363
|
-
icon = /* @__PURE__ */
|
5444
|
+
icon = /* @__PURE__ */ React42.createElement(React42.Fragment, null),
|
5364
5445
|
content = "",
|
5365
5446
|
backgroundColor = "$surface_default",
|
5366
5447
|
textColor = "$on_surface_high",
|
5367
|
-
hideIfNoContent = false
|
5448
|
+
hideIfNoContent = false,
|
5449
|
+
onClick,
|
5450
|
+
css: css2 = {}
|
5368
5451
|
}) => {
|
5369
5452
|
if (hideIfNoContent && !content) {
|
5370
|
-
return;
|
5453
|
+
return null;
|
5371
5454
|
}
|
5372
|
-
return /* @__PURE__ */
|
5455
|
+
return /* @__PURE__ */ React42.createElement(Flex, { align: "center", css: __spreadValues({ backgroundColor, p: "$4 $6", borderRadius: "$4" }, css2), onClick: () => onClick == null ? void 0 : onClick() }, icon, /* @__PURE__ */ React42.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold", color: textColor, ml: "$2" } }, content));
|
5373
5456
|
};
|
5374
5457
|
var Chip_default = Chip;
|
5375
5458
|
|
5376
5459
|
// src/Prebuilt/components/Connection/TileConnection.tsx
|
5377
|
-
import
|
5460
|
+
import React44 from "react";
|
5378
5461
|
import { PinIcon, SpotlightIcon } from "@100mslive/react-icons";
|
5379
5462
|
|
5380
5463
|
// src/Prebuilt/components/Connection/ConnectionIndicator.tsx
|
5381
|
-
import
|
5464
|
+
import React43 from "react";
|
5382
5465
|
import { selectConnectionQualityByPeerID as selectConnectionQualityByPeerID2, useHMSStore as useHMSStore18 } from "@100mslive/react-sdk";
|
5383
5466
|
import { PoorConnectivityIcon as PoorConnectivityIcon2 } from "@100mslive/react-icons";
|
5384
5467
|
|
@@ -5440,10 +5523,10 @@ var ConnectionIndicator = ({
|
|
5440
5523
|
return null;
|
5441
5524
|
}
|
5442
5525
|
if (downlinkQuality === 0) {
|
5443
|
-
return /* @__PURE__ */
|
5526
|
+
return /* @__PURE__ */ React43.createElement(Tooltip, { title: getTooltipText(downlinkQuality) }, /* @__PURE__ */ React43.createElement(Wrapper, { isTile, css: { color: "#ED4C5A" }, "data-testid": "tile_network" }, /* @__PURE__ */ React43.createElement(PoorConnectivityIcon2, null)));
|
5444
5527
|
}
|
5445
5528
|
const size = isTile ? 12 : 16;
|
5446
|
-
return /* @__PURE__ */
|
5529
|
+
return /* @__PURE__ */ React43.createElement(Tooltip, { title: getTooltipText(downlinkQuality) }, /* @__PURE__ */ React43.createElement(Wrapper, { isTile, "data-testid": "tile_network", css: { backgroundColor: hideBg ? "" : "$surface_bright" } }, /* @__PURE__ */ React43.createElement(
|
5447
5530
|
"svg",
|
5448
5531
|
{
|
5449
5532
|
width: size,
|
@@ -5458,7 +5541,7 @@ var ConnectionIndicator = ({
|
|
5458
5541
|
strokeMiterlimit: 2
|
5459
5542
|
}
|
5460
5543
|
},
|
5461
|
-
/* @__PURE__ */
|
5544
|
+
/* @__PURE__ */ React43.createElement(
|
5462
5545
|
"path",
|
5463
5546
|
{
|
5464
5547
|
d: "M6.875 0c2.549.035 4.679.902 6.445 2.648.366.362.45.796.216 1.096-.239.306-.714.34-1.142.072a2.28 2.28 0 0 1-.341-.271C9.24.862 4.924.775 1.992 3.346c-.284.249-.594.419-.983.393-.272-.019-.49-.135-.613-.388-.125-.261-.05-.498.114-.713.073-.092.156-.177.245-.254C2.516.804 4.591.039 6.875 0Z",
|
@@ -5466,7 +5549,7 @@ var ConnectionIndicator = ({
|
|
5466
5549
|
transform: "translate(-.333)"
|
5467
5550
|
}
|
5468
5551
|
),
|
5469
|
-
/* @__PURE__ */
|
5552
|
+
/* @__PURE__ */ React43.createElement(
|
5470
5553
|
"path",
|
5471
5554
|
{
|
5472
5555
|
d: "M7.056 2.964c1.756.035 3.208.7 4.499 1.763.162.134.277.315.354.512.098.251.114.503-.075.72-.193.222-.452.259-.725.198-.293-.066-.518-.247-.738-.443a4.859 4.859 0 0 0-6.198-.26c-.166.127-.318.271-.475.409-.242.211-.513.343-.843.317-.43-.034-.679-.397-.561-.81.062-.211.181-.4.345-.546 1.265-1.162 2.733-1.836 4.417-1.86Z",
|
@@ -5474,14 +5557,14 @@ var ConnectionIndicator = ({
|
|
5474
5557
|
transform: "translate(-.333)"
|
5475
5558
|
}
|
5476
5559
|
),
|
5477
|
-
/* @__PURE__ */
|
5560
|
+
/* @__PURE__ */ React43.createElement(
|
5478
5561
|
"path",
|
5479
5562
|
{
|
5480
5563
|
d: "M7.384,6.052C8.293,6.068 9.157,6.449 9.783,7.108C10.005,7.339 10.157,7.6 10.07,7.942C9.959,8.377 9.435,8.581 9.071,8.243C7.935,7.191 6.356,7.183 5.152,8.183C4.816,8.462 4.6,8.485 4.332,8.27C4.063,8.055 3.998,7.691 4.177,7.358C4.273,7.179 4.414,7.038 4.57,6.911C5.26,6.349 6.149,6.05 7.384,6.052L7.384,6.052Z",
|
5481
5564
|
fill: getColor(2, downlinkQuality, defaultColor, theme2)
|
5482
5565
|
}
|
5483
5566
|
),
|
5484
|
-
/* @__PURE__ */
|
5567
|
+
/* @__PURE__ */ React43.createElement(
|
5485
5568
|
"path",
|
5486
5569
|
{
|
5487
5570
|
d: "M8.214,9.941C8.214,10.234 8.097,10.515 7.888,10.721C7.68,10.928 7.398,11.042 7.104,11.039C6.471,11.036 5.982,10.541 5.993,9.912C6.004,9.259 6.499,8.766 7.133,8.779C7.744,8.791 8.22,9.301 8.214,9.941Z",
|
@@ -5500,7 +5583,7 @@ var TileConnection = ({
|
|
5500
5583
|
spotlighted,
|
5501
5584
|
pinned
|
5502
5585
|
}) => {
|
5503
|
-
return /* @__PURE__ */
|
5586
|
+
return /* @__PURE__ */ React44.createElement(Wrapper2, null, !hideLabel ? /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(Flex, { align: "center" }, pinned && /* @__PURE__ */ React44.createElement(IconWrapper, null, /* @__PURE__ */ React44.createElement(PinIcon, { width: "15", height: "15" })), spotlighted && /* @__PURE__ */ React44.createElement(IconWrapper, null, /* @__PURE__ */ React44.createElement(SpotlightIcon, { width: "15", height: "15" })), /* @__PURE__ */ React44.createElement(
|
5504
5587
|
Text,
|
5505
5588
|
{
|
5506
5589
|
css: __spreadValues({
|
@@ -5510,7 +5593,7 @@ var TileConnection = ({
|
|
5510
5593
|
variant: "xs"
|
5511
5594
|
},
|
5512
5595
|
name
|
5513
|
-
)), /* @__PURE__ */
|
5596
|
+
)), /* @__PURE__ */ React44.createElement(ConnectionIndicator, { isTile: true, peerId, hideBg: true })) : null);
|
5514
5597
|
};
|
5515
5598
|
var IconWrapper = styled("div", { c: "$on_surface_high", ml: "$3", mt: "$1" });
|
5516
5599
|
var Wrapper2 = styled("div", {
|
@@ -5530,7 +5613,7 @@ var Wrapper2 = styled("div", {
|
|
5530
5613
|
var TileConnection_default = TileConnection;
|
5531
5614
|
|
5532
5615
|
// src/Prebuilt/components/Settings/SettingsModal.jsx
|
5533
|
-
import
|
5616
|
+
import React50, { useCallback as useCallback15, useEffect as useEffect22, useState as useState15 } from "react";
|
5534
5617
|
import { useMedia as useMedia4 } from "react-use";
|
5535
5618
|
import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons";
|
5536
5619
|
|
@@ -5538,7 +5621,7 @@ import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons
|
|
5538
5621
|
import { GridFourIcon, NotificationsIcon, SettingsIcon } from "@100mslive/react-icons";
|
5539
5622
|
|
5540
5623
|
// src/Prebuilt/components/Settings/DeviceSettings.jsx
|
5541
|
-
import
|
5624
|
+
import React46, { Fragment as Fragment3, useEffect as useEffect21, useRef as useRef7, useState as useState14 } from "react";
|
5542
5625
|
import {
|
5543
5626
|
DeviceType as DeviceType3,
|
5544
5627
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled3,
|
@@ -5550,10 +5633,10 @@ import {
|
|
5550
5633
|
import { MicOnIcon as MicOnIcon4, SpeakerIcon as SpeakerIcon2, VideoOnIcon as VideoOnIcon2 } from "@100mslive/react-icons";
|
5551
5634
|
|
5552
5635
|
// src/Prebuilt/primitives/DropdownTrigger.jsx
|
5553
|
-
import
|
5636
|
+
import React45 from "react";
|
5554
5637
|
import { ChevronDownIcon as ChevronDownIcon3, ChevronUpIcon as ChevronUpIcon3 } from "@100mslive/react-icons";
|
5555
|
-
var DialogDropdownTrigger =
|
5556
|
-
return /* @__PURE__ */
|
5638
|
+
var DialogDropdownTrigger = React45.forwardRef(({ title, css: css2, open, icon, titleCSS = {} }, ref) => {
|
5639
|
+
return /* @__PURE__ */ React45.createElement(
|
5557
5640
|
Dropdown.Trigger,
|
5558
5641
|
{
|
5559
5642
|
asChild: true,
|
@@ -5567,7 +5650,7 @@ var DialogDropdownTrigger = React43.forwardRef(({ title, css: css2, open, icon,
|
|
5567
5650
|
}, css2),
|
5568
5651
|
ref
|
5569
5652
|
},
|
5570
|
-
/* @__PURE__ */
|
5653
|
+
/* @__PURE__ */ React45.createElement(
|
5571
5654
|
Flex,
|
5572
5655
|
{
|
5573
5656
|
css: {
|
@@ -5578,7 +5661,7 @@ var DialogDropdownTrigger = React43.forwardRef(({ title, css: css2, open, icon,
|
|
5578
5661
|
}
|
5579
5662
|
},
|
5580
5663
|
icon,
|
5581
|
-
/* @__PURE__ */
|
5664
|
+
/* @__PURE__ */ React45.createElement(
|
5582
5665
|
Text,
|
5583
5666
|
{
|
5584
5667
|
css: __spreadValues(__spreadProps(__spreadValues({
|
@@ -5590,7 +5673,7 @@ var DialogDropdownTrigger = React43.forwardRef(({ title, css: css2, open, icon,
|
|
5590
5673
|
},
|
5591
5674
|
title
|
5592
5675
|
),
|
5593
|
-
open ? /* @__PURE__ */
|
5676
|
+
open ? /* @__PURE__ */ React45.createElement(ChevronUpIcon3, null) : /* @__PURE__ */ React45.createElement(ChevronDownIcon3, null)
|
5594
5677
|
)
|
5595
5678
|
);
|
5596
5679
|
});
|
@@ -5615,7 +5698,7 @@ var Settings = ({ setHide }) => {
|
|
5615
5698
|
if (!(videoInput == null ? void 0 : videoInput.length) && !(audioInput == null ? void 0 : audioInput.length) && !(audioOutputFiltered == null ? void 0 : audioOutputFiltered.length)) {
|
5616
5699
|
setHide(true);
|
5617
5700
|
}
|
5618
|
-
return /* @__PURE__ */
|
5701
|
+
return /* @__PURE__ */ React46.createElement(Box, { className: settingOverflow() }, (videoInput == null ? void 0 : videoInput.length) ? /* @__PURE__ */ React46.createElement(Fragment3, null, isVideoOn && /* @__PURE__ */ React46.createElement(
|
5619
5702
|
StyledVideoTile.Container,
|
5620
5703
|
{
|
5621
5704
|
css: {
|
@@ -5626,24 +5709,24 @@ var Settings = ({ setHide }) => {
|
|
5626
5709
|
m: "$10 auto"
|
5627
5710
|
}
|
5628
5711
|
},
|
5629
|
-
/* @__PURE__ */
|
5630
|
-
), /* @__PURE__ */
|
5712
|
+
/* @__PURE__ */ React46.createElement(Video, { trackId: videoTrackId, mirror: (track == null ? void 0 : track.facingMode) !== "environment" && mirrorLocalVideo })
|
5713
|
+
), /* @__PURE__ */ React46.createElement(
|
5631
5714
|
DeviceSelector,
|
5632
5715
|
{
|
5633
5716
|
title: "Video",
|
5634
5717
|
devices: videoInput,
|
5635
|
-
icon: /* @__PURE__ */
|
5718
|
+
icon: /* @__PURE__ */ React46.createElement(VideoOnIcon2, null),
|
5636
5719
|
selection: selectedDeviceIDs.videoInput,
|
5637
5720
|
onChange: (deviceId) => updateDevice({
|
5638
5721
|
deviceId,
|
5639
5722
|
deviceType: DeviceType3.videoInput
|
5640
5723
|
})
|
5641
5724
|
}
|
5642
|
-
)) : null, (audioInput == null ? void 0 : audioInput.length) ? /* @__PURE__ */
|
5725
|
+
)) : null, (audioInput == null ? void 0 : audioInput.length) ? /* @__PURE__ */ React46.createElement(
|
5643
5726
|
DeviceSelector,
|
5644
5727
|
{
|
5645
5728
|
title: shouldShowAudioOutput ? "Microphone" : "Audio",
|
5646
|
-
icon: /* @__PURE__ */
|
5729
|
+
icon: /* @__PURE__ */ React46.createElement(MicOnIcon4, null),
|
5647
5730
|
devices: audioInput,
|
5648
5731
|
selection: selectedDeviceIDs.audioInput,
|
5649
5732
|
onChange: (deviceId) => updateDevice({
|
@@ -5651,11 +5734,11 @@ var Settings = ({ setHide }) => {
|
|
5651
5734
|
deviceType: DeviceType3.audioInput
|
5652
5735
|
})
|
5653
5736
|
}
|
5654
|
-
) : null, (audioOutputFiltered == null ? void 0 : audioOutputFiltered.length) && shouldShowAudioOutput ? /* @__PURE__ */
|
5737
|
+
) : null, (audioOutputFiltered == null ? void 0 : audioOutputFiltered.length) && shouldShowAudioOutput ? /* @__PURE__ */ React46.createElement(
|
5655
5738
|
DeviceSelector,
|
5656
5739
|
{
|
5657
5740
|
title: "Speaker",
|
5658
|
-
icon: /* @__PURE__ */
|
5741
|
+
icon: /* @__PURE__ */ React46.createElement(SpeakerIcon2, null),
|
5659
5742
|
devices: audioOutput,
|
5660
5743
|
selection: selectedDeviceIDs.audioOutput,
|
5661
5744
|
onChange: (deviceId) => updateDevice({
|
@@ -5663,15 +5746,15 @@ var Settings = ({ setHide }) => {
|
|
5663
5746
|
deviceType: DeviceType3.audioOutput
|
5664
5747
|
})
|
5665
5748
|
},
|
5666
|
-
/* @__PURE__ */
|
5749
|
+
/* @__PURE__ */ React46.createElement(TestAudio, { id: selectedDeviceIDs.audioOutput })
|
5667
5750
|
) : null);
|
5668
5751
|
};
|
5669
5752
|
var DeviceSelector = ({ title, devices, selection, onChange, icon, children = null }) => {
|
5670
5753
|
var _a7, _b7;
|
5671
5754
|
const [open, setOpen] = useState14(false);
|
5672
5755
|
const selectionBg = useDropdownSelection();
|
5673
|
-
const ref =
|
5674
|
-
return /* @__PURE__ */
|
5756
|
+
const ref = useRef7(null);
|
5757
|
+
return /* @__PURE__ */ React46.createElement(Box, { css: { mb: "$10" } }, /* @__PURE__ */ React46.createElement(Text, { css: { mb: "$4" } }, title), /* @__PURE__ */ React46.createElement(
|
5675
5758
|
Flex,
|
5676
5759
|
{
|
5677
5760
|
align: "center",
|
@@ -5683,7 +5766,7 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5683
5766
|
}
|
5684
5767
|
}
|
5685
5768
|
},
|
5686
|
-
/* @__PURE__ */
|
5769
|
+
/* @__PURE__ */ React46.createElement(
|
5687
5770
|
Box,
|
5688
5771
|
{
|
5689
5772
|
css: {
|
@@ -5697,7 +5780,7 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5697
5780
|
}
|
5698
5781
|
}
|
5699
5782
|
},
|
5700
|
-
/* @__PURE__ */
|
5783
|
+
/* @__PURE__ */ React46.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React46.createElement(
|
5701
5784
|
DialogDropdownTrigger,
|
5702
5785
|
{
|
5703
5786
|
ref,
|
@@ -5705,8 +5788,8 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5705
5788
|
title: ((_a7 = devices.find(({ deviceId }) => deviceId === selection)) == null ? void 0 : _a7.label) || "Select device from list",
|
5706
5789
|
open
|
5707
5790
|
}
|
5708
|
-
), /* @__PURE__ */
|
5709
|
-
return /* @__PURE__ */
|
5791
|
+
), /* @__PURE__ */ React46.createElement(Dropdown.Portal, null, /* @__PURE__ */ React46.createElement(Dropdown.Content, { align: "start", sideOffset: 8, css: { w: (_b7 = ref.current) == null ? void 0 : _b7.clientWidth, zIndex: 1001 } }, devices.map((device) => {
|
5792
|
+
return /* @__PURE__ */ React46.createElement(
|
5710
5793
|
Dropdown.Item,
|
5711
5794
|
{
|
5712
5795
|
key: device.label,
|
@@ -5725,9 +5808,9 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5725
5808
|
};
|
5726
5809
|
var TEST_AUDIO_URL = "https://100ms.live/test-audio.wav";
|
5727
5810
|
var TestAudio = ({ id }) => {
|
5728
|
-
const audioRef =
|
5811
|
+
const audioRef = useRef7(null);
|
5729
5812
|
const [playing, setPlaying] = useState14(false);
|
5730
|
-
|
5813
|
+
useEffect21(() => {
|
5731
5814
|
if (audioRef.current && id) {
|
5732
5815
|
try {
|
5733
5816
|
if (typeof audioRef.current.setSinkId !== "undefined") {
|
@@ -5738,7 +5821,7 @@ var TestAudio = ({ id }) => {
|
|
5738
5821
|
}
|
5739
5822
|
}
|
5740
5823
|
}, [id]);
|
5741
|
-
return /* @__PURE__ */
|
5824
|
+
return /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(
|
5742
5825
|
Button,
|
5743
5826
|
{
|
5744
5827
|
variant: "standard",
|
@@ -5755,22 +5838,22 @@ var TestAudio = ({ id }) => {
|
|
5755
5838
|
},
|
5756
5839
|
disabled: playing
|
5757
5840
|
},
|
5758
|
-
/* @__PURE__ */
|
5841
|
+
/* @__PURE__ */ React46.createElement(SpeakerIcon2, null),
|
5759
5842
|
"\xA0Test",
|
5760
5843
|
" ",
|
5761
|
-
/* @__PURE__ */
|
5762
|
-
), /* @__PURE__ */
|
5844
|
+
/* @__PURE__ */ React46.createElement(Text, { as: "span", css: { display: "none", "@md": { display: "inline" } } }, "\xA0 speaker")
|
5845
|
+
), /* @__PURE__ */ React46.createElement("audio", { ref: audioRef, src: TEST_AUDIO_URL, onEnded: () => setPlaying(false), onPlay: () => setPlaying(true) }));
|
5763
5846
|
};
|
5764
5847
|
var DeviceSettings_default = Settings;
|
5765
5848
|
|
5766
5849
|
// src/Prebuilt/components/Settings/LayoutSettings.jsx
|
5767
|
-
import
|
5850
|
+
import React48, { useCallback as useCallback14 } from "react";
|
5768
5851
|
import { selectIsLocalScreenShared, selectIsLocalVideoEnabled as selectIsLocalVideoEnabled4, useHMSActions as useHMSActions15, useHMSStore as useHMSStore20 } from "@100mslive/react-sdk";
|
5769
5852
|
|
5770
5853
|
// src/Prebuilt/components/Settings/SwitchWithLabel.jsx
|
5771
|
-
import
|
5854
|
+
import React47 from "react";
|
5772
5855
|
var SwitchWithLabel = ({ label, icon, id, onChange, checked, hide = false }) => {
|
5773
|
-
return /* @__PURE__ */
|
5856
|
+
return /* @__PURE__ */ React47.createElement(
|
5774
5857
|
Flex,
|
5775
5858
|
{
|
5776
5859
|
align: "center",
|
@@ -5782,7 +5865,7 @@ var SwitchWithLabel = ({ label, icon, id, onChange, checked, hide = false }) =>
|
|
5782
5865
|
display: hide ? "none" : "flex"
|
5783
5866
|
}
|
5784
5867
|
},
|
5785
|
-
/* @__PURE__ */
|
5868
|
+
/* @__PURE__ */ React47.createElement(
|
5786
5869
|
Label3,
|
5787
5870
|
{
|
5788
5871
|
htmlFor: id,
|
@@ -5800,7 +5883,7 @@ var SwitchWithLabel = ({ label, icon, id, onChange, checked, hide = false }) =>
|
|
5800
5883
|
icon,
|
5801
5884
|
label
|
5802
5885
|
),
|
5803
|
-
/* @__PURE__ */
|
5886
|
+
/* @__PURE__ */ React47.createElement(Switch, { id, checked, onCheckedChange: onChange })
|
5804
5887
|
);
|
5805
5888
|
};
|
5806
5889
|
var SwitchWithLabel_default = SwitchWithLabel;
|
@@ -5821,7 +5904,7 @@ var LayoutSettings = () => {
|
|
5821
5904
|
}),
|
5822
5905
|
[hmsActions, isLocalVideoEnabled, isLocalScreenShared, setUISettings]
|
5823
5906
|
);
|
5824
|
-
return /* @__PURE__ */
|
5907
|
+
return /* @__PURE__ */ React48.createElement(Box, { className: settingOverflow() }, /* @__PURE__ */ React48.createElement(SwitchWithLabel_default, { label: "Audio Only Mode", id: "audioOnlyMode", checked: isAudioOnly, onChange: toggleIsAudioOnly }), /* @__PURE__ */ React48.createElement(
|
5825
5908
|
SwitchWithLabel_default,
|
5826
5909
|
{
|
5827
5910
|
label: "Mirror Local Video",
|
@@ -5833,7 +5916,7 @@ var LayoutSettings = () => {
|
|
5833
5916
|
});
|
5834
5917
|
}
|
5835
5918
|
}
|
5836
|
-
), /* @__PURE__ */
|
5919
|
+
), /* @__PURE__ */ React48.createElement(Flex, { align: "center", css: { w: "100%", my: "$2", py: "$8", "@md": { display: "none" } } }, /* @__PURE__ */ React48.createElement(Text, { variant: "md", css: { fontWeight: "$semiBold" } }, "Tiles In View(", maxTileCount, ")"), /* @__PURE__ */ React48.createElement(Flex, { justify: "end", css: { flex: "1 1 0" } }, /* @__PURE__ */ React48.createElement(
|
5837
5920
|
Slider,
|
5838
5921
|
{
|
5839
5922
|
step: 1,
|
@@ -5849,11 +5932,11 @@ var LayoutSettings = () => {
|
|
5849
5932
|
};
|
5850
5933
|
|
5851
5934
|
// src/Prebuilt/components/Settings/NotificationSettings.jsx
|
5852
|
-
import
|
5935
|
+
import React49 from "react";
|
5853
5936
|
import { AlertOctagonIcon, HandIcon as HandIcon2, PeopleAddIcon as PeopleAddIcon2, PeopleRemoveIcon as PeopleRemoveIcon2 } from "@100mslive/react-icons";
|
5854
5937
|
var NotificationItem = ({ type, label, icon, checked }) => {
|
5855
5938
|
const [, setSubscribedNotifications] = useSetSubscribedNotifications(type);
|
5856
|
-
return /* @__PURE__ */
|
5939
|
+
return /* @__PURE__ */ React49.createElement(
|
5857
5940
|
SwitchWithLabel_default,
|
5858
5941
|
{
|
5859
5942
|
label,
|
@@ -5868,36 +5951,36 @@ var NotificationItem = ({ type, label, icon, checked }) => {
|
|
5868
5951
|
};
|
5869
5952
|
var NotificationSettings = () => {
|
5870
5953
|
const subscribedNotifications = useSubscribedNotifications();
|
5871
|
-
return /* @__PURE__ */
|
5954
|
+
return /* @__PURE__ */ React49.createElement(Box, { className: settingOverflow() }, /* @__PURE__ */ React49.createElement(
|
5872
5955
|
NotificationItem,
|
5873
5956
|
{
|
5874
5957
|
label: "Peer Joined",
|
5875
5958
|
type: SUBSCRIBED_NOTIFICATIONS.PEER_JOINED,
|
5876
|
-
icon: /* @__PURE__ */
|
5959
|
+
icon: /* @__PURE__ */ React49.createElement(PeopleAddIcon2, null),
|
5877
5960
|
checked: subscribedNotifications.PEER_JOINED
|
5878
5961
|
}
|
5879
|
-
), /* @__PURE__ */
|
5962
|
+
), /* @__PURE__ */ React49.createElement(
|
5880
5963
|
NotificationItem,
|
5881
5964
|
{
|
5882
5965
|
label: "Peer Leave",
|
5883
5966
|
type: SUBSCRIBED_NOTIFICATIONS.PEER_LEFT,
|
5884
|
-
icon: /* @__PURE__ */
|
5967
|
+
icon: /* @__PURE__ */ React49.createElement(PeopleRemoveIcon2, null),
|
5885
5968
|
checked: subscribedNotifications.PEER_LEFT
|
5886
5969
|
}
|
5887
|
-
), /* @__PURE__ */
|
5970
|
+
), /* @__PURE__ */ React49.createElement(
|
5888
5971
|
NotificationItem,
|
5889
5972
|
{
|
5890
5973
|
label: "Hand Raised",
|
5891
5974
|
type: SUBSCRIBED_NOTIFICATIONS.METADATA_UPDATED,
|
5892
|
-
icon: /* @__PURE__ */
|
5975
|
+
icon: /* @__PURE__ */ React49.createElement(HandIcon2, null),
|
5893
5976
|
checked: subscribedNotifications.METADATA_UPDATED
|
5894
5977
|
}
|
5895
|
-
), /* @__PURE__ */
|
5978
|
+
), /* @__PURE__ */ React49.createElement(
|
5896
5979
|
NotificationItem,
|
5897
5980
|
{
|
5898
5981
|
label: "Error",
|
5899
5982
|
type: SUBSCRIBED_NOTIFICATIONS.ERROR,
|
5900
|
-
icon: /* @__PURE__ */
|
5983
|
+
icon: /* @__PURE__ */ React49.createElement(AlertOctagonIcon, null),
|
5901
5984
|
checked: subscribedNotifications.ERROR
|
5902
5985
|
}
|
5903
5986
|
));
|
@@ -5939,7 +6022,7 @@ var settingsList = [
|
|
5939
6022
|
];
|
5940
6023
|
|
5941
6024
|
// src/Prebuilt/components/Settings/SettingsModal.jsx
|
5942
|
-
var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ */
|
6025
|
+
var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ */ React50.createElement(React50.Fragment, null) }) => {
|
5943
6026
|
const mediaQueryLg = config.media.md;
|
5944
6027
|
const isMobile = useMedia4(mediaQueryLg);
|
5945
6028
|
const [showSetting, setShowSetting] = useState15(
|
@@ -5949,7 +6032,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5949
6032
|
(key) => (hide) => setShowSetting((prev) => __spreadProps(__spreadValues({}, prev), { [key]: !hide })),
|
5950
6033
|
[setShowSetting]
|
5951
6034
|
);
|
5952
|
-
|
6035
|
+
useEffect22(() => {
|
5953
6036
|
if (screenType === "hls_live_streaming") {
|
5954
6037
|
hideSettingByTabName("layout")(true);
|
5955
6038
|
}
|
@@ -5961,7 +6044,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5961
6044
|
const resetSelection = useCallback15(() => {
|
5962
6045
|
setSelection("");
|
5963
6046
|
}, []);
|
5964
|
-
|
6047
|
+
useEffect22(() => {
|
5965
6048
|
var _a7;
|
5966
6049
|
if (isMobile) {
|
5967
6050
|
setSelection("");
|
@@ -5970,7 +6053,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5970
6053
|
setSelection(firstNotHiddenTabName);
|
5971
6054
|
}
|
5972
6055
|
}, [isMobile, showSetting]);
|
5973
|
-
return isMobile ? /* @__PURE__ */
|
6056
|
+
return isMobile ? /* @__PURE__ */ React50.createElement(
|
5974
6057
|
MobileSettingModal,
|
5975
6058
|
{
|
5976
6059
|
open,
|
@@ -5982,7 +6065,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5982
6065
|
resetSelection,
|
5983
6066
|
children
|
5984
6067
|
}
|
5985
|
-
) : /* @__PURE__ */
|
6068
|
+
) : /* @__PURE__ */ React50.createElement(
|
5986
6069
|
DesktopSettingModal,
|
5987
6070
|
{
|
5988
6071
|
open,
|
@@ -6004,9 +6087,9 @@ var MobileSettingModal = ({
|
|
6004
6087
|
showSetting,
|
6005
6088
|
hideSettingByTabName,
|
6006
6089
|
resetSelection,
|
6007
|
-
children = /* @__PURE__ */
|
6090
|
+
children = /* @__PURE__ */ React50.createElement(React50.Fragment, null)
|
6008
6091
|
}) => {
|
6009
|
-
return /* @__PURE__ */
|
6092
|
+
return /* @__PURE__ */ React50.createElement(Sheet.Root, { open, onOpenChange }, /* @__PURE__ */ React50.createElement(Sheet.Trigger, { asChild: true }, children), /* @__PURE__ */ React50.createElement(
|
6010
6093
|
Sheet.Content,
|
6011
6094
|
{
|
6012
6095
|
css: {
|
@@ -6014,9 +6097,9 @@ var MobileSettingModal = ({
|
|
6014
6097
|
overflowY: "auto"
|
6015
6098
|
}
|
6016
6099
|
},
|
6017
|
-
/* @__PURE__ */
|
6018
|
-
/* @__PURE__ */
|
6019
|
-
!selection ? /* @__PURE__ */
|
6100
|
+
/* @__PURE__ */ React50.createElement(Sheet.Title, { css: { py: "$10", px: "$8", alignItems: "center" } }, /* @__PURE__ */ React50.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%" } }, !selection ? /* @__PURE__ */ React50.createElement(Text, { variant: "h6", css: { display: "flex" } }, "Settings") : /* @__PURE__ */ React50.createElement(Text, { variant: "h6", css: { display: "flex" } }, /* @__PURE__ */ React50.createElement(Box, { as: "span", css: { r: "$round", mr: "$2" }, onClick: resetSelection }, /* @__PURE__ */ React50.createElement(ChevronLeftIcon, null)), (selection == null ? void 0 : selection.charAt(0).toUpperCase()) + selection.slice(1)), /* @__PURE__ */ React50.createElement(Sheet.Close, null, /* @__PURE__ */ React50.createElement(IconButton, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React50.createElement(CrossIcon6, null))))),
|
6101
|
+
/* @__PURE__ */ React50.createElement(HorizontalDivider, null),
|
6102
|
+
!selection ? /* @__PURE__ */ React50.createElement(
|
6020
6103
|
Flex,
|
6021
6104
|
{
|
6022
6105
|
direction: "column",
|
@@ -6027,7 +6110,7 @@ var MobileSettingModal = ({
|
|
6027
6110
|
}
|
6028
6111
|
},
|
6029
6112
|
settingsList.filter(({ tabName }) => showSetting[tabName]).map(({ icon: Icon2, tabName, title }) => {
|
6030
|
-
return /* @__PURE__ */
|
6113
|
+
return /* @__PURE__ */ React50.createElement(
|
6031
6114
|
Box,
|
6032
6115
|
{
|
6033
6116
|
key: tabName,
|
@@ -6057,18 +6140,18 @@ var MobileSettingModal = ({
|
|
6057
6140
|
borderBottom: "1px solid $border_default"
|
6058
6141
|
}
|
6059
6142
|
},
|
6060
|
-
/* @__PURE__ */
|
6143
|
+
/* @__PURE__ */ React50.createElement(Icon2, null),
|
6061
6144
|
title
|
6062
6145
|
);
|
6063
6146
|
})
|
6064
|
-
) : /* @__PURE__ */
|
6147
|
+
) : /* @__PURE__ */ React50.createElement(
|
6065
6148
|
Box,
|
6066
6149
|
{
|
6067
6150
|
direction: "column",
|
6068
6151
|
css: { overflowY: "scroll", px: "$8", py: "$10", maxHeight: "70vh", overflowX: "hidden" }
|
6069
6152
|
},
|
6070
6153
|
settingsList.filter(({ tabName }) => showSetting[tabName] && selection === tabName).map(({ content: Content10, title, tabName }) => {
|
6071
|
-
return /* @__PURE__ */
|
6154
|
+
return /* @__PURE__ */ React50.createElement(Content10, { key: title, setHide: hideSettingByTabName(tabName) });
|
6072
6155
|
})
|
6073
6156
|
)
|
6074
6157
|
));
|
@@ -6081,9 +6164,9 @@ var DesktopSettingModal = ({
|
|
6081
6164
|
showSetting,
|
6082
6165
|
hideSettingByTabName,
|
6083
6166
|
resetSelection,
|
6084
|
-
children = /* @__PURE__ */
|
6167
|
+
children = /* @__PURE__ */ React50.createElement(React50.Fragment, null)
|
6085
6168
|
}) => {
|
6086
|
-
return /* @__PURE__ */
|
6169
|
+
return /* @__PURE__ */ React50.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React50.createElement(Dialog.Trigger, { asChild: true }, children), /* @__PURE__ */ React50.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React50.createElement(Dialog.Overlay, null), /* @__PURE__ */ React50.createElement(
|
6087
6170
|
Dialog.Content,
|
6088
6171
|
{
|
6089
6172
|
css: {
|
@@ -6093,7 +6176,7 @@ var DesktopSettingModal = ({
|
|
6093
6176
|
r: "$4"
|
6094
6177
|
}
|
6095
6178
|
},
|
6096
|
-
/* @__PURE__ */
|
6179
|
+
/* @__PURE__ */ React50.createElement(
|
6097
6180
|
Tabs.Root,
|
6098
6181
|
{
|
6099
6182
|
value: selection,
|
@@ -6101,7 +6184,7 @@ var DesktopSettingModal = ({
|
|
6101
6184
|
onValueChange: setSelection,
|
6102
6185
|
css: { size: "100%", position: "relative" }
|
6103
6186
|
},
|
6104
|
-
/* @__PURE__ */
|
6187
|
+
/* @__PURE__ */ React50.createElement(
|
6105
6188
|
Tabs.List,
|
6106
6189
|
{
|
6107
6190
|
css: {
|
@@ -6113,12 +6196,12 @@ var DesktopSettingModal = ({
|
|
6113
6196
|
borderBottomLeftRadius: "$4"
|
6114
6197
|
}
|
6115
6198
|
},
|
6116
|
-
/* @__PURE__ */
|
6117
|
-
/* @__PURE__ */
|
6118
|
-
return /* @__PURE__ */
|
6199
|
+
/* @__PURE__ */ React50.createElement(Text, { variant: "h5" }, "Settings "),
|
6200
|
+
/* @__PURE__ */ React50.createElement(Flex, { direction: "column", css: { mx: 0, overflowY: "auto", pt: "$10" } }, settingsList.filter(({ tabName }) => showSetting[tabName]).map(({ icon: Icon2, tabName, title }) => {
|
6201
|
+
return /* @__PURE__ */ React50.createElement(Tabs.Trigger, { key: tabName, value: tabName, css: { gap: "$8" } }, /* @__PURE__ */ React50.createElement(Icon2, null), title);
|
6119
6202
|
}))
|
6120
6203
|
),
|
6121
|
-
selection && /* @__PURE__ */
|
6204
|
+
selection && /* @__PURE__ */ React50.createElement(
|
6122
6205
|
Flex,
|
6123
6206
|
{
|
6124
6207
|
direction: "column",
|
@@ -6129,727 +6212,21 @@ var DesktopSettingModal = ({
|
|
6129
6212
|
}
|
6130
6213
|
},
|
6131
6214
|
settingsList.filter(({ tabName }) => showSetting[tabName]).map(({ content: Content10, title, tabName }) => {
|
6132
|
-
return /* @__PURE__ */
|
6215
|
+
return /* @__PURE__ */ React50.createElement(Tabs.Content, { key: tabName, value: tabName, className: settingContent() }, /* @__PURE__ */ React50.createElement(SettingsContentHeader, { onBack: resetSelection, isMobile: false }, title), /* @__PURE__ */ React50.createElement(Content10, { setHide: hideSettingByTabName(tabName) }));
|
6133
6216
|
})
|
6134
6217
|
)
|
6135
6218
|
),
|
6136
|
-
/* @__PURE__ */
|
6219
|
+
/* @__PURE__ */ React50.createElement(Dialog.Close, { css: { position: "absolute", right: "$10", top: "$10" } }, /* @__PURE__ */ React50.createElement(IconButton, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React50.createElement(CrossIcon6, null)))
|
6137
6220
|
)));
|
6138
6221
|
};
|
6139
6222
|
var SettingsContentHeader = ({ children, isMobile, onBack }) => {
|
6140
|
-
return /* @__PURE__ */
|
6223
|
+
return /* @__PURE__ */ React50.createElement(Text, { variant: "h6", css: { mb: "$12", display: "flex", alignItems: "center" } }, isMobile && /* @__PURE__ */ React50.createElement(Box, { as: "span", css: { bg: "$surface_bright", mr: "$4", r: "$round", p: "$2" }, onClick: onBack }, /* @__PURE__ */ React50.createElement(ChevronLeftIcon, null)), children);
|
6141
6224
|
};
|
6142
6225
|
var SettingsModal_default = SettingsModal;
|
6143
6226
|
|
6144
|
-
// src/Prebuilt/components/VideoTile.jsx
|
6145
|
-
import React53, { Fragment as Fragment5, useCallback as useCallback16, useEffect as useEffect23, useMemo as useMemo3, useRef as useRef7, useState as useState18 } from "react";
|
6146
|
-
import { useMedia as useMedia8 } from "react-use";
|
6147
|
-
import {
|
6148
|
-
selectAudioTrackByPeerID as selectAudioTrackByPeerID2,
|
6149
|
-
selectHasPeerHandRaised as selectHasPeerHandRaised3,
|
6150
|
-
selectIsPeerAudioEnabled,
|
6151
|
-
selectLocalPeerID as selectLocalPeerID5,
|
6152
|
-
selectPeerMetadata as selectPeerMetadata2,
|
6153
|
-
selectPeerNameByID,
|
6154
|
-
selectSessionStore as selectSessionStore3,
|
6155
|
-
selectTrackAudioByID,
|
6156
|
-
selectVideoTrackByID as selectVideoTrackByID4,
|
6157
|
-
selectVideoTrackByPeerID as selectVideoTrackByPeerID3,
|
6158
|
-
useHMSStore as useHMSStore24,
|
6159
|
-
useHMSVanillaStore as useHMSVanillaStore6
|
6160
|
-
} from "@100mslive/react-sdk";
|
6161
|
-
import { BrbTileIcon, HandIcon as HandIcon3, MicOffIcon as MicOffIcon3 } from "@100mslive/react-icons";
|
6162
|
-
|
6163
|
-
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
6164
|
-
import React52, { useState as useState17 } from "react";
|
6165
|
-
import { useMedia as useMedia7 } from "react-use";
|
6166
|
-
import {
|
6167
|
-
selectLocalPeerID as selectLocalPeerID4,
|
6168
|
-
selectPeerByID as selectPeerByID2,
|
6169
|
-
selectPermissions as selectPermissions3,
|
6170
|
-
selectTrackByID as selectTrackByID3,
|
6171
|
-
selectVideoTrackByPeerID as selectVideoTrackByPeerID2,
|
6172
|
-
useHMSStore as useHMSStore23,
|
6173
|
-
useRemoteAVToggle as useRemoteAVToggle2
|
6174
|
-
} from "@100mslive/react-sdk";
|
6175
|
-
import { CrossIcon as CrossIcon8, VerticalMenuIcon as VerticalMenuIcon2 } from "@100mslive/react-icons";
|
6176
|
-
|
6177
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
6178
|
-
import React50, { useState as useState16 } from "react";
|
6179
|
-
import { useMedia as useMedia5 } from "react-use";
|
6180
|
-
import { selectLocalPeerName, useHMSActions as useHMSActions16, useHMSStore as useHMSStore21 } from "@100mslive/react-sdk";
|
6181
|
-
|
6182
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx
|
6183
|
-
import React49 from "react";
|
6184
|
-
import { ChevronLeftIcon as ChevronLeftIcon2, CrossIcon as CrossIcon7 } from "@100mslive/react-icons";
|
6185
|
-
var ChangeNameContent = ({
|
6186
|
-
changeName,
|
6187
|
-
setCurrentName,
|
6188
|
-
currentName,
|
6189
|
-
localPeerName,
|
6190
|
-
isMobile,
|
6191
|
-
onExit,
|
6192
|
-
onBackClick
|
6193
|
-
}) => {
|
6194
|
-
return /* @__PURE__ */ React49.createElement(
|
6195
|
-
"form",
|
6196
|
-
{
|
6197
|
-
onSubmit: (e) => __async(void 0, null, function* () {
|
6198
|
-
e.preventDefault();
|
6199
|
-
yield changeName();
|
6200
|
-
})
|
6201
|
-
},
|
6202
|
-
/* @__PURE__ */ React49.createElement(
|
6203
|
-
Text,
|
6204
|
-
{
|
6205
|
-
variant: isMobile ? "md" : "lg",
|
6206
|
-
css: {
|
6207
|
-
color: "$on_surface_high",
|
6208
|
-
fontWeight: "$semiBold",
|
6209
|
-
display: "flex",
|
6210
|
-
pb: "$4",
|
6211
|
-
"@md": { px: "$8", borderBottom: "1px solid $border_default" }
|
6212
|
-
}
|
6213
|
-
},
|
6214
|
-
isMobile ? /* @__PURE__ */ React49.createElement(ChevronLeftIcon2, { onClick: onBackClick, style: { marginRight: "0.5rem" } }) : null,
|
6215
|
-
"Change Name",
|
6216
|
-
/* @__PURE__ */ React49.createElement(
|
6217
|
-
Box,
|
6218
|
-
{
|
6219
|
-
css: { color: "inherit", ml: "auto", "&:hover": { color: "$on_surface_medium", cursor: "pointer" } },
|
6220
|
-
onClick: onExit
|
6221
|
-
},
|
6222
|
-
/* @__PURE__ */ React49.createElement(CrossIcon7, null)
|
6223
|
-
)
|
6224
|
-
),
|
6225
|
-
/* @__PURE__ */ React49.createElement(Text, { variant: "sm", css: { color: "$on_surface_medium", pb: "$6", mb: "$8", "@md": { px: "$8", mt: "$4" } } }, "Your name will be visible to other participants in the session."),
|
6226
|
-
/* @__PURE__ */ React49.createElement(Flex, { justify: "center", align: "center", css: { my: "$8", w: "100%", "@md": { px: "$8" } } }, /* @__PURE__ */ React49.createElement(
|
6227
|
-
Input,
|
6228
|
-
{
|
6229
|
-
css: { width: "100%", bg: "$surface_default" },
|
6230
|
-
value: currentName,
|
6231
|
-
type: isMobile ? "search" : "text",
|
6232
|
-
onChange: (e) => {
|
6233
|
-
setCurrentName(e.target.value);
|
6234
|
-
},
|
6235
|
-
autoComplete: "name",
|
6236
|
-
required: true,
|
6237
|
-
"data-testid": "change_name_field",
|
6238
|
-
onKeyDown: (e) => __async(void 0, null, function* () {
|
6239
|
-
if (e.key === "Enter" && currentName.trim().length > 0 && currentName !== localPeerName) {
|
6240
|
-
e.preventDefault();
|
6241
|
-
if (isMobile) {
|
6242
|
-
return;
|
6243
|
-
}
|
6244
|
-
changeName();
|
6245
|
-
}
|
6246
|
-
})
|
6247
|
-
}
|
6248
|
-
)),
|
6249
|
-
/* @__PURE__ */ React49.createElement(
|
6250
|
-
Flex,
|
6251
|
-
{
|
6252
|
-
justify: "between",
|
6253
|
-
align: "center",
|
6254
|
-
css: {
|
6255
|
-
width: "100%",
|
6256
|
-
gap: "$md",
|
6257
|
-
mt: "$10",
|
6258
|
-
"@md": { px: "$4" }
|
6259
|
-
}
|
6260
|
-
},
|
6261
|
-
isMobile ? null : /* @__PURE__ */ React49.createElement(
|
6262
|
-
Button,
|
6263
|
-
{
|
6264
|
-
variant: "standard",
|
6265
|
-
css: { w: "100%" },
|
6266
|
-
outlined: true,
|
6267
|
-
type: "submit",
|
6268
|
-
disabled: !localPeerName,
|
6269
|
-
onClick: onExit
|
6270
|
-
},
|
6271
|
-
"Cancel"
|
6272
|
-
),
|
6273
|
-
/* @__PURE__ */ React49.createElement(
|
6274
|
-
Button,
|
6275
|
-
{
|
6276
|
-
variant: "primary",
|
6277
|
-
css: { width: "100%" },
|
6278
|
-
type: "submit",
|
6279
|
-
disabled: !currentName.trim() || currentName.trim() === localPeerName,
|
6280
|
-
"data-testid": "popup_change_btn"
|
6281
|
-
},
|
6282
|
-
"Change"
|
6283
|
-
)
|
6284
|
-
)
|
6285
|
-
);
|
6286
|
-
};
|
6287
|
-
|
6288
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
6289
|
-
var ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
6290
|
-
const [previewPreference, setPreviewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW);
|
6291
|
-
const hmsActions = useHMSActions16();
|
6292
|
-
const localPeerName = useHMSStore21(selectLocalPeerName);
|
6293
|
-
const [currentName, setCurrentName] = useState16(localPeerName);
|
6294
|
-
const isMobile = useMedia5(config.media.md);
|
6295
|
-
const changeName = () => __async(void 0, null, function* () {
|
6296
|
-
const name = currentName.trim();
|
6297
|
-
if (!name || name === localPeerName) {
|
6298
|
-
return;
|
6299
|
-
}
|
6300
|
-
try {
|
6301
|
-
yield hmsActions.changeName(name);
|
6302
|
-
setPreviewPreference(__spreadProps(__spreadValues({}, previewPreference || {}), {
|
6303
|
-
name
|
6304
|
-
}));
|
6305
|
-
} catch (error) {
|
6306
|
-
console.error("failed to update name", error);
|
6307
|
-
ToastManager.addToast({ title: error.message });
|
6308
|
-
} finally {
|
6309
|
-
onOpenChange(false);
|
6310
|
-
}
|
6311
|
-
});
|
6312
|
-
const props = {
|
6313
|
-
changeName,
|
6314
|
-
setCurrentName,
|
6315
|
-
currentName,
|
6316
|
-
localPeerName,
|
6317
|
-
isMobile,
|
6318
|
-
onExit: () => onOpenChange(false),
|
6319
|
-
onBackClick: () => {
|
6320
|
-
onOpenChange(false);
|
6321
|
-
openParentSheet();
|
6322
|
-
}
|
6323
|
-
};
|
6324
|
-
if (isMobile) {
|
6325
|
-
return /* @__PURE__ */ React50.createElement(Sheet.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React50.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$8 0" } }, /* @__PURE__ */ React50.createElement(ChangeNameContent, __spreadValues({}, props))));
|
6326
|
-
}
|
6327
|
-
return /* @__PURE__ */ React50.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React50.createElement(Dialog.Portal, null, /* @__PURE__ */ React50.createElement(Dialog.Overlay, null), /* @__PURE__ */ React50.createElement(Dialog.Content, { css: { bg: "$surface_dim", width: "min(400px,80%)", p: "$10" } }, /* @__PURE__ */ React50.createElement(ChangeNameContent, __spreadValues({}, props)))));
|
6328
|
-
};
|
6329
|
-
|
6330
|
-
// src/Prebuilt/components/TileMenu/TileMenuContent.jsx
|
6331
|
-
import React51, { Fragment as Fragment4 } from "react";
|
6332
|
-
import { useMedia as useMedia6 } from "react-use";
|
6333
|
-
import {
|
6334
|
-
selectPermissions as selectPermissions2,
|
6335
|
-
selectSessionStore as selectSessionStore2,
|
6336
|
-
selectTrackByID as selectTrackByID2,
|
6337
|
-
useCustomEvent as useCustomEvent2,
|
6338
|
-
useHMSActions as useHMSActions17,
|
6339
|
-
useHMSStore as useHMSStore22,
|
6340
|
-
useRemoteAVToggle
|
6341
|
-
} from "@100mslive/react-sdk";
|
6342
|
-
import {
|
6343
|
-
MicOffIcon as MicOffIcon2,
|
6344
|
-
MicOnIcon as MicOnIcon5,
|
6345
|
-
PencilIcon,
|
6346
|
-
PinIcon as PinIcon2,
|
6347
|
-
RemoveUserIcon,
|
6348
|
-
ShareScreenIcon as ShareScreenIcon2,
|
6349
|
-
ShrinkIcon,
|
6350
|
-
SpeakerIcon as SpeakerIcon3,
|
6351
|
-
StarIcon,
|
6352
|
-
VideoOffIcon as VideoOffIcon2,
|
6353
|
-
VideoOnIcon as VideoOnIcon3
|
6354
|
-
} from "@100mslive/react-icons";
|
6355
|
-
var isSameTile = ({ trackId, videoTrackID, audioTrackID }) => trackId && (videoTrackID && videoTrackID === trackId || audioTrackID && audioTrackID === trackId);
|
6356
|
-
var spacingCSS = { "@md": { my: "$8", fontWeight: "$semiBold", fontSize: "sm" } };
|
6357
|
-
var SpotlightActions = ({
|
6358
|
-
peerId,
|
6359
|
-
onSpotLightClick = () => {
|
6360
|
-
return;
|
6361
|
-
}
|
6362
|
-
}) => {
|
6363
|
-
const hmsActions = useHMSActions17();
|
6364
|
-
const spotlightPeerId = useHMSStore22(selectSessionStore2(SESSION_STORE_KEY.SPOTLIGHT));
|
6365
|
-
const isTileSpotlighted = spotlightPeerId === peerId;
|
6366
|
-
const setSpotlightPeerId = (peer) => hmsActions.sessionStore.set(SESSION_STORE_KEY.SPOTLIGHT, peer).catch((err) => ToastManager.addToast({ title: err.description }));
|
6367
|
-
return /* @__PURE__ */ React51.createElement(
|
6368
|
-
StyledMenuTile.ItemButton,
|
6369
|
-
{
|
6370
|
-
css: spacingCSS,
|
6371
|
-
onClick: () => {
|
6372
|
-
if (isTileSpotlighted) {
|
6373
|
-
setSpotlightPeerId();
|
6374
|
-
} else {
|
6375
|
-
setSpotlightPeerId(peerId);
|
6376
|
-
}
|
6377
|
-
onSpotLightClick();
|
6378
|
-
}
|
6379
|
-
},
|
6380
|
-
/* @__PURE__ */ React51.createElement(StarIcon, { height: 20, width: 20 }),
|
6381
|
-
/* @__PURE__ */ React51.createElement("span", null, isTileSpotlighted ? "Remove from Spotlight" : "Spotlight Tile for everyone")
|
6382
|
-
);
|
6383
|
-
};
|
6384
|
-
var PinActions = ({ audioTrackID, videoTrackID }) => {
|
6385
|
-
const [pinnedTrackId, setPinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
6386
|
-
const isTilePinned = isSameTile({
|
6387
|
-
trackId: pinnedTrackId,
|
6388
|
-
videoTrackID,
|
6389
|
-
audioTrackID
|
6390
|
-
});
|
6391
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(
|
6392
|
-
StyledMenuTile.ItemButton,
|
6393
|
-
{
|
6394
|
-
css: spacingCSS,
|
6395
|
-
onClick: () => isTilePinned ? setPinnedTrackId() : setPinnedTrackId(videoTrackID || audioTrackID)
|
6396
|
-
},
|
6397
|
-
/* @__PURE__ */ React51.createElement(PinIcon2, { height: 20, width: 20 }),
|
6398
|
-
/* @__PURE__ */ React51.createElement("span", null, isTilePinned ? "Unpin" : "Pin", " Tile for myself")
|
6399
|
-
));
|
6400
|
-
};
|
6401
|
-
var MinimiseInset = () => {
|
6402
|
-
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
6403
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, { css: spacingCSS, onClick: () => setMinimised(!minimised) }, /* @__PURE__ */ React51.createElement(ShrinkIcon, { height: 20, width: 20 }), /* @__PURE__ */ React51.createElement("span", null, minimised ? "Show" : "Minimise", " your video")));
|
6404
|
-
};
|
6405
|
-
var SimulcastLayers = ({ trackId }) => {
|
6406
|
-
var _a7;
|
6407
|
-
const track = useHMSStore22(selectTrackByID2(trackId));
|
6408
|
-
const actions = useHMSActions17();
|
6409
|
-
const bg = useDropdownSelection();
|
6410
|
-
if (!((_a7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _a7.length) || track.degraded || !track.enabled) {
|
6411
|
-
return null;
|
6412
|
-
}
|
6413
|
-
const currentLayer = track.layerDefinitions.find((layer) => layer.layer === track.layer);
|
6414
|
-
return /* @__PURE__ */ React51.createElement(Fragment4, null, /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, { css: { color: "$on_surface_medium", cursor: "default" } }, "Select maximum resolution"), track.layerDefinitions.map((layer) => {
|
6415
|
-
return /* @__PURE__ */ React51.createElement(
|
6416
|
-
StyledMenuTile.ItemButton,
|
6417
|
-
{
|
6418
|
-
key: layer.layer,
|
6419
|
-
onClick: () => __async(void 0, null, function* () {
|
6420
|
-
yield actions.setPreferredLayer(trackId, layer.layer);
|
6421
|
-
}),
|
6422
|
-
css: {
|
6423
|
-
justifyContent: "space-between",
|
6424
|
-
bg: track.preferredLayer === layer.layer ? bg : void 0,
|
6425
|
-
"&:hover": {
|
6426
|
-
bg: track.preferredLayer === layer.layer ? bg : void 0
|
6427
|
-
}
|
6428
|
-
}
|
6429
|
-
},
|
6430
|
-
/* @__PURE__ */ React51.createElement(
|
6431
|
-
Text,
|
6432
|
-
{
|
6433
|
-
as: "span",
|
6434
|
-
css: {
|
6435
|
-
textTransform: "capitalize",
|
6436
|
-
mr: "$2",
|
6437
|
-
fontWeight: track.preferredLayer === layer.layer ? "$semiBold" : "$regular",
|
6438
|
-
color: track.preferredLayer === layer.layer ? "$on_primary_high" : "$on_surface_high"
|
6439
|
-
}
|
6440
|
-
},
|
6441
|
-
layer.layer
|
6442
|
-
),
|
6443
|
-
/* @__PURE__ */ React51.createElement(
|
6444
|
-
Text,
|
6445
|
-
{
|
6446
|
-
as: "span",
|
6447
|
-
variant: "xs",
|
6448
|
-
css: {
|
6449
|
-
color: track.preferredLayer === layer.layer ? "$on_primary_high" : "$on_surface_high"
|
6450
|
-
}
|
6451
|
-
},
|
6452
|
-
layer.resolution.width,
|
6453
|
-
"x",
|
6454
|
-
layer.resolution.height
|
6455
|
-
)
|
6456
|
-
);
|
6457
|
-
}), /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, null, /* @__PURE__ */ React51.createElement(Text, { as: "span", variant: "xs", css: { color: "$on_surface_medium" } }, "Currently streaming:", /* @__PURE__ */ React51.createElement(
|
6458
|
-
Text,
|
6459
|
-
{
|
6460
|
-
as: "span",
|
6461
|
-
variant: "xs",
|
6462
|
-
css: {
|
6463
|
-
fontWeight: "$semiBold",
|
6464
|
-
textTransform: "capitalize",
|
6465
|
-
color: "$on_surface_medium",
|
6466
|
-
ml: "$2"
|
6467
|
-
}
|
6468
|
-
},
|
6469
|
-
currentLayer ? /* @__PURE__ */ React51.createElement(React51.Fragment, null, track.layer, " (", currentLayer.resolution.width, "x", currentLayer.resolution.height, ")") : "-"
|
6470
|
-
))));
|
6471
|
-
};
|
6472
|
-
var TileMenuContent = (props) => {
|
6473
|
-
const actions = useHMSActions17();
|
6474
|
-
const { removeOthers } = useHMSStore22(selectPermissions2);
|
6475
|
-
const {
|
6476
|
-
videoTrackID,
|
6477
|
-
audioTrackID,
|
6478
|
-
isLocal,
|
6479
|
-
isScreenshare,
|
6480
|
-
showSpotlight,
|
6481
|
-
showPinAction,
|
6482
|
-
peerID,
|
6483
|
-
canMinimise,
|
6484
|
-
closeSheetOnClick = () => {
|
6485
|
-
return;
|
6486
|
-
},
|
6487
|
-
openNameChangeModal = () => {
|
6488
|
-
return;
|
6489
|
-
}
|
6490
|
-
} = props;
|
6491
|
-
const { isAudioEnabled, isVideoEnabled, setVolume, toggleAudio, toggleVideo, volume } = useRemoteAVToggle(
|
6492
|
-
audioTrackID,
|
6493
|
-
videoTrackID
|
6494
|
-
);
|
6495
|
-
const { sendEvent } = useCustomEvent2({
|
6496
|
-
type: REMOTE_STOP_SCREENSHARE_TYPE
|
6497
|
-
});
|
6498
|
-
const isMobile = useMedia6(config.media.md);
|
6499
|
-
return isLocal ? (showPinAction || canMinimise) && /* @__PURE__ */ React51.createElement(React51.Fragment, null, showPinAction && /* @__PURE__ */ React51.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React51.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() }), canMinimise && /* @__PURE__ */ React51.createElement(MinimiseInset, null), /* @__PURE__ */ React51.createElement(
|
6500
|
-
StyledMenuTile.ItemButton,
|
6501
|
-
{
|
6502
|
-
onClick: () => {
|
6503
|
-
openNameChangeModal();
|
6504
|
-
closeSheetOnClick();
|
6505
|
-
}
|
6506
|
-
},
|
6507
|
-
/* @__PURE__ */ React51.createElement(PencilIcon, { height: 20, width: 20 }),
|
6508
|
-
/* @__PURE__ */ React51.createElement(Text, { variant: "sm", css: { "@md": { fontWeight: "$semiBold" }, c: "$on_surface_high" } }, "Change Name")
|
6509
|
-
)) : /* @__PURE__ */ React51.createElement(React51.Fragment, null, toggleVideo ? /* @__PURE__ */ React51.createElement(
|
6510
|
-
StyledMenuTile.ItemButton,
|
6511
|
-
{
|
6512
|
-
css: spacingCSS,
|
6513
|
-
onClick: () => {
|
6514
|
-
toggleVideo();
|
6515
|
-
closeSheetOnClick();
|
6516
|
-
},
|
6517
|
-
"data-testid": isVideoEnabled ? "mute_video_participant_btn" : "unmute_video_participant_btn"
|
6518
|
-
},
|
6519
|
-
isVideoEnabled ? /* @__PURE__ */ React51.createElement(VideoOnIcon3, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(VideoOffIcon2, { height: 20, width: 20 }),
|
6520
|
-
/* @__PURE__ */ React51.createElement("span", null, isVideoEnabled ? "Mute" : "Request Unmute")
|
6521
|
-
) : null, toggleAudio ? /* @__PURE__ */ React51.createElement(
|
6522
|
-
StyledMenuTile.ItemButton,
|
6523
|
-
{
|
6524
|
-
css: spacingCSS,
|
6525
|
-
onClick: () => {
|
6526
|
-
toggleAudio();
|
6527
|
-
closeSheetOnClick();
|
6528
|
-
},
|
6529
|
-
"data-testid": isVideoEnabled ? "mute_audio_participant_btn" : "unmute_audio_participant_btn"
|
6530
|
-
},
|
6531
|
-
isAudioEnabled ? /* @__PURE__ */ React51.createElement(MicOnIcon5, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(MicOffIcon2, { height: 20, width: 20 }),
|
6532
|
-
/* @__PURE__ */ React51.createElement("span", null, isAudioEnabled ? "Mute" : "Request Unmute")
|
6533
|
-
) : null, audioTrackID ? /* @__PURE__ */ React51.createElement(StyledMenuTile.VolumeItem, { "data-testid": "participant_volume_slider", css: __spreadProps(__spreadValues({}, spacingCSS), { mb: "$0" }) }, /* @__PURE__ */ React51.createElement(Flex, { align: "center", gap: 1 }, /* @__PURE__ */ React51.createElement(SpeakerIcon3, { height: 20, width: 20 }), /* @__PURE__ */ React51.createElement(Box, { as: "span", css: { ml: "$4" } }, "Volume (", volume, ")")), /* @__PURE__ */ React51.createElement(Slider, { css: { my: "0.5rem" }, step: 5, value: [volume], onValueChange: (e) => setVolume(e[0]) })) : null, showPinAction && /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React51.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() })), isMobile ? null : /* @__PURE__ */ React51.createElement(SimulcastLayers, { trackId: videoTrackID }), removeOthers ? /* @__PURE__ */ React51.createElement(
|
6534
|
-
StyledMenuTile.RemoveItem,
|
6535
|
-
{
|
6536
|
-
css: __spreadProps(__spreadValues({}, spacingCSS), { borderTop: "none" }),
|
6537
|
-
onClick: () => __async(void 0, null, function* () {
|
6538
|
-
try {
|
6539
|
-
yield actions.removePeer(peerID, "");
|
6540
|
-
} catch (error) {
|
6541
|
-
}
|
6542
|
-
closeSheetOnClick();
|
6543
|
-
}),
|
6544
|
-
"data-testid": "remove_participant_btn"
|
6545
|
-
},
|
6546
|
-
/* @__PURE__ */ React51.createElement(RemoveUserIcon, { height: 20, width: 20 }),
|
6547
|
-
/* @__PURE__ */ React51.createElement("span", null, "Remove Participant")
|
6548
|
-
) : null, removeOthers && isScreenshare ? /* @__PURE__ */ React51.createElement(
|
6549
|
-
StyledMenuTile.RemoveItem,
|
6550
|
-
{
|
6551
|
-
onClick: () => {
|
6552
|
-
sendEvent({});
|
6553
|
-
closeSheetOnClick();
|
6554
|
-
},
|
6555
|
-
css: spacingCSS
|
6556
|
-
},
|
6557
|
-
/* @__PURE__ */ React51.createElement(ShareScreenIcon2, { height: 20, width: 20 }),
|
6558
|
-
/* @__PURE__ */ React51.createElement("span", null, "Stop Screenshare")
|
6559
|
-
) : null);
|
6560
|
-
};
|
6561
|
-
|
6562
|
-
// src/Prebuilt/components/hooks/useDropdownList.jsx
|
6563
|
-
import { useEffect as useEffect22 } from "react";
|
6564
|
-
var useDropdownList = ({ name, open }) => {
|
6565
|
-
const [dropdownList = [], setDropdownList] = useSetAppDataByKey(APP_DATA.dropdownList);
|
6566
|
-
useEffect22(() => {
|
6567
|
-
if (open) {
|
6568
|
-
if (!dropdownList.includes(name)) {
|
6569
|
-
setDropdownList([...dropdownList, name]);
|
6570
|
-
}
|
6571
|
-
} else {
|
6572
|
-
const index = dropdownList.indexOf(name);
|
6573
|
-
if (index >= 0) {
|
6574
|
-
const newDropdownList = [...dropdownList];
|
6575
|
-
newDropdownList.splice(index, 1);
|
6576
|
-
setDropdownList(newDropdownList);
|
6577
|
-
}
|
6578
|
-
}
|
6579
|
-
}, [open, name]);
|
6580
|
-
};
|
6581
|
-
|
6582
|
-
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
6583
|
-
var TileMenu = ({
|
6584
|
-
audioTrackID,
|
6585
|
-
videoTrackID,
|
6586
|
-
peerID,
|
6587
|
-
isScreenshare = false,
|
6588
|
-
canMinimise,
|
6589
|
-
enableSpotlightingPeer = true
|
6590
|
-
}) => {
|
6591
|
-
var _a7, _b7;
|
6592
|
-
const [open, setOpen] = useState17(false);
|
6593
|
-
const { theme: theme2 } = useTheme();
|
6594
|
-
const localPeerID = useHMSStore23(selectLocalPeerID4);
|
6595
|
-
const isLocal = localPeerID === peerID;
|
6596
|
-
const { removeOthers } = useHMSStore23(selectPermissions3);
|
6597
|
-
const { setVolume, toggleAudio, toggleVideo } = useRemoteAVToggle2(audioTrackID, videoTrackID);
|
6598
|
-
const showSpotlight = enableSpotlightingPeer;
|
6599
|
-
const isPrimaryVideoTrack = ((_a7 = useHMSStore23(selectVideoTrackByPeerID2(peerID))) == null ? void 0 : _a7.id) === videoTrackID;
|
6600
|
-
const showPinAction = audioTrackID || videoTrackID && isPrimaryVideoTrack;
|
6601
|
-
const track = useHMSStore23(selectTrackByID3(videoTrackID));
|
6602
|
-
const hideSimulcastLayers = !((_b7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _b7.length) || track.degraded || !track.enabled;
|
6603
|
-
const isMobile = useMedia7(config.media.md);
|
6604
|
-
const peer = useHMSStore23(selectPeerByID2(peerID));
|
6605
|
-
const [showNameChangeModal, setShowNameChangeModal] = useState17(false);
|
6606
|
-
useDropdownList({ open, name: "TileMenu" });
|
6607
|
-
if (!(removeOthers || toggleAudio || toggleVideo || setVolume || showPinAction) && hideSimulcastLayers) {
|
6608
|
-
return null;
|
6609
|
-
}
|
6610
|
-
const openNameChangeModal = () => setShowNameChangeModal(true);
|
6611
|
-
const props = {
|
6612
|
-
isLocal,
|
6613
|
-
isScreenshare,
|
6614
|
-
audioTrackID,
|
6615
|
-
videoTrackID,
|
6616
|
-
peerID,
|
6617
|
-
isPrimaryVideoTrack,
|
6618
|
-
showSpotlight,
|
6619
|
-
showPinAction,
|
6620
|
-
canMinimise,
|
6621
|
-
openNameChangeModal
|
6622
|
-
};
|
6623
|
-
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(StyledMenuTile.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React52.createElement(
|
6624
|
-
StyledMenuTile.Trigger,
|
6625
|
-
{
|
6626
|
-
"data-testid": "participant_menu_btn",
|
6627
|
-
css: { bg: `${theme2.colors.background_dim.value}A3`, p: "$2", w: "unset", h: "unset" },
|
6628
|
-
onClick: (e) => e.stopPropagation(),
|
6629
|
-
className: isMobile ? "__cancel-drag-event" : ""
|
6630
|
-
},
|
6631
|
-
/* @__PURE__ */ React52.createElement(VerticalMenuIcon2, { width: 20, height: 20 })
|
6632
|
-
), isMobile ? /* @__PURE__ */ React52.createElement(Sheet.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React52.createElement(Sheet.Content, { css: { bg: "$surface_dim", pt: "$8" } }, /* @__PURE__ */ React52.createElement(
|
6633
|
-
Flex,
|
6634
|
-
{
|
6635
|
-
css: {
|
6636
|
-
color: "$on_surface_high",
|
6637
|
-
display: "flex",
|
6638
|
-
w: "100%",
|
6639
|
-
justifyContent: "space-between",
|
6640
|
-
alignItems: "center",
|
6641
|
-
px: "$10",
|
6642
|
-
pb: "$8",
|
6643
|
-
borderBottom: "1px solid $border_default"
|
6644
|
-
}
|
6645
|
-
},
|
6646
|
-
/* @__PURE__ */ React52.createElement(Box, null, /* @__PURE__ */ React52.createElement(Text, { css: { color: "$on_surface_high", fontWeight: "$semiBold" } }, peer.name, isLocal ? ` (You)` : null), (peer == null ? void 0 : peer.roleName) ? /* @__PURE__ */ React52.createElement(Text, { variant: "xs", css: { color: "$on_surface_low", mt: "$2" } }, peer.roleName) : null),
|
6647
|
-
/* @__PURE__ */ React52.createElement(Sheet.Close, { css: { color: "inherit" } }, /* @__PURE__ */ React52.createElement(CrossIcon8, null))
|
6648
|
-
), /* @__PURE__ */ React52.createElement(Box, { css: { px: "$8", pb: "$8", maxHeight: "80vh", overflowY: "auto" } }, /* @__PURE__ */ React52.createElement(TileMenuContent, __spreadProps(__spreadValues({}, props), { closeSheetOnClick: () => setOpen(false) }))))) : /* @__PURE__ */ React52.createElement(StyledMenuTile.Content, { side: "top", align: "end", css: { maxHeight: "$80", overflowY: "auto" } }, /* @__PURE__ */ React52.createElement(TileMenuContent, __spreadValues({}, props)))), showNameChangeModal && /* @__PURE__ */ React52.createElement(ChangeNameModal, { onOpenChange: setShowNameChangeModal }));
|
6649
|
-
};
|
6650
|
-
var TileMenu_default = TileMenu;
|
6651
|
-
|
6652
|
-
// src/Prebuilt/components/peerTileUtils.jsx
|
6653
|
-
var PEER_NAME_PLACEHOLDER = "peerName";
|
6654
|
-
var labelMap = /* @__PURE__ */ new Map([
|
6655
|
-
[[true, "screen"].toString(), "Your Screen"],
|
6656
|
-
[[true, "regular"].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
6657
|
-
[[false, "screen"].toString(), `${PEER_NAME_PLACEHOLDER}'s Screen`],
|
6658
|
-
[[false, "regular"].toString(), PEER_NAME_PLACEHOLDER],
|
6659
|
-
[[true, void 0].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
6660
|
-
[[false, void 0].toString(), `${PEER_NAME_PLACEHOLDER}`]
|
6661
|
-
]);
|
6662
|
-
var getVideoTileLabel = ({ peerName, isLocal, track }) => {
|
6663
|
-
const isPeerPresent = peerName !== void 0;
|
6664
|
-
if (!isPeerPresent || !track) {
|
6665
|
-
return isPeerPresent ? labelMap.get([isLocal, void 0].toString()).replace(PEER_NAME_PLACEHOLDER, peerName) : "";
|
6666
|
-
}
|
6667
|
-
const isLocallyMuted = track.volume === 0;
|
6668
|
-
let label = labelMap.get([isLocal, track.source].toString());
|
6669
|
-
if (label) {
|
6670
|
-
label = label.replace(PEER_NAME_PLACEHOLDER, peerName);
|
6671
|
-
} else {
|
6672
|
-
label = `${peerName} ${track.source}`;
|
6673
|
-
}
|
6674
|
-
return `${label}${isLocallyMuted ? " (Muted for you)" : ""}`;
|
6675
|
-
};
|
6676
|
-
|
6677
|
-
// src/Prebuilt/components/VideoTile.jsx
|
6678
|
-
var Tile = ({
|
6679
|
-
peerId,
|
6680
|
-
trackId,
|
6681
|
-
width,
|
6682
|
-
height,
|
6683
|
-
objectFit = "cover",
|
6684
|
-
canMinimise = false,
|
6685
|
-
isDragabble = false,
|
6686
|
-
rootCSS = {},
|
6687
|
-
containerCSS = {},
|
6688
|
-
enableSpotlightingPeer = true,
|
6689
|
-
hideParticipantNameOnTile = false,
|
6690
|
-
roundedVideoTile = true,
|
6691
|
-
hideAudioMuteOnTile = false,
|
6692
|
-
hideMetadataOnTile = false
|
6693
|
-
}) => {
|
6694
|
-
const trackSelector = trackId ? selectVideoTrackByID4(trackId) : selectVideoTrackByPeerID3(peerId);
|
6695
|
-
const track = useHMSStore24(trackSelector);
|
6696
|
-
const isMobile = useMedia8(config.media.md);
|
6697
|
-
const peerName = useHMSStore24(selectPeerNameByID(peerId));
|
6698
|
-
const audioTrack = useHMSStore24(selectAudioTrackByPeerID2(peerId));
|
6699
|
-
const localPeerID = useHMSStore24(selectLocalPeerID5);
|
6700
|
-
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
6701
|
-
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
6702
|
-
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
6703
|
-
const isAudioMuted = !useHMSStore24(selectIsPeerAudioEnabled(peerId));
|
6704
|
-
const isVideoMuted = !(track == null ? void 0 : track.enabled);
|
6705
|
-
const [isMouseHovered, setIsMouseHovered] = useState18(false);
|
6706
|
-
const isVideoDegraded = track == null ? void 0 : track.degraded;
|
6707
|
-
const isLocal = localPeerID === peerId;
|
6708
|
-
const [pinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
6709
|
-
const pinned = isSameTile({
|
6710
|
-
trackId: pinnedTrackId,
|
6711
|
-
videoTrackID: track == null ? void 0 : track.id,
|
6712
|
-
audioTrackID: audioTrack == null ? void 0 : audioTrack.id
|
6713
|
-
});
|
6714
|
-
const spotlighted = useHMSStore24(selectSessionStore3(SESSION_STORE_KEY.SPOTLIGHT)) === peerId;
|
6715
|
-
const label = getVideoTileLabel({
|
6716
|
-
peerName,
|
6717
|
-
track,
|
6718
|
-
isLocal
|
6719
|
-
});
|
6720
|
-
const onHoverHandler = useCallback16((event) => {
|
6721
|
-
setIsMouseHovered(event.type === "mouseenter");
|
6722
|
-
}, []);
|
6723
|
-
const isTileBigEnoughToShowStats = height >= 180 && width >= 180;
|
6724
|
-
const avatarSize = useMemo3(() => {
|
6725
|
-
if (!width || !height) {
|
6726
|
-
return void 0;
|
6727
|
-
}
|
6728
|
-
if (width <= 150 || height <= 150) {
|
6729
|
-
return "small";
|
6730
|
-
} else if (width <= 300 || height <= 300) {
|
6731
|
-
return "medium";
|
6732
|
-
}
|
6733
|
-
return "large";
|
6734
|
-
}, [width, height]);
|
6735
|
-
return /* @__PURE__ */ React53.createElement(
|
6736
|
-
StyledVideoTile.Root,
|
6737
|
-
{
|
6738
|
-
css: __spreadValues({
|
6739
|
-
width,
|
6740
|
-
height
|
6741
|
-
}, rootCSS),
|
6742
|
-
"data-testid": `participant_tile_${peerName}`
|
6743
|
-
},
|
6744
|
-
peerName !== void 0 ? /* @__PURE__ */ React53.createElement(
|
6745
|
-
StyledVideoTile.Container,
|
6746
|
-
{
|
6747
|
-
onMouseEnter: onHoverHandler,
|
6748
|
-
onMouseLeave: onHoverHandler,
|
6749
|
-
noRadius: !roundedVideoTile,
|
6750
|
-
css: containerCSS
|
6751
|
-
},
|
6752
|
-
showStatsOnTiles && isTileBigEnoughToShowStats ? /* @__PURE__ */ React53.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
6753
|
-
/* @__PURE__ */ React53.createElement(
|
6754
|
-
Video,
|
6755
|
-
{
|
6756
|
-
trackId: track == null ? void 0 : track.id,
|
6757
|
-
attach: isLocal ? void 0 : !isAudioOnly,
|
6758
|
-
mirror: mirrorLocalVideo && peerId === localPeerID && (track == null ? void 0 : track.source) === "regular" && (track == null ? void 0 : track.facingMode) !== "environment",
|
6759
|
-
noRadius: !roundedVideoTile,
|
6760
|
-
"data-testid": "participant_video_tile",
|
6761
|
-
css: {
|
6762
|
-
objectFit,
|
6763
|
-
filter: isVideoDegraded ? "blur($space$2)" : void 0,
|
6764
|
-
bg: "transparent"
|
6765
|
-
}
|
6766
|
-
}
|
6767
|
-
),
|
6768
|
-
isVideoMuted || !isLocal && isAudioOnly ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React53.createElement(Avatar, { name: peerName || "", "data-testid": "participant_avatar_icon", size: avatarSize })) : null,
|
6769
|
-
!hideAudioMuteOnTile ? isAudioMuted ? /* @__PURE__ */ React53.createElement(
|
6770
|
-
StyledVideoTile.AudioIndicator,
|
6771
|
-
{
|
6772
|
-
"data-testid": "participant_audio_mute_icon",
|
6773
|
-
size: width && height && (width < 180 || height < 180) ? "small" : "medium"
|
6774
|
-
},
|
6775
|
-
/* @__PURE__ */ React53.createElement(MicOffIcon3, null)
|
6776
|
-
) : /* @__PURE__ */ React53.createElement(AudioLevel, { trackId: audioTrack == null ? void 0 : audioTrack.id }) : null,
|
6777
|
-
isMouseHovered || isDragabble && isMobile ? /* @__PURE__ */ React53.createElement(
|
6778
|
-
TileMenu_default,
|
6779
|
-
{
|
6780
|
-
peerID: peerId,
|
6781
|
-
audioTrackID: audioTrack == null ? void 0 : audioTrack.id,
|
6782
|
-
videoTrackID: track == null ? void 0 : track.id,
|
6783
|
-
canMinimise,
|
6784
|
-
enableSpotlightingPeer
|
6785
|
-
}
|
6786
|
-
) : null,
|
6787
|
-
!hideMetadataOnTile && /* @__PURE__ */ React53.createElement(PeerMetadata, { peerId }),
|
6788
|
-
/* @__PURE__ */ React53.createElement(
|
6789
|
-
TileConnection_default,
|
6790
|
-
{
|
6791
|
-
hideLabel: hideParticipantNameOnTile,
|
6792
|
-
name: label,
|
6793
|
-
isTile: true,
|
6794
|
-
peerId,
|
6795
|
-
width,
|
6796
|
-
pinned,
|
6797
|
-
spotlighted
|
6798
|
-
}
|
6799
|
-
)
|
6800
|
-
) : null
|
6801
|
-
);
|
6802
|
-
};
|
6803
|
-
var metaStyles = { top: "$4", left: "$4", width: "$14", height: "$14" };
|
6804
|
-
var heightAnimation = (value) => keyframes({
|
6805
|
-
"50%": {
|
6806
|
-
transform: `scale3d(1,${value},1)`
|
6807
|
-
},
|
6808
|
-
"100%": {
|
6809
|
-
transform: `scale3d(1,1,1)`
|
6810
|
-
}
|
6811
|
-
});
|
6812
|
-
var AudioLevelIndicator = ({ trackId, value, delay }) => {
|
6813
|
-
const vanillaStore = useHMSVanillaStore6();
|
6814
|
-
const ref = useRef7();
|
6815
|
-
useEffect23(() => {
|
6816
|
-
const unsubscribe = vanillaStore.subscribe((audioLevel) => {
|
6817
|
-
if (ref.current) {
|
6818
|
-
ref.current.style["animation"] = `${heightAnimation(
|
6819
|
-
audioLevel ? value : 1
|
6820
|
-
)} 0.3s cubic-bezier(0.61, 1, 0.88, 1) infinite ${delay}s`;
|
6821
|
-
}
|
6822
|
-
}, selectTrackAudioByID(trackId));
|
6823
|
-
return unsubscribe;
|
6824
|
-
}, [vanillaStore, trackId, value, delay]);
|
6825
|
-
return /* @__PURE__ */ React53.createElement(
|
6826
|
-
Box,
|
6827
|
-
{
|
6828
|
-
ref,
|
6829
|
-
css: {
|
6830
|
-
w: 4,
|
6831
|
-
height: 6,
|
6832
|
-
r: 2,
|
6833
|
-
bg: "$on_primary_high"
|
6834
|
-
}
|
6835
|
-
}
|
6836
|
-
);
|
6837
|
-
};
|
6838
|
-
var AudioLevel = ({ trackId }) => {
|
6839
|
-
return /* @__PURE__ */ React53.createElement(StyledVideoTile.AudioIndicator, null, /* @__PURE__ */ React53.createElement(Flex, { align: "center", justify: "center", css: { gap: "$2" } }, [3, 2, 3].map((v, i) => /* @__PURE__ */ React53.createElement(AudioLevelIndicator, { trackId, value: v, delay: i * 0.15, key: i }))));
|
6840
|
-
};
|
6841
|
-
var PeerMetadata = ({ peerId }) => {
|
6842
|
-
const metaData = useHMSStore24(selectPeerMetadata2(peerId));
|
6843
|
-
const isBRB = (metaData == null ? void 0 : metaData.isBRBOn) || false;
|
6844
|
-
const isHandRaised = useHMSStore24(selectHasPeerHandRaised3(peerId));
|
6845
|
-
return /* @__PURE__ */ React53.createElement(Fragment5, null, isHandRaised ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { css: metaStyles, "data-testid": "raiseHand_icon_onTile" }, /* @__PURE__ */ React53.createElement(HandIcon3, { width: 24, height: 24 })) : null, isBRB ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { css: metaStyles, "data-testid": "brb_icon_onTile" }, /* @__PURE__ */ React53.createElement(BrbTileIcon, { width: 22, height: 22 })) : null);
|
6846
|
-
};
|
6847
|
-
var VideoTile = React53.memo(Tile);
|
6848
|
-
var VideoTile_default = VideoTile;
|
6849
|
-
|
6850
6227
|
// src/Prebuilt/components/Preview/PreviewForm.tsx
|
6851
|
-
import
|
6852
|
-
import { useMedia as
|
6228
|
+
import React51 from "react";
|
6229
|
+
import { useMedia as useMedia5 } from "react-use";
|
6853
6230
|
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType2 } from "@100mslive/types-prebuilt/elements/join_form";
|
6854
6231
|
import { useRecordingStreaming as useRecordingStreaming3 } from "@100mslive/react-sdk";
|
6855
6232
|
import { RadioIcon } from "@100mslive/react-icons";
|
@@ -6865,18 +6242,18 @@ var PreviewForm = ({
|
|
6865
6242
|
const formSubmit = (e) => {
|
6866
6243
|
e.preventDefault();
|
6867
6244
|
};
|
6868
|
-
const isMobile =
|
6245
|
+
const isMobile = useMedia5(config.media.md);
|
6869
6246
|
const { isHLSRunning } = useRecordingStreaming3();
|
6870
6247
|
const layout = useRoomLayout();
|
6871
6248
|
const { join_form: joinForm = {} } = ((_c = (_b7 = (_a7 = layout == null ? void 0 : layout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
6872
6249
|
const showGoLive = (joinForm == null ? void 0 : joinForm.join_btn_type) === JoinForm_JoinBtnType2.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && !isHLSRunning;
|
6873
|
-
return /* @__PURE__ */
|
6250
|
+
return /* @__PURE__ */ React51.createElement(
|
6874
6251
|
Form,
|
6875
6252
|
{
|
6876
6253
|
css: { flexDirection: cannotPublishVideo ? "column" : "row", "@md": { flexDirection: "row" } },
|
6877
6254
|
onSubmit: formSubmit
|
6878
6255
|
},
|
6879
|
-
/* @__PURE__ */
|
6256
|
+
/* @__PURE__ */ React51.createElement(Flex, { align: "center", css: { gap: "$8", w: "100%" } }, /* @__PURE__ */ React51.createElement(
|
6880
6257
|
Input,
|
6881
6258
|
{
|
6882
6259
|
required: true,
|
@@ -6897,8 +6274,8 @@ var PreviewForm = ({
|
|
6897
6274
|
}
|
6898
6275
|
}
|
6899
6276
|
}
|
6900
|
-
), cannotPublishAudio && cannotPublishVideo && !isMobile ? /* @__PURE__ */
|
6901
|
-
/* @__PURE__ */
|
6277
|
+
), cannotPublishAudio && cannotPublishVideo && !isMobile ? /* @__PURE__ */ React51.createElement(PreviewSettings, null) : null),
|
6278
|
+
/* @__PURE__ */ React51.createElement(Button, { type: "submit", icon: true, disabled: !name || !enableJoin, onClick: onJoin }, showGoLive ? /* @__PURE__ */ React51.createElement(RadioIcon, { height: 18, width: 18 }) : null, showGoLive ? joinForm.go_live_btn_label : joinForm.join_btn_label)
|
6902
6279
|
);
|
6903
6280
|
};
|
6904
6281
|
var Form = styled("form", {
|
@@ -6915,7 +6292,7 @@ var Form = styled("form", {
|
|
6915
6292
|
var PreviewForm_default = PreviewForm;
|
6916
6293
|
|
6917
6294
|
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
6918
|
-
var VirtualBackground =
|
6295
|
+
var VirtualBackground = React52.lazy(() => import("./VirtualBackground-GP4ATXD3.js"));
|
6919
6296
|
var getParticipantChipContent = (peerCount = 0) => {
|
6920
6297
|
if (peerCount === 0) {
|
6921
6298
|
return "You are the first to join";
|
@@ -6936,9 +6313,9 @@ var PreviewJoin = ({
|
|
6936
6313
|
);
|
6937
6314
|
const { isStreamingOn } = useRecordingStreaming4();
|
6938
6315
|
const authToken = useAuthToken();
|
6939
|
-
const [name, setName] =
|
6316
|
+
const [name, setName] = useState16(initialName || previewPreference.name);
|
6940
6317
|
const { toggleAudio, toggleVideo } = useAVToggle2();
|
6941
|
-
const [previewError, setPreviewError] =
|
6318
|
+
const [previewError, setPreviewError] = useState16(false);
|
6942
6319
|
const { endpoints } = useHMSPrebuiltContext();
|
6943
6320
|
const { peerCount } = useParticipants();
|
6944
6321
|
const { enableJoin, preview, join } = usePreviewJoin({
|
@@ -6958,8 +6335,8 @@ var PreviewJoin = ({
|
|
6958
6335
|
},
|
6959
6336
|
asRole
|
6960
6337
|
});
|
6961
|
-
const roomState =
|
6962
|
-
const savePreferenceAndJoin =
|
6338
|
+
const roomState = useHMSStore21(selectRoomState6);
|
6339
|
+
const savePreferenceAndJoin = useCallback16(() => {
|
6963
6340
|
setPreviewPreference({
|
6964
6341
|
name
|
6965
6342
|
});
|
@@ -6968,11 +6345,11 @@ var PreviewJoin = ({
|
|
6968
6345
|
}, [join, name, setPreviewPreference, onJoin]);
|
6969
6346
|
const roomLayout = useRoomLayout();
|
6970
6347
|
const { preview_header: previewHeader = {} } = ((_c = (_b7 = (_a7 = roomLayout == null ? void 0 : roomLayout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
6971
|
-
const localPeer =
|
6972
|
-
const videoTrack =
|
6973
|
-
const isMobile =
|
6348
|
+
const localPeer = useHMSStore21(selectLocalPeer);
|
6349
|
+
const videoTrack = useHMSStore21(selectVideoTrackByID4(localPeer == null ? void 0 : localPeer.videoTrack));
|
6350
|
+
const isMobile = useMedia6(config.media.md);
|
6974
6351
|
const aspectRatio = (videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
|
6975
|
-
|
6352
|
+
useEffect23(() => {
|
6976
6353
|
if (authToken) {
|
6977
6354
|
if (skipPreview) {
|
6978
6355
|
savePreferenceAndJoin();
|
@@ -6981,34 +6358,34 @@ var PreviewJoin = ({
|
|
6981
6358
|
}
|
6982
6359
|
}
|
6983
6360
|
}, [authToken, skipPreview]);
|
6984
|
-
|
6361
|
+
useEffect23(() => {
|
6985
6362
|
if (initialName) {
|
6986
6363
|
setName(initialName);
|
6987
6364
|
}
|
6988
6365
|
}, [initialName]);
|
6989
|
-
return roomState === HMSRoomState6.Preview ? /* @__PURE__ */
|
6366
|
+
return roomState === HMSRoomState6.Preview ? /* @__PURE__ */ React52.createElement(Container3, { css: { h: "100%", pt: "$10", "@md": { justifyContent: "space-between" } } }, toggleVideo ? null : /* @__PURE__ */ React52.createElement(Box, null), /* @__PURE__ */ React52.createElement(Flex, { direction: "column", justify: "center", css: { w: "100%", maxWidth: "640px" } }, /* @__PURE__ */ React52.createElement(Logo, null), /* @__PURE__ */ React52.createElement(
|
6990
6367
|
Text,
|
6991
6368
|
{
|
6992
6369
|
variant: "h4",
|
6993
6370
|
css: { wordBreak: "break-word", textAlign: "center", mt: "$14", mb: "$4", "@md": { mt: "$8", mb: "$2" } }
|
6994
6371
|
},
|
6995
6372
|
previewHeader.title
|
6996
|
-
), /* @__PURE__ */
|
6373
|
+
), /* @__PURE__ */ React52.createElement(
|
6997
6374
|
Text,
|
6998
6375
|
{
|
6999
6376
|
css: { c: "$on_surface_medium", my: "0", textAlign: "center", maxWidth: "100%", wordWrap: "break-word" },
|
7000
6377
|
variant: "sm"
|
7001
6378
|
},
|
7002
6379
|
previewHeader.sub_title
|
7003
|
-
), /* @__PURE__ */
|
6380
|
+
), /* @__PURE__ */ React52.createElement(Flex, { justify: "center", css: { mt: "$14", "@md": { mt: "$8", mb: "0" }, gap: "$4" } }, isStreamingOn ? /* @__PURE__ */ React52.createElement(
|
7004
6381
|
Chip_default,
|
7005
6382
|
{
|
7006
6383
|
content: "LIVE",
|
7007
6384
|
backgroundColor: "$alert_error_default",
|
7008
6385
|
textColor: "#FFF",
|
7009
|
-
icon: /* @__PURE__ */
|
6386
|
+
icon: /* @__PURE__ */ React52.createElement(Box, { css: { h: "$sm", w: "$sm", backgroundColor: "$on_primary_high", borderRadius: "$round" } })
|
7010
6387
|
}
|
7011
|
-
) : null, /* @__PURE__ */
|
6388
|
+
) : null, /* @__PURE__ */ React52.createElement(Chip_default, { content: getParticipantChipContent(peerCount), hideIfNoContent: true }))), toggleVideo ? /* @__PURE__ */ React52.createElement(
|
7012
6389
|
Flex,
|
7013
6390
|
{
|
7014
6391
|
align: "center",
|
@@ -7020,8 +6397,8 @@ var PreviewJoin = ({
|
|
7020
6397
|
flexDirection: "column"
|
7021
6398
|
}
|
7022
6399
|
},
|
7023
|
-
/* @__PURE__ */
|
7024
|
-
) : null, /* @__PURE__ */
|
6400
|
+
/* @__PURE__ */ React52.createElement(PreviewTile, { name, error: previewError })
|
6401
|
+
) : null, /* @__PURE__ */ React52.createElement(Box, { css: { w: "100%", maxWidth: `${Math.max(aspectRatio, 1) * 360}px` } }, /* @__PURE__ */ React52.createElement(PreviewControls, { hideSettings: !toggleVideo && !toggleAudio }), /* @__PURE__ */ React52.createElement(
|
7025
6402
|
PreviewForm_default,
|
7026
6403
|
{
|
7027
6404
|
name,
|
@@ -7031,7 +6408,7 @@ var PreviewJoin = ({
|
|
7031
6408
|
cannotPublishVideo: !toggleVideo,
|
7032
6409
|
cannotPublishAudio: !toggleAudio
|
7033
6410
|
}
|
7034
|
-
))) : /* @__PURE__ */
|
6411
|
+
))) : /* @__PURE__ */ React52.createElement(FullPageProgress_default, null);
|
7035
6412
|
};
|
7036
6413
|
var Container3 = styled("div", __spreadProps(__spreadValues({
|
7037
6414
|
width: "100%"
|
@@ -7040,17 +6417,17 @@ var Container3 = styled("div", __spreadProps(__spreadValues({
|
|
7040
6417
|
px: "$10"
|
7041
6418
|
}));
|
7042
6419
|
var PreviewTile = ({ name, error }) => {
|
7043
|
-
const localPeer =
|
6420
|
+
const localPeer = useHMSStore21(selectLocalPeer);
|
7044
6421
|
const { isLocalAudioEnabled, toggleAudio } = useAVToggle2();
|
7045
|
-
const isVideoOn =
|
6422
|
+
const isVideoOn = useHMSStore21(selectIsLocalVideoEnabled5);
|
7046
6423
|
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
7047
|
-
const trackSelector =
|
7048
|
-
const track =
|
6424
|
+
const trackSelector = selectVideoTrackByID4(localPeer == null ? void 0 : localPeer.videoTrack);
|
6425
|
+
const track = useHMSStore21(trackSelector);
|
7049
6426
|
const showMuteIcon = !isLocalAudioEnabled || !toggleAudio;
|
7050
|
-
const videoTrack =
|
7051
|
-
const isMobile =
|
6427
|
+
const videoTrack = useHMSStore21(selectVideoTrackByID4(localPeer == null ? void 0 : localPeer.videoTrack));
|
6428
|
+
const isMobile = useMedia6(config.media.md);
|
7052
6429
|
const aspectRatio = (videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
|
7053
|
-
return /* @__PURE__ */
|
6430
|
+
return /* @__PURE__ */ React52.createElement(
|
7054
6431
|
StyledVideoTile.Container,
|
7055
6432
|
{
|
7056
6433
|
css: {
|
@@ -7066,35 +6443,35 @@ var PreviewTile = ({ name, error }) => {
|
|
7066
6443
|
}
|
7067
6444
|
}
|
7068
6445
|
},
|
7069
|
-
localPeer ? /* @__PURE__ */
|
6446
|
+
localPeer ? /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(TileConnection_default, { name, peerId: localPeer.id, hideLabel: true }), /* @__PURE__ */ React52.createElement(
|
7070
6447
|
Video,
|
7071
6448
|
{
|
7072
6449
|
mirror: (track == null ? void 0 : track.facingMode) !== "environment" && mirrorLocalVideo,
|
7073
6450
|
trackId: localPeer.videoTrack,
|
7074
6451
|
"data-testid": "preview_tile"
|
7075
6452
|
}
|
7076
|
-
), !isVideoOn ? /* @__PURE__ */
|
7077
|
-
showMuteIcon ? /* @__PURE__ */
|
6453
|
+
), !isVideoOn ? /* @__PURE__ */ React52.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React52.createElement(Avatar, { name, "data-testid": "preview_avatar_tile" })) : null) : !error ? /* @__PURE__ */ React52.createElement(FullPageProgress_default, null) : null,
|
6454
|
+
showMuteIcon ? /* @__PURE__ */ React52.createElement(StyledVideoTile.AudioIndicator, null, /* @__PURE__ */ React52.createElement(MicOffIcon2, null)) : /* @__PURE__ */ React52.createElement(StyledVideoTile.AudioIndicator, { size: "medium" }, /* @__PURE__ */ React52.createElement(AudioLevel, { trackId: localPeer == null ? void 0 : localPeer.audioTrack }))
|
7078
6455
|
);
|
7079
6456
|
};
|
7080
6457
|
var PreviewControls = ({ hideSettings }) => {
|
7081
|
-
const isMobile =
|
7082
|
-
return /* @__PURE__ */
|
6458
|
+
const isMobile = useMedia6(config.media.md);
|
6459
|
+
return /* @__PURE__ */ React52.createElement(
|
7083
6460
|
Flex,
|
7084
6461
|
{
|
7085
|
-
justify: "between",
|
6462
|
+
justify: hideSettings && isMobile ? "center" : "between",
|
7086
6463
|
css: {
|
7087
6464
|
width: "100%",
|
7088
6465
|
mt: "$8"
|
7089
6466
|
}
|
7090
6467
|
},
|
7091
|
-
/* @__PURE__ */
|
7092
|
-
!hideSettings ? /* @__PURE__ */
|
6468
|
+
/* @__PURE__ */ React52.createElement(Flex, { css: { gap: "$4" } }, /* @__PURE__ */ React52.createElement(AudioVideoToggle, null), /* @__PURE__ */ React52.createElement(Suspense, { fallback: "" }, !isMobile ? /* @__PURE__ */ React52.createElement(VirtualBackground, null) : null)),
|
6469
|
+
!hideSettings ? /* @__PURE__ */ React52.createElement(PreviewSettings, null) : null
|
7093
6470
|
);
|
7094
6471
|
};
|
7095
|
-
var PreviewSettings =
|
7096
|
-
const [open, setOpen] =
|
7097
|
-
return /* @__PURE__ */
|
6472
|
+
var PreviewSettings = React52.memo(() => {
|
6473
|
+
const [open, setOpen] = useState16(false);
|
6474
|
+
return /* @__PURE__ */ React52.createElement(Fragment4, null, /* @__PURE__ */ React52.createElement(IconButton_default, { "data-testid": "preview_setting_btn", css: { flexShrink: 0 }, onClick: () => setOpen((value) => !value) }, /* @__PURE__ */ React52.createElement(SettingsIcon2, null)), open && /* @__PURE__ */ React52.createElement(SettingsModal_default, { open, onOpenChange: setOpen }));
|
7098
6475
|
});
|
7099
6476
|
var PreviewJoin_default = PreviewJoin;
|
7100
6477
|
|
@@ -7118,14 +6495,14 @@ var PreviewContainer = () => {
|
|
7118
6495
|
}
|
7119
6496
|
navigate(meetingURL);
|
7120
6497
|
};
|
7121
|
-
return /* @__PURE__ */
|
6498
|
+
return /* @__PURE__ */ React53.createElement(Flex, { direction: "column", css: { size: "100%" } }, /* @__PURE__ */ React53.createElement(
|
7122
6499
|
Flex,
|
7123
6500
|
{
|
7124
6501
|
css: { flex: "1 1 0", position: "relative", overflowY: "auto", color: "$primary_default" },
|
7125
6502
|
justify: "center",
|
7126
6503
|
align: "center"
|
7127
6504
|
},
|
7128
|
-
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */
|
6505
|
+
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */ React53.createElement(
|
7129
6506
|
PreviewJoin_default,
|
7130
6507
|
{
|
7131
6508
|
initialName,
|
@@ -7133,20 +6510,20 @@ var PreviewContainer = () => {
|
|
7133
6510
|
asRole: previewAsRole != null ? previewAsRole : void 0,
|
7134
6511
|
onJoin
|
7135
6512
|
}
|
7136
|
-
) : /* @__PURE__ */
|
6513
|
+
) : /* @__PURE__ */ React53.createElement(FullPageProgress_default, null)
|
7137
6514
|
));
|
7138
6515
|
};
|
7139
6516
|
var PreviewContainer_default = PreviewContainer;
|
7140
6517
|
|
7141
6518
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
7142
|
-
import
|
7143
|
-
import { selectIsConnectedToRoom as selectIsConnectedToRoom3, useHMSStore as
|
6519
|
+
import React55, { useEffect as useEffect24, useState as useState17 } from "react";
|
6520
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom3, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
7144
6521
|
|
7145
6522
|
// src/Prebuilt/components/Toast/Toast.jsx
|
7146
|
-
import
|
6523
|
+
import React54 from "react";
|
7147
6524
|
var Toast2 = (_a7) => {
|
7148
6525
|
var _b7 = _a7, { title, description, close = true, open, duration, onOpenChange, icon } = _b7, props = __objRest(_b7, ["title", "description", "close", "open", "duration", "onOpenChange", "icon"]);
|
7149
|
-
return /* @__PURE__ */
|
6526
|
+
return /* @__PURE__ */ React54.createElement(
|
7150
6527
|
Toast.HMSToast,
|
7151
6528
|
__spreadValues({
|
7152
6529
|
title,
|
@@ -7162,17 +6539,17 @@ var Toast2 = (_a7) => {
|
|
7162
6539
|
|
7163
6540
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
7164
6541
|
var ToastContainer = () => {
|
7165
|
-
const isConnected =
|
7166
|
-
const [toasts, setToast] =
|
7167
|
-
|
6542
|
+
const isConnected = useHMSStore22(selectIsConnectedToRoom3);
|
6543
|
+
const [toasts, setToast] = useState17([]);
|
6544
|
+
useEffect24(() => {
|
7168
6545
|
ToastManager.addListener(setToast);
|
7169
6546
|
return () => {
|
7170
6547
|
ToastManager.removeListener(setToast);
|
7171
6548
|
};
|
7172
6549
|
}, []);
|
7173
|
-
return /* @__PURE__ */
|
7174
|
-
return /* @__PURE__ */
|
7175
|
-
}), /* @__PURE__ */
|
6550
|
+
return /* @__PURE__ */ React55.createElement(Toast.Provider, { swipeDirection: "left", duration: 3e3 }, toasts.slice(0, MAX_TOASTS).map((toast) => {
|
6551
|
+
return /* @__PURE__ */ React55.createElement(Toast2, __spreadProps(__spreadValues({ key: toast.id }, toast), { onOpenChange: (value) => !value && ToastManager.removeToast(toast.id) }));
|
6552
|
+
}), /* @__PURE__ */ React55.createElement(
|
7176
6553
|
Toast.Viewport,
|
7177
6554
|
{
|
7178
6555
|
css: __spreadValues({
|
@@ -7183,13 +6560,13 @@ var ToastContainer = () => {
|
|
7183
6560
|
};
|
7184
6561
|
|
7185
6562
|
// src/Prebuilt/plugins/FlyingEmoji.jsx
|
7186
|
-
import
|
7187
|
-
import { useMedia as
|
6563
|
+
import React56, { useCallback as useCallback17, useEffect as useEffect25, useMemo as useMemo3, useState as useState18 } from "react";
|
6564
|
+
import { useMedia as useMedia7 } from "react-use";
|
7188
6565
|
import {
|
7189
|
-
selectLocalPeerID as
|
7190
|
-
selectPeerNameByID
|
7191
|
-
useCustomEvent as
|
7192
|
-
useHMSStore as
|
6566
|
+
selectLocalPeerID as selectLocalPeerID4,
|
6567
|
+
selectPeerNameByID,
|
6568
|
+
useCustomEvent as useCustomEvent2,
|
6569
|
+
useHMSStore as useHMSStore23,
|
7193
6570
|
useHMSVanillaStore as useHMSVanillaStore7
|
7194
6571
|
} from "@100mslive/react-sdk";
|
7195
6572
|
var emojiCount = 1;
|
@@ -7216,17 +6593,17 @@ var getStartingPoints = (isMobile) => {
|
|
7216
6593
|
return arr;
|
7217
6594
|
};
|
7218
6595
|
function FlyingEmoji() {
|
7219
|
-
const localPeerId =
|
6596
|
+
const localPeerId = useHMSStore23(selectLocalPeerID4);
|
7220
6597
|
const vanillaStore = useHMSVanillaStore7();
|
7221
|
-
const [emojis, setEmojis] =
|
7222
|
-
const isMobile =
|
7223
|
-
const startingPoints =
|
7224
|
-
const showFlyingEmoji =
|
6598
|
+
const [emojis, setEmojis] = useState18([]);
|
6599
|
+
const isMobile = useMedia7(config.media.md);
|
6600
|
+
const startingPoints = useMemo3(() => getStartingPoints(isMobile), [isMobile]);
|
6601
|
+
const showFlyingEmoji = useCallback17(
|
7225
6602
|
({ emojiId, senderId }) => {
|
7226
6603
|
if (!emojiId || !senderId || document.hidden) {
|
7227
6604
|
return;
|
7228
6605
|
}
|
7229
|
-
const senderPeerName = vanillaStore.getState(
|
6606
|
+
const senderPeerName = vanillaStore.getState(selectPeerNameByID(senderId));
|
7230
6607
|
const nameToShow = localPeerId === senderId ? "You" : senderPeerName;
|
7231
6608
|
const startingPoint = startingPoints[emojiCount % startingPoints.length];
|
7232
6609
|
const id = emojiCount++;
|
@@ -7245,14 +6622,14 @@ function FlyingEmoji() {
|
|
7245
6622
|
},
|
7246
6623
|
[localPeerId, vanillaStore, startingPoints]
|
7247
6624
|
);
|
7248
|
-
|
6625
|
+
useCustomEvent2({
|
7249
6626
|
type: EMOJI_REACTION_TYPE,
|
7250
6627
|
onEvent: showFlyingEmoji
|
7251
6628
|
});
|
7252
|
-
|
6629
|
+
useEffect25(() => {
|
7253
6630
|
window.showFlyingEmoji = showFlyingEmoji;
|
7254
6631
|
}, [showFlyingEmoji]);
|
7255
|
-
return /* @__PURE__ */
|
6632
|
+
return /* @__PURE__ */ React56.createElement(
|
7256
6633
|
Box,
|
7257
6634
|
{
|
7258
6635
|
css: {
|
@@ -7268,7 +6645,7 @@ function FlyingEmoji() {
|
|
7268
6645
|
}
|
7269
6646
|
},
|
7270
6647
|
emojis.map((emoji) => {
|
7271
|
-
return /* @__PURE__ */
|
6648
|
+
return /* @__PURE__ */ React56.createElement(
|
7272
6649
|
Flex,
|
7273
6650
|
{
|
7274
6651
|
key: emoji.id,
|
@@ -7284,8 +6661,8 @@ function FlyingEmoji() {
|
|
7284
6661
|
setEmojis(emojis.filter((item) => item.id !== emoji.id));
|
7285
6662
|
}
|
7286
6663
|
},
|
7287
|
-
/* @__PURE__ */
|
7288
|
-
/* @__PURE__ */
|
6664
|
+
/* @__PURE__ */ React56.createElement(Box, null, /* @__PURE__ */ React56.createElement("em-emoji", { id: emoji.emojiId, size: "48px", set: "apple" })),
|
6665
|
+
/* @__PURE__ */ React56.createElement(
|
7289
6666
|
Box,
|
7290
6667
|
{
|
7291
6668
|
css: {
|
@@ -7295,7 +6672,7 @@ function FlyingEmoji() {
|
|
7295
6672
|
borderRadius: "$1"
|
7296
6673
|
}
|
7297
6674
|
},
|
7298
|
-
/* @__PURE__ */
|
6675
|
+
/* @__PURE__ */ React56.createElement(
|
7299
6676
|
Text,
|
7300
6677
|
{
|
7301
6678
|
css: {
|
@@ -7313,45 +6690,45 @@ function FlyingEmoji() {
|
|
7313
6690
|
}
|
7314
6691
|
|
7315
6692
|
// src/Prebuilt/plugins/RemoteStopScreenshare.jsx
|
7316
|
-
import
|
7317
|
-
import { useCustomEvent as
|
6693
|
+
import React57, { useCallback as useCallback18 } from "react";
|
6694
|
+
import { useCustomEvent as useCustomEvent3, useHMSActions as useHMSActions16 } from "@100mslive/react-sdk";
|
7318
6695
|
function RemoteStopScreenshare() {
|
7319
|
-
const actions =
|
7320
|
-
const onRemoteStopScreenshare =
|
6696
|
+
const actions = useHMSActions16();
|
6697
|
+
const onRemoteStopScreenshare = useCallback18(() => __async(this, null, function* () {
|
7321
6698
|
yield actions.setScreenShareEnabled(false);
|
7322
6699
|
}), [actions]);
|
7323
|
-
|
6700
|
+
useCustomEvent3({
|
7324
6701
|
type: REMOTE_STOP_SCREENSHARE_TYPE,
|
7325
6702
|
onEvent: onRemoteStopScreenshare
|
7326
6703
|
});
|
7327
|
-
return /* @__PURE__ */
|
6704
|
+
return /* @__PURE__ */ React57.createElement(React57.Fragment, null);
|
7328
6705
|
}
|
7329
6706
|
|
7330
6707
|
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
7331
|
-
import { useCallback as
|
6708
|
+
import { useCallback as useCallback19, useEffect as useEffect27, useRef as useRef9 } from "react";
|
7332
6709
|
import {
|
7333
6710
|
selectIsConnectedToRoom as selectIsConnectedToRoom5,
|
7334
|
-
selectPermissions as
|
7335
|
-
useHMSActions as
|
7336
|
-
useHMSStore as
|
6711
|
+
selectPermissions as selectPermissions2,
|
6712
|
+
useHMSActions as useHMSActions17,
|
6713
|
+
useHMSStore as useHMSStore25,
|
7337
6714
|
useRecordingStreaming as useRecordingStreaming5
|
7338
6715
|
} from "@100mslive/react-sdk";
|
7339
6716
|
|
7340
6717
|
// src/Prebuilt/common/hooks.js
|
7341
|
-
import { useEffect as
|
6718
|
+
import { useEffect as useEffect26, useRef as useRef8, useState as useState19 } from "react";
|
7342
6719
|
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType3 } from "@100mslive/types-prebuilt/elements/join_form";
|
7343
6720
|
import {
|
7344
6721
|
selectAvailableRoleNames as selectAvailableRoleNames2,
|
7345
6722
|
selectIsConnectedToRoom as selectIsConnectedToRoom4,
|
7346
6723
|
selectPeerCount,
|
7347
|
-
selectPeerMetadata as
|
6724
|
+
selectPeerMetadata as selectPeerMetadata2,
|
7348
6725
|
selectPeers,
|
7349
6726
|
selectRemotePeers,
|
7350
|
-
useHMSStore as
|
6727
|
+
useHMSStore as useHMSStore24,
|
7351
6728
|
useHMSVanillaStore as useHMSVanillaStore8
|
7352
6729
|
} from "@100mslive/react-sdk";
|
7353
6730
|
var useFilteredRoles = () => {
|
7354
|
-
const roles =
|
6731
|
+
const roles = useHMSStore24(selectAvailableRoleNames2);
|
7355
6732
|
return roles;
|
7356
6733
|
};
|
7357
6734
|
var useShowStreamingUI = () => {
|
@@ -7362,15 +6739,15 @@ var useShowStreamingUI = () => {
|
|
7362
6739
|
};
|
7363
6740
|
var useParticipants2 = (params) => {
|
7364
6741
|
var _a7;
|
7365
|
-
const isConnected =
|
7366
|
-
const peerCount =
|
7367
|
-
const availableRoles =
|
7368
|
-
let participantList =
|
6742
|
+
const isConnected = useHMSStore24(selectIsConnectedToRoom4);
|
6743
|
+
const peerCount = useHMSStore24(selectPeerCount);
|
6744
|
+
const availableRoles = useHMSStore24(selectAvailableRoleNames2);
|
6745
|
+
let participantList = useHMSStore24(isConnected ? selectPeers : selectRemotePeers);
|
7369
6746
|
const rolesWithParticipants = Array.from(new Set(participantList.map((peer) => peer.roleName)));
|
7370
6747
|
const vanillaStore = useHMSVanillaStore8();
|
7371
6748
|
if ((_a7 = params == null ? void 0 : params.metadata) == null ? void 0 : _a7.isHandRaised) {
|
7372
6749
|
participantList = participantList.filter((peer) => {
|
7373
|
-
return vanillaStore.getState(
|
6750
|
+
return vanillaStore.getState(selectPeerMetadata2(peer.id)).isHandRaised;
|
7374
6751
|
});
|
7375
6752
|
}
|
7376
6753
|
if ((params == null ? void 0 : params.role) && availableRoles.includes(params.role)) {
|
@@ -7386,13 +6763,13 @@ var useParticipants2 = (params) => {
|
|
7386
6763
|
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
7387
6764
|
var useAutoStartStreaming = () => {
|
7388
6765
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
7389
|
-
const permissions =
|
6766
|
+
const permissions = useHMSStore25(selectPermissions2);
|
7390
6767
|
const showStreamingUI = useShowStreamingUI();
|
7391
|
-
const hmsActions =
|
7392
|
-
const isConnected =
|
6768
|
+
const hmsActions = useHMSActions17();
|
6769
|
+
const isConnected = useHMSStore25(selectIsConnectedToRoom5);
|
7393
6770
|
const { isHLSRunning } = useRecordingStreaming5();
|
7394
6771
|
const streamStartedRef = useRef9(false);
|
7395
|
-
const startHLS =
|
6772
|
+
const startHLS = useCallback19(() => __async(void 0, null, function* () {
|
7396
6773
|
var _a7;
|
7397
6774
|
try {
|
7398
6775
|
if (isHLSStarted || !showStreamingUI || isHLSRunning) {
|
@@ -7409,12 +6786,12 @@ var useAutoStartStreaming = () => {
|
|
7409
6786
|
setHLSStarted(false);
|
7410
6787
|
}
|
7411
6788
|
}), [hmsActions, isHLSRunning, isHLSStarted, setHLSStarted, showStreamingUI]);
|
7412
|
-
|
6789
|
+
useEffect27(() => {
|
7413
6790
|
if (!isHLSStarted && !isHLSRunning) {
|
7414
6791
|
streamStartedRef.current = false;
|
7415
6792
|
}
|
7416
6793
|
}, [isHLSStarted, isHLSRunning]);
|
7417
|
-
|
6794
|
+
useEffect27(() => {
|
7418
6795
|
if (!isConnected || streamStartedRef.current || !(permissions == null ? void 0 : permissions.hlsStreaming)) {
|
7419
6796
|
return;
|
7420
6797
|
}
|
@@ -7423,8 +6800,8 @@ var useAutoStartStreaming = () => {
|
|
7423
6800
|
};
|
7424
6801
|
|
7425
6802
|
// src/Prebuilt/App.tsx
|
7426
|
-
var Conference =
|
7427
|
-
var HMSPrebuilt =
|
6803
|
+
var Conference = React58.lazy(() => import("./conference-JD35TNH4.js"));
|
6804
|
+
var HMSPrebuilt = React58.forwardRef(
|
7428
6805
|
({
|
7429
6806
|
roomCode = "",
|
7430
6807
|
authToken = "",
|
@@ -7440,8 +6817,8 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7440
6817
|
var _a7, _b7, _c, _d;
|
7441
6818
|
const metadata = "";
|
7442
6819
|
const reactiveStore = useRef10();
|
7443
|
-
const [hydrated, setHydrated] =
|
7444
|
-
|
6820
|
+
const [hydrated, setHydrated] = React58.useState(false);
|
6821
|
+
useEffect28(() => {
|
7445
6822
|
setHydrated(true);
|
7446
6823
|
const hms = new HMSReactiveStore();
|
7447
6824
|
const hmsStore = hms.getStore();
|
@@ -7456,13 +6833,13 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7456
6833
|
hmsNotifications
|
7457
6834
|
};
|
7458
6835
|
}, []);
|
7459
|
-
|
6836
|
+
useEffect28(() => {
|
7460
6837
|
if (!ref || !reactiveStore.current) {
|
7461
6838
|
return;
|
7462
6839
|
}
|
7463
6840
|
ref.current = __spreadValues({}, reactiveStore.current);
|
7464
6841
|
}, [ref]);
|
7465
|
-
|
6842
|
+
useEffect28(
|
7466
6843
|
() => () => {
|
7467
6844
|
var _a8;
|
7468
6845
|
(_a8 = reactiveStore == null ? void 0 : reactiveStore.current) == null ? void 0 : _a8.hmsActions.leave();
|
@@ -7492,7 +6869,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7492
6869
|
return null;
|
7493
6870
|
}
|
7494
6871
|
globalStyles();
|
7495
|
-
return /* @__PURE__ */
|
6872
|
+
return /* @__PURE__ */ React58.createElement(ErrorBoundary, null, /* @__PURE__ */ React58.createElement(
|
7496
6873
|
HMSPrebuiltContext.Provider,
|
7497
6874
|
{
|
7498
6875
|
value: {
|
@@ -7510,7 +6887,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7510
6887
|
}
|
7511
6888
|
}
|
7512
6889
|
},
|
7513
|
-
/* @__PURE__ */
|
6890
|
+
/* @__PURE__ */ React58.createElement(
|
7514
6891
|
HMSRoomProvider,
|
7515
6892
|
{
|
7516
6893
|
isHMSStatsOn: FeatureFlags.enableStatsForNerds,
|
@@ -7519,7 +6896,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7519
6896
|
notifications: (_c = reactiveStore.current) == null ? void 0 : _c.hmsNotifications,
|
7520
6897
|
stats: (_d = reactiveStore.current) == null ? void 0 : _d.hmsStats
|
7521
6898
|
},
|
7522
|
-
/* @__PURE__ */
|
6899
|
+
/* @__PURE__ */ React58.createElement(RoomLayoutProvider, { roomLayoutEndpoint, overrideLayout }, /* @__PURE__ */ React58.createElement(RoomLayoutContext.Consumer, null, (data) => {
|
7523
6900
|
var _a8;
|
7524
6901
|
const layout = data == null ? void 0 : data.layout;
|
7525
6902
|
const theme2 = ((_a8 = layout == null ? void 0 : layout.themes) == null ? void 0 : _a8[0]) || {};
|
@@ -7528,7 +6905,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7528
6905
|
if (typography2 == null ? void 0 : typography2.font_family) {
|
7529
6906
|
fontFamily = [`${typography2 == null ? void 0 : typography2.font_family}`, ...fontFamily];
|
7530
6907
|
}
|
7531
|
-
return /* @__PURE__ */
|
6908
|
+
return /* @__PURE__ */ React58.createElement(
|
7532
6909
|
HMSThemeProvider,
|
7533
6910
|
{
|
7534
6911
|
themeType: `${theme2.name}-${Date.now()}`,
|
@@ -7541,11 +6918,12 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7541
6918
|
}
|
7542
6919
|
}
|
7543
6920
|
},
|
7544
|
-
/* @__PURE__ */
|
7545
|
-
/* @__PURE__ */
|
7546
|
-
/* @__PURE__ */
|
6921
|
+
/* @__PURE__ */ React58.createElement(AppData, { appDetails: metadata, tokenEndpoint: tokenByRoomIdRoleEndpoint }),
|
6922
|
+
/* @__PURE__ */ React58.createElement(Init, null),
|
6923
|
+
/* @__PURE__ */ React58.createElement(
|
7547
6924
|
Box,
|
7548
6925
|
{
|
6926
|
+
id: "prebuilt-container",
|
7549
6927
|
css: {
|
7550
6928
|
bg: "$background_dim",
|
7551
6929
|
size: "100%",
|
@@ -7553,7 +6931,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7553
6931
|
"-webkit-text-size-adjust": "100%"
|
7554
6932
|
}
|
7555
6933
|
},
|
7556
|
-
/* @__PURE__ */
|
6934
|
+
/* @__PURE__ */ React58.createElement(AppRoutes, { authTokenByRoomCodeEndpoint: tokenByRoomCodeEndpoint, defaultAuthToken: authToken })
|
7557
6935
|
)
|
7558
6936
|
);
|
7559
6937
|
}))
|
@@ -7564,42 +6942,42 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7564
6942
|
HMSPrebuilt.displayName = "HMSPrebuilt";
|
7565
6943
|
var Redirector = ({ showPreview }) => {
|
7566
6944
|
const { roomId, role } = useParams5();
|
7567
|
-
return /* @__PURE__ */
|
6945
|
+
return /* @__PURE__ */ React58.createElement(Navigate, { to: `/${showPreview ? "preview" : "meeting"}/${roomId}/${role || ""}` });
|
7568
6946
|
};
|
7569
6947
|
var RouteList = () => {
|
7570
6948
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
7571
6949
|
const { isLeaveScreenEnabled } = useRoomLayoutLeaveScreen();
|
7572
6950
|
useAutoStartStreaming();
|
7573
|
-
return /* @__PURE__ */
|
6951
|
+
return /* @__PURE__ */ React58.createElement(Routes, null, isPreviewScreenEnabled ? /* @__PURE__ */ React58.createElement(Route, { path: "preview" }, /* @__PURE__ */ React58.createElement(
|
7574
6952
|
Route,
|
7575
6953
|
{
|
7576
6954
|
path: ":roomId/:role",
|
7577
|
-
element: /* @__PURE__ */
|
6955
|
+
element: /* @__PURE__ */ React58.createElement(Suspense2, { fallback: /* @__PURE__ */ React58.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React58.createElement(PreviewContainer_default, null))
|
7578
6956
|
}
|
7579
|
-
), /* @__PURE__ */
|
6957
|
+
), /* @__PURE__ */ React58.createElement(
|
7580
6958
|
Route,
|
7581
6959
|
{
|
7582
6960
|
path: ":roomId",
|
7583
|
-
element: /* @__PURE__ */
|
6961
|
+
element: /* @__PURE__ */ React58.createElement(Suspense2, { fallback: /* @__PURE__ */ React58.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React58.createElement(PreviewContainer_default, null))
|
7584
6962
|
}
|
7585
|
-
)) : null, /* @__PURE__ */
|
6963
|
+
)) : null, /* @__PURE__ */ React58.createElement(Route, { path: "meeting" }, /* @__PURE__ */ React58.createElement(
|
7586
6964
|
Route,
|
7587
6965
|
{
|
7588
6966
|
path: ":roomId/:role",
|
7589
|
-
element: /* @__PURE__ */
|
6967
|
+
element: /* @__PURE__ */ React58.createElement(Suspense2, { fallback: /* @__PURE__ */ React58.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React58.createElement(Conference, null))
|
7590
6968
|
}
|
7591
|
-
), /* @__PURE__ */
|
6969
|
+
), /* @__PURE__ */ React58.createElement(
|
7592
6970
|
Route,
|
7593
6971
|
{
|
7594
6972
|
path: ":roomId",
|
7595
|
-
element: /* @__PURE__ */
|
6973
|
+
element: /* @__PURE__ */ React58.createElement(Suspense2, { fallback: /* @__PURE__ */ React58.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React58.createElement(Conference, null))
|
7596
6974
|
}
|
7597
|
-
)), isLeaveScreenEnabled ? /* @__PURE__ */
|
6975
|
+
)), isLeaveScreenEnabled ? /* @__PURE__ */ React58.createElement(Route, { path: "leave" }, /* @__PURE__ */ React58.createElement(Route, { path: ":roomId/:role", element: /* @__PURE__ */ React58.createElement(PostLeave_default, null) }), /* @__PURE__ */ React58.createElement(Route, { path: ":roomId", element: /* @__PURE__ */ React58.createElement(PostLeave_default, null) })) : null, /* @__PURE__ */ React58.createElement(Route, { path: "/:roomId/:role", element: /* @__PURE__ */ React58.createElement(Redirector, { showPreview: isPreviewScreenEnabled }) }), /* @__PURE__ */ React58.createElement(Route, { path: "/:roomId/", element: /* @__PURE__ */ React58.createElement(Redirector, { showPreview: isPreviewScreenEnabled }) }));
|
7598
6976
|
};
|
7599
6977
|
var BackSwipe = () => {
|
7600
|
-
const isConnectedToRoom =
|
7601
|
-
const hmsActions =
|
7602
|
-
|
6978
|
+
const isConnectedToRoom = useHMSStore26(selectIsConnectedToRoom6);
|
6979
|
+
const hmsActions = useHMSActions18();
|
6980
|
+
useEffect28(() => {
|
7603
6981
|
const onRouteLeave = () => __async(void 0, null, function* () {
|
7604
6982
|
if (isConnectedToRoom) {
|
7605
6983
|
yield hmsActions.leave();
|
@@ -7614,7 +6992,7 @@ var BackSwipe = () => {
|
|
7614
6992
|
};
|
7615
6993
|
var Router = ({ children }) => {
|
7616
6994
|
const { roomId, role, roomCode } = useHMSPrebuiltContext();
|
7617
|
-
return [roomId, role, roomCode].every((value) => !value) ? /* @__PURE__ */
|
6995
|
+
return [roomId, role, roomCode].every((value) => !value) ? /* @__PURE__ */ React58.createElement(BrowserRouter, null, children) : /* @__PURE__ */ React58.createElement(MemoryRouter, { initialEntries: [`/${roomCode ? roomCode : `${roomId}/${role || ""}`}`], initialIndex: 0 }, children);
|
7618
6996
|
};
|
7619
6997
|
function AppRoutes({
|
7620
6998
|
authTokenByRoomCodeEndpoint,
|
@@ -7622,7 +7000,7 @@ function AppRoutes({
|
|
7622
7000
|
}) {
|
7623
7001
|
const roomLayout = useRoomLayout();
|
7624
7002
|
const isNotificationsDisabled = useIsNotificationDisabled();
|
7625
|
-
return /* @__PURE__ */
|
7003
|
+
return /* @__PURE__ */ React58.createElement(Router, null, /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(ToastContainer, null), /* @__PURE__ */ React58.createElement(Notifications, null), /* @__PURE__ */ React58.createElement(BackSwipe, null), !isNotificationsDisabled && /* @__PURE__ */ React58.createElement(FlyingEmoji, null), /* @__PURE__ */ React58.createElement(RemoteStopScreenshare, null), /* @__PURE__ */ React58.createElement(KeyboardHandler, null), /* @__PURE__ */ React58.createElement(AuthToken_default, { authTokenByRoomCodeEndpoint, defaultAuthToken }), roomLayout && /* @__PURE__ */ React58.createElement(Routes, null, /* @__PURE__ */ React58.createElement(Route, { path: "/*", element: /* @__PURE__ */ React58.createElement(RouteList, null) }))));
|
7626
7004
|
}
|
7627
7005
|
|
7628
7006
|
// src/Progress/index.tsx
|
@@ -7665,6 +7043,7 @@ export {
|
|
7665
7043
|
Video,
|
7666
7044
|
StyledMenuTile,
|
7667
7045
|
useBorderAudioLevel,
|
7046
|
+
AudioLevel,
|
7668
7047
|
Popover2 as Popover,
|
7669
7048
|
VideoTileStats,
|
7670
7049
|
Checkbox,
|
@@ -7689,6 +7068,7 @@ export {
|
|
7689
7068
|
APP_DATA,
|
7690
7069
|
UI_SETTINGS,
|
7691
7070
|
SIDE_PANE_OPTIONS,
|
7071
|
+
REMOTE_STOP_SCREENSHARE_TYPE,
|
7692
7072
|
isChrome,
|
7693
7073
|
isIOS,
|
7694
7074
|
isMacOS,
|
@@ -7709,6 +7089,7 @@ export {
|
|
7709
7089
|
useSetSubscribedChatSelector,
|
7710
7090
|
useSetAppDataByKey,
|
7711
7091
|
useHMSPrebuiltContext,
|
7092
|
+
PrebuiltDialogPortal,
|
7712
7093
|
DialogContent,
|
7713
7094
|
DialogRow,
|
7714
7095
|
DialogCol,
|
@@ -7728,15 +7109,12 @@ export {
|
|
7728
7109
|
StopRecordingInSheet,
|
7729
7110
|
Header2 as Header,
|
7730
7111
|
AudioVideoToggle,
|
7112
|
+
Chip_default,
|
7731
7113
|
ConnectionIndicator,
|
7114
|
+
TileConnection_default,
|
7732
7115
|
DialogDropdownTrigger,
|
7733
7116
|
useDropdownSelection,
|
7734
7117
|
SettingsModal_default,
|
7735
|
-
ChangeNameModal,
|
7736
|
-
useDropdownList,
|
7737
|
-
TileMenu_default,
|
7738
|
-
getVideoTileLabel,
|
7739
|
-
VideoTile_default,
|
7740
7118
|
PreviewTile,
|
7741
7119
|
PreviewControls,
|
7742
7120
|
useFilteredRoles,
|
@@ -7744,4 +7122,4 @@ export {
|
|
7744
7122
|
HMSPrebuilt,
|
7745
7123
|
Progress
|
7746
7124
|
};
|
7747
|
-
//# sourceMappingURL=chunk-
|
7125
|
+
//# sourceMappingURL=chunk-GLYGPYNS.js.map
|