sceyt-chat-react-uikit 1.8.6 → 1.8.7-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/index.modern.js CHANGED
@@ -18694,7 +18694,6 @@ function markMessagesRead(action) {
18694
18694
  _context0.n = 9;
18695
18695
  break;
18696
18696
  }
18697
- console.log('Mark Messages As Read', messageIds);
18698
18697
  _context0.n = 4;
18699
18698
  return call(channel.markMessagesAsDisplayed, messageIds);
18700
18699
  case 4:
@@ -18955,7 +18954,6 @@ function markMessagesDelivered(action) {
18955
18954
  _context12.n = 7;
18956
18955
  break;
18957
18956
  }
18958
- console.log('Mark Messages As Delivered', messageIds);
18959
18957
  _context12.n = 3;
18960
18958
  return call(channel.markMessagesAsReceived, messageIds);
18961
18959
  case 3:
@@ -31332,10 +31330,12 @@ var UsersPopup = function UsersPopup(_ref2) {
31332
31330
  })));
31333
31331
  };
31334
31332
  var List = styled.div(_templateObject$b || (_templateObject$b = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n overflow-x: hidden;\n margin-top: 12px;\n min-height: 150px;\n box-sizing: border-box;\n"])));
31335
- var MembersContainer = styled(List)(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n position: relative;\n max-height: ", ";\n overflow-y: auto;\n padding-right: 16px;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
31333
+ var MembersContainer = styled(List)(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n position: relative;\n max-height: ", ";\n overflow-y: auto;\n padding-right: 16px;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n"])), function (props) {
31336
31334
  return "calc(100% - (" + ((props.isAdd ? 67 : 70) + props.selectedMembersHeight) + "px))";
31337
31335
  }, function (props) {
31338
31336
  return props.thumbColor;
31337
+ }, function (props) {
31338
+ return props.thumbColor;
31339
31339
  });
31340
31340
  var SearchUserCont = styled.div(_templateObject3$8 || (_templateObject3$8 = _taggedTemplateLiteralLoose(["\n position: relative;\n margin: 24px 12px 0;\n\n ", " {\n top: 10px;\n right: 11px;\n }\n"])), ClearTypedText);
31341
31341
  var SearchUsersInput = styled.input(_templateObject4$7 || (_templateObject4$7 = _taggedTemplateLiteralLoose(["\n height: 40px;\n width: 100%;\n font-size: 14px;\n border: ", ";\n box-sizing: border-box;\n border-radius: 8px;\n padding-left: 36px;\n color: ", ";\n background-color: ", ";\n\n &::placeholder {\n color: ", ";\n font-size: 14px;\n opacity: 1;\n }\n\n &:focus {\n outline: none;\n }\n"])), function (props) {
@@ -31356,7 +31356,7 @@ var UserNamePresence = styled.div(_templateObject6$3 || (_templateObject6$3 = _t
31356
31356
  var MemberName = styled.h4(_templateObject7$3 || (_templateObject7$3 = _taggedTemplateLiteralLoose(["\n font-style: normal;\n font-size: 15px;\n font-weight: 500;\n line-height: 16px;\n color: ", ";\n margin: 0;\n max-width: calc(100% - 10px);\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n"])), function (props) {
31357
31357
  return props.color;
31358
31358
  });
31359
- var SelectedMembersContainer = styled.div(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: flex-start;\n flex-wrap: wrap;\n width: 100%;\n max-height: 85px;\n overflow-x: hidden;\n padding: 2px 12px 0;\n box-sizing: border-box;\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
31359
+ var SelectedMembersContainer = styled.div(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: flex-start;\n flex-wrap: wrap;\n width: 100%;\n max-height: 85px;\n overflow-x: hidden;\n padding: 2px 12px 0;\n box-sizing: border-box;\n overflow-y: auto;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
31360
31360
  return props.thumbColor;
31361
31361
  });
31362
31362
  var SelectedMemberBubble = styled.div(_templateObject9$2 || (_templateObject9$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n background: ", ";\n border-radius: 16px;\n align-items: center;\n padding: 4px 10px 4px 0;\n height: 28px;\n margin: 8px 8px 0 0;\n box-sizing: border-box;\n"])), function (props) {
@@ -33143,7 +33143,9 @@ var Container$7 = styled.div(_templateObject$i || (_templateObject$i = _taggedTe
33143
33143
  }, function (props) {
33144
33144
  return props.withCustomList ? '' : "\n @media " + device.laptopL + " {\n width: 400px;\n min-width: 400px;\n }\n ";
33145
33145
  });
33146
- var ChannelsList = styled.div(_templateObject2$g || (_templateObject2$g = _taggedTemplateLiteralLoose(["\n overflow-y: auto;\n width: 400px;\n height: 100%;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
33146
+ var ChannelsList = styled.div(_templateObject2$g || (_templateObject2$g = _taggedTemplateLiteralLoose(["\n overflow-y: auto;\n width: 400px;\n height: 100%;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n"])), function (props) {
33147
+ return props.thumbColor;
33148
+ }, function (props) {
33147
33149
  return props.thumbColor;
33148
33150
  });
33149
33151
  var SearchedChannels = styled.div(_templateObject3$d || (_templateObject3$d = _taggedTemplateLiteralLoose(["\n height: calc(100vh - 123px);\n overflow-x: hidden;\n"])));
@@ -34992,10 +34994,12 @@ function ForwardMessagePopup(_ref2) {
34992
34994
  onClick: handleForwardMessage
34993
34995
  }, buttonText || 'Forward'))));
34994
34996
  }
34995
- var ForwardChannelsCont = styled.div(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n overflow-y: auto;\n margin-top: 16px;\n max-height: ", ";\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
34997
+ var ForwardChannelsCont = styled.div(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n overflow-y: auto;\n margin-top: 16px;\n max-height: ", ";\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n"])), function (props) {
34996
34998
  return "calc(100% - " + (props.selectedChannelsHeight + 82) + "px)";
34997
34999
  }, function (props) {
34998
35000
  return props.thumbColor;
35001
+ }, function (props) {
35002
+ return props.thumbColor;
34999
35003
  });
35000
35004
  var ChannelItem = styled.div(_templateObject2$l || (_templateObject2$l = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n padding: 8px 12px;\n cursor: pointer;\n border-radius: 8px;\n position: relative;\n\n ", "\n"])), function (_ref3) {
35001
35005
  var disabled = _ref3.disabled,
@@ -39876,7 +39880,9 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
39876
39880
  color: textSecondary
39877
39881
  }, "Loading...")))))));
39878
39882
  };
39879
- var VotesList = styled.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n max-height: 500px;\n padding: 8px 0;\n overflow-y: auto;\n overflow-x: hidden;\n padding-right: 14px;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
39883
+ var VotesList = styled.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n max-height: 500px;\n padding: 8px 0;\n overflow-y: auto;\n overflow-x: hidden;\n padding-right: 14px;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n"])), function (props) {
39884
+ return props.thumbColor;
39885
+ }, function (props) {
39880
39886
  return props.thumbColor;
39881
39887
  });
39882
39888
  var VoterRow = styled.div(_templateObject2$z || (_templateObject2$z = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 6px 0;\n"])));
@@ -40059,10 +40065,12 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
40059
40065
  })) === null || _poll$options$find === void 0 ? void 0 : _poll$options$find.name) || ''
40060
40066
  })));
40061
40067
  };
40062
- var OptionsList = styled.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n max-height: calc(554px - ", "px);\n border-radius: 10px;\n overflow-y: auto;\n overflow-x: hidden;\n width: calc(100% + 20px);\n padding-right: 14px;\n box-sizing: border-box;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
40068
+ var OptionsList = styled.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n max-height: calc(554px - ", "px);\n border-radius: 10px;\n overflow-y: auto;\n overflow-x: hidden;\n width: calc(100% + 20px);\n padding-right: 14px;\n box-sizing: border-box;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n"])), function (props) {
40063
40069
  return props.titleHeight;
40064
40070
  }, function (props) {
40065
40071
  return props.thumbColor;
40072
+ }, function (props) {
40073
+ return props.thumbColor;
40066
40074
  });
40067
40075
  var OptionBlock = styled.div(_templateObject2$A || (_templateObject2$A = _taggedTemplateLiteralLoose(["\n background: ", ";\n border-radius: 10px;\n border: 1px solid ", "0F; /* subtle */\n padding: 14px 16px 0 16px;\n"])), function (p) {
40068
40076
  return p.backgroundColor;
@@ -42796,7 +42804,7 @@ var MESSAGE_ACTIONS_HOVER_DELAY = 450;
42796
42804
  var MAX_SELECTED_MESSAGES = 30;
42797
42805
  var EMOJI_POPUP_THRESHOLD = 300;
42798
42806
  var Message$1 = function Message(_ref) {
42799
- var _message$reactionTota;
42807
+ var _tabIsActiveRef$curre, _message$reactionTota;
42800
42808
  var message = _ref.message,
42801
42809
  channel = _ref.channel,
42802
42810
  MessageActionsMenu = _ref.MessageActionsMenu,
@@ -42952,6 +42960,7 @@ var Message$1 = function Message(_ref) {
42952
42960
  openedMessageMenuId = _ref.openedMessageMenuId,
42953
42961
  _ref$tabIsActive = _ref.tabIsActive,
42954
42962
  tabIsActive = _ref$tabIsActive === void 0 ? true : _ref$tabIsActive,
42963
+ tabIsActiveRef = _ref.tabIsActiveRef,
42955
42964
  connectionStatus = _ref.connectionStatus,
42956
42965
  messageTextFontSize = _ref.messageTextFontSize,
42957
42966
  messageTextLineHeight = _ref.messageTextLineHeight,
@@ -42964,6 +42973,7 @@ var Message$1 = function Message(_ref) {
42964
42973
  _ref$createChatOnAvat = _ref.createChatOnAvatarTap,
42965
42974
  createChatOnAvatarTap = _ref$createChatOnAvat === void 0 ? true : _ref$createChatOnAvat,
42966
42975
  ifLatestAndHasNotPreview = _ref.ifLatestAndHasNotPreview;
42976
+ var isTabActive = (_tabIsActiveRef$curre = tabIsActiveRef === null || tabIsActiveRef === void 0 ? void 0 : tabIsActiveRef.current) != null ? _tabIsActiveRef$curre : tabIsActive;
42967
42977
  var getComparableUserId = function getComparableUserId(messageUser) {
42968
42978
  return messageUser !== null && messageUser !== void 0 && messageUser.id ? String(messageUser.id) : 'deleted';
42969
42979
  };
@@ -43205,14 +43215,14 @@ var Message$1 = function Message(_ref) {
43205
43215
  }
43206
43216
  if (isVisible && message.incoming && !(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
43207
43217
  return marker.name === MESSAGE_DELIVERY_STATUS.READ;
43208
- })) && !disableAutoReadTracking && tabIsActive && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
43218
+ })) && !disableAutoReadTracking && isTabActive && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
43209
43219
  if (queueReadMarker) {
43210
43220
  queueReadMarker(channel.id, message.id);
43211
43221
  } else {
43212
43222
  dispatch(markMessagesAsReadAC(channel.id, [message.id]));
43213
43223
  }
43214
43224
  }
43215
- }, [dispatch, message.incoming, message.userMarkers, message.id, isVisible, channel.id, channel.newMessageCount, connectionStatus, queueReadMarker, queueDeliveredMarker, disableAutoReadTracking, tabIsActive]);
43225
+ }, [dispatch, message.incoming, message.userMarkers, message.id, isVisible, channel.id, channel.newMessageCount, connectionStatus, queueReadMarker, queueDeliveredMarker, disableAutoReadTracking, isTabActive]);
43216
43226
  var handleForwardMessage = useCallback(function (channelIds) {
43217
43227
  if (channelIds && channelIds.length) {
43218
43228
  channelIds.forEach(function (channelId) {
@@ -43266,7 +43276,7 @@ var Message$1 = function Message(_ref) {
43266
43276
  removeMessageFromVisibleMessagesMap(message);
43267
43277
  }
43268
43278
  }
43269
- }, [isVisible, setLastVisibleMessageId, message.id, handleSendReadMarker, channel.isLinkedChannel, channel.lastMessage, scrollToNewMessage.scrollToBottom, dispatch, message, tabIsActive]);
43279
+ }, [isVisible, setLastVisibleMessageId, message.id, handleSendReadMarker, channel.isLinkedChannel, channel.lastMessage, scrollToNewMessage.scrollToBottom, dispatch, message, isTabActive]);
43270
43280
  useEffect(function () {
43271
43281
  return function () {
43272
43282
  if (!channel.isLinkedChannel) {
@@ -43632,7 +43642,7 @@ var Message$1 = function Message(_ref) {
43632
43642
  }));
43633
43643
  };
43634
43644
  var Message$2 = /*#__PURE__*/React__default.memo(Message$1, function (prev, next) {
43635
- var _prev$prevMessage, _next$prevMessage, _prev$prevMessage2, _prev$prevMessage2$us, _next$prevMessage2, _next$prevMessage2$us, _prev$prevMessage3, _next$prevMessage3, _prev$nextMessage, _next$nextMessage, _prev$nextMessage2, _prev$nextMessage2$us, _next$nextMessage2, _next$nextMessage2$us, _prev$nextMessage3, _next$nextMessage3;
43645
+ var _prev$prevMessage, _next$prevMessage, _prev$prevMessage2, _prev$prevMessage2$us, _next$prevMessage2, _next$prevMessage2$us, _prev$prevMessage3, _next$prevMessage3, _prev$nextMessage, _next$nextMessage, _prev$nextMessage2, _prev$nextMessage2$us, _next$nextMessage2, _next$nextMessage2$us, _prev$nextMessage3, _next$nextMessage3, _prev$tabIsActiveRef$, _prev$tabIsActiveRef, _next$tabIsActiveRef$, _next$tabIsActiveRef;
43636
43646
  if (prev.message.id !== next.message.id) return false;
43637
43647
  if (prev.message.deliveryStatus !== next.message.deliveryStatus) return false;
43638
43648
  if (prev.message.state !== next.message.state) return false;
@@ -43660,7 +43670,7 @@ var Message$2 = /*#__PURE__*/React__default.memo(Message$1, function (prev, next
43660
43670
  if (prev.selectedMessagesMap !== next.selectedMessagesMap) return false;
43661
43671
  if (prev.contactsMap !== next.contactsMap) return false;
43662
43672
  if (prev.connectionStatus !== next.connectionStatus) return false;
43663
- if (prev.tabIsActive !== next.tabIsActive) return false;
43673
+ if (((_prev$tabIsActiveRef$ = (_prev$tabIsActiveRef = prev.tabIsActiveRef) === null || _prev$tabIsActiveRef === void 0 ? void 0 : _prev$tabIsActiveRef.current) != null ? _prev$tabIsActiveRef$ : prev.tabIsActive) !== ((_next$tabIsActiveRef$ = (_next$tabIsActiveRef = next.tabIsActiveRef) === null || _next$tabIsActiveRef === void 0 ? void 0 : _next$tabIsActiveRef.current) != null ? _next$tabIsActiveRef$ : next.tabIsActive)) return false;
43664
43674
  if (prev.ifLatestAndHasNotPreview !== next.ifLatestAndHasNotPreview) return false;
43665
43675
  var prevMenuOpen = prev.openedMessageMenuId === (prev.message.id || prev.message.tid);
43666
43676
  var nextMenuOpen = next.openedMessageMenuId === (next.message.id || next.message.tid);
@@ -43712,7 +43722,7 @@ var MessageItem = styled.div(_templateObject6$n || (_templateObject6$n = _tagged
43712
43722
 
43713
43723
  var PRELOAD_TRIGGER_PX = 5;
43714
43724
  var PRELOAD_RESET_PX = 50;
43715
- var LATEST_EDGE_GAP_PX = 5;
43725
+ var LATEST_EDGE_GAP_PX = 0;
43716
43726
  var PINNED_TO_LATEST_PX = 96;
43717
43727
  var HIGHLIGHT_DURATION_MS = 1600;
43718
43728
  var DEFAULT_UNREAD_VISIBILITY_THRESHOLD = 0.5;
@@ -43748,20 +43758,65 @@ var setScrollTop = function setScrollTop(container, top, behavior) {
43748
43758
  }
43749
43759
  container.scrollTop = top;
43750
43760
  };
43761
+ var getMaxScrollTop = function getMaxScrollTop(container) {
43762
+ return Math.max(0, container.scrollHeight - container.clientHeight);
43763
+ };
43764
+ var clampScrollTopToViewport = function clampScrollTopToViewport(container, nextScrollTop) {
43765
+ var maxScrollTop = getMaxScrollTop(container);
43766
+ var minScrollTop = Math.min(LATEST_EDGE_GAP_PX, maxScrollTop);
43767
+ var maxVisibleScrollTop = Math.max(minScrollTop, maxScrollTop - LATEST_EDGE_GAP_PX);
43768
+ return Math.min(maxVisibleScrollTop, Math.max(minScrollTop, nextScrollTop));
43769
+ };
43770
+ var getHistoryEdgeScrollTop = function getHistoryEdgeScrollTop(container) {
43771
+ return clampScrollTopToViewport(container, LATEST_EDGE_GAP_PX);
43772
+ };
43773
+ var getLatestEdgeScrollTop = function getLatestEdgeScrollTop(container) {
43774
+ return clampScrollTopToViewport(container, getMaxScrollTop(container) - LATEST_EDGE_GAP_PX);
43775
+ };
43776
+ var getWheelDelta = function getWheelDelta(event, container) {
43777
+ if (event.deltaMode === 1) {
43778
+ return event.deltaY * 16;
43779
+ }
43780
+ if (event.deltaMode === 2) {
43781
+ return event.deltaY * container.clientHeight;
43782
+ }
43783
+ return event.deltaY;
43784
+ };
43785
+ var shouldUseFirefoxWheelInterop = function shouldUseFirefoxWheelInterop() {
43786
+ return typeof window !== 'undefined' && /firefox/i.test(window.navigator.userAgent);
43787
+ };
43751
43788
  var scrollToLatestEdge = function scrollToLatestEdge(container, behavior) {
43752
43789
  if (behavior === void 0) {
43753
43790
  behavior = 'auto';
43754
43791
  }
43755
- setScrollTop(container, LATEST_EDGE_GAP_PX, behavior);
43756
- };
43757
- var getMaxScrollTop = function getMaxScrollTop(container) {
43758
- return Math.max(0, container.scrollHeight - container.clientHeight);
43792
+ setScrollTop(container, getLatestEdgeScrollTop(container), behavior);
43759
43793
  };
43760
43794
  var scrollToHistoryEdge = function scrollToHistoryEdge(container, behavior) {
43761
43795
  if (behavior === void 0) {
43762
43796
  behavior = 'auto';
43763
43797
  }
43764
- setScrollTop(container, Math.max(LATEST_EDGE_GAP_PX, getMaxScrollTop(container) - LATEST_EDGE_GAP_PX), behavior);
43798
+ setScrollTop(container, getHistoryEdgeScrollTop(container), behavior);
43799
+ };
43800
+ var getElementScrollTopInContainer = function getElementScrollTopInContainer(container, target, alignment) {
43801
+ if (alignment === void 0) {
43802
+ alignment = 'center';
43803
+ }
43804
+ var containerRect = container.getBoundingClientRect();
43805
+ var targetRect = target.getBoundingClientRect();
43806
+ var targetTop = container.scrollTop + (targetRect.top - containerRect.top);
43807
+ var nextScrollTop = alignment === 'start' ? targetTop : targetTop - (container.clientHeight - targetRect.height) / 2;
43808
+ return clampScrollTopToViewport(container, nextScrollTop);
43809
+ };
43810
+ var scrollElementInContainer = function scrollElementInContainer(container, target, options) {
43811
+ if (options === void 0) {
43812
+ options = {};
43813
+ }
43814
+ var _options = options,
43815
+ _options$behavior = _options.behavior,
43816
+ behavior = _options$behavior === void 0 ? 'auto' : _options$behavior,
43817
+ _options$alignment = _options.alignment,
43818
+ alignment = _options$alignment === void 0 ? 'center' : _options$alignment;
43819
+ setScrollTop(container, getElementScrollTopInContainer(container, target, alignment), behavior);
43765
43820
  };
43766
43821
  var scrollItemIntoView = function scrollItemIntoView(container, target, smooth, isInView, direction) {
43767
43822
  if (isInView === void 0) {
@@ -43777,19 +43832,17 @@ var scrollItemIntoView = function scrollItemIntoView(container, target, smooth,
43777
43832
  }
43778
43833
  requestAnimationFrame(function () {
43779
43834
  requestAnimationFrame(function () {
43780
- target.scrollIntoView({
43835
+ scrollElementInContainer(container, target, {
43781
43836
  behavior: 'smooth',
43782
- block: 'center',
43783
- inline: 'nearest'
43837
+ alignment: 'center'
43784
43838
  });
43785
43839
  });
43786
43840
  });
43787
43841
  return;
43788
43842
  }
43789
- target.scrollIntoView({
43843
+ scrollElementInContainer(container, target, {
43790
43844
  behavior: 'auto',
43791
- block: 'center',
43792
- inline: 'nearest'
43845
+ alignment: 'center'
43793
43846
  });
43794
43847
  };
43795
43848
  var getItemElement = function getItemElement(container, itemId) {
@@ -43848,7 +43901,7 @@ var isPinnedToLatest = function isPinnedToLatest(container) {
43848
43901
  if (!container) {
43849
43902
  return true;
43850
43903
  }
43851
- return container.scrollTop <= PINNED_TO_LATEST_PX;
43904
+ return getLatestEdgeScrollTop(container) - container.scrollTop <= PINNED_TO_LATEST_PX;
43852
43905
  };
43853
43906
  var getVisibilityRatio = function getVisibilityRatio(containerRect, targetRect) {
43854
43907
  var visibleTop = Math.max(containerRect.top, targetRect.top);
@@ -43856,15 +43909,6 @@ var getVisibilityRatio = function getVisibilityRatio(containerRect, targetRect)
43856
43909
  var visibleHeight = Math.max(0, visibleBottom - visibleTop);
43857
43910
  return targetRect.height > 0 ? visibleHeight / targetRect.height : 0;
43858
43911
  };
43859
- var getWheelDelta = function getWheelDelta(event, container) {
43860
- if (event.deltaMode === 1) {
43861
- return event.deltaY * 16;
43862
- }
43863
- if (event.deltaMode === 2) {
43864
- return event.deltaY * container.clientHeight;
43865
- }
43866
- return event.deltaY;
43867
- };
43868
43912
  var isUnreadIncomingMessage = function isUnreadIncomingMessage(message) {
43869
43913
  var _message$userMarkers;
43870
43914
  return message.incoming && !((_message$userMarkers = message.userMarkers) !== null && _message$userMarkers !== void 0 && _message$userMarkers.some(function (marker) {
@@ -43975,6 +44019,7 @@ function useChatController(_ref5) {
43975
44019
  var historyArmTimerRef = useRef(null);
43976
44020
  var latestArmTimerRef = useRef(null);
43977
44021
  var pendingEdgeCheckAfterLoadRef = useRef(false);
44022
+ var lastUnreadCheckAtRef = useRef(0);
43978
44023
  var _useState = useState(false),
43979
44024
  isLoadingPrevious = _useState[0],
43980
44025
  setIsLoadingPrevious = _useState[1];
@@ -44101,11 +44146,11 @@ function useChatController(_ref5) {
44101
44146
  return jumpLockModeRef.current === 'latest' && (isJumping.current || Date.now() < jumpLockUntilRef.current);
44102
44147
  }, []);
44103
44148
  var captureWindowPreserveAnchor = useCallback(function () {
44104
- var _restoreRef$current, _restoreRef$current2;
44105
- if (isLatestJumpLocked()) {
44149
+ var _restoreRef$current, _restoreRef$current2, _restoreRef$current3;
44150
+ if (isJumping.current || jumpLockModeRef.current !== null && Date.now() < jumpLockUntilRef.current) {
44106
44151
  return;
44107
44152
  }
44108
- if (((_restoreRef$current = restoreRef.current) === null || _restoreRef$current === void 0 ? void 0 : _restoreRef$current.mode) === 'to-bottom' || ((_restoreRef$current2 = restoreRef.current) === null || _restoreRef$current2 === void 0 ? void 0 : _restoreRef$current2.mode) === 'to-bottom-smooth') {
44153
+ if (((_restoreRef$current = restoreRef.current) === null || _restoreRef$current === void 0 ? void 0 : _restoreRef$current.mode) === 'to-bottom' || ((_restoreRef$current2 = restoreRef.current) === null || _restoreRef$current2 === void 0 ? void 0 : _restoreRef$current2.mode) === 'to-bottom-smooth' || ((_restoreRef$current3 = restoreRef.current) === null || _restoreRef$current3 === void 0 ? void 0 : _restoreRef$current3.mode) === 'reveal-message') {
44109
44154
  return;
44110
44155
  }
44111
44156
  var container = scrollRef.current;
@@ -44122,7 +44167,7 @@ function useChatController(_ref5) {
44122
44167
  offsetFromTop: anchor.offsetFromTop,
44123
44168
  sourceScrollTop: container.scrollTop
44124
44169
  };
44125
- }, [isLatestJumpLocked]);
44170
+ }, []);
44126
44171
  var syncLatestState = useCallback(function () {
44127
44172
  var nextIsViewingLatest = !hasNext && isPinnedToLatest(scrollRef.current);
44128
44173
  viewIsAtLatestRef.current = nextIsViewingLatest;
@@ -44297,8 +44342,8 @@ function useChatController(_ref5) {
44297
44342
  return !direction || activeRequest.direction === direction;
44298
44343
  }, []);
44299
44344
  var clearPreserveAnchorForRequest = useCallback(function (requestId) {
44300
- var _restoreRef$current3;
44301
- if (((_restoreRef$current3 = restoreRef.current) === null || _restoreRef$current3 === void 0 ? void 0 : _restoreRef$current3.mode) !== 'preserve-anchor') {
44345
+ var _restoreRef$current4;
44346
+ if (((_restoreRef$current4 = restoreRef.current) === null || _restoreRef$current4 === void 0 ? void 0 : _restoreRef$current4.mode) !== 'preserve-anchor') {
44302
44347
  return;
44303
44348
  }
44304
44349
  if (requestId && restoreRef.current.requestId !== requestId) {
@@ -44457,7 +44502,6 @@ function useChatController(_ref5) {
44457
44502
  try {
44458
44503
  var _channelRef$current, _pendingLatestJumpRef, _pendingLatestJumpRef2, _channelRef$current2, _channelRef$current2$;
44459
44504
  clearScrollIdleTimer();
44460
- isJumping.current = true;
44461
44505
  lockJumpScrolling(smooth, 'latest');
44462
44506
  invalidateEdgeDirection('previous');
44463
44507
  invalidateEdgeDirection('next');
@@ -44523,12 +44567,16 @@ function useChatController(_ref5) {
44523
44567
  cancelAnimationFrame(jumpToLatestFrameRef.current);
44524
44568
  }
44525
44569
  jumpToLatestFrameRef.current = requestAnimationFrame(function () {
44570
+ var _restoreRef$current5, _restoreRef$current6;
44526
44571
  jumpToLatestFrameRef.current = null;
44527
44572
  var renderedContainer = scrollRef.current;
44528
44573
  if (!renderedContainer) {
44529
44574
  return;
44530
44575
  }
44531
- scrollToLatestEdge(renderedContainer, smooth ? 'smooth' : 'auto');
44576
+ if (((_restoreRef$current5 = restoreRef.current) === null || _restoreRef$current5 === void 0 ? void 0 : _restoreRef$current5.mode) === 'to-bottom' || ((_restoreRef$current6 = restoreRef.current) === null || _restoreRef$current6 === void 0 ? void 0 : _restoreRef$current6.mode) === 'to-bottom-smooth') {
44577
+ restoreRef.current = null;
44578
+ scrollToLatestEdge(renderedContainer, smooth ? 'smooth' : 'auto');
44579
+ }
44532
44580
  });
44533
44581
  });
44534
44582
  } catch (e) {
@@ -44557,9 +44605,12 @@ function useChatController(_ref5) {
44557
44605
  });
44558
44606
  setTimeout(function () {
44559
44607
  try {
44608
+ clearScrollIdleTimer();
44560
44609
  clearPendingLatestJump();
44561
44610
  var jumpId = ++currentJumpIdRef.current;
44562
- isJumping.current = true;
44611
+ if (!isLoaded) {
44612
+ isJumping.current = true;
44613
+ }
44563
44614
  invalidateEdgeDirection('previous');
44564
44615
  invalidateEdgeDirection('next');
44565
44616
  restoreRef.current = {
@@ -44919,26 +44970,32 @@ function useChatController(_ref5) {
44919
44970
  }
44920
44971
  }, [channel.id, clearPreserveAnchorForRequest, consumeSuppressedMessageChange, createEdgeRequestId, clearPendingLatestJump, dispatch, suppressNextMessageChange, hasNext, hasPrevious, isActiveEdgeRequestCurrent, isLoadingNext, loadNext, messages, requestDirectionalPrefetchIfNeeded]);
44921
44972
  var handleTimelineScroll = useCallback(function () {
44922
- var _restoreRef$current4, _restoreRef$current5;
44973
+ var _restoreRef$current7, _restoreRef$current8;
44923
44974
  var container = scrollRef.current;
44924
44975
  if (!container) {
44925
44976
  return;
44926
44977
  }
44978
+ var historyEdgeScrollTop = getHistoryEdgeScrollTop(container);
44979
+ var latestEdgeScrollTop = getLatestEdgeScrollTop(container);
44980
+ var currentScrollTop = container.scrollTop;
44927
44981
  lastScrollActivityAtRef.current = Date.now();
44928
44982
  if (isJumping.current) {
44929
44983
  return;
44930
44984
  }
44985
+ if (currentScrollTop <= historyEdgeScrollTop + PRELOAD_TRIGGER_PX) {
44986
+ currentScrollTop = historyEdgeScrollTop;
44987
+ } else if (currentScrollTop >= latestEdgeScrollTop - PRELOAD_TRIGGER_PX) {
44988
+ currentScrollTop = latestEdgeScrollTop;
44989
+ }
44990
+ var distanceFromLatest = latestEdgeScrollTop - currentScrollTop;
44931
44991
  if (Date.now() < jumpLockUntilRef.current) {
44932
- if (jumpLockModeRef.current === 'latest' && container.scrollTop > PRELOAD_RESET_PX) {
44992
+ if (jumpLockModeRef.current === 'latest' && distanceFromLatest > PRELOAD_RESET_PX) {
44933
44993
  clearJumpScrollingLock();
44934
44994
  } else {
44935
44995
  return;
44936
44996
  }
44937
44997
  }
44938
- if (container.scrollTop < LATEST_EDGE_GAP_PX) {
44939
- setScrollTop(container, LATEST_EDGE_GAP_PX);
44940
- }
44941
- var pendingRestore = ((_restoreRef$current4 = restoreRef.current) === null || _restoreRef$current4 === void 0 ? void 0 : _restoreRef$current4.mode) === 'preserve-anchor' || ((_restoreRef$current5 = restoreRef.current) === null || _restoreRef$current5 === void 0 ? void 0 : _restoreRef$current5.mode) === 'preserve-anchor-window' ? restoreRef.current : null;
44998
+ var pendingRestore = ((_restoreRef$current7 = restoreRef.current) === null || _restoreRef$current7 === void 0 ? void 0 : _restoreRef$current7.mode) === 'preserve-anchor' || ((_restoreRef$current8 = restoreRef.current) === null || _restoreRef$current8 === void 0 ? void 0 : _restoreRef$current8.mode) === 'preserve-anchor-window' ? restoreRef.current : null;
44942
44999
  if (pendingRestore && Math.abs(container.scrollTop - pendingRestore.sourceScrollTop) > PRESERVE_ANCHOR_SCROLL_EPSILON_PX && (pendingRestore.mode === 'preserve-anchor-window' || pendingRestore.mode === 'preserve-anchor' && isActiveEdgeRequestCurrent(pendingRestore.requestId))) {
44943
45000
  var currentAnchor = getTopViewportAnchor(container, itemElementsRef.current);
44944
45001
  restoreRef.current = currentAnchor ? pendingRestore.mode === 'preserve-anchor-window' ? {
@@ -44956,15 +45013,14 @@ function useChatController(_ref5) {
44956
45013
  } : null;
44957
45014
  }
44958
45015
  syncLatestState();
44959
- queueVisibleUnreadCheck();
44960
- var maxScrollTop = getMaxScrollTop(container);
44961
- if (container.scrollTop > maxScrollTop - LATEST_EDGE_GAP_PX) {
44962
- setScrollTop(container, maxScrollTop - LATEST_EDGE_GAP_PX);
44963
- }
44964
- var distanceFromHistory = maxScrollTop - container.scrollTop;
44965
- var historyTriggered = distanceFromHistory <= PRELOAD_TRIGGER_PX && hasPrevious;
44966
- var latestTriggered = container.scrollTop <= PRELOAD_TRIGGER_PX + LATEST_EDGE_GAP_PX && hasNext;
44967
- if (distanceFromHistory > PRELOAD_RESET_PX) {
45016
+ var now = Date.now();
45017
+ if (now - lastUnreadCheckAtRef.current >= 100) {
45018
+ lastUnreadCheckAtRef.current = now;
45019
+ queueVisibleUnreadCheck();
45020
+ }
45021
+ var historyTriggered = currentScrollTop <= historyEdgeScrollTop + PRELOAD_TRIGGER_PX && hasPrevious;
45022
+ var latestTriggered = distanceFromLatest <= PRELOAD_TRIGGER_PX && hasNext;
45023
+ if (currentScrollTop > historyEdgeScrollTop + PRELOAD_RESET_PX) {
44968
45024
  if (historyArmTimerRef.current === null) {
44969
45025
  historyArmTimerRef.current = setTimeout(function () {
44970
45026
  historyArmTimerRef.current = null;
@@ -44973,7 +45029,7 @@ function useChatController(_ref5) {
44973
45029
  }
44974
45030
  invalidateEdgeDirection('previous');
44975
45031
  }
44976
- if (container.scrollTop > PRELOAD_RESET_PX) {
45032
+ if (distanceFromLatest > PRELOAD_RESET_PX) {
44977
45033
  if (latestArmTimerRef.current === null) {
44978
45034
  latestArmTimerRef.current = setTimeout(function () {
44979
45035
  latestArmTimerRef.current = null;
@@ -45046,39 +45102,45 @@ function useChatController(_ref5) {
45046
45102
  handleScrollRef.current = handleTimelineScroll;
45047
45103
  useEffect(function () {
45048
45104
  var el = scrollRef.current;
45049
- if (!el) {
45105
+ if (!el || !messages || !messages.length) {
45050
45106
  return;
45051
45107
  }
45052
45108
  var onScroll = function onScroll() {
45053
- return handleScrollRef.current();
45109
+ handleScrollRef.current();
45054
45110
  };
45055
45111
  el.addEventListener('scroll', onScroll, {
45056
45112
  passive: true
45057
45113
  });
45058
45114
  return function () {
45059
- return el.removeEventListener('scroll', onScroll);
45115
+ el.removeEventListener('scroll', onScroll);
45060
45116
  };
45061
- }, [channel === null || channel === void 0 ? void 0 : channel.id]);
45117
+ }, [channel === null || channel === void 0 ? void 0 : channel.id, messages]);
45062
45118
  useEffect(function () {
45063
45119
  var el = scrollRef.current;
45064
- if (!el) {
45120
+ if (!el || !shouldUseFirefoxWheelInterop() || !messages.length) {
45065
45121
  return;
45066
45122
  }
45067
45123
  var onWheel = function onWheel(event) {
45124
+ if (event.ctrlKey) {
45125
+ return;
45126
+ }
45068
45127
  event.preventDefault();
45069
45128
  if (isJumping.current || jumpLockModeRef.current === 'item' && Date.now() < jumpLockUntilRef.current) {
45070
45129
  return;
45071
45130
  }
45072
- el.scrollTop -= getWheelDelta(event, el);
45131
+ var nextScrollTop = clampScrollTopToViewport(el, el.scrollTop + getWheelDelta(event, el));
45132
+ if (nextScrollTop !== el.scrollTop) {
45133
+ setScrollTop(el, nextScrollTop, 'auto');
45134
+ }
45073
45135
  handleScrollRef.current();
45074
45136
  };
45075
45137
  el.addEventListener('wheel', onWheel, {
45076
45138
  passive: false
45077
45139
  });
45078
45140
  return function () {
45079
- return el.removeEventListener('wheel', onWheel);
45141
+ el.removeEventListener('wheel', onWheel);
45080
45142
  };
45081
- }, [channel === null || channel === void 0 ? void 0 : channel.id]);
45143
+ }, [channel === null || channel === void 0 ? void 0 : channel.id, messages]);
45082
45144
  useEffect(function () {
45083
45145
  var _pendingWindowLoadRef, _pendingEdgeLoadRefs$, _pendingEdgeLoadRefs$2;
45084
45146
  if (activeChannelIdRef.current === null) {
@@ -45140,6 +45202,7 @@ function useChatController(_ref5) {
45140
45202
  itemElementsRef.current.clear();
45141
45203
  previousMessagesRef.current = [];
45142
45204
  suppressedMessageChangesRef.current = 0;
45205
+ lastScrollActivityAtRef.current = 0;
45143
45206
  pendingLatestJumpRef.current = null;
45144
45207
  pendingEdgeCheckAfterLoadRef.current = false;
45145
45208
  (_pendingWindowLoadRef = pendingWindowLoadRef.current) === null || _pendingWindowLoadRef === void 0 ? void 0 : _pendingWindowLoadRef.resolve({
@@ -45202,12 +45265,12 @@ function useChatController(_ref5) {
45202
45265
  }
45203
45266
  }
45204
45267
  useLayoutEffect(function () {
45205
- var _restoreRef$current6;
45268
+ var _restoreRef$current9;
45206
45269
  var container = scrollRef.current;
45207
45270
  if (!container || !messages.length) {
45208
45271
  return;
45209
45272
  }
45210
- if (((_restoreRef$current6 = restoreRef.current) === null || _restoreRef$current6 === void 0 ? void 0 : _restoreRef$current6.mode) === 'restore-scroll-top') {
45273
+ if (((_restoreRef$current9 = restoreRef.current) === null || _restoreRef$current9 === void 0 ? void 0 : _restoreRef$current9.mode) === 'restore-scroll-top') {
45211
45274
  var savedScrollTop = restoreRef.current.scrollTop;
45212
45275
  if (!lastBootKeyRef.current) {
45213
45276
  lastBootKeyRef.current = channel.id + ":" + getMessageLocalRef(messages[0]);
@@ -45221,9 +45284,10 @@ function useChatController(_ref5) {
45221
45284
  }
45222
45285
  if (!lastBootKeyRef.current) {
45223
45286
  lastBootKeyRef.current = channel.id + ":" + getMessageLocalRef(messages[0]);
45287
+ var preservePendingHistoryEdge = pendingEdgeCheckAfterLoadRef.current && activeEdgeIntentRef.current === 'previous';
45224
45288
  restoreRef.current = unreadScrollTo && unreadMessageId ? {
45225
45289
  mode: 'reveal-unread-separator'
45226
- } : isScrollInteractionActive() ? null : {
45290
+ } : preservePendingHistoryEdge ? null : isScrollInteractionActive() ? null : {
45227
45291
  mode: 'to-bottom'
45228
45292
  };
45229
45293
  }
@@ -45266,10 +45330,9 @@ function useChatController(_ref5) {
45266
45330
  unreadRestoreCompletedRef.current = true;
45267
45331
  viewIsAtLatestRef.current = false;
45268
45332
  setIsViewingLatest(false);
45269
- unreadDivider.scrollIntoView({
45333
+ scrollElementInContainer(container, unreadDivider, {
45270
45334
  behavior: 'auto',
45271
- block: 'center',
45272
- inline: 'nearest'
45335
+ alignment: 'center'
45273
45336
  });
45274
45337
  } else {
45275
45338
  return;
@@ -45291,6 +45354,13 @@ function useChatController(_ref5) {
45291
45354
  return;
45292
45355
  }
45293
45356
  if (restoreState.mode === 'preserve-anchor-window') {
45357
+ if (!hasNextMessages && getLatestEdgeScrollTop(container) - container.scrollTop <= PRELOAD_TRIGGER_PX) {
45358
+ restoreRef.current = null;
45359
+ viewIsAtLatestRef.current = true;
45360
+ setIsViewingLatest(true);
45361
+ scrollToLatestEdge(container, 'auto');
45362
+ return;
45363
+ }
45294
45364
  var anchorElement = getItemElement(container, restoreState.itemId);
45295
45365
  if (!anchorElement) {
45296
45366
  return;
@@ -45300,7 +45370,7 @@ function useChatController(_ref5) {
45300
45370
  var offsetDelta = anchorRect.top - containerRect.top - restoreState.offsetFromTop;
45301
45371
  restoreRef.current = null;
45302
45372
  if (offsetDelta !== 0) {
45303
- setScrollTop(container, Math.max(LATEST_EDGE_GAP_PX, container.scrollTop - offsetDelta), 'auto');
45373
+ setScrollTop(container, clampScrollTopToViewport(container, container.scrollTop + offsetDelta), 'auto');
45304
45374
  }
45305
45375
  return;
45306
45376
  }
@@ -45332,7 +45402,7 @@ function useChatController(_ref5) {
45332
45402
  cachedEdgeRequestRef.current = null;
45333
45403
  }
45334
45404
  if (_offsetDelta !== 0) {
45335
- var nextScrollTop = Math.max(LATEST_EDGE_GAP_PX, container.scrollTop - _offsetDelta);
45405
+ var nextScrollTop = clampScrollTopToViewport(container, container.scrollTop + _offsetDelta);
45336
45406
  setScrollTop(container, nextScrollTop, 'auto');
45337
45407
  }
45338
45408
  }
@@ -45353,10 +45423,9 @@ function useChatController(_ref5) {
45353
45423
  restoreRef.current = null;
45354
45424
  viewIsAtLatestRef.current = false;
45355
45425
  setIsViewingLatest(false);
45356
- unreadDivider.scrollIntoView({
45426
+ scrollElementInContainer(container, unreadDivider, {
45357
45427
  behavior: 'auto',
45358
- block: 'center',
45359
- inline: 'nearest'
45428
+ alignment: 'center'
45360
45429
  });
45361
45430
  }, [messages, unreadMessageId, unreadScrollTo]);
45362
45431
  useEffect(function () {
@@ -45561,9 +45630,8 @@ function useChatController(_ref5) {
45561
45630
  }) : false;
45562
45631
  var reconnectContainer = scrollRef.current;
45563
45632
  if (reconnectContainer) {
45564
- var maxTop = getMaxScrollTop(reconnectContainer);
45565
- var atHistoryEdge = maxTop - reconnectContainer.scrollTop <= PRELOAD_TRIGGER_PX;
45566
- var atLatestEdge = reconnectContainer.scrollTop <= PRELOAD_TRIGGER_PX + LATEST_EDGE_GAP_PX;
45633
+ var atHistoryEdge = reconnectContainer.scrollTop <= getHistoryEdgeScrollTop(reconnectContainer) + PRELOAD_TRIGGER_PX;
45634
+ var atLatestEdge = getLatestEdgeScrollTop(reconnectContainer) - reconnectContainer.scrollTop <= PRELOAD_TRIGGER_PX;
45567
45635
  if (atHistoryEdge || atLatestEdge) {
45568
45636
  pendingEdgeCheckAfterLoadRef.current = true;
45569
45637
  }
@@ -46081,12 +46149,9 @@ var MessageList = function MessageList(_ref) {
46081
46149
  var _useState3 = useState(false),
46082
46150
  stopScrolling = _useState3[0],
46083
46151
  setStopScrolling = _useState3[1];
46084
- var _useState4 = useState(false),
46085
- isScrolling = _useState4[0],
46086
- setIsScrolling = _useState4[1];
46087
- var _useState5 = useState(''),
46088
- stickyDate = _useState5[0],
46089
- setStickyDate = _useState5[1];
46152
+ var _useState4 = useState(''),
46153
+ stickyDate = _useState4[0],
46154
+ setStickyDate = _useState4[1];
46090
46155
  var markerBatcherRef = React__default.useRef(null);
46091
46156
  if (!markerBatcherRef.current) {
46092
46157
  markerBatcherRef.current = createMessageMarkerBatcher({
@@ -46125,6 +46190,17 @@ var MessageList = function MessageList(_ref) {
46125
46190
  isJumpingToItem = _useChatController.isJumpingToItem,
46126
46191
  jumpToLatest = _useChatController.jumpToLatest,
46127
46192
  jumpToItem = _useChatController.jumpToItem;
46193
+ var handleScrollToRepliedMessageRef = React__default.useRef(handleScrollToRepliedMessage);
46194
+ useEffect(function () {
46195
+ handleScrollToRepliedMessageRef.current = handleScrollToRepliedMessage;
46196
+ }, [handleScrollToRepliedMessage]);
46197
+ var stableHandleScrollToRepliedMessage = useCallback(function (messageId) {
46198
+ handleScrollToRepliedMessageRef.current(messageId);
46199
+ }, []);
46200
+ var tabIsActiveRef = React__default.useRef(browserTabIsActive);
46201
+ useEffect(function () {
46202
+ tabIsActiveRef.current = browserTabIsActive;
46203
+ }, [browserTabIsActive]);
46128
46204
  var queueReadMarker = useCallback(function (channelId, messageId) {
46129
46205
  var _markerBatcherRef$cur;
46130
46206
  (_markerBatcherRef$cur = markerBatcherRef.current) === null || _markerBatcherRef$cur === void 0 ? void 0 : _markerBatcherRef$cur.enqueueRead(channelId, messageId);
@@ -46219,7 +46295,7 @@ var MessageList = function MessageList(_ref) {
46219
46295
  var remainingMentionIds = mentionIds.filter(function (mentionId) {
46220
46296
  return mentionId !== nextUnreadMentionId;
46221
46297
  });
46222
- handleScrollToRepliedMessage(nextUnreadMentionId);
46298
+ stableHandleScrollToRepliedMessage(nextUnreadMentionId);
46223
46299
  dispatch(markMessagesAsReadAC(channel.id, [nextUnreadMentionId]));
46224
46300
  dispatch(updateChannelDataAC(channel.id, {
46225
46301
  mentionsIds: remainingMentionIds
@@ -46227,7 +46303,7 @@ var MessageList = function MessageList(_ref) {
46227
46303
  if (channel.newMentionCount >= 3 && remainingMentionIds.length < 3) {
46228
46304
  dispatch(getChannelMentionsAC(channel.id));
46229
46305
  }
46230
- }, [channel === null || channel === void 0 ? void 0 : channel.id, channel.newMentionCount, dispatch, handleScrollToRepliedMessage, isMessageRead]);
46306
+ }, [channel === null || channel === void 0 ? void 0 : channel.id, channel.newMentionCount, dispatch, isMessageRead, stableHandleScrollToRepliedMessage]);
46231
46307
  useEffect(function () {
46232
46308
  registerMessageListNavigator(jumpToItem);
46233
46309
  return function () {
@@ -46385,7 +46461,7 @@ var MessageList = function MessageList(_ref) {
46385
46461
  channel: channel,
46386
46462
  stopScrolling: setStopScrolling,
46387
46463
  handleMediaItemClick: handleMediaItemClickStable,
46388
- handleScrollToRepliedMessage: handleScrollToRepliedMessage,
46464
+ handleScrollToRepliedMessage: stableHandleScrollToRepliedMessage,
46389
46465
  prevMessage: prevMessage,
46390
46466
  nextMessage: nextMessage,
46391
46467
  isUnreadMessage: isUnreadMessage,
@@ -46502,7 +46578,7 @@ var MessageList = function MessageList(_ref) {
46502
46578
  contactsMap: contactsMap,
46503
46579
  connectionStatus: connectionStatus,
46504
46580
  openedMessageMenuId: openedMessageMenuId,
46505
- tabIsActive: browserTabIsActive,
46581
+ tabIsActiveRef: tabIsActiveRef,
46506
46582
  messageTextFontSize: messageTextFontSize,
46507
46583
  messageTextLineHeight: messageTextLineHeight,
46508
46584
  messageStatusSize: messageStatusSize,
@@ -46558,15 +46634,9 @@ var MessageList = function MessageList(_ref) {
46558
46634
  "$color": iconInactive
46559
46635
  }))), /*#__PURE__*/React__default.createElement(Container$j, {
46560
46636
  id: 'scrollableDiv',
46561
- className: isScrolling ? 'show-scrollbar' : '',
46637
+ className: 'show-scrollbar',
46562
46638
  ref: scrollRef,
46563
46639
  stopScrolling: stopScrolling,
46564
- onMouseEnter: function onMouseEnter() {
46565
- return setIsScrolling(true);
46566
- },
46567
- onMouseLeave: function onMouseLeave() {
46568
- return setIsScrolling(false);
46569
- },
46570
46640
  onDragEnter: handleDragIn,
46571
46641
  backgroundColor: backgroundColor || themeBackgroundColor,
46572
46642
  thumbColor: surface2
@@ -46663,10 +46733,12 @@ var MessageList = function MessageList(_ref) {
46663
46733
  }
46664
46734
  })));
46665
46735
  };
46666
- var Container$j = styled.div(_templateObject$P || (_templateObject$P = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n transform: scaleY(-1);\n background-color: ", ";\n overflow-y: overlay;\n overflow-x: hidden;\n overscroll-behavior-y: contain;\n margin-top: auto;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
46736
+ var Container$j = styled.div(_templateObject$P || (_templateObject$P = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n background-color: ", ";\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n"])), function (props) {
46667
46737
  return props.backgroundColor;
46668
46738
  }, function (props) {
46669
46739
  return props.thumbColor;
46740
+ }, function (props) {
46741
+ return props.thumbColor;
46670
46742
  });
46671
46743
  var JumpOverlay = styled.div(_templateObject2$K || (_templateObject2$K = _taggedTemplateLiteralLoose(["\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 10;\n"])));
46672
46744
  var JumpSpinner = styled.div(_templateObject3$C || (_templateObject3$C = _taggedTemplateLiteralLoose(["\n width: ", "px;\n height: ", "px;\n border: 2.5px solid transparent;\n border-top-color: ", ";\n border-radius: 50%;\n animation: spin 0.7s linear infinite;\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n"])), function (props) {
@@ -46676,7 +46748,7 @@ var JumpSpinner = styled.div(_templateObject3$C || (_templateObject3$C = _tagged
46676
46748
  }, function (props) {
46677
46749
  return props.$color || '#9EA6B0';
46678
46750
  });
46679
- var MessagesBox = styled.div(_templateObject4$x || (_templateObject4$x = _taggedTemplateLiteralLoose(["\n display: flex;\n padding-top: 5px;\n flex-direction: column;\n padding-bottom: 6px;\n width: 100%;\n transform: scaleY(-1);\n backface-visibility: hidden;\n filter: ", ";\n transition: filter 0.2s ease;\n"])), function (props) {
46751
+ var MessagesBox = styled.div(_templateObject4$x || (_templateObject4$x = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-top: auto;\n flex-shrink: 0;\n filter: ", ";\n transition: filter 0.2s ease;\n"])), function (props) {
46680
46752
  return props.$isJumping ? 'blur(4px)' : 'none';
46681
46753
  });
46682
46754
  var ScrollViewport = styled.div(_templateObject5$s || (_templateObject5$s = _taggedTemplateLiteralLoose(["\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n"])));
@@ -46717,7 +46789,7 @@ var DropAttachmentArea = styled.div(_templateObject9$h || (_templateObject9$h =
46717
46789
  var MessageWrapper = styled.div(_templateObject0$g || (_templateObject0$g = _taggedTemplateLiteralLoose(["\n &.highlight {\n & .message_item {\n background-color: ", ";\n }\n }\n"])), function (props) {
46718
46790
  return props.highlightBg || '#d5d5d5';
46719
46791
  });
46720
- var NoMessagesContainer = styled.div(_templateObject1$e || (_templateObject1$e = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n height: 100%;\n width: 100%;\n transform: scaleY(-1);\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n color: ", ";\n"])), function (props) {
46792
+ var NoMessagesContainer = styled.div(_templateObject1$e || (_templateObject1$e = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n height: 100%;\n width: 100%;\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n color: ", ";\n"])), function (props) {
46721
46793
  return props.color;
46722
46794
  });
46723
46795
  var NoMessagesTitle = styled.h4(_templateObject10$b || (_templateObject10$b = _taggedTemplateLiteralLoose(["\n margin: 12px 0 8px;\n font-family: Inter, sans-serif;\n text-align: center;\n font-size: 20px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n color: ", ";\n"])), function (props) {
@@ -50122,7 +50194,9 @@ var CustomTextArea = styled.textarea(_templateObject2$Q || (_templateObject2$Q =
50122
50194
  var TextCounter = styled.span(_templateObject3$H || (_templateObject3$H = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 20px;\n margin-left: auto;\n"])), function (props) {
50123
50195
  return props.color;
50124
50196
  });
50125
- var OptionsList$1 = styled.div(_templateObject4$B || (_templateObject4$B = _taggedTemplateLiteralLoose(["\n max-height: 200px;\n overflow-y: auto;\n margin-top: 8px;\n padding-right: 6px;\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
50197
+ var OptionsList$1 = styled.div(_templateObject4$B || (_templateObject4$B = _taggedTemplateLiteralLoose(["\n max-height: 200px;\n overflow-y: auto;\n margin-top: 8px;\n padding-right: 6px;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n"])), function (props) {
50198
+ return props.thumbColor;
50199
+ }, function (props) {
50126
50200
  return props.thumbColor;
50127
50201
  });
50128
50202
  var OptionRow = styled.div(_templateObject5$w || (_templateObject5$w = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 8px;\n cursor: grab;\n border: ", ";\n border-radius: 6px;\n padding: 4px;\n opacity: ", ";\n"])), function (props) {
@@ -52169,7 +52243,7 @@ var MessageInputWrapper = styled.div(_templateObject12$6 || (_templateObject12$6
52169
52243
  }, function (props) {
52170
52244
  return props.borderRadius || '18px';
52171
52245
  });
52172
- var LexicalWrapper = styled.div(_templateObject13$5 || (_templateObject13$5 = _taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n\n & .rich_text_editor {\n width: 100%;\n max-height: 80px;\n min-height: 20px;\n display: block;\n border: none;\n box-sizing: border-box;\n outline: none !important;\n border-radius: ", ";\n background-color: ", ";\n padding: ", ";\n color: ", ";\n order: ", ";\n overflow-y: auto;\n overflow-x: hidden;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n & p {\n font-size: 15px;\n line-height: 20px;\n color: ", ";\n }\n\n &::selection {\n background-color: ", ";\n }\n\n & *::selection {\n background-color: ", ";\n }\n\n & span::selection {\n background-color: ", ";\n }\n\n &:empty:before {\n content: attr(data-placeholder);\n }\n\n & .content_editable_input {\n border: none !important;\n outline: none !important;\n }\n\n & .mention {\n color: ", ";\n background-color: inherit !important;\n user-modify: read-only;\n }\n\n & span.bold {\n font-weight: bold;\n }\n\n & .editor_paragraph {\n margin: 0;\n }\n\n & .text_bold {\n font-weight: 600;\n }\n\n & .text_italic {\n font-style: italic;\n }\n\n & .text_underline {\n text-decoration: underline;\n }\n\n & .text_strikethrough {\n text-decoration: line-through;\n }\n\n & .text_underlineStrikethrough {\n text-decoration: underline line-through;\n }\n\n & code {\n font-family: inherit;\n letter-spacing: 4px;\n }\n }\n"])), function (props) {
52246
+ var LexicalWrapper = styled.div(_templateObject13$5 || (_templateObject13$5 = _taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n\n & .rich_text_editor {\n width: 100%;\n max-height: 80px;\n min-height: 20px;\n display: block;\n border: none;\n box-sizing: border-box;\n outline: none !important;\n border-radius: ", ";\n background-color: ", ";\n padding: ", ";\n color: ", ";\n order: ", ";\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n\n & p {\n font-size: 15px;\n line-height: 20px;\n color: ", ";\n }\n\n &::selection {\n background-color: ", ";\n }\n\n & *::selection {\n background-color: ", ";\n }\n\n & span::selection {\n background-color: ", ";\n }\n\n &:empty:before {\n content: attr(data-placeholder);\n }\n\n & .content_editable_input {\n border: none !important;\n outline: none !important;\n }\n\n & .mention {\n color: ", ";\n background-color: inherit !important;\n user-modify: read-only;\n }\n\n & span.bold {\n font-weight: bold;\n }\n\n & .editor_paragraph {\n margin: 0;\n }\n\n & .text_bold {\n font-weight: 600;\n }\n\n & .text_italic {\n font-style: italic;\n }\n\n & .text_underline {\n text-decoration: underline;\n }\n\n & .text_strikethrough {\n text-decoration: line-through;\n }\n\n & .text_underlineStrikethrough {\n text-decoration: underline line-through;\n }\n\n & code {\n font-family: inherit;\n letter-spacing: 4px;\n }\n }\n"])), function (props) {
52173
52247
  return props.borderRadius;
52174
52248
  }, function (props) {
52175
52249
  return props.backgroundColor;
@@ -52181,6 +52255,8 @@ var LexicalWrapper = styled.div(_templateObject13$5 || (_templateObject13$5 = _t
52181
52255
  return props.order === 0 || props.order ? props.order : 1;
52182
52256
  }, function (props) {
52183
52257
  return props.thumbColor;
52258
+ }, function (props) {
52259
+ return props.thumbColor;
52184
52260
  }, function (props) {
52185
52261
  return props.color;
52186
52262
  }, function (props) {
@@ -53016,7 +53092,9 @@ var GroupsInCommonPopup = function GroupsInCommonPopup(_ref2) {
53016
53092
  color: textSecondary
53017
53093
  }, "Loading more...")))));
53018
53094
  };
53019
- var ChannelsList$1 = styled.div(_templateObject$Z || (_templateObject$Z = _taggedTemplateLiteralLoose(["\n max-height: 400px;\n overflow-y: auto;\n overflow-x: hidden;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
53095
+ var ChannelsList$1 = styled.div(_templateObject$Z || (_templateObject$Z = _taggedTemplateLiteralLoose(["\n max-height: 400px;\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n"])), function (props) {
53096
+ return props.thumbColor;
53097
+ }, function (props) {
53020
53098
  return props.thumbColor;
53021
53099
  });
53022
53100
  var ChannelItem$1 = styled.div(_templateObject2$U || (_templateObject2$U = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n padding: 6px 2px 6px 6px;\n border-radius: 8px;\n cursor: pointer;\n transition: background-color 0.2s;\n\n &:hover {\n background-color: ", ";\n }\n"])), function (props) {
@@ -56361,7 +56439,7 @@ var Container$v = styled.div(_templateObject$1a || (_templateObject$1a = _tagged
56361
56439
  var ChannelDetailsHeader = styled.div(_templateObject2$15 || (_templateObject2$15 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n padding: 16px;\n position: relative;\n height: 64px;\n box-sizing: border-box;\n border-bottom: 1px solid ", ";\n\n & svg {\n cursor: pointer;\n }\n"])), function (props) {
56362
56440
  return props.borderColor;
56363
56441
  });
56364
- var ChatDetails = styled.div(_templateObject3$X || (_templateObject3$X = _taggedTemplateLiteralLoose(["\n //position: relative;\n width: ", ";\n //height: ", ";\n height: ", ";\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
56442
+ var ChatDetails = styled.div(_templateObject3$X || (_templateObject3$X = _taggedTemplateLiteralLoose(["\n //position: relative;\n width: ", ";\n //height: ", ";\n height: ", ";\n overflow-y: auto;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n"])), function (props) {
56365
56443
  return props.size === 'small' ? '300px' : props.size === 'medium' ? '350px' : '400px';
56366
56444
  }, function (props) {
56367
56445
  return props.height ? "calc(100vh - " + props.heightOffset + "px)" : '100vh';
@@ -56369,6 +56447,8 @@ var ChatDetails = styled.div(_templateObject3$X || (_templateObject3$X = _tagged
56369
56447
  return props.height && props.height - (props.heightOffset ? props.heightOffset + 2 : 0) + "px";
56370
56448
  }, function (props) {
56371
56449
  return props.thumbColor;
56450
+ }, function (props) {
56451
+ return props.thumbColor;
56372
56452
  });
56373
56453
  var AboutChannel = styled.div(_templateObject4$N || (_templateObject4$N = _taggedTemplateLiteralLoose(["\n margin-top: 20px;\n"])));
56374
56454
  var AboutChannelTitle = styled.h4(_templateObject5$H || (_templateObject5$H = _taggedTemplateLiteralLoose(["\n font-size: 12px;\n margin: 0;\n line-height: 16px;\n color: ", ";\n"])), function (props) {