@pipecat-ai/client-react 0.4.0 → 1.0.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.
@@ -1,9 +1,9 @@
1
1
  import {jsx as $h9lXz$jsx, Fragment as $h9lXz$Fragment} from "react/jsx-runtime";
2
- import {RTVIEvent as $h9lXz$RTVIEvent} from "@pipecat-ai/client-js";
2
+ import {RTVIEvent as $h9lXz$RTVIEvent, setAboutClient as $h9lXz$setAboutClient} from "@pipecat-ai/client-js";
3
3
  import $h9lXz$react, {useRef as $h9lXz$useRef, useEffect as $h9lXz$useEffect, useCallback as $h9lXz$useCallback, useContext as $h9lXz$useContext, createContext as $h9lXz$createContext, useState as $h9lXz$useState, forwardRef as $h9lXz$forwardRef} from "react";
4
- import {createStore as $h9lXz$createStore, atom as $h9lXz$atom, useAtomValue as $h9lXz$useAtomValue, useAtom as $h9lXz$useAtom} from "jotai";
5
- import {Provider as $h9lXz$Provider} from "jotai/react";
4
+ import {atom as $h9lXz$atom, useAtomValue as $h9lXz$useAtomValue, createStore as $h9lXz$createStore, useAtom as $h9lXz$useAtom} from "jotai";
6
5
  import {atomFamily as $h9lXz$atomFamily, useAtomCallback as $h9lXz$useAtomCallback} from "jotai/utils";
6
+ import {Provider as $h9lXz$Provider} from "jotai/react";
7
7
 
8
8
  /**
9
9
  * Copyright (c) 2024, Daily.
@@ -17,6 +17,9 @@ import {atomFamily as $h9lXz$atomFamily, useAtomCallback as $h9lXz$useAtomCallba
17
17
  *
18
18
  * SPDX-License-Identifier: BSD-2-Clause
19
19
  */
20
+
21
+
22
+
20
23
  /**
21
24
  * Copyright (c) 2024, Daily.
22
25
  *
@@ -26,81 +29,132 @@ import {atomFamily as $h9lXz$atomFamily, useAtomCallback as $h9lXz$useAtomCallba
26
29
 
27
30
 
28
31
 
29
- const $f3f7d4263dc13c6a$var$defaultStore = (0, $h9lXz$createStore)();
30
- const $f3f7d4263dc13c6a$export$8d2b07cbee622e7c = /*#__PURE__*/ (0, $h9lXz$createContext)({});
31
- const $f3f7d4263dc13c6a$export$4a4ae2d5dc96782 = ({ children: children, client: client, jotaiStore: jotaiStore = $f3f7d4263dc13c6a$var$defaultStore })=>{
32
+
33
+ var $ad20387e24e513d4$exports = {};
34
+ $ad20387e24e513d4$exports = JSON.parse("{\"name\":\"@pipecat-ai/client-react\",\"version\":\"1.0.0\",\"license\":\"BSD-2-Clause\",\"main\":\"dist/index.js\",\"module\":\"dist/index.module.js\",\"types\":\"dist/index.d.ts\",\"source\":\"src/index.ts\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/pipecat-ai/pipecat-client-web.git\"},\"files\":[\"dist\",\"package.json\",\"README.md\"],\"scripts\":{\"build\":\"parcel build --no-cache\",\"dev\":\"parcel watch\",\"lint\":\"eslint . --report-unused-disable-directives --max-warnings 0 --ignore-pattern 'dist/'\"},\"devDependencies\":{\"@pipecat-ai/client-js\":\"*\",\"@types/react\":\"^18.3.3\",\"@types/react-dom\":\"^18.3.0\",\"@typescript-eslint/eslint-plugin\":\"^8.32.0\",\"eslint\":\"^9.11.1\",\"eslint-config-prettier\":\"^9.1.0\",\"eslint-plugin-react-hooks\":\"^5.2.0\",\"eslint-plugin-simple-import-sort\":\"^12.1.1\",\"parcel\":\"^2.12.0\",\"react\":\"^18.3.1\",\"react-dom\":\"^18.3.1\",\"typescript\":\"^5.2.2\"},\"peerDependencies\":{\"@pipecat-ai/client-js\":\"*\",\"react\":\">=18\",\"react-dom\":\">=18\"},\"dependencies\":{\"jotai\":\"^2.9.0\"}}");
35
+
36
+
37
+
38
+ const $33f16f27e37c90bc$export$fe23d0ef95286467 = /*#__PURE__*/ (0, $h9lXz$createContext)({
39
+ on: ()=>{},
40
+ off: ()=>{}
41
+ });
42
+
43
+
44
+ const $d2e362c5a07ee3c5$var$defaultStore = (0, $h9lXz$createStore)();
45
+ const $d2e362c5a07ee3c5$export$67f6d73bc6cd7bb1 = /*#__PURE__*/ (0, $h9lXz$createContext)({});
46
+ const $d2e362c5a07ee3c5$export$bb43666ced7a20d0 = ({ children: children, client: client, jotaiStore: jotaiStore = $d2e362c5a07ee3c5$var$defaultStore })=>{
47
+ (0, $h9lXz$useEffect)(()=>{
48
+ (0, $h9lXz$setAboutClient)({
49
+ library: (0, $ad20387e24e513d4$exports.name),
50
+ library_version: (0, $ad20387e24e513d4$exports.version)
51
+ });
52
+ }, []);
53
+ const eventHandlersMap = (0, $h9lXz$useRef)({});
54
+ (0, $h9lXz$useEffect)(()=>{
55
+ if (!client) return;
56
+ const allEvents = Object.values((0, $h9lXz$RTVIEvent)).filter((value)=>isNaN(Number(value)));
57
+ const allHandlers = {};
58
+ allEvents.forEach((event)=>{
59
+ const handler = (...payload)=>{
60
+ const handlers = eventHandlersMap.current[event];
61
+ if (!handlers) return;
62
+ handlers.forEach((h)=>{
63
+ h(...payload);
64
+ });
65
+ };
66
+ allHandlers[event] = handler;
67
+ client.on(event, handler);
68
+ });
69
+ return ()=>{
70
+ allEvents.forEach((event)=>{
71
+ client.off(event, allHandlers[event]);
72
+ });
73
+ };
74
+ }, [
75
+ client
76
+ ]);
77
+ const on = (0, $h9lXz$useCallback)((event, handler)=>{
78
+ if (!eventHandlersMap.current[event]) eventHandlersMap.current[event] = new Set();
79
+ eventHandlersMap.current[event].add(handler);
80
+ }, []);
81
+ const off = (0, $h9lXz$useCallback)((event, handler)=>{
82
+ eventHandlersMap.current[event]?.delete(handler);
83
+ }, []);
32
84
  return (0, $h9lXz$jsx)((0, $h9lXz$Provider), {
33
85
  store: jotaiStore,
34
- children: (0, $h9lXz$jsx)($f3f7d4263dc13c6a$export$8d2b07cbee622e7c.Provider, {
86
+ children: (0, $h9lXz$jsx)($d2e362c5a07ee3c5$export$67f6d73bc6cd7bb1.Provider, {
35
87
  value: {
36
88
  client: client
37
89
  },
38
- children: children
90
+ children: (0, $h9lXz$jsx)((0, $33f16f27e37c90bc$export$fe23d0ef95286467).Provider, {
91
+ value: {
92
+ on: on,
93
+ off: off
94
+ },
95
+ children: children
96
+ })
39
97
  })
40
98
  });
41
99
  };
42
- $f3f7d4263dc13c6a$export$4a4ae2d5dc96782.displayName = "RTVIClientProvider";
100
+ $d2e362c5a07ee3c5$export$bb43666ced7a20d0.displayName = "PipecatClientProvider";
43
101
 
44
102
 
45
- const $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba = ()=>{
46
- const { client: client } = (0, $h9lXz$useContext)((0, $f3f7d4263dc13c6a$export$8d2b07cbee622e7c));
103
+ const $034a56e7ee1b7bed$export$777fa8498be78705 = ()=>{
104
+ const { client: client } = (0, $h9lXz$useContext)((0, $d2e362c5a07ee3c5$export$67f6d73bc6cd7bb1));
47
105
  return client;
48
106
  };
49
107
 
50
108
 
109
+ /**
110
+ * Copyright (c) 2024, Daily.
111
+ *
112
+ * SPDX-License-Identifier: BSD-2-Clause
113
+ */
114
+
51
115
  const $824ea64b5f757259$export$33a6ac53b8f02625 = (event, handler)=>{
52
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
116
+ const { on: on, off: off } = (0, $h9lXz$useContext)((0, $33f16f27e37c90bc$export$fe23d0ef95286467));
53
117
  (0, $h9lXz$useEffect)(()=>{
54
- if (!client) return;
55
- client.on(event, handler);
118
+ on(event, handler);
56
119
  return ()=>{
57
- client.off(event, handler);
120
+ off(event, handler);
58
121
  };
59
122
  }, [
60
123
  event,
61
124
  handler,
62
- client
125
+ on,
126
+ off
63
127
  ]);
64
128
  };
65
129
 
66
130
 
67
- /**
68
- * Copyright (c) 2024, Daily.
69
- *
70
- * SPDX-License-Identifier: BSD-2-Clause
71
- */
72
-
73
-
74
-
75
-
76
-
77
- const $194c75143b7a1fa0$var$localAudioTrackAtom = (0, $h9lXz$atom)(null);
78
- const $194c75143b7a1fa0$var$localVideoTrackAtom = (0, $h9lXz$atom)(null);
79
- const $194c75143b7a1fa0$var$localScreenAudioTrackAtom = (0, $h9lXz$atom)(null);
80
- const $194c75143b7a1fa0$var$localScreenVideoTrackAtom = (0, $h9lXz$atom)(null);
81
- const $194c75143b7a1fa0$var$botAudioTrackAtom = (0, $h9lXz$atom)(null);
82
- const $194c75143b7a1fa0$var$botVideoTrackAtom = (0, $h9lXz$atom)(null);
83
- const $194c75143b7a1fa0$var$trackAtom = (0, $h9lXz$atomFamily)(({ local: local, trackType: trackType })=>{
131
+ const $4b4b9099cdb5b776$var$localAudioTrackAtom = (0, $h9lXz$atom)(null);
132
+ const $4b4b9099cdb5b776$var$localVideoTrackAtom = (0, $h9lXz$atom)(null);
133
+ const $4b4b9099cdb5b776$var$localScreenAudioTrackAtom = (0, $h9lXz$atom)(null);
134
+ const $4b4b9099cdb5b776$var$localScreenVideoTrackAtom = (0, $h9lXz$atom)(null);
135
+ const $4b4b9099cdb5b776$var$botAudioTrackAtom = (0, $h9lXz$atom)(null);
136
+ const $4b4b9099cdb5b776$var$botVideoTrackAtom = (0, $h9lXz$atom)(null);
137
+ const $4b4b9099cdb5b776$var$trackAtom = (0, $h9lXz$atomFamily)(({ local: local, trackType: trackType })=>{
84
138
  if (local) switch(trackType){
85
139
  case "audio":
86
- return $194c75143b7a1fa0$var$localAudioTrackAtom;
140
+ return $4b4b9099cdb5b776$var$localAudioTrackAtom;
87
141
  case "screenAudio":
88
- return $194c75143b7a1fa0$var$localScreenAudioTrackAtom;
142
+ return $4b4b9099cdb5b776$var$localScreenAudioTrackAtom;
89
143
  case "screenVideo":
90
- return $194c75143b7a1fa0$var$localScreenVideoTrackAtom;
144
+ return $4b4b9099cdb5b776$var$localScreenVideoTrackAtom;
91
145
  case "video":
92
- return $194c75143b7a1fa0$var$localVideoTrackAtom;
146
+ return $4b4b9099cdb5b776$var$localVideoTrackAtom;
93
147
  }
94
- return trackType === "audio" ? $194c75143b7a1fa0$var$botAudioTrackAtom : $194c75143b7a1fa0$var$botVideoTrackAtom;
148
+ return trackType === "audio" ? $4b4b9099cdb5b776$var$botAudioTrackAtom : $4b4b9099cdb5b776$var$botVideoTrackAtom;
95
149
  });
96
- const $194c75143b7a1fa0$export$7c03381e0d26a6c3 = (trackType, participantType)=>{
97
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
98
- const track = (0, $h9lXz$useAtomValue)($194c75143b7a1fa0$var$trackAtom({
150
+ const $4b4b9099cdb5b776$export$9813dcd2d0c26814 = (trackType, participantType)=>{
151
+ const client = (0, $034a56e7ee1b7bed$export$777fa8498be78705)();
152
+ const track = (0, $h9lXz$useAtomValue)($4b4b9099cdb5b776$var$trackAtom({
99
153
  local: participantType === "local",
100
154
  trackType: trackType
101
155
  }));
102
156
  const updateTrack = (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((get, set, track, trackType, local)=>{
103
- const atom = $194c75143b7a1fa0$var$trackAtom({
157
+ const atom = $4b4b9099cdb5b776$var$trackAtom({
104
158
  local: local,
105
159
  trackType: trackType
106
160
  });
@@ -135,9 +189,10 @@ const $194c75143b7a1fa0$export$7c03381e0d26a6c3 = (trackType, participantType)=>
135
189
  };
136
190
 
137
191
 
138
- const $f8b885726fc652c0$export$ba1245f7cbf3ae02 = ()=>{
192
+
193
+ const $f209aa7ddb77dcb2$export$b52250cb73ff4de1 = ()=>{
139
194
  const botAudioRef = (0, $h9lXz$useRef)(null);
140
- const botAudioTrack = (0, $194c75143b7a1fa0$export$7c03381e0d26a6c3)("audio", "bot");
195
+ const botAudioTrack = (0, $4b4b9099cdb5b776$export$9813dcd2d0c26814)("audio", "bot");
141
196
  (0, $h9lXz$useEffect)(()=>{
142
197
  if (!botAudioRef.current || !botAudioTrack) return;
143
198
  if (botAudioRef.current.srcObject) {
@@ -162,22 +217,39 @@ const $f8b885726fc652c0$export$ba1245f7cbf3ae02 = ()=>{
162
217
  })
163
218
  });
164
219
  };
165
- $f8b885726fc652c0$export$ba1245f7cbf3ae02.displayName = "RTVIClientAudio";
220
+ $f209aa7ddb77dcb2$export$b52250cb73ff4de1.displayName = "PipecatClientAudio";
166
221
 
167
222
 
168
223
 
169
224
 
170
225
 
171
226
 
172
- const $7662c16ae3a8c331$export$46099a7ec2fe8ac5 = ()=>{
173
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
227
+ /**
228
+ * Copyright (c) 2024, Daily.
229
+ *
230
+ * SPDX-License-Identifier: BSD-2-Clause
231
+ */
232
+
233
+
234
+ const $33f3729bbe9f09df$var$transportStateAtom = (0, $h9lXz$atom)("disconnected");
235
+ const $33f3729bbe9f09df$export$30aee278309a867b = ()=>{
236
+ const [transportState, setTransportState] = (0, $h9lXz$useAtom)($33f3729bbe9f09df$var$transportStateAtom);
237
+ (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).TransportStateChanged, setTransportState);
238
+ return transportState;
239
+ };
240
+
241
+
242
+ const $e76ee2f021b54325$export$3ea2601427f0430f = ()=>{
243
+ const client = (0, $034a56e7ee1b7bed$export$777fa8498be78705)();
174
244
  const [isCamEnabled, setIsCamEnabled] = (0, $h9lXz$useState)(client?.isCamEnabled ?? false);
245
+ const transportState = (0, $33f3729bbe9f09df$export$30aee278309a867b)();
175
246
  // Sync component state with client state initially
176
247
  (0, $h9lXz$useEffect)(()=>{
177
- if (!client) return;
248
+ if (!client || transportState !== "initialized" || typeof client.isCamEnabled !== "boolean") return;
178
249
  setIsCamEnabled(client.isCamEnabled);
179
250
  }, [
180
- client
251
+ client,
252
+ transportState
181
253
  ]);
182
254
  const enableCam = (0, $h9lXz$useCallback)((enabled)=>{
183
255
  setIsCamEnabled(enabled);
@@ -192,8 +264,8 @@ const $7662c16ae3a8c331$export$46099a7ec2fe8ac5 = ()=>{
192
264
  };
193
265
 
194
266
 
195
- const $379da083c72543d5$export$156c26e16246ae3e = ({ onCamEnabledChanged: onCamEnabledChanged, disabled: disabled = false, children: children })=>{
196
- const { isCamEnabled: isCamEnabled, enableCam: enableCam } = (0, $7662c16ae3a8c331$export$46099a7ec2fe8ac5)();
267
+ const $7cb2ce2c4cbfb401$export$dc9a029eeca8213f = ({ onCamEnabledChanged: onCamEnabledChanged, disabled: disabled = false, children: children })=>{
268
+ const { isCamEnabled: isCamEnabled, enableCam: enableCam } = (0, $e76ee2f021b54325$export$3ea2601427f0430f)();
197
269
  const handleToggleCam = (0, $h9lXz$useCallback)(()=>{
198
270
  if (disabled) return;
199
271
  const newEnabledState = !isCamEnabled;
@@ -213,22 +285,25 @@ const $379da083c72543d5$export$156c26e16246ae3e = ({ onCamEnabledChanged: onCamE
213
285
  })
214
286
  });
215
287
  };
216
- var $379da083c72543d5$export$2e2bcd8739ae039 = $379da083c72543d5$export$156c26e16246ae3e;
288
+ var $7cb2ce2c4cbfb401$export$2e2bcd8739ae039 = $7cb2ce2c4cbfb401$export$dc9a029eeca8213f;
289
+
217
290
 
218
291
 
219
292
 
220
293
 
221
294
 
222
295
 
223
- const $e6f5302cf8392476$export$805915964ad7bc25 = ()=>{
224
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
296
+ const $5905c001b0dc8d25$export$388e706586309ef0 = ()=>{
297
+ const client = (0, $034a56e7ee1b7bed$export$777fa8498be78705)();
225
298
  const [isMicEnabled, setIsMicEnabled] = (0, $h9lXz$useState)(client?.isMicEnabled ?? false);
299
+ const transportState = (0, $33f3729bbe9f09df$export$30aee278309a867b)();
226
300
  // Sync component state with client state initially
227
301
  (0, $h9lXz$useEffect)(()=>{
228
- if (!client) return;
302
+ if (!client || transportState !== "initialized" || typeof client.isMicEnabled !== "boolean") return;
229
303
  setIsMicEnabled(client.isMicEnabled);
230
304
  }, [
231
- client
305
+ client,
306
+ transportState
232
307
  ]);
233
308
  const enableMic = (0, $h9lXz$useCallback)((enabled)=>{
234
309
  setIsMicEnabled(enabled);
@@ -243,8 +318,8 @@ const $e6f5302cf8392476$export$805915964ad7bc25 = ()=>{
243
318
  };
244
319
 
245
320
 
246
- const $5bebec90a95fc7e5$export$bf1c2c9ca877628d = ({ onMicEnabledChanged: onMicEnabledChanged, disabled: disabled = false, children: children })=>{
247
- const { enableMic: enableMic, isMicEnabled: isMicEnabled } = (0, $e6f5302cf8392476$export$805915964ad7bc25)();
321
+ const $2984fdfc31bad375$export$bc8133b69ff660a2 = ({ onMicEnabledChanged: onMicEnabledChanged, disabled: disabled = false, children: children })=>{
322
+ const { enableMic: enableMic, isMicEnabled: isMicEnabled } = (0, $5905c001b0dc8d25$export$388e706586309ef0)();
248
323
  const handleToggleMic = (0, $h9lXz$useCallback)(()=>{
249
324
  if (disabled) return;
250
325
  const newEnabledState = !isMicEnabled;
@@ -264,7 +339,7 @@ const $5bebec90a95fc7e5$export$bf1c2c9ca877628d = ({ onMicEnabledChanged: onMicE
264
339
  })
265
340
  });
266
341
  };
267
- var $5bebec90a95fc7e5$export$2e2bcd8739ae039 = $5bebec90a95fc7e5$export$bf1c2c9ca877628d;
342
+ var $2984fdfc31bad375$export$2e2bcd8739ae039 = $2984fdfc31bad375$export$bc8133b69ff660a2;
268
343
 
269
344
 
270
345
 
@@ -294,8 +369,8 @@ var $9098519210cf34e2$export$2e2bcd8739ae039 = $9098519210cf34e2$var$useMergedRe
294
369
 
295
370
 
296
371
 
297
- const $b76d887910983811$export$d090a384943608eb = /*#__PURE__*/ (0, $h9lXz$forwardRef)(function VoiceClientVideo({ participant: participant = "local", fit: fit = "contain", mirror: mirror, onResize: onResize, style: style = {}, trackType: trackType = "video", ...props }, ref) {
298
- const videoTrack = (0, $194c75143b7a1fa0$export$7c03381e0d26a6c3)(trackType, participant);
372
+ const $6a65deb8615a2ad7$export$85974db6d0cc43b3 = /*#__PURE__*/ (0, $h9lXz$forwardRef)(function VoiceClientVideo({ participant: participant = "local", fit: fit = "contain", mirror: mirror, onResize: onResize, style: style = {}, trackType: trackType = "video", ...props }, ref) {
373
+ const videoTrack = (0, $4b4b9099cdb5b776$export$9813dcd2d0c26814)(trackType, participant);
299
374
  const videoEl = (0, $h9lXz$useRef)(null);
300
375
  const videoRef = (0, $9098519210cf34e2$export$2e2bcd8739ae039)(videoEl, ref);
301
376
  /**
@@ -407,7 +482,7 @@ const $b76d887910983811$export$d090a384943608eb = /*#__PURE__*/ (0, $h9lXz$forwa
407
482
  ...props
408
483
  });
409
484
  });
410
- $b76d887910983811$export$d090a384943608eb.displayName = "RTVIClientVideo";
485
+ $6a65deb8615a2ad7$export$85974db6d0cc43b3.displayName = "PipecatClientVideo";
411
486
 
412
487
 
413
488
 
@@ -418,32 +493,31 @@ $b76d887910983811$export$d090a384943608eb.displayName = "RTVIClientVideo";
418
493
 
419
494
 
420
495
 
421
-
422
- const $c7d06534b21735c2$var$availableMicsAtom = (0, $h9lXz$atom)([]);
423
- const $c7d06534b21735c2$var$availableCamsAtom = (0, $h9lXz$atom)([]);
424
- const $c7d06534b21735c2$var$availableSpeakersAtom = (0, $h9lXz$atom)([]);
425
- const $c7d06534b21735c2$var$selectedMicAtom = (0, $h9lXz$atom)({});
426
- const $c7d06534b21735c2$var$selectedCamAtom = (0, $h9lXz$atom)({});
427
- const $c7d06534b21735c2$var$selectedSpeakerAtom = (0, $h9lXz$atom)({});
428
- const $c7d06534b21735c2$export$652c54907b83a48d = ()=>{
429
- const client = (0, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba)();
430
- const availableCams = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$availableCamsAtom);
431
- const availableMics = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$availableMicsAtom);
432
- const availableSpeakers = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$availableSpeakersAtom);
433
- const selectedCam = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$selectedCamAtom);
434
- const selectedMic = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$selectedMicAtom);
435
- const selectedSpeaker = (0, $h9lXz$useAtomValue)($c7d06534b21735c2$var$selectedSpeakerAtom);
496
+ const $f934f1f8b10aaf19$var$availableMicsAtom = (0, $h9lXz$atom)([]);
497
+ const $f934f1f8b10aaf19$var$availableCamsAtom = (0, $h9lXz$atom)([]);
498
+ const $f934f1f8b10aaf19$var$availableSpeakersAtom = (0, $h9lXz$atom)([]);
499
+ const $f934f1f8b10aaf19$var$selectedMicAtom = (0, $h9lXz$atom)({});
500
+ const $f934f1f8b10aaf19$var$selectedCamAtom = (0, $h9lXz$atom)({});
501
+ const $f934f1f8b10aaf19$var$selectedSpeakerAtom = (0, $h9lXz$atom)({});
502
+ const $f934f1f8b10aaf19$export$642bc4d2d2a376f1 = ()=>{
503
+ const client = (0, $034a56e7ee1b7bed$export$777fa8498be78705)();
504
+ const availableCams = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$availableCamsAtom);
505
+ const availableMics = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$availableMicsAtom);
506
+ const availableSpeakers = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$availableSpeakersAtom);
507
+ const selectedCam = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$selectedCamAtom);
508
+ const selectedMic = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$selectedMicAtom);
509
+ const selectedSpeaker = (0, $h9lXz$useAtomValue)($f934f1f8b10aaf19$var$selectedSpeakerAtom);
436
510
  const initDevices = (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)(async (_get, set)=>{
437
511
  if (!client) return;
438
512
  const availableCams = await client.getAllCams();
439
513
  const availableMics = await client.getAllMics();
440
514
  const availableSpeakers = await client.getAllSpeakers();
441
- set($c7d06534b21735c2$var$availableCamsAtom, availableCams);
442
- set($c7d06534b21735c2$var$availableMicsAtom, availableMics);
443
- set($c7d06534b21735c2$var$availableSpeakersAtom, availableSpeakers);
444
- set($c7d06534b21735c2$var$selectedCamAtom, client.selectedCam);
445
- set($c7d06534b21735c2$var$selectedMicAtom, client.selectedMic);
446
- set($c7d06534b21735c2$var$selectedSpeakerAtom, client.selectedSpeaker);
515
+ set($f934f1f8b10aaf19$var$availableCamsAtom, availableCams);
516
+ set($f934f1f8b10aaf19$var$availableMicsAtom, availableMics);
517
+ set($f934f1f8b10aaf19$var$availableSpeakersAtom, availableSpeakers);
518
+ set($f934f1f8b10aaf19$var$selectedCamAtom, client.selectedCam);
519
+ set($f934f1f8b10aaf19$var$selectedMicAtom, client.selectedMic);
520
+ set($f934f1f8b10aaf19$var$selectedSpeakerAtom, client.selectedSpeaker);
447
521
  }, [
448
522
  client
449
523
  ]));
@@ -453,22 +527,22 @@ const $c7d06534b21735c2$export$652c54907b83a48d = ()=>{
453
527
  initDevices
454
528
  ]);
455
529
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).AvailableCamsUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, cams)=>{
456
- set($c7d06534b21735c2$var$availableCamsAtom, cams);
530
+ set($f934f1f8b10aaf19$var$availableCamsAtom, cams);
457
531
  }, [])));
458
532
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).AvailableMicsUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, mics)=>{
459
- set($c7d06534b21735c2$var$availableMicsAtom, mics);
533
+ set($f934f1f8b10aaf19$var$availableMicsAtom, mics);
460
534
  }, [])));
461
535
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).AvailableSpeakersUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, speakers)=>{
462
- set($c7d06534b21735c2$var$availableSpeakersAtom, speakers);
536
+ set($f934f1f8b10aaf19$var$availableSpeakersAtom, speakers);
463
537
  }, [])));
464
538
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).CamUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, cam)=>{
465
- set($c7d06534b21735c2$var$selectedCamAtom, cam);
539
+ set($f934f1f8b10aaf19$var$selectedCamAtom, cam);
466
540
  }, [])));
467
541
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).MicUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, mic)=>{
468
- set($c7d06534b21735c2$var$selectedMicAtom, mic);
542
+ set($f934f1f8b10aaf19$var$selectedMicAtom, mic);
469
543
  }, [])));
470
544
  (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).SpeakerUpdated, (0, $h9lXz$useAtomCallback)((0, $h9lXz$useCallback)((_get, set, speaker)=>{
471
- set($c7d06534b21735c2$var$selectedSpeakerAtom, speaker);
545
+ set($f934f1f8b10aaf19$var$selectedSpeakerAtom, speaker);
472
546
  }, [])));
473
547
  const updateCam = (0, $h9lXz$useCallback)((id)=>{
474
548
  client?.updateCam(id);
@@ -501,19 +575,6 @@ const $c7d06534b21735c2$export$652c54907b83a48d = ()=>{
501
575
 
502
576
 
503
577
 
504
- /**
505
- * Copyright (c) 2024, Daily.
506
- *
507
- * SPDX-License-Identifier: BSD-2-Clause
508
- */
509
-
510
-
511
- const $8376ffbc1b1f3c97$var$transportStateAtom = (0, $h9lXz$atom)("disconnected");
512
- const $8376ffbc1b1f3c97$export$599fa01283bd4ece = ()=>{
513
- const [transportState, setTransportState] = (0, $h9lXz$useAtom)($8376ffbc1b1f3c97$var$transportStateAtom);
514
- (0, $824ea64b5f757259$export$33a6ac53b8f02625)((0, $h9lXz$RTVIEvent).TransportStateChanged, setTransportState);
515
- return transportState;
516
- };
517
578
 
518
579
 
519
580
 
@@ -521,7 +582,7 @@ const $8376ffbc1b1f3c97$export$599fa01283bd4ece = ()=>{
521
582
 
522
583
  const $993a744193844a95$export$59bf27bd43679db6 = /*#__PURE__*/ (0, $h9lXz$react).memo(({ backgroundColor: backgroundColor = "transparent", barColor: barColor = "black", barCount: barCount = 5, barGap: barGap = 12, barLineCap: barLineCap = "round", barMaxHeight: barMaxHeight = 120, barOrigin: barOrigin = "center", barWidth: barWidth = 30, participantType: participantType })=>{
523
584
  const canvasRef = (0, $h9lXz$useRef)(null);
524
- const track = (0, $194c75143b7a1fa0$export$7c03381e0d26a6c3)("audio", participantType);
585
+ const track = (0, $4b4b9099cdb5b776$export$9813dcd2d0c26814)("audio", participantType);
525
586
  (0, $h9lXz$useEffect)(()=>{
526
587
  if (!canvasRef.current) return;
527
588
  const canvasWidth = barCount * barWidth + (barCount - 1) * barGap;
@@ -698,5 +759,5 @@ $993a744193844a95$export$59bf27bd43679db6.displayName = "VoiceVisualizer";
698
759
 
699
760
 
700
761
 
701
- export {$f8b885726fc652c0$export$ba1245f7cbf3ae02 as RTVIClientAudio, $379da083c72543d5$export$156c26e16246ae3e as RTVIClientCamToggle, $5bebec90a95fc7e5$export$bf1c2c9ca877628d as RTVIClientMicToggle, $f3f7d4263dc13c6a$export$4a4ae2d5dc96782 as RTVIClientProvider, $b76d887910983811$export$d090a384943608eb as RTVIClientVideo, $54a3c9f5bdbf0854$export$31a5f6a22c9b8fba as useRTVIClient, $7662c16ae3a8c331$export$46099a7ec2fe8ac5 as useRTVIClientCamControl, $824ea64b5f757259$export$33a6ac53b8f02625 as useRTVIClientEvent, $c7d06534b21735c2$export$652c54907b83a48d as useRTVIClientMediaDevices, $194c75143b7a1fa0$export$7c03381e0d26a6c3 as useRTVIClientMediaTrack, $e6f5302cf8392476$export$805915964ad7bc25 as useRTVIClientMicControl, $8376ffbc1b1f3c97$export$599fa01283bd4ece as useRTVIClientTransportState, $993a744193844a95$export$59bf27bd43679db6 as VoiceVisualizer};
762
+ export {$f209aa7ddb77dcb2$export$b52250cb73ff4de1 as PipecatClientAudio, $7cb2ce2c4cbfb401$export$dc9a029eeca8213f as PipecatClientCamToggle, $2984fdfc31bad375$export$bc8133b69ff660a2 as PipecatClientMicToggle, $d2e362c5a07ee3c5$export$bb43666ced7a20d0 as PipecatClientProvider, $6a65deb8615a2ad7$export$85974db6d0cc43b3 as PipecatClientVideo, $034a56e7ee1b7bed$export$777fa8498be78705 as usePipecatClient, $e76ee2f021b54325$export$3ea2601427f0430f as usePipecatClientCamControl, $f934f1f8b10aaf19$export$642bc4d2d2a376f1 as usePipecatClientMediaDevices, $4b4b9099cdb5b776$export$9813dcd2d0c26814 as usePipecatClientMediaTrack, $5905c001b0dc8d25$export$388e706586309ef0 as usePipecatClientMicControl, $33f3729bbe9f09df$export$30aee278309a867b as usePipecatClientTransportState, $824ea64b5f757259$export$33a6ac53b8f02625 as useRTVIClientEvent, $993a744193844a95$export$59bf27bd43679db6 as VoiceVisualizer};
702
763
  //# sourceMappingURL=index.module.js.map