@cloudflare/realtimekit-ui 1.1.0-staging.7 → 1.1.0-staging.9

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.
@@ -11045,6 +11045,13 @@ const RtkChat = class {
11045
11045
  const message = event.detail;
11046
11046
  this.meeting.chat.deleteMessage(message.id);
11047
11047
  };
11048
+ this.onMessageEdit = (event) => {
11049
+ const message = event.detail;
11050
+ if (message.type !== 'text')
11051
+ return;
11052
+ this.replyMessage = null;
11053
+ this.editingMessage = message;
11054
+ };
11048
11055
  this.getPrivateChatRecipients = () => {
11049
11056
  const participants = this.getFilteredParticipants().map((participant) => {
11050
11057
  const key = generateChatGroupKey([participant.userId, this.meeting.self.userId]);
@@ -11229,14 +11236,21 @@ const RtkChat = class {
11229
11236
  const uiProps = { iconPack: this.iconPack, t: this.t, size: this.size };
11230
11237
  const message = this.editingMessage ? this.editingMessage.message : '';
11231
11238
  const quotedMessage = this.replyMessage ? this.replyMessage.message : '';
11232
- return (h("rtk-chat-composer-view", Object.assign({ message: message, storageKey: (_a = this.selectedChannelId) !== null && _a !== void 0 ? _a : `draft-${this.selectedChannelId}`, quotedMessage: quotedMessage, isEditing: !!this.editingMessage, canSendTextMessage: this.isTextMessagingAllowed(), canSendFiles: this.isFileMessagingAllowed(), disableEmojiPicker: this.overrides.disableEmojiPicker, maxLength: this.meeting.chat.maxTextLimit, rateLimits: this.meeting.chat.rateLimits, inputTextPlaceholder: this.t('chat.message_placeholder'), onNewMessage: this.onNewMessageHandler, onEditMessage: this.onEditMessageHandler, onEditCancel: this.onEditCancel, onQuotedMessageDismiss: this.onQuotedMessageDismiss }, uiProps), h("slot", { name: "chat-addon", slot: "chat-addon" })));
11239
+ const draftStorageKey = this.selectedChannelId
11240
+ ? `rtk-chat-draft-${this.selectedChannelId}`
11241
+ : 'rtk-chat-draft';
11242
+ const editStorageKey = this.editingMessage
11243
+ ? `rtk-chat-edit-${(_a = this.selectedChannelId) !== null && _a !== void 0 ? _a : 'no-channel'}-${this.editingMessage.id}`
11244
+ : 'rtk-chat-edit';
11245
+ const storageKey = this.editingMessage ? editStorageKey : draftStorageKey;
11246
+ return (h("rtk-chat-composer-view", Object.assign({ message: message, storageKey: storageKey, quotedMessage: quotedMessage, isEditing: !!this.editingMessage, canSendTextMessage: this.isTextMessagingAllowed(), canSendFiles: this.isFileMessagingAllowed(), disableEmojiPicker: this.overrides.disableEmojiPicker, maxLength: this.meeting.chat.maxTextLimit, rateLimits: this.meeting.chat.rateLimits, inputTextPlaceholder: this.t('chat.message_placeholder'), onNewMessage: this.onNewMessageHandler, onEditMessage: this.onEditMessageHandler, onEditCancel: this.onEditCancel, onQuotedMessageDismiss: this.onQuotedMessageDismiss }, uiProps), h("slot", { name: "chat-addon", slot: "chat-addon" })));
11233
11247
  }
11234
11248
  render() {
11235
11249
  var _a;
11236
11250
  if (!this.meeting) {
11237
11251
  return null;
11238
11252
  }
11239
- return (h(Host, null, h("div", { class: "chat-container" }, h("div", { class: "chat" }, this.isFileMessagingAllowed() && (h("div", { id: "dropzone", class: { active: this.dropzoneActivated }, part: "dropzone" }, h("rtk-icon", { icon: this.iconPack.attach }), h("p", null, this.t('chat.send_attachment')))), this.renderPinnedMessagesHeader(), this.isPrivateChatSupported() && (h("rtk-channel-selector-view", { channels: this.getPrivateChatRecipients(), selectedChannelId: ((_a = this.selectedParticipant) === null || _a === void 0 ? void 0 : _a.userId) || 'everyone', onChannelChange: this.updateRecipients, t: this.t, viewAs: "dropdown" })), h("rtk-chat-messages-ui-paginated", { meeting: this.meeting, onPinMessage: this.onPinMessage, onDeleteMessage: this.onDeleteMessage, size: this.size, iconPack: this.iconPack, t: this.t }), this.renderComposerUI()))));
11253
+ return (h(Host, null, h("div", { class: "chat-container" }, h("div", { class: "chat" }, this.isFileMessagingAllowed() && (h("div", { id: "dropzone", class: { active: this.dropzoneActivated }, part: "dropzone" }, h("rtk-icon", { icon: this.iconPack.attach }), h("p", null, this.t('chat.send_attachment')))), this.renderPinnedMessagesHeader(), this.isPrivateChatSupported() && (h("rtk-channel-selector-view", { channels: this.getPrivateChatRecipients(), selectedChannelId: ((_a = this.selectedParticipant) === null || _a === void 0 ? void 0 : _a.userId) || 'everyone', onChannelChange: this.updateRecipients, t: this.t, viewAs: "dropdown" })), h("rtk-chat-messages-ui-paginated", { meeting: this.meeting, onPinMessage: this.onPinMessage, onEditMessage: this.onMessageEdit, onDeleteMessage: this.onDeleteMessage, size: this.size, iconPack: this.iconPack, t: this.t }), this.renderComposerUI()))));
11240
11254
  }
11241
11255
  get host() { return getElement(this); }
11242
11256
  static get watchers() { return {
@@ -11479,6 +11493,7 @@ const RtkChatMessagesUiPaginated = class {
11479
11493
  registerInstance(this, hostRef);
11480
11494
  this.editMessageInit = createEvent(this, "editMessageInit", 7);
11481
11495
  this.onPinMessage = createEvent(this, "pinMessage", 7);
11496
+ this.onEditMessage = createEvent(this, "editMessage", 7);
11482
11497
  this.onDeleteMessage = createEvent(this, "deleteMessage", 7);
11483
11498
  this.stateUpdate = createEvent(this, "rtkStateUpdate", 7);
11484
11499
  /** Icon pack */
@@ -11529,22 +11544,18 @@ const RtkChatMessagesUiPaginated = class {
11529
11544
  };
11530
11545
  this.getMessageActions = (message) => {
11531
11546
  const actions = [];
11532
- // const isSelf = this.meeting.self.userId === message.userId;
11533
- // const chatMessagePermissions = this.meeting.self.permissions?.chatMessage;
11534
- // const canEdit =
11535
- // chatMessagePermissions === undefined
11536
- // ? isSelf
11537
- // : chatMessagePermissions.canEdit === 'ALL' ||
11538
- // (chatMessagePermissions.canEdit === 'SELF' && isSelf);
11539
- const canDelete = message.userId === this.meeting.self.userId;
11540
- if (this.meeting.self.permissions.pinParticipant) {
11547
+ const messageBelongsToSelf = message.userId === this.meeting.self.userId;
11548
+ actions.push({
11549
+ id: 'pin_message',
11550
+ label: message.pinned ? this.t('unpin') : this.t('pin'),
11551
+ icon: this.iconPack.pin,
11552
+ });
11553
+ if (messageBelongsToSelf) {
11541
11554
  actions.push({
11542
- id: 'pin_message',
11543
- label: message.pinned ? this.t('unpin') : this.t('pin'),
11544
- icon: this.iconPack.pin,
11555
+ id: 'edit_message',
11556
+ label: this.t('chat.edit_msg'),
11557
+ icon: this.iconPack.edit,
11545
11558
  });
11546
- }
11547
- if (canDelete) {
11548
11559
  actions.push({
11549
11560
  id: 'delete_message',
11550
11561
  label: this.t('chat.delete_msg'),
@@ -11558,6 +11569,9 @@ const RtkChatMessagesUiPaginated = class {
11558
11569
  case 'pin_message':
11559
11570
  this.onPinMessage.emit(message);
11560
11571
  break;
11572
+ case 'edit_message':
11573
+ this.onEditMessage.emit(message);
11574
+ break;
11561
11575
  case 'delete_message':
11562
11576
  this.onDeleteMessage.emit(message);
11563
11577
  break;
@@ -11634,7 +11648,7 @@ const RtkChatMessagesUiPaginated = class {
11634
11648
  this.lastReadMessageIndex = -1;
11635
11649
  }
11636
11650
  render() {
11637
- return (h(Host, { key: 'c710da6e2fda420146905a2ed75d3444dd6d2c0b' }, h("rtk-paginated-list", { key: '51a36437e38e9c0242cca34bfda39f6d8309bee3', ref: (el) => (this.$paginatedListRef = el), pageSize: this.pageSize, pagesAllowed: 3, fetchData: this.getChatMessages, createNodes: this.createChatNodes, selectedItemId: this.selectedChannelId, emptyListLabel: this.t('chat.empty_channel') }, h("slot", { key: '69b54a41263510b425ce3e39af055321c4e2deb8' }))));
11651
+ return (h(Host, { key: '55b594d1fad2c164a70b71e297f63273ece0bc4f' }, h("rtk-paginated-list", { key: '1554ee896643feec72a02672f156f95c988813ce', ref: (el) => (this.$paginatedListRef = el), pageSize: this.pageSize, pagesAllowed: 3, fetchData: this.getChatMessages, createNodes: this.createChatNodes, selectedItemId: this.selectedChannelId, emptyListLabel: this.t('chat.empty_channel') }, h("slot", { key: '03aeb2069b87cb217b9759cabd3835c9bac81f11' }))));
11638
11652
  }
11639
11653
  get host() { return getElement(this); }
11640
11654
  static get watchers() { return {
@@ -12657,12 +12671,18 @@ const RtkPaginatedList = class {
12657
12671
  * @param {DataNode} node - The data node to add to the beginning of the list
12658
12672
  */
12659
12673
  async onNewNode(node) {
12660
- // if there are no pages, load the first page
12674
+ // if there are no pages, append to the first page
12661
12675
  if (this.pages.length < 1) {
12662
- this.oldTS = node.timeMs + 1;
12663
- this.loadPrevPage();
12676
+ this.oldTS = node.timeMs;
12677
+ this.pages.unshift([node]);
12678
+ this.newTS = node.timeMs;
12679
+ this.maxTS = node.timeMs;
12680
+ this.rerender();
12681
+ if (this.autoScroll)
12682
+ this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
12664
12683
  }
12665
- else {
12684
+ else if (this.maxTS === this.newTS) {
12685
+ this.maxTS = node.timeMs;
12666
12686
  // append messages to the page if page has not reached full capacity
12667
12687
  if (this.pages[0].length < this.pageSize) {
12668
12688
  this.pages[0].unshift(node);
@@ -12671,14 +12691,25 @@ const RtkPaginatedList = class {
12671
12691
  }
12672
12692
  else {
12673
12693
  // if page is at full capacity, load next page
12674
- this.loadNextPage();
12694
+ this.pages.unshift([node]);
12695
+ this.newTS = node.timeMs;
12696
+ // remove pages if out of bounds
12697
+ if (this.pages.length > this.pagesAllowed)
12698
+ this.pages.pop();
12699
+ // update timestamps
12700
+ const lastPage = this.pages[this.pages.length - 1];
12701
+ this.oldTS = lastPage[lastPage.length - 1].timeMs;
12702
+ this.newTS = this.pages[0][0].timeMs;
12703
+ this.rerender();
12675
12704
  }
12705
+ if (this.autoScroll)
12706
+ this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
12676
12707
  }
12677
- // If autoscroll is enabled, scroll to the bottom
12678
- if (this.autoScroll) {
12679
- this.shouldScrollToBottom = true;
12680
- this.scrollToBottom();
12708
+ else {
12709
+ if (this.autoScroll)
12710
+ this.scrollToBottom();
12681
12711
  }
12712
+ this.pendingScrollAnchor = null;
12682
12713
  }
12683
12714
  /**
12684
12715
  * Deletes a node anywhere from the list
@@ -12686,7 +12717,6 @@ const RtkPaginatedList = class {
12686
12717
  * */
12687
12718
  async onNodeDelete(id) {
12688
12719
  var _a, _b;
12689
- let didDelete = false;
12690
12720
  for (let i = this.pages.length - 1; i >= 0; i--) {
12691
12721
  const index = this.pages[i].findIndex((node) => node.id === id);
12692
12722
  // if message not found, move on
@@ -12697,24 +12727,35 @@ const RtkPaginatedList = class {
12697
12727
  // if page is empty, delete it
12698
12728
  if (this.pages[i].length === 0)
12699
12729
  this.pages.splice(i, 1);
12700
- didDelete = true;
12730
+ // update timestamps
12731
+ const firstPage = this.pages[0];
12732
+ const lastPage = this.pages[this.pages.length - 1];
12733
+ this.newTS = (_a = firstPage === null || firstPage === void 0 ? void 0 : firstPage[0]) === null || _a === void 0 ? void 0 : _a.timeMs;
12734
+ this.oldTS = (_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage[lastPage.length - 1]) === null || _b === void 0 ? void 0 : _b.timeMs;
12735
+ // if I have deleted the latest message, update maxTS
12736
+ if (index === 0 && i === 0)
12737
+ this.maxTS = this.newTS;
12738
+ this.rerender();
12701
12739
  break;
12702
12740
  }
12703
- if (!didDelete)
12704
- return;
12705
- // update timestamps
12706
- const firstPage = this.pages[0];
12707
- const lastPage = this.pages[this.pages.length - 1];
12708
- this.newTS = (_a = firstPage === null || firstPage === void 0 ? void 0 : firstPage[0]) === null || _a === void 0 ? void 0 : _a.timeMs;
12709
- this.oldTS = (_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage[lastPage.length - 1]) === null || _b === void 0 ? void 0 : _b.timeMs;
12710
- this.rerender();
12711
12741
  }
12712
12742
  /**
12713
12743
  * Updates a new node anywhere in the list
12714
- * @param {string} _id - The id of the node to update
12715
- * @param {DataNode} _node - The updated data node
12744
+ * @param {string} id - The id of the node to update
12745
+ * @param {DataNode} node - The updated data node
12716
12746
  * */
12717
- async onNodeUpdate(_id, _node) { }
12747
+ async onNodeUpdate(id, node) {
12748
+ for (let i = this.pages.length - 1; i >= 0; i--) {
12749
+ const index = this.pages[i].findIndex((node) => node.id === id);
12750
+ // if message not found, move on
12751
+ if (index === -1)
12752
+ continue;
12753
+ // edit message
12754
+ this.pages[i][index] = node;
12755
+ this.rerender();
12756
+ break;
12757
+ }
12758
+ }
12718
12759
  connectedCallback() {
12719
12760
  this.rerender = debounce$1(this.rerender.bind(this), 50, { maxWait: 200 });
12720
12761
  }
@@ -12723,6 +12764,10 @@ const RtkPaginatedList = class {
12723
12764
  this.loadPrevPage();
12724
12765
  if (this.$containerRef) {
12725
12766
  this.$containerRef.onscrollend = async () => {
12767
+ // do not do anything if we are scrolling to bottom
12768
+ if (this.shouldScrollToBottom)
12769
+ return;
12770
+ // handle top and bottom scroll
12726
12771
  if (this.isInView(this.$bottomRef)) {
12727
12772
  await this.loadNextPage();
12728
12773
  }
@@ -12765,6 +12810,8 @@ const RtkPaginatedList = class {
12765
12810
  const lastPage = this.pages[this.pages.length - 1];
12766
12811
  this.oldTS = lastPage[lastPage.length - 1].timeMs;
12767
12812
  this.newTS = this.pages[0][0].timeMs;
12813
+ if (!this.maxTS)
12814
+ this.maxTS = this.newTS;
12768
12815
  this.rerender();
12769
12816
  // fix scroll position
12770
12817
  if (scrollAnchor)
@@ -12772,53 +12819,47 @@ const RtkPaginatedList = class {
12772
12819
  }
12773
12820
  async loadNextPage() {
12774
12821
  if (this.isLoading)
12775
- return;
12822
+ return [];
12776
12823
  // Do nothing. New timestamp needs to be assigned by loadPrevPage method
12777
12824
  if (!this.newTS) {
12778
12825
  this.showNewMessagesCTR = false;
12779
- this.shouldScrollToBottom = false;
12780
- return;
12826
+ return [];
12781
12827
  }
12782
- // for autoscroll or scroll to bottom button
12783
- const maxAutoLoads = 200;
12784
- let loads = 0;
12785
- let prevNewTS = this.newTS;
12786
12828
  this.isLoading = true;
12787
12829
  this.isLoadingBottom = true;
12788
- while (loads < maxAutoLoads) {
12789
- const scrollAnchor = this.getScrollAnchor('bottom');
12790
- const data = await this.fetchData(this.newTS + 1, this.pageSize, false);
12791
- this.isLoading = false;
12792
- this.isLoadingBottom = false;
12793
- // no more new messages to load
12794
- if (!data.length) {
12795
- this.showNewMessagesCTR = false;
12796
- this.shouldScrollToBottom = false;
12797
- break;
12798
- }
12799
- // load new messages and append to the start
12800
- this.pages.unshift(data.reverse());
12801
- // remove pages if out of bounds
12802
- if (this.pages.length > this.pagesAllowed)
12803
- this.pages.pop();
12804
- // update timestamps
12805
- const lastPage = this.pages[this.pages.length - 1];
12806
- this.oldTS = lastPage[lastPage.length - 1].timeMs;
12807
- this.newTS = this.pages[0][0].timeMs;
12808
- this.rerender();
12809
- this.pendingScrollAnchor = scrollAnchor;
12810
- if (!this.shouldScrollToBottom)
12811
- break;
12812
- // if should scroll to bottom then retrigger
12813
- await this.waitForNextFrame();
12814
- this.scrollToBottom();
12815
- await this.waitForNextFrame();
12816
- // if no new messages, break
12817
- if (this.newTS === prevNewTS)
12818
- break;
12819
- prevNewTS = this.newTS;
12820
- loads++;
12830
+ const scrollAnchor = this.getScrollAnchor('bottom');
12831
+ const data = await this.fetchData(this.newTS + 1, this.pageSize, false);
12832
+ this.isLoading = false;
12833
+ this.isLoadingBottom = false;
12834
+ // no more new messages to load
12835
+ if (!data.length) {
12836
+ this.maxTS = this.newTS;
12837
+ this.showNewMessagesCTR = false;
12838
+ return [];
12821
12839
  }
12840
+ // load new messages and append to the start
12841
+ const incoming = [...data].reverse();
12842
+ if (this.pages.length === 0)
12843
+ this.pages.unshift([]);
12844
+ const firstPage = this.pages[0];
12845
+ const spaceInFirstPage = this.pageSize - firstPage.length;
12846
+ if (spaceInFirstPage > 0) {
12847
+ const toFill = incoming.splice(0, spaceInFirstPage);
12848
+ firstPage.unshift(...toFill);
12849
+ }
12850
+ while (incoming.length > 0) {
12851
+ this.pages.unshift(incoming.splice(0, this.pageSize));
12852
+ }
12853
+ // remove pages if out of bounds
12854
+ if (this.pages.length > this.pagesAllowed)
12855
+ this.pages.pop();
12856
+ // update timestamps
12857
+ const lastPage = this.pages[this.pages.length - 1];
12858
+ this.oldTS = lastPage[lastPage.length - 1].timeMs;
12859
+ this.newTS = this.pages[0][0].timeMs;
12860
+ this.rerender();
12861
+ this.pendingScrollAnchor = scrollAnchor;
12862
+ return data;
12822
12863
  }
12823
12864
  // Find the element that is closest to the top/bottom of the container
12824
12865
  getScrollAnchor(edge = 'top') {
@@ -12874,11 +12915,14 @@ const RtkPaginatedList = class {
12874
12915
  }
12875
12916
  }
12876
12917
  // this method is called recursively based on shouldScrollToBottom (see loadNextPage)
12877
- scrollToBottom() {
12878
- this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
12879
- }
12880
- waitForNextFrame() {
12881
- return new Promise((resolve) => requestAnimationFrame(() => resolve()));
12918
+ async scrollToBottom() {
12919
+ this.shouldScrollToBottom = true;
12920
+ while (this.shouldScrollToBottom) {
12921
+ const response = await this.loadNextPage();
12922
+ this.$bottomRef.scrollIntoView({ behavior: 'smooth' });
12923
+ if (response.length === 0)
12924
+ this.shouldScrollToBottom = false;
12925
+ }
12882
12926
  }
12883
12927
  rerender() {
12884
12928
  this.rerenderBoolean = !this.rerenderBoolean;
@@ -12887,10 +12931,9 @@ const RtkPaginatedList = class {
12887
12931
  /**
12888
12932
  * div.container is flex=column-reversewhich is why div#bottom-scroll comes before div#top-scroll
12889
12933
  */
12890
- return (h(Host, { key: 'e0f806cccdcba162d0c834476863b34630cb1a1e' }, h("div", { key: '6d54d50ed703a59df8d26399499533e3cb0d70fe', class: "scrollbar container", part: "container", ref: (el) => (this.$containerRef = el) }, h("div", { key: '4e9fcbed725fb55d9fbb67eca94b0e770662d51b', class: { 'show-new-messages-ctr': true, active: this.showNewMessagesCTR } }, h("rtk-button", { key: '7db0236d35db3fb9856fea7a4f62c1fbd421829e', class: "show-new-messages", kind: "icon", variant: "secondary", part: "show-new-messages", onClick: () => {
12891
- this.shouldScrollToBottom = true;
12934
+ return (h(Host, { key: '3e7a77a4254ea0c75513edeaf72a5a77cee0e913' }, h("div", { key: 'f61e72e7a447048fe17ed8321a077841f991bfc5', class: "scrollbar container", part: "container", ref: (el) => (this.$containerRef = el) }, h("div", { key: '9efd0543b48b5ad5e147a763d258f7ef1a5024c5', class: { 'show-new-messages-ctr': true, active: this.showNewMessagesCTR } }, h("rtk-button", { key: '4b9bfda38538ceb89f31f317ddcb15d24f75ae8e', class: "show-new-messages", kind: "icon", variant: "secondary", part: "show-new-messages", onClick: () => {
12892
12935
  this.scrollToBottom();
12893
- } }, h("rtk-icon", { key: '6e247e86029560601080e0b4d6dcfccbd90fcdd6', icon: this.iconPack.chevron_down }))), h("div", { key: '01d1ba7eacc67ece70b805fb2dfb493cdf1c9d23', class: "smallest-dom-element", id: "bottom-scroll", ref: (el) => (this.$bottomRef = el) }), this.isLoadingBottom && this.pages.length > 0 && h("rtk-spinner", { key: '24391bfc34914675cbfd0c287332bfdf3f5f5000', size: "sm" }), this.isLoading && this.pages.length < 1 && h("rtk-spinner", { key: 'e6c2cb44fce52ca54c9f1e543d91a29648745408', size: "lg" }), !this.isLoading && this.pages.flat().length === 0 ? (h("div", { class: "empty-list" }, this.t('list.empty'))) : (h("div", { class: "page-wrapper" }, this.pages.map((page, pageIndex) => (h("div", { class: "page", "data-page-index": pageIndex }, this.createNodes([...page].reverse())))))), this.isLoadingTop && this.pages.length > 0 && h("rtk-spinner", { key: 'd90a15494bcd7ec6c9c7ffc5e9a55054252a4258', size: "sm" }), h("div", { key: '2a65f98c3c4e6f2510c6cf1b4e2bcf1e607a7552', class: "smallest-dom-element", id: "top-scroll", ref: (el) => (this.$topRef = el) }))));
12936
+ } }, h("rtk-icon", { key: 'fbcbc895940c8046916a2382806fb403e83a0a53', icon: this.iconPack.chevron_down }))), h("div", { key: 'fe2e51385216cba1905c75db783f037953e4831e', class: "smallest-dom-element", id: "bottom-scroll", ref: (el) => (this.$bottomRef = el) }), this.isLoadingBottom && this.pages.length > 0 && h("rtk-spinner", { key: '548899e797bbf139526208df3c7696b5859cc884', size: "sm" }), this.isLoading && this.pages.length < 1 && h("rtk-spinner", { key: '6353d5970e284369c274c28fc3c774d03fd555cc', size: "lg" }), !this.isLoading && this.pages.flat().length === 0 ? (h("div", { class: "empty-list" }, this.t('list.empty'))) : (h("div", { class: "page-wrapper" }, this.pages.map((page, pageIndex) => (h("div", { class: "page", "data-page-index": pageIndex }, this.createNodes([...page].reverse())))))), this.isLoadingTop && this.pages.length > 0 && h("rtk-spinner", { key: 'ff7b4e80f27610c0b73b63ea32fa5331b0cf4630', size: "sm" }), h("div", { key: '8729bf082cde39f7b154fa5816a70b6fb2c7f7df', class: "smallest-dom-element", id: "top-scroll", ref: (el) => (this.$topRef = el) }))));
12894
12937
  }
12895
12938
  };
12896
12939
  __decorate$2$8([