@superinterface/react 5.2.3-beta.1 → 5.2.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -365,7 +365,7 @@ var require_lib = __commonJS({
365
365
  Object.defineProperty(exports2, "__esModule", {
366
366
  value: true
367
367
  });
368
- function _objectWithoutPropertiesLoose10(r, e) {
368
+ function _objectWithoutPropertiesLoose11(r, e) {
369
369
  if (null == r) return {};
370
370
  var t = {};
371
371
  for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
@@ -732,7 +732,7 @@ var require_lib = __commonJS({
732
732
  PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
733
733
  PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
734
734
  });
735
- var _excluded10 = [
735
+ var _excluded11 = [
736
736
  "message"
737
737
  ];
738
738
  function defineHidden(obj, key2, value) {
@@ -807,7 +807,7 @@ var require_lib = __commonJS({
807
807
  }
808
808
  } : typeof template === "function" ? {
809
809
  message: template
810
- } : template, message = _ref.message, rest = _objectWithoutPropertiesLoose10(_ref, _excluded10);
810
+ } : template, message = _ref.message, rest = _objectWithoutPropertiesLoose11(_ref, _excluded11);
811
811
  var toMessage = typeof message === "string" ? function() {
812
812
  return message;
813
813
  } : message;
@@ -37220,7 +37220,7 @@ var SuperinterfaceProvider = function(_ref) {
37220
37220
  });
37221
37221
  };
37222
37222
  // src/components/threads/Thread/index.tsx
37223
- var import_react_compiler_runtime78 = require("react-compiler-runtime");
37223
+ var import_react_compiler_runtime79 = require("react-compiler-runtime");
37224
37224
  // src/components/threads/Thread/Messages/index.tsx
37225
37225
  var import_react_compiler_runtime66 = require("react-compiler-runtime");
37226
37226
  var import_themes45 = require("@radix-ui/themes");
@@ -44091,7 +44091,7 @@ Messages2.Message = Message;
44091
44091
  Messages2.NextPageSkeleton = NextPageSkeleton;
44092
44092
  Messages2.Content = Content7;
44093
44093
  // src/components/threads/Thread/MessageForm/index.tsx
44094
- var import_react_compiler_runtime74 = require("react-compiler-runtime");
44094
+ var import_react_compiler_runtime75 = require("react-compiler-runtime");
44095
44095
  // src/components/threads/Thread/MessageForm/Submit/index.tsx
44096
44096
  var import_react_compiler_runtime67 = require("react-compiler-runtime");
44097
44097
  var import_react_icons11 = require("@radix-ui/react-icons");
@@ -44266,12 +44266,32 @@ Submit.Root = Root7;
44266
44266
  Submit.Button = Button3;
44267
44267
  // src/components/threads/Thread/MessageForm/Root/index.tsx
44268
44268
  var import_react_query6 = require("@tanstack/react-query");
44269
- var import_react52 = require("react");
44270
- var import_react_hook_form = require("react-hook-form");
44271
- // src/lib/reactHookForm/FormProvider.tsx
44269
+ var import_react53 = require("react");
44270
+ // src/components/forms/FormProvider.tsx
44272
44271
  var import_react_compiler_runtime68 = require("react-compiler-runtime");
44273
44272
  var import_react51 = require("react");
44274
44273
  var import_jsx_runtime69 = require("react/jsx-runtime");
44274
+ var _excluded3 = [
44275
+ "children"
44276
+ ];
44277
+ function _objectWithoutProperties3(e, t) {
44278
+ if (null == e) return {};
44279
+ var o, r, i = _objectWithoutPropertiesLoose3(e, t);
44280
+ if (Object.getOwnPropertySymbols) {
44281
+ var n = Object.getOwnPropertySymbols(e);
44282
+ for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
44283
+ }
44284
+ return i;
44285
+ }
44286
+ function _objectWithoutPropertiesLoose3(r, e) {
44287
+ if (null == r) return {};
44288
+ var t = {};
44289
+ for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
44290
+ if (-1 !== e.indexOf(n)) continue;
44291
+ t[n] = r[n];
44292
+ }
44293
+ return t;
44294
+ }
44275
44295
  var FormContext = /* @__PURE__ */ (0, import_react51.createContext)(null);
44276
44296
  var useFormContext = function() {
44277
44297
  var value = (0, import_react51.useContext)(FormContext);
@@ -44281,40 +44301,387 @@ var useFormContext = function() {
44281
44301
  return value;
44282
44302
  };
44283
44303
  var FormProvider = function(t0) {
44284
- var $ = (0, import_react_compiler_runtime68.c)(3);
44285
- var children = t0.children, form = t0.form;
44304
+ var $ = (0, import_react_compiler_runtime68.c)(6);
44305
+ var children;
44306
+ var form;
44307
+ if ($[0] !== t0) {
44308
+ var _t = t0;
44309
+ children = _t.children;
44310
+ form = _objectWithoutProperties3(_t, _excluded3);
44311
+ _t;
44312
+ $[0] = t0;
44313
+ $[1] = children;
44314
+ $[2] = form;
44315
+ } else {
44316
+ children = $[1];
44317
+ form = $[2];
44318
+ }
44286
44319
  var t1;
44287
44320
  t1 = form;
44288
44321
  var contextValue = t1;
44289
44322
  var t2;
44290
- if ($[0] !== children || $[1] !== contextValue) {
44323
+ if ($[3] !== children || $[4] !== contextValue) {
44291
44324
  t2 = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(FormContext.Provider, {
44292
44325
  value: contextValue,
44293
44326
  children: children
44294
44327
  });
44295
- $[0] = children;
44296
- $[1] = contextValue;
44297
- $[2] = t2;
44328
+ $[3] = children;
44329
+ $[4] = contextValue;
44330
+ $[5] = t2;
44298
44331
  } else {
44299
- t2 = $[2];
44332
+ t2 = $[5];
44300
44333
  }
44301
44334
  return t2;
44302
44335
  };
44336
+ // src/hooks/forms/useForm.ts
44337
+ var import_react_compiler_runtime69 = require("react-compiler-runtime");
44338
+ var import_react52 = require("react");
44339
+ function asyncGeneratorStep6(n, t, e, r, o, a, c) {
44340
+ try {
44341
+ var i = n[a](c), u = i.value;
44342
+ } catch (n2) {
44343
+ return void e(n2);
44344
+ }
44345
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
44346
+ }
44347
+ function _asyncToGenerator6(n) {
44348
+ return function() {
44349
+ var t = this, e = arguments;
44350
+ return new Promise(function(r, o) {
44351
+ var a = n.apply(t, e);
44352
+ function _next(n2) {
44353
+ asyncGeneratorStep6(a, r, o, _next, _throw, "next", n2);
44354
+ }
44355
+ function _throw(n2) {
44356
+ asyncGeneratorStep6(a, r, o, _next, _throw, "throw", n2);
44357
+ }
44358
+ _next(void 0);
44359
+ });
44360
+ };
44361
+ }
44362
+ function ownKeys30(e, r) {
44363
+ var t = Object.keys(e);
44364
+ if (Object.getOwnPropertySymbols) {
44365
+ var o = Object.getOwnPropertySymbols(e);
44366
+ r && (o = o.filter(function(r2) {
44367
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
44368
+ })), t.push.apply(t, o);
44369
+ }
44370
+ return t;
44371
+ }
44372
+ function _objectSpread30(e) {
44373
+ for(var r = 1; r < arguments.length; r++){
44374
+ var t = null != arguments[r] ? arguments[r] : {};
44375
+ r % 2 ? ownKeys30(Object(t), true).forEach(function(r2) {
44376
+ _defineProperty30(e, r2, t[r2]);
44377
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys30(Object(t)).forEach(function(r2) {
44378
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
44379
+ });
44380
+ }
44381
+ return e;
44382
+ }
44383
+ function _defineProperty30(e, r, t) {
44384
+ return (r = _toPropertyKey30(r)) in e ? Object.defineProperty(e, r, {
44385
+ value: t,
44386
+ enumerable: true,
44387
+ configurable: true,
44388
+ writable: true
44389
+ }) : e[r] = t, e;
44390
+ }
44391
+ function _toPropertyKey30(t) {
44392
+ var i = _toPrimitive30(t, "string");
44393
+ return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
44394
+ }
44395
+ function _toPrimitive30(t, r) {
44396
+ if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
44397
+ var e = t[Symbol.toPrimitive];
44398
+ if (void 0 !== e) {
44399
+ var i = e.call(t, r || "default");
44400
+ if ("object" != (typeof i === "undefined" ? "undefined" : _type_of(i))) return i;
44401
+ throw new TypeError("@@toPrimitive must return a primitive value.");
44402
+ }
44403
+ return ("string" === r ? String : Number)(t);
44404
+ }
44405
+ var createInitialFormState = function() {
44406
+ return {
44407
+ isSubmitting: false,
44408
+ errors: {}
44409
+ };
44410
+ };
44411
+ var getValueFromEvent = function(event) {
44412
+ if (!event) return event;
44413
+ if (event.target) {
44414
+ var target = event.target;
44415
+ if (target.type === "checkbox") {
44416
+ return target.checked;
44417
+ }
44418
+ return target.value;
44419
+ }
44420
+ return event;
44421
+ };
44422
+ var useForm = function(t0) {
44423
+ var $ = (0, import_react_compiler_runtime69.c)(18);
44424
+ var t1;
44425
+ if ($[0] !== t0) {
44426
+ t1 = t0 === void 0 ? {} : t0;
44427
+ $[0] = t0;
44428
+ $[1] = t1;
44429
+ } else {
44430
+ t1 = $[1];
44431
+ }
44432
+ var options = t1;
44433
+ var defaultValues = options.defaultValues, resolver = options.resolver;
44434
+ var t2;
44435
+ if ($[2] !== defaultValues) {
44436
+ t2 = defaultValues !== null && defaultValues !== void 0 ? defaultValues : {};
44437
+ $[2] = defaultValues;
44438
+ $[3] = t2;
44439
+ } else {
44440
+ t2 = $[3];
44441
+ }
44442
+ var _ref = _sliced_to_array((0, import_react52.useState)(t2), 2), valuesState = _ref[0], setValuesState = _ref[1];
44443
+ var valuesRef = (0, import_react52.useRef)(valuesState);
44444
+ var t3;
44445
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
44446
+ t3 = createInitialFormState();
44447
+ $[4] = t3;
44448
+ } else {
44449
+ t3 = $[4];
44450
+ }
44451
+ var _ref1 = _sliced_to_array((0, import_react52.useState)(t3), 2), formState = _ref1[0], setFormState = _ref1[1];
44452
+ var t4;
44453
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
44454
+ t4 = function(name, value) {
44455
+ valuesRef.current = _objectSpread30(_objectSpread30({}, valuesRef.current), {}, _define_property({}, name, value));
44456
+ setValuesState(valuesRef.current);
44457
+ };
44458
+ $[5] = t4;
44459
+ } else {
44460
+ t4 = $[5];
44461
+ }
44462
+ var setValue = t4;
44463
+ var t5;
44464
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
44465
+ t5 = function(name_0) {
44466
+ var _valuesRef$current$na;
44467
+ return {
44468
+ name: name_0,
44469
+ value: (_valuesRef$current$na = valuesRef.current[name_0]) !== null && _valuesRef$current$na !== void 0 ? _valuesRef$current$na : "",
44470
+ onChange: function(event) {
44471
+ setValue(name_0, getValueFromEvent(event));
44472
+ },
44473
+ onBlur: _temp4,
44474
+ ref: _temp23
44475
+ };
44476
+ };
44477
+ $[6] = t5;
44478
+ } else {
44479
+ t5 = $[6];
44480
+ }
44481
+ var register = t5;
44482
+ var t6;
44483
+ if ($[7] !== resolver) {
44484
+ t6 = /* @__PURE__ */ function() {
44485
+ var _ref = _asyncToGenerator6(function() {
44486
+ var _result$values, _result$errors, result;
44487
+ return _ts_generator(this, function(_state) {
44488
+ switch(_state.label){
44489
+ case 0:
44490
+ if (!resolver) {
44491
+ return [
44492
+ 2,
44493
+ {
44494
+ values: valuesRef.current,
44495
+ errors: {}
44496
+ }
44497
+ ];
44498
+ }
44499
+ return [
44500
+ 4,
44501
+ resolver(valuesRef.current)
44502
+ ];
44503
+ case 1:
44504
+ result = _state.sent();
44505
+ return [
44506
+ 2,
44507
+ {
44508
+ values: (_result$values = result.values) !== null && _result$values !== void 0 ? _result$values : valuesRef.current,
44509
+ errors: (_result$errors = result.errors) !== null && _result$errors !== void 0 ? _result$errors : {}
44510
+ }
44511
+ ];
44512
+ }
44513
+ });
44514
+ });
44515
+ return function t62() {
44516
+ return _ref.apply(this, arguments);
44517
+ };
44518
+ }();
44519
+ $[7] = resolver;
44520
+ $[8] = t6;
44521
+ } else {
44522
+ t6 = $[8];
44523
+ }
44524
+ var runResolver = t6;
44525
+ var t7;
44526
+ if ($[9] !== runResolver) {
44527
+ t7 = function(onValid) {
44528
+ return /* @__PURE__ */ function() {
44529
+ var _ref2 = _asyncToGenerator6(function(event_0) {
44530
+ var _event_0$preventDefau, _ref, values, errors, hasErrors;
44531
+ return _ts_generator(this, function(_state) {
44532
+ switch(_state.label){
44533
+ case 0:
44534
+ event_0 === null || event_0 === void 0 || (_event_0$preventDefau = event_0.preventDefault) === null || _event_0$preventDefau === void 0 || _event_0$preventDefau.call(event_0);
44535
+ setFormState(_temp32);
44536
+ return [
44537
+ 4,
44538
+ runResolver()
44539
+ ];
44540
+ case 1:
44541
+ _ref = _state.sent(), values = _ref.values, errors = _ref.errors;
44542
+ setFormState({
44543
+ isSubmitting: false,
44544
+ errors: errors
44545
+ });
44546
+ hasErrors = Object.keys(errors).length > 0;
44547
+ if (hasErrors) {
44548
+ return [
44549
+ 2
44550
+ ];
44551
+ }
44552
+ valuesRef.current = values;
44553
+ setValuesState(values);
44554
+ return [
44555
+ 4,
44556
+ onValid(values)
44557
+ ];
44558
+ case 2:
44559
+ _state.sent();
44560
+ return [
44561
+ 2
44562
+ ];
44563
+ }
44564
+ });
44565
+ });
44566
+ return function(_x) {
44567
+ return _ref2.apply(this, arguments);
44568
+ };
44569
+ }();
44570
+ };
44571
+ $[9] = runResolver;
44572
+ $[10] = t7;
44573
+ } else {
44574
+ t7 = $[10];
44575
+ }
44576
+ var handleSubmit = t7;
44577
+ var t8;
44578
+ if ($[11] !== defaultValues) {
44579
+ t8 = function(nextValues) {
44580
+ var merged = nextValues ? _objectSpread30({}, nextValues) : _objectSpread30({}, defaultValues !== null && defaultValues !== void 0 ? defaultValues : {});
44581
+ valuesRef.current = merged;
44582
+ setValuesState(merged);
44583
+ setFormState(createInitialFormState());
44584
+ };
44585
+ $[11] = defaultValues;
44586
+ $[12] = t8;
44587
+ } else {
44588
+ t8 = $[12];
44589
+ }
44590
+ var reset = t8;
44591
+ var t9;
44592
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
44593
+ t9 = function(name_1) {
44594
+ var _valuesRef$current$na2;
44595
+ return (_valuesRef$current$na2 = valuesRef.current[name_1]) !== null && _valuesRef$current$na2 !== void 0 ? _valuesRef$current$na2 : "";
44596
+ };
44597
+ $[13] = t9;
44598
+ } else {
44599
+ t9 = $[13];
44600
+ }
44601
+ var watch = t9;
44602
+ var t10;
44603
+ var t11;
44604
+ if ($[14] !== formState || $[15] !== handleSubmit || $[16] !== reset) {
44605
+ t11 = {
44606
+ register: register,
44607
+ handleSubmit: handleSubmit,
44608
+ reset: reset,
44609
+ watch: watch,
44610
+ formState: formState
44611
+ };
44612
+ $[14] = formState;
44613
+ $[15] = handleSubmit;
44614
+ $[16] = reset;
44615
+ $[17] = t11;
44616
+ } else {
44617
+ t11 = $[17];
44618
+ }
44619
+ t10 = t11;
44620
+ return t10;
44621
+ };
44622
+ function _temp4() {}
44623
+ function _temp23() {}
44624
+ function _temp32(prev) {
44625
+ return _objectSpread30(_objectSpread30({}, prev), {}, {
44626
+ isSubmitting: true
44627
+ });
44628
+ }
44303
44629
  // src/components/threads/Thread/MessageForm/Root/index.tsx
44304
44630
  var import_themes47 = require("@radix-ui/themes");
44305
44631
  // src/components/threads/Thread/MessageForm/Root/lib/formOptions.ts
44306
44632
  var import_zod = require("zod");
44307
- var import_zod2 = require("@hookform/resolvers/zod");
44633
+ // src/lib/forms/resolvers/zod.ts
44634
+ var zodResolver = function(schema2) {
44635
+ return function(values) {
44636
+ var result = schema2.safeParse(values);
44637
+ if (result.success) {
44638
+ return {
44639
+ values: result.data,
44640
+ errors: {}
44641
+ };
44642
+ }
44643
+ var errors = {};
44644
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
44645
+ try {
44646
+ for(var _iterator = result.error.issues[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
44647
+ var issue = _step.value;
44648
+ if (!issue.path.length) continue;
44649
+ var key2 = issue.path.join(".");
44650
+ errors[key2] = {
44651
+ message: issue.message
44652
+ };
44653
+ }
44654
+ } catch (err) {
44655
+ _didIteratorError = true;
44656
+ _iteratorError = err;
44657
+ } finally{
44658
+ try {
44659
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
44660
+ _iterator.return();
44661
+ }
44662
+ } finally{
44663
+ if (_didIteratorError) {
44664
+ throw _iteratorError;
44665
+ }
44666
+ }
44667
+ }
44668
+ return {
44669
+ values: values,
44670
+ errors: errors
44671
+ };
44672
+ };
44673
+ };
44674
+ // src/components/threads/Thread/MessageForm/Root/lib/formOptions.ts
44308
44675
  var schema = import_zod.z.object({
44309
44676
  content: import_zod.z.string().min(1)
44310
44677
  });
44311
44678
  var formOptions = {
44312
- resolver: (0, import_zod2.zodResolver)(schema)
44679
+ resolver: zodResolver(schema)
44313
44680
  };
44314
44681
  // src/components/threads/Thread/MessageForm/Root/index.tsx
44315
44682
  var import_radash14 = require("radash");
44316
44683
  var import_jsx_runtime70 = require("react/jsx-runtime");
44317
- function ownKeys30(e, r) {
44684
+ function ownKeys31(e, r) {
44318
44685
  var t = Object.keys(e);
44319
44686
  if (Object.getOwnPropertySymbols) {
44320
44687
  var o = Object.getOwnPropertySymbols(e);
@@ -44324,30 +44691,30 @@ function ownKeys30(e, r) {
44324
44691
  }
44325
44692
  return t;
44326
44693
  }
44327
- function _objectSpread30(e) {
44694
+ function _objectSpread31(e) {
44328
44695
  for(var r = 1; r < arguments.length; r++){
44329
44696
  var t = null != arguments[r] ? arguments[r] : {};
44330
- r % 2 ? ownKeys30(Object(t), true).forEach(function(r2) {
44331
- _defineProperty30(e, r2, t[r2]);
44332
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys30(Object(t)).forEach(function(r2) {
44697
+ r % 2 ? ownKeys31(Object(t), true).forEach(function(r2) {
44698
+ _defineProperty31(e, r2, t[r2]);
44699
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys31(Object(t)).forEach(function(r2) {
44333
44700
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
44334
44701
  });
44335
44702
  }
44336
44703
  return e;
44337
44704
  }
44338
- function _defineProperty30(e, r, t) {
44339
- return (r = _toPropertyKey30(r)) in e ? Object.defineProperty(e, r, {
44705
+ function _defineProperty31(e, r, t) {
44706
+ return (r = _toPropertyKey31(r)) in e ? Object.defineProperty(e, r, {
44340
44707
  value: t,
44341
44708
  enumerable: true,
44342
44709
  configurable: true,
44343
44710
  writable: true
44344
44711
  }) : e[r] = t, e;
44345
44712
  }
44346
- function _toPropertyKey30(t) {
44347
- var i = _toPrimitive30(t, "string");
44713
+ function _toPropertyKey31(t) {
44714
+ var i = _toPrimitive31(t, "string");
44348
44715
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
44349
44716
  }
44350
- function _toPrimitive30(t, r) {
44717
+ function _toPrimitive31(t, r) {
44351
44718
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
44352
44719
  var e = t[Symbol.toPrimitive];
44353
44720
  if (void 0 !== e) {
@@ -44357,7 +44724,7 @@ function _toPrimitive30(t, r) {
44357
44724
  }
44358
44725
  return ("string" === r ? String : Number)(t);
44359
44726
  }
44360
- function asyncGeneratorStep6(n, t, e, r, o, a, c) {
44727
+ function asyncGeneratorStep7(n, t, e, r, o, a, c) {
44361
44728
  try {
44362
44729
  var i = n[a](c), u = i.value;
44363
44730
  } catch (n2) {
@@ -44365,16 +44732,16 @@ function asyncGeneratorStep6(n, t, e, r, o, a, c) {
44365
44732
  }
44366
44733
  i.done ? t(u) : Promise.resolve(u).then(r, o);
44367
44734
  }
44368
- function _asyncToGenerator6(n) {
44735
+ function _asyncToGenerator7(n) {
44369
44736
  return function() {
44370
44737
  var t = this, e = arguments;
44371
44738
  return new Promise(function(r, o) {
44372
44739
  var a = n.apply(t, e);
44373
44740
  function _next(n2) {
44374
- asyncGeneratorStep6(a, r, o, _next, _throw, "next", n2);
44741
+ asyncGeneratorStep7(a, r, o, _next, _throw, "next", n2);
44375
44742
  }
44376
44743
  function _throw(n2) {
44377
- asyncGeneratorStep6(a, r, o, _next, _throw, "throw", n2);
44744
+ asyncGeneratorStep7(a, r, o, _next, _throw, "throw", n2);
44378
44745
  }
44379
44746
  _next(void 0);
44380
44747
  });
@@ -44383,8 +44750,8 @@ function _asyncToGenerator6(n) {
44383
44750
  var Root8 = function(_ref) {
44384
44751
  "use no memo";
44385
44752
  var children = _ref.children, onSubmitArg = _ref.onSubmit, isDisabledArg = _ref.isDisabled, style = _ref.style, className = _ref.className;
44386
- var _$_ref = _sliced_to_array((0, import_react52.useState)([]), 2), files = _$_ref[0], setFiles = _$_ref[1];
44387
- var formProps = (0, import_react_hook_form.useForm)(formOptions);
44753
+ var _$_ref = _sliced_to_array((0, import_react53.useState)([]), 2), files = _$_ref[0], setFiles = _$_ref[1];
44754
+ var formProps = useForm(formOptions);
44388
44755
  var handleSubmit = formProps.handleSubmit, isSubmitting = formProps.formState.isSubmitting, formReset = formProps.reset, watch = formProps.watch;
44389
44756
  var addToast = useToasts().addToast;
44390
44757
  var queryClient = (0, import_react_query6.useQueryClient)();
@@ -44397,7 +44764,7 @@ var Root8 = function(_ref) {
44397
44764
  })
44398
44765
  }).createMessage;
44399
44766
  var isMutatingMessage = useIsMutatingMessage();
44400
- var isFileLoading = (0, import_react52.useMemo)(function() {
44767
+ var isFileLoading = (0, import_react53.useMemo)(function() {
44401
44768
  return files.some(function(file) {
44402
44769
  return isOptimistic({
44403
44770
  id: file.id
@@ -44406,21 +44773,21 @@ var Root8 = function(_ref) {
44406
44773
  }, [
44407
44774
  files
44408
44775
  ]);
44409
- var isLoading = (0, import_react52.useMemo)(function() {
44776
+ var isLoading = (0, import_react53.useMemo)(function() {
44410
44777
  return isMutatingMessage || isSubmitting;
44411
44778
  }, [
44412
44779
  isMutatingMessage,
44413
44780
  isSubmitting
44414
44781
  ]);
44415
44782
  var latestMessage = useLatestMessage().latestMessage;
44416
- var isDisabled = (0, import_react52.useMemo)(function() {
44783
+ var isDisabled = (0, import_react53.useMemo)(function() {
44417
44784
  var _latestMessage$metada;
44418
44785
  return !!(latestMessage !== null && latestMessage !== void 0 && (_latestMessage$metada = latestMessage.metadata) !== null && _latestMessage$metada !== void 0 && _latestMessage$metada.isBlocking) || !!isDisabledArg;
44419
44786
  }, [
44420
44787
  latestMessage,
44421
44788
  isDisabledArg
44422
44789
  ]);
44423
- var reset = (0, import_react52.useCallback)(function() {
44790
+ var reset = (0, import_react53.useCallback)(function() {
44424
44791
  formReset();
44425
44792
  setFiles([]);
44426
44793
  }, [
@@ -44431,7 +44798,7 @@ var Root8 = function(_ref) {
44431
44798
  createMessage: createMessage,
44432
44799
  files: files
44433
44800
  }) : /* @__PURE__ */ function() {
44434
- var _ref2 = _asyncToGenerator6(function(data2) {
44801
+ var _ref2 = _asyncToGenerator7(function(data2) {
44435
44802
  var attachments, imageFileContentParts, content2;
44436
44803
  return _ts_generator(this, function(_state) {
44437
44804
  switch(_state.label){
@@ -44476,7 +44843,7 @@ var Root8 = function(_ref) {
44476
44843
  ]);
44477
44844
  return [
44478
44845
  4,
44479
- createMessage(_objectSpread30({
44846
+ createMessage(_objectSpread31({
44480
44847
  content: content2
44481
44848
  }, attachments.length ? {
44482
44849
  attachments: attachments
@@ -44504,8 +44871,7 @@ var Root8 = function(_ref) {
44504
44871
  isFileLoading: isFileLoading,
44505
44872
  content: content_0
44506
44873
  },
44507
- children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FormProvider, {
44508
- form: formProps,
44874
+ children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FormProvider, _objectSpread31(_objectSpread31({}, formProps), {}, {
44509
44875
  children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_themes47.Box, {
44510
44876
  asChild: true,
44511
44877
  flexShrink: "0",
@@ -44516,35 +44882,35 @@ var Root8 = function(_ref) {
44516
44882
  children: children
44517
44883
  })
44518
44884
  })
44519
- })
44885
+ }))
44520
44886
  });
44521
44887
  };
44522
44888
  // src/components/threads/Thread/MessageForm/Field/index.tsx
44523
44889
  var import_themes51 = require("@radix-ui/themes");
44524
44890
  // src/components/threads/Thread/MessageForm/Field/Control.tsx
44525
- var import_react_compiler_runtime70 = require("react-compiler-runtime");
44891
+ var import_react_compiler_runtime71 = require("react-compiler-runtime");
44526
44892
  var import_themes48 = require("@radix-ui/themes");
44527
44893
  // src/hooks/misc/usePrevious.ts
44528
- var import_react53 = require("react");
44894
+ var import_react54 = require("react");
44529
44895
  var usePrevious = function(state) {
44530
- var ref = (0, import_react53.useRef)(void 0);
44531
- (0, import_react53.useEffect)(function() {
44896
+ var ref = (0, import_react54.useRef)(void 0);
44897
+ (0, import_react54.useEffect)(function() {
44532
44898
  ref.current = state;
44533
44899
  });
44534
44900
  return ref.current;
44535
44901
  };
44536
44902
  // src/components/threads/Thread/MessageForm/Field/Control.tsx
44537
- var import_react55 = require("react");
44903
+ var import_react56 = require("react");
44538
44904
  // src/components/textareas/TextareaBase/index.tsx
44539
- var import_react_compiler_runtime69 = require("react-compiler-runtime");
44540
- var import_react54 = require("react");
44905
+ var import_react_compiler_runtime70 = require("react-compiler-runtime");
44906
+ var import_react55 = require("react");
44541
44907
  var import_react_textarea_autosize = __toESM(require("react-textarea-autosize"), 1);
44542
44908
  var import_jsx_runtime71 = require("react/jsx-runtime");
44543
- var _excluded3 = [
44909
+ var _excluded4 = [
44544
44910
  "style",
44545
44911
  "className"
44546
44912
  ];
44547
- function ownKeys31(e, r) {
44913
+ function ownKeys32(e, r) {
44548
44914
  var t = Object.keys(e);
44549
44915
  if (Object.getOwnPropertySymbols) {
44550
44916
  var o = Object.getOwnPropertySymbols(e);
@@ -44554,30 +44920,30 @@ function ownKeys31(e, r) {
44554
44920
  }
44555
44921
  return t;
44556
44922
  }
44557
- function _objectSpread31(e) {
44923
+ function _objectSpread32(e) {
44558
44924
  for(var r = 1; r < arguments.length; r++){
44559
44925
  var t = null != arguments[r] ? arguments[r] : {};
44560
- r % 2 ? ownKeys31(Object(t), true).forEach(function(r2) {
44561
- _defineProperty31(e, r2, t[r2]);
44562
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys31(Object(t)).forEach(function(r2) {
44926
+ r % 2 ? ownKeys32(Object(t), true).forEach(function(r2) {
44927
+ _defineProperty32(e, r2, t[r2]);
44928
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys32(Object(t)).forEach(function(r2) {
44563
44929
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
44564
44930
  });
44565
44931
  }
44566
44932
  return e;
44567
44933
  }
44568
- function _defineProperty31(e, r, t) {
44569
- return (r = _toPropertyKey31(r)) in e ? Object.defineProperty(e, r, {
44934
+ function _defineProperty32(e, r, t) {
44935
+ return (r = _toPropertyKey32(r)) in e ? Object.defineProperty(e, r, {
44570
44936
  value: t,
44571
44937
  enumerable: true,
44572
44938
  configurable: true,
44573
44939
  writable: true
44574
44940
  }) : e[r] = t, e;
44575
44941
  }
44576
- function _toPropertyKey31(t) {
44577
- var i = _toPrimitive31(t, "string");
44942
+ function _toPropertyKey32(t) {
44943
+ var i = _toPrimitive32(t, "string");
44578
44944
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
44579
44945
  }
44580
- function _toPrimitive31(t, r) {
44946
+ function _toPrimitive32(t, r) {
44581
44947
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
44582
44948
  var e = t[Symbol.toPrimitive];
44583
44949
  if (void 0 !== e) {
@@ -44587,16 +44953,16 @@ function _toPrimitive31(t, r) {
44587
44953
  }
44588
44954
  return ("string" === r ? String : Number)(t);
44589
44955
  }
44590
- function _objectWithoutProperties3(e, t) {
44956
+ function _objectWithoutProperties4(e, t) {
44591
44957
  if (null == e) return {};
44592
- var o, r, i = _objectWithoutPropertiesLoose3(e, t);
44958
+ var o, r, i = _objectWithoutPropertiesLoose4(e, t);
44593
44959
  if (Object.getOwnPropertySymbols) {
44594
44960
  var n = Object.getOwnPropertySymbols(e);
44595
44961
  for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
44596
44962
  }
44597
44963
  return i;
44598
44964
  }
44599
- function _objectWithoutPropertiesLoose3(r, e) {
44965
+ function _objectWithoutPropertiesLoose4(r, e) {
44600
44966
  if (null == r) return {};
44601
44967
  var t = {};
44602
44968
  for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
@@ -44605,8 +44971,8 @@ function _objectWithoutPropertiesLoose3(r, e) {
44605
44971
  }
44606
44972
  return t;
44607
44973
  }
44608
- var TextareaBase = /* @__PURE__ */ (0, import_react54.forwardRef)(function TextareaBase2(t0, ref) {
44609
- var $ = (0, import_react_compiler_runtime69.c)(14);
44974
+ var TextareaBase = /* @__PURE__ */ (0, import_react55.forwardRef)(function TextareaBase2(t0, ref) {
44975
+ var $ = (0, import_react_compiler_runtime70.c)(14);
44610
44976
  var className;
44611
44977
  var rest;
44612
44978
  var style;
@@ -44614,7 +44980,7 @@ var TextareaBase = /* @__PURE__ */ (0, import_react54.forwardRef)(function Texta
44614
44980
  var _t = t0;
44615
44981
  var _$ref;
44616
44982
  _$ref = _t, style = _$ref.style, className = _$ref.className, _$ref;
44617
- rest = _objectWithoutProperties3(_t, _excluded3);
44983
+ rest = _objectWithoutProperties4(_t, _excluded4);
44618
44984
  _t;
44619
44985
  $[0] = t0;
44620
44986
  $[1] = className;
@@ -44645,7 +45011,7 @@ var TextareaBase = /* @__PURE__ */ (0, import_react54.forwardRef)(function Texta
44645
45011
  }
44646
45012
  var t4;
44647
45013
  if ($[7] !== t3) {
44648
- t4 = _objectSpread31({
45014
+ t4 = _objectSpread32({
44649
45015
  border: 0,
44650
45016
  outline: 0,
44651
45017
  boxSizing: "border-box",
@@ -44664,7 +45030,7 @@ var TextareaBase = /* @__PURE__ */ (0, import_react54.forwardRef)(function Texta
44664
45030
  t5 = /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, {
44665
45031
  children: [
44666
45032
  t1,
44667
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react_textarea_autosize.default, _objectSpread31({
45033
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react_textarea_autosize.default, _objectSpread32({
44668
45034
  ref: ref,
44669
45035
  className: t2,
44670
45036
  style: t4
@@ -44683,7 +45049,7 @@ var TextareaBase = /* @__PURE__ */ (0, import_react54.forwardRef)(function Texta
44683
45049
  });
44684
45050
  // src/components/threads/Thread/MessageForm/Field/Control.tsx
44685
45051
  var import_jsx_runtime72 = require("react/jsx-runtime");
44686
- function ownKeys32(e, r) {
45052
+ function ownKeys33(e, r) {
44687
45053
  var t = Object.keys(e);
44688
45054
  if (Object.getOwnPropertySymbols) {
44689
45055
  var o = Object.getOwnPropertySymbols(e);
@@ -44693,30 +45059,30 @@ function ownKeys32(e, r) {
44693
45059
  }
44694
45060
  return t;
44695
45061
  }
44696
- function _objectSpread32(e) {
45062
+ function _objectSpread33(e) {
44697
45063
  for(var r = 1; r < arguments.length; r++){
44698
45064
  var t = null != arguments[r] ? arguments[r] : {};
44699
- r % 2 ? ownKeys32(Object(t), true).forEach(function(r2) {
44700
- _defineProperty32(e, r2, t[r2]);
44701
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys32(Object(t)).forEach(function(r2) {
45065
+ r % 2 ? ownKeys33(Object(t), true).forEach(function(r2) {
45066
+ _defineProperty33(e, r2, t[r2]);
45067
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys33(Object(t)).forEach(function(r2) {
44702
45068
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
44703
45069
  });
44704
45070
  }
44705
45071
  return e;
44706
45072
  }
44707
- function _defineProperty32(e, r, t) {
44708
- return (r = _toPropertyKey32(r)) in e ? Object.defineProperty(e, r, {
45073
+ function _defineProperty33(e, r, t) {
45074
+ return (r = _toPropertyKey33(r)) in e ? Object.defineProperty(e, r, {
44709
45075
  value: t,
44710
45076
  enumerable: true,
44711
45077
  configurable: true,
44712
45078
  writable: true
44713
45079
  }) : e[r] = t, e;
44714
45080
  }
44715
- function _toPropertyKey32(t) {
44716
- var i = _toPrimitive32(t, "string");
45081
+ function _toPropertyKey33(t) {
45082
+ var i = _toPrimitive33(t, "string");
44717
45083
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
44718
45084
  }
44719
- function _toPrimitive32(t, r) {
45085
+ function _toPrimitive33(t, r) {
44720
45086
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
44721
45087
  var e = t[Symbol.toPrimitive];
44722
45088
  if (void 0 !== e) {
@@ -44727,7 +45093,7 @@ function _toPrimitive32(t, r) {
44727
45093
  return ("string" === r ? String : Number)(t);
44728
45094
  }
44729
45095
  var Root9 = function(t0) {
44730
- var $ = (0, import_react_compiler_runtime70.c)(4);
45096
+ var $ = (0, import_react_compiler_runtime71.c)(4);
44731
45097
  var children = t0.children, style = t0.style, className = t0.className;
44732
45098
  var t1;
44733
45099
  if ($[0] !== children || $[1] !== className || $[2] !== style) {
@@ -44750,19 +45116,19 @@ var Root9 = function(t0) {
44750
45116
  var Input = function(props) {
44751
45117
  "use no memo";
44752
45118
  var _props$placeholder;
44753
- var assistantNameContext = (0, import_react55.useContext)(AssistantNameContext);
45119
+ var assistantNameContext = (0, import_react56.useContext)(AssistantNameContext);
44754
45120
  var register = useFormContext().register;
44755
45121
  var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
44756
- var isSubmitDisabled = (0, import_react55.useMemo)(function() {
45122
+ var isSubmitDisabled = (0, import_react56.useMemo)(function() {
44757
45123
  return isDisabled || isLoading;
44758
45124
  }, [
44759
45125
  isDisabled,
44760
45126
  isLoading
44761
45127
  ]);
44762
45128
  var isDisabledPrevious = usePrevious(isDisabled);
44763
- var textareaRef = (0, import_react55.useRef)(null);
45129
+ var textareaRef = (0, import_react56.useRef)(null);
44764
45130
  var textareaProps = register("content");
44765
- (0, import_react55.useEffect)(function() {
45131
+ (0, import_react56.useEffect)(function() {
44766
45132
  if (isDisabled) return;
44767
45133
  if (!isDisabledPrevious) return;
44768
45134
  if (!textareaRef.current) return;
@@ -44772,7 +45138,7 @@ var Input = function(props) {
44772
45138
  isDisabledPrevious,
44773
45139
  textareaProps
44774
45140
  ]);
44775
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TextareaBase, _objectSpread32(_objectSpread32(_objectSpread32({
45141
+ return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TextareaBase, _objectSpread33(_objectSpread33(_objectSpread33({
44776
45142
  minRows: 1,
44777
45143
  placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : "Message ".concat(assistantNameContext, "..."),
44778
45144
  disabled: isDisabled,
@@ -44792,7 +45158,7 @@ var Input = function(props) {
44792
45158
  }));
44793
45159
  };
44794
45160
  var Control = function(props) {
44795
- var $ = (0, import_react_compiler_runtime70.c)(3);
45161
+ var $ = (0, import_react_compiler_runtime71.c)(3);
44796
45162
  var t0;
44797
45163
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
44798
45164
  t0 = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Input, {});
@@ -44802,7 +45168,7 @@ var Control = function(props) {
44802
45168
  }
44803
45169
  var t1;
44804
45170
  if ($[1] !== props) {
44805
- t1 = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Root9, _objectSpread32(_objectSpread32({}, props), {}, {
45171
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Root9, _objectSpread33(_objectSpread33({}, props), {}, {
44806
45172
  children: t0
44807
45173
  }));
44808
45174
  $[1] = props;
@@ -44815,11 +45181,11 @@ var Control = function(props) {
44815
45181
  Control.Root = Root9;
44816
45182
  Control.Input = Input;
44817
45183
  // src/components/threads/Thread/MessageForm/Field/Files/Preview.tsx
44818
- var import_react_compiler_runtime71 = require("react-compiler-runtime");
45184
+ var import_react_compiler_runtime72 = require("react-compiler-runtime");
44819
45185
  var import_themes49 = require("@radix-ui/themes");
44820
45186
  var import_react_icons12 = require("@radix-ui/react-icons");
44821
45187
  var import_jsx_runtime73 = require("react/jsx-runtime");
44822
- function ownKeys33(e, r) {
45188
+ function ownKeys34(e, r) {
44823
45189
  var t = Object.keys(e);
44824
45190
  if (Object.getOwnPropertySymbols) {
44825
45191
  var o = Object.getOwnPropertySymbols(e);
@@ -44829,30 +45195,30 @@ function ownKeys33(e, r) {
44829
45195
  }
44830
45196
  return t;
44831
45197
  }
44832
- function _objectSpread33(e) {
45198
+ function _objectSpread34(e) {
44833
45199
  for(var r = 1; r < arguments.length; r++){
44834
45200
  var t = null != arguments[r] ? arguments[r] : {};
44835
- r % 2 ? ownKeys33(Object(t), true).forEach(function(r2) {
44836
- _defineProperty33(e, r2, t[r2]);
44837
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys33(Object(t)).forEach(function(r2) {
45201
+ r % 2 ? ownKeys34(Object(t), true).forEach(function(r2) {
45202
+ _defineProperty34(e, r2, t[r2]);
45203
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys34(Object(t)).forEach(function(r2) {
44838
45204
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
44839
45205
  });
44840
45206
  }
44841
45207
  return e;
44842
45208
  }
44843
- function _defineProperty33(e, r, t) {
44844
- return (r = _toPropertyKey33(r)) in e ? Object.defineProperty(e, r, {
45209
+ function _defineProperty34(e, r, t) {
45210
+ return (r = _toPropertyKey34(r)) in e ? Object.defineProperty(e, r, {
44845
45211
  value: t,
44846
45212
  enumerable: true,
44847
45213
  configurable: true,
44848
45214
  writable: true
44849
45215
  }) : e[r] = t, e;
44850
45216
  }
44851
- function _toPropertyKey33(t) {
44852
- var i = _toPrimitive33(t, "string");
45217
+ function _toPropertyKey34(t) {
45218
+ var i = _toPrimitive34(t, "string");
44853
45219
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
44854
45220
  }
44855
- function _toPrimitive33(t, r) {
45221
+ function _toPrimitive34(t, r) {
44856
45222
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
44857
45223
  var e = t[Symbol.toPrimitive];
44858
45224
  if (void 0 !== e) {
@@ -44863,7 +45229,7 @@ function _toPrimitive33(t, r) {
44863
45229
  return ("string" === r ? String : Number)(t);
44864
45230
  }
44865
45231
  var Preview = function(props) {
44866
- var $ = (0, import_react_compiler_runtime71.c)(8);
45232
+ var $ = (0, import_react_compiler_runtime72.c)(8);
44867
45233
  var _useMessageFormContext = useMessageFormContext(), files = _useMessageFormContext.files, setFiles = _useMessageFormContext.setFiles;
44868
45234
  if (!files.length) {
44869
45235
  return null;
@@ -44938,7 +45304,7 @@ var Preview = function(props) {
44938
45304
  }
44939
45305
  var t1;
44940
45306
  if ($[5] !== props || $[6] !== t0) {
44941
- t1 = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes49.Flex, _objectSpread33(_objectSpread33({
45307
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_themes49.Flex, _objectSpread34(_objectSpread34({
44942
45308
  flexBasis: "100%",
44943
45309
  direction: "column",
44944
45310
  pb: "2",
@@ -44955,15 +45321,15 @@ var Preview = function(props) {
44955
45321
  return t1;
44956
45322
  };
44957
45323
  // src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
44958
- var import_react_compiler_runtime73 = require("react-compiler-runtime");
45324
+ var import_react_compiler_runtime74 = require("react-compiler-runtime");
44959
45325
  var import_react_icons13 = require("@radix-ui/react-icons");
44960
45326
  var import_themes50 = require("@radix-ui/themes");
44961
45327
  // src/hooks/files/useChangeFilesField/index.ts
44962
- var import_react56 = require("react");
45328
+ var import_react57 = require("react");
44963
45329
  var import_radash15 = require("radash");
44964
45330
  var import_dayjs2 = __toESM(require("dayjs"), 1);
44965
45331
  // src/hooks/files/useCreateFile/index.ts
44966
- var import_react_compiler_runtime72 = require("react-compiler-runtime");
45332
+ var import_react_compiler_runtime73 = require("react-compiler-runtime");
44967
45333
  var import_react_query7 = require("@tanstack/react-query");
44968
45334
  // src/hooks/files/useCreateFile/lib/mutationOptions/mutationFn/body/formData.ts
44969
45335
  var formData = function(variables) {
@@ -44974,7 +45340,7 @@ var formData = function(variables) {
44974
45340
  return data2;
44975
45341
  };
44976
45342
  // src/hooks/files/useCreateFile/lib/mutationOptions/mutationFn/body/index.ts
44977
- function ownKeys34(e, r) {
45343
+ function ownKeys35(e, r) {
44978
45344
  var t = Object.keys(e);
44979
45345
  if (Object.getOwnPropertySymbols) {
44980
45346
  var o = Object.getOwnPropertySymbols(e);
@@ -44984,30 +45350,30 @@ function ownKeys34(e, r) {
44984
45350
  }
44985
45351
  return t;
44986
45352
  }
44987
- function _objectSpread34(e) {
45353
+ function _objectSpread35(e) {
44988
45354
  for(var r = 1; r < arguments.length; r++){
44989
45355
  var t = null != arguments[r] ? arguments[r] : {};
44990
- r % 2 ? ownKeys34(Object(t), true).forEach(function(r2) {
44991
- _defineProperty34(e, r2, t[r2]);
44992
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys34(Object(t)).forEach(function(r2) {
45356
+ r % 2 ? ownKeys35(Object(t), true).forEach(function(r2) {
45357
+ _defineProperty35(e, r2, t[r2]);
45358
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys35(Object(t)).forEach(function(r2) {
44993
45359
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
44994
45360
  });
44995
45361
  }
44996
45362
  return e;
44997
45363
  }
44998
- function _defineProperty34(e, r, t) {
44999
- return (r = _toPropertyKey34(r)) in e ? Object.defineProperty(e, r, {
45364
+ function _defineProperty35(e, r, t) {
45365
+ return (r = _toPropertyKey35(r)) in e ? Object.defineProperty(e, r, {
45000
45366
  value: t,
45001
45367
  enumerable: true,
45002
45368
  configurable: true,
45003
45369
  writable: true
45004
45370
  }) : e[r] = t, e;
45005
45371
  }
45006
- function _toPropertyKey34(t) {
45007
- var i = _toPrimitive34(t, "string");
45372
+ function _toPropertyKey35(t) {
45373
+ var i = _toPrimitive35(t, "string");
45008
45374
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
45009
45375
  }
45010
- function _toPrimitive34(t, r) {
45376
+ function _toPrimitive35(t, r) {
45011
45377
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
45012
45378
  var e = t[Symbol.toPrimitive];
45013
45379
  if (void 0 !== e) {
@@ -45027,12 +45393,12 @@ var body2 = function(_ref) {
45027
45393
  assistantId: variables.assistantId
45028
45394
  });
45029
45395
  if (!threadId) return formData(variables);
45030
- return formData(_objectSpread34(_objectSpread34({}, variables), {}, {
45396
+ return formData(_objectSpread35(_objectSpread35({}, variables), {}, {
45031
45397
  threadId: threadId
45032
45398
  }));
45033
45399
  };
45034
45400
  // src/hooks/files/useCreateFile/lib/mutationOptions/mutationFn/index.ts
45035
- function asyncGeneratorStep7(n, t, e, r, o, a, c) {
45401
+ function asyncGeneratorStep8(n, t, e, r, o, a, c) {
45036
45402
  try {
45037
45403
  var i = n[a](c), u = i.value;
45038
45404
  } catch (n2) {
@@ -45040,16 +45406,16 @@ function asyncGeneratorStep7(n, t, e, r, o, a, c) {
45040
45406
  }
45041
45407
  i.done ? t(u) : Promise.resolve(u).then(r, o);
45042
45408
  }
45043
- function _asyncToGenerator7(n) {
45409
+ function _asyncToGenerator8(n) {
45044
45410
  return function() {
45045
45411
  var t = this, e = arguments;
45046
45412
  return new Promise(function(r, o) {
45047
45413
  var a = n.apply(t, e);
45048
45414
  function _next(n2) {
45049
- asyncGeneratorStep7(a, r, o, _next, _throw, "next", n2);
45415
+ asyncGeneratorStep8(a, r, o, _next, _throw, "next", n2);
45050
45416
  }
45051
45417
  function _throw(n2) {
45052
- asyncGeneratorStep7(a, r, o, _next, _throw, "throw", n2);
45418
+ asyncGeneratorStep8(a, r, o, _next, _throw, "throw", n2);
45053
45419
  }
45054
45420
  _next(void 0);
45055
45421
  });
@@ -45058,7 +45424,7 @@ function _asyncToGenerator7(n) {
45058
45424
  var mutationFn2 = function(_ref) {
45059
45425
  var superinterfaceContext = _ref.superinterfaceContext, queryClient = _ref.queryClient, threadContext = _ref.threadContext;
45060
45426
  return /* @__PURE__ */ function() {
45061
- var _ref2 = _asyncToGenerator7(function(variables) {
45427
+ var _ref2 = _asyncToGenerator8(function(variables) {
45062
45428
  var response, result;
45063
45429
  return _ts_generator(this, function(_state) {
45064
45430
  switch(_state.label){
@@ -45094,7 +45460,7 @@ var mutationFn2 = function(_ref) {
45094
45460
  }();
45095
45461
  };
45096
45462
  // src/hooks/files/useCreateFile/lib/mutationOptions/index.ts
45097
- function ownKeys35(e, r) {
45463
+ function ownKeys36(e, r) {
45098
45464
  var t = Object.keys(e);
45099
45465
  if (Object.getOwnPropertySymbols) {
45100
45466
  var o = Object.getOwnPropertySymbols(e);
@@ -45104,30 +45470,30 @@ function ownKeys35(e, r) {
45104
45470
  }
45105
45471
  return t;
45106
45472
  }
45107
- function _objectSpread35(e) {
45473
+ function _objectSpread36(e) {
45108
45474
  for(var r = 1; r < arguments.length; r++){
45109
45475
  var t = null != arguments[r] ? arguments[r] : {};
45110
- r % 2 ? ownKeys35(Object(t), true).forEach(function(r2) {
45111
- _defineProperty35(e, r2, t[r2]);
45112
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys35(Object(t)).forEach(function(r2) {
45476
+ r % 2 ? ownKeys36(Object(t), true).forEach(function(r2) {
45477
+ _defineProperty36(e, r2, t[r2]);
45478
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys36(Object(t)).forEach(function(r2) {
45113
45479
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
45114
45480
  });
45115
45481
  }
45116
45482
  return e;
45117
45483
  }
45118
- function _defineProperty35(e, r, t) {
45119
- return (r = _toPropertyKey35(r)) in e ? Object.defineProperty(e, r, {
45484
+ function _defineProperty36(e, r, t) {
45485
+ return (r = _toPropertyKey36(r)) in e ? Object.defineProperty(e, r, {
45120
45486
  value: t,
45121
45487
  enumerable: true,
45122
45488
  configurable: true,
45123
45489
  writable: true
45124
45490
  }) : e[r] = t, e;
45125
45491
  }
45126
- function _toPropertyKey35(t) {
45127
- var i = _toPrimitive35(t, "string");
45492
+ function _toPropertyKey36(t) {
45493
+ var i = _toPrimitive36(t, "string");
45128
45494
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
45129
45495
  }
45130
- function _toPrimitive35(t, r) {
45496
+ function _toPrimitive36(t, r) {
45131
45497
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
45132
45498
  var e = t[Symbol.toPrimitive];
45133
45499
  if (void 0 !== e) {
@@ -45143,7 +45509,7 @@ var mutationOptions2 = function(_ref) {
45143
45509
  "createFile",
45144
45510
  threadContext.variables
45145
45511
  ];
45146
- return _objectSpread35(_objectSpread35(_objectSpread35({
45512
+ return _objectSpread36(_objectSpread36(_objectSpread36({
45147
45513
  mutationFn: mutationFn2({
45148
45514
  queryClient: queryClient,
45149
45515
  superinterfaceContext: superinterfaceContext,
@@ -45155,7 +45521,7 @@ var mutationOptions2 = function(_ref) {
45155
45521
  });
45156
45522
  };
45157
45523
  // src/hooks/files/useCreateFile/index.ts
45158
- function ownKeys36(e, r) {
45524
+ function ownKeys37(e, r) {
45159
45525
  var t = Object.keys(e);
45160
45526
  if (Object.getOwnPropertySymbols) {
45161
45527
  var o = Object.getOwnPropertySymbols(e);
@@ -45165,30 +45531,30 @@ function ownKeys36(e, r) {
45165
45531
  }
45166
45532
  return t;
45167
45533
  }
45168
- function _objectSpread36(e) {
45534
+ function _objectSpread37(e) {
45169
45535
  for(var r = 1; r < arguments.length; r++){
45170
45536
  var t = null != arguments[r] ? arguments[r] : {};
45171
- r % 2 ? ownKeys36(Object(t), true).forEach(function(r2) {
45172
- _defineProperty36(e, r2, t[r2]);
45173
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys36(Object(t)).forEach(function(r2) {
45537
+ r % 2 ? ownKeys37(Object(t), true).forEach(function(r2) {
45538
+ _defineProperty37(e, r2, t[r2]);
45539
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys37(Object(t)).forEach(function(r2) {
45174
45540
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
45175
45541
  });
45176
45542
  }
45177
45543
  return e;
45178
45544
  }
45179
- function _defineProperty36(e, r, t) {
45180
- return (r = _toPropertyKey36(r)) in e ? Object.defineProperty(e, r, {
45545
+ function _defineProperty37(e, r, t) {
45546
+ return (r = _toPropertyKey37(r)) in e ? Object.defineProperty(e, r, {
45181
45547
  value: t,
45182
45548
  enumerable: true,
45183
45549
  configurable: true,
45184
45550
  writable: true
45185
45551
  }) : e[r] = t, e;
45186
45552
  }
45187
- function _toPropertyKey36(t) {
45188
- var i = _toPrimitive36(t, "string");
45553
+ function _toPropertyKey37(t) {
45554
+ var i = _toPrimitive37(t, "string");
45189
45555
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
45190
45556
  }
45191
- function _toPrimitive36(t, r) {
45557
+ function _toPrimitive37(t, r) {
45192
45558
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
45193
45559
  var e = t[Symbol.toPrimitive];
45194
45560
  if (void 0 !== e) {
@@ -45199,11 +45565,11 @@ function _toPrimitive36(t, r) {
45199
45565
  return ("string" === r ? String : Number)(t);
45200
45566
  }
45201
45567
  var useCreateFile = function(t0) {
45202
- var $ = (0, import_react_compiler_runtime72.c)(15);
45568
+ var $ = (0, import_react_compiler_runtime73.c)(15);
45203
45569
  var t1;
45204
45570
  if ($[0] !== t0) {
45205
45571
  t1 = t0 === void 0 ? {
45206
- onError: _temp4
45572
+ onError: _temp5
45207
45573
  } : t0;
45208
45574
  $[0] = t0;
45209
45575
  $[1] = t1;
@@ -45213,7 +45579,7 @@ var useCreateFile = function(t0) {
45213
45579
  var t2 = t1.onError;
45214
45580
  var t3;
45215
45581
  if ($[2] !== t2) {
45216
- t3 = t2 === void 0 ? _temp23 : t2;
45582
+ t3 = t2 === void 0 ? _temp24 : t2;
45217
45583
  $[2] = t2;
45218
45584
  $[3] = t3;
45219
45585
  } else {
@@ -45250,7 +45616,7 @@ var useCreateFile = function(t0) {
45250
45616
  var args = t62;
45251
45617
  var _args = _to_array(args), firstArg = _args[0], restArgs = _args.slice(1);
45252
45618
  return (_props = props).mutateAsync.apply(_props, [
45253
- _objectSpread36(_objectSpread36({}, threadContext.variables), firstArg)
45619
+ _objectSpread37(_objectSpread37({}, threadContext.variables), firstArg)
45254
45620
  ].concat(_to_consumable_array(restArgs)));
45255
45621
  };
45256
45622
  $[9] = props;
@@ -45261,7 +45627,7 @@ var useCreateFile = function(t0) {
45261
45627
  }
45262
45628
  var t6;
45263
45629
  if ($[12] !== props || $[13] !== t5) {
45264
- t6 = _objectSpread36(_objectSpread36({}, props), {}, {
45630
+ t6 = _objectSpread37(_objectSpread37({}, props), {}, {
45265
45631
  createFile: t5
45266
45632
  });
45267
45633
  $[12] = props;
@@ -45272,10 +45638,10 @@ var useCreateFile = function(t0) {
45272
45638
  }
45273
45639
  return t6;
45274
45640
  };
45275
- function _temp4() {}
45276
- function _temp23() {}
45641
+ function _temp5() {}
45642
+ function _temp24() {}
45277
45643
  // src/hooks/files/useChangeFilesField/index.ts
45278
- function asyncGeneratorStep8(n, t, e, r, o, a, c) {
45644
+ function asyncGeneratorStep9(n, t, e, r, o, a, c) {
45279
45645
  try {
45280
45646
  var i = n[a](c), u = i.value;
45281
45647
  } catch (n2) {
@@ -45283,16 +45649,16 @@ function asyncGeneratorStep8(n, t, e, r, o, a, c) {
45283
45649
  }
45284
45650
  i.done ? t(u) : Promise.resolve(u).then(r, o);
45285
45651
  }
45286
- function _asyncToGenerator8(n) {
45652
+ function _asyncToGenerator9(n) {
45287
45653
  return function() {
45288
45654
  var t = this, e = arguments;
45289
45655
  return new Promise(function(r, o) {
45290
45656
  var a = n.apply(t, e);
45291
45657
  function _next(n2) {
45292
- asyncGeneratorStep8(a, r, o, _next, _throw, "next", n2);
45658
+ asyncGeneratorStep9(a, r, o, _next, _throw, "next", n2);
45293
45659
  }
45294
45660
  function _throw(n2) {
45295
- asyncGeneratorStep8(a, r, o, _next, _throw, "throw", n2);
45661
+ asyncGeneratorStep9(a, r, o, _next, _throw, "throw", n2);
45296
45662
  }
45297
45663
  _next(void 0);
45298
45664
  });
@@ -45350,8 +45716,8 @@ var useChangeFilesField = function() {
45350
45716
  var setFiles = useMessageFormContext().setFiles;
45351
45717
  var createFile = useCreateFile().createFile;
45352
45718
  var addToast = useToasts().addToast;
45353
- var changeFilesField = (0, import_react56.useCallback)(/* @__PURE__ */ function() {
45354
- var _ref2 = _asyncToGenerator8(function(event) {
45719
+ var changeFilesField = (0, import_react57.useCallback)(/* @__PURE__ */ function() {
45720
+ var _ref2 = _asyncToGenerator9(function(event) {
45355
45721
  var fileObjects, newFiles, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step, err;
45356
45722
  return _ts_generator(this, function(_state) {
45357
45723
  switch(_state.label){
@@ -45529,7 +45895,7 @@ var useChangeFilesField = function() {
45529
45895
  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";
45530
45896
  // src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
45531
45897
  var import_jsx_runtime74 = require("react/jsx-runtime");
45532
- function ownKeys37(e, r) {
45898
+ function ownKeys38(e, r) {
45533
45899
  var t = Object.keys(e);
45534
45900
  if (Object.getOwnPropertySymbols) {
45535
45901
  var o = Object.getOwnPropertySymbols(e);
@@ -45539,30 +45905,30 @@ function ownKeys37(e, r) {
45539
45905
  }
45540
45906
  return t;
45541
45907
  }
45542
- function _objectSpread37(e) {
45908
+ function _objectSpread38(e) {
45543
45909
  for(var r = 1; r < arguments.length; r++){
45544
45910
  var t = null != arguments[r] ? arguments[r] : {};
45545
- r % 2 ? ownKeys37(Object(t), true).forEach(function(r2) {
45546
- _defineProperty37(e, r2, t[r2]);
45547
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys37(Object(t)).forEach(function(r2) {
45911
+ r % 2 ? ownKeys38(Object(t), true).forEach(function(r2) {
45912
+ _defineProperty38(e, r2, t[r2]);
45913
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys38(Object(t)).forEach(function(r2) {
45548
45914
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
45549
45915
  });
45550
45916
  }
45551
45917
  return e;
45552
45918
  }
45553
- function _defineProperty37(e, r, t) {
45554
- return (r = _toPropertyKey37(r)) in e ? Object.defineProperty(e, r, {
45919
+ function _defineProperty38(e, r, t) {
45920
+ return (r = _toPropertyKey38(r)) in e ? Object.defineProperty(e, r, {
45555
45921
  value: t,
45556
45922
  enumerable: true,
45557
45923
  configurable: true,
45558
45924
  writable: true
45559
45925
  }) : e[r] = t, e;
45560
45926
  }
45561
- function _toPropertyKey37(t) {
45562
- var i = _toPrimitive37(t, "string");
45927
+ function _toPropertyKey38(t) {
45928
+ var i = _toPrimitive38(t, "string");
45563
45929
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
45564
45930
  }
45565
- function _toPrimitive37(t, r) {
45931
+ function _toPrimitive38(t, r) {
45566
45932
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
45567
45933
  var e = t[Symbol.toPrimitive];
45568
45934
  if (void 0 !== e) {
@@ -45573,7 +45939,7 @@ function _toPrimitive37(t, r) {
45573
45939
  return ("string" === r ? String : Number)(t);
45574
45940
  }
45575
45941
  var Control2 = function(props) {
45576
- var $ = (0, import_react_compiler_runtime73.c)(11);
45942
+ var $ = (0, import_react_compiler_runtime74.c)(11);
45577
45943
  var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
45578
45944
  var changeFilesField = useChangeFilesField().changeFilesField;
45579
45945
  var t0 = isDisabled || isLoading;
@@ -45641,7 +46007,7 @@ var Control2 = function(props) {
45641
46007
  }
45642
46008
  var t6;
45643
46009
  if ($[8] !== props || $[9] !== t5) {
45644
- t6 = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_themes50.Flex, _objectSpread37(_objectSpread37({
46010
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_themes50.Flex, _objectSpread38(_objectSpread38({
45645
46011
  pt: "2",
45646
46012
  pr: "2",
45647
46013
  flexGrow: "0"
@@ -45663,7 +46029,7 @@ var Files = {
45663
46029
  };
45664
46030
  // src/components/threads/Thread/MessageForm/Field/index.tsx
45665
46031
  var import_jsx_runtime75 = require("react/jsx-runtime");
45666
- function ownKeys38(e, r) {
46032
+ function ownKeys39(e, r) {
45667
46033
  var t = Object.keys(e);
45668
46034
  if (Object.getOwnPropertySymbols) {
45669
46035
  var o = Object.getOwnPropertySymbols(e);
@@ -45673,30 +46039,30 @@ function ownKeys38(e, r) {
45673
46039
  }
45674
46040
  return t;
45675
46041
  }
45676
- function _objectSpread38(e) {
46042
+ function _objectSpread39(e) {
45677
46043
  for(var r = 1; r < arguments.length; r++){
45678
46044
  var t = null != arguments[r] ? arguments[r] : {};
45679
- r % 2 ? ownKeys38(Object(t), true).forEach(function(r2) {
45680
- _defineProperty38(e, r2, t[r2]);
45681
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys38(Object(t)).forEach(function(r2) {
46045
+ r % 2 ? ownKeys39(Object(t), true).forEach(function(r2) {
46046
+ _defineProperty39(e, r2, t[r2]);
46047
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys39(Object(t)).forEach(function(r2) {
45682
46048
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
45683
46049
  });
45684
46050
  }
45685
46051
  return e;
45686
46052
  }
45687
- function _defineProperty38(e, r, t) {
45688
- return (r = _toPropertyKey38(r)) in e ? Object.defineProperty(e, r, {
46053
+ function _defineProperty39(e, r, t) {
46054
+ return (r = _toPropertyKey39(r)) in e ? Object.defineProperty(e, r, {
45689
46055
  value: t,
45690
46056
  enumerable: true,
45691
46057
  configurable: true,
45692
46058
  writable: true
45693
46059
  }) : e[r] = t, e;
45694
46060
  }
45695
- function _toPropertyKey38(t) {
45696
- var i = _toPrimitive38(t, "string");
46061
+ function _toPropertyKey39(t) {
46062
+ var i = _toPrimitive39(t, "string");
45697
46063
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
45698
46064
  }
45699
- function _toPrimitive38(t, r) {
46065
+ function _toPrimitive39(t, r) {
45700
46066
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
45701
46067
  var e = t[Symbol.toPrimitive];
45702
46068
  if (void 0 !== e) {
@@ -45722,7 +46088,7 @@ var Root10 = function(_ref) {
45722
46088
  direction: "column",
45723
46089
  flexShrink: "0",
45724
46090
  children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_themes51.Flex, {
45725
- style: _objectSpread38({
46091
+ style: _objectSpread39({
45726
46092
  borderRadius: "var(--radius-2)",
45727
46093
  borderWidth: "1px",
45728
46094
  borderStyle: "solid",
@@ -45746,7 +46112,7 @@ var Field = {
45746
46112
  };
45747
46113
  // src/components/threads/Thread/MessageForm/index.tsx
45748
46114
  var import_jsx_runtime76 = require("react/jsx-runtime");
45749
- function ownKeys39(e, r) {
46115
+ function ownKeys40(e, r) {
45750
46116
  var t = Object.keys(e);
45751
46117
  if (Object.getOwnPropertySymbols) {
45752
46118
  var o = Object.getOwnPropertySymbols(e);
@@ -45756,30 +46122,30 @@ function ownKeys39(e, r) {
45756
46122
  }
45757
46123
  return t;
45758
46124
  }
45759
- function _objectSpread39(e) {
46125
+ function _objectSpread40(e) {
45760
46126
  for(var r = 1; r < arguments.length; r++){
45761
46127
  var t = null != arguments[r] ? arguments[r] : {};
45762
- r % 2 ? ownKeys39(Object(t), true).forEach(function(r2) {
45763
- _defineProperty39(e, r2, t[r2]);
45764
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys39(Object(t)).forEach(function(r2) {
46128
+ r % 2 ? ownKeys40(Object(t), true).forEach(function(r2) {
46129
+ _defineProperty40(e, r2, t[r2]);
46130
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys40(Object(t)).forEach(function(r2) {
45765
46131
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
45766
46132
  });
45767
46133
  }
45768
46134
  return e;
45769
46135
  }
45770
- function _defineProperty39(e, r, t) {
45771
- return (r = _toPropertyKey39(r)) in e ? Object.defineProperty(e, r, {
46136
+ function _defineProperty40(e, r, t) {
46137
+ return (r = _toPropertyKey40(r)) in e ? Object.defineProperty(e, r, {
45772
46138
  value: t,
45773
46139
  enumerable: true,
45774
46140
  configurable: true,
45775
46141
  writable: true
45776
46142
  }) : e[r] = t, e;
45777
46143
  }
45778
- function _toPropertyKey39(t) {
45779
- var i = _toPrimitive39(t, "string");
46144
+ function _toPropertyKey40(t) {
46145
+ var i = _toPrimitive40(t, "string");
45780
46146
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
45781
46147
  }
45782
- function _toPrimitive39(t, r) {
46148
+ function _toPrimitive40(t, r) {
45783
46149
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
45784
46150
  var e = t[Symbol.toPrimitive];
45785
46151
  if (void 0 !== e) {
@@ -45790,7 +46156,7 @@ function _toPrimitive39(t, r) {
45790
46156
  return ("string" === r ? String : Number)(t);
45791
46157
  }
45792
46158
  var MessageForm = function(props) {
45793
- var $ = (0, import_react_compiler_runtime74.c)(3);
46159
+ var $ = (0, import_react_compiler_runtime75.c)(3);
45794
46160
  var t0;
45795
46161
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
45796
46162
  t0 = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Field.Root, {
@@ -45805,7 +46171,7 @@ var MessageForm = function(props) {
45805
46171
  }
45806
46172
  var t1;
45807
46173
  if ($[1] !== props) {
45808
- t1 = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Root8, _objectSpread39(_objectSpread39({}, props), {}, {
46174
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Root8, _objectSpread40(_objectSpread40({}, props), {}, {
45809
46175
  children: t0
45810
46176
  }));
45811
46177
  $[1] = props;
@@ -45819,22 +46185,22 @@ MessageForm.Root = Root8;
45819
46185
  MessageForm.Field = Field;
45820
46186
  MessageForm.Submit = Submit;
45821
46187
  // src/components/threads/Thread/Root/index.tsx
45822
- var import_react_compiler_runtime77 = require("react-compiler-runtime");
46188
+ var import_react_compiler_runtime78 = require("react-compiler-runtime");
45823
46189
  var import_themes53 = require("@radix-ui/themes");
45824
46190
  // src/components/threads/Thread/Provider/index.tsx
45825
46191
  var Provider2 = SuperinterfaceProvider;
45826
46192
  // src/components/toasts/ToastsProvider/index.tsx
45827
- var import_react_compiler_runtime76 = require("react-compiler-runtime");
45828
- var import_react57 = require("react");
46193
+ var import_react_compiler_runtime77 = require("react-compiler-runtime");
46194
+ var import_react58 = require("react");
45829
46195
  var Toast2 = __toESM(require("@radix-ui/react-toast"), 1);
45830
46196
  // src/components/toasts/ToastsProvider/CustomToast.tsx
45831
- var import_react_compiler_runtime75 = require("react-compiler-runtime");
46197
+ var import_react_compiler_runtime76 = require("react-compiler-runtime");
45832
46198
  var Toast = __toESM(require("@radix-ui/react-toast"), 1);
45833
46199
  var import_themes52 = require("@radix-ui/themes");
45834
46200
  var import_react_icons14 = require("@radix-ui/react-icons");
45835
46201
  var import_jsx_runtime77 = require("react/jsx-runtime");
45836
46202
  var CustomToast = function(t0) {
45837
- var $ = (0, import_react_compiler_runtime75.c)(7);
46203
+ var $ = (0, import_react_compiler_runtime76.c)(7);
45838
46204
  var toast = t0.toast;
45839
46205
  var t1;
45840
46206
  if ($[0] !== toast.type) {
@@ -45890,7 +46256,7 @@ var CustomToast = function(t0) {
45890
46256
  // src/components/toasts/ToastsProvider/index.tsx
45891
46257
  var import_jsx_runtime78 = require("react/jsx-runtime");
45892
46258
  var ToastsProvider = function(t0) {
45893
- var $ = (0, import_react_compiler_runtime76.c)(15);
46259
+ var $ = (0, import_react_compiler_runtime77.c)(15);
45894
46260
  var children = t0.children, t1 = t0.bottom;
45895
46261
  var bottom = t1 === void 0 ? 0 : t1;
45896
46262
  var t2;
@@ -45900,7 +46266,7 @@ var ToastsProvider = function(t0) {
45900
46266
  } else {
45901
46267
  t2 = $[0];
45902
46268
  }
45903
- var _ref = _sliced_to_array((0, import_react57.useState)(t2), 2), toasts = _ref[0], setToasts = _ref[1];
46269
+ var _ref = _sliced_to_array((0, import_react58.useState)(t2), 2), toasts = _ref[0], setToasts = _ref[1];
45904
46270
  var t3;
45905
46271
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
45906
46272
  t3 = function(toast) {
@@ -45928,7 +46294,7 @@ var ToastsProvider = function(t0) {
45928
46294
  }
45929
46295
  var t5;
45930
46296
  if ($[4] !== toasts) {
45931
- t5 = Array.from(toasts).map(_temp5);
46297
+ t5 = Array.from(toasts).map(_temp6);
45932
46298
  $[4] = toasts;
45933
46299
  $[5] = t5;
45934
46300
  } else {
@@ -45988,136 +46354,18 @@ var ToastsProvider = function(t0) {
45988
46354
  }
45989
46355
  return t8;
45990
46356
  };
45991
- function _temp5(toast_0, index) {
46357
+ function _temp6(toast_0, index) {
45992
46358
  return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(CustomToast, {
45993
46359
  toast: toast_0
45994
46360
  }, index);
45995
46361
  }
45996
46362
  // src/components/threads/Thread/Root/index.tsx
45997
46363
  var import_jsx_runtime79 = require("react/jsx-runtime");
45998
- var _excluded4 = [
46364
+ var _excluded5 = [
45999
46365
  "children",
46000
46366
  "style",
46001
46367
  "className"
46002
46368
  ];
46003
- function ownKeys40(e, r) {
46004
- var t = Object.keys(e);
46005
- if (Object.getOwnPropertySymbols) {
46006
- var o = Object.getOwnPropertySymbols(e);
46007
- r && (o = o.filter(function(r2) {
46008
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
46009
- })), t.push.apply(t, o);
46010
- }
46011
- return t;
46012
- }
46013
- function _objectSpread40(e) {
46014
- for(var r = 1; r < arguments.length; r++){
46015
- var t = null != arguments[r] ? arguments[r] : {};
46016
- r % 2 ? ownKeys40(Object(t), true).forEach(function(r2) {
46017
- _defineProperty40(e, r2, t[r2]);
46018
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys40(Object(t)).forEach(function(r2) {
46019
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
46020
- });
46021
- }
46022
- return e;
46023
- }
46024
- function _defineProperty40(e, r, t) {
46025
- return (r = _toPropertyKey40(r)) in e ? Object.defineProperty(e, r, {
46026
- value: t,
46027
- enumerable: true,
46028
- configurable: true,
46029
- writable: true
46030
- }) : e[r] = t, e;
46031
- }
46032
- function _toPropertyKey40(t) {
46033
- var i = _toPrimitive40(t, "string");
46034
- return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
46035
- }
46036
- function _toPrimitive40(t, r) {
46037
- if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
46038
- var e = t[Symbol.toPrimitive];
46039
- if (void 0 !== e) {
46040
- var i = e.call(t, r || "default");
46041
- if ("object" != (typeof i === "undefined" ? "undefined" : _type_of(i))) return i;
46042
- throw new TypeError("@@toPrimitive must return a primitive value.");
46043
- }
46044
- return ("string" === r ? String : Number)(t);
46045
- }
46046
- function _objectWithoutProperties4(e, t) {
46047
- if (null == e) return {};
46048
- var o, r, i = _objectWithoutPropertiesLoose4(e, t);
46049
- if (Object.getOwnPropertySymbols) {
46050
- var n = Object.getOwnPropertySymbols(e);
46051
- for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
46052
- }
46053
- return i;
46054
- }
46055
- function _objectWithoutPropertiesLoose4(r, e) {
46056
- if (null == r) return {};
46057
- var t = {};
46058
- for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
46059
- if (-1 !== e.indexOf(n)) continue;
46060
- t[n] = r[n];
46061
- }
46062
- return t;
46063
- }
46064
- var Root12 = function(t0) {
46065
- var $ = (0, import_react_compiler_runtime77.c)(12);
46066
- var children;
46067
- var className;
46068
- var rest;
46069
- var style;
46070
- if ($[0] !== t0) {
46071
- var _t = t0;
46072
- var ref;
46073
- ref = _t, children = ref.children, style = ref.style, className = ref.className, ref;
46074
- rest = _objectWithoutProperties4(_t, _excluded4);
46075
- _t;
46076
- $[0] = t0;
46077
- $[1] = children;
46078
- $[2] = className;
46079
- $[3] = rest;
46080
- $[4] = style;
46081
- } else {
46082
- children = $[1];
46083
- className = $[2];
46084
- rest = $[3];
46085
- style = $[4];
46086
- }
46087
- var t1;
46088
- if ($[5] !== children || $[6] !== className || $[7] !== style) {
46089
- t1 = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_themes53.Flex, {
46090
- direction: "column",
46091
- flexGrow: "1",
46092
- className: className,
46093
- style: style,
46094
- children: children
46095
- });
46096
- $[5] = children;
46097
- $[6] = className;
46098
- $[7] = style;
46099
- $[8] = t1;
46100
- } else {
46101
- t1 = $[8];
46102
- }
46103
- var t2;
46104
- if ($[9] !== rest || $[10] !== t1) {
46105
- t2 = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ToastsProvider, {
46106
- bottom: "var(--space-9)",
46107
- children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Provider2, _objectSpread40(_objectSpread40({}, rest), {}, {
46108
- children: t1
46109
- }))
46110
- });
46111
- $[9] = rest;
46112
- $[10] = t1;
46113
- $[11] = t2;
46114
- } else {
46115
- t2 = $[11];
46116
- }
46117
- return t2;
46118
- };
46119
- // src/components/threads/Thread/index.tsx
46120
- var import_jsx_runtime80 = require("react/jsx-runtime");
46121
46369
  function ownKeys41(e, r) {
46122
46370
  var t = Object.keys(e);
46123
46371
  if (Object.getOwnPropertySymbols) {
@@ -46161,8 +46409,126 @@ function _toPrimitive41(t, r) {
46161
46409
  }
46162
46410
  return ("string" === r ? String : Number)(t);
46163
46411
  }
46412
+ function _objectWithoutProperties5(e, t) {
46413
+ if (null == e) return {};
46414
+ var o, r, i = _objectWithoutPropertiesLoose5(e, t);
46415
+ if (Object.getOwnPropertySymbols) {
46416
+ var n = Object.getOwnPropertySymbols(e);
46417
+ for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
46418
+ }
46419
+ return i;
46420
+ }
46421
+ function _objectWithoutPropertiesLoose5(r, e) {
46422
+ if (null == r) return {};
46423
+ var t = {};
46424
+ for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
46425
+ if (-1 !== e.indexOf(n)) continue;
46426
+ t[n] = r[n];
46427
+ }
46428
+ return t;
46429
+ }
46430
+ var Root12 = function(t0) {
46431
+ var $ = (0, import_react_compiler_runtime78.c)(12);
46432
+ var children;
46433
+ var className;
46434
+ var rest;
46435
+ var style;
46436
+ if ($[0] !== t0) {
46437
+ var _t = t0;
46438
+ var ref;
46439
+ ref = _t, children = ref.children, style = ref.style, className = ref.className, ref;
46440
+ rest = _objectWithoutProperties5(_t, _excluded5);
46441
+ _t;
46442
+ $[0] = t0;
46443
+ $[1] = children;
46444
+ $[2] = className;
46445
+ $[3] = rest;
46446
+ $[4] = style;
46447
+ } else {
46448
+ children = $[1];
46449
+ className = $[2];
46450
+ rest = $[3];
46451
+ style = $[4];
46452
+ }
46453
+ var t1;
46454
+ if ($[5] !== children || $[6] !== className || $[7] !== style) {
46455
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_themes53.Flex, {
46456
+ direction: "column",
46457
+ flexGrow: "1",
46458
+ className: className,
46459
+ style: style,
46460
+ children: children
46461
+ });
46462
+ $[5] = children;
46463
+ $[6] = className;
46464
+ $[7] = style;
46465
+ $[8] = t1;
46466
+ } else {
46467
+ t1 = $[8];
46468
+ }
46469
+ var t2;
46470
+ if ($[9] !== rest || $[10] !== t1) {
46471
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ToastsProvider, {
46472
+ bottom: "var(--space-9)",
46473
+ children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Provider2, _objectSpread41(_objectSpread41({}, rest), {}, {
46474
+ children: t1
46475
+ }))
46476
+ });
46477
+ $[9] = rest;
46478
+ $[10] = t1;
46479
+ $[11] = t2;
46480
+ } else {
46481
+ t2 = $[11];
46482
+ }
46483
+ return t2;
46484
+ };
46485
+ // src/components/threads/Thread/index.tsx
46486
+ var import_jsx_runtime80 = require("react/jsx-runtime");
46487
+ function ownKeys42(e, r) {
46488
+ var t = Object.keys(e);
46489
+ if (Object.getOwnPropertySymbols) {
46490
+ var o = Object.getOwnPropertySymbols(e);
46491
+ r && (o = o.filter(function(r2) {
46492
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
46493
+ })), t.push.apply(t, o);
46494
+ }
46495
+ return t;
46496
+ }
46497
+ function _objectSpread42(e) {
46498
+ for(var r = 1; r < arguments.length; r++){
46499
+ var t = null != arguments[r] ? arguments[r] : {};
46500
+ r % 2 ? ownKeys42(Object(t), true).forEach(function(r2) {
46501
+ _defineProperty42(e, r2, t[r2]);
46502
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys42(Object(t)).forEach(function(r2) {
46503
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
46504
+ });
46505
+ }
46506
+ return e;
46507
+ }
46508
+ function _defineProperty42(e, r, t) {
46509
+ return (r = _toPropertyKey42(r)) in e ? Object.defineProperty(e, r, {
46510
+ value: t,
46511
+ enumerable: true,
46512
+ configurable: true,
46513
+ writable: true
46514
+ }) : e[r] = t, e;
46515
+ }
46516
+ function _toPropertyKey42(t) {
46517
+ var i = _toPrimitive42(t, "string");
46518
+ return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
46519
+ }
46520
+ function _toPrimitive42(t, r) {
46521
+ if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
46522
+ var e = t[Symbol.toPrimitive];
46523
+ if (void 0 !== e) {
46524
+ var i = e.call(t, r || "default");
46525
+ if ("object" != (typeof i === "undefined" ? "undefined" : _type_of(i))) return i;
46526
+ throw new TypeError("@@toPrimitive must return a primitive value.");
46527
+ }
46528
+ return ("string" === r ? String : Number)(t);
46529
+ }
46164
46530
  var Thread = function(props) {
46165
- var $ = (0, import_react_compiler_runtime78.c)(4);
46531
+ var $ = (0, import_react_compiler_runtime79.c)(4);
46166
46532
  var t0;
46167
46533
  var t1;
46168
46534
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -46176,7 +46542,7 @@ var Thread = function(props) {
46176
46542
  }
46177
46543
  var t2;
46178
46544
  if ($[2] !== props) {
46179
- t2 = /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Root12, _objectSpread41(_objectSpread41({}, props), {}, {
46545
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Root12, _objectSpread42(_objectSpread42({}, props), {}, {
46180
46546
  children: [
46181
46547
  t0,
46182
46548
  t1
@@ -46193,18 +46559,18 @@ Thread.Root = Root12;
46193
46559
  Thread.Messages = Messages2;
46194
46560
  Thread.MessageForm = MessageForm;
46195
46561
  // src/hooks/messages/useMessageContext/index.ts
46196
- var import_react58 = require("react");
46562
+ var import_react59 = require("react");
46197
46563
  var useMessageContext = function() {
46198
- return (0, import_react58.useContext)(MessageContext);
46564
+ return (0, import_react59.useContext)(MessageContext);
46199
46565
  };
46200
46566
  // src/hooks/assistants/useAssistant/index.ts
46201
- var import_react_compiler_runtime79 = require("react-compiler-runtime");
46202
- var import_react59 = require("react");
46567
+ var import_react_compiler_runtime80 = require("react-compiler-runtime");
46568
+ var import_react60 = require("react");
46203
46569
  var import_react_query9 = require("@tanstack/react-query");
46204
46570
  // src/hooks/assistants/useAssistant/lib/queryOptions/index.ts
46205
46571
  var import_react_query8 = require("@tanstack/react-query");
46206
46572
  // src/hooks/assistants/useAssistant/lib/queryOptions/queryFn.ts
46207
- function asyncGeneratorStep9(n, t, e, r, o, a, c) {
46573
+ function asyncGeneratorStep10(n, t, e, r, o, a, c) {
46208
46574
  try {
46209
46575
  var i = n[a](c), u = i.value;
46210
46576
  } catch (n2) {
@@ -46212,16 +46578,16 @@ function asyncGeneratorStep9(n, t, e, r, o, a, c) {
46212
46578
  }
46213
46579
  i.done ? t(u) : Promise.resolve(u).then(r, o);
46214
46580
  }
46215
- function _asyncToGenerator9(n) {
46581
+ function _asyncToGenerator10(n) {
46216
46582
  return function() {
46217
46583
  var t = this, e = arguments;
46218
46584
  return new Promise(function(r, o) {
46219
46585
  var a = n.apply(t, e);
46220
46586
  function _next(n2) {
46221
- asyncGeneratorStep9(a, r, o, _next, _throw, "next", n2);
46587
+ asyncGeneratorStep10(a, r, o, _next, _throw, "next", n2);
46222
46588
  }
46223
46589
  function _throw(n2) {
46224
- asyncGeneratorStep9(a, r, o, _next, _throw, "throw", n2);
46590
+ asyncGeneratorStep10(a, r, o, _next, _throw, "throw", n2);
46225
46591
  }
46226
46592
  _next(void 0);
46227
46593
  });
@@ -46230,7 +46596,7 @@ function _asyncToGenerator9(n) {
46230
46596
  var queryFn = function(_ref) {
46231
46597
  var superinterfaceContext = _ref.superinterfaceContext;
46232
46598
  return /* @__PURE__ */ function() {
46233
- var _ref3 = _asyncToGenerator9(function(_ref2) {
46599
+ var _ref3 = _asyncToGenerator10(function(_ref2) {
46234
46600
  var queryKey, _queryKey, _key, assistantId, params;
46235
46601
  return _ts_generator(this, function(_state) {
46236
46602
  queryKey = _ref2.queryKey;
@@ -46241,7 +46607,7 @@ var queryFn = function(_ref) {
46241
46607
  return [
46242
46608
  2,
46243
46609
  fetch("".concat(superinterfaceContext.baseUrl, "/assistants/").concat(assistantId, "?").concat(params)).then(/* @__PURE__ */ function() {
46244
- var _ref4 = _asyncToGenerator9(function(response) {
46610
+ var _ref4 = _asyncToGenerator10(function(response) {
46245
46611
  var errorResponse, error;
46246
46612
  return _ts_generator(this, function(_state) {
46247
46613
  switch(_state.label){
@@ -46304,7 +46670,7 @@ var queryOptions2 = function(_ref) {
46304
46670
  });
46305
46671
  };
46306
46672
  // src/hooks/assistants/useAssistant/index.ts
46307
- function ownKeys42(e, r) {
46673
+ function ownKeys43(e, r) {
46308
46674
  var t = Object.keys(e);
46309
46675
  if (Object.getOwnPropertySymbols) {
46310
46676
  var o = Object.getOwnPropertySymbols(e);
@@ -46314,30 +46680,30 @@ function ownKeys42(e, r) {
46314
46680
  }
46315
46681
  return t;
46316
46682
  }
46317
- function _objectSpread42(e) {
46683
+ function _objectSpread43(e) {
46318
46684
  for(var r = 1; r < arguments.length; r++){
46319
46685
  var t = null != arguments[r] ? arguments[r] : {};
46320
- r % 2 ? ownKeys42(Object(t), true).forEach(function(r2) {
46321
- _defineProperty42(e, r2, t[r2]);
46322
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys42(Object(t)).forEach(function(r2) {
46686
+ r % 2 ? ownKeys43(Object(t), true).forEach(function(r2) {
46687
+ _defineProperty43(e, r2, t[r2]);
46688
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys43(Object(t)).forEach(function(r2) {
46323
46689
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
46324
46690
  });
46325
46691
  }
46326
46692
  return e;
46327
46693
  }
46328
- function _defineProperty42(e, r, t) {
46329
- return (r = _toPropertyKey42(r)) in e ? Object.defineProperty(e, r, {
46694
+ function _defineProperty43(e, r, t) {
46695
+ return (r = _toPropertyKey43(r)) in e ? Object.defineProperty(e, r, {
46330
46696
  value: t,
46331
46697
  enumerable: true,
46332
46698
  configurable: true,
46333
46699
  writable: true
46334
46700
  }) : e[r] = t, e;
46335
46701
  }
46336
- function _toPropertyKey42(t) {
46337
- var i = _toPrimitive42(t, "string");
46702
+ function _toPropertyKey43(t) {
46703
+ var i = _toPrimitive43(t, "string");
46338
46704
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
46339
46705
  }
46340
- function _toPrimitive42(t, r) {
46706
+ function _toPrimitive43(t, r) {
46341
46707
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
46342
46708
  var e = t[Symbol.toPrimitive];
46343
46709
  if (void 0 !== e) {
@@ -46348,7 +46714,7 @@ function _toPrimitive42(t, r) {
46348
46714
  return ("string" === r ? String : Number)(t);
46349
46715
  }
46350
46716
  var useAssistant = function(t0) {
46351
- var $ = (0, import_react_compiler_runtime79.c)(6);
46717
+ var $ = (0, import_react_compiler_runtime80.c)(6);
46352
46718
  var assistantId = t0.assistantId;
46353
46719
  var superinterfaceContext = useSuperinterfaceContext();
46354
46720
  var t1;
@@ -46368,7 +46734,7 @@ var useAssistant = function(t0) {
46368
46734
  var t3 = props.data ? props.data.assistant : null;
46369
46735
  var t4;
46370
46736
  if ($[3] !== props || $[4] !== t3) {
46371
- t4 = _objectSpread42(_objectSpread42({}, props), {}, {
46737
+ t4 = _objectSpread43(_objectSpread43({}, props), {}, {
46372
46738
  assistant: t3
46373
46739
  });
46374
46740
  $[3] = props;
@@ -46381,30 +46747,30 @@ var useAssistant = function(t0) {
46381
46747
  return t2;
46382
46748
  };
46383
46749
  // src/components/threads/ThreadDialog/index.tsx
46384
- var import_react_compiler_runtime86 = require("react-compiler-runtime");
46750
+ var import_react_compiler_runtime87 = require("react-compiler-runtime");
46385
46751
  // src/components/threads/ThreadDialog/Root/index.tsx
46386
- var import_react_compiler_runtime81 = require("react-compiler-runtime");
46752
+ var import_react_compiler_runtime82 = require("react-compiler-runtime");
46387
46753
  // src/components/threads/ThreadDialog/Provider/index.tsx
46388
- var import_react_compiler_runtime80 = require("react-compiler-runtime");
46389
- var import_react62 = require("react");
46754
+ var import_react_compiler_runtime81 = require("react-compiler-runtime");
46755
+ var import_react63 = require("react");
46390
46756
  // src/contexts/threads/ThreadDialogContext/index.ts
46391
- var import_react60 = require("react");
46392
- var ThreadDialogContext = /* @__PURE__ */ (0, import_react60.createContext)({
46757
+ var import_react61 = require("react");
46758
+ var ThreadDialogContext = /* @__PURE__ */ (0, import_react61.createContext)({
46393
46759
  isOpen: false,
46394
46760
  setIsOpen: function() {}
46395
46761
  });
46396
46762
  // src/hooks/threads/useThreadDialogContext/index.ts
46397
- var import_react61 = require("react");
46763
+ var import_react62 = require("react");
46398
46764
  var useThreadDialogContext = function() {
46399
- return (0, import_react61.useContext)(ThreadDialogContext);
46765
+ return (0, import_react62.useContext)(ThreadDialogContext);
46400
46766
  };
46401
46767
  // src/components/threads/ThreadDialog/Provider/index.tsx
46402
46768
  var import_jsx_runtime81 = require("react/jsx-runtime");
46403
46769
  var Provider4 = function(t0) {
46404
- var $ = (0, import_react_compiler_runtime80.c)(5);
46770
+ var $ = (0, import_react_compiler_runtime81.c)(5);
46405
46771
  var children = t0.children;
46406
46772
  var threadDialogContext = useThreadDialogContext();
46407
- var _ref = _sliced_to_array((0, import_react62.useState)(threadDialogContext.isOpen), 2), isOpen = _ref[0], setIsOpen = _ref[1];
46773
+ var _ref = _sliced_to_array((0, import_react63.useState)(threadDialogContext.isOpen), 2), isOpen = _ref[0], setIsOpen = _ref[1];
46408
46774
  var t1;
46409
46775
  if ($[0] !== isOpen) {
46410
46776
  t1 = {
@@ -46433,7 +46799,7 @@ var Provider4 = function(t0) {
46433
46799
  // src/components/threads/ThreadDialog/Root/index.tsx
46434
46800
  var import_jsx_runtime82 = require("react/jsx-runtime");
46435
46801
  var Root13 = function(t0) {
46436
- var $ = (0, import_react_compiler_runtime81.c)(2);
46802
+ var $ = (0, import_react_compiler_runtime82.c)(2);
46437
46803
  var children = t0.children;
46438
46804
  var t1;
46439
46805
  if ($[0] !== children) {
@@ -46448,14 +46814,14 @@ var Root13 = function(t0) {
46448
46814
  return t1;
46449
46815
  };
46450
46816
  // src/components/threads/ThreadDialog/Trigger/index.tsx
46451
- var import_react_compiler_runtime83 = require("react-compiler-runtime");
46817
+ var import_react_compiler_runtime84 = require("react-compiler-runtime");
46452
46818
  var import_themes55 = require("@radix-ui/themes");
46453
46819
  // src/components/threads/ThreadDialog/Trigger/Button.tsx
46454
- var import_react_compiler_runtime82 = require("react-compiler-runtime");
46820
+ var import_react_compiler_runtime83 = require("react-compiler-runtime");
46455
46821
  var import_themes54 = require("@radix-ui/themes");
46456
46822
  var import_react_icons15 = require("@radix-ui/react-icons");
46457
46823
  var import_jsx_runtime83 = require("react/jsx-runtime");
46458
- function ownKeys43(e, r) {
46824
+ function ownKeys44(e, r) {
46459
46825
  var t = Object.keys(e);
46460
46826
  if (Object.getOwnPropertySymbols) {
46461
46827
  var o = Object.getOwnPropertySymbols(e);
@@ -46465,30 +46831,30 @@ function ownKeys43(e, r) {
46465
46831
  }
46466
46832
  return t;
46467
46833
  }
46468
- function _objectSpread43(e) {
46834
+ function _objectSpread44(e) {
46469
46835
  for(var r = 1; r < arguments.length; r++){
46470
46836
  var t = null != arguments[r] ? arguments[r] : {};
46471
- r % 2 ? ownKeys43(Object(t), true).forEach(function(r2) {
46472
- _defineProperty43(e, r2, t[r2]);
46473
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys43(Object(t)).forEach(function(r2) {
46837
+ r % 2 ? ownKeys44(Object(t), true).forEach(function(r2) {
46838
+ _defineProperty44(e, r2, t[r2]);
46839
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys44(Object(t)).forEach(function(r2) {
46474
46840
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
46475
46841
  });
46476
46842
  }
46477
46843
  return e;
46478
46844
  }
46479
- function _defineProperty43(e, r, t) {
46480
- return (r = _toPropertyKey43(r)) in e ? Object.defineProperty(e, r, {
46845
+ function _defineProperty44(e, r, t) {
46846
+ return (r = _toPropertyKey44(r)) in e ? Object.defineProperty(e, r, {
46481
46847
  value: t,
46482
46848
  enumerable: true,
46483
46849
  configurable: true,
46484
46850
  writable: true
46485
46851
  }) : e[r] = t, e;
46486
46852
  }
46487
- function _toPropertyKey43(t) {
46488
- var i = _toPrimitive43(t, "string");
46853
+ function _toPropertyKey44(t) {
46854
+ var i = _toPrimitive44(t, "string");
46489
46855
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
46490
46856
  }
46491
- function _toPrimitive43(t, r) {
46857
+ function _toPrimitive44(t, r) {
46492
46858
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
46493
46859
  var e = t[Symbol.toPrimitive];
46494
46860
  if (void 0 !== e) {
@@ -46499,7 +46865,7 @@ function _toPrimitive43(t, r) {
46499
46865
  return ("string" === r ? String : Number)(t);
46500
46866
  }
46501
46867
  var Button4 = function(props) {
46502
- var $ = (0, import_react_compiler_runtime82.c)(3);
46868
+ var $ = (0, import_react_compiler_runtime83.c)(3);
46503
46869
  var t0;
46504
46870
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46505
46871
  t0 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_react_icons15.ChatBubbleIcon, {});
@@ -46509,7 +46875,7 @@ var Button4 = function(props) {
46509
46875
  }
46510
46876
  var t1;
46511
46877
  if ($[1] !== props) {
46512
- t1 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_themes54.IconButton, _objectSpread43(_objectSpread43({
46878
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_themes54.IconButton, _objectSpread44(_objectSpread44({
46513
46879
  size: "4",
46514
46880
  radius: "full"
46515
46881
  }, props), {}, {
@@ -46524,7 +46890,7 @@ var Button4 = function(props) {
46524
46890
  };
46525
46891
  // src/components/threads/ThreadDialog/Trigger/index.tsx
46526
46892
  var import_jsx_runtime84 = require("react/jsx-runtime");
46527
- function ownKeys44(e, r) {
46893
+ function ownKeys45(e, r) {
46528
46894
  var t = Object.keys(e);
46529
46895
  if (Object.getOwnPropertySymbols) {
46530
46896
  var o = Object.getOwnPropertySymbols(e);
@@ -46534,30 +46900,30 @@ function ownKeys44(e, r) {
46534
46900
  }
46535
46901
  return t;
46536
46902
  }
46537
- function _objectSpread44(e) {
46903
+ function _objectSpread45(e) {
46538
46904
  for(var r = 1; r < arguments.length; r++){
46539
46905
  var t = null != arguments[r] ? arguments[r] : {};
46540
- r % 2 ? ownKeys44(Object(t), true).forEach(function(r2) {
46541
- _defineProperty44(e, r2, t[r2]);
46542
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys44(Object(t)).forEach(function(r2) {
46906
+ r % 2 ? ownKeys45(Object(t), true).forEach(function(r2) {
46907
+ _defineProperty45(e, r2, t[r2]);
46908
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys45(Object(t)).forEach(function(r2) {
46543
46909
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
46544
46910
  });
46545
46911
  }
46546
46912
  return e;
46547
46913
  }
46548
- function _defineProperty44(e, r, t) {
46549
- return (r = _toPropertyKey44(r)) in e ? Object.defineProperty(e, r, {
46914
+ function _defineProperty45(e, r, t) {
46915
+ return (r = _toPropertyKey45(r)) in e ? Object.defineProperty(e, r, {
46550
46916
  value: t,
46551
46917
  enumerable: true,
46552
46918
  configurable: true,
46553
46919
  writable: true
46554
46920
  }) : e[r] = t, e;
46555
46921
  }
46556
- function _toPropertyKey44(t) {
46557
- var i = _toPrimitive44(t, "string");
46922
+ function _toPropertyKey45(t) {
46923
+ var i = _toPrimitive45(t, "string");
46558
46924
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
46559
46925
  }
46560
- function _toPrimitive44(t, r) {
46926
+ function _toPrimitive45(t, r) {
46561
46927
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
46562
46928
  var e = t[Symbol.toPrimitive];
46563
46929
  if (void 0 !== e) {
@@ -46568,7 +46934,7 @@ function _toPrimitive44(t, r) {
46568
46934
  return ("string" === r ? String : Number)(t);
46569
46935
  }
46570
46936
  var Root14 = function(t0) {
46571
- var $ = (0, import_react_compiler_runtime83.c)(14);
46937
+ var $ = (0, import_react_compiler_runtime84.c)(14);
46572
46938
  var children = t0.children, style = t0.style, className = t0.className;
46573
46939
  var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
46574
46940
  var t1 = isOpen ? "none" : "flex";
@@ -46586,7 +46952,7 @@ var Root14 = function(t0) {
46586
46952
  var t3;
46587
46953
  if ($[2] !== setIsOpen) {
46588
46954
  t3 = function() {
46589
- return setIsOpen(_temp6);
46955
+ return setIsOpen(_temp7);
46590
46956
  };
46591
46957
  $[2] = setIsOpen;
46592
46958
  $[3] = t3;
@@ -46603,7 +46969,7 @@ var Root14 = function(t0) {
46603
46969
  }
46604
46970
  var t5;
46605
46971
  if ($[6] !== t4) {
46606
- t5 = _objectSpread44({
46972
+ t5 = _objectSpread45({
46607
46973
  zIndex: 9999999999
46608
46974
  }, t4);
46609
46975
  $[6] = t4;
@@ -46639,7 +47005,7 @@ var Root14 = function(t0) {
46639
47005
  return t6;
46640
47006
  };
46641
47007
  var Trigger = function(args) {
46642
- var $ = (0, import_react_compiler_runtime83.c)(3);
47008
+ var $ = (0, import_react_compiler_runtime84.c)(3);
46643
47009
  var t0;
46644
47010
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46645
47011
  t0 = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Button4, {});
@@ -46649,7 +47015,7 @@ var Trigger = function(args) {
46649
47015
  }
46650
47016
  var t1;
46651
47017
  if ($[1] !== args) {
46652
- t1 = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Root14, _objectSpread44(_objectSpread44({}, args), {}, {
47018
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Root14, _objectSpread45(_objectSpread45({}, args), {}, {
46653
47019
  children: t0
46654
47020
  }));
46655
47021
  $[1] = args;
@@ -46661,19 +47027,19 @@ var Trigger = function(args) {
46661
47027
  };
46662
47028
  Trigger.Root = Root14;
46663
47029
  Trigger.Button = Button4;
46664
- function _temp6(prev) {
47030
+ function _temp7(prev) {
46665
47031
  return !prev;
46666
47032
  }
46667
47033
  // src/components/threads/ThreadDialog/Content/index.tsx
46668
- var import_react_compiler_runtime85 = require("react-compiler-runtime");
47034
+ var import_react_compiler_runtime86 = require("react-compiler-runtime");
46669
47035
  var import_themes57 = require("@radix-ui/themes");
46670
47036
  // src/components/threads/ThreadDialog/Close/index.tsx
46671
- var import_react_compiler_runtime84 = require("react-compiler-runtime");
47037
+ var import_react_compiler_runtime85 = require("react-compiler-runtime");
46672
47038
  var import_react_icons16 = require("@radix-ui/react-icons");
46673
47039
  var import_themes56 = require("@radix-ui/themes");
46674
47040
  var import_jsx_runtime85 = require("react/jsx-runtime");
46675
47041
  var Close = function() {
46676
- var $ = (0, import_react_compiler_runtime84.c)(9);
47042
+ var $ = (0, import_react_compiler_runtime85.c)(9);
46677
47043
  var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
46678
47044
  var t0 = isOpen ? "flex" : "none";
46679
47045
  var t1;
@@ -46690,7 +47056,7 @@ var Close = function() {
46690
47056
  var t2;
46691
47057
  if ($[2] !== setIsOpen) {
46692
47058
  t2 = function() {
46693
- return setIsOpen(_temp7);
47059
+ return setIsOpen(_temp8);
46694
47060
  };
46695
47061
  $[2] = setIsOpen;
46696
47062
  $[3] = t2;
@@ -46740,12 +47106,12 @@ var Close = function() {
46740
47106
  }
46741
47107
  return t5;
46742
47108
  };
46743
- function _temp7(prev) {
47109
+ function _temp8(prev) {
46744
47110
  return !prev;
46745
47111
  }
46746
47112
  // src/components/threads/ThreadDialog/Content/index.tsx
46747
47113
  var import_jsx_runtime86 = require("react/jsx-runtime");
46748
- function ownKeys45(e, r) {
47114
+ function ownKeys46(e, r) {
46749
47115
  var t = Object.keys(e);
46750
47116
  if (Object.getOwnPropertySymbols) {
46751
47117
  var o = Object.getOwnPropertySymbols(e);
@@ -46755,30 +47121,30 @@ function ownKeys45(e, r) {
46755
47121
  }
46756
47122
  return t;
46757
47123
  }
46758
- function _objectSpread45(e) {
47124
+ function _objectSpread46(e) {
46759
47125
  for(var r = 1; r < arguments.length; r++){
46760
47126
  var t = null != arguments[r] ? arguments[r] : {};
46761
- r % 2 ? ownKeys45(Object(t), true).forEach(function(r2) {
46762
- _defineProperty45(e, r2, t[r2]);
46763
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys45(Object(t)).forEach(function(r2) {
47127
+ r % 2 ? ownKeys46(Object(t), true).forEach(function(r2) {
47128
+ _defineProperty46(e, r2, t[r2]);
47129
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys46(Object(t)).forEach(function(r2) {
46764
47130
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
46765
47131
  });
46766
47132
  }
46767
47133
  return e;
46768
47134
  }
46769
- function _defineProperty45(e, r, t) {
46770
- return (r = _toPropertyKey45(r)) in e ? Object.defineProperty(e, r, {
47135
+ function _defineProperty46(e, r, t) {
47136
+ return (r = _toPropertyKey46(r)) in e ? Object.defineProperty(e, r, {
46771
47137
  value: t,
46772
47138
  enumerable: true,
46773
47139
  configurable: true,
46774
47140
  writable: true
46775
47141
  }) : e[r] = t, e;
46776
47142
  }
46777
- function _toPropertyKey45(t) {
46778
- var i = _toPrimitive45(t, "string");
47143
+ function _toPropertyKey46(t) {
47144
+ var i = _toPrimitive46(t, "string");
46779
47145
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
46780
47146
  }
46781
- function _toPrimitive45(t, r) {
47147
+ function _toPrimitive46(t, r) {
46782
47148
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
46783
47149
  var e = t[Symbol.toPrimitive];
46784
47150
  if (void 0 !== e) {
@@ -46789,7 +47155,7 @@ function _toPrimitive45(t, r) {
46789
47155
  return ("string" === r ? String : Number)(t);
46790
47156
  }
46791
47157
  var Root15 = function(t0) {
46792
- var $ = (0, import_react_compiler_runtime85.c)(19);
47158
+ var $ = (0, import_react_compiler_runtime86.c)(19);
46793
47159
  var children = t0.children, className = t0.className, style = t0.style;
46794
47160
  var isOpen = useThreadDialogContext().isOpen;
46795
47161
  if (!isOpen) {
@@ -46838,7 +47204,7 @@ var Root15 = function(t0) {
46838
47204
  }
46839
47205
  var t6;
46840
47206
  if ($[5] !== style) {
46841
- t6 = _objectSpread45({
47207
+ t6 = _objectSpread46({
46842
47208
  zIndex: 9999999999
46843
47209
  }, style);
46844
47210
  $[5] = style;
@@ -46936,11 +47302,11 @@ var Root15 = function(t0) {
46936
47302
  return t13;
46937
47303
  };
46938
47304
  var Messages3 = function(t0) {
46939
- var $ = (0, import_react_compiler_runtime85.c)(5);
47305
+ var $ = (0, import_react_compiler_runtime86.c)(5);
46940
47306
  var className = t0.className, style = t0.style;
46941
47307
  var t1;
46942
47308
  if ($[0] !== style) {
46943
- t1 = _objectSpread45({
47309
+ t1 = _objectSpread46({
46944
47310
  paddingTop: "var(--space-5)",
46945
47311
  paddingRight: "var(--space-5)",
46946
47312
  paddingLeft: "var(--space-5)"
@@ -46965,7 +47331,7 @@ var Messages3 = function(t0) {
46965
47331
  return t2;
46966
47332
  };
46967
47333
  var FormContainer = function(t0) {
46968
- var $ = (0, import_react_compiler_runtime85.c)(4);
47334
+ var $ = (0, import_react_compiler_runtime86.c)(4);
46969
47335
  var children = t0.children, className = t0.className, style = t0.style;
46970
47336
  var t1;
46971
47337
  if ($[0] !== children || $[1] !== className || $[2] !== style) {
@@ -46989,7 +47355,7 @@ var FormContainer = function(t0) {
46989
47355
  return t1;
46990
47356
  };
46991
47357
  var Content8 = function(props) {
46992
- var $ = (0, import_react_compiler_runtime85.c)(4);
47358
+ var $ = (0, import_react_compiler_runtime86.c)(4);
46993
47359
  var t0;
46994
47360
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
46995
47361
  t0 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Messages3, {});
@@ -47013,7 +47379,7 @@ var Content8 = function(props) {
47013
47379
  }
47014
47380
  var t2;
47015
47381
  if ($[2] !== props) {
47016
- t2 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Root15, _objectSpread45(_objectSpread45({}, props), {}, {
47382
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Root15, _objectSpread46(_objectSpread46({}, props), {}, {
47017
47383
  children: t1
47018
47384
  }));
47019
47385
  $[2] = props;
@@ -47029,7 +47395,7 @@ Content8.FormContainer = FormContainer;
47029
47395
  // src/components/threads/ThreadDialog/index.tsx
47030
47396
  var import_jsx_runtime87 = require("react/jsx-runtime");
47031
47397
  var ThreadDialog = function() {
47032
- var $ = (0, import_react_compiler_runtime86.c)(1);
47398
+ var $ = (0, import_react_compiler_runtime87.c)(1);
47033
47399
  var t0;
47034
47400
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
47035
47401
  t0 = /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Root13, {
@@ -47048,30 +47414,30 @@ ThreadDialog.Root = Root13;
47048
47414
  ThreadDialog.Trigger = Trigger;
47049
47415
  ThreadDialog.Content = Content8;
47050
47416
  // src/components/threads/AudioThreadDialog/index.tsx
47051
- var import_react_compiler_runtime101 = require("react-compiler-runtime");
47417
+ var import_react_compiler_runtime102 = require("react-compiler-runtime");
47052
47418
  // src/components/threads/AudioThread/index.tsx
47053
- var import_react_compiler_runtime100 = require("react-compiler-runtime");
47419
+ var import_react_compiler_runtime101 = require("react-compiler-runtime");
47054
47420
  // src/components/threads/AudioThread/Root/index.tsx
47055
- var import_react_compiler_runtime92 = require("react-compiler-runtime");
47421
+ var import_react_compiler_runtime93 = require("react-compiler-runtime");
47056
47422
  var import_themes58 = require("@radix-ui/themes");
47057
47423
  // src/contexts/threads/AudioThreadContext/index.ts
47058
- var import_react63 = require("react");
47059
- var AudioThreadContext = /* @__PURE__ */ (0, import_react63.createContext)({
47424
+ var import_react64 = require("react");
47425
+ var AudioThreadContext = /* @__PURE__ */ (0, import_react64.createContext)({
47060
47426
  audioRuntime: null
47061
47427
  });
47062
47428
  // src/hooks/threads/useAudioThreadContext/index.ts
47063
- var import_react64 = require("react");
47429
+ var import_react65 = require("react");
47064
47430
  var useAudioThreadContext = function() {
47065
- return (0, import_react64.useContext)(AudioThreadContext);
47431
+ return (0, import_react65.useContext)(AudioThreadContext);
47066
47432
  };
47067
47433
  // src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
47068
- var import_react_compiler_runtime91 = require("react-compiler-runtime");
47434
+ var import_react_compiler_runtime92 = require("react-compiler-runtime");
47069
47435
  // src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
47070
- var import_react_compiler_runtime90 = require("react-compiler-runtime");
47071
- var import_react69 = require("react");
47436
+ var import_react_compiler_runtime91 = require("react-compiler-runtime");
47437
+ var import_react70 = require("react");
47072
47438
  // src/hooks/misc/usePermission/index.ts
47073
- var import_react_compiler_runtime87 = require("react-compiler-runtime");
47074
- var import_react65 = require("react");
47439
+ var import_react_compiler_runtime88 = require("react-compiler-runtime");
47440
+ var import_react66 = require("react");
47075
47441
  // src/hooks/misc/usePermission/util.ts
47076
47442
  var noop = function() {};
47077
47443
  function on(obj) {
@@ -47094,8 +47460,8 @@ function off(obj) {
47094
47460
  }
47095
47461
  // src/hooks/misc/usePermission/index.ts
47096
47462
  var usePermission = function(permissionDesc) {
47097
- var $ = (0, import_react_compiler_runtime87.c)(3);
47098
- var _ref = _sliced_to_array((0, import_react65.useState)(""), 2), state = _ref[0], setState = _ref[1];
47463
+ var $ = (0, import_react_compiler_runtime88.c)(3);
47464
+ var _ref = _sliced_to_array((0, import_react66.useState)(""), 2), state = _ref[0], setState = _ref[1];
47099
47465
  var t0;
47100
47466
  var t1;
47101
47467
  if ($[0] !== permissionDesc) {
@@ -47134,20 +47500,20 @@ var usePermission = function(permissionDesc) {
47134
47500
  t0 = $[1];
47135
47501
  t1 = $[2];
47136
47502
  }
47137
- (0, import_react65.useEffect)(t0, t1);
47503
+ (0, import_react66.useEffect)(t0, t1);
47138
47504
  return state;
47139
47505
  };
47140
47506
  // src/hooks/audioThreads/useRecorder/index.ts
47141
47507
  var import_dayjs3 = __toESM(require("dayjs"), 1);
47142
47508
  var import_use_audio_capture = require("@supercorp/use-audio-capture");
47143
- var import_react67 = require("react");
47509
+ var import_react68 = require("react");
47144
47510
  var import_react_use_audio_player = require("react-use-audio-player");
47145
47511
  // src/hooks/misc/useInterval.ts
47146
- var import_react_compiler_runtime88 = require("react-compiler-runtime");
47147
- var import_react66 = require("react");
47512
+ var import_react_compiler_runtime89 = require("react-compiler-runtime");
47513
+ var import_react67 = require("react");
47148
47514
  var useInterval = function(callback, delay) {
47149
- var $ = (0, import_react_compiler_runtime88.c)(5);
47150
- var savedCallback = (0, import_react66.useRef)(_temp8);
47515
+ var $ = (0, import_react_compiler_runtime89.c)(5);
47516
+ var savedCallback = (0, import_react67.useRef)(_temp9);
47151
47517
  var t0;
47152
47518
  if ($[0] !== callback) {
47153
47519
  t0 = function() {
@@ -47158,7 +47524,7 @@ var useInterval = function(callback, delay) {
47158
47524
  } else {
47159
47525
  t0 = $[1];
47160
47526
  }
47161
- (0, import_react66.useEffect)(t0);
47527
+ (0, import_react67.useEffect)(t0);
47162
47528
  var t1;
47163
47529
  var t2;
47164
47530
  if ($[2] !== delay) {
@@ -47182,11 +47548,11 @@ var useInterval = function(callback, delay) {
47182
47548
  t1 = $[3];
47183
47549
  t2 = $[4];
47184
47550
  }
47185
- (0, import_react66.useEffect)(t1, t2);
47551
+ (0, import_react67.useEffect)(t1, t2);
47186
47552
  };
47187
- function _temp8() {}
47553
+ function _temp9() {}
47188
47554
  // src/hooks/audioThreads/useRecorder/index.ts
47189
- function ownKeys46(e, r) {
47555
+ function ownKeys47(e, r) {
47190
47556
  var t = Object.keys(e);
47191
47557
  if (Object.getOwnPropertySymbols) {
47192
47558
  var o = Object.getOwnPropertySymbols(e);
@@ -47196,30 +47562,30 @@ function ownKeys46(e, r) {
47196
47562
  }
47197
47563
  return t;
47198
47564
  }
47199
- function _objectSpread46(e) {
47565
+ function _objectSpread47(e) {
47200
47566
  for(var r = 1; r < arguments.length; r++){
47201
47567
  var t = null != arguments[r] ? arguments[r] : {};
47202
- r % 2 ? ownKeys46(Object(t), true).forEach(function(r2) {
47203
- _defineProperty46(e, r2, t[r2]);
47204
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys46(Object(t)).forEach(function(r2) {
47568
+ r % 2 ? ownKeys47(Object(t), true).forEach(function(r2) {
47569
+ _defineProperty47(e, r2, t[r2]);
47570
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys47(Object(t)).forEach(function(r2) {
47205
47571
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
47206
47572
  });
47207
47573
  }
47208
47574
  return e;
47209
47575
  }
47210
- function _defineProperty46(e, r, t) {
47211
- return (r = _toPropertyKey46(r)) in e ? Object.defineProperty(e, r, {
47576
+ function _defineProperty47(e, r, t) {
47577
+ return (r = _toPropertyKey47(r)) in e ? Object.defineProperty(e, r, {
47212
47578
  value: t,
47213
47579
  enumerable: true,
47214
47580
  configurable: true,
47215
47581
  writable: true
47216
47582
  }) : e[r] = t, e;
47217
47583
  }
47218
- function _toPropertyKey46(t) {
47219
- var i = _toPrimitive46(t, "string");
47584
+ function _toPropertyKey47(t) {
47585
+ var i = _toPrimitive47(t, "string");
47220
47586
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
47221
47587
  }
47222
- function _toPrimitive46(t, r) {
47588
+ function _toPrimitive47(t, r) {
47223
47589
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
47224
47590
  var e = t[Symbol.toPrimitive];
47225
47591
  if (void 0 !== e) {
@@ -47229,7 +47595,7 @@ function _toPrimitive46(t, r) {
47229
47595
  }
47230
47596
  return ("string" === r ? String : Number)(t);
47231
47597
  }
47232
- function asyncGeneratorStep10(n, t, e, r, o, a, c) {
47598
+ function asyncGeneratorStep11(n, t, e, r, o, a, c) {
47233
47599
  try {
47234
47600
  var i = n[a](c), u = i.value;
47235
47601
  } catch (n2) {
@@ -47237,16 +47603,16 @@ function asyncGeneratorStep10(n, t, e, r, o, a, c) {
47237
47603
  }
47238
47604
  i.done ? t(u) : Promise.resolve(u).then(r, o);
47239
47605
  }
47240
- function _asyncToGenerator10(n) {
47606
+ function _asyncToGenerator11(n) {
47241
47607
  return function() {
47242
47608
  var t = this, e = arguments;
47243
47609
  return new Promise(function(r, o) {
47244
47610
  var a = n.apply(t, e);
47245
47611
  function _next(n2) {
47246
- asyncGeneratorStep10(a, r, o, _next, _throw, "next", n2);
47612
+ asyncGeneratorStep11(a, r, o, _next, _throw, "next", n2);
47247
47613
  }
47248
47614
  function _throw(n2) {
47249
- asyncGeneratorStep10(a, r, o, _next, _throw, "throw", n2);
47615
+ asyncGeneratorStep11(a, r, o, _next, _throw, "throw", n2);
47250
47616
  }
47251
47617
  _next(void 0);
47252
47618
  });
@@ -47254,14 +47620,14 @@ function _asyncToGenerator10(n) {
47254
47620
  }
47255
47621
  var useRecorder = function(_ref) {
47256
47622
  var isStopOnSilence = _ref.isStopOnSilence, _onStart = _ref.onStart, _onStop = _ref.onStop;
47257
- var _$_ref = _sliced_to_array((0, import_react67.useState)(null), 2), silenceStart = _$_ref[0], setSilenceStart = _$_ref[1];
47258
- var _$_ref1 = _sliced_to_array((0, import_react67.useState)(null), 2), noiseStart = _$_ref1[0], setNoiseStart = _$_ref1[1];
47259
- var _$_ref2 = _sliced_to_array((0, import_react67.useState)(null), 2), mediaStream = _$_ref2[0], setMediaStream = _$_ref2[1];
47260
- var _$_ref3 = _sliced_to_array((0, import_react67.useState)("idle"), 2), status = _$_ref3[0], setStatus = _$_ref3[1];
47623
+ var _$_ref = _sliced_to_array((0, import_react68.useState)(null), 2), silenceStart = _$_ref[0], setSilenceStart = _$_ref[1];
47624
+ var _$_ref1 = _sliced_to_array((0, import_react68.useState)(null), 2), noiseStart = _$_ref1[0], setNoiseStart = _$_ref1[1];
47625
+ var _$_ref2 = _sliced_to_array((0, import_react68.useState)(null), 2), mediaStream = _$_ref2[0], setMediaStream = _$_ref2[1];
47626
+ var _$_ref3 = _sliced_to_array((0, import_react68.useState)("idle"), 2), status = _$_ref3[0], setStatus = _$_ref3[1];
47261
47627
  var startAudioPlayer = (0, import_react_use_audio_player.useAudioPlayer)();
47262
47628
  var endAudioPlayer = (0, import_react_use_audio_player.useAudioPlayer)();
47263
- var _$_ref4 = _sliced_to_array((0, import_react67.useState)(false), 2), isLoaded = _$_ref4[0], setIsLoaded = _$_ref4[1];
47264
- (0, import_react67.useEffect)(function() {
47629
+ var _$_ref4 = _sliced_to_array((0, import_react68.useState)(false), 2), isLoaded = _$_ref4[0], setIsLoaded = _$_ref4[1];
47630
+ (0, import_react68.useEffect)(function() {
47265
47631
  if (isLoaded) return;
47266
47632
  setIsLoaded(true);
47267
47633
  }, [
@@ -47279,7 +47645,7 @@ var useRecorder = function(_ref) {
47279
47645
  setNoiseStart(null);
47280
47646
  },
47281
47647
  onStop: function() {
47282
- var _onStop2 = _asyncToGenerator10(function() {
47648
+ var _onStop2 = _asyncToGenerator11(function() {
47283
47649
  var _arguments = arguments;
47284
47650
  return _ts_generator(this, function(_state) {
47285
47651
  switch(_state.label){
@@ -47321,9 +47687,9 @@ var useRecorder = function(_ref) {
47321
47687
  setNoiseStart(null);
47322
47688
  }
47323
47689
  });
47324
- var _$_ref5 = _sliced_to_array((0, import_react67.useState)(null), 2), audioEngine = _$_ref5[0], setAudioEngine = _$_ref5[1];
47325
- var isInited = (0, import_react67.useRef)(false);
47326
- (0, import_react67.useEffect)(function() {
47690
+ var _$_ref5 = _sliced_to_array((0, import_react68.useState)(null), 2), audioEngine = _$_ref5[0], setAudioEngine = _$_ref5[1];
47691
+ var isInited = (0, import_react68.useRef)(false);
47692
+ (0, import_react68.useEffect)(function() {
47327
47693
  if (!mediaStream) return;
47328
47694
  if (isInited.current) return;
47329
47695
  isInited.current = true;
@@ -47336,7 +47702,7 @@ var useRecorder = function(_ref) {
47336
47702
  isInited,
47337
47703
  mediaStream
47338
47704
  ]);
47339
- var visualizationAnalyser = (0, import_react67.useMemo)(function() {
47705
+ var visualizationAnalyser = (0, import_react68.useMemo)(function() {
47340
47706
  if (!audioEngine) return null;
47341
47707
  var result = audioEngine.audioContext.createAnalyser();
47342
47708
  audioEngine.source.connect(result);
@@ -47344,7 +47710,7 @@ var useRecorder = function(_ref) {
47344
47710
  }, [
47345
47711
  audioEngine
47346
47712
  ]);
47347
- var silenceAnalyser = (0, import_react67.useMemo)(function() {
47713
+ var silenceAnalyser = (0, import_react68.useMemo)(function() {
47348
47714
  if (!audioEngine) return null;
47349
47715
  var result_0 = audioEngine.audioContext.createAnalyser();
47350
47716
  result_0.minDecibels = -60;
@@ -47353,7 +47719,7 @@ var useRecorder = function(_ref) {
47353
47719
  }, [
47354
47720
  audioEngine
47355
47721
  ]);
47356
- var handleSilence = (0, import_react67.useCallback)(function() {
47722
+ var handleSilence = (0, import_react68.useCallback)(function() {
47357
47723
  if (!silenceAnalyser) return;
47358
47724
  var frequencyData = new Uint8Array(silenceAnalyser.frequencyBinCount);
47359
47725
  silenceAnalyser.getByteFrequencyData(frequencyData);
@@ -47376,7 +47742,7 @@ var useRecorder = function(_ref) {
47376
47742
  setNoiseStart,
47377
47743
  setSilenceStart
47378
47744
  ]);
47379
- (0, import_react67.useEffect)(function() {
47745
+ (0, import_react68.useEffect)(function() {
47380
47746
  if (!isStopOnSilence) return;
47381
47747
  requestAnimationFrame(function() {
47382
47748
  return handleSilence();
@@ -47393,14 +47759,14 @@ var useRecorder = function(_ref) {
47393
47759
  if (!silenceStart.isBefore((0, import_dayjs3.default)().subtract(1.5, "second"))) return;
47394
47760
  audioCaptureProps.stop();
47395
47761
  }, 300);
47396
- return _objectSpread46(_objectSpread46({}, audioCaptureProps), {}, {
47762
+ return _objectSpread47(_objectSpread47({}, audioCaptureProps), {}, {
47397
47763
  status: status,
47398
47764
  visualizationAnalyser: visualizationAnalyser
47399
47765
  });
47400
47766
  };
47401
47767
  // src/hooks/audioThreads/useMessageAudio/index.ts
47402
- var import_react_compiler_runtime89 = require("react-compiler-runtime");
47403
- var import_react68 = require("react");
47768
+ var import_react_compiler_runtime90 = require("react-compiler-runtime");
47769
+ var import_react69 = require("react");
47404
47770
  var import_compromise = __toESM(require("compromise"), 1);
47405
47771
  var import_howler = require("howler");
47406
47772
  var import_react_use_audio_player2 = require("react-use-audio-player");
@@ -47426,7 +47792,7 @@ var unsupportedNames = [
47426
47792
  ];
47427
47793
  var isHtmlAudioSupported = !unsupportedNames.includes(((_detect = (0, import_detect_browser.detect)()) === null || _detect === void 0 ? void 0 : _detect.name) || "");
47428
47794
  // src/hooks/audioThreads/useMessageAudio/index.ts
47429
- function ownKeys47(e, r) {
47795
+ function ownKeys48(e, r) {
47430
47796
  var t = Object.keys(e);
47431
47797
  if (Object.getOwnPropertySymbols) {
47432
47798
  var o = Object.getOwnPropertySymbols(e);
@@ -47436,30 +47802,30 @@ function ownKeys47(e, r) {
47436
47802
  }
47437
47803
  return t;
47438
47804
  }
47439
- function _objectSpread47(e) {
47805
+ function _objectSpread48(e) {
47440
47806
  for(var r = 1; r < arguments.length; r++){
47441
47807
  var t = null != arguments[r] ? arguments[r] : {};
47442
- r % 2 ? ownKeys47(Object(t), true).forEach(function(r2) {
47443
- _defineProperty47(e, r2, t[r2]);
47444
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys47(Object(t)).forEach(function(r2) {
47808
+ r % 2 ? ownKeys48(Object(t), true).forEach(function(r2) {
47809
+ _defineProperty48(e, r2, t[r2]);
47810
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys48(Object(t)).forEach(function(r2) {
47445
47811
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
47446
47812
  });
47447
47813
  }
47448
47814
  return e;
47449
47815
  }
47450
- function _defineProperty47(e, r, t) {
47451
- return (r = _toPropertyKey47(r)) in e ? Object.defineProperty(e, r, {
47816
+ function _defineProperty48(e, r, t) {
47817
+ return (r = _toPropertyKey48(r)) in e ? Object.defineProperty(e, r, {
47452
47818
  value: t,
47453
47819
  enumerable: true,
47454
47820
  configurable: true,
47455
47821
  writable: true
47456
47822
  }) : e[r] = t, e;
47457
47823
  }
47458
- function _toPropertyKey47(t) {
47459
- var i = _toPrimitive47(t, "string");
47824
+ function _toPropertyKey48(t) {
47825
+ var i = _toPrimitive48(t, "string");
47460
47826
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
47461
47827
  }
47462
- function _toPrimitive47(t, r) {
47828
+ function _toPrimitive48(t, r) {
47463
47829
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
47464
47830
  var e = t[Symbol.toPrimitive];
47465
47831
  if (void 0 !== e) {
@@ -47481,7 +47847,7 @@ var getMessageSentences = function(_ref) {
47481
47847
  };
47482
47848
  var useMessageAudio = function(t0) {
47483
47849
  var _latestMessageProps$l, _latestMessageProps$l4, _latestMessageProps$l5;
47484
- var $ = (0, import_react_compiler_runtime89.c)(68);
47850
+ var $ = (0, import_react_compiler_runtime90.c)(68);
47485
47851
  var _onEnd = t0.onEnd, passedPlay = t0.play, t1 = t0.fullSentenceRegex;
47486
47852
  var t2;
47487
47853
  if ($[0] !== t1) {
@@ -47492,7 +47858,7 @@ var useMessageAudio = function(t0) {
47492
47858
  t2 = $[1];
47493
47859
  }
47494
47860
  var fullSentenceRegex = t2;
47495
- var _ref = _sliced_to_array((0, import_react68.useState)(false), 2), isAudioPlayed = _ref[0], setIsAudioPlayed = _ref[1];
47861
+ var _ref = _sliced_to_array((0, import_react69.useState)(false), 2), isAudioPlayed = _ref[0], setIsAudioPlayed = _ref[1];
47496
47862
  var t3;
47497
47863
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
47498
47864
  t3 = [];
@@ -47500,7 +47866,7 @@ var useMessageAudio = function(t0) {
47500
47866
  } else {
47501
47867
  t3 = $[2];
47502
47868
  }
47503
- var _ref1 = _sliced_to_array((0, import_react68.useState)(t3), 2), stoppedMessageIds = _ref1[0], setStoppedMessageIds = _ref1[1];
47869
+ var _ref1 = _sliced_to_array((0, import_react69.useState)(t3), 2), stoppedMessageIds = _ref1[0], setStoppedMessageIds = _ref1[1];
47504
47870
  var t4;
47505
47871
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
47506
47872
  t4 = [];
@@ -47508,12 +47874,12 @@ var useMessageAudio = function(t0) {
47508
47874
  } else {
47509
47875
  t4 = $[3];
47510
47876
  }
47511
- var _ref2 = _sliced_to_array((0, import_react68.useState)(t4), 2), playedMessageSentences = _ref2[0], setPlayedMessageSentences = _ref2[1];
47877
+ var _ref2 = _sliced_to_array((0, import_react69.useState)(t4), 2), playedMessageSentences = _ref2[0], setPlayedMessageSentences = _ref2[1];
47512
47878
  var audioPlayer = (0, import_react_use_audio_player2.useAudioPlayer)();
47513
47879
  var nextAudioPlayer = (0, import_react_use_audio_player2.useAudioPlayer)();
47514
47880
  var superinterfaceContext = useSuperinterfaceContext();
47515
- var _ref3 = _sliced_to_array((0, import_react68.useState)(false), 2), isPlaying = _ref3[0], setIsPlaying = _ref3[1];
47516
- var isLastSentencePlayedRef = (0, import_react68.useRef)(false);
47881
+ var _ref3 = _sliced_to_array((0, import_react69.useState)(false), 2), isPlaying = _ref3[0], setIsPlaying = _ref3[1];
47882
+ var isLastSentencePlayedRef = (0, import_react69.useRef)(false);
47517
47883
  var latestMessageProps = useLatestMessage();
47518
47884
  var t5;
47519
47885
  var t6;
@@ -47534,7 +47900,7 @@ var useMessageAudio = function(t0) {
47534
47900
  t5 = $[5];
47535
47901
  t6 = $[6];
47536
47902
  }
47537
- (0, import_react68.useEffect)(t5, t6);
47903
+ (0, import_react69.useEffect)(t5, t6);
47538
47904
  var t7;
47539
47905
  bb0: {
47540
47906
  if (!latestMessageProps.latestMessage) {
@@ -47618,7 +47984,7 @@ var useMessageAudio = function(t0) {
47618
47984
  if ($[17] !== audioPlayer || $[18] !== fullSentenceRegex || $[19] !== isAudioPlayed || $[20] !== nextAudioPlayer || $[21] !== superinterfaceContext || $[22] !== unplayedMessageSentences[1]) {
47619
47985
  t8 = function(t92) {
47620
47986
  var input_0 = t92.input, onPlay = t92.onPlay, onStop = t92.onStop, onEnd_0 = t92.onEnd;
47621
- var searchParams = new URLSearchParams(_objectSpread47({
47987
+ var searchParams = new URLSearchParams(_objectSpread48({
47622
47988
  input: input_0
47623
47989
  }, superinterfaceContext.variables));
47624
47990
  audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(searchParams), {
@@ -47636,7 +48002,7 @@ var useMessageAudio = function(t0) {
47636
48002
  if (!isNextFullSentence) {
47637
48003
  return;
47638
48004
  }
47639
- var nextSearchParams = new URLSearchParams(_objectSpread47({
48005
+ var nextSearchParams = new URLSearchParams(_objectSpread48({
47640
48006
  input: nextUnplayedMessageSentence.sentence
47641
48007
  }, superinterfaceContext.variables));
47642
48008
  nextAudioPlayer.load("".concat(superinterfaceContext.baseUrl, "/audio-runtimes/tts?").concat(nextSearchParams), {
@@ -47757,7 +48123,7 @@ var useMessageAudio = function(t0) {
47757
48123
  } else {
47758
48124
  t11 = $[43];
47759
48125
  }
47760
- (0, import_react68.useEffect)(t10, t11);
48126
+ (0, import_react69.useEffect)(t10, t11);
47761
48127
  var t12;
47762
48128
  if ($[44] !== isPlaying || $[45] !== ((_latestMessageProps$l = latestMessageProps.latestMessage) === null || _latestMessageProps$l === void 0 ? void 0 : _latestMessageProps$l.status) || $[46] !== _onEnd || $[47] !== unplayedMessageSentences.length) {
47763
48129
  var _latestMessageProps$l3;
@@ -47793,7 +48159,7 @@ var useMessageAudio = function(t0) {
47793
48159
  } else {
47794
48160
  t14 = $[53];
47795
48161
  }
47796
- (0, import_react68.useEffect)(t12, t14);
48162
+ (0, import_react69.useEffect)(t12, t14);
47797
48163
  var t15;
47798
48164
  if ($[54] !== audioPlayer) {
47799
48165
  t15 = [
@@ -47804,9 +48170,9 @@ var useMessageAudio = function(t0) {
47804
48170
  } else {
47805
48171
  t15 = $[55];
47806
48172
  }
47807
- (0, import_react68.useEffect)(_temp9, t15);
47808
- var _ref4 = _sliced_to_array((0, import_react68.useState)(null), 2), audioEngine = _ref4[0], setAudioEngine = _ref4[1];
47809
- var isAudioEngineInited = (0, import_react68.useRef)(false);
48173
+ (0, import_react69.useEffect)(_temp10, t15);
48174
+ var _ref4 = _sliced_to_array((0, import_react69.useState)(null), 2), audioEngine = _ref4[0], setAudioEngine = _ref4[1];
48175
+ var isAudioEngineInited = (0, import_react69.useRef)(false);
47810
48176
  var t16;
47811
48177
  if ($[56] !== audioPlayer.playing) {
47812
48178
  t16 = function() {
@@ -47846,7 +48212,7 @@ var useMessageAudio = function(t0) {
47846
48212
  } else {
47847
48213
  t17 = $[59];
47848
48214
  }
47849
- (0, import_react68.useEffect)(t16, t17);
48215
+ (0, import_react69.useEffect)(t16, t17);
47850
48216
  var t18;
47851
48217
  bb1: {
47852
48218
  if (!audioEngine) {
@@ -47872,7 +48238,7 @@ var useMessageAudio = function(t0) {
47872
48238
  var isPending = t19;
47873
48239
  var t20;
47874
48240
  if ($[63] !== audioPlayer || $[64] !== isAudioPlayed || $[65] !== isPending || $[66] !== visualizationAnalyser) {
47875
- t20 = _objectSpread47(_objectSpread47({
48241
+ t20 = _objectSpread48(_objectSpread48({
47876
48242
  isPending: isPending,
47877
48243
  isAudioPlayed: isAudioPlayed
47878
48244
  }, audioPlayer), {}, {
@@ -47888,7 +48254,7 @@ var useMessageAudio = function(t0) {
47888
48254
  }
47889
48255
  return t20;
47890
48256
  };
47891
- function _temp9() {
48257
+ function _temp10() {
47892
48258
  if (isHtmlAudioSupported) {
47893
48259
  var _Howler$_howls$;
47894
48260
  if (!(import_howler.Howler !== null && import_howler.Howler !== void 0 && (_Howler$_howls$ = import_howler.Howler._howls[0]) !== null && _Howler$_howls$ !== void 0 && (_Howler$_howls$ = _Howler$_howls$._sounds[0]) !== null && _Howler$_howls$ !== void 0 && _Howler$_howls$._node)) {
@@ -47910,7 +48276,7 @@ var blobToData = function(blob) {
47910
48276
  });
47911
48277
  };
47912
48278
  // src/hooks/audioRuntimes/useTtsAudioRuntime/index.ts
47913
- function asyncGeneratorStep11(n, t, e, r, o, a, c) {
48279
+ function asyncGeneratorStep12(n, t, e, r, o, a, c) {
47914
48280
  try {
47915
48281
  var i = n[a](c), u = i.value;
47916
48282
  } catch (n2) {
@@ -47918,23 +48284,23 @@ function asyncGeneratorStep11(n, t, e, r, o, a, c) {
47918
48284
  }
47919
48285
  i.done ? t(u) : Promise.resolve(u).then(r, o);
47920
48286
  }
47921
- function _asyncToGenerator11(n) {
48287
+ function _asyncToGenerator12(n) {
47922
48288
  return function() {
47923
48289
  var t = this, e = arguments;
47924
48290
  return new Promise(function(r, o) {
47925
48291
  var a = n.apply(t, e);
47926
48292
  function _next(n2) {
47927
- asyncGeneratorStep11(a, r, o, _next, _throw, "next", n2);
48293
+ asyncGeneratorStep12(a, r, o, _next, _throw, "next", n2);
47928
48294
  }
47929
48295
  function _throw(n2) {
47930
- asyncGeneratorStep11(a, r, o, _next, _throw, "throw", n2);
48296
+ asyncGeneratorStep12(a, r, o, _next, _throw, "throw", n2);
47931
48297
  }
47932
48298
  _next(void 0);
47933
48299
  });
47934
48300
  };
47935
48301
  }
47936
48302
  var useTtsAudioRuntime = function(t0) {
47937
- var $ = (0, import_react_compiler_runtime90.c)(30);
48303
+ var $ = (0, import_react_compiler_runtime91.c)(30);
47938
48304
  var play = t0.play, passedOnEnd = t0.onEnd;
47939
48305
  var addToast = useToasts().addToast;
47940
48306
  var queryClient = (0, import_react_query10.useQueryClient)();
@@ -47963,9 +48329,9 @@ var useTtsAudioRuntime = function(t0) {
47963
48329
  if ($[1] !== createMessageProps) {
47964
48330
  t2 = {
47965
48331
  isStopOnSilence: true,
47966
- onStart: _temp10,
48332
+ onStart: _temp11,
47967
48333
  onStop: function() {
47968
- var _onStop = _asyncToGenerator11(function(_event, chunks) {
48334
+ var _onStop = _asyncToGenerator12(function(_event, chunks) {
47969
48335
  var blob, audioContent;
47970
48336
  return _ts_generator(this, function(_state) {
47971
48337
  switch(_state.label){
@@ -48104,23 +48470,23 @@ var useTtsAudioRuntime = function(t0) {
48104
48470
  t5 = t8;
48105
48471
  return t5;
48106
48472
  };
48107
- function _temp10() {
48108
- return _temp24.apply(this, arguments);
48473
+ function _temp11() {
48474
+ return _temp25.apply(this, arguments);
48109
48475
  }
48110
- function _temp24() {
48111
- _temp24 = _asyncToGenerator11(function() {
48476
+ function _temp25() {
48477
+ _temp25 = _asyncToGenerator12(function() {
48112
48478
  return _ts_generator(this, function(_state) {
48113
48479
  return [
48114
48480
  2
48115
48481
  ];
48116
48482
  });
48117
48483
  });
48118
- return _temp24.apply(this, arguments);
48484
+ return _temp25.apply(this, arguments);
48119
48485
  }
48120
48486
  // src/components/audioRuntimes/TtsAudioRuntimeProvider.tsx
48121
48487
  var import_jsx_runtime88 = require("react/jsx-runtime");
48122
48488
  var TtsAudioRuntimeProvider = function(t0) {
48123
- var $ = (0, import_react_compiler_runtime91.c)(8);
48489
+ var $ = (0, import_react_compiler_runtime92.c)(8);
48124
48490
  var children = t0.children, play = t0.play, onEnd = t0.onEnd;
48125
48491
  var t1;
48126
48492
  if ($[0] !== onEnd || $[1] !== play) {
@@ -48161,7 +48527,7 @@ var TtsAudioRuntimeProvider = function(t0) {
48161
48527
  };
48162
48528
  // src/components/threads/AudioThread/Root/index.tsx
48163
48529
  var import_jsx_runtime89 = require("react/jsx-runtime");
48164
- var _excluded5 = [
48530
+ var _excluded6 = [
48165
48531
  "children"
48166
48532
  ];
48167
48533
  var _excluded22 = [
@@ -48171,7 +48537,7 @@ var _excluded22 = [
48171
48537
  "className",
48172
48538
  "style"
48173
48539
  ];
48174
- function ownKeys48(e, r) {
48540
+ function ownKeys49(e, r) {
48175
48541
  var t = Object.keys(e);
48176
48542
  if (Object.getOwnPropertySymbols) {
48177
48543
  var o = Object.getOwnPropertySymbols(e);
@@ -48181,30 +48547,30 @@ function ownKeys48(e, r) {
48181
48547
  }
48182
48548
  return t;
48183
48549
  }
48184
- function _objectSpread48(e) {
48550
+ function _objectSpread49(e) {
48185
48551
  for(var r = 1; r < arguments.length; r++){
48186
48552
  var t = null != arguments[r] ? arguments[r] : {};
48187
- r % 2 ? ownKeys48(Object(t), true).forEach(function(r2) {
48188
- _defineProperty48(e, r2, t[r2]);
48189
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys48(Object(t)).forEach(function(r2) {
48553
+ r % 2 ? ownKeys49(Object(t), true).forEach(function(r2) {
48554
+ _defineProperty49(e, r2, t[r2]);
48555
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys49(Object(t)).forEach(function(r2) {
48190
48556
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
48191
48557
  });
48192
48558
  }
48193
48559
  return e;
48194
48560
  }
48195
- function _defineProperty48(e, r, t) {
48196
- return (r = _toPropertyKey48(r)) in e ? Object.defineProperty(e, r, {
48561
+ function _defineProperty49(e, r, t) {
48562
+ return (r = _toPropertyKey49(r)) in e ? Object.defineProperty(e, r, {
48197
48563
  value: t,
48198
48564
  enumerable: true,
48199
48565
  configurable: true,
48200
48566
  writable: true
48201
48567
  }) : e[r] = t, e;
48202
48568
  }
48203
- function _toPropertyKey48(t) {
48204
- var i = _toPrimitive48(t, "string");
48569
+ function _toPropertyKey49(t) {
48570
+ var i = _toPrimitive49(t, "string");
48205
48571
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
48206
48572
  }
48207
- function _toPrimitive48(t, r) {
48573
+ function _toPrimitive49(t, r) {
48208
48574
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
48209
48575
  var e = t[Symbol.toPrimitive];
48210
48576
  if (void 0 !== e) {
@@ -48214,16 +48580,16 @@ function _toPrimitive48(t, r) {
48214
48580
  }
48215
48581
  return ("string" === r ? String : Number)(t);
48216
48582
  }
48217
- function _objectWithoutProperties5(e, t) {
48583
+ function _objectWithoutProperties6(e, t) {
48218
48584
  if (null == e) return {};
48219
- var o, r, i = _objectWithoutPropertiesLoose5(e, t);
48585
+ var o, r, i = _objectWithoutPropertiesLoose6(e, t);
48220
48586
  if (Object.getOwnPropertySymbols) {
48221
48587
  var n = Object.getOwnPropertySymbols(e);
48222
48588
  for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
48223
48589
  }
48224
48590
  return i;
48225
48591
  }
48226
- function _objectWithoutPropertiesLoose5(r, e) {
48592
+ function _objectWithoutPropertiesLoose6(r, e) {
48227
48593
  if (null == r) return {};
48228
48594
  var t = {};
48229
48595
  for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
@@ -48233,7 +48599,7 @@ function _objectWithoutPropertiesLoose5(r, e) {
48233
48599
  return t;
48234
48600
  }
48235
48601
  var Content9 = function(t0) {
48236
- var $ = (0, import_react_compiler_runtime92.c)(4);
48602
+ var $ = (0, import_react_compiler_runtime93.c)(4);
48237
48603
  var children = t0.children, className = t0.className, style = t0.style;
48238
48604
  var t1;
48239
48605
  if ($[0] !== children || $[1] !== className || $[2] !== style) {
@@ -48255,7 +48621,7 @@ var Content9 = function(t0) {
48255
48621
  return t1;
48256
48622
  };
48257
48623
  var AudioRuntimeProvider = function(t0) {
48258
- var $ = (0, import_react_compiler_runtime92.c)(4);
48624
+ var $ = (0, import_react_compiler_runtime93.c)(4);
48259
48625
  var children = t0.children, play = t0.play, onEnd = t0.onEnd;
48260
48626
  var audioThreadContext = useAudioThreadContext();
48261
48627
  if (audioThreadContext.audioRuntime) {
@@ -48278,13 +48644,13 @@ var AudioRuntimeProvider = function(t0) {
48278
48644
  return t1;
48279
48645
  };
48280
48646
  var Provider5 = function(t0) {
48281
- var $ = (0, import_react_compiler_runtime92.c)(9);
48647
+ var $ = (0, import_react_compiler_runtime93.c)(9);
48282
48648
  var children;
48283
48649
  var rest;
48284
48650
  if ($[0] !== t0) {
48285
48651
  var _t = t0;
48286
48652
  children = _t.children;
48287
- rest = _objectWithoutProperties5(_t, _excluded5);
48653
+ rest = _objectWithoutProperties6(_t, _excluded6);
48288
48654
  _t;
48289
48655
  $[0] = t0;
48290
48656
  $[1] = children;
@@ -48296,7 +48662,7 @@ var Provider5 = function(t0) {
48296
48662
  var audioThreadContext = useAudioThreadContext();
48297
48663
  var t1;
48298
48664
  if ($[3] !== audioThreadContext || $[4] !== rest) {
48299
- t1 = _objectSpread48(_objectSpread48({}, audioThreadContext), rest);
48665
+ t1 = _objectSpread49(_objectSpread49({}, audioThreadContext), rest);
48300
48666
  $[3] = audioThreadContext;
48301
48667
  $[4] = rest;
48302
48668
  $[5] = t1;
@@ -48318,7 +48684,7 @@ var Provider5 = function(t0) {
48318
48684
  return t2;
48319
48685
  };
48320
48686
  var Root16 = function(t0) {
48321
- var $ = (0, import_react_compiler_runtime92.c)(18);
48687
+ var $ = (0, import_react_compiler_runtime93.c)(18);
48322
48688
  var children;
48323
48689
  var className;
48324
48690
  var onEnd;
@@ -48329,7 +48695,7 @@ var Root16 = function(t0) {
48329
48695
  var _t2 = t0;
48330
48696
  var ref;
48331
48697
  ref = _t2, children = ref.children, play = ref.play, onEnd = ref.onEnd, className = ref.className, style = ref.style, ref;
48332
- rest = _objectWithoutProperties5(_t2, _excluded22);
48698
+ rest = _objectWithoutProperties6(_t2, _excluded22);
48333
48699
  _t2;
48334
48700
  $[0] = t0;
48335
48701
  $[1] = children;
@@ -48378,7 +48744,7 @@ var Root16 = function(t0) {
48378
48744
  }
48379
48745
  var t3;
48380
48746
  if ($[15] !== rest || $[16] !== t2) {
48381
- t3 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Provider5, _objectSpread48(_objectSpread48({}, rest), {}, {
48747
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Provider5, _objectSpread49(_objectSpread49({}, rest), {}, {
48382
48748
  children: t2
48383
48749
  }));
48384
48750
  $[15] = rest;
@@ -48390,21 +48756,21 @@ var Root16 = function(t0) {
48390
48756
  return t3;
48391
48757
  };
48392
48758
  // src/components/threads/AudioThread/Visualization/index.tsx
48393
- var import_react_compiler_runtime94 = require("react-compiler-runtime");
48394
- var import_react72 = require("react");
48759
+ var import_react_compiler_runtime95 = require("react-compiler-runtime");
48760
+ var import_react73 = require("react");
48395
48761
  var import_lodash9 = __toESM(require("lodash"), 1);
48396
48762
  var import_themes60 = require("@radix-ui/themes");
48397
48763
  // src/components/threads/AudioThread/BarsVisualizer/index.tsx
48398
48764
  var import_lodash8 = __toESM(require("lodash"), 1);
48399
48765
  var import_themes59 = require("@radix-ui/themes");
48400
- var import_react70 = require("react");
48766
+ var import_react71 = require("react");
48401
48767
  var import_radash17 = require("radash");
48402
48768
  var import_jsx_runtime90 = require("react/jsx-runtime");
48403
48769
  var barCount = 4;
48404
48770
  var BarsVisualizer = function(_ref) {
48405
48771
  var visualizationAnalyser = _ref.visualizationAnalyser, backgroundColor = _ref.backgroundColor, height = _ref.height, barWidth = _ref.barWidth;
48406
- var _$_ref = _sliced_to_array((0, import_react70.useState)([]), 2), barHeights = _$_ref[0], setBarHeights = _$_ref[1];
48407
- var draw = (0, import_react70.useCallback)(function(_ref2) {
48772
+ var _$_ref = _sliced_to_array((0, import_react71.useState)([]), 2), barHeights = _$_ref[0], setBarHeights = _$_ref[1];
48773
+ var draw = (0, import_react71.useCallback)(function(_ref2) {
48408
48774
  var visualizationAnalyser_0 = _ref2.visualizationAnalyser;
48409
48775
  if (!visualizationAnalyser_0) {
48410
48776
  setBarHeights(Array(barCount).fill(0));
@@ -48422,7 +48788,7 @@ var BarsVisualizer = function(_ref) {
48422
48788
  });
48423
48789
  });
48424
48790
  }, []);
48425
- (0, import_react70.useEffect)(function() {
48791
+ (0, import_react71.useEffect)(function() {
48426
48792
  draw({
48427
48793
  visualizationAnalyser: visualizationAnalyser
48428
48794
  });
@@ -48459,10 +48825,10 @@ var BarsVisualizer = function(_ref) {
48459
48825
  });
48460
48826
  };
48461
48827
  // src/hooks/audioThreads/useStatus/index.ts
48462
- var import_react_compiler_runtime93 = require("react-compiler-runtime");
48463
- var import_react71 = require("react");
48828
+ var import_react_compiler_runtime94 = require("react-compiler-runtime");
48829
+ var import_react72 = require("react");
48464
48830
  var useStatus = function() {
48465
- var $ = (0, import_react_compiler_runtime93.c)(2);
48831
+ var $ = (0, import_react_compiler_runtime94.c)(2);
48466
48832
  var audioRuntime = useAudioThreadContext().audioRuntime;
48467
48833
  var t0;
48468
48834
  bb0: {
@@ -48511,7 +48877,7 @@ var useStatus = function() {
48511
48877
  };
48512
48878
  // src/components/threads/AudioThread/Visualization/index.tsx
48513
48879
  var import_jsx_runtime91 = require("react/jsx-runtime");
48514
- var _excluded6 = [
48880
+ var _excluded7 = [
48515
48881
  "children"
48516
48882
  ];
48517
48883
  var _excluded23 = [
@@ -48523,7 +48889,7 @@ var _excluded32 = [
48523
48889
  "height",
48524
48890
  "width"
48525
48891
  ];
48526
- function ownKeys49(e, r) {
48892
+ function ownKeys50(e, r) {
48527
48893
  var t = Object.keys(e);
48528
48894
  if (Object.getOwnPropertySymbols) {
48529
48895
  var o = Object.getOwnPropertySymbols(e);
@@ -48533,30 +48899,30 @@ function ownKeys49(e, r) {
48533
48899
  }
48534
48900
  return t;
48535
48901
  }
48536
- function _objectSpread49(e) {
48902
+ function _objectSpread50(e) {
48537
48903
  for(var r = 1; r < arguments.length; r++){
48538
48904
  var t = null != arguments[r] ? arguments[r] : {};
48539
- r % 2 ? ownKeys49(Object(t), true).forEach(function(r2) {
48540
- _defineProperty49(e, r2, t[r2]);
48541
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys49(Object(t)).forEach(function(r2) {
48905
+ r % 2 ? ownKeys50(Object(t), true).forEach(function(r2) {
48906
+ _defineProperty50(e, r2, t[r2]);
48907
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys50(Object(t)).forEach(function(r2) {
48542
48908
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
48543
48909
  });
48544
48910
  }
48545
48911
  return e;
48546
48912
  }
48547
- function _defineProperty49(e, r, t) {
48548
- return (r = _toPropertyKey49(r)) in e ? Object.defineProperty(e, r, {
48913
+ function _defineProperty50(e, r, t) {
48914
+ return (r = _toPropertyKey50(r)) in e ? Object.defineProperty(e, r, {
48549
48915
  value: t,
48550
48916
  enumerable: true,
48551
48917
  configurable: true,
48552
48918
  writable: true
48553
48919
  }) : e[r] = t, e;
48554
48920
  }
48555
- function _toPropertyKey49(t) {
48556
- var i = _toPrimitive49(t, "string");
48921
+ function _toPropertyKey50(t) {
48922
+ var i = _toPrimitive50(t, "string");
48557
48923
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
48558
48924
  }
48559
- function _toPrimitive49(t, r) {
48925
+ function _toPrimitive50(t, r) {
48560
48926
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
48561
48927
  var e = t[Symbol.toPrimitive];
48562
48928
  if (void 0 !== e) {
@@ -48566,16 +48932,16 @@ function _toPrimitive49(t, r) {
48566
48932
  }
48567
48933
  return ("string" === r ? String : Number)(t);
48568
48934
  }
48569
- function _objectWithoutProperties6(e, t) {
48935
+ function _objectWithoutProperties7(e, t) {
48570
48936
  if (null == e) return {};
48571
- var o, r, i = _objectWithoutPropertiesLoose6(e, t);
48937
+ var o, r, i = _objectWithoutPropertiesLoose7(e, t);
48572
48938
  if (Object.getOwnPropertySymbols) {
48573
48939
  var n = Object.getOwnPropertySymbols(e);
48574
48940
  for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
48575
48941
  }
48576
48942
  return i;
48577
48943
  }
48578
- function _objectWithoutPropertiesLoose6(r, e) {
48944
+ function _objectWithoutPropertiesLoose7(r, e) {
48579
48945
  if (null == r) return {};
48580
48946
  var t = {};
48581
48947
  for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
@@ -48584,14 +48950,14 @@ function _objectWithoutPropertiesLoose6(r, e) {
48584
48950
  }
48585
48951
  return t;
48586
48952
  }
48587
- var AudioThreadVisualizationContext = /* @__PURE__ */ (0, import_react72.createContext)({
48953
+ var AudioThreadVisualizationContext = /* @__PURE__ */ (0, import_react73.createContext)({
48588
48954
  scale: 0
48589
48955
  });
48590
48956
  var Provider6 = function(_ref) {
48591
48957
  var children = _ref.children;
48592
48958
  var audioThreadContext = useAudioThreadContext();
48593
- var _$_ref = _sliced_to_array((0, import_react72.useState)(0), 2), scale = _$_ref[0], setScale = _$_ref[1];
48594
- var draw = (0, import_react72.useCallback)(function(_ref2) {
48959
+ var _$_ref = _sliced_to_array((0, import_react73.useState)(0), 2), scale = _$_ref[0], setScale = _$_ref[1];
48960
+ var draw = (0, import_react73.useCallback)(function(_ref2) {
48595
48961
  var visualizationAnalyser = _ref2.visualizationAnalyser;
48596
48962
  if (!visualizationAnalyser) {
48597
48963
  setScale(1);
@@ -48606,7 +48972,7 @@ var Provider6 = function(_ref) {
48606
48972
  });
48607
48973
  });
48608
48974
  }, []);
48609
- (0, import_react72.useEffect)(function() {
48975
+ (0, import_react73.useEffect)(function() {
48610
48976
  draw({
48611
48977
  visualizationAnalyser: audioThreadContext.audioRuntime.user.visualizationAnalyser
48612
48978
  });
@@ -48622,13 +48988,13 @@ var Provider6 = function(_ref) {
48622
48988
  });
48623
48989
  };
48624
48990
  var Root17 = function(t0) {
48625
- var $ = (0, import_react_compiler_runtime94.c)(6);
48991
+ var $ = (0, import_react_compiler_runtime95.c)(6);
48626
48992
  var children;
48627
48993
  var rest;
48628
48994
  if ($[0] !== t0) {
48629
48995
  var _t = t0;
48630
48996
  children = _t.children;
48631
- rest = _objectWithoutProperties6(_t, _excluded6);
48997
+ rest = _objectWithoutProperties7(_t, _excluded7);
48632
48998
  _t;
48633
48999
  $[0] = t0;
48634
49000
  $[1] = children;
@@ -48640,7 +49006,7 @@ var Root17 = function(t0) {
48640
49006
  var t1;
48641
49007
  if ($[3] !== children || $[4] !== rest) {
48642
49008
  t1 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Provider6, {
48643
- children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_themes60.Flex, _objectSpread49(_objectSpread49({
49009
+ children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_themes60.Flex, _objectSpread50(_objectSpread50({
48644
49010
  direction: "column",
48645
49011
  align: "center",
48646
49012
  justify: "center",
@@ -48659,7 +49025,7 @@ var Root17 = function(t0) {
48659
49025
  return t1;
48660
49026
  };
48661
49027
  var BarsVisualizer2 = function(t0) {
48662
- var $ = (0, import_react_compiler_runtime94.c)(10);
49028
+ var $ = (0, import_react_compiler_runtime95.c)(10);
48663
49029
  var rest;
48664
49030
  var t1;
48665
49031
  var t2;
@@ -48667,7 +49033,7 @@ var BarsVisualizer2 = function(t0) {
48667
49033
  var _t2 = t0;
48668
49034
  var ref;
48669
49035
  ref = _t2, t1 = ref.height, t2 = ref.barWidth, ref;
48670
- rest = _objectWithoutProperties6(_t2, _excluded23);
49036
+ rest = _objectWithoutProperties7(_t2, _excluded23);
48671
49037
  _t2;
48672
49038
  $[0] = t0;
48673
49039
  $[1] = rest;
@@ -48685,7 +49051,7 @@ var BarsVisualizer2 = function(t0) {
48685
49051
  var t3 = status === "playing" ? "var(--accent-11)" : "var(--gray-11)";
48686
49052
  var t4;
48687
49053
  if ($[4] !== audioThreadContext.audioRuntime.assistant.visualizationAnalyser || $[5] !== barWidth || $[6] !== height || $[7] !== rest || $[8] !== t3) {
48688
- t4 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(BarsVisualizer, _objectSpread49({
49054
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(BarsVisualizer, _objectSpread50({
48689
49055
  visualizationAnalyser: audioThreadContext.audioRuntime.assistant.visualizationAnalyser,
48690
49056
  backgroundColor: t3,
48691
49057
  height: height,
@@ -48703,7 +49069,7 @@ var BarsVisualizer2 = function(t0) {
48703
49069
  return t4;
48704
49070
  };
48705
49071
  var AssistantVisualizationRoot = function(t0) {
48706
- var $ = (0, import_react_compiler_runtime94.c)(17);
49072
+ var $ = (0, import_react_compiler_runtime95.c)(17);
48707
49073
  var children;
48708
49074
  var rest;
48709
49075
  var t1;
@@ -48712,7 +49078,7 @@ var AssistantVisualizationRoot = function(t0) {
48712
49078
  var _t3 = t0;
48713
49079
  var ref;
48714
49080
  ref = _t3, children = ref.children, t1 = ref.height, t2 = ref.width, ref;
48715
- rest = _objectWithoutProperties6(_t3, _excluded32);
49081
+ rest = _objectWithoutProperties7(_t3, _excluded32);
48716
49082
  _t3;
48717
49083
  $[0] = t0;
48718
49084
  $[1] = children;
@@ -48728,7 +49094,7 @@ var AssistantVisualizationRoot = function(t0) {
48728
49094
  var height = t1 === void 0 ? "200px" : t1;
48729
49095
  var width2 = t2 === void 0 ? "200px" : t2;
48730
49096
  var status = useStatus().status;
48731
- var scale = (0, import_react72.useContext)(AudioThreadVisualizationContext).scale;
49097
+ var scale = (0, import_react73.useContext)(AudioThreadVisualizationContext).scale;
48732
49098
  var t3 = status === "playing" ? "var(--accent-4)" : "var(--gray-4)";
48733
49099
  var t4;
48734
49100
  if ($[5] !== rest.style) {
@@ -48741,7 +49107,7 @@ var AssistantVisualizationRoot = function(t0) {
48741
49107
  }
48742
49108
  var t5;
48743
49109
  if ($[7] !== scale || $[8] !== t3 || $[9] !== t4) {
48744
- t5 = _objectSpread49({
49110
+ t5 = _objectSpread50({
48745
49111
  backgroundColor: t3,
48746
49112
  borderRadius: "9999px",
48747
49113
  scale: scale
@@ -48755,7 +49121,7 @@ var AssistantVisualizationRoot = function(t0) {
48755
49121
  }
48756
49122
  var t6;
48757
49123
  if ($[11] !== children || $[12] !== height || $[13] !== rest || $[14] !== t5 || $[15] !== width2) {
48758
- t6 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_themes60.Flex, _objectSpread49(_objectSpread49({
49124
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_themes60.Flex, _objectSpread50(_objectSpread50({
48759
49125
  align: "center",
48760
49126
  justify: "center",
48761
49127
  height: height,
@@ -48776,7 +49142,7 @@ var AssistantVisualizationRoot = function(t0) {
48776
49142
  return t6;
48777
49143
  };
48778
49144
  var AssistantVisualization = function(props) {
48779
- var $ = (0, import_react_compiler_runtime94.c)(3);
49145
+ var $ = (0, import_react_compiler_runtime95.c)(3);
48780
49146
  var t0;
48781
49147
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48782
49148
  t0 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(BarsVisualizer2, {});
@@ -48786,7 +49152,7 @@ var AssistantVisualization = function(props) {
48786
49152
  }
48787
49153
  var t1;
48788
49154
  if ($[1] !== props) {
48789
- t1 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AssistantVisualizationRoot, _objectSpread49(_objectSpread49({}, props), {}, {
49155
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AssistantVisualizationRoot, _objectSpread50(_objectSpread50({}, props), {}, {
48790
49156
  children: t0
48791
49157
  }));
48792
49158
  $[1] = props;
@@ -48799,8 +49165,8 @@ var AssistantVisualization = function(props) {
48799
49165
  AssistantVisualization.Root = AssistantVisualizationRoot;
48800
49166
  AssistantVisualization.BarsVisualizer = BarsVisualizer2;
48801
49167
  var AssistantInfo = function(props) {
48802
- var $ = (0, import_react_compiler_runtime94.c)(6);
48803
- var assistantNameContext = (0, import_react72.useContext)(AssistantNameContext);
49168
+ var $ = (0, import_react_compiler_runtime95.c)(6);
49169
+ var assistantNameContext = (0, import_react73.useContext)(AssistantNameContext);
48804
49170
  var t0;
48805
49171
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48806
49172
  t0 = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MessageGroup.AssistantAvatar, {});
@@ -48820,7 +49186,7 @@ var AssistantInfo = function(props) {
48820
49186
  }
48821
49187
  var t2;
48822
49188
  if ($[3] !== props || $[4] !== t1) {
48823
- t2 = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_themes60.Flex, _objectSpread49(_objectSpread49({
49189
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_themes60.Flex, _objectSpread50(_objectSpread50({
48824
49190
  ml: "-22.5px",
48825
49191
  gap: "3",
48826
49192
  pt: "5"
@@ -48839,7 +49205,7 @@ var AssistantInfo = function(props) {
48839
49205
  return t2;
48840
49206
  };
48841
49207
  var Visualization = function(props) {
48842
- var $ = (0, import_react_compiler_runtime94.c)(4);
49208
+ var $ = (0, import_react_compiler_runtime95.c)(4);
48843
49209
  var t0;
48844
49210
  var t1;
48845
49211
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -48853,7 +49219,7 @@ var Visualization = function(props) {
48853
49219
  }
48854
49220
  var t2;
48855
49221
  if ($[2] !== props) {
48856
- t2 = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Root17, _objectSpread49(_objectSpread49({}, props), {}, {
49222
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Root17, _objectSpread50(_objectSpread50({}, props), {}, {
48857
49223
  children: [
48858
49224
  t0,
48859
49225
  t1
@@ -48871,9 +49237,9 @@ Visualization.Provider = Provider6;
48871
49237
  Visualization.AssistantVisualization = AssistantVisualization;
48872
49238
  Visualization.AssistantInfo = AssistantInfo;
48873
49239
  // src/components/threads/AudioThread/Status/index.tsx
48874
- var import_react_compiler_runtime96 = require("react-compiler-runtime");
49240
+ var import_react_compiler_runtime97 = require("react-compiler-runtime");
48875
49241
  // src/components/threads/AudioThread/Status/StatusMessages.tsx
48876
- var import_react_compiler_runtime95 = require("react-compiler-runtime");
49242
+ var import_react_compiler_runtime96 = require("react-compiler-runtime");
48877
49243
  var import_themes61 = require("@radix-ui/themes");
48878
49244
  var import_jsx_runtime92 = require("react/jsx-runtime");
48879
49245
  var html = function(_ref) {
@@ -48883,7 +49249,7 @@ var html = function(_ref) {
48883
49249
  }).join(""), "\n }");
48884
49250
  };
48885
49251
  var StatusMessages = function(t0) {
48886
- var $ = (0, import_react_compiler_runtime95.c)(9);
49252
+ var $ = (0, import_react_compiler_runtime96.c)(9);
48887
49253
  var texts = t0.texts, className = t0.className, style = t0.style;
48888
49254
  var t1;
48889
49255
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -48943,152 +49309,6 @@ var StatusMessages = function(t0) {
48943
49309
  };
48944
49310
  // src/components/threads/AudioThread/Status/index.tsx
48945
49311
  var import_jsx_runtime93 = require("react/jsx-runtime");
48946
- function ownKeys50(e, r) {
48947
- var t = Object.keys(e);
48948
- if (Object.getOwnPropertySymbols) {
48949
- var o = Object.getOwnPropertySymbols(e);
48950
- r && (o = o.filter(function(r2) {
48951
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
48952
- })), t.push.apply(t, o);
48953
- }
48954
- return t;
48955
- }
48956
- function _objectSpread50(e) {
48957
- for(var r = 1; r < arguments.length; r++){
48958
- var t = null != arguments[r] ? arguments[r] : {};
48959
- r % 2 ? ownKeys50(Object(t), true).forEach(function(r2) {
48960
- _defineProperty50(e, r2, t[r2]);
48961
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys50(Object(t)).forEach(function(r2) {
48962
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
48963
- });
48964
- }
48965
- return e;
48966
- }
48967
- function _defineProperty50(e, r, t) {
48968
- return (r = _toPropertyKey50(r)) in e ? Object.defineProperty(e, r, {
48969
- value: t,
48970
- enumerable: true,
48971
- configurable: true,
48972
- writable: true
48973
- }) : e[r] = t, e;
48974
- }
48975
- function _toPropertyKey50(t) {
48976
- var i = _toPrimitive50(t, "string");
48977
- return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
48978
- }
48979
- function _toPrimitive50(t, r) {
48980
- if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
48981
- var e = t[Symbol.toPrimitive];
48982
- if (void 0 !== e) {
48983
- var i = e.call(t, r || "default");
48984
- if ("object" != (typeof i === "undefined" ? "undefined" : _type_of(i))) return i;
48985
- throw new TypeError("@@toPrimitive must return a primitive value.");
48986
- }
48987
- return ("string" === r ? String : Number)(t);
48988
- }
48989
- var Status = function(props) {
48990
- var $ = (0, import_react_compiler_runtime96.c)(12);
48991
- var status = useStatus().status;
48992
- if (status === "recording") {
48993
- var _t;
48994
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
48995
- _t = [
48996
- "Start speaking",
48997
- "Listening",
48998
- "Finish speaking to send",
48999
- "Click the button below to send manually"
49000
- ];
49001
- $[0] = _t;
49002
- } else {
49003
- _t = $[0];
49004
- }
49005
- var _t2;
49006
- if ($[1] !== props) {
49007
- _t2 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread50({
49008
- texts: _t
49009
- }, props));
49010
- $[1] = props;
49011
- $[2] = _t2;
49012
- } else {
49013
- _t2 = $[2];
49014
- }
49015
- return _t2;
49016
- }
49017
- if ([
49018
- "recorderPaused",
49019
- "idle",
49020
- "playerPaused"
49021
- ].includes(status)) {
49022
- var _t3;
49023
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
49024
- _t3 = [
49025
- "Click the button below to activate"
49026
- ];
49027
- $[3] = _t3;
49028
- } else {
49029
- _t3 = $[3];
49030
- }
49031
- var _t4;
49032
- if ($[4] !== props) {
49033
- _t4 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread50({
49034
- texts: _t3
49035
- }, props));
49036
- $[4] = props;
49037
- $[5] = _t4;
49038
- } else {
49039
- _t4 = $[5];
49040
- }
49041
- return _t4;
49042
- }
49043
- if (status === "playing") {
49044
- var _t5;
49045
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
49046
- _t5 = [
49047
- "Listening"
49048
- ];
49049
- $[6] = _t5;
49050
- } else {
49051
- _t5 = $[6];
49052
- }
49053
- var _t6;
49054
- if ($[7] !== props) {
49055
- _t6 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread50({
49056
- texts: _t5
49057
- }, props));
49058
- $[7] = props;
49059
- $[8] = _t6;
49060
- } else {
49061
- _t6 = $[8];
49062
- }
49063
- return _t6;
49064
- }
49065
- var t0;
49066
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
49067
- t0 = [
49068
- "Thinking"
49069
- ];
49070
- $[9] = t0;
49071
- } else {
49072
- t0 = $[9];
49073
- }
49074
- var t1;
49075
- if ($[10] !== props) {
49076
- t1 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread50({
49077
- texts: t0
49078
- }, props));
49079
- $[10] = props;
49080
- $[11] = t1;
49081
- } else {
49082
- t1 = $[11];
49083
- }
49084
- return t1;
49085
- };
49086
- // src/components/threads/AudioThread/Form/index.tsx
49087
- var import_react_compiler_runtime99 = require("react-compiler-runtime");
49088
- var import_themes63 = require("@radix-ui/themes");
49089
- // src/components/threads/AudioThread/Form/MicIcon.tsx
49090
- var import_react_compiler_runtime97 = require("react-compiler-runtime");
49091
- var import_jsx_runtime94 = require("react/jsx-runtime");
49092
49312
  function ownKeys51(e, r) {
49093
49313
  var t = Object.keys(e);
49094
49314
  if (Object.getOwnPropertySymbols) {
@@ -49132,8 +49352,154 @@ function _toPrimitive51(t, r) {
49132
49352
  }
49133
49353
  return ("string" === r ? String : Number)(t);
49134
49354
  }
49355
+ var Status = function(props) {
49356
+ var $ = (0, import_react_compiler_runtime97.c)(12);
49357
+ var status = useStatus().status;
49358
+ if (status === "recording") {
49359
+ var _t;
49360
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
49361
+ _t = [
49362
+ "Start speaking",
49363
+ "Listening",
49364
+ "Finish speaking to send",
49365
+ "Click the button below to send manually"
49366
+ ];
49367
+ $[0] = _t;
49368
+ } else {
49369
+ _t = $[0];
49370
+ }
49371
+ var _t2;
49372
+ if ($[1] !== props) {
49373
+ _t2 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread51({
49374
+ texts: _t
49375
+ }, props));
49376
+ $[1] = props;
49377
+ $[2] = _t2;
49378
+ } else {
49379
+ _t2 = $[2];
49380
+ }
49381
+ return _t2;
49382
+ }
49383
+ if ([
49384
+ "recorderPaused",
49385
+ "idle",
49386
+ "playerPaused"
49387
+ ].includes(status)) {
49388
+ var _t3;
49389
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
49390
+ _t3 = [
49391
+ "Click the button below to activate"
49392
+ ];
49393
+ $[3] = _t3;
49394
+ } else {
49395
+ _t3 = $[3];
49396
+ }
49397
+ var _t4;
49398
+ if ($[4] !== props) {
49399
+ _t4 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread51({
49400
+ texts: _t3
49401
+ }, props));
49402
+ $[4] = props;
49403
+ $[5] = _t4;
49404
+ } else {
49405
+ _t4 = $[5];
49406
+ }
49407
+ return _t4;
49408
+ }
49409
+ if (status === "playing") {
49410
+ var _t5;
49411
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
49412
+ _t5 = [
49413
+ "Listening"
49414
+ ];
49415
+ $[6] = _t5;
49416
+ } else {
49417
+ _t5 = $[6];
49418
+ }
49419
+ var _t6;
49420
+ if ($[7] !== props) {
49421
+ _t6 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread51({
49422
+ texts: _t5
49423
+ }, props));
49424
+ $[7] = props;
49425
+ $[8] = _t6;
49426
+ } else {
49427
+ _t6 = $[8];
49428
+ }
49429
+ return _t6;
49430
+ }
49431
+ var t0;
49432
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
49433
+ t0 = [
49434
+ "Thinking"
49435
+ ];
49436
+ $[9] = t0;
49437
+ } else {
49438
+ t0 = $[9];
49439
+ }
49440
+ var t1;
49441
+ if ($[10] !== props) {
49442
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusMessages, _objectSpread51({
49443
+ texts: t0
49444
+ }, props));
49445
+ $[10] = props;
49446
+ $[11] = t1;
49447
+ } else {
49448
+ t1 = $[11];
49449
+ }
49450
+ return t1;
49451
+ };
49452
+ // src/components/threads/AudioThread/Form/index.tsx
49453
+ var import_react_compiler_runtime100 = require("react-compiler-runtime");
49454
+ var import_themes63 = require("@radix-ui/themes");
49455
+ // src/components/threads/AudioThread/Form/MicIcon.tsx
49456
+ var import_react_compiler_runtime98 = require("react-compiler-runtime");
49457
+ var import_jsx_runtime94 = require("react/jsx-runtime");
49458
+ function ownKeys52(e, r) {
49459
+ var t = Object.keys(e);
49460
+ if (Object.getOwnPropertySymbols) {
49461
+ var o = Object.getOwnPropertySymbols(e);
49462
+ r && (o = o.filter(function(r2) {
49463
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
49464
+ })), t.push.apply(t, o);
49465
+ }
49466
+ return t;
49467
+ }
49468
+ function _objectSpread52(e) {
49469
+ for(var r = 1; r < arguments.length; r++){
49470
+ var t = null != arguments[r] ? arguments[r] : {};
49471
+ r % 2 ? ownKeys52(Object(t), true).forEach(function(r2) {
49472
+ _defineProperty52(e, r2, t[r2]);
49473
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys52(Object(t)).forEach(function(r2) {
49474
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
49475
+ });
49476
+ }
49477
+ return e;
49478
+ }
49479
+ function _defineProperty52(e, r, t) {
49480
+ return (r = _toPropertyKey52(r)) in e ? Object.defineProperty(e, r, {
49481
+ value: t,
49482
+ enumerable: true,
49483
+ configurable: true,
49484
+ writable: true
49485
+ }) : e[r] = t, e;
49486
+ }
49487
+ function _toPropertyKey52(t) {
49488
+ var i = _toPrimitive52(t, "string");
49489
+ return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
49490
+ }
49491
+ function _toPrimitive52(t, r) {
49492
+ if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
49493
+ var e = t[Symbol.toPrimitive];
49494
+ if (void 0 !== e) {
49495
+ var i = e.call(t, r || "default");
49496
+ if ("object" != (typeof i === "undefined" ? "undefined" : _type_of(i))) return i;
49497
+ throw new TypeError("@@toPrimitive must return a primitive value.");
49498
+ }
49499
+ return ("string" === r ? String : Number)(t);
49500
+ }
49135
49501
  var MicIcon = function(props) {
49136
- var $ = (0, import_react_compiler_runtime97.c)(3);
49502
+ var $ = (0, import_react_compiler_runtime98.c)(3);
49137
49503
  var t0;
49138
49504
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
49139
49505
  t0 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("path", {
@@ -49146,7 +49512,7 @@ var MicIcon = function(props) {
49146
49512
  }
49147
49513
  var t1;
49148
49514
  if ($[1] !== props) {
49149
- t1 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("svg", _objectSpread51(_objectSpread51({
49515
+ t1 = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("svg", _objectSpread52(_objectSpread52({
49150
49516
  xmlns: "http://www.w3.org/2000/svg",
49151
49517
  fill: "currentColor",
49152
49518
  stroke: "currentColor",
@@ -49165,12 +49531,12 @@ var MicIcon = function(props) {
49165
49531
  return t1;
49166
49532
  };
49167
49533
  // src/components/threads/AudioThread/Form/ActionButton/index.tsx
49168
- var import_react_compiler_runtime98 = require("react-compiler-runtime");
49534
+ var import_react_compiler_runtime99 = require("react-compiler-runtime");
49169
49535
  var import_themes62 = require("@radix-ui/themes");
49170
49536
  var import_react_icons17 = require("@radix-ui/react-icons");
49171
49537
  var import_jsx_runtime95 = require("react/jsx-runtime");
49172
49538
  var ActionButton = function() {
49173
- var $ = (0, import_react_compiler_runtime98.c)(27);
49539
+ var $ = (0, import_react_compiler_runtime99.c)(27);
49174
49540
  var status = useStatus().status;
49175
49541
  var audioThreadContext = useAudioThreadContext();
49176
49542
  var superinterfaceContext = useSuperinterfaceContext();
@@ -49364,7 +49730,7 @@ var ActionButton = function() {
49364
49730
  };
49365
49731
  // src/components/threads/AudioThread/Form/index.tsx
49366
49732
  var import_jsx_runtime96 = require("react/jsx-runtime");
49367
- function ownKeys52(e, r) {
49733
+ function ownKeys53(e, r) {
49368
49734
  var t = Object.keys(e);
49369
49735
  if (Object.getOwnPropertySymbols) {
49370
49736
  var o = Object.getOwnPropertySymbols(e);
@@ -49374,30 +49740,30 @@ function ownKeys52(e, r) {
49374
49740
  }
49375
49741
  return t;
49376
49742
  }
49377
- function _objectSpread52(e) {
49743
+ function _objectSpread53(e) {
49378
49744
  for(var r = 1; r < arguments.length; r++){
49379
49745
  var t = null != arguments[r] ? arguments[r] : {};
49380
- r % 2 ? ownKeys52(Object(t), true).forEach(function(r2) {
49381
- _defineProperty52(e, r2, t[r2]);
49382
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys52(Object(t)).forEach(function(r2) {
49746
+ r % 2 ? ownKeys53(Object(t), true).forEach(function(r2) {
49747
+ _defineProperty53(e, r2, t[r2]);
49748
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys53(Object(t)).forEach(function(r2) {
49383
49749
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
49384
49750
  });
49385
49751
  }
49386
49752
  return e;
49387
49753
  }
49388
- function _defineProperty52(e, r, t) {
49389
- return (r = _toPropertyKey52(r)) in e ? Object.defineProperty(e, r, {
49754
+ function _defineProperty53(e, r, t) {
49755
+ return (r = _toPropertyKey53(r)) in e ? Object.defineProperty(e, r, {
49390
49756
  value: t,
49391
49757
  enumerable: true,
49392
49758
  configurable: true,
49393
49759
  writable: true
49394
49760
  }) : e[r] = t, e;
49395
49761
  }
49396
- function _toPropertyKey52(t) {
49397
- var i = _toPrimitive52(t, "string");
49762
+ function _toPropertyKey53(t) {
49763
+ var i = _toPrimitive53(t, "string");
49398
49764
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
49399
49765
  }
49400
- function _toPrimitive52(t, r) {
49766
+ function _toPrimitive53(t, r) {
49401
49767
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
49402
49768
  var e = t[Symbol.toPrimitive];
49403
49769
  if (void 0 !== e) {
@@ -49408,7 +49774,7 @@ function _toPrimitive52(t, r) {
49408
49774
  return ("string" === r ? String : Number)(t);
49409
49775
  }
49410
49776
  var Form = function(props) {
49411
- var $ = (0, import_react_compiler_runtime99.c)(17);
49777
+ var $ = (0, import_react_compiler_runtime100.c)(17);
49412
49778
  var status = useStatus().status;
49413
49779
  var audioThreadContext = useAudioThreadContext();
49414
49780
  var t0 = status === "recording" ? "var(--accent-11)" : "var(--gray-11)";
@@ -49495,7 +49861,7 @@ var Form = function(props) {
49495
49861
  }
49496
49862
  var t9;
49497
49863
  if ($[14] !== props || $[15] !== t7) {
49498
- t9 = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_themes63.Flex, _objectSpread52(_objectSpread52({
49864
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_themes63.Flex, _objectSpread53(_objectSpread53({
49499
49865
  direction: "column",
49500
49866
  align: "center"
49501
49867
  }, props), {}, {
@@ -49514,7 +49880,7 @@ var Form = function(props) {
49514
49880
  };
49515
49881
  // src/components/threads/AudioThread/index.tsx
49516
49882
  var import_jsx_runtime97 = require("react/jsx-runtime");
49517
- function ownKeys53(e, r) {
49883
+ function ownKeys54(e, r) {
49518
49884
  var t = Object.keys(e);
49519
49885
  if (Object.getOwnPropertySymbols) {
49520
49886
  var o = Object.getOwnPropertySymbols(e);
@@ -49524,30 +49890,30 @@ function ownKeys53(e, r) {
49524
49890
  }
49525
49891
  return t;
49526
49892
  }
49527
- function _objectSpread53(e) {
49893
+ function _objectSpread54(e) {
49528
49894
  for(var r = 1; r < arguments.length; r++){
49529
49895
  var t = null != arguments[r] ? arguments[r] : {};
49530
- r % 2 ? ownKeys53(Object(t), true).forEach(function(r2) {
49531
- _defineProperty53(e, r2, t[r2]);
49532
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys53(Object(t)).forEach(function(r2) {
49896
+ r % 2 ? ownKeys54(Object(t), true).forEach(function(r2) {
49897
+ _defineProperty54(e, r2, t[r2]);
49898
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys54(Object(t)).forEach(function(r2) {
49533
49899
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
49534
49900
  });
49535
49901
  }
49536
49902
  return e;
49537
49903
  }
49538
- function _defineProperty53(e, r, t) {
49539
- return (r = _toPropertyKey53(r)) in e ? Object.defineProperty(e, r, {
49904
+ function _defineProperty54(e, r, t) {
49905
+ return (r = _toPropertyKey54(r)) in e ? Object.defineProperty(e, r, {
49540
49906
  value: t,
49541
49907
  enumerable: true,
49542
49908
  configurable: true,
49543
49909
  writable: true
49544
49910
  }) : e[r] = t, e;
49545
49911
  }
49546
- function _toPropertyKey53(t) {
49547
- var i = _toPrimitive53(t, "string");
49912
+ function _toPropertyKey54(t) {
49913
+ var i = _toPrimitive54(t, "string");
49548
49914
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
49549
49915
  }
49550
- function _toPrimitive53(t, r) {
49916
+ function _toPrimitive54(t, r) {
49551
49917
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
49552
49918
  var e = t[Symbol.toPrimitive];
49553
49919
  if (void 0 !== e) {
@@ -49558,7 +49924,7 @@ function _toPrimitive53(t, r) {
49558
49924
  return ("string" === r ? String : Number)(t);
49559
49925
  }
49560
49926
  var AudioThread = function(props) {
49561
- var $ = (0, import_react_compiler_runtime100.c)(5);
49927
+ var $ = (0, import_react_compiler_runtime101.c)(5);
49562
49928
  var t0;
49563
49929
  var t1;
49564
49930
  var t2;
@@ -49576,7 +49942,7 @@ var AudioThread = function(props) {
49576
49942
  }
49577
49943
  var t3;
49578
49944
  if ($[3] !== props) {
49579
- t3 = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Root16, _objectSpread53(_objectSpread53({}, props), {}, {
49945
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Root16, _objectSpread54(_objectSpread54({}, props), {}, {
49580
49946
  children: [
49581
49947
  t0,
49582
49948
  t1,
@@ -49596,7 +49962,7 @@ AudioThread.Status = Status;
49596
49962
  AudioThread.Form = Form;
49597
49963
  // src/components/threads/AudioThreadDialog/index.tsx
49598
49964
  var import_jsx_runtime98 = require("react/jsx-runtime");
49599
- function ownKeys54(e, r) {
49965
+ function ownKeys55(e, r) {
49600
49966
  var t = Object.keys(e);
49601
49967
  if (Object.getOwnPropertySymbols) {
49602
49968
  var o = Object.getOwnPropertySymbols(e);
@@ -49606,30 +49972,30 @@ function ownKeys54(e, r) {
49606
49972
  }
49607
49973
  return t;
49608
49974
  }
49609
- function _objectSpread54(e) {
49975
+ function _objectSpread55(e) {
49610
49976
  for(var r = 1; r < arguments.length; r++){
49611
49977
  var t = null != arguments[r] ? arguments[r] : {};
49612
- r % 2 ? ownKeys54(Object(t), true).forEach(function(r2) {
49613
- _defineProperty54(e, r2, t[r2]);
49614
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys54(Object(t)).forEach(function(r2) {
49978
+ r % 2 ? ownKeys55(Object(t), true).forEach(function(r2) {
49979
+ _defineProperty55(e, r2, t[r2]);
49980
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys55(Object(t)).forEach(function(r2) {
49615
49981
  Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
49616
49982
  });
49617
49983
  }
49618
49984
  return e;
49619
49985
  }
49620
- function _defineProperty54(e, r, t) {
49621
- return (r = _toPropertyKey54(r)) in e ? Object.defineProperty(e, r, {
49986
+ function _defineProperty55(e, r, t) {
49987
+ return (r = _toPropertyKey55(r)) in e ? Object.defineProperty(e, r, {
49622
49988
  value: t,
49623
49989
  enumerable: true,
49624
49990
  configurable: true,
49625
49991
  writable: true
49626
49992
  }) : e[r] = t, e;
49627
49993
  }
49628
- function _toPropertyKey54(t) {
49629
- var i = _toPrimitive54(t, "string");
49994
+ function _toPropertyKey55(t) {
49995
+ var i = _toPrimitive55(t, "string");
49630
49996
  return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
49631
49997
  }
49632
- function _toPrimitive54(t, r) {
49998
+ function _toPrimitive55(t, r) {
49633
49999
  if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
49634
50000
  var e = t[Symbol.toPrimitive];
49635
50001
  if (void 0 !== e) {
@@ -49640,7 +50006,7 @@ function _toPrimitive54(t, r) {
49640
50006
  return ("string" === r ? String : Number)(t);
49641
50007
  }
49642
50008
  var AudioThreadDialog = function(props) {
49643
- var $ = (0, import_react_compiler_runtime101.c)(4);
50009
+ var $ = (0, import_react_compiler_runtime102.c)(4);
49644
50010
  var t0;
49645
50011
  var t1;
49646
50012
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -49656,7 +50022,7 @@ var AudioThreadDialog = function(props) {
49656
50022
  }
49657
50023
  var t2;
49658
50024
  if ($[2] !== props) {
49659
- t2 = /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Root13, _objectSpread54(_objectSpread54({}, props), {}, {
50025
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Root13, _objectSpread55(_objectSpread55({}, props), {}, {
49660
50026
  children: [
49661
50027
  t0,
49662
50028
  t1
@@ -49673,8 +50039,8 @@ AudioThreadDialog.Root = Root13;
49673
50039
  AudioThreadDialog.Trigger = Trigger;
49674
50040
  AudioThreadDialog.Content = Content8;
49675
50041
  // src/hooks/audioRuntimes/useWebrtcAudioRuntime/index.ts
49676
- var import_react73 = require("react");
49677
- function asyncGeneratorStep12(n, t, e, r, o, a, c) {
50042
+ var import_react74 = require("react");
50043
+ function asyncGeneratorStep13(n, t, e, r, o, a, c) {
49678
50044
  try {
49679
50045
  var i = n[a](c), u = i.value;
49680
50046
  } catch (n2) {
@@ -49682,16 +50048,16 @@ function asyncGeneratorStep12(n, t, e, r, o, a, c) {
49682
50048
  }
49683
50049
  i.done ? t(u) : Promise.resolve(u).then(r, o);
49684
50050
  }
49685
- function _asyncToGenerator12(n) {
50051
+ function _asyncToGenerator13(n) {
49686
50052
  return function() {
49687
50053
  var t = this, e = arguments;
49688
50054
  return new Promise(function(r, o) {
49689
50055
  var a = n.apply(t, e);
49690
50056
  function _next(n2) {
49691
- asyncGeneratorStep12(a, r, o, _next, _throw, "next", n2);
50057
+ asyncGeneratorStep13(a, r, o, _next, _throw, "next", n2);
49692
50058
  }
49693
50059
  function _throw(n2) {
49694
- asyncGeneratorStep12(a, r, o, _next, _throw, "throw", n2);
50060
+ asyncGeneratorStep13(a, r, o, _next, _throw, "throw", n2);
49695
50061
  }
49696
50062
  _next(void 0);
49697
50063
  });
@@ -49762,22 +50128,22 @@ var useWebrtcAudioRuntime = function() {
49762
50128
  console.warn("Could not build analyzers:", err_0);
49763
50129
  }
49764
50130
  };
49765
- var _ref = _sliced_to_array((0, import_react73.useState)("idle"), 2), recorderStatus = _ref[0], setRecorderStatus = _ref[1];
50131
+ var _ref = _sliced_to_array((0, import_react74.useState)("idle"), 2), recorderStatus = _ref[0], setRecorderStatus = _ref[1];
49766
50132
  var superinterfaceContext = useSuperinterfaceContext();
49767
- var _ref1 = _sliced_to_array((0, import_react73.useState)(false), 2), userIsPending = _ref1[0], setUserIsPending = _ref1[1];
49768
- var _ref2 = _sliced_to_array((0, import_react73.useState)(false), 2), assistantPlaying = _ref2[0], setAssistantPlaying = _ref2[1];
49769
- var _ref3 = _sliced_to_array((0, import_react73.useState)(false), 2), assistantPaused = _ref3[0], setAssistantPaused = _ref3[1];
49770
- var _ref4 = _sliced_to_array((0, import_react73.useState)(true), 2), assistantIsPending = _ref4[0], setAssistantIsPending = _ref4[1];
49771
- var _ref5 = _sliced_to_array((0, import_react73.useState)(false), 2), assistantIsReady = _ref5[0], setAssistantIsReady = _ref5[1];
49772
- var _ref6 = _sliced_to_array((0, import_react73.useState)(false), 2), assistantAudioPlayed = _ref6[0], setAssistantAudioPlayed = _ref6[1];
49773
- var sessionStartedRef = (0, import_react73.useRef)(false);
49774
- var pcRef = (0, import_react73.useRef)(null);
49775
- var localStreamRef = (0, import_react73.useRef)(null);
49776
- var remoteStreamRef = (0, import_react73.useRef)(null);
49777
- var userAnalyserRef = (0, import_react73.useRef)(null);
49778
- var assistantAnalyserRef = (0, import_react73.useRef)(null);
49779
- var assistantAudioElRef = (0, import_react73.useRef)(null);
49780
- (0, import_react73.useEffect)(function() {
50133
+ var _ref1 = _sliced_to_array((0, import_react74.useState)(false), 2), userIsPending = _ref1[0], setUserIsPending = _ref1[1];
50134
+ var _ref2 = _sliced_to_array((0, import_react74.useState)(false), 2), assistantPlaying = _ref2[0], setAssistantPlaying = _ref2[1];
50135
+ var _ref3 = _sliced_to_array((0, import_react74.useState)(false), 2), assistantPaused = _ref3[0], setAssistantPaused = _ref3[1];
50136
+ var _ref4 = _sliced_to_array((0, import_react74.useState)(true), 2), assistantIsPending = _ref4[0], setAssistantIsPending = _ref4[1];
50137
+ var _ref5 = _sliced_to_array((0, import_react74.useState)(false), 2), assistantIsReady = _ref5[0], setAssistantIsReady = _ref5[1];
50138
+ var _ref6 = _sliced_to_array((0, import_react74.useState)(false), 2), assistantAudioPlayed = _ref6[0], setAssistantAudioPlayed = _ref6[1];
50139
+ var sessionStartedRef = (0, import_react74.useRef)(false);
50140
+ var pcRef = (0, import_react74.useRef)(null);
50141
+ var localStreamRef = (0, import_react74.useRef)(null);
50142
+ var remoteStreamRef = (0, import_react74.useRef)(null);
50143
+ var userAnalyserRef = (0, import_react74.useRef)(null);
50144
+ var assistantAnalyserRef = (0, import_react74.useRef)(null);
50145
+ var assistantAudioElRef = (0, import_react74.useRef)(null);
50146
+ (0, import_react74.useEffect)(function() {
49781
50147
  return function() {
49782
50148
  if (pcRef.current) {
49783
50149
  pcRef.current.close();
@@ -49789,7 +50155,7 @@ var useWebrtcAudioRuntime = function() {
49789
50155
  };
49790
50156
  }, []);
49791
50157
  function _startSessionIfNeeded() {
49792
- _startSessionIfNeeded = _asyncToGenerator12(function() {
50158
+ _startSessionIfNeeded = _asyncToGenerator13(function() {
49793
50159
  return _ts_generator(this, function(_state) {
49794
50160
  switch(_state.label){
49795
50161
  case 0:
@@ -49812,7 +50178,7 @@ var useWebrtcAudioRuntime = function() {
49812
50178
  return _startSessionIfNeeded.apply(this, arguments);
49813
50179
  }
49814
50180
  function _initRealtimeSession() {
49815
- _initRealtimeSession = _asyncToGenerator12(function() {
50181
+ _initRealtimeSession = _asyncToGenerator13(function() {
49816
50182
  var peerConn, audioEl, openaiEventsDataChannel, ms, offer, searchParams_0, sdpResponse, answerSdp, answer, err1;
49817
50183
  return _ts_generator(this, function(_state) {
49818
50184
  switch(_state.label){
@@ -49860,7 +50226,7 @@ var useWebrtcAudioRuntime = function() {
49860
50226
  };
49861
50227
  openaiEventsDataChannel = peerConn.createDataChannel("oai-events");
49862
50228
  openaiEventsDataChannel.addEventListener("message", /* @__PURE__ */ function() {
49863
- var _ref8 = _asyncToGenerator12(function(e) {
50229
+ var _ref8 = _asyncToGenerator13(function(e) {
49864
50230
  var parsedData, searchParams, eventsResponse, reader, decoder, _ref, value, done, buffer, lines, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, line, event, ref;
49865
50231
  return _ts_generator(this, function(_state) {
49866
50232
  switch(_state.label){
@@ -50059,7 +50425,7 @@ var useWebrtcAudioRuntime = function() {
50059
50425
  return _initRealtimeSession.apply(this, arguments);
50060
50426
  }
50061
50427
  var start = /* @__PURE__ */ function() {
50062
- var _ref6 = _asyncToGenerator12(function() {
50428
+ var _ref6 = _asyncToGenerator13(function() {
50063
50429
  return _ts_generator(this, function(_state) {
50064
50430
  switch(_state.label){
50065
50431
  case 0:
@@ -50092,7 +50458,7 @@ var useWebrtcAudioRuntime = function() {
50092
50458
  };
50093
50459
  }();
50094
50460
  var pause = /* @__PURE__ */ function() {
50095
- var _ref7 = _asyncToGenerator12(function() {
50461
+ var _ref7 = _asyncToGenerator13(function() {
50096
50462
  return _ts_generator(this, function(_state) {
50097
50463
  if (!sessionStartedRef.current) return [
50098
50464
  2
@@ -50113,12 +50479,12 @@ var useWebrtcAudioRuntime = function() {
50113
50479
  return _ref7.apply(this, arguments);
50114
50480
  };
50115
50481
  }();
50116
- return (0, import_react73.useMemo)(function() {
50482
+ return (0, import_react74.useMemo)(function() {
50117
50483
  return {
50118
50484
  webrtcAudioRuntime: {
50119
50485
  user: {
50120
50486
  start: function() {
50121
- var _start = _asyncToGenerator12(function() {
50487
+ var _start = _asyncToGenerator13(function() {
50122
50488
  return _ts_generator(this, function(_state) {
50123
50489
  return [
50124
50490
  2
@@ -50162,10 +50528,10 @@ var useWebrtcAudioRuntime = function() {
50162
50528
  ]);
50163
50529
  };
50164
50530
  // src/components/audioRuntimes/WebrtcAudioRuntimeProvider.tsx
50165
- var import_react_compiler_runtime102 = require("react-compiler-runtime");
50531
+ var import_react_compiler_runtime103 = require("react-compiler-runtime");
50166
50532
  var import_jsx_runtime99 = require("react/jsx-runtime");
50167
50533
  var WebrtcAudioRuntimeProvider = function(t0) {
50168
- var $ = (0, import_react_compiler_runtime102.c)(5);
50534
+ var $ = (0, import_react_compiler_runtime103.c)(5);
50169
50535
  var children = t0.children;
50170
50536
  var webrtcAudioRuntime = useWebrtcAudioRuntime().webrtcAudioRuntime;
50171
50537
  var t1;
@@ -50193,20 +50559,20 @@ var WebrtcAudioRuntimeProvider = function(t0) {
50193
50559
  return t2;
50194
50560
  };
50195
50561
  // src/components/gui/Gui/index.tsx
50196
- var import_react_compiler_runtime105 = require("react-compiler-runtime");
50197
- var import_react76 = require("react");
50562
+ var import_react_compiler_runtime106 = require("react-compiler-runtime");
50563
+ var import_react77 = require("react");
50198
50564
  var import_themes64 = require("@radix-ui/themes");
50199
50565
  // src/hooks/messages/useLatestAssistantMessage/index.ts
50200
- var import_react_compiler_runtime103 = require("react-compiler-runtime");
50201
- var import_react74 = require("react");
50566
+ var import_react_compiler_runtime104 = require("react-compiler-runtime");
50567
+ var import_react75 = require("react");
50202
50568
  var useLatestAssistantMessage = function() {
50203
- var $ = (0, import_react_compiler_runtime103.c)(4);
50569
+ var $ = (0, import_react_compiler_runtime104.c)(4);
50204
50570
  var _useMessages = useMessages(), messages2 = _useMessages.messages;
50205
50571
  var t0;
50206
50572
  var t1;
50207
50573
  if ($[0] !== messages2) {
50208
50574
  var _messages$find;
50209
- t1 = (_messages$find = messages2.find(_temp11)) !== null && _messages$find !== void 0 ? _messages$find : null;
50575
+ t1 = (_messages$find = messages2.find(_temp12)) !== null && _messages$find !== void 0 ? _messages$find : null;
50210
50576
  $[0] = messages2;
50211
50577
  $[1] = t1;
50212
50578
  } else {
@@ -50225,21 +50591,21 @@ var useLatestAssistantMessage = function() {
50225
50591
  t0 = t2;
50226
50592
  return t0;
50227
50593
  };
50228
- function _temp11(message) {
50594
+ function _temp12(message) {
50229
50595
  return message.role === "assistant";
50230
50596
  }
50231
50597
  // src/hooks/messages/useLatestAssistantMessageWithContent/index.ts
50232
- var import_react_compiler_runtime104 = require("react-compiler-runtime");
50598
+ var import_react_compiler_runtime105 = require("react-compiler-runtime");
50233
50599
  var import_radash18 = require("radash");
50234
- var import_react75 = require("react");
50600
+ var import_react76 = require("react");
50235
50601
  var useLatestAssistantMessageWithContent = function() {
50236
- var $ = (0, import_react_compiler_runtime104.c)(4);
50602
+ var $ = (0, import_react_compiler_runtime105.c)(4);
50237
50603
  var _useMessages = useMessages(), messages2 = _useMessages.messages;
50238
50604
  var t0;
50239
50605
  var t1;
50240
50606
  if ($[0] !== messages2) {
50241
50607
  var _messages$find;
50242
- t1 = (_messages$find = messages2.find(_temp25)) !== null && _messages$find !== void 0 ? _messages$find : null;
50608
+ t1 = (_messages$find = messages2.find(_temp26)) !== null && _messages$find !== void 0 ? _messages$find : null;
50243
50609
  $[0] = messages2;
50244
50610
  $[1] = t1;
50245
50611
  } else {
@@ -50258,16 +50624,16 @@ var useLatestAssistantMessageWithContent = function() {
50258
50624
  t0 = t2;
50259
50625
  return t0;
50260
50626
  };
50261
- function _temp12(content2) {
50627
+ function _temp13(content2) {
50262
50628
  return content2.type === "text" && !(0, import_radash18.isEmpty)(content2.text.value);
50263
50629
  }
50264
- function _temp25(message) {
50265
- return message.role === "assistant" && message.content.some(_temp12);
50630
+ function _temp26(message) {
50631
+ return message.role === "assistant" && message.content.some(_temp13);
50266
50632
  }
50267
50633
  // src/components/gui/Gui/index.tsx
50268
50634
  var import_jsx_runtime100 = require("react/jsx-runtime");
50269
50635
  var StartingToolCalls3 = function() {
50270
- var $ = (0, import_react_compiler_runtime105.c)(2);
50636
+ var $ = (0, import_react_compiler_runtime106.c)(2);
50271
50637
  var _useComponents = useComponents(), t0 = _useComponents.components;
50272
50638
  var StartingToolCalls4 = t0.StartingToolCalls;
50273
50639
  var t1;
@@ -50281,7 +50647,7 @@ var StartingToolCalls3 = function() {
50281
50647
  return t1;
50282
50648
  };
50283
50649
  var Content10 = function(t0) {
50284
- var $ = (0, import_react_compiler_runtime105.c)(5);
50650
+ var $ = (0, import_react_compiler_runtime106.c)(5);
50285
50651
  var latestRunStep = t0.latestRunStep;
50286
50652
  var t1;
50287
50653
  bb0: {
@@ -50335,14 +50701,14 @@ var Content10 = function(t0) {
50335
50701
  return t2;
50336
50702
  };
50337
50703
  var Progress2 = function(t0) {
50338
- var $ = (0, import_react_compiler_runtime105.c)(5);
50704
+ var $ = (0, import_react_compiler_runtime106.c)(5);
50339
50705
  var latestAssistantMessage = t0.latestAssistantMessage;
50340
50706
  var isMutatingMessage = useIsMutatingMessage();
50341
50707
  var t1;
50342
50708
  var t2;
50343
50709
  if ($[0] !== latestAssistantMessage.runSteps) {
50344
50710
  var _latestAssistantMessa;
50345
- t2 = (_latestAssistantMessa = latestAssistantMessage.runSteps.find(_temp13)) !== null && _latestAssistantMessa !== void 0 ? _latestAssistantMessa : null;
50711
+ t2 = (_latestAssistantMessa = latestAssistantMessage.runSteps.find(_temp14)) !== null && _latestAssistantMessa !== void 0 ? _latestAssistantMessa : null;
50346
50712
  $[0] = latestAssistantMessage.runSteps;
50347
50713
  $[1] = t2;
50348
50714
  } else {
@@ -50385,7 +50751,7 @@ var Progress2 = function(t0) {
50385
50751
  return t4;
50386
50752
  };
50387
50753
  var Gui = function() {
50388
- var $ = (0, import_react_compiler_runtime105.c)(8);
50754
+ var $ = (0, import_react_compiler_runtime106.c)(8);
50389
50755
  var latestAssistantMessage = useLatestAssistantMessage().latestAssistantMessage;
50390
50756
  var latestAssistantMessageWithContent = useLatestAssistantMessageWithContent().latestAssistantMessageWithContent;
50391
50757
  if (!latestAssistantMessage || !latestAssistantMessageWithContent) {
@@ -50447,26 +50813,26 @@ var Gui = function() {
50447
50813
  }
50448
50814
  return t2;
50449
50815
  };
50450
- function _temp13(rs) {
50816
+ function _temp14(rs) {
50451
50817
  return rs.status === "in_progress";
50452
50818
  }
50453
50819
  // src/components/markdown/MarkdownProvider/index.tsx
50454
- var import_react_compiler_runtime106 = require("react-compiler-runtime");
50455
- var import_react77 = require("react");
50820
+ var import_react_compiler_runtime107 = require("react-compiler-runtime");
50821
+ var import_react78 = require("react");
50456
50822
  var import_jsx_runtime101 = require("react/jsx-runtime");
50457
- var _excluded7 = [
50823
+ var _excluded8 = [
50458
50824
  "children"
50459
50825
  ];
50460
- function _objectWithoutProperties7(e, t) {
50826
+ function _objectWithoutProperties8(e, t) {
50461
50827
  if (null == e) return {};
50462
- var o, r, i = _objectWithoutPropertiesLoose7(e, t);
50828
+ var o, r, i = _objectWithoutPropertiesLoose8(e, t);
50463
50829
  if (Object.getOwnPropertySymbols) {
50464
50830
  var n = Object.getOwnPropertySymbols(e);
50465
50831
  for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
50466
50832
  }
50467
50833
  return i;
50468
50834
  }
50469
- function _objectWithoutPropertiesLoose7(r, e) {
50835
+ function _objectWithoutPropertiesLoose8(r, e) {
50470
50836
  if (null == r) return {};
50471
50837
  var t = {};
50472
50838
  for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
@@ -50476,13 +50842,13 @@ function _objectWithoutPropertiesLoose7(r, e) {
50476
50842
  return t;
50477
50843
  }
50478
50844
  var MarkdownProvider = function(t0) {
50479
- var $ = (0, import_react_compiler_runtime106.c)(9);
50845
+ var $ = (0, import_react_compiler_runtime107.c)(9);
50480
50846
  var children;
50481
50847
  var rest;
50482
50848
  if ($[0] !== t0) {
50483
50849
  var _t = t0;
50484
50850
  children = _t.children;
50485
- rest = _objectWithoutProperties7(_t, _excluded7);
50851
+ rest = _objectWithoutProperties8(_t, _excluded8);
50486
50852
  _t;
50487
50853
  $[0] = t0;
50488
50854
  $[1] = children;
@@ -50519,18 +50885,18 @@ var MarkdownProvider = function(t0) {
50519
50885
  return t3;
50520
50886
  };
50521
50887
  // src/components/annotations/SourceAnnotation/index.tsx
50522
- var import_react_compiler_runtime109 = require("react-compiler-runtime");
50888
+ var import_react_compiler_runtime110 = require("react-compiler-runtime");
50523
50889
  // src/components/annotations/SourceAnnotation/FileCitation/index.tsx
50524
- var import_react_compiler_runtime108 = require("react-compiler-runtime");
50525
- var import_react78 = require("react");
50890
+ var import_react_compiler_runtime109 = require("react-compiler-runtime");
50891
+ var import_react79 = require("react");
50526
50892
  var import_react_icons18 = require("@radix-ui/react-icons");
50527
50893
  var import_themes66 = require("@radix-ui/themes");
50528
50894
  // src/components/annotations/SourceAnnotation/FileCitation/Content.tsx
50529
- var import_react_compiler_runtime107 = require("react-compiler-runtime");
50895
+ var import_react_compiler_runtime108 = require("react-compiler-runtime");
50530
50896
  var import_themes65 = require("@radix-ui/themes");
50531
50897
  var import_jsx_runtime102 = require("react/jsx-runtime");
50532
50898
  var Content11 = function(t0) {
50533
- var $ = (0, import_react_compiler_runtime107.c)(5);
50899
+ var $ = (0, import_react_compiler_runtime108.c)(5);
50534
50900
  var fileId = t0.fileId;
50535
50901
  var superinterfaceContext = useSuperinterfaceContext();
50536
50902
  var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
@@ -50596,9 +50962,9 @@ var Content11 = function(t0) {
50596
50962
  // src/components/annotations/SourceAnnotation/FileCitation/index.tsx
50597
50963
  var import_jsx_runtime103 = require("react/jsx-runtime");
50598
50964
  var FileCitation = function(t0) {
50599
- var $ = (0, import_react_compiler_runtime108.c)(18);
50965
+ var $ = (0, import_react_compiler_runtime109.c)(18);
50600
50966
  var annotation = t0.annotation;
50601
- var _ref = _sliced_to_array((0, import_react78.useState)(null), 2), activeFileId = _ref[0], setActiveFileId = _ref[1];
50967
+ var _ref = _sliced_to_array((0, import_react79.useState)(null), 2), activeFileId = _ref[0], setActiveFileId = _ref[1];
50602
50968
  var t1;
50603
50969
  if ($[0] !== annotation.file_citation.file_id) {
50604
50970
  t1 = function() {
@@ -50723,19 +51089,19 @@ var FileCitation = function(t0) {
50723
51089
  };
50724
51090
  // src/components/annotations/SourceAnnotation/index.tsx
50725
51091
  var import_jsx_runtime104 = require("react/jsx-runtime");
50726
- var _excluded8 = [
51092
+ var _excluded9 = [
50727
51093
  "children"
50728
51094
  ];
50729
- function _objectWithoutProperties8(e, t) {
51095
+ function _objectWithoutProperties9(e, t) {
50730
51096
  if (null == e) return {};
50731
- var o, r, i = _objectWithoutPropertiesLoose8(e, t);
51097
+ var o, r, i = _objectWithoutPropertiesLoose9(e, t);
50732
51098
  if (Object.getOwnPropertySymbols) {
50733
51099
  var n = Object.getOwnPropertySymbols(e);
50734
51100
  for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
50735
51101
  }
50736
51102
  return i;
50737
51103
  }
50738
- function _objectWithoutPropertiesLoose8(r, e) {
51104
+ function _objectWithoutPropertiesLoose9(r, e) {
50739
51105
  if (null == r) return {};
50740
51106
  var t = {};
50741
51107
  for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
@@ -50745,13 +51111,13 @@ function _objectWithoutPropertiesLoose8(r, e) {
50745
51111
  return t;
50746
51112
  }
50747
51113
  var SourceAnnotation = function(t0) {
50748
- var $ = (0, import_react_compiler_runtime109.c)(10);
51114
+ var $ = (0, import_react_compiler_runtime110.c)(10);
50749
51115
  var children;
50750
51116
  var rest;
50751
51117
  if ($[0] !== t0) {
50752
51118
  var _t = t0;
50753
51119
  children = _t.children;
50754
- rest = _objectWithoutProperties8(_t, _excluded8);
51120
+ rest = _objectWithoutProperties9(_t, _excluded9);
50755
51121
  _t;
50756
51122
  $[0] = t0;
50757
51123
  $[1] = children;
@@ -50802,7 +51168,7 @@ var SourceAnnotation = function(t0) {
50802
51168
  return null;
50803
51169
  };
50804
51170
  // src/components/avatars/Avatar.tsx
50805
- var import_react_compiler_runtime112 = require("react-compiler-runtime");
51171
+ var import_react_compiler_runtime113 = require("react-compiler-runtime");
50806
51172
  // src/enums/index.ts
50807
51173
  var IconAvatarName = /* @__PURE__ */ function(IconAvatarName2) {
50808
51174
  IconAvatarName2["BACKPACK"] = "BACKPACK";
@@ -50827,7 +51193,7 @@ var AvatarType = /* @__PURE__ */ function(AvatarType2) {
50827
51193
  // src/components/avatars/Avatar.tsx
50828
51194
  var import_themes69 = require("@radix-ui/themes");
50829
51195
  // src/components/imageAvatars/ImageAvatar/index.tsx
50830
- var import_react_compiler_runtime110 = require("react-compiler-runtime");
51196
+ var import_react_compiler_runtime111 = require("react-compiler-runtime");
50831
51197
  var import_themes67 = require("@radix-ui/themes");
50832
51198
  // src/components/imageAvatars/ImageAvatar/lib/optimizedSrc/path.ts
50833
51199
  var width = function(_ref) {
@@ -50881,7 +51247,7 @@ var optimizedSrc = function(_ref) {
50881
51247
  // src/components/imageAvatars/ImageAvatar/index.tsx
50882
51248
  var import_jsx_runtime105 = require("react/jsx-runtime");
50883
51249
  var ImageAvatar = function(t0) {
50884
- var $ = (0, import_react_compiler_runtime110.c)(9);
51250
+ var $ = (0, import_react_compiler_runtime111.c)(9);
50885
51251
  var imageAvatar = t0.imageAvatar, size = t0.size, className = t0.className, style = t0.style;
50886
51252
  var superinterfaceContext = useSuperinterfaceContext();
50887
51253
  var t1;
@@ -50918,8 +51284,8 @@ var ImageAvatar = function(t0) {
50918
51284
  return t2;
50919
51285
  };
50920
51286
  // src/components/iconAvatars/IconAvatar.tsx
50921
- var import_react_compiler_runtime111 = require("react-compiler-runtime");
50922
- var import_react79 = require("react");
51287
+ var import_react_compiler_runtime112 = require("react-compiler-runtime");
51288
+ var import_react80 = require("react");
50923
51289
  var import_themes68 = require("@radix-ui/themes");
50924
51290
  // src/lib/iconAvatars/iconAvatarComponents.ts
50925
51291
  var import_react_icons19 = require("@radix-ui/react-icons");
@@ -50928,7 +51294,7 @@ var iconAvatarComponents = (_obj = {}, _define_property(_obj, IconAvatarName.BAC
50928
51294
  // src/components/iconAvatars/IconAvatar.tsx
50929
51295
  var import_jsx_runtime106 = require("react/jsx-runtime");
50930
51296
  var IconAvatar = function(t0) {
50931
- var $ = (0, import_react_compiler_runtime111.c)(7);
51297
+ var $ = (0, import_react_compiler_runtime112.c)(7);
50932
51298
  var iconAvatar = t0.iconAvatar, size = t0.size, className = t0.className, style = t0.style;
50933
51299
  var t1;
50934
51300
  t1 = iconAvatarComponents[iconAvatar.name];
@@ -50962,7 +51328,7 @@ var IconAvatar = function(t0) {
50962
51328
  // src/components/avatars/Avatar.tsx
50963
51329
  var import_jsx_runtime107 = require("react/jsx-runtime");
50964
51330
  var Avatar6 = function(t0) {
50965
- var $ = (0, import_react_compiler_runtime112.c)(14);
51331
+ var $ = (0, import_react_compiler_runtime113.c)(14);
50966
51332
  var avatar = t0.avatar, t1 = t0.size, className = t0.className, style = t0.style;
50967
51333
  var size = t1 === void 0 ? "1" : t1;
50968
51334
  if (avatar) {
@@ -51023,22 +51389,22 @@ var Avatar6 = function(t0) {
51023
51389
  return t2;
51024
51390
  };
51025
51391
  // src/components/components/ComponentsProvider.tsx
51026
- var import_react_compiler_runtime113 = require("react-compiler-runtime");
51027
- var import_react80 = require("react");
51392
+ var import_react_compiler_runtime114 = require("react-compiler-runtime");
51393
+ var import_react81 = require("react");
51028
51394
  var import_jsx_runtime108 = require("react/jsx-runtime");
51029
- var _excluded9 = [
51395
+ var _excluded10 = [
51030
51396
  "children"
51031
51397
  ];
51032
- function _objectWithoutProperties9(e, t) {
51398
+ function _objectWithoutProperties10(e, t) {
51033
51399
  if (null == e) return {};
51034
- var o, r, i = _objectWithoutPropertiesLoose9(e, t);
51400
+ var o, r, i = _objectWithoutPropertiesLoose10(e, t);
51035
51401
  if (Object.getOwnPropertySymbols) {
51036
51402
  var n = Object.getOwnPropertySymbols(e);
51037
51403
  for(r = 0; r < n.length; r++)o = n[r], -1 === t.indexOf(o) && ({}).propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
51038
51404
  }
51039
51405
  return i;
51040
51406
  }
51041
- function _objectWithoutPropertiesLoose9(r, e) {
51407
+ function _objectWithoutPropertiesLoose10(r, e) {
51042
51408
  if (null == r) return {};
51043
51409
  var t = {};
51044
51410
  for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
@@ -51048,13 +51414,13 @@ function _objectWithoutPropertiesLoose9(r, e) {
51048
51414
  return t;
51049
51415
  }
51050
51416
  var ComponentsProvider = function(t0) {
51051
- var $ = (0, import_react_compiler_runtime113.c)(9);
51417
+ var $ = (0, import_react_compiler_runtime114.c)(9);
51052
51418
  var children;
51053
51419
  var rest;
51054
51420
  if ($[0] !== t0) {
51055
51421
  var _t = t0;
51056
51422
  children = _t.children;
51057
- rest = _objectWithoutProperties9(_t, _excluded9);
51423
+ rest = _objectWithoutProperties10(_t, _excluded10);
51058
51424
  _t;
51059
51425
  $[0] = t0;
51060
51426
  $[1] = children;
@@ -51091,11 +51457,11 @@ var ComponentsProvider = function(t0) {
51091
51457
  return t3;
51092
51458
  };
51093
51459
  // src/components/assistants/AssistantProvider/index.tsx
51094
- var import_react_compiler_runtime114 = require("react-compiler-runtime");
51460
+ var import_react_compiler_runtime115 = require("react-compiler-runtime");
51095
51461
  var import_jsx_runtime109 = require("react/jsx-runtime");
51096
51462
  var AssistantProvider = function(t0) {
51097
51463
  var _assistant$name;
51098
- var $ = (0, import_react_compiler_runtime114.c)(10);
51464
+ var $ = (0, import_react_compiler_runtime115.c)(10);
51099
51465
  var children = t0.children;
51100
51466
  var superinterfaceContext = useSuperinterfaceContext();
51101
51467
  var t1;