@posiwise/messaging-module 0.0.90 → 0.0.91

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.
@@ -33,13 +33,14 @@ import * as i5 from 'primeng/api';
33
33
 
34
34
  class ChatBoxComponent extends AppBaseComponent {
35
35
  constructor(elRef, // NOSONAR
36
- mailboxService, profileService, socketService, scriptLoader, injector) {
36
+ mailboxService, profileService, socketService, scriptLoader, injector, cdr) {
37
37
  super(injector);
38
38
  this.elRef = elRef;
39
39
  this.mailboxService = mailboxService;
40
40
  this.profileService = profileService;
41
41
  this.socketService = socketService;
42
42
  this.scriptLoader = scriptLoader;
43
+ this.cdr = cdr;
43
44
  this.ObjectKeys = Object.keys;
44
45
  this.showEmoji = false;
45
46
  // Conversation list
@@ -116,12 +117,15 @@ class ChatBoxComponent extends AppBaseComponent {
116
117
  else {
117
118
  this.activateThread();
118
119
  }
120
+ this.cdr.markForCheck();
119
121
  })
120
122
  .add(() => {
121
123
  this.isChatLoading = false;
122
124
  this.initialLoad = false;
125
+ this.cdr.markForCheck();
123
126
  });
124
127
  }
128
+ this.cdr.markForCheck();
125
129
  });
126
130
  }
127
131
  filterConversations() {
@@ -177,6 +181,7 @@ class ChatBoxComponent extends AppBaseComponent {
177
181
  else if (this.conversations.length > 0) {
178
182
  this.router.navigate(['/message'], { fragment: this.conversations[0].to?.slug });
179
183
  }
184
+ this.cdr.markForCheck();
180
185
  });
181
186
  }
182
187
  onParticipantClick(conversation) {
@@ -195,6 +200,7 @@ class ChatBoxComponent extends AppBaseComponent {
195
200
  const newConversation = new Conversation(null, 1, null, 'chat', [to, from], null, 0, from, to);
196
201
  this.conversations.unshift(newConversation);
197
202
  this.setActive(this.conversations[0]);
203
+ this.cdr.markForCheck();
198
204
  });
199
205
  }
200
206
  // chat user list click event function
@@ -257,6 +263,7 @@ class ChatBoxComponent extends AppBaseComponent {
257
263
  this.parseConversation();
258
264
  }
259
265
  }
266
+ this.cdr.markForCheck();
260
267
  });
261
268
  }
262
269
  getMessage(messageId, reload = true) {
@@ -291,11 +298,13 @@ class ChatBoxComponent extends AppBaseComponent {
291
298
  current.created_at = response.messages[0].created_at;
292
299
  }
293
300
  }
301
+ this.cdr.markForCheck();
294
302
  })
295
303
  .add(() => {
296
304
  this.isChatLoading = false;
297
305
  this.isLoaded = true;
298
306
  this.animateOnScroll();
307
+ this.cdr.markForCheck();
299
308
  });
300
309
  }
301
310
  }
@@ -310,6 +319,7 @@ class ChatBoxComponent extends AppBaseComponent {
310
319
  return moment(o.created_at).format('YYYYMMDD');
311
320
  });
312
321
  }
322
+ this.cdr.markForCheck();
313
323
  });
314
324
  }
315
325
  clearUnreadCount() {
@@ -338,9 +348,11 @@ class ChatBoxComponent extends AppBaseComponent {
338
348
  this.messageInputRef.nativeElement.value = '';
339
349
  this.messageInputRef.nativeElement.focus();
340
350
  this.getMessage(response.conversation_id, false);
351
+ this.cdr.markForCheck();
341
352
  })
342
353
  .add(() => {
343
354
  this.isFileUploading = false;
355
+ this.cdr.markForCheck();
344
356
  });
345
357
  }
346
358
  }
@@ -349,6 +361,7 @@ class ChatBoxComponent extends AppBaseComponent {
349
361
  this.clearUnreadCount();
350
362
  this.mailboxService.markAsRead(conversationId).subscribe(() => {
351
363
  this.conversations.find(x => x?.id === conversationId).unread_count = 0;
364
+ this.cdr.markForCheck();
352
365
  });
353
366
  }
354
367
  }
@@ -408,6 +421,9 @@ class ChatBoxComponent extends AppBaseComponent {
408
421
  trackByMessageId(_index, item) {
409
422
  return item?.id;
410
423
  }
424
+ trackConversationKey(conversation) {
425
+ return conversation?.id ?? conversation?.to?.slug ?? conversation?.to?.id ?? '';
426
+ }
411
427
  animateOnScroll() {
412
428
  setTimeout(() => {
413
429
  if (window['jQuery'] && $('#chats-wrapper')?.length) {
@@ -448,6 +464,7 @@ class ChatBoxComponent extends AppBaseComponent {
448
464
  search: this.searchText
449
465
  })).then(response => {
450
466
  this.recipients = response.filter(x => x?.id !== this.currentUser?.id);
467
+ this.cdr.markForCheck();
451
468
  });
452
469
  }
453
470
  onMemberSelection(member) {
@@ -470,6 +487,7 @@ class ChatBoxComponent extends AppBaseComponent {
470
487
  }
471
488
  }
472
489
  }
490
+ this.cdr.markForCheck();
473
491
  });
474
492
  }
475
493
  });
@@ -522,13 +540,13 @@ class ChatBoxComponent extends AppBaseComponent {
522
540
  };
523
541
  document.head.appendChild(script);
524
542
  }
525
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ChatBoxComponent, deps: [{ token: i0.ElementRef }, { token: i1.MailBoxService }, { token: i1.ProfileService }, { token: i1.WebsocketService }, { token: i1.ScriptLoaderService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
526
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.19", type: ChatBoxComponent, isStandalone: false, selector: "ng-component", viewQueries: [{ propertyName: "messageInputRef", first: true, predicate: ["messageInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n <div *ngIf=\"isChatLoading\"\n class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading\">\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search a member\"\n [ngModelOptions]=\"{ standalone: true }\"\n field=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n <div class=\"users-list-padding\"\n *ngIf=\"conversations?.length\">\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\"\n *ngFor=\"let conversation of conversations\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n <ng-template [ngIf]=\"conversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\"\n *ngIf=\"conversation?.unread_count\">\n {{ conversation.unread_count }}\n </span>\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading && conversations?.length\"\n [ngIfElse]=\"noMessage\">\n <!-- Chat Header -->\n <div class=\"chat-name p-2 bg-white\"\n *ngIf=\"otherUser\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n <ng-template [ngIf]=\"currentConversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div *ngIf=\"currentUser\"\n class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n\n <ng-template [ngIf]=\"currentUser\">\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n </ng-template>\n </div>\n </div>\n </div>\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n <div *ngIf=\"!isLoaded\"\n class=\"spinner\"></div>\n <ng-container *ngIf=\"messagesGroupedByDate\">\n <ng-container *ngFor=\"let item of ObjectKeys(messagesGroupedByDate)\">\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\"\n *ngFor=\"\n let message of messagesGroupedByDate[item];\n trackBy: trackByMessageId;\n let i = index\n \">\n <ng-container *ngIf=\"message.body || message.attachment.url\">\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n <ng-container *ngIf=\"message.sender_id === currentUser.id\">\n <ng-template [ngIf]=\"currentUserImg\"\n [ngIfElse]=\"curDummy\">\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n <ng-template #curDummy>\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- Participant -->\n <ng-container *ngIf=\"message.sender_id !== currentUser.id\">\n <ng-template [ngIf]=\"currentUser && otherUser?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </ng-container>\n </a>\n </div>\n <div class=\"chat-body\">\n <div class=\"chat-content attachment\"\n *ngIf=\"\n !message?.attachment?.url;\n else withAttachmentRef\n \">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.error)=\"onDeleteMessage(message)\"\n ></i>\n <i\n *ngIf=\"\n message.sender_id === currentUser.id &&\n message.is_open\n \"\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n <p>{{ message.body }}</p>\n </div>\n\n <ng-template #withAttachmentRef>\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.error)=\"onDeleteMessage(message)\"\n ></i>\n <div *ngIf=\"message.attachment\"\n class=\"message-attachment\">\n <i *ngIf=\"message.attachment.url\">\n <img\n [src]=\"message.attachment.url\"\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.IMG\n \"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n <video\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.VIDEO\n \"\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!messagesGroupedByDate && isLoaded\">\n <div class=\"mt-3 text-center\">No message history.</div>\n </ng-container>\n\n <ng-container *ngIf=\"isFileUploading\">\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n </ng-container>\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n <div class=\"card px-3 py-2 m-0 mb-1\"\n *ngFor=\"let item of attachedFiles; let i = index\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji\u2026\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <i class=\"icon-emoticon-smile\" (click)=\"showEmoji = !showEmoji\" (keydown)=\"showEmoji = !showEmoji\"></i>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <i class=\"fa fa-paperclip\">\n <input\n id=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\"\n />\n </i>\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n </ng-template>\n\n <ng-template #noMessage>\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-template>\n</div>\n", styles: [":root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: rgb(70, 136, 236);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-double-check{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media (min-width: 768px){.no-message-center{margin-left:auto;width:calc(100% - 300px)}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "style", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "itemSize", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "variant", "fluid"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "component", type: i7.PickerComponent, selector: "emoji-mart", inputs: ["perLine", "totalFrequentLines", "i18n", "style", "title", "emoji", "darkMode", "color", "hideObsolete", "categories", "activeCategories", "set", "skin", "isNative", "emojiSize", "sheetSize", "emojisToShowFilter", "showPreview", "emojiTooltip", "autoFocus", "custom", "hideRecent", "imageUrlFn", "include", "exclude", "notFoundEmoji", "categoriesIcons", "searchIcons", "useButton", "enableFrequentEmojiSort", "enableSearch", "showSingleCategory", "virtualize", "virtualizeOffset", "recent", "backgroundImageFn"], outputs: ["emojiClick", "emojiSelect", "skinChange"] }, { kind: "directive", type: i8.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i9.TextTruncatePipe, name: "textTruncate" }, { kind: "pipe", type: i9.CommonPipe, name: "common" }] }); }
543
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ChatBoxComponent, deps: [{ token: i0.ElementRef }, { token: i1.MailBoxService }, { token: i1.ProfileService }, { token: i1.WebsocketService }, { token: i1.ScriptLoaderService }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
544
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ChatBoxComponent, isStandalone: false, selector: "ng-component", viewQueries: [{ propertyName: "messageInputRef", first: true, predicate: ["messageInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n @if (isChatLoading) {\n <div class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n }\n\n @if (!isChatLoading) {\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search a member\"\n [ngModelOptions]=\"{ standalone: true }\"\n optionLabel=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n @if (conversations?.length) {\n <div class=\"users-list-padding\">\n @for (conversation of conversations; track trackConversationKey(conversation)) {\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n @if (conversation?.to?.avatar) {\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n @if (conversation?.unread_count) {\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\">\n {{ conversation.unread_count }}\n </span>\n }\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n }\n </div>\n }\n </div>\n </div>\n </div>\n\n @if (conversations?.length) {\n <!-- Chat Header -->\n @if (otherUser) {\n <div class=\"chat-name p-2 bg-white\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n @if (currentConversation?.to?.avatar) {\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n } @else {\n @if (currentUser) {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n }\n\n @if (currentUser) {\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n @if (!isLoaded) {\n <div class=\"spinner\"></div>\n }\n @if (messagesGroupedByDate) {\n @for (item of ObjectKeys(messagesGroupedByDate); track item) {\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n @for (message of messagesGroupedByDate[item]; track message.id) {\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\">\n @if (message.body || message.attachment?.url) {\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n @if (message.sender_id === currentUser.id) {\n @if (currentUserImg) {\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n }\n }\n\n <!-- Participant -->\n @if (message.sender_id !== currentUser.id) {\n @if (currentUser && otherUser?.avatar) {\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n }\n }\n </a>\n </div>\n <div class=\"chat-body\">\n @if (!message?.attachment?.url) {\n <div class=\"chat-content attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.sender_id === currentUser.id && message.is_open) {\n <i\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n }\n <p>{{ message.body }}</p>\n </div>\n } @else {\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.attachment) {\n <div class=\"message-attachment\">\n <i>\n @if (message?.messageType === ATTACHMENT_TYPE.IMG) {\n <img\n [src]=\"message.attachment.url\"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n }\n @if (message?.messageType === ATTACHMENT_TYPE.VIDEO) {\n <video\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n }\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n }\n }\n\n @if (!messagesGroupedByDate && isLoaded) {\n <div class=\"mt-3 text-center\">No message history.</div>\n }\n\n @if (isFileUploading) {\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n }\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n @for (item of attachedFiles; track $index) {\n <div class=\"card px-3 py-2 m-0 mb-1\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji\u2026\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <i class=\"icon-emoticon-smile\" (click)=\"showEmoji = !showEmoji\" (keydown)=\"showEmoji = !showEmoji\"></i>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <span class=\"visually-hidden\">Attach file</span>\n <i class=\"fa fa-paperclip\" aria-hidden=\"true\"></i>\n <input\n id=\"file-input\"\n name=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\" />\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n } @else {\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n }\n</div>\n", styles: [":root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: rgb(70, 136, 236);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-double-check{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media(min-width:768px){.no-message-center{margin-left:auto;width:calc(100% - 300px)}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i6.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "minQueryLength", "delay", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "addOnTab", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "addOnBlur", "separator", "appendTo", "motionOptions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onAdd", "onFocus", "onBlur", "onDropdownClick", "onClear", "onInputKeydown", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "component", type: i7.PickerComponent, selector: "emoji-mart", inputs: ["perLine", "totalFrequentLines", "i18n", "style", "title", "emoji", "darkMode", "color", "hideObsolete", "categories", "activeCategories", "set", "skin", "isNative", "emojiSize", "sheetSize", "emojisToShowFilter", "showPreview", "emojiTooltip", "autoFocus", "custom", "hideRecent", "imageUrlFn", "include", "exclude", "notFoundEmoji", "categoriesIcons", "searchIcons", "useButton", "enableFrequentEmojiSort", "enableSearch", "showSingleCategory", "virtualize", "virtualizeOffset", "recent", "backgroundImageFn"], outputs: ["emojiClick", "emojiSelect", "skinChange"] }, { kind: "directive", type: i8.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i9.TextTruncatePipe, name: "textTruncate" }, { kind: "pipe", type: i9.CommonPipe, name: "common" }] }); }
527
545
  }
528
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ChatBoxComponent, decorators: [{
546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ChatBoxComponent, decorators: [{
529
547
  type: Component,
530
- args: [{ standalone: false, template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n <div *ngIf=\"isChatLoading\"\n class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading\">\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search a member\"\n [ngModelOptions]=\"{ standalone: true }\"\n field=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n <div class=\"users-list-padding\"\n *ngIf=\"conversations?.length\">\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\"\n *ngFor=\"let conversation of conversations\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n <ng-template [ngIf]=\"conversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\"\n *ngIf=\"conversation?.unread_count\">\n {{ conversation.unread_count }}\n </span>\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading && conversations?.length\"\n [ngIfElse]=\"noMessage\">\n <!-- Chat Header -->\n <div class=\"chat-name p-2 bg-white\"\n *ngIf=\"otherUser\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n <ng-template [ngIf]=\"currentConversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div *ngIf=\"currentUser\"\n class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n\n <ng-template [ngIf]=\"currentUser\">\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n </ng-template>\n </div>\n </div>\n </div>\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n <div *ngIf=\"!isLoaded\"\n class=\"spinner\"></div>\n <ng-container *ngIf=\"messagesGroupedByDate\">\n <ng-container *ngFor=\"let item of ObjectKeys(messagesGroupedByDate)\">\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\"\n *ngFor=\"\n let message of messagesGroupedByDate[item];\n trackBy: trackByMessageId;\n let i = index\n \">\n <ng-container *ngIf=\"message.body || message.attachment.url\">\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n <ng-container *ngIf=\"message.sender_id === currentUser.id\">\n <ng-template [ngIf]=\"currentUserImg\"\n [ngIfElse]=\"curDummy\">\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n <ng-template #curDummy>\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- Participant -->\n <ng-container *ngIf=\"message.sender_id !== currentUser.id\">\n <ng-template [ngIf]=\"currentUser && otherUser?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </ng-container>\n </a>\n </div>\n <div class=\"chat-body\">\n <div class=\"chat-content attachment\"\n *ngIf=\"\n !message?.attachment?.url;\n else withAttachmentRef\n \">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.error)=\"onDeleteMessage(message)\"\n ></i>\n <i\n *ngIf=\"\n message.sender_id === currentUser.id &&\n message.is_open\n \"\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n <p>{{ message.body }}</p>\n </div>\n\n <ng-template #withAttachmentRef>\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.error)=\"onDeleteMessage(message)\"\n ></i>\n <div *ngIf=\"message.attachment\"\n class=\"message-attachment\">\n <i *ngIf=\"message.attachment.url\">\n <img\n [src]=\"message.attachment.url\"\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.IMG\n \"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n <video\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.VIDEO\n \"\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!messagesGroupedByDate && isLoaded\">\n <div class=\"mt-3 text-center\">No message history.</div>\n </ng-container>\n\n <ng-container *ngIf=\"isFileUploading\">\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n </ng-container>\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n <div class=\"card px-3 py-2 m-0 mb-1\"\n *ngFor=\"let item of attachedFiles; let i = index\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji\u2026\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <i class=\"icon-emoticon-smile\" (click)=\"showEmoji = !showEmoji\" (keydown)=\"showEmoji = !showEmoji\"></i>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <i class=\"fa fa-paperclip\">\n <input\n id=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\"\n />\n </i>\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n </ng-template>\n\n <ng-template #noMessage>\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-template>\n</div>\n", styles: [":root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: rgb(70, 136, 236);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-double-check{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media (min-width: 768px){.no-message-center{margin-left:auto;width:calc(100% - 300px)}}\n"] }]
531
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.MailBoxService }, { type: i1.ProfileService }, { type: i1.WebsocketService }, { type: i1.ScriptLoaderService }, { type: i0.Injector }], propDecorators: { messageInputRef: [{
548
+ args: [{ standalone: false, template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n @if (isChatLoading) {\n <div class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n }\n\n @if (!isChatLoading) {\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search a member\"\n [ngModelOptions]=\"{ standalone: true }\"\n optionLabel=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n @if (conversations?.length) {\n <div class=\"users-list-padding\">\n @for (conversation of conversations; track trackConversationKey(conversation)) {\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n @if (conversation?.to?.avatar) {\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n @if (conversation?.unread_count) {\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\">\n {{ conversation.unread_count }}\n </span>\n }\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n }\n </div>\n }\n </div>\n </div>\n </div>\n\n @if (conversations?.length) {\n <!-- Chat Header -->\n @if (otherUser) {\n <div class=\"chat-name p-2 bg-white\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n @if (currentConversation?.to?.avatar) {\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n } @else {\n @if (currentUser) {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n }\n\n @if (currentUser) {\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n @if (!isLoaded) {\n <div class=\"spinner\"></div>\n }\n @if (messagesGroupedByDate) {\n @for (item of ObjectKeys(messagesGroupedByDate); track item) {\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n @for (message of messagesGroupedByDate[item]; track message.id) {\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\">\n @if (message.body || message.attachment?.url) {\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n @if (message.sender_id === currentUser.id) {\n @if (currentUserImg) {\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n }\n }\n\n <!-- Participant -->\n @if (message.sender_id !== currentUser.id) {\n @if (currentUser && otherUser?.avatar) {\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n }\n }\n </a>\n </div>\n <div class=\"chat-body\">\n @if (!message?.attachment?.url) {\n <div class=\"chat-content attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.sender_id === currentUser.id && message.is_open) {\n <i\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n }\n <p>{{ message.body }}</p>\n </div>\n } @else {\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.attachment) {\n <div class=\"message-attachment\">\n <i>\n @if (message?.messageType === ATTACHMENT_TYPE.IMG) {\n <img\n [src]=\"message.attachment.url\"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n }\n @if (message?.messageType === ATTACHMENT_TYPE.VIDEO) {\n <video\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n }\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n }\n }\n\n @if (!messagesGroupedByDate && isLoaded) {\n <div class=\"mt-3 text-center\">No message history.</div>\n }\n\n @if (isFileUploading) {\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n }\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n @for (item of attachedFiles; track $index) {\n <div class=\"card px-3 py-2 m-0 mb-1\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji\u2026\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <i class=\"icon-emoticon-smile\" (click)=\"showEmoji = !showEmoji\" (keydown)=\"showEmoji = !showEmoji\"></i>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <span class=\"visually-hidden\">Attach file</span>\n <i class=\"fa fa-paperclip\" aria-hidden=\"true\"></i>\n <input\n id=\"file-input\"\n name=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\" />\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n } @else {\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n }\n</div>\n", styles: [":root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: rgb(70, 136, 236);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-double-check{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media(min-width:768px){.no-message-center{margin-left:auto;width:calc(100% - 300px)}}\n"] }]
549
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.MailBoxService }, { type: i1.ProfileService }, { type: i1.WebsocketService }, { type: i1.ScriptLoaderService }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }], propDecorators: { messageInputRef: [{
532
550
  type: ViewChild,
533
551
  args: ['messageInput', { static: false }]
534
552
  }] } });
@@ -550,11 +568,11 @@ const routes = [
550
568
  }
551
569
  ];
552
570
  class MessageRoutingModule {
553
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MessageRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
554
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: MessageRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] }); }
555
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MessageRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
571
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: MessageRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
572
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.6", ngImport: i0, type: MessageRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] }); }
573
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: MessageRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
556
574
  }
557
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MessageRoutingModule, decorators: [{
575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: MessageRoutingModule, decorators: [{
558
576
  type: NgModule,
559
577
  args: [{
560
578
  imports: [RouterModule.forChild(routes)],
@@ -563,8 +581,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
563
581
  }] });
564
582
 
565
583
  class MessagingModule {
566
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MessagingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
567
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: MessagingModule, declarations: [ChatBoxComponent], imports: [CommonModule,
584
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: MessagingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
585
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.6", ngImport: i0, type: MessagingModule, declarations: [ChatBoxComponent], imports: [CommonModule,
568
586
  PipesModule,
569
587
  FormsModule,
570
588
  MessageRoutingModule,
@@ -575,7 +593,7 @@ class MessagingModule {
575
593
  NgxFileDropModule,
576
594
  InfiniteScrollModule,
577
595
  ScrollingModule], exports: [RouterModule, ChatBoxComponent] }); }
578
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MessagingModule, imports: [CommonModule,
596
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: MessagingModule, imports: [CommonModule,
579
597
  PipesModule,
580
598
  FormsModule,
581
599
  MessageRoutingModule,
@@ -587,7 +605,7 @@ class MessagingModule {
587
605
  InfiniteScrollModule,
588
606
  ScrollingModule, RouterModule] }); }
589
607
  }
590
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MessagingModule, decorators: [{
608
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: MessagingModule, decorators: [{
591
609
  type: NgModule,
592
610
  args: [{
593
611
  imports: [
@@ -1 +1 @@
1
- {"version":3,"file":"posiwise-messaging-module.mjs","sources":["../../../../libs/messaging-module/src/lib/chatbox/chatbox.component.ts","../../../../libs/messaging-module/src/lib/chatbox/chatbox.component.html","../../../../libs/messaging-module/src/lib/messaging-routing.module.ts","../../../../libs/messaging-module/src/lib/messaging.module.ts","../../../../libs/messaging-module/src/posiwise-messaging-module.ts"],"sourcesContent":["import {\n Component,\n DoCheck,\n ElementRef,\n Injector,\n OnDestroy,\n OnInit,\n ViewChild\n} from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n MailBoxService,\n PermissionService,\n ProfileService,\n ScriptLoaderService,\n WebsocketService\n} from '@posiwise/common-services';\nimport { ATTACHMENT_TYPE, ChatUser, Conversation, SOCKET_TYPE } from '@posiwise/common-utilities';\nimport { HelperService } from '@posiwise/helper-service';\n\nimport groupBy from 'lodash/groupBy';\nimport sortBy from 'lodash/sortBy';\nimport uniqBy from 'lodash/uniqBy';\nimport moment from 'moment';\nimport { FileSystemFileEntry } from 'ngx-file-drop';\nimport { lastValueFrom } from 'rxjs';\n\nimport { ExtendedConversation, MessageChatUser } from '../shared/chatbox.interface';\n\n@Component({\n templateUrl: './chatbox.component.html',\n styleUrls: ['./chatbox.component.scss'],\n\n standalone: false\n})\nexport class ChatBoxComponent extends AppBaseComponent implements OnInit, OnDestroy, DoCheck {\n // Message Box Template Ref\n @ViewChild('messageInput', { static: false })\n messageInputRef: ElementRef;\n\n // File Upload Progress spinner\n isFileUploading: boolean;\n\n ObjectKeys = Object.keys;\n\n showEmoji = false;\n\n selectedConversationId: number;\n\n currentConversation: Conversation;\n\n // logged user\n currentUser: MessageChatUser;\n\n currentUserImg: string;\n\n // Conversation list\n private pristineConversation: Conversation[] = [];\n private isDrift = true;\n private readonly units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n private initialLoad = true;\n private selectedIndex = 0;\n private totalMessages = 0;\n private currentThreads = [];\n\n conversations: Conversation[] = [];\n\n // Active Chat User => other participant\n otherUser: ChatUser;\n\n // Boolean to unsubscribe on Destroy\n // List of messages per conversation Id\n messagesGroupedByDate = {};\n\n searchText: string;\n\n recipients = [];\n\n files = [];\n\n attachedFiles: { name: string; size: string }[] = [];\n\n isChatLoading = true;\n\n currentPage = 1;\n\n isLoaded = true;\n\n throttle = 300;\n\n scrollUpDistance = 2;\n\n scrollDistance = 1;\n subscriptionId: number;\n ATTACHMENT_TYPE = ATTACHMENT_TYPE;\n\n constructor(\n private elRef: ElementRef, // NOSONAR\n private readonly mailboxService: MailBoxService,\n private readonly profileService: ProfileService,\n private readonly socketService: WebsocketService,\n private readonly scriptLoader: ScriptLoaderService,\n injector: Injector\n ) {\n super(injector);\n }\n\n onImgError(event: Event, fallbackSrc: string): void {\n const img = event.target as HTMLImageElement | null;\n if (!img) return;\n if (img.src?.endsWith(fallbackSrc)) return;\n img.src = fallbackSrc;\n }\n\n onUp(_ev, conversationId) {\n this.currentPage++;\n const totalPages = Math.ceil(this.totalMessages / 10);\n // Prevent API call if all messages have been fetched\n if (this.currentPage <= totalPages) {\n this.loadMore(conversationId, this.currentPage);\n }\n }\n\n ngOnInit() {\n this.waitForJQuery(() => {\n this.scriptLoader.loadScript('head', '/assets/js/chat.js', true);\n });\n this.listenToNewMessage();\n this.subscriptionId = PermissionService.selectedSubscription?.id;\n this.userStore().subscribe(resp => {\n this.currentUser = resp;\n if (this.currentUser) {\n this.mailboxService\n .getConversations()\n .subscribe((response: ExtendedConversation[]) => {\n if (response?.length) {\n let raw;\n if (this.conversations.length > 0) {\n raw = this.conversations.find(x => x?.id === null);\n }\n response.forEach(x => {\n x.datetime = x.latest_message.created_at;\n });\n const chats = sortBy(response, 'datetime').reverse();\n this.pristineConversation = chats;\n this.conversations = [...chats];\n\n if (raw) {\n this.conversations.unshift(raw);\n }\n\n this.parseConversation();\n setTimeout(() => this.filterConversations());\n }\n\n if (this.initialLoad) {\n this.checkIfNewConversation();\n } else {\n this.activateThread();\n }\n })\n .add(() => {\n this.isChatLoading = false;\n this.initialLoad = false;\n });\n }\n });\n }\n private filterConversations(): void {\n this.conversations = this.conversations.filter(conversation => conversation.to);\n }\n ngDoCheck() {\n // Hiding Drift messenger for Chat-box (Drift service shut down - kept for future chat widget alternative)\n if (window['jQuery'] && this.isDrift) {\n if ($('#drift-widget-container').length > 0 && $('#drift-widget-container:visible')) {\n this.isDrift = false;\n $('#drift-widget-container').hide();\n }\n }\n }\n\n override ngOnDestroy(): void {\n if (window['jQuery']) {\n $('.drift-widget-container').show();\n }\n }\n\n private parseConversation() {\n this.conversations.forEach((element: Conversation, index) => {\n element.to = element.participants.find(x => x?.id !== this.currentUser?.id);\n element.from = element.participants.find(x => x?.id === this.currentUser?.id);\n if (index === 0) {\n this.currentUserImg = element.from?.avatar ?? '/assets/img/icons/male.png';\n }\n });\n }\n\n private activateThread() {\n setTimeout(() => {\n if (window['jQuery']) {\n const selector = `.list-group-item:nth-child(${this.selectedIndex + 1})`;\n $(selector)\n .removeClass('no-border')\n .addClass(\n 'list-group-item bg-blue-grey bg-lighten-5 border-right-primary border-right-2'\n );\n }\n });\n }\n\n private checkIfNewConversation() {\n this.route.fragment.subscribe((fragment: string) => {\n if (fragment) {\n // Check for existing conversation\n const existingConversation = this.conversations.find(x => x.to?.slug === fragment);\n if (existingConversation) {\n this.otherUser = existingConversation.to;\n // sets the active tab when navigate to chat page\n this.setActive(existingConversation);\n } else {\n this.newParticipant(fragment);\n }\n } else if (this.conversations.length > 0) {\n this.router.navigate(['/message'], { fragment: this.conversations[0].to?.slug });\n }\n });\n }\n\n onParticipantClick(conversation) {\n this.otherUser = conversation.participants.find(x => x?.id !== this.currentUser?.id);\n const slug = this.otherUser?.slug;\n this.clearUnreadCount();\n this.router.navigate(['/message'], { fragment: slug });\n }\n\n private newParticipant(slug) {\n this.profileService.getUserProfile(slug).subscribe(response => {\n this.otherUser = response;\n\n const to = new ChatUser(\n response?.id,\n response?.first_name,\n response?.slug,\n response?.email,\n response?.avatar ? response?.avatar[0]?.url : '',\n new Date()\n );\n\n const from = new ChatUser(\n this.currentUser?.id,\n this.currentUser?.firstName,\n this.currentUser?.slug,\n this.currentUser?.email,\n this.currentUser?.avatar\n ? this.currentUser?.avatar[0].url\n : '/assets/img/icons/male.png',\n new Date()\n );\n\n const newConversation = new Conversation(\n null,\n 1,\n null,\n 'chat',\n [to, from],\n null,\n 0,\n from,\n to\n );\n\n this.conversations.unshift(newConversation);\n this.setActive(this.conversations[0]);\n });\n }\n\n // chat user list click event function\n private setActive(conversation) {\n this.currentPage = 0;\n this.currentThreads = [];\n this.totalMessages = 0;\n this.otherUser = conversation.participants.find(x => x?.id !== this.currentUser?.id);\n\n this.selectedConversationId = conversation?.id;\n this.currentConversation = conversation;\n\n const hElement: HTMLElement = this.elRef.nativeElement;\n // now you can simply get your elements with their class name\n const allAnchors = hElement.getElementsByClassName('list-group-item');\n // do something with selected elements\n [].forEach.call(allAnchors, (item: HTMLElement) => {\n item.setAttribute('class', 'list-group-item no-border');\n });\n\n const index = this.conversations.findIndex(x => x?.to?.id === this.otherUser?.id) || 0;\n setTimeout(() => {\n if (window['jQuery']) {\n $(`.list-group-item:nth-child(${index + 1})`)\n .removeClass('no-border')\n .addClass(\n 'list-group-item bg-blue-grey bg-lighten-5 border-right-primary border-right-2'\n );\n this.selectedIndex = $('.list-group-item.border-right-2').index();\n }\n }, 500);\n\n this.markAsRead(conversation?.id);\n this.getMessage(conversation?.id);\n }\n\n search(searchTxt) {\n if (searchTxt?.value?.length > 2) {\n this.conversations = this.pristineConversation.filter(\n x => x.to.slug.includes(searchTxt.value) ?? x.to?.email.includes(searchTxt.value)\n );\n } else {\n this.conversations = this.pristineConversation;\n }\n }\n\n // Socket For Listening to new Message\n private listenToNewMessage() {\n this.socketService.webSocket$.subscribe(\n (result: {\n event: string;\n new_conversation: string;\n data: {\n formattedDate: string;\n created_at: string;\n conversation_id: number;\n };\n id: number;\n }) => {\n if (result.event === SOCKET_TYPE.MSG) {\n if (result?.new_conversation === 'false') {\n const newMessage = result?.data;\n newMessage.formattedDate = moment(new Date(newMessage.created_at)).format(\n 'YYYYMMDD'\n );\n\n // Append the new message to conversation\n const conversation = this.conversations.find(x => x?.id === result?.id);\n if (conversation) {\n conversation.latest_message = result.data;\n conversation.created_at = newMessage.created_at;\n conversation.unread_count += 1;\n }\n\n if (\n newMessage.conversation_id === this.selectedConversationId &&\n newMessage.formattedDate in this.messagesGroupedByDate\n ) {\n this.messagesGroupedByDate[newMessage.formattedDate].push(newMessage);\n this.animateOnScroll();\n }\n } else if (result && typeof result.new_conversation === 'object') {\n this.conversations.unshift(result.new_conversation);\n this.parseConversation();\n }\n }\n }\n );\n }\n\n getMessage(messageId, reload = true) {\n if (reload) {\n this.messagesGroupedByDate = null;\n }\n if (messageId) {\n this.isLoaded = false;\n\n this.mailboxService\n .getMessages(messageId)\n .subscribe(response => {\n if (response) {\n this.totalMessages = response.object_count;\n this.currentThreads = response.messages;\n const ifExist = this.conversations.find(x => x?.id === response?.id);\n if (!ifExist) {\n this.conversations.find(x => x?.id === null).id = response?.id;\n }\n\n const messages = sortBy(response.messages, 'created_at');\n\n messages.forEach(msg => {\n msg.messageType = msg.attachment.url\n ? this.getMessageType(msg.attachment.url)\n : null;\n });\n this.messagesGroupedByDate = groupBy(messages, (o: Conversation) => {\n return moment(o.created_at).format('YYYYMMDD');\n });\n\n // Append the latest message to conversation list\n const current = this.conversations.find(\n x => x?.id === response?.id\n ).latest_message;\n if (current) {\n current.body = response.messages[0].body;\n current.created_at = response.messages[0].created_at;\n }\n }\n })\n .add(() => {\n this.isChatLoading = false;\n this.isLoaded = true;\n this.animateOnScroll();\n });\n }\n }\n\n private loadMore(conversationId, pageNumber, pageSize = 10) {\n this.mailboxService\n .getMessages(conversationId, pageNumber, pageSize)\n .subscribe(response => {\n if (response) {\n this.currentThreads = uniqBy(\n this.currentThreads.concat(response.messages),\n 'id'\n );\n const messages = sortBy(this.currentThreads, 'created_at');\n this.messagesGroupedByDate = groupBy(messages, (o: Conversation) => {\n return moment(o.created_at).format('YYYYMMDD');\n });\n }\n });\n }\n\n private clearUnreadCount() {\n this.mailboxService.decrementUnreadCount(this.currentConversation?.unread_count);\n if (this.currentConversation?.['unread_count']) {\n this.currentConversation['unread_count'] = 0;\n }\n }\n\n onSendMessage() {\n const text = this.messageInputRef.nativeElement.value;\n const formData = new FormData();\n formData.append('to', this.otherUser?.email);\n formData.append('message', text);\n formData.append('type', '1');\n formData.append('subscription_id', `${this.subscriptionId}`);\n\n if (this.files?.length) {\n this.isFileUploading = true;\n formData.append('file', this.files[0], this.files[0].name);\n }\n\n if (text || this.files.length > 0) {\n this.mailboxService\n .postMessage(formData)\n .subscribe(response => {\n this.files = [];\n this.attachedFiles = [];\n this.messageInputRef.nativeElement.value = '';\n this.messageInputRef.nativeElement.focus();\n this.getMessage(response.conversation_id, false);\n })\n .add(() => {\n this.isFileUploading = false;\n });\n }\n }\n\n private markAsRead(conversationId) {\n if (conversationId) {\n this.clearUnreadCount();\n this.mailboxService.markAsRead(conversationId).subscribe(() => {\n this.conversations.find(x => x?.id === conversationId).unread_count = 0;\n });\n }\n }\n\n private transform(bytes = 0, precision = 2) {\n // eslint-disable-next-line no-restricted-globals\n if (Number.isNaN(Number.parseFloat(String(bytes))) || !Number.isFinite(bytes)) {\n return '?';\n }\n let unit = 0;\n\n while (bytes >= 1024) {\n bytes /= 1024;\n unit++;\n }\n\n return `${bytes.toFixed(+precision)} ${this.units[unit]}`;\n }\n\n dropped(files) {\n // eslint-disable-next-line no-restricted-syntax\n for (const droppedFile of files) {\n // Is it a file?\n if (droppedFile.fileEntry.isFile) {\n const fileEntry = droppedFile.fileEntry as FileSystemFileEntry;\n fileEntry.file((file: File) => {\n this.files.push(file);\n this.attachedFiles.push({\n name: file.name,\n size: this.transform(Number(file.size))\n });\n });\n }\n }\n }\n\n onRemoveAttachment(item) {\n this.files = this.files.filter(x => x.name !== item.name);\n this.attachedFiles = this.attachedFiles.filter(x => x.name !== item.name);\n }\n\n fileOver(_event) {\n console.log();\n }\n\n onEmojiSelect($event) {\n this.messageInputRef.nativeElement.value += $event.emoji.native;\n this.showEmoji = false;\n }\n\n fileChangeListener($event) {\n const file: File = $event.target.files[0];\n this.files.push(file);\n this.attachedFiles.push({\n name: file.name,\n size: this.transform(Number(file.size / 1024))\n });\n }\n\n toggleSidebar() {\n if (window['jQuery']) {\n $('.chat-sidebar').removeClass('d-none d-sm-none').addClass('d-block d-sm-block');\n $('.content-overlay').addClass('show');\n }\n }\n\n trackByMessageId(_index, item) {\n return item?.id;\n }\n\n private animateOnScroll() {\n setTimeout(() => {\n if (window['jQuery'] && $('#chats-wrapper')?.length) {\n $('#chats-wrapper')\n .stop()\n .animate(\n {\n scrollTop: $('#chats-wrapper')[0].scrollHeight\n },\n 800\n );\n }\n });\n }\n\n private getMessageType(filename): string {\n const ext = this.getExtension(filename);\n switch (ext.toLowerCase()) {\n case 'jpg':\n case 'gif':\n case 'bmp':\n case 'png':\n return ATTACHMENT_TYPE.IMG;\n case 'm4v':\n case 'avi':\n case 'mpg':\n case 'mp4':\n return ATTACHMENT_TYPE.VIDEO;\n default:\n return '';\n }\n }\n\n private getExtension(filename) {\n const parts = filename.split('.');\n\n return parts[parts.length - 1];\n }\n\n recipientSearch() {\n lastValueFrom(\n this.mailboxService.getRecipient({\n page: 1,\n page_size: 20,\n subscription_id: PermissionService.selectedSubscription?.id,\n search: this.searchText\n })\n ).then(response => {\n this.recipients = response.filter(x => x?.id !== this.currentUser?.id);\n });\n }\n\n onMemberSelection(member) {\n this.otherUser = member;\n this.router.navigate(['/message'], { fragment: member.slug });\n }\n\n onDeleteMessage(message) {\n HelperService.raiseDeletePopup().then(rep => {\n if (rep.value) {\n this.mailboxService\n .deleteMessage(this.selectedConversationId, message?.id)\n .subscribe(response => {\n if (response?.status_code === 200) {\n const createdAt = moment(message.created_at).format('YYYYMMDD');\n // eslint-disable-next-line no-restricted-syntax\n for (const property in this.messagesGroupedByDate) {\n if (property === createdAt) {\n this.messagesGroupedByDate[property] =\n this.messagesGroupedByDate[property].filter(\n x => x?.id !== message?.id\n );\n }\n }\n }\n });\n }\n });\n }\n\n private waitForJQuery(callback: () => void): void {\n let attempts = 0;\n const maxAttempts = 100; // 10 seconds max wait time\n\n const checkJQuery = () => {\n if (window['jQuery']) {\n console.log('jQuery detected, loading chat.js');\n callback();\n } else if (attempts < maxAttempts) {\n attempts++;\n setTimeout(checkJQuery, 100);\n } else {\n console.log('jQuery not available, loading it now for chatbox');\n // Load jQuery since it's needed\n this.loadJQueryForChatbox(callback);\n }\n };\n checkJQuery();\n }\n\n private loadJQueryForChatbox(callback: () => void): void {\n const jquerySrc = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js';\n const script = document.createElement('script');\n script.src = jquerySrc;\n script.crossOrigin = 'anonymous';\n script.async = false;\n script.onload = () => {\n console.log('jQuery loaded for chatbox');\n callback();\n };\n script.onerror = () => {\n console.error('Failed to load jQuery for chatbox');\n // Try fallback\n const fallbackScript = document.createElement('script');\n fallbackScript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js';\n fallbackScript.crossOrigin = 'anonymous';\n fallbackScript.async = false;\n fallbackScript.onload = () => {\n console.log('jQuery loaded from Google CDN for chatbox');\n callback();\n };\n fallbackScript.onerror = () => {\n console.error('All jQuery CDNs failed for chatbox');\n };\n document.head.appendChild(fallbackScript);\n };\n document.head.appendChild(script);\n }\n}\n","<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n <div *ngIf=\"isChatLoading\"\n class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading\">\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search a member\"\n [ngModelOptions]=\"{ standalone: true }\"\n field=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n <div class=\"users-list-padding\"\n *ngIf=\"conversations?.length\">\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\"\n *ngFor=\"let conversation of conversations\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n <ng-template [ngIf]=\"conversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\"\n *ngIf=\"conversation?.unread_count\">\n {{ conversation.unread_count }}\n </span>\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading && conversations?.length\"\n [ngIfElse]=\"noMessage\">\n <!-- Chat Header -->\n <div class=\"chat-name p-2 bg-white\"\n *ngIf=\"otherUser\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n <ng-template [ngIf]=\"currentConversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div *ngIf=\"currentUser\"\n class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n\n <ng-template [ngIf]=\"currentUser\">\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n </ng-template>\n </div>\n </div>\n </div>\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n <div *ngIf=\"!isLoaded\"\n class=\"spinner\"></div>\n <ng-container *ngIf=\"messagesGroupedByDate\">\n <ng-container *ngFor=\"let item of ObjectKeys(messagesGroupedByDate)\">\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\"\n *ngFor=\"\n let message of messagesGroupedByDate[item];\n trackBy: trackByMessageId;\n let i = index\n \">\n <ng-container *ngIf=\"message.body || message.attachment.url\">\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n <ng-container *ngIf=\"message.sender_id === currentUser.id\">\n <ng-template [ngIf]=\"currentUserImg\"\n [ngIfElse]=\"curDummy\">\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n <ng-template #curDummy>\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- Participant -->\n <ng-container *ngIf=\"message.sender_id !== currentUser.id\">\n <ng-template [ngIf]=\"currentUser && otherUser?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </ng-container>\n </a>\n </div>\n <div class=\"chat-body\">\n <div class=\"chat-content attachment\"\n *ngIf=\"\n !message?.attachment?.url;\n else withAttachmentRef\n \">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.error)=\"onDeleteMessage(message)\"\n ></i>\n <i\n *ngIf=\"\n message.sender_id === currentUser.id &&\n message.is_open\n \"\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n <p>{{ message.body }}</p>\n </div>\n\n <ng-template #withAttachmentRef>\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.error)=\"onDeleteMessage(message)\"\n ></i>\n <div *ngIf=\"message.attachment\"\n class=\"message-attachment\">\n <i *ngIf=\"message.attachment.url\">\n <img\n [src]=\"message.attachment.url\"\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.IMG\n \"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n <video\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.VIDEO\n \"\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!messagesGroupedByDate && isLoaded\">\n <div class=\"mt-3 text-center\">No message history.</div>\n </ng-container>\n\n <ng-container *ngIf=\"isFileUploading\">\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n </ng-container>\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n <div class=\"card px-3 py-2 m-0 mb-1\"\n *ngFor=\"let item of attachedFiles; let i = index\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji…\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <i class=\"icon-emoticon-smile\" (click)=\"showEmoji = !showEmoji\" (keydown)=\"showEmoji = !showEmoji\"></i>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <i class=\"fa fa-paperclip\">\n <input\n id=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\"\n />\n </i>\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n </ng-template>\n\n <ng-template #noMessage>\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-template>\n</div>\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\n\nimport { ChatBoxComponent } from './chatbox/chatbox.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: ChatBoxComponent,\n data: {\n title: 'Chat'\n }\n },\n {\n path: ':memberId',\n component: ChatBoxComponent,\n data: {\n title: 'Chat'\n }\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule]\n})\nexport class MessageRoutingModule {}\n","import { ScrollingModule } from '@angular/cdk/scrolling';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\n\nimport { PipesModule } from '@posiwise/pipes';\n\nimport { NgxFileDropModule } from 'ngx-file-drop';\nimport { InfiniteScrollModule } from 'ngx-infinite-scroll';\nimport { AutoCompleteModule } from 'primeng/autocomplete';\nimport { ProgressSpinnerModule } from 'primeng/progressspinner';\n\nimport { PickerModule } from '@ctrl/ngx-emoji-mart';\nimport { EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji';\n\nimport { ChatBoxComponent } from './chatbox/chatbox.component';\nimport { MessageRoutingModule } from './messaging-routing.module';\n\n@NgModule({\n imports: [\n CommonModule,\n PipesModule,\n FormsModule,\n MessageRoutingModule,\n ProgressSpinnerModule,\n AutoCompleteModule,\n PickerModule,\n EmojiModule,\n NgxFileDropModule,\n InfiniteScrollModule,\n ScrollingModule\n ],\n declarations: [ChatBoxComponent],\n exports: [RouterModule, ChatBoxComponent]\n})\nexport class MessagingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCM,MAAO,gBAAiB,SAAQ,gBAAgB,CAAA;IA6DlD,WACY,CAAA,KAAiB;AACR,IAAA,cAA8B,EAC9B,cAA8B,EAC9B,aAA+B,EAC/B,YAAiC,EAClD,QAAkB,EAAA;QAElB,KAAK,CAAC,QAAQ,CAAC;QAPP,IAAK,CAAA,KAAA,GAAL,KAAK;QACI,IAAc,CAAA,cAAA,GAAd,cAAc;QACd,IAAc,CAAA,cAAA,GAAd,cAAc;QACd,IAAa,CAAA,aAAA,GAAb,aAAa;QACb,IAAY,CAAA,YAAA,GAAZ,YAAY;AA1DjC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,IAAI;QAExB,IAAS,CAAA,SAAA,GAAG,KAAK;;QAYT,IAAoB,CAAA,oBAAA,GAAmB,EAAE;QACzC,IAAO,CAAA,OAAA,GAAG,IAAI;AACL,QAAA,IAAA,CAAA,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,E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;wBACjB,oBAAoB;wBACpB;AACH,qBAAA;oBACD,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB;AAC3C,iBAAA;;;ACnCD;;AAEG;;;;"}
1
+ {"version":3,"file":"posiwise-messaging-module.mjs","sources":["../../../../libs/messaging-module/src/lib/chatbox/chatbox.component.ts","../../../../libs/messaging-module/src/lib/chatbox/chatbox.component.html","../../../../libs/messaging-module/src/lib/messaging-routing.module.ts","../../../../libs/messaging-module/src/lib/messaging.module.ts","../../../../libs/messaging-module/src/posiwise-messaging-module.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n DoCheck,\n ElementRef,\n Injector,\n OnDestroy,\n OnInit,\n ViewChild\n} from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n MailBoxService,\n PermissionService,\n ProfileService,\n ScriptLoaderService,\n WebsocketService\n} from '@posiwise/common-services';\nimport { ATTACHMENT_TYPE, ChatUser, Conversation, SOCKET_TYPE } from '@posiwise/common-utilities';\nimport { HelperService } from '@posiwise/helper-service';\n\nimport groupBy from 'lodash/groupBy';\nimport sortBy from 'lodash/sortBy';\nimport uniqBy from 'lodash/uniqBy';\nimport moment from 'moment';\nimport { FileSystemFileEntry } from 'ngx-file-drop';\nimport { lastValueFrom } from 'rxjs';\n\nimport { ExtendedConversation, MessageChatUser } from '../shared/chatbox.interface';\n\n@Component({\n templateUrl: './chatbox.component.html',\n styleUrls: ['./chatbox.component.scss'],\n\n standalone: false\n})\nexport class ChatBoxComponent extends AppBaseComponent implements OnInit, OnDestroy, DoCheck {\n // Message Box Template Ref\n @ViewChild('messageInput', { static: false })\n messageInputRef: ElementRef;\n\n // File Upload Progress spinner\n isFileUploading: boolean;\n\n ObjectKeys = Object.keys;\n\n showEmoji = false;\n\n selectedConversationId: number;\n\n currentConversation: Conversation;\n\n // logged user\n currentUser: MessageChatUser;\n\n currentUserImg: string;\n\n // Conversation list\n private pristineConversation: Conversation[] = [];\n private isDrift = true;\n private readonly units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n private initialLoad = true;\n private selectedIndex = 0;\n private totalMessages = 0;\n private currentThreads = [];\n\n conversations: Conversation[] = [];\n\n // Active Chat User => other participant\n otherUser: ChatUser;\n\n // Boolean to unsubscribe on Destroy\n // List of messages per conversation Id\n messagesGroupedByDate = {};\n\n searchText: string;\n\n recipients = [];\n\n files = [];\n\n attachedFiles: { name: string; size: string }[] = [];\n\n isChatLoading = true;\n\n currentPage = 1;\n\n isLoaded = true;\n\n throttle = 300;\n\n scrollUpDistance = 2;\n\n scrollDistance = 1;\n subscriptionId: number;\n ATTACHMENT_TYPE = ATTACHMENT_TYPE;\n\n constructor(\n private elRef: ElementRef, // NOSONAR\n private readonly mailboxService: MailBoxService,\n private readonly profileService: ProfileService,\n private readonly socketService: WebsocketService,\n private readonly scriptLoader: ScriptLoaderService,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n onImgError(event: Event, fallbackSrc: string): void {\n const img = event.target as HTMLImageElement | null;\n if (!img) return;\n if (img.src?.endsWith(fallbackSrc)) return;\n img.src = fallbackSrc;\n }\n\n onUp(_ev, conversationId) {\n this.currentPage++;\n const totalPages = Math.ceil(this.totalMessages / 10);\n // Prevent API call if all messages have been fetched\n if (this.currentPage <= totalPages) {\n this.loadMore(conversationId, this.currentPage);\n }\n }\n\n ngOnInit() {\n this.waitForJQuery(() => {\n this.scriptLoader.loadScript('head', '/assets/js/chat.js', true);\n });\n this.listenToNewMessage();\n this.subscriptionId = PermissionService.selectedSubscription?.id;\n this.userStore().subscribe(resp => {\n this.currentUser = resp;\n if (this.currentUser) {\n this.mailboxService\n .getConversations()\n .subscribe((response: ExtendedConversation[]) => {\n if (response?.length) {\n let raw;\n if (this.conversations.length > 0) {\n raw = this.conversations.find(x => x?.id === null);\n }\n response.forEach(x => {\n x.datetime = x.latest_message.created_at;\n });\n const chats = sortBy(response, 'datetime').reverse();\n this.pristineConversation = chats;\n this.conversations = [...chats];\n\n if (raw) {\n this.conversations.unshift(raw);\n }\n\n this.parseConversation();\n setTimeout(() => this.filterConversations());\n }\n\n if (this.initialLoad) {\n this.checkIfNewConversation();\n } else {\n this.activateThread();\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isChatLoading = false;\n this.initialLoad = false;\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n private filterConversations(): void {\n this.conversations = this.conversations.filter(conversation => conversation.to);\n }\n ngDoCheck() {\n // Hiding Drift messenger for Chat-box (Drift service shut down - kept for future chat widget alternative)\n if (window['jQuery'] && this.isDrift) {\n if ($('#drift-widget-container').length > 0 && $('#drift-widget-container:visible')) {\n this.isDrift = false;\n $('#drift-widget-container').hide();\n }\n }\n }\n\n override ngOnDestroy(): void {\n if (window['jQuery']) {\n $('.drift-widget-container').show();\n }\n }\n\n private parseConversation() {\n this.conversations.forEach((element: Conversation, index) => {\n element.to = element.participants.find(x => x?.id !== this.currentUser?.id);\n element.from = element.participants.find(x => x?.id === this.currentUser?.id);\n if (index === 0) {\n this.currentUserImg = element.from?.avatar ?? '/assets/img/icons/male.png';\n }\n });\n }\n\n private activateThread() {\n setTimeout(() => {\n if (window['jQuery']) {\n const selector = `.list-group-item:nth-child(${this.selectedIndex + 1})`;\n $(selector)\n .removeClass('no-border')\n .addClass(\n 'list-group-item bg-blue-grey bg-lighten-5 border-right-primary border-right-2'\n );\n }\n });\n }\n\n private checkIfNewConversation() {\n this.route.fragment.subscribe((fragment: string) => {\n if (fragment) {\n // Check for existing conversation\n const existingConversation = this.conversations.find(x => x.to?.slug === fragment);\n if (existingConversation) {\n this.otherUser = existingConversation.to;\n // sets the active tab when navigate to chat page\n this.setActive(existingConversation);\n } else {\n this.newParticipant(fragment);\n }\n } else if (this.conversations.length > 0) {\n this.router.navigate(['/message'], { fragment: this.conversations[0].to?.slug });\n }\n this.cdr.markForCheck();\n });\n }\n\n onParticipantClick(conversation) {\n this.otherUser = conversation.participants.find(x => x?.id !== this.currentUser?.id);\n const slug = this.otherUser?.slug;\n this.clearUnreadCount();\n this.router.navigate(['/message'], { fragment: slug });\n }\n\n private newParticipant(slug) {\n this.profileService.getUserProfile(slug).subscribe(response => {\n this.otherUser = response;\n\n const to = new ChatUser(\n response?.id,\n response?.first_name,\n response?.slug,\n response?.email,\n response?.avatar ? response?.avatar[0]?.url : '',\n new Date()\n );\n\n const from = new ChatUser(\n this.currentUser?.id,\n this.currentUser?.firstName,\n this.currentUser?.slug,\n this.currentUser?.email,\n this.currentUser?.avatar\n ? this.currentUser?.avatar[0].url\n : '/assets/img/icons/male.png',\n new Date()\n );\n\n const newConversation = new Conversation(\n null,\n 1,\n null,\n 'chat',\n [to, from],\n null,\n 0,\n from,\n to\n );\n\n this.conversations.unshift(newConversation);\n this.setActive(this.conversations[0]);\n this.cdr.markForCheck();\n });\n }\n\n // chat user list click event function\n private setActive(conversation) {\n this.currentPage = 0;\n this.currentThreads = [];\n this.totalMessages = 0;\n this.otherUser = conversation.participants.find(x => x?.id !== this.currentUser?.id);\n\n this.selectedConversationId = conversation?.id;\n this.currentConversation = conversation;\n\n const hElement: HTMLElement = this.elRef.nativeElement;\n // now you can simply get your elements with their class name\n const allAnchors = hElement.getElementsByClassName('list-group-item');\n // do something with selected elements\n [].forEach.call(allAnchors, (item: HTMLElement) => {\n item.setAttribute('class', 'list-group-item no-border');\n });\n\n const index = this.conversations.findIndex(x => x?.to?.id === this.otherUser?.id) || 0;\n setTimeout(() => {\n if (window['jQuery']) {\n $(`.list-group-item:nth-child(${index + 1})`)\n .removeClass('no-border')\n .addClass(\n 'list-group-item bg-blue-grey bg-lighten-5 border-right-primary border-right-2'\n );\n this.selectedIndex = $('.list-group-item.border-right-2').index();\n }\n }, 500);\n\n this.markAsRead(conversation?.id);\n this.getMessage(conversation?.id);\n }\n\n search(searchTxt) {\n if (searchTxt?.value?.length > 2) {\n this.conversations = this.pristineConversation.filter(\n x => x.to.slug.includes(searchTxt.value) ?? x.to?.email.includes(searchTxt.value)\n );\n } else {\n this.conversations = this.pristineConversation;\n }\n }\n\n // Socket For Listening to new Message\n private listenToNewMessage() {\n this.socketService.webSocket$.subscribe(\n (result: {\n event: string;\n new_conversation: string;\n data: {\n formattedDate: string;\n created_at: string;\n conversation_id: number;\n };\n id: number;\n }) => {\n if (result.event === SOCKET_TYPE.MSG) {\n if (result?.new_conversation === 'false') {\n const newMessage = result?.data;\n newMessage.formattedDate = moment(new Date(newMessage.created_at)).format(\n 'YYYYMMDD'\n );\n\n // Append the new message to conversation\n const conversation = this.conversations.find(x => x?.id === result?.id);\n if (conversation) {\n conversation.latest_message = result.data;\n conversation.created_at = newMessage.created_at;\n conversation.unread_count += 1;\n }\n\n if (\n newMessage.conversation_id === this.selectedConversationId &&\n newMessage.formattedDate in this.messagesGroupedByDate\n ) {\n this.messagesGroupedByDate[newMessage.formattedDate].push(newMessage);\n this.animateOnScroll();\n }\n } else if (result && typeof result.new_conversation === 'object') {\n this.conversations.unshift(result.new_conversation);\n this.parseConversation();\n }\n }\n this.cdr.markForCheck();\n }\n );\n }\n\n getMessage(messageId, reload = true) {\n if (reload) {\n this.messagesGroupedByDate = null;\n }\n if (messageId) {\n this.isLoaded = false;\n\n this.mailboxService\n .getMessages(messageId)\n .subscribe(response => {\n if (response) {\n this.totalMessages = response.object_count;\n this.currentThreads = response.messages;\n const ifExist = this.conversations.find(x => x?.id === response?.id);\n if (!ifExist) {\n this.conversations.find(x => x?.id === null).id = response?.id;\n }\n\n const messages = sortBy(response.messages, 'created_at');\n\n messages.forEach(msg => {\n msg.messageType = msg.attachment.url\n ? this.getMessageType(msg.attachment.url)\n : null;\n });\n this.messagesGroupedByDate = groupBy(messages, (o: Conversation) => {\n return moment(o.created_at).format('YYYYMMDD');\n });\n\n // Append the latest message to conversation list\n const current = this.conversations.find(\n x => x?.id === response?.id\n ).latest_message;\n if (current) {\n current.body = response.messages[0].body;\n current.created_at = response.messages[0].created_at;\n }\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isChatLoading = false;\n this.isLoaded = true;\n this.animateOnScroll();\n this.cdr.markForCheck();\n });\n }\n }\n\n private loadMore(conversationId, pageNumber, pageSize = 10) {\n this.mailboxService\n .getMessages(conversationId, pageNumber, pageSize)\n .subscribe(response => {\n if (response) {\n this.currentThreads = uniqBy(\n this.currentThreads.concat(response.messages),\n 'id'\n );\n const messages = sortBy(this.currentThreads, 'created_at');\n this.messagesGroupedByDate = groupBy(messages, (o: Conversation) => {\n return moment(o.created_at).format('YYYYMMDD');\n });\n }\n this.cdr.markForCheck();\n });\n }\n\n private clearUnreadCount() {\n this.mailboxService.decrementUnreadCount(this.currentConversation?.unread_count);\n if (this.currentConversation?.['unread_count']) {\n this.currentConversation['unread_count'] = 0;\n }\n }\n\n onSendMessage() {\n const text = this.messageInputRef.nativeElement.value;\n const formData = new FormData();\n formData.append('to', this.otherUser?.email);\n formData.append('message', text);\n formData.append('type', '1');\n formData.append('subscription_id', `${this.subscriptionId}`);\n\n if (this.files?.length) {\n this.isFileUploading = true;\n formData.append('file', this.files[0], this.files[0].name);\n }\n\n if (text || this.files.length > 0) {\n this.mailboxService\n .postMessage(formData)\n .subscribe(response => {\n this.files = [];\n this.attachedFiles = [];\n this.messageInputRef.nativeElement.value = '';\n this.messageInputRef.nativeElement.focus();\n this.getMessage(response.conversation_id, false);\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isFileUploading = false;\n this.cdr.markForCheck();\n });\n }\n }\n\n private markAsRead(conversationId) {\n if (conversationId) {\n this.clearUnreadCount();\n this.mailboxService.markAsRead(conversationId).subscribe(() => {\n this.conversations.find(x => x?.id === conversationId).unread_count = 0;\n this.cdr.markForCheck();\n });\n }\n }\n\n private transform(bytes = 0, precision = 2) {\n // eslint-disable-next-line no-restricted-globals\n if (Number.isNaN(Number.parseFloat(String(bytes))) || !Number.isFinite(bytes)) {\n return '?';\n }\n let unit = 0;\n\n while (bytes >= 1024) {\n bytes /= 1024;\n unit++;\n }\n\n return `${bytes.toFixed(+precision)} ${this.units[unit]}`;\n }\n\n dropped(files) {\n // eslint-disable-next-line no-restricted-syntax\n for (const droppedFile of files) {\n // Is it a file?\n if (droppedFile.fileEntry.isFile) {\n const fileEntry = droppedFile.fileEntry as FileSystemFileEntry;\n fileEntry.file((file: File) => {\n this.files.push(file);\n this.attachedFiles.push({\n name: file.name,\n size: this.transform(Number(file.size))\n });\n });\n }\n }\n }\n\n onRemoveAttachment(item) {\n this.files = this.files.filter(x => x.name !== item.name);\n this.attachedFiles = this.attachedFiles.filter(x => x.name !== item.name);\n }\n\n fileOver(_event) {\n console.log();\n }\n\n onEmojiSelect($event) {\n this.messageInputRef.nativeElement.value += $event.emoji.native;\n this.showEmoji = false;\n }\n\n fileChangeListener($event) {\n const file: File = $event.target.files[0];\n this.files.push(file);\n this.attachedFiles.push({\n name: file.name,\n size: this.transform(Number(file.size / 1024))\n });\n }\n\n toggleSidebar() {\n if (window['jQuery']) {\n $('.chat-sidebar').removeClass('d-none d-sm-none').addClass('d-block d-sm-block');\n $('.content-overlay').addClass('show');\n }\n }\n\n trackByMessageId(_index, item) {\n return item?.id;\n }\n\n trackConversationKey(conversation: Conversation): string | number {\n return conversation?.id ?? conversation?.to?.slug ?? conversation?.to?.id ?? '';\n }\n\n private animateOnScroll() {\n setTimeout(() => {\n if (window['jQuery'] && $('#chats-wrapper')?.length) {\n $('#chats-wrapper')\n .stop()\n .animate(\n {\n scrollTop: $('#chats-wrapper')[0].scrollHeight\n },\n 800\n );\n }\n });\n }\n\n private getMessageType(filename): string {\n const ext = this.getExtension(filename);\n switch (ext.toLowerCase()) {\n case 'jpg':\n case 'gif':\n case 'bmp':\n case 'png':\n return ATTACHMENT_TYPE.IMG;\n case 'm4v':\n case 'avi':\n case 'mpg':\n case 'mp4':\n return ATTACHMENT_TYPE.VIDEO;\n default:\n return '';\n }\n }\n\n private getExtension(filename) {\n const parts = filename.split('.');\n\n return parts[parts.length - 1];\n }\n\n recipientSearch() {\n lastValueFrom(\n this.mailboxService.getRecipient({\n page: 1,\n page_size: 20,\n subscription_id: PermissionService.selectedSubscription?.id,\n search: this.searchText\n })\n ).then(response => {\n this.recipients = response.filter(x => x?.id !== this.currentUser?.id);\n this.cdr.markForCheck();\n });\n }\n\n onMemberSelection(member) {\n this.otherUser = member;\n this.router.navigate(['/message'], { fragment: member.slug });\n }\n\n onDeleteMessage(message) {\n HelperService.raiseDeletePopup().then(rep => {\n if (rep.value) {\n this.mailboxService\n .deleteMessage(this.selectedConversationId, message?.id)\n .subscribe(response => {\n if (response?.status_code === 200) {\n const createdAt = moment(message.created_at).format('YYYYMMDD');\n // eslint-disable-next-line no-restricted-syntax\n for (const property in this.messagesGroupedByDate) {\n if (property === createdAt) {\n this.messagesGroupedByDate[property] =\n this.messagesGroupedByDate[property].filter(\n x => x?.id !== message?.id\n );\n }\n }\n }\n this.cdr.markForCheck();\n });\n }\n });\n }\n\n private waitForJQuery(callback: () => void): void {\n let attempts = 0;\n const maxAttempts = 100; // 10 seconds max wait time\n\n const checkJQuery = () => {\n if (window['jQuery']) {\n console.log('jQuery detected, loading chat.js');\n callback();\n } else if (attempts < maxAttempts) {\n attempts++;\n setTimeout(checkJQuery, 100);\n } else {\n console.log('jQuery not available, loading it now for chatbox');\n // Load jQuery since it's needed\n this.loadJQueryForChatbox(callback);\n }\n };\n checkJQuery();\n }\n\n private loadJQueryForChatbox(callback: () => void): void {\n const jquerySrc = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js';\n const script = document.createElement('script');\n script.src = jquerySrc;\n script.crossOrigin = 'anonymous';\n script.async = false;\n script.onload = () => {\n console.log('jQuery loaded for chatbox');\n callback();\n };\n script.onerror = () => {\n console.error('Failed to load jQuery for chatbox');\n // Try fallback\n const fallbackScript = document.createElement('script');\n fallbackScript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js';\n fallbackScript.crossOrigin = 'anonymous';\n fallbackScript.async = false;\n fallbackScript.onload = () => {\n console.log('jQuery loaded from Google CDN for chatbox');\n callback();\n };\n fallbackScript.onerror = () => {\n console.error('All jQuery CDNs failed for chatbox');\n };\n document.head.appendChild(fallbackScript);\n };\n document.head.appendChild(script);\n }\n}\n","<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n @if (isChatLoading) {\n <div class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n }\n\n @if (!isChatLoading) {\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete inputId=\"chatbox-search-member\"\n [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Search a member\"\n [ngModelOptions]=\"{ standalone: true }\"\n optionLabel=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n @if (conversations?.length) {\n <div class=\"users-list-padding\">\n @for (conversation of conversations; track trackConversationKey(conversation)) {\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n @if (conversation?.to?.avatar) {\n <img [src]=\"conversation.to?.avatar\"\n width=\"40\"\n height=\"40\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation?.participants\n ? conversation.to?.slug.charAt(0).toUpperCase()\n : conversation.to?.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to?.name\n : conversation.to?.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n @if (conversation?.unread_count) {\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\">\n {{ conversation.unread_count }}\n </span>\n }\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation?.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n }\n </div>\n }\n </div>\n </div>\n </div>\n\n @if (conversations?.length) {\n <!-- Chat Header -->\n @if (otherUser) {\n <div class=\"chat-name p-2 bg-white\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (keydown.enter)=\"toggleSidebar()\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n @if (currentConversation?.to?.avatar) {\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n role=\"presentation\"\n (error)=\"onImgError($event, '/assets/img/icons/male.png')\" />\n } @else {\n @if (currentUser) {\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n }\n }\n\n @if (currentUser) {\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <div class=\"chats\">\n <!-- Shows Message -->\n @if (!isLoaded) {\n <div class=\"spinner\"></div>\n }\n @if (messagesGroupedByDate) {\n @for (item of ObjectKeys(messagesGroupedByDate); track item) {\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n @for (message of messagesGroupedByDate[item]; track message.id) {\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\">\n @if (message.body || message.attachment?.url) {\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n @if (message.sender_id === currentUser.id) {\n @if (currentUserImg) {\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar bg-brown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n }\n }\n\n <!-- Participant -->\n @if (message.sender_id !== currentUser.id) {\n @if (currentUser && otherUser?.avatar) {\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n } @else {\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n }\n }\n </a>\n </div>\n <div class=\"chat-body\">\n @if (!message?.attachment?.url) {\n <div class=\"chat-content attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.sender_id === currentUser.id && message.is_open) {\n <i\n class=\"fa fa-check-double msg-double-check\"\n ></i>\n }\n <p>{{ message.body }}</p>\n </div>\n } @else {\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n @if (message.sender_id === currentUser.id) {\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n (click)=\"onDeleteMessage(message)\"\n (keydown.enter)=\"onDeleteMessage(message)\"\n ></i>\n }\n @if (message.attachment) {\n <div class=\"message-attachment\">\n <i>\n @if (message?.messageType === ATTACHMENT_TYPE.IMG) {\n <img\n [src]=\"message.attachment.url\"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n }\n @if (message?.messageType === ATTACHMENT_TYPE.VIDEO) {\n <video\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n <track kind=\"subtitles\" srclang=\"en\" label=\"English\" />\n Your browser does not support the video\n tag.\n </video>\n }\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n }\n }\n\n @if (!messagesGroupedByDate && isLoaded) {\n <div class=\"mt-3 text-center\">No message history.</div>\n }\n\n @if (isFileUploading) {\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n }\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n @for (item of attachedFiles; track $index) {\n <div class=\"card px-3 py-2 m-0 mb-1\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (keydown.enter)=\"onRemoveAttachment(item)\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji…\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Text box area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <i class=\"icon-emoticon-smile\" (click)=\"showEmoji = !showEmoji\" (keydown)=\"showEmoji = !showEmoji\"></i>\n </div>\n <label for=\"chatbox-message-input\" class=\"visually-hidden\">Type your message</label>\n <input type=\"text\"\n id=\"chatbox-message-input\"\n name=\"chatbox-message-input\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <span class=\"visually-hidden\">Attach file</span>\n <i class=\"fa fa-paperclip\" aria-hidden=\"true\"></i>\n <input\n id=\"file-input\"\n name=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\" />\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n } @else {\n <div class=\"container-fluid pw-tab overflow-hidden no-message-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing the name of the member you want to send a message to\n in the chat search field and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n }\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { RouterModule, Routes } from '@angular/router';\n\nimport { ChatBoxComponent } from './chatbox/chatbox.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: ChatBoxComponent,\n data: {\n title: 'Chat'\n }\n },\n {\n path: ':memberId',\n component: ChatBoxComponent,\n data: {\n title: 'Chat'\n }\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule]\n})\nexport class MessageRoutingModule {}\n","import { ScrollingModule } from '@angular/cdk/scrolling';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\n\nimport { PipesModule } from '@posiwise/pipes';\n\nimport { NgxFileDropModule } from 'ngx-file-drop';\nimport { InfiniteScrollModule } from 'ngx-infinite-scroll';\nimport { AutoCompleteModule } from 'primeng/autocomplete';\nimport { ProgressSpinnerModule } from 'primeng/progressspinner';\n\nimport { PickerModule } from '@ctrl/ngx-emoji-mart';\nimport { EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji';\n\nimport { ChatBoxComponent } from './chatbox/chatbox.component';\nimport { MessageRoutingModule } from './messaging-routing.module';\n\n@NgModule({\n imports: [\n CommonModule,\n PipesModule,\n FormsModule,\n MessageRoutingModule,\n ProgressSpinnerModule,\n AutoCompleteModule,\n PickerModule,\n EmojiModule,\n NgxFileDropModule,\n InfiniteScrollModule,\n ScrollingModule\n ],\n declarations: [ChatBoxComponent],\n exports: [RouterModule, ChatBoxComponent]\n})\nexport class Mess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,CAAA,EAAA,CAAA,CAAA;AAE/B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAfpB,YAAY;YACZ,WAAW;YACX,WAAW;YACX,oBAAoB;YACpB,qBAAqB;YACrB,kBAAkB;YAClB,YAAY;YACZ,WAAW;YACX,iBAAiB;YACjB,oBAAoB;AACpB,YAAA,eAAe,EAGT,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAEb,eAAe,EAAA,UAAA,EAAA,CAAA;kBAjB3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,WAAW;wBACX,oBAAoB;wBACpB,qBAAqB;wBACrB,kBAAkB;wBAClB,YAAY;wBACZ,WAAW;wBACX,iBAAiB;wBACjB,oBAAoB;wBACpB;AACH,qBAAA;oBACD,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB;AAC3C,iBAAA;;;ACnCD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@posiwise/messaging-module",
3
- "version": "0.0.90",
3
+ "version": "0.0.91",
4
4
  "peerDependencies": {
5
- "@angular/common": "^19.2.18",
6
- "@angular/core": "^19.2.18",
5
+ "@angular/common": "^21.2.6",
6
+ "@angular/core": "^21.2.6",
7
7
  "@ctrl/ngx-emoji-mart": "^9.2.0",
8
8
  "ngx-file-drop": "^16.0.0",
9
9
  "ngx-infinite-scroll": "^19.0.0"
@@ -13,13 +13,13 @@
13
13
  },
14
14
  "sideEffects": false,
15
15
  "module": "fesm2022/posiwise-messaging-module.mjs",
16
- "typings": "index.d.ts",
16
+ "typings": "types/posiwise-messaging-module.d.ts",
17
17
  "exports": {
18
18
  "./package.json": {
19
19
  "default": "./package.json"
20
20
  },
21
21
  ".": {
22
- "types": "./index.d.ts",
22
+ "types": "./types/posiwise-messaging-module.d.ts",
23
23
  "default": "./fesm2022/posiwise-messaging-module.mjs"
24
24
  }
25
25
  }
@@ -1,15 +1,40 @@
1
- import { DoCheck, ElementRef, Injector, OnDestroy, OnInit } from '@angular/core';
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit, OnDestroy, DoCheck, ElementRef, Injector, ChangeDetectorRef } from '@angular/core';
2
3
  import { AppBaseComponent } from '@posiwise/app-base-component';
3
- import { MailBoxService, ProfileService, ScriptLoaderService, WebsocketService } from '@posiwise/common-services';
4
- import { ATTACHMENT_TYPE, ChatUser, Conversation } from '@posiwise/common-utilities';
5
- import { MessageChatUser } from '../shared/chatbox.interface';
6
- import * as i0 from "@angular/core";
7
- export declare class ChatBoxComponent extends AppBaseComponent implements OnInit, OnDestroy, DoCheck {
4
+ import { MailBoxService, ProfileService, WebsocketService, ScriptLoaderService } from '@posiwise/common-services';
5
+ import { Conversation, ChatUser, ATTACHMENT_TYPE } from '@posiwise/common-utilities';
6
+ import * as i2 from '@angular/common';
7
+ import * as i3 from '@posiwise/pipes';
8
+ import * as i4 from '@angular/forms';
9
+ import * as i1 from '@angular/router';
10
+ import * as i6 from 'primeng/progressspinner';
11
+ import * as i7 from 'primeng/autocomplete';
12
+ import * as i8 from '@ctrl/ngx-emoji-mart';
13
+ import * as i9 from '@ctrl/ngx-emoji-mart/ngx-emoji';
14
+ import * as i10 from 'ngx-file-drop';
15
+ import * as i11 from 'ngx-infinite-scroll';
16
+ import * as i12 from '@angular/cdk/scrolling';
17
+
18
+ interface MessageChatUser {
19
+ avatar?: {
20
+ url: string;
21
+ }[];
22
+ id?: number;
23
+ firstName?: string;
24
+ slug?: string;
25
+ email?: string;
26
+ avatarUrl?: string;
27
+ lastActive?: Date;
28
+ name?: string;
29
+ }
30
+
31
+ declare class ChatBoxComponent extends AppBaseComponent implements OnInit, OnDestroy, DoCheck {
8
32
  private elRef;
9
33
  private readonly mailboxService;
10
34
  private readonly profileService;
11
35
  private readonly socketService;
12
36
  private readonly scriptLoader;
37
+ private readonly cdr;
13
38
  messageInputRef: ElementRef;
14
39
  isFileUploading: boolean;
15
40
  ObjectKeys: {
@@ -47,7 +72,7 @@ export declare class ChatBoxComponent extends AppBaseComponent implements OnInit
47
72
  subscriptionId: number;
48
73
  ATTACHMENT_TYPE: typeof ATTACHMENT_TYPE;
49
74
  constructor(elRef: ElementRef, // NOSONAR
50
- mailboxService: MailBoxService, profileService: ProfileService, socketService: WebsocketService, scriptLoader: ScriptLoaderService, injector: Injector);
75
+ mailboxService: MailBoxService, profileService: ProfileService, socketService: WebsocketService, scriptLoader: ScriptLoaderService, injector: Injector, cdr: ChangeDetectorRef);
51
76
  onImgError(event: Event, fallbackSrc: string): void;
52
77
  onUp(_ev: any, conversationId: any): void;
53
78
  ngOnInit(): void;
@@ -75,6 +100,7 @@ export declare class ChatBoxComponent extends AppBaseComponent implements OnInit
75
100
  fileChangeListener($event: any): void;
76
101
  toggleSidebar(): void;
77
102
  trackByMessageId(_index: any, item: any): any;
103
+ trackConversationKey(conversation: Conversation): string | number;
78
104
  private animateOnScroll;
79
105
  private getMessageType;
80
106
  private getExtension;
@@ -86,3 +112,17 @@ export declare class ChatBoxComponent extends AppBaseComponent implements OnInit
86
112
  static ɵfac: i0.ɵɵFactoryDeclaration<ChatBoxComponent, never>;
87
113
  static ɵcmp: i0.ɵɵComponentDeclaration<ChatBoxComponent, "ng-component", never, {}, {}, never, never, false, never>;
88
114
  }
115
+
116
+ declare class MessageRoutingModule {
117
+ static ɵfac: i0.ɵɵFactoryDeclaration<MessageRoutingModule, never>;
118
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MessageRoutingModule, never, [typeof i1.RouterModule], [typeof i1.RouterModule]>;
119
+ static ɵinj: i0.ɵɵInjectorDeclaration<MessageRoutingModule>;
120
+ }
121
+
122
+ declare class MessagingModule {
123
+ static ɵfac: i0.ɵɵFactoryDeclaration<MessagingModule, never>;
124
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MessagingModule, [typeof ChatBoxComponent], [typeof i2.CommonModule, typeof i3.PipesModule, typeof i4.FormsModule, typeof MessageRoutingModule, typeof i6.ProgressSpinnerModule, typeof i7.AutoCompleteModule, typeof i8.PickerModule, typeof i9.EmojiModule, typeof i10.NgxFileDropModule, typeof i11.InfiniteScrollModule, typeof i12.ScrollingModule], [typeof i1.RouterModule, typeof ChatBoxComponent]>;
125
+ static ɵinj: i0.ɵɵInjectorDeclaration<MessagingModule>;
126
+ }
127
+
128
+ export { ChatBoxComponent, MessagingModule };
package/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './lib/messaging.module';
2
- export * from './lib/chatbox/chatbox.component';
@@ -1,7 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@angular/router";
3
- export declare class MessageRoutingModule {
4
- static ɵfac: i0.ɵɵFactoryDeclaration<MessageRoutingModule, never>;
5
- static ɵmod: i0.ɵɵNgModuleDeclaration<MessageRoutingModule, never, [typeof i1.RouterModule], [typeof i1.RouterModule]>;
6
- static ɵinj: i0.ɵɵInjectorDeclaration<MessageRoutingModule>;
7
- }
@@ -1,19 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./chatbox/chatbox.component";
3
- import * as i2 from "@angular/common";
4
- import * as i3 from "@posiwise/pipes";
5
- import * as i4 from "@angular/forms";
6
- import * as i5 from "./messaging-routing.module";
7
- import * as i6 from "primeng/progressspinner";
8
- import * as i7 from "primeng/autocomplete";
9
- import * as i8 from "@ctrl/ngx-emoji-mart";
10
- import * as i9 from "@ctrl/ngx-emoji-mart/ngx-emoji";
11
- import * as i10 from "ngx-file-drop";
12
- import * as i11 from "ngx-infinite-scroll";
13
- import * as i12 from "@angular/cdk/scrolling";
14
- import * as i13 from "@angular/router";
15
- export declare class MessagingModule {
16
- static ɵfac: i0.ɵɵFactoryDeclaration<MessagingModule, never>;
17
- static ɵmod: i0.ɵɵNgModuleDeclaration<MessagingModule, [typeof i1.ChatBoxComponent], [typeof i2.CommonModule, typeof i3.PipesModule, typeof i4.FormsModule, typeof i5.MessageRoutingModule, typeof i6.ProgressSpinnerModule, typeof i7.AutoCompleteModule, typeof i8.PickerModule, typeof i9.EmojiModule, typeof i10.NgxFileDropModule, typeof i11.InfiniteScrollModule, typeof i12.ScrollingModule], [typeof i13.RouterModule, typeof i1.ChatBoxComponent]>;
18
- static ɵinj: i0.ɵɵInjectorDeclaration<MessagingModule>;
19
- }
@@ -1,57 +0,0 @@
1
- export interface MessageChatUser {
2
- avatar?: {
3
- url: string;
4
- }[];
5
- id?: number;
6
- firstName?: string;
7
- slug?: string;
8
- email?: string;
9
- avatarUrl?: string;
10
- lastActive?: Date;
11
- name?: string;
12
- }
13
- export interface Message {
14
- id: number;
15
- body: string;
16
- createdAt: Date;
17
- formattedDate?: string;
18
- messageType?: string;
19
- created_at: string;
20
- attachment?: {
21
- url: string;
22
- };
23
- conversationId?: number;
24
- }
25
- export interface Conversation {
26
- id: number | null;
27
- unreadCount: number;
28
- latestMessage: Message;
29
- type: string;
30
- participants: MessageChatUser[];
31
- createdAt: Date | null;
32
- from: MessageChatUser;
33
- to: MessageChatUser;
34
- }
35
- export interface Attachment {
36
- name: string;
37
- size: string;
38
- }
39
- export interface Recipient {
40
- id: number;
41
- slug: string;
42
- email: string;
43
- }
44
- export interface ExtendedConversation {
45
- datetime?: string;
46
- id: number;
47
- mailbox_type: number;
48
- latest_message: {
49
- created_at: string;
50
- };
51
- subject: string;
52
- participants: string[];
53
- created_at: string;
54
- unread_count: number;
55
- from?: string;
56
- to?: string;
57
- }