<?php
/**
 * Template library templates
 */

defined( 'ABSPATH' ) || exit;

?>
<script type="text/template" id="ci-elementor-template-library-header-logo">
	<span class="ci-elementor-template-library-logo-wrap">
	</span>
	<span class="ci-elementor-template-library-logo-title">{{{ title }}}</span>
</script>

<script type="text/template" id="ci-elementor-template-library-header-back">
	<i class="eicon-" aria-hidden="true"></i>
	<span><?php esc_html_e( 'Back to Library', 'ignition-elementor-widgets' ); ?></span>
</script>

<script type="text/template" id="ci-elementor-template-library-header-menu">
	<# _.each( tabs, function( args, tab ) { var activeClass = args.active ? 'elementor-active' : ''; #>
		<div class="elementor-component-tab elementor-template-library-menu-item {{activeClass}}" data-tab="{{{ tab }}}">{{{ args.title }}}</div>
	<# } ); #>
</script>

<script type="text/template" id="ci-elementor-template-library-header-menu-responsive">
	<div class="elementor-component-tab ci-elementor-template-library-responsive-menu-item elementor-active" data-tab="desktop">
		<i class="eicon-device-desktop" aria-hidden="true" title="<?php esc_attr_e( 'Desktop view', 'ignition-elementor-widgets' ); ?>"></i>
		<span class="elementor-screen-only"><?php esc_html_e( 'Desktop view', 'ignition-elementor-widgets' ); ?></span>
	</div>
	<div class="elementor-component-tab ci-elementor-template-library-responsive-menu-item" data-tab="tab">
		<i class="eicon-device-tablet" aria-hidden="true" title="<?php esc_attr_e( 'Tab view', 'ignition-elementor-widgets' ); ?>"></i>
		<span class="elementor-screen-only"><?php esc_html_e( 'Tab view', 'ignition-elementor-widgets' ); ?></span>
	</div>
	<div class="elementor-component-tab ci-elementor-template-library-responsive-menu-item" data-tab="mobile">
		<i class="eicon-device-mobile" aria-hidden="true" title="<?php esc_attr_e( 'Mobile view', 'ignition-elementor-widgets' ); ?>"></i>
		<span class="elementor-screen-only"><?php esc_html_e( 'Mobile view', 'ignition-elementor-widgets' ); ?></span>
	</div>
</script>

<script type="text/template" id="ci-elementor-template-library-header-actions">
		<# if ( ciet.library.getButtons() ) { var button = ciet.library.getButtons()[0]; #>
			<# if ( 'disabled-showcase' === button ) { #>
				<a class="elementor-template-library-template-action elementor-button ci-elementor-template-library-more-button" href="https://cssigniter.com/elementor-templates/">
					<i class="eicon-external-link-square" aria-hidden="true"></i>
					<span class="elementor-button-title"><?php esc_html_e( 'Learn more', 'ignition-elementor-widgets' ); ?></span>
				</a>
			<# } else if ( 'disabled-partial' === button ) { #>
				<a class="elementor-template-library-template-action elementor-button ci-elementor-template-library-more-button" href="https://cssigniter.com/themes/">
					<i class="eicon-external-link-square" aria-hidden="true"></i>
					<span class="elementor-button-title"><?php esc_html_e( 'More templates', 'ignition-elementor-widgets' ); ?></span>
				</a>
			<# } #>
		<# } #>
	<div id="ci-elementor-template-library-header-sync" class="elementor-templates-modal__header__item">
		<i class="eicon-sync" aria-hidden="true" title="<?php esc_attr_e( 'Sync Library', 'ignition-elementor-widgets' ); ?>"></i>
		<span class="elementor-screen-only"><?php esc_html_e( 'Sync Library', 'ignition-elementor-widgets' ); ?></span>
	</div>
</script>

<script type="text/template" id="ci-elementor-template-library-preview">
	<iframe></iframe>
</script>

<script type="text/template" id="ci-elementor-template-library-header-insert">
	<div id="elementor-template-library-header-preview-insert-wrapper" class="elementor-templates-modal__header__item">
		{{{ obj.isAvailable ? ciet.library.getModal().getTemplateActionButton( obj ) : null }}}
	</div>
</script>

<script type="text/template" id="ci-elementor-template-library-insert-button">
	<a class="elementor-template-library-template-action elementor-button ci-elementor-template-library-insert-button">
		<i class="eicon-file-download" aria-hidden="true"></i>
		<span class="elementor-button-title"><?php esc_html_e( 'Insert', 'ignition-elementor-widgets' ); ?></span>
	</a>
</script>

<script type="text/template" id="ci-elementor-template-library-loading">
	<div class="elementor-loader-wrapper">
		<div class="elementor-loader">
			<div class="elementor-loader-boxes">
				<div class="elementor-loader-box"></div>
				<div class="elementor-loader-box"></div>
				<div class="elementor-loader-box"></div>
				<div class="elementor-loader-box"></div>
			</div>
		</div>
		<div class="elementor-loading-title"><?php esc_html_e( 'Loading', 'ignition-elementor-widgets' ); ?></div>
	</div>
</script>

<script type="text/template" id="ci-elementor-template-library-templates">
	<?php if ( ! function_exists( 'CSSIgniter_Updater' ) ) : ?>
		<div class="ci-elementor-template-notice"><?php	echo wp_kses_post( sprintf(
			/* translators: 1) CSSIgniter downloads page URL, 2) Plugin documentation URL. */
			__( 'The CSSIgniter Connector plugin was not found. Please <a href="%1$s" target="_blank">download</a> and <a href="%2$s" target="_blank">configure</a> it to access the Elementor templates.', 'ignition-elementor-widgets' ),
			'https://www.cssigniter.com/download/',
			'https://www.cssigniter.com/docs/ignition-elementor-widgets/#import-elementor-page-templates'
		) ); ?></div>
	<?php endif; ?>
	<div id="ci-elementor-template-library-toolbar">
		<div id="ci-elementor-template-library-toolbar-filter" class="ci-elementor-template-library-toolbar-filter">
			<# if (ciet.library.getTypeTags()) { var selectedTag = ciet.library.getFilter( 'tags' ); #>
				<# if ( selectedTag ) { #>
				<span class="ci-elementor-template-library-filter-btn">{{{ ciet.library.getTags()[selectedTag] }}} <i class="eicon-caret-right"></i></span>
				<# } else { #>
				<span class="ci-elementor-template-library-filter-btn"><?php esc_html_e( 'Filter', 'ignition-elementor-widgets' ); ?> <i class="eicon-caret-right"></i></span>
				<# } #>
				<ul id="ci-elementor-template-library-filter-tags" class="ci-elementor-template-library-filter-tags">
					<li data-tag="">All</li>
					<# _.each(ciet.library.getTypeTags(), function(slug) {
						var selected = selectedTag === slug ? 'active' : '';
						#>
						<li data-tag="{{ slug }}" class="{{ selected }}">{{{ ciet.library.getTags()[slug] }}}</li>
					<# } ); #>
				</ul>
			<# } #>
		</div>
		<div id="ci-elementor-template-library-toolbar-counter"></div>
		<div id="ci-elementor-template-library-toolbar-search">
			<label for="ci-elementor-template-library-search" class="elementor-screen-only"><?php esc_html_e( 'Search Templates:', 'ignition-elementor-widgets' ); ?></label>
			<input id="ci-elementor-template-library-search" placeholder="<?php esc_attr_e( 'Search', 'ignition-elementor-widgets' ); ?>">
			<i class="eicon-search"></i>
		</div>
	</div>

	<div class="ci-elementor-template-library-templates-window">
		<div id="ci-elementor-template-library-templates-list"></div>
	</div>
</script>

<script type="text/template" id="ci-elementor-template-library-template">
	<div class="ci-elementor-template-library-template-body ci-elementor-template-user-is-{{{ obj.isAvailable ? 'active' : 'inactive'}}}" id="ci-elementor-template-{{ template_id }}">
		<div class="ci-elementor-template-library-template-preview">
			<i class="eicon-zoom-in-bold" aria-hidden="true"></i>
		</div>
		<img class="ci-elementor-template-library-template-thumbnail" src="{{ thumbnail }}">
	</div>
	<div class="ci-elementor-template-library-template-footer">
		{{{ obj.isAvailable ? ciet.library.getModal().getTemplateActionButton( obj ) : '' }}}
		<div class="elementor-template-library-template-name">{{{ title }}}</div>
		<a href="#" class="elementor-button ci-elementor-template-library-preview-button">
			<i class="eicon-device-desktop" aria-hidden="true"></i>
			<?php esc_html_e( 'Preview', 'ignition-elementor-widgets' ); ?>
		</a>
	</div>
</script>

<script type="text/template" id="ci-elementor-template-library-empty">
	<div class="elementor-template-library-blank-icon">
		<img src="<?php echo esc_url_raw( ELEMENTOR_ASSETS_URL ) . 'images/no-search-results.svg'; ?>" class="elementor-template-library-no-results" />
	</div>
	<div class="elementor-template-library-blank-title"></div>
	<div class="elementor-template-library-blank-message"></div>
	<div class="elementor-template-library-blank-footer">
		<?php esc_html_e( 'Want to learn more about our themes?', 'ignition-elementor-widgets' ); ?>
		<a class="elementor-template-library-blank-footer-link" href="https://cssigniter.com/" target="_blank"><?php esc_html_e( 'Click here', 'ignition-elementor-widgets' ); ?></a>
	</div>
</script>
