{#if fetching}
{/if} {#if error && !fetching}

{error === 'Novel not found' ? 'Novel Not Found' : 'Error Loading Novel'}

{error}

{/if} {#if novel && !fetching}
{#if coverSrc}
{novel.name}
{:else}
{/if}

{novel.name}

{#if novel.author}

by {novel.author.name}

{/if}
{statusLabel} {#if isNsfw} NSFW {/if} {languageLabel} {#if $isAuthenticated} {#if !canRefresh()} Updated less than 6 hours ago {/if} {/if} {#if refreshSuccess} Refresh queued {/if} {#if refreshError} {refreshError} {/if}
{#if novel.source} Source: {novel.source.name} {/if} {#if relativeTime && absoluteTime} Updated: {absoluteTime} {/if} {chapterCount} chapters
{#if displayTags.length > 0}
{#each displayTags as tag (tag.key)} {tag.displayName} {/each}
{/if}
{#if description}
{@html truncatedDescriptionHtml}
{#if isDescriptionLong} {/if}
{/if}
Chapters ({chapterCount}) Gallery ({imageCount}) Bookmarks {#if chapterCount === 0}

No chapters available yet.

{:else if isSingleVolume} {@const singleVolumeChapters = [...(sortedVolumes[0]?.chapters ?? [])].sort((a, b) => a.order - b.order)}
{#each singleVolumeChapters as chapter (chapter.id)} {@const chapterDate = chapter.lastUpdatedTime ? new Date(chapter.lastUpdatedTime) : null}
Ch. {chapter.order} {chapter.name}
{#if chapterDate} {formatRelativeTime(chapterDate)} {/if}
{/each}
{:else}
{#each sortedVolumes as volume (volume.id)} {@const volumeChapters = [...volume.chapters].sort((a, b) => a.order - b.order)}
{volume.name} ({volumeChapters.length} chapters)
{#each volumeChapters as chapter (chapter.id)} {@const chapterDate = chapter.lastUpdatedTime ? new Date(chapter.lastUpdatedTime) : null}
Ch. {chapter.order} {chapter.name}
{#if chapterDate} {formatRelativeTime(chapterDate)} {/if}
{/each}
{/each}
{/if}
{#if galleryImages.length === 0}

No images available.

{:else if galleryLoaded}
{#each galleryImages as image, index (image.src)} {/each}
{:else}
{/if}

Bookmarks coming soon.

{/if}
{#if viewerOpen && currentImage} {/if} {#if showDeleteConfirm && novel}
!deleting && (showDeleteConfirm = false)} onkeydown={(e) => e.key === 'Escape' && !deleting && (showDeleteConfirm = false)} role="dialog" aria-modal="true" aria-labelledby="delete-modal-title" tabindex="-1" >
e.stopPropagation()}>

Delete Novel

Are you sure you want to delete {novel.name}?

This will permanently delete the novel, all chapters, images, and translations. This action cannot be undone.

{#if deleteError}

{deleteError}

{/if}
{/if}