open-chat-studio-widget 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/cjs/{index-Du0PBL6n.js → index-D8A4RBzq.js} +3 -3
  2. package/dist/cjs/{index-Du0PBL6n.js.map → index-D8A4RBzq.js.map} +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/open-chat-studio-widget.cjs.entry.js +59 -44
  5. package/dist/cjs/open-chat-studio-widget.cjs.entry.js.map +1 -1
  6. package/dist/cjs/open-chat-studio-widget.cjs.js +1 -1
  7. package/dist/cjs/open-chat-studio-widget.entry.cjs.js.map +1 -1
  8. package/dist/collection/components/ocs-chat/ocs-chat.js +44 -37
  9. package/dist/collection/components/ocs-chat/ocs-chat.js.map +1 -1
  10. package/dist/collection/services/chat-session-service.js +14 -6
  11. package/dist/collection/services/chat-session-service.js.map +1 -1
  12. package/dist/components/open-chat-studio-widget.js +58 -43
  13. package/dist/components/open-chat-studio-widget.js.map +1 -1
  14. package/dist/esm/{index-CX3v6rTy.js → index-C53whb-B.js} +3 -3
  15. package/dist/esm/{index-CX3v6rTy.js.map → index-C53whb-B.js.map} +1 -1
  16. package/dist/esm/loader.js +2 -2
  17. package/dist/esm/open-chat-studio-widget.entry.js +59 -44
  18. package/dist/esm/open-chat-studio-widget.entry.js.map +1 -1
  19. package/dist/esm/open-chat-studio-widget.js +2 -2
  20. package/dist/open-chat-studio-widget/open-chat-studio-widget.entry.esm.js.map +1 -1
  21. package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js +1 -1
  22. package/dist/open-chat-studio-widget/{p-CX3v6rTy.js → p-C53whb-B.js} +2 -2
  23. package/dist/open-chat-studio-widget/{p-CX3v6rTy.js.map → p-C53whb-B.js.map} +1 -1
  24. package/dist/open-chat-studio-widget/{p-90719a8b.entry.js → p-b9556259.entry.js} +3 -3
  25. package/dist/open-chat-studio-widget/p-b9556259.entry.js.map +1 -0
  26. package/dist/types/components/ocs-chat/ocs-chat.d.ts +5 -1
  27. package/dist/types/services/chat-session-service.d.ts +1 -1
  28. package/package.json +2 -2
  29. package/dist/open-chat-studio-widget/p-90719a8b.entry.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-CX3v6rTy.js';
2
- export { s as setNonce } from './index-CX3v6rTy.js';
1
+ import { b as bootstrapLazy } from './index-C53whb-B.js';
2
+ export { s as setNonce } from './index-C53whb-B.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -1,4 +1,4 @@
1
- import { h, r as registerInstance, E as Env, H as Host, g as getElement } from './index-CX3v6rTy.js';
1
+ import { h, r as registerInstance, E as Env, H as Host, g as getElement } from './index-C53whb-B.js';
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
4
4
  const OcsWidgetAvatar = () => {
@@ -4933,7 +4933,9 @@ class ChatSessionService {
4933
4933
  return response.json();
4934
4934
  }
4935
4935
  async pollTaskOnce(sessionId, taskId) {
4936
- const response = await fetch(`${this.apiBaseUrl}/api/chat/${sessionId}/${taskId}/poll/`);
4936
+ const response = await fetch(`${this.apiBaseUrl}/api/chat/${sessionId}/${taskId}/poll/`, {
4937
+ headers: this.getCommonHeaders(),
4938
+ });
4937
4939
  if (!response.ok) {
4938
4940
  throw new Error(`Failed to poll task: ${response.statusText}`);
4939
4941
  }
@@ -4991,7 +4993,9 @@ class ChatSessionService {
4991
4993
  if (since) {
4992
4994
  url.searchParams.set('since', since);
4993
4995
  }
4994
- const response = await fetch(url.toString());
4996
+ const response = await fetch(url.toString(), {
4997
+ headers: this.getCommonHeaders(),
4998
+ });
4995
4999
  if (!response.ok) {
4996
5000
  throw new Error(`Failed to poll messages: ${response.statusText}`);
4997
5001
  }
@@ -5028,14 +5032,18 @@ class ChatSessionService {
5028
5032
  }
5029
5033
  }
5030
5034
  getJsonHeaders() {
5031
- const headers = {
5032
- 'Content-Type': 'application/json',
5033
- 'x-ocs-widget-version': this.widgetVersion,
5034
- };
5035
+ const headers = this.getCommonHeaders();
5036
+ headers['Content-Type'] = 'application/json';
5035
5037
  const csrfToken = this.csrfTokenProvider(this.apiBaseUrl);
5036
5038
  if (csrfToken) {
5037
5039
  headers['X-CSRFToken'] = csrfToken;
5038
5040
  }
5041
+ return headers;
5042
+ }
5043
+ getCommonHeaders() {
5044
+ const headers = {
5045
+ 'x-ocs-widget-version': this.widgetVersion,
5046
+ };
5039
5047
  if (this.embedKey) {
5040
5048
  headers['X-Embed-Key'] = this.embedKey;
5041
5049
  }
@@ -5400,17 +5408,16 @@ const OcsChat = class {
5400
5408
  this.chatWindowFullscreenWidth = varToPixels(fullscreenWidthVar, window.innerWidth, this.chatWindowFullscreenWidth);
5401
5409
  // Initialize button position from computed styles
5402
5410
  this.initializeButtonPosition();
5403
- if (this.visible) {
5404
- this.initializePosition();
5405
- }
5406
- // Only auto-start session if we don't have an existing one
5407
- if (this.visible && !this.sessionId) {
5408
- this.startSession();
5409
- }
5410
- else if (this.visible && this.sessionId) {
5411
- // Resume polling for existing session
5412
- this.startMessagePolling();
5413
- }
5411
+ // Defer position initialization to avoid state changes during componentDidLoad
5412
+ setTimeout(() => {
5413
+ if (this.visible) {
5414
+ this.initializePosition();
5415
+ }
5416
+ // Resume polling for existing session (don't auto-start new sessions)
5417
+ if (this.visible && this.sessionId) {
5418
+ this.startMessagePolling();
5419
+ }
5420
+ }, 0);
5414
5421
  window.addEventListener('resize', this.handleWindowResize);
5415
5422
  }
5416
5423
  disconnectedCallback() {
@@ -5522,13 +5529,7 @@ const OcsChat = class {
5522
5529
  const data = await this.getChatService().startSession(requestBody);
5523
5530
  this.sessionId = data.session_id;
5524
5531
  this.saveSessionToStorage();
5525
- // Handle seed message if present
5526
- if (data.seed_message_task_id) {
5527
- this.startTaskPolling(data.seed_message_task_id);
5528
- }
5529
- else {
5530
- this.startMessagePolling();
5531
- }
5532
+ this.startMessagePolling();
5532
5533
  }
5533
5534
  catch (_error) {
5534
5535
  this.handleError('Failed to start chat session');
@@ -5557,8 +5558,20 @@ const OcsChat = class {
5557
5558
  }
5558
5559
  }
5559
5560
  async sendMessage(message) {
5560
- if (!this.sessionId || !message.trim())
5561
+ if (!message.trim())
5561
5562
  return;
5563
+ // Start session if we don't have one yet
5564
+ if (!this.sessionId) {
5565
+ // Prevent concurrent session initialization
5566
+ if (this.isLoading) {
5567
+ return;
5568
+ }
5569
+ await this.startSession();
5570
+ // Check if session started successfully
5571
+ if (!this.sessionId) {
5572
+ return; // startSession already handled the error
5573
+ }
5574
+ }
5562
5575
  try {
5563
5576
  let attachmentIds = [];
5564
5577
  if (this.allowAttachments && this.selectedFiles.length > 0) {
@@ -5573,10 +5586,11 @@ const OcsChat = class {
5573
5586
  }
5574
5587
  // If this is the first user message and there are welcome messages,
5575
5588
  // add them to chat history as assistant messages
5576
- if (this.messages.length === 0 && this.parsedWelcomeMessages.length > 0) {
5589
+ const welcomeMessagesToAdd = this.getWelcomeMessages();
5590
+ if (this.messages.length === 0 && welcomeMessagesToAdd.length > 0) {
5577
5591
  const now = new Date();
5578
- const welcomeMessages = this.parsedWelcomeMessages.map((welcomeMsg, index) => ({
5579
- created_at: new Date(now.getTime() - (this.parsedWelcomeMessages.length - index) * 1000).toISOString(),
5592
+ const welcomeMessages = welcomeMessagesToAdd.map((welcomeMsg, index) => ({
5593
+ created_at: new Date(now.getTime() - (welcomeMessagesToAdd.length - index) * 1000).toISOString(),
5580
5594
  role: 'assistant',
5581
5595
  content: welcomeMsg,
5582
5596
  attachments: []
@@ -5710,16 +5724,14 @@ const OcsChat = class {
5710
5724
  }
5711
5725
  if (visible) {
5712
5726
  this.initializePosition();
5713
- }
5714
- if (visible && !this.sessionId) {
5715
- await this.startSession();
5716
- }
5717
- else if (!visible) {
5718
- this.stopMessagePolling();
5727
+ // Resume polling for existing session (don't auto-start new sessions)
5728
+ if (this.sessionId) {
5729
+ this.scrollToBottom(true);
5730
+ this.startMessagePolling();
5731
+ }
5719
5732
  }
5720
5733
  else {
5721
- this.scrollToBottom(true);
5722
- this.startMessagePolling();
5734
+ this.stopMessagePolling();
5723
5735
  }
5724
5736
  }
5725
5737
  startTaskPolling(taskId) {
@@ -6222,9 +6234,13 @@ const OcsChat = class {
6222
6234
  }
6223
6235
  async confirmNewChat() {
6224
6236
  this.hideConfirmationDialog();
6225
- await this.actuallyStartNewChat();
6237
+ await this.clearSession();
6226
6238
  }
6227
- async actuallyStartNewChat() {
6239
+ /**
6240
+ * This clears out all data related to the previous session. A new session
6241
+ * will start when the user sends a message.
6242
+ */
6243
+ async clearSession() {
6228
6244
  this.clearSessionStorage();
6229
6245
  this.sessionId = undefined;
6230
6246
  this.messages = [];
@@ -6234,7 +6250,6 @@ const OcsChat = class {
6234
6250
  this.selectedFiles = [];
6235
6251
  }
6236
6252
  this.cleanup();
6237
- await this.startSession();
6238
6253
  }
6239
6254
  toggleFullscreen() {
6240
6255
  this.isFullscreen = !this.isFullscreen;
@@ -6246,18 +6261,18 @@ const OcsChat = class {
6246
6261
  if (this.error && !this.sessionId) {
6247
6262
  return (h(Host, null, h("p", { class: "error-message" }, this.error)));
6248
6263
  }
6249
- return (h(Host, null, this.renderButton(), this.visible && (h("div", { ref: (el) => this.chatWindowRef = el, id: "ocs-chat-window", class: this.getPositionClasses(), style: this.getPositionStyles() }, h("div", { class: `chat-header ${this.isDragging ? 'chat-header-dragging' : 'chat-header-draggable'}`, onMouseDown: this.handleMouseDown, onTouchStart: this.handleTouchStart }, h("div", { class: "drag-indicator" }, h("div", { class: "drag-dots header-button" }, h(GripDotsVerticalIcon, null))), h("div", { class: "header-text" }, this.translationManager.get('branding.headerText', this.headerText)), h("div", { class: "header-buttons" }, this.messages.length > 0 && (h("button", { class: "header-button", onClick: () => this.showConfirmationDialog(), title: this.translationManager.get('window.newChat'), "aria-label": this.translationManager.get('window.newChat') }, h(PlusWithCircleIcon, null))), this.allowFullScreen && h("button", { class: "header-button fullscreen-button", onClick: () => this.toggleFullscreen(), title: this.isFullscreen ? this.translationManager.get('window.exitFullscreen') : this.translationManager.get('window.fullscreen'), "aria-label": this.isFullscreen ? this.translationManager.get('window.exitFullscreen') : this.translationManager.get('window.fullscreen') }, this.isFullscreen ? h(ArrowsPointingInIcon, null) : h(ArrowsPointingOutIcon, null)), h("button", { class: "header-button", onClick: () => this.visible = false, "aria-label": this.translationManager.get('window.close') }, h(XMarkIcon, null)))), this.showNewChatConfirmation && (h("div", { class: "confirmation-overlay" }, h("div", { class: "confirmation-dialog" }, h("div", { class: "confirmation-content" }, h("h3", { class: "confirmation-title" }, this.translationManager.get('modal.newChatTitle')), h("p", { class: "confirmation-message" }, this.translationManager.get('modal.newChatBody', this.newChatConfirmationMessage)), h("div", { class: "confirmation-buttons" }, h("button", { class: "confirmation-button confirmation-button-cancel", onClick: () => this.hideConfirmationDialog() }, this.translationManager.get('modal.cancel')), h("button", { class: "confirmation-button confirmation-button-confirm", onClick: () => this.confirmNewChat() }, this.translationManager.get('modal.confirm'))))))), h("div", { class: "chat-content" }, this.isLoading && !this.sessionId && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("span", { class: "loading-text" }, this.translationManager.get('status.starting')))), (h("div", { ref: (el) => this.messageListRef = el, class: "messages-container" }, this.messages.length === 0 && this.parsedWelcomeMessages.length > 0 && (h("div", { class: "welcome-messages" }, this.getWelcomeMessages().map((message, index) => (h("div", { key: `welcome-${index}`, class: "message-row message-row-assistant" }, h("div", { class: "message-bubble message-bubble-assistant" }, h("div", { class: "chat-markdown", innerHTML: renderMarkdownSync(message) }))))))), this.messages.map((message, index) => (h("div", { key: index, class: `message-row ${message.role === 'user' ? 'message-row-user' : 'message-row-assistant'}` }, h("div", { class: `message-bubble ${message.role === 'user'
6264
+ return (h(Host, null, this.renderButton(), this.visible && (h("div", { ref: (el) => this.chatWindowRef = el, id: "ocs-chat-window", class: this.getPositionClasses(), style: this.getPositionStyles() }, h("div", { class: `chat-header ${this.isDragging ? 'chat-header-dragging' : 'chat-header-draggable'}`, onMouseDown: this.handleMouseDown, onTouchStart: this.handleTouchStart }, h("div", { class: "drag-indicator" }, h("div", { class: "drag-dots header-button" }, h(GripDotsVerticalIcon, null))), h("div", { class: "header-text" }, this.translationManager.get('branding.headerText', this.headerText)), h("div", { class: "header-buttons" }, this.messages.length > 0 && (h("button", { class: "header-button", onClick: () => this.showConfirmationDialog(), title: this.translationManager.get('window.newChat'), "aria-label": this.translationManager.get('window.newChat') }, h(PlusWithCircleIcon, null))), this.allowFullScreen && h("button", { class: "header-button fullscreen-button", onClick: () => this.toggleFullscreen(), title: this.isFullscreen ? this.translationManager.get('window.exitFullscreen') : this.translationManager.get('window.fullscreen'), "aria-label": this.isFullscreen ? this.translationManager.get('window.exitFullscreen') : this.translationManager.get('window.fullscreen') }, this.isFullscreen ? h(ArrowsPointingInIcon, null) : h(ArrowsPointingOutIcon, null)), h("button", { class: "header-button", onClick: () => this.visible = false, "aria-label": this.translationManager.get('window.close') }, h(XMarkIcon, null)))), this.showNewChatConfirmation && (h("div", { class: "confirmation-overlay" }, h("div", { class: "confirmation-dialog" }, h("div", { class: "confirmation-content" }, h("h3", { class: "confirmation-title" }, this.translationManager.get('modal.newChatTitle')), h("p", { class: "confirmation-message" }, this.translationManager.get('modal.newChatBody', this.newChatConfirmationMessage)), h("div", { class: "confirmation-buttons" }, h("button", { class: "confirmation-button confirmation-button-cancel", onClick: () => this.hideConfirmationDialog() }, this.translationManager.get('modal.cancel')), h("button", { class: "confirmation-button confirmation-button-confirm", onClick: () => this.confirmNewChat() }, this.translationManager.get('modal.confirm'))))))), h("div", { class: "chat-content" }, this.isLoading && !this.sessionId && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("span", { class: "loading-text" }, this.translationManager.get('status.starting')))), (h("div", { ref: (el) => this.messageListRef = el, class: "messages-container" }, this.messages.length === 0 && this.getWelcomeMessages().length > 0 && (h("div", { class: "welcome-messages" }, this.getWelcomeMessages().map((message, index) => (h("div", { key: `welcome-${index}`, class: "message-row message-row-assistant" }, h("div", { class: "message-bubble message-bubble-assistant" }, h("div", { class: "chat-markdown", innerHTML: renderMarkdownSync(message) }))))))), this.messages.map((message, index) => (h("div", { key: index, class: `message-row ${message.role === 'user' ? 'message-row-user' : 'message-row-assistant'}` }, h("div", { class: `message-bubble ${message.role === 'user'
6250
6265
  ? 'message-bubble-user'
6251
6266
  : message.role === 'assistant'
6252
6267
  ? 'message-bubble-assistant'
6253
- : 'message-bubble-system'}` }, h("div", { class: "chat-markdown", innerHTML: renderMarkdownSync(message.content) }), message.attachments && message.attachments.length > 0 && (h("div", { class: "message-attachments" }, message.attachments.map((attachment, attachmentIndex) => (h("div", { key: attachmentIndex, class: "flex items-center gap-[0.5em]" }, h("span", { class: "message-attachment-icon" }, h(PaperClipIcon, null)), h("span", { class: "message-attachment-name" }, attachment.name)))))), h("div", { class: "message-timestamp" }, this.formatTime(message.created_at)))))), this.isTyping && (h("div", null, h("div", { class: "typing-indicator" }, h("div", { class: "typing-progress" })), h("div", { class: "typing-text" }, h("span", null, this.translationManager.get('status.typing', this.typingIndicatorText)), h("span", { class: "typing-dots loading" })))))), this.messages.length === 0 && this.parsedStarterQuestions.length > 0 && (h("div", { class: "starter-questions" }, this.getStarterQuestions().map((question, index) => (h("div", { key: `starter-${index}`, class: "starter-question-row" }, h("button", { class: "starter-question", onClick: () => this.handleStarterQuestionClick(question) }, question)))))), this.allowAttachments && this.selectedFiles.length > 0 && (h("div", { class: "selected-files-container" }, h("div", { class: "space-y-[0.25em]" }, this.selectedFiles.map((selectedFile, index) => (h("div", { key: index, class: "selected-file-item" }, h("div", { class: "flex items-center gap-[0.5em]" }, h("span", { class: "selected-file-icon" }, h(PaperClipIcon, null)), h("span", null, selectedFile.file.name), h("span", { class: "selected-file-size" }, "(", this.formatFileSize(selectedFile.file.size), ")"), selectedFile.error && (h("span", { class: "selected-file-error" }, selectedFile.error)), selectedFile.uploaded && (h("span", { class: "selected-file-success-icon" }, h(CheckDocumentIcon, null)))), h("button", { onClick: () => this.removeSelectedFile(index), class: "selected-file-remove-button", "aria-label": this.translationManager.get('attach.remove') }, h(XIcon, null)))))))), this.sessionId && (h("div", { class: "input-area" }, h("div", { class: "input-container" }, h("textarea", { ref: (el) => this.textareaRef = el, class: "message-textarea", rows: 1, placeholder: this.translationManager.get('composer.placeholder'), value: this.messageInput, onInput: (e) => this.handleInputChange(e), onKeyPress: (e) => this.handleKeyPress(e), disabled: this.isTyping || this.isUploadingFiles }), this.allowAttachments && (h("input", { ref: (el) => {
6268
+ : 'message-bubble-system'}` }, h("div", { class: "chat-markdown", innerHTML: renderMarkdownSync(message.content) }), message.attachments && message.attachments.length > 0 && (h("div", { class: "message-attachments" }, message.attachments.map((attachment, attachmentIndex) => (h("div", { key: attachmentIndex, class: "flex items-center gap-[0.5em]" }, h("span", { class: "message-attachment-icon" }, h(PaperClipIcon, null)), h("span", { class: "message-attachment-name" }, attachment.name)))))), h("div", { class: "message-timestamp" }, this.formatTime(message.created_at)))))), this.isTyping && (h("div", null, h("div", { class: "typing-indicator" }, h("div", { class: "typing-progress" })), h("div", { class: "typing-text" }, h("span", null, this.translationManager.get('status.typing', this.typingIndicatorText)), h("span", { class: "typing-dots loading" })))))), this.messages.length === 0 && this.getStarterQuestions().length > 0 && (h("div", { class: "starter-questions" }, this.getStarterQuestions().map((question, index) => (h("div", { key: `starter-${index}`, class: "starter-question-row" }, h("button", { class: "starter-question", onClick: () => this.handleStarterQuestionClick(question) }, question)))))), this.allowAttachments && this.selectedFiles.length > 0 && (h("div", { class: "selected-files-container" }, h("div", { class: "space-y-[0.25em]" }, this.selectedFiles.map((selectedFile, index) => (h("div", { key: index, class: "selected-file-item" }, h("div", { class: "flex items-center gap-[0.5em]" }, h("span", { class: "selected-file-icon" }, h(PaperClipIcon, null)), h("span", null, selectedFile.file.name), h("span", { class: "selected-file-size" }, "(", this.formatFileSize(selectedFile.file.size), ")"), selectedFile.error && (h("span", { class: "selected-file-error" }, selectedFile.error)), selectedFile.uploaded && (h("span", { class: "selected-file-success-icon" }, h(CheckDocumentIcon, null)))), h("button", { onClick: () => this.removeSelectedFile(index), class: "selected-file-remove-button", "aria-label": this.translationManager.get('attach.remove') }, h(XIcon, null)))))))), h("div", { class: "input-area" }, h("div", { class: "input-container" }, h("textarea", { ref: (el) => this.textareaRef = el, class: "message-textarea", rows: 1, placeholder: this.translationManager.get('composer.placeholder'), value: this.messageInput, onInput: (e) => this.handleInputChange(e), onKeyPress: (e) => this.handleKeyPress(e), disabled: this.isTyping || this.isUploadingFiles || this.isLoading }), this.allowAttachments && (h("input", { ref: (el) => {
6254
6269
  // Unclear why but after removing all attachments this is being set to `null`.
6255
6270
  if (el) {
6256
6271
  this.fileInputRef = el;
6257
6272
  }
6258
- }, id: "ocs-file-input", type: "file", multiple: true, accept: OcsChat.SUPPORTED_FILE_EXTENSIONS.join(','), onChange: (e) => this.handleFileSelect(e), class: "hidden" })), this.allowAttachments && (h("button", { class: "file-attachment-button", onClick: () => { var _a; return (_a = this.fileInputRef) === null || _a === void 0 ? void 0 : _a.click(); }, disabled: this.isTyping || this.isUploadingFiles, title: this.translationManager.get('attach.add'), "aria-label": this.translationManager.get('attach.add') }, h(PaperClipIcon, null))), h("button", { class: `send-button ${!this.isTyping && !!this.messageInput.trim()
6273
+ }, id: "ocs-file-input", type: "file", multiple: true, accept: OcsChat.SUPPORTED_FILE_EXTENSIONS.join(','), onChange: (e) => this.handleFileSelect(e), class: "hidden" })), this.allowAttachments && (h("button", { class: "file-attachment-button", onClick: () => { var _a; return (_a = this.fileInputRef) === null || _a === void 0 ? void 0 : _a.click(); }, disabled: this.isTyping || this.isUploadingFiles || this.isLoading, title: this.translationManager.get('attach.add'), "aria-label": this.translationManager.get('attach.add') }, h(PaperClipIcon, null))), h("button", { class: `send-button ${!this.isTyping && !this.isLoading && !!this.messageInput.trim()
6259
6274
  ? 'send-button-enabled'
6260
- : 'send-button-disabled'}`, onClick: () => this.sendMessage(this.messageInput), disabled: this.isTyping || this.isUploadingFiles || !this.messageInput.trim() }, this.isUploadingFiles ? `${this.translationManager.get('status.uploading')}...` : this.translationManager.get('composer.send'))))), h("div", { class: "flex items-center justify-center text-[0.8em] font-light w-full text-slate-500 py-[2px]" }, h("p", null, this.translationManager.get('branding.poweredBy'), ' ', " ", h("a", { class: "underline", href: "https://www.dimagi.com", target: "_blank" }, "Dimagi"))))))));
6275
+ : 'send-button-disabled'}`, onClick: () => this.sendMessage(this.messageInput), disabled: this.isTyping || this.isUploadingFiles || this.isLoading || !this.messageInput.trim() }, this.isUploadingFiles ? `${this.translationManager.get('status.uploading')}...` : this.translationManager.get('composer.send')))), h("div", { class: "flex items-center justify-center text-[0.8em] font-light w-full text-slate-500 py-[2px]" }, h("p", null, this.translationManager.get('branding.poweredBy'), ' ', " ", h("a", { class: "underline", href: "https://www.dimagi.com", target: "_blank" }, "Dimagi"))))))));
6261
6276
  }
6262
6277
  get host() { return getElement(this); }
6263
6278
  static get watchers() { return {