{#if dragged}
{/if}
{#if autoScroll === false && messages.length > 0}
{/if}
{#if prompt.charAt(0) === '/'} {:else if prompt.charAt(0) === '#'} { console.log(e); uploadWeb(e.detail); }} on:select={(e) => { console.log(e); files = [ ...files, { type: e?.detail?.type ?? 'doc', ...e.detail, upload_status: true } ]; }} /> {:else if prompt.charAt(0) === '@'} {/if} {#if messages.length == 0 && suggestionPrompts.length !== 0} {/if}
{ if (inputFiles && inputFiles.length > 0) { const _inputFiles = Array.from(inputFiles); _inputFiles.forEach((file) => { if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) { let reader = new FileReader(); reader.onload = (event) => { files = [ ...files, { type: 'image', url: `${event.target.result}` } ]; inputFiles = null; filesInputElement.value = ''; }; reader.readAsDataURL(file); } else if ( SUPPORTED_FILE_TYPE.includes(file['type']) || SUPPORTED_FILE_EXTENSIONS.includes(file.name.split('.').at(-1)) ) { uploadDoc(file); filesInputElement.value = ''; } else { toast.error( $i18n.t( `Unknown File Type '{{file_type}}', but accepting and treating as plain text`, { file_type: file['type'] } ) ); uploadDoc(file); filesInputElement.value = ''; } }); } else { toast.error($i18n.t(`File not found.`)); } }} />
{ submitPrompt(prompt, user); }} > {#if files.length > 0}
{#each files as file, fileIdx}
{#if file.type === 'image'} input {:else if file.type === 'doc'}
{#if file.upload_status} {:else} {/if}
{file.name}
{$i18n.t('Document')}
{:else if file.type === 'collection'}
{file?.title ?? `#${file.name}`}
{$i18n.t('Collection')}
{/if}
{/each}
{/if}
{#if fileUploadEnabled}
{/if}