{#snippet eventRow(e: CalEvent)}
  • {#if selecting} {/if} {#if e.include} {:else} {/if}
    {#if editing === e.id} (editing = null)} ondelete={remove(e.id)} /> {/if}
  • {/snippet} {#snippet group(title: string, list: CalEvent[], note: string)} {#if list.length}

    {title} ({list.length})

    {#if note}

    {note}

    {/if} {/if} {/snippet}
    {#if scan.image_keys.length}
    {`Page {#if activeBox && scan.events.find((e) => e.id === active)?.page === page}
    {/if}
    {:else}

    The photo has been deleted.

    {/if}
    {#if scan.image_keys.length > 1} {#each scan.image_keys as _, i} {/each} {/if}
    {#if selecting}

    {selected.length} selected

    {/if} {#if editing === 'new'}

    New event

    s.id === scan.source_id)?.child_ids ?? [] }} onsave={add} oncancel={() => (editing = null)} />
    {/if} {#if view === 'grid'}

    Tap a day to add an event.

    {#each months as month} e.include)} {colorFor} onday={addOn} /> {/each} {:else} {#if !live.length && !scan.menu_items.length}

    Nothing was found on this page. Add events by hand, or discard the scan.

    {/if} {@render group('Needs a look', needs, 'Each one says why. Tap to see where it came from on the photo.')} {@render group('Updated', updated, 'Already on your calendar; publishing applies these changes.')} {@render group('New', fresh, '')} {#if unchanged.length} {#if open.unchanged}
      {#each unchanged as e (e.id)}{@render eventRow(e)}{/each}
    {/if} {/if} {#if excluded.length} {#if open.excluded}
      {#each excluded as e (e.id)}{@render eventRow(e)}{/each}
    {/if} {/if} {#if scan.menu_items.length}

    Menu ({scan.menu_items.length} days{flaggedMenu ? `, ${flaggedMenu} need a look` : ''})

    One food per line. Your kids pick lunch days on the Lunch screen after you publish.

      {#each scan.menu_items as m (m.id)} {@const text = m.items.join('\n')} {/each}
    {/if} {/if}