@acorex/components 21.0.3-next.40 → 21.0.3-next.42

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 (108) hide show
  1. package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs → acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs} +2 -3
  2. package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs.map → acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs.map} +1 -1
  3. package/fesm2022/acorex-components-conversation.mjs +22456 -1
  4. package/fesm2022/acorex-components-conversation.mjs.map +1 -1
  5. package/fesm2022/acorex-components-kbd.mjs +2 -2
  6. package/fesm2022/acorex-components-kbd.mjs.map +1 -1
  7. package/package.json +3 -3
  8. package/types/acorex-components-conversation.d.ts +1228 -48
  9. package/fesm2022/acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs +0 -13711
  10. package/fesm2022/acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs.map +0 -1
  11. package/fesm2022/acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs +0 -119
  12. package/fesm2022/acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs.map +0 -1
  13. package/fesm2022/acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs +0 -59
  14. package/fesm2022/acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs.map +0 -1
  15. package/fesm2022/acorex-components-conversation-audio-picker.component-BD_fN2Ip.mjs +0 -432
  16. package/fesm2022/acorex-components-conversation-audio-picker.component-BD_fN2Ip.mjs.map +0 -1
  17. package/fesm2022/acorex-components-conversation-audio-renderer.component-CcxVVprx.mjs +0 -177
  18. package/fesm2022/acorex-components-conversation-audio-renderer.component-CcxVVprx.mjs.map +0 -1
  19. package/fesm2022/acorex-components-conversation-audio.payload-Bag4aTut.mjs +0 -54
  20. package/fesm2022/acorex-components-conversation-audio.payload-Bag4aTut.mjs.map +0 -1
  21. package/fesm2022/acorex-components-conversation-conversation-audio.file-type-CfGSVnMA.mjs +0 -100
  22. package/fesm2022/acorex-components-conversation-conversation-audio.file-type-CfGSVnMA.mjs.map +0 -1
  23. package/fesm2022/acorex-components-conversation-conversation-file.file-type-DB-2xhaC.mjs +0 -121
  24. package/fesm2022/acorex-components-conversation-conversation-file.file-type-DB-2xhaC.mjs.map +0 -1
  25. package/fesm2022/acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs +0 -84
  26. package/fesm2022/acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs.map +0 -1
  27. package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs +0 -238
  28. package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs.map +0 -1
  29. package/fesm2022/acorex-components-conversation-conversation-info-panel.component-CNaM5ajR.mjs +0 -1080
  30. package/fesm2022/acorex-components-conversation-conversation-info-panel.component-CNaM5ajR.mjs.map +0 -1
  31. package/fesm2022/acorex-components-conversation-conversation-video.file-type-Pescv4Vu.mjs +0 -102
  32. package/fesm2022/acorex-components-conversation-conversation-video.file-type-Pescv4Vu.mjs.map +0 -1
  33. package/fesm2022/acorex-components-conversation-conversation-voice.file-type-DDd47o4r.mjs +0 -90
  34. package/fesm2022/acorex-components-conversation-conversation-voice.file-type-DDd47o4r.mjs.map +0 -1
  35. package/fesm2022/acorex-components-conversation-fallback-renderer.component-CYh_6O6j.mjs +0 -44
  36. package/fesm2022/acorex-components-conversation-fallback-renderer.component-CYh_6O6j.mjs.map +0 -1
  37. package/fesm2022/acorex-components-conversation-file-composer.payload-Dy7aG-EH.mjs +0 -64
  38. package/fesm2022/acorex-components-conversation-file-composer.payload-Dy7aG-EH.mjs.map +0 -1
  39. package/fesm2022/acorex-components-conversation-file-picker.component-DCVgl33l.mjs +0 -468
  40. package/fesm2022/acorex-components-conversation-file-picker.component-DCVgl33l.mjs.map +0 -1
  41. package/fesm2022/acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs +0 -125
  42. package/fesm2022/acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs.map +0 -1
  43. package/fesm2022/acorex-components-conversation-file.payload-DyFxTQYn.mjs +0 -50
  44. package/fesm2022/acorex-components-conversation-file.payload-DyFxTQYn.mjs.map +0 -1
  45. package/fesm2022/acorex-components-conversation-format-media-DUD4vA6F.mjs +0 -21
  46. package/fesm2022/acorex-components-conversation-format-media-DUD4vA6F.mjs.map +0 -1
  47. package/fesm2022/acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs +0 -77
  48. package/fesm2022/acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs.map +0 -1
  49. package/fesm2022/acorex-components-conversation-image-picker.component-CS343UDa.mjs +0 -407
  50. package/fesm2022/acorex-components-conversation-image-picker.component-CS343UDa.mjs.map +0 -1
  51. package/fesm2022/acorex-components-conversation-image-renderer.component-Cy0TA6cL.mjs +0 -83
  52. package/fesm2022/acorex-components-conversation-image-renderer.component-Cy0TA6cL.mjs.map +0 -1
  53. package/fesm2022/acorex-components-conversation-index-3V2b14I0.mjs +0 -184
  54. package/fesm2022/acorex-components-conversation-index-3V2b14I0.mjs.map +0 -1
  55. package/fesm2022/acorex-components-conversation-index-MCvfr9Zd.mjs +0 -266
  56. package/fesm2022/acorex-components-conversation-index-MCvfr9Zd.mjs.map +0 -1
  57. package/fesm2022/acorex-components-conversation-location-picker.component-DcNQzuoU.mjs +0 -149
  58. package/fesm2022/acorex-components-conversation-location-picker.component-DcNQzuoU.mjs.map +0 -1
  59. package/fesm2022/acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs +0 -118
  60. package/fesm2022/acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs.map +0 -1
  61. package/fesm2022/acorex-components-conversation-media-formatters-DV3wEEno.mjs +0 -17
  62. package/fesm2022/acorex-components-conversation-media-formatters-DV3wEEno.mjs.map +0 -1
  63. package/fesm2022/acorex-components-conversation-media-playback-info-bar-banner.component-DbWUl6M2.mjs +0 -140
  64. package/fesm2022/acorex-components-conversation-media-playback-info-bar-banner.component-DbWUl6M2.mjs.map +0 -1
  65. package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs +0 -33
  66. package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs.map +0 -1
  67. package/fesm2022/acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs +0 -172
  68. package/fesm2022/acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs.map +0 -1
  69. package/fesm2022/acorex-components-conversation-pagination-demo-data-oIT_YJmN.mjs +0 -81
  70. package/fesm2022/acorex-components-conversation-pagination-demo-data-oIT_YJmN.mjs.map +0 -1
  71. package/fesm2022/acorex-components-conversation-picker-header.component-BneIFjXq.mjs +0 -91
  72. package/fesm2022/acorex-components-conversation-picker-header.component-BneIFjXq.mjs.map +0 -1
  73. package/fesm2022/acorex-components-conversation-picker-toolbar.component-BthRvEeE.mjs +0 -537
  74. package/fesm2022/acorex-components-conversation-picker-toolbar.component-BthRvEeE.mjs.map +0 -1
  75. package/fesm2022/acorex-components-conversation-picker-upload-C-PlKPaU.mjs +0 -163
  76. package/fesm2022/acorex-components-conversation-picker-upload-C-PlKPaU.mjs.map +0 -1
  77. package/fesm2022/acorex-components-conversation-playback-banner-sync-D8FFKde6.mjs +0 -68
  78. package/fesm2022/acorex-components-conversation-playback-banner-sync-D8FFKde6.mjs.map +0 -1
  79. package/fesm2022/acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs +0 -95
  80. package/fesm2022/acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs.map +0 -1
  81. package/fesm2022/acorex-components-conversation-search.component-B-nc6xiA.mjs +0 -187
  82. package/fesm2022/acorex-components-conversation-search.component-B-nc6xiA.mjs.map +0 -1
  83. package/fesm2022/acorex-components-conversation-send-message-media-BRklgfV7.mjs +0 -170
  84. package/fesm2022/acorex-components-conversation-send-message-media-BRklgfV7.mjs.map +0 -1
  85. package/fesm2022/acorex-components-conversation-shared-storage.seed-J9PA4l3c.mjs +0 -750
  86. package/fesm2022/acorex-components-conversation-shared-storage.seed-J9PA4l3c.mjs.map +0 -1
  87. package/fesm2022/acorex-components-conversation-sticker-renderer.component-BmBwy7Ig.mjs +0 -103
  88. package/fesm2022/acorex-components-conversation-sticker-renderer.component-BmBwy7Ig.mjs.map +0 -1
  89. package/fesm2022/acorex-components-conversation-system-renderer.component-uie3tm5N.mjs +0 -55
  90. package/fesm2022/acorex-components-conversation-system-renderer.component-uie3tm5N.mjs.map +0 -1
  91. package/fesm2022/acorex-components-conversation-text-renderer.component-DNAquHYK.mjs +0 -109
  92. package/fesm2022/acorex-components-conversation-text-renderer.component-DNAquHYK.mjs.map +0 -1
  93. package/fesm2022/acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs +0 -105
  94. package/fesm2022/acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs.map +0 -1
  95. package/fesm2022/acorex-components-conversation-video-composer.payload-DMqRkafr.mjs +0 -62
  96. package/fesm2022/acorex-components-conversation-video-composer.payload-DMqRkafr.mjs.map +0 -1
  97. package/fesm2022/acorex-components-conversation-video-picker.component-DPwSBnoH.mjs +0 -446
  98. package/fesm2022/acorex-components-conversation-video-picker.component-DPwSBnoH.mjs.map +0 -1
  99. package/fesm2022/acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs +0 -181
  100. package/fesm2022/acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs.map +0 -1
  101. package/fesm2022/acorex-components-conversation-video.payload-C8QaqxuX.mjs +0 -54
  102. package/fesm2022/acorex-components-conversation-video.payload-C8QaqxuX.mjs.map +0 -1
  103. package/fesm2022/acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs +0 -17
  104. package/fesm2022/acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs.map +0 -1
  105. package/fesm2022/acorex-components-conversation-voice-recorder.component-D_rdANZN.mjs +0 -344
  106. package/fesm2022/acorex-components-conversation-voice-recorder.component-D_rdANZN.mjs.map +0 -1
  107. package/fesm2022/acorex-components-conversation-voice-renderer.component-BY5FJcT8.mjs +0 -270
  108. package/fesm2022/acorex-components-conversation-voice-renderer.component-BY5FJcT8.mjs.map +0 -1
@@ -1,468 +0,0 @@
1
- import { AXUploaderService } from '@acorex/cdk/uploader';
2
- import * as i1 from '@acorex/components/progress-bar';
3
- import { AXProgressBarModule } from '@acorex/components/progress-bar';
4
- import { AXToastService } from '@acorex/components/toast';
5
- import { AXFileService, AXFileTypeRegistryService, runFileTypeUtilityForFile, runFileTypeUtility } from '@acorex/core/file';
6
- import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
7
- import { CommonModule } from '@angular/common';
8
- import * as i0 from '@angular/core';
9
- import { inject, PLATFORM_ID, input, computed, signal, Component } from '@angular/core';
10
- import { o as AXConversationComposerService, q as AX_CONVERSATION_FILE_CATALOG } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
11
- import { A as AXConversationPickerHeaderComponent, a as AXConversationPickerFooterComponent } from './acorex-components-conversation-picker-header.component-BneIFjXq.mjs';
12
- import { A as AXConversationPickerEmptyComponent, a as AXConversationPickerToolbarComponent, b as AXConversationPickerCaptionComponent, c as AXConversationPickerShellComponent } from './acorex-components-conversation-picker-toolbar.component-BthRvEeE.mjs';
13
- import { s as seedPickerInitialFiles, l as limitFilesToCapacity, a as notifyMaxFilesCapacityExceeded, n as notifyPickerValidationErrors, i as isUploadAborted, c as cleanupPickerUploads, p as pickerItemToUploadResult, d as dismissComposerPickerHost, u as uploadPickerFile, g as getPickerCancelUploadLabel } from './acorex-components-conversation-picker-upload-C-PlKPaU.mjs';
14
- import { fileItemFromUpload } from './acorex-components-conversation-file-composer.payload-Dy7aG-EH.mjs';
15
- import { AX_CONVERSATION_FILE_PRESENTATION, createConversationFileFileType } from './acorex-components-conversation-conversation-file.file-type-DB-2xhaC.mjs';
16
-
17
- /**
18
- * File Picker Component
19
- * General-purpose file attachment interface for the composer
20
- */
21
- class AXConversationFilePickerComponent {
22
- get composerService() {
23
- const svc = this.service() ?? this.composerServiceFromInjector;
24
- if (!svc) {
25
- throw new Error('AXConversationComposerService is required for the file picker');
26
- }
27
- return svc;
28
- }
29
- constructor() {
30
- this.uploadsDismissed = false;
31
- this.retainUploadedOnDismiss = false;
32
- this.uploader = inject(AXUploaderService);
33
- this.fileService = inject(AXFileService);
34
- this.fileTypeRegistry = inject(AXFileTypeRegistryService);
35
- this.platformId = inject(PLATFORM_ID);
36
- this.service = input(...(ngDevMode ? [undefined, { debugName: "service" }] : /* istanbul ignore next */ []));
37
- this.composerServiceFromInjector = inject(AXConversationComposerService, { optional: true });
38
- this.toast = inject(AXToastService);
39
- this.translation = inject(AXTranslationService);
40
- this.conversation = input.required(...(ngDevMode ? [{ debugName: "conversation" }] : /* istanbul ignore next */ []));
41
- this.maxFiles = input(10, ...(ngDevMode ? [{ debugName: "maxFiles" }] : /* istanbul ignore next */ []));
42
- this.initialFiles = input([], ...(ngDevMode ? [{ debugName: "initialFiles" }] : /* istanbul ignore next */ []));
43
- this.__popup__ = input(...(ngDevMode ? [undefined, { debugName: "__popup__" }] : /* istanbul ignore next */ []));
44
- this.catalogFileType = AX_CONVERSATION_FILE_CATALOG;
45
- this.allowMultiple = computed(() => this.maxFiles() > 1, ...(ngDevMode ? [{ debugName: "allowMultiple" }] : /* istanbul ignore next */ []));
46
- this.files = signal([], ...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
47
- this.isDragging = signal(false, ...(ngDevMode ? [{ debugName: "isDragging" }] : /* istanbul ignore next */ []));
48
- this.isUploading = signal(false, ...(ngDevMode ? [{ debugName: "isUploading" }] : /* istanbul ignore next */ []));
49
- this.emptyIconClass = computed(() => this.isDragging() ? 'fa-light fa-cloud-arrow-up' : AX_CONVERSATION_FILE_PRESENTATION.icon, ...(ngDevMode ? [{ debugName: "emptyIconClass" }] : /* istanbul ignore next */ []));
50
- this.caption = '';
51
- this.fileTypeRegistry.registerTypes([createConversationFileFileType()]);
52
- seedPickerInitialFiles(this.initialFiles, (files) => this.handleFiles(files));
53
- }
54
- createUtilityContext() {
55
- return {
56
- readAsDataUrl: (file) => this.fileService.blobToBase64(file),
57
- platformId: this.platformId,
58
- };
59
- }
60
- async getCatalogFileTypeDef() {
61
- this.catalogFileTypeDef ??= await this.fileService.getFileType(this.catalogFileType);
62
- return this.catalogFileTypeDef;
63
- }
64
- pickerKind(catalogName) {
65
- if (catalogName === 'conversation-image')
66
- return 'image';
67
- if (catalogName === 'conversation-video')
68
- return 'video';
69
- if (catalogName === 'conversation-audio')
70
- return 'audio';
71
- return 'file';
72
- }
73
- async handleFiles(fileList) {
74
- const max = this.maxFiles();
75
- const capacity = limitFilesToCapacity(fileList, this.files().length, max);
76
- if (capacity.length < fileList.length) {
77
- notifyMaxFilesCapacityExceeded(this.toast, this.translation, max);
78
- }
79
- if (capacity.length === 0) {
80
- return;
81
- }
82
- const { accepted, rejected } = await this.uploader.validateFiles(capacity, this.catalogFileType);
83
- notifyPickerValidationErrors(this.toast, this.translation, rejected);
84
- const fileType = await this.getCatalogFileTypeDef();
85
- const ctx = this.createUtilityContext();
86
- for (const file of accepted) {
87
- try {
88
- const previewResult = fileType
89
- ? await runFileTypeUtilityForFile(fileType, ctx, file, 'preview')
90
- : undefined;
91
- const rowCatalogResult = fileType
92
- ? await runFileTypeUtilityForFile(fileType, ctx, file, 'pickerCatalog')
93
- : undefined;
94
- const preview = typeof previewResult === 'string' ? previewResult : undefined;
95
- const rowCatalog = typeof rowCatalogResult === 'string' ? rowCatalogResult : this.catalogFileType;
96
- const rowType = await this.fileService.getFileType(rowCatalog);
97
- const icon = rowType?.icon ?? fileType?.icon ?? 'fa-light fa-file';
98
- const pickerKind = this.pickerKind(rowCatalog);
99
- let fileIndex = -1;
100
- this.files.update((files) => {
101
- fileIndex = files.length;
102
- return [...files, { file, preview, icon, type: pickerKind, uploadProgress: 0, uploading: true }];
103
- });
104
- if (fileIndex >= 0) {
105
- void this.uploadFile(fileIndex, file);
106
- }
107
- }
108
- catch (error) {
109
- console.error('Failed to process file:', error);
110
- }
111
- }
112
- }
113
- async uploadFile(index, file) {
114
- const abortController = new AbortController();
115
- this.files.update((files) => {
116
- const updated = [...files];
117
- updated[index] = { ...updated[index], abortController };
118
- return updated;
119
- });
120
- try {
121
- const result = await this.uploadFileWithProgress(file, (progress) => {
122
- this.updateFileProgress(index, progress, true);
123
- }, abortController.signal);
124
- this.updateFileProgress(index, 100, false, true, result.url, result.mediaId);
125
- }
126
- catch (error) {
127
- if (this.uploadsDismissed || isUploadAborted(error, abortController.signal)) {
128
- return;
129
- }
130
- console.error('Failed to upload file:', error);
131
- this.updateFileProgress(index, 0, false, false, undefined, undefined, this.translation.translateSync('@acorex:chat.errors.upload-failed'));
132
- }
133
- }
134
- removeFile(index) {
135
- const item = this.files()[index];
136
- if (item) {
137
- cleanupPickerUploads(this.uploader, [item]);
138
- }
139
- this.files.update((files) => files.filter((_, i) => i !== index));
140
- }
141
- async sendFiles() {
142
- const fileList = this.files();
143
- if (fileList.length === 0)
144
- return;
145
- // Check if all files are uploaded
146
- const allUploaded = fileList.every((f) => f.uploaded && !f.error);
147
- if (!allUploaded) {
148
- console.warn('Some files are still uploading or failed');
149
- return;
150
- }
151
- const files = fileList.flatMap((f) => {
152
- const result = pickerItemToUploadResult(f);
153
- return result ? [fileItemFromUpload(f.file, result)] : [];
154
- });
155
- if (files.length === 0) {
156
- return;
157
- }
158
- const command = {
159
- conversationId: this.conversation().id,
160
- type: 'file',
161
- payload: {
162
- type: 'file',
163
- files,
164
- caption: this.caption.trim() || undefined,
165
- },
166
- };
167
- this.retainUploadedOnDismiss = true;
168
- const popup = this.__popup__();
169
- this.dismissPicker();
170
- dismissComposerPickerHost(this.composerService, popup);
171
- void this.composerService.sendMessage(command).catch(() => {
172
- this.retainUploadedOnDismiss = false;
173
- });
174
- }
175
- updateFileProgress(index, progress, uploading, uploaded = false, uploadedUrl, mediaId, error) {
176
- if (this.uploadsDismissed) {
177
- return;
178
- }
179
- this.files.update((files) => {
180
- const updated = [...files];
181
- updated[index] = {
182
- ...updated[index],
183
- uploadProgress: progress,
184
- uploading,
185
- uploaded,
186
- uploadedUrl,
187
- mediaId,
188
- error,
189
- };
190
- return updated;
191
- });
192
- }
193
- async uploadFileWithProgress(file, onProgress, signal) {
194
- return uploadPickerFile(this.uploader, this.conversation().id, file, onProgress, signal);
195
- }
196
- cancel() {
197
- this.dismissPicker();
198
- dismissComposerPickerHost(this.composerService, this.__popup__());
199
- }
200
- ngOnDestroy() {
201
- this.dismissPicker();
202
- }
203
- dismissPicker() {
204
- if (this.uploadsDismissed) {
205
- return;
206
- }
207
- this.uploadsDismissed = true;
208
- const snapshot = [...this.files()];
209
- cleanupPickerUploads(this.uploader, snapshot, {
210
- retainUploaded: this.retainUploadedOnDismiss,
211
- });
212
- this.retainUploadedOnDismiss = false;
213
- this.files.set([]);
214
- this.caption = '';
215
- }
216
- getCancelUploadLabel() {
217
- return getPickerCancelUploadLabel(this.translation);
218
- }
219
- formatFileSize(bytes) {
220
- const fileType = this.catalogFileTypeDef;
221
- const result = fileType
222
- ? runFileTypeUtility(fileType, this.createUtilityContext(), undefined, 'formatSize', bytes)
223
- : undefined;
224
- return typeof result === 'string' ? result : `${bytes} B`;
225
- }
226
- canSend() {
227
- const fileList = this.files();
228
- if (fileList.length === 0)
229
- return false;
230
- // Can send if all files are uploaded and no errors
231
- return fileList.every((f) => f.uploaded && !f.error && !f.uploading);
232
- }
233
- getSendButtonText() {
234
- const fileList = this.files();
235
- const uploadingCount = fileList.filter((f) => f.uploading).length;
236
- const uploadedCount = fileList.filter((f) => f.uploaded).length;
237
- if (uploadingCount > 0) {
238
- return this.translation.translateSync('@acorex:chat.pickers.files.uploading-count', {
239
- params: { count: uploadingCount },
240
- });
241
- }
242
- if (uploadedCount === fileList.length) {
243
- return this.translation.translateSync('@acorex:chat.pickers.files.send-count', {
244
- params: { count: fileList.length },
245
- });
246
- }
247
- return this.translation.translateSync('@acorex:chat.pickers.files.ready-count', {
248
- params: { ready: uploadedCount, total: fileList.length },
249
- });
250
- }
251
- getEmptyTitle() {
252
- return this.isDragging()
253
- ? this.translation.translateSync('@acorex:chat.pickers.files.drop-here')
254
- : this.translation.translateSync('@acorex:chat.pickers.files.select');
255
- }
256
- getEmptySubtitle() {
257
- return this.isDragging()
258
- ? this.translation.translateSync('@acorex:chat.pickers.common.release-to-upload')
259
- : this.translation.translateSync('@acorex:chat.pickers.common.click-to-browse');
260
- }
261
- getSelectedCountText() {
262
- return this.translation.translateSync('@acorex:chat.pickers.files.selected-count', {
263
- params: { count: this.files().length },
264
- });
265
- }
266
- getUploadingLabel(progress) {
267
- return this.translation.translateSync('@acorex:chat.pickers.files.uploading-progress', {
268
- params: { progress },
269
- });
270
- }
271
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationFilePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
272
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXConversationFilePickerComponent, isStandalone: true, selector: "ax-conversation-file-picker", inputs: { service: { classPropertyName: "service", publicName: "service", isSignal: true, isRequired: false, transformFunction: null }, conversation: { classPropertyName: "conversation", publicName: "conversation", isSignal: true, isRequired: true, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, initialFiles: { classPropertyName: "initialFiles", publicName: "initialFiles", isSignal: true, isRequired: false, transformFunction: null }, __popup__: { classPropertyName: "__popup__", publicName: "__popup__", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
273
- <ax-conversation-picker-shell
274
- [fileType]="catalogFileType"
275
- [multiple]="allowMultiple()"
276
- (filesSelected)="handleFiles($event)"
277
- (dragEnter)="isDragging.set(true)"
278
- (dragLeave)="isDragging.set(false)"
279
- >
280
- <ax-conversation-picker-header [title]="translation.translateSync('@acorex:chat.pickers.files.title')" (onClose)="cancel()" />
281
-
282
- <div class="ax-conversation-picker__scroll">
283
- @if (files().length === 0) {
284
- <ax-conversation-picker-empty
285
- [title]="getEmptyTitle()"
286
- [hint]="getEmptySubtitle()"
287
- [iconClass]="emptyIconClass()"
288
- [dragOver]="isDragging()"
289
- />
290
- } @else {
291
- <div class="ax-conversation-picker__body">
292
- <ax-conversation-picker-toolbar
293
- [countLabel]="getSelectedCountText()"
294
- [addMoreLabel]="translation.translateSync('@acorex:chat.pickers.common.add-more')"
295
- />
296
-
297
- <div class="ax-conversation-picker__list">
298
- @for (file of files(); track $index) {
299
- <div class="ax-conversation-picker__row">
300
- <div class="ax-conversation-picker__thumb">
301
- @if (file.type === 'image' && file.preview) {
302
- <img [src]="file.preview" [alt]="file.file.name" />
303
- } @else {
304
- <i [class]="file.icon"></i>
305
- }
306
- </div>
307
- <div class="ax-conversation-picker__details">
308
- <div class="ax-conversation-picker__name">{{ file.file.name }}</div>
309
- <div class="ax-conversation-picker__status">
310
- @if (file.uploading) {
311
- <span>{{ getUploadingLabel(file.uploadProgress ?? 0) }}</span>
312
- } @else if (file.uploaded) {
313
- <span class="ax-conversation-picker__status--ok"
314
- ><i class="fa-light fa-check"></i>
315
- {{ translation.translateSync('@acorex:chat.pickers.files.uploaded') }}</span
316
- >
317
- } @else if (file.error) {
318
- <span class="ax-conversation-picker__status--err"
319
- ><i class="fa-light fa-xmark"></i> {{ file.error }}</span
320
- >
321
- } @else {
322
- <span>{{ formatFileSize(file.file.size) }}</span>
323
- }
324
- </div>
325
- @if (file.uploading || file.uploaded) {
326
- <div class="ax-conversation-picker__progress">
327
- <ax-progress-bar [progress]="file.uploadProgress || 0" [mode]="'determinate'" [height]="3" />
328
- </div>
329
- }
330
- </div>
331
- <button
332
- type="button"
333
- class="ax-conversation-picker__remove"
334
- (click)="removeFile($index)"
335
- [attr.aria-label]="
336
- file.uploading
337
- ? getCancelUploadLabel()
338
- : translation.translateSync('@acorex:chat.pickers.common.remove')
339
- "
340
- >
341
- <i class="fa-light fa-xmark"></i>
342
- </button>
343
- </div>
344
- }
345
- </div>
346
- </div>
347
- }
348
- </div>
349
-
350
- <ax-conversation-picker-caption [(caption)]="caption" />
351
-
352
- @if (files().length > 0) {
353
- <ax-conversation-picker-footer
354
- [sendText]="getSendButtonText()"
355
- [sendDisabled]="!canSend()"
356
- (onCancel)="cancel()"
357
- (onSend)="sendFiles()"
358
- />
359
- }
360
- </ax-conversation-picker-shell>
361
- `, isInline: true, styles: [":host{display:block;width:100%;max-width:100%;min-height:0}.ax-conversation-picker__scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.ax-conversation-picker__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.375rem;min-height:8.5rem;margin:.75rem;padding:1rem .75rem;border:1px dashed rgb(var(--ax-sys-color-border-surface));border-radius:var(--ax-sys-border-radius, .5rem);cursor:pointer;transition:border-color .15s ease,background-color .15s ease;text-align:center;touch-action:manipulation}.ax-conversation-picker__empty:hover,.ax-conversation-picker__empty--drag{border-color:rgb(var(--ax-sys-color-primary-500));background:rgba(var(--ax-sys-color-primary-500),.06)}.ax-conversation-picker__empty-icon{font-size:1.75rem;line-height:1;color:rgba(var(--ax-sys-color-on-surface),.55)}.ax-conversation-picker__empty-title{margin:0;font-size:.8125rem;font-weight:600;color:rgb(var(--ax-sys-color-on-surface))}.ax-conversation-picker__empty-hint{margin:0;font-size:.75rem;color:rgba(var(--ax-sys-color-on-surface),.6)}.ax-conversation-picker__body{padding:0 .75rem .75rem}.ax-conversation-picker__list{display:flex;flex-direction:column;gap:.5rem;padding-top:.5rem}.ax-conversation-picker__row{display:flex;align-items:center;gap:.625rem;padding:.5rem .625rem;border:1px solid rgb(var(--ax-sys-color-border-light-surface));border-radius:var(--ax-sys-border-radius, .375rem);background:rgb(var(--ax-sys-color-surface));transition:background-color .15s ease}@media(hover:hover){.ax-conversation-picker__row:hover{background:rgb(var(--ax-sys-color-light-surface))}}.ax-conversation-picker__thumb{position:relative;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border-radius:var(--ax-sys-border-radius, .375rem);background:rgba(var(--ax-sys-color-primary-500),.08);color:rgb(var(--ax-sys-color-primary-500));font-size:1.125rem;overflow:hidden}.ax-conversation-picker__thumb img,.ax-conversation-picker__thumb video{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}.ax-conversation-picker__thumb-badge{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#00000052;color:rgb(var(--ax-sys-color-light));font-size:.625rem;pointer-events:none}.ax-conversation-picker__details{flex:1;min-width:0;display:flex;flex-direction:column;gap:.125rem}.ax-conversation-picker__name{font-size:.8125rem;font-weight:500;color:rgb(var(--ax-sys-color-on-surface));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-picker__status{display:flex;flex-wrap:wrap;gap:.375rem;font-size:.6875rem;color:rgba(var(--ax-sys-color-on-surface),.65)}.ax-conversation-picker__status--ok{color:rgb(var(--ax-sys-color-success-600));font-weight:500}.ax-conversation-picker__status--err{color:rgb(var(--ax-sys-color-danger-600));font-weight:500}.ax-conversation-picker__progress{width:100%;margin-top:.125rem}.ax-conversation-picker__remove{display:flex;align-items:center;justify-content:center;width:2.75rem;height:2.75rem;flex-shrink:0;border:none;border-radius:var(--ax-sys-border-radius, .25rem);background:transparent;color:rgba(var(--ax-sys-color-on-surface),.55);font-size:1rem;cursor:pointer;touch-action:manipulation;transition:background-color .15s ease,color .15s ease}.ax-conversation-picker__remove:hover,.ax-conversation-picker__remove:focus-visible{background:rgba(var(--ax-sys-color-danger-500),.1);color:rgb(var(--ax-sys-color-danger-500));outline:none}.ax-conversation-picker__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(5.25rem,1fr));gap:.5rem}.ax-conversation-picker__tile{position:relative;aspect-ratio:1;border-radius:var(--ax-sys-border-radius, .375rem);overflow:hidden;border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-light-surface))}.ax-conversation-picker__tile img{width:100%;height:100%;object-fit:cover;display:block}.ax-conversation-picker__tile-remove{position:absolute;top:.25rem;inset-inline-end:.25rem;z-index:2;display:flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border:none;border-radius:50%;background:rgb(var(--ax-sys-color-danger-500));color:rgb(var(--ax-sys-color-light));font-size:.6875rem;cursor:pointer;touch-action:manipulation;box-shadow:0 1px 3px #0003}.ax-conversation-picker__tile-overlay{position:absolute;inset-inline:0;bottom:0;padding:.25rem;background:linear-gradient(transparent,#0000008c)}.ax-conversation-picker__tile-status{font-size:.625rem;color:rgb(var(--ax-sys-color-light));line-height:1.2}.ax-conversation-picker__caption-slot{flex-shrink:0;padding:.5rem .75rem;border-top:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-lightest-surface))}.ax-conversation-picker__input-hidden{display:none}@container picker (max-width: 480px){.ax-conversation-picker__grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:.375rem}.ax-conversation-picker__row{padding:.4375rem .5rem;gap:.5rem}.ax-conversation-picker__thumb{width:2.25rem;height:2.25rem}.ax-conversation-picker__empty{min-height:7.5rem;margin:.5rem}.ax-conversation-picker__body{padding-inline:.5rem;padding-bottom:.5rem}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXProgressBarModule }, { kind: "component", type: i1.AXProgressBarComponent, selector: "ax-progress-bar", inputs: ["color", "mode", "progress", "height"], outputs: ["ValueChange", "sizeChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXConversationPickerHeaderComponent, selector: "ax-conversation-picker-header", inputs: ["title"], outputs: ["onClose"] }, { kind: "component", type: AXConversationPickerFooterComponent, selector: "ax-conversation-picker-footer", inputs: ["sendText", "sendDisabled"], outputs: ["onCancel", "onSend"] }, { kind: "component", type: AXConversationPickerEmptyComponent, selector: "ax-conversation-picker-empty", inputs: ["title", "hint", "iconClass", "dragOver"] }, { kind: "component", type: AXConversationPickerToolbarComponent, selector: "ax-conversation-picker-toolbar", inputs: ["countLabel", "addMoreLabel"] }, { kind: "component", type: AXConversationPickerCaptionComponent, selector: "ax-conversation-picker-caption", inputs: ["caption"], outputs: ["captionChange"] }, { kind: "component", type: AXConversationPickerShellComponent, selector: "ax-conversation-picker-shell", inputs: ["fileType", "multiple"], outputs: ["filesSelected", "dragEnter", "dragLeave", "dragOver"] }] }); }
362
- }
363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationFilePickerComponent, decorators: [{
364
- type: Component,
365
- args: [{ selector: 'ax-conversation-file-picker', imports: [
366
- CommonModule,
367
- AXProgressBarModule,
368
- AXTranslationModule,
369
- AXConversationPickerHeaderComponent,
370
- AXConversationPickerFooterComponent,
371
- AXConversationPickerEmptyComponent,
372
- AXConversationPickerToolbarComponent,
373
- AXConversationPickerCaptionComponent,
374
- AXConversationPickerShellComponent,
375
- ], template: `
376
- <ax-conversation-picker-shell
377
- [fileType]="catalogFileType"
378
- [multiple]="allowMultiple()"
379
- (filesSelected)="handleFiles($event)"
380
- (dragEnter)="isDragging.set(true)"
381
- (dragLeave)="isDragging.set(false)"
382
- >
383
- <ax-conversation-picker-header [title]="translation.translateSync('@acorex:chat.pickers.files.title')" (onClose)="cancel()" />
384
-
385
- <div class="ax-conversation-picker__scroll">
386
- @if (files().length === 0) {
387
- <ax-conversation-picker-empty
388
- [title]="getEmptyTitle()"
389
- [hint]="getEmptySubtitle()"
390
- [iconClass]="emptyIconClass()"
391
- [dragOver]="isDragging()"
392
- />
393
- } @else {
394
- <div class="ax-conversation-picker__body">
395
- <ax-conversation-picker-toolbar
396
- [countLabel]="getSelectedCountText()"
397
- [addMoreLabel]="translation.translateSync('@acorex:chat.pickers.common.add-more')"
398
- />
399
-
400
- <div class="ax-conversation-picker__list">
401
- @for (file of files(); track $index) {
402
- <div class="ax-conversation-picker__row">
403
- <div class="ax-conversation-picker__thumb">
404
- @if (file.type === 'image' && file.preview) {
405
- <img [src]="file.preview" [alt]="file.file.name" />
406
- } @else {
407
- <i [class]="file.icon"></i>
408
- }
409
- </div>
410
- <div class="ax-conversation-picker__details">
411
- <div class="ax-conversation-picker__name">{{ file.file.name }}</div>
412
- <div class="ax-conversation-picker__status">
413
- @if (file.uploading) {
414
- <span>{{ getUploadingLabel(file.uploadProgress ?? 0) }}</span>
415
- } @else if (file.uploaded) {
416
- <span class="ax-conversation-picker__status--ok"
417
- ><i class="fa-light fa-check"></i>
418
- {{ translation.translateSync('@acorex:chat.pickers.files.uploaded') }}</span
419
- >
420
- } @else if (file.error) {
421
- <span class="ax-conversation-picker__status--err"
422
- ><i class="fa-light fa-xmark"></i> {{ file.error }}</span
423
- >
424
- } @else {
425
- <span>{{ formatFileSize(file.file.size) }}</span>
426
- }
427
- </div>
428
- @if (file.uploading || file.uploaded) {
429
- <div class="ax-conversation-picker__progress">
430
- <ax-progress-bar [progress]="file.uploadProgress || 0" [mode]="'determinate'" [height]="3" />
431
- </div>
432
- }
433
- </div>
434
- <button
435
- type="button"
436
- class="ax-conversation-picker__remove"
437
- (click)="removeFile($index)"
438
- [attr.aria-label]="
439
- file.uploading
440
- ? getCancelUploadLabel()
441
- : translation.translateSync('@acorex:chat.pickers.common.remove')
442
- "
443
- >
444
- <i class="fa-light fa-xmark"></i>
445
- </button>
446
- </div>
447
- }
448
- </div>
449
- </div>
450
- }
451
- </div>
452
-
453
- <ax-conversation-picker-caption [(caption)]="caption" />
454
-
455
- @if (files().length > 0) {
456
- <ax-conversation-picker-footer
457
- [sendText]="getSendButtonText()"
458
- [sendDisabled]="!canSend()"
459
- (onCancel)="cancel()"
460
- (onSend)="sendFiles()"
461
- />
462
- }
463
- </ax-conversation-picker-shell>
464
- `, styles: [":host{display:block;width:100%;max-width:100%;min-height:0}.ax-conversation-picker__scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.ax-conversation-picker__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.375rem;min-height:8.5rem;margin:.75rem;padding:1rem .75rem;border:1px dashed rgb(var(--ax-sys-color-border-surface));border-radius:var(--ax-sys-border-radius, .5rem);cursor:pointer;transition:border-color .15s ease,background-color .15s ease;text-align:center;touch-action:manipulation}.ax-conversation-picker__empty:hover,.ax-conversation-picker__empty--drag{border-color:rgb(var(--ax-sys-color-primary-500));background:rgba(var(--ax-sys-color-primary-500),.06)}.ax-conversation-picker__empty-icon{font-size:1.75rem;line-height:1;color:rgba(var(--ax-sys-color-on-surface),.55)}.ax-conversation-picker__empty-title{margin:0;font-size:.8125rem;font-weight:600;color:rgb(var(--ax-sys-color-on-surface))}.ax-conversation-picker__empty-hint{margin:0;font-size:.75rem;color:rgba(var(--ax-sys-color-on-surface),.6)}.ax-conversation-picker__body{padding:0 .75rem .75rem}.ax-conversation-picker__list{display:flex;flex-direction:column;gap:.5rem;padding-top:.5rem}.ax-conversation-picker__row{display:flex;align-items:center;gap:.625rem;padding:.5rem .625rem;border:1px solid rgb(var(--ax-sys-color-border-light-surface));border-radius:var(--ax-sys-border-radius, .375rem);background:rgb(var(--ax-sys-color-surface));transition:background-color .15s ease}@media(hover:hover){.ax-conversation-picker__row:hover{background:rgb(var(--ax-sys-color-light-surface))}}.ax-conversation-picker__thumb{position:relative;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border-radius:var(--ax-sys-border-radius, .375rem);background:rgba(var(--ax-sys-color-primary-500),.08);color:rgb(var(--ax-sys-color-primary-500));font-size:1.125rem;overflow:hidden}.ax-conversation-picker__thumb img,.ax-conversation-picker__thumb video{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}.ax-conversation-picker__thumb-badge{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#00000052;color:rgb(var(--ax-sys-color-light));font-size:.625rem;pointer-events:none}.ax-conversation-picker__details{flex:1;min-width:0;display:flex;flex-direction:column;gap:.125rem}.ax-conversation-picker__name{font-size:.8125rem;font-weight:500;color:rgb(var(--ax-sys-color-on-surface));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-picker__status{display:flex;flex-wrap:wrap;gap:.375rem;font-size:.6875rem;color:rgba(var(--ax-sys-color-on-surface),.65)}.ax-conversation-picker__status--ok{color:rgb(var(--ax-sys-color-success-600));font-weight:500}.ax-conversation-picker__status--err{color:rgb(var(--ax-sys-color-danger-600));font-weight:500}.ax-conversation-picker__progress{width:100%;margin-top:.125rem}.ax-conversation-picker__remove{display:flex;align-items:center;justify-content:center;width:2.75rem;height:2.75rem;flex-shrink:0;border:none;border-radius:var(--ax-sys-border-radius, .25rem);background:transparent;color:rgba(var(--ax-sys-color-on-surface),.55);font-size:1rem;cursor:pointer;touch-action:manipulation;transition:background-color .15s ease,color .15s ease}.ax-conversation-picker__remove:hover,.ax-conversation-picker__remove:focus-visible{background:rgba(var(--ax-sys-color-danger-500),.1);color:rgb(var(--ax-sys-color-danger-500));outline:none}.ax-conversation-picker__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(5.25rem,1fr));gap:.5rem}.ax-conversation-picker__tile{position:relative;aspect-ratio:1;border-radius:var(--ax-sys-border-radius, .375rem);overflow:hidden;border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-light-surface))}.ax-conversation-picker__tile img{width:100%;height:100%;object-fit:cover;display:block}.ax-conversation-picker__tile-remove{position:absolute;top:.25rem;inset-inline-end:.25rem;z-index:2;display:flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border:none;border-radius:50%;background:rgb(var(--ax-sys-color-danger-500));color:rgb(var(--ax-sys-color-light));font-size:.6875rem;cursor:pointer;touch-action:manipulation;box-shadow:0 1px 3px #0003}.ax-conversation-picker__tile-overlay{position:absolute;inset-inline:0;bottom:0;padding:.25rem;background:linear-gradient(transparent,#0000008c)}.ax-conversation-picker__tile-status{font-size:.625rem;color:rgb(var(--ax-sys-color-light));line-height:1.2}.ax-conversation-picker__caption-slot{flex-shrink:0;padding:.5rem .75rem;border-top:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-lightest-surface))}.ax-conversation-picker__input-hidden{display:none}@container picker (max-width: 480px){.ax-conversation-picker__grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:.375rem}.ax-conversation-picker__row{padding:.4375rem .5rem;gap:.5rem}.ax-conversation-picker__thumb{width:2.25rem;height:2.25rem}.ax-conversation-picker__empty{min-height:7.5rem;margin:.5rem}.ax-conversation-picker__body{padding-inline:.5rem;padding-bottom:.5rem}}\n"] }]
465
- }], ctorParameters: () => [], propDecorators: { service: [{ type: i0.Input, args: [{ isSignal: true, alias: "service", required: false }] }], conversation: [{ type: i0.Input, args: [{ isSignal: true, alias: "conversation", required: true }] }], maxFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFiles", required: false }] }], initialFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFiles", required: false }] }], __popup__: [{ type: i0.Input, args: [{ isSignal: true, alias: "__popup__", required: false }] }] } });
466
-
467
- export { AXConversationFilePickerComponent };
468
- //# sourceMappingURL=acorex-components-conversation-file-picker.component-DCVgl33l.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"acorex-components-conversation-file-picker.component-DCVgl33l.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/composer/components/file-picker/file-picker.component.ts"],"sourcesContent":["/**\n * File Picker Component\n * General-purpose file attachment interface for the composer\n */\n\nimport { AXUploaderService } from '@acorex/cdk/uploader';\nimport { AXProgressBarModule } from '@acorex/components/progress-bar';\nimport type { AXPopupRef } from '@acorex/components/popup';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXFileService, AXFileTypeRegistryService, runFileTypeUtility, runFileTypeUtilityForFile, type AXFileType } from '@acorex/core/file';\nimport { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport { Component, OnDestroy, PLATFORM_ID, computed, inject, input, signal } from '@angular/core';\nimport { AXConversationComposerService } from '../../../../components/composer/composer.service';\nimport { AXConversation, AXConversationSendMessageCommand } from '../../../../models';\nimport { AXConversationPickerFooterComponent } from '../picker-footer/picker-footer.component';\nimport { AXConversationPickerHeaderComponent } from '../picker-header/picker-header.component';\nimport { AXConversationPickerCaptionComponent } from '../shared/picker-caption.component';\nimport { AXConversationPickerEmptyComponent } from '../shared/picker-empty.component';\nimport { AX_CONVERSATION_PICKER_SHARED_STYLES } from '../shared/picker-shared.styles';\nimport { AXConversationPickerShellComponent } from '../shared/picker-shell.component';\nimport { AXConversationPickerToolbarComponent } from '../shared/picker-toolbar.component';\nimport {\n cleanupPickerUploads,\n dismissComposerPickerHost,\n getPickerCancelUploadLabel,\n isUploadAborted,\n seedPickerInitialFiles,\n limitFilesToCapacity,\n notifyMaxFilesCapacityExceeded,\n notifyPickerValidationErrors,\n pickerItemToUploadResult,\n uploadPickerFile,\n} from '../shared/picker-upload';\nimport { fileItemFromUpload } from './file-composer.payload';\nimport { AX_CONVERSATION_FILE_CATALOG, AX_CONVERSATION_FILE_PRESENTATION, createConversationFileFileType } from './index';\n\ninterface AXConversationAttachedFile {\n file: File;\n preview?: string;\n icon: string;\n type: 'image' | 'video' | 'audio' | 'file';\n uploadProgress?: number;\n uploading?: boolean;\n uploaded?: boolean;\n uploadedUrl?: string;\n mediaId?: string;\n error?: string;\n abortController?: AbortController;\n}\n\n@Component({\n selector: 'ax-conversation-file-picker',\n imports: [\n CommonModule,\n AXProgressBarModule,\n AXTranslationModule,\n AXConversationPickerHeaderComponent,\n AXConversationPickerFooterComponent,\n AXConversationPickerEmptyComponent,\n AXConversationPickerToolbarComponent,\n AXConversationPickerCaptionComponent,\n AXConversationPickerShellComponent,\n ],\n template: `\n <ax-conversation-picker-shell\n [fileType]=\"catalogFileType\"\n [multiple]=\"allowMultiple()\"\n (filesSelected)=\"handleFiles($event)\"\n (dragEnter)=\"isDragging.set(true)\"\n (dragLeave)=\"isDragging.set(false)\"\n >\n <ax-conversation-picker-header [title]=\"translation.translateSync('@acorex:chat.pickers.files.title')\" (onClose)=\"cancel()\" />\n\n <div class=\"ax-conversation-picker__scroll\">\n @if (files().length === 0) {\n <ax-conversation-picker-empty\n [title]=\"getEmptyTitle()\"\n [hint]=\"getEmptySubtitle()\"\n [iconClass]=\"emptyIconClass()\"\n [dragOver]=\"isDragging()\"\n />\n } @else {\n <div class=\"ax-conversation-picker__body\">\n <ax-conversation-picker-toolbar\n [countLabel]=\"getSelectedCountText()\"\n [addMoreLabel]=\"translation.translateSync('@acorex:chat.pickers.common.add-more')\"\n />\n\n <div class=\"ax-conversation-picker__list\">\n @for (file of files(); track $index) {\n <div class=\"ax-conversation-picker__row\">\n <div class=\"ax-conversation-picker__thumb\">\n @if (file.type === 'image' && file.preview) {\n <img [src]=\"file.preview\" [alt]=\"file.file.name\" />\n } @else {\n <i [class]=\"file.icon\"></i>\n }\n </div>\n <div class=\"ax-conversation-picker__details\">\n <div class=\"ax-conversation-picker__name\">{{ file.file.name }}</div>\n <div class=\"ax-conversation-picker__status\">\n @if (file.uploading) {\n <span>{{ getUploadingLabel(file.uploadProgress ?? 0) }}</span>\n } @else if (file.uploaded) {\n <span class=\"ax-conversation-picker__status--ok\"\n ><i class=\"fa-light fa-check\"></i>\n {{ translation.translateSync('@acorex:chat.pickers.files.uploaded') }}</span\n >\n } @else if (file.error) {\n <span class=\"ax-conversation-picker__status--err\"\n ><i class=\"fa-light fa-xmark\"></i> {{ file.error }}</span\n >\n } @else {\n <span>{{ formatFileSize(file.file.size) }}</span>\n }\n </div>\n @if (file.uploading || file.uploaded) {\n <div class=\"ax-conversation-picker__progress\">\n <ax-progress-bar [progress]=\"file.uploadProgress || 0\" [mode]=\"'determinate'\" [height]=\"3\" />\n </div>\n }\n </div>\n <button\n type=\"button\"\n class=\"ax-conversation-picker__remove\"\n (click)=\"removeFile($index)\"\n [attr.aria-label]=\"\n file.uploading\n ? getCancelUploadLabel()\n : translation.translateSync('@acorex:chat.pickers.common.remove')\n \"\n >\n <i class=\"fa-light fa-xmark\"></i>\n </button>\n </div>\n }\n </div>\n </div>\n }\n </div>\n\n <ax-conversation-picker-caption [(caption)]=\"caption\" />\n\n @if (files().length > 0) {\n <ax-conversation-picker-footer\n [sendText]=\"getSendButtonText()\"\n [sendDisabled]=\"!canSend()\"\n (onCancel)=\"cancel()\"\n (onSend)=\"sendFiles()\"\n />\n }\n </ax-conversation-picker-shell>\n `,\n styles: [AX_CONVERSATION_PICKER_SHARED_STYLES],\n})\nexport class AXConversationFilePickerComponent implements OnDestroy {\n private uploadsDismissed = false;\n private retainUploadedOnDismiss = false;\n private readonly uploader = inject(AXUploaderService);\n private readonly fileService = inject(AXFileService);\n private readonly fileTypeRegistry = inject(AXFileTypeRegistryService);\n private readonly platformId = inject(PLATFORM_ID);\n readonly service = input<AXConversationComposerService | undefined>();\n private readonly composerServiceFromInjector = inject(AXConversationComposerService, { optional: true });\n\n private get composerService(): AXConversationComposerService {\n const svc = this.service() ?? this.composerServiceFromInjector;\n if (!svc) {\n throw new Error('AXConversationComposerService is required for the file picker');\n }\n return svc;\n }\n private readonly toast = inject(AXToastService);\n readonly translation = inject(AXTranslationService);\n\n readonly conversation = input.required<AXConversation>();\n readonly maxFiles = input<number>(10);\n readonly initialFiles = input<File[]>([]);\n readonly __popup__ = input<AXPopupRef | undefined>();\n\n readonly catalogFileType = AX_CONVERSATION_FILE_CATALOG;\n\n readonly allowMultiple = computed(() => this.maxFiles() > 1);\n\n readonly files = signal<AXConversationAttachedFile[]>([]);\n readonly isDragging = signal(false);\n readonly isUploading = signal(false);\n readonly emptyIconClass = computed(() =>\n this.isDragging() ? 'fa-light fa-cloud-arrow-up' : AX_CONVERSATION_FILE_PRESENTATION.icon,\n );\n\n private catalogFileTypeDef?: AXFileType;\n caption = '';\n\n constructor() {\n this.fileTypeRegistry.registerTypes([createConversationFileFileType()]);\n seedPickerInitialFiles(this.initialFiles, (files) => this.handleFiles(files));\n }\n\n private createUtilityContext() {\n return {\n readAsDataUrl: (file: File | Blob) => this.fileService.blobToBase64(file),\n platformId: this.platformId,\n };\n }\n\n private async getCatalogFileTypeDef(): Promise<AXFileType | undefined> {\n this.catalogFileTypeDef ??= await this.fileService.getFileType(this.catalogFileType);\n return this.catalogFileTypeDef;\n }\n\n private pickerKind(catalogName: string): AXConversationAttachedFile['type'] {\n if (catalogName === 'conversation-image') return 'image';\n if (catalogName === 'conversation-video') return 'video';\n if (catalogName === 'conversation-audio') return 'audio';\n return 'file';\n }\n\n async handleFiles(fileList: File[]): Promise<void> {\n const max = this.maxFiles();\n const capacity = limitFilesToCapacity(fileList, this.files().length, max);\n if (capacity.length < fileList.length) {\n notifyMaxFilesCapacityExceeded(this.toast, this.translation, max);\n }\n if (capacity.length === 0) {\n return;\n }\n\n const { accepted, rejected } = await this.uploader.validateFiles(capacity, this.catalogFileType);\n\n notifyPickerValidationErrors(this.toast, this.translation, rejected);\n\n const fileType = await this.getCatalogFileTypeDef();\n const ctx = this.createUtilityContext();\n\n for (const file of accepted) {\n try {\n const previewResult = fileType\n ? await runFileTypeUtilityForFile(fileType, ctx, file, 'preview')\n : undefined;\n const rowCatalogResult = fileType\n ? await runFileTypeUtilityForFile(fileType, ctx, file, 'pickerCatalog')\n : undefined;\n const preview = typeof previewResult === 'string' ? previewResult : undefined;\n const rowCatalog = typeof rowCatalogResult === 'string' ? rowCatalogResult : this.catalogFileType;\n const rowType = await this.fileService.getFileType(rowCatalog);\n const icon = rowType?.icon ?? fileType?.icon ?? 'fa-light fa-file';\n const pickerKind = this.pickerKind(rowCatalog);\n\n let fileIndex = -1;\n this.files.update((files) => {\n fileIndex = files.length;\n return [...files, { file, preview, icon, type: pickerKind, uploadProgress: 0, uploading: true }];\n });\n\n if (fileIndex >= 0) {\n void this.uploadFile(fileIndex, file);\n }\n } catch (error) {\n console.error('Failed to process file:', error);\n }\n }\n }\n\n private async uploadFile(index: number, file: File): Promise<void> {\n const abortController = new AbortController();\n this.files.update((files) => {\n const updated = [...files];\n updated[index] = { ...updated[index], abortController };\n return updated;\n });\n\n try {\n const result = await this.uploadFileWithProgress(\n file,\n (progress) => {\n this.updateFileProgress(index, progress, true);\n },\n abortController.signal,\n );\n\n this.updateFileProgress(index, 100, false, true, result.url, result.mediaId);\n } catch (error) {\n if (this.uploadsDismissed || isUploadAborted(error, abortController.signal)) {\n return;\n }\n console.error('Failed to upload file:', error);\n this.updateFileProgress(\n index,\n 0,\n false,\n false,\n undefined,\n undefined,\n this.translation.translateSync('@acorex:chat.errors.upload-failed'),\n );\n }\n }\n\n removeFile(index: number): void {\n const item = this.files()[index];\n if (item) {\n cleanupPickerUploads(this.uploader, [item]);\n }\n this.files.update((files) => files.filter((_, i) => i !== index));\n }\n\n async sendFiles(): Promise<void> {\n const fileList = this.files();\n if (fileList.length === 0) return;\n\n // Check if all files are uploaded\n const allUploaded = fileList.every((f) => f.uploaded && !f.error);\n if (!allUploaded) {\n console.warn('Some files are still uploading or failed');\n return;\n }\n\n const files = fileList.flatMap((f) => {\n const result = pickerItemToUploadResult(f);\n return result ? [fileItemFromUpload(f.file, result)] : [];\n });\n\n if (files.length === 0) {\n return;\n }\n\n const command: AXConversationSendMessageCommand = {\n conversationId: this.conversation().id,\n type: 'file',\n payload: {\n type: 'file',\n files,\n caption: this.caption.trim() || undefined,\n },\n };\n\n this.retainUploadedOnDismiss = true;\n const popup = this.__popup__();\n this.dismissPicker();\n dismissComposerPickerHost(this.composerService, popup);\n\n void this.composerService.sendMessage(command).catch(() => {\n this.retainUploadedOnDismiss = false;\n });\n }\n\n private updateFileProgress(\n index: number,\n progress: number,\n uploading: boolean,\n uploaded = false,\n uploadedUrl?: string,\n mediaId?: string,\n error?: string,\n ): void {\n if (this.uploadsDismissed) {\n return;\n }\n this.files.update((files) => {\n const updated = [...files];\n updated[index] = {\n ...updated[index],\n uploadProgress: progress,\n uploading,\n uploaded,\n uploadedUrl,\n mediaId,\n error,\n };\n return updated;\n });\n }\n\n private async uploadFileWithProgress(\n file: File,\n onProgress: (progress: number) => void,\n signal?: AbortSignal,\n ): Promise<{ url: string; mediaId?: string; thumbnailUrl?: string; size: number; mimeType: string }> {\n return uploadPickerFile(this.uploader, this.conversation().id, file, onProgress, signal);\n }\n\n cancel(): void {\n this.dismissPicker();\n dismissComposerPickerHost(this.composerService, this.__popup__());\n }\n\n ngOnDestroy(): void {\n this.dismissPicker();\n }\n\n private dismissPicker(): void {\n if (this.uploadsDismissed) {\n return;\n }\n this.uploadsDismissed = true;\n const snapshot = [...this.files()];\n cleanupPickerUploads(this.uploader, snapshot, {\n retainUploaded: this.retainUploadedOnDismiss,\n });\n this.retainUploadedOnDismiss = false;\n this.files.set([]);\n this.caption = '';\n }\n\n getCancelUploadLabel(): string {\n return getPickerCancelUploadLabel(this.translation);\n }\n\n formatFileSize(bytes: number): string {\n const fileType = this.catalogFileTypeDef;\n const result = fileType\n ? runFileTypeUtility(fileType, this.createUtilityContext(), undefined, 'formatSize', bytes)\n : undefined;\n return typeof result === 'string' ? result : `${bytes} B`;\n }\n\n canSend(): boolean {\n const fileList = this.files();\n if (fileList.length === 0) return false;\n\n // Can send if all files are uploaded and no errors\n return fileList.every((f) => f.uploaded && !f.error && !f.uploading);\n }\n\n getSendButtonText(): string {\n const fileList = this.files();\n const uploadingCount = fileList.filter((f) => f.uploading).length;\n const uploadedCount = fileList.filter((f) => f.uploaded).length;\n\n if (uploadingCount > 0) {\n return this.translation.translateSync('@acorex:chat.pickers.files.uploading-count', {\n params: { count: uploadingCount },\n });\n }\n\n if (uploadedCount === fileList.length) {\n return this.translation.translateSync('@acorex:chat.pickers.files.send-count', {\n params: { count: fileList.length },\n });\n }\n\n return this.translation.translateSync('@acorex:chat.pickers.files.ready-count', {\n params: { ready: uploadedCount, total: fileList.length },\n });\n }\n\n getEmptyTitle(): string {\n return this.isDragging()\n ? this.translation.translateSync('@acorex:chat.pickers.files.drop-here')\n : this.translation.translateSync('@acorex:chat.pickers.files.select');\n }\n\n getEmptySubtitle(): string {\n return this.isDragging()\n ? this.translation.translateSync('@acorex:chat.pickers.common.release-to-upload')\n : this.translation.translateSync('@acorex:chat.pickers.common.click-to-browse');\n }\n\n getSelectedCountText(): string {\n return this.translation.translateSync('@acorex:chat.pickers.files.selected-count', {\n params: { count: this.files().length },\n });\n }\n\n getUploadingLabel(progress: number): string {\n return this.translation.translateSync('@acorex:chat.pickers.files.uploading-progress', {\n params: { progress },\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;AAGG;MAyJU,iCAAiC,CAAA;AAU5C,IAAA,IAAY,eAAe,GAAA;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,2BAA2B;QAC9D,IAAI,CAAC,GAAG,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC;QAClF;AACA,QAAA,OAAO,GAAG;IACZ;AAuBA,IAAA,WAAA,GAAA;QAtCQ,IAAA,CAAA,gBAAgB,GAAG,KAAK;QACxB,IAAA,CAAA,uBAAuB,GAAG,KAAK;AACtB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACpC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC;AACnC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACpD,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QACxC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAA6C;QACpD,IAAA,CAAA,2BAA2B,GAAG,MAAM,CAAC,6BAA6B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AASvF,QAAA,IAAA,CAAA,KAAK,G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