{#each sources as src, i}
{@const tag = langTag(src.displayName)}
{/each}
{/if}
{/if}
{#if !inPicker}
{#if loading}
{:else if prefs.length === 0}
No configurable settings.
{:else}
{#each prefs as pref, i}
{@const title = getTitle(pref)}
{@const summary = getSummary(pref)}
{@const isSaving = saving === pref.key}
{#if pref.type === "CheckBoxPreference" || pref.type === "SwitchPreference"}
{@const checked = getBoolValue(pref)}
-
{title}
{#if summary}{summary}{/if}
{:else if pref.type === "ListPreference"}
{@const current = getListValue(pref)}
-
{title}
{#if summary}{summary}{/if}
{#if listOpen === pref.key}
{#each (pref.entries ?? []) as entry, j}
{@const val = pref.entryValues?.[j] ?? entry}
{/each}
{/if}
{:else if pref.type === "EditTextPreference"}
{#if editKey === pref.key}
-
{#if pref.dialogTitle}{pref.dialogTitle}{/if}
{#if pref.dialogMessage}{pref.dialogMessage}{/if}
{ if (e.key === "Enter") submitEdit(i); if (e.key === "Escape") editKey = null; }} />
{:else}
-
{/if}
{:else if pref.type === "MultiSelectListPreference"}
{@const selected = getMultiValue(pref)}
-
{title}
{#if summary}{summary}{/if}
{#each (pref.entries ?? []) as entry, j}
{@const val = pref.entryValues?.[j] ?? entry}
{@const on = selected.includes(val)}
{/each}
{/if}
{/each}
{/if}
{/if}