403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.46
Web Server : Apache
System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : infrafs ( 43850)
PHP Version : 8.2.29
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/i/n/f/infrafs/INFRABIKEIT/wp-content/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/i/n/f/infrafs/INFRABIKEIT/wp-content/plugins/inc.tar
class-envato-market-github.php000064400000023041151327206010012412 0ustar00<?php
/**
 * Envato Market Github class.
 *
 * @package Envato_Market
 */

if ( ! class_exists( 'Envato_Market_Github' ) ) :

	/**
	 * Creates the connection between Github to install & update the Envato Market plugin.
	 *
	 * @class Envato_Market_Github
	 * @version 1.0.0
	 * @since 1.0.0
	 */
	class Envato_Market_Github {

		/**
		 * Action nonce.
		 *
		 * @type string
		 */
		const AJAX_ACTION = 'envato_market_dismiss_notice';

		/**
		 * The single class instance.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var object
		 */
		private static $_instance = null;

		/**
		 * The API URL.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var string
		 */
		private static $api_url = 'https://envato.github.io/wp-envato-market/dist/update-check.json';

		/**
		 * The Envato_Market_Items Instance
		 *
		 * Ensures only one instance of this class exists in memory at any one time.
		 *
		 * @see Envato_Market_Github()
		 * @uses Envato_Market_Github::init_actions() Setup hooks and actions.
		 *
		 * @since 1.0.0
		 * @static
		 * @return object The one true Envato_Market_Github.
		 * @codeCoverageIgnore
		 */
		public static function instance() {
			if ( is_null( self::$_instance ) ) {
				self::$_instance = new self();
				self::$_instance->init_actions();
			}
			return self::$_instance;
		}

		/**
		 * A dummy constructor to prevent this class from being loaded more than once.
		 *
		 * @see Envato_Market_Github::instance()
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function __construct() {
			/* We do nothing here! */
		}

		/**
		 * You cannot clone this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __clone() {
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * You cannot unserialize instances of this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __wakeup() {
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * Setup the actions and filters.
		 *
		 * @uses add_action() To add actions.
		 * @uses add_filter() To add filters.
		 *
		 * @since 1.0.0
		 */
		public function init_actions() {

			// Bail outside of the WP Admin panel.
			if ( ! is_admin() ) {
				return;
			}

			add_filter( 'http_request_args', array( $this, 'update_check' ), 5, 2 );
			add_filter( 'plugins_api', array( $this, 'plugins_api' ), 10, 3 );
			add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'update_plugins' ) );
			add_filter( 'pre_set_transient_update_plugins', array( $this, 'update_plugins' ) );
			add_filter( 'site_transient_update_plugins', array( $this, 'update_state' ) );
			add_filter( 'transient_update_plugins', array( $this, 'update_state' ) );
			add_action( 'admin_notices', array( $this, 'notice' ) );
			add_action( 'wp_ajax_' . self::AJAX_ACTION, array( $this, 'dismiss_notice' ) );
		}

		/**
		 * Check Github for an update.
		 *
		 * @since 1.0.0
		 *
		 * @return false|object
		 */
		public function api_check() {
			$raw_response = wp_remote_get( self::$api_url );
			if ( is_wp_error( $raw_response ) ) {
				return false;
			}

			if ( ! empty( $raw_response['body'] ) ) {
				$raw_body = json_decode( $raw_response['body'], true );
				if ( $raw_body ) {
					return (object) $raw_body;
				}
			}

			return false;
		}

		/**
		 * Disables requests to the wp.org repository for Envato Market.
		 *
		 * @since 1.0.0
		 *
		 * @param array  $request An array of HTTP request arguments.
		 * @param string $url The request URL.
		 * @return array
		 */
		public function update_check( $request, $url ) {

			// Plugin update request.
			if ( false !== strpos( $url, '//api.wordpress.org/plugins/update-check/1.1/' ) ) {

				// Decode JSON so we can manipulate the array.
				$data = json_decode( $request['body']['plugins'] );

				// Remove the Envato Market.
				unset( $data->plugins->{'envato-market/envato-market.php'} );

				// Encode back into JSON and update the response.
				$request['body']['plugins'] = wp_json_encode( $data );
			}

			return $request;
		}

		/**
		 * API check.
		 *
		 * @since 1.0.0
		 *
		 * @param bool   $api Always false.
		 * @param string $action The API action being performed.
		 * @param object $args Plugin arguments.
		 * @return mixed $api The plugin info or false.
		 */
		public function plugins_api( $api, $action, $args ) {
			if ( isset( $args->slug ) && 'envato-market' === $args->slug ) {
				$api_check = $this->api_check();
				if ( is_object( $api_check ) ) {
					$api = $api_check;
				}
			}
			return $api;
		}

		/**
		 * Update check.
		 *
		 * @since 1.0.0
		 *
		 * @param object $transient The pre-saved value of the `update_plugins` site transient.
		 * @return object
		 */
		public function update_plugins( $transient ) {
			$state = $this->state();
			if ( 'activated' === $state ) {
				$api_check = $this->api_check();
				if ( is_object( $api_check ) && version_compare( envato_market()->get_version(), $api_check->version, '<' ) ) {
					$transient->response['envato-market/envato-market.php'] = (object) array(
						'slug'        => 'envato-market',
						'plugin'      => 'envato-market/envato-market.php',
						'new_version' => $api_check->version,
						'url'         => 'https://github.com/envato/wp-envato-market',
						'package'     => $api_check->download_link,
					);
				}
			}
			return $transient;
		}

		/**
		 * Set the plugin state.
		 *
		 * @since 1.0.0
		 *
		 * @return string
		 */
		public function state() {
			$option         = 'envato_market_state';
			$active_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
			// We also have to check network activated plugins. Otherwise this plugin won't update on multisite.
			$active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
			if ( ! is_array( $active_plugins ) ) {
				$active_plugins = array();
			}
			if ( ! is_array( $active_sitewide_plugins ) ) {
				$active_sitewide_plugins = array();
			}
			$active_plugins = array_merge( $active_plugins, array_keys( $active_sitewide_plugins ) );
			if ( in_array( 'envato-market/envato-market.php', $active_plugins ) ) {
				$state = 'activated';
				update_option( $option, $state );
			} else {
				$state = 'install';
				update_option( $option, $state );
				foreach ( array_keys( get_plugins() ) as $plugin ) {
					if ( strpos( $plugin, 'envato-market.php' ) !== false ) {
						$state = 'deactivated';
						update_option( $option, $state );
					}
				}
			}
			return $state;
		}

		/**
		 * Force the plugin state to be updated.
		 *
		 * @since 1.0.0
		 *
		 * @param object $transient The saved value of the `update_plugins` site transient.
		 * @return object
		 */
		public function update_state( $transient ) {
			$state = $this->state();
			return $transient;
		}

		/**
		 * Admin notices.
		 *
		 * @since 1.0.0
		 *
		 * @return string
		 */
		public function notice() {
			$screen = get_current_screen();
			$slug   = 'envato-market';
			$state  = get_option( 'envato_market_state' );
			$notice = get_option( self::AJAX_ACTION );

			if ( empty( $state ) ) {
				$state = $this->state();
			}

			if (
				'activated' === $state ||
				'update-core' === $screen->id ||
				'update' === $screen->id ||
				'plugins' === $screen->id && isset( $_GET['action'] ) && 'delete-selected' === $_GET['action'] ||
				'dismissed' === $notice
				) {
				return;
			}

			if ( 'deactivated' === $state ) {
				$activate_url = add_query_arg(
					array(
						'action'   => 'activate',
						'plugin'   => urlencode( "$slug/$slug.php" ),
						'_wpnonce' => urlencode( wp_create_nonce( "activate-plugin_$slug/$slug.php" ) ),
					),
					self_admin_url( 'plugins.php' )
				);

				$message = sprintf(
					esc_html__( '%1$sActivate the Envato Market plugin%2$s to get updates for your ThemeForest and CodeCanyon items.', 'envato-market' ),
					'<a href="' . esc_url( $activate_url ) . '">',
					'</a>'
				);
			} elseif ( 'install' === $state ) {
				$install_url = add_query_arg(
					array(
						'action' => 'install-plugin',
						'plugin' => $slug,
					),
					self_admin_url( 'update.php' )
				);

				$message = sprintf(
					esc_html__( '%1$sInstall the Envato Market plugin%2$s to get updates for your ThemeForest and CodeCanyon items.', 'envato-market' ),
					'<a href="' . esc_url( wp_nonce_url( $install_url, 'install-plugin_' . $slug ) ) . '">',
					'</a>'
				);
			}

			if ( isset( $message ) ) {
				?>
				<div class="updated envato-market-notice notice is-dismissible">
					<p><?php echo wp_kses_post( $message ); ?></p>
				</div>
				<script>
				jQuery( document ).ready( function( $ ) {
					$( document ).on( 'click', '.envato-market-notice .notice-dismiss', function() {
						$.ajax( {
							url: ajaxurl,
							data: {
								action: '<?php echo self::AJAX_ACTION; ?>',
								nonce: '<?php echo wp_create_nonce( self::AJAX_ACTION ); ?>'
							}
						} );
					} );
				} );
				</script>
				<?php
			}
		}

		/**
		 * Dismiss admin notice.
		 *
		 * @since 1.0.0
		 */
		public function dismiss_notice() {
			check_ajax_referer( self::AJAX_ACTION, 'nonce' );

			update_option( self::AJAX_ACTION, 'dismissed' );
			wp_send_json_success();
		}
	}

	if ( ! function_exists( 'envato_market_github' ) ) :
		/**
		 * Envato_Market_Github Instance
		 *
		 * @since 1.0.0
		 *
		 * @return Envato_Market_Github
		 */
		function envato_market_github() {
			return Envato_Market_Github::instance();
		}
	endif;

	/**
	 * Loads the main instance of Envato_Market_Github
	 *
	 * @since 1.0.0
	 */
	add_action( 'after_setup_theme', 'envato_market_github', 99 );

endif;
class-envato-market.php000064400000023164151327206010011140 0ustar00<?php
/**
 * Envato Market class.
 *
 * @package Envato_Market
 */

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


if ( ! class_exists( 'Envato_Market' ) ) :

	/**
	 * It's the main class that does all the things.
	 *
	 * @class Envato_Market
	 * @version 1.0.0
	 * @since 1.0.0
	 */
	final class Envato_Market {

		/**
		 * The single class instance.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var object
		 */
		private static $_instance = null;

		/**
		 * Plugin data.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var object
		 */
		private $data;

		/**
		 * The slug.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var string
		 */
		private $slug;

		/**
		 * The version number.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var string
		 */
		private $version;

		/**
		 * The web URL to the plugin directory.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var string
		 */
		private $plugin_url;

		/**
		 * The server path to the plugin directory.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var string
		 */
		private $plugin_path;

		/**
		 * The web URL to the plugin admin page.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var string
		 */
		private $page_url;

		/**
		 * The setting option name.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var string
		 */
		private $option_name;

		/**
		 * Main Envato_Market Instance
		 *
		 * Ensures only one instance of this class exists in memory at any one time.
		 *
		 * @see Envato_Market()
		 * @uses Envato_Market::init_globals() Setup class globals.
		 * @uses Envato_Market::init_includes() Include required files.
		 * @uses Envato_Market::init_actions() Setup hooks and actions.
		 *
		 * @since 1.0.0
		 * @static
		 * @return Envato_Market.
		 * @codeCoverageIgnore
		 */
		public static function instance() {
			if ( is_null( self::$_instance ) ) {
				self::$_instance = new self();
				self::$_instance->init_globals();
				self::$_instance->init_includes();
				self::$_instance->init_actions();
			}
			return self::$_instance;
		}

		/**
		 * A dummy constructor to prevent this class from being loaded more than once.
		 *
		 * @see Envato_Market::instance()
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function __construct() {
			/* We do nothing here! */
		}

		/**
		 * You cannot clone this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __clone() {
			_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * You cannot unserialize instances of this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __wakeup() {
			_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * Setup the class globals.
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function init_globals() {
			$this->data        = new stdClass();
			$this->version     = ENVATO_MARKET_VERSION;
			$this->slug        = 'envato-market';
			$this->option_name = self::sanitize_key( $this->slug );
			$this->plugin_url  = ENVATO_MARKET_URI;
			$this->plugin_path = ENVATO_MARKET_PATH;
			$this->page_url    = ENVATO_MARKET_NETWORK_ACTIVATED ? network_admin_url( 'admin.php?page=' . $this->slug ) : admin_url( 'admin.php?page=' . $this->slug );
			$this->data->admin = true;

		}

		/**
		 * Include required files.
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function init_includes() {
			require $this->plugin_path . '/inc/admin/class-envato-market-admin.php';
			require $this->plugin_path . '/inc/admin/functions.php';
			require $this->plugin_path . '/inc/class-envato-market-api.php';
			require $this->plugin_path . '/inc/class-envato-market-items.php';
			require $this->plugin_path . '/inc/class-envato-market-github.php';
		}

		/**
		 * Setup the hooks, actions and filters.
		 *
		 * @uses add_action() To add actions.
		 * @uses add_filter() To add filters.
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function init_actions() {
			// Activate plugin.
			register_activation_hook( ENVATO_MARKET_CORE_FILE, array( $this, 'activate' ) );

			// Deactivate plugin.
			register_deactivation_hook( ENVATO_MARKET_CORE_FILE, array( $this, 'deactivate' ) );

			// Load the textdomain.
			add_action( 'init', array( $this, 'load_textdomain' ) );

			// Load OAuth.
			add_action( 'init', array( $this, 'admin' ) );

			// Load Upgrader.
			add_action( 'init', array( $this, 'items' ) );
		}

		/**
		 * Activate plugin.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function activate() {
			self::set_plugin_state( true );
		}

		/**
		 * Deactivate plugin.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function deactivate() {
			self::set_plugin_state( false );
		}

		/**
		 * Loads the plugin's translated strings.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function load_textdomain() {
			load_plugin_textdomain( 'envato-market', false, ENVATO_MARKET_PATH . 'languages/' );
		}

		/**
		 * Sanitize data key.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @param string $key An alpha numeric string to sanitize.
		 * @return string
		 */
		private function sanitize_key( $key ) {
			return preg_replace( '/[^A-Za-z0-9\_]/i', '', str_replace( array( '-', ':' ), '_', $key ) );
		}

		/**
		 * Recursively converts data arrays to objects.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @param array $array An array of data.
		 * @return object
		 */
		private function convert_data( $array ) {
			foreach ( (array) $array as $key => $value ) {
				if ( is_array( $value ) ) {
					$array[ $key ] = self::convert_data( $value );
				}
			}
			return (object) $array;
		}

		/**
		 * Set the `is_plugin_active` option.
		 *
		 * This setting helps determine context. Since the plugin can be included in your theme root you
		 * might want to hide the admin UI when the plugin is not activated and implement your own.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @param bool $value Whether or not the plugin is active.
		 */
		private function set_plugin_state( $value ) {
			self::set_option( 'is_plugin_active', $value );
		}

		/**
		 * Set option value.
		 *
		 * @since 1.0.0
		 *
		 * @param string $name Option name.
		 * @param mixed  $option Option data.
		 */
		public function set_option( $name, $option ) {
			$options          = self::get_options();
			$name             = self::sanitize_key( $name );
			$options[ $name ] = esc_html( $option );
			$this->set_options( $options );
		}


		/**
		 * Set option.
		 *
		 * @since 2.0.0
		 *
		 * @param mixed $options Option data.
		 */
		public function set_options( $options ) {
			ENVATO_MARKET_NETWORK_ACTIVATED ? update_site_option( $this->option_name, $options ) : update_option( $this->option_name, $options );
		}

		/**
		 * Return the option settings array.
		 *
		 * @since 1.0.0
		 */
		public function get_options() {
			return ENVATO_MARKET_NETWORK_ACTIVATED ? get_site_option( $this->option_name, array() ) : get_option( $this->option_name, array() );
		}

		/**
		 * Return a value from the option settings array.
		 *
		 * @since 1.0.0
		 *
		 * @param string $name Option name.
		 * @param mixed  $default The default value if nothing is set.
		 * @return mixed
		 */
		public function get_option( $name, $default = '' ) {
			$options = self::get_options();
			$name    = self::sanitize_key( $name );
			return isset( $options[ $name ] ) ? $options[ $name ] : $default;
		}

		/**
		 * Set data.
		 *
		 * @since 1.0.0
		 *
		 * @param string $key Unique object key.
		 * @param mixed  $data Any kind of data.
		 */
		public function set_data( $key, $data ) {
			if ( ! empty( $key ) ) {
				if ( is_array( $data ) ) {
					$data = self::convert_data( $data );
				}
				$key = self::sanitize_key( $key );
				// @codingStandardsIgnoreStart
				$this->data->$key = $data;
				// @codingStandardsIgnoreEnd
			}
		}

		/**
		 * Get data.
		 *
		 * @since 1.0.0
		 *
		 * @param string $key Unique object key.
		 * @return string|object
		 */
		public function get_data( $key ) {
			return isset( $this->data->$key ) ? $this->data->$key : '';
		}

		/**
		 * Return the plugin slug.
		 *
		 * @since 1.0.0
		 *
		 * @return string
		 */
		public function get_slug() {
			return $this->slug;
		}

		/**
		 * Return the plugin version number.
		 *
		 * @since 1.0.0
		 *
		 * @return string
		 */
		public function get_version() {
			return $this->version;
		}

		/**
		 * Return the plugin URL.
		 *
		 * @since 1.0.0
		 *
		 * @return string
		 */
		public function get_plugin_url() {
			return $this->plugin_url;
		}

		/**
		 * Return the plugin path.
		 *
		 * @since 1.0.0
		 *
		 * @return string
		 */
		public function get_plugin_path() {
			return $this->plugin_path;
		}

		/**
		 * Return the plugin page URL.
		 *
		 * @since 1.0.0
		 *
		 * @return string
		 */
		public function get_page_url() {
			return $this->page_url;
		}

		/**
		 * Return the option settings name.
		 *
		 * @since 1.0.0
		 *
		 * @return string
		 */
		public function get_option_name() {
			return $this->option_name;
		}

		/**
		 * Admin UI class.
		 *
		 * @since 1.0.0
		 *
		 * @return Envato_Market_Admin
		 */
		public function admin() {
			return Envato_Market_Admin::instance();
		}

		/**
		 * Envato API class.
		 *
		 * @since 1.0.0
		 *
		 * @return Envato_Market_API
		 */
		public function api() {
			return Envato_Market_API::instance();
		}

		/**
		 * Items class.
		 *
		 * @since 1.0.0
		 *
		 * @return Envato_Market_Items
		 */
		public function items() {
			return Envato_Market_Items::instance();
		}
	}

endif;
admin/view/notice/error-permissions.php000064400000001054151327206010014277 0ustar00<?php
/**
 * Error notice
 *
 * @package Envato_Market
 * @since 2.0.1
 */

?>
<div class="notice notice-error is-dismissible">
	<p><?php printf( esc_html__( 'Incorrect token permissions, please generate another token or fix the permissions on the existing token.' ) ); ?></p>
	<p><?php printf( esc_html__( 'Please ensure only the following permissions are enabled: ', 'envato-market' ) ); ?></p>
	<ol>
		<?php foreach ( $this->get_required_permissions() as $permission ) { ?>
				<li><?php echo esc_html( $permission ); ?></li>
		<?php } ?>
	</ol>
</div>
admin/view/notice/error-http.php000064400000000741151327206010012705 0ustar00<?php
/**
 * Error notice
 *
 * @package Envato_Market
 * @since 2.0.1
 */

?>
<div class="notice notice-error is-dismissible">
	<p><?php esc_html_e( 'Failed to connect to the Envato API. Please contact the hosting providier with this message: "The Envato Market WordPress plugin requires TLS version 1.2 or above, please confirm if this hosting account supports TLS version 1.2 and allows connections from WordPress to the host api.envato.com".', 'envato-market' ); ?></p>
</div>
admin/view/notice/error-missing-zip.php000064400000000645151327206010014202 0ustar00<?php
/**
 * Error notice
 *
 * @package Envato_Market
 * @since 2.0.1
 */

?>
<div class="notice notice-error is-dismissible">
	<p><?php printf( esc_html__( 'Failed to locate the package file for this item. Please contact the item author for support, or install/upgrade the item manually from the %s.', 'envato-market' ), '<a href="https://themeforest.net/downloads" target="_blank">downloads page</a>' ); ?></p>
</div>
admin/view/notice/success-no-items.php000064400000000457151327206010014004 0ustar00<?php
/**
 * Success notice
 *
 * @package Envato_Market
 * @since 1.0.0
 */

?>
<div class="notice notice-success is-dismissible">
	<p><?php esc_html_e( 'Your OAuth Personal Token has been verified. However, there are no WordPress downloadable items in your account.', 'envato-market' ); ?></p>
</div>
admin/view/notice/error-single-use.php000064400000000424151327206010013777 0ustar00<?php
/**
 * Error notice
 *
 * @package Envato_Market
 * @since 1.0.0
 */

?>
<div class="notice notice-error is-dismissible">
	<p><?php esc_html_e( 'One or more Single Use OAuth Personal Tokens could not be verified and should be removed.', 'envato-market' ); ?></p>
</div>
admin/view/notice/error.php000064400000000513151327206010011725 0ustar00<?php
/**
 * Error notice
 *
 * @package Envato_Market
 * @since 1.0.0
 */

?>
<div class="notice notice-error is-dismissible">
	<p><?php esc_html_e( 'The OAuth Personal Token could not be verified. Please check that the Token has been entered correctly and has the minimum required permissions.', 'envato-market' ); ?></p>
</div>
admin/view/notice/success-single-use.php000064400000000367151327206010014324 0ustar00<?php
/**
 * Success notice
 *
 * @package Envato_Market
 * @since 1.0.0
 */

?>
<div class="notice notice-success is-dismissible">
	<p><?php esc_html_e( 'All Single Use OAuth Personal Tokens have been verified.', 'envato-market' ); ?></p>
</div>
admin/view/notice/success.php000064400000000353151327206010012246 0ustar00<?php
/**
 * Success notice
 *
 * @package Envato_Market
 * @since 1.0.0
 */

?>
<div class="notice notice-success is-dismissible">
	<p><?php esc_html_e( 'Your OAuth Personal Token has been verified.', 'envato-market' ); ?></p>
</div>
admin/view/notice/error-details.php000064400000000466151327206010013357 0ustar00<?php
/**
 * Error details
 *
 * @package Envato_Market
 * @since 2.0.2
 */

?>
<div class="notice notice-error is-dismissible">
	<p><?php printf( '<strong>Additional Error Details:</strong><br/>%s.<br/> %s <br/> %s', esc_html( $title ), esc_html( $message ), esc_html( json_encode( $data ) ) ); ?></p>
</div>
admin/view/callback/section/items.php000064400000001032151327206010013631 0ustar00<?php
/**
 * Items section
 *
 * @package Envato_Market
 * @since 1.0.0
 */

?>
<p><?php esc_html_e( 'Add Envato Market themes & plugins using multiple OAuth tokens. This is especially useful when an item has been purchased on behalf of a third-party. This works similarly to the global OAuth Personal Token, but for individual items and additionally requires the Envato Market item ID.', 'envato-market' ); ?></p>

<p><?php esc_html_e( 'Warning: These tokens can be revoked by the account holder at any time.', 'envato-market' ); ?></p>
admin/view/callback/section/oauth.php000064400000002737151327206010013645 0ustar00<?php
/**
 * OAuth section
 *
 * @package Envato_Market
 * @since 1.0.0
 */

?>

<p>
	<?php printf( esc_html__( 'This area enables WordPress Theme &amp; Plugin updates from Envato Market. Read more about how this process works at %s.', 'envato-market' ), '<a href="https://envato.com/market-plugin/" target="_blank">' . esc_html__( 'envato.com', 'envato-market' ) . '</a>' ); ?>
</p>
<p>
	<?php esc_html_e( 'Please follow the steps below:', 'envato-market' ); ?>
</p>
<ol>
	<li><?php printf( esc_html__( 'Generate an Envato API Personal Token by %s.', 'envato-market' ), '<a href="' . envato_market()->admin()->get_generate_token_url() . '" target="_blank">' . esc_html__( 'clicking this link', 'envato-market' ) . '</a>' ); ?></li>
	<li><?php esc_html_e( 'Name the token eg “My WordPress site”.', 'envato-market' ); ?></li>
	<li><?php esc_html_e( 'Ensure the following permissions are enabled:', 'envato-market' ); ?>
		<ul>
			<li><?php esc_html_e( 'View and search Envato sites', 'envato-market' ); ?></li>
			<li><?php esc_html_e( 'Download your purchased items', 'envato-market' ); ?></li>
			<li><?php esc_html_e( 'List purchases you\'ve made', 'envato-market' ); ?></li>
		</ul>
	</li>
	<li><?php esc_html_e( 'Copy the token into the box below.', 'envato-market' ); ?></li>
	<li><?php esc_html_e( 'Click the "Save Changes" button.', 'envato-market' ); ?></li>
	<li><?php esc_html_e( 'A list of purchased Themes &amp; Plugins from Envato Market will appear.', 'envato-market' ); ?></li>
</ol>
admin/view/callback/setting/token.php000064400000000612151327206010013644 0ustar00<?php
/**
 * Token setting
 *
 * @package Envato_Market
 * @since 1.0.0
 */

?>
<input type="text" name="<?php echo esc_attr( envato_market()->get_option_name() ); ?>[token]" class="widefat" value="<?php echo esc_html( envato_market()->get_option( 'token' ) ); ?>" autocomplete="off">

<p class="description"><?php esc_html_e( 'Enter your Envato API Personal Token.', 'envato-market' ); ?></p>
admin/view/callback/setting/items.php000064400000003531151327206010013650 0ustar00<?php
/**
 * Items setting
 *
 * @package Envato_Market
 * @since 1.0.0
 */

$items = envato_market()->get_option( 'items', array() );

?>
<ul id="envato-market-items">
<?php
if ( ! empty( $items ) ) {
	foreach ( $items as $key => $item ) {
		if ( empty( $item['name'] ) || empty( $item['token'] ) || empty( $item['id'] ) || empty( $item['type'] ) || empty( $item['authorized'] ) ) {
			continue;
		}
		$class = 'success' === $item['authorized'] ? 'is-authorized' : 'not-authorized';
		echo '
		<li data-id="' . esc_attr( $item['id'] ) . '" class="' . esc_attr( $class ) . '">
			<span class="item-name">' . esc_html__( 'ID', 'envato-market' ) . ': ' . esc_html( $item['id'] ) . ' - ' . esc_html( $item['name'] ) . '</span>
			<button class="item-delete dashicons dashicons-dismiss">
				<span class="screen-reader-text">' . esc_html__( 'Delete', 'envato-market' ) . '</span>
			</button>
			<input type="hidden" name="' . esc_attr( envato_market()->get_option_name() ) . '[items][' . esc_attr( $key ) . '][name]" value="' . esc_html( $item['name'] ) . '" />
			<input type="hidden" name="' . esc_attr( envato_market()->get_option_name() ) . '[items][' . esc_attr( $key ) . '][token]" value="' . esc_html( $item['token'] ) . '" />
			<input type="hidden" name="' . esc_attr( envato_market()->get_option_name() ) . '[items][' . esc_attr( $key ) . '][id]" value="' . esc_html( $item['id'] ) . '" />
			<input type="hidden" name="' . esc_attr( envato_market()->get_option_name() ) . '[items][' . esc_attr( $key ) . '][type]" value="' . esc_html( $item['type'] ) . '" />
			<input type="hidden" name="' . esc_attr( envato_market()->get_option_name() ) . '[items][' . esc_attr( $key ) . '][authorized]" value="' . esc_html( $item['authorized'] ) . '" />
		</li>';
	}
}
?>
</ul>

<button class="button add-envato-market-item"><?php esc_html_e( 'Add Item', 'envato-market' ); ?></button>
admin/view/callback/admin.php000064400000002011151327206010012132 0ustar00<?php
/**
 * Admin UI
 *
 * @package Envato_Market
 * @since 1.0.0
 */

if ( isset( $_GET['action'] ) ) {
	$id = ! empty( $_GET['id'] ) ? absint( trim( $_GET['id'] ) ) : '';

	if ( 'install-plugin' === $_GET['action'] ) {
		Envato_Market_Admin::install_plugin( $id );
	} elseif ( 'install-theme' === $_GET['action'] ) {
		Envato_Market_Admin::install_theme( $id );
	}
} else {
	add_thickbox();
	?>
	<div class="wrap about-wrap full-width-layout">
		<?php Envato_Market_Admin::render_intro_partial(); ?>
		<?php Envato_Market_Admin::render_tabs_partial(); ?>
		<form method="POST" action="<?php echo esc_url( ENVATO_MARKET_NETWORK_ACTIVATED ? network_admin_url( 'edit.php?action=envato_market_network_settings' ) : admin_url( 'options.php' ) ); ?>">
			<?php Envato_Market_Admin::render_themes_panel_partial(); ?>
			<?php Envato_Market_Admin::render_plugins_panel_partial(); ?>
			<?php Envato_Market_Admin::render_settings_panel_partial(); ?>
			<?php Envato_Market_Admin::render_help_panel_partial(); ?>
		</form>
	</div>
	<?php
}
admin/view/partials/themes.php000064400000000715151327206010012423 0ustar00<?php
/**
 * Themes panel partial
 *
 * @package Envato_Market
 * @since 1.0.0
 */

$themes = envato_market()->items()->themes( 'purchased' );

?>
<div id="themes" class="panel <?php echo empty( $themes ) ? 'hidden' : ''; ?>">
	<div class="envato-market-blocks">
		<?php
		if ( ! empty( $themes ) ) {
			envato_market_themes_column( 'active' );
			envato_market_themes_column( 'installed' );
			envato_market_themes_column( 'install' );
		}
		?>
	</div>
</div>
admin/view/partials/plugins.php000064400000000726151327206010012621 0ustar00<?php
/**
 * Plugins panel partial
 *
 * @package Envato_Market
 * @since 1.0.0
 */

$plugins = envato_market()->items()->plugins( 'purchased' );

?>
<div id="plugins" class="panel <?php echo empty( $plugins ) ? 'hidden' : ''; ?>">
	<div class="envato-market-blocks">
		<?php
		if ( ! empty( $plugins ) ) {
			envato_market_plugins_column( 'active' );
			envato_market_plugins_column( 'installed' );
			envato_market_plugins_column( 'install' );
		}
		?>
	</div>
</div>
admin/view/partials/help.php000064400000005201151327206010012061 0ustar00<?php
/**
 * Help panel partial
 *
 * @package Envato_Market
 * @since 2.0.1
 */


?>
<div id="help" class="panel">
	<div class="envato-market-blocks">
		<div class="envato-market-block">
			<h3>Troubleshooting:</h3>
			<p>If you’re having trouble with the plugin, please</p>
			<ol>
				<li>Confirm the old <code>Envato Toolkit</code> plugin is not installed.</li>
				<li>Confirm the latest version of WordPress is installed.</li>
				<li>Confirm the latest version of the <a href="https://envato.com/market-plugin/" target="_blank">Envato Market</a> plugin is installed.</li>
				<li>Try creating a new API token has from the <a href="<?php echo envato_market()->admin()->get_generate_token_url(); ?>" target="_blank">build.envato.com</a> website - ensure only the following permissions have been granted
					<ul>
						<li>View and search Envato sites</li>
						<li>Download your purchased items</li>
						<li>List purchases you've made</li>
					</ul>
				</li>
				<li>Check with the hosting provider to ensure the API connection to <code>api.envato.com</code> is not blocked.</li>
				<li>Check with the hosting provider that the minimum TLS version is 1.2 or above on the server.</li>
				<li>If you can’t see your items - check with the item author to confirm the Theme or Plugin is compatible with the Envato Market plugin.</li>
				<li>Confirm your Envato account is still active and the items are still visible from <a href="https://themeforest.net/downloads" target="_blank">your downloads page</a>.</li>
				<li>Note - if an item has been recently updated, it may take up to 24 hours for the latest version to appear in the Envato Market plugin.</li>
			</ol>
		</div>
		<div class="envato-market-block">
			<h3>Health Check:</h3>
			<div class="envato-market-healthcheck">
				Problem starting healthcheck. Please check javascript console for errors.
			</div>
			<h3>Support:</h3>
			<p>The Envato Market plugin is maintained - we ensure it works best on the latest version of WordPress and on a modern hosting platform, however we can’t guarantee it’ll work on all WordPress sites or hosting environments.</p>
			<p>If you’ve tried all the troubleshooting steps and you’re still unable to get the Envato Market plugin to work on your site/hosting, at this time, our advice is to remove the Envato Market plugin and instead visit the Downloads section of ThemeForest/CodeCanyon to download the latest version of your items.</p>
			<p>If you’re having trouble with a specific item from ThemeForest or CodeCanyon, it’s best you browse to the Theme or Plugin item page, visit the ‘support’ tab and follow the next steps.
			</p>
		</div>
	</div>
</div>
admin/view/partials/intro.php000064400000001671151327206010012273 0ustar00<?php
/**
 * Intro partial
 *
 * @package Envato_Market
 * @since 1.0.0
 */

?>
<div class="col">

	<h1 class="about-title"><img class="about-logo" src="<?php echo envato_market()->get_plugin_url(); ?>images/envato-market-logo.svg" alt="Envato Market"><sup><?php echo esc_html( envato_market()->get_version() ); ?></sup></h1>
	<p><?php esc_html_e( 'Welcome!', 'envato-market' ); ?></p>
	<p><?php esc_html_e( 'This plugin can install WordPress themes and plugins purchased from ThemeForest & CodeCanyon by connecting with the Envato Market API using a secure OAuth personal token. Once your themes & plugins are installed WordPress will periodically check for updates, so keeping your items up to date is as simple as a few clicks.', 'envato-market' ); ?></p>
	<p><strong><?php printf( esc_html__( 'Find out more at %1$senvato.com%2$s.', 'envato-market' ), '<a href="https://envato.com/market-plugin/" target="_blank">', '</a>' ); ?></strong></p>
</div>
admin/view/partials/settings.php000064400000001760151327206010012777 0ustar00<?php
/**
 * Settings panel partial
 *
 * @package Envato_Market
 * @since 1.0.0
 */

$token = envato_market()->get_option( 'token' );
$items = envato_market()->get_option( 'items', array() );

?>
<div id="settings" class="panel">
	<div class="envato-market-blocks">
		<?php settings_fields( envato_market()->get_slug() ); ?>
		<?php Envato_Market_Admin::do_settings_sections( envato_market()->get_slug(), 2 ); ?>
	</div>
	<p class="submit">
		<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_html_e( 'Save Changes', 'envato-market' ); ?>" />
		<?php if ( ( '' !== $token || ! empty( $items ) ) && 10 !== has_action( 'admin_notices', array( $this, 'error_notice' ) ) ) { ?>
			<a href="<?php echo esc_url( add_query_arg( array( 'authorization' => 'check' ), envato_market()->get_page_url() ) ); ?>" class="button button-secondary auth-check-button" style="margin:0 5px"><?php esc_html_e( 'Test API Connection', 'envato-market' ); ?></a>
		<?php } ?>
	</p>
</div>
admin/view/partials/tabs.php000064400000002724151327206010012071 0ustar00<?php
/**
 * Tabs partial
 *
 * @package Envato_Market
 * @since 1.0.0
 */

$tab     = isset( $_GET['tab'] ) ? sanitize_key( wp_unslash( $_GET['tab'] ) ) : '';
$themes  = envato_market()->items()->themes( 'purchased' );
$plugins = envato_market()->items()->plugins( 'purchased' );

?>
<h2 class="nav-tab-wrapper">
	<?php
	// Themes tab.
	$theme_class = array();
	if ( ! empty( $themes ) ) {
		if ( empty( $tab ) ) {
			$tab = 'themes';
		}
		if ( 'themes' === $tab ) {
			$theme_class[] = 'nav-tab-active';
		}
	} else {
		$theme_class[] = 'hidden';
	}
	echo '<a href="#themes" data-id="theme" class="nav-tab ' . esc_attr( implode( ' ', $theme_class ) ) . '">' . esc_html__( 'Themes', 'envato-market' ) . '</a>';

	// Plugins tab.
	$plugin_class = array();
	if ( ! empty( $plugins ) ) {
		if ( empty( $tab ) ) {
			$tab = 'plugins';
		}
		if ( 'plugins' === $tab ) {
			$plugin_class[] = 'nav-tab-active';
		}
	} else {
		$plugin_class[] = 'hidden';
	}
	echo '<a href="#plugins" data-id="plugin" class="nav-tab ' . esc_attr( implode( ' ', $plugin_class ) ) . '">' . esc_html__( 'Plugins', 'envato-market' ) . '</a>';

	// Settings tab.
	echo '<a href="#settings" class="nav-tab ' . esc_attr( 'settings' === $tab || empty( $tab ) ? 'nav-tab-active' : '' ) . '">' . esc_html__( 'Settings', 'envato-market' ) . '</a>';

	// Help tab.
	echo '<a href="#help" class="nav-tab ' . esc_attr( 'help' === $tab ? 'nav-tab-active' : '' ) . '">' . esc_html__( 'Help', 'envato-market' ) . '</a>';
	?>
</h2>
admin/class-envato-market-admin.php000064400000161130151327206010013312 0ustar00<?php
/**
 * Admin UI class.
 *
 * @package Envato_Market
 */

if ( ! class_exists( 'Envato_Market_Admin' ) && class_exists( 'Envato_Market' ) ) :

	/**
	 * Creates an admin page to save the Envato API OAuth token.
	 *
	 * @class Envato_Market_Admin
	 * @version 1.0.0
	 * @since 1.0.0
	 */
	class Envato_Market_Admin {

		/**
		 * Action nonce.
		 *
		 * @type string
		 */
		const AJAX_ACTION = 'envato_market';

		/**
		 * The single class instance.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var object
		 */
		private static $_instance = null;

		/**
		 * Main Envato_Market_Admin Instance
		 *
		 * Ensures only one instance of this class exists in memory at any one time.
		 *
		 * @return object The one true Envato_Market_Admin.
		 * @codeCoverageIgnore
		 * @uses Envato_Market_Admin::init_actions() Setup hooks and actions.
		 *
		 * @since 1.0.0
		 * @static
		 * @see  Envato_Market_Admin()
		 */
		public static function instance() {
			if ( is_null( self::$_instance ) ) {
				self::$_instance = new self();
				self::$_instance->init_actions();
			}

			return self::$_instance;
		}

		/**
		 * A dummy constructor to prevent this class from being loaded more than once.
		 *
		 * @see Envato_Market_Admin::instance()
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function __construct() {
			/* We do nothing here! */
		}

		/**
		 * You cannot clone this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __clone() {
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * You cannot unserialize instances of this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __wakeup() {
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * Setup the hooks, actions and filters.
		 *
		 * @uses add_action() To add actions.
		 * @uses add_filter() To add filters.
		 *
		 * @since 1.0.0
		 */
		public function init_actions() {
			// @codeCoverageIgnoreStart
			if ( false === envato_market()->get_data( 'admin' ) && false === envato_market()->get_option( 'is_plugin_active' ) ) { // Turns the UI off if allowed.
				return;
			}
			// @codeCoverageIgnoreEnd
			// Deferred Download.
			add_action( 'upgrader_package_options', array( $this, 'maybe_deferred_download' ), 9 );

			// Add pre download filter to help with 3rd party plugin integration.
			add_filter( 'upgrader_pre_download', array( $this, 'upgrader_pre_download' ), 2, 4 );

			// Add item AJAX handler.
			add_action( 'wp_ajax_' . self::AJAX_ACTION . '_add_item', array( $this, 'ajax_add_item' ) );

			// Remove item AJAX handler.
			add_action( 'wp_ajax_' . self::AJAX_ACTION . '_remove_item', array( $this, 'ajax_remove_item' ) );

			// Health check AJAX handler
			add_action( 'wp_ajax_' . self::AJAX_ACTION . '_healthcheck', array( $this, 'ajax_healthcheck' ) );

			// Maybe delete the site transients.
			add_action( 'init', array( $this, 'maybe_delete_transients' ), 11 );

			// Add the menu icon.
			add_action( 'admin_head', array( $this, 'add_menu_icon' ) );

			// Add the menu.
			add_action( 'admin_menu', array( $this, 'add_menu_page' ) );

			// Register the settings.
			add_action( 'admin_init', array( $this, 'register_settings' ) );

			// We may need to redirect after an item is enabled.
			add_action( 'current_screen', array( $this, 'maybe_redirect' ) );

			// Add authorization notices.
			add_action( 'current_screen', array( $this, 'add_notices' ) );

			// Set the API values.
			add_action( 'current_screen', array( $this, 'set_items' ) );

			// Hook to verify the API token before saving it.
			add_filter(
				'pre_update_option_' . envato_market()->get_option_name(),
				array(
					$this,
					'check_api_token_before_saving',
				),
				9,
				3
			);
			add_filter(
				'pre_update_site_option_' . envato_market()->get_option_name(),
				array(
					$this,
					'check_api_token_before_saving',
				),
				9,
				3
			);

			// When network enabled, add the network options menu.
			add_action( 'network_admin_menu', array( $this, 'add_menu_page' ) );

			// Ability to make use of the Settings API when in multisite mode.
			add_action( 'network_admin_edit_envato_market_network_settings', array( $this, 'save_network_settings' ) );
		}

		/**
		 * This runs before we save the Envato Market options array.
		 * If the token has changed then we set a transient so we can do the update check.
		 *
		 * @param array $value The option to save.
		 * @param array $old_value The old option value.
		 * @param array $option Serialized option value.
		 *
		 * @return array $value The updated option value.
		 * @since 2.0.1
		 */
		public function check_api_token_before_saving( $value, $old_value, $option ) {
			if ( ! empty( $value['token'] ) && ( empty( $old_value['token'] ) || $old_value['token'] != $value['token'] || isset( $_POST['envato_market'] ) ) ) {
				set_site_transient( envato_market()->get_option_name() . '_check_token', $value['token'], HOUR_IN_SECONDS );
			}

			return $value;
		}


		/**
		 * Defers building the API download url until the last responsible moment to limit file requests.
		 *
		 * Filter the package options before running an update.
		 *
		 * @param array $options {
		 *     Options used by the upgrader.
		 *
		 * @type string $package Package for update.
		 * @type string $destination Update location.
		 * @type bool   $clear_destination Clear the destination resource.
		 * @type bool   $clear_working Clear the working resource.
		 * @type bool   $abort_if_destination_exists Abort if the Destination directory exists.
		 * @type bool   $is_multi Whether the upgrader is running multiple times.
		 * @type array  $hook_extra Extra hook arguments.
		 * }
		 * @since 1.0.0
		 */
		public function maybe_deferred_download( $options ) {
			$package = $options['package'];
			if ( false !== strrpos( $package, 'deferred_download' ) && false !== strrpos( $package, 'item_id' ) ) {
				parse_str( parse_url( $package, PHP_URL_QUERY ), $vars );
				if ( $vars['item_id'] ) {
					$args               = $this->set_bearer_args( $vars['item_id'] );
					$options['package'] = envato_market()->api()->download( $vars['item_id'], $args );
				}
			}

			return $options;
		}

		/**
		 * We want to stop certain popular 3rd party scripts from blocking the update process by
		 * adjusting the plugin name slightly so the 3rd party plugin checks stop.
		 *
		 * Currently works for: Visual Composer.
		 *
		 * @param string $reply Package URL.
		 * @param string $package Package URL.
		 * @param object $updater Updater Object.
		 *
		 * @return string $reply    New Package URL.
		 * @since 2.0.0
		 */
		public function upgrader_pre_download( $reply, $package, $updater ) {
			if ( strpos( $package, 'marketplace.envato.com/short-dl' ) !== false ) {
				if ( isset( $updater->skin->plugin_info ) && ! empty( $updater->skin->plugin_info['Name'] ) ) {
					$updater->skin->plugin_info['Name'] = $updater->skin->plugin_info['Name'] . '.';
				} else {
					$updater->skin->plugin_info = array(
						'Name' => 'Name',
					);
				}
			}

			return $reply;
		}

		/**
		 * Returns the bearer arguments for a request with a single use API Token.
		 *
		 * @param int $id The item ID.
		 *
		 * @return array
		 * @since 1.0.0
		 */
		public function set_bearer_args( $id ) {
			$token = '';
			$args  = array();
			foreach ( envato_market()->get_option( 'items', array() ) as $item ) {
				if ( absint( $item['id'] ) === absint( $id ) ) {
					$token = $item['token'];
					break;
				}
			}
			if ( ! empty( $token ) ) {
				$args = array(
					'headers' => array(
						'Authorization' => 'Bearer ' . $token,
					),
				);
			}

			return $args;
		}

		/**
		 * Maybe delete the site transients.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function maybe_delete_transients() {
			if ( isset( $_POST[ envato_market()->get_option_name() ] ) ) {

				// Nonce check.
				if ( isset( $_POST['_wpnonce'] ) && ! wp_verify_nonce( $_POST['_wpnonce'], envato_market()->get_slug() . '-options' ) ) {
					wp_die( __( 'You do not have sufficient permissions to delete transients.', 'envato-market' ) );
				}

				self::delete_transients();
			} elseif ( ! envato_market()->get_option( 'installed_version', 0 ) || version_compare( envato_market()->get_version(), envato_market()->get_option( 'installed_version', 0 ), '<' ) ) {

				// When the plugin updates we want to delete transients.
				envato_market()->set_option( 'installed_version', envato_market()->get_version() );
				self::delete_transients();

			}
		}

		/**
		 * Delete the site transients.
		 *
		 * @since 1.0.0
		 * @access private
		 */
		private function delete_transients() {
			delete_site_transient( envato_market()->get_option_name() . '_themes' );
			delete_site_transient( envato_market()->get_option_name() . '_plugins' );
		}

		/**
		 * Prints out all settings sections added to a particular settings page in columns.
		 *
		 * @param string $page The slug name of the page whos settings sections you want to output.
		 * @param int    $columns The number of columns in each row.
		 *
		 * @since 1.0.0
		 *
		 * @global array $wp_settings_sections Storage array of all settings sections added to admin pages
		 * @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections
		 */
		public static function do_settings_sections( $page, $columns = 2 ) {
			global $wp_settings_sections, $wp_settings_fields;

			// @codeCoverageIgnoreStart
			if ( ! isset( $wp_settings_sections[ $page ] ) ) {
				return;
			}
			// @codeCoverageIgnoreEnd
			foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
				// @codeCoverageIgnoreStart
				if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
					continue;
				}
				// @codeCoverageIgnoreEnd
				// Set the column class.
				$class = 'envato-market-block';
				?>
							<div class="<?php echo esc_attr( $class ); ?>">
				  <?php
					if ( ! empty( $section['title'] ) ) {
						echo '<h3>' . esc_html( $section['title'] ) . '</h3>' . "\n";
					}
					if ( ! empty( $section['callback'] ) ) {
						call_user_func( $section['callback'], $section );
					}
					?>
								<table class="form-table">
					<?php do_settings_fields( $page, $section['id'] ); ?>
								</table>
							</div>
				<?php
			}
		}

		/**
		 * Add a font based menu icon
		 *
		 * @since 1.0.0
		 */
		public function add_menu_icon() {
			// Fonts directory URL.
			$fonts_dir_url = envato_market()->get_plugin_url() . 'fonts/';

			// Create font styles.
			$style = '<style type="text/css">
				/*<![CDATA[*/
				@font-face {
					font-family: "envato-market";
					src:url("' . $fonts_dir_url . 'envato-market.eot?20150626");
					src:url("' . $fonts_dir_url . 'envato-market.eot?#iefix20150626") format("embedded-opentype"),
					url("' . $fonts_dir_url . 'envato-market.woff?20150626") format("woff"),
					url("' . $fonts_dir_url . 'envato-market.ttf?20150626") format("truetype"),
					url("' . $fonts_dir_url . 'envato-market.svg?20150626#envato") format("svg");
					font-weight: normal;
					font-style: normal;
				}
				#adminmenu .toplevel_page_' . envato_market()->get_slug() . ' .menu-icon-generic div.wp-menu-image:before {
					font: normal 20px/1 "envato-market" !important;
					content: "\e600";
					speak: none;
					padding: 6px 0;
					height: 34px;
					width: 20px;
					display: inline-block;
					-webkit-font-smoothing: antialiased;
					-moz-osx-font-smoothing: grayscale;
					-webkit-transition: all .1s ease-in-out;
					-moz-transition:    all .1s ease-in-out;
					transition:         all .1s ease-in-out;
				}
				/*]]>*/
			</style>';

			// Remove space after colons.
			$style = str_replace( ': ', ':', $style );

			// Remove whitespace.
			echo str_replace( array( "\r\n", "\r", "\n", "\t", '	', '		', '		', '  ', '    ' ), '', $style );
		}

		/**
		 * Adds the menu.
		 *
		 * @since 1.0.0
		 */
		public function add_menu_page() {

			if ( ENVATO_MARKET_NETWORK_ACTIVATED && ! is_super_admin() ) {
				// we do not want to show a menu item for people who do not have permission.
				return;
			}

			$page = add_menu_page(
				__( 'Envato Market', 'envato-market' ),
				__( 'Envato Market', 'envato-market' ),
				'manage_options',
				envato_market()->get_slug(),
				array(
					$this,
					'render_admin_callback',
				)
			);

			// Enqueue admin CSS.
			add_action( 'admin_print_styles-' . $page, array( $this, 'admin_enqueue_style' ) );

			// Enqueue admin JavaScript.
			add_action( 'admin_print_scripts-' . $page, array( $this, 'admin_enqueue_script' ) );

			// Add Underscore.js templates.
			add_action( 'admin_footer-' . $page, array( $this, 'render_templates' ) );
		}

		/**
		 * Enqueue admin css.
		 *
		 * @since  1.0.0
		 */
		public function admin_enqueue_style() {
			$file_url = envato_market()->get_plugin_url() . 'css/envato-market' . ( is_rtl() ? '-rtl' : '' ) . '.css';
			wp_enqueue_style( envato_market()->get_slug(), $file_url, array( 'wp-jquery-ui-dialog' ), envato_market()->get_version() );
		}

		/**
		 * Enqueue admin script.
		 *
		 * @since  1.0.0
		 */
		public function admin_enqueue_script() {
			$min        = ( WP_DEBUG ? '' : '.min' );
			$slug       = envato_market()->get_slug();
			$version    = envato_market()->get_version();
			$plugin_url = envato_market()->get_plugin_url();

			wp_enqueue_script(
				$slug,
				$plugin_url . 'js/envato-market' . $min . '.js',
				array(
					'jquery',
					'jquery-ui-dialog',
					'wp-util',
				),
				$version,
				true
			);
			wp_enqueue_script(
				$slug . '-updates',
				$plugin_url . 'js/updates' . $min . '.js',
				array(
					'jquery',
					'updates',
					'wp-a11y',
					'wp-util',
				),
				$version,
				true
			);

			// Script data array.
			$exports = array(
				'nonce'  => wp_create_nonce( self::AJAX_ACTION ),
				'action' => self::AJAX_ACTION,
				'i18n'   => array(
					'save'   => __( 'Save', 'envato-market' ),
					'remove' => __( 'Remove', 'envato-market' ),
					'cancel' => __( 'Cancel', 'envato-market' ),
					'error'  => __( 'An unknown error occurred. Try again.', 'envato-market' ),
				),
			);

			// Export data to JS.
			wp_scripts()->add_data(
				$slug,
				'data',
				sprintf( 'var _envatoMarket = %s;', wp_json_encode( $exports ) )
			);
		}

		/**
		 * Underscore (JS) templates for dialog windows.
		 *
		 * @codeCoverageIgnore
		 */
		public function render_templates() {
			?>
					<script type="text/html" id="tmpl-envato-market-auth-check-button">
						<a
							href="<?php echo esc_url( add_query_arg( array( 'authorization' => 'check' ), envato_market()->get_page_url() ) ); ?>"
							class="button button-secondary auth-check-button"
							style="margin:0 5px"><?php esc_html_e( 'Test API Connection', 'envato-market' ); ?></a>
					</script>

					<script type="text/html" id="tmpl-envato-market-item">
						<li data-id="{{ data.id }}">
							<span class="item-name"><?php esc_html_e( 'ID', 'envato-market' ); ?>
								: {{ data.id }} - {{ data.name }}</span>
							<button class="item-delete dashicons dashicons-dismiss">
								<span class="screen-reader-text"><?php esc_html_e( 'Delete', 'envato-market' ); ?></span>
							</button>
							<input type="hidden"
								   name="<?php echo esc_attr( envato_market()->get_option_name() ); ?>[items][{{ data.key }}][name]"
								   value="{{ data.name }}"/>
							<input type="hidden"
								   name="<?php echo esc_attr( envato_market()->get_option_name() ); ?>[items][{{ data.key }}][token]"
								   value="{{ data.token }}"/>
							<input type="hidden"
								   name="<?php echo esc_attr( envato_market()->get_option_name() ); ?>[items][{{ data.key }}][id]"
								   value="{{ data.id }}"/>
							<input type="hidden"
								   name="<?php echo esc_attr( envato_market()->get_option_name() ); ?>[items][{{ data.key }}][type]"
								   value="{{ data.type }}"/>
							<input type="hidden"
								   name="<?php echo esc_attr( envato_market()->get_option_name() ); ?>[items][{{ data.key }}][authorized]"
								   value="{{ data.authorized }}"/>
						</li>
					</script>

					<script type="text/html" id="tmpl-envato-market-dialog-remove">
						<div id="envato-market-dialog-remove" title="<?php esc_html_e( 'Remove Item', 'envato-market' ); ?>">
							<p><?php esc_html_e( 'You are about to remove the connection between the Envato Market API and this item. You cannot undo this action.', 'envato-market' ); ?></p>
						</div>
					</script>

					<script type="text/html" id="tmpl-envato-market-dialog-form">
						<div id="envato-market-dialog-form" title="<?php esc_html_e( 'Add Item', 'envato-market' ); ?>">
							<form>
								<fieldset>
									<label for="token"><?php esc_html_e( 'Token', 'envato-market' ); ?></label>
									<input type="text" name="token" class="widefat" value=""/>
									<p
										class="description"><?php esc_html_e( 'Enter the Envato API Personal Token.', 'envato-market' ); ?></p>
									<label for="id"><?php esc_html_e( 'Item ID', 'envato-market' ); ?></label>
									<input type="text" name="id" class="widefat" value=""/>
									<p class="description"><?php esc_html_e( 'Enter the Envato Item ID.', 'envato-market' ); ?></p>
									<input type="submit" tabindex="-1" style="position:absolute; top:-5000px"/>
								</fieldset>
							</form>
						</div>
					</script>

					<script type="text/html" id="tmpl-envato-market-dialog-error">
						<div class="notice notice-error">
							<p>{{ data.message }}</p>
						</div>
					</script>

					<script type="text/html" id="tmpl-envato-market-card">
						<div class="envato-market-block" data-id="{{ data.id }}">
							<div class="envato-card {{ data.type }}">
								<div class="envato-card-top">
									<a href="{{ data.url }}" class="column-icon">
										<img src="{{ data.thumbnail_url }}"/>
									</a>
									<div class="column-name">
										<h4>
											<a href="{{ data.url }}">{{ data.name }}</a>
											<span class="version"
												  aria-label="<?php esc_attr_e( 'Version %s', 'envato-market' ); ?>"><?php esc_html_e( 'Version', 'envato-market' ); ?>
												{{ data.version }}</span>
										</h4>
									</div>
									<div class="column-description">
										<div class="description">
											<p>{{ data.description }}</p>
										</div>
										<p class="author">
											<cite><?php esc_html_e( 'By', 'envato-market' ); ?> {{ data.author }}</cite>
										</p>
									</div>
								</div>
								<div class="envato-card-bottom">
									<div class="column-actions">
										<a href="{{{ data.install }}}" class="button button-primary">
											<span aria-hidden="true"><?php esc_html_e( 'Install', 'envato-market' ); ?></span>
											<span class="screen-reader-text"><?php esc_html_e( 'Install', 'envato-market' ); ?> {{ data.name }}</span>
										</a>
									</div>
								</div>
							</div>
						</div>
					</script>
			<?php
		}

		/**
		 * Registers the settings.
		 *
		 * @since 1.0.0
		 */
		public function register_settings() {
			// Setting.
			register_setting( envato_market()->get_slug(), envato_market()->get_option_name() );

			// OAuth section.
			add_settings_section(
				envato_market()->get_option_name() . '_oauth_section',
				__( 'Getting Started (Simple)', 'envato-market' ),
				array( $this, 'render_oauth_section_callback' ),
				envato_market()->get_slug()
			);

			// Token setting.
			add_settings_field(
				'token',
				__( 'Token', 'envato-market' ),
				array( $this, 'render_token_setting_callback' ),
				envato_market()->get_slug(),
				envato_market()->get_option_name() . '_oauth_section'
			);

			// Items section.
			add_settings_section(
				envato_market()->get_option_name() . '_items_section',
				__( 'Single Item Tokens (Advanced)', 'envato-market' ),
				array( $this, 'render_items_section_callback' ),
				envato_market()->get_slug()
			);

			// Items setting.
			add_settings_field(
				'items',
				__( 'Envato Market Items', 'envato-market' ),
				array( $this, 'render_items_setting_callback' ),
				envato_market()->get_slug(),
				envato_market()->get_option_name() . '_items_section'
			);
		}

		/**
		 * Redirect after the enable action runs.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function maybe_redirect() {
			if ( $this->are_we_on_settings_page() ) {

				if ( ! empty( $_GET['action'] ) && 'install-theme' === $_GET['action'] && ! empty( $_GET['enabled'] ) ) {
					wp_safe_redirect( esc_url( envato_market()->get_page_url() ) );
					exit;
				}
			}
		}

		/**
		 * Add authorization notices.
		 *
		 * @since 1.0.0
		 */
		public function add_notices() {

			if ( $this->are_we_on_settings_page() ) {

				// @codeCoverageIgnoreStart
				if ( get_site_transient( envato_market()->get_option_name() . '_check_token' ) || ( isset( $_GET['authorization'] ) && 'check' === $_GET['authorization'] ) ) {
					delete_site_transient( envato_market()->get_option_name() . '_check_token' );
					self::authorization_redirect();
				}
				// @codeCoverageIgnoreEnd
				// Get the option array.
				$option = envato_market()->get_options();

				// Display success/error notices.
				if ( ! empty( $option['notices'] ) ) {
					self::delete_transients();

					// Show succes notice.
					if ( isset( $option['notices']['success'] ) ) {
						add_action(
							( ENVATO_MARKET_NETWORK_ACTIVATED ? 'network_' : '' ) . 'admin_notices',
							array(
								$this,
								'render_success_notice',
							)
						);
					}

					// Show succes no-items notice.
					if ( isset( $option['notices']['success-no-items'] ) ) {
						add_action(
							( ENVATO_MARKET_NETWORK_ACTIVATED ? 'network_' : '' ) . 'admin_notices',
							array(
								$this,
								'render_success_no_items_notice',
							)
						);
					}

					// Show single-use succes notice.
					if ( isset( $option['notices']['success-single-use'] ) ) {
						add_action(
							( ENVATO_MARKET_NETWORK_ACTIVATED ? 'network_' : '' ) . 'admin_notices',
							array(
								$this,
								'render_success_single_use_notice',
							)
						);
					}

					// Show error notice.
					if ( isset( $option['notices']['error'] ) ) {
						add_action(
							( ENVATO_MARKET_NETWORK_ACTIVATED ? 'network_' : '' ) . 'admin_notices',
							array(
								$this,
								'render_error_notice',
							)
						);
					}

					// Show invalid permissions error notice.
					if ( isset( $option['notices']['error-permissions'] ) ) {
						add_action(
							( ENVATO_MARKET_NETWORK_ACTIVATED ? 'network_' : '' ) . 'admin_notices',
							array(
								$this,
								'render_error_permissions',
							)
						);
					}

					// Show single-use error notice.
					if ( isset( $option['notices']['error-single-use'] ) ) {
						add_action(
							( ENVATO_MARKET_NETWORK_ACTIVATED ? 'network_' : '' ) . 'admin_notices',
							array(
								$this,
								'render_error_single_use_notice',
							)
						);
					}

					// Show missing zip notice.
					if ( isset( $option['notices']['missing-package-zip'] ) ) {
						add_action(
							( ENVATO_MARKET_NETWORK_ACTIVATED ? 'network_' : '' ) . 'admin_notices',
							array(
								$this,
								'render_error_missing_zip',
							)
						);
					}

					// Show missing http connection error.
					if ( isset( $option['notices']['http_error'] ) ) {
						add_action(
							( ENVATO_MARKET_NETWORK_ACTIVATED ? 'network_' : '' ) . 'admin_notices',
							array(
								$this,
								'render_error_http',
							)
						);
					}

					// Update the saved data so the notice disappears on the next page load.
					unset( $option['notices'] );

					envato_market()->set_options( $option );
				}
			}
		}

		/**
		 * Set the API values.
		 *
		 * @since 1.0.0
		 */
		public function set_items() {
			if ( $this->are_we_on_settings_page() ) {
				envato_market()->items()->set_themes();
				envato_market()->items()->set_plugins();
			}
		}

		/**
		 * Check if we're on the settings page.
		 *
		 * @since 2.0.0
		 * @access private
		 */
		private function are_we_on_settings_page() {
			return 'toplevel_page_' . envato_market()->get_slug() === get_current_screen()->id || 'toplevel_page_' . envato_market()->get_slug() . '-network' === get_current_screen()->id;
		}

		/**
		 * Check for authorization and redirect.
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function authorization_redirect() {
			self::authorization();
			wp_safe_redirect( esc_url( envato_market()->get_page_url() . '#settings' ) );
			exit;
		}

		/**
		 * Set the Envato API authorization value.
		 *
		 * @since 1.0.0
		 */
		public function authorization() {
			// Get the option array.
			$option            = envato_market()->get_options();
			$option['notices'] = array();

			// Check for global token.
			if ( envato_market()->get_option( 'token' ) || envato_market()->api()->token ) {

				$notice      = 'success';
				$scope_check = $this->authorize_token_permissions();

				if ( 'http_error' === $scope_check ) {
					$notice = 'http_error';
				} elseif ( 'error' === $this->authorize_total_items() || 'error' === $scope_check ) {
					$notice = 'error';
				} else {
					if ( 'missing-permissions' == $scope_check ) {
						$notice = 'error-permissions';
					} elseif ( 'too-many-permissions' === $scope_check ) {
						$notice = 'error-permissions';
					} else {
						$themes_notice  = $this->authorize_themes();
						$plugins_notice = $this->authorize_plugins();
						if ( 'error' === $themes_notice || 'error' === $plugins_notice ) {
							$notice = 'error';
						} elseif ( 'success-no-themes' === $themes_notice && 'success-no-plugins' === $plugins_notice ) {
							$notice = 'success-no-items';
						}
					}
				}
				$option['notices'][ $notice ] = true;
			}

			// Check for single-use token.
			if ( ! empty( $option['items'] ) ) {
				$failed = false;

				foreach ( $option['items'] as $key => $item ) {
					if ( empty( $item['name'] ) || empty( $item['token'] ) || empty( $item['id'] ) || empty( $item['type'] ) || empty( $item['authorized'] ) ) {
						continue;
					}

					$request_args = array(
						'headers' => array(
							'Authorization' => 'Bearer ' . $item['token'],
						),
					);

					// Uncached API response with single-use token.
					$response = envato_market()->api()->item( $item['id'], $request_args );

					if ( ! is_wp_error( $response ) && isset( $response['id'] ) ) {
						$option['items'][ $key ]['authorized'] = 'success';
					} else {
						if ( is_wp_error( $response ) ) {
							$this->store_additional_error_debug_information( 'Unable to query single item ID ' . $item['id'], $response->get_error_message(), $response->get_error_data() );
						}
						$failed                                = true;
						$option['items'][ $key ]['authorized'] = 'failed';
					}
				}

				if ( true === $failed ) {
					$option['notices']['error-single-use'] = true;
				} else {
					$option['notices']['success-single-use'] = true;
				}
			}

			// Set the option array.
			if ( ! empty( $option['notices'] ) ) {
				envato_market()->set_options( $option );
			}
		}

		/**
		 * Check that themes are authorized.
		 *
		 * @return bool
		 * @since 1.0.0
		 */
		public function authorize_total_items() {
			$response = envato_market()->api()->request( 'https://api.envato.com/v1/market/total-items.json' );
			$notice   = 'success';

			if ( is_wp_error( $response ) ) {
				$notice = 'error';
				$this->store_additional_error_debug_information( 'Failed to query total number of items in API response', $response->get_error_message(), $response->get_error_data() );
			} elseif ( ! isset( $response['total-items'] ) ) {
				$notice = 'error';
				$this->store_additional_error_debug_information( 'Incorrect response from API when querying total items' );
			}

			return $notice;
		}


		/**
		 * Get the required API permissions for this plugin to work.
		 *
		 * @single 2.0.1
		 *
		 * @return array
		 */
		public function get_required_permissions() {
			return apply_filters(
				'envato_market_required_permissions',
				array(
					'default'           => 'View and search Envato sites',
					'purchase:download' => 'Download your purchased items',
					'purchase:list'     => 'List purchases you\'ve made',
				)
			);
		}

		/**
		 * Return the URL a user needs to click to generate a personal token.
		 *
		 * @single 2.0.1
		 *
		 * @return string The full URL to request a token.
		 */
		public function get_generate_token_url() {
			return 'https://build.envato.com/create-token/?' . implode(
				'&',
				array_map(
					function ( $val ) {
							return $val . '=t';
					},
					array_keys( $this->get_required_permissions() )
				)
			);
		}

		/**
		 * Check that themes are authorized.
		 *
		 * @return bool
		 * @since 1.0.0
		 */
		public function authorize_token_permissions() {
			$response = envato_market()->api()->request( 'https://api.envato.com/whoami' );
			$notice   = 'success';

			if ( is_wp_error( $response ) && ( $response->get_error_code() === 'http_error' || $response->get_error_code() == 500 ) ) {
				$this->store_additional_error_debug_information( 'An error occured checking token permissions', $response->get_error_message(), $response->get_error_data() );
				$notice = 'http_error';
			} elseif ( is_wp_error( $response ) || ! isset( $response['scopes'] ) || ! is_array( $response['scopes'] ) ) {
				$this->store_additional_error_debug_information( 'No scopes found in API response message', $response->get_error_message(), $response->get_error_data() );
				$notice = 'error';
			} else {

				$minimum_scopes = $this->get_required_permissions();
				$maximum_scopes = array( 'default' => 'Default' ) + $minimum_scopes;

				foreach ( $minimum_scopes as $required_scope => $required_scope_name ) {
					if ( ! in_array( $required_scope, $response['scopes'] ) ) {
						// The scope minimum required scope doesn't exist.
						$this->store_additional_error_debug_information( 'Could not find required API permission scope in output.', $required_scope );
						$notice = 'missing-permissions';
					}
				}
				foreach ( $response['scopes'] as $scope ) {
					if ( ! isset( $maximum_scopes[ $scope ] ) ) {
						// The available scope is outside our maximum bounds.
						$this->store_additional_error_debug_information( 'Found too many permissions on token.', $scope );
						$notice = 'too-many-permissions';
					}
				}
			}

			return $notice;
		}

		/**
		 * Check that themes or plugins are authorized and downloadable.
		 *
		 * @param string $type The filter type, either 'themes' or 'plugins'. Default 'themes'.
		 *
		 * @return bool|null
		 * @since 1.0.0
		 */
		public function authorize_items( $type = 'themes' ) {
			$api_url  = 'https://api.envato.com/v2/market/buyer/list-purchases?filter_by=wordpress-' . $type;
			$response = envato_market()->api()->request( $api_url );
			$notice   = 'success';

			if ( is_wp_error( $response ) ) {
				$notice = 'error';
				$this->store_additional_error_debug_information( 'Error listing buyer purchases.', $response->get_error_message(), $response->get_error_data() );
			} elseif ( empty( $response ) ) {
				$notice = 'error';
				$this->store_additional_error_debug_information( 'Empty API result listing buyer purchases' );
			} elseif ( empty( $response['results'] ) ) {
				$notice = 'success-no-' . $type;
			} else {
				shuffle( $response['results'] );
				$item = array_shift( $response['results'] );
				if ( ! isset( $item['item']['id'] ) || ! envato_market()->api()->download( $item['item']['id'] ) ) {
					$this->store_additional_error_debug_information( 'Failed to find the correct item format in API response' );
					$notice = 'error';
				}
			}

			return $notice;
		}

		/**
		 * Check that themes are authorized.
		 *
		 * @return bool
		 * @since 1.0.0
		 */
		public function authorize_themes() {
			return $this->authorize_items( 'themes' );
		}

		/**
		 * Check that plugins are authorized.
		 *
		 * @return bool
		 * @since 1.0.0
		 */
		public function authorize_plugins() {
			return $this->authorize_items( 'plugins' );
		}

		/**
		 * Install plugin.
		 *
		 * @param string $plugin The plugin item ID.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function install_plugin( $plugin ) {
			if ( ! current_user_can( 'install_plugins' ) ) {
				$msg = '
				<div class="wrap">
					<h1>' . __( 'Installing Plugin...', 'envato-market' ) . '</h1>
					<p>' . __( 'You do not have sufficient permissions to install plugins on this site.', 'envato-market' ) . '</p>
					<a href="' . esc_url( 'admin.php?page=' . envato_market()->get_slug() . '&tab=plugins' ) . '">' . __( 'Return to Plugin Installer', 'envato-market' ) . '</a>
				</div>';
				wp_die( $msg );
			}

			check_admin_referer( 'install-plugin_' . $plugin );

			envato_market()->items()->set_plugins( true );
			$install = envato_market()->items()->plugins( 'install' );
			$api     = new stdClass();

			foreach ( $install as $value ) {
				if ( absint( $value['id'] ) === absint( $plugin ) ) {
					$api->name    = $value['name'];
					$api->version = $value['version'];
				}
			}

			$array_api = (array) $api;

			if ( empty( $array_api ) ) {
				$msg = '
				<div class="wrap">
					<h1>' . __( 'Installing Plugin...', 'envato-market' ) . '</h1>
					<p>' . __( 'An error occurred, please check that the item ID is correct.', 'envato-market' ) . '</p>
					<a href="' . esc_url( 'admin.php?page=' . envato_market()->get_slug() . '&tab=plugins' ) . '">' . __( 'Return to Plugin Installer', 'envato-market' ) . '</a>
				</div>';
				wp_die( $msg );
			}

			$title              = sprintf( __( 'Installing Plugin: %s', 'envato-market' ), esc_html( $api->name . ' ' . $api->version ) );
			$nonce              = 'install-plugin_' . $plugin;
			$url                = 'admin.php?page=' . envato_market()->get_slug() . '&action=install-plugin&plugin=' . urlencode( $plugin );
			$type               = 'web'; // Install plugin type, From Web or an Upload.
			$api->download_link = envato_market()->api()->download( $plugin, $this->set_bearer_args( $plugin ) );

			// Must have the upgrader & skin.
			require envato_market()->get_plugin_path() . '/inc/admin/class-envato-market-theme-upgrader.php';
			require envato_market()->get_plugin_path() . '/inc/admin/class-envato-market-theme-installer-skin.php';

			$upgrader = new Envato_Market_Plugin_Upgrader( new Envato_Market_Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) );
			$upgrader->install( $api->download_link );
		}

		/**
		 * Install theme.
		 *
		 * @param string $theme The theme item ID.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function install_theme( $theme ) {
			if ( ! current_user_can( 'install_themes' ) ) {
				$msg = '
				<div class="wrap">
					<h1>' . __( 'Installing Theme...', 'envato-market' ) . '</h1>
					<p>' . __( 'You do not have sufficient permissions to install themes on this site.', 'envato-market' ) . '</p>
					<a href="' . esc_url( 'admin.php?page=' . envato_market()->get_slug() . '&tab=themes' ) . '">' . __( 'Return to Theme Installer', 'envato-market' ) . '</a>
				</div>';
				wp_die( $msg );
			}

			check_admin_referer( 'install-theme_' . $theme );

			envato_market()->items()->set_themes( true );
			$install = envato_market()->items()->themes( 'install' );
			$api     = new stdClass();

			foreach ( $install as $value ) {
				if ( absint( $value['id'] ) === absint( $theme ) ) {
					$api->name    = $value['name'];
					$api->version = $value['version'];
				}
			}

			$array_api = (array) $api;

			if ( empty( $array_api ) ) {
				$msg = '
				<div class="wrap">
					<h1>' . __( 'Installing Theme...', 'envato-market' ) . '</h1>
					<p>' . __( 'An error occurred, please check that the item ID is correct.', 'envato-market' ) . '</p>
					<a href="' . esc_url( 'admin.php?page=' . envato_market()->get_slug() . '&tab=themes' ) . '">' . __( 'Return to Plugin Installer', 'envato-market' ) . '</a>
				</div>';
				wp_die( $msg );
			}

			wp_enqueue_script( 'customize-loader' );

			$title              = sprintf( __( 'Installing Theme: %s', 'envato-market' ), esc_html( $api->name . ' ' . $api->version ) );
			$nonce              = 'install-theme_' . $theme;
			$url                = 'admin.php?page=' . envato_market()->get_slug() . '&action=install-theme&theme=' . urlencode( $theme );
			$type               = 'web'; // Install theme type, From Web or an Upload.
			$api->download_link = envato_market()->api()->download( $theme, $this->set_bearer_args( $theme ) );

			// Must have the upgrader & skin.
			require_once envato_market()->get_plugin_path() . '/inc/admin/class-envato-market-theme-upgrader.php';
			require_once envato_market()->get_plugin_path() . '/inc/admin/class-envato-market-theme-installer-skin.php';

			$upgrader = new Envato_Market_Theme_Upgrader( new Envato_Market_Theme_Installer_Skin( compact( 'title', 'url', 'nonce', 'api' ) ) );
			$upgrader->install( $api->download_link );
		}

		/**
		 * AJAX handler for adding items that use a non global token.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function ajax_add_item() {
			if ( ! check_ajax_referer( self::AJAX_ACTION, 'nonce', false ) ) {
				status_header( 400 );
				wp_send_json_error( 'bad_nonce' );
			} elseif ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
				status_header( 405 );
				wp_send_json_error( 'bad_method' );
			} elseif ( empty( $_POST['token'] ) ) {
				wp_send_json_error( array( 'message' => __( 'The Token is missing.', 'envato-market' ) ) );
			} elseif ( empty( $_POST['id'] ) ) {
				wp_send_json_error( array( 'message' => __( 'The Item ID is missing.', 'envato-market' ) ) );
			}

			$args = array(
				'headers' => array(
					'Authorization' => 'Bearer ' . $_POST['token'],
				),
			);

			$request = envato_market()->api()->item( $_POST['id'], $args );
			if ( false === $request ) {
				wp_send_json_error( array( 'message' => __( 'The Token or Item ID is incorrect.', 'envato-market' ) ) );
			}

			if ( false === envato_market()->api()->download( $_POST['id'], $args ) ) {
				wp_send_json_error( array( 'message' => __( 'The item cannot be downloaded.', 'envato-market' ) ) );
			}

			if ( isset( $request['number_of_sales'] ) ) {
				$type = 'plugin';
			} else {
				$type = 'theme';
			}

			if ( isset( $type ) ) {
				$response = array(
					'name'       => $request['name'],
					'token'      => $_POST['token'],
					'id'         => $_POST['id'],
					'type'       => $type,
					'authorized' => 'success',
				);

				$options = get_option( envato_market()->get_option_name(), array() );

				if ( ! empty( $options['items'] ) ) {
					$options['items'] = array_values( $options['items'] );
					$key              = count( $options['items'] );
				} else {
					$options['items'] = array();
					$key              = 0;
				}

				$options['items'][] = $response;

				envato_market()->set_options( $options );

				// Rebuild the theme cache.
				if ( 'theme' === $type ) {
					envato_market()->items()->set_themes( true, false );

					$install_link = add_query_arg(
						array(
							'page'   => envato_market()->get_slug(),
							'action' => 'install-theme',
							'id'     => $_POST['id'],
						),
						self_admin_url( 'admin.php' )
					);

					$request['install'] = wp_nonce_url( $install_link, 'install-theme_' . $_POST['id'] );
				}

				// Rebuild the plugin cache.
				if ( 'plugin' === $type ) {
					envato_market()->items()->set_plugins( true, false );

					$install_link = add_query_arg(
						array(
							'page'   => envato_market()->get_slug(),
							'action' => 'install-plugin',
							'id'     => $_POST['id'],
						),
						self_admin_url( 'admin.php' )
					);

					$request['install'] = wp_nonce_url( $install_link, 'install-plugin_' . $_POST['id'] );
				}

				$response['key']  = $key;
				$response['item'] = $request;
				wp_send_json_success( $response );
			}

			wp_send_json_error( array( 'message' => __( 'An unknown error occurred.', 'envato-market' ) ) );
		}

		/**
		 * AJAX handler for removing items that use a non global token.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function ajax_remove_item() {
			if ( ! check_ajax_referer( self::AJAX_ACTION, 'nonce', false ) ) {
				status_header( 400 );
				wp_send_json_error( 'bad_nonce' );
			} elseif ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
				status_header( 405 );
				wp_send_json_error( 'bad_method' );
			} elseif ( empty( $_POST['id'] ) ) {
				wp_send_json_error( array( 'message' => __( 'The Item ID is missing.', 'envato-market' ) ) );
			}

			$options = get_option( envato_market()->get_option_name(), array() );
			$type    = '';

			foreach ( $options['items'] as $key => $item ) {
				if ( $item['id'] === $_POST['id'] ) {
					$type = $item['type'];
					unset( $options['items'][ $key ] );
					break;
				}
			}
			$options['items'] = array_values( $options['items'] );

			envato_market()->set_options( $options );

			// Rebuild the theme cache.
			if ( 'theme' === $type ) {
				envato_market()->items()->set_themes( true, false );
			}

			// Rebuild the plugin cache.
			if ( 'plugin' === $type ) {
				envato_market()->items()->set_plugins( true, false );
			}

			wp_send_json_success();
		}

		/**
		 * AJAX handler for performing a healthcheck of the current website.
		 *
		 * @since 2.0.6
		 * @codeCoverageIgnore
		 */
		public function ajax_healthcheck() {
			if ( ! check_ajax_referer( self::AJAX_ACTION, 'nonce', false ) ) {
				status_header( 400 );
				wp_send_json_error( 'bad_nonce' );
			} elseif ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
				status_header( 405 );
				wp_send_json_error( 'bad_method' );
			}

			$limits = $this->get_server_limits();

			wp_send_json_success( array(
				'limits' => $limits
			) );
		}

	  /**
	   * AJAX handler for performing a healthcheck of the current website.
	   *
	   * @since 2.0.6
	   * @codeCoverageIgnore
	   */
	  public function get_server_limits() {
		  $limits = [];

		  // Check memory limit is > 256 M
		  try {
			  $memory_limit         = wp_convert_hr_to_bytes( ini_get( 'memory_limit' ) );
			  $memory_limit_desired = 256;
			  $memory_limit_ok      = $memory_limit < 0 || $memory_limit >= $memory_limit_desired * 1024 * 1024;
			  $memory_limit_in_mb   = $memory_limit < 0 ? 'Unlimited' : floor( $memory_limit / ( 1024 * 1024 ) ) . 'M';

			  $limits['memory_limit'] = [
				  'title'   => 'PHP Memory Limit',
				  'ok'      => $memory_limit_ok,
				  'message' => $memory_limit_ok ? "is ok at ${memory_limit_in_mb}." : "${memory_limit_in_mb} may be too small. If you are having issues please set your PHP memory limit to at least 256M - or ask your hosting provider to do this if you're unsure."
			  ];
		  } catch ( \Exception $e ) {
			  $limits['memory_limit'] = [
				  'title'   => 'PHP Memory Limit',
				  'ok'      => false,
				  'message' => 'Failed to check memory limit. If you are having issues please ask hosting provider to raise the memory limit for you.'
			  ];
		  }

		  // Check upload size.
		  try {
			  $upload_size_desired = 80;

			  $upload_max_filesize       = wp_max_upload_size();
			  $upload_max_filesize_ok    = $upload_max_filesize < 0 || $upload_max_filesize >= $upload_size_desired * 1024 * 1024;
			  $upload_max_filesize_in_mb = $upload_max_filesize < 0 ? 'Unlimited' : floor( $upload_max_filesize / ( 1024 * 1024 ) ) . 'M';

			  $limits['upload'] = [
				  'ok'      => $upload_max_filesize_ok,
				  'title'   => 'PHP Upload Limits',
				  'message' => $upload_max_filesize_ok ? "is ok at $upload_max_filesize_in_mb." : "$upload_max_filesize_in_mb may be too small. If you are having issues please set your PHP upload limits to at least ${upload_size_desired}M - or ask your hosting provider to do this if you're unsure.",
			  ];
		  } catch ( \Exception $e ) {
			  $limits['upload'] = [
				  'title'   => 'PHP Upload Limits',
				  'ok'      => false,
				  'message' => 'Failed to check upload limit. If you are having issues please ask hosting provider to raise the upload limit for you.'
			  ];
		  }

		  // Check max_input_vars.
		  try {
			  $max_input_vars         = ini_get( 'max_input_vars' );
			  $max_input_vars_desired = 1000;
			  $max_input_vars_ok      = $max_input_vars < 0 || $max_input_vars >= $max_input_vars_desired;

			  $limits['max_input_vars'] = [
				  'ok'      => $max_input_vars_ok,
				  'title'   => 'PHP Max Input Vars',
				  'message' => $max_input_vars_ok ? "is ok at $max_input_vars." : "$max_input_vars may be too small. If you are having issues please set your PHP max input vars to at least $max_input_vars_desired - or ask your hosting provider to do this if you're unsure.",
			  ];
		  } catch ( \Exception $e ) {
			  $limits['max_input_vars'] = [
				  'title'   => 'PHP Max Input Vars',
				  'ok'      => false,
				  'message' => 'Failed to check input vars limit. If you are having issues please ask hosting provider to raise the input vars limit for you.'
			  ];
		  }

		  // Check max_execution_time.
		  try {
			  $max_execution_time         = ini_get( 'max_execution_time' );
			  $max_execution_time_desired = 60;
			  $max_execution_time_ok      = $max_execution_time <= 0 || $max_execution_time >= $max_execution_time_desired;

			  $limits['max_execution_time'] = [
				  'ok'      => $max_execution_time_ok,
				  'title'   => 'PHP Execution Time',
				  'message' => $max_execution_time_ok ? "PHP execution time limit is ok at ${max_execution_time}." : "$max_execution_time is too small. Please set your PHP max execution time to at least $max_execution_time_desired - or ask your hosting provider to do this if you're unsure.",
			  ];
		  } catch ( \Exception $e ) {
			  $limits['max_execution_time'] = [
				  'title'   => 'PHP Execution Time',
				  'ok'      => false,
				  'message' => 'Failed to check PHP execution time limit. Please ask hosting provider to raise this limit for you.'
			  ];
		  }

		  // Check various hostname connectivity.
		  $hosts_to_check = array(
			  array(
				  'hostname' => 'envato.github.io',
				  'url'      => 'https://envato.github.io/wp-envato-market/dist/update-check.json',
				  'title'    => 'Plugin Update API',
			  ),
			  array(
				  'hostname' => 'api.envato.com',
				  'url'      => 'https://api.envato.com/ping',
				  'title'    => 'Envato Market API',
			  ),
			  array(
				  'hostname' => 'marketplace.envato.com',
				  'url'      => 'https://marketplace.envato.com/robots.txt',
				  'title'    => 'Download API',
			  ),
		  );

		  foreach ( $hosts_to_check as $host ) {
			  try {
				  $response      = wp_remote_get( $host['url'], [
					  'user-agent' => 'WordPress - Envato Market ' . envato_market()->get_version(),
					  'timeout'    => 5,
				  ] );
				  $response_code = wp_remote_retrieve_response_code( $response );
				  if ( $response && ! is_wp_error( $response ) && $response_code === 200 ) {
					  $limits[ $host['hostname'] ] = [
						  'ok'      => true,
						  'title'   => $host['title'],
						  'message' => 'Connected ok.',
					  ];
				  } else {
					  $limits[ $host['hostname'] ] = [
						  'ok'      => false,
						  'title'   => $host['title'],
						  'message' => "Connection failed. Status '$response_code'. Please ensure PHP is allowed to connect to the host '" . $host['hostname'] . "' - or ask your hosting provider to do this if you’re unsure. " . ( is_wp_error( $response ) ? $response->get_error_message() : '' ),
					  ];
				  }
			  } catch ( \Exception $e ) {
				  $limits[ $host['hostname'] ] = [
					  'ok'      => true,
					  'title'   => $host['title'],
					  'message' => "Connection failed. Please contact the hosting provider and ensure PHP is allowed to connect to the host '" . $host['hostname'] . "'. " . $e->getMessage(),
				  ];
			  }
		  }


		  // Check authenticated API request
		  $response = envato_market()->api()->request( 'https://api.envato.com/whoami' );

		  if ( is_wp_error( $response ) ) {
			  $limits['authentication'] = [
				  'ok'      => false,
				  'title'   => 'Envato API Authentication',
				  'message' => "Not currently authenticated with the Envato API. Please add your API token. " . $response->get_error_message(),
			  ];
		  } elseif ( ! isset( $response['scopes'] ) ) {
			  $limits['authentication'] = [
				  'ok'      => false,
				  'title'   => 'Envato API Authentication',
				  'message' => "Missing API permissions. Please re-create your Envato API token with the correct permissions. ",
			  ];
		  } else {
			  $minimum_scopes    = $this->get_required_permissions();
			  $maximum_scopes    = array( 'default' => 'Default' ) + $minimum_scopes;
			  $missing_scopes    = array();
			  $additional_scopes = array();
			  foreach ( $minimum_scopes as $required_scope => $required_scope_name ) {
				  if ( ! in_array( $required_scope, $response['scopes'] ) ) {
					  // The scope minimum required scope doesn't exist.
					  $missing_scopes [] = $required_scope;
				  }
			  }
			  foreach ( $response['scopes'] as $scope ) {
				  if ( ! isset( $maximum_scopes[ $scope ] ) ) {
					  // The available scope is outside our maximum bounds.
					  $additional_scopes [] = $scope;
				  }
			  }
			  $limits['authentication'] = [
				  'ok'      => true,
				  'title'   => 'Envato API Authentication',
				  'message' => "Authenticated successfully with correct scopes: " . implode( ', ', $response['scopes'] ),
			  ];
		  }

		  $debug_enabled      = defined( 'WP_DEBUG' ) && WP_DEBUG;
		  $limits['wp_debug'] = [
			  'ok'      => ! $debug_enabled,
			  'title'   => 'WP Debug',
			  'message' => $debug_enabled ? 'If you’re on a production website, it’s best to set WP_DEBUG to false, please ask your hosting provider to do this if you’re unsure.' : 'WP Debug is disabled, all ok.',
		  ];

		  $zip_archive_installed = class_exists( '\ZipArchive' );
		  $limits['zip_archive'] = [
			  'ok'      => $zip_archive_installed,
			  'title'   => 'ZipArchive Support',
			  'message' => $zip_archive_installed ? 'ZipArchive is available.' : 'ZipArchive is not available. If you have issues installing or updating items please ask your hosting provider to enable ZipArchive.',
		  ];


		  $php_version_ok        = version_compare( PHP_VERSION, '7.0', '>=' );
		  $limits['php_version'] = [
			  'ok'      => $php_version_ok,
			  'title'   => 'PHP Version',
			  'message' => $php_version_ok ? 'PHP version is ok at ' . PHP_VERSION . '.' : 'Please ask the hosting provider to upgrade your PHP version to at least 7.0 or above.',
		  ];

		  require_once( ABSPATH . 'wp-admin/includes/file.php' );
		  $current_filesystem_method = get_filesystem_method();
		  if ( $current_filesystem_method !== 'direct' ) {
			  $limits['filesystem_method'] = [
				  'ok'      => false,
				  'title'   => 'WordPress Filesystem',
				  'message' => 'Please enable WordPress FS_METHOD direct - or ask your hosting provider to do this if you’re unsure.',
			  ];
		  }

		  $wp_upload_dir                 = wp_upload_dir();
		  $upload_base_dir               = $wp_upload_dir['basedir'];
		  $upload_base_dir_writable      = is_writable( $upload_base_dir );
		  $limits['wp_content_writable'] = [
			  'ok'      => $upload_base_dir_writable,
			  'title'   => 'WordPress File Permissions',
			  'message' => $upload_base_dir_writable ? 'is ok.' : 'Please set correct WordPress PHP write permissions for the wp-content directory - or ask your hosting provider to do this if you’re unsure.',
		  ];

		  $active_plugins    = get_option( 'active_plugins' );
		  $active_plugins_ok = count( $active_plugins ) < 15;
		  if ( ! $active_plugins_ok ) {
			  $limits['active_plugins'] = [
				  'ok'      => false,
				  'title'   => 'Active Plugins',
				  'message' => 'Please try to reduce the number of active plugins on your WordPress site, as this will slow things down.',
			  ];
		  }

		  return $limits;
	  }


	  /**
		 * Admin page callback.
		 *
		 * @since 1.0.0
		 */
		public function render_admin_callback() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/callback/admin.php' );
		}

		/**
		 * OAuth section callback.
		 *
		 * @since 1.0.0
		 */
		public function render_oauth_section_callback() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/callback/section/oauth.php' );
		}

		/**
		 * Items section callback.
		 *
		 * @since 1.0.0
		 */
		public function render_items_section_callback() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/callback/section/items.php' );
		}

		/**
		 * Token setting callback.
		 *
		 * @since 1.0.0
		 */
		public function render_token_setting_callback() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/callback/setting/token.php' );
		}

		/**
		 * Items setting callback.
		 *
		 * @since 1.0.0
		 */
		public function render_items_setting_callback() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/callback/setting/items.php' );
		}

		/**
		 * Intro
		 *
		 * @since 1.0.0
		 */
		public function render_intro_partial() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/partials/intro.php' );
		}

		/**
		 * Tabs
		 *
		 * @since 1.0.0
		 */
		public function render_tabs_partial() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/partials/tabs.php' );
		}

		/**
		 * Settings panel
		 *
		 * @since 1.0.0
		 */
		public function render_settings_panel_partial() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/partials/settings.php' );
		}


		/**
		 * Help panel
		 *
		 * @since 2.0.1
		 */
		public function render_help_panel_partial() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/partials/help.php' );
		}

		/**
		 * Themes panel
		 *
		 * @since 1.0.0
		 */
		public function render_themes_panel_partial() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/partials/themes.php' );
		}

		/**
		 * Plugins panel
		 *
		 * @since 1.0.0
		 */
		public function render_plugins_panel_partial() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/partials/plugins.php' );
		}

		/**
		 * Success notice.
		 *
		 * @since 1.0.0
		 */
		public function render_success_notice() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/notice/success.php' );
		}

		/**
		 * Success no-items notice.
		 *
		 * @since 1.0.0
		 */
		public function render_success_no_items_notice() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/notice/success-no-items.php' );
		}

		/**
		 * Success single-use notice.
		 *
		 * @since 1.0.0
		 */
		public function render_success_single_use_notice() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/notice/success-single-use.php' );
		}

		/**
		 * Error details.
		 *
		 * @since 2.0.2
		 */
		public function render_additional_error_details() {
			$error_details = get_site_transient( envato_market()->get_option_name() . '_error_information' );
			if ( $error_details && ! empty( $error_details['title'] ) ) {
				extract( $error_details );
				require( envato_market()->get_plugin_path() . 'inc/admin/view/notice/error-details.php' );
			}
		}

		/**
		 * Error notice.
		 *
		 * @since 1.0.0
		 */
		public function render_error_notice() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/notice/error.php' );
			$this->render_additional_error_details();
		}

		/**
		 * Permission error notice.
		 *
		 * @since 2.0.1
		 */
		public function render_error_permissions() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/notice/error-permissions.php' );
			$this->render_additional_error_details();
		}

		/**
		 * Error single-use notice.
		 *
		 * @since 1.0.0
		 */
		public function render_error_single_use_notice() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/notice/error-single-use.php' );
			$this->render_additional_error_details();
		}

		/**
		 * Error missing zip.
		 *
		 * @since 2.0.1
		 */
		public function render_error_missing_zip() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/notice/error-missing-zip.php' );
			$this->render_additional_error_details();
		}

		/**
		 * Error http
		 *
		 * @since 2.0.1
		 */
		public function render_error_http() {
			require( envato_market()->get_plugin_path() . 'inc/admin/view/notice/error-http.php' );
			$this->render_additional_error_details();
		}

		/**
		 * Use the Settings API when in network mode.
		 *
		 * This allows us to make use of the same WordPress Settings API when displaying the menu item in network mode.
		 *
		 * @since 2.0.0
		 */
		public function save_network_settings() {
			check_admin_referer( envato_market()->get_slug() . '-options' );

			global $new_whitelist_options;
			$options = $new_whitelist_options[ envato_market()->get_slug() ];

			foreach ( $options as $option ) {
				if ( isset( $_POST[ $option ] ) ) {
					update_site_option( $option, $_POST[ $option ] );
				} else {
					delete_site_option( $option );
				}
			}
			wp_redirect( envato_market()->get_page_url() );
			exit;
		}

		/**
		 * Store additional error information in transient so users can self debug.
		 *
		 * @since 2.0.2
		 */
		public function store_additional_error_debug_information( $title, $message = '', $data = [] ) {
			set_site_transient(
				envato_market()->get_option_name() . '_error_information',
				[
					'title'   => $title,
					'message' => $message,
					'data'    => $data,
				],
				120
			);
		}
	}

endif;
admin/class-envato-market-theme-upgrader.php000064400000003723151327206010015136 0ustar00<?php
/**
 * Theme Upgrader class.
 *
 * @package Envato_Market
 */

// Include the WP_Upgrader class.
if ( ! class_exists( 'WP_Upgrader', false ) ) :
	include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
endif;

if ( ! class_exists( 'Envato_Market_Theme_Upgrader' ) ) :

	/**
	 * Extends the WordPress Theme_Upgrader class.
	 *
	 * This class makes modifications to the strings during install & upgrade.
	 *
	 * @class Envato_Market_Plugin_Upgrader
	 * @version 1.0.0
	 * @since 1.0.0
	 */
	class Envato_Market_Theme_Upgrader extends Theme_Upgrader {

		/**
		 * Initialize the upgrade strings.
		 *
		 * @since 1.0.0
		 */
		public function upgrade_strings() {
			parent::upgrade_strings();

			$this->strings['downloading_package'] = __( 'Downloading the Envato Market upgrade package&#8230;', 'envato-market' );
		}

		/**
		 * Initialize the install strings.
		 *
		 * @since 1.0.0
		 */
		public function install_strings() {
			parent::install_strings();

			$this->strings['downloading_package'] = __( 'Downloading the Envato Market install package&#8230;', 'envato-market' );
		}
	}

endif;

if ( ! class_exists( 'Envato_Market_Plugin_Upgrader' ) ) :

	/**
	 * Extends the WordPress Plugin_Upgrader class.
	 *
	 * This class makes modifications to the strings during install & upgrade.
	 *
	 * @class Envato_Market_Plugin_Upgrader
	 * @version 1.0.0
	 * @since 1.0.0
	 */
	class Envato_Market_Plugin_Upgrader extends Plugin_Upgrader {

		/**
		 * Initialize the upgrade strings.
		 *
		 * @since 1.0.0
		 */
		public function upgrade_strings() {
			parent::upgrade_strings();

			$this->strings['downloading_package'] = __( 'Downloading the Envato Market upgrade package&#8230;', 'envato-market' );
		}

		/**
		 * Initialize the install strings.
		 *
		 * @since 1.0.0
		 */
		public function install_strings() {
			parent::install_strings();

			$this->strings['downloading_package'] = __( 'Downloading the Envato Market install package&#8230;', 'envato-market' );
		}
	}

endif;
admin/functions.php000064400000037607151327206010010367 0ustar00<?php
/**
 * Functions
 *
 * @package Envato_Market
 */

/**
 * Interate over the themes array and displays each theme.
 *
 * @since 1.0.0
 *
 * @param string $group The theme group. Options are 'purchased', 'active', 'installed', or 'install'.
 */
function envato_market_themes_column( $group = 'install' ) {
	$premium = envato_market()->items()->themes( $group );
	if ( empty( $premium ) ) {
		return;
	}

	foreach ( $premium as $slug => $theme ) :
		$name               = $theme['name'];
		$author             = $theme['author'];
		$version            = $theme['version'];
		$description        = $theme['description'];
		$url                = $theme['url'];
		$author_url         = $theme['author_url'];
		$theme['hasUpdate'] = false;

		if ( 'active' === $group || 'installed' === $group ) {
			$get_theme = wp_get_theme( $slug );
			if ( $get_theme->exists() ) {
				$name        = $get_theme->get( 'Name' );
				$author      = $get_theme->get( 'Author' );
				$version     = $get_theme->get( 'Version' );
				$description = $get_theme->get( 'Description' );
				$author_url  = $get_theme->get( 'AuthorURI' );
				if ( version_compare( $version, $theme['version'], '<' ) ) {
					$theme['hasUpdate'] = true;
				}
			}
		}

		// Setup the column CSS classes.
		$classes = array( 'envato-card', 'theme' );

		if ( 'active' === $group ) {
			$classes[] = 'active';
		}

		// Setup the update action links.
		$update_actions = array();

		if ( true === $theme['hasUpdate'] ) {
			$classes[] = 'update';
			$classes[] = 'envato-card-' . esc_attr( $slug );

			if ( current_user_can( 'update_themes' ) ) {
				// Upgrade link.
				$upgrade_link = add_query_arg(
					array(
						'action' => 'upgrade-theme',
						'theme'  => esc_attr( $slug ),
					),
					self_admin_url( 'update.php' )
				);

				$update_actions['update'] = sprintf(
					'<a class="update-now" href="%1$s" aria-label="%2$s" data-name="%3$s %5$s" data-slug="%4$s" data-version="%5$s">%6$s</a>',
					wp_nonce_url( $upgrade_link, 'upgrade-theme_' . $slug ),
					esc_attr__( 'Update %s now', 'envato-market' ),
					esc_attr( $name ),
					esc_attr( $slug ),
					esc_attr( $theme['version'] ),
					esc_html__( 'Update Available', 'envato-market' )
				);

				$update_actions['details'] = sprintf(
					'<a href="%1$s" class="details" title="%2$s" target="_blank">%3$s</a>',
					esc_url( $url ),
					esc_attr( $name ),
					sprintf(
						__( 'View version %1$s details.', 'envato-market' ),
						$theme['version']
					)
				);
			}
		}

		// Setup the action links.
		$actions = array();

		if ( 'active' === $group && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
			// Customize theme.
			$customize_url        = admin_url( 'customize.php' );
			$customize_url       .= '?theme=' . urlencode( $slug );
			$customize_url       .= '&return=' . urlencode( envato_market()->get_page_url() . '#themes' );
			$actions['customize'] = '<a href="' . esc_url( $customize_url ) . '" class="button button-primary load-customize hide-if-no-customize"><span aria-hidden="true">' . __( 'Customize', 'envato-market' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Customize &#8220;%s&#8221;', 'envato-market' ), $name ) . '</span></a>';
		} elseif ( 'installed' === $group ) {
			$can_activate = true;

			// @codeCoverageIgnoreStart
			// Multisite needs special attention.
			if ( is_multisite() && ! $get_theme->is_allowed( 'both' ) && current_user_can( 'manage_sites' ) ) {
				$can_activate = false;
				if ( current_user_can( 'manage_network_themes' ) ) {
					$actions['network_enable'] = '<a href="' . esc_url( network_admin_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . urlencode( $slug ) . '&amp;paged=1&amp;s', 'enable-theme_' . $slug ) ) ) . '" class="button"><span aria-hidden="true">' . __( 'Network Enable', 'envato-market' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Network Enable &#8220;%s&#8221;', 'envato-market' ), $name ) . '</span></a>';
				}
			}
			// @codeCoverageIgnoreEnd
			// Can activate theme.
			if ( $can_activate && current_user_can( 'switch_themes' ) ) {
				$activate_link = add_query_arg(
					array(
						'action'     => 'activate',
						'stylesheet' => urlencode( $slug ),
					),
					admin_url( 'themes.php' )
				);
				$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $slug );

				// Activate link.
				$actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="button"><span aria-hidden="true">' . __( 'Activate', 'envato-market' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Activate &#8220;%s&#8221;', 'envato-market' ), $name ) . '</span></a>';

				// Preview theme.
				if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
					$preview_url                  = admin_url( 'customize.php' );
					$preview_url                 .= '?theme=' . urlencode( $slug );
					$preview_url                 .= '&return=' . urlencode( envato_market()->get_page_url() . '#themes' );
					$actions['customize_preview'] = '<a href="' . esc_url( $preview_url ) . '" class="button button-primary load-customize hide-if-no-customize"><span aria-hidden="true">' . __( 'Live Preview', 'envato-market' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;', 'envato-market' ), $name ) . '</span></a>';
				}
			}
		} elseif ( 'install' === $group && current_user_can( 'install_themes' ) ) {
			// Install link.
			$install_link = add_query_arg(
				array(
					'page'   => envato_market()->get_slug(),
					'action' => 'install-theme',
					'id'     => $theme['id'],
				),
				self_admin_url( 'admin.php' )
			);

			$actions['install'] = '
			<a href="' . wp_nonce_url( $install_link, 'install-theme_' . $theme['id'] ) . '" class="button button-primary">
				<span aria-hidden="true">' . __( 'Install', 'envato-market' ) . '</span>
				<span class="screen-reader-text">' . sprintf( __( 'Install %s', 'envato-market' ), $name ) . '</span>
			</a>';
		}
		if ( 0 === strrpos( html_entity_decode( $author ), '<a ' ) ) {
			$author_link = $author;
		} else {
			$author_link = '<a href="' . esc_url( $author_url ) . '">' . esc_html( $author ) . '</a>';
		}
		?>
		<div class="envato-market-block" data-id="<?php echo esc_attr( $theme['id'] ); ?>">
			<div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
				<div class="envato-card-top">
					<a href="<?php echo esc_url( $url ); ?>" class="column-icon">
						<img src="<?php echo esc_url( $theme['thumbnail_url'] ); ?>"/>
					</a>
					<div class="column-name">
						<h4>
							<a href="<?php echo esc_url( $url ); ?>"><?php echo esc_html( $name ); ?></a>
							<span class="version" aria-label="<?php esc_attr_e( 'Version %s', 'envato-market' ); ?>">
								<?php echo esc_html( sprintf( __( 'Version %s', 'envato-market' ), $version ) ); ?>
							</span>
						</h4>
					</div>
					<div class="column-description">
						<div class="description">
							<?php echo wp_kses_post( wpautop( strip_tags( $description ) ) ); ?>
						</div>
						<p class="author">
							<cite>
								<?php esc_html_e( 'By', 'envato-market' ); ?>
								<?php echo wp_kses_post( $author_link ); ?>
							</cite>
						</p>
					</div>
					<?php if ( ! empty( $update_actions ) ) { ?>
						<div class="column-update">
							<?php echo implode( "\n", $update_actions ); ?>
						</div>
					<?php } ?>
				</div>
				<div class="envato-card-bottom">
					<div class="column-rating">
						<?php
						if ( ! empty( $theme['rating'] ) ) {
							if ( is_array( $theme['rating'] ) && ! empty( $theme['rating']['count'] ) ) {
								wp_star_rating(
									array(
										'rating' => $theme['rating']['count'] > 0 ? ( $theme['rating']['rating'] / 5 * 100 ) : 0,
										'type'   => 'percent',
										'number' => $theme['rating']['count'],
									)
								);
							} else {
								wp_star_rating(
									array(
										'rating' => $theme['rating'] > 0 ? ( $theme['rating'] / 5 * 100 ) : 0,
										'type'   => 'percent',
									)
								);
							}
						}
						?>
					</div>
					<div class="column-actions">
						<?php echo implode( "\n", $actions ); ?>
					</div>
				</div>
			</div>
		</div>
		<?php
	endforeach;
}

/**
 * Interate over the plugins array and displays each plugin.
 *
 * @since 1.0.0
 *
 * @param string $group The plugin group. Options are 'purchased', 'active', 'installed', or 'install'.
 */
function envato_market_plugins_column( $group = 'install' ) {
	$premium = envato_market()->items()->plugins( $group );
	if ( empty( $premium ) ) {
		return;
	}

	$plugins = envato_market()->items()->wp_plugins();

	foreach ( $premium as $slug => $plugin ) :
		$name                = $plugin['name'];
		$author              = $plugin['author'];
		$version             = $plugin['version'];
		$description         = $plugin['description'];
		$url                 = $plugin['url'];
		$author_url          = $plugin['author_url'];
		$plugin['hasUpdate'] = false;

		// Setup the column CSS classes.
		$classes = array( 'envato-card', 'plugin' );

		if ( 'active' === $group ) {
			$classes[] = 'active';
		}

		// Setup the update action links.
		$update_actions = array();

		// Check for an update.
		if ( isset( $plugins[ $slug ] ) && version_compare( $plugins[ $slug ]['Version'], $plugin['version'], '<' ) ) {
			$plugin['hasUpdate'] = true;

			$classes[] = 'update';
			$classes[] = 'envato-card-' . sanitize_key( dirname( $slug ) );

			if ( current_user_can( 'update_plugins' ) ) {
				// Upgrade link.
				$upgrade_link = add_query_arg(
					array(
						'action' => 'upgrade-plugin',
						'plugin' => $slug,
					),
					self_admin_url( 'update.php' )
				);

				// Details link.
				$details_link = add_query_arg(
					array(
						'action'    => 'upgrade-plugin',
						'tab'       => 'plugin-information',
						'plugin'    => dirname( $slug ),
						'section'   => 'changelog',
						'TB_iframe' => 'true',
						'width'     => 640,
						'height'    => 662,
					),
					self_admin_url( 'plugin-install.php' )
				);

				$update_actions['update'] = sprintf(
					'<a class="update-now" href="%1$s" aria-label="%2$s" data-name="%3$s %6$s" data-plugin="%4$s" data-slug="%5$s" data-version="%6$s">%7$s</a>',
					wp_nonce_url( $upgrade_link, 'upgrade-plugin_' . $slug ),
					esc_attr__( 'Update %s now', 'envato-market' ),
					esc_attr( $name ),
					esc_attr( $slug ),
					sanitize_key( dirname( $slug ) ),
					esc_attr( $version ),
					esc_html__( 'Update Available', 'envato-market' )
				);

				$update_actions['details'] = sprintf(
					'<a href="%1$s" class="thickbox details" title="%2$s">%3$s</a>',
					esc_url( $details_link ),
					esc_attr( $name ),
					sprintf(
						__( 'View version %1$s details.', 'envato-market' ),
						$version
					)
				);
			}
		}

		// Setup the action links.
		$actions = array();

		if ( 'active' === $group ) {
			// Deactivate link.
			$deactivate_link = add_query_arg(
				array(
					'action' => 'deactivate',
					'plugin' => $slug,
				),
				self_admin_url( 'plugins.php' )
			);

			$actions['deactivate'] = '
			<a href="' . wp_nonce_url( $deactivate_link, 'deactivate-plugin_' . $slug ) . '" class="button">
				<span aria-hidden="true">' . __( 'Deactivate', 'envato-market' ) . '</span>
				<span class="screen-reader-text">' . sprintf( __( 'Deactivate %s', 'envato-market' ), $name ) . '</span>
			</a>';
		} elseif ( 'installed' === $group ) {
			if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) {
				// Delete link.
				$delete_link = add_query_arg(
					array(
						'action'    => 'delete-selected',
						'checked[]' => $slug,
					),
					self_admin_url( 'plugins.php' )
				);

				$actions['delete'] = '
				<a href="' . wp_nonce_url( $delete_link, 'bulk-plugins' ) . '" class="button-delete">
					<span aria-hidden="true">' . __( 'Delete', 'envato-market' ) . '</span>
					<span class="screen-reader-text">' . sprintf( __( 'Delete %s', 'envato-market' ), $name ) . '</span>
				</a>';
			}

			if ( ! is_multisite() && current_user_can( 'activate_plugins' ) ) {
				// Activate link.
				$activate_link = add_query_arg(
					array(
						'action' => 'activate',
						'plugin' => $slug,
					),
					self_admin_url( 'plugins.php' )
				);

				$actions['activate'] = '
				<a href="' . wp_nonce_url( $activate_link, 'activate-plugin_' . $slug ) . '" class="button">
					<span aria-hidden="true">' . __( 'Activate', 'envato-market' ) . '</span>
					<span class="screen-reader-text">' . sprintf( __( 'Activate %s', 'envato-market' ), $name ) . '</span>
				</a>';
			}

			// @codeCoverageIgnoreStart
			// Multisite needs special attention.
			if ( is_multisite() ) {
				if ( current_user_can( 'manage_network_plugins' ) ) {
					$actions['network_activate'] = '
					<a href="' . esc_url( network_admin_url( wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $slug ), 'activate-plugin_' . $slug ) ) ) . '" class="button">
						<span aria-hidden="true">' . __( 'Network Activate', 'envato-market' ) . '</span>
						<span class="screen-reader-text">' . sprintf( __( 'Network Activate %s', 'envato-market' ), $name ) . '</span>
					</a>';
				}
			}
			// @codeCoverageIgnoreEnd
		} elseif ( 'install' === $group && current_user_can( 'install_plugins' ) ) {
			// Install link.
			$install_link = add_query_arg(
				array(
					'page'   => envato_market()->get_slug(),
					'action' => 'install-plugin',
					'id'     => $plugin['id'],
				),
				self_admin_url( 'admin.php' )
			);

			$actions['install'] = '
			<a href="' . wp_nonce_url( $install_link, 'install-plugin_' . $plugin['id'] ) . '" class="button button-primary">
				<span aria-hidden="true">' . __( 'Install', 'envato-market' ) . '</span>
				<span class="screen-reader-text">' . sprintf( __( 'Install %s', 'envato-market' ), $name ) . '</span>
			</a>';
		}
		if ( 0 === strrpos( html_entity_decode( $author ), '<a ' ) ) {
			$author_link = $author;
		} else {
			$author_link = '<a href="' . esc_url( $author_url ) . '">' . esc_html( $author ) . '</a>';
		}
		?>
		<div class="envato-market-block" data-id="<?php echo esc_attr( $plugin['id'] ); ?>">
			<div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
				<div class="envato-card-top">
					<a href="<?php echo esc_url( $url ); ?>" class="column-icon">
						<img src="<?php echo esc_url( $plugin['thumbnail_url'] ); ?>"/>
					</a>
					<div class="column-name">
						<h4>
							<a href="<?php echo esc_url( $url ); ?>"><?php echo esc_html( $name ); ?></a>
							<span class="version" aria-label="<?php esc_attr_e( 'Version %s', 'envato-market' ); ?>">
								<?php echo esc_html( sprintf( __( 'Version %s', 'envato-market' ), ( isset( $plugins[ $slug ] ) ? $plugins[ $slug ]['Version'] : $version ) ) ); ?>
							</span>
						</h4>
					</div>
					<div class="column-description">
						<div class="description">
							<?php echo wp_kses_post( wpautop( strip_tags( $description ) ) ); ?>
						</div>
						<p class="author">
							<cite>
								<?php esc_html_e( 'By', 'envato-market' ); ?>
								<?php echo wp_kses_post( $author_link ); ?>
							</cite>
						</p>
					</div>
					<?php if ( ! empty( $update_actions ) ) { ?>
						<div class="column-update">
							<?php echo implode( "\n", $update_actions ); ?>
						</div>
					<?php } ?>
				</div>
				<div class="envato-card-bottom">
					<div class="column-rating">
						<?php
						if ( ! empty( $plugin['rating'] ) ) {
							if ( is_array( $plugin['rating'] ) && ! empty( $plugin['rating']['count'] ) ) {
								wp_star_rating(
									array(
										'rating' => $plugin['rating']['rating'] > 0 ? ( $plugin['rating']['rating'] / 5 * 100 ) : 0,
										'type'   => 'percent',
										'number' => $plugin['rating']['count'],
									)
								);
							} else {
								wp_star_rating(
									array(
										'rating' => $plugin['rating'] > 0 ? ( $plugin['rating'] / 5 * 100 ) : 0,
										'type'   => 'percent',
									)
								);
							}
						}
						?>
					</div>
					<div class="column-actions">
						<?php echo implode( "\n", $actions ); ?>
					</div>
				</div>
			</div>
		</div>
		<?php
	endforeach;
}
admin/class-envato-market-theme-installer-skin.php000064400000011106151327206010016256 0ustar00<?php
/**
 * Upgrader skin classes.
 *
 * @package Envato_Market
 */

// Include the WP_Upgrader_Skin class.
if ( ! class_exists( 'WP_Upgrader_Skin', false ) ) :
	include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skins.php';
endif;

if ( ! class_exists( 'Envato_Market_Theme_Installer_Skin' ) ) :

	/**
	 * Theme Installer Skin.
	 *
	 * @class Envato_Market_Theme_Installer_Skin
	 * @version 1.0.0
	 * @since 1.0.0
	 */
	class Envato_Market_Theme_Installer_Skin extends Theme_Installer_Skin {

		/**
		 * Modify the install actions.
		 *
		 * @since 1.0.0
		 */
		public function after() {
			if ( empty( $this->upgrader->result['destination_name'] ) ) {
				return;
			}

			$theme_info = $this->upgrader->theme_info();
			if ( empty( $theme_info ) ) {
				return;
			}

			$name       = $theme_info->display( 'Name' );
			$stylesheet = $this->upgrader->result['destination_name'];
			$template   = $theme_info->get_template();

			$activate_link = add_query_arg(
				array(
					'action'     => 'activate',
					'template'   => urlencode( $template ),
					'stylesheet' => urlencode( $stylesheet ),
				),
				admin_url( 'themes.php' )
			);
			$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );

			$install_actions = array();

			if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
				$install_actions['preview'] = '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Live Preview', 'envato-market' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;', 'envato-market' ), $name ) . '</span></a>';
			}

			if ( is_multisite() ) {
				if ( current_user_can( 'manage_network_themes' ) ) {
					$install_actions['network_enable'] = '<a href="' . esc_url( network_admin_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . urlencode( $stylesheet ) . '&amp;paged=1&amp;s', 'enable-theme_' . $stylesheet ) ) ) . '" target="_parent">' . __( 'Network Enable', 'envato-market' ) . '</a>';
				}
			}

			$install_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink"><span aria-hidden="true">' . __( 'Activate', 'envato-market' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Activate &#8220;%s&#8221;', 'envato-market' ), $name ) . '</span></a>';

			$install_actions['themes_page'] = '<a href="' . esc_url( admin_url( 'admin.php?page=' . envato_market()->get_slug() . '&tab=themes' ) ) . '" target="_parent">' . __( 'Return to Theme Installer', 'envato-market' ) . '</a>';

			if ( ! $this->result || is_wp_error( $this->result ) || is_multisite() || ! current_user_can( 'switch_themes' ) ) {
				unset( $install_actions['activate'], $install_actions['preview'] );
			}

			if ( ! empty( $install_actions ) ) {
				$this->feedback( implode( ' | ', $install_actions ) );
			}
		}
	}

endif;

if ( ! class_exists( 'Envato_Market_Plugin_Installer_Skin' ) ) :

	/**
	 * Plugin Installer Skin.
	 *
	 * @class Envato_Market_Plugin_Installer_Skin
	 * @version 1.0.0
	 * @since 1.0.0
	 */
	class Envato_Market_Plugin_Installer_Skin extends Plugin_Installer_Skin {

		/**
		 * Modify the install actions.
		 *
		 * @since 1.0.0
		 */
		public function after() {
			$plugin_file     = $this->upgrader->plugin_info();
			$install_actions = array();

			if ( current_user_can( 'activate_plugins' ) ) {
				$install_actions['activate_plugin'] = '<a href="' . esc_url( wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) ) . '" target="_parent">' . __( 'Activate Plugin', 'envato-market' ) . '</a>';
			}

			if ( is_multisite() ) {
				unset( $install_actions['activate_plugin'] );

				if ( current_user_can( 'manage_network_plugins' ) ) {
					$install_actions['network_activate'] = '<a href="' . esc_url( network_admin_url( wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file ) ) ) . '" target="_parent">' . __( 'Network Activate', 'envato-market' ) . '</a>';
				}
			}

			$install_actions['plugins_page'] = '<a href="' . esc_url( admin_url( 'admin.php?page=' . envato_market()->get_slug() . '&tab=plugins' ) ) . '" target="_parent">' . __( 'Return to Plugin Installer', 'envato-market' ) . '</a>';

			if ( ! $this->result || is_wp_error( $this->result ) ) {
				unset( $install_actions['activate_plugin'], $install_actions['site_activate'], $install_actions['network_activate'] );
			}

			if ( ! empty( $install_actions ) ) {
				$this->feedback( implode( ' | ', $install_actions ) );
			}
		}
	}

endif;
class-envato-market-api.php000064400000032563151327206010011712 0ustar00<?php
/**
 * Envato API class.
 *
 * @package Envato_Market
 */

if ( ! class_exists( 'Envato_Market_API' ) && class_exists( 'Envato_Market' ) ) :

	/**
	 * Creates the Envato API connection.
	 *
	 * @class Envato_Market_API
	 * @version 1.0.0
	 * @since 1.0.0
	 */
	class Envato_Market_API {

		/**
		 * The single class instance.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var object
		 */
		private static $_instance = null;

		/**
		 * The Envato API personal token.
		 *
		 * @since 1.0.0
		 *
		 * @var string
		 */
		public $token;

		/**
		 * Main Envato_Market_API Instance
		 *
		 * Ensures only one instance of this class exists in memory at any one time.
		 *
		 * @see Envato_Market_API()
		 * @uses Envato_Market_API::init_globals() Setup class globals.
		 * @uses Envato_Market_API::init_actions() Setup hooks and actions.
		 *
		 * @since 1.0.0
		 * @static
		 * @return object The one true Envato_Market_API.
		 * @codeCoverageIgnore
		 */
		public static function instance() {
			if ( is_null( self::$_instance ) ) {
				self::$_instance = new self();
				self::$_instance->init_globals();
			}
			return self::$_instance;
		}

		/**
		 * A dummy constructor to prevent this class from being loaded more than once.
		 *
		 * @see Envato_Market_API::instance()
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function __construct() {
			/* We do nothing here! */
		}

		/**
		 * You cannot clone this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __clone() {
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * You cannot unserialize instances of this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __wakeup() {
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * Setup the class globals.
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function init_globals() {
			// Envato API token.
			$this->token = envato_market()->get_option( 'token' );
		}

		/**
		 * Query the Envato API.
		 *
		 * @uses wp_remote_get() To perform an HTTP request.
		 *
		 * @since 1.0.0
		 *
		 * @param  string $url API request URL, including the request method, parameters, & file type.
		 * @param  array  $args The arguments passed to `wp_remote_get`.
		 * @return array|WP_Error  The HTTP response.
		 */
		public function request( $url, $args = array() ) {
			$defaults = array(
				'headers' => array(
					'Authorization' => 'Bearer ' . $this->token,
					'User-Agent'    => 'WordPress - Envato Market ' . envato_market()->get_version(),
				),
				'timeout' => 14,
			);
			$args     = wp_parse_args( $args, $defaults );

			$token = trim( str_replace( 'Bearer', '', $args['headers']['Authorization'] ) );
			if ( empty( $token ) ) {
				return new WP_Error( 'api_token_error', __( 'An API token is required.', 'envato-market' ) );
			}

			$debugging_information = [
				'request_url' => $url,
			];

			// Make an API request.
			$response = wp_remote_get( esc_url_raw( $url ), $args );

			// Check the response code.
			$response_code    = wp_remote_retrieve_response_code( $response );
			$response_message = wp_remote_retrieve_response_message( $response );

			$debugging_information['response_code']   = $response_code;
			$debugging_information['response_cf_ray'] = wp_remote_retrieve_header( $response, 'cf-ray' );
			$debugging_information['response_server'] = wp_remote_retrieve_header( $response, 'server' );

			if ( ! empty( $response->errors ) && isset( $response->errors['http_request_failed'] ) ) {
				// API connectivity issue, inject notice into transient with more details.
				$option = envato_market()->get_options();
				if ( empty( $option['notices'] ) ) {
					$option['notices'] = [];
				}
				$option['notices']['http_error'] = current( $response->errors['http_request_failed'] );
				envato_market()->set_options( $option );
				return new WP_Error( 'http_error', esc_html( current( $response->errors['http_request_failed'] ) ), $debugging_information );
			}

			if ( 200 !== $response_code && ! empty( $response_message ) ) {
				return new WP_Error( $response_code, $response_message, $debugging_information );
			} elseif ( 200 !== $response_code ) {
				return new WP_Error( $response_code, __( 'An unknown API error occurred.', 'envato-market' ), $debugging_information );
			} else {
				$return = json_decode( wp_remote_retrieve_body( $response ), true );
				if ( null === $return ) {
					return new WP_Error( 'api_error', __( 'An unknown API error occurred.', 'envato-market' ), $debugging_information );
				}
				return $return;
			}
		}

		/**
		 * Deferred item download URL.
		 *
		 * @since 1.0.0
		 *
		 * @param int $id The item ID.
		 * @return string.
		 */
		public function deferred_download( $id ) {
			if ( empty( $id ) ) {
				return '';
			}

			$args = array(
				'deferred_download' => true,
				'item_id'           => $id,
			);
			return add_query_arg( $args, esc_url( envato_market()->get_page_url() ) );
		}

		/**
		 * Get the item download.
		 *
		 * @since 1.0.0
		 *
		 * @param  int   $id The item ID.
		 * @param  array $args The arguments passed to `wp_remote_get`.
		 * @return bool|array The HTTP response.
		 */
		public function download( $id, $args = array() ) {
			if ( empty( $id ) ) {
				return false;
			}

			$url      = 'https://api.envato.com/v2/market/buyer/download?item_id=' . $id . '&shorten_url=true';
			$response = $this->request( $url, $args );

			// @todo Find out which errors could be returned & handle them in the UI.
			if ( is_wp_error( $response ) || empty( $response ) || ! empty( $response['error'] ) ) {
				return false;
			}

			if ( ! empty( $response['wordpress_theme'] ) ) {
				return $response['wordpress_theme'];
			}

			if ( ! empty( $response['wordpress_plugin'] ) ) {
				return $response['wordpress_plugin'];
			}

			// Missing a WordPress theme and plugin, report an error.
			$option = envato_market()->get_options();
			if ( ! isset( $option['notices'] ) ) {
				$option['notices'] = [];
			}
			$option['notices']['missing-package-zip'] = true;
			envato_market()->set_options( $option );

			return false;
		}

		/**
		 * Get an item by ID and type.
		 *
		 * @since 1.0.0
		 *
		 * @param  int   $id The item ID.
		 * @param  array $args The arguments passed to `wp_remote_get`.
		 * @return array The HTTP response.
		 */
		public function item( $id, $args = array() ) {
			$url      = 'https://api.envato.com/v2/market/catalog/item?id=' . $id;
			$response = $this->request( $url, $args );

			if ( is_wp_error( $response ) || empty( $response ) ) {
				return false;
			}

			if ( ! empty( $response['wordpress_theme_metadata'] ) ) {
				return $this->normalize_theme( $response );
			}

			if ( ! empty( $response['wordpress_plugin_metadata'] ) ) {
				return $this->normalize_plugin( $response );
			}

			return false;
		}

		/**
		 * Get the list of available themes.
		 *
		 * @since 1.0.0
		 *
		 * @param  array $args The arguments passed to `wp_remote_get`.
		 * @return array The HTTP response.
		 */
		public function themes( $args = array() ) {
			$themes = array();

			$url      = 'https://api.envato.com/v2/market/buyer/list-purchases?filter_by=wordpress-themes';
			$response = $this->request( $url, $args );

			if ( is_wp_error( $response ) || empty( $response ) || empty( $response['results'] ) ) {
				return $themes;
			}

			foreach ( $response['results'] as $theme ) {
				$themes[] = $this->normalize_theme( $theme['item'] );
			}

			return $themes;
		}

		/**
		 * Normalize a theme.
		 *
		 * @since 1.0.0
		 *
		 * @param  array $theme An array of API request values.
		 * @return array A normalized array of values.
		 */
		public function normalize_theme( $theme ) {
			$normalized_theme = array(
				'id'            => $theme['id'],
				'name'          => ( ! empty( $theme['wordpress_theme_metadata']['theme_name'] ) ? $theme['wordpress_theme_metadata']['theme_name'] : '' ),
				'author'        => ( ! empty( $theme['wordpress_theme_metadata']['author_name'] ) ? $theme['wordpress_theme_metadata']['author_name'] : '' ),
				'version'       => ( ! empty( $theme['wordpress_theme_metadata']['version'] ) ? $theme['wordpress_theme_metadata']['version'] : '' ),
				'description'   => self::remove_non_unicode( strip_tags( $theme['wordpress_theme_metadata']['description'] ) ),
				'url'           => ( ! empty( $theme['url'] ) ? $theme['url'] : '' ),
				'author_url'    => ( ! empty( $theme['author_url'] ) ? $theme['author_url'] : '' ),
				'thumbnail_url' => ( ! empty( $theme['thumbnail_url'] ) ? $theme['thumbnail_url'] : '' ),
				'rating'        => ( ! empty( $theme['rating'] ) ? $theme['rating'] : '' ),
				'landscape_url' => '',
			);

			// No main thumbnail in API response, so we grab it from the preview array.
			if ( empty( $normalized_theme['thumbnail_url'] ) && ! empty( $theme['previews'] ) && is_array( $theme['previews'] ) ) {
				foreach ( $theme['previews'] as $possible_preview ) {
					if ( ! empty( $possible_preview['landscape_url'] ) ) {
						$normalized_theme['landscape_url'] = $possible_preview['landscape_url'];
						break;
					}
				}
			}
			if ( empty( $normalized_theme['thumbnail_url'] ) && ! empty( $theme['previews'] ) && is_array( $theme['previews'] ) ) {
				foreach ( $theme['previews'] as $possible_preview ) {
					if ( ! empty( $possible_preview['icon_url'] ) ) {
						$normalized_theme['thumbnail_url'] = $possible_preview['icon_url'];
						break;
					}
				}
			}

			return $normalized_theme;
		}

		/**
		 * Get the list of available plugins.
		 *
		 * @since 1.0.0
		 *
		 * @param  array $args The arguments passed to `wp_remote_get`.
		 * @return array The HTTP response.
		 */
		public function plugins( $args = array() ) {
			$plugins = array();

			$url      = 'https://api.envato.com/v2/market/buyer/list-purchases?filter_by=wordpress-plugins';
			$response = $this->request( $url, $args );

			if ( is_wp_error( $response ) || empty( $response ) || empty( $response['results'] ) ) {
				return $plugins;
			}

			foreach ( $response['results'] as $plugin ) {
				$plugins[] = $this->normalize_plugin( $plugin['item'] );
			}

			return $plugins;
		}

		/**
		 * Normalize a plugin.
		 *
		 * @since 1.0.0
		 *
		 * @param  array $plugin An array of API request values.
		 * @return array A normalized array of values.
		 */
		public function normalize_plugin( $plugin ) {
			$requires = null;
			$tested   = null;
			$versions = array();

			// Set the required and tested WordPress version numbers.
			foreach ( $plugin['attributes'] as $k => $v ) {
				if ( ! empty( $v['name'] ) && 'compatible-software' === $v['name'] && ! empty( $v['value'] ) && is_array( $v['value'] ) ) {
					foreach ( $v['value'] as $version ) {
						$versions[] = str_replace( 'WordPress ', '', trim( $version ) );
					}
					if ( ! empty( $versions ) ) {
						$requires = $versions[ count( $versions ) - 1 ];
						$tested   = $versions[0];
					}
					break;
				}
			}

			$plugin_normalized = array(
				'id'              => $plugin['id'],
				'name'            => ( ! empty( $plugin['wordpress_plugin_metadata']['plugin_name'] ) ? $plugin['wordpress_plugin_metadata']['plugin_name'] : '' ),
				'author'          => ( ! empty( $plugin['wordpress_plugin_metadata']['author'] ) ? $plugin['wordpress_plugin_metadata']['author'] : '' ),
				'version'         => ( ! empty( $plugin['wordpress_plugin_metadata']['version'] ) ? $plugin['wordpress_plugin_metadata']['version'] : '' ),
				'description'     => self::remove_non_unicode( strip_tags( $plugin['wordpress_plugin_metadata']['description'] ) ),
				'url'             => ( ! empty( $plugin['url'] ) ? $plugin['url'] : '' ),
				'author_url'      => ( ! empty( $plugin['author_url'] ) ? $plugin['author_url'] : '' ),
				'thumbnail_url'   => ( ! empty( $plugin['thumbnail_url'] ) ? $plugin['thumbnail_url'] : '' ),
				'landscape_url'   => ( ! empty( $plugin['previews']['landscape_preview']['landscape_url'] ) ? $plugin['previews']['landscape_preview']['landscape_url'] : '' ),
				'requires'        => $requires,
				'tested'          => $tested,
				'number_of_sales' => ( ! empty( $plugin['number_of_sales'] ) ? $plugin['number_of_sales'] : '' ),
				'updated_at'      => ( ! empty( $plugin['updated_at'] ) ? $plugin['updated_at'] : '' ),
				'rating'          => ( ! empty( $plugin['rating'] ) ? $plugin['rating'] : '' ),
			);

			// No main thumbnail in API response, so we grab it from the preview array.
			if ( empty( $plugin_normalized['landscape_url'] ) && ! empty( $plugin['previews'] ) && is_array( $plugin['previews'] ) ) {
				foreach ( $plugin['previews'] as $possible_preview ) {
					if ( ! empty( $possible_preview['landscape_url'] ) ) {
						$plugin_normalized['landscape_url'] = $possible_preview['landscape_url'];
						break;
					}
				}
			}
			if ( empty( $plugin_normalized['thumbnail_url'] ) && ! empty( $plugin['previews'] ) && is_array( $plugin['previews'] ) ) {
				foreach ( $plugin['previews'] as $possible_preview ) {
					if ( ! empty( $possible_preview['icon_url'] ) ) {
						$plugin_normalized['thumbnail_url'] = $possible_preview['icon_url'];
						break;
					}
				}
			}

			return $plugin_normalized;
		}

		/**
		 * Remove all non unicode characters in a string
		 *
		 * @since 1.0.0
		 *
		 * @param string $retval The string to fix.
		 * @return string
		 */
		static private function remove_non_unicode( $retval ) {
			return preg_replace( '/[\x00-\x1F\x80-\xFF]/', '', $retval );
		}
	}

endif;
class-envato-market-items.php000064400000041417151327206010012260 0ustar00<?php
/**
 * Items class.
 *
 * @package Envato_Market
 */

if ( ! class_exists( 'Envato_Market_Items' ) ) :

	/**
	 * Creates the theme & plugin arrays & injects API results.
	 *
	 * @class Envato_Market_Items
	 * @version 1.0.0
	 * @since 1.0.0
	 */
	class Envato_Market_Items {

		/**
		 * The single class instance.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var object
		 */
		private static $_instance = null;

		/**
		 * Premium themes.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var array
		 */
		private static $themes = array();

		/**
		 * Premium plugins.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var array
		 */
		private static $plugins = array();

		/**
		 * WordPress plugins.
		 *
		 * @since 1.0.0
		 * @access private
		 *
		 * @var array
		 */
		private static $wp_plugins = array();

		/**
		 * The Envato_Market_Items Instance
		 *
		 * Ensures only one instance of this class exists in memory at any one time.
		 *
		 * @see Envato_Market_Items()
		 * @uses Envato_Market_Items::init_actions() Setup hooks and actions.
		 *
		 * @since 1.0.0
		 * @static
		 * @return object The one true Envato_Market_Items.
		 * @codeCoverageIgnore
		 */
		public static function instance() {
			if ( is_null( self::$_instance ) ) {
				self::$_instance = new self();
				self::$_instance->init_actions();
			}
			return self::$_instance;
		}

		/**
		 * A dummy constructor to prevent this class from being loaded more than once.
		 *
		 * @see Envato_Market_Items::instance()
		 *
		 * @since 1.0.0
		 * @access private
		 * @codeCoverageIgnore
		 */
		private function __construct() {
			/* We do nothing here! */
		}

		/**
		 * You cannot clone this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __clone() {
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * You cannot unserialize instances of this class.
		 *
		 * @since 1.0.0
		 * @codeCoverageIgnore
		 */
		public function __wakeup() {
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'envato-market' ), '1.0.0' );
		}

		/**
		 * Setup the hooks, actions and filters.
		 *
		 * @uses add_action() To add actions.
		 * @uses add_filter() To add filters.
		 *
		 * @since 1.0.0
		 */
		public function init_actions() {
			// Check for theme & plugin updates.
			add_filter( 'http_request_args', array( $this, 'update_check' ), 5, 2 );

			// Inject plugin updates into the response array.
			add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'update_plugins' ), 5, 1 );
			add_filter( 'pre_set_transient_update_plugins', array( $this, 'update_plugins' ), 5, 1 );

			// Inject theme updates into the response array.
			add_filter( 'pre_set_site_transient_update_themes', array( $this, 'update_themes' ), 1, 99999 );
			add_filter( 'pre_set_transient_update_themes', array( $this, 'update_themes' ), 1, 99999 );

			// Inject plugin information into the API calls.
			add_filter( 'plugins_api', array( $this, 'plugins_api' ), 10, 3 );

			// Rebuild the saved theme data.
			add_action( 'after_switch_theme', array( $this, 'rebuild_themes' ) );

			// Rebuild the saved plugin data.
			add_action( 'activated_plugin', array( $this, 'rebuild_plugins' ) );
			add_action( 'deactivated_plugin', array( $this, 'rebuild_plugins' ) );
		}

		/**
		 * Get the premium plugins list.
		 *
		 * @since 1.0.0
		 *
		 * @param string $group The plugin group. Options are 'purchased', 'active', 'installed', or 'install'.
		 * @return array
		 */
		public function plugins( $group = '' ) {
			if ( ! empty( $group ) ) {
				if ( isset( self::$plugins[ $group ] ) ) {
					return self::$plugins[ $group ];
				} else {
					return array();
				}
			}

			return self::$plugins;
		}

		/**
		 * Get the premium themes list.
		 *
		 * @since 1.0.0
		 *
		 * @param string $group The theme group. Options are 'purchased', 'active', 'installed', or 'install'.
		 * @return array
		 */
		public function themes( $group = '' ) {
			if ( ! empty( $group ) ) {
				if ( isset( self::$themes[ $group ] ) ) {
					return self::$themes[ $group ];
				} else {
					return array();
				}
			}

			return self::$themes;
		}

		/**
		 * Get the list of WordPress plugins
		 *
		 * @since 1.0.0
		 *
		 * @param bool $flush Forces a cache flush. Default is 'false'.
		 * @return array
		 */
		public function wp_plugins( $flush = false ) {
			if ( empty( self::$wp_plugins ) || true === $flush ) {
				wp_cache_set( 'plugins', false, 'plugins' );
				self::$wp_plugins = get_plugins();
			}

			return self::$wp_plugins;
		}

		/**
		 * Disables requests to the wp.org repository for premium themes.
		 *
		 * @since 1.0.0
		 *
		 * @param array  $request An array of HTTP request arguments.
		 * @param string $url The request URL.
		 * @return array
		 */
		public function update_check( $request, $url ) {

			// Theme update request.
			if ( false !== strpos( $url, '//api.wordpress.org/themes/update-check/1.1/' ) ) {

				/**
				 * Excluded theme slugs that should never ping the WordPress API.
				 * We don't need the extra http requests for themes we know are premium.
				 */
				self::set_themes();
				$installed = self::$themes['installed'];

				// Decode JSON so we can manipulate the array.
				$data = json_decode( $request['body']['themes'] );

				// Remove the excluded themes.
				foreach ( $installed as $slug => $id ) {
					unset( $data->themes->$slug );
				}

				// Encode back into JSON and update the response.
				$request['body']['themes'] = wp_json_encode( $data );
			}

			// Plugin update request.
			if ( false !== strpos( $url, '//api.wordpress.org/plugins/update-check/1.1/' ) ) {

				/**
				 * Excluded theme slugs that should never ping the WordPress API.
				 * We don't need the extra http requests for themes we know are premium.
				 */
				self::set_plugins();
				$installed = self::$plugins['installed'];

				// Decode JSON so we can manipulate the array.
				$data = json_decode( $request['body']['plugins'] );

				// Remove the excluded themes.
				foreach ( $installed as $slug => $id ) {
					unset( $data->plugins->$slug );
				}

				// Encode back into JSON and update the response.
				$request['body']['plugins'] = wp_json_encode( $data );
			}

			return $request;
		}

		/**
		 * Inject update data for premium themes.
		 *
		 * @since 1.0.0
		 *
		 * @param object $transient The pre-saved value of the `update_themes` site transient.
		 * @return object
		 */
		public function update_themes( $transient ) {
			// Process premium theme updates.
			if ( isset( $transient->checked ) ) {
				self::set_themes( true );
				$installed = array_merge( self::$themes['active'], self::$themes['installed'] );

				foreach ( $installed as $slug => $premium ) {
					$theme = wp_get_theme( $slug );
					if ( $theme->exists() && version_compare( $theme->get( 'Version' ), $premium['version'], '<' ) ) {
						$transient->response[ $slug ] = array(
							'theme'       => $slug,
							'new_version' => $premium['version'],
							'url'         => $premium['url'],
							'package'     => envato_market()->api()->deferred_download( $premium['id'] ),
						);
					}
				}
			}

			return $transient;
		}

		/**
		 * Inject update data for premium plugins.
		 *
		 * @since 1.0.0
		 *
		 * @param object $transient The pre-saved value of the `update_plugins` site transient.
		 * @return object
		 */
		public function update_plugins( $transient ) {
			self::set_plugins( true );

			// Process premium plugin updates.
			$installed = array_merge( self::$plugins['active'], self::$plugins['installed'] );
			$plugins   = self::wp_plugins();

			foreach ( $installed as $plugin => $premium ) {
				if ( isset( $plugins[ $plugin ] ) && version_compare( $plugins[ $plugin ]['Version'], $premium['version'], '<' ) ) {
					$_plugin                        = array(
						'slug'        => dirname( $plugin ),
						'plugin'      => $plugin,
						'new_version' => $premium['version'],
						'url'         => $premium['url'],
						'package'     => envato_market()->api()->deferred_download( $premium['id'] ),
					);
					$transient->response[ $plugin ] = (object) $_plugin;
				}
			}

			return $transient;
		}

		/**
		 * Inject API data for premium plugins.
		 *
		 * @since 1.0.0
		 *
		 * @param bool   $response Always false.
		 * @param string $action The API action being performed.
		 * @param object $args Plugin arguments.
		 * @return bool|object $response The plugin info or false.
		 */
		public function plugins_api( $response, $action, $args ) {
			self::set_plugins( true );

			// Process premium theme updates.
			if ( 'plugin_information' === $action && isset( $args->slug ) ) {
				$installed = array_merge( self::$plugins['active'], self::$plugins['installed'] );
				foreach ( $installed as $slug => $plugin ) {
					if ( dirname( $slug ) === $args->slug ) {
						$response                 = new stdClass();
						$response->slug           = $args->slug;
						$response->plugin         = $slug;
						$response->plugin_name    = $plugin['name'];
						$response->name           = $plugin['name'];
						$response->version        = $plugin['version'];
						$response->author         = $plugin['author'];
						$response->homepage       = $plugin['url'];
						$response->requires       = $plugin['requires'];
						$response->tested         = $plugin['tested'];
						$response->downloaded     = $plugin['number_of_sales'];
						$response->last_updated   = $plugin['updated_at'];
						$response->sections       = array( 'description' => $plugin['description'] );
						$response->banners['low'] = $plugin['landscape_url'];
						$response->rating         = ! empty( $plugin['rating'] ) && ! empty( $plugin['rating']['rating'] ) && $plugin['rating']['rating'] > 0 ? $plugin['rating']['rating'] / 5 * 100 : 0;
						$response->num_ratings    = ! empty( $plugin['rating'] ) && ! empty( $plugin['rating']['count'] ) ? $plugin['rating']['count'] : 0;
						$response->download_link  = envato_market()->api()->deferred_download( $plugin['id'] );
						break;
					}
				}
			}

			return $response;
		}

		/**
		 * Set the list of themes
		 *
		 * @since 1.0.0
		 *
		 * @param bool $forced Forces an API request. Default is 'false'.
		 * @param bool $use_cache Attempts to rebuild from the cache before making an API request.
		 */
		public function set_themes( $forced = false, $use_cache = false ) {
			self::$themes = get_site_transient( envato_market()->get_option_name() . '_themes' );

			if ( false === self::$themes || true === $forced ) {
				$themes = envato_market()->api()->themes();
				foreach ( envato_market()->get_option( 'items', array() ) as $item ) {
					if ( empty( $item ) ) {
						continue;
					}
					if ( 'theme' === $item['type'] ) {
						$request_args = array(
							'headers' => array(
								'Authorization' => 'Bearer ' . $item['token'],
							),
						);
						$request      = envato_market()->api()->item( $item['id'], $request_args );
						if ( false !== $request ) {
							$themes[] = $request;
						}
					}
				}
				self::process_themes( $themes );
			} elseif ( true === $use_cache ) {
				self::process_themes( self::$themes['purchased'] );
			}
		}

		/**
		 * Set the list of plugins
		 *
		 * @since 1.0.0
		 *
		 * @param bool  $forced Forces an API request. Default is 'false'.
		 * @param bool  $use_cache Attempts to rebuild from the cache before making an API request.
		 * @param array $args Used to remove or add a plugin during activate and deactivate routines.
		 */
		public function set_plugins( $forced = false, $use_cache = false, $args = array() ) {
			self::$plugins = get_site_transient( envato_market()->get_option_name() . '_plugins' );

			if ( false === self::$plugins || true === $forced ) {
				$plugins = envato_market()->api()->plugins();
				foreach ( envato_market()->get_option( 'items', array() ) as $item ) {
					if ( empty( $item ) ) {
						continue;
					}
					if ( 'plugin' === $item['type'] ) {
						$request_args = array(
							'headers' => array(
								'Authorization' => 'Bearer ' . $item['token'],
							),
						);
						$request      = envato_market()->api()->item( $item['id'], $request_args );
						if ( false !== $request ) {
							$plugins[] = $request;
						}
					}
				}
				self::process_plugins( $plugins, $args );
			} elseif ( true === $use_cache ) {
				self::process_plugins( self::$plugins['purchased'], $args );
			}
		}

		/**
		 * Rebuild the themes array using the cache value if possible.
		 *
		 * @since 1.0.0
		 *
		 * @param mixed $filter Any data being filtered.
		 * @return mixed
		 */
		public function rebuild_themes( $filter ) {
			self::set_themes( false, true );

			return $filter;
		}

		/**
		 * Rebuild the plugins array using the cache value if possible.
		 *
		 * @since 1.0.0
		 *
		 * @param string $plugin The plugin to add or remove.
		 */
		public function rebuild_plugins( $plugin ) {
			$remove = ( 'deactivated_plugin' === current_filter() ) ? true : false;
			self::set_plugins(
				false,
				true,
				array(
					'plugin' => $plugin,
					'remove' => $remove,
				)
			);
		}

		/**
		 * Normalizes a string to do a value check against.
		 *
		 * Strip all HTML tags including script and style & then decode the
		 * HTML entities so `&amp;` will equal `&` in the value check and
		 * finally lower case the entire string. This is required becuase some
		 * themes & plugins add a link to the Author field or ambersands to the
		 * names, or change the case of their files or names, which will not match
		 * the saved value in the database causing a false negative.
		 *
		 * @since 1.0.0
		 *
		 * @param string $string The string to normalize.
		 * @return string
		 */
		public function normalize( $string ) {
			return strtolower( html_entity_decode( wp_strip_all_tags( $string ) ) );
		}

		/**
		 * Process the themes and save the transient.
		 *
		 * @since 1.0.0
		 *
		 * @param array $purchased The purchased themes array.
		 */
		private function process_themes( $purchased ) {
			if ( is_wp_error( $purchased ) ) {
				$purchased = array();
			}

			$current   = wp_get_theme()->get_template();
			$active    = array();
			$installed = array();
			$install   = $purchased;

			if ( ! empty( $purchased ) ) {
				foreach ( wp_get_themes() as $theme ) {

					/**
					 * WP_Theme object.
					 *
					 * @var WP_Theme $theme
					 */
					$template = $theme->get_template();
					$title    = $theme->get( 'Name' );
					$author   = $theme->get( 'Author' );

					foreach ( $install as $key => $value ) {
						if ( $this->normalize( $value['name'] ) === $this->normalize( $title ) && $this->normalize( $value['author'] ) === $this->normalize( $author ) ) {
							$installed[ $template ] = $value;
							unset( $install[ $key ] );
						}
					}
				}
			}

			if ( isset( $installed[ $current ] ) ) {
				$active[ $current ] = $installed[ $current ];
				unset( $installed[ $current ] );
			}

			self::$themes['purchased'] = array_unique( $purchased, SORT_REGULAR );
			self::$themes['active']    = array_unique( $active, SORT_REGULAR );
			self::$themes['installed'] = array_unique( $installed, SORT_REGULAR );
			self::$themes['install']   = array_unique( array_values( $install ), SORT_REGULAR );

			set_site_transient( envato_market()->get_option_name() . '_themes', self::$themes, HOUR_IN_SECONDS );
		}

		/**
		 * Process the plugins and save the transient.
		 *
		 * @since 1.0.0
		 *
		 * @param array $purchased The purchased plugins array.
		 * @param array $args Used to remove or add a plugin during activate and deactivate routines.
		 */
		private function process_plugins( $purchased, $args = array() ) {
			if ( is_wp_error( $purchased ) ) {
				$purchased = array();
			}

			$active    = array();
			$installed = array();
			$install   = $purchased;

			if ( ! empty( $purchased ) ) {
				foreach ( self::wp_plugins( true ) as $slug => $plugin ) {
					foreach ( $install as $key => $value ) {
						if ( $this->normalize( $value['name'] ) === $this->normalize( $plugin['Name'] ) && $this->normalize( $value['author'] ) === $this->normalize( $plugin['Author'] ) && file_exists( WP_PLUGIN_DIR . '/' . $slug ) ) {
							$installed[ $slug ] = $value;
							unset( $install[ $key ] );
						}
					}
				}
			}

			foreach ( $installed as $slug => $plugin ) {
				$condition = false;
				if ( ! empty( $args ) && $slug === $args['plugin'] ) {
					if ( true === $args['remove'] ) {
						continue;
					}
					$condition = true;
				}
				if ( $condition || is_plugin_active( $slug ) ) {
					$active[ $slug ] = $plugin;
					unset( $installed[ $slug ] );
				}
			}

			self::$plugins['purchased'] = array_unique( $purchased, SORT_REGULAR );
			self::$plugins['active']    = array_unique( $active, SORT_REGULAR );
			self::$plugins['installed'] = array_unique( $installed, SORT_REGULAR );
			self::$plugins['install']   = array_unique( array_values( $install ), SORT_REGULAR );

			set_site_transient( envato_market()->get_option_name() . '_plugins', self::$plugins, HOUR_IN_SECONDS );
		}
	}

endif;
icon-functions.php000060400000006611151327377020010222 0ustar00<?php
/**
 * SVG icons related functions
 *
 * @package WordPress
 * @subpackage Twenty_Nineteen
 * @since Twenty Nineteen 1.0
 */

/**
 * Gets the SVG code for a given icon.
 */
function twentynineteen_get_icon_svg( $icon, $size = 24 ) {
	return TwentyNineteen_SVG_Icons::get_svg( 'ui', $icon, $size );
}

/**
 * Gets the SVG code for a given social icon.
 */
function twentynineteen_get_social_icon_svg( $icon, $size = 24 ) {
	return TwentyNineteen_SVG_Icons::get_svg( 'social', $icon, $size );
}

/**
 * Detects the social network from a URL and returns the SVG code for its icon.
 */
function twentynineteen_get_social_link_svg( $uri, $size = 24 ) {
	return TwentyNineteen_SVG_Icons::get_social_link_svg( $uri, $size );
}

/**
 * Display SVG icons in social links menu.
 *
 * @param string   $item_output The menu item's starting HTML output.
 * @param WP_Post  $item        Menu item data object.
 * @param int      $depth       Depth of the menu. Used for padding.
 * @param stdClass $args        An object of wp_nav_menu() arguments.
 * @return string The menu item output with social icon.
 */
function twentynineteen_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
	// Change SVG icon inside social links menu if there is supported URL.
	if ( 'social' === $args->theme_location ) {
		$svg = twentynineteen_get_social_link_svg( $item->url, 26 );
		if ( empty( $svg ) ) {
			$svg = twentynineteen_get_icon_svg( 'link' );
		}
		$item_output = str_replace( $args->link_after, '</span>' . $svg, $item_output );
	}

	return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'twentynineteen_nav_menu_social_icons', 10, 4 );

/**
 * Add a dropdown icon to top-level menu items.
 *
 * @param string   $item_output The menu item's starting HTML output.
 * @param WP_Post  $item        Menu item data object.
 * @param int      $depth       Depth of the menu. Used for padding.
 * @param stdClass $args        An object of wp_nav_menu() arguments.
 * @return string Nav menu item start element.
 */
function twentynineteen_add_dropdown_icons( $item_output, $item, $depth, $args ) {

	// Only add class to 'top level' items on the 'primary' menu.
	if ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) {
		return $item_output;
	}

	if ( in_array( 'mobile-parent-nav-menu-item', $item->classes, true ) && isset( $item->original_id ) ) {
		// Inject the keyboard_arrow_left SVG inside the parent nav menu item, and let the item link to the parent item.
		// @todo Only do this for nested submenus? If on a first-level submenu, then really the link could be "#" since the desire is to remove the target entirely.
		$link = sprintf(
			'<button class="menu-item-link-return" tabindex="-1">%s',
			twentynineteen_get_icon_svg( 'chevron_left', 24 )
		);

		// Replace opening <a> with <button>.
		$item_output = preg_replace(
			'/<a\s.*?>/',
			$link,
			$item_output,
			1 // Limit.
		);

		// Replace closing </a> with </button>.
		$item_output = preg_replace(
			'#</a>#i',
			'</button>',
			$item_output,
			1 // Limit.
		);

	} elseif ( in_array( 'menu-item-has-children', $item->classes, true ) ) {

		// Add SVG icon to parent items.
		$icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 );

		$item_output .= sprintf(
			'<button class="submenu-expand" tabindex="-1">%s</button>',
			$icon
		);
	}

	return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'twentynineteen_add_dropdown_icons', 10, 4 );
back-compat.php000060400000004654151327377020007452 0ustar00<?php
/**
 * Back compat functionality
 *
 * Prevents the theme from running on WordPress versions prior to 5.3,
 * since this theme is not meant to be backward compatible beyond that and
 * relies on many newer functions and markup changes introduced in 5.3.
 *
 * @package WordPress
 * @subpackage Twenty_Twenty_One
 * @since Twenty Twenty-One 1.0
 */

/**
 * Display upgrade notice on theme switch.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @return void
 */
function twenty_twenty_one_switch_theme() {
	add_action( 'admin_notices', 'twenty_twenty_one_upgrade_notice' );
}
add_action( 'after_switch_theme', 'twenty_twenty_one_switch_theme' );

/**
 * Adds a message for unsuccessful theme switch.
 *
 * Prints an update nag after an unsuccessful attempt to switch to
 * the theme on WordPress versions prior to 5.3.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @global string $wp_version WordPress version.
 *
 * @return void
 */
function twenty_twenty_one_upgrade_notice() {
	echo '<div class="error"><p>';
	printf(
		/* translators: %s: WordPress Version. */
		esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ),
		esc_html( $GLOBALS['wp_version'] )
	);
	echo '</p></div>';
}

/**
 * Prevents the Customizer from being loaded on WordPress versions prior to 5.3.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @global string $wp_version WordPress version.
 *
 * @return void
 */
function twenty_twenty_one_customize() {
	wp_die(
		sprintf(
			/* translators: %s: WordPress Version. */
			esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ),
			esc_html( $GLOBALS['wp_version'] )
		),
		'',
		array(
			'back_link' => true,
		)
	);
}
add_action( 'load-customize.php', 'twenty_twenty_one_customize' );

/**
 * Prevents the Theme Preview from being loaded on WordPress versions prior to 5.3.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @global string $wp_version WordPress version.
 *
 * @return void
 */
function twenty_twenty_one_preview() {
	if ( isset( $_GET['preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
		wp_die(
			sprintf(
				/* translators: %s: WordPress Version. */
				esc_html__( 'This theme requires WordPress 5.3 or newer. You are running version %s. Please upgrade.', 'twentytwentyone' ),
				esc_html( $GLOBALS['wp_version'] )
			)
		);
	}
}
add_action( 'template_redirect', 'twenty_twenty_one_preview' );
color-patterns.php000060400000025406151327377020010243 0ustar00<?php
/**
 * Twenty Nineteen: Color Patterns
 *
 * @package WordPress
 * @subpackage Twenty_Nineteen
 * @since Twenty Nineteen 1.0
 */

/**
 * Generate the CSS for the current primary color.
 */
function twentynineteen_custom_colors_css() {

	$primary_color = 199;
	if ( 'default' !== get_theme_mod( 'primary_color', 'default' ) ) {
		$primary_color = absint( get_theme_mod( 'primary_color_hue', 199 ) );
	}

	/**
	 * Filters Twenty Nineteen default saturation level.
	 *
	 * @since Twenty Nineteen 1.0
	 *
	 * @param int $saturation Color saturation level.
	 */
	$saturation = apply_filters( 'twentynineteen_custom_colors_saturation', 100 );
	$saturation = absint( $saturation ) . '%';

	/**
	 * Filters Twenty Nineteen default selection saturation level.
	 *
	 * @since Twenty Nineteen 1.0
	 *
	 * @param int $saturation_selection Selection color saturation level.
	 */
	$saturation_selection = absint( apply_filters( 'twentynineteen_custom_colors_saturation_selection', 50 ) );
	$saturation_selection = $saturation_selection . '%';

	/**
	 * Filters Twenty Nineteen default lightness level.
	 *
	 * @since Twenty Nineteen 1.0
	 *
	 * @param int $lightness Color lightness level.
	 */
	$lightness = apply_filters( 'twentynineteen_custom_colors_lightness', 33 );
	$lightness = absint( $lightness ) . '%';

	/**
	 * Filters Twenty Nineteen default hover lightness level.
	 *
	 * @since Twenty Nineteen 1.0
	 *
	 * @param int $lightness_hover Hover color lightness level.
	 */
	$lightness_hover = apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 );
	$lightness_hover = absint( $lightness_hover ) . '%';

	/**
	 * Filters Twenty Nineteen default selection lightness level.
	 *
	 * @since Twenty Nineteen 1.0
	 *
	 * @param int $lightness_selection Selection color lightness level.
	 */
	$lightness_selection = apply_filters( 'twentynineteen_custom_colors_lightness_selection', 90 );
	$lightness_selection = absint( $lightness_selection ) . '%';

	$theme_css = '
		/*
		 * Set background for:
		 * - featured image :before
		 * - featured image :before
		 * - post thumbmail :before
		 * - post thumbmail :before
		 * - Submenu
		 * - Sticky Post
		 * - buttons
		 * - WP Block Button
		 * - Blocks
		 */
		.image-filters-enabled .site-header.featured-image .site-featured-image:before,
		.image-filters-enabled .site-header.featured-image .site-featured-image:after,
		.image-filters-enabled .entry .post-thumbnail:before,
		.image-filters-enabled .entry .post-thumbnail:after,
		.main-navigation .sub-menu,
		.sticky-post,
		.entry .entry-content .wp-block-button .wp-block-button__link:not(.has-background),
		.entry .button, button, input[type="button"], input[type="reset"], input[type="submit"],
		.entry .entry-content > .has-primary-background-color,
		.entry .entry-content > *[class^="wp-block-"].has-primary-background-color,
		.entry .entry-content > *[class^="wp-block-"] .has-primary-background-color,
		.entry .entry-content > *[class^="wp-block-"].is-style-solid-color,
		.entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-primary-background-color,
		.entry .entry-content .wp-block-file .wp-block-file__button {
			background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
		}

		/*
		 * Set Color for:
		 * - all links
		 * - main navigation links
		 * - Post navigation links
		 * - Post entry meta hover
		 * - Post entry header more-link hover
		 * - main navigation svg
		 * - comment navigation
		 * - Comment edit link hover
		 * - Site Footer Link hover
		 * - Widget links
		 */
		a,
		a:visited,
		.main-navigation .main-menu > li,
		.main-navigation ul.main-menu > li > a,
		.post-navigation .post-title,
		.entry .entry-meta a:hover,
		.entry .entry-footer a:hover,
		.entry .entry-content .more-link:hover,
		.main-navigation .main-menu > li > a + svg,
		.comment .comment-metadata > a:hover,
		.comment .comment-metadata .comment-edit-link:hover,
		#colophon .site-info a:hover,
		.widget a,
		.entry .entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
		.entry .entry-content > .has-primary-color,
		.entry .entry-content > *[class^="wp-block-"] .has-primary-color,
		.entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color,
		.entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-primary-color p {
			color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
		}

		/*
		 * Set border color for:
		 * wp block quote
		 * :focus
		 */
		blockquote,
		.entry .entry-content blockquote,
		.entry .entry-content .wp-block-quote:not(.is-large),
		.entry .entry-content .wp-block-quote:not(.is-style-large),
		input[type="text"]:focus,
		input[type="email"]:focus,
		input[type="url"]:focus,
		input[type="password"]:focus,
		input[type="search"]:focus,
		input[type="number"]:focus,
		input[type="tel"]:focus,
		input[type="range"]:focus,
		input[type="date"]:focus,
		input[type="month"]:focus,
		input[type="week"]:focus,
		input[type="time"]:focus,
		input[type="datetime"]:focus,
		input[type="datetime-local"]:focus,
		input[type="color"]:focus,
		textarea:focus {
			border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
		}

		.gallery-item > div > a:focus {
			box-shadow: 0 0 0 2px hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
		}

		/* Hover colors */
		a:hover, a:active,
		.main-navigation .main-menu > li > a:hover,
		.main-navigation .main-menu > li > a:hover + svg,
		.post-navigation .nav-links a:hover,
		.post-navigation .nav-links a:hover .post-title,
		.author-bio .author-description .author-link:hover,
		.entry .entry-content > .has-secondary-color,
		.entry .entry-content > *[class^="wp-block-"] .has-secondary-color,
		.entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color,
		.entry .entry-content > *[class^="wp-block-"].is-style-solid-color blockquote.has-secondary-color p,
		.comment .comment-author .fn a:hover,
		.comment-reply-link:hover,
		.comment-navigation .nav-previous a:hover,
		.comment-navigation .nav-next a:hover,
		#cancel-comment-reply-link:hover,
		.widget a:hover {
			color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */
		}

		.main-navigation .sub-menu > li > a:hover,
		.main-navigation .sub-menu > li > a:focus,
		.main-navigation .sub-menu > li > a:hover:after,
		.main-navigation .sub-menu > li > a:focus:after,
		.main-navigation .sub-menu > li > .menu-item-link-return:hover,
		.main-navigation .sub-menu > li > .menu-item-link-return:focus,
		.main-navigation .sub-menu > li > a:not(.submenu-expand):hover,
		.main-navigation .sub-menu > li > a:not(.submenu-expand):focus,
		.entry .entry-content > .has-secondary-background-color,
		.entry .entry-content > *[class^="wp-block-"].has-secondary-background-color,
		.entry .entry-content > *[class^="wp-block-"] .has-secondary-background-color,
		.entry .entry-content > *[class^="wp-block-"].is-style-solid-color.has-secondary-background-color {
			background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */
		}

		/* Text selection colors */
		::selection {
			background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */
		}
		::-moz-selection {
			background-color: hsl( ' . $primary_color . ', ' . $saturation_selection . ', ' . $lightness_selection . ' ); /* base: #005177; */
		}';

	$editor_css = '
		/*
		 * Set colors for:
		 * - links
		 * - blockquote
		 * - pullquote (solid color)
		 * - buttons
		 */
		.editor-block-list__layout .editor-block-list__block a,
		.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
		.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:hover .wp-block-button__link:not(.has-text-color),
		.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:focus .wp-block-button__link:not(.has-text-color),
		.editor-block-list__layout .editor-block-list__block .wp-block-button.is-style-outline:active .wp-block-button__link:not(.has-text-color),
		.editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink {
			color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
		}

		.editor-block-list__layout .editor-block-list__block .wp-block-quote:not(.is-large):not(.is-style-large),
		.editor-styles-wrapper .editor-block-list__layout .wp-block-freeform blockquote {
			border-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
		}

		.editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color:not(.has-background-color) {
			background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
		}

		.editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__button,
		.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link,
		.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:active,
		.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
		.editor-block-list__layout .editor-block-list__block .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
			background-color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness . ' ); /* base: #0073a8; */
		}

		/* Hover colors */
		.editor-block-list__layout .editor-block-list__block a:hover,
		.editor-block-list__layout .editor-block-list__block a:active,
		.editor-block-list__layout .editor-block-list__block .wp-block-file .wp-block-file__textlink:hover {
			color: hsl( ' . $primary_color . ', ' . $saturation . ', ' . $lightness_hover . ' ); /* base: #005177; */
		}

		/* Do not overwrite solid color pullquote or cover links */
		.editor-block-list__layout .editor-block-list__block .wp-block-pullquote.is-style-solid-color a,
		.editor-block-list__layout .editor-block-list__block .wp-block-cover a {
			color: inherit;
		}
		';

	if ( function_exists( 'register_block_type' ) && is_admin() ) {
		$theme_css = $editor_css;
	}

	/**
	 * Filters Twenty Nineteen custom colors CSS.
	 *
	 * @since Twenty Nineteen 1.0
	 *
	 * @param string $css           Base theme colors CSS.
	 * @param int    $primary_color The user's selected color hue.
	 * @param string $saturation    Filtered theme color saturation level.
	 */
	return apply_filters( 'twentynineteen_custom_colors_css', $theme_css, $primary_color, $saturation );
}
customizer.php000060400000007673151327377020007501 0ustar00<?php
/**
 * Twenty Nineteen: Customizer
 *
 * @package WordPress
 * @subpackage Twenty_Nineteen
 * @since Twenty Nineteen 1.0
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function twentynineteen_customize_register( $wp_customize ) {
	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';

	if ( isset( $wp_customize->selective_refresh ) ) {
		$wp_customize->selective_refresh->add_partial(
			'blogname',
			array(
				'selector'        => '.site-title a',
				'render_callback' => 'twentynineteen_customize_partial_blogname',
			)
		);
		$wp_customize->selective_refresh->add_partial(
			'blogdescription',
			array(
				'selector'        => '.site-description',
				'render_callback' => 'twentynineteen_customize_partial_blogdescription',
			)
		);
	}

	/**
	 * Primary color.
	 */
	$wp_customize->add_setting(
		'primary_color',
		array(
			'default'           => 'default',
			'transport'         => 'postMessage',
			'sanitize_callback' => 'twentynineteen_sanitize_color_option',
		)
	);

	$wp_customize->add_control(
		'primary_color',
		array(
			'type'     => 'radio',
			'label'    => __( 'Primary Color', 'twentynineteen' ),
			'choices'  => array(
				'default' => _x( 'Default', 'primary color', 'twentynineteen' ),
				'custom'  => _x( 'Custom', 'primary color', 'twentynineteen' ),
			),
			'section'  => 'colors',
			'priority' => 5,
		)
	);

	// Add primary color hue setting and control.
	$wp_customize->add_setting(
		'primary_color_hue',
		array(
			'default'           => 199,
			'transport'         => 'postMessage',
			'sanitize_callback' => 'absint',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'primary_color_hue',
			array(
				'description' => __( 'Apply a custom color for buttons, links, featured images, etc.', 'twentynineteen' ),
				'section'     => 'colors',
				'mode'        => 'hue',
			)
		)
	);

	// Add image filter setting and control.
	$wp_customize->add_setting(
		'image_filter',
		array(
			'default'           => 1,
			'sanitize_callback' => 'absint',
			'transport'         => 'postMessage',
		)
	);

	$wp_customize->add_control(
		'image_filter',
		array(
			'label'   => __( 'Apply a filter to featured images using the primary color', 'twentynineteen' ),
			'section' => 'colors',
			'type'    => 'checkbox',
		)
	);
}
add_action( 'customize_register', 'twentynineteen_customize_register' );

/**
 * Render the site title for the selective refresh partial.
 *
 * @return void
 */
function twentynineteen_customize_partial_blogname() {
	bloginfo( 'name' );
}

/**
 * Render the site tagline for the selective refresh partial.
 *
 * @return void
 */
function twentynineteen_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

/**
 * Bind JS handlers to instantly live-preview changes.
 */
function twentynineteen_customize_preview_js() {
	wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', true );
}
add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' );

/**
 * Load dynamic logic for the customizer controls area.
 */
function twentynineteen_panels_js() {
	wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181214', true );
}
add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' );

/**
 * Sanitize custom color choice.
 *
 * @param string $choice Whether image filter is active.
 * @return string
 */
function twentynineteen_sanitize_color_option( $choice ) {
	$valid = array(
		'default',
		'custom',
	);

	if ( in_array( $choice, $valid, true ) ) {
		return $choice;
	}

	return 'default';
}
template-tags.php000060400000017156151327377020010041 0ustar00<?php
/**
 * Custom template tags for this theme
 *
 * @package WordPress
 * @subpackage Twenty_Twenty_One
 * @since Twenty Twenty-One 1.0
 */

if ( ! function_exists( 'twenty_twenty_one_posted_on' ) ) {
	/**
	 * Prints HTML with meta information for the current post-date/time.
	 *
	 * @since Twenty Twenty-One 1.0
	 *
	 * @return void
	 */
	function twenty_twenty_one_posted_on() {
		$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';

		$time_string = sprintf(
			$time_string,
			esc_attr( get_the_date( DATE_W3C ) ),
			esc_html( get_the_date() )
		);
		echo '<span class="posted-on">';
		printf(
			/* translators: %s: Publish date. */
			esc_html__( 'Published %s', 'twentytwentyone' ),
			$time_string // phpcs:ignore WordPress.Security.EscapeOutput
		);
		echo '</span>';
	}
}

if ( ! function_exists( 'twenty_twenty_one_posted_by' ) ) {
	/**
	 * Prints HTML with meta information about theme author.
	 *
	 * @since Twenty Twenty-One 1.0
	 *
	 * @return void
	 */
	function twenty_twenty_one_posted_by() {
		if ( ! get_the_author_meta( 'description' ) && post_type_supports( get_post_type(), 'author' ) ) {
			echo '<span class="byline">';
			printf(
				/* translators: %s: Author name. */
				esc_html__( 'By %s', 'twentytwentyone' ),
				'<a href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" rel="author">' . esc_html( get_the_author() ) . '</a>'
			);
			echo '</span>';
		}
	}
}

if ( ! function_exists( 'twenty_twenty_one_entry_meta_footer' ) ) {
	/**
	 * Prints HTML with meta information for the categories, tags and comments.
	 * Footer entry meta is displayed differently in archives and single posts.
	 *
	 * @since Twenty Twenty-One 1.0
	 *
	 * @return void
	 */
	function twenty_twenty_one_entry_meta_footer() {

		// Early exit if not a post.
		if ( 'post' !== get_post_type() ) {
			return;
		}

		// Hide meta information on pages.
		if ( ! is_single() ) {

			if ( is_sticky() ) {
				echo '<p>' . esc_html_x( 'Featured post', 'Label for sticky posts', 'twentytwentyone' ) . '</p>';
			}

			$post_format = get_post_format();
			if ( 'aside' === $post_format || 'status' === $post_format ) {
				echo '<p><a href="' . esc_url( get_permalink() ) . '">' . twenty_twenty_one_continue_reading_text() . '</a></p>'; // phpcs:ignore WordPress.Security.EscapeOutput
			}

			// Posted on.
			twenty_twenty_one_posted_on();

			// Edit post link.
			edit_post_link(
				sprintf(
					/* translators: %s: Name of current post. Only visible to screen readers. */
					esc_html__( 'Edit %s', 'twentytwentyone' ),
					'<span class="screen-reader-text">' . get_the_title() . '</span>'
				),
				'<span class="edit-link">',
				'</span><br>'
			);

			if ( has_category() || has_tag() ) {

				echo '<div class="post-taxonomies">';

				/* translators: Used between list items, there is a space after the comma. */
				$categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) );
				if ( $categories_list ) {
					printf(
						/* translators: %s: List of categories. */
						'<span class="cat-links">' . esc_html__( 'Categorized as %s', 'twentytwentyone' ) . ' </span>',
						$categories_list // phpcs:ignore WordPress.Security.EscapeOutput
					);
				}

				/* translators: Used between list items, there is a space after the comma. */
				$tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) );
				if ( $tags_list ) {
					printf(
						/* translators: %s: List of tags. */
						'<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',
						$tags_list // phpcs:ignore WordPress.Security.EscapeOutput
					);
				}
				echo '</div>';
			}
		} else {

			echo '<div class="posted-by">';
			// Posted on.
			twenty_twenty_one_posted_on();
			// Posted by.
			twenty_twenty_one_posted_by();
			// Edit post link.
			edit_post_link(
				sprintf(
					/* translators: %s: Name of current post. Only visible to screen readers. */
					esc_html__( 'Edit %s', 'twentytwentyone' ),
					'<span class="screen-reader-text">' . get_the_title() . '</span>'
				),
				'<span class="edit-link">',
				'</span>'
			);
			echo '</div>';

			if ( has_category() || has_tag() ) {

				echo '<div class="post-taxonomies">';

				/* translators: Used between list items, there is a space after the comma. */
				$categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) );
				if ( $categories_list ) {
					printf(
						/* translators: %s: List of categories. */
						'<span class="cat-links">' . esc_html__( 'Categorized as %s', 'twentytwentyone' ) . ' </span>',
						$categories_list // phpcs:ignore WordPress.Security.EscapeOutput
					);
				}

				/* translators: Used between list items, there is a space after the comma. */
				$tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) );
				if ( $tags_list ) {
					printf(
						/* translators: %s: List of tags. */
						'<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',
						$tags_list // phpcs:ignore WordPress.Security.EscapeOutput
					);
				}
				echo '</div>';
			}
		}
	}
}

if ( ! function_exists( 'twenty_twenty_one_post_thumbnail' ) ) {
	/**
	 * Displays an optional post thumbnail.
	 *
	 * Wraps the post thumbnail in an anchor element on index views, or a div
	 * element when on single views.
	 *
	 * @since Twenty Twenty-One 1.0
	 *
	 * @return void
	 */
	function twenty_twenty_one_post_thumbnail() {
		if ( ! twenty_twenty_one_can_show_post_thumbnail() ) {
			return;
		}
		?>

		<?php if ( is_singular() ) : ?>

			<figure class="post-thumbnail">
				<?php
				// Lazy-loading attributes should be skipped for thumbnails since they are immediately in the viewport.
				the_post_thumbnail( 'post-thumbnail', array( 'loading' => false ) );
				?>
				<?php if ( wp_get_attachment_caption( get_post_thumbnail_id() ) ) : ?>
					<figcaption class="wp-caption-text"><?php echo wp_kses_post( wp_get_attachment_caption( get_post_thumbnail_id() ) ); ?></figcaption>
				<?php endif; ?>
			</figure><!-- .post-thumbnail -->

		<?php else : ?>

			<figure class="post-thumbnail">
				<a class="post-thumbnail-inner alignwide" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
					<?php the_post_thumbnail( 'post-thumbnail' ); ?>
				</a>
				<?php if ( wp_get_attachment_caption( get_post_thumbnail_id() ) ) : ?>
					<figcaption class="wp-caption-text"><?php echo wp_kses_post( wp_get_attachment_caption( get_post_thumbnail_id() ) ); ?></figcaption>
				<?php endif; ?>
			</figure>

		<?php endif; ?>
		<?php
	}
}

if ( ! function_exists( 'twenty_twenty_one_the_posts_navigation' ) ) {
	/**
	 * Print the next and previous posts navigation.
	 *
	 * @since Twenty Twenty-One 1.0
	 *
	 * @return void
	 */
	function twenty_twenty_one_the_posts_navigation() {
		the_posts_pagination(
			array(
				'before_page_number' => esc_html__( 'Page', 'twentytwentyone' ) . ' ',
				'mid_size'           => 0,
				'prev_text'          => sprintf(
					'%s <span class="nav-prev-text">%s</span>',
					is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' ),
					wp_kses(
						__( 'Newer <span class="nav-short">posts</span>', 'twentytwentyone' ),
						array(
							'span' => array(
								'class' => array(),
							),
						)
					)
				),
				'next_text'          => sprintf(
					'<span class="nav-next-text">%s</span> %s',
					wp_kses(
						__( 'Older <span class="nav-short">posts</span>', 'twentytwentyone' ),
						array(
							'span' => array(
								'class' => array(),
							),
						)
					),
					is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' )
				),
			)
		);
	}
}
block-patterns.php000060400000007650151327377020010220 0ustar00<?php
/**
 * Twenty Twenty-Two: Block Patterns
 *
 * @since Twenty Twenty-Two 1.0
 */

/**
 * Registers block patterns and categories.
 *
 * @since Twenty Twenty-Two 1.0
 *
 * @return void
 */
function twentytwentytwo_register_block_patterns() {
	$block_pattern_categories = array(
		'featured'              => array( 'label' => __( 'Featured', 'twentytwentytwo' ) ),
		'footer'                => array( 'label' => __( 'Footers', 'twentytwentytwo' ) ),
		'header'                => array( 'label' => __( 'Headers', 'twentytwentytwo' ) ),
		'query'                 => array( 'label' => __( 'Query', 'twentytwentytwo' ) ),
		'twentytwentytwo_pages' => array( 'label' => __( 'Pages', 'twentytwentytwo' ) ),
	);

	/**
	 * Filters the theme block pattern categories.
	 *
	 * @since Twenty Twenty-Two 1.0
	 *
	 * @param array[] $block_pattern_categories {
	 *     An associative array of block pattern categories, keyed by category name.
	 *
	 *     @type array[] $properties {
	 *         An array of block category properties.
	 *
	 *         @type string $label A human-readable label for the pattern category.
	 *     }
	 * }
	 */
	$block_pattern_categories = apply_filters( 'twentytwentytwo_block_pattern_categories', $block_pattern_categories );

	foreach ( $block_pattern_categories as $name => $properties ) {
		if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) {
			register_block_pattern_category( $name, $properties );
		}
	}

	$block_patterns = array(
		'footer-default',
		'footer-dark',
		'footer-logo',
		'footer-navigation',
		'footer-title-tagline-social',
		'footer-social-copyright',
		'footer-navigation-copyright',
		'footer-about-title-logo',
		'footer-query-title-citation',
		'footer-query-images-title-citation',
		'footer-blog',
		'general-subscribe',
		'general-featured-posts',
		'general-layered-images-with-duotone',
		'general-wide-image-intro-buttons',
		'general-large-list-names',
		'general-video-header-details',
		'general-list-events',
		'general-two-images-text',
		'general-image-with-caption',
		'general-video-trailer',
		'general-pricing-table',
		'general-divider-light',
		'general-divider-dark',
		'header-default',
		'header-large-dark',
		'header-small-dark',
		'header-image-background',
		'header-image-background-overlay',
		'header-with-tagline',
		'header-text-only-green-background',
		'header-text-only-salmon-background',
		'header-title-and-button',
		'header-text-only-with-tagline-black-background',
		'header-logo-navigation-gray-background',
		'header-logo-navigation-social-black-background',
		'header-title-navigation-social',
		'header-logo-navigation-offset-tagline',
		'header-stacked',
		'header-centered-logo',
		'header-centered-logo-black-background',
		'header-centered-title-navigation-social',
		'header-title-and-button',
		'hidden-404',
		'hidden-bird',
		'hidden-heading-and-bird',
		'page-about-media-left',
		'page-about-simple-dark',
		'page-about-media-right',
		'page-about-solid-color',
		'page-about-links',
		'page-about-links-dark',
		'page-about-large-image-and-buttons',
		'page-layout-image-and-text',
		'page-layout-image-text-and-video',
		'page-layout-two-columns',
		'page-sidebar-poster',
		'page-sidebar-grid-posts',
		'page-sidebar-blog-posts',
		'page-sidebar-blog-posts-right',
		'query-default',
		'query-simple-blog',
		'query-grid',
		'query-text-grid',
		'query-image-grid',
		'query-large-titles',
		'query-irregular-grid',
	);

	/**
	 * Filters the theme block patterns.
	 *
	 * @since Twenty Twenty-Two 1.0
	 *
	 * @param array $block_patterns List of block patterns by name.
	 */
	$block_patterns = apply_filters( 'twentytwentytwo_block_patterns', $block_patterns );

	foreach ( $block_patterns as $block_pattern ) {
		$pattern_file = get_theme_file_path( '/inc/patterns/' . $block_pattern . '.php' );

		register_block_pattern(
			'twentytwentytwo/' . $block_pattern,
			require $pattern_file
		);
	}
}
add_action( 'init', 'twentytwentytwo_register_block_patterns', 9 );
helper-functions.php000060400000006710151327377020010551 0ustar00<?php
/**
 * Common theme functions
 *
 * @package WordPress
 * @subpackage Twenty_Nineteen
 * @since Twenty Nineteen 1.5
 */

/**
 * Determines if post thumbnail can be displayed.
 */
function twentynineteen_can_show_post_thumbnail() {
	return apply_filters( 'twentynineteen_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() );
}

/**
 * Returns true if image filters are enabled on the theme options.
 */
function twentynineteen_image_filters_enabled() {
	return 0 !== get_theme_mod( 'image_filter', 1 );
}

/**
 * Returns the size for avatars used in the theme.
 */
function twentynineteen_get_avatar_size() {
	return 60;
}

/**
 * Returns true if comment is by author of the post.
 *
 * @see get_comment_class()
 */
function twentynineteen_is_comment_by_post_author( $comment = null ) {
	if ( is_object( $comment ) && $comment->user_id > 0 ) {
		$user = get_userdata( $comment->user_id );
		$post = get_post( $comment->comment_post_ID );
		if ( ! empty( $user ) && ! empty( $post ) ) {
			return $comment->user_id === $post->post_author;
		}
	}
	return false;
}

/**
 * Returns information about the current post's discussion, with cache support.
 */
function twentynineteen_get_discussion_data() {
	static $discussion, $post_id;

	$current_post_id = get_the_ID();
	if ( $current_post_id === $post_id ) {
		return $discussion; /* If we have discussion information for post ID, return cached object */
	} else {
		$post_id = $current_post_id;
	}

	$comments = get_comments(
		array(
			'post_id' => $current_post_id,
			'orderby' => 'comment_date_gmt',
			'order'   => get_option( 'comment_order', 'asc' ), /* Respect comment order from Settings » Discussion. */
			'status'  => 'approve',
			'number'  => 20, /* Only retrieve the last 20 comments, as the end goal is just 6 unique authors */
		)
	);

	$authors = array();
	foreach ( $comments as $comment ) {
		$authors[] = ( (int) $comment->user_id > 0 ) ? (int) $comment->user_id : $comment->comment_author_email;
	}

	$authors    = array_unique( $authors );
	$discussion = (object) array(
		'authors'   => array_slice( $authors, 0, 6 ),           /* Six unique authors commenting on the post. */
		'responses' => get_comments_number( $current_post_id ), /* Number of responses. */
	);

	return $discussion;
}

/**
 * Converts HSL to HEX colors.
 */
function twentynineteen_hsl_hex( $h, $s, $l, $to_hex = true ) {

	$h /= 360;
	$s /= 100;
	$l /= 100;

	$r = $l;
	$g = $l;
	$b = $l;
	$v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s );

	if ( $v > 0 ) {
		$m       = $l + $l - $v;
		$sv      = ( $v - $m ) / $v;
		$h      *= 6.0;
		$sextant = floor( $h );
		$fract   = $h - $sextant;
		$vsf     = $v * $sv * $fract;
		$mid1    = $m + $vsf;
		$mid2    = $v - $vsf;

		switch ( $sextant ) {
			case 0:
				$r = $v;
				$g = $mid1;
				$b = $m;
				break;
			case 1:
				$r = $mid2;
				$g = $v;
				$b = $m;
				break;
			case 2:
				$r = $m;
				$g = $v;
				$b = $mid1;
				break;
			case 3:
				$r = $m;
				$g = $mid2;
				$b = $v;
				break;
			case 4:
				$r = $mid1;
				$g = $m;
				$b = $v;
				break;
			case 5:
				$r = $v;
				$g = $m;
				$b = $mid2;
				break;
		}
	}

	$r = round( $r * 255, 0 );
	$g = round( $g * 255, 0 );
	$b = round( $b * 255, 0 );

	if ( $to_hex ) {

		$r = ( $r < 15 ) ? '0' . dechex( $r ) : dechex( $r );
		$g = ( $g < 15 ) ? '0' . dechex( $g ) : dechex( $g );
		$b = ( $b < 15 ) ? '0' . dechex( $b ) : dechex( $b );

		return "#$r$g$b";

	}

	return "rgb($r, $g, $b)";
}
template-functions.php000064400000033233151327377020011111 0ustar00<?php

use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\View;

function colibriwp_page_title( $atts = array() ) {
    $title = '';
    if ( is_404() ) {
        $title = __( 'Page not found', 'colibri-wp' );
    } elseif ( is_search() ) {
        $title = sprintf( __( 'Search Results for &#8220;%s&#8221;', 'colibri-wp' ), get_search_query() );
    } elseif ( is_home() ) {
        if ( is_front_page() ) {
            $title = get_bloginfo( 'name' );
        } else {
            $title = single_post_title( '', false );
        }
    } elseif ( is_archive() ) {
        if ( is_post_type_archive() ) {
            $title = post_type_archive_title( '', false );
        } else {
            $title = get_the_archive_title();
        }
    } elseif ( is_single() ) {
        $title = get_bloginfo( 'name' );

        global $post;
        if ( $post ) {
            // apply core filter
            $title = apply_filters( 'single_post_title', $post->post_title, $post );
        }
    } else {
        $title = get_the_title();
    }

    echo "<span><" . $atts['tag'] . ">" . $title . "</" . $atts['tag'] . "></span>";
}

function colibriwp_site_title() {
    $site_title = get_bloginfo( 'name' );
    echo esc_html( $site_title );
}

function colibriwp_post_title( $atts ) {
    $atts = array_merge(
        array(
            'heading_type' => 'h3',
            'classes'      => 'colibri-word-wrap'
        ),
        $atts
    );

    $title_tempalte = '<a href="%1$s"><%2$s class="%4$s">%3$s</%2$s></a>';

    printf( $title_tempalte,
        esc_url( get_the_permalink() ),
        $atts['heading_type'],
        get_the_title(),
        $atts['classes']
    );
}

function colibriwp_post_excerpt( $attrs = array() ) {

    $atts = shortcode_atts(
        array(
            'max_length' => '',
        ),
        $attrs
    );


    echo '<div class="colibri-post-excerpt">' . get_the_excerpt() . '</div>';
}

function colibriwp_post_thumb_placeholder_classes( $atts = array() ) {
    $result = 'colibri-post-thumbnail-has-placeholder';

    $show_placeholder = get_theme_mod( 'blog_show_post_thumb_placeholder',
        \ColibriWP\Theme\Defaults::get( 'blog_show_post_thumb_placeholder', true )
    );
    if ( intval( $show_placeholder ) ) {
        echo $result;
    }
}

function colibriwp_post_thumbnail_classes( $atts = array() ) {
    $result = 'colibri-post-has-no-thumbnail';

    if ( has_post_thumbnail() ) {
        $result = 'colibri-post-has-thumbnail';
    }

    if ( get_theme_mod( 'blog_show_post_thumb_placeholder',
        \ColibriWP\Theme\Defaults::get( 'blog_show_post_thumb_placeholder', true ) ) ) {
        $result .= ' colibri-post-thumbnail-has-placeholder';
    }

    echo $result;
}

function colibriwp_post_thumbnail( $atts = array() ) {

    $show_placeholder = get_theme_mod( 'blog_show_post_thumb_placeholder',
        \ColibriWP\Theme\Defaults::get( 'blog_show_post_thumb_placeholder', true ) );
    if ( ! has_post_thumbnail() && ! $show_placeholder ) {
        return;
    }

    if ( has_post_thumbnail() ) {
        if ( Utils::pathGet( $atts, 'link', false ) ) {
            ?>
            <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
                <?php the_post_thumbnail(); ?>
            </a>
            <?php
        } else {
            the_post_thumbnail();
        }
    }
}

function colibriwp_post_meta_date_url( $atts = array() ) {
    $id   = get_the_ID();
    $link = get_day_link( get_post_time( 'Y', false, $id, true ),
        get_post_time( 'm', false, $id, true ),
        get_post_time( 'j', false, $id, true ) );

    echo $link;
}

function colibriwp_post_categories( $attrs = array() ) {
    $categories = get_the_category( get_the_ID() );
    $atts       = shortcode_atts(
        array(
            'prefix' => '',
        ),
        $attrs
    );

    $html = "";
    if ( $atts['prefix'] !== '' ) {
        $html .= '<span class="d-inline-block categories-prefix">' . colibriwp_esc_html_preserve_spaces( $atts['prefix'] ) . '</span>';
    }
    if ( $categories ) {
        foreach ( $categories as $category ) {
            $html .= sprintf( '<a class="d-inline-block" href="%1$s">%2$s</a>',
                esc_url( get_category_link( $category->term_id ) ),
                esc_html( $category->name )
            );
        }
    } else {
        $html .= sprintf( '<span class="d-inline-block">%s</span>', esc_html__( 'No Category', 'colibri-wp' ) );
    }

    echo $html;
}

function colibriwp_esc_html_preserve_spaces( $text ) {
    return esc_html( str_replace( " ", "&nbsp;", $text ) );
}

function colibriwp_post_tags( $attrs = array() ) {
    $atts = shortcode_atts(
        array(
            'prefix' => '',
        ),
        $attrs
    );
    $tags = get_the_tags( get_the_ID() );
    $html = '';
    if ( $atts['prefix'] !== '' ) {
        $html .= '<span class="d-inline-block tags-prefix">' . colibriwp_esc_html_preserve_spaces( $atts['prefix'] ) . '</span>';
    }
    if ( $tags ) {
        foreach ( $tags as $tag ) {
            $tag_link  = get_tag_link( $tag->term_id );
            $tag_title = sprintf( __( 'Tag: %s', 'colibri-wp' ), $tag->name );
            $html      .= sprintf( '<a class="d-inline-block" href="%s" title="%s">%s</a>',
                esc_html( $tag_link ),
                esc_attr( $tag_title ),
                esc_html( $tag->name )
            );
        }
    } else {
        $html .= sprintf( '<span class="d-inline-block">%s</span>', esc_html__( 'No Tag', 'colibri-wp' ) );
    }

    echo $html;
}


function colibriwp_get_nav_direction_wp_name( $type ) {
    return $type == "next" ? $type : "previous";
}


function colibriwp_print_navigation_button( $type, $button_text ) {
    $args = array(
        'prev_text'          => '%title',
        'next_text'          => '%title',
        'in_same_term'       => false,
        'excluded_terms'     => '',
        'taxonomy'           => 'category',
        'screen_reader_text' => __( 'Post navigation', 'colibri-wp' ),
    );

    $navigation        = '';
    $direction_wp_name = colibriwp_get_nav_direction_wp_name( $type );
    $outer             = "<div class=\"nav-{$direction_wp_name}\">%link</div>";
    $nav_link_fct      = "get_{$direction_wp_name}_post_link";
    $navigation        = call_user_func( $nav_link_fct,
        $outer,
        $button_text,
        $args['in_same_term'],
        $args['excluded_terms'],
        $args['taxonomy']
    );

    // Only add markup if there's somewhere to navigate to.
    if ( $navigation ) {
        $navigation = _navigation_markup( $navigation, 'post-navigation',
            $args['screen_reader_text'] );
    }

    echo $navigation;
}


function colibriwp_post_nav_button( $atts = array() ) {
    $type = $atts['type'];
    $meta = $atts["{$type}_post"];

    $button_text = '<span class="meta-nav" aria-hidden="true">' . $meta . '</span> ' .
                   '<span class="post-title" title="%title">%title</span>';
    colibriwp_print_navigation_button( $type, $button_text );

}


function colibriwp_button_pagination( $args, $atts ) {
    $type          = $atts['type'];
    $nav_direction = colibriwp_get_nav_direction_wp_name( $type );
    $label         = $atts["{$type}_label"];
    $link          = call_user_func( "get_{$nav_direction}_posts_link", '<span>' . $label . '</span>' );
    ?>
    <div class="navigation" role="navigation">
        <h2 class="screen-reader-text"><?php echo $args['screen_reader_text'] ?></h2>
        <div class="nav-links">
            <div class="<?php echo $type ?>-navigation"><?php echo $link; ?></div>
        </div>
    </div>
    <?php
}

function colibriwp_numbers_pagination( $args, $atts ) {
    $links = paginate_links( $args );
    $template
           = '<div class="navigation" role="navigation">' .
             '  <h2 class="screen-reader-text">' . $args["screen_reader_text"] . '</h2>' .
             '  <div class="nav-links">' .
             '      <div class="numbers-navigation">' . $links . '</div>' .
             ' </div>' .
             '</div>';
    echo $template;
}


function colibriwp_render_pagination( $pagination_type, $atts = array(), $args = array() ) {
    $args = wp_parse_args( $args, array(
        'before_page_number' => '<span class="meta-nav screen-reader-text">'
                                . __( 'Page', 'colibri-wp' )
                                . ' </span>',
        'prev_text'          => '',
        'next_text'          => '',
        'prev_next'          => false,
        'screen_reader_text' => __( 'Posts navigation',
            'colibri-wp' ),
    ) );

    call_user_func( $pagination_type, $args, $atts );
}


function colibriwp_archive_nav_button( $attrs = array() ) {

    $atts = shortcode_atts(
        array(
            'type'       => 'next',
            'next_label' => '',
            'prev_label' => ''
        ),
        $attrs
    );
    colibriwp_render_pagination( 'colibriwp_button_pagination', $atts );
}


function colibriwp_archive_pagination() {
    colibriwp_render_pagination( '\colibriwp_numbers_pagination' );
}

function colibriwp_render_page_comments() {
    if ( ! comments_open() ) {
        return;
    }
    ?>
    <div id="page-comments" class="page-comments">
        <div
                class="h-section h-section-global-spacing d-flex align-items-lg-center align-items-md-center align-items-center">
            <div class="h-section-grid-container h-section-boxed-container">
                <div class="gutters-row-md-2 gutters-row-0 position-relative">
                    <div class="h-px-lg-2 h-px-md-2 h-px-2 ">
                        <?php echo colibriwp_post_comments() ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php

}

function colibriwp_post_comments( $attrs = array() ) {
    // comments won't render without post//
    if ( is_customize_preview() ) {
        the_post();
    }

    $atts = shortcode_atts(
        array(
            'none'        => 'No responses yet',
            'one'         => 'One response',
            'multiple'    => 'Responses',
            'avatar_size' => 32
        ),
        $attrs
    );

    ob_start();


    add_filter( 'comments_template', 'colibriwp_post_comments_template' );
    if ( comments_open( get_the_ID() ) ) {
        comments_template();
    } else {
        return "";
    }
    $content = ob_get_clean();

    remove_filter( 'comments_template', 'colibriwp_post_comments_template' );

    echo $content;
}

function colibriwp_post_comment_form() {

}

function colibriwp_widget_area( $atts ) {

    if ( is_customize_preview() ) {
        global $wp_customize;
        $wp_customize->widgets->selective_refresh_init();
    }

    $atts = shortcode_atts(
        array(
            'id' => 'widget-1',
        ),
        $atts
    );

    $id = "colibri-" . $atts['id'];
    $id = Hooks::colibri_apply_filters( 'widget_area_id', $id );

    ob_start();
    dynamic_sidebar( $id );
    $content = ob_get_clean();
    echo $content;
}

function colibriwp_post_meta_time_url() {
    return '';
}

function colibriwp_has_multiple_pages() {
    global $wp_query;

    $adjacent_post = get_next_post();

    if ( empty( $adjacent_post ) ) {
        $adjacent_post = get_previous_post();
    }

    if ( is_single() ) {
        return ! empty( $adjacent_post );
    }

    return ( $wp_query->max_num_pages > 1 );
}

function colibriwp_output_sidebar_search_form( $form = '' ) {

    ob_start();

    get_template_part( 'template-parts/blog/searchform' );

    return ob_get_clean();
}

function colibriwp_post_comments_template( $form = '' ) {
    return 'template-parts/blog/comments.php';
}

function colibriwp_theme_print_footer_copyright() {
    ?>
    <div class="h-global-transition-all">
        &copy; <?php echo date( 'Y' ); ?> <?php bloginfo( 'blogname' ); ?>.
        <?php printf( __( 'Built using WordPress and %s', 'colibri-wp' ),
            '<a target="_blank" href="https://colibriwp.com/">ColibriWP Theme</a>'
        ); ?> .
    </div>
    <?php
}

function colibriwp_copyright() {
    ?>
    <div class="h-global-transition-all">
        <span>&copy; <?php echo date( 'Y' ); ?> <?php bloginfo( 'blogname' ); ?></span>.
    </div>
    <?php
}

function colibriwp_print_offscreen_copyright() {
    echo "&copy; " . date( 'Y' );
}

function colibriwp_the_date( $format = 'F j, Y' ) {
    echo get_the_date( $format );
}

add_filter( 'get_search_form', "colibriwp_output_sidebar_search_form", 100 );


function colibriwp_layout_wrapper( $atts ) {
    $atts = array_merge(
        array(
            "name" => "",
            "slug" => ""
        ),
        $atts
    );

    $name = $atts['name'];

    ?>
    <!-- layout_wrapper_output:<?php echo esc_attr( $name ); ?>-start -->
    <?php
    Hooks::colibri_do_action( "layout_wrapper_output_{$name}", $atts );
    ?>
    <!-- layout_wrapper_output:<?php echo esc_attr( $name ); ?>-end -->
    <?php
}


function colibriwp_layout_wrapper_output_tags_container( $atts ) {
    if ( has_tag() ) {
        View::partial( 'layout-wrapper-content', $atts['slug'] );
    }
}


function colibriwp_layout_wrapper_output_categories_container( $atts ) {
    if ( has_category() ) {
        View::partial( 'layout-wrapper-content', $atts['slug'] );
    }
}


function colibriwp_layout_wrapper_output_navigation_container( $atts ) {
    if ( colibriwp_has_multiple_pages() ) {
        View::partial( 'layout-wrapper-content', $atts['slug'] );
    }
}

Hooks::colibri_add_action( "layout_wrapper_output_tags_container",
    'colibriwp_layout_wrapper_output_tags_container' );

Hooks::colibri_add_action( "layout_wrapper_output_categories_container",
    'colibriwp_layout_wrapper_output_categories_container' );

Hooks::colibri_add_action( "layout_wrapper_output_navigation_container",
    'colibriwp_layout_wrapper_output_navigation_container' );
patterns/footer-query-images-title-citation.php000060400000004444151330667700015762 0ustar00<?php
/**
 * Footer with query, featured images, title, and citation
 */
return array(
	'title'      => __( 'Footer with query, featured images, title, and citation', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"exclude","inherit":false},"displayLayout":{"type":"flex","columns":3},"align":"wide"} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template -->
					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query -->

					<!-- wp:spacer -->
					<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-title {"level":0} /-->
					<!-- wp:group {"layout":{"type":"flex","justifyContent":"right"}} -->
					<div class="wp-block-group">
					<!-- wp:paragraph -->
					<p>' .
					sprintf(
						/* Translators: WordPress link. */
						esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ),
						'<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>'
					) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/general-featured-posts.php000060400000002162151330667700013502 0ustar00<?php
/**
 * Featured posts block pattern
 */
return array(
	'title'      => __( 'Featured posts', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'query' ),
	'content'    => '<!-- wp:group {"align":"wide","layout":{"inherit":false}} -->
					<div class="wp-block-group alignwide"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} -->
					<p style="text-transform:uppercase">' . esc_html__( 'Latest posts', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"displayLayout":{"type":"flex","columns":3}} -->
					<div class="wp-block-query"><!-- wp:post-template -->
					<!-- wp:post-featured-image {"isLink":true,"width":"","height":"310px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:group -->',
);
patterns/footer-default.php000060400000002004151330667700012035 0ustar00<?php
/**
 * Default footer
 */
return array(
	'title'      => __( 'Default footer', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-title {"level":0} /-->

					<!-- wp:paragraph {"align":"right"} -->
					<p class="has-text-align-right">' .
					sprintf(
						/* Translators: WordPress link. */
						esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ),
						'<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>'
					) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/page-about-media-right.php000060400000005551151330667700013343 0ustar00<?php
/**
 * About page with media on the right
 */
return array(
	'title'      => __( 'About page with media on the right', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:media-text {"align":"full","mediaPosition":"right","mediaLink":"' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-black.jpg","mediaType":"image","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background"} -->
				<div class="wp-block-media-text alignfull has-media-on-the-right is-stacked-on-mobile has-background-color has-foreground-background-color has-text-color has-background has-link-color"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-black.jpg" alt="' . esc_attr__( 'An image of a bird flying', 'twentytwentytwo' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->
					<!-- wp:site-logo {"width":60} /-->

					<!-- wp:group {"style":{"spacing":{"padding":{"right":"min(8rem, 5vw)","top":"min(20rem, 20vw)"}}}} -->
					<div class="wp-block-group" style="padding-top:min(20rem, 20vw);padding-right:min(8rem, 5vw)"><!-- wp:heading {"style":{"typography":{"fontWeight":"300","lineHeight":"1.115","fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} -->
					<h2 style="font-size:clamp(3rem, 6vw, 4.5rem);font-weight:300;line-height:1.115"><em>' . wp_kses_post( __( 'Emery<br>Driscoll', 'twentytwentytwo' ) ) . '</em></h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.6"}}} -->
					<p style="line-height:1.6">' . esc_html__( 'Oh hello. My name’s Emery, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show on Tuesday evenings at 11PM EDT.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":40} -->
					<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--foreground)","iconBackgroundColor":"foreground","iconBackgroundColorValue":"var(--wp--preset--color--background)"} -->
					<ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"#","service":"wordpress"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
					<!-- /wp:social-links --></div>
					<!-- /wp:group --></div>

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div>
					<!-- /wp:media-text -->',
);
patterns/page-about-links.php000060400000010344151330667700012265 0ustar00<?php
/**
 * About page links
 */
return array(
	'title'      => __( 'About page links', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages', 'buttons' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"10rem","bottom":"10rem"}}},"layout":{"inherit":false,"contentSize":"400px"}} -->
					<div class="wp-block-group alignfull" style="padding-top:10rem;padding-bottom:10rem;"><!-- wp:image {"align":"center","width":100,"height":100,"sizeSlug":"full","linkDestination":"none","className":"is-style-rounded"} -->
					<div class="wp-block-image is-style-rounded"><figure class="aligncenter size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/icon-bird.jpg" alt="' . esc_attr__( 'Logo featuring a flying bird', 'twentytwentytwo' ) . '" width="100" height="100"/></figure></div>
					<!-- /wp:image -->

					<!-- wp:group -->
					<div class="wp-block-group">

					<!-- wp:heading {"textAlign":"center","style":{"typography":{"fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"}}} -->
					<h2 class="has-text-align-center" style="font-size:var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))">' . esc_html__( 'Swoop', 'twentytwentytwo' ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph {"align":"center"} -->
					<p class="has-text-align-center">' . esc_html__( 'A podcast about birds', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":40} -->
					<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:buttons {"contentJustification":"left"} -->
					<div class="wp-block-buttons is-content-justification-left"><!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Watch our videos', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button -->

					<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on iTunes Podcasts', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button -->

					<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on Spotify', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button -->

					<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Support the show', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button -->

					<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-fill"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-fill"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'About the hosts', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:group -->

					<!-- wp:spacer {"height":40} -->
					<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:social-links {"iconColor":"primary","iconColorValue":"var(--wp--preset--color--primary)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"center"}} -->
					<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"wordpress"} /-->

					<!-- wp:social-link {"url":"#","service":"facebook"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
					<!-- /wp:social-links --></div>
					<!-- /wp:group -->',
);
patterns/page-about-links-dark.php000060400000007131151330667700013204 0ustar00<?php
/**
 * About page links (dark)
 */
return array(
	'title'      => __( 'About page links (dark)', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages', 'buttons' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"10rem","bottom":"10rem"}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":false,"contentSize":"400px"}} -->
					<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:10rem;padding-bottom:10rem;"><!-- wp:group -->
					<div class="wp-block-group">

					<!-- wp:image {"width":100,"height":100,"sizeSlug":"full","linkDestination":"none","className":"is-style-rounded"} -->
					<figure class="wp-block-image size-full is-resized is-style-rounded"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/icon-bird.jpg" alt="' . esc_attr__( 'Logo featuring a flying bird', 'twentytwentytwo' ) . '" width="100" height="100"/></figure>
					<!-- /wp:image -->

					<!-- wp:heading {"textAlign":"left","style":{"typography":{"fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"}}} -->
					<h2 class="has-text-align-left" style="font-size:var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))">' . esc_html__( 'A trouble of hummingbirds', 'twentytwentytwo' ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:spacer {"height":40} -->
					<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:buttons {"contentJustification":"left"} -->
					<div class="wp-block-buttons is-content-justification-left"><!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Watch our videos', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button -->

					<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on iTunes Podcasts', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button -->

					<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on Spotify', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button -->

					<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Support the show', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button -->

					<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'About the hosts', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/header-text-only-green-background.php000060400000003116151330667700015526 0ustar00<?php
/**
 * Text-only header with green background block pattern
 */
return array(
	'title'      => __( 'Text-only header with background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide"><!-- wp:group -->
					<div class="wp-block-group"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /-->

					<!-- wp:site-tagline {"style":{"spacing":{"margin":{"top":"0.25em","bottom":"0px"}},"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div>
					<!-- /wp:group -->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/header-with-tagline.php000060400000003063151330667700012745 0ustar00<?php
/**
 * Header with tagline block pattern
 */
return array(
	'title'      => __( 'Header with tagline', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"type":"flex"}} -->
					<div class="wp-block-group"><!-- wp:site-logo {"width":64} /-->

					<!-- wp:group -->
					<div class="wp-block-group"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /-->

					<!-- wp:site-tagline {"style":{"spacing":{"margin":{"top":"0.25em","bottom":"0px"}},"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/query-grid.php000060400000002556151330667700011221 0ustar00<?php
/**
 * Grid of posts block pattern
 */
return array(
	'title'      => __( 'Grid of posts', 'twentytwentytwo' ),
	'categories' => array( 'query' ),
	'blockTypes' => array( 'core/query' ),
	'content'    => '<!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":12},"displayLayout":{"type":"flex","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template -->

					<!-- wp:separator {"align":"wide","className":"is-style-wide"} -->
					<hr class="wp-block-separator alignwide is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<!-- wp:query-pagination-previous {"fontSize":"small"} /-->

					<!-- wp:query-pagination-numbers /-->

					<!-- wp:query-pagination-next {"fontSize":"small"} /-->
					<!-- /wp:query-pagination --></div>
					<!-- /wp:query -->',
);
patterns/general-wide-image-intro-buttons.php000060400000004625151330667700015400 0ustar00<?php
/**
 * Wide image with introduction and buttons block pattern
 */
return array(
	'title'      => __( 'Wide image with introduction and buttons', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'columns' ),
	'content'    => '<!-- wp:group {"align":"wide"} -->
				<div class="wp-block-group alignwide"><!-- wp:image {"width":2100,"height":994,"sizeSlug":"large"} -->
				<figure class="wp-block-image size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-gray-a.jpg" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2100" height="994"/></figure>
				<!-- /wp:image -->

				<!-- wp:columns {"verticalAlignment":null} -->
				<div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"bottom"} -->
				<div class="wp-block-column is-vertically-aligned-bottom"><!-- wp:heading {"style":{"typography":{"fontSize":"clamp(3.25rem, 8vw, 6.25rem)","lineHeight":"1.15"}}} -->
				<h2 style="font-size:clamp(3.25rem, 8vw, 6.25rem);line-height:1.15"><em>' . wp_kses_post( __( 'Welcome to<br>the Aviary', 'twentytwentytwo' ) ) . '</em></h2>
				<!-- /wp:heading --></div>
				<!-- /wp:column -->

				<!-- wp:column {"verticalAlignment":"bottom","style":{"spacing":{"padding":{"bottom":"6rem"}}}} -->
				<div class="wp-block-column is-vertically-aligned-bottom" style="padding-bottom:6rem"><!-- wp:paragraph -->
				<p>' . esc_html__( 'A film about hobbyist bird watchers, a catalog of different birds, paired with the noises they make. Each bird is listed by their scientific name so things seem more official.', 'twentytwentytwo' ) . '</p>
				<!-- /wp:paragraph -->

				<!-- wp:spacer {"height":20} -->
				<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
				<!-- /wp:spacer -->

				<!-- wp:buttons -->
				<div class="wp-block-buttons"><!-- wp:button {"className":"is-style-outline"} -->
				<div class="wp-block-button is-style-outline"><a class="wp-block-button__link">' . esc_html__( 'Learn More', 'twentytwentytwo' ) . '</a></div>
				<!-- /wp:button -->

				<!-- wp:button {"className":"is-style-outline"} -->
				<div class="wp-block-button is-style-outline"><a class="wp-block-button__link">' . esc_html__( 'Buy Tickets', 'twentytwentytwo' ) . '</a></div>
				<!-- /wp:button --></div>
				<!-- /wp:buttons --></div>
				<!-- /wp:column --></div>
				<!-- /wp:columns --></div>
				<!-- /wp:group -->',
);
patterns/general-large-list-names.php000060400000004573151330667700013711 0ustar00<?php
/**
 * Large list of names block pattern
 */
return array(
	'title'      => __( 'Large list of names', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'text' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"6rem","bottom":"6rem"}},"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"backgroundColor":"tertiary","textColor":"primary","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-primary-color has-tertiary-background-color has-text-color has-background has-link-color" style="padding-top:6rem;padding-bottom:6rem"><!-- wp:group {"align":"wide"} -->
					<div class="wp-block-group alignwide"><!-- wp:image {"width":175,"height":82,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/icon-binoculars.png" alt="' . esc_attr__( 'An icon representing binoculars.', 'twentytwentytwo' ) . '" width="175" height="82"/></figure>
					<!-- /wp:image --></div>
					<!-- /wp:group -->

					<!-- wp:group {"align":"wide"} -->
					<div class="wp-block-group alignwide"><!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:paragraph {"style":{"typography":{"fontWeight":"300"}},"fontSize":"x-large"} -->
					<p class="has-x-large-font-size" style="font-weight:300">' . esc_html__( 'Jesús Rodriguez, Doug Stilton, Emery Driscoll, Megan Perry, Rowan Price, Angelo Tso, Edward Stilton, Amy Jensen, Boston Bell, Shay Ford, Lee Cunningham, Evelynn Ray, Landen Reese, Ewan Hart, Jenna Chan, Phoenix Murray, Mel Saunders, Aldo Davidson, Zain Hall.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"primary","textColor":"background"} -->
					<div class="wp-block-button"><a class="wp-block-button__link has-background-color has-primary-background-color has-text-color has-background">' . esc_html__( 'Read more', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/header-logo-navigation-social-black-background.php000060400000003623151330667700020107 0ustar00<?php
/**
 * Logo, navigation, and social links header with black background block pattern
 */
return array(
	'title'      => __( 'Logo, navigation, and social links header with background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:site-logo {"width":64} /-->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->

					<!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--background)","className":"is-style-logos-only"} -->
					<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"instagram"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /--></ul>
					<!-- /wp:social-links -->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/general-subscribe.php000060400000002715151330667700012522 0ustar00<?php
/**
 * Subscribe callout block pattern
 */
return array(
	'title'      => __( 'Subscribe callout', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'buttons' ),
	'content'    => '<!-- wp:columns {"verticalAlignment":"center","align":"wide"} -->
					<div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading -->
					<h2>' . wp_kses_post( __( 'Watch birds<br>from your inbox', 'twentytwentytwo' ) ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"fontSize":"medium"} -->
					<div class="wp-block-button has-custom-font-size has-medium-font-size"><a class="wp-block-button__link">' . esc_html__( 'Join our mailing list', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center","style":{"spacing":{"padding":{"top":"2rem","bottom":"2rem"}}}} -->
					<div class="wp-block-column is-vertically-aligned-center" style="padding-top:2rem;padding-bottom:2rem"><!-- wp:separator {"color":"primary","className":"is-style-wide"} -->
					<hr class="wp-block-separator has-text-color has-background has-primary-background-color has-primary-color is-style-wide"/>
					<!-- /wp:separator --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->',
);
patterns/general-two-images-text.php000060400000005275151330667700013603 0ustar00<?php
/**
 * Two images with text block pattern
 */
return array(
	'title'      => __( 'Two images with text', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'columns', 'gallery' ),
	'content'    => '<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"style":{"spacing":{"padding":{"top":"0rem","right":"0rem","bottom":"0rem","left":"0rem"}}}} -->
					<div class="wp-block-column" style="padding-top:0rem;padding-right:0rem;padding-bottom:0rem;padding-left:0rem"><!-- wp:image {"width":984,"height":1426,"sizeSlug":"large"} -->
					<figure class="wp-block-image size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-salmon.jpg" alt="' . esc_attr__( 'Illustration of a bird sitting on a branch.', 'twentytwentytwo' ) . '" width="984" height="1426"/></figure>
					<!-- /wp:image --></div>
					<!-- /wp:column -->

					<!-- wp:column {"style":{"spacing":{"padding":{"top":"0rem","right":"0rem","bottom":"0rem","left":"0rem"}}}} -->
					<div class="wp-block-column" style="padding-top:0rem;padding-right:0rem;padding-bottom:0rem;padding-left:0rem"><!-- wp:image {"width":984,"height":1426,"sizeSlug":"large"} -->
					<figure class="wp-block-image size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-green.jpg" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="984" height="1426"/></figure>
					<!-- /wp:image -->

					<!-- wp:spacer {"height":30} -->
					<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:heading {"fontSize":"x-large"} -->
					<h2 class="has-x-large-font-size" id="screening">' . esc_html__( 'SCREENING', 'twentytwentytwo' ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'May 14th, 2022 @ 7:00PM<br>The Vintagé Theater,<br>245 Arden Rd.<br>Gardenville, NH', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":8} -->
					<div style="height:8px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:spacer {"height":10} -->
					<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"foreground"} -->
					<div class="wp-block-button"><a class="wp-block-button__link has-foreground-background-color has-background">' . esc_html__( 'Buy Tickets', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->',
);
patterns/page-sidebar-grid-posts.php000060400000010137151330667700013537 0ustar00<?php
/**
 * Grid of posts with left sidebar block pattern
 */
return array(
	'title'      => __( 'Grid of posts with left sidebar', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:columns {"align":"wide","style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}}}} -->
					<div class="wp-block-columns alignwide" style="margin-top:0px;margin-bottom:0px"><!-- wp:column {"width":"30%"} -->
					<div class="wp-block-column" style="flex-basis:30%"><!-- wp:site-title {"isLink":false,"style":{"spacing":{"margin":{"top":"0px","bottom":"1rem"}},"typography":{"fontStyle":"italic","fontWeight":"300","lineHeight":"1.1"}},"fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))","fontFamily":"source-serif-pro"} /-->

					<!-- wp:site-tagline {"fontSize":"small"} /-->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:separator {"color":"foreground","className":"is-style-wide"} -->
					<hr class="wp-block-separator has-text-color has-background has-foreground-background-color has-foreground-color is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:navigation {"orientation":"vertical"} -->
					<!-- wp:page-list /-->
					<!-- /wp:navigation -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:separator {"color":"foreground","className":"is-style-wide"} -->
					<hr class="wp-block-separator has-text-color has-background has-foreground-background-color has-foreground-color is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:site-logo {"width":60} /--></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":"70%"} -->
					<div class="wp-block-column" style="flex-basis:70%"><!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","inherit":false,"perPage":12},"displayLayout":{"type":"flex","columns":3},"layout":{"inherit":true}} -->
					<div class="wp-block-query"><!-- wp:post-template -->
					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"200px"} /-->

					<!-- wp:group {"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group"><!-- wp:post-title {"isLink":true,"style":{"typography":{"fontStyle":"normal","fontWeight":"400"}},"fontSize":"small","fontFamily":"system-font"} /-->

					<!-- wp:post-date {"format":"m.d.y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div>
					<!-- /wp:group -->
					<!-- /wp:post-template -->

					<!-- wp:separator {"className":"alignwide is-style-wide"} -->
					<hr class="wp-block-separator alignwide is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<!-- wp:query-pagination-previous {"fontSize":"small"} /-->

					<!-- wp:query-pagination-numbers /-->

					<!-- wp:query-pagination-next {"fontSize":"small"} /-->
					<!-- /wp:query-pagination --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/hidden-404.php000060400000001741151330667700010664 0ustar00<?php
/**
 * 404 content.
 */
return array(
	'title'    => __( '404 content', 'twentytwentytwo' ),
	'inserter' => false,
	'content'  => '<!-- wp:heading {"style":{"typography":{"fontSize":"clamp(4rem, 40vw, 20rem)","fontWeight":"200","lineHeight":"1"}},"className":"has-text-align-center"} -->
					<h2 class="has-text-align-center" style="font-size:clamp(4rem, 40vw, 20rem);font-weight:200;line-height:1">' . esc_html( _x( '404', 'Error code for a webpage that is not found.', 'twentytwentytwo' ) ) . '</h2>
					<!-- /wp:heading -->
					<!-- wp:paragraph {"align":"center"} -->
					<p class="has-text-align-center">' . esc_html__( 'This page could not be found. Maybe try a search?', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->
					<!-- wp:search {"label":"' . esc_html_x( 'Search', 'label', 'twentytwentytwo' ) . '","showLabel":false,"width":50,"widthUnit":"%","buttonText":"' . esc_html__( 'Search', 'twentytwentytwo' ) . '","buttonUseIcon":true,"align":"center"} /-->',
);
patterns/query-image-grid.php000060400000003573151330667700012301 0ustar00<?php
/**
 * Grid of image posts block pattern
 */
return array(
	'title'      => __( 'Grid of image posts', 'twentytwentytwo' ),
	'categories' => array( 'query' ),
	'blockTypes' => array( 'core/query' ),
	'content'    => '<!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","inherit":false,"perPage":12},"displayLayout":{"type":"flex","columns":3},"layout":{"inherit":true}} -->
					<div class="wp-block-query"><!-- wp:post-template -->
					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"200px"} /-->

					<!-- wp:columns {"isStackedOnMobile":false,"style":{"spacing":{"blockGap":"0.5rem"}}} -->
					<div class="wp-block-columns is-not-stacked-on-mobile"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:post-title {"isLink":true,"style":{"typography":{"fontStyle":"normal","fontWeight":"400"},"spacing":{"margin":{"top":"0.2em"}}},"fontSize":"small","fontFamily":"system-font"} /--></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":"4em"} -->
					<div class="wp-block-column" style="flex-basis:4em"><!-- wp:post-date {"textAlign":"right","format":"m.d.y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->
					<!-- /wp:post-template -->

					<!-- wp:separator {"className":"is-style-wide"} -->
					<hr class="wp-block-separator alignwide is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<!-- wp:query-pagination-previous {"fontSize":"small"} /-->

					<!-- wp:query-pagination-numbers /-->

					<!-- wp:query-pagination-next {"fontSize":"small"} /-->
					<!-- /wp:query-pagination --></div>
					<!-- /wp:query -->',
);
patterns/general-layered-images-with-duotone.php000060400000002764151330667700016061 0ustar00<?php
/**
 * Layered images with duotone block pattern
 */
return array(
	'title'      => __( 'Layered images with duotone', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'gallery' ),
	'content'    => '<!-- wp:cover {"url":"' . esc_url( get_template_directory_uri() ) . '/assets/images/ducks.jpg","dimRatio":0,"minHeight":666,"contentPosition":"center center","isDark":false,"align":"wide","style":{"spacing":{"padding":{"top":"1em","right":"1em","bottom":"1em","left":"1em"}},"color":{"duotone":["#000000","#FFFFFF"]}}} -->
					<div class="wp-block-cover alignwide is-light" style="padding-top:1em;padding-right:1em;padding-bottom:1em;padding-left:1em;min-height:666px"><span aria-hidden="true" class="has-background-dim-0 wp-block-cover__gradient-background has-background-dim"></span><img class="wp-block-cover__image-background" alt="' . esc_attr__( 'Painting of ducks in the water.', 'twentytwentytwo' ) . '" src="' . esc_url( get_template_directory_uri() ) . '/assets/images/ducks.jpg" data-object-fit="cover"/><div class="wp-block-cover__inner-container"><!-- wp:image {"align":"center","width":384,"height":580,"sizeSlug":"large"} -->
					<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-salmon.jpg" alt="' . esc_attr__( 'Illustration of a flying bird.', 'twentytwentytwo' ) . '" width="384" height="580"/></figure></div>
					<!-- /wp:image --></div></div>
					<!-- /wp:cover -->',
);
patterns/general-video-trailer.php000060400000003227151330667700013306 0ustar00<?php
/**
 * Video trailer block pattern
 */
return array(
	'title'      => __( 'Video trailer', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'columns' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}},"spacing":{"padding":{"top":"6rem","bottom":"4rem"}}},"backgroundColor":"secondary","textColor":"foreground","layout":{"inherit":true}} -->
				<div class="wp-block-group alignfull has-foreground-color has-secondary-background-color has-text-color has-background has-link-color" style="padding-top:6rem;padding-bottom:4rem"><!-- wp:columns {"align":"wide"} -->
				<div class="wp-block-columns alignwide"><!-- wp:column {"width":"33.33%"} -->
				<div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:heading {"fontSize":"x-large"} -->
				<h2 class="has-x-large-font-size" id="extended-trailer">' . esc_html__( 'Extended Trailer', 'twentytwentytwo' ) . '</h2>
				<!-- /wp:heading -->

				<!-- wp:paragraph -->
				<p>' . esc_html__( 'A film about hobbyist bird watchers, a catalog of different birds, paired with the noises they make. Each bird is listed by their scientific name so things seem more official.', 'twentytwentytwo' ) . '</p>
				<!-- /wp:paragraph --></div>
				<!-- /wp:column -->

				<!-- wp:column {"width":"66.66%"} -->
				<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:video -->
				<figure class="wp-block-video"><video controls src="' . esc_url( get_template_directory_uri() ) . '/assets/videos/birds.mp4"></video></figure>
				<!-- /wp:video --></div>
				<!-- /wp:column --></div>
				<!-- /wp:columns --></div>
				<!-- /wp:group -->',
);
patterns/page-layout-image-text-and-video.php000060400000007650151330667700015266 0ustar00<?php
/**
 * Page layout with image, text and video.
 */
return array(
	'title'      => __( 'Page layout with image, text and video', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"backgroundColor":"primary","textColor":"background"} -->
					<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"inherit":true}} -->
					<div class="wp-block-group"><!-- wp:heading {"level":1,"align":"wide","style":{"typography":{"fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} -->
					<h1 class="alignwide" style="font-size:clamp(3rem, 6vw, 4.5rem)">' . wp_kses_post( __( '<em>Warble</em>, a film about <br>hobbyist bird watchers.', 'twentytwentytwo' ) ) . '</h1>
					<!-- /wp:heading -->

					<!-- wp:spacer {"height":50} -->
					<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"width":"33.33%"} -->
					<div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:heading {"fontSize":"x-large"} -->
					<h2 class="has-x-large-font-size">' . esc_html__( 'Screening', 'twentytwentytwo' ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'May 14th, 2022 @ 7:00PM<br>The Vintagé Theater,<br>245 Arden Rd.<br>Gardenville, NH', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"secondary","textColor":"primary"} -->
					<div class="wp-block-button"><a class="wp-block-button__link has-primary-color has-secondary-background-color has-text-color has-background">' . esc_html__( 'Buy Tickets', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":"66.66%"} -->
					<div class="wp-block-column" style="flex-basis:66.66%"></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->

					<!-- wp:image {"align":"full","width":2400,"height":1178,"style":{"color":{}}} -->
					<figure class="wp-block-image alignfull is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-a.png" alt="' . esc_attr__( 'An illustration of a bird in flight', 'twentytwentytwo' ) . '" width="2400" height="1178"/></figure>
					<!-- /wp:image -->

					<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"width":"33.33%"} -->
					<div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:heading {"fontSize":"x-large"} -->
					<h2 class="has-x-large-font-size">' . esc_html__( 'Extended Trailer', 'twentytwentytwo' ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . esc_html__( 'Oh hello. My name’s Angelo, and you’ve found your way to my blog. I write about a range of topics, but lately I’ve been sharing my hopes for next year.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":"66.66%"} -->
					<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:video {"id":181} -->
					<figure class="wp-block-video"><video controls src="' . esc_url( get_template_directory_uri() ) . '/assets/videos/birds.mp4"></video></figure>
					<!-- /wp:video --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/query-large-titles.php000060400000002517151330667700012665 0ustar00<?php
/**
 * Large post titles block pattern
 */
return array(
	'title'      => __( 'Large post titles', 'twentytwentytwo' ),
	'categories' => array( 'query' ),
	'blockTypes' => array( 'core/query' ),
	'content'    => '<!-- wp:query {"query":{"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"perPage":8},"align":"wide"} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template -->
					<!-- wp:columns -->
					<div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"top","width":"4em"} -->
					<div class="wp-block-column is-vertically-aligned-top" style="flex-basis:4em"><!-- wp:post-date {"format":"M j","fontSize":"small"} /--></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center","width":""} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:post-title {"isLink":true,"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontSize":"clamp(2.75rem, 6vw, 3.25rem)"}}} /--></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:separator {"className":"is-style-wide"} -->
					<hr class="wp-block-separator is-style-wide"/>
					<!-- /wp:separator -->
					<!-- /wp:post-template --></div>
					<!-- /wp:query -->',
);
patterns/page-sidebar-poster.php000060400000006543151330667700012766 0ustar00<?php
/**
 * Poster with right sidebar block pattern
 */
return array(
	'title'      => __( 'Poster with right sidebar', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:columns {"align":"wide","style":{"spacing":{"blockGap":"5%"}}} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"width":"70%"} -->
					<div class="wp-block-column" style="flex-basis:70%">

					<!-- wp:heading {"level":1,"align":"wide","style":{"typography":{"fontSize":"clamp(3rem, 6vw, 4.5rem)"},"spacing":{"margin":{"bottom":"0px"}}}} -->
				<h1 class="alignwide" style="font-size:clamp(3rem, 6vw, 4.5rem);margin-bottom:0px">' . wp_kses_post( __( '<em>Flutter</em>, a collection of bird-related ephemera', 'twentytwentytwo' ) ) . '</h1>
					<!-- /wp:heading --></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":""} -->
					<div class="wp-block-column"></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:columns {"align":"wide","style":{"spacing":{"blockGap":"5%"}}} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"width":"70%","style":{"spacing":{"padding":{"bottom":"32px"}}}} -->
					<div class="wp-block-column" style="padding-bottom:32px;flex-basis:70%"><!-- wp:image {"width":984,"height":1426,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-salmon.jpg" alt="' . esc_attr__( 'Image of a bird on a branch', 'twentytwentytwo' ) . '" width="984" height="1426"/></figure>
					<!-- /wp:image --></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":""} -->
					<div class="wp-block-column"><!-- wp:image {"width":100,"height":47,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/icon-binoculars.png" alt="' . esc_attr__( 'An icon representing binoculars.', 'twentytwentytwo' ) . '" width="100" height="47"/></figure>
					<!-- /wp:image -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:heading {"level":3,"fontSize":"large"} -->
					<h3 class="has-large-font-size"><em>' . esc_html__( 'Date', 'twentytwentytwo' ) . '</em></h3>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . esc_html__( 'February, 12 2021', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:heading {"level":3,"fontSize":"large"} -->
					<h3 class="has-large-font-size"><em>' . esc_html__( 'Location', 'twentytwentytwo' ) . '</em></h3>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'The Grand Theater<br>154 Eastern Avenue<br>Maryland NY, 12345', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/header-text-only-with-tagline-black-background.php000060400000003335151330667700020077 0ustar00<?php
/**
 * Text-only header with tagline and black background block pattern
 */
return array(
	'title'      => __( 'Text-only header with tagline and background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|secondary"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"foreground","textColor":"secondary","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-secondary-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:group {"layout":{"type":"flex","justifyContent":"left"}} -->
					<div class="wp-block-group"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"700"}}} /-->

					<!-- wp:site-tagline {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div>
					<!-- /wp:group -->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/header-title-navigation-social.php000060400000003031151330667700015072 0ustar00<?php
/**
 * Title, navigation, and social links header block pattern
 */
return array(
	'title'      => __( 'Title, navigation, and social links header', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /-->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->

					<!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","className":"is-style-logos-only"} -->
					<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"instagram"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /--></ul>
					<!-- /wp:social-links -->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/general-list-events.php000060400000017625151330667700013024 0ustar00<?php
/**
 * List of events block pattern
 */
return array(
	'title'      => __( 'List of events', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'text' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"primary","textColor":"background"} -->
					<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:heading {"align":"wide","style":{"typography":{"fontSize":"clamp(3.25rem, 8vw, 6.25rem)","lineHeight":"1.15"},"spacing":{"margin":{"bottom":"2rem"}}}} -->
					<h2 class="alignwide" style="font-size:clamp(3.25rem, 8vw, 6.25rem);line-height:1.15;margin-bottom:2rem"><em>' . esc_html__( 'Speaker Series', 'twentytwentytwo' ) . '</em></h2>
					<!-- /wp:heading -->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} -->
					<hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:columns {"verticalAlignment":"center","align":"wide"} -->
					<div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"210px"} -->
					<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:210px"><!-- wp:paragraph -->
					<p>' . esc_html__( 'May 14th, 2022, 6 PM', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading {"fontSize":"x-large"} -->
					<h2 class="has-x-large-font-size" id="jesus-rodriguez">' . esc_html__( 'Jesús Rodriguez', 'twentytwentytwo' ) . '</h2>
					<!-- /wp:heading --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'The Vintagé Theater<br>245 Arden Rd.<br>Gardenville, NH', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} -->
					<hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:columns {"verticalAlignment":"center","align":"wide"} -->
					<div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"210px"} -->
					<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:210px"><!-- wp:paragraph -->
					<p>' . esc_html__( 'May 16th, 2022, 6 PM', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading {"fontSize":"x-large"} -->
					<h2 class="has-x-large-font-size" id="jesus-rodriguez">' . esc_html__( 'Doug Stilton', 'twentytwentytwo' ) . '</h2>
					<!-- /wp:heading --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'The Swell Theater<br>120 River Rd.<br>Rainfall, NH', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} -->
					<hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:columns {"verticalAlignment":"center","align":"wide"} -->
					<div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"210px"} -->
					<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:210px"><!-- wp:paragraph -->
					<p>' . esc_html__( 'May 18th, 2022, 7 PM', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading {"fontSize":"x-large"} -->
					<h2 class="has-x-large-font-size" id="jesus-rodriguez">' . esc_html__( 'Amy Jensen', 'twentytwentytwo' ) . '</h2>
					<!-- /wp:heading --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'The Vintagé Theater<br>245 Arden Rd.<br>Gardenville, NH', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} -->
					<hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:columns {"verticalAlignment":"center","align":"wide"} -->
					<div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center","width":"210px"} -->
					<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:210px"><!-- wp:paragraph -->
					<p>' . esc_html__( 'May 20th, 2022, 6 PM', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:heading {"fontSize":"x-large"} -->
					<h2 class="has-x-large-font-size" id="jesus-rodriguez">' . esc_html__( 'Emery Driscoll', 'twentytwentytwo' ) . '</h2>
					<!-- /wp:heading --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'The Swell Theater<br>120 River Rd.<br>Rainfall, NH', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:separator {"color":"background","align":"wide","className":"is-style-wide"} -->
					<hr class="wp-block-separator alignwide has-text-color has-background has-background-background-color has-background-color is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:group {"align":"wide"} -->
					<div class="wp-block-group alignwide"><!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--background)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"right"}} -->
					<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"wordpress"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /--></ul>
					<!-- /wp:social-links --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/page-about-media-left.php000060400000005735151330667700013164 0ustar00<?php
/**
 * About page with media on the left
 */
return array(
	'title'      => __( 'About page with media on the left', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:media-text {"align":"full","mediaType":"image","imageFill":true,"focalPoint":{"x":"0.63","y":"0.16"},"backgroundColor":"foreground","className":"alignfull is-image-fill has-background-color has-text-color has-background has-link-color"} -->
					<div class="wp-block-media-text alignfull is-stacked-on-mobile is-image-fill has-background-color has-text-color has-background has-link-color has-foreground-background-color has-background"><figure class="wp-block-media-text__media" style="background-image:url(' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-salmon.jpg);background-position:63% 16%"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-salmon.jpg" alt="' . esc_attr__( 'Image of a bird on a branch', 'twentytwentytwo' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:site-logo {"width":60} /-->

					<!-- wp:group {"style":{"spacing":{"padding":{"right":"min(8rem, 5vw)","top":"min(28rem, 28vw)"}}}} -->
					<div class="wp-block-group" style="padding-top:min(28rem, 28vw);padding-right:min(8rem, 5vw)"><!-- wp:heading {"style":{"typography":{"fontWeight":"300","lineHeight":"1.115","fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} -->
					<h2 style="font-size:clamp(3rem, 6vw, 4.5rem);font-weight:300;line-height:1.115"><em>' . esc_html__( 'Doug', 'twentytwentytwo' ) . '<br>' . esc_html__( 'Stilton', 'twentytwentytwo' ) . '</em></h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.6"}}} -->
					<p style="line-height:1.6">' . esc_html__( 'Oh hello. My name’s Doug, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show on Tuesday evenings at 11PM EDT.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":40} -->
					<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--background)","iconBackgroundColor":"foreground","iconBackgroundColorValue":"var(--wp--preset--color--foreground)"} -->
					<ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"#","service":"wordpress"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
					<!-- /wp:social-links --></div>
					<!-- /wp:group -->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div></div>
					<!-- /wp:media-text -->',
);
patterns/query-irregular-grid.php000060400000020546151330667700013212 0ustar00<?php
/**
 * Irregular grid of posts block pattern
 */
return array(
	'title'      => __( 'Irregular grid of posts', 'twentytwentytwo' ),
	'categories' => array( 'query' ),
	'blockTypes' => array( 'core/query' ),
	'content'    => '<!-- wp:group {"align":"wide"} -->
					<div class="wp-block-group alignwide"><!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:query {"query":{"offset":"1","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:spacer {"height":64} -->
					<div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:query {"query":{"offset":"2","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:spacer {"height":128} -->
					<div style="height:128px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:query {"query":{"offset":"3","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:query {"query":{"offset":"4","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:spacer {"height":96} -->
					<div style="height:96px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:query {"query":{"offset":"5","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:spacer {"height":160} -->
					<div style="height:160px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:query {"query":{"offset":"6","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:query {"query":{"offset":"7","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:spacer {"height":160} -->
					<div style="height:160px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:query {"query":{"offset":"8","postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":"1"},"displayLayout":{"type":"list","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:spacer {"height":96} -->
					<div style="height:96px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:post-featured-image {"isLink":true,"width":"100%","height":"318px"} /-->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/general-divider-dark.php000060400000001614151330667700013103 0ustar00<?php
/**
 * Divider with image and color (dark) block pattern
 */
return array(
	'title'      => __( 'Divider with image and color (dark)', 'twentytwentytwo' ),
	'categories' => array( 'featured' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"1rem","right":"0px","bottom":"1rem","left":"0px"}}},"backgroundColor":"primary"} -->
					<div class="wp-block-group alignfull has-primary-background-color has-background" style="padding-top:1rem;padding-right:0px;padding-bottom:1rem;padding-left:0px"><!-- wp:image {"id":473,"width":3001,"height":246,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/divider-white.png" alt="" class="wp-image-473" width="3001" height="246"/></figure>
					<!-- /wp:image --></div>
					<!-- /wp:group -->',
);
patterns/page-about-simple-dark.php000060400000006417151330667700013363 0ustar00<?php
/**
 * Simple dark about page
 */
return array(
	'title'      => __( 'Simple dark about page', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:cover {"overlayColor":"foreground","minHeight":100,"minHeightUnit":"vh","contentPosition":"center center","align":"full","style":{"spacing":{"padding":{"top":"max(1.25rem, 8vw)","right":"max(1.25rem, 8vw)","bottom":"max(1.25rem, 8vw)","left":"max(1.25rem, 8vw)"}}}} -->
					<div class="wp-block-cover alignfull has-foreground-background-color has-background-dim" style="padding-top:max(1.25rem, 8vw);padding-right:max(1.25rem, 8vw);padding-bottom:max(1.25rem, 8vw);padding-left:max(1.25rem, 8vw);min-height:100vh"><div class="wp-block-cover__inner-container"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"},"overlayMenu":"always"} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation -->

					<!-- wp:columns -->
					<div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"bottom","width":"45%","style":{"spacing":{"padding":{"top":"12rem"}}}} -->
					<div class="wp-block-column is-vertically-aligned-bottom" style="padding-top:12rem;flex-basis:45%"><!-- wp:site-logo {"width":60} /-->

					<!-- wp:heading {"style":{"typography":{"fontWeight":"300","lineHeight":"1.115","fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} -->
					<h2 style="font-size:clamp(3rem, 6vw, 4.5rem);font-weight:300;line-height:1.115"><em>' . wp_kses_post( __( 'Jesús<br>Rodriguez', 'twentytwentytwo' ) ) . '</em></h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.6"}}} -->
					<p style="line-height:1.6">' . esc_html__( 'Oh hello. My name’s Jesús, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show on Tuesday evenings at 11PM EDT.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":40} -->
					<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:social-links {"iconColor":"background","iconColorValue":"var(--wp--preset--color--foreground)","iconBackgroundColor":"foreground","iconBackgroundColorValue":"var(--wp--preset--color--background)"} -->
					<ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"#","service":"wordpress"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
					<!-- /wp:social-links --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center","style":{"spacing":{"padding":{"top":"0rem","right":"0rem","bottom":"4rem","left":"0rem"}}}} -->
					<div class="wp-block-column is-vertically-aligned-center" style="padding-top:0rem;padding-right:0rem;padding-bottom:4rem;padding-left:0rem"><!-- wp:separator {"color":"background","className":"is-style-wide"} -->
					<hr class="wp-block-separator has-text-color has-background has-background-background-color has-background-color is-style-wide"/>
					<!-- /wp:separator --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div></div>
					<!-- /wp:cover -->',
);
patterns/footer-blog.php000060400000005306151330667700011344 0ustar00<?php
/**
 * Blog footer
 */
return array(
	'title'      => __( 'Blog footer', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} -->
					<p style="text-transform:uppercase">' . esc_html__( 'About us', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:paragraph -->
					<p>' . esc_html__( 'We are a rogue collective of bird watchers. We’ve been known to sneak through fences, climb perimeter walls, and generally trespass in order to observe the rarest of birds.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} -->
					<p style="text-transform:uppercase">' . esc_html__( 'Latest posts', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:latest-posts /--></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} -->
					<p style="text-transform:uppercase">' . esc_html__( 'Categories', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:categories /--></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:spacer {"height":50} -->
					<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-title {"level":0} /-->

					<!-- wp:paragraph {"align":"right"} -->
					<p class="has-text-align-right">' .
					sprintf(
						/* Translators: WordPress link. */
						esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ),
						'<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>'
					) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/general-video-header-details.php000060400000005272151330667700014521 0ustar00<?php
/**
 * Video with header and details block pattern
 */
return array(
	'title'      => __( 'Video with header and details', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'columns' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}},"elements":{"link":{"color":{"text":"var:preset|color|secondary"}}}},"backgroundColor":"foreground","textColor":"secondary"} -->
					<div class="wp-block-group alignfull has-secondary-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:heading {"level":1,"align":"wide","style":{"typography":{"fontSize":"clamp(3rem, 6vw, 4.5rem)"}}} -->
					<h1 class="alignwide" id="warble-a-film-about-hobbyist-bird-watchers-1" style="font-size:clamp(3rem, 6vw, 4.5rem)">' . wp_kses_post( __( '<em>Warble</em>, a film about <br>hobbyist bird watchers.', 'twentytwentytwo' ) ) . '</h1>
					<!-- /wp:heading -->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:video {"align":"wide"} -->
					<figure class="wp-block-video alignwide"><video controls src="' . esc_url( get_template_directory_uri() ) . '/assets/videos/birds.mp4"></video></figure>
					<!-- /wp:video -->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"width":"50%"} -->
					<div class="wp-block-column" style="flex-basis:50%"><!-- wp:paragraph -->
					<p><strong>' . esc_html__( 'Featuring', 'twentytwentytwo' ) . '</strong></p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'Jesús Rodriguez<br>Doug Stilton<br>Emery Driscoll<br>Megan Perry<br>Rowan Price', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'Angelo Tso<br>Edward Stilton<br>Amy Jensen<br>Boston Bell<br>Shay Ford', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/page-layout-two-columns.php000060400000007667151330667700013655 0ustar00<?php
/**
 * Page layout with two columns.
 */
return array(
	'title'      => __( 'Page layout with two columns', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:var(--wp--custom--spacing--large, 8rem);"><!-- wp:heading {"level":1,"align":"wide","style":{"typography":{"fontSize":"clamp(4rem, 15vw, 12.5rem)","lineHeight":"1","fontWeight":"200"}}} -->
					<h1 class="alignwide" style="font-size:clamp(4rem, 15vw, 12.5rem);font-weight:200;line-height:1">' . wp_kses_post( __( '<em>Goldfinch </em><br><em>&amp; Sparrow</em>', 'twentytwentytwo' ) ) . '</h1>
					<!-- /wp:heading -->

					<!-- wp:spacer {"height":50} -->
					<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:group {"align":"wide","layout":{"inherit":false}} -->
					<div class="wp-block-group alignwide"><!-- wp:columns -->
					<div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"center","width":"20%"} -->
					<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:20%"><!-- wp:paragraph -->
					<p>' . esc_html__( 'WELCOME', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center","width":"80%"} -->
					<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:80%"><!-- wp:separator {"className":"is-style-wide"} -->
					<hr class="wp-block-separator is-style-wide"/>
					<!-- /wp:separator --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'Oh hello. My name’s Angelo, and I operate this blog. I was born in Portland, but I currently live in upstate New York. You may recognize me from publications with names like <a href="#">Eagle Beagle</a> and <a href="#">Mourning Dive</a>. I write for a living.<br><br>I usually use this blog to catalog extensive lists of birds and other things that I find interesting. If you find an error with one of my lists, please keep it to yourself.<br><br>If that’s not your cup of tea, <a href="#">I definitely recommend this tea</a>. It’s my favorite.', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:spacer -->
					<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:separator {"className":"is-style-wide"} -->
					<hr class="wp-block-separator is-style-wide"/>
					<!-- /wp:separator --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:paragraph -->
					<p>' . esc_html__( 'POSTS', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column -->
					<div class="wp-block-column"></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:latest-posts /--></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/footer-navigation-copyright.php000060400000002327151330667700014566 0ustar00<?php
/**
 * Footer with navigation and copyright
 */
return array(
	'title'      => __( 'Footer with navigation and copyright', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}}} -->
					<div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"center"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation -->

					<!-- wp:spacer {"height":50} -->
					<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:paragraph {"align":"center","style":{"typography":{"fontSize":"16px"}}} -->
					<p class="has-text-align-center" style="font-size:16px">' . esc_html__( '© Site Title', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/query-default.php000060400000004425151330667700011715 0ustar00<?php
/**
 * Default posts block pattern
 */
return array(
	'title'      => __( 'Default posts', 'twentytwentytwo' ),
	'categories' => array( 'query' ),
	'blockTypes' => array( 'core/query' ),
	'content'    => '<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":""},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->
					<!-- wp:group {"layout":{"inherit":true}} -->
					<div class="wp-block-group"><!-- wp:post-title {"isLink":true,"align":"wide","fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"} /-->

					<!-- wp:post-featured-image {"isLink":true,"align":"wide","style":{"spacing":{"margin":{"top":"calc(1.75 * var(--wp--style--block-gap))"}}}} /-->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"width":"650px"} -->
					<div class="wp-block-column" style="flex-basis:650px"><!-- wp:post-excerpt /-->

					<!-- wp:post-date {"isLink":true,"format":"F j, Y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":""} -->
					<div class="wp-block-column"></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:separator {"align":"wide","className":"is-style-wide"} -->
					<hr class="wp-block-separator alignwide is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div>
					<!-- /wp:group -->
					<!-- /wp:post-template -->

					<!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<!-- wp:query-pagination-previous {"fontSize":"small"} /-->

					<!-- wp:query-pagination-numbers /-->

					<!-- wp:query-pagination-next {"fontSize":"small"} /-->
					<!-- /wp:query-pagination --></div>
					<!-- /wp:query -->',
);
patterns/page-about-solid-color.php000060400000005340151330667700013373 0ustar00<?php
/**
 * About page on solid color background
 */
return array(
	'title'      => __( 'About page on solid color background', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"1.25rem","right":"1.25rem","bottom":"1.25rem","left":"1.25rem"}}}} -->
					<div class="wp-block-group alignfull" style="padding-top:1.25rem;padding-right:1.25rem;padding-bottom:1.25rem;padding-left:1.25rem"><!-- wp:cover {"overlayColor":"secondary","minHeight":80,"minHeightUnit":"vh","isDark":false,"align":"full"} -->
					<div class="wp-block-cover alignfull is-light" style="min-height:80vh"><span aria-hidden="true" class="has-secondary-background-color has-background-dim-100 wp-block-cover__gradient-background has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:group {"layout":{"inherit":false,"contentSize":"400px"}} -->
					<div class="wp-block-group"><!-- wp:spacer {"height":64} -->
					<div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --><!-- wp:heading {"style":{"typography":{"lineHeight":"1","textTransform":"uppercase","fontSize":"clamp(2.75rem, 6vw, 3.25rem)"}}} -->
					<h2 id="edvard-smith" style="font-size:clamp(2.75rem, 6vw, 3.25rem);line-height:1;text-transform:uppercase">' . wp_kses_post( __( 'Edvard<br>Smith', 'twentytwentytwo' ) ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:spacer {"height":8} -->
					<div style="height:8px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:paragraph {"fontSize":"small"} -->
					<p class="has-small-font-size">' . esc_html__( 'Oh hello. My name’s Edvard, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show every Tuesday evening at 11PM EDT. Listen in sometime!', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":8} -->
					<div style="height:8px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","className":"is-style-logos-only"} -->
					<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"wordpress"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
					<!-- /wp:social-links --><!-- wp:spacer {"height":64} -->
					<div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div>
					<!-- /wp:group --></div></div>
					<!-- /wp:cover --></div>
					<!-- /wp:group -->',
);
patterns/footer-dark.php000060400000002645151330667700011345 0ustar00<?php
/**
 * Dark footer with title and citation
 */
return array(
	'title'      => __( 'Dark footer with title and citation', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide"><!-- wp:site-title {"level":0} /-->

					<!-- wp:paragraph {"align":"right"} -->
					<p class="has-text-align-right">' .
					sprintf(
						/* Translators: WordPress link. */
						esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ),
						'<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>'
					) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/page-about-large-image-and-buttons.php000060400000010461151330667700015553 0ustar00<?php
/**
 * About page with large image and buttons
 */
return array(
	'title'      => __( 'About page with large image and buttons', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages', 'buttons' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:image {"align":"wide","width":2100,"height":1260,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image alignwide size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-gray-b.jpg" alt="" width="2100" height="1260"/></figure>
					<!-- /wp:image -->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"width":100} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Purchase my work', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"width":100} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Support my studio', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"width":100} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Take a class', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"width":100} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Read about me', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"width":100} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Learn about my process', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"width":100} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link">' . esc_html__( 'Join my mailing list', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:spacer {"height":50} -->
					<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:social-links {"iconColor":"primary","iconColorValue":"var(--wp--preset--color--primary)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"center"}} -->
					<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"wordpress"} /-->

					<!-- wp:social-link {"url":"#","service":"facebook"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
					<!-- /wp:social-links --></div>
					<!-- /wp:group -->',
);
patterns/general-image-with-caption.php000060400000003106151330667700014222 0ustar00<?php
/**
 * Image with caption block pattern
 */
return array(
	'title'      => __( 'Image with caption', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'columns', 'gallery' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"6rem","bottom":"6rem"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:6rem;padding-bottom:6rem"><!-- wp:media-text {"mediaId":202,"mediaLink":"' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-gray.jpg","mediaType":"image","verticalAlignment":"bottom","imageFill":false} -->
					<div class="wp-block-media-text alignwide is-stacked-on-mobile is-vertically-aligned-bottom"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/bird-on-gray.jpg" alt="' . esc_attr__( 'Hummingbird illustration', 'twentytwentytwo' ) . '" class="wp-image-202 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->
					<p><strong>' . esc_html__( 'Hummingbird', 'twentytwentytwo' ) . '</strong></p>
					<!-- /wp:paragraph -->

					<!-- wp:paragraph -->
					<p>' . esc_html__( 'A beautiful bird featuring a surprising set of color feathers.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div></div>
					<!-- /wp:media-text --></div>
					<!-- /wp:group -->',
);
patterns/footer-about-title-logo.php000060400000003433151330667700013607 0ustar00<?php
/**
 * Footer with text, title, and logo
 */
return array(
	'title'      => __( 'Footer with text, title, and logo', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"6rem"}}},"backgroundColor":"secondary","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-secondary-background-color has-background" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:6rem"><!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"width":"33%"} -->
					<div class="wp-block-column" style="flex-basis:33%"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} -->
					<p style="text-transform:uppercase">' . esc_html__( 'About us', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:paragraph {"style":{"fontSize":"small"} -->
					<p class="has-small-font-size">' . esc_html__( 'We are a rogue collective of bird watchers. We’ve been known to sneak through fences, climb perimeter walls, and generally trespass in order to observe the rarest of birds.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":180} -->
					<div style="height:180px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:site-title {"level":0} /--></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"bottom"} -->
					<div class="wp-block-column is-vertically-aligned-bottom"><!-- wp:site-logo {"align":"right","width":60} /--></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/header-image-background.php000060400000004562151330667700013555 0ustar00<?php
/**
 * Header with image background block pattern
 */
return array(
	'title'      => __( 'Header with image background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:cover {"url":"' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-gray-c.jpg","dimRatio":0,"focalPoint":{"x":"0.58","y":"0.58"},"minHeight":400,"contentPosition":"center center","align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}},"color":{}}} -->
					<div class="wp-block-cover alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem);min-height:400px"><span aria-hidden="true" class="has-background-dim-0 wp-block-cover__gradient-background has-background-dim"></span><img class="wp-block-cover__image-background" alt="' . esc_attr__( 'Illustration of a flying bird', 'twentytwentytwo' ) . '" src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-gray-c.jpg" style="object-position:58% 58%" data-object-fit="cover" data-object-position="58% 58%"/><div class="wp-block-cover__inner-container"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}},"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}}},"textColor":"foreground","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide has-foreground-color has-text-color has-link-color" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"700"}}} /-->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group -->

					<!-- wp:spacer {"height":500} -->
					<div style="height:500px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div></div>
					<!-- /wp:cover --></div>
					<!-- /wp:group -->',
);
patterns/footer-logo.php000060400000002035151330667700011355 0ustar00<?php
/**
 * Default footer with logo
 */
return array(
	'title'      => __( 'Footer with logo and citation', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-logo {"width":60} /-->

					<!-- wp:paragraph {"align":"right"} -->
					<p class="has-text-align-right">' .
					sprintf(
						/* Translators: WordPress link. */
						esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ),
						'<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>'
					) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/hidden-heading-and-bird.php000060400000002620151330667700013427 0ustar00<?php
/**
 * Heading and bird image
 *
 * This pattern is used only for translation
 * and to reference a dynamic image URL. It does
 * not appear in the inserter.
 */
return array(
	'title'    => __( 'Heading and bird image', 'twentytwentytwo' ),
	'inserter' => false,
	'content'  => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:0px;padding-bottom:0px;"><!-- wp:heading {"align":"wide","style":{"typography":{"fontSize":"var(--wp--custom--typography--font-size--colossal, clamp(3.25rem, 8vw, 6.25rem))","lineHeight":"1.15"}}} -->
					<h2 class="alignwide" style="font-size:var(--wp--custom--typography--font-size--colossal, clamp(3.25rem, 8vw, 6.25rem));line-height:1.15">' . wp_kses_post( __( '<em>The Hatchery</em>: a blog about my adventures in bird watching', 'twentytwentytwo' ) ) . '</h2>
					<!-- /wp:heading --></div>
					<!-- /wp:group -->

					<!-- wp:image {"align":"full","width":2400,"height":1020,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image alignfull size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-c.png" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2400" height="1020"/></figure>
					<!-- /wp:image -->',
);
patterns/footer-social-copyright.php000060400000003034151330667700013675 0ustar00<?php
/**
 * Footer with social links and copyright
 */
return array(
	'title'      => __( 'Footer with social links and copyright', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}}} -->
					<div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","iconBackgroundColor":"background","iconBackgroundColorValue":"var(--wp--preset--color--background)","layout":{"type":"flex","justifyContent":"center"}} -->
					<ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"#","service":"facebook"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
					<!-- /wp:social-links -->

					<!-- wp:spacer {"height":50} -->
					<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:paragraph {"align":"center","style":{"typography":{"fontSize":"16px"}}} -->
					<p class="has-text-align-center" style="font-size:16px">' . esc_html__( '© Site Title', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/header-centered-logo-black-background.php000060400000002463151330667700016272 0ustar00<?php
/**
 * Header with centered logo and black background
 */
return array(
	'title'      => __( 'Header with centered logo and background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--small, 1.25rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background","layout":{"type":"flex","justifyContent":"center"}} -->
					<div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:navigation-link {"isTopLevelLink":true} /-->

					<!-- wp:navigation-link {"isTopLevelLink":true} /-->

					<!-- wp:site-logo {"width":90} /-->

					<!-- wp:navigation-link {"isTopLevelLink":true} /-->

					<!-- wp:navigation-link {"isTopLevelLink":true} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group -->',
);
patterns/header-text-only-salmon-background.php000060400000002645151330667700015725 0ustar00<?php
/**
 * Text-only header with salmon background block pattern
 */
return array(
	'title'      => __( 'Text-only header with background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"secondary","textColor":"foreground","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-foreground-color has-secondary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /-->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/header-logo-navigation-gray-background.php000060400000002630151330667700016522 0ustar00<?php
/**
 * Logo and navigation header with gray background
 */
return array(
	'title'      => __( 'Logo and navigation header with background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"tertiary","textColor":"foreground","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-foreground-color has-tertiary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:site-logo {"width":64} /-->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/header-logo-navigation-offset-tagline.php000060400000003333151330667700016353 0ustar00<?php
/**
 * Logo, navigation, and offset tagline Header block pattern
 */
return array(
	'title'      => __( 'Logo, navigation, and offset tagline Header', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)"}}}} -->
					<div class="wp-block-group alignwide" style="padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:site-logo {"width":64} /-->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group -->

					<!-- wp:columns {"isStackedOnMobile":false,"align":"wide"} -->
					<div class="wp-block-columns alignwide is-not-stacked-on-mobile"><!-- wp:column {"width":"64px"} -->
					<div class="wp-block-column" style="flex-basis:64px"></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":"380px"} -->
					<div class="wp-block-column" style="flex-basis:380px"><!-- wp:site-tagline {"fontSize":"small"} /--></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/page-layout-image-and-text.php000060400000005366151330667700014164 0ustar00<?php
/**
 * Page layout with image and text.
 */
return array(
	'title'      => __( 'Page layout with image and text', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"2rem"}}},"layout":{"inherit":true}} -->
				<div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:2rem"><!-- wp:heading {"align":"wide","style":{"typography":{"fontSize":"clamp(4rem, 8vw, 7.5rem)","lineHeight":"1.15","fontWeight":"300"}}} -->
					<h2 class="alignwide" style="font-size:clamp(4rem, 8vw, 7.5rem);font-weight:300;line-height:1.15">' . wp_kses_post( __( '<em>Watching Birds </em><br><em>in the Garden</em>', 'twentytwentytwo' ) ) . '</h2>
					<!-- /wp:heading --></div>
					<!-- /wp:group -->

					<!-- wp:image {"align":"full","width":2400,"height":1800,"style":{"color":{}}} -->
					<figure class="wp-block-image alignfull is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-b.png" alt="' . esc_attr_x( 'TBD', 'Short for to be determined', 'twentytwentytwo' ) . '" width="2400" height="1800"/></figure>
					<!-- /wp:image -->

					<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"2rem","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:2rem;padding-bottom:var(--wp--custom--spacing--large, 8rem)">
					<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column {"verticalAlignment":"bottom","style":{"spacing":{"padding":{"bottom":"1em"}}}} -->
					<div class="wp-block-column is-vertically-aligned-bottom" style="padding-bottom:1em"><!-- wp:site-logo {"width":60} /--></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"bottom"} -->
					<div class="wp-block-column is-vertically-aligned-bottom"><!-- wp:paragraph -->
					<p>' . wp_kses_post( __( 'Oh hello. My name’s Angelo, and I operate this blog. I was born in Portland, but I currently live in upstate New York. You may recognize me from publications with names like <a href="#">Eagle Beagle</a> and <a href="#">Mourning Dive</a>. I write for a living.<br><br>I usually use this blog to catalog extensive lists of birds and other things that I find interesting. If you find an error with one of my lists, please keep it to yourself.<br><br>If that’s not your cup of tea, <a href="#">I definitely recommend this tea</a>. It’s my favorite.', 'twentytwentytwo' ) ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/footer-query-title-citation.php000060400000004200151330667700014505 0ustar00<?php
/**
 * Footer with query, title, and citation
 */
return array(
	'title'      => __( 'Footer with query, title, and citation', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"exclude","inherit":false},"displayLayout":{"type":"flex","columns":3},"align":"wide"} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template -->
					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"isLink":true} /-->
					<!-- /wp:post-template --></div>
					<!-- /wp:query -->

					<!-- wp:spacer -->
					<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:site-title {"level":0} /-->
					<!-- wp:group {"layout":{"type":"flex","justifyContent":"right"}} -->
					<div class="wp-block-group">
					<!-- wp:paragraph -->
					<p>' .
					sprintf(
						/* Translators: WordPress link. */
						esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ),
						'<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>'
					) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/header-centered-logo.php000060400000003505151330667700013101 0ustar00<?php
/**
 * Header with centered logo block pattern
 */
return array(
	'title'      => __( 'Header with centered logo', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"primary","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem);"><!-- wp:columns {"verticalAlignment":"center","align":"wide"} -->
					<div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"400","textTransform":"uppercase"}}} /--></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":"64px"} -->
					<div class="wp-block-column" style="flex-basis:64px"><!-- wp:site-logo {"width":64} /--></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/hidden-bird.php000060400000001242151330667700011271 0ustar00<?php
/**
 * Bird image
 *
 * This pattern is used only to reference a dynamic image URL.
 * It does not appear in the inserter.
 */
return array(
	'title'    => __( 'Heading and bird image', 'twentytwentytwo' ),
	'inserter' => false,
	'content'  => '<!-- wp:image {"align":"wide","width":2000,"height":474,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image alignwide size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-d.png" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2000" height="474"/></figure>
					<!-- /wp:image -->',
);
patterns/footer-title-tagline-social.php000060400000003427151330667700014435 0ustar00<?php
/**
 * Footer with title, tagline, and social links on a dark background
 */
return array(
	'title'      => __( 'Footer with title, tagline, and social links on a dark background', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:group -->
					<div class="wp-block-group"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"textTransform":"uppercase"}}} /-->

					<!-- wp:site-tagline {"style":{"spacing":{"margin":{"top":"0.25em","bottom":"0px"}},"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div>
					<!-- /wp:group -->

					<!-- wp:social-links {"iconBackgroundColor":"foreground","iconBackgroundColorValue":"var(--wp--preset--color--foreground)","layout":{"type":"flex","justifyContent":"right"}} -->
					<ul class="wp-block-social-links has-icon-background-color"><!-- wp:social-link {"url":"#","service":"facebook"} /-->

					<!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
					<!-- /wp:social-links --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/page-sidebar-blog-posts.php000060400000010704151330667700013535 0ustar00<?php
/**
 * Blog posts with left sidebar block pattern
 */
return array(
	'title'      => __( 'Blog posts with left sidebar', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:columns {"align":"wide","style":{"spacing":{"margin":{"top":"0px","bottom":"0px"},"blockGap":"5%"},"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"textColor":"primary"} -->
					<div class="wp-block-columns alignwide has-primary-color has-text-color has-link-color" style="margin-top:0px;margin-bottom:0px"><!-- wp:column {"width":"33.33%"} -->
					<div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:cover {"overlayColor":"secondary","minHeight":400,"isDark":false} -->
					<div class="wp-block-cover is-light" style="min-height:400px"><span aria-hidden="true" class="has-secondary-background-color has-background-dim-100 wp-block-cover__gradient-background has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:site-logo {"align":"center","width":60} /--></div></div>
					<!-- /wp:cover -->

					<!-- wp:spacer {"height":40} -->
					<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:site-tagline {"fontSize":"small"} /-->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:separator {"color":"foreground","className":"is-style-wide"} -->
					<hr class="wp-block-separator has-text-color has-background has-foreground-background-color has-foreground-color is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:navigation {"orientation":"vertical"} -->
					<!-- wp:page-list /-->
					<!-- /wp:navigation -->

					<!-- wp:spacer {"height":32} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:separator {"color":"foreground","className":"is-style-wide"} -->
					<hr class="wp-block-separator has-text-color has-background has-foreground-background-color has-foreground-color is-style-wide"/>
					<!-- /wp:separator --></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":"66.66%"} -->
					<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:query {"query":{"perPage":"5","pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"layout":{"inherit":true}} -->
					<div class="wp-block-query"><!-- wp:post-template -->
					<!-- wp:post-title {"isLink":true,"style":{"spacing":{"margin":{"top":"0","bottom":"1rem"}},"typography":{"fontStyle":"normal","fontWeight":"300"},"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"textColor":"primary","fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"} /-->

					<!-- wp:post-featured-image {"isLink":true} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:group {"layout":{"type":"flex"}} -->
					<div class="wp-block-group"><!-- wp:post-date {"format":"F j, Y","style":{"typography":{"fontStyle":"normal","fontWeight":"400"}},"fontSize":"small"} /-->

					<!-- wp:post-terms {"term":"category","fontSize":"small"} /-->

					<!-- wp:post-terms {"term":"post_tag","fontSize":"small"} /--></div>
					<!-- /wp:group -->

					<!-- wp:spacer {"height":128} -->
					<div style="height:128px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->
					<!-- /wp:post-template -->

					<!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<!-- wp:query-pagination-previous {"fontSize":"small"} /-->

					<!-- wp:query-pagination-numbers /-->

					<!-- wp:query-pagination-next {"fontSize":"small"} /-->
					<!-- /wp:query-pagination --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/general-pricing-table.php000060400000011754151330667700013264 0ustar00<?php
/**
 * Pricing table block pattern
 */
return array(
	'title'      => __( 'Pricing table', 'twentytwentytwo' ),
	'categories' => array( 'featured', 'columns', 'buttons' ),
	'content'    => '<!-- wp:columns {"align":"wide"} -->
					<div class="wp-block-columns alignwide"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:separator {"className":"is-style-wide"} -->
					<hr class="wp-block-separator is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:heading {"style":{"typography":{"fontSize":"var(--wp--custom--typography--font-size--gigantic, clamp(2.75rem, 6vw, 3.25rem))","lineHeight":"0.5"}}} -->
					<h2 id="1" style="font-size:var(--wp--custom--typography--font-size--gigantic, clamp(2.75rem, 6vw, 3.25rem));line-height:0.5">' . esc_html( _x( '1', 'First item in a numbered list.', 'twentytwentytwo' ) ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:heading {"level":3,"fontSize":"x-large"} -->
					<h3 class="has-x-large-font-size" id="pigeon"><em>' . esc_html__( 'Pigeon', 'twentytwentytwo' ) . '</em></h3>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . esc_html__( 'Help support our growing community by joining at the Pigeon level. Your support will help pay our writers, and you’ll get access to our exclusive newsletter.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"foreground","width":100} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link has-foreground-background-color has-background">' . esc_html__( '$25', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:separator {"className":"is-style-wide"} -->
					<hr class="wp-block-separator is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:heading {"style":{"typography":{"fontSize":"clamp(2.75rem, 6vw, 3.25rem)","lineHeight":"0.5"}}} -->
					<h2 id="2" style="font-size:clamp(2.75rem, 6vw, 3.25rem);line-height:0.5">' . esc_html( _x( '2', 'Second item in a numbered list.', 'twentytwentytwo' ) ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:heading {"level":3,"fontSize":"x-large"} -->
					<h3 class="has-x-large-font-size" id="sparrow"><meta charset="utf-8"><em>' . esc_html__( 'Sparrow', 'twentytwentytwo' ) . '</em></h3>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . esc_html__( 'Join at the Sparrow level and become a member of our flock! You’ll receive our newsletter, plus a bird pin that you can wear with pride when you’re out in nature.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"foreground","width":100} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link has-foreground-background-color has-background">' . esc_html__( '$75', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:separator {"className":"is-style-wide"} -->
					<hr class="wp-block-separator is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:heading {"style":{"typography":{"fontSize":"clamp(2.75rem, 6vw, 3.25rem)","lineHeight":"0.5"}}} -->
					<h2 id="3" style="font-size:clamp(2.75rem, 6vw, 3.25rem);line-height:0.5">' . esc_html( _x( '3', 'Third item in a numbered list.', 'twentytwentytwo' ) ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:heading {"level":3,"fontSize":"x-large"} -->
					<h3 class="has-x-large-font-size" id="falcon"><meta charset="utf-8"><em>' . esc_html__( 'Falcon', 'twentytwentytwo' ) . '</em></h3>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . esc_html__( 'Play a leading role for our community by joining at the Falcon level. This level earns you a seat on our board, where you can help plan future birdwatching expeditions.', 'twentytwentytwo' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"foreground","width":100} -->
					<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link has-foreground-background-color has-background">' . esc_html__( '$150', 'twentytwentytwo' ) . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons -->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->',
);
patterns/page-sidebar-blog-posts-right.php000060400000012123151330667700014645 0ustar00<?php
/**
 * Blog posts with right sidebar block pattern
 */
return array(
	'title'      => __( 'Blog posts with right sidebar', 'twentytwentytwo' ),
	'categories' => array( 'twentytwentytwo_pages' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"2rem","top":"0px","right":"0px","left":"0px"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:0px;padding-right:0px;padding-bottom:2rem;padding-left:0px"><!-- wp:group {"layout":{"type":"flex"}} -->
					<div class="wp-block-group"><!-- wp:site-logo {"width":64} /--></div>
					<!-- /wp:group -->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group -->

					<!-- wp:spacer {"height":64} -->
					<div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:columns {"align":"wide","style":{"spacing":{"margin":{"top":"0px","bottom":"0px"},"blockGap":"5%"},"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}}},"textColor":"foreground"} -->
					<div class="wp-block-columns alignwide has-foreground-color has-text-color has-link-color" style="margin-top:0px;margin-bottom:0px"><!-- wp:column {"width":"66.66%","style":{"spacing":{"padding":{"bottom":"6rem"}}}} -->
					<div class="wp-block-column" style="padding-bottom:6rem;flex-basis:66.66%"><!-- wp:query {"queryId":9,"query":{"perPage":"5","pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"displayLayout":{"type":"list"},"layout":{"inherit":true}} -->
					<div class="wp-block-query"><!-- wp:post-template -->
					<!-- wp:post-title {"isLink":true,"style":{"spacing":{"margin":{"top":"0","bottom":"1rem"}},"typography":{"fontStyle":"normal","fontWeight":"300"},"elements":{"link":{"color":{"text":"var:preset|color|foreground"}}}},"textColor":"foreground","fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"} /-->

					<!-- wp:post-featured-image {"isLink":true} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:group {"layout":{"type":"flex"}} -->
					<div class="wp-block-group"><!-- wp:post-date {"format":"F j, Y","style":{"typography":{"fontStyle":"normal","fontWeight":"400"}},"fontSize":"small"} /-->

					<!-- wp:post-terms {"term":"category","fontSize":"small"} /-->

					<!-- wp:post-terms {"term":"post_tag","fontSize":"small"} /--></div>
					<!-- /wp:group -->

					<!-- wp:spacer {"height":64} -->
					<div style="height:64px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->
					<!-- /wp:post-template -->

					<!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<!-- wp:query-pagination-previous {"fontSize":"small"} /-->

					<!-- wp:query-pagination-numbers /-->

					<!-- wp:query-pagination-next {"fontSize":"small"} /-->
					<!-- /wp:query-pagination --></div>
					<!-- /wp:query --></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":"33.33%"} -->
					<div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:image {"width":768,"height":1160,"sizeSlug":"large","linkDestination":"none"} -->
					<figure class="wp-block-image size-large is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-salmon.jpg" alt="' . esc_attr__( 'Illustration of a flying bird.', 'twentytwentytwo' ) . '" width="768" height="1160"/></figure>
					<!-- /wp:image -->

					<!-- wp:spacer {"height":4} -->
					<div style="height:4px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:site-title {"isLink":false,"style":{"typography":{"fontStyle":"normal","fontWeight":"300","lineHeight":"1.2"}},"fontSize":"large","fontFamily":"source-serif-pro"} /-->

					<!-- wp:site-tagline /-->

					<!-- wp:spacer {"height":16} -->
					<div style="height:16px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:heading {"level":4,"fontSize":"large"} -->
					<h4 class="has-large-font-size"><em>' . esc_html__( 'Categories', 'twentytwentytwo' ) . '</em></h4>
					<!-- /wp:heading -->

					<!-- wp:tag-cloud {"taxonomy":"category","showTagCounts":true} /-->

					<!-- wp:heading {"level":4,"fontSize":"large"} -->
					<h4 class="has-large-font-size"><em>' . esc_html__( 'Tags', 'twentytwentytwo' ) . '</em></h4>
					<!-- /wp:heading -->

					<!-- wp:tag-cloud {"showTagCounts":true} /--></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/header-default.php000060400000002401151330667700011770 0ustar00<?php
/**
 * Default header block pattern
 */
return array(
	'title'      => __( 'Default header', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"type":"flex"}} -->
					<div class="wp-block-group">
					<!-- wp:site-logo {"width":64} /-->

					<!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div>
					<!-- /wp:group -->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/general-divider-light.php000060400000001622151330667700013270 0ustar00<?php
/**
 * Divider with image and color (light) block pattern
 */
return array(
	'title'      => __( 'Divider with image and color (light)', 'twentytwentytwo' ),
	'categories' => array( 'featured' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"1rem","right":"0px","bottom":"1rem","left":"0px"}}},"backgroundColor":"secondary"} -->
					<div class="wp-block-group alignfull has-secondary-background-color has-background" style="padding-top:1rem;padding-right:0px;padding-bottom:1rem;padding-left:0px"><!-- wp:image {"id":473,"width":3001,"height":246,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/divider-black.png" alt="" class="wp-image-473" width="3001" height="246"/></figure>
					<!-- /wp:image --></div>
					<!-- /wp:group -->',
);
patterns/header-centered-title-navigation-social.php000060400000004267151330667700016675 0ustar00<?php
/**
 * Centered header with navigation, social links, and salmon background block pattern
 */
return array(
	'title'      => __( 'Centered header with navigation, social links, and background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|primary"}}},"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}},"backgroundColor":"secondary","textColor":"primary","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-primary-color has-secondary-background-color has-text-color has-background has-link-color" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem);"><!-- wp:columns {"verticalAlignment":"center","align":"wide"} -->
					<div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"left"}} -->
					<!-- wp:page-list /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:column -->

					<!-- wp:column {"width":""} -->
					<div class="wp-block-column"><!-- wp:site-title {"textAlign":"center","style":{"typography":{"textTransform":"uppercase","fontStyle":"normal","fontWeight":"700"}}} /--></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:social-links {"iconColor":"primary","iconColorValue":"var(--wp--custom--color--primary)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"right"}} -->
					<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
					<!-- /wp:social-links --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
);
patterns/header-small-dark.php000060400000004501151330667700012376 0ustar00<?php
/**
 * Small header with dark background block pattern
 */
return array(
	'title'      => __( 'Small header with dark background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"0px","bottom":"0px"}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:0px;padding-bottom:0px;"><!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:0px;padding-bottom:0px;"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"type":"flex"}} -->
					<div class="wp-block-group"><!-- wp:site-logo {"width":64} /-->

					<!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div>
					<!-- /wp:group -->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->

					<!-- wp:image {"align":"wide","width":2000,"height":474,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image alignwide size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-d.png" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2000" height="474"/></figure>
					<!-- /wp:image --></div>
					<!-- /wp:group -->
					<!-- wp:spacer {"height":66} -->
					<div style="height:66px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->',
);
patterns/header-image-background-overlay.php000060400000004514151330667700015231 0ustar00<?php
/**
 * Header with image background and overlay block pattern
 */
return array(
	'title'      => __( 'Header with image background and overlay', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:cover {"url":"' . esc_url( get_template_directory_uri() ) . '/assets/images/ducks.jpg","dimRatio":90,"overlayColor":"primary","focalPoint":{"x":"0.26","y":"0.34"},"minHeight":100,"minHeightUnit":"px","contentPosition":"center center","align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--small, 1.25rem)"}},"color":{"duotone":["#000000","#ffffff"]}}} -->
					<div class="wp-block-cover alignfull" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--small, 1.25rem);min-height:100px"><span aria-hidden="true" class="has-primary-background-color has-background-dim-90 wp-block-cover__gradient-background has-background-dim"></span><img class="wp-block-cover__image-background" alt="' . esc_attr__( 'Painting of ducks in the water.', 'twentytwentytwo' ) . '" src="' . esc_url( get_template_directory_uri() ) . '/assets/images/ducks.jpg" style="object-position:26% 34%" data-object-fit="cover" data-object-position="26% 34%"/><div class="wp-block-cover__inner-container"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0rem","top":"0px","right":"0px","left":"0px"}},"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"textColor":"background","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide has-background-color has-text-color has-link-color" style="padding-top:0px;padding-right:0px;padding-bottom:0rem;padding-left:0px"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"700"}}} /-->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div></div>
					<!-- /wp:cover --></div>
					<!-- /wp:group -->',
);
patterns/header-large-dark.php000060400000005367151330667700012373 0ustar00<?php
/**
 * Large header with dark background block pattern
 */
return array(
	'title'      => __( 'Large header with dark background', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"0px","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:0px;padding-bottom:var(--wp--custom--spacing--large, 8rem);"><!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"0px","bottom":"0px"}}},"layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull" style="padding-top:0px;padding-bottom:0px;"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--small, 1.25rem)","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:group {"layout":{"type":"flex"}} -->
					<div class="wp-block-group"><!-- wp:site-logo {"width":64} /-->

					<!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div>
					<!-- /wp:group -->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->
					<!-- wp:page-list /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group -->

					<!-- wp:heading {"align":"wide","style":{"typography":{"fontSize":"clamp(3.25rem, 8vw, 6.25rem)","lineHeight":"1.15"}}} -->
					<h2 class="alignwide" style="font-size:clamp(3.25rem, 8vw, 6.25rem);line-height:1.15">' . wp_kses_post( __( '<em>The Hatchery</em>: a blog about my adventures in bird watching', 'twentytwentytwo' ) ) . '</h2>
					<!-- /wp:heading --></div>
					<!-- /wp:group -->

					<!-- wp:image {"align":"full","width":2400,"height":1020,"sizeSlug":"full","linkDestination":"none"} -->
					<figure class="wp-block-image alignfull size-full is-resized"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-c.png" alt="' . esc_attr__( 'Illustration of a bird flying.', 'twentytwentytwo' ) . '" width="2400" height="1020"/></figure>
					<!-- /wp:image --></div>
					<!-- /wp:group --><!-- wp:spacer {"height":66} -->
					<div style="height:66px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->',
);
patterns/header-title-and-button.php000060400000002300151330667700013534 0ustar00<?php
/**
 * Title and button header block pattern
 */
return array(
	'title'      => __( 'Title and button header', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /-->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"},"overlayMenu":"always"} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/footer-navigation.php000060400000002250151330667700012553 0ustar00<?php
/**
 * Footer with navigation and citation
 */
return array(
	'title'      => __( 'Footer with navigation and citation', 'twentytwentytwo' ),
	'categories' => array( 'footer' ),
	'blockTypes' => array( 'core/template-part/footer' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
					<div class="wp-block-group alignwide" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:navigation -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation -->

					<!-- wp:paragraph {"align":"right"} -->
					<p class="has-text-align-right">' .
					sprintf(
						/* Translators: WordPress link. */
						esc_html__( 'Proudly powered by %s', 'twentytwentytwo' ),
						'<a href="' . esc_url( __( 'https://wordpress.org', 'twentytwentytwo' ) ) . '" rel="nofollow">WordPress</a>'
					) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/query-text-grid.php000060400000002456151330667700012202 0ustar00<?php
/**
 * Text-based grid of posts block pattern
 */
return array(
	'title'      => __( 'Text-based grid of posts', 'twentytwentytwo' ),
	'categories' => array( 'query' ),
	'blockTypes' => array( 'core/query' ),
	'content'    => '<!-- wp:query {"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":12},"displayLayout":{"type":"flex","columns":3},"align":"wide","layout":{"inherit":true}} -->
					<div class="wp-block-query alignwide"><!-- wp:post-template {"align":"wide"} -->

					<!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:post-date {"format":"F j, Y","isLink":true,"fontSize":"small"} /-->
					<!-- /wp:post-template -->

					<!-- wp:separator {"align":"wide","className":"is-style-wide"} -->
					<hr class="wp-block-separator alignwide is-style-wide"/>
					<!-- /wp:separator -->

					<!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<!-- wp:query-pagination-previous {"fontSize":"small"} /-->

					<!-- wp:query-pagination-numbers /-->

					<!-- wp:query-pagination-next {"fontSize":"small"} /-->
					<!-- /wp:query-pagination --></div>
					<!-- /wp:query -->',
);
patterns/header-stacked.php000060400000002721151330667700011767 0ustar00<?php
/**
 * Logo and navigation header block pattern
 */
return array(
	'title'      => __( 'Logo and navigation header', 'twentytwentytwo' ),
	'categories' => array( 'header' ),
	'blockTypes' => array( 'core/template-part/header' ),
	'content'    => '<!-- wp:group {"align":"full","layout":{"inherit":true}} -->
					<div class="wp-block-group alignfull"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var(--wp--custom--spacing--large, 8rem)","top":"var(--wp--custom--spacing--small, 1.25rem)"}}}} -->
					<div class="wp-block-group alignwide" style="padding-top:var(--wp--custom--spacing--small, 1.25rem);padding-bottom:var(--wp--custom--spacing--large, 8rem)"><!-- wp:site-logo {"align":"center","width":128} /-->

					<!-- wp:spacer {"height":10} -->
					<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:site-title {"textAlign":"center","style":{"typography":{"fontStyle":"normal","fontWeight":"400","textTransform":"uppercase"}}} /-->

					<!-- wp:spacer {"height":10} -->
					<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"center"}} -->
					<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
					<!-- /wp:navigation --></div>
					<!-- /wp:group --></div>
					<!-- /wp:group -->',
);
patterns/query-simple-blog.php000060400000003534151330667700012503 0ustar00<?php
/**
 * Simple blog posts block pattern
 */
return array(
	'title'      => __( 'Simple blog posts', 'twentytwentytwo' ),
	'categories' => array( 'query' ),
	'blockTypes' => array( 'core/query' ),
	'content'    => '<!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"perPage":10},"layout":{"inherit":true}} -->
					<div class="wp-block-query"><!-- wp:post-template -->
					<!-- wp:post-title {"isLink":true,"style":{"spacing":{"margin":{"top":"1rem","bottom":"1rem"}},"typography":{"fontStyle":"normal","fontWeight":"300"},"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"textColor":"primary","fontSize":"var(--wp--custom--typography--font-size--huge, clamp(2.25rem, 4vw, 2.75rem))"} /-->

					<!-- wp:post-featured-image {"isLink":true} /-->

					<!-- wp:post-excerpt /-->

					<!-- wp:group {"layout":{"type":"flex"}} -->
					<div class="wp-block-group"><!-- wp:post-date {"format":"F j, Y","style":{"typography":{"fontStyle":"normal","fontWeight":"400"}},"fontSize":"small"} /-->

					<!-- wp:post-terms {"term":"category","fontSize":"small"} /-->

					<!-- wp:post-terms {"term":"post_tag","fontSize":"small"} /--></div>
					<!-- /wp:group -->

					<!-- wp:spacer {"height":128} -->
					<div style="height:128px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->
					<!-- /wp:post-template -->

					<!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
					<!-- wp:query-pagination-previous {"fontSize":"small"} /-->

					<!-- wp:query-pagination-numbers /-->

					<!-- wp:query-pagination-next {"fontSize":"small"} /-->
					<!-- /wp:query-pagination --></div>
					<!-- /wp:query -->',
);
menu-functions.php000060400000007045151331575610010240 0ustar00<?php
/**
 * Functions and filters related to the menus.
 *
 * Makes the default WordPress navigation use an HTML structure similar
 * to the Navigation block.
 *
 * @link https://make.wordpress.org/themes/2020/07/06/printing-navigation-block-html-from-a-legacy-menu-in-themes/
 *
 * @package WordPress
 * @subpackage Twenty_Twenty_One
 * @since Twenty Twenty-One 1.0
 */

/**
 * Add a button to top-level menu items that has sub-menus.
 * An icon is added using CSS depending on the value of aria-expanded.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @param string $output Nav menu item start element.
 * @param object $item   Nav menu item.
 * @param int    $depth  Depth.
 * @param object $args   Nav menu args.
 * @return string Nav menu item start element.
 */
function twenty_twenty_one_add_sub_menu_toggle( $output, $item, $depth, $args ) {
	if ( 0 === $depth && in_array( 'menu-item-has-children', $item->classes, true ) ) {

		// Add toggle button.
		$output .= '<button class="sub-menu-toggle" aria-expanded="false" onClick="twentytwentyoneExpandSubMenu(this)">';
		$output .= '<span class="icon-plus">' . twenty_twenty_one_get_icon_svg( 'ui', 'plus', 18 ) . '</span>';
		$output .= '<span class="icon-minus">' . twenty_twenty_one_get_icon_svg( 'ui', 'minus', 18 ) . '</span>';
		$output .= '<span class="screen-reader-text">' . esc_html__( 'Open menu', 'twentytwentyone' ) . '</span>';
		$output .= '</button>';
	}
	return $output;
}
add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_add_sub_menu_toggle', 10, 4 );

/**
 * Detects the social network from a URL and returns the SVG code for its icon.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @param string $uri  Social link.
 * @param int    $size The icon size in pixels.
 * @return string
 */
function twenty_twenty_one_get_social_link_svg( $uri, $size = 24 ) {
	return Twenty_Twenty_One_SVG_Icons::get_social_link_svg( $uri, $size );
}

/**
 * Displays SVG icons in the footer navigation.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @param string   $item_output The menu item's starting HTML output.
 * @param WP_Post  $item        Menu item data object.
 * @param int      $depth       Depth of the menu. Used for padding.
 * @param stdClass $args        An object of wp_nav_menu() arguments.
 * @return string The menu item output with social icon.
 */
function twenty_twenty_one_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
	// Change SVG icon inside social links menu if there is supported URL.
	if ( 'footer' === $args->theme_location ) {
		$svg = twenty_twenty_one_get_social_link_svg( $item->url, 24 );
		if ( ! empty( $svg ) ) {
			$item_output = str_replace( $args->link_before, $svg, $item_output );
		}
	}

	return $item_output;
}

add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_nav_menu_social_icons', 10, 4 );

/**
 * Filters the arguments for a single nav menu item.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @param stdClass $args  An object of wp_nav_menu() arguments.
 * @param WP_Post  $item  Menu item data object.
 * @param int      $depth Depth of menu item. Used for padding.
 * @return stdClass
 */
function twenty_twenty_one_add_menu_description_args( $args, $item, $depth ) {
	$args->link_after = '';
	if ( 0 === $depth && isset( $item->description ) && $item->description ) {
		// The extra <span> element is here for styling purposes: Allows the description to not be underlined on hover.
		$args->link_after = '<p class="menu-item-description"><span>' . $item->description . '</span></p>';
	}
	return $args;
}
add_filter( 'nav_menu_item_args', 'twenty_twenty_one_add_menu_description_args', 10, 3 );
block-styles.php000060400000004611151331575610007675 0ustar00<?php
/**
 * Block Styles
 *
 * @link https://developer.wordpress.org/reference/functions/register_block_style/
 *
 * @package WordPress
 * @subpackage Twenty_Twenty_One
 * @since Twenty Twenty-One 1.0
 */

if ( function_exists( 'register_block_style' ) ) {
	/**
	 * Register block styles.
	 *
	 * @since Twenty Twenty-One 1.0
	 *
	 * @return void
	 */
	function twenty_twenty_one_register_block_styles() {
		// Columns: Overlap.
		register_block_style(
			'core/columns',
			array(
				'name'  => 'twentytwentyone-columns-overlap',
				'label' => esc_html__( 'Overlap', 'twentytwentyone' ),
			)
		);

		// Cover: Borders.
		register_block_style(
			'core/cover',
			array(
				'name'  => 'twentytwentyone-border',
				'label' => esc_html__( 'Borders', 'twentytwentyone' ),
			)
		);

		// Group: Borders.
		register_block_style(
			'core/group',
			array(
				'name'  => 'twentytwentyone-border',
				'label' => esc_html__( 'Borders', 'twentytwentyone' ),
			)
		);

		// Image: Borders.
		register_block_style(
			'core/image',
			array(
				'name'  => 'twentytwentyone-border',
				'label' => esc_html__( 'Borders', 'twentytwentyone' ),
			)
		);

		// Image: Frame.
		register_block_style(
			'core/image',
			array(
				'name'  => 'twentytwentyone-image-frame',
				'label' => esc_html__( 'Frame', 'twentytwentyone' ),
			)
		);

		// Latest Posts: Dividers.
		register_block_style(
			'core/latest-posts',
			array(
				'name'  => 'twentytwentyone-latest-posts-dividers',
				'label' => esc_html__( 'Dividers', 'twentytwentyone' ),
			)
		);

		// Latest Posts: Borders.
		register_block_style(
			'core/latest-posts',
			array(
				'name'  => 'twentytwentyone-latest-posts-borders',
				'label' => esc_html__( 'Borders', 'twentytwentyone' ),
			)
		);

		// Media & Text: Borders.
		register_block_style(
			'core/media-text',
			array(
				'name'  => 'twentytwentyone-border',
				'label' => esc_html__( 'Borders', 'twentytwentyone' ),
			)
		);

		// Separator: Thick.
		register_block_style(
			'core/separator',
			array(
				'name'  => 'twentytwentyone-separator-thick',
				'label' => esc_html__( 'Thick', 'twentytwentyone' ),
			)
		);

		// Social icons: Dark gray color.
		register_block_style(
			'core/social-links',
			array(
				'name'  => 'twentytwentyone-social-icons-color',
				'label' => esc_html__( 'Dark gray', 'twentytwentyone' ),
			)
		);
	}
	add_action( 'init', 'twenty_twenty_one_register_block_styles' );
}
starter-content.php000060400000021031151331575610010411 0ustar00<?php
/**
 * Twenty Twenty-One Starter Content
 *
 * @link https://make.wordpress.org/core/2016/11/30/starter-content-for-themes-in-4-7/
 *
 * @package WordPress
 * @subpackage Twenty_Twenty_One
 * @since Twenty Twenty-One 1.0
 */

/**
 * Function to return the array of starter content for the theme.
 *
 * Passes it through the `twenty_twenty_one_starter_content` filter before returning.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @return array A filtered array of args for the starter_content.
 */
function twenty_twenty_one_get_starter_content() {

	// Define and register starter content to showcase the theme on new sites.
	$starter_content = array(

		// Specify the core-defined pages to create and add custom thumbnails to some of them.
		'posts'     => array(
			'front' => array(
				'post_type'    => 'page',
				'post_title'   => esc_html_x( 'Create your website with blocks', 'Theme starter content', 'twentytwentyone' ),
				'post_content' => '
					<!-- wp:heading {"align":"wide","fontSize":"gigantic","style":{"typography":{"lineHeight":"1.1"}}} -->
					<h2 class="alignwide has-text-align-wide has-gigantic-font-size" style="line-height:1.1">' . esc_html_x( 'Create your website with blocks', 'Theme starter content', 'twentytwentyone' ) . '</h2>
					<!-- /wp:heading -->

					<!-- wp:spacer -->
					<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:columns {"verticalAlignment":"center","align":"wide","className":"is-style-twentytwentyone-columns-overlap"} -->
					<div class="wp-block-columns alignwide are-vertically-aligned-center is-style-twentytwentyone-columns-overlap"><!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"full","sizeSlug":"large"} -->
					<figure class="wp-block-image alignfull size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/roses-tremieres-hollyhocks-1884.jpg" alt="' . esc_attr__( '&#8220;Roses Trémières&#8221; by Berthe Morisot', 'twentytwentyone' ) . '"/></figure>
					<!-- /wp:image -->

					<!-- wp:spacer -->
					<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:image {"align":"full","sizeSlug":"large","className":"is-style-twentytwentyone-image-frame"} -->
					<figure class="wp-block-image alignfull size-large is-style-twentytwentyone-image-frame"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/in-the-bois-de-boulogne.jpg" alt="' . esc_attr__( '&#8220;In the Bois de Boulogne&#8221; by Berthe Morisot', 'twentytwentyone' ) . '"/></figure>
					<!-- /wp:image --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center"} -->
					<div class="wp-block-column is-vertically-aligned-center"><!-- wp:spacer -->
					<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:image {"sizeSlug":"large","className":"alignfull size-full is-style-twentytwentyone-border"} -->
					<figure class="wp-block-image size-large alignfull size-full is-style-twentytwentyone-border"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/young-woman-in-mauve.jpg" alt="' . esc_attr__( '&#8220;Young Woman in Mauve&#8221; by Berthe Morisot', 'twentytwentyone' ) . '"/></figure>
					<!-- /wp:image --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:spacer {"height":50} -->
					<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:columns {"verticalAlignment":"top","align":"wide"} -->
					<div class="wp-block-columns alignwide are-vertically-aligned-top"><!-- wp:column {"verticalAlignment":"top"} -->
					<div class="wp-block-column is-vertically-aligned-top"><!-- wp:heading {"level":3} -->
					<h3>' . esc_html_x( 'Add block patterns', 'Theme starter content', 'twentytwentyone' ) . '</h3>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . esc_html_x( 'Block patterns are pre-designed groups of blocks. To add one, select the Add Block button [+] in the toolbar at the top of the editor. Switch to the Patterns tab underneath the search bar, and choose a pattern.', 'Theme starter content', 'twentytwentyone' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"top"} -->
					<div class="wp-block-column is-vertically-aligned-top"><!-- wp:heading {"level":3} -->
					<h3>' . esc_html_x( 'Frame your images', 'Theme starter content', 'twentytwentyone' ) . '</h3>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . esc_html_x( 'Twenty Twenty-One includes stylish borders for your content. With an Image block selected, open the "Styles" panel within the Editor sidebar. Select the "Frame" block style to activate it.', 'Theme starter content', 'twentytwentyone' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"top"} -->
					<div class="wp-block-column is-vertically-aligned-top"><!-- wp:heading {"level":3} -->
					<h3>' . esc_html_x( 'Overlap columns', 'Theme starter content', 'twentytwentyone' ) . '</h3>
					<!-- /wp:heading -->

					<!-- wp:paragraph -->
					<p>' . esc_html_x( 'Twenty Twenty-One also includes an overlap style for column blocks. With a Columns block selected, open the "Styles" panel within the Editor sidebar. Choose the "Overlap" block style to try it out.', 'Theme starter content', 'twentytwentyone' ) . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:spacer -->
					<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:cover {"overlayColor":"green","contentPosition":"center center","align":"wide","className":"is-style-twentytwentyone-border"} -->
					<div class="wp-block-cover alignwide has-green-background-color has-background-dim is-style-twentytwentyone-border"><div class="wp-block-cover__inner-container"><!-- wp:spacer {"height":20} -->
					<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:paragraph {"fontSize":"huge"} -->
					<p class="has-huge-font-size">' . esc_html_x( 'Need help?', 'Theme starter content', 'twentytwentyone' ) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":75} -->
					<div style="height:75px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:columns -->
					<div class="wp-block-columns"><!-- wp:column -->
					<div class="wp-block-column"><!-- wp:paragraph -->
					<p><a href="https://wordpress.org/support/article/twenty-twenty-one/">' . esc_html_x( 'Read the Theme Documentation', 'Theme starter content', 'twentytwentyone' ) . '</a></p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column -->
					<div class="wp-block-column"><!-- wp:paragraph -->
					<p><a href="https://wordpress.org/support/theme/twentytwentyone/">' . esc_html_x( 'Check out the Support Forums', 'Theme starter content', 'twentytwentyone' ) . '</a></p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns -->

					<!-- wp:spacer {"height":20} -->
					<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer --></div></div>
					<!-- /wp:cover -->',
			),
			'about',
			'contact',
			'blog',
		),

		// Default to a static front page and assign the front and posts pages.
		'options'   => array(
			'show_on_front'  => 'page',
			'page_on_front'  => '{{front}}',
			'page_for_posts' => '{{blog}}',
		),

		// Set up nav menus for each of the two areas registered in the theme.
		'nav_menus' => array(
			// Assign a menu to the "primary" location.
			'primary' => array(
				'name'  => esc_html__( 'Primary menu', 'twentytwentyone' ),
				'items' => array(
					'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
					'page_about',
					'page_blog',
					'page_contact',
				),
			),

			// Assign a menu to the "footer" location.
			'footer'  => array(
				'name'  => esc_html__( 'Secondary menu', 'twentytwentyone' ),
				'items' => array(
					'link_facebook',
					'link_twitter',
					'link_instagram',
					'link_email',
				),
			),
		),
	);

	/**
	 * Filters the array of starter content.
	 *
	 * @since Twenty Twenty-One 1.0
	 *
	 * @param array $starter_content Array of starter content.
	 */
	return apply_filters( 'twenty_twenty_one_starter_content', $starter_content );
}
custom-css.php000060400000002250151331575610007357 0ustar00<?php
/**
 * Custom CSS
 *
 * @package WordPress
 * @subpackage Twenty_Twenty_One
 * @since Twenty Twenty-One 1.0
 */

/**
 * Generate CSS.
 *
 * @since Twenty Twenty-One 1.0
 *
 * @param string $selector The CSS selector.
 * @param string $style    The CSS style.
 * @param string $value    The CSS value.
 * @param string $prefix   The CSS prefix.
 * @param string $suffix   The CSS suffix.
 * @param bool   $echo     Echo the styles.
 * @return string
 */
function twenty_twenty_one_generate_css( $selector, $style, $value, $prefix = '', $suffix = '', $echo = true ) {

	// Bail early if there is no $selector elements or properties and $value.
	if ( ! $value || ! $selector ) {
		return '';
	}

	$css = sprintf( '%s { %s: %s; }', $selector, $style, $prefix . $value . $suffix );

	if ( $echo ) {
		/*
		 * Note to reviewers: $css contains auto-generated CSS.
		 * It is included inside <style> tags and can only be interpreted as CSS on the browser.
		 * Using wp_strip_all_tags() here is sufficient escaping to avoid
		 * malicious attempts to close </style> and open a <script>.
		 */
		echo wp_strip_all_tags( $css ); // phpcs:ignore WordPress.Security.EscapeOutput
	}
	return $css;
}
src/HeaderPresets.php000064400000006360151335104360010610 0ustar00<?php


namespace ColibriWP\Theme;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Utils;

class HeaderPresets {

    private $headers_data = array();

    public function __construct() {
        $this->loadHeadersData();
        Hooks::colibri_add_filter( 'customizer_js_data',
            array( $this, 'addHeadersToJSData' ) );
    }

    public function loadHeadersData() {

        if ( ! file_exists( get_template_directory() . "/inc/customizer-headers.php" ) ) {
            return;
        }

        $assets_base_url = get_template_directory_uri() . "/resources/header-presets";

        $headers = require_once get_template_directory() . "/inc/customizer-headers.php";
        foreach ( $headers as $index => $header ) {
            $image = Utils::pathGet( $header, 'image', '' );
            $data  = Utils::pathGet( $header, 'data', array() );

            foreach ( $data as $data_index => $value ) {

                $decoded_value = $this->maybeJSONDecode( $value );

                if ( ( is_array( $value ) || $decoded_value !== $value ) && is_array( $decoded_value ) ) {
                    $decoded_value       = $this->sprintfRecursive( $decoded_value, $assets_base_url );
                    $data[ $data_index ] = urlencode( json_encode( $decoded_value ) );
                } else {
                    if ( is_string( $value ) ) {
                        $data[ $data_index ] = sprintf( $value, $assets_base_url );
                    }
                }

            }

            $fallback_keys = array(
                'header_front_page.icon_list.localProps.iconList',
                'header_front_page.social_icons.localProps.icons'
            );

            foreach ( $fallback_keys as $fallback_key ) {
                $data[ $fallback_key ] = Defaults::get( $fallback_key );
            }

            $headers[ $index ] = array(
                'image' => sprintf( $image, "{$assets_base_url}/previews" ),
                'data'  => $data
            );

            $this->headers_data = $headers;
        }
    }

    private function maybeJSONDecode( $value ) {
        if ( is_string( $value ) && strlen( trim( $value ) ) ) {
            // try to decode an url encoded value
            $maybe_value = json_decode( urldecode( $value ), true );

            if ( json_last_error() === JSON_ERROR_NONE ) {
                return $maybe_value;
            } else {
                // try to decode the value directly
                if ( is_string( $value ) ) {
                    $maybe_value = json_decode( $value, true );
                    if ( json_last_error() === JSON_ERROR_NONE ) {
                        return $maybe_value;
                    }
                }
            }

        }

        return $value;
    }

    public function sprintfRecursive( $array, $arg ) {

        if ( ! is_array( $array ) ) {
            if ( is_string( $array ) ) {
                return sprintf( $array, $arg );
            }

            return $array;
        }

        foreach ( $array as $index => $value ) {
            $array[ $index ] = $this->sprintfRecursive( $value, $arg );
        }

        return $array;
    }

    public function addHeadersToJSData( $data ) {
        $data['headers'] = $this->headers_data;

        return $data;
    }
}
src/Defaults.php000064400000002046151335104360007616 0ustar00<?php


namespace ColibriWP\Theme;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Utils;

class Defaults {
    private static $defaults = array();

    private static $loaded = false;

    public static function getDefaults() {
        return static::$defaults;
    }

    public static function get( $key, $fallback = null ) {
        static::load();

        return Utils::pathGet( static::$defaults, $key, $fallback );
    }

    public static function load() {

        if ( static::$loaded ) {
            return;
        }

        $defaults = require_once get_template_directory() . "/inc/defaults.php";

        if ( file_exists( get_template_directory() . "/inc/template-defaults.php" ) ) {
            $template_defaults = require_once get_template_directory() . "/inc/template-defaults.php";
            static::$defaults  = array_replace_recursive( $template_defaults, $defaults );
        }

        static::$defaults = Hooks::colibri_apply_filters( 'defaults', static::$defaults, $defaults );
        static::$loaded   = true;
    }

}
src/Customizer/SectionFactory.php000064400000002564151335104360013154 0ustar00<?php


namespace ColibriWP\Theme\Customizer;

use ColibriWP\Theme\Customizer\Sections\ColibriSection;
use WP_Customize_Section;

class SectionFactory {
    private static $sections = array(
        'colibri_section' => ColibriSection::class,
    );

    private static $register_exclusion = array();
    private static $registered = false;

    public static function make( $id, $data ) {

        $data = array_merge( array(
            'type' => 'default',
        ), $data );


        $class = static::getClassByType( $data['type'] );


        global $wp_customize;


        unset( $data['type'] );

        $section = new $class( $wp_customize, $id, $data );
        $wp_customize->add_section( $section );


        return $section;
    }

    private static function register() {
        if ( ! static::$registered ) {

            foreach ( static::$sections as $key => $section ) {
                global $wp_customize;

                if ( ! in_array( $key, static::$register_exclusion ) ) {
                    $wp_customize->register_section_type( $section );
                }
            }

            static::$registered = true;
        }
    }

    private static function getClassByType( $type ) {

        static::register();

        $class = isset( static::$sections[ $type ] ) ? static::$sections [ $type ] : WP_Customize_Section::class;

        return $class;
    }
}
src/Customizer/ControlFactory.php000064400000021314151335104360013162 0ustar00<?php


namespace ColibriWP\Theme\Customizer;


use ColibriWP\Theme\ActiveCallback;
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\PartialComponentInterface;
use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Customizer\Controls\AlignButtonGroupControl;
use ColibriWP\Theme\Customizer\Controls\ButtonControl;
use ColibriWP\Theme\Customizer\Controls\ButtonGroupControl;
use ColibriWP\Theme\Customizer\Controls\ColibriControl;
use ColibriWP\Theme\Customizer\Controls\ColorControl;
use ColibriWP\Theme\Customizer\Controls\ComposedControl;
use ColibriWP\Theme\Customizer\Controls\ControlsGroupControl;
use ColibriWP\Theme\Customizer\Controls\CroppedImageControl;
use ColibriWP\Theme\Customizer\Controls\GradientControl;
use ColibriWP\Theme\Customizer\Controls\IconControl;
use ColibriWP\Theme\Customizer\Controls\ImageControl;
use ColibriWP\Theme\Customizer\Controls\InputControl;
use ColibriWP\Theme\Customizer\Controls\LinkedSelectControl;
use ColibriWP\Theme\Customizer\Controls\MediaControl;
use ColibriWP\Theme\Customizer\Controls\PenControl;
use ColibriWP\Theme\Customizer\Controls\PluginMessageControl;
use ColibriWP\Theme\Customizer\Controls\RepeaterControl;
use ColibriWP\Theme\Customizer\Controls\SelectControl;
use ColibriWP\Theme\Customizer\Controls\SelectIconControl;
use ColibriWP\Theme\Customizer\Controls\SeparatorControl;
use ColibriWP\Theme\Customizer\Controls\SliderControl;
use ColibriWP\Theme\Customizer\Controls\SpacingControl;
use ColibriWP\Theme\Customizer\Controls\SwitchControl;
use ColibriWP\Theme\Customizer\Controls\UploadControl;
use ColibriWP\Theme\Customizer\Controls\VideoControl;

class ControlFactory {


	private static $controls
		= array(
			// defaults
			'image'              => ImageControl::class,
			'cropped_image'      => CroppedImageControl::class,
			'upload'             => UploadControl::class,
			'media'              => MediaControl::class,
			// colibri
			'color'              => ColorControl::class,
			'switch'             => SwitchControl::class,
			'select'             => SelectControl::class,
			'linked-select'      => LinkedSelectControl::class,
			'select-icon'        => SelectIconControl::class,
			'button-group'       => ButtonGroupControl::class,
			'align-button-group' => AlignButtonGroupControl::class,
			'button'             => ButtonControl::class,
			'gradient'           => GradientControl::class,
			'repeater'           => RepeaterControl::class,
			'composed'           => ComposedControl::class,
			'slider'             => SliderControl::class,
			'video'              => VideoControl::class,
			'input'              => InputControl::class,
			'plugin-message'     => PluginMessageControl::class,
			'separator'          => SeparatorControl::class,
			'group'              => ControlsGroupControl::class,
			'spacing'            => SpacingControl::class,
			'icon'               => IconControl::class,
			'pen'                => PenControl::class,
		);

	private static $decoration_controls = [ 'separator', 'plugin-message' ];

	private static $wp_controls = array();


	private static $partial_refreshes = array();
	private static $css_output_controls = array();
	private static $js_output_controls = array();
	private static $active_rules = array();


	private static $registered = false;

	/**
	 * @return array
	 */
	public static function getCssOutputControls() {
		return self::$css_output_controls;
	}

	public static function getJsOutputControls() {
		return self::$js_output_controls;
	}

	public static function make( $setting_id, $data ) {

		if ( array_key_exists( 'active_rules', $data ) ) {
			static::addActiveCallbackRules( $setting_id, $data );
		}

		$data = array_merge(
			array(
				'type'            => 'hidden',
				'transport'       => 'colibri_selective_refresh',
				'settings'        => $data['settingless'] ? array() : $setting_id,
				'active_callback' => function ( $control ) use ( $setting_id ) {
					$rendered = Hooks::colibri_apply_filters( "control_{$setting_id}_rendered", false, $control );
					$active   = false;
					if ( $rendered ) {
						$active = Hooks::colibri_apply_filters( "control_{$setting_id}_active", true, $control );
					}

					return $active;

				},
			),
			$data
		);

		if ( $data['settingless'] ) {
			$data['capability'] = 'edit_theme_options';
		}

		if ( isset( $data['focus_alias'] ) ) {
			Hooks::colibri_add_filter( 'customizer_autofocus_aliases',
				function ( $aliases ) use ( $data, $setting_id ) {
					$aliases[ $data['focus_alias'] ] = $setting_id;

					return $aliases;
				} );
		}

		$class = static::getClassByType( $data['type'] );

		global $wp_customize;

		if ( ! in_array( $data['type'], static::$decoration_controls ) ) {
			if ( $data['transport'] === 'colibri_selective_refresh' ) {
				$data = static::preparePartialRefreshControl( $setting_id, $data );
			}

			if ( $data['transport'] === 'css_output' ) {
				$data = static::prepareCSSOutputControl( $setting_id, $data );
			}

			if ( $data['transport'] === 'js_output' ) {
				$data = static::prepareJSOutputControl( $setting_id, $data );
			}
		}

		if ( $class !== ColibriControl::class ) {
			unset( $data['type'] );
		}

		$control = new $class( $wp_customize, Utils::slugify( $setting_id ), $data );
		$wp_customize->add_control( $control );


		return $control;
	}

	private static function addActiveCallbackRules( $setting_id, $data ) {
		$rules = $data['active_rules'];

		$active_callback = new ActiveCallback();
		$active_callback->setRules( $rules );

		static::$active_rules[ $setting_id ] = $rules;

		Hooks::colibri_add_filter( "control_{$setting_id}_active", array( $active_callback, 'applyRules' ), 10 );
	}

	private static function getClassByType( $type ) {

		static::register();

		$controls = array_merge( static::$wp_controls, static::$controls );

		$class = isset( $controls [ $type ] ) ? $controls [ $type ] : ColibriControl::class;

		return $class;
	}

	private static function register() {
		if ( ! static::$registered ) {

			foreach ( static::$controls as $key => $control ) {
				global $wp_customize;
				$wp_customize->register_control_type( $control );

			}

			static::$registered = true;
		}
	}

	private static function preparePartialRefreshControl( $setting_id, $data ) {
		global $wp_customize;

		if ( ! isset( $wp_customize->selective_refresh ) ) {

			$wp_customize->get_setting( $setting_id )->transport = 'refresh';
			if ( array_key_exists( 'colibri_selective_refresh_selector', $data ) ) {
				unset( $data['colibri_selective_refresh_selector'] );
			}

			if ( array_key_exists( 'colibri_selective_refresh_class', $data ) ) {
				unset( $data['colibri_selective_refresh_class'] );
			}

		} else {
			$wp_customize->get_setting( $setting_id )->transport = 'postMessage';

			$selector = ( isset( $data['colibri_selective_refresh_selector'] ) ) ? $data['colibri_selective_refresh_selector'] : '';
			$id       = Utils::slugify( $selector );

			if ( isset( static::$partial_refreshes[ $id ] ) ) {
				static::$partial_refreshes[ $id ]['settings'][] = $setting_id;
			} else {
				static::$partial_refreshes[ $id ] = array(
					'selector'            => $selector,
					'settings'            => array( $setting_id ),
					'container_inclusive' => true, //$data['selective_refresh_container_inclusive'],
					'render_callback'     => function () use ( $data ) {
						$class = $data['colibri_selective_refresh_class'];

						/** @var PartialComponentInterface $item */
						$item = new $class();

						if ( isset( $data['colibri_selective_refresh_function'] ) ) {
							$fn = $data['colibri_selective_refresh_function'];
							if ( is_string( $fn ) && ! function_exists( $fn ) ) {
								$fn = array( $item, $fn );
							}
							call_user_func( $fn );
						} else {
							$item->renderContent();
						}

					},
				);
			}
		}

		return $data;
	}

	private static function prepareCSSOutputControl( $setting_id, $data ) {
		global $wp_customize;

		$setting = $wp_customize->get_setting( $setting_id );
		if ( ! $setting ) {
			return array();
		}

		$setting->transport = 'postMessage';

		static::$css_output_controls[ $setting_id ] = $data['css_output'];

		return $data;
	}

	private static function prepareJSOutputControl( $setting_id, $data ) {
		global $wp_customize;

		$setting = $wp_customize->get_setting( $setting_id );
		if ( ! $setting ) {
			return array();
		}

		$setting->transport                        = 'postMessage';
		static::$js_output_controls[ $setting_id ] = $data['js_output'];

		return $data;
	}

	/**
	 * @return array
	 */
	public static function getPartialRefreshes() {
		return self::$partial_refreshes;
	}

	/**
	 * @return array
	 */
	public static function getActiveRules() {
		return Hooks::colibri_apply_filters( 'controls_active_rules', self::$active_rules );
	}

	public static function getConstructor( $type ) {
		return Utils::pathGet( static::$controls, $type, null );
	}
}
src/Customizer/PanelFactory.php000064400000002520151335104360012577 0ustar00<?php


namespace ColibriWP\Theme\Customizer;

use ColibriWP\Theme\Customizer\Panel\ColibriPanel;
use WP_Customize_Panel;

class PanelFactory {
    private static $panels = array(
        'colibri_panel' => ColibriPanel::class,

    );

    private static $register_exclusion = array();
    private static $registered = false;

    public static function make( $id, $data ) {

        $data = array_merge( array(
            'type' => 'default',
        ), $data );


        $class = static::getClassByType( $data['type'] );


        global $wp_customize;


        unset( $data['type'] );

        $panel = new $class( $wp_customize, $id, $data );
        $wp_customize->add_panel( $panel );


        return $panel;
    }

    private static function register() {
        if ( ! static::$registered ) {

            foreach ( static::$panels as $key => $panel ) {
                global $wp_customize;

                if ( ! in_array( $key, static::$register_exclusion ) ) {
                    $wp_customize->register_panel_type( $panel );
                }
            }

            static::$registered = true;
        }
    }

    private static function getClassByType( $type ) {

        static::register();

        $class = isset( static::$panels[ $type ] ) ? static::$panels [ $type ] : WP_Customize_Panel::class;

        return $class;
    }
}
src/Customizer/CustomizerApi.php000064400000003314151335104360013010 0ustar00<?php


namespace ColibriWP\Theme\Customizer;


use ColibriWP\Theme\Core\Hooks;
use WP_REST_Request;
use WP_REST_Response;

class CustomizerApi {

    const REST_NAMESPACE = 'colibri_theme/v1';

    public function __construct() {
        $that = $this;
        add_action( 'rest_api_init', function () use ( $that ) {
            foreach ( $that->getRoutes() as $route => $data ) {
                $data['callback'] = array( $that, $data['callback'] );
                $data['permission_callback'] = function () {
                    return current_user_can( 'edit_theme_options' );
                };
                register_rest_route( static::REST_NAMESPACE, $route, $data );
            }
        } );

        Hooks::colibri_add_filter( 'customizer_additional_js_data', function ( $data ) {
            $data['api_url'] = site_url( "?rest_route=/" . static::REST_NAMESPACE );

            return $data;
        } );
    }

    protected function getRoutes() {

        return array(
            '/attachment-data/(?P<id>\d+)' => array(
                "method"   => "GET",
                "callback" => "getAttachmentData",
            ),
        );

    }

    public function send( $data, $status = "200" ) {
        $reponse = new WP_REST_Response( $data );
        $reponse->set_status( $status );

        return $reponse;
    }

    public function getAttachmentData( WP_REST_Request $request ) {

        $id = $request->get_param( "id" );

        $url       = wp_get_attachment_url( $id );
        $type      = wp_check_filetype( $url, wp_get_mime_types() );
        $mime_type = $type['type'];

        return $this->send( array(
            "url"       => $url,
            "mime_type" => $mime_type,
        ) );
    }
}
src/Customizer/Formatter.php000064400000000535151335104360012157 0ustar00<?php
/**
 * Created by PhpStorm.
 * User: Extend Studio
 * Date: 3/19/2019
 * Time: 5:35 PM
 */

namespace ColibriWP\Theme\Customizer;


class Formatter {

	public static function sanitizeControlValue( $control_type, $value ) {
		switch ( $control_type ) {
			case 'switch':
				$value = ! ! intval( $value );
				break;
		}

		return $value;
	}
}
src/Customizer/Sections/ColibriSection.php000064400000007421151335104360014714 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Sections;


use ColibriWP\Theme\Translations;
use WP_Customize_Section;

class ColibriSection extends WP_Customize_Section {
    public $type = 'colibri_section';

    protected $hidden = false;

    protected function render_template() {
        ?>
        <li id="accordion-section-{{ data.id }}"
            class="accordion-section control-section control-section-{{ data.type }}">
            <h3 class="accordion-section-title" tabindex="0">
                {{ data.title }}
                <span class="screen-reader-text"><?php Translations::escHtmlE( "press_enter_to_open_section" ); ?></span>
            </h3>
            <ul class="accordion-section-content">
                <li class="customize-section-description-container section-meta <# if ( data.description_hidden ) { #>customize-info<# } #>">
                    <div class="customize-section-title">
                        <button class="customize-section-back" tabindex="-1">
                            <span class="screen-reader-text"><?php Translations::escHtmlE( "back" ); ?></span>
                        </button>
                        <h3>
							<span class="customize-action">
								{{{ data.customizeAction }}}
							</span>
                            {{ data.title }}
                        </h3>
                        <# if ( data.description && data.description_hidden ) { #>
                        <button type="button" class="customize-help-toggle dashicons dashicons-editor-help"
                                aria-expanded="false"><span
                                    class="screen-reader-text"><?php Translations::escHtmlE( "help" ); ?></span>
                        </button>
                        <div class="description customize-section-description">
                            {{{ data.description }}}
                        </div>
                        <# } #>

                        <div class="customize-control-notifications-container"></div>
                    </div>

                    <# if ( data.description && ! data.description_hidden ) { #>
                    <div class="description customize-section-description">
                        {{{ data.description }}}
                    </div>
                    <# } #>
                </li>
                <li class="colibri-section-tabs-section customize-control">
                    <div role="tablist" class="tabs-nav">
                        <div role="tab" data-tab-name="content" class="tab-item active"
                             title="<?php Translations::escAttrE( 'content' ); ?>">
                            <span class="dashicons dashicons-edit"></span>
                            <span class="tab-label"><?php Translations::escHtmlE( 'content' ); ?></span>
                        </div>
                        <div role="tab" data-tab-name="style" class="tab-item"
                             title="<?php Translations::escAttrE( 'style' ); ?>">
                            <span class="dashicons dashicons-admin-customizer"></span>
                            <span class="tab-label"><?php Translations::escHtmlE( 'style' ); ?></span>
                        </div>
                        <div role="tab" data-tab-name="layout" class="tab-item"
                             title="<?php Translations::escAttrE( 'advanced' ); ?>">
                            <span class="dashicons dashicons-admin-generic"></span>
                            <span class="tab-label"><?php Translations::escHtmlE( 'advanced' ); ?></span>
                        </div>
                    </div>
                </li>
            </ul>
        </li>
        <?php
    }

    public function json() {
        $json           = parent::json();
        $json['hidden'] = $this->hidden;

        return $json;
    }
}
src/Customizer/Controls/SliderControl.php000064400000002515151335104360014602 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;

class SliderControl extends VueControl {
    public $type = 'colibri-slider';

    public static function sanitize( $value, $control_data, $default = '' ) {
        $to_float = ( Utils::pathGet( $control_data, 'step', 1 ) < 0 );

        if ( $to_float ) {
            return floatval( $value );
        }

        return intval( $value );

    }

    protected function printVueContent() {
        ?>
        <div class="inline-elements-container">
            <div class="inline-element">
                <el-slider
                        v-model="value"
                        :min="min"
                        :max="max"
                        :step="step"
                        @change="setValue"
                >
                </el-slider>
            </div>
            <div class="inline-element fit">
                <el-input-number
                        size="small"
                        v-model="value"
                        :min="min"
                        :max="max"
                        :step="step"
                        @keyup.native="keyUp"
                        @change="setValue"
                        controls-position="right">
                </el-input-number>
            </div>
        </div>
        <?php
    }
}
src/Customizer/Controls/ImageControl.php000064400000000267151335104360014404 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use WP_Customize_Image_Control;

class ImageControl extends WP_Customize_Image_Control {

    use ColibriWPControlsAdapter;
}
src/Customizer/Controls/IconControl.php000064400000001162151335104360014245 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


class IconControl extends VueControl {

    public $type = "colibri-icon";

    public static function sanitize( $value, $control_data, $default = '' ) {

        $keys = array( 'name', 'content' );
        $diff = array_diff( array_keys( $value ), $keys );
        if ( is_array( $value ) && count( $diff ) === 0 ) {

        }

        return array(
            'content' => '',
            'name'    => ''
        );
    }

    protected function printVueContent() {
        ?>
        <icon-picker :value="value" :icons="icons"></icon-picker>
        <?php
    }
}
src/Customizer/Controls/ButtonGroupControl.php000064400000004011151335104360015641 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Translations;
use WP_Customize_Manager;

class ButtonGroupControl extends VueControl {

    public $type = 'colibri-button-group';

    public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
        parent::__construct( $manager, $id, $args );
    }

    public static function sanitize( $value, $control_data, $default = '' ) {
        $list_value = Utils::sanitizeSelectControl( $control_data, $value );
        $none_value = Utils::pathGet( $control_data, 'none_value', null );

        if ( ! $list_value && $none_value !== null && $none_value === $value ) {
            $list_value = $none_value;
        }


        return $list_value;
    }

    /**
     * @return bool|mixed
     */
    public function getNoneValue() {
        return $this->getParam( 'none_value' );
    }

    protected function content_template() {
        $this->printVueMountPoint();

        ?>
        <div class="customize-control-notifications-container"></div>
        <?php
    }

    protected function printVueContent() {
        ?>
        <div class="colibri-fullwidth">
            <div class="inline-elements-container">
                <div class="inline-element">
                    <# if ( data.label ) { #>
                    <span class="customize-control-title">{{{ data.label }}}</span>
                    <# } #>
                </div>

                <div class="inline-element fit">
                    <# if ( data.none_value ) { #>
                    <el-button @click="noneClicked"
                               type="text"><?php Translations::escHtmlE( 'none' ); ?></el-button>
                    <# } #>
                </div>
            </div>
            <colibri-group-control
                    :items="options"
                    :value="value"
                    :size="size"
                    @change="handleButtonClicked"></colibri-group-control>
        </div>
        <?php
    }
}
src/Customizer/Controls/VueControl.php000064400000004247151335104360014123 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;

abstract class VueControl extends ColibriControl {

    protected $inline_content_template = false;

    final protected function printVueMountPoint() {
        ?>
        <div class="sidebar-container" data-name="vue-mount-point">
            <?php $this->printVueContent(); ?>
        </div>
        <?php
    }

    public function json() {
        $json                            = parent::json();
        $json['inline_content_template'] = $this->getParam(
            'inline_content_template',
            false
        );

        return $json;
    }

    protected function content_template() {
        ?>
        <# if(data.inline_content_template) { #>
        <?php $this->printInlineContentTemplate(); ?>
        <# } else { #>
        <?php $this->printDefaultContentTemplate(); ?>
        <# } #>

        <div class="customize-control-notifications-container"></div>
        <?php
    }


    protected function printInlineContentTemplate() {
        ?>
        <div class="inline-elements-container">
            <div class="inline-element">
                <# if ( data.label ) { #>
                <span class="customize-control-title">{{{ data.label }}}</span>
                <# } #>
            </div>
            <div class="inline-element fit">
                <?php $this->printVueMountPoint(); ?>
            </div>
        </div>

        <# if ( data.description ) { #>
        <span class="description customize-control-description">{{{ data.description }}}</span>
        <# } #>
        <?php
    }

    protected function printDefaultContentTemplate() {
        ?>

        <# if ( data.label ) { #>
        <span class="customize-control-title">{{{ data.label }}}</span>
        <# } #>
        <div>
            <?php $this->printVueMountPoint(); ?>
        </div>


        <# if ( data.description ) { #>
        <span class="description customize-control-description">{{{ data.description }}}</span>
        <# } #>
        <?php
    }

    abstract protected function printVueContent();

    protected function vueEcho( $to_echo ) {
        echo '${ ' . $to_echo . ' }';
    }

    protected function render() {
    }
}
src/Customizer/Controls/AlignButtonGroupControl.php000064400000012000151335104360016611 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Translations;
use WP_Customize_Manager;

class AlignButtonGroupControl extends ButtonGroupControl {

    public $type = 'colibri-align-button-group';

    public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
        parent::__construct( $manager, $id, $args );
    }

    public static function sanitize( $value, $control_data, $default = '' ) {
        if ( in_array( $value, array( 'left', 'center', 'right' ) ) ) {
            return $value;
        }

        return 'left';
    }

    /**
     * @return bool|mixed
     */
    public function getNoneValue() {
        return $this->getParam( 'none_value' );
    }

    protected function content_template() {
        $this->printVueMountPoint();

        ?>
        <div class="customize-control-notifications-container"></div>
        <?php
    }

    protected function printVueContent() {
        ?>
        <div class="colibri-fullwidth">
            <div class="inline-elements-container">
                <div class="inline-element">
                    <# if ( data.label ) { #>
                    <span class="customize-control-title">{{{ data.label }}}</span>
                    <# } #>
                </div>

                <div class="inline-element fit">
                    <# if ( data.none_value ) { #>
                    <el-button @click="noneClicked"
                               type="text"><?php Translations::escHtmlE( 'none' ); ?></el-button>
                    <# } #>
                </div>
            </div>

            <el-button-group class="colibri-select-buttons-container">
                <div class="h-row no-gutters">

                    <el-button :is-selected="buttonIsSelected(values['left'])" :class="classes(values['left'])"
                               v-if="values['left']" @click="handleButtonClicked(values['left'])">
                           <span>
                            <svg version="1.1" viewBox="0 0 448 512" class="svg-icon svg-fill"
                                 style="width: 14px; height: 14px;">
                                <path v-html="rawHtml" pid="0"
                                      d="M288 44v40c0 8.837-7.163 16-16 16H16c-8.837 0-16-7.163-16-16V44c0-8.837 7.163-16 16-16h256c8.837 0 16 7.163 16 16zM0 172v40c0 8.837 7.163 16 16 16h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16zm16 312h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm256-200H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16h256c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16z">
                                </path>
                            </svg>
                           </span>
                    </el-button>

                    <el-button :is-selected="buttonIsSelected(values['center'])" :class="classes(values['center'])"
                               v-if="values['center']" @click="handleButtonClicked(values['center'])">
                        <span>
                        <svg version="1.1" viewBox="0 0 448 512" class="svg-icon svg-fill"
                             style="width: 14px; height: 14px;">
                            <path v-html="rawHtml"
                                  d="M352 44v40c0 8.837-7.163 16-16 16H112c-8.837 0-16-7.163-16-16V44c0-8.837 7.163-16 16-16h224c8.837 0 16 7.163 16 16zM16 228h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 256h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm320-200H112c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16h224c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16z">
                            </path>
                        </svg>
                        </span>
                    </el-button>

                    <el-button :is-selected="buttonIsSelected(values['right'])" :class="classes(values['right'])"
                               v-if="values['right']" @click="handleButtonClicked(values['right'])">
                        <span>
                        <svg version="1.1" viewBox="0 0 448 512" class="svg-icon svg-fill"
                             style="width: 14px; height: 14px;">
                            <path v-html="rawHtml"
                                  d="M160 84V44c0-8.837 7.163-16 16-16h256c8.837 0 16 7.163 16 16v40c0 8.837-7.163 16-16 16H176c-8.837 0-16-7.163-16-16zM16 228h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 256h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm160-128h256c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H176c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z">
                            </path>
                        </svg>
                        </span>
                    </el-button>

                </div>
            </el-button-group>
        </div>
        <?php
    }
}
src/Customizer/Controls/ColibriControl.php000064400000006054151335104360014745 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Translations;
use WP_Customize_Control;
use WP_Customize_Manager;
use WP_Error;

class ColibriControl extends WP_Customize_Control {

    const DEFAULT_COLIBRI_TAB = 'content';
    const STYLE_COLIBRI_TAB = 'style';

    protected $colibri_tab = self::DEFAULT_COLIBRI_TAB;
    protected $default = '';

    private $extra_json_params = array();

    public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
        parent::__construct( $manager, $id, $args );

        $exclude_keys = array_merge(
            array_keys( get_object_vars( $this ) ),
            array(
                "transport",
                "colibri_selective_refresh_key",
                "colibri_selective_refresh_class",
                "css_output",
            )
        );


        $args_keys         = array_keys( $args );
        $extra_json_params = array_diff( $args_keys, $exclude_keys );

        foreach ( $extra_json_params as $param ) {
            $this->extra_json_params[ $param ] = $args[ $param ];
        }

    }

    /**
     * Default sanitization function for Colibri Controls.
     * This is added to force a sanitization implementation for each Colibri Control
     *
     * @param $value
     * @param $control_data
     *
     * @param string $default
     *
     * @return mixed
     */
    public static function sanitize( $value, $control_data, $default = '' ) {
        return new WP_Error( 'colibri_undefined_sanitize_function_for_control',
            Translations::get( 'undefined_sanitize_function_for_control', array( $control_data['type'] ) ) );
    }

    public function json() {
        $json      = parent::json();
        $json_data = $this->extra_json_params;

        $json['choices']     = $this->choices;
        $json['colibri_tab'] = $this->colibri_tab;

        return array_merge( $json, $json_data );
    }

    protected function hasParam( $name, $in_extra = true ) {
        if ( property_exists( $this, $name ) ) {
            return true;
        }

        if ( $in_extra && array_key_exists( $name, $this->extra_json_params ) ) {
            return true;
        }

        return false;
    }

    protected function getParam( $name, $default = null, $in_extra = true ) {
        if ( property_exists( $this, $name ) ) {
            return $this->{$name};
        }

        if ( $in_extra && array_key_exists( $name, $this->getExtraJsonParams() ) ) {
            return $this->getExtraJsonParams()[ $name ];
        }

        return null;
    }

    /**
     * @return array
     */
    public function getExtraJsonParams() {
        return $this->extra_json_params;
    }

    protected function getProps( $props = array() ) {
        $props = is_array( $props ) ? $props : array( $props );
        $props = array_flip( $props );

        foreach ( $props as $key => $prop ) {
            $props[ $key ] = null;

            if ( property_exists( $this, $key ) ) {
                $props[ $key ] = $this->$key;
            }
        }

        return $props;
    }
}
src/Customizer/Controls/SpacingControl.php000064400000004104151335104360014740 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


class SpacingControl extends VueControl {

    public $type = "colibri-spacing";

    public static function sanitize( $value, $control_data, $default = '' ) {
        //@TODO proper sanitization
        return $value;
    }

    protected function content_template() {
        $this->printVueMountPoint();

        ?>
        <div class="customize-control-notifications-container"></div>
        <?php
    }

    protected function printVueContent() {
        ?>
        <div class="colibri-fullwidth">

            <div class="inline-elements-container">
                <div class="inline-element">
                    <# if ( data.label ) { #>
                    <span class="customize-control-title">{{{ data.label }}}</span>
                    <# } #>
                </div>

                <div class="inline-element fit">
                    <el-radio-group v-model="value.unit">
                        <el-radio-button
                                v-for="u in spacing_units"
                                size="mini"
                                :label="u.label"
                                :key="u.unit"
                        >
                        </el-radio-button>
                    </el-radio-group>
                </div>
            </div>

            <div class="colibri-fullwidth">
                <div class="inline-elements-container">

                    <div class="side" v-for="(side_value,side) in value.sides" class="inline-element" :key="side">
                        <div class="side-inner">
                            <label class="side-label"><?php $this->vueEcho( "label(side)" ); ?></label>
                            <el-input-number
                                    controls-position="right"
                                    placeholder=""

                                    v-model="value.sides[side]">
                            </el-input-number>
                        </div>
                    </div>

                </div>
            </div>

        </div>
        <?php
    }
}
src/Customizer/Controls/RepeaterControl.php000064400000004001151335104360015117 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Translations;

class RepeaterControl extends VueControl {

    public $type = 'colibri-repeater';
    private $fields = array();


    public static function sanitize( $value, $control_data, $default = '' ) {
        return Utils::sanitizeEscapedJSON( $value );
    }


    protected function printVueContent() {
        ?>

        <div class="colibri-fullwidth">
            <div class="colibri-fullwidth">
                <el-collapse v-sortable-el-accordion="onSortEnd">

                    <el-collapse-item v-for="(item,index) in items" :name="index" :key="item.index">

                        <template slot="title">
                            <?php $this->vueEcho( "itemsLabels[index]" ); ?>
                        </template>

                        <ul class="field-data">
                            <li v-for="(field,name) in fields" :key="name">
                                <label class="field-label"><?php $this->vueEcho( "field.label" ); ?></label>
                                <div class="component-holder"
                                     :is="getComponentType(field.type)"
                                     :value="item[name]"
                                     v-bind="field.props"
                                     @change="propChanged($event,item,name)"></div>
                            </li>
                        </ul>

                        <el-button class="el-button--danger" type="text" v-show="canRemoveItem"
                                   @click="removeItem(index)"><?php Translations::escHtmlE( 'remove' ); ?></el-button>

                    </el-collapse-item>

                </el-collapse>
            </div>

            <div class="colibri-fullwidth">
                <el-button size="medium" v-show="canAdd"
                           @click="addItem()"><?php $this->vueEcho( 'item_add_label' ); ?></el-button>
            </div>
        </div>
        <?php
    }

}
src/Customizer/Controls/ButtonControl.php000064400000001556151335104360014637 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


class ButtonControl extends VueControl {

    public $type = 'colibri-button';

    /**
     * @param $value
     * @param $control_data
     * @param string $default
     *
     * @return mixed|null
     */
    public static function sanitize( $value, $control_data, $default = '' ) {
        return '';
    }

    protected function printVueContent() {
        ?>
        <div class="colibri-fullwidth">
            <div class="inline-elements-container">
                <div class="inline-element fit">
                    <# if ( data.label ) { #>
                    <el-button :value="value" @click="onClick"
                               type="default">{{{ data.label }}}
                    </el-button>
                    <# } #>
                </div>
            </div>
        </div>
        <?php
    }
}
src/Customizer/Controls/ControlsGroupControl.php000064400000003323151335104360016176 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use WP_Customize_Manager;

class ControlsGroupControl extends VueControl {
    public $type = "colibri-controls-group";
    protected $inline_content_template = true;
    protected $active_color = "#1989fa";
    protected $inactive_color = "#949596";

    public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {

        if ( isset( $args['default'] ) ) {
            $args['default'] = ! ! intval( $args['default'] );
        }

        parent::__construct( $manager, $id, $args );
    }

    public static function sanitize( $value, $control_data, $default = '' ) {
        return 1;
    }

    public function json() {
        $json        = parent::json();
        $json['key'] = $this->id . "-controls-holder";

        return $json;
    }

    protected function printVueContent() {
        ?>
        <el-switch

                v-if="show_toggle"
                v-model="value"
                active-color="{{ data.active_color }}"
                inactive-color="{{ data.inactive_color }}"
                @change="conditionChanged"
        >
        </el-switch>

        <el-popover
                placement="right"
                width="334"
                trigger="click"
                @show="onShow($event)">
            <div class="holder" data-holder-id="{{ data.key }}">
            </div>

            <el-button
                    class="popover-toggler"
                    :disabled="!value"
                    type="text"
                    @click="togglePopup"
                    slot="reference"
                    icon="el-icon-setting" circle>
            </el-button>


        </el-popover>


        <?php
    }
}
src/Customizer/Controls/SelectIconControl.php000064400000001112151335104360015400 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;

class SelectIconControl extends VueControl {
    public $type = 'colibri-select-icon';

    public static function sanitize( $value, $control_data, $default = '' ) {
        return Utils::sanitizeSelectControl( $control_data, $value );
    }

    protected function printVueContent() {
        ?>

        <select-with-icon
                slot="control"
                :value="value"
                @change="setValue($event)"
                :items="options"
        />

        <?php
    }
}
src/Customizer/Controls/SeparatorControl.php000064400000000556151335104360015323 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;

class SeparatorControl extends VueControl {

    public $type = "colibri-separator";

    public static function sanitize( $value, $control_data, $default = '' ) {
        return '';
    }

    protected function printVueContent() {
        ?>
        <div class="separator">&nbsp;</div>
        <?php
    }
}
src/Customizer/Controls/ComposedControl.php000064400000002500151335104360015123 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;

class ComposedControl extends VueControl {

    public $type = 'colibri-composed';
    private $fields = array();

    public static function sanitize( $value, $control_data, $default = '' ) {
        return Utils::sanitizeEscapedJSON( $value );
    }

    protected function printVueContent() {
        ?>
        <ul class="colibri-fullwidth">
            <li class="customize-control customize-control-colibri-slider"
                v-for="(field, name) in fields" v-bind:class="classControlType">
                <div :class="{ 'inline-elements-container' : field.inline == true}">
                    <div :class="{ 'inline-element' : field.inline == true}">
                        <span class="customize-control-title"><?php $this->vueEcho( "field.label" ); ?></span>
                    </div>

                    <div :class="{ 'inline-element fit' : field.inline == true}">
                        <div
                                :is="getComponentType(field.type)"
                                v-model="value[name]"
                                v-bind="field.props"
                                @change="propChanged($event,field,name)"></div>
                        <div>
            </li>
        </ul>
        <?php
    }

}
src/Customizer/Controls/LinkedSelectControl.php000064400000001471151335104360015726 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Translations;

class LinkedSelectControl extends VueControl {
    public $type = 'colibri-linked-select';

    public static function sanitize( $value, $control_data, $default = '' ) {
        return Utils::sanitizeSelectControl( $control_data, $value );
    }

    protected function printVueContent() {
        ?>
        <el-select v-model="value" :size="size" @change="setValue"
                   placeholder="<?php Translations::escAttrE( 'select' ); ?>">
            <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
            </el-option>
        </el-select>
        <?php
    }
}
src/Customizer/Controls/SelectControl.php000064400000001454151335104360014600 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Translations;

class SelectControl extends VueControl {
    public $type = 'colibri-select';

    public static function sanitize( $value, $control_data, $default = '' ) {
        return Utils::sanitizeSelectControl( $control_data, $value );
    }

    protected function printVueContent() {
        ?>
        <el-select v-model="value" :size="size" @change="setValue"
                   placeholder="<?php Translations::escAttrE( 'select' ); ?>">
            <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
            </el-option>
        </el-select>
        <?php
    }
}
src/Customizer/Controls/MediaControl.php000064400000000266151335104360014400 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use WP_Customize_Media_Control;

class MediaControl extends WP_Customize_Media_Control {
    use ColibriWPControlsAdapter;
}
src/Customizer/Controls/CroppedImageControl.php000064400000000315151335104360015713 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use WP_Customize_Cropped_Image_Control;

class CroppedImageControl extends WP_Customize_Cropped_Image_Control {
    use ColibriWPControlsAdapter;
}
src/Customizer/Controls/InputControl.php000064400000001560151335104360014456 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


class InputControl extends VueControl {

    public $type = "colibri-input";
    protected $input_type = "text";

    public static function sanitize( $value, $control_data, $default = '' ) {
        if ( isset($control_data['input_type']) && $control_data['input_type'] === 'textarea' ) {
            return sanitize_textarea_field( $value );
        }

        return sanitize_text_field( $value );
    }

    public function json() {
        $json = parent::json();

        $json['input_type'] = $this->input_type;

        return $json;
    }

    protected function printVueContent() {
        ?>
        <el-input
                @change="setValue"
                :type="input_type"
                placeholder=""
                v-model="value"
                clearable>
        </el-input>
        <?php
    }
}
src/Customizer/Controls/UploadControl.php000064400000000271151335104360014601 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use WP_Customize_Upload_Control;

class UploadControl extends WP_Customize_Upload_Control {
    use ColibriWPControlsAdapter;
}
src/Customizer/Controls/PluginMessageControl.php000064400000007162151335104360016126 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\PluginsManager;
use ColibriWP\Theme\Translations;

class PluginMessageControl extends VueControl {

    public $type = "colibri-plugin-message";
	public static $slug = null;
    protected function printVueContent() {

        $this->addData();

        ?>
        <div class="plugin-message card">
            <p>
                <?php echo Translations::get( 'plugin_message', 'Colibri Page Builder' ); ?>
            </p>
            <?php if ( colibriwp_theme()->getPluginsManager()->getPluginState( $this->getBuilderSlug() ) === PluginsManager::NOT_INSTALLED_PLUGIN ): ?>
                <button data-colibri-plugin-action="install"
                        class="el-button el-link h-col el-button--primary el-button--small"
                        style="text-decoration: none">
                    <?php echo Translations::get( 'install_with_placeholder', 'Colibri Page Builder' ); ?>
                </button>
            <?php endif; ?>

            <?php if ( colibriwp_theme()->getPluginsManager()->getPluginState( $this->getBuilderSlug() ) === PluginsManager::INSTALLED_PLUGIN ): ?>
                <button data-colibri-plugin-action="activate"
                        class="el-button el-link h-col el-button--primary el-button--small"
                        style="text-decoration: none">
                    <?php echo Translations::get( 'activate_with_placeholder', 'Colibri Page Builder' ); ?>
                </button>
            <?php endif; ?>

            <p class="notice notice-large" data-colibri-plugin-action-message="1" style="display: none"></p>
        </div>
        <?php
    }

	protected function getBuilderSlug() {
		if ( self::$slug ) {
			return self::$slug;
		}
		$builder_plugin    = 'colibri-page-builder';
		$installed_plugins = get_plugins();
		foreach ( $installed_plugins as $key => $plugin_data ) {
			if ( strpos( $key, 'colibri-page-builder-pro' ) !== false ) {
				$builder_plugin = 'colibri-page-builder-pro';
			}
		}
		self::$slug = $builder_plugin;

		return self::$slug;
	}
    public function addData() {

        if ( Hooks::colibri_apply_filters( 'plugin-customizer-controller-data-added', false ) ) {
            return;
        }

        Hooks::colibri_add_filter( 'plugin-customizer-controller-data-added', '__return_true' );

        add_action( 'customize_controls_print_footer_scripts', function () {

            $data = array(
                "status"       => colibriwp_theme()->getPluginsManager()->getPluginState(  $this->getBuilderSlug() ),
                "install_url"  => colibriwp_theme()->getPluginsManager()->getInstallLink(  $this->getBuilderSlug() ),
                "activate_url" => colibriwp_theme()->getPluginsManager()->getActivationLink(  $this->getBuilderSlug() ),
                'colibri_plugin_install_activate_nonce' => wp_create_nonce( 'colibri_plugin_install_activate_nonce' ),
                "messages"     => array(
                    "installing" => Translations::get( 'installing',
                        'Colibri Page Builder' ),
                    "activating" => Translations::get( 'activating',
                        'Colibri Page Builder' )
                ),
                "admin_url"    => add_query_arg( array(
                    'colibri_create_pages'       => '1',
                    'colibri_generator_callback' => 'customizer'
                ), admin_url() ),
            );
            ?>
            <script>
                window.colibriwp_plugin_status = <?php echo json_encode( $data ); ?>;
            </script>
            <?php
        }, PHP_INT_MAX );

    }
}
src/Customizer/Controls/ColorControl.php000064400000004147151335104360014441 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;

class ColorControl extends VueControl {
    public $type = 'colibri-color';
    public $alpha = true;
    protected $inline_content_template = true;

    public static function sanitize( $value, $control_data, $default = '' ) {

        if ( ! is_string( $value ) ) {
            return '#000000';
        }

        $alpha = Utils::pathGet( $control_data, 'alpha', true );
        $value = trim( $value );

        if ( ! $alpha ) {
            if ( strpos( $value, '#' ) === 0 ) {
                return sanitize_hex_color( $value );
            } else {
                if ( strpos( $value, 'rgb(' ) === 0 ) {
                    $color = str_replace( ' ', '', $value );
                    sscanf( $color, 'rgb(%d,%d,%d)', $red, $green, $blue );

                    return 'rgb(' . $red . ',' . $green . ',' . $blue . ')';
                }

                if ( strpos( $value, 'rgba(' ) === 0 ) {
                    $color = str_replace( ' ', '', $value );
                    sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha );
                    return 'rgb(' . $red . ',' . $green . ',' . $blue . ')';
                }
            }

        } else {

            if ( strpos( $value, 'rgba' ) !== 0 ) {
                return '';
            } else {
                $color = str_replace( ' ', '', $value );
                sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha );

                return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')';
            }
        }

    }

    public function json() {
        $json          = parent::json();
        $json['alpha'] = $this->alpha;

        return $json;
    }

    protected function printVueContent() {
        ?>
        <el-color-picker
                v-model="value"
                :size="size"
                :show-alpha="alpha"
                @change="setValue"
                @active-change="activeChange"
        <# (data.alpha == false) ? '': print('show-alpha') #>
        >
        </el-color-picker>
        <?php
    }
}
src/Customizer/Controls/VideoControl.php000064400000000331151335104360014420 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use WP_Customize_Media_Control;

class VideoControl extends WP_Customize_Media_Control {

    use ColibriWPControlsAdapter;

    public $mime_type = 'video';
}
src/Customizer/Controls/GradientControl.php000064400000001357151335104360015120 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


use ColibriWP\Theme\Core\Utils;

class GradientControl extends VueControl {

    public $type = 'colibri-gradient';

    public static function sanitize( $value, $control_data, $default = '' ) {
        return Utils::sanitizeEscapedJSON( $value );
    }

    protected function printVueContent() {
        ?>
        <ul class="gradients-list inline-elements-container">
            <li :class="[(gradient.name == value.name)?'selected':'']" class="inline-element"
                v-for="gradient in gradients"
                @click="setValue(gradient)">
                <div class="web-gradient" :style="computeGradient(gradient)"></div>
            </li>
        </ul>
        <?php
    }
}
src/Customizer/Controls/PenControl.php000064400000000351151335104360014076 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


class PenControl extends ColibriControl {

	public $type = 'colibri-pen';

	protected function content_template() {
		?>
        <div class="control-focus"></div>
		<?php
	}
}
src/Customizer/Controls/ColibriWPControlsAdapter.php000064400000000626151335104360016677 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;


trait ColibriWPControlsAdapter {

	protected $colibri_tab  = ColibriControl::DEFAULT_COLIBRI_TAB;
	protected $default      = '';
	protected $active_rules = array();

	public function json() {
		$json                 = parent::json();
		$json['colibri_tab']  = $this->colibri_tab;
		$json['active_rules'] = $this->active_rules;

		return $json;
	}
}
src/Customizer/Controls/SwitchControl.php000064400000001525151335104360014621 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Controls;

class SwitchControl extends VueControl {
	public $type = 'colibri-switch';

	protected $active_color = "#008ec2";
	protected $inactive_color = "#949596";
	protected $inline_content_template = true;

	public function json() {
		return array_merge( parent::json(), $this->getProps( array( 'active_color', 'inactive_color' ) ) );
	}

	protected function printVueContent() {
		?>
        <el-switch
                v-model="value"
                active-color="{{ data.active_color }}"
                inactive-color="{{ data.inactive_color }}"
                @change="setValue"
        >
        </el-switch>
		<?php
	}

	public static function sanitize( $value, $control_data, $default = '' ) {
		if ( $value === true || $value === '1' || $value === 1 ) {
			return true;
		}

		return false;
	}
}
src/Customizer/Panel/ColibriPanel.php000064400000003035151335104360013614 0ustar00<?php


namespace ColibriWP\Theme\Customizer\Panel;


use ColibriWP\Theme\Translations;
use WP_Customize_Panel;

class ColibriPanel extends WP_Customize_Panel {
    public $type = 'colibri_panel';

    public $footer_buttons = array();

    protected function content_template() {
        ?>
        <li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
            <button class="customize-panel-back" tabindex="-1"><span
                        class="screen-reader-text"><?php Translations::escHtmlE( 'back' ); ?></span></button>
            <div class="accordion-section-title">
				<span class="preview-notice">
					<strong class="panel-title">{{ data.title }}</strong>
                </span>
                <# if ( data.description ) { #>
                <button type="button" class="customize-help-toggle dashicons dashicons-editor-help"
                        aria-expanded="false"><span
                            class="screen-reader-text"><?php Translations::escHtmlE( 'help' ); ?></span></button>
                <# } #>
            </div>
            <# if ( data.description ) { #>
            <div class="description customize-panel-description">
                {{{ data.description }}}
            </div>
            <# } #>

            <div class="customize-control-notifications-container"></div>
        </li>
        <?php
    }

    public function json() {
        $json = parent::json();

        $json['footer_buttons'] = $this->footer_buttons;

        return $json;
    }
}
src/ActiveCallback.php000064400000007376151335104360010712 0ustar00<?php


namespace ColibriWP\Theme;


use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Core\ConfigurableInterface;
use Exception;

class ActiveCallback {

    private $rules = array();
    private $component = null;


    private function getSettingValue( $setting ) {
        global $wp_customize;

        $value = "";

        if ( $wp_customize ) {
            if ( $wp_customize->get_setting( $setting ) ) {
                $value = $wp_customize->get_setting( $setting )->value();
            }
        } else {

            $default = false;
            if ( $this->component ) {
                /** @var ConfigurableInterface $component */
                $component = $this->component;
                $default   = $component::settingDefault( $setting );
            }

            $value = get_theme_mod( $setting, $default );


        }

        return ComponentBase::mabyDeserializeModValue( $value );
    }

    /**
     * @param $rule
     *
     * @return bool
     * @throws Exception
     */
    private function checkRule( $rule ) {
        $result = true;

        if ( ! is_array( $rule ) ) {
            throw new Exception( 'Invalid active callback rule' );
        }

        $rule = array_merge(
            array(
                "setting"  => "",
                "operator" => "=",
                "value"    => true,
            ),
            $rule
        );

        if ( empty( $rule['setting'] ) ) {
            return true;
        }

        $value         = $rule['value'];
        $setting_value = $this->getSettingValue( $rule['setting'] );

        switch ( $rule['operator'] ) {
            case "=":
            case "==":
                $result = ( $setting_value == $value );
                break;

            case "!=":
                $result = ( $setting_value != $value );
                break;

            case "===":
                $result = ( $setting_value === $value );
                break;

            case "!==":
                $result = ( $setting_value !== $value );
                break;
            /* greater */
            case ">":
                $result = ( $setting_value > $value );
                break;
            case ">=":
                $result = ( $setting_value >= $value );
                break;
            /* lower than */
            case "<":
                $result = ( $setting_value < $value );
                break;
            case "<=":
                $result = ( $setting_value <= $value );
                break;

            case "in":

                if ( is_array( $setting_value ) ) {
                    $result = in_array( $value, $setting_value );
                } else {
                    if ( is_array( $value ) ) {
                        $result = in_array( $setting_value, $value );
                    } else {
                        $result = false;
                    }
                }

                break;

        }

        return $result;
    }


    /**
     * @return bool
     * @throws Exception
     */
    public function applyRules() {
        $result = true;

        foreach ( (array) $this->rules as $rule ) {
            try {
                if ( ! $this->checkRule( $rule ) ) {
                    $result = false;
                    break;
                }
            } catch ( Exception $e ) {
                throw $e;
            }
        }

        return $result;
    }

    /**
     * @param array $rules
     *
     * @return ActiveCallback
     */
    public function setRules( $rules ) {
        $this->rules = $rules;

        return $this;
    }

    /**
     * @param ConfigurableInterface $component
     *
     * @return ActiveCallback
     */
    public function setComponent( $component ) {
        $this->component = $component;

        return $this;
    }

}
src/Core/ComponentBase.php000064400000016744151335104360011506 0ustar00<?php


namespace ColibriWP\Theme\Core;


use ColibriWP\Theme\Components\CSSOutput;
use ColibriWP\Theme\Theme;
use function get_theme_mod;

abstract class ComponentBase implements ConfigurableInterface, PartialComponentInterface {

    const PEN_ON_LEFT = "left";
    const PEN_ON_RIGHT = "right";

    protected static $selective_refresh_container_inclusive = true;

    public static function selectiveRefreshKey() {
        return Utils::slugify( static::class );
    }

    public static function options() {

        $options = array_replace(
            array(
                "settings" => array(),
                "sections" => array(),
                "panels"   => array(),
            ),
            (array) static::getOptions()
        );

        foreach ( array_keys( $options['settings'] ) as $id ) {

            if ( ! array_key_exists( 'css_output', $options['settings'][ $id ] ) ) {
                continue;
            }


            if ( is_array( $options['settings'][ $id ]['css_output'] ) ) {

                foreach ( $options['settings'][ $id ]['css_output'] as $index => $css_output ) {
                    $options['settings'][ $id ]['css_output'][ $index ] = CSSOutput::normalizeOutput( $css_output );
                }

            }
        }

        $__class__ = static::class;

        Theme::getInstance()->getCustomizer()->isCustomizer(
            function () use ( &$options, $__class__ ) {
                foreach ( array_keys( $options['settings'] ) as $id ) {

                    $has_control = isset( $options['settings'][ $id ]['control'] ) ? true : false;
                    $has_control = $has_control && is_array( $options['settings'][ $id ]['control'] );

                    if ( $has_control ) {

                        if ( array_key_exists( 'selective_refresh', $options['settings'][ $id ]['control'] ) ) {
                            $selective_refresh = $options['settings'][ $id ]['control']['selective_refresh'];

                            if ( $selective_refresh === false ) {
                                continue;
                            }


                            unset( $options['settings'][ $id ]['control']['selective_refresh'] );

                            if ( array_key_exists( 'selector', $selective_refresh ) ) {
                                $options['settings'][ $id ]['control']['colibri_selective_refresh_selector']
                                    = $selective_refresh['selector'];
                            }

                            if ( array_key_exists( 'function', $selective_refresh ) ) {
                                $options['settings'][ $id ]['control']['colibri_selective_refresh_function']
                                    = $selective_refresh['function'];
                            }

                        } else {
                            $options['settings'][ $id ]['control']['colibri_selective_refresh_selector']
                                = static::selectiveRefreshSelector();

                        }

                        $options['settings'][ $id ]['control']['colibri_selective_refresh_class']       = $__class__;
                        $options['settings'][ $id ]['control']['selective_refresh_container_inclusive'] = static::$selective_refresh_container_inclusive;
                    }

                }
            }
        );

        return $options;
    }

    protected static abstract function getOptions();

    public static function selectiveRefreshSelector() {
        return false;
    }

    public function mod_e_esc_attr( $name ) {
        echo esc_attr( $this->mod( $name ) );
    }

    /**
     * @param      $name
     * @param null $fallback
     *
     * @return mixed
     */
    public function mod( $name, $fallback = null ) {
        return static::mabyDeserializeModValue( get_theme_mod( $name, static::settingDefault( $name, $fallback ) ) );
    }

    public static function mabyDeserializeModValue( $value ) {

        if ( is_string( $value ) ) {

            if ( empty( trim( $value ) ) ) {
                return $value;
            }

            $new_value = json_decode( urldecode( $value ), true );

            if ( json_last_error() === JSON_ERROR_NONE ) {
                $value = $new_value;
            }

        }

        return $value;
    }

    /**
     * @param      $name
     * @param null $fallback
     *
     * @return null
     */
    public static function settingDefault( $name, $fallback = null ) {
        $options = (array) static::getOptions();

        $default = $fallback;

        if ( isset( $options['settings'] ) && isset( $options['settings'][ $name ] ) ) {
            if ( array_key_exists( 'default', $options['settings'][ $name ] ) ) {
                $default = $options['settings'][ $name ]['default'];
            }

        }

        return $default;
    }

    /**
     * @return array
     */
    public function mods() {
        $result   = array();
        $settings = array_key_exists( 'settings', static::getOptions() ) ? static::getOptions()['settings'] : array();

        foreach ( array( $settings ) as $key => $value ) {
            $result[ $key ] = $this->mod( $key );
        }

        return $result;
    }

    public function render( $parameters = array() ) {

        $that = $this;

        Theme::getInstance()->getCustomizer()->inPreview(
            function () use ( $that ) {
                $that->addControlsFilter();
                $that->whenCustomizerPreview();
                $that->prinPenPosition();
            }
        );

        $this->renderContent( $parameters );
    }

    /**
     * @return array();
     */
    /** @noinspection PhpAbstractStaticMethodInspection */
    private function addControlsFilter() {

        $options = (array) static::getOptions();

        if ( isset( $options['settings'] ) ) {
            $options = array_keys( $options['settings'] );

        } else {
            $options = array();
        }

        foreach ( $options as $option ) {

            Hooks::colibri_add_filter(
                "control_{$option}_rendered",
                function ( $value ) {
                    return true;
                },
                0,
                1
            );
        }

    }

    public function whenCustomizerPreview() {


    }

    private function prinPenPosition() {
        if ( $this->getPenPosition() === static::PEN_ON_RIGHT ) {
            $class = static::class;
            add_action( 'wp_footer',
                function () use ( $class ) {
                    $selector = call_user_func( array( $class, 'selectiveRefreshSelector' ) );
                    if ( $selector ) {
                        ?>
                        <style>
                            @media (min-width: 768px) {
                            <?php echo $selector; ?> > .customize-partial-edit-shortcut {
                                left: unset !important;
                                right: -30px !important;
                            }
                            }
                        </style>
                        <?php
                    }
                }
            );
        }
    }

    public function getPenPosition() {
        return static::PEN_ON_LEFT;
    }

    public abstract function renderContent();

    protected function addFrontendJSData( $key, $value ) {
        Hooks::add_filter(
            'frontend_js_data',
            function ( $current_data ) use ( $key, $value ) {
                $current_data[ $key ] = $value;

                return $current_data;
            }
        );

    }

}
src/Core/ComponentInterface.php000064400000000153151335104360012517 0ustar00<?php


namespace ColibriWP\Theme\Core;


interface ComponentInterface {

    public function render();

}
src/Core/PartialComponent.php000064400000004530151335104360012216 0ustar00<?php


namespace ColibriWP\Theme\Core;


use ColibriWP\Theme\Theme;
use function get_theme_mod;

abstract class PartialComponent implements PartialComponentInterface {


    public function mod( $name ) {

        return ComponentBase::mabyDeserializeModValue( get_theme_mod( $name, $this->settingDefault( $name ) ) );
    }

    public function settingDefault( $name ) {
        $options = (array) $this->getOptions();
        $default = null;

        if ( isset( $options['settings'] ) && isset( $options['settings'][ $name ] ) ) {
            if ( array_key_exists( 'default', $options['settings'][ $name ] ) ) {
                $default = $options['settings'][ $name ]['default'];
            }
        }

        return $default;
    }

    private function addControlsFilter() {

        $options = (array) static::getOptions();

        if ( isset( $options['settings'] ) ) {
            $options = array_keys( $options['settings'] );

        } else {
            $options = array();
        }

        foreach ( $options as $option ) {
            Hooks::colibri_add_filter(
                "control_{$option}_rendered",
                function ( $value ) {
                    return true;
                }
            );
        }

    }

    public function whenCustomizerPreview() {

    }


    public function render() {
        $that = $this;

        Theme::getInstance()->getCustomizer()->inPreview(
            function () use ( $that ) {
                $that->addControlsFilter();
                $that->whenCustomizerPreview();
            }
        );

        $this->renderContent();
    }

    protected function addFrontendJSData( $key, $value, $in_preview = false ) {


        if ( $in_preview ) {
            $self = $this;
            Theme::getInstance()->getCustomizer()->inPreview( function () use ( $self, $key, $value ) {
                $self->addJSData( $key, $value );
            } );
        } else {
            $this->addJSData( $key, $value );
        }

    }

    private function addJSData( $key, $value ) {
        Hooks::add_filter(
            'frontend_js_data',
            function ( $current_data ) use ( $key, $value ) {
                $current_data[ $key ] = $value;

                return $current_data;
            }
        );
    }

    public abstract function getOptions();

    public abstract function renderContent();


}
src/Core/Utils.php000064400000013107151335104360010037 0ustar00<?php


namespace ColibriWP\Theme\Core;


class Utils {

    public static function camel2dashed( $string ) {
        return strtolower( preg_replace( '/([a-zA-Z])(?=[A-Z])/', '$1-', $string ) );
    }

    public static function replace_file_extension( $filename, $old_extenstion, $new_extension ) {

        return preg_replace( '#\\' . $old_extenstion . '$#', $new_extension, $filename );
    }

    public static function pathSet( &$data, $path, $value ) {
        if ( ! is_array( $path ) ) {
            $path = preg_replace( "#\.\.+#", '.', $path );
            $path = explode( ".", (string) $path );
        }

        $ref = &$data;

        foreach ( $path as $parent ) {
            if ( isset( $ref ) && ! is_array( $ref ) ) {
                $ref = array();
            }

            $ref = &$ref[ $parent ];
        }

        $ref = $value;

        return $data;
    }

    public static function recursiveOnly( $from, $except ) {

        foreach ( $from as $key => $value ) {
            if ( ! in_array( $key, $except ) ) {
                unset( $from[ $key ] );
            } else {
                if ( is_array( $value ) ) {
                    $from[ $key ] = static::recursiveOnly( $value, $except );
                }
            }
        }

        return $from;
    }

    public static function recursiveWithout( $from, $except ) {

        foreach ( $from as $key => $value ) {
            if ( in_array( $key, $except ) ) {
                unset( $from[ $key ] );
            } else {
                if ( is_array( $value ) ) {
                    $from[ $key ] = static::recursiveWithout( $value, $except );
                }
            }
        }

        return $from;
    }

    public static function arrayGetAt( $array, $index = 0, $fallback = false ) {
        return Utils::pathGet( $array, (string) $index, $fallback );
    }


    /**
     * @param $data
     * @param string|null $path
     * @param string|null $fallback
     *
     * @return mixed|null
     */
    public static function pathGet( $data, $path = null, $fallback = null ) {

        if ( strlen( $path ) === 0 || $path === null ) {
            return $data;
        }

        $path = preg_replace( "#\.\.+#", '.', $path );

        $result = $data;

        $path = explode( ".", $path );

        if ( count( $path ) ) {
            foreach ( $path as $key ) {

                if ( ! isset( $result[ $key ] ) ) {
                    $result = $fallback;
                    break;
                }

                $result = $result[ $key ];
            }
        }

        return $result;

    }

    public static function flatten( $array, $prefix = '' ) {
        $return = array();

        foreach ( $array as $key => $value ) {
            $key = trim( "{$prefix}.{$key}", '.' );
            if ( ! is_array( $value ) ) {
                $return[ $key ] = $value;
            } else {
                $return = array_merge( $return, static::flatten( $value, $key ) );
            }
        }

        return $return;
    }

    public static function slugify( $text ) {
        // replace non letter or digits by -
        $text = preg_replace( '~[^\pL\d]+~u', '-', $text );

        // transliterate
        $text = iconv( 'utf-8', 'us-ascii//TRANSLIT', $text );

        // remove unwanted characters
        $text = preg_replace( '~[^-\w]+~', '', $text );

        // trim
        $text = trim( $text, '-' );

        // remove duplicate -
        $text = preg_replace( '~-+~', '-', $text );

        // lowercase
        $text = strtolower( $text );

        if ( empty( $text ) ) {
            return 'n-a';
        }

        return $text;
    }

    public static function buffer_wrap( $callback, $strip_tags = false ) {
        ob_start();
        call_user_func( $callback );
        $content = ob_get_clean();

        if ( $strip_tags ) {
            $content = strip_tags( $content );
        }

        return $content;
    }


    /**
     * @param array $array
     * @param array|string $key
     *
     * @return array
     */
    public static function pathDelete( $array, $key ) {
        $keys = ( array ) $key;

        foreach ( $keys as $key ) {
            $key_parts = explode( ".", $key );
            $ref       = &$array;

            while ( count( $key_parts ) ) {
                $key_part = array_shift( $key_parts );
                if ( array_key_exists( $key_part, $ref ) ) {

                    if ( count( $key_parts ) === 0 ) {
                        unset( $ref[ $key_part ] );
                    } else {
                        $ref = &$array[ $key_part ];
                    }
                } else {
                    break;
                }
            }

        }

        return $array;

    }

    public static function sanitizeSelectControl( $control_data, $current_value ) {
        $possible_values = array_keys( Utils::pathGet( $control_data, 'choices', array() ) );

        if ( $linked_to = Utils::pathGet( $control_data, 'linked_to', false ) ) {
            $possible_values = array();
            $values          = Utils::pathGet( $control_data, 'choices', array() );

            foreach ( $values as $linked_values ) {
                $possible_values = $possible_values + array_keys( $linked_values );
            }

            $possible_values = array_unique( $possible_values );
        }

        if ( in_array( $current_value, $possible_values ) ) {
            return $current_value;
        }

        return null;
    }

    public static function sanitizeEscapedJSON( $value ) {
        if ( json_decode( urldecode( $value ) ) ) {
            return $value;
        }

        return null;
    }
}
src/Core/ConfigurableInterface.php000064400000000336151335104360013160 0ustar00<?php


namespace ColibriWP\Theme\Core;


interface ConfigurableInterface {

    public static function options();

    public static function settingDefault( $name );

    public static function selectiveRefreshKey();

}
src/Core/PartialComponentInterface.php000064400000000223151335104360014032 0ustar00<?php


namespace ColibriWP\Theme\Core;


interface PartialComponentInterface extends ComponentInterface {

    public function renderContent();
}
src/Core/Tree.php000064400000003714151335104360007641 0ustar00<?php


namespace ColibriWP\Theme\Core;


class Tree {

    const SEPARATOR = ".";

    private $data;

    public function __construct( $data = array() ) {
        $this->data = $data;
    }

    public function walkFirstLevel( $callback ) {
        $this->walkElementsAt( "", $callback );
    }

    public function walkElementsAt( $path, $callback ) {

        $data = $this->getData();

        if ( ! empty( $path ) ) {
            $data = $this->findAt( $path, array() );
        }

        if ( is_array( $data ) ) {
            foreach ( $data as $key => $item ) {
                call_user_func( $callback, $key, $item );
            }
        }
    }

    /**
     * @return array
     */
    public function getData() {
        return $this->data;
    }

    /**
     * @param array $data
     *
     * @return Tree
     */
    public function setData( $data ) {
        $this->data = $data;

        return $this;
    }

    public function findAt( $path, $default = null ) {
        $path_parts = explode( Tree::SEPARATOR, $path );
        $result     = $this->data;

        if ( $path === '' ) {
            return $result;
        }

        while ( $path_parts ) {
            $part = array_shift( $path_parts );

            if ( $this->entityHasKey( $result, $part ) ) {
                if ( is_array( $result ) ) {
                    $result = $result[ $part ];
                } else {
                    $result = $result->$part;
                }
            } else {
                $result = $default;
                break;
            }
        }

        return $result;
    }

    /**
     * @param $entity
     * @param $key
     *
     * @return bool
     */
    private function entityHasKey( $entity, $key ) {
        if ( is_array( $entity ) && array_key_exists( $key, $entity ) ) {
            return true;
        }

        if ( is_object( $entity ) && property_exists( $entity, $key ) ) {
            return true;
        }

        return false;
    }

}
src/Core/Hooks.php000064400000004534151335104360010026 0ustar00<?php


namespace ColibriWP\Theme\Core;

use function add_action;
use function add_filter;

/**
 * Class Hooks
 * @package ColibriTheme\Core
 *
 * @method static colibri_add_action( string $tag, callable $function_to_add, $priority = 10, $accepted_args = 1 )
 * @method static colibri_add_filter( string $tag, callable $function_to_add, $priority = 10, $accepted_args = 1 )
 * @method static colibri_do_action( string $tag, ...$args )
 * @method static mixed colibri_apply_filters( string $tag, $value, ...$args )
 */
class Hooks {

    const HOOK_PREFIX = "colibriwp_theme_";

    /**
     * @param string $tag
     * @param callable $function_to_add
     * @param int $priority
     * @param int $accepted_args
     */
    public static function add_action( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {
        add_action( $tag, $function_to_add, $priority, $accepted_args );
    }

    /**
     * @param string $tag
     * @param callable $function_to_add
     * @param int $priority
     * @param int $accepted_args
     */
    public static function add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {

        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }

    public static function do_action( $tag, $arg = '' ) {
        return call_user_func_array( 'do_action', func_get_args() );
    }


    /**
     * @param string $tag The name of the filter hook.
     * @param mixed $value The value on which the filters hooked to `$tag` are applied on.
     * @param mixed $var,... Additional variables passed to the functions hooked to `$tag`.
     *
     * @return mixed The filtered value after all hooked functions are applied to it.
     */
    public static function apply_filters( $tag, $value ) {
        return call_user_func_array( 'apply_filters', func_get_args() );
    }

    public static function __callStatic( $name, $arguments ) {
        if ( strpos( $name, "colibri_" ) === 0 ) {
            $name         = str_replace( "colibri_", "", $name );
            $arguments[0] = self::HOOK_PREFIX . $arguments[0];

            return call_user_func_array( array( __CLASS__, $name ), $arguments );
        }
    }


    /**
     * @param $data
     *
     * @return \Closure
     */
    public static function identity( $data ) {
        return function () use ( $data ) {
            return $data;
        };
    }
}
src/ComponentsRepository.php000064400000003146151335104360012276 0ustar00<?php


namespace ColibriWP\Theme;

use ColibriWP\Theme\Core\ComponentInterface;
use ColibriWP\Theme\Core\Hooks;

class ComponentsRepository {

    private $entities = array();

    public function load() {
        $components = Hooks::colibri_apply_filters( 'components', array() );

        foreach ( $components as $key => $class ) {

            $this->add( $key, $class );
        }
    }


    /**
     * @param $id
     *
     * @return null|ComponentInterface
     */
    private function getInstance( $id ) {

        if ( ! $this->entities[ $id ] ['instance'] ) {
            $class = $this->entities[ $id ]['class'];

            $this->entities[ $id ] = array(
                'class'    => $this->entities[ $id ]['class'],
                'instance' => new $class,
            );
        }

        return $this->entities[ $id ]['instance'];
    }

    /**
     * @param $id
     *
     * @return ComponentInterface|null
     */
    public function getByName( $id ) {


        if ( array_key_exists( $id, $this->entities ) ) {
            return $this->getInstance( $id );
        }

        return null;
    }


    /**
     * @return array
     */
    public function getAllDefinitions() {
        $result = array();

        foreach ( $this->entities as $key => $entity ) {
            $result[ $key ] = $entity['class'];
        }

        return $result;
    }

    /**
     * @param $component_name
     * @param $class
     */
    public function add( $component_name, $class ) {
        $this->entities[ $component_name ] = array(
            'class'    => $class,
            'instance' => null,
        );
    }
}
src/Translations.php000064400000002773151335104360010537 0ustar00<?php


namespace ColibriWP\Theme;


use ColibriWP\Theme\Core\Hooks;

class Translations {
    private static $texts = array();

    public static function load() {
        $texts = require_once get_template_directory() . "/inc/translations.php";
        static::$texts = Hooks::colibri_apply_filters( 'translations', $texts );
    }

    public static function e( $key, $params = array() ) {
        static::render( $key, $params );
    }

    public static function render( $key, $params = array() ) {
        echo static::get( $key, $params );
    }

    public static function get( $key, $params = array() ) {
        $text = "__[{$key}]__";
        if ( isset( static::$texts[ $key ] ) ) {
            $text = static::$texts[ $key ];
        }
        $params = (array) $params;


        if ( empty( $params ) ) {
            return $text;
        }

        array_unshift( $params, $text );

        return call_user_func_array( 'sprintf', $params );
    }

    public static function escHtmlE( $key, $params = array() ) {
        echo static::escHtml( $key, $params );
    }

    public static function escHtml( $key, $params = array() ) {
        return esc_html( static::get( $key, $params ) );
    }

    public static function escAttrE( $key, $params = array() ) {
        echo esc_attr( static::get( $key, $params ) );
    }

    public static function translate( $key, $params = array() ) {
        return static::get( $key, $params );
    }

    public static function all() {
        return static::$texts;
    }
}
src/PluginsManager.php000064400000020122151335104360010756 0ustar00<?php


namespace ColibriWP\Theme;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Tree;
use TGM_Plugin_Activation;

class PluginsManager {

    const INSTALLED_PLUGIN = "installed";
    const ACTIVE_PLUGIN = "active";
    const NOT_INSTALLED_PLUGIN = "not-installed";

    private $theme = null;
    /** @var Tree $plugins_data */
    private $plugins_data = array();
    private $tgmpa_config = array();

    public function __construct( $theme ) {

        if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
            require_once get_template_directory() . "/inc/class-tgm-plugin-activation.php";
        }
        $this->theme = $theme;
    }

    public function boot() {
        $data               = Hooks::colibri_apply_filters( 'theme_plugins', array() );
        $this->tgmpa_config = Hooks::colibri_apply_filters( 'tgmpa_config', array(
            'id'           => get_template(),
            'default_path' => '',
            'menu'         => 'tgmpa-install-plugins',
            'has_notices'  => false,
            'dismissable'  => true,
            'dismiss_msg'  => '',
            'is_automatic' => false,
            'message'      => '',
        ) );

        foreach ( $data as $slug => $plugin_data ) {
            $data[ $slug ] = $this->normalizePluginData( $plugin_data );
        }

        uasort( $data, function ( $a, $b ) {
            return (
                intval( $a['priority'] ) -
                intval( $b['priority'] )
            );
        } );

        $this->plugins_data = new Tree( $data );

        add_action( 'tgmpa_register', array( $this, 'tgmpaRegitster' ) );

        add_action( 'wp_ajax_colibriwp_install_plugin', function () {
            check_ajax_referer( 'colibri_plugin_install_activate_nonce');
            $slug = isset( $_REQUEST['slug'] ) ? wp_unslash( $_REQUEST['slug'] ) : false;

            if ( ! current_user_can( 'install_plugins', $slug ) ) {
                wp_send_json_error( array( 'error' => 'install_plugin_capability_missing' ) );
            }

            if ( ! function_exists( 'plugins_api' ) ) {
                include_once ABSPATH . 'wp-admin/includes/plugin-install.php';

            }

            if ( $slug && ( $path = $this->getPluginData( "{$slug}.plugin_path" ) ) ) {
                $api = plugins_api(
                    'plugin_information',
                    array(
                        'slug'   => $slug,
                        'fields' => array(
                            'sections' => false,
                        ),
                    )
                );

                if ( is_wp_error( $api ) ) {
                    wp_send_json_error( array( 'error' => 'api_error', 'error_content' => $api ) );
                } else {

                    if ( ! class_exists( 'Plugin_Upgrader' ) ) {
                        /** Plugin_Upgrader class */
                        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
                    }

                    $upgrader = new \Plugin_Upgrader( new \Automatic_Upgrader_Skin() );
                    $result   = $upgrader->install( $api->download_link );

                    if ( $result !== true ) {
                        wp_send_json_error( array( 'error' => 'installation_failed' ) );
                    }


                    $data = apply_filters( 'colibri_page_builder/plugin-installed', array(), $slug,
                        $this->getPluginData( $slug ) );

                    wp_send_json_success( $data );
                }
            }

            wp_send_json_error( array( 'error' => 'not_found' ) );

        } );

        add_action( 'wp_ajax_colibriwp_activate_plugin', function () {
            check_ajax_referer( 'colibri_plugin_install_activate_nonce');
            $slug = isset( $_REQUEST['slug'] ) ? wp_unslash( $_REQUEST['slug'] ) : false;

            if ( ! current_user_can( 'activate_plugin', $slug ) ) {
                wp_send_json_error( array( 'error' => 'activate_plugin_capability_missing' ) );
            }

            if( !$path = $this->getPluginData( "{$slug}.plugin_path") ){
                $path =  $this->getPluginData( "{$slug}-pro.plugin_path" );
            }
        
        	$colibriwp_builder_slug = Hooks::colibri_apply_filters('plugin_slug', 'colibri-page-builder');
            if ($slug === $colibriwp_builder_slug) {
                $source = isset($_REQUEST['source']) ? wp_unslash($_REQUEST['source']) : 'other';
                $theme = get_template();
                $option = $theme . "_start-source";
                update_option($option, $source);
            }

            if ( $slug && $path ) {
                $ac   = get_option( 'active_plugins' );
                $ac[] = $path;
                update_option( 'active_plugins', array_unique( $ac ) );

                $data = apply_filters( 'colibri_page_builder/plugin-activated', array(), $slug,
                    $this->getPluginData( $slug ) );

                if ( isset( $data[ $slug ] ) ) {
                    wp_send_json_success( $data[ $slug ] );
                } else {
                    wp_send_json_success();
                }
            }

            wp_send_json_error( array( 'error' => 'not_found' ) );

        } );
    }

    private function normalizePluginData( $plugin_data ) {
        return array_merge( array(
            'name'             => '',
            'description'      => '',
            'required'         => false,
            'force_activation' => false,
            'is_automatic'     => false,
            'priority'         => 10,
            'plugin_path'      => ''
        ), $plugin_data );
    }

    public function getPluginData( $path = '', $default = null ) {
        return $this->plugins_data->findAt( $path, $default );
    }

    public function tgmpaRegitster() {
        $plugins     = $this->plugins_data->getData();
        $to_register = array();
        foreach ( $plugins as $slug => $plugin_data ) {
            $to_register[] = array_merge(
                array(
                    'slug' => $slug
                ),
                $plugin_data
            );
        }


        tgmpa( $to_register, $this->tgmpa_config );
    }

    public function getPluginState( $slug ) {
        $tgmpa     = TGM_Plugin_Activation::get_instance();
        $installed = $tgmpa->is_plugin_installed( $slug );
        $result    = static::NOT_INSTALLED_PLUGIN;

        if ( $installed ) {
            $result = static::INSTALLED_PLUGIN;

            if ( $tgmpa->is_plugin_active( $slug ) ) {
                $result = static::ACTIVE_PLUGIN;
            }
        }

        return $result;
    }

    public function getInstallLink( $slug ) {

        if ( $this->getPluginData( "$slug.source" ) ) {
            return $this->nonceURL(
                add_query_arg(
                    array(
                        'plugin'        => urlencode( $slug ),
                        'tgmpa-install' => 'install-plugin',
                    ),
                    TGM_Plugin_Activation::get_instance()->get_tgmpa_url()
                ),
                'tgmpa-install',
                'tgmpa-nonce'
            );
        }

        return add_query_arg(
            array(
                'action'   => 'install-plugin',
                'plugin'   => $slug,
                '_wpnonce' => wp_create_nonce( 'install-plugin_' . $slug ),
            ),
            network_admin_url( 'update.php' )
        );
    }

    private function nonceURL( $actionurl, $action = - 1, $name = '_wpnonce' ) {
        return add_query_arg( $name, wp_create_nonce( $action ), $actionurl );
    }

    public function getActivationLink( $slug ) {
        $tgmpa = TGM_Plugin_Activation::get_instance();
        if ( isset( $tgmpa->plugins[ $slug ] ) ) {
            $path = $tgmpa->plugins[ $slug ]['file_path'];

            return add_query_arg( array(
                'action'        => 'activate',
                'plugin'        => rawurlencode( $path ),
                'plugin_status' => 'all',
                'paged'         => '1',
                '_wpnonce'      => wp_create_nonce( 'activate-plugin_' . $path ),
            ), network_admin_url( 'plugins.php' ) );
        }
    }
}
src/BuilderComponents/Footer.php000064400000000320151335104360012732 0ustar00<?php


namespace ColibriWP\Theme\BuilderComponents;


class Footer extends BuilderComponentBase {

    /**
     * @return string
     */
    protected function getName() {
        return 'footer';
    }


}
src/BuilderComponents/PageNotFound.php000064400000002477151335104360014044 0ustar00<?php


namespace ColibriWP\Theme\BuilderComponents;


use ColibriWP\Theme\View;

class PageNotFound extends BuilderComponentBase {

    public function render( $parameters = array() ) {

        $self = $this;
        View::printIn( View::CONTENT_ELEMENT, function () use ( $self ) {
            /** SECTION START */
            View::printIn( View::SECTION_ELEMENT, function () use ( $self ) {
                /** ROW START */
                View::printIn( View::ROW_ELEMENT, function () use ( $self ) {
                    /** COLUMN START */
                    View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {
                        $self->parentRender();
                    } );
                }, array(
                    'outer_class' => array(),
                    'inner_class' => array( 'blog-content', 'gutters-col-0' )
                ) );
                /** ROW END */
            }, array(
                'outer_class' => array(),
                'inner_class' => array( 'h-section-boxed-container' )
            ) );
            /** SECTION END */
        }, array(
            'class' => array( 'page-404' )
        ) );
    }

    public function parentRender() {
        parent::render();
    }

    /**
     * @return string
     */
    protected function getName() {
        return 'main';
    }
}
src/BuilderComponents/BuilderComponentBase.php000064400000001330151335104360015542 0ustar00<?php

namespace ColibriWP\Theme\BuilderComponents;


use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Core\Hooks;
use function ExtendBuilder\colibri_output_dynamic_template;

abstract class BuilderComponentBase extends ComponentBase {

    /**
     * @return string
     */
    protected abstract function getName();


    public function render( $parameters = array() ) {
        $template_type = Hooks::colibri_apply_filters( "{$this->getName()}_partial_type", "" );
        colibri_output_dynamic_template( $template_type, $this->getName() );
    }

    public function renderContent() {

    }

    /**
     * @return array();
     */
    protected static function getOptions() {
        return array();
    }
}
src/BuilderComponents/WooContent.php000064400000007304151335104360013604 0ustar00<?php

namespace ColibriWP\Theme\BuilderComponents;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\View;
use function function_exists;

class WooContent extends BuilderComponentBase {

    /**
     * @return string
     */
    protected function getName() {
        return 'main';
    }

    public function render( $parameters = array() ) {

        $self = $this;
        View::printIn( View::CONTENT_ELEMENT, function () use ( $self ) {
            /** SECTION START */
            View::printIn( View::SECTION_ELEMENT, function () use ( $self ) {
                /** ROW START */
                View::printIn( View::ROW_ELEMENT, function () use ( $self ) {

                    $self->printSidebarColumn('left');

                    /** COLUMN START */
                    View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {

                        if ( function_exists( 'woocommerce_content' ) ) {
                            woocommerce_content();
                        }
                    } );

//                    $self->printRightSidebarColumn();

                }, $self->getMainRowClass() );
                /** ROW END */
            }, $self->getMainSectionClass() );
            /** SECTION END */
        }, array(
            'class' => $self->getContentClass()
        ) );
    }

    public function printSidebarColumn($side = 'right') {
        $self = $this;

        $sidebar_id = 'ecommerce-'.$side;
        $is_active = is_active_sidebar("colibri-${sidebar_id}");
        $in_customizer = isset ( $GLOBALS['wp_customize'] );
        $is_active = $is_active || $in_customizer;
        $display_sidebar = Hooks::colibri_apply_filters( 'colibri_sidebar_enabled', $is_active, $sidebar_id );

        if ( $display_sidebar ) {
            View::printIn( View::COLUMN_ELEMENT, function () use ( $self,$sidebar_id ) {
                get_sidebar($sidebar_id);
            }, array(
                'data-colibri-main-sidebar-col' => 1,
                'class'                         => $self->getSidebarColumnClass( $side )
            ) );
        }
    }

    private function getSidebarColumnClass( $side ) {

        $classes = (array) Hooks::colibri_apply_filters( 'woocommerce_sidebar_column_class',
            array( 'h-col-12','h-col-lg-3', 'h-col-md-4' ), $side
        );

        $classes = array_merge( $classes, array( 'colibri-sidebar' ,"woo-sidebar-{$side}" ) );

        return array_unique( $classes );
    }

    private function getMainRowClass() {
        $classes = Hooks::colibri_apply_filters( 'woocommerce_main_row_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'gutters-col-0' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-row' ),
            'inner_class' => array( 'main-row-inner' )
        ) );

        return $classes;
    }

    private function getMainSectionClass() {

        $classes = Hooks::colibri_apply_filters( 'woocommerce_main_section_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'h-section-boxed-container' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-section' ),
            'inner_class' => array( 'main-section-inner' ),
        ) );

        return $classes;
    }

    private function getContentClass() {
        $class = Hooks::colibri_apply_filters( 'woocommerce_main_content_class', array() );

        if ( ! is_array( $class ) ) {
            $class = (array) $class;
        }

        array_push( $class, 'colibri-woo-main-content-archive' );
        return $class;
    }

    public function parentRender() {
        parent::render();
    }


}
src/BuilderComponents/SingleContent.php000064400000006444151335104360014265 0ustar00<?php

namespace ColibriWP\Theme\BuilderComponents;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\View;

class SingleContent extends BuilderComponentBase {

    public function render( $parameters = array() ) {

        $self = $this;
        View::printIn( View::CONTENT_ELEMENT, function () use ( $self ) {
            /** SECTION START */
            View::printIn( View::SECTION_ELEMENT, function () use ( $self ) {
                /** ROW START */
                View::printIn( View::ROW_ELEMENT, function () use ( $self ) {

                    /** COLUMN START */
                    View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {
                        $self->parentRender();
                    } );

                    /** COLUMN END */
                    $self->printRightSidebarColumn();

                }, $self->getMainRowClass() );
                /** ROW END */
            }, $self->getMainSectionClass() );
            /** SECTION END */
        }, array(
            'class' => $self->getContentClass()
        ) );
    }

    public function parentRender() {
        parent::render();
    }

    public function printRightSidebarColumn() {
        $self = $this;

        $display_sidebar = Hooks::colibri_apply_filters( 'blog_sidebar_enabled', true, 'right' );

        if ( $display_sidebar && is_active_sidebar( 'colibri-sidebar-1' ) ) {
            View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {
                get_sidebar();
            }, array(
                'data-colibri-main-sidebar-col' => 1,
                'class'                         => $self->getSidebarColumnClass( 'right' )
            ) );
        }

    }

    private function getSidebarColumnClass( $side ) {

        $classes = (array) Hooks::colibri_apply_filters( 'blog_sidebar_column_class',
            array( 'h-col-12', 'h-col-lg-3', 'h-col-md-4' ), $side
        );

        $classes = array_merge( $classes, array( 'colibri-sidebar', "blog-sidebar-{$side}" ) );

        return array_unique( $classes );
    }

    private function getMainRowClass() {
        $classes = Hooks::colibri_apply_filters( 'main_row_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'gutters-col-0' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-row' ),
            'inner_class' => array( 'main-row-inner' )
        ) );

        return $classes;
    }

    private function getMainSectionClass() {

        $classes = Hooks::colibri_apply_filters( 'main_section_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'h-section-boxed-container' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-section' ),
            'inner_class' => array( 'main-section-inner' ),
        ) );

        return $classes;
    }

    private function getContentClass() {
        $class = Hooks::colibri_apply_filters( 'main_content_class', array() );

        if ( ! is_array( $class ) ) {
            $class = (array) $class;
        }

        array_push( $class, 'colibri-main-content-single' );

        return $class;
    }

    /**
     * @return string
     */
    protected function getName() {
        return 'main';
    }

}
src/BuilderComponents/CSSOutput.php000064400000000424151335104360013352 0ustar00<?php

namespace ColibriWP\Theme\BuilderComponents;


use ColibriWP\Theme\Core\ComponentBase;

class CssOutput extends ComponentBase {

    public function renderContent() {

    }

    /**
     * @return array();
     */
    protected static function getOptions() {

    }
}
src/BuilderComponents/FrontPageContent.php000064400000001346151335104360014725 0ustar00<?php

namespace ColibriWP\Theme\BuilderComponents;


use ColibriWP\Theme\Core\ComponentBase;


class FrontPageContent extends ComponentBase {

    public function renderContent() {
        ?>
        <div class="page-content">
                <?php while ( have_posts() ) : the_post(); ?>
                    <div id="content"  class="content">
                     <?php
                         the_content();
                         endwhile;
                     ?>
                    </div>
            <?php
            colibriwp_render_page_comments();
                    ?>
        </div>
        <?php

    }

    /**
     * @return array();
     */
    protected static function getOptions() {
        return array();
    }


}
src/BuilderComponents/Sidebar.php000064400000001203151335104360013046 0ustar00<?php

namespace ColibriWP\Theme\BuilderComponents;
use ColibriWP\Theme\Core\Hooks;
use function ExtendBuilder\colibri_output_dynamic_template;

class Sidebar extends BuilderComponentBase {

    public function render( $parameters = array() ) {
        $type = isset($parameters['type']) ? $parameters['type'] : 'right';
        $partial_type = $this->getName();
        $template_type = Hooks::colibri_apply_filters( "{$partial_type}_partial_type", "" );
        colibri_output_dynamic_template( $template_type, $partial_type);
    }

    /**
     * @return string
     */
    protected function getName() {
        return 'sidebar';
    }
}
src/BuilderComponents/PageContent.php000064400000000175151335104360013713 0ustar00<?php

namespace ColibriWP\Theme\BuilderComponents;


class PageContent extends \ColibriWP\Theme\Components\PageContent {

}
src/BuilderComponents/MainContent.php000064400000006446151335104360013732 0ustar00<?php

namespace ColibriWP\Theme\BuilderComponents;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\View;

class MainContent extends BuilderComponentBase {

    public function render( $parameters = array() ) {

        $self = $this;
        View::printIn( View::CONTENT_ELEMENT, function () use ( $self ) {
            /** SECTION START */
            View::printIn( View::SECTION_ELEMENT, function () use ( $self ) {
                /** ROW START */
                View::printIn( View::ROW_ELEMENT, function () use ( $self ) {

                    /** COLUMN START */
                    View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {
                        $self->parentRender();
                    } );


                    /** COLUMN END */

                    $self->printRightSidebarColumn();

                }, $self->getMainRowClass() );
                /** ROW END */
            }, $self->getMainSectionClass() );
            /** SECTION END */
        }, array(
            'class' => $self->getContentClass()
        ) );
    }

    public function parentRender() {
        parent::render();
    }

    public function printRightSidebarColumn() {
        $self = $this;

        $display_sidebar = Hooks::colibri_apply_filters( 'blog_sidebar_enabled', true, 'right' );

        if ( $display_sidebar && is_active_sidebar( 'colibri-sidebar-1' ) ) {
            View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {
                get_sidebar();
            }, array(
                'data-colibri-main-sidebar-col' => 1,
                'class'                         => $self->getSidebarColumnClass( 'right' )
            ) );
        }

    }

    private function getSidebarColumnClass( $side ) {

        $classes = (array) Hooks::colibri_apply_filters( 'blog_sidebar_column_class',
            array( 'h-col-12', 'h-col-lg-3', 'h-col-md-4' ), $side
        );

        $classes = array_merge( $classes, array( 'colibri-sidebar', "blog-sidebar-{$side}" ) );

        return array_unique( $classes );
    }

    private function getMainRowClass() {
        $classes = Hooks::colibri_apply_filters( 'main_row_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'gutters-col-0' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-row' ),
            'inner_class' => array( 'main-row-inner' )
        ) );

        return $classes;
    }

    private function getMainSectionClass() {

        $classes = Hooks::colibri_apply_filters( 'main_section_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'h-section-boxed-container' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-section' ),
            'inner_class' => array( 'main-section-inner' ),
        ) );

        return $classes;
    }

    private function getContentClass() {
        $class = Hooks::colibri_apply_filters( 'main_content_class', array() );

        if ( ! is_array( $class ) ) {
            $class = (array) $class;
        }

        array_push( $class, 'colibri-main-content-archive' );

        return $class;
    }

    /**
     * @return string
     */
    protected function getName() {
        return 'main';
    }


}
src/BuilderComponents/Header.php000064400000000563151335104360012675 0ustar00<?php


namespace ColibriWP\Theme\BuilderComponents;


use ColibriWP\Theme\View;

class Header extends BuilderComponentBase {


    /**
     * @return string
     */
    protected function getName() {
        return 'header';
    }

    public function render( $parameters = array() ) {
        View::printSkipToContent();
        parent::render( $parameters );
    }

}
src/AssetsManager.php000064400000023135151335104360010606 0ustar00<?php


namespace ColibriWP\Theme;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Utils;
use function wp_add_inline_script;
use function wp_add_inline_style;
use function wp_enqueue_script;
use function wp_enqueue_style;
use function wp_localize_script;

class AssetsManager {

    private $theme;
    private $key;

    private $fonts = array();

    private $autoenqueue
        = array(
            'style'  => array(),
            'script' => array(),
        );


    private $registered
        = array(
            'style'  => array(),
            'script' => array(),
        );

    private $localized = array();
    private $base_url = "";
    private $is_hot = false;

    /**
     * AssetsManager constructor.
     *
     * @param Theme $theme
     */
    public function __construct( $theme ) {
        $this->theme = $theme;
        $this->key   = Defaults::get( 'assets_js_key', 'THEME_DATA' );

        $this->base_url = get_template_directory_uri() . "/resources";

         
    }

    public static function addInlineScriptCallback( $handle, $callback ) {
        wp_add_inline_script( $handle, Utils::buffer_wrap( $callback, true ) );
    }

    public static function addInlineStyleCallback( $handle, $callback ) {
        wp_add_inline_style( $handle, Utils::buffer_wrap( $callback, true ) );
    }

    public function boot() {
        add_action( 'wp_footer', array( $this, 'addFrontendJSData' ), 0 );
        add_action( 'wp_enqueue_scripts', array( $this, 'doEnqueueGoogleFonts' ), 1 );
        add_action( 'wp_enqueue_scripts', array( $this, 'doRegisterScript' ), 10 );
        add_action( 'admin_enqueue_scripts', array( $this, 'doRegisterScript' ), 10 );
        add_action( 'wp_enqueue_scripts', array( $this, 'doAutoEnqueue' ), 20 );
        add_action( 'wp_enqueue_scripts', array( $this, 'doLocalize' ), 40 );
    }

    public function addFrontendJSData() {
        $data   = Hooks::apply_filters( "frontend_js_data", array() );
        $script = "window.{$this->key} = " . wp_json_encode( $data ) . ';';

        ?>
        <script data-name="colibri-frontend-data"><?php echo $script; ?></script>
        <?php
    }

    public function doRegisterScript() {

        foreach ( $this->registered['style'] as $handle => $data ) {
            wp_register_style( $handle, $data['src'], $data['deps'], $data['ver'], $data['media'] );
        }

        foreach ( $this->registered['script'] as $handle => $data ) {
            wp_register_script( $handle, $data['src'], $data['deps'], $data['ver'], $data['in_footer'] );
        }
    }

    public function doEnqueueGoogleFonts() {

        if ( apply_filters( 'colibri_page_builder/installed', false ) ) {
            return;
        }

        $fontQuery = array();

        foreach ( $this->fonts as $family => $font ) {
            $fontQuery[] = $family . ":" . implode( ',', $font['weights'] );
        }

        $query_args = array(
            'family'  => urlencode( implode( '|', $fontQuery ) ),
            'subset'  => urlencode( 'latin,latin-ext' ),
            'display' => 'swap'
        );

        $fontsURL = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );

        $this->registerStyle( $this->theme->getTextDomain() . "_google_fonts", $fontsURL );
    }

    /**
     * @param       $handle
     * @param       $url
     * @param array $deps
     * @param bool $auto_enqueue
     *
     * @return AssetsManager
     */
    public function registerStyle( $handle, $url, $deps = array(), $auto_enqueue = true ) {
        $this->register( 'style', $handle, array(
            'src'          => $url,
            'deps'         => $deps,
            'auto_enqueue' => $auto_enqueue,
        ) );

        return $this;
    }

    /**
     * @param       $type
     * @param       $handle
     * @param array $args
     *
     * @return AssetsManager
     */
    public function register( $type, $handle, $args = array() ) {
        $ver  = $this->theme->getVersion();
        $data = array_merge( array(
            'src'          => '',
            'deps'         => array(),
            'has_min'      => false,
            'in_footer'    => true,
            'media'        => 'all',
            'ver'          => $ver,
            'in_preview'   => true,
            'auto_enqueue' => false,
        ), $args );

        if ( $this->theme->getCustomizer()->isInPreview() && $data['in_preview'] === false ) {
            return $this;
        }

        if ( $data['has_min'] ) {
            if ( $type === 'style' ) {
                $data['src'] = Utils::replace_file_extension( $data['src'], '.css', '.min.css' );
            }

            if ( $type === 'script' ) {
                $data['src'] = Utils::replace_file_extension( $data['src'], '.js', '.min.js' );
            }
        }

        $this->registered[ $type ][ $handle ] = $data;

        if ( $data['auto_enqueue'] ) {
            if ( ! in_array( $handle, $this->autoenqueue[ $type ] ) ) {
                $this->autoenqueue[ $type ][] = $handle;
            }
        }


        return $this;
    }

    public function doAutoEnqueue() {

        foreach ( Hooks::colibri_apply_filters( 'auto_enqueue_assets', $this->autoenqueue ) as $type => $content ) {
            foreach ( $content as $item ) {
                $this->enqueue( $type, $item );
            }
        }

        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
            wp_enqueue_script( 'comment-reply' );
        }
    }

    public function enqueue( $type, $handle, $args = array() ) {
        if ( ! empty( $args ) ) {
            $this->register( $type, $handle, $args );
        }

        if ( $type === 'style' ) {
            wp_enqueue_style( $handle );
        }

        if ( $type === 'script' ) {

            if ( isset( $this->localized[ $handle ] ) ) {
                wp_localize_script( $handle, $this->localized[ $handle ]['key'], $this->localized[ $handle ]['data'] );
                unset( $this->localized[ $handle ] );
            }

            wp_enqueue_script( $handle );
        }
    }

    public function doLocalize() {
        foreach ( $this->localized as $handle => $data ) {
            wp_localize_script( $handle, $data['key'], $data['data'] );
        }
    }

    public function enqueueScript( $handle, $args = array() ) {
        $this->enqueue( "script", $handle, $args );
    }

    public function enqueueStyle( $handle, $args = array() ) {
        $this->enqueue( "style", $handle, $args );
    }

    /**
     * @param string $handle
     * @param string $rel
     * @param array $deps
     * @param bool $auto_enqueue
     *
     * @return AssetsManager
     */
    public function registerTemplateScript( $handle, $rel, $deps = array(), $auto_enqueue = true ) {
        $this->registerScript( $handle, $this->getBaseURL() . $rel, $deps, $auto_enqueue );

        return $this;
    }

    /**
     * @param string $handle
     * @param string $rel
     * @param array $deps
     * @param bool $auto_enqueue
     *
     * @return AssetsManager
     */
    public function registerScript( $handle, $url, $deps = array(), $auto_enqueue = true ) {

        $this->register( 'script', $handle, array(
            'src'          => $url,
            'deps'         => $deps,
            'auto_enqueue' => $auto_enqueue,
        ) );

        return $this;
    }

    public function getBaseURL() {
        return $this->base_url;
    }

    public function registerStylesheet( $handle, $hot_rel, $deps = array(), $auto_enqueue = true ) {
        if ( $this->is_hot ) {
            $this->registerTemplateStyle( $handle, "/{$hot_rel}", $deps, $auto_enqueue );
        } else {
            $this->registerStyle( $handle, get_stylesheet_uri(), $deps, $auto_enqueue );
        }

        return $this;
    }

    /**
     * @param string $handle
     * @param string $rel
     * @param array $deps
     * @param bool $auto_enqueue
     *
     * @return AssetsManager
     */
    public function registerTemplateStyle( $handle, $rel, $deps = array(), $auto_enqueue = true ) {

        $this->registerStyle( $handle, $this->getBaseURL() . $rel, $deps, $auto_enqueue );

        return $this;
    }

    /**
     * @param string $handle
     * @param string $key
     * @param array $data
     *
     * @return AssetsManager
     */
    public function localize( $handle, $key, $data = array() ) {
        $this->localized[ $handle ] = array(
            "key"  => $key,
            "data" => $data,
        );

        return $this;
    }

    public function addGoogleFont( $family, $weights ) {
        $this->fonts[ $family ] = compact( 'family', 'weights' );

        return $this;
    }

    public function clearGoogleFonts() {
        $this->fonts = array();

        return $this;
    }

    public function removeGoogleFont( $family, $weights = 'all' ) {

        if ( array_key_exists( $family, $this->fonts ) ) {
            if ( $weights === 'all' ) {
                unset( $this->fonts[ $family ] );

                return $this;
            } else {

                $weights = (array) $weights;

                foreach ( $weights as $weight ) {
                    $font_weights = Utils::pathGet( $this->fonts, "{$family}.weights" );
                    if ( array_key_exists( $weight, $font_weights ) ) {
                        unset( $font_weights[ $weight ] );
                    }

                    if ( count( $font_weights ) ) {
                        $this->fonts = Utils::pathSet( $this->fonts, "{$family}.weights", $font_weights );
                    } else {
                        unset( $this->fonts[ $family ] );
                    }
                }

                return $this;
            }
        }

        return $this;
    }
}
src/Components/PageSearch.php000064400000001500151335104360012170 0ustar00<?php


namespace ColibriWP\Theme\Components;


use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\View;

class PageSearch extends ComponentBase {

    public function renderContent() {

        View::printIn( View::CONTENT_ELEMENT, function () {
            View::printIn( View::SECTION_ELEMENT, function () {
                View::printIn( View::ROW_ELEMENT, function () {
                    View::printIn( View::COLUMN_ELEMENT, function () {
                        View::partial( 'main', 'search', array(
                            "component" => $this,
                        ) );
                    } );
                } );
            } );
        }, array( array( 'post-single' ) ) );
    }


    /**
     * @return array();
     */
    protected static function getOptions() {
        return array();
    }
}
src/Components/Sidebar.php000064400000000665151335104360011552 0ustar00<?php
namespace ColibriWP\Theme\Components;


use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\View;

class Sidebar extends ComponentBase {

	public function renderContent($options = array()) {
	    $id = isset($options['id']) ? $options['id'] : 'post';
		View::partial( 'sidebar', $id, array(
			"component" => $this,
		) );
	}

	/**
	 * @return array();
	 */
	protected static function getOptions() {
		return array();
	}
}
src/Components/Footer.php000064400000005153151335104360011434 0ustar00<?php


namespace ColibriWP\Theme\Components;


use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Theme;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class Footer extends ComponentBase {

    public static function selectiveRefreshSelector() {
        $footer_class = View::isFrontPage() ? "footer-front-page" : "footer-inner-page";

        return ".footer.{$footer_class}";
    }

    protected static function getOptions() {

        return array(
            "settings" => array(),
            "sections" => array(
                "footer" => array(
                    'title'    => Translations::get( 'footer_settings' ),
                    'priority' => 0,
                    'panel'    => 'footer_panel',
                    'type'     => 'colibri_section',

                ),
            ),

            "panels" => array(
                "footer_panel" => array(
                    'priority'       => 3,
                    'title'          => Translations::get( 'footer_sections' ),
                    'type'           => 'colibri_panel',
                    'footer_buttons' => array(
                        'change_header' => array(
                            'label'   => Translations::get( 'change_footer_design' ),
                            'name'    => 'colibriwp_footers_panel',
                            'classes' => array( 'colibri-button-large', 'button-primary' ),
                            'icon'    => 'dashicons-admin-customizer',
                        )
                    )
                ),
            ),
        );

    }

    public function printCopyright() {
        $colibr_theme_url = sprintf(
            '<a target="_blank" href="%s" class="mesmerize-theme-link">%s</a>',
            "https://colibriwp.com",
            __( 'Colibri Theme', 'colibri-wp' )
        );

        $copyrightText = sprintf(
            __( 'Built using WordPress and the %s', 'colibri-wp' ),
            $colibr_theme_url
        );

        $copyright = sprintf(
            '<p class="copyright">&copy;&nbsp;&nbsp;%s&nbsp;%s.&nbsp;%s</p>',
            date_i18n( __( 'Y', 'colibri-wp' ) ),
            esc_html( get_bloginfo( 'name' ) ),
            $copyrightText
        );

        echo $copyright;
    }

    public function renderContent() {

        Hooks::colibri_do_action( 'before_footer' );
        $footer_class = View::isFrontPage() ? "footer-front-page" : "footer-inner-page";

        ?>
        <div class="footer <?php echo $footer_class; ?>">
            <?php Theme::getInstance()->get( 'front-footer' )->render(); ?>
        </div>
        <?php
    }
}
src/Components/CSSOutput.php000064400000021704151335104360012047 0ustar00<?php


namespace ColibriWP\Theme\Components;

use ColibriWP\Theme\ActiveCallback;
use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Core\ComponentInterface;
use ColibriWP\Theme\Core\ConfigurableInterface;
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Customizer\Formatter;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Theme;
use Exception;
use function get_theme_mod;

class CSSOutput implements ComponentInterface {

    const NO_MEDIA = "__colibri__no__media__";
    const GRADIENT_VALUE_PATTERN = 'linear-gradient(#angle#deg,#steps.0.color# #steps.0.position#% ,#steps.1.color# #steps.1.position#%)';
    const SELECTORS_PREFIX = "html.colibri-wp-theme #colibri ";

    public function render() {

        Hooks::colibri_add_filter( 'customizer_additional_js_data', function ( $data ) {
            $data['css_selectors_prefix'] = CSSOutput::SELECTORS_PREFIX;
            return $data;
        } );

        ?>
        <style data-colibri-theme-style="true">
            <?php echo $this->getCSSOutput(); ?>
        </style>
        <?php
    }

    public function getCSSOutput() {
        return $this->generateCSSOutput();
    }

    private function generateCSSOutput() {
        $content = "";
        $data    = $this->getCSSData();
        $medias  = $this->groupDataByMedia( $data );

        if ( array_key_exists( CSSOutput::NO_MEDIA, $medias ) ) {
            $content .= $this->generateCSSOutputForMedia( '', $medias[ CSSOutput::NO_MEDIA ] );
        }

        if ( array_key_exists( CSSOutput::mobileMedia(), $medias ) ) {
            $content .= $this->generateCSSOutputForMedia(
                CSSOutput::mobileMedia(),
                $medias[ CSSOutput::mobileMedia() ]
            );
        }

        if ( array_key_exists( CSSOutput::tabletMedia(), $medias ) ) {
            $content .= $this->generateCSSOutputForMedia(
                CSSOutput::tabletMedia(),
                $medias[ CSSOutput::tabletMedia() ]
            );
        }


        if ( array_key_exists( CSSOutput::desktopMedia(), $medias ) ) {
            $content .= $this->generateCSSOutputForMedia(
                CSSOutput::desktopMedia(),
                $medias[ CSSOutput::desktopMedia() ]
            );
        }

        return $content;

    }

    /**
     * @return array
     * @throws Exception
     */
    private function getCSSData() {
        $data = array();

        $components = Theme::getInstance()->getRepository()->getAllDefinitions();

        foreach ( $components as $key => $component ) {
            $interfaces = class_implements( $component );

            if ( array_key_exists( ConfigurableInterface::class, $interfaces ) ) {
                /** @var ConfigurableInterface $component */
                $opts = (array) $component::options();

                if ( array_key_exists( 'settings', $opts ) && is_array( $opts['settings'] ) ) {
                    foreach ( $opts['settings'] as $mod => $setting ) {

                        if ( array_key_exists( 'css_output', $setting ) && is_array( $setting['css_output'] ) ) {


                            if ( $this->activeRulesAreMet( $setting, $component ) ) {
                                $default      = isset( $setting['default'] ) ? $setting['default'] : "";
                                $control_type = Utils::pathGet( $setting, 'control.type' );


                                foreach ( $setting['css_output'] as $css_output ) {
                                    $rule = $this->prepareOutputDataForMod(
                                        $css_output,
                                        $mod,
                                        $default,
                                        $control_type
                                    );

                                    if ( ! ( empty( $rule['selector'] ) || empty( $rule['property'] ) ) ) {
                                        $data[] = $rule;
                                    }
                                }

                            }
                        }
                    }
                }
            }
        }

        return $data;
    }

    /**
     * @param $settings
     * @param $component
     *
     * @return bool
     * @throws Exception
     */
    private function activeRulesAreMet( $settings, $component ) {
        if ( ! array_key_exists( 'active_rules', $settings ) ) {
            return true;
        }

        $activeCallback = ( new ActiveCallback() )->setComponent( $component )->setRules( $settings['active_rules'] );

        return $activeCallback->applyRules();
    }

    private function prepareOutputDataForMod( $output, $mod, $default = '', $control_type = '' ) {
        $output = static::normalizeOutput( $output );

        $mod_value = get_theme_mod( $mod, $default );
        $mod_value = Formatter::sanitizeControlValue( $control_type, $mod_value );
        if ( isset( $output['value'] ) && is_array( $output['value'] ) ) {
            $output['value'] = $output['value'][ $mod_value ];
        } else {
            $output['value'] = ComponentBase::mabyDeserializeModValue( $mod_value );
        }

        return $output;
    }

    public static function normalizeOutput( $output ) {

        return array_replace(
            array(
                'selector'      => '',
                'media'         => CSSOutput::NO_MEDIA,
                'property'      => '',
                'value_pattern' => '%s',
            ),
            $output
        );


    }

    private function groupDataByMedia( $data ) {
        $medias = array();

        foreach ( $data as $item ) {
            if ( ! array_key_exists( $item['media'], $medias ) ) {
                $medias[ $item['media'] ] = array();
            }

            $medias[ $item['media'] ][] = $item;
        }

        return $medias;
    }

    private function generateCSSOutputForMedia( $media, $data ) {
        $selectors = array();

        foreach ( $data as $item ) {

            $selector = $item['selector'];

            if ( is_array( $selector ) ) {
                $selector = implode( ",", $selector );
            }

            if ( ! array_key_exists( $selector, $selectors ) ) {
                $selectors[ $selector ] = array();
            }
            $value = $this->getValue( $item );


            if ( $value !== null ) {
                $selectors[ $selector ][ $item['property'] ] = $value;
            }


        }

        $content = "";

        foreach ( $selectors as $selector => $rules ) {
            $rules_parts = array();

            foreach ( $rules as $prop => $value ) {
                $rules_parts[] = "{$prop}:{$value}";
            }

            $rules = implode( ";", $rules_parts );

            $content .= CSSOutput::SELECTORS_PREFIX . "{$selector}{{$rules}}";
        }

        if ( ! empty( $media ) ) {
            $content = "{$media}{{$content}}";
        }

        return $content;
    }

    private function getValue( $item ) {

        if ( is_array( $item['value'] ) ) {
            $that       = $this;
            $item_value = $item['value'];
            $value      = preg_replace_callback(
                "/#([\w\.]+)#/",
                function ( $matches ) use ( $item_value, $that ) {
                    return $that->getValueInTree( $item_value, $matches[1] );
                },
                $item['value_pattern']
            );

            return $value;
        } else {

            if ( is_bool( $item['value'] ) ) {
                if ( $item['value'] ) {
                    if ( isset( $item['true_value'] ) ) {
                        return $item['true_value'];
                    } else {
                        return null;
                    }

                } else {
                    if ( isset( $item['false_value'] ) ) {
                        return $item['false_value'];
                    } else {
                        return null;
                    }
                }

            }
        }
        if ( $item['value'] || $item['value'] === 0 ) {
            return sprintf( $item['value_pattern'], $item['value'] );
        }
    }

    private function getValueInTree( $tree, $path ) {
        $path   = explode( ".", $path );
        $result = $tree;

        while ( count( $path ) && is_array( $tree ) ) {
            $next_key = array_shift( $path );
            if ( array_key_exists( $next_key, $result ) ) {
                $result = $result[ $next_key ];
            } else {
                $result = "";
                break;
            }
        }

        if ( is_array( $result ) ) {
            $result = "";
        }

        return $result;
    }

    public static function mobileMedia() {
        return Defaults::get( 'mobile_media', '@media (max-width: 767px)' );
    }

    public static function tabletMedia() {
        return Defaults::get( 'tablet_media', '@media (min-width: 768px) and (max-width: 1023px)' );
    }


    public static function desktopMedia() {
        return Defaults::get( 'tablet_media', '@media (min-width: 1024px)' );
    }


}
src/Components/SingleContent.php000064400000005175151335104360012756 0ustar00<?php

namespace ColibriWP\Theme\Components;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Theme;
use ColibriWP\Theme\View;

class SingleContent extends MainContent {

	public function renderContent() {

		$self = $this;
		View::printIn( View::CONTENT_ELEMENT, function () use ( $self ) {
			/** SECTION START */
			View::printIn( View::SECTION_ELEMENT, function () use ( $self ) {
				/** ROW START */
				View::printIn( View::ROW_ELEMENT, function () use ( $self ) {

					/** COLUMN START */
					View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {

						Theme::getInstance()->get( 'single-template' )->render();

					} );

					/** COLUMN END */
					$self->printRightSidebarColumn();

				}, $self->getMainRowClass() );
				/** ROW END */
			}, $self->getMainSectionClass() );
			/** SECTION END */
		}, array(
			'class' => $self->getContentClass()
		) );
	}

	public function printRightSidebarColumn() {
		$self = $this;

		$display_sidebar = Hooks::colibri_apply_filters( 'blog_sidebar_enabled', true, 'right' );

		if ( $display_sidebar && is_active_sidebar( 'colibri-sidebar-1' ) ) {
			View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {
				get_sidebar();
			}, array(
				'data-colibri-main-sidebar-col' => 1,
				'class'                         => $self->getSidebarColumnClass( 'right' )
			) );
		}

	}

	private function getSidebarColumnClass( $side ) {

		$classes = (array) Hooks::colibri_apply_filters( 'blog_sidebar_column_class',
			array( 'h-col-12','h-col-lg-3', 'h-col-md-4' ), $side
		);

		$classes = array_merge( $classes, array( 'colibri-sidebar', "blog-sidebar-{$side}" ) );

		return array_unique( $classes );
	}

	private function getMainRowClass() {
		$classes = Hooks::colibri_apply_filters( 'main_row_class', array(
			'outer_class' => array(),
			'inner_class' => array( 'gutters-col-0' )
		) );

		$classes = array_merge_recursive( $classes, array(
			'outer_class' => array( 'main-row' ),
			'inner_class' => array( 'main-row-inner' )
		) );

		return $classes;
	}

	private function getMainSectionClass() {

		$classes = Hooks::colibri_apply_filters( 'main_section_class', array(
			'outer_class' => array(),
			'inner_class' => array( 'h-section-boxed-container' )
		) );

		$classes = array_merge_recursive( $classes, array(
			'outer_class' => array( 'main-section' ),
			'inner_class' => array( 'main-section-inner' ),
		) );

		return $classes;
	}

	private function getContentClass() {
		$class = Hooks::colibri_apply_filters( 'main_content_class', array() );

		if ( ! is_array( $class ) ) {
			$class = (array) $class;
		}

		array_push( $class, 'colibri-main-content-single' );

		return $class;
	}

}
src/Components/PageNotFound.php000064400000002554151335104360012531 0ustar00<?php

namespace ColibriWP\Theme\Components;


use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\View;

class PageNotFound extends ComponentBase {

    /**
     * @return array();
     */
    protected static function getOptions() {
        return array();
    }

    public function renderContent() {

        $self = $this;
        View::printIn( View::CONTENT_ELEMENT, function () use ( $self ) {
            /** SECTION START */
            View::printIn( View::SECTION_ELEMENT, function () use ( $self ) {
                /** ROW START */
                View::printIn( View::ROW_ELEMENT, function () use ( $self ) {
                    /** COLUMN START */
                    View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {
                        View::partial( 'main', '404', array(
                            "component" => $this,
                        ) );
                    } );
                }, array(
                    'outer_class' => array(),
                    'inner_class' => array( 'blog-content', 'gutters-col-0' )
                ) );
                /** ROW END */
            }, array(
                'outer_class' => array(),
                'inner_class' => array( 'h-section-boxed-container' )
            ) );
            /** SECTION END */
        }, array(
            'class' => array( 'page-404' )
        ) );
    }
}
src/Components/WooContent.php000064400000006736151335104360012305 0ustar00<?php


namespace ColibriWP\Theme\Components;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\View;

class WooContent extends MainContent {

    public function renderContent() {

        $self = $this;
        View::printIn( View::CONTENT_ELEMENT, function () use ( $self ) {
            /** SECTION START */
            View::printIn( View::SECTION_ELEMENT, function () use ( $self ) {
                /** ROW START */
                View::printIn( View::ROW_ELEMENT, function () use ( $self ) {

                    $self->printSidebarColumn("left");

                    /** COLUMN START */
                    View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {

                        if ( function_exists( 'woocommerce_content' ) ) {
                            woocommerce_content();
                        }
                    } );

//                    $self->printSidebarColumn("right");

                }, $self->getMainRowClass() );
                /** ROW END */
            }, $self->getMainSectionClass() );
            /** SECTION END */
        }, array(
            'class' => $self->getContentClass()
        ) );
    }

    public function printSidebarColumn($side = 'right') {
        $self = $this;

        $sidebar_id = 'ecommerce-'.$side;
        $is_active = is_active_sidebar("colibri-{$sidebar_id}");
        $in_customizer = isset ( $GLOBALS['wp_customize'] );
        $is_active = $is_active || $in_customizer;
        $display_sidebar = Hooks::colibri_apply_filters( 'colibri_sidebar_enabled', $is_active, $sidebar_id );

        if ( $display_sidebar ) {
            View::printIn( View::COLUMN_ELEMENT, function () use ( $self, $sidebar_id ) {
                get_sidebar($sidebar_id);
            }, array(
                'data-colibri-main-sidebar-col' => 1,
                'class'                         => $self->getSidebarColumnClass( $side )
            ) );
        }

    }

    private function getSidebarColumnClass( $side ) {

        $classes = (array) Hooks::colibri_apply_filters( 'woocommerce_sidebar_column_class',
            array( 'h-col-12', 'h-col-lg-3', 'h-col-md-4' ), $side
        );

        $classes = array_merge( $classes, array( 'colibri-sidebar', "woo-sidebar-{$side}" ) );

        return array_unique( $classes );
    }

    private function getMainRowClass() {
        $classes = Hooks::colibri_apply_filters( 'woocommerce_main_row_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'gutters-col-0' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-row' ),
            'inner_class' => array( 'main-row-inner' )
        ) );

        return $classes;
    }

    private function getMainSectionClass() {

        $classes = Hooks::colibri_apply_filters( 'woocommerce_main_section_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'h-section-boxed-container' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-section' ),
            'inner_class' => array( 'main-section-inner' ),
        ) );

        return $classes;
    }

    private function getContentClass() {
        $class = Hooks::colibri_apply_filters( 'woocommerce_main_content_class', array() );

        if ( ! is_array( $class ) ) {
            $class = (array) $class;
        }

        array_push( $class, 'colibri-woo-main-content-archive' );

        return $class;
    }
}
src/Components/Header/TopBar.php000064400000004417151335104360012557 0ustar00<?php

namespace ColibriWP\Theme\Components\Header;

use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;
use function is_customize_preview;

class TopBar extends ComponentBase {

    protected static $settings_prefix = "header_front_page.navigation.";
    private $attrs = array();

    public function __construct( $attrs = array() ) {
    }

    protected static function getOptions() {
        $prefix  = static::$settings_prefix;
        $section = 'nav_bar';

        return array(
            "settings" => array(

                "{$prefix}props.showTopBar" => array(
                    'default'    => Defaults::get( "{$prefix}props.showTopBar" ),
                    'control'    => array(
                        'label'       => Translations::get( 'show_top_bar' ),
                        'type'        => 'switch',
                        'section'     => $section,
                        'colibri_tab' => 'content',
                        'priority'    => 12
                    ),
                    'css_output' => array(
                        array(
                            'selector'    => static::selectiveRefreshSelector(),
                            'property'    => 'display',
                            'true_value'  => 'block',
                            'false_value' => 'none',
                        ),
                    ),
                ),
            ),
        );
    }

    public static function selectiveRefreshSelector() {
        return "[data-selective-refresh='" . static::selectiveRefreshKey() . "']";
    }

    public function renderContent() {

        $prefix = static::$settings_prefix;

        if ( ! $this->mod( "{$prefix}props.showTopBar" ) ) {
            if ( ! is_customize_preview() ) {

                return;
            }
        }

        if ( is_customize_preview() ) {
            ?>
            <div data-selective-refresh="<?php echo static::selectiveRefreshKey(); ?>">
                <?php $this->makeView(); ?>
            </div>
            <?php
        } else {
            $this->makeView();
        }
    }

    public function makeView() {
        View::partial( 'front-header', 'top-bar', array(
            "component" => $this,
        ) );
    }

}
src/Components/Header/Logo.php000064400000034564151335104360012276 0ustar00<?php
/**
 * Created by PhpStorm.
 * User: Extend Studio
 * Date: 2/19/2019
 * Time: 6:21 PM
 */

namespace ColibriWP\Theme\Components\Header;

use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;
use WP_Customize_Manager;
use WP_Customize_Setting;


class Logo extends ComponentBase {

    protected static $settings_prefix = "header_front_page.logo.";

    public static function rearrangeControls( $wp_customize ) {

        $prefix = static::$settings_prefix;

        $controls       = array( 'blogname', 'custom_logo', );
        $priority_start = 20;

        foreach ( $controls as $index => $control ) {
            /** @var WP_Customize_Manager $wp_customize */
            $instance = $wp_customize->get_control( $control );

            if ( $instance ) {
                $instance->section             = "{$prefix}section";
                $instance->json['colibri_tab'] = "content";
                $instance->priority            = ( $priority_start + $index * 5 );

                $active_rule_value = "text";

                if ( $control == 'custom_logo' ) {
                    $active_rule_value = "image";

                }

                /** @var WP_Customize_Setting $setting */
                $setting                        = $instance->setting;
                $setting->transport             = 'postMessage';
                $instance->json['active_rules'] = array(
                    array(
                        "setting"  => "{$prefix}props.layoutType",
                        "operator" => "=",
                        "value"    => $active_rule_value,
                    ),
                );
            }

            if ( $wp_customize->selective_refresh ) {
                $id                = static::selectiveRefreshSelector();
                $partial           = $wp_customize->selective_refresh->get_partial( Utils::slugify( $id ) );
                $partial->settings = array_merge(
                    $partial->settings,
                    $controls
                );
            }
        }
    }

    public static function selectiveRefreshSelector() {
        $selector = Defaults::get( static::$settings_prefix . 'selective_selector', false );

        return $selector;
    }

    /**
     * @return array();
     */
    protected static function getOptions() {
        Hooks::colibri_add_action( 'rearrange_customizer_components', array( __CLASS__, "rearrangeControls" ) );

        $prefix = static::$settings_prefix;

        $custom_logo_args = get_theme_support( 'custom-logo' );

        return array(
            "sections" => array(
                "{$prefix}section" => array(
                    'title'  => Translations::get( 'logo' ),
                    'panel'  => 'header_panel',
                    'type'   => 'colibri_section',
                    'hidden' => true
                )
            ),

            "settings" => array(

                "alternate_logo" => array(
                    'default' => Defaults::get( "dark_logo", "" ),
                    'control' => array(
                        'label'       => Translations::escHtml( "alternate_logo_image" ),
                        'type'        => 'cropped_image',
                        'section'     => "{$prefix}section",
                        'priority'    => 35,
                        'colibri_tab' => "content",

                        'height'      => Utils::pathGet( $custom_logo_args, '0.height', false ),
                        'width'       => Utils::pathGet( $custom_logo_args, '0.width', false ),
                        'flex_height' => Utils::pathGet( $custom_logo_args, '0.flex-height', false ),
                        'flex_width'  => Utils::pathGet( $custom_logo_args, '0.flex-width', false ),

                        'active_rules' => array(
                            array(
                                "setting"  => "{$prefix}props.layoutType",
                                "operator" => "=",
                                "value"    => "image",
                            ),
                        )
                    ),

                ),

                "{$prefix}props.layoutType" => array(
                    'default' => Defaults::get( "{$prefix}props.layoutType" ),
                    'control' => array(
                        'label'       => Translations::get( 'layout_type' ),
                        'focus_alias' => "logo",
                        'type'        => 'select',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => "content",
                        'choices'     => array(
                            'image' => Translations::escHtml( "logo_image_only" ),
                            'text'  => Translations::escHtml( "site_title_text_only" ),/*
							'image_text_v' => Translations::escHtml( "image_with_text_below" ),
							'image_text_h'    => Translations::escHtml( "image_with_text_right" ),
							'text_image_v'    => Translations::escHtml( "image_with_text_above" ),
							'text_image_h'    => Translations::escHtml( "image_with_text_left" ),*/
                        ),
                    ),
                ),
            ),
        );
    }

    public function getPenPosition() {
        return static::PEN_ON_RIGHT;
    }

    public function renderContent() {
        View::partial( 'front-header', 'logo', array(
            "component" => $this,
        ) );
    }

    public function printTextLogo() {

        if ( $this->getLayoutType() == 'text' ) {
            echo sprintf( '<a class="text-logo" data-type="group" data-dynamic-mod="true" href="%1$s">%2$s</a>',
                $this->getHomeurl(), get_bloginfo( 'name' ) );
        }
    }

    public function getLayoutType() {
        $prefix = static::$settings_prefix;

        return $this->mod( "{$prefix}props.layoutType" );
    }

    public function getHomeUrl() {
        return esc_url( home_url( '/' ) );
    }

    public function printImageLogo( $class = '' ) {

        $class = $class ? "{$class}-image" : '';

        if ( $this->getLayoutType() == 'image' ) : ?>
            <a href="<?php echo $this->getHomeUrl(); ?>" class="d-flex align-items-center">
                <img src="<?php echo $this->customLogoUrl(); ?>"
                     class="h-logo__image h-logo__image_h logo-image <?php echo esc_attr( $class ); ?>"/>
                <img src="<?php echo $this->alternateLogoUrl(); ?>"
                     class="h-logo__alt-image h-logo__alt-image_h logo-alt-image <?php echo esc_attr( $class ); ?>"/>
            </a>
        <?php endif;
    }

    public function customLogoUrl() {
        $custom_logo_id = get_theme_mod( 'custom_logo', - 1 );

        if ( $custom_logo_id == - 1 || empty( $custom_logo_id ) ) {
            $placeholder =
                'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAAEH5aXCAAAAAXNSR0IArs4c6QAAFIxJREFUeAHtXQl4VNW9PzOZzGQmrGEPymbZyvJEEBAVEUGq7AUiPEQtr+99fbW1LVb72b5au2Ft+1WktmqtbX36WBICCaAQQPZ9C4sIQSBhXyIkQGZf7vv9751zc+/MnZk7mUky4ZvzfTPn3HP+53/+y1nuvf/zP5exZARBI0zd5vqdJu4h65xzNOBVWWEVVaURLs47AgJVNNAfwVCsJxgQjHoAlTDAb5MrmfLtjH4U5uxxy+kXD3nEvKM3ZWLO6SLvolNgna0iKCF4TVclsangn8xT7krHfmVBrLTcph4JUiuEUBYEZdz2RW6DV4gIMWO70OWmV7iO1n8REajOBcC6jfgKDUqEugXAeYlLN1QprgpEmrHaI3iVNMZKG1tmMhMB3bXKKcO+dNgjdkzqqPOPe1kV+ibvtAaSCIekxDWXwDpkybLgRXJsbFZg78SvCCwaMMHFxTQJSexTXFq8Ja3Y4ZdyVZ1QC5Dy/ueo53y2SVKBJkyFXSiELMo1C/VkQuSjtlX6vaF97I3jnjPmfPeAWDgiylypolhIlOVaMpRlRYAtVwutObXKivGko9ZHoeaw45XqEpuXuQfKBBZXCs3rgkRPHbkRJfDGq37howpJxwXnfHIRFC98WC7l8ziA0uO36F8QfnPMI8brrtTWETMEYZHYUPBCFWUsrVFdf2uvW/jxIbfw1y+9Ai+j+D/3uYU/n5QaL7roEzZf88vlQQRStz5UFShVYUziBXEhd2HCK8sviQl5fhBbw1UScTO/wPbwMaOJOBGugJyZjGqCVYORc0IUUDAtc07jebFiqQbqhDQQq17DlkN880mEGmFMQpRY8l1f00AaMSvuxpac86lHYkTU6oL71zlW6mpMmiTUleO5OnYzcDJqQy5/POgiw1Z5hLc1G0KVeZGrxV9iK1TfZoiNEhrN1hPIpLFD1cXBCPzvJoArYtV++YKZCsWW6oOLYMtuMJOlOa1EJC3+AgtVMXbbJGTxup9clm7FPsfjTsF5Kf2/FT627asAW3fVz9ZcCd6qBSv8sUy6q72Mm82r+FH4+xmNx4fmy4U2JC4eNmFl44FWPvrN3u0Sxmxy8mwxPhFcdoeudwoPbnAKtDzzFVMJSA0bjWYWoAQPQMaTcuwOMtCs0CHnWTOkJAkcjy5s9CaXXBaWeE0QjMqWeVrPyMc9eVhwhNxHUIP13bsYjZX67l3ihCk2Mni98y9hckxCBpiYLIuLEiTcJOBVoSBRUYYsrq6fuO9RQSR4wRsIQwNmVoV1lzpkWJc5ot+A/KPce7wOeOUq/de6xodRr5Wx+orQX64VR0ILV8w84C/R08a39rlfjolMDwAam4nfkVePenyjNrputC9ybNVTr15h+PJrKnSJ92amfOdD1KBy1q9XAuJBPmqTYNpR6V+sR20xYKpyixwb4mk7YVgQNE/PIhCD8FjFtwAgvhnSS7A4e8UCBlIrYGrXxFgVklu+GpPgxFgo5RlYC5AYINGhrLGYILImEA3zSt1ntWjkeRE18sXNwM2+LQwtOGAKxd2hoYpQesI0YipwPuzHIEhRJoj+cihoaSgjqms8hfYmNTaRUKIkXtW1SBNGVY4SNPXStzxsVkuLYQlRJnctaGF+U2KCiG9hZotpLVMxgotXKKOphSdzfT8lmmWNaDFAD4DcFMHjez5xsu6rnaIJo+8a6VGMlz0NGxvZ2cZudrHhG1xsGH7mAmnm5jC8Hbp+oVQyfeyvCjAXHuEo73WYQCimOX8e7HQ2PNKNwqNbaH2OZ3T7jNmUjrp6doLJ5N0hFhHJ+Uk2se5Ze4D58rLFdCTkVLj/hvRw+e17MkVY5R89PVNYOMjMBrc2sglbXWza3Sb2RCcTI1thBvr4qkt+tvCkl3lmZDPq8pHaapXJuhGuqIwQwLd7mNh39rsZMUVhXEeTjPRJNMxDV2jpoiPAjj9pY98F/I96Z7I8EPfABid7d7D4woN1Xilp52JQKHRNj/yXJmez9niTQMR2b2ZkmHRYi0wDe/9+CzRqZ+YMA2uGa61wzS18ocpvIlNuGJnPH/TMIUZkNgExBtfrVdyl+AWZE3MsIU+7WPbpNro6xWlXkdd9jXMGz5A1wjNIdzydyjGeHo9WTs2uNZFpEQte6HkgZcO965zPadGtmfeTI95XU5ETTWKRGda1QgEPVwdODmxp6Bma35DX1NdBaA7GcVXC7UI7CxpDQx2L3F9PmHgtBG2LRbPz0npmKler7XrNa5YvtANT08/UBDTeOUdn92i1+BpjZavlzmfrlcg08jtJAlkrnN2In8xCx3CKsb+jH8UpHx7Z6HwPI2JXeY3Y7yMOjqClxvurY94VAKL3ZY0bQARt+xryt9Nee0SqdRS4YYtz+oS/NQo3oG/03uu11kAd9OoC+aDcq362qC/uHlgr5BypDtRpX4EuToJA3VY5ztQXD2Q5mxIPMUmArcpdJUjP18ni6oktzgtJICxuFD7MGz3WSHaVhHhBy4bF53xn46YgiRWIGYTEblmAYIeIppH/vGCmXZHjqTppZfFZX34j0x/WPO0+iIuZ8dvcM8KwpEZGxOcRzQcrojkuzhsQuPsnzoqKCbbuoU2GqQr7yK6EAqXSdfl4azctesIY2TvW2kELMJXy3irzlEWlZ2GZ90hqDIXYVIQyohojqTw2QgkvrQosui9HehNPZXLX2nddmBsKnMrXg1ob/11Jn6wRrKBuvPSWXpsrIVI7bcMrItFII2ukCTLB1l4OLFTJefZu4a7YwyslIWSPIbFrgcSZ4GyxirsmcOHFnkwYgUQexK5VWi2oBg7ngTaa8sDT1z1MtPORbYJC0UU/O3ZLuhHgMBR/hB/ZICmUYJPqAdgJlWE9zG+hG1MXnfWzDxVtUm3a0HritvaNRqY8MIKz1qBWhm7KRnj6v/Z72ObKAPshjJYfYDcsSaBDkZ3ZwV87xORC8LOjHvbpJYnhuXvdYlWKibm7YVo7VB1gvz/hZfnBXbgEQEbOydvd7OOzPtmMR2a4Xx7zsPdP+1gPGFwpZMIUd84hsP5rHIwMplrBVmzPpXzRCHjNxTq3lzcB14KvH5XFntrpEn3JXDBKvgGLa6/mRvabAZnsIxDxp+D239oatanfDcyEtrB1GIIIDWTkLB1nYwNaGmRGyJZ4MU96INyCOmVBLZDBlMyHzx/wsD1jwol0TM6+RPhF5YCJZqGN0fXDbY0iE/CrYCYgq4B0+rWU9DkA8VlcRwpk2Dx1O8C+37PWYKqE7ddC7NrKLDFtWeZgj29xAXetAAa2QluwJmsFywqXuK9UpOqKi0W8USQkr/SVTMx9mhvY9q8k0/Ku637WG9oxA4NLo43KKZIJW6txyqNN3lrBPd0mWnX7ADcPOwBLbWkF99Ss05QviqtjFruAdBctQGXeizA5/wT+jbRh4KZHEKV9t83Apu9wsbfQXSxYjHhoHVxaaVBTeOeUl31c4WVze2SKZufHsO9baXb+BkzdpMVWZgPtfGZdgJeC0oQtZoT80ab12980XBez113x/zmeVeICnJlDA5wu4g6h+8MJKz3WKoPWvnJlOedLZBsFg5BxkGc2lZiWgrZK83SLFexcUyFeSWcbM9vNr8URJPcxnttE4mf3etaGkfrBGe9uZd9rCmklE/I0A8LJQSaKK4iyWuOnV13210zKNTXnlMiTM6Y8d+j9EAdKxXhip4xHlXTJjFAm9k49oixM1fTu6wFaa1QnN6gYQeHWTde0V9xUYmp4G+NjofTIY4QXYKzQ3eRFfp1q8b4bAfvQNhlh94YqjRDR0MolaOXzVGOA02PMMbbmaWUcxggVzv3CeD+tmikYpg4xGOTHW130oYuZUmktgbHpvC7CtYBwl/t0yD1co/C24apfvFXXopHnhQ12XsBjUE598ga/boR4J8btg7Ha1RwjykpAQjaJzCM3G35a/u0XvrV6mFDSGzPdaoXQCtrZ01B96zsHvKNjEpUIgJ6jpxJhtsHtMyB2JF4uJEKzqi58D48nIuCE64IayzN7XKdUVOm/cL161PtawkQkG4GpoOZx8DCoY7H9GuIdrxz2VCF24/cVfmREWlTjE2YjtsVtoU02sWl8aQnokkDMhV0XlnoEyl1ln9i/malfyShzBZrp/ePD3skDWxmsz3Q10b1j85WX/DntswzW4TlGen17G+/KfeYM5piSm3EZ12en7XR3thpZ2cfDLe/gugwORn07t7Mdq3jU0GSe6kF3w4WvfSpYWix3vIB5bDp+xQeq/G74BSHZIMGVt9N15u1T3pfQmgW/lO+g9aKZTsWOvTVeYX2DiDzORj69LJ5WQucqjMT+3j71IoDGRvrgRnfea0c9++OUTUqAB/cwk0NDLjfxNbY869R+99WOP4KZgykh1SQRcc4uTqX0erxb63yhZZ0E05CVrIWOqSC2UXx+kiRz3Whw9oIAS+q/UEHbzltHwSdlEQNR9IplNU5KHWHLqCMlTbjaH8q8p3dVsmkrHjYfblQ2Rm/xjrjtFY7p7lZ3OOB1eHC/dVqIad5PutLaFDmGYZE+Qr4r6aApATo8rE5TWdxTFhqaAg2vSLqW7zCEpdjU9dQO965rzDr+5oQkOOSGyidnpWP42yc9pzX7QzozmgToJbnu0aJrhAAhGUVP4Ccb5UMVlr6OKoHbKO1DNtmoUCiMaduBMsg0QRbqtDJiSTNyeXOcVXNxzm73q5FBdJRM3u787SVng71Xijbs76SykdFEH3HKggSGoOK+aJXTZfFLYCs2MeOg/2VnJtjk02iUWDSnrOzCmlcWlPm2KAHT6eRIYGQ7Izs93joGHZ429oUFzRECYDrIeGIYdDojaRK4f73zq0PVbJIvz7ZLiTTsdqx9kf1zbM7oNzC4dV8JnE4nTwL7xlrbAlt26IgIm7KuTrbdTisjeYKPhum7Bzwf4vRmuouVg0pBd69yFC95wDJpRJswPckV0omkS+A+PJ+UcqwqyZ+bYD2YVgYXTcPEg0pci5UHi8gjhA4+f6qLoeDjYZaOekj55TEv+zUc6+izaBdw5iUh2g6vp1EbJSe7g+OsjKa+ndjonbfTza44azcNdsaHBQtGWNjQHKk/9FvrZGW3Auz1gWb2Uh/Jc4tOQF0CH7pZXU3so2EW8SRUfBVDRRo5Mf26fyYj5ygKj+G01C2AebGPmb0B/7rQUI1tETPhr4dtnXIRubzNh7/evCAOKiAPydm73QxfpZPhmsPJLh80j+0g2Rf04pIRRE6odmfKI8SXZ90OZejeifGLfplsRheTeOjo9w56xGNfZ+2SPCcXPZAlKmMZvCVHfuYUYcjdjU5tJeXR4aYjcJgpdoxEJjNCCR2GSnjccIC0gHryUlv4Za2raoRqzI3+QB5mpAw6UZZw0G8YOsXLwPEMOgAF8vAcj9NgfdDF7WkSDB3ECjMDewL+g+SOqhdXJFqU+QtP+npnFNgn8zxZIXAb/e+3v/TdxQv0xIuHW9gA+CO+Bxe8weuc7DJGwc/7mXF6rNSLPgv26Im5GYy77XXEiBoT7GWfKXqqnvYIhs7/vYFt7f+H0UNCojBMx5pHoxfmAhH+2W61N5dzgmk+avCNGRHmobYZjH8apmczg6xAyedSHy4RUYy/F3qZmvtnZBdzMFkh3rzsd77X03STF+iNdzxmZS3h64hTqdh0HONLI4cH7kbpDAqC5wflKHrH8jy9Mb6qJSqf/Jdpyqr6ptTLY9XntBCcUzEwyV+aQiYdgizGYgQ/akl5C0762BhMheTTSb9ijGq9uCRM0f/hs+3BXrGZHEpWSEa+fdILpV4FqRwkekwm265Bp9O+LWR0YqWZmNIorMecTAdAU1gOL3ea5ynkBcv7Br1tNyKfxOCBkLYHfatDcT7X3cTKJ1jZM90zmQeKHo6pT094BE/IudgxR4E+NkrTDrlGvwkHXAp8VM9Ap6JAo5c+E/XDXiZW8kgWDq2Wl1umF5eIKMbff/QwlXtm2JZwsNpWkIMn9EWIZvFCvfF9mK5ohNB0pRwhVJ889X8A7/2l530MJ+MxG5zG6UDst+CMnl07c7C/nPKxX+EmAWZQsdkeOAB7AWCe7CRNf3S8OS3qtIb84d8kt+Wh613sYJWfTcg1saKHLPKiHkr38z0zxfYo/5/lPvrwqbiukZDpBPG/D7Uwpe95DWj+EU4IWIrRCKdhcfSQb/vv7zWzUVAsD3pwcdhI8ZQd7lMlV9k417SsMwSjUkjXVfaj+8fa+rfVfMsSCWU6P0EJzMJziDxCatUNrDiaahiUEfuWJUEK0tUlCRRe9Ptx6pzqMy6qEULf6+1pdu3eNzarV1poDSKB1zE6fqpsSTGL46t/MMbvE4R7AVCFX3riUkoqyek1l/0enBwQto9LNWUF23SN3uxemaIurEkWS+Ohe6JTxuzKKbawjyKFKQRDSNj0aFYeDrB4r/HIvbNbfvNL37qcAu0Ph6jWEKUYsouFDsuH+Ysf75AxTJmfTicsgXXo9OMiYYmoEF4BzybbkH6IX6fjhCSwHcp4OBqGsCkrFDiIID80P32tXwL0qPvmSd9u63LX07FqxRwhhIBuhx9t6V6MJ9pxWFvSIX4JvIiO/af4q8WogemrG37k65wOOiTwHj7EAB/xf8UQa2LF1nxnl+8f9GzGKXnpEF0CCxKTdJy1B5e4++CgoYPpfY1hWqGPATTe91LQeC5+n4cemxhG5h2egSMpT4zbqvNb7XF2/jqBt5J8zZPylfumoju4dgvvn/bibVMjjgg92ur1qWML7Ah37OJ/wRmohhKm2ArtnfTII2VgQLQJX2ldeuCGv94/OlSfo4o+T41AH7Ccl13oGpMyAk6UEDA0etxmZyVxl+qhUvo84DbQOdpU6ByZKO9Nov6Ere6X55V6toPpRp3e6GxnfO+JRvG7+A3BkRoDm4QA65tIc7776wNL3P0hFNquP/+5va5LODwbS2fiAZsWCAnh2oW9VQs647wVpBvv9rS+hdkQ+DuUCNmD9wvyPqPMpfa57fIF8cBV01L7z5U0mPJrvqG8TqfTEqiTBP4f/Nu7m4GGni8AAAAASUVORK5CYII=';

            return $placeholder;
        }

        return esc_url( wp_get_attachment_image_url( $custom_logo_id, 'full' ) );
    }

    public function alternateLogoUrl() {
        $alternate_logo_id = get_theme_mod( 'alternate_logo', - 1 );

        if ( $alternate_logo_id == - 1 || empty( $alternate_logo_id ) ) {
            return $this->customLogoUrl();
        }
        if ( is_numeric( $alternate_logo_id ) ) {
            return esc_url( wp_get_attachment_image_url( $alternate_logo_id, 'full' ) );
        } else {
            return esc_url( $alternate_logo_id );
        }
    }
}
src/Components/Header/NavBarStyle.php000064400000020235151335104360013556 0ustar00<?php

namespace ColibriWP\Theme\Components\Header;


use ColibriWP\Theme\Core\PartialComponent;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;

class NavBarStyle extends PartialComponent {

	private static $instances = array();

	protected $prefix = "header_front_page.navigation.";
	protected $selector = "";

	public function __construct( $prefix, $selector ) {
		$this->prefix   = $prefix;
		$this->selector = $selector;
	}

	public static function getInstance( $prefix, $selector ) {
		if ( ! isset( static::$instances["{$prefix}_{$selector}"] ) ) {
			static::$instances["{$prefix}_{$selector}"] = new static( $prefix, $selector );
		}

		return static::$instances["{$prefix}_{$selector}"];
	}

	public function getOptions() {
		$prefix      = $this->getPrefix();
		$section     = 'nav_bar';
		$colibri_tab = 'content';
		$priority    = 10;

		return array(
			"settings" => array(

				"{$prefix}props.layoutType" => array(
					'default'    => Defaults::get( "{$prefix}props.layoutType" ),
					'control'    => array(
						'label'       => Translations::get( 'layout_type' ),
						'focus_alias' => "navigation",
						'type'        => 'select-icon',
						'section'     => $section,
						'colibri_tab' => $colibri_tab,
						'priority'    => $priority ++,
						'choices'     => array(
							'logo-spacing-menu' =>
								array(
									'tooltip' => Translations::get( 'logo_nav' ),
									'label'   => Translations::get( 'logo_nav' ),
									'value'   => 'logo-spacing-menu',
									'icon'    => Defaults::get( 'icons.logoNav.content' ),
								),

							'logo-above-menu' =>
								array(
									'tooltip' => Translations::get( 'logo_above' ),
									'label'   => Translations::get( 'logo_above' ),
									'value'   => 'logo-above-menu',
									//'icon'    => $icons['logoAbove']['content'],
									'icon'    => Defaults::get( 'icons.logoAbove.content' ),
								),
						),
					),
					'css_output' => array(
						array(
							'selector' => "{$this->selector} .h-column-container",
							'property' => 'flex-basis',
							'value'    => array(
								'logo-spacing-menu' => 'auto',
								'logo-above-menu'   => '100%',
							),
						),
						array(
							'selector' => "{$this->selector} .h-column-container:nth-child(1) a",
							'property' => 'margin',
							'value'    => array(
								'logo-spacing-menu' => 'auto',
								'logo-above-menu'   => 'auto',
							),
						),
						array(
							'selector' => "{$this->selector} .h-column-container:nth-child(2)",
							'property' => 'display',
							'value'    => array(
								'logo-spacing-menu' => 'block',
								'logo-above-menu'   => 'block',
							),
						),
						array(
							'selector' => "{$this->selector} div > .colibri-menu-container > ul.colibri-menu",
							'property' => 'justify-content',
							'value'    => array(
								'logo-spacing-menu' => 'normal',
								'logo-above-menu'   => 'center',
							),
						),

					),
					/*'js_output' => array(
						array(
							'selector' => "{$this->selector}#navigation",
							'action'   => 'colibri-component-restart',
							'value'    => 'navigation'
						),
					)*/
				),

				"{$prefix}separator1" => array(
					'default' => '',
					'control' => array(
						'label'       => '',
						'type'        => 'separator',
						'section'     => 'nav_bar',
						'colibri_tab' => $colibri_tab,
						'priority'    => $priority ++,
					),
				),

				"{$prefix}props.sticky" => array(
					'default'   => Defaults::get( "{$prefix}props.sticky" ),
					'control'   => array(
						'label'       => Translations::get( 'stick_to_top' ),
						'type'        => 'switch',
						'section'     => $section,
						'colibri_tab' => $colibri_tab,
						'priority'    => $priority ++,
					),
					'js_output' => array(
						array(
							'selector' => "{$this->selector}#navigation",
							'action'   => "colibri-navigation-toggle-sticky",
						),

					),

				),

//				"{$prefix}props.overlap" => array(
//					'default'   =>  Defaults::get( "{$prefix}props.overlap" ),
//					'control'   => array(
//						'label'       => Translations::get( 'transparent_nav' ),
//						'type'        => 'switch',
//						'section'     => $section,
//						'colibri_tab' => $colibri_tab,
//						'priority'    => $priority ++,
//					),
//					'js_output' => array(
//						array(
//							'selector' => ".h-navigation_outer",
//							'action'   => "toggle-class",
//							'value'    => 'h-navigation_overlap',
//						),
//						array(
//							'selector' => "{$this->selector}#navigation",
//							'action'   => "colibri-navigation-toggle-overlap",
//							'callback' => "colibriUpdateHeroPenPosition",
//						),
//					),
//				),

				"{$prefix}separator2" => array(
					'default' => '',
					'control' => array(
						'label'       => '',
						'type'        => 'separator',
						'section'     => 'nav_bar',
						'colibri_tab' => $colibri_tab,
						'priority'    => $priority ++,
					),
				),

				"{$prefix}props.width" => array(
					'default'   => Defaults::get( "{$prefix}props.width" ),
					'control'   => array(
						'label'       => Translations::get( 'container_width' ),
						'section'     => $section,
						'type'        => 'button-group',
						'button_size' => 'medium',
						'choices'     => array(
							'boxed'      => Translations::escHtml( "boxed" ),
							'full-width' => Translations::escHtml( "full_width" ),
						),
						'colibri_tab' => $colibri_tab,
						'priority'    => $priority ++,
						'none_value'  => '',

					),
					'js_output' => array(
						array(
							'selector' => ".style-local-" . Defaults::get( "{$this->prefix}.nodeId" ) . "-outer",
							'action'   => "set-class",
							'value'    => array(
								'boxed'      => 'colibri-theme-nav-boxed',
								'full-width' => 'colibri-theme-nav-full-width'
							),
						),
						array(
							'selector' => "{$this->selector} .h-section-boxed-container, {$this->selector} .h-section-fluid-container",
							'action'   => "set-class",
							'value'    => array(
								'boxed'      => 'h-section-boxed-container',
								'full-width' => 'h-section-fluid-container'
							),
						),
					),
				),

				"{$prefix}style.padding.top.value" => array(
					'default'    => Defaults::get( "{$prefix}style.padding.top.value" ),
					'control'    => array(
						'label'       => Translations::get( 'navigation_padding' ),
						'type'        => 'slider',
						'section'     => $section,
						'colibri_tab' => $colibri_tab,
						'priority'    => $priority ++,
						'min'         => 0,
						'max'         => 120,
					),
					'css_output' => array(
						array(
							"selector"      => $this->selector . "[data-colibri-component=\"navigation\"]#navigation",
							"property"      => "padding-top",
							"value_pattern" => "%spx",
						),
						array(
							"selector"      => $this->selector . "[data-colibri-component=\"navigation\"]#navigation",
							"property"      => "padding-bottom",
							"value_pattern" => "%spx",
						),
					),
				),
				//add hidden input to show edit element button
				"{$prefix}hidden"                  => array(
					'default' => '',
					'control' => array(
						'label'       => '',
						'type'        => 'hidden',
						'section'     => 'nav_bar',
						'colibri_tab' => $colibri_tab,
						'priority'    => $priority ++,
					),
				),
			),
		);
	}

	/**
	 * @return string
	 */
	public function getPrefix() {
		return $this->prefix;
	}

	public function renderContent() {
		$this->addFrontendJSData(
			Defaults::get( $this->getPrefix() . 'nodeId', 'no_component' ),
			array(
				'data' => array(
					'overlap' => true
				)
			) );

		if ( $style = $this->getNavLayoutStyle() ) {
			printf( "<style>%s</style>", $style );
		}
	}

	public function getNavLayoutStyle() {
		$layoutType = $this->mod( 'props.layoutType' );
		$css        = '';

		switch ( $layoutType ) {
			case 'logo-above-menu':
				$css .= "{$this->selector} .h-column-container  { flex-basis: 100%; }" .
				        "{$this->selector} .h-column-container:nth-child(1) a { margin: auto; }" .
				        "{$this->selector} div > .colibri-menu-container > ul.colibri-menu { justify-content: center; }";
				break;
		}

		return $css;
	}

	public function mod( $name ) {
		return parent::mod( $this->getPrefix() . $name );
	}
}
src/Components/Header/HeroStyle.php000064400000100554151335104360013305 0ustar00<?php


namespace ColibriWP\Theme\Components\Header;


use ColibriWP\Theme\Components\CSSOutput;
use ColibriWP\Theme\Core\PartialComponent;
use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;

class HeroStyle extends PartialComponent {

	private static $instances = array();
	protected $prefix = "";
	protected $selector = "";

	public function __construct( $prefix, $selector ) {
		$this->prefix   = $prefix;
		$this->selector = $selector;
	}

	public static function getInstance( $prefix, $selector ) {
		$key = Utils::slugify( "{$prefix}-{$selector}" );
		if ( ! isset( static::$instances[ $key ] ) ) {
			static::$instances[ $key ] = new static( $prefix, $selector );
		}

		return static::$instances[ $key ];
	}

	public function renderContent() {
		?>
        <div class="background-wrapper" data-colibri-hide-pen="true">
            <div class="background-layer">
                <div class="background-layer">
					<?php $this->doSlideshow(); ?>
					<?php $this->doVideoBackground(); ?>
                </div>
                <div class="overlay-layer"></div>
                <div class="shape-layer"></div>
            </div>
        </div>
		<?php
	}

	public function doSlideshow() {
		$slideshow_prefix = "style.background.slideshow.";
		$component_id     = "{$this->getPrefix()}slideshow";
		$slides           = $this->prefixedMod( "{$slideshow_prefix}slides" );


		$slide_duration = $this->prefixedMod( "{$slideshow_prefix}duration.value" );
		$slide_speed    = $this->prefixedMod( "{$slideshow_prefix}duration.value" );

		$this->printSlideshow( $component_id, $slides, $slide_duration, $slide_speed );
	}

	/**
	 * @return string
	 */
	public function getPrefix() {
		return $this->prefix;
	}

	/**
	 * @param string $prefix
	 *
	 * @return HeroStyle
	 */
	public function setPrefix( $prefix ) {
		$this->prefix = $prefix;

		return $this;
	}

	public function prefixedMod( $name ) {
		$name = $this->getPrefix() . $name;

		return $this->mod( $name );
	}

	public function printSlideshow( $component_id, $slides, $slide_duration, $slide_speed ) {

		if ( $this->prefixedMod( 'style.background.type' ) !== 'slideshow' ) {
			return;
		}

		?>
        <div class="colibri-slideshow background-layer"
             data-colibri-id="<?php echo esc_attr( $component_id ); ?>"
             data-slide-duration="<?php echo esc_attr( $slide_duration ); ?>"
             data-slide-speed="<?php echo esc_attr( $slide_speed ); ?>"
             data-colibri-component="slideshow">
			<?php foreach ( $slides as $slide ): ?>
				<?php $this->printSlide( $slide ); ?>
			<?php endforeach; ?>
        </div>
		<?php
	}

	private function printSlide( $slide ) {
		?>
        <div class="slideshow-image"
             style="background-image:url(<?php echo esc_attr( $slide['url'] ); ?>)"></div>
		<?php
	}

	public function doVideoBackground() {

		$component_id = "{$this->getPrefix()}video";

		$this->printVideoBackground( $component_id );
	}

	public function printVideoBackground( $component_id ) {

		if ( $this->prefixedMod( 'style.background.type' ) !== 'video' ) {
			return;
		}
		$video_prefix = "style.background.video.";

		$mime_type = "video/mp4";
		$poster    = $this->prefixedMod( "{$video_prefix}poster.url" );
		$video     = "";

		if ( $this->prefixedMod( "{$video_prefix}videoType" ) === "external" ) {
			$mime_type = "video/x-youtube";
			$video     = $this->prefixedMod( "{$video_prefix}externalUrl" );
		} else {
			$id = absint( $this->prefixedMod( "{$video_prefix}internalUrl" ) );
			//$poster = $this->prefixedMod( 'video_background_self_hosted_poster' );

			if ( $id ) {
				$video     = wp_get_attachment_url( $id );
				$type      = wp_check_filetype( $video, wp_get_mime_types() );
				$mime_type = $type['type'];
			}

		}

		?>
        <div
                class="colibri-video-background background-layer"
                data-colibri-component="video-background"
                data-mime-type="<?php echo esc_attr( $mime_type ); ?>"
                data-video="<?php echo esc_attr( $video ); ?>"
                data-poster="<?php echo esc_attr( $poster ); ?>"
                data-colibri-id="<?php echo esc_attr( $component_id ); ?>">
        </div>
		<?php
	}

	public function whenCustomizerPreview() {
		$component_id     = "{$this->getPrefix()}slideshow";
		$slideshow_prefix = "style.background.slideshow.";
		$this->addFrontendJSData(
			$component_id,
			array(
				"wpSettings" => array(
					"slideDuration" => "{$this->getPrefix()}{$slideshow_prefix}duration.value",
					"slideSpeed"    => "{$this->getPrefix()}{$slideshow_prefix}speed.value",
				),
			),
			true
		);


		$video_prefix       = "style.background.video.";
		$video_component_id = "{$this->getPrefix()}video";

		$this->addFrontendJSData(
			$video_component_id,
			array(

				"wpSettings" => array(
					"videoType"   => "{$this->getPrefix()}{$video_prefix}videoType",
					"externalUrl" => "{$this->getPrefix()}{$video_prefix}externalUrl",
					"internalUrl" => "{$this->getPrefix()}{$video_prefix}internalUrl",
					"posterUrl"   => "{$this->getPrefix()}{$video_prefix}poster.url",
				),
			)
		);

	}

	public function getOptions() {
		$prefix = $this->getPrefix();

		$wrapper_settings = array_merge(
			$this->getSlideshowSettings( $prefix ),
			$this->getVideoSettings( $prefix ),
			$this->getOverlaySettings( $prefix ),
			$this->getDividerSettings( $prefix ),
			array()
		);

		foreach ( $wrapper_settings as $key => $setting_data ) {
			if ( ! isset( $setting_data['control']['selective_refresh'] ) ) {
				$wrapper_settings[ $key ]['control']['selective_refresh'] = array(
					'selector' => $this->getSelector() . " .background-wrapper",
					'function' => array( $this, 'renderContent' )
				);
			}
		}

		return array(
			"settings" => array_merge( array(),
				$this->getGeneralBackgroundSettings( $prefix ),
				$this->getImageSettings( $prefix ),
				$this->getGradientSettings( $prefix ),
				$wrapper_settings,
				$this->getSpacingSettings( $prefix )
			)
		);
	}

	protected function getSlideshowSettings( $prefix ) {

		$slideshow_prefix = "{$prefix}style.background.slideshow.";

		$self = $this;

		return array(
			"{$slideshow_prefix}slides" => array(
				'default' => Defaults::get( "{$slideshow_prefix}slides" ),
				'control' => array(
					'colibri_tab'    => 'style',
					'label'          => Translations::escHtml( "slideshow" ),
					'type'           => 'repeater',
					'section'        => 'hero',
					'item_label'     => Translations::get( 'slide_n' ),
					'item_add_label' => Translations::get( 'add_slide' ),
					'fields'         => array(
						'url' => array(
							'type'    => 'image',
							'label'   => Translations::get( 'image' ),
							'default' => Defaults::get( "{$slideshow_prefix}slides.0.url" ),
						),
					),
					'active_rules'   => array(
						array(
							"setting"  => "{$prefix}style.background.type",
							"operator" => "=",
							"value"    => "slideshow",
						),
					),
				),
			),

			"{$slideshow_prefix}duration.value" => array(
				'default'   => Defaults::get( "{$slideshow_prefix}duration.value", 100 ),
				'transport' => 'postMessage',
				'control'   => array(
					'label'        => Translations::escHtml( "slide_duration" ),
					'colibri_tab'  => 'style',
					'type'         => 'slider',
					'section'      => 'hero',
					'min'          => 0,
					'max'          => 10000,
					'step'         => 100,
					'active_rules' => array(
						array(
							"setting"  => "{$prefix}style.background.type",
							"operator" => "=",
							"value"    => "slideshow",
						),
					),
				),
			),

			"{$slideshow_prefix}speed.value" => array(
				'default'   => Defaults::get( "{$slideshow_prefix}speed.value" ),
				'transport' => 'postMessage',
				'control'   => array(
					'label'        => Translations::escHtml( "effect_speed" ),
					'colibri_tab'  => 'style',
					'type'         => 'slider',
					'section'      => 'hero',
					'min'          => 100,
					'max'          => 10000,
					'step'         => 100,
					'active_rules' => array(
						array(
							"setting"  => "{$prefix}style.background.type",
							"operator" => "=",
							"value"    => "slideshow",
						),
					),
				),
			),

		);
	}

	protected static function getVideoSettings( $prefix ) {

		$base_active_rule
			= array(
			"setting"  => "{$prefix}style.background.type",
			"operator" => "=",
			"value"    => "video",
		);


		$video_prefix = "{$prefix}style.background.video.";

		//$self = $this;


		return array(
			"{$video_prefix}videoType" => array(
				'default' => Defaults::get( "{$video_prefix}videoType" ),
				'control' => array(
					'label'        => Translations::get( 'video_type' ),
					'type'         => 'button-group',
					'button_size'  => 'medium',
					'choices'      => array(
						'internal' => Translations::escHtml( "self_hosted" ),
						'external' => Translations::escHtml( "external_video" ),
					),
					'section'      => 'hero',
					'colibri_tab'  => 'style',
					'active_rules' => array( $base_active_rule ),
				),

			),

			"{$video_prefix}externalUrl" => array(
				'default' => Defaults::get( "{$video_prefix}externalUrl" ),
				'control' => array(
					'label'        => Translations::get( 'youtube_url' ),
					'type'         => 'input',
					'section'      => 'hero',
					'colibri_tab'  => 'style',
					'active_rules' => array(
						$base_active_rule,
						array(
							"setting"  => "{$video_prefix}videoType",
							"operator" => "=",
							"value"    => "external",
						),
					),
				),

			),

			"{$video_prefix}internalUrl" => array(
				'default' => Defaults::get( "{$video_prefix}internalUrl" ),
				'control' => array(
					'label'        => Translations::get( 'self_hosted_video' ),
					'type'         => 'video',
					'section'      => 'hero',
					'colibri_tab'  => 'style',
					'active_rules' => array(
						$base_active_rule,
						array(
							"setting"  => "{$video_prefix}videoType",
							"operator" => "=",
							"value"    => "internal",
						),
					),
				),

			),


			"{$video_prefix}poster.url" => array(
				'default'   => Defaults::get( "{$video_prefix}poster.url" ),
				'transport' => 'postMessage',
				'control'   => array(
					'label'       => Translations::get( 'video_poster' ),
					'type'        => 'image',
					'section'     => 'hero',
					'colibri_tab' => 'style',

					'active_rules' => array(
						$base_active_rule,
						array(
							"setting"  => "{$prefix}style.background.type",
							"operator" => "=",
							"value"    => "video",
						),
					),

				),

			),

		);
	}


	public function getOverlaySettings( $prefix ) {

		$overlay_prefix = "{$prefix}style.background.overlay.";

		$active_rule_base = array(
			"setting"  => "{$overlay_prefix}enabled",
			"operator" => "=",
			"value"    => true,
		);

		$shape_base_url = get_template_directory_uri() . '/resources/images/header-shapes';

		return array(

			"{$prefix}hero.separator5" => array(
				'default' => '',
				'control' => array(
					'label'        => '',
					'type'         => 'separator',
					'section'      => 'hero',
					'colibri_tab'  => 'style',
					'active_rules' => array(
						array(
							"setting"  => "{$prefix}style.background.type",
							"operator" => "!=",
							"value"    => "color",
						),
					),
				),
			),

			"{$overlay_prefix}type" => array(
				'default'   => Defaults::get( "{$overlay_prefix}type" ),
				'transport' => 'postMessage',
				'control'   => array(
					'label'        => Translations::get( 'overlay_type' ),
					'type'         => 'button-group',
					'button_size'  => 'medium',
					'choices'      => array(
						'shapeOnly' => Translations::escHtml( "shape_only" ),
						'color'     => Translations::escHtml( "color" ),
						'gradient'  => Translations::escHtml( "gradient" ),
					),
					'section'      => 'hero',
					'colibri_tab'  => 'style',
					'active_rules' => array( $active_rule_base ),
				),
			),


			"{$overlay_prefix}shape.value" => array(
				'default'      => Defaults::get( "{$overlay_prefix}shape.value", "none" ),
				'transport'    => 'postMessage',
				'control'      => array(
					'label'       => Translations::escHtml( "overlay_shape" ),
					'type'        => 'select',
					'section'     => 'hero',
					'colibri_tab' => 'style',
					'size'        => 'small',
					'choices'     => array(
						'none'                      => Translations::get( 'none' ),
						'circles'                   => Translations::get( 'circles' ),
						'10degree-stripes'          => Translations::get( '10degree_stripes' ),
						'rounded-squares-blue'      => Translations::get( 'rounded_squares_blue' ),
						'many-rounded-squares-blue' => Translations::get( 'many_rounded_squares_blue' ),
						'two-circles'               => Translations::get( 'two_circles' ),
						'circles-2'                 => Translations::get( 'circles_2' ),
						'circles-3'                 => Translations::get( 'circles_3' ),
						'circles-gradient'          => Translations::get( 'circles_gradient' ),
						'circles-white-gradient'    => Translations::get( 'circles_white_gradient' ),
						'waves'                     => Translations::get( 'waves' ),
						'waves-inverted'            => Translations::get( 'waves_inverted' ),
						'dots'                      => Translations::get( 'dots' ),
						'left-tilted-lines'         => Translations::get( 'left_tilted_lines' ),
						'right-tilted-lines'        => Translations::get( 'right_tilted_lines' ),
						'right-tilted-strips'       => Translations::get( 'right_tilted_strips' ),
					),
				),
				'css_output'   => array(
					array(
						'selector'      => "{$this->selector} .background-layer .shape-layer",
						'media'         => CSSOutput::NO_MEDIA,
						'property'      => 'background-image',
						'value_pattern' => 'url(' . $shape_base_url . '/%s.png)',
					),
				),
				'active_rules' => array( $active_rule_base ),
			),

			"{$overlay_prefix}light" => array(
				'default'      => Defaults::get( "{$overlay_prefix}light" ),
				'transport'    => 'postMessage',
				'control'      => array(
					'label'       => Translations::escHtml( "shape_light" ),
					'type'        => 'slider',
					'section'     => 'hero',
					'colibri_tab' => 'style',

				),
				'css_output'   => array(
					array(
						'selector'      => "{$this->selector} .background-layer .shape-layer",
						'media'         => CSSOutput::NO_MEDIA,
						'property'      => 'filter',
						'value_pattern' => 'invert(%s%%)',
					),
				),
				'active_rules' => array(
					array(
						"setting"  => "{$overlay_prefix}shape.value",
						"operator" => "!=",
						"value"    => "none",
					),
				),
			),

			"{$overlay_prefix}color.value" => array(
				'default'      => Defaults::get( "{$overlay_prefix}color.value" ),
				'transport'    => 'postMessage',
				'control'      => array(
					'label'       => Translations::get( 'color' ),
					'type'        => 'color',
					'alpha'       => false,
					'section'     => 'hero',
					'colibri_tab' => 'style',
				),
				'css_output'   => array(
					array(
						'selector' => "{$this->selector} .background-layer .overlay-layer",
						'media'    => CSSOutput::NO_MEDIA,
						'property' => 'background-color',
					),
				),
				'active_rules' => array(
					array(
						"setting"  => "{$overlay_prefix}type",
						"operator" => "=",
						"value"    => "color",
					),
				),
			),

			"{$overlay_prefix}gradient" => array(
				'default'      => Defaults::get( "{$overlay_prefix}gradient" ),
				'control'      => array(
					'label'       => Translations::escHtml( "gradient" ),
					'type'        => 'gradient',
					'section'     => 'hero',
					'colibri_tab' => 'style',
					'choices'     => Defaults::get( "gradients", "" ),
				),
				'css_output'   => array(
					array(
						'selector'      => "{$this->selector} .background-layer .overlay-layer",
						'media'         => CSSOutput::NO_MEDIA,
						'property'      => 'background-image',
						'value_pattern' => CSSOutput::GRADIENT_VALUE_PATTERN,
					),
				),
				'active_rules' => array(
					array(
						"setting"  => "{$overlay_prefix}type",
						"operator" => "=",
						"value"    => "gradient",
					),
				),
			),

			"{$overlay_prefix}color.opacity_" => array(
				'default'      => Defaults::get( "{$overlay_prefix}color.opacity" ),
				'transport'    => 'postMessage',
				'control'      => array(
					'label'       => Translations::get( 'opacity' ),
					'type'        => 'slider',
					'section'     => 'hero',
					'colibri_tab' => 'style',
					'min'         => 1,
					'max'         => 100,
				),
				'css_output'   => array(
					array(
						'selector'      => "{$this->selector} .background-layer .overlay-layer",
						'media'         => CSSOutput::NO_MEDIA,
						'property'      => 'opacity',
						'value_pattern' => "calc( %s / 100 )",
					),
				),
				'active_rules' => array(
					array(
						"setting"  => "{$overlay_prefix}type",
						"operator" => "in",
						"value"    => array( "color", "gradient" ),
					),
				),
			),

			"{$overlay_prefix}enabled" => array(
				'default'    => Defaults::get( "{$overlay_prefix}enabled" ),
				'transport'  => 'postMessage',
				'control'    => array(
					'label'       => Translations::get( 'show_background_overlay' ),
					'type'        => 'group',
					'section'     => 'hero',
					'show_toggle' => true,
					'controls'    => array(
						"{$overlay_prefix}type",
						"{$overlay_prefix}color.value",
						"{$overlay_prefix}gradient",
						"{$overlay_prefix}color.opacity_",
						"{$overlay_prefix}shape.value",
						"{$overlay_prefix}light",
					),
					'colibri_tab' => 'style',
				),
				'css_output' => array(
					array(
						'selector'    => "{$this->selector} .background-layer .overlay-layer",
						'media'       => CSSOutput::NO_MEDIA,
						'property'    => 'display',
						'false_value' => 'none',
					),
				),
			),
		);
	}

	public function getDividerSettings( $prefix ) {

		$divider_prefix   = "{$prefix}style.separatorBottom.";
		$section          = 'hero';
		$active_rule_base = array(
			"setting"  => "{$divider_prefix}enabled",
			"operator" => "=",
			"value"    => true,
		);

		return array(

			"{$prefix}hero.separator6" => array(
				'default' => '',
				'control' => array(
					'label'       => '',
					'type'        => 'separator',
					'section'     => 'hero',
					'colibri_tab' => 'style',
				),
			),

			"{$divider_prefix}enabled" => array(
				'default' => Defaults::get( "{$divider_prefix}enabled" ),
				'control' => array(
					'label'             => Translations::get( 'show_bottom_divider' ),
					'type'              => 'group',
					'section'           => $section,
					'show_toggle'       => true,
					'colibri_tab'       => 'style',
					'controls'          => array(
						"{$divider_prefix}type",
						"{$divider_prefix}color",
						"{$divider_prefix}height.value",
					),
					'selective_refresh' => array(
						'selector' => $this->getSelector(),
						'function' => array( $this, 'renderContent' )
					)

				),
			),

			"{$divider_prefix}type" => array(
				'default'      => Defaults::get( "{$divider_prefix}type", "none" ),
				'control'      => array(
					'label'             => Translations::escHtml( "divider_style" ),
					'type'              => 'select',
					'section'           => 'hero',
					'colibri_tab'       => 'style',
					'size'              => 'small',
					'choices'           => array(
						'tilt'                  => Translations::get( 'tilt' ),
						'tilt-flipped'          => Translations::get( 'tilt-flipped' ),
						'triangle'              => Translations::get( 'triangle' ),
						'triangle-asymmetrical' => Translations::get( 'triangle-asymmetrical' ),
						'opacity-fan'           => Translations::get( 'opacity-fan' ),
						'opacity-tilt'          => Translations::get( 'opacity-tilt' ),
						'mountains'             => Translations::get( 'mountains' ),
						'pyramids'              => Translations::get( 'pyramids' ),
						'waves'                 => Translations::get( 'waves' ),
						'wave-brush'            => Translations::get( 'wave-brush' ),
						'waves-pattern'         => Translations::get( 'waves-pattern' ),
						'clouds'                => Translations::get( 'clouds' ),
						'curve'                 => Translations::get( 'curve' ),
						'curve-asymmetrical'    => Translations::get( 'curve-asymmetrical' ),
						'drops'                 => Translations::get( 'drops' ),
						'arrow'                 => Translations::get( 'arrow' ),
						'book'                  => Translations::get( 'book' ),
						'split'                 => Translations::get( 'split' ),
						'zigzag'                => Translations::get( 'zigzag' ),

					),
					'selective_refresh' => array(
						'selector' => $this->getSelector(),
						'function' => array( $this, 'renderContent' )
					)
				),
				'active_rules' => array( $active_rule_base ),
			),

			"{$divider_prefix}color" => array(
				'default'      => Defaults::get( "{$divider_prefix}color" ),
				'control'      => array(
					'label'       => Translations::escHtml( "color" ),
					'type'        => 'color',
					'section'     => 'hero',
					'colibri_tab' => 'style',
				),
				'css_output'   => array(
					array(
						'selector' => "{$this->selector} .h-separator svg path",
						'media'    => CSSOutput::NO_MEDIA,
						'property' => 'background-color',
					),

					array(
						'selector' => "{$this->selector} .h-separator svg path",
						'media'    => CSSOutput::NO_MEDIA,
						'property' => 'fill',
					),
				),
				'active_rules' => array( $active_rule_base ),
			),


			"{$divider_prefix}height.value" => array(
				'default'    => Defaults::get( "{$divider_prefix}height.value", 100 ),
				'control'    => array(
					'label'        => Translations::escHtml( "divider_height" ),
					'colibri_tab'  => 'style',
					'type'         => 'slider',
					'section'      => 'hero',
					'min'          => 0,
					'max'          => 300,
					'step'         => 1,
					'active_rules' => array( $active_rule_base )
				),
				'css_output' => array(
					array(
						'selector'      => "{$this->selector} .h-separator",
						'media'         => CSSOutput::NO_MEDIA,
						'property'      => 'height',
						'value_pattern' => '%spx !important',
					),
				),
			),
		);
	}

	/**
	 * @return string
	 */
	public function getSelector() {
		return $this->selector;
	}

	/**
	 * @param string $selector
	 */
	public function setSelector( $selector ) {
		$this->selector = $selector;
	}

	protected function getGeneralBackgroundSettings( $prefix ) {

		return array(

			"{$prefix}full_height" => array(
				'default'    => Defaults::get( "{$prefix}full_height" ),
				'control'    => array(
					'label'       => Translations::get( 'full_height' ),
					'type'        => 'switch',
					'section'     => 'hero',
					'colibri_tab' => 'style',
				),
				'css_output' => array(
					array(
						'selector'    => $this->selector,
						'media'       => CSSOutput::NO_MEDIA,
						'property'    => 'min-height',
						'true_value'  => '100vh',
						'false_value' => 'auto',
					),
				),
			),

			"{$prefix}hero.separator2" => array(
				'default' => '',
				'control' => array(
					'label'       => '',
					'type'        => 'separator',
					'section'     => 'hero',
					'colibri_tab' => 'style',
				),
			),

			"{$prefix}style.background.color" => array(
				'default'    => Defaults::get( "{$prefix}style.background.color" ),
				'control'    => array(
					'label'       => Translations::escHtml( "background_color" ),
					'type'        => 'color',
					'section'     => 'hero',
					'colibri_tab' => 'style',

				),
				'css_output' => array(
					array(
						'selector' => $this->selector,
						'media'    => CSSOutput::NO_MEDIA,
						'property' => 'background-color',
					),
				),
			),

			"{$prefix}style.background.type" => array(
				'default' => Defaults::get( "{$prefix}style.background.type" ),
				'control' => array(
					'label'             => Translations::escHtml( "background_type" ),
					'focus_alias'       => "hero_background",
					'type'              => 'button-group',
					'button_size'       => 'medium',
					'choices'           => array(
						'image'     => Translations::escHtml( "image" ),
						'gradient'  => Translations::escHtml( "gradient" ),
						'slideshow' => Translations::escHtml( "slideshow" ),
						'video'     => Translations::escHtml( "video" ),
					),
					'colibri_tab'       => 'style',
					'none_value'        => 'color',
					'section'           => 'hero',
					'selective_refresh' => array(
						'selector' => $this->getSelector() . " .background-wrapper",
						'function' => array( $this, 'renderContent' )
					)
				),
			),

		);
	}

	protected function getImageSettings( $prefix ) {

		$image_prefix = "{$prefix}style.background.image.0.";

		return array(
			"{$image_prefix}source.url" => array(
				'default'      => Defaults::get( "{$image_prefix}source.url", "" ),
				'control'      => array(
					'label'       => Translations::escHtml( "image" ),
					'type'        => 'image',
					'section'     => 'hero',
					'colibri_tab' => 'style',
				),
				'css_output'   => array(
					array(
						'selector'      => static::getSelector(),
						'media'         => CSSOutput::NO_MEDIA,
						'property'      => 'background-image',
						'value_pattern' => 'url("%s")',
					),
				),
				'active_rules' => array(
					array(
						"setting"  => "{$prefix}style.background.type",
						"operator" => "=",
						"value"    => "image",
					),
				),
			),

			"{$image_prefix}position" => array(
				'default'      => Defaults::get( "{$image_prefix}position", "top center" ),
				'control'      => array(
					'label'                   => Translations::escHtml( "position" ),
					'type'                    => 'select',
					'section'                 => 'hero',
					'colibri_tab'             => 'style',
					'inline_content_template' => true,
					'choices'                 => array(
						'top left'      => Translations::escHtml( 'top_left' ),
						'top center'    => Translations::escHtml( 'top_center' ),
						'top right'     => Translations::escHtml( 'top_right' ),
						'center left'   => Translations::escHtml( 'center_left' ),
						'center center' => Translations::escHtml( 'center_center' ),
						'center right'  => Translations::escHtml( 'center_right' ),
						'bottom left'   => Translations::escHtml( 'bottom_left' ),
						'bottom center' => Translations::escHtml( 'bottom_center' ),
						'bottom right'  => Translations::escHtml( 'bottom_right' ),
					),
				),
				'css_output'   => array(
					array(
						'selector' => $this->selector,
						'media'    => CSSOutput::NO_MEDIA,
						'property' => 'background-position',
					),
				),
				'active_rules' => array(
					array(
						"setting"  => "{$prefix}style.background.type",
						"operator" => "=",
						"value"    => "image",
					),
				),
			),

			"{$image_prefix}attachment" => array(
				'default'      => Defaults::get( "{$image_prefix}attachment", "" ),
				'control'      => array(
					'label'                   => Translations::escHtml( "attachment" ),
					'inline_content_template' => true,
					'type'                    => 'select',
					'section'                 => 'hero',
					'colibri_tab'             => 'style',
					'choices'                 => array(
						'scroll' => Translations::escHtml( 'scroll' ),
						'fixed'  => Translations::escHtml( 'fixed' ),
					),
				),
				'css_output'   => array(
					array(
						'selector' => $this->selector,
						'media'    => CSSOutput::NO_MEDIA,
						'property' => 'background-attachment',
					),

					array(
						'selector'      => static::getSelector(),
						'media'         => CSSOutput::mobileMedia(),
						'property'      => 'background-attachment',
						'value_pattern' => 'none',
					),
				),
				'active_rules' => array(
					array(
						"setting"  => "{$prefix}style.background.type",
						"operator" => "=",
						"value"    => "image",
					),
				),
			),


			"{$image_prefix}repeat" => array(
				'default'      => Defaults::get( "{$image_prefix}repeat", "no-repeat" ),
				'control'      => array(
					'label'                   => Translations::escHtml( "repeat", '' ),
					'inline_content_template' => true,
					'type'                    => 'select',
					'section'                 => 'hero',
					'colibri_tab'             => 'style',
					'choices'                 => array(
						'no-repeat' => Translations::escHtml( 'no-repeat' ),
						'repeat'    => Translations::escHtml( 'repeat', '' ),
						'repeat-x'  => Translations::escHtml( 'repeat', 'X' ),
						'repeat-y'  => Translations::escHtml( 'repeat', 'Y' ),

					),
				),
				'css_output'   => array(
					array(
						'selector' => $this->selector,
						'media'    => CSSOutput::NO_MEDIA,
						'property' => 'background-repeat',
					),

				),
				'active_rules' => array(
					array(
						"setting"  => "{$prefix}style.background.type",
						"operator" => "=",
						"value"    => "image",
					),
				),
			),

			"{$image_prefix}size" => array(
				'default'      => Defaults::get( "{$image_prefix}size", "cover" ),
				'control'      => array(
					'label'                   => Translations::escHtml( "size" ),
					'inline_content_template' => true,
					'type'                    => 'select',
					'section'                 => 'hero',
					'colibri_tab'             => 'style',
					'choices'                 => array(
						'auto'    => Translations::escHtml( 'auto' ),
						'cover'   => Translations::escHtml( 'cover' ),
						'contain' => Translations::escHtml( 'contain' ),
					),
				),
				'css_output'   => array(
					array(
						'selector' => $this->selector,
						'media'    => CSSOutput::NO_MEDIA,
						'property' => 'background-size',
					),

				),
				'active_rules' => array(
					array(
						"setting"  => "{$prefix}style.background.type",
						"operator" => "=",
						"value"    => "image",
					),
				),
			),
		);
	}

	protected function getGradientSettings( $prefix ) {

		$gradient_prefix = "{$prefix}style.background.image.0.";

		return array(
			"{$gradient_prefix}source.gradient" => array(
				'default'      => Defaults::get( "{$gradient_prefix}source.gradient" ),
				'control'      => array(
					'label'       => Translations::escHtml( "gradient" ),
					'type'        => 'gradient',
					'section'     => 'hero',
					'colibri_tab' => 'style',
					'choices'     => Defaults::get( "gradients", "" ),
				),
				'css_output'   => array(
					array(
						'selector'      => static::getSelector(),
						'media'         => CSSOutput::NO_MEDIA,
						'property'      => 'background-image',
						'value_pattern' => CSSOutput::GRADIENT_VALUE_PATTERN,
					),
				),
				'active_rules' => array(
					array(
						"setting"  => "{$prefix}style.background.type",
						"operator" => "=",
						"value"    => "gradient",
					),
				),
			),
		);
	}

	protected function getSpacingSettings( $prefix ) {
		return array(
			"{$prefix}hero.separator1" => array(
				'default'      => '',
				'control'      => array(
					'label'       => '',
					'type'        => 'separator',
					'section'     => 'hero',
					'colibri_tab' => 'style',
				),
				'active_rules' => array(
					array(
						"setting"  => "{$prefix}full_height",
						"operator" => "=",
						"value"    => false,
					),
				),
			),

			"{$prefix}style.padding.top.value" => array(
				'default'    => Defaults::get( "{$prefix}style.padding.top.value", 150 ),
				'transport'  => 'postMessage',
				'control'    => array(
					'label'        => Translations::escHtml( "spacing_top" ),
					'colibri_tab'  => 'style',
					'type'         => 'slider',
					'section'      => 'hero',
					'min'          => 0,
					'max'          => 300,
					'step'         => 1,
					'active_rules' => array(
						array(
							"setting"  => "{$prefix}full_height",
							"operator" => "=",
							"value"    => false,
						),
					),
				),
				'css_output' => array(
					array(
						'selector'      => $this->selector,
						'media'         => CSSOutput::NO_MEDIA,
						'property'      => 'padding-top',
						'value_pattern' => '%spx',
					),
				),
			),


			"{$prefix}style.padding.bottom.value" => array(
				'default'    => Defaults::get( "{$prefix}style.padding.bottom.value", 150 ),
				'transport'  => 'postMessage',
				'control'    => array(
					'label'        => Translations::escHtml( "spacing_bottom" ),
					'colibri_tab'  => 'style',
					'type'         => 'slider',
					'section'      => 'hero',
					'min'          => 0,
					'max'          => 300,
					'step'         => 1,
					'active_rules' => array(
						array(
							"setting"  => "{$prefix}full_height",
							"operator" => "=",
							"value"    => false,
						),
					),
				),
				'css_output' => array(
					array(
						'selector'      => $this->selector,
						'media'         => CSSOutput::NO_MEDIA,
						'property'      => 'padding-bottom',
						'value_pattern' => '%spx',
					),
				),
			),
		);
	}
}
src/Components/Header/HeaderMenu.php000064400000040365151335104360013407 0ustar00<?php
/**
 * Created by PhpStorm.
 * User: Extend Studio
 * Date: 2/19/2019
 * Time: 6:24 PM
 */

namespace ColibriWP\Theme\Components\Header;


use ColibriWP\Theme\Components\CSSOutput;
use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class HeaderMenu extends ComponentBase {

    protected static $settings_prefix = "header_front_page.header-menu.";
    private $attrs = array();

    private $has_children = array();

    public function __construct() {
        $prefix  = static::$settings_prefix;
        $classes = static::mod( "{$prefix}props.hoverEffect.type" );

        if ( $classes != 'solid-active-item' && strpos( $classes, 'bordered-active-item' ) !== - 1 ) {
            $classes .= ' bordered-active-item ';
        }

        $classes .= ' ' . static::mod( "{$prefix}props.hoverEffect.group.border.transition" );

        $defaultAttrs = array(
            'id'                 => "header-menu",
            'classes'            => $classes,
            'show_shopping_cart' => '0',
        );

        $this->attrs = $defaultAttrs;
    }

    public static function selectiveRefreshSelector() {
        return Defaults::get( static::$settings_prefix . 'selective_selector', false );
    }

    protected static function getOptions() {
        $prefix   = static::$settings_prefix;
        $settings = array_merge(
            static::getContentOptions(),
            static::getStyleOptions()
        );

        return array(
            "sections" => array(
                "{$prefix}section" => array(
                    'title'  => Translations::get( 'menu' ),
                    'panel'  => 'header_panel',
                    'type'   => 'colibri_section',
                    'hidden' => true
                )
            ),

            "settings" => $settings,
        );
    }

    /**
     * @return array();
     */
    protected static function getContentOptions() {
        $prefix   = static::$settings_prefix;
        $selector = '[data-colibri-component="dropdown-menu"]';

        $menu_choices = array( 0 => Translations::get( 'no_menu' ) );
        $menus        = wp_get_nav_menus();
        foreach ( $menus as $menu ) {
            $menu_choices[ (string) $menu->term_id ] = $menu->name;
        }

        return array(

            "{$prefix}edit" => array(
                'default'   => Defaults::get( "{$prefix}value" ),
                'control'   => array(
                    'label'       => Translations::get( 'edit_menu_structure' ),
                    'type'        => 'button',
                    'section'     => "{$prefix}section",
                    'colibri_tab' => "content",
                ),
                'js_output' => array(
                    array(
                        'selector' => "#navigation",
                        'action'   => "focus",
                        'value'    => array(
                            'entity'    => 'panel',
                            'entity_id' => 'nav_menus',
                        ),
                    ),
                ),
            ),

            "{$prefix}style.descendants.innerMenu.justifyContent" => array(
                'default'    => Defaults::get( "{$prefix}style.descendants.innerMenu.justifyContent", "center" ),
                'control'    => array(
                    'label'       => Translations::escHtml( "button_align" ),
                    'focus_alias' => 'menu',
                    'type'        => 'align-button-group',
                    'button_size' => 'medium',
                    //labels are used as values for align-button-group
                    'choices'     => array(
                        'flex-start' => 'left',
                        'center'     => 'center',
                        'flex-end'   => 'right',
                    ),
                    'none_value'  => 'flex-start',
                    'section'     => "{$prefix}section",
                    'colibri_tab' => "content",
                ),
                'css_output' => array(
                    array(
                        'selector'      => "$selector ul",
                        'media'         => CSSOutput::NO_MEDIA,
                        'property'      => 'justify-content',
                        'value_pattern' => '%s !important',
                    ),
                ),
            ),

            "{$prefix}props.showOffscreenMenuOn" => array(
                'default' => Defaults::get( "{$prefix}props.showOffscreenMenuOn" ),
                'control' => array(
                    'label'       => Translations::get( 'show_offscreen_menu_on' ),
                    'type'        => 'select',
                    'section'     => "{$prefix}section",
                    'colibri_tab' => "content",
                    'choices'     => array(
                        'has-offcanvas-mobile'  => Translations::escHtml( "mobile" ),
                        'has-offcanvas-tablet'  => Translations::escHtml( "mobile_tablet" ),
                        'has-offcanvas-desktop' => Translations::escHtml( "mobile_tablet_desktop" ),
                    ),
                ),
            ),
        );
    }

    /**
     * @return array();
     */
    protected static function getStyleOptions() {
        $prefix   = static::$settings_prefix;
        $selector = '[data-colibri-component="dropdown-menu"]';

        return array(

            "{$prefix}props.hoverEffect.type" => array(
                'default'   => Defaults::get( "{$prefix}props.hoverEffect.type" ),
                'control'   => array(
                    'label'       => Translations::get( 'button_highlight_type' ),
                    'type'        => 'select',
                    'section'     => "{$prefix}section",
                    'colibri_tab' => "style",
                    'choices'     => array(
                        'none'                                              => Translations::escHtml( "none" ),
                        'bordered-active-item bordered-active-item--bottom' => Translations::escHtml( "bottom_line" ),
                    ),
                ),
                'js_output' => array(
                    array(
                        'selector' => "$selector ul",
                        'action'   => "set-class",
                    ),
                ),
            ),

            "{$prefix}props.hoverEffect.activeGroup" => array(
                'default' => 'border',
                'control' => array(
                    'label'       => "&nbsp;",
                    'type'        => 'hidden',
                    'section'     => "{$prefix}section",
                    'colibri_tab' => "style",
                )
            ),

            "{$prefix}props.hoverEffect.group.border.transition" => array(
                'default'   => Defaults::get( "{$prefix}props.hoverEffect.group.border.transition" ),
                'control'   => array(
                    'label'       => Translations::get( 'button_hover_effect' ),
                    'type'        => 'linked-select',
                    'linked_to'   => "{$prefix}props.hoverEffect.type",
                    'section'     => "{$prefix}section",
                    'colibri_tab' => "style",
                    'choices'     =>
                        array(
                            'bordered-active-item bordered-active-item--bottom'         => array(
                                'effect-none'                          => Translations::escHtml( "none" ),
                                'effect-borders-in'                    => Translations::escHtml( "drop_in" ),
                                'effect-borders-out'                   => Translations::escHtml( "drop_out" ),
                                'effect-borders-grow grow-from-left'   => Translations::escHtml( "grow_from_left" ),
                                'effect-borders-grow grow-from-right'  => Translations::escHtml( "grow_from_right" ),
                                'effect-borders-grow grow-from-center' => Translations::escHtml( "grow_from_center" ),
                            ),
                            'bordered-active-item bordered-active-item--top'            => array(
                                'effect-none'                          => Translations::escHtml( "none" ),
                                'effect-borders-in'                    => Translations::escHtml( "drop_in" ),
                                'effect-borders-out'                   => Translations::escHtml( "drop_out" ),
                                'effect-borders-grow grow-from-left'   => Translations::escHtml( "grow_from_left" ),
                                'effect-borders-grow grow-from-right'  => Translations::escHtml( "grow_from_right" ),
                                'effect-borders-grow grow-from-center' => Translations::escHtml( "grow_from_center" ),
                            ),
                            'bordered-active-item bordered-active-item--top-and-bottom' => array(
                                'effect-none'                          => Translations::escHtml( "none" ),
                                'effect-borders-in'                    => Translations::escHtml( "drop_in" ),
                                'effect-borders-out'                   => Translations::escHtml( "drop_out" ),
                                'effect-borders-grow grow-from-left'   => Translations::escHtml( "grow_from_left" ),
                                'effect-borders-grow grow-from-right'  => Translations::escHtml( "grow_from_right" ),
                                'effect-borders-grow grow-from-center' => Translations::escHtml( "grow_from_center" ),
                            ),
                            'solid-active-item'                                         => array(
                                'solid-active-item effect-none'                    => Translations::escHtml( "none" ),
                                'solid-active-item effect-pull-up'                 => Translations::escHtml( "grow_up" ),
                                'solid-active-item effect-pull-down'               => Translations::escHtml( "grow_down" ),
                                'solid-active-item effect-pull-left'               => Translations::escHtml( "grow_left" ),
                                'solid-active-item effect-pull-right'              => Translations::escHtml( "grow_right" ),
                                'solid-active-item effect-pull-up-down'            => Translations::escHtml( "shutter_in_horizontal" ),
                                'solid-active-item effect-pull-up-down-reverse'    => Translations::escHtml( "shutter_out_horizontal" ),
                                'solid-active-item effect-pull-left-right'         => Translations::escHtml( "shutter_in_vertical" ),
                                'solid-active-item effect-pull-left-right-reverse' => Translations::escHtml( "shutter_out_vertical" ),
                            )
                        ),
                ),
                'js_output' => array(
                    array(
                        'selector' => "$selector ul",
                        'action'   => "set-class",
                    ),
                ),
            ),
        );
    }

    public function getPenPosition() {
        return static::PEN_ON_LEFT;
    }

    public function renderContent() {
        View::partial( 'front-header', 'header-menu', array(
            "component" => $this,
        ) );
    }

    public function printHeaderMenu() {
        $theme_location         = $this->attrs['id'];
        $customClasses          = $this->attrs['classes'];
        $drop_down_menu_classes = array( 'colibri-menu' );
        $drop_down_menu_classes = array_merge( $drop_down_menu_classes, array( $customClasses ) );

        $self = $this;
        add_filter( 'nav_menu_item_title', function ( $title, $item, $args, $depth ) use ( $self ) {
            return $self->addFirstLevelIcons( $title, $item );
        }, 10, 4 );

        wp_nav_menu( array(
            'echo'            => true,
            'theme_location'  => $theme_location,
            'menu_class'      => esc_attr( implode( " ", $drop_down_menu_classes ) ),
            'container_class' => 'colibri-menu-container',
            'fallback_cb'     => array( $this, "colibriNomenuFallback" ),
        ) );

        $key = static::$settings_prefix . "nodeId";

        $this->addFrontendJSData( Defaults::get( $key, false ), array(
            "data" => array(
                "type" => "horizontal"
            )
        ) );

    }

    public function addFirstLevelIcons( $title, $item ) {
        $arrow = $this->getMenuArrows();

        if ( is_numeric( $item ) ) {

            if ( wp_get_post_parent_id( $item ) ) {
                return $title;
            }

            $args = array(
                'post_parent'   => $item, // Current post's ID
                'post_type__in' => 'post,page',
                'numberposts'   => 1,
                'fields'        => 'ids'
            );

            if ( ! array_key_exists( $item, $this->has_children ) ) {
                $children                    = get_children( $args );
                $this->has_children[ $item ] = ! empty( $children );
            }

            if ( $this->has_children[ $item ] ) {
                return $title . $arrow;
            }

        } else {

            if ( $item instanceof \WP_Post && $item->post_type === 'nav_menu_item' ) {
                if ( intval( $item->post_parent ) ) {
                    return $title;
                }
            }

        }

        if ( is_object( $item ) && in_array( 'menu-item-has-children', $item->classes ) && ! $item->menu_item_parent ) {
            return $title . $arrow;
        }

        return $title;
    }

    private function getMenuArrows() {
        $arrow = '';

        // down arrow
        $arrow = '' .
                 ' <svg aria-hidden="true" data-prefix="fas" data-icon="angle-down" class="svg-inline--fa fa-angle-down fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">' .
                 '  <path fill="currentColor" d="M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"></path>' .
                 ' </svg>' .
                 '';

        // right arrow
        $arrow .= '' .
                  ' <svg aria-hidden="true" data-prefix="fas" data-icon="angle-right" class="svg-inline--fa fa-angle-right fa-w-8" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512">' .
                  '  <path fill="currentColor" d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"></path>' .
                  ' </svg>' .
                  '';


        return $arrow;
    }

    public function hasOffCanvasMobile() {
        $prefix = static::$settings_prefix;
        $type   = static::mod( "{$prefix}props.hoverEffect.type" );

        return ( $type == 'none' ) ? 'has-offcanvas-mobile' : '';
    }

    public function printContainerClasses() {
        $prefix            = static::$settings_prefix;
        $container_classes = static::mod( "{$prefix}props.showOffscreenMenuOn" );

        echo esc_attr( $container_classes );
    }

    function colibriNomenuFallback() {
        $customClasses          = $this->attrs['classes'];
        $drop_down_menu_classes = array( 'colibri-menu' );
        $drop_down_menu_classes = array_merge( $drop_down_menu_classes, array( $customClasses ) );

        add_filter( 'the_title', array( $this, 'addFirstLevelIcons' ), 10, 2 );

        $menu = wp_page_menu( array(
            "menu_class" => 'colibri-menu-container',
            'before'     => '<ul class="' . esc_attr( implode( " ", $drop_down_menu_classes ) ) . '">',
            'after'      => apply_filters( 'colibriwp_nomenu_after', '' ) . "</ul>",
        ) );


        remove_filter( 'the_title', array( $this, 'addFirstLevelIcons' ), 10 );

        return $menu;
    }

    function colibriMenuAddShopingCart() {
        add_filter( 'wp_nav_menu_items', array( $this, 'colibri_woocommerce_cart_menu_item' ), 10, 2 );
        add_filter( 'colibriwp_nomenu_after', array( $this, 'colibri_woocommerce_cart_menu_item' ), 10, 2 );
    }

}
src/Components/MainContent/PostLoop.php000064400000001227151335104360014172 0ustar00<?php

namespace ColibriWP\Theme\Components\MainContent;

use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\View;

class PostLoop extends ComponentBase {

    protected static function getOptions() {
        return array();
    }

    public function renderContent() {
        if ( have_posts() ):
            while ( have_posts() ):
                the_post();

                View::partial( "main", "item_template", array(
                    "component" => $this,
                ) );

            endwhile;
        else:
            View::partial( 'main', '404', array(
                "component" => $this,
            ) );
        endif;
    }
}
src/Components/MainContent/ArchiveLoop.php000064400000002041151335104360014621 0ustar00<?php

namespace ColibriWP\Theme\Components\MainContent;

use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\View;

class ArchiveLoop extends ComponentBase {

    protected static function getOptions() {
        return array();
    }

    public function renderContent() {
        if ( have_posts() ):
            while ( have_posts() ):
                the_post();

                View::partial( "main", "archive_item_template", array(
                    "component" => $this,
                ) );

            endwhile;
        else:
            $self = $this;
            /** ROW START */
            View::printIn( View::ROW_ELEMENT, function () use ( $self ) {
                /** COLUMN START */
                View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {
                    View::partial( 'main', '404', array(
                        "component" => $this,
                    ) );
                } );
            }, array(
                'outer_class' => array( 'w-100' ),
            ) );

        endif;
    }
}
src/Components/MainContent/Loop.php000064400000001223151335104360013320 0ustar00<?php

namespace ColibriWP\Theme\Components\MainContent;

use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\View;

class Loop extends ComponentBase {

    protected static function getOptions() {
        return array();
    }

    public function renderContent() {
        if ( have_posts() ):
            while ( have_posts() ):
                the_post();

                View::partial( "main", "item_template", array(
                    "component" => $this,
                ) );

            endwhile;
        else:
            View::partial( 'main', '404', array(
                "component" => $this,
            ) );
        endif;
    }
}
src/Components/MainContent/SingleItemTemplate.php000064400000001066151335104360016150 0ustar00<?php

namespace ColibriWP\Theme\Components\MainContent;

use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\View;

class SingleItemTemplate extends ComponentBase {

    protected static function getOptions() {
        return array();
    }

    public function renderContent() {
        if ( have_posts() ):

            View::partial( "main", "post", array(
                "component" => $this,
            ) );

        else:
            View::partial( 'main', '404', array(
                "component" => $this,
            ) );
        endif;
    }
}
src/Components/InnerHeader/NavBar.php000064400000000704151335104360013530 0ustar00<?php


namespace ColibriWP\Theme\Components\InnerHeader;

use ColibriWP\Theme\Components\FrontHeader\NavBar as FrontNavBar;
use ColibriWP\Theme\View;


class NavBar extends FrontNavBar {
    protected static $settings_prefix = "header_post.navigation.";

    public function renderContent() {
        static::style()->renderContent();

        View::partial( "inner-header", "navigation", array(
            "component" => $this,
        ) );
    }
}
src/Components/InnerHeader/TopBar.php000064400000000557151335104360013554 0ustar00<?php

namespace ColibriWP\Theme\Components\InnerHeader;

use ColibriWP\Theme\Components\Header\TopBar as HeaderTopBar;
use ColibriWP\Theme\View;


class TopBar extends HeaderTopBar {
	protected static $settings_prefix = "header_post.navigation.";

	public function makeView() {
		View::partial( "front-header", "top-bar", array(
			"component" => $this,
		) );
	}
}
src/Components/InnerHeader/Title.php000064400000001315151335104360013437 0ustar00<?php


namespace ColibriWP\Theme\Components\InnerHeader;

use ColibriWP\Theme\Components\FrontHeader\Title as FrontTitle;
use ColibriWP\Theme\View;

class Title extends FrontTitle {
    protected static $settings_prefix = "header_post.title.";

    public function renderContent() {

        if ( $this->mod( static::$settings_prefix . 'show' ) ) {
            View::partial( 'inner-header', 'title', array(
                "component" => $this,
            ) );
        }
    }


    protected static function getOptions() {
        $prefix  = static::$settings_prefix;
        $options = parent::getOptions();
        unset( $options['settings']["{$prefix}localProps.content"] );

        return $options;
    }
}
src/Components/InnerHeader/Hero.php000064400000002212151335104360013250 0ustar00<?php


namespace ColibriWP\Theme\Components\InnerHeader;

use ColibriWP\Theme\Components\FrontHeader\Hero as FrontHero;
use ColibriWP\Theme\View;

class Hero extends FrontHero {
    protected static $settings_prefix = "header_post.hero.";

    protected static function getOptions( $include_content_settings = true ) {
        $options = parent::getOptions( false );

        return $options;
    }

    public function printPostFeaturedImage() {
        $bgImage = '';
        if ( apply_filters( 'colibriwp_override_with_thumbnail_image', false ) ) {
            global $post;
            if ( $post ) {
                $thumbnail = get_the_post_thumbnail_url( $post->ID, 'mesmerize-full-hd' );

                $thumbnail = apply_filters( 'colibriwp_overriden_thumbnail_image', $thumbnail );

                if ( $thumbnail ) {
                    $bgImage = $thumbnail;
                }
            }
        }

        if ( $bgImage ) {
            echo "background-image:url('$bgImage')";
        }
    }

    public function renderContent() {
        View::partial( "inner-header", "hero", array(
            "component" => $this,
        ) );
    }
}
src/Components/FrontPageContent.php000064400000001007151335104360013410 0ustar00<?php


namespace ColibriWP\Theme\Components;


class FrontPageContent extends PageContent {

    public function renderContent() {
        ?>
        <div class="page-content">
            <?php while ( have_posts() ) : the_post(); ?>
            <div id="content"  class="content">
                <?php
                the_content();
                endwhile;
                ?>
            </div>
            <?php
            colibriwp_render_page_comments();
            ?>
        </div>
        <?php

    }

}
src/Components/FrontHeader/Title.php000064400000010553151335104360013460 0ustar00<?php


namespace ColibriWP\Theme\Components\FrontHeader;


use ColibriWP\Theme\Components\CSSOutput;
use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class Title extends ComponentBase {

    protected static $settings_prefix = "header_front_page.title.";

    /**
     * @return array();
     */
    protected static function getOptions() {
        $prefix = static::$settings_prefix;
        $colibriwp_theme_click_pen_to_edit_title = __( 'Click the pencil icon to edit the text', 'colibri-wp' );

        if ( apply_filters( 'colibri_page_builder/installed', false ) ) {
            $colibriwp_theme_click_pen_to_edit_title = __( 'Just click and start typing to change the site headline.',
                'colibri-wp' );
        }
        $colibriwp_theme_click_pen_to_edit_title = apply_filters('colibri_theme_title_default_content', $colibriwp_theme_click_pen_to_edit_title);

        return array(
            "sections" => array(
                "{$prefix}section" => array(
                    'title'  => Translations::get( 'title' ),
                    'panel'  => 'header_panel',
                    'type'   => 'colibri_section',
                    'hidden' => true
                )
            ),

            "settings" => array(
                "{$prefix}show"               => array(
                    'default'   => Defaults::get( "{$prefix}show" ),
                    'transport' => 'refresh',
                    'control'   => array(
                        'label'       => Translations::get( 'show_title' ),
                        'type'        => 'switch',
                        'show_toggle' => true,
                        'section'     => "hero",
                        'colibri_tab' => 'content',
                    ),

                ),
                "{$prefix}localProps.content" => array(
                    'default' => $colibriwp_theme_click_pen_to_edit_title,
                    'control' => array(
                        'label'       => Translations::get( 'title' ),
                        'type'        => 'input',
                        'input_type'  => 'textarea',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => "content",
                    ),
                ),
                "{$prefix}style.textAlign"    => array(
                    'default'    => Defaults::get( "{$prefix}style.textAlign" ),
                    'control'    => array(
                        'label'       => Translations::escHtml( "align" ),
                        'type'        => 'align-button-group',
                        'button_size' => 'medium',
                        //labels are used as values for align-button-group
                        'choices'     => array(
                            'left'   => 'left',
                            'center' => 'center',
                            'right'  => 'right',
                        ),
                        'none_value'  => 'flex-start',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => "content",
                    ),
                    'css_output' => array(
                        array(
                            'selector' => static::selectiveRefreshSelector(),
                            'media'    => CSSOutput::NO_MEDIA,
                            'property' => 'text-align',
                        ),
                    ),
                ),
            ),
        );
    }

    public static function selectiveRefreshSelector() {
        return Defaults::get( static::$settings_prefix . 'selective_selector', false );
    }

    public function getPenPosition() {
        return static::PEN_ON_RIGHT;
    }

    public function renderContent() {

        if ( $this->mod( static::$settings_prefix . 'show' ) ) {
            View::partial( 'front-header', 'title', array(
                "component" => $this,
            ) );
        }
    }

    public function printTitle( $shortcode = '' ) {

        $prefix = static::$settings_prefix;

        if ( get_theme_mod( "{$prefix}localProps.content", false ) || is_user_logged_in() ) {
            $value = trim( $this->mod( "{$prefix}localProps.content" ) );
        } else {
            $value = get_bloginfo( 'name' );
        }


        echo str_replace( "\n", "<br/>", $value );
    }
}
src/Components/FrontHeader/ButtonsGroup.php000064400000012132151335104360015045 0ustar00<?php

namespace ColibriWP\Theme\Components\FrontHeader;

use ColibriWP\Theme\Components\CSSOutput;
use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class ButtonsGroup extends ComponentBase {

	protected static $settings_prefix = "header_front_page.button_group.";

	/**
	 * @return array();
	 */
	protected static function getOptions() {
		$prefix = static::$settings_prefix;
        $defaultValue = Defaults::get( "{$prefix}value" );

        //in wp 6.7 we can't add translation before the init hook
        $colibriwp_theme_action_button = __('Action Button %d', 'colibri-wp');
        $translatedDefaultValue =  array(
            array(
                'label'       => sprintf( $colibriwp_theme_action_button, 1 ),

            ),
            array(
                'label'       => sprintf( $colibriwp_theme_action_button, 2 ),

            ),
        );
        $defaultValueArr = json_decode($defaultValue, true);
        if(is_array($defaultValueArr)) {
            foreach($defaultValueArr as $key => $value) {
                if(isset($value['label']) && isset($translatedDefaultValue[$key]) && isset($translatedDefaultValue[$key]['label'])) {
                    $defaultValueArr[$key]['label'] = $translatedDefaultValue[$key]['label'];
                }
            }
        }
        $defaultValue = json_encode($defaultValueArr);
		return array(
			"sections" => array(
				"{$prefix}section" => array(
					'title'  => Translations::get( 'buttons' ),
					'panel'  => 'header_panel',
					'type'   => 'colibri_section',
					'hidden' => true
				)
			),

			"settings" => array(
				"{$prefix}show"  => array(
					'default'   => Defaults::get( "{$prefix}show" ),
					'transport' => 'refresh',
					'control'   => array(
						'label'       => Translations::get( 'buttons' ),
						'type'        => 'switch',
						'show_toggle' => true,
						'section'     => "hero",
						'colibri_tab' => 'content',
					),

				),
				"{$prefix}value" => array(
					'default' => $defaultValue,
					'control' => array(
						'label'          => Translations::get( 'buttons' ),
						'type'           => 'repeater',
						'input_type'     => 'textarea',
						'section'        => "{$prefix}section",
						'colibri_tab'    => 'content',
						'item_add_label' => Translations::get( 'add_button' ),
						'max'            => 2,
						'min'            => 1,
						'fields'         => array(
							'label' => array(
								'type'    => 'text',
								'label'   => Translations::get( 'label' ),
								'default' => Translations::get( 'button' ),
							),

							'url' => array(
								'type'    => 'text',
								'label'   => Translations::get( 'link' ),
								'default' => '#',
							),

							'button_type' => array(
								'type'    => 'select',
								'label'   => Translations::get( 'button_type' ),
								'default' => '0',
								'props'   => array(
									'options' => array(
										'0' => Translations::escHtml( "primary_button" ),
										'1' => Translations::escHtml( "secondary_button" ),
									),
								)
							),
						)
					),
				),

				"{$prefix}style.textAlign" => array(
					'default'    => Defaults::get( "{$prefix}style.textAlign" ),
					'control'    => array(
						'label'       => Translations::escHtml( "align" ),
						'type'        => 'align-button-group',
						'button_size' => 'medium',
						//labels are used as values for align-button-group
						'choices'     => array(
							'left'   => 'left',
							'center' => 'center',
							'right'  => 'right',
						),
						'none_value'  => 'flex-start',
						'section'     => "{$prefix}section",
						'colibri_tab' => "content",
					),
					'css_output' => array(
						array(
							'selector' => static::selectiveRefreshSelector(),
							'media'    => CSSOutput::NO_MEDIA,
							'property' => 'text-align',
						),
					),
				),
			),
		);
	}

	public static function selectiveRefreshSelector() {
		return Defaults::get( static::$settings_prefix . 'selective_selector', false );
	}

	public function getPenPosition() {
		return static::PEN_ON_RIGHT;
	}

	public function renderContent() {

		if ( $this->mod( static::$settings_prefix . 'show' ) ) {
			View::partial( 'front-header', 'button_group', array(
				"component" => $this,
			) );
		}
	}

	public function printButtons() {

		if ( get_theme_mod( static::$settings_prefix . "value", false ) || is_user_logged_in() ) {
			$buttons = $this->mod( static::$settings_prefix . "value", array() );
		} else {
			$latest_posts = wp_get_recent_posts( array( 'numberposts' => 2, 'post_status' => 'publish' ) );
			$buttons      = array();
			$button_index = 0;
			foreach ( $latest_posts as $id => $post ) {
				$buttons[] = array(
					'label'       => get_the_title( $post['ID'] ),
					'url'         => get_post_permalink( $post['ID'] ),
					'button_type' => $button_index,
					'index'       => $button_index,
				);
				$button_index ++;
			}
		}

		foreach ( $buttons as $button ) {
			$type = array_key_exists( 'button_type', $button ) ? $button['button_type'] : 0;
			View::partial( 'front-header', "buttons/button-{$type}", $button );
		}
	}
}
src/Components/FrontHeader/NavBar.php000064400000007372151335104360013555 0ustar00<?php

namespace ColibriWP\Theme\Components\FrontHeader;


use ColibriWP\Theme\AssetsManager;
use ColibriWP\Theme\Components\Header\NavBarStyle;
use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\View;

class NavBar extends ComponentBase {

    protected static $settings_prefix = "header_front_page.navigation.";

    /**
     * @return array();
     */
    protected static function getOptions() {
        $style = static::style()->getOptions();

        return $style;
    }

    /**
     * @return NavBarStyle
     */
    public static function style() {
        return NavBarStyle::getInstance( static::getPrefix(), static::selectiveRefreshSelector() );
    }

    protected static function getPrefix() {
        return static::$settings_prefix;
    }

    public static function selectiveRefreshSelector() {
        return Defaults::get( static::getPrefix() . 'selective_selector', false );
    }


    public function renderContent() {
        static::style()->renderContent();

        $template = static::style()->mod( 'bar_type' );
        View::partial( "front-header", "navigation", array(
            "component" => $this,
        ) );
    }

    public function printHeaderMenu() {
        View::printMenu( array(
            'id'      => 'header-menu',
            'classes' => 'none',
        ) );
    }

    public function printSticky() {
        $sticky = static::style()->mod( "props.sticky" );
        if ( $sticky === false || $sticky === "" ) {

            AssetsManager::addInlineScriptCallback(
                'colibri-theme',
                function () {
                    ?>
                    <script type="text/javascript">
                        jQuery(window).load(function () {
                            var el = jQuery("#navigation");
                            var component = el.data()['fn.colibri.navigation'];
                            if (component) {
                                window.colibriNavStickyOpts = component.opts.data.sticky;
                                component.opts.data.sticky = false;
                                if (component.hasOwnProperty('restart')) {
                                    component.restart();
                                } else {
                                    component.stop();
                                    component.start();
                                }
                            }
                        });
                    </script>
                    <?php
                }
            );

        }

    }

    public function printWrapperClasses() {
        $classes = array( 'navigation-wrapper' );
        $prefix  = static::getPrefix();

        if ( $this->mod( "{$prefix}boxed_navigation", false ) ) {
            $classes[] = "gridContainer";
        }

        echo esc_attr( implode( " ", $classes ) );
    }

    public function printNavigationClasses() {
        $classes = array();
        $prefix  = static::getPrefix();

        if ( $this->mod( "{$prefix}props.overlap", Defaults::get( "{$prefix}props.overlap", true ) ) ) {
            $classes[] = "h-navigation_overlap";
        }
        if ( $width = $this->mod( "{$prefix}props.width", 'boxed' ) ) {
            $classes[] = "colibri-theme-nav-{$width}";
        }

        echo esc_attr( implode( " ", $classes ) );
    }

    public function printContainerClasses() {
        $classes = array();
        $prefix  = static::getPrefix();

        $width_options = array(
            'boxed'      => 'h-section-boxed-container',
            'full-width' => 'h-section-fluid-container'
        );

        if ( $width = $this->mod( "{$prefix}props.width", 'boxed' ) ) {
            $classes[] = $width_options[ $width ];
        }

        echo esc_attr( implode( " ", $classes ) );
    }
}
src/Components/FrontHeader/TopBar.php000064400000000566151335104360013571 0ustar00<?php

namespace ColibriWP\Theme\Components\FrontHeader;

use ColibriWP\Theme\Components\Header\TopBar as HeaderTopBar;
use ColibriWP\Theme\View;


class TopBar extends HeaderTopBar {
	protected static $settings_prefix = "header_front_page.navigation.";


	public function makeView() {
		View::partial( "front-header", "top-bar", array(
			"component" => $this,
		) );
	}
}
src/Components/FrontHeader/TopBarListIcons.php000064400000005621151335104360015416 0ustar00<?php

namespace ColibriWP\Theme\Components\FrontHeader;

use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class TopBarListIcons extends ComponentBase {

	protected static $settings_prefix = "header_front_page.icon_list.";

	/**
	 * @return array();
	 */
	protected static function getOptions() {
		$prefix = static::$settings_prefix;

		return array(
			"sections" => array(
				"{$prefix}section" => array(
					'title'  => Translations::get( 'information_fields' ),
					'panel'  => 'header_panel',
					'type'   => 'colibri_section',
					'hidden' => true
				)
			),

			"settings" => array(

				"{$prefix}pen" => array(
					'control' => array(
						'type'    => 'pen',
						'section' => "{$prefix}section",
					),

				),

				"{$prefix}localProps.iconList" => array(
					'default' => Defaults::get( "{$prefix}localProps.iconList" ),
					'control' => array(
						'label'          => Translations::get( 'icons' ),
						'type'           => 'repeater',
						'section'        => "{$prefix}section",
						'colibri_tab'    => 'content',
						'item_add_label' => Translations::get( 'add_item' ),
						'max'            => 10,
						'fields'         => array(
							'text' => array(
								'type'    => 'text',
								'label'   => Translations::get( 'text' ),
								'default' => Translations::get( 'text' ),
							),

							'icon' => array(
								'type'    => 'icon',
								'label'   => Translations::get( 'icon' ),
								'default' => Defaults::get( 'icons.facebook' ),
							),

							'link_value' => array(
								'type'    => 'text',
								'label'   => Translations::get( 'link' ),
								'default' => '#',
							),

						)
					),
				),
			),
		);
	}

	public function getPenPosition() {
		return static::PEN_ON_LEFT;
	}

	public function renderContent() {
		/* this prevents the pen to show after adding a new item
	    if (\is_customize_preview() ): ?>
            <style type="text/css">
                <?php echo static::selectiveRefreshSelector(); ?>
                .customize-partial-edit-shortcut {
                    left: auto !important;
                    top: -6px !important;
                }
            </style>
		<?php endif;
        */
		View::partial( 'front-header', 'top-bar/list-icons', array(
			"component" => $this,
		) );

	}

	public static function selectiveRefreshSelector() {
		return Defaults::get( static::$settings_prefix . 'selective_selector', false );
	}

	public function printIcons() {
		$icons = $this->mod( static::$settings_prefix . 'localProps.iconList', array() );
		if ( $icons ) {
			$count = count( $icons );

			for ( $i = 0; $i < $count; $i ++ ) {
				$icon = $icons[ $i ];
				$name = 'middle';

				if ( $i === 0 ) {
					$name = 'first';
				}
				if ( $i + 1 === $count ) {
					$name = 'last';
				}
				View::partial( 'front-header', "top-bar/list-icon-$name", $icon );
			}

		}
	}
}
src/Components/FrontHeader/Hero.php000064400000020077151335104360013276 0ustar00<?php


namespace ColibriWP\Theme\Components\FrontHeader;


use ColibriWP\Theme\Components\CSSOutput;
use ColibriWP\Theme\Components\Header\HeroStyle;
use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class Hero extends ComponentBase
{

    protected static $settings_prefix = "header_front_page.hero.";

    /**
     * @param bool $include_content_settings
     *
     * @return array
     */
    protected static function getOptions($include_content_settings = true)
    {

        $prefix = static::$settings_prefix;
        $result = array(
            'settings' => array(
                "{$prefix}.pen" => array(
                    'control' => array(
                        'type'    => 'pen',
                        'section' => 'hero',
                    )
                )
            )
        );

        $background_settings = static::getStyleComponent()->getOptions();

        $result = array_merge_recursive($result, $background_settings);

        if ($include_content_settings) {
            $content = array(
                "settings" => static::getGeneralContentSettings($prefix)
            );
            $result  = array_merge_recursive($content, $result);
        }

        return $result;
    }

    public static function getStyleComponent()
    {
        return HeroStyle::getInstance(
            static::$settings_prefix,
            static::selectiveRefreshSelector()
        );
    }

    public static function selectiveRefreshSelector()
    {
        return Defaults::get(static::$settings_prefix . 'selective_selector', false);
    }

    protected static function getGeneralContentSettings($prefix)
    {

        $selector = static::selectiveRefreshSelector();

        return array(
            "{$prefix}props.heroSection.layout" => array(
                'default'    => Defaults::get("{$prefix}props.heroSection.layout"),
                'control'    => array(
                    'label'       => Translations::get('hero_layout'),
                    'focus_alias' => "hero_layout",
                    'type'        => 'select-icon',
                    'section'     => 'hero',
                    'colibri_tab' => 'content',
                    'choices'     => array(
                        'textOnly' =>
                        array(
                            'tooltip' => Translations::get('text_only'),
                            'label'   => Translations::get('text_only'),
                            'value'   => 'textOnly',
                            'icon'    => Defaults::get('icons.textOnly.content'),
                        ),

                        'textWithMediaOnRight' =>
                        array(
                            'tooltip' => Translations::get('text_with_media_on_right'),
                            'label'   => Translations::get('text_with_media_on_right'),
                            'value'   => 'textWithMediaOnRight',
                            'icon'    => Defaults::get('icons.textWithMediaOnRight.content'),
                        ),

                        'textWithMediaOnLeft' =>
                        array(
                            'tooltip' => Translations::get('text_with_media_on_left'),
                            'label'   => Translations::get('text_with_media_on_left'),
                            'value'   => 'textWithMediaOnLeft',
                            'icon'    => Defaults::get('icons.textWithMediaOnLeft.content'),
                        ),
                    ),
                ),
                'css_output' => array(
                    array(
                        'selector' => "{$selector} .h-column-container",
                        'media'    => CSSOutput::desktopMedia(),
                        'property' => 'width',
                        'value'    => array(
                            'textOnly'             => '100%',
                            'textWithMediaOnRight' => '50%',
                            'textWithMediaOnLeft'  => '50%',
                        ),
                    ),
                    array(
                        'selector' => "{$selector} .h-column-container:nth-child(1)",
                        'media'    => CSSOutput::desktopMedia(),
                        'property' => 'order',
                        'value'    => array(
                            'textOnly'             => '0',
                            'textWithMediaOnRight' => '0',
                            'textWithMediaOnLeft'  => '1',
                        ),
                    ),
                    array(
                        'selector' => "{$selector} .h-column-container:nth-child(2)",
                        'media'    => CSSOutput::NO_MEDIA,
                        'property' => 'display',
                        'value'    => array(
                            'textOnly'             => 'none',
                            'textWithMediaOnRight' => 'block',
                            'textWithMediaOnLeft'  => 'block',
                        ),
                    ),
                ),
            ),

            "{$prefix}separator1" => array(
                'default' => '',
                'control' => array(
                    'label'       => '',
                    'type'        => 'separator',
                    'section'     => 'hero',
                    'colibri_tab' => 'content',
                ),
            ),

            "{$prefix}hero_column_width" => array(
                'default'    => Defaults::get("{$prefix}hero_column_width"),
                'control'    => array(
                    'label'       => Translations::get('hero_column_width'),
                    'type'        => 'slider',
                    'section'     => 'hero',
                    'colibri_tab' => 'content',
                    'min'         => 0,
                    'max'         => 100,
                ),
                'css_output' => array(
                    array(
                        "selector"      => "{$selector} .h-section-grid-container .h-column-container:first-child",
                        "property"      => "width",
                        'media'         => CSSOutput::desktopMedia(),
                        'value_pattern' => '%s%% !important',
                    ),
                    array(
                        "selector"      => "{$selector} .h-section-grid-container .h-column-container:nth-child(2)",
                        "property"      => "width",
                        'media'         => CSSOutput::desktopMedia(),
                        'value_pattern' => 'calc(100%% - %s%%) !important',
                    ),
                ),
            ),

            "{$prefix}separator2" => array(
                'default' => '',
                'control' => array(
                    'label'       => '',
                    'type'        => 'separator',
                    'section'     => 'hero',
                    'colibri_tab' => 'content',
                ),
            ),

        );
    }

    public function renderContent()
    {
        View::partial("front-header", "hero", array(
            "component" => $this,
        ));
    }

    public function printBackground()
    {
        static::getStyleComponent()->render();
    }

    public function printSeparator()
    {
        $prefix         = static::$settings_prefix;
        $divider_prefix = "{$prefix}style.separatorBottom.";
        $enabled        = $this->mod("{$divider_prefix}enabled", false);
        if ($enabled) {
            $style = $this->mod("{$divider_prefix}type", 'mountains');

            $divider_style = Defaults::get('divider_style');

            $svg = '';
            if (isset($divider_style[$style])) {
                $svg = $divider_style[$style];
            }

            //set color
            $svg = str_replace('<path', '<path class="svg-white-bg"', $svg);
            //flip for bottom
            $svg       = str_replace('<svg ', '<svg style="transform:rotateX(180deg);" ', $svg);
            $separator = "<div class='h-separator' style='bottom: -1px;'>$svg</div>";

            echo $separator;
        }
    }
}
src/Components/FrontHeader/Image.php000064400000046646151335104360013435 0ustar00<?php


namespace ColibriWP\Theme\Components\FrontHeader;


use ColibriWP\Theme\Components\CSSOutput;
use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class Image extends ComponentBase {

    protected static $settings_prefix = "header_front_page.hero.image.";
    protected static $selector = "#hero";

    public static function selectiveRefreshSelector() {
        return Defaults::get( static::$settings_prefix . 'selective_selector', false );
    }

    /**
     * @return array();
     */
    protected static function getOptions() {
        $prefix        = static::$settings_prefix;
        $selector      = static::$selector;
        $prefix_shadow = "{$prefix}style.descendants.image.boxShadow.";
        $prefix_frame  = "{$prefix}style.descendants.frameImage.";

        return array(
            "sections" => array(
                "{$prefix}section" => array(
                    'title'  => Translations::get( 'image' ),
                    'panel'  => 'header_panel',
                    'type'   => 'colibri_section',
                    'hidden' => true
                )
            ),

            "settings" => array(
                "{$prefix}localProps.url" => array(
                    'default' => Defaults::get( "{$prefix}localProps.url" ),
                    'control' => array(
                        'label'       => Translations::get( 'image' ),
                        'type'        => 'image',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => "content",
                    ),
                ),

                "{$prefix_shadow}layers.0" => array(
                    'default'      => Defaults::get( "{$prefix_shadow}layers.0" ),
                    'control'      => array(
                        'label'       => Translations::get( 'box_shadow' ),
                        'type'        => 'composed',
                        'input_type'  => 'switch',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                        'fields'      => array(
                            'x'      => array(
                                'type'    => 'slider',
                                'label'   => Translations::get( 'horizontal' ),
                                'default' => Defaults::get( "{$prefix_shadow}layers.0.x" ),
                                'props'   => array(
                                    'min' => - 100,
                                    'max' => 100,
                                )
                            ),
                            'y'      => array(
                                'type'    => 'slider',
                                'label'   => Translations::get( 'vertical' ),
                                'default' => Defaults::get( "{$prefix_shadow}layers.0.y" ),
                                'props'   => array(
                                    'min' => - 100,
                                    'max' => 100,

                                )
                            ),
                            'spread' => array(
                                'type'    => 'slider',
                                'label'   => Translations::get( 'spread' ),
                                'default' => Defaults::get( "{$prefix_shadow}layers.0.spread" ),
                                'props'   => array(
                                    'options' => array(
                                        'min' => 0,
                                        'max' => 100,
                                    ),
                                )
                            ),
                            'blur'   => array(
                                'type'    => 'slider',
                                'label'   => Translations::get( 'blur' ),
                                'default' => Defaults::get( "{$prefix_shadow}layers.0.blur" ),
                                'props'   => array(
                                    'options' => array(
                                        'min' => 0,
                                        'max' => 100,
                                    ),
                                )
                            ),
                            'color'  => array(
                                'type'    => 'color-picker',
                                'label'   => Translations::get( 'color' ),
                                'default' => Defaults::get( "{$prefix_shadow}layers.0.color" ),
                                'props'   => array(
                                    'inline' => true,
                                ),
                            ),
                        )
                    ),
                    'css_output'   => array(
                        array(
                            'selector'      => "{$selector} img",
                            'media'         => CSSOutput::NO_MEDIA,
                            'property'      => 'box-shadow',
                            'value_pattern' => '#x#px #y#px #blur#px #spread#px #color#',
                        ),
                    ),
                    'active_rules' => array(
                        array(
                            "setting"  => "{$prefix_shadow}enabled",
                            "operator" => "=",
                            "value"    => true,
                        ),
                    ),
                ),

                "{$prefix_shadow}enabled"   => array(
                    'default'    => Defaults::get( "{$prefix_shadow}enabled" ),
                    'control'    => array(
                        'label'       => Translations::get( 'box_shadow' ),
                        'input_type'  => 'switch',
                        'type'        => 'group',
                        'section'     => "{$prefix}section",
                        'show_toggle' => true,
                        'controls'    => array(
                            "{$prefix_shadow}layers.0",
                        ),
                        'colibri_tab' => 'content',
                    ),
                    'css_output' => array(
                        array(
                            'selector'    => "{$selector} img",
                            'media'       => CSSOutput::NO_MEDIA,
                            'property'    => 'box-shadow',
                            'false_value' => 'none',
                        ),
                    ),
                ),
//frame options
                "{$prefix}props.frame.type" => array(
                    'default'    => Defaults::get( "{$prefix}props.frame.type" ),
                    'control'    => array(
                        'label'       => Translations::get( 'type' ),
                        'type'        => 'select',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => "content",
                        'choices'     => array(
                            'border'     => Translations::escHtml( "border" ),
                            'background' => Translations::escHtml( "background" ),
                        ),
                    ),
                    'css_output' => array(
                        array(
                            'selector' => "{$selector} div.h-image__frame",
                            'media'    => CSSOutput::NO_MEDIA,
                            'property' => 'border-style',
                            'value'    => array(
                                'border'     => 'solid',
                                'background' => 'none',
                            ),
                        ),
                        array(
                            'selector' => "{$selector} div.h-image__frame",
                            'media'    => CSSOutput::NO_MEDIA,
                            'property' => 'background-color',
                            'value'    => array(
                                'border'     => 'transparent',
                                'background' => '',
                            ),
                        ),
                    ),
                    /*
                    'js_output' => array(
                        array(
                            'selector' => "{$selector} .h-image__frame",
                            'action'   => 'set-css',
                            'property' => 'border-style',
                            'value'    => array(
                                'border'     => 'solid',
                                'background' => 'none',
                            ),
                        ),
                        array(
                            'selector' => "{$selector} .h-image__frame",
                            'action'   => 'set-css',
                            'property' => 'background-color',
                            'value'    => array(
                                'border'     => 'transparent',
                                'background' => '',
                            ),
                        ),
                    ),*/
                ),

                "{$prefix_frame}backgroundColor" => array(
                    'default'    => Defaults::get( "{$prefix_frame}backgroundColor" ),
                    'control'    => array(
                        'label'       => Translations::escHtml( "color" ),
                        'type'        => 'color',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                    ),
                    'css_output' => array(
                        array(
                            'selector' => "{$selector} .h-image__frame",
                            'media'    => CSSOutput::NO_MEDIA,
                            'property' => 'background-color',
                        ),
                        array(
                            'selector' => "{$selector} .h-image__frame",
                            'media'    => CSSOutput::NO_MEDIA,
                            'property' => 'border-color',
                        ),
                    ),
                ),

                "{$prefix_frame}width" => array(
                    'default'    => Defaults::get( "{$prefix_frame}width" ),
                    'control'    => array(
                        'label'       => Translations::get( 'width' ),
                        'type'        => 'slider',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                        'min'         => 0,
                        'max'         => 300,
                    ),
                    'css_output' => array(
                        array(
                            'selector'      => "{$selector} .h-image__frame",
                            'media'         => CSSOutput::NO_MEDIA,
                            'property'      => 'width',
                            "value_pattern" => "%s%%",
                        ),
                    ),
                ),

                "{$prefix_frame}height" => array(
                    'default'    => Defaults::get( "{$prefix_frame}height" ),
                    'control'    => array(
                        'label'       => Translations::get( 'height' ),
                        'type'        => 'slider',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                        'min'         => 0,
                        'max'         => 300,
                    ),
                    'css_output' => array(
                        array(
                            'selector'      => "{$selector} .h-image__frame",
                            'media'         => CSSOutput::NO_MEDIA,
                            'property'      => 'height',
                            "value_pattern" => "%s%%",
                        ),
                    ),
                ),

                "{$prefix_frame}transform.translate" => array(
                    'default'    => Defaults::get( "{$prefix_frame}transform.translate" ),
                    'control'    => array(
                        'label'       => Translations::get( 'offset' ),
                        'type'        => 'composed',
                        'input_type'  => 'textarea',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                        'fields'      => array(
                            "x_value" => array(
                                'type'    => 'slider',
                                'label'   => Translations::get( 'offset_left' ),
                                'default' => Defaults::get( "{$prefix_frame}transform.translate.x_value" ),
                                'props'   => array(
                                    'min' => - 50,
                                    'max' => 50,
                                )
                            ),

                            "y_value" => array(
                                'type'    => 'slider',
                                'label'   => Translations::get( 'offset_top' ),
                                'default' => Defaults::get( "{$prefix_frame}transform.translate.y_value" ),
                                'props'   => array(
                                    'min' => - 50,
                                    'max' => 50,

                                )
                            ),
                        ),
                    ),
                    'css_output' => array(
                        array(
                            'selector'      => "{$selector} .h-image__frame",
                            'media'         => CSSOutput::NO_MEDIA,
                            'property'      => 'transform',
                            'value_pattern' => 'translateX(#x_value#%) translateY(#y_value#%)',
                        ),
                    ),
                ),


                "{$prefix_frame}thickness" => array(
                    'default'      => Defaults::get( "{$prefix_frame}thickness" ),
                    'control'      => array(
                        'label'       => Translations::get( 'frame_thickness' ),
                        'type'        => 'slider',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                        'min'         => 0,
                        'max'         => 100,
                    ),
                    'active_rules' => array(
                        array(
                            "setting"  => "{$prefix}props.frame.type",
                            "operator" => "=",
                            "value"    => "border",
                        ),
                    ),
                    'css_output'   => array(
                        array(
                            'selector'      => "{$selector} .h-image__frame",
                            'media'         => CSSOutput::NO_MEDIA,
                            'property'      => 'border-width',
                            "value_pattern" => "%spx",
                        ),
                    ),
                ),

                "{$prefix}props.showFrameOverImage" => array(
                    'default'    => Defaults::get( "{$prefix}props.showFrameOverImage" ),
                    'control'    => array(
                        'label'       => Translations::get( 'frame_over_image' ),
                        'type'        => 'switch',
                        'show_toggle' => true,
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                    ),
                    'css_output' => array(
                        array(
                            'selector'    => "{$selector} .h-image__frame",
                            'media'       => CSSOutput::NO_MEDIA,
                            'property'    => 'z-index',
                            'true_value'  => '1',
                            'false_value' => '-1',
                        ),
                    ),
                ),

                "{$prefix}props.showFrameShadow" => array(
                    'default'   => Defaults::get( "{$prefix}props.showFrameShadow" ),
                    'control'   => array(
                        'label'       => Translations::get( 'frame_shadow' ),
                        'type'        => 'switch',
                        'show_toggle' => true,
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                    ),
                    'js_output' => array(
                        array(
                            'selector' => "{$selector} .h-image__frame",
                            'action'   => "toggle-class",
                            'value'    => 'h-image__frame_shadow',
                        ),
                    ),
                ),

                "{$prefix}props.enabledFrameOption" => array(
                    'default' => Defaults::get( "{$prefix}props.enabledFrameOption" ),
                    'control' => array(
                        'label'       => Translations::get( 'frame_options' ),
                        'input_type'  => 'switch',
                        'type'        => 'group',
                        'section'     => "{$prefix}section",
                        'show_toggle' => true,
                        'controls'    => array(
                            //"{$prefix_frame}composed",
                            "{$prefix}props.frame.type",
                            "{$prefix_frame}backgroundColor",
                            "{$prefix_frame}width",
                            "{$prefix_frame}height",
                            "{$prefix_frame}transform.translate",
                            "{$prefix_frame}thickness",
                            "{$prefix}props.showFrameOverImage",
                            "{$prefix}props.showFrameShadow",
                        ),
                        'colibri_tab' => 'content',
                    ),

                    'css_output' => array(
                        array(
                            'selector'    => "{$selector} .h-image__frame",
                            'media'       => CSSOutput::NO_MEDIA,
                            'property'    => 'display',
                            'true_value'  => 'block',
                            'false_value' => 'none',
                        ),
                    ),

                ),
            ),
        );
    }

    public function renderContent() {

        //if ( $this->mod( static::$settings_prefix . 'show' ) ) {
        View::partial( 'front-header', 'image', array(
            "component" => $this,
        ) );
        //}
    }

    public function printImage( $classes, $placeholder ) {
        $prefix = static::$settings_prefix;
        $image  = $this->mod( "{$prefix}localProps.url" );
        if ( ! $image ) {
            $image = $placeholder;
        }
        ?>
        <img src="<?php echo esc_attr( $image ); ?>" alt="" class="<?php echo esc_attr( $classes ); ?>"/>
        <?php
    }


    public function printFrameClasses() {
        $prefix  = static::$settings_prefix;
        $classes = array();

        if ( $this->mod( "{$prefix}props.showFrameShadow", false ) ) {
            $classes[] = "h-image__frame_shadow";
        }

        echo esc_attr( implode( " ", $classes ) );
    }

    public function getPenPosition() {
        return static::PEN_ON_RIGHT;
    }
}
src/Components/FrontHeader/Subtitle.php000064400000007732151335104360014177 0ustar00<?php


namespace ColibriWP\Theme\Components\FrontHeader;


use ColibriWP\Theme\Components\CSSOutput;
use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class Subtitle extends ComponentBase {

    protected static $settings_prefix = "header_front_page.subtitle.";

    /**
     * @return array();
     */
    protected static function getOptions() {
        $prefix = static::$settings_prefix;
        $default_content = apply_filters('colibri_theme_subtitle_default_content', Defaults::get( "lorem_ipsum"));
        return array(
            "sections" => array(
                "{$prefix}section" => array(
                    'title'  => Translations::get( 'subtitle' ),
                    'panel'  => 'header_panel',
                    'type'   => 'colibri_section',
                    'hidden' => true
                )
            ),

            "settings" => array(
                "{$prefix}show"               => array(
                    'default'   => Defaults::get( "{$prefix}show" ),
                    'transport' => 'refresh',
                    'control'   => array(
                        'label'       => Translations::get( 'show_subtitle' ),
                        'type'        => 'switch',
                        'show_toggle' => true,
                        'section'     => "hero",
                        'colibri_tab' => 'content',
                    ),

                ),
                "{$prefix}localProps.content" => array(
                    'default' => $default_content,
                    'control' => array(
                        'label'       => Translations::get( 'subtitle' ),
                        'type'        => 'input',
                        'input_type'  => 'textarea',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => "content",
                    ),
                ),

                "{$prefix}style.textAlign" => array(
                    'default'    => Defaults::get( "{$prefix}style.textAlign" ),
                    'control'    => array(
                        'label'       => Translations::escHtml( "align" ),
                        'type'        => 'align-button-group',
                        'button_size' => 'medium',
                        //labels are used as values for align-button-group
                        'choices'     => array(
                            'left'   => 'left',
                            'center' => 'center',
                            'right'  => 'right',
                        ),
                        'none_value'  => 'flex-start',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => "content",
                    ),
                    'css_output' => array(
                        array(
                            'selector' => static::selectiveRefreshSelector(),
                            'media'    => CSSOutput::NO_MEDIA,
                            'property' => 'text-align',
                        ),
                    ),
                ),
            ),
        );
    }

    public static function selectiveRefreshSelector() {
        return Defaults::get( 'header_front_page.subtitle.selective_selector', false );
    }

    public function getPenPosition() {
        return static::PEN_ON_RIGHT;
    }

    public function renderContent() {
        if ( $this->mod( static::$settings_prefix . 'show' ) ) {
            View::partial( 'front-header', 'subtitle', array(
                "component" => $this,
            ) );
        }
    }

    public function printSubtitle() {

        $prefix = static::$settings_prefix;
        if ( get_theme_mod( "{$prefix}localProps.content", false ) || is_user_logged_in() ) {
            $value = trim( $this->mod( "{$prefix}localProps.content" ) );
        } else {
            $value = get_bloginfo( 'description' );
        }
        echo str_replace( "\n", "<br/>", $value );
    }
}
src/Components/FrontHeader/TopBarSocialIcons.php000064400000004053151335104360015713 0ustar00<?php

namespace ColibriWP\Theme\Components\FrontHeader;

use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class TopBarSocialIcons extends ComponentBase {

	protected static $settings_prefix = "header_front_page.social_icons.";

	public static function selectiveRefreshSelector() {
		return Defaults::get( static::$settings_prefix . 'selective_selector', false );
	}

	/**
	 * @return array();
	 */
	protected static function getOptions() {
		$prefix = static::$settings_prefix;

		return array(
			"sections" => array(
				"{$prefix}section" => array(
					'title'  => Translations::get( 'social_icons' ),
					'panel'  => 'header_panel',
					'type'   => 'colibri_section',
					'hidden' => true
				)
			),

			"settings" => array(

				"{$prefix}localProps.icons" => array(
					'default' => Defaults::get( "{$prefix}localProps.icons" ),
					'control' => array(
						'label'          => Translations::get( 'icons' ),
						'type'           => 'repeater',
						'input_type'     => 'textarea',
						'section'        => "{$prefix}section",
						'colibri_tab'    => 'content',
						'item_add_label' => Translations::get( 'add_icon' ),
						'max'            => 10,
						'fields'         => array(

							'icon' => array(
								'type'    => 'icon',
								'label'   => Translations::get( 'icon' ),
								'default' => Defaults::get( 'icons.facebook' ),
							),

							'link_value' => array(
								'type'    => 'text',
								'label'   => Translations::get( 'link' ),
								'default' => '#',
							),
						)
					),
				),
			),
		);
	}

	public function getPenPosition() {
		return static::PEN_ON_RIGHT;
	}

	public function renderContent() {
		View::partial( 'front-header', 'top-bar/social-icons', array(
			"component" => $this,
		) );
	}

	public function printIcons() {
		$icons = $this->mod( static::$settings_prefix . 'localProps.icons', array() );
		if ( $icons ) {
			foreach ( $icons as $icon ) {
				View::partial( 'front-header', "top-bar/social-icon", $icon );
			}
		}
	}
}
src/Components/Header.php000064400000010405151335104360011362 0ustar00<?php


namespace ColibriWP\Theme\Components;


use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Theme;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;
use Exception;

class Header extends ComponentBase {

    protected static function getOptions() {
        return array(
            "settings" => array(),

            "sections" => array(
                "top_bar" => array(
                    'title'    => Translations::get( 'top_bar_settings' ),
                    'priority' => 0,
                    'panel'    => 'header_panel',
                    'type'     => 'colibri_section',
                ),

                "nav_bar" => array(
                    'title'    => Translations::get( 'nav_settings' ),
                    'priority' => 0,
                    'panel'    => 'header_panel',
                    'type'     => 'colibri_section',
                ),

                "hero" => array(
                    'title'    => Translations::get( 'hero_settings' ),
                    'priority' => 0,
                    'panel'    => 'header_panel',
                    'type'     => 'colibri_section',
                ),
            ),

            "panels" => array(
                "header_panel" => array(
                    'priority'       => 1,
                    'title'          => Translations::get( 'header_sections' ),
                    'type'           => 'colibri_panel',
                    'footer_buttons' => array(
                        'change_header' => array(
                            'label'         => Translations::get( 'change_header_design' ),
                            'name'          => 'colibriwp_headers_panel',
                            'classes'       => array( 'colibri-button-large', 'colibri-button-orange' ),
                            'icon'          => 'dashicons-admin-customizer',
                            'activate_when' => array(
                                'selector' => Defaults::get( 'header_front_page.hero.selective_selector', false )
                            )
                        )
                    )
                ),
            ),
        );
    }

    /**
     * @throws Exception
     */
    public function renderContent() {

        Hooks::colibri_do_action( 'before_header' );
        $header_class = View::isFrontPage() ? "header-front-page" : "header-inner-page";
        View::printSkipToContent();
        ?>
        <div class="header <?php echo $header_class; ?>">
            <?php View::isFrontPage() ? $this->renderFrontPageFragment() : $this->renderInnerPageFragment(); ?>
        </div>
        <script type='text/javascript'>
            (function () {
                // forEach polyfill
                if (!NodeList.prototype.forEach) {
                    NodeList.prototype.forEach = function (callback) {
                        for (var i = 0; i < this.length; i++) {
                            callback.call(this, this.item(i));
                        }
                    }
                }

                var navigation = document.querySelector('[data-colibri-navigation-overlap="true"], [data-colibri-component="navigation"][data-overlap="true"]');
                if (navigation) {
                    var els = document
                        .querySelectorAll('.h-navigation-padding');
                    if (els.length) {
                        els.forEach(function (item) {
                            item.style.paddingTop = navigation.offsetHeight + "px";
                        });
                    }
                }
            })();
        </script>
        <?php
    }


    /**
     * @throws Exception
     */
    private function renderFrontPageFragment() {

        //Theme::getInstance()->get( 'top-bar' )->render();
        Theme::getInstance()->get( 'front-nav-bar' )->render();
        Theme::getInstance()->get( 'front-hero' )->render();
    }

    private function renderInnerPageFragment() {
        //Theme::getInstance()->get( 'top-bar' )->render();
        Theme::getInstance()->get( 'inner-nav-bar' )->render();
        Theme::getInstance()->get( 'inner-hero' )->render();
    }

    public function getRenderData() {
        return array(
            'mods' => $this->mods(),
        );
    }
}
src/Components/MainContent.php000064400000022240151335104360012411 0ustar00<?php

namespace ColibriWP\Theme\Components;


use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class MainContent extends ComponentBase {

    public static function selectiveRefreshSelector() {
        return ".colibri-main-content-archive,.colibri-main-content-single";
    }

    protected static function getOptions() {
        $prefix = 'content.';

        return array(
            "settings" => array(
                "blog_posts.pen" => array(
                    'control' => array(
                        'type'        => 'pen',
                        'section'     => "content",
                        'colibri_tab' => 'content',
                    ),
                ),

                "blog_posts_per_row" => array(
                    'transport' => 'refresh',
                    'default'   => Defaults::get( "blog_posts_per_row" ),
                    'control'   => array(
                        'label'       => Translations::get( 'posts_per_row' ),
                        'section'     => "content",
                        'colibri_tab' => 'content',
                        'type'        => 'button-group',
                        'button_size' => 'medium',
                        'choices'     => array(
                            1 => '1',
                            2 => '2',
                            3 => '3',
                            4 => '4',
                        ),
                        'none_value'  => '',
                    )
                ),

                "{$prefix}separator1" => array(
                    'transport' => 'refresh',
                    'default'   => '',
                    'control'   => array(
                        'label'       => '',
                        'type'        => 'separator',
                        'section'     => 'content',
                        'colibri_tab' => 'content',
                    ),
                ),

                "blog_sidebar_enabled" => array(
                    'transport' => 'refresh',
                    'default'   => Defaults::get( "blog_sidebar_enabled" ),
                    'control'   => array(
                        'label'       => Translations::get( 'show_blog_sidebar' ),
                        'type'        => 'switch',
                        'section'     => "content",
                        'colibri_tab' => 'content',
                    )
                ),

                "blog_enable_masonry" => array(
                    'transport' => 'refresh',
                    'default'   => Defaults::get( "blog_enable_masonry" ),
                    'control'   => array(
                        'label'       => Translations::get( 'enable_masonry' ),
                        'type'        => 'switch',
                        'section'     => "content",
                        'colibri_tab' => 'content',
                    ),

                ),

                "{$prefix}separator3"               => array(
                    'default' => '',
                    'control' => array(
                        'label'       => '',
                        'type'        => 'separator',
                        'section'     => 'content',
                        'colibri_tab' => 'content',
                    ),
                ),
                "blog_show_post_thumb_placeholder"  => array(
                    'transport' => 'refresh',
                    'default'   => Defaults::get( "blog_show_post_thumb_placeholder" ),
                    'control'   => array(
                        'label'       => Translations::get( 'show_thumbnail_placeholder' ),
                        'type'        => 'switch',
                        'section'     => "content",
                        'colibri_tab' => 'content',
                    )
                ),
                "blog_post_thumb_placeholder_color" => array(
                    'transport'  => 'refresh',
                    'default'    => Defaults::get( "blog_post_thumb_placeholder_color" ),
                    'control'    => array(
                        'label'       => Translations::get( 'thumbnail_placeholder_color' ),
                        'type'        => 'color',
                        'section'     => "content",
                        'colibri_tab' => 'content',
                    ),
                    'css_output' => array(
                        array(
                            'selector' => '.colibri-post-has-no-thumbnail.colibri-post-thumbnail-has-placeholder .colibri-post-thumbnail-content',
                            'media'    => CSSOutput::NO_MEDIA,
                            'property' => 'background-color',
                        ),
                    ),
                ),

            ),
            "sections" => array(

                "content" => array(
                    'title'    => Translations::get( 'blog_settings' ),
                    'priority' => 2,
                    'panel'    => 'content_panel',
                    'type'     => 'colibri_section',

                ),
            ),

            "panels" => array(
                "content_panel" => array(
                    'priority'       => 2,
                    'title'          => Translations::get( 'content_sections' ),
                    'type'           => 'colibri_panel',
                    'footer_buttons' => array(
                        'change_header' => array(
                            'label'   => Translations::get( 'add_section' ),
                            'name'    => 'colibriwp_add_section',
                            'classes' => array( 'colibri-button-large', 'button-primary' ),
                            'icon'    => 'dashicons-plus-alt',
                        )
                    )
                ),
            ),
        );
    }


    public function printMasonryFlag() {
        $value = $this->mod( "blog_enable_masonry", false );

        if ( $value ) {
            wp_enqueue_script( 'jquery-masonry' );
            $value = 'true';
        } else {
            $value = 'false';
        }


        echo $value;
    }

    public function renderContent() {

        $self = $this;
        View::printIn( View::CONTENT_ELEMENT, function () use ( $self ) {
            /** SECTION START */
            View::printIn( View::SECTION_ELEMENT, function () use ( $self ) {
                /** ROW START */
                View::printIn( View::ROW_ELEMENT, function () use ( $self ) {

                    /** COLUMN START */
                    View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {

                        View::partial( 'main', 'archive', array(
                            "component" => $self,
                        ) );
                    } );

                    $self->printRightSidebarColumn();

                }, $self->getMainRowClass() );
                /** ROW END */
            }, $self->getMainSectionClass() );
            /** SECTION END */
        }, array(
            'class' => $self->getContentClass()
        ) );
    }

    public function printRightSidebarColumn() {
        $self = $this;

        $display_sidebar = Hooks::colibri_apply_filters( 'blog_sidebar_enabled', true, 'right' );

        if ( $display_sidebar && is_active_sidebar( 'colibri-sidebar-1' ) ) {
            View::printIn( View::COLUMN_ELEMENT, function () use ( $self ) {
                get_sidebar();
            }, array(
                'data-colibri-main-sidebar-col' => 1,
                'class'                         => $self->getSidebarColumnClass( 'right' )
            ) );
        }

    }

    private function getSidebarColumnClass( $side ) {

        $classes = (array) Hooks::colibri_apply_filters( 'blog_sidebar_column_class',
            array( 'h-col-12', 'h-col-lg-3', 'h-col-md-4' ), $side
        );

        $classes = array_merge( $classes, array( 'colibri-sidebar', "blog-sidebar-{$side}" ) );

        return array_unique( $classes );
    }

    private function getMainRowClass() {
        $classes = Hooks::colibri_apply_filters( 'main_row_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'gutters-col-0' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-row' ),
            'inner_class' => array( 'main-row-inner' )
        ) );

        return $classes;
    }

    private function getMainSectionClass() {

        $classes = Hooks::colibri_apply_filters( 'main_section_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'h-section-boxed-container' )
        ) );

        $classes = array_merge_recursive( $classes, array(
            'outer_class' => array( 'main-section' ),
            'inner_class' => array( 'main-section-inner' ),
        ) );

        return $classes;
    }

    private function getContentClass() {
        $class = Hooks::colibri_apply_filters( 'main_content_class', array() );

        if ( ! is_array( $class ) ) {
            $class = (array) $class;
        }

        array_push( $class, 'colibri-main-content-archive' );

        return $class;
    }

    public function parentRender() {
        parent::render();
    }
}
src/Components/Footer/FrontFooter.php000064400000006704151335104360013706 0ustar00<?php


namespace ColibriWP\Theme\Components\Footer;


use ColibriWP\Theme\AssetsManager;
use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;


class FrontFooter extends ComponentBase {

    protected static $settings_prefix = "footer_post.footer.";
    protected static $selector = ".page-footer";

    protected $background_component = null;

    public static function selectiveRefreshSelector() {
        return Defaults::get( static::$settings_prefix . 'selective_selector', false );
    }

    /**
     * @return array();
     */
    protected static function getOptions() {
        $prefix = static::$settings_prefix;

        return array(
            "sections" => array(
                "{$prefix}section" => array(
                    'title'  => Translations::get( 'title' ),
                    'panel'  => 'footer_panel',
                    'type'   => 'colibri_section',
                    'hidden' => true
                )
            ),

            "settings" => array(

                "{$prefix}pen" => array(
                    'control' => array(
                        'type'    => 'pen',
                        'section' => "footer",
                    ),

                ),

                "{$prefix}props.useFooterParallax" => array(
                    'default'   => Defaults::get( "{$prefix}props.useFooterParallax" ),
                    'transport' => 'refresh',
                    'control'   => array(
                        'focus_alias' => 'footer',
                        'label'       => Translations::get( 'footer_parallax' ),
                        'type'        => 'switch',
                        'show_toggle' => true,
                        'section'     => "footer",
                        'colibri_tab' => 'content',
                    ),
                    'js_output' => array(

                        array(
                            'selector' => ".page-footer",
                            'action'   => "colibri-set-attr",
                            'value'    => 'data-enabled'
                        ),


                        array(
                            'selector' => ".page-footer",
                            'action'   => "colibri-component-toggle",
                            'value'    => 'footerParallax',
                            'delay'    => 30
                        ),


                    ),
                ),
            ),
        );
    }

    public function printParalaxJsToggle() {
        $prefix   = static::$settings_prefix;
        $parallax = $this->mod( "{$prefix}props.useFooterParallax", false );
        if ( $parallax === false || $parallax === "" ) {
            AssetsManager::addInlineScriptCallback( 'colibri-theme', function () {
                ?>
                <script type="text/javascript">
                    jQuery(window).load(function () {
                        var el = jQuery(".page-footer");
                        var component = el.data()['fn.colibri.footerParallax'];
                        if (component) {
                            el.attr('data-enabled', 'false');
                            component.stop();
                        }
                    });
                </script>
                <?php
            } );
        }

    }

    public function renderContent() {
        View::partial( "front-footer", "footer", array(
            "component" => $this,
        ) );
    }
}
src/Components/PageContent.php000064400000006172151335104360012407 0ustar00<?php

namespace ColibriWP\Theme\Components;


use ColibriWP\Theme\Core\ComponentBase;
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Translations;
use ColibriWP\Theme\View;

class PageContent extends ComponentBase {

    public static function selectiveRefreshSelector() {
        return '.colibri-page-content';
    }

    /**
     * @return array();
     */
    protected static function getOptions() {
        $prefix = 'page_content_';

        return array(
            "sections" => array(
                "page_content_section" => array(
                    'title' => Translations::get( 'content_settings' ),
                    'panel' => 'content_panel',
                    'type'  => 'colibri_section',
                )
            ),

            "settings" => array(
                "page_content_pen" => array(
                    'control' => array(
                        'type'        => 'pen',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                    ),

                ),

                "{$prefix}plugin-content" => array(
                    'control' => array(
                        'type'        => 'plugin-message',
                        'section'     => "{$prefix}section",
                        'colibri_tab' => 'content',
                    )
                ),

            ),

            "panels" => array(
                "content_panel" => array(
                    'priority'       => 2,
                    'title'          => Translations::get( 'content_sections' ),
                    'type'           => 'colibri_panel',
                    'footer_buttons' => array(
                        'change_header' => array(
                            'label'   => Translations::get( 'add_section' ),
                            'name'    => 'colibriwp_add_section',
                            'classes' => array( 'colibri-button-large', 'button-primary' ),
                            'icon'    => 'dashicons-plus-alt',
                        )
                    )
                ),
            ),
        );
    }

    public function renderContent() {
        $self = $this;
        View::printIn( View::CONTENT_ELEMENT, function () use ( $self ) {
            View::printIn( View::SECTION_ELEMENT, function () {
                View::printIn( View::ROW_ELEMENT, function () {
                    View::printIn( View::COLUMN_ELEMENT, function () {
                        while ( have_posts() ) : the_post();
                            get_template_part( 'template-parts/content/content', 'page' );
                        endwhile;
                    } );
                } );
            }, $self->getPageSectionClass() );

            colibriwp_render_page_comments();

        }, array(
            "class" => array( 'page-content', 'colibri-page-content' )
        ) );
    }
    private function getPageSectionClass() {

        $classes = Hooks::colibri_apply_filters( 'page_section_class', array(
            'outer_class' => array(),
            'inner_class' => array( 'h-section-boxed-container' )
        ) );


        return $classes;
    }
}
src/Theme.php000064400000044630151335104360007116 0ustar00<?php


namespace ColibriWP\Theme;


use ColibriWP\Theme\Core\ComponentInterface;
use ColibriWP\Theme\Core\Hooks;
use Exception;
use function add_theme_support;
use function register_nav_menus;
use function register_sidebar;


class Theme {

    private static $instance = null;

    private $repository;
    private $customizer;
    private $assets_manager;
    private $plugins_manager;

    private $registered_menus = array();
    private $sidebars = array();

    private $themes_cache = array();

    public function __construct() {
        static::$instance = $this;
        Hooks::colibri_do_action( 'boot' );

        $this->repository      = new ComponentsRepository();
        $this->customizer      = new Customizer( $this );
        $this->assets_manager  = new AssetsManager( $this );
        $this->plugins_manager = new PluginsManager( $this );

        add_action( 'after_setup_theme', array( $this, 'afterSetup' ), 20 );
        add_action('init', array($this, 'onInitHook'));
        add_action('widgets_init', array($this, 'doInitWidgets'));
    }

    public static function load() {
        static::getInstance();
    }

    /**
     * @return null|Theme
     */
    public static function getInstance() {
        if ( ! static::$instance ) {
            static::$instance = new static();
            Hooks::colibri_do_action( 'theme_loaded', static::$instance );
        }

        return static::$instance;
    }

    public function modifyRegisteredSidebar( $sidebar ) {


        global $wp_registered_sidebars;

        $sidebar['before_widget'] .= '<!--colibriwp_before_widget-->';
        $sidebar['after_widget']  .= '<!--colibriwp_after_widget-->';
        $sidebar['after_title']   .= '<!--colibriwp_after_title-->';


        $wp_registered_sidebars[ $sidebar['id'] ] = $sidebar;
    }

    public function wrapWidgetsContent( $params ) {
        global $wp_registered_widgets;

        $id                = $params[0]['widget_id'];
        $original_callback = $wp_registered_widgets[ $id ]['callback'];

        if ( is_admin() ) {
            return $params;
        }

        $wp_registered_widgets[ $id ]['callback'] = function ( $args, $widget_args = 1 ) use ( $original_callback ) {
            ob_start();
            call_user_func( $original_callback, $args, $widget_args );
            $content = ob_get_clean();

            $wrapper_start_added = false;

            if ( strpos( $content, '<!--colibriwp_after_title-->' ) !== false ) {
                $content             = str_replace( '<!--colibriwp_after_title-->',
                    '<div class="colibri-widget-content-container">',
                    $content );
                $wrapper_start_added = true;
            } else {
                if ( strpos( $content, '<!--colibriwp_before_widget-->' ) !== false ) {
                    $content = str_replace( '<!--colibriwp_before_widget-->',
                        '<div class="colibri-widget-content-container">',
                        $content );
                }
                $wrapper_start_added = true;
            }

            if ( $wrapper_start_added ) {
                $content = str_replace( '<!--colibriwp_after_widget-->',
                    '</div>',
                    $content );
            }

            echo $content;

        };

        return $params;
    }


    public function afterSetup() {

        Defaults::load();
        Translations::load();



        $this->repository->load();
        $this->customizer->boot();
        $this->assets_manager->boot();
        $this->plugins_manager->boot();




        add_action( 'admin_menu', array( $this, 'addThemeInfoPage' ) );
        add_action( 'admin_notices', array( $this, 'addThemeNotice' ) );


        add_action( 'wp_ajax_colibriwp_disable_big_notice', function () {
            check_ajax_referer( 'colibriwp_disable_big_notice_nonce', 'nonce' );
            $slug = get_template() . "-page-info";
            update_option( "{$slug}-theme-notice-dismissed", true );
        } );

        add_filter( 'language_attributes', array( $this, 'languageAttributes' ) );

        add_action( 'admin_enqueue_scripts', array( $this, 'enqueueAdminScripts' ), 0 );
        add_action('wp_footer', array($this, 'addWooMyAccountIcons'));
    }

    public function onInitHook() {
        $this->registerMenus();

        add_filter( 'dynamic_sidebar_params', array( $this, 'wrapWidgetsContent' ) );
        // hooks for handling the widget content wrapping
        add_action( 'register_sidebar', array( $this, 'modifyRegisteredSidebar' ) );

    }



    public function addWooMyAccountIcons() {
        if(!function_exists('\is_account_page') ||  apply_filters( 'colibri_page_builder/installed', false )) {
            return;
        }
        if ( !is_account_page()) {
            return;
        }
        ?>
        <script>
            document.addEventListener('DOMContentLoaded', function() {
                // Check if we are on the "My Account" page by looking for a unique element
                if (document.querySelector('.woocommerce-MyAccount-navigation')) {

                    // Define SVGs for each menu item
                    const svgDashboard = '<svg  aria-hidden="true" focusable="false" data-prefix="fas" data-icon="tachometer-alt" class="svg-inline--fa fa-tachometer-alt fa-w-18" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path  d="M288 32C128.94 32 0 160.94 0 320c0 52.8 14.25 102.26 39.06 144.8 5.61 9.62 16.3 15.2 27.44 15.2h443c11.14 0 21.83-5.58 27.44-15.2C561.75 422.26 576 372.8 576 320c0-159.06-128.94-288-288-288zm0 64c14.71 0 26.58 10.13 30.32 23.65-1.11 2.26-2.64 4.23-3.45 6.67l-9.22 27.67c-5.13 3.49-10.97 6.01-17.64 6.01-17.67 0-32-14.33-32-32S270.33 96 288 96zM96 384c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm48-160c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm246.77-72.41l-61.33 184C343.13 347.33 352 364.54 352 384c0 11.72-3.38 22.55-8.88 32H232.88c-5.5-9.45-8.88-20.28-8.88-32 0-33.94 26.5-61.43 59.9-63.59l61.34-184.01c4.17-12.56 17.73-19.45 30.36-15.17 12.57 4.19 19.35 17.79 15.17 30.36zm14.66 57.2l15.52-46.55c3.47-1.29 7.13-2.23 11.05-2.23 17.67 0 32 14.33 32 32s-14.33 32-32 32c-11.38-.01-20.89-6.28-26.57-15.22zM480 384c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32z"></path></svg>';
                    const svgOrders = '<svg  aria-hidden="true" focusable="false" data-prefix="fas" data-icon="shopping-basket" class="svg-inline--fa fa-shopping-basket fa-w-18" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M576 216v16c0 13.255-10.745 24-24 24h-8l-26.113 182.788C514.509 462.435 494.257 480 470.37 480H105.63c-23.887 0-44.139-17.565-47.518-41.212L32 256h-8c-13.255 0-24-10.745-24-24v-16c0-13.255 10.745-24 24-24h67.341l106.78-146.821c10.395-14.292 30.407-17.453 44.701-7.058 14.293 10.395 17.453 30.408 7.058 44.701L170.477 192h235.046L326.12 82.821c-10.395-14.292-7.234-34.306 7.059-44.701 14.291-10.395 34.306-7.235 44.701 7.058L484.659 192H552c13.255 0 24 10.745 24 24zM312 392V280c0-13.255-10.745-24-24-24s-24 10.745-24 24v112c0 13.255 10.745 24 24 24s24-10.745 24-24zm112 0V280c0-13.255-10.745-24-24-24s-24 10.745-24 24v112c0 13.255 10.745 24 24 24s24-10.745 24-24zm-224 0V280c0-13.255-10.745-24-24-24s-24 10.745-24 24v112c0 13.255 10.745 24 24 24s24-10.745 24-24z"></path></svg>';
                    const svgDownloads = '<svg  aria-hidden="true" focusable="false" data-prefix="far" data-icon="file-archive" class="svg-inline--fa fa-file-archive fa-w-12" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M128.3 160v32h32v-32zm64-96h-32v32h32zm-64 32v32h32V96zm64 32h-32v32h32zm177.6-30.1L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM256 51.9l76.1 76.1H256zM336 464H48V48h79.7v16h32V48H208v104c0 13.3 10.7 24 24 24h104zM194.2 265.7c-1.1-5.6-6-9.7-11.8-9.7h-22.1v-32h-32v32l-19.7 97.1C102 385.6 126.8 416 160 416c33.1 0 57.9-30.2 51.5-62.6zm-33.9 124.4c-17.9 0-32.4-12.1-32.4-27s14.5-27 32.4-27 32.4 12.1 32.4 27-14.5 27-32.4 27zm32-198.1h-32v32h32z"></path></svg>';
                    const svgAddresses = '<svg  aria-hidden="true" focusable="false" data-prefix="fas" data-icon="home" class="svg-inline--fa fa-home fa-w-18" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"></path></svg>';
                    const svgAccountDetails = '<svg  aria-hidden="true" focusable="false" data-prefix="fas" data-icon="user" class="svg-inline--fa fa-user fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"></path></svg>';
                    const svgLogout = '<svg  aria-hidden="true" focusable="false" data-prefix="fas" data-icon="sign-out-alt" class="svg-inline--fa fa-sign-out-alt fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path  d="M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"></path></svg>';

                    // Define the menu item IDs
                    const menuItems = {
                        'dashboard': svgDashboard,
                        'orders': svgOrders,
                        'downloads': svgDownloads,
                        'edit-address': svgAddresses,
                        'edit-account': svgAccountDetails,
                        'customer-logout': svgLogout
                    };

                    // Loop through the items and prepend the corresponding SVG to the link text
                    for (const [key, svg] of Object.entries(menuItems)) {
                        const menuItem = document.querySelector('.woocommerce-MyAccount-navigation-link--' + key + ' a');
                        if (menuItem) {
                            menuItem.insertAdjacentHTML('afterbegin', svg + ' ');
                        }
                    }
                }
            });
        </script>
        <?php
    }
    private function registerMenus() {
        register_nav_menus( $this->registered_menus );
    }

    public function languageAttributes( $output ) {
        if ( apply_filters( 'colibri_page_builder/installed', false ) ) {
            return $output;
        }

        $theme_class = get_template() . "-theme";
        $output      .= " class='{$theme_class}'";

        return $output;

    }

    public function enqueueAdminScripts() {
        $slug = get_template() . "-page-info";

        $this->getAssetsManager()->registerScript(
            $slug,
            $this->getAssetsManager()->getBaseURL() . "/admin/admin.js",
            array( 'jquery' ),
            false
        )->registerStyle(
            $slug,
            $this->getAssetsManager()->getBaseURL() . "/admin/admin.css" .
            false );
    }

    /**
     * @return AssetsManager
     */
    public function getAssetsManager() {
        return $this->assets_manager;
    }

    public function addThemeNotice() {

        global $pagenow;
        if ( $pagenow === "update.php" ) {
            return;
        }

        $slug = get_template() . "-page-info";

        $dismissed            = get_option( "{$slug}-theme-notice-dismissed", false );
        $is_builder_installed = apply_filters( 'colibri_page_builder/installed', false );

        if ( get_option( 'extend_builder_theme', false ) ) {
            $dismissed = true;
        }

        if ( ! $dismissed && ! $is_builder_installed ) {
            wp_enqueue_style( $slug );
            wp_enqueue_script( $slug );
            wp_enqueue_script( 'wp-util' );


	          $colibri_get_started = array(
              'plugin_installed_and_active' => Translations::escHtml( 'plugin_installed_and_active' ),
              'activate'                    => Translations::escHtml( 'activate' ),
              'activating'                  => __( 'Activating', 'colibri-wp' ),
              'install_recommended'         => isset( $_GET['install_recommended'] ) ? $_GET['install_recommended'] : ''
            );

	          wp_localize_script( $slug, 'colibri_get_started', $colibri_get_started );

            ?>
            <div class="notice notice-success is-dismissible colibri-admin-big-notice notice-large">
                <?php View::make( "admin/admin-notice" ); ?>
            </div>
            <?php
        }

    }

    /**
     * @return PluginsManager
     */
    public function getPluginsManager() {
        return $this->plugins_manager;
    }

    public function addThemeInfoPage() {
        $tabs = Hooks::colibri_apply_filters( 'info_page_tabs', array() );

        if ( ! count( $tabs ) ) {
            return;
        }

        $slug = get_template() . "-page-info";

        $page_name = Hooks::colibri_apply_filters( 'theme_page_name', Translations::get( 'theme_page_name' ) );
        add_theme_page(
            $page_name,
            $page_name,
            'activate_plugins',
            $slug,
            array( $this, 'printThemePage' )
        );

        add_action( 'admin_enqueue_scripts', array( $this, 'enqueueThemeInfoPageScripts' ), 20 );
    }

    public function enqueueThemeInfoPageScripts() {
        global $plugin_page;
        $slug = get_template() . "-page-info";

        if ( $plugin_page === $slug ) {
            wp_enqueue_style( $slug );
            wp_enqueue_script( $slug );
        }
    }

    public function printThemePage() {


        $tabs        = Hooks::colibri_apply_filters( 'info_page_tabs', array() );
        $tabs_slugs  = array_keys( $tabs );
        $default_tab = count( $tabs_slugs ) ? $tabs_slugs[0] : null;

        $current_tab = isset( $_REQUEST['current_tab'] ) ? $_REQUEST['current_tab'] : $default_tab;
        $url         = add_query_arg
        (
            array(
                'page' => get_template() . "-page-info",
            ),
            admin_url( "themes.php" )
        );

        $welcome_message = sprintf( Translations::translate( 'welcome_message' ), $this->getThemeHeaderData( 'Name' ) );
        $welcome_info    = Translations::translate( 'welcome_info' );


        View::make( "admin/page",
            array(
                'tabs'            => $tabs,
                'current_tab'     => $current_tab,
                'page_url'        => $url,
                'welcome_message' => Hooks::colibri_apply_filters( 'info_page_welcome_message', $welcome_message ),
                'welcome_info'    => Hooks::colibri_apply_filters( 'info_page_welcome_info', $welcome_info ),
            )
        );

    }

    public function getThemeHeaderData( $key, $child = false ) {

        $slug  = $this->getThemeSlug( $child );
        $theme = $this->getTheme( $slug );

        return $theme->get( $key );
    }

    public function getThemeSlug( $maybe_get_child = false ) {
        $slug  = get_template();
        $theme = $this->getTheme();
        if ( ! $maybe_get_child ) {
            $maybe_get_child = Hooks::colibri_apply_filters( 'use_child_theme_header_data', $maybe_get_child );
        }

        if ( $maybe_get_child && $theme->get( 'Template' ) ) {
            $slug = get_stylesheet();
        }

        return $slug;

    }

    public function getTheme( $stylesheet = null ) {

        if ( ! array_key_exists( $stylesheet, $this->themes_cache ) ) {
            $this->themes_cache[ $stylesheet ] = wp_get_theme( $stylesheet );
        }

        return $this->themes_cache[ $stylesheet ];

    }

    public function doInitWidgets() {

        foreach ( $this->sidebars as $sidebar ) {
            register_sidebar( $sidebar );
        }
    }

    /**
     * @param $component_name
     *
     * @return ComponentInterface|null
     * @throws Exception
     */
    public function get( $component_name ) {


        $component = $this->repository->getByName( $component_name );

        if ( ! $component ) {
            throw new Exception( "Null component: `{$component_name}`" );
        }


        return $component;
    }

    /**
     * @return ComponentsRepository
     */
    public function getRepository() {
        return $this->repository;
    }

    /**
     * @param ComponentsRepository $repository
     */
    public function setRepository( $repository ) {
        $this->repository = $repository;
    }

    public function getVersion() {
        $theme = $this->getTheme();
        if ( $theme->get( 'Template' ) ) {
            $theme = $this->getTheme( $theme->get( 'Template' ) );
        }

        return $theme->get( 'Version' );
    }

    public function getTextDomain() {
        $theme = $this->getTheme();
        if ( $theme->get( 'Template' ) ) {
            $theme = $this->getTheme( $theme->get( 'Template' ) );
        }

        return $theme->get( 'TextDomain' );
    }

    /**
     * @return Customizer
     */
    public function getCustomizer() {
        return $this->customizer;
    }

    /**
     * @param string $feature
     * @param bool $args
     *
     * @return Theme
     */
    public function add_theme_support( $feature, $args = true ) {

        if ( $args !== true ) {
            add_theme_support( $feature, $args );
        } else {
            add_theme_support( $feature );
        }

        return $this;
    }

    /**
     * @param string $feature
     * @param bool $args
     *
     * @return Theme
     */
    public function register_menus( $menus ) {
        $this->registered_menus = array_merge( $this->registered_menus, $menus );

        return $this;
    }

    public function register_sidebars( $sidebar ) {

        $this->sidebars = array_merge( $this->sidebars, $sidebar );

        return $this;
    }

    public function contentWidth( $width = 1200 ) {
        global $content_width;
        $content_width = $width;
    }
}
src/View.php000064400000027324151335104360006767 0ustar00<?php


namespace ColibriWP\Theme;


use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Tree;
use ColibriWP\Theme\Core\Utils;


class View {


    const CONTENT_ELEMENT = 'content';
    const SECTION_ELEMENT = 'section';
    const ROW_ELEMENT = 'row';
    const COLUMN_ELEMENT = 'column';

    /**
     * @param       $category
     * @param       $slug
     * @param array $data
     */

    public static function partial( $category, $slug, $data = array() ) {

        $category = Utils::camel2dashed( $category );
        $slug     = Utils::camel2dashed( $slug );


        static::prinDebugHTMLComment( 'Start Partial', "/{$category}/{$slug}" );
        static::make( "template-parts/{$category}/{$slug}", $data );
        static::prinDebugHTMLComment( 'Start Partial', "/{$category}/{$slug}" );

    }

    public static function prinDebugHTMLComment( $message = '', $details = '' ) {

        if ( defined( 'COLIBRI_THEME_DEBUG' ) && COLIBRI_THEME_DEBUG && ! is_customize_preview() ) {
            $message = $details ? trim( $message ) . " - " : '';
            $content = trim( strtoupper( $message ) . trim( $details ) );
            ?>
            <!--  <?php echo esc_attr( $content ); ?> -->
            <?php
        }
    }

    public static function make( $path, $data = array() ) {
        global $wp_query;

        $wp_query->query_vars['colibri_data'] = new Tree( $data );

        if ( file_exists( $path ) ) {
            load_template( $path );
        } else {
            get_template_part( $path );
        }


        $wp_query->query_vars['colibri_data'] = null;
    }

    public static function getData( $path, $default = null ) {
        global $wp_query;
        $colibri_data = $wp_query->query_vars['colibri_data'];
        if ( $colibri_data ) {
            /** @var Tree $colibri_data */
            return $colibri_data->findAt( $path, $default );
        }

        return $default;
    }

    public static function isFrontPage() {
        return is_front_page();
    }

    public static function printMenu( $attrs, $walker = "" ) {
        $attrs = array_merge( array(
            'id'      => null,
            'classes' => '',
        ), $attrs );

        $theme_location         = $attrs['id'];
        $customClasses          = $attrs['classes'];
        $drop_down_menu_classes = array( 'colibri-menu' );
        $drop_down_menu_classes = array_merge( $drop_down_menu_classes, array( $customClasses ) );


        if ( static::emptyMenu( $theme_location ) ) {
            echo 'No menu items';

            return;
        }

        wp_nav_menu( array(
            'theme_location'  => $theme_location,
            'menu_class'      => esc_attr( implode( " ", $drop_down_menu_classes ) ),
            'container_class' => 'colibri-menu-container',
            'fallback_cb'     => function () use ( $attrs ) {
                static::menuFallback( $attrs );
            },
            'walker'          => $walker,
        ) );
    }

    private static function emptyMenu( $theme_location ) {
        $theme_locations = get_nav_menu_locations();
        $menu_id         = 0;

        if ( array_key_exists( $theme_location, $theme_locations ) ) {
            $menu_id = $theme_locations[ $theme_location ];
        }

        $menu_items = wp_get_nav_menu_items( $menu_id );

        if ( $menu_items && count( $menu_items ) === 0 ) {
            return true;
        }

    }

    public static function menuFallback( $attrs, $walker = '' ) {

        $customClasses          = $attrs['classes'];
        $drop_down_menu_classes = array( 'colibri-menu' );
        $drop_down_menu_classes = array_merge( $drop_down_menu_classes, array( $customClasses ) );

        return wp_page_menu( array(
            "menu_class" => 'colibri-menu-container',
            'before'     => '<ul class="' . esc_attr( implode( " ", $drop_down_menu_classes ) ) . '">',
            'after'      => apply_filters( 'colibriwp_nomenu_after', '' ) . "</ul>",
            'walker'     => $walker,
        ) );
    }


    public static function printContentWrapperAttrs( $classes = array() ) {

        $classes = is_array( $classes ) ? $classes : array( $classes );
        $classes = array_merge( array( 'gridContainer', 'content' ), $classes );

        $classes = Hooks::colibri_apply_filters( 'content_wrapper_class', $classes );
        $classes = array_unique( $classes );

        printf( ' class="%s" ', esc_attr( implode( " ", $classes ) ) );
    }

    public static function printEntryThumb( $classes = "" ) {

        $placeholder_color = "#333";
        ?>
        <a href="<?php the_permalink(); ?>">
            <div class="image-container-frame">
                <?php
                if ( has_post_thumbnail() ) {
                    the_post_thumbnail( 'post-thumbnail', array(
                        "class" => $classes,
                    ) );
                } else {
                    ?>
                    <svg class="colibri-post-list-item-thumb-placeholder <?php echo esc_attr( $classes ); ?>"
                         width="890" height="580"
                         viewBox="0 0 890 580" preserveAspectRatio="none">
                        <rect width="890" height="580"
                              style="fill:<?php echo esc_attr( $placeholder_color ); ?>;"></rect>
                    </svg>
                    <?php
                }
                ?>
            </div>
        </a>
        <?php
    }

    public static function printPagination( $args = array(), $class = 'pagination' ) {
        if ( $GLOBALS['wp_query']->max_num_pages <= 1 ) {
            return;
        }

        $args = wp_parse_args( $args, array(
            'mid_size'           => 2,
            'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'colibri-wp' )
                                    . ' </span>',
            'prev_text'          => __( '<i class="fa fa-angle-left" aria-hidden="true"></i>', 'colibri-wp' ),
            'next_text'          => __( '<i class="fa fa-angle-right" aria-hidden="true"></i>', 'colibri-wp' ),
            'screen_reader_text' => __( 'Posts navigation', 'colibri-wp' ),
        ) );

        $links = paginate_links( $args );

        $next_link = get_previous_posts_link( __( '<i class="fa fa-angle-left" aria-hidden="true"></i>',
            'colibri-wp' ) );
        $prev_link = get_next_posts_link( __( '<i class="fa fa-angle-right" aria-hidden="true"></i>',
            'colibri-wp' ) );

        $template = '<div class="navigation %1$s" role="navigation">' .
                    '  <h2 class="screen-reader-text">%2$s</h2>' .
                    '  <div class="nav-links">' .
                    '    <div class="prev-navigation">%3$s</div>' .
                    '    <div class="numbers-navigation">%4$s</div>' .
                    '    <div class="next-navigation">%5$s</div>' .
                    '  </div>' .
                    '</div>';

        echo sprintf( $template, esc_attr( $class ), $args['screen_reader_text'], $next_link, $links, $prev_link );
    }

    public static function printRowStart( $args ) {

        $args = array_merge( array(
            'inner_class' => array(),
            'outer_class' => array()
        ), $args );

        $outer_classes = array_merge( array(
            "h-row-container"
        ), $args['outer_class'] );

        $inner_classes = array_merge(
            array(
                'h-row'
            ),
            $args['inner_class']
        );
        static::printTwoLevelsDivStart( $outer_classes, $inner_classes );

    }

    private static function printTwoLevelsDivStart( $outer_classes = array(), $inner_classes = array() ) {
        $outer_classes = implode( ' ', $outer_classes );
        $inner_classes = implode( ' ', $inner_classes );


        static::printElementStart( 'div', array( 'class' => $outer_classes ) );
        static::printElementStart( 'div', array( 'class' => $inner_classes ) );
    }

    public static function printElementStart( $tag, $attrs = array() ) {
        $key_value_attrs = array();

        foreach ( $attrs as $key => $value ) {
            if ( is_array( $value ) ) {
                $value = implode( " ", array_unique( $value ) );
            }

            $value             = esc_attr( $value );
            $key               = sanitize_key( $key );
            $key_value_attrs[] = "{$key}='{$value}'";
        }

        $attrs_string = implode( " ", $key_value_attrs );

        echo "<{$tag} {$attrs_string}>";

    }

    public static function printRowEnd() {
        static::printTwoLevelsDivEnd();
    }

    private static function printTwoLevelsDivEnd() {
        self::printElementEnd( 'div' );
        self::printElementEnd( 'div' );
    }

    public static function printElementEnd( $tag ) {
        echo "</{$tag}>";

    }

    public static function printSectionStart( $args = array() ) {
        $args = array_merge( array(
            'inner_class' => array(),
            'outer_class' => array()
        ), $args );


        $outer_classes = array_merge( array(
            'd-flex',
            'h-section',
            'h-section-global-spacing',
            'position-relative',
        ), (array) $args['outer_class'] );

        $inner_classes = array_merge( array(
            'h-section-grid-container',
        ), (array) $args['inner_class'] );

        static::printTwoLevelsDivStart( $outer_classes, $inner_classes );
    }

    public static function printSectionEnd() {
        static::printTwoLevelsDivEnd();
    }

    public static function printContentStart( $args = array() ) {
        $class         = Utils::pathGet( $args, 'class', array() );
        $class         = array_merge( array( 'content', ' position-relative' ), $class );
        $args['class'] = $class;
        $args['id']    = Utils::pathGet( $args, 'id', 'content' );

        self::printElementStart( 'div', $args );

    }

    public static function printContentEnd() {
        static::printElementEnd( 'div' );
    }


    public static function printColumnStart( $args = array() ) {
        $class         = Utils::pathGet( $args, 'class', array() );
        $class         = array_merge( array( 'h-col' ), $class );
        $args['class'] = $class;
        self::printElementStart( 'div', $args );
    }

    public static function printColumnEnd() {
        static::printElementEnd( 'div' );
    }

    /**
     * @param string $wrapper
     * @param callable $to_print
     * @param array $args
     */
    public static function printIn( $wrapper, $to_print, $args = array() ) {
        $wrapper              = ucfirst( strtolower( $wrapper ) );
        $wrapperFunctionStart = "print{$wrapper}Start";
        $wrapperFunctionEnd   = "print{$wrapper}End";
        if ( method_exists( View::class, "{$wrapperFunctionStart}" ) ) {
            if ( method_exists( View::class, "{$wrapperFunctionEnd}" ) ) {
                echo "<!-- {$wrapper}:start -->\n";
                call_user_func( array( View::class, $wrapperFunctionStart ), $args );
                call_user_func( $to_print );
                call_user_func( array( View::class, $wrapperFunctionEnd ), $args );
                echo "\n<!-- {$wrapper}:end -->";
            }
        }
    }

    public static function printSkipToContent() {
        ?>
        <script>
            /(trident|msie)/i.test(navigator.userAgent) && document.getElementById && window.addEventListener && window.addEventListener("hashchange", function () {
                var t, e = location.hash.substring(1);
                /^[A-z0-9_-]+$/.test(e) && (t = document.getElementById(e)) && (/^(?:a|select|input|button|textarea)$/i.test(t.tagName) || (t.tabIndex = -1), t.focus())
            }, !1);
        </script>
        <a class="skip-link screen-reader-text" href="#content">
            <?php Translations::escHtmlE( 'skip_to_content' ) ?>
        </a>
        <?php
    }
}
src/Customizer.php000064400000035621151335104360010220 0ustar00<?php


namespace ColibriWP\Theme;


use ColibriWP\Theme\Core\ConfigurableInterface;
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Tree;
use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Customizer\ControlFactory;
use ColibriWP\Theme\Customizer\Controls\ColibriControl;
use ColibriWP\Theme\Customizer\CustomizerApi;
use ColibriWP\Theme\Customizer\PanelFactory;
use ColibriWP\Theme\Customizer\SectionFactory;
use WP_Customize_Manager;
use function is_customize_preview;

class Customizer {

    const TYPE_CONTROL = "control";
    const TYPE_SECTION = "section";
    const TYPE_PANEL = "panel";

    private $theme = null;
    private $options;
    private $sections = array();
    private $panels = array();
    private $settings = array();


    public function __construct( Theme $theme ) {

        new CustomizerApi();
        $this->theme   = $theme;
        $this->options = new Tree();

    }

    public static function sanitize( $value, $data = array() ) {

        if ( is_bool( $value ) ) {
            return $value;
        }

        $control_type = Utils::pathGet( $data, 'control.type', false );

        if ( $control_type ) {
            $constructor = ControlFactory::getConstructor( $control_type );

            if ( method_exists( $constructor, 'sanitize' ) ) {
                return call_user_func( array( $constructor, 'sanitize' ),
                    $value,
                    Utils::pathGet( $data, 'control', array() ),
                    Utils::pathGet( $data, 'default', '' )
                );
            }


        }

        return (string) $value;
    }

    public function boot() {

        if ( Hooks::colibri_apply_filters( 'customizer_skip_boot', false ) ) {
            return;
        }

        add_action( 'customize_register', array( $this, 'prepareOptions' ), 0, 0 );
        add_action( 'customize_register', array( $this, 'prepareTypes' ), 0, 1 );

        // register customizer structure
        add_action( 'customize_register', array( $this, 'registerPanels' ), 1, 1 );
        add_action( 'customize_register', array( $this, 'registerSections' ), 2, 1 );

        // register customizer components
        add_action( 'customize_register', array( $this, 'registerSettings' ), 3, 1 );
        add_action( 'customize_register', array( $this, 'registerControls' ), 4, 1 );

        // additional elements
        add_action( 'customize_register', array( $this, 'registerPartialRefresh' ), 5, 1 );

        $self = $this;
        $this->inPreview( function () use ( $self ) {
            add_action( 'wp_print_footer_scripts', array( $self, 'printPreviewOptions' ), PHP_INT_MAX );
        } );

        // rearrange customizer components
        add_action( 'customize_register', array( $this, 'rearrangeComponents' ), PHP_INT_MAX, 1 );

        // add customizer js / css
        add_action( 'customize_controls_print_scripts', array( $this, 'registerAssets' ), PHP_INT_MAX, 1 );

        //
        $this->onPreviewInit( array( $this, 'previewInit' ) );


    }

    public function inPreview( $callback ) {
        if ( is_customize_preview() && is_callable( $callback ) ) {
            call_user_func( $callback );
        }
    }

    public function onPreviewInit( $callback, $priorty = 10 ) {

        add_action( 'customize_preview_init', $callback, $priorty );
    }

    public function printPreviewOptions() {
        ?>
        <script data-name="colibri-preview-options">
            var colibri_CSS_OUTPUT_CONTROLS = <?php echo wp_json_encode( ControlFactory::getCssOutputControls() ); ?>;
            var colibri_JS_OUTPUT_CONTROLS = <?php echo wp_json_encode( ControlFactory::getJsOutputControls() ); ?>;
            var colibri_CONTROLS_ACTIVE_RULES = <?php echo wp_json_encode( ControlFactory::getActiveRules() ); ?>;
            var colibri_ADDITIONAL_JS_DATA = <?php echo wp_json_encode( (object) Hooks::colibri_apply_filters( 'customizer_additional_js_data',
                array() ) ); ?>;
        </script>
        <?php
    }

    public function getSettingQuickLink( $value ) {
        return add_query_arg( 'colibri_autofocus', $value, admin_url( "/customize.php" ) );
    }

    public function prepareOptions() {

        new HeaderPresets();

        $components = $this->theme->getRepository()->getAllDefinitions();
        $options    = array(
            "settings" => array(),
            "sections" => array(),
            "panels"   => array(),
        );

        foreach ( $components as $key => $component ) {
            $interfaces = class_implements( $component );

            if ( array_key_exists( ConfigurableInterface::class, $interfaces ) ) {

                /** @var ConfigurableInterface $component */
                $opts = (array) $component::options();

                foreach ( $options as $opt_key => $value ) {

                    if ( array_key_exists( $opt_key, $opts ) && is_array( $opts[ $opt_key ] ) ) {

                        $options[ $opt_key ] = array_merge( $options[ $opt_key ], $opts[ $opt_key ] );

                    }

                }
            }

        }

        $options = Hooks::colibri_apply_filters( 'customizer_options', $options );

        //set initial section > tabs to empty = true
        $tabs     = array( 'content' => true, 'style' => true, 'layout' => true );
        $sections = array_flip( array_keys( $options['sections'] ) );
        array_walk( $sections, function ( &$value, $key ) use ( $tabs ) {
            $value = array( 'tabs' => $tabs );
        } );

        //set section > tabs that have controls empty = false
        foreach ( $options['settings'] as $setting => $value ) {
            $section                              = $value['control']['section'];
            $tab                                  = Utils::pathGet( $value, 'control.colibri_tab', 'content' );
            $sections[ $section ]['tabs'][ $tab ] = false;
        }

        foreach ( $sections as $section => $values ) {
            foreach ( $values['tabs'] as $tab => $tab_empty ) {
                if ( $tab_empty ) {
                    //var_dump($section);
                    $key                         = "{$section}-{$tab}-plugin-message";
                    $options['settings'][ $key ] = array(
                        'control' => array(
                            'type'        => 'plugin-message',
                            'section'     => $section,
                            'colibri_tab' => $tab,
                        )
                    );
                }
            }
        }

        if ( isset( $_REQUEST['colibriwp_export_default_options'] ) && is_admin() ) {
            $defaults = array();

            foreach ( $options['settings'] as $key => $value ) {
                $defaults[ $key ] = str_replace(
                    site_url(),
                    '%s',
                    Utils::pathGet( $value, 'default', '' )
                );
            }

            wp_send_json_success( $defaults );
        }

        $this->options->setData( $options );
    }

    /**
     * @param WP_Customize_Manager $wp_customize
     */
    public function prepareTypes( $wp_customize ) {
        $types = Hooks::colibri_apply_filters( 'customizer_types', array() );
        foreach ( $types as $class => $type ) {
            switch ( $type ) {
                case Customizer::TYPE_CONTROL:
                    $wp_customize->register_control_type( $class );
                    break;

                case Customizer::TYPE_SECTION:
                    $wp_customize->register_section_type( $class );
                    break;

                case Customizer::TYPE_PANEL:
                    $wp_customize->register_panel_type( $class );
                    break;
            }

        }

    }

    public function registerPanels() {
        $this->panels = new Tree( $this->options->findAt( "panels" ) );

        $this->panels->walkFirstLevel( function ( $id, $data ) {
            PanelFactory::make( $id, $data );
        } );
    }

    public function registerSections() {
        $this->sections = new Tree( $this->options->findAt( "sections" ) );

        $this->sections->walkFirstLevel( function ( $id, $data ) {
            SectionFactory::make( $id, $data );
        } );
    }

    /**
     * @param WP_Customize_Manager $wp_customize
     */
    public function registerSettings( $wp_customize ) {
        $this->settings    = new Tree( $this->options->findAt( "settings" ) );
        $sanitize_callback = array( __CLASS__, "sanitize" );

        $this->settings->walkFirstLevel( function ( $id, $data ) use ( $wp_customize, $sanitize_callback ) {

            $data = array_merge( array(
                'transport' => 'colibri_selective_refresh',
                'default'   => '',
            ), $data );

            if ( isset( $data['setting'] ) ) {
                $id = $data['setting'];
            }

            if ( ! ( isset( $data['settingless'] ) && $data['settingless'] ) ) {

                if ( ! $wp_customize->get_setting( $id ) ) {
                    $wp_customize->add_setting( $id, array(
                        'transport'         => $data['transport'],
                        'default'           => $data['default'],
                        'sanitize_callback' => function ( $value ) use ( $sanitize_callback, $data ) {
                            return call_user_func( $sanitize_callback, $value, $data );
                        },
                    ) );
                }
            }

            if ( isset( $data['control'] ) ) {

                $control = array_merge( array(
                    'default'   => $data['default'],
                    'transport' => $data['transport'],

                ), $data['control'] );

                if ( array_key_exists( 'css_output', $data ) ) {
                    $control['transport']  = 'css_output';
                    $control['css_output'] = $data['css_output'];
                }
                if ( array_key_exists( 'js_output', $data ) ) {
                    $control['transport'] = 'js_output';
                    $control['js_output'] = $data['js_output'];
                }
                if ( array_key_exists( 'active_rules', $data ) ) {
                    $control['active_rules'] = $data['active_rules'];
                }

                $control['settingless'] = ( isset( $data['settingless'] ) && $data['settingless'] );

                ControlFactory::make( $id, $control );
            }

        } );


    }

    /**
     * @param WP_Customize_Manager $wp_customize
     */
    public function registerControls( $wp_customize ) {

    }

    /**
     * @param WP_Customize_Manager $wp_customize
     */
    public function registerPartialRefresh( $wp_customize ) {
        $partials = ControlFactory::getPartialRefreshes();

        Hooks::colibri_add_filter( 'customizer_additional_js_data', function ( $value ) use ( $partials ) {
            $value['selective_refresh_settings'] = array();

            foreach ( $partials as $partial ) {
                $value['selective_refresh_settings'] = array_merge( $value['selective_refresh_settings'],
                    $partial['settings'] );
            }

            return $value;
        } );

        foreach ( $partials as $key => $args ) {
            $wp_customize->selective_refresh->add_partial( $key, $args );
        }
    }

    /**
     * @param WP_Customize_Manager $wp_customize
     */
    public function rearrangeComponents( $wp_customize ) {

        Hooks::colibri_do_action( 'rearrange_customizer_components', $wp_customize );
    }

    public function registerAssets() {


        $base_url = $this->theme->getAssetsManager()->getBaseURL();

        wp_register_script( Hooks::HOOK_PREFIX . "customizer",
            $base_url . "/customizer/customizer.js", array( 'jquery' ),
            $this->theme->getVersion(), true );

        wp_localize_script( Hooks::HOOK_PREFIX . "customizer", 'colibri_Customizer_Data',
            Hooks::colibri_apply_filters( 'customizer_js_data', array(
                'translations'              => Translations::all(),
                'section_default_tab'       => ColibriControl::DEFAULT_COLIBRI_TAB,
                'style_tab'                 => ColibriControl::STYLE_COLIBRI_TAB,
                'colibriwp_disable_big_notice_nonce' => wp_create_nonce('colibriwp_disable_big_notice_nonce'),
                'colibri_autofocus'         => Utils::pathGet( $_REQUEST, 'colibri_autofocus' ),
                'colibri_autofocus_aliases' => (object) Hooks::colibri_apply_filters( 'customizer_autofocus_aliases',
                    array() )
            ) ) );

        wp_register_style( Hooks::HOOK_PREFIX . "customizer",
            $base_url . "/customizer/customizer.css", array( 'customize-controls' ),
            $this->theme->getVersion() );

        wp_enqueue_style( Hooks::HOOK_PREFIX . "customizer" );
        wp_enqueue_script( Hooks::HOOK_PREFIX . "customizer" );
    }

    public function isInPreview() {
        return is_customize_preview();
    }

    public function isCustomizer( $callback ) {
        if ( is_customize_preview() && is_callable( $callback ) ) {
            call_user_func( $callback );
        }
    }

    public function previewInit() {

        $base_url = $this->theme->getAssetsManager()->getBaseURL();

        wp_enqueue_style( Hooks::HOOK_PREFIX . "customizer_preview",
            $base_url . "/customizer/preview.css", Theme::getInstance()->getVersion() );


        wp_enqueue_script( Hooks::HOOK_PREFIX . "customizer_preview",
            $base_url . "/customizer/preview.js", array(
                'customize-preview',
                'customize-selective-refresh'
            ),
            Theme::getInstance()->getVersion(), true );


        AssetsManager::addInlineScriptCallback(
            Hooks::HOOK_PREFIX . "customizer_preview",
            function () {
                ?>
                <script type="text/javascript">
                    (function () {
                        function ready(callback) {
                            if (document.readyState !== 'loading') {
                                callback();
                            } else {
                                if (document.addEventListener) {
                                    document.addEventListener('DOMContentLoaded', callback);

                                } else {
                                    document.attachEvent('onreadystatechange', function () {
                                        if (document.readyState === 'complete') callback();
                                    });
                                }
                            }
                        }

                        ready(function () {
                            setTimeout(function () {
                                parent.wp.customize.trigger('colibri_preview_ready');
                            }, 500);
                        })
                    })();
                </script>
                <?php
            }
        );
    }

    /**
     * @return array
     */
    public function getSettings() {
        return $this->settings;
    }
}
class-tgm-plugin-activation.php000064400000466516151335104360012625 0ustar00<?php
/**
 * Plugin installation and activation for WordPress themes.
 *
 * Please note that this is a drop-in library for a theme or plugin.
 * The authors of this library (Thomas, Gary and Juliette) are NOT responsible
 * for the support of your plugin or theme. Please contact the plugin
 * or theme author for support.
 *
 * @package   TGM-Plugin-Activation
 * @version   2.6.1 for parent theme Colibri Wp for publication on WordPress.org
 * @link      http://tgmpluginactivation.com/
 * @author    Thomas Griffin, Gary Jones, Juliette Reinders Folmer
 * @copyright Copyright (c) 2011, Thomas Griffin
 * @license   GPL-2.0+
 */

/*
	Copyright 2011 Thomas Griffin (thomasgriffinmedia.com)

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License, version 2, as
	published by the Free Software Foundation.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {

    /**
     * Automatic plugin installation and activation library.
     *
     * Creates a way to automatically install and activate plugins from within themes.
     * The plugins can be either bundled, downloaded from the WordPress
     * Plugin Repository or downloaded from another external source.
     *
     * @since 1.0.0
     *
     * @package TGM-Plugin-Activation
     * @author  Thomas Griffin
     * @author  Gary Jones
     */
    class TGM_Plugin_Activation {
        /**
         * TGMPA version number.
         *
         * @since 2.5.0
         *
         * @const string Version number.
         */
        const TGMPA_VERSION = '2.6.1';

        /**
         * Regular expression to test if a URL is a WP plugin repo URL.
         *
         * @const string Regex.
         *
         * @since 2.5.0
         */
        const WP_REPO_REGEX = '|^http[s]?://wordpress\.org/(?:extend/)?plugins/|';

        /**
         * Arbitrary regular expression to test if a string starts with a URL.
         *
         * @const string Regex.
         *
         * @since 2.5.0
         */
        const IS_URL_REGEX = '|^http[s]?://|';

        /**
         * Holds a copy of itself, so it can be referenced by the class name.
         *
         * @since 1.0.0
         *
         * @var TGM_Plugin_Activation
         */
        public static $instance;

        /**
         * Holds arrays of plugin details.
         *
         * @since 1.0.0
         * @since 2.5.0 the array has the plugin slug as an associative key.
         *
         * @var array
         */
        public $plugins = array();

        /**
         * Holds arrays of plugin names to use to sort the plugins array.
         *
         * @since 2.5.0
         *
         * @var array
         */
        protected $sort_order = array();

        /**
         * Whether any plugins have the 'force_activation' setting set to true.
         *
         * @since 2.5.0
         *
         * @var bool
         */
        protected $has_forced_activation = false;

        /**
         * Whether any plugins have the 'force_deactivation' setting set to true.
         *
         * @since 2.5.0
         *
         * @var bool
         */
        protected $has_forced_deactivation = false;

        /**
         * Name of the unique ID to hash notices.
         *
         * @since 2.4.0
         *
         * @var string
         */
        public $id = 'tgmpa';

        /**
         * Name of the query-string argument for the admin page.
         *
         * @since 1.0.0
         *
         * @var string
         */
        protected $menu = 'tgmpa-install-plugins';

        /**
         * Parent menu file slug.
         *
         * @since 2.5.0
         *
         * @var string
         */
        public $parent_slug = 'themes.php';

        /**
         * Capability needed to view the plugin installation menu item.
         *
         * @since 2.5.0
         *
         * @var string
         */
        public $capability = 'edit_theme_options';

        /**
         * Default absolute path to folder containing bundled plugin zip files.
         *
         * @since 2.0.0
         *
         * @var string Absolute path prefix to zip file location for bundled plugins. Default is empty string.
         */
        public $default_path = '';

        /**
         * Flag to show admin notices or not.
         *
         * @since 2.1.0
         *
         * @var boolean
         */
        public $has_notices = true;

        /**
         * Flag to determine if the user can dismiss the notice nag.
         *
         * @since 2.4.0
         *
         * @var boolean
         */
        public $dismissable = true;

        /**
         * Message to be output above nag notice if dismissable is false.
         *
         * @since 2.4.0
         *
         * @var string
         */
        public $dismiss_msg = '';

        /**
         * Flag to set automatic activation of plugins. Off by default.
         *
         * @since 2.2.0
         *
         * @var boolean
         */
        public $is_automatic = false;

        /**
         * Optional message to display before the plugins table.
         *
         * @since 2.2.0
         *
         * @var string Message filtered by wp_kses_post(). Default is empty string.
         */
        public $message = '';

        /**
         * Holds configurable array of strings.
         *
         * Default values are added in the constructor.
         *
         * @since 2.0.0
         *
         * @var array
         */
        public $strings = array();

        /**
         * Holds the version of WordPress.
         *
         * @since 2.4.0
         *
         * @var int
         */
        public $wp_version;

        /**
         * Holds the hook name for the admin page.
         *
         * @since 2.5.0
         *
         * @var string
         */
        public $page_hook;

        /**
         * Adds a reference of this object to $instance, populates default strings,
         * does the tgmpa_init action hook, and hooks in the interactions to init.
         *
         * {@internal This method should be `protected`, but as too many TGMPA implementations
         * haven't upgraded beyond v2.3.6 yet, this gives backward compatibility issues.
         * Reverted back to public for the time being.}}
         *
         * @since 1.0.0
         *
         * @see TGM_Plugin_Activation::init()
         */
        public function __construct() {
            // Set the current WordPress version.
            $this->wp_version = $GLOBALS['wp_version'];

            // Announce that the class is ready, and pass the object (for advanced use).
            do_action_ref_array( 'tgmpa_init', array( $this ) );


            // When the rest of WP has loaded, kick-start the rest of the class.
            add_action( 'init', array( $this, 'init' ) );
        }

        /**
         * Magic method to (not) set protected properties from outside of this class.
         *
         * {@internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6  where the `menu` property
         * is being assigned rather than tested in a conditional, effectively rendering it useless.
         * This 'hack' prevents this from happening.}}
         *
         * @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593
         *
         * @since 2.5.2
         *
         * @param string $name Name of an inaccessible property.
         * @param mixed $value Value to assign to the property.
         *
         * @return void  Silently fail to set the property when this is tried from outside of this class context.
         *               (Inside this class context, the __set() method if not used as there is direct access.)
         */
        public function __set( $name, $value ) {
            return;
        }

        /**
         * Magic method to get the value of a protected property outside of this class context.
         *
         * @param string $name Name of an inaccessible property.
         *
         * @return mixed The property value.
         * @since 2.5.2
         *
         */
        public function __get( $name ) {
            return $this->{$name};
        }

        /**
         * Initialise the interactions between this class and WordPress.
         *
         * Hooks in three new methods for the class: admin_menu, notices and styles.
         *
         * @since 2.0.0
         *
         * @see TGM_Plugin_Activation::admin_menu()
         * @see TGM_Plugin_Activation::notices()
         * @see TGM_Plugin_Activation::styles()
         */
        public function init() {
            /**
             * By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter
             * you can overrule that behaviour.
             *
             * @param bool $load Whether or not TGMPA should load.
             *                   Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`.
             *
             * @since 2.5.0
             *
             */
            if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) {
                return;
            }

            // Load class strings.
            $this->strings = array(
                'page_title'                      => __( 'Install Required Plugins', 'colibri-wp' ),
                'menu_title'                      => __( 'Install Plugins', 'colibri-wp' ),
                /* translators: %s: plugin name. */
                'installing'                      => __( 'Installing Plugin: %s', 'colibri-wp' ),
                /* translators: %s: plugin name. */
                'updating'                        => __( 'Updating Plugin: %s', 'colibri-wp' ),
                'oops'                            => __( 'Something went wrong with the plugin API.', 'colibri-wp' ),
                'notice_can_install_required'     => _n_noop(
                /* translators: 1: plugin name(s). */
                    'This theme requires the following plugin: %1$s.',
                    'This theme requires the following plugins: %1$s.',
                    'colibri-wp'
                ),
                'notice_can_install_recommended'  => _n_noop(
                /* translators: 1: plugin name(s). */
                    'This theme recommends the following plugin: %1$s.',
                    'This theme recommends the following plugins: %1$s.',
                    'colibri-wp'
                ),
                'notice_ask_to_update'            => _n_noop(
                /* translators: 1: plugin name(s). */
                    'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
                    'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
                    'colibri-wp'
                ),
                'notice_ask_to_update_maybe'      => _n_noop(
                /* translators: 1: plugin name(s). */
                    'There is an update available for: %1$s.',
                    'There are updates available for the following plugins: %1$s.',
                    'colibri-wp'
                ),
                'notice_can_activate_required'    => _n_noop(
                /* translators: 1: plugin name(s). */
                    'The following required plugin is currently inactive: %1$s.',
                    'The following required plugins are currently inactive: %1$s.',
                    'colibri-wp'
                ),
                'notice_can_activate_recommended' => _n_noop(
                /* translators: 1: plugin name(s). */
                    'The following recommended plugin is currently inactive: %1$s.',
                    'The following recommended plugins are currently inactive: %1$s.',
                    'colibri-wp'
                ),
                'install_link'                    => _n_noop(
                    'Begin installing plugin',
                    'Begin installing plugins',
                    'colibri-wp'
                ),
                'update_link'                     => _n_noop(
                    'Begin updating plugin',
                    'Begin updating plugins',
                    'colibri-wp'
                ),
                'activate_link'                   => _n_noop(
                    'Begin activating plugin',
                    'Begin activating plugins',
                    'colibri-wp'
                ),
                'return'                          => __( 'Return to Required Plugins Installer', 'colibri-wp' ),
                'dashboard'                       => __( 'Return to the Dashboard', 'colibri-wp' ),
                'plugin_activated'                => __( 'Plugin activated successfully.', 'colibri-wp' ),
                'activated_successfully'          => __( 'The following plugin was activated successfully:',
                    'colibri-wp' ),
                /* translators: 1: plugin name. */
                'plugin_already_active'           => __( 'No action taken. Plugin %1$s was already active.',
                    'colibri-wp' ),
                /* translators: 1: plugin name. */
                'plugin_needs_higher_version'     => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.',
                    'colibri-wp' ),
                /* translators: 1: dashboard link. */
                'complete'                        => __( 'All plugins installed and activated successfully. %1$s',
                    'colibri-wp' ),
                'dismiss'                         => __( 'Dismiss this notice', 'colibri-wp' ),
                'notice_cannot_install_activate'  => __( 'There are one or more required or recommended plugins to install, update or activate.',
                    'colibri-wp' ),
                'contact_admin'                   => __( 'Please contact the administrator of this site for help.',
                    'colibri-wp' ),
            );

            do_action( 'tgmpa_register' );

            /* After this point, the plugins should be registered and the configuration set. */

            // Proceed only if we have plugins to handle.
            if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) {
                return;
            }

            // Set up the menu and notices if we still have outstanding actions.
            if ( true !== $this->is_tgmpa_complete() ) {
                // Sort the plugins.
                array_multisort( $this->sort_order, SORT_ASC, $this->plugins );

                add_action( 'admin_menu', array( $this, 'admin_menu' ) );
                add_action( 'admin_head', array( $this, 'dismiss' ) );

                // Prevent the normal links from showing underneath a single install/update page.
                add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) );
                add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) );

                if ( $this->has_notices ) {
                    add_action( 'admin_notices', array( $this, 'notices' ) );
                    add_action( 'admin_init', array( $this, 'admin_init' ), 1 );
                    add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) );
                }
            }

            // If needed, filter plugin action links.
            add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 );

            // Make sure things get reset on switch theme.
            add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) );

            if ( $this->has_notices ) {
                add_action( 'switch_theme', array( $this, 'update_dismiss' ) );
            }

            // Setup the force activation hook.
            if ( true === $this->has_forced_activation ) {
                add_action( 'admin_init', array( $this, 'force_activation' ) );
            }

            // Setup the force deactivation hook.
            if ( true === $this->has_forced_deactivation ) {
                add_action( 'switch_theme', array( $this, 'force_deactivation' ) );
            }
        }


        /**
         * Hook in plugin action link filters for the WP native plugins page.
         *
         * - Prevent activation of plugins which don't meet the minimum version requirements.
         * - Prevent deactivation of force-activated plugins.
         * - Add update notice if update available.
         *
         * @since 2.5.0
         */
        public function add_plugin_action_link_filters() {
            foreach ( $this->plugins as $slug => $plugin ) {
                if ( false === $this->can_plugin_activate( $slug ) ) {
                    add_filter( 'plugin_action_links_' . $plugin['file_path'],
                        array( $this, 'filter_plugin_action_links_activate' ), 20 );
                }

                if ( true === $plugin['force_activation'] ) {
                    add_filter( 'plugin_action_links_' . $plugin['file_path'],
                        array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
                }

                if ( false !== $this->does_plugin_require_update( $slug ) ) {
                    add_filter( 'plugin_action_links_' . $plugin['file_path'],
                        array( $this, 'filter_plugin_action_links_update' ), 20 );
                }
            }
        }

        /**
         * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the
         * minimum version requirements.
         *
         * @param array $actions Action links.
         *
         * @return array
         * @since 2.5.0
         *
         */
        public function filter_plugin_action_links_activate( $actions ) {
            unset( $actions['activate'] );

            return $actions;
        }

        /**
         * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate.
         *
         * @param array $actions Action links.
         *
         * @return array
         * @since 2.5.0
         *
         */
        public function filter_plugin_action_links_deactivate( $actions ) {
            unset( $actions['deactivate'] );

            return $actions;
        }

        /**
         * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the
         * minimum version requirements.
         *
         * @param array $actions Action links.
         *
         * @return array
         * @since 2.5.0
         *
         */
        public function filter_plugin_action_links_update( $actions ) {
            $actions['update'] = sprintf(
                '<a href="%1$s" title="%2$s" class="edit">%3$s</a>',
                esc_url( $this->get_tgmpa_status_url( 'update' ) ),
                esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'colibri-wp' ),
                esc_html__( 'Update Required', 'colibri-wp' )
            );

            return $actions;
        }

        /**
         * Handles calls to show plugin information via links in the notices.
         *
         * We get the links in the admin notices to point to the TGMPA page, rather
         * than the typical plugin-install.php file, so we can prepare everything
         * beforehand.
         *
         * WP does not make it easy to show the plugin information in the thickbox -
         * here we have to require a file that includes a function that does the
         * main work of displaying it, enqueue some styles, set up some globals and
         * finally call that function before exiting.
         *
         * Down right easy once you know how...
         *
         * Returns early if not the TGMPA page.
         *
         * @return null Returns early if not the TGMPA page.
         * @global string $tab Used as iframe div class names, helps with styling
         * @global string $body_id Used as the iframe body ID, helps with styling
         *
         * @since 2.1.0
         *
         */
        public function admin_init() {
            if ( ! $this->is_tgmpa_page() ) {
                return;
            }

            if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) {
                // Needed for install_plugin_information().
                require_once ABSPATH . 'wp-admin/includes/plugin-install.php';

                wp_enqueue_style( 'plugin-install' );

                global $tab, $body_id;
                $body_id = 'plugin-information';
                // @codingStandardsIgnoreStart
                $tab = 'plugin-information';
                // @codingStandardsIgnoreEnd

                install_plugin_information();

                exit;
            }
        }

        /**
         * Enqueue thickbox scripts/styles for plugin info.
         *
         * Thickbox is not automatically included on all admin pages, so we must
         * manually enqueue it for those pages.
         *
         * Thickbox is only loaded if the user has not dismissed the admin
         * notice or if there are any plugins left to install and activate.
         *
         * @since 2.1.0
         */
        public function thickbox() {
            if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {
                add_thickbox();
            }
        }

        /**
         * Adds submenu page if there are plugin actions to take.
         *
         * This method adds the submenu page letting users know that a required
         * plugin needs to be installed.
         *
         * This page disappears once the plugin has been installed and activated.
         *
         * @return null Return early if user lacks capability to install a plugin.
         * @see TGM_Plugin_Activation::init()
         * @see TGM_Plugin_Activation::install_plugins_page()
         *
         * @since 1.0.0
         *
         */
        public function admin_menu() {
            // Make sure privileges are correct to see the page.
            if ( ! current_user_can( 'install_plugins' ) ) {
                return;
            }

            $args = apply_filters(
                'tgmpa_admin_menu_args',
                array(
                    'parent_slug' => $this->parent_slug,                     // Parent Menu slug.
                    'page_title'  => $this->strings['page_title'],           // Page title.
                    'menu_title'  => $this->strings['menu_title'],           // Menu title.
                    'capability'  => $this->capability,                      // Capability.
                    'menu_slug'   => $this->menu,                            // Menu slug.
                    'function'    => array( $this, 'install_plugins_page' ), // Callback.
                )
            );

            $this->add_admin_menu( $args );
        }

        /**
         * Add the menu item.
         *
         * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
         * generator on the website.}}
         *
         * @param array $args Menu item configuration.
         *
         * @since 2.5.0
         *
         */
        protected function add_admin_menu( array $args ) {
            $this->page_hook = add_theme_page( $args['page_title'], $args['menu_title'], $args['capability'],
                $args['menu_slug'], $args['function'] );
        }

        /**
         * Echoes plugin installation form.
         *
         * This method is the callback for the admin_menu method function.
         * This displays the admin page and form area where the user can select to install and activate the plugin.
         * Aborts early if we're processing a plugin installation action.
         *
         * @return null Aborts early if we're processing a plugin installation action.
         * @since 1.0.0
         *
         */
        public function install_plugins_page() {
            // Store new instance of plugin table in object.
            $plugin_table = new TGMPA_List_Table;

            // Return early if processing a plugin installation action.
            if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) {
                return;
            }

            // Force refresh of available plugin information so we'll know about manual updates/deletes.
            wp_clean_plugins_cache( false );

            ?>
            <div class="tgmpa wrap">
                <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
                <?php $plugin_table->prepare_items(); ?>

                <?php
                if ( ! empty( $this->message ) && is_string( $this->message ) ) {
                    echo wp_kses_post( $this->message );
                }
                ?>
                <?php $plugin_table->views(); ?>

                <form id="tgmpa-plugins" action="" method="post">
                    <input type="hidden" name="tgmpa-page" value="<?php echo esc_attr( $this->menu ); ?>"/>
                    <input type="hidden" name="plugin_status"
                           value="<?php echo esc_attr( $plugin_table->view_context ); ?>"/>
                    <?php $plugin_table->display(); ?>
                </form>
            </div>
            <?php
        }

        /**
         * Installs, updates or activates a plugin depending on the action link clicked by the user.
         *
         * Checks the $_GET variable to see which actions have been
         * passed and responds with the appropriate method.
         *
         * Uses WP_Filesystem to process and handle the plugin installation
         * method.
         *
         * @return boolean True on success, false on failure.
         * @uses WP_Filesystem
         * @uses WP_Error
         * @uses WP_Upgrader
         * @uses Plugin_Upgrader
         * @uses Plugin_Installer_Skin
         * @uses Plugin_Upgrader_Skin
         *
         * @since 1.0.0
         *
         */
        protected function do_plugin_install() {
            if ( empty( $_GET['plugin'] ) ) {
                return false;
            }

            // All plugin information will be stored in an array for processing.
            $slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) );

            if ( ! isset( $this->plugins[ $slug ] ) ) {
                return false;
            }

            // Was an install or upgrade action link clicked?
            if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) {

                $install_type = 'install';
                if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) {
                    $install_type = 'update';
                }

                check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' );

                // Pass necessary information via URL if WP_Filesystem is needed.
                $url = wp_nonce_url(
                    add_query_arg(
                        array(
                            'plugin'                 => urlencode( $slug ),
                            'tgmpa-' . $install_type => $install_type . '-plugin',
                        ),
                        $this->get_tgmpa_url()
                    ),
                    'tgmpa-' . $install_type,
                    'tgmpa-nonce'
                );

                $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.

                if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false,
                        array() ) ) ) {
                    return true;
                }

                if ( ! WP_Filesystem( $creds ) ) {
                    request_filesystem_credentials( esc_url_raw( $url ), $method, true, false,
                        array() ); // Setup WP_Filesystem.

                    return true;
                }

                /* If we arrive here, we have the filesystem. */

                // Prep variables for Plugin_Installer_Skin class.
                $extra         = array();
                $extra['slug'] = $slug; // Needed for potentially renaming of directory name.
                $source        = $this->get_download_url( $slug );
                $api           = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null;
                $api           = ( false !== $api ) ? $api : null;

                $url = add_query_arg(
                    array(
                        'action' => $install_type . '-plugin',
                        'plugin' => urlencode( $slug ),
                    ),
                    'update.php'
                );

                if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
                    require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
                }

                $title     = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing'];
                $skin_args = array(
                    'type'   => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',
                    'title'  => sprintf( $title, $this->plugins[ $slug ]['name'] ),
                    'url'    => esc_url_raw( $url ),
                    'nonce'  => $install_type . '-plugin_' . $slug,
                    'plugin' => '',
                    'api'    => $api,
                    'extra'  => $extra,
                );
                unset( $title );

                if ( 'update' === $install_type ) {
                    $skin_args['plugin'] = $this->plugins[ $slug ]['file_path'];
                    $skin                = new Plugin_Upgrader_Skin( $skin_args );
                } else {
                    $skin = new Plugin_Installer_Skin( $skin_args );
                }

                // Create a new instance of Plugin_Upgrader.
                $upgrader = new Plugin_Upgrader( $skin );

                // Perform the action and install the plugin from the $source urldecode().
                add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );

                if ( 'update' === $install_type ) {
                    // Inject our info into the update transient.
                    $to_inject                    = array( $slug => $this->plugins[ $slug ] );
                    $to_inject[ $slug ]['source'] = $source;
                    $this->inject_update_info( $to_inject );

                    $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] );
                } else {
                    $upgrader->install( $source );
                }

                remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1 );

                // Make sure we have the correct file path now the plugin is installed/updated.
                $this->populate_file_path( $slug );

                // Only activate plugins if the config option is set to true and the plugin isn't
                // already active (upgrade).
                if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) {
                    $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method.
                    if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) {
                        return true; // Finish execution of the function early as we encountered an error.
                    }
                }

                $this->show_tgmpa_version();

                // Display message based on if all plugins are now active or not.
                if ( $this->is_tgmpa_complete() ) {
                    echo '<p>', sprintf( esc_html( $this->strings['complete'] ),
                        '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard',
                            'colibri-wp' ) . '</a>' ), '</p>';
                    echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
                } else {
                    echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
                }

                return true;
            } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) {
                // Activate action link was clicked.
                check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' );

                if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) {
                    return true; // Finish execution of the function early as we encountered an error.
                }
            }

            return false;
        }

        /**
         * Inject information into the 'update_plugins' site transient as WP checks that before running an update.
         *
         * @param array $plugins The plugin information for the plugins which are to be updated.
         *
         * @since 2.5.0
         *
         */
        public function inject_update_info( $plugins ) {
            $repo_updates = get_site_transient( 'update_plugins' );

            if ( ! is_object( $repo_updates ) ) {
                $repo_updates = new stdClass;
            }

            foreach ( $plugins as $slug => $plugin ) {
                $file_path = $plugin['file_path'];

                if ( empty( $repo_updates->response[ $file_path ] ) ) {
                    $repo_updates->response[ $file_path ] = new stdClass;
                }

                // We only really need to set package, but let's do all we can in case WP changes something.
                $repo_updates->response[ $file_path ]->slug        = $slug;
                $repo_updates->response[ $file_path ]->plugin      = $file_path;
                $repo_updates->response[ $file_path ]->new_version = $plugin['version'];
                $repo_updates->response[ $file_path ]->package     = $plugin['source'];
                if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) {
                    $repo_updates->response[ $file_path ]->url = $plugin['external_url'];
                }
            }

            set_site_transient( 'update_plugins', $repo_updates );
        }

        /**
         * Adjust the plugin directory name if necessary.
         *
         * The final destination directory of a plugin is based on the subdirectory name found in the
         * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this
         * subdirectory name is not the same as the expected slug and the plugin will not be recognized
         * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to
         * the expected plugin slug.
         *
         * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
         * @param string $remote_source Path to upgrade/zip-file-name.tmp.
         * @param WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
         *
         * @return string $source
         * @since 2.5.0
         *
         */
        public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
            if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) {
                return $source;
            }

            // Check for single file plugins.
            $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );
            if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) {
                return $source;
            }

            // Multi-file plugin, let's see if the directory is correctly named.
            $desired_slug = '';

            // Figure out what the slug is supposed to be.
            if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) {
                $desired_slug = $upgrader->skin->options['extra']['slug'];
            } else {
                // Bulk installer contains less info, so fall back on the info registered here.
                foreach ( $this->plugins as $slug => $plugin ) {
                    if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
                        $desired_slug = $slug;
                        break;
                    }
                }
                unset( $slug, $plugin );
            }

            if ( ! empty( $desired_slug ) ) {
                $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );

                if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
                    $from_path = untrailingslashit( $source );
                    $to_path   = trailingslashit( $remote_source ) . $desired_slug;

                    if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
                        return trailingslashit( $to_path );
                    } else {
                        return new WP_Error( 'rename_failed',
                            esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.',
                                'colibri-wp' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.',
                                'colibri-wp' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
                    }
                } elseif ( empty( $subdir_name ) ) {
                    return new WP_Error( 'packaged_wrong',
                        esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.',
                            'colibri-wp' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.',
                            'colibri-wp' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
                }
            }

            return $source;
        }

        /**
         * Activate a single plugin and send feedback about the result to the screen.
         *
         * @param string $file_path Path within wp-plugins/ to main plugin file.
         * @param string $slug Plugin slug.
         * @param bool $automatic Whether this is an automatic activation after an install. Defaults to false.
         *                          This determines the styling of the output messages.
         *
         * @return bool False if an error was encountered, true otherwise.
         * @since 2.5.0
         *
         */
        protected function activate_single_plugin( $file_path, $slug, $automatic = false ) {
            if ( $this->can_plugin_activate( $slug ) ) {
                $activate = activate_plugin( $file_path );

                if ( is_wp_error( $activate ) ) {
                    echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>',
                    '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';

                    return false; // End it here if there is an error with activation.
                } else {
                    if ( ! $automatic ) {
                        // Make sure message doesn't display again if bulk activation is performed
                        // immediately after a single activation.
                        if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
                            echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';
                        }
                    } else {
                        // Simpler message layout for use on the plugin install page.
                        echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>';
                    }
                }
            } elseif ( $this->is_plugin_active( $slug ) ) {
                // No simpler message format provided as this message should never be encountered
                // on the plugin install page.
                echo '<div id="message" class="error"><p>',
                sprintf(
                    esc_html( $this->strings['plugin_already_active'] ),
                    '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
                ),
                '</p></div>';
            } elseif ( $this->does_plugin_require_update( $slug ) ) {
                if ( ! $automatic ) {
                    // Make sure message doesn't display again if bulk activation is performed
                    // immediately after a single activation.
                    if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
                        echo '<div id="message" class="error"><p>',
                        sprintf(
                            esc_html( $this->strings['plugin_needs_higher_version'] ),
                            '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
                        ),
                        '</p></div>';
                    }
                } else {
                    // Simpler message layout for use on the plugin install page.
                    echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ),
                        esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>';
                }
            }

            return true;
        }

        /**
         * Echoes required plugin notice.
         *
         * Outputs a message telling users that a specific plugin is required for
         * their theme. If appropriate, it includes a link to the form page where
         * users can install and activate the plugin.
         *
         * Returns early if we're on the Install page.
         *
         * @return null Returns early if we're on the Install page.
         * @global object $current_screen
         *
         * @since 1.0.0
         *
         */
        public function notices() {
            // Remove nag on the install page / Return early if the nag message has been dismissed or user < author.
            if ( ( $this->is_tgmpa_page() || $this->is_core_update_page() ) || get_user_meta( get_current_user_id(),
                    'tgmpa_dismissed_notice_' . $this->id,
                    true ) || ! current_user_can( apply_filters( 'tgmpa_show_admin_notice_capability',
                    'publish_posts' ) ) ) {
                return;
            }

            // Store for the plugin slugs by message type.
            $message = array();

            // Initialize counters used to determine plurality of action link texts.
            $install_link_count          = 0;
            $update_link_count           = 0;
            $activate_link_count         = 0;
            $total_required_action_count = 0;

            foreach ( $this->plugins as $slug => $plugin ) {
                if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) {
                    continue;
                }

                if ( ! $this->is_plugin_installed( $slug ) ) {
                    if ( current_user_can( 'install_plugins' ) ) {
                        $install_link_count ++;

                        if ( true === $plugin['required'] ) {
                            $message['notice_can_install_required'][] = $slug;
                        } else {
                            $message['notice_can_install_recommended'][] = $slug;
                        }
                    }
                    if ( true === $plugin['required'] ) {
                        $total_required_action_count ++;
                    }
                } else {
                    if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) {
                        if ( current_user_can( 'activate_plugins' ) ) {
                            $activate_link_count ++;

                            if ( true === $plugin['required'] ) {
                                $message['notice_can_activate_required'][] = $slug;
                            } else {
                                $message['notice_can_activate_recommended'][] = $slug;
                            }
                        }
                        if ( true === $plugin['required'] ) {
                            $total_required_action_count ++;
                        }
                    }

                    if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {

                        if ( current_user_can( 'update_plugins' ) ) {
                            $update_link_count ++;

                            if ( $this->does_plugin_require_update( $slug ) ) {
                                $message['notice_ask_to_update'][] = $slug;
                            } elseif ( false !== $this->does_plugin_have_update( $slug ) ) {
                                $message['notice_ask_to_update_maybe'][] = $slug;
                            }
                        }
                        if ( true === $plugin['required'] ) {
                            $total_required_action_count ++;
                        }
                    }
                }
            }
            unset( $slug, $plugin );

            // If we have notices to display, we move forward.
            if ( ! empty( $message ) || $total_required_action_count > 0 ) {
                krsort( $message ); // Sort messages.
                $rendered = '';

                // As add_settings_error() wraps the final message in a <p> and as the final message can't be
                // filtered, using <p>'s in our html would render invalid html output.
                $line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>' . "\n";

                if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) {
                    $rendered = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] );
                    $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template );
                } else {

                    // If dismissable is false and a message is set, output it now.
                    if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) {
                        $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) );
                    }

                    // Render the individual message lines for the notice.
                    foreach ( $message as $type => $plugin_group ) {
                        $linked_plugins = array();

                        // Get the external info link for a plugin if one is available.
                        foreach ( $plugin_group as $plugin_slug ) {
                            $linked_plugins[] = $this->get_info_link( $plugin_slug );
                        }
                        unset( $plugin_slug );

                        $count          = count( $plugin_group );
                        $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
                        $last_plugin    = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
                        $imploded       = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ',
                                $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B',
                                'colibri-wp' ) . ' ' . $last_plugin );

                        $rendered .= sprintf(
                            $line_template,
                            sprintf(
                                translate_nooped_plural( $this->strings[ $type ], $count, 'colibri-wp' ),
                                $imploded,
                                $count
                            )
                        );

                    }
                    unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded );

                    $rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count,
                        $activate_link_count, $line_template );
                }

                // Register the nag messages and prepare them to be processed.
                add_settings_error( 'tgmpa', 'tgmpa', $rendered, $this->get_admin_notice_class() );
            }

            // Admin options pages already output settings_errors, so this is to avoid duplication.
            if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) {
                $this->display_settings_errors();
            }
        }

        /**
         * Generate the user action links for the admin notice.
         *
         * @param int $install_count Number of plugins to install.
         * @param int $update_count Number of plugins to update.
         * @param int $activate_count Number of plugins to activate.
         * @param int $line_template Template for the HTML tag to output a line.
         *
         * @return string Action links.
         * @since 2.6.0
         *
         */
        protected function create_user_action_links_for_notice(
            $install_count,
            $update_count,
            $activate_count,
            $line_template
        ) {
            // Setup action links.
            $action_links = array(
                'install'  => '',
                'update'   => '',
                'activate' => '',
                'dismiss'  => $this->dismissable ? '<a href="' . esc_url( wp_nonce_url( add_query_arg( 'tgmpa-dismiss',
                        'dismiss_admin_notices' ),
                        'tgmpa-dismiss-' . get_current_user_id() ) ) . '" class="dismiss-notice" target="_parent">' . esc_html( $this->strings['dismiss'] ) . '</a>' : '',
            );

            $link_template = '<a href="%2$s">%1$s</a>';

            if ( current_user_can( 'install_plugins' ) ) {
                if ( $install_count > 0 ) {
                    $action_links['install'] = sprintf(
                        $link_template,
                        translate_nooped_plural( $this->strings['install_link'], $install_count, 'colibri-wp' ),
                        esc_url( $this->get_tgmpa_status_url( 'install' ) )
                    );
                }
                if ( $update_count > 0 ) {
                    $action_links['update'] = sprintf(
                        $link_template,
                        translate_nooped_plural( $this->strings['update_link'], $update_count, 'colibri-wp' ),
                        esc_url( $this->get_tgmpa_status_url( 'update' ) )
                    );
                }
            }

            if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) {
                $action_links['activate'] = sprintf(
                    $link_template,
                    translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'colibri-wp' ),
                    esc_url( $this->get_tgmpa_status_url( 'activate' ) )
                );
            }

            $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links );

            $action_links = array_filter( (array) $action_links ); // Remove any empty array items.

            if ( ! empty( $action_links ) ) {
                $action_links = sprintf( $line_template, implode( ' | ', $action_links ) );

                return apply_filters( 'tgmpa_notice_rendered_action_links', $action_links );
            } else {
                return '';
            }
        }

        /**
         * Get admin notice class.
         *
         * Work around all the changes to the various admin notice classes between WP 4.4 and 3.7
         * (lowest supported version by TGMPA).
         *
         * @return string
         * @since 2.6.0
         *
         */
        protected function get_admin_notice_class() {
            if ( ! empty( $this->strings['nag_type'] ) ) {
                return sanitize_html_class( strtolower( $this->strings['nag_type'] ) );
            } else {
                if ( version_compare( $this->wp_version, '4.2', '>=' ) ) {
                    return 'notice-warning';
                } elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) {
                    return 'notice';
                } else {
                    return 'updated';
                }
            }
        }

        /**
         * Display settings errors and remove those which have been displayed to avoid duplicate messages showing
         *
         * @since 2.5.0
         */
        protected function display_settings_errors() {
            global $wp_settings_errors;

            settings_errors( 'tgmpa' );

            foreach ( (array) $wp_settings_errors as $key => $details ) {
                if ( 'tgmpa' === $details['setting'] ) {
                    unset( $wp_settings_errors[ $key ] );
                    break;
                }
            }
        }

        /**
         * Register dismissal of admin notices.
         *
         * Acts on the dismiss link in the admin nag messages.
         * If clicked, the admin notice disappears and will no longer be visible to this user.
         *
         * @since 2.1.0
         */
        public function dismiss() {
            if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) {
                update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 );
            }
        }

        /**
         * Add individual plugin to our collection of plugins.
         *
         * If the required keys are not set or the plugin has already
         * been registered, the plugin is not added.
         *
         * @param array|null $plugin Array of plugin arguments or null if invalid argument.
         *
         * @return null Return early if incorrect argument.
         * @since 2.0.0
         *
         */
        public function register( $plugin ) {
            if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) {
                return;
            }

            if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) {
                return;
            }

            $defaults = array(
                'name'               => '',      // String
                'slug'               => '',      // String
                'source'             => 'repo',  // String
                'required'           => false,   // Boolean
                'version'            => '',      // String
                'force_activation'   => false,   // Boolean
                'force_deactivation' => false,   // Boolean
                'external_url'       => '',      // String
                'is_callable'        => '',      // String|Array.
            );

            // Prepare the received data.
            $plugin = wp_parse_args( $plugin, $defaults );

            // Standardize the received slug.
            $plugin['slug'] = $this->sanitize_key( $plugin['slug'] );

            // Forgive users for using string versions of booleans or floats for version number.
            $plugin['version']            = (string) $plugin['version'];
            $plugin['source']             = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];
            $plugin['required']           = TGMPA_Utils::validate_bool( $plugin['required'] );
            $plugin['force_activation']   = TGMPA_Utils::validate_bool( $plugin['force_activation'] );
            $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );

            // Enrich the received data.
            $plugin['file_path']   = $this->_get_plugin_basename_from_slug( $plugin['slug'] );
            $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] );

            // Set the class properties.
            $this->plugins[ $plugin['slug'] ]    = $plugin;
            $this->sort_order[ $plugin['slug'] ] = $plugin['name'];

            // Should we add the force activation hook ?
            if ( true === $plugin['force_activation'] ) {
                $this->has_forced_activation = true;
            }

            // Should we add the force deactivation hook ?
            if ( true === $plugin['force_deactivation'] ) {
                $this->has_forced_deactivation = true;
            }
        }

        /**
         * Determine what type of source the plugin comes from.
         *
         * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path
         *                       (= bundled) or an external URL.
         *
         * @return string 'repo', 'external', or 'bundled'
         * @since 2.5.0
         *
         */
        protected function get_plugin_source_type( $source ) {
            if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) {
                return 'repo';
            } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) {
                return 'external';
            } else {
                return 'bundled';
            }
        }

        /**
         * Sanitizes a string key.
         *
         * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are*
         * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase
         * characters in the plugin directory path/slug. Silly them.
         *
         * @see https://developer.wordpress.org/reference/hooks/sanitize_key/
         *
         * @since 2.5.0
         *
         * @param string $key String key.
         *
         * @return string Sanitized key
         */
        public function sanitize_key( $key ) {
            $raw_key = $key;
            $key     = preg_replace( '`[^A-Za-z0-9_-]`', '', $key );

            /**
             * Filter a sanitized key string.
             *
             * @param string $key Sanitized key.
             * @param string $raw_key The key prior to sanitization.
             *
             * @since 2.5.0
             *
             */
            return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key );
        }

        /**
         * Amend default configuration settings.
         *
         * @param array $config Array of config options to pass as class properties.
         *
         * @since 2.0.0
         *
         */
        public function config( $config ) {
            $keys = array(
                'id',
                'default_path',
                'has_notices',
                'dismissable',
                'dismiss_msg',
                'menu',
                'parent_slug',
                'capability',
                'is_automatic',
                'message',
                'strings',
            );

            foreach ( $keys as $key ) {
                if ( isset( $config[ $key ] ) ) {
                    if ( is_array( $config[ $key ] ) ) {
                        $this->$key = array_merge( $this->$key, $config[ $key ] );
                    } else {
                        $this->$key = $config[ $key ];
                    }
                }
            }
        }

        /**
         * Amend action link after plugin installation.
         *
         * @param array $install_actions Existing array of actions.
         *
         * @return false|array Amended array of actions.
         * @since 2.0.0
         *
         */
        public function actions( $install_actions ) {
            // Remove action links on the TGMPA install page.
            if ( $this->is_tgmpa_page() ) {
                return false;
            }

            return $install_actions;
        }

        /**
         * Flushes the plugins cache on theme switch to prevent stale entries
         * from remaining in the plugin table.
         *
         * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache.
         *                                 Parameter added in v2.5.0.
         *
         * @since 2.4.0
         *
         */
        public function flush_plugins_cache( $clear_update_cache = true ) {
            wp_clean_plugins_cache( $clear_update_cache );
        }

        /**
         * Set file_path key for each installed plugin.
         *
         * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin.
         *                            Parameter added in v2.5.0.
         *
         * @since 2.1.0
         *
         */
        public function populate_file_path( $plugin_slug = '' ) {
            if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) {
                $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug );
            } else {
                // Add file_path key for all plugins.
                foreach ( $this->plugins as $slug => $values ) {
                    $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug );
                }
            }
        }

        /**
         * Helper function to extract the file path of the plugin file from the
         * plugin slug, if the plugin is installed.
         *
         * @param string $slug Plugin slug (typically folder name) as provided by the developer.
         *
         * @return string Either file path for plugin if installed, or just the plugin slug.
         * @since 2.0.0
         *
         */
        protected function _get_plugin_basename_from_slug( $slug ) {
            $keys = array_keys( $this->get_plugins() );

            foreach ( $keys as $key ) {
                if ( preg_match( '|^' . $slug . '/|', $key ) ) {
                    return $key;
                }
            }

            return $slug;
        }

        /**
         * Retrieve plugin data, given the plugin name.
         *
         * Loops through the registered plugins looking for $name. If it finds it,
         * it returns the $data from that plugin. Otherwise, returns false.
         *
         * @param string $name Name of the plugin, as it was registered.
         * @param string $data Optional. Array key of plugin data to return. Default is slug.
         *
         * @return string|boolean Plugin slug if found, false otherwise.
         * @since 2.1.0
         *
         */
        public function _get_plugin_data_from_name( $name, $data = 'slug' ) {
            foreach ( $this->plugins as $values ) {
                if ( $name === $values['name'] && isset( $values[ $data ] ) ) {
                    return $values[ $data ];
                }
            }

            return false;
        }

        /**
         * Retrieve the download URL for a package.
         *
         * @param string $slug Plugin slug.
         *
         * @return string Plugin download URL or path to local file or empty string if undetermined.
         * @since 2.5.0
         *
         */
        public function get_download_url( $slug ) {
            $dl_source = '';

            switch ( $this->plugins[ $slug ]['source_type'] ) {
                case 'repo':
                    return $this->get_wp_repo_download_url( $slug );
                case 'external':
                    return $this->plugins[ $slug ]['source'];
                case 'bundled':
                    return $this->default_path . $this->plugins[ $slug ]['source'];
            }

            return $dl_source; // Should never happen.
        }

        /**
         * Retrieve the download URL for a WP repo package.
         *
         * @param string $slug Plugin slug.
         *
         * @return string Plugin download URL.
         * @since 2.5.0
         *
         */
        protected function get_wp_repo_download_url( $slug ) {
            $source = '';
            $api    = $this->get_plugins_api( $slug );

            if ( false !== $api && isset( $api->download_link ) ) {
                $source = $api->download_link;
            }

            return $source;
        }

        /**
         * Try to grab information from WordPress API.
         *
         * @param string $slug Plugin slug.
         *
         * @return object Plugins_api response object on success, WP_Error on failure.
         * @since 2.5.0
         *
         */
        protected function get_plugins_api( $slug ) {
            static $api = array(); // Cache received responses.

            if ( ! isset( $api[ $slug ] ) ) {
                if ( ! function_exists( 'plugins_api' ) ) {
                    require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
                }

                $response = plugins_api( 'plugin_information',
                    array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );

                $api[ $slug ] = false;

                if ( is_wp_error( $response ) ) {
                    wp_die( esc_html( $this->strings['oops'] ) );
                } else {
                    $api[ $slug ] = $response;
                }
            }

            return $api[ $slug ];
        }

        /**
         * Retrieve a link to a plugin information page.
         *
         * @param string $slug Plugin slug.
         *
         * @return string Fully formed html link to a plugin information page if available
         *                or the plugin name if not.
         * @since 2.5.0
         *
         */
        public function get_info_link( $slug ) {
            if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX,
                    $this->plugins[ $slug ]['external_url'] ) ) {
                $link = sprintf(
                    '<a href="%1$s" target="_blank">%2$s</a>',
                    esc_url( $this->plugins[ $slug ]['external_url'] ),
                    esc_html( $this->plugins[ $slug ]['name'] )
                );
            } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) {
                $url = add_query_arg(
                    array(
                        'tab'       => 'plugin-information',
                        'plugin'    => urlencode( $slug ),
                        'TB_iframe' => 'true',
                        'width'     => '640',
                        'height'    => '500',
                    ),
                    self_admin_url( 'plugin-install.php' )
                );

                $link = sprintf(
                    '<a href="%1$s" class="thickbox">%2$s</a>',
                    esc_url( $url ),
                    esc_html( $this->plugins[ $slug ]['name'] )
                );
            } else {
                $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink.
            }

            return $link;
        }

        /**
         * Determine if we're on the TGMPA Install page.
         *
         * @return boolean True when on the TGMPA page, false otherwise.
         * @since 2.1.0
         *
         */
        protected function is_tgmpa_page() {
            return isset( $_GET['page'] ) && $this->menu === $_GET['page'];
        }

        /**
         * Determine if we're on a WP Core installation/upgrade page.
         *
         * @return boolean True when on a WP Core installation/upgrade page, false otherwise.
         * @since 2.6.0
         *
         */
        protected function is_core_update_page() {
            // Current screen is not always available, most notably on the customizer screen.
            if ( ! function_exists( 'get_current_screen' ) ) {
                return false;
            }

            $screen = get_current_screen();

            if ( 'update-core' === $screen->base ) {
                // Core update screen.
                return true;
            } elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
                // Plugins bulk update screen.
                return true;
            } elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
                // Individual updates (ajax call).
                return true;
            }

            return false;
        }

        /**
         * Retrieve the URL to the TGMPA Install page.
         *
         * I.e. depending on the config settings passed something along the lines of:
         * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins
         *
         * @return string Properly encoded URL (not escaped).
         * @since 2.5.0
         *
         */
        public function get_tgmpa_url() {
            static $url;

            if ( ! isset( $url ) ) {
                $parent = $this->parent_slug;
                if ( false === strpos( $parent, '.php' ) ) {
                    $parent = 'admin.php';
                }
                $url = add_query_arg(
                    array(
                        'page' => urlencode( $this->menu ),
                    ),
                    self_admin_url( $parent )
                );
            }

            return $url;
        }

        /**
         * Retrieve the URL to the TGMPA Install page for a specific plugin status (view).
         *
         * I.e. depending on the config settings passed something along the lines of:
         * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install
         *
         * @param string $status Plugin status - either 'install', 'update' or 'activate'.
         *
         * @return string Properly encoded URL (not escaped).
         * @since 2.5.0
         *
         */
        public function get_tgmpa_status_url( $status ) {
            return add_query_arg(
                array(
                    'plugin_status' => urlencode( $status ),
                ),
                $this->get_tgmpa_url()
            );
        }

        /**
         * Determine whether there are open actions for plugins registered with TGMPA.
         *
         * @return bool True if complete, i.e. no outstanding actions. False otherwise.
         * @since 2.5.0
         *
         */
        public function is_tgmpa_complete() {
            $complete = true;
            foreach ( $this->plugins as $slug => $plugin ) {
                if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
                    $complete = false;
                    break;
                }
            }

            return $complete;
        }

        /**
         * Check if a plugin is installed. Does not take must-use plugins into account.
         *
         * @param string $slug Plugin slug.
         *
         * @return bool True if installed, false otherwise.
         * @since 2.5.0
         *
         */
        public function is_plugin_installed( $slug ) {
            $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).

            if(!isset($this->plugins[ $slug ])) {
                return false;
            }
            return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) );
        }

        /**
         * Check if a plugin is active.
         *
         * @param string $slug Plugin slug.
         *
         * @return bool True if active, false otherwise.
         * @since 2.5.0
         *
         */
        public function is_plugin_active( $slug ) {
            return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) );
        }

        /**
         * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required
         * available, check whether the current install meets them.
         *
         * @param string $slug Plugin slug.
         *
         * @return bool True if OK to update, false otherwise.
         * @since 2.5.0
         *
         */
        public function can_plugin_update( $slug ) {
            // We currently can't get reliable info on non-WP-repo plugins - issue #380.
            if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
                return true;
            }

            $api = $this->get_plugins_api( $slug );

            if ( false !== $api && isset( $api->requires ) ) {
                return version_compare( $this->wp_version, $api->requires, '>=' );
            }

            // No usable info received from the plugins API, presume we can update.
            return true;
        }

        /**
         * Check to see if the plugin is 'updatetable', i.e. installed, with an update available
         * and no WP version requirements blocking it.
         *
         * @param string $slug Plugin slug.
         *
         * @return bool True if OK to proceed with update, false otherwise.
         * @since 2.6.0
         *
         */
        public function is_plugin_updatetable( $slug ) {
            if ( ! $this->is_plugin_installed( $slug ) ) {
                return false;
            } else {
                return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) );
            }
        }

        /**
         * Check if a plugin can be activated, i.e. is not currently active and meets the minimum
         * plugin version requirements set in TGMPA (if any).
         *
         * @param string $slug Plugin slug.
         *
         * @return bool True if OK to activate, false otherwise.
         * @since 2.5.0
         *
         */
        public function can_plugin_activate( $slug ) {
            return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) );
        }

        /**
         * Retrieve the version number of an installed plugin.
         *
         * @param string $slug Plugin slug.
         *
         * @return string Version number as string or an empty string if the plugin is not installed
         *                or version unknown (plugins which don't comply with the plugin header standard).
         * @since 2.5.0
         *
         */
        public function get_installed_version( $slug ) {
            $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).

            if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) {
                return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'];
            }

            return '';
        }

        /**
         * Check whether a plugin complies with the minimum version requirements.
         *
         * @param string $slug Plugin slug.
         *
         * @return bool True when a plugin needs to be updated, otherwise false.
         * @since 2.5.0
         *
         */
        public function does_plugin_require_update( $slug ) {
            $installed_version = $this->get_installed_version( $slug );
            $minimum_version   = $this->plugins[ $slug ]['version'];

            return version_compare( $minimum_version, $installed_version, '>' );
        }

        /**
         * Check whether there is an update available for a plugin.
         *
         * @param string $slug Plugin slug.
         *
         * @return false|string Version number string of the available update or false if no update available.
         * @since 2.5.0
         *
         */
        public function does_plugin_have_update( $slug ) {
            // Presume bundled and external plugins will point to a package which meets the minimum required version.
            if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
                if ( $this->does_plugin_require_update( $slug ) ) {
                    return $this->plugins[ $slug ]['version'];
                }

                return false;
            }

            $repo_updates = get_site_transient( 'update_plugins' );

            if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) {
                return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version;
            }

            return false;
        }

        /**
         * Retrieve potential upgrade notice for a plugin.
         *
         * @param string $slug Plugin slug.
         *
         * @return string The upgrade notice or an empty string if no message was available or provided.
         * @since 2.5.0
         *
         */
        public function get_upgrade_notice( $slug ) {
            // We currently can't get reliable info on non-WP-repo plugins - issue #380.
            if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
                return '';
            }

            $repo_updates = get_site_transient( 'update_plugins' );

            if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) {
                return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice;
            }

            return '';
        }

        /**
         * Wrapper around the core WP get_plugins function, making sure it's actually available.
         *
         * @param string $plugin_folder Optional. Relative path to single plugin folder.
         *
         * @return array Array of installed plugins with plugin information.
         * @since 2.5.0
         *
         */
        public function get_plugins( $plugin_folder = '' ) {
            if ( ! function_exists( 'get_plugins' ) ) {
                require_once ABSPATH . 'wp-admin/includes/plugin.php';
            }

            return get_plugins( $plugin_folder );
        }

        /**
         * Delete dismissable nag option when theme is switched.
         *
         * This ensures that the user(s) is/are again reminded via nag of required
         * and/or recommended plugins if they re-activate the theme.
         *
         * @since 2.1.1
         */
        public function update_dismiss() {
            delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true );
        }

        /**
         * Forces plugin activation if the parameter 'force_activation' is
         * set to true.
         *
         * This allows theme authors to specify certain plugins that must be
         * active at all times while using the current theme.
         *
         * Please take special care when using this parameter as it has the
         * potential to be harmful if not used correctly. Setting this parameter
         * to true will not allow the specified plugin to be deactivated unless
         * the user switches themes.
         *
         * @since 2.2.0
         */
        public function force_activation() {
            foreach ( $this->plugins as $slug => $plugin ) {
                if ( true === $plugin['force_activation'] ) {
                    if ( ! $this->is_plugin_installed( $slug ) ) {
                        // Oops, plugin isn't there so iterate to next condition.
                        continue;
                    } elseif ( $this->can_plugin_activate( $slug ) ) {
                        // There we go, activate the plugin.
                        activate_plugin( $plugin['file_path'] );
                    }
                }
            }
        }

        /**
         * Forces plugin deactivation if the parameter 'force_deactivation'
         * is set to true and adds the plugin to the 'recently active' plugins list.
         *
         * This allows theme authors to specify certain plugins that must be
         * deactivated upon switching from the current theme to another.
         *
         * Please take special care when using this parameter as it has the
         * potential to be harmful if not used correctly.
         *
         * @since 2.2.0
         */
        public function force_deactivation() {
            $deactivated = array();

            foreach ( $this->plugins as $slug => $plugin ) {
                /*
				 * Only proceed forward if the parameter is set to true and plugin is active
				 * as a 'normal' (not must-use) plugin.
				 */
                if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) {
                    deactivate_plugins( $plugin['file_path'] );
                    $deactivated[ $plugin['file_path'] ] = time();
                }
            }

            if ( ! empty( $deactivated ) ) {
                update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) );
            }
        }

        /**
         * Echo the current TGMPA version number to the page.
         *
         * @since 2.5.0
         */
        public function show_tgmpa_version() {
            echo '<p style="float: right; padding: 0em 1.5em 0.5em 0;"><strong><small>',
            esc_html(
                sprintf(
                /* translators: %s: version number */
                    __( 'TGMPA v%s', 'colibri-wp' ),
                    self::TGMPA_VERSION
                )
            ),
            '</small></strong></p>';
        }

        /**
         * Returns the singleton instance of the class.
         *
         * @return TGM_Plugin_Activation The TGM_Plugin_Activation object.
         * @since 2.4.0
         *
         */
        public static function get_instance() {
            if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
                self::$instance = new self();
            }

            return self::$instance;
        }
    }

    if ( ! function_exists( 'load_tgm_plugin_activation' ) ) {
        /**
         * Ensure only one instance of the class is ever invoked.
         *
         * @since 2.5.0
         */
        function load_tgm_plugin_activation() {
            $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance();
        }
    }

    if ( did_action( 'plugins_loaded' ) ) {
        load_tgm_plugin_activation();
    } else {
        add_action( 'plugins_loaded', 'load_tgm_plugin_activation' );
    }
}

if ( ! function_exists( 'tgmpa' ) ) {
    /**
     * Helper function to register a collection of required plugins.
     *
     * @param array $plugins An array of plugin arrays.
     * @param array $config Optional. An array of configuration values.
     *
     * @since 2.0.0
     * @api
     *
     */
    function tgmpa( $plugins, $config = array() ) {
        $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );

        foreach ( $plugins as $plugin ) {
            call_user_func( array( $instance, 'register' ), $plugin );
        }

        if ( ! empty( $config ) && is_array( $config ) ) {
            // Send out notices for deprecated arguments passed.
            if ( isset( $config['notices'] ) ) {
                _deprecated_argument( __FUNCTION__, '2.2.0',
                    'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' );
                if ( ! isset( $config['has_notices'] ) ) {
                    $config['has_notices'] = $config['notices'];
                }
            }

            if ( isset( $config['parent_menu_slug'] ) ) {
                _deprecated_argument( __FUNCTION__, '2.4.0',
                    'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
            }
            if ( isset( $config['parent_url_slug'] ) ) {
                _deprecated_argument( __FUNCTION__, '2.4.0',
                    'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
            }

            call_user_func( array( $instance, 'config' ), $config );
        }
    }
}

/**
 * WP_List_Table isn't always available. If it isn't available,
 * we load it here.
 *
 * @since 2.2.0
 */
if ( ! class_exists( 'WP_List_Table' ) ) {
    require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}

if ( ! class_exists( 'TGMPA_List_Table' ) ) {

    /**
     * List table class for handling plugins.
     *
     * Extends the WP_List_Table class to provide a future-compatible
     * way of listing out all required/recommended plugins.
     *
     * Gives users an interface similar to the Plugin Administration
     * area with similar (albeit stripped down) capabilities.
     *
     * This class also allows for the bulk install of plugins.
     *
     * @since 2.2.0
     *
     * @package TGM-Plugin-Activation
     * @author  Thomas Griffin
     * @author  Gary Jones
     */
    class TGMPA_List_Table extends WP_List_Table {
        /**
         * TGMPA instance.
         *
         * @since 2.5.0
         *
         * @var object
         */
        protected $tgmpa;

        /**
         * The currently chosen view.
         *
         * @since 2.5.0
         *
         * @var string One of: 'all', 'install', 'update', 'activate'
         */
        public $view_context = 'all';

        /**
         * The plugin counts for the various views.
         *
         * @since 2.5.0
         *
         * @var array
         */
        protected $view_totals = array(
            'all'      => 0,
            'install'  => 0,
            'update'   => 0,
            'activate' => 0,
        );

        /**
         * References parent constructor and sets defaults for class.
         *
         * @since 2.2.0
         */
        public function __construct() {
            $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );

            parent::__construct(
                array(
                    'singular' => 'plugin',
                    'plural'   => 'plugins',
                    'ajax'     => false,
                )
            );

            if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'],
                    array( 'install', 'update', 'activate' ), true ) ) {
                $this->view_context = sanitize_key( $_REQUEST['plugin_status'] );
            }

            add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) );
        }

        /**
         * Get a list of CSS classes for the <table> tag.
         *
         * Overruled to prevent the 'plural' argument from being added.
         *
         * @return array CSS classnames.
         * @since 2.5.0
         *
         */
        public function get_table_classes() {
            return array( 'widefat', 'fixed' );
        }

        /**
         * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table.
         *
         * @return array $table_data Information for use in table.
         * @since 2.2.0
         *
         */
        protected function _gather_plugin_data() {
            // Load thickbox for plugin links.
            $this->tgmpa->admin_init();
            $this->tgmpa->thickbox();

            // Categorize the plugins which have open actions.
            $plugins = $this->categorize_plugins_to_views();

            // Set the counts for the view links.
            $this->set_view_totals( $plugins );

            // Prep variables for use and grab list of all installed plugins.
            $table_data = array();
            $i          = 0;

            // Redirect to the 'all' view if no plugins were found for the selected view context.
            if ( empty( $plugins[ $this->view_context ] ) ) {
                $this->view_context = 'all';
            }

            foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) {
                $table_data[ $i ]['sanitized_plugin']  = $plugin['name'];
                $table_data[ $i ]['slug']              = $slug;
                $table_data[ $i ]['plugin']            = '<strong>' . $this->tgmpa->get_info_link( $slug ) . '</strong>';
                $table_data[ $i ]['source']            = $this->get_plugin_source_type_text( $plugin['source_type'] );
                $table_data[ $i ]['type']              = $this->get_plugin_advise_type_text( $plugin['required'] );
                $table_data[ $i ]['status']            = $this->get_plugin_status_text( $slug );
                $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug );
                $table_data[ $i ]['minimum_version']   = $plugin['version'];
                $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug );

                // Prep the upgrade notice info.
                $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug );
                if ( ! empty( $upgrade_notice ) ) {
                    $table_data[ $i ]['upgrade_notice'] = $upgrade_notice;

                    add_action( "tgmpa_after_plugin_row_{$slug}", array( $this, 'wp_plugin_update_row' ), 10, 2 );
                }

                $table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin );

                $i ++;
            }

            return $table_data;
        }

        /**
         * Categorize the plugins which have open actions into views for the TGMPA page.
         *
         * @since 2.5.0
         */
        protected function categorize_plugins_to_views() {
            $plugins = array(
                'all'      => array(), // Meaning: all plugins which still have open actions.
                'install'  => array(),
                'update'   => array(),
                'activate' => array(),
            );

            foreach ( $this->tgmpa->plugins as $slug => $plugin ) {
                if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
                    // No need to display plugins if they are installed, up-to-date and active.
                    continue;
                } else {
                    $plugins['all'][ $slug ] = $plugin;

                    if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
                        $plugins['install'][ $slug ] = $plugin;
                    } else {
                        if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
                            $plugins['update'][ $slug ] = $plugin;
                        }

                        if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
                            $plugins['activate'][ $slug ] = $plugin;
                        }
                    }
                }
            }

            return $plugins;
        }

        /**
         * Set the counts for the view links.
         *
         * @param array $plugins Plugins order by view.
         *
         * @since 2.5.0
         *
         */
        protected function set_view_totals( $plugins ) {
            foreach ( $plugins as $type => $list ) {
                $this->view_totals[ $type ] = count( $list );
            }
        }

        /**
         * Get the plugin required/recommended text string.
         *
         * @param string $required Plugin required setting.
         *
         * @return string
         * @since 2.5.0
         *
         */
        protected function get_plugin_advise_type_text( $required ) {
            if ( true === $required ) {
                return __( 'Required', 'colibri-wp' );
            }

            return __( 'Recommended', 'colibri-wp' );
        }

        /**
         * Get the plugin source type text string.
         *
         * @param string $type Plugin type.
         *
         * @return string
         * @since 2.5.0
         *
         */
        protected function get_plugin_source_type_text( $type ) {
            $string = '';

            switch ( $type ) {
                case 'repo':
                    $string = __( 'WordPress Repository', 'colibri-wp' );
                    break;
                case 'external':
                    $string = __( 'External Source', 'colibri-wp' );
                    break;
                case 'bundled':
                    $string = __( 'Pre-Packaged', 'colibri-wp' );
                    break;
            }

            return $string;
        }

        /**
         * Determine the plugin status message.
         *
         * @param string $slug Plugin slug.
         *
         * @return string
         * @since 2.5.0
         *
         */
        protected function get_plugin_status_text( $slug ) {
            if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
                return __( 'Not Installed', 'colibri-wp' );
            }

            if ( ! $this->tgmpa->is_plugin_active( $slug ) ) {
                $install_status = __( 'Installed But Not Activated', 'colibri-wp' );
            } else {
                $install_status = __( 'Active', 'colibri-wp' );
            }

            $update_status = '';

            if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
                $update_status = __( 'Required Update not Available', 'colibri-wp' );

            } elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) {
                $update_status = __( 'Requires Update', 'colibri-wp' );

            } elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
                $update_status = __( 'Update recommended', 'colibri-wp' );
            }

            if ( '' === $update_status ) {
                return $install_status;
            }

            return sprintf(
            /* translators: 1: install status, 2: update status */
                _x( '%1$s, %2$s', 'Install/Update Status', 'colibri-wp' ),
                $install_status,
                $update_status
            );
        }

        /**
         * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type.
         *
         * @param array $items Prepared table items.
         *
         * @return array Sorted table items.
         * @since 2.5.0
         *
         */
        public function sort_table_items( $items ) {
            $type = array();
            $name = array();

            foreach ( $items as $i => $plugin ) {
                $type[ $i ] = $plugin['type']; // Required / recommended.
                $name[ $i ] = $plugin['sanitized_plugin'];
            }

            array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items );

            return $items;
        }

        /**
         * Get an associative array ( id => link ) of the views available on this table.
         *
         * @return array
         * @since 2.5.0
         *
         */
        public function get_views() {
            $status_links = array();

            foreach ( $this->view_totals as $type => $count ) {
                if ( $count < 1 ) {
                    continue;
                }

                switch ( $type ) {
                    case 'all':
                        /* translators: 1: number of plugins. */
                        $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>',
                            $count, 'plugins', 'colibri-wp' );
                        break;
                    case 'install':
                        /* translators: 1: number of plugins. */
                        $text = _n( 'To Install <span class="count">(%s)</span>',
                            'To Install <span class="count">(%s)</span>', $count, 'colibri-wp' );
                        break;
                    case 'update':
                        /* translators: 1: number of plugins. */
                        $text = _n( 'Update Available <span class="count">(%s)</span>',
                            'Update Available <span class="count">(%s)</span>', $count, 'colibri-wp' );
                        break;
                    case 'activate':
                        /* translators: 1: number of plugins. */
                        $text = _n( 'To Activate <span class="count">(%s)</span>',
                            'To Activate <span class="count">(%s)</span>', $count, 'colibri-wp' );
                        break;
                    default:
                        $text = '';
                        break;
                }

                if ( ! empty( $text ) ) {

                    $status_links[ $type ] = sprintf(
                        '<a href="%s"%s>%s</a>',
                        esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ),
                        ( $type === $this->view_context ) ? ' class="current"' : '',
                        sprintf( $text, number_format_i18n( $count ) )
                    );
                }
            }

            return $status_links;
        }

        /**
         * Create default columns to display important plugin information
         * like type, action and status.
         *
         * @param array $item Array of item data.
         * @param string $column_name The name of the column.
         *
         * @return string
         * @since 2.2.0
         *
         */
        public function column_default( $item, $column_name ) {
            return $item[ $column_name ];
        }

        /**
         * Required for bulk installing.
         *
         * Adds a checkbox for each plugin.
         *
         * @param array $item Array of item data.
         *
         * @return string The input checkbox with all necessary info.
         * @since 2.2.0
         *
         */
        public function column_cb( $item ) {
            return sprintf(
                '<input type="checkbox" name="%1$s[]" value="%2$s" id="%3$s" />',
                esc_attr( $this->_args['singular'] ),
                esc_attr( $item['slug'] ),
                esc_attr( $item['sanitized_plugin'] )
            );
        }

        /**
         * Create default title column along with the action links.
         *
         * @param array $item Array of item data.
         *
         * @return string The plugin name and action links.
         * @since 2.2.0
         *
         */
        public function column_plugin( $item ) {
            return sprintf(
                '%1$s %2$s',
                $item['plugin'],
                $this->row_actions( $this->get_row_actions( $item ), true )
            );
        }

        /**
         * Create version information column.
         *
         * @param array $item Array of item data.
         *
         * @return string HTML-formatted version information.
         * @since 2.5.0
         *
         */
        public function column_version( $item ) {
            $output = array();

            if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
                $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown',
                    'as in: "version nr unknown"', 'colibri-wp' );

                $color = '';
                if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) {
                    $color = ' color: #ff0000; font-weight: bold;';
                }

                $output[] = sprintf(
                    '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:',
                        'colibri-wp' ) . '</p>',
                    $color,
                    $installed
                );
            }

            if ( ! empty( $item['minimum_version'] ) ) {
                $output[] = sprintf(
                    '<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:',
                        'colibri-wp' ) . '</p>',
                    $item['minimum_version']
                );
            }

            if ( ! empty( $item['available_version'] ) ) {
                $color = '';
                if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'],
                        $item['minimum_version'], '>=' ) ) {
                    $color = ' color: #71C671; font-weight: bold;';
                }

                $output[] = sprintf(
                    '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:',
                        'colibri-wp' ) . '</p>',
                    $color,
                    $item['available_version']
                );
            }

            if ( empty( $output ) ) {
                return '&nbsp;'; // Let's not break the table layout.
            } else {
                return implode( "\n", $output );
            }
        }

        /**
         * Sets default message within the plugins table if no plugins
         * are left for interaction.
         *
         * Hides the menu item to prevent the user from clicking and
         * getting a permissions error.
         *
         * @since 2.2.0
         */
        public function no_items() {
            echo esc_html__( 'No plugins to install, update or activate.',
                    'colibri-wp' ) . ' <a href="' . esc_url( self_admin_url() ) . '"> ' . esc_html__( 'Return to the Dashboard',
                    'colibri-wp' ) . '</a>';
            echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
        }

        /**
         * Output all the column information within the table.
         *
         * @return array $columns The column names.
         * @since 2.2.0
         *
         */
        public function get_columns() {
            $columns = array(
                'cb'     => '<input type="checkbox" />',
                'plugin' => __( 'Plugin', 'colibri-wp' ),
                'source' => __( 'Source', 'colibri-wp' ),
                'type'   => __( 'Type', 'colibri-wp' ),
            );

            if ( 'all' === $this->view_context || 'update' === $this->view_context ) {
                $columns['version'] = __( 'Version', 'colibri-wp' );
                $columns['status']  = __( 'Status', 'colibri-wp' );
            }

            return apply_filters( 'tgmpa_table_columns', $columns );
        }

        /**
         * Get name of default primary column
         *
         * @return string
         * @since 2.5.0 / WP 4.3+ compatibility
         * @access protected
         *
         */
        protected function get_default_primary_column_name() {
            return 'plugin';
        }

        /**
         * Get the name of the primary column.
         *
         * @return string The name of the primary column.
         * @since 2.5.0 / WP 4.3+ compatibility
         * @access protected
         *
         */
        protected function get_primary_column_name() {
            if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) {
                return parent::get_primary_column_name();
            } else {
                return $this->get_default_primary_column_name();
            }
        }

        /**
         * Get the actions which are relevant for a specific plugin row.
         *
         * @param array $item Array of item data.
         *
         * @return array Array with relevant action links.
         * @since 2.5.0
         *
         */
        protected function get_row_actions( $item ) {
            $actions      = array();
            $action_links = array();

            // Display the 'Install' action link if the plugin is not yet available.
            if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
                /* translators: %2$s: plugin name in screen reader markup */
                $actions['install'] = __( 'Install %2$s', 'colibri-wp' );
            } else {
                // Display the 'Update' action link if an update is available and WP complies with plugin minimum.
                if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) {
                    /* translators: %2$s: plugin name in screen reader markup */
                    $actions['update'] = __( 'Update %2$s', 'colibri-wp' );
                }

                // Display the 'Activate' action link, but only if the plugin meets the minimum version.
                if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) {
                    /* translators: %2$s: plugin name in screen reader markup */
                    $actions['activate'] = __( 'Activate %2$s', 'colibri-wp' );
                }
            }

            // Create the actual links.
            foreach ( $actions as $action => $text ) {
                $nonce_url = wp_nonce_url(
                    add_query_arg(
                        array(
                            'plugin'           => urlencode( $item['slug'] ),
                            'tgmpa-' . $action => $action . '-plugin',
                        ),
                        $this->tgmpa->get_tgmpa_url()
                    ),
                    'tgmpa-' . $action,
                    'tgmpa-nonce'
                );

                $action_links[ $action ] = sprintf(
                    '<a href="%1$s">' . esc_html( $text ) . '</a>', // $text contains the second placeholder.
                    esc_url( $nonce_url ),
                    '<span class="screen-reader-text">' . esc_html( $item['sanitized_plugin'] ) . '</span>'
                );
            }

            $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : '';

            return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'],
                $item, $this->view_context );
        }

        /**
         * Generates content for a single row of the table.
         *
         * @param object $item The current item.
         *
         * @since 2.5.0
         *
         */
        public function single_row( $item ) {
            parent::single_row( $item );

            /**
             * Fires after each specific row in the TGMPA Plugins list table.
             *
             * The dynamic portion of the hook name, `$item['slug']`, refers to the slug
             * for the plugin.
             *
             * @since 2.5.0
             */
            do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context );
        }

        /**
         * Show the upgrade notice below a plugin row if there is one.
         *
         * @param string $slug Plugin slug.
         * @param array $item The information available in this table row.
         *
         * @return null Return early if upgrade notice is empty.
         * @see /wp-admin/includes/update.php
         *
         * @since 2.5.0
         *
         */
        public function wp_plugin_update_row( $slug, $item ) {
            if ( empty( $item['upgrade_notice'] ) ) {
                return;
            }

            echo '
				<tr class="plugin-update-tr">
					<td colspan="', absint( $this->get_column_count() ), '" class="plugin-update colspanchange">
						<div class="update-message">',
            esc_html__( 'Upgrade message from the plugin author:', 'colibri-wp' ),
            ' <strong>', wp_kses_data( $item['upgrade_notice'] ), '</strong>
						</div>
					</td>
				</tr>';
        }

        /**
         * Extra controls to be displayed between bulk actions and pagination.
         *
         * @param string $which 'top' or 'bottom' table navigation.
         *
         * @since 2.5.0
         *
         */
        public function extra_tablenav( $which ) {
            if ( 'bottom' === $which ) {
                $this->tgmpa->show_tgmpa_version();
            }
        }

        /**
         * Defines the bulk actions for handling registered plugins.
         *
         * @return array $actions The bulk actions for the plugin install table.
         * @since 2.2.0
         *
         */
        public function get_bulk_actions() {

            $actions = array();

            if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {
                if ( current_user_can( 'install_plugins' ) ) {
                    $actions['tgmpa-bulk-install'] = __( 'Install', 'colibri-wp' );
                }
            }

            if ( 'install' !== $this->view_context ) {
                if ( current_user_can( 'update_plugins' ) ) {
                    $actions['tgmpa-bulk-update'] = __( 'Update', 'colibri-wp' );
                }
                if ( current_user_can( 'activate_plugins' ) ) {
                    $actions['tgmpa-bulk-activate'] = __( 'Activate', 'colibri-wp' );
                }
            }

            return $actions;
        }

        /**
         * Processes bulk installation and activation actions.
         *
         * The bulk installation process looks for the $_POST information and passes that
         * through if a user has to use WP_Filesystem to enter their credentials.
         *
         * @since 2.2.0
         */
        public function process_bulk_actions() {
            // Bulk installation process.
            if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) {

                check_admin_referer( 'bulk-' . $this->_args['plural'] );

                $install_type = 'install';
                if ( 'tgmpa-bulk-update' === $this->current_action() ) {
                    $install_type = 'update';
                }

                $plugins_to_install = array();

                // Did user actually select any plugins to install/update ?
                if ( empty( $_POST['plugin'] ) ) {
                    if ( 'install' === $install_type ) {
                        $message = __( 'No plugins were selected to be installed. No action taken.', 'colibri-wp' );
                    } else {
                        $message = __( 'No plugins were selected to be updated. No action taken.', 'colibri-wp' );
                    }

                    echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';

                    return false;
                }

                if ( is_array( $_POST['plugin'] ) ) {
                    $plugins_to_install = (array) $_POST['plugin'];
                } elseif ( is_string( $_POST['plugin'] ) ) {
                    // Received via Filesystem page - un-flatten array (WP bug #19643).
                    $plugins_to_install = explode( ',', $_POST['plugin'] );
                }

                // Sanitize the received input.
                $plugins_to_install = array_map( 'urldecode', $plugins_to_install );
                $plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install );

                // Validate the received input.
                foreach ( $plugins_to_install as $key => $slug ) {
                    // Check if the plugin was registered with TGMPA and remove if not.
                    if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) {
                        unset( $plugins_to_install[ $key ] );
                        continue;
                    }

                    // For install: make sure this is a plugin we *can* install and not one already installed.
                    if ( 'install' === $install_type && true === $this->tgmpa->is_plugin_installed( $slug ) ) {
                        unset( $plugins_to_install[ $key ] );
                    }

                    // For updates: make sure this is a plugin we *can* update (update available and WP version ok).
                    if ( 'update' === $install_type && false === $this->tgmpa->is_plugin_updatetable( $slug ) ) {
                        unset( $plugins_to_install[ $key ] );
                    }
                }

                // No need to proceed further if we have no plugins to handle.
                if ( empty( $plugins_to_install ) ) {
                    if ( 'install' === $install_type ) {
                        $message = __( 'No plugins are available to be installed at this time.', 'colibri-wp' );
                    } else {
                        $message = __( 'No plugins are available to be updated at this time.', 'colibri-wp' );
                    }

                    echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';

                    return false;
                }

                // Pass all necessary information if WP_Filesystem is needed.
                $url = wp_nonce_url(
                    $this->tgmpa->get_tgmpa_url(),
                    'bulk-' . $this->_args['plural']
                );

                // Give validated data back to $_POST which is the only place the filesystem looks for extra fields.
                $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643.

                $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
                $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.

                if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false,
                        $fields ) ) ) {
                    return true; // Stop the normal page form from displaying, credential request form will be shown.
                }

                // Now we have some credentials, setup WP_Filesystem.
                if ( ! WP_Filesystem( $creds ) ) {
                    // Our credentials were no good, ask the user for them again.
                    request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );

                    return true;
                }

                /* If we arrive here, we have the filesystem */

                // Store all information in arrays since we are processing a bulk installation.
                $names      = array();
                $sources    = array(); // Needed for installs.
                $file_paths = array(); // Needed for upgrades.
                $to_inject  = array(); // Information to inject into the update_plugins transient.

                // Prepare the data for validated plugins for the install/upgrade.
                foreach ( $plugins_to_install as $slug ) {
                    $name   = $this->tgmpa->plugins[ $slug ]['name'];
                    $source = $this->tgmpa->get_download_url( $slug );

                    if ( ! empty( $name ) && ! empty( $source ) ) {
                        $names[] = $name;

                        switch ( $install_type ) {

                            case 'install':
                                $sources[] = $source;
                                break;

                            case 'update':
                                $file_paths[]                 = $this->tgmpa->plugins[ $slug ]['file_path'];
                                $to_inject[ $slug ]           = $this->tgmpa->plugins[ $slug ];
                                $to_inject[ $slug ]['source'] = $source;
                                break;
                        }
                    }
                }
                unset( $slug, $name, $source );

                // Create a new instance of TGMPA_Bulk_Installer.
                $installer = new TGMPA_Bulk_Installer(
                    new TGMPA_Bulk_Installer_Skin(
                        array(
                            'url'          => esc_url_raw( $this->tgmpa->get_tgmpa_url() ),
                            'nonce'        => 'bulk-' . $this->_args['plural'],
                            'names'        => $names,
                            'install_type' => $install_type,
                        )
                    )
                );

                // Wrap the install process with the appropriate HTML.
                echo '<div class="tgmpa">',
                '<h2 style="font-size: 23px; font-weight: 400; line-height: 29px; margin: 0; padding: 9px 15px 4px 0;">', esc_html( get_admin_page_title() ), '</h2>
					<div class="update-php" style="width: 100%; height: 98%; min-height: 850px; padding-top: 1px;">';

                // Process the bulk installation submissions.
                add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );

                if ( 'tgmpa-bulk-update' === $this->current_action() ) {
                    // Inject our info into the update transient.
                    $this->tgmpa->inject_update_info( $to_inject );

                    $installer->bulk_upgrade( $file_paths );
                } else {
                    $installer->bulk_install( $sources );
                }

                remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1 );

                echo '</div></div>';

                return true;
            }

            // Bulk activation process.
            if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
                check_admin_referer( 'bulk-' . $this->_args['plural'] );

                // Did user actually select any plugins to activate ?
                if ( empty( $_POST['plugin'] ) ) {
                    echo '<div id="message" class="error"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.',
                        'colibri-wp' ), '</p></div>';

                    return false;
                }

                // Grab plugin data from $_POST.
                $plugins = array();
                if ( isset( $_POST['plugin'] ) ) {
                    $plugins = array_map( 'urldecode', (array) $_POST['plugin'] );
                    $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins );
                }

                $plugins_to_activate = array();
                $plugin_names        = array();

                // Grab the file paths for the selected & inactive plugins from the registration array.
                foreach ( $plugins as $slug ) {
                    if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
                        $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path'];
                        $plugin_names[]        = $this->tgmpa->plugins[ $slug ]['name'];
                    }
                }
                unset( $slug );

                // Return early if there are no plugins to activate.
                if ( empty( $plugins_to_activate ) ) {
                    echo '<div id="message" class="error"><p>', esc_html__( 'No plugins are available to be activated at this time.',
                        'colibri-wp' ), '</p></div>';

                    return false;
                }

                // Now we are good to go - let's start activating plugins.
                $activate = activate_plugins( $plugins_to_activate );

                if ( is_wp_error( $activate ) ) {
                    echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>';
                } else {
                    $count        = count( $plugin_names ); // Count so we can use _n function.
                    $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names );
                    $last_plugin  = array_pop( $plugin_names ); // Pop off last name to prep for readability.
                    $imploded     = empty( $plugin_names ) ? $last_plugin : ( implode( ', ',
                            $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B',
                            'colibri-wp' ) . ' ' . $last_plugin );

                    printf( // WPCS: xss ok.
                        '<div id="message" class="updated"><p>%1$s %2$s.</p></div>',
                        esc_html( _n( 'The following plugin was activated successfully:',
                            'The following plugins were activated successfully:', $count, 'colibri-wp' ) ),
                        $imploded
                    );

                    // Update recently activated plugins option.
                    $recent = (array) get_option( 'recently_activated' );
                    foreach ( $plugins_to_activate as $plugin => $time ) {
                        if ( isset( $recent[ $plugin ] ) ) {
                            unset( $recent[ $plugin ] );
                        }
                    }
                    update_option( 'recently_activated', $recent );
                }

                unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another.

                return true;
            }

            return false;
        }

        /**
         * Prepares all of our information to be outputted into a usable table.
         *
         * @since 2.2.0
         */
        public function prepare_items() {
            $columns               = $this->get_columns(); // Get all necessary column information.
            $hidden                = array(); // No columns to hide, but we must set as an array.
            $sortable              = array(); // No reason to make sortable columns.
            $primary               = $this->get_primary_column_name(); // Column which has the row actions.
            $this->_column_headers = array(
                $columns,
                $hidden,
                $sortable,
                $primary
            ); // Get all necessary column headers.

            // Process our bulk activations here.
            if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
                $this->process_bulk_actions();
            }

            // Store all of our plugin data into $items array so WP_List_Table can use it.
            $this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() );
        }

        /* *********** DEPRECATED METHODS *********** */

        /**
         * Retrieve plugin data, given the plugin name.
         *
         * @param string $name Name of the plugin, as it was registered.
         * @param string $data Optional. Array key of plugin data to return. Default is slug.
         *
         * @return string|boolean Plugin slug if found, false otherwise.
         * @since      2.2.0
         * @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead.
         * @see        TGM_Plugin_Activation::_get_plugin_data_from_name()
         *
         */
        protected function _get_plugin_data_from_name( $name, $data = 'slug' ) {
            _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' );

            return $this->tgmpa->_get_plugin_data_from_name( $name, $data );
        }
    }
}


if ( ! class_exists( 'TGM_Bulk_Installer' ) ) {

    /**
     * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+.
     *
     * @since 2.5.2
     *
     * {@internal The TGMPA_Bulk_Installer class was originally called TGM_Bulk_Installer.
     *            For more information, see that class.}}
     */
    class TGM_Bulk_Installer {
    }
}
if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) {

    /**
     * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+.
     *
     * @since 2.5.2
     *
     * {@internal The TGMPA_Bulk_Installer_Skin class was originally called TGM_Bulk_Installer_Skin.
     *            For more information, see that class.}}
     */
    class TGM_Bulk_Installer_Skin {
    }
}

/**
 * The WP_Upgrader file isn't always available. If it isn't available,
 * we load it here.
 *
 * We check to make sure no action or activation keys are set so that WordPress
 * does not try to re-include the class when processing upgrades or installs outside
 * of the class.
 *
 * @since 2.2.0
 */
add_action( 'admin_init', 'tgmpa_load_bulk_installer' );
if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
    /**
     * Load bulk installer
     */
    function tgmpa_load_bulk_installer() {
        // Silently fail if 2.5+ is loaded *after* an older version.
        if ( ! isset( $GLOBALS['tgmpa'] ) ) {
            return;
        }

        // Get TGMPA class instance.
        $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );

        if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) {
            if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
                require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
            }

            if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) {

                /**
                 * Installer class to handle bulk plugin installations.
                 *
                 * Extends WP_Upgrader and customizes to suit the installation of multiple
                 * plugins.
                 *
                 * @since 2.2.0
                 *
                 * {@internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader.}}
                 * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer.
                 *            This was done to prevent backward compatibility issues with v2.3.6.}}
                 *
                 * @package TGM-Plugin-Activation
                 * @author  Thomas Griffin
                 * @author  Gary Jones
                 */
                class TGMPA_Bulk_Installer extends Plugin_Upgrader {
                    /**
                     * Holds result of bulk plugin installation.
                     *
                     * @since 2.2.0
                     *
                     * @var string
                     */
                    public $result;

                    /**
                     * Flag to check if bulk installation is occurring or not.
                     *
                     * @since 2.2.0
                     *
                     * @var boolean
                     */
                    public $bulk = false;

                    /**
                     * TGMPA instance
                     *
                     * @since 2.5.0
                     *
                     * @var object
                     */
                    protected $tgmpa;

                    /**
                     * Whether or not the destination directory needs to be cleared ( = on update).
                     *
                     * @since 2.5.0
                     *
                     * @var bool
                     */
                    protected $clear_destination = false;

                    /**
                     * References parent constructor and sets defaults for class.
                     *
                     * @param Bulk_Upgrader_Skin|null $skin Installer skin.
                     *
                     * @since 2.2.0
                     *
                     */
                    public function __construct( $skin = null ) {
                        // Get TGMPA class instance.
                        $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );

                        parent::__construct( $skin );

                        if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) {
                            $this->clear_destination = true;
                        }

                        if ( $this->tgmpa->is_automatic ) {
                            $this->activate_strings();
                        }

                        add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) );
                    }

                    /**
                     * Sets the correct activation strings for the installer skin to use.
                     *
                     * @since 2.2.0
                     */
                    public function activate_strings() {
                        $this->strings['activation_failed']  = __( 'Plugin activation failed.', 'colibri-wp' );
                        $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'colibri-wp' );
                    }

                    /**
                     * Performs the actual installation of each plugin.
                     *
                     * @param array $options The installation config options.
                     *
                     * @return null|array Return early if error, array of installation data on success.
                     * @since 2.2.0
                     *
                     * @see WP_Upgrader::run()
                     *
                     */
                    public function run( $options ) {
                        $result = parent::run( $options );

                        // Reset the strings in case we changed one during automatic activation.
                        if ( $this->tgmpa->is_automatic ) {
                            if ( 'update' === $this->skin->options['install_type'] ) {
                                $this->upgrade_strings();
                            } else {
                                $this->install_strings();
                            }
                        }

                        return $result;
                    }


                    /**
                     * Processes the bulk installation of plugins.
                     *
                     * @param array $plugins The plugin sources needed for installation.
                     * @param array $args Arbitrary passed extra arguments.
                     *
                     * @return array|false   Install confirmation messages on success, false on failure.
                     *
                     *
                     * @since 2.2.0
                     *
                     * {@internal This is basically a near identical copy of the WP Core
                     * Plugin_Upgrader::bulk_upgrade() method, with minor adjustments to deal with
                     * new installs instead of upgrades.
                     * For ease of future synchronizations, the adjustments are clearly commented, but no other
                     * comments are added. Code style has been made to comply.}}
                     *
                     * @see Plugin_Upgrader::bulk_upgrade()
                     *
                     */

                    public function bulk_install( $plugins, $args = array() ) {
                        // [TGMPA + ] Hook auto-activation in.
                        add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );

                        $defaults    = array(
                            'clear_update_cache' => true,
                        );
                        $parsed_args = wp_parse_args( $args, $defaults );

                        $this->init();
                        $this->bulk = true;

                        $this->install_strings(); // [TGMPA + ] adjusted.

                        /* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */

                        /* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */

                        $this->skin->header();

                        // Connect to the Filesystem first.
                        $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );
                        if ( ! $res ) {
                            $this->skin->footer();

                            return false;
                        }

                        $this->skin->bulk_header();

                        /*
						 * Only start maintenance mode if:
						 * - running Multisite and there are one or more plugins specified, OR
						 * - a plugin with an update available is currently active.
						 * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
						 */
                        $maintenance = ( is_multisite() && ! empty( $plugins ) );

                        /*
						[TGMPA - ]
						foreach ( $plugins as $plugin )
							$maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
						*/
                        if ( $maintenance ) {
                            $this->maintenance_mode( true );
                        }

                        $results = array();

                        $this->update_count   = count( $plugins );
                        $this->update_current = 0;
                        foreach ( $plugins as $plugin ) {
                            $this->update_current ++;

                            /*
							[TGMPA - ]
							$this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);

							if ( !isset( $current->response[ $plugin ] ) ) {
								$this->skin->set_result('up_to_date');
								$this->skin->before();
								$this->skin->feedback('up_to_date');
								$this->skin->after();
								$results[$plugin] = true;
								continue;
							}

							// Get the URL to the zip file.
							$r = $current->response[ $plugin ];

							$this->skin->plugin_active = is_plugin_active($plugin);
							*/

                            $result = $this->run(
                                array(
                                    'package'           => $plugin, // [TGMPA + ] adjusted.
                                    'destination'       => WP_PLUGIN_DIR,
                                    'clear_destination' => false, // [TGMPA + ] adjusted.
                                    'clear_working'     => true,
                                    'is_multi'          => true,
                                    'hook_extra'        => array(
                                        'plugin' => $plugin,
                                    ),
                                )
                            );

                            $results[ $plugin ] = $this->result;

                            // Prevent credentials auth screen from displaying multiple times.
                            if ( false === $result ) {
                                break;
                            }
                        } //end foreach $plugins

                        $this->maintenance_mode( false );

                        /**
                         * Fires when the bulk upgrader process is complete.
                         *
                         * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might
                         *                              be a Theme_Upgrader or Core_Upgrade instance.
                         * @param array $data {
                         *     Array of bulk item update data.
                         *
                         * @type string $action Type of action. Default 'update'.
                         * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
                         * @type bool $bulk Whether the update process is a bulk update. Default true.
                         * @type array $packages Array of plugin, theme, or core packages to update.
                         * }
                         * @since WP 3.6.0 / TGMPA 2.5.0
                         *
                         */
                        do_action( 'upgrader_process_complete', $this, array(
                            'action'  => 'install', // [TGMPA + ] adjusted.
                            'type'    => 'plugin',
                            'bulk'    => true,
                            'plugins' => $plugins,
                        ) );

                        $this->skin->bulk_footer();

                        $this->skin->footer();

                        // Cleanup our hooks, in case something else does a upgrade on this connection.
                        /* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */

                        // [TGMPA + ] Remove our auto-activation hook.
                        remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );

                        // Force refresh of plugin update information.
                        wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );

                        return $results;
                    }

                    /**
                     * Handle a bulk upgrade request.
                     *
                     * @param array $plugins The local WP file_path's of the plugins which should be upgraded.
                     * @param array $args Arbitrary passed extra arguments.
                     *
                     * @return string|bool Install confirmation messages on success, false on failure.
                     * @see Plugin_Upgrader::bulk_upgrade()
                     *
                     * @since 2.5.0
                     *
                     */
                    public
                    function bulk_upgrade(
                        $plugins,
                        $args = array()
                    ) {

                        add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );

                        $result = parent::bulk_upgrade( $plugins, $args );

                        remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );

                        return $result;
                    }

                    /**
                     * Abuse a filter to auto-activate plugins after installation.
                     *
                     * Hooked into the 'upgrader_post_install' filter hook.
                     *
                     * @param bool $bool The value we need to give back (true).
                     *
                     * @return bool
                     * @since 2.5.0
                     *
                     */
                    public
                    function auto_activate(
                        $bool
                    ) {
                        // Only process the activation of installed plugins if the automatic flag is set to true.
                        if ( $this->tgmpa->is_automatic ) {
                            // Flush plugins cache so the headers of the newly installed plugins will be read correctly.
                            wp_clean_plugins_cache();

                            // Get the installed plugin file.
                            $plugin_info = $this->plugin_info();

                            // Don't try to activate on upgrade of active plugin as WP will do this already.
                            if ( ! is_plugin_active( $plugin_info ) ) {
                                $activate = activate_plugin( $plugin_info );

                                // Adjust the success string based on the activation result.
                                $this->strings['process_success'] = $this->strings['process_success'] . "<br />\n";

                                if ( is_wp_error( $activate ) ) {
                                    $this->skin->error( $activate );
                                    $this->strings['process_success'] .= $this->strings['activation_failed'];
                                } else {
                                    $this->strings['process_success'] .= $this->strings['activation_success'];
                                }
                            }
                        }

                        return $bool;
                    }
                }
            }

            if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) {

                /**
                 * Installer skin to set strings for the bulk plugin installations..
                 *
                 * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple
                 * plugins.
                 *
                 * @since 2.2.0
                 *
                 * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to
                 *            TGMPA_Bulk_Installer_Skin.
                 *            This was done to prevent backward compatibility issues with v2.3.6.}}
                 *
                 * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php
                 *
                 * @package TGM-Plugin-Activation
                 * @author  Thomas Griffin
                 * @author  Gary Jones
                 */
                class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin {
                    /**
                     * Holds plugin info for each individual plugin installation.
                     *
                     * @since 2.2.0
                     *
                     * @var array
                     */
                    public $plugin_info = array();

                    /**
                     * Holds names of plugins that are undergoing bulk installations.
                     *
                     * @since 2.2.0
                     *
                     * @var array
                     */
                    public $plugin_names = array();

                    /**
                     * Integer to use for iteration through each plugin installation.
                     *
                     * @since 2.2.0
                     *
                     * @var integer
                     */
                    public $i = 0;

                    /**
                     * TGMPA instance
                     *
                     * @since 2.5.0
                     *
                     * @var object
                     */
                    protected $tgmpa;

                    /**
                     * Constructor. Parses default args with new ones and extracts them for use.
                     *
                     * @param array $args Arguments to pass for use within the class.
                     *
                     * @since 2.2.0
                     *
                     */
                    public function __construct( $args = array() ) {
                        // Get TGMPA class instance.
                        $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );

                        // Parse default and new args.
                        $defaults = array(
                            'url'          => '',
                            'nonce'        => '',
                            'names'        => array(),
                            'install_type' => 'install',
                        );
                        $args     = wp_parse_args( $args, $defaults );

                        // Set plugin names to $this->plugin_names property.
                        $this->plugin_names = $args['names'];

                        // Extract the new args.
                        parent::__construct( $args );
                    }

                    /**
                     * Sets install skin strings for each individual plugin.
                     *
                     * Checks to see if the automatic activation flag is set and uses the
                     * the proper strings accordingly.
                     *
                     * @since 2.2.0
                     */
                    public function add_strings() {
                        if ( 'update' === $this->options['install_type'] ) {
                            parent::add_strings();
                            /* translators: 1: plugin name, 2: action number 3: total number of actions. */
                            $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)',
                                'colibri-wp' );
                        } else {
                            /* translators: 1: plugin name, 2: error message. */
                            $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.',
                                'colibri-wp' );
                            /* translators: 1: plugin name. */
                            $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.',
                                'colibri-wp' );

                            if ( $this->tgmpa->is_automatic ) {
                                // Automatic activation strings.
                                $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.',
                                    'colibri-wp' );
                                /* translators: 1: plugin name. */
                                $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.',
                                        'colibri-wp' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details',
                                        'colibri-wp' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details',
                                        'colibri-wp' ) . '</span>.</a>';
                                $this->upgrader->strings['skin_upgrade_end']       = __( 'All installations and activations have been completed.',
                                    'colibri-wp' );
                                /* translators: 1: plugin name, 2: action number 3: total number of actions. */
                                $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)',
                                    'colibri-wp' );
                            } else {
                                // Default installation strings.
                                $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.',
                                    'colibri-wp' );
                                /* translators: 1: plugin name. */
                                $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.',
                                        'colibri-wp' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details',
                                        'colibri-wp' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details',
                                        'colibri-wp' ) . '</span>.</a>';
                                $this->upgrader->strings['skin_upgrade_end']       = __( 'All installations have been completed.',
                                    'colibri-wp' );
                                /* translators: 1: plugin name, 2: action number 3: total number of actions. */
                                $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)',
                                    'colibri-wp' );
                            }
                        }
                    }

                    /**
                     * Outputs the header strings and necessary JS before each plugin installation.
                     *
                     * @param string $title Unused in this implementation.
                     *
                     * @since 2.2.0
                     *
                     */
                    public function before( $title = '' ) {
                        if ( empty( $title ) ) {
                            $title = esc_html( $this->plugin_names[ $this->i ] );
                        }
                        parent::before( $title );
                    }

                    /**
                     * Outputs the footer strings and necessary JS after each plugin installation.
                     *
                     * Checks for any errors and outputs them if they exist, else output
                     * success strings.
                     *
                     * @param string $title Unused in this implementation.
                     *
                     * @since 2.2.0
                     *
                     */
                    public function after( $title = '' ) {
                        if ( empty( $title ) ) {
                            $title = esc_html( $this->plugin_names[ $this->i ] );
                        }
                        parent::after( $title );

                        $this->i ++;
                    }

                    /**
                     * Outputs links after bulk plugin installation is complete.
                     *
                     * @since 2.2.0
                     */
                    public function bulk_footer() {
                        // Serve up the string to say installations (and possibly activations) are complete.
                        parent::bulk_footer();

                        // Flush plugins cache so we can make sure that the installed plugins list is always up to date.
                        wp_clean_plugins_cache();

                        $this->tgmpa->show_tgmpa_version();

                        // Display message based on if all plugins are now active or not.
                        $update_actions = array();

                        if ( $this->tgmpa->is_tgmpa_complete() ) {
                            // All plugins are active, so we display the complete string and hide the menu to protect users.
                            echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
                            $update_actions['dashboard'] = sprintf(
                                esc_html( $this->tgmpa->strings['complete'] ),
                                '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard',
                                    'colibri-wp' ) . '</a>'
                            );
                        } else {
                            $update_actions['tgmpa_page'] = '<a href="' . esc_url( $this->tgmpa->get_tgmpa_url() ) . '" target="_parent">' . esc_html( $this->tgmpa->strings['return'] ) . '</a>';
                        }

                        /**
                         * Filter the list of action links available following bulk plugin installs/updates.
                         *
                         * @param array $update_actions Array of plugin action links.
                         * @param array $plugin_info Array of information for the last-handled plugin.
                         *
                         * @since 2.5.0
                         *
                         */
                        $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions,
                            $this->plugin_info );

                        if ( ! empty( $update_actions ) ) {
                            $this->feedback( implode( ' | ', (array) $update_actions ) );
                        }
                    }

                    /* *********** DEPRECATED METHODS *********** */

                    /**
                     * Flush header output buffer.
                     *
                     * @since      2.2.0
                     * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
                     * @see        Bulk_Upgrader_Skin::flush_output()
                     */
                    public function before_flush_output() {
                        _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
                        $this->flush_output();
                    }

                    /**
                     * Flush footer output buffer and iterate $this->i to make sure the
                     * installation strings reference the correct plugin.
                     *
                     * @since      2.2.0
                     * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
                     * @see        Bulk_Upgrader_Skin::flush_output()
                     */
                    public function after_flush_output() {
                        _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
                        $this->flush_output();
                        $this->i ++;
                    }
                }
            }
        }
    }
}

if ( ! class_exists( 'TGMPA_Utils' ) ) {

    /**
     * Generic utilities for TGMPA.
     *
     * All methods are static, poor-dev name-spacing class wrapper.
     *
     * Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy.
     *
     * @since 2.5.0
     *
     * @package TGM-Plugin-Activation
     * @author  Juliette Reinders Folmer
     */
    class TGMPA_Utils {
        /**
         * Whether the PHP filter extension is enabled.
         *
         * @see http://php.net/book.filter
         *
         * @since 2.5.0
         *
         * @static
         *
         * @var bool $has_filters True is the extension is enabled.
         */
        public static $has_filters;

        /**
         * Wrap an arbitrary string in <em> tags. Meant to be used in combination with array_map().
         *
         * @param string $string Text to be wrapped.
         *
         * @return string
         * @since 2.5.0
         *
         * @static
         *
         */
        public static function wrap_in_em( $string ) {
            return '<em>' . wp_kses_post( $string ) . '</em>';
        }

        /**
         * Wrap an arbitrary string in <strong> tags. Meant to be used in combination with array_map().
         *
         * @param string $string Text to be wrapped.
         *
         * @return string
         * @since 2.5.0
         *
         * @static
         *
         */
        public static function wrap_in_strong( $string ) {
            return '<strong>' . wp_kses_post( $string ) . '</strong>';
        }

        /**
         * Helper function: Validate a value as boolean
         *
         * @param mixed $value Arbitrary value.
         *
         * @return bool
         * @since 2.5.0
         *
         * @static
         *
         */
        public static function validate_bool( $value ) {
            if ( ! isset( self::$has_filters ) ) {
                self::$has_filters = extension_loaded( 'filter' );
            }

            if ( self::$has_filters ) {
                return filter_var( $value, FILTER_VALIDATE_BOOLEAN );
            } else {
                return self::emulate_filter_bool( $value );
            }
        }

        /**
         * Helper function: Cast a value to bool
         *
         * @param mixed $value Value to cast.
         *
         * @return bool
         * @since 2.5.0
         *
         * @static
         *
         */
        protected static function emulate_filter_bool( $value ) {
            // @codingStandardsIgnoreStart
            static $true = array(
                '1',
                'true',
                'True',
                'TRUE',
                'y',
                'Y',
                'yes',
                'Yes',
                'YES',
                'on',
                'On',
                'ON',
            );
            static $false = array(
                '0',
                'false',
                'False',
                'FALSE',
                'n',
                'N',
                'no',
                'No',
                'NO',
                'off',
                'Off',
                'OFF',
            );
            // @codingStandardsIgnoreEnd

            if ( is_bool( $value ) ) {
                return $value;
            } elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) {
                return (bool) $value;
            } elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) {
                return (bool) $value;
            } elseif ( is_string( $value ) ) {
                $value = trim( $value );
                if ( in_array( $value, $true, true ) ) {
                    return true;
                } elseif ( in_array( $value, $false, true ) ) {
                    return false;
                } else {
                    return false;
                }
            }

            return false;
        }
    } // End of class TGMPA_Utils
} // End of class_exists wrapper
translations.php000064400000046315151335104360010010 0ustar00<?php

return array(

    // panel / sections general texts
    'press_enter_to_open_section' => __( 'Press return or enter to open this section', 'colibri-wp' ),
    'back'                        => __( 'Back', 'colibri-wp' ),
    'help'                        => __( 'Help', 'colibri-wp' ),
    'header_sections'             => __( 'Header', 'colibri-wp' ),
    'footer_sections'             => __( 'Footer', 'colibri-wp' ),
    'content_sections'            => __( 'Content', 'colibri-wp' ),
    'content_settings'            => __( 'Content Settings', 'colibri-wp' ),
    'top_bar_settings'            => __( 'Top Bar Settings', 'colibri-wp' ),
    'nav_settings'                => __( 'Navigation Settings', 'colibri-wp' ),
    'hero_settings'               => __( 'Hero Settings', 'colibri-wp' ),
    'footer_settings'             => __( 'Footer Settings', 'colibri-wp' ),
    'blog_settings'               => __( 'Blog Settings', 'colibri-wp' ),
    'content'                     => __( 'Content', 'colibri-wp' ),
    'style'                       => __( 'Style', 'colibri-wp' ),
    'advanced'                    => __( 'Advanced', 'colibri-wp' ),

    //hero
    'background_type'             => __( 'Background Type', 'colibri-wp' ),
    'background_color'            => __( 'Background Color', 'colibri-wp' ),
    'background_image'            => __( 'Background Image', 'colibri-wp' ),
    'color'                       => __( 'Color', 'colibri-wp' ),
    'image'                       => __( 'Image', 'colibri-wp' ),
    'gradient'                    => __( 'Gradient', 'colibri-wp' ),
    'slideshow'                   => __( 'Slideshow', 'colibri-wp' ),
    'video'                       => __( 'Video', 'colibri-wp' ),

    //divider
    'show_bottom_divider'         => __( 'Show bottom divider', 'colibri-wp' ),
    'divider_style'               => __( 'Divider style', 'colibri-wp' ),
    'divider_height'              => __( 'Divider height', 'colibri-wp' ),
    'divider_negative'            => __( 'Divider negative', 'colibri-wp' ),

    //divider style
    'tilt'                        => __( 'Tilt', 'colibri-wp' ),
    'tilt-flipped'                => __( 'Tilt Flipped', 'colibri-wp' ),
    'triangle'                    => __( 'Triangle', 'colibri-wp' ),
    'triangle-asymmetrical'       => __( 'Triangle Asymmetrical', 'colibri-wp' ),
    'opacity-fan'                 => __( 'Opacity Fan', 'colibri-wp' ),
    'opacity-tilt'                => __( 'Opacity Tilt ', 'colibri-wp' ),
    'mountains'                   => __( 'Mountains', 'colibri-wp' ),
    'pyramids'                    => __( 'Pyramids', 'colibri-wp' ),
    'waves'                       => __( 'Waves', 'colibri-wp' ),
    'wave-brush'                  => __( 'Wave Brush', 'colibri-wp' ),
    'waves-pattern'               => __( 'Waves Pattern', 'colibri-wp' ),
    'clouds'                      => __( 'Clouds', 'colibri-wp' ),
    'curve'                       => __( 'Curve', 'colibri-wp' ),
    'curve-asymmetrical'          => __( 'Curve Asymmetrical', 'colibri-wp' ),
    'drops'                       => __( 'Drops', 'colibri-wp' ),
    'arrow'                       => __( 'Arrow', 'colibri-wp' ),
    'book'                        => __( 'Book', 'colibri-wp' ),
    'split'                       => __( 'Split', 'colibri-wp' ),
    'zigzag'                      => __( 'Zigzag', 'colibri-wp' ),

    // controls
    'select'                      => __( 'Select', 'colibri-wp' ),
    'select_item'                 => __( 'Select item', 'colibri-wp' ),
    'select_image'                => __( 'Select image', 'colibri-wp' ),
    'OK'                          => __( 'OK', 'colibri-wp' ),
    'clear'                       => __( 'Clear', 'colibri-wp' ),
    'none'                        => __( 'None', 'colibri-wp' ),
    'add'                         => __( 'Add', 'colibri-wp' ),
    'remove'                      => __( 'Remove', 'colibri-wp' ),
    'slide_n'                     => __( 'Slide %s', 'colibri-wp' ),
    'add_slide'                   => __( 'Add Slide', 'colibri-wp' ),
    'position'                    => __( 'Position', 'colibri-wp' ),

    // position
    'top_left'                    => __( 'Top Left', 'colibri-wp' ),
    'top_center'                  => __( 'Top Center', 'colibri-wp' ),
    'top_right'                   => __( 'Top Right', 'colibri-wp' ),
    'center_left'                 => __( 'Center Left', 'colibri-wp' ),
    'center_center'               => __( 'Center Center', 'colibri-wp' ),
    'center_right'                => __( 'Center Right', 'colibri-wp' ),
    'bottom_left'                 => __( 'Bottom Left', 'colibri-wp' ),
    'bottom_center'               => __( 'Bottom Center', 'colibri-wp' ),
    'bottom_right'                => __( 'Bottom Right', 'colibri-wp' ),
    'attachment'                  => __( 'Attachment', 'colibri-wp' ),
    'scroll'                      => __( 'Scroll', 'colibri-wp' ),
    'fixed'                       => __( 'Fixed', 'colibri-wp' ),
    'size'                        => __( 'Size', 'colibri-wp' ),
    'no-repeat'                   => __( 'Do not repeat', 'colibri-wp' ),
    'repeat'                      => __( 'Repeat %s', 'colibri-wp' ),
    'auto'                        => __( 'Auto', 'colibri-wp' ),
    'cover'                       => __( 'Cover', 'colibri-wp' ),
    'contain'                     => __( 'Contain', 'colibri-wp' ),
    'slide_duration'              => __( 'Slide Duration', 'colibri-wp' ),
    'effect_speed'                => __( 'Effect Speed', 'colibri-wp' ),
    'video_type'                  => __( 'Video type', 'colibri-wp' ),
    'self_hosted'                 => __( 'Self Hosted', 'colibri-wp' ),
    'self_hosted_video'           => __( 'Self Hosted Video', 'colibri-wp' ),
    'external_video'              => __( 'External', 'colibri-wp' ),
    'video_poster'                => __( 'Video Poster', 'colibri-wp' ),
    'youtube_url'                 => __( 'Youtube link', 'colibri-wp' ),
    'show_background_overlay'     => __( 'Show Background Overlay', 'colibri-wp' ),
    'overlay_type'                => __( 'Overlay Type', 'colibri-wp' ),
    'shape_only'                  => __( 'Shape Only', 'colibri-wp' ),
    'opacity'                     => __( 'Opacity', 'colibri-wp' ),
    'circles'                     => __( 'Circles', 'colibri-wp' ),
    '10degree_stripes'            => __( '10deg Stripes', 'colibri-wp' ),
    'rounded_squares_blue'        => __( 'Rounded Square Blue', 'colibri-wp' ),
    'many_rounded_squares_blue'   => __( 'Many Rounded Squares Blue', 'colibri-wp' ),
    'two_circles'                 => __( 'Two Circles', 'colibri-wp' ),
    'circles_2'                   => __( 'Circles 2', 'colibri-wp' ),
    'circles_3'                   => __( 'Circles 3', 'colibri-wp' ),
    'circles_gradient'            => __( 'Circles Gradient', 'colibri-wp' ),
    'circles_white_gradient'      => __( 'Circles White Gradient', 'colibri-wp' ),
    'waves_inverted'              => __( 'Waves Inverted', 'colibri-wp' ),
    'dots'                        => __( 'Dots', 'colibri-wp' ),
    'left_tilted_lines'           => __( 'Left Tilted Lines', 'colibri-wp' ),
    'right_tilted_lines'          => __( 'Right Tilted Lines', 'colibri-wp' ),
    'right_tilted_strips'         => __( 'Right Tilted Strips', 'colibri-wp' ),
    'shape_light'                 => __( 'Shape Light', 'colibri-wp' ),
    'overlay_shape'               => __( 'Overlay Shape', 'colibri-wp' ),

    // hero content
    'hero_layout'                 => __( 'Hero layout', 'colibri-wp' ),
    'text_only'                   => __( 'Text only', 'colibri-wp' ),
    'text_with_media_on_right'    => __( 'Text with media on right', 'colibri-wp' ),
    'text_with_media_on_left'     => __( 'Text with media on left', 'colibri-wp' ),
    'show_title'                  => __( 'Show Title', 'colibri-wp' ),
    'show_subtitle'               => __( 'Show Subtitle', 'colibri-wp' ),
    'title'                       => __( 'Title', 'colibri-wp' ),
    'subtitle'                    => __( 'Subtitle', 'colibri-wp' ),
    'text_width'                  => __( 'Text width', 'colibri-wp' ),
    'button'                      => __( 'Button', 'colibri-wp' ),
    'add_button'                  => __( 'Add Button', 'colibri-wp' ),
    'buttons'                     => __( 'Buttons', 'colibri-wp' ),
    'button_type'                 => __( 'Button Type', 'colibri-wp' ),
    'primary_button'              => __( 'Primary Button', 'colibri-wp' ),
    'secondary_button'            => __( 'Secondary Button', 'colibri-wp' ),
    'label'                       => __( 'Label', 'colibri-wp' ),
    'link'                        => __( 'Link', 'colibri-wp' ),
    'icons'                       => __( 'Icons', 'colibri-wp' ),
    'align'                       => __( 'Align', 'colibri-wp' ),
    'spacing_top'                 => __( 'Spacing top', 'colibri-wp' ),
    'spacing_bottom'              => __( 'Spacing bottom', 'colibri-wp' ),
    'full_height'                 => __( 'Full Height', 'colibri-wp' ),
    'hero_column_width'           => __( 'Text column width', 'colibri-wp' ),

    //hero image
    'box_shadow'                  => __( 'Box shadow', 'colibri-wp' ),
    'horizontal'                  => __( 'Horizontal', 'colibri-wp' ),
    'vertical'                    => __( 'Vertical', 'colibri-wp' ),
    'spread'                      => __( 'Spread', 'colibri-wp' ),
    'blur'                        => __( 'Blur', 'colibri-wp' ),
    'frame_options'               => __( 'Frame options', 'colibri-wp' ),
    'type'                        => __( 'Type', 'colibri-wp' ),
    'border'                      => __( 'Border', 'colibri-wp' ),
    'width'                       => __( 'Width', 'colibri-wp' ),
    'height'                      => __( 'Height', 'colibri-wp' ),
    'offset'                      => __( 'Offset', 'colibri-wp' ),
    'offset_left'                 => __( 'Offset left', 'colibri-wp' ),
    'offset_top'                  => __( 'Offset top', 'colibri-wp' ),
    'frame_thickness'             => __( 'Frame thickness', 'colibri-wp' ),
    'frame_over_image'            => __( 'Show frame over image', 'colibri-wp' ),
    'frame_shadow'                => __( 'Show frame shadow', 'colibri-wp' ),

    //top bar
    "information_fields"          => __( "Information Fields", 'colibri-wp' ),
    "social_icons"                => __( "Social Icons", 'colibri-wp' ),
    "content_type"                => __( "Content Type", 'colibri-wp' ),
    "field_n"                     => __( "Field %s", 'colibri-wp' ),
    "add_field"                   => __( "Add Field", 'colibri-wp' ),
    "icon_n"                      => __( "Icon %s", 'colibri-wp' ),
    "add_item"                    => __( "Add Item", 'colibri-wp' ),
    "add_icon"                    => __( "Add Icon", 'colibri-wp' ),
    "icon"                        => __( "Icon", 'colibri-wp' ),
    "text"                        => __( "Text", 'colibri-wp' ),

    // nav bar
    "stick_to_top"                => __( "Stick on scroll", 'colibri-wp' ),
    "show_top_bar"                => __( "Show top bar", 'colibri-wp' ),
    "boxed"                       => __( "Boxed", 'colibri-wp' ),
    "container_width"             => __( "Container width", 'colibri-wp' ),
    "full_width"                  => __( "Full width", 'colibri-wp' ),
    "transparent_nav"             => __( "Transparent nav", 'colibri-wp' ),
    "button_align"                => __( "Button align", 'colibri-wp' ),

    //logo
    "layout_type"                 => __( "Layout type", 'colibri-wp' ),
    "alternate_logo_image"        => __( "Alternate logo image", 'colibri-wp' ),
    "navigation_padding"          => __( "Navigation padding", 'colibri-wp' ),
    'logo'                        => __( 'Logo', 'colibri-wp' ),

    'logo_image_only'        => __( 'Logo image only', 'colibri-wp' ),
    'site_title_text_only'   => __( 'Site title text only', 'colibri-wp' ),
    'image_with_text_below'  => __( 'Image with text below', 'colibri-wp' ),
    'image_with_text_right'  => __( 'Image with text on the right', 'colibri-wp' ),
    'image_with_text_above'  => __( 'Image with text above', 'colibri-wp' ),
    'image_with_text_left'   => __( 'Image with text on the left', 'colibri-wp' ),

    // menu
    'menu'                   => __( 'Menu', 'colibri-wp' ),
    'no_menu'                => __( '- No menu -', 'colibri-wp' ),
    'edit_menu_structure'    => __( 'Edit Menu Structure', 'colibri-wp' ),
    'show_offscreen_menu_on' => __( 'Show offscreen menu on', 'colibri-wp' ),
    'mobile'                 => __( 'Mobile', 'colibri-wp' ),
    'mobile_tablet'          => __( 'Mobile and tablet', 'colibri-wp' ),
    'mobile_tablet_desktop'  => __( 'Mobile, tablet and desktop', 'colibri-wp' ),
    'button_highlight_type'  => __( 'Button highlight type', 'colibri-wp' ),
    'button_hover_effect'    => __( 'Button hover effect', 'colibri-wp' ),

    //menu style
    'bottom_line'            => __( 'Bottom line', 'colibri-wp' ),
    'top_line'               => __( 'Top line', 'colibri-wp' ),
    'double_line'            => __( 'Double line', 'colibri-wp' ),
    'background'             => __( 'Background', 'colibri-wp' ),

    'drop_in'          => __( 'Drop in', 'colibri-wp' ),
    'drop_out'         => __( 'Drop out', 'colibri-wp' ),
    'grow_from_left'   => __( 'Grow from left', 'colibri-wp' ),
    'grow_from_right'  => __( 'Grow from right', 'colibri-wp' ),
    'grow_from_center' => __( 'Grow from center', 'colibri-wp' ),

    'grow_up'                => __( 'Grow up', 'colibri-wp' ),
    'grow_down'              => __( 'Grow down', 'colibri-wp' ),
    'grow_left'              => __( 'Grow left', 'colibri-wp' ),
    'grow_right'             => __( 'Grow right', 'colibri-wp' ),
    'shutter_in_horizontal'  => __( 'Shutter in horizontal', 'colibri-wp' ),
    'shutter_out_horizontal' => __( 'Shutter out horizontal', 'colibri-wp' ),
    'shutter_in_vertical'    => __( 'Shutter in vertical', 'colibri-wp' ),
    'shutter_out_vertical'   => __( 'Shutter out vertical', 'colibri-wp' ),

    //navbar
    'logo_nav'               => __( 'Logo / Nav', 'colibri-wp' ),//logo /nav
    'logo_above'             => __( 'Logo above', 'colibri-wp' ),//logo above

    // frontend

    "read_more" => __( 'Read More', 'colibri-wp' ),

    //footer

    "footer_parallax" => __( 'Use footer parallax', 'colibri-wp' ),

    //plugin

    "plugin_message"            => __( 'To enable all the theme features, please install %s plugin',
        'colibri-wp' ),
    "install_with_placeholder"  => __( 'Install %s', 'colibri-wp' ),
    "activate_with_placeholder" => __( 'Activate %s', 'colibri-wp' ),

    //blog

    "posts_per_row"                           => __( 'Posts per row', 'colibri-wp' ),
    "show_blog_sidebar"                       => __( 'Show blog sidebar ', 'colibri-wp' ),
    "enable_masonry"                          => __( 'Enable masonry', 'colibri-wp' ),
    "show_thumbnail_placeholder"              => __( 'Show thumbnail placeholder', 'colibri-wp' ),
    "thumbnail_placeholder_color"             => __( 'Thumbnail placeholder color', 'colibri-wp' ),

    // admin
    "theme_page_name"                         => __( 'Colibri Settings', 'colibri-wp' ),
    "or"                                      => __( 'or', 'colibri-wp' ),
    "get_started"                             => __( 'Get Started', 'colibri-wp' ),
    "get_started_section_1_title"             => __( 'Recommended plugins', 'colibri-wp' ),
    "get_started_section_2_title"             => __( 'Links to Customizer Settings', 'colibri-wp' ),
    "get_started_set_logo"                    => __( 'Set your logo', 'colibri-wp' ),
    "get_started_change_hero_image"           => __( 'Change the hero image', 'colibri-wp' ),
    "get_started_change_customize_navigation" => __( 'Customize navigation', 'colibri-wp' ),
    "get_started_change_customize_hero"       => __( 'Customize frontpage hero', 'colibri-wp' ),
    "get_started_customize_footer"            => __( 'Customize footer', 'colibri-wp' ),
    "get_started_change_color_settings"       => __( 'Change color settings', 'colibri-wp' ),
    "get_started_customize_fonts"             => __( 'Customize fonts', 'colibri-wp' ),
    "get_started_set_menu_links"              => __( 'Customize menu', 'colibri-wp' ),
    "customize"                               => __( 'Customize', 'colibri-wp' ),
    "welcome_message"                         => __( 'Welcome to %s', 'colibri-wp' ),
    "start_with_a_front_page"                 => __( 'Choose one of the Colibri predefined designs', 'colibri-wp' ),
    "start_with_selected_page"                => __( 'Start with selected design', 'colibri-wp' ),
    "check_all_demo_sites_page"               => __( 'Check all demo sites page', 'colibri-wp' ),
    "admin_sidebar_documentation_title"       => __( 'Documentation', 'colibri-wp' ),
    "admin_sidebar_documentation_description" => __( 'Colibri is easy to learn and master, but you can always check out our documentation to check out features you might have missed.',
        'colibri-wp' ),
    "admin_sidebar_documentation_action"      => __( 'Check documentation', 'colibri-wp' ),
    "admin_sidebar_support_title"             => __( 'Support', 'colibri-wp' ),
    "admin_sidebar_support_description"       => __( 'Our technical team is here to help you build an awesome website. We usually answer support issues in less than 1 business day.',
        'colibri-wp' ),
    "admin_sidebar_support_action"            => __( 'Open a support ticket', 'colibri-wp' ),
	"admin_sidebar_review_title"              => __( 'Leave a Review', 'colibri-wp' ),
	"admin_sidebar_review_description"        => __( 'We strive to provide our customers with the best service in our industry, so your feedback is very important to us. We would greatly appreciate it if you would take a few minutes to share your experience with us via this survey.',
		'colibri-wp' ),
	"admin_sidebar_review_action"             => __( 'Leave a review', 'colibri-wp' ),
    "contact_form_plugin_description"         => sprintf(
        __( '%1$s plugin is recommended for the %2$s contact section.', 'colibri-wp' ),
        'Forminator',
        'Colibri Page Builder'
    ),
    "page_builder_plugin_description"         => sprintf(
        __( '%1$s plugin adds drag and drop functionality and many other features to the %2$s theme.', 'colibri-wp' ),
        'Colibri Page Builder',
        'ColibriWP'
    ),
    'activate'                                => __( 'Activate', 'colibri-wp' ),
    'install'                                 => __( 'Install', 'colibri-wp' ),
    'installing'                              => __( 'Installing %s', 'colibri-wp' ),
    'activating'                              => __( 'Activating %s', 'colibri-wp' ),
    'plugin_installed_and_active'             => __( 'Active', 'colibri-wp' ),
    'skip_to_content'                         => __( 'Skip to content', 'colibri-wp' ),
    'change_header_design'                    => __( 'Choose header design', 'colibri-wp' ),
    'change_footer_design'                    => __( 'Choose footer design', 'colibri-wp' ),
    'add_section'                             => __( 'Add Predefined Section', 'colibri-wp' ),
    'start_with_a_front_page_plugin_info'     => __( 'These actions will also install Colibri Page Builder plugin.',
        'colibri-wp' ),

    'undefined_sanitize_function_for_control'     => __( 'Undefined sanitize function for control "%s"',
        'colibri-wp' ),
);
composer.json000064400000000511151335104360007264 0ustar00{
  "name": "colibriwp/colibri-theme",
  "license": "GPL",
  "authors": [
    {
      "name": "ColibriWP",
      "email": "support@colibriwp.com"
    }
  ],
  "autoload": {
    "psr-4": {
      "ColibriWP\\Theme\\": "src/"
    },
    "files": [
      "template-functions.php"
    ]
  },
  "require": {
    "php": ">=5.6.0"
  }
}
defaults.php000064400000203520151335104360007067 0ustar00<?php


$colibriwp_theme_svg_icons = array(
    'fort-awesome'  => array(
        "name"    => "font-awesome/fort-awesome",
        "content" => "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" id=\"fort-awesome\" viewBox=\"0 0 1792 1896.0833\"><path d=\"M640 1008V784q0-16-16-16h-96q-16 0-16 16v224q0 16 16 16h96q16 0 16-16zm512 0V784q0-16-16-16h-96q-16 0-16 16v224q0 16 16 16h96q16 0 16-16zm512 32v752h-640v-320q0-80-56-136t-136-56-136 56-56 136v320H0v-752q0-16 16-16h96q16 0 16 16v112h128V528q0-16 16-16h96q16 0 16 16v112h128V528q0-16 16-16h96q16 0 16 16v112h128V528q0-6 2.5-9.5t8.5-5 9.5-2 11.5 0 9 .5V121q-32-15-32-50 0-23 16.5-39T832 16t38.5 16T887 71q0 35-32 50v17q45-10 83-10 21 0 59.5 7.5t54.5 7.5q17 0 47-7.5t37-7.5q16 0 16 16v210q0 15-35 21.5t-62 6.5q-18 0-54.5-7.5T945 367q-40 0-90 12v133q1 0 9-.5t11.5 0 9.5 2 8.5 5 2.5 9.5v112h128V528q0-16 16-16h96q16 0 16 16v112h128V528q0-16 16-16h96q16 0 16 16v624h128v-112q0-16 16-16h96q16 0 16 16z\"/></svg>",
    ),
    'phone'         => array(
        'name'    => 'font-awesome/phone',
        'content' => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="phone" viewBox="0 0 1408 1896.0833"><path d="M1408 1240q0 27-10 70.5t-21 68.5q-21 50-122 106-94 51-186 51-27 0-53-3.5t-57.5-12.5-47-14.5T856 1485t-49-18q-98-35-175-83-127-79-264-216T152 904q-48-77-83-175-3-9-18-49t-20.5-55.5-14.5-47T3.5 520 0 467q0-92 51-186 56-101 106-122 25-11 68.5-21t70.5-10q14 0 21 3 18 6 53 76 11 19 30 54t35 63.5 31 53.5q3 4 17.5 25t21.5 35.5 7 28.5q0 20-28.5 50t-62 55-62 53-28.5 46q0 9 5 22.5t8.5 20.5 14 24 11.5 19q76 137 174 235t235 174q2 1 19 11.5t24 14 20.5 8.5 22.5 5q18 0 46-28.5t53-62 55-62 50-28.5q14 0 28.5 7t35.5 21.5 25 17.5q25 15 53.5 31t63.5 35 54 30q70 35 76 53 3 7 3 21z"/></svg>',
    ),
    'phone-square'  => array(
        'name'    => 'font-awesome/phone-square',
        'content' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="phone-square" viewBox="0 0 1536 1896.0833"><path d="M1280 1193q0-11-2-16t-18-16.5-40.5-25-47.5-26.5-45.5-25-28.5-15q-5-3-19-13t-25-15-21-5q-15 0-36.5 20.5t-39.5 45-38.5 45T885 1167q-7 0-16.5-3.5T853 1157t-17-9.5-14-8.5q-99-55-170-126.5T525 842q-2-3-8.5-14t-9.5-17-6.5-15.5T497 779q0-13 20.5-33.5t45-38.5 45-39.5T628 631q0-10-5-21t-15-25-13-19q-3-6-15-28.5T555 492t-26.5-47.5-25-40.5-16.5-18-16-2q-48 0-101 22-46 21-80 94.5T256 631q0 16 2.5 34t5 30.5 9 33 10 29.5 12.5 33 11 30q60 164 216.5 320.5T843 1358q6 2 30 11t33 12.5 29.5 10 33 9 30.5 5 34 2.5q57 0 130.5-34t94.5-80q22-53 22-101zm256-777v960q0 119-84.5 203.5T1248 1664H288q-119 0-203.5-84.5T0 1376V416q0-119 84.5-203.5T288 128h960q119 0 203.5 84.5T1536 416z"></path></svg>',
    ),
    'map'           => array(
        'name'    => 'font-awesome/map-o',
        'content' => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="map-o" viewBox="0 0 2048 1896.0833"><path d="M2020 11q28 20 28 53v1408q0 20-11 36t-29 23l-640 256q-24 11-48 0l-616-246-616 246q-10 5-24 5-19 0-36-11-28-20-28-53V320q0-20 11-36t29-23L680 5q24-11 48 0l616 246L1960 5q32-13 60 6zM736 146v1270l576 230V376zM128 363v1270l544-217V146zm1792 1066V159l-544 217v1270z"/></svg>',
    ),
    'map-marker'    => array(
        'name'    => 'font-awesome/map-marker',
        'content' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="map-marker" viewBox="0 0 1049.8953 1896.0833"><path d="M768 640q0-106-75-181t-181-75-181 75-75 181 75 181 181 75 181-75 75-181zm256 0q0 109-33 179l-364 774q-16 33-47.5 52t-67.5 19-67.5-19-46.5-52L33 819Q0 749 0 640q0-212 150-362t362-150 362 150 150 362z"></path></svg>',
    ),
    'envelope-open' => array(
        'name'    => 'font-awesome/envelope-open-o',
        'content' => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="envelope-open-o" viewBox="0 0 1792 1896.0833"><path d="M1474 913l39 51q8 11 6.5 23.5T1508 1008q-43 34-126.5 98.5t-146.5 113-67 51.5q-39 32-60 48t-60.5 41-76.5 36.5-74 11.5h-2q-37 0-74-11.5t-76-36.5-61-41.5-60-47.5q-5-4-65-50.5t-143.5-111T293 1015q-11-8-12.5-20.5T287 971l37-52q8-11 21.5-13t24.5 7q94 73 306 236 5 4 43.5 35t60.5 46.5 56.5 32.5 58.5 17h2q24 0 58.5-17t56.5-32.5 60.5-46.5 43.5-35q258-198 313-242 11-8 24-6.5t21 12.5zm190 719V704q-90-83-159-139-91-74-389-304-3-2-43-35t-61-48-56-32.5-59-17.5h-2q-24 0-59 17.5T780 178t-61 48-43 35Q461 427 360.5 506.5T231 610.5 149 685q-14 12-21 19v928q0 13 9.5 22.5t22.5 9.5h1472q13 0 22.5-9.5t9.5-22.5zm128-928v928q0 66-47 113t-113 47H160q-66 0-113-47T0 1632V704q0-56 41-94 123-114 350-290.5T624 138q36-30 59-47.5t61.5-42 76-36.5T895 0h2q37 0 74.5 12t76 36.5 61.5 42 59 47.5q43 36 156 122t226 177 201 173q41 38 41 94z"/></svg>',
    ),
    'envelope'      => array(
        'name'    => 'font-awesome/envelope-open-o',
        'content' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="envelope" viewBox="0 0 1792 1896.0833"><path d="M1792 710v794q0 66-47 113t-113 47H160q-66 0-113-47T0 1504V710q44 49 101 87 362 246 497 345 57 42 92.5 65.5t94.5 48 110 24.5h2q51 0 110-24.5t94.5-48 92.5-65.5q170-123 498-345 57-39 100-87zm0-294q0 79-49 151t-122 123q-376 261-468 325-10 7-42.5 30.5t-54 38-52 32.5-57.5 27-50 9h-2q-23 0-50-9t-57.5-27-52-32.5-54-38T639 1015q-91-64-262-182.5T172 690q-62-42-117-115.5T0 438q0-78 41.5-130T160 256h1472q65 0 112.5 47t47.5 113z"></path></svg>',
    ),
    'facebook'      => array(
        'name'    => 'font-awesome/facebook-square',
        'content' => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="facebook-square" viewBox="0 0 1536 1896.0833"><path d="M1248 128q119 0 203.5 84.5T1536 416v960q0 119-84.5 203.5T1248 1664h-188v-595h199l30-232h-229V689q0-56 23.5-84t91.5-28l122-1V369q-63-9-178-9-136 0-217.5 80T820 666v171H620v232h200v595H288q-119 0-203.5-84.5T0 1376V416q0-119 84.5-203.5T288 128h960z"/></svg>',
    ),
    'twitter'       => array(
        'name'    => 'font-awesome/twitter-square',
        'content' => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="twitter-square" viewBox="0 0 1536 1896.0833"><path d="M1280 610q-56 25-121 34 68-40 93-117-65 38-134 51-61-66-153-66-87 0-148.5 61.5T755 722q0 29 5 48-129-7-242-65T326 550q-29 50-29 106 0 114 91 175-47-1-100-26v2q0 75 50 133.5t123 72.5q-29 8-51 8-13 0-39-4 21 63 74.5 104t121.5 42q-116 90-261 90-26 0-50-3 148 94 322 94 112 0 210-35.5t168-95 120.5-137 75-162T1176 746q0-18-1-27 63-45 105-109zm256-194v960q0 119-84.5 203.5T1248 1664H288q-119 0-203.5-84.5T0 1376V416q0-119 84.5-203.5T288 128h960q119 0 203.5 84.5T1536 416z"/></svg>',
    ),
    'youtube'       => array(
        'name'    => 'font-awesome/youtube-square',
        'content' => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="youtube-square" viewBox="0 0 1536 1896.0833">                                <path d="M919 1303v-157q0-50-29-50-17 0-33 16v224q16 16 33 16 29 0 29-49zm184-122h66v-34q0-51-33-51t-33 51v34zM532 915v70h-80v423h-74V985h-78v-70h232zm201 126v367h-67v-40q-39 45-76 45-33 0-42-28-6-17-6-54v-290h66v270q0 24 1 26 1 15 15 15 20 0 42-31v-280h67zm252 111v146q0 52-7 73-12 42-53 42-35 0-68-41v36h-67V915h67v161q32-40 68-40 41 0 53 42 7 21 7 74zm251 129v9q0 29-2 43-3 22-15 40-27 40-80 40-52 0-81-38-21-27-21-86v-129q0-59 20-86 29-38 80-38t78 38q21 29 21 86v76h-133v65q0 51 34 51 24 0 30-26 0-1 .5-7t.5-16.5V1281h68zM785 457v156q0 51-32 51t-32-51V457q0-52 32-52t32 52zm533 713q0-177-19-260-10-44-43-73.5t-76-34.5q-136-15-412-15-275 0-411 15-44 5-76.5 34.5T238 910q-20 87-20 260 0 176 20 260 10 43 42.5 73t75.5 35q137 15 412 15t412-15q43-5 75.5-35t42.5-73q20-84 20-260zM563 519l90-296h-75l-51 195-53-195h-78q7 23 23 69l24 69q35 103 46 158v201h74V519zm289 81V470q0-58-21-87-29-38-78-38-51 0-78 38-21 29-21 87v130q0 58 21 87 27 38 78 38 49 0 78-38 21-27 21-87zm181 120h67V350h-67v283q-22 31-42 31-15 0-16-16-1-2-1-26V350h-67v293q0 37 6 55 11 27 43 27 36 0 77-45v40zm503-304v960q0 119-84.5 203.5T1248 1664H288q-119 0-203.5-84.5T0 1376V416q0-119 84.5-203.5T288 128h960q119 0 203.5 84.5T1536 416z"></path></svg>',
    ),
    'vimeo'         => array(
        'name'    => 'font-awesome/vimeo-square',
        'content' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="vimeo-square" viewBox="0 0 1536 1896.0833">                                <path d="M1292 638q10-216-161-222-231-8-312 261 44-19 82-19 85 0 74 96-4 57-74 167t-105 110q-43 0-82-169-13-54-45-255-30-189-160-177-59 7-164 100l-81 72-81 72 52 67q76-52 87-52 57 0 107 179 15 55 45 164.5t45 164.5q68 179 164 179 157 0 383-294 220-283 226-444zm244-222v960q0 119-84.5 203.5T1248 1664H288q-119 0-203.5-84.5T0 1376V416q0-119 84.5-203.5T288 128h960q119 0 203.5 84.5T1536 416z"></path></svg>',
    ),
    'pinterest'     => array(
        'name'    => 'font-awesome/pinterest-square',
        'content' => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="pinterest-square" viewBox="0 0 1536 1896.0833"><path d="M1248 128q119 0 203.5 84.5T1536 416v960q0 119-84.5 203.5T1248 1664H523q85-122 108-210 9-34 53-209 21 39 73.5 67t112.5 28q181 0 295.5-147.5T1280 819q0-84-35-162.5t-96.5-139-152.5-97T799 384q-104 0-194.5 28.5t-153 76.5T344 598.5t-66.5 128T256 859q0 102 39.5 180T412 1149q13 5 23.5 0t14.5-19q10-44 15-61 6-23-11-42-50-62-50-150 0-150 103.5-256.5T778 514q149 0 232.5 81t83.5 210q0 168-67.5 286T853 1209q-60 0-97-43.5T733 1062q8-34 26.5-92.5t29.5-102 11-74.5q0-49-26.5-81.5T698 679q-61 0-103.5 56.5T552 875q0 72 24 121l-98 414q-24 100-7 254H288q-119 0-203.5-84.5T0 1376V416q0-119 84.5-203.5T288 128h960z"/></svg>',
    ),
    'behance'       => array(
        'name'    => 'font-awesome/behance-square',
        'content' => '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="behance-square" viewBox="0 0 1536 1896.0833"><path d="M1248 128q119 0 203.5 84.5T1536 416v960q0 119-84.5 203.5T1248 1664H288q-119 0-203.5-84.5T0 1376V416q0-119 84.5-203.5T288 128h960zM499 495H128v787h382q117 0 197-57.5t80-170.5q0-158-143-200 107-52 107-164 0-57-19.5-96.5T675 533t-79-29.5-97-8.5zm-22 318H301V629h163q119 0 119 90 0 94-106 94zm9 335H301V931h189q124 0 124 113 0 104-128 104zm650 32q-68 0-104-38t-36-107h411q1-10 1-30 0-132-74.5-220.5T1130 696q-128 0-210 86t-82 216q0 135 79 217t213 82q205 0 267-191h-138q-11 34-47.5 54t-75.5 20zm-10-366q113 0 124 122H996q4-56 39-89t91-33zM964 548h319v77H964v-77z"/></svg>',
    ),

    'logoNav'     => array(
        'name'    => 'logoNav',
        'content' => '<svg height="64" enable-background="new 0 0 67 67" viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="m66 32.5h-8c-.5 0-1 .4-1 1s.4 1 1 1h8c.5 0 1-.4 1-1s-.4-1-1-1z"/><path d="m55 32.5h-8c-.5 0-1 .4-1 1s.4 1 1 1h8c.5 0 1-.4 1-1s-.4-1-1-1z"/><path d="m44 32.5h-8c-.5 0-1 .4-1 1s.4 1 1 1h8c.5 0 1-.4 1-1s-.4-1-1-1z"/><path d="m27 25.5h-24c-1.7 0-3 1.4-3 3v10c0 1.7 1.3 3 3 3h24c1.7 0 3-1.4 3-3v-10c0-1.6-1.3-3-3-3zm2 13c0 1.1-.9 2-2 2h-24c-1.1 0-2-.9-2-2v-10c0-1.1.9-2 2-2h24c1.1 0 2 .9 2 2z"/><path d="m6.7 30.8h-1v5.7h3.5v-.8h-2.5z"/><path d="m13.4 31.1c-.4-.2-.8-.3-1.2-.3s-.9.1-1.2.3-.6.6-.8 1-.4.9-.4 1.4v.3c0 .5.1 1 .3 1.4s.5.7.8 1 .8.3 1.2.3c.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.2c0-.6-.1-1-.3-1.5s-.3-.7-.7-.9zm.1 2.7c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4z"/><path d="m24.4 31.1c-.4-.2-.8-.3-1.2-.3s-.9.1-1.2.3-.6.6-.8 1-.4.9-.4 1.4v.3c0 .5.1 1 .3 1.4s.5.7.8 1 .8.3 1.2.3c.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.2c0-.6-.1-1-.3-1.5s-.4-.7-.7-.9zm.1 2.7c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4z"/><path d="m17.7 34.3h1.2v1.1c-.2.2-.6.3-1.1.3s-.8-.2-1.1-.5-.4-.7-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5c.7 0 1.1.3 1.2 1h1c-.1-.6-.3-1-.7-1.4s-.9-.5-1.5-.5c-.7.1-1.3.4-1.7.9s-.6 1.2-.6 2v.4c0 .5.1 1 .3 1.4s.5.7.8.9.8.3 1.3.3.9-.1 1.2-.2.6-.3.9-.6v-2.1h-2.2z"/></svg>',
    ),
    'logoAbove'   => array(
        'name'    => 'logoAbove',
        'content' => '<svg height="64" enable-background="new 0 0 67 67" viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="m21.5 38h24c1.7 0 3-1.4 3-3v-10c0-1.7-1.3-3-3-3h-24c-1.7 0-3 1.4-3 3v10c0 1.6 1.3 3 3 3zm-2-13c0-1.1.9-2 2-2h24c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2h-24c-1.1 0-2-.9-2-2z"/><path d="m29.5 32.7c.4.2.8.3 1.2.3.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.2c0-.6-.1-1-.3-1.5s-.5-.7-.8-1-.8-.3-1.2-.3-.9.1-1.2.3-.6.6-.8 1-.4 1-.4 1.5v.3c0 .5.1 1 .3 1.4s.5.8.9 1zm-.2-2.7c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4v.3c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4z"/><path d="m35 32.8c.4.2.8.3 1.3.3s.9-.1 1.2-.2.6-.3.9-.6v-2.2h-2.2v.8h1.2v1.1c-.2.2-.6.3-1.1.3s-.8-.2-1.1-.5-.4-.8-.4-1.5v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5c.7 0 1.1.3 1.2 1h1c-.1-.6-.3-1-.7-1.4s-.9-.5-1.5-.5c-.7.1-1.3.4-1.7.9s-.6 1.2-.6 2v.4c0 .5.1 1 .3 1.4s.4.7.8 1z"/><path d="m40.4 32.7c.4.2.8.3 1.2.3.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.2c0-.6-.1-1-.3-1.5s-.5-.7-.8-1-.8-.3-1.2-.3-.9.1-1.2.3-.6.6-.8 1-.3 1-.3 1.5v.3c0 .5.1 1 .3 1.4s.5.8.8 1zm-.1-2.7c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4v.3c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4z"/><path d="m27.7 32.2h-2.5v-4.9h-1v5.7h3.5z"/><path d="m48.5 43h-8c-.5 0-1 .4-1 1s.4 1 1 1h8c.5 0 1-.4 1-1s-.4-1-1-1z"/><path d="m37.5 43h-8c-.5 0-1 .4-1 1s.4 1 1 1h8c.5 0 1-.4 1-1s-.4-1-1-1z"/><path d="m26.5 43h-8c-.5 0-1 .4-1 1s.4 1 1 1h8c.5 0 1-.4 1-1s-.4-1-1-1z"/></svg>',
    ),
    'logoNavCta'  => array(
        'name'    => 'logoNavCta',
        'content' => '<svg height="64" enable-background="new 0 0 67 67" viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="m44 32.5h-8c-.6 0-1 .4-1 1s.4 1 1 1h8c.6 0 1-.4 1-1s-.4-1-1-1zm-8 1v-.5z"/><path d="m55 32.5h-8c-.6 0-1 .4-1 1s.4 1 1 1h8c.6 0 1-.4 1-1s-.4-1-1-1zm-8 1v-.5z"/><path d="m65 31.5h-6c-1.1 0-2 .9-2 2s.9 2 2 2h6c1.1 0 2-.9 2-2s-.9-2-2-2zm0 3h-6c-.6 0-1-.4-1-1s.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1z"/><path d="m27 25.5h-24c-1.7 0-3 1.4-3 3v10c0 1.7 1.3 3 3 3h24c1.7 0 3-1.4 3-3v-10c0-1.6-1.3-3-3-3zm2 13c0 1.1-.9 2-2 2h-24c-1.1 0-2-.9-2-2v-10c0-1.1.9-2 2-2h24c1.1 0 2 .9 2 2z"/><path d="m6.7 30.8h-1v5.7h3.5v-.8h-2.5z"/><path d="m17.7 34.3h1.2v1.1c-.2.2-.6.3-1.1.3s-.8-.2-1.1-.5-.4-.7-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5c.7 0 1.1.3 1.2 1h1c-.1-.6-.3-1-.7-1.4s-.9-.5-1.5-.5c-.7.1-1.3.4-1.7.9s-.6 1.2-.6 2v.4c0 .5.1 1 .3 1.4s.5.7.8.9.8.3 1.3.3.9-.1 1.2-.2.6-.3.9-.6v-2.1h-2.2z"/><path d="m24.4 31.1c-.4-.2-.8-.3-1.2-.3s-.9.1-1.2.3-.6.6-.8 1-.4.9-.4 1.4v.3c0 .5.1 1 .3 1.4s.5.7.8 1 .8.3 1.2.3c.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.2c0-.6-.1-1-.3-1.5s-.4-.7-.7-.9zm.1 2.7c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4z"/><path d="m13.4 31.1c-.4-.2-.8-.3-1.2-.3s-.9.1-1.2.3-.6.6-.8 1-.4.9-.4 1.4v.3c0 .5.1 1 .3 1.4s.5.7.8 1 .8.3 1.2.3c.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.2c0-.6-.1-1-.3-1.5s-.3-.7-.7-.9zm.1 2.7c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4z"/></svg>',
    ),
    'navLogoCta'  => array(
        'name'    => 'navLogoCta',
        'content' => '<svg height="64" enable-background="new 0 0 67 67" viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="m9 32.5h-8c-.6 0-1 .4-1 1s.4 1 1 1h8c.6 0 1-.4 1-1s-.4-1-1-1zm-8 1v-.5zm19-1h-8c-.6 0-1 .4-1 1s.4 1 1 1h8c.6 0 1-.4 1-1s-.4-1-1-1zm-8 1v-.5zm53-2h-6c-1.1 0-2 .9-2 2s.9 2 2 2h6c1.1 0 2-.9 2-2s-.9-2-2-2zm0 3h-6c-.6 0-1-.4-1-1s.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1zm-14-9h-24c-1.7 0-3 1.4-3 3v10c0 1.7 1.3 3 3 3h24c1.7 0 3-1.4 3-3v-10c0-1.6-1.3-3-3-3zm2 13c0 1.1-.9 2-2 2h-24c-1.1 0-2-.9-2-2v-10c0-1.1.9-2 2-2h24c1.1 0 2 .9 2 2z"/><path d="m37.4 31.1c-.4-.2-.8-.3-1.2-.3s-.9.1-1.2.3-.6.6-.8 1-.3.9-.3 1.5v.3c0 .5.1 1 .3 1.4s.5.7.8 1 .8.3 1.2.3c.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.3c0-.6-.1-1-.3-1.5s-.4-.7-.8-.9zm.1 2.7c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4zm4.2.5h1.2v1.1c-.2.2-.6.3-1.1.3s-.8-.2-1.1-.5-.4-.8-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5c.7 0 1.1.3 1.2 1h1c-.1-.6-.3-1-.7-1.4s-.9-.5-1.5-.5c-.7 0-1.3.2-1.7.7s-.6 1.2-.6 2v.4c0 .5.1 1 .3 1.4s.5.7.8.9.8.3 1.3.3.9-.1 1.2-.2.6-.3.9-.6v-2.2h-2.2z"/><path d="m30.7 30.8h-1v5.7h3.5v-.8h-2.5z"/><path d="m48.4 31.1c-.4-.2-.8-.3-1.2-.3s-.9.1-1.2.3-.6.6-.8 1-.3.9-.3 1.5v.3c0 .5.1 1 .3 1.4s.5.7.8 1 .8.3 1.2.3c.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.3c0-.6-.1-1-.3-1.5s-.5-.7-.8-.9zm.1 2.7c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4z"/></svg>',
    ),
    'logoNavCta2' => array(
        'name'    => 'logoNavCta2',
        'content' => '<svg height="64" enable-background="new 0 0 67 67" viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="m65 28h-6c-1.1 0-2 .9-2 2s.9 2 2 2h6c1.1 0 2-.9 2-2s-.9-2-2-2zm0 3h-6c-.6 0-1-.4-1-1s.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1z"/><path d="m30 35v-10c0-1.7-1.3-3-3-3h-24c-1.7 0-3 1.4-3 3v10c0 1.7 1.3 3 3 3h24c1.7 0 3-1.4 3-3zm-1 0c0 1.1-.9 2-2 2h-24c-1.1 0-2-.9-2-2v-10c0-1.1.9-2 2-2h24c1.1 0 2 .9 2 2z"/><path d="m13.4 27.6c-.4-.2-.8-.3-1.2-.3s-.9.1-1.2.3-.6.6-.8 1-.4.9-.4 1.4v.3c0 .5.1 1 .3 1.4s.5.7.8 1 .8.3 1.2.3c.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.2c0-.6-.1-1-.3-1.5s-.3-.7-.7-.9zm.1 2.7c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4z"/><path d="m17.7 30.8h1.2v1.1c-.2.2-.6.3-1.1.3s-.8-.2-1.1-.5-.4-.7-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5c.7 0 1.1.3 1.2 1h1c-.1-.6-.3-1-.7-1.4s-.9-.5-1.5-.5c-.7.1-1.3.4-1.7.9s-.6 1.2-.6 2v.4c0 .5.1 1 .3 1.4s.5.7.8.9.8.3 1.3.3.9-.1 1.2-.2.6-.3.9-.6v-2.1h-2.2z"/><path d="m6.7 27.3h-1v5.7h3.5v-.8h-2.5z"/><path d="m24.4 27.6c-.4-.2-.8-.3-1.2-.3s-.9.1-1.2.3-.6.6-.8 1-.4.9-.4 1.4v.3c0 .5.1 1 .3 1.4s.5.7.8 1 .8.3 1.2.3c.5 0 .9-.1 1.2-.3s.6-.5.8-1 .3-.9.3-1.5v-.2c0-.6-.1-1-.3-1.5s-.4-.7-.7-.9zm.1 2.7c0 .6-.1 1.1-.4 1.5s-.6.5-1 .5-.8-.2-1-.5-.4-.8-.4-1.4v-.4c0-.6.1-1.1.4-1.4s.6-.5 1-.5.8.2 1 .5.4.8.4 1.4z"/><path d="m48 43h-8c-.5 0-1 .4-1 1s.4 1 1 1h8c.5 0 1-.4 1-1s-.4-1-1-1z"/><path d="m37 43h-8c-.5 0-1 .4-1 1s.4 1 1 1h8c.5 0 1-.4 1-1s-.4-1-1-1z"/><path d="m26 43h-8c-.5 0-1 .4-1 1s.4 1 1 1h8c.5 0 1-.4 1-1s-.4-1-1-1z"/></svg>',
    ),
    'customLogo'  => array(
        'name'    => 'customLogo',
        'content' => '<svg height="14" enable-background="new 0 0 41 9" viewBox="0 0 41 9" xmlns="http://www.w3.org/2000/svg"><path d="m17.8 4.5c-.3-.2-.8-.4-1.3-.6s-1-.3-1.2-.5-.3-.4-.3-.6c0-.3.1-.6.3-.7s.5-.3.9-.3.8.1 1 .3.3.5.3.9h1.2c0-.4-.1-.8-.3-1.1s-.4-.7-.8-.8-.8-.3-1.3-.3c-.7 0-1.4.2-1.8.6-.5.4-.7.8-.7 1.4 0 .7.3 1.2 1 1.6.3.2.8.4 1.4.6s1 .3 1.2.5.3.4.3.7-.1.5-.3.7-.5.3-1 .3-.9-.1-1.1-.3-.4-.5-.4-.9h-1.2c0 .4.1.8.4 1.2s.6.6 1 .8.9.3 1.4.3c.8 0 1.4-.2 1.8-.5s.7-.8.7-1.4c0-.4-.1-.7-.2-1s-.6-.7-1-.9z"/><path d="m11.3 5.6c0 1-.5 1.5-1.4 1.5-.5 0-.8-.1-1.1-.4s-.3-.6-.3-1.1v-4.7h-1.3v4.7c0 .8.3 1.4.8 1.8s1.1.7 1.9.7 1.4-.2 1.9-.7.7-1 .7-1.8v-4.7h-1.2z"/><path d="m2.3 2.4c.3-.4.7-.6 1.2-.6s.8.1 1.1.3.4.6.4 1.1h1.2c0-.7-.3-1.3-.8-1.8s-1.1-.6-1.9-.6c-.6 0-1.1.1-1.5.4s-.8.7-1 1.2-.4 1.1-.4 1.8v.7c0 .7.1 1.2.4 1.7s.6.9 1 1.1.9.4 1.5.4c.8 0 1.5-.2 1.9-.6s.8-1 .8-1.8h-1.2c-.1.5-.2.9-.5 1.1s-.6.3-1 .3c-.5 0-.9-.2-1.2-.6s-.4-1-.4-1.8v-.6c-.1-.8.1-1.3.4-1.7z"/><path d="m38.6.9-2.1 5.4-2-5.4h-1.6v7.1h1.2v-2.3l-.1-3.2 2.1 5.5h.9l2.1-5.5-.2 3.2v2.3h1.3v-7.1z"/><path d="m19.4 1.9h2.2v6.1h1.2v-6.1h2.2v-1h-5.6z"/><path d="m30.2 1.2c-.4-.3-1-.4-1.5-.4s-1.1.1-1.5.4-.8.7-1 1.2-.4 1.1-.4 1.8v.4c0 .7.1 1.3.4 1.8s.6.9 1 1.2 1 .4 1.5.4c.6 0 1.1-.1 1.5-.4s.8-.7 1-1.2.4-1.1.4-1.8v-.4c0-.7-.1-1.3-.4-1.8s-.5-.9-1-1.2zm.2 3.4c0 .8-.1 1.4-.4 1.8s-.7.6-1.3.6c-.5 0-1-.2-1.3-.6s-.4-1-.4-1.8v-.4c0-.8.2-1.4.5-1.8s.7-.6 1.3-.6c.5 0 1 .2 1.3.6s.4 1 .4 1.8v.4z"/></svg>',
    ),

    'textWithMediaBelow'   => array(
        'name'    => 'textWithMediaBelow',
        'content' => '<svg height="42" enable-background="new 0 0 50 50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"><path d="m30.27 13.2h-10.94c-.43 0-.78.35-.78.78s.35.78.78.78h10.94c.43 0 .78-.35.78-.78s-.35-.78-.78-.78z"/><path d="m31.83 10.08h-14.06c-.43 0-.78.35-.78.78s.35.78.78.78h14.06c.43 0 .78-.35.78-.78s-.35-.78-.78-.78z"/><path d="m31.83 3.83h-14.06c-.43 0-.78.35-.78.78s.35.78.78.78h14.06c.43 0 .78-.35.78-.78s-.35-.78-.78-.78z"/><path d="m30.27 8.52c.43 0 .78-.35.78-.78s-.35-.78-.78-.78h-10.94c-.43 0-.78.35-.78.78s.35.78.78.78z"/><path d="m35.08 18.23h-20.57c-1.66 0-3 1.35-3 3.01v22.11c0 1.67 1.34 3.01 3 3.01h20.57c1.66 0 3-1.35 3-3.01v-22.11c0-1.67-1.34-3.01-3-3.01zm1 25.12c0 .56-.45 1.01-1 1.01h-20.57c-.56 0-1-.44-1-1.01v-22.11c0-.56.45-1.01 1-1.01h20.57c.56 0 1 .44 1 1.01z"/><path d="m33.03 39.29h-16.47c-.2 0-.36.18-.36.41s.16.41.36.41h16.47c.2 0 .36-.18.36-.41s-.16-.41-.36-.41z"/><path d="m20.38 28.6c1.11 0 2.03-.93 2.03-2.06s-.91-2.06-2.03-2.06-2.03.93-2.03 2.06.91 2.06 2.03 2.06zm0-3.29c.68 0 1.22.55 1.22 1.23s-.54 1.23-1.22 1.23-1.22-.55-1.22-1.23.54-1.23 1.22-1.23z"/><path d="m30.06 29.81c-.24-.29-.55-.39-.85-.39-.29 0-.54.17-.73.39l-4.29 5.18c-.19.24-.39.22-.57 0l-2.15-2.67c-.21-.27-.49-.43-.79-.43s-.58.17-.8.45l-3.57 4.6c-.34.39.19 1 .53.56l3.57-4.6c.25-.34.45-.13.56.01l2.15 2.67c.21.27.49.42.79.42s.57-.15.79-.42l4.29-5.18c.22-.26.44-.13.57 0l3.21 3.81c.34.41.86-.2.51-.59z"/></svg>',
    ),
    'customMedia'          => array(
        'name'    => 'customMedia',
        'content' => '<svg height="14" enable-background="new 0 0 41 9" viewBox="0 0 41 9" xmlns="http://www.w3.org/2000/svg"><path d="m17.8 4.5c-.3-.2-.8-.4-1.3-.6s-1-.3-1.2-.5-.3-.4-.3-.6c0-.3.1-.6.3-.7s.5-.3.9-.3.8.1 1 .3.3.5.3.9h1.2c0-.4-.1-.8-.3-1.1s-.4-.7-.8-.8-.8-.3-1.3-.3c-.7 0-1.4.2-1.8.6-.5.4-.7.8-.7 1.4 0 .7.3 1.2 1 1.6.3.2.8.4 1.4.6s1 .3 1.2.5.3.4.3.7-.1.5-.3.7-.5.3-1 .3-.9-.1-1.1-.3-.4-.5-.4-.9h-1.2c0 .4.1.8.4 1.2s.6.6 1 .8.9.3 1.4.3c.8 0 1.4-.2 1.8-.5s.7-.8.7-1.4c0-.4-.1-.7-.2-1s-.6-.7-1-.9z"/><path d="m11.3 5.6c0 1-.5 1.5-1.4 1.5-.5 0-.8-.1-1.1-.4s-.3-.6-.3-1.1v-4.7h-1.3v4.7c0 .8.3 1.4.8 1.8s1.1.7 1.9.7 1.4-.2 1.9-.7.7-1 .7-1.8v-4.7h-1.2z"/><path d="m2.3 2.4c.3-.4.7-.6 1.2-.6s.8.1 1.1.3.4.6.4 1.1h1.2c0-.7-.3-1.3-.8-1.8s-1.1-.6-1.9-.6c-.6 0-1.1.1-1.5.4s-.8.7-1 1.2-.4 1.1-.4 1.8v.7c0 .7.1 1.2.4 1.7s.6.9 1 1.1.9.4 1.5.4c.8 0 1.5-.2 1.9-.6s.8-1 .8-1.8h-1.2c-.1.5-.2.9-.5 1.1s-.6.3-1 .3c-.5 0-.9-.2-1.2-.6s-.4-1-.4-1.8v-.6c-.1-.8.1-1.3.4-1.7z"/><path d="m38.6.9-2.1 5.4-2-5.4h-1.6v7.1h1.2v-2.3l-.1-3.2 2.1 5.5h.9l2.1-5.5-.2 3.2v2.3h1.3v-7.1z"/><path d="m19.4 1.9h2.2v6.1h1.2v-6.1h2.2v-1h-5.6z"/><path d="m30.2 1.2c-.4-.3-1-.4-1.5-.4s-1.1.1-1.5.4-.8.7-1 1.2-.4 1.1-.4 1.8v.4c0 .7.1 1.3.4 1.8s.6.9 1 1.2 1 .4 1.5.4c.6 0 1.1-.1 1.5-.4s.8-.7 1-1.2.4-1.1.4-1.8v-.4c0-.7-.1-1.3-.4-1.8s-.5-.9-1-1.2zm.2 3.4c0 .8-.1 1.4-.4 1.8s-.7.6-1.3.6c-.5 0-1-.2-1.3-.6s-.4-1-.4-1.8v-.4c0-.8.2-1.4.5-1.8s.7-.6 1.3-.6c.5 0 1 .2 1.3.6s.4 1 .4 1.8v.4z"/></svg>',
    ),
    'textWithMediaOnLeft'  => array(
        'name'    => 'textWithMediaOnLeft',
        'content' => '<svg height="42" enable-background="new 0 0 50 50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"><path d="m48.84 28.91c.43 0 .78.35.78.78s-.35.78-.78.78h-10.93c-.43 0-.78-.35-.78-.78s.35-.78.78-.78z"/><path d="m48.84 25.78c.43 0 .78.35.78.78s-.35.78-.78.78h-14.06c-.43 0-.78-.35-.78-.78s.35-.78.78-.78z"/><path d="m48.84 19.53c.43 0 .78.35.78.78s-.35.78-.78.78h-14.06c-.43 0-.78-.35-.78-.78s.35-.78.78-.78z"/><path d="m48.84 22.66c.43 0 .78.35.78.78s-.35.78-.78.78h-10.93c-.43 0-.78-.35-.78-.78s.35-.78.78-.78z"/><path d="m24.5 10.94h-20.57c-1.66 0-3 1.35-3 3.01v22.11c0 1.67 1.34 3.01 3 3.01h20.57c1.66 0 3-1.35 3-3.01v-22.11c0-1.67-1.34-3.01-3-3.01zm1 25.11c0 .56-.45 1.01-1 1.01h-20.57c-.56 0-1-.44-1-1.01v-22.1c0-.56.45-1.01 1-1.01h20.57c.56 0 1 .44 1 1.01z"/><path d="m22.45 31.99h-16.47c-.2 0-.36.18-.36.41s.16.41.36.41h16.47c.2 0 .36-.18.36-.41s-.16-.41-.36-.41z"/><path d="m9.8 21.3c1.11 0 2.03-.93 2.03-2.06s-.91-2.06-2.03-2.06-2.03.93-2.03 2.06.91 2.06 2.03 2.06zm0-3.29c.68 0 1.22.55 1.22 1.23s-.54 1.23-1.22 1.23-1.22-.55-1.22-1.23.54-1.23 1.22-1.23z"/><path d="m19.48 22.52c-.24-.29-.55-.39-.85-.39-.29 0-.54.17-.73.39l-4.29 5.18c-.19.24-.39.22-.57 0l-2.15-2.67c-.21-.27-.49-.43-.79-.43s-.58.17-.8.45l-3.57 4.6c-.34.39.19 1 .53.56l3.57-4.6c.25-.34.45-.13.56.01l2.15 2.67c.21.27.49.42.79.42s.57-.15.79-.42l4.29-5.18c.22-.26.44-.13.57 0l3.21 3.81c.34.41.86-.2.51-.59z"/></svg>',
    ),
    'textWithMediaOnRight' => array(
        'name'    => 'textWithMediaOnRight',
        'content' => '<svg height="42" enable-background="new 0 0 50 50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"><path d="m15.84 28.91c.43 0 .78.35.78.78s-.35.78-.78.78h-10.93c-.43 0-.78-.35-.78-.78s.35-.78.78-.78z"/><path d="m15.84 25.78c.43 0 .78.35.78.78s-.35.78-.78.78h-14.06c-.43 0-.78-.35-.78-.78s.35-.78.78-.78z"/><path d="m15.84 19.53c.43 0 .78.35.78.78s-.35.78-.78.78h-14.06c-.43 0-.78-.35-.78-.78s.35-.78.78-.78z"/><path d="m15.84 22.66c.43 0 .78.35.78.78s-.35.78-.78.78h-10.93c-.43 0-.78-.35-.78-.78s.35-.78.78-.78z"/><path d="m46.5 10.94h-20.57c-1.66 0-3 1.35-3 3.01v22.11c0 1.67 1.34 3.01 3 3.01h20.57c1.66 0 3-1.35 3-3.01v-22.11c0-1.67-1.34-3.01-3-3.01zm1 25.11c0 .56-.45 1.01-1 1.01h-20.57c-.56 0-1-.44-1-1.01v-22.1c0-.56.45-1.01 1-1.01h20.57c.56 0 1 .44 1 1.01z"/><path d="m44.45 31.99h-16.47c-.2 0-.36.18-.36.41s.16.41.36.41h16.47c.2 0 .36-.18.36-.41s-.16-.41-.36-.41z"/><path d="m31.8 21.3c1.11 0 2.03-.93 2.03-2.06s-.91-2.06-2.03-2.06-2.03.93-2.03 2.06.91 2.06 2.03 2.06zm0-3.29c.68 0 1.22.55 1.22 1.23s-.54 1.23-1.22 1.23-1.22-.55-1.22-1.23.54-1.23 1.22-1.23z"/><path d="m41.48 22.52c-.24-.29-.55-.39-.85-.39-.29 0-.54.17-.73.39l-4.29 5.18c-.19.24-.39.22-.57 0l-2.15-2.67c-.21-.27-.49-.43-.79-.43s-.58.17-.8.45l-3.57 4.6c-.34.39.19 1 .53.56l3.57-4.6c.25-.34.45-.13.56.01l2.15 2.67c.21.27.49.42.79.42s.57-.15.79-.42l4.29-5.18c.22-.26.44-.13.57 0l3.21 3.81c.34.41.86-.2.51-.59z"/></svg>',
    ),
    'textOnly'             => array(
        'name'    => 'textOnly',
        'content' => '<svg height="42" enable-background="new 0 0 50 50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"><path d="m33.31 31.29h-16.62c-.66 0-1.19.45-1.19 1s.53 1 1.19 1h16.62c.66 0 1.19-.45 1.19-1s-.53-1-1.19-1z"/><path d="m35.8 26.43h-21.6c-.66 0-1.2.45-1.2 1s.54 1 1.2 1h21.6c.66 0 1.2-.45 1.2-1s-.54-1-1.2-1z"/><path d="m14.2 18.71h21.6c.66 0 1.2-.45 1.2-1s-.54-1-1.2-1h-21.6c-.66 0-1.2.45-1.2 1 0 .56.54 1 1.2 1z"/><path d="m16.69 21.57c-.66 0-1.19.45-1.19 1s.53 1 1.19 1h16.62c.66 0 1.19-.45 1.19-1s-.53-1-1.19-1z"/></svg>',
    ),
    'textWithMediaAbove'   => array(
        'name'    => 'textWithMediaAbove',
        'content' => '<svg height="42" enable-background="new 0 0 50 50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"><path d="m30.27 45.2h-10.94c-.43 0-.78.35-.78.78s.35.78.78.78h10.94c.43 0 .78-.35.78-.78s-.35-.78-.78-.78z"/><path d="m31.83 42.08h-14.06c-.43 0-.78.35-.78.78s.35.78.78.78h14.06c.43 0 .78-.35.78-.78s-.35-.78-.78-.78z"/><path d="m31.83 35.83h-14.06c-.43 0-.78.35-.78.78s.35.78.78.78h14.06c.43 0 .78-.35.78-.78s-.35-.78-.78-.78z"/><path d="m30.27 40.52c.43 0 .78-.35.78-.78s-.35-.78-.78-.78h-10.94c-.43 0-.78.35-.78.78s.35.78.78.78z"/><path d="m35.08 3.23h-20.57c-1.66 0-3 1.35-3 3.01v22.11c0 1.67 1.34 3.01 3 3.01h20.57c1.66 0 3-1.35 3-3.01v-22.11c0-1.67-1.34-3.01-3-3.01zm1 25.12c0 .56-.45 1.01-1 1.01h-20.57c-.56 0-1-.44-1-1.01v-22.11c0-.56.45-1.01 1-1.01h20.57c.56 0 1 .44 1 1.01z"/><path d="m33.03 24.29h-16.47c-.2 0-.36.18-.36.41s.16.41.36.41h16.47c.2 0 .36-.18.36-.41s-.16-.41-.36-.41z"/><path d="m20.38 13.6c1.11 0 2.03-.93 2.03-2.06s-.91-2.06-2.03-2.06-2.03.93-2.03 2.06.91 2.06 2.03 2.06zm0-3.29c.68 0 1.22.55 1.22 1.23s-.54 1.23-1.22 1.23-1.22-.55-1.22-1.23.54-1.23 1.22-1.23z"/><path d="m30.06 14.81c-.24-.29-.55-.39-.85-.39-.29 0-.54.17-.73.39l-4.29 5.18c-.19.24-.39.22-.57 0l-2.15-2.67c-.21-.27-.49-.43-.79-.43s-.58.17-.8.45l-3.57 4.6c-.34.39.19 1 .53.56l3.57-4.6c.25-.34.45-.13.56.01l2.15 2.67c.21.27.49.42.79.42s.57-.15.79-.42l4.29-5.18c.22-.26.44-.13.57 0l3.21 3.81c.34.41.86-.2.51-.59z"/></svg>',
    ),

);

$colibriwp_theme_divider_style = array(
    'arrow-negative'                 => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 10" preserveAspectRatio="none">	<path class="svg-white-bg" d="M360 0L350 9.9 340 0 0 0 0 10 700 10 700 0"/></svg>',
    'arrow'                          => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 10" preserveAspectRatio="none">	<path class="svg-white-bg" d="M350,10L340,0h20L350,10z"/></svg>',
    'book-negative'                  => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M806,94.7C619.5,90,500,20.3,500,1.7c-1,18.6-117.5,88.3-306,93C92,97.2,0,97.9,0,97.9v-0l0,0v2.3h1000v-2.3 C1000,97.7,920.3,97.6,806,94.7z M350,65.1L350,65.1L350,65.1L350,65.1z"/></svg>',
    'book'                           => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M194,99c186.7,0.7,305-78.3,306-97.2c1,18.9,119.3,97.9,306,97.2c114.3-0.3,194,0.3,194,0.3s0-91.7,0-100c0,0,0,0,0-0 L0,0v99.3C0,99.3,79.7,98.7,194,99z"/></svg>',
    'clouds-negative'                => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.5 27.8" preserveAspectRatio="xMidYMax slice">	<path class="svg-white-bg" d="M265.8 3.5c-10.9 0-15.9 6.2-15.9 6.2s-3.6-3.5-9.2-.9c-9.1 4.1-4.4 13.4-4.4 13.4s-1.2.2-1.9.9c-.6.7-.5 1.9-.5 1.9s-1-.5-2.3-.2c-1.3.3-1.6 1.4-1.6 1.4s.4-3.4-1.5-5c-3.9-3.4-8.3-.2-8.3-.2s-.6-.7-.9-.9c-.4-.2-1.2-.2-1.2-.2s-4.4-3.6-11.5-2.6-10.4 7.9-10.4 7.9-.5-3.3-3.9-4.9c-4.8-2.4-7.4 0-7.4 0s2.4-4.1-1.9-6.4-6.2 1.2-6.2 1.2-.9-.5-2.1-.5-2.3 1.1-2.3 1.1.1-.7-1.1-1.1c-1.2-.4-2 0-2 0s3.6-6.8-3.5-8.9c-6-1.8-7.9 2.6-8.4 4-.1-.3-.4-.7-.9-1.1-1-.7-1.3-.5-1.3-.5s1-4-1.7-5.2c-2.7-1.2-4.2 1.1-4.2 1.1s-3.1-1-5.7 1.4-2.1 5.5-2.1 5.5-.9 0-2.1.7-1.4 1.7-1.4 1.7-1.7-1.2-4.3-1.2c-2.6 0-4.5 1.2-4.5 1.2s-.7-1.5-2.8-2.4c-2.1-.9-4 0-4 0s2.6-5.9-4.7-9c-7.3-3.1-12.6 3.3-12.6 3.3s-.9 0-1.9.2c-.9.2-1.5.9-1.5.9S99.4 3 94.9 3.9c-4.5.9-5.7 5.7-5.7 5.7s-2.8-5-12.3-3.9-11.1 6-11.1 6-1.2-1.4-4-.7c-.8.2-1.3.5-1.8.9-.9-2.1-2.7-4.9-6.2-4.4-3.2.4-4 2.2-4 2.2s-.5-.7-1.2-.7h-1.4s-.5-.9-1.7-1.4-2.4 0-2.4 0-2.4-1.2-4.7 0-3.1 4.1-3.1 4.1-1.7-1.4-3.6-.7c-1.9.7-1.9 2.8-1.9 2.8s-.5-.5-1.7-.2c-1.2.2-1.4.7-1.4.7s-.7-2.3-2.8-2.8c-2.1-.5-4.3.2-4.3.2s-1.7-5-11.1-6c-3.8-.4-6.6.2-8.5 1v21.2h283.5V11.1c-.9.2-1.6.4-1.6.4s-5.2-8-16.1-8z"/></svg>',
    'clouds'                         => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.5 27.8" preserveAspectRatio="xMidYMax slice">  <path class="svg-white-bg" d="M0 0v6.7c1.9-.8 4.7-1.4 8.5-1 9.5 1.1 11.1 6 11.1 6s2.1-.7 4.3-.2c2.1.5 2.8 2.6 2.8 2.6s.2-.5 1.4-.7c1.2-.2 1.7.2 1.7.2s0-2.1 1.9-2.8c1.9-.7 3.6.7 3.6.7s.7-2.9 3.1-4.1 4.7 0 4.7 0 1.2-.5 2.4 0 1.7 1.4 1.7 1.4h1.4c.7 0 1.2.7 1.2.7s.8-1.8 4-2.2c3.5-.4 5.3 2.4 6.2 4.4.4-.4 1-.7 1.8-.9 2.8-.7 4 .7 4 .7s1.7-5 11.1-6c9.5-1.1 12.3 3.9 12.3 3.9s1.2-4.8 5.7-5.7c4.5-.9 6.8 1.8 6.8 1.8s.6-.6 1.5-.9c.9-.2 1.9-.2 1.9-.2s5.2-6.4 12.6-3.3c7.3 3.1 4.7 9 4.7 9s1.9-.9 4 0 2.8 2.4 2.8 2.4 1.9-1.2 4.5-1.2 4.3 1.2 4.3 1.2.2-1 1.4-1.7 2.1-.7 2.1-.7-.5-3.1 2.1-5.5 5.7-1.4 5.7-1.4 1.5-2.3 4.2-1.1c2.7 1.2 1.7 5.2 1.7 5.2s.3-.1 1.3.5c.5.4.8.8.9 1.1.5-1.4 2.4-5.8 8.4-4 7.1 2.1 3.5 8.9 3.5 8.9s.8-.4 2 0 1.1 1.1 1.1 1.1 1.1-1.1 2.3-1.1 2.1.5 2.1.5 1.9-3.6 6.2-1.2 1.9 6.4 1.9 6.4 2.6-2.4 7.4 0c3.4 1.7 3.9 4.9 3.9 4.9s3.3-6.9 10.4-7.9 11.5 2.6 11.5 2.6.8 0 1.2.2c.4.2.9.9.9.9s4.4-3.1 8.3.2c1.9 1.7 1.5 5 1.5 5s.3-1.1 1.6-1.4c1.3-.3 2.3.2 2.3.2s-.1-1.2.5-1.9 1.9-.9 1.9-.9-4.7-9.3 4.4-13.4c5.6-2.5 9.2.9 9.2.9s5-6.2 15.9-6.2 16.1 8.1 16.1 8.1.7-.2 1.6-.4V0H0z"/></svg>',
    'curve-asymmetrical-negative'    => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M615.2,96.7C240.2,97.8,0,18.9,0,0v100h1000V0C1000,19.2,989.8,96,615.2,96.7z"/></svg>',
    'curve-asymmetrical'             => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M0,0c0,0,0,6,0,6.7c0,18,240.2,93.6,615.2,92.6C989.8,98.5,1000,25,1000,6.7c0-0.7,0-6.7,0-6.7H0z"/></svg>',
    'curve-negative'                 => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M500,97C126.7,96.3,0.8,19.8,0,0v100l1000,0V1C1000,19.4,873.3,97.8,500,97z"/></svg>',
    'curve'                          => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">    <path class="svg-white-bg" d="M1000,4.3V0H0v4.3C0.9,23.1,126.7,99.2,500,100S1000,22.7,1000,4.3z"/></svg>',
    'drops-negative'                 => '<svg xmlns="http://www.w3.org/2000/svg" height="100%" viewBox="0 0 283.5 27.8" preserveAspectRatio="xMidYMax slice">	<path class="svg-white-bg" d="M282.7 3.4c-2 3.8-2.2 6.6-1.8 10.8.3 3.3 2 8.5.4 11.6-1.4 2.6-4 2.5-5-.2-1.2-3.4.3-7.6.5-11.1.3-4.3-2.9-6.9-7.4-5.8-3.1.7-4.1 3.3-4.3 6.2-.2 2 1.2 8-.1 9.6-3.1 4.3-2.5-4.5-2.5-5.2.1-4-.1-9.6-4.1-11.6-4.5-2.3-6.1 1-5.5 5 .2 1.4 1.5 10.2-2.7 6.9-2.5-1.9.4-7.5-.9-10.3-.8-1.8-2.6-4.2-4.8-4.1-2.4.1-2.7 2.2-4 3.7-3.3 3.8-2.2-1.2-4.8-2.7-5.5-3.1-2 5.6-2.9 7.3-1.4 2.4-3.1.6-3.3-1.3-.1-1.5.5-3.1.4-4.6-.3-4.3-2.9-5.3-5.2-1.2-3.7 6.7-2.8-1.9-6.5-.4-3 1.1-.9 9.2-.6 11.1.7 4.1-2.2 5.2-2.7.8-.4-3.6 2.8-10.2.8-13.4-2.1-3.3-6.7-.1-7.9 2.4-2.1 4.2-.4 8.7 0 13.1.2 2-.8 8.9-3.8 4.8-3.1-4.3 2.5-11.6.2-16.3-1.1-2.2-5.8-3.5-7.2-1-.8 1.4 1 3.4.3 4.8s-2.2 1.2-2.8-.3c-.8-2.1 2.2-4.8-.1-6.5-1.3-.9-3.5.3-4.9.5-2.4-.1-3.3 0-4.5 2-.7 1.2-.4 3-2.3 2.1-1.9-.8-1.7-4.3-4.1-4.9-2.1-.6-4 1.3-5.1 2.9-.9 1.4-1.3 3-1.3 4.6 0 1.9 1.4 4.2.3 6-2.4 4.2-4.2-2.2-3.8-4.4.5-2.9 2-7.7-2.7-7.5-5.2.3-6.1 5.8-6.4 9.8-.1 1.3 1.5 10.4-2 8.4-1.8-1-.5-7.5-.6-9.1-.1-3.5-1.6-8.3-6.3-7.1-7.6 1.9 2.1 18.2-4.8 18.7-3.7.3-2.3-6.2-2-8.1.5-3.1.5-11.4-5.5-8.5-2.2 1.1-1 2.3-1.3 4.3-.2 1.8-1.3 3.2-2.3.8-1.1-2.5.8-6.7-3.9-6.6-8 .1-.7 16.4-4.8 15.8-2.8-.4-1-9.3-1.3-11.3-.6-3.5-3.5-7.8-7.8-6.9-4.4.9-1.4 6.5-1.4 9.1 0 3.1-3.4 5.9-4.4 1.7-.5-2.2.9-4.4.6-6.6-.3-1.9-1.5-4.1-3.2-5.2-5.3-3.4-4.9 5.2-8.1 4.5-1.4-.3-3-8.1-6.1-4.1-.7.9 2 10.3-2.2 8-2-1.1-.1-6.7-.7-8.9-1.8-6.2-4.7 2.3-6.1 3.1-2.9 1.7-4.6-6.2-6.3-.6-.5 1.7-.4 3.7-.2 5.4.2 1.6 1.5 4.6 1 6.1-.6 1.8-1.7 1.7-2.6.3-1-1.6-.4-4.5-.2-6.2.3-2.5 2.4-8.4-.2-10.3-3.1-2.1-6.8 2.1-7.7 4.5-1.5 4.3.3 8.7.5 13 .1 3.2-3 7.5-4.3 2.4-.6-2.4.2-5.1.6-7.4.4-2.3 1.2-6-.1-8.1-1.2-1.9-5.8-2.7-7-.5-.9 1.6 1.2 5.2-.6 5.6-2.4.6-2-2.3-1.8-3.4.3-1.5 1.1-3.2-.4-4.3-1.2-.9-4.7.3-5.9.5-2.4.5-2.5 1.4-3.6 3.3-1.2 2.1-1.4 1.7-3-.1-1.3-1.5-1.7-3.6-4-3.7-1.8-.1-3.4 1.7-4.2 3-1.4 2.2-1.3 4.1-1 6.5.2 1.4 1 3.8-.5 4.9-3.9 2.9-3.2-4.6-2.9-6.3.8-3.9-.4-8.1-5.4-5.6-3.8 1.9-4.1 6.7-4.1 10.5 0 1.6 1.2 5.8-.1 6.9-.8.7-1.8.3-2.4-.5-1.1-1.5.1-6.7 0-8.5-.1-3.5-.9-6.9-4.9-7.4-3.6-.6-6.7 1.2-6.8 4.9-.1 3.9 2 8.2.6 12-.9 2.4-2.9 2.9-4.6.9-2.4-2.8-.4-9 0-12.3.4-4.2.2-7-1.8-10.8C1.1 2.8.6 2.1 0 1.4v26.4h283.5V2.2c-.3.4-.6.8-.8 1.2z"/></svg>',
    'drops'                          => '<svg xmlns="http://www.w3.org/2000/svg" height="100%" viewBox="0 0 283.5 27.8" preserveAspectRatio="xMidYMax slice">	<path class="svg-white-bg" d="M0 0v1.4c.6.7 1.1 1.4 1.4 2 2 3.8 2.2 6.6 1.8 10.8-.3 3.3-2.4 9.4 0 12.3 1.7 2 3.7 1.4 4.6-.9 1.4-3.8-.7-8.2-.6-12 .1-3.7 3.2-5.5 6.9-4.9 4 .6 4.8 4 4.9 7.4.1 1.8-1.1 7 0 8.5.6.8 1.6 1.2 2.4.5 1.4-1.1.1-5.4.1-6.9.1-3.7.3-8.6 4.1-10.5 5-2.5 6.2 1.6 5.4 5.6-.4 1.7-1 9.2 2.9 6.3 1.5-1.1.7-3.5.5-4.9-.4-2.4-.4-4.3 1-6.5.9-1.4 2.4-3.1 4.2-3 2.4.1 2.7 2.2 4 3.7 1.5 1.8 1.8 2.2 3 .1 1.1-1.9 1.2-2.8 3.6-3.3 1.3-.3 4.8-1.4 5.9-.5 1.5 1.1.6 2.8.4 4.3-.2 1.1-.6 4 1.8 3.4 1.7-.4-.3-4.1.6-5.6 1.3-2.2 5.8-1.4 7 .5 1.3 2.1.5 5.8.1 8.1s-1.2 5-.6 7.4c1.3 5.1 4.4.9 4.3-2.4-.1-4.4-2-8.8-.5-13 .9-2.4 4.6-6.6 7.7-4.5 2.7 1.8.5 7.8.2 10.3-.2 1.7-.8 4.6.2 6.2.9 1.4 2 1.5 2.6-.3.5-1.5-.9-4.5-1-6.1-.2-1.7-.4-3.7.2-5.4 1.8-5.6 3.5 2.4 6.3.6 1.4-.9 4.3-9.4 6.1-3.1.6 2.2-1.3 7.8.7 8.9 4.2 2.3 1.5-7.1 2.2-8 3.1-4 4.7 3.8 6.1 4.1 3.1.7 2.8-7.9 8.1-4.5 1.7 1.1 2.9 3.3 3.2 5.2.4 2.2-1 4.5-.6 6.6 1 4.3 4.4 1.5 4.4-1.7 0-2.7-3-8.3 1.4-9.1 4.4-.9 7.3 3.5 7.8 6.9.3 2-1.5 10.9 1.3 11.3 4.1.6-3.2-15.7 4.8-15.8 4.7-.1 2.8 4.1 3.9 6.6 1 2.4 2.1 1 2.3-.8.3-1.9-.9-3.2 1.3-4.3 5.9-2.9 5.9 5.4 5.5 8.5-.3 2-1.7 8.4 2 8.1 6.9-.5-2.8-16.9 4.8-18.7 4.7-1.2 6.1 3.6 6.3 7.1.1 1.7-1.2 8.1.6 9.1 3.5 2 1.9-7 2-8.4.2-4 1.2-9.6 6.4-9.8 4.7-.2 3.2 4.6 2.7 7.5-.4 2.2 1.3 8.6 3.8 4.4 1.1-1.9-.3-4.1-.3-6 0-1.7.4-3.2 1.3-4.6 1-1.6 2.9-3.5 5.1-2.9 2.5.6 2.3 4.1 4.1 4.9 1.9.8 1.6-.9 2.3-2.1 1.2-2.1 2.1-2.1 4.4-2.4 1.4-.2 3.6-1.5 4.9-.5 2.3 1.7-.7 4.4.1 6.5.6 1.5 2.1 1.7 2.8.3.7-1.4-1.1-3.4-.3-4.8 1.4-2.5 6.2-1.2 7.2 1 2.3 4.8-3.3 12-.2 16.3 3 4.1 3.9-2.8 3.8-4.8-.4-4.3-2.1-8.9 0-13.1 1.3-2.5 5.9-5.7 7.9-2.4 2 3.2-1.3 9.8-.8 13.4.5 4.4 3.5 3.3 2.7-.8-.4-1.9-2.4-10 .6-11.1 3.7-1.4 2.8 7.2 6.5.4 2.2-4.1 4.9-3.1 5.2 1.2.1 1.5-.6 3.1-.4 4.6.2 1.9 1.8 3.7 3.3 1.3 1-1.6-2.6-10.4 2.9-7.3 2.6 1.5 1.6 6.5 4.8 2.7 1.3-1.5 1.7-3.6 4-3.7 2.2-.1 4 2.3 4.8 4.1 1.3 2.9-1.5 8.4.9 10.3 4.2 3.3 3-5.5 2.7-6.9-.6-3.9 1-7.2 5.5-5 4.1 2.1 4.3 7.7 4.1 11.6 0 .8-.6 9.5 2.5 5.2 1.2-1.7-.1-7.7.1-9.6.3-2.9 1.2-5.5 4.3-6.2 4.5-1 7.7 1.5 7.4 5.8-.2 3.5-1.8 7.7-.5 11.1 1 2.7 3.6 2.8 5 .2 1.6-3.1 0-8.3-.4-11.6-.4-4.2-.2-7 1.8-10.8 0 0-.1.1-.1.2-.2.4-.3.7-.4.8v.1c-.1.2-.1.2 0 0v-.1l.4-.8c0-.1.1-.1.1-.2.2-.4.5-.8.8-1.2V0H0zM282.7 3.4z"/></svg>',
    'mountains'                      => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" opacity="0.33" d="M473,67.3c-203.9,88.3-263.1-34-320.3,0C66,119.1,0,59.7,0,59.7V0h1000v59.7 c0,0-62.1,26.1-94.9,29.3c-32.8,3.3-62.8-12.3-75.8-22.1C806,49.6,745.3,8.7,694.9,4.7S492.4,59,473,67.3z"/>	<path class="svg-white-bg" opacity="0.66" d="M734,67.3c-45.5,0-77.2-23.2-129.1-39.1c-28.6-8.7-150.3-10.1-254,39.1 s-91.7-34.4-149.2,0C115.7,118.3,0,39.8,0,39.8V0h1000v36.5c0,0-28.2-18.5-92.1-18.5C810.2,18.1,775.7,67.3,734,67.3z"/>	<path class="svg-white-bg" d="M766.1,28.9c-200-57.5-266,65.5-395.1,19.5C242,1.8,242,5.4,184.8,20.6C128,35.8,132.3,44.9,89.9,52.5C28.6,63.7,0,0,0,0 h1000c0,0-9.9,40.9-83.6,48.1S829.6,47,766.1,28.9z"/></svg>',
    'opacity-fan'                    => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.5 19.6" preserveAspectRatio="none">	<path class="svg-white-bg" opacity="0.33"  d="M0 0L0 18.8 141.8 4.1 283.5 18.8 283.5 0z"/>	<path class="svg-white-bg" opacity="0.33" d="M0 0L0 12.6 141.8 4 283.5 12.6 283.5 0z"/>	<path class="svg-white-bg" opacity="0.33" d="M0 0L0 6.4 141.8 4 283.5 6.4 283.5 0z"/>	<path class="svg-white-bg" d="M0 0L0 1.2 141.8 4 283.5 1.2 283.5 0z"/></svg>',
    'opacity-tilt'                   => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2600 131.1" preserveAspectRatio="none">	<path class="svg-white-bg" d="M0 0L2600 0 2600 69.1 0 0z"/>	<path class="svg-white-bg" opacity="0.5" d="M0 0L2600 0 2600 69.1 0 69.1z"/>	<path class="svg-white-bg" opacity="0.25" d="M2600 0L0 0 0 130.1 2600 69.1z"/></svg>',
    'pyramids-negative'              => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M761.9,40.6L643.1,24L333.9,93.8L0.1,1H0v99h1000V1"/></svg>',
    'pyramids'                       => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M761.9,44.1L643.1,27.2L333.8,98L0,3.8V0l1000,0v3.9"/></svg>',
    'split-negative'                 => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 20" preserveAspectRatio="none">	<path class="svg-white-bg" d="M519.8,0.2c-11,0-19.8,8.5-19.8,19c0-10.4-8.8-19-19.8-19L0,0v20h1000V0.2H519.8z"/></svg>',
    'split'                          => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 20" preserveAspectRatio="none">	<path class="svg-white-bg" d="M0,0v3c0,0,393.8,0,483.4,0c9.2,0,16.6,7.4,16.6,16.6c0-9.1,7.4-16.6,16.6-16.6C606.2,3,1000,3,1000,3V0H0z"/></svg>',
    'tilt-flipped'                   => '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"  viewBox="0 0 1000 100">  <path id="path2" d="M 1000,0 H 0 v 100 z" class="svg-white-bg" /></svg>',
    'tilt'                           => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M-0 0L1000 0 1000 100z"/></svg>',
    'triangle-asymmetrical-negative' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M737.9,94.7L0,0v100h1000V0L737.9,94.7z"/></svg>',
    'triangle-asymmetrical'          => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M738,99l262-93V0H0v5.6L738,99z"/></svg>',
    'triangle-negative'              => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M500.2,94.7L0,0v100h1000V0L500.2,94.7z"/></svg>',
    'triangle'                       => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M500,98.9L0,6.1V0h1000v6.1L500,98.9z"/></svg>',
    'wave-brush'                     => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.5 27.8" preserveAspectRatio="none">	<path class="svg-white-bg" d="M283.5,9.7c0,0-7.3,4.3-14,4.6c-6.8,0.3-12.6,0-20.9-1.5c-11.3-2-33.1-10.1-44.7-5.7	s-12.1,4.6-18,7.4c-6.6,3.2-20,9.6-36.6,9.3C131.6,23.5,99.5,7.2,86.3,8c-1.4,0.1-6.6,0.8-10.5,2c-3.8,1.2-9.4,3.8-17,4.7	c-3.2,0.4-8.3,1.1-14.2,0.9c-1.5-0.1-6.3-0.4-12-1.6c-5.7-1.2-11-3.1-15.8-3.7C6.5,9.2,0,10.8,0,10.8V0h283.5V9.7z M260.8,11.3	c-0.7-1-2-0.4-4.3-0.4c-2.3,0-6.1-1.2-5.8-1.1c0.3,0.1,3.1,1.5,6,1.9C259.7,12.2,261.4,12.3,260.8,11.3z M242.4,8.6	c0,0-2.4-0.2-5.6-0.9c-3.2-0.8-10.3-2.8-15.1-3.5c-8.2-1.1-15.8,0-15.1,0.1c0.8,0.1,9.6-0.6,17.6,1.1c3.3,0.7,9.3,2.2,12.4,2.7	C239.9,8.7,242.4,8.6,242.4,8.6z M185.2,8.5c1.7-0.7-13.3,4.7-18.5,6.1c-2.1,0.6-6.2,1.6-10,2c-3.9,0.4-8.9,0.4-8.8,0.5	c0,0.2,5.8,0.8,11.2,0c5.4-0.8,5.2-1.1,7.6-1.6C170.5,14.7,183.5,9.2,185.2,8.5z M199.1,6.9c0.2,0-0.8-0.4-4.8,1.1	c-4,1.5-6.7,3.5-6.9,3.7c-0.2,0.1,3.5-1.8,6.6-3C197,7.5,199,6.9,199.1,6.9z M283,6c-0.1,0.1-1.9,1.1-4.8,2.5s-6.9,2.8-6.7,2.7	c0.2,0,3.5-0.6,7.4-2.5C282.8,6.8,283.1,5.9,283,6z M31.3,11.6c0.1-0.2-1.9-0.2-4.5-1.2s-5.4-1.6-7.8-2C15,7.6,7.3,8.5,7.7,8.6	C8,8.7,15.9,8.3,20.2,9.3c2.2,0.5,2.4,0.5,5.7,1.6S31.2,11.9,31.3,11.6z M73,9.2c0.4-0.1,3.5-1.6,8.4-2.6c4.9-1.1,8.9-0.5,8.9-0.8	c0-0.3-1-0.9-6.2-0.3S72.6,9.3,73,9.2z M71.6,6.7C71.8,6.8,75,5.4,77.3,5c2.3-0.3,1.9-0.5,1.9-0.6c0-0.1-1.1-0.2-2.7,0.2	C74.8,5.1,71.4,6.6,71.6,6.7z M93.6,4.4c0.1,0.2,3.5,0.8,5.6,1.8c2.1,1,1.8,0.6,1.9,0.5c0.1-0.1-0.8-0.8-2.4-1.3	C97.1,4.8,93.5,4.2,93.6,4.4z M65.4,11.1c-0.1,0.3,0.3,0.5,1.9-0.2s2.6-1.3,2.2-1.2s-0.9,0.4-2.5,0.8C65.3,10.9,65.5,10.8,65.4,11.1	z M34.5,12.4c-0.2,0,2.1,0.8,3.3,0.9c1.2,0.1,2,0.1,2-0.2c0-0.3-0.1-0.5-1.6-0.4C36.6,12.8,34.7,12.4,34.5,12.4z M152.2,21.1	c-0.1,0.1-2.4-0.3-7.5-0.3c-5,0-13.6-2.4-17.2-3.5c-3.6-1.1,10,3.9,16.5,4.1C150.5,21.6,152.3,21,152.2,21.1z"/>	<path class="svg-white-bg" d="M269.6,18c-0.1-0.1-4.6,0.3-7.2,0c-7.3-0.7-17-3.2-16.6-2.9c0.4,0.3,13.7,3.1,17,3.3	C267.7,18.8,269.7,18,269.6,18z"/>	<path class="svg-white-bg" d="M227.4,9.8c-0.2-0.1-4.5-1-9.5-1.2c-5-0.2-12.7,0.6-12.3,0.5c0.3-0.1,5.9-1.8,13.3-1.2	S227.6,9.9,227.4,9.8z"/>	<path class="svg-white-bg" d="M204.5,13.4c-0.1-0.1,2-1,3.2-1.1c1.2-0.1,2,0,2,0.3c0,0.3-0.1,0.5-1.6,0.4	C206.4,12.9,204.6,13.5,204.5,13.4z"/>	<path class="svg-white-bg" d="M201,10.6c0-0.1-4.4,1.2-6.3,2.2c-1.9,0.9-6.2,3.1-6.1,3.1c0.1,0.1,4.2-1.6,6.3-2.6	S201,10.7,201,10.6z"/>	<path class="svg-white-bg" d="M154.5,26.7c-0.1-0.1-4.6,0.3-7.2,0c-7.3-0.7-17-3.2-16.6-2.9c0.4,0.3,13.7,3.1,17,3.3	C152.6,27.5,154.6,26.8,154.5,26.7z"/>	<path class="svg-white-bg" d="M41.9,19.3c0,0,1.2-0.3,2.9-0.1c1.7,0.2,5.8,0.9,8.2,0.7c4.2-0.4,7.4-2.7,7-2.6	c-0.4,0-4.3,2.2-8.6,1.9c-1.8-0.1-5.1-0.5-6.7-0.4S41.9,19.3,41.9,19.3z"/>	<path class="svg-white-bg" d="M75.5,12.6c0.2,0.1,2-0.8,4.3-1.1c2.3-0.2,2.1-0.3,2.1-0.5c0-0.1-1.8-0.4-3.4,0	C76.9,11.5,75.3,12.5,75.5,12.6z"/>	<path class="svg-white-bg" d="M15.6,13.2c0-0.1,4.3,0,6.7,0.5c2.4,0.5,5,1.9,5,2c0,0.1-2.7-0.8-5.1-1.4	C19.9,13.7,15.7,13.3,15.6,13.2z"/></svg>',
    'waves-negative'                 => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M790.5,93.1c-59.3-5.3-116.8-18-192.6-50c-29.6-12.7-76.9-31-100.5-35.9c-23.6-4.9-52.6-7.8-75.5-5.3	c-10.2,1.1-22.6,1.4-50.1,7.4c-27.2,6.3-58.2,16.6-79.4,24.7c-41.3,15.9-94.9,21.9-134,22.6C72,58.2,0,25.8,0,25.8V100h1000V65.3	c0,0-51.5,19.4-106.2,25.7C839.5,97,814.1,95.2,790.5,93.1z"/></svg>',
    'waves-pattern'                  => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1047.1 3.7" preserveAspectRatio="xMidYMin slice">	<path class="svg-white-bg" d="M1047.1,0C557,0,8.9,0,0,0v1.6c0,0,0.6-1.5,2.7-0.3C3.9,2,6.1,4.1,8.3,3.5c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3C13.8,2,16,4.1,18.2,3.5c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3C23.6,2,25.9,4.1,28,3.5c0.9-0.2,1.5-1.9,1.5-1.9	c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3C63,2,65.3,4.1,67.4,3.5	C68.3,3.3,69,1.6,69,1.6s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3	C82.7,2,85,4.1,87.1,3.5c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3C92.6,2,94.8,4.1,97,3.5c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9	c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9c0,0,0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2	c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.7-0.3	c1.2,0.7,3.5,2.8,5.6,2.2c0.9-0.2,1.5-1.9,1.5-1.9s0.6-1.5,2.6-0.4V0z M2.5,1.2C2.5,1.2,2.5,1.2,2.5,1.2C2.5,1.2,2.5,1.2,2.5,1.2z M2.7,1.4c0.1,0,0.1,0.1,0.1,0.1C2.8,1.4,2.8,1.4,2.7,1.4z"/></svg>',
    'waves'                          => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none">	<path class="svg-white-bg" d="M421.9,6.5c22.6-2.5,51.5,0.4,75.5,5.3c23.6,4.9,70.9,23.5,100.5,35.7c75.8,32.2,133.7,44.5,192.6,49.7	c23.6,2.1,48.7,3.5,103.4-2.5c54.7-6,106.2-25.6,106.2-25.6V0H0v30.3c0,0,72,32.6,158.4,30.5c39.2-0.7,92.8-6.7,134-22.4	c21.2-8.1,52.2-18.2,79.7-24.2C399.3,7.9,411.6,7.5,421.9,6.5z"/></svg>',
    'zigzag'                         => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 5.8" preserveAspectRatio="none">  <path class="svg-white-bg" d="M5.4.4l5.4 5.3L16.5.4l5.4 5.3L27.5.4 33 5.7 38.6.4l5.5 5.4h.1L49.9.4l5.4 5.3L60.9.4l5.5 5.3L72 .4l5.5 5.3L83.1.4l5.4 5.3L94.1.4l5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3L161 .4l5.4 5.3L172 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3L261 .4l5.4 5.3L272 .4l5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3L361 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.6-5.4 5.5 5.3L461 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1L550 .4l5.4 5.3L561 .4l5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2L650 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2L750 .4l5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.4h.2L850 .4l5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.4h.2l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.7-5.4 5.4 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.5 5.4h.1l5.6-5.4 5.5 5.3 5.6-5.3 5.5 5.3 5.6-5.3 5.4 5.3 5.7-5.3 5.4 5.3 5.6-5.3 5.5 5.4V0H-.2v5.8z"/></svg>',
);



$colibriwp_theme_action_button = 'Action Button %d';

$colibriwp_lorem_ipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimnad minim veniam, quis nostrud exercitation ullamco laboris nisi.";

return array(
    'mobile_media'                      => '@media (max-width:767px)',
    'table_media'                       => '@media (min-width:768px) and (max-width:1023px)',
    'desktop_media'                     => '@media (min-width: 1024px)',
    'lorem_ipsum'                       => $colibriwp_lorem_ipsum,
    'blog_sidebar_enabled'              => 1,
    'blog_post_meta_enabled'            => 1,
    'blog_enable_masonry'               => 1,
    'blog_show_post_thumb_placeholder'  => false,
    'blog_show_post_featured_image'     => false,
    'show_single_item_title'            => 1,
    'blog_posts_per_row'                => 2,
    'blog_post_highlight_enabled'       => false,
    'blog_post_thumb_placeholder_color' => '#F79007',
    'assets_js_key'                     => "colibriFrontendData",
    'default_icon'                      => $colibriwp_theme_svg_icons['fort-awesome'],
    'icons'                             => $colibriwp_theme_svg_icons,
    'divider_style'                     => $colibriwp_theme_divider_style,
    "gradients"                         => array(
        'night_fade'  =>
            array(
                'name'  => 'night_fade',
                'angle' => '0',
                'steps' =>
                    array(
                        0 =>
                            array(
                                'color'    => '#a18cd1',
                                'position' => '0',
                            ),
                        1 =>
                            array(
                                'color'    => '#fbc2eb',
                                'position' => '100',
                            ),
                    ),
            ),
        'juicy_peach' =>
            array(
                'name'  => 'juicy_peach',
                'angle' => '90',
                'steps' =>
                    array(
                        0 =>
                            array(
                                'color'    => '#ffecd2',
                                'position' => '0',
                            ),
                        1 =>
                            array(
                                'color'    => '#fcb69f',
                                'position' => '100',
                            ),
                    ),
            ),
        'mean_fruit'  =>
            array(
                'name'  => 'mean_fruit',
                'angle' => '120',
                'steps' =>
                    array(
                        0 =>
                            array(
                                'color'    => '#fccb90',
                                'position' => '0',
                            ),
                        1 =>
                            array(
                                'color'    => '#d57eeb',
                                'position' => '100',
                            ),
                    ),
            ),

    ),

    // template-default override
    'header_front_page'                 => array(

        'navigation' => array(
            'props' => array(
                'showTopBar' => false,
            )
        ),

        'logo' => array(
            'props' => array(
                'layoutType' => 'text',
            ),
        ),

        "hero"         => array(
            "hero_column_width" => '80',
            "props"             => array(
                "heroSection" => array(
                    "layout" => "textOnly"
                )
            ),
            "style"             => array(
                'padding'         =>
                    array(
                        'top'    =>
                            array(
                                'value' => '200',
                                'unit'  => 'px',
                            ),
                        'bottom' =>
                            array(
                                'value' => '200',
                                'unit'  => 'px',
                            ),
                    ),
                'separatorBottom' => array(
                    'type'     => 'mountains',
                    'color'    => '#FFF',
                    'height'   => array( 'value' => 100 ),
                    'enabled'  => false,
                    'negative' => false
                ),
                "background"      => array(
                    'image'     =>
                        array(
                            0 =>
                                array(
                                    'source' =>
                                        array(
                                            'url' => get_template_directory_uri() . '/resources/images/aerial-background.jpg',
                                        )
                                )
                        ),
                    "slideshow" => array(
                        "duration" => array( "value" => 1500 ),
                        "speed"    => array( "value" => 500 ),
                        "slides"   => array(
                            array(
                                'url' => get_template_directory_uri() . "/resources/images/beach-landscape-sea-water-nature-sand-1061655-pxhere.com.jpg",
                            ),
                            array(
                                'url' => get_template_directory_uri() . "/resources/images/landscape-tree-water-nature-grass-outdoor-1327743-pxhere.com.jpg",
                            ),
                            array(
                                'url' => get_template_directory_uri() . "/resources/images/leaf-nature-water-green-freshness-dew-1440543-pxhere.com.jpg",
                            ),
                        )
                    ),

                    'overlay' => array(
                        'type'  => 'color',
                        'color' => array(
                            'opacity' => 40
                        ),
                        'shape' =>
                            array(
                                'value'  => 'none',
                                'isTile' => false,
                            ),
                    )

                )
            )
        ),
        "title"        => array(
            "show"  => true,
            "value" => 'Click the pencil icon to edit the text',
        ),
        "subtitle"     => array(
            "show"  => true,
            "value" => $colibriwp_lorem_ipsum,
        ),
        "social_icons" => array(
            "show"       => true,
            "localProps" => array(
                "icons" => json_encode( array(
                    array(
                        'icon'       => $colibriwp_theme_svg_icons['facebook'],
                        'link_value' => 'http://www.facebook.com/',
                        'index'      => 0,
                    ),
                    array(
                        'icon'       => $colibriwp_theme_svg_icons['twitter'],
                        'link_value' => 'http://www.facebook.com/',
                        'index'      => 1,
                    ),
                    array(
                        'icon'       => $colibriwp_theme_svg_icons['youtube'],
                        'link_value' => 'http://www.youtube.com/',
                        'index'      => 2,
                    ),
                    array(
                        'icon'       => $colibriwp_theme_svg_icons['vimeo'],
                        'link_value' => 'http://www.vimeo.com/',
                        'index'      => 3,
                    ),
                ) ),
            ),
        ),
        "icon_list"    => array(
            "show"       => true,
            "localProps" => array(
                "iconList" => json_encode( array(
                    array(
                        'icon'       => $colibriwp_theme_svg_icons['map-marker'],
                        'text'       => 'Location, State, Country',
                        'link_value' => 'https://maps.google.com/',
                        'index'      => 0,
                    ),
                    array(
                        'icon'       => $colibriwp_theme_svg_icons['phone-square'],
                        'text'       => '(000) 123 12345',
                        'link_value' => 'https://www.twitter.com/',
                        'index'      => 1,
                    ),
                    array(
                        'icon'       => $colibriwp_theme_svg_icons['envelope'],
                        'text'       => 'email@yoursite.com',
                        'link_value' => 'mailto:email@yoursite.com',
                        'index'      => 2,
                    ),
                ) ),
            ),
        ),
        "button_group" => array(
            "show"  => true,
            "value" => json_encode( array(
                array(
                    'label'       => sprintf( $colibriwp_theme_action_button, 1 ),
                    'url'         => '#',
                    'button_type' => '0',
                    'index'       => 0,
                ),
                array(
                    'label'       => sprintf( $colibriwp_theme_action_button, 2 ),
                    'url'         => '#',
                    'button_type' => '1',
                    'index'       => 1,
                ),
            ) ),
        ),

    ),
    'header_post'                       => array(

        'logo' => array(
            'props' => array(
                'layoutType' => 'text',
            ),
        ),

        "hero"  => array(
            "style" => array(
                "background" => array(
                    "slideshow" => array(
                        "duration" => array( "value" => 1500 ),
                        "speed"    => array( "value" => 500 ),
                        "slides"   => array(
                            array(
                                'url' => get_template_directory_uri() . "/resources/images/beach-landscape-sea-water-nature-sand-1061655-pxhere.com.jpg",
                            ),
                            array(
                                'url' => get_template_directory_uri() . "/resources/images/landscape-tree-water-nature-grass-outdoor-1327743-pxhere.com.jpg",
                            ),
                            array(
                                'url' => get_template_directory_uri() . "/resources/images/leaf-nature-water-green-freshness-dew-1440543-pxhere.com.jpg",
                            ),
                        )
                    ),

                    'overlay' => array(
                        'type'  => 'color',
                        'color' => array(
                            'opacity' => 0
                        ),
                        'shape' =>
                            array(
                                'value'  => 'none',
                                'isTile' => false,
                            ),
                    )

                ),


                'separatorBottom' => array(
                    'type'     => 'mountains',
                    'color'    => '#FFF',
                    'height'   => array( 'value' => 100 ),
                    'enabled'  => false,
                    'negative' => false
                ),
            )
        ),
        "title" => array(
            "show" => true,
        ),

        'navigation' => array(
            'props' => array(
                'showTopBar' => false,
            )
        )
    )
);
functions.php000064400000032451151335104360007273 0ustar00<?php

use ColibriWP\Theme\AssetsManager;
use ColibriWP\Theme\Core\Hooks;
use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Defaults;
use ColibriWP\Theme\Theme;

require_once get_template_directory() . "/inc/vendor/autoload.php";


function colibriwp_page_builder_components( $components ) {
    $namespace = "ColibriWP\\Theme\\BuilderComponents";

    $components = array_merge( $components, array(

        'css'                => "{$namespace}\\CSSOutput",

        // header components
        'header'             => "{$namespace}\\Header",

        // footer components
        'footer'             => "{$namespace}\\Footer",

        // page content
        'main'               => "{$namespace}\\MainContent",
        'single'             => "{$namespace}\\SingleContent",
        'content'            => "{$namespace}\\PageContent",
        'front-page-content' => "{$namespace}\\FrontPageContent",
        // sidebar
        'sidebar'            => "{$namespace}\\Sidebar",
        // 404
        'page-not-found'     => "{$namespace}\\PageNotFound",

        // woo
        'main-woo'           => "{$namespace}\\WooContent",
    ) );

    return $components;
}

function colibriwp_default_components( $components ) {

    $namespace = "ColibriWP\\Theme\\Components";

    $components = array_merge( $components, array(

        // header components
        'header'               => "{$namespace}\\Header",
        'logo'                 => "{$namespace}\\Header\\Logo",
        'header-menu'          => "{$namespace}\\Header\\HeaderMenu",

        // inner page fragments
        'inner-nav-bar'        => "{$namespace}\\InnerHeader\\NavBar",
        'inner-top-bar'        => "{$namespace}\\InnerHeader\\TopBar",
        'inner-hero'           => "{$namespace}\\InnerHeader\\Hero",
        'inner-title'          => "{$namespace}\\InnerHeader\\Title",

        // front page fragments
        'front-hero'           => "{$namespace}\\FrontHeader\\Hero",
        'front-title'          => "{$namespace}\\FrontHeader\\Title",
        'front-subtitle'       => "{$namespace}\\FrontHeader\\Subtitle",
        'front-buttons'        => "{$namespace}\\FrontHeader\\ButtonsGroup",
        'top-bar-list-icons'   => "{$namespace}\\FrontHeader\\TopBarListIcons",
        'top-bar-social-icons' => "{$namespace}\\FrontHeader\\TopBarSocialIcons",
        'front-nav-bar'        => "{$namespace}\\FrontHeader\\NavBar",
        'front-top-bar'        => "{$namespace}\\FrontHeader\\TopBar",
        'front-image'          => "{$namespace}\\FrontHeader\\Image",


        // footer components
        'footer'               => "{$namespace}\\Footer",
        'front-footer'         => "{$namespace}\\Footer\\FrontFooter",

        // general components
        'css'                  => "{$namespace}\\CSSOutput",

        // page content
        'main'                 => "{$namespace}\\MainContent",
        'single'               => "{$namespace}\\SingleContent",
        'content'              => "{$namespace}\\PageContent",
        'front-page-content'   => "{$namespace}\\FrontPageContent",
        'search'               => "{$namespace}\\PageSearch",
        'page-not-found'       => "{$namespace}\\PageNotFound",

        // inner content fragments

        //main content
        'main-loop'            => "{$namespace}\\MainContent\ArchiveLoop",
        'post-loop'            => "{$namespace}\\MainContent\PostLoop",
        'archive-loop'         => "{$namespace}\\MainContent\ArchiveLoop",
        'single-template'      => "{$namespace}\\MainContent\SingleItemTemplate",

        // sidebar
        'sidebar'              => "{$namespace}\\Sidebar",

        // woo
        'main-woo'             => "{$namespace}\\WooContent",
    ) );

    return $components;
}

function colibriwp_register_components( $components = array() ) {
    if ( apply_filters( 'colibri_page_builder/installed', false ) ) {
        $components = colibriwp_page_builder_components( $components );
    } else {
        $components = colibriwp_default_components( $components );
    }

    return $components;
}

Hooks::colibri_add_action( 'components', 'colibriwp_register_components' );
Theme::load();


/**
 * @return Theme
 */
function colibriwp_theme() {
    return Theme::getInstance();
}


/**
 * @return AssetsManager
 */
function colibriwp_assets() {
    return colibriwp_theme()->getAssetsManager();
}


colibriwp_theme()
    ->add_theme_support( 'automatic-feed-links' )
    ->add_theme_support( 'title-tag' )
    ->add_theme_support( 'post-thumbnails' )
    ->add_theme_support( 'custom-logo', array(
        'flex-height' => true,
        'flex-width'  => true,
        'width'       => 150,
        'height'      => 70,
    ) );

add_action('init', function() {
    colibriwp_theme()->register_menus( array(
        'header-menu' => esc_html__( 'Header Menu', 'colibri-wp' ),
        'footer-menu' => esc_html__( 'Footer Menu', 'colibri-wp' ),
    ) );

}, 1);
add_action('widgets_init',  function() {
    colibriwp_theme()->register_sidebars( array(
        array(
            'name'          => esc_html__( 'Blog sidebar widget area', 'colibri-wp' ),
            'id'            => 'colibri-sidebar-1',
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'before_title'  => '<h5 class="widgettitle">',
            'after_title'   => '</h5>',
            'after_widget'  => '</div>',
        ),

        array(
            'name'          => esc_html__( 'Woo Commerce left sidebar widget area', 'colibri-wp' ),
            'id'            => 'colibri-ecommerce-left',
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'before_title'  => '<h5 class="widgettitle">',
            'after_title'   => '</h5>',
            'after_widget'  => '</div>',
        ),
    ) );
}, 1);

if ( ! apply_filters( 'colibri_page_builder/installed', false ) ) {
    colibriwp_assets()
        ->registerTemplateScript(
            "colibri-theme",
            "/theme/theme.js",
            array( 'jquery', 'jquery-effects-slide', 'jquery-effects-core' )
        )
        ->registerStylesheet( "colibri-theme", "/theme/theme.css" )
        ->addGoogleFont( "Open Sans", array( "300", "400", "600", "700" ) )
        ->addGoogleFont(
            "Muli",
            array(
                "300",
                "300italic",
                "400",
                "400italic",
                "600",
                "600italic",
                "700",
                "700italic",
                "900",
                "900italic"
            )
        );
}

add_filter( 'colibri_page_builder/theme_supported', '__return_true' );


//blog options

function colibriwp_show_post_meta_setting_filter( $value ) {

    $value = get_theme_mod( 'blog_post_meta_enabled', $value );

    return ( $value == 1 );
}

add_filter( 'colibriwp_show_post_meta', 'colibriwp_show_post_meta_setting_filter' );


function colibriwp_posts_per_row_setting_filter( $value ) {

    $value = get_theme_mod( 'blog_posts_per_row', $value );

    return $value;
}

add_filter( 'colibriwp_posts_per_row', 'colibriwp_posts_per_row_setting_filter' );

function colibriwp_archive_post_highlight_setting_filter( $value ) {

    $value = get_theme_mod( 'blog_post_highlight_enabled', $value );

    return $value;
}

add_filter( 'colibriwp_archive_post_highlight', 'colibriwp_archive_post_highlight_setting_filter' );


function colibriwp_blog_sidebar_enabled_setting_filter( $value ) {
    $value = get_theme_mod( 'blog_sidebar_enabled', $value );

    return ( $value == 1 );
}

Hooks::colibri_add_filter( 'blog_sidebar_enabled', 'colibriwp_blog_sidebar_enabled_setting_filter' );

function colibriwp_override_with_thumbnail_image( $value ) {
    global $post;

    if ( isset( $post ) && $post->post_type === 'post' ) {
        $value = get_theme_mod( 'blog_show_post_featured_image',
            Defaults::get( 'blog_show_post_featured_image', false ) );
        $value = ( intval( $value ) === 1 );
    }

    return $value;
}

add_filter( 'colibriwp_override_with_thumbnail_image', 'colibriwp_override_with_thumbnail_image' );

function colibriwp_print_archive_entry_class( $class = "" ) {

    $classes = array( "post-list-item", "h-col-xs-12", "space-bottom" );
    $classes = array_merge( $classes, explode( " ", $class ) );
    $classes = get_post_class( $classes );

    $default     = get_theme_mod( 'blog_posts_per_row', Defaults::get( 'blog_posts_per_row' ) );
    $postsPerRow = max( 1, apply_filters( 'colibriwp_posts_per_row', $default ) );


    $classes[] = "h-col-sm-12 h-col-md-" . ( 12 / intval( $postsPerRow ) );

    $classes = apply_filters( 'colibriwp_archive_entry_class', $classes );

    $classesText = implode( " ", $classes );

    echo esc_attr( $classesText );
}

function colibriwp_print_masonry_col_class( $echo = false ) {

    global $wp_query;
    $index        = $wp_query->current_post;
    $hasBigClass  = ( is_sticky() || ( $index === 0 && apply_filters( 'colibriwp_archive_post_highlight', false ) ) );
    $showBigEntry = ( is_archive() || is_home() );

    $class = "";
    if ( $showBigEntry && $hasBigClass ) {
        $class = "col-md-12";
    } else {
        $default     = get_theme_mod( 'blog_posts_per_row', Defaults::get( 'blog_posts_per_row' ) );
        $postsPerRow = max( 1, apply_filters( 'colibriwp_posts_per_row', $default ) );

        $class = "col-sm-12.col-md-" . ( 12 / intval( $postsPerRow ) );
    }

    if ( $echo ) {
        echo esc_attr( $class );
    } else {
        return esc_attr( $class );
    }


}


Hooks::colibri_add_filter( 'info_page_tabs', 'colibriwp_get_started_info_page_tab' );

function colibriwp_get_started_info_page_tab( $tabs ) {

    $tabs['get-started'] = array(
        'title'       => \ColibriWP\Theme\Translations::translate( 'get_started' ),
        'tab_partial' => "admin/get-started"
    );

    return $tabs;
}


function colibriwp_theme_plugins( $plugins ) {
    $theme_plugins = array();

    if ( ! function_exists( 'get_plugins' ) ) {
        require_once ABSPATH . 'wp-admin/includes/plugin.php';
    }

    $installed_plugins = get_plugins();
    $is_cf_7_installed = false;

    foreach ( array_keys( $installed_plugins ) as $plugin_path ) {
        if ( strpos( $plugin_path, 'contact-form-7' ) === 0 ) {
            $is_cf_7_installed = true;
            break;
        }
    }

    if ( ! $is_cf_7_installed ) {
        $theme_plugins = array_merge( $theme_plugins, array(
            'forminator' => array(
                'name'        => 'Forminator',
                'description' => \ColibriWP\Theme\Translations::translate( 'contact_form_plugin_description' )
            )
        ) );
    }

    $builder_plugin = 'colibri-page-builder';

    foreach ( $installed_plugins as $key => $plugin_data ) {
        if ( strpos( $key, 'colibri-page-builder-pro/' ) !== false ) {
            $builder_plugin = 'colibri-page-builder-pro';

        }

        if ( strpos( $key, 'wpforms-' ) !== false ) {
            unset( $theme_plugins['contact-form-7'] );
            $slug                   = Utils::arrayGetAt( explode( "/", $key ), 0 );
            $theme_plugins[ $slug ] = array(
                'name'        => Utils::pathGet( $plugin_data, 'Name', 'WP Forms' ),
                'description' => Utils::pathGet( $plugin_data, 'Description' ),
            );
        }
    }

    Hooks::colibri_add_filter( 'plugin_slug', function ( $slug ) use ( $builder_plugin ) {
        return $builder_plugin;
    } );

    $theme_plugins = array_merge( array(
        $builder_plugin => array(
            'name'        => $builder_plugin === 'colibri-page-builder-pro' ? 'Colibri Page Builder PRO' : 'Colibri Page Builder',
            'description' => \ColibriWP\Theme\Translations::translate( 'page_builder_plugin_description' ),
            'plugin_path' => "{$builder_plugin}/{$builder_plugin}.php"
        )
    ), $theme_plugins );

    return array_merge( $plugins, $theme_plugins );
}

Hooks::colibri_add_filter( 'theme_plugins', 'colibriwp_theme_plugins' );


add_filter( 'http_request_host_is_external', 'colibriwp_allow_internal_host', 10, 3 );
function colibriwp_allow_internal_host( $allow, $host, $url ) {
    if ( $host === 'extendstudio.net' ) {
        $allow = true;
    }

    return $allow;
}

add_action( 'wp_ajax_colibriwp_front_set_predesign', function () {
    check_ajax_referer( 'colibriwp_front_set_predesign_nonce', 'nonce' );
    $predesign_index = isset( $_REQUEST['index'] ) ? $_REQUEST['index'] : 0;
    $predesign_index = intval( $predesign_index );
    $meta            = array();

    foreach ( Defaults::get( 'front_page_designs', array() ) as $predesign ) {
        if ( intval( $predesign['index'] ) === $predesign_index ) {
            $meta = Utils::pathGet( $predesign, 'meta', array() );
            break;
        }
    }

    update_option( 'colibriwp_predesign_front_page_index', $predesign_index );
    update_option( 'colibriwp_predesign_front_page_meta', $meta );
} );

/* WooCommerce support for latest gallery */
if ( class_exists( 'WooCommerce' ) ) {
    colibriwp_theme()
        ->add_theme_support( 'woocommerce' )
        ->add_theme_support( 'wc-product-gallery-zoom' )
        ->add_theme_support( 'wc-product-gallery-lightbox' )
        ->add_theme_support( 'wc-product-gallery-slider' );
}

function colibriwp_override_main_row_class( $classes ) {
    return Defaults::get( 'templates.blog.row.layout-classes', $classes );
}

Hooks::colibri_add_filter( 'main_row_class', 'colibriwp_override_main_row_class', 10, 1 );
customizer-headers.php000064400000122454151335104360011103 0ustar00<?php return array (
  0 => 
  array (
    'image' => '%s/header-1-preview.jpg',
    'data' => 
    array (
      'header_front_page.logo.props.layoutType' => 'image',
      'header_front_page.header-menu.edit' => '',
      'header_front_page.header-menu.style.descendants.innerMenu.justifyContent' => 'center',
      'header_front_page.header-menu.props.showOffscreenMenuOn' => 'has-offcanvas-tablet',
      'header_front_page.header-menu.props.hoverEffect.type' => 'bordered-active-item bordered-active-item--bottom',
      'header_front_page.header-menu.props.hoverEffect.activeGroup' => 'border',
      'header_front_page.header-menu.props.hoverEffect.group.border.transition' => 'effect-borders-grow grow-from-center',
      'header_front_page.hero.props.heroSection.layout' => 'textOnly',
      'header_front_page.hero.separator1' => '',
      'header_front_page.hero.hero_column_width' => '80',
      'header_front_page.hero.separator2' => '',
      'header_front_page.hero..pen' => '',
      'header_front_page.hero.full_height' => false,
      'header_front_page.hero.hero.separator2' => '',
      'header_front_page.hero.style.background.color' => '#03a9f4',
      'header_front_page.hero.style.background.type' => 'image',
      'header_front_page.hero.style.background.image.0.source.url' => '%s/images/hero-1.jpg',
      'header_front_page.hero.style.background.image.0.position' => 'center center',
      'header_front_page.hero.style.background.image.0.attachment' => 'scroll',
      'header_front_page.hero.style.background.image.0.repeat' => 'no-repeat',
      'header_front_page.hero.style.background.image.0.size' => 'cover',
      'header_front_page.hero.style.background.image.0.source.gradient' => 
      array (
        'name' => 'october_silence',
        'angle' => '0',
        'steps' => 
        array (
          0 => 
          array (
            'position' => '0',
            'color' => '#b721ff',
          ),
          1 => 
          array (
            'position' => '100',
            'color' => '#21d4fd',
          ),
        ),
      ),
      'header_front_page.hero.style.background.slideshow.slides' => 
      array (
        0 => 
        array (
          'url' => '%s/images/beach-landscape-sea-water-nature-sand-1061655-pxhere.com.jpg',
        ),
        1 => 
        array (
          'url' => '%s/images/landscape-tree-water-nature-grass-outdoor-1327743-pxhere.com.jpg',
        ),
        2 => 
        array (
          'url' => '%s/images/leaf-nature-water-green-freshness-dew-1440543-pxhere.com.jpg',
        ),
      ),
      'header_front_page.hero.style.background.slideshow.duration.value' => '1500',
      'header_front_page.hero.style.background.slideshow.speed.value' => '500',
      'header_front_page.hero.style.background.video.videoType' => 'external',
      'header_front_page.hero.style.background.video.externalUrl' => 'https://www.youtube.com/watch?v=y5zFszln1ao',
      'header_front_page.hero.style.background.video.internalUrl' => '%s/../videos/colibri-demo-video.mp4',
      'header_front_page.hero.style.background.video.poster.url' => '%s/../images/colibri-demo-video-cover.jpg',
      'header_front_page.hero.hero.separator5' => '',
      'header_front_page.hero.style.background.overlay.type' => 'color',
      'header_front_page.hero.style.background.overlay.shape.value' => 'none',
      'header_front_page.hero.style.background.overlay.light' => '',
      'header_front_page.hero.style.background.overlay.color.value' => '#000000',
      'header_front_page.hero.style.background.overlay.gradient' => 
      array (
        'angle' => '-20',
        'steps' => 
        array (
          0 => 
          array (
            'color' => 'rgba(183, 33, 255, 0.8)',
            'position' => '0',
          ),
          1 => 
          array (
            'color' => 'rgba(33, 212, 253, 0.8)',
            'position' => '100',
          ),
        ),
        'name' => 'october_silence',
      ),
      'header_front_page.hero.style.background.overlay.color.opacity_' => '50',
      'header_front_page.hero.style.background.overlay.enabled' => '1',
      'header_front_page.hero.hero.separator6' => '',
      'header_front_page.hero.style.separatorBottom.enabled' => false,
      'header_front_page.hero.style.separatorBottom.type' => 'mountains',
      'header_front_page.hero.style.separatorBottom.color' => '#FFF',
      'header_front_page.hero.style.separatorBottom.height.value' => '100',
      'header_front_page.hero.hero.separator1' => '',
      'header_front_page.hero.style.padding.top.value' => '150',
      'header_front_page.hero.style.padding.bottom.value' => '150',
      'header_front_page.title.show' => '1',
      'header_front_page.title.localProps.content' => 'We\'re here to help you bring your awesome ideas to life',
      'header_front_page.title.style.textAlign' => 'center',
      'header_front_page.subtitle.show' => '1',
      'header_front_page.subtitle.localProps.content' => 'Fusce vitae magna sit amet orci bibendum volutpat id quis enim. Quisque viverra ligula sit amet porttitor ornare. Cras eros mi, rhoncus ac elementum vitae, dignissim nec enim.',
      'header_front_page.subtitle.style.textAlign' => '',
      'header_front_page.button_group.show' => '1',
      'header_front_page.button_group.value' => '%5B%7B%22label%22%3A%22Get+started+today%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%220%22%2C%22index%22%3A0%7D%2C%7B%22label%22%3A%22Learn+more%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%221%22%2C%22index%22%3A1%7D%5D',
      'header_front_page.button_group.style.textAlign' => '',
      'header_front_page.icon_list.pen' => '',
      'header_front_page.navigation.props.layoutType' => 'logo-spacing-menu',
      'header_front_page.navigation.separator1' => '',
      'header_front_page.navigation.props.sticky' => '1',
      'header_front_page.navigation.separator2' => '',
      'header_front_page.navigation.props.width' => 'boxed',
      'header_front_page.navigation.style.padding.top.value' => '20',
      'header_front_page.navigation.hidden' => '',
      'header_front_page.navigation.props.showTopBar' => '',
      'header_front_page.hero.image.localProps.url' => '',
      'header_front_page.hero.image.style.descendants.image.boxShadow.layers.0' => 
      array (
        'x' => '2',
        'y' => '2',
        'spread' => '10',
        'blur' => '2',
        'color' => '#333',
      ),
      'header_front_page.hero.image.style.descendants.image.boxShadow.enabled' => '',
      'header_front_page.hero.image.props.frame.type' => 'border',
      'header_front_page.hero.image.style.descendants.frameImage.backgroundColor' => 'rgba(0, 0, 0, 0.5)',
      'header_front_page.hero.image.style.descendants.frameImage.width' => '100',
      'header_front_page.hero.image.style.descendants.frameImage.height' => '100',
      'header_front_page.hero.image.style.descendants.frameImage.transform.translate' => 
      array (
        'x' => 
        array (
          'path' => 'value',
        ),
        'x_value' => '4',
        'y' => 
        array (
          'path' => 'value',
        ),
        'y_value' => '6',
      ),
      'header_front_page.hero.image.style.descendants.frameImage.thickness' => '10',
      'header_front_page.hero.image.props.showFrameOverImage' => '',
      'header_front_page.hero.image.props.showFrameShadow' => '',
      'header_front_page.hero.image.props.enabledFrameOption' => false,
      'header_front_page.logo.section-style-plugin-message' => '',
      'header_front_page.logo.section-layout-plugin-message' => '',
      'header_front_page.header-menu.section-layout-plugin-message' => '',
      'header_front_page.title.section-style-plugin-message' => '',
      'header_front_page.title.section-layout-plugin-message' => '',
      'header_front_page.subtitle.section-style-plugin-message' => '',
      'header_front_page.subtitle.section-layout-plugin-message' => '',
      'header_front_page.button_group.section-style-plugin-message' => '',
      'header_front_page.button_group.section-layout-plugin-message' => '',
      'header_front_page.icon_list.section-style-plugin-message' => '',
      'header_front_page.icon_list.section-layout-plugin-message' => '',
      'header_front_page.social_icons.section-style-plugin-message' => '',
      'header_front_page.social_icons.section-layout-plugin-message' => '',
      'header_front_page.hero.image.section-style-plugin-message' => '',
      'header_front_page.hero.image.section-layout-plugin-message' => '',
    ),
  ),
  1 => 
  array (
    'image' => '%s/header-2-preview.jpg',
    'data' => 
    array (
      'header_front_page.logo.props.layoutType' => 'image',
      'header_front_page.header-menu.edit' => '',
      'header_front_page.header-menu.style.descendants.innerMenu.justifyContent' => 'center',
      'header_front_page.header-menu.props.showOffscreenMenuOn' => 'has-offcanvas-tablet',
      'header_front_page.header-menu.props.hoverEffect.type' => 'bordered-active-item bordered-active-item--bottom',
      'header_front_page.header-menu.props.hoverEffect.activeGroup' => 'border',
      'header_front_page.header-menu.props.hoverEffect.group.border.transition' => 'effect-borders-grow grow-from-center',
      'header_front_page.hero.props.heroSection.layout' => 'textWithMediaOnRight',
      'header_front_page.hero.separator1' => '',
      'header_front_page.hero.hero_column_width' => '50',
      'header_front_page.hero.separator2' => '',
      'header_front_page.hero..pen' => '',
      'header_front_page.hero.full_height' => false,
      'header_front_page.hero.hero.separator2' => '',
      'header_front_page.hero.style.background.color' => '#03a9f4',
      'header_front_page.hero.style.background.type' => 'slideshow',
      'header_front_page.hero.style.background.image.0.source.url' => '%s/../images/beach-landscape-sea-water-nature-sand-1061655-pxhere.com.jpg',
      'header_front_page.hero.style.background.image.0.position' => 'center center',
      'header_front_page.hero.style.background.image.0.attachment' => 'scroll',
      'header_front_page.hero.style.background.image.0.repeat' => 'no-repeat',
      'header_front_page.hero.style.background.image.0.size' => 'cover',
      'header_front_page.hero.style.background.image.0.source.gradient' => 
      array (
        'name' => 'october_silence',
        'angle' => '0',
        'steps' => 
        array (
          0 => 
          array (
            'position' => '0',
            'color' => '#b721ff',
          ),
          1 => 
          array (
            'position' => '100',
            'color' => '#21d4fd',
          ),
        ),
      ),
      'header_front_page.hero.style.background.slideshow.slides' => 
      array (
        0 => 
        array (
          'url' => '%s/images/StockSnap_Z2FVSJZAEN-hero1-1024x576.jpg',
          'index' => 0,
        ),
        1 => 
        array (
          'url' => '%s/images/slide-3-sea-body-of-water-beach-sky-blue-ocean-1589419-pxhere.com_.jpg',
          'index' => 1,
        ),
        2 => 
        array (
          'url' => '%s/images/slide-4-beach-sea-coast-sand-ocean-horizon-1266150-pxhere.com_.jpg',
          'index' => 2,
        ),
      ),
      'header_front_page.hero.style.background.slideshow.duration.value' => '1500',
      'header_front_page.hero.style.background.slideshow.speed.value' => '500',
      'header_front_page.hero.style.background.video.videoType' => 'external',
      'header_front_page.hero.style.background.video.externalUrl' => 'https://www.youtube.com/watch?v=y5zFszln1ao',
      'header_front_page.hero.style.background.video.internalUrl' => '%s/../videos/colibri-demo-video.mp4',
      'header_front_page.hero.style.background.video.poster.url' => '%s/../images/colibri-demo-video-cover.jpg',
      'header_front_page.hero.hero.separator5' => '',
      'header_front_page.hero.style.background.overlay.type' => 'color',
      'header_front_page.hero.style.background.overlay.shape.value' => 'none',
      'header_front_page.hero.style.background.overlay.light' => '',
      'header_front_page.hero.style.background.overlay.color.value' => 'rgba(23, 37, 42, 1)',
      'header_front_page.hero.style.background.overlay.gradient' => 
      array (
        'angle' => '-20',
        'steps' => 
        array (
          0 => 
          array (
            'color' => 'rgba(183, 33, 255, 0.8)',
            'position' => '0',
          ),
          1 => 
          array (
            'color' => 'rgba(33, 212, 253, 0.8)',
            'position' => '100',
          ),
        ),
        'name' => 'october_silence',
      ),
      'header_front_page.hero.style.background.overlay.color.opacity_' => '50',
      'header_front_page.hero.style.background.overlay.enabled' => true,
      'header_front_page.hero.hero.separator6' => '',
      'header_front_page.hero.style.separatorBottom.enabled' => true,
      'header_front_page.hero.style.separatorBottom.type' => 'wave-brush',
      'header_front_page.hero.style.separatorBottom.color' => '#FFF',
      'header_front_page.hero.style.separatorBottom.height.value' => '200',
      'header_front_page.hero.hero.separator1' => '',
      'header_front_page.hero.style.padding.top.value' => '50',
      'header_front_page.hero.style.padding.bottom.value' => '50',
      'header_front_page.title.show' => '1',
      'header_front_page.title.localProps.content' => 'Your awesome site title goes here',
      'header_front_page.title.style.textAlign' => 'left',
      'header_front_page.subtitle.show' => '1',
      'header_front_page.subtitle.localProps.content' => 'Fusce vitae magna sit amet orci bibendum volutpat id quis enim. Quisque viverra ligula sit amet porttitor ornare.',
      'header_front_page.subtitle.style.textAlign' => 'left',
      'header_front_page.button_group.show' => '1',
      'header_front_page.button_group.value' => '%5B%7B%22label%22%3A%22Get+started+today%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%220%22%2C%22index%22%3A0%7D%2C%7B%22label%22%3A%22Learn+more%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%221%22%2C%22index%22%3A1%7D%5D',
      'header_front_page.button_group.style.textAlign' => 'left',
      'header_front_page.icon_list.pen' => '',
      'header_front_page.navigation.props.layoutType' => 'logo-spacing-menu',
      'header_front_page.navigation.separator1' => '',
      'header_front_page.navigation.props.sticky' => '1',
      'header_front_page.navigation.separator2' => '',
      'header_front_page.navigation.props.width' => 'boxed',
      'header_front_page.navigation.style.padding.top.value' => '20',
      'header_front_page.navigation.hidden' => '',
      'header_front_page.navigation.props.showTopBar' => '',
      'header_front_page.hero.image.localProps.url' => '%s/images/small-attractive-beach-beautiful-bikini-blurred-background-body-1418560-pxhere.com_.jpg',
      'header_front_page.hero.image.style.descendants.image.boxShadow.layers.0' => 
      array (
        'x' => '2',
        'y' => '2',
        'spread' => '10',
        'blur' => '2',
        'color' => '#333',
      ),
      'header_front_page.hero.image.style.descendants.image.boxShadow.enabled' => '',
      'header_front_page.hero.image.props.frame.type' => 'background',
      'header_front_page.hero.image.style.descendants.frameImage.backgroundColor' => 'rgba(255, 255, 255, 0.97)',
      'header_front_page.hero.image.style.descendants.frameImage.width' => '104',
      'header_front_page.hero.image.style.descendants.frameImage.height' => '104',
      'header_front_page.hero.image.style.descendants.frameImage.transform.translate' => '%7B%22x%22%3A%7B%22path%22%3A%22value%22%7D%2C%22x_value%22%3A-2%2C%22y%22%3A%7B%22path%22%3A%22value%22%7D%2C%22y_value%22%3A-2%7D',
      'header_front_page.hero.image.style.descendants.frameImage.thickness' => '10',
      'header_front_page.hero.image.props.showFrameOverImage' => false,
      'header_front_page.hero.image.props.showFrameShadow' => true,
      'header_front_page.hero.image.props.enabledFrameOption' => true,
      'header_front_page.logo.section-style-plugin-message' => '',
      'header_front_page.logo.section-layout-plugin-message' => '',
      'header_front_page.header-menu.section-layout-plugin-message' => '',
      'header_front_page.title.section-style-plugin-message' => '',
      'header_front_page.title.section-layout-plugin-message' => '',
      'header_front_page.subtitle.section-style-plugin-message' => '',
      'header_front_page.subtitle.section-layout-plugin-message' => '',
      'header_front_page.button_group.section-style-plugin-message' => '',
      'header_front_page.button_group.section-layout-plugin-message' => '',
      'header_front_page.icon_list.section-style-plugin-message' => '',
      'header_front_page.icon_list.section-layout-plugin-message' => '',
      'header_front_page.social_icons.section-style-plugin-message' => '',
      'header_front_page.social_icons.section-layout-plugin-message' => '',
      'header_front_page.hero.image.section-style-plugin-message' => '',
      'header_front_page.hero.image.section-layout-plugin-message' => '',
    ),
  ),
  2 => 
  array (
    'image' => '%s/header-3-preview.jpg',
    'data' => 
    array (
      'header_front_page.logo.props.layoutType' => 'image',
      'header_front_page.header-menu.edit' => '',
      'header_front_page.header-menu.style.descendants.innerMenu.justifyContent' => 'center',
      'header_front_page.header-menu.props.showOffscreenMenuOn' => 'has-offcanvas-tablet',
      'header_front_page.header-menu.props.hoverEffect.type' => 'bordered-active-item bordered-active-item--bottom',
      'header_front_page.header-menu.props.hoverEffect.activeGroup' => 'border',
      'header_front_page.header-menu.props.hoverEffect.group.border.transition' => 'effect-borders-grow grow-from-center',
      'header_front_page.hero.props.heroSection.layout' => 'textWithMediaOnRight',
      'header_front_page.hero.separator1' => '',
      'header_front_page.hero.hero_column_width' => '50',
      'header_front_page.hero.separator2' => '',
      'header_front_page.hero..pen' => '',
      'header_front_page.hero.full_height' => true,
      'header_front_page.hero.hero.separator2' => '',
      'header_front_page.hero.style.background.color' => '#03a9f4',
      'header_front_page.hero.style.background.type' => 'video',
      'header_front_page.hero.style.background.image.0.source.url' => '%s/../images/beach-landscape-sea-water-nature-sand-1061655-pxhere.com.jpg',
      'header_front_page.hero.style.background.image.0.position' => 'center center',
      'header_front_page.hero.style.background.image.0.attachment' => 'scroll',
      'header_front_page.hero.style.background.image.0.repeat' => 'no-repeat',
      'header_front_page.hero.style.background.image.0.size' => 'cover',
      'header_front_page.hero.style.background.image.0.source.gradient' => 
      array (
        'name' => 'october_silence',
        'angle' => '0',
        'steps' => 
        array (
          0 => 
          array (
            'position' => '0',
            'color' => '#b721ff',
          ),
          1 => 
          array (
            'position' => '100',
            'color' => '#21d4fd',
          ),
        ),
      ),
      'header_front_page.hero.style.background.slideshow.slides' => 
      array (
        0 => 
        array (
          'url' => '%s/images/beach-landscape-sea-water-nature-sand-1061655-pxhere.com.jpg',
        ),
        1 => 
        array (
          'url' => '%s/images/landscape-tree-water-nature-grass-outdoor-1327743-pxhere.com.jpg',
        ),
        2 => 
        array (
          'url' => '%s/images/leaf-nature-water-green-freshness-dew-1440543-pxhere.com.jpg',
        ),
      ),
      'header_front_page.hero.style.background.slideshow.duration.value' => '1500',
      'header_front_page.hero.style.background.slideshow.speed.value' => '500',
      'header_front_page.hero.style.background.video.videoType' => 'external',
      'header_front_page.hero.style.background.video.externalUrl' => 'https://www.youtube.com/watch?v=y5zFszln1ao',
      'header_front_page.hero.style.background.video.internalUrl' => '%s/../videos/colibri-demo-video.mp4',
      'header_front_page.hero.style.background.video.poster.url' => '%s/../images/colibri-demo-video-cover.jpg',
      'header_front_page.hero.hero.separator5' => '',
      'header_front_page.hero.style.background.overlay.type' => 'color',
      'header_front_page.hero.style.background.overlay.shape.value' => 'none',
      'header_front_page.hero.style.background.overlay.light' => '',
      'header_front_page.hero.style.background.overlay.color.value' => '#000000',
      'header_front_page.hero.style.background.overlay.gradient' => 
      array (
        'angle' => '-20',
        'steps' => 
        array (
          0 => 
          array (
            'color' => 'rgba(183, 33, 255, 0.8)',
            'position' => '0',
          ),
          1 => 
          array (
            'color' => 'rgba(33, 212, 253, 0.8)',
            'position' => '100',
          ),
        ),
        'name' => 'october_silence',
      ),
      'header_front_page.hero.style.background.overlay.color.opacity_' => '50',
      'header_front_page.hero.style.background.overlay.enabled' => '1',
      'header_front_page.hero.hero.separator6' => '',
      'header_front_page.hero.style.separatorBottom.enabled' => false,
      'header_front_page.hero.style.separatorBottom.type' => 'mountains',
      'header_front_page.hero.style.separatorBottom.color' => '#FFF',
      'header_front_page.hero.style.separatorBottom.height.value' => '100',
      'header_front_page.hero.hero.separator1' => '',
      'header_front_page.hero.style.padding.top.value' => '150',
      'header_front_page.hero.style.padding.bottom.value' => '150',
      'header_front_page.title.show' => '1',
      'header_front_page.title.localProps.content' => 'Your awesome site title goes here',
      'header_front_page.title.style.textAlign' => 'left',
      'header_front_page.subtitle.show' => '1',
      'header_front_page.subtitle.localProps.content' => 'Fusce vitae magna sit amet orci bibendum volutpat id quis enim. Quisque viverra ligula sit amet porttitor ornare.',
      'header_front_page.subtitle.style.textAlign' => 'left',
      'header_front_page.button_group.show' => '1',
      'header_front_page.button_group.value' => '%5B%7B%22label%22%3A%22Get+started+today%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%220%22%2C%22index%22%3A0%7D%2C%7B%22label%22%3A%22Learn+more%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%221%22%2C%22index%22%3A1%7D%5D',
      'header_front_page.button_group.style.textAlign' => 'left',
      'header_front_page.icon_list.pen' => '',
      'header_front_page.navigation.props.layoutType' => 'logo-spacing-menu',
      'header_front_page.navigation.separator1' => '',
      'header_front_page.navigation.props.sticky' => '1',
      'header_front_page.navigation.separator2' => '',
      'header_front_page.navigation.props.width' => 'boxed',
      'header_front_page.navigation.style.padding.top.value' => '20',
      'header_front_page.navigation.hidden' => '',
      'header_front_page.navigation.props.showTopBar' => '',
      'header_front_page.hero.image.localProps.url' => '%s/images/camera-black-background-camera-canon-832811.jpg',
      'header_front_page.hero.image.style.descendants.image.boxShadow.layers.0' => 
      array (
        'x' => '2',
        'y' => '2',
        'spread' => '10',
        'blur' => '2',
        'color' => '#333',
      ),
      'header_front_page.hero.image.style.descendants.image.boxShadow.enabled' => '',
      'header_front_page.hero.image.props.frame.type' => 'background',
      'header_front_page.hero.image.style.descendants.frameImage.backgroundColor' => 'rgba(247, 144, 7, 1)',
      'header_front_page.hero.image.style.descendants.frameImage.width' => '100',
      'header_front_page.hero.image.style.descendants.frameImage.height' => '120',
      'header_front_page.hero.image.style.descendants.frameImage.transform.translate' => '%7B%22x%22%3A%7B%22path%22%3A%22value%22%7D%2C%22x_value%22%3A8%2C%22y%22%3A%7B%22path%22%3A%22value%22%7D%2C%22y_value%22%3A-8%7D',
      'header_front_page.hero.image.style.descendants.frameImage.thickness' => '10',
      'header_front_page.hero.image.props.showFrameOverImage' => '',
      'header_front_page.hero.image.props.showFrameShadow' => '',
      'header_front_page.hero.image.props.enabledFrameOption' => true,
      'header_front_page.logo.section-style-plugin-message' => '',
      'header_front_page.logo.section-layout-plugin-message' => '',
      'header_front_page.header-menu.section-layout-plugin-message' => '',
      'header_front_page.title.section-style-plugin-message' => '',
      'header_front_page.title.section-layout-plugin-message' => '',
      'header_front_page.subtitle.section-style-plugin-message' => '',
      'header_front_page.subtitle.section-layout-plugin-message' => '',
      'header_front_page.button_group.section-style-plugin-message' => '',
      'header_front_page.button_group.section-layout-plugin-message' => '',
      'header_front_page.icon_list.section-style-plugin-message' => '',
      'header_front_page.icon_list.section-layout-plugin-message' => '',
      'header_front_page.social_icons.section-style-plugin-message' => '',
      'header_front_page.social_icons.section-layout-plugin-message' => '',
      'header_front_page.hero.image.section-style-plugin-message' => '',
      'header_front_page.hero.image.section-layout-plugin-message' => '',
    ),
  ),
  3 => 
  array (
    'image' => '%s/header-4-preview.jpg',
    'data' => 
    array (
      'header_front_page.logo.props.layoutType' => 'image',
      'header_front_page.header-menu.edit' => '',
      'header_front_page.header-menu.style.descendants.innerMenu.justifyContent' => 'center',
      'header_front_page.header-menu.props.showOffscreenMenuOn' => 'has-offcanvas-tablet',
      'header_front_page.header-menu.props.hoverEffect.type' => 'bordered-active-item bordered-active-item--bottom',
      'header_front_page.header-menu.props.hoverEffect.activeGroup' => 'border',
      'header_front_page.header-menu.props.hoverEffect.group.border.transition' => 'effect-borders-grow grow-from-center',
      'header_front_page.hero.props.heroSection.layout' => 'textWithMediaOnRight',
      'header_front_page.hero.separator1' => '',
      'header_front_page.hero.hero_column_width' => '50',
      'header_front_page.hero.separator2' => '',
      'header_front_page.hero..pen' => '',
      'header_front_page.hero.full_height' => '',
      'header_front_page.hero.hero.separator2' => '',
      'header_front_page.hero.style.background.color' => '#03a9f4',
      'header_front_page.hero.style.background.type' => 'image',
      'header_front_page.hero.style.background.image.0.source.url' => '%s/images/hero-4a.jpg',
      'header_front_page.hero.style.background.image.0.position' => 'top center',
      'header_front_page.hero.style.background.image.0.attachment' => 'scroll',
      'header_front_page.hero.style.background.image.0.repeat' => 'no-repeat',
      'header_front_page.hero.style.background.image.0.size' => 'cover',
      'header_front_page.hero.style.background.image.0.source.gradient' => 
      array (
        'name' => 'october_silence',
        'angle' => '0',
        'steps' => 
        array (
          0 => 
          array (
            'position' => '0',
            'color' => '#b721ff',
          ),
          1 => 
          array (
            'position' => '100',
            'color' => '#21d4fd',
          ),
        ),
      ),
      'header_front_page.hero.style.background.slideshow.slides' => 
      array (
        0 => 
        array (
          'url' => '%s/images/beach-landscape-sea-water-nature-sand-1061655-pxhere.com.jpg',
        ),
        1 => 
        array (
          'url' => '%s/images/landscape-tree-water-nature-grass-outdoor-1327743-pxhere.com.jpg',
        ),
        2 => 
        array (
          'url' => '%s/images/leaf-nature-water-green-freshness-dew-1440543-pxhere.com.jpg',
        ),
      ),
      'header_front_page.hero.style.background.slideshow.duration.value' => '1500',
      'header_front_page.hero.style.background.slideshow.speed.value' => '500',
      'header_front_page.hero.style.background.video.videoType' => 'external',
      'header_front_page.hero.style.background.video.externalUrl' => 'https://www.youtube.com/watch?v=y5zFszln1ao',
      'header_front_page.hero.style.background.video.internalUrl' => '%s/../videos/colibri-demo-video.mp4',
      'header_front_page.hero.style.background.video.poster.url' => '%s/../images/colibri-demo-video-cover.jpg',
      'header_front_page.hero.hero.separator5' => '',
      'header_front_page.hero.style.background.overlay.type' => 'color',
      'header_front_page.hero.style.background.overlay.shape.value' => 'none',
      'header_front_page.hero.style.background.overlay.light' => '',
      'header_front_page.hero.style.background.overlay.color.value' => '#000000',
      'header_front_page.hero.style.background.overlay.gradient' => 
      array (
        'angle' => '-20',
        'steps' => 
        array (
          0 => 
          array (
            'color' => 'rgba(183, 33, 255, 0.8)',
            'position' => '0',
          ),
          1 => 
          array (
            'color' => 'rgba(33, 212, 253, 0.8)',
            'position' => '100',
          ),
        ),
        'name' => 'october_silence',
      ),
      'header_front_page.hero.style.background.overlay.color.opacity_' => '60',
      'header_front_page.hero.style.background.overlay.enabled' => '1',
      'header_front_page.hero.hero.separator6' => '',
      'header_front_page.hero.style.separatorBottom.enabled' => false,
      'header_front_page.hero.style.separatorBottom.type' => 'mountains',
      'header_front_page.hero.style.separatorBottom.color' => '#FFF',
      'header_front_page.hero.style.separatorBottom.height.value' => '100',
      'header_front_page.hero.hero.separator1' => '',
      'header_front_page.hero.style.padding.top.value' => '200',
      'header_front_page.hero.style.padding.bottom.value' => '200',
      'header_front_page.title.show' => '1',
      'header_front_page.title.localProps.content' => 'Your awesome site title goes here',
      'header_front_page.title.style.textAlign' => 'left',
      'header_front_page.subtitle.show' => '1',
      'header_front_page.subtitle.localProps.content' => 'Fusce vitae magna sit amet orci bibendum volutpat id quis enim. Quisque viverra ligula sit amet porttitor ornare.',
      'header_front_page.subtitle.style.textAlign' => 'left',
      'header_front_page.button_group.show' => '1',
      'header_front_page.button_group.value' => '%5B%7B%22label%22%3A%22Get+started+today%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%220%22%2C%22index%22%3A0%7D%2C%7B%22label%22%3A%22Learn+more%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%221%22%2C%22index%22%3A1%7D%5D',
      'header_front_page.button_group.style.textAlign' => 'left',
      'header_front_page.icon_list.pen' => '',
      'header_front_page.navigation.props.layoutType' => 'logo-spacing-menu',
      'header_front_page.navigation.separator1' => '',
      'header_front_page.navigation.props.sticky' => '1',
      'header_front_page.navigation.separator2' => '',
      'header_front_page.navigation.props.width' => 'boxed',
      'header_front_page.navigation.style.padding.top.value' => '10',
      'header_front_page.navigation.hidden' => '',
      'header_front_page.navigation.props.showTopBar' => true,
      'header_front_page.hero.image.localProps.url' => '%s/images/void.png',
      'header_front_page.hero.image.style.descendants.image.boxShadow.layers.0' => 
      array (
        'x' => '2',
        'y' => '2',
        'spread' => '10',
        'blur' => '2',
        'color' => '#333',
      ),
      'header_front_page.hero.image.style.descendants.image.boxShadow.enabled' => '',
      'header_front_page.hero.image.props.frame.type' => 'border',
      'header_front_page.hero.image.style.descendants.frameImage.backgroundColor' => 'rgba(0, 0, 0, 0.5)',
      'header_front_page.hero.image.style.descendants.frameImage.width' => '100',
      'header_front_page.hero.image.style.descendants.frameImage.height' => '100',
      'header_front_page.hero.image.style.descendants.frameImage.transform.translate' => 
      array (
        'x' => 
        array (
          'path' => 'value',
        ),
        'x_value' => '4',
        'y' => 
        array (
          'path' => 'value',
        ),
        'y_value' => '6',
      ),
      'header_front_page.hero.image.style.descendants.frameImage.thickness' => '10',
      'header_front_page.hero.image.props.showFrameOverImage' => '',
      'header_front_page.hero.image.props.showFrameShadow' => '',
      'header_front_page.hero.image.props.enabledFrameOption' => false,
      'header_front_page.logo.section-style-plugin-message' => '',
      'header_front_page.logo.section-layout-plugin-message' => '',
      'header_front_page.header-menu.section-layout-plugin-message' => '',
      'header_front_page.title.section-style-plugin-message' => '',
      'header_front_page.title.section-layout-plugin-message' => '',
      'header_front_page.subtitle.section-style-plugin-message' => '',
      'header_front_page.subtitle.section-layout-plugin-message' => '',
      'header_front_page.button_group.section-style-plugin-message' => '',
      'header_front_page.button_group.section-layout-plugin-message' => '',
      'header_front_page.icon_list.section-style-plugin-message' => '',
      'header_front_page.icon_list.section-layout-plugin-message' => '',
      'header_front_page.social_icons.section-style-plugin-message' => '',
      'header_front_page.social_icons.section-layout-plugin-message' => '',
      'header_front_page.hero.image.section-style-plugin-message' => '',
      'header_front_page.hero.image.section-layout-plugin-message' => '',
    ),
  ),
  4 => 
  array (
    'image' => '%s/header-5-preview.jpg',
    'data' => 
    array (
      'header_front_page.logo.props.layoutType' => 'image',
      'header_front_page.header-menu.edit' => '',
      'header_front_page.header-menu.style.descendants.innerMenu.justifyContent' => 'center',
      'header_front_page.header-menu.props.showOffscreenMenuOn' => 'has-offcanvas-tablet',
      'header_front_page.header-menu.props.hoverEffect.type' => 'bordered-active-item bordered-active-item--bottom',
      'header_front_page.header-menu.props.hoverEffect.activeGroup' => 'border',
      'header_front_page.header-menu.props.hoverEffect.group.border.transition' => 'effect-borders-grow grow-from-center',
      'header_front_page.hero.props.heroSection.layout' => 'textWithMediaOnLeft',
      'header_front_page.hero.separator1' => '',
      'header_front_page.hero.hero_column_width' => '50',
      'header_front_page.hero.separator2' => '',
      'header_front_page.hero..pen' => '',
      'header_front_page.hero.full_height' => true,
      'header_front_page.hero.hero.separator2' => '',
      'header_front_page.hero.style.background.color' => '#03a9f4',
      'header_front_page.hero.style.background.type' => 'slideshow',
      'header_front_page.hero.style.background.image.0.source.url' => '%s/../images/beach-landscape-sea-water-nature-sand-1061655-pxhere.com.jpg',
      'header_front_page.hero.style.background.image.0.position' => 'center center',
      'header_front_page.hero.style.background.image.0.attachment' => 'scroll',
      'header_front_page.hero.style.background.image.0.repeat' => 'no-repeat',
      'header_front_page.hero.style.background.image.0.size' => 'cover',
      'header_front_page.hero.style.background.image.0.source.gradient' => 
      array (
        'name' => 'october_silence',
        'angle' => '0',
        'steps' => 
        array (
          0 => 
          array (
            'position' => '0',
            'color' => '#b721ff',
          ),
          1 => 
          array (
            'position' => '100',
            'color' => '#21d4fd',
          ),
        ),
      ),
      'header_front_page.hero.style.background.slideshow.slides' => '%5B%7B%22url%22%3A%22%25s%5C%2Fimages%5C%2Fguy-0-1561967557758.jpg%22%2C%22index%22%3A0%7D%2C%7B%22url%22%3A%22%25s%5C%2Fimages%5C%2Fglasses-1-1561967557758.jpg%22%2C%22index%22%3A1%7D%5D',
      'header_front_page.hero.style.background.slideshow.duration.value' => '1500',
      'header_front_page.hero.style.background.slideshow.speed.value' => '500',
      'header_front_page.hero.style.background.video.videoType' => 'external',
      'header_front_page.hero.style.background.video.externalUrl' => 'https://www.youtube.com/watch?v=y5zFszln1ao',
      'header_front_page.hero.style.background.video.internalUrl' => '%s/../videos/colibri-demo-video.mp4',
      'header_front_page.hero.style.background.video.poster.url' => '%s/../images/colibri-demo-video-cover.jpg',
      'header_front_page.hero.hero.separator5' => '',
      'header_front_page.hero.style.background.overlay.type' => 'gradient',
      'header_front_page.hero.style.background.overlay.shape.value' => 'none',
      'header_front_page.hero.style.background.overlay.light' => '',
      'header_front_page.hero.style.background.overlay.color.value' => '#000000',
      'header_front_page.hero.style.background.overlay.gradient' => '%7B%22steps%22%3A%5B%7B%22color%22%3A%22%23a18cd1%22%2C%22position%22%3A%220%22%7D%2C%7B%22color%22%3A%22%23fbc2eb%22%2C%22position%22%3A%22100%22%7D%5D%2C%22name%22%3A%22night_fade%22%2C%22angle%22%3A%220%22%7D',
      'header_front_page.hero.style.background.overlay.color.opacity_' => '70',
      'header_front_page.hero.style.background.overlay.enabled' => '1',
      'header_front_page.hero.hero.separator6' => '',
      'header_front_page.hero.style.separatorBottom.enabled' => false,
      'header_front_page.hero.style.separatorBottom.type' => 'mountains',
      'header_front_page.hero.style.separatorBottom.color' => '#FFF',
      'header_front_page.hero.style.separatorBottom.height.value' => '100',
      'header_front_page.hero.hero.separator1' => '',
      'header_front_page.hero.style.padding.top.value' => '150',
      'header_front_page.hero.style.padding.bottom.value' => '150',
      'header_front_page.title.show' => '1',
      'header_front_page.title.localProps.content' => 'Collection of spring',
      'header_front_page.title.style.textAlign' => 'left',
      'header_front_page.subtitle.show' => '1',
      'header_front_page.subtitle.localProps.content' => 'Fusce vitae magna sit amet orci bibendum volutpat id quis enim. Quisque viverra ligula sit amet porttitor ornare.',
      'header_front_page.subtitle.style.textAlign' => 'left',
      'header_front_page.button_group.show' => '1',
      'header_front_page.button_group.value' => '%5B%7B%22label%22%3A%22Get+started+today%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%220%22%2C%22index%22%3A0%7D%2C%7B%22label%22%3A%22Learn+more%22%2C%22url%22%3A%22%23%22%2C%22button_type%22%3A%221%22%2C%22index%22%3A1%7D%5D',
      'header_front_page.button_group.style.textAlign' => 'left',
      'header_front_page.icon_list.pen' => '',
      'header_front_page.navigation.props.layoutType' => 'logo-spacing-menu',
      'header_front_page.navigation.separator1' => '',
      'header_front_page.navigation.props.sticky' => '1',
      'header_front_page.navigation.separator2' => '',
      'header_front_page.navigation.props.width' => 'boxed',
      'header_front_page.navigation.style.padding.top.value' => '20',
      'header_front_page.navigation.hidden' => '',
      'header_front_page.navigation.props.showTopBar' => '',
      'header_front_page.hero.image.localProps.url' => '%s/images/void.png',
      'header_front_page.hero.image.style.descendants.image.boxShadow.layers.0' => 
      array (
        'x' => '2',
        'y' => '2',
        'spread' => '10',
        'blur' => '2',
        'color' => '#333',
      ),
      'header_front_page.hero.image.style.descendants.image.boxShadow.enabled' => '',
      'header_front_page.hero.image.props.frame.type' => 'border',
      'header_front_page.hero.image.style.descendants.frameImage.backgroundColor' => 'rgba(0, 0, 0, 0.5)',
      'header_front_page.hero.image.style.descendants.frameImage.width' => '100',
      'header_front_page.hero.image.style.descendants.frameImage.height' => '100',
      'header_front_page.hero.image.style.descendants.frameImage.transform.translate' => 
      array (
        'x' => 
        array (
          'path' => 'value',
        ),
        'x_value' => '4',
        'y' => 
        array (
          'path' => 'value',
        ),
        'y_value' => '6',
      ),
      'header_front_page.hero.image.style.descendants.frameImage.thickness' => '10',
      'header_front_page.hero.image.props.showFrameOverImage' => '',
      'header_front_page.hero.image.props.showFrameShadow' => '',
      'header_front_page.hero.image.props.enabledFrameOption' => false,
      'header_front_page.logo.section-style-plugin-message' => '',
      'header_front_page.logo.section-layout-plugin-message' => '',
      'header_front_page.header-menu.section-layout-plugin-message' => '',
      'header_front_page.title.section-style-plugin-message' => '',
      'header_front_page.title.section-layout-plugin-message' => '',
      'header_front_page.subtitle.section-style-plugin-message' => '',
      'header_front_page.subtitle.section-layout-plugin-message' => '',
      'header_front_page.button_group.section-style-plugin-message' => '',
      'header_front_page.button_group.section-layout-plugin-message' => '',
      'header_front_page.icon_list.section-style-plugin-message' => '',
      'header_front_page.icon_list.section-layout-plugin-message' => '',
      'header_front_page.social_icons.section-style-plugin-message' => '',
      'header_front_page.social_icons.section-layout-plugin-message' => '',
      'header_front_page.hero.image.section-style-plugin-message' => '',
      'header_front_page.hero.image.section-layout-plugin-message' => '',
    ),
  ),
);
template-defaults.php000064400000054467151335104360010716 0ustar00<?php return 
array (
  'sidebar_post' => 
  array (
    'sidebar' => 
    array (
      'selective_selector' => '[data-colibri-id="438-s1"]',
      'id' => '1',
      'nodeId' => '438-s1',
      'partialId' => '438',
      'styleRef' => '603',
    ),
  ),
  'header_front_page' => 
  array (
    'icon_list' => 
    array (
      'selective_selector' => '[data-colibri-id="7-h22"]',
      'id' => '22',
      'nodeId' => '7-h22',
      'partialId' => '7',
      'styleRef' => '141',
    ),
    'social_icons' => 
    array (
      'selective_selector' => '[data-colibri-id="7-h24"]',
      'id' => '24',
      'nodeId' => '7-h24',
      'partialId' => '7',
      'styleRef' => '143',
    ),
    'top_bar' => 
    array (
      'selective_selector' => '[data-colibri-id="7-h19"]',
      'id' => '19',
      'nodeId' => '7-h19',
      'partialId' => '7',
      'styleRef' => '138',
    ),
    'navigation' => 
    array (
      'props' => 
      array (
        'showTopBar' => true,
        'sticky' => true,
        'overlap' => true,
        'width' => 'boxed',
        'layoutType' => 'logo-spacing-menu',
      ),
      'selective_selector' => '[data-colibri-id="7-h2"]',
      'id' => '2',
      'nodeId' => '7-h2',
      'partialId' => '7',
      'styleRef' => '2',
      'style' => 
      array (
        'ancestor' => 
        array (
          'sticky' => 
          array (
            'background' => 
            array (
              'color' => '#ffffff',
            ),
          ),
        ),
        'background' => 
        array (
          'color' => 'transparent',
        ),
        'padding' => 
        array (
          'top' => 
          array (
            'value' => '20',
          ),
        ),
      ),
    ),
    'logo' => 
    array (
      'selective_selector' => '[data-colibri-id="7-h5"]',
      'id' => '5',
      'nodeId' => '7-h5',
      'partialId' => '7',
      'styleRef' => '5',
      'props' => 
      array (
        'layoutType' => 'image',
      ),
    ),
    'header-menu' => 
    array (
      'selective_selector' => '[data-colibri-id="7-h9"]',
      'id' => '9',
      'nodeId' => '7-h9',
      'partialId' => '7',
      'styleRef' => '9',
      'props' => 
      array (
        'sticky' => true,
        'hoverEffect' => 
        array (
          'type' => 'bordered-active-item bordered-active-item--bottom',
          'group' => 
          array (
            'border' => 
            array (
              'transition' => 'effect-borders-grow grow-from-center',
            ),
          ),
          'activeGroup' => 'border',
          'enabled' => true,
        ),
        'showOffscreenMenuOn' => 'has-offcanvas-tablet',
      ),
    ),
    'title' => 
    array (
      'selective_selector' => '[data-colibri-id="7-h28"]',
      'id' => '28',
      'nodeId' => '7-h28',
      'partialId' => '7',
      'styleRef' => '22',
      'style' => 
      array (
        'textAlign' => 'center',
      ),
    ),
    'subtitle' => 
    array (
      'selective_selector' => '[data-colibri-id="7-h29"]',
      'id' => '29',
      'nodeId' => '7-h29',
      'partialId' => '7',
      'styleRef' => '23',
    ),
    'button-0' => 
    array (
      'id' => '31',
      'nodeId' => '7-h31',
      'partialId' => '7',
      'styleRef' => '25',
    ),
    'button-1' => 
    array (
      'id' => '32',
      'nodeId' => '7-h32',
      'partialId' => '7',
      'styleRef' => '26',
    ),
    'button_group' => 
    array (
      'selective_selector' => '[data-colibri-id="7-h30"]',
      'id' => '30',
      'nodeId' => '7-h30',
      'partialId' => '7',
      'styleRef' => '24',
    ),
    'hero' => 
    array (
      'image' => 
      array (
        'selective_selector' => '[data-colibri-id="7-h34"]',
        'id' => '34',
        'nodeId' => '7-h34',
        'partialId' => '7',
        'styleRef' => '148',
        'style' => 
        array (
          'descendants' => 
          array (
            'image' => 
            array (
              'boxShadow' => 
              array (
                'enabled' => false,
                'layers' => 
                array (
                  0 => 
                  array (
                    'x' => '2',
                    'y' => '2',
                    'spread' => '10',
                    'blur' => '2',
                    'color' => '#333',
                  ),
                ),
              ),
            ),
            'frameImage' => 
            array (
              'backgroundColor' => 'rgba(0, 0, 0, 0.5)',
              'width' => 100,
              'height' => 100,
              'thickness' => 10,
              'border' => 
              array (
                'top' => 
                array (
                  'width' => 
                  array (
                    'path' => 'value',
                    'value' => '10',
                  ),
                  'color' => 'rgba(0, 0, 0, 0.5)',
                  'style' => 'solid',
                ),
                'bottom' => 
                array (
                  'width' => 
                  array (
                    'path' => 'value',
                    'value' => '10',
                  ),
                  'color' => 'rgba(0, 0, 0, 0.5)',
                  'style' => 'solid',
                ),
                'left' => 
                array (
                  'width' => 
                  array (
                    'path' => 'value',
                    'value' => '10',
                  ),
                  'color' => 'rgba(0, 0, 0, 0.5)',
                  'style' => 'solid',
                ),
                'right' => 
                array (
                  'width' => 
                  array (
                    'path' => 'value',
                    'value' => '10',
                  ),
                  'color' => 'rgba(0, 0, 0, 0.5)',
                  'style' => 'solid',
                ),
              ),
              'transform' => 
              array (
                'translate' => 
                array (
                  'x' => 
                  array (
                    'path' => 'value',
                  ),
                  'x_value' => '4',
                  'y' => 
                  array (
                    'path' => 'value',
                  ),
                  'y_value' => '6',
                ),
              ),
            ),
          ),
        ),
        'props' => 
        array (
          'frame' => 
          array (
            'type' => 'border',
          ),
          'enabledFrameOption' => false,
          'showFrameOverImage' => false,
          'showFrameShadow' => false,
        ),
      ),
      'row' => 
      array (
        'id' => '26',
        'nodeId' => '7-h26',
        'partialId' => '7',
        'styleRef' => '20',
      ),
      'column-1' => 
      array (
        'id' => '27',
        'nodeId' => '7-h27',
        'partialId' => '7',
        'styleRef' => '21',
      ),
      'column-2' => 
      array (
        'id' => '33',
        'nodeId' => '7-h33',
        'partialId' => '7',
        'styleRef' => '147',
      ),
      'selective_selector' => '[data-colibri-id="7-h25"]',
      'id' => '25',
      'nodeId' => '7-h25',
      'partialId' => '7',
      'styleRef' => '19',
      'style' => 
      array (
        'background' => 
        array (
          'type' => 'image',
          'color' => '#03a9f4',
          'overlay' => 
          array (
            'shape' => 
            array (
              'value' => 'circles',
              'isTile' => false,
            ),
            'light' => false,
            'color' => 
            array (
              'value' => '#000000',
              'opacity' => '0.7',
            ),
            'enabled' => true,
            'type' => 'gradient',
            'gradient' => 
            array (
              'angle' => '-20',
              'steps' => 
              array (
                0 => 
                array (
                  'color' => 'rgba(183, 33, 255, 0.8)',
                  'position' => '0',
                ),
                1 => 
                array (
                  'color' => 'rgba(33, 212, 253, 0.8)',
                  'position' => '100',
                ),
              ),
              'name' => 'october_silence',
            ),
          ),
          'image' => 
          array (
            0 => 
            array (
              'source' => 
              array (
                'url' => 'images-xheader-default-0-1545411152082.jpg',
                'gradient' => 
                array (
                  'name' => 'october_silence',
                  'angle' => 0,
                  'steps' => 
                  array (
                    0 => 
                    array (
                      'position' => '0',
                      'color' => '#b721ff',
                    ),
                    1 => 
                    array (
                      'position' => '100',
                      'color' => '#21d4fd',
                    ),
                  ),
                ),
              ),
              'attachment' => 'scroll',
              'position' => 'center center',
              'repeat' => 'no-repeat',
              'size' => 'cover',
              'useParallax' => false,
            ),
          ),
          'slideshow' => 
          array (
            'duration' => 
            array (
              'value' => 1500,
            ),
            'speed' => 
            array (
              'value' => 1500,
            ),
          ),
          'video' => 
          array (
            'videoType' => 'external',
            'externalUrl' => 'https://www.youtube.com/watch?v=y5zFszln1ao',
            'internalUrl' => 'https://static.colibriwp.com/assets/sources/colibri-demo-video.mp4',
            'poster' => 
            array (
              'url' => 'https://static.colibriwp.com/assets/sources/colibri-demo-video-cover.jpg',
            ),
          ),
        ),
        'padding' => 
        array (
          'top' => 
          array (
            'value' => '150',
            'unit' => 'px',
          ),
          'bottom' => 
          array (
            'value' => '150',
            'unit' => 'px',
          ),
        ),
        'separatorBottom' => 
        array (
          'enabled' => true,
        ),
      ),
      'props' => 
      array (
        'layoutType' => 'textWithMediaOnRight',
        'heroSection' => 
        array (
          'layout' => 'textWithMediaOnRight',
        ),
      ),
      'hero_column_width' => '50',
    ),
  ),
  'header_post' => 
  array (
    'icon_list' => 
    array (
      'selective_selector' => '[data-colibri-id="10-h22"]',
      'id' => '22',
      'nodeId' => '10-h22',
      'partialId' => '10',
      'styleRef' => '141',
    ),
    'social_icons' => 
    array (
      'selective_selector' => '[data-colibri-id="10-h24"]',
      'id' => '24',
      'nodeId' => '10-h24',
      'partialId' => '10',
      'styleRef' => '143',
    ),
    'top_bar' => 
    array (
      'selective_selector' => '[data-colibri-id="10-h19"]',
      'id' => '19',
      'nodeId' => '10-h19',
      'partialId' => '10',
      'styleRef' => '138',
    ),
    'navigation' => 
    array (
      'props' => 
      array (
        'showTopBar' => true,
        'sticky' => true,
        'overlap' => true,
        'width' => 'boxed',
        'layoutType' => 'logo-spacing-menu',
      ),
      'selective_selector' => '[data-colibri-id="10-h2"]',
      'id' => '2',
      'nodeId' => '10-h2',
      'partialId' => '10',
      'styleRef' => '200',
      'style' => 
      array (
        'ancestor' => 
        array (
          'sticky' => 
          array (
            'background' => 
            array (
              'color' => '#ffffff',
            ),
          ),
        ),
        'background' => 
        array (
          'color' => 'transparent',
        ),
        'padding' => 
        array (
          'top' => 
          array (
            'value' => '20',
          ),
        ),
      ),
    ),
    'logo' => 
    array (
      'selective_selector' => '[data-colibri-id="10-h5"]',
      'id' => '5',
      'nodeId' => '10-h5',
      'partialId' => '10',
      'styleRef' => '204',
      'props' => 
      array (
        'layoutType' => 'image',
      ),
    ),
    'header-menu' => 
    array (
      'selective_selector' => '[data-colibri-id="10-h9"]',
      'id' => '9',
      'nodeId' => '10-h9',
      'partialId' => '10',
      'styleRef' => '201',
      'props' => 
      array (
        'sticky' => true,
        'hoverEffect' => 
        array (
          'type' => 'bordered-active-item bordered-active-item--bottom',
          'group' => 
          array (
            'border' => 
            array (
              'transition' => 'effect-borders-grow grow-from-center',
            ),
          ),
          'activeGroup' => 'border',
          'enabled' => true,
        ),
        'showOffscreenMenuOn' => 'has-offcanvas-tablet',
      ),
    ),
    'title' => 
    array (
      'selective_selector' => '[data-colibri-id="10-h28"]',
    ),
    'hero' => 
    array (
      'row' => 
      array (
        'id' => '26',
        'nodeId' => '10-h26',
        'partialId' => '10',
        'styleRef' => '192',
      ),
      'column-1' => 
      array (
        'id' => '27',
        'nodeId' => '10-h27',
        'partialId' => '10',
        'styleRef' => '193',
      ),
      'selective_selector' => '[data-colibri-id="10-h25"]',
      'id' => '25',
      'nodeId' => '10-h25',
      'partialId' => '10',
      'styleRef' => '184',
      'style' => 
      array (
        'background' => 
        array (
          'type' => 'none',
          'color' => '${theme.colors.0}',
          'overlay' => 
          array (
            'shape' => 
            array (
              'value' => '',
              'isTile' => false,
            ),
            'light' => false,
            'color' => 
            array (
              'value' => '#000000',
              'opacity' => 80,
            ),
            'enabled' => true,
            'type' => 'gradient',
            'gradient' => 
            array (
              'name' => 'october_silence',
              'angle' => 0,
              'steps' => 
              array (
                0 => 
                array (
                  'position' => '0',
                  'color' => '#b721ff',
                ),
                1 => 
                array (
                  'position' => '100',
                  'color' => '#21d4fd',
                ),
              ),
            ),
          ),
          'image' => 
          array (
            0 => 
            array (
              'source' => 
              array (
                'url' => '',
                'gradient' => 
                array (
                  'name' => 'october_silence',
                  'angle' => 0,
                  'steps' => 
                  array (
                    0 => 
                    array (
                      'position' => '0',
                      'color' => '#b721ff',
                    ),
                    1 => 
                    array (
                      'position' => '100',
                      'color' => '#21d4fd',
                    ),
                  ),
                ),
              ),
              'attachment' => 'scroll',
              'position' => 'center center',
              'repeat' => 'no-repeat',
              'size' => 'cover',
              'useParallax' => false,
            ),
          ),
          'slideshow' => 
          array (
            'duration' => 
            array (
              'value' => 1500,
            ),
            'speed' => 
            array (
              'value' => 1500,
            ),
          ),
          'video' => 
          array (
            'videoType' => 'external',
            'externalUrl' => 'https://www.youtube.com/watch?v=y5zFszln1ao',
            'internalUrl' => 'https://static.colibriwp.com/assets/sources/colibri-demo-video.mp4',
            'poster' => 
            array (
              'url' => 'https://static.colibriwp.com/assets/sources/colibri-demo-video-cover.jpg',
            ),
          ),
        ),
        'padding' => 
        array (
          'top' => 
          array (
            'value' => '50',
            'unit' => 'px',
          ),
          'bottom' => 
          array (
            'value' => '50',
            'unit' => 'px',
          ),
        ),
        'separatorBottom' => NULL,
      ),
      'props' => 
      array (
        'layoutType' => 'textWithMediaOnRight',
        'heroSection' => 
        array (
          'layout' => 'textWithMediaOnRight',
        ),
      ),
      'hero_column_width' => '50',
      'image' => 
      array (
        'style' => 
        array (
          'descendants' => 
          array (
            'image' => 
            array (
              'boxShadow' => 
              array (
                'enabled' => false,
                'layers' => 
                array (
                  0 => 
                  array (
                    'x' => '2',
                    'y' => '2',
                    'spread' => '10',
                    'blur' => '2',
                    'color' => '#333',
                  ),
                ),
              ),
            ),
            'frameImage' => 
            array (
              'backgroundColor' => 'rgba(0, 0, 0, 0.5)',
              'width' => 100,
              'height' => 100,
              'thickness' => 10,
              'border' => 
              array (
                'top' => 
                array (
                  'width' => 
                  array (
                    'path' => 'value',
                    'value' => '10',
                  ),
                  'color' => 'rgba(0, 0, 0, 0.5)',
                  'style' => 'solid',
                ),
                'bottom' => 
                array (
                  'width' => 
                  array (
                    'path' => 'value',
                    'value' => '10',
                  ),
                  'color' => 'rgba(0, 0, 0, 0.5)',
                  'style' => 'solid',
                ),
                'left' => 
                array (
                  'width' => 
                  array (
                    'path' => 'value',
                    'value' => '10',
                  ),
                  'color' => 'rgba(0, 0, 0, 0.5)',
                  'style' => 'solid',
                ),
                'right' => 
                array (
                  'width' => 
                  array (
                    'path' => 'value',
                    'value' => '10',
                  ),
                  'color' => 'rgba(0, 0, 0, 0.5)',
                  'style' => 'solid',
                ),
              ),
              'transform' => 
              array (
                'translate' => 
                array (
                  'x' => 
                  array (
                    'path' => 'value',
                  ),
                  'x_value' => '4',
                  'y' => 
                  array (
                    'path' => 'value',
                  ),
                  'y_value' => '6',
                ),
              ),
            ),
          ),
        ),
        'props' => 
        array (
          'frame' => 
          array (
            'type' => 'border',
          ),
          'enabledFrameOption' => false,
          'showFrameOverImage' => false,
          'showFrameShadow' => false,
        ),
      ),
    ),
  ),
  'footer_post' => 
  array (
    'footer' => 
    array (
      'selective_selector' => '[data-colibri-id="13-f1"]',
      'id' => '1',
      'nodeId' => '13-f1',
      'partialId' => '13',
      'styleRef' => '49',
      'props' => 
      array (
        'useFooterParallax' => true,
      ),
    ),
  ),
  'main_404' => 
  array (
    'blog_posts_row' => 
    array (
      'id' => '2',
      'nodeId' => '22-m2',
      'partialId' => '22',
      'styleRef' => '104',
    ),
    404 => 
    array (
      'selective_selector' => '[data-colibri-id="22-m2"]',
      'id' => '2',
      'nodeId' => '22-m2',
      'partialId' => '22',
      'styleRef' => '104',
    ),
  ),
  'main_post' => 
  array (
    'blog_posts_row' => 
    array (
      'id' => '3',
      'nodeId' => '432-m3',
      'partialId' => '432',
      'styleRef' => '543',
    ),
    'post_thumbnail' => 
    array (
      'id' => '5',
      'nodeId' => '432-m5',
      'partialId' => '432',
      'styleRef' => '545',
    ),
    'post_meta' => 
    array (
      'id' => '8',
      'nodeId' => '432-m8',
      'partialId' => '432',
      'styleRef' => '548',
    ),
    'post' => 
    array (
      'selective_selector' => '[data-colibri-id="432-m2"]',
      'id' => '2',
      'nodeId' => '432-m2',
      'partialId' => '432',
      'styleRef' => '538',
    ),
  ),
  'main_archive' => 
  array (
    'blog_posts_row' => 
    array (
      'id' => '3',
      'nodeId' => '435-m3',
      'partialId' => '435',
      'styleRef' => '580',
    ),
    'post_thumbnail' => 
    array (
      'id' => '5',
      'nodeId' => '435-m5',
      'partialId' => '435',
      'styleRef' => '582',
    ),
    'post_meta' => 
    array (
      'id' => '8',
      'nodeId' => '435-m8',
      'partialId' => '435',
      'styleRef' => '585',
    ),
    'archive' => 
    array (
      'selective_selector' => '[data-colibri-id=""]',
      'id' => '1',
      'nodeId' => '435-m1',
      'partialId' => '435',
      'styleRef' => '574',
    ),
  ),
  'main_search' => 
  array (
    'blog_posts_row' => 
    array (
      'id' => '2',
      'nodeId' => '25-m2',
      'partialId' => '25',
      'styleRef' => '111',
    ),
    'post_meta' => 
    array (
      'id' => '8',
      'nodeId' => '25-m8',
      'partialId' => '25',
      'styleRef' => '117',
    ),
    'search' => 
    array (
      'selective_selector' => '[data-colibri-id=""]',
      'id' => '1',
      'nodeId' => '25-m1',
      'partialId' => '25',
      'styleRef' => '110',
    ),
  ),
  'templates' => 
  array (
    'blog' => 
    array (
      'row' => 
      array (
        'layout' => 
        array (
          'horizontalGap' => 2,
          'verticalGap' => 2,
        ),
        'layout-classes' => 
        array (
          'unset' => true,
          'outer_class' => 
          array (
            0 => 'gutters-row-lg-2',
          ),
          'inner_class' => 
          array (
            0 => 'gutters-col-lg-2',
          ),
        ),
      ),
      'section' => 
      array (
        'sidebars' => 
        array (
          'right' => true,
        ),
      ),
    ),
  ),
);
vendor/autoload.php000064400000000262151335104360010363 0ustar00<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit830b4242f52dcda28eda3141289ea4bf::getLoader();
vendor/composer/autoload_classmap.php000064400000000232151335104360014072 0ustar00<?php

// autoload_classmap.php @generated by Composer

$vendorDir = dirname( dirname( __FILE__ ) );
$baseDir   = dirname( $vendorDir );

return array();
vendor/composer/ClassLoader.php000064400000032572151335104360012607 0ustar00<?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Autoload;

use InvalidArgumentException;

/**
 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
 *
 *     $loader = new \Composer\Autoload\ClassLoader();
 *
 *     // register classes with namespaces
 *     $loader->add('Symfony\Component', __DIR__.'/component');
 *     $loader->add('Symfony',           __DIR__.'/framework');
 *
 *     // activate the autoloader
 *     $loader->register();
 *
 *     // to enable searching the include path (eg. for PEAR packages)
 *     $loader->setUseIncludePath(true);
 *
 * In this example, if you try to use a class in the Symfony\Component
 * namespace or one of its children (Symfony\Component\Console for instance),
 * the autoloader will first look for the class under the component/
 * directory, and it will then fallback to the framework/ directory if not
 * found before giving up.
 *
 * This class is loosely based on the Symfony UniversalClassLoader.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Jordi Boggiano <j.boggiano@seld.be>
 * @see    http://www.php-fig.org/psr/psr-0/
 * @see    http://www.php-fig.org/psr/psr-4/
 */
class ClassLoader {
    // PSR-4
    private $prefixLengthsPsr4 = array();
    private $prefixDirsPsr4 = array();
    private $fallbackDirsPsr4 = array();

    // PSR-0
    private $prefixesPsr0 = array();
    private $fallbackDirsPsr0 = array();

    private $useIncludePath = false;
    private $classMap = array();
    private $classMapAuthoritative = false;
    private $missingClasses = array();
    private $apcuPrefix;

    public function getPrefixes() {
        if ( ! empty( $this->prefixesPsr0 ) ) {
            return call_user_func_array( 'array_merge', $this->prefixesPsr0 );
        }

        return array();
    }

    public function getPrefixesPsr4() {
        return $this->prefixDirsPsr4;
    }

    public function getFallbackDirs() {
        return $this->fallbackDirsPsr0;
    }

    public function getFallbackDirsPsr4() {
        return $this->fallbackDirsPsr4;
    }

    public function getClassMap() {
        return $this->classMap;
    }

    /**
     * @param array $classMap Class to filename map
     */
    public function addClassMap( array $classMap ) {
        if ( $this->classMap ) {
            $this->classMap = array_merge( $this->classMap, $classMap );
        } else {
            $this->classMap = $classMap;
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix, either
     * appending or prepending to the ones previously set for this prefix.
     *
     * @param string $prefix The prefix
     * @param array|string $paths The PSR-0 root directories
     * @param bool $prepend Whether to prepend the directories
     */
    public function add( $prefix, $paths, $prepend = false ) {
        if ( ! $prefix ) {
            if ( $prepend ) {
                $this->fallbackDirsPsr0 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr0
                );
            } else {
                $this->fallbackDirsPsr0 = array_merge(
                    $this->fallbackDirsPsr0,
                    (array) $paths
                );
            }

            return;
        }

        $first = $prefix[0];
        if ( ! isset( $this->prefixesPsr0[ $first ][ $prefix ] ) ) {
            $this->prefixesPsr0[ $first ][ $prefix ] = (array) $paths;

            return;
        }
        if ( $prepend ) {
            $this->prefixesPsr0[ $first ][ $prefix ] = array_merge(
                (array) $paths,
                $this->prefixesPsr0[ $first ][ $prefix ]
            );
        } else {
            $this->prefixesPsr0[ $first ][ $prefix ] = array_merge(
                $this->prefixesPsr0[ $first ][ $prefix ],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace, either
     * appending or prepending to the ones previously set for this namespace.
     *
     * @param string $prefix The prefix/namespace, with trailing '\\'
     * @param array|string $paths The PSR-4 base directories
     * @param bool $prepend Whether to prepend the directories
     *
     * @throws InvalidArgumentException
     */
    public function addPsr4( $prefix, $paths, $prepend = false ) {
        if ( ! $prefix ) {
            // Register directories for the root namespace.
            if ( $prepend ) {
                $this->fallbackDirsPsr4 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr4
                );
            } else {
                $this->fallbackDirsPsr4 = array_merge(
                    $this->fallbackDirsPsr4,
                    (array) $paths
                );
            }
        } elseif ( ! isset( $this->prefixDirsPsr4[ $prefix ] ) ) {
            // Register directories for a new namespace.
            $length = strlen( $prefix );
            if ( '\\' !== $prefix[ $length - 1 ] ) {
                throw new InvalidArgumentException( "A non-empty PSR-4 prefix must end with a namespace separator." );
            }
            $this->prefixLengthsPsr4[ $prefix[0] ][ $prefix ] = $length;
            $this->prefixDirsPsr4[ $prefix ]                  = (array) $paths;
        } elseif ( $prepend ) {
            // Prepend directories for an already registered namespace.
            $this->prefixDirsPsr4[ $prefix ] = array_merge(
                (array) $paths,
                $this->prefixDirsPsr4[ $prefix ]
            );
        } else {
            // Append directories for an already registered namespace.
            $this->prefixDirsPsr4[ $prefix ] = array_merge(
                $this->prefixDirsPsr4[ $prefix ],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix,
     * replacing any others previously set for this prefix.
     *
     * @param string $prefix The prefix
     * @param array|string $paths The PSR-0 base directories
     */
    public function set( $prefix, $paths ) {
        if ( ! $prefix ) {
            $this->fallbackDirsPsr0 = (array) $paths;
        } else {
            $this->prefixesPsr0[ $prefix[0] ][ $prefix ] = (array) $paths;
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace,
     * replacing any others previously set for this namespace.
     *
     * @param string $prefix The prefix/namespace, with trailing '\\'
     * @param array|string $paths The PSR-4 base directories
     *
     * @throws InvalidArgumentException
     */
    public function setPsr4( $prefix, $paths ) {
        if ( ! $prefix ) {
            $this->fallbackDirsPsr4 = (array) $paths;
        } else {
            $length = strlen( $prefix );
            if ( '\\' !== $prefix[ $length - 1 ] ) {
                throw new InvalidArgumentException( "A non-empty PSR-4 prefix must end with a namespace separator." );
            }
            $this->prefixLengthsPsr4[ $prefix[0] ][ $prefix ] = $length;
            $this->prefixDirsPsr4[ $prefix ]                  = (array) $paths;
        }
    }

    /**
     * Turns on searching the include path for class files.
     *
     * @param bool $useIncludePath
     */
    public function setUseIncludePath( $useIncludePath ) {
        $this->useIncludePath = $useIncludePath;
    }

    /**
     * Can be used to check if the autoloader uses the include path to check
     * for classes.
     *
     * @return bool
     */
    public function getUseIncludePath() {
        return $this->useIncludePath;
    }

    /**
     * Turns off searching the prefix and fallback directories for classes
     * that have not been registered with the class map.
     *
     * @param bool $classMapAuthoritative
     */
    public function setClassMapAuthoritative( $classMapAuthoritative ) {
        $this->classMapAuthoritative = $classMapAuthoritative;
    }

    /**
     * Should class lookup fail if not found in the current class map?
     *
     * @return bool
     */
    public function isClassMapAuthoritative() {
        return $this->classMapAuthoritative;
    }

    /**
     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
     *
     * @param string|null $apcuPrefix
     */
    public function setApcuPrefix( $apcuPrefix ) {
        $this->apcuPrefix = function_exists( 'apcu_fetch' ) && filter_var( ini_get( 'apc.enabled' ),
            FILTER_VALIDATE_BOOLEAN ) ? $apcuPrefix : null;
    }

    /**
     * The APCu prefix in use, or null if APCu caching is not enabled.
     *
     * @return string|null
     */
    public function getApcuPrefix() {
        return $this->apcuPrefix;
    }

    /**
     * Registers this instance as an autoloader.
     *
     * @param bool $prepend Whether to prepend the autoloader or not
     */
    public function register( $prepend = false ) {
        spl_autoload_register( array( $this, 'loadClass' ), true, $prepend );
    }

    /**
     * Unregisters this instance as an autoloader.
     */
    public function unregister() {
        spl_autoload_unregister( array( $this, 'loadClass' ) );
    }

    /**
     * Loads the given class or interface.
     *
     * @param string $class The name of the class
     *
     * @return bool|null True if loaded, null otherwise
     */
    public function loadClass( $class ) {
        if ( $file = $this->findFile( $class ) ) {
            includeFile( $file );

            return true;
        }
    }

    /**
     * Finds the path to the file where the class is defined.
     *
     * @param string $class The name of the class
     *
     * @return string|false The path if found, false otherwise
     */
    public function findFile( $class ) {
        // class map lookup
        if ( isset( $this->classMap[ $class ] ) ) {
            return $this->classMap[ $class ];
        }
        if ( $this->classMapAuthoritative || isset( $this->missingClasses[ $class ] ) ) {
            return false;
        }
        if ( null !== $this->apcuPrefix ) {
            $file = apcu_fetch( $this->apcuPrefix . $class, $hit );
            if ( $hit ) {
                return $file;
            }
        }

        $file = $this->findFileWithExtension( $class, '.php' );

        // Search for Hack files if we are running on HHVM
        if ( false === $file && defined( 'HHVM_VERSION' ) ) {
            $file = $this->findFileWithExtension( $class, '.hh' );
        }

        if ( null !== $this->apcuPrefix ) {
            apcu_add( $this->apcuPrefix . $class, $file );
        }

        if ( false === $file ) {
            // Remember that this class does not exist.
            $this->missingClasses[ $class ] = true;
        }

        return $file;
    }

    private function findFileWithExtension( $class, $ext ) {
        // PSR-4 lookup
        $logicalPathPsr4 = strtr( $class, '\\', DIRECTORY_SEPARATOR ) . $ext;

        $first = $class[0];
        if ( isset( $this->prefixLengthsPsr4[ $first ] ) ) {
            $subPath = $class;
            while ( false !== $lastPos = strrpos( $subPath, '\\' ) ) {
                $subPath = substr( $subPath, 0, $lastPos );
                $search  = $subPath . '\\';
                if ( isset( $this->prefixDirsPsr4[ $search ] ) ) {
                    $pathEnd = DIRECTORY_SEPARATOR . substr( $logicalPathPsr4, $lastPos + 1 );
                    foreach ( $this->prefixDirsPsr4[ $search ] as $dir ) {
                        if ( file_exists( $file = $dir . $pathEnd ) ) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-4 fallback dirs
        foreach ( $this->fallbackDirsPsr4 as $dir ) {
            if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4 ) ) {
                return $file;
            }
        }

        // PSR-0 lookup
        if ( false !== $pos = strrpos( $class, '\\' ) ) {
            // namespaced class name
            $logicalPathPsr0 = substr( $logicalPathPsr4, 0, $pos + 1 )
                               . strtr( substr( $logicalPathPsr4, $pos + 1 ), '_', DIRECTORY_SEPARATOR );
        } else {
            // PEAR-like class name
            $logicalPathPsr0 = strtr( $class, '_', DIRECTORY_SEPARATOR ) . $ext;
        }

        if ( isset( $this->prefixesPsr0[ $first ] ) ) {
            foreach ( $this->prefixesPsr0[ $first ] as $prefix => $dirs ) {
                if ( 0 === strpos( $class, $prefix ) ) {
                    foreach ( $dirs as $dir ) {
                        if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-0 fallback dirs
        foreach ( $this->fallbackDirsPsr0 as $dir ) {
            if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) {
                return $file;
            }
        }

        // PSR-0 include paths.
        if ( $this->useIncludePath && $file = stream_resolve_include_path( $logicalPathPsr0 ) ) {
            return $file;
        }

        return false;
    }
}

/**
 * Scope isolated include.
 *
 * Prevents access to $this/self from included files.
 */
function includeFile( $file ) {
    include $file;
}
vendor/composer/autoload_psr4.php000064400000000305151335104360013160 0ustar00<?php

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'ColibriWP\\Theme\\' => array($baseDir . '/src'),
);
vendor/composer/autoload_real.php000064400000004765151335104360013231 0ustar00<?php

// autoload_real.php @generated by Composer

use Composer\Autoload\ClassLoader;
use Composer\Autoload\ComposerStaticInit830b4242f52dcda28eda3141289ea4bf;

class ComposerAutoloaderInit830b4242f52dcda28eda3141289ea4bf {
    private static $loader;

    public static function loadClassLoader( $class ) {
        if ( 'Composer\Autoload\ClassLoader' === $class ) {
            require __DIR__ . '/ClassLoader.php';
        }
    }

    public static function getLoader() {
        if ( null !== self::$loader ) {
            return self::$loader;
        }

        spl_autoload_register( array( 'ComposerAutoloaderInit830b4242f52dcda28eda3141289ea4bf', 'loadClassLoader' ),
            true, true );
        self::$loader = $loader = new ClassLoader();
        spl_autoload_unregister( array( 'ComposerAutoloaderInit830b4242f52dcda28eda3141289ea4bf', 'loadClassLoader' ) );

        $useStaticLoader = PHP_VERSION_ID >= 50600 && ! defined( 'HHVM_VERSION' ) && ( ! function_exists( 'zend_loader_file_encoded' ) || ! zend_loader_file_encoded() );
        if ( $useStaticLoader ) {
            require_once __DIR__ . '/autoload_static.php';

            call_user_func( ComposerStaticInit830b4242f52dcda28eda3141289ea4bf::getInitializer( $loader ) );
        } else {
            $map = require __DIR__ . '/autoload_namespaces.php';
            foreach ( $map as $namespace => $path ) {
                $loader->set( $namespace, $path );
            }

            $map = require __DIR__ . '/autoload_psr4.php';
            foreach ( $map as $namespace => $path ) {
                $loader->setPsr4( $namespace, $path );
            }

            $classMap = require __DIR__ . '/autoload_classmap.php';
            if ( $classMap ) {
                $loader->addClassMap( $classMap );
            }
        }

        $loader->register( true );

        if ( $useStaticLoader ) {
            $includeFiles = Composer\Autoload\ComposerStaticInit830b4242f52dcda28eda3141289ea4bf::$files;
        } else {
            $includeFiles = require __DIR__ . '/autoload_files.php';
        }
        foreach ( $includeFiles as $fileIdentifier => $file ) {
            composerRequire830b4242f52dcda28eda3141289ea4bf( $fileIdentifier, $file );
        }

        return $loader;
    }
}

function composerRequire830b4242f52dcda28eda3141289ea4bf( $fileIdentifier, $file ) {
    if ( empty( $GLOBALS['__composer_autoload_files'][ $fileIdentifier ] ) ) {
        require $file;

        $GLOBALS['__composer_autoload_files'][ $fileIdentifier ] = true;
    }
}
vendor/composer/autoload_static.php000064400000001755151335104360013571 0ustar00<?php

// autoload_static.php @generated by Composer

namespace Composer\Autoload;

use Closure;

class ComposerStaticInit830b4242f52dcda28eda3141289ea4bf {
    public static $files = array(
        '7e6cca5b119770fe793b2f9ca0e657fd' => __DIR__ . '/../..' . '/template-functions.php',
    );

    public static $prefixLengthsPsr4 = array(
        'C' =>
            array(
                'ColibriWP\\Theme\\' => 16,
            ),
    );

    public static $prefixDirsPsr4 = array(
        'ColibriWP\\Theme\\' =>
            array(
                0 => __DIR__ . '/../..' . '/src',
            ),
    );

    public static function getInitializer( ClassLoader $loader ) {
        return Closure::bind( function () use ( $loader ) {
            $loader->prefixLengthsPsr4 = ComposerStaticInit830b4242f52dcda28eda3141289ea4bf::$prefixLengthsPsr4;
            $loader->prefixDirsPsr4    = ComposerStaticInit830b4242f52dcda28eda3141289ea4bf::$prefixDirsPsr4;

        }, null, ClassLoader::class );
    }
}
vendor/composer/autoload_namespaces.php000064400000000234151335104360014410 0ustar00<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname( dirname( __FILE__ ) );
$baseDir   = dirname( $vendorDir );

return array();
vendor/composer/autoload_files.php000064400000000340151335104360013371 0ustar00<?php

// autoload_files.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    '7e6cca5b119770fe793b2f9ca0e657fd' => $baseDir . '/template-functions.php',
);
vendor/composer/LICENSE000064400000002056151335104360010701 0ustar00
Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


Youez - 2016 - github.com/yon3zu
LinuXploit