{#if _citations.length > 0}
{#if _citations.length <= 3} {#each _citations as citation, idx}
{/each} {:else}
{#if _citations.length > 1 && _citations .slice(0, 2) .reduce((acc, citation) => acc + citation.source.name.length, 0) <= 50} {#each _citations.slice(0, 2) as citation, idx}
{#if idx === 0}, {/if}
{/each} {:else} {#each _citations.slice(0, 1) as citation, idx}
{/each} {/if}
{_citations.length - (_citations.length > 1 && _citations .slice(0, 2) .reduce((acc, citation) => acc + citation.source.name.length, 0) <= 50 ? 2 : 1)} {$i18n.t('more')}
{#if isCollapsibleOpen} {:else} {/if}
{#each _citations as citation, idx}
{/each}
{/if}
{/if}