@snapcall/stream-ui 1.10.1 → 1.11.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.
@@ -3,7 +3,7 @@ import {createRoot as $3Sbms$createRoot} from "react-dom/client";
3
3
  import $3Sbms$hotjarbrowser from "@hotjar/browser";
4
4
  import $3Sbms$reacthottoast, {toast as $3Sbms$toast, Toaster as $3Sbms$Toaster, ToastBar as $3Sbms$ToastBar} from "react-hot-toast";
5
5
  import $3Sbms$styledcomponents, {keyframes as $3Sbms$keyframes, ThemeProvider as $3Sbms$ThemeProvider, css as $3Sbms$css, ThemeContext as $3Sbms$ThemeContext, createGlobalStyle as $3Sbms$createGlobalStyle} from "styled-components";
6
- import {useState as $3Sbms$useState, useRef as $3Sbms$useRef, useEffect as $3Sbms$useEffect, useContext as $3Sbms$useContext, useMemo as $3Sbms$useMemo, createContext as $3Sbms$createContext, useReducer as $3Sbms$useReducer, useLayoutEffect as $3Sbms$useLayoutEffect, useCallback as $3Sbms$useCallback} from "react";
6
+ import $3Sbms$react, {useState as $3Sbms$useState, useRef as $3Sbms$useRef, useEffect as $3Sbms$useEffect, useContext as $3Sbms$useContext, useMemo as $3Sbms$useMemo, createContext as $3Sbms$createContext, useReducer as $3Sbms$useReducer, useLayoutEffect as $3Sbms$useLayoutEffect, useCallback as $3Sbms$useCallback, forwardRef as $3Sbms$forwardRef} from "react";
7
7
  import "inobounce";
8
8
  import $3Sbms$i18next from "i18next";
9
9
  import {initReactI18next as $3Sbms$initReactI18next, useTranslation as $3Sbms$useTranslation} from "react-i18next";
@@ -16,10 +16,22 @@ import {Device as $3Sbms$Device} from "mediasoup-client";
16
16
  import {SelfieSegmentation as $3Sbms$SelfieSegmentation} from "@mediapipe/selfie_segmentation";
17
17
  import {createPortal as $3Sbms$createPortal} from "react-dom";
18
18
  import {toCanvas as $3Sbms$toCanvas} from "qrcode";
19
+ import {useOverlayTriggerState as $3Sbms$useOverlayTriggerState, useToggleState as $3Sbms$useToggleState} from "react-stately";
20
+ import $3Sbms$classnames from "classnames";
21
+ import {useToggleButton as $3Sbms$useToggleButton, useFocusRing as $3Sbms$useFocusRing, useButton as $3Sbms$useButton} from "react-aria";
22
+ import {useModalOverlay as $3Sbms$useModalOverlay, Overlay as $3Sbms$Overlay} from "@react-aria/overlays";
23
+ import {useViewportSize as $3Sbms$useViewportSize} from "@react-aria/utils";
24
+ import {CSSTransition as $3Sbms$CSSTransition} from "react-transition-group";
25
+ import {useHover as $3Sbms$useHover} from "@react-aria/interactions";
26
+ import $3Sbms$reactcontentloader from "react-content-loader";
27
+
28
+ function $parcel$interopDefault(a) {
29
+ return a && a.__esModule ? a.default : a;
30
+ }
19
31
 
20
32
 
21
33
 
22
-
34
+ // https://github.com/voodoocreation/ts-deepmerge/blob/master/src/index.ts
23
35
  const $365e765f9890497b$var$isObject = (obj)=>{
24
36
  if (typeof obj === "object" && obj !== null) {
25
37
  if (typeof Object.getPrototypeOf === "function") {
@@ -806,7 +818,7 @@ var $384d985bb9605c35$export$2e2bcd8739ae039 = (0, $3Sbms$i18next);
806
818
 
807
819
 
808
820
 
809
-
821
+ /* eslint-disable no-console */
810
822
  const $0f65a9eaf4a1e910$var$LogLevel = {
811
823
  error: 1,
812
824
  warn: 2,
@@ -973,8 +985,8 @@ class $67e45b2e30dcc030$export$ea669869acd8f177 {
973
985
  });
974
986
  try {
975
987
  this.audioStreamSource.disconnect(this.analyser);
976
- } catch (err1) {
977
- $67e45b2e30dcc030$var$log.error("release", "audioStreamSource failed to disconnect", err1);
988
+ } catch (err) {
989
+ $67e45b2e30dcc030$var$log.error("release", "audioStreamSource failed to disconnect", err);
978
990
  }
979
991
  this.audioContext.close().catch((err)=>{
980
992
  $67e45b2e30dcc030$var$log.error("release", "audioContext failed to close", err);
@@ -1228,7 +1240,7 @@ class $0148b6fd862a22e8$export$2e2bcd8739ae039 {
1228
1240
  live = false;
1229
1241
  fps = 24;
1230
1242
  blurLevel = 10;
1231
- timerWorker = new Worker(new URL("timer.370d0e5a.js", import.meta.url), {
1243
+ timerWorker = new Worker(new URL("timer.7144fe82.js", import.meta.url), {
1232
1244
  name: "VirtualBackgroundTimerWorker"
1233
1245
  });
1234
1246
  constructor(stream, options){
@@ -1360,7 +1372,7 @@ class $0148b6fd862a22e8$export$2e2bcd8739ae039 {
1360
1372
 
1361
1373
 
1362
1374
  const $c31e3fb4360572af$var$log = new (0, $0f65a9eaf4a1e910$export$2e2bcd8739ae039)("StreamerClient");
1363
- const $c31e3fb4360572af$export$818d60b2e626da0c = {
1375
+ const $c31e3fb4360572af$export$103bedf43ba882db = {
1364
1376
  WEBRTC_FAILED: "WRTC1",
1365
1377
  WEBRTC_RECOVER_ERROR: "WRTC2",
1366
1378
  CREATE_TRANSPORT_FAILED: "TRANS1",
@@ -1409,7 +1421,7 @@ const $c31e3fb4360572af$var$WEBCAM_SIMULCAST_ENCODINGS = [
1409
1421
  {
1410
1422
  scaleResolutionDownBy: 1,
1411
1423
  maxBitrate: 5000000
1412
- },
1424
+ }
1413
1425
  ];
1414
1426
  const $c31e3fb4360572af$var$SCREEN_SHARING_SIMULCAST_ENCODINGS = [
1415
1427
  {
@@ -1419,7 +1431,7 @@ const $c31e3fb4360572af$var$SCREEN_SHARING_SIMULCAST_ENCODINGS = [
1419
1431
  {
1420
1432
  dtx: true,
1421
1433
  maxBitrate: 6000000
1422
- },
1434
+ }
1423
1435
  ];
1424
1436
  class $c31e3fb4360572af$var$SnapcallEvent extends CustomEvent {
1425
1437
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
@@ -1447,6 +1459,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1447
1459
  super();
1448
1460
  navigator.mediaDevices.addEventListener("devicechange", ()=>this.onDeviceChange());
1449
1461
  this.config = {
1462
+ streamApiURL: String("https://apistream.snapcall.io"),
1450
1463
  apiUrl: String("https://api.snapcall.io/v2"),
1451
1464
  streamerServer: String("wss://g.snapcall.io/stream"),
1452
1465
  streamerApi: String("https://g.snapcall.io/stream"),
@@ -1456,7 +1469,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1456
1469
  username: "test",
1457
1470
  credential: "test",
1458
1471
  credentialType: "password"
1459
- },
1472
+ }
1460
1473
  ]
1461
1474
  };
1462
1475
  this.peers = new Map();
@@ -1564,7 +1577,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1564
1577
  if (!this.peerId) this.peerId = (0, $3Sbms$v4)();
1565
1578
  let url;
1566
1579
  try {
1567
- const { streamer_instance: instanceId , plan: { permissions: permissions , name: name } , } = await fetch(`${this.config.apiUrl}/streams/${room}/info`, {
1580
+ const { streamer_instance: instanceId , plan: { permissions: permissions , name: name } } = await fetch(`${this.config.apiUrl}/streams/${room}/info`, {
1568
1581
  method: "get",
1569
1582
  headers: {
1570
1583
  "Content-Type": "application/json"
@@ -1575,7 +1588,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1575
1588
  });
1576
1589
  this.permissions = permissions;
1577
1590
  this.plan = name;
1578
- url = `${this.config.streamerServer}/${instanceId}/?roomId=${room}&peerId=${this.peerId}`;
1591
+ url = `${this.config.streamerServer}/${instanceId}${this.joinOptions.recorder ? "/recorder" : ""}?roomId=${room}&peerId=${this.peerId}`;
1579
1592
  } catch (roomError) {
1580
1593
  const event = new $c31e3fb4360572af$var$SnapcallEvent("invalidRoom", {
1581
1594
  detail: {}
@@ -1591,21 +1604,25 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1591
1604
  });
1592
1605
  this.protoo = new $3Sbms$Peer(this.protooTransport);
1593
1606
  this.protoo.on("open", ()=>{
1607
+ if (this.joinOptions.recorder) {
1608
+ this.joinRecorder();
1609
+ return;
1610
+ }
1594
1611
  this.joinRoom();
1595
1612
  });
1596
1613
  this.protoo.on("failed", ()=>{
1597
1614
  $c31e3fb4360572af$var$log.error("protoo.on", "failed");
1598
- this.onCriticalError($c31e3fb4360572af$export$818d60b2e626da0c.SOCKET_LOST);
1615
+ this.onCriticalError($c31e3fb4360572af$export$103bedf43ba882db.SOCKET_LOST);
1599
1616
  });
1600
1617
  this.protoo.on("disconnected", ()=>{
1601
1618
  $c31e3fb4360572af$var$log.error("protoo.on", "disconnected");
1602
- this.onCriticalError($c31e3fb4360572af$export$818d60b2e626da0c.SOCKET_LOST);
1619
+ this.onCriticalError($c31e3fb4360572af$export$103bedf43ba882db.SOCKET_LOST);
1603
1620
  });
1604
1621
  this.protoo.on("close", ()=>$c31e3fb4360572af$var$log.log("protoo.on", "close :("));
1605
1622
  this.protoo.on("notification", async (notification)=>{
1606
1623
  $c31e3fb4360572af$var$log.log("notification", notification);
1607
1624
  if (notification.method === "error") {
1608
- if (notification.data?.reason === "reached user limit") this.onCriticalError($c31e3fb4360572af$export$818d60b2e626da0c.USER_LIMIT);
1625
+ if (notification.data?.reason === "reached user limit") this.onCriticalError($c31e3fb4360572af$export$103bedf43ba882db.USER_LIMIT);
1609
1626
  } else if (notification.method === "newPeer") {
1610
1627
  const { id: id , profile: profile , muted: muted } = notification.data;
1611
1628
  this.peers.set(id, {
@@ -1651,7 +1668,10 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1651
1668
  this.onConsumerClose({
1652
1669
  consumerId: consumerId
1653
1670
  });
1654
- } else if (notification.method === "displayName") {
1671
+ } else if (notification.method === "recordStopped") this.dispatchEvent(new $c31e3fb4360572af$var$SnapcallEvent("recordStopped", {
1672
+ detail: notification.data
1673
+ }));
1674
+ else if (notification.method === "displayName") {
1655
1675
  const { peerId: peerId , displayName: displayName } = notification.data;
1656
1676
  const event = new $c31e3fb4360572af$var$SnapcallEvent("displayName", {
1657
1677
  detail: {
@@ -1731,17 +1751,17 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1731
1751
  });
1732
1752
  this.dispatchEvent(event);
1733
1753
  } else if (notification.method === "customMessage") {
1734
- const { messageId: messageId , chunk: chunk1 , chunkIndex: chunkIndex , totalChunks: totalChunks } = notification.data.event;
1754
+ const { messageId: messageId , chunk: chunk , chunkIndex: chunkIndex , totalChunks: totalChunks } = notification.data.event;
1735
1755
  const existingMessage = this.customMessages.get(messageId);
1736
1756
  if (existingMessage) existingMessage.chunks.push({
1737
1757
  index: chunkIndex,
1738
- data: chunk1
1758
+ data: chunk
1739
1759
  });
1740
1760
  else this.customMessages.set(messageId, {
1741
1761
  chunks: [
1742
1762
  {
1743
1763
  index: chunkIndex,
1744
- data: chunk1
1764
+ data: chunk
1745
1765
  }
1746
1766
  ],
1747
1767
  totalChunks: totalChunks
@@ -1786,7 +1806,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1786
1806
  transport.transport = await promise;
1787
1807
  if (transport.transport) this.listenWebRTCTransportStates(transport);
1788
1808
  } catch (err) {
1789
- this.onCriticalError($c31e3fb4360572af$export$818d60b2e626da0c.CREATE_TRANSPORT_FAILED);
1809
+ this.onCriticalError($c31e3fb4360572af$export$103bedf43ba882db.CREATE_TRANSPORT_FAILED);
1790
1810
  throw err;
1791
1811
  }
1792
1812
  return transport.transport;
@@ -1813,7 +1833,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1813
1833
  }
1814
1834
  });
1815
1835
  $c31e3fb4360572af$var$log.error("listenWebRTCTransportStats", "webrtc stat failed", err);
1816
- this.onCriticalError($c31e3fb4360572af$export$818d60b2e626da0c.WEBRTC_FAILED);
1836
+ this.onCriticalError($c31e3fb4360572af$export$103bedf43ba882db.WEBRTC_FAILED);
1817
1837
  }
1818
1838
  }
1819
1839
  });
@@ -1854,7 +1874,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1854
1874
  {
1855
1875
  ...peer,
1856
1876
  peerId: peer.id || peer.peerId
1857
- },
1877
+ }
1858
1878
  ]));
1859
1879
  const callId = await this.getCallId();
1860
1880
  this.dispatchEvent(new $c31e3fb4360572af$var$SnapcallEvent("enterRoom", {
@@ -1882,6 +1902,19 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1882
1902
  });
1883
1903
  });
1884
1904
  }
1905
+ async joinRecorder() {
1906
+ this.streamerMediasoup = await (0, $a2f0e3c29b11c88e$export$2e2bcd8739ae039).create(this.protoo, this.config);
1907
+ const callId = await this.getCallId();
1908
+ this.dispatchEvent(new $c31e3fb4360572af$var$SnapcallEvent("enterRoom", {
1909
+ detail: {
1910
+ peerId: this.peerId,
1911
+ peers: [],
1912
+ callId: callId,
1913
+ plan: this.plan,
1914
+ permissions: this.permissions
1915
+ }
1916
+ }));
1917
+ }
1885
1918
  async switchMicrophone(deviceId) {
1886
1919
  try {
1887
1920
  $c31e3fb4360572af$var$log.log("switchMicrophone", "switching Microphone");
@@ -2137,7 +2170,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2137
2170
  iceParameters: iceParameters
2138
2171
  });
2139
2172
  } catch (err) {
2140
- this.onCriticalError($c31e3fb4360572af$export$818d60b2e626da0c.WEBRTC_RECOVER_ERROR);
2173
+ this.onCriticalError($c31e3fb4360572af$export$103bedf43ba882db.WEBRTC_RECOVER_ERROR);
2141
2174
  $c31e3fb4360572af$var$log.log("restartIce", "restartIceFailed", err);
2142
2175
  $3Sbms$captureException(err, {
2143
2176
  extra: {
@@ -2204,20 +2237,39 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2204
2237
  if (!this.webcamProducer || this.webcamProducer.closed) return;
2205
2238
  await this.switchWebcam({});
2206
2239
  }
2207
- async switchWebcam({ device: device , resolution: resolution , rotate: rotate }) {
2240
+ async switchWebcam({ device: device , resolution: resolution , rotate: rotate , frameRate: frameRate , facingMode: facingMode }) {
2208
2241
  if (!this.webcam.device) throw new Error("no webcam devices");
2242
+ const optionalParam = {};
2209
2243
  if (rotate) {
2210
- const webcams = Array.from(this.webcams.keys());
2211
- const deviceId = this.webcam?.device?.deviceId || "unknow";
2212
- let newWebcamIndex = webcams.indexOf(deviceId);
2213
- if (newWebcamIndex < webcams.length - 1) newWebcamIndex++;
2214
- else newWebcamIndex = 0;
2215
- const newWebcamDevice = this.webcams.get(webcams[newWebcamIndex]);
2216
- if (!newWebcamDevice) throw new Error("no webcam device");
2217
- this.webcam.device = newWebcamDevice;
2218
- this.webcam.resolution = "hd";
2244
+ if (this.webcam.facingMode) {
2245
+ console.log("switch by facing mod");
2246
+ this.webcam.facingMode = this.webcam.facingMode === "user" ? "environment" : "user";
2247
+ optionalParam.facingMode = this.webcam.facingMode;
2248
+ } else {
2249
+ const webcams = Array.from(this.webcams.keys());
2250
+ const deviceId = this.webcam?.device?.deviceId || "unknow";
2251
+ let newWebcamIndex = webcams.indexOf(deviceId);
2252
+ if (newWebcamIndex < webcams.length - 1) newWebcamIndex++;
2253
+ else newWebcamIndex = 0;
2254
+ const newWebcamDevice = this.webcams.get(webcams[newWebcamIndex]);
2255
+ if (!newWebcamDevice) throw new Error("no webcam device");
2256
+ this.webcam.device = newWebcamDevice;
2257
+ this.webcam.resolution = "hd";
2258
+ optionalParam.deviceId = {
2259
+ ideal: this.webcam.device?.deviceId
2260
+ };
2261
+ }
2219
2262
  } else {
2220
- if (device) this.webcam.device = device;
2263
+ if (facingMode) {
2264
+ this.webcam.facingMode = facingMode;
2265
+ optionalParam.facingMode = this.webcam.facingMode;
2266
+ } else if (device) {
2267
+ this.webcam.device = device;
2268
+ this.webcam.facingMode = undefined;
2269
+ optionalParam.deviceId = {
2270
+ ideal: this.webcam.device.deviceId
2271
+ };
2272
+ }
2221
2273
  if (resolution) this.webcam.resolution = resolution;
2222
2274
  }
2223
2275
  let usedResolution = $c31e3fb4360572af$export$d21ffcc5eb136bfa[resolution || this.webcam.resolution];
@@ -2237,9 +2289,8 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2237
2289
  });
2238
2290
  const mediaStream = await this.handleGetUserMediaError("webcam", navigator.mediaDevices.getUserMedia({
2239
2291
  video: {
2240
- deviceId: {
2241
- ideal: this.webcam.device.deviceId
2242
- },
2292
+ frameRate: frameRate,
2293
+ ...optionalParam,
2243
2294
  ...usedResolution
2244
2295
  }
2245
2296
  }));
@@ -2269,7 +2320,16 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2269
2320
  }
2270
2321
  async enableVideo(config) {
2271
2322
  await this.updateWebcams();
2272
- if (config?.device) this.webcam.device = config.device;
2323
+ const optionalParam = {};
2324
+ if (config?.facingMode) {
2325
+ optionalParam.facingMode = config.facingMode;
2326
+ this.webcam.facingMode = config.facingMode;
2327
+ } else {
2328
+ if (config?.device) this.webcam.device = config.device;
2329
+ optionalParam.deviceId = {
2330
+ ideal: this.webcam.device?.deviceId
2331
+ };
2332
+ }
2273
2333
  if (!this.webcam.device) throw new Error("no webcam devices");
2274
2334
  let usedResolution = $c31e3fb4360572af$export$d21ffcc5eb136bfa[config?.resolution || this.webcam.resolution];
2275
2335
  if (this.useVideoBackground) usedResolution = {
@@ -2283,12 +2343,18 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2283
2343
  };
2284
2344
  const mediaStream = await this.handleGetUserMediaError("webcam", navigator.mediaDevices.getUserMedia({
2285
2345
  video: {
2286
- deviceId: {
2287
- ideal: this.webcam.device.deviceId
2288
- },
2346
+ frameRate: config?.frameRate,
2347
+ ...optionalParam,
2289
2348
  ...usedResolution
2290
2349
  }
2291
2350
  }));
2351
+ if (config?.facingMode) try {
2352
+ const capabilities = mediaStream.getVideoTracks()[0].getCapabilities();
2353
+ if (!capabilities?.facingMode || capabilities.facingMode.length === 0) throw new Error("no facing mod");
2354
+ } catch {
2355
+ this.webcam.device = this.webcams.values().next().value;
2356
+ this.webcam.facingMode = undefined;
2357
+ }
2292
2358
  if (this.useVideoBackground) {
2293
2359
  if (this.mediaPipe) await this.mediaPipe.clean();
2294
2360
  this.mediaPipe = new (0, $0148b6fd862a22e8$export$2e2bcd8739ae039)(mediaStream, this.mediaPipeOption);
@@ -2344,7 +2410,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2344
2410
  advanced: [
2345
2411
  {
2346
2412
  zoom: this.webcamZoom.min * 2
2347
- },
2413
+ }
2348
2414
  ]
2349
2415
  });
2350
2416
  }
@@ -2355,7 +2421,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2355
2421
  advanced: [
2356
2422
  {
2357
2423
  zoom: this.webcamZoom.min
2358
- },
2424
+ }
2359
2425
  ]
2360
2426
  });
2361
2427
  }
@@ -2464,6 +2530,27 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2464
2530
  element.srcObject = mediaStream;
2465
2531
  } else $c31e3fb4360572af$var$log.error("requestVideo", `Video consumer ${consumer} not found`);
2466
2532
  }
2533
+ async saveCapture(base64Image) {
2534
+ const { objectUrl: objectUrl } = await fetch(`${this.config.streamApiURL}/uploadSnapshot`, {
2535
+ method: "POST",
2536
+ body: JSON.stringify({
2537
+ file: base64Image
2538
+ })
2539
+ }).then((rawResponse)=>rawResponse.json());
2540
+ const res = await this.protoo.request("addCapture", {
2541
+ url: objectUrl
2542
+ });
2543
+ return {
2544
+ url: objectUrl,
2545
+ assetId: res.assetId
2546
+ };
2547
+ }
2548
+ async deleteCapture(assetId) {
2549
+ const res = await this.protoo.request("deleteCapture", {
2550
+ assetId: assetId
2551
+ });
2552
+ return res;
2553
+ }
2467
2554
  async captureVideo(videoElement) {
2468
2555
  if (this.permissions.find((permission)=>permission === "instant_picture")) {
2469
2556
  let image;
@@ -2558,7 +2645,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2558
2645
  consumerId: consumer.id
2559
2646
  });
2560
2647
  } catch (error) {
2561
- this.onCriticalError($c31e3fb4360572af$export$818d60b2e626da0c.CONSUME_ERROR);
2648
+ this.onCriticalError($c31e3fb4360572af$export$103bedf43ba882db.CONSUME_ERROR);
2562
2649
  $c31e3fb4360572af$var$log.error("consumeProducer", "newConsumer request failed", error);
2563
2650
  throw error;
2564
2651
  }
@@ -2762,6 +2849,12 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
2762
2849
  getPermissions() {
2763
2850
  return this.permissions;
2764
2851
  }
2852
+ async startRecord() {
2853
+ await this.protoo.request("startRecord");
2854
+ }
2855
+ async stopRecord() {
2856
+ await this.protoo.request("stopRecord");
2857
+ }
2765
2858
  }
2766
2859
 
2767
2860
 
@@ -2776,17 +2869,17 @@ var $5f30d8bf4f04621e$export$2e2bcd8739ae039 = $5f30d8bf4f04621e$var$StreamUICon
2776
2869
 
2777
2870
 
2778
2871
  let $2884da8a64948e35$export$96a9662a3eda31f6;
2779
- (function(StreamsReducerActionTypes1) {
2780
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_STREAMS"] = 0] = "SET_STREAMS";
2781
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["ADD_STREAM"] = 1] = "ADD_STREAM";
2782
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["REMOVE_STREAM"] = 2] = "REMOVE_STREAM";
2783
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["DEVICE_UPDATE"] = 3] = "DEVICE_UPDATE";
2784
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["MUTE"] = 4] = "MUTE";
2785
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["UNMUTE"] = 5] = "UNMUTE";
2786
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_HIGHLIGHTED_TILE"] = 6] = "SET_HIGHLIGHTED_TILE";
2787
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["UNSET_HIGHLIGHTED_TILE"] = 7] = "UNSET_HIGHLIGHTED_TILE";
2788
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_STREAM_PROFILE"] = 8] = "SET_STREAM_PROFILE";
2789
- StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_STREAM_SPEAKING"] = 9] = "SET_STREAM_SPEAKING";
2872
+ (function(StreamsReducerActionTypes) {
2873
+ StreamsReducerActionTypes[StreamsReducerActionTypes["SET_STREAMS"] = 0] = "SET_STREAMS";
2874
+ StreamsReducerActionTypes[StreamsReducerActionTypes["ADD_STREAM"] = 1] = "ADD_STREAM";
2875
+ StreamsReducerActionTypes[StreamsReducerActionTypes["REMOVE_STREAM"] = 2] = "REMOVE_STREAM";
2876
+ StreamsReducerActionTypes[StreamsReducerActionTypes["DEVICE_UPDATE"] = 3] = "DEVICE_UPDATE";
2877
+ StreamsReducerActionTypes[StreamsReducerActionTypes["MUTE"] = 4] = "MUTE";
2878
+ StreamsReducerActionTypes[StreamsReducerActionTypes["UNMUTE"] = 5] = "UNMUTE";
2879
+ StreamsReducerActionTypes[StreamsReducerActionTypes["SET_HIGHLIGHTED_TILE"] = 6] = "SET_HIGHLIGHTED_TILE";
2880
+ StreamsReducerActionTypes[StreamsReducerActionTypes["UNSET_HIGHLIGHTED_TILE"] = 7] = "UNSET_HIGHLIGHTED_TILE";
2881
+ StreamsReducerActionTypes[StreamsReducerActionTypes["SET_STREAM_PROFILE"] = 8] = "SET_STREAM_PROFILE";
2882
+ StreamsReducerActionTypes[StreamsReducerActionTypes["SET_STREAM_SPEAKING"] = 9] = "SET_STREAM_SPEAKING";
2790
2883
  })($2884da8a64948e35$export$96a9662a3eda31f6 || ($2884da8a64948e35$export$96a9662a3eda31f6 = {}));
2791
2884
  const $2884da8a64948e35$export$7fc21eab2c971c9c = {
2792
2885
  streams: [],
@@ -2997,6 +3090,52 @@ const $a1ac29d50bdaa837$var$SnapcallLogoMedium = ()=>{
2997
3090
  })
2998
3091
  });
2999
3092
  };
3093
+ const $a1ac29d50bdaa837$export$3741e4ac43f04ca2 = ()=>{
3094
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)("svg", {
3095
+ width: "48",
3096
+ height: "48",
3097
+ viewBox: "0 0 48 48",
3098
+ fill: "none",
3099
+ xmlns: "http://www.w3.org/2000/svg",
3100
+ children: [
3101
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("g", {
3102
+ clipPath: "url(#clip0_243_300)",
3103
+ children: [
3104
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
3105
+ d: "M0 24C0 4.236 4.236 0 24 0C43.764 0 48 4.236 48 24C48 43.764 43.764 48 24 48C4.236 48 0 43.764 0 24Z",
3106
+ fill: "black"
3107
+ }),
3108
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
3109
+ d: "M24.15 38.2856C25.7279 38.2856 27.0502 36.9758 26.5626 35.4753C26.1419 34.1801 25.4321 32.9898 24.4746 32.0064C22.853 30.341 20.6537 29.4053 18.3605 29.4053C16.0673 29.4053 13.8679 30.341 12.2464 32.0064C11.2888 32.9898 10.5791 34.1801 10.1583 35.4753C9.67078 36.9758 10.9931 38.2856 12.571 38.2856H24.15Z",
3110
+ fill: "white"
3111
+ }),
3112
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
3113
+ d: "M23.8494 9.71436C22.2714 9.71436 20.9491 11.0242 21.4367 12.5249C21.8574 13.8199 22.5672 15.0102 23.5248 15.9937C25.1463 17.6591 27.3456 18.5947 29.6389 18.5947C31.932 18.5947 34.1314 17.6591 35.7529 15.9937C36.7106 15.0102 37.4203 13.8199 37.8409 12.5249C38.3286 11.0242 37.0063 9.71436 35.4283 9.71436H23.8494Z",
3114
+ fill: "white"
3115
+ }),
3116
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
3117
+ d: "M29.6387 35.4287C29.6387 37.0067 30.953 38.3301 32.4415 37.8064C33.6767 37.3715 34.8118 36.6509 35.7527 35.6847C37.3744 34.0195 38.2852 31.7606 38.2852 29.4055C38.2852 27.0502 37.3744 24.7915 35.7527 23.1261C34.8118 22.1599 33.6767 21.4393 32.4415 21.0046C30.953 20.4807 29.6387 21.8043 29.6387 23.3823V35.4287Z",
3118
+ fill: "white"
3119
+ }),
3120
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
3121
+ d: "M18.3605 12.5712C18.3605 10.9933 17.0461 9.66972 15.5576 10.1936C14.3224 10.6283 13.1872 11.3489 12.2464 12.3151C10.6248 13.9804 9.71387 16.2392 9.71387 18.5944C9.71387 20.9496 10.6248 23.2083 12.2464 24.8737C13.1872 25.8399 14.3224 26.5605 15.5576 26.9952C17.0461 27.5191 18.3605 26.1955 18.3605 24.6176V12.5712Z",
3122
+ fill: "white"
3123
+ })
3124
+ ]
3125
+ }),
3126
+ /*#__PURE__*/ (0, $3Sbms$jsx)("defs", {
3127
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("clipPath", {
3128
+ id: "clip0_243_300",
3129
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("rect", {
3130
+ width: "48",
3131
+ height: "48",
3132
+ fill: "white"
3133
+ })
3134
+ })
3135
+ })
3136
+ ]
3137
+ });
3138
+ };
3000
3139
  var $a1ac29d50bdaa837$export$2e2bcd8739ae039 = $a1ac29d50bdaa837$var$SnapcallLogo;
3001
3140
 
3002
3141
 
@@ -3357,7 +3496,7 @@ const $ae6e25be45301335$var$HeaderSettings = ({ baseCategories: baseCategories ,
3357
3496
  items: [
3358
3497
  ...baseCategory.items
3359
3498
  ]
3360
- })),
3499
+ }))
3361
3500
  ];
3362
3501
  extraCategories?.forEach((extraCategory)=>{
3363
3502
  const existingCategory = mergedCategories.find((category)=>category.id === extraCategory.id);
@@ -3497,7 +3636,7 @@ const $e96d119a19ed0c6c$var$getLayout = ({ width: width , cellAspectRatio: cellA
3497
3636
  width: roundedWidth,
3498
3637
  height: height
3499
3638
  }
3500
- },
3639
+ }
3501
3640
  ],
3502
3641
  tileCount: tileCount
3503
3642
  };
@@ -3619,7 +3758,7 @@ const $f235befa4cdc42d6$var$multiPiP = new (0, $e96d119a19ed0c6c$export$45fabd1c
3619
3758
  const $f235befa4cdc42d6$var$browser = $3Sbms$parse(window.navigator.userAgent);
3620
3759
  const $f235befa4cdc42d6$var$Header = ()=>{
3621
3760
  const { t: t } = (0, $3Sbms$useTranslation)();
3622
- const { setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , setIsSettingsMenuVisible: setIsSettingsMenuVisible , setIsVirtualBackgroundPopupVisible: setIsVirtualBackgroundPopupVisible , options: options , muted: muted , streaming: streaming , permissions: permissions , plan: plan , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
3761
+ const { setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , setIsSettingsMenuVisible: setIsSettingsMenuVisible , setIsVirtualBackgroundPopupVisible: setIsVirtualBackgroundPopupVisible , options: options , muted: muted , streaming: streaming , permissions: permissions , plan: plan , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
3623
3762
  const { streams: streams } = (0, $cce9fd41d8a55a18$export$b5633a7cfbe42d9f)();
3624
3763
  const [extraOptions, setExtraOptions] = (0, $3Sbms$useState)(options.extraSettingsOptions || []);
3625
3764
  const onSetExtraSettingsOptions = (event)=>{
@@ -3688,7 +3827,7 @@ const $f235befa4cdc42d6$var$Header = ()=>{
3688
3827
  title: t("menu.openNewTab"),
3689
3828
  jsxIcon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $2da9626742e3560b$export$6546b255bd3a2004), {}),
3690
3829
  action: onOpenInNewTabClick
3691
- },
3830
+ }
3692
3831
  ]
3693
3832
  },
3694
3833
  {
@@ -3705,7 +3844,7 @@ const $f235befa4cdc42d6$var$Header = ()=>{
3705
3844
  title: t("quickConnect.title"),
3706
3845
  jsxIcon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $2da9626742e3560b$export$6470d09a29d34d08), {}),
3707
3846
  action: onScanQuickConnectClick
3708
- },
3847
+ }
3709
3848
  ]
3710
3849
  },
3711
3850
  {
@@ -3716,9 +3855,9 @@ const $f235befa4cdc42d6$var$Header = ()=>{
3716
3855
  title: t("settings.title"),
3717
3856
  jsxIcon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $2da9626742e3560b$export$1095c93890fce526), {}),
3718
3857
  action: onSettingsMenuClick
3719
- },
3858
+ }
3720
3859
  ]
3721
- },
3860
+ }
3722
3861
  ];
3723
3862
  if ($f235befa4cdc42d6$var$browser.platform.type === "desktop" && $f235befa4cdc42d6$var$browser.engine.name === "Blink") computedCategories[2].items.unshift({
3724
3863
  id: "virtualBackground",
@@ -3742,7 +3881,7 @@ const $f235befa4cdc42d6$var$Header = ()=>{
3742
3881
  setIsQuickConnectPopupVisible,
3743
3882
  setBlockedFeaturePopupOpen,
3744
3883
  setIsSettingsMenuVisible,
3745
- setIsVirtualBackgroundPopupVisible,
3884
+ setIsVirtualBackgroundPopupVisible
3746
3885
  ]);
3747
3886
  return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $ab29487ffcc05855$export$1e86fd0e1db89578), {
3748
3887
  children: [
@@ -4899,7 +5038,7 @@ var $f260365f66cb6a6f$export$2e2bcd8739ae039 = $f260365f66cb6a6f$var$Reduce;
4899
5038
 
4900
5039
 
4901
5040
 
4902
- const $57ab7b9a012d9acd$var$Cross = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
5041
+ const $57ab7b9a012d9acd$var$Cross = ({ color: color = "#fff" })=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
4903
5042
  width: "24",
4904
5043
  height: "24",
4905
5044
  viewBox: "0 0 24 24",
@@ -4907,7 +5046,7 @@ const $57ab7b9a012d9acd$var$Cross = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
4907
5046
  xmlns: "http://www.w3.org/2000/svg",
4908
5047
  children: /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
4909
5048
  d: "m13.41 12 6.3-6.29a1.004 1.004 0 0 0-1.42-1.42L12 10.59l-6.29-6.3a1.004 1.004 0 1 0-1.42 1.42l6.3 6.29-6.3 6.29a.999.999 0 0 0 0 1.42 1 1 0 0 0 1.42 0l6.29-6.3 6.29 6.3a1.001 1.001 0 0 0 1.639-.325 1 1 0 0 0-.22-1.095L13.41 12Z",
4910
- fill: "#fff"
5049
+ fill: color
4911
5050
  })
4912
5051
  });
4913
5052
  var $57ab7b9a012d9acd$export$2e2bcd8739ae039 = $57ab7b9a012d9acd$var$Cross;
@@ -5256,7 +5395,7 @@ const $5939a59dc7c96d41$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
5256
5395
  const videoElementRef = (0, $3Sbms$useRef)(null);
5257
5396
  const videoMediaProviderRef = (0, $3Sbms$useRef)(null);
5258
5397
  const SelfTileRef = (0, $3Sbms$useRef)(null);
5259
- const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , profile: profile , muted: muted , streaming: streaming , orientation: orientation , options: options , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
5398
+ const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , profile: profile , muted: muted , streaming: streaming , orientation: orientation , options: options , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
5260
5399
  const { streams: streams } = (0, $cce9fd41d8a55a18$export$b5633a7cfbe42d9f)();
5261
5400
  const [containerWidth, containerHeight] = (0, $af23c74942bdcae7$export$2b86bedf890eab8)(videosContainerRef.current);
5262
5401
  const cursor = streaming && !extended ? "pointer" : "default";
@@ -5670,7 +5809,7 @@ const $f81bfa56534026c2$export$e9785ae652b3a722 = (item)=>{
5670
5809
  {
5671
5810
  ...item,
5672
5811
  id: 0
5673
- },
5812
+ }
5674
5813
  ]);
5675
5814
  localStorage.setItem(key, stringifiedHistory);
5676
5815
  }
@@ -5778,7 +5917,7 @@ const $5e2ac34f2c3f1b42$export$405a29439cf92237 = "youtube_pause";
5778
5917
  const $5e2ac34f2c3f1b42$export$649698d6e35b1ef3 = "youtube_stop";
5779
5918
  const $5e2ac34f2c3f1b42$var$YoutubeTile = (tile)=>{
5780
5919
  const { selfPeerId: selfPeerId } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
5781
- const [player1, setPlayer] = (0, $3Sbms$useState)(null);
5920
+ const [player, setPlayer] = (0, $3Sbms$useState)(null);
5782
5921
  const isSelf = tile.peerId === selfPeerId;
5783
5922
  const onVideoStateChange = (event)=>{
5784
5923
  const time = event.target.getCurrentTime();
@@ -5846,15 +5985,15 @@ const $5e2ac34f2c3f1b42$var$YoutubeTile = (tile)=>{
5846
5985
  isSelf
5847
5986
  ]);
5848
5987
  (0, $3Sbms$useEffect)(()=>{
5849
- if (!isSelf && player1) {
5988
+ if (!isSelf && player) {
5850
5989
  const onCustomMessage = (event)=>{
5851
5990
  const { type: type , time: time } = event.detail.event;
5852
5991
  if (type === $5e2ac34f2c3f1b42$export$405a29439cf92237) {
5853
- player1.pauseVideo();
5854
- player1.seekTo(time, true);
5992
+ player.pauseVideo();
5993
+ player.seekTo(time, true);
5855
5994
  } else if (type === $5e2ac34f2c3f1b42$export$1712c056f28ddd33) {
5856
- player1.playVideo();
5857
- player1.seekTo(time, true);
5995
+ player.playVideo();
5996
+ player.seekTo(time, true);
5858
5997
  }
5859
5998
  };
5860
5999
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("customMessage", onCustomMessage);
@@ -5862,10 +6001,10 @@ const $5e2ac34f2c3f1b42$var$YoutubeTile = (tile)=>{
5862
6001
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("customMessage", onCustomMessage);
5863
6002
  };
5864
6003
  }
5865
- if (isSelf && player1) {
6004
+ if (isSelf && player) {
5866
6005
  const onNewPeer = (event)=>{
5867
6006
  const { peerId: peerId } = event.detail;
5868
- const time = player1.getCurrentTime();
6007
+ const time = player.getCurrentTime();
5869
6008
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).sendCustomMessage(peerId, {
5870
6009
  type: $5e2ac34f2c3f1b42$export$8bd7ff36223ef5c1,
5871
6010
  videoId: tile.data.videoId,
@@ -5880,7 +6019,7 @@ const $5e2ac34f2c3f1b42$var$YoutubeTile = (tile)=>{
5880
6019
  }, [
5881
6020
  tile.data,
5882
6021
  isSelf,
5883
- player1
6022
+ player
5884
6023
  ]);
5885
6024
  return /*#__PURE__*/ (0, $3Sbms$jsx)((0, $34a6fb3d684caabd$export$f4a8a05247f8d4c), {
5886
6025
  children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $34a6fb3d684caabd$export$b0da35797f3be127), {
@@ -6454,7 +6593,7 @@ var $b8963bf62cf5b984$export$2e2bcd8739ae039 = $b8963bf62cf5b984$var$tooltip;
6454
6593
 
6455
6594
 
6456
6595
  const $cdab47bb8796991e$var$Video = ()=>{
6457
- const { selfPeerId: selfPeerId , videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , options: options , muted: selfMuted , profile: profile1 , orientation: orientation , userInteractionTriggered: userInteractionTriggered , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
6596
+ const { selfPeerId: selfPeerId , videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , options: options , muted: selfMuted , profile: profile , orientation: orientation , userInteractionTriggered: userInteractionTriggered } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
6458
6597
  const [tileSize, setTileSize] = (0, $3Sbms$useState)({
6459
6598
  width: 0,
6460
6599
  height: 0
@@ -6634,7 +6773,7 @@ const $cdab47bb8796991e$var$Video = ()=>{
6634
6773
  stream: {
6635
6774
  id: String(selfPeerId),
6636
6775
  muted: selfMuted,
6637
- profile: profile1
6776
+ profile: profile
6638
6777
  }
6639
6778
  }),
6640
6779
  streams.map((stream)=>{
@@ -6695,6 +6834,18 @@ const $58d405d56c1abe95$var$Rotate = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
6695
6834
  fill: "#F7F7F7"
6696
6835
  })
6697
6836
  });
6837
+ const $58d405d56c1abe95$export$aefffb14595958fe = ()=>{
6838
+ return /*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
6839
+ xmlns: "http://www.w3.org/2000/svg",
6840
+ width: "32",
6841
+ height: "32",
6842
+ fill: "none",
6843
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
6844
+ fill: "#fff",
6845
+ d: "M26.547 20.68h-6.04a1.333 1.333 0 1 0 0 2.666h3.2A10.667 10.667 0 0 1 5.334 16a1.333 1.333 0 0 0-2.667 0 13.333 13.333 0 0 0 22.507 9.64V28a1.333 1.333 0 1 0 2.666 0v-6a1.333 1.333 0 0 0-1.293-1.32ZM16 2.666A13.333 13.333 0 0 0 6.827 6.36V4A1.333 1.333 0 1 0 4.16 4v6a1.333 1.333 0 0 0 1.334 1.333h6a1.333 1.333 0 0 0 0-2.667h-3.2A10.667 10.667 0 0 1 26.667 16a1.333 1.333 0 1 0 2.667 0A13.333 13.333 0 0 0 16 2.666Z"
6846
+ })
6847
+ });
6848
+ };
6698
6849
  var $58d405d56c1abe95$export$2e2bcd8739ae039 = $58d405d56c1abe95$var$Rotate;
6699
6850
 
6700
6851
 
@@ -6878,7 +7029,7 @@ const $db92fac48417791a$var$HighlightButton = ()=>{
6878
7029
  const { t: t } = (0, $3Sbms$useTranslation)();
6879
7030
  const highlightMenuRef = (0, $3Sbms$useRef)(null);
6880
7031
  const [isHighlightMenuOpen, setIsHighlightMenuOpen] = (0, $3Sbms$useState)(false);
6881
- const { setIsYoutubePopupVisible: setIsYoutubePopupVisible , setIsLinksharePopupVisible: setIsLinksharePopupVisible , selfPeerId: selfPeerId , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
7032
+ const { setIsYoutubePopupVisible: setIsYoutubePopupVisible , setIsLinksharePopupVisible: setIsLinksharePopupVisible , selfPeerId: selfPeerId , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
6882
7033
  const { highlightedTile: highlightedTile , dispatch: dispatch } = (0, $cce9fd41d8a55a18$export$b5633a7cfbe42d9f)();
6883
7034
  const isPresenting = Boolean(highlightedTile?.isGlobal && highlightedTile?.peerId === selfPeerId);
6884
7035
  (0, $e1413aacdaa5a03e$export$71b2224f1ce5e08e)(highlightMenuRef, ()=>setIsHighlightMenuOpen(false));
@@ -6931,9 +7082,9 @@ const $db92fac48417791a$var$HighlightButton = ()=>{
6931
7082
  title: t("youtube.title"),
6932
7083
  jsxIcon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $a2d206a438475087$export$2e2bcd8739ae039), {}),
6933
7084
  action: onYoutubeClick
6934
- },
7085
+ }
6935
7086
  ]
6936
- },
7087
+ }
6937
7088
  ];
6938
7089
  if ($db92fac48417791a$var$isScreenshareSupported) menuCategories.push({
6939
7090
  id: "2",
@@ -6943,7 +7094,7 @@ const $db92fac48417791a$var$HighlightButton = ()=>{
6943
7094
  title: t("menu.screenSharing"),
6944
7095
  jsxIcon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $1ca024917df8f7bc$export$2e2bcd8739ae039), {}),
6945
7096
  action: onScreenshareClick
6946
- },
7097
+ }
6947
7098
  ]
6948
7099
  });
6949
7100
  return /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$Fragment), {
@@ -7088,9 +7239,9 @@ const $69a9c49ece80e773$var$ControlBar = ()=>{
7088
7239
  jsxIcon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $2da9626742e3560b$export$e57aa6aff2e1f414), {}),
7089
7240
  action: terminateCall,
7090
7241
  danger: true
7091
- },
7242
+ }
7092
7243
  ]
7093
- },
7244
+ }
7094
7245
  ]
7095
7246
  })
7096
7247
  }),
@@ -7271,7 +7422,7 @@ const $5b80b81d7b095f89$var$QuickConnect = ()=>{
7271
7422
  const themeContext = (0, $3Sbms$useContext)((0, $3Sbms$ThemeContext));
7272
7423
  const QuickConnectContainerRef = (0, $3Sbms$useRef)(null);
7273
7424
  const QuickConnectRef = (0, $3Sbms$useRef)(null);
7274
- const { selfPeerId: selfPeerId , profile: profile , isQuickConnectPopupVisible: isQuickConnectPopupVisible , setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , options: options , orientation: orientation , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
7425
+ const { selfPeerId: selfPeerId , profile: profile , isQuickConnectPopupVisible: isQuickConnectPopupVisible , setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , options: options , orientation: orientation } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
7275
7426
  (0, $e1413aacdaa5a03e$export$71b2224f1ce5e08e)(QuickConnectContainerRef, ()=>{
7276
7427
  if (isQuickConnectPopupVisible) setIsQuickConnectPopupVisible(false);
7277
7428
  });
@@ -9125,7 +9276,7 @@ const $d493afe60dcea711$var$backgroundOptions = [
9125
9276
  title: "Blurred",
9126
9277
  value: "blurred",
9127
9278
  id: "background-blurred"
9128
- },
9279
+ }
9129
9280
  ];
9130
9281
  const $d493afe60dcea711$var$VirtualBackgroundPopup = ()=>{
9131
9282
  const { t: t } = (0, $3Sbms$useTranslation)();
@@ -9398,7 +9549,7 @@ const $e1c48a389d8ac959$export$8376625f8bb18347 = (0, $3Sbms$styledcomponents).d
9398
9549
 
9399
9550
 
9400
9551
  const $01986a58bfba8001$var$Settings = ()=>{
9401
- const { isQuickConnectPopupVisible: isQuickConnectPopupVisible , isSettingsMenuVisible: isSettingsMenuVisible , isYoutubePopupVisible: isYoutubePopupVisible , isLinksharePopupVisible: isLinksharePopupVisible , isVirtualBackgroundPopupVisible: isVirtualBackgroundPopupVisible , isBlockedFeaturePopupOpen: isBlockedFeaturePopupOpen , } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
9552
+ const { isQuickConnectPopupVisible: isQuickConnectPopupVisible , isSettingsMenuVisible: isSettingsMenuVisible , isYoutubePopupVisible: isYoutubePopupVisible , isLinksharePopupVisible: isLinksharePopupVisible , isVirtualBackgroundPopupVisible: isVirtualBackgroundPopupVisible , isBlockedFeaturePopupOpen: isBlockedFeaturePopupOpen } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
9402
9553
  const open = isQuickConnectPopupVisible || isSettingsMenuVisible || isYoutubePopupVisible || isBlockedFeaturePopupOpen || isLinksharePopupVisible || isVirtualBackgroundPopupVisible;
9403
9554
  return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $e1c48a389d8ac959$export$8376625f8bb18347), {
9404
9555
  open: open,
@@ -10176,8 +10327,8 @@ const $15a01b611391c1e7$var$audioSource = new Blob([
10176
10327
  170,
10177
10328
  170,
10178
10329
  170,
10179
- 170,
10180
- ]),
10330
+ 170
10331
+ ])
10181
10332
  ], {
10182
10333
  type: "audio/mpeg"
10183
10334
  });
@@ -10278,135 +10429,1310 @@ const $4fb4815baa04b470$export$914ddf2021ea8ee6 = (0, $3Sbms$styledcomponents).d
10278
10429
 
10279
10430
 
10280
10431
 
10281
- const $26ed036cbc17809a$var$currentTheme = (0, $52580db2e49cdd90$export$3bfd0d5209a8006a)();
10282
- const $26ed036cbc17809a$var$currentLanguage = (0, $a3e657fb86ae23f3$export$604ba5624273df44)();
10283
- let $26ed036cbc17809a$var$timestampCriticalError = -1;
10284
- const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
10285
- const [selfPeerId, setSelfPeerId] = (0, $3Sbms$useState)(undefined);
10286
- const streamUIContainerRef = (0, $3Sbms$useRef)(null);
10287
- const videosContainerRef = (0, $3Sbms$useRef)(null);
10288
- const remoteTilesContainerRef = (0, $3Sbms$useRef)(null);
10289
- const [streamState, setStreamState] = (0, $3Sbms$useState)("streaming");
10290
- const [isQuickConnectPopupVisible, setIsQuickConnectPopupVisible] = (0, $3Sbms$useState)(false);
10291
- const [isSettingsMenuVisible, setIsSettingsMenuVisible] = (0, $3Sbms$useState)(false);
10292
- const [isYoutubePopupVisible, setIsYoutubePopupVisible] = (0, $3Sbms$useState)(false);
10293
- const [isLinksharePopupVisible, setIsLinksharePopupVisible] = (0, $3Sbms$useState)(false);
10294
- const [isVirtualBackgroundPopupVisible, setIsVirtualBackgroundPopupVisible] = (0, $3Sbms$useState)(false);
10295
- const [theme, setTheme] = (0, $3Sbms$useState)($26ed036cbc17809a$var$currentTheme);
10296
- const [language, setLanguage] = (0, $3Sbms$useState)(options.language || $26ed036cbc17809a$var$currentLanguage);
10297
- const [profile1, setProfile] = (0, $3Sbms$useState)({});
10298
- const [muted, setMuted] = (0, $3Sbms$useState)(true);
10299
- const [streaming, setStreaming] = (0, $3Sbms$useState)(false);
10300
- const [screensharing, setScreensharing] = (0, $3Sbms$useState)(false);
10301
- const [isAgent, setIsAgent] = (0, $3Sbms$useState)(false);
10302
- const [userInteractionTriggered, setUserInteractionTriggered] = (0, $3Sbms$useState)(false);
10303
- const [containerWidth, containerHeight] = (0, $af23c74942bdcae7$export$2b86bedf890eab8)(streamUIContainerRef.current);
10304
- const [isBlockedDevicesPopupOpen, setBlockedDevicesPopupOpen] = (0, $3Sbms$useState)(false);
10305
- const [isBlockedFeaturePopupOpen, setBlockedFeaturePopupOpen] = (0, $3Sbms$useState)(false);
10306
- const [permissions, setPermissions] = (0, $3Sbms$useState)([]);
10307
- const [plan, setPlan] = (0, $3Sbms$useState)(undefined);
10308
- const orientation = (containerWidth || window.screen.width) > (containerHeight || window.screen.height) ? "landscape" : "portrait";
10309
- const styledTheme = theme === "dark" ? (0, $52580db2e49cdd90$export$3e936a8db52a10a0) : (0, $52580db2e49cdd90$export$f30cb9bc4f736419);
10310
- const onWebcamUpdate = (event)=>{
10311
- if (event.type === "localVideoAvailable") setStreaming(true);
10312
- else setStreaming(false);
10313
- };
10314
- const onScreenshareUpdate = (event)=>{
10315
- if (event.type === "screenshareEnabled") setScreensharing(true);
10316
- else setScreensharing(false);
10317
- };
10318
- const onMicrophoneUpdate = (event)=>{
10319
- if (event.type === "microphoneMute") setMuted(true);
10320
- else setMuted(false);
10321
- };
10322
- const onDefaultAudioDeviceChange = (event)=>{
10323
- const micro = event.detail.label;
10324
- (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${micro}`, {
10325
- duration: 3000,
10326
- icon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6043ae1b48c5aa97$export$2e2bcd8739ae039), {}),
10327
- messageStyle: {
10328
- fontWeight: 600
10329
- }
10330
- });
10331
- };
10332
- const onSelfProfileUpdate = (event)=>{
10333
- const { profile: profile } = event.detail;
10334
- setProfile(profile);
10335
- };
10336
- const onCallEnd = ()=>{
10337
- (0, $15a01b611391c1e7$export$716eeec86fd18da7)();
10338
- setStreamState("ended");
10339
- setMuted(true);
10340
- setStreaming(false);
10341
- setScreensharing(false);
10342
- setUserInteractionTriggered(false);
10343
- };
10344
- const onCallTerminated = ()=>{
10345
- (0, $15a01b611391c1e7$export$716eeec86fd18da7)();
10346
- setStreamState("terminated");
10432
+
10433
+
10434
+
10435
+
10436
+
10437
+
10438
+
10439
+
10440
+
10441
+
10442
+
10443
+
10444
+
10445
+
10446
+
10447
+ function $5a48b7481979330f$export$61dc559f8a0b9bcf(ref) {
10448
+ const innerRef = (0, $3Sbms$useRef)(null);
10449
+ (0, $3Sbms$useEffect)(()=>{
10450
+ if (!ref) return;
10451
+ if (typeof ref === "function") ref(innerRef.current);
10452
+ else ref.current = innerRef.current;
10453
+ });
10454
+ return innerRef;
10455
+ }
10456
+ const $5a48b7481979330f$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $3Sbms$forwardRef)(function Button({ children: children , ...otherProps }, forwardedRef) {
10457
+ const ref = $5a48b7481979330f$export$61dc559f8a0b9bcf(forwardedRef);
10458
+ let state = (0, $3Sbms$useToggleState)(otherProps);
10459
+ const { buttonProps: buttonProps } = (0, $3Sbms$useToggleButton)(otherProps, state, ref);
10460
+ const { isFocusVisible: isFocusVisible , focusProps: focusProps } = (0, $3Sbms$useFocusRing)();
10461
+ return /*#__PURE__*/ (0, $3Sbms$jsx)("button", {
10462
+ className: (0, $3Sbms$classnames)("w-[76px] h-[40px]", otherProps.isSelected ? "bg-[#FFFFFF]" : "bg-[#FFFFFF] opacity-[0.4]", "rounded-full", "text-black", "flex items-center justify-center gap-[5px]", "text-base font-medium", "transition-colors ease-in-out", "focus:outline-none", {
10463
+ "ring-[3px] ring-cta": isFocusVisible,
10464
+ "cursor-not-allowed": buttonProps.disabled
10465
+ }),
10466
+ ...buttonProps,
10467
+ ...focusProps,
10468
+ ref: ref,
10469
+ children: children
10470
+ });
10471
+ });
10472
+
10473
+
10474
+
10475
+
10476
+
10477
+
10478
+
10479
+
10480
+
10481
+
10482
+
10483
+
10484
+
10485
+
10486
+
10487
+
10488
+ const $0590ee3141e14968$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3Sbms$forwardRef)(function Button({ children: children , variant: variant = "primary" , size: size = "medium" , fullWidth: fullWidth = false , form: form , className: className , ...otherProps }, forwardedRef) {
10489
+ const ref = (0, $5a48b7481979330f$export$61dc559f8a0b9bcf)(forwardedRef);
10490
+ const { buttonProps: buttonProps , isPressed: isPressed } = (0, $3Sbms$useButton)(otherProps, ref);
10491
+ const { isFocusVisible: isFocusVisible , focusProps: focusProps } = (0, $3Sbms$useFocusRing)();
10492
+ const { hoverProps: hoverProps , isHovered: isHovered } = (0, $3Sbms$useHover)({
10493
+ isDisabled: buttonProps.disabled
10494
+ });
10495
+ const isActive = isHovered || isFocusVisible || isPressed;
10496
+ const variantStyle = {
10497
+ primary: (0, $3Sbms$classnames)(isActive ? "bg-primaryLight" : "bg-primary", "text-white disabled:bg-secondaryLight"),
10498
+ secondary: (0, $3Sbms$classnames)(isActive ? "bg-graySelected" : "bg-transparent", "text-primary border border-secondaryLight disabled:text-secondaryLight disabled:bg-graySelected"),
10499
+ basic: (0, $3Sbms$classnames)(isActive ? "bg-graySelected" : "bg-white", "text-primary disabled:text-secondaryLight disabled:bg-graySelected"),
10500
+ custom: ""
10347
10501
  };
10348
- const onInvalidRoom = ()=>{
10349
- setStreamState("expired");
10502
+ const sizeStyle = {
10503
+ large: "py-3 px-4 text-base rounded-lg",
10504
+ medium: "py-[9px] px-3.5 text-base rounded-lg",
10505
+ small: "py-2 px-3 text-sm rounded-lg",
10506
+ extraSmall: "py-1.5 px-2.5 text-xs rounded-md",
10507
+ custom: ""
10350
10508
  };
10351
- const onAgentIdentity = (event)=>{
10352
- const { success: success , email: email } = event.detail;
10353
- if (success) {
10354
- setIsAgent(true);
10355
- if (email) (0, $3Sbms$hotjarbrowser).identify(null, {
10356
- email: email
10357
- });
10358
- } else (0, $3Sbms$reacthottoast)("An error occured while trying to join the room as an agent", {
10359
- className: "error"
10360
- });
10509
+ return /*#__PURE__*/ (0, $3Sbms$jsx)("button", {
10510
+ className: (0, $3Sbms$classnames)(sizeStyle[size], variantStyle[variant], "flex items-center justify-center gap-[5px] font-medium", "transition-colors ease-in-out", "focus:outline-none", {
10511
+ "ring-[3px] ring-cta": isFocusVisible,
10512
+ "cursor-not-allowed": buttonProps.disabled,
10513
+ "w-full": fullWidth
10514
+ }, className),
10515
+ ...buttonProps,
10516
+ ...focusProps,
10517
+ ...hoverProps,
10518
+ form: form,
10519
+ ref: ref,
10520
+ children: children
10521
+ });
10522
+ });
10523
+
10524
+
10525
+ function $c0bb66c3d546ed81$export$2b77a92f1a5ad772(props) {
10526
+ const { children: children , state: state , size: size = "small" , title: title , description: description , primaryAction: primaryAction , secondaryAction: secondaryAction , centered: centered = false } = props;
10527
+ const ref = (0, $3Sbms$react).useRef(null);
10528
+ const { modalProps: modalProps , underlayProps: underlayProps } = (0, $3Sbms$useModalOverlay)({
10529
+ isDismissable: true,
10530
+ ...props
10531
+ }, state, ref);
10532
+ const [exited, setExited] = (0, $3Sbms$useState)(!state.isOpen);
10533
+ const viewport = (0, $3Sbms$useViewportSize)();
10534
+ const maxHeight = viewport.height - 64;
10535
+ const modalSize = {
10536
+ small: "max-w-[400px] mx-[20px]",
10537
+ medium: "max-w-[600px]",
10538
+ large: "max-w-[800px]"
10361
10539
  };
10362
- const onCriticalError = (event)=>{
10363
- const duration = 20000;
10364
- const now = Date.now();
10365
- if (event.detail.code === "USERLIMIT") {
10366
- setStreamState("full");
10367
- return;
10368
- }
10369
- if ($26ed036cbc17809a$var$timestampCriticalError !== -1 && $26ed036cbc17809a$var$timestampCriticalError + duration > now) return;
10370
- $26ed036cbc17809a$var$timestampCriticalError = now;
10371
- (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`A critical error has occurred (error ${event.detail.code}).`, {
10372
- icon: (0, $93a0377c243d965e$export$c7df1b15b59b1df2),
10373
- button: {
10374
- text: "Reload",
10375
- action: ()=>{
10376
- window.location.reload();
10377
- }
10540
+ // Don't render anything if the modal is not open and we're not animating out.
10541
+ if (!(state.isOpen || !exited)) return null;
10542
+ return /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$Overlay), {
10543
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$CSSTransition), {
10544
+ in: state.isOpen,
10545
+ appear: true,
10546
+ onEntered: ()=>setExited(false),
10547
+ onExited: ()=>setExited(true),
10548
+ timeout: {
10549
+ enter: 0,
10550
+ exit: 300
10378
10551
  },
10379
- duration: duration
10380
- });
10381
- };
10382
- (0, $3Sbms$useEffect)(()=>{
10383
- try {
10384
- localStorage.setItem("stream_ui_theme", theme);
10385
- } catch (localStorageError) {
10386
- console.warn(localStorageError);
10387
- }
10388
- }, [
10389
- theme
10390
- ]);
10391
- (0, $3Sbms$useEffect)(()=>{
10392
- try {
10393
- localStorage.setItem("stream_ui_language", language);
10394
- (0, $384d985bb9605c35$export$2e2bcd8739ae039).changeLanguage(language);
10395
- } catch (localStorageError) {
10396
- console.warn(localStorageError);
10397
- }
10398
- }, [
10399
- language
10400
- ]);
10401
- (0, $3Sbms$useEffect)(()=>{
10402
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("localVideoAvailable", onWebcamUpdate);
10403
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("localVideoUnavailable", onWebcamUpdate);
10404
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("screenshareEnabled", onScreenshareUpdate);
10405
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("screenshareDisabled", onScreenshareUpdate);
10406
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("microphoneEnabled", onMicrophoneUpdate);
10407
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("microphoneMute", onMicrophoneUpdate);
10408
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("microphoneUnmute", onMicrophoneUpdate);
10409
- (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("defaultAudioDeviceChange", onDefaultAudioDeviceChange);
10552
+ classNames: {
10553
+ enter: "opacity-0",
10554
+ enterDone: "opacity-1 transition ease-in",
10555
+ exit: "opacity-0 transition ease-out"
10556
+ },
10557
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10558
+ className: "fixed z-[100] inset-0 bg-black bg-opacity-90 flex justify-center items-center",
10559
+ ...underlayProps,
10560
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$CSSTransition), {
10561
+ in: state.isOpen,
10562
+ appear: true,
10563
+ nodeRef: ref,
10564
+ timeout: {
10565
+ enter: 0,
10566
+ exit: 300
10567
+ },
10568
+ classNames: {
10569
+ appear: "translate-y-2",
10570
+ appearDone: "translate-y-0 transition ease-in",
10571
+ exit: "translate-y-2 transition ease-out"
10572
+ },
10573
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10574
+ ...modalProps,
10575
+ ref: ref,
10576
+ className: (0, $3Sbms$classnames)("bg-white rounded-[10px] z-[1] overflow-auto focus:outline-none", modalSize[size]),
10577
+ style: {
10578
+ maxHeight: `${maxHeight}px`
10579
+ },
10580
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10581
+ className: "flex flex-col gap-5 px-5 py-[25px]",
10582
+ children: [
10583
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10584
+ className: (0, $3Sbms$classnames)("flex flex-col gap-[5px]", {
10585
+ "text-center": centered
10586
+ }),
10587
+ children: [
10588
+ /*#__PURE__*/ (0, $3Sbms$jsx)("h2", {
10589
+ className: "text-xl font-medium",
10590
+ children: title
10591
+ }),
10592
+ description && /*#__PURE__*/ (0, $3Sbms$jsx)("p", {
10593
+ className: "text-sm text-secondary",
10594
+ children: description
10595
+ })
10596
+ ]
10597
+ }),
10598
+ children,
10599
+ (primaryAction || secondaryAction) && /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10600
+ className: (0, $3Sbms$classnames)("flex justify-end gap-2.5", centered ? "justify-center" : "justify-end"),
10601
+ children: [
10602
+ typeof secondaryAction === "string" && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $0590ee3141e14968$export$353f5b6fc5456de1), {
10603
+ variant: "secondary",
10604
+ onPress: state.close,
10605
+ fullWidth: centered,
10606
+ children: secondaryAction
10607
+ }),
10608
+ typeof secondaryAction === "function" && secondaryAction({
10609
+ close: state.close
10610
+ }),
10611
+ typeof primaryAction === "string" && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $0590ee3141e14968$export$353f5b6fc5456de1), {
10612
+ onPress: state.close,
10613
+ fullWidth: centered,
10614
+ children: primaryAction
10615
+ }),
10616
+ typeof primaryAction === "function" && primaryAction({
10617
+ close: state.close
10618
+ })
10619
+ ]
10620
+ })
10621
+ ]
10622
+ })
10623
+ })
10624
+ })
10625
+ })
10626
+ })
10627
+ });
10628
+ }
10629
+
10630
+
10631
+
10632
+
10633
+ const $444e1dd9fa8f6883$export$f9da3144ae2525a3 = ()=>/*#__PURE__*/ (0, $3Sbms$jsxs)("svg", {
10634
+ width: "20",
10635
+ height: "21",
10636
+ viewBox: "0 0 20 21",
10637
+ fill: "none",
10638
+ xmlns: "http://www.w3.org/2000/svg",
10639
+ style: {
10640
+ display: "inline"
10641
+ },
10642
+ transform: "translate(0 -1)",
10643
+ children: [
10644
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
10645
+ d: "M10 2.167a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.333Z",
10646
+ fill: "#1D1C20"
10647
+ }),
10648
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
10649
+ d: "M6.76 5.65a5.833 5.833 0 1 1 6.481 9.7 5.833 5.833 0 0 1-6.481-9.7Z",
10650
+ fill: "#F12828"
10651
+ })
10652
+ ]
10653
+ });
10654
+ const $444e1dd9fa8f6883$export$c6a849fd9d9d93a2 = ()=>/*#__PURE__*/ (0, $3Sbms$jsxs)("svg", {
10655
+ width: "20",
10656
+ height: "20",
10657
+ viewBox: "0 0 20 20",
10658
+ fill: "none",
10659
+ xmlns: "http://www.w3.org/2000/svg",
10660
+ style: {
10661
+ display: "inline"
10662
+ },
10663
+ transform: "translate(0 -1)",
10664
+ children: [
10665
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
10666
+ d: "M10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.333Z",
10667
+ fill: "#1D1C20"
10668
+ }),
10669
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
10670
+ d: "M7.5 6.667h5a.833.833 0 0 1 .833.833v5a.833.833 0 0 1-.834.834h-5a.833.833 0 0 1-.833-.834v-5a.833.833 0 0 1 .833-.833Z",
10671
+ fill: "#F12828"
10672
+ })
10673
+ ]
10674
+ });
10675
+ const $444e1dd9fa8f6883$export$dce36e07153365d = ()=>/*#__PURE__*/ (0, $3Sbms$jsxs)("svg", {
10676
+ width: "20",
10677
+ height: "20",
10678
+ viewBox: "0 0 20 20",
10679
+ fill: "none",
10680
+ xmlns: "http://www.w3.org/2000/svg",
10681
+ style: {
10682
+ display: "inline"
10683
+ },
10684
+ transform: "translate(0 -1)",
10685
+ children: [
10686
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
10687
+ d: "M10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15a6.666 6.666 0 1 1 0-13.333 6.666 6.666 0 0 1 0 13.333Z",
10688
+ fill: "#1D1C20"
10689
+ }),
10690
+ /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
10691
+ d: "M6.76 5.15a5.833 5.833 0 1 1 6.481 9.7 5.833 5.833 0 0 1-6.481-9.7Z",
10692
+ fill: "#1D1C20"
10693
+ })
10694
+ ]
10695
+ });
10696
+
10697
+
10698
+
10699
+
10700
+
10701
+ const $f4e9ebfd4b02cf09$var$Text = ({ children: children })=>/*#__PURE__*/ (0, $3Sbms$jsx)("span", {
10702
+ className: "w-full text-base text-primaryLight font-normal leading-[20px]",
10703
+ children: children
10704
+ });
10705
+ const $f4e9ebfd4b02cf09$var$Bold = ({ children: children })=>/*#__PURE__*/ (0, $3Sbms$jsx)("span", {
10706
+ className: "text-primary font-medium",
10707
+ children: children
10708
+ });
10709
+ const $f4e9ebfd4b02cf09$var$InstructionRow = ({ children: children , index: index })=>/*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10710
+ className: "flex flex-row justify-center gap-[5px]",
10711
+ children: [
10712
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10713
+ className: "flex items-center justify-center min-w-[24px] h-[24px] rounded-[50%] bg-secondaryVLight",
10714
+ children: index
10715
+ }),
10716
+ children
10717
+ ]
10718
+ });
10719
+ const $f4e9ebfd4b02cf09$export$788cb893d96254c8 = ({ state: state , type: type })=>{
10720
+ const [permissionsState, setPermissionsState] = (0, $3Sbms$useState)("idle");
10721
+ const { orientation: orientation } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
10722
+ const device = orientation === "landscape" ? "desktop" : "mobile";
10723
+ const videoLength = permissionsState === "granted" ? "short" : "full";
10724
+ const videoType = type === "picture" ? "photo" : "video";
10725
+ const onDeviceEnabled = ()=>setPermissionsState("granted");
10726
+ const ref = (0, $3Sbms$useRef)(null);
10727
+ const title = (0, $3Sbms$useMemo)(()=>{
10728
+ if (permissionsState === "refused") return "Something went wrong!";
10729
+ if (type === "picture") return "Ready to take a shot?";
10730
+ return "Ready to record a video?";
10731
+ }, [
10732
+ permissionsState,
10733
+ type
10734
+ ]);
10735
+ (0, $3Sbms$useEffect)(()=>{
10736
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("localVideoAvailable", onDeviceEnabled);
10737
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("microphoneEnabled", onDeviceEnabled);
10738
+ return ()=>{
10739
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("localVideoAvailable", onDeviceEnabled);
10740
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("microphoneEnabled", onDeviceEnabled);
10741
+ };
10742
+ }, []);
10743
+ const permissionsInstructionIndex = Number(permissionsState !== "granted");
10744
+ return /*#__PURE__*/ (0, $3Sbms$jsx)((0, $c0bb66c3d546ed81$export$2b77a92f1a5ad772), {
10745
+ title: title,
10746
+ state: state,
10747
+ centered: permissionsState !== "refused",
10748
+ isDismissable: false,
10749
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10750
+ className: "flex flex-col gap-[20px]",
10751
+ children: [
10752
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10753
+ className: "flex flex-col gap-[10px]",
10754
+ ref: ref,
10755
+ children: permissionsState === "refused" ? /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$Text, {
10756
+ children: "Without camera and microphone access, you can't take photos or videos to share with the support team. Please grant access in your browser settings."
10757
+ }) : /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$Fragment), {
10758
+ children: [
10759
+ permissionsState !== "granted" && /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$InstructionRow, {
10760
+ index: 1,
10761
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)($f4e9ebfd4b02cf09$var$Text, {
10762
+ children: [
10763
+ "When prompted, ",
10764
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$Bold, {
10765
+ children: "allow access"
10766
+ }),
10767
+ " to camera and microphone."
10768
+ ]
10769
+ })
10770
+ }),
10771
+ type === "picture" && /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$Fragment), {
10772
+ children: [
10773
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$InstructionRow, {
10774
+ index: 1 + permissionsInstructionIndex,
10775
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)($f4e9ebfd4b02cf09$var$Text, {
10776
+ children: [
10777
+ "Tap the ",
10778
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $444e1dd9fa8f6883$export$dce36e07153365d), {}),
10779
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$Bold, {
10780
+ children: " Camera button"
10781
+ }),
10782
+ " to take a photo."
10783
+ ]
10784
+ })
10785
+ }),
10786
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$InstructionRow, {
10787
+ index: 2 + permissionsInstructionIndex,
10788
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$Text, {
10789
+ children: "Don't hesitate to take multiple photos for more detail."
10790
+ })
10791
+ }),
10792
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$InstructionRow, {
10793
+ index: 3 + permissionsInstructionIndex,
10794
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)($f4e9ebfd4b02cf09$var$Text, {
10795
+ children: [
10796
+ "You can review your photo and then ",
10797
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$Bold, {
10798
+ children: "send it when you're done."
10799
+ })
10800
+ ]
10801
+ })
10802
+ })
10803
+ ]
10804
+ }),
10805
+ type === "video" && /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$Fragment), {
10806
+ children: [
10807
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$InstructionRow, {
10808
+ index: 1 + permissionsInstructionIndex,
10809
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)($f4e9ebfd4b02cf09$var$Text, {
10810
+ children: [
10811
+ "Tap the ",
10812
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $444e1dd9fa8f6883$export$f9da3144ae2525a3), {}),
10813
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$Bold, {
10814
+ children: " Record button"
10815
+ }),
10816
+ " to start a recording."
10817
+ ]
10818
+ })
10819
+ }),
10820
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$InstructionRow, {
10821
+ index: 2 + permissionsInstructionIndex,
10822
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)($f4e9ebfd4b02cf09$var$Text, {
10823
+ children: [
10824
+ "You can ",
10825
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$Bold, {
10826
+ children: "speak during"
10827
+ }),
10828
+ " the recording for added detail."
10829
+ ]
10830
+ })
10831
+ }),
10832
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$InstructionRow, {
10833
+ index: 3 + permissionsInstructionIndex,
10834
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)($f4e9ebfd4b02cf09$var$Text, {
10835
+ children: [
10836
+ "When you're finished, tap the ",
10837
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $444e1dd9fa8f6883$export$c6a849fd9d9d93a2), {}),
10838
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$Bold, {
10839
+ children: " Stop button"
10840
+ }),
10841
+ "."
10842
+ ]
10843
+ })
10844
+ }),
10845
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$InstructionRow, {
10846
+ index: 4 + permissionsInstructionIndex,
10847
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)($f4e9ebfd4b02cf09$var$Text, {
10848
+ children: [
10849
+ "You can review your video and then ",
10850
+ /*#__PURE__*/ (0, $3Sbms$jsx)($f4e9ebfd4b02cf09$var$Bold, {
10851
+ children: "send it when you're done"
10852
+ }),
10853
+ "."
10854
+ ]
10855
+ })
10856
+ })
10857
+ ]
10858
+ })
10859
+ ]
10860
+ })
10861
+ }),
10862
+ permissionsState !== "refused" && /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10863
+ className: "flex items-center justify-center rounded-[8px] overflow-hidden",
10864
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("video", {
10865
+ src: `${"https://stream-assets.snapcall.io"}/animations/${device}-assist-onboarding-${videoType}-${videoLength}.mp4`,
10866
+ playsInline: true,
10867
+ autoPlay: true,
10868
+ muted: true,
10869
+ loop: true
10870
+ })
10871
+ }),
10872
+ permissionsState === "refused" ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $0590ee3141e14968$export$353f5b6fc5456de1), {
10873
+ onPress: ()=>window.location.reload(),
10874
+ children: "Allow access"
10875
+ }) : /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$Fragment), {
10876
+ children: permissionsState === "granted" ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $0590ee3141e14968$export$353f5b6fc5456de1), {
10877
+ onPress: state.close,
10878
+ children: "Okay"
10879
+ }) : /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $0590ee3141e14968$export$353f5b6fc5456de1), {
10880
+ isDisabled: permissionsState === "requesting",
10881
+ onPress: async ()=>{
10882
+ setPermissionsState("requesting");
10883
+ try {
10884
+ const mediaResult = await navigator.mediaDevices.getUserMedia({
10885
+ audio: true,
10886
+ video: true
10887
+ });
10888
+ mediaResult.getTracks().forEach((track)=>track.stop());
10889
+ await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableMicrophone();
10890
+ await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableVideo({
10891
+ resolution: "vga",
10892
+ frameRate: 20,
10893
+ facingMode: "environment"
10894
+ });
10895
+ } catch {
10896
+ setPermissionsState("refused");
10897
+ }
10898
+ },
10899
+ children: [
10900
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $910dd7d7d872a463$export$2e2bcd8739ae039), {}),
10901
+ "Allow access to cam/mic"
10902
+ ]
10903
+ })
10904
+ })
10905
+ ]
10906
+ })
10907
+ });
10908
+ };
10909
+
10910
+
10911
+ function $a94f21ef9007b90a$export$bd7b6af6aa16550c({ photo: photo = true }) {
10912
+ const [isPhoto, setPhoto] = (0, $3Sbms$useState)(photo);
10913
+ const [streaming, setStreaming] = (0, $3Sbms$useState)(false);
10914
+ return {
10915
+ photo: isPhoto,
10916
+ setPhoto: setPhoto,
10917
+ streaming: streaming,
10918
+ setStreaming: setStreaming
10919
+ };
10920
+ }
10921
+ const $a94f21ef9007b90a$export$11a6fe490bbc4873 = (props)=>{
10922
+ const [isPhotoInstructionsModalOpen, setIsPhotoInstructionsModalOpen] = (0, $3Sbms$useState)(props.state.photo);
10923
+ const [isVideoInstructionsModalOpen, setIsVideoInstructionsModalOpen] = (0, $3Sbms$useState)(!props.state.photo);
10924
+ const photoInstructionsModalState = (0, $3Sbms$useOverlayTriggerState)({
10925
+ isOpen: isPhotoInstructionsModalOpen,
10926
+ onOpenChange: setIsPhotoInstructionsModalOpen
10927
+ });
10928
+ const videoInstructionsModalState = (0, $3Sbms$useOverlayTriggerState)({
10929
+ isOpen: isVideoInstructionsModalOpen,
10930
+ onOpenChange: setIsVideoInstructionsModalOpen
10931
+ });
10932
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10933
+ className: "flex flex-col bg-primary h-[150px] w-full max-w-[400px] rounded-[15px] p-2.5 gap-2.5",
10934
+ children: [
10935
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $f4e9ebfd4b02cf09$export$788cb893d96254c8), {
10936
+ state: photoInstructionsModalState,
10937
+ type: "picture"
10938
+ }),
10939
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $f4e9ebfd4b02cf09$export$788cb893d96254c8), {
10940
+ state: videoInstructionsModalState,
10941
+ type: "video"
10942
+ }),
10943
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10944
+ className: "flex flex-1 flex-row px-[10px] w-full",
10945
+ children: [
10946
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10947
+ className: "flex flex-row flex-auto items-center gap-[10px]",
10948
+ children: [
10949
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $a1ac29d50bdaa837$export$3741e4ac43f04ca2), {}),
10950
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10951
+ className: " text-white text-base font-medium",
10952
+ children: "SnapCall"
10953
+ })
10954
+ ]
10955
+ }),
10956
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10957
+ className: "flex flex-row justify-end flex-auto items-center gap-[10px] ",
10958
+ children: [
10959
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $5a48b7481979330f$export$d2b052e7b4be1756), {
10960
+ onPress: ()=>{
10961
+ if (!props.state.streaming) {
10962
+ props.state.setPhoto(true);
10963
+ photoInstructionsModalState.open();
10964
+ }
10965
+ },
10966
+ isSelected: props.state.photo,
10967
+ children: "Photo"
10968
+ }),
10969
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $5a48b7481979330f$export$d2b052e7b4be1756), {
10970
+ onPress: ()=>{
10971
+ if (!props.state.streaming) {
10972
+ props.state.setPhoto(false);
10973
+ videoInstructionsModalState.open();
10974
+ }
10975
+ },
10976
+ isSelected: !props.state.photo,
10977
+ children: "Video"
10978
+ })
10979
+ ]
10980
+ })
10981
+ ]
10982
+ }),
10983
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
10984
+ className: "flex flex-row flex-1 items-center justify-between w-full ",
10985
+ children: [
10986
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10987
+ className: "w-[60px] h-[60px]",
10988
+ children: props.thumbnail
10989
+ }),
10990
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10991
+ className: "bg-white rounded-full w-[72px] h-[72px] p-[3px]",
10992
+ onClick: ()=>props.onCapturePress(),
10993
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10994
+ className: "bg-primary rounded-full w-full h-full p-[3px] flex items-center justify-center cursor-pointer",
10995
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
10996
+ className: (0, $3Sbms$classnames)("w-full h-full transition-[transform,border-radius] duration-300", props.state.photo ? "bg-white" : "bg-[#f12828]", props.state.streaming ? "rounded-[5px] scale-[0.4]" : "rounded-[60px]")
10997
+ })
10998
+ })
10999
+ }),
11000
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11001
+ onClick: props.onSwitch,
11002
+ className: "bg-[#565656] rounded-full w-[56px] h-[56px] flex items-center justify-center cursor-pointer",
11003
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $58d405d56c1abe95$export$aefffb14595958fe), {})
11004
+ })
11005
+ ]
11006
+ })
11007
+ ]
11008
+ });
11009
+ };
11010
+
11011
+
11012
+
11013
+
11014
+
11015
+
11016
+
11017
+
11018
+
11019
+
11020
+
11021
+
11022
+
11023
+ function $38cdd553fb158eaa$export$4589ed81930b555c(props) {
11024
+ const { children: children , state: state } = props;
11025
+ const ref = (0, $3Sbms$react).useRef(null);
11026
+ const { orientation: orientation } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
11027
+ const { modalProps: modalProps , underlayProps: underlayProps } = (0, $3Sbms$useModalOverlay)(props, state, ref);
11028
+ const [exited, setExited] = (0, $3Sbms$useState)(!state.isOpen);
11029
+ const viewport = (0, $3Sbms$useViewportSize)();
11030
+ const maxHeight = viewport.height - 64;
11031
+ const desktop = orientation === "landscape";
11032
+ // Don't render anything if the modal is not open and we're not animating out.
11033
+ if (!(state.isOpen || !exited)) return null;
11034
+ return /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$Overlay), {
11035
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$CSSTransition), {
11036
+ in: state.isOpen,
11037
+ appear: true,
11038
+ onEntered: ()=>setExited(false),
11039
+ onExited: ()=>setExited(true),
11040
+ timeout: {
11041
+ enter: 0,
11042
+ exit: 300
11043
+ },
11044
+ classNames: {
11045
+ enter: "opacity-0",
11046
+ enterDone: "opacity-1 transition ease-in",
11047
+ exit: "opacity-0 transition ease-out"
11048
+ },
11049
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11050
+ className: (0, $3Sbms$classnames)("fixed z-[100] inset-0 bg-underlay flex justify-center", desktop ? "items-center" : "items-end"),
11051
+ ...underlayProps,
11052
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$CSSTransition), {
11053
+ in: state.isOpen,
11054
+ appear: true,
11055
+ nodeRef: ref,
11056
+ timeout: {
11057
+ enter: 0,
11058
+ exit: 300
11059
+ },
11060
+ classNames: {
11061
+ appear: desktop ? "translate-y-[200%]" : "translate-y-full",
11062
+ appearDone: "translate-y-0 transition duration-300 ease-out",
11063
+ exit: (0, $3Sbms$classnames)("transition ease-out", desktop ? "translate-y-[200%]" : "translate-y-full")
11064
+ },
11065
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11066
+ ...modalProps,
11067
+ ref: ref,
11068
+ className: (0, $3Sbms$classnames)("bg-white z-[1] overflow-auto focus:outline-none", desktop ? "translate-y-[200%] rounded-[15px]" : "translate-y-full rounded-t-[15px]"),
11069
+ style: {
11070
+ maxHeight: `${maxHeight}px`
11071
+ },
11072
+ children: children
11073
+ })
11074
+ })
11075
+ })
11076
+ })
11077
+ });
11078
+ }
11079
+
11080
+
11081
+
11082
+
11083
+
11084
+
11085
+
11086
+
11087
+
11088
+
11089
+
11090
+ const $4425c0dfad3f82bb$export$480db61f4dcd7727 = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
11091
+ width: "12",
11092
+ height: "15",
11093
+ viewBox: "0 0 12 15",
11094
+ fill: "none",
11095
+ xmlns: "http://www.w3.org/2000/svg",
11096
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
11097
+ d: "M11.103 5.747 2.677.272A1.614 1.614 0 0 0 1.773 0a1.62 1.62 0 0 0-.9.288 1.886 1.886 0 0 0-.64.733A2.235 2.235 0 0 0 0 2.025v10.95c0 .352.08.699.233 1.004.154.305.375.558.64.733.273.186.584.285.9.288.317.003.63-.091.904-.272l8.426-5.475c.272-.173.498-.427.656-.736.158-.308.241-.66.241-1.017a2.24 2.24 0 0 0-.24-1.017 1.884 1.884 0 0 0-.657-.736Z",
11098
+ fill: "#fff"
11099
+ })
11100
+ });
11101
+
11102
+
11103
+ const $c7542aa0d9bb5f39$export$1cd1efc78cb52ca5 = ({ asset: asset , onClick: onClick })=>{
11104
+ if (!asset) return null;
11105
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11106
+ className: "flex items-center justify-center w-[60px] h-[60px] rounded-[8px] cursor-pointer bg-white relative overflow-hidden",
11107
+ onClick: onClick,
11108
+ children: [
11109
+ asset?.type === "picture" && /*#__PURE__*/ (0, $3Sbms$jsx)("img", {
11110
+ className: "cursor-pointer bg-white",
11111
+ src: asset.objectUrl,
11112
+ alt: "last shot"
11113
+ }),
11114
+ asset?.type === "video" && /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$Fragment), {
11115
+ children: [
11116
+ /*#__PURE__*/ (0, $3Sbms$jsx)("video", {
11117
+ src: asset.objectUrl,
11118
+ className: "min-w-[100%] min-h-[100%] object-cover"
11119
+ }),
11120
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11121
+ className: "absolute left-0 top-0 flex items-center justify-center w-[60px] h-[60px] bg-primary opacity-50",
11122
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $4425c0dfad3f82bb$export$480db61f4dcd7727), {})
11123
+ })
11124
+ ]
11125
+ })
11126
+ ]
11127
+ });
11128
+ };
11129
+
11130
+
11131
+
11132
+
11133
+ const $a879d6bc7f43b0c5$export$28e1ba20e0688eb7 = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
11134
+ width: "18",
11135
+ height: "19",
11136
+ viewBox: "0 0 18 19",
11137
+ fill: "none",
11138
+ xmlns: "http://www.w3.org/2000/svg",
11139
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
11140
+ d: "M7.5 14a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM15 5h-3v-.75A2.25 2.25 0 0 0 9.75 2h-1.5A2.25 2.25 0 0 0 6 4.25V5H3a.75.75 0 0 0 0 1.5h.75v8.25A2.25 2.25 0 0 0 6 17h6a2.25 2.25 0 0 0 2.25-2.25V6.5H15A.75.75 0 1 0 15 5Zm-7.5-.75a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75V5h-3v-.75Zm5.25 10.5a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V6.5h7.5v8.25ZM10.5 14a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z",
11141
+ fill: "#fff"
11142
+ })
11143
+ });
11144
+
11145
+
11146
+ const $77fb06ba253d6f7c$var$dateFormat = new Intl.DateTimeFormat("default", {
11147
+ dateStyle: "short"
11148
+ });
11149
+ const $77fb06ba253d6f7c$var$timeFormat = new Intl.DateTimeFormat("default", {
11150
+ hour: "numeric",
11151
+ minute: "2-digit"
11152
+ });
11153
+ function $77fb06ba253d6f7c$var$formatDate(date) {
11154
+ const ampm = date.getHours() % 12 >= 12 ? "PM" : "AM";
11155
+ return `${$77fb06ba253d6f7c$var$dateFormat.format(date)} at ${$77fb06ba253d6f7c$var$timeFormat.format(date)} ${ampm}`;
11156
+ }
11157
+ const $77fb06ba253d6f7c$export$c9169049516d8bcf = ({ asset: asset , index: index , removeAsset: removeAsset })=>{
11158
+ const confirmRemovalModalState = (0, $3Sbms$useOverlayTriggerState)({});
11159
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11160
+ className: "flex flex-row justify-between items-center",
11161
+ children: [
11162
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $c0bb66c3d546ed81$export$2b77a92f1a5ad772), {
11163
+ title: "Confirm removal",
11164
+ state: confirmRemovalModalState,
11165
+ description: "Are you sure you want to remove this photo/video? This action cannot be undone.",
11166
+ primaryAction: ({ close: close })=>/*#__PURE__*/ (0, $3Sbms$jsxs)((0, $0590ee3141e14968$export$353f5b6fc5456de1), {
11167
+ onPress: async ()=>{
11168
+ await removeAsset(asset);
11169
+ close();
11170
+ },
11171
+ children: [
11172
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $a879d6bc7f43b0c5$export$28e1ba20e0688eb7), {}),
11173
+ "Confirm"
11174
+ ]
11175
+ }),
11176
+ secondaryAction: "Cancel"
11177
+ }),
11178
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11179
+ className: "flex flex-row gap-[10px] items-center",
11180
+ children: [
11181
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $c7542aa0d9bb5f39$export$1cd1efc78cb52ca5), {
11182
+ asset: asset
11183
+ }),
11184
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("span", {
11185
+ className: "text-sm",
11186
+ style: {
11187
+ hyphens: "manual"
11188
+ },
11189
+ children: [
11190
+ asset.type === "picture" ? "Photo" : "Video",
11191
+ " ",
11192
+ index + 1,
11193
+ " \xb7",
11194
+ " ",
11195
+ $77fb06ba253d6f7c$var$formatDate(new Date(asset.timestamp))
11196
+ ]
11197
+ })
11198
+ ]
11199
+ }),
11200
+ /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
11201
+ className: "text-xs font-bold underline cursor-pointer ml-[10px]",
11202
+ onClick: confirmRemovalModalState.open,
11203
+ children: "Remove"
11204
+ })
11205
+ ]
11206
+ }, asset.assetId);
11207
+ };
11208
+
11209
+
11210
+
11211
+
11212
+ const $7436fc0a14c16764$export$4fa52f68b1c78fbf = ()=>/*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11213
+ className: "w-screen max-w-[400px] h-[235px] px-[20px] py-[25px] gap-[10px]",
11214
+ children: [
11215
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11216
+ className: "w-[360px] h-[93px]",
11217
+ children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$reactcontentloader), {
11218
+ width: 360,
11219
+ height: 93,
11220
+ foregroundColor: "#EBEBEB",
11221
+ children: [
11222
+ /*#__PURE__*/ (0, $3Sbms$jsx)("rect", {
11223
+ x: 0,
11224
+ y: 0,
11225
+ rx: 8,
11226
+ ry: 8,
11227
+ width: 230,
11228
+ height: 16
11229
+ }),
11230
+ /*#__PURE__*/ (0, $3Sbms$jsx)("rect", {
11231
+ x: 0,
11232
+ y: 33,
11233
+ rx: 8,
11234
+ ry: 8,
11235
+ width: 60,
11236
+ height: 60
11237
+ }),
11238
+ /*#__PURE__*/ (0, $3Sbms$jsx)("rect", {
11239
+ x: 70,
11240
+ y: 56,
11241
+ rx: 7,
11242
+ ry: 7,
11243
+ width: 180,
11244
+ height: 14
11245
+ })
11246
+ ]
11247
+ })
11248
+ }),
11249
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11250
+ className: "flex items-center justify-center w-full h-[40px] rounded-[8px] border border-primaryLight mt-[10px]",
11251
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$reactcontentloader), {
11252
+ width: 120,
11253
+ height: 14,
11254
+ foregroundColor: "#EBEBEB",
11255
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("rect", {
11256
+ x: 0,
11257
+ y: 0,
11258
+ rx: 7,
11259
+ ry: 7,
11260
+ width: 120,
11261
+ height: 14
11262
+ })
11263
+ })
11264
+ }),
11265
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11266
+ className: "flex items-center justify-center w-full h-[40px] rounded-[8px] bg-primary mt-[10px]",
11267
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$reactcontentloader), {
11268
+ width: 120,
11269
+ height: 14,
11270
+ foregroundColor: "#EBEBEB",
11271
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("rect", {
11272
+ x: 0,
11273
+ y: 0,
11274
+ rx: 7,
11275
+ ry: 7,
11276
+ width: 120,
11277
+ height: 14
11278
+ })
11279
+ })
11280
+ })
11281
+ ]
11282
+ });
11283
+
11284
+
11285
+ const $d4d374dc7955cc18$export$5c334f209b1aa661 = ({ assets: assets , state: state , onSendAssets: onSendAssets , removeAsset: removeAsset , loading: loading })=>{
11286
+ const ref = (0, $3Sbms$useRef)(null);
11287
+ const [assetKind, setAssetKind] = (0, $3Sbms$useState)(assets[assets.length - 1]?.type === "picture" ? "photo" : "video");
11288
+ const { orientation: orientation } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
11289
+ const desktop = orientation === "landscape";
11290
+ (0, $3Sbms$useEffect)(()=>{
11291
+ if (assets.length < 1) return;
11292
+ setAssetKind(assets[assets.length - 1]?.type === "picture" ? "photo" : "video");
11293
+ }, [
11294
+ assets
11295
+ ]);
11296
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$Fragment), {
11297
+ children: [
11298
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$CSSTransition), {
11299
+ in: state.isOpen,
11300
+ appear: true,
11301
+ timeout: {
11302
+ enter: 0,
11303
+ exit: 300
11304
+ },
11305
+ classNames: {
11306
+ enter: "opacity-0",
11307
+ enterDone: "opacity-90 transition ease-in",
11308
+ exit: "opacity-0 transition ease-out"
11309
+ },
11310
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11311
+ className: (0, $3Sbms$classnames)("fixed justify-center w-screen h-screen top-0 left-0 bg-black z-[1]", state.isOpen ? "flex" : "hidden"),
11312
+ children: loading && /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11313
+ className: (0, $3Sbms$classnames)("flex mt-[50px] h-fit opacity-1", desktop ? "flex-row items-center w-[400px]" : "flex-col items-center text-center w-[320px]"),
11314
+ children: [
11315
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11316
+ className: "w-[24px] h-[24px] m-[10px]",
11317
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $8b7bd174d29d9a1f$export$2e2bcd8739ae039), {})
11318
+ }),
11319
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("span", {
11320
+ className: "text-sm text-white",
11321
+ children: [
11322
+ "Please wait a moment while your ",
11323
+ loading,
11324
+ " is being processed...",
11325
+ loading === "video" ? " It may take up to 15 seconds for a video to be ready." : ""
11326
+ ]
11327
+ })
11328
+ ]
11329
+ })
11330
+ })
11331
+ }),
11332
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $38cdd553fb158eaa$export$4589ed81930b555c), {
11333
+ state: {
11334
+ ...state,
11335
+ close: loading ? ()=>{} : state.close
11336
+ },
11337
+ children: loading ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $7436fc0a14c16764$export$4fa52f68b1c78fbf), {}) : /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11338
+ ref: ref,
11339
+ className: "flex flex-col w-screen max-w-[400px] text-primary",
11340
+ children: [
11341
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11342
+ className: "flex flex-row justify-between p-[12px]",
11343
+ children: [
11344
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("h1", {
11345
+ className: "text-lg first-letter:capitalize",
11346
+ children: [
11347
+ assetKind,
11348
+ " successfully captured"
11349
+ ]
11350
+ }),
11351
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11352
+ className: "flex justify-center items-center rounded-full bg-[#f3f3f3] h-[30px] w-[30px] cursor-pointer",
11353
+ onClick: state.close,
11354
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $57ab7b9a012d9acd$export$2e2bcd8739ae039), {
11355
+ color: "#565656"
11356
+ })
11357
+ })
11358
+ ]
11359
+ }),
11360
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11361
+ className: "flex flex-col px-[20px] pb-[25px] gap-[10px]",
11362
+ children: [
11363
+ assets.map((asset, index)=>/*#__PURE__*/ (0, $3Sbms$jsx)((0, $77fb06ba253d6f7c$export$c9169049516d8bcf), {
11364
+ asset: asset,
11365
+ index: index,
11366
+ removeAsset: removeAsset
11367
+ }, asset.assetId)),
11368
+ /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $0590ee3141e14968$export$353f5b6fc5456de1), {
11369
+ variant: "secondary",
11370
+ onPress: state.close,
11371
+ children: [
11372
+ "Take new ",
11373
+ assetKind
11374
+ ]
11375
+ }),
11376
+ /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $0590ee3141e14968$export$353f5b6fc5456de1), {
11377
+ onPress: ()=>{
11378
+ onSendAssets();
11379
+ state.close();
11380
+ },
11381
+ children: [
11382
+ "Send ",
11383
+ assets.length > 1 ? `${assets.length} elements` : assetKind
11384
+ ]
11385
+ })
11386
+ ]
11387
+ })
11388
+ ]
11389
+ })
11390
+ })
11391
+ ]
11392
+ });
11393
+ };
11394
+
11395
+
11396
+
11397
+
11398
+
11399
+
11400
+
11401
+ const $db82628e5503d51b$export$53819c0e58f98d49 = (props)=>{
11402
+ const [countdown, setCountdown] = (0, $3Sbms$useState)(props.initialValue);
11403
+ (0, $3Sbms$useEffect)(()=>{
11404
+ if (countdown === undefined) return;
11405
+ const t = setTimeout(()=>{
11406
+ if (countdown === 1) props.onFinish();
11407
+ setCountdown(countdown - 1);
11408
+ }, 1000);
11409
+ return ()=>clearTimeout(t);
11410
+ }, [
11411
+ countdown,
11412
+ props
11413
+ ]);
11414
+ return /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11415
+ children: countdown
11416
+ });
11417
+ };
11418
+
11419
+
11420
+ const $92672d57809ea9d3$var$timerText = (delta)=>{
11421
+ const d = [
11422
+ Math.floor(delta / 60),
11423
+ Math.round(delta % 60)
11424
+ ].map((n)=>`${n < 10 ? "0" : ""}${n}`);
11425
+ return d.join(":");
11426
+ };
11427
+ const $92672d57809ea9d3$export$336a011955157f9a = ()=>{
11428
+ const [startRecordTime, setStartRecordTime] = (0, $3Sbms$useState)(undefined);
11429
+ const [timer, setTimer] = (0, $3Sbms$useState)(0);
11430
+ const [countdownVisible, setCountdownVisible] = (0, $3Sbms$useState)(false);
11431
+ const videoElementRef = (0, $3Sbms$useRef)(null);
11432
+ const [assets, setAssets] = (0, $3Sbms$useState)([]);
11433
+ const [assetLoading, setAssetLoading] = (0, $3Sbms$useState)(null);
11434
+ const [isAssetsPopupStateOpen, setIsAssetsPopupStateOpen] = (0, $3Sbms$useState)(false);
11435
+ const assetsPopupState = (0, $3Sbms$useOverlayTriggerState)({
11436
+ isOpen: isAssetsPopupStateOpen,
11437
+ onOpenChange: setIsAssetsPopupStateOpen
11438
+ });
11439
+ const sendAssetsModalState = (0, $3Sbms$useOverlayTriggerState)({});
11440
+ const [flashAnimation, setFlashAnimation] = (0, $3Sbms$useState)(false);
11441
+ const menuBarState = (0, $a94f21ef9007b90a$export$bd7b6af6aa16550c)({});
11442
+ const exitStreaming = (0, $3Sbms$useCallback)(()=>{
11443
+ menuBarState.setStreaming(false);
11444
+ setStartRecordTime(undefined);
11445
+ setCountdownVisible(false);
11446
+ setTimer(0);
11447
+ }, [
11448
+ menuBarState
11449
+ ]);
11450
+ const onLocalVideoChange = (event)=>{
11451
+ if (!event.detail?.camera?.device || !videoElementRef.current) return;
11452
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).requestLocalVideo(videoElementRef?.current);
11453
+ };
11454
+ const onStopRecord = (0, $3Sbms$useCallback)((event)=>{
11455
+ const { url: url , assetId: assetId } = event.detail;
11456
+ exitStreaming();
11457
+ setAssetLoading(null);
11458
+ setAssets([
11459
+ ...assets,
11460
+ {
11461
+ type: "video",
11462
+ timestamp: Date.now(),
11463
+ objectUrl: url,
11464
+ assetId: assetId
11465
+ }
11466
+ ]);
11467
+ }, [
11468
+ assets,
11469
+ exitStreaming
11470
+ ]);
11471
+ const onPhotoCapture = async (videoElement)=>{
11472
+ const timestamp = Date.now();
11473
+ setAssetLoading("picture");
11474
+ const image = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).captureVideo(videoElement);
11475
+ const { url: url , assetId: assetId } = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).saveCapture(image);
11476
+ setAssetLoading(null);
11477
+ setAssets([
11478
+ ...assets,
11479
+ {
11480
+ type: "picture",
11481
+ timestamp: timestamp,
11482
+ objectUrl: url,
11483
+ assetId: assetId
11484
+ }
11485
+ ]);
11486
+ };
11487
+ const removeAsset = (0, $3Sbms$useCallback)(async (asset)=>{
11488
+ if (!asset.assetId) return;
11489
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).deleteCapture(asset.assetId);
11490
+ const newAssets = assets.filter((item)=>item.assetId !== asset.assetId);
11491
+ setAssets(newAssets);
11492
+ if (newAssets.length < 1) setIsAssetsPopupStateOpen(false);
11493
+ }, [
11494
+ assets
11495
+ ]);
11496
+ (0, $3Sbms$useEffect)(()=>{
11497
+ if (startRecordTime === undefined) return;
11498
+ const interval = setInterval(()=>{
11499
+ const delta = (Date.now() - startRecordTime) / 1000;
11500
+ setTimer(delta);
11501
+ }, 1000);
11502
+ return ()=>clearInterval(interval);
11503
+ }, [
11504
+ startRecordTime
11505
+ ]);
11506
+ (0, $3Sbms$useEffect)(()=>{
11507
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("localVideoAvailable", onLocalVideoChange);
11508
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("localVideoChange", onLocalVideoChange);
11509
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("recordStopped", onStopRecord);
11510
+ return ()=>{
11511
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("localVideoChange", onLocalVideoChange);
11512
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("localVideoAvailable", onLocalVideoChange);
11513
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("recordStopped", onStopRecord);
11514
+ };
11515
+ }, [
11516
+ onStopRecord
11517
+ ]);
11518
+ return /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11519
+ className: "bg-[#000] w-full h-full justify-center flex flex-col antialiased",
11520
+ children: [
11521
+ !menuBarState.photo && /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11522
+ className: "text-base text-white text-center font-medium pt-2.5",
11523
+ children: $92672d57809ea9d3$var$timerText(timer)
11524
+ }),
11525
+ countdownVisible && /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11526
+ className: "absolute z-50 top-0 bottom-[160px] left-0 right-0 text-[100px] flex items-center justify-center text-center text-white bg-[#000000] opacity-[0.6] ",
11527
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $db82628e5503d51b$export$53819c0e58f98d49), {
11528
+ initialValue: 3,
11529
+ onFinish: ()=>{
11530
+ setCountdownVisible(false);
11531
+ setStartRecordTime(Date.now());
11532
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).startRecord();
11533
+ }
11534
+ })
11535
+ }),
11536
+ /*#__PURE__*/ (0, $3Sbms$jsxs)("div", {
11537
+ className: "relative flex-1 min-h-0 px-2.5 pt-2.5",
11538
+ children: [
11539
+ flashAnimation && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6efc75079651494a$export$2b501aee548bae06), {
11540
+ onAnimationEnd: ()=>{
11541
+ setFlashAnimation(false);
11542
+ assetsPopupState.open();
11543
+ }
11544
+ }),
11545
+ /*#__PURE__*/ (0, $3Sbms$jsx)("video", {
11546
+ autoPlay: true,
11547
+ muted: true,
11548
+ playsInline: true,
11549
+ ref: videoElementRef,
11550
+ className: "w-full h-full object-cover rounded-[10px]"
11551
+ })
11552
+ ]
11553
+ }),
11554
+ /*#__PURE__*/ (0, $3Sbms$jsx)("div", {
11555
+ className: "flex justify-center p-2.5",
11556
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $a94f21ef9007b90a$export$11a6fe490bbc4873), {
11557
+ state: menuBarState,
11558
+ thumbnail: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $c7542aa0d9bb5f39$export$1cd1efc78cb52ca5), {
11559
+ asset: assets[assets.length - 1],
11560
+ onClick: assetsPopupState.open
11561
+ }),
11562
+ onSwitch: ()=>{
11563
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).rotateVideo();
11564
+ },
11565
+ onCapturePress: ()=>{
11566
+ if (menuBarState.photo && videoElementRef.current) {
11567
+ onPhotoCapture(videoElementRef.current);
11568
+ setFlashAnimation(true);
11569
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).captureVideo(videoElementRef.current);
11570
+ }
11571
+ if (!menuBarState.photo && !menuBarState.streaming) {
11572
+ menuBarState.setStreaming(true);
11573
+ setTimer(0);
11574
+ setCountdownVisible(true);
11575
+ }
11576
+ if (!menuBarState.photo && menuBarState.streaming) {
11577
+ exitStreaming();
11578
+ if (startRecordTime) {
11579
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).stopRecord();
11580
+ setAssetLoading("video");
11581
+ assetsPopupState.open();
11582
+ }
11583
+ }
11584
+ }
11585
+ })
11586
+ }),
11587
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $d4d374dc7955cc18$export$5c334f209b1aa661), {
11588
+ assets: assets,
11589
+ state: assetsPopupState,
11590
+ onSendAssets: sendAssetsModalState.open,
11591
+ removeAsset: removeAsset,
11592
+ loading: assetLoading
11593
+ }),
11594
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $c0bb66c3d546ed81$export$2b77a92f1a5ad772), {
11595
+ title: "Thank you for your submission!",
11596
+ state: sendAssetsModalState,
11597
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
11598
+ className: "text-base text-primaryLight",
11599
+ children: "Your photo/video has been successfully sent. We will review it and get back to you soon."
11600
+ })
11601
+ })
11602
+ ]
11603
+ });
11604
+ };
11605
+
11606
+
11607
+ const $26ed036cbc17809a$var$currentTheme = (0, $52580db2e49cdd90$export$3bfd0d5209a8006a)();
11608
+ const $26ed036cbc17809a$var$currentLanguage = (0, $a3e657fb86ae23f3$export$604ba5624273df44)();
11609
+ let $26ed036cbc17809a$var$timestampCriticalError = -1;
11610
+ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
11611
+ const [selfPeerId, setSelfPeerId] = (0, $3Sbms$useState)(undefined);
11612
+ const streamUIContainerRef = (0, $3Sbms$useRef)(null);
11613
+ const videosContainerRef = (0, $3Sbms$useRef)(null);
11614
+ const remoteTilesContainerRef = (0, $3Sbms$useRef)(null);
11615
+ const [streamState, setStreamState] = (0, $3Sbms$useState)(options.recorder ? "recorder" : "streaming");
11616
+ const [isQuickConnectPopupVisible, setIsQuickConnectPopupVisible] = (0, $3Sbms$useState)(false);
11617
+ const [isSettingsMenuVisible, setIsSettingsMenuVisible] = (0, $3Sbms$useState)(false);
11618
+ const [isYoutubePopupVisible, setIsYoutubePopupVisible] = (0, $3Sbms$useState)(false);
11619
+ const [isLinksharePopupVisible, setIsLinksharePopupVisible] = (0, $3Sbms$useState)(false);
11620
+ const [isVirtualBackgroundPopupVisible, setIsVirtualBackgroundPopupVisible] = (0, $3Sbms$useState)(false);
11621
+ const [theme, setTheme] = (0, $3Sbms$useState)($26ed036cbc17809a$var$currentTheme);
11622
+ const [language, setLanguage] = (0, $3Sbms$useState)(options.language || $26ed036cbc17809a$var$currentLanguage);
11623
+ const [profile, setProfile] = (0, $3Sbms$useState)({});
11624
+ const [muted, setMuted] = (0, $3Sbms$useState)(true);
11625
+ const [streaming, setStreaming] = (0, $3Sbms$useState)(false);
11626
+ const [screensharing, setScreensharing] = (0, $3Sbms$useState)(false);
11627
+ const [isAgent, setIsAgent] = (0, $3Sbms$useState)(false);
11628
+ const [userInteractionTriggered, setUserInteractionTriggered] = (0, $3Sbms$useState)(false);
11629
+ const [containerWidth, containerHeight] = (0, $af23c74942bdcae7$export$2b86bedf890eab8)(streamUIContainerRef.current);
11630
+ const [isBlockedDevicesPopupOpen, setBlockedDevicesPopupOpen] = (0, $3Sbms$useState)(false);
11631
+ const [isBlockedFeaturePopupOpen, setBlockedFeaturePopupOpen] = (0, $3Sbms$useState)(false);
11632
+ const [permissions, setPermissions] = (0, $3Sbms$useState)([]);
11633
+ const [plan, setPlan] = (0, $3Sbms$useState)(undefined);
11634
+ const orientation = (containerWidth || window.screen.width) > (containerHeight || window.screen.height) ? "landscape" : "portrait";
11635
+ const styledTheme = theme === "dark" ? (0, $52580db2e49cdd90$export$3e936a8db52a10a0) : (0, $52580db2e49cdd90$export$f30cb9bc4f736419);
11636
+ const onWebcamUpdate = (event)=>{
11637
+ if (event.type === "localVideoAvailable") setStreaming(true);
11638
+ else setStreaming(false);
11639
+ };
11640
+ const onScreenshareUpdate = (event)=>{
11641
+ if (event.type === "screenshareEnabled") setScreensharing(true);
11642
+ else setScreensharing(false);
11643
+ };
11644
+ const onMicrophoneUpdate = (event)=>{
11645
+ if (event.type === "microphoneMute") setMuted(true);
11646
+ else setMuted(false);
11647
+ };
11648
+ const onDefaultAudioDeviceChange = (event)=>{
11649
+ const micro = event.detail.label;
11650
+ (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`Connected to ${micro}`, {
11651
+ duration: 3000,
11652
+ icon: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $6043ae1b48c5aa97$export$2e2bcd8739ae039), {}),
11653
+ messageStyle: {
11654
+ fontWeight: 600
11655
+ }
11656
+ });
11657
+ };
11658
+ const onSelfProfileUpdate = (event)=>{
11659
+ const { profile: profile } = event.detail;
11660
+ setProfile(profile);
11661
+ };
11662
+ const onCallEnd = ()=>{
11663
+ (0, $15a01b611391c1e7$export$716eeec86fd18da7)();
11664
+ setStreamState("ended");
11665
+ setMuted(true);
11666
+ setStreaming(false);
11667
+ setScreensharing(false);
11668
+ setUserInteractionTriggered(false);
11669
+ };
11670
+ const onCallTerminated = ()=>{
11671
+ (0, $15a01b611391c1e7$export$716eeec86fd18da7)();
11672
+ setStreamState("terminated");
11673
+ };
11674
+ const onInvalidRoom = ()=>{
11675
+ setStreamState("expired");
11676
+ };
11677
+ const onAgentIdentity = (event)=>{
11678
+ const { success: success , email: email } = event.detail;
11679
+ if (success) {
11680
+ setIsAgent(true);
11681
+ if (email) (0, $3Sbms$hotjarbrowser).identify(null, {
11682
+ email: email
11683
+ });
11684
+ } else (0, $3Sbms$reacthottoast)("An error occured while trying to join the room as an agent", {
11685
+ className: "error"
11686
+ });
11687
+ };
11688
+ const onCriticalError = (event)=>{
11689
+ const duration = 20000;
11690
+ const now = Date.now();
11691
+ if (event.detail.code === "USERLIMIT") {
11692
+ setStreamState("full");
11693
+ return;
11694
+ }
11695
+ if ($26ed036cbc17809a$var$timestampCriticalError !== -1 && $26ed036cbc17809a$var$timestampCriticalError + duration > now) return;
11696
+ $26ed036cbc17809a$var$timestampCriticalError = now;
11697
+ (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`A critical error has occurred (error ${event.detail.code}).`, {
11698
+ icon: (0, $93a0377c243d965e$export$c7df1b15b59b1df2),
11699
+ button: {
11700
+ text: "Reload",
11701
+ action: ()=>{
11702
+ window.location.reload();
11703
+ }
11704
+ },
11705
+ duration: duration
11706
+ });
11707
+ };
11708
+ (0, $3Sbms$useEffect)(()=>{
11709
+ try {
11710
+ localStorage.setItem("stream_ui_theme", theme);
11711
+ } catch (localStorageError) {
11712
+ console.warn(localStorageError);
11713
+ }
11714
+ }, [
11715
+ theme
11716
+ ]);
11717
+ (0, $3Sbms$useEffect)(()=>{
11718
+ try {
11719
+ localStorage.setItem("stream_ui_language", language);
11720
+ (0, $384d985bb9605c35$export$2e2bcd8739ae039).changeLanguage(language);
11721
+ } catch (localStorageError) {
11722
+ console.warn(localStorageError);
11723
+ }
11724
+ }, [
11725
+ language
11726
+ ]);
11727
+ (0, $3Sbms$useEffect)(()=>{
11728
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("localVideoAvailable", onWebcamUpdate);
11729
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("localVideoUnavailable", onWebcamUpdate);
11730
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("screenshareEnabled", onScreenshareUpdate);
11731
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("screenshareDisabled", onScreenshareUpdate);
11732
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("microphoneEnabled", onMicrophoneUpdate);
11733
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("microphoneMute", onMicrophoneUpdate);
11734
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("microphoneUnmute", onMicrophoneUpdate);
11735
+ (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("defaultAudioDeviceChange", onDefaultAudioDeviceChange);
10410
11736
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("selfProfileUpdate", onSelfProfileUpdate);
10411
11737
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("terminateRoom", onCallTerminated);
10412
11738
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("leaveRoom", onCallEnd);
@@ -10437,7 +11763,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
10437
11763
  setPermissions(event.detail.permissions);
10438
11764
  console.log(event.detail.permissions);
10439
11765
  setSelfPeerId(peerId);
10440
- try {
11766
+ if (!options.recorder) try {
10441
11767
  await (0, $15a01b611391c1e7$export$494039379563c94d)(options);
10442
11768
  setUserInteractionTriggered(true);
10443
11769
  } catch (userInteractionError) {
@@ -10479,7 +11805,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
10479
11805
  language: language,
10480
11806
  setLanguage: setLanguage,
10481
11807
  options: options,
10482
- profile: profile1,
11808
+ profile: profile,
10483
11809
  muted: muted,
10484
11810
  streaming: streaming,
10485
11811
  screensharing: screensharing,
@@ -10503,6 +11829,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
10503
11829
  setBlockedDevicesPopupOpen(false);
10504
11830
  }
10505
11831
  }),
11832
+ streamState === "recorder" && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $92672d57809ea9d3$export$336a011955157f9a), {}),
10506
11833
  streamState === "streaming" && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$Fragment), {
10507
11834
  children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $cce9fd41d8a55a18$export$74636703cfe1eecf), {
10508
11835
  children: [
@@ -10774,14 +12101,14 @@ const $f8d57e3d223f5089$var$GreetingView = ({ onGreetingDone: onGreetingDone })
10774
12101
  const [mainContainerRef, { width: width , height: height }] = (0, $af23c74942bdcae7$export$e295b0c537d32d7d)();
10775
12102
  const inputRef = (0, $3Sbms$useRef)(null);
10776
12103
  const videoRef = (0, $3Sbms$useRef)(null);
10777
- const [videoTrack1, setVideoTrack] = (0, $3Sbms$useState)(undefined);
12104
+ const [videoTrack, setVideoTrack] = (0, $3Sbms$useState)(undefined);
10778
12105
  const [micEnabled, setMicEnabled] = (0, $3Sbms$useState)(false);
10779
12106
  const [joining, setJoining] = (0, $3Sbms$useState)(false);
10780
12107
  const desktop = width >= height;
10781
12108
  const onSubmit = ()=>{
10782
12109
  const displayName = inputRef.current?.value;
10783
- const cameraEnabled = Boolean(videoTrack1);
10784
- videoTrack1?.stop();
12110
+ const cameraEnabled = Boolean(videoTrack);
12111
+ videoTrack?.stop();
10785
12112
  setJoining(true);
10786
12113
  setTimeout(()=>{
10787
12114
  onGreetingDone({
@@ -10804,15 +12131,15 @@ const $f8d57e3d223f5089$var$GreetingView = ({ onGreetingDone: onGreetingDone })
10804
12131
  }
10805
12132
  };
10806
12133
  const onCameraClick = (0, $3Sbms$useCallback)(async ()=>{
10807
- if (!videoTrack1) await getUserMedia({
12134
+ if (!videoTrack) await getUserMedia({
10808
12135
  video: true
10809
12136
  });
10810
12137
  else {
10811
- videoTrack1.stop();
12138
+ videoTrack.stop();
10812
12139
  setVideoTrack(undefined);
10813
12140
  }
10814
12141
  }, [
10815
- videoTrack1
12142
+ videoTrack
10816
12143
  ]);
10817
12144
  const onMicrophoneClick = (0, $3Sbms$useCallback)(async ()=>{
10818
12145
  if (!micEnabled) await getUserMedia({
@@ -10824,14 +12151,14 @@ const $f8d57e3d223f5089$var$GreetingView = ({ onGreetingDone: onGreetingDone })
10824
12151
  ]);
10825
12152
  (0, $3Sbms$useEffect)(()=>{
10826
12153
  if (videoRef.current) {
10827
- if (videoTrack1) videoRef.current.srcObject = new MediaStream([
10828
- videoTrack1
12154
+ if (videoTrack) videoRef.current.srcObject = new MediaStream([
12155
+ videoTrack
10829
12156
  ]);
10830
12157
  else videoRef.current.srcObject = null;
10831
12158
  }
10832
12159
  }, [
10833
12160
  videoRef,
10834
- videoTrack1,
12161
+ videoTrack,
10835
12162
  width,
10836
12163
  height
10837
12164
  ]);
@@ -10848,7 +12175,7 @@ const $f8d57e3d223f5089$var$GreetingView = ({ onGreetingDone: onGreetingDone })
10848
12175
  height: 40
10849
12176
  })
10850
12177
  });
10851
- const webcamEnabled = Boolean(videoTrack1);
12178
+ const webcamEnabled = Boolean(videoTrack);
10852
12179
  return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $35c6a4b506b7dc62$export$d653589df987fd93), {
10853
12180
  ref: mainContainerRef,
10854
12181
  children: [
@@ -10947,10 +12274,15 @@ const $f8d57e3d223f5089$var$GreetingView = ({ onGreetingDone: onGreetingDone })
10947
12274
  var $f8d57e3d223f5089$export$2e2bcd8739ae039 = $f8d57e3d223f5089$var$GreetingView;
10948
12275
 
10949
12276
 
12277
+ var $1e2747ca72d0ab49$exports = {};
12278
+ $1e2747ca72d0ab49$exports = "*, :before, :after {\n box-sizing: border-box;\n border: 0 solid #e5e7eb;\n}\n\n:before, :after {\n --tw-content: \"\";\n}\n\nhtml {\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-feature-settings: normal;\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n line-height: 1.5;\n}\n\nbody {\n line-height: inherit;\n margin: 0;\n}\n\nhr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n}\n\nabbr:where([title]) {\n text-decoration: underline dotted;\n}\n\nh1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\nb, strong {\n font-weight: bolder;\n}\n\ncode, kbd, samp, pre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;\n font-size: 1em;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub, sup {\n vertical-align: baseline;\n font-size: 75%;\n line-height: 0;\n position: relative;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\ntable {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n}\n\nbutton, input, optgroup, select, textarea {\n font-family: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n color: inherit;\n margin: 0;\n padding: 0;\n}\n\nbutton, select {\n text-transform: none;\n}\n\nbutton, [type=\"button\"], [type=\"reset\"], [type=\"submit\"] {\n -webkit-appearance: button;\n background-color: #0000;\n background-image: none;\n}\n\n:-moz-focusring {\n outline: auto;\n}\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\n\nsummary {\n display: list-item;\n}\n\nblockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol, ul, menu {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\ntextarea {\n resize: vertical;\n}\n\ninput::placeholder, textarea::placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n\nbutton, [role=\"button\"] {\n cursor: pointer;\n}\n\n:disabled {\n cursor: default;\n}\n\nimg, svg, video, canvas, audio, iframe, embed, object {\n vertical-align: middle;\n display: block;\n}\n\nimg, video {\n max-width: 100%;\n height: auto;\n}\n\n[hidden] {\n display: none;\n}\n\n*, :before, :after, ::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: #3b82f680;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n\n.visible {\n visibility: visible;\n}\n\n.fixed {\n position: fixed;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.inset-0 {\n inset: 0;\n}\n\n.top-0 {\n top: 0;\n}\n\n.bottom-\\[160px\\] {\n bottom: 160px;\n}\n\n.left-0 {\n left: 0;\n}\n\n.right-0 {\n right: 0;\n}\n\n.z-\\[100\\] {\n z-index: 100;\n}\n\n.z-\\[1\\] {\n z-index: 1;\n}\n\n.z-50 {\n z-index: 50;\n}\n\n.m-\\[10px\\] {\n margin: 10px;\n}\n\n.mx-\\[20px\\] {\n margin-left: 20px;\n margin-right: 20px;\n}\n\n.ml-\\[10px\\] {\n margin-left: 10px;\n}\n\n.mt-\\[10px\\] {\n margin-top: 10px;\n}\n\n.mt-\\[50px\\] {\n margin-top: 50px;\n}\n\n.block {\n display: block;\n}\n\n.inline {\n display: inline;\n}\n\n.flex {\n display: flex;\n}\n\n.table {\n display: table;\n}\n\n.hidden {\n display: none;\n}\n\n.h-\\[24px\\] {\n height: 24px;\n}\n\n.h-\\[150px\\] {\n height: 150px;\n}\n\n.h-\\[60px\\] {\n height: 60px;\n}\n\n.h-\\[72px\\] {\n height: 72px;\n}\n\n.h-full {\n height: 100%;\n}\n\n.h-\\[56px\\] {\n height: 56px;\n}\n\n.h-\\[40px\\] {\n height: 40px;\n}\n\n.h-\\[235px\\] {\n height: 235px;\n}\n\n.h-\\[93px\\] {\n height: 93px;\n}\n\n.h-screen {\n height: 100vh;\n}\n\n.h-fit {\n height: -moz-fit-content;\n height: fit-content;\n}\n\n.h-\\[30px\\] {\n height: 30px;\n}\n\n.min-h-0 {\n min-height: 0;\n}\n\n.min-h-\\[100\\%\\] {\n min-height: 100%;\n}\n\n.w-full {\n width: 100%;\n}\n\n.w-\\[60px\\] {\n width: 60px;\n}\n\n.w-\\[72px\\] {\n width: 72px;\n}\n\n.w-\\[56px\\] {\n width: 56px;\n}\n\n.w-\\[76px\\] {\n width: 76px;\n}\n\n.w-screen {\n width: 100vw;\n}\n\n.w-\\[360px\\] {\n width: 360px;\n}\n\n.w-\\[400px\\] {\n width: 400px;\n}\n\n.w-\\[320px\\] {\n width: 320px;\n}\n\n.w-\\[24px\\] {\n width: 24px;\n}\n\n.w-\\[30px\\] {\n width: 30px;\n}\n\n.min-w-\\[24px\\] {\n min-width: 24px;\n}\n\n.min-w-\\[100\\%\\] {\n min-width: 100%;\n}\n\n.max-w-\\[400px\\] {\n max-width: 400px;\n}\n\n.max-w-\\[600px\\] {\n max-width: 600px;\n}\n\n.max-w-\\[800px\\] {\n max-width: 800px;\n}\n\n.flex-1 {\n flex: 1;\n}\n\n.flex-auto {\n flex: auto;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.translate-y-2 {\n --tw-translate-y: .5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-\\[200\\%\\] {\n --tw-translate-y: 200%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.translate-y-full {\n --tw-translate-y: 100%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.scale-\\[0\\.4\\] {\n --tw-scale-x: .4;\n --tw-scale-y: .4;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.cursor-not-allowed {\n cursor: not-allowed;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.resize {\n resize: both;\n}\n\n.flex-row {\n flex-direction: row;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.flex-wrap {\n flex-wrap: wrap;\n}\n\n.items-end {\n align-items: flex-end;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-center {\n justify-content: center;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-\\[5px\\] {\n gap: 5px;\n}\n\n.gap-\\[20px\\] {\n gap: 20px;\n}\n\n.gap-\\[10px\\] {\n gap: 10px;\n}\n\n.gap-2\\.5 {\n gap: .625rem;\n}\n\n.gap-2 {\n gap: .5rem;\n}\n\n.gap-5 {\n gap: 1.25rem;\n}\n\n.overflow-auto {\n overflow: auto;\n}\n\n.overflow-hidden {\n overflow: hidden;\n}\n\n.rounded-lg {\n border-radius: .5rem;\n}\n\n.rounded-md {\n border-radius: .375rem;\n}\n\n.rounded-\\[50\\%\\] {\n border-radius: 50%;\n}\n\n.rounded-\\[8px\\] {\n border-radius: 8px;\n}\n\n.rounded-\\[15px\\] {\n border-radius: 15px;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.rounded-\\[5px\\] {\n border-radius: 5px;\n}\n\n.rounded-\\[60px\\] {\n border-radius: 60px;\n}\n\n.rounded-\\[10px\\] {\n border-radius: 10px;\n}\n\n.rounded-t-\\[15px\\] {\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-secondaryLight {\n --tw-border-opacity: 1;\n border-color: rgb(179 179 179 / var(--tw-border-opacity));\n}\n\n.border-primaryLight {\n --tw-border-opacity: 1;\n border-color: rgb(86 86 86 / var(--tw-border-opacity));\n}\n\n.bg-primaryLight {\n --tw-bg-opacity: 1;\n background-color: rgb(86 86 86 / var(--tw-bg-opacity));\n}\n\n.bg-primary {\n --tw-bg-opacity: 1;\n background-color: rgb(29 28 32 / var(--tw-bg-opacity));\n}\n\n.bg-graySelected {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.bg-transparent {\n background-color: #0000;\n}\n\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity));\n}\n\n.bg-secondaryVLight {\n --tw-bg-opacity: 1;\n background-color: rgb(235 235 235 / var(--tw-bg-opacity));\n}\n\n.bg-\\[\\#f12828\\] {\n --tw-bg-opacity: 1;\n background-color: rgb(241 40 40 / var(--tw-bg-opacity));\n}\n\n.bg-\\[\\#565656\\] {\n --tw-bg-opacity: 1;\n background-color: rgb(86 86 86 / var(--tw-bg-opacity));\n}\n\n.bg-black, .bg-\\[\\#000\\], .bg-\\[\\#000000\\] {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity));\n}\n\n.bg-\\[\\#FFFFFF\\] {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity));\n}\n\n.bg-underlay {\n background-color: #00000040;\n}\n\n.bg-\\[\\#f3f3f3\\] {\n --tw-bg-opacity: 1;\n background-color: rgb(243 243 243 / var(--tw-bg-opacity));\n}\n\n.bg-opacity-90 {\n --tw-bg-opacity: .9;\n}\n\n.object-cover {\n object-fit: cover;\n}\n\n.p-2\\.5 {\n padding: .625rem;\n}\n\n.p-2 {\n padding: .5rem;\n}\n\n.p-\\[3px\\] {\n padding: 3px;\n}\n\n.p-\\[12px\\] {\n padding: 12px;\n}\n\n.py-3 {\n padding-top: .75rem;\n padding-bottom: .75rem;\n}\n\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n\n.py-\\[9px\\] {\n padding-top: 9px;\n padding-bottom: 9px;\n}\n\n.px-3\\.5 {\n padding-left: .875rem;\n padding-right: .875rem;\n}\n\n.px-3 {\n padding-left: .75rem;\n padding-right: .75rem;\n}\n\n.py-2 {\n padding-top: .5rem;\n padding-bottom: .5rem;\n}\n\n.py-1\\.5 {\n padding-top: .375rem;\n padding-bottom: .375rem;\n}\n\n.px-2\\.5 {\n padding-left: .625rem;\n padding-right: .625rem;\n}\n\n.py-1 {\n padding-top: .25rem;\n padding-bottom: .25rem;\n}\n\n.px-2 {\n padding-left: .5rem;\n padding-right: .5rem;\n}\n\n.px-\\[10px\\] {\n padding-left: 10px;\n padding-right: 10px;\n}\n\n.px-5 {\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n}\n\n.py-\\[25px\\] {\n padding-top: 25px;\n padding-bottom: 25px;\n}\n\n.px-\\[20px\\] {\n padding-left: 20px;\n padding-right: 20px;\n}\n\n.pt-2\\.5 {\n padding-top: .625rem;\n}\n\n.pt-2 {\n padding-top: .5rem;\n}\n\n.pb-\\[25px\\] {\n padding-bottom: 25px;\n}\n\n.text-center {\n text-align: center;\n}\n\n.text-base {\n letter-spacing: -.02em;\n font-size: 16px;\n line-height: 19px;\n}\n\n.text-sm {\n letter-spacing: -.02em;\n font-size: 14px;\n line-height: 17px;\n}\n\n.text-xs {\n letter-spacing: -.02em;\n font-size: 12px;\n line-height: 14px;\n}\n\n.text-xl {\n letter-spacing: -.02em;\n font-size: 20px;\n line-height: 24px;\n}\n\n.text-\\[100px\\] {\n font-size: 100px;\n}\n\n.text-lg {\n letter-spacing: -.02em;\n font-size: 18px;\n line-height: 22px;\n}\n\n.font-medium {\n font-weight: 500;\n}\n\n.font-normal {\n font-weight: 400;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.leading-\\[20px\\] {\n line-height: 20px;\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n\n.text-primary {\n --tw-text-opacity: 1;\n color: rgb(29 28 32 / var(--tw-text-opacity));\n}\n\n.text-primaryLight {\n --tw-text-opacity: 1;\n color: rgb(86 86 86 / var(--tw-text-opacity));\n}\n\n.text-secondary {\n --tw-text-opacity: 1;\n color: rgb(134 134 134 / var(--tw-text-opacity));\n}\n\n.text-black {\n --tw-text-opacity: 1;\n color: rgb(0 0 0 / var(--tw-text-opacity));\n}\n\n.underline {\n text-decoration-line: underline;\n}\n\n.antialiased {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.opacity-0 {\n opacity: 0;\n}\n\n.opacity-\\[0\\.6\\] {\n opacity: .6;\n}\n\n.opacity-50 {\n opacity: .5;\n}\n\n.opacity-\\[0\\.4\\] {\n opacity: .4;\n}\n\n.opacity-90 {\n opacity: .9;\n}\n\n.outline {\n outline-style: solid;\n}\n\n.ring-\\[3px\\] {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);\n}\n\n.ring-cta {\n --tw-ring-opacity: 1;\n --tw-ring-color: rgb(38 138 250 / var(--tw-ring-opacity));\n}\n\n.blur {\n --tw-blur: blur(8px);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter, backdrop-filter;\n transition-duration: .15s;\n transition-timing-function: cubic-bezier(.4, 0, .2, 1);\n}\n\n.transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-duration: .15s;\n transition-timing-function: cubic-bezier(.4, 0, .2, 1);\n}\n\n.transition-\\[transform\\,border-radius\\] {\n transition-property: transform, border-radius;\n transition-duration: .15s;\n transition-timing-function: cubic-bezier(.4, 0, .2, 1);\n}\n\n.duration-300 {\n transition-duration: .3s;\n}\n\n.ease-in-out {\n transition-timing-function: cubic-bezier(.4, 0, .2, 1);\n}\n\n.ease-in {\n transition-timing-function: cubic-bezier(.4, 0, 1, 1);\n}\n\n.ease-out {\n transition-timing-function: cubic-bezier(0, 0, .2, 1);\n}\n\n.first-letter\\:capitalize:first-letter {\n text-transform: capitalize;\n}\n\n.focus\\:outline-none:focus {\n outline-offset: 2px;\n outline: 2px solid #0000;\n}\n\n.disabled\\:bg-secondaryLight:disabled {\n --tw-bg-opacity: 1;\n background-color: rgb(179 179 179 / var(--tw-bg-opacity));\n}\n\n.disabled\\:bg-graySelected:disabled {\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n\n.disabled\\:text-secondaryLight:disabled {\n --tw-text-opacity: 1;\n color: rgb(179 179 179 / var(--tw-text-opacity));\n}\n\n";
12279
+
12280
+
10950
12281
  const $24075a5d702d64b3$var$currentURL = new URL(window.location.href);
10951
12282
  const $24075a5d702d64b3$var$microphoneEnabled = $24075a5d702d64b3$var$currentURL.searchParams.get("microphone-enabled") !== "0";
10952
12283
  const $24075a5d702d64b3$var$cameraEnabled = $24075a5d702d64b3$var$currentURL.searchParams.get("camera-enabled") === "1";
10953
12284
  const $24075a5d702d64b3$var$defaultOptions = {
12285
+ recorder: false,
10954
12286
  sharedURL: window.location.href,
10955
12287
  showMenuButton: true,
10956
12288
  settingsShortcuts: [
@@ -10980,8 +12312,17 @@ const $24075a5d702d64b3$export$3f94917203ab7078 = {
10980
12312
  if (element?.nodeType !== window.Node.ELEMENT_NODE) throw new Error('The "element" property must be a valid element!');
10981
12313
  const mergedOptions = (0, $365e765f9890497b$export$6969335ea1e4e77c)($24075a5d702d64b3$var$defaultOptions, options);
10982
12314
  const rootElement = (0, $3Sbms$createRoot)(element);
10983
- rootElement.render(/*#__PURE__*/ (0, $3Sbms$jsx)((0, $26ed036cbc17809a$export$2e2bcd8739ae039), {
10984
- options: mergedOptions
12315
+ let styleElement = null;
12316
+ styleElement = /*#__PURE__*/ (0, $3Sbms$jsx)("style", {
12317
+ children: (0, (/*@__PURE__*/$parcel$interopDefault($1e2747ca72d0ab49$exports)))
12318
+ });
12319
+ rootElement.render(/*#__PURE__*/ (0, $3Sbms$jsxs)((0, $3Sbms$Fragment), {
12320
+ children: [
12321
+ styleElement,
12322
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $26ed036cbc17809a$export$2e2bcd8739ae039), {
12323
+ options: mergedOptions
12324
+ })
12325
+ ]
10985
12326
  }));
10986
12327
  if (mergedOptions.tracking) (0, $3Sbms$hotjarbrowser).init(3111933, 6);
10987
12328
  },
@@ -10999,6 +12340,8 @@ const $24075a5d702d64b3$export$3f94917203ab7078 = {
10999
12340
  });
11000
12341
  window.dispatchEvent(event);
11001
12342
  },
12343
+ startRecord: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).startRecord.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2)),
12344
+ stopRecord: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).stopRecord.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2)),
11002
12345
  sendNotification: $a5146f9062d7bf28$export$3a57e165650c636f,
11003
12346
  joinRoom: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).init.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2)),
11004
12347
  leaveRoom: (0, $c9e496369b59be7a$export$2f377c2162fd02b2).endCall.bind((0, $c9e496369b59be7a$export$2f377c2162fd02b2)),