{#if loading}
{:else if loadError} {:else} {#if isOwnerMember} {:else if !canEdit} {/if}

{i18n.t("settings.permissions.summary", { allowed: summary.allowed, total: summary.total })}

{#if !readOnly}
{/if}
{#if visibleSections.length === 0}

{i18n.t("settings.permissions.noMatches")}

{/if} {#each visibleSections as section (section.id)}

{sectionLabel(section.id)}

{#each section.entries as entry (entry.key)} {@const allowed = entry.plan_allowed && !isDenied(denied, entry.key)} {@const locked = !entry.plan_allowed}
toggle(entry.key, !allowed)} /> {#if locked} {i18n.t("settings.permissions.planLocked")} {/if}
{/each}
{/each}
{/if}
{#snippet footer()} {#if !readOnly} {/if} {/snippet}