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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Du0PBL6n.js');
3
+ var index = require('./index-D8A4RBzq.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Du0PBL6n.js');
3
+ var index = require('./index-D8A4RBzq.js');
4
4
 
5
5
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
6
  const OcsWidgetAvatar = () => {
@@ -4935,7 +4935,9 @@ class ChatSessionService {
4935
4935
  return response.json();
4936
4936
  }
4937
4937
  async pollTaskOnce(sessionId, taskId) {
4938
- const response = await fetch(`${this.apiBaseUrl}/api/chat/${sessionId}/${taskId}/poll/`);
4938
+ const response = await fetch(`${this.apiBaseUrl}/api/chat/${sessionId}/${taskId}/poll/`, {
4939
+ headers: this.getCommonHeaders(),
4940
+ });
4939
4941
  if (!response.ok) {
4940
4942
  throw new Error(`Failed to poll task: ${response.statusText}`);
4941
4943
  }
@@ -4993,7 +4995,9 @@ class ChatSessionService {
4993
4995
  if (since) {
4994
4996
  url.searchParams.set('since', since);
4995
4997
  }
4996
- const response = await fetch(url.toString());
4998
+ const response = await fetch(url.toString(), {
4999
+ headers: this.getCommonHeaders(),
5000
+ });
4997
5001
  if (!response.ok) {
4998
5002
  throw new Error(`Failed to poll messages: ${response.statusText}`);
4999
5003
  }
@@ -5030,14 +5034,18 @@ class ChatSessionService {
5030
5034
  }
5031
5035
  }
5032
5036
  getJsonHeaders() {
5033
- const headers = {
5034
- 'Content-Type': 'application/json',
5035
- 'x-ocs-widget-version': this.widgetVersion,
5036
- };
5037
+ const headers = this.getCommonHeaders();
5038
+ headers['Content-Type'] = 'application/json';
5037
5039
  const csrfToken = this.csrfTokenProvider(this.apiBaseUrl);
5038
5040
  if (csrfToken) {
5039
5041
  headers['X-CSRFToken'] = csrfToken;
5040
5042
  }
5043
+ return headers;
5044
+ }
5045
+ getCommonHeaders() {
5046
+ const headers = {
5047
+ 'x-ocs-widget-version': this.widgetVersion,
5048
+ };
5041
5049
  if (this.embedKey) {
5042
5050
  headers['X-Embed-Key'] = this.embedKey;
5043
5051
  }
@@ -5402,17 +5410,16 @@ const OcsChat = class {
5402
5410
  this.chatWindowFullscreenWidth = varToPixels(fullscreenWidthVar, window.innerWidth, this.chatWindowFullscreenWidth);
5403
5411
  // Initialize button position from computed styles
5404
5412
  this.initializeButtonPosition();
5405
- if (this.visible) {
5406
- this.initializePosition();
5407
- }
5408
- // Only auto-start session if we don't have an existing one
5409
- if (this.visible && !this.sessionId) {
5410
- this.startSession();
5411
- }
5412
- else if (this.visible && this.sessionId) {
5413
- // Resume polling for existing session
5414
- this.startMessagePolling();
5415
- }
5413
+ // Defer position initialization to avoid state changes during componentDidLoad
5414
+ setTimeout(() => {
5415
+ if (this.visible) {
5416
+ this.initializePosition();
5417
+ }
5418
+ // Resume polling for existing session (don't auto-start new sessions)
5419
+ if (this.visible && this.sessionId) {
5420
+ this.startMessagePolling();
5421
+ }
5422
+ }, 0);
5416
5423
  window.addEventListener('resize', this.handleWindowResize);
5417
5424
  }
5418
5425
  disconnectedCallback() {
@@ -5524,13 +5531,7 @@ const OcsChat = class {
5524
5531
  const data = await this.getChatService().startSession(requestBody);
5525
5532
  this.sessionId = data.session_id;
5526
5533
  this.saveSessionToStorage();
5527
- // Handle seed message if present
5528
- if (data.seed_message_task_id) {
5529
- this.startTaskPolling(data.seed_message_task_id);
5530
- }
5531
- else {
5532
- this.startMessagePolling();
5533
- }
5534
+ this.startMessagePolling();
5534
5535
  }
5535
5536
  catch (_error) {
5536
5537
  this.handleError('Failed to start chat session');
@@ -5559,8 +5560,20 @@ const OcsChat = class {
5559
5560
  }
5560
5561
  }
5561
5562
  async sendMessage(message) {
5562
- if (!this.sessionId || !message.trim())
5563
+ if (!message.trim())
5563
5564
  return;
5565
+ // Start session if we don't have one yet
5566
+ if (!this.sessionId) {
5567
+ // Prevent concurrent session initialization
5568
+ if (this.isLoading) {
5569
+ return;
5570
+ }
5571
+ await this.startSession();
5572
+ // Check if session started successfully
5573
+ if (!this.sessionId) {
5574
+ return; // startSession already handled the error
5575
+ }
5576
+ }
5564
5577
  try {
5565
5578
  let attachmentIds = [];
5566
5579
  if (this.allowAttachments && this.selectedFiles.length > 0) {
@@ -5575,10 +5588,11 @@ const OcsChat = class {
5575
5588
  }
5576
5589
  // If this is the first user message and there are welcome messages,
5577
5590
  // add them to chat history as assistant messages
5578
- if (this.messages.length === 0 && this.parsedWelcomeMessages.length > 0) {
5591
+ const welcomeMessagesToAdd = this.getWelcomeMessages();
5592
+ if (this.messages.length === 0 && welcomeMessagesToAdd.length > 0) {
5579
5593
  const now = new Date();
5580
- const welcomeMessages = this.parsedWelcomeMessages.map((welcomeMsg, index) => ({
5581
- created_at: new Date(now.getTime() - (this.parsedWelcomeMessages.length - index) * 1000).toISOString(),
5594
+ const welcomeMessages = welcomeMessagesToAdd.map((welcomeMsg, index) => ({
5595
+ created_at: new Date(now.getTime() - (welcomeMessagesToAdd.length - index) * 1000).toISOString(),
5582
5596
  role: 'assistant',
5583
5597
  content: welcomeMsg,
5584
5598
  attachments: []
@@ -5712,16 +5726,14 @@ const OcsChat = class {
5712
5726
  }
5713
5727
  if (visible) {
5714
5728
  this.initializePosition();
5715
- }
5716
- if (visible && !this.sessionId) {
5717
- await this.startSession();
5718
- }
5719
- else if (!visible) {
5720
- this.stopMessagePolling();
5729
+ // Resume polling for existing session (don't auto-start new sessions)
5730
+ if (this.sessionId) {
5731
+ this.scrollToBottom(true);
5732
+ this.startMessagePolling();
5733
+ }
5721
5734
  }
5722
5735
  else {
5723
- this.scrollToBottom(true);
5724
- this.startMessagePolling();
5736
+ this.stopMessagePolling();
5725
5737
  }
5726
5738
  }
5727
5739
  startTaskPolling(taskId) {
@@ -6224,9 +6236,13 @@ const OcsChat = class {
6224
6236
  }
6225
6237
  async confirmNewChat() {
6226
6238
  this.hideConfirmationDialog();
6227
- await this.actuallyStartNewChat();
6239
+ await this.clearSession();
6228
6240
  }
6229
- async actuallyStartNewChat() {
6241
+ /**
6242
+ * This clears out all data related to the previous session. A new session
6243
+ * will start when the user sends a message.
6244
+ */
6245
+ async clearSession() {
6230
6246
  this.clearSessionStorage();
6231
6247
  this.sessionId = undefined;
6232
6248
  this.messages = [];
@@ -6236,7 +6252,6 @@ const OcsChat = class {
6236
6252
  this.selectedFiles = [];
6237
6253
  }
6238
6254
  this.cleanup();
6239
- await this.startSession();
6240
6255
  }
6241
6256
  toggleFullscreen() {
6242
6257
  this.isFullscreen = !this.isFullscreen;
@@ -6248,18 +6263,18 @@ const OcsChat = class {
6248
6263
  if (this.error && !this.sessionId) {
6249
6264
  return (index.h(index.Host, null, index.h("p", { class: "error-message" }, this.error)));
6250
6265
  }
6251
- return (index.h(index.Host, null, this.renderButton(), this.visible && (index.h("div", { ref: (el) => this.chatWindowRef = el, id: "ocs-chat-window", class: this.getPositionClasses(), style: this.getPositionStyles() }, index.h("div", { class: `chat-header ${this.isDragging ? 'chat-header-dragging' : 'chat-header-draggable'}`, onMouseDown: this.handleMouseDown, onTouchStart: this.handleTouchStart }, index.h("div", { class: "drag-indicator" }, index.h("div", { class: "drag-dots header-button" }, index.h(GripDotsVerticalIcon, null))), index.h("div", { class: "header-text" }, this.translationManager.get('branding.headerText', this.headerText)), index.h("div", { class: "header-buttons" }, this.messages.length > 0 && (index.h("button", { class: "header-button", onClick: () => this.showConfirmationDialog(), title: this.translationManager.get('window.newChat'), "aria-label": this.translationManager.get('window.newChat') }, index.h(PlusWithCircleIcon, null))), this.allowFullScreen && index.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 ? index.h(ArrowsPointingInIcon, null) : index.h(ArrowsPointingOutIcon, null)), index.h("button", { class: "header-button", onClick: () => this.visible = false, "aria-label": this.translationManager.get('window.close') }, index.h(XMarkIcon, null)))), this.showNewChatConfirmation && (index.h("div", { class: "confirmation-overlay" }, index.h("div", { class: "confirmation-dialog" }, index.h("div", { class: "confirmation-content" }, index.h("h3", { class: "confirmation-title" }, this.translationManager.get('modal.newChatTitle')), index.h("p", { class: "confirmation-message" }, this.translationManager.get('modal.newChatBody', this.newChatConfirmationMessage)), index.h("div", { class: "confirmation-buttons" }, index.h("button", { class: "confirmation-button confirmation-button-cancel", onClick: () => this.hideConfirmationDialog() }, this.translationManager.get('modal.cancel')), index.h("button", { class: "confirmation-button confirmation-button-confirm", onClick: () => this.confirmNewChat() }, this.translationManager.get('modal.confirm'))))))), index.h("div", { class: "chat-content" }, this.isLoading && !this.sessionId && (index.h("div", { class: "loading-container" }, index.h("div", { class: "loading-spinner" }), index.h("span", { class: "loading-text" }, this.translationManager.get('status.starting')))), (index.h("div", { ref: (el) => this.messageListRef = el, class: "messages-container" }, this.messages.length === 0 && this.parsedWelcomeMessages.length > 0 && (index.h("div", { class: "welcome-messages" }, this.getWelcomeMessages().map((message, index$1) => (index.h("div", { key: `welcome-${index$1}`, class: "message-row message-row-assistant" }, index.h("div", { class: "message-bubble message-bubble-assistant" }, index.h("div", { class: "chat-markdown", innerHTML: renderMarkdownSync(message) }))))))), this.messages.map((message, index$1) => (index.h("div", { key: index$1, class: `message-row ${message.role === 'user' ? 'message-row-user' : 'message-row-assistant'}` }, index.h("div", { class: `message-bubble ${message.role === 'user'
6266
+ return (index.h(index.Host, null, this.renderButton(), this.visible && (index.h("div", { ref: (el) => this.chatWindowRef = el, id: "ocs-chat-window", class: this.getPositionClasses(), style: this.getPositionStyles() }, index.h("div", { class: `chat-header ${this.isDragging ? 'chat-header-dragging' : 'chat-header-draggable'}`, onMouseDown: this.handleMouseDown, onTouchStart: this.handleTouchStart }, index.h("div", { class: "drag-indicator" }, index.h("div", { class: "drag-dots header-button" }, index.h(GripDotsVerticalIcon, null))), index.h("div", { class: "header-text" }, this.translationManager.get('branding.headerText', this.headerText)), index.h("div", { class: "header-buttons" }, this.messages.length > 0 && (index.h("button", { class: "header-button", onClick: () => this.showConfirmationDialog(), title: this.translationManager.get('window.newChat'), "aria-label": this.translationManager.get('window.newChat') }, index.h(PlusWithCircleIcon, null))), this.allowFullScreen && index.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 ? index.h(ArrowsPointingInIcon, null) : index.h(ArrowsPointingOutIcon, null)), index.h("button", { class: "header-button", onClick: () => this.visible = false, "aria-label": this.translationManager.get('window.close') }, index.h(XMarkIcon, null)))), this.showNewChatConfirmation && (index.h("div", { class: "confirmation-overlay" }, index.h("div", { class: "confirmation-dialog" }, index.h("div", { class: "confirmation-content" }, index.h("h3", { class: "confirmation-title" }, this.translationManager.get('modal.newChatTitle')), index.h("p", { class: "confirmation-message" }, this.translationManager.get('modal.newChatBody', this.newChatConfirmationMessage)), index.h("div", { class: "confirmation-buttons" }, index.h("button", { class: "confirmation-button confirmation-button-cancel", onClick: () => this.hideConfirmationDialog() }, this.translationManager.get('modal.cancel')), index.h("button", { class: "confirmation-button confirmation-button-confirm", onClick: () => this.confirmNewChat() }, this.translationManager.get('modal.confirm'))))))), index.h("div", { class: "chat-content" }, this.isLoading && !this.sessionId && (index.h("div", { class: "loading-container" }, index.h("div", { class: "loading-spinner" }), index.h("span", { class: "loading-text" }, this.translationManager.get('status.starting')))), (index.h("div", { ref: (el) => this.messageListRef = el, class: "messages-container" }, this.messages.length === 0 && this.getWelcomeMessages().length > 0 && (index.h("div", { class: "welcome-messages" }, this.getWelcomeMessages().map((message, index$1) => (index.h("div", { key: `welcome-${index$1}`, class: "message-row message-row-assistant" }, index.h("div", { class: "message-bubble message-bubble-assistant" }, index.h("div", { class: "chat-markdown", innerHTML: renderMarkdownSync(message) }))))))), this.messages.map((message, index$1) => (index.h("div", { key: index$1, class: `message-row ${message.role === 'user' ? 'message-row-user' : 'message-row-assistant'}` }, index.h("div", { class: `message-bubble ${message.role === 'user'
6252
6267
  ? 'message-bubble-user'
6253
6268
  : message.role === 'assistant'
6254
6269
  ? 'message-bubble-assistant'
6255
- : 'message-bubble-system'}` }, index.h("div", { class: "chat-markdown", innerHTML: renderMarkdownSync(message.content) }), message.attachments && message.attachments.length > 0 && (index.h("div", { class: "message-attachments" }, message.attachments.map((attachment, attachmentIndex) => (index.h("div", { key: attachmentIndex, class: "flex items-center gap-[0.5em]" }, index.h("span", { class: "message-attachment-icon" }, index.h(PaperClipIcon, null)), index.h("span", { class: "message-attachment-name" }, attachment.name)))))), index.h("div", { class: "message-timestamp" }, this.formatTime(message.created_at)))))), this.isTyping && (index.h("div", null, index.h("div", { class: "typing-indicator" }, index.h("div", { class: "typing-progress" })), index.h("div", { class: "typing-text" }, index.h("span", null, this.translationManager.get('status.typing', this.typingIndicatorText)), index.h("span", { class: "typing-dots loading" })))))), this.messages.length === 0 && this.parsedStarterQuestions.length > 0 && (index.h("div", { class: "starter-questions" }, this.getStarterQuestions().map((question, index$1) => (index.h("div", { key: `starter-${index$1}`, class: "starter-question-row" }, index.h("button", { class: "starter-question", onClick: () => this.handleStarterQuestionClick(question) }, question)))))), this.allowAttachments && this.selectedFiles.length > 0 && (index.h("div", { class: "selected-files-container" }, index.h("div", { class: "space-y-[0.25em]" }, this.selectedFiles.map((selectedFile, index$1) => (index.h("div", { key: index$1, class: "selected-file-item" }, index.h("div", { class: "flex items-center gap-[0.5em]" }, index.h("span", { class: "selected-file-icon" }, index.h(PaperClipIcon, null)), index.h("span", null, selectedFile.file.name), index.h("span", { class: "selected-file-size" }, "(", this.formatFileSize(selectedFile.file.size), ")"), selectedFile.error && (index.h("span", { class: "selected-file-error" }, selectedFile.error)), selectedFile.uploaded && (index.h("span", { class: "selected-file-success-icon" }, index.h(CheckDocumentIcon, null)))), index.h("button", { onClick: () => this.removeSelectedFile(index$1), class: "selected-file-remove-button", "aria-label": this.translationManager.get('attach.remove') }, index.h(XIcon, null)))))))), this.sessionId && (index.h("div", { class: "input-area" }, index.h("div", { class: "input-container" }, index.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 && (index.h("input", { ref: (el) => {
6270
+ : 'message-bubble-system'}` }, index.h("div", { class: "chat-markdown", innerHTML: renderMarkdownSync(message.content) }), message.attachments && message.attachments.length > 0 && (index.h("div", { class: "message-attachments" }, message.attachments.map((attachment, attachmentIndex) => (index.h("div", { key: attachmentIndex, class: "flex items-center gap-[0.5em]" }, index.h("span", { class: "message-attachment-icon" }, index.h(PaperClipIcon, null)), index.h("span", { class: "message-attachment-name" }, attachment.name)))))), index.h("div", { class: "message-timestamp" }, this.formatTime(message.created_at)))))), this.isTyping && (index.h("div", null, index.h("div", { class: "typing-indicator" }, index.h("div", { class: "typing-progress" })), index.h("div", { class: "typing-text" }, index.h("span", null, this.translationManager.get('status.typing', this.typingIndicatorText)), index.h("span", { class: "typing-dots loading" })))))), this.messages.length === 0 && this.getStarterQuestions().length > 0 && (index.h("div", { class: "starter-questions" }, this.getStarterQuestions().map((question, index$1) => (index.h("div", { key: `starter-${index$1}`, class: "starter-question-row" }, index.h("button", { class: "starter-question", onClick: () => this.handleStarterQuestionClick(question) }, question)))))), this.allowAttachments && this.selectedFiles.length > 0 && (index.h("div", { class: "selected-files-container" }, index.h("div", { class: "space-y-[0.25em]" }, this.selectedFiles.map((selectedFile, index$1) => (index.h("div", { key: index$1, class: "selected-file-item" }, index.h("div", { class: "flex items-center gap-[0.5em]" }, index.h("span", { class: "selected-file-icon" }, index.h(PaperClipIcon, null)), index.h("span", null, selectedFile.file.name), index.h("span", { class: "selected-file-size" }, "(", this.formatFileSize(selectedFile.file.size), ")"), selectedFile.error && (index.h("span", { class: "selected-file-error" }, selectedFile.error)), selectedFile.uploaded && (index.h("span", { class: "selected-file-success-icon" }, index.h(CheckDocumentIcon, null)))), index.h("button", { onClick: () => this.removeSelectedFile(index$1), class: "selected-file-remove-button", "aria-label": this.translationManager.get('attach.remove') }, index.h(XIcon, null)))))))), index.h("div", { class: "input-area" }, index.h("div", { class: "input-container" }, index.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 && (index.h("input", { ref: (el) => {
6256
6271
  // Unclear why but after removing all attachments this is being set to `null`.
6257
6272
  if (el) {
6258
6273
  this.fileInputRef = el;
6259
6274
  }
6260
- }, id: "ocs-file-input", type: "file", multiple: true, accept: OcsChat.SUPPORTED_FILE_EXTENSIONS.join(','), onChange: (e) => this.handleFileSelect(e), class: "hidden" })), this.allowAttachments && (index.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') }, index.h(PaperClipIcon, null))), index.h("button", { class: `send-button ${!this.isTyping && !!this.messageInput.trim()
6275
+ }, id: "ocs-file-input", type: "file", multiple: true, accept: OcsChat.SUPPORTED_FILE_EXTENSIONS.join(','), onChange: (e) => this.handleFileSelect(e), class: "hidden" })), this.allowAttachments && (index.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') }, index.h(PaperClipIcon, null))), index.h("button", { class: `send-button ${!this.isTyping && !this.isLoading && !!this.messageInput.trim()
6261
6276
  ? 'send-button-enabled'
6262
- : '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'))))), index.h("div", { class: "flex items-center justify-center text-[0.8em] font-light w-full text-slate-500 py-[2px]" }, index.h("p", null, this.translationManager.get('branding.poweredBy'), ' ', " ", index.h("a", { class: "underline", href: "https://www.dimagi.com", target: "_blank" }, "Dimagi"))))))));
6277
+ : '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')))), index.h("div", { class: "flex items-center justify-center text-[0.8em] font-light w-full text-slate-500 py-[2px]" }, index.h("p", null, this.translationManager.get('branding.poweredBy'), ' ', " ", index.h("a", { class: "underline", href: "https://www.dimagi.com", target: "_blank" }, "Dimagi"))))))));
6263
6278
  }
6264
6279
  get host() { return index.getElement(this); }
6265
6280
  static get watchers() { return {