@superinterface/react 5.0.0 → 5.1.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 +207 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +207 -135
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -47436,7 +47436,6 @@ function _toPrimitive47(t, r) {
|
|
|
47436
47436
|
}
|
|
47437
47437
|
return ("string" === r ? String : Number)(t);
|
|
47438
47438
|
}
|
|
47439
|
-
var FULL_SENTENCE_REGEX = /[\.?!]$/;
|
|
47440
47439
|
var getMessageSentences = function(_ref) {
|
|
47441
47440
|
var messageId = _ref.messageId, input2 = _ref.input;
|
|
47442
47441
|
var sentences = (0, import_compromise.default)(input2).sentences().json();
|
|
@@ -47448,80 +47447,110 @@ var getMessageSentences = function(_ref) {
|
|
|
47448
47447
|
});
|
|
47449
47448
|
};
|
|
47450
47449
|
var useMessageAudio = function(t0) {
|
|
47451
|
-
var _latestMessageProps$l;
|
|
47452
|
-
var $ = (0, import_react_compiler_runtime88.c)(
|
|
47453
|
-
var _onEnd = t0.onEnd, passedPlay = t0.play;
|
|
47454
|
-
var _ref = _sliced_to_array((0, import_react67.useState)(false), 2), isAudioPlayed = _ref[0], setIsAudioPlayed = _ref[1];
|
|
47455
|
-
var t1;
|
|
47456
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47457
|
-
t1 = [];
|
|
47458
|
-
$[0] = t1;
|
|
47459
|
-
} else {
|
|
47460
|
-
t1 = $[0];
|
|
47461
|
-
}
|
|
47462
|
-
var _ref1 = _sliced_to_array((0, import_react67.useState)(t1), 2), stoppedMessageIds = _ref1[0], setStoppedMessageIds = _ref1[1];
|
|
47450
|
+
var _latestMessageProps$l, _latestMessageProps$l4, _latestMessageProps$l5;
|
|
47451
|
+
var $ = (0, import_react_compiler_runtime88.c)(68);
|
|
47452
|
+
var _onEnd = t0.onEnd, passedPlay = t0.play, t1 = t0.fullSentenceRegex;
|
|
47463
47453
|
var t2;
|
|
47464
|
-
if ($[
|
|
47465
|
-
t2 = [];
|
|
47454
|
+
if ($[0] !== t1) {
|
|
47455
|
+
t2 = t1 === void 0 ? /[\.?!]$/ : t1;
|
|
47456
|
+
$[0] = t1;
|
|
47466
47457
|
$[1] = t2;
|
|
47467
47458
|
} else {
|
|
47468
47459
|
t2 = $[1];
|
|
47469
47460
|
}
|
|
47470
|
-
var
|
|
47461
|
+
var fullSentenceRegex = t2;
|
|
47462
|
+
var _ref = _sliced_to_array((0, import_react67.useState)(false), 2), isAudioPlayed = _ref[0], setIsAudioPlayed = _ref[1];
|
|
47463
|
+
var t3;
|
|
47464
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47465
|
+
t3 = [];
|
|
47466
|
+
$[2] = t3;
|
|
47467
|
+
} else {
|
|
47468
|
+
t3 = $[2];
|
|
47469
|
+
}
|
|
47470
|
+
var _ref1 = _sliced_to_array((0, import_react67.useState)(t3), 2), stoppedMessageIds = _ref1[0], setStoppedMessageIds = _ref1[1];
|
|
47471
|
+
var t4;
|
|
47472
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47473
|
+
t4 = [];
|
|
47474
|
+
$[3] = t4;
|
|
47475
|
+
} else {
|
|
47476
|
+
t4 = $[3];
|
|
47477
|
+
}
|
|
47478
|
+
var _ref2 = _sliced_to_array((0, import_react67.useState)(t4), 2), playedMessageSentences = _ref2[0], setPlayedMessageSentences = _ref2[1];
|
|
47471
47479
|
var audioPlayer = (0, import_react_use_audio_player2.useAudioPlayer)();
|
|
47472
47480
|
var nextAudioPlayer = (0, import_react_use_audio_player2.useAudioPlayer)();
|
|
47473
47481
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
47474
47482
|
var _ref3 = _sliced_to_array((0, import_react67.useState)(false), 2), isPlaying = _ref3[0], setIsPlaying = _ref3[1];
|
|
47483
|
+
var isLastSentencePlayedRef = (0, import_react67.useRef)(false);
|
|
47475
47484
|
var latestMessageProps = useLatestMessage();
|
|
47476
|
-
var
|
|
47485
|
+
var t5;
|
|
47486
|
+
var t6;
|
|
47487
|
+
if ($[4] !== isPlaying) {
|
|
47488
|
+
t5 = function() {
|
|
47489
|
+
if (!isPlaying) {
|
|
47490
|
+
return;
|
|
47491
|
+
}
|
|
47492
|
+
isLastSentencePlayedRef.current = false;
|
|
47493
|
+
};
|
|
47494
|
+
t6 = [
|
|
47495
|
+
isPlaying
|
|
47496
|
+
];
|
|
47497
|
+
$[4] = isPlaying;
|
|
47498
|
+
$[5] = t5;
|
|
47499
|
+
$[6] = t6;
|
|
47500
|
+
} else {
|
|
47501
|
+
t5 = $[5];
|
|
47502
|
+
t6 = $[6];
|
|
47503
|
+
}
|
|
47504
|
+
(0, import_react67.useEffect)(t5, t6);
|
|
47505
|
+
var t7;
|
|
47477
47506
|
bb0: {
|
|
47478
47507
|
if (!latestMessageProps.latestMessage) {
|
|
47479
47508
|
var _t;
|
|
47480
|
-
if ($[
|
|
47509
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47481
47510
|
_t = [];
|
|
47482
|
-
$[
|
|
47511
|
+
$[7] = _t;
|
|
47483
47512
|
} else {
|
|
47484
|
-
_t = $[
|
|
47513
|
+
_t = $[7];
|
|
47485
47514
|
}
|
|
47486
|
-
|
|
47515
|
+
t7 = _t;
|
|
47487
47516
|
break bb0;
|
|
47488
47517
|
}
|
|
47489
47518
|
if (latestMessageProps.latestMessage.role !== "assistant") {
|
|
47490
47519
|
var _t2;
|
|
47491
|
-
if ($[
|
|
47520
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47492
47521
|
_t2 = [];
|
|
47493
|
-
$[
|
|
47522
|
+
$[8] = _t2;
|
|
47494
47523
|
} else {
|
|
47495
|
-
_t2 = $[
|
|
47524
|
+
_t2 = $[8];
|
|
47496
47525
|
}
|
|
47497
|
-
|
|
47526
|
+
t7 = _t2;
|
|
47498
47527
|
break bb0;
|
|
47499
47528
|
}
|
|
47500
47529
|
if (stoppedMessageIds.includes(latestMessageProps.latestMessage.id)) {
|
|
47501
47530
|
var _t3;
|
|
47502
|
-
if ($[
|
|
47531
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47503
47532
|
_t3 = [];
|
|
47504
|
-
$[
|
|
47533
|
+
$[9] = _t3;
|
|
47505
47534
|
} else {
|
|
47506
|
-
_t3 = $[
|
|
47535
|
+
_t3 = $[9];
|
|
47507
47536
|
}
|
|
47508
|
-
|
|
47537
|
+
t7 = _t3;
|
|
47509
47538
|
break bb0;
|
|
47510
47539
|
}
|
|
47511
47540
|
var _t4;
|
|
47512
|
-
if ($[
|
|
47541
|
+
if ($[10] !== latestMessageProps.latestMessage || $[11] !== playedMessageSentences) {
|
|
47513
47542
|
var input2 = input({
|
|
47514
47543
|
message: latestMessageProps.latestMessage
|
|
47515
47544
|
});
|
|
47516
47545
|
if (!input2) {
|
|
47517
47546
|
var _t5;
|
|
47518
|
-
if ($[
|
|
47547
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
47519
47548
|
_t5 = [];
|
|
47520
|
-
$[
|
|
47549
|
+
$[14] = _t5;
|
|
47521
47550
|
} else {
|
|
47522
|
-
_t5 = $[
|
|
47551
|
+
_t5 = $[14];
|
|
47523
47552
|
}
|
|
47524
|
-
|
|
47553
|
+
t7 = _t5;
|
|
47525
47554
|
break bb0;
|
|
47526
47555
|
}
|
|
47527
47556
|
var messageSentences = getMessageSentences({
|
|
@@ -47529,33 +47558,33 @@ var useMessageAudio = function(t0) {
|
|
|
47529
47558
|
input: input2
|
|
47530
47559
|
});
|
|
47531
47560
|
var _t6;
|
|
47532
|
-
if ($[
|
|
47561
|
+
if ($[15] !== playedMessageSentences) {
|
|
47533
47562
|
_t6 = function(ms) {
|
|
47534
47563
|
return !playedMessageSentences.find(function(pms) {
|
|
47535
47564
|
return pms.messageId === ms.messageId && pms.sentence === ms.sentence;
|
|
47536
47565
|
});
|
|
47537
47566
|
};
|
|
47538
|
-
$[
|
|
47539
|
-
$[
|
|
47567
|
+
$[15] = playedMessageSentences;
|
|
47568
|
+
$[16] = _t6;
|
|
47540
47569
|
} else {
|
|
47541
|
-
_t6 = $[
|
|
47570
|
+
_t6 = $[16];
|
|
47542
47571
|
}
|
|
47543
47572
|
_t4 = messageSentences.filter(_t6);
|
|
47544
|
-
$[
|
|
47545
|
-
$[
|
|
47546
|
-
$[
|
|
47547
|
-
$[
|
|
47573
|
+
$[10] = latestMessageProps.latestMessage;
|
|
47574
|
+
$[11] = playedMessageSentences;
|
|
47575
|
+
$[12] = _t4;
|
|
47576
|
+
$[13] = t7;
|
|
47548
47577
|
} else {
|
|
47549
|
-
_t4 = $[
|
|
47550
|
-
|
|
47578
|
+
_t4 = $[12];
|
|
47579
|
+
t7 = $[13];
|
|
47551
47580
|
}
|
|
47552
|
-
|
|
47581
|
+
t7 = _t4;
|
|
47553
47582
|
}
|
|
47554
|
-
var unplayedMessageSentences =
|
|
47555
|
-
var
|
|
47556
|
-
if ($[
|
|
47557
|
-
|
|
47558
|
-
var input_0 =
|
|
47583
|
+
var unplayedMessageSentences = t7;
|
|
47584
|
+
var t8;
|
|
47585
|
+
if ($[17] !== audioPlayer || $[18] !== fullSentenceRegex || $[19] !== isAudioPlayed || $[20] !== nextAudioPlayer || $[21] !== superinterfaceContext || $[22] !== unplayedMessageSentences[1]) {
|
|
47586
|
+
t8 = function(t92) {
|
|
47587
|
+
var input_0 = t92.input, onPlay = t92.onPlay, onStop = t92.onStop, onEnd_0 = t92.onEnd;
|
|
47559
47588
|
var searchParams = new URLSearchParams(_objectSpread47({
|
|
47560
47589
|
input: input_0
|
|
47561
47590
|
}, superinterfaceContext.variables));
|
|
@@ -47570,7 +47599,7 @@ var useMessageAudio = function(t0) {
|
|
|
47570
47599
|
if (!nextUnplayedMessageSentence) {
|
|
47571
47600
|
return;
|
|
47572
47601
|
}
|
|
47573
|
-
var isNextFullSentence =
|
|
47602
|
+
var isNextFullSentence = fullSentenceRegex.test(nextUnplayedMessageSentence.sentence);
|
|
47574
47603
|
if (!isNextFullSentence) {
|
|
47575
47604
|
return;
|
|
47576
47605
|
}
|
|
@@ -47586,22 +47615,23 @@ var useMessageAudio = function(t0) {
|
|
|
47586
47615
|
onend: onEnd_0
|
|
47587
47616
|
});
|
|
47588
47617
|
};
|
|
47589
|
-
$[
|
|
47590
|
-
$[
|
|
47591
|
-
$[
|
|
47592
|
-
$[
|
|
47593
|
-
$[
|
|
47594
|
-
$[
|
|
47618
|
+
$[17] = audioPlayer;
|
|
47619
|
+
$[18] = fullSentenceRegex;
|
|
47620
|
+
$[19] = isAudioPlayed;
|
|
47621
|
+
$[20] = nextAudioPlayer;
|
|
47622
|
+
$[21] = superinterfaceContext;
|
|
47623
|
+
$[22] = unplayedMessageSentences[1];
|
|
47624
|
+
$[23] = t8;
|
|
47595
47625
|
} else {
|
|
47596
|
-
|
|
47626
|
+
t8 = $[23];
|
|
47597
47627
|
}
|
|
47598
|
-
var defaultPlay =
|
|
47599
|
-
var
|
|
47600
|
-
|
|
47601
|
-
var play =
|
|
47602
|
-
var
|
|
47603
|
-
if ($[
|
|
47604
|
-
|
|
47628
|
+
var defaultPlay = t8;
|
|
47629
|
+
var t9;
|
|
47630
|
+
t9 = passedPlay || defaultPlay;
|
|
47631
|
+
var play = t9;
|
|
47632
|
+
var t10;
|
|
47633
|
+
if ($[24] !== audioPlayer.playing || $[25] !== fullSentenceRegex || $[26] !== isPlaying || $[27] !== latestMessageProps.latestMessage || $[28] !== _onEnd || $[29] !== play || $[30] !== unplayedMessageSentences[0] || $[31] !== unplayedMessageSentences.length) {
|
|
47634
|
+
t10 = function() {
|
|
47605
47635
|
if (isPlaying) {
|
|
47606
47636
|
return;
|
|
47607
47637
|
}
|
|
@@ -47620,7 +47650,7 @@ var useMessageAudio = function(t0) {
|
|
|
47620
47650
|
}
|
|
47621
47651
|
var isFullSentence = isOptimistic({
|
|
47622
47652
|
id: latestMessageProps.latestMessage.id
|
|
47623
|
-
}) || latestMessageProps.latestMessage.status !== "in_progress" ||
|
|
47653
|
+
}) || latestMessageProps.latestMessage.status !== "in_progress" || fullSentenceRegex.test(firstUnplayedMessageSentence.sentence);
|
|
47624
47654
|
if (!isFullSentence) {
|
|
47625
47655
|
return;
|
|
47626
47656
|
}
|
|
@@ -47646,25 +47676,29 @@ var useMessageAudio = function(t0) {
|
|
|
47646
47676
|
},
|
|
47647
47677
|
onEnd: function() {
|
|
47648
47678
|
setIsPlaying(false);
|
|
47649
|
-
|
|
47679
|
+
isLastSentencePlayedRef.current = unplayedMessageSentences.length === 1;
|
|
47680
|
+
if (isLastSentencePlayedRef.current && latestMessageProps.latestMessage.status !== "in_progress") {
|
|
47650
47681
|
_onEnd();
|
|
47682
|
+
isLastSentencePlayedRef.current = false;
|
|
47651
47683
|
}
|
|
47652
47684
|
}
|
|
47653
47685
|
});
|
|
47654
47686
|
};
|
|
47655
|
-
$[
|
|
47656
|
-
$[
|
|
47657
|
-
$[
|
|
47658
|
-
$[
|
|
47659
|
-
$[
|
|
47660
|
-
$[
|
|
47661
|
-
$[
|
|
47687
|
+
$[24] = audioPlayer.playing;
|
|
47688
|
+
$[25] = fullSentenceRegex;
|
|
47689
|
+
$[26] = isPlaying;
|
|
47690
|
+
$[27] = latestMessageProps.latestMessage;
|
|
47691
|
+
$[28] = _onEnd;
|
|
47692
|
+
$[29] = play;
|
|
47693
|
+
$[30] = unplayedMessageSentences[0];
|
|
47694
|
+
$[31] = unplayedMessageSentences.length;
|
|
47695
|
+
$[32] = t10;
|
|
47662
47696
|
} else {
|
|
47663
|
-
|
|
47697
|
+
t10 = $[32];
|
|
47664
47698
|
}
|
|
47665
|
-
var
|
|
47666
|
-
if ($[
|
|
47667
|
-
|
|
47699
|
+
var t11;
|
|
47700
|
+
if ($[33] !== audioPlayer || $[34] !== fullSentenceRegex || $[35] !== isPlaying || $[36] !== latestMessageProps || $[37] !== nextAudioPlayer || $[38] !== _onEnd || $[39] !== play || $[40] !== playedMessageSentences || $[41] !== superinterfaceContext || $[42] !== unplayedMessageSentences) {
|
|
47701
|
+
t11 = [
|
|
47668
47702
|
unplayedMessageSentences,
|
|
47669
47703
|
isPlaying,
|
|
47670
47704
|
superinterfaceContext,
|
|
@@ -47673,38 +47707,76 @@ var useMessageAudio = function(t0) {
|
|
|
47673
47707
|
nextAudioPlayer,
|
|
47674
47708
|
playedMessageSentences,
|
|
47675
47709
|
_onEnd,
|
|
47676
|
-
play
|
|
47710
|
+
play,
|
|
47711
|
+
fullSentenceRegex
|
|
47677
47712
|
];
|
|
47678
|
-
$[
|
|
47679
|
-
$[
|
|
47680
|
-
$[
|
|
47681
|
-
$[
|
|
47682
|
-
$[
|
|
47683
|
-
$[
|
|
47684
|
-
$[
|
|
47685
|
-
$[
|
|
47686
|
-
$[
|
|
47687
|
-
$[
|
|
47688
|
-
|
|
47689
|
-
|
|
47690
|
-
|
|
47691
|
-
|
|
47692
|
-
|
|
47693
|
-
|
|
47694
|
-
|
|
47713
|
+
$[33] = audioPlayer;
|
|
47714
|
+
$[34] = fullSentenceRegex;
|
|
47715
|
+
$[35] = isPlaying;
|
|
47716
|
+
$[36] = latestMessageProps;
|
|
47717
|
+
$[37] = nextAudioPlayer;
|
|
47718
|
+
$[38] = _onEnd;
|
|
47719
|
+
$[39] = play;
|
|
47720
|
+
$[40] = playedMessageSentences;
|
|
47721
|
+
$[41] = superinterfaceContext;
|
|
47722
|
+
$[42] = unplayedMessageSentences;
|
|
47723
|
+
$[43] = t11;
|
|
47724
|
+
} else {
|
|
47725
|
+
t11 = $[43];
|
|
47726
|
+
}
|
|
47727
|
+
(0, import_react67.useEffect)(t10, t11);
|
|
47728
|
+
var t12;
|
|
47729
|
+
if ($[44] !== isPlaying || $[45] !== ((_latestMessageProps$l = latestMessageProps.latestMessage) === null || _latestMessageProps$l === void 0 ? void 0 : _latestMessageProps$l.status) || $[46] !== _onEnd || $[47] !== unplayedMessageSentences.length) {
|
|
47730
|
+
var _latestMessageProps$l3;
|
|
47731
|
+
t12 = function() {
|
|
47732
|
+
var _latestMessageProps$l2;
|
|
47733
|
+
if (isLastSentencePlayedRef.current && !isPlaying && unplayedMessageSentences.length === 0 && ((_latestMessageProps$l2 = latestMessageProps.latestMessage) === null || _latestMessageProps$l2 === void 0 ? void 0 : _latestMessageProps$l2.status) !== "in_progress") {
|
|
47734
|
+
_onEnd();
|
|
47735
|
+
isLastSentencePlayedRef.current = false;
|
|
47736
|
+
}
|
|
47737
|
+
};
|
|
47738
|
+
$[44] = isPlaying;
|
|
47739
|
+
$[45] = (_latestMessageProps$l3 = latestMessageProps.latestMessage) === null || _latestMessageProps$l3 === void 0 ? void 0 : _latestMessageProps$l3.status;
|
|
47740
|
+
$[46] = _onEnd;
|
|
47741
|
+
$[47] = unplayedMessageSentences.length;
|
|
47742
|
+
$[48] = t12;
|
|
47743
|
+
} else {
|
|
47744
|
+
t12 = $[48];
|
|
47745
|
+
}
|
|
47746
|
+
var t13 = (_latestMessageProps$l4 = latestMessageProps.latestMessage) === null || _latestMessageProps$l4 === void 0 ? void 0 : _latestMessageProps$l4.status;
|
|
47747
|
+
var t14;
|
|
47748
|
+
if ($[49] !== isPlaying || $[50] !== _onEnd || $[51] !== t13 || $[52] !== unplayedMessageSentences.length) {
|
|
47749
|
+
t14 = [
|
|
47750
|
+
isPlaying,
|
|
47751
|
+
unplayedMessageSentences.length,
|
|
47752
|
+
t13,
|
|
47753
|
+
_onEnd
|
|
47754
|
+
];
|
|
47755
|
+
$[49] = isPlaying;
|
|
47756
|
+
$[50] = _onEnd;
|
|
47757
|
+
$[51] = t13;
|
|
47758
|
+
$[52] = unplayedMessageSentences.length;
|
|
47759
|
+
$[53] = t14;
|
|
47760
|
+
} else {
|
|
47761
|
+
t14 = $[53];
|
|
47762
|
+
}
|
|
47763
|
+
(0, import_react67.useEffect)(t12, t14);
|
|
47764
|
+
var t15;
|
|
47765
|
+
if ($[54] !== audioPlayer) {
|
|
47766
|
+
t15 = [
|
|
47695
47767
|
audioPlayer
|
|
47696
47768
|
];
|
|
47697
|
-
$[
|
|
47698
|
-
$[
|
|
47769
|
+
$[54] = audioPlayer;
|
|
47770
|
+
$[55] = t15;
|
|
47699
47771
|
} else {
|
|
47700
|
-
|
|
47772
|
+
t15 = $[55];
|
|
47701
47773
|
}
|
|
47702
|
-
(0, import_react67.useEffect)(_temp9,
|
|
47774
|
+
(0, import_react67.useEffect)(_temp9, t15);
|
|
47703
47775
|
var _ref4 = _sliced_to_array((0, import_react67.useState)(null), 2), audioEngine = _ref4[0], setAudioEngine = _ref4[1];
|
|
47704
47776
|
var isAudioEngineInited = (0, import_react67.useRef)(false);
|
|
47705
|
-
var
|
|
47706
|
-
if ($[
|
|
47707
|
-
|
|
47777
|
+
var t16;
|
|
47778
|
+
if ($[56] !== audioPlayer.playing) {
|
|
47779
|
+
t16 = function() {
|
|
47708
47780
|
if (!audioPlayer.playing) {
|
|
47709
47781
|
return;
|
|
47710
47782
|
}
|
|
@@ -47725,63 +47797,63 @@ var useMessageAudio = function(t0) {
|
|
|
47725
47797
|
});
|
|
47726
47798
|
}
|
|
47727
47799
|
};
|
|
47728
|
-
$[
|
|
47729
|
-
$[
|
|
47800
|
+
$[56] = audioPlayer.playing;
|
|
47801
|
+
$[57] = t16;
|
|
47730
47802
|
} else {
|
|
47731
|
-
|
|
47803
|
+
t16 = $[57];
|
|
47732
47804
|
}
|
|
47733
|
-
var
|
|
47734
|
-
if ($[
|
|
47735
|
-
|
|
47805
|
+
var t17;
|
|
47806
|
+
if ($[58] !== audioPlayer) {
|
|
47807
|
+
t17 = [
|
|
47736
47808
|
audioPlayer,
|
|
47737
47809
|
isAudioEngineInited
|
|
47738
47810
|
];
|
|
47739
|
-
$[
|
|
47740
|
-
$[
|
|
47811
|
+
$[58] = audioPlayer;
|
|
47812
|
+
$[59] = t17;
|
|
47741
47813
|
} else {
|
|
47742
|
-
|
|
47814
|
+
t17 = $[59];
|
|
47743
47815
|
}
|
|
47744
|
-
(0, import_react67.useEffect)(
|
|
47745
|
-
var
|
|
47816
|
+
(0, import_react67.useEffect)(t16, t17);
|
|
47817
|
+
var t18;
|
|
47746
47818
|
bb1: {
|
|
47747
47819
|
if (!audioEngine) {
|
|
47748
|
-
|
|
47820
|
+
t18 = null;
|
|
47749
47821
|
break bb1;
|
|
47750
47822
|
}
|
|
47751
47823
|
var result;
|
|
47752
|
-
if ($[
|
|
47824
|
+
if ($[60] !== audioEngine.audioContext || $[61] !== audioEngine.source) {
|
|
47753
47825
|
result = audioEngine.audioContext.createAnalyser();
|
|
47754
47826
|
audioEngine.source.connect(audioEngine.audioContext.destination);
|
|
47755
47827
|
audioEngine.source.connect(result);
|
|
47756
|
-
$[
|
|
47757
|
-
$[
|
|
47758
|
-
$[
|
|
47828
|
+
$[60] = audioEngine.audioContext;
|
|
47829
|
+
$[61] = audioEngine.source;
|
|
47830
|
+
$[62] = result;
|
|
47759
47831
|
} else {
|
|
47760
|
-
result = $[
|
|
47832
|
+
result = $[62];
|
|
47761
47833
|
}
|
|
47762
|
-
|
|
47834
|
+
t18 = result;
|
|
47763
47835
|
}
|
|
47764
|
-
var visualizationAnalyser =
|
|
47765
|
-
var
|
|
47766
|
-
|
|
47767
|
-
var isPending =
|
|
47768
|
-
var
|
|
47769
|
-
if ($[
|
|
47770
|
-
|
|
47836
|
+
var visualizationAnalyser = t18;
|
|
47837
|
+
var t19;
|
|
47838
|
+
t19 = isPlaying || unplayedMessageSentences.length > 0 || ((_latestMessageProps$l5 = latestMessageProps.latestMessage) === null || _latestMessageProps$l5 === void 0 ? void 0 : _latestMessageProps$l5.status) === "in_progress";
|
|
47839
|
+
var isPending = t19;
|
|
47840
|
+
var t20;
|
|
47841
|
+
if ($[63] !== audioPlayer || $[64] !== isAudioPlayed || $[65] !== isPending || $[66] !== visualizationAnalyser) {
|
|
47842
|
+
t20 = _objectSpread47(_objectSpread47({
|
|
47771
47843
|
isPending: isPending,
|
|
47772
47844
|
isAudioPlayed: isAudioPlayed
|
|
47773
47845
|
}, audioPlayer), {}, {
|
|
47774
47846
|
visualizationAnalyser: visualizationAnalyser
|
|
47775
47847
|
});
|
|
47776
|
-
$[
|
|
47777
|
-
$[
|
|
47778
|
-
$[
|
|
47779
|
-
$[
|
|
47780
|
-
$[
|
|
47848
|
+
$[63] = audioPlayer;
|
|
47849
|
+
$[64] = isAudioPlayed;
|
|
47850
|
+
$[65] = isPending;
|
|
47851
|
+
$[66] = visualizationAnalyser;
|
|
47852
|
+
$[67] = t20;
|
|
47781
47853
|
} else {
|
|
47782
|
-
|
|
47854
|
+
t20 = $[67];
|
|
47783
47855
|
}
|
|
47784
|
-
return
|
|
47856
|
+
return t20;
|
|
47785
47857
|
};
|
|
47786
47858
|
function _temp9() {
|
|
47787
47859
|
if (isHtmlAudioSupported) {
|