sceyt-chat-react-uikit 1.8.5-beta.10 → 1.8.5-beta.12

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.
Files changed (3) hide show
  1. package/index.js +1290 -1054
  2. package/index.modern.js +1292 -1056
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -21167,40 +21167,41 @@ var _marked$3 = /*#__PURE__*/_regenerator().m(setMessageListLoading),
21167
21167
  _marked17$1 = /*#__PURE__*/_regenerator().m(loadAroundMessageFromServer),
21168
21168
  _marked18$1 = /*#__PURE__*/_regenerator().m(backgroundRefreshRestoreWindow),
21169
21169
  _marked19$1 = /*#__PURE__*/_regenerator().m(loadAroundMessageWorker),
21170
- _marked20$1 = /*#__PURE__*/_regenerator().m(loadAroundMessage),
21171
- _marked21$1 = /*#__PURE__*/_regenerator().m(loadNearUnread),
21172
- _marked22$1 = /*#__PURE__*/_regenerator().m(loadDefaultMessages),
21173
- _marked23$1 = /*#__PURE__*/_regenerator().m(getMessagesQuery),
21174
- _marked24$1 = /*#__PURE__*/_regenerator().m(getMessageQuery),
21175
- _marked25$1 = /*#__PURE__*/_regenerator().m(prefetchMessages),
21176
- _marked26$1 = /*#__PURE__*/_regenerator().m(loadMoreMessages),
21177
- _marked27$1 = /*#__PURE__*/_regenerator().m(addReaction),
21178
- _marked28$1 = /*#__PURE__*/_regenerator().m(deleteReaction),
21179
- _marked29$1 = /*#__PURE__*/_regenerator().m(getReactions),
21180
- _marked30$1 = /*#__PURE__*/_regenerator().m(loadMoreReactions),
21181
- _marked31$1 = /*#__PURE__*/_regenerator().m(getMessageAttachments),
21182
- _marked32$1 = /*#__PURE__*/_regenerator().m(loadMoreMessageAttachments),
21183
- _marked33$1 = /*#__PURE__*/_regenerator().m(pauseAttachmentUploading),
21184
- _marked34$1 = /*#__PURE__*/_regenerator().m(resumeAttachmentUploading),
21185
- _marked35$1 = /*#__PURE__*/_regenerator().m(getMessageMarkers),
21186
- _marked36$1 = /*#__PURE__*/_regenerator().m(executeAddPollVote),
21187
- _marked37$1 = /*#__PURE__*/_regenerator().m(updateMessageOptimisticallyForAddPollVote),
21188
- _marked38$1 = /*#__PURE__*/_regenerator().m(addPollVote),
21189
- _marked39$1 = /*#__PURE__*/_regenerator().m(executeDeletePollVote),
21190
- _marked40$1 = /*#__PURE__*/_regenerator().m(updateMessageOptimisticallyForDeletePollVote),
21191
- _marked41$1 = /*#__PURE__*/_regenerator().m(deletePollVote),
21192
- _marked42 = /*#__PURE__*/_regenerator().m(executeClosePoll),
21193
- _marked43 = /*#__PURE__*/_regenerator().m(updateMessageOptimisticallyForClosePoll),
21194
- _marked44 = /*#__PURE__*/_regenerator().m(closePoll),
21195
- _marked45 = /*#__PURE__*/_regenerator().m(executeRetractPollVote),
21196
- _marked46 = /*#__PURE__*/_regenerator().m(updateMessageOptimisticallyForRetractPollVote),
21197
- _marked47 = /*#__PURE__*/_regenerator().m(retractPollVote),
21198
- _marked48 = /*#__PURE__*/_regenerator().m(resendPendingPollActions),
21199
- _marked49 = /*#__PURE__*/_regenerator().m(resendPendingMessageMutations),
21200
- _marked50 = /*#__PURE__*/_regenerator().m(getPollVotes),
21201
- _marked51 = /*#__PURE__*/_regenerator().m(loadMorePollVotes),
21202
- _marked52 = /*#__PURE__*/_regenerator().m(refreshCacheAroundMessage),
21203
- _marked53 = /*#__PURE__*/_regenerator().m(MessageSaga);
21170
+ _marked20$1 = /*#__PURE__*/_regenerator().m(backgroundCacheAroundMessage),
21171
+ _marked21$1 = /*#__PURE__*/_regenerator().m(loadAroundMessage),
21172
+ _marked22$1 = /*#__PURE__*/_regenerator().m(loadNearUnread),
21173
+ _marked23$1 = /*#__PURE__*/_regenerator().m(loadDefaultMessages),
21174
+ _marked24$1 = /*#__PURE__*/_regenerator().m(getMessagesQuery),
21175
+ _marked25$1 = /*#__PURE__*/_regenerator().m(getMessageQuery),
21176
+ _marked26$1 = /*#__PURE__*/_regenerator().m(prefetchMessages),
21177
+ _marked27$1 = /*#__PURE__*/_regenerator().m(loadMoreMessages),
21178
+ _marked28$1 = /*#__PURE__*/_regenerator().m(addReaction),
21179
+ _marked29$1 = /*#__PURE__*/_regenerator().m(deleteReaction),
21180
+ _marked30$1 = /*#__PURE__*/_regenerator().m(getReactions),
21181
+ _marked31$1 = /*#__PURE__*/_regenerator().m(loadMoreReactions),
21182
+ _marked32$1 = /*#__PURE__*/_regenerator().m(getMessageAttachments),
21183
+ _marked33$1 = /*#__PURE__*/_regenerator().m(loadMoreMessageAttachments),
21184
+ _marked34$1 = /*#__PURE__*/_regenerator().m(pauseAttachmentUploading),
21185
+ _marked35$1 = /*#__PURE__*/_regenerator().m(resumeAttachmentUploading),
21186
+ _marked36$1 = /*#__PURE__*/_regenerator().m(getMessageMarkers),
21187
+ _marked37$1 = /*#__PURE__*/_regenerator().m(executeAddPollVote),
21188
+ _marked38$1 = /*#__PURE__*/_regenerator().m(updateMessageOptimisticallyForAddPollVote),
21189
+ _marked39$1 = /*#__PURE__*/_regenerator().m(addPollVote),
21190
+ _marked40$1 = /*#__PURE__*/_regenerator().m(executeDeletePollVote),
21191
+ _marked41$1 = /*#__PURE__*/_regenerator().m(updateMessageOptimisticallyForDeletePollVote),
21192
+ _marked42 = /*#__PURE__*/_regenerator().m(deletePollVote),
21193
+ _marked43 = /*#__PURE__*/_regenerator().m(executeClosePoll),
21194
+ _marked44 = /*#__PURE__*/_regenerator().m(updateMessageOptimisticallyForClosePoll),
21195
+ _marked45 = /*#__PURE__*/_regenerator().m(closePoll),
21196
+ _marked46 = /*#__PURE__*/_regenerator().m(executeRetractPollVote),
21197
+ _marked47 = /*#__PURE__*/_regenerator().m(updateMessageOptimisticallyForRetractPollVote),
21198
+ _marked48 = /*#__PURE__*/_regenerator().m(retractPollVote),
21199
+ _marked49 = /*#__PURE__*/_regenerator().m(resendPendingPollActions),
21200
+ _marked50 = /*#__PURE__*/_regenerator().m(resendPendingMessageMutations),
21201
+ _marked51 = /*#__PURE__*/_regenerator().m(getPollVotes),
21202
+ _marked52 = /*#__PURE__*/_regenerator().m(loadMorePollVotes),
21203
+ _marked53 = /*#__PURE__*/_regenerator().m(refreshCacheAroundMessage),
21204
+ _marked54 = /*#__PURE__*/_regenerator().m(MessageSaga);
21204
21205
  var loadMoreMessagesInFlight = new Set();
21205
21206
  var prefetchInFlight = new Set();
21206
21207
  var queuedPrefetchRequests = new Map();
@@ -23084,6 +23085,36 @@ var getCachedMessagesForResult = function getCachedMessagesForResult(channelId,
23084
23085
  var cachedMessages = getCachedMessagesInRange(channelId, firstConfirmedMessageId, lastConfirmedMessageId);
23085
23086
  return cachedMessages.length > 0 ? cachedMessages : messages;
23086
23087
  };
23088
+ var getCachedAroundMessageWindow = function getCachedAroundMessageWindow(channel, messageId) {
23089
+ var _channel$lastMessage4;
23090
+ var targetMessage = getMessageFromMap(channel.id, messageId);
23091
+ if (!(targetMessage !== null && targetMessage !== void 0 && targetMessage.id)) {
23092
+ return null;
23093
+ }
23094
+ var targetInterval = getCachedWindowInterval(channel.id, targetMessage.id, targetMessage.id);
23095
+ if (!targetInterval.isFullyCached) {
23096
+ return null;
23097
+ }
23098
+ var halfWindowSize = MESSAGES_MAX_PAGE_COUNT / 2;
23099
+ var previousMessages = getContiguousPrevMessages(channel.id, targetMessage, halfWindowSize);
23100
+ var nextMessages = getContiguousNextMessages(channel.id, targetMessage, halfWindowSize);
23101
+ var messages = [].concat(previousMessages, [targetMessage], nextMessages);
23102
+ var firstConfirmedMessageId = getFirstConfirmedMessageId(messages);
23103
+ var lastConfirmedMessageId = getLastConfirmedMessageId(messages);
23104
+ if (!firstConfirmedMessageId || !lastConfirmedMessageId) {
23105
+ return null;
23106
+ }
23107
+ var cachedWindowInterval = getCachedWindowInterval(channel.id, firstConfirmedMessageId, lastConfirmedMessageId);
23108
+ if (!cachedWindowInterval.isFullyCached) {
23109
+ return null;
23110
+ }
23111
+ var hasNewerChannelMessage = !!((_channel$lastMessage4 = channel.lastMessage) !== null && _channel$lastMessage4 !== void 0 && _channel$lastMessage4.id) && !!lastConfirmedMessageId && compareMessageIds(channel.lastMessage.id, lastConfirmedMessageId) > 0;
23112
+ return {
23113
+ messages: messages,
23114
+ hasPrevMessages: cachedWindowInterval.hasPrevMessages,
23115
+ hasNextMessages: cachedWindowInterval.hasNextMessages || hasNewerChannelMessage
23116
+ };
23117
+ };
23087
23118
  function patchActiveMessagesFromCacheRange(channelId, startId, endId) {
23088
23119
  var activeMessages, activeConfirmedMessages, activeStartId, activeEndId, overlapStartId, overlapEndId, cachedMessages, changedMessages;
23089
23120
  return _regenerator().w(function (_context17) {
@@ -23828,7 +23859,7 @@ function backgroundRefreshRestoreWindow(channel, restoreWindow, cachedMessages)
23828
23859
  }, _marked18$1, null, [[0, 19]]);
23829
23860
  }
23830
23861
  function loadAroundMessageWorker(action) {
23831
- var _action$payload4, channel, messageId, networkChanged, restoreWindow, connectionState, messages, cachedWindow, _filteredPendingMessages, SceytChatClient, messageQueryBuilder, messageQuery, loadNextMessageId, loadPreviousMessageId, nextLoadLimit, previousLoadLimit, centerMessageIndex, firstResult, secondResult, resultMessages, result, firstConfirmedMessageId, lastConfirmedMessageId, appliedMessages, filteredPendingMessages, waitToSendPendingMessages, _t20, _t21, _t22, _t23;
23862
+ var _action$payload4, channel, messageId, networkChanged, restoreWindow, connectionState, messages, cachedWindow, _filteredPendingMessages, cachedAroundWindow, _firstConfirmedMessageId, _lastConfirmedMessageId, _filteredPendingMessages2, _waitToSendPendingMessages, SceytChatClient, messageQueryBuilder, messageQuery, loadNextMessageId, loadPreviousMessageId, nextLoadLimit, previousLoadLimit, centerMessageIndex, firstResult, secondResult, resultMessages, result, firstConfirmedMessageId, lastConfirmedMessageId, appliedMessages, filteredPendingMessages, waitToSendPendingMessages, _t20, _t21, _t22;
23832
23863
  return _regenerator().w(function (_context25) {
23833
23864
  while (1) switch (_context25.p = _context25.n) {
23834
23865
  case 0:
@@ -23837,7 +23868,7 @@ function loadAroundMessageWorker(action) {
23837
23868
  connectionState = store.getState().UserReducer.connectionStatus;
23838
23869
  messages = store.getState().MessageReducer.activeChannelMessages;
23839
23870
  if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
23840
- _context25.n = 30;
23871
+ _context25.n = 38;
23841
23872
  break;
23842
23873
  }
23843
23874
  if (!(restoreWindow !== null && restoreWindow !== void 0 && restoreWindow.preferCache)) {
@@ -23888,27 +23919,67 @@ function loadAroundMessageWorker(action) {
23888
23919
  case 10:
23889
23920
  return _context25.a(2);
23890
23921
  case 11:
23922
+ cachedAroundWindow = messageId && !networkChanged ? getCachedAroundMessageWindow(channel, messageId) : null;
23923
+ if (!cachedAroundWindow) {
23924
+ _context25.n = 20;
23925
+ break;
23926
+ }
23927
+ _firstConfirmedMessageId = getFirstConfirmedMessageId(cachedAroundWindow.messages);
23928
+ _lastConfirmedMessageId = getLastConfirmedMessageId(cachedAroundWindow.messages);
23929
+ if (_firstConfirmedMessageId && _lastConfirmedMessageId) {
23930
+ setActiveSegment(channel.id, _firstConfirmedMessageId, _lastConfirmedMessageId);
23931
+ }
23891
23932
  _context25.n = 12;
23892
- return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADING);
23933
+ return effects.put(setMessagesHasPrevAC(cachedAroundWindow.hasPrevMessages));
23893
23934
  case 12:
23935
+ _context25.n = 13;
23936
+ return effects.put(setMessagesHasNextAC(cachedAroundWindow.hasNextMessages));
23937
+ case 13:
23938
+ _context25.n = 14;
23939
+ return effects.call(loadOGMetadataForLinkMessages, cachedAroundWindow.messages, true, false, false);
23940
+ case 14:
23941
+ _context25.n = 15;
23942
+ return effects.put(setMessagesAC(JSON.parse(JSON.stringify(cachedAroundWindow.messages)), channel.id));
23943
+ case 15:
23944
+ _filteredPendingMessages2 = getFilteredPendingMessages(channel, cachedAroundWindow.messages, {
23945
+ hasNext: cachedAroundWindow.hasNextMessages
23946
+ });
23947
+ _context25.n = 16;
23948
+ return effects.put(addMessagesAC(_filteredPendingMessages2, MESSAGE_LOAD_DIRECTION.NEXT));
23949
+ case 16:
23950
+ _context25.n = 17;
23951
+ return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages2, true, false, false);
23952
+ case 17:
23953
+ _waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
23954
+ if (!(connectionState === CONNECTION_STATUS.CONNECTED && _waitToSendPendingMessages)) {
23955
+ _context25.n = 19;
23956
+ break;
23957
+ }
23958
+ _context25.n = 18;
23959
+ return effects.put(setWaitToSendPendingMessagesAC(false));
23960
+ case 18:
23961
+ _context25.n = 19;
23962
+ return effects.spawn(sendPendingMessages, connectionState);
23963
+ case 19:
23964
+ return _context25.a(2);
23965
+ case 20:
23966
+ if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
23967
+ _context25.n = 21;
23968
+ break;
23969
+ }
23970
+ return _context25.a(2);
23971
+ case 21:
23972
+ _context25.n = 22;
23973
+ return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADING);
23974
+ case 22:
23894
23975
  SceytChatClient = getClient();
23895
23976
  messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
23896
23977
  messageQueryBuilder.limit(MESSAGES_MAX_LENGTH);
23897
23978
  messageQueryBuilder.reverse(true);
23898
- if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
23899
- _context25.n = 14;
23900
- break;
23901
- }
23902
- _context25.n = 13;
23979
+ _context25.n = 23;
23903
23980
  return effects.call(messageQueryBuilder.build);
23904
- case 13:
23905
- _t20 = _context25.v;
23906
- _context25.n = 15;
23907
- break;
23908
- case 14:
23909
- _t20 = null;
23910
- case 15:
23911
- messageQuery = _t20;
23981
+ case 23:
23982
+ messageQuery = _context25.v;
23912
23983
  query.messageQuery = messageQuery;
23913
23984
  loadNextMessageId = '';
23914
23985
  loadPreviousMessageId = '';
@@ -23925,22 +23996,22 @@ function loadAroundMessageWorker(action) {
23925
23996
  }
23926
23997
  messageQuery.limit = previousLoadLimit;
23927
23998
  if (!(loadPreviousMessageId && connectionState === CONNECTION_STATUS.CONNECTED)) {
23928
- _context25.n = 17;
23999
+ _context25.n = 25;
23929
24000
  break;
23930
24001
  }
23931
- _context25.n = 16;
24002
+ _context25.n = 24;
23932
24003
  return effects.call(messageQuery.loadPreviousMessageId, loadPreviousMessageId);
23933
- case 16:
23934
- _t21 = _context25.v;
23935
- _context25.n = 18;
24004
+ case 24:
24005
+ _t20 = _context25.v;
24006
+ _context25.n = 26;
23936
24007
  break;
23937
- case 17:
23938
- _t21 = {
24008
+ case 25:
24009
+ _t20 = {
23939
24010
  messages: [],
23940
24011
  hasNext: false
23941
24012
  };
23942
- case 18:
23943
- firstResult = _t21;
24013
+ case 26:
24014
+ firstResult = _t20;
23944
24015
  if (!loadNextMessageId && firstResult.messages.length > 0) {
23945
24016
  loadNextMessageId = getLastConfirmedMessageId(firstResult.messages);
23946
24017
  } else if (!networkChanged && !loadNextMessageId && !firstResult.messages.length) {
@@ -23949,22 +24020,22 @@ function loadAroundMessageWorker(action) {
23949
24020
  messageQuery.reverse = false;
23950
24021
  messageQuery.limit = nextLoadLimit;
23951
24022
  if (!(loadNextMessageId && connectionState === CONNECTION_STATUS.CONNECTED)) {
23952
- _context25.n = 20;
24023
+ _context25.n = 28;
23953
24024
  break;
23954
24025
  }
23955
- _context25.n = 19;
24026
+ _context25.n = 27;
23956
24027
  return effects.call(messageQuery.loadNextMessageId, loadNextMessageId);
23957
- case 19:
23958
- _t22 = _context25.v;
23959
- _context25.n = 21;
24028
+ case 27:
24029
+ _t21 = _context25.v;
24030
+ _context25.n = 29;
23960
24031
  break;
23961
- case 20:
23962
- _t22 = {
24032
+ case 28:
24033
+ _t21 = {
23963
24034
  messages: [],
23964
24035
  hasNext: false
23965
24036
  };
23966
- case 21:
23967
- secondResult = _t22;
24037
+ case 29:
24038
+ secondResult = _t21;
23968
24039
  resultMessages = networkChanged && !firstResult.messages.length && !secondResult.messages.length ? messages : [].concat(firstResult.messages, secondResult.messages);
23969
24040
  result = {
23970
24041
  messages: resultMessages,
@@ -23973,164 +24044,243 @@ function loadAroundMessageWorker(action) {
23973
24044
  firstConfirmedMessageId = getFirstConfirmedMessageId(result.messages);
23974
24045
  lastConfirmedMessageId = getLastConfirmedMessageId(result.messages);
23975
24046
  if (!(firstConfirmedMessageId && lastConfirmedMessageId)) {
23976
- _context25.n = 23;
24047
+ _context25.n = 31;
23977
24048
  break;
23978
24049
  }
23979
24050
  setMessagesToMap(channel.id, result.messages, firstConfirmedMessageId, lastConfirmedMessageId);
23980
24051
  setActiveSegment(channel.id, firstConfirmedMessageId, lastConfirmedMessageId);
23981
- _context25.n = 22;
24052
+ _context25.n = 30;
23982
24053
  return effects.spawn(prefetchMessages, channel.id, firstConfirmedMessageId, MESSAGE_LOAD_DIRECTION.PREV, 2);
23983
- case 22:
23984
- _context25.n = 23;
24054
+ case 30:
24055
+ _context25.n = 31;
23985
24056
  return effects.spawn(prefetchMessages, channel.id, lastConfirmedMessageId, MESSAGE_LOAD_DIRECTION.NEXT, 2);
23986
- case 23:
24057
+ case 31:
23987
24058
  appliedMessages = getCachedMessagesForResult(channel.id, result.messages);
23988
- _context25.n = 24;
24059
+ _context25.n = 32;
23989
24060
  return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true, false, false);
23990
- case 24:
23991
- _context25.n = 25;
24061
+ case 32:
24062
+ _context25.n = 33;
23992
24063
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(appliedMessages)), channel.id));
23993
- case 25:
23994
- _context25.n = 26;
24064
+ case 33:
24065
+ _context25.n = 34;
23995
24066
  return effects.put(setMessagesHasNextAC(true));
23996
- case 26:
24067
+ case 34:
23997
24068
  filteredPendingMessages = getFilteredPendingMessages(channel, appliedMessages);
23998
- _context25.n = 27;
24069
+ _context25.n = 35;
23999
24070
  return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
24000
- case 27:
24001
- _context25.n = 28;
24071
+ case 35:
24072
+ _context25.n = 36;
24002
24073
  return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true, false, false);
24003
- case 28:
24074
+ case 36:
24004
24075
  waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
24005
24076
  if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
24006
- _context25.n = 30;
24077
+ _context25.n = 38;
24007
24078
  break;
24008
24079
  }
24009
- _context25.n = 29;
24080
+ _context25.n = 37;
24010
24081
  return effects.put(setWaitToSendPendingMessagesAC(false));
24011
- case 29:
24012
- _context25.n = 30;
24082
+ case 37:
24083
+ _context25.n = 38;
24013
24084
  return effects.spawn(sendPendingMessages, connectionState);
24014
- case 30:
24015
- _context25.n = 32;
24085
+ case 38:
24086
+ _context25.n = 40;
24016
24087
  break;
24017
- case 31:
24018
- _context25.p = 31;
24019
- _t23 = _context25.v;
24020
- log.error('error in loadAroundMessage', _t23);
24021
- case 32:
24022
- _context25.p = 32;
24023
- _context25.n = 33;
24088
+ case 39:
24089
+ _context25.p = 39;
24090
+ _t22 = _context25.v;
24091
+ log.error('error in loadAroundMessage', _t22);
24092
+ case 40:
24093
+ _context25.p = 40;
24094
+ _context25.n = 41;
24024
24095
  return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADED);
24025
- case 33:
24026
- return _context25.f(32);
24027
- case 34:
24096
+ case 41:
24097
+ return _context25.f(40);
24098
+ case 42:
24028
24099
  return _context25.a(2);
24029
24100
  }
24030
- }, _marked19$1, null, [[0, 31, 32, 34]]);
24101
+ }, _marked19$1, null, [[0, 39, 40, 42]]);
24031
24102
  }
24032
- function loadAroundMessage(action) {
24103
+ function backgroundCacheAroundMessage(action) {
24104
+ var _action$payload5, channel, messageId, waited, SceytChatClient, messageQueryBuilder, messageQuery, firstResult, loadNextMessageId, secondResult, resultMessages, firstConfirmedMessageId, lastConfirmedMessageId, _t23;
24033
24105
  return _regenerator().w(function (_context26) {
24034
- while (1) switch (_context26.n) {
24106
+ while (1) switch (_context26.p = _context26.n) {
24035
24107
  case 0:
24036
- _context26.n = 1;
24108
+ _context26.p = 0;
24109
+ _action$payload5 = action.payload, channel = _action$payload5.channel, messageId = _action$payload5.messageId;
24110
+ if (!(!(channel !== null && channel !== void 0 && channel.id) || !messageId)) {
24111
+ _context26.n = 1;
24112
+ break;
24113
+ }
24114
+ return _context26.a(2);
24115
+ case 1:
24116
+ waited = 0;
24117
+ case 2:
24118
+ if (!(store.getState().UserReducer.connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
24119
+ _context26.n = 5;
24120
+ break;
24121
+ }
24122
+ if (!(waited >= 60000)) {
24123
+ _context26.n = 3;
24124
+ break;
24125
+ }
24126
+ return _context26.a(2);
24127
+ case 3:
24128
+ _context26.n = 4;
24129
+ return effects.call(effects.delay, 2000);
24130
+ case 4:
24131
+ waited += 2000;
24132
+ _context26.n = 2;
24133
+ break;
24134
+ case 5:
24135
+ SceytChatClient = getClient();
24136
+ messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
24137
+ messageQueryBuilder.limit(MESSAGES_MAX_LENGTH);
24138
+ messageQueryBuilder.reverse(true);
24139
+ _context26.n = 6;
24140
+ return effects.call(messageQueryBuilder.build);
24141
+ case 6:
24142
+ messageQuery = _context26.v;
24143
+ messageQuery.limit = MESSAGES_MAX_PAGE_COUNT / 2;
24144
+ _context26.n = 7;
24145
+ return effects.call(messageQuery.loadPreviousMessageId, messageId);
24146
+ case 7:
24147
+ firstResult = _context26.v;
24148
+ loadNextMessageId = firstResult.messages.length > 0 ? getLastConfirmedMessageId(firstResult.messages) : '0';
24149
+ messageQuery.reverse = false;
24150
+ messageQuery.limit = MESSAGES_MAX_PAGE_COUNT / 2;
24151
+ _context26.n = 8;
24152
+ return effects.call(messageQuery.loadNextMessageId, loadNextMessageId);
24153
+ case 8:
24154
+ secondResult = _context26.v;
24155
+ resultMessages = [].concat(firstResult.messages, secondResult.messages);
24156
+ firstConfirmedMessageId = getFirstConfirmedMessageId(resultMessages);
24157
+ lastConfirmedMessageId = getLastConfirmedMessageId(resultMessages);
24158
+ if (firstConfirmedMessageId && lastConfirmedMessageId) {
24159
+ setMessagesToMap(channel.id, resultMessages, firstConfirmedMessageId, lastConfirmedMessageId);
24160
+ setActiveSegment(channel.id, firstConfirmedMessageId, lastConfirmedMessageId);
24161
+ }
24162
+ _context26.n = 10;
24163
+ break;
24164
+ case 9:
24165
+ _context26.p = 9;
24166
+ _t23 = _context26.v;
24167
+ log.error('error in backgroundCacheAroundMessage', _t23);
24168
+ case 10:
24169
+ return _context26.a(2);
24170
+ }
24171
+ }, _marked20$1, null, [[0, 9]]);
24172
+ }
24173
+ function loadAroundMessage(action) {
24174
+ var result;
24175
+ return _regenerator().w(function (_context27) {
24176
+ while (1) switch (_context27.n) {
24177
+ case 0:
24178
+ _context27.n = 1;
24037
24179
  return effects.race({
24038
24180
  load: effects.call(loadAroundMessageWorker, action),
24039
24181
  cancel: effects.take(CANCEL_WINDOW_LOAD)
24040
24182
  });
24041
24183
  case 1:
24042
- return _context26.a(2);
24184
+ result = _context27.v;
24185
+ if (!result.cancel) {
24186
+ _context27.n = 2;
24187
+ break;
24188
+ }
24189
+ _context27.n = 2;
24190
+ return effects.spawn(backgroundCacheAroundMessage, action);
24191
+ case 2:
24192
+ return _context27.a(2);
24043
24193
  }
24044
- }, _marked20$1);
24194
+ }, _marked21$1);
24045
24195
  }
24046
24196
  function loadNearUnread(action) {
24047
- var channel, connectionState, _channel$lastMessage4, _channel$lastMessage5, _channel$lastMessage6, cachedNearWindow, cacheWasShown, cachedLastConfirmedMessageId, cachedHasPrevMessages, cachedHasNextMessages, filteredPendingMessages, SceytChatClient, messageQueryBuilder, messageQuery, result, firstConfirmedMessageId, lastConfirmedMessageId, refreshedCachedNearWindow, lastAppliedWindow, appliedMessages, hasPrevMessages, refreshedLastConfirmedMessageId, hasNextMessages, changedMessages, _filteredPendingMessages2, waitToSendPendingMessages, _t24;
24048
- return _regenerator().w(function (_context27) {
24049
- while (1) switch (_context27.p = _context27.n) {
24197
+ var channel, connectionState, _channel$lastMessage5, _channel$lastMessage6, _channel$lastMessage7, cachedNearWindow, cacheWasShown, cachedLastConfirmedMessageId, cachedHasPrevMessages, cachedHasNextMessages, filteredPendingMessages, SceytChatClient, messageQueryBuilder, messageQuery, result, firstConfirmedMessageId, lastConfirmedMessageId, refreshedCachedNearWindow, lastAppliedWindow, appliedMessages, hasPrevMessages, refreshedLastConfirmedMessageId, hasNextMessages, changedMessages, _filteredPendingMessages3, waitToSendPendingMessages, _t24;
24198
+ return _regenerator().w(function (_context28) {
24199
+ while (1) switch (_context28.p = _context28.n) {
24050
24200
  case 0:
24051
- _context27.p = 0;
24201
+ _context28.p = 0;
24052
24202
  channel = action.payload.channel;
24053
24203
  connectionState = store.getState().UserReducer.connectionStatus;
24054
24204
  if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
24055
- _context27.n = 30;
24205
+ _context28.n = 30;
24056
24206
  break;
24057
24207
  }
24058
24208
  cachedNearWindow = getCachedNearMessages(channel.id, channel.lastDisplayedMessageId, MESSAGES_MAX_LENGTH);
24059
24209
  cacheWasShown = cachedNearWindow.hasEnoughCache && cachedNearWindow.messages.length > 0;
24060
24210
  cachedLastConfirmedMessageId = getLastConfirmedMessageId(cachedNearWindow.messages);
24061
24211
  cachedHasPrevMessages = !!channel.lastDisplayedMessageId || cachedNearWindow.hasPrevMessages;
24062
- cachedHasNextMessages = cachedNearWindow.hasNextMessages || !!((_channel$lastMessage4 = channel.lastMessage) !== null && _channel$lastMessage4 !== void 0 && _channel$lastMessage4.id) && !!cachedLastConfirmedMessageId && compareMessageIds(channel.lastMessage.id, cachedLastConfirmedMessageId) > 0;
24212
+ cachedHasNextMessages = cachedNearWindow.hasNextMessages || !!((_channel$lastMessage5 = channel.lastMessage) !== null && _channel$lastMessage5 !== void 0 && _channel$lastMessage5.id) && !!cachedLastConfirmedMessageId && compareMessageIds(channel.lastMessage.id, cachedLastConfirmedMessageId) > 0;
24063
24213
  if (!cacheWasShown) {
24064
- _context27.n = 10;
24214
+ _context28.n = 10;
24065
24215
  break;
24066
24216
  }
24067
- _context27.n = 1;
24217
+ _context28.n = 1;
24068
24218
  return effects.put(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
24069
24219
  case 1:
24070
- _context27.n = 2;
24220
+ _context28.n = 2;
24071
24221
  return effects.put(setMessagesHasPrevAC(cachedHasPrevMessages));
24072
24222
  case 2:
24073
- _context27.n = 3;
24223
+ _context28.n = 3;
24074
24224
  return effects.put(setMessagesHasNextAC(cachedHasNextMessages));
24075
24225
  case 3:
24076
- _context27.n = 4;
24226
+ _context28.n = 4;
24077
24227
  return effects.call(loadOGMetadataForLinkMessages, cachedNearWindow.messages, true, false, false);
24078
24228
  case 4:
24079
- _context27.n = 5;
24229
+ _context28.n = 5;
24080
24230
  return effects.put(setMessagesAC(cachedNearWindow.messages, channel.id));
24081
24231
  case 5:
24082
- _context27.n = 6;
24232
+ _context28.n = 6;
24083
24233
  return effects.put(scrollToNewMessageAC(false));
24084
24234
  case 6:
24085
- _context27.n = 7;
24235
+ _context28.n = 7;
24086
24236
  return effects.put(setUnreadScrollToAC(true));
24087
24237
  case 7:
24088
24238
  filteredPendingMessages = getFilteredPendingMessages(channel, cachedNearWindow.messages, {
24089
24239
  hasNext: cachedHasNextMessages
24090
24240
  });
24091
- _context27.n = 8;
24241
+ _context28.n = 8;
24092
24242
  return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
24093
24243
  case 8:
24094
- _context27.n = 9;
24244
+ _context28.n = 9;
24095
24245
  return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true, false, false);
24096
24246
  case 9:
24097
- _context27.n = 11;
24247
+ _context28.n = 11;
24098
24248
  break;
24099
24249
  case 10:
24100
- _context27.n = 11;
24250
+ _context28.n = 11;
24101
24251
  return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADING);
24102
24252
  case 11:
24103
24253
  if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
24104
- _context27.n = 12;
24254
+ _context28.n = 12;
24105
24255
  break;
24106
24256
  }
24107
- return _context27.a(2);
24257
+ return _context28.a(2);
24108
24258
  case 12:
24109
24259
  SceytChatClient = getClient();
24110
24260
  messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
24111
24261
  messageQueryBuilder.limit(MESSAGES_MAX_LENGTH);
24112
24262
  messageQueryBuilder.reverse(true);
24113
- _context27.n = 13;
24263
+ _context28.n = 13;
24114
24264
  return effects.call(messageQueryBuilder.build);
24115
24265
  case 13:
24116
- messageQuery = _context27.v;
24266
+ messageQuery = _context28.v;
24117
24267
  query.messageQuery = messageQuery;
24118
24268
  messageQuery.limit = MESSAGES_MAX_LENGTH;
24119
24269
  if (!Number(channel.lastDisplayedMessageId)) {
24120
- _context27.n = 15;
24270
+ _context28.n = 15;
24121
24271
  break;
24122
24272
  }
24123
- _context27.n = 14;
24273
+ _context28.n = 14;
24124
24274
  return effects.call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
24125
24275
  case 14:
24126
- result = _context27.v;
24127
- _context27.n = 17;
24276
+ result = _context28.v;
24277
+ _context28.n = 17;
24128
24278
  break;
24129
24279
  case 15:
24130
- _context27.n = 16;
24280
+ _context28.n = 16;
24131
24281
  return effects.call(messageQuery.loadPrevious);
24132
24282
  case 16:
24133
- result = _context27.v;
24283
+ result = _context28.v;
24134
24284
  case 17:
24135
24285
  firstConfirmedMessageId = getFirstConfirmedMessageId(result.messages);
24136
24286
  lastConfirmedMessageId = getLastConfirmedMessageId(result.messages);
@@ -24145,90 +24295,90 @@ function loadNearUnread(action) {
24145
24295
  appliedMessages = refreshedCachedNearWindow.hasEnoughCache && refreshedCachedNearWindow.messages.length ? refreshedCachedNearWindow.messages : getCachedMessagesForResult(channel.id, result.messages);
24146
24296
  hasPrevMessages = refreshedCachedNearWindow.hasEnoughCache && refreshedCachedNearWindow.messages.length ? !!channel.lastDisplayedMessageId || refreshedCachedNearWindow.hasPrevMessages : true;
24147
24297
  refreshedLastConfirmedMessageId = getLastConfirmedMessageId(appliedMessages);
24148
- hasNextMessages = refreshedCachedNearWindow.hasEnoughCache && refreshedCachedNearWindow.messages.length ? refreshedCachedNearWindow.hasNextMessages || !!((_channel$lastMessage5 = channel.lastMessage) !== null && _channel$lastMessage5 !== void 0 && _channel$lastMessage5.id) && !!refreshedLastConfirmedMessageId && compareMessageIds(channel.lastMessage.id, refreshedLastConfirmedMessageId) > 0 : !!((_channel$lastMessage6 = channel.lastMessage) !== null && _channel$lastMessage6 !== void 0 && _channel$lastMessage6.id) && !!refreshedLastConfirmedMessageId && compareMessageIds(channel.lastMessage.id, refreshedLastConfirmedMessageId) > 0;
24149
- _context27.n = 18;
24298
+ hasNextMessages = refreshedCachedNearWindow.hasEnoughCache && refreshedCachedNearWindow.messages.length ? refreshedCachedNearWindow.hasNextMessages || !!((_channel$lastMessage6 = channel.lastMessage) !== null && _channel$lastMessage6 !== void 0 && _channel$lastMessage6.id) && !!refreshedLastConfirmedMessageId && compareMessageIds(channel.lastMessage.id, refreshedLastConfirmedMessageId) > 0 : !!((_channel$lastMessage7 = channel.lastMessage) !== null && _channel$lastMessage7 !== void 0 && _channel$lastMessage7.id) && !!refreshedLastConfirmedMessageId && compareMessageIds(channel.lastMessage.id, refreshedLastConfirmedMessageId) > 0;
24299
+ _context28.n = 18;
24150
24300
  return effects.put(setMessagesHasPrevAC(hasPrevMessages));
24151
24301
  case 18:
24152
- _context27.n = 19;
24302
+ _context28.n = 19;
24153
24303
  return effects.put(setMessagesHasNextAC(hasNextMessages));
24154
24304
  case 19:
24155
- _context27.n = 20;
24305
+ _context28.n = 20;
24156
24306
  return effects.put(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
24157
24307
  case 20:
24158
- _context27.n = 21;
24308
+ _context28.n = 21;
24159
24309
  return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true, false, false);
24160
24310
  case 21:
24161
24311
  if (!(cacheWasShown && sameConfirmedWindow(lastAppliedWindow, appliedMessages))) {
24162
- _context27.n = 23;
24312
+ _context28.n = 23;
24163
24313
  break;
24164
24314
  }
24165
24315
  changedMessages = getChangedActiveMessages(lastAppliedWindow, appliedMessages);
24166
24316
  if (!(changedMessages.length > 0)) {
24167
- _context27.n = 22;
24317
+ _context28.n = 22;
24168
24318
  break;
24169
24319
  }
24170
- _context27.n = 22;
24320
+ _context28.n = 22;
24171
24321
  return effects.put(patchMessagesAC(changedMessages));
24172
24322
  case 22:
24173
- _context27.n = 28;
24323
+ _context28.n = 28;
24174
24324
  break;
24175
24325
  case 23:
24176
- _context27.n = 24;
24326
+ _context28.n = 24;
24177
24327
  return effects.put(setMessagesAC(appliedMessages, channel.id));
24178
24328
  case 24:
24179
- _context27.n = 25;
24329
+ _context28.n = 25;
24180
24330
  return effects.put(scrollToNewMessageAC(false));
24181
24331
  case 25:
24182
- _context27.n = 26;
24332
+ _context28.n = 26;
24183
24333
  return effects.put(setUnreadScrollToAC(true));
24184
24334
  case 26:
24185
- _filteredPendingMessages2 = getFilteredPendingMessages(channel, appliedMessages, {
24335
+ _filteredPendingMessages3 = getFilteredPendingMessages(channel, appliedMessages, {
24186
24336
  hasNext: hasNextMessages
24187
24337
  });
24188
- _context27.n = 27;
24189
- return effects.put(addMessagesAC(_filteredPendingMessages2, MESSAGE_LOAD_DIRECTION.NEXT));
24338
+ _context28.n = 27;
24339
+ return effects.put(addMessagesAC(_filteredPendingMessages3, MESSAGE_LOAD_DIRECTION.NEXT));
24190
24340
  case 27:
24191
- _context27.n = 28;
24192
- return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages2, true, false, false);
24341
+ _context28.n = 28;
24342
+ return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages3, true, false, false);
24193
24343
  case 28:
24194
24344
  waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
24195
24345
  if (!waitToSendPendingMessages) {
24196
- _context27.n = 30;
24346
+ _context28.n = 30;
24197
24347
  break;
24198
24348
  }
24199
- _context27.n = 29;
24349
+ _context28.n = 29;
24200
24350
  return effects.put(setWaitToSendPendingMessagesAC(false));
24201
24351
  case 29:
24202
- _context27.n = 30;
24352
+ _context28.n = 30;
24203
24353
  return effects.spawn(sendPendingMessages, connectionState);
24204
24354
  case 30:
24205
- _context27.n = 32;
24355
+ _context28.n = 32;
24206
24356
  break;
24207
24357
  case 31:
24208
- _context27.p = 31;
24209
- _t24 = _context27.v;
24358
+ _context28.p = 31;
24359
+ _t24 = _context28.v;
24210
24360
  log.error('error in loadNearUnread', _t24);
24211
24361
  case 32:
24212
- _context27.p = 32;
24213
- _context27.n = 33;
24362
+ _context28.p = 32;
24363
+ _context28.n = 33;
24214
24364
  return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADED);
24215
24365
  case 33:
24216
- return _context27.f(32);
24366
+ return _context28.f(32);
24217
24367
  case 34:
24218
- return _context27.a(2);
24368
+ return _context28.a(2);
24219
24369
  }
24220
- }, _marked21$1, null, [[0, 31, 32, 34]]);
24370
+ }, _marked22$1, null, [[0, 31, 32, 34]]);
24221
24371
  }
24222
24372
  function loadDefaultMessages(action) {
24223
- var channel, connectionState, _channel$lastMessage7, _channel$lastMessage8, _channel$lastMessage9, _result$messages, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, messages, _filteredPendingMessages3, result, updatedMessages, appliedMessages, messageIdForLoad, firstConfirmedMessageId, lastConfirmedMessageId, changedMessages, _iterator3, _step3, message, filteredPendingMessages, waitToSendPendingMessages, _t25, _t26, _t27, _t28;
24224
- return _regenerator().w(function (_context28) {
24225
- while (1) switch (_context28.p = _context28.n) {
24373
+ var channel, connectionState, _channel$lastMessage8, _channel$lastMessage9, _channel$lastMessage0, _result$messages, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, messages, _filteredPendingMessages4, result, updatedMessages, appliedMessages, messageIdForLoad, firstConfirmedMessageId, lastConfirmedMessageId, changedMessages, _iterator3, _step3, message, filteredPendingMessages, waitToSendPendingMessages, _t25, _t26, _t27, _t28;
24374
+ return _regenerator().w(function (_context29) {
24375
+ while (1) switch (_context29.p = _context29.n) {
24226
24376
  case 0:
24227
- _context28.p = 0;
24377
+ _context29.p = 0;
24228
24378
  channel = action.payload.channel;
24229
24379
  connectionState = store.getState().UserReducer.connectionStatus;
24230
24380
  if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
24231
- _context28.n = 32;
24381
+ _context29.n = 32;
24232
24382
  break;
24233
24383
  }
24234
24384
  SceytChatClient = getClient();
@@ -24236,14 +24386,14 @@ function loadDefaultMessages(action) {
24236
24386
  messageQueryBuilder.limit(MESSAGES_MAX_LENGTH);
24237
24387
  messageQueryBuilder.reverse(true);
24238
24388
  if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
24239
- _context28.n = 2;
24389
+ _context29.n = 2;
24240
24390
  break;
24241
24391
  }
24242
- _context28.n = 1;
24392
+ _context29.n = 1;
24243
24393
  return effects.call(messageQueryBuilder.build);
24244
24394
  case 1:
24245
- _t25 = _context28.v;
24246
- _context28.n = 3;
24395
+ _t25 = _context29.v;
24396
+ _context29.n = 3;
24247
24397
  break;
24248
24398
  case 2:
24249
24399
  _t25 = null;
@@ -24252,48 +24402,48 @@ function loadDefaultMessages(action) {
24252
24402
  query.messageQuery = messageQuery;
24253
24403
  cachedMessages = getLatestMessagesFromMap(channel.id, MESSAGES_MAX_PAGE_COUNT);
24254
24404
  if (!(cachedMessages && cachedMessages.length)) {
24255
- _context28.n = 8;
24405
+ _context29.n = 8;
24256
24406
  break;
24257
24407
  }
24258
24408
  messages = cachedMessages;
24259
- _context28.n = 4;
24409
+ _context29.n = 4;
24260
24410
  return effects.call(loadOGMetadataForLinkMessages, messages, true, false, false);
24261
24411
  case 4:
24262
- _context28.n = 5;
24412
+ _context29.n = 5;
24263
24413
  return effects.put(setMessagesAC(messages, channel.id));
24264
24414
  case 5:
24265
- _filteredPendingMessages3 = getFilteredPendingMessages(channel, messages, {
24415
+ _filteredPendingMessages4 = getFilteredPendingMessages(channel, messages, {
24266
24416
  isLatestWindow: true
24267
24417
  });
24268
- _context28.n = 6;
24269
- return effects.put(addMessagesAC(_filteredPendingMessages3, MESSAGE_LOAD_DIRECTION.NEXT));
24418
+ _context29.n = 6;
24419
+ return effects.put(addMessagesAC(_filteredPendingMessages4, MESSAGE_LOAD_DIRECTION.NEXT));
24270
24420
  case 6:
24271
- _context28.n = 7;
24272
- return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages3, true, false, false);
24421
+ _context29.n = 7;
24422
+ return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages4, true, false, false);
24273
24423
  case 7:
24274
- _context28.n = 9;
24424
+ _context29.n = 9;
24275
24425
  break;
24276
24426
  case 8:
24277
- _context28.n = 9;
24427
+ _context29.n = 9;
24278
24428
  return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADING);
24279
24429
  case 9:
24280
24430
  result = {
24281
24431
  messages: [],
24282
24432
  hasNext: false
24283
24433
  };
24284
- if (!(compareMessageIds(channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId, channel === null || channel === void 0 ? void 0 : (_channel$lastMessage7 = channel.lastMessage) === null || _channel$lastMessage7 === void 0 ? void 0 : _channel$lastMessage7.id) > 0)) {
24285
- _context28.n = 13;
24434
+ if (!(compareMessageIds(channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId, channel === null || channel === void 0 ? void 0 : (_channel$lastMessage8 = channel.lastMessage) === null || _channel$lastMessage8 === void 0 ? void 0 : _channel$lastMessage8.id) > 0)) {
24435
+ _context29.n = 13;
24286
24436
  break;
24287
24437
  }
24288
24438
  if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
24289
- _context28.n = 11;
24439
+ _context29.n = 11;
24290
24440
  break;
24291
24441
  }
24292
- _context28.n = 10;
24442
+ _context29.n = 10;
24293
24443
  return effects.call(messageQuery.loadPreviousMessageId, channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId);
24294
24444
  case 10:
24295
- _t26 = _context28.v;
24296
- _context28.n = 12;
24445
+ _t26 = _context29.v;
24446
+ _context29.n = 12;
24297
24447
  break;
24298
24448
  case 11:
24299
24449
  _t26 = {
@@ -24302,18 +24452,18 @@ function loadDefaultMessages(action) {
24302
24452
  };
24303
24453
  case 12:
24304
24454
  result = _t26;
24305
- _context28.n = 17;
24455
+ _context29.n = 17;
24306
24456
  break;
24307
24457
  case 13:
24308
24458
  if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
24309
- _context28.n = 15;
24459
+ _context29.n = 15;
24310
24460
  break;
24311
24461
  }
24312
- _context28.n = 14;
24462
+ _context29.n = 14;
24313
24463
  return effects.call(messageQuery.loadPrevious);
24314
24464
  case 14:
24315
- _t27 = _context28.v;
24316
- _context28.n = 16;
24465
+ _t27 = _context29.v;
24466
+ _context29.n = 16;
24317
24467
  break;
24318
24468
  case 15:
24319
24469
  _t27 = {
@@ -24332,143 +24482,143 @@ function loadDefaultMessages(action) {
24332
24482
  updatedMessages.push(updatedMessage || msg);
24333
24483
  });
24334
24484
  appliedMessages = updatedMessages;
24335
- messageIdForLoad = compareMessageIds(channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId, channel === null || channel === void 0 ? void 0 : (_channel$lastMessage8 = channel.lastMessage) === null || _channel$lastMessage8 === void 0 ? void 0 : _channel$lastMessage8.id) > 0 ? (channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId) || '0' : (channel === null || channel === void 0 ? void 0 : (_channel$lastMessage9 = channel.lastMessage) === null || _channel$lastMessage9 === void 0 ? void 0 : _channel$lastMessage9.id) || '0';
24485
+ messageIdForLoad = compareMessageIds(channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId, channel === null || channel === void 0 ? void 0 : (_channel$lastMessage9 = channel.lastMessage) === null || _channel$lastMessage9 === void 0 ? void 0 : _channel$lastMessage9.id) > 0 ? (channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId) || '0' : (channel === null || channel === void 0 ? void 0 : (_channel$lastMessage0 = channel.lastMessage) === null || _channel$lastMessage0 === void 0 ? void 0 : _channel$lastMessage0.id) || '0';
24336
24486
  if (!updatedMessages.length) {
24337
- _context28.n = 27;
24487
+ _context29.n = 27;
24338
24488
  break;
24339
24489
  }
24340
24490
  firstConfirmedMessageId = getFirstConfirmedMessageId(updatedMessages);
24341
24491
  lastConfirmedMessageId = getLastConfirmedMessageId(updatedMessages);
24342
24492
  setMessagesToMap(channel.id, updatedMessages, firstConfirmedMessageId || '0', messageIdForLoad);
24343
24493
  if (!(firstConfirmedMessageId && lastConfirmedMessageId)) {
24344
- _context28.n = 18;
24494
+ _context29.n = 18;
24345
24495
  break;
24346
24496
  }
24347
24497
  setActiveSegment(channel.id, firstConfirmedMessageId, lastConfirmedMessageId);
24348
- _context28.n = 18;
24498
+ _context29.n = 18;
24349
24499
  return effects.spawn(prefetchMessages, channel.id, firstConfirmedMessageId, MESSAGE_LOAD_DIRECTION.PREV, 2);
24350
24500
  case 18:
24351
24501
  appliedMessages = getCachedMessagesForResult(channel.id, updatedMessages);
24352
- _context28.n = 19;
24502
+ _context29.n = 19;
24353
24503
  return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true, false, false);
24354
24504
  case 19:
24355
- _context28.n = 20;
24505
+ _context29.n = 20;
24356
24506
  return effects.put(setMessagesHasPrevAC(true));
24357
24507
  case 20:
24358
- _context28.n = 21;
24508
+ _context29.n = 21;
24359
24509
  return effects.put(setMessagesHasNextAC(false));
24360
24510
  case 21:
24361
24511
  if (!(cachedMessages !== null && cachedMessages !== void 0 && cachedMessages.length && sameConfirmedWindow(cachedMessages, appliedMessages))) {
24362
- _context28.n = 25;
24512
+ _context29.n = 25;
24363
24513
  break;
24364
24514
  }
24365
24515
  changedMessages = getChangedActiveMessages(cachedMessages, appliedMessages);
24366
24516
  _iterator3 = _createForOfIteratorHelperLoose(changedMessages);
24367
24517
  case 22:
24368
24518
  if ((_step3 = _iterator3()).done) {
24369
- _context28.n = 24;
24519
+ _context29.n = 24;
24370
24520
  break;
24371
24521
  }
24372
24522
  message = _step3.value;
24373
- _context28.n = 23;
24523
+ _context29.n = 23;
24374
24524
  return effects.put(updateMessageAC(message.id, message));
24375
24525
  case 23:
24376
- _context28.n = 22;
24526
+ _context29.n = 22;
24377
24527
  break;
24378
24528
  case 24:
24379
- _context28.n = 26;
24529
+ _context29.n = 26;
24380
24530
  break;
24381
24531
  case 25:
24382
- _context28.n = 26;
24532
+ _context29.n = 26;
24383
24533
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(appliedMessages))));
24384
24534
  case 26:
24385
- _context28.n = 28;
24535
+ _context29.n = 28;
24386
24536
  break;
24387
24537
  case 27:
24388
24538
  if (!(!(cachedMessages !== null && cachedMessages !== void 0 && cachedMessages.length) && !((_result$messages = result.messages) !== null && _result$messages !== void 0 && _result$messages.length))) {
24389
- _context28.n = 28;
24539
+ _context29.n = 28;
24390
24540
  break;
24391
24541
  }
24392
- _context28.n = 28;
24542
+ _context29.n = 28;
24393
24543
  return effects.put(setMessagesAC([]));
24394
24544
  case 28:
24395
24545
  filteredPendingMessages = getFilteredPendingMessages(channel, appliedMessages, {
24396
24546
  isLatestWindow: true
24397
24547
  });
24398
- _context28.n = 29;
24548
+ _context29.n = 29;
24399
24549
  return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
24400
24550
  case 29:
24401
- _context28.n = 30;
24551
+ _context29.n = 30;
24402
24552
  return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true, false, false);
24403
24553
  case 30:
24404
24554
  waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
24405
24555
  if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
24406
- _context28.n = 32;
24556
+ _context29.n = 32;
24407
24557
  break;
24408
24558
  }
24409
- _context28.n = 31;
24559
+ _context29.n = 31;
24410
24560
  return effects.put(setWaitToSendPendingMessagesAC(false));
24411
24561
  case 31:
24412
- _context28.n = 32;
24562
+ _context29.n = 32;
24413
24563
  return effects.spawn(sendPendingMessages, connectionState);
24414
24564
  case 32:
24415
- _context28.n = 34;
24565
+ _context29.n = 34;
24416
24566
  break;
24417
24567
  case 33:
24418
- _context28.p = 33;
24419
- _t28 = _context28.v;
24568
+ _context29.p = 33;
24569
+ _t28 = _context29.v;
24420
24570
  log.error('error in loadDefaultMessages', _t28);
24421
24571
  case 34:
24422
- _context28.p = 34;
24423
- _context28.n = 35;
24572
+ _context29.p = 34;
24573
+ _context29.n = 35;
24424
24574
  return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADED);
24425
24575
  case 35:
24426
- return _context28.f(34);
24576
+ return _context29.f(34);
24427
24577
  case 36:
24428
- return _context28.a(2);
24578
+ return _context29.a(2);
24429
24579
  }
24430
- }, _marked22$1, null, [[0, 33, 34, 36]]);
24580
+ }, _marked23$1, null, [[0, 33, 34, 36]]);
24431
24581
  }
24432
24582
  function getMessagesQuery(action) {
24433
- var _action$payload5, channel, limit, networkChanged, _action$payload5$appl, applyVisibleWindow, channelNewMessageCount, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, result, appliedMessages, firstConfirmedMessageId, lastConfirmedMessageId, _channel$lastMessage0, cachedMessages, cacheIsCurrent, _firstConfirmedMessageId, _lastConfirmedMessageId, activeMessages, activeConfirmedMessages, sameVisibleWindow, filteredPendingMessages, activeById, changedMessages, waitToSendPendingMessages, _t29, _t30, _t31, _t32;
24434
- return _regenerator().w(function (_context29) {
24435
- while (1) switch (_context29.p = _context29.n) {
24583
+ var _action$payload6, channel, limit, networkChanged, _action$payload6$appl, applyVisibleWindow, channelNewMessageCount, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, result, appliedMessages, firstConfirmedMessageId, lastConfirmedMessageId, _channel$lastMessage1, cachedMessages, cacheIsCurrent, _firstConfirmedMessageId2, _lastConfirmedMessageId2, activeMessages, activeConfirmedMessages, sameVisibleWindow, filteredPendingMessages, activeById, changedMessages, waitToSendPendingMessages, _t29, _t30, _t31, _t32;
24584
+ return _regenerator().w(function (_context30) {
24585
+ while (1) switch (_context30.p = _context30.n) {
24436
24586
  case 0:
24437
- _context29.p = 0;
24438
- _context29.n = 1;
24587
+ _context30.p = 0;
24588
+ _context30.n = 1;
24439
24589
  return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADING);
24440
24590
  case 1:
24441
- _action$payload5 = action.payload, channel = _action$payload5.channel, limit = _action$payload5.limit, networkChanged = _action$payload5.networkChanged, _action$payload5$appl = _action$payload5.applyVisibleWindow, applyVisibleWindow = _action$payload5$appl === void 0 ? true : _action$payload5$appl;
24591
+ _action$payload6 = action.payload, channel = _action$payload6.channel, limit = _action$payload6.limit, networkChanged = _action$payload6.networkChanged, _action$payload6$appl = _action$payload6.applyVisibleWindow, applyVisibleWindow = _action$payload6$appl === void 0 ? true : _action$payload6$appl;
24442
24592
  channelNewMessageCount = (channel === null || channel === void 0 ? void 0 : channel.newMessageCount) || 0;
24443
24593
  connectionState = store.getState().UserReducer.connectionStatus;
24444
24594
  if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
24445
- _context29.n = 33;
24595
+ _context30.n = 33;
24446
24596
  break;
24447
24597
  }
24448
24598
  SceytChatClient = getClient();
24449
24599
  if (!networkChanged) {
24450
- _context29.n = 2;
24600
+ _context30.n = 2;
24451
24601
  break;
24452
24602
  }
24453
24603
  if (!channel.newMessageCount) {
24454
- _context29.n = 2;
24604
+ _context30.n = 2;
24455
24605
  break;
24456
24606
  }
24457
- _context29.n = 2;
24607
+ _context30.n = 2;
24458
24608
  return effects.put(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
24459
24609
  case 2:
24460
24610
  messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
24461
24611
  messageQueryBuilder.limit(limit || MESSAGES_MAX_LENGTH);
24462
24612
  messageQueryBuilder.reverse(true);
24463
24613
  if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
24464
- _context29.n = 4;
24614
+ _context30.n = 4;
24465
24615
  break;
24466
24616
  }
24467
- _context29.n = 3;
24617
+ _context30.n = 3;
24468
24618
  return effects.call(messageQueryBuilder.build);
24469
24619
  case 3:
24470
- _t29 = _context29.v;
24471
- _context29.n = 5;
24620
+ _t29 = _context30.v;
24621
+ _context30.n = 5;
24472
24622
  break;
24473
24623
  case 4:
24474
24624
  _t29 = null;
@@ -24481,23 +24631,23 @@ function getMessagesQuery(action) {
24481
24631
  };
24482
24632
  appliedMessages = [];
24483
24633
  if (!(!networkChanged && channelNewMessageCount && channelNewMessageCount > 0)) {
24484
- _context29.n = 17;
24634
+ _context30.n = 17;
24485
24635
  break;
24486
24636
  }
24487
24637
  messageQuery.limit = MESSAGES_MAX_LENGTH;
24488
24638
  if (!Number(channel.lastDisplayedMessageId)) {
24489
- _context29.n = 9;
24639
+ _context30.n = 9;
24490
24640
  break;
24491
24641
  }
24492
24642
  if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
24493
- _context29.n = 7;
24643
+ _context30.n = 7;
24494
24644
  break;
24495
24645
  }
24496
- _context29.n = 6;
24646
+ _context30.n = 6;
24497
24647
  return effects.call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
24498
24648
  case 6:
24499
- _t30 = _context29.v;
24500
- _context29.n = 8;
24649
+ _t30 = _context30.v;
24650
+ _context30.n = 8;
24501
24651
  break;
24502
24652
  case 7:
24503
24653
  _t30 = {
@@ -24506,18 +24656,18 @@ function getMessagesQuery(action) {
24506
24656
  };
24507
24657
  case 8:
24508
24658
  result = _t30;
24509
- _context29.n = 13;
24659
+ _context30.n = 13;
24510
24660
  break;
24511
24661
  case 9:
24512
24662
  if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
24513
- _context29.n = 11;
24663
+ _context30.n = 11;
24514
24664
  break;
24515
24665
  }
24516
- _context29.n = 10;
24666
+ _context30.n = 10;
24517
24667
  return effects.call(messageQuery.loadPrevious);
24518
24668
  case 10:
24519
- _t31 = _context29.v;
24520
- _context29.n = 12;
24669
+ _t31 = _context30.v;
24670
+ _context30.n = 12;
24521
24671
  break;
24522
24672
  case 11:
24523
24673
  _t31 = {
@@ -24527,10 +24677,10 @@ function getMessagesQuery(action) {
24527
24677
  case 12:
24528
24678
  result = _t31;
24529
24679
  case 13:
24530
- _context29.n = 14;
24680
+ _context30.n = 14;
24531
24681
  return effects.call(loadOGMetadataForLinkMessages, result.messages, true, false, false);
24532
24682
  case 14:
24533
- _context29.n = 15;
24683
+ _context30.n = 15;
24534
24684
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages)), channel.id));
24535
24685
  case 15:
24536
24686
  firstConfirmedMessageId = getFirstConfirmedMessageId(result.messages);
@@ -24540,52 +24690,52 @@ function getMessagesQuery(action) {
24540
24690
  setActiveSegment(channel.id, firstConfirmedMessageId, lastConfirmedMessageId);
24541
24691
  }
24542
24692
  appliedMessages = getCachedMessagesForResult(channel.id, result.messages);
24543
- _context29.n = 16;
24693
+ _context30.n = 16;
24544
24694
  return effects.put(setMessagesHasPrevAC(true));
24545
24695
  case 16:
24546
- _context29.n = 22;
24696
+ _context30.n = 22;
24547
24697
  break;
24548
24698
  case 17:
24549
24699
  cachedMessages = getLatestMessagesFromMap(channel.id, MESSAGES_MAX_PAGE_COUNT);
24550
- cacheIsCurrent = cachedMessages.length > 0 && getLastConfirmedMessageId(cachedMessages) === ((_channel$lastMessage0 = channel.lastMessage) === null || _channel$lastMessage0 === void 0 ? void 0 : _channel$lastMessage0.id);
24700
+ cacheIsCurrent = cachedMessages.length > 0 && getLastConfirmedMessageId(cachedMessages) === ((_channel$lastMessage1 = channel.lastMessage) === null || _channel$lastMessage1 === void 0 ? void 0 : _channel$lastMessage1.id);
24551
24701
  if (!cacheIsCurrent) {
24552
- _context29.n = 18;
24702
+ _context30.n = 18;
24553
24703
  break;
24554
24704
  }
24555
24705
  result.messages = cachedMessages;
24556
- _context29.n = 21;
24706
+ _context30.n = 21;
24557
24707
  break;
24558
24708
  case 18:
24559
24709
  if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
24560
- _context29.n = 20;
24710
+ _context30.n = 20;
24561
24711
  break;
24562
24712
  }
24563
24713
  messageQuery.limit = MESSAGES_MAX_LENGTH;
24564
- _context29.n = 19;
24714
+ _context30.n = 19;
24565
24715
  return effects.call(messageQuery.loadPrevious);
24566
24716
  case 19:
24567
- result = _context29.v;
24717
+ result = _context30.v;
24568
24718
  if (result.messages.length) {
24569
- _firstConfirmedMessageId = getFirstConfirmedMessageId(result.messages);
24570
- _lastConfirmedMessageId = getLastConfirmedMessageId(result.messages);
24571
- if (_firstConfirmedMessageId && _lastConfirmedMessageId) {
24572
- setMessagesToMap(channel.id, result.messages, _firstConfirmedMessageId, _lastConfirmedMessageId);
24573
- setActiveSegment(channel.id, _firstConfirmedMessageId, _lastConfirmedMessageId);
24719
+ _firstConfirmedMessageId2 = getFirstConfirmedMessageId(result.messages);
24720
+ _lastConfirmedMessageId2 = getLastConfirmedMessageId(result.messages);
24721
+ if (_firstConfirmedMessageId2 && _lastConfirmedMessageId2) {
24722
+ setMessagesToMap(channel.id, result.messages, _firstConfirmedMessageId2, _lastConfirmedMessageId2);
24723
+ setActiveSegment(channel.id, _firstConfirmedMessageId2, _lastConfirmedMessageId2);
24574
24724
  }
24575
24725
  }
24576
- _context29.n = 21;
24726
+ _context30.n = 21;
24577
24727
  break;
24578
24728
  case 20:
24579
24729
  result.messages = cachedMessages;
24580
24730
  case 21:
24581
24731
  appliedMessages = connectionState === CONNECTION_STATUS.CONNECTED ? getCachedMessagesForResult(channel.id, result.messages) : result.messages;
24582
- _context29.n = 22;
24732
+ _context30.n = 22;
24583
24733
  return effects.put(setMessagesHasPrevAC(true));
24584
24734
  case 22:
24585
24735
  if (!appliedMessages.length) {
24586
24736
  appliedMessages = result.messages;
24587
24737
  }
24588
- _context29.n = 23;
24738
+ _context30.n = 23;
24589
24739
  return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true, false, false);
24590
24740
  case 23:
24591
24741
  activeMessages = store.getState().MessageReducer.activeChannelMessages || [];
@@ -24594,29 +24744,29 @@ function getMessagesQuery(action) {
24594
24744
  });
24595
24745
  sameVisibleWindow = sameConfirmedWindow(activeConfirmedMessages, appliedMessages);
24596
24746
  if (!applyVisibleWindow) {
24597
- _context29.n = 28;
24747
+ _context30.n = 28;
24598
24748
  break;
24599
24749
  }
24600
- _context29.n = 24;
24750
+ _context30.n = 24;
24601
24751
  return effects.put(setMessagesAC(appliedMessages, channel.id));
24602
24752
  case 24:
24603
- _context29.n = 25;
24753
+ _context30.n = 25;
24604
24754
  return effects.put(setMessagesHasNextAC(false));
24605
24755
  case 25:
24606
24756
  filteredPendingMessages = getFilteredPendingMessages(channel, appliedMessages, {
24607
24757
  hasNext: false
24608
24758
  });
24609
- _context29.n = 26;
24759
+ _context30.n = 26;
24610
24760
  return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
24611
24761
  case 26:
24612
- _context29.n = 27;
24762
+ _context30.n = 27;
24613
24763
  return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true, false, false);
24614
24764
  case 27:
24615
- _context29.n = 30;
24765
+ _context30.n = 30;
24616
24766
  break;
24617
24767
  case 28:
24618
24768
  if (!sameVisibleWindow) {
24619
- _context29.n = 30;
24769
+ _context30.n = 30;
24620
24770
  break;
24621
24771
  }
24622
24772
  activeById = new Map(activeConfirmedMessages.map(function (currentMessage) {
@@ -24633,82 +24783,82 @@ function getMessagesQuery(action) {
24633
24783
  return JSON.stringify(existingMessage) !== JSON.stringify(loadedMessage);
24634
24784
  });
24635
24785
  if (!(changedMessages.length > 0)) {
24636
- _context29.n = 29;
24786
+ _context30.n = 29;
24637
24787
  break;
24638
24788
  }
24639
- _context29.n = 29;
24789
+ _context30.n = 29;
24640
24790
  return effects.put(patchMessagesAC(changedMessages));
24641
24791
  case 29:
24642
- _context29.n = 30;
24792
+ _context30.n = 30;
24643
24793
  return effects.put(setMessagesHasNextAC(false));
24644
24794
  case 30:
24645
24795
  waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
24646
24796
  if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
24647
- _context29.n = 32;
24797
+ _context30.n = 32;
24648
24798
  break;
24649
24799
  }
24650
- _context29.n = 31;
24800
+ _context30.n = 31;
24651
24801
  return effects.put(setWaitToSendPendingMessagesAC(false));
24652
24802
  case 31:
24653
- _context29.n = 32;
24803
+ _context30.n = 32;
24654
24804
  return effects.spawn(sendPendingMessages, connectionState);
24655
24805
  case 32:
24656
- _context29.n = 34;
24806
+ _context30.n = 34;
24657
24807
  break;
24658
24808
  case 33:
24659
24809
  if (!(channel !== null && channel !== void 0 && channel.isMockChannel)) {
24660
- _context29.n = 34;
24810
+ _context30.n = 34;
24661
24811
  break;
24662
24812
  }
24663
- _context29.n = 34;
24813
+ _context30.n = 34;
24664
24814
  return effects.put(setMessagesAC([]));
24665
24815
  case 34:
24666
- _context29.n = 36;
24816
+ _context30.n = 36;
24667
24817
  break;
24668
24818
  case 35:
24669
- _context29.p = 35;
24670
- _t32 = _context29.v;
24819
+ _context30.p = 35;
24820
+ _t32 = _context30.v;
24671
24821
  log.error('error in message query', _t32);
24672
24822
  case 36:
24673
- _context29.p = 36;
24674
- _context29.n = 37;
24823
+ _context30.p = 36;
24824
+ _context30.n = 37;
24675
24825
  return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADED);
24676
24826
  case 37:
24677
- return _context29.f(36);
24827
+ return _context30.f(36);
24678
24828
  case 38:
24679
- return _context29.a(2);
24829
+ return _context30.a(2);
24680
24830
  }
24681
- }, _marked23$1, null, [[0, 35, 36, 38]]);
24831
+ }, _marked24$1, null, [[0, 35, 36, 38]]);
24682
24832
  }
24683
24833
  function getMessageQuery(action) {
24684
24834
  var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage, _t33;
24685
- return _regenerator().w(function (_context30) {
24686
- while (1) switch (_context30.p = _context30.n) {
24835
+ return _regenerator().w(function (_context31) {
24836
+ while (1) switch (_context31.p = _context31.n) {
24687
24837
  case 0:
24688
- _context30.p = 0;
24838
+ _context31.p = 0;
24689
24839
  payload = action.payload;
24690
24840
  channelId = payload.channelId, messageId = payload.messageId;
24691
- _context30.n = 1;
24841
+ _context31.n = 1;
24692
24842
  return effects.call(getChannelFromAllChannels, channelId);
24693
24843
  case 1:
24694
- channel = _context30.v;
24844
+ channel = _context31.v;
24695
24845
  connectionState = store.getState().UserReducer.connectionStatus;
24696
24846
  if (!(!channel || connectionState !== CONNECTION_STATUS.CONNECTED)) {
24697
- _context30.n = 2;
24847
+ _context31.n = 2;
24698
24848
  break;
24699
24849
  }
24700
- return _context30.a(2);
24850
+ return _context31.a(2);
24701
24851
  case 2:
24702
- _context30.n = 3;
24852
+ _context31.n = 3;
24703
24853
  return effects.call(channel.getMessagesById, [messageId]);
24704
24854
  case 3:
24705
- messages = _context30.v;
24855
+ messages = _context31.v;
24706
24856
  fetchedMessage = messages && messages[0] ? JSON.parse(JSON.stringify(messages[0])) : null;
24707
24857
  if (!fetchedMessage) {
24708
- _context30.n = 5;
24858
+ _context31.n = 5;
24709
24859
  break;
24710
24860
  }
24711
- _context30.n = 4;
24861
+ _context31.n = 4;
24712
24862
  return effects.put(updateMessageAC(messageId, fetchedMessage));
24713
24863
  case 4:
24714
24864
  updateMessageOnMap(channel.id, {
@@ -24716,39 +24866,39 @@ function getMessageQuery(action) {
24716
24866
  params: fetchedMessage
24717
24867
  });
24718
24868
  if (!(channel.lastMessage && channel.lastMessage.id === messageId)) {
24719
- _context30.n = 5;
24869
+ _context31.n = 5;
24720
24870
  break;
24721
24871
  }
24722
24872
  updateChannelLastMessageOnAllChannels(channel.id, fetchedMessage);
24723
- _context30.n = 5;
24873
+ _context31.n = 5;
24724
24874
  return effects.put(updateChannelLastMessageAC(fetchedMessage, channel));
24725
24875
  case 5:
24726
- _context30.n = 7;
24876
+ _context31.n = 7;
24727
24877
  break;
24728
24878
  case 6:
24729
- _context30.p = 6;
24730
- _t33 = _context30.v;
24879
+ _context31.p = 6;
24880
+ _t33 = _context31.v;
24731
24881
  log.error('error in message query', _t33);
24732
24882
  case 7:
24733
- return _context30.a(2);
24883
+ return _context31.a(2);
24734
24884
  }
24735
- }, _marked24$1, null, [[0, 6]]);
24885
+ }, _marked25$1, null, [[0, 6]]);
24736
24886
  }
24737
24887
  function prefetchMessages(channelId, fromMessageId, direction, pages) {
24738
24888
  var key, SceytChatClient, request, currentFromId, i, cached, mqb, mq, result, _cached, _mqb, _mq, _result, _t34;
24739
- return _regenerator().w(function (_context31) {
24740
- while (1) switch (_context31.p = _context31.n) {
24889
+ return _regenerator().w(function (_context32) {
24890
+ while (1) switch (_context32.p = _context32.n) {
24741
24891
  case 0:
24742
24892
  key = channelId + ":" + direction;
24743
24893
  if (!prefetchInFlight.has(key)) {
24744
- _context31.n = 1;
24894
+ _context32.n = 1;
24745
24895
  break;
24746
24896
  }
24747
24897
  queuePrefetchRequest(key, direction, fromMessageId, pages);
24748
- return _context31.a(2);
24898
+ return _context32.a(2);
24749
24899
  case 1:
24750
24900
  prefetchInFlight.add(key);
24751
- _context31.p = 2;
24901
+ _context32.p = 2;
24752
24902
  SceytChatClient = getClient();
24753
24903
  request = {
24754
24904
  fromMessageId: fromMessageId,
@@ -24756,170 +24906,170 @@ function prefetchMessages(channelId, fromMessageId, direction, pages) {
24756
24906
  };
24757
24907
  case 3:
24758
24908
  if (!request) {
24759
- _context31.n = 19;
24909
+ _context32.n = 19;
24760
24910
  break;
24761
24911
  }
24762
24912
  currentFromId = request.fromMessageId;
24763
24913
  i = 0;
24764
24914
  case 4:
24765
24915
  if (!(i < request.pages)) {
24766
- _context31.n = 18;
24916
+ _context32.n = 18;
24767
24917
  break;
24768
24918
  }
24769
24919
  if (!(direction === MESSAGE_LOAD_DIRECTION.PREV)) {
24770
- _context31.n = 11;
24920
+ _context32.n = 11;
24771
24921
  break;
24772
24922
  }
24773
24923
  if (!hasPrevContiguousInMap(channelId, {
24774
24924
  id: currentFromId
24775
24925
  })) {
24776
- _context31.n = 5;
24926
+ _context32.n = 5;
24777
24927
  break;
24778
24928
  }
24779
24929
  cached = getContiguousPrevMessages(channelId, {
24780
24930
  id: currentFromId
24781
24931
  }, LOAD_MAX_MESSAGE_COUNT_PREFETCH);
24782
24932
  if (!(cached.length > 0)) {
24783
- _context31.n = 5;
24933
+ _context32.n = 5;
24784
24934
  break;
24785
24935
  }
24786
24936
  currentFromId = cached[0].id;
24787
- return _context31.a(3, 17);
24937
+ return _context32.a(3, 17);
24788
24938
  case 5:
24789
24939
  mqb = new SceytChatClient.MessageListQueryBuilder(channelId);
24790
24940
  mqb.limit(LOAD_MAX_MESSAGE_COUNT_PREFETCH);
24791
24941
  mqb.reverse(true);
24792
- _context31.n = 6;
24942
+ _context32.n = 6;
24793
24943
  return effects.call(mqb.build);
24794
24944
  case 6:
24795
- mq = _context31.v;
24796
- _context31.n = 7;
24945
+ mq = _context32.v;
24946
+ _context32.n = 7;
24797
24947
  return effects.call(mq.loadPreviousMessageId, currentFromId);
24798
24948
  case 7:
24799
- result = _context31.v;
24949
+ result = _context32.v;
24800
24950
  if (result.messages.length) {
24801
- _context31.n = 8;
24951
+ _context32.n = 8;
24802
24952
  break;
24803
24953
  }
24804
- return _context31.a(3, 18);
24954
+ return _context32.a(3, 18);
24805
24955
  case 8:
24806
24956
  setMessagesToMap(channelId, result.messages, result.messages[0].id, result.messages[result.messages.length - 1].id);
24807
24957
  extendActiveSegment(channelId, result.messages[0].id, result.messages[result.messages.length - 1].id, MESSAGE_LOAD_DIRECTION.PREV);
24808
- _context31.n = 9;
24958
+ _context32.n = 9;
24809
24959
  return effects.call(patchActiveMessagesFromCacheRange, channelId, result.messages[0].id, result.messages[result.messages.length - 1].id);
24810
24960
  case 9:
24811
24961
  currentFromId = result.messages[0].id;
24812
24962
  if (result.hasNext) {
24813
- _context31.n = 10;
24963
+ _context32.n = 10;
24814
24964
  break;
24815
24965
  }
24816
- return _context31.a(3, 18);
24966
+ return _context32.a(3, 18);
24817
24967
  case 10:
24818
- _context31.n = 17;
24968
+ _context32.n = 17;
24819
24969
  break;
24820
24970
  case 11:
24821
24971
  if (!hasNextContiguousInMap(channelId, {
24822
24972
  id: currentFromId
24823
24973
  })) {
24824
- _context31.n = 12;
24974
+ _context32.n = 12;
24825
24975
  break;
24826
24976
  }
24827
24977
  _cached = getContiguousNextMessages(channelId, {
24828
24978
  id: currentFromId
24829
24979
  }, LOAD_MAX_MESSAGE_COUNT_PREFETCH);
24830
24980
  if (!(_cached.length > 0)) {
24831
- _context31.n = 12;
24981
+ _context32.n = 12;
24832
24982
  break;
24833
24983
  }
24834
24984
  currentFromId = _cached[_cached.length - 1].id;
24835
- return _context31.a(3, 17);
24985
+ return _context32.a(3, 17);
24836
24986
  case 12:
24837
24987
  _mqb = new SceytChatClient.MessageListQueryBuilder(channelId);
24838
24988
  _mqb.limit(LOAD_MAX_MESSAGE_COUNT_PREFETCH);
24839
24989
  _mqb.reverse(false);
24840
- _context31.n = 13;
24990
+ _context32.n = 13;
24841
24991
  return effects.call(_mqb.build);
24842
24992
  case 13:
24843
- _mq = _context31.v;
24844
- _context31.n = 14;
24993
+ _mq = _context32.v;
24994
+ _context32.n = 14;
24845
24995
  return effects.call(_mq.loadNextMessageId, currentFromId);
24846
24996
  case 14:
24847
- _result = _context31.v;
24997
+ _result = _context32.v;
24848
24998
  if (_result.messages.length) {
24849
- _context31.n = 15;
24999
+ _context32.n = 15;
24850
25000
  break;
24851
25001
  }
24852
- return _context31.a(3, 18);
25002
+ return _context32.a(3, 18);
24853
25003
  case 15:
24854
25004
  setMessagesToMap(channelId, _result.messages, _result.messages[0].id, _result.messages[_result.messages.length - 1].id);
24855
25005
  extendActiveSegment(channelId, _result.messages[0].id, _result.messages[_result.messages.length - 1].id, MESSAGE_LOAD_DIRECTION.NEXT);
24856
- _context31.n = 16;
25006
+ _context32.n = 16;
24857
25007
  return effects.call(patchActiveMessagesFromCacheRange, channelId, _result.messages[0].id, _result.messages[_result.messages.length - 1].id);
24858
25008
  case 16:
24859
25009
  currentFromId = _result.messages[_result.messages.length - 1].id;
24860
25010
  if (_result.hasNext) {
24861
- _context31.n = 17;
25011
+ _context32.n = 17;
24862
25012
  break;
24863
25013
  }
24864
- return _context31.a(3, 18);
25014
+ return _context32.a(3, 18);
24865
25015
  case 17:
24866
25016
  i++;
24867
- _context31.n = 4;
25017
+ _context32.n = 4;
24868
25018
  break;
24869
25019
  case 18:
24870
25020
  request = queuedPrefetchRequests.get(key) || null;
24871
25021
  if (request) {
24872
25022
  queuedPrefetchRequests["delete"](key);
24873
25023
  }
24874
- _context31.n = 3;
25024
+ _context32.n = 3;
24875
25025
  break;
24876
25026
  case 19:
24877
- _context31.n = 21;
25027
+ _context32.n = 21;
24878
25028
  break;
24879
25029
  case 20:
24880
- _context31.p = 20;
24881
- _t34 = _context31.v;
25030
+ _context32.p = 20;
25031
+ _t34 = _context32.v;
24882
25032
  log.error('[PREFETCH] prefetchMessages error:', _t34);
24883
25033
  case 21:
24884
- _context31.p = 21;
25034
+ _context32.p = 21;
24885
25035
  queuedPrefetchRequests["delete"](key);
24886
25036
  prefetchInFlight["delete"](key);
24887
25037
  notifyPrefetchCompletion(key);
24888
- return _context31.f(21);
25038
+ return _context32.f(21);
24889
25039
  case 22:
24890
- return _context31.a(2);
25040
+ return _context32.a(2);
24891
25041
  }
24892
- }, _marked25$1, null, [[2, 20, 21, 22]]);
25042
+ }, _marked26$1, null, [[2, 20, 21, 22]]);
24893
25043
  }
24894
25044
  function loadMoreMessages(action) {
24895
25045
  var acquiredLock, loadingScope, payload, limit, direction, channelId, messageId, hasNext, requestId, inFlightKey, SceytChatClient, messageQueryBuilder, messageQuery, connectionState, result, reachedLatestConfirmedEdge, nextHasPrevState, nextHasNextState, currentConfirmedMessages, prefetchKey, mapCached, aheadCached, pagesToFetch, fromId, _result$messages$, _result$messages2, nextWindowConfirmedCount, _mapCached, lastConfirmedMsg, lastConfirmedId, _aheadCached, confirmedAheadCount, hasCachedNext, canLoadServerNext, _pagesToFetch, _reverse$find, lastAheadConfirmedId, _fromId, _result$messages$2, _result$messages3, shouldApplyVisibleResult, filteredPendingMessages, _t35;
24896
- return _regenerator().w(function (_context32) {
24897
- while (1) switch (_context32.p = _context32.n) {
25046
+ return _regenerator().w(function (_context33) {
25047
+ while (1) switch (_context33.p = _context33.n) {
24898
25048
  case 0:
24899
25049
  acquiredLock = false;
24900
25050
  loadingScope = 'both';
24901
- _context32.p = 1;
25051
+ _context33.p = 1;
24902
25052
  payload = action.payload;
24903
25053
  limit = payload.limit, direction = payload.direction, channelId = payload.channelId, messageId = payload.messageId, hasNext = payload.hasNext, requestId = payload.requestId;
24904
25054
  inFlightKey = getLoadMoreInFlightKey(channelId, direction);
24905
25055
  if (!loadMoreMessagesInFlight.has(inFlightKey)) {
24906
- _context32.n = 2;
25056
+ _context33.n = 2;
24907
25057
  break;
24908
25058
  }
24909
- return _context32.a(2);
25059
+ return _context33.a(2);
24910
25060
  case 2:
24911
25061
  loadMoreMessagesInFlight.add(inFlightKey);
24912
25062
  acquiredLock = true;
24913
25063
  SceytChatClient = getClient();
24914
25064
  messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channelId);
24915
25065
  messageQueryBuilder.reverse(true);
24916
- _context32.n = 3;
25066
+ _context33.n = 3;
24917
25067
  return effects.call(messageQueryBuilder.build);
24918
25068
  case 3:
24919
- messageQuery = _context32.v;
25069
+ messageQuery = _context33.v;
24920
25070
  messageQuery.limit = 20;
24921
25071
  loadingScope = direction === MESSAGE_LOAD_DIRECTION.PREV ? 'previous' : 'next';
24922
- _context32.n = 4;
25072
+ _context33.n = 4;
24923
25073
  return effects.call(setMessageListLoading, loadingScope, LOADING_STATE.LOADING);
24924
25074
  case 4:
24925
25075
  connectionState = store.getState().UserReducer.connectionStatus;
@@ -24933,17 +25083,17 @@ function loadMoreMessages(action) {
24933
25083
  });
24934
25084
  prefetchKey = channelId + ":" + direction;
24935
25085
  if (!(direction === MESSAGE_LOAD_DIRECTION.PREV)) {
24936
- _context32.n = 14;
25086
+ _context33.n = 14;
24937
25087
  break;
24938
25088
  }
24939
25089
  mapCached = getContiguousPrevMessages(channelId, {
24940
25090
  id: messageId
24941
25091
  }, limit || 30);
24942
25092
  if (!(!mapCached.length && hasNext && prefetchInFlight.has(prefetchKey))) {
24943
- _context32.n = 6;
25093
+ _context33.n = 6;
24944
25094
  break;
24945
25095
  }
24946
- _context32.n = 5;
25096
+ _context33.n = 5;
24947
25097
  return effects.call(waitForPrefetchCompletion, prefetchKey);
24948
25098
  case 5:
24949
25099
  mapCached = getContiguousPrevMessages(channelId, {
@@ -24951,7 +25101,7 @@ function loadMoreMessages(action) {
24951
25101
  }, limit || 30);
24952
25102
  case 6:
24953
25103
  if (!(mapCached.length > 0)) {
24954
- _context32.n = 8;
25104
+ _context33.n = 8;
24955
25105
  break;
24956
25106
  }
24957
25107
  result.messages = mapCached;
@@ -24959,39 +25109,39 @@ function loadMoreMessages(action) {
24959
25109
  nextHasPrevState = aheadCached.length > 0 || hasNext;
24960
25110
  pagesToFetch = 2 - Math.floor(aheadCached.length / LOAD_MAX_MESSAGE_COUNT_PREFETCH);
24961
25111
  if (!(pagesToFetch > 0 && hasNext)) {
24962
- _context32.n = 7;
25112
+ _context33.n = 7;
24963
25113
  break;
24964
25114
  }
24965
25115
  fromId = aheadCached.length > 0 ? aheadCached[0].id : mapCached[0].id;
24966
- _context32.n = 7;
25116
+ _context33.n = 7;
24967
25117
  return effects.spawn(prefetchMessages, channelId, fromId, MESSAGE_LOAD_DIRECTION.PREV, pagesToFetch);
24968
25118
  case 7:
24969
- _context32.n = 13;
25119
+ _context33.n = 13;
24970
25120
  break;
24971
25121
  case 8:
24972
25122
  if (!hasNext) {
24973
- _context32.n = 13;
25123
+ _context33.n = 13;
24974
25124
  break;
24975
25125
  }
24976
25126
  if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
24977
- _context32.n = 9;
25127
+ _context33.n = 9;
24978
25128
  break;
24979
25129
  }
24980
25130
  loadMoreMessagesInFlight["delete"](getLoadMoreInFlightKey(action.payload.channelId, action.payload.direction));
24981
25131
  store.dispatch(setLoadingPrevMessagesStateAC(LOADING_STATE.LOADED));
24982
- return _context32.a(2);
25132
+ return _context33.a(2);
24983
25133
  case 9:
24984
- _context32.n = 10;
25134
+ _context33.n = 10;
24985
25135
  return effects.call(messageQuery.loadPreviousMessageId, messageId);
24986
25136
  case 10:
24987
- result = _context32.v;
25137
+ result = _context33.v;
24988
25138
  if (!result.messages.length) {
24989
- _context32.n = 12;
25139
+ _context33.n = 12;
24990
25140
  break;
24991
25141
  }
24992
25142
  setMessagesToMap(channelId, result.messages, (_result$messages$ = result.messages[0]) === null || _result$messages$ === void 0 ? void 0 : _result$messages$.id, (_result$messages2 = result.messages[result.messages.length - 1]) === null || _result$messages2 === void 0 ? void 0 : _result$messages2.id);
24993
25143
  extendActiveSegment(channelId, result.messages[0].id, result.messages[result.messages.length - 1].id, MESSAGE_LOAD_DIRECTION.PREV);
24994
- _context32.n = 11;
25144
+ _context33.n = 11;
24995
25145
  return effects.spawn(prefetchMessages, channelId, result.messages[0].id, MESSAGE_LOAD_DIRECTION.PREV, 2);
24996
25146
  case 11:
24997
25147
  result.messages = getContiguousPrevMessages(channelId, {
@@ -25006,17 +25156,17 @@ function loadMoreMessages(action) {
25006
25156
  if (nextWindowConfirmedCount > MESSAGES_MAX_PAGE_COUNT) {
25007
25157
  nextHasNextState = true;
25008
25158
  }
25009
- _context32.n = 25;
25159
+ _context33.n = 25;
25010
25160
  break;
25011
25161
  case 14:
25012
25162
  _mapCached = getContiguousNextMessages(channelId, {
25013
25163
  id: messageId
25014
25164
  }, limit || 30);
25015
25165
  if (!(!_mapCached.length && hasNext && prefetchInFlight.has(prefetchKey))) {
25016
- _context32.n = 16;
25166
+ _context33.n = 16;
25017
25167
  break;
25018
25168
  }
25019
- _context32.n = 15;
25169
+ _context33.n = 15;
25020
25170
  return effects.call(waitForPrefetchCompletion, prefetchKey);
25021
25171
  case 15:
25022
25172
  _mapCached = getContiguousNextMessages(channelId, {
@@ -25024,7 +25174,7 @@ function loadMoreMessages(action) {
25024
25174
  }, limit || 30);
25025
25175
  case 16:
25026
25176
  if (!(_mapCached.length > 0)) {
25027
- _context32.n = 18;
25177
+ _context33.n = 18;
25028
25178
  break;
25029
25179
  }
25030
25180
  result.messages = _mapCached;
@@ -25042,7 +25192,7 @@ function loadMoreMessages(action) {
25042
25192
  nextHasNextState = hasCachedNext || canLoadServerNext;
25043
25193
  _pagesToFetch = 2 - Math.floor(confirmedAheadCount / LOAD_MAX_MESSAGE_COUNT_PREFETCH);
25044
25194
  if (!(_pagesToFetch > 0 && hasNext)) {
25045
- _context32.n = 17;
25195
+ _context33.n = 17;
25046
25196
  break;
25047
25197
  }
25048
25198
  lastAheadConfirmedId = (_reverse$find = [].concat(_aheadCached).reverse().find(function (m) {
@@ -25050,39 +25200,39 @@ function loadMoreMessages(action) {
25050
25200
  })) === null || _reverse$find === void 0 ? void 0 : _reverse$find.id;
25051
25201
  _fromId = lastAheadConfirmedId || lastConfirmedId;
25052
25202
  if (!_fromId) {
25053
- _context32.n = 17;
25203
+ _context33.n = 17;
25054
25204
  break;
25055
25205
  }
25056
- _context32.n = 17;
25206
+ _context33.n = 17;
25057
25207
  return effects.spawn(prefetchMessages, channelId, _fromId, MESSAGE_LOAD_DIRECTION.NEXT, _pagesToFetch);
25058
25208
  case 17:
25059
- _context32.n = 24;
25209
+ _context33.n = 24;
25060
25210
  break;
25061
25211
  case 18:
25062
25212
  if (!hasNext) {
25063
- _context32.n = 23;
25213
+ _context33.n = 23;
25064
25214
  break;
25065
25215
  }
25066
25216
  messageQuery.reverse = false;
25067
25217
  if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
25068
- _context32.n = 19;
25218
+ _context33.n = 19;
25069
25219
  break;
25070
25220
  }
25071
25221
  loadMoreMessagesInFlight["delete"](getLoadMoreInFlightKey(action.payload.channelId, action.payload.direction));
25072
25222
  store.dispatch(setLoadingNextMessagesStateAC(LOADING_STATE.LOADED));
25073
- return _context32.a(2);
25223
+ return _context33.a(2);
25074
25224
  case 19:
25075
- _context32.n = 20;
25225
+ _context33.n = 20;
25076
25226
  return effects.call(messageQuery.loadNextMessageId, messageId);
25077
25227
  case 20:
25078
- result = _context32.v;
25228
+ result = _context33.v;
25079
25229
  if (!result.messages.length) {
25080
- _context32.n = 22;
25230
+ _context33.n = 22;
25081
25231
  break;
25082
25232
  }
25083
25233
  setMessagesToMap(channelId, result.messages, (_result$messages$2 = result.messages[0]) === null || _result$messages$2 === void 0 ? void 0 : _result$messages$2.id, (_result$messages3 = result.messages[result.messages.length - 1]) === null || _result$messages3 === void 0 ? void 0 : _result$messages3.id);
25084
25234
  extendActiveSegment(channelId, result.messages[0].id, result.messages[result.messages.length - 1].id, MESSAGE_LOAD_DIRECTION.NEXT);
25085
- _context32.n = 21;
25235
+ _context33.n = 21;
25086
25236
  return effects.spawn(prefetchMessages, channelId, result.messages[result.messages.length - 1].id, MESSAGE_LOAD_DIRECTION.NEXT, 2);
25087
25237
  case 21:
25088
25238
  result.messages = getContiguousNextMessages(channelId, {
@@ -25091,7 +25241,7 @@ function loadMoreMessages(action) {
25091
25241
  case 22:
25092
25242
  reachedLatestConfirmedEdge = !result.hasNext;
25093
25243
  nextHasNextState = result.hasNext;
25094
- _context32.n = 24;
25244
+ _context33.n = 24;
25095
25245
  break;
25096
25246
  case 23:
25097
25247
  reachedLatestConfirmedEdge = true;
@@ -25101,64 +25251,64 @@ function loadMoreMessages(action) {
25101
25251
  case 25:
25102
25252
  shouldApplyVisibleResult = isCurrentPaginationIntent(channelId, direction === MESSAGE_LOAD_DIRECTION.PREV ? 'prev' : 'next', requestId);
25103
25253
  if (!(shouldApplyVisibleResult && nextHasPrevState !== undefined)) {
25104
- _context32.n = 26;
25254
+ _context33.n = 26;
25105
25255
  break;
25106
25256
  }
25107
- _context32.n = 26;
25257
+ _context33.n = 26;
25108
25258
  return effects.put(setMessagesHasPrevAC(nextHasPrevState));
25109
25259
  case 26:
25110
25260
  if (!(shouldApplyVisibleResult && nextHasNextState !== undefined)) {
25111
- _context32.n = 27;
25261
+ _context33.n = 27;
25112
25262
  break;
25113
25263
  }
25114
- _context32.n = 27;
25264
+ _context33.n = 27;
25115
25265
  return effects.put(setMessagesHasNextAC(nextHasNextState));
25116
25266
  case 27:
25117
25267
  if (!(shouldApplyVisibleResult && result.messages && result.messages.length && result.messages.length > 0)) {
25118
- _context32.n = 30;
25268
+ _context33.n = 30;
25119
25269
  break;
25120
25270
  }
25121
- _context32.n = 28;
25271
+ _context33.n = 28;
25122
25272
  return effects.call(loadOGMetadataForLinkMessages, result.messages, true, false, false);
25123
25273
  case 28:
25124
- _context32.n = 29;
25274
+ _context33.n = 29;
25125
25275
  return effects.put(addMessagesAC(JSON.parse(JSON.stringify(result.messages)), direction));
25126
25276
  case 29:
25127
- _context32.n = 31;
25277
+ _context33.n = 31;
25128
25278
  break;
25129
25279
  case 30:
25130
25280
  if (!shouldApplyVisibleResult) {
25131
- _context32.n = 31;
25281
+ _context33.n = 31;
25132
25282
  break;
25133
25283
  }
25134
- _context32.n = 31;
25284
+ _context33.n = 31;
25135
25285
  return effects.put(addMessagesAC([], direction));
25136
25286
  case 31:
25137
25287
  if (!(shouldApplyVisibleResult && direction === MESSAGE_LOAD_DIRECTION.NEXT && reachedLatestConfirmedEdge)) {
25138
- _context32.n = 33;
25288
+ _context33.n = 33;
25139
25289
  break;
25140
25290
  }
25141
25291
  filteredPendingMessages = getFilteredPendingMessages(channelId, result.messages, {
25142
25292
  hasNext: false
25143
25293
  });
25144
25294
  if (!filteredPendingMessages.length) {
25145
- _context32.n = 33;
25295
+ _context33.n = 33;
25146
25296
  break;
25147
25297
  }
25148
- _context32.n = 32;
25298
+ _context33.n = 32;
25149
25299
  return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
25150
25300
  case 32:
25151
- _context32.n = 33;
25301
+ _context33.n = 33;
25152
25302
  return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true, false, false);
25153
25303
  case 33:
25154
- _context32.n = 35;
25304
+ _context33.n = 35;
25155
25305
  break;
25156
25306
  case 34:
25157
- _context32.p = 34;
25158
- _t35 = _context32.v;
25307
+ _context33.p = 34;
25308
+ _t35 = _context33.v;
25159
25309
  log.error('[MESSAGE_LIST] loadMoreMessages ERROR:', _t35 === null || _t35 === void 0 ? void 0 : _t35.type);
25160
25310
  case 35:
25161
- _context32.p = 35;
25311
+ _context33.p = 35;
25162
25312
  if (acquiredLock) {
25163
25313
  loadMoreMessagesInFlight["delete"](getLoadMoreInFlightKey(action.payload.channelId, action.payload.direction));
25164
25314
  if (loadingScope === 'previous') {
@@ -25167,39 +25317,39 @@ function loadMoreMessages(action) {
25167
25317
  store.dispatch(setLoadingNextMessagesStateAC(LOADING_STATE.LOADED));
25168
25318
  }
25169
25319
  }
25170
- return _context32.f(35);
25320
+ return _context33.f(35);
25171
25321
  case 36:
25172
- return _context32.a(2);
25322
+ return _context33.a(2);
25173
25323
  }
25174
- }, _marked26$1, null, [[1, 34, 35, 36]]);
25324
+ }, _marked27$1, null, [[1, 34, 35, 36]]);
25175
25325
  }
25176
25326
  function addReaction(action) {
25177
25327
  var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam, _t36;
25178
- return _regenerator().w(function (_context33) {
25179
- while (1) switch (_context33.p = _context33.n) {
25328
+ return _regenerator().w(function (_context34) {
25329
+ while (1) switch (_context34.p = _context34.n) {
25180
25330
  case 0:
25181
- _context33.p = 0;
25331
+ _context34.p = 0;
25182
25332
  payload = action.payload;
25183
25333
  channelId = payload.channelId, messageId = payload.messageId, key = payload.key, score = payload.score, reason = payload.reason, enforceUnique = payload.enforceUnique;
25184
25334
  user = getClient().user;
25185
- _context33.n = 1;
25335
+ _context34.n = 1;
25186
25336
  return effects.call(getChannelFromMap, channelId);
25187
25337
  case 1:
25188
- channel = _context33.v;
25338
+ channel = _context34.v;
25189
25339
  if (!channel) {
25190
25340
  channel = getChannelFromAllChannels(channelId);
25191
25341
  if (channel) {
25192
25342
  setChannelInMap(channel);
25193
25343
  }
25194
25344
  }
25195
- _context33.n = 2;
25345
+ _context34.n = 2;
25196
25346
  return effects.call(channel.addReaction, messageId, key, score, reason, enforceUnique);
25197
25347
  case 2:
25198
- _yield$call = _context33.v;
25348
+ _yield$call = _context34.v;
25199
25349
  message = _yield$call.message;
25200
25350
  reaction = _yield$call.reaction;
25201
25351
  if (!(user.id === message.user.id)) {
25202
- _context33.n = 4;
25352
+ _context34.n = 4;
25203
25353
  break;
25204
25354
  }
25205
25355
  channelUpdateParam = {
@@ -25207,97 +25357,97 @@ function addReaction(action) {
25207
25357
  lastReactedMessage: message,
25208
25358
  newReactions: [reaction]
25209
25359
  };
25210
- _context33.n = 3;
25360
+ _context34.n = 3;
25211
25361
  return effects.put(updateChannelDataAC(channel.id, channelUpdateParam));
25212
25362
  case 3:
25213
25363
  updateChannelOnAllChannels(channel.id, channelUpdateParam);
25214
25364
  case 4:
25215
- _context33.n = 5;
25365
+ _context34.n = 5;
25216
25366
  return effects.put(addChannelAC(JSON.parse(JSON.stringify(channel))));
25217
25367
  case 5:
25218
- _context33.n = 6;
25368
+ _context34.n = 6;
25219
25369
  return effects.put(addReactionToListAC(reaction));
25220
25370
  case 6:
25221
- _context33.n = 7;
25371
+ _context34.n = 7;
25222
25372
  return effects.put(addReactionToMessageAC(message, reaction, true));
25223
25373
  case 7:
25224
25374
  addReactionToMessageOnMap(channelId, message, reaction, true);
25225
- _context33.n = 9;
25375
+ _context34.n = 9;
25226
25376
  break;
25227
25377
  case 8:
25228
- _context33.p = 8;
25229
- _t36 = _context33.v;
25378
+ _context34.p = 8;
25379
+ _t36 = _context34.v;
25230
25380
  log.error('ERROR in add reaction', _t36.message);
25231
25381
  case 9:
25232
- return _context33.a(2);
25382
+ return _context34.a(2);
25233
25383
  }
25234
- }, _marked27$1, null, [[0, 8]]);
25384
+ }, _marked28$1, null, [[0, 8]]);
25235
25385
  }
25236
25386
  function deleteReaction(action) {
25237
25387
  var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam, _t37;
25238
- return _regenerator().w(function (_context34) {
25239
- while (1) switch (_context34.p = _context34.n) {
25388
+ return _regenerator().w(function (_context35) {
25389
+ while (1) switch (_context35.p = _context35.n) {
25240
25390
  case 0:
25241
- _context34.p = 0;
25391
+ _context35.p = 0;
25242
25392
  payload = action.payload;
25243
25393
  channelId = payload.channelId, messageId = payload.messageId, key = payload.key, isLastReaction = payload.isLastReaction;
25244
- _context34.n = 1;
25394
+ _context35.n = 1;
25245
25395
  return effects.call(getChannelFromMap, channelId);
25246
25396
  case 1:
25247
- channel = _context34.v;
25397
+ channel = _context35.v;
25248
25398
  if (!channel) {
25249
25399
  channel = getChannelFromAllChannels(channelId);
25250
25400
  if (channel) {
25251
25401
  setChannelInMap(channel);
25252
25402
  }
25253
25403
  }
25254
- _context34.n = 2;
25404
+ _context35.n = 2;
25255
25405
  return effects.call(channel.deleteReaction, messageId, key);
25256
25406
  case 2:
25257
- _yield$call2 = _context34.v;
25407
+ _yield$call2 = _context35.v;
25258
25408
  message = _yield$call2.message;
25259
25409
  reaction = _yield$call2.reaction;
25260
25410
  if (!isLastReaction) {
25261
- _context34.n = 4;
25411
+ _context35.n = 4;
25262
25412
  break;
25263
25413
  }
25264
25414
  channelUpdateParam = {
25265
25415
  userMessageReactions: [],
25266
25416
  lastReactedMessage: null
25267
25417
  };
25268
- _context34.n = 3;
25418
+ _context35.n = 3;
25269
25419
  return effects.put(updateChannelDataAC(channel.id, channelUpdateParam));
25270
25420
  case 3:
25271
25421
  updateChannelOnAllChannels(channel.id, channelUpdateParam);
25272
25422
  case 4:
25273
- _context34.n = 5;
25423
+ _context35.n = 5;
25274
25424
  return effects.put(deleteReactionFromListAC(reaction));
25275
25425
  case 5:
25276
- _context34.n = 6;
25426
+ _context35.n = 6;
25277
25427
  return effects.put(deleteReactionFromMessageAC(message, reaction, true));
25278
25428
  case 6:
25279
25429
  removeReactionToMessageOnMap(channelId, message, reaction, true);
25280
- _context34.n = 8;
25430
+ _context35.n = 8;
25281
25431
  break;
25282
25432
  case 7:
25283
- _context34.p = 7;
25284
- _t37 = _context34.v;
25433
+ _context35.p = 7;
25434
+ _t37 = _context35.v;
25285
25435
  log.error('ERROR in delete reaction', _t37.message);
25286
25436
  case 8:
25287
- return _context34.a(2);
25437
+ return _context35.a(2);
25288
25438
  }
25289
- }, _marked28$1, null, [[0, 7]]);
25439
+ }, _marked29$1, null, [[0, 7]]);
25290
25440
  }
25291
25441
  function getReactions(action) {
25292
25442
  var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result, _t38;
25293
- return _regenerator().w(function (_context35) {
25294
- while (1) switch (_context35.p = _context35.n) {
25443
+ return _regenerator().w(function (_context36) {
25444
+ while (1) switch (_context36.p = _context36.n) {
25295
25445
  case 0:
25296
- _context35.p = 0;
25446
+ _context36.p = 0;
25297
25447
  payload = action.payload;
25298
25448
  messageId = payload.messageId, key = payload.key, limit = payload.limit;
25299
25449
  SceytChatClient = getClient();
25300
- _context35.n = 1;
25450
+ _context36.n = 1;
25301
25451
  return effects.put(setReactionsLoadingStateAC(LOADING_STATE.LOADING));
25302
25452
  case 1:
25303
25453
  reactionQueryBuilder = new SceytChatClient.ReactionListQueryBuilder(messageId);
@@ -25305,76 +25455,76 @@ function getReactions(action) {
25305
25455
  if (key) {
25306
25456
  reactionQueryBuilder.setKey(key);
25307
25457
  }
25308
- _context35.n = 2;
25458
+ _context36.n = 2;
25309
25459
  return effects.call(reactionQueryBuilder.build);
25310
25460
  case 2:
25311
- reactionQuery = _context35.v;
25312
- _context35.n = 3;
25461
+ reactionQuery = _context36.v;
25462
+ _context36.n = 3;
25313
25463
  return effects.call(reactionQuery.loadNext);
25314
25464
  case 3:
25315
- result = _context35.v;
25465
+ result = _context36.v;
25316
25466
  query.ReactionsQuery = reactionQuery;
25317
- _context35.n = 4;
25467
+ _context36.n = 4;
25318
25468
  return effects.put(setReactionsListAC(result.reactions, result.hasNext));
25319
25469
  case 4:
25320
- _context35.n = 5;
25470
+ _context36.n = 5;
25321
25471
  return effects.put(setReactionsLoadingStateAC(LOADING_STATE.LOADED));
25322
25472
  case 5:
25323
- _context35.n = 7;
25473
+ _context36.n = 7;
25324
25474
  break;
25325
25475
  case 6:
25326
- _context35.p = 6;
25327
- _t38 = _context35.v;
25476
+ _context36.p = 6;
25477
+ _t38 = _context36.v;
25328
25478
  log.error('ERROR in get reactions', _t38.message);
25329
25479
  case 7:
25330
- return _context35.a(2);
25480
+ return _context36.a(2);
25331
25481
  }
25332
- }, _marked29$1, null, [[0, 6]]);
25482
+ }, _marked30$1, null, [[0, 6]]);
25333
25483
  }
25334
25484
  function loadMoreReactions(action) {
25335
25485
  var payload, limit, ReactionQuery, result, _t39;
25336
- return _regenerator().w(function (_context36) {
25337
- while (1) switch (_context36.p = _context36.n) {
25486
+ return _regenerator().w(function (_context37) {
25487
+ while (1) switch (_context37.p = _context37.n) {
25338
25488
  case 0:
25339
- _context36.p = 0;
25489
+ _context37.p = 0;
25340
25490
  payload = action.payload;
25341
25491
  limit = payload.limit;
25342
- _context36.n = 1;
25492
+ _context37.n = 1;
25343
25493
  return effects.put(setReactionsLoadingStateAC(LOADING_STATE.LOADING));
25344
25494
  case 1:
25345
25495
  ReactionQuery = query.ReactionsQuery;
25346
25496
  if (limit) {
25347
25497
  ReactionQuery.limit = limit;
25348
25498
  }
25349
- _context36.n = 2;
25499
+ _context37.n = 2;
25350
25500
  return effects.call(ReactionQuery.loadNext);
25351
25501
  case 2:
25352
- result = _context36.v;
25353
- _context36.n = 3;
25502
+ result = _context37.v;
25503
+ _context37.n = 3;
25354
25504
  return effects.put(addReactionsToListAC(result.reactions, result.hasNext));
25355
25505
  case 3:
25356
- _context36.n = 4;
25506
+ _context37.n = 4;
25357
25507
  return effects.put(setReactionsLoadingStateAC(LOADING_STATE.LOADED));
25358
25508
  case 4:
25359
- _context36.n = 6;
25509
+ _context37.n = 6;
25360
25510
  break;
25361
25511
  case 5:
25362
- _context36.p = 5;
25363
- _t39 = _context36.v;
25512
+ _context37.p = 5;
25513
+ _t39 = _context37.v;
25364
25514
  log.error('ERROR in load more reactions', _t39.message);
25365
25515
  case 6:
25366
- return _context36.a(2);
25516
+ return _context37.a(2);
25367
25517
  }
25368
- }, _marked30$1, null, [[0, 5]]);
25518
+ }, _marked31$1, null, [[0, 5]]);
25369
25519
  }
25370
25520
  function getMessageAttachments(action) {
25371
- var _action$payload6, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, attachments, attachmentIndex, hasPrev, hasNext, _t40;
25372
- return _regenerator().w(function (_context37) {
25373
- while (1) switch (_context37.p = _context37.n) {
25521
+ var _action$payload7, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, attachments, attachmentIndex, hasPrev, hasNext, _t40;
25522
+ return _regenerator().w(function (_context38) {
25523
+ while (1) switch (_context38.p = _context38.n) {
25374
25524
  case 0:
25375
- _action$payload6 = action.payload, channelId = _action$payload6.channelId, attachmentType = _action$payload6.attachmentType, limit = _action$payload6.limit, direction = _action$payload6.direction, attachmentId = _action$payload6.attachmentId, forPopup = _action$payload6.forPopup;
25376
- _context37.p = 1;
25377
- _context37.n = 2;
25525
+ _action$payload7 = action.payload, channelId = _action$payload7.channelId, attachmentType = _action$payload7.attachmentType, limit = _action$payload7.limit, direction = _action$payload7.direction, attachmentId = _action$payload7.attachmentId, forPopup = _action$payload7.forPopup;
25526
+ _context38.p = 1;
25527
+ _context38.n = 2;
25378
25528
  return effects.put(setAttachmentsLoadingStateAC(LOADING_STATE.LOADING, forPopup));
25379
25529
  case 2:
25380
25530
  SceytChatClient = getClient();
@@ -25390,49 +25540,49 @@ function getMessageAttachments(action) {
25390
25540
  }
25391
25541
  AttachmentByTypeQueryBuilder = new SceytChatClient.AttachmentListQueryBuilder(channelId, typeList);
25392
25542
  AttachmentByTypeQueryBuilder.limit(limit || 34);
25393
- _context37.n = 3;
25543
+ _context38.n = 3;
25394
25544
  return effects.call(AttachmentByTypeQueryBuilder.build);
25395
25545
  case 3:
25396
- AttachmentByTypeQuery = _context37.v;
25546
+ AttachmentByTypeQuery = _context38.v;
25397
25547
  if (forPopup) {
25398
25548
  AttachmentByTypeQuery.reverse = true;
25399
25549
  }
25400
25550
  if (!(direction === queryDirection.NEXT)) {
25401
- _context37.n = 5;
25551
+ _context38.n = 5;
25402
25552
  break;
25403
25553
  }
25404
- _context37.n = 4;
25554
+ _context38.n = 4;
25405
25555
  return effects.call(AttachmentByTypeQuery.loadPrevious);
25406
25556
  case 4:
25407
- result = _context37.v;
25408
- _context37.n = 9;
25557
+ result = _context38.v;
25558
+ _context38.n = 9;
25409
25559
  break;
25410
25560
  case 5:
25411
25561
  if (!(direction === queryDirection.NEAR)) {
25412
- _context37.n = 7;
25562
+ _context38.n = 7;
25413
25563
  break;
25414
25564
  }
25415
- _context37.n = 6;
25565
+ _context38.n = 6;
25416
25566
  return effects.call(AttachmentByTypeQuery.loadNearMessageId, attachmentId);
25417
25567
  case 6:
25418
- result = _context37.v;
25419
- _context37.n = 9;
25568
+ result = _context38.v;
25569
+ _context38.n = 9;
25420
25570
  break;
25421
25571
  case 7:
25422
- _context37.n = 8;
25572
+ _context38.n = 8;
25423
25573
  return effects.call(AttachmentByTypeQuery.loadPrevious);
25424
25574
  case 8:
25425
- result = _context37.v;
25575
+ result = _context38.v;
25426
25576
  case 9:
25427
25577
  attachments = result.attachments.sort(function (a, b) {
25428
25578
  return forPopup ? Number(a.id || 0) - Number(b.id || 0) : Number(b.id || 0) - Number(a.id || 0);
25429
25579
  });
25430
25580
  if (!forPopup) {
25431
- _context37.n = 12;
25581
+ _context38.n = 12;
25432
25582
  break;
25433
25583
  }
25434
25584
  query.AttachmentByTypeQueryForPopup = AttachmentByTypeQuery;
25435
- _context37.n = 10;
25585
+ _context38.n = 10;
25436
25586
  return effects.put(setAttachmentsForPopupAC(JSON.parse(JSON.stringify(attachments))));
25437
25587
  case 10:
25438
25588
  attachmentIndex = attachments.findIndex(function (attachment) {
@@ -25450,55 +25600,55 @@ function getMessageAttachments(action) {
25450
25600
  } else {
25451
25601
  hasNext = false;
25452
25602
  }
25453
- _context37.n = 11;
25603
+ _context38.n = 11;
25454
25604
  return effects.put(setAttachmentsCompleteForPopupAC(hasPrev, hasNext));
25455
25605
  case 11:
25456
- _context37.n = 14;
25606
+ _context38.n = 14;
25457
25607
  break;
25458
25608
  case 12:
25459
25609
  query.AttachmentByTypeQuery = AttachmentByTypeQuery;
25460
- _context37.n = 13;
25610
+ _context38.n = 13;
25461
25611
  return effects.put(setAttachmentsCompleteAC(result.hasNext));
25462
25612
  case 13:
25463
- _context37.n = 14;
25613
+ _context38.n = 14;
25464
25614
  return effects.put(setAttachmentsAC(JSON.parse(JSON.stringify(attachments))));
25465
25615
  case 14:
25466
- _context37.n = 16;
25616
+ _context38.n = 16;
25467
25617
  break;
25468
25618
  case 15:
25469
- _context37.p = 15;
25470
- _t40 = _context37.v;
25619
+ _context38.p = 15;
25620
+ _t40 = _context38.v;
25471
25621
  log.error('error in message attachment query', _t40);
25472
25622
  case 16:
25473
- _context37.p = 16;
25474
- _context37.n = 17;
25623
+ _context38.p = 16;
25624
+ _context38.n = 17;
25475
25625
  return effects.put(setAttachmentsLoadingStateAC(LOADING_STATE.LOADED, forPopup));
25476
25626
  case 17:
25477
- return _context37.f(16);
25627
+ return _context38.f(16);
25478
25628
  case 18:
25479
- return _context37.a(2);
25629
+ return _context38.a(2);
25480
25630
  }
25481
- }, _marked31$1, null, [[1, 15, 16, 18]]);
25631
+ }, _marked32$1, null, [[1, 15, 16, 18]]);
25482
25632
  }
25483
25633
  function loadMoreMessageAttachments(action) {
25484
- var _action$payload7, limit, direction, forPopup, attachmentId, AttachmentQuery, result, _result2, attachments, hasNext, _t41;
25485
- return _regenerator().w(function (_context38) {
25486
- while (1) switch (_context38.p = _context38.n) {
25634
+ var _action$payload8, limit, direction, forPopup, attachmentId, AttachmentQuery, result, _result2, attachments, hasNext, _t41;
25635
+ return _regenerator().w(function (_context39) {
25636
+ while (1) switch (_context39.p = _context39.n) {
25487
25637
  case 0:
25488
- _action$payload7 = action.payload, limit = _action$payload7.limit, direction = _action$payload7.direction, forPopup = _action$payload7.forPopup, attachmentId = _action$payload7.attachmentId;
25489
- _context38.p = 1;
25638
+ _action$payload8 = action.payload, limit = _action$payload8.limit, direction = _action$payload8.direction, forPopup = _action$payload8.forPopup, attachmentId = _action$payload8.attachmentId;
25639
+ _context39.p = 1;
25490
25640
  if (forPopup) {
25491
25641
  AttachmentQuery = query.AttachmentByTypeQueryForPopup;
25492
25642
  } else {
25493
25643
  AttachmentQuery = query.AttachmentByTypeQuery;
25494
25644
  }
25495
25645
  if (AttachmentQuery) {
25496
- _context38.n = 2;
25646
+ _context39.n = 2;
25497
25647
  break;
25498
25648
  }
25499
- return _context38.a(2);
25649
+ return _context39.a(2);
25500
25650
  case 2:
25501
- _context38.n = 3;
25651
+ _context39.n = 3;
25502
25652
  return effects.put(setAttachmentsLoadingStateAC(LOADING_STATE.LOADING, forPopup));
25503
25653
  case 3:
25504
25654
  AttachmentQuery.limit = limit;
@@ -25507,172 +25657,172 @@ function loadMoreMessageAttachments(action) {
25507
25657
  hasNext: false
25508
25658
  };
25509
25659
  if (!attachmentId) {
25510
- _context38.n = 8;
25660
+ _context39.n = 8;
25511
25661
  break;
25512
25662
  }
25513
25663
  if (!(direction === queryDirection.NEXT)) {
25514
- _context38.n = 5;
25664
+ _context39.n = 5;
25515
25665
  break;
25516
25666
  }
25517
- _context38.n = 4;
25667
+ _context39.n = 4;
25518
25668
  return effects.call(AttachmentQuery.loadNextAttachmentId, attachmentId);
25519
25669
  case 4:
25520
- result = _context38.v;
25521
- _context38.n = 7;
25670
+ result = _context39.v;
25671
+ _context39.n = 7;
25522
25672
  break;
25523
25673
  case 5:
25524
- _context38.n = 6;
25674
+ _context39.n = 6;
25525
25675
  return effects.call(AttachmentQuery.loadPreviousAttachmentId, attachmentId);
25526
25676
  case 6:
25527
- result = _context38.v;
25677
+ result = _context39.v;
25528
25678
  case 7:
25529
- _context38.n = 12;
25679
+ _context39.n = 12;
25530
25680
  break;
25531
25681
  case 8:
25532
25682
  if (!(direction === queryDirection.NEXT)) {
25533
- _context38.n = 10;
25683
+ _context39.n = 10;
25534
25684
  break;
25535
25685
  }
25536
- _context38.n = 9;
25686
+ _context39.n = 9;
25537
25687
  return effects.call(AttachmentQuery.loadNext);
25538
25688
  case 9:
25539
- result = _context38.v;
25540
- _context38.n = 12;
25689
+ result = _context39.v;
25690
+ _context39.n = 12;
25541
25691
  break;
25542
25692
  case 10:
25543
- _context38.n = 11;
25693
+ _context39.n = 11;
25544
25694
  return effects.call(AttachmentQuery.loadPrevious);
25545
25695
  case 11:
25546
- result = _context38.v;
25696
+ result = _context39.v;
25547
25697
  case 12:
25548
25698
  _result2 = result, attachments = _result2.attachments, hasNext = _result2.hasNext;
25549
25699
  if (!forPopup) {
25550
- _context38.n = 17;
25700
+ _context39.n = 17;
25551
25701
  break;
25552
25702
  }
25553
- _context38.n = 13;
25703
+ _context39.n = 13;
25554
25704
  return effects.put(addAttachmentsForPopupAC(attachments, direction));
25555
25705
  case 13:
25556
25706
  if (!(attachmentId && direction === queryDirection.NEXT)) {
25557
- _context38.n = 15;
25707
+ _context39.n = 15;
25558
25708
  break;
25559
25709
  }
25560
- _context38.n = 14;
25710
+ _context39.n = 14;
25561
25711
  return effects.put(setAttachmentsCompleteForPopupAC(undefined, result.hasNext));
25562
25712
  case 14:
25563
- _context38.n = 16;
25713
+ _context39.n = 16;
25564
25714
  break;
25565
25715
  case 15:
25566
25716
  if (!(attachmentId && direction === queryDirection.PREV)) {
25567
- _context38.n = 16;
25717
+ _context39.n = 16;
25568
25718
  break;
25569
25719
  }
25570
- _context38.n = 16;
25720
+ _context39.n = 16;
25571
25721
  return effects.put(setAttachmentsCompleteForPopupAC(result.hasNext, undefined));
25572
25722
  case 16:
25573
- _context38.n = 20;
25723
+ _context39.n = 20;
25574
25724
  break;
25575
25725
  case 17:
25576
- _context38.n = 18;
25726
+ _context39.n = 18;
25577
25727
  return effects.put(setAttachmentsCompleteAC(hasNext));
25578
25728
  case 18:
25579
- _context38.n = 19;
25729
+ _context39.n = 19;
25580
25730
  return effects.put(setAttachmentsLoadingStateAC(LOADING_STATE.LOADED, forPopup));
25581
25731
  case 19:
25582
- _context38.n = 20;
25732
+ _context39.n = 20;
25583
25733
  return effects.put(addAttachmentsAC(attachments));
25584
25734
  case 20:
25585
- _context38.n = 22;
25735
+ _context39.n = 22;
25586
25736
  break;
25587
25737
  case 21:
25588
- _context38.p = 21;
25589
- _t41 = _context38.v;
25738
+ _context39.p = 21;
25739
+ _t41 = _context39.v;
25590
25740
  log.error('error in message attachment query', _t41);
25591
25741
  case 22:
25592
- _context38.p = 22;
25593
- _context38.n = 23;
25742
+ _context39.p = 22;
25743
+ _context39.n = 23;
25594
25744
  return effects.put(setAttachmentsLoadingStateAC(LOADING_STATE.LOADED, forPopup));
25595
25745
  case 23:
25596
- return _context38.f(22);
25746
+ return _context39.f(22);
25597
25747
  case 24:
25598
- return _context38.a(2);
25748
+ return _context39.a(2);
25599
25749
  }
25600
- }, _marked32$1, null, [[1, 21, 22, 24]]);
25750
+ }, _marked33$1, null, [[1, 21, 22, 24]]);
25601
25751
  }
25602
25752
  function pauseAttachmentUploading(action) {
25603
25753
  var attachmentId, isPaused, _t42;
25604
- return _regenerator().w(function (_context39) {
25605
- while (1) switch (_context39.p = _context39.n) {
25754
+ return _regenerator().w(function (_context40) {
25755
+ while (1) switch (_context40.p = _context40.n) {
25606
25756
  case 0:
25607
- _context39.p = 0;
25757
+ _context40.p = 0;
25608
25758
  attachmentId = action.payload.attachmentId;
25609
25759
  if (!getCustomUploader()) {
25610
- _context39.n = 1;
25760
+ _context40.n = 1;
25611
25761
  break;
25612
25762
  }
25613
25763
  isPaused = pauseUpload(attachmentId);
25614
25764
  if (!isPaused) {
25615
- _context39.n = 1;
25765
+ _context40.n = 1;
25616
25766
  break;
25617
25767
  }
25618
- _context39.n = 1;
25768
+ _context40.n = 1;
25619
25769
  return effects.put(updateAttachmentUploadingStateAC(UPLOAD_STATE.PAUSED, attachmentId));
25620
25770
  case 1:
25621
- _context39.n = 3;
25771
+ _context40.n = 3;
25622
25772
  break;
25623
25773
  case 2:
25624
- _context39.p = 2;
25625
- _t42 = _context39.v;
25774
+ _context40.p = 2;
25775
+ _t42 = _context40.v;
25626
25776
  log.error('error in pause attachment uploading', _t42);
25627
25777
  case 3:
25628
- return _context39.a(2);
25778
+ return _context40.a(2);
25629
25779
  }
25630
- }, _marked33$1, null, [[0, 2]]);
25780
+ }, _marked34$1, null, [[0, 2]]);
25631
25781
  }
25632
25782
  function resumeAttachmentUploading(action) {
25633
25783
  var attachmentId, isResumed, _t43;
25634
- return _regenerator().w(function (_context40) {
25635
- while (1) switch (_context40.p = _context40.n) {
25784
+ return _regenerator().w(function (_context41) {
25785
+ while (1) switch (_context41.p = _context41.n) {
25636
25786
  case 0:
25637
- _context40.p = 0;
25787
+ _context41.p = 0;
25638
25788
  attachmentId = action.payload.attachmentId;
25639
25789
  log.info('resume for attachment ... ', attachmentId);
25640
25790
  if (!getCustomUploader()) {
25641
- _context40.n = 1;
25791
+ _context41.n = 1;
25642
25792
  break;
25643
25793
  }
25644
25794
  isResumed = resumeUpload(attachmentId);
25645
25795
  if (!isResumed) {
25646
- _context40.n = 1;
25796
+ _context41.n = 1;
25647
25797
  break;
25648
25798
  }
25649
- _context40.n = 1;
25799
+ _context41.n = 1;
25650
25800
  return effects.put(updateAttachmentUploadingStateAC(UPLOAD_STATE.UPLOADING, attachmentId));
25651
25801
  case 1:
25652
- _context40.n = 3;
25802
+ _context41.n = 3;
25653
25803
  break;
25654
25804
  case 2:
25655
- _context40.p = 2;
25656
- _t43 = _context40.v;
25805
+ _context41.p = 2;
25806
+ _t43 = _context41.v;
25657
25807
  log.error('error in resume attachment uploading', _t43);
25658
25808
  case 3:
25659
- return _context40.a(2);
25809
+ return _context41.a(2);
25660
25810
  }
25661
- }, _marked34$1, null, [[0, 2]]);
25811
+ }, _marked35$1, null, [[0, 2]]);
25662
25812
  }
25663
25813
  function getMessageMarkers(action) {
25664
- var _action$payload8, messageId, channelId, deliveryStatuses, sceytChatClient, deliveryStatusesArray, messageMarkers, _iterator4, _step4, deliveryStatus, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkersResult, _t44;
25665
- return _regenerator().w(function (_context41) {
25666
- while (1) switch (_context41.p = _context41.n) {
25814
+ var _action$payload9, messageId, channelId, deliveryStatuses, sceytChatClient, deliveryStatusesArray, messageMarkers, _iterator4, _step4, deliveryStatus, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkersResult, _t44;
25815
+ return _regenerator().w(function (_context42) {
25816
+ while (1) switch (_context42.p = _context42.n) {
25667
25817
  case 0:
25668
- _context41.p = 0;
25669
- _context41.n = 1;
25818
+ _context42.p = 0;
25819
+ _context42.n = 1;
25670
25820
  return effects.put(setMessagesMarkersLoadingStateAC(LOADING_STATE.LOADING));
25671
25821
  case 1:
25672
- _action$payload8 = action.payload, messageId = _action$payload8.messageId, channelId = _action$payload8.channelId, deliveryStatuses = _action$payload8.deliveryStatuses;
25822
+ _action$payload9 = action.payload, messageId = _action$payload9.messageId, channelId = _action$payload9.channelId, deliveryStatuses = _action$payload9.deliveryStatuses;
25673
25823
  sceytChatClient = getClient();
25674
25824
  if (!sceytChatClient) {
25675
- _context41.n = 7;
25825
+ _context42.n = 7;
25676
25826
  break;
25677
25827
  }
25678
25828
  deliveryStatusesArray = deliveryStatuses.split(',');
@@ -25680,98 +25830,98 @@ function getMessageMarkers(action) {
25680
25830
  _iterator4 = _createForOfIteratorHelperLoose(deliveryStatusesArray);
25681
25831
  case 2:
25682
25832
  if ((_step4 = _iterator4()).done) {
25683
- _context41.n = 6;
25833
+ _context42.n = 6;
25684
25834
  break;
25685
25835
  }
25686
25836
  deliveryStatus = _step4.value;
25687
25837
  messageMarkerListQueryBuilder = new sceytChatClient.MessageMarkerListQueryBuilder(channelId, String(messageId), deliveryStatus);
25688
- _context41.n = 3;
25838
+ _context42.n = 3;
25689
25839
  return effects.call(messageMarkerListQueryBuilder.build);
25690
25840
  case 3:
25691
- messageMarkerListQuery = _context41.v;
25692
- _context41.n = 4;
25841
+ messageMarkerListQuery = _context42.v;
25842
+ _context42.n = 4;
25693
25843
  return effects.call(messageMarkerListQuery.loadNext);
25694
25844
  case 4:
25695
- messageMarkersResult = _context41.v;
25845
+ messageMarkersResult = _context42.v;
25696
25846
  messageMarkers[deliveryStatus] = messageMarkersResult.markers;
25697
25847
  case 5:
25698
- _context41.n = 2;
25848
+ _context42.n = 2;
25699
25849
  break;
25700
25850
  case 6:
25701
25851
  if (!(Object.keys(messageMarkers).length > 0)) {
25702
- _context41.n = 7;
25852
+ _context42.n = 7;
25703
25853
  break;
25704
25854
  }
25705
- _context41.n = 7;
25855
+ _context42.n = 7;
25706
25856
  return effects.put(setMessageMarkersAC(channelId, messageId, messageMarkers, deliveryStatusesArray));
25707
25857
  case 7:
25708
- _context41.n = 9;
25858
+ _context42.n = 9;
25709
25859
  break;
25710
25860
  case 8:
25711
- _context41.p = 8;
25712
- _t44 = _context41.v;
25861
+ _context42.p = 8;
25862
+ _t44 = _context42.v;
25713
25863
  log.error('error in get message markers', _t44);
25714
25864
  case 9:
25715
- _context41.p = 9;
25716
- _context41.n = 10;
25865
+ _context42.p = 9;
25866
+ _context42.n = 10;
25717
25867
  return effects.put(setMessagesMarkersLoadingStateAC(LOADING_STATE.LOADED));
25718
25868
  case 10:
25719
- return _context41.f(9);
25869
+ return _context42.f(9);
25720
25870
  case 11:
25721
- return _context41.a(2);
25871
+ return _context42.a(2);
25722
25872
  }
25723
- }, _marked35$1, null, [[0, 8, 9, 11]]);
25873
+ }, _marked36$1, null, [[0, 8, 9, 11]]);
25724
25874
  }
25725
25875
  function executeAddPollVote(channelId, pollId, optionId, message) {
25726
25876
  var channel;
25727
- return _regenerator().w(function (_context42) {
25728
- while (1) switch (_context42.n) {
25877
+ return _regenerator().w(function (_context43) {
25878
+ while (1) switch (_context43.n) {
25729
25879
  case 0:
25730
- _context42.n = 1;
25880
+ _context43.n = 1;
25731
25881
  return effects.call(getChannelFromMap, channelId);
25732
25882
  case 1:
25733
- channel = _context42.v;
25883
+ channel = _context43.v;
25734
25884
  if (message.pollDetails) {
25735
- _context42.n = 2;
25885
+ _context43.n = 2;
25736
25886
  break;
25737
25887
  }
25738
- return _context42.a(2);
25888
+ return _context43.a(2);
25739
25889
  case 2:
25740
25890
  if (!(channel && message.id)) {
25741
- _context42.n = 4;
25891
+ _context43.n = 4;
25742
25892
  break;
25743
25893
  }
25744
- _context42.n = 3;
25894
+ _context43.n = 3;
25745
25895
  return effects.call(channel.addVote, message.id, pollId, [optionId]);
25746
25896
  case 3:
25747
- _context42.n = 4;
25897
+ _context43.n = 4;
25748
25898
  return effects.put(removePendingPollActionAC(message.id, 'ADD_POLL_VOTE', optionId));
25749
25899
  case 4:
25750
- return _context42.a(2);
25900
+ return _context43.a(2);
25751
25901
  }
25752
- }, _marked36$1);
25902
+ }, _marked37$1);
25753
25903
  }
25754
25904
  function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
25755
25905
  var _message$pollDetails, _message$pollDetails2, _message$pollDetails3, _message$pollDetails4;
25756
25906
  var channel, objs, _message$pollDetails5, _message$pollDetails6, _message$pollDetails7, _i2, _objs, obj;
25757
- return _regenerator().w(function (_context43) {
25758
- while (1) switch (_context43.n) {
25907
+ return _regenerator().w(function (_context44) {
25908
+ while (1) switch (_context44.n) {
25759
25909
  case 0:
25760
- _context43.n = 1;
25910
+ _context44.n = 1;
25761
25911
  return effects.call(getChannelFromMap, channelId);
25762
25912
  case 1:
25763
- channel = _context43.v;
25913
+ channel = _context44.v;
25764
25914
  if (channel) {
25765
- _context43.n = 2;
25915
+ _context44.n = 2;
25766
25916
  break;
25767
25917
  }
25768
- return _context43.a(2);
25918
+ return _context44.a(2);
25769
25919
  case 2:
25770
25920
  if (message.pollDetails) {
25771
- _context43.n = 3;
25921
+ _context44.n = 3;
25772
25922
  break;
25773
25923
  }
25774
- return _context43.a(2);
25924
+ return _context44.a(2);
25775
25925
  case 3:
25776
25926
  objs = [];
25777
25927
  if (!((_message$pollDetails = message.pollDetails) !== null && _message$pollDetails !== void 0 && _message$pollDetails.allowMultipleVotes) && ((_message$pollDetails2 = message.pollDetails) === null || _message$pollDetails2 === void 0 ? void 0 : (_message$pollDetails3 = _message$pollDetails2.voteDetails) === null || _message$pollDetails3 === void 0 ? void 0 : (_message$pollDetails4 = _message$pollDetails3.ownVotes) === null || _message$pollDetails4 === void 0 ? void 0 : _message$pollDetails4.length) > 0) {
@@ -25787,7 +25937,7 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
25787
25937
  _i2 = 0, _objs = objs;
25788
25938
  case 4:
25789
25939
  if (!(_i2 < _objs.length)) {
25790
- _context43.n = 6;
25940
+ _context44.n = 6;
25791
25941
  break;
25792
25942
  }
25793
25943
  obj = _objs[_i2];
@@ -25795,28 +25945,28 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
25795
25945
  messageId: message.id,
25796
25946
  params: {}
25797
25947
  }, obj);
25798
- _context43.n = 5;
25948
+ _context44.n = 5;
25799
25949
  return effects.put(updateMessageAC(message.id, {}, undefined, obj));
25800
25950
  case 5:
25801
25951
  _i2++;
25802
- _context43.n = 4;
25952
+ _context44.n = 4;
25803
25953
  break;
25804
25954
  case 6:
25805
- return _context43.a(2);
25955
+ return _context44.a(2);
25806
25956
  }
25807
- }, _marked37$1);
25957
+ }, _marked38$1);
25808
25958
  }
25809
25959
  function addPollVote(action) {
25810
25960
  var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence, user, vote, pendingAction, conflictCheck, channel, _store$getState$Messa2, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t45;
25811
- return _regenerator().w(function (_context44) {
25812
- while (1) switch (_context44.p = _context44.n) {
25961
+ return _regenerator().w(function (_context45) {
25962
+ while (1) switch (_context45.p = _context45.n) {
25813
25963
  case 0:
25814
- _context44.p = 0;
25964
+ _context45.p = 0;
25815
25965
  payload = action.payload;
25816
25966
  channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
25817
25967
  sceytChatClient = getClient();
25818
25968
  if (!sceytChatClient) {
25819
- _context44.n = 6;
25969
+ _context45.n = 6;
25820
25970
  break;
25821
25971
  }
25822
25972
  user = sceytChatClient.user;
@@ -25850,20 +26000,20 @@ function addPollVote(action) {
25850
26000
  };
25851
26001
  conflictCheck = checkPendingPollActionConflict(pendingAction);
25852
26002
  if (!(conflictCheck.hasConflict && !conflictCheck.shouldSkip)) {
25853
- _context44.n = 4;
26003
+ _context45.n = 4;
25854
26004
  break;
25855
26005
  }
25856
- _context44.n = 1;
26006
+ _context45.n = 1;
25857
26007
  return effects.call(getChannelFromMap, channelId);
25858
26008
  case 1:
25859
- channel = _context44.v;
26009
+ channel = _context45.v;
25860
26010
  if (!channel) {
25861
- _context44.n = 3;
26011
+ _context45.n = 3;
25862
26012
  break;
25863
26013
  }
25864
26014
  currentMessage = getMessageFromMap(channelId, message.id) || message;
25865
26015
  hasNext = ((_store$getState$Messa2 = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa2 === void 0 ? void 0 : _store$getState$Messa2[pollId]) || false;
25866
- _context44.n = 2;
26016
+ _context45.n = 2;
25867
26017
  return effects.put(addPollVotesToListAC(pollId, optionId, [(_currentMessage$pollD = currentMessage.pollDetails) === null || _currentMessage$pollD === void 0 ? void 0 : (_currentMessage$pollD2 = _currentMessage$pollD.voteDetails) === null || _currentMessage$pollD2 === void 0 ? void 0 : (_currentMessage$pollD3 = _currentMessage$pollD2.ownVotes) === null || _currentMessage$pollD3 === void 0 ? void 0 : _currentMessage$pollD3[0]], hasNext, message.id));
25868
26018
  case 2:
25869
26019
  obj = {
@@ -25874,95 +26024,95 @@ function addPollVote(action) {
25874
26024
  messageId: message.id,
25875
26025
  params: {}
25876
26026
  }, obj);
25877
- _context44.n = 3;
26027
+ _context45.n = 3;
25878
26028
  return effects.put(updateMessageAC(message.id, {}, undefined, obj));
25879
26029
  case 3:
25880
- _context44.n = 5;
26030
+ _context45.n = 5;
25881
26031
  break;
25882
26032
  case 4:
25883
26033
  if (conflictCheck.shouldSkip) {
25884
- _context44.n = 5;
26034
+ _context45.n = 5;
25885
26035
  break;
25886
26036
  }
25887
- _context44.n = 5;
26037
+ _context45.n = 5;
25888
26038
  return effects.call(updateMessageOptimisticallyForAddPollVote, channelId, message, vote);
25889
26039
  case 5:
25890
26040
  if (!conflictCheck.shouldSkip && !isResend) {
25891
26041
  setPendingPollAction(pendingAction);
25892
26042
  }
25893
- _context44.n = 6;
26043
+ _context45.n = 6;
25894
26044
  return effects.call(executeAddPollVote, channelId, pollId, optionId, message);
25895
26045
  case 6:
25896
- _context44.n = 8;
26046
+ _context45.n = 8;
25897
26047
  break;
25898
26048
  case 7:
25899
- _context44.p = 7;
25900
- _t45 = _context44.v;
26049
+ _context45.p = 7;
26050
+ _t45 = _context45.v;
25901
26051
  log.error('error in add poll vote', _t45);
25902
26052
  case 8:
25903
- return _context44.a(2);
26053
+ return _context45.a(2);
25904
26054
  }
25905
- }, _marked38$1, null, [[0, 7]]);
26055
+ }, _marked39$1, null, [[0, 7]]);
25906
26056
  }
25907
26057
  function executeDeletePollVote(channelId, pollId, optionId, message) {
25908
26058
  var _message$pollDetails8, _message$pollDetails9, _message$pollDetails0;
25909
26059
  var channel, vote;
25910
- return _regenerator().w(function (_context45) {
25911
- while (1) switch (_context45.n) {
26060
+ return _regenerator().w(function (_context46) {
26061
+ while (1) switch (_context46.n) {
25912
26062
  case 0:
25913
- _context45.n = 1;
26063
+ _context46.n = 1;
25914
26064
  return effects.call(getChannelFromMap, channelId);
25915
26065
  case 1:
25916
- channel = _context45.v;
26066
+ channel = _context46.v;
25917
26067
  if (message.pollDetails) {
25918
- _context45.n = 2;
26068
+ _context46.n = 2;
25919
26069
  break;
25920
26070
  }
25921
- return _context45.a(2);
26071
+ return _context46.a(2);
25922
26072
  case 2:
25923
26073
  vote = (_message$pollDetails8 = message.pollDetails) === null || _message$pollDetails8 === void 0 ? void 0 : (_message$pollDetails9 = _message$pollDetails8.voteDetails) === null || _message$pollDetails9 === void 0 ? void 0 : (_message$pollDetails0 = _message$pollDetails9.ownVotes) === null || _message$pollDetails0 === void 0 ? void 0 : _message$pollDetails0.find(function (vote) {
25924
26074
  return vote.optionId === optionId;
25925
26075
  });
25926
26076
  if (vote) {
25927
- _context45.n = 3;
26077
+ _context46.n = 3;
25928
26078
  break;
25929
26079
  }
25930
- return _context45.a(2);
26080
+ return _context46.a(2);
25931
26081
  case 3:
25932
26082
  if (!(channel && message.id)) {
25933
- _context45.n = 5;
26083
+ _context46.n = 5;
25934
26084
  break;
25935
26085
  }
25936
- _context45.n = 4;
26086
+ _context46.n = 4;
25937
26087
  return effects.call(channel.deleteVote, message.id, pollId, [optionId]);
25938
26088
  case 4:
25939
- _context45.n = 5;
26089
+ _context46.n = 5;
25940
26090
  return effects.put(removePendingPollActionAC(message.id, 'DELETE_POLL_VOTE', optionId));
25941
26091
  case 5:
25942
- return _context45.a(2);
26092
+ return _context46.a(2);
25943
26093
  }
25944
- }, _marked39$1);
26094
+ }, _marked40$1);
25945
26095
  }
25946
26096
  function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote) {
25947
26097
  var channel, obj;
25948
- return _regenerator().w(function (_context46) {
25949
- while (1) switch (_context46.n) {
26098
+ return _regenerator().w(function (_context47) {
26099
+ while (1) switch (_context47.n) {
25950
26100
  case 0:
25951
- _context46.n = 1;
26101
+ _context47.n = 1;
25952
26102
  return effects.call(getChannelFromMap, channelId);
25953
26103
  case 1:
25954
- channel = _context46.v;
26104
+ channel = _context47.v;
25955
26105
  if (channel) {
25956
- _context46.n = 2;
26106
+ _context47.n = 2;
25957
26107
  break;
25958
26108
  }
25959
- return _context46.a(2);
26109
+ return _context47.a(2);
25960
26110
  case 2:
25961
26111
  if (message.pollDetails) {
25962
- _context46.n = 3;
26112
+ _context47.n = 3;
25963
26113
  break;
25964
26114
  }
25965
- return _context46.a(2);
26115
+ return _context47.a(2);
25966
26116
  case 3:
25967
26117
  obj = {
25968
26118
  type: 'deleteOwn',
@@ -25972,34 +26122,34 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
25972
26122
  messageId: message.id,
25973
26123
  params: {}
25974
26124
  }, obj);
25975
- _context46.n = 4;
26125
+ _context47.n = 4;
25976
26126
  return effects.put(updateMessageAC(message.id, {}, undefined, obj));
25977
26127
  case 4:
25978
- return _context46.a(2);
26128
+ return _context47.a(2);
25979
26129
  }
25980
- }, _marked40$1);
26130
+ }, _marked41$1);
25981
26131
  }
25982
26132
  function deletePollVote(action) {
25983
26133
  var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, vote, pendingAction, conflictCheck, channel, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj, _t46;
25984
- return _regenerator().w(function (_context47) {
25985
- while (1) switch (_context47.p = _context47.n) {
26134
+ return _regenerator().w(function (_context48) {
26135
+ while (1) switch (_context48.p = _context48.n) {
25986
26136
  case 0:
25987
- _context47.p = 0;
26137
+ _context48.p = 0;
25988
26138
  payload = action.payload;
25989
26139
  channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
25990
26140
  sceytChatClient = getClient();
25991
26141
  if (!sceytChatClient) {
25992
- _context47.n = 7;
26142
+ _context48.n = 7;
25993
26143
  break;
25994
26144
  }
25995
26145
  vote = (_message$pollDetails1 = message.pollDetails) === null || _message$pollDetails1 === void 0 ? void 0 : (_message$pollDetails10 = _message$pollDetails1.voteDetails) === null || _message$pollDetails10 === void 0 ? void 0 : (_message$pollDetails11 = _message$pollDetails10.ownVotes) === null || _message$pollDetails11 === void 0 ? void 0 : _message$pollDetails11.find(function (vote) {
25996
26146
  return vote.optionId === optionId;
25997
26147
  });
25998
26148
  if (vote) {
25999
- _context47.n = 1;
26149
+ _context48.n = 1;
26000
26150
  break;
26001
26151
  }
26002
- return _context47.a(2);
26152
+ return _context48.a(2);
26003
26153
  case 1:
26004
26154
  pendingAction = {
26005
26155
  type: 'DELETE_POLL_VOTE',
@@ -26010,19 +26160,19 @@ function deletePollVote(action) {
26010
26160
  };
26011
26161
  conflictCheck = checkPendingPollActionConflict(pendingAction);
26012
26162
  if (!(conflictCheck.hasConflict && conflictCheck.shouldSkip)) {
26013
- _context47.n = 5;
26163
+ _context48.n = 5;
26014
26164
  break;
26015
26165
  }
26016
- _context47.n = 2;
26166
+ _context48.n = 2;
26017
26167
  return effects.call(getChannelFromMap, channelId);
26018
26168
  case 2:
26019
- channel = _context47.v;
26169
+ channel = _context48.v;
26020
26170
  if (!channel) {
26021
- _context47.n = 4;
26171
+ _context48.n = 4;
26022
26172
  break;
26023
26173
  }
26024
26174
  currentMessage = getMessageFromMap(channelId, message.id) || message;
26025
- _context47.n = 3;
26175
+ _context48.n = 3;
26026
26176
  return effects.put(deletePollVotesFromListAC(pollId, optionId, [(_currentMessage$pollD4 = currentMessage.pollDetails) === null || _currentMessage$pollD4 === void 0 ? void 0 : (_currentMessage$pollD5 = _currentMessage$pollD4.voteDetails) === null || _currentMessage$pollD5 === void 0 ? void 0 : (_currentMessage$pollD6 = _currentMessage$pollD5.ownVotes) === null || _currentMessage$pollD6 === void 0 ? void 0 : _currentMessage$pollD6[0]], message.id));
26027
26177
  case 3:
26028
26178
  obj = {
@@ -26033,45 +26183,45 @@ function deletePollVote(action) {
26033
26183
  messageId: message.id,
26034
26184
  params: {}
26035
26185
  }, obj);
26036
- _context47.n = 4;
26186
+ _context48.n = 4;
26037
26187
  return effects.put(updateMessageAC(message.id, {}, undefined, obj));
26038
26188
  case 4:
26039
- _context47.n = 6;
26189
+ _context48.n = 6;
26040
26190
  break;
26041
26191
  case 5:
26042
26192
  if (conflictCheck.shouldSkip) {
26043
- _context47.n = 6;
26193
+ _context48.n = 6;
26044
26194
  break;
26045
26195
  }
26046
- _context47.n = 6;
26196
+ _context48.n = 6;
26047
26197
  return effects.call(updateMessageOptimisticallyForDeletePollVote, channelId, message, vote);
26048
26198
  case 6:
26049
26199
  if (!conflictCheck.shouldSkip && !isResend) {
26050
26200
  setPendingPollAction(pendingAction);
26051
26201
  }
26052
- _context47.n = 7;
26202
+ _context48.n = 7;
26053
26203
  return effects.call(executeDeletePollVote, channelId, pollId, optionId, message);
26054
26204
  case 7:
26055
- _context47.n = 9;
26205
+ _context48.n = 9;
26056
26206
  break;
26057
26207
  case 8:
26058
- _context47.p = 8;
26059
- _t46 = _context47.v;
26208
+ _context48.p = 8;
26209
+ _t46 = _context48.v;
26060
26210
  log.error('error in delete poll vote', _t46);
26061
26211
  case 9:
26062
- return _context47.a(2);
26212
+ return _context48.a(2);
26063
26213
  }
26064
- }, _marked41$1, null, [[0, 8]]);
26214
+ }, _marked42, null, [[0, 8]]);
26065
26215
  }
26066
26216
  function executeClosePoll(channelId, pollId, message) {
26067
26217
  var channel, obj;
26068
- return _regenerator().w(function (_context48) {
26069
- while (1) switch (_context48.n) {
26218
+ return _regenerator().w(function (_context49) {
26219
+ while (1) switch (_context49.n) {
26070
26220
  case 0:
26071
- _context48.n = 1;
26221
+ _context49.n = 1;
26072
26222
  return effects.call(getChannelFromMap, channelId);
26073
26223
  case 1:
26074
- channel = _context48.v;
26224
+ channel = _context49.v;
26075
26225
  obj = {
26076
26226
  type: 'close'
26077
26227
  };
@@ -26079,37 +26229,37 @@ function executeClosePoll(channelId, pollId, message) {
26079
26229
  messageId: message.id,
26080
26230
  params: {}
26081
26231
  }, obj);
26082
- _context48.n = 2;
26232
+ _context49.n = 2;
26083
26233
  return effects.put(updateMessageAC(message.id, {}, undefined, obj));
26084
26234
  case 2:
26085
26235
  if (!(channel && message.id)) {
26086
- _context48.n = 4;
26236
+ _context49.n = 4;
26087
26237
  break;
26088
26238
  }
26089
- _context48.n = 3;
26239
+ _context49.n = 3;
26090
26240
  return effects.call(channel.closePoll, message.id, pollId);
26091
26241
  case 3:
26092
- _context48.n = 4;
26242
+ _context49.n = 4;
26093
26243
  return effects.put(removePendingPollActionAC(message.id, 'CLOSE_POLL'));
26094
26244
  case 4:
26095
- return _context48.a(2);
26245
+ return _context49.a(2);
26096
26246
  }
26097
- }, _marked42);
26247
+ }, _marked43);
26098
26248
  }
26099
26249
  function updateMessageOptimisticallyForClosePoll(channelId, message) {
26100
26250
  var channel, pollDetails;
26101
- return _regenerator().w(function (_context49) {
26102
- while (1) switch (_context49.n) {
26251
+ return _regenerator().w(function (_context50) {
26252
+ while (1) switch (_context50.n) {
26103
26253
  case 0:
26104
- _context49.n = 1;
26254
+ _context50.n = 1;
26105
26255
  return effects.call(getChannelFromMap, channelId);
26106
26256
  case 1:
26107
- channel = _context49.v;
26257
+ channel = _context50.v;
26108
26258
  if (channel) {
26109
- _context49.n = 2;
26259
+ _context50.n = 2;
26110
26260
  break;
26111
26261
  }
26112
- return _context49.a(2);
26262
+ return _context50.a(2);
26113
26263
  case 2:
26114
26264
  pollDetails = JSON.parse(JSON.stringify(message.pollDetails));
26115
26265
  pollDetails.closed = true;
@@ -26120,34 +26270,34 @@ function updateMessageOptimisticallyForClosePoll(channelId, message) {
26120
26270
  pollDetails: pollDetails
26121
26271
  }
26122
26272
  });
26123
- _context49.n = 3;
26273
+ _context50.n = 3;
26124
26274
  return effects.put(updateMessageAC(message.id, {
26125
26275
  pollDetails: pollDetails
26126
26276
  }));
26127
26277
  case 3:
26128
- return _context49.a(2);
26278
+ return _context50.a(2);
26129
26279
  }
26130
- }, _marked43);
26280
+ }, _marked44);
26131
26281
  }
26132
26282
  function closePoll(action) {
26133
26283
  var payload, channelId, pollId, message, sceytChatClient, connectionState, _t47;
26134
- return _regenerator().w(function (_context50) {
26135
- while (1) switch (_context50.p = _context50.n) {
26284
+ return _regenerator().w(function (_context51) {
26285
+ while (1) switch (_context51.p = _context51.n) {
26136
26286
  case 0:
26137
- _context50.p = 0;
26287
+ _context51.p = 0;
26138
26288
  payload = action.payload;
26139
26289
  channelId = payload.channelId, pollId = payload.pollId, message = payload.message;
26140
26290
  sceytChatClient = getClient();
26141
26291
  if (!sceytChatClient) {
26142
- _context50.n = 3;
26292
+ _context51.n = 3;
26143
26293
  break;
26144
26294
  }
26145
26295
  connectionState = sceytChatClient.connectionState;
26146
26296
  if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
26147
- _context50.n = 2;
26297
+ _context51.n = 2;
26148
26298
  break;
26149
26299
  }
26150
- _context50.n = 1;
26300
+ _context51.n = 1;
26151
26301
  return effects.call(updateMessageOptimisticallyForClosePoll, channelId, message);
26152
26302
  case 1:
26153
26303
  setPendingPollAction({
@@ -26156,39 +26306,39 @@ function closePoll(action) {
26156
26306
  pollId: pollId,
26157
26307
  message: message
26158
26308
  });
26159
- return _context50.a(2);
26309
+ return _context51.a(2);
26160
26310
  case 2:
26161
- _context50.n = 3;
26311
+ _context51.n = 3;
26162
26312
  return effects.call(executeClosePoll, channelId, pollId, message);
26163
26313
  case 3:
26164
- _context50.n = 5;
26314
+ _context51.n = 5;
26165
26315
  break;
26166
26316
  case 4:
26167
- _context50.p = 4;
26168
- _t47 = _context50.v;
26317
+ _context51.p = 4;
26318
+ _t47 = _context51.v;
26169
26319
  log.error('error in close poll', _t47);
26170
26320
  case 5:
26171
- return _context50.a(2);
26321
+ return _context51.a(2);
26172
26322
  }
26173
- }, _marked44, null, [[0, 4]]);
26323
+ }, _marked45, null, [[0, 4]]);
26174
26324
  }
26175
26325
  function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
26176
26326
  var channel, _iterator5, _step5, obj;
26177
- return _regenerator().w(function (_context51) {
26178
- while (1) switch (_context51.n) {
26327
+ return _regenerator().w(function (_context52) {
26328
+ while (1) switch (_context52.n) {
26179
26329
  case 0:
26180
- _context51.n = 1;
26330
+ _context52.n = 1;
26181
26331
  return effects.call(getChannelFromMap, channelId);
26182
26332
  case 1:
26183
- channel = _context51.v;
26333
+ channel = _context52.v;
26184
26334
  if (isResend) {
26185
- _context51.n = 4;
26335
+ _context52.n = 4;
26186
26336
  break;
26187
26337
  }
26188
26338
  _iterator5 = _createForOfIteratorHelperLoose(objs);
26189
26339
  case 2:
26190
26340
  if ((_step5 = _iterator5()).done) {
26191
- _context51.n = 4;
26341
+ _context52.n = 4;
26192
26342
  break;
26193
26343
  }
26194
26344
  obj = _step5.value;
@@ -26196,45 +26346,45 @@ function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
26196
26346
  messageId: message.id,
26197
26347
  params: {}
26198
26348
  }, obj);
26199
- _context51.n = 3;
26349
+ _context52.n = 3;
26200
26350
  return effects.put(updateMessageAC(message.id, {}, undefined, obj));
26201
26351
  case 3:
26202
- _context51.n = 2;
26352
+ _context52.n = 2;
26203
26353
  break;
26204
26354
  case 4:
26205
26355
  if (!(channel && message.id)) {
26206
- _context51.n = 6;
26356
+ _context52.n = 6;
26207
26357
  break;
26208
26358
  }
26209
- _context51.n = 5;
26359
+ _context52.n = 5;
26210
26360
  return effects.call(channel.retractVote, message.id, pollId);
26211
26361
  case 5:
26212
- _context51.n = 6;
26362
+ _context52.n = 6;
26213
26363
  return effects.put(removePendingPollActionAC(message.id || '', 'RETRACT_POLL_VOTE'));
26214
26364
  case 6:
26215
- return _context51.a(2);
26365
+ return _context52.a(2);
26216
26366
  }
26217
- }, _marked45);
26367
+ }, _marked46);
26218
26368
  }
26219
26369
  function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs) {
26220
26370
  var channel, _iterator6, _step6, obj;
26221
- return _regenerator().w(function (_context52) {
26222
- while (1) switch (_context52.n) {
26371
+ return _regenerator().w(function (_context53) {
26372
+ while (1) switch (_context53.n) {
26223
26373
  case 0:
26224
- _context52.n = 1;
26374
+ _context53.n = 1;
26225
26375
  return effects.call(getChannelFromMap, channelId);
26226
26376
  case 1:
26227
- channel = _context52.v;
26377
+ channel = _context53.v;
26228
26378
  if (channel) {
26229
- _context52.n = 2;
26379
+ _context53.n = 2;
26230
26380
  break;
26231
26381
  }
26232
- return _context52.a(2);
26382
+ return _context53.a(2);
26233
26383
  case 2:
26234
26384
  _iterator6 = _createForOfIteratorHelperLoose(objs);
26235
26385
  case 3:
26236
26386
  if ((_step6 = _iterator6()).done) {
26237
- _context52.n = 5;
26387
+ _context53.n = 5;
26238
26388
  break;
26239
26389
  }
26240
26390
  obj = _step6.value;
@@ -26242,27 +26392,27 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
26242
26392
  messageId: message.id,
26243
26393
  params: {}
26244
26394
  });
26245
- _context52.n = 4;
26395
+ _context53.n = 4;
26246
26396
  return effects.put(updateMessageAC(message.id, {}, undefined, obj));
26247
26397
  case 4:
26248
- _context52.n = 3;
26398
+ _context53.n = 3;
26249
26399
  break;
26250
26400
  case 5:
26251
- return _context52.a(2);
26401
+ return _context53.a(2);
26252
26402
  }
26253
- }, _marked46);
26403
+ }, _marked47);
26254
26404
  }
26255
26405
  function retractPollVote(action) {
26256
26406
  var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator7, _step7, _message$pollDetails12, _message$pollDetails13, vote, _t48;
26257
- return _regenerator().w(function (_context53) {
26258
- while (1) switch (_context53.p = _context53.n) {
26407
+ return _regenerator().w(function (_context54) {
26408
+ while (1) switch (_context54.p = _context54.n) {
26259
26409
  case 0:
26260
- _context53.p = 0;
26410
+ _context54.p = 0;
26261
26411
  payload = action.payload;
26262
26412
  channelId = payload.channelId, pollId = payload.pollId, message = payload.message, isResend = payload.isResend;
26263
26413
  sceytChatClient = getClient();
26264
26414
  if (!sceytChatClient) {
26265
- _context53.n = 3;
26415
+ _context54.n = 3;
26266
26416
  break;
26267
26417
  }
26268
26418
  connectionState = sceytChatClient.connectionState;
@@ -26275,10 +26425,10 @@ function retractPollVote(action) {
26275
26425
  });
26276
26426
  }
26277
26427
  if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
26278
- _context53.n = 2;
26428
+ _context54.n = 2;
26279
26429
  break;
26280
26430
  }
26281
- _context53.n = 1;
26431
+ _context54.n = 1;
26282
26432
  return effects.call(updateMessageOptimisticallyForRetractPollVote, channelId, message, objs);
26283
26433
  case 1:
26284
26434
  setPendingPollAction({
@@ -26287,36 +26437,36 @@ function retractPollVote(action) {
26287
26437
  pollId: pollId,
26288
26438
  message: message
26289
26439
  });
26290
- return _context53.a(2);
26440
+ return _context54.a(2);
26291
26441
  case 2:
26292
- _context53.n = 3;
26442
+ _context54.n = 3;
26293
26443
  return effects.call(executeRetractPollVote, channelId, pollId, message, objs, isResend);
26294
26444
  case 3:
26295
- _context53.n = 5;
26445
+ _context54.n = 5;
26296
26446
  break;
26297
26447
  case 4:
26298
- _context53.p = 4;
26299
- _t48 = _context53.v;
26448
+ _context54.p = 4;
26449
+ _t48 = _context54.v;
26300
26450
  log.error('error in retract poll vote', _t48);
26301
26451
  case 5:
26302
- return _context53.a(2);
26452
+ return _context54.a(2);
26303
26453
  }
26304
- }, _marked47, null, [[0, 4]]);
26454
+ }, _marked48, null, [[0, 4]]);
26305
26455
  }
26306
26456
  function resendPendingPollActions(action) {
26307
26457
  var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy, _t49;
26308
- return _regenerator().w(function (_context54) {
26309
- while (1) switch (_context54.p = _context54.n) {
26458
+ return _regenerator().w(function (_context55) {
26459
+ while (1) switch (_context55.p = _context55.n) {
26310
26460
  case 0:
26311
- _context54.p = 0;
26461
+ _context55.p = 0;
26312
26462
  payload = action.payload;
26313
26463
  connectionState = payload.connectionState;
26314
26464
  sceytChatClient = getClient();
26315
26465
  if (!(!sceytChatClient || connectionState !== CONNECTION_STATUS.CONNECTED)) {
26316
- _context54.n = 1;
26466
+ _context55.n = 1;
26317
26467
  break;
26318
26468
  }
26319
- return _context54.a(2);
26469
+ return _context55.a(2);
26320
26470
  case 1:
26321
26471
  pendingPollActionsMap = store.getState().MessageReducer.pendingPollActions;
26322
26472
  pendingPollActionsMapCopy = JSON.parse(JSON.stringify(pendingPollActionsMap));
@@ -26349,30 +26499,30 @@ function resendPendingPollActions(action) {
26349
26499
  }
26350
26500
  });
26351
26501
  });
26352
- _context54.n = 3;
26502
+ _context55.n = 3;
26353
26503
  break;
26354
26504
  case 2:
26355
- _context54.p = 2;
26356
- _t49 = _context54.v;
26505
+ _context55.p = 2;
26506
+ _t49 = _context55.v;
26357
26507
  log.error('error in resend pending poll actions', _t49);
26358
26508
  case 3:
26359
- return _context54.a(2);
26509
+ return _context55.a(2);
26360
26510
  }
26361
- }, _marked48, null, [[0, 2]]);
26511
+ }, _marked49, null, [[0, 2]]);
26362
26512
  }
26363
26513
  function resendPendingMessageMutations(action) {
26364
26514
  var payload, connectionState, pendingMutations, _iterator8, _step8, mutation, currentMutation, channel, _t50, _t51;
26365
- return _regenerator().w(function (_context55) {
26366
- while (1) switch (_context55.p = _context55.n) {
26515
+ return _regenerator().w(function (_context56) {
26516
+ while (1) switch (_context56.p = _context56.n) {
26367
26517
  case 0:
26368
- _context55.p = 0;
26518
+ _context56.p = 0;
26369
26519
  payload = action.payload;
26370
26520
  connectionState = payload.connectionState;
26371
26521
  if (!(connectionState !== CONNECTION_STATUS.CONNECTED || !isMessageMutationConnected())) {
26372
- _context55.n = 1;
26522
+ _context56.n = 1;
26373
26523
  break;
26374
26524
  }
26375
- return _context55.a(2);
26525
+ return _context56.a(2);
26376
26526
  case 1:
26377
26527
  pendingMutations = Object.values(getPendingMessageMutations()).sort(function (left, right) {
26378
26528
  return left.queuedAt - right.queuedAt;
@@ -26380,98 +26530,98 @@ function resendPendingMessageMutations(action) {
26380
26530
  _iterator8 = _createForOfIteratorHelperLoose(pendingMutations);
26381
26531
  case 2:
26382
26532
  if ((_step8 = _iterator8()).done) {
26383
- _context55.n = 16;
26533
+ _context56.n = 16;
26384
26534
  break;
26385
26535
  }
26386
26536
  mutation = _step8.value;
26387
26537
  currentMutation = getPendingMessageMutations()[mutation.messageId];
26388
26538
  if (!(!currentMutation || currentMutation.queuedAt !== mutation.queuedAt || currentMutation.type !== mutation.type)) {
26389
- _context55.n = 3;
26539
+ _context56.n = 3;
26390
26540
  break;
26391
26541
  }
26392
- return _context55.a(3, 15);
26542
+ return _context56.a(3, 15);
26393
26543
  case 3:
26394
26544
  if (isMessageMutationConnected()) {
26395
- _context55.n = 4;
26545
+ _context56.n = 4;
26396
26546
  break;
26397
26547
  }
26398
- return _context55.a(2);
26548
+ return _context56.a(2);
26399
26549
  case 4:
26400
- _context55.n = 5;
26550
+ _context56.n = 5;
26401
26551
  return effects.call(getChannelForMessageMutation, mutation.channelId);
26402
26552
  case 5:
26403
- channel = _context55.v;
26553
+ channel = _context56.v;
26404
26554
  if (channel) {
26405
- _context55.n = 7;
26555
+ _context56.n = 7;
26406
26556
  break;
26407
26557
  }
26408
- _context55.n = 6;
26558
+ _context56.n = 6;
26409
26559
  return effects.put(removePendingMessageMutationAC(mutation.messageId));
26410
26560
  case 6:
26411
- return _context55.a(3, 15);
26561
+ return _context56.a(3, 15);
26412
26562
  case 7:
26413
- _context55.p = 7;
26563
+ _context56.p = 7;
26414
26564
  if (!(mutation.type === 'DELETE_MESSAGE')) {
26415
- _context55.n = 9;
26565
+ _context56.n = 9;
26416
26566
  break;
26417
26567
  }
26418
- _context55.n = 8;
26568
+ _context56.n = 8;
26419
26569
  return effects.call(executeDeleteMessageMutation, channel, mutation.messageId, mutation.deleteOption);
26420
26570
  case 8:
26421
- _context55.n = 10;
26571
+ _context56.n = 10;
26422
26572
  break;
26423
26573
  case 9:
26424
- _context55.n = 10;
26574
+ _context56.n = 10;
26425
26575
  return effects.call(executeEditMessageMutation, channel, mutation.message);
26426
26576
  case 10:
26427
- _context55.n = 15;
26577
+ _context56.n = 15;
26428
26578
  break;
26429
26579
  case 11:
26430
- _context55.p = 11;
26431
- _t50 = _context55.v;
26580
+ _context56.p = 11;
26581
+ _t50 = _context56.v;
26432
26582
  if (isMessageMutationConnected()) {
26433
- _context55.n = 12;
26583
+ _context56.n = 12;
26434
26584
  break;
26435
26585
  }
26436
- return _context55.a(2);
26586
+ return _context56.a(2);
26437
26587
  case 12:
26438
- _context55.n = 13;
26588
+ _context56.n = 13;
26439
26589
  return effects.call(applyLocalMessageUpdate, mutation.channelId, mutation.messageId, cloneSerializable(mutation.originalMessage));
26440
26590
  case 13:
26441
- _context55.n = 14;
26591
+ _context56.n = 14;
26442
26592
  return effects.put(removePendingMessageMutationAC(mutation.messageId));
26443
26593
  case 14:
26444
26594
  log.error('error in resend pending message mutations', _t50);
26445
26595
  case 15:
26446
- _context55.n = 2;
26596
+ _context56.n = 2;
26447
26597
  break;
26448
26598
  case 16:
26449
- _context55.n = 18;
26599
+ _context56.n = 18;
26450
26600
  break;
26451
26601
  case 17:
26452
- _context55.p = 17;
26453
- _t51 = _context55.v;
26602
+ _context56.p = 17;
26603
+ _t51 = _context56.v;
26454
26604
  log.error('error in resend pending message mutations', _t51);
26455
26605
  case 18:
26456
- return _context55.a(2);
26606
+ return _context56.a(2);
26457
26607
  }
26458
- }, _marked49, null, [[7, 11], [0, 17]]);
26608
+ }, _marked50, null, [[7, 11], [0, 17]]);
26459
26609
  }
26460
26610
  function getPollVotes(action) {
26461
26611
  var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes, _t52;
26462
- return _regenerator().w(function (_context56) {
26463
- while (1) switch (_context56.p = _context56.n) {
26612
+ return _regenerator().w(function (_context57) {
26613
+ while (1) switch (_context57.p = _context57.n) {
26464
26614
  case 0:
26465
- _context56.p = 0;
26615
+ _context57.p = 0;
26466
26616
  payload = action.payload;
26467
26617
  messageId = payload.messageId, pollId = payload.pollId, optionId = payload.optionId, limit = payload.limit;
26468
26618
  key = pollId + "_" + optionId;
26469
- _context56.n = 1;
26619
+ _context57.n = 1;
26470
26620
  return effects.put(setPollVotesLoadingStateAC(pollId, optionId, LOADING_STATE.LOADING));
26471
26621
  case 1:
26472
26622
  SceytChatClient = getClient();
26473
26623
  if (!(!SceytChatClient || !SceytChatClient.PollVotesQueryBuilder)) {
26474
- _context56.n = 2;
26624
+ _context57.n = 2;
26475
26625
  break;
26476
26626
  }
26477
26627
  throw new Error('SceytChatClient or PollVotesQueryBuilder not available');
@@ -26479,14 +26629,14 @@ function getPollVotes(action) {
26479
26629
  queryBuilder = new SceytChatClient.PollVotesQueryBuilder(messageId, pollId);
26480
26630
  queryBuilder.setOptionId(optionId);
26481
26631
  queryBuilder.limit(limit || 20);
26482
- _context56.n = 3;
26632
+ _context57.n = 3;
26483
26633
  return effects.call(queryBuilder.build);
26484
26634
  case 3:
26485
- pollVotesQuery = _context56.v;
26486
- _context56.n = 4;
26635
+ pollVotesQuery = _context57.v;
26636
+ _context57.n = 4;
26487
26637
  return effects.call(pollVotesQuery.loadNext);
26488
26638
  case 4:
26489
- result = _context56.v;
26639
+ result = _context57.v;
26490
26640
  if (!query.PollVotesQueries) {
26491
26641
  query.PollVotesQueries = {};
26492
26642
  }
@@ -26514,39 +26664,39 @@ function getPollVotes(action) {
26514
26664
  }
26515
26665
  };
26516
26666
  });
26517
- _context56.n = 5;
26667
+ _context57.n = 5;
26518
26668
  return effects.put(setPollVotesListAC(pollId, optionId, formattedVotes, result.hasNext || false));
26519
26669
  case 5:
26520
- _context56.n = 6;
26670
+ _context57.n = 6;
26521
26671
  return effects.put(setPollVotesLoadingStateAC(pollId, optionId, LOADING_STATE.LOADED));
26522
26672
  case 6:
26523
- _context56.n = 8;
26673
+ _context57.n = 8;
26524
26674
  break;
26525
26675
  case 7:
26526
- _context56.p = 7;
26527
- _t52 = _context56.v;
26676
+ _context57.p = 7;
26677
+ _t52 = _context57.v;
26528
26678
  log.error('ERROR in get poll votes', _t52);
26529
- _context56.n = 8;
26679
+ _context57.n = 8;
26530
26680
  return effects.put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
26531
26681
  case 8:
26532
- return _context56.a(2);
26682
+ return _context57.a(2);
26533
26683
  }
26534
- }, _marked50, null, [[0, 7]]);
26684
+ }, _marked51, null, [[0, 7]]);
26535
26685
  }
26536
26686
  function loadMorePollVotes(action) {
26537
26687
  var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes, _t53;
26538
- return _regenerator().w(function (_context57) {
26539
- while (1) switch (_context57.p = _context57.n) {
26688
+ return _regenerator().w(function (_context58) {
26689
+ while (1) switch (_context58.p = _context58.n) {
26540
26690
  case 0:
26541
- _context57.p = 0;
26691
+ _context58.p = 0;
26542
26692
  payload = action.payload;
26543
26693
  pollId = payload.pollId, optionId = payload.optionId, limit = payload.limit;
26544
26694
  key = pollId + "_" + optionId;
26545
- _context57.n = 1;
26695
+ _context58.n = 1;
26546
26696
  return effects.put(setPollVotesLoadingStateAC(pollId, optionId, LOADING_STATE.LOADING));
26547
26697
  case 1:
26548
26698
  if (!(!query.PollVotesQueries || !query.PollVotesQueries[key])) {
26549
- _context57.n = 2;
26699
+ _context58.n = 2;
26550
26700
  break;
26551
26701
  }
26552
26702
  throw new Error('Poll votes query not found');
@@ -26555,10 +26705,10 @@ function loadMorePollVotes(action) {
26555
26705
  if (limit && pollVotesQuery.limit < limit) {
26556
26706
  pollVotesQuery.limit = limit;
26557
26707
  }
26558
- _context57.n = 3;
26708
+ _context58.n = 3;
26559
26709
  return effects.call(pollVotesQuery.loadNext);
26560
26710
  case 3:
26561
- result = _context57.v;
26711
+ result = _context58.v;
26562
26712
  formattedVotes = (result.votes || []).map(function (vote) {
26563
26713
  return {
26564
26714
  optionId: vote.optionId || optionId,
@@ -26582,64 +26732,64 @@ function loadMorePollVotes(action) {
26582
26732
  }
26583
26733
  };
26584
26734
  });
26585
- _context57.n = 4;
26735
+ _context58.n = 4;
26586
26736
  return effects.put(addPollVotesToListAC(pollId, optionId, formattedVotes, result.hasNext || false));
26587
26737
  case 4:
26588
- _context57.n = 5;
26738
+ _context58.n = 5;
26589
26739
  return effects.put(setPollVotesLoadingStateAC(pollId, optionId, LOADING_STATE.LOADED));
26590
26740
  case 5:
26591
- _context57.n = 7;
26741
+ _context58.n = 7;
26592
26742
  break;
26593
26743
  case 6:
26594
- _context57.p = 6;
26595
- _t53 = _context57.v;
26744
+ _context58.p = 6;
26745
+ _t53 = _context58.v;
26596
26746
  log.error('ERROR in load more poll votes', _t53);
26597
- _context57.n = 7;
26747
+ _context58.n = 7;
26598
26748
  return effects.put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
26599
26749
  case 7:
26600
- return _context57.a(2);
26750
+ return _context58.a(2);
26601
26751
  }
26602
- }, _marked51, null, [[0, 6]]);
26752
+ }, _marked52, null, [[0, 6]]);
26603
26753
  }
26604
26754
  var REFRESH_WINDOW_HALF = 30;
26605
26755
  function refreshCacheAroundMessage(action) {
26606
- var _action$payload9, channelId, messageId, _action$payload9$appl, applyVisibleWindow, connectionState, activeChannelId, activeMessages, activeConfirmedMessages, centerMessageIndex, refreshAnchorId, previousLimit, nextLimit, SceytChatClient, messageQueryBuilder, messageQuery, prevResult, pivotId, nextResult, loadedMessages, firstId, lastId, activeById, changed, filteredPendingMessages, _t54, _t55, _t56;
26607
- return _regenerator().w(function (_context58) {
26608
- while (1) switch (_context58.p = _context58.n) {
26756
+ var _action$payload0, channelId, messageId, _action$payload0$appl, applyVisibleWindow, connectionState, activeChannelId, activeMessages, activeConfirmedMessages, centerMessageIndex, refreshAnchorId, previousLimit, nextLimit, SceytChatClient, messageQueryBuilder, messageQuery, prevResult, pivotId, nextResult, loadedMessages, firstId, lastId, activeById, changed, filteredPendingMessages, _t54, _t55, _t56;
26757
+ return _regenerator().w(function (_context59) {
26758
+ while (1) switch (_context59.p = _context59.n) {
26609
26759
  case 0:
26610
- _context58.p = 0;
26611
- _action$payload9 = action.payload, channelId = _action$payload9.channelId, messageId = _action$payload9.messageId, _action$payload9$appl = _action$payload9.applyVisibleWindow, applyVisibleWindow = _action$payload9$appl === void 0 ? true : _action$payload9$appl;
26760
+ _context59.p = 0;
26761
+ _action$payload0 = action.payload, channelId = _action$payload0.channelId, messageId = _action$payload0.messageId, _action$payload0$appl = _action$payload0.applyVisibleWindow, applyVisibleWindow = _action$payload0$appl === void 0 ? true : _action$payload0$appl;
26612
26762
  connectionState = store.getState().UserReducer.connectionStatus;
26613
26763
  if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
26614
- _context58.n = 1;
26764
+ _context59.n = 1;
26615
26765
  break;
26616
26766
  }
26617
- return _context58.a(2);
26767
+ return _context59.a(2);
26618
26768
  case 1:
26619
26769
  activeChannelId = getActiveChannelId();
26620
26770
  if (!(activeChannelId !== channelId)) {
26621
- _context58.n = 2;
26771
+ _context59.n = 2;
26622
26772
  break;
26623
26773
  }
26624
- return _context58.a(2);
26774
+ return _context59.a(2);
26625
26775
  case 2:
26626
26776
  activeMessages = store.getState().MessageReducer.activeChannelMessages || [];
26627
26777
  activeConfirmedMessages = activeMessages.filter(function (message) {
26628
26778
  return !!message.id;
26629
26779
  });
26630
26780
  if (activeConfirmedMessages.length) {
26631
- _context58.n = 3;
26781
+ _context59.n = 3;
26632
26782
  break;
26633
26783
  }
26634
- return _context58.a(2);
26784
+ return _context59.a(2);
26635
26785
  case 3:
26636
26786
  centerMessageIndex = getCenterTwoMessages(activeConfirmedMessages);
26637
26787
  refreshAnchorId = centerMessageIndex.mid2.messageId || messageId;
26638
26788
  if (refreshAnchorId) {
26639
- _context58.n = 4;
26789
+ _context59.n = 4;
26640
26790
  break;
26641
26791
  }
26642
- return _context58.a(2);
26792
+ return _context59.a(2);
26643
26793
  case 4:
26644
26794
  previousLimit = activeConfirmedMessages.length === 1 ? 1 : Math.min(REFRESH_WINDOW_HALF, centerMessageIndex.mid2.index);
26645
26795
  nextLimit = Math.min(REFRESH_WINDOW_HALF, Math.max(0, activeConfirmedMessages.length - centerMessageIndex.mid1.index - 1));
@@ -26647,20 +26797,20 @@ function refreshCacheAroundMessage(action) {
26647
26797
  messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channelId);
26648
26798
  messageQueryBuilder.limit(REFRESH_WINDOW_HALF);
26649
26799
  messageQueryBuilder.reverse(true);
26650
- _context58.n = 5;
26800
+ _context59.n = 5;
26651
26801
  return effects.call(messageQueryBuilder.build);
26652
26802
  case 5:
26653
- messageQuery = _context58.v;
26803
+ messageQuery = _context59.v;
26654
26804
  messageQuery.limit = previousLimit;
26655
26805
  if (!(previousLimit > 0)) {
26656
- _context58.n = 7;
26806
+ _context59.n = 7;
26657
26807
  break;
26658
26808
  }
26659
- _context58.n = 6;
26809
+ _context59.n = 6;
26660
26810
  return effects.call(messageQuery.loadPreviousMessageId, refreshAnchorId);
26661
26811
  case 6:
26662
- _t54 = _context58.v;
26663
- _context58.n = 8;
26812
+ _t54 = _context59.v;
26813
+ _context59.n = 8;
26664
26814
  break;
26665
26815
  case 7:
26666
26816
  _t54 = {
@@ -26673,14 +26823,14 @@ function refreshCacheAroundMessage(action) {
26673
26823
  messageQuery.reverse = false;
26674
26824
  messageQuery.limit = nextLimit;
26675
26825
  if (!(nextLimit > 0 && pivotId)) {
26676
- _context58.n = 10;
26826
+ _context59.n = 10;
26677
26827
  break;
26678
26828
  }
26679
- _context58.n = 9;
26829
+ _context59.n = 9;
26680
26830
  return effects.call(messageQuery.loadNextMessageId, pivotId);
26681
26831
  case 9:
26682
- _t55 = _context58.v;
26683
- _context58.n = 11;
26832
+ _t55 = _context59.v;
26833
+ _context59.n = 11;
26684
26834
  break;
26685
26835
  case 10:
26686
26836
  _t55 = {
@@ -26691,10 +26841,10 @@ function refreshCacheAroundMessage(action) {
26691
26841
  nextResult = _t55;
26692
26842
  loadedMessages = [].concat(prevResult.messages, nextResult.messages);
26693
26843
  if (!(loadedMessages.length === 0)) {
26694
- _context58.n = 12;
26844
+ _context59.n = 12;
26695
26845
  break;
26696
26846
  }
26697
- return _context58.a(2);
26847
+ return _context59.a(2);
26698
26848
  case 12:
26699
26849
  firstId = getFirstConfirmedMessageId(loadedMessages);
26700
26850
  lastId = getLastConfirmedMessageId(loadedMessages);
@@ -26702,11 +26852,11 @@ function refreshCacheAroundMessage(action) {
26702
26852
  setMessagesToMap(channelId, loadedMessages, firstId, lastId);
26703
26853
  setActiveSegment(channelId, firstId, lastId);
26704
26854
  }
26705
- _context58.n = 13;
26855
+ _context59.n = 13;
26706
26856
  return effects.call(loadOGMetadataForLinkMessages, loadedMessages, true, false, false);
26707
26857
  case 13:
26708
26858
  if (!sameConfirmedWindow(activeConfirmedMessages, loadedMessages)) {
26709
- _context58.n = 15;
26859
+ _context59.n = 15;
26710
26860
  break;
26711
26861
  }
26712
26862
  activeById = new Map(activeConfirmedMessages.map(function (currentMessage) {
@@ -26719,151 +26869,151 @@ function refreshCacheAroundMessage(action) {
26719
26869
  return JSON.stringify(existing) !== JSON.stringify(loaded);
26720
26870
  });
26721
26871
  if (!(changed.length > 0)) {
26722
- _context58.n = 14;
26872
+ _context59.n = 14;
26723
26873
  break;
26724
26874
  }
26725
- _context58.n = 14;
26875
+ _context59.n = 14;
26726
26876
  return effects.put(patchMessagesAC(changed));
26727
26877
  case 14:
26728
- return _context58.a(2);
26878
+ return _context59.a(2);
26729
26879
  case 15:
26730
26880
  if (applyVisibleWindow) {
26731
- _context58.n = 16;
26881
+ _context59.n = 16;
26732
26882
  break;
26733
26883
  }
26734
- return _context58.a(2);
26884
+ return _context59.a(2);
26735
26885
  case 16:
26736
- _context58.n = 17;
26886
+ _context59.n = 17;
26737
26887
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(loadedMessages)), channelId));
26738
26888
  case 17:
26739
26889
  filteredPendingMessages = getFilteredPendingMessages(channelId, loadedMessages);
26740
26890
  if (!(filteredPendingMessages.length > 0)) {
26741
- _context58.n = 19;
26891
+ _context59.n = 19;
26742
26892
  break;
26743
26893
  }
26744
- _context58.n = 18;
26894
+ _context59.n = 18;
26745
26895
  return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
26746
26896
  case 18:
26747
- _context58.n = 19;
26897
+ _context59.n = 19;
26748
26898
  return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true, false, false);
26749
26899
  case 19:
26750
- _context58.n = 21;
26900
+ _context59.n = 21;
26751
26901
  break;
26752
26902
  case 20:
26753
- _context58.p = 20;
26754
- _t56 = _context58.v;
26903
+ _context59.p = 20;
26904
+ _t56 = _context59.v;
26755
26905
  log.error('error in refreshCacheAroundMessage', _t56);
26756
26906
  case 21:
26757
- return _context58.a(2);
26907
+ return _context59.a(2);
26758
26908
  }
26759
- }, _marked52, null, [[0, 20]]);
26909
+ }, _marked53, null, [[0, 20]]);
26760
26910
  }
26761
26911
  function MessageSaga() {
26762
- return _regenerator().w(function (_context59) {
26763
- while (1) switch (_context59.n) {
26912
+ return _regenerator().w(function (_context60) {
26913
+ while (1) switch (_context60.n) {
26764
26914
  case 0:
26765
- _context59.n = 1;
26915
+ _context60.n = 1;
26766
26916
  return effects.takeEvery(SEND_MESSAGE, sendMessage);
26767
26917
  case 1:
26768
- _context59.n = 2;
26918
+ _context60.n = 2;
26769
26919
  return effects.takeEvery(SEND_TEXT_MESSAGE, sendTextMessage);
26770
26920
  case 2:
26771
- _context59.n = 3;
26921
+ _context60.n = 3;
26772
26922
  return effects.takeEvery(FORWARD_MESSAGE, forwardMessage);
26773
26923
  case 3:
26774
- _context59.n = 4;
26924
+ _context60.n = 4;
26775
26925
  return effects.takeEvery(RESEND_MESSAGE, resendMessage);
26776
26926
  case 4:
26777
- _context59.n = 5;
26927
+ _context60.n = 5;
26778
26928
  return effects.takeLatest(EDIT_MESSAGE, editMessage);
26779
26929
  case 5:
26780
- _context59.n = 6;
26930
+ _context60.n = 6;
26781
26931
  return effects.takeEvery(DELETE_MESSAGE, deleteMessage);
26782
26932
  case 6:
26783
- _context59.n = 7;
26933
+ _context60.n = 7;
26784
26934
  return effects.takeLatest(RELOAD_ACTIVE_CHANNEL_AFTER_RECONNECT, reloadActiveChannelAfterReconnect);
26785
26935
  case 7:
26786
- _context59.n = 8;
26936
+ _context60.n = 8;
26787
26937
  return effects.takeLatest(LOAD_LATEST_MESSAGES, getMessagesQuery);
26788
26938
  case 8:
26789
- _context59.n = 9;
26939
+ _context60.n = 9;
26790
26940
  return effects.takeLatest(LOAD_AROUND_MESSAGE, loadAroundMessage);
26791
26941
  case 9:
26792
- _context59.n = 10;
26942
+ _context60.n = 10;
26793
26943
  return effects.takeLatest(REFRESH_CACHE_AROUND_MESSAGE, refreshCacheAroundMessage);
26794
26944
  case 10:
26795
- _context59.n = 11;
26945
+ _context60.n = 11;
26796
26946
  return effects.takeLatest(LOAD_NEAR_UNREAD, loadNearUnread);
26797
26947
  case 11:
26798
- _context59.n = 12;
26948
+ _context60.n = 12;
26799
26949
  return effects.takeLatest(LOAD_DEFAULT_MESSAGES, loadDefaultMessages);
26800
26950
  case 12:
26801
- _context59.n = 13;
26951
+ _context60.n = 13;
26802
26952
  return effects.takeEvery(GET_MESSAGE, getMessageQuery);
26803
26953
  case 13:
26804
- _context59.n = 14;
26954
+ _context60.n = 14;
26805
26955
  return effects.takeLatest(GET_MESSAGE_MARKERS, getMessageMarkers);
26806
26956
  case 14:
26807
- _context59.n = 15;
26957
+ _context60.n = 15;
26808
26958
  return effects.takeLatest(GET_MESSAGES_ATTACHMENTS, getMessageAttachments);
26809
26959
  case 15:
26810
- _context59.n = 16;
26960
+ _context60.n = 16;
26811
26961
  return effects.takeLatest(LOAD_MORE_MESSAGES_ATTACHMENTS, loadMoreMessageAttachments);
26812
26962
  case 16:
26813
- _context59.n = 17;
26963
+ _context60.n = 17;
26814
26964
  return effects.takeLatest(ADD_REACTION, addReaction);
26815
26965
  case 17:
26816
- _context59.n = 18;
26966
+ _context60.n = 18;
26817
26967
  return effects.takeLatest(DELETE_REACTION, deleteReaction);
26818
26968
  case 18:
26819
- _context59.n = 19;
26969
+ _context60.n = 19;
26820
26970
  return effects.takeEvery(LOAD_MORE_MESSAGES, loadMoreMessages);
26821
26971
  case 19:
26822
- _context59.n = 20;
26972
+ _context60.n = 20;
26823
26973
  return effects.takeEvery(GET_REACTIONS, getReactions);
26824
26974
  case 20:
26825
- _context59.n = 21;
26975
+ _context60.n = 21;
26826
26976
  return effects.takeEvery(LOAD_MORE_REACTIONS, loadMoreReactions);
26827
26977
  case 21:
26828
- _context59.n = 22;
26978
+ _context60.n = 22;
26829
26979
  return effects.takeEvery(PAUSE_ATTACHMENT_UPLOADING, pauseAttachmentUploading);
26830
26980
  case 22:
26831
- _context59.n = 23;
26981
+ _context60.n = 23;
26832
26982
  return effects.takeEvery(RESUME_ATTACHMENT_UPLOADING, resumeAttachmentUploading);
26833
26983
  case 23:
26834
- _context59.n = 24;
26984
+ _context60.n = 24;
26835
26985
  return effects.takeEvery(ADD_POLL_VOTE, addPollVote);
26836
26986
  case 24:
26837
- _context59.n = 25;
26987
+ _context60.n = 25;
26838
26988
  return effects.takeEvery(DELETE_POLL_VOTE, deletePollVote);
26839
26989
  case 25:
26840
- _context59.n = 26;
26990
+ _context60.n = 26;
26841
26991
  return effects.takeEvery(CLOSE_POLL, closePoll);
26842
26992
  case 26:
26843
- _context59.n = 27;
26993
+ _context60.n = 27;
26844
26994
  return effects.takeEvery(RETRACT_POLL_VOTE, retractPollVote);
26845
26995
  case 27:
26846
- _context59.n = 28;
26996
+ _context60.n = 28;
26847
26997
  return effects.takeEvery(GET_POLL_VOTES, getPollVotes);
26848
26998
  case 28:
26849
- _context59.n = 29;
26999
+ _context60.n = 29;
26850
27000
  return effects.takeEvery(LOAD_MORE_POLL_VOTES, loadMorePollVotes);
26851
27001
  case 29:
26852
- _context59.n = 30;
27002
+ _context60.n = 30;
26853
27003
  return effects.takeEvery(RESEND_PENDING_POLL_ACTIONS, resendPendingPollActions);
26854
27004
  case 30:
26855
- _context59.n = 31;
27005
+ _context60.n = 31;
26856
27006
  return effects.takeLatest(RESEND_PENDING_MESSAGE_MUTATIONS, resendPendingMessageMutations);
26857
27007
  case 31:
26858
- _context59.n = 32;
27008
+ _context60.n = 32;
26859
27009
  return effects.takeEvery(LOAD_OG_METADATA_FOR_LINK, loadOGMetadataForLinkSaga);
26860
27010
  case 32:
26861
- _context59.n = 33;
27011
+ _context60.n = 33;
26862
27012
  return effects.takeEvery(FETCH_OG_METADATA, fetchOGMetadata);
26863
27013
  case 33:
26864
- return _context59.a(2);
27014
+ return _context60.a(2);
26865
27015
  }
26866
- }, _marked53);
27016
+ }, _marked54);
26867
27017
  }
26868
27018
 
26869
27019
  var _marked$4 = /*#__PURE__*/_regenerator().m(getMembers),
@@ -32031,76 +32181,102 @@ var UserNumber = styled__default.h4(_templateObject6$5 || (_templateObject6$5 =
32031
32181
  return props.color;
32032
32182
  });
32033
32183
 
32034
- var _templateObject$i, _templateObject2$g, _templateObject3$d, _templateObject4$a, _templateObject5$7, _templateObject6$6, _templateObject7$5, _templateObject8$5, _templateObject9$4, _templateObject0$3;
32035
- var ChannelList = function ChannelList(_ref) {
32184
+ var _templateObject$i, _templateObject2$g, _templateObject3$d, _templateObject4$a, _templateObject5$7, _templateObject6$6, _templateObject7$5, _templateObject8$5, _templateObject9$4, _templateObject0$3, _templateObject1$3, _templateObject10$3, _templateObject11$2, _templateObject12$2, _templateObject13$2, _templateObject14$2;
32185
+ var ChannelSkeletonList = function ChannelSkeletonList(_ref) {
32186
+ var color = _ref.color,
32187
+ _ref$count = _ref.count,
32188
+ count = _ref$count === void 0 ? 12 : _ref$count;
32189
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, Array.from({
32190
+ length: count
32191
+ }, function (_, i) {
32192
+ return /*#__PURE__*/React__default.createElement(SkeletonItem, {
32193
+ key: i
32194
+ }, /*#__PURE__*/React__default.createElement(SkeletonAvatar, {
32195
+ color: color,
32196
+ size: 50
32197
+ }), /*#__PURE__*/React__default.createElement(SkeletonRight, null, /*#__PURE__*/React__default.createElement(SkeletonTopRow, null, /*#__PURE__*/React__default.createElement(SkeletonLine, {
32198
+ color: color,
32199
+ width: '55%'
32200
+ }), /*#__PURE__*/React__default.createElement(SkeletonLine, {
32201
+ color: color,
32202
+ width: '36px',
32203
+ height: '10px'
32204
+ })), /*#__PURE__*/React__default.createElement(SkeletonLine, {
32205
+ color: color,
32206
+ width: '72%',
32207
+ height: '12px'
32208
+ })));
32209
+ }));
32210
+ };
32211
+ var ChannelList = function ChannelList(_ref2) {
32036
32212
  var _activeChannel$member, _searchedChannels$cha, _searchedChannels$cha2, _searchedChannels$con, _searchedChannels$cha3, _searchedChannels$cha4, _searchedChannels$cha5, _searchedChannels$cha6;
32037
- var className = _ref.className,
32038
- selectedChannelBackground = _ref.selectedChannelBackground,
32039
- selectedChannelLeftBorder = _ref.selectedChannelLeftBorder,
32040
- backgroundColor = _ref.backgroundColor,
32041
- searchInputBackgroundColor = _ref.searchInputBackgroundColor,
32042
- searchInputTextColor = _ref.searchInputTextColor,
32043
- _ref$searchChannelsPo = _ref.searchChannelsPosition,
32044
- searchChannelsPosition = _ref$searchChannelsPo === void 0 ? 'bottom' : _ref$searchChannelsPo,
32045
- channelSearchWidth = _ref.channelSearchWidth,
32046
- searchInputBorderRadius = _ref.searchInputBorderRadius,
32047
- selectedChannelBorderRadius = _ref.selectedChannelBorderRadius,
32048
- selectedChannelPaddings = _ref.selectedChannelPaddings,
32049
- channelsPaddings = _ref.channelsPaddings,
32050
- channelsMargin = _ref.channelsMargin,
32051
- List = _ref.List,
32052
- ListItem = _ref.ListItem,
32053
- getSelectedChannel = _ref.getSelectedChannel,
32054
- Profile = _ref.Profile,
32055
- CreateChannel = _ref.CreateChannel,
32056
- ChannelsTitle = _ref.ChannelsTitle,
32057
- filter = _ref.filter,
32058
- limit = _ref.limit,
32059
- sort = _ref.sort,
32060
- _ref$showAvatar = _ref.showAvatar,
32061
- showAvatar = _ref$showAvatar === void 0 ? true : _ref$showAvatar,
32062
- avatarBorderRadius = _ref.avatarBorderRadius,
32063
- _ref$showSearch = _ref.showSearch,
32064
- showSearch = _ref$showSearch === void 0 ? true : _ref$showSearch,
32065
- _ref$showCreateChanne = _ref.showCreateChannelIcon,
32066
- showCreateChannelIcon = _ref$showCreateChanne === void 0 ? true : _ref$showCreateChanne,
32067
- uriPrefixOnCreateChannel = _ref.uriPrefixOnCreateChannel,
32068
- onChannelDeleted = _ref.onChannelDeleted,
32069
- onChannelCreated = _ref.onChannelCreated,
32070
- onChannelHidden = _ref.onChannelHidden,
32071
- onChannelVisible = _ref.onChannelVisible,
32072
- onAddedToChannel = _ref.onAddedToChannel,
32073
- notificationsIsMutedIcon = _ref.notificationsIsMutedIcon,
32074
- notificationsIsMutedIconColor = _ref.notificationsIsMutedIconColor,
32075
- pinedIcon = _ref.pinedIcon,
32076
- createChannelIcon = _ref.createChannelIcon,
32077
- newChannelIcon = _ref.newChannelIcon,
32078
- newGroupIcon = _ref.newGroupIcon,
32079
- newChatIcon = _ref.newChatIcon,
32080
- uploadPhotoIcon = _ref.uploadPhotoIcon,
32081
- channelHoverBackground = _ref.channelHoverBackground,
32082
- channelSubjectFontSize = _ref.channelSubjectFontSize,
32083
- channelSubjectLineHeight = _ref.channelSubjectLineHeight,
32084
- channelSubjectColor = _ref.channelSubjectColor,
32085
- channelLastMessageFontSize = _ref.channelLastMessageFontSize,
32086
- channelLastMessageHeight = _ref.channelLastMessageHeight,
32087
- channelLastMessageTimeFontSize = _ref.channelLastMessageTimeFontSize,
32088
- channelAvatarSize = _ref.channelAvatarSize,
32089
- channelAvatarTextSize = _ref.channelAvatarTextSize,
32090
- searchChannelInputFontSize = _ref.searchChannelInputFontSize,
32091
- searchedChannelsTitleFontSize = _ref.searchedChannelsTitleFontSize,
32092
- searchChannelsPadding = _ref.searchChannelsPadding,
32093
- getCustomLatestMessage = _ref.getCustomLatestMessage,
32094
- _ref$doNotShowMessage = _ref.doNotShowMessageDeliveryTypes,
32095
- doNotShowMessageDeliveryTypes = _ref$doNotShowMessage === void 0 ? ['system'] : _ref$doNotShowMessage,
32096
- _ref$showPhoneNumber = _ref.showPhoneNumber,
32097
- showPhoneNumber = _ref$showPhoneNumber === void 0 ? false : _ref$showPhoneNumber;
32213
+ var className = _ref2.className,
32214
+ selectedChannelBackground = _ref2.selectedChannelBackground,
32215
+ selectedChannelLeftBorder = _ref2.selectedChannelLeftBorder,
32216
+ backgroundColor = _ref2.backgroundColor,
32217
+ searchInputBackgroundColor = _ref2.searchInputBackgroundColor,
32218
+ searchInputTextColor = _ref2.searchInputTextColor,
32219
+ _ref2$searchChannelsP = _ref2.searchChannelsPosition,
32220
+ searchChannelsPosition = _ref2$searchChannelsP === void 0 ? 'bottom' : _ref2$searchChannelsP,
32221
+ channelSearchWidth = _ref2.channelSearchWidth,
32222
+ searchInputBorderRadius = _ref2.searchInputBorderRadius,
32223
+ selectedChannelBorderRadius = _ref2.selectedChannelBorderRadius,
32224
+ selectedChannelPaddings = _ref2.selectedChannelPaddings,
32225
+ channelsPaddings = _ref2.channelsPaddings,
32226
+ channelsMargin = _ref2.channelsMargin,
32227
+ List = _ref2.List,
32228
+ ListItem = _ref2.ListItem,
32229
+ getSelectedChannel = _ref2.getSelectedChannel,
32230
+ Profile = _ref2.Profile,
32231
+ CreateChannel = _ref2.CreateChannel,
32232
+ ChannelsTitle = _ref2.ChannelsTitle,
32233
+ filter = _ref2.filter,
32234
+ limit = _ref2.limit,
32235
+ sort = _ref2.sort,
32236
+ _ref2$showAvatar = _ref2.showAvatar,
32237
+ showAvatar = _ref2$showAvatar === void 0 ? true : _ref2$showAvatar,
32238
+ avatarBorderRadius = _ref2.avatarBorderRadius,
32239
+ _ref2$showSearch = _ref2.showSearch,
32240
+ showSearch = _ref2$showSearch === void 0 ? true : _ref2$showSearch,
32241
+ _ref2$showCreateChann = _ref2.showCreateChannelIcon,
32242
+ showCreateChannelIcon = _ref2$showCreateChann === void 0 ? true : _ref2$showCreateChann,
32243
+ uriPrefixOnCreateChannel = _ref2.uriPrefixOnCreateChannel,
32244
+ onChannelDeleted = _ref2.onChannelDeleted,
32245
+ onChannelCreated = _ref2.onChannelCreated,
32246
+ onChannelHidden = _ref2.onChannelHidden,
32247
+ onChannelVisible = _ref2.onChannelVisible,
32248
+ onAddedToChannel = _ref2.onAddedToChannel,
32249
+ notificationsIsMutedIcon = _ref2.notificationsIsMutedIcon,
32250
+ notificationsIsMutedIconColor = _ref2.notificationsIsMutedIconColor,
32251
+ pinedIcon = _ref2.pinedIcon,
32252
+ createChannelIcon = _ref2.createChannelIcon,
32253
+ newChannelIcon = _ref2.newChannelIcon,
32254
+ newGroupIcon = _ref2.newGroupIcon,
32255
+ newChatIcon = _ref2.newChatIcon,
32256
+ uploadPhotoIcon = _ref2.uploadPhotoIcon,
32257
+ channelHoverBackground = _ref2.channelHoverBackground,
32258
+ channelSubjectFontSize = _ref2.channelSubjectFontSize,
32259
+ channelSubjectLineHeight = _ref2.channelSubjectLineHeight,
32260
+ channelSubjectColor = _ref2.channelSubjectColor,
32261
+ channelLastMessageFontSize = _ref2.channelLastMessageFontSize,
32262
+ channelLastMessageHeight = _ref2.channelLastMessageHeight,
32263
+ channelLastMessageTimeFontSize = _ref2.channelLastMessageTimeFontSize,
32264
+ channelAvatarSize = _ref2.channelAvatarSize,
32265
+ channelAvatarTextSize = _ref2.channelAvatarTextSize,
32266
+ searchChannelInputFontSize = _ref2.searchChannelInputFontSize,
32267
+ searchedChannelsTitleFontSize = _ref2.searchedChannelsTitleFontSize,
32268
+ searchChannelsPadding = _ref2.searchChannelsPadding,
32269
+ getCustomLatestMessage = _ref2.getCustomLatestMessage,
32270
+ _ref2$doNotShowMessag = _ref2.doNotShowMessageDeliveryTypes,
32271
+ doNotShowMessageDeliveryTypes = _ref2$doNotShowMessag === void 0 ? ['system'] : _ref2$doNotShowMessag,
32272
+ _ref2$showPhoneNumber = _ref2.showPhoneNumber,
32273
+ showPhoneNumber = _ref2$showPhoneNumber === void 0 ? false : _ref2$showPhoneNumber;
32098
32274
  var _useColor = useColors(),
32099
32275
  background = _useColor[THEME_COLORS.BACKGROUND],
32100
32276
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
32101
32277
  textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
32102
- textFootnote = _useColor[THEME_COLORS.TEXT_FOOTNOTE],
32103
32278
  borderColor = _useColor[THEME_COLORS.BORDER],
32279
+ surface1 = _useColor[THEME_COLORS.SURFACE_1],
32104
32280
  surface2 = _useColor[THEME_COLORS.SURFACE_2];
32105
32281
  var dispatch = useDispatch();
32106
32282
  var getFromContacts = getShowOnlyContactUsers();
@@ -32385,7 +32561,7 @@ var ChannelList = function ChannelList(_ref) {
32385
32561
  setSelectedChannel: setSelectedChannel,
32386
32562
  loadMoreChannels: handleLoadMoreChannels,
32387
32563
  searchValue: searchValue
32388
- }, !searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, channels.map(function (channel) {
32564
+ }, !searchValue && (channelsLoading === LOADING_STATE.LOADED || channels.length > 0) ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, channels.map(function (channel) {
32389
32565
  return !getPendingDeleteChannel(channel.id) && (ListItem ? (/*#__PURE__*/React__default.createElement(ListItem, {
32390
32566
  channel: channel,
32391
32567
  setSelectedChannel: setSelectedChannel,
@@ -32419,7 +32595,10 @@ var ChannelList = function ChannelList(_ref) {
32419
32595
  doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
32420
32596
  showPhoneNumber: showPhoneNumber
32421
32597
  })));
32422
- }))) : channelsLoading === LOADING_STATE.LOADED && searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha = searchedChannels.chats_groups) !== null && _searchedChannels$cha !== void 0 && _searchedChannels$cha.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha2 = searchedChannels.channels) !== null && _searchedChannels$cha2 !== void 0 && _searchedChannels$cha2.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$con = searchedChannels.contacts) !== null && _searchedChannels$con !== void 0 && _searchedChannels$con.length ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !!(searchedChannels.chats_groups && searchedChannels.chats_groups.length) && (/*#__PURE__*/React__default.createElement(DirectChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
32598
+ }), channelsLoading === LOADING_STATE.LOADING && channelsHasNext && (/*#__PURE__*/React__default.createElement(ChannelSkeletonList, {
32599
+ color: surface1,
32600
+ count: 1
32601
+ })))) : channelsLoading === LOADING_STATE.LOADED && searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha = searchedChannels.chats_groups) !== null && _searchedChannels$cha !== void 0 && _searchedChannels$cha.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha2 = searchedChannels.channels) !== null && _searchedChannels$cha2 !== void 0 && _searchedChannels$cha2.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$con = searchedChannels.contacts) !== null && _searchedChannels$con !== void 0 && _searchedChannels$con.length ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !!(searchedChannels.chats_groups && searchedChannels.chats_groups.length) && (/*#__PURE__*/React__default.createElement(DirectChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
32423
32602
  color: textSecondary,
32424
32603
  fontSize: searchedChannelsTitleFontSize
32425
32604
  }, "Chats & Groups"), searchedChannels.chats_groups.map(function (channel) {
@@ -32527,9 +32706,9 @@ var ChannelList = function ChannelList(_ref) {
32527
32706
  }))))) : (/*#__PURE__*/React__default.createElement(NoData, {
32528
32707
  color: textSecondary,
32529
32708
  fontSize: searchedChannelsTitleFontSize
32530
- }, "No channels found")))) : (/*#__PURE__*/React__default.createElement(LoadingWrapper, null, /*#__PURE__*/React__default.createElement(UploadingIcon, {
32531
- color: textFootnote
32532
- }))))) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !searchValue && (/*#__PURE__*/React__default.createElement(ChannelsList, {
32709
+ }, "No channels found")))) : (/*#__PURE__*/React__default.createElement(ChannelSkeletonList, {
32710
+ color: surface1
32711
+ })))) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !searchValue && (channelsLoading === LOADING_STATE.LOADED || channels.length > 0 ? (/*#__PURE__*/React__default.createElement(ChannelsList, {
32533
32712
  ref: channelsScrollRef,
32534
32713
  onScroll: handleAllChannelsListScroll,
32535
32714
  onMouseEnter: function onMouseEnter() {
@@ -32574,6 +32753,11 @@ var ChannelList = function ChannelList(_ref) {
32574
32753
  doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
32575
32754
  showPhoneNumber: showPhoneNumber
32576
32755
  }));
32756
+ }), channelsLoading === LOADING_STATE.LOADING && channelsHasNext && (/*#__PURE__*/React__default.createElement(ChannelSkeletonList, {
32757
+ color: surface1,
32758
+ count: 1
32759
+ })))) : (/*#__PURE__*/React__default.createElement(ChannelSkeletonList, {
32760
+ color: surface1
32577
32761
  }))), !!searchValue && (channelsLoading === LOADING_STATE.LOADED ? !((_searchedChannels$cha4 = searchedChannels.chats_groups) !== null && _searchedChannels$cha4 !== void 0 && _searchedChannels$cha4.length) && !((_searchedChannels$cha5 = searchedChannels.chats_groups) !== null && _searchedChannels$cha5 !== void 0 && _searchedChannels$cha5.length) && !((_searchedChannels$cha6 = searchedChannels.channels) !== null && _searchedChannels$cha6 !== void 0 && _searchedChannels$cha6.length) ? (/*#__PURE__*/React__default.createElement(NoData, {
32578
32762
  color: textSecondary,
32579
32763
  fontSize: searchedChannelsTitleFontSize
@@ -32651,9 +32835,9 @@ var ChannelList = function ChannelList(_ref) {
32651
32835
  doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
32652
32836
  showPhoneNumber: showPhoneNumber
32653
32837
  }));
32654
- }))))) : (/*#__PURE__*/React__default.createElement(LoadingWrapper, null, /*#__PURE__*/React__default.createElement(UploadingIcon, {
32655
- color: textFootnote
32656
- })))))), profileIsOpen && /*#__PURE__*/React__default.createElement(ProfileSettings, {
32838
+ }))))) : (/*#__PURE__*/React__default.createElement(ChannelSkeletonList, {
32839
+ color: surface1
32840
+ }))))), profileIsOpen && /*#__PURE__*/React__default.createElement(ProfileSettings, {
32657
32841
  handleCloseProfile: handleOpenProfile
32658
32842
  }));
32659
32843
  };
@@ -32687,8 +32871,28 @@ var NoData = styled__default.div(_templateObject8$5 || (_templateObject8$5 = _ta
32687
32871
  }, function (props) {
32688
32872
  return props.color;
32689
32873
  });
32690
- var LoadingWrapper = styled__default.div(_templateObject9$4 || (_templateObject9$4 = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: calc(50% - 20px);\n top: calc(50% - 20px);\n"])));
32691
- var ChannelListHeader = styled__default.div(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n max-width: ", ";\n padding: ", ";\n box-sizing: border-box;\n padding-left: ", ";\n border-right: ", ";\n"])), function (props) {
32874
+ var shimmer = styled.keyframes(_templateObject9$4 || (_templateObject9$4 = _taggedTemplateLiteralLoose(["\n 0% { background-position: -400px 0; }\n 100% { background-position: 400px 0; }\n"])));
32875
+ var SkeletonBlock = styled__default.div(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n background-image: linear-gradient(\n 90deg,\n ", " 0px,\n rgba(255, 255, 255, 0.35) 80px,\n ", " 160px\n );\n background-size: 400px 100%;\n background-repeat: no-repeat;\n animation: ", " 1.4s ease infinite;\n"])), function (p) {
32876
+ return p.color;
32877
+ }, function (p) {
32878
+ return p.color;
32879
+ }, function (p) {
32880
+ return p.color;
32881
+ }, shimmer);
32882
+ var SkeletonAvatar = styled__default(SkeletonBlock)(_templateObject1$3 || (_templateObject1$3 = _taggedTemplateLiteralLoose(["\n width: ", "px;\n height: ", "px;\n border-radius: 50%;\n flex-shrink: 0;\n"])), function (p) {
32883
+ return p.size;
32884
+ }, function (p) {
32885
+ return p.size;
32886
+ });
32887
+ var SkeletonLine = styled__default(SkeletonBlock)(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: ", ";\n border-radius: 7px;\n"])), function (p) {
32888
+ return p.width;
32889
+ }, function (p) {
32890
+ return p.height || '14px';
32891
+ });
32892
+ var SkeletonRight = styled__default.div(_templateObject11$2 || (_templateObject11$2 = _taggedTemplateLiteralLoose(["\n flex: 1;\n margin-left: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n"])));
32893
+ var SkeletonTopRow = styled__default.div(_templateObject12$2 || (_templateObject12$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"])));
32894
+ var SkeletonItem = styled__default.div(_templateObject13$2 || (_templateObject13$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n padding: 8px;\n margin: 0 8px;\n"])));
32895
+ var ChannelListHeader = styled__default.div(_templateObject14$2 || (_templateObject14$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n max-width: ", ";\n padding: ", ";\n box-sizing: border-box;\n padding-left: ", ";\n border-right: ", ";\n"])), function (props) {
32692
32896
  return props.maxWidth ? "" + props.maxWidth : 'inherit';
32693
32897
  }, function (props) {
32694
32898
  return props.padding || '12px';
@@ -32877,7 +33081,7 @@ function SvgSearchMessages(props) {
32877
33081
  })));
32878
33082
  }
32879
33083
 
32880
- var _templateObject$k, _templateObject2$i, _templateObject3$f, _templateObject4$c, _templateObject5$9, _templateObject6$7, _templateObject7$6, _templateObject8$6, _templateObject9$5, _templateObject0$4, _templateObject1$3;
33084
+ var _templateObject$k, _templateObject2$i, _templateObject3$f, _templateObject4$c, _templateObject5$9, _templateObject6$7, _templateObject7$6, _templateObject8$6, _templateObject9$5, _templateObject0$4, _templateObject1$4;
32881
33085
  function ChatHeader(_ref) {
32882
33086
  var infoIcon = _ref.infoIcon,
32883
33087
  backgroundColor = _ref.backgroundColor,
@@ -33051,7 +33255,7 @@ var MobileBackButtonWrapper = styled__default.span(_templateObject8$6 || (_templ
33051
33255
  });
33052
33256
  var DefaultInfoIcon = styled__default(SvgInfo)(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteralLoose([""])));
33053
33257
  var WrapArrowLeftIcon = styled__default(SvgArrowLeft)(_templateObject0$4 || (_templateObject0$4 = _taggedTemplateLiteralLoose([""])));
33054
- var SearchMessagesButton = styled__default.span(_templateObject1$3 || (_templateObject1$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n cursor: pointer;\n margin-left: 16px;\n border-radius: 50%;\n transition: background-color 0.15s;\n order: ", ";\n"])), function (p) {
33258
+ var SearchMessagesButton = styled__default.span(_templateObject1$4 || (_templateObject1$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n cursor: pointer;\n margin-left: 16px;\n border-radius: 50%;\n transition: background-color 0.15s;\n order: ", ";\n"])), function (p) {
33055
33259
  return p.order;
33056
33260
  });
33057
33261
 
@@ -33802,7 +34006,7 @@ function SvgFullscreenExit(props) {
33802
34006
  })));
33803
34007
  }
33804
34008
 
33805
- var _templateObject$n, _templateObject2$k, _templateObject3$h, _templateObject4$e, _templateObject5$b, _templateObject6$8, _templateObject7$7, _templateObject8$7, _templateObject9$6, _templateObject0$5, _templateObject1$4;
34009
+ var _templateObject$n, _templateObject2$k, _templateObject3$h, _templateObject4$e, _templateObject5$b, _templateObject6$8, _templateObject7$7, _templateObject8$7, _templateObject9$6, _templateObject0$5, _templateObject1$5;
33806
34010
  var VideoPlayer = function VideoPlayer(_ref) {
33807
34011
  var src = _ref.src,
33808
34012
  videoFileId = _ref.videoFileId,
@@ -34123,9 +34327,9 @@ var VolumeController = styled__default.div(_templateObject7$7 || (_templateObjec
34123
34327
  var VolumeIconWrapper = styled__default.span(_templateObject8$7 || (_templateObject8$7 = _taggedTemplateLiteralLoose(["\n display: flex;\n cursor: pointer;\n @media (max-width: 768px) {\n & > svg {\n width: 18px;\n height: 18px;\n }\n }\n @media (max-width: 768px) {\n & > svg {\n width: 16px;\n height: 16px;\n }\n }\n"])));
34124
34328
  var VolumeSlide = styled__default.input(_templateObject9$6 || (_templateObject9$6 = _taggedTemplateLiteralLoose(["\n -webkit-appearance: none;\n margin-left: 8px;\n width: 60px;\n height: 4px;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 5px;\n background-image: linear-gradient(#fff, #fff);\n //background-size: 70% 100%;\n background-repeat: no-repeat;\n cursor: pointer;\n\n &::-webkit-slider-thumb {\n visibility: hidden;\n -webkit-appearance: none;\n height: 1px;\n width: 1px;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n &::-moz-range-thumb {\n visibility: hidden;\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n\n &::-ms-thumb {\n visibility: hidden;\n -webkit-appearance: none;\n height: 1px;\n width: 1px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n &::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n\n &::-moz-range-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n &::-ms-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n\n @media (max-width: 768px) {\n width: 50px;\n }\n"])));
34125
34329
  var Progress = styled__default.input(_templateObject0$5 || (_templateObject0$5 = _taggedTemplateLiteralLoose(["\n -webkit-appearance: none;\n margin-right: 15px;\n width: 100%;\n height: 4px;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 5px;\n background-image: linear-gradient(#fff, #fff);\n //background-size: 70% 100%;\n background-repeat: no-repeat;\n cursor: pointer;\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n &::-moz-range-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n\n &::-ms-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n\n &::-webkit-slider-thumb:hover {\n background: #fff;\n }\n &::-moz-range-thumb:hover {\n background: #fff;\n }\n &::-ms-thumb:hover {\n background: #fff;\n }\n\n &::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n\n &::-moz-range-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n &::-ms-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n"])));
34126
- var FullScreenWrapper = styled__default.div(_templateObject1$4 || (_templateObject1$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n margin-left: 16px;\n cursor: pointer;\n @media (max-width: 768px) {\n margin-left: 12px;\n & > svg {\n width: 18px;\n height: 18px;\n }\n }\n @media (max-width: 480px) {\n margin-left: auto;\n & > svg {\n width: 16px;\n height: 16px;\n }\n }\n"])));
34330
+ var FullScreenWrapper = styled__default.div(_templateObject1$5 || (_templateObject1$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n margin-left: 16px;\n cursor: pointer;\n @media (max-width: 768px) {\n margin-left: 12px;\n & > svg {\n width: 18px;\n height: 18px;\n }\n }\n @media (max-width: 480px) {\n margin-left: auto;\n & > svg {\n width: 16px;\n height: 16px;\n }\n }\n"])));
34127
34331
 
34128
- var _templateObject$o, _templateObject2$l, _templateObject3$i, _templateObject4$f, _templateObject5$c, _templateObject6$9, _templateObject7$8, _templateObject8$8, _templateObject9$7, _templateObject0$6, _templateObject1$5, _templateObject10$3, _templateObject11$2;
34332
+ var _templateObject$o, _templateObject2$l, _templateObject3$i, _templateObject4$f, _templateObject5$c, _templateObject6$9, _templateObject7$8, _templateObject8$8, _templateObject9$7, _templateObject0$6, _templateObject1$6, _templateObject10$4, _templateObject11$3;
34129
34333
  var ChannelMembersItem = function ChannelMembersItem(_ref) {
34130
34334
  var channel = _ref.channel,
34131
34335
  directChannelUser = _ref.directChannelUser,
@@ -34527,11 +34731,11 @@ var SelectedChannelName = styled__default.span(_templateObject9$7 || (_templateO
34527
34731
  return props.color;
34528
34732
  });
34529
34733
  var StyledSubtractSvg$1 = styled__default(SvgCross)(_templateObject0$6 || (_templateObject0$6 = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin-left: 4px;\n transform: translate(2px, 0);\n"])));
34530
- var NoResults$1 = styled__default.div(_templateObject1$5 || (_templateObject1$5 = _taggedTemplateLiteralLoose(["\n font-size: 15px;\n line-height: 16px;\n font-weight: 500;\n text-align: center;\n margin-top: 20px;\n color: ", ";\n"])), function (props) {
34734
+ var NoResults$1 = styled__default.div(_templateObject1$6 || (_templateObject1$6 = _taggedTemplateLiteralLoose(["\n font-size: 15px;\n line-height: 16px;\n font-weight: 500;\n text-align: center;\n margin-top: 20px;\n color: ", ";\n"])), function (props) {
34531
34735
  return props.color;
34532
34736
  });
34533
- var ChannelItemWrapper = styled__default.div(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
34534
- var WarningTooltip = styled__default.div(_templateObject11$2 || (_templateObject11$2 = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: calc(100% + 8px);\n left: 50%;\n transform: translateX(-50%);\n background: ", ";\n color: ", ";\n font-size: 13px;\n line-height: 18px;\n font-weight: 400;\n padding: 10px 14px;\n border-radius: 8px;\n text-align: center;\n margin-top: 8px;\n pointer-events: none;\n z-index: 10;\n\n &::after {\n content: '';\n position: absolute;\n bottom: -7px;\n left: 50%;\n transform: translateX(-50%);\n width: 0;\n height: 0;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid ", ";\n }\n"])), function (props) {
34737
+ var ChannelItemWrapper = styled__default.div(_templateObject10$4 || (_templateObject10$4 = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
34738
+ var WarningTooltip = styled__default.div(_templateObject11$3 || (_templateObject11$3 = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: calc(100% + 8px);\n left: 50%;\n transform: translateX(-50%);\n background: ", ";\n color: ", ";\n font-size: 13px;\n line-height: 18px;\n font-weight: 400;\n padding: 10px 14px;\n border-radius: 8px;\n text-align: center;\n margin-top: 8px;\n pointer-events: none;\n z-index: 10;\n\n &::after {\n content: '';\n position: absolute;\n bottom: -7px;\n left: 50%;\n transform: translateX(-50%);\n width: 0;\n height: 0;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid ", ";\n }\n"])), function (props) {
34535
34739
  return props.backgroundColor;
34536
34740
  }, function (props) {
34537
34741
  return props.color;
@@ -34715,7 +34919,7 @@ var DeleteOptionItem = styled__default.div(_templateObject2$n || (_templateObjec
34715
34919
  return props.color;
34716
34920
  });
34717
34921
 
34718
- var _templateObject$r, _templateObject2$o, _templateObject3$j, _templateObject4$g, _templateObject5$d, _templateObject6$a, _templateObject7$9, _templateObject8$9, _templateObject9$8, _templateObject0$7, _templateObject1$6, _templateObject10$4, _templateObject11$3, _templateObject12$2, _templateObject13$2, _templateObject14$2;
34922
+ var _templateObject$r, _templateObject2$o, _templateObject3$j, _templateObject4$g, _templateObject5$d, _templateObject6$a, _templateObject7$9, _templateObject8$9, _templateObject9$8, _templateObject0$7, _templateObject1$7, _templateObject10$5, _templateObject11$4, _templateObject12$3, _templateObject13$3, _templateObject14$3;
34719
34923
  var SliderPopup = function SliderPopup(_ref) {
34720
34924
  var channel = _ref.channel,
34721
34925
  setIsSliderOpen = _ref.setIsSliderOpen,
@@ -35339,18 +35543,18 @@ var FileSize = styled__default.span(_templateObject9$8 || (_templateObject9$8 =
35339
35543
  var UserName = styled__default.h4(_templateObject0$7 || (_templateObject0$7 = _taggedTemplateLiteralLoose(["\n margin: 0;\n color: ", ";\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n"])), function (props) {
35340
35544
  return props.color;
35341
35545
  });
35342
- var ActionsWrapper = styled__default.div(_templateObject1$6 || (_templateObject1$6 = _taggedTemplateLiteralLoose(["\n display: flex;\n"])));
35343
- var IconWrapper = styled__default.span(_templateObject10$4 || (_templateObject10$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n cursor: pointer;\n color: ", ";\n margin: ", ";\n\n & > svg {\n width: 28px;\n height: 28px;\n }\n\n ", "\n"])), function (props) {
35546
+ var ActionsWrapper = styled__default.div(_templateObject1$7 || (_templateObject1$7 = _taggedTemplateLiteralLoose(["\n display: flex;\n"])));
35547
+ var IconWrapper = styled__default.span(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n cursor: pointer;\n color: ", ";\n margin: ", ";\n\n & > svg {\n width: 28px;\n height: 28px;\n }\n\n ", "\n"])), function (props) {
35344
35548
  return props.color;
35345
35549
  }, function (props) {
35346
35550
  return props.margin;
35347
35551
  }, function (props) {
35348
35552
  return props.hideInMobile && "\n @media (max-width: 550px) {\n display: none;\n }\n ";
35349
35553
  });
35350
- var CarouselItem$1 = styled__default.div(_templateObject11$3 || (_templateObject11$3 = _taggedTemplateLiteralLoose(["\n position: relative;\n display: flex;\n max-width: calc(100% - 200px);\n z-index: 2;\n\n img,\n video {\n min-width: 280px;\n max-width: 100%;\n margin: auto;\n object-fit: contain;\n max-height: calc(100vh - 200px);\n @media (max-width: 480px) {\n min-width: inherit;\n }\n }\n @media (max-width: 480px) {\n max-width: calc(100% - 100px);\n }\n\n img {\n min-width: inherit;\n }\n"])));
35351
- var UploadCont$1 = styled__default.div(_templateObject12$2 || (_templateObject12$2 = _taggedTemplateLiteralLoose(["\n left: calc((100vw - 100%) / -2);\n top: calc((100vh - 100%) / -2);\n width: 100vw;\n height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n z-index: 1;\n"])));
35352
- var ItemLoadingCont = styled__default.div(_templateObject13$2 || (_templateObject13$2 = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: calc((100vw - 100%) / -2);\n top: calc((100vh - 100% + 60px) / -2);\n width: 100vw;\n height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1;\n"])));
35353
- var ArrowButton = styled__default.button(_templateObject14$2 || (_templateObject14$2 = _taggedTemplateLiteralLoose(["\n min-width: 60px;\n max-width: 60px;\n height: 60px;\n margin-right: ", ";\n margin-left: ", ";\n border: none;\n color: ", ";\n background: transparent;\n box-sizing: border-box;\n border-radius: 50%;\n line-height: 1px;\n align-self: center;\n outline: none;\n cursor: pointer;\n visibility: ", ";\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n left: ", ";\n right: ", ";\n & > svg {\n width: 40px;\n height: 40px;\n }\n @media (max-width: 768px) {\n min-width: 36px;\n max-width: 36px;\n height: 36px;\n margin-right: ", ";\n margin-left: ", ";\n\n & > svg {\n width: 22px;\n height: 22px;\n }\n }\n @media (max-width: 450px) {\n min-width: 32px;\n max-width: 32px;\n height: 32px;\n\n & > svg {\n width: 20px;\n height: 20px;\n }\n }\n"])), function (props) {
35554
+ var CarouselItem$1 = styled__default.div(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteralLoose(["\n position: relative;\n display: flex;\n max-width: calc(100% - 200px);\n z-index: 2;\n\n img,\n video {\n min-width: 280px;\n max-width: 100%;\n margin: auto;\n object-fit: contain;\n max-height: calc(100vh - 200px);\n @media (max-width: 480px) {\n min-width: inherit;\n }\n }\n @media (max-width: 480px) {\n max-width: calc(100% - 100px);\n }\n\n img {\n min-width: inherit;\n }\n"])));
35555
+ var UploadCont$1 = styled__default.div(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n left: calc((100vw - 100%) / -2);\n top: calc((100vh - 100%) / -2);\n width: 100vw;\n height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n z-index: 1;\n"])));
35556
+ var ItemLoadingCont = styled__default.div(_templateObject13$3 || (_templateObject13$3 = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: calc((100vw - 100%) / -2);\n top: calc((100vh - 100% + 60px) / -2);\n width: 100vw;\n height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1;\n"])));
35557
+ var ArrowButton = styled__default.button(_templateObject14$3 || (_templateObject14$3 = _taggedTemplateLiteralLoose(["\n min-width: 60px;\n max-width: 60px;\n height: 60px;\n margin-right: ", ";\n margin-left: ", ";\n border: none;\n color: ", ";\n background: transparent;\n box-sizing: border-box;\n border-radius: 50%;\n line-height: 1px;\n align-self: center;\n outline: none;\n cursor: pointer;\n visibility: ", ";\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n left: ", ";\n right: ", ";\n & > svg {\n width: 40px;\n height: 40px;\n }\n @media (max-width: 768px) {\n min-width: 36px;\n max-width: 36px;\n height: 36px;\n margin-right: ", ";\n margin-left: ", ";\n\n & > svg {\n width: 22px;\n height: 22px;\n }\n }\n @media (max-width: 450px) {\n min-width: 32px;\n max-width: 32px;\n height: 32px;\n\n & > svg {\n width: 20px;\n height: 20px;\n }\n }\n"])), function (props) {
35354
35558
  return !props.leftButton && '24px';
35355
35559
  }, function (props) {
35356
35560
  return props.leftButton && '24px';
@@ -37308,7 +37512,7 @@ var VideoIcon = styled__default.div(_templateObject8$a || (_templateObject8$a =
37308
37512
  return bg;
37309
37513
  });
37310
37514
 
37311
- var _templateObject$z, _templateObject2$v, _templateObject3$p, _templateObject4$l, _templateObject5$h, _templateObject6$e, _templateObject7$d, _templateObject8$b, _templateObject9$9, _templateObject0$8, _templateObject1$7, _templateObject10$5, _templateObject11$4;
37515
+ var _templateObject$z, _templateObject2$v, _templateObject3$p, _templateObject4$l, _templateObject5$h, _templateObject6$e, _templateObject7$d, _templateObject8$b, _templateObject9$9, _templateObject0$8, _templateObject1$8, _templateObject10$6, _templateObject11$5;
37312
37516
  var Attachment = function Attachment(_ref) {
37313
37517
  var attachment = _ref.attachment,
37314
37518
  _ref$isPreview = _ref.isPreview,
@@ -38250,10 +38454,10 @@ var AttachmentSize = styled__default.span(_templateObject0$8 || (_templateObject
38250
38454
  }, function (props) {
38251
38455
  return props.errorColor;
38252
38456
  });
38253
- var AttachmentFileInfo = styled__default.div(_templateObject1$7 || (_templateObject1$7 = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n ", "\n"])), function (props) {
38457
+ var AttachmentFileInfo = styled__default.div(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n ", "\n"])), function (props) {
38254
38458
  return props.isPreview && "line-height: 14px;\n max-width: calc(100% - 44px);\n ";
38255
38459
  });
38256
- var AttachmentImg = styled__default.img(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n position: ", ";\n border-radius: ", ";\n padding: ", ";\n box-sizing: border-box;\n width: ", ";\n height: ", ";\n object-fit: cover;\n visibility: ", ";\n z-index: 2;\n opacity: ", ";\n transition: opacity 0.3s ease-in-out;\n"])), function (props) {
38460
+ var AttachmentImg = styled__default.img(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose(["\n position: ", ";\n border-radius: ", ";\n padding: ", ";\n box-sizing: border-box;\n width: ", ";\n height: ", ";\n object-fit: cover;\n visibility: ", ";\n z-index: 2;\n opacity: ", ";\n transition: opacity 0.3s ease-in-out;\n"])), function (props) {
38257
38461
  return props.absolute && 'absolute';
38258
38462
  }, function (props) {
38259
38463
  return props.isRepliedMessage ? '4px' : props.borderRadius || '6px';
@@ -38268,7 +38472,7 @@ var AttachmentImg = styled__default.img(_templateObject10$5 || (_templateObject1
38268
38472
  }, function (props) {
38269
38473
  return props.$shouldAnimate && !props.$isLoaded ? 0 : 1;
38270
38474
  });
38271
- var VideoCont = styled__default.div(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteralLoose(["\n position: relative;\n cursor: pointer;\n height: ", ";\n"])), function (props) {
38475
+ var VideoCont = styled__default.div(_templateObject11$5 || (_templateObject11$5 = _taggedTemplateLiteralLoose(["\n position: relative;\n cursor: pointer;\n height: ", ";\n"])), function (props) {
38272
38476
  return props.isDetailsView && '100%';
38273
38477
  });
38274
38478
 
@@ -39273,7 +39477,7 @@ var OpenMoreEmojis = styled__default.span(_templateObject3$s || (_templateObject
39273
39477
  return props.iconHoverColor;
39274
39478
  });
39275
39479
 
39276
- var _templateObject$E, _templateObject2$z, _templateObject3$t, _templateObject4$o, _templateObject5$j, _templateObject6$g, _templateObject7$f, _templateObject8$d, _templateObject9$a, _templateObject0$9, _templateObject1$8, _templateObject10$6;
39480
+ var _templateObject$E, _templateObject2$z, _templateObject3$t, _templateObject4$o, _templateObject5$j, _templateObject6$g, _templateObject7$f, _templateObject8$d, _templateObject9$a, _templateObject0$9, _templateObject1$9, _templateObject10$7;
39277
39481
  var POLL_VOTES_LIMIT = 20;
39278
39482
  var AllVotesPopup = function AllVotesPopup(_ref) {
39279
39483
  var _pollVotesHasMore$key, _poll$voteDetails, _poll$voteDetails$vot, _poll$voteDetails3;
@@ -39423,14 +39627,14 @@ var VotesContainer = styled__default.div(_templateObject9$a || (_templateObject9
39423
39627
  var VotesCount = styled__default.div(_templateObject0$9 || (_templateObject0$9 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: -0.4px;\n padding: 12px 0;\n"])), function (p) {
39424
39628
  return p.color;
39425
39629
  });
39426
- var LoaderContainer = styled__default.div(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 40px 0;\n min-height: 100px;\n"])));
39427
- var Loader = styled__default.div(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose(["\n width: 40px;\n height: 40px;\n border: 3px solid ", "20;\n border-top-color: ", ";\n border-radius: 50%;\n animation: spin 1s linear infinite;\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])), function (p) {
39630
+ var LoaderContainer = styled__default.div(_templateObject1$9 || (_templateObject1$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 40px 0;\n min-height: 100px;\n"])));
39631
+ var Loader = styled__default.div(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n width: 40px;\n height: 40px;\n border: 3px solid ", "20;\n border-top-color: ", ";\n border-radius: 50%;\n animation: spin 1s linear infinite;\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])), function (p) {
39428
39632
  return p.color;
39429
39633
  }, function (p) {
39430
39634
  return p.color;
39431
39635
  });
39432
39636
 
39433
- var _templateObject$F, _templateObject2$A, _templateObject3$u, _templateObject4$p, _templateObject5$k, _templateObject6$h, _templateObject7$g, _templateObject8$e, _templateObject9$b, _templateObject0$a, _templateObject1$9, _templateObject10$7;
39637
+ var _templateObject$F, _templateObject2$A, _templateObject3$u, _templateObject4$p, _templateObject5$k, _templateObject6$h, _templateObject7$g, _templateObject8$e, _templateObject9$b, _templateObject0$a, _templateObject1$a, _templateObject10$8;
39434
39638
  var VotesResultsPopup = function VotesResultsPopup(_ref) {
39435
39639
  var _poll$voteDetails3, _poll$voteDetails4, _poll$options$find;
39436
39640
  var onClose = _ref.onClose,
@@ -39608,10 +39812,10 @@ var VoterName$1 = styled__default.div(_templateObject9$b || (_templateObject9$b
39608
39812
  var VotedAt$1 = styled__default.div(_templateObject0$a || (_templateObject0$a = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: -0.2px;\n"])), function (p) {
39609
39813
  return p.color;
39610
39814
  });
39611
- var TitleWrapper$1 = styled__default.div(_templateObject1$9 || (_templateObject1$9 = _taggedTemplateLiteralLoose(["\n margin: 0 auto;\n border-radius: 10px;\n padding: 16px;\n background: ", ";\n margin-bottom: 16px;\n"])), function (p) {
39815
+ var TitleWrapper$1 = styled__default.div(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose(["\n margin: 0 auto;\n border-radius: 10px;\n padding: 16px;\n background: ", ";\n margin-bottom: 16px;\n"])), function (p) {
39612
39816
  return p.backgroundColor;
39613
39817
  });
39614
- var Question = styled__default.div(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.4px;\n overflow-wrap: anywhere;\n"])), function (p) {
39818
+ var Question = styled__default.div(_templateObject10$8 || (_templateObject10$8 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.4px;\n overflow-wrap: anywhere;\n"])), function (p) {
39615
39819
  return p.color;
39616
39820
  });
39617
39821
 
@@ -39637,7 +39841,7 @@ function SvgFilledCheckbox(props) {
39637
39841
  })));
39638
39842
  }
39639
39843
 
39640
- var _templateObject$G, _templateObject2$B, _templateObject3$v, _templateObject4$q, _templateObject5$l, _templateObject6$i, _templateObject7$h, _templateObject8$f, _templateObject9$c, _templateObject0$b, _templateObject1$a, _templateObject10$8, _templateObject11$5, _templateObject12$3;
39844
+ var _templateObject$G, _templateObject2$B, _templateObject3$v, _templateObject4$q, _templateObject5$l, _templateObject6$i, _templateObject7$h, _templateObject8$f, _templateObject9$c, _templateObject0$b, _templateObject1$b, _templateObject10$9, _templateObject11$6, _templateObject12$4;
39641
39845
  var PollMessage = function PollMessage(_ref) {
39642
39846
  var _poll$voteDetails3, _poll$voteDetails4, _poll$voteDetails5, _poll$voteDetails6, _poll$voteDetails7;
39643
39847
  var message = _ref.message,
@@ -39817,22 +40021,22 @@ var StyledCheck = styled__default(SvgFilledCheckbox)(_templateObject9$c || (_tem
39817
40021
  var Title$2 = styled__default.div(_templateObject0$b || (_templateObject0$b = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n color: ", ";\n margin-right: auto;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n max-width: calc(100% - 80px);\n word-break: break-word;\n"])), function (p) {
39818
40022
  return p.color;
39819
40023
  });
39820
- var Votes = styled__default.span(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n margin-left: 4px;\n cursor: ", ";\n"])), function (p) {
40024
+ var Votes = styled__default.span(_templateObject1$b || (_templateObject1$b = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n margin-left: 4px;\n cursor: ", ";\n"])), function (p) {
39821
40025
  return p.color;
39822
40026
  }, function (p) {
39823
40027
  return p.cursor;
39824
40028
  });
39825
- var Bar = styled__default.div(_templateObject10$8 || (_templateObject10$8 = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: 6px;\n border-radius: 6px;\n background: ", ";\n overflow: hidden;\n margin-left: auto;\n"])), function (p) {
40029
+ var Bar = styled__default.div(_templateObject10$9 || (_templateObject10$9 = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: 6px;\n border-radius: 6px;\n background: ", ";\n overflow: hidden;\n margin-left: auto;\n"])), function (p) {
39826
40030
  return p.closed ? '100%' : "calc(100% - 28px)";
39827
40031
  }, function (p) {
39828
40032
  return p.track;
39829
40033
  });
39830
- var Fill = styled__default.div(_templateObject11$5 || (_templateObject11$5 = _taggedTemplateLiteralLoose(["\n height: 100%;\n border-radius: 6px;\n transition: width 0.3s ease-in-out;\n"])));
39831
- var UsersContainer = styled__default.div(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n margin-left: auto;\n padding-left: 16px;\n height: max-content;\n cursor: ", ";\n"])), function (p) {
40034
+ var Fill = styled__default.div(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose(["\n height: 100%;\n border-radius: 6px;\n transition: width 0.3s ease-in-out;\n"])));
40035
+ var UsersContainer = styled__default.div(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n margin-left: auto;\n padding-left: 16px;\n height: max-content;\n cursor: ", ";\n"])), function (p) {
39832
40036
  return p.cursor;
39833
40037
  });
39834
40038
 
39835
- var _templateObject$H, _templateObject2$C, _templateObject3$w, _templateObject4$r, _templateObject5$m, _templateObject6$j, _templateObject7$i, _templateObject8$g, _templateObject9$d, _templateObject0$c, _templateObject1$b;
40039
+ var _templateObject$H, _templateObject2$C, _templateObject3$w, _templateObject4$r, _templateObject5$m, _templateObject6$j, _templateObject7$i, _templateObject8$g, _templateObject9$d, _templateObject0$c, _templateObject1$c;
39836
40040
  var OG_IMAGE_CACHE = 'og-images-v1';
39837
40041
  var loadFromMetadata$1 = function loadFromMetadata(firstAttachment) {
39838
40042
  if (!firstAttachment) {
@@ -40248,7 +40452,7 @@ var Img = styled__default.img(_templateObject7$i || (_templateObject7$i = _tagge
40248
40452
  var OGRow = styled__default.div(_templateObject8$g || (_templateObject8$g = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n padding: 0;\n"])));
40249
40453
  var OGTextWrapper = styled__default.div(_templateObject9$d || (_templateObject9$d = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n"])));
40250
40454
  var FaviconContainer = styled__default.div(_templateObject0$c || (_templateObject0$c = _taggedTemplateLiteralLoose(["\n width: 52px;\n height: 52px;\n border-radius: 8px;\n overflow: hidden;\n margin: 8px;\n flex: 0 0 52px;\n"])));
40251
- var FaviconImg = styled__default.img(_templateObject1$b || (_templateObject1$b = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n"])));
40455
+ var FaviconImg = styled__default.img(_templateObject1$c || (_templateObject1$c = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n"])));
40252
40456
 
40253
40457
  var _templateObject$I, _templateObject2$D, _templateObject3$x, _templateObject4$s, _templateObject5$n, _templateObject6$k, _templateObject7$j, _templateObject8$h, _templateObject9$e, _templateObject0$d;
40254
40458
  var MessageBody = function MessageBody(_ref) {
@@ -41430,7 +41634,7 @@ function SvgCircleDashed(props) {
41430
41634
  })));
41431
41635
  }
41432
41636
 
41433
- var _templateObject$L, _templateObject2$G, _templateObject3$A, _templateObject4$v, _templateObject5$q, _templateObject6$m, _templateObject7$l, _templateObject8$j, _templateObject9$g, _templateObject0$f, _templateObject1$c, _templateObject10$9, _templateObject11$6, _templateObject12$4, _templateObject13$3;
41637
+ var _templateObject$L, _templateObject2$G, _templateObject3$A, _templateObject4$v, _templateObject5$q, _templateObject6$m, _templateObject7$l, _templateObject8$j, _templateObject9$g, _templateObject0$f, _templateObject1$d, _templateObject10$a, _templateObject11$7, _templateObject12$5, _templateObject13$4;
41434
41638
  var defaultFormatDate = function defaultFormatDate(date) {
41435
41639
  var m = moment(date);
41436
41640
  if (m.isSame(moment(), 'day')) {
@@ -42048,15 +42252,15 @@ var Panel = styled__default.div(_templateObject0$f || (_templateObject0$f = _tag
42048
42252
  }, function (p) {
42049
42253
  return p.minWidth || '340px';
42050
42254
  });
42051
- var Content = styled__default.div(_templateObject1$c || (_templateObject1$c = _taggedTemplateLiteralLoose(["\n padding: ", ";\n height: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n"])), function (p) {
42255
+ var Content = styled__default.div(_templateObject1$d || (_templateObject1$d = _taggedTemplateLiteralLoose(["\n padding: ", ";\n height: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n"])), function (p) {
42052
42256
  return p.padding || '16px 12px';
42053
42257
  });
42054
- var P2PStatusList = styled__default.div(_templateObject10$9 || (_templateObject10$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n"])));
42055
- var P2PStatusRow = styled__default.div(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 4px;\n height: 48px;\n"])));
42056
- var P2PStatusLabel = styled__default.div(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-family: Inter;\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n"])), function (p) {
42258
+ var P2PStatusList = styled__default.div(_templateObject10$a || (_templateObject10$a = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n"])));
42259
+ var P2PStatusRow = styled__default.div(_templateObject11$7 || (_templateObject11$7 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 4px;\n height: 48px;\n"])));
42260
+ var P2PStatusLabel = styled__default.div(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-family: Inter;\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n"])), function (p) {
42057
42261
  return p.color;
42058
42262
  });
42059
- var P2PStatusDate = styled__default.div(_templateObject13$3 || (_templateObject13$3 = _taggedTemplateLiteralLoose(["\n color: ", ";\n min-width: max-content;\n font-family: Inter;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n letter-spacing: 0px;\n"])), function (p) {
42263
+ var P2PStatusDate = styled__default.div(_templateObject13$4 || (_templateObject13$4 = _taggedTemplateLiteralLoose(["\n color: ", ";\n min-width: max-content;\n font-family: Inter;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n letter-spacing: 0px;\n"])), function (p) {
42060
42264
  return p.color;
42061
42265
  });
42062
42266
 
@@ -43292,6 +43496,11 @@ var DEFAULT_UNREAD_VISIBILITY_THRESHOLD = 0.5;
43292
43496
  var JUMP_SCROLL_LOCK_MS = 1800;
43293
43497
  var PRESERVE_ANCHOR_SCROLL_EPSILON_PX = 1;
43294
43498
  var SCROLL_IDLE_MS = 800;
43499
+ var delay = function delay(ms) {
43500
+ return new Promise(function (resolve) {
43501
+ return setTimeout(resolve, ms);
43502
+ });
43503
+ };
43295
43504
  var channelRestoreWindowMap = new Map();
43296
43505
  var formatMessageDateLabel = function formatMessageDateLabel(message) {
43297
43506
  var current = new Date(message.createdAt);
@@ -44083,15 +44292,33 @@ function useChatController(_ref3) {
44083
44292
  jumpTargetIdRef.current = itemId;
44084
44293
  setIsJumpingToItem(true);
44085
44294
  return Promise.resolve(_finallyRethrows(function () {
44086
- return Promise.resolve(beginWindowPagedRequest(function () {
44087
- dispatch(loadAroundMessageAC(channelRef.current, itemId));
44088
- })).then(function () {
44089
- if (jumpId !== currentJumpIdRef.current) {
44090
- clearJumpBlur();
44091
- return;
44092
- }
44093
- windowLoadScopeRef.current = null;
44094
- setHighlight(itemId);
44295
+ return Promise.resolve(delay(20)).then(function () {
44296
+ var timeout = setTimeout(function () {
44297
+ if (pendingWindowLoadRef.current) {
44298
+ dispatch(cancelWindowLoadAC());
44299
+ pendingWindowLoadRef.current.resolve({
44300
+ items: []
44301
+ });
44302
+ pendingWindowLoadRef.current = null;
44303
+ windowLoadScopeRef.current = null;
44304
+ setIsJumpingToItem(false);
44305
+ }
44306
+ }, 7000);
44307
+ return Promise.resolve(beginWindowPagedRequest(function () {
44308
+ dispatch(loadAroundMessageAC(channelRef.current, itemId));
44309
+ }, {
44310
+ allowNoLoading: true
44311
+ })).then(function () {
44312
+ clearTimeout(timeout);
44313
+ if (jumpId !== currentJumpIdRef.current) {
44314
+ setIsJumpingToItem(false);
44315
+ windowLoadScopeRef.current = null;
44316
+ clearJumpBlur();
44317
+ return;
44318
+ }
44319
+ windowLoadScopeRef.current = null;
44320
+ setHighlight(itemId);
44321
+ });
44095
44322
  });
44096
44323
  }, function (_wasThrown, _result) {
44097
44324
  if (jumpId === currentJumpIdRef.current) {
@@ -45267,7 +45494,7 @@ var createMessageMarkerBatcher = function createMessageMarkerBatcher(_ref) {
45267
45494
  };
45268
45495
  };
45269
45496
 
45270
- var _templateObject$P, _templateObject2$K, _templateObject3$C, _templateObject4$x, _templateObject5$s, _templateObject6$o, _templateObject7$m, _templateObject8$k, _templateObject9$h, _templateObject0$g, _templateObject1$d, _templateObject10$a, _templateObject11$7;
45497
+ var _templateObject$P, _templateObject2$K, _templateObject3$C, _templateObject4$x, _templateObject5$s, _templateObject6$o, _templateObject7$m, _templateObject8$k, _templateObject9$h, _templateObject0$g, _templateObject1$e, _templateObject10$b, _templateObject11$8;
45271
45498
  var MessageList = function MessageList(_ref) {
45272
45499
  var _scrollRef$current, _scrollRef$current2;
45273
45500
  var fontFamily = _ref.fontFamily,
@@ -46013,13 +46240,18 @@ var MessageList = function MessageList(_ref) {
46013
46240
  isHighlighted: timelineItem.isHighlighted,
46014
46241
  ifLatestAndHasNotPreview: timelineItem.ifLatestAndHasNotPreview
46015
46242
  }));
46016
- }))) : loadingPrevMessages === LOADING_STATE.LOADED && loadingNextMessages === LOADING_STATE.LOADED && (/*#__PURE__*/React__default.createElement(NoMessagesContainer, {
46243
+ }))) : loadingPrevMessages === LOADING_STATE.LOADED && loadingNextMessages === LOADING_STATE.LOADED ? (/*#__PURE__*/React__default.createElement(NoMessagesContainer, {
46017
46244
  color: textPrimary
46018
46245
  }, /*#__PURE__*/React__default.createElement(SvgNoMessagesIcon, null), /*#__PURE__*/React__default.createElement(NoMessagesTitle, {
46019
46246
  color: textPrimary
46020
46247
  }, "No Messages yet"), /*#__PURE__*/React__default.createElement(NoMessagesText, {
46021
46248
  color: textSecondary
46022
- }, "No messages yet, start the chat"))), (attachmentsPreview === null || attachmentsPreview === void 0 ? void 0 : attachmentsPreview.show) && mediaFile && (/*#__PURE__*/React__default.createElement(SliderPopup, {
46249
+ }, "No messages yet, start the chat"))) : (/*#__PURE__*/React__default.createElement(NoMessagesContainer, {
46250
+ color: textPrimary
46251
+ }, /*#__PURE__*/React__default.createElement(JumpSpinner, {
46252
+ "$color": iconInactive,
46253
+ "$size": 32
46254
+ }))), (attachmentsPreview === null || attachmentsPreview === void 0 ? void 0 : attachmentsPreview.show) && mediaFile && (/*#__PURE__*/React__default.createElement(SliderPopup, {
46023
46255
  channel: channel,
46024
46256
  setIsSliderOpen: setMediaFile,
46025
46257
  currentMediaFile: mediaFile,
@@ -46054,7 +46286,11 @@ var Container$j = styled__default.div(_templateObject$P || (_templateObject$P =
46054
46286
  return props.thumbColor;
46055
46287
  });
46056
46288
  var JumpOverlay = styled__default.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"])));
46057
- var JumpSpinner = styled__default.div(_templateObject3$C || (_templateObject3$C = _taggedTemplateLiteralLoose(["\n width: 26px;\n height: 26px;\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) {
46289
+ var JumpSpinner = styled__default.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) {
46290
+ return props.$size || 26;
46291
+ }, function (props) {
46292
+ return props.$size || 26;
46293
+ }, function (props) {
46058
46294
  return props.$color || '#9EA6B0';
46059
46295
  });
46060
46296
  var MessagesBox = styled__default.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) {
@@ -46098,13 +46334,13 @@ var DropAttachmentArea = styled__default.div(_templateObject9$h || (_templateObj
46098
46334
  var MessageWrapper = styled__default.div(_templateObject0$g || (_templateObject0$g = _taggedTemplateLiteralLoose(["\n &.highlight {\n & .message_item {\n background-color: ", ";\n }\n }\n"])), function (props) {
46099
46335
  return props.highlightBg || '#d5d5d5';
46100
46336
  });
46101
- var NoMessagesContainer = styled__default.div(_templateObject1$d || (_templateObject1$d = _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) {
46337
+ var NoMessagesContainer = styled__default.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) {
46102
46338
  return props.color;
46103
46339
  });
46104
- var NoMessagesTitle = styled__default.h4(_templateObject10$a || (_templateObject10$a = _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) {
46340
+ var NoMessagesTitle = styled__default.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) {
46105
46341
  return props.color;
46106
46342
  });
46107
- var NoMessagesText = styled__default.p(_templateObject11$7 || (_templateObject11$7 = _taggedTemplateLiteralLoose(["\n margin: 0;\n text-align: center;\n font-feature-settings:\n 'clig' off,\n 'liga' off;\n font-family: Inter, sans-serif;\n font-size: 15px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: ", ";\n"])), function (props) {
46343
+ var NoMessagesText = styled__default.p(_templateObject11$8 || (_templateObject11$8 = _taggedTemplateLiteralLoose(["\n margin: 0;\n text-align: center;\n font-feature-settings:\n 'clig' off,\n 'liga' off;\n font-family: Inter, sans-serif;\n font-size: 15px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: ", ";\n"])), function (props) {
46108
46344
  return props.color;
46109
46345
  });
46110
46346
 
@@ -49528,7 +49764,7 @@ var SettingItem = styled__default.div(_templateObject9$i || (_templateObject9$i
49528
49764
  return props.color;
49529
49765
  });
49530
49766
 
49531
- var _templateObject$W, _templateObject2$R, _templateObject3$I, _templateObject4$C, _templateObject5$x, _templateObject6$t, _templateObject7$q, _templateObject8$n, _templateObject9$j, _templateObject0$h, _templateObject1$e, _templateObject10$b, _templateObject11$8, _templateObject12$5, _templateObject13$4, _templateObject14$3, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$2, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1, _templateObject35$1, _templateObject36$1, _templateObject37$1, _templateObject38$1, _templateObject39$1, _templateObject40$1, _templateObject41$1, _templateObject42, _templateObject43, _templateObject44, _templateObject45;
49767
+ var _templateObject$W, _templateObject2$R, _templateObject3$I, _templateObject4$C, _templateObject5$x, _templateObject6$t, _templateObject7$q, _templateObject8$n, _templateObject9$j, _templateObject0$h, _templateObject1$f, _templateObject10$c, _templateObject11$9, _templateObject12$6, _templateObject13$5, _templateObject14$4, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$2, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1, _templateObject35$1, _templateObject36$1, _templateObject37$1, _templateObject38$1, _templateObject39$1, _templateObject40$1, _templateObject41$1, _templateObject42, _templateObject43, _templateObject44, _templateObject45;
49532
49768
  function AutoFocusPlugin(_ref) {
49533
49769
  var messageForReply = _ref.messageForReply;
49534
49770
  var _useLexicalComposerCo = LexicalComposerContext.useLexicalComposerContext(),
@@ -51516,10 +51752,10 @@ var UserName$1 = styled__default.span(_templateObject9$j || (_templateObject9$j
51516
51752
  var ReplyMessageBody$1 = styled__default.div(_templateObject0$h || (_templateObject0$h = _taggedTemplateLiteralLoose(["\n word-break: break-word;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n a {\n color: ", ";\n }\n"])), function (props) {
51517
51753
  return props.linkColor;
51518
51754
  });
51519
- var EditReplyMessageHeader = styled__default.h4(_templateObject1$e || (_templateObject1$e = _taggedTemplateLiteralLoose(["\n display: flex;\n margin: 0 0 2px;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n color: ", ";\n\n > svg {\n margin-right: 4px;\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
51755
+ var EditReplyMessageHeader = styled__default.h4(_templateObject1$f || (_templateObject1$f = _taggedTemplateLiteralLoose(["\n display: flex;\n margin: 0 0 2px;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n color: ", ";\n\n > svg {\n margin-right: 4px;\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
51520
51756
  return props.color;
51521
51757
  });
51522
- var AddAttachmentIcon = styled__default.span(_templateObject10$b || (_templateObject10$b = _taggedTemplateLiteralLoose(["\n display: flex;\n height: ", ";\n align-items: center;\n margin: 0 8px;\n cursor: pointer;\n line-height: 13px;\n z-index: 2;\n order: ", ";\n\n > svg {\n ", ";\n width: 24px;\n }\n\n &:hover > svg {\n color: ", ";\n }\n"])), function (props) {
51758
+ var AddAttachmentIcon = styled__default.span(_templateObject10$c || (_templateObject10$c = _taggedTemplateLiteralLoose(["\n display: flex;\n height: ", ";\n align-items: center;\n margin: 0 8px;\n cursor: pointer;\n line-height: 13px;\n z-index: 2;\n order: ", ";\n\n > svg {\n ", ";\n width: 24px;\n }\n\n &:hover > svg {\n color: ", ";\n }\n"])), function (props) {
51523
51759
  return props.height ? props.height + "px" : '36px';
51524
51760
  }, function (props) {
51525
51761
  return props.order === 0 || props.order ? props.order : 1;
@@ -51528,21 +51764,21 @@ var AddAttachmentIcon = styled__default.span(_templateObject10$b || (_templateOb
51528
51764
  }, function (props) {
51529
51765
  return props.hoverColor;
51530
51766
  });
51531
- var SendMessageInputContainer = styled__default.div(_templateObject11$8 || (_templateObject11$8 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n position: relative;\n min-height: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n\n & .dropdown-trigger.open {\n color: #ccc;\n\n & ", " {\n & > svg {\n color: ", ";\n }\n ;\n }\n }\n}\n"])), function (props) {
51767
+ var SendMessageInputContainer = styled__default.div(_templateObject11$9 || (_templateObject11$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n position: relative;\n min-height: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n\n & .dropdown-trigger.open {\n color: #ccc;\n\n & ", " {\n & > svg {\n color: ", ";\n }\n ;\n }\n }\n}\n"])), function (props) {
51532
51768
  return props.minHeight || '36px';
51533
51769
  }, function (props) {
51534
51770
  return props.messageForReply ? '0 0 4px 4px' : '4px';
51535
51771
  }, AddAttachmentIcon, function (props) {
51536
51772
  return props.iconColor;
51537
51773
  });
51538
- var MessageInputWrapper = styled__default.div(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n max-width: calc(100% - 50px);\n //max-width: ", ";\n //max-width: calc(100% - 110px);\n background-color: ", ";\n border-radius: ", ";\n position: relative;\n"])), function (props) {
51774
+ var MessageInputWrapper = styled__default.div(_templateObject12$6 || (_templateObject12$6 = _taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n max-width: calc(100% - 50px);\n //max-width: ", ";\n //max-width: calc(100% - 110px);\n background-color: ", ";\n border-radius: ", ";\n position: relative;\n"])), function (props) {
51539
51775
  return props.channelDetailsIsOpen ? "calc(100% - " + (props.channelDetailsIsOpen ? 362 : 0) + "px)" : '';
51540
51776
  }, function (props) {
51541
51777
  return props.backgroundColor;
51542
51778
  }, function (props) {
51543
51779
  return props.borderRadius || '18px';
51544
51780
  });
51545
- var LexicalWrapper = styled__default.div(_templateObject13$4 || (_templateObject13$4 = _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) {
51781
+ var LexicalWrapper = styled__default.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) {
51546
51782
  return props.borderRadius;
51547
51783
  }, function (props) {
51548
51784
  return props.backgroundColor;
@@ -51565,7 +51801,7 @@ var LexicalWrapper = styled__default.div(_templateObject13$4 || (_templateObject
51565
51801
  }, function (props) {
51566
51802
  return props.mentionColor;
51567
51803
  });
51568
- var Placeholder = styled__default.span(_templateObject14$3 || (_templateObject14$3 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n color: ", ";\n padding: ", ";\n line-height: 20px;\n\n @media (max-width: 768px) {\n font-size: 13px;\n }\n"])), function (props) {
51804
+ var Placeholder = styled__default.span(_templateObject14$4 || (_templateObject14$4 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n color: ", ";\n padding: ", ";\n line-height: 20px;\n\n @media (max-width: 768px) {\n font-size: 13px;\n }\n"])), function (props) {
51569
51805
  return props.color;
51570
51806
  }, function (props) {
51571
51807
  return props.paddings || '8px 6px';
@@ -52410,7 +52646,7 @@ var EmptyText = styled__default.div(_templateObject7$s || (_templateObject7$s =
52410
52646
  });
52411
52647
  var ChevronRightIconWrapper = styled__default.span(_templateObject8$p || (_templateObject8$p = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n\n & > svg {\n width: 16px;\n height: 16px;\n transform: rotate(-90deg);\n }\n"])));
52412
52648
 
52413
- var _templateObject$_, _templateObject2$V, _templateObject3$M, _templateObject4$F, _templateObject5$A, _templateObject6$w, _templateObject7$t, _templateObject8$q, _templateObject9$k, _templateObject0$i, _templateObject1$f, _templateObject10$c, _templateObject11$9, _templateObject12$6, _templateObject13$5, _templateObject14$4, _templateObject15$3, _templateObject16$3, _templateObject17$3, _templateObject18$3, _templateObject19$3, _templateObject20$3;
52649
+ var _templateObject$_, _templateObject2$V, _templateObject3$M, _templateObject4$F, _templateObject5$A, _templateObject6$w, _templateObject7$t, _templateObject8$q, _templateObject9$k, _templateObject0$i, _templateObject1$g, _templateObject10$d, _templateObject11$a, _templateObject12$7, _templateObject13$6, _templateObject14$5, _templateObject15$3, _templateObject16$3, _templateObject17$3, _templateObject18$3, _templateObject19$3, _templateObject20$3;
52414
52650
  var Actions = function Actions(_ref) {
52415
52651
  var _getDisappearingSetti;
52416
52652
  var setActionsHeight = _ref.setActionsHeight,
@@ -52944,12 +53180,12 @@ var DefaultStarIcon = styled__default(SvgStar)(_templateObject7$t || (_templateO
52944
53180
  var DefaultUnpinIcon = styled__default(SvgUnpin)(_templateObject8$q || (_templateObject8$q = _taggedTemplateLiteralLoose([""])));
52945
53181
  var DefaultPinIcon = styled__default(SvgPin)(_templateObject9$k || (_templateObject9$k = _taggedTemplateLiteralLoose([""])));
52946
53182
  var DefaultMarkAsRead = styled__default(SvgMarkAsRead)(_templateObject0$i || (_templateObject0$i = _taggedTemplateLiteralLoose([""])));
52947
- var DefaultMarkAsUnRead = styled__default(SvgMarkAsUnRead)(_templateObject1$f || (_templateObject1$f = _taggedTemplateLiteralLoose([""])));
52948
- var DefaultBlockIcon = styled__default(SvgBlockChannel)(_templateObject10$c || (_templateObject10$c = _taggedTemplateLiteralLoose([""])));
52949
- var DefaultReportIcon = styled__default(SvgReport)(_templateObject11$9 || (_templateObject11$9 = _taggedTemplateLiteralLoose([""])));
52950
- var DefaultClearIcon = styled__default(SvgClear)(_templateObject12$6 || (_templateObject12$6 = _taggedTemplateLiteralLoose([""])));
52951
- var DefaultDeleteChannelIcon = styled__default(SvgDeleteChannel)(_templateObject13$5 || (_templateObject13$5 = _taggedTemplateLiteralLoose([""])));
52952
- var DefaultBottomIcon = styled__default(SvgBottom)(_templateObject14$4 || (_templateObject14$4 = _taggedTemplateLiteralLoose([""])));
53183
+ var DefaultMarkAsUnRead = styled__default(SvgMarkAsUnRead)(_templateObject1$g || (_templateObject1$g = _taggedTemplateLiteralLoose([""])));
53184
+ var DefaultBlockIcon = styled__default(SvgBlockChannel)(_templateObject10$d || (_templateObject10$d = _taggedTemplateLiteralLoose([""])));
53185
+ var DefaultReportIcon = styled__default(SvgReport)(_templateObject11$a || (_templateObject11$a = _taggedTemplateLiteralLoose([""])));
53186
+ var DefaultClearIcon = styled__default(SvgClear)(_templateObject12$7 || (_templateObject12$7 = _taggedTemplateLiteralLoose([""])));
53187
+ var DefaultDeleteChannelIcon = styled__default(SvgDeleteChannel)(_templateObject13$6 || (_templateObject13$6 = _taggedTemplateLiteralLoose([""])));
53188
+ var DefaultBottomIcon = styled__default(SvgBottom)(_templateObject14$5 || (_templateObject14$5 = _taggedTemplateLiteralLoose([""])));
52953
53189
  var DefaultMarkAsReadIcon = styled__default(SvgLeave)(_templateObject15$3 || (_templateObject15$3 = _taggedTemplateLiteralLoose([""])));
52954
53190
  var DefaultWatchIcon = styled__default(SvgWatch)(_templateObject16$3 || (_templateObject16$3 = _taggedTemplateLiteralLoose(["\n width: 24px;\n height: 24px;\n\n path.watch-ticks,\n path:nth-child(2) {\n fill: ", " !important;\n }\n"])), function (props) {
52955
53191
  return props.$isLightMode ? '#FFFFFF' : '#000000';
@@ -53884,7 +54120,7 @@ function ResetLinkConfirmModal(_ref) {
53884
54120
  });
53885
54121
  }
53886
54122
 
53887
- var _templateObject$16, _templateObject2$11, _templateObject3$U, _templateObject4$K, _templateObject5$F, _templateObject6$z, _templateObject7$w, _templateObject8$t, _templateObject9$m, _templateObject0$k, _templateObject1$g, _templateObject10$d, _templateObject11$a, _templateObject12$7, _templateObject13$6;
54123
+ var _templateObject$16, _templateObject2$11, _templateObject3$U, _templateObject4$K, _templateObject5$F, _templateObject6$z, _templateObject7$w, _templateObject8$t, _templateObject9$m, _templateObject0$k, _templateObject1$h, _templateObject10$e, _templateObject11$b, _templateObject12$8, _templateObject13$7;
53888
54124
  function loadImage$1(src) {
53889
54125
  return new Promise(function (resolve, reject) {
53890
54126
  var img = document.createElement('img');
@@ -54494,19 +54730,19 @@ var CopyButtonWrapper = styled__default.div(_templateObject9$m || (_templateObje
54494
54730
  var SectionTitle = styled__default.h4(_templateObject0$k || (_templateObject0$k = _taggedTemplateLiteralLoose(["\n margin: 16px 0 8px;\n font-weight: 500;\n font-size: 15px;\n line-height: 16px;\n color: ", ";\n"])), function (p) {
54495
54731
  return p.color;
54496
54732
  });
54497
- var HistoryRow = styled__default.div(_templateObject1$g || (_templateObject1$g = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 12px;\n"])));
54498
- var Switch = styled__default.div(_templateObject10$d || (_templateObject10$d = _taggedTemplateLiteralLoose(["\n width: 44px;\n height: 26px;\n border-radius: 13px;\n background: ", ";\n position: relative;\n cursor: pointer;\n transition: background 0.2s ease;\n\n &:after {\n content: '';\n position: absolute;\n top: 3px;\n left: ", ";\n width: 20px;\n height: 20px;\n background: #fff;\n border-radius: 50%;\n transition: left 0.2s ease;\n }\n"])), function (p) {
54733
+ var HistoryRow = styled__default.div(_templateObject1$h || (_templateObject1$h = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 12px;\n"])));
54734
+ var Switch = styled__default.div(_templateObject10$e || (_templateObject10$e = _taggedTemplateLiteralLoose(["\n width: 44px;\n height: 26px;\n border-radius: 13px;\n background: ", ";\n position: relative;\n cursor: pointer;\n transition: background 0.2s ease;\n\n &:after {\n content: '';\n position: absolute;\n top: 3px;\n left: ", ";\n width: 20px;\n height: 20px;\n background: #fff;\n border-radius: 50%;\n transition: left 0.2s ease;\n }\n"])), function (p) {
54499
54735
  return p.active ? p.accent : 'rgba(226,226,226,1)';
54500
54736
  }, function (p) {
54501
54737
  return p.active ? '22px' : '3px';
54502
54738
  });
54503
- var ResetLink = styled__default.button(_templateObject11$a || (_templateObject11$a = _taggedTemplateLiteralLoose(["\n margin-top: 12px;\n border: none;\n background: transparent;\n color: #ff4d4f;\n cursor: pointer;\n"])));
54504
- var QRCodeBox = styled__default.div(_templateObject12$7 || (_templateObject12$7 = _taggedTemplateLiteralLoose(["\n border-radius: 8px;\n border: 1px solid ", ";\n background-color: ", ";\n display: flex;\n width: max-content;\n padding: 13.5px;\n margin: auto;\n position: relative;\n"])), function (p) {
54739
+ var ResetLink = styled__default.button(_templateObject11$b || (_templateObject11$b = _taggedTemplateLiteralLoose(["\n margin-top: 12px;\n border: none;\n background: transparent;\n color: #ff4d4f;\n cursor: pointer;\n"])));
54740
+ var QRCodeBox = styled__default.div(_templateObject12$8 || (_templateObject12$8 = _taggedTemplateLiteralLoose(["\n border-radius: 8px;\n border: 1px solid ", ";\n background-color: ", ";\n display: flex;\n width: max-content;\n padding: 13.5px;\n margin: auto;\n position: relative;\n"])), function (p) {
54505
54741
  return p.borderColor;
54506
54742
  }, function (p) {
54507
54743
  return p.backgroundColor;
54508
54744
  });
54509
- var QrHint = styled__default.p(_templateObject13$6 || (_templateObject13$6 = _taggedTemplateLiteralLoose(["\n text-align: center;\n font-size: 14px;\n line-height: 16px;\n color: ", ";\n margin: 12px 0 0;\n"])), function (p) {
54745
+ var QrHint = styled__default.p(_templateObject13$7 || (_templateObject13$7 = _taggedTemplateLiteralLoose(["\n text-align: center;\n font-size: 14px;\n line-height: 16px;\n color: ", ";\n margin: 12px 0 0;\n"])), function (p) {
54510
54746
  return p.color;
54511
54747
  });
54512
54748
 
@@ -55276,7 +55512,7 @@ var EditChannel = function EditChannel(_ref) {
55276
55512
  })));
55277
55513
  };
55278
55514
 
55279
- var _templateObject$1a, _templateObject2$15, _templateObject3$X, _templateObject4$N, _templateObject5$H, _templateObject6$B, _templateObject7$y, _templateObject8$v, _templateObject9$o, _templateObject0$l, _templateObject1$h, _templateObject10$e, _templateObject11$b;
55515
+ var _templateObject$1a, _templateObject2$15, _templateObject3$X, _templateObject4$N, _templateObject5$H, _templateObject6$B, _templateObject7$y, _templateObject8$v, _templateObject9$o, _templateObject0$l, _templateObject1$i, _templateObject10$f, _templateObject11$c;
55280
55516
  var Details = function Details(_ref) {
55281
55517
  var _activeChannel$member;
55282
55518
  var detailsTitleText = _ref.detailsTitleText,
@@ -55770,9 +56006,9 @@ var ChannelName$1 = styled__default(SectionHeader)(_templateObject0$l || (_templ
55770
56006
  }, function (props) {
55771
56007
  return props.uppercase && 'uppercase';
55772
56008
  });
55773
- var ChannelNameWrapper = styled__default.div(_templateObject1$h || (_templateObject1$h = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
55774
- var EditButton = styled__default.span(_templateObject10$e || (_templateObject10$e = _taggedTemplateLiteralLoose(["\n margin-left: 6px;\n cursor: pointer;\n color: #b2b6be;\n"])));
55775
- var PhoneNumberContainer = styled__default.span(_templateObject11$b || (_templateObject11$b = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n user-select: text;\n"])));
56009
+ var ChannelNameWrapper = styled__default.div(_templateObject1$i || (_templateObject1$i = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
56010
+ var EditButton = styled__default.span(_templateObject10$f || (_templateObject10$f = _taggedTemplateLiteralLoose(["\n margin-left: 6px;\n cursor: pointer;\n color: #b2b6be;\n"])));
56011
+ var PhoneNumberContainer = styled__default.span(_templateObject11$c || (_templateObject11$c = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n user-select: text;\n"])));
55776
56012
 
55777
56013
  var _path$1M;
55778
56014
  function _extends$1Q() {
@@ -55818,7 +56054,7 @@ function SvgChevronDownSearch(props) {
55818
56054
  })));
55819
56055
  }
55820
56056
 
55821
- var _templateObject$1b, _templateObject2$16, _templateObject3$Y, _templateObject4$O, _templateObject5$I, _templateObject6$C, _templateObject7$z, _templateObject8$w, _templateObject9$p, _templateObject0$m, _templateObject1$i, _templateObject10$f, _templateObject11$c, _templateObject12$8, _templateObject13$7, _templateObject14$5, _templateObject15$4, _templateObject16$4, _templateObject17$4, _templateObject18$4, _templateObject19$4, _templateObject20$4, _templateObject21$3, _templateObject22$2, _templateObject23$2, _templateObject24$2, _templateObject25$2;
56057
+ var _templateObject$1b, _templateObject2$16, _templateObject3$Y, _templateObject4$O, _templateObject5$I, _templateObject6$C, _templateObject7$z, _templateObject8$w, _templateObject9$p, _templateObject0$m, _templateObject1$j, _templateObject10$g, _templateObject11$d, _templateObject12$9, _templateObject13$8, _templateObject14$6, _templateObject15$4, _templateObject16$4, _templateObject17$4, _templateObject18$4, _templateObject19$4, _templateObject20$4, _templateObject21$3, _templateObject22$2, _templateObject23$2, _templateObject24$2, _templateObject25$2;
55822
56058
  var SEARCH_DEBOUNCE_MS = 400;
55823
56059
  function formatMessageDate(date) {
55824
56060
  if (!date) return '';
@@ -56276,22 +56512,22 @@ var NavButton = styled__default.button(_templateObject0$m || (_templateObject0$m
56276
56512
  }, function (p) {
56277
56513
  return p.iconColor;
56278
56514
  });
56279
- var ClearButton = styled__default.button(_templateObject1$i || (_templateObject1$i = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n background: none;\n border: none;\n cursor: pointer;\n padding: 2px;\n border-radius: 50%;\n &:hover {\n background-color: ", ";\n }\n\n & > svg {\n width: 11px;\n height: 11px;\n }\n"])), function (p) {
56515
+ var ClearButton = styled__default.button(_templateObject1$j || (_templateObject1$j = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n background: none;\n border: none;\n cursor: pointer;\n padding: 2px;\n border-radius: 50%;\n &:hover {\n background-color: ", ";\n }\n\n & > svg {\n width: 11px;\n height: 11px;\n }\n"])), function (p) {
56280
56516
  return p.hoverBackground;
56281
56517
  });
56282
- var ResultsList = styled__default.div(_templateObject10$f || (_templateObject10$f = _taggedTemplateLiteralLoose(["\n flex: 1;\n overflow-y: auto;\n padding: 0 8px 8px 8px;\n"])));
56283
- var StatusText$1 = styled__default.p(_templateObject11$c || (_templateObject11$c = _taggedTemplateLiteralLoose(["\n text-align: center;\n color: ", ";\n ", "\n align-items: center;\n display: flex;\n justify-content: center;\n font-weight: 400;\n font-size: 15px;\n line-height: 20px;\n margin: 0;\n"])), function (p) {
56518
+ var ResultsList = styled__default.div(_templateObject10$g || (_templateObject10$g = _taggedTemplateLiteralLoose(["\n flex: 1;\n overflow-y: auto;\n padding: 0 8px 8px 8px;\n"])));
56519
+ var StatusText$1 = styled__default.p(_templateObject11$d || (_templateObject11$d = _taggedTemplateLiteralLoose(["\n text-align: center;\n color: ", ";\n ", "\n align-items: center;\n display: flex;\n justify-content: center;\n font-weight: 400;\n font-size: 15px;\n line-height: 20px;\n margin: 0;\n"])), function (p) {
56284
56520
  return p.color;
56285
56521
  }, function (props) {
56286
56522
  return props.full ? 'height: 100%;' : '';
56287
56523
  });
56288
- var GroupSection = styled__default.div(_templateObject12$8 || (_templateObject12$8 = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
56289
- var GroupLabel = styled__default.div(_templateObject13$7 || (_templateObject13$7 = _taggedTemplateLiteralLoose(["\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: ", ";\n text-transform: capitalize;\n letter-spacing: 0.5px;\n color: ", ";\n padding: 12px 16px 4px;\n font-weight: 500;\n font-size: 13px;\n line-height: 16px;\n user-select: none;\n"])), function (p) {
56524
+ var GroupSection = styled__default.div(_templateObject12$9 || (_templateObject12$9 = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
56525
+ var GroupLabel = styled__default.div(_templateObject13$8 || (_templateObject13$8 = _taggedTemplateLiteralLoose(["\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: ", ";\n text-transform: capitalize;\n letter-spacing: 0.5px;\n color: ", ";\n padding: 12px 16px 4px;\n font-weight: 500;\n font-size: 13px;\n line-height: 16px;\n user-select: none;\n"])), function (p) {
56290
56526
  return p.backgroundColor;
56291
56527
  }, function (p) {
56292
56528
  return p.color;
56293
56529
  });
56294
- var ResultItem = styled__default.div(_templateObject14$5 || (_templateObject14$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-start;\n gap: 10px;\n padding: 7px 8px;\n cursor: pointer;\n transition: background-color 0.1s;\n border-radius: 12px;\n background-color: ", ";\n &:hover {\n background-color: ", ";\n }\n"])), function (p) {
56530
+ var ResultItem = styled__default.div(_templateObject14$6 || (_templateObject14$6 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-start;\n gap: 10px;\n padding: 7px 8px;\n cursor: pointer;\n transition: background-color 0.1s;\n border-radius: 12px;\n background-color: ", ";\n &:hover {\n background-color: ", ";\n }\n"])), function (p) {
56295
56531
  return p.isActive ? p.hoverBackground : 'transparent';
56296
56532
  }, function (p) {
56297
56533
  return p.hoverBackground;