{#if loading}

Loading event...

{:else if error}

Error: {error}

{:else if rootEvent}
{#if rootEvent.kind === 30040} {@const titleTag = rootEvent.tags.find(t => t[0] === 'title')} {@const authorTag = rootEvent.tags.find(t => t[0] === 'author')} {@const typeTag = rootEvent.tags.find(t => t[0] === 'type')} {@const versionTag = rootEvent.tags.find(t => t[0] === 'version')} {@const publishedOnTag = rootEvent.tags.find(t => t[0] === 'published_on')} {@const publishedByTag = rootEvent.tags.find(t => t[0] === 'published_by')} {@const imageTag = rootEvent.tags.find(t => t[0] === 'image')} {@const summaryTag = rootEvent.tags.find(t => t[0] === 'summary')} {@const sourceTag = rootEvent.tags.find(t => t[0] === 'source')} {@const iTags = rootEvent.tags.filter(t => t[0] === 'i')} {@const tTags = rootEvent.tags.filter(t => t[0] === 't')} {@const pTag = rootEvent.tags.find(t => t[0] === 'p')} {@const ETag = rootEvent.tags.find(t => t[0] === 'E')} {#if titleTag && titleTag[1]}

{titleTag[1]}

{/if}
{#if authorTag && authorTag[1]}

Author: {authorTag[1]}

{/if} {#if typeTag && typeTag[1]}

Type: {typeTag[1]}

{/if} {#if versionTag && versionTag[1]}

Version: {versionTag[1]}

{/if} {#if publishedOnTag && publishedOnTag[1]}

Published: {publishedOnTag[1]} {#if publishedByTag && publishedByTag[1]} by {publishedByTag[1]} {/if}

{:else if publishedByTag && publishedByTag[1]}

Published by: {publishedByTag[1]}

{/if} {#if iTags.length > 0} {@const plural = iTags.length > 1 ? 's' : ''}

Identifier{plural}: {#each iTags as iTag, index} {iTag[1]}{#if index < iTags.length - 1}, {/if} {/each}

{/if} {#if tTags.length > 0} {@const plural = tTags.length > 1 ? 's' : ''}

Topic{plural}: {#each tTags as tTag} {tTag[1]} {/each}

{/if} {#if sourceTag && sourceTag[1]}

Source: {sourceTag[1]}

{/if} {#if summaryTag && summaryTag[1]}

{summaryTag[1]}

{/if} {#if imageTag && imageTag[1]}
Cover image for {titleTag?.[1] || 'publication'}
{/if} {#if pTag && pTag[1]}

Original author: {pTag[1]} {#if ETag && ETag[1]} (derivative work) {/if}

{/if}
{/if} {#if isMetadataOnly}
{:else if isEventIndex}
{#if loadingIndex}

Loading event index hierarchy... ({eventIndexItems.length} loaded so far)

{:else if indexError}

Error: {indexError}

{:else if eventIndexItems.length === 0 && missingEvents.length === 0}

No events found in index

{:else} {#if missingEvents.length > 0}
{#each missingEvents as missing (missing.order)}

This event {missing.dTag} is missing.

{/each}
{/if} {#if eventIndexItems.length > 0} {#snippet renderIndexItems(items: EventIndexItem[], parentLevel: number = 0)} {#each items as item (item.event.id)}
{#if item.event.kind === 30040} {@const indexTitleTag = item.event.tags.find(t => t[0] === 'title')} {#if indexTitleTag && indexTitleTag[1]} {@const headingLevel = Math.min(2 + item.level, 6)} {@const textSize = item.level === 0 ? 'xl' : item.level === 1 ? 'lg' : 'base'} {#if headingLevel === 2}

{indexTitleTag[1]}

{:else if headingLevel === 3}

{indexTitleTag[1]}

{:else if headingLevel === 4}

{indexTitleTag[1]}

{:else if headingLevel === 5}
{indexTitleTag[1]}
{:else}
{indexTitleTag[1]}
{/if} {/if} {#if item.children && item.children.length > 0}
{@render renderIndexItems(item.children, item.level)}
{/if} {:else} {#if item.event.kind === 30041 || item.event.kind === 1 || item.event.kind === 30817} {@const chapterTitleTag = item.event.tags.find(t => t[0] === 'title')} {#if chapterTitleTag && chapterTitleTag[1]}

{chapterTitleTag[1]}

{/if} {/if}
{#if item.children && item.children.length > 0}
{@render renderIndexItems(item.children, item.level)}
{/if} {/if}
{/each} {/snippet} {#if Virtualizer && totalItemCount > 100 && eventIndexItems.every(item => !item.children || item.children.length === 0)} {#if Virtualizer} {@const V = Virtualizer}
virtualizerContainer} estimateSize={() => 200} overscan={5} > {@render renderIndexItems(eventIndexItems)}
{/if} {:else}
{@render renderIndexItems(eventIndexItems)}
{/if} {/if} {/if}
{:else}
{#if rootEvent && !isMetadataOnly}
{/if} {/if}
{:else}

Event not found

{/if}