<?php
defined( 'ABSPATH' ) || exit;

/*-------------------------------------------------------------------------------*/
/* [ Header Flex Aside ]
/*-------------------------------------------------------------------------------*/

/**
 * Header Flex Aside Class.
 */
function wpex_header_flex_aside_class() {
	$header_style = \TotalTheme\Header\Core::style();

	$class = array(
		'wpex-flex',
		'wpex-items-center',
		'wpex-justify-end',
		'wpex-h-100',
	);

	if ( $header_style ) {
		$class[] = 'header-' . sanitize_html_class( $header_style ) . '-aside';
	}

	$visibility = get_theme_mod( 'header_flex_aside_visibility' );

	if ( ! empty( $visibility ) ) {
		$class[] = wpex_visibility_class( $visibility );
	}

	/**
	 * Filters the header aside element class.
	 *
	 * @param array $class
	 */
	$class = (array) apply_filters( 'wpex_header_flex_aside_class', $class );

	if ( $class ) {
		echo 'class="' . esc_attr( implode( ' ', $class ) ) . '"';
	}
}

/**
 * Get Header Flex Aside content.
 *
 * @todo move to TotalTheme\Header\Aside
 */
function wpex_header_flex_aside_content() {
	$content = wpex_get_translated_theme_mod( 'header_flex_aside_content' );

	/**
	 * Filters if the header flex aside content.
	 *
	 * @param string $content
	 */
	$content = apply_filters( 'wpex_header_flex_aside_content', $content );

	return $content;
}