{#if themesLoading || settingsLoading} {at("loading", {}, "Загрузка…")} {:else}

{at("appearance_brand_title", {}, "Логотип")}

{at( "appearance_brand_sub", {}, "Файл, ссылка или подтвержденный emoji-логотип" )}
{#if dirtyCount} {at("settings_dirty_count", { count: dirtyCount }, `Изменений: ${dirtyCount}`)} {/if} {settingsSaving || themesSaving ? at("btn_saving", {}, "Сохранение...") : at("btn_save", {}, "Сохранить")}
{#if !useEmojiLogo && previewLogoUrl && !logoPreviewFailed} { logoPreviewFailed = true; }} /> {:else if useEmojiLogo} {:else} {/if}
logoFileInput?.click()} disabled={themesSaving} > {at("appearance_logo_upload_file", {}, "Загрузить файл")}
{at("appearance_logo_upload_url", {}, "По ссылке")}
setAppearanceValue("WEBAPP_LOGO_EMOJI", event.currentTarget.value)} /> setAppearanceValue("WEBAPP_LOGO_EMOJI_FONT", value)} />
{#if previewFaviconUrl && !faviconPreviewFailed} { faviconPreviewFailed = true; }} /> {:else if !useCustomFavicon && useEmojiLogo} {:else} {/if}
faviconFileInput?.click()} disabled={themesSaving} > {at("appearance_favicon_upload_file", {}, "Загрузить favicon")}
{at("appearance_favicon_upload_url", {}, "По ссылке")}

{at("appearance_themes_title", {}, "Темы")}

{at( "appearance_themes_sub", {}, "Глобальная тема, accent color и предпросмотр" )}
{at("btn_refresh", {}, "Обновить")} {at("btn_save", {}, "Сохранить")}
{#if !themesCatalog.themes.length} {at( "themes_catalog_empty", {}, "Каталог пуст. Добавьте папку темы в data/themes и обновите список." )} {:else}
{#each themesCatalog.themes as theme (theme.key)} {@const isCurrent = theme.key === activeKey}
selectTheme(theme, event)} onkeydown={(event) => handleThemeKeydown(event, theme)} > {themeTitle(theme)} {#if isCurrent} {at("status_current", {}, "Текущая")} {/if} {theme.key} {themeDescription(theme)}
previewTheme(event, theme)} > {at("appearance_preview_theme", {}, "Предпросмотр")}
{/each}
{/if}
{/if}