<?php
/**
 * Template Name: Lost Password Confirmation
 */

if (!defined('ABSPATH')) {
  exit;
}

$custausu_tpl_lang = function_exists('custausu_auth_pages_frontend_route_lang') ? custausu_auth_pages_frontend_route_lang() : 'en';
if (function_exists('custausu_auth_template_header')) { custausu_auth_template_header(); } else { get_header(); }
?>



<div class="reset-confirm-wrapper">
  <div class="custom-auth-anim">
    <?php
$custausu_tpl_lang = function_exists('custausu_lang') ? custausu_lang() : 'en';
?>
<h2>
  <?php
  if (function_exists('custausu_asset_img_html')) {
    echo wp_kses(
      custausu_asset_img_html('check_gif', [
        'width' => '80',
        'class' => 'custausu-reset-confirm__check-image',
        'alt'   => 'check',
      ]),
      [
        'img' => [
          'src'      => true,
          'alt'      => true,
          'width'    => true,
          'height'   => true,
                    'class'    => true,
          'loading'  => true,
          'decoding' => true,
        ],
      ],
      ['http', 'https', 'data']
    );
  } else {
    $custausu_tpl_check_gif = function_exists('custausu_config') ? (string) custausu_config('assets.checkgif_url', '') : '';
    if ($custausu_tpl_check_gif !== '') {
      printf(
        '<img src="%s" width="80" class="custausu-reset-confirm__check-image" alt="%s">',
        esc_url($custausu_tpl_check_gif),
        esc_attr__('check', 'custom-auth-suite')
      );
    }
  }
  ?>
  <?php esc_html_e('Check Your eMail', 'custom-auth-suite'); ?>
</h2>
    <p><?php esc_html_e('Visit the link you just received to begin the password reset process.', 'custom-auth-suite'); ?></p>

    <?php
    $custausu_tpl_login_url = function_exists('custausu_route_url')
      ? custausu_route_url('login', $custausu_tpl_lang, wp_login_url())
      : wp_login_url();

    $custausu_tpl_login_url_is_home = function_exists('home_url') && function_exists('untrailingslashit')
      ? (untrailingslashit((string) $custausu_tpl_login_url) === untrailingslashit((string) home_url('/')))
      : false;

    if ($custausu_tpl_login_url_is_home && function_exists('custausu_auth_page_find_by_template')) {
      $custausu_tpl_login_page_id = (int) custausu_auth_page_find_by_template('login');

      if ($custausu_tpl_login_page_id > 0) {
        $custausu_tpl_login_permalink = get_permalink($custausu_tpl_login_page_id);

        if (is_string($custausu_tpl_login_permalink) && $custausu_tpl_login_permalink !== '') {
          $custausu_tpl_login_url = $custausu_tpl_login_permalink;
        }
      }
    }
    ?>
    <a class="back-login" href="<?php echo esc_url($custausu_tpl_login_url); ?>">
        <?php esc_html_e('Back to Login', 'custom-auth-suite'); ?>
    </a>
  </div>
</div>

<?php if (function_exists('custausu_auth_template_footer')) { custausu_auth_template_footer(); } else { get_footer(); } ?>