<?php
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template files receive local context variables from their controller.
namespace SPAATG;

use SPAATG\Helper\UiHelper;

if ( ! defined( 'ABSPATH' ) ) {
 exit; // Exit if accessed directly.
}

$settings = \wpSPAATG()->settings();
?>
<section class="panel process" data-panel="process" >
  <div class="panel-container">

  <?php $this->loadView('bulk/part-progressbar', false, ['part' => 'process']); ?>


    <div class='process_heading'>
    <h3 class="heading">
      <?php esc_html_e('ShortPixel AI SEO bulk process is in progress','shortpixel-ai-alt-text-generator'); ?>
    </h3>

	    <p class='description'>
	      <?php esc_html_e('ShortPixel is generating AI SEO data for your images. Please keep this window open to complete the process.', 'shortpixel-ai-alt-text-generator'); ?>
	    </p>


    </div>


		<!--- ###### MEDIA ###### -->
		<span class='hidden' data-check-media-total data-stats-media="total">0</span>
    <div class='bulk-summary' data-check-visibility data-control="data-check-media-total">
      <div class='heading'>
        <span><i class='dashicons dashicons-format-image'>&nbsp;</i> <?php esc_html_e('Media Library' ,'shortpixel-ai-alt-text-generator'); ?>
	              <?php /* translators: %s: media items count. */ ?>
	              <?php printf(esc_html__('( %1$s items )', 'shortpixel-ai-alt-text-generator'), '<i data-stats-media="total">--</i>'); ?>
	        <?php if (false !== $this->view->customOperationMedia) {
	            echo '</br><span class="special-op">' . esc_html($this->view->customOperationMedia) . '</span>';
	         } ?>
        </span>
        <span>
              <span class='line-progressbar'>
                <span class='done-text'><i data-stats-media="percentage_done"></i> %</span>
                <span class='done' data-stats-media="percentage_done" data-presentation="css.width.percentage"></span>

              </span>
							<span class='dashicons spin dashicons-update line-progressbar-spinner' data-check-visibility data-control="data-check-media-in_process">&nbsp;</span>

        </span>
        <span><?php esc_html_e('Processing', 'shortpixel-ai-alt-text-generator') ?>: <i data-stats-media="in_process" data-check-media-in_process >0</i></span>
      </div>

      <div>
        <span><?php esc_html_e('Processed', 'shortpixel-ai-alt-text-generator'); ?>: <i data-stats-media="done">0</i></span>

        <span><?php esc_html_e('Waiting','shortpixel-ai-alt-text-generator'); ?>: <i data-stats-media="in_queue">0</i></span>
        <span><?php esc_html_e('Errors','shortpixel-ai-alt-text-generator') ?>: <i data-check-media-fatalerrors data-stats-media="fatal_errors" class='error'>0 </i>
					<span class="display-error-box" data-check-visibility data-control="data-check-media-fatalerrors" ><label title="<?php esc_html_e('Show Errors', 'shortpixel-ai-alt-text-generator'); ?>">
						<input type="checkbox" name="show-errors" value="show" data-action='ToggleErrorBox' data-errorbox='media' data-event='change'>
						<span><?php esc_html_e('Show Errors','shortpixel-ai-alt-text-generator'); ?></span>
	            <span class='collap-arrow'><?php echo wp_kses(UIHelper::getIcon('res/images/icon/chevron.svg'), array('img' => array('src' => array(), 'class' => array(), 'width' => array(), 'height' => array(), 'alt' => array()))); ?></span>

            </label>
				 </span>

				</span>


      </div>

    </div>

		<div data-error-media="message" data-presentation="append" class='errorbox media'>
				<?php if(property_exists($this->view, 'mediaErrorLog') && $this->view->mediaErrorLog !== false)
				{
						echo wp_kses_post($this->view->mediaErrorLog);
				}
				?>
		</div>

		<nav>
			<button class='button stop' type='button' data-action="StopBulk" >
          <span class='dashicons dashicons-no'></span>  
					<?php esc_html_e('Stop Bulk Processing' ,'shortpixel-ai-alt-text-generator'); ?>
			</button>
			<button class='button pause' type='button' data-action="PauseBulk" id="PauseBulkButton">
        <span class='dashicons dashicons-controls-pause'></span>  
				<?php esc_html_e('Pause Bulk Processing' ,'shortpixel-ai-alt-text-generator') ?>
			</button>
			<button class='button button-primary resume' type='button' data-action='ResumeBulk' id="ResumeBulkButton">
         <span class='dashicons dashicons-controls-play'></span>  
				<?php esc_html_e('Resume Bulk Processing','shortpixel-ai-alt-text-generator'); ?>
			</button>

		</nav>

		<div id="preloader" class="hidden">

  	</div>

</section>
