{ if (e.target === e.currentTarget && phase !== "migrating") onClose(); }} onkeydown={(e) => { if (e.key === "Escape" && phase !== "migrating") onClose(); }}>
(e.target as HTMLImageElement).style.display = "none"} />
Source migration {sourceName} {manga.length} {manga.length === 1 ? "title" : "titles"} in library
{#if phase !== "migrating"} {/if}
{#if phase === "pick-target"}
Select destination source
{#if loadingSources}
{:else if allSources.length === 0}
No other sources installed.
{:else} {#if hasMultipleLangs}
{#each availableLangs as lang} {/each}
{/if}
{#each visibleSources as src} {/each}
{/if} {:else if phase === "review" || phase === "migrating" || phase === "done"}
(e.target as HTMLImageElement).style.display = "none"} />
{sourceName}
{#if targetSource}
(e.target as HTMLImageElement).style.display = "none"} />
{targetSource.displayName}
{/if}
{#if phase === "review"}
{#if searchProgress.done < searchProgress.total} Searching {searchProgress.done + 1} / {searchProgress.total}… {:else} {foundCount} found · {noMatchCount} no match {/if}
{:else if phase === "migrating"}
Migrating {migrateProgress.done} / {migrateProgress.total}…
{:else}
{migratedCount} migrated{failedCount > 0 ? ` · ${failedCount} failed` : ""}
{/if}
{#each entries as entry, idx}
{entry.manga.title} {#if entry.status === "found" && entry.match} {entry.match.title} {Math.round(entry.similarity * 100)}% {:else if entry.status === "no-match"} No match found {:else if entry.status === "searching"} Searching… {:else if entry.status === "migrated"} Migrated {:else if entry.status === "failed"} {entry.error ?? "Failed"} {/if}
{#if entry.status === "searching"} {:else if entry.status === "found"}
{#if phase === "review"} {/if} {:else if entry.status === "migrated"} {:else if entry.status === "failed"} {/if}
{/each}
{#if phase === "review" && searchProgress.done === searchProgress.total}
{/if} {#if phase === "done"}
{/if} {/if}