@aglyn/plugins-crm 1.30.0 → 1.31.0

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.
@@ -0,0 +1,608 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { _ as _extends } from "@swc/helpers/_/_extends";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ import { CALL_RECORDING_CONSENT_REQUIRED, CALL_RECORDING_CONSENT_STATEMENT, CRM_ACTIVITY_MEDIA_IDS_MAX, CRM_ACTIVITY_TRANSCRIPT_MAX, CRM_CALL_RECORDINGS_FOLDER_PATH, formatMediaRef, MediaUploadError, normalizeCrmActivityMediaIds, resolveMediaSrc, useMediaPicker } from "@aglyn/aglyn";
20
+ import { mdiClose, mdiFileMusicOutline, mdiFolderMusicOutline, mdiTextBoxOutline, mdiTrayArrowDown, mdiTrayArrowUp } from "@aglyn/shared-data-mdi";
21
+ import { MdiIcon } from "@aglyn/shared-ui-jsx";
22
+ import { authorizedFetch } from "@aglyn/shared-util-http/authorized-token";
23
+ import { useUser } from "@aglyn/tenant-feature-instance";
24
+ import { Alert, Box, Button, Checkbox, FormControlLabel, IconButton, LinearProgress, MenuItem, Stack, TextField, Tooltip, Typography } from "@mui/material";
25
+ import { doc, getDoc } from "firebase/firestore";
26
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
27
+ /** One playback speed the player offers. */ const SPEEDS = [
28
+ 0.75,
29
+ 1,
30
+ 1.25,
31
+ 1.5,
32
+ 2
33
+ ];
34
+ /** A signed link for a private org asset, from the console's `/api/media/sign`. */ async function signPrivateMedia(user, orgId, mediaId) {
35
+ const response = await authorizedFetch(user, '/api/media/sign', {
36
+ method: 'POST',
37
+ headers: {
38
+ 'Content-Type': 'application/json'
39
+ },
40
+ body: JSON.stringify({
41
+ orgId,
42
+ mediaId
43
+ })
44
+ });
45
+ if (!response.ok) return undefined;
46
+ const payload = await response.json().catch(()=>({}));
47
+ return typeof payload.url === 'string' ? payload.url : undefined;
48
+ }
49
+ /**
50
+ * The recordings an activity names, read from the organization's library.
51
+ *
52
+ * One `getDoc` per recording, bounded by {@link CRM_ACTIVITY_MEDIA_IDS_MAX}
53
+ * and paid only when the row is opened. A recording the library no longer
54
+ * holds is still listed, as missing, the way a record's files are.
55
+ */ export function useActivityRecordings(firestore, orgId, mediaIds, enabled = true) {
56
+ var _ref;
57
+ const { data: user } = useUser();
58
+ // Read through a ref, keyed by uid: the user object's identity changes on
59
+ // renders that change nothing about who is signed in, and an effect keyed
60
+ // by it would read every recording again on each one.
61
+ const userRef = useRef(user);
62
+ userRef.current = user;
63
+ const uid = (_ref = user == null ? void 0 : user.uid) != null ? _ref : '';
64
+ const ids = useMemo(()=>normalizeCrmActivityMediaIds(mediaIds), [
65
+ mediaIds
66
+ ]);
67
+ const key = ids.join('\n');
68
+ const [rows, setRows] = useState(null);
69
+ useEffect(()=>{
70
+ if (!enabled || !orgId) return undefined;
71
+ const wanted = key ? key.split('\n') : [];
72
+ if (!wanted.length) {
73
+ setRows((current)=>current && current.length === 0 ? current : []);
74
+ return undefined;
75
+ }
76
+ let live = true;
77
+ void Promise.all(wanted.map(async (mediaId)=>{
78
+ try {
79
+ var _snapshot_data, _formatMediaRef, _data_fileName, _data_contentType;
80
+ const snapshot = await getDoc(doc(firestore, 'orgs', orgId, 'media', mediaId));
81
+ if (!snapshot.exists()) {
82
+ return {
83
+ mediaId,
84
+ fileName: '',
85
+ contentType: '',
86
+ isPrivate: false,
87
+ missing: true
88
+ };
89
+ }
90
+ const data = (_snapshot_data = snapshot.data()) != null ? _snapshot_data : {};
91
+ const isPrivate = data['private'] === true;
92
+ const signer = userRef.current;
93
+ const src = isPrivate ? signer ? await signPrivateMedia(signer, orgId, mediaId) : undefined : resolveMediaSrc((_formatMediaRef = formatMediaRef(`org:${orgId}`, mediaId)) != null ? _formatMediaRef : undefined);
94
+ return {
95
+ mediaId,
96
+ fileName: String((_data_fileName = data['fileName']) != null ? _data_fileName : ''),
97
+ contentType: String((_data_contentType = data['contentType']) != null ? _data_contentType : ''),
98
+ isPrivate,
99
+ src,
100
+ missing: !src
101
+ };
102
+ } catch (unused) {
103
+ return {
104
+ mediaId,
105
+ fileName: '',
106
+ contentType: '',
107
+ isPrivate: false,
108
+ missing: true
109
+ };
110
+ }
111
+ })).then((resolved)=>{
112
+ if (live) setRows(resolved);
113
+ });
114
+ return ()=>{
115
+ live = false;
116
+ };
117
+ }, [
118
+ firestore,
119
+ orgId,
120
+ key,
121
+ enabled,
122
+ uid
123
+ ]);
124
+ return rows;
125
+ }
126
+ /**
127
+ * One recording: the browser's own audio controls (play, pause, scrub,
128
+ * volume), a speed menu, and a download.
129
+ */ export function ActivityRecordingPlayer(props) {
130
+ const { recording } = props;
131
+ const audio = useRef(null);
132
+ const [speed, setSpeed] = useState(1);
133
+ useEffect(()=>{
134
+ if (audio.current) audio.current.playbackRate = speed;
135
+ }, [
136
+ speed
137
+ ]);
138
+ const name = recording.fileName || recording.mediaId;
139
+ if (recording.missing || !recording.src) {
140
+ return /*#__PURE__*/ _jsx(Typography, {
141
+ variant: "caption",
142
+ color: "text.secondary",
143
+ "data-testid": "activity-recording-missing",
144
+ children: `${name}: this recording is no longer in the library, or you cannot play it.`
145
+ });
146
+ }
147
+ return /*#__PURE__*/ _jsxs(Stack, {
148
+ spacing: 0.5,
149
+ "data-testid": "activity-recording",
150
+ children: [
151
+ /*#__PURE__*/ _jsxs(Stack, {
152
+ direction: "row",
153
+ spacing: 1,
154
+ sx: {
155
+ alignItems: 'center'
156
+ },
157
+ children: [
158
+ /*#__PURE__*/ _jsx(MdiIcon, {
159
+ path: mdiFileMusicOutline.path,
160
+ size: 0.8,
161
+ sx: {
162
+ color: 'text.secondary'
163
+ }
164
+ }),
165
+ /*#__PURE__*/ _jsx(Typography, {
166
+ variant: "body2",
167
+ noWrap: true,
168
+ sx: {
169
+ flex: 1,
170
+ minWidth: 0
171
+ },
172
+ children: name
173
+ }),
174
+ /*#__PURE__*/ _jsx(TextField, {
175
+ select: true,
176
+ size: "small",
177
+ label: "Speed",
178
+ value: speed,
179
+ onChange: (event)=>setSpeed(Number(event.target.value) || 1),
180
+ sx: {
181
+ width: 96
182
+ },
183
+ slotProps: {
184
+ htmlInput: {
185
+ 'aria-label': `Playback speed for ${name}`
186
+ }
187
+ },
188
+ children: SPEEDS.map((value)=>/*#__PURE__*/ _jsx(MenuItem, {
189
+ value: value,
190
+ children: `${value}×`
191
+ }, value))
192
+ }),
193
+ /*#__PURE__*/ _jsx(Tooltip, {
194
+ title: "Download",
195
+ children: /*#__PURE__*/ _jsx(IconButton, {
196
+ size: "small",
197
+ component: "a",
198
+ href: recording.src,
199
+ download: recording.fileName || true,
200
+ "aria-label": `Download ${name}`,
201
+ children: /*#__PURE__*/ _jsx(MdiIcon, {
202
+ path: mdiTrayArrowDown.path,
203
+ size: 0.8
204
+ })
205
+ })
206
+ })
207
+ ]
208
+ }),
209
+ /*#__PURE__*/ _jsx(Box, {
210
+ component: "audio",
211
+ ref: audio,
212
+ controls: true,
213
+ preload: "metadata",
214
+ src: recording.src,
215
+ onLoadedMetadata: ()=>{
216
+ if (audio.current) audio.current.playbackRate = speed;
217
+ },
218
+ sx: {
219
+ width: '100%'
220
+ }
221
+ })
222
+ ]
223
+ });
224
+ }
225
+ ActivityRecordingPlayer.displayName = 'ActivityRecordingPlayer';
226
+ /** An activity's transcript, closed until asked for: a 25-minute call is pages of text. */ export function ActivityTranscript(props) {
227
+ const [open, setOpen] = useState(false);
228
+ return /*#__PURE__*/ _jsxs(Stack, {
229
+ spacing: 0.5,
230
+ children: [
231
+ /*#__PURE__*/ _jsx(Button, {
232
+ size: "small",
233
+ sx: {
234
+ alignSelf: 'flex-start'
235
+ },
236
+ startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
237
+ path: mdiTextBoxOutline.path,
238
+ size: 0.8
239
+ }),
240
+ onClick: ()=>setOpen((value)=>!value),
241
+ "aria-expanded": open,
242
+ children: open ? 'Hide transcript' : 'Show transcript'
243
+ }),
244
+ open ? /*#__PURE__*/ _jsx(Typography, {
245
+ variant: "body2",
246
+ "data-testid": "activity-transcript",
247
+ sx: {
248
+ whiteSpace: 'pre-wrap',
249
+ overflowWrap: 'anywhere',
250
+ maxHeight: 360,
251
+ overflowY: 'auto',
252
+ p: 1,
253
+ borderRadius: 1,
254
+ bgcolor: 'action.hover'
255
+ },
256
+ children: props.transcript
257
+ }) : null
258
+ ]
259
+ });
260
+ }
261
+ ActivityTranscript.displayName = 'ActivityTranscript';
262
+ /** What an opened activity row shows under its body: the players and the transcript. */ export function ActivityRecordingsBlock(props) {
263
+ const recordings = useActivityRecordings(props.firestore, props.orgId, props.mediaIds);
264
+ const transcript = typeof props.transcript === 'string' ? props.transcript.trim() : '';
265
+ const hasIds = normalizeCrmActivityMediaIds(props.mediaIds).length > 0;
266
+ if (!hasIds && !transcript) return null;
267
+ return /*#__PURE__*/ _jsxs(Stack, {
268
+ spacing: 1,
269
+ sx: {
270
+ mt: 1
271
+ },
272
+ children: [
273
+ hasIds && recordings === null ? /*#__PURE__*/ _jsx(Typography, {
274
+ variant: "caption",
275
+ color: "text.secondary",
276
+ children: 'Reading the recording…'
277
+ }) : null,
278
+ (recordings != null ? recordings : []).map((recording)=>/*#__PURE__*/ _jsx(ActivityRecordingPlayer, {
279
+ recording: recording
280
+ }, recording.mediaId)),
281
+ transcript ? /*#__PURE__*/ _jsx(ActivityTranscript, {
282
+ transcript: transcript
283
+ }) : null
284
+ ]
285
+ });
286
+ }
287
+ ActivityRecordingsBlock.displayName = 'ActivityRecordingsBlock';
288
+ /** A `.txt` read as text, refused when it is not plain text. */ export async function readTranscriptFile(file) {
289
+ const name = file.name.toLowerCase();
290
+ if (!(file.type === 'text/plain' || name.endsWith('.txt'))) {
291
+ throw new MediaUploadError('A transcript is a plain-text (.txt) file.');
292
+ }
293
+ return (await file.text()).slice(0, CRM_ACTIVITY_TRANSCRIPT_MAX);
294
+ }
295
+ /**
296
+ * The Recording section of the log-activity dialog: upload a recording
297
+ * (pick or drop), or choose one already in the library; and a transcript,
298
+ * typed, pasted, or loaded from a `.txt`.
299
+ *
300
+ * The file goes to the organization's library, private, in CRM / Calls.
301
+ * While {@link CALL_RECORDING_CONSENT_REQUIRED} is on, an upload first asks
302
+ * its uploader to confirm {@link CALL_RECORDING_CONSENT_STATEMENT}; it is off
303
+ * (the owner's decision), so nothing is asked.
304
+ */ export function ActivityRecordingFields(props) {
305
+ const { firestore, orgId, mediaIds, onMediaIdsChange, transcript, onTranscriptChange, disabled, onBusyChange } = props;
306
+ const { pickMedia, uploadMedia } = useMediaPicker();
307
+ const [consent, setConsent] = useState(false);
308
+ const [uploading, setUploading] = useState(null);
309
+ const [error, setError] = useState(null);
310
+ const [dragging, setDragging] = useState(false);
311
+ const fileInput = useRef(null);
312
+ const transcriptInput = useRef(null);
313
+ const recordings = useActivityRecordings(firestore, orgId, mediaIds);
314
+ const full = mediaIds.length >= CRM_ACTIVITY_MEDIA_IDS_MAX;
315
+ useEffect(()=>{
316
+ onBusyChange == null ? void 0 : onBusyChange(uploading !== null);
317
+ }, [
318
+ uploading,
319
+ onBusyChange
320
+ ]);
321
+ const add = useCallback((mediaId)=>{
322
+ if (mediaIds.includes(mediaId)) return;
323
+ onMediaIdsChange(normalizeCrmActivityMediaIds([
324
+ ...mediaIds,
325
+ mediaId
326
+ ]));
327
+ }, [
328
+ mediaIds,
329
+ onMediaIdsChange
330
+ ]);
331
+ const upload = useCallback(async (file)=>{
332
+ if (!file || !uploadMedia || disabled || uploading) return;
333
+ setError(null);
334
+ if (full) {
335
+ setError(`An activity holds at most ${CRM_ACTIVITY_MEDIA_IDS_MAX} recordings.`);
336
+ return;
337
+ }
338
+ if (CALL_RECORDING_CONSENT_REQUIRED && !consent) {
339
+ setError('Confirm that everyone on the call knew it was being recorded first.');
340
+ return;
341
+ }
342
+ setUploading(file.name);
343
+ try {
344
+ const picked = await uploadMedia(file, _extends({
345
+ folderPath: CRM_CALL_RECORDINGS_FOLDER_PATH,
346
+ private: true,
347
+ purpose: 'callRecording'
348
+ }, CALL_RECORDING_CONSENT_REQUIRED ? {
349
+ confirmed: true
350
+ } : {}, {
351
+ kind: 'audio'
352
+ }));
353
+ if (picked.mediaId) add(picked.mediaId);
354
+ } catch (caught) {
355
+ setError(caught instanceof MediaUploadError ? caught.message : `Upload failed for "${file.name}" — try again.`);
356
+ } finally{
357
+ setUploading(null);
358
+ }
359
+ }, [
360
+ uploadMedia,
361
+ disabled,
362
+ uploading,
363
+ full,
364
+ consent,
365
+ add
366
+ ]);
367
+ const choose = useCallback(async ()=>{
368
+ if (!pickMedia || disabled) return;
369
+ setError(null);
370
+ const picked = await pickMedia({
371
+ kind: 'audio',
372
+ allowPrivate: true
373
+ });
374
+ if (!(picked == null ? void 0 : picked.mediaId)) return;
375
+ if (full) {
376
+ setError(`An activity holds at most ${CRM_ACTIVITY_MEDIA_IDS_MAX} recordings.`);
377
+ return;
378
+ }
379
+ add(picked.mediaId);
380
+ }, [
381
+ pickMedia,
382
+ disabled,
383
+ full,
384
+ add
385
+ ]);
386
+ const onDrop = useCallback((event)=>{
387
+ var _event_dataTransfer_files;
388
+ event.preventDefault();
389
+ setDragging(false);
390
+ void upload((_event_dataTransfer_files = event.dataTransfer.files) == null ? void 0 : _event_dataTransfer_files[0]);
391
+ }, [
392
+ upload
393
+ ]);
394
+ const loadTranscript = useCallback(async (file)=>{
395
+ if (!file) return;
396
+ setError(null);
397
+ try {
398
+ onTranscriptChange(await readTranscriptFile(file));
399
+ } catch (caught) {
400
+ setError(caught instanceof Error ? caught.message : 'The transcript could not be read.');
401
+ }
402
+ }, [
403
+ onTranscriptChange
404
+ ]);
405
+ const names = new Map((recordings != null ? recordings : []).map((row)=>[
406
+ row.mediaId,
407
+ row.fileName
408
+ ]));
409
+ return /*#__PURE__*/ _jsxs(Stack, {
410
+ spacing: 1,
411
+ "data-testid": "activity-recording-fields",
412
+ children: [
413
+ /*#__PURE__*/ _jsx(Typography, {
414
+ variant: "subtitle2",
415
+ children: 'Recording'
416
+ }),
417
+ mediaIds.map((mediaId)=>/*#__PURE__*/ _jsxs(Stack, {
418
+ direction: "row",
419
+ spacing: 1,
420
+ sx: {
421
+ alignItems: 'center'
422
+ },
423
+ children: [
424
+ /*#__PURE__*/ _jsx(MdiIcon, {
425
+ path: mdiFileMusicOutline.path,
426
+ size: 0.8,
427
+ sx: {
428
+ color: 'text.secondary'
429
+ }
430
+ }),
431
+ /*#__PURE__*/ _jsx(Typography, {
432
+ variant: "body2",
433
+ noWrap: true,
434
+ sx: {
435
+ flex: 1,
436
+ minWidth: 0
437
+ },
438
+ children: names.get(mediaId) || mediaId
439
+ }),
440
+ /*#__PURE__*/ _jsx(IconButton, {
441
+ size: "small",
442
+ "aria-label": `Remove ${names.get(mediaId) || 'recording'}`,
443
+ disabled: disabled || uploading !== null,
444
+ onClick: ()=>onMediaIdsChange(mediaIds.filter((id)=>id !== mediaId)),
445
+ children: /*#__PURE__*/ _jsx(MdiIcon, {
446
+ path: mdiClose.path,
447
+ size: 0.8
448
+ })
449
+ })
450
+ ]
451
+ }, mediaId)),
452
+ full ? null : /*#__PURE__*/ _jsx(Box, {
453
+ onDragOver: (event)=>{
454
+ event.preventDefault();
455
+ setDragging(true);
456
+ },
457
+ onDragLeave: ()=>setDragging(false),
458
+ onDrop: onDrop,
459
+ "data-testid": "activity-recording-drop",
460
+ sx: {
461
+ border: 1,
462
+ borderStyle: 'dashed',
463
+ borderColor: dragging ? 'primary.main' : 'divider',
464
+ borderRadius: 1,
465
+ p: 1.5
466
+ },
467
+ children: /*#__PURE__*/ _jsxs(Stack, {
468
+ spacing: 1,
469
+ children: [
470
+ CALL_RECORDING_CONSENT_REQUIRED ? /*#__PURE__*/ _jsx(FormControlLabel, {
471
+ control: /*#__PURE__*/ _jsx(Checkbox, {
472
+ size: "small",
473
+ checked: consent,
474
+ onChange: (event)=>setConsent(event.target.checked),
475
+ disabled: disabled
476
+ }),
477
+ label: /*#__PURE__*/ _jsx(Typography, {
478
+ variant: "body2",
479
+ children: CALL_RECORDING_CONSENT_STATEMENT
480
+ })
481
+ }) : null,
482
+ /*#__PURE__*/ _jsxs(Stack, {
483
+ direction: "row",
484
+ spacing: 1,
485
+ sx: {
486
+ flexWrap: 'wrap',
487
+ rowGap: 1
488
+ },
489
+ children: [
490
+ /*#__PURE__*/ _jsx(Button, {
491
+ size: "small",
492
+ variant: "outlined",
493
+ startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
494
+ path: mdiTrayArrowUp.path,
495
+ size: 0.8
496
+ }),
497
+ disabled: !uploadMedia || disabled || uploading !== null,
498
+ onClick: ()=>{
499
+ var _fileInput_current;
500
+ return (_fileInput_current = fileInput.current) == null ? void 0 : _fileInput_current.click();
501
+ },
502
+ children: 'Upload recording'
503
+ }),
504
+ /*#__PURE__*/ _jsx(Button, {
505
+ size: "small",
506
+ startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
507
+ path: mdiFolderMusicOutline.path,
508
+ size: 0.8
509
+ }),
510
+ disabled: !pickMedia || disabled || uploading !== null,
511
+ onClick: ()=>void choose(),
512
+ children: 'Choose from library'
513
+ })
514
+ ]
515
+ }),
516
+ /*#__PURE__*/ _jsx(Typography, {
517
+ variant: "caption",
518
+ color: "text.secondary",
519
+ children: 'Drop an MP3, M4A, WAV, AAC or OGG file here, up to 50 MB. It is kept private in your media library, under CRM / Calls.'
520
+ }),
521
+ /*#__PURE__*/ _jsx("input", {
522
+ ref: fileInput,
523
+ type: "file",
524
+ hidden: true,
525
+ accept: "audio/*,.m4a,.mp3,.wav,.aac,.ogg",
526
+ "data-testid": "activity-recording-input",
527
+ onChange: (event)=>{
528
+ var _event_target_files;
529
+ const file = (_event_target_files = event.target.files) == null ? void 0 : _event_target_files[0];
530
+ event.target.value = '';
531
+ void upload(file);
532
+ }
533
+ })
534
+ ]
535
+ })
536
+ }),
537
+ uploading ? /*#__PURE__*/ _jsxs(Stack, {
538
+ spacing: 0.5,
539
+ children: [
540
+ /*#__PURE__*/ _jsx(Typography, {
541
+ variant: "caption",
542
+ children: `Uploading "${uploading}"…`
543
+ }),
544
+ /*#__PURE__*/ _jsx(LinearProgress, {})
545
+ ]
546
+ }) : null,
547
+ !uploadMedia ? /*#__PURE__*/ _jsx(Alert, {
548
+ severity: "info",
549
+ children: 'Uploading is not available on this surface.'
550
+ }) : null,
551
+ error ? /*#__PURE__*/ _jsx(Alert, {
552
+ severity: "warning",
553
+ children: error
554
+ }) : null,
555
+ /*#__PURE__*/ _jsx(TextField, {
556
+ size: "small",
557
+ label: "Transcript",
558
+ placeholder: "Paste what was said, or load a .txt",
559
+ value: transcript,
560
+ onChange: (event)=>onTranscriptChange(event.target.value),
561
+ multiline: true,
562
+ minRows: 2,
563
+ maxRows: 10,
564
+ disabled: disabled,
565
+ slotProps: {
566
+ htmlInput: {
567
+ maxLength: CRM_ACTIVITY_TRANSCRIPT_MAX
568
+ }
569
+ }
570
+ }),
571
+ /*#__PURE__*/ _jsxs(Stack, {
572
+ direction: "row",
573
+ spacing: 1,
574
+ children: [
575
+ /*#__PURE__*/ _jsx(Button, {
576
+ size: "small",
577
+ startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
578
+ path: mdiTextBoxOutline.path,
579
+ size: 0.8
580
+ }),
581
+ disabled: disabled,
582
+ onClick: ()=>{
583
+ var _transcriptInput_current;
584
+ return (_transcriptInput_current = transcriptInput.current) == null ? void 0 : _transcriptInput_current.click();
585
+ },
586
+ children: 'Load transcript (.txt)'
587
+ }),
588
+ /*#__PURE__*/ _jsx("input", {
589
+ ref: transcriptInput,
590
+ type: "file",
591
+ hidden: true,
592
+ accept: ".txt,text/plain",
593
+ "data-testid": "activity-transcript-input",
594
+ onChange: (event)=>{
595
+ var _event_target_files;
596
+ const file = (_event_target_files = event.target.files) == null ? void 0 : _event_target_files[0];
597
+ event.target.value = '';
598
+ void loadTranscript(file);
599
+ }
600
+ })
601
+ ]
602
+ })
603
+ ]
604
+ });
605
+ }
606
+ ActivityRecordingFields.displayName = 'ActivityRecordingFields';
607
+
608
+ //# sourceMappingURL=activity-recording.js.map