CallOverlay.svelte 16 KB
Newer Older
Timothy J. Baek's avatar
Timothy J. Baek committed
1
<script lang="ts">
2
	import { settings, showCallOverlay } from '$lib/stores';
Timothy J. Baek's avatar
Timothy J. Baek committed
3
4
	import { onMount, tick, getContext } from 'svelte';

Timothy J. Baek's avatar
Timothy J. Baek committed
5
6
	import { blobToFile, calculateSHA256, extractSentences, findWordIndices } from '$lib/utils';
	import { synthesizeOpenAISpeech, transcribeAudio } from '$lib/apis/audio';
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
7
	import { toast } from 'svelte-sonner';
Timothy J. Baek's avatar
Timothy J. Baek committed
8
	import Tooltip from '$lib/components/common/Tooltip.svelte';
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
9

Timothy J. Baek's avatar
Timothy J. Baek committed
10
11
	const i18n = getContext('i18n');

12
	export let submitPrompt: Function;
Timothy J. Baek's avatar
Timothy J. Baek committed
13
	export let files;
14

Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
15
16
	let loading = false;
	let confirmed = false;
Timothy J. Baek's avatar
Timothy J. Baek committed
17

Timothy J. Baek's avatar
Timothy J. Baek committed
18
19
20
	let camera = false;
	let cameraStream = null;

21
	let assistantSpeaking = false;
Timothy J. Baek's avatar
Timothy J. Baek committed
22
23
	let assistantAudio = {};
	let assistantAudioIdx = null;
24

Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
25
	let rmsLevel = 0;
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
26
	let hasStartedSpeaking = false;
Timothy J. Baek's avatar
Timothy J. Baek committed
27

Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
28
29
30
31
32
33
34
	let audioContext;
	let analyser;
	let dataArray;
	let audioElement;
	let animationFrameId;

	let speechRecognition;
Timothy J. Baek's avatar
Timothy J. Baek committed
35
	let currentUtterance = null;
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

	let mediaRecorder;
	let audioChunks = [];

	const MIN_DECIBELS = -45;
	const VISUALIZER_BUFFER_LENGTH = 300;

	let visualizerData = Array(VISUALIZER_BUFFER_LENGTH).fill(0);

	const startAudio = () => {
		audioContext = new (window.AudioContext || window.webkitAudioContext)();
		analyser = audioContext.createAnalyser();
		const source = audioContext.createMediaElementSource(audioElement);
		source.connect(analyser);
		analyser.connect(audioContext.destination);
		analyser.fftSize = 32; // Adjust the fftSize
		dataArray = new Uint8Array(analyser.frequencyBinCount);
		visualize();
	};

	const visualize = () => {
		analyser.getByteFrequencyData(dataArray);
		div1Height = dataArray[1] / 2;
		div2Height = dataArray[3] / 2;
		div3Height = dataArray[5] / 2;
		div4Height = dataArray[7] / 2;
		animationFrameId = requestAnimationFrame(visualize);
	};

	// Function to calculate the RMS level from time domain data
	const calculateRMS = (data: Uint8Array) => {
		let sumSquares = 0;
		for (let i = 0; i < data.length; i++) {
			const normalizedValue = (data[i] - 128) / 128; // Normalize the data
			sumSquares += normalizedValue * normalizedValue;
		}
		return Math.sqrt(sumSquares / data.length);
	};

	const normalizeRMS = (rms) => {
		rms = rms * 10;
		const exp = 1.5; // Adjust exponent value; values greater than 1 expand larger numbers more and compress smaller numbers more
		const scaledRMS = Math.pow(rms, exp);

		// Scale between 0.01 (1%) and 1.0 (100%)
		return Math.min(1.0, Math.max(0.01, scaledRMS));
	};

	const analyseAudio = (stream) => {
		const audioContext = new AudioContext();
		const audioStreamSource = audioContext.createMediaStreamSource(stream);

		const analyser = audioContext.createAnalyser();
		analyser.minDecibels = MIN_DECIBELS;
		audioStreamSource.connect(analyser);

		const bufferLength = analyser.frequencyBinCount;

		const domainData = new Uint8Array(bufferLength);
		const timeDomainData = new Uint8Array(analyser.fftSize);

		let lastSoundTime = Date.now();
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
98
		hasStartedSpeaking = false;
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
99
100
101

		const detectSound = () => {
			const processFrame = () => {
Timothy J. Baek's avatar
Timothy J. Baek committed
102
103
104
105
106
107
108
				if (!mediaRecorder || !$showCallOverlay) {
					if (mediaRecorder) {
						mediaRecorder.stop();
					}

					return;
				}
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
109
110
111
112
113
114
115
116
117
				analyser.getByteTimeDomainData(timeDomainData);
				analyser.getByteFrequencyData(domainData);

				// Calculate RMS level from time domain data
				rmsLevel = calculateRMS(timeDomainData);

				// Check if initial speech/noise has started
				const hasSound = domainData.some((value) => value > 0);
				if (hasSound) {
Timothy J. Baek's avatar
Timothy J. Baek committed
118
					stopAllAudio();
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
					hasStartedSpeaking = true;
					lastSoundTime = Date.now();
				}

				// Start silence detection only after initial speech/noise has been detected
				if (hasStartedSpeaking) {
					if (Date.now() - lastSoundTime > 2000) {
						confirmed = true;

						if (mediaRecorder) {
							mediaRecorder.stop();
						}
					}
				}

				window.requestAnimationFrame(processFrame);
			};

			window.requestAnimationFrame(processFrame);
		};
Timothy J. Baek's avatar
Timothy J. Baek committed
139

Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
140
141
142
		detectSound();
	};

Timothy J. Baek's avatar
Timothy J. Baek committed
143
144
145
146
147
148
149
150
151
	const stopAllAudio = () => {
		if (currentUtterance) {
			speechSynthesis.cancel();
			currentUtterance = null;
		}
		if (assistantAudio[assistantAudioIdx]) {
			assistantAudio[assistantAudioIdx].pause();
			assistantAudio[assistantAudioIdx].currentTime = 0;
		}
152
153
154
155
156

		const audioElement = document.getElementById('audioElement');
		audioElement.pause();
		audioElement.currentTime = 0;

Timothy J. Baek's avatar
Timothy J. Baek committed
157
158
159
160
161
162
		assistantSpeaking = false;
	};

	const playAudio = (idx) => {
		return new Promise((res) => {
			assistantAudioIdx = idx;
163
			const audioElement = document.getElementById('audioElement');
Timothy J. Baek's avatar
Timothy J. Baek committed
164
			const audio = assistantAudio[idx];
165
166
167
168
169

			audioElement.src = audio.src; // Assume `assistantAudio` has objects with a `src` property
			audioElement.play();

			audioElement.onended = async (e) => {
Timothy J. Baek's avatar
Timothy J. Baek committed
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
				await new Promise((r) => setTimeout(r, 300));

				if (Object.keys(assistantAudio).length - 1 === idx) {
					assistantSpeaking = false;
				}

				res(e);
			};
		});
	};

	const getOpenAISpeech = async (text) => {
		const res = await synthesizeOpenAISpeech(
			localStorage.token,
			$settings?.audio?.speaker ?? 'alloy',
			text,
			$settings?.audio?.model ?? 'tts-1'
		).catch((error) => {
			toast.error(error);
			assistantSpeaking = false;
			return null;
		});

		if (res) {
			const blob = await res.blob();
			const blobUrl = URL.createObjectURL(blob);
			const audio = new Audio(blobUrl);
			assistantAudio = audio;
		}
	};

Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
201
202
203
204
205
206
207
208
209
210
211
212
	const transcribeHandler = async (audioBlob) => {
		// Create a blob from the audio chunks

		await tick();
		const file = blobToFile(audioBlob, 'recording.wav');

		const res = await transcribeAudio(localStorage.token, file).catch((error) => {
			toast.error(error);
			return null;
		});

		if (res) {
Timothy J. Baek's avatar
Timothy J. Baek committed
213
			console.log(res.text);
214

Timothy J. Baek's avatar
Timothy J. Baek committed
215
216
217
218
219
220
221
222
223
			if (res.text !== '') {
				const _responses = await submitPrompt(res.text);
				console.log(_responses);

				if (_responses.at(0)) {
					const content = _responses[0];
					if (content) {
						assistantSpeakingHandler(content);
					}
Timothy J. Baek's avatar
Timothy J. Baek committed
224
225
226
227
				}
			}
		}
	};
228

Timothy J. Baek's avatar
Timothy J. Baek committed
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
	const assistantSpeakingHandler = async (content) => {
		assistantSpeaking = true;

		if (($settings?.audio?.TTSEngine ?? '') == '') {
			currentUtterance = new SpeechSynthesisUtterance(content);
			speechSynthesis.speak(currentUtterance);
		} else if ($settings?.audio?.TTSEngine === 'openai') {
			console.log('openai');

			const sentences = extractSentences(content).reduce((mergedTexts, currentText) => {
				const lastIndex = mergedTexts.length - 1;
				if (lastIndex >= 0) {
					const previousText = mergedTexts[lastIndex];
					const wordCount = previousText.split(/\s+/).length;
					if (wordCount < 2) {
						mergedTexts[lastIndex] = previousText + ' ' + currentText;
245
					} else {
Timothy J. Baek's avatar
Timothy J. Baek committed
246
						mergedTexts.push(currentText);
247
					}
Timothy J. Baek's avatar
Timothy J. Baek committed
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
				} else {
					mergedTexts.push(currentText);
				}
				return mergedTexts;
			}, []);

			console.log(sentences);

			let lastPlayedAudioPromise = Promise.resolve(); // Initialize a promise that resolves immediately

			for (const [idx, sentence] of sentences.entries()) {
				const res = await synthesizeOpenAISpeech(
					localStorage.token,
					$settings?.audio?.speaker,
					sentence,
					$settings?.audio?.model
				).catch((error) => {
					toast.error(error);

					assistantSpeaking = false;
					return null;
				});

				if (res) {
					const blob = await res.blob();
					const blobUrl = URL.createObjectURL(blob);
					const audio = new Audio(blobUrl);
					assistantAudio[idx] = audio;
					lastPlayedAudioPromise = lastPlayedAudioPromise.then(() => playAudio(idx));
277
278
				}
			}
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
279
280
281
		}
	};

Timothy J. Baek's avatar
Timothy J. Baek committed
282
	const stopRecordingCallback = async () => {
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
283
284
285
286
		if ($showCallOverlay) {
			if (confirmed) {
				loading = true;

Timothy J. Baek's avatar
Timothy J. Baek committed
287
288
289
290
291
292
293
294
295
296
297
298
				if (cameraStream) {
					const imageUrl = takeScreenshot();

					files = [
						...files,
						{
							type: 'image',
							url: imageUrl
						}
					];
				}

Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
299
300
301
302
303
304
305
306
307
308
				const audioBlob = new Blob(audioChunks, { type: 'audio/wav' });
				await transcribeHandler(audioBlob);

				confirmed = false;
				loading = false;
			}
			audioChunks = [];
			mediaRecorder = false;

			startRecording();
Timothy J. Baek's avatar
Timothy J. Baek committed
309
310
311
		} else {
			audioChunks = [];
			mediaRecorder = false;
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
312
313
314
315
316
317
318
319
320
321
322
		}
	};

	const startRecording = async () => {
		const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
		mediaRecorder = new MediaRecorder(stream);
		mediaRecorder.onstart = () => {
			console.log('Recording started');
			audioChunks = [];
			analyseAudio(stream);
		};
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
323
324
325
326
327
		mediaRecorder.ondataavailable = (event) => {
			if (hasStartedSpeaking) {
				audioChunks.push(event.data);
			}
		};
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
328
329
330
		mediaRecorder.onstop = async () => {
			console.log('Recording stopped');

Timothy J. Baek's avatar
Timothy J. Baek committed
331
			await stopRecordingCallback();
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
332
333
334
335
		};
		mediaRecorder.start();
	};

Timothy J. Baek's avatar
Timothy J. Baek committed
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
	const startCamera = async () => {
		if (cameraStream === null) {
			camera = true;
			await tick();
			try {
				const video = document.getElementById('camera-feed');
				if (video) {
					cameraStream = await navigator.mediaDevices.getUserMedia({ video: true });
					video.srcObject = cameraStream;
					await video.play();
				}
			} catch (err) {
				console.error('Error accessing webcam: ', err);
			}
		}
	};

	const takeScreenshot = () => {
		const video = document.getElementById('camera-feed');
		const canvas = document.getElementById('camera-canvas');

		if (!canvas) {
			return;
		}

		const context = canvas.getContext('2d');
		// Make the canvas match the video dimensions
		canvas.width = video.videoWidth;
		canvas.height = video.videoHeight;
		// Draw the flipped image from the video onto the canvas
		context.save();
		context.scale(-1, 1); // Flip horizontally
		context.drawImage(video, 0, 0, video.videoWidth * -1, video.videoHeight);
		context.restore();

		// Convert the canvas to a data base64 URL and console log it
		const dataURL = canvas.toDataURL('image/png');
		console.log(dataURL);

		return dataURL;
	};

	const stopCamera = () => {
		if (cameraStream) {
			const tracks = cameraStream.getTracks();
			tracks.forEach((track) => track.stop());
		}

		cameraStream = null;
		camera = false;
	};

Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
388
389
	$: if ($showCallOverlay) {
		startRecording();
Timothy J. Baek's avatar
Timothy J. Baek committed
390
391
	} else {
		stopCamera();
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
392
393
394
395
	}
</script>

{#if $showCallOverlay}
396
	<audio id="audioElement" src="" style="display: none;" />
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
397
398
399
400
	<div class=" absolute w-full h-full flex z-[999]">
		<div
			class="absolute w-full h-full bg-white text-gray-700 dark:bg-black dark:text-gray-300 flex justify-center"
		>
Timothy J. Baek's avatar
Timothy J. Baek committed
401
			<div class="max-w-lg w-full h-screen max-h-[100dvh] flex flex-col justify-between p-6">
Timothy J. Baek's avatar
Timothy J. Baek committed
402
403
404
405
406
407
408
409
410
411
412
				{#if camera}
					<div class="flex justify-center items-center pt-2 w-full h-20">
						{#if loading}
							<svg
								class="size-12 text-gray-900 dark:text-gray-400"
								viewBox="0 0 24 24"
								fill="currentColor"
								xmlns="http://www.w3.org/2000/svg"
								><style>
									.spinner_qM83 {
										animation: spinner_8HQG 1.05s infinite;
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
413
									}
Timothy J. Baek's avatar
Timothy J. Baek committed
414
415
									.spinner_oXPr {
										animation-delay: 0.1s;
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
416
									}
Timothy J. Baek's avatar
Timothy J. Baek committed
417
418
									.spinner_ZTLf {
										animation-delay: 0.2s;
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
419
									}
Timothy J. Baek's avatar
Timothy J. Baek committed
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
									@keyframes spinner_8HQG {
										0%,
										57.14% {
											animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
											transform: translate(0);
										}
										28.57% {
											animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33);
											transform: translateY(-6px);
										}
										100% {
											transform: translate(0);
										}
									}
								</style><circle class="spinner_qM83" cx="4" cy="12" r="3" /><circle
									class="spinner_qM83 spinner_oXPr"
									cx="12"
									cy="12"
									r="3"
								/><circle class="spinner_qM83 spinner_ZTLf" cx="20" cy="12" r="3" /></svg
							>
						{:else}
							<div
								class=" {rmsLevel * 100 > 4
									? ' size-[4.5rem]'
									: rmsLevel * 100 > 2
									? ' size-16'
									: rmsLevel * 100 > 1
									? 'size-14'
									: 'size-12'}  transition-all bg-black dark:bg-white rounded-full"
							/>
						{/if}
						<!-- navbar -->
					</div>
				{/if}

				<div class="flex justify-center items-center w-full flex-1">
					{#if !camera}
						{#if loading}
							<svg
								class="size-44 text-gray-900 dark:text-gray-400"
								viewBox="0 0 24 24"
								fill="currentColor"
								xmlns="http://www.w3.org/2000/svg"
								><style>
									.spinner_qM83 {
										animation: spinner_8HQG 1.05s infinite;
									}
									.spinner_oXPr {
										animation-delay: 0.1s;
									}
									.spinner_ZTLf {
										animation-delay: 0.2s;
									}
									@keyframes spinner_8HQG {
										0%,
										57.14% {
											animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
											transform: translate(0);
										}
										28.57% {
											animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33);
											transform: translateY(-6px);
										}
										100% {
											transform: translate(0);
										}
									}
								</style><circle class="spinner_qM83" cx="4" cy="12" r="3" /><circle
									class="spinner_qM83 spinner_oXPr"
									cx="12"
									cy="12"
									r="3"
								/><circle class="spinner_qM83 spinner_ZTLf" cx="20" cy="12" r="3" /></svg
							>
						{:else}
							<div
								class=" {rmsLevel * 100 > 4
									? ' size-52'
									: rmsLevel * 100 > 2
									? 'size-48'
									: rmsLevel * 100 > 1
									? 'size-[11.5rem]'
									: 'size-44'}  transition-all bg-black dark:bg-white rounded-full"
							/>
						{/if}
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
506
					{:else}
Timothy J. Baek's avatar
Timothy J. Baek committed
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
						<div class="relative video-container w-full h-full py-6 px-2">
							<video
								id="camera-feed"
								autoplay
								class="w-full h-full object-cover object-center rounded-2xl"
							/>

							<canvas id="camera-canvas" style="display:none;" />

							<div class=" absolute top-8 left-4">
								<button
									type="button"
									class="p-1.5 text-white cursor-pointer backdrop-blur-xl bg-black/10 rounded-full"
									on:click={() => {
										stopCamera();
									}}
								>
									<svg
										xmlns="http://www.w3.org/2000/svg"
										viewBox="0 0 16 16"
										fill="currentColor"
										class="size-6"
									>
										<path
											d="M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z"
										/>
									</svg>
								</button>
							</div>
						</div>
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
537
					{/if}
Timothy J. Baek's avatar
Timothy J. Baek committed
538
539
				</div>

Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
540
541
				<div class="flex justify-between items-center pb-2 w-full">
					<div>
Timothy J. Baek's avatar
Timothy J. Baek committed
542
543
544
545
546
547
548
549
						<Tooltip content="Camera">
							<button
								class=" p-3 rounded-full bg-gray-50 dark:bg-gray-900"
								type="button"
								on:click={() => {
									startCamera();
								}}
							>
Timothy J. Baek's avatar
Timothy J. Baek committed
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
								<svg
									xmlns="http://www.w3.org/2000/svg"
									fill="none"
									viewBox="0 0 24 24"
									stroke-width="1.5"
									stroke="currentColor"
									class="size-5"
								>
									<path
										stroke-linecap="round"
										stroke-linejoin="round"
										d="M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z"
									/>
									<path
										stroke-linecap="round"
										stroke-linejoin="round"
										d="M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z"
									/>
								</svg>
							</button>
						</Tooltip>
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
571
					</div>
Timothy J. Baek's avatar
Timothy J. Baek committed
572

Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
573
					<div>
574
						<button type="button">
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
575
576
577
578
							<div class=" line-clamp-1 text-sm font-medium">
								{#if loading}
									Thinking...
								{:else}
Timothy J. Baek's avatar
Timothy J. Baek committed
579
									Listening...
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
580
581
582
583
584
585
586
587
588
589
590
591
								{/if}
							</div>
						</button>
					</div>

					<div>
						<button
							class=" p-3 rounded-full bg-gray-50 dark:bg-gray-900"
							on:click={async () => {
								showCallOverlay.set(false);
							}}
							type="button"
Timothy J. Baek's avatar
Timothy J. Baek committed
592
						>
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
593
594
595
596
597
598
599
600
601
602
603
604
							<svg
								xmlns="http://www.w3.org/2000/svg"
								viewBox="0 0 20 20"
								fill="currentColor"
								class="size-5"
							>
								<path
									d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"
								/>
							</svg>
						</button>
					</div>
Timothy J. Baek's avatar
Timothy J. Baek committed
605
606
607
608
				</div>
			</div>
		</div>
	</div>
Timothy J. Baek's avatar
refac  
Timothy J. Baek committed
609
{/if}