@snapcall/stream-ui 1.8.1 → 1.10.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/stream-ui.js CHANGED
@@ -333,6 +333,9 @@ const $393bda1b33846dfc$export$604ba5624273df44 = ()=>{
333
333
  const $91fcbf58e59aae79$export$84584c2a98eb6753 = {
334
334
  name: "English",
335
335
  translation: {
336
+ header: {
337
+ free: "Free version"
338
+ },
336
339
  notifications: {
337
340
  screensharingError: "An error occured when trying to toggle screensharing",
338
341
  microphoneError: "An error occured when trying to toggle the microphone",
@@ -364,6 +367,14 @@ const $91fcbf58e59aae79$export$84584c2a98eb6753 = {
364
367
  pictureInPicture: "Picture-in-Picture",
365
368
  screenSharing: "Screen sharing"
366
369
  },
370
+ blockedFeature: {
371
+ titleConnected: "Upgrade to Pro",
372
+ titleGuest: "Feature not available",
373
+ descriptionConnected: "On a free plan, you can't use this feature. Upgrade your plan to enjoy all in-call features.",
374
+ descriptionGuest: "You are participating in a call created with a free version of SnapCall. This feature is only available with a Pro version.",
375
+ dismissGuest: "Okay",
376
+ dismissConnected: "Upgrade to Pro"
377
+ },
367
378
  copyLink: {
368
379
  title: "Copy link",
369
380
  description: "Copy link into clipboard",
@@ -457,11 +468,6 @@ const $91fcbf58e59aae79$export$84584c2a98eb6753 = {
457
468
  decline: "Decline",
458
469
  you: "You"
459
470
  },
460
- invite: {
461
- title: "Share link to start a conversation",
462
- copy: "Copy",
463
- description: "You are currently the only participant. Invite people to start the conversation."
464
- },
465
471
  greeting: {
466
472
  mainTitle: "Welcome to SnapCall",
467
473
  sideTitle: "Are you ready to join?",
@@ -478,6 +484,9 @@ const $91fcbf58e59aae79$export$84584c2a98eb6753 = {
478
484
  const $e52ca91c2b296e41$export$acb2a88f7d552ebf = {
479
485
  name: "Fran\xe7ais",
480
486
  translation: {
487
+ header: {
488
+ free: "Version gratuite"
489
+ },
481
490
  notifications: {
482
491
  screensharingError: "Une erreur est survenue pendant l'activation du partage d'\xe9cran",
483
492
  microphoneError: "Une erreur est survenue pendant l'activation du micro",
@@ -509,6 +518,14 @@ const $e52ca91c2b296e41$export$acb2a88f7d552ebf = {
509
518
  pictureInPicture: "Picture-in-Picture",
510
519
  screenSharing: "Partage d'\xe9cran"
511
520
  },
521
+ blockedFeature: {
522
+ titleConnected: "Souscrire au plan Pro",
523
+ titleGuest: "Fonctionnalit\xe9 non disponible",
524
+ descriptionConnected: "Vous n'avez pas acc\xe8s \xe0 cette fonctionnalit\xe9. Souscrivez au plan Pro pour d\xe9bloquer toutes les fonctionnalit\xe9s de SnapCall.",
525
+ descriptionGuest: "Vous participez \xe0 un appel cr\xe9\xe9 avec la version gratuite de SnapCall. Cette fonctionnalit\xe9 n'est disponible qu'avec une version Pro.",
526
+ dismissGuest: "D'accord",
527
+ dismissConnected: "Souscrire \xe0 Pro"
528
+ },
512
529
  copyLink: {
513
530
  title: "Copier le lien",
514
531
  description: "Copier le lien dans le presse-papiers",
@@ -602,11 +619,6 @@ const $e52ca91c2b296e41$export$acb2a88f7d552ebf = {
602
619
  decline: "D\xe9cliner",
603
620
  you: "Vous"
604
621
  },
605
- invite: {
606
- title: "Partagez le lien pour commencer une conversation",
607
- copy: "Copier",
608
- description: "Vous \xeates actuellement le seul participant. Inviter des personnes pour commencer la conversation."
609
- },
610
622
  greeting: {
611
623
  mainTitle: "Bienvenue sur SnapCall",
612
624
  sideTitle: "Pr\xeat \xe0 rejoindre ?",
@@ -623,6 +635,9 @@ const $e52ca91c2b296e41$export$acb2a88f7d552ebf = {
623
635
  const $e0ae3d23c2381da3$export$3486a10f30cf1ee4 = {
624
636
  name: "Italiano",
625
637
  translation: {
638
+ header: {
639
+ free: "Versione gratuita"
640
+ },
626
641
  notifications: {
627
642
  screensharingError: "Si \xe8 verificato un errore durante l'attivazione della condivisione dello schermo",
628
643
  microphoneError: "Si \xe8 verificato un errore durante l'attivazione del microfono",
@@ -654,6 +669,14 @@ const $e0ae3d23c2381da3$export$3486a10f30cf1ee4 = {
654
669
  pictureInPicture: "Immagine nell'immagine",
655
670
  screenSharing: "Condivisione dello schermo"
656
671
  },
672
+ blockedFeature: {
673
+ titleConnected: "L'aggiornamento a Pro",
674
+ titleGuest: "Funzione non disponibile",
675
+ descriptionConnected: "Su un piano gratuito, non puoi utilizzare questa funzione. Aggiorna il tuo piano per usufruire di tutte le funzionalit\xe0 in chiamata.",
676
+ descriptionGuest: "Stai partecipando a una chiamata creata con una versione gratuita di SnapCall. Questa funzione \xe8 disponibile solo con una versione Pro.",
677
+ dismissGuest: "Okay",
678
+ dismissConnected: "L'aggiornamento a Pro"
679
+ },
657
680
  copyLink: {
658
681
  title: "Copia il link",
659
682
  description: "Copia il link negli appunti",
@@ -751,11 +774,6 @@ const $e0ae3d23c2381da3$export$3486a10f30cf1ee4 = {
751
774
  decline: "Declinare",
752
775
  you: "Voi"
753
776
  },
754
- invite: {
755
- title: "Condividi link per avviare una conversazione",
756
- copy: "Copiare",
757
- description: "Attualmente sei l'unico partecipante. Invita le persone ad iniziare la conversazione."
758
- },
759
777
  greeting: {
760
778
  mainTitle: "Benvenuto a SnapCall",
761
779
  sideTitle: "Sei pronto per unirti?",
@@ -794,6 +812,8 @@ var $b45c0bcc142f0b5e$export$2e2bcd8739ae039 = (0, ($parcel$interopDefault($jQDc
794
812
 
795
813
 
796
814
 
815
+
816
+
797
817
  const $d0c6baf97675ab49$var$LogLevel = {
798
818
  error: 1,
799
819
  warn: 2,
@@ -1428,6 +1448,8 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1428
1448
  pendingDeviceRequest = {};
1429
1449
  joinOptions = {};
1430
1450
  devicesList = [];
1451
+ plan = undefined;
1452
+ permissions = [];
1431
1453
  constructor(){
1432
1454
  super();
1433
1455
  navigator.mediaDevices.addEventListener("devicechange", ()=>this.onDeviceChange());
@@ -1551,7 +1573,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1551
1573
  if (!this.peerId) this.peerId = (0, $jQDcL$uuid.v4)();
1552
1574
  let url;
1553
1575
  try {
1554
- const { instanceId: instanceId } = await fetch(`${this.config.streamerApi}/instance/${this.roomId}`, {
1576
+ const { streamer_instance: instanceId , plan: { permissions: permissions , name: name } , } = await fetch(`${this.config.apiUrl}/streams/${room}/info`, {
1555
1577
  method: "get",
1556
1578
  headers: {
1557
1579
  "Content-Type": "application/json"
@@ -1560,6 +1582,8 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1560
1582
  if (response.ok) return response.json();
1561
1583
  throw new Error("Invalid room ID");
1562
1584
  });
1585
+ this.permissions = permissions;
1586
+ this.plan = name;
1563
1587
  url = `${this.config.streamerServer}/${instanceId}/?roomId=${room}&peerId=${this.peerId}`;
1564
1588
  } catch (roomError) {
1565
1589
  const event = new $1dedebd5ff3002eb$var$SnapcallEvent("invalidRoom", {
@@ -1829,7 +1853,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1829
1853
  peerId: peer.id || peer.peerId
1830
1854
  };
1831
1855
  }),
1832
- callId: callId
1856
+ callId: callId,
1857
+ plan: this.plan,
1858
+ permissions: this.permissions
1833
1859
  }
1834
1860
  }));
1835
1861
  $1dedebd5ff3002eb$var$log.log("joinRoom", "peers", peers);
@@ -2149,6 +2175,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2149
2175
  this.mediaPipeOption = options;
2150
2176
  }
2151
2177
  async initVideoBackground() {
2178
+ if (!this.permissions.find((permission)=>permission === "virtual_background")) throw new Error("feature not allowed");
2152
2179
  if (this.useVideoBackground === true) return;
2153
2180
  this.useVideoBackground = true;
2154
2181
  if (!this.webcamProducer || this.webcamProducer.closed) return;
@@ -2325,6 +2352,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2325
2352
  this.dispatchEvent(event);
2326
2353
  }
2327
2354
  async enableScreenshare() {
2355
+ if (!this.permissions.find((permission)=>permission === "screen_sharing")) throw new Error("feature not allowed");
2328
2356
  const stream = await this.handleGetUserMediaError("screen", navigator.mediaDevices.getDisplayMedia({
2329
2357
  audio: false,
2330
2358
  video: {
@@ -2417,11 +2445,13 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2417
2445
  } else $1dedebd5ff3002eb$var$log.error("requestVideo", `Video consumer ${consumer} not found`);
2418
2446
  }
2419
2447
  async captureVideo(videoElement) {
2420
- let image;
2421
- if (videoElement) image = await (0, $3575c8a563f2a1da$export$674c90a250a8b2c5)(videoElement);
2422
- else if (this.webcamProducer && this.webcamProducer.track) image = await (0, $3575c8a563f2a1da$export$4a210166cc9cb64b)(this.webcamProducer.track);
2423
- else throw new Error("no video to capture");
2424
- return image;
2448
+ if (this.permissions.find((permission)=>permission === "instant_picture")) {
2449
+ let image;
2450
+ if (videoElement) image = await (0, $3575c8a563f2a1da$export$674c90a250a8b2c5)(videoElement);
2451
+ else if (this.webcamProducer && this.webcamProducer.track) image = await (0, $3575c8a563f2a1da$export$4a210166cc9cb64b)(this.webcamProducer.track);
2452
+ else throw new Error("no video to capture");
2453
+ return image;
2454
+ } else throw new Error("feature not allowed");
2425
2455
  }
2426
2456
  requestLocalVideo(element) {
2427
2457
  $1dedebd5ff3002eb$var$log.info("requestLocalVideo");
@@ -2539,6 +2569,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2539
2569
  this.dispatchEvent(event);
2540
2570
  }
2541
2571
  async requestPeerDevice(remotePeerId, deviceType) {
2572
+ if (!this.permissions.find((permission)=>permission === "request_input")) throw new Error("feature not allowed");
2542
2573
  return this.protoo.request("requestPeerDevice", {
2543
2574
  remotePeerId: remotePeerId,
2544
2575
  deviceType: deviceType
@@ -2707,6 +2738,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2707
2738
  ...config
2708
2739
  };
2709
2740
  }
2741
+ getPermissions() {
2742
+ return this.permissions;
2743
+ }
2710
2744
  }
2711
2745
 
2712
2746
 
@@ -3186,7 +3220,7 @@ const $1949f8f101c8cf77$export$4dc2e6a0e59ffa13 = (0, ($parcel$interopDefault($j
3186
3220
  font-size: 16px;
3187
3221
  font-weight: 300;
3188
3222
  line-height: 16px;
3189
- color: #fff;
3223
+ color: rgba(255, 255, 255, 0.5);
3190
3224
  margin-left: 5px;
3191
3225
  position: relative;
3192
3226
  bottom: 1px;
@@ -3561,7 +3595,7 @@ const $e1930b467e7d8845$var$multiPiP = new (0, $21395e477f83709c$export$45fabd1c
3561
3595
  const $e1930b467e7d8845$var$browser = $jQDcL$bowser.parse(window.navigator.userAgent);
3562
3596
  const $e1930b467e7d8845$var$Header = ()=>{
3563
3597
  const { t: t } = (0, $jQDcL$reacti18next.useTranslation)();
3564
- const { setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , setIsSettingsMenuVisible: setIsSettingsMenuVisible , setIsVirtualBackgroundPopupVisible: setIsVirtualBackgroundPopupVisible , options: options , muted: muted , streaming: streaming , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
3598
+ const { setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , setIsSettingsMenuVisible: setIsSettingsMenuVisible , setIsVirtualBackgroundPopupVisible: setIsVirtualBackgroundPopupVisible , options: options , muted: muted , streaming: streaming , permissions: permissions , plan: plan , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
3565
3599
  const { streams: streams } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
3566
3600
  const [extraOptions, setExtraOptions] = (0, $jQDcL$react.useState)(options.extraSettingsOptions || []);
3567
3601
  const onSetExtraSettingsOptions = (event)=>{
@@ -3609,14 +3643,17 @@ const $e1930b467e7d8845$var$Header = ()=>{
3609
3643
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).endCall();
3610
3644
  };
3611
3645
  const onScanQuickConnectClick = ()=>{
3612
- setIsQuickConnectPopupVisible(true);
3613
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("quickConnectClick");
3646
+ if (permissions.find((permission)=>permission === "quick_connect")) {
3647
+ setIsQuickConnectPopupVisible(true);
3648
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("quickConnectClick");
3649
+ } else setBlockedFeaturePopupOpen(true);
3614
3650
  };
3615
3651
  const onSettingsMenuClick = ()=>{
3616
3652
  setIsSettingsMenuVisible(true);
3617
3653
  };
3618
3654
  const onVirtualBackgroundClick = ()=>{
3619
- setIsVirtualBackgroundPopupVisible(true);
3655
+ if (permissions.find((permission)=>permission === "virtual_background")) setIsVirtualBackgroundPopupVisible(true);
3656
+ else setBlockedFeaturePopupOpen(true);
3620
3657
  };
3621
3658
  const computedCategories = [
3622
3659
  {
@@ -3673,13 +3710,15 @@ const $e1930b467e7d8845$var$Header = ()=>{
3673
3710
  });
3674
3711
  return computedCategories;
3675
3712
  }, [
3713
+ t,
3714
+ options.sharedURL,
3676
3715
  muted,
3677
3716
  streaming,
3678
- options.sharedURL,
3717
+ permissions,
3679
3718
  setIsQuickConnectPopupVisible,
3719
+ setBlockedFeaturePopupOpen,
3680
3720
  setIsSettingsMenuVisible,
3681
- setIsVirtualBackgroundPopupVisible,
3682
- t,
3721
+ setIsVirtualBackgroundPopupVisible,
3683
3722
  ]);
3684
3723
  return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $1949f8f101c8cf77$export$1e86fd0e1db89578), {
3685
3724
  children: [
@@ -3689,7 +3728,10 @@ const $e1930b467e7d8845$var$Header = ()=>{
3689
3728
  size: options.logo?.size
3690
3729
  }),
3691
3730
  options.logo?.text && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $1949f8f101c8cf77$export$4dc2e6a0e59ffa13), {
3692
- children: options.logo.text
3731
+ children: options.logo?.text
3732
+ }),
3733
+ plan === "individual" && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $1949f8f101c8cf77$export$4dc2e6a0e59ffa13), {
3734
+ children: `${options.logo?.text ? " \xb7 " : ""}${t("header.free")}`
3693
3735
  })
3694
3736
  ]
3695
3737
  }),
@@ -4525,7 +4567,7 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
4525
4567
  const [requestingDevice, setRequestingDevice] = (0, $jQDcL$react.useState)(null);
4526
4568
  const [flashAnimation, setFlashAnimation] = (0, $jQDcL$react.useState)(false);
4527
4569
  const requestingDeviceTimeoutRef = (0, $jQDcL$react.useRef)(null);
4528
- const { selfPeerId: selfPeerId } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
4570
+ const { selfPeerId: selfPeerId , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
4529
4571
  const { highlightedTile: highlightedTile } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
4530
4572
  const isSharingScreen = highlightedTile?.type === "screenshare" && highlightedTile.peerId === selfPeerId;
4531
4573
  const microphoneActive = stream.microphone && !stream.muted;
@@ -4537,16 +4579,22 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
4537
4579
  const onMouseEnter = ()=>setHover(true);
4538
4580
  const onMouseLeave = ()=>setHover(false);
4539
4581
  const requestMicrophone = ()=>{
4540
- (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "microphone");
4541
- setRequestingDevice("microphone");
4582
+ if (permissions.find((permission)=>permission === "request_input")) {
4583
+ (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "microphone");
4584
+ setRequestingDevice("microphone");
4585
+ } else setBlockedFeaturePopupOpen(true);
4542
4586
  };
4543
4587
  const requestWebcam = ()=>{
4544
- (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "webcam");
4545
- setRequestingDevice("webcam");
4588
+ if (permissions.find((permission)=>permission === "request_input")) {
4589
+ (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "webcam");
4590
+ setRequestingDevice("webcam");
4591
+ } else setBlockedFeaturePopupOpen(true);
4546
4592
  };
4547
4593
  const requestScreen = ()=>{
4548
- (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "screen");
4549
- setRequestingDevice("screen");
4594
+ if (permissions.find((permission)=>permission === "request_input")) {
4595
+ (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "screen");
4596
+ setRequestingDevice("screen");
4597
+ } else setBlockedFeaturePopupOpen(true);
4550
4598
  };
4551
4599
  (0, $jQDcL$react.useEffect)(()=>{
4552
4600
  if (!videoElementRef.current) throw new Error("videoElementRef not available");
@@ -5184,7 +5232,7 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
5184
5232
  const videoElementRef = (0, $jQDcL$react.useRef)(null);
5185
5233
  const videoMediaProviderRef = (0, $jQDcL$react.useRef)(null);
5186
5234
  const SelfTileRef = (0, $jQDcL$react.useRef)(null);
5187
- const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , profile: profile , muted: muted , streaming: streaming , orientation: orientation , options: options , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
5235
+ const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , profile: profile , muted: muted , streaming: streaming , orientation: orientation , options: options , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
5188
5236
  const { streams: streams } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
5189
5237
  const [containerWidth, containerHeight] = (0, $56e1e7a85d8bf4bb$export$2b86bedf890eab8)(videosContainerRef.current);
5190
5238
  const cursor = streaming && !extended ? "pointer" : "default";
@@ -5228,42 +5276,44 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
5228
5276
  }
5229
5277
  };
5230
5278
  const onSnapshotClick = async ()=>{
5231
- if (!snapshotAnimation && !snapshotImage) {
5232
- if (!videoElementRef.current) throw new Error("Video element is not available");
5233
- setSnapshotAnimation(true);
5234
- const base64Image = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).captureVideo(videoElementRef.current);
5235
- setSnapshotImage(base64Image);
5236
- try {
5237
- const { objectUrl: objectUrl } = await fetch(`${options.streamApiURL}/uploadSnapshot`, {
5238
- method: "POST",
5239
- body: JSON.stringify({
5240
- file: base64Image
5241
- })
5242
- }).then((rawResponse)=>rawResponse.json());
5243
- await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).sendCustomMessageToAll({
5244
- type: "snapshot",
5245
- imageSrc: objectUrl
5246
- });
5247
- let notificationMessage = t("snapshot.sentToUsers");
5248
- if (streams.length === 1) {
5249
- const userName = streams[0].profile.name || t("misc.user");
5250
- notificationMessage = t("snapshot.sentToUser", {
5251
- user: userName
5279
+ if (permissions.find((permission)=>permission === "instant_picture")) {
5280
+ if (!snapshotAnimation && !snapshotImage) {
5281
+ if (!videoElementRef.current) throw new Error("Video element is not available");
5282
+ setSnapshotAnimation(true);
5283
+ const base64Image = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).captureVideo(videoElementRef.current);
5284
+ setSnapshotImage(base64Image);
5285
+ try {
5286
+ const { objectUrl: objectUrl } = await fetch(`${options.streamApiURL}/uploadSnapshot`, {
5287
+ method: "POST",
5288
+ body: JSON.stringify({
5289
+ file: base64Image
5290
+ })
5291
+ }).then((rawResponse)=>rawResponse.json());
5292
+ await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).sendCustomMessageToAll({
5293
+ type: "snapshot",
5294
+ imageSrc: objectUrl
5295
+ });
5296
+ let notificationMessage = t("snapshot.sentToUsers");
5297
+ if (streams.length === 1) {
5298
+ const userName = streams[0].profile.name || t("misc.user");
5299
+ notificationMessage = t("snapshot.sentToUser", {
5300
+ user: userName
5301
+ });
5302
+ }
5303
+ (0, $84c6cbcbb594d072$export$3a57e165650c636f)(notificationMessage, {
5304
+ icon: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $2c45d365ee8aa1ab$export$26fe7ec9351ff761), {
5305
+ src: base64Image
5306
+ }),
5307
+ duration: 2500
5308
+ });
5309
+ } catch (sendMessageError) {
5310
+ (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(t("snapshot.error"), {
5311
+ className: "error"
5252
5312
  });
5313
+ console.error(sendMessageError);
5253
5314
  }
5254
- (0, $84c6cbcbb594d072$export$3a57e165650c636f)(notificationMessage, {
5255
- icon: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $2c45d365ee8aa1ab$export$26fe7ec9351ff761), {
5256
- src: base64Image
5257
- }),
5258
- duration: 2500
5259
- });
5260
- } catch (sendMessageError) {
5261
- (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(t("snapshot.error"), {
5262
- className: "error"
5263
- });
5264
- console.error(sendMessageError);
5265
5315
  }
5266
- }
5316
+ } else setBlockedFeaturePopupOpen(true);
5267
5317
  };
5268
5318
  const onDeviceRequest = (event)=>{
5269
5319
  const { peerId: peerId , deviceType: deviceType } = event.detail;
@@ -6267,104 +6317,8 @@ var $c225be5472ba393a$export$2e2bcd8739ae039 = $c225be5472ba393a$var$Highlighted
6267
6317
 
6268
6318
 
6269
6319
 
6270
- const $7e6d6d75bd13cce5$export$dd2ac23a70f320dd = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
6271
- display: ${({ show: show })=>show ? "flex" : "none"};
6272
- flex-direction: column;
6273
- justify-content: center;
6274
- align-items: center;
6275
- position: relative;
6276
- width: ${({ width: width })=>width};
6277
- height: ${({ height: height })=>height};
6278
- background-color: ${({ theme: theme })=>theme.streamTileBackgroundColor};
6279
- border: 2px solid ${({ theme: theme })=>theme.streamTileBorderColor};
6280
- border-radius: 20px;
6281
- box-sizing: border-box;
6282
- color: #fff;
6283
- font-family: Lato;
6284
- padding: 20px;
6285
- `;
6286
- const $7e6d6d75bd13cce5$export$2dabfbe763cc7a4 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).h2`
6287
- font-weight: 600;
6288
- font-size: 16px;
6289
- text-align: center;
6290
- max-width: 300px;
6291
- `;
6292
- const $7e6d6d75bd13cce5$export$6ed6e36e1b456f96 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
6293
- position: relative;
6294
- display: flex;
6295
- align-items: center;
6296
- height: 50px;
6297
- width: 100%;
6298
- max-width: 300px;
6299
- background-color: ${({ theme: theme })=>theme.popupBackgroundSecondaryColor};
6300
- border: 1px solid ${({ theme: theme })=>theme.popupBorderColor};
6301
- border-radius: 15px;
6302
- padding: 0 10px;
6303
- box-sizing: border-box;
6304
- `;
6305
- const $7e6d6d75bd13cce5$export$5f759de1870a3e41 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
6306
- display: flex;
6307
- align-items: center;
6308
- width: 100%;
6309
- gap: 5px;
6310
-
6311
- svg {
6312
- width: 20px;
6313
- height: 20px;
6314
- }
6315
- `;
6316
- const $7e6d6d75bd13cce5$export$c6b180e8ec79154e = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).p`
6317
- color: #242324;
6318
- font-size: 15px;
6319
- font-weight: 600;
6320
- width: 100%;
6321
- text-overflow: ellipsis;
6322
- white-space: nowrap;
6323
- overflow: hidden;
6324
- line-height: 15px;
6325
- `;
6326
- const $7e6d6d75bd13cce5$export$d7f3ab4b3437ad97 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).button`
6327
- position: absolute;
6328
- right: 5px;
6329
- display: flex;
6330
- justify-content: center;
6331
- align-items: center;
6332
- background-color: ${({ theme: theme })=>theme.primaryColor};
6333
- border: none;
6334
- border-radius: 8px;
6335
- height: 32px;
6336
- color: #fff;
6337
- font-weight: 600;
6338
- font-size: 16px;
6339
- padding: 8px 12px;
6340
- line-height: 18px;
6341
- `;
6342
- const $7e6d6d75bd13cce5$export$c22678f0e7b404e0 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).p`
6343
- font-size: 12px;
6344
- font-weight: 400;
6345
- max-width: 300px;
6346
- text-align: center;
6347
- `;
6348
-
6349
-
6350
-
6351
-
6352
6320
 
6353
6321
 
6354
- const $daca1602b495441e$var$Link = ({ color: color })=>{
6355
- return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("svg", {
6356
- width: "24",
6357
- height: "24",
6358
- viewBox: "0 0 24 24",
6359
- fill: "none",
6360
- xmlns: "http://www.w3.org/2000/svg",
6361
- children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("path", {
6362
- d: "m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1.004 1.004 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1.004 1.004 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1.004 1.004 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.471 2.471 0 0 1 0 3.5l-3.88 3.88a1.002 1.002 0 0 0 .325 1.639.999.999 0 0 0 1.095-.219l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1.004 1.004 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z",
6363
- fill: color || "#fff"
6364
- })
6365
- });
6366
- };
6367
- var $daca1602b495441e$export$2e2bcd8739ae039 = $daca1602b495441e$var$Link;
6368
6322
 
6369
6323
 
6370
6324
 
@@ -6417,67 +6371,6 @@ const $e8ac63718934c648$export$c7df1b15b59b1df2 = /*#__PURE__*/ (0, $jQDcL$react
6417
6371
  });
6418
6372
 
6419
6373
 
6420
-
6421
-
6422
- const $23c39d8ee81f4f67$var$InvitationTile = ({ show: show , orientation: orientation , width: width , height: height })=>{
6423
- const { t: t } = (0, $jQDcL$reacti18next.useTranslation)();
6424
- const { options: options } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
6425
- const onCopyCallLinkClick = async ()=>{
6426
- try {
6427
- await (0, $0bea101d3ef852fb$export$2e2bcd8739ae039)(options.sharedURL || window.location.href);
6428
- (0, $84c6cbcbb594d072$export$3a57e165650c636f)(t("copyLink.copied"), {
6429
- duration: 2000
6430
- });
6431
- } catch (copyError) {
6432
- console.warn(copyError);
6433
- (0, $84c6cbcbb594d072$export$3a57e165650c636f)(t("copyLink.error"), {
6434
- icon: (0, $e8ac63718934c648$export$edf27be85e5f6da0)
6435
- });
6436
- }
6437
- };
6438
- return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $7e6d6d75bd13cce5$export$dd2ac23a70f320dd), {
6439
- show: show,
6440
- width: width,
6441
- height: height,
6442
- orientation: orientation,
6443
- children: [
6444
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $7e6d6d75bd13cce5$export$2dabfbe763cc7a4), {
6445
- children: t("invite.title")
6446
- }),
6447
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $7e6d6d75bd13cce5$export$6ed6e36e1b456f96), {
6448
- children: [
6449
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $7e6d6d75bd13cce5$export$5f759de1870a3e41), {
6450
- children: [
6451
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $daca1602b495441e$export$2e2bcd8739ae039), {
6452
- color: "black"
6453
- }),
6454
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $7e6d6d75bd13cce5$export$c6b180e8ec79154e), {
6455
- children: options.sharedURL || window.location.href
6456
- })
6457
- ]
6458
- }),
6459
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $7e6d6d75bd13cce5$export$d7f3ab4b3437ad97), {
6460
- onClick: onCopyCallLinkClick,
6461
- children: t("invite.copy")
6462
- })
6463
- ]
6464
- }),
6465
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $7e6d6d75bd13cce5$export$c22678f0e7b404e0), {
6466
- children: t("invite.description")
6467
- })
6468
- ]
6469
- });
6470
- };
6471
- var $23c39d8ee81f4f67$export$2e2bcd8739ae039 = $23c39d8ee81f4f67$var$InvitationTile;
6472
-
6473
-
6474
-
6475
-
6476
-
6477
-
6478
-
6479
-
6480
-
6481
6374
  const $537dcc6df507dc4a$var$Container = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
6482
6375
  background-color: rgba(45, 45, 45, 0.75);
6483
6376
  display: flex;
@@ -6544,7 +6437,6 @@ const $88b23a8428e67b66$var$Video = ()=>{
6544
6437
  });
6545
6438
  const { streams: streams , highlightedTile: highlightedTile , dispatch: dispatch } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
6546
6439
  const [containerWidth, containerHeight] = (0, $56e1e7a85d8bf4bb$export$2b86bedf890eab8)(remoteTilesContainerRef.current);
6547
- const showInvitation = !options.audioTiles && streams.length < 1 && !highlightedTile && containerWidth > 0;
6548
6440
  (0, $jQDcL$react.useEffect)(()=>{
6549
6441
  if (options.GDPRDisclaimer) (0, $537dcc6df507dc4a$export$2e2bcd8739ae039)({
6550
6442
  message: "Para mejorar la calidad de nuestro servicio, esta llamada ser\xe1 grabada",
@@ -6558,7 +6450,6 @@ const $88b23a8428e67b66$var$Video = ()=>{
6558
6450
  if (remoteTilesContainerRef?.current) {
6559
6451
  const ratio = 1;
6560
6452
  let numberOfTiles = remoteTilesContainerRef.current.childElementCount;
6561
- if (!showInvitation) numberOfTiles -= 1;
6562
6453
  const videoWidth = (0, $7de6ded9bdec6f42$export$4d43009c33055644)({
6563
6454
  availableWidth: containerWidth - 16 * (numberOfTiles - 1),
6564
6455
  availableHeight: containerHeight - 16 * (numberOfTiles - 1),
@@ -6576,8 +6467,7 @@ const $88b23a8428e67b66$var$Video = ()=>{
6576
6467
  containerWidth,
6577
6468
  containerHeight,
6578
6469
  streams.length,
6579
- highlightedTile,
6580
- showInvitation,
6470
+ highlightedTile
6581
6471
  ]);
6582
6472
  (0, $jQDcL$react.useEffect)(()=>{
6583
6473
  if (userInteractionTriggered) {
@@ -6731,12 +6621,6 @@ const $88b23a8428e67b66$var$Video = ()=>{
6731
6621
  width: tileSize.width,
6732
6622
  height: tileSize.height
6733
6623
  }, stream.id);
6734
- }),
6735
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $23c39d8ee81f4f67$export$2e2bcd8739ae039), {
6736
- show: showInvitation,
6737
- width: `${tileSize.width}px`,
6738
- height: `${tileSize.height}px`,
6739
- orientation: orientation
6740
6624
  })
6741
6625
  ]
6742
6626
  })
@@ -6868,6 +6752,22 @@ var $3b6953f72db3bb17$export$2e2bcd8739ae039 = $3b6953f72db3bb17$var$YoutubeIcon
6868
6752
 
6869
6753
 
6870
6754
 
6755
+ const $daca1602b495441e$var$Link = ({ color: color })=>{
6756
+ return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("svg", {
6757
+ width: "24",
6758
+ height: "24",
6759
+ viewBox: "0 0 24 24",
6760
+ fill: "none",
6761
+ xmlns: "http://www.w3.org/2000/svg",
6762
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("path", {
6763
+ d: "m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1.004 1.004 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1.004 1.004 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1.004 1.004 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.471 2.471 0 0 1 0 3.5l-3.88 3.88a1.002 1.002 0 0 0 .325 1.639.999.999 0 0 0 1.095-.219l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1.004 1.004 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z",
6764
+ fill: color || "#fff"
6765
+ })
6766
+ });
6767
+ };
6768
+ var $daca1602b495441e$export$2e2bcd8739ae039 = $daca1602b495441e$var$Link;
6769
+
6770
+
6871
6771
 
6872
6772
 
6873
6773
 
@@ -6953,7 +6853,7 @@ const $9dfd9e2286cffa66$var$HighlightButton = ()=>{
6953
6853
  const { t: t } = (0, $jQDcL$reacti18next.useTranslation)();
6954
6854
  const highlightMenuRef = (0, $jQDcL$react.useRef)(null);
6955
6855
  const [isHighlightMenuOpen, setIsHighlightMenuOpen] = (0, $jQDcL$react.useState)(false);
6956
- const { setIsYoutubePopupVisible: setIsYoutubePopupVisible , setIsLinksharePopupVisible: setIsLinksharePopupVisible , selfPeerId: selfPeerId } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
6856
+ const { setIsYoutubePopupVisible: setIsYoutubePopupVisible , setIsLinksharePopupVisible: setIsLinksharePopupVisible , selfPeerId: selfPeerId , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
6957
6857
  const { highlightedTile: highlightedTile , dispatch: dispatch } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
6958
6858
  const isPresenting = Boolean(highlightedTile?.isGlobal && highlightedTile?.peerId === selfPeerId);
6959
6859
  (0, $326cea7dbbcb019a$export$71b2224f1ce5e08e)(highlightMenuRef, ()=>setIsHighlightMenuOpen(false));
@@ -6964,18 +6864,20 @@ const $9dfd9e2286cffa66$var$HighlightButton = ()=>{
6964
6864
  else setIsHighlightMenuOpen((previousValue)=>!previousValue);
6965
6865
  };
6966
6866
  const onScreenshareClick = async ()=>{
6967
- setIsHighlightMenuOpen(false);
6968
- try {
6969
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("screenshareClick");
6970
- await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).enableScreenshare();
6971
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("enableScreenshare");
6972
- } catch (screenshareError) {
6973
- console.warn(screenshareError);
6974
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("screenshareCancel");
6975
- (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(t("notifications.screensharingError"), {
6976
- className: "error"
6977
- });
6978
- }
6867
+ if (permissions.find((permission)=>permission === "screen_sharing")) {
6868
+ setIsHighlightMenuOpen(false);
6869
+ try {
6870
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("screenshareClick");
6871
+ await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).enableScreenshare();
6872
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("enableScreenshare");
6873
+ } catch (screenshareError) {
6874
+ console.warn(screenshareError);
6875
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("screenshareCancel");
6876
+ (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(t("notifications.screensharingError"), {
6877
+ className: "error"
6878
+ });
6879
+ }
6880
+ } else setBlockedFeaturePopupOpen(true);
6979
6881
  };
6980
6882
  const onYoutubeClick = ()=>{
6981
6883
  setIsHighlightMenuOpen(false);
@@ -6983,9 +6885,11 @@ const $9dfd9e2286cffa66$var$HighlightButton = ()=>{
6983
6885
  (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("youtubeClick");
6984
6886
  };
6985
6887
  const onLinkshareClick = ()=>{
6986
- setIsHighlightMenuOpen(false);
6987
- setIsLinksharePopupVisible(true);
6988
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("linkshareClick");
6888
+ if (permissions.find((permission)=>permission === "share_link")) {
6889
+ setIsHighlightMenuOpen(false);
6890
+ setIsLinksharePopupVisible(true);
6891
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("linkshareClick");
6892
+ } else setBlockedFeaturePopupOpen(true);
6989
6893
  };
6990
6894
  const menuCategories = [
6991
6895
  {
@@ -7558,6 +7462,16 @@ const $41e530447f5fd995$var$Checkmark = ()=>/*#__PURE__*/ (0, $jQDcL$reactjsxrun
7558
7462
  fill: "#fff"
7559
7463
  })
7560
7464
  });
7465
+ const $41e530447f5fd995$export$f8e32eb727ccae99 = ()=>/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("svg", {
7466
+ xmlns: "http://www.w3.org/2000/svg",
7467
+ width: "17",
7468
+ height: "18",
7469
+ fill: "none",
7470
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("path", {
7471
+ fill: "#fff",
7472
+ d: "M10.767 6.325 7.192 9.908 5.817 8.533a.833.833 0 1 0-1.175 1.175L6.6 11.675a.831.831 0 0 0 .592.241.833.833 0 0 0 .583-.241l4.166-4.167a.833.833 0 1 0-1.175-1.183ZM8.5.667a8.333 8.333 0 1 0 0 16.666A8.333 8.333 0 0 0 8.5.667Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.333Z"
7473
+ })
7474
+ });
7561
7475
  var $41e530447f5fd995$export$2e2bcd8739ae039 = $41e530447f5fd995$var$Checkmark;
7562
7476
 
7563
7477
 
@@ -8709,6 +8623,20 @@ const $2d8fe9775ff247d9$export$5e3f251c730829 = (0, ($parcel$interopDefault($jQD
8709
8623
 
8710
8624
 
8711
8625
 
8626
+
8627
+ function $41f07a84772f3ab1$export$bc98e171e8c82a3d(title) {
8628
+ (0, $jQDcL$react.useEffect)(()=>{
8629
+ const prevTitle = document.title;
8630
+ if (title) document.title = title;
8631
+ return ()=>{
8632
+ document.title = prevTitle;
8633
+ };
8634
+ }, [
8635
+ title
8636
+ ]);
8637
+ }
8638
+
8639
+
8712
8640
  const $e38290b50aaba0e3$export$a1eac7fdbc2db4af = "linkshare_sent";
8713
8641
  const $e38290b50aaba0e3$var$sendLinkNotification = (data, t)=>{
8714
8642
  let notificationStatusText = new URL(data.url).hostname;
@@ -8732,7 +8660,7 @@ const $e38290b50aaba0e3$var$sendLinkNotification = (data, t)=>{
8732
8660
  }
8733
8661
  },
8734
8662
  ellipsis: true,
8735
- duration: 10000
8663
+ duration: 15000
8736
8664
  });
8737
8665
  (0, $65bf10a117819168$export$e9785ae652b3a722)({
8738
8666
  title: data.title,
@@ -8774,22 +8702,45 @@ const $e38290b50aaba0e3$var$LinksharePopup = ()=>{
8774
8702
  const themeContext = (0, $jQDcL$react.useContext)((0, $jQDcL$styledcomponents.ThemeContext));
8775
8703
  const linksharePopupRef = (0, $jQDcL$react.useRef)(null);
8776
8704
  const linkshareInputRef = (0, $jQDcL$react.useRef)(null);
8705
+ const [pendingShareLink, setPendingShareLink] = (0, $jQDcL$react.useState)([]);
8706
+ const [title, setTitle] = (0, $jQDcL$react.useState)();
8777
8707
  const [linkshareInputValue, setLinkshareInputValue] = (0, $jQDcL$react.useState)("");
8778
8708
  const [errorMessage, setErrorMessage] = (0, $jQDcL$react.useState)(null);
8779
8709
  const [status, setStatus] = (0, $jQDcL$react.useState)("waiting");
8780
8710
  const { isLinksharePopupVisible: isLinksharePopupVisible , setIsLinksharePopupVisible: setIsLinksharePopupVisible , orientation: orientation , options: options } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
8781
8711
  const { streams: streams } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
8712
+ (0, $41f07a84772f3ab1$export$bc98e171e8c82a3d)(title);
8782
8713
  const desktop = orientation === "landscape";
8714
+ const onVisibilitychange = (0, $jQDcL$react.useCallback)(()=>{
8715
+ if (!document.hidden) {
8716
+ pendingShareLink.forEach((data)=>{
8717
+ $e38290b50aaba0e3$var$sendLinkNotification(data, t);
8718
+ });
8719
+ setPendingShareLink([]);
8720
+ setTitle(undefined);
8721
+ }
8722
+ }, [
8723
+ pendingShareLink,
8724
+ t
8725
+ ]);
8783
8726
  const onCustomMessage = (0, $jQDcL$react.useCallback)((event)=>{
8784
8727
  const { type: type , data: data } = event.detail.event;
8785
- if (type === $e38290b50aaba0e3$export$a1eac7fdbc2db4af) $e38290b50aaba0e3$var$sendLinkNotification(data, t);
8786
- else if (type === "paypal_invoice") {
8787
- const sender = streams.find((stream)=>stream.id === event.detail.peerId);
8788
- $e38290b50aaba0e3$var$sendPaypalInvoiceNotification(sender?.profile?.name, data.url, t);
8789
- }
8728
+ const sender = streams.find((stream)=>stream.id === event.detail?.peerId);
8729
+ if (type === $e38290b50aaba0e3$export$a1eac7fdbc2db4af) {
8730
+ if (!document.hidden) $e38290b50aaba0e3$var$sendLinkNotification(data, t);
8731
+ else {
8732
+ const name = sender?.profile.name?.toLowerCase() !== "user" ? sender?.profile.name : undefined;
8733
+ setPendingShareLink([
8734
+ ...pendingShareLink,
8735
+ data
8736
+ ]);
8737
+ setTitle(`${name || "Someone"} shared a link`);
8738
+ }
8739
+ } else if (type === "paypal_invoice") $e38290b50aaba0e3$var$sendPaypalInvoiceNotification(sender?.profile?.name, data.url, t);
8790
8740
  }, [
8791
8741
  streams,
8792
- t
8742
+ t,
8743
+ pendingShareLink
8793
8744
  ]);
8794
8745
  const onShareClick = async (event)=>{
8795
8746
  event.preventDefault();
@@ -8844,12 +8795,15 @@ const $e38290b50aaba0e3$var$LinksharePopup = ()=>{
8844
8795
  };
8845
8796
  const onCloseClick = ()=>setIsLinksharePopupVisible(false);
8846
8797
  (0, $jQDcL$react.useEffect)(()=>{
8798
+ window.addEventListener("visibilitychange", onVisibilitychange);
8847
8799
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("customMessage", onCustomMessage);
8848
8800
  return ()=>{
8801
+ window.removeEventListener("visibilitychange", onVisibilitychange);
8849
8802
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("customMessage", onCustomMessage);
8850
8803
  };
8851
8804
  }, [
8852
- onCustomMessage
8805
+ onCustomMessage,
8806
+ onVisibilitychange
8853
8807
  ]);
8854
8808
  const onPopupTransitionEnd = ()=>{
8855
8809
  if (isLinksharePopupVisible) linkshareInputRef.current?.focus();
@@ -9243,6 +9197,170 @@ var $8a52c9358bc52b86$export$2e2bcd8739ae039 = $8a52c9358bc52b86$var$VirtualBack
9243
9197
 
9244
9198
 
9245
9199
 
9200
+
9201
+
9202
+ const $72e3731384b9cb71$var$modalHeight = (desktop)=>desktop ? "225px" : "237px";
9203
+ const $72e3731384b9cb71$export$6e1d6efa4a5a1be4 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9204
+ position: absolute;
9205
+ width: 100%;
9206
+ bottom: ${(props)=>props.open ? 0 : `-${$72e3731384b9cb71$var$modalHeight(props.desktop)}`};
9207
+ transition: all 0.4s;
9208
+
9209
+ ${(props)=>{
9210
+ if (props.desktop) return (0, $jQDcL$styledcomponents.css)`
9211
+ bottom: ${props.open ? 0 : `calc(-${$72e3731384b9cb71$var$modalHeight(props.desktop)} - (100vh / 2))`};
9212
+ height: 100%;
9213
+ display: flex;
9214
+ justify-content: center;
9215
+ align-items: center;
9216
+ `;
9217
+ }}
9218
+ `;
9219
+ const $72e3731384b9cb71$export$ed7a64955cfa5a69 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9220
+ display: flex;
9221
+ flex-direction: column;
9222
+ width: ${(props)=>props.desktop ? "375px" : "100%"};
9223
+ height: ${({ desktop: desktop })=>$72e3731384b9cb71$var$modalHeight(desktop)};
9224
+ max-height: 100vh;
9225
+ background-color: ${(props)=>props.theme.popupBackgroundPrimaryColor};
9226
+ color: ${(props)=>props.theme.popupTitleColor};
9227
+ border-radius: ${(props)=>props.desktop ? "20px" : "20px 20px 0 0"};
9228
+ box-sizing: border-box;
9229
+ `;
9230
+ const $72e3731384b9cb71$export$6334857f32bd1136 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9231
+ display: flex;
9232
+ justify-content: space-between;
9233
+ align-items: center;
9234
+ border-bottom: 2px solid #f7f7f7;
9235
+ `;
9236
+ const $72e3731384b9cb71$export$a27d59de3a7a8b8e = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9237
+ display: flex;
9238
+ align-items: center;
9239
+ margin: 16px auto 16px 16px;
9240
+ `;
9241
+ const $72e3731384b9cb71$export$47ef2d2839b7d95a = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9242
+ font-family: 'Lato';
9243
+ font-style: normal;
9244
+ font-weight: 600;
9245
+ font-size: 18px;
9246
+ line-height: 22px;
9247
+ letter-spacing: -0.02em;
9248
+ `;
9249
+ const $72e3731384b9cb71$export$219c8e53e235e8b7 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).button`
9250
+ display: flex;
9251
+ justify-content: center;
9252
+ align-items: center;
9253
+ border: none;
9254
+ background-color: ${(props)=>props.theme.popupBackgroundSecondaryColor};
9255
+ border-radius: 50%;
9256
+ height: 30px;
9257
+ width: 30px;
9258
+ padding: 0;
9259
+ margin: 16px 16px 16px auto;
9260
+
9261
+ svg {
9262
+ height: 15px;
9263
+ width: 15px;
9264
+
9265
+ path {
9266
+ fill: #000;
9267
+ }
9268
+ }
9269
+ `;
9270
+ const $72e3731384b9cb71$export$5197cd1b80f9682b = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9271
+ display: flex;
9272
+ align-items: center;
9273
+ justify-content: center;
9274
+ font-size: 12px;
9275
+ color: #2d2d2d;
9276
+ margin: 16px 32px auto 32px;
9277
+ font-family: 'Lato';
9278
+ font-style: normal;
9279
+ font-weight: 400;
9280
+ font-size: 16px;
9281
+ line-height: 19px;
9282
+ text-align: left;
9283
+ letter-spacing: -0.02em;
9284
+ `;
9285
+ const $72e3731384b9cb71$export$5f79cadb3a637092 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).button`
9286
+ background-color: ${({ theme: theme })=>theme.primaryColor};
9287
+ padding: 8px 18px;
9288
+ height: 46px;
9289
+ max-width: 100%;
9290
+ border-radius: 15px;
9291
+ margin: 20px 32px 20px 32px;
9292
+ border: none;
9293
+ color: #fff;
9294
+ font-size: 16px;
9295
+ font-weight: 700;
9296
+ line-height: 18px;
9297
+
9298
+ span {
9299
+ display: flex;
9300
+ flex-direction: row;
9301
+ gap: 5px;
9302
+ alig-items: center;
9303
+ justify-content: center;
9304
+ }
9305
+ `;
9306
+
9307
+
9308
+
9309
+
9310
+
9311
+
9312
+
9313
+ const $5b8a9a2976fbc419$var$BlockedFeaturePopup = ()=>{
9314
+ const { t: t } = (0, $jQDcL$reacti18next.useTranslation)();
9315
+ const { isBlockedFeaturePopupOpen: isBlockedFeaturePopupOpen , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , orientation: orientation , isAgent: isAgent } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
9316
+ const popupRef = (0, $jQDcL$react.useRef)(null);
9317
+ const desktop = orientation === "landscape";
9318
+ (0, $326cea7dbbcb019a$export$71b2224f1ce5e08e)(popupRef, ()=>{
9319
+ if (isBlockedFeaturePopupOpen) setBlockedFeaturePopupOpen(false);
9320
+ });
9321
+ return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$6e1d6efa4a5a1be4), {
9322
+ open: isBlockedFeaturePopupOpen,
9323
+ desktop: desktop,
9324
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $72e3731384b9cb71$export$ed7a64955cfa5a69), {
9325
+ ref: popupRef,
9326
+ desktop: desktop,
9327
+ children: [
9328
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $72e3731384b9cb71$export$6334857f32bd1136), {
9329
+ children: [
9330
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$a27d59de3a7a8b8e), {
9331
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$47ef2d2839b7d95a), {
9332
+ children: isAgent && t("blockedFeature.titleConnected") || t("blockedFeature.titleGuest")
9333
+ })
9334
+ }),
9335
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$219c8e53e235e8b7), {
9336
+ onClick: ()=>setBlockedFeaturePopupOpen(false),
9337
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $6f36db3b1217f099$export$2e2bcd8739ae039), {})
9338
+ })
9339
+ ]
9340
+ }),
9341
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$5197cd1b80f9682b), {
9342
+ children: isAgent && t("blockedFeature.descriptionConnected") || t("blockedFeature.descriptionGuest")
9343
+ }),
9344
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$5f79cadb3a637092), {
9345
+ onClick: ()=>{
9346
+ setBlockedFeaturePopupOpen(false);
9347
+ if (isAgent) window.open(`${"https://app.snapcall.io"}/settings/workspace/plans-invoices`, "_blank");
9348
+ },
9349
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)("span", {
9350
+ children: [
9351
+ isAgent && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$f8e32eb727ccae99), {}),
9352
+ isAgent && t("blockedFeature.dismissConnected") || t("blockedFeature.dismissGuest")
9353
+ ]
9354
+ })
9355
+ })
9356
+ ]
9357
+ })
9358
+ });
9359
+ };
9360
+ var $5b8a9a2976fbc419$export$2e2bcd8739ae039 = $5b8a9a2976fbc419$var$BlockedFeaturePopup;
9361
+
9362
+
9363
+
9246
9364
  const $e6950939129bcd4b$export$8376625f8bb18347 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9247
9365
  position: absolute;
9248
9366
  width: 100%;
@@ -9255,8 +9373,8 @@ const $e6950939129bcd4b$export$8376625f8bb18347 = (0, ($parcel$interopDefault($j
9255
9373
 
9256
9374
 
9257
9375
  const $5f509eaff0d9c05a$var$Settings = ()=>{
9258
- const { isQuickConnectPopupVisible: isQuickConnectPopupVisible , isSettingsMenuVisible: isSettingsMenuVisible , isYoutubePopupVisible: isYoutubePopupVisible , isLinksharePopupVisible: isLinksharePopupVisible , isVirtualBackgroundPopupVisible: isVirtualBackgroundPopupVisible , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
9259
- const open = isQuickConnectPopupVisible || isSettingsMenuVisible || isYoutubePopupVisible || isLinksharePopupVisible || isVirtualBackgroundPopupVisible;
9376
+ const { isQuickConnectPopupVisible: isQuickConnectPopupVisible , isSettingsMenuVisible: isSettingsMenuVisible , isYoutubePopupVisible: isYoutubePopupVisible , isLinksharePopupVisible: isLinksharePopupVisible , isVirtualBackgroundPopupVisible: isVirtualBackgroundPopupVisible , isBlockedFeaturePopupOpen: isBlockedFeaturePopupOpen , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
9377
+ const open = isQuickConnectPopupVisible || isSettingsMenuVisible || isYoutubePopupVisible || isBlockedFeaturePopupOpen || isLinksharePopupVisible || isVirtualBackgroundPopupVisible;
9260
9378
  return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $e6950939129bcd4b$export$8376625f8bb18347), {
9261
9379
  open: open,
9262
9380
  children: [
@@ -9264,7 +9382,8 @@ const $5f509eaff0d9c05a$var$Settings = ()=>{
9264
9382
  /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $7d4fa7ceb4c29739$export$2e2bcd8739ae039), {}),
9265
9383
  /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $696ded7a5399bcd4$export$2e2bcd8739ae039), {}),
9266
9384
  /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $e38290b50aaba0e3$export$2e2bcd8739ae039), {}),
9267
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $8a52c9358bc52b86$export$2e2bcd8739ae039), {})
9385
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $8a52c9358bc52b86$export$2e2bcd8739ae039), {}),
9386
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5b8a9a2976fbc419$export$2e2bcd8739ae039), {})
9268
9387
  ]
9269
9388
  });
9270
9389
  };
@@ -9365,10 +9484,12 @@ var $3d1bfd8f074b99b1$export$2e2bcd8739ae039 = $3d1bfd8f074b99b1$var$EndView;
9365
9484
 
9366
9485
 
9367
9486
 
9487
+
9368
9488
  const $5dcd9e6925c7037c$var$connected = new Audio("https://cdn.snapcall.io/stream/connected.mp3");
9369
9489
  const $5dcd9e6925c7037c$var$disconnected = new Audio("https://cdn.snapcall.io/stream/disconnected.mp3");
9370
9490
  const $5dcd9e6925c7037c$var$userConnected = new Audio("https://cdn.snapcall.io/stream/user-connected.mp3");
9371
9491
  const $5dcd9e6925c7037c$var$userDisconnected = new Audio("https://cdn.snapcall.io/stream/user-disconnected.mp3");
9492
+ const $5dcd9e6925c7037c$var$linkReceived = new Audio("https://cdn.snapcall.io/stream/link-received.mp3");
9372
9493
  const $5dcd9e6925c7037c$var$Sounds = ()=>{
9373
9494
  const { userInteractionTriggered: userInteractionTriggered } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
9374
9495
  const onEnterRoom = async ()=>{
@@ -9401,14 +9522,24 @@ const $5dcd9e6925c7037c$var$Sounds = ()=>{
9401
9522
  console.warn("Couldn't play disconnected sound");
9402
9523
  }
9403
9524
  };
9525
+ const onCustomMessage = async (event)=>{
9526
+ const { type: type } = event.detail.event;
9527
+ if (type === (0, $e38290b50aaba0e3$export$a1eac7fdbc2db4af)) try {
9528
+ await $5dcd9e6925c7037c$var$linkReceived.play();
9529
+ } catch (disconnectedPlayError) {
9530
+ console.warn("Couldn't play link-received sound");
9531
+ }
9532
+ };
9404
9533
  (0, $jQDcL$react.useEffect)(()=>{
9405
9534
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("newPeer", onNewPeer);
9406
9535
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("peerClosed", onPeerClosed);
9407
9536
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("leaveRoom", onLeaveRoom);
9537
+ (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("customMessage", onCustomMessage);
9408
9538
  return ()=>{
9409
9539
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("newPeer", onNewPeer);
9410
9540
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("peerClosed", onPeerClosed);
9411
9541
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("leaveRoom", onLeaveRoom);
9542
+ (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("customMessage", onCustomMessage);
9412
9543
  };
9413
9544
  }, []);
9414
9545
  (0, $jQDcL$react.useEffect)(()=>{
@@ -10146,6 +10277,9 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
10146
10277
  const [userInteractionTriggered, setUserInteractionTriggered] = (0, $jQDcL$react.useState)(false);
10147
10278
  const [containerWidth, containerHeight] = (0, $56e1e7a85d8bf4bb$export$2b86bedf890eab8)(streamUIContainerRef.current);
10148
10279
  const [isBlockedDevicesPopupOpen, setBlockedDevicesPopupOpen] = (0, $jQDcL$react.useState)(false);
10280
+ const [isBlockedFeaturePopupOpen, setBlockedFeaturePopupOpen] = (0, $jQDcL$react.useState)(false);
10281
+ const [permissions, setPermissions] = (0, $jQDcL$react.useState)([]);
10282
+ const [plan, setPlan] = (0, $jQDcL$react.useState)(undefined);
10149
10283
  const orientation = (containerWidth || window.screen.width) > (containerHeight || window.screen.height) ? "landscape" : "portrait";
10150
10284
  const styledTheme = theme === "dark" ? (0, $9295e87e6b93e693$export$3e936a8db52a10a0) : (0, $9295e87e6b93e693$export$f30cb9bc4f736419);
10151
10285
  const onWebcamUpdate = (event)=>{
@@ -10274,6 +10408,9 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
10274
10408
  (0, $jQDcL$react.useEffect)(()=>{
10275
10409
  const onEnterRoom = async (event)=>{
10276
10410
  const peerId = event.detail.peerId;
10411
+ setPlan(event.detail.plan);
10412
+ setPermissions(event.detail.permissions);
10413
+ console.log(event.detail.permissions);
10277
10414
  setSelfPeerId(peerId);
10278
10415
  try {
10279
10416
  await (0, $c3d5253d9d597eb5$export$494039379563c94d)(options);
@@ -10292,6 +10429,8 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
10292
10429
  ]);
10293
10430
  return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $8b39f32976a7698a$export$2e2bcd8739ae039).Provider, {
10294
10431
  value: {
10432
+ plan: plan,
10433
+ permissions: permissions,
10295
10434
  selfPeerId: selfPeerId,
10296
10435
  streamUIContainerRef: streamUIContainerRef,
10297
10436
  videosContainerRef: videosContainerRef,
@@ -10308,6 +10447,8 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
10308
10447
  setIsLinksharePopupVisible: setIsLinksharePopupVisible,
10309
10448
  isVirtualBackgroundPopupVisible: isVirtualBackgroundPopupVisible,
10310
10449
  setIsVirtualBackgroundPopupVisible: setIsVirtualBackgroundPopupVisible,
10450
+ isBlockedFeaturePopupOpen: isBlockedFeaturePopupOpen,
10451
+ setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen,
10311
10452
  theme: theme,
10312
10453
  setTheme: setTheme,
10313
10454
  language: language,
@@ -10841,7 +10982,8 @@ const $e68207026aca356b$export$3f94917203ab7078 = {
10841
10982
  getState: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).getState.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10842
10983
  setProfile: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setProfile.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10843
10984
  /* Should not be documented */ setConfig: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setConfig.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10844
- setLogLevel: (level)=>(0, $d0c6baf97675ab49$export$2e2bcd8739ae039).setLogLevel(level)
10985
+ setLogLevel: (level)=>(0, $d0c6baf97675ab49$export$2e2bcd8739ae039).setLogLevel(level),
10986
+ getPermissions: ()=>(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).getPermissions()
10845
10987
  };
10846
10988
  window.streamUI = $e68207026aca356b$export$3f94917203ab7078;
10847
10989
  // Backward compatibility