<?php

$authLogoHref = isset($authLogoHref) && is_string($authLogoHref) ? trim($authLogoHref) : '';
$authLogoUrl = appAuthLogoUrl();
if ($authLogoUrl === '') {
    return;
}

// Offer both theme variants via data-* so the client can swap without reload.
$authLogoLight = function_exists('appTenantLogoUrl') ? appTenantLogoUrl(null, 'light') : $authLogoUrl;
$authLogoDark = function_exists('appTenantLogoUrl') ? appTenantLogoUrl(null, 'dark') : $authLogoUrl;
?>
<div class="login-logo">
    <?php if ($authLogoHref !== ''): ?>
        <a href="<?php e($authLogoHref); ?>" class="login-logo-link">
            <img src="<?php e($authLogoUrl); ?>"
                data-theme-src
                data-src-light="<?php e($authLogoLight); ?>"
                data-src-dark="<?php e($authLogoDark); ?>"
                alt="<?php e(appTitle()); ?>" class="login-logo-img">
        </a>
    <?php else: ?>
        <img src="<?php e($authLogoUrl); ?>"
            data-theme-src
            data-src-light="<?php e($authLogoLight); ?>"
            data-src-dark="<?php e($authLogoDark); ?>"
            alt="<?php e(appTitle()); ?>" class="login-logo-img">
    <?php endif; ?>
</div>
