@superinterface/react 3.11.1 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -370,9 +370,15 @@ __export(src_exports, {
370
370
  ThreadDialogContext: function() {
371
371
  return ThreadDialogContext;
372
372
  },
373
+ TtsAudioRuntimeProvider: function() {
374
+ return TtsAudioRuntimeProvider;
375
+ },
373
376
  UserAvatarContext: function() {
374
377
  return UserAvatarContext;
375
378
  },
379
+ WebrtcAudioRuntimeProvider: function() {
380
+ return WebrtcAudioRuntimeProvider;
381
+ },
376
382
  useAssistant: function() {
377
383
  return useAssistant;
378
384
  },
@@ -403,9 +409,6 @@ __export(src_exports, {
403
409
  useMessages: function() {
404
410
  return useMessages;
405
411
  },
406
- useRealtimeWebRTCAudioRuntime: function() {
407
- return useRealtimeWebRTCAudioRuntime;
408
- },
409
412
  useSuperinterfaceContext: function() {
410
413
  return useSuperinterfaceContext;
411
414
  },
@@ -417,6 +420,9 @@ __export(src_exports, {
417
420
  },
418
421
  useTtsAudioRuntime: function() {
419
422
  return useTtsAudioRuntime;
423
+ },
424
+ useWebrtcAudioRuntime: function() {
425
+ return useWebrtcAudioRuntime;
420
426
  }
421
427
  });
422
428
  module.exports = __toCommonJS(src_exports);
@@ -8766,7 +8772,7 @@ ThreadDialog.Root = Root9;
8766
8772
  ThreadDialog.Trigger = Trigger;
8767
8773
  ThreadDialog.Content = Content7;
8768
8774
  // src/components/threads/AudioThread/Root/index.tsx
8769
- var import_react_compiler_runtime51 = require("react-compiler-runtime");
8775
+ var import_react_compiler_runtime52 = require("react-compiler-runtime");
8770
8776
  var import_themes58 = require("@radix-ui/themes");
8771
8777
  // src/contexts/threads/AudioThreadContext/index.ts
8772
8778
  var import_react58 = require("react");
@@ -8778,6 +8784,8 @@ var import_react59 = require("react");
8778
8784
  var useAudioThreadContext = function() {
8779
8785
  return (0, import_react59.useContext)(AudioThreadContext);
8780
8786
  };
8787
+ // src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
8788
+ var import_react_compiler_runtime51 = require("react-compiler-runtime");
8781
8789
  // src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
8782
8790
  var import_react_compiler_runtime50 = require("react-compiler-runtime");
8783
8791
  var import_react64 = require("react");
@@ -9760,8 +9768,48 @@ function _temp23() {
9760
9768
  });
9761
9769
  return _temp23.apply(this, arguments);
9762
9770
  }
9763
- // src/components/threads/AudioThread/Root/index.tsx
9771
+ // src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
9764
9772
  var import_jsx_runtime82 = require("react/jsx-runtime");
9773
+ var TtsAudioRuntimeProvider = function(t0) {
9774
+ var $ = (0, import_react_compiler_runtime51.c)(7);
9775
+ var children = t0.children, play = t0.play;
9776
+ var t1;
9777
+ if ($[0] !== play) {
9778
+ t1 = {
9779
+ play: play
9780
+ };
9781
+ $[0] = play;
9782
+ $[1] = t1;
9783
+ } else {
9784
+ t1 = $[1];
9785
+ }
9786
+ var ttsAudioRuntime = useTtsAudioRuntime(t1).ttsAudioRuntime;
9787
+ var t2;
9788
+ if ($[2] !== ttsAudioRuntime) {
9789
+ t2 = {
9790
+ audioRuntime: ttsAudioRuntime
9791
+ };
9792
+ $[2] = ttsAudioRuntime;
9793
+ $[3] = t2;
9794
+ } else {
9795
+ t2 = $[3];
9796
+ }
9797
+ var t3;
9798
+ if ($[4] !== children || $[5] !== t2) {
9799
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(AudioThreadContext.Provider, {
9800
+ value: t2,
9801
+ children: children
9802
+ });
9803
+ $[4] = children;
9804
+ $[5] = t2;
9805
+ $[6] = t3;
9806
+ } else {
9807
+ t3 = $[6];
9808
+ }
9809
+ return t3;
9810
+ };
9811
+ // src/components/threads/AudioThread/Root/index.tsx
9812
+ var import_jsx_runtime83 = require("react/jsx-runtime");
9765
9813
  var _excluded5 = [
9766
9814
  "children"
9767
9815
  ];
@@ -9834,7 +9882,7 @@ function _objectWithoutPropertiesLoose5(r, e) {
9834
9882
  }
9835
9883
  var Content8 = function(_ref) {
9836
9884
  var children = _ref.children, className = _ref.className, style = _ref.style;
9837
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_themes58.Flex, {
9885
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_themes58.Flex, {
9838
9886
  direction: "column",
9839
9887
  flexGrow: "1",
9840
9888
  p: "9",
@@ -9843,46 +9891,8 @@ var Content8 = function(_ref) {
9843
9891
  children: children
9844
9892
  });
9845
9893
  };
9846
- var TtsAudioRuntime = function(t0) {
9847
- var $ = (0, import_react_compiler_runtime51.c)(7);
9848
- var children = t0.children, play = t0.play;
9849
- var t1;
9850
- if ($[0] !== play) {
9851
- t1 = {
9852
- play: play
9853
- };
9854
- $[0] = play;
9855
- $[1] = t1;
9856
- } else {
9857
- t1 = $[1];
9858
- }
9859
- var ttsAudioRuntime = useTtsAudioRuntime(t1).ttsAudioRuntime;
9860
- var t2;
9861
- if ($[2] !== ttsAudioRuntime) {
9862
- t2 = {
9863
- audioRuntime: ttsAudioRuntime
9864
- };
9865
- $[2] = ttsAudioRuntime;
9866
- $[3] = t2;
9867
- } else {
9868
- t2 = $[3];
9869
- }
9870
- var t3;
9871
- if ($[4] !== children || $[5] !== t2) {
9872
- t3 = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(AudioThreadContext.Provider, {
9873
- value: t2,
9874
- children: children
9875
- });
9876
- $[4] = children;
9877
- $[5] = t2;
9878
- $[6] = t3;
9879
- } else {
9880
- t3 = $[6];
9881
- }
9882
- return t3;
9883
- };
9884
9894
  var AudioRuntimeProvider = function(t0) {
9885
- var $ = (0, import_react_compiler_runtime51.c)(3);
9895
+ var $ = (0, import_react_compiler_runtime52.c)(3);
9886
9896
  var children = t0.children, play = t0.play;
9887
9897
  var audioThreadContext = useAudioThreadContext();
9888
9898
  if (audioThreadContext.audioRuntime) {
@@ -9890,7 +9900,7 @@ var AudioRuntimeProvider = function(t0) {
9890
9900
  }
9891
9901
  var t1;
9892
9902
  if ($[0] !== children || $[1] !== play) {
9893
- t1 = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TtsAudioRuntime, {
9903
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TtsAudioRuntimeProvider, {
9894
9904
  play: play,
9895
9905
  children: children
9896
9906
  });
@@ -9903,7 +9913,7 @@ var AudioRuntimeProvider = function(t0) {
9903
9913
  return t1;
9904
9914
  };
9905
9915
  var Provider5 = function(t0) {
9906
- var $ = (0, import_react_compiler_runtime51.c)(9);
9916
+ var $ = (0, import_react_compiler_runtime52.c)(9);
9907
9917
  var children;
9908
9918
  var rest;
9909
9919
  if ($[0] !== t0) {
@@ -9930,7 +9940,7 @@ var Provider5 = function(t0) {
9930
9940
  }
9931
9941
  var t2;
9932
9942
  if ($[6] !== children || $[7] !== t1) {
9933
- t2 = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(AudioThreadContext.Provider, {
9943
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(AudioThreadContext.Provider, {
9934
9944
  value: t1,
9935
9945
  children: children
9936
9946
  });
@@ -9944,11 +9954,11 @@ var Provider5 = function(t0) {
9944
9954
  };
9945
9955
  var Root12 = function(_ref2) {
9946
9956
  var children = _ref2.children, play = _ref2.play, className = _ref2.className, style = _ref2.style, rest = _objectWithoutProperties5(_ref2, _excluded22);
9947
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Provider5, _objectSpread46(_objectSpread46({}, rest), {}, {
9948
- children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(AudioRuntimeProvider, {
9957
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Provider5, _objectSpread46(_objectSpread46({}, rest), {}, {
9958
+ children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(AudioRuntimeProvider, {
9949
9959
  play: play,
9950
- children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ToastsProvider, {
9951
- children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Content8, {
9960
+ children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ToastsProvider, {
9961
+ children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Content8, {
9952
9962
  className: className,
9953
9963
  style: style,
9954
9964
  children: children
@@ -9966,7 +9976,7 @@ var import_lodash8 = __toESM(require("lodash"), 1);
9966
9976
  var import_themes59 = require("@radix-ui/themes");
9967
9977
  var import_react65 = require("react");
9968
9978
  var import_radash17 = require("radash");
9969
- var import_jsx_runtime83 = require("react/jsx-runtime");
9979
+ var import_jsx_runtime84 = require("react/jsx-runtime");
9970
9980
  var barCount = 4;
9971
9981
  var BarsVisualizer = function(_ref) {
9972
9982
  var visualizationAnalyser = _ref.visualizationAnalyser, backgroundColor = _ref.backgroundColor, height = _ref.height, barWidth = _ref.barWidth;
@@ -9997,7 +10007,7 @@ var BarsVisualizer = function(_ref) {
9997
10007
  draw,
9998
10008
  visualizationAnalyser
9999
10009
  ]);
10000
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_themes59.Grid, {
10010
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes59.Grid, {
10001
10011
  columns: "".concat(barCount),
10002
10012
  gap: "1",
10003
10013
  width: "auto",
@@ -10006,12 +10016,12 @@ var BarsVisualizer = function(_ref) {
10006
10016
  gridTemplateColumns: "repeat(4, minmax(0, 1fr))"
10007
10017
  },
10008
10018
  children: barHeights.map(function(barHeight, index) {
10009
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_themes59.Flex, {
10019
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes59.Flex, {
10010
10020
  direction: "column",
10011
10021
  align: "center",
10012
10022
  justify: "center",
10013
10023
  height: height,
10014
- children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_themes59.Flex, {
10024
+ children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes59.Flex, {
10015
10025
  minHeight: "50%",
10016
10026
  maxHeight: "100%",
10017
10027
  height: "".concat(barHeight + 20, "%"),
@@ -10026,10 +10036,10 @@ var BarsVisualizer = function(_ref) {
10026
10036
  });
10027
10037
  };
10028
10038
  // src/hooks/audioThreads/useStatus/index.ts
10029
- var import_react_compiler_runtime52 = require("react-compiler-runtime");
10039
+ var import_react_compiler_runtime53 = require("react-compiler-runtime");
10030
10040
  var import_react66 = require("react");
10031
10041
  var useStatus = function() {
10032
- var $ = (0, import_react_compiler_runtime52.c)(2);
10042
+ var $ = (0, import_react_compiler_runtime53.c)(2);
10033
10043
  var audioRuntime = useAudioThreadContext().audioRuntime;
10034
10044
  var t0;
10035
10045
  bb0: {
@@ -10077,7 +10087,7 @@ var useStatus = function() {
10077
10087
  return t1;
10078
10088
  };
10079
10089
  // src/components/threads/AudioThread/Visualization/index.tsx
10080
- var import_jsx_runtime84 = require("react/jsx-runtime");
10090
+ var import_jsx_runtime85 = require("react/jsx-runtime");
10081
10091
  function ownKeys47(e, r) {
10082
10092
  var t = Object.keys(e);
10083
10093
  if (Object.getOwnPropertySymbols) {
@@ -10149,7 +10159,7 @@ var Visualization = function(props) {
10149
10159
  draw,
10150
10160
  audioThreadContext
10151
10161
  ]);
10152
- return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_themes60.Flex, _objectSpread47(_objectSpread47({
10162
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_themes60.Flex, _objectSpread47(_objectSpread47({
10153
10163
  direction: "column",
10154
10164
  align: "center",
10155
10165
  justify: "center",
@@ -10157,7 +10167,7 @@ var Visualization = function(props) {
10157
10167
  flexGrow: "1"
10158
10168
  }, props), {}, {
10159
10169
  children: [
10160
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_themes60.Flex, {
10170
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_themes60.Flex, {
10161
10171
  align: "center",
10162
10172
  justify: "center",
10163
10173
  height: "200px",
@@ -10167,20 +10177,20 @@ var Visualization = function(props) {
10167
10177
  borderRadius: "9999px",
10168
10178
  scale: scale
10169
10179
  },
10170
- children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(BarsVisualizer, {
10180
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(BarsVisualizer, {
10171
10181
  visualizationAnalyser: audioThreadContext.audioRuntime.assistant.visualizationAnalyser,
10172
10182
  backgroundColor: status === "playing" ? "var(--accent-11)" : "var(--gray-11)",
10173
10183
  height: "40px",
10174
10184
  barWidth: "24px"
10175
10185
  })
10176
10186
  }),
10177
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_themes60.Flex, {
10187
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_themes60.Flex, {
10178
10188
  ml: "-22.5px",
10179
10189
  gap: "3",
10180
10190
  pt: "5",
10181
10191
  children: [
10182
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(AssistantAvatar, {}),
10183
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Name, {
10192
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(AssistantAvatar, {}),
10193
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Name, {
10184
10194
  children: assistantNameContext
10185
10195
  })
10186
10196
  ]
@@ -10189,10 +10199,10 @@ var Visualization = function(props) {
10189
10199
  }));
10190
10200
  };
10191
10201
  // src/components/threads/AudioThread/Status/index.tsx
10192
- var import_react_compiler_runtime53 = require("react-compiler-runtime");
10202
+ var import_react_compiler_runtime54 = require("react-compiler-runtime");
10193
10203
  // src/components/threads/AudioThread/Status/StatusMessages.tsx
10194
10204
  var import_themes61 = require("@radix-ui/themes");
10195
- var import_jsx_runtime85 = require("react/jsx-runtime");
10205
+ var import_jsx_runtime86 = require("react/jsx-runtime");
10196
10206
  var html = function(_ref) {
10197
10207
  var texts = _ref.texts;
10198
10208
  return "\n .status-messages-texts:after {\n content: '".concat(texts[0], "';\n animation: texts ").concat(texts.length * 5, "s linear infinite;\n }\n\n @keyframes texts {\n ").concat(texts.map(function(_10, i) {
@@ -10201,19 +10211,19 @@ var html = function(_ref) {
10201
10211
  };
10202
10212
  var StatusMessages = function(_ref2) {
10203
10213
  var texts = _ref2.texts, className = _ref2.className, style = _ref2.style;
10204
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_themes61.Flex, {
10214
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_themes61.Flex, {
10205
10215
  justify: "center",
10206
10216
  pb: "5",
10207
10217
  className: className,
10208
10218
  style: style,
10209
10219
  children: [
10210
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_themes61.Text, {
10220
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_themes61.Text, {
10211
10221
  size: "2",
10212
10222
  weight: "regular",
10213
10223
  color: "gray",
10214
10224
  className: "status-messages-texts"
10215
10225
  }),
10216
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("style", {
10226
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("style", {
10217
10227
  dangerouslySetInnerHTML: {
10218
10228
  __html: html({
10219
10229
  texts: texts
@@ -10224,7 +10234,7 @@ var StatusMessages = function(_ref2) {
10224
10234
  });
10225
10235
  };
10226
10236
  // src/components/threads/AudioThread/Status/index.tsx
10227
- var import_jsx_runtime86 = require("react/jsx-runtime");
10237
+ var import_jsx_runtime87 = require("react/jsx-runtime");
10228
10238
  function ownKeys48(e, r) {
10229
10239
  var t = Object.keys(e);
10230
10240
  if (Object.getOwnPropertySymbols) {
@@ -10269,7 +10279,7 @@ function _toPrimitive48(t, r) {
10269
10279
  return ("string" === r ? String : Number)(t);
10270
10280
  }
10271
10281
  var Status = function(props) {
10272
- var $ = (0, import_react_compiler_runtime53.c)(12);
10282
+ var $ = (0, import_react_compiler_runtime54.c)(12);
10273
10283
  var status = useStatus().status;
10274
10284
  if (status === "recording") {
10275
10285
  var _t;
@@ -10286,7 +10296,7 @@ var Status = function(props) {
10286
10296
  }
10287
10297
  var _t2;
10288
10298
  if ($[1] !== props) {
10289
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(StatusMessages, _objectSpread48({
10299
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(StatusMessages, _objectSpread48({
10290
10300
  texts: _t
10291
10301
  }, props));
10292
10302
  $[1] = props;
@@ -10312,7 +10322,7 @@ var Status = function(props) {
10312
10322
  }
10313
10323
  var _t4;
10314
10324
  if ($[4] !== props) {
10315
- _t4 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(StatusMessages, _objectSpread48({
10325
+ _t4 = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(StatusMessages, _objectSpread48({
10316
10326
  texts: _t3
10317
10327
  }, props));
10318
10328
  $[4] = props;
@@ -10334,7 +10344,7 @@ var Status = function(props) {
10334
10344
  }
10335
10345
  var _t6;
10336
10346
  if ($[7] !== props) {
10337
- _t6 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(StatusMessages, _objectSpread48({
10347
+ _t6 = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(StatusMessages, _objectSpread48({
10338
10348
  texts: _t5
10339
10349
  }, props));
10340
10350
  $[7] = props;
@@ -10355,7 +10365,7 @@ var Status = function(props) {
10355
10365
  }
10356
10366
  var t1;
10357
10367
  if ($[10] !== props) {
10358
- t1 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(StatusMessages, _objectSpread48({
10368
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(StatusMessages, _objectSpread48({
10359
10369
  texts: t0
10360
10370
  }, props));
10361
10371
  $[10] = props;
@@ -10366,10 +10376,10 @@ var Status = function(props) {
10366
10376
  return t1;
10367
10377
  };
10368
10378
  // src/components/threads/AudioThread/Form/index.tsx
10369
- var import_react_compiler_runtime55 = require("react-compiler-runtime");
10379
+ var import_react_compiler_runtime56 = require("react-compiler-runtime");
10370
10380
  var import_themes63 = require("@radix-ui/themes");
10371
10381
  // src/components/threads/AudioThread/Form/MicIcon.tsx
10372
- var import_jsx_runtime87 = require("react/jsx-runtime");
10382
+ var import_jsx_runtime88 = require("react/jsx-runtime");
10373
10383
  function ownKeys49(e, r) {
10374
10384
  var t = Object.keys(e);
10375
10385
  if (Object.getOwnPropertySymbols) {
@@ -10414,7 +10424,7 @@ function _toPrimitive49(t, r) {
10414
10424
  return ("string" === r ? String : Number)(t);
10415
10425
  }
10416
10426
  var MicIcon = function(props) {
10417
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("svg", _objectSpread49(_objectSpread49({
10427
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("svg", _objectSpread49(_objectSpread49({
10418
10428
  xmlns: "http://www.w3.org/2000/svg",
10419
10429
  fill: "currentColor",
10420
10430
  stroke: "currentColor",
@@ -10423,36 +10433,36 @@ var MicIcon = function(props) {
10423
10433
  height: "15",
10424
10434
  width: "15"
10425
10435
  }, props), {}, {
10426
- children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("path", {
10436
+ children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("path", {
10427
10437
  stroke: "none",
10428
10438
  d: "M192 0c-53 0-96 43-96 96v160c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464h-48c-13.3 0-24 10.7-24 24s10.7 24 24 24h144c13.3 0 24-10.7 24-24s-10.7-24-24-24h-48v-33.6c85.8-11.7 152-85.3 152-174.4v-40c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128S64 326.7 64 256v-40z"
10429
10439
  })
10430
10440
  }));
10431
10441
  };
10432
10442
  // src/components/threads/AudioThread/Form/ActionButton/index.tsx
10433
- var import_react_compiler_runtime54 = require("react-compiler-runtime");
10443
+ var import_react_compiler_runtime55 = require("react-compiler-runtime");
10434
10444
  var import_themes62 = require("@radix-ui/themes");
10435
10445
  var import_react_icons17 = require("@radix-ui/react-icons");
10436
- var import_jsx_runtime88 = require("react/jsx-runtime");
10446
+ var import_jsx_runtime89 = require("react/jsx-runtime");
10437
10447
  var ActionButton = function() {
10438
- var $ = (0, import_react_compiler_runtime54.c)(27);
10448
+ var $ = (0, import_react_compiler_runtime55.c)(27);
10439
10449
  var status = useStatus().status;
10440
10450
  var audioThreadContext = useAudioThreadContext();
10441
10451
  var superinterfaceContext = useSuperinterfaceContext();
10442
10452
  if (status === "recording") {
10443
10453
  var _t;
10444
10454
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
10445
- _t = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react_icons17.PauseIcon, {});
10455
+ _t = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.PauseIcon, {});
10446
10456
  $[0] = _t;
10447
10457
  } else {
10448
10458
  _t = $[0];
10449
10459
  }
10450
10460
  var t1;
10451
10461
  if ($[1] !== audioThreadContext.audioRuntime.user.pause) {
10452
- t1 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_themes62.Flex, {
10462
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.Flex, {
10453
10463
  mr: "3",
10454
10464
  ml: "-7",
10455
- children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_themes62.IconButton, {
10465
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
10456
10466
  onClick: audioThreadContext.audioRuntime.user.pause,
10457
10467
  color: "gray",
10458
10468
  variant: "soft",
@@ -10467,14 +10477,14 @@ var ActionButton = function() {
10467
10477
  }
10468
10478
  var t2;
10469
10479
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
10470
- t2 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react_icons17.ArrowUpIcon, {});
10480
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.ArrowUpIcon, {});
10471
10481
  $[3] = t2;
10472
10482
  } else {
10473
10483
  t2 = $[3];
10474
10484
  }
10475
10485
  var t3;
10476
10486
  if ($[4] !== audioThreadContext.audioRuntime.user.stop) {
10477
- t3 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_themes62.IconButton, {
10487
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
10478
10488
  onClick: audioThreadContext.audioRuntime.user.stop,
10479
10489
  highContrast: true,
10480
10490
  variant: "soft",
@@ -10488,7 +10498,7 @@ var ActionButton = function() {
10488
10498
  }
10489
10499
  var t4;
10490
10500
  if ($[6] !== t1 || $[7] !== t3) {
10491
- t4 = /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_themes62.Flex, {
10501
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_themes62.Flex, {
10492
10502
  align: "center",
10493
10503
  children: [
10494
10504
  t1,
@@ -10506,14 +10516,14 @@ var ActionButton = function() {
10506
10516
  if (status === "recorderPaused") {
10507
10517
  var _t2;
10508
10518
  if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
10509
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react_icons17.ResumeIcon, {});
10519
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.ResumeIcon, {});
10510
10520
  $[9] = _t2;
10511
10521
  } else {
10512
10522
  _t2 = $[9];
10513
10523
  }
10514
10524
  var _t3;
10515
10525
  if ($[10] !== audioThreadContext.audioRuntime.user.resume) {
10516
- _t3 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_themes62.IconButton, {
10526
+ _t3 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
10517
10527
  onClick: audioThreadContext.audioRuntime.user.resume,
10518
10528
  color: "red",
10519
10529
  size: "4",
@@ -10529,7 +10539,7 @@ var ActionButton = function() {
10529
10539
  if (status === "idle") {
10530
10540
  var _t4;
10531
10541
  if ($[12] !== audioThreadContext.audioRuntime.user) {
10532
- _t4 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_themes62.IconButton, {
10542
+ _t4 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
10533
10543
  onClick: function() {
10534
10544
  return audioThreadContext.audioRuntime.user.start();
10535
10545
  },
@@ -10561,14 +10571,14 @@ var ActionButton = function() {
10561
10571
  }
10562
10572
  var _t6;
10563
10573
  if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
10564
- _t6 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react_icons17.StopIcon, {});
10574
+ _t6 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.StopIcon, {});
10565
10575
  $[18] = _t6;
10566
10576
  } else {
10567
10577
  _t6 = $[18];
10568
10578
  }
10569
10579
  var _t7;
10570
10580
  if ($[19] !== _t5) {
10571
- _t7 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_themes62.IconButton, {
10581
+ _t7 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
10572
10582
  onClick: _t5,
10573
10583
  size: "4",
10574
10584
  color: "gray",
@@ -10595,14 +10605,14 @@ var ActionButton = function() {
10595
10605
  }
10596
10606
  var _t9;
10597
10607
  if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
10598
- _t9 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react_icons17.ResumeIcon, {});
10608
+ _t9 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react_icons17.ResumeIcon, {});
10599
10609
  $[23] = _t9;
10600
10610
  } else {
10601
10611
  _t9 = $[23];
10602
10612
  }
10603
10613
  var _t10;
10604
10614
  if ($[24] !== _t8) {
10605
- _t10 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_themes62.IconButton, {
10615
+ _t10 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
10606
10616
  onClick: _t8,
10607
10617
  size: "4",
10608
10618
  children: _t9
@@ -10616,7 +10626,7 @@ var ActionButton = function() {
10616
10626
  }
10617
10627
  var t0;
10618
10628
  if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
10619
- t0 = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_themes62.IconButton, {
10629
+ t0 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes62.IconButton, {
10620
10630
  size: "4",
10621
10631
  variant: "soft",
10622
10632
  disabled: true
@@ -10628,7 +10638,7 @@ var ActionButton = function() {
10628
10638
  return t0;
10629
10639
  };
10630
10640
  // src/components/threads/AudioThread/Form/index.tsx
10631
- var import_jsx_runtime89 = require("react/jsx-runtime");
10641
+ var import_jsx_runtime90 = require("react/jsx-runtime");
10632
10642
  function ownKeys50(e, r) {
10633
10643
  var t = Object.keys(e);
10634
10644
  if (Object.getOwnPropertySymbols) {
@@ -10673,17 +10683,17 @@ function _toPrimitive50(t, r) {
10673
10683
  return ("string" === r ? String : Number)(t);
10674
10684
  }
10675
10685
  var Form = function(props) {
10676
- var $ = (0, import_react_compiler_runtime55.c)(17);
10686
+ var $ = (0, import_react_compiler_runtime56.c)(17);
10677
10687
  var status = useStatus().status;
10678
10688
  var audioThreadContext = useAudioThreadContext();
10679
10689
  var t0 = status === "recording" ? "var(--accent-11)" : "var(--gray-11)";
10680
10690
  var t1;
10681
10691
  if ($[0] !== t0) {
10682
- t1 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes63.Flex, {
10692
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_themes63.Flex, {
10683
10693
  ml: "-22.5px",
10684
10694
  mr: "2",
10685
10695
  align: "center",
10686
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(MicIcon, {
10696
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(MicIcon, {
10687
10697
  style: {
10688
10698
  color: t0
10689
10699
  }
@@ -10709,7 +10719,7 @@ var Form = function(props) {
10709
10719
  var t4 = status === "recording" ? "var(--accent-11)" : "var(--gray-11)";
10710
10720
  var t5;
10711
10721
  if ($[4] !== audioThreadContext.audioRuntime.user.visualizationAnalyser || $[5] !== t4) {
10712
- t5 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(BarsVisualizer, {
10722
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(BarsVisualizer, {
10713
10723
  visualizationAnalyser: audioThreadContext.audioRuntime.user.visualizationAnalyser,
10714
10724
  backgroundColor: t4,
10715
10725
  height: "20px",
@@ -10723,7 +10733,7 @@ var Form = function(props) {
10723
10733
  }
10724
10734
  var t6;
10725
10735
  if ($[7] !== t3 || $[8] !== t5) {
10726
- t6 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_themes63.Flex, {
10736
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_themes63.Flex, {
10727
10737
  px: "2",
10728
10738
  py: "1",
10729
10739
  style: t3,
@@ -10737,7 +10747,7 @@ var Form = function(props) {
10737
10747
  }
10738
10748
  var t7;
10739
10749
  if ($[10] !== t1 || $[11] !== t6) {
10740
- t7 = /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_themes63.Flex, {
10750
+ t7 = /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_themes63.Flex, {
10741
10751
  pb: "3",
10742
10752
  align: "center",
10743
10753
  children: [
@@ -10753,14 +10763,14 @@ var Form = function(props) {
10753
10763
  }
10754
10764
  var t8;
10755
10765
  if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
10756
- t8 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ActionButton, {});
10766
+ t8 = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ActionButton, {});
10757
10767
  $[13] = t8;
10758
10768
  } else {
10759
10769
  t8 = $[13];
10760
10770
  }
10761
10771
  var t9;
10762
10772
  if ($[14] !== props || $[15] !== t7) {
10763
- t9 = /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_themes63.Flex, _objectSpread50(_objectSpread50({
10773
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_themes63.Flex, _objectSpread50(_objectSpread50({
10764
10774
  direction: "column",
10765
10775
  align: "center"
10766
10776
  }, props), {}, {
@@ -10778,7 +10788,7 @@ var Form = function(props) {
10778
10788
  return t9;
10779
10789
  };
10780
10790
  // src/components/threads/AudioThread/index.tsx
10781
- var import_jsx_runtime90 = require("react/jsx-runtime");
10791
+ var import_jsx_runtime91 = require("react/jsx-runtime");
10782
10792
  function ownKeys51(e, r) {
10783
10793
  var t = Object.keys(e);
10784
10794
  if (Object.getOwnPropertySymbols) {
@@ -10823,11 +10833,11 @@ function _toPrimitive51(t, r) {
10823
10833
  return ("string" === r ? String : Number)(t);
10824
10834
  }
10825
10835
  var AudioThread = function(props) {
10826
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Root12, _objectSpread51(_objectSpread51({}, props), {}, {
10836
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Root12, _objectSpread51(_objectSpread51({}, props), {}, {
10827
10837
  children: [
10828
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Visualization, {}),
10829
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Status, {}),
10830
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Form, {})
10838
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Visualization, {}),
10839
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Status, {}),
10840
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Form, {})
10831
10841
  ]
10832
10842
  }));
10833
10843
  };
@@ -10836,7 +10846,7 @@ AudioThread.Visualization = Visualization;
10836
10846
  AudioThread.Status = Status;
10837
10847
  AudioThread.Form = Form;
10838
10848
  // src/components/threads/AudioThreadDialog/index.tsx
10839
- var import_jsx_runtime91 = require("react/jsx-runtime");
10849
+ var import_jsx_runtime92 = require("react/jsx-runtime");
10840
10850
  function ownKeys52(e, r) {
10841
10851
  var t = Object.keys(e);
10842
10852
  if (Object.getOwnPropertySymbols) {
@@ -10881,19 +10891,19 @@ function _toPrimitive52(t, r) {
10881
10891
  return ("string" === r ? String : Number)(t);
10882
10892
  }
10883
10893
  var AudioThreadDialog = function(props) {
10884
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Root9, _objectSpread52(_objectSpread52({}, props), {}, {
10894
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Root9, _objectSpread52(_objectSpread52({}, props), {}, {
10885
10895
  children: [
10886
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Content7.Root, {
10887
- children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AudioThread, {})
10896
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Content7.Root, {
10897
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(AudioThread, {})
10888
10898
  }),
10889
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Trigger, {})
10899
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Trigger, {})
10890
10900
  ]
10891
10901
  }));
10892
10902
  };
10893
10903
  AudioThreadDialog.Root = Root9;
10894
10904
  AudioThreadDialog.Trigger = Trigger;
10895
10905
  AudioThreadDialog.Content = Content7;
10896
- // src/hooks/audioRuntimes/useRealtimeWebRTCAudioRuntime/index.ts
10906
+ // src/hooks/audioRuntimes/useWebrtcAudioRuntime/index.ts
10897
10907
  var import_react68 = require("react");
10898
10908
  function asyncGeneratorStep12(n, t, e, r, o, a, c) {
10899
10909
  try {
@@ -10918,7 +10928,7 @@ function _asyncToGenerator12(n) {
10918
10928
  });
10919
10929
  };
10920
10930
  }
10921
- var useRealtimeWebRTCAudioRuntime = function() {
10931
+ var useWebrtcAudioRuntime = function() {
10922
10932
  var startSessionIfNeeded = function startSessionIfNeeded() {
10923
10933
  return _startSessionIfNeeded.apply(this, arguments);
10924
10934
  };
@@ -10995,7 +11005,7 @@ var useRealtimeWebRTCAudioRuntime = function() {
10995
11005
  }
10996
11006
  function _initRealtimeSession() {
10997
11007
  _initRealtimeSession = _asyncToGenerator12(function() {
10998
- var peerConn, audioEl, ms, offer, searchParams, sdpResponse, answerSdp, answer, err;
11008
+ var peerConn, audioEl, ms, offer, searchParams, sdpResponse, reader, decoder, answerSdp, _ref, value, done, answer, err;
10999
11009
  return _ts_generator(this, function(_state) {
11000
11010
  switch(_state.label){
11001
11011
  case 0:
@@ -11082,12 +11092,28 @@ var useRealtimeWebRTCAudioRuntime = function() {
11082
11092
  ];
11083
11093
  case 4:
11084
11094
  sdpResponse = _state.sent();
11095
+ if (!sdpResponse.ok) {
11096
+ throw new Error("Server responded with status ".concat(sdpResponse.status));
11097
+ }
11098
+ if (!sdpResponse.body) {
11099
+ throw new Error("ReadableStream not supported in this browser.");
11100
+ }
11101
+ reader = sdpResponse.body.getReader();
11102
+ decoder = new TextDecoder("utf-8");
11103
+ answerSdp = "";
11085
11104
  return [
11086
11105
  4,
11087
- sdpResponse.text()
11106
+ reader.read()
11088
11107
  ];
11089
11108
  case 5:
11090
- answerSdp = _state.sent();
11109
+ _ref = _state.sent(), value = _ref.value, done = _ref.done;
11110
+ if (done) {
11111
+ throw new Error("Stream closed before SDP was received");
11112
+ }
11113
+ answerSdp += decoder.decode(value, {
11114
+ stream: true
11115
+ });
11116
+ console.log("Received SDP Answer:", answerSdp);
11091
11117
  answer = {
11092
11118
  type: "answer",
11093
11119
  sdp: answerSdp
@@ -11132,7 +11158,7 @@ var useRealtimeWebRTCAudioRuntime = function() {
11132
11158
  }
11133
11159
  return (0, import_react68.useMemo)(function() {
11134
11160
  return {
11135
- realtimeWebRTCAudioRuntime: {
11161
+ webrtcAudioRuntime: {
11136
11162
  user: {
11137
11163
  start: function() {
11138
11164
  var _start = _asyncToGenerator12(function() {
@@ -11325,10 +11351,41 @@ var useRealtimeWebRTCAudioRuntime = function() {
11325
11351
  assistantAudioPlayed
11326
11352
  ]);
11327
11353
  };
11354
+ // src/components/audioRuntimes/WebrtcAudioRuntimeProvider.tsx
11355
+ var import_react_compiler_runtime57 = require("react-compiler-runtime");
11356
+ var import_jsx_runtime93 = require("react/jsx-runtime");
11357
+ var WebrtcAudioRuntimeProvider = function(t0) {
11358
+ var $ = (0, import_react_compiler_runtime57.c)(5);
11359
+ var children = t0.children;
11360
+ var webrtcAudioRuntime = useWebrtcAudioRuntime().webrtcAudioRuntime;
11361
+ var t1;
11362
+ if ($[0] !== webrtcAudioRuntime) {
11363
+ t1 = {
11364
+ audioRuntime: webrtcAudioRuntime
11365
+ };
11366
+ $[0] = webrtcAudioRuntime;
11367
+ $[1] = t1;
11368
+ } else {
11369
+ t1 = $[1];
11370
+ }
11371
+ var t2;
11372
+ if ($[2] !== children || $[3] !== t1) {
11373
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(AudioThreadContext.Provider, {
11374
+ value: t1,
11375
+ children: children
11376
+ });
11377
+ $[2] = children;
11378
+ $[3] = t1;
11379
+ $[4] = t2;
11380
+ } else {
11381
+ t2 = $[4];
11382
+ }
11383
+ return t2;
11384
+ };
11328
11385
  // src/components/markdown/MarkdownProvider/index.tsx
11329
- var import_react_compiler_runtime56 = require("react-compiler-runtime");
11386
+ var import_react_compiler_runtime58 = require("react-compiler-runtime");
11330
11387
  var import_react69 = require("react");
11331
- var import_jsx_runtime92 = require("react/jsx-runtime");
11388
+ var import_jsx_runtime94 = require("react/jsx-runtime");
11332
11389
  var _excluded6 = [
11333
11390
  "children"
11334
11391
  ];
@@ -11351,7 +11408,7 @@ function _objectWithoutPropertiesLoose6(r, e) {
11351
11408
  return t;
11352
11409
  }
11353
11410
  var MarkdownProvider = function(t0) {
11354
- var $ = (0, import_react_compiler_runtime56.c)(9);
11411
+ var $ = (0, import_react_compiler_runtime58.c)(9);
11355
11412
  var children;
11356
11413
  var rest;
11357
11414
  if ($[0] !== t0) {
@@ -11381,7 +11438,7 @@ var MarkdownProvider = function(t0) {
11381
11438
  var value = t1;
11382
11439
  var t3;
11383
11440
  if ($[6] !== children || $[7] !== value) {
11384
- t3 = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(MarkdownContext.Provider, {
11441
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(MarkdownContext.Provider, {
11385
11442
  value: value,
11386
11443
  children: children
11387
11444
  });
@@ -11394,18 +11451,18 @@ var MarkdownProvider = function(t0) {
11394
11451
  return t3;
11395
11452
  };
11396
11453
  // src/components/annotations/SourceAnnotation/index.tsx
11397
- var import_react_compiler_runtime59 = require("react-compiler-runtime");
11454
+ var import_react_compiler_runtime61 = require("react-compiler-runtime");
11398
11455
  // src/components/annotations/SourceAnnotation/FileCitation/index.tsx
11399
- var import_react_compiler_runtime58 = require("react-compiler-runtime");
11456
+ var import_react_compiler_runtime60 = require("react-compiler-runtime");
11400
11457
  var import_react70 = require("react");
11401
11458
  var import_react_icons18 = require("@radix-ui/react-icons");
11402
11459
  var import_themes65 = require("@radix-ui/themes");
11403
11460
  // src/components/annotations/SourceAnnotation/FileCitation/Content.tsx
11404
- var import_react_compiler_runtime57 = require("react-compiler-runtime");
11461
+ var import_react_compiler_runtime59 = require("react-compiler-runtime");
11405
11462
  var import_themes64 = require("@radix-ui/themes");
11406
- var import_jsx_runtime93 = require("react/jsx-runtime");
11463
+ var import_jsx_runtime95 = require("react/jsx-runtime");
11407
11464
  var Content9 = function(t0) {
11408
- var $ = (0, import_react_compiler_runtime57.c)(5);
11465
+ var $ = (0, import_react_compiler_runtime59.c)(5);
11409
11466
  var fileId = t0.fileId;
11410
11467
  var superinterfaceContext = useSuperinterfaceContext();
11411
11468
  var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
@@ -11442,18 +11499,18 @@ var Content9 = function(t0) {
11442
11499
  }
11443
11500
  var t5;
11444
11501
  if ($[3] !== t3) {
11445
- t5 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_themes64.Flex, {
11502
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes64.Flex, {
11446
11503
  direction: "column",
11447
11504
  flexGrow: "1",
11448
11505
  gap: "3",
11449
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_themes64.Card, {
11506
+ children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes64.Card, {
11450
11507
  style: t1,
11451
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_themes64.Inset, {
11508
+ children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes64.Inset, {
11452
11509
  clip: "padding-box",
11453
11510
  style: t2,
11454
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_themes64.Flex, {
11511
+ children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_themes64.Flex, {
11455
11512
  flexGrow: "1",
11456
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("embed", {
11513
+ children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("embed", {
11457
11514
  src: t3,
11458
11515
  style: t4
11459
11516
  })
@@ -11469,9 +11526,9 @@ var Content9 = function(t0) {
11469
11526
  return t5;
11470
11527
  };
11471
11528
  // src/components/annotations/SourceAnnotation/FileCitation/index.tsx
11472
- var import_jsx_runtime94 = require("react/jsx-runtime");
11529
+ var import_jsx_runtime96 = require("react/jsx-runtime");
11473
11530
  var FileCitation = function(t0) {
11474
- var $ = (0, import_react_compiler_runtime58.c)(18);
11531
+ var $ = (0, import_react_compiler_runtime60.c)(18);
11475
11532
  var annotation = t0.annotation;
11476
11533
  var _ref = _sliced_to_array((0, import_react70.useState)(null), 2), activeFileId = _ref[0], setActiveFileId = _ref[1];
11477
11534
  var t1;
@@ -11486,14 +11543,14 @@ var FileCitation = function(t0) {
11486
11543
  }
11487
11544
  var t2;
11488
11545
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
11489
- t2 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_icons18.QuoteIcon, {});
11546
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react_icons18.QuoteIcon, {});
11490
11547
  $[2] = t2;
11491
11548
  } else {
11492
11549
  t2 = $[2];
11493
11550
  }
11494
11551
  var t3;
11495
11552
  if ($[3] !== t1) {
11496
- t3 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes65.IconButton, {
11553
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes65.IconButton, {
11497
11554
  variant: "soft",
11498
11555
  color: "gray",
11499
11556
  size: "1",
@@ -11529,9 +11586,9 @@ var FileCitation = function(t0) {
11529
11586
  }
11530
11587
  var t7;
11531
11588
  if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
11532
- t7 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes65.VisuallyHidden, {
11589
+ t7 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes65.VisuallyHidden, {
11533
11590
  asChild: true,
11534
- children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes65.Dialog.Title, {
11591
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes65.Dialog.Title, {
11535
11592
  children: "Source"
11536
11593
  })
11537
11594
  });
@@ -11541,7 +11598,7 @@ var FileCitation = function(t0) {
11541
11598
  }
11542
11599
  var t8;
11543
11600
  if ($[8] !== activeFileId) {
11544
- t8 = activeFileId && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Content9, {
11601
+ t8 = activeFileId && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Content9, {
11545
11602
  fileId: activeFileId
11546
11603
  });
11547
11604
  $[8] = activeFileId;
@@ -11551,7 +11608,7 @@ var FileCitation = function(t0) {
11551
11608
  }
11552
11609
  var t9;
11553
11610
  if ($[10] !== t8) {
11554
- t9 = /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_themes65.Dialog.Content, {
11611
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_themes65.Dialog.Content, {
11555
11612
  width: "1000px",
11556
11613
  height: "90vh",
11557
11614
  maxWidth: "calc(100vw - 2 * var(--space-4))",
@@ -11569,7 +11626,7 @@ var FileCitation = function(t0) {
11569
11626
  }
11570
11627
  var t10;
11571
11628
  if ($[12] !== t4 || $[13] !== t9) {
11572
- t10 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_themes65.Dialog.Root, {
11629
+ t10 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes65.Dialog.Root, {
11573
11630
  open: t4,
11574
11631
  onOpenChange: t5,
11575
11632
  children: t9
@@ -11582,7 +11639,7 @@ var FileCitation = function(t0) {
11582
11639
  }
11583
11640
  var t11;
11584
11641
  if ($[15] !== t10 || $[16] !== t3) {
11585
- t11 = /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, {
11642
+ t11 = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, {
11586
11643
  children: [
11587
11644
  t3,
11588
11645
  t10
@@ -11597,7 +11654,7 @@ var FileCitation = function(t0) {
11597
11654
  return t11;
11598
11655
  };
11599
11656
  // src/components/annotations/SourceAnnotation/index.tsx
11600
- var import_jsx_runtime95 = require("react/jsx-runtime");
11657
+ var import_jsx_runtime97 = require("react/jsx-runtime");
11601
11658
  var _excluded7 = [
11602
11659
  "children"
11603
11660
  ];
@@ -11620,7 +11677,7 @@ function _objectWithoutPropertiesLoose7(r, e) {
11620
11677
  return t;
11621
11678
  }
11622
11679
  var SourceAnnotation = function(t0) {
11623
- var $ = (0, import_react_compiler_runtime59.c)(10);
11680
+ var $ = (0, import_react_compiler_runtime61.c)(10);
11624
11681
  var children;
11625
11682
  var rest;
11626
11683
  if ($[0] !== t0) {
@@ -11648,7 +11705,7 @@ var SourceAnnotation = function(t0) {
11648
11705
  if (annotation.type === "file_citation") {
11649
11706
  var t2;
11650
11707
  if ($[5] !== annotation) {
11651
- t2 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(FileCitation, {
11708
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(FileCitation, {
11652
11709
  annotation: annotation
11653
11710
  });
11654
11711
  $[5] = annotation;
@@ -11661,7 +11718,7 @@ var SourceAnnotation = function(t0) {
11661
11718
  if (annotation.type === "file_path") {
11662
11719
  var _t2;
11663
11720
  if ($[7] !== annotation || $[8] !== children) {
11664
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(FilePathAnnotation, {
11721
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(FilePathAnnotation, {
11665
11722
  annotation: annotation,
11666
11723
  children: children
11667
11724
  });
@@ -11677,7 +11734,7 @@ var SourceAnnotation = function(t0) {
11677
11734
  return null;
11678
11735
  };
11679
11736
  // src/components/avatars/Avatar.tsx
11680
- var import_react_compiler_runtime62 = require("react-compiler-runtime");
11737
+ var import_react_compiler_runtime64 = require("react-compiler-runtime");
11681
11738
  // src/lib/enums/index.ts
11682
11739
  var IconAvatarName = /* @__PURE__ */ function(IconAvatarName2) {
11683
11740
  IconAvatarName2["BACKPACK"] = "BACKPACK";
@@ -11702,7 +11759,7 @@ var AvatarType = /* @__PURE__ */ function(AvatarType2) {
11702
11759
  // src/components/avatars/Avatar.tsx
11703
11760
  var import_themes68 = require("@radix-ui/themes");
11704
11761
  // src/components/imageAvatars/ImageAvatar/index.tsx
11705
- var import_react_compiler_runtime60 = require("react-compiler-runtime");
11762
+ var import_react_compiler_runtime62 = require("react-compiler-runtime");
11706
11763
  var import_themes66 = require("@radix-ui/themes");
11707
11764
  // src/components/imageAvatars/ImageAvatar/lib/optimizedSrc/path.ts
11708
11765
  var width = function(_ref) {
@@ -11754,9 +11811,9 @@ var optimizedSrc = function(_ref) {
11754
11811
  }));
11755
11812
  };
11756
11813
  // src/components/imageAvatars/ImageAvatar/index.tsx
11757
- var import_jsx_runtime96 = require("react/jsx-runtime");
11814
+ var import_jsx_runtime98 = require("react/jsx-runtime");
11758
11815
  var ImageAvatar = function(t0) {
11759
- var $ = (0, import_react_compiler_runtime60.c)(9);
11816
+ var $ = (0, import_react_compiler_runtime62.c)(9);
11760
11817
  var imageAvatar = t0.imageAvatar, size = t0.size, className = t0.className, style = t0.style;
11761
11818
  var superinterfaceContext = useSuperinterfaceContext();
11762
11819
  var t1;
@@ -11775,7 +11832,7 @@ var ImageAvatar = function(t0) {
11775
11832
  }
11776
11833
  var t2;
11777
11834
  if ($[4] !== className || $[5] !== size || $[6] !== style || $[7] !== t1) {
11778
- t2 = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_themes66.Avatar, {
11835
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_themes66.Avatar, {
11779
11836
  className: className,
11780
11837
  style: style,
11781
11838
  fallback: "",
@@ -11793,7 +11850,7 @@ var ImageAvatar = function(t0) {
11793
11850
  return t2;
11794
11851
  };
11795
11852
  // src/components/iconAvatars/IconAvatar.tsx
11796
- var import_react_compiler_runtime61 = require("react-compiler-runtime");
11853
+ var import_react_compiler_runtime63 = require("react-compiler-runtime");
11797
11854
  var import_react71 = require("react");
11798
11855
  var import_themes67 = require("@radix-ui/themes");
11799
11856
  // src/lib/iconAvatars/iconAvatarComponents.ts
@@ -11801,16 +11858,16 @@ var import_react_icons19 = require("@radix-ui/react-icons");
11801
11858
  var _obj;
11802
11859
  var iconAvatarComponents = (_obj = {}, _define_property(_obj, IconAvatarName.BACKPACK, import_react_icons19.BackpackIcon), _define_property(_obj, IconAvatarName.ROCKET, import_react_icons19.RocketIcon), _define_property(_obj, IconAvatarName.MAGIC_WAND, import_react_icons19.MagicWandIcon), _define_property(_obj, IconAvatarName.CUBE, import_react_icons19.CubeIcon), _define_property(_obj, IconAvatarName.TARGET, import_react_icons19.TargetIcon), _define_property(_obj, IconAvatarName.DISC, import_react_icons19.DiscIcon), _define_property(_obj, IconAvatarName.GLOBE, import_react_icons19.GlobeIcon), _define_property(_obj, IconAvatarName.STAR, import_react_icons19.StarIcon), _define_property(_obj, IconAvatarName.LIGHTNING_BOLT, import_react_icons19.LightningBoltIcon), _define_property(_obj, IconAvatarName.FACE, import_react_icons19.FaceIcon), _define_property(_obj, IconAvatarName.PERSON, import_react_icons19.PersonIcon), _define_property(_obj, IconAvatarName.HEART, import_react_icons19.HeartIcon), _obj);
11803
11860
  // src/components/iconAvatars/IconAvatar.tsx
11804
- var import_jsx_runtime97 = require("react/jsx-runtime");
11861
+ var import_jsx_runtime99 = require("react/jsx-runtime");
11805
11862
  var IconAvatar = function(t0) {
11806
- var $ = (0, import_react_compiler_runtime61.c)(7);
11863
+ var $ = (0, import_react_compiler_runtime63.c)(7);
11807
11864
  var iconAvatar = t0.iconAvatar, size = t0.size, className = t0.className, style = t0.style;
11808
11865
  var t1;
11809
11866
  t1 = iconAvatarComponents[iconAvatar.name];
11810
11867
  var Component2 = t1;
11811
11868
  var t2;
11812
11869
  if ($[0] !== Component2) {
11813
- t2 = Component2 ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Component2, {}) : "";
11870
+ t2 = Component2 ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Component2, {}) : "";
11814
11871
  $[0] = Component2;
11815
11872
  $[1] = t2;
11816
11873
  } else {
@@ -11818,7 +11875,7 @@ var IconAvatar = function(t0) {
11818
11875
  }
11819
11876
  var t3;
11820
11877
  if ($[2] !== className || $[3] !== size || $[4] !== style || $[5] !== t2) {
11821
- t3 = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_themes67.Avatar, {
11878
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_themes67.Avatar, {
11822
11879
  className: className,
11823
11880
  style: style,
11824
11881
  size: size,
@@ -11835,16 +11892,16 @@ var IconAvatar = function(t0) {
11835
11892
  return t3;
11836
11893
  };
11837
11894
  // src/components/avatars/Avatar.tsx
11838
- var import_jsx_runtime98 = require("react/jsx-runtime");
11895
+ var import_jsx_runtime100 = require("react/jsx-runtime");
11839
11896
  var Avatar6 = function(t0) {
11840
- var $ = (0, import_react_compiler_runtime62.c)(14);
11897
+ var $ = (0, import_react_compiler_runtime64.c)(14);
11841
11898
  var avatar = t0.avatar, t1 = t0.size, className = t0.className, style = t0.style;
11842
11899
  var size = t1 === void 0 ? "1" : t1;
11843
11900
  if (avatar) {
11844
11901
  if (avatar.type === AvatarType.IMAGE && avatar.imageAvatar) {
11845
11902
  var _t;
11846
11903
  if ($[0] !== avatar.imageAvatar || $[1] !== className || $[2] !== size || $[3] !== style) {
11847
- _t = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ImageAvatar, {
11904
+ _t = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(ImageAvatar, {
11848
11905
  imageAvatar: avatar.imageAvatar,
11849
11906
  size: size,
11850
11907
  className: className,
@@ -11863,7 +11920,7 @@ var Avatar6 = function(t0) {
11863
11920
  if (avatar.type === AvatarType.ICON && avatar.iconAvatar) {
11864
11921
  var _t2;
11865
11922
  if ($[5] !== avatar.iconAvatar || $[6] !== className || $[7] !== size || $[8] !== style) {
11866
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(IconAvatar, {
11923
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(IconAvatar, {
11867
11924
  iconAvatar: avatar.iconAvatar,
11868
11925
  size: size,
11869
11926
  className: className,
@@ -11882,7 +11939,7 @@ var Avatar6 = function(t0) {
11882
11939
  }
11883
11940
  var t2;
11884
11941
  if ($[10] !== className || $[11] !== size || $[12] !== style) {
11885
- t2 = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_themes68.Avatar, {
11942
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_themes68.Avatar, {
11886
11943
  fallback: "",
11887
11944
  size: size,
11888
11945
  className: className,
@@ -11898,7 +11955,7 @@ var Avatar6 = function(t0) {
11898
11955
  return t2;
11899
11956
  };
11900
11957
  // src/components/components/ComponentsProvider.tsx
11901
- var import_react_compiler_runtime63 = require("react-compiler-runtime");
11958
+ var import_react_compiler_runtime65 = require("react-compiler-runtime");
11902
11959
  var import_react73 = require("react");
11903
11960
  // src/hooks/components/useComponents.ts
11904
11961
  var import_react72 = require("react");
@@ -11906,7 +11963,7 @@ var useComponents = function() {
11906
11963
  return (0, import_react72.useContext)(ComponentsContext);
11907
11964
  };
11908
11965
  // src/components/components/ComponentsProvider.tsx
11909
- var import_jsx_runtime99 = require("react/jsx-runtime");
11966
+ var import_jsx_runtime101 = require("react/jsx-runtime");
11910
11967
  var _excluded8 = [
11911
11968
  "children"
11912
11969
  ];
@@ -11929,7 +11986,7 @@ function _objectWithoutPropertiesLoose8(r, e) {
11929
11986
  return t;
11930
11987
  }
11931
11988
  var ComponentsProvider = function(t0) {
11932
- var $ = (0, import_react_compiler_runtime63.c)(9);
11989
+ var $ = (0, import_react_compiler_runtime65.c)(9);
11933
11990
  var children;
11934
11991
  var rest;
11935
11992
  if ($[0] !== t0) {
@@ -11959,7 +12016,7 @@ var ComponentsProvider = function(t0) {
11959
12016
  var value = t1;
11960
12017
  var t3;
11961
12018
  if ($[6] !== children || $[7] !== value) {
11962
- t3 = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ComponentsContext.Provider, {
12019
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ComponentsContext.Provider, {
11963
12020
  value: value,
11964
12021
  children: children
11965
12022
  });
@@ -11972,11 +12029,11 @@ var ComponentsProvider = function(t0) {
11972
12029
  return t3;
11973
12030
  };
11974
12031
  // src/components/assistants/AssistantProvider/index.tsx
11975
- var import_react_compiler_runtime64 = require("react-compiler-runtime");
11976
- var import_jsx_runtime100 = require("react/jsx-runtime");
12032
+ var import_react_compiler_runtime66 = require("react-compiler-runtime");
12033
+ var import_jsx_runtime102 = require("react/jsx-runtime");
11977
12034
  var AssistantProvider = function(t0) {
11978
12035
  var _assistant$name;
11979
- var $ = (0, import_react_compiler_runtime64.c)(10);
12036
+ var $ = (0, import_react_compiler_runtime66.c)(10);
11980
12037
  var children = t0.children;
11981
12038
  var superinterfaceContext = useSuperinterfaceContext();
11982
12039
  var t1;
@@ -11994,7 +12051,7 @@ var AssistantProvider = function(t0) {
11994
12051
  var t3 = assistant === null || assistant === void 0 ? void 0 : assistant.avatar;
11995
12052
  var t4;
11996
12053
  if ($[2] !== t3) {
11997
- t4 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Avatar6, {
12054
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Avatar6, {
11998
12055
  avatar: t3
11999
12056
  });
12000
12057
  $[2] = t3;
@@ -12004,7 +12061,7 @@ var AssistantProvider = function(t0) {
12004
12061
  }
12005
12062
  var t5;
12006
12063
  if ($[4] !== children || $[5] !== t4) {
12007
- t5 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(AssistantAvatarContext.Provider, {
12064
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(AssistantAvatarContext.Provider, {
12008
12065
  value: t4,
12009
12066
  children: children
12010
12067
  });
@@ -12016,7 +12073,7 @@ var AssistantProvider = function(t0) {
12016
12073
  }
12017
12074
  var t6;
12018
12075
  if ($[7] !== t2 || $[8] !== t5) {
12019
- t6 = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(AssistantNameContext.Provider, {
12076
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(AssistantNameContext.Provider, {
12020
12077
  value: t2,
12021
12078
  children: t5
12022
12079
  });
@@ -12048,7 +12105,9 @@ var AssistantProvider = function(t0) {
12048
12105
  Thread: Thread,
12049
12106
  ThreadDialog: ThreadDialog,
12050
12107
  ThreadDialogContext: ThreadDialogContext,
12108
+ TtsAudioRuntimeProvider: TtsAudioRuntimeProvider,
12051
12109
  UserAvatarContext: UserAvatarContext,
12110
+ WebrtcAudioRuntimeProvider: WebrtcAudioRuntimeProvider,
12052
12111
  useAssistant: useAssistant,
12053
12112
  useAudioThreadContext: useAudioThreadContext,
12054
12113
  useComponents: useComponents,
@@ -12059,10 +12118,10 @@ var AssistantProvider = function(t0) {
12059
12118
  useMessageContext: useMessageContext,
12060
12119
  useMessageFormContext: useMessageFormContext,
12061
12120
  useMessages: useMessages,
12062
- useRealtimeWebRTCAudioRuntime: useRealtimeWebRTCAudioRuntime,
12063
12121
  useSuperinterfaceContext: useSuperinterfaceContext,
12064
12122
  useThreadContext: useThreadContext,
12065
12123
  useThreadDialogContext: useThreadDialogContext,
12066
- useTtsAudioRuntime: useTtsAudioRuntime
12124
+ useTtsAudioRuntime: useTtsAudioRuntime,
12125
+ useWebrtcAudioRuntime: useWebrtcAudioRuntime
12067
12126
  });
12068
12127
  //# sourceMappingURL=index.cjs.map