{ dispatch('update', e.detail); }} on:code={(e) => { const { lang, code } = e.detail; if ( (['html', 'svg'].includes(lang) || (lang === 'xml' && code.includes('svg'))) && !$mobile && $chatId ) { showArtifacts.set(true); showControls.set(true); } }} />
{#if floatingButtons}
{#if !floatingInput}
{ selectedText = window.getSelection().toString(); floatingInput = true; }} >
Ask
{ const selection = window.getSelection(); dispatch('select', { type: 'explain', content: selection.toString() }); // Clear selection selection.removeAllRanges(); buttonsContainerElement.style.display = 'none'; }} >
Explain
{:else}
{ if (e.key === 'Enter') { selectAskHandler(); } }} />
{ selectAskHandler(); }} >
{/if}
{/if}