@superinterface/react 5.2.3-beta.1 → 5.3.0-beta.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.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  function _array_like_to_array(arr, len) {
2
3
  if (len == null || len > arr.length) len = arr.length;
3
4
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -5596,7 +5597,7 @@ var require_lib = __commonJS({
5596
5597
  key: "parseMaybeAssign",
5597
5598
  value: function parseMaybeAssign(refExpressionErrors, afterLeftParse) {
5598
5599
  var _this = this;
5599
- var _jsx110;
5600
+ var _jsx109;
5600
5601
  var state = null;
5601
5602
  var jsx2;
5602
5603
  if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) {
@@ -5611,7 +5612,7 @@ var require_lib = __commonJS({
5611
5612
  context.pop();
5612
5613
  }
5613
5614
  }
5614
- if ((_jsx110 = jsx2) != null && _jsx110.error || this.match(47)) {
5615
+ if ((_jsx109 = jsx2) != null && _jsx109.error || this.match(47)) {
5615
5616
  var _jsx210, _jsx310;
5616
5617
  state = state || this.state.clone();
5617
5618
  var typeParameters;
@@ -13389,7 +13390,7 @@ var require_lib = __commonJS({
13389
13390
  key: "parseMaybeAssign",
13390
13391
  value: function parseMaybeAssign(refExpressionErrors, afterLeftParse) {
13391
13392
  var _this = this;
13392
- var _jsx110, _jsx210, _typeCast, _jsx310, _typeCast2;
13393
+ var _jsx109, _jsx210, _typeCast, _jsx310, _typeCast2;
13393
13394
  var state;
13394
13395
  var jsx2;
13395
13396
  var typeCast;
@@ -13405,7 +13406,7 @@ var require_lib = __commonJS({
13405
13406
  context.pop();
13406
13407
  }
13407
13408
  }
13408
- if (!((_jsx110 = jsx2) != null && _jsx110.error) && !this.match(47)) {
13409
+ if (!((_jsx109 = jsx2) != null && _jsx109.error) && !this.match(47)) {
13409
13410
  return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeAssign", this).call(this, refExpressionErrors, afterLeftParse);
13410
13411
  }
13411
13412
  if (!state || state === this.state) state = this.state.clone();
@@ -37071,7 +37072,7 @@ var SuperinterfaceProvider = function(_ref) {
37071
37072
  });
37072
37073
  };
37073
37074
  // src/components/threads/Thread/index.tsx
37074
- import { c as _c78 } from "react-compiler-runtime";
37075
+ import { c as _c77 } from "react-compiler-runtime";
37075
37076
  // src/components/threads/Thread/Messages/index.tsx
37076
37077
  import { c as _c66 } from "react-compiler-runtime";
37077
37078
  import { Flex as Flex18 } from "@radix-ui/themes";
@@ -43942,7 +43943,7 @@ Messages2.Message = Message;
43942
43943
  Messages2.NextPageSkeleton = NextPageSkeleton;
43943
43944
  Messages2.Content = Content7;
43944
43945
  // src/components/threads/Thread/MessageForm/index.tsx
43945
- import { c as _c74 } from "react-compiler-runtime";
43946
+ import { c as _c73 } from "react-compiler-runtime";
43946
43947
  // src/components/threads/Thread/MessageForm/Submit/index.tsx
43947
43948
  import { c as _c67 } from "react-compiler-runtime";
43948
43949
  import { ArrowUpIcon as ArrowUpIcon2, StopIcon } from "@radix-ui/react-icons";
@@ -44117,41 +44118,8 @@ Submit.Root = Root7;
44117
44118
  Submit.Button = Button3;
44118
44119
  // src/components/threads/Thread/MessageForm/Root/index.tsx
44119
44120
  import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
44120
- import { useMemo as useMemo14, useState as useState4, useCallback as useCallback3 } from "react";
44121
- import { useForm } from "react-hook-form";
44122
- // src/lib/reactHookForm/FormProvider.tsx
44123
- import { c as _c68 } from "react-compiler-runtime";
44124
- import { createContext as createContext12, useContext as useContext16, useMemo as useMemo13 } from "react";
44125
- import { jsx as _jsx69 } from "react/jsx-runtime";
44126
- var FormContext = /* @__PURE__ */ createContext12(null);
44127
- var useFormContext = function() {
44128
- var value = useContext16(FormContext);
44129
- if (!value) {
44130
- throw new Error("useFormContext must be used within FormProvider");
44131
- }
44132
- return value;
44133
- };
44134
- var FormProvider = function(t0) {
44135
- var $ = _c68(3);
44136
- var children = t0.children, form = t0.form;
44137
- var t1;
44138
- t1 = form;
44139
- var contextValue = t1;
44140
- var t2;
44141
- if ($[0] !== children || $[1] !== contextValue) {
44142
- t2 = /* @__PURE__ */ _jsx69(FormContext.Provider, {
44143
- value: contextValue,
44144
- children: children
44145
- });
44146
- $[0] = children;
44147
- $[1] = contextValue;
44148
- $[2] = t2;
44149
- } else {
44150
- t2 = $[2];
44151
- }
44152
- return t2;
44153
- };
44154
- // src/components/threads/Thread/MessageForm/Root/index.tsx
44121
+ import { useMemo as useMemo13, useState as useState4, useCallback as useCallback3 } from "react";
44122
+ import { useForm, FormProvider } from "react-hook-form";
44155
44123
  import { Box as Box14 } from "@radix-ui/themes";
44156
44124
  // src/components/threads/Thread/MessageForm/Root/lib/formOptions.ts
44157
44125
  import { z } from "zod";
@@ -44164,7 +44132,7 @@ var formOptions = {
44164
44132
  };
44165
44133
  // src/components/threads/Thread/MessageForm/Root/index.tsx
44166
44134
  import { partob } from "radash";
44167
- import { jsx as _jsx70 } from "react/jsx-runtime";
44135
+ import { jsx as _jsx69 } from "react/jsx-runtime";
44168
44136
  function ownKeys30(e, r) {
44169
44137
  var t = Object.keys(e);
44170
44138
  if (Object.getOwnPropertySymbols) {
@@ -44248,7 +44216,7 @@ var Root8 = function(_ref) {
44248
44216
  })
44249
44217
  }).createMessage;
44250
44218
  var isMutatingMessage = useIsMutatingMessage();
44251
- var isFileLoading = useMemo14(function() {
44219
+ var isFileLoading = useMemo13(function() {
44252
44220
  return files.some(function(file) {
44253
44221
  return isOptimistic({
44254
44222
  id: file.id
@@ -44257,14 +44225,14 @@ var Root8 = function(_ref) {
44257
44225
  }, [
44258
44226
  files
44259
44227
  ]);
44260
- var isLoading = useMemo14(function() {
44228
+ var isLoading = useMemo13(function() {
44261
44229
  return isMutatingMessage || isSubmitting;
44262
44230
  }, [
44263
44231
  isMutatingMessage,
44264
44232
  isSubmitting
44265
44233
  ]);
44266
44234
  var latestMessage = useLatestMessage().latestMessage;
44267
- var isDisabled = useMemo14(function() {
44235
+ var isDisabled = useMemo13(function() {
44268
44236
  var _latestMessage$metada;
44269
44237
  return !!(latestMessage !== null && latestMessage !== void 0 && (_latestMessage$metada = latestMessage.metadata) !== null && _latestMessage$metada !== void 0 && _latestMessage$metada.isBlocking) || !!isDisabledArg;
44270
44238
  }, [
@@ -44346,7 +44314,7 @@ var Root8 = function(_ref) {
44346
44314
  };
44347
44315
  }();
44348
44316
  var content_0 = watch("content");
44349
- return /* @__PURE__ */ _jsx70(MessageFormContext.Provider, {
44317
+ return /* @__PURE__ */ _jsx69(MessageFormContext.Provider, {
44350
44318
  value: {
44351
44319
  isDisabled: isDisabled,
44352
44320
  isLoading: isLoading,
@@ -44355,26 +44323,27 @@ var Root8 = function(_ref) {
44355
44323
  isFileLoading: isFileLoading,
44356
44324
  content: content_0
44357
44325
  },
44358
- children: /* @__PURE__ */ _jsx70(FormProvider, {
44359
- form: formProps,
44360
- children: /* @__PURE__ */ _jsx70(Box14, {
44326
+ children: /* @__PURE__ */ _jsx69(FormProvider, _objectSpread30(_objectSpread30({}, formProps), {}, {
44327
+ children: /* @__PURE__ */ _jsx69(Box14, {
44361
44328
  asChild: true,
44362
44329
  flexShrink: "0",
44363
44330
  style: style,
44364
44331
  className: className,
44365
- children: /* @__PURE__ */ _jsx70("form", {
44332
+ children: /* @__PURE__ */ _jsx69("form", {
44366
44333
  onSubmit: handleSubmit(onSubmit),
44367
44334
  children: children
44368
44335
  })
44369
44336
  })
44370
- })
44337
+ }))
44371
44338
  });
44372
44339
  };
44373
44340
  // src/components/threads/Thread/MessageForm/Field/index.tsx
44341
+ import { useFormContext as useFormContext2 } from "react-hook-form";
44374
44342
  import { Container as RadixContainer, Flex as Flex23 } from "@radix-ui/themes";
44375
44343
  // src/components/threads/Thread/MessageForm/Field/Control.tsx
44376
- import { c as _c70 } from "react-compiler-runtime";
44344
+ import { c as _c69 } from "react-compiler-runtime";
44377
44345
  import { Flex as Flex20 } from "@radix-ui/themes";
44346
+ import { useFormContext } from "react-hook-form";
44378
44347
  // src/hooks/misc/usePrevious.ts
44379
44348
  import { useEffect as useEffect5, useRef as useRef4 } from "react";
44380
44349
  var usePrevious = function(state) {
@@ -44385,12 +44354,12 @@ var usePrevious = function(state) {
44385
44354
  return ref.current;
44386
44355
  };
44387
44356
  // src/components/threads/Thread/MessageForm/Field/Control.tsx
44388
- import { useContext as useContext17, useMemo as useMemo15, useRef as useRef5, useEffect as useEffect6 } from "react";
44357
+ import { useContext as useContext16, useMemo as useMemo14, useRef as useRef5, useEffect as useEffect6 } from "react";
44389
44358
  // src/components/textareas/TextareaBase/index.tsx
44390
- import { c as _c69 } from "react-compiler-runtime";
44359
+ import { c as _c68 } from "react-compiler-runtime";
44391
44360
  import { forwardRef as forwardRef4 } from "react";
44392
44361
  import TextareaAutosize from "react-textarea-autosize";
44393
- import { jsx as _jsx71, Fragment as _Fragment5, jsxs as _jsxs22 } from "react/jsx-runtime";
44362
+ import { jsx as _jsx70, Fragment as _Fragment5, jsxs as _jsxs22 } from "react/jsx-runtime";
44394
44363
  var _excluded3 = [
44395
44364
  "style",
44396
44365
  "className"
@@ -44457,7 +44426,7 @@ function _objectWithoutPropertiesLoose3(r, e) {
44457
44426
  return t;
44458
44427
  }
44459
44428
  var TextareaBase = /* @__PURE__ */ forwardRef4(function TextareaBase2(t0, ref) {
44460
- var $ = _c69(14);
44429
+ var $ = _c68(14);
44461
44430
  var className;
44462
44431
  var rest;
44463
44432
  var style;
@@ -44478,7 +44447,7 @@ var TextareaBase = /* @__PURE__ */ forwardRef4(function TextareaBase2(t0, ref) {
44478
44447
  }
44479
44448
  var t1;
44480
44449
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
44481
- t1 = /* @__PURE__ */ _jsx71("style", {
44450
+ t1 = /* @__PURE__ */ _jsx70("style", {
44482
44451
  children: ".superinterface-textarea { min-height: inherit; height: 30px; }\n.superinterface-textarea::placeholder { color: var(--gray-a10); }"
44483
44452
  });
44484
44453
  $[4] = t1;
@@ -44515,7 +44484,7 @@ var TextareaBase = /* @__PURE__ */ forwardRef4(function TextareaBase2(t0, ref) {
44515
44484
  t5 = /* @__PURE__ */ _jsxs22(_Fragment5, {
44516
44485
  children: [
44517
44486
  t1,
44518
- /* @__PURE__ */ _jsx71(TextareaAutosize, _objectSpread31({
44487
+ /* @__PURE__ */ _jsx70(TextareaAutosize, _objectSpread31({
44519
44488
  ref: ref,
44520
44489
  className: t2,
44521
44490
  style: t4
@@ -44533,7 +44502,7 @@ var TextareaBase = /* @__PURE__ */ forwardRef4(function TextareaBase2(t0, ref) {
44533
44502
  return t5;
44534
44503
  });
44535
44504
  // src/components/threads/Thread/MessageForm/Field/Control.tsx
44536
- import { jsx as _jsx72 } from "react/jsx-runtime";
44505
+ import { jsx as _jsx71 } from "react/jsx-runtime";
44537
44506
  function ownKeys32(e, r) {
44538
44507
  var t = Object.keys(e);
44539
44508
  if (Object.getOwnPropertySymbols) {
@@ -44578,11 +44547,11 @@ function _toPrimitive32(t, r) {
44578
44547
  return ("string" === r ? String : Number)(t);
44579
44548
  }
44580
44549
  var Root9 = function(t0) {
44581
- var $ = _c70(4);
44550
+ var $ = _c69(4);
44582
44551
  var children = t0.children, style = t0.style, className = t0.className;
44583
44552
  var t1;
44584
44553
  if ($[0] !== children || $[1] !== className || $[2] !== style) {
44585
- t1 = /* @__PURE__ */ _jsx72(Flex20, {
44554
+ t1 = /* @__PURE__ */ _jsx71(Flex20, {
44586
44555
  flexGrow: "1",
44587
44556
  pt: "4px",
44588
44557
  style: style,
@@ -44601,10 +44570,10 @@ var Root9 = function(t0) {
44601
44570
  var Input = function(props) {
44602
44571
  "use no memo";
44603
44572
  var _props$placeholder;
44604
- var assistantNameContext = useContext17(AssistantNameContext);
44573
+ var assistantNameContext = useContext16(AssistantNameContext);
44605
44574
  var register = useFormContext().register;
44606
44575
  var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
44607
- var isSubmitDisabled = useMemo15(function() {
44576
+ var isSubmitDisabled = useMemo14(function() {
44608
44577
  return isDisabled || isLoading;
44609
44578
  }, [
44610
44579
  isDisabled,
@@ -44623,7 +44592,7 @@ var Input = function(props) {
44623
44592
  isDisabledPrevious,
44624
44593
  textareaProps
44625
44594
  ]);
44626
- return /* @__PURE__ */ _jsx72(TextareaBase, _objectSpread32(_objectSpread32(_objectSpread32({
44595
+ return /* @__PURE__ */ _jsx71(TextareaBase, _objectSpread32(_objectSpread32(_objectSpread32({
44627
44596
  minRows: 1,
44628
44597
  placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : "Message ".concat(assistantNameContext, "..."),
44629
44598
  disabled: isDisabled,
@@ -44643,17 +44612,17 @@ var Input = function(props) {
44643
44612
  }));
44644
44613
  };
44645
44614
  var Control = function(props) {
44646
- var $ = _c70(3);
44615
+ var $ = _c69(3);
44647
44616
  var t0;
44648
44617
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
44649
- t0 = /* @__PURE__ */ _jsx72(Input, {});
44618
+ t0 = /* @__PURE__ */ _jsx71(Input, {});
44650
44619
  $[0] = t0;
44651
44620
  } else {
44652
44621
  t0 = $[0];
44653
44622
  }
44654
44623
  var t1;
44655
44624
  if ($[1] !== props) {
44656
- t1 = /* @__PURE__ */ _jsx72(Root9, _objectSpread32(_objectSpread32({}, props), {}, {
44625
+ t1 = /* @__PURE__ */ _jsx71(Root9, _objectSpread32(_objectSpread32({}, props), {}, {
44657
44626
  children: t0
44658
44627
  }));
44659
44628
  $[1] = props;
@@ -44666,10 +44635,10 @@ var Control = function(props) {
44666
44635
  Control.Root = Root9;
44667
44636
  Control.Input = Input;
44668
44637
  // src/components/threads/Thread/MessageForm/Field/Files/Preview.tsx
44669
- import { c as _c71 } from "react-compiler-runtime";
44638
+ import { c as _c70 } from "react-compiler-runtime";
44670
44639
  import { Flex as Flex21, Card as Card2, Spinner as Spinner2, Text as Text7, IconButton as IconButton6 } from "@radix-ui/themes";
44671
44640
  import { FileIcon as FileIcon2, Cross2Icon } from "@radix-ui/react-icons";
44672
- import { jsx as _jsx73, jsxs as _jsxs23 } from "react/jsx-runtime";
44641
+ import { jsx as _jsx72, jsxs as _jsxs23 } from "react/jsx-runtime";
44673
44642
  function ownKeys33(e, r) {
44674
44643
  var t = Object.keys(e);
44675
44644
  if (Object.getOwnPropertySymbols) {
@@ -44714,7 +44683,7 @@ function _toPrimitive33(t, r) {
44714
44683
  return ("string" === r ? String : Number)(t);
44715
44684
  }
44716
44685
  var Preview = function(props) {
44717
- var $ = _c71(8);
44686
+ var $ = _c70(8);
44718
44687
  var _useMessageFormContext = useMessageFormContext(), files = _useMessageFormContext.files, setFiles = _useMessageFormContext.setFiles;
44719
44688
  if (!files.length) {
44720
44689
  return null;
@@ -44724,7 +44693,7 @@ var Preview = function(props) {
44724
44693
  var _t;
44725
44694
  if ($[3] !== setFiles) {
44726
44695
  _t = function(file) {
44727
- return /* @__PURE__ */ _jsx73(Card2, {
44696
+ return /* @__PURE__ */ _jsx72(Card2, {
44728
44697
  variant: "ghost",
44729
44698
  children: /* @__PURE__ */ _jsxs23(Flex21, {
44730
44699
  align: "center",
@@ -44738,16 +44707,16 @@ var Preview = function(props) {
44738
44707
  minWidth: "0",
44739
44708
  maxWidth: "250px",
44740
44709
  children: [
44741
- /* @__PURE__ */ _jsx73(Flex21, {
44710
+ /* @__PURE__ */ _jsx72(Flex21, {
44742
44711
  flexShrink: "0",
44743
- children: /* @__PURE__ */ _jsx73(Spinner2, {
44712
+ children: /* @__PURE__ */ _jsx72(Spinner2, {
44744
44713
  loading: isOptimistic({
44745
44714
  id: file.id
44746
44715
  }),
44747
- children: /* @__PURE__ */ _jsx73(FileIcon2, {})
44716
+ children: /* @__PURE__ */ _jsx72(FileIcon2, {})
44748
44717
  })
44749
44718
  }),
44750
- /* @__PURE__ */ _jsx73(Text7, {
44719
+ /* @__PURE__ */ _jsx72(Text7, {
44751
44720
  size: "2",
44752
44721
  truncate: true,
44753
44722
  wrap: "nowrap",
@@ -44755,9 +44724,9 @@ var Preview = function(props) {
44755
44724
  })
44756
44725
  ]
44757
44726
  }),
44758
- /* @__PURE__ */ _jsx73(Flex21, {
44727
+ /* @__PURE__ */ _jsx72(Flex21, {
44759
44728
  flexShrink: "0",
44760
- children: /* @__PURE__ */ _jsx73(IconButton6, {
44729
+ children: /* @__PURE__ */ _jsx72(IconButton6, {
44761
44730
  onClick: function() {
44762
44731
  return setFiles(function(prev) {
44763
44732
  return prev.filter(function(prevFile) {
@@ -44768,7 +44737,7 @@ var Preview = function(props) {
44768
44737
  color: "gray",
44769
44738
  variant: "ghost",
44770
44739
  size: "1",
44771
- children: /* @__PURE__ */ _jsx73(Cross2Icon, {})
44740
+ children: /* @__PURE__ */ _jsx72(Cross2Icon, {})
44772
44741
  })
44773
44742
  })
44774
44743
  ]
@@ -44789,7 +44758,7 @@ var Preview = function(props) {
44789
44758
  }
44790
44759
  var t1;
44791
44760
  if ($[5] !== props || $[6] !== t0) {
44792
- t1 = /* @__PURE__ */ _jsx73(Flex21, _objectSpread33(_objectSpread33({
44761
+ t1 = /* @__PURE__ */ _jsx72(Flex21, _objectSpread33(_objectSpread33({
44793
44762
  flexBasis: "100%",
44794
44763
  direction: "column",
44795
44764
  pb: "2",
@@ -44806,7 +44775,7 @@ var Preview = function(props) {
44806
44775
  return t1;
44807
44776
  };
44808
44777
  // src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
44809
- import { c as _c73 } from "react-compiler-runtime";
44778
+ import { c as _c72 } from "react-compiler-runtime";
44810
44779
  import { FilePlusIcon } from "@radix-ui/react-icons";
44811
44780
  import { IconButton as IconButton7, Flex as Flex22 } from "@radix-ui/themes";
44812
44781
  // src/hooks/files/useChangeFilesField/index.ts
@@ -44814,7 +44783,7 @@ import { useCallback as useCallback4 } from "react";
44814
44783
  import { omit as omit4 } from "radash";
44815
44784
  import dayjs2 from "dayjs";
44816
44785
  // src/hooks/files/useCreateFile/index.ts
44817
- import { c as _c72 } from "react-compiler-runtime";
44786
+ import { c as _c71 } from "react-compiler-runtime";
44818
44787
  import { useMutation as useMutation2, useQueryClient as useQueryClient5 } from "@tanstack/react-query";
44819
44788
  // src/hooks/files/useCreateFile/lib/mutationOptions/mutationFn/body/formData.ts
44820
44789
  var formData = function(variables) {
@@ -45050,7 +45019,7 @@ function _toPrimitive36(t, r) {
45050
45019
  return ("string" === r ? String : Number)(t);
45051
45020
  }
45052
45021
  var useCreateFile = function(t0) {
45053
- var $ = _c72(15);
45022
+ var $ = _c71(15);
45054
45023
  var t1;
45055
45024
  if ($[0] !== t0) {
45056
45025
  t1 = t0 === void 0 ? {
@@ -45379,7 +45348,7 @@ var useChangeFilesField = function() {
45379
45348
  // src/lib/files/filesFieldAccept.ts
45380
45349
  var filesFieldAccept = ".c,text/x-c,\n.cs,text/x-csharp,\n.cpp,text/x-c++,\n.doc,application/msword,\n.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document,\n.html,text/html,\n.java,text/x-java,\n.json,application/json,\n.md,text/markdown,\n.pdf,application/pdf,\n.php,text/x-php,\n.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation,\n.py,text/x-python,\n.py,text/x-script.python,\n.rb,text/x-ruby,\n.tex,text/x-tex,\n.txt,text/plain,\n.css,text/css,\n.js,text/javascript,\n.sh,application/x-sh,\n.ts,application/typescript,\n.png,image/png,\n.jpeg,image/jpeg,\n.jpg,image/jpeg,\n.webp,image/webp,\n.gif,image/gif";
45381
45350
  // src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
45382
- import { jsx as _jsx74, jsxs as _jsxs24 } from "react/jsx-runtime";
45351
+ import { jsx as _jsx73, jsxs as _jsxs24 } from "react/jsx-runtime";
45383
45352
  function ownKeys37(e, r) {
45384
45353
  var t = Object.keys(e);
45385
45354
  if (Object.getOwnPropertySymbols) {
@@ -45424,7 +45393,7 @@ function _toPrimitive37(t, r) {
45424
45393
  return ("string" === r ? String : Number)(t);
45425
45394
  }
45426
45395
  var Control2 = function(props) {
45427
- var $ = _c73(11);
45396
+ var $ = _c72(11);
45428
45397
  var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
45429
45398
  var changeFilesField = useChangeFilesField().changeFilesField;
45430
45399
  var t0 = isDisabled || isLoading;
@@ -45435,7 +45404,7 @@ var Control2 = function(props) {
45435
45404
  position: "relative",
45436
45405
  overflow: "hidden"
45437
45406
  };
45438
- t2 = /* @__PURE__ */ _jsx74(FilePlusIcon, {});
45407
+ t2 = /* @__PURE__ */ _jsx73(FilePlusIcon, {});
45439
45408
  $[0] = t1;
45440
45409
  $[1] = t2;
45441
45410
  } else {
@@ -45459,7 +45428,7 @@ var Control2 = function(props) {
45459
45428
  }
45460
45429
  var t4;
45461
45430
  if ($[3] !== changeFilesField) {
45462
- t4 = /* @__PURE__ */ _jsx74("input", {
45431
+ t4 = /* @__PURE__ */ _jsx73("input", {
45463
45432
  type: "file",
45464
45433
  multiple: true,
45465
45434
  accept: filesFieldAccept,
@@ -45492,7 +45461,7 @@ var Control2 = function(props) {
45492
45461
  }
45493
45462
  var t6;
45494
45463
  if ($[8] !== props || $[9] !== t5) {
45495
- t6 = /* @__PURE__ */ _jsx74(Flex22, _objectSpread37(_objectSpread37({
45464
+ t6 = /* @__PURE__ */ _jsx73(Flex22, _objectSpread37(_objectSpread37({
45496
45465
  pt: "2",
45497
45466
  pr: "2",
45498
45467
  flexGrow: "0"
@@ -45513,7 +45482,7 @@ var Files = {
45513
45482
  Control: Control2
45514
45483
  };
45515
45484
  // src/components/threads/Thread/MessageForm/Field/index.tsx
45516
- import { jsx as _jsx75 } from "react/jsx-runtime";
45485
+ import { jsx as _jsx74 } from "react/jsx-runtime";
45517
45486
  function ownKeys38(e, r) {
45518
45487
  var t = Object.keys(e);
45519
45488
  if (Object.getOwnPropertySymbols) {
@@ -45560,19 +45529,19 @@ function _toPrimitive38(t, r) {
45560
45529
  var Root10 = function(_ref) {
45561
45530
  "use no memo";
45562
45531
  var children = _ref.children, className = _ref.className, style = _ref.style;
45563
- var _useFormContext = useFormContext(), errors = _useFormContext.formState.errors;
45564
- return /* @__PURE__ */ _jsx75(RadixContainer, {
45532
+ var _useFormContext2 = useFormContext2(), errors = _useFormContext2.formState.errors;
45533
+ return /* @__PURE__ */ _jsx74(RadixContainer, {
45565
45534
  size: "2",
45566
45535
  flexGrow: "0",
45567
45536
  className: className,
45568
45537
  style: style,
45569
- children: /* @__PURE__ */ _jsx75(Flex23, {
45538
+ children: /* @__PURE__ */ _jsx74(Flex23, {
45570
45539
  direction: "column",
45571
45540
  flexShrink: "0",
45572
- children: /* @__PURE__ */ _jsx75(Flex23, {
45541
+ children: /* @__PURE__ */ _jsx74(Flex23, {
45573
45542
  direction: "column",
45574
45543
  flexShrink: "0",
45575
- children: /* @__PURE__ */ _jsx75(Flex23, {
45544
+ children: /* @__PURE__ */ _jsx74(Flex23, {
45576
45545
  style: _objectSpread38({
45577
45546
  borderRadius: "var(--radius-2)",
45578
45547
  borderWidth: "1px",
@@ -45596,7 +45565,7 @@ var Field = {
45596
45565
  Files: Files
45597
45566
  };
45598
45567
  // src/components/threads/Thread/MessageForm/index.tsx
45599
- import { jsx as _jsx76, jsxs as _jsxs25 } from "react/jsx-runtime";
45568
+ import { jsx as _jsx75, jsxs as _jsxs25 } from "react/jsx-runtime";
45600
45569
  function ownKeys39(e, r) {
45601
45570
  var t = Object.keys(e);
45602
45571
  if (Object.getOwnPropertySymbols) {
@@ -45641,13 +45610,13 @@ function _toPrimitive39(t, r) {
45641
45610
  return ("string" === r ? String : Number)(t);
45642
45611
  }
45643
45612
  var MessageForm = function(props) {
45644
- var $ = _c74(3);
45613
+ var $ = _c73(3);
45645
45614
  var t0;
45646
45615
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
45647
45616
  t0 = /* @__PURE__ */ _jsxs25(Field.Root, {
45648
45617
  children: [
45649
- /* @__PURE__ */ _jsx76(Field.Control, {}),
45650
- /* @__PURE__ */ _jsx76(Submit, {})
45618
+ /* @__PURE__ */ _jsx75(Field.Control, {}),
45619
+ /* @__PURE__ */ _jsx75(Submit, {})
45651
45620
  ]
45652
45621
  });
45653
45622
  $[0] = t0;
@@ -45656,7 +45625,7 @@ var MessageForm = function(props) {
45656
45625
  }
45657
45626
  var t1;
45658
45627
  if ($[1] !== props) {
45659
- t1 = /* @__PURE__ */ _jsx76(Root8, _objectSpread39(_objectSpread39({}, props), {}, {
45628
+ t1 = /* @__PURE__ */ _jsx75(Root8, _objectSpread39(_objectSpread39({}, props), {}, {
45660
45629
  children: t0
45661
45630
  }));
45662
45631
  $[1] = props;
@@ -45670,32 +45639,32 @@ MessageForm.Root = Root8;
45670
45639
  MessageForm.Field = Field;
45671
45640
  MessageForm.Submit = Submit;
45672
45641
  // src/components/threads/Thread/Root/index.tsx
45673
- import { c as _c77 } from "react-compiler-runtime";
45642
+ import { c as _c76 } from "react-compiler-runtime";
45674
45643
  import { Flex as Flex25 } from "@radix-ui/themes";
45675
45644
  // src/components/threads/Thread/Provider/index.tsx
45676
45645
  var Provider2 = SuperinterfaceProvider;
45677
45646
  // src/components/toasts/ToastsProvider/index.tsx
45678
- import { c as _c76 } from "react-compiler-runtime";
45647
+ import { c as _c75 } from "react-compiler-runtime";
45679
45648
  import { useState as useState5, useCallback as useCallback5 } from "react";
45680
45649
  import * as Toast2 from "@radix-ui/react-toast";
45681
45650
  // src/components/toasts/ToastsProvider/CustomToast.tsx
45682
- import { c as _c75 } from "react-compiler-runtime";
45651
+ import { c as _c74 } from "react-compiler-runtime";
45683
45652
  import * as Toast from "@radix-ui/react-toast";
45684
45653
  import { Card as Card3, Text as Text8, Flex as Flex24 } from "@radix-ui/themes";
45685
45654
  import { CheckCircledIcon as CheckCircledIcon2, CrossCircledIcon } from "@radix-ui/react-icons";
45686
- import { jsx as _jsx77, jsxs as _jsxs26 } from "react/jsx-runtime";
45655
+ import { jsx as _jsx76, jsxs as _jsxs26 } from "react/jsx-runtime";
45687
45656
  var CustomToast = function(t0) {
45688
- var $ = _c75(7);
45657
+ var $ = _c74(7);
45689
45658
  var toast = t0.toast;
45690
45659
  var t1;
45691
45660
  if ($[0] !== toast.type) {
45692
- t1 = /* @__PURE__ */ _jsx77(Flex24, {
45661
+ t1 = /* @__PURE__ */ _jsx76(Flex24, {
45693
45662
  pr: "2",
45694
45663
  height: "14px",
45695
45664
  align: "center",
45696
- children: toast.type === "success" ? /* @__PURE__ */ _jsx77(CheckCircledIcon2, {
45665
+ children: toast.type === "success" ? /* @__PURE__ */ _jsx76(CheckCircledIcon2, {
45697
45666
  color: "var(--accent-9)"
45698
- }) : /* @__PURE__ */ _jsx77(CrossCircledIcon, {
45667
+ }) : /* @__PURE__ */ _jsx76(CrossCircledIcon, {
45699
45668
  color: "var(--red-9)"
45700
45669
  })
45701
45670
  });
@@ -45706,7 +45675,7 @@ var CustomToast = function(t0) {
45706
45675
  }
45707
45676
  var t2;
45708
45677
  if ($[2] !== toast.message) {
45709
- t2 = /* @__PURE__ */ _jsx77(Text8, {
45678
+ t2 = /* @__PURE__ */ _jsx76(Text8, {
45710
45679
  weight: "medium",
45711
45680
  size: "1",
45712
45681
  children: toast.message
@@ -45718,9 +45687,9 @@ var CustomToast = function(t0) {
45718
45687
  }
45719
45688
  var t3;
45720
45689
  if ($[4] !== t1 || $[5] !== t2) {
45721
- t3 = /* @__PURE__ */ _jsx77(Toast.Root, {
45722
- children: /* @__PURE__ */ _jsx77(Card3, {
45723
- children: /* @__PURE__ */ _jsx77(Toast.Title, {
45690
+ t3 = /* @__PURE__ */ _jsx76(Toast.Root, {
45691
+ children: /* @__PURE__ */ _jsx76(Card3, {
45692
+ children: /* @__PURE__ */ _jsx76(Toast.Title, {
45724
45693
  children: /* @__PURE__ */ _jsxs26(Flex24, {
45725
45694
  children: [
45726
45695
  t1,
@@ -45739,9 +45708,9 @@ var CustomToast = function(t0) {
45739
45708
  return t3;
45740
45709
  };
45741
45710
  // src/components/toasts/ToastsProvider/index.tsx
45742
- import { jsx as _jsx78, jsxs as _jsxs27 } from "react/jsx-runtime";
45711
+ import { jsx as _jsx77, jsxs as _jsxs27 } from "react/jsx-runtime";
45743
45712
  var ToastsProvider = function(t0) {
45744
- var $ = _c76(15);
45713
+ var $ = _c75(15);
45745
45714
  var children = t0.children, t1 = t0.bottom;
45746
45715
  var bottom = t1 === void 0 ? 0 : t1;
45747
45716
  var t2;
@@ -45787,7 +45756,7 @@ var ToastsProvider = function(t0) {
45787
45756
  }
45788
45757
  var t6;
45789
45758
  if ($[6] !== bottom) {
45790
- t6 = /* @__PURE__ */ _jsx78(Toast2.Viewport, {
45759
+ t6 = /* @__PURE__ */ _jsx77(Toast2.Viewport, {
45791
45760
  style: {
45792
45761
  position: "absolute",
45793
45762
  bottom: bottom,
@@ -45827,7 +45796,7 @@ var ToastsProvider = function(t0) {
45827
45796
  }
45828
45797
  var t8;
45829
45798
  if ($[12] !== t4 || $[13] !== t7) {
45830
- t8 = /* @__PURE__ */ _jsx78(ToastsContext.Provider, {
45799
+ t8 = /* @__PURE__ */ _jsx77(ToastsContext.Provider, {
45831
45800
  value: t4,
45832
45801
  children: t7
45833
45802
  });
@@ -45840,12 +45809,12 @@ var ToastsProvider = function(t0) {
45840
45809
  return t8;
45841
45810
  };
45842
45811
  function _temp5(toast_0, index) {
45843
- return /* @__PURE__ */ _jsx78(CustomToast, {
45812
+ return /* @__PURE__ */ _jsx77(CustomToast, {
45844
45813
  toast: toast_0
45845
45814
  }, index);
45846
45815
  }
45847
45816
  // src/components/threads/Thread/Root/index.tsx
45848
- import { jsx as _jsx79 } from "react/jsx-runtime";
45817
+ import { jsx as _jsx78 } from "react/jsx-runtime";
45849
45818
  var _excluded4 = [
45850
45819
  "children",
45851
45820
  "style",
@@ -45913,7 +45882,7 @@ function _objectWithoutPropertiesLoose4(r, e) {
45913
45882
  return t;
45914
45883
  }
45915
45884
  var Root12 = function(t0) {
45916
- var $ = _c77(12);
45885
+ var $ = _c76(12);
45917
45886
  var children;
45918
45887
  var className;
45919
45888
  var rest;
@@ -45937,7 +45906,7 @@ var Root12 = function(t0) {
45937
45906
  }
45938
45907
  var t1;
45939
45908
  if ($[5] !== children || $[6] !== className || $[7] !== style) {
45940
- t1 = /* @__PURE__ */ _jsx79(Flex25, {
45909
+ t1 = /* @__PURE__ */ _jsx78(Flex25, {
45941
45910
  direction: "column",
45942
45911
  flexGrow: "1",
45943
45912
  className: className,
@@ -45953,9 +45922,9 @@ var Root12 = function(t0) {
45953
45922
  }
45954
45923
  var t2;
45955
45924
  if ($[9] !== rest || $[10] !== t1) {
45956
- t2 = /* @__PURE__ */ _jsx79(ToastsProvider, {
45925
+ t2 = /* @__PURE__ */ _jsx78(ToastsProvider, {
45957
45926
  bottom: "var(--space-9)",
45958
- children: /* @__PURE__ */ _jsx79(Provider2, _objectSpread40(_objectSpread40({}, rest), {}, {
45927
+ children: /* @__PURE__ */ _jsx78(Provider2, _objectSpread40(_objectSpread40({}, rest), {}, {
45959
45928
  children: t1
45960
45929
  }))
45961
45930
  });
@@ -45968,7 +45937,7 @@ var Root12 = function(t0) {
45968
45937
  return t2;
45969
45938
  };
45970
45939
  // src/components/threads/Thread/index.tsx
45971
- import { jsx as _jsx80, jsxs as _jsxs28 } from "react/jsx-runtime";
45940
+ import { jsx as _jsx79, jsxs as _jsxs28 } from "react/jsx-runtime";
45972
45941
  function ownKeys41(e, r) {
45973
45942
  var t = Object.keys(e);
45974
45943
  if (Object.getOwnPropertySymbols) {
@@ -46013,12 +45982,12 @@ function _toPrimitive41(t, r) {
46013
45982
  return ("string" === r ? String : Number)(t);
46014
45983
  }
46015
45984
  var Thread = function(props) {
46016
- var $ = _c78(4);
45985
+ var $ = _c77(4);
46017
45986
  var t0;
46018
45987
  var t1;
46019
45988
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46020
- t0 = /* @__PURE__ */ _jsx80(Messages2, {});
46021
- t1 = /* @__PURE__ */ _jsx80(MessageForm, {});
45989
+ t0 = /* @__PURE__ */ _jsx79(Messages2, {});
45990
+ t1 = /* @__PURE__ */ _jsx79(MessageForm, {});
46022
45991
  $[0] = t0;
46023
45992
  $[1] = t1;
46024
45993
  } else {
@@ -46044,13 +46013,13 @@ Thread.Root = Root12;
46044
46013
  Thread.Messages = Messages2;
46045
46014
  Thread.MessageForm = MessageForm;
46046
46015
  // src/hooks/messages/useMessageContext/index.ts
46047
- import { useContext as useContext18 } from "react";
46016
+ import { useContext as useContext17 } from "react";
46048
46017
  var useMessageContext = function() {
46049
- return useContext18(MessageContext);
46018
+ return useContext17(MessageContext);
46050
46019
  };
46051
46020
  // src/hooks/assistants/useAssistant/index.ts
46052
- import { c as _c79 } from "react-compiler-runtime";
46053
- import { useMemo as useMemo16 } from "react";
46021
+ import { c as _c78 } from "react-compiler-runtime";
46022
+ import { useMemo as useMemo15 } from "react";
46054
46023
  import { useQuery } from "@tanstack/react-query";
46055
46024
  // src/hooks/assistants/useAssistant/lib/queryOptions/index.ts
46056
46025
  import { queryOptions as tanstackQueryOptions } from "@tanstack/react-query";
@@ -46199,7 +46168,7 @@ function _toPrimitive42(t, r) {
46199
46168
  return ("string" === r ? String : Number)(t);
46200
46169
  }
46201
46170
  var useAssistant = function(t0) {
46202
- var $ = _c79(6);
46171
+ var $ = _c78(6);
46203
46172
  var assistantId = t0.assistantId;
46204
46173
  var superinterfaceContext = useSuperinterfaceContext();
46205
46174
  var t1;
@@ -46232,27 +46201,27 @@ var useAssistant = function(t0) {
46232
46201
  return t2;
46233
46202
  };
46234
46203
  // src/components/threads/ThreadDialog/index.tsx
46235
- import { c as _c86 } from "react-compiler-runtime";
46204
+ import { c as _c85 } from "react-compiler-runtime";
46236
46205
  // src/components/threads/ThreadDialog/Root/index.tsx
46237
- import { c as _c81 } from "react-compiler-runtime";
46238
- // src/components/threads/ThreadDialog/Provider/index.tsx
46239
46206
  import { c as _c80 } from "react-compiler-runtime";
46207
+ // src/components/threads/ThreadDialog/Provider/index.tsx
46208
+ import { c as _c79 } from "react-compiler-runtime";
46240
46209
  import { useState as useState6 } from "react";
46241
46210
  // src/contexts/threads/ThreadDialogContext/index.ts
46242
- import { createContext as createContext13 } from "react";
46243
- var ThreadDialogContext = /* @__PURE__ */ createContext13({
46211
+ import { createContext as createContext12 } from "react";
46212
+ var ThreadDialogContext = /* @__PURE__ */ createContext12({
46244
46213
  isOpen: false,
46245
46214
  setIsOpen: function() {}
46246
46215
  });
46247
46216
  // src/hooks/threads/useThreadDialogContext/index.ts
46248
- import { useContext as useContext19 } from "react";
46217
+ import { useContext as useContext18 } from "react";
46249
46218
  var useThreadDialogContext = function() {
46250
- return useContext19(ThreadDialogContext);
46219
+ return useContext18(ThreadDialogContext);
46251
46220
  };
46252
46221
  // src/components/threads/ThreadDialog/Provider/index.tsx
46253
- import { jsx as _jsx81 } from "react/jsx-runtime";
46222
+ import { jsx as _jsx80 } from "react/jsx-runtime";
46254
46223
  var Provider4 = function(t0) {
46255
- var $ = _c80(5);
46224
+ var $ = _c79(5);
46256
46225
  var children = t0.children;
46257
46226
  var threadDialogContext = useThreadDialogContext();
46258
46227
  var _useState6 = _sliced_to_array(useState6(threadDialogContext.isOpen), 2), isOpen = _useState6[0], setIsOpen = _useState6[1];
@@ -46269,7 +46238,7 @@ var Provider4 = function(t0) {
46269
46238
  }
46270
46239
  var t2;
46271
46240
  if ($[2] !== children || $[3] !== t1) {
46272
- t2 = /* @__PURE__ */ _jsx81(ThreadDialogContext.Provider, {
46241
+ t2 = /* @__PURE__ */ _jsx80(ThreadDialogContext.Provider, {
46273
46242
  value: t1,
46274
46243
  children: children
46275
46244
  });
@@ -46282,13 +46251,13 @@ var Provider4 = function(t0) {
46282
46251
  return t2;
46283
46252
  };
46284
46253
  // src/components/threads/ThreadDialog/Root/index.tsx
46285
- import { jsx as _jsx82 } from "react/jsx-runtime";
46254
+ import { jsx as _jsx81 } from "react/jsx-runtime";
46286
46255
  var Root13 = function(t0) {
46287
- var $ = _c81(2);
46256
+ var $ = _c80(2);
46288
46257
  var children = t0.children;
46289
46258
  var t1;
46290
46259
  if ($[0] !== children) {
46291
- t1 = /* @__PURE__ */ _jsx82(Provider4, {
46260
+ t1 = /* @__PURE__ */ _jsx81(Provider4, {
46292
46261
  children: children
46293
46262
  });
46294
46263
  $[0] = children;
@@ -46299,13 +46268,13 @@ var Root13 = function(t0) {
46299
46268
  return t1;
46300
46269
  };
46301
46270
  // src/components/threads/ThreadDialog/Trigger/index.tsx
46302
- import { c as _c83 } from "react-compiler-runtime";
46271
+ import { c as _c82 } from "react-compiler-runtime";
46303
46272
  import { Flex as Flex26 } from "@radix-ui/themes";
46304
46273
  // src/components/threads/ThreadDialog/Trigger/Button.tsx
46305
- import { c as _c82 } from "react-compiler-runtime";
46274
+ import { c as _c81 } from "react-compiler-runtime";
46306
46275
  import { IconButton as IconButton8 } from "@radix-ui/themes";
46307
46276
  import { ChatBubbleIcon } from "@radix-ui/react-icons";
46308
- import { jsx as _jsx83 } from "react/jsx-runtime";
46277
+ import { jsx as _jsx82 } from "react/jsx-runtime";
46309
46278
  function ownKeys43(e, r) {
46310
46279
  var t = Object.keys(e);
46311
46280
  if (Object.getOwnPropertySymbols) {
@@ -46350,17 +46319,17 @@ function _toPrimitive43(t, r) {
46350
46319
  return ("string" === r ? String : Number)(t);
46351
46320
  }
46352
46321
  var Button4 = function(props) {
46353
- var $ = _c82(3);
46322
+ var $ = _c81(3);
46354
46323
  var t0;
46355
46324
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46356
- t0 = /* @__PURE__ */ _jsx83(ChatBubbleIcon, {});
46325
+ t0 = /* @__PURE__ */ _jsx82(ChatBubbleIcon, {});
46357
46326
  $[0] = t0;
46358
46327
  } else {
46359
46328
  t0 = $[0];
46360
46329
  }
46361
46330
  var t1;
46362
46331
  if ($[1] !== props) {
46363
- t1 = /* @__PURE__ */ _jsx83(IconButton8, _objectSpread43(_objectSpread43({
46332
+ t1 = /* @__PURE__ */ _jsx82(IconButton8, _objectSpread43(_objectSpread43({
46364
46333
  size: "4",
46365
46334
  radius: "full"
46366
46335
  }, props), {}, {
@@ -46374,7 +46343,7 @@ var Button4 = function(props) {
46374
46343
  return t1;
46375
46344
  };
46376
46345
  // src/components/threads/ThreadDialog/Trigger/index.tsx
46377
- import { jsx as _jsx84 } from "react/jsx-runtime";
46346
+ import { jsx as _jsx83 } from "react/jsx-runtime";
46378
46347
  function ownKeys44(e, r) {
46379
46348
  var t = Object.keys(e);
46380
46349
  if (Object.getOwnPropertySymbols) {
@@ -46419,7 +46388,7 @@ function _toPrimitive44(t, r) {
46419
46388
  return ("string" === r ? String : Number)(t);
46420
46389
  }
46421
46390
  var Root14 = function(t0) {
46422
- var $ = _c83(14);
46391
+ var $ = _c82(14);
46423
46392
  var children = t0.children, style = t0.style, className = t0.className;
46424
46393
  var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
46425
46394
  var t1 = isOpen ? "none" : "flex";
@@ -46464,7 +46433,7 @@ var Root14 = function(t0) {
46464
46433
  }
46465
46434
  var t6;
46466
46435
  if ($[8] !== children || $[9] !== className || $[10] !== t2 || $[11] !== t3 || $[12] !== t5) {
46467
- t6 = /* @__PURE__ */ _jsx84(Flex26, {
46436
+ t6 = /* @__PURE__ */ _jsx83(Flex26, {
46468
46437
  display: t2,
46469
46438
  onClick: t3,
46470
46439
  direction: "column",
@@ -46490,17 +46459,17 @@ var Root14 = function(t0) {
46490
46459
  return t6;
46491
46460
  };
46492
46461
  var Trigger = function(args) {
46493
- var $ = _c83(3);
46462
+ var $ = _c82(3);
46494
46463
  var t0;
46495
46464
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46496
- t0 = /* @__PURE__ */ _jsx84(Button4, {});
46465
+ t0 = /* @__PURE__ */ _jsx83(Button4, {});
46497
46466
  $[0] = t0;
46498
46467
  } else {
46499
46468
  t0 = $[0];
46500
46469
  }
46501
46470
  var t1;
46502
46471
  if ($[1] !== args) {
46503
- t1 = /* @__PURE__ */ _jsx84(Root14, _objectSpread44(_objectSpread44({}, args), {}, {
46472
+ t1 = /* @__PURE__ */ _jsx83(Root14, _objectSpread44(_objectSpread44({}, args), {}, {
46504
46473
  children: t0
46505
46474
  }));
46506
46475
  $[1] = args;
@@ -46516,15 +46485,15 @@ function _temp6(prev) {
46516
46485
  return !prev;
46517
46486
  }
46518
46487
  // src/components/threads/ThreadDialog/Content/index.tsx
46519
- import { c as _c85 } from "react-compiler-runtime";
46488
+ import { c as _c84 } from "react-compiler-runtime";
46520
46489
  import { Card as Card4, Inset as Inset2, Flex as Flex28 } from "@radix-ui/themes";
46521
46490
  // src/components/threads/ThreadDialog/Close/index.tsx
46522
- import { c as _c84 } from "react-compiler-runtime";
46491
+ import { c as _c83 } from "react-compiler-runtime";
46523
46492
  import { Cross1Icon } from "@radix-ui/react-icons";
46524
46493
  import { IconButton as IconButton9, Flex as Flex27 } from "@radix-ui/themes";
46525
- import { jsx as _jsx85 } from "react/jsx-runtime";
46494
+ import { jsx as _jsx84 } from "react/jsx-runtime";
46526
46495
  var Close = function() {
46527
- var $ = _c84(9);
46496
+ var $ = _c83(9);
46528
46497
  var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
46529
46498
  var t0 = isOpen ? "flex" : "none";
46530
46499
  var t1;
@@ -46559,10 +46528,10 @@ var Close = function() {
46559
46528
  }
46560
46529
  var t4;
46561
46530
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
46562
- t4 = /* @__PURE__ */ _jsx85(IconButton9, {
46531
+ t4 = /* @__PURE__ */ _jsx84(IconButton9, {
46563
46532
  size: "2",
46564
46533
  variant: "soft",
46565
- children: /* @__PURE__ */ _jsx85(Cross1Icon, {})
46534
+ children: /* @__PURE__ */ _jsx84(Cross1Icon, {})
46566
46535
  });
46567
46536
  $[5] = t4;
46568
46537
  } else {
@@ -46570,7 +46539,7 @@ var Close = function() {
46570
46539
  }
46571
46540
  var t5;
46572
46541
  if ($[6] !== t1 || $[7] !== t2) {
46573
- t5 = /* @__PURE__ */ _jsx85(Flex27, {
46542
+ t5 = /* @__PURE__ */ _jsx84(Flex27, {
46574
46543
  display: t1,
46575
46544
  onClick: t2,
46576
46545
  direction: "column",
@@ -46595,7 +46564,7 @@ function _temp7(prev) {
46595
46564
  return !prev;
46596
46565
  }
46597
46566
  // src/components/threads/ThreadDialog/Content/index.tsx
46598
- import { jsx as _jsx86, jsxs as _jsxs29 } from "react/jsx-runtime";
46567
+ import { jsx as _jsx85, jsxs as _jsxs29 } from "react/jsx-runtime";
46599
46568
  function ownKeys45(e, r) {
46600
46569
  var t = Object.keys(e);
46601
46570
  if (Object.getOwnPropertySymbols) {
@@ -46640,7 +46609,7 @@ function _toPrimitive45(t, r) {
46640
46609
  return ("string" === r ? String : Number)(t);
46641
46610
  }
46642
46611
  var Root15 = function(t0) {
46643
- var $ = _c85(19);
46612
+ var $ = _c84(19);
46644
46613
  var children = t0.children, className = t0.className, style = t0.style;
46645
46614
  var isOpen = useThreadDialogContext().isOpen;
46646
46615
  if (!isOpen) {
@@ -46727,7 +46696,7 @@ var Root15 = function(t0) {
46727
46696
  }
46728
46697
  var t10;
46729
46698
  if ($[10] !== children) {
46730
- t10 = /* @__PURE__ */ _jsx86(Inset2, {
46699
+ t10 = /* @__PURE__ */ _jsx85(Inset2, {
46731
46700
  clip: "padding-box",
46732
46701
  side: "all",
46733
46702
  pb: "current",
@@ -46741,7 +46710,7 @@ var Root15 = function(t0) {
46741
46710
  }
46742
46711
  var t11;
46743
46712
  if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
46744
- t11 = /* @__PURE__ */ _jsx86(Close, {});
46713
+ t11 = /* @__PURE__ */ _jsx85(Close, {});
46745
46714
  $[12] = t11;
46746
46715
  } else {
46747
46716
  t11 = $[12];
@@ -46763,7 +46732,7 @@ var Root15 = function(t0) {
46763
46732
  }
46764
46733
  var t13;
46765
46734
  if ($[15] !== className || $[16] !== t12 || $[17] !== t6) {
46766
- t13 = /* @__PURE__ */ _jsx86(Flex28, {
46735
+ t13 = /* @__PURE__ */ _jsx85(Flex28, {
46767
46736
  className: className,
46768
46737
  direction: "column",
46769
46738
  justify: "end",
@@ -46787,7 +46756,7 @@ var Root15 = function(t0) {
46787
46756
  return t13;
46788
46757
  };
46789
46758
  var Messages3 = function(t0) {
46790
- var $ = _c85(5);
46759
+ var $ = _c84(5);
46791
46760
  var className = t0.className, style = t0.style;
46792
46761
  var t1;
46793
46762
  if ($[0] !== style) {
@@ -46803,7 +46772,7 @@ var Messages3 = function(t0) {
46803
46772
  }
46804
46773
  var t2;
46805
46774
  if ($[2] !== className || $[3] !== t1) {
46806
- t2 = /* @__PURE__ */ _jsx86(Thread.Messages, {
46775
+ t2 = /* @__PURE__ */ _jsx85(Thread.Messages, {
46807
46776
  className: className,
46808
46777
  style: t1
46809
46778
  });
@@ -46816,11 +46785,11 @@ var Messages3 = function(t0) {
46816
46785
  return t2;
46817
46786
  };
46818
46787
  var FormContainer = function(t0) {
46819
- var $ = _c85(4);
46788
+ var $ = _c84(4);
46820
46789
  var children = t0.children, className = t0.className, style = t0.style;
46821
46790
  var t1;
46822
46791
  if ($[0] !== children || $[1] !== className || $[2] !== style) {
46823
- t1 = /* @__PURE__ */ _jsx86(Flex28, {
46792
+ t1 = /* @__PURE__ */ _jsx85(Flex28, {
46824
46793
  direction: "column",
46825
46794
  pl: "5",
46826
46795
  pr: "5",
@@ -46840,10 +46809,10 @@ var FormContainer = function(t0) {
46840
46809
  return t1;
46841
46810
  };
46842
46811
  var Content8 = function(props) {
46843
- var $ = _c85(4);
46812
+ var $ = _c84(4);
46844
46813
  var t0;
46845
46814
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46846
- t0 = /* @__PURE__ */ _jsx86(Messages3, {});
46815
+ t0 = /* @__PURE__ */ _jsx85(Messages3, {});
46847
46816
  $[0] = t0;
46848
46817
  } else {
46849
46818
  t0 = $[0];
@@ -46853,8 +46822,8 @@ var Content8 = function(props) {
46853
46822
  t1 = /* @__PURE__ */ _jsxs29(Thread.Root, {
46854
46823
  children: [
46855
46824
  t0,
46856
- /* @__PURE__ */ _jsx86(FormContainer, {
46857
- children: /* @__PURE__ */ _jsx86(Thread.MessageForm, {})
46825
+ /* @__PURE__ */ _jsx85(FormContainer, {
46826
+ children: /* @__PURE__ */ _jsx85(Thread.MessageForm, {})
46858
46827
  })
46859
46828
  ]
46860
46829
  });
@@ -46864,7 +46833,7 @@ var Content8 = function(props) {
46864
46833
  }
46865
46834
  var t2;
46866
46835
  if ($[2] !== props) {
46867
- t2 = /* @__PURE__ */ _jsx86(Root15, _objectSpread45(_objectSpread45({}, props), {}, {
46836
+ t2 = /* @__PURE__ */ _jsx85(Root15, _objectSpread45(_objectSpread45({}, props), {}, {
46868
46837
  children: t1
46869
46838
  }));
46870
46839
  $[2] = props;
@@ -46878,15 +46847,15 @@ Content8.Root = Root15;
46878
46847
  Content8.Messages = Messages3;
46879
46848
  Content8.FormContainer = FormContainer;
46880
46849
  // src/components/threads/ThreadDialog/index.tsx
46881
- import { jsx as _jsx87, jsxs as _jsxs30 } from "react/jsx-runtime";
46850
+ import { jsx as _jsx86, jsxs as _jsxs30 } from "react/jsx-runtime";
46882
46851
  var ThreadDialog = function() {
46883
- var $ = _c86(1);
46852
+ var $ = _c85(1);
46884
46853
  var t0;
46885
46854
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46886
46855
  t0 = /* @__PURE__ */ _jsxs30(Root13, {
46887
46856
  children: [
46888
- /* @__PURE__ */ _jsx87(Content8, {}),
46889
- /* @__PURE__ */ _jsx87(Trigger, {})
46857
+ /* @__PURE__ */ _jsx86(Content8, {}),
46858
+ /* @__PURE__ */ _jsx86(Trigger, {})
46890
46859
  ]
46891
46860
  });
46892
46861
  $[0] = t0;
@@ -46899,29 +46868,29 @@ ThreadDialog.Root = Root13;
46899
46868
  ThreadDialog.Trigger = Trigger;
46900
46869
  ThreadDialog.Content = Content8;
46901
46870
  // src/components/threads/AudioThreadDialog/index.tsx
46902
- import { c as _c101 } from "react-compiler-runtime";
46871
+ import { c as _c99 } from "react-compiler-runtime";
46903
46872
  // src/components/threads/AudioThread/index.tsx
46904
- import { c as _c100 } from "react-compiler-runtime";
46873
+ import { c as _c98 } from "react-compiler-runtime";
46905
46874
  // src/components/threads/AudioThread/Root/index.tsx
46906
- import { c as _c92 } from "react-compiler-runtime";
46875
+ import { c as _c90 } from "react-compiler-runtime";
46907
46876
  import { Flex as Flex29 } from "@radix-ui/themes";
46908
46877
  // src/contexts/threads/AudioThreadContext/index.ts
46909
- import { createContext as createContext14 } from "react";
46910
- var AudioThreadContext = /* @__PURE__ */ createContext14({
46878
+ import { createContext as createContext13 } from "react";
46879
+ var AudioThreadContext = /* @__PURE__ */ createContext13({
46911
46880
  audioRuntime: null
46912
46881
  });
46913
46882
  // src/hooks/threads/useAudioThreadContext/index.ts
46914
- import { useContext as useContext20 } from "react";
46883
+ import { useContext as useContext19 } from "react";
46915
46884
  var useAudioThreadContext = function() {
46916
- return useContext20(AudioThreadContext);
46885
+ return useContext19(AudioThreadContext);
46917
46886
  };
46918
46887
  // src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
46919
- import { c as _c91 } from "react-compiler-runtime";
46888
+ import { c as _c89 } from "react-compiler-runtime";
46920
46889
  // src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
46921
- import { c as _c90 } from "react-compiler-runtime";
46922
- import { useMemo as useMemo19 } from "react";
46890
+ import { c as _c88 } from "react-compiler-runtime";
46891
+ import { useMemo as useMemo18 } from "react";
46923
46892
  // src/hooks/misc/usePermission/index.ts
46924
- import { c as _c87 } from "react-compiler-runtime";
46893
+ import { c as _c86 } from "react-compiler-runtime";
46925
46894
  import { useEffect as useEffect7, useState as useState7 } from "react";
46926
46895
  // src/hooks/misc/usePermission/util.ts
46927
46896
  var noop = function() {};
@@ -46945,7 +46914,7 @@ function off(obj) {
46945
46914
  }
46946
46915
  // src/hooks/misc/usePermission/index.ts
46947
46916
  var usePermission = function(permissionDesc) {
46948
- var $ = _c87(3);
46917
+ var $ = _c86(3);
46949
46918
  var _useState7 = _sliced_to_array(useState7(""), 2), state = _useState7[0], setState = _useState7[1];
46950
46919
  var t0;
46951
46920
  var t1;
@@ -46991,13 +46960,13 @@ var usePermission = function(permissionDesc) {
46991
46960
  // src/hooks/audioThreads/useRecorder/index.ts
46992
46961
  import dayjs3 from "dayjs";
46993
46962
  import { useAudioCapture } from "@supercorp/use-audio-capture";
46994
- import { useMemo as useMemo17, useRef as useRef7, useState as useState8, useCallback as useCallback6, useEffect as useEffect9 } from "react";
46963
+ import { useMemo as useMemo16, useRef as useRef7, useState as useState8, useCallback as useCallback6, useEffect as useEffect9 } from "react";
46995
46964
  import { useAudioPlayer } from "react-use-audio-player";
46996
46965
  // src/hooks/misc/useInterval.ts
46997
- import { c as _c88 } from "react-compiler-runtime";
46966
+ import { c as _c87 } from "react-compiler-runtime";
46998
46967
  import { useEffect as useEffect8, useRef as useRef6 } from "react";
46999
46968
  var useInterval = function(callback, delay) {
47000
- var $ = _c88(5);
46969
+ var $ = _c87(5);
47001
46970
  var savedCallback = useRef6(_temp8);
47002
46971
  var t0;
47003
46972
  if ($[0] !== callback) {
@@ -47187,7 +47156,7 @@ var useRecorder = function(_ref) {
47187
47156
  isInited,
47188
47157
  mediaStream
47189
47158
  ]);
47190
- var visualizationAnalyser = useMemo17(function() {
47159
+ var visualizationAnalyser = useMemo16(function() {
47191
47160
  if (!audioEngine) return null;
47192
47161
  var result = audioEngine.audioContext.createAnalyser();
47193
47162
  audioEngine.source.connect(result);
@@ -47195,7 +47164,7 @@ var useRecorder = function(_ref) {
47195
47164
  }, [
47196
47165
  audioEngine
47197
47166
  ]);
47198
- var silenceAnalyser = useMemo17(function() {
47167
+ var silenceAnalyser = useMemo16(function() {
47199
47168
  if (!audioEngine) return null;
47200
47169
  var result_0 = audioEngine.audioContext.createAnalyser();
47201
47170
  result_0.minDecibels = -60;
@@ -47250,8 +47219,7 @@ var useRecorder = function(_ref) {
47250
47219
  });
47251
47220
  };
47252
47221
  // src/hooks/audioThreads/useMessageAudio/index.ts
47253
- import { c as _c89 } from "react-compiler-runtime";
47254
- import { useMemo as useMemo18, useRef as useRef8, useState as useState9, useEffect as useEffect10, useCallback as useCallback7 } from "react";
47222
+ import { useMemo as useMemo17, useRef as useRef8, useState as useState9, useEffect as useEffect10, useCallback as useCallback7 } from "react";
47255
47223
  import nlp from "compromise";
47256
47224
  import { Howler } from "howler";
47257
47225
  import { useAudioPlayer as useAudioPlayer2 } from "react-use-audio-player";
@@ -47330,424 +47298,222 @@ var getMessageSentences = function(_ref) {
47330
47298
  };
47331
47299
  });
47332
47300
  };
47333
- var useMessageAudio = function(t0) {
47334
- var _latestMessageProps$l, _latestMessageProps$l4, _latestMessageProps$l5;
47335
- var $ = _c89(68);
47336
- var _onEnd = t0.onEnd, passedPlay = t0.play, t1 = t0.fullSentenceRegex;
47337
- var t2;
47338
- if ($[0] !== t1) {
47339
- t2 = t1 === void 0 ? /[\.?!]$/ : t1;
47340
- $[0] = t1;
47341
- $[1] = t2;
47342
- } else {
47343
- t2 = $[1];
47344
- }
47345
- var fullSentenceRegex = t2;
47301
+ var useMessageAudio = function(_ref2) {
47302
+ var _latestMessageProps$l2;
47303
+ var _onEnd = _ref2.onEnd, passedPlay = _ref2.play, _ref2_fullSentenceRegex = _ref2.fullSentenceRegex, fullSentenceRegex = _ref2_fullSentenceRegex === void 0 ? /[\.?!]$/ : _ref2_fullSentenceRegex;
47346
47304
  var _useState9 = _sliced_to_array(useState9(false), 2), isAudioPlayed = _useState9[0], setIsAudioPlayed = _useState9[1];
47347
- var t3;
47348
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
47349
- t3 = [];
47350
- $[2] = t3;
47351
- } else {
47352
- t3 = $[2];
47353
- }
47354
- var _useState91 = _sliced_to_array(useState9(t3), 2), stoppedMessageIds = _useState91[0], setStoppedMessageIds = _useState91[1];
47355
- var t4;
47356
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
47357
- t4 = [];
47358
- $[3] = t4;
47359
- } else {
47360
- t4 = $[3];
47361
- }
47362
- var _useState92 = _sliced_to_array(useState9(t4), 2), playedMessageSentences = _useState92[0], setPlayedMessageSentences = _useState92[1];
47305
+ var _useState91 = _sliced_to_array(useState9([]), 2), stoppedMessageIds = _useState91[0], setStoppedMessageIds = _useState91[1];
47306
+ var _useState92 = _sliced_to_array(useState9([]), 2), playedMessageSentences = _useState92[0], setPlayedMessageSentences = _useState92[1];
47363
47307
  var audioPlayer = useAudioPlayer2();
47364
47308
  var nextAudioPlayer = useAudioPlayer2();
47365
47309
  var superinterfaceContext = useSuperinterfaceContext();
47366
47310
  var _useState93 = _sliced_to_array(useState9(false), 2), isPlaying = _useState93[0], setIsPlaying = _useState93[1];
47367
47311
  var isLastSentencePlayedRef = useRef8(false);
47368
47312
  var latestMessageProps = useLatestMessage();
47369
- var t5;
47370
- var t6;
47371
- if ($[4] !== isPlaying) {
47372
- t5 = function() {
47373
- if (!isPlaying) {
47374
- return;
47375
- }
47376
- isLastSentencePlayedRef.current = false;
47377
- };
47378
- t6 = [
47379
- isPlaying
47380
- ];
47381
- $[4] = isPlaying;
47382
- $[5] = t5;
47383
- $[6] = t6;
47384
- } else {
47385
- t5 = $[5];
47386
- t6 = $[6];
47387
- }
47388
- useEffect10(t5, t6);
47389
- var t7;
47390
- bb0: {
47391
- if (!latestMessageProps.latestMessage) {
47392
- var _t;
47393
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
47394
- _t = [];
47395
- $[7] = _t;
47396
- } else {
47397
- _t = $[7];
47398
- }
47399
- t7 = _t;
47400
- break bb0;
47401
- }
47402
- if (latestMessageProps.latestMessage.role !== "assistant") {
47403
- var _t2;
47404
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
47405
- _t2 = [];
47406
- $[8] = _t2;
47407
- } else {
47408
- _t2 = $[8];
47409
- }
47410
- t7 = _t2;
47411
- break bb0;
47412
- }
47413
- if (stoppedMessageIds.includes(latestMessageProps.latestMessage.id)) {
47414
- var _t3;
47415
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
47416
- _t3 = [];
47417
- $[9] = _t3;
47418
- } else {
47419
- _t3 = $[9];
47420
- }
47421
- t7 = _t3;
47422
- break bb0;
47423
- }
47424
- var _t4;
47425
- if ($[10] !== latestMessageProps.latestMessage || $[11] !== playedMessageSentences) {
47426
- var input2 = input({
47427
- message: latestMessageProps.latestMessage
47428
- });
47429
- if (!input2) {
47430
- var _t5;
47431
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
47432
- _t5 = [];
47433
- $[14] = _t5;
47434
- } else {
47435
- _t5 = $[14];
47436
- }
47437
- t7 = _t5;
47438
- break bb0;
47439
- }
47440
- var messageSentences = getMessageSentences({
47441
- messageId: latestMessageProps.latestMessage.id,
47442
- input: input2
47443
- });
47444
- var _t6;
47445
- if ($[15] !== playedMessageSentences) {
47446
- _t6 = function(ms) {
47447
- return !playedMessageSentences.find(function(pms) {
47448
- return pms.messageId === ms.messageId && pms.sentence === ms.sentence;
47449
- });
47450
- };
47451
- $[15] = playedMessageSentences;
47452
- $[16] = _t6;
47453
- } else {
47454
- _t6 = $[16];
47455
- }
47456
- _t4 = messageSentences.filter(_t6);
47457
- $[10] = latestMessageProps.latestMessage;
47458
- $[11] = playedMessageSentences;
47459
- $[12] = _t4;
47460
- $[13] = t7;
47461
- } else {
47462
- _t4 = $[12];
47463
- t7 = $[13];
47464
- }
47465
- t7 = _t4;
47466
- }
47467
- var unplayedMessageSentences = t7;
47468
- var t8;
47469
- if ($[17] !== audioPlayer || $[18] !== fullSentenceRegex || $[19] !== isAudioPlayed || $[20] !== nextAudioPlayer || $[21] !== superinterfaceContext || $[22] !== unplayedMessageSentences[1]) {
47470
- t8 = function(t92) {
47471
- var input_0 = t92.input, onPlay = t92.onPlay, onStop = t92.onStop, onEnd_0 = t92.onEnd;
47472
- var searchParams = new URLSearchParams(_objectSpread47({
47313
+ var messagesProps = useMessages();
47314
+ useEffect10(function() {
47315
+ if (!isPlaying) return;
47316
+ isLastSentencePlayedRef.current = false;
47317
+ }, [
47318
+ isPlaying
47319
+ ]);
47320
+ var unplayedMessageSentences = useMemo17(function() {
47321
+ var playableMessages = messagesProps.messages.filter(function(message) {
47322
+ if (message.role !== "assistant") return false;
47323
+ if (stoppedMessageIds.includes(message.id)) return false;
47324
+ return true;
47325
+ });
47326
+ var messageInputs = playableMessages.map(function(message_0) {
47327
+ return {
47328
+ message: message_0,
47329
+ input: input({
47330
+ message: message_0
47331
+ })
47332
+ };
47333
+ }).filter(function(_ref3) {
47334
+ var input2 = _ref3.input;
47335
+ return input2 !== null;
47336
+ });
47337
+ var messageSentences = messageInputs.flatMap(function(_ref4) {
47338
+ var message_1 = _ref4.message, input_0 = _ref4.input;
47339
+ return getMessageSentences({
47340
+ messageId: message_1.id,
47473
47341
  input: input_0
47474
- }, superinterfaceContext.variables));
47475
- audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(searchParams), {
47476
- format: "mp3",
47477
- autoplay: isAudioPlayed,
47478
- html5: isHtmlAudioSupported,
47479
- onplay: onPlay,
47480
- onstop: onStop,
47481
- onload: function() {
47482
- var nextUnplayedMessageSentence = unplayedMessageSentences[1];
47483
- if (!nextUnplayedMessageSentence) {
47484
- return;
47485
- }
47486
- var isNextFullSentence = fullSentenceRegex.test(nextUnplayedMessageSentence.sentence);
47487
- if (!isNextFullSentence) {
47488
- return;
47489
- }
47490
- var nextSearchParams = new URLSearchParams(_objectSpread47({
47491
- input: nextUnplayedMessageSentence.sentence
47492
- }, superinterfaceContext.variables));
47493
- nextAudioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(nextSearchParams), {
47494
- format: "mp3",
47495
- autoplay: false,
47496
- html5: isHtmlAudioSupported
47497
- });
47498
- },
47499
- onend: onEnd_0
47500
47342
  });
47501
- };
47502
- $[17] = audioPlayer;
47503
- $[18] = fullSentenceRegex;
47504
- $[19] = isAudioPlayed;
47505
- $[20] = nextAudioPlayer;
47506
- $[21] = superinterfaceContext;
47507
- $[22] = unplayedMessageSentences[1];
47508
- $[23] = t8;
47509
- } else {
47510
- t8 = $[23];
47511
- }
47512
- var defaultPlay = t8;
47513
- var t9;
47514
- t9 = passedPlay || defaultPlay;
47515
- var play = t9;
47516
- var t10;
47517
- if ($[24] !== audioPlayer.playing || $[25] !== fullSentenceRegex || $[26] !== isPlaying || $[27] !== latestMessageProps.latestMessage || $[28] !== _onEnd || $[29] !== play || $[30] !== unplayedMessageSentences[0] || $[31] !== unplayedMessageSentences.length) {
47518
- t10 = function() {
47519
- if (isPlaying) {
47520
- return;
47521
- }
47522
- if (audioPlayer.playing) {
47523
- return;
47524
- }
47525
- if (!latestMessageProps.latestMessage) {
47526
- return;
47527
- }
47528
- if (latestMessageProps.latestMessage.role !== "assistant") {
47529
- return;
47530
- }
47531
- var firstUnplayedMessageSentence = unplayedMessageSentences[0];
47532
- if (!firstUnplayedMessageSentence) {
47533
- return;
47534
- }
47535
- var isFullSentence = isOptimistic({
47536
- id: latestMessageProps.latestMessage.id
47537
- }) || latestMessageProps.latestMessage.status !== "in_progress" || fullSentenceRegex.test(firstUnplayedMessageSentence.sentence);
47538
- if (!isFullSentence) {
47539
- return;
47540
- }
47541
- setIsPlaying(true);
47542
- setPlayedMessageSentences(function(prev) {
47543
- return _to_consumable_array(prev).concat([
47544
- firstUnplayedMessageSentence
47545
- ]);
47343
+ });
47344
+ return messageSentences.filter(function(ms) {
47345
+ return !playedMessageSentences.find(function(pms) {
47346
+ return pms.messageId === ms.messageId && pms.sentence === ms.sentence;
47546
47347
  });
47547
- var input_1 = firstUnplayedMessageSentence.sentence;
47548
- play({
47549
- input: input_1,
47550
- onPlay: function() {
47551
- setIsAudioPlayed(true);
47552
- },
47553
- onStop: function() {
47554
- setStoppedMessageIds(function(prev_0) {
47555
- return _to_consumable_array(prev_0).concat([
47556
- firstUnplayedMessageSentence.messageId
47557
- ]);
47558
- });
47559
- setIsPlaying(false);
47560
- },
47561
- onEnd: function() {
47562
- setIsPlaying(false);
47563
- isLastSentencePlayedRef.current = unplayedMessageSentences.length === 1;
47564
- if (isLastSentencePlayedRef.current && latestMessageProps.latestMessage.status !== "in_progress") {
47565
- _onEnd();
47566
- isLastSentencePlayedRef.current = false;
47567
- }
47348
+ });
47349
+ }, [
47350
+ messagesProps,
47351
+ playedMessageSentences
47352
+ ]);
47353
+ var defaultPlay = useCallback7(function(_ref5) {
47354
+ var input_1 = _ref5.input, onPlay = _ref5.onPlay, onStop = _ref5.onStop, onEnd_0 = _ref5.onEnd;
47355
+ var searchParams = new URLSearchParams(_objectSpread47({
47356
+ input: input_1
47357
+ }, superinterfaceContext.variables));
47358
+ audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(searchParams), {
47359
+ format: "mp3",
47360
+ autoplay: isAudioPlayed,
47361
+ html5: isHtmlAudioSupported,
47362
+ onplay: onPlay,
47363
+ onstop: onStop,
47364
+ onload: function() {
47365
+ var nextUnplayedMessageSentence = unplayedMessageSentences[1];
47366
+ if (!nextUnplayedMessageSentence) return;
47367
+ var isNextFullSentence = fullSentenceRegex.test(nextUnplayedMessageSentence.sentence);
47368
+ if (!isNextFullSentence) return;
47369
+ var nextSearchParams = new URLSearchParams(_objectSpread47({
47370
+ input: nextUnplayedMessageSentence.sentence
47371
+ }, superinterfaceContext.variables));
47372
+ nextAudioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(nextSearchParams), {
47373
+ format: "mp3",
47374
+ autoplay: false,
47375
+ html5: isHtmlAudioSupported
47376
+ });
47377
+ },
47378
+ onend: onEnd_0
47379
+ });
47380
+ }, [
47381
+ superinterfaceContext,
47382
+ unplayedMessageSentences,
47383
+ audioPlayer,
47384
+ nextAudioPlayer,
47385
+ isAudioPlayed,
47386
+ fullSentenceRegex
47387
+ ]);
47388
+ var play = useMemo17(function() {
47389
+ return passedPlay || defaultPlay;
47390
+ }, [
47391
+ passedPlay,
47392
+ defaultPlay
47393
+ ]);
47394
+ useEffect10(function() {
47395
+ if (isPlaying) return;
47396
+ if (audioPlayer.playing) return;
47397
+ if (!latestMessageProps.latestMessage) return;
47398
+ if (latestMessageProps.latestMessage.role !== "assistant") return;
47399
+ var firstUnplayedMessageSentence = unplayedMessageSentences[0];
47400
+ if (!firstUnplayedMessageSentence) {
47401
+ return;
47402
+ }
47403
+ var isFullSentence = isOptimistic({
47404
+ id: latestMessageProps.latestMessage.id
47405
+ }) || latestMessageProps.latestMessage.status !== "in_progress" || fullSentenceRegex.test(firstUnplayedMessageSentence.sentence);
47406
+ if (!isFullSentence) return;
47407
+ setIsPlaying(true);
47408
+ setPlayedMessageSentences(function(prev) {
47409
+ return _to_consumable_array(prev).concat([
47410
+ firstUnplayedMessageSentence
47411
+ ]);
47412
+ });
47413
+ var input_2 = firstUnplayedMessageSentence.sentence;
47414
+ play({
47415
+ input: input_2,
47416
+ onPlay: function() {
47417
+ setIsAudioPlayed(true);
47418
+ },
47419
+ onStop: function() {
47420
+ setStoppedMessageIds(function(prev_0) {
47421
+ return _to_consumable_array(prev_0).concat([
47422
+ firstUnplayedMessageSentence.messageId
47423
+ ]);
47424
+ });
47425
+ setIsPlaying(false);
47426
+ },
47427
+ onEnd: function() {
47428
+ setIsPlaying(false);
47429
+ isLastSentencePlayedRef.current = unplayedMessageSentences.length === 1;
47430
+ if (isLastSentencePlayedRef.current && latestMessageProps.latestMessage.status !== "in_progress") {
47431
+ _onEnd();
47432
+ isLastSentencePlayedRef.current = false;
47568
47433
  }
47569
- });
47570
- };
47571
- $[24] = audioPlayer.playing;
47572
- $[25] = fullSentenceRegex;
47573
- $[26] = isPlaying;
47574
- $[27] = latestMessageProps.latestMessage;
47575
- $[28] = _onEnd;
47576
- $[29] = play;
47577
- $[30] = unplayedMessageSentences[0];
47578
- $[31] = unplayedMessageSentences.length;
47579
- $[32] = t10;
47580
- } else {
47581
- t10 = $[32];
47582
- }
47583
- var t11;
47584
- if ($[33] !== audioPlayer || $[34] !== fullSentenceRegex || $[35] !== isPlaying || $[36] !== latestMessageProps || $[37] !== nextAudioPlayer || $[38] !== _onEnd || $[39] !== play || $[40] !== playedMessageSentences || $[41] !== superinterfaceContext || $[42] !== unplayedMessageSentences) {
47585
- t11 = [
47586
- unplayedMessageSentences,
47587
- isPlaying,
47588
- superinterfaceContext,
47589
- latestMessageProps,
47590
- audioPlayer,
47591
- nextAudioPlayer,
47592
- playedMessageSentences,
47593
- _onEnd,
47594
- play,
47595
- fullSentenceRegex
47596
- ];
47597
- $[33] = audioPlayer;
47598
- $[34] = fullSentenceRegex;
47599
- $[35] = isPlaying;
47600
- $[36] = latestMessageProps;
47601
- $[37] = nextAudioPlayer;
47602
- $[38] = _onEnd;
47603
- $[39] = play;
47604
- $[40] = playedMessageSentences;
47605
- $[41] = superinterfaceContext;
47606
- $[42] = unplayedMessageSentences;
47607
- $[43] = t11;
47608
- } else {
47609
- t11 = $[43];
47610
- }
47611
- useEffect10(t10, t11);
47612
- var t12;
47613
- if ($[44] !== isPlaying || $[45] !== ((_latestMessageProps$l = latestMessageProps.latestMessage) === null || _latestMessageProps$l === void 0 ? void 0 : _latestMessageProps$l.status) || $[46] !== _onEnd || $[47] !== unplayedMessageSentences.length) {
47614
- var _latestMessageProps$l3;
47615
- t12 = function() {
47616
- var _latestMessageProps$l2;
47617
- if (isLastSentencePlayedRef.current && !isPlaying && unplayedMessageSentences.length === 0 && ((_latestMessageProps$l2 = latestMessageProps.latestMessage) === null || _latestMessageProps$l2 === void 0 ? void 0 : _latestMessageProps$l2.status) !== "in_progress") {
47618
- _onEnd();
47619
- isLastSentencePlayedRef.current = false;
47620
47434
  }
47621
- };
47622
- $[44] = isPlaying;
47623
- $[45] = (_latestMessageProps$l3 = latestMessageProps.latestMessage) === null || _latestMessageProps$l3 === void 0 ? void 0 : _latestMessageProps$l3.status;
47624
- $[46] = _onEnd;
47625
- $[47] = unplayedMessageSentences.length;
47626
- $[48] = t12;
47627
- } else {
47628
- t12 = $[48];
47629
- }
47630
- var t13 = (_latestMessageProps$l4 = latestMessageProps.latestMessage) === null || _latestMessageProps$l4 === void 0 ? void 0 : _latestMessageProps$l4.status;
47631
- var t14;
47632
- if ($[49] !== isPlaying || $[50] !== _onEnd || $[51] !== t13 || $[52] !== unplayedMessageSentences.length) {
47633
- t14 = [
47634
- isPlaying,
47635
- unplayedMessageSentences.length,
47636
- t13,
47637
- _onEnd
47638
- ];
47639
- $[49] = isPlaying;
47640
- $[50] = _onEnd;
47641
- $[51] = t13;
47642
- $[52] = unplayedMessageSentences.length;
47643
- $[53] = t14;
47644
- } else {
47645
- t14 = $[53];
47646
- }
47647
- useEffect10(t12, t14);
47648
- var t15;
47649
- if ($[54] !== audioPlayer) {
47650
- t15 = [
47651
- audioPlayer
47652
- ];
47653
- $[54] = audioPlayer;
47654
- $[55] = t15;
47655
- } else {
47656
- t15 = $[55];
47657
- }
47658
- useEffect10(_temp9, t15);
47435
+ });
47436
+ }, [
47437
+ unplayedMessageSentences,
47438
+ isPlaying,
47439
+ superinterfaceContext,
47440
+ latestMessageProps,
47441
+ audioPlayer,
47442
+ nextAudioPlayer,
47443
+ playedMessageSentences,
47444
+ _onEnd,
47445
+ play,
47446
+ fullSentenceRegex
47447
+ ]);
47448
+ useEffect10(function() {
47449
+ var _latestMessageProps$l;
47450
+ if (isLastSentencePlayedRef.current && !isPlaying && unplayedMessageSentences.length === 0 && ((_latestMessageProps$l = latestMessageProps.latestMessage) === null || _latestMessageProps$l === void 0 ? void 0 : _latestMessageProps$l.status) !== "in_progress") {
47451
+ _onEnd();
47452
+ isLastSentencePlayedRef.current = false;
47453
+ }
47454
+ }, [
47455
+ isPlaying,
47456
+ unplayedMessageSentences.length,
47457
+ (_latestMessageProps$l2 = latestMessageProps.latestMessage) === null || _latestMessageProps$l2 === void 0 ? void 0 : _latestMessageProps$l2.status,
47458
+ _onEnd
47459
+ ]);
47460
+ useEffect10(function() {
47461
+ if (isHtmlAudioSupported) {
47462
+ var _Howler$_howls$;
47463
+ if (!(Howler !== null && Howler !== void 0 && (_Howler$_howls$ = Howler._howls[0]) !== null && _Howler$_howls$ !== void 0 && (_Howler$_howls$ = _Howler$_howls$._sounds[0]) !== null && _Howler$_howls$ !== void 0 && _Howler$_howls$._node)) return;
47464
+ Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
47465
+ }
47466
+ }, [
47467
+ audioPlayer
47468
+ ]);
47659
47469
  var _useState94 = _sliced_to_array(useState9(null), 2), audioEngine = _useState94[0], setAudioEngine = _useState94[1];
47660
47470
  var isAudioEngineInited = useRef8(false);
47661
- var t16;
47662
- if ($[56] !== audioPlayer.playing) {
47663
- t16 = function() {
47664
- if (!audioPlayer.playing) {
47665
- return;
47666
- }
47667
- if (isAudioEngineInited.current) {
47668
- return;
47669
- }
47670
- isAudioEngineInited.current = true;
47671
- if (isHtmlAudioSupported) {
47672
- var audioContext = new AudioContext();
47673
- setAudioEngine({
47674
- source: audioContext.createMediaElementSource(Howler._howls[0]._sounds[0]._node),
47675
- audioContext: audioContext
47676
- });
47677
- } else {
47678
- setAudioEngine({
47679
- source: Howler.masterGain,
47680
- audioContext: Howler.ctx
47681
- });
47682
- }
47683
- };
47684
- $[56] = audioPlayer.playing;
47685
- $[57] = t16;
47686
- } else {
47687
- t16 = $[57];
47688
- }
47689
- var t17;
47690
- if ($[58] !== audioPlayer) {
47691
- t17 = [
47692
- audioPlayer,
47693
- isAudioEngineInited
47694
- ];
47695
- $[58] = audioPlayer;
47696
- $[59] = t17;
47697
- } else {
47698
- t17 = $[59];
47699
- }
47700
- useEffect10(t16, t17);
47701
- var t18;
47702
- bb1: {
47703
- if (!audioEngine) {
47704
- t18 = null;
47705
- break bb1;
47706
- }
47707
- var result;
47708
- if ($[60] !== audioEngine.audioContext || $[61] !== audioEngine.source) {
47709
- result = audioEngine.audioContext.createAnalyser();
47710
- audioEngine.source.connect(audioEngine.audioContext.destination);
47711
- audioEngine.source.connect(result);
47712
- $[60] = audioEngine.audioContext;
47713
- $[61] = audioEngine.source;
47714
- $[62] = result;
47471
+ useEffect10(function() {
47472
+ if (!audioPlayer.playing) return;
47473
+ if (isAudioEngineInited.current) return;
47474
+ isAudioEngineInited.current = true;
47475
+ if (isHtmlAudioSupported) {
47476
+ var audioContext = new AudioContext();
47477
+ setAudioEngine({
47478
+ // @ts-ignore-next-line
47479
+ source: audioContext.createMediaElementSource(// @ts-ignore-next-line
47480
+ Howler._howls[0]._sounds[0]._node),
47481
+ audioContext: audioContext
47482
+ });
47715
47483
  } else {
47716
- result = $[62];
47484
+ setAudioEngine({
47485
+ source: Howler.masterGain,
47486
+ audioContext: Howler.ctx
47487
+ });
47717
47488
  }
47718
- t18 = result;
47719
- }
47720
- var visualizationAnalyser = t18;
47721
- var t19;
47722
- t19 = isPlaying || unplayedMessageSentences.length > 0 || ((_latestMessageProps$l5 = latestMessageProps.latestMessage) === null || _latestMessageProps$l5 === void 0 ? void 0 : _latestMessageProps$l5.status) === "in_progress";
47723
- var isPending = t19;
47724
- var t20;
47725
- if ($[63] !== audioPlayer || $[64] !== isAudioPlayed || $[65] !== isPending || $[66] !== visualizationAnalyser) {
47726
- t20 = _objectSpread47(_objectSpread47({
47727
- isPending: isPending,
47728
- isAudioPlayed: isAudioPlayed
47729
- }, audioPlayer), {}, {
47730
- visualizationAnalyser: visualizationAnalyser
47731
- });
47732
- $[63] = audioPlayer;
47733
- $[64] = isAudioPlayed;
47734
- $[65] = isPending;
47735
- $[66] = visualizationAnalyser;
47736
- $[67] = t20;
47737
- } else {
47738
- t20 = $[67];
47739
- }
47740
- return t20;
47489
+ }, [
47490
+ audioPlayer,
47491
+ isAudioEngineInited
47492
+ ]);
47493
+ var visualizationAnalyser = useMemo17(function() {
47494
+ if (!audioEngine) return null;
47495
+ var result = audioEngine.audioContext.createAnalyser();
47496
+ audioEngine.source.connect(audioEngine.audioContext.destination);
47497
+ audioEngine.source.connect(result);
47498
+ return result;
47499
+ }, [
47500
+ audioEngine
47501
+ ]);
47502
+ var isPending = useMemo17(function() {
47503
+ var _latestMessageProps$l3;
47504
+ return isPlaying || unplayedMessageSentences.length > 0 || ((_latestMessageProps$l3 = latestMessageProps.latestMessage) === null || _latestMessageProps$l3 === void 0 ? void 0 : _latestMessageProps$l3.status) === "in_progress";
47505
+ }, [
47506
+ isPlaying,
47507
+ unplayedMessageSentences,
47508
+ latestMessageProps
47509
+ ]);
47510
+ return _objectSpread47(_objectSpread47({
47511
+ isPending: isPending,
47512
+ isAudioPlayed: isAudioPlayed
47513
+ }, audioPlayer), {}, {
47514
+ visualizationAnalyser: visualizationAnalyser
47515
+ });
47741
47516
  };
47742
- function _temp9() {
47743
- if (isHtmlAudioSupported) {
47744
- var _Howler$_howls$;
47745
- if (!(Howler !== null && Howler !== void 0 && (_Howler$_howls$ = Howler._howls[0]) !== null && _Howler$_howls$ !== void 0 && (_Howler$_howls$ = _Howler$_howls$._sounds[0]) !== null && _Howler$_howls$ !== void 0 && _Howler$_howls$._node)) {
47746
- return;
47747
- }
47748
- Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
47749
- }
47750
- }
47751
47517
  // src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
47752
47518
  import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
47753
47519
  // src/hooks/audioRuntimes/useTtsAudioRuntime/blobToData.ts
@@ -47785,7 +47551,7 @@ function _asyncToGenerator11(n) {
47785
47551
  };
47786
47552
  }
47787
47553
  var useTtsAudioRuntime = function(t0) {
47788
- var $ = _c90(30);
47554
+ var $ = _c88(30);
47789
47555
  var play = t0.play, passedOnEnd = t0.onEnd;
47790
47556
  var addToast = useToasts().addToast;
47791
47557
  var queryClient = useQueryClient6();
@@ -47814,7 +47580,7 @@ var useTtsAudioRuntime = function(t0) {
47814
47580
  if ($[1] !== createMessageProps) {
47815
47581
  t2 = {
47816
47582
  isStopOnSilence: true,
47817
- onStart: _temp10,
47583
+ onStart: _temp9,
47818
47584
  onStop: function() {
47819
47585
  var _onStop = _asyncToGenerator11(function(_event, chunks) {
47820
47586
  var blob, audioContent;
@@ -47955,7 +47721,7 @@ var useTtsAudioRuntime = function(t0) {
47955
47721
  t5 = t8;
47956
47722
  return t5;
47957
47723
  };
47958
- function _temp10() {
47724
+ function _temp9() {
47959
47725
  return _temp24.apply(this, arguments);
47960
47726
  }
47961
47727
  function _temp24() {
@@ -47969,9 +47735,9 @@ function _temp24() {
47969
47735
  return _temp24.apply(this, arguments);
47970
47736
  }
47971
47737
  // src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
47972
- import { jsx as _jsx88 } from "react/jsx-runtime";
47738
+ import { jsx as _jsx87 } from "react/jsx-runtime";
47973
47739
  var TtsAudioRuntimeProvider = function(t0) {
47974
- var $ = _c91(8);
47740
+ var $ = _c89(8);
47975
47741
  var children = t0.children, play = t0.play, onEnd = t0.onEnd;
47976
47742
  var t1;
47977
47743
  if ($[0] !== onEnd || $[1] !== play) {
@@ -47998,7 +47764,7 @@ var TtsAudioRuntimeProvider = function(t0) {
47998
47764
  }
47999
47765
  var t3;
48000
47766
  if ($[5] !== children || $[6] !== t2) {
48001
- t3 = /* @__PURE__ */ _jsx88(AudioThreadContext.Provider, {
47767
+ t3 = /* @__PURE__ */ _jsx87(AudioThreadContext.Provider, {
48002
47768
  value: t2,
48003
47769
  children: children
48004
47770
  });
@@ -48011,7 +47777,7 @@ var TtsAudioRuntimeProvider = function(t0) {
48011
47777
  return t3;
48012
47778
  };
48013
47779
  // src/components/threads/AudioThread/Root/index.tsx
48014
- import { jsx as _jsx89 } from "react/jsx-runtime";
47780
+ import { jsx as _jsx88 } from "react/jsx-runtime";
48015
47781
  var _excluded5 = [
48016
47782
  "children"
48017
47783
  ];
@@ -48084,11 +47850,11 @@ function _objectWithoutPropertiesLoose5(r, e) {
48084
47850
  return t;
48085
47851
  }
48086
47852
  var Content9 = function(t0) {
48087
- var $ = _c92(4);
47853
+ var $ = _c90(4);
48088
47854
  var children = t0.children, className = t0.className, style = t0.style;
48089
47855
  var t1;
48090
47856
  if ($[0] !== children || $[1] !== className || $[2] !== style) {
48091
- t1 = /* @__PURE__ */ _jsx89(Flex29, {
47857
+ t1 = /* @__PURE__ */ _jsx88(Flex29, {
48092
47858
  direction: "column",
48093
47859
  flexGrow: "1",
48094
47860
  p: "9",
@@ -48106,7 +47872,7 @@ var Content9 = function(t0) {
48106
47872
  return t1;
48107
47873
  };
48108
47874
  var AudioRuntimeProvider = function(t0) {
48109
- var $ = _c92(4);
47875
+ var $ = _c90(4);
48110
47876
  var children = t0.children, play = t0.play, onEnd = t0.onEnd;
48111
47877
  var audioThreadContext = useAudioThreadContext();
48112
47878
  if (audioThreadContext.audioRuntime) {
@@ -48114,7 +47880,7 @@ var AudioRuntimeProvider = function(t0) {
48114
47880
  }
48115
47881
  var t1;
48116
47882
  if ($[0] !== children || $[1] !== onEnd || $[2] !== play) {
48117
- t1 = /* @__PURE__ */ _jsx89(TtsAudioRuntimeProvider, {
47883
+ t1 = /* @__PURE__ */ _jsx88(TtsAudioRuntimeProvider, {
48118
47884
  play: play,
48119
47885
  onEnd: onEnd,
48120
47886
  children: children
@@ -48129,7 +47895,7 @@ var AudioRuntimeProvider = function(t0) {
48129
47895
  return t1;
48130
47896
  };
48131
47897
  var Provider5 = function(t0) {
48132
- var $ = _c92(9);
47898
+ var $ = _c90(9);
48133
47899
  var children;
48134
47900
  var rest;
48135
47901
  if ($[0] !== t0) {
@@ -48156,7 +47922,7 @@ var Provider5 = function(t0) {
48156
47922
  }
48157
47923
  var t2;
48158
47924
  if ($[6] !== children || $[7] !== t1) {
48159
- t2 = /* @__PURE__ */ _jsx89(AudioThreadContext.Provider, {
47925
+ t2 = /* @__PURE__ */ _jsx88(AudioThreadContext.Provider, {
48160
47926
  value: t1,
48161
47927
  children: children
48162
47928
  });
@@ -48169,7 +47935,7 @@ var Provider5 = function(t0) {
48169
47935
  return t2;
48170
47936
  };
48171
47937
  var Root16 = function(t0) {
48172
- var $ = _c92(18);
47938
+ var $ = _c90(18);
48173
47939
  var children;
48174
47940
  var className;
48175
47941
  var onEnd;
@@ -48199,8 +47965,8 @@ var Root16 = function(t0) {
48199
47965
  }
48200
47966
  var t1;
48201
47967
  if ($[7] !== children || $[8] !== className || $[9] !== style) {
48202
- t1 = /* @__PURE__ */ _jsx89(ToastsProvider, {
48203
- children: /* @__PURE__ */ _jsx89(Content9, {
47968
+ t1 = /* @__PURE__ */ _jsx88(ToastsProvider, {
47969
+ children: /* @__PURE__ */ _jsx88(Content9, {
48204
47970
  className: className,
48205
47971
  style: style,
48206
47972
  children: children
@@ -48215,7 +47981,7 @@ var Root16 = function(t0) {
48215
47981
  }
48216
47982
  var t2;
48217
47983
  if ($[11] !== onEnd || $[12] !== play || $[13] !== t1) {
48218
- t2 = /* @__PURE__ */ _jsx89(AudioRuntimeProvider, {
47984
+ t2 = /* @__PURE__ */ _jsx88(AudioRuntimeProvider, {
48219
47985
  play: play,
48220
47986
  onEnd: onEnd,
48221
47987
  children: t1
@@ -48229,7 +47995,7 @@ var Root16 = function(t0) {
48229
47995
  }
48230
47996
  var t3;
48231
47997
  if ($[15] !== rest || $[16] !== t2) {
48232
- t3 = /* @__PURE__ */ _jsx89(Provider5, _objectSpread48(_objectSpread48({}, rest), {}, {
47998
+ t3 = /* @__PURE__ */ _jsx88(Provider5, _objectSpread48(_objectSpread48({}, rest), {}, {
48233
47999
  children: t2
48234
48000
  }));
48235
48001
  $[15] = rest;
@@ -48241,8 +48007,8 @@ var Root16 = function(t0) {
48241
48007
  return t3;
48242
48008
  };
48243
48009
  // src/components/threads/AudioThread/Visualization/index.tsx
48244
- import { c as _c94 } from "react-compiler-runtime";
48245
- import { useState as useState11, useCallback as useCallback9, useEffect as useEffect12, useContext as useContext21, createContext as createContext15 } from "react";
48010
+ import { c as _c92 } from "react-compiler-runtime";
48011
+ import { useState as useState11, useCallback as useCallback9, useEffect as useEffect12, useContext as useContext20, createContext as createContext14 } from "react";
48246
48012
  import _9 from "lodash";
48247
48013
  import { Flex as Flex31 } from "@radix-ui/themes";
48248
48014
  // src/components/threads/AudioThread/BarsVisualizer/index.tsx
@@ -48250,7 +48016,7 @@ import _8 from "lodash";
48250
48016
  import { Flex as Flex30, Grid } from "@radix-ui/themes";
48251
48017
  import { useState as useState10, useEffect as useEffect11, useCallback as useCallback8 } from "react";
48252
48018
  import { cluster } from "radash";
48253
- import { jsx as _jsx90 } from "react/jsx-runtime";
48019
+ import { jsx as _jsx89 } from "react/jsx-runtime";
48254
48020
  var barCount = 4;
48255
48021
  var BarsVisualizer = function(_ref) {
48256
48022
  var visualizationAnalyser = _ref.visualizationAnalyser, backgroundColor = _ref.backgroundColor, height = _ref.height, barWidth = _ref.barWidth;
@@ -48281,7 +48047,7 @@ var BarsVisualizer = function(_ref) {
48281
48047
  draw,
48282
48048
  visualizationAnalyser
48283
48049
  ]);
48284
- return /* @__PURE__ */ _jsx90(Grid, {
48050
+ return /* @__PURE__ */ _jsx89(Grid, {
48285
48051
  columns: "".concat(barCount),
48286
48052
  gap: "1",
48287
48053
  width: "auto",
@@ -48290,12 +48056,12 @@ var BarsVisualizer = function(_ref) {
48290
48056
  gridTemplateColumns: "repeat(4, minmax(0, 1fr))"
48291
48057
  },
48292
48058
  children: barHeights.map(function(barHeight, index) {
48293
- return /* @__PURE__ */ _jsx90(Flex30, {
48059
+ return /* @__PURE__ */ _jsx89(Flex30, {
48294
48060
  direction: "column",
48295
48061
  align: "center",
48296
48062
  justify: "center",
48297
48063
  height: height,
48298
- children: /* @__PURE__ */ _jsx90(Flex30, {
48064
+ children: /* @__PURE__ */ _jsx89(Flex30, {
48299
48065
  minHeight: "50%",
48300
48066
  maxHeight: "100%",
48301
48067
  height: "".concat(barHeight + 20, "%"),
@@ -48310,10 +48076,10 @@ var BarsVisualizer = function(_ref) {
48310
48076
  });
48311
48077
  };
48312
48078
  // src/hooks/audioThreads/useStatus/index.ts
48313
- import { c as _c93 } from "react-compiler-runtime";
48314
- import { useMemo as useMemo20 } from "react";
48079
+ import { c as _c91 } from "react-compiler-runtime";
48080
+ import { useMemo as useMemo19 } from "react";
48315
48081
  var useStatus = function() {
48316
- var $ = _c93(2);
48082
+ var $ = _c91(2);
48317
48083
  var audioRuntime = useAudioThreadContext().audioRuntime;
48318
48084
  var t0;
48319
48085
  bb0: {
@@ -48361,7 +48127,7 @@ var useStatus = function() {
48361
48127
  return t1;
48362
48128
  };
48363
48129
  // src/components/threads/AudioThread/Visualization/index.tsx
48364
- import { jsx as _jsx91, jsxs as _jsxs31 } from "react/jsx-runtime";
48130
+ import { jsx as _jsx90, jsxs as _jsxs31 } from "react/jsx-runtime";
48365
48131
  var _excluded6 = [
48366
48132
  "children"
48367
48133
  ];
@@ -48435,7 +48201,7 @@ function _objectWithoutPropertiesLoose6(r, e) {
48435
48201
  }
48436
48202
  return t;
48437
48203
  }
48438
- var AudioThreadVisualizationContext = /* @__PURE__ */ createContext15({
48204
+ var AudioThreadVisualizationContext = /* @__PURE__ */ createContext14({
48439
48205
  scale: 0
48440
48206
  });
48441
48207
  var Provider6 = function(_ref) {
@@ -48465,7 +48231,7 @@ var Provider6 = function(_ref) {
48465
48231
  draw,
48466
48232
  audioThreadContext
48467
48233
  ]);
48468
- return /* @__PURE__ */ _jsx91(AudioThreadVisualizationContext.Provider, {
48234
+ return /* @__PURE__ */ _jsx90(AudioThreadVisualizationContext.Provider, {
48469
48235
  value: {
48470
48236
  scale: scale
48471
48237
  },
@@ -48473,7 +48239,7 @@ var Provider6 = function(_ref) {
48473
48239
  });
48474
48240
  };
48475
48241
  var Root17 = function(t0) {
48476
- var $ = _c94(6);
48242
+ var $ = _c92(6);
48477
48243
  var children;
48478
48244
  var rest;
48479
48245
  if ($[0] !== t0) {
@@ -48490,8 +48256,8 @@ var Root17 = function(t0) {
48490
48256
  }
48491
48257
  var t1;
48492
48258
  if ($[3] !== children || $[4] !== rest) {
48493
- t1 = /* @__PURE__ */ _jsx91(Provider6, {
48494
- children: /* @__PURE__ */ _jsx91(Flex31, _objectSpread49(_objectSpread49({
48259
+ t1 = /* @__PURE__ */ _jsx90(Provider6, {
48260
+ children: /* @__PURE__ */ _jsx90(Flex31, _objectSpread49(_objectSpread49({
48495
48261
  direction: "column",
48496
48262
  align: "center",
48497
48263
  justify: "center",
@@ -48510,7 +48276,7 @@ var Root17 = function(t0) {
48510
48276
  return t1;
48511
48277
  };
48512
48278
  var BarsVisualizer2 = function(t0) {
48513
- var $ = _c94(10);
48279
+ var $ = _c92(10);
48514
48280
  var rest;
48515
48281
  var t1;
48516
48282
  var t2;
@@ -48536,7 +48302,7 @@ var BarsVisualizer2 = function(t0) {
48536
48302
  var t3 = status === "playing" ? "var(--accent-11)" : "var(--gray-11)";
48537
48303
  var t4;
48538
48304
  if ($[4] !== audioThreadContext.audioRuntime.assistant.visualizationAnalyser || $[5] !== barWidth || $[6] !== height || $[7] !== rest || $[8] !== t3) {
48539
- t4 = /* @__PURE__ */ _jsx91(BarsVisualizer, _objectSpread49({
48305
+ t4 = /* @__PURE__ */ _jsx90(BarsVisualizer, _objectSpread49({
48540
48306
  visualizationAnalyser: audioThreadContext.audioRuntime.assistant.visualizationAnalyser,
48541
48307
  backgroundColor: t3,
48542
48308
  height: height,
@@ -48554,7 +48320,7 @@ var BarsVisualizer2 = function(t0) {
48554
48320
  return t4;
48555
48321
  };
48556
48322
  var AssistantVisualizationRoot = function(t0) {
48557
- var $ = _c94(17);
48323
+ var $ = _c92(17);
48558
48324
  var children;
48559
48325
  var rest;
48560
48326
  var t1;
@@ -48579,7 +48345,7 @@ var AssistantVisualizationRoot = function(t0) {
48579
48345
  var height = t1 === void 0 ? "200px" : t1;
48580
48346
  var width2 = t2 === void 0 ? "200px" : t2;
48581
48347
  var status = useStatus().status;
48582
- var scale = useContext21(AudioThreadVisualizationContext).scale;
48348
+ var scale = useContext20(AudioThreadVisualizationContext).scale;
48583
48349
  var t3 = status === "playing" ? "var(--accent-4)" : "var(--gray-4)";
48584
48350
  var t4;
48585
48351
  if ($[5] !== rest.style) {
@@ -48606,7 +48372,7 @@ var AssistantVisualizationRoot = function(t0) {
48606
48372
  }
48607
48373
  var t6;
48608
48374
  if ($[11] !== children || $[12] !== height || $[13] !== rest || $[14] !== t5 || $[15] !== width2) {
48609
- t6 = /* @__PURE__ */ _jsx91(Flex31, _objectSpread49(_objectSpread49({
48375
+ t6 = /* @__PURE__ */ _jsx90(Flex31, _objectSpread49(_objectSpread49({
48610
48376
  align: "center",
48611
48377
  justify: "center",
48612
48378
  height: height,
@@ -48627,17 +48393,17 @@ var AssistantVisualizationRoot = function(t0) {
48627
48393
  return t6;
48628
48394
  };
48629
48395
  var AssistantVisualization = function(props) {
48630
- var $ = _c94(3);
48396
+ var $ = _c92(3);
48631
48397
  var t0;
48632
48398
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48633
- t0 = /* @__PURE__ */ _jsx91(BarsVisualizer2, {});
48399
+ t0 = /* @__PURE__ */ _jsx90(BarsVisualizer2, {});
48634
48400
  $[0] = t0;
48635
48401
  } else {
48636
48402
  t0 = $[0];
48637
48403
  }
48638
48404
  var t1;
48639
48405
  if ($[1] !== props) {
48640
- t1 = /* @__PURE__ */ _jsx91(AssistantVisualizationRoot, _objectSpread49(_objectSpread49({}, props), {}, {
48406
+ t1 = /* @__PURE__ */ _jsx90(AssistantVisualizationRoot, _objectSpread49(_objectSpread49({}, props), {}, {
48641
48407
  children: t0
48642
48408
  }));
48643
48409
  $[1] = props;
@@ -48650,18 +48416,18 @@ var AssistantVisualization = function(props) {
48650
48416
  AssistantVisualization.Root = AssistantVisualizationRoot;
48651
48417
  AssistantVisualization.BarsVisualizer = BarsVisualizer2;
48652
48418
  var AssistantInfo = function(props) {
48653
- var $ = _c94(6);
48654
- var assistantNameContext = useContext21(AssistantNameContext);
48419
+ var $ = _c92(6);
48420
+ var assistantNameContext = useContext20(AssistantNameContext);
48655
48421
  var t0;
48656
48422
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48657
- t0 = /* @__PURE__ */ _jsx91(MessageGroup.AssistantAvatar, {});
48423
+ t0 = /* @__PURE__ */ _jsx90(MessageGroup.AssistantAvatar, {});
48658
48424
  $[0] = t0;
48659
48425
  } else {
48660
48426
  t0 = $[0];
48661
48427
  }
48662
48428
  var t1;
48663
48429
  if ($[1] !== assistantNameContext) {
48664
- t1 = /* @__PURE__ */ _jsx91(MessageGroup.Name, {
48430
+ t1 = /* @__PURE__ */ _jsx90(MessageGroup.Name, {
48665
48431
  children: assistantNameContext
48666
48432
  });
48667
48433
  $[1] = assistantNameContext;
@@ -48690,12 +48456,12 @@ var AssistantInfo = function(props) {
48690
48456
  return t2;
48691
48457
  };
48692
48458
  var Visualization = function(props) {
48693
- var $ = _c94(4);
48459
+ var $ = _c92(4);
48694
48460
  var t0;
48695
48461
  var t1;
48696
48462
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48697
- t0 = /* @__PURE__ */ _jsx91(AssistantVisualization, {});
48698
- t1 = /* @__PURE__ */ _jsx91(AssistantInfo, {});
48463
+ t0 = /* @__PURE__ */ _jsx90(AssistantVisualization, {});
48464
+ t1 = /* @__PURE__ */ _jsx90(AssistantInfo, {});
48699
48465
  $[0] = t0;
48700
48466
  $[1] = t1;
48701
48467
  } else {
@@ -48722,11 +48488,11 @@ Visualization.Provider = Provider6;
48722
48488
  Visualization.AssistantVisualization = AssistantVisualization;
48723
48489
  Visualization.AssistantInfo = AssistantInfo;
48724
48490
  // src/components/threads/AudioThread/Status/index.tsx
48725
- import { c as _c96 } from "react-compiler-runtime";
48491
+ import { c as _c94 } from "react-compiler-runtime";
48726
48492
  // src/components/threads/AudioThread/Status/StatusMessages.tsx
48727
- import { c as _c95 } from "react-compiler-runtime";
48493
+ import { c as _c93 } from "react-compiler-runtime";
48728
48494
  import { Flex as Flex32, Text as Text9 } from "@radix-ui/themes";
48729
- import { jsx as _jsx92, jsxs as _jsxs32 } from "react/jsx-runtime";
48495
+ import { jsx as _jsx91, jsxs as _jsxs32 } from "react/jsx-runtime";
48730
48496
  var html = function(_ref) {
48731
48497
  var texts = _ref.texts;
48732
48498
  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) {
@@ -48734,11 +48500,11 @@ var html = function(_ref) {
48734
48500
  }).join(""), "\n }");
48735
48501
  };
48736
48502
  var StatusMessages = function(t0) {
48737
- var $ = _c95(9);
48503
+ var $ = _c93(9);
48738
48504
  var texts = t0.texts, className = t0.className, style = t0.style;
48739
48505
  var t1;
48740
48506
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48741
- t1 = /* @__PURE__ */ _jsx92(Text9, {
48507
+ t1 = /* @__PURE__ */ _jsx91(Text9, {
48742
48508
  size: "2",
48743
48509
  weight: "regular",
48744
48510
  color: "gray",
@@ -48761,7 +48527,7 @@ var StatusMessages = function(t0) {
48761
48527
  }
48762
48528
  var t3;
48763
48529
  if ($[3] !== t2) {
48764
- t3 = /* @__PURE__ */ _jsx92("style", {
48530
+ t3 = /* @__PURE__ */ _jsx91("style", {
48765
48531
  dangerouslySetInnerHTML: {
48766
48532
  __html: t2
48767
48533
  }
@@ -48793,7 +48559,7 @@ var StatusMessages = function(t0) {
48793
48559
  return t4;
48794
48560
  };
48795
48561
  // src/components/threads/AudioThread/Status/index.tsx
48796
- import { jsx as _jsx93 } from "react/jsx-runtime";
48562
+ import { jsx as _jsx92 } from "react/jsx-runtime";
48797
48563
  function ownKeys50(e, r) {
48798
48564
  var t = Object.keys(e);
48799
48565
  if (Object.getOwnPropertySymbols) {
@@ -48838,7 +48604,7 @@ function _toPrimitive50(t, r) {
48838
48604
  return ("string" === r ? String : Number)(t);
48839
48605
  }
48840
48606
  var Status = function(props) {
48841
- var $ = _c96(12);
48607
+ var $ = _c94(12);
48842
48608
  var status = useStatus().status;
48843
48609
  if (status === "recording") {
48844
48610
  var _t;
@@ -48855,7 +48621,7 @@ var Status = function(props) {
48855
48621
  }
48856
48622
  var _t2;
48857
48623
  if ($[1] !== props) {
48858
- _t2 = /* @__PURE__ */ _jsx93(StatusMessages, _objectSpread50({
48624
+ _t2 = /* @__PURE__ */ _jsx92(StatusMessages, _objectSpread50({
48859
48625
  texts: _t
48860
48626
  }, props));
48861
48627
  $[1] = props;
@@ -48881,7 +48647,7 @@ var Status = function(props) {
48881
48647
  }
48882
48648
  var _t4;
48883
48649
  if ($[4] !== props) {
48884
- _t4 = /* @__PURE__ */ _jsx93(StatusMessages, _objectSpread50({
48650
+ _t4 = /* @__PURE__ */ _jsx92(StatusMessages, _objectSpread50({
48885
48651
  texts: _t3
48886
48652
  }, props));
48887
48653
  $[4] = props;
@@ -48903,7 +48669,7 @@ var Status = function(props) {
48903
48669
  }
48904
48670
  var _t6;
48905
48671
  if ($[7] !== props) {
48906
- _t6 = /* @__PURE__ */ _jsx93(StatusMessages, _objectSpread50({
48672
+ _t6 = /* @__PURE__ */ _jsx92(StatusMessages, _objectSpread50({
48907
48673
  texts: _t5
48908
48674
  }, props));
48909
48675
  $[7] = props;
@@ -48924,7 +48690,7 @@ var Status = function(props) {
48924
48690
  }
48925
48691
  var t1;
48926
48692
  if ($[10] !== props) {
48927
- t1 = /* @__PURE__ */ _jsx93(StatusMessages, _objectSpread50({
48693
+ t1 = /* @__PURE__ */ _jsx92(StatusMessages, _objectSpread50({
48928
48694
  texts: t0
48929
48695
  }, props));
48930
48696
  $[10] = props;
@@ -48935,11 +48701,11 @@ var Status = function(props) {
48935
48701
  return t1;
48936
48702
  };
48937
48703
  // src/components/threads/AudioThread/Form/index.tsx
48938
- import { c as _c99 } from "react-compiler-runtime";
48704
+ import { c as _c97 } from "react-compiler-runtime";
48939
48705
  import { Flex as Flex34 } from "@radix-ui/themes";
48940
48706
  // src/components/threads/AudioThread/Form/MicIcon.tsx
48941
- import { c as _c97 } from "react-compiler-runtime";
48942
- import { jsx as _jsx94 } from "react/jsx-runtime";
48707
+ import { c as _c95 } from "react-compiler-runtime";
48708
+ import { jsx as _jsx93 } from "react/jsx-runtime";
48943
48709
  function ownKeys51(e, r) {
48944
48710
  var t = Object.keys(e);
48945
48711
  if (Object.getOwnPropertySymbols) {
@@ -48984,10 +48750,10 @@ function _toPrimitive51(t, r) {
48984
48750
  return ("string" === r ? String : Number)(t);
48985
48751
  }
48986
48752
  var MicIcon = function(props) {
48987
- var $ = _c97(3);
48753
+ var $ = _c95(3);
48988
48754
  var t0;
48989
48755
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48990
- t0 = /* @__PURE__ */ _jsx94("path", {
48756
+ t0 = /* @__PURE__ */ _jsx93("path", {
48991
48757
  stroke: "none",
48992
48758
  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"
48993
48759
  });
@@ -48997,7 +48763,7 @@ var MicIcon = function(props) {
48997
48763
  }
48998
48764
  var t1;
48999
48765
  if ($[1] !== props) {
49000
- t1 = /* @__PURE__ */ _jsx94("svg", _objectSpread51(_objectSpread51({
48766
+ t1 = /* @__PURE__ */ _jsx93("svg", _objectSpread51(_objectSpread51({
49001
48767
  xmlns: "http://www.w3.org/2000/svg",
49002
48768
  fill: "currentColor",
49003
48769
  stroke: "currentColor",
@@ -49016,29 +48782,29 @@ var MicIcon = function(props) {
49016
48782
  return t1;
49017
48783
  };
49018
48784
  // src/components/threads/AudioThread/Form/ActionButton/index.tsx
49019
- import { c as _c98 } from "react-compiler-runtime";
48785
+ import { c as _c96 } from "react-compiler-runtime";
49020
48786
  import { Flex as Flex33, IconButton as IconButton10 } from "@radix-ui/themes";
49021
48787
  import { StopIcon as StopIcon2, PauseIcon as PauseIcon2, ArrowUpIcon as ArrowUpIcon3, ResumeIcon } from "@radix-ui/react-icons";
49022
- import { jsx as _jsx95, jsxs as _jsxs33 } from "react/jsx-runtime";
48788
+ import { jsx as _jsx94, jsxs as _jsxs33 } from "react/jsx-runtime";
49023
48789
  var ActionButton = function() {
49024
- var $ = _c98(27);
48790
+ var $ = _c96(27);
49025
48791
  var status = useStatus().status;
49026
48792
  var audioThreadContext = useAudioThreadContext();
49027
48793
  var superinterfaceContext = useSuperinterfaceContext();
49028
48794
  if (status === "recording") {
49029
48795
  var _t;
49030
48796
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
49031
- _t = /* @__PURE__ */ _jsx95(PauseIcon2, {});
48797
+ _t = /* @__PURE__ */ _jsx94(PauseIcon2, {});
49032
48798
  $[0] = _t;
49033
48799
  } else {
49034
48800
  _t = $[0];
49035
48801
  }
49036
48802
  var t1;
49037
48803
  if ($[1] !== audioThreadContext.audioRuntime.user.pause) {
49038
- t1 = /* @__PURE__ */ _jsx95(Flex33, {
48804
+ t1 = /* @__PURE__ */ _jsx94(Flex33, {
49039
48805
  mr: "3",
49040
48806
  ml: "-7",
49041
- children: /* @__PURE__ */ _jsx95(IconButton10, {
48807
+ children: /* @__PURE__ */ _jsx94(IconButton10, {
49042
48808
  onClick: audioThreadContext.audioRuntime.user.pause,
49043
48809
  color: "gray",
49044
48810
  variant: "soft",
@@ -49053,14 +48819,14 @@ var ActionButton = function() {
49053
48819
  }
49054
48820
  var t2;
49055
48821
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
49056
- t2 = /* @__PURE__ */ _jsx95(ArrowUpIcon3, {});
48822
+ t2 = /* @__PURE__ */ _jsx94(ArrowUpIcon3, {});
49057
48823
  $[3] = t2;
49058
48824
  } else {
49059
48825
  t2 = $[3];
49060
48826
  }
49061
48827
  var t3;
49062
48828
  if ($[4] !== audioThreadContext.audioRuntime.user.stop) {
49063
- t3 = /* @__PURE__ */ _jsx95(IconButton10, {
48829
+ t3 = /* @__PURE__ */ _jsx94(IconButton10, {
49064
48830
  onClick: audioThreadContext.audioRuntime.user.stop,
49065
48831
  highContrast: true,
49066
48832
  variant: "soft",
@@ -49092,14 +48858,14 @@ var ActionButton = function() {
49092
48858
  if (status === "recorderPaused") {
49093
48859
  var _t2;
49094
48860
  if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
49095
- _t2 = /* @__PURE__ */ _jsx95(ResumeIcon, {});
48861
+ _t2 = /* @__PURE__ */ _jsx94(ResumeIcon, {});
49096
48862
  $[9] = _t2;
49097
48863
  } else {
49098
48864
  _t2 = $[9];
49099
48865
  }
49100
48866
  var _t3;
49101
48867
  if ($[10] !== audioThreadContext.audioRuntime.user.resume) {
49102
- _t3 = /* @__PURE__ */ _jsx95(IconButton10, {
48868
+ _t3 = /* @__PURE__ */ _jsx94(IconButton10, {
49103
48869
  onClick: audioThreadContext.audioRuntime.user.resume,
49104
48870
  color: "red",
49105
48871
  size: "4",
@@ -49115,7 +48881,7 @@ var ActionButton = function() {
49115
48881
  if (status === "idle") {
49116
48882
  var _t4;
49117
48883
  if ($[12] !== audioThreadContext.audioRuntime.user) {
49118
- _t4 = /* @__PURE__ */ _jsx95(IconButton10, {
48884
+ _t4 = /* @__PURE__ */ _jsx94(IconButton10, {
49119
48885
  onClick: function() {
49120
48886
  return audioThreadContext.audioRuntime.user.start();
49121
48887
  },
@@ -49147,14 +48913,14 @@ var ActionButton = function() {
49147
48913
  }
49148
48914
  var _t6;
49149
48915
  if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
49150
- _t6 = /* @__PURE__ */ _jsx95(StopIcon2, {});
48916
+ _t6 = /* @__PURE__ */ _jsx94(StopIcon2, {});
49151
48917
  $[18] = _t6;
49152
48918
  } else {
49153
48919
  _t6 = $[18];
49154
48920
  }
49155
48921
  var _t7;
49156
48922
  if ($[19] !== _t5) {
49157
- _t7 = /* @__PURE__ */ _jsx95(IconButton10, {
48923
+ _t7 = /* @__PURE__ */ _jsx94(IconButton10, {
49158
48924
  onClick: _t5,
49159
48925
  size: "4",
49160
48926
  color: "gray",
@@ -49181,14 +48947,14 @@ var ActionButton = function() {
49181
48947
  }
49182
48948
  var _t9;
49183
48949
  if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
49184
- _t9 = /* @__PURE__ */ _jsx95(ResumeIcon, {});
48950
+ _t9 = /* @__PURE__ */ _jsx94(ResumeIcon, {});
49185
48951
  $[23] = _t9;
49186
48952
  } else {
49187
48953
  _t9 = $[23];
49188
48954
  }
49189
48955
  var _t0;
49190
48956
  if ($[24] !== _t8) {
49191
- _t0 = /* @__PURE__ */ _jsx95(IconButton10, {
48957
+ _t0 = /* @__PURE__ */ _jsx94(IconButton10, {
49192
48958
  onClick: _t8,
49193
48959
  size: "4",
49194
48960
  children: _t9
@@ -49202,7 +48968,7 @@ var ActionButton = function() {
49202
48968
  }
49203
48969
  var t0;
49204
48970
  if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
49205
- t0 = /* @__PURE__ */ _jsx95(IconButton10, {
48971
+ t0 = /* @__PURE__ */ _jsx94(IconButton10, {
49206
48972
  size: "4",
49207
48973
  variant: "soft",
49208
48974
  disabled: true
@@ -49214,7 +48980,7 @@ var ActionButton = function() {
49214
48980
  return t0;
49215
48981
  };
49216
48982
  // src/components/threads/AudioThread/Form/index.tsx
49217
- import { jsx as _jsx96, jsxs as _jsxs34 } from "react/jsx-runtime";
48983
+ import { jsx as _jsx95, jsxs as _jsxs34 } from "react/jsx-runtime";
49218
48984
  function ownKeys52(e, r) {
49219
48985
  var t = Object.keys(e);
49220
48986
  if (Object.getOwnPropertySymbols) {
@@ -49259,17 +49025,17 @@ function _toPrimitive52(t, r) {
49259
49025
  return ("string" === r ? String : Number)(t);
49260
49026
  }
49261
49027
  var Form = function(props) {
49262
- var $ = _c99(17);
49028
+ var $ = _c97(17);
49263
49029
  var status = useStatus().status;
49264
49030
  var audioThreadContext = useAudioThreadContext();
49265
49031
  var t0 = status === "recording" ? "var(--accent-11)" : "var(--gray-11)";
49266
49032
  var t1;
49267
49033
  if ($[0] !== t0) {
49268
- t1 = /* @__PURE__ */ _jsx96(Flex34, {
49034
+ t1 = /* @__PURE__ */ _jsx95(Flex34, {
49269
49035
  ml: "-22.5px",
49270
49036
  mr: "2",
49271
49037
  align: "center",
49272
- children: /* @__PURE__ */ _jsx96(MicIcon, {
49038
+ children: /* @__PURE__ */ _jsx95(MicIcon, {
49273
49039
  style: {
49274
49040
  color: t0
49275
49041
  }
@@ -49295,7 +49061,7 @@ var Form = function(props) {
49295
49061
  var t4 = status === "recording" ? "var(--accent-11)" : "var(--gray-11)";
49296
49062
  var t5;
49297
49063
  if ($[4] !== audioThreadContext.audioRuntime.user.visualizationAnalyser || $[5] !== t4) {
49298
- t5 = /* @__PURE__ */ _jsx96(BarsVisualizer, {
49064
+ t5 = /* @__PURE__ */ _jsx95(BarsVisualizer, {
49299
49065
  visualizationAnalyser: audioThreadContext.audioRuntime.user.visualizationAnalyser,
49300
49066
  backgroundColor: t4,
49301
49067
  height: "20px",
@@ -49309,7 +49075,7 @@ var Form = function(props) {
49309
49075
  }
49310
49076
  var t6;
49311
49077
  if ($[7] !== t3 || $[8] !== t5) {
49312
- t6 = /* @__PURE__ */ _jsx96(Flex34, {
49078
+ t6 = /* @__PURE__ */ _jsx95(Flex34, {
49313
49079
  px: "2",
49314
49080
  py: "1",
49315
49081
  style: t3,
@@ -49339,7 +49105,7 @@ var Form = function(props) {
49339
49105
  }
49340
49106
  var t8;
49341
49107
  if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
49342
- t8 = /* @__PURE__ */ _jsx96(ActionButton, {});
49108
+ t8 = /* @__PURE__ */ _jsx95(ActionButton, {});
49343
49109
  $[13] = t8;
49344
49110
  } else {
49345
49111
  t8 = $[13];
@@ -49364,7 +49130,7 @@ var Form = function(props) {
49364
49130
  return t9;
49365
49131
  };
49366
49132
  // src/components/threads/AudioThread/index.tsx
49367
- import { jsx as _jsx97, jsxs as _jsxs35 } from "react/jsx-runtime";
49133
+ import { jsx as _jsx96, jsxs as _jsxs35 } from "react/jsx-runtime";
49368
49134
  function ownKeys53(e, r) {
49369
49135
  var t = Object.keys(e);
49370
49136
  if (Object.getOwnPropertySymbols) {
@@ -49409,14 +49175,14 @@ function _toPrimitive53(t, r) {
49409
49175
  return ("string" === r ? String : Number)(t);
49410
49176
  }
49411
49177
  var AudioThread = function(props) {
49412
- var $ = _c100(5);
49178
+ var $ = _c98(5);
49413
49179
  var t0;
49414
49180
  var t1;
49415
49181
  var t2;
49416
49182
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
49417
- t0 = /* @__PURE__ */ _jsx97(Visualization, {});
49418
- t1 = /* @__PURE__ */ _jsx97(Status, {});
49419
- t2 = /* @__PURE__ */ _jsx97(Form, {});
49183
+ t0 = /* @__PURE__ */ _jsx96(Visualization, {});
49184
+ t1 = /* @__PURE__ */ _jsx96(Status, {});
49185
+ t2 = /* @__PURE__ */ _jsx96(Form, {});
49420
49186
  $[0] = t0;
49421
49187
  $[1] = t1;
49422
49188
  $[2] = t2;
@@ -49446,7 +49212,7 @@ AudioThread.Visualization = Visualization;
49446
49212
  AudioThread.Status = Status;
49447
49213
  AudioThread.Form = Form;
49448
49214
  // src/components/threads/AudioThreadDialog/index.tsx
49449
- import { jsx as _jsx98, jsxs as _jsxs36 } from "react/jsx-runtime";
49215
+ import { jsx as _jsx97, jsxs as _jsxs36 } from "react/jsx-runtime";
49450
49216
  function ownKeys54(e, r) {
49451
49217
  var t = Object.keys(e);
49452
49218
  if (Object.getOwnPropertySymbols) {
@@ -49491,14 +49257,14 @@ function _toPrimitive54(t, r) {
49491
49257
  return ("string" === r ? String : Number)(t);
49492
49258
  }
49493
49259
  var AudioThreadDialog = function(props) {
49494
- var $ = _c101(4);
49260
+ var $ = _c99(4);
49495
49261
  var t0;
49496
49262
  var t1;
49497
49263
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
49498
- t0 = /* @__PURE__ */ _jsx98(Content8.Root, {
49499
- children: /* @__PURE__ */ _jsx98(AudioThread, {})
49264
+ t0 = /* @__PURE__ */ _jsx97(Content8.Root, {
49265
+ children: /* @__PURE__ */ _jsx97(AudioThread, {})
49500
49266
  });
49501
- t1 = /* @__PURE__ */ _jsx98(Trigger, {});
49267
+ t1 = /* @__PURE__ */ _jsx97(Trigger, {});
49502
49268
  $[0] = t0;
49503
49269
  $[1] = t1;
49504
49270
  } else {
@@ -49524,7 +49290,7 @@ AudioThreadDialog.Root = Root13;
49524
49290
  AudioThreadDialog.Trigger = Trigger;
49525
49291
  AudioThreadDialog.Content = Content8;
49526
49292
  // src/hooks/audioRuntimes/useWebrtcAudioRuntime/index.ts
49527
- import { useEffect as useEffect13, useMemo as useMemo21, useRef as useRef9, useState as useState12 } from "react";
49293
+ import { useEffect as useEffect13, useMemo as useMemo20, useRef as useRef9, useState as useState12 } from "react";
49528
49294
  function asyncGeneratorStep12(n, t, e, r, o, a, c) {
49529
49295
  try {
49530
49296
  var i = n[a](c), u = i.value;
@@ -49964,7 +49730,7 @@ var useWebrtcAudioRuntime = function() {
49964
49730
  return _ref7.apply(this, arguments);
49965
49731
  };
49966
49732
  }();
49967
- return useMemo21(function() {
49733
+ return useMemo20(function() {
49968
49734
  return {
49969
49735
  webrtcAudioRuntime: {
49970
49736
  user: {
@@ -50013,10 +49779,10 @@ var useWebrtcAudioRuntime = function() {
50013
49779
  ]);
50014
49780
  };
50015
49781
  // src/components/audioRuntimes/WebrtcAudioRuntimeProvider.tsx
50016
- import { c as _c102 } from "react-compiler-runtime";
50017
- import { jsx as _jsx99 } from "react/jsx-runtime";
49782
+ import { c as _c100 } from "react-compiler-runtime";
49783
+ import { jsx as _jsx98 } from "react/jsx-runtime";
50018
49784
  var WebrtcAudioRuntimeProvider = function(t0) {
50019
- var $ = _c102(5);
49785
+ var $ = _c100(5);
50020
49786
  var children = t0.children;
50021
49787
  var webrtcAudioRuntime = useWebrtcAudioRuntime().webrtcAudioRuntime;
50022
49788
  var t1;
@@ -50031,7 +49797,7 @@ var WebrtcAudioRuntimeProvider = function(t0) {
50031
49797
  }
50032
49798
  var t2;
50033
49799
  if ($[2] !== children || $[3] !== t1) {
50034
- t2 = /* @__PURE__ */ _jsx99(AudioThreadContext.Provider, {
49800
+ t2 = /* @__PURE__ */ _jsx98(AudioThreadContext.Provider, {
50035
49801
  value: t1,
50036
49802
  children: children
50037
49803
  });
@@ -50044,20 +49810,20 @@ var WebrtcAudioRuntimeProvider = function(t0) {
50044
49810
  return t2;
50045
49811
  };
50046
49812
  // src/components/gui/Gui/index.tsx
50047
- import { c as _c105 } from "react-compiler-runtime";
50048
- import { useMemo as useMemo24 } from "react";
49813
+ import { c as _c103 } from "react-compiler-runtime";
49814
+ import { useMemo as useMemo23 } from "react";
50049
49815
  import { Flex as Flex35, Card as Card5, Spinner as Spinner3 } from "@radix-ui/themes";
50050
49816
  // src/hooks/messages/useLatestAssistantMessage/index.ts
50051
- import { c as _c103 } from "react-compiler-runtime";
50052
- import { useMemo as useMemo22 } from "react";
49817
+ import { c as _c101 } from "react-compiler-runtime";
49818
+ import { useMemo as useMemo21 } from "react";
50053
49819
  var useLatestAssistantMessage = function() {
50054
- var $ = _c103(4);
49820
+ var $ = _c101(4);
50055
49821
  var _useMessages = useMessages(), messages2 = _useMessages.messages;
50056
49822
  var t0;
50057
49823
  var t1;
50058
49824
  if ($[0] !== messages2) {
50059
49825
  var _messages$find;
50060
- t1 = (_messages$find = messages2.find(_temp11)) !== null && _messages$find !== void 0 ? _messages$find : null;
49826
+ t1 = (_messages$find = messages2.find(_temp10)) !== null && _messages$find !== void 0 ? _messages$find : null;
50061
49827
  $[0] = messages2;
50062
49828
  $[1] = t1;
50063
49829
  } else {
@@ -50076,15 +49842,15 @@ var useLatestAssistantMessage = function() {
50076
49842
  t0 = t2;
50077
49843
  return t0;
50078
49844
  };
50079
- function _temp11(message) {
49845
+ function _temp10(message) {
50080
49846
  return message.role === "assistant";
50081
49847
  }
50082
49848
  // src/hooks/messages/useLatestAssistantMessageWithContent/index.ts
50083
- import { c as _c104 } from "react-compiler-runtime";
49849
+ import { c as _c102 } from "react-compiler-runtime";
50084
49850
  import { isEmpty as isEmpty3 } from "radash";
50085
- import { useMemo as useMemo23 } from "react";
49851
+ import { useMemo as useMemo22 } from "react";
50086
49852
  var useLatestAssistantMessageWithContent = function() {
50087
- var $ = _c104(4);
49853
+ var $ = _c102(4);
50088
49854
  var _useMessages = useMessages(), messages2 = _useMessages.messages;
50089
49855
  var t0;
50090
49856
  var t1;
@@ -50109,21 +49875,21 @@ var useLatestAssistantMessageWithContent = function() {
50109
49875
  t0 = t2;
50110
49876
  return t0;
50111
49877
  };
50112
- function _temp12(content2) {
49878
+ function _temp11(content2) {
50113
49879
  return content2.type === "text" && !isEmpty3(content2.text.value);
50114
49880
  }
50115
49881
  function _temp25(message) {
50116
- return message.role === "assistant" && message.content.some(_temp12);
49882
+ return message.role === "assistant" && message.content.some(_temp11);
50117
49883
  }
50118
49884
  // src/components/gui/Gui/index.tsx
50119
- import { jsx as _jsx100, jsxs as _jsxs37 } from "react/jsx-runtime";
49885
+ import { jsx as _jsx99, jsxs as _jsxs37 } from "react/jsx-runtime";
50120
49886
  var StartingToolCalls3 = function() {
50121
- var $ = _c105(2);
49887
+ var $ = _c103(2);
50122
49888
  var _useComponents = useComponents(), t0 = _useComponents.components;
50123
49889
  var StartingToolCalls4 = t0.StartingToolCalls;
50124
49890
  var t1;
50125
49891
  if ($[0] !== StartingToolCalls4) {
50126
- t1 = /* @__PURE__ */ _jsx100(StartingToolCalls4, {});
49892
+ t1 = /* @__PURE__ */ _jsx99(StartingToolCalls4, {});
50127
49893
  $[0] = StartingToolCalls4;
50128
49894
  $[1] = t1;
50129
49895
  } else {
@@ -50132,7 +49898,7 @@ var StartingToolCalls3 = function() {
50132
49898
  return t1;
50133
49899
  };
50134
49900
  var Content10 = function(t0) {
50135
- var $ = _c105(5);
49901
+ var $ = _c103(5);
50136
49902
  var latestRunStep = t0.latestRunStep;
50137
49903
  var t1;
50138
49904
  bb0: {
@@ -50154,7 +49920,7 @@ var Content10 = function(t0) {
50154
49920
  if (!latestRunStep || latestRunStep.step_details.type !== "tool_calls") {
50155
49921
  var _t;
50156
49922
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
50157
- _t = /* @__PURE__ */ _jsx100(Spinner3, {});
49923
+ _t = /* @__PURE__ */ _jsx99(Spinner3, {});
50158
49924
  $[0] = _t;
50159
49925
  } else {
50160
49926
  _t = $[0];
@@ -50164,7 +49930,7 @@ var Content10 = function(t0) {
50164
49930
  if (!latestToolCall) {
50165
49931
  var _t2;
50166
49932
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
50167
- _t2 = /* @__PURE__ */ _jsx100(StartingToolCalls3, {});
49933
+ _t2 = /* @__PURE__ */ _jsx99(StartingToolCalls3, {});
50168
49934
  $[1] = _t2;
50169
49935
  } else {
50170
49936
  _t2 = $[1];
@@ -50173,7 +49939,7 @@ var Content10 = function(t0) {
50173
49939
  }
50174
49940
  var t2;
50175
49941
  if ($[2] !== latestRunStep || $[3] !== latestToolCall) {
50176
- t2 = /* @__PURE__ */ _jsx100(ToolCall, {
49942
+ t2 = /* @__PURE__ */ _jsx99(ToolCall, {
50177
49943
  runStep: latestRunStep,
50178
49944
  toolCall: latestToolCall
50179
49945
  });
@@ -50186,14 +49952,14 @@ var Content10 = function(t0) {
50186
49952
  return t2;
50187
49953
  };
50188
49954
  var Progress2 = function(t0) {
50189
- var $ = _c105(5);
49955
+ var $ = _c103(5);
50190
49956
  var latestAssistantMessage = t0.latestAssistantMessage;
50191
49957
  var isMutatingMessage = useIsMutatingMessage();
50192
49958
  var t1;
50193
49959
  var t2;
50194
49960
  if ($[0] !== latestAssistantMessage.runSteps) {
50195
49961
  var _latestAssistantMessa;
50196
- t2 = (_latestAssistantMessa = latestAssistantMessage.runSteps.find(_temp13)) !== null && _latestAssistantMessa !== void 0 ? _latestAssistantMessa : null;
49962
+ t2 = (_latestAssistantMessa = latestAssistantMessage.runSteps.find(_temp12)) !== null && _latestAssistantMessa !== void 0 ? _latestAssistantMessa : null;
50197
49963
  $[0] = latestAssistantMessage.runSteps;
50198
49964
  $[1] = t2;
50199
49965
  } else {
@@ -50220,10 +49986,10 @@ var Progress2 = function(t0) {
50220
49986
  }
50221
49987
  var t4;
50222
49988
  if ($[3] !== latestRunStep) {
50223
- t4 = /* @__PURE__ */ _jsx100(Flex35, {
49989
+ t4 = /* @__PURE__ */ _jsx99(Flex35, {
50224
49990
  style: t3,
50225
- children: /* @__PURE__ */ _jsx100(Card5, {
50226
- children: /* @__PURE__ */ _jsx100(Content10, {
49991
+ children: /* @__PURE__ */ _jsx99(Card5, {
49992
+ children: /* @__PURE__ */ _jsx99(Content10, {
50227
49993
  latestRunStep: latestRunStep
50228
49994
  })
50229
49995
  })
@@ -50236,20 +50002,20 @@ var Progress2 = function(t0) {
50236
50002
  return t4;
50237
50003
  };
50238
50004
  var Gui = function() {
50239
- var $ = _c105(8);
50005
+ var $ = _c103(8);
50240
50006
  var latestAssistantMessage = useLatestAssistantMessage().latestAssistantMessage;
50241
50007
  var latestAssistantMessageWithContent = useLatestAssistantMessageWithContent().latestAssistantMessageWithContent;
50242
50008
  if (!latestAssistantMessage || !latestAssistantMessageWithContent) {
50243
50009
  var _t3;
50244
50010
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
50245
- _t3 = /* @__PURE__ */ _jsx100(Flex35, {
50011
+ _t3 = /* @__PURE__ */ _jsx99(Flex35, {
50246
50012
  direction: "column",
50247
50013
  flexGrow: "1",
50248
- children: /* @__PURE__ */ _jsx100(Flex35, {
50014
+ children: /* @__PURE__ */ _jsx99(Flex35, {
50249
50015
  align: "center",
50250
50016
  justify: "center",
50251
50017
  flexGrow: "1",
50252
- children: /* @__PURE__ */ _jsx100(Spinner3, {
50018
+ children: /* @__PURE__ */ _jsx99(Spinner3, {
50253
50019
  size: "3"
50254
50020
  })
50255
50021
  })
@@ -50262,7 +50028,7 @@ var Gui = function() {
50262
50028
  }
50263
50029
  var t0;
50264
50030
  if ($[1] !== latestAssistantMessageWithContent) {
50265
- t0 = /* @__PURE__ */ _jsx100(MessageContent, {
50031
+ t0 = /* @__PURE__ */ _jsx99(MessageContent, {
50266
50032
  message: latestAssistantMessageWithContent
50267
50033
  });
50268
50034
  $[1] = latestAssistantMessageWithContent;
@@ -50272,7 +50038,7 @@ var Gui = function() {
50272
50038
  }
50273
50039
  var t1;
50274
50040
  if ($[3] !== latestAssistantMessage) {
50275
- t1 = /* @__PURE__ */ _jsx100(Progress2, {
50041
+ t1 = /* @__PURE__ */ _jsx99(Progress2, {
50276
50042
  latestAssistantMessage: latestAssistantMessage
50277
50043
  });
50278
50044
  $[3] = latestAssistantMessage;
@@ -50298,13 +50064,13 @@ var Gui = function() {
50298
50064
  }
50299
50065
  return t2;
50300
50066
  };
50301
- function _temp13(rs) {
50067
+ function _temp12(rs) {
50302
50068
  return rs.status === "in_progress";
50303
50069
  }
50304
50070
  // src/components/markdown/MarkdownProvider/index.tsx
50305
- import { c as _c106 } from "react-compiler-runtime";
50306
- import { useMemo as useMemo25 } from "react";
50307
- import { jsx as _jsx101 } from "react/jsx-runtime";
50071
+ import { c as _c104 } from "react-compiler-runtime";
50072
+ import { useMemo as useMemo24 } from "react";
50073
+ import { jsx as _jsx100 } from "react/jsx-runtime";
50308
50074
  var _excluded7 = [
50309
50075
  "children"
50310
50076
  ];
@@ -50327,7 +50093,7 @@ function _objectWithoutPropertiesLoose7(r, e) {
50327
50093
  return t;
50328
50094
  }
50329
50095
  var MarkdownProvider = function(t0) {
50330
- var $ = _c106(9);
50096
+ var $ = _c104(9);
50331
50097
  var children;
50332
50098
  var rest;
50333
50099
  if ($[0] !== t0) {
@@ -50357,7 +50123,7 @@ var MarkdownProvider = function(t0) {
50357
50123
  var value = t1;
50358
50124
  var t3;
50359
50125
  if ($[6] !== children || $[7] !== value) {
50360
- t3 = /* @__PURE__ */ _jsx101(MarkdownContext.Provider, {
50126
+ t3 = /* @__PURE__ */ _jsx100(MarkdownContext.Provider, {
50361
50127
  value: value,
50362
50128
  children: children
50363
50129
  });
@@ -50370,18 +50136,18 @@ var MarkdownProvider = function(t0) {
50370
50136
  return t3;
50371
50137
  };
50372
50138
  // src/components/annotations/SourceAnnotation/index.tsx
50373
- import { c as _c109 } from "react-compiler-runtime";
50139
+ import { c as _c107 } from "react-compiler-runtime";
50374
50140
  // src/components/annotations/SourceAnnotation/FileCitation/index.tsx
50375
- import { c as _c108 } from "react-compiler-runtime";
50141
+ import { c as _c106 } from "react-compiler-runtime";
50376
50142
  import { useState as useState13 } from "react";
50377
50143
  import { QuoteIcon as QuoteIcon2 } from "@radix-ui/react-icons";
50378
50144
  import { Dialog, VisuallyHidden, IconButton as IconButton11 } from "@radix-ui/themes";
50379
50145
  // src/components/annotations/SourceAnnotation/FileCitation/Content.tsx
50380
- import { c as _c107 } from "react-compiler-runtime";
50146
+ import { c as _c105 } from "react-compiler-runtime";
50381
50147
  import { Flex as Flex36, Card as Card6, Inset as Inset3 } from "@radix-ui/themes";
50382
- import { jsx as _jsx102 } from "react/jsx-runtime";
50148
+ import { jsx as _jsx101 } from "react/jsx-runtime";
50383
50149
  var Content11 = function(t0) {
50384
- var $ = _c107(5);
50150
+ var $ = _c105(5);
50385
50151
  var fileId = t0.fileId;
50386
50152
  var superinterfaceContext = useSuperinterfaceContext();
50387
50153
  var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
@@ -50418,18 +50184,18 @@ var Content11 = function(t0) {
50418
50184
  }
50419
50185
  var t5;
50420
50186
  if ($[3] !== t3) {
50421
- t5 = /* @__PURE__ */ _jsx102(Flex36, {
50187
+ t5 = /* @__PURE__ */ _jsx101(Flex36, {
50422
50188
  direction: "column",
50423
50189
  flexGrow: "1",
50424
50190
  gap: "3",
50425
- children: /* @__PURE__ */ _jsx102(Card6, {
50191
+ children: /* @__PURE__ */ _jsx101(Card6, {
50426
50192
  style: t1,
50427
- children: /* @__PURE__ */ _jsx102(Inset3, {
50193
+ children: /* @__PURE__ */ _jsx101(Inset3, {
50428
50194
  clip: "padding-box",
50429
50195
  style: t2,
50430
- children: /* @__PURE__ */ _jsx102(Flex36, {
50196
+ children: /* @__PURE__ */ _jsx101(Flex36, {
50431
50197
  flexGrow: "1",
50432
- children: /* @__PURE__ */ _jsx102("embed", {
50198
+ children: /* @__PURE__ */ _jsx101("embed", {
50433
50199
  src: t3,
50434
50200
  style: t4
50435
50201
  })
@@ -50445,9 +50211,9 @@ var Content11 = function(t0) {
50445
50211
  return t5;
50446
50212
  };
50447
50213
  // src/components/annotations/SourceAnnotation/FileCitation/index.tsx
50448
- import { jsx as _jsx103, jsxs as _jsxs38, Fragment as _Fragment6 } from "react/jsx-runtime";
50214
+ import { jsx as _jsx102, jsxs as _jsxs38, Fragment as _Fragment6 } from "react/jsx-runtime";
50449
50215
  var FileCitation = function(t0) {
50450
- var $ = _c108(18);
50216
+ var $ = _c106(18);
50451
50217
  var annotation = t0.annotation;
50452
50218
  var _useState13 = _sliced_to_array(useState13(null), 2), activeFileId = _useState13[0], setActiveFileId = _useState13[1];
50453
50219
  var t1;
@@ -50462,14 +50228,14 @@ var FileCitation = function(t0) {
50462
50228
  }
50463
50229
  var t2;
50464
50230
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
50465
- t2 = /* @__PURE__ */ _jsx103(QuoteIcon2, {});
50231
+ t2 = /* @__PURE__ */ _jsx102(QuoteIcon2, {});
50466
50232
  $[2] = t2;
50467
50233
  } else {
50468
50234
  t2 = $[2];
50469
50235
  }
50470
50236
  var t3;
50471
50237
  if ($[3] !== t1) {
50472
- t3 = /* @__PURE__ */ _jsx103(IconButton11, {
50238
+ t3 = /* @__PURE__ */ _jsx102(IconButton11, {
50473
50239
  variant: "soft",
50474
50240
  color: "gray",
50475
50241
  size: "1",
@@ -50505,9 +50271,9 @@ var FileCitation = function(t0) {
50505
50271
  }
50506
50272
  var t7;
50507
50273
  if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
50508
- t7 = /* @__PURE__ */ _jsx103(VisuallyHidden, {
50274
+ t7 = /* @__PURE__ */ _jsx102(VisuallyHidden, {
50509
50275
  asChild: true,
50510
- children: /* @__PURE__ */ _jsx103(Dialog.Title, {
50276
+ children: /* @__PURE__ */ _jsx102(Dialog.Title, {
50511
50277
  children: "Source"
50512
50278
  })
50513
50279
  });
@@ -50517,7 +50283,7 @@ var FileCitation = function(t0) {
50517
50283
  }
50518
50284
  var t8;
50519
50285
  if ($[8] !== activeFileId) {
50520
- t8 = activeFileId && /* @__PURE__ */ _jsx103(Content11, {
50286
+ t8 = activeFileId && /* @__PURE__ */ _jsx102(Content11, {
50521
50287
  fileId: activeFileId
50522
50288
  });
50523
50289
  $[8] = activeFileId;
@@ -50545,7 +50311,7 @@ var FileCitation = function(t0) {
50545
50311
  }
50546
50312
  var t10;
50547
50313
  if ($[12] !== t4 || $[13] !== t9) {
50548
- t10 = /* @__PURE__ */ _jsx103(Dialog.Root, {
50314
+ t10 = /* @__PURE__ */ _jsx102(Dialog.Root, {
50549
50315
  open: t4,
50550
50316
  onOpenChange: t5,
50551
50317
  children: t9
@@ -50573,7 +50339,7 @@ var FileCitation = function(t0) {
50573
50339
  return t11;
50574
50340
  };
50575
50341
  // src/components/annotations/SourceAnnotation/index.tsx
50576
- import { jsx as _jsx104 } from "react/jsx-runtime";
50342
+ import { jsx as _jsx103 } from "react/jsx-runtime";
50577
50343
  var _excluded8 = [
50578
50344
  "children"
50579
50345
  ];
@@ -50596,7 +50362,7 @@ function _objectWithoutPropertiesLoose8(r, e) {
50596
50362
  return t;
50597
50363
  }
50598
50364
  var SourceAnnotation = function(t0) {
50599
- var $ = _c109(10);
50365
+ var $ = _c107(10);
50600
50366
  var children;
50601
50367
  var rest;
50602
50368
  if ($[0] !== t0) {
@@ -50624,7 +50390,7 @@ var SourceAnnotation = function(t0) {
50624
50390
  if (annotation.type === "file_citation") {
50625
50391
  var t2;
50626
50392
  if ($[5] !== annotation) {
50627
- t2 = /* @__PURE__ */ _jsx104(FileCitation, {
50393
+ t2 = /* @__PURE__ */ _jsx103(FileCitation, {
50628
50394
  annotation: annotation
50629
50395
  });
50630
50396
  $[5] = annotation;
@@ -50637,7 +50403,7 @@ var SourceAnnotation = function(t0) {
50637
50403
  if (annotation.type === "file_path") {
50638
50404
  var _t2;
50639
50405
  if ($[7] !== annotation || $[8] !== children) {
50640
- _t2 = /* @__PURE__ */ _jsx104(FilePathAnnotation, {
50406
+ _t2 = /* @__PURE__ */ _jsx103(FilePathAnnotation, {
50641
50407
  annotation: annotation,
50642
50408
  children: children
50643
50409
  });
@@ -50653,7 +50419,7 @@ var SourceAnnotation = function(t0) {
50653
50419
  return null;
50654
50420
  };
50655
50421
  // src/components/avatars/Avatar.tsx
50656
- import { c as _c112 } from "react-compiler-runtime";
50422
+ import { c as _c110 } from "react-compiler-runtime";
50657
50423
  // src/enums/index.ts
50658
50424
  var IconAvatarName = /* @__PURE__ */ function(IconAvatarName2) {
50659
50425
  IconAvatarName2["BACKPACK"] = "BACKPACK";
@@ -50678,7 +50444,7 @@ var AvatarType = /* @__PURE__ */ function(AvatarType2) {
50678
50444
  // src/components/avatars/Avatar.tsx
50679
50445
  import { Avatar as RadixAvatar } from "@radix-ui/themes";
50680
50446
  // src/components/imageAvatars/ImageAvatar/index.tsx
50681
- import { c as _c110 } from "react-compiler-runtime";
50447
+ import { c as _c108 } from "react-compiler-runtime";
50682
50448
  import { Avatar as Avatar4 } from "@radix-ui/themes";
50683
50449
  // src/components/imageAvatars/ImageAvatar/lib/optimizedSrc/path.ts
50684
50450
  var width = function(_ref) {
@@ -50730,9 +50496,9 @@ var optimizedSrc = function(_ref) {
50730
50496
  }));
50731
50497
  };
50732
50498
  // src/components/imageAvatars/ImageAvatar/index.tsx
50733
- import { jsx as _jsx105 } from "react/jsx-runtime";
50499
+ import { jsx as _jsx104 } from "react/jsx-runtime";
50734
50500
  var ImageAvatar = function(t0) {
50735
- var $ = _c110(9);
50501
+ var $ = _c108(9);
50736
50502
  var imageAvatar = t0.imageAvatar, size = t0.size, className = t0.className, style = t0.style;
50737
50503
  var superinterfaceContext = useSuperinterfaceContext();
50738
50504
  var t1;
@@ -50751,7 +50517,7 @@ var ImageAvatar = function(t0) {
50751
50517
  }
50752
50518
  var t2;
50753
50519
  if ($[4] !== className || $[5] !== size || $[6] !== style || $[7] !== t1) {
50754
- t2 = /* @__PURE__ */ _jsx105(Avatar4, {
50520
+ t2 = /* @__PURE__ */ _jsx104(Avatar4, {
50755
50521
  className: className,
50756
50522
  style: style,
50757
50523
  fallback: "",
@@ -50769,24 +50535,24 @@ var ImageAvatar = function(t0) {
50769
50535
  return t2;
50770
50536
  };
50771
50537
  // src/components/iconAvatars/IconAvatar.tsx
50772
- import { c as _c111 } from "react-compiler-runtime";
50773
- import { useMemo as useMemo26 } from "react";
50538
+ import { c as _c109 } from "react-compiler-runtime";
50539
+ import { useMemo as useMemo25 } from "react";
50774
50540
  import { Avatar as Avatar5 } from "@radix-ui/themes";
50775
50541
  // src/lib/iconAvatars/iconAvatarComponents.ts
50776
50542
  import { BackpackIcon, RocketIcon, MagicWandIcon, CubeIcon, TargetIcon, DiscIcon, GlobeIcon, StarIcon, LightningBoltIcon as LightningBoltIcon2, FaceIcon, PersonIcon as PersonIcon2, HeartIcon } from "@radix-ui/react-icons";
50777
50543
  var _obj;
50778
50544
  var iconAvatarComponents = (_obj = {}, _define_property(_obj, IconAvatarName.BACKPACK, BackpackIcon), _define_property(_obj, IconAvatarName.ROCKET, RocketIcon), _define_property(_obj, IconAvatarName.MAGIC_WAND, MagicWandIcon), _define_property(_obj, IconAvatarName.CUBE, CubeIcon), _define_property(_obj, IconAvatarName.TARGET, TargetIcon), _define_property(_obj, IconAvatarName.DISC, DiscIcon), _define_property(_obj, IconAvatarName.GLOBE, GlobeIcon), _define_property(_obj, IconAvatarName.STAR, StarIcon), _define_property(_obj, IconAvatarName.LIGHTNING_BOLT, LightningBoltIcon2), _define_property(_obj, IconAvatarName.FACE, FaceIcon), _define_property(_obj, IconAvatarName.PERSON, PersonIcon2), _define_property(_obj, IconAvatarName.HEART, HeartIcon), _obj);
50779
50545
  // src/components/iconAvatars/IconAvatar.tsx
50780
- import { jsx as _jsx106 } from "react/jsx-runtime";
50546
+ import { jsx as _jsx105 } from "react/jsx-runtime";
50781
50547
  var IconAvatar = function(t0) {
50782
- var $ = _c111(7);
50548
+ var $ = _c109(7);
50783
50549
  var iconAvatar = t0.iconAvatar, size = t0.size, className = t0.className, style = t0.style;
50784
50550
  var t1;
50785
50551
  t1 = iconAvatarComponents[iconAvatar.name];
50786
50552
  var Component2 = t1;
50787
50553
  var t2;
50788
50554
  if ($[0] !== Component2) {
50789
- t2 = Component2 ? /* @__PURE__ */ _jsx106(Component2, {}) : "";
50555
+ t2 = Component2 ? /* @__PURE__ */ _jsx105(Component2, {}) : "";
50790
50556
  $[0] = Component2;
50791
50557
  $[1] = t2;
50792
50558
  } else {
@@ -50794,7 +50560,7 @@ var IconAvatar = function(t0) {
50794
50560
  }
50795
50561
  var t3;
50796
50562
  if ($[2] !== className || $[3] !== size || $[4] !== style || $[5] !== t2) {
50797
- t3 = /* @__PURE__ */ _jsx106(Avatar5, {
50563
+ t3 = /* @__PURE__ */ _jsx105(Avatar5, {
50798
50564
  className: className,
50799
50565
  style: style,
50800
50566
  size: size,
@@ -50811,16 +50577,16 @@ var IconAvatar = function(t0) {
50811
50577
  return t3;
50812
50578
  };
50813
50579
  // src/components/avatars/Avatar.tsx
50814
- import { jsx as _jsx107 } from "react/jsx-runtime";
50580
+ import { jsx as _jsx106 } from "react/jsx-runtime";
50815
50581
  var Avatar6 = function(t0) {
50816
- var $ = _c112(14);
50582
+ var $ = _c110(14);
50817
50583
  var avatar = t0.avatar, t1 = t0.size, className = t0.className, style = t0.style;
50818
50584
  var size = t1 === void 0 ? "1" : t1;
50819
50585
  if (avatar) {
50820
50586
  if (avatar.type === AvatarType.IMAGE && avatar.imageAvatar) {
50821
50587
  var _t;
50822
50588
  if ($[0] !== avatar.imageAvatar || $[1] !== className || $[2] !== size || $[3] !== style) {
50823
- _t = /* @__PURE__ */ _jsx107(ImageAvatar, {
50589
+ _t = /* @__PURE__ */ _jsx106(ImageAvatar, {
50824
50590
  imageAvatar: avatar.imageAvatar,
50825
50591
  size: size,
50826
50592
  className: className,
@@ -50839,7 +50605,7 @@ var Avatar6 = function(t0) {
50839
50605
  if (avatar.type === AvatarType.ICON && avatar.iconAvatar) {
50840
50606
  var _t2;
50841
50607
  if ($[5] !== avatar.iconAvatar || $[6] !== className || $[7] !== size || $[8] !== style) {
50842
- _t2 = /* @__PURE__ */ _jsx107(IconAvatar, {
50608
+ _t2 = /* @__PURE__ */ _jsx106(IconAvatar, {
50843
50609
  iconAvatar: avatar.iconAvatar,
50844
50610
  size: size,
50845
50611
  className: className,
@@ -50858,7 +50624,7 @@ var Avatar6 = function(t0) {
50858
50624
  }
50859
50625
  var t2;
50860
50626
  if ($[10] !== className || $[11] !== size || $[12] !== style) {
50861
- t2 = /* @__PURE__ */ _jsx107(RadixAvatar, {
50627
+ t2 = /* @__PURE__ */ _jsx106(RadixAvatar, {
50862
50628
  fallback: "",
50863
50629
  size: size,
50864
50630
  className: className,
@@ -50874,9 +50640,9 @@ var Avatar6 = function(t0) {
50874
50640
  return t2;
50875
50641
  };
50876
50642
  // src/components/components/ComponentsProvider.tsx
50877
- import { c as _c113 } from "react-compiler-runtime";
50878
- import { useMemo as useMemo27 } from "react";
50879
- import { jsx as _jsx108 } from "react/jsx-runtime";
50643
+ import { c as _c111 } from "react-compiler-runtime";
50644
+ import { useMemo as useMemo26 } from "react";
50645
+ import { jsx as _jsx107 } from "react/jsx-runtime";
50880
50646
  var _excluded9 = [
50881
50647
  "children"
50882
50648
  ];
@@ -50899,7 +50665,7 @@ function _objectWithoutPropertiesLoose9(r, e) {
50899
50665
  return t;
50900
50666
  }
50901
50667
  var ComponentsProvider = function(t0) {
50902
- var $ = _c113(9);
50668
+ var $ = _c111(9);
50903
50669
  var children;
50904
50670
  var rest;
50905
50671
  if ($[0] !== t0) {
@@ -50929,7 +50695,7 @@ var ComponentsProvider = function(t0) {
50929
50695
  var value = t1;
50930
50696
  var t3;
50931
50697
  if ($[6] !== children || $[7] !== value) {
50932
- t3 = /* @__PURE__ */ _jsx108(ComponentsContext.Provider, {
50698
+ t3 = /* @__PURE__ */ _jsx107(ComponentsContext.Provider, {
50933
50699
  value: value,
50934
50700
  children: children
50935
50701
  });
@@ -50942,11 +50708,11 @@ var ComponentsProvider = function(t0) {
50942
50708
  return t3;
50943
50709
  };
50944
50710
  // src/components/assistants/AssistantProvider/index.tsx
50945
- import { c as _c114 } from "react-compiler-runtime";
50946
- import { jsx as _jsx109 } from "react/jsx-runtime";
50711
+ import { c as _c112 } from "react-compiler-runtime";
50712
+ import { jsx as _jsx108 } from "react/jsx-runtime";
50947
50713
  var AssistantProvider = function(t0) {
50948
50714
  var _assistant$name;
50949
- var $ = _c114(10);
50715
+ var $ = _c112(10);
50950
50716
  var children = t0.children;
50951
50717
  var superinterfaceContext = useSuperinterfaceContext();
50952
50718
  var t1;
@@ -50964,7 +50730,7 @@ var AssistantProvider = function(t0) {
50964
50730
  var t3 = assistant === null || assistant === void 0 ? void 0 : assistant.avatar;
50965
50731
  var t4;
50966
50732
  if ($[2] !== t3) {
50967
- t4 = /* @__PURE__ */ _jsx109(Avatar6, {
50733
+ t4 = /* @__PURE__ */ _jsx108(Avatar6, {
50968
50734
  avatar: t3
50969
50735
  });
50970
50736
  $[2] = t3;
@@ -50974,7 +50740,7 @@ var AssistantProvider = function(t0) {
50974
50740
  }
50975
50741
  var t5;
50976
50742
  if ($[4] !== children || $[5] !== t4) {
50977
- t5 = /* @__PURE__ */ _jsx109(AssistantAvatarContext.Provider, {
50743
+ t5 = /* @__PURE__ */ _jsx108(AssistantAvatarContext.Provider, {
50978
50744
  value: t4,
50979
50745
  children: children
50980
50746
  });
@@ -50986,7 +50752,7 @@ var AssistantProvider = function(t0) {
50986
50752
  }
50987
50753
  var t6;
50988
50754
  if ($[7] !== t2 || $[8] !== t5) {
50989
- t6 = /* @__PURE__ */ _jsx109(AssistantNameContext.Provider, {
50755
+ t6 = /* @__PURE__ */ _jsx108(AssistantNameContext.Provider, {
50990
50756
  value: t2,
50991
50757
  children: t5
50992
50758
  });