Your IP : 216.73.216.162


Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/
Upload File :
Current File : /home/x/b/o/xbodynamge/namtation/wp-content/customizer.tar

controls/custom-controls/radio-image/class-hestia-customize-control-radio-image.php000066600000012371151123453750024721 0ustar00<?php
/**
 * The radio image customize control extends the WP_Customize_Control class.  This class allows
 * developers to create a list of image radio inputs.
 *
 * Note, the `$choices` array is slightly different than normal and should be in the form of
 * `array(
 *  $value => array( 'url' => $image_url, 'label' => $text_label ),
 *  $value => array( 'url' => $image_url, 'label' => $text_label ),
 * )`
 *
 * @package Hestia
 * @since Hestia 1.1.24
 * @author     Justin Tadlock <justin@justintadlock.com>
 * @copyright  Copyright (c) 2008 - 2015, Justin Tadlock
 * @link       http://themehybrid.com/hybrid-core
 * @license    http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */

/**
 * Class Hestia_Customize_Control_Radio_Image
 */
class Hestia_Customize_Control_Radio_Image extends WP_Customize_Control {

	/**
	 * The type of customize control being rendered.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $type = 'radio-image';

	/**
	 * Flag to tell that this control is a tab
	 *
	 * @since 1.1.72
	 * @var   bool
	 */
	public $is_tab = false;

	/**
	 * Flag to tell that this control is a sub-tab in a tab
	 *
	 * @since 1.1.72
	 * @var   bool
	 */
	public $is_subtab = false;

	/**
	 * Controls in tabs.
	 *
	 * @since 1.1.72
	 * @var   array
	 */
	public $controls;

	/**
	 * Control data (tabs, names, icons, images)
	 *
	 * @since 1.1.72
	 * @var   array
	 */
	public $choices;

	/**
	 * Hestia_Customize_Control_Radio_Image constructor.
	 *
	 * @param WP_Customize_Manager $manager Customizer manager object.
	 * @param string               $id Control id.
	 * @param array                $args Control arguments.
	 */
	public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
		parent::__construct( $manager, $id, apply_filters( $id . '_filter_args', apply_filters( $id . '_filter_args', $args ) ) );

		if ( ! empty( $args['is_tab'] ) && $args['is_tab'] === true ) {
			$this->is_tab = $args['is_tab'];
			if ( ! empty( $args['is_subtab'] ) && $args['is_subtab'] === true ) {
				$this->is_subtab = $args['is_subtab'];
			}

			if ( ! empty( $this->choices ) ) {
				foreach ( $this->choices as $value => $args ) {
					$this->controls[ $value ] = $args['controls'];
				}
			}
		}

	}

	/**
	 * Loads the jQuery UI Button script and custom scripts/styles.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	public function enqueue() {
		wp_enqueue_script( 'jquery-ui-button' );
		wp_enqueue_script( 'hestia-radio-customize-controls', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/radio-image/script.js', array( 'jquery' ) );
		wp_enqueue_style( 'hestia-radio-customize-controls', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/radio-image/style.css' );
	}

	/**
	 * Add custom JSON parameters to use in the JS template.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return array
	 */
	public function json() {
		$json = parent::json();

		$json['is_tab']    = $this->is_tab;
		$json['is_subtab'] = $this->is_subtab;
		if ( $json['is_tab'] === true ) {
			$json['controls'] = $this->controls;
		}
		// We need to make sure we have the correct image URL.
		$json['choices'] = $this->choices;
		$json['id']      = $this->id;
		$json['link']    = $this->get_link();
		$json['value']   = $this->value();

		return $json;
	}

	/**
	 * Underscore JS template to handle the control's output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	public function content_template() {
		?>
		<#
				if ( ! data.choices ) {
				return;
				}
				#>
			<# if( !data.is_tab) {#>
				<# if ( data.label ) { #>
					<span class="customize-control-title">{{ data.label }}</span>
					<# } #>

						<# if ( data.description ) { #>
							<span class="description customize-control-description">{{{ data.description }}}</span>
							<# } #>
								<#}#>



									<div class="buttonset <# if( data.is_tab) {#>customizer-tab <#}#> <# if( data.is_subtab) {#>customizer-subtab <#}#>">

										<# for ( key in data.choices ) { #>

											<input <# if( data.is_tab) {#>data-controls="{{data.controls[key]}}"<#}#> type="radio" value="{{ key }}" name="_customize-{{ data.type }}-{{ data.id }}" id="{{ data.id }}-{{ key }}" {{{ data.link }}} <# if ( key === data.value && ( !data.is_tab || data.is_subtab) ) { #> checked="checked" <# } #> />
															<label for="{{ data.id }}-{{ key }}">
																<# if( !data.is_tab) {#>
																	<span class="screen-reader-text">{{ data.choices[ key ]['label'] }}</span>
																	<img src="{{ data.choices[ key ]['url'] }}" alt="{{ data.choices[ key ]['label'] }}" />
																	<# } else { #>
																		<# if( data.choices[ key ]['icon'] ){ #>
																			<i class="fa fa-{{ data.choices[ key ]['icon'] }}"></i>
																			<# }
																					if( data.choices[ key ]['url'] ){
																					#>
																				<img src="{{ data.choices[ key ]['url'] }}" alt="{{ data.choices[ key ]['label'] }}" />
																				<# }
																						if(data.choices[ key ]['label']){ #>
																					<span class="tab-label">{{ data.choices[ key ]['label'] }}</span>
																					<# } #>
																						<# } #>
															</label>
															<# } #>

									</div>
		<?php
	}
}
controls/custom-controls/radio-image/script.js000066600000010334151123453750015615 0ustar00jQuery( document ).ready( function() {

    // Use buttonset() for radio images.
    jQuery( '.customize-control-radio-image .buttonset' ).buttonset();

    jQuery.hestiaTab = {

        'init': function () {
            var firstTabControlName = this.initTabDefault();
            this.handleClick(firstTabControlName);
        },

        'handleClick':function (parentTabName) {
            var self = this;
            jQuery( '.customize-control-radio-image .buttonset.customizer-tab input:radio' ).click( function() {

                var controlsToShow = jQuery(this).data('controls');

                var controlsToShowArray = controlsToShow.split(',');
                var activeTabControlName = jQuery(this).parent().parent().attr('id').replace('customize-control-','');
                var currentSection = jQuery(this).parent().parent().parent();
                var allControlsToShow = controlsToShowArray;


                controlsToShowArray.forEach(function(controlId){
                    if( typeof wp.customize.control(controlId) !== 'undefined' ){
                        if( typeof wp.customize.control(controlId).params.is_tab !== 'undefined'){
                            var grandChildToShow = self.getControlsToShow(controlId);
                            allControlsToShow = allControlsToShow.concat(grandChildToShow);
                        }
                    }
                });

                allControlsToShow.push(activeTabControlName);
                allControlsToShow.push(parentTabName);

                self.hideControlExcept(currentSection, allControlsToShow);
            } );
        },

        'initTabDefault': function () {

            var section = jQuery('ul.accordion-section');

            //First tab control in section
            var firstTabControl = section.find('.customizer-tab').first();
            var currentSection = firstTabControl.parent().parent();
            var firstTabControlName = firstTabControl.parent().attr('id').replace('customize-control-','');
            var firstTab = firstTabControl.children('input').first();
            firstTabControl.children('label').removeClass('ui-state-active');
            firstTabControl.children('label').first().addClass('ui-state-active');
            var controlsToShow = firstTab.data('controls');
            var controlsToShowArray = controlsToShow.split(',');
            var allControlsToShow = controlsToShowArray;

            /**
             * Beside the controls that are defined in tab, we must check if there is another tab in this tab and
             * to show its controls.
             */
            var self = this;
            controlsToShowArray.forEach(function(controlId){
                if ( typeof wp.customize.control( controlId ) !== 'undefined' ) {
                    var is_tab = wp.customize.control(controlId).params.is_tab;
                    if( typeof is_tab !== 'undefined' && is_tab === true ){
                        var grandChildToShow = self.getControlsToShow(controlId);
                        allControlsToShow = allControlsToShow.concat(grandChildToShow);
                    }
                }
            });
            allControlsToShow.push(firstTabControlName);


            this.hideControlExcept(currentSection, allControlsToShow);
            return firstTabControlName;

        },
        'getControlsToShow': function (controlId) {
            var firstTabControl = jQuery('#customize-control-'+controlId).find('.customizer-tab').first();
            var firstTab = firstTabControl.children('input:checked');
            var controlsToShow = firstTab.data('controls');
            if( typeof controlsToShow !== 'undefined' ){
                return controlsToShow.split(',');
            }
            return [];
        },
        'hideControlExcept':function (section, controls) {
            jQuery(section).find('.customize-control').hide();
            for( var i in controls ){
                if( controls[i] === 'widgets' ){
                    jQuery( section ).children( 'li[class*="widget"]' ).css( 'display', 'list-item' );
                } else {
                    jQuery(section).find('#customize-control-'+controls[i]).show();
                }
            }
        }
    };
    // jQuery.hestiaTab.init();

} );controls/custom-controls/radio-image/style.css000066600000004276151123453750015635 0ustar00.customize-control-radio-image .ui-buttonset {
    text-align: center;
}
.customize-control-radio-image label {
    display: inline-block;
    max-width: 33.3%;
    padding: 3px;
    font-size: inherit;
    line-height: inherit;
    height: auto;
    cursor: pointer;
    border-width: 0;
    -webkit-appearance: none;
    -webkit-border-radius: 0;
    border-radius: 0;
    white-space: nowrap;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    color: inherit;
    background: none;
    -webkit-box-shadow: none;
    box-shadow: none;
    vertical-align: inherit;
}
.customize-control-radio-image label:first-of-type {
    float: left;
}
.customize-control-radio-image label:nth-of-type(n + 3){
    float: right;
}
.customize-control-radio-image label:hover {
    background: none;
    border-color: inherit;
    color: inherit;
}
.customize-control-radio-image label:active {
    background: none;
    border-color: inherit;
    -webkit-box-shadow: none;
    box-shadow: none;
    -webkit-transform: none;
    -ms-transform: none;
    transform: none;
}
.customize-control-radio-image img { border: 1px solid transparent; }
.customize-control-radio-image .ui-state-active img {
    border-color: #00b6ff;
    -webkit-box-shadow: 0 0 1px #3ec8ff;
    box-shadow: 0 0 5px #3EC8FE;
}

#customize-control-header_video, #customize-control-external_header_video{
    display: none;
}

/**
 * Tab styling
 */
.customizer-tab:not(.customizer-subtab){
    display: table;
    width: calc(100% + 28px);
    margin: -15px 0 0 -12px;
}
.customizer-tab:not(.customizer-subtab) label{
    border-right: 1px solid #ddd;
    display: inherit;
    width: 50%;
    vertical-align: top;
    max-width: 100%;
    text-transform: capitalize;
    background: #fff;
    padding: 10px 0;
    text-decoration: none;
    font-weight: 600;
    transition: all .3s ease;
    color: #333;
}
.customizer-tab:not(.customizer-subtab) label i{
    color: #333;
    margin-right: 4px;
}
.customizer-tab:not(.customizer-subtab) label.ui-state-active{
    box-shadow: inset 0 -3px 0 0 #0085ba;
    color: #0085ba;
    background-color: #fff;
}

.customizer-tab:not(.customizer-subtab) label:last-child{
    border:none;
}controls/custom-controls/customizer-page-editor/class-hestia-customizer-page-editor-helper.php000066600000015663151123453750027157 0ustar00<?php
/**
 * Page editor helper class.
 *
 * @package Hestia
 * @since   Hestia 1.1.3
 */

/**
 * Class Hestia_Customizer_Page_Editor_Helper
 */
class Hestia_Customizer_Page_Editor_Helper extends Hestia_Abstract_Main {
	/**
	 * Initialize Customizer Page Editor Helper.
	 */
	public function init() {
		add_action( 'customize_controls_print_footer_scripts', array( $this, 'customize_editor' ), 1 );
		add_action( 'save_post', array( $this, 'trigger_sync_from_page' ), 10 );
		add_action( 'customize_save', array( $this, 'trigger_sync_from_customizer' ), 10 );
		add_action( 'after_setup_theme', array( $this, 'sync_controls' ) );
		add_action( 'wp_ajax_hestiaUpdateFrontPageChange', array( $this, 'update_frontpage_change' ) );

		add_filter( 'tiny_mce_before_init', array( $this, 'override_tinymce_options' ) );
		add_filter( 'wp_default_editor', array( $this, 'change_editor_mode_to_html' ) );
		$this->filter_content();
	}

	/**
	 * Display editor for page editor control.
	 *
	 * @since 1.1.51
	 */
	public function customize_editor() {
		?>
		<div id="wp-editor-widget-container" style="display: none;">
			<a class="close" href="javascript:WPEditorWidget.hideEditor();"><span class="icon"></span></a>
			<div class="editor">
				<?php
				$settings = array(
					'textarea_rows' => 55,
					'editor_height' => 260,
				);
				wp_editor( '', 'wpeditorwidget', $settings );
				?>
			</div>
		</div>
		<?php
	}

	/**
	 * When the frontpage is edited, we set a flag with 'sync_customizer' value to know that we should update
	 * hestia_page_editor and hestia_feature_thumbnail customizer controls.
	 *
	 * @param int $post_id ID of the post that we need to update.
	 *
	 * @since 1.1.60
	 */
	public function trigger_sync_from_page( $post_id ) {
		$frontpage_id = get_option( 'page_on_front' );
		if ( empty( $frontpage_id ) ) {
			return;
		}

		if ( intval( $post_id ) === intval( $frontpage_id ) ) {
			update_option( 'hestia_sync_needed', 'sync_customizer' );
		};
	}

	/**
	 * When customizer is saved, we set the flag to 'sync_page' value to know that we should update the frontpage
	 * content and feature image.
	 *
	 * @since 1.1.60
	 */
	function trigger_sync_from_customizer() {
		$frontpage_id = get_option( 'page_on_front' );
		if ( ! empty( $frontpage_id ) ) {
			update_option( 'hestia_sync_needed', 'sync_page' );
		}
	}


	/**
	 * Based on 'hestia_sync_needed' option value, update either page or customizer controls and then we update
	 * the flag as false to know that we don't need to update anything.
	 *
	 * @since 1.1.60
	 */
	function sync_controls() {
		$should_sync = get_option( 'hestia_sync_needed' );
		if ( $should_sync === false ) {
			return;
		}
		$frontpage_id = get_option( 'page_on_front' );
		if ( empty( $frontpage_id ) ) {
			return;
		}
		switch ( $should_sync ) {
			// Synchronize customizer controls with page content
			case 'sync_customizer':
				$content = get_post_field( 'post_content', $frontpage_id );
				set_theme_mod( 'hestia_page_editor', $content );

				$featured_image = '';
				if ( has_post_thumbnail( $frontpage_id ) ) {
					$featured_image = get_the_post_thumbnail_url( $frontpage_id );
				} else {
					$thumbnail = get_theme_mod( 'hestia_feature_thumbnail', get_template_directory_uri() . '/assets/img/contact.jpg' );
					if ( $thumbnail === get_template_directory_uri() . '/assets/img/contact.jpg' ) {
						$featured_image = get_template_directory_uri() . '/assets/img/contact.jpg';
					}
				}
				set_theme_mod( 'hestia_feature_thumbnail', $featured_image );
				break;
			// Synchronize frontpage content with customizer values.
			case 'sync_page':
				$content = get_theme_mod( 'hestia_page_editor' );
				if ( ! empty( $frontpage_id ) ) {
					if ( ! wp_is_post_revision( $frontpage_id ) ) {

						// update the post, which calls save_post again
						$post = array(
							'ID'           => $frontpage_id,
							'post_content' => wp_kses_post( $content ),
						);
						wp_update_post( $post );
					}
				}
				$thumbnail    = get_theme_mod( 'hestia_feature_thumbnail', get_template_directory_uri() . '/assets/img/contact.jpg' );
				$thumbnail_id = attachment_url_to_postid( $thumbnail );
				update_post_meta( $frontpage_id, '_thumbnail_id', $thumbnail_id );

				break;
		}
		update_option( 'hestia_sync_needed', false );
	}


	/**
	 * This function updates controls from customizer (about content and featured background) when you change your
	 * frontpage.
	 */
	public function update_frontpage_change() {
		$pid          = $_POST['pid'];
		$return_value = array();

		$content = get_post_field( 'post_content', $pid );
		set_theme_mod( 'hestia_page_editor', $content );

		$featured_image = '';
		if ( has_post_thumbnail( $pid ) ) {
			$featured_image = get_the_post_thumbnail_url( $pid );
		} else {
			$thumbnail = get_theme_mod( 'hestia_feature_thumbnail', get_template_directory_uri() . '/assets/img/contact.jpg' );
			if ( $thumbnail === get_template_directory_uri() . '/assets/img/contact.jpg' ) {
				$featured_image = get_template_directory_uri() . '/assets/img/contact.jpg';
			}
		}

		set_theme_mod( 'hestia_feature_thumbnail', $featured_image );

		$return_value['post_content']   = $content;
		$return_value['post_thumbnail'] = $featured_image;
		echo json_encode( $return_value );

		die();
	}


	/**
	 * Hestia allow all HTML tags in TinyMce editor.
	 *
	 * @param array $init_array TinyMce settings.
	 *
	 * @return array
	 */
	public function override_tinymce_options( $init_array ) {
		$opts                                  = '*[*]';
		$init_array['valid_elements']          = $opts;
		$init_array['extended_valid_elements'] = $opts;

		return $init_array;
	}


	/**
	 * Change the default mode of the editor to html when using the tinyMce editor in customizer.
	 *
	 * @param string $editor_mode The current mode of the default editor.
	 *
	 * @return string The new mode (visual or html) of the editor, if we are in the customizer page.
	 */
	public function change_editor_mode_to_html( $editor_mode ) {
		if ( is_customize_preview() && function_exists( 'get_current_screen' ) ) {
			$screen = get_current_screen();
			if ( ! isset( $screen->id ) ) {
				return $editor_mode;
			}

			if ( $screen->id === 'customize' ) {
				return 'tmce';
			}
		}

		return $editor_mode;
	}

	/**
	 * This filter is used to filter the content of the post after it is retrieved from the database and before it is
	 * printed to the screen.
	 * Initial we've applied 'the_content' filter but that was wrong because it relies on the global $post being set.
	 * Otherwise, it can break plugins. See https://github.com/Codeinwp/hestia-pro/issues/309 for the issue.
	 * For more explanations check this link https://themehybrid.com/weblog/how-to-apply-content-filters
	 */
	private function filter_content() {
		add_filter( 'hestia_text', 'wptexturize' );
		add_filter( 'hestia_text', 'convert_smilies' );
		add_filter( 'hestia_text', 'convert_chars' );
		add_filter( 'hestia_text', 'wpautop' );
		add_filter( 'hestia_text', 'shortcode_unautop' );
		add_filter( 'hestia_text', 'do_shortcode' );
	}
}
controls/custom-controls/customizer-page-editor/class-hestia-page-editor.php000066600000005206151123453750023470 0ustar00<?php
/**
 * Page editor control
 *
 * @package Hestia
 * @since Hestia 1.1.3
 */

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return null;
}

/**
 * Class to create a custom tags control
 */
class Hestia_Page_Editor extends WP_Customize_Control {

	/**
	 * Flag to include sync scripts if needed
	 *
	 * @var bool|mixed
	 */
	private $needsync = false;

	/**
	 * Hestia_Page_Editor constructor.
	 *
	 * @param WP_Customize_Manager $manager Manager.
	 * @param string               $id Id.
	 * @param array                $args Constructor args.
	 */
	public function __construct( $manager, $id, $args = array() ) {
		parent::__construct( $manager, $id, $args );
		if ( ! empty( $args['needsync'] ) ) {
			$this->needsync = $args['needsync'];
		}
	}

	/**
	 * Enqueue scripts
	 *
	 * @since   1.1.0
	 * @access  public
	 * @updated Changed wp_enqueue_scripts order and dependencies.
	 */
	public function enqueue() {
		wp_enqueue_style( 'hestia_text_editor_css', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/customizer-page-editor/css/hestia-page-editor.css', array(), HESTIA_VERSION );
		wp_enqueue_script(
			'hestia_text_editor', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/customizer-page-editor/js/hestia-text-editor.js', array(
				'jquery',
				'customize-preview',
			), HESTIA_VERSION, false
		);
		if ( $this->needsync === true ) {
			wp_enqueue_script( 'hestia_controls_script', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/customizer-page-editor/js/hestia-update-controls.js', array( 'jquery', 'hestia_text_editor' ), HESTIA_VERSION, true );
			wp_localize_script(
				'hestia_controls_script', 'requestpost', array(
					'ajaxurl'           => admin_url( 'admin-ajax.php' ),
					'thumbnail_control' => 'hestia_feature_thumbnail', // name of image control that needs sync
					'editor_control'    => 'hestia_page_editor', // name of control (theme_mod) that needs sync
					'thumbnail_label'   => esc_html__( 'About background', 'hestia' ), // name of thumbnail control
				)
			);
		}
	}

	/**
	 * Render the content on the theme customizer page
	 */
	public function render_content() {
		?>
		<label>
			<?php if ( ! empty( $this->label ) ) : ?>
				<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
			<?php endif; ?>
			<input type="hidden" <?php $this->link(); ?> value="<?php echo esc_textarea( $this->value() ); ?>" id="<?php echo esc_attr( $this->id ); ?>" class="editorfield">
			<button data-editor-id="<?php echo esc_attr( $this->id ); ?>" class="button edit-content-button"><?php _e( '(Edit)', 'hestia' ); ?></button>
		</label>
		<?php
	}
}
controls/custom-controls/customizer-page-editor/js/hestia-text-editor.js000066600000007406151123453750022702 0ustar00/**
 * Text editor
 *
 * @package Hestia
 */

/* global tinyMCE */
/* global wp */

/* exported WPEditorWidget */
var WPEditorWidget = {

	/**
	 * Current content id
	 *
	 * @var string Current content id.
	 */
    contentId: '',

	/**
	 * Z index for Overlay
	 *
	 * @var int Z index for Overlay.
	 */
	wpFullOverlayOriginalZIndex: 0,

	/**
	 * Visible or not
	 *
	 * @var bool Visible or not.
	 */
	isVisible: false,


	init: function ( contentId ) {
		this.contentId = contentId;
		return this;
    },

	run: function ( editorWidget ) {
        editorWidget.toggleEditor();
        editorWidget.updateTinyMCE();
        editorWidget.updateWPEditor();
    },

	/**
	 * Show/Hide editor
	 */
	toggleEditor: function(){
		if ( this.isVisible === true ) {
			this.hideEditor();
		} else {
			this.showEditor( this.contentId );
		}
	},

	/**
	 * Show the editor
	 *
	 * @param contentId
	 */
	showEditor: function(contentId) {
		this.isVisible = true;
		var overlay    = jQuery( '.wp-full-overlay' );

		jQuery( 'body.wp-customizer #wp-editor-widget-container' ).fadeIn( 100 ).animate( {'bottom':'0'} );

		this.wpFullOverlayOriginalZIndex = parseInt( overlay.css( 'zIndex' ) );
		overlay.css( { zIndex: 49000 } );

		this.setEditorContent( contentId );
	},

	/**
	 * Hide editor
	 */
	hideEditor: function() {
		this.isVisible = false;
		jQuery( 'body.wp-customizer #wp-editor-widget-container' ).animate( {'bottom':'-650px'} ).fadeOut();
		jQuery( '.wp-full-overlay' ).css( { zIndex: this.wpFullOverlayOriginalZIndex } );
	},

	/**
	 * Set editor content
	 */
	setEditorContent: function(contentId) {
		var editor  = tinyMCE.get( 'wpeditorwidget' );
		var content = jQuery( '#' + contentId ).val();

		if (typeof editor === 'object' && editor !== null) {
			editor.setContent( content );
		}
		jQuery( '#wpeditorwidget' ).val( content );
	},

    updateTinyMCE: function () {
        var editor  = tinyMCE.get( 'wpeditorwidget' );
		var th = this;
		if( typeof editor !== 'undefined' && editor) {
            editor.on('NodeChange KeyUp', function () {
				th.doUpdate(editor);
            });
        }
    },

    updateWPEditor: function () {
        var editorWidget = document.getElementById( 'wpeditorwidget' );
        var th = this;

        jQuery(editorWidget).on('keyup', function () {
        	var newContent = this.value;
            var contentField = jQuery( '#' + th.contentId );
			contentField.val(newContent);
			contentField.trigger('change');
        });
    },

	doUpdate: function ( editor ) {
        var content = editor.getContent();
        var contentField = jQuery( '#' + this.contentId );
        contentField.val( content );
        contentField.trigger('change');
    }

};

jQuery( window ).load(function () {

	var editor;

	/**
	 * This handles the click form customizer control.
	 */
	jQuery(document).on('click','.edit-content-button',function (event) {
		event.preventDefault();
		var editorId = jQuery(this).data('editor-id');
		if( typeof editorId !== 'undefined' ) {
			editor = WPEditorWidget.init(editorId);
			WPEditorWidget.run(editor);
		}
	});

	/**
	 * Toggle editor when the user clicks on customizer shortcut.
	 */
	var customize = wp.customize;
	customize.previewer.bind(
		'trigger-open-editor', function( data ) {
            if( typeof data !== 'undefined'){
				editor = WPEditorWidget.init(data);
				WPEditorWidget.run(editor);
            }
		}
	);

	/**
	 * Hide the editor if the user clicks on back button to exit about panel.
	 */
	jQuery( '.customize-section-back' ).on(
		'click',function(){
			if( typeof editor !== 'undefined' ){
				editor.hideEditor();
			}
		}
	);

	/**
	 * Focus menu when the user clicks on customizer shortcut of the menu.
	 */
	customize.previewer.bind(
		'trigger-focus-menu', function() {
			wp.customize.section( 'menu_locations' ).focus();
		}
	);
});
controls/custom-controls/customizer-page-editor/js/hestia-update-controls.js000066600000006063151123453750023553 0ustar00/**
 * Update controls
 *
 * @package Hestia
 */

/* global requestpost */
/* global wp */
/* global WPEditorWidget */

( function( $ ) {
	'use strict';
	wp.customize(
		'page_on_front', function( value ) {

			value.bind(
				function( newval ) {

					$.ajax(
						{
							url: requestpost.ajaxurl,
							type: 'post',
							data: {
								action: 'hestiaUpdateFrontPageChange',
								pid: newval
							},
							success: function (result) {
								if (result !== '' && result !== 'undefined' ) {

									result      = JSON.parse( result );
									var html, content = result.post_content;
									jQuery( '#hestia_page_editor' ).val( content );
									WPEditorWidget.setEditorContent( 'hestia_page_editor' );

									if (result.post_thumbnail !== '' && result.post_thumbnail !== 'undefined') {
										wp.customize.instance( requestpost.thumbnail_control ).set( result.post_thumbnail );
										html = '<label for="hestia_feature_thumbnail-button">' +
										'<span class="customize-control-title">' + requestpost.thumbnail_label + '</span>' +
										'</label>' +
										'<div class="attachment-media-view attachment-media-view-image landscape">' +
										'<div class="thumbnail thumbnail-image">' +
										'<img class="attachment-thumb" src="' + result.post_thumbnail + '" draggable="false" alt=""> ' +
										'</div>' +
										'<div class="actions">' +
										'<button type="button" class="button remove-button">Remove</button>' +
										'<button type="button" class="button upload-button control-focus" id="hestia_feature_thumbnail-button">Change Image</button> ' +
										'<div style="clear:both"></div>' +
										'</div>' +
										'</div>';
									} else {
                                        wp.customize.instance( requestpost.thumbnail_control ).set( '' );
										html = '<label class="customize-control-title" for="customize-media-control-button-105">About background</label>' +
                                            '<div class="customize-control-notifications-container" style="display: none;"><ul></ul></div>' +
                                            '<div class="attachment-media-view">\n' +
                                            '<div class="placeholder">' +
                                            'No image selected' +
                                            '</div>' +
                                            '<div class="actions">' +
                                            '<button type="button" class="button default-button">Default</button>' +
                                            '<button type="button" class="button upload-button" id="customize-media-control-button-105">Select image</button>' +
                                            '</div>' +
                                            '</div>';
									}
                                    wp.customize.control( requestpost.thumbnail_control ).container['0'].innerHTML = html;
									wp.customize.instance( requestpost.editor_control ).previewer.refresh();
								}
							}
						}
					);

				}
			);
		}
	);
} )( jQuery );
controls/custom-controls/customizer-page-editor/css/hestia-page-editor.css000066600000002771151123453750023162 0ustar00/*EDIT CONTENT CONTROL*/
.edit-content-button{  margin-bottom: 10px;}
.edit-content-button:before{content: "\f464";opacity: 0.6;background-color: #ddd;padding: 4px 5px;margin-left: -10px;margin-right: 7px;font-size: 18px;vertical-align: top;border-radius: 2px 0 0 2px;font-family: 'dashicons';}

/*--------------------------WIDGETS------------------------------------*/
#wp-editor-widget-container{position:fixed;left:0;right:0;bottom:0;z-index:9999999;background:#f1f1f1;border-top:1px solid #ddd;}



@media screen and (min-width: 800px){
	#wp-editor-widget-container{
		left:300px;
	}
}

@media screen and (min-width: 1667px){
	#wp-editor-widget-container{
		left:18%;
	}
}

#wp-editor-widget-container .close{position:absolute;top:17px;right:7px;width:30px;height:30px;z-index:1000; text-decoration: none; opacity:0.4; text-align: center;}
#wp-editor-widget-container .close{ opacity:0.7;}
#wp-editor-widget-container .icon:after{font: 400 22px/45px dashicons; content: "\f335";color: #888;text-decoration: none!important; line-height: 30px}
#wp-editor-widget-container .close:active{outline:0}
#wp-editor-widget-container .editor{margin:50px}
#available-widgets [class*=wp_editor_widget] .widget-title:before{content:"\f478"}

body.wp-customizer #wp-editor-widget-container{ bottom:-650px;}
body.wp-customizer #wp-editor-widget-container.editoron{ bottom:0;}
body.wp-customizer #wp-editor-widget-container .editor {margin: 10px; margin-top: 55px;}
body.widgets_access .widget-position table tr:nth-child(3) {display: none;}
controls/custom-controls/repeater/icon-picker/icon-picker.css000066600000004457151123453750020535 0ustar00.iconpicker .iconpicker-items,.iconpicker .iconpicker-items:after,.iconpicker-popover .popover-footer:after,.iconpicker:after{clear:both}.iconpicker-popover.popover{position:absolute;padding:1px;text-align:left;background:#e5e5e5;z-index:999;display:none;margin-left:-10px;width:254px}.iconpicker,.iconpicker-popover.popover.iconpicker-visible{display:block}.iconpicker-popover.popover .popover-title{padding:5px;font-size:5px;line-height:16px;border-bottom:1px solid #ebebeb;background-color:#e5e5e5}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px}.iconpicker-popover.popover .popover-title-text~input[type=search].iconpicker-search{margin-top:14px}.iconpicker-popover.popover .popover-content{padding:0;text-align:center}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker *,.icp-container{position:relative}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.bottomLeft>.arrow{border-top-width:0;border-bottom-color:#e5e5e5;top:-11px}.iconpicker-popover.popover.bottomLeft>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#e5e5e5}.iconpicker-popover.popover.bottomLeft>.arrow{left:14px;margin-left:0}.iconpicker,.iconpicker .iconpicker-items{position:relative;margin:0;overflow:hidden}.iconpicker{text-align:left;text-shadow:none;line-height:0}.iconpicker .iconpicker-items:after,.iconpicker .iconpicker-items:before,.iconpicker:after,.iconpicker:before{content:" ";display:table}.iconpicker *{box-sizing:content-box}.iconpicker .iconpicker-items{float:none;padding:5px 0 0 5px;background:#fff;overflow-y:auto;min-height:55px;max-height:275px}.iconpicker .iconpicker-items i{float:left;width:32px;height:32px;line-height:32px;margin:0 7px 7px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:18px;color:#444;box-shadow:0 0 0 1px #ddd;transition:transform .2s ease}.iconpicker .iconpicker-items i:nth-child(6n){margin-right:0}.iconpicker .iconpicker-items i:hover{transform:scale(1.4);color:#008ec2;box-shadow:none}.icp{padding-left:30px}.icp-container .input-group-addon{position:absolute;top:1px;left:5px;padding:3px}controls/custom-controls/repeater/icon-picker/icon-picker.js000066600000003647151123453750020361 0ustar00/**
 * Fontawesome iconpicker control in the repeater
 *
 * @package Hestia
 */
(function ($) {
	'use strict';
	wp.customizerRepeater = {

		init: function () {
			$( '.iconpicker-items>i' ).on(
				'click', function () {
					var iconClass  = $( this ).attr( 'class' ).slice( 3 );
					var classInput = $( this ).parents( '.iconpicker-popover' ).prev().find( '.icp' );
					classInput.val( iconClass );
					classInput.attr( 'value', iconClass );

					var iconPreview = classInput.next( '.input-group-addon' );
					var iconElement = '<i class="fa '.concat( iconClass, '"><\/i>' );
					iconPreview.empty();
					iconPreview.append( iconElement );
					classInput.trigger( 'change' );
					return false;
				}
			);
		},
		search: function ($searchField) {
			var itemsList  = $searchField.parent().next().find( '.iconpicker-items' );
			var searchTerm = $searchField.val().toLowerCase();
			if (searchTerm.length > 0) {
				itemsList.children().each(
					function () {
						if ($( this ).filter( '[title*='.concat( searchTerm ).concat( ']' ) ).length > 0 || searchTerm.length < 1) {
							$( this ).show();
						} else {
							$( this ).hide();
						}
					}
				);
			} else {
				itemsList.children().show();
			}
		},
		iconPickerToggle: function ($input) {
			var iconPicker = $input.parent().next();
			iconPicker.addClass( 'iconpicker-visible' );
		}
	};

	$( document ).ready(
		function () {
			wp.customizerRepeater.init();

			$( '.iconpicker-search' ).on(
				'keyup', function () {
					wp.customizerRepeater.search( $( this ) );
				}
			);

			$( '.icp-auto' ).on(
				'click', function () {
					wp.customizerRepeater.iconPickerToggle( $( this ) );
				}
			);

			$( document ).mouseup(
				function (e) {
					var container = $( '.iconpicker-popover' );

					if ( ! container.is( e.target )	&& container.has( e.target ).length === 0) {
						container.removeClass( 'iconpicker-visible' );
					}
				}
			);

		}
	);

})( jQuery );
controls/custom-controls/repeater/icon-picker/icons.php000066600000015131151123453750017433 0ustar00<?php
/**
 * The list of icons
 *
 * @package Hestia
 */
?>
<div class="iconpicker-popover popover bottomLeft">
	<div class="arrow"></div>
	<div class="popover-title">
		<input type="search" class="form-control iconpicker-search" placeholder="Type to filter">
	</div>
	<div class="popover-content">
		<div class="iconpicker">
			<div class="iconpicker-items">

				<i data-type="iconpicker-item" title=".fa-behance" class="fa fa-behance"></i>
				<i data-type="iconpicker-item" title=".fa-behance-square" class="fa fa-behance-square"></i>
				<i data-type="iconpicker-item" title=".fa-facebook" class="fa fa-facebook"></i>
				<i data-type="iconpicker-item" title=".fa-facebook-square" class="fa fa-facebook-square"></i>
				<i data-type="iconpicker-item" title=".fa-google-plus" class="fa fa-google-plus"></i>
				<i data-type="iconpicker-item" title=".fa-google-plus-square" class="fa fa-google-plus-square"></i>
				<i data-type="iconpicker-item" title=".fa-linkedin" class="fa fa-linkedin"></i>
				<i data-type="iconpicker-item" title=".fa-linkedin-square" class="fa fa-linkedin-square"></i>
				<i data-type="iconpicker-item" title=".fa-twitter" class="fa fa-twitter"></i>
				<i data-type="iconpicker-item" title=".fa-twitter-square" class="fa fa-twitter-square"></i>
				<i data-type="iconpicker-item" title=".fa-vimeo" class="fa fa-vimeo"></i>
				<i data-type="iconpicker-item" title=".fa-vimeo-square" class="fa fa-vimeo-square"></i>
				<i data-type="iconpicker-item" title=".fa-youtube" class="fa fa-youtube"></i>
				<i data-type="iconpicker-item" title=".fa-youtube-square" class="fa fa-youtube-square"></i>
				<i data-type="iconpicker-item" title=".fa-ambulance" class="fa fa-ambulance"></i>
				<i data-type="iconpicker-item" title=".fa-american-sign-language-interpreting" class="fa fa-american-sign-language-interpreting"></i>
				<i data-type="iconpicker-item" title=".fa-anchor" class="fa fa-anchor"></i>
				<i data-type="iconpicker-item" title=".fa-android" class="fa fa-android"></i>
				<i data-type="iconpicker-item" title=".fa-apple" class="fa fa-apple"></i>
				<i data-type="iconpicker-item" title=".fa-archive" class="fa fa-archive"></i>
				<i data-type="iconpicker-item" title=".fa-area-chart" class="fa fa-area-chart"></i>
				<i data-type="iconpicker-item" title=".fa-asterisk" class="fa fa-asterisk"></i>
				<i data-type="iconpicker-item" title=".fa-automobile" class="fa fa-automobile"></i>
				<i data-type="iconpicker-item" title=".fa-balance-scale" class="fa fa-balance-scale"></i>
				<i data-type="iconpicker-item" title=".fa-ban" class="fa fa-ban"></i>
				<i data-type="iconpicker-item" title=".fa-bank" class="fa fa-bank"></i>
				<i data-type="iconpicker-item" title=".fa-bicycle" class="fa fa-bicycle"></i>
				<i data-type="iconpicker-item" title=".fa-birthday-cake" class="fa fa-birthday-cake"></i>
				<i data-type="iconpicker-item" title=".fa-btc" class="fa fa-btc"></i>
				<i data-type="iconpicker-item" title=".fa-black-tie" class="fa fa-black-tie"></i>
				<i data-type="iconpicker-item" title=".fa-bookmark" class="fa fa-bookmark"></i>
				<i data-type="iconpicker-item" title=".fa-briefcase" class="fa fa-briefcase"></i>
				<i data-type="iconpicker-item" title=".fa-bus" class="fa fa-bus"></i>
				<i data-type="iconpicker-item" title=".fa-cab" class="fa fa-cab"></i>
				<i data-type="iconpicker-item" title=".fa-camera" class="fa fa-camera"></i>
				<i data-type="iconpicker-item" title=".fa-check" class="fa fa-check"></i>
				<i data-type="iconpicker-item" title=".fa-child" class="fa fa-child"></i>
				<i data-type="iconpicker-item" title=".fa-code" class="fa fa-code"></i>
				<i data-type="iconpicker-item" title=".fa-coffee" class="fa fa-coffee"></i>
				<i data-type="iconpicker-item" title=".fa-cog" class="fa fa-cog"></i>
				<i data-type="iconpicker-item" title=".fa-commenting" class="fa fa-commenting"></i>
				<i data-type="iconpicker-item" title=".fa-cube" class="fa fa-cube"></i>
				<i data-type="iconpicker-item" title=".fa-dollar" class="fa fa-dollar"></i>
				<i data-type="iconpicker-item" title=".fa-diamond" class="fa fa-diamond"></i>
				<i data-type="iconpicker-item" title=".fa-envelope" class="fa fa-envelope"></i>
				<i data-type="iconpicker-item" title=".fa-female" class="fa fa-female"></i>
				<i data-type="iconpicker-item" title=".fa-fire-extinguisher" class="fa fa-fire-extinguisher"></i>
				<i data-type="iconpicker-item" title=".fa-glass" class="fa fa-glass"></i>
				<i data-type="iconpicker-item" title=".fa-globe" class="fa fa-globe"></i>
				<i data-type="iconpicker-item" title=".fa-graduation-cap" class="fa fa-graduation-cap"></i>
				<i data-type="iconpicker-item" title=".fa-heartbeat" class="fa fa-heartbeat"></i>
				<i data-type="iconpicker-item" title=".fa-heart" class="fa fa-heart"></i>
				<i data-type="iconpicker-item" title=".fa-hotel" class="fa fa-hotel"></i>
				<i data-type="iconpicker-item" title=".fa-hourglass" class="fa fa-hourglass"></i>
				<i data-type="iconpicker-item" title=".fa-home" class="fa fa-home"></i>
				<i data-type="iconpicker-item" title=".fa-hourglass" class="fa fa-hourglass"></i>
				<i data-type="iconpicker-item" title=".fa-legal" class="fa fa-legal"></i>
				<i data-type="iconpicker-item" title=".fa-lock" class="fa fa-lock"></i>
				<i data-type="iconpicker-item" title=".fa-map-signs" class="fa fa-map-signs"></i>
				<i data-type="iconpicker-item" title=".fa-paint-brush" class="fa fa-paint-brush"></i>
				<i data-type="iconpicker-item" title=".fa-plane" class="fa fa-plane"></i>
				<i data-type="iconpicker-item" title=".fa-rocket" class="fa fa-rocket"></i>
				<i data-type="iconpicker-item" title=".fa-puzzle-piece" class="fa fa-puzzle-piece"></i>
				<i data-type="iconpicker-item" title=".fa-shield" class="fa fa-shield"></i>
				<i data-type="iconpicker-item" title=".fa-tag" class="fa fa-tag"></i>
				<i data-type="iconpicker-item" title=".fa-times" class="fa fa-times"></i>
				<i data-type="iconpicker-item" title=".fa-unlock" class="fa fa-unlock"></i>
				<i data-type="iconpicker-item" title=".fa-user" class="fa fa-user"></i>
				<i data-type="iconpicker-item" title=".fa-user" class="fa fa-user"></i>
				<i data-type="iconpicker-item" title=".fa-user-md" class="fa fa-user-md"></i>
				<i data-type="iconpicker-item" title=".fa-video-camera" class="fa fa-video-camera"></i>
				<i data-type="iconpicker-item" title=".fa-wordpress" class="fa fa-wordpress"></i>
				<i data-type="iconpicker-item" title=".fa-wrench" class="fa fa-wrench"></i>
				<i data-type="iconpicker-item" title=".fa-youtube-play" class="fa fa-youtube-play"></i>

			</div> <!-- /.iconpicker-items -->
		</div> <!-- /.iconpicker -->
	</div> <!-- /.popover-content -->
</div> <!-- /.iconpicker-popover -->
controls/custom-controls/repeater/class-hestia-repeater.php000066600000073442151123453750020313 0ustar00<?php
/**
 * Repeater functionality in customize
 *
 * @package Hestia
 */

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return null;
}

/**
 * Class Hestia_Repeater
 */
class Hestia_Repeater extends WP_Customize_Control {

	/**
	 * ID of the field
	 *
	 * @var string
	 */
	public $id;

	/**
	 * Repeater box title
	 *
	 * @var array
	 */
	private $boxtitle = array();

	/**
	 * Repeater Add field button label
	 *
	 * @var array
	 */
	private $add_field_label = array();

	/**
	 * Repeater Icon container
	 *
	 * @var string
	 */
	private $customizer_icon_container = '';

	/**
	 * Repeater Allowed HTML tags
	 *
	 * @var array
	 */
	private $allowed_html = array();

	/**
	 * Check if image control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_image_control = false;

	/**
	 * Check if icon control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_icon_control = false;

	/**
	 * Check if color control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_color_control = false;

	/**
	 * Check if second color control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_color2_control = false;

	/**
	 * Check if title control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_title_control = false;

	/**
	 * Check if subtitle control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_subtitle_control = false;

	/**
	 * Check if text control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_text_control = false;

	/**
	 * Check if link control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_link_control = false;

	/**
	 * Check if second text control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_text2_control = false;

	/**
	 * Check if second link control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_link2_control = false;

	/**
	 * Check if shortcode control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_shortcode_control = false;

	/**
	 * Check if internal repeater control is added in the repetear
	 *
	 * @var bool
	 */
	public $customizer_repeater_repeater_control = false;


	/**
	 * Class constructor
	 */
	public function __construct( $manager, $id, $args = array() ) {
		parent::__construct( $manager, $id, $args );
		/*Get options from customizer.php*/
		$this->add_field_label = esc_html__( 'Add new field', 'hestia' );
		if ( ! empty( $args['add_field_label'] ) ) {
			$this->add_field_label = $args['add_field_label'];
		}

		$this->boxtitle = esc_html__( 'Customizer Repeater', 'hestia' );
		if ( ! empty( $args['item_name'] ) ) {
			$this->boxtitle = $args['item_name'];
		} elseif ( ! empty( $this->label ) ) {
			$this->boxtitle = $this->label;
		}

		if ( ! empty( $args['customizer_repeater_image_control'] ) ) {
			$this->customizer_repeater_image_control = $args['customizer_repeater_image_control'];
		}

		if ( ! empty( $args['customizer_repeater_icon_control'] ) ) {
			$this->customizer_repeater_icon_control = $args['customizer_repeater_icon_control'];
		}

		if ( ! empty( $args['customizer_repeater_color_control'] ) ) {
			$this->customizer_repeater_color_control = $args['customizer_repeater_color_control'];
		}

		if ( ! empty( $args['customizer_repeater_color2_control'] ) ) {
			$this->customizer_repeater_color2_control = $args['customizer_repeater_color2_control'];
		}

		if ( ! empty( $args['customizer_repeater_title_control'] ) ) {
			$this->customizer_repeater_title_control = $args['customizer_repeater_title_control'];
		}

		if ( ! empty( $args['customizer_repeater_subtitle_control'] ) ) {
			$this->customizer_repeater_subtitle_control = $args['customizer_repeater_subtitle_control'];
		}

		if ( ! empty( $args['customizer_repeater_text_control'] ) ) {
			$this->customizer_repeater_text_control = $args['customizer_repeater_text_control'];
		}

		if ( ! empty( $args['customizer_repeater_link_control'] ) ) {
			$this->customizer_repeater_link_control = $args['customizer_repeater_link_control'];
		}

		if ( ! empty( $args['customizer_repeater_text2_control'] ) ) {
			$this->customizer_repeater_text2_control = $args['customizer_repeater_text2_control'];
		}

		if ( ! empty( $args['customizer_repeater_link2_control'] ) ) {
			$this->customizer_repeater_link2_control = $args['customizer_repeater_link2_control'];
		}

		if ( ! empty( $args['customizer_repeater_shortcode_control'] ) ) {
			$this->customizer_repeater_shortcode_control = $args['customizer_repeater_shortcode_control'];
		}

		if ( ! empty( $args['customizer_repeater_repeater_control'] ) ) {
			$this->customizer_repeater_repeater_control = $args['customizer_repeater_repeater_control'];
		}

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

		if ( file_exists( get_template_directory() . '/inc/customizer/controls/custom-controls/repeater/icon-picker/icons.php' ) ) {
			$this->customizer_icon_container = '/inc/customizer/controls/custom-controls/repeater/icon-picker/icons';
		}

		$allowed_array1 = wp_kses_allowed_html( 'post' );
		$allowed_array2 = array(
			'input' => array(
				'type'        => array(),
				'class'       => array(),
				'placeholder' => array(),
			),
		);

		$this->allowed_html = array_merge( $allowed_array1, $allowed_array2 );
	}

	/**
	 * Enqueue resources for the control
	 */
	public function enqueue() {
		wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/font-awesome/css/font-awesome.min.css', array(), HESTIA_VENDOR_VERSION );

		wp_enqueue_style( 'hestia_customizer-repeater-admin-stylesheet', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/repeater/style.css', array(), HESTIA_VERSION );

		wp_enqueue_style( 'wp-color-picker' );

		wp_enqueue_script( 'hestia_customizer-repeater-script', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/repeater/script.js', array( 'jquery', 'jquery-ui-draggable', 'wp-color-picker' ), HESTIA_VERSION, true );

		wp_enqueue_script( 'hestia_customizer-repeater-fontawesome-iconpicker', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/repeater/icon-picker/icon-picker.js', array( 'jquery' ), HESTIA_VERSION, true );

		wp_enqueue_style( 'hestia_customizer-repeater-fontawesome-iconpicker-script', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/repeater/icon-picker/icon-picker.css', array(), HESTIA_VERSION );
	}

	/**
	 * Render the control
	 */
	public function render_content() {

		/*Get default options*/
		$this_default = json_decode( $this->setting->default );

		/*Get values (json format)*/
		$values = $this->value();

		/*Decode values*/
		$json = json_decode( $values );

		if ( ! is_array( $json ) ) {
			$json = array( $values );
		} ?>

		<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
		<div class="customizer-repeater-general-control-repeater customizer-repeater-general-control-droppable">
			<?php
			if ( ( count( $json ) == 1 && '' === $json[0] ) || empty( $json ) ) {
				if ( ! empty( $this_default ) ) {
					$this->iterate_array( $this_default );
					?>
					<input type="hidden" id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?> class="customizer-repeater-colector" value="<?php echo esc_textarea( json_encode( $this_default ) ); ?>"/>
					<?php
				} else {
					$this->iterate_array();
					?>
					<input type="hidden" id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?> class="customizer-repeater-colector"/>
					<?php
				}
			} else {
				$this->iterate_array( $json );
				?>
				<input type="hidden" id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?> class="customizer-repeater-colector" value="<?php echo esc_textarea( $this->value() ); ?>"/>
				<?php
			}
			?>
			</div>
		<button type="button" class="button add_field customizer-repeater-new-field">
			<?php echo esc_html( $this->add_field_label ); ?>
		</button>
		<?php
	}

	/**
	 * Iterate array
	 *
	 * @param array $array Array to iterate.
	 */
	private function iterate_array( $array = array() ) {
		/*Counter that helps checking if the box is first and should have the delete button disabled*/
		$it = 0;
		if ( ! empty( $array ) ) {
			foreach ( $array as $icon ) {
				?>
				<div class="customizer-repeater-general-control-repeater-container customizer-repeater-draggable">
					<div class="customizer-repeater-customize-control-title">
						<?php echo esc_html( $this->boxtitle ); ?>
					</div>
					<div class="customizer-repeater-box-content-hidden">
						<?php
						$choice = '';
						if ( $this->id === 'hestia_features_content' ) {
							$choice = 'customizer_repeater_icon';
						}

						$image_url  = '';
						$icon_value = '';
						$title      = '';
						$subtitle   = '';
						$text       = '';
						$text2      = '';
						$link2      = '';
						$link       = '';
						$shortcode  = '';
						$repeater   = '';
						$color      = '';
						$color2     = '';

						if ( ! empty( $icon->id ) ) {
							$id = $icon->id;
						}

						if ( ! empty( $icon->choice ) ) {
							$choice = $icon->choice;
						}

						if ( ! empty( $icon->image_url ) ) {
							$image_url = $icon->image_url;
						}

						if ( ! empty( $icon->icon_value ) ) {
							$icon_value = $icon->icon_value;
						}

						if ( ! empty( $icon->color ) ) {
							$color = $icon->color;
						}

						if ( ! empty( $icon->color2 ) ) {
							$color2 = $icon->color2;
						}

						if ( ! empty( $icon->title ) ) {
							$title = $icon->title;
						}

						if ( ! empty( $icon->subtitle ) ) {
							$subtitle = $icon->subtitle;
						}

						if ( ! empty( $icon->text ) ) {
							$text = $icon->text;
						}

						if ( ! empty( $icon->link ) ) {
							$link = $icon->link;
						}

						if ( ! empty( $icon->text2 ) ) {
							$text2 = $icon->text2;
						}

						if ( ! empty( $icon->link2 ) ) {
							$link2 = $icon->link2;
						}

						if ( ! empty( $icon->shortcode ) ) {
							$shortcode = $icon->shortcode;
						}

						if ( ! empty( $icon->social_repeater ) ) {
							$repeater = $icon->social_repeater;
						}

						if ( $this->customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true ) {
							$this->icon_type_choice( $choice );
						}

						if ( $this->customizer_repeater_image_control == true ) {
							$this->image_control( $image_url, $choice );
						}

						if ( $this->customizer_repeater_icon_control == true ) {
							$this->icon_picker_control( $icon_value, $choice );
						}

						if ( $this->customizer_repeater_color_control == true ) {
							$this->input_control(
								array(
									'label'             => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Color', 'hestia' ), $this->id, 'customizer_repeater_color_control' ),
									'class'             => 'customizer-repeater-color-control',
									'type'              => apply_filters( 'hestia_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ),
									'sanitize_callback' => 'sanitize_hex_color',
									'choice'            => $choice,
								), $color
							);
						}
						if ( $this->customizer_repeater_color2_control == true ) {
							$this->input_control(
								array(
									'label'             => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Color', 'hestia' ), $this->id, 'customizer_repeater_color2_control' ),
									'class'             => 'customizer-repeater-color2-control',
									'type'              => apply_filters( 'hestia_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color2_control' ),
									'sanitize_callback' => 'sanitize_hex_color',
								), $color2
							);
						}
						if ( $this->customizer_repeater_title_control == true ) {
							$this->input_control(
								array(
									'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Title', 'hestia' ), $this->id, 'customizer_repeater_title_control' ),
									'class' => 'customizer-repeater-title-control',
									'type'  => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
								), $title
							);
						}
						if ( $this->customizer_repeater_subtitle_control == true ) {
							$this->input_control(
								array(
									'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Subtitle', 'hestia' ), $this->id, 'customizer_repeater_subtitle_control' ),
									'class' => 'customizer-repeater-subtitle-control',
									'type'  => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ),
								), $subtitle
							);
						}
						if ( $this->customizer_repeater_text_control == true ) {
							$this->input_control(
								array(
									'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Text', 'hestia' ), $this->id, 'customizer_repeater_text_control' ),
									'class' => 'customizer-repeater-text-control',
									'type'  => apply_filters( 'hestia_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
								), $text
							);
						}
						if ( $this->customizer_repeater_link_control ) {
							$this->input_control(
								array(
									'label'             => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'hestia' ), $this->id, 'customizer_repeater_link_control' ),
									'class'             => 'customizer-repeater-link-control',
									'sanitize_callback' => 'esc_url_raw',
									'type'              => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ),
								), $link
							);
						}
						if ( $this->customizer_repeater_text2_control == true ) {
							$this->input_control(
								array(
									'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Text', 'hestia' ), $this->id, 'customizer_repeater_text2_control' ),
									'class' => 'customizer-repeater-text2-control',
									'type'  => apply_filters( 'hestia_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text2_control' ),
								), $text2
							);
						}
						if ( $this->customizer_repeater_link2_control ) {
							$this->input_control(
								array(
									'label'             => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'hestia' ), $this->id, 'customizer_repeater_link2_control' ),
									'class'             => 'customizer-repeater-link2-control',
									'sanitize_callback' => 'esc_url_raw',
									'type'              => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link2_control' ),
								), $link2
							);
						}
						if ( $this->customizer_repeater_shortcode_control == true ) {
							$this->input_control(
								array(
									'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Shortcode', 'hestia' ), $this->id, 'customizer_repeater_shortcode_control' ),
									'class' => 'customizer-repeater-shortcode-control',
									'type'  => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
								), $shortcode
							);
						}
						if ( $this->customizer_repeater_repeater_control == true ) {
							$this->repeater_control( $repeater );
						}
						echo '<input type="hidden" class="social-repeater-box-id" value="';
						if ( ! empty( $id ) ) {
							echo esc_attr( $id );
						}
						echo '">';
						echo '<button type="button" class="social-repeater-general-control-remove-field"';
						if ( $it == 0 ) {
							echo 'style="display:none;"';
						}
						echo '>';
						esc_html_e( 'Delete field', 'hestia' );
						?>
						</button>

					</div>
				</div>

				<?php
				$it++;
			}
		} else {
			?>
			<div class="customizer-repeater-general-control-repeater-container">
				<div class="customizer-repeater-customize-control-title">
					<?php echo esc_html( $this->boxtitle ); ?>
				</div>
				<div class="customizer-repeater-box-content-hidden">
					<?php
					if ( $this->customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true ) {
						$this->icon_type_choice();
					}
					if ( $this->customizer_repeater_image_control == true ) {
						$this->image_control();
					}
					if ( $this->customizer_repeater_icon_control == true ) {
						$this->icon_picker_control();
					}
					if ( $this->customizer_repeater_color_control == true ) {
						$this->input_control(
							array(
								'label'             => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Color', 'hestia' ), $this->id, 'customizer_repeater_color_control' ),
								'class'             => 'customizer-repeater-color-control',
								'type'              => apply_filters( 'hestia_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ),
								'sanitize_callback' => 'sanitize_hex_color',
							)
						);
					}
					if ( $this->customizer_repeater_color2_control == true ) {
						$this->input_control(
							array(
								'label'             => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Color', 'hestia' ), $this->id, 'customizer_repeater_color2_control' ),
								'class'             => 'customizer-repeater-color2-control',
								'type'              => apply_filters( 'hestia_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color2_control' ),
								'sanitize_callback' => 'sanitize_hex_color',
							)
						);
					}
					if ( $this->customizer_repeater_title_control == true ) {
						$this->input_control(
							array(
								'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Title', 'hestia' ), $this->id, 'customizer_repeater_title_control' ),
								'class' => 'customizer-repeater-title-control',
								'type'  => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
							)
						);
					}
					if ( $this->customizer_repeater_subtitle_control == true ) {
						$this->input_control(
							array(
								'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Subtitle', 'hestia' ), $this->id, 'customizer_repeater_subtitle_control' ),
								'class' => 'customizer-repeater-subtitle-control',
								'type'  => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ),
							)
						);
					}
					if ( $this->customizer_repeater_text_control == true ) {
						$this->input_control(
							array(
								'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Text', 'hestia' ), $this->id, 'customizer_repeater_text_control' ),
								'class' => 'customizer-repeater-text-control',
								'type'  => apply_filters( 'hestia_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
							)
						);
					}
					if ( $this->customizer_repeater_link_control == true ) {
						$this->input_control(
							array(
								'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'hestia' ), $this->id, 'customizer_repeater_link_control' ),
								'class' => 'customizer-repeater-link-control',
								'type'  => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ),
							)
						);
					}
					if ( $this->customizer_repeater_text2_control == true ) {
						$this->input_control(
							array(
								'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Text', 'hestia' ), $this->id, 'customizer_repeater_text2_control' ),
								'class' => 'customizer-repeater-text2-control',
								'type'  => apply_filters( 'hestia_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text2_control' ),
							)
						);
					}
					if ( $this->customizer_repeater_link2_control == true ) {
						$this->input_control(
							array(
								'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Link', 'hestia' ), $this->id, 'customizer_repeater_link2_control' ),
								'class' => 'customizer-repeater-link2-control',
								'type'  => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link2_control' ),
							)
						);
					}
					if ( $this->customizer_repeater_shortcode_control == true ) {
						$this->input_control(
							array(
								'label' => apply_filters( 'repeater_input_labels_filter', esc_html__( 'Shortcode', 'hestia' ), $this->id, 'customizer_repeater_shortcode_control' ),
								'class' => 'customizer-repeater-shortcode-control',
								'type'  => apply_filters( 'hestia_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
							)
						);
					}
					if ( $this->customizer_repeater_repeater_control == true ) {
						$this->repeater_control();
					}
					?>
					<input type="hidden" class="social-repeater-box-id">
					<button type="button" class="social-repeater-general-control-remove-field button" style="display:none;">
						<?php esc_html_e( 'Delete field', 'hestia' ); ?>
					</button>
				</div>
			</div>
			<?php
		}
	}

	/**
	 * Input control
	 *
	 * @param array  $options Options.
	 * @param string $value Value.
	 */
	private function input_control( $options, $value = '' ) {
		?>

		<?php
		if ( ! empty( $options['type'] ) ) {
			switch ( $options['type'] ) {
				case 'textarea':
					?>
					<span class="customize-control-title"><?php echo esc_html( $options['label'] ); ?></span>
					<textarea class="<?php echo esc_attr( $options['class'] ); ?>" placeholder="<?php echo esc_attr( $options['label'] ); ?>"><?php echo ( ! empty( $options['sanitize_callback'] ) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr( $value ) ); ?></textarea>
					<?php
					break;
				case 'color':
					$style_to_add = '';
					if ( $this->id === 'hestia_features_content' && $options['choice'] !== 'customizer_repeater_icon' ) {
						$style_to_add = 'display:none';
					}
					?>
					<span class="customize-control-title" 
					<?php
					if ( ! empty( $style_to_add ) ) {
						echo 'style="' . esc_attr( $style_to_add ) . '"';}
					?>
						><?php echo esc_html( $options['label'] ); ?></span>
					<div class="<?php echo esc_attr( $options['class'] ); ?>" 
											<?php
											if ( ! empty( $style_to_add ) ) {
												echo 'style="' . esc_attr( $style_to_add ) . '"';}
											?>
						>
						<input type="text" value="<?php echo ( ! empty( $options['sanitize_callback'] ) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr( $value ) ); ?>" class="<?php echo esc_attr( $options['class'] ); ?>" />
					</div>
					<?php
					break;
			}
		} else {
			?>
			<span class="customize-control-title"><?php echo esc_html( $options['label'] ); ?></span>
			<input type="text" value="<?php echo ( ! empty( $options['sanitize_callback'] ) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr( $value ) ); ?>" class="<?php echo esc_attr( $options['class'] ); ?>" placeholder="<?php echo esc_attr( $options['label'] ); ?>"/>
			<?php
		}
	}

	/**
	 * Icon picker control
	 *
	 * @param string $value Value.
	 * @param string $show Show or not.
	 */
	private function icon_picker_control( $value = '', $show = '' ) {
		?>
		<div class="social-repeater-general-control-icon" 
		<?php
		if ( $show === 'customizer_repeater_image' || $show === 'customizer_repeater_none' ) {
			echo 'style="display:none;"'; }
		?>
			>
			<span class="customize-control-title">
				<?php esc_html_e( 'Icon', 'hestia' ); ?>
			</span>
			<span class="description customize-control-description">
				<?php
				echo sprintf(
					/* translators: Fontawesome link with full list of icons available */
					esc_html__( 'Note: Some icons may not be displayed here. You can see the full list of icons at %1$s.', 'hestia' ),
					/* translators: Fontawesome link with full list of icons available */
					sprintf( '<a href="http://fontawesome.io/icons/" rel="nofollow">%s</a>', esc_html__( 'http://fontawesome.io/icons/', 'hestia' ) )
				);
				?>
			</span>
			<div class="input-group icp-container">
				<?php
				echo '<input data-placement="bottomRight" class="icp icp-auto" value="';
				if ( ! empty( $value ) ) {
					echo esc_attr( $value );
				}
				echo '" type="text">';
				?>
				<span class="input-group-addon">
					<i class="fa <?php echo esc_attr( $value ); ?>"></i>
				</span>
			</div>
			<?php get_template_part( $this->customizer_icon_container ); ?>
		</div>
		<?php
	}

	/**
	 * Image control
	 *
	 * @param string $value Value.
	 * @param string $show Show or not.
	 */
	private function image_control( $value = '', $show = '' ) {
		?>
		<div class="customizer-repeater-image-control" 
		<?php
		if ( $show === 'customizer_repeater_icon' || $show === 'customizer_repeater_none' || ( $this->id === 'hestia_features_content' && empty( $show ) ) ) {
			echo 'style="display:none;"'; }
		?>
			>
			<span class="customize-control-title">
				<?php esc_html_e( 'Image', 'hestia' ); ?>
			</span>
			<input type="text" class="widefat custom-media-url" value="<?php echo esc_attr( $value ); ?>">
			<input type="button" class="button button-secondary customizer-repeater-custom-media-button" value="<?php esc_attr_e( 'Upload Image', 'hestia' ); ?>" />
		</div>
		<?php
	}

	/**
	 * Icon/Image/None select control
	 *
	 * @param string $value Select control type.
	 */
	private function icon_type_choice( $value = 'customizer_repeater_icon' ) {
		?>
		<span class="customize-control-title">
			<?php esc_html_e( 'Image type', 'hestia' ); ?>
		</span>
		<select class="customizer-repeater-image-choice">
			<option value="customizer_repeater_icon" <?php selected( $value, 'customizer_repeater_icon' ); ?>><?php esc_html_e( 'Icon', 'hestia' ); ?></option>
			<option value="customizer_repeater_image" <?php selected( $value, 'customizer_repeater_image' ); ?>><?php esc_html_e( 'Image', 'hestia' ); ?></option>
			<option value="customizer_repeater_none" <?php selected( $value, 'customizer_repeater_none' ); ?>><?php esc_html_e( 'None', 'hestia' ); ?></option>
		</select>
		<?php
	}

	/**
	 * Repeater control
	 *
	 * @param string $value Value.
	 */
	private function repeater_control( $value = '' ) {
		$social_repeater = array();
		$show_del        = 0;
		?>
		<span class="customize-control-title"><?php esc_html_e( 'Social icons', 'hestia' ); ?></span>
		<?php
		echo '<span class="description customize-control-description">';
		echo sprintf(
			/* translators: Fontawesome link with full list of icons available */
			esc_html__( 'Note: Some icons may not be displayed here. You can see the full list of icons at %1$s.', 'hestia' ),
			/* translators: Fontawesome link with full list of icons available */
			sprintf( '<a href="http://fontawesome.io/icons/" rel="nofollow">%s</a>', esc_html__( 'http://fontawesome.io/icons/', 'hestia' ) )
		);
		echo '</span>';
		if ( ! empty( $value ) ) {
			$social_repeater = json_decode( html_entity_decode( $value ), true );
		}
		if ( ( count( $social_repeater ) == 1 && '' === $social_repeater[0] ) || empty( $social_repeater ) ) {
			?>
			<div class="customizer-repeater-social-repeater">
				<div class="customizer-repeater-social-repeater-container">
					<div class="customizer-repeater-rc input-group icp-container">
						<?php
						echo '<input data-placement="bottomRight" class="icp icp-auto" value="';
						if ( ! empty( $value ) ) {
							echo esc_attr( $value );
						}
						echo '" type="text">';
						?>
						<span class="input-group-addon"></span>
					</div>
					<?php get_template_part( $this->customizer_icon_container ); ?>
					<input type="text" class="customizer-repeater-social-repeater-link" placeholder="<?php esc_attr_e( 'Link', 'hestia' ); ?>">
					<input type="hidden" class="customizer-repeater-social-repeater-id" value="">
					<button class="social-repeater-remove-social-item" style="display:none">
						<?php esc_html_e( 'Remove Icon', 'hestia' ); ?>
					</button>
				</div>
				<input type="hidden" id="social-repeater-socials-repeater-colector" class="social-repeater-socials-repeater-colector" value=""/>
			</div>
			<button class="social-repeater-add-social-item button-secondary"><?php esc_html_e( 'Add Icon', 'hestia' ); ?></button>
			<?php
		} else {
			?>
			<div class="customizer-repeater-social-repeater">
				<?php
				foreach ( $social_repeater as $social_icon ) {
					$show_del ++;
					echo '<div class="customizer-repeater-social-repeater-container">';
						echo '<div class="customizer-repeater-rc input-group icp-container">';
							echo '<input data-placement="bottomRight" class="icp icp-auto" value="';
					if ( ! empty( $social_icon['icon'] ) ) {
						echo esc_attr( $social_icon['icon'] );
					}
							echo '" type="text">';
							echo '<span class="input-group-addon"><i class="fa ' . esc_attr( $social_icon['icon'] ) . '"></i></span>';
						echo '</div>';
						get_template_part( $this->customizer_icon_container );
						echo '<input type="text" class="customizer-repeater-social-repeater-link" placeholder="' . esc_attr__( 'Link', 'hestia' ) . '" value="';
					if ( ! empty( $social_icon['link'] ) ) {
						echo esc_url( $social_icon['link'] );
					}
						echo '">';
						echo '<input type="hidden" class="customizer-repeater-social-repeater-id" value="';
					if ( ! empty( $social_icon['id'] ) ) {
						echo esc_attr( $social_icon['id'] );
					}
						echo '">';
						echo '<button class="social-repeater-remove-social-item" style="';
					if ( $show_del == 1 ) {
						echo 'display:none';
					}
						echo '">' . esc_html__( 'Remove Icon', 'hestia' ) . '</button>';
					echo '</div>';
				}
				?>
				<input type="hidden" id="social-repeater-socials-repeater-colector" class="social-repeater-socials-repeater-colector" value="<?php echo esc_textarea( html_entity_decode( $value ) ); ?>" />
			</div>
			<button class="social-repeater-add-social-item button-secondary"><?php esc_html_e( 'Add Icon', 'hestia' ); ?></button>
			<?php
		}
	}
}
controls/custom-controls/repeater/script.js000066600000037673151123453750015265 0ustar00/**
 * Customizer repeater
 *
 * @package Hestia
 */

/* global jQuery */
/* global wp */

function media_upload(button_class) {
	'use strict';
	jQuery( 'body' ).on(
		'click', button_class, function () {
			var button_id     = '#' + jQuery( this ).attr( 'id' );
			var display_field = jQuery( this ).parent().children( 'input:text' );
			var _custom_media = true;

			wp.media.editor.send.attachment = function (props, attachment) {

				if (_custom_media) {
					if (typeof display_field !== 'undefined') {
						switch (props.size) {
							case 'full':
								display_field.val( attachment.sizes.full.url );
								display_field.trigger( 'change' );
								break;
							case 'medium':
								display_field.val( attachment.sizes.medium.url );
								display_field.trigger( 'change' );
								break;
							case 'thumbnail':
								display_field.val( attachment.sizes.thumbnail.url );
								display_field.trigger( 'change' );
								break;
							default:
								display_field.val( attachment.url );
								display_field.trigger( 'change' );
						}
					}
					_custom_media = false;
				} else {
					return wp.media.editor.send.attachment( button_id, [props, attachment] );
				}
			};
			wp.media.editor.open( button_class );
			return false;
		}
	);
}

/********************************************
 * ** Generate unique id ***
 *********************************************/
function customizer_repeater_uniqid(prefix, more_entropy) {
	'use strict';
	if (typeof prefix === 'undefined') {
		prefix = '';
	}

	var retId;
	var php_js;
	var formatSeed = function (seed, reqWidth) {
		seed = parseInt( seed, 10 )
			.toString( 16 ); // to hex str
		if (reqWidth < seed.length) { // so long we split
			return seed.slice( seed.length - reqWidth );
		}
		if (reqWidth > seed.length) { // so short we pad
			return new Array( 1 + (reqWidth - seed.length) )
					.join( '0' ) + seed;
		}
		return seed;
	};

	// BEGIN REDUNDANT
	if ( ! php_js) {
		php_js = {};
	}
	// END REDUNDANT
	if ( ! php_js.uniqidSeed) { // init seed with big random int
		php_js.uniqidSeed = Math.floor( Math.random() * 0x75bcd15 );
	}
	php_js.uniqidSeed++;

	retId  = prefix; // start with prefix, add current milliseconds hex string
	retId += formatSeed(
		parseInt(
			new Date()
			.getTime() / 1000, 10
		), 8
	);
	retId += formatSeed( php_js.uniqidSeed, 5 ); // add seed hex string
	if (more_entropy) {
		// for more entropy we add a float lower to 10
		retId += (Math.random() * 10)
			.toFixed( 8 )
			.toString();
	}

	return retId;
}


/********************************************
 * ** General Repeater ***
 *********************************************/
function customizer_repeater_refresh_social_icons(th) {
	'use strict';
	var icons_repeater_values = [];
	th.find( '.customizer-repeater-social-repeater-container' ).each(
		function () {
			var icon = jQuery( this ).find( '.icp' ).val();
			var link = jQuery( this ).find( '.customizer-repeater-social-repeater-link' ).val();
			var id   = jQuery( this ).find( '.customizer-repeater-social-repeater-id' ).val();

			if ( ! id) {
				id = 'customizer-repeater-social-repeater-' + customizer_repeater_uniqid();
				jQuery( this ).find( '.customizer-repeater-social-repeater-id' ).val( id );
			}

			if (icon !== '' && link !== '') {
				icons_repeater_values.push(
					{
						'icon': icon,
						'link': link,
						'id': id
					}
				);
			}
		}
	);

	th.find( '.social-repeater-socials-repeater-colector' ).val( JSON.stringify( icons_repeater_values ) );
	customizer_repeater_refresh_general_control_values();
}


function customizer_repeater_refresh_general_control_values() {
	'use strict';
	jQuery( '.customizer-repeater-general-control-repeater' ).each(
		function () {
			var values = [];
			var th     = jQuery( this );
			th.find( '.customizer-repeater-general-control-repeater-container' ).each(
				function () {

					var icon_value = jQuery( this ).find( '.icp' ).val();
					var text       = jQuery( this ).find( '.customizer-repeater-text-control' ).val();
					var link       = jQuery( this ).find( '.customizer-repeater-link-control' ).val();
					var text2      = jQuery( this ).find( '.customizer-repeater-text2-control' ).val();
					var link2      = jQuery( this ).find( '.customizer-repeater-link2-control' ).val();
					var color      = jQuery( this ).find( 'input.customizer-repeater-color-control' ).val();
					var color2     = jQuery( this ).find( 'input.customizer-repeater-color2-control' ).val();
					var image_url  = jQuery( this ).find( '.custom-media-url' ).val();
					var choice     = jQuery( this ).find( '.customizer-repeater-image-choice' ).val();
					var title      = jQuery( this ).find( '.customizer-repeater-title-control' ).val();
					var subtitle   = jQuery( this ).find( '.customizer-repeater-subtitle-control' ).val();
					var id         = jQuery( this ).find( '.social-repeater-box-id' ).val();
					if ( ! id) {
						id = 'social-repeater-' + customizer_repeater_uniqid();
						jQuery( this ).find( '.social-repeater-box-id' ).val( id );
					}
					var social_repeater = jQuery( this ).find( '.social-repeater-socials-repeater-colector' ).val();
					var shortcode       = jQuery( this ).find( '.customizer-repeater-shortcode-control' ).val();

					if (text !== '' || image_url !== '' || title !== '' || subtitle !== '' || icon_value !== '' || link !== '' || choice !== '' || social_repeater !== '' || shortcode !== '' || color !== '') {
						values.push(
							{
								'icon_value': (choice === 'customizer_repeater_none' ? '' : icon_value),
								'color': color,
								'color2': color2,
								'text': escapeHtml( text ),
								'link': link,
								'text2': escapeHtml( text2 ),
								'link2': link2,
								'image_url': (choice === 'customizer_repeater_none' ? '' : image_url),
								'choice': choice,
								'title': escapeHtml( title ),
								'subtitle': escapeHtml( subtitle ),
								'social_repeater': escapeHtml( social_repeater ),
								'id': id,
								'shortcode': escapeHtml( shortcode )
							}
						);
					}

				}
			);
			th.find( '.customizer-repeater-colector' ).val( JSON.stringify( values ) );
			th.find( '.customizer-repeater-colector' ).trigger( 'change' );
		}
	);
}


jQuery( document ).ready(
	function () {
		'use strict';
		var theme_conrols = jQuery( '#customize-theme-controls' );
		theme_conrols.on(
			'click', '.customizer-repeater-customize-control-title', function () {
				jQuery( this ).next().slideToggle(
					'medium', function () {
						if (jQuery( this ).is( ':visible' )) {
							jQuery( this ).prev().addClass( 'repeater-expanded' );
							jQuery( this ).css( 'display', 'block' );
						} else {
							jQuery( this ).prev().removeClass( 'repeater-expanded' );
						}
					}
				);
			}
		);

		theme_conrols.on(
			'change', '.icp',function(){
				customizer_repeater_refresh_general_control_values();
				return false;
			}
		);

		theme_conrols.on(
			'change', '.customizer-repeater-image-choice', function () {
				if (jQuery( this ).val() === 'customizer_repeater_image') {
					jQuery( this ).parent().parent().find( '.social-repeater-general-control-icon' ).hide();
					jQuery( this ).parent().parent().find( '.customizer-repeater-image-control' ).show();
					jQuery( this ).parent().parent().find( '.customizer-repeater-color-control' ).prev().prev().hide();
					jQuery( this ).parent().parent().find( '.customizer-repeater-color-control' ).hide();

				}
				if (jQuery( this ).val() === 'customizer_repeater_icon') {
					jQuery( this ).parent().parent().find( '.social-repeater-general-control-icon' ).show();
					jQuery( this ).parent().parent().find( '.customizer-repeater-image-control' ).hide();
					jQuery( this ).parent().parent().find( '.customizer-repeater-color-control' ).prev().prev().show();
					jQuery( this ).parent().parent().find( '.customizer-repeater-color-control' ).show();
				}
				if (jQuery( this ).val() === 'customizer_repeater_none') {
					jQuery( this ).parent().parent().find( '.social-repeater-general-control-icon' ).hide();
					jQuery( this ).parent().parent().find( '.customizer-repeater-image-control' ).hide();
					jQuery( this ).parent().parent().find( '.customizer-repeater-color-control' ).prev().prev().hide();
					jQuery( this ).parent().parent().find( '.customizer-repeater-color-control' ).hide();
				}

				customizer_repeater_refresh_general_control_values();
				return false;
			}
		);
		media_upload( '.customizer-repeater-custom-media-button' );
		jQuery( '.custom-media-url' ).on(
			'change', function () {
				customizer_repeater_refresh_general_control_values();
				return false;
			}
		);

		var color_options = {
			change: function(){
				customizer_repeater_refresh_general_control_values();
			}
		};

		/**
	 * This adds a new box to repeater
	 */
		theme_conrols.on(
			'click', '.customizer-repeater-new-field', function () {
				var th = jQuery( this ).parent();
				var id = 'customizer-repeater-' + customizer_repeater_uniqid();
				if (typeof th !== 'undefined') {
					/* Clone the first box*/
					var field = th.find( '.customizer-repeater-general-control-repeater-container:first' ).clone( true, true );

					if (typeof field !== 'undefined') {
						/*Set the default value for choice between image and icon to icon*/
						field.find( '.customizer-repeater-image-choice' ).val( 'customizer_repeater_icon' );

						/*Show icon selector*/
						field.find( '.social-repeater-general-control-icon' ).show();

						/*Hide image selector*/
						if (field.find( '.social-repeater-general-control-icon' ).length > 0) {
							field.find( '.customizer-repeater-image-control' ).hide();
						}

						/*Show delete box button because it's not the first box*/
						field.find( '.social-repeater-general-control-remove-field' ).show();

						/* Empty control for icon */
						field.find( '.input-group-addon' ).find( '.fa' ).attr( 'class', 'fa' );

						/*Remove all repeater fields except first one*/

						field.find( '.customizer-repeater-social-repeater' ).find( '.customizer-repeater-social-repeater-container' ).not( ':first' ).remove();
						field.find( '.customizer-repeater-social-repeater-link' ).val( '' );
						field.find( '.social-repeater-socials-repeater-colector' ).val( '' );

						/*Remove value from icon field*/
						field.find( '.icp' ).val( '' );

						/*Remove value from text field*/
						field.find( '.customizer-repeater-text-control' ).val( '' );

						/*Remove value from link field*/
						field.find( '.customizer-repeater-link-control' ).val( '' );

						/*Remove value from text field*/
						field.find( '.customizer-repeater-text2-control' ).val( '' );

						/*Remove value from link field*/
						field.find( '.customizer-repeater-link2-control' ).val( '' );

						/*Set box id*/
						field.find( '.social-repeater-box-id' ).val( id );

						/*Remove value from media field*/
						field.find( '.custom-media-url' ).val( '' );

						/*Remove value from title field*/
						field.find( '.customizer-repeater-title-control' ).val( '' );

						/*Remove value from color field*/
						field.find( 'div.customizer-repeater-color-control .wp-picker-container' ).replaceWith( '<input type="text" class="customizer-repeater-color-control ' + id + '">' );
						field.find( 'input.customizer-repeater-color-control' ).wpColorPicker( color_options );

						field.find( 'div.customizer-repeater-color2-control .wp-picker-container' ).replaceWith( '<input type="text" class="customizer-repeater-color2-control ' + id + '">' );
						field.find( 'input.customizer-repeater-color2-control' ).wpColorPicker( color_options );

						// field.find('.customize-control-notifications-container').remove();
						/*Remove value from subtitle field*/
						field.find( '.customizer-repeater-subtitle-control' ).val( '' );

						/*Remove value from shortcode field*/
						field.find( '.customizer-repeater-shortcode-control' ).val( '' );

						/*Append new box*/
						th.find( '.customizer-repeater-general-control-repeater-container:first' ).parent().append( field );

						/*Refresh values*/
						customizer_repeater_refresh_general_control_values();
					}

				}
				return false;
			}
		);

		theme_conrols.on(
			'click', '.social-repeater-general-control-remove-field', function () {
				if (typeof    jQuery( this ).parent() !== 'undefined') {
					jQuery( this ).parent().hide(
						500, function(){
							jQuery( this ).parent().remove();
							customizer_repeater_refresh_general_control_values();

						}
					);
				}
				return false;
			}
		);

		theme_conrols.on(
			'keyup', '.customizer-repeater-title-control', function () {
				customizer_repeater_refresh_general_control_values();
			}
		);

		jQuery( 'input.customizer-repeater-color-control' ).wpColorPicker( color_options );
		jQuery( 'input.customizer-repeater-color2-control' ).wpColorPicker( color_options );

		theme_conrols.on(
			'keyup', '.customizer-repeater-subtitle-control', function () {
				customizer_repeater_refresh_general_control_values();
			}
		);

		theme_conrols.on(
			'keyup', '.customizer-repeater-shortcode-control', function () {
				customizer_repeater_refresh_general_control_values();
			}
		);

		theme_conrols.on(
			'keyup', '.customizer-repeater-text-control', function () {
				customizer_repeater_refresh_general_control_values();
			}
		);

		theme_conrols.on(
			'keyup', '.customizer-repeater-link-control', function () {
				customizer_repeater_refresh_general_control_values();
			}
		);

		theme_conrols.on(
			'keyup', '.customizer-repeater-text2-control', function () {
				customizer_repeater_refresh_general_control_values();
			}
		);

		theme_conrols.on(
			'keyup', '.customizer-repeater-link2-control', function () {
				customizer_repeater_refresh_general_control_values();
			}
		);

		/*Drag and drop to change icons order*/

		jQuery( '.customizer-repeater-general-control-droppable' ).sortable(
			{
				axis: 'y',
				update: function () {
					customizer_repeater_refresh_general_control_values();
				}
			}
		);

		/*----------------- Socials Repeater ---------------------*/
		theme_conrols.on(
			'click', '.social-repeater-add-social-item', function (event) {
				event.preventDefault();
				var th = jQuery( this ).parent();
				var id = 'customizer-repeater-social-repeater-' + customizer_repeater_uniqid();
				if (typeof th !== 'undefined') {
					var field = th.find( '.customizer-repeater-social-repeater-container:first' ).clone( true, true );
					if (typeof field !== 'undefined') {
						field.find( '.icp' ).val( '' );
						field.find( '.input-group-addon' ).find( '.fa' ).attr( 'class','fa' );
						field.find( '.social-repeater-remove-social-item' ).show();
						field.find( '.customizer-repeater-social-repeater-link' ).val( '' );
						field.find( '.customizer-repeater-social-repeater-id' ).val( id );
						th.find( '.customizer-repeater-social-repeater-container:first' ).parent().append( field );
					}
				}
				return false;
			}
		);

		theme_conrols.on(
			'click', '.social-repeater-remove-social-item', function (event) {
				event.preventDefault();
				var th       = jQuery( this ).parent();
				var repeater = jQuery( this ).parent().parent();
				th.remove();
				customizer_repeater_refresh_social_icons( repeater );
				return false;
			}
		);

		theme_conrols.on(
			'keyup', '.customizer-repeater-social-repeater-link', function (event) {
				event.preventDefault();
				var repeater = jQuery( this ).parent().parent();
				customizer_repeater_refresh_social_icons( repeater );
				return false;
			}
		);

		theme_conrols.on(
			'change', '.customizer-repeater-social-repeater-container .icp', function (event) {
				event.preventDefault();
				var repeater = jQuery( this ).parent().parent().parent();
				customizer_repeater_refresh_social_icons( repeater );
				return false;
			}
		);

	}
);

var entityMap = {
	'&': '&amp;',
	'<': '&lt;',
	'>': '&gt;',
	'"': '&quot;',
	'\'': '&#39;',
	'/': '&#x2F;'
};

function escapeHtml(string) {
	'use strict';
	// noinspection JSUnresolvedFunction
	string = String( string ).replace( new RegExp( '\r?\n', 'g' ), '<br />' );
	string = String( string ).replace( /\\/g, '&#92;' );
	return String( string ).replace(
		/[&<>"'\/]/g, function (s) {
			return entityMap[s];
		}
	);

}
controls/custom-controls/repeater/style.css000066600000011020151123453750015247 0ustar00.customizer-repeater-general-control-repeater-container .customizer-repeater-box-content-hidden:after {
	content: "";
	display: table;
	clear: both;
}

.customizer-repeater-general-control-repeater-container .customizer-repeater-box-content-hidden {
	display: none;
}

.customizer-repeater-customize-control-title {
	margin: 0;
	padding: 15px;
	font-size: 1em;
	line-height: 1;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	display: block;
	font-weight: 600;
	color: #23282d;
	border: 1px solid #e5e5e5;
	cursor: move;
}

.customizer-repeater-customize-control-title:hover {
	border: 1px solid #999;
}

.customizer-repeater-customize-control-title:after {
	content: "\f140";
	font-family: dashicons;
	font-size: 20px;
	height: 13px;
	bottom: 3px;
	position: relative;
	float: right;
}

.customizer-repeater-customize-control-title.repeater-expanded:after {
	content: "\f142";
}

.customizer-repeater-box-content-hidden {
	border: 1px solid #e5e5e5;
	border-top: none;
	padding: 1px 10px 10px;
}

.customizer-repeater-box-content-hidden > div {
	margin: 1em 0;
}

.customizer-repeater-box-content-hidden .customize-control-title {
	font-size: 13px;
	line-height: 1.5;
	font-weight: normal;
	margin-bottom: 0;
	margin-top: 1em;
}

.customizer-repeater-box-content-hidden .customize-control-title:after {
	content: ":";
}

.customizer-repeater-box-content-hidden span.description {
	font-size: 12px;
	font-style: normal;
}

.customizer-repeater-general-control-repeater-container, .customizer-repeater-general-control-repeater_container {
	border: 1px solid #e5e5e5;
	border-top: none;
	margin-bottom: 12px;
	width: 100%;
	float: left;
	background: #fff;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.customizer-repeater-box-content-hidden .wp-picker-container, .customizer-repeater-box-content-hidden .wp-picker-container .wp-color-result, .icp-container {
	margin: 0;
}

.customizer-repeater-box-content-hidden input:not(.icp, .wp-color-picker),
.customizer-repeater-box-content-hidden textarea,
.customizer-repeater-box-content-hidden .wp-picker-container {
	margin-bottom: 1em !important;
}

.social-repeater-general-control-remove-field {
	cursor: pointer;
	color: #a00;
	background: none;
	border: none;
	padding: 0;
	margin-top: 10px;
}

.social-repeater-general-control-remove-field:hover {
	color: red;
}

.customizer-repeater-box-content-hidden .wp-picker-holder {
	position: relative;
	left: -10px;
}

.customizer-repeater-box-content-hidden .wp-picker-input-wrap {
	margin-left: 10px;
}

.customizer-repeater-box-content-hidden .wp-picker-container .iris-picker {
	border-left: none;
	border-right: none;
}

button.customizer-repeater-new-field {
	float: right;
}

button.customizer-repeater-new-field:before {
	content: "\f132";
	display: inline-block;
	position: relative;
	left: -2px;
	top: -1px;
	font: 400 20px/1 dashicons;
	vertical-align: middle;
	-webkit-transition: all .2s;
	transition: all .2s;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.customizer-repeater-box-content-hidden > div.customizer-repeater-social-repeater {
	margin-top: 0;
}

.customizer-repeater-general-control-repeater-container .customizer-repeater-icon-control {
	width: 100%;
	margin: 0;
	padding: 0;
}

#customizer-repeater-new-field {
	width: 100%;
}

.customize-control-widget_form .widget-control-save {
	display: block !important;
}

.customizer-repeater-box-content-hidden {
	background-color: #fff;
}

.customizer-repeater-image-control .customizer-repeater-custom-media-button {
	margin-top: 5px;
}

.customizer-icons {
	display: inline-block;
	padding: 0 10px 0 0;
	vertical-align: middle;
}

.social-repeater-remove-social-item {
	display: inline-block;
	vertical-align: top;
	color: #a00;
	border: none;
	background: none;
	cursor: pointer;
	padding: 0;
}

.social-repeater-remove-social-item:hover {
	color: red;
}

.customizer-repeater-social-repeater > .customizer-repeater-social-repeater-container:not(:first-child) {
	margin-top: 25px;
}

.icp-container {
	margin-bottom: 10px;
}

.button-secondary.social-repeater-add-social-item:before {
	content: "\f132";
	display: inline-block;
	position: relative;
	left: -2px;
	top: -1px;
	font: 400 20px/1 dashicons;
	vertical-align: middle;
	-webkit-transition: all .2s;
	transition: all .2s;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.button-secondary.social-repeater-add-social-item {
	vertical-align: text-top;
	float: right;
}

.customizer-repeater-box-content-hidden textarea {
	width: 100%;
}
controls/custom-controls/alpha-color-picker/style.css000066600000011324151123453750017123 0ustar00/**
 * Alpha Color Picker CSS
 */

.customize-control-alpha-color .wp-picker-container .iris-picker {
	border-bottom:none;
}

.customize-control-alpha-color .wp-picker-container {
	max-width: 257px;
}

.customize-control-alpha-color .wp-picker-open + .wp-picker-input-wrap {
	width: 100%;
}

.customize-control-alpha-color .wp-picker-input-wrap input[type="text"].wp-color-picker.alpha-color-control {
	float: left;
	width: 195px;
}

.customize-control-alpha-color .wp-picker-input-wrap .button {
	margin-left: 0;
	float: right;
}

.wp-picker-container .wp-picker-open ~ .wp-picker-holder .alpha-color-picker-container {
	display: block;
}

.alpha-color-picker-container {
	border: 1px solid #dfdfdf;
	border-top: none;
	display: none;
	background: #FFF;
	padding: 0 11px 10px;
	position: relative;
}

.alpha-color-picker-container .ui-widget-content,
.alpha-color-picker-container .ui-widget-header,
.alpha-color-picker-wrap .ui-state-focus {
	background: transparent;
	border: none;
}

.alpha-color-picker-wrap a.iris-square-value:focus {
	-webkit-box-shadow: none;
	box-shadow: none;
}

.alpha-color-picker-container .ui-slider {
	position: relative;
	z-index: 1;
	height: 24px;
	text-align: center;
	margin: 0 auto;
	width: 88%;
	width: calc( 100% - 28px );
}

.alpha-color-picker-container .ui-slider-handle,
.alpha-color-picker-container .ui-widget-content .ui-state-default {
	color: #777;
	background-color: #FFF;
	text-shadow: 0 1px 0 #FFF;
	text-decoration: none;
	position: absolute;
	z-index: 2;
	box-shadow: 0 1px 2px rgba(0,0,0,0.2);
	border: 1px solid #aaa;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	margin-top: -2px;
	top: 0;
	height: 26px;
	width: 26px;
	cursor: ew-resize;
	font-size: 0;
	padding: 0;
	line-height: 27px;
	margin-left: -14px;
}

.alpha-color-picker-container .ui-slider-handle.show-opacity {
	font-size: 12px;
}

.alpha-color-picker-container .click-zone {
	width: 14px;
	height: 24px;
	display: block;
	position: absolute;
	left: 10px;
}

.alpha-color-picker-container .max-click-zone {
	right: 10px;
	left: auto;
}

.alpha-color-picker-container .transparency {
	height: 24px;
	width: 100%;
	background-color: #FFF;
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOkAAAAYCAQAAAC18BLUAAAF0ElEQVRo3pVa69XrNgwjfLqL1+g2Xandpmt4GaM/4gdFApKbe26+xLYkik8QCv5mMCLu9+f/zuB19Yy43hnnEc91Bq+rDD7P32N+n+7nn+/XTOfO53rE+dzn8bt6PnNcn/bfs+881/XjTPOf7739fvoc1xfz/+Sp81wjjvOVIc+1Fznu68co+TNP0s+ZNPXbr/i3Zy2/f3/Pj1cjGNzj/rZFBCK/MAyJ4HUfwefzPYZl5P2iuPZ+hxiVr3H4juRu93221fFImkdj+Mw0GmkOPDOO6+Y5KHQ0rsW2E6Sr8QQL48vrtyranqtkTcN/cntUg2FzeCaEMBoexVRTKDPWrVflUIqqnIVpq0irs6mYbQY2w3ApXaTMFWm/THIz6Q5lZF6T0hSUso7XaINDvjYz8F2KwkvYPBfCX7WQmPhlSIWOaqvGyEpC2QeH2I3yFKYRw8GJ7j3o/MPHzFEcgM3E41MQ7sRBZ0yrKzdrbrwJEXW04DFl96O8eIh79Q4H86NsiMLctErX2YBP1GDiMJAOmNdDc5+VE/i1MMzr89it66xTfnC/6+8maqDfBFKVhYhF2s30+ljXc6OdNNk5VB1T4yDyBoZYRoom5ZJ1Xxo5wMQybSbrKbvjjj625hpE/IutJbfs5yGSnfdEX4fuhIPJRlRq9BljBBAoqD0++DQGYypThUmgFbKgFRfKYoZFwKj8wTY2YxyRZX7wSFWYmiRQDP0NvY3JT20ZKdowAA+YyPBJGgLERYo7SiCi0atyYRoHo02iKBIrt/Zu1zWH3LY0J0TEHaUKf9ZkQxnma+EgssAsEcKoigYhjpGGYsjs2Rwwcp4JqdJRND/VnXyBcbLHJzOush4nDc6zmzdKOYHLIbYCodxZUl2lQ9oYcOvpJoei46VMd2iIns3kVfIayZB9K0xZ4sJUDqRxgYyL3raWGhReVWZCi2PKpkWnGhgVs/RxHJoHCJVBpnpKLM5mfBT8oDMKZRbBgBUoNVF3iGkmC6NpF2LRdjrAI5jpMFl4nTIo2534RC841EcTASNydjmlO57rNWGKQ12nGkxnKyzQ8wrvo1mkzoVgxJ/8Y9ddWBwVJl939jzd+c53GPH2jt0YCB4Ghu9s1YqBiIPyee4Gzx5nUvqZnkciAVPFPUJWaexnccHzN+pQBenHjXdS9daPKB+77oV5hOa7do2KcVx6O1KUuh6Ok9qFKVpT6XQGnyBYk4qt0aoIBTPKQnKiJX9K+hMFJavq2JEzJ5Cvc9f4wFipiszCC9imbZPMi06NbNBgZSZN1GtBHXGBD4Cjwgkse0BU8D+4TqX+Kc2JIhskNp0fdawOK8L25e/6pUBtolWGoawUYeX7vKymOcbjEJucdn29ZVk3ABhUS/HOSeZhMTiM66vZKNA2luZUAeVzXYF8f3ETDSs/cYkwJy40R0QYukjIlKYgy4rghywTmNLvmTuqadGbAVaVY+GAIOXn3BsmNOrIEffmpvQr/wy1lK2GzZtpLtWdvZaSze11CaUZgU3qPaohGgWU9TmcisDSoB019MJD00XO8D4XydcRLx+7jDFKvzQkIQljTBgPiKM12EYEppLHhPdlSYyM2RkjWkPCDzHjUx4kJ46JZmagkuZQw0FXsddNQGsadAvLeXLRDmPSbUGS9hDsjuKivpy+uoSJhdGwxPs0B3KQbNXaPbTjemIQ5RAjxsQL60X6EBwNCKFgSF0ZuWyCvLlgmxeYCtqhPj63ahwOExS/5aAMDc9F2dgoyWF+BaHoT3Z4NP7kw/vP2M7QMEUUJyVoUL9vIWSl0sphm4MFD6P0d7CVfsbLaikh2jTHSHNB6a/QCCf5Qvblb5R21VcvdM0EpuLBgC3VPiiCHOIMhgOShGBe1bwwlX40HJbgxWNqRTjO+O340IRh2Wy1hqr/qoGO4W+eg//B+erTfdimBQPdRnm2QhE//axVqaOm0oqOIX+Yptmtzhc5RM8F8lC/eRzzSMf7vSDFf67LPR9fAb+7AAAAAElFTkSuQmCC);
	box-shadow: 0 0 5px rgba(0,0,0,0.4) inset;
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	border-radius: 3px;
	padding: 0;
	margin-top: -24px;
}

@media only screen and (max-width: 782px) {
	.customize-control-alpha-color .wp-picker-input-wrap input[type="text"].wp-color-picker.alpha-color-control {
		width: 184px;
	}
}

@media only screen and (max-width: 640px) {
	.customize-control-alpha-color .wp-picker-input-wrap input[type="text"].wp-color-picker.alpha-color-control {
		width: 172px;
		height: 33px;
	}
}
controls/custom-controls/alpha-color-picker/script.js000066600000021421151123453750017112 0ustar00/**
 * Alpha Color Picker JS
 *
 * This file includes several helper functions and the core control JS.
 *
 * @package Hestia
 */

/**
 * Override the stock color.js toString() method to add support for
 * outputting RGBa or Hex.
 */
Color.prototype.toString = function( flag ) {

	// If our no-alpha flag has been passed in, output RGBa value with 100% opacity.
	// This is used to set the background color on the opacity slider during color changes.
	if ( 'no-alpha' == flag ) {
		return this.toCSS( 'rgba', '1' ).replace( /\s+/g, '' );
	}

	// If we have a proper opacity value, output RGBa.
	if ( 1 > this._alpha ) {
		return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );
	}

	// Proceed with stock color.js hex output.
	var hex = parseInt( this._color, 10 ).toString( 16 );
	if ( this.error ) {
		return ''; }
	if ( hex.length < 6 ) {
		for ( var i = 6 - hex.length - 1; i >= 0; i-- ) {
			hex = '0' + hex;
		}
	}

	return '#' + hex;
};

/**
 * Given an RGBa, RGB, or hex color value, return the alpha channel value.
 */
function acp_get_alpha_value_from_color( value ) {
	var alphaVal;

	// Remove all spaces from the passed in value to help our RGBa regex.
	value = value.replace( / /g, '' );

	if ( value.match( /rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/ ) ) {
		alphaVal = parseFloat( value.match( /rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/ )[1] ).toFixed( 2 ) * 100;
		alphaVal = parseInt( alphaVal );
	} else {
		alphaVal = 100;
	}

	return alphaVal;
}

/**
 * Force update the alpha value of the color picker object and maybe the alpha slider.
 */
function acp_update_alpha_value_on_color_control( alpha, $control, $alphaSlider, update_slider ) {
	var iris, colorPicker, color;

	iris        = $control.data( 'a8cIris' );
	colorPicker = $control.data( 'wpWpColorPicker' );

	// Set the alpha value on the Iris object.
	iris._color._alpha = alpha;

	// Store the new color value.
	color = iris._color.toString();

	// Set the value of the input.
	$control.val( color );

	// Update the background color of the color picker.
	colorPicker.toggler.css(
		{
			'background-color': color
		}
	);

	// Maybe update the alpha slider itself.
	if ( update_slider ) {
		acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider );
	}

	// Update the color value of the color picker object.
	$control.wpColorPicker( 'color', color );
}

/**
 * Update the slider handle position and label.
 */
function acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ) {
	$alphaSlider.slider( 'value', alpha );
	$alphaSlider.find( '.ui-slider-handle' ).text( alpha.toString() );
}

/**
 * Initialization trigger.
 */
jQuery( document ).ready(
	function( $ ) {

			// Loop over each control and transform it into our color picker.
			$( '.alpha-color-control' ).each(
				function() {

					// Scope the vars.
					var $control, startingColor, paletteInput, showOpacity, defaultColor, palette,
					colorPickerOptions, $container, $alphaSlider, alphaVal, sliderOptions;

					// Store the control instance.
					$control = $( this );

					// Get a clean starting value for the option.
					startingColor = $control.val().replace( /\s+/g, '' );

					// Get some data off the control.
					paletteInput = $control.attr( 'data-palette' );
					showOpacity  = $control.attr( 'data-show-opacity' );
					defaultColor = $control.attr( 'data-default-color' );

					// Process the palette.
					if ( paletteInput.indexOf( '|' ) !== -1 ) {
						palette = paletteInput.split( '|' );
					} else if ( 'false' == paletteInput ) {
						palette = false;
					} else {
						palette = true;
					}

					// Set up the options that we'll pass to wpColorPicker().
					colorPickerOptions = {
						change: function( event, ui ) {
							var key, value, alpha, $transparency;

							key   = $control.attr( 'data-customize-setting-link' );
							value = $control.wpColorPicker( 'color' );

							// Set the opacity value on the slider handle when the default color button is clicked.
							if ( defaultColor == value ) {
								alpha = acp_get_alpha_value_from_color( value );
								$alphaSlider.find( '.ui-slider-handle' ).text( alpha );
							}

							// Send ajax request to wp.customize to trigger the Save action.
							wp.customize(
								key, function( obj ) {
									obj.set( value );
								}
							);

							$transparency = $container.find( '.transparency' );

							// Always show the background color of the opacity slider at 100% opacity.
							$transparency.css( 'background-color', ui.color.toString( 'no-alpha' ) );
						},
						palettes: palette // Use the passed in palette.
					};

					// Create the colorpicker.
					$control.wpColorPicker( colorPickerOptions );

					$container = $control.parents( '.wp-picker-container:first' );

					// Insert our opacity slider.
					$(
						'<div class="alpha-color-picker-container">' +
						'<div class="min-click-zone click-zone"></div>' +
						'<div class="max-click-zone click-zone"></div>' +
						'<div class="alpha-slider"></div>' +
						'<div class="transparency"></div>' +
						'</div>'
					).appendTo( $container.find( '.wp-picker-holder' ) );

					$alphaSlider = $container.find( '.alpha-slider' );

					// If starting value is in format RGBa, grab the alpha channel.
					alphaVal = acp_get_alpha_value_from_color( startingColor );

					// Set up jQuery UI slider() options.
					sliderOptions = {
						create: function( event, ui ) {
							var value = $( this ).slider( 'value' );

							// Set up initial values.
							$( this ).find( '.ui-slider-handle' ).text( value );
							$( this ).siblings( '.transparency ' ).css( 'background-color', startingColor );
						},
						value: alphaVal,
						range: 'max',
						step: 1,
						min: 0,
						max: 100,
						animate: 300
					};

					// Initialize jQuery UI slider with our options.
					$alphaSlider.slider( sliderOptions );

					// Maybe show the opacity on the handle.
					if ( 'true' == showOpacity ) {
						$alphaSlider.find( '.ui-slider-handle' ).addClass( 'show-opacity' );
					}

					// Bind event handlers for the click zones.
					$container.find( '.min-click-zone' ).on(
						'click', function() {
							acp_update_alpha_value_on_color_control( 0, $control, $alphaSlider, true );
						}
					);
					$container.find( '.max-click-zone' ).on(
						'click', function() {
							acp_update_alpha_value_on_color_control( 100, $control, $alphaSlider, true );
						}
					);

					// Bind event handler for clicking on a palette color.
					$container.find( '.iris-palette' ).on(
						'click', function() {
							var color, alpha;

							color = $( this ).css( 'background-color' );
							alpha = acp_get_alpha_value_from_color( color );

							acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider );

							// Sometimes Iris doesn't set a perfect background-color on the palette,
							// for example rgba(20, 80, 100, 0.3) becomes rgba(20, 80, 100, 0.298039).
							// To compensante for this we round the opacity value on RGBa colors here
							// and save it a second time to the color picker object.
							if ( alpha != 100 ) {
								color = color.replace( /[^,]+(?=\))/, ( alpha / 100 ).toFixed( 2 ) );
							}

							$control.wpColorPicker( 'color', color );
						}
					);

					// Bind event handler for clicking on the 'Clear' button.
					$container.find( '.button.wp-picker-clear' ).on(
						'click', function() {
							var key = $control.attr( 'data-customize-setting-link' );

							// The #fff color is delibrate here. This sets the color picker to white instead of the
							// defult black, which puts the color picker in a better place to visually represent empty.
							$control.wpColorPicker( 'color', '#ffffff' );

							// Set the actual option value to empty string.
							wp.customize(
								key, function( obj ) {
									obj.set( '' );
								}
							);

							acp_update_alpha_value_on_alpha_slider( 100, $alphaSlider );
						}
					);

					// Bind event handler for clicking on the 'Default' button.
					$container.find( '.button.wp-picker-default' ).on(
						'click', function() {
							var alpha = acp_get_alpha_value_from_color( defaultColor );

							acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider );
						}
					);

					// Bind event handler for typing or pasting into the input.
					$control.on(
						'input', function() {
							var value = $( this ).val();
							var alpha = acp_get_alpha_value_from_color( value );

							acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider );
						}
					);

					// Update all the things when the slider is interacted with.
					$alphaSlider.slider().on(
						'slide', function( event, ui ) {
							var alpha = parseFloat( ui.value ) / 100.0;

							acp_update_alpha_value_on_color_control( alpha, $control, $alphaSlider, false );

							// Change value shown on slider handle.
							$( this ).find( '.ui-slider-handle' ).text( ui.value );
						}
					);

				}
			);
	}
);
controls/custom-controls/alpha-color-picker/class-hestia-customize-alpha-color-control.php000066600000006755151123453750026253 0ustar00<?php
/**
 * Alpha Color Picker Customizer Control
 *
 * This control adds a second slider for opacity to the stock WordPress color picker,
 * and it includes logic to seamlessly convert between RGBa and Hex color values as
 * opacity is added to or removed from a color.
 *
 * This Alpha Color Picker is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * 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 Alpha Color Picker. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package Hestia
 * @since Hestia 1.0
 */

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return null;
}

/**
 * Class Hestia_Customize_Alpha_Color_Control
 */
class Hestia_Customize_Alpha_Color_Control extends WP_Customize_Control {
	/**
	 * Official control name.
	 *
	 * @var string
	 */
	public $type = 'alpha-color';
	/**
	 * Add support for palettes to be passed in.
	 *
	 * Supported palette values are true, false, or an array of RGBa and Hex colors.
	 *
	 * @var bool
	 */
	public $palette;
	/**
	 * Add support for showing the opacity value on the slider handle.
	 *
	 * @var array
	 */
	public $show_opacity;
	/**
	 * Enqueue scripts and styles.
	 *
	 * Ideally these would get registered and given proper paths before this control object
	 * gets initialized, then we could simply enqueue them here, but for completeness as a
	 * stand alone class we'll register and enqueue them here.
	 */
	public function enqueue() {
		wp_enqueue_script(
			'hestia_alpha-color-picker',
			get_template_directory_uri() . '/inc/customizer/controls/custom-controls/alpha-color-picker/script.js',
			array( 'jquery', 'wp-color-picker' ),
			HESTIA_VERSION,
			true
		);
		wp_enqueue_style(
			'hestia_alpha-color-picker',
			get_template_directory_uri() . '/inc/customizer/controls/custom-controls/alpha-color-picker/style.css',
			array( 'wp-color-picker' ),
			HESTIA_VERSION
		);
	}
	/**
	 * Render the control.
	 */
	public function render_content() {
		// Process the palette
		if ( is_array( $this->palette ) ) {
			$palette = implode( '|', $this->palette );
		} else {
			// Default to true.
			$palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true';
		}
		// Support passing show_opacity as string or boolean. Default to true.
		$show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true';
		// Output the label and description if they were passed in.
		if ( isset( $this->label ) && '' !== $this->label ) {
			echo '<span class="customize-control-title">' . sanitize_text_field( $this->label ) . '</span>';
		}
		if ( isset( $this->description ) && '' !== $this->description ) {
			echo '<span class="description customize-control-description">' . sanitize_text_field( $this->description ) . '</span>';
		}
		?>
		<label>
			<input class="alpha-color-control" type="text" data-show-opacity="<?php echo esc_attr( $show_opacity ); ?>" data-palette="<?php echo esc_attr( $palette ); ?>" data-default-color="<?php echo esc_attr( $this->settings['default']->default ); ?>" <?php esc_attr( $this->link() ); ?>  />
		</label>
		<?php
	}
}
controls/custom-controls/range-value/style.css000066600000007436151123453750015666 0ustar00.range-slider {
	width: 100%;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	flex-wrap: wrap;
	-webkit-align-items: center;
	align-items: center;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	flex-direction: row;
	justify-content: flex-start;
}

.range-slider__range {
	background-color: rgba(0,0,0,.1);
	height: 5px;
	width: 67%;
	padding: 0;
	cursor: pointer;
	outline: none;
	-webkit-transition: background .5s;
	-moz-transition: background .5s;
	transition: background .5s;
	-webkit-appearance: none;
}

.range-slider__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 15px;
	height: 15px;
	border: none;
	border-radius: 15px;
	background-color: #2e86b9;
}

.range-slider__range::-webkit-slider-thumb:hover {
	background: #0085ba;
}

.range-slider__range:active::-webkit-slider-thumb {
	background: #0085ba;
}

.range-slider__range::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border: 0;
	border-radius: 50%;
	background: #0085ba;
	cursor: pointer;
	-webkit-transition: background .15s ease-in-out;
	transition: background .15s ease-in-out;
}

.range-slider__range::-moz-range-thumb:hover {
	background: #0085ba;
}

.range-slider__range:active::-moz-range-thumb {
	background: #0085ba;
}

.customize-control input[type=number].range-slider-value,
.customize-control input[type=text].range-slider-value {
	width: 21%;
	height: 28px;
	text-align: center;
	margin-left: 2%;
	border-radius: 4px;
	padding: 3px;
	font-size: 12px;
	font-weight: 600;
	color: #555;
	-moz-appearance: textfield;

}

.customize-control input[type=number].range-slider-value::-webkit-outer-spin-button,
.customize-control input[type=number].range-slider-value::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.customize-control input[type=number].range-slider-value {
	-moz-appearance: textfield;
}

.range-reset-slider .dashicons{
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

.customize-control span.range-reset-slider {
	display: inline-block;
	position: relative;
	width: 6%;
	line-height: 1;
	color: rgba(0,0,0,.2);
	cursor: pointer;
	text-align: center;
	transition: all .3s ease;
	-webkit-transition: all .3s ease;
	-moz-transition: all .3s ease;
	-o-transition: all .3s ease;
	-ms-transition: all .3s ease;
}
.customize-control span.range-reset-slider:hover {
	color: #fe5252;
}

::-moz-range-track {
	background: #d7dcdf;
	border: 0;
}

input::-moz-focus-inner, input::-moz-focus-outer {
	border: 0;
}

.customize-control-range-value .customize-control-title,
.customize-control-range-value .responsive-switchers{
	display: inline-block;
}

.responsive-switchers{
	display: inline-block;
	vertical-align: middle;
	margin-bottom: 5px;
}

.responsive-switchers .preview-tablet,
.responsive-switchers .preview-mobile{
	display: none;
}

.desktop-range,
.tablet-range,
.mobile-range{
	display: none;
	width:100%;
}

.desktop-range.active,
.tablet-range.active,
.mobile-range.active{
	display: block;
}

.customize-control .responsive-switchers { margin-left: 5px; width: auto; }
.customize-control .responsive-switchers-open li button { display: block; }
.customize-control .responsive-switchers li { float: left; margin: 0; }
.customize-control .responsive-switchers li button { height: 20px; width: 20px; background-color: #a4afb7; cursor: pointer; position: relative; margin-left: 5px; color: #fff; font-size: 10px; text-align: center; border-radius: 50%; padding: 0; border: 0; outline: none; -webkit-transition: background-color .5s; transition: background-color .5s; cursor: pointer; }
.customize-control .responsive-switchers li button:hover { background-color: #c2cbd2; }
.customize-control .responsive-switchers li button.active { background-color: #13aff0; }
.customize-control .responsive-switchers li button i { width: auto; height: auto; font-size: inherit; line-height: 18px; }
controls/custom-controls/range-value/script.js000066600000014002151123453750015641 0ustar00/**
 * Range control in customizer
 *
 * @package Hestia
 */

/* global wp */
/* global jQuery */
wp.customize.controlConstructor['range-value'] = wp.customize.Control.extend(
	{

		ready: function(){
			'use strict';

			jQuery.fn.exists = function(){return this.length > 0;};
			var control        = this,
			changeAction;
			var theme_controls = jQuery( '#customize-theme-controls' );

			function syncRangeText( slider, input, from ){
				switch (from) {
					case 'slider':
						var value = slider.val();
						var type  = jQuery( input ).attr( 'type' );
						if (type === 'text') { // inputBox
							if (value >= 0) {
								value = '+' + value;
							}
						}
						input.val( value );
						break;
					case 'input':
						slider.val( input.val() );
						break;
				}
			}

			function updateValues( control ){
				var collector    = control.find( '.range-collector' );
				var values       = getSliderValues( control );
				var have_queries = Object.keys( values ).length > 1;
				if ( have_queries ) {
					collector.val( JSON.stringify( values ) );
				} else {
					collector.val( values.desktop );
				}
				collector.trigger( 'change' );

			}

			function getSliderValues( control ) {
				var values          = {};
				var desktopSelector = control.find( '.range-slider__range[data-query="desktop"]' ),
				tabletSelector      = control.find( '.range-slider__range[data-query="tablet"]' ) ,
				mobileSelector      = control.find( '.range-slider__range[data-query="mobile"]' ),
				desktopValue, tabletValue, mobileValue;

				if ( desktopSelector.exists() ) {
					desktopValue = desktopSelector.val();
					if ( desktopValue !== 'undefined' && desktopValue !== '' ) {
						values.desktop = desktopValue;
					}
				}

				if ( tabletSelector.exists() ) {
					tabletValue = tabletSelector.val();
					if ( tabletValue !== 'undefined' && tabletValue !== '' ) {
						values.tablet = tabletValue;
					}
				}

				if ( mobileSelector.exists() ) {
					mobileValue = mobileSelector.val();
					if ( mobileValue !== 'undefined' && mobileValue !== '' ) {
						values.mobile = mobileValue;
					}
				}

				return values;
			}

			function responsiveSwitcher(){
				// Responsive switchers
				jQuery( '.customize-control .responsive-switchers button' ).on(
					'click', function( event ) {
						event.preventDefault();
						// Set up variables
						var $devices    = jQuery( '.responsive-switchers' ),
						$device         = jQuery( event.currentTarget ).data( 'device' ),
						$body           = jQuery( '.wp-full-overlay' ),
						$footer_devices = jQuery( '.wp-full-overlay-footer .devices' );

						// Button class
						$devices.find( 'button' ).removeClass( 'active' );
						$devices.find( 'button.preview-' + $device ).addClass( 'active' );

						var control = jQuery( '.range-slider.has-media-queries' );
						control.find( '.desktop-range' ).removeClass( 'active' );
						control.find( '.tablet-range' ).removeClass( 'active' );
						control.find( '.mobile-range' ).removeClass( 'active' );
						control.find( '.' + $device + '-range' ).addClass( 'active' );

						// Wrapper class
						$body.removeClass( 'preview-desktop preview-tablet preview-mobile' ).addClass( 'preview-' + $device );

						// Panel footer buttons
						$footer_devices.find( 'button' ).removeClass( 'active' ).attr( 'aria-pressed', false );
						$footer_devices.find( 'button.preview-' + $device ).trigger('click');

					}
				);

				jQuery( '#customize-footer-actions .devices button' ).on(
					'click', function( event ) {
						event.preventDefault();
						var device  = jQuery( this ).data( 'device' );
						var queries = jQuery( '.responsive-switchers' );
						if( device !== 'desktop'){
                            queries.addClass( 'responsive-switchers-open' );
						} else {
                            queries.removeClass( 'responsive-switchers-open' );
						}

						queries.find( 'button' ).removeClass( 'active' );
						queries.find( 'button.preview-' + device ).addClass( 'active' );

						var control = jQuery( '.range-slider.has-media-queries' );
						control.find( '.desktop-range' ).removeClass( 'active' );
						control.find( '.tablet-range' ).removeClass( 'active' );
						control.find( '.mobile-range' ).removeClass( 'active' );
						control.find( '.' + device + '-range' ).addClass( 'active' );
					}
				);
			}

			theme_controls.unbind().on(
				'click', '.preview-desktop.active', function () {
					jQuery( '.responsive-switchers' ).toggleClass( 'responsive-switchers-open' );
				}
			);

			theme_controls.on(
				'input', '.range-slider__range', function () {
					var slider  = jQuery( this );
					var input   = jQuery( this ).next();
					var control = jQuery( this ).parent().parent();
					syncRangeText( slider, input, 'slider' );
					updateValues( control );
				}
			);

			theme_controls.on(
				'keyup', '.range-slider-value', function(){
					var control = jQuery( this ).parent().parent();
					updateValues( control );
				}
			);
			theme_controls.on(
				'keydown', '.range-slider-value', function(){
					var slider = jQuery( this ).prev();
					var input  = jQuery( this );
					syncRangeText( slider, input, 'input' );
				}
			);

			theme_controls.on(
				'click', '.range-reset-slider', function (event) {
					event.preventDefault();
					var input        = jQuery( this ).prev();
					var slider       = input.prev();
					var control      = jQuery( this ).parent().parent();
					var defaultValue = slider.data( 'default' );
                    var type  = jQuery( input ).attr( 'type' );
                    if (type === 'text') { // inputBox
                        defaultValue = '+0';
                    }
					input.val( defaultValue );
					slider.val( defaultValue );
					updateValues( control );
				}
			);

			responsiveSwitcher();

			if ( 'postMessage' === control.setting.transport ) {
				changeAction = 'mousemove change';
			} else {
				changeAction = 'change';
			}

			// Change the value
			this.container.on(
				changeAction, '.range-collector', function() {
					control.setting.set( jQuery( this ).val() );
				}
			);
		}
	}
);
controls/custom-controls/range-value/class-hestia-customizer-range-value-control.php000066600000021064151123453750025162 0ustar00<?php
/**
 * The range value customize control extends the WP_Customize_Control class.
 *
 * @package Hestia
 * @since Hestia 1.1.30
 * @author     Justin Tadlock <justin@justintadlock.com>
 * @copyright  Copyright (c) 2016, Soderlind
 * @link       https://github.com/soderlind/class-customizer-range-value-control/blob/master/README.md
 * @license    http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return;
}

/**
 * Class Customizer_Range_Value_Control
 *
 * @since 1.1.31
 * @modified 1.1.38
 * @access public
 */
class Hestia_Customizer_Range_Value_Control extends WP_Customize_Control {

	/**
	 * Control type
	 *
	 * @var string
	 */
	public $type = 'range-value';

	/**
	 * Flag that enables media queries
	 *
	 * @var bool
	 */
	public $media_query = false;

	/**
	 * Settings for range inputs.
	 *
	 * @var array|mixed
	 */
	public $input_attr = array();

	/**
	 * Add/remove from fixed value flag
	 *
	 * @var bool
	 */
	public $sum_type = false;

	/**
	 * Hestia_Customizer_Range_Value_Control constructor.
	 *
	 * @param WP_Customize_Manager $manager Customize manager.
	 * @param string               $id Control id.
	 * @param array                $args Control arguments.
	 */
	public function __construct( $manager, $id, $args = array() ) {
		parent::__construct( $manager, $id, $args );

		if ( ! empty( $args['media_query'] ) ) {
			$this->media_query = (bool) $args['media_query'];
		}

		if ( ! empty( $args['input_attr'] ) ) {
			$this->input_attr = $args['input_attr'];
		}

		if ( ! empty( $args['sum_type'] ) ) {
			$this->sum_type = $args['sum_type'];
		}
	}

	/**
	 * Enqueue scripts/styles.
	 *
	 * @since 1.1.31
	 * @modified 1.1.38
	 * @access public
	 */
	public function enqueue() {
		wp_enqueue_script(
			'customizer-range-value-control', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/range-value/script.js', array(
				'jquery',
				'customize-base',
			), HESTIA_VERSION, true
		);
		wp_enqueue_style( 'customizer-range-value-control', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/range-value/style.css', array(), HESTIA_VERSION );
	}

	/**
	 * Handles input value.
	 *
	 * @since 1.1.38
	 * @return array
	 */
	public function json() {
		$json = parent::json();

		$json['value'] = $this->value();

		$json['default_value'] = ! empty( $this->setting->default ) ? $this->setting->default : '0';

		$json['desktop_value'] = ! $this->is_json( $json['value'] ) ? $json['value'] : $json['default_value'];
		$json['tablet_value']  = $json['default_value'];
		$json['mobile_value']  = $json['default_value'];

		if ( $this->is_json( $json['value'] ) ) {
			$decoded_value         = json_decode( $json['value'], true );
			$json['desktop_value'] = $decoded_value['desktop'];
			$json['tablet_value']  = $decoded_value['tablet'];
			$json['mobile_value']  = $decoded_value['mobile'];
		} else {
			$json['desktop_value'] = $json['value'];
		}
		$json['sum_type']    = $this->sum_type;
		$json['media_query'] = $this->media_query;
		$json['link']        = $this->get_link();
		if ( ! $this->contains_array( $this->input_attr ) ) {
			$json['min']  = ! empty( $this->input_attr['min'] ) ? $this->input_attr['min'] : 0;
			$json['max']  = ! empty( $this->input_attr['max'] ) ? $this->input_attr['max'] : 1;
			$json['step'] = ! empty( $this->input_attr['step'] ) ? $this->input_attr['step'] : 1;
		} else {
			foreach ( $this->input_attr as $device => $value ) {
				$json[ $device ] = $value;
			}
		}

		return $json;
	}

	/**
	 * Check if an array contains another array.
	 *
	 * @since 1.1.53
	 *
	 * @param array $array Array to check.
	 *
	 * @return bool
	 */
	private function contains_array( $array ) {
		foreach ( $array as $value ) {
			if ( is_array( $value ) ) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Check if a string is in json format
	 *
	 * @param  string $string Input.
	 *
	 * @since 1.1.31
	 * @access public
	 * @return bool
	 */
	public function is_json( $string ) {
		return is_string( $string ) && is_array( json_decode( $string, true ) ) ? true : false;
	}

	/**
	 * Render the control's content.
	 *
	 * @since 1.1.31
	 * @modified 1.1.38
	 * @access public
	 */
	protected function content_template() {
		?>
		<# if ( data.label ) { #>
		<span class="customize-control-title">
				<span>{{{ data.label }}}</span>
				<# if ( data.description ) { #>
					<i class="dashicons dashicons-editor-help" style="vertical-align: text-bottom;"
							title="{{{ data.description }}}"></i>
				<# } #>
			</span>
		<# if ( data.media_query ) { #>
		<ul class="responsive-switchers">
			<li class="desktop">
				<button type="button" class="preview-desktop active" data-device="desktop">
					<i class="dashicons dashicons-desktop"></i>
				</button>
			</li>
			<li class="tablet">
				<button type="button" class="preview-tablet" data-device="tablet">
					<i class="dashicons dashicons-tablet"></i>
				</button>
			</li>
			<li class="mobile">
				<button type="button" class="preview-mobile" data-device="mobile">
					<i class="dashicons dashicons-smartphone"></i>
				</button>
			</li>
		</ul>
		<# } #>
		<# }
		var min, max, step, default_value;
		if( data.min ){
		min = data.min;
		}
		if( data.max ){
		max = data.max;
		}
		if( data.step ){
		step = data.step;
		}
		if( data.default_value ){
		default_value = data.default_value;
		}

		if( data.desktop ){
		if ( data.desktop.min ){
		min = data.desktop.min;
		}
		if ( data.desktop.max ){
		max = data.desktop.max;
		}
		if ( data.desktop.step ){
		step = data.desktop.step;
		}
		if ( data.desktop.default_value ){
		default_value = data.desktop.default_value;
		}
		}
		if( data.desktop_value ){
		value = data.desktop_value;
		} else {
		if( default_value ) {
		value = default_value;
		}
		}
		if( data.sum_type === true ){
		input_type = 'text';
		} else {
		input_type = 'number';
		}
		#>
		<div class="range-slider <# if ( data.media_query ) { #>has-media-queries<# }#>">
			<div class="desktop-range active">
				<input type="range" class="range-slider__range" title="{{{data.label}}}" min="{{min}}" max="{{max}}"
						step="{{step}}" data-query="desktop" data-default="{{default_value}}" value="{{ value }}">
				<input type="{{input_type}}" class="range-slider-value" title="{{{data.label}}}" min="{{min}}"
						max="{{max}}" step="{{step}}"
						value="<# if( data.sum_type === true && value >= 0 ){ #> +<# } #>{{ value }}">
				<span class="range-reset-slider"><span class="dashicons dashicons-image-rotate"></span></span>
			</div>
			<# if ( data.media_query ) {

			if( data.tablet ){
			if ( data.tablet.min ){
			min = data.tablet.min;
			}
			if ( data.tablet.max ){
			max = data.tablet.max;
			}
			if ( data.tablet.step ){
			step = data.tablet.step;
			}
			if ( data.tablet.default_value ){
			default_value = data.tablet.default_value;
			}
			}
			if( data.tablet_value ){
			value = data.tablet_value;
			} else {
			if( default_value ) {
			value = default_value;
			}
			}
			#>
			<div class="tablet-range">
				<input type="range" class="range-slider__range" title="{{{data.label}}}" min="{{min}}" max="{{max}}"
						step="{{step}}" data-query="tablet" data-default="{{default_value}}" value="{{ value }}">
				<input type="{{input_type}}" class="range-slider-value" title="{{{data.label}}}" min="{{min}}"
						max="{{max}}" step="{{step}}"
						value="<# if( data.sum_type === true && value >= 0 ){ #> +<# } #>{{ value }}">
				<span class="range-reset-slider"><span class="dashicons dashicons-image-rotate"></span></span>
			</div>
			<# if( data.mobile ){
			if ( data.mobile.min ){
			min = data.mobile.min;
			}
			if ( data.mobile.max ){
			max = data.mobile.max;
			}
			if ( data.mobile.step ){
			step = data.mobile.step;
			}
			if ( data.mobile.default_value ){
			default_value = data.mobile.default_value;
			}
			}
			if( data.mobile_value ){
			value = data.mobile_value;
			} else {
			if( default_value ) {
			value = default_value;
			}
			}#>
			<div class="mobile-range">
				<input type="range" class="range-slider__range" title="{{{data.label}}}" min="{{min}}" max="{{max}}"
						step="{{step}}" data-query="mobile" data-default="{{default_value}}" value="{{ value }}">
				<input type="{{input_type}}" class="range-slider-value" title="{{{data.label}}}" min="{{min}}"
						max="{{max}}" step="{{step}}"
						value="<# if( data.sum_type === true && value >= 0 ){ #> +<# } #>{{ value }}">
				<span class="range-reset-slider"><span class="dashicons dashicons-image-rotate"></span></span>
			</div>
			<# } #>
			<input type="hidden" class="range-collector" title="{{{data.label}}}" value="{{ data.value }}" {{{ data.link
					}}}>
		</div>
		<?php
	}
}
controls/custom-controls/section-hiding/style.css000066600000001124151123453750016350 0ustar00.control-section-hiding-section .hestia-toggle-section,
.control-section-sidebar .hestia-toggle-section{
	text-decoration: none;
	margin-right: 5px;
	vertical-align: middle;
}

.control-section-hiding-section .hestia-toggle-section .dashicons,
.control-section-sidebar .hestia-toggle-section .dashicons{
	font-size:16px;
	vertical-align: middle;
}

.hestia-section-visible .hestia-toggle-section{
	color: #929292;
}

#customize-theme-controls .accordion-section-title.hestia-section-hidden,
.hestia-section-hidden .hestia-toggle-section{
	color: #dcdcdc;
}

.hestia-toggle-section{
	float:left
}
controls/custom-controls/section-hiding/script.js000066600000011212151123453750016337 0ustar00/**
 * Scripts file for the Show/Hide frontpage control in customizer
 *
 * @package Hestia
 */

/* global jQuery */
/* global wp */

jQuery( window ).load(
	function() {
		'use strict';

        var controlValue;
		var subscribeSection = jQuery( '#accordion-section-sidebar-widgets-subscribe-widgets' );

        var subscribeSectionHide = wp.customize.control( 'hestia_subscribe_hide' );
        if ( typeof subscribeSectionHide !== 'undefined' ) {
            controlValue = subscribeSectionHide.setting.get();
        }
		var iconClass        = 'dashicons-visibility';
		if (controlValue === true) {
			iconClass = 'dashicons-hidden';
			subscribeSection.find( '.accordion-section-title' ).addClass( 'hestia-section-hidden' ).removeClass( 'hestia-section-visible' );
		} else {
			subscribeSection.find( '.accordion-section-title' ).addClass( 'hestia-section-visible' ).removeClass( 'hestia-section-hidden' );
		}
		subscribeSection.find( '.screen-reader-text' ).after( '<a data-control="hestia_subscribe_hide" class="alignright hestia-toggle-section" href="#"><span class="dashicons' + iconClass + '"></span></a>' );

		var toggleSection = jQuery( '.hestia-toggle-section' );
		/**
	 * Fix for icons when they are in changeset is active
	 */
		toggleSection.each(
			function(){
				var controlName  = jQuery( this ).data( 'control' );
                var controlValue;
				if ( typeof wp.customize.control( controlName ) !== 'undefined' ) {
                    controlValue = wp.customize.control( controlName ).setting.get();
                }
				var parentHeader = jQuery( this ).parent();
				if ( typeof(controlName) !== 'undefined' && controlName !== '' ) {
					var iconClass = 'dashicons-visibility';
					if (controlValue === true) {
						iconClass = 'dashicons-hidden';
						parentHeader.addClass( 'hestia-section-hidden' ).removeClass( 'hestia-section-visible' );
					} else {
						parentHeader.addClass( 'hestia-section-visible' ).removeClass( 'hestia-section-hidden' );
					}
					jQuery( this ).children().attr( 'class','dashicons ' + iconClass );
				}
			}
		);

		toggleSection.on(
			'click',function(e){
				e.stopPropagation();
				var controlName  = jQuery( this ).data( 'control' );
				var parentHeader = jQuery( this ).parent();
				var controlValue = wp.customize.control( controlName ).setting.get();
				if ( typeof(controlName) !== 'undefined' && controlName !== '' ) {
					var iconClass = 'dashicons-visibility';
					/* Compare with false because value already changed when triggered this function */
					if (controlValue === false) {
						iconClass = 'dashicons-hidden';
						parentHeader.addClass( 'hestia-section-hidden' ).removeClass( 'hestia-section-visible' );
					} else {
						parentHeader.addClass( 'hestia-section-visible' ).removeClass( 'hestia-section-hidden' );
					}
					wp.customize.control( controlName ).setting.set( ! controlValue );
					jQuery( this ).children().attr( 'class','dashicons ' + iconClass );
				}
			}
		);

		jQuery( 'ul' ).find( '[data-customize-setting-link]' ).on(
			'click',function(){
				var showHideControls = [
					'hestia_features_hide',
					'hestia_about_hide',
					'hestia_shop_hide',
					'hestia_portfolio_hide',
					'hestia_team_hide',
					'hestia_pricing_hide',
					'hestia_ribbon_hide',
					'hestia_testimonials_hide',
					'hestia_subscribe_hide',
					'hestia_clients_bar_hide',
					'hestia_blog_hide',
					'hestia_contact_hide'
				];
				var controlName  = jQuery( this ).data( 'customize-setting-link' );
				if( showHideControls.indexOf(controlName) <= -1){
					return;
				}
				var sectionName  = jQuery( this ).parent().parent().parent().attr( 'id' );
				sectionName      = sectionName.replace( 'sub-','' );
				var parentHeader = jQuery( '#' + sectionName ).find( '.accordion-section-title' );
				if ( typeof (sectionName) !== 'undefined' && sectionName !== '') {

					if( wp.customize.control( controlName ) && wp.customize.control(controlName).setting ) {
                        var controlValue = wp.customize.control(controlName).setting.get();

                        var iconClass = 'dashicons-visibility';
                        if (controlValue === false) {
                            iconClass = 'dashicons-hidden';
                            parentHeader.addClass('hestia-section-hidden').removeClass('hestia-section-visible');
                        } else {
                            parentHeader.addClass('hestia-section-visible');
                            parentHeader.removeClass('hestia-section-hidden');
                        }
                        parentHeader.find('.hestia-toggle-section').children().attr('class', 'dashicons ' + iconClass);
                    }
				}
			}
		);
	}
);
controls/custom-controls/section-hiding/class-hestia-hiding-section.php000066600000007450151123453750022501 0ustar00<?php
/**
 * Class for sections that are hiding.
 *
 * @since 1.1.47
 * @package hestia
 */

/**
 * Class Hestia_Hiding_Section
 *
 * @since  1.1.49
 * @access public
 */
class Hestia_Hiding_Section extends WP_Customize_Section {

	/**
	 * The type of customize section being rendered.
	 *
	 * @since  1.1.47
	 * @access public
	 * @var    string
	 */
	public $type = 'hiding-section';

	/**
	 * Flag to display icon when entering in customizer
	 *
	 * @since  1.1.47
	 * @access public
	 * @var bool
	 */
	public $visible;

	/**
	 * Name of customizer hiding control.
	 *
	 * @since  1.1.47
	 * @access public
	 * @var bool
	 */
	public $hiding_control;

	/**
	 * Id of customizer hiding control.
	 *
	 * @since  1.1.82
	 * @access public
	 * @var integer
	 */
	public $id;


	/**
	 * Hestia_Hiding_Section constructor.
	 *
	 * @param WP_Customize_Manager $manager Customizer Manager.
	 * @param string               $id Control id.
	 * @param array                $args Arguments.
	 */
	public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
		parent::__construct( $manager, $id, $args );
		add_action( 'customize_controls_init', array( $this, 'enqueue' ) );

		if ( ! empty( $args['hiding_control'] ) ) {
			$this->visible = ! get_theme_mod( $args['hiding_control'] );
		}
	}

	/**
	 * Add custom parameters to pass to the JS via JSON.
	 *
	 * @since  1.1.47
	 * @access public
	 */
	public function json() {
		$json                   = parent::json();
		$json['visible']        = $this->visible;
		$json['hiding_control'] = $this->hiding_control;
		return $json;
	}


	/**
	 * Enqueue function.
	 *
	 * @since  1.1.47
	 * @access public
	 * @return void
	 */
	public function enqueue() {
		wp_enqueue_script( 'hestia-hiding-section', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/section-hiding/script.js', array( 'jquery' ), HESTIA_VERSION, true );
		wp_enqueue_style( 'hestia-hiding-section-style', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/section-hiding/style.css', array(), HESTIA_VERSION );
	}

	/**
	 * Outputs the Underscore.js template.
	 *
	 * @since  1.1.47
	 * @access public
	 * @return void
	 */
	protected function render_template() {
		?>
		<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }}">
			<h3 class="accordion-section-title <# if ( data.visible ) { #> hestia-section-visible <# } else { #> hestia-section-hidden <# }#>" tabindex="0">
				{{ data.title }}
				<# if ( data.visible ) { #>
					<a data-control="{{ data.hiding_control }}" class="hestia-toggle-section" href="#"><span class="dashicons dashicons-visibility"></span></a>
				<# } else { #>
					<a data-control="{{ data.hiding_control }}" class="hestia-toggle-section" href="#"><span class="dashicons dashicons-hidden"></span></a>
				<# } #>
			</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">
						</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"></button>
							<div class="description customize-section-description">
								{{{ data.description }}}
							</div>
							<# } #>
					</div>

					<# if ( data.description && ! data.description_hidden ) { #>
						<div class="description customize-section-description">
							{{{ data.description }}}
						</div>
						<# } #>
				</li>
			</ul>
		</li>
		<?php
	}
}
controls/custom-controls/multi-select/class-hestia-select-multiple.php000066600000005654151123453750022414 0ustar00<?php
/**
 * The multiple select customize control extends the WP_Customize_Control class.  This class allows
 * developers to create a `<select>` form field with the `multiple` attribute within the WordPress
 * theme customizer.
 *
 * @package    hestia
 * @author     Justin Tadlock <justin@justintadlock.com>
 */

/**
 * Multiple select customize control class.
 *
 * @since  1.1.40
 * @access public
 */
class Hestia_Select_Multiple extends WP_Customize_Control {
	/**
	 * The type of customize control being rendered.
	 *
	 * @since  1.1.40
	 * @access public
	 * @var    string
	 */
	public $type = 'select-multiple';

	/**
	 * Custom classes to apply on select.
	 *
	 * @since 1.1.40
	 * @access public
	 * @var string
	 */
	public $custom_class = '';

	/**
	 * Hestia_Select_Multiple constructor.
	 *
	 * @param WP_Customize_Manager $manager Customize manager object.
	 * @param string               $id Control id.
	 * @param array                $args Control arguments.
	 */
	public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
		parent::__construct( $manager, $id, $args );
		if ( array_key_exists( 'custom_class', $args ) ) {
			$this->custom_class = esc_attr( $args['custom_class'] );
		}
	}

	/**
	 * Loads the framework scripts/styles.
	 *
	 * @since  1.1.40
	 * @access public
	 * @return void
	 */
	public function enqueue() {
		wp_enqueue_script( 'hestia-customizer-select-multiple', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/multi-select/script.js', array( 'jquery', 'customize-base' ), HESTIA_VERSION, true );

	}
	/**
	 * Add custom parameters to pass to the JS via JSON.
	 *
	 * @since  1.1.40
	 * @access public
	 * @return array
	 */
	public function json() {
		$json                 = parent::json();
		$json['choices']      = $this->choices;
		$json['link']         = $this->get_link();
		$json['value']        = (array) $this->value();
		$json['id']           = $this->id;
		$json['custom_class'] = $this->custom_class;

		return $json;
	}


	/**
	 * Underscore JS template to handle the control's output.
	 *
	 * @since  1.1.40
	 * @access public
	 * @return void
	 */
	public function content_template() {
		?>
		<#
		if ( ! data.choices ) {
			return;
		} #>

		<label>
			<# if ( data.label ) { #>
				<span class="customize-control-title">{{ data.label }}</span>
			<# } #>

			<# if ( data.description ) { #>
				<span class="description customize-control-description">{{{ data.description }}}</span>
			<# } #>

			<#
			var custom_class = ''
			if ( data.custom_class ) {
				custom_class = 'class='+data.custom_class
			} #>
			<select multiple="multiple" {{{ data.link }}} {{ custom_class }}>
				<# _.each( data.choices, function( label, choice ) {
					var selected = ( data.value.indexOf( choice.toString() ) !== -1 ) ? 'selected="selected"' : ''
					#>
					<option value="{{ choice }}" {{ selected }} >{{ label }}</option>
				<# } ) #>
			</select>
		</label>
		<?php
	}
}
controls/custom-controls/multi-select/script.js000066600000001071151123453750016044 0ustar00/**
 * Multiple select control
 *
 * @package Hestia
 */

/* global jQuery */
/* global wp */
( function( $, api ) {
	'use strict';

	/* === Select Multiple Control === */
	api.controlConstructor['select-multiple'] = api.Control.extend(
		{
			ready: function() {
				var control = this;

				$( 'select', control.container ).change(
					function() {
						var value = $( this ).val();

						if ( null === value ) {
							control.setting.set( '' );
						} else {
							control.setting.set( value );
						}
					}
				);
			}
		}
	);

} )( jQuery, wp.customize );
controls/custom-controls/font-selector/functions.php000066600000000113151123453750017074 0ustar00<?php
/**
 * Fonts functions
 *
 * @package hestia
 * @since 1.1.38
 */



controls/custom-controls/font-selector/style.css000066600000003036151123453750016234 0ustar00#customize-theme-controls #sub-accordion-section-hestia_typography.customize-pane-child.open {
	height: 100%;
}
.hestia-ss-wrap {
    position: relative;
    box-sizing: border-box;
    border: 1px solid #ddd;
}
.hestia-ss-wrap.active {
    box-shadow: 0 0 2px rgba(30, 140, 190, .8);
    border: 1px solid #5897fb;
}
.customize-control input.hestia-fs-main-input {
	width: 90%;
	background: #fff;
	display: block;
	float: left;
	box-shadow: none;
	cursor: pointer;
    box-sizing: border-box;
    border-right: 0;
    height: 35px;
}
.customize-control input.hestia-fs-main-input:focus {
    border-color: #ddd;
}

.hestia-fs-input-addon {
	width: 10%;
	background: #fff;
	box-sizing: border-box;
	padding: 7px 0;
	line-height: 18px;
	display: inline-block;
	border: 1px solid #ddd;
	text-align: center;
	border-left: 0;
    height: 35px;
}

.hestia-fs-options-wrapper {
	max-height: 300px;
	overflow-y: scroll;
}

.hestia-fs-options-group {
	display: block;
}

.hestia-fs-search {
	padding: 7px;
	display: block;
	border-bottom: 1px solid #ddd;
}

.hestia-fs-option, .hestia-fs-options-heading {
	display: block;
	padding: 3px 5px;
	line-height: 18px;
}

.hestia-fs-option {
	cursor: pointer;
}

.hestia-fs-options-heading {
	font-weight: 600;
	color: #777;
	background: #eee;
}

.hestia-fs-option:hover {
	background: #5897fb;
	color: #fff;
}


.hestia-ss-wrap.active .hestia-fs-dropdown {
	display: block;
	width: 100%;
    z-index: 1000;
}

.hestia-fs-dropdown {
	background: #fff;
	border: 1px solid #ddd;
	border-top: 0;
	display: none;
	position: absolute;
}controls/custom-controls/font-selector/class-hestia-font-selector.php000066600000035665151123453750022252 0ustar00<?php
/**
 * Font selector.
 *
 * @package hestia
 * @since 1.1.38
 */

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return;
}

/**
 * Class Hestia_Font_Selector
 */
class Hestia_Font_Selector extends WP_Customize_Control {
	/**
	 * The control type.
	 *
	 * @access public
	 * @var string
	 */
	public $type = 'selector-font';

	/**
	 * Enqueue control related scripts/styles.
	 *
	 * @access public
	 */
	public function enqueue() {
		wp_enqueue_script( 'hestia-select-script', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/font-selector/script.js', array( 'jquery' ), HESTIA_VERSION, true );
		wp_enqueue_style( 'hestia-select-style', get_template_directory_uri() . '/inc/customizer/controls/custom-controls/font-selector/style.css', null, HESTIA_VERSION );
	}

	/**
	 * Render the control's content.
	 * Allows the content to be overriden without having to rewrite the wrapper in $this->render().
	 *
	 * @access protected
	 */
	protected function render_content() {
		$std_fonts    = $this->get_standard_fonts();
		$google_fonts = $this->get_google_fonts();
		$value        = $this->value();
		?>
		<label>
			<?php if ( ! empty( $this->label ) ) : ?>
				<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
			<?php endif; ?>
			<?php if ( ! empty( $this->description ) ) : ?>
				<span class="description customize-control-description"><?php echo wp_kses_post( $this->description ); ?></span>
			<?php endif; ?>
		</label>
		<div class="hestia-ss-wrap">
			<input class="hestia-fs-main-input" type="text"
					name="<?php echo esc_attr( $this->id ); ?>"
					value="<?php echo ( ! empty( $value ) ) ? esc_html( $value ) : __( 'Default', 'hestia' ); ?>"
					readonly>
			<span class="hestia-fs-input-addon"><i class="dashicons dashicons-arrow-down"></i></span>
			<div class="hestia-fs-dropdown">
				<span class="hestia-fs-search">
						<input type="search" placeholder="<?php echo _x( 'Search for:', 'label', 'hestia' ) . '...'; ?>">
				</span>
				<div class="hestia-fs-options-wrapper">
						<span class="hestia-fs-option"
								data-option="<?php esc_html_e( 'Default', 'hestia' ); ?>"><?php esc_html_e( 'Default', 'hestia' ); ?></span>
					<?php
					$this->render_dropdown_options_group( $std_fonts, esc_html__( 'Standard Fonts', 'hestia' ) );
					$this->render_dropdown_options_group( $google_fonts, esc_html__( 'Google Fonts', 'hestia' ) );
					?>
				</div>
			</div>
			<input type="hidden" class="hestia-ss-collector" <?php $this->link(); ?> >
		</div>
		<?php
	}

	/**
	 * Render the dropdown option group.
	 *
	 * @param array  $options Options in group.
	 *
	 * @param string $title Title of options group.
	 */
	protected function render_dropdown_options_group( $options, $title ) {
		if ( ! empty( $options ) ) {
			?>
			<span class="hestia-fs-options-group">
					<span class="hestia-fs-options-heading"><?php echo esc_html( $title ); ?></span>
				<?php foreach ( $options as $option ) { ?>
					<span class="hestia-fs-option"
							data-filter="<?php echo strtolower( esc_html( $option ) ); ?>"
							data-option="<?php echo esc_html( $option ); ?>"><?php echo esc_html( $option ); ?></span>
				<?php } ?>
				</span>
			<?php
		}
	}


	/**
	 * List of standard fonts
	 *
	 * @since 1.1.38
	 */
	function get_standard_fonts() {
		return apply_filters(
			'hestia_standard_fonts_array', array(
				'Arial, Helvetica, sans-serif',
				'Arial Black, Gadget, sans-serif',
				'Bookman Old Style, serif',
				'Comic Sans MS, cursive',
				'Courier, monospace',
				'Georgia, serif',
				'Garamond, serif',
				'Impact, Charcoal, sans-serif',
				'Lucida Console, Monaco, monospace',
				'Lucida Sans Unicode, Lucida Grande, sans-serif',
				'MS Sans Serif, Geneva, sans-serif',
				'MS Serif, New York, sans-serif',
				'Palatino Linotype, Book Antiqua, Palatino, serif',
				'Tahoma, Geneva, sans-serif',
				'Times New Roman, Times, serif',
				'Trebuchet MS, Helvetica, sans-serif',
				'Verdana, Geneva, sans-serif',
				'Paratina Linotype',
				'Trebuchet MS',
			)
		);
	}

	/**
	 * List of All Google fonts
	 *
	 * @since 1.1.38
	 */
	function get_google_fonts() {
		return apply_filters( 'hestia_google_fonts_array', array( 'ABeeZee', 'Abel', 'Abril Fatface', 'Aclonica', 'Acme', 'Actor', 'Adamina', 'Advent Pro', 'Aguafina Script', 'Akronim', 'Aladin', 'Aldrich', 'Alef', 'Alegreya', 'Alegreya SC', 'Alegreya Sans', 'Alegreya Sans SC', 'Alex Brush', 'Alfa Slab One', 'Alice', 'Alike', 'Alike Angular', 'Allan', 'Allerta', 'Allerta Stencil', 'Allura', 'Almendra', 'Almendra Display', 'Almendra SC', 'Amarante', 'Amaranth', 'Amatic SC', 'Amatica SC', 'Amethysta', 'Amiko', 'Amiri', 'Amita', 'Anaheim', 'Andada', 'Andika', 'Angkor', 'Annie Use Your Telescope', 'Anonymous Pro', 'Antic', 'Antic Didone', 'Antic Slab', 'Anton', 'Arapey', 'Arbutus', 'Arbutus Slab', 'Architects Daughter', 'Archivo Black', 'Archivo Narrow', 'Aref Ruqaa', 'Arima Madurai', 'Arimo', 'Arizonia', 'Armata', 'Artifika', 'Arvo', 'Arya', 'Asap', 'Asar', 'Asset', 'Assistant', 'Astloch', 'Asul', 'Athiti', 'Atma', 'Atomic Age', 'Aubrey', 'Audiowide', 'Autour One', 'Average', 'Average Sans', 'Averia Gruesa Libre', 'Averia Libre', 'Averia Sans Libre', 'Averia Serif Libre', 'Bad Script', 'Baloo', 'Baloo Bhai', 'Baloo Da', 'Baloo Thambi', 'Balthazar', 'Bangers', 'Basic', 'Battambang', 'Baumans', 'Bayon', 'Belgrano', 'Belleza', 'BenchNine', 'Bentham', 'Berkshire Swash', 'Bevan', 'Bigelow Rules', 'Bigshot One', 'Bilbo', 'Bilbo Swash Caps', 'BioRhyme', 'BioRhyme Expanded', 'Biryani', 'Bitter', 'Black Ops One', 'Bokor', 'Bonbon', 'Boogaloo', 'Bowlby One', 'Bowlby One SC', 'Brawler', 'Bree Serif', 'Bubblegum Sans', 'Bubbler One', 'Buda', 'Buenard', 'Bungee', 'Bungee Hairline', 'Bungee Inline', 'Bungee Outline', 'Bungee Shade', 'Butcherman', 'Butterfly Kids', 'Cabin', 'Cabin Condensed', 'Cabin Sketch', 'Caesar Dressing', 'Cagliostro', 'Cairo', 'Calligraffitti', 'Cambay', 'Cambo', 'Candal', 'Cantarell', 'Cantata One', 'Cantora One', 'Capriola', 'Cardo', 'Carme', 'Carrois Gothic', 'Carrois Gothic SC', 'Carter One', 'Catamaran', 'Caudex', 'Caveat', 'Caveat Brush', 'Cedarville Cursive', 'Ceviche One', 'Changa', 'Changa One', 'Chango', 'Chathura', 'Chau Philomene One', 'Chela One', 'Chelsea Market', 'Chenla', 'Cherry Cream Soda', 'Cherry Swash', 'Chewy', 'Chicle', 'Chivo', 'Chonburi', 'Cinzel', 'Cinzel Decorative', 'Clicker Script', 'Coda', 'Coda Caption', 'Codystar', 'Coiny', 'Combo', 'Comfortaa', 'Coming Soon', 'Concert One', 'Condiment', 'Content', 'Contrail One', 'Convergence', 'Cookie', 'Copse', 'Corben', 'Cormorant', 'Cormorant Garamond', 'Cormorant Infant', 'Cormorant SC', 'Cormorant Unicase', 'Cormorant Upright', 'Courgette', 'Cousine', 'Coustard', 'Covered By Your Grace', 'Crafty Girls', 'Creepster', 'Crete Round', 'Crimson Text', 'Croissant One', 'Crushed', 'Cuprum', 'Cutive', 'Cutive Mono', 'Damion', 'Dancing Script', 'Dangrek', 'David Libre', 'Dawning of a New Day', 'Days One', 'Dekko', 'Delius', 'Delius Swash Caps', 'Delius Unicase', 'Della Respira', 'Denk One', 'Devonshire', 'Dhurjati', 'Didact Gothic', 'Diplomata', 'Diplomata SC', 'Domine', 'Donegal One', 'Doppio One', 'Dorsa', 'Dosis', 'Dr Sugiyama', 'Droid Sans', 'Droid Sans Mono', 'Droid Serif', 'Duru Sans', 'Dynalight', 'EB Garamond', 'Eagle Lake', 'Eater', 'Economica', 'Eczar', 'Ek Mukta', 'El Messiri', 'Electrolize', 'Elsie', 'Elsie Swash Caps', 'Emblema One', 'Emilys Candy', 'Engagement', 'Englebert', 'Enriqueta', 'Erica One', 'Esteban', 'Euphoria Script', 'Ewert', 'Exo', 'Exo 2', 'Expletus Sans', 'Fanwood Text', 'Farsan', 'Fascinate', 'Fascinate Inline', 'Faster One', 'Fasthand', 'Fauna One', 'Federant', 'Federo', 'Felipa', 'Fenix', 'Finger Paint', 'Fira Mono', 'Fira Sans', 'Fjalla One', 'Fjord One', 'Flamenco', 'Flavors', 'Fondamento', 'Fontdiner Swanky', 'Forum', 'Francois One', 'Frank Ruhl Libre', 'Freckle Face', 'Fredericka the Great', 'Fredoka One', 'Freehand', 'Fresca', 'Frijole', 'Fruktur', 'Fugaz One', 'GFS Didot', 'GFS Neohellenic', 'Gabriela', 'Gafata', 'Galada', 'Galdeano', 'Galindo', 'Gentium Basic', 'Gentium Book Basic', 'Geo', 'Geostar', 'Geostar Fill', 'Germania One', 'Gidugu', 'Gilda Display', 'Give You Glory', 'Glass Antiqua', 'Glegoo', 'Gloria Hallelujah', 'Goblin One', 'Gochi Hand', 'Gorditas', 'Goudy Bookletter 1911', 'Graduate', 'Grand Hotel', 'Gravitas One', 'Great Vibes', 'Griffy', 'Gruppo', 'Gudea', 'Gurajada', 'Habibi', 'Halant', 'Hammersmith One', 'Hanalei', 'Hanalei Fill', 'Handlee', 'Hanuman', 'Happy Monkey', 'Harmattan', 'Headland One', 'Heebo', 'Henny Penny', 'Herr Von Muellerhoff', 'Hind', 'Hind Guntur', 'Hind Madurai', 'Hind Siliguri', 'Hind Vadodara', 'Holtwood One SC', 'Homemade Apple', 'Homenaje', 'IM Fell DW Pica', 'IM Fell DW Pica SC', 'IM Fell Double Pica', 'IM Fell Double Pica SC', 'IM Fell English', 'IM Fell English SC', 'IM Fell French Canon', 'IM Fell French Canon SC', 'IM Fell Great Primer', 'IM Fell Great Primer SC', 'Iceberg', 'Iceland', 'Imprima', 'Inconsolata', 'Inder', 'Indie Flower', 'Inika', 'Inknut Antiqua', 'Irish Grover', 'Istok Web', 'Italiana', 'Italianno', 'Itim', 'Jacques Francois', 'Jacques Francois Shadow', 'Jaldi', 'Jim Nightshade', 'Jockey One', 'Jolly Lodger', 'Jomhuria', 'Josefin Sans', 'Josefin Slab', 'Joti One', 'Judson', 'Julee', 'Julius Sans One', 'Junge', 'Jura', 'Just Another Hand', 'Just Me Again Down Here', 'Kadwa', 'Kalam', 'Kameron', 'Kanit', 'Kantumruy', 'Karla', 'Karma', 'Katibeh', 'Kaushan Script', 'Kavivanar', 'Kavoon', 'Kdam Thmor', 'Keania One', 'Kelly Slab', 'Kenia', 'Khand', 'Khmer', 'Khula', 'Kite One', 'Knewave', 'Kotta One', 'Koulen', 'Kranky', 'Kreon', 'Kristi', 'Krona One', 'Kumar One', 'Kumar One Outline', 'Kurale', 'La Belle Aurore', 'Laila', 'Lakki Reddy', 'Lalezar', 'Lancelot', 'Lateef', 'Lato', 'League Script', 'Leckerli One', 'Ledger', 'Lekton', 'Lemon', 'Lemonada', 'Libre Baskerville', 'Libre Franklin', 'Life Savers', 'Lilita One', 'Lily Script One', 'Limelight', 'Linden Hill', 'Lobster', 'Lobster Two', 'Londrina Outline', 'Londrina Shadow', 'Londrina Sketch', 'Londrina Solid', 'Lora', 'Love Ya Like A Sister', 'Loved by the King', 'Lovers Quarrel', 'Luckiest Guy', 'Lusitana', 'Lustria', 'Macondo', 'Macondo Swash Caps', 'Mada', 'Magra', 'Maiden Orange', 'Maitree', 'Mako', 'Mallanna', 'Mandali', 'Marcellus', 'Marcellus SC', 'Marck Script', 'Margarine', 'Marko One', 'Marmelad', 'Martel', 'Martel Sans', 'Marvel', 'Mate', 'Mate SC', 'Maven Pro', 'McLaren', 'Meddon', 'MedievalSharp', 'Medula One', 'Meera Inimai', 'Megrim', 'Meie Script', 'Merienda', 'Merienda One', 'Merriweather', 'Merriweather Sans', 'Metal', 'Metal Mania', 'Metamorphous', 'Metrophobic', 'Michroma', 'Milonga', 'Miltonian', 'Miltonian Tattoo', 'Miniver', 'Miriam Libre', 'Mirza', 'Miss Fajardose', 'Mitr', 'Modak', 'Modern Antiqua', 'Mogra', 'Molengo', 'Molle', 'Monda', 'Monofett', 'Monoton', 'Monsieur La Doulaise', 'Montaga', 'Montez', 'Montserrat', 'Montserrat Alternates', 'Montserrat Subrayada', 'Moul', 'Moulpali', 'Mountains of Christmas', 'Mouse Memoirs', 'Mr Bedfort', 'Mr Dafoe', 'Mr De Haviland', 'Mrs Saint Delafield', 'Mrs Sheppards', 'Mukta Vaani', 'Muli', 'Mystery Quest', 'NTR', 'Neucha', 'Neuton', 'New Rocker', 'News Cycle', 'Niconne', 'Nixie One', 'Nobile', 'Nokora', 'Norican', 'Nosifer', 'Nothing You Could Do', 'Noticia Text', 'Noto Sans', 'Noto Serif', 'Nova Cut', 'Nova Flat', 'Nova Mono', 'Nova Oval', 'Nova Round', 'Nova Script', 'Nova Slim', 'Nova Square', 'Numans', 'Nunito', 'Odor Mean Chey', 'Offside', 'Old Standard TT', 'Oldenburg', 'Oleo Script', 'Oleo Script Swash Caps', 'Open Sans', 'Open Sans Condensed', 'Oranienbaum', 'Orbitron', 'Oregano', 'Orienta', 'Original Surfer', 'Oswald', 'Over the Rainbow', 'Overlock', 'Overlock SC', 'Ovo', 'Oxygen', 'Oxygen Mono', 'PT Mono', 'PT Sans', 'PT Sans Caption', 'PT Sans Narrow', 'PT Serif', 'PT Serif Caption', 'Pacifico', 'Palanquin', 'Palanquin Dark', 'Paprika', 'Parisienne', 'Passero One', 'Passion One', 'Pathway Gothic One', 'Patrick Hand', 'Patrick Hand SC', 'Pattaya', 'Patua One', 'Pavanam', 'Paytone One', 'Peddana', 'Peralta', 'Permanent Marker', 'Petit Formal Script', 'Petrona', 'Philosopher', 'Piedra', 'Pinyon Script', 'Pirata One', 'Plaster', 'Play', 'Playball', 'Playfair Display', 'Playfair Display SC', 'Podkova', 'Poiret One', 'Poller One', 'Poly', 'Pompiere', 'Pontano Sans', 'Poppins', 'Port Lligat Sans', 'Port Lligat Slab', 'Pragati Narrow', 'Prata', 'Preahvihear', 'Press Start 2P', 'Pridi', 'Princess Sofia', 'Prociono', 'Prompt', 'Prosto One', 'Proza Libre', 'Puritan', 'Purple Purse', 'Quando', 'Quantico', 'Quattrocento', 'Quattrocento Sans', 'Questrial', 'Quicksand', 'Quintessential', 'Qwigley', 'Racing Sans One', 'Radley', 'Rajdhani', 'Rakkas', 'Raleway', 'Raleway Dots', 'Ramabhadra', 'Ramaraja', 'Rambla', 'Rammetto One', 'Ranchers', 'Rancho', 'Ranga', 'Rasa', 'Rationale', 'Ravi Prakash', 'Redressed', 'Reem Kufi', 'Reenie Beanie', 'Revalia', 'Rhodium Libre', 'Ribeye', 'Ribeye Marrow', 'Righteous', 'Risque', 'Roboto', 'Roboto Condensed', 'Roboto Mono', 'Roboto Slab', 'Rochester', 'Rock Salt', 'Rokkitt', 'Romanesco', 'Ropa Sans', 'Rosario', 'Rosarivo', 'Rouge Script', 'Rozha One', 'Rubik', 'Rubik Mono One', 'Rubik One', 'Ruda', 'Rufina', 'Ruge Boogie', 'Ruluko', 'Rum Raisin', 'Ruslan Display', 'Russo One', 'Ruthie', 'Rye', 'Sacramento', 'Sahitya', 'Sail', 'Salsa', 'Sanchez', 'Sancreek', 'Sansita One', 'Sarala', 'Sarina', 'Sarpanch', 'Satisfy', 'Scada', 'Scheherazade', 'Schoolbell', 'Scope One', 'Seaweed Script', 'Secular One', 'Sevillana', 'Seymour One', 'Shadows Into Light', 'Shadows Into Light Two', 'Shanti', 'Share', 'Share Tech', 'Share Tech Mono', 'Shojumaru', 'Short Stack', 'Shrikhand', 'Siemreap', 'Sigmar One', 'Signika', 'Signika Negative', 'Simonetta', 'Sintony', 'Sirin Stencil', 'Six Caps', 'Skranji', 'Slabo 13px', 'Slabo 27px', 'Slackey', 'Smokum', 'Smythe', 'Sniglet', 'Snippet', 'Snowburst One', 'Sofadi One', 'Sofia', 'Sonsie One', 'Sorts Mill Goudy', 'Source Code Pro', 'Source Sans Pro', 'Source Serif Pro', 'Space Mono', 'Special Elite', 'Spicy Rice', 'Spinnaker', 'Spirax', 'Squada One', 'Sree Krushnadevaraya', 'Sriracha', 'Stalemate', 'Stalinist One', 'Stardos Stencil', 'Stint Ultra Condensed', 'Stint Ultra Expanded', 'Stoke', 'Strait', 'Sue Ellen Francisco', 'Suez One', 'Sumana', 'Sunshiney', 'Supermercado One', 'Sura', 'Suranna', 'Suravaram', 'Suwannaphum', 'Swanky and Moo Moo', 'Syncopate', 'Tangerine', 'Taprom', 'Tauri', 'Taviraj', 'Teko', 'Telex', 'Tenali Ramakrishna', 'Tenor Sans', 'Text Me One', 'The Girl Next Door', 'Tienne', 'Tillana', 'Timmana', 'Tinos', 'Titan One', 'Titillium Web', 'Trade Winds', 'Trirong', 'Trocchi', 'Trochut', 'Trykker', 'Tulpen One', 'Ubuntu', 'Ubuntu Condensed', 'Ubuntu Mono', 'Ultra', 'Uncial Antiqua', 'Underdog', 'Unica One', 'UnifrakturCook', 'UnifrakturMaguntia', 'Unkempt', 'Unlock', 'Unna', 'VT323', 'Vampiro One', 'Varela', 'Varela Round', 'Vast Shadow', 'Vesper Libre', 'Vibur', 'Vidaloka', 'Viga', 'Voces', 'Volkhov', 'Vollkorn', 'Voltaire', 'Waiting for the Sunrise', 'Wallpoet', 'Walter Turncoat', 'Warnes', 'Wellfleet', 'Wendy One', 'Wire One', 'Work Sans', 'Yanone Kaffeesatz', 'Yantramanav', 'Yatra One', 'Yellowtail', 'Yeseva One', 'Yesteryear', 'Yrsa', 'Zeyada' ) );
	}

}
controls/custom-controls/font-selector/script.js000066600000003722151123453750016226 0ustar00/**
 * Customizer font selector control.
 *
 * @package Hestia
 */
(function ( $ ) {
	'use strict';
	wp.hestiaSelect = {
		init: function () {
			var self = this;

			$( '.hestia-fs-main-input, .hestia-fs-input-addon' ).on(
				'click', function ( e ) {
					$( this ).parent().toggleClass( 'active' );
					$( '.hestia-ss-wrap.active .hestia-fs-search input' ).focus();
					e.stopPropagation();
					return false;
				}
			);

			$( '.hestia-fs-option' ).on(
				'click', function () {
					var value = $( this ).data( 'option' );
					var mainInput = $( '.hestia-ss-wrap.active input.hestia-fs-main-input' );
					var collector = $( '.hestia-ss-wrap.active .hestia-ss-collector' );
					$( '.hestia-ss-wrap.active' ).removeClass( 'active' );
					mainInput.val( value );
					if ( value === 'Default' ) {
						value = '';
					}
					collector.val( value );
					collector.trigger( 'change' );
					return false;
				}
			);

			$( '.hestia-fs-search input' ).on(
				'keyup', function () {
					self.search( $( this ) );
					return false;
				}
			);

			$( document ).mouseup(
				function ( e ) {
					var container = $( '.hestia-ss-wrap.active .hestia-fs-dropdown' );
					if ( !container.is( e.target ) && container.has( e.target ).length === 0 ) {
						$( '.hestia-ss-wrap.active' ).removeClass( 'active' );
					}
				}
			);
		},

		search: function ( $searchInput ) {
			var itemsList = jQuery( '.hestia-ss-wrap.active .hestia-fs-options-wrapper' );
			var searchTerm = $searchInput.val().toLowerCase();
			if ( searchTerm.length > 0 ) {
				itemsList.children().children( '.hestia-fs-option' ).each(
					function () {
						if ( $( this ).filter( '[data-filter*='.concat( searchTerm ).concat( ']' ) ).length > 0 || searchTerm.length < 1 ) {
							$( this ).show();
						} else {
							$( this ).hide();
						}
					}
				);
			} else {
				itemsList.children().children().show();
			}
		}
	};

	$( document ).ready(
		function () {
			wp.hestiaSelect.init();
		}
	);
})( jQuery );
controls/ui/class-hestia-section-docs.php000066600000003174151123453750014524 0ustar00<?php
/**
 * Documentation link in main customizer.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Section_Docs
 *
 * @since  1.0.0
 * @access public
 */
class Hestia_Section_Docs extends WP_Customize_Section {

	/**
	 * The type of customize section being rendered.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $type = 'hestia-section-docs';

	/**
	 * Upsell title to output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $theme_info_title = '';

	/**
	 * Label text to output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $label_text = '';

	/**
	 * Label URL.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $label_url = '';

	/**
	 * Add custom parameters to pass to the JS via JSON.
	 *
	 * @since  1.0.0
	 * @access public
	 */
	public function json() {
		$json = parent::json();

		$json['theme_info_title'] = $this->theme_info_title;
		$json['label_text']       = $this->label_text;
		$json['label_url']        = esc_url( $this->label_url );

		return $json;
	}

	/**
	 * Outputs the Underscore.js template.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	protected function render_template() {
		?>

		<li id="accordion-section-{{ data.id }}"
			class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
			<h3 class="accordion-section-title">
				{{data.theme_info_title}}
				<# if ( data.label_text && data.label_url ) { #>
				<a class="button button-secondary alignright" href="{{data.label_url}}" target="_blank">
					{{data.label_text}}
				</a>
				<# } #>
			</h3>
		</li>
		<?php
	}
}
controls/ui/class-hestia-contact-info.php000066600000002775151123453750014524 0ustar00<?php
/**
 * A custom text control for Contact info.
 *
 * @package Hestia
 * @since Hestia 1.1.10
 */

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return null;
}

/**
 * A custom text control for Contact info.
 *
 * @since Hestia 1.0
 */
class Hestia_Contact_Info extends WP_Customize_Control {

	/**
	 * Enqueue function.
	 */
	public function enqueue() {
		Hestia_Plugin_Install_Helper::instance()->enqueue_scripts();
	}

	/**
	 * Render content for the control.
	 *
	 * @since Hestia 1.0
	 */
	public function render_content() {
		if ( defined( 'PIRATE_FORMS_VERSION' ) ) {
			printf(
				/* translators: %s is Path in plugin wrapped */
				esc_html__( 'You should be able to see the form on your front-page. You can configure settings from %s, in your WordPress dashboard.', 'hestia' ),
				/* translators: %s is Path in plugin*/
				sprintf( '<a href="%s" target="_blank">%s</a>', admin_url( 'admin.php?page=pirateforms-admin' ), esc_html__( 'Settings > Pirate Forms', 'hestia' ) )
			);
		} else {
			printf(
				/* translators: %1$s is Plugin name */
				esc_html__( 'In order to add a contact form to this section, you need to install the %s plugin.', 'hestia' ),
				esc_html( 'Pirate Forms' )
			);
			echo $this->create_plugin_install_button( 'pirate-forms' );
		}
	}

	/**
	 * Create plugin install button.
	 *
	 * @param string $slug plugin slug.
	 *
	 * @return bool
	 */
	public function create_plugin_install_button( $slug ) {
		return Hestia_Plugin_Install_Helper::instance()->get_button_html( $slug );
	}
}
controls/ui/customizer-scroll/class-hestia-customizer-scroll-ui.php000066600000003006151123453750021737 0ustar00<?php
/**
 * This class allows developers to implement scrolling to sections.
 *
 * @package    Hestia
 * @since      1.1.49
 * @author     Andrei Baicus <andrei@themeisle.com>
 * @copyright  Copyright (c) 2017, Themeisle
 * @link       http://themeisle.com/
 * @license    http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return;
}

/**
 * Scroll to section.
 *
 * @since  1.1.45
 * @access public
 */
class Hestia_Customizer_Scroll_Ui extends Hestia_Abstract_Main {

	/**
	 * Hestia_Customize_Control_Scroll constructor.
	 */
	public function init() {
		add_action( 'customize_controls_init', array( $this, 'enqueue' ) );
		add_action( 'customize_preview_init', array( $this, 'helper_script_enqueue' ) );
	}

	/**
	 * The priority of the control.
	 *
	 * @since 1.1.45
	 * @var   string
	 */
	public $priority = 0;

	/**
	 * Loads the customizer script.
	 *
	 * @since  1.1.45
	 * @access public
	 * @return void
	 */
	public function enqueue() {
		wp_enqueue_script( 'hestia-scroller-script', get_template_directory_uri() . '/inc/customizer/controls/ui/customizer-scroll/script.js', array( 'jquery' ), HESTIA_VERSION, true );
	}

	/**
	 * Enqueue the partials handler script that works synchronously with the hestia-scroller-script
	 */
	public function helper_script_enqueue() {
		wp_enqueue_script( 'hestia-scroller-addon-script', get_template_directory_uri() . '/inc/customizer/controls/ui/customizer-scroll/helper-script.js', array( 'jquery' ), HESTIA_VERSION, true );
	}
}
controls/ui/customizer-scroll/script.js000066600000001266151123453750014405 0ustar00/**
 * Script for the customizer auto scrolling.
 *
 * Sends the section name to the preview.
 *
 * @since    1.1.50
 * @package Hestia
 *
 * @author    ThemeIsle
 */

/* global wp */

var hestia_customize_scroller = function ( $ ) {
	'use strict';

	$(
		function () {
				var customize = wp.customize;

				$( 'ul[id*="hestia_frontpage_sections"] .accordion-section' ).not( '.panel-meta' ).each(
					function () {
						$( this ).on(
							'click', function() {
								var section = $( this ).attr( 'aria-owns' ).split( '_' ).pop();
								customize.previewer.send( 'clicked-customizer-section', section );
							}
						);
					}
				);
		}
	);
};

hestia_customize_scroller( jQuery );
controls/ui/customizer-scroll/helper-script.js000066600000002245151123453750015660 0ustar00/**
 * Script fort the customizer sections scroll function.
 *
 * @since    1.1.43
 * @package Hestia
 *
 * @author    ThemeIsle
 */

/* global wp */

var hestia_customizer_section_scroll = function ( $ ) {
	'use strict';
	$(
		function () {
				var customize = wp.customize;

				customize.preview.bind(
					'clicked-customizer-section', function( data ) {
						var sectionId = '';
						switch (data) {
							case 'shop':
								sectionId = 'section#products';
							break;
							case 'ribbon':
								sectionId = 'section.hestia-ribbon';
							break;
							case 'sub-accordion-section-sidebar-widgets-subscribe-widgets':
								sectionId = 'section#subscribe';
							break;
							case 'bar':
								sectionId = 'section.hestia-clients-bar';
							break;
							case 'slider':
								sectionId = '#carousel-hestia-generic.carousel.slide';
							break;
							default:
								sectionId = 'section#' + data;
							break;
						}
						if ( $( sectionId ).length > 0) {
							$( 'html, body' ).animate(
								{
									scrollTop: $( sectionId ).offset().top - 100
								}, 1000
							);
						}
					}
				);
		}
	);
};

hestia_customizer_section_scroll( jQuery );
controls/ui/class-hestia-section-upsell.php000066600000005471151123453750015102 0ustar00<?php
/**
 * The upsell for the front page sections
 *
 * Pro customizer section.
 *
 * @package Hestia
 */

/**
 * Class Themeisle_Section_Upsell
 */
class Hestia_Section_Upsell extends WP_Customize_Section {

	/**
	 * The type of customize section being rendered.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $type = 'hestia-section-upsell';

	/**
	 * Upsell text to output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $upsell_text = '';

	/**
	 * Button text to output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $button_text = '';

	/**
	 * Button link to output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $button_url = '';

	/**
	 * List of theme options to output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    array
	 */
	public $options = array();

	/**
	 * List of additional explanations to output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    array
	 */
	public $explained_features = array();


	/**
	 * Label text to output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	private $pro_label;

	/**
	 * Hestia_Customizer_Theme_Info_Section constructor.
	 */
	public function __construct( WP_Customize_Manager $manager, $id, array $args ) {
		parent::__construct( $manager, $id, $args );
		$this->pro_label       = esc_html__( 'PRO', 'hestia' );
		$this->active_callback = true;
	}

	/**
	 * Add custom parameters to pass to the JS via JSON.
	 *
	 * @since  1.0.0
	 * @access public
	 */
	public function json() {
		$json                       = parent::json();
		$json['button_text']        = esc_html( $this->button_text );
		$json['button_url']         = esc_url( $this->button_url );
		$json['options']            = $this->options;
		$json['explained_features'] = $this->explained_features;
		$json['pro_label']          = esc_html( $this->pro_label );

		return $json;
	}

	/**
	 * Outputs the Underscore.js template.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	protected function render_template() {
		?>
		<div class="themeisle-upsell themeisle-boxed-section">
			<# if ( data.options.length > 0 ) { #>
			<ul class="themeisle-upsell-features">
				<# for (option in data.options) { #>
				<li><span class="upsell-pro-label">{{ data.pro_label }}</span>{{ data.options[option] }}
				</li>
				<# } #>
			</ul>
			<# } #>

			<# if ( data.button_text && data.button_url ) { #>
			<a target="_blank" href="{{ data.button_url }}" class="button button-primary" target="_blank">{{
				data.button_text }}</a>
			<# } #>

			<# if ( data.explained_features.length > 0 ) { #>
			<hr>
			<ul class="themeisle-upsell-feature-list">
				<# for (feature in data.explained_features) { #>
				<li>* {{ data.explained_features[feature] }}</li>
				<# } #>
			</ul>
			<# } #>
		</div>
		<?php
	}
}
controls/ui/helper-plugin-install/class-hestia-plugin-install-helper.php000066600000012010151123453750022555 0ustar00<?php
/**
 * Plugin install helper.
 *
 * @package Hestia
 * @since Hestia 1.1.31
 */

/**
 * Class Hestia_Plugin_Install_Helper
 */
class Hestia_Plugin_Install_Helper {
	/**
	 * Instance of class.
	 *
	 * @var bool $instance instance variable.
	 */
	private static $instance;


	/**
	 * Check if instance already exists.
	 *
	 * @return Hestia_Plugin_Install_Helper
	 */
	public static function instance() {
		if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Hestia_Plugin_Install_Helper ) ) {
			self::$instance = new Hestia_Plugin_Install_Helper;
		}

		return self::$instance;
	}

	/**
	 * Get plugin path based on plugin slug.
	 *
	 * @param string $slug Plugin slug.
	 *
	 * @return string
	 */
	public static function get_plugin_path( $slug ) {

		switch ( $slug ) {
			case 'mailin':
				return $slug . '/sendinblue.php';
				break;
			case 'intergeo-maps':
			case 'visualizer':
			case 'translatepress-multilingual':
				return $slug . '/index.php';
				break;
			case 'beaver-builder-lite-version':
				return $slug . '/fl-builder.php';
				break;
			case 'adblock-notify-by-bweb':
				return $slug . '/adblock-notify.php';
				break;
			default:
				return $slug . '/' . $slug . '.php';
		}
	}

	/**
	 * Generate action button html.
	 *
	 * @param string $slug plugin slug.
	 *
	 * @return string
	 */
	public function get_button_html( $slug, $settings = array() ) {
		$button   = '';
		$redirect = '';
		if ( ! empty( $settings ) && array_key_exists( 'redirect', $settings ) ) {
			$redirect = $settings['redirect'];
		}
		$state = $this->check_plugin_state( $slug );
		if ( empty( $slug ) ) {
			return '';
		}

		$additional = '';

		if ( $state === 'deactivate' ) {
			$additional = ' action_button active';
		}

		$button .= '<div class=" plugin-card-' . esc_attr( $slug ) . esc_attr( $additional ) . '" style="padding: 8px 0 5px;">';

		$plugin_link_suffix = self::get_plugin_path( $slug );

		$nonce = add_query_arg(
			array(
				'action'        => 'activate',
				'plugin'        => rawurlencode( $plugin_link_suffix ),
				'plugin_status' => 'all',
				'paged'         => '1',
				'_wpnonce'      => wp_create_nonce( 'activate-plugin_' . $plugin_link_suffix ),
			), network_admin_url( 'plugins.php' )
		);
		switch ( $state ) {
			case 'install':
				$button .= '<a data-redirect="' . esc_url( $redirect ) . '" data-slug="' . esc_attr( $slug ) . '" class="install-now hestia-install-plugin button  " href="' . esc_url( $nonce ) . '" data-name="' . esc_attr( $slug ) . '" aria-label="Install ' . esc_attr( $slug ) . '">' . __( 'Install and activate', 'hestia' ) . '</a>';
				break;

			case 'activate':
				$button .= '<a  data-redirect="' . esc_url( $redirect ) . '" data-slug="' . esc_attr( $slug ) . '" class="activate-now button button-primary" href="' . esc_url( $nonce ) . '" aria-label="Activate ' . esc_attr( $slug ) . '">' . esc_html__( 'Activate', 'hestia' ) . '</a>';
				break;

			case 'deactivate':
				$nonce = add_query_arg(
					array(
						'action'        => 'deactivate',
						'plugin'        => rawurlencode( $plugin_link_suffix ),
						'plugin_status' => 'all',
						'paged'         => '1',
						'_wpnonce'      => wp_create_nonce( 'deactivate-plugin_' . $plugin_link_suffix ),
					), network_admin_url( 'plugins.php' )
				);

				$button .= '<a  data-redirect="' . esc_url( $redirect ) . '" data-slug="' . esc_attr( $slug ) . '" class="deactivate-now button" href="' . esc_url( $nonce ) . '" data-name="' . esc_attr( $slug ) . '" aria-label="Deactivate ' . esc_attr( $slug ) . '">' . esc_html__( 'Deactivate', 'hestia' ) . '</a>';
				break;

			case 'enable_cpt':
				$url     = admin_url( 'admin.php?page=jetpack#/settings' );
				$button .= '<a  data-redirect="' . esc_url( $redirect ) . '" class="button" href="' . esc_url( $url ) . '">' . esc_html__( 'Activate', 'hestia' ) . ' ' . esc_html__( 'Jetpack Portfolio', 'hestia' ) . '</a>';
				break;
		}// End switch().
		$button .= '</div>';

		return $button;
	}

	/**
	 * Check plugin state.
	 *
	 * @param string $slug plugin slug.
	 *
	 * @return bool
	 */
	private function check_plugin_state( $slug ) {

		$plugin_link_suffix = self::get_plugin_path( $slug );

		if ( file_exists( ABSPATH . 'wp-content/plugins/' . $plugin_link_suffix ) ) {
			$needs = is_plugin_active( $plugin_link_suffix ) ? 'deactivate' : 'activate';
			if ( $needs === 'deactivate' && ! post_type_exists( 'portfolio' ) && $slug === 'jetpack' ) {
				return 'enable_cpt';
			}

			return $needs;
		} else {
			return 'install';
		}
	}

	/**
	 * Enqueue Function.
	 */
	public function enqueue_scripts() {
		wp_enqueue_script( 'plugin-install' );
		wp_enqueue_script( 'updates' );
		wp_enqueue_script( 'hestia-plugin-install-helper', get_template_directory_uri() . '/inc/customizer/controls/ui/helper-plugin-install/script.js', array( 'jquery' ), HESTIA_VERSION, true );
		wp_localize_script(
			'hestia-plugin-install-helper', 'hestia_plugin_helper',
			array(
				'activating' => esc_html__( 'Activating ', 'hestia' ),
			)
		);
		wp_localize_script(
			'hestia-plugin-install-helper', 'pagenow',
			array( 'import' )
		);
	}
}
controls/ui/helper-plugin-install/script.js000066600000007302151123453750015121 0ustar00/**
 * Remove activate button and replace with activation in progress button.
 *
 * @package Hestia
 */

/* global hestia_plugin_helper */
/* global console */

jQuery( document ).ready(
    function ( $ ) {
        $.pluginInstall = {
            'init': function () {
                this.handleInstall();
                this.handleActivate();
			},

            'handleInstall': function () {
                var self = this;
                $( 'body' ).on( 'click', '.hestia-install-plugin', function (e) {
                    e.preventDefault();
                    var button = $( this );
                    var slug = button.attr( 'data-slug' );
                    var url = button.attr( 'href' );
                    var redirect = $( button ).attr( 'data-redirect' );
                    button.text( wp.updates.l10n.installing );
                    button.addClass('updating-message');
                    wp.updates.installPlugin(
                        {
                            slug: slug,
                            success: function(){
                                button.text(hestia_plugin_helper.activating + '...');
                                self.activatePlugin(url, redirect);
							}
						}
					);
                });
            },

            'activatePlugin': function (url, redirect) {
                if (typeof url === 'undefined' || !url) {
                    return;
                }
                jQuery.ajax(
                    {
                        async: true,
                        type: 'GET',
                        url: url,
                        success: function () {
                            // Reload the page.
                            if (typeof(redirect) !== 'undefined' && redirect !== '') {
                                window.location.replace(redirect);
                            } else {
                                location.reload();
                            }
                        },
                        error: function (jqXHR, exception) {
                            var msg = '';
                            if (jqXHR.status === 0) {
                                msg = 'Not connect.\n Verify Network.';
                            } else if (jqXHR.status === 404) {
                                msg = 'Requested page not found. [404]';
                            } else if (jqXHR.status === 500) {
                                msg = 'Internal Server Error [500].';
                            } else if (exception === 'parsererror') {
                                msg = 'Requested JSON parse failed.';
                            } else if (exception === 'timeout') {
                                msg = 'Time out error.';
                            } else if (exception === 'abort') {
                                msg = 'Ajax request aborted.';
                            } else {
                                msg = 'Uncaught Error.\n' + jqXHR.responseText;
                            }
                            console.log(msg);
                        },
                    }
                );
            },

            'handleActivate': function () {
                var self = this;
                $( 'body' ).on( 'click', '.activate-now', function (e) {
                    e.preventDefault();
                    var button = $( this );
                    var url = button.attr( 'href' );
                    var redirect = button.attr( 'data-redirect' );
                    button.addClass('updating-message');
                    button.text(hestia_plugin_helper.activating + '...');
                    self.activatePlugin(url,redirect);
                });
            },
        };
        $.pluginInstall.init();
	}
);controls/ui/class-hestia-main-notice-section.php000066600000007301151123453750015773 0ustar00<?php
/**
 * ThemeIsle Customizer Notification Section Class.
 *
 * @package Hestia
 */

/**
 * Themeisle_Customizer_Notify_Section class
 */
class Hestia_Main_Notice_Section extends Hestia_Generic_Notice_Section {
	/**
	 * The type of customize section being rendered.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $type = 'main-customizer-notice';

	/**
	 * The plugin information requested from plugins api.
	 *
	 * @var array
	 */
	private $plugin_info;

	/**
	 * Slug of recommended plugin.
	 *
	 * @var string
	 */
	public $slug;

	/**
	 * Control options.
	 *
	 * Ex: redirect link after install
	 *
	 * @var array
	 */
	public $options = array();

	/**
	 * Hestia_Main_Notice_Section constructor.
	 *
	 * @param WP_Customize_Manager $manager The customizer object.
	 * @param string               $id The control id.
	 * @param array                $args The control args.
	 */
	public function __construct( $manager, $id, $args = array() ) {
		parent::__construct( $manager, $id, $args );
		if ( empty( $this->slug ) ) {
			return;
		}
		$this->plugin_info = $this->call_plugin_api( $this->slug );
	}

	/**
	 * Call plugin API to get plugins info
	 *
	 * @param plugin-slug $slug The plugin slug.
	 *
	 * @return mixed
	 */
	private function call_plugin_api( $slug ) {
		if ( empty( $slug ) ) {
			return;
		}
		include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
		$call_api = get_transient( 'ti_cust_notify_plugin_info_' . $slug );
		if ( false === $call_api ) {
			$call_api = plugins_api(
				'plugin_information', array(
					'slug'   => $slug,
					'fields' => array(
						'downloaded'        => false,
						'rating'            => false,
						'description'       => false,
						'short_description' => true,
						'donate_link'       => false,
						'tags'              => false,
						'sections'          => false,
						'homepage'          => false,
						'added'             => false,
						'last_updated'      => false,
						'compatibility'     => false,
						'tested'            => false,
						'requires'          => false,
						'downloadlink'      => false,
						'icons'             => false,
					),
				)
			);
			set_transient( 'ti_cust_notify_plugin_info_' . $slug, $call_api, 30 * MINUTE_IN_SECONDS );
		}

		return $call_api;
	}

	/**
	 * Add custom parameters to pass to the JS via JSON.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return array
	 */
	public function json() {
		$json                          = parent::json();
		$json['name']                  = $this->plugin_info->name;
		$json['description']           = $this->description;
		$json['plugin_install_button'] = $this->create_plugin_install_button( $this->slug, $this->options );
		$json['hide_notice']           = $this->hide_notice;

		return $json;

	}

	/**
	 * Outputs the structure for the customizer control
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	protected function render_template() {
		?>
		<# if ( ! data.hide_notice ) { #>
		<li id="accordion-section-{{ data.id }}"
				class="hestia-notice control-section-{{ data.type }} cannot-expand" style="margin-bottom: 1px;">
			<# if ( data.title ) { #>
			<h3 class="accordion-section-title">
				{{{ data.title }}}
			</h3>
			<# } #>
			<div class="notice notice-info" style="position: relative; margin-top:0; margin-bottom: 1px;">
				<button type="button" class="notice-dismiss" style="z-index: 1;"></button>
				<# if ( data.name ) { #>
				<h3 style="padding-right: 36px">
					{{{data.name}}}
				</h3>

				<# } #>
				<# if( data.description ) { #>
				<p>
					{{{ data.description }}}
				</p>
				<# } #>
				<# if ( data.plugin_install_button ) { #>
				{{{data.plugin_install_button}}}
				<# } #>
			</div>
		</li>
		<# } #>
		<?php
	}
}
controls/ui/class-hestia-control-upsell.php000066600000004672151123453750015120 0ustar00<?php
/**
 *  Hestia Upsell Theme Info Class
 *
 * @package Hestia
 */

/**
 * Hestia_Control_Upsell_Theme_Info class.
 */
class Hestia_Control_Upsell extends WP_Customize_Control {

	/**
	 * Control type
	 *
	 * @var string control type
	 */
	public $type = 'hestia-control-upsell';

	/**
	 * Button text
	 *
	 * @var string button text
	 */
	public $button_text = '';

	/**
	 * Button link
	 *
	 * @var string button url
	 */
	public $button_url = '';

	/**
	 * List of features
	 *
	 * @var array theme features / options
	 */
	public $options = array();

	/**
	 * List of explanations
	 *
	 * @var array additional info
	 */
	public $explained_features = array();

	/**
	 * Label text for each feature
	 *
	 * @var string|void label text
	 */
	public $pro_label = '';

	/**
	 * Hestia_Control_Upsell_Theme_Info constructor.
	 *
	 * @param WP_Customize_Manager $manager the customize manager class.
	 * @param string               $id id.
	 * @param array                $args customizer manager parameters.
	 */
	public function __construct( WP_Customize_Manager $manager, $id, array $args ) {
		parent::__construct( $manager, $id, $args );
		$this->button_text;
		$this->pro_label = esc_html__( 'PRO', 'hestia' );
	}

	/**
	 * Json conversion
	 */
	public function to_json() {
		parent::to_json();
		$this->json['button_text']        = $this->button_text;
		$this->json['button_url']         = $this->button_url;
		$this->json['options']            = $this->options;
		$this->json['explained_features'] = $this->explained_features;
		$this->json['pro_label']          = $this->pro_label;
	}

	/**
	 * Render upsell content.
	 */
	public function render_content() {

	}

	/**
	 * Control content
	 */
	public function content_template() {
		?>
		<div class="themeisle-upsell">
			<# if ( data.options ) { #>
			<ul class="themeisle-upsell-features">
				<# for (option in data.options) { #>
				<li><span class="upsell-pro-label">{{ data.pro_label }}</span>{{ data.options[option] }}
				</li>
				<# } #>
			</ul>
			<# } #>

			<# if ( data.button_text && data.button_url ) { #>
			<a target="_blank" href="{{ data.button_url }}" class="button button-primary" target="_blank">{{
				data.button_text }}</a>
			<# } #>
			<hr>

			<# if ( data.explained_features ) { #>
			<ul class="themeisle-upsell-feature-list">
				<# for (requirement in data.explained_features) { #>
				<li>* {{ data.explained_features[requirement] }}</li>
				<# } #>
			</ul>
			<# } #>
		</div>
		<?php
	}
}
controls/ui/class-hestia-button.php000066600000002677151123453750013454 0ustar00<?php
/**
 * Customizer functionality for the Blog settings panel.
 *
 * @package Hestia
 * @since Hestia 1.1.10
 */

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return null;
}

/**
 * A customizer control to display text in customizer.
 *
 * @since Hestia 1.1.42
 */
class Hestia_Button extends WP_Customize_Control {


	/**
	 * Control id
	 *
	 * @var string $id Control id.
	 */
	public $id = '';

	/**
	 * Button class.
	 *
	 * @var mixed|string
	 */
	public $button_class = '';

	/**
	 * Icon class.
	 *
	 * @var mixed|string
	 */
	public $icon_class = '';

	/**
	 * Button text.
	 *
	 * @var mixed|string
	 */
	public $button_text = '';

	/**
	 * Hestia_Button constructor.
	 *
	 * @param WP_Customize_Manager $manager Customizer manager.
	 * @param string               $id Control id.
	 * @param array                $args Argument.
	 */
	public function __construct( $manager, $id, $args = array() ) {
		parent::__construct( $manager, $id, $args );
		$this->id = $id;
	}

	/**
	 * Render content for the control.
	 *
	 * @since Hestia 1.1.42
	 */
	public function render_content() {
		if ( ! empty( $this->button_text ) ) {
			echo '<button type="button" class="button menu-shortcut ' . esc_attr( $this->button_class ) . '" tabindex="0">';
			if ( ! empty( $this->button_class ) ) {
				echo '<i class="fa ' . esc_attr( $this->icon_class ) . '" style="margin-right: 10px"></i>';
			}
				echo esc_html( $this->button_text );
			echo '</button>';
		}
	}
}
controls/ui/class-hestia-customizer-heading.php000066600000001504151123453750015726 0ustar00<?php
/**
 * Customizer Control: Hestia_Customizer_Heading.
 *
 * @since 1.1.56
 * @package hestia
 */

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

/**
 * Heading control
 */
class Hestia_Customizer_Heading extends WP_Customize_Control {

	/**
	 * The control type.
	 *
	 * @access public
	 * @var string
	 */
	public $type = 'hestia-heading';

	/**
	 * An Underscore (JS) template for this control's content (but not its container).
	 *
	 * Class variables for this control class are available in the `data` JS object;
	 * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
	 *
	 * @see WP_Customize_Control::print_template()
	 *
	 * @access protected
	 */
	protected function content_template() {
		?>
		<h4 class="hestia-customizer-heading">{{{ data.label }}}</h4>
		<?php
	}
}
controls/ui/class-hestia-pagebuilder-button.php000066600000012665151123453750015733 0ustar00<?php
/**
 * This class allows developers to display a button in customizer that links to Elementor live edit if the page
 * that is set as frontpage was previously edited with Elementor. This control replace the text editor control
 * if the page was edited with Elementor.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Elementor_Edit
 *
 * @since  1.1.60
 * @access public
 */
class Hestia_PageBuilder_Button extends WP_Customize_Control {

	/**
	 * The type of customize control being rendered.
	 *
	 * @since  1.1.60
	 * @access public
	 * @var    string
	 */
	public $type = 'page-builder-button';

	/**
	 * The post id of the page that is set as frontpage.
	 *
	 * @since  1.1.60
	 * @access public
	 * @var    string
	 */
	public $pid = '';

	/**
	 * Page Builder pugin
	 *
	 * @since  1.1.63
	 * @access public
	 * @var    string
	 */
	public $page_builder = array();

	/**
	 * Hestia_Elementor_Edit constructor.
	 *
	 * @param WP_Customize_Manager $manager Customize manager object.
	 * @param string               $id Control id.
	 * @param array                $args Control arguments.
	 */
	public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
		parent::__construct( $manager, $id, $args );

		$frontpage_id = get_option( 'page_on_front' );
		if ( ! empty( $frontpage_id ) ) {

			if ( ! empty( $frontpage_id ) ) {
				$this->pid = $frontpage_id;
			}

			$page_edited_with_elementor = false;
			$page_edited_with_beaver    = false;
			$page_edited_with_wpbakery  = false;
			$page_edited_with_so        = false;
			$page_edited_with_divi      = false;

			/**
			 * Elementor and Beaver builder mark if the page was edited with its editors in post meta so we'll have to
			 * check if plugins exists and the page was edited with page builder.
			 */
			$post_meta = ! empty( $frontpage_id ) ? get_post_meta( $frontpage_id ) : '';
			if ( ! empty( $post_meta ) ) {
				$page_edited_with_elementor = ! empty( $post_meta['_elementor_edit_mode'] ) && $post_meta['_elementor_edit_mode'][0] === 'builder' && class_exists( 'Elementor\Plugin' );
				$page_edited_with_beaver    = ! empty( $post_meta['_fl_builder_enabled'] ) && $post_meta['_fl_builder_enabled'][0] === '1' && class_exists( 'FLBuilder' );
				$page_edited_with_so        = ! empty( $post_meta['panels_data'] ) && class_exists( 'SiteOrigin_Panels' );
				$page_edited_with_divi      = ! empty( $post_meta['_et_pb_use_builder'] ) && $post_meta['_et_pb_use_builder'][0] === 'on' && class_exists( 'ET_Builder_Plugin' );
			}

			/**
			 * WP Bakery (former Visual Composer) doesn't store a flag in meta data to say whether or not the page
			 * is edited with it so we have to check post content if it contains shortcodes from plugin.
			 */
			$post_content = get_post_field( 'post_content', $frontpage_id );
			if ( ! empty( $post_content ) ) {
				$page_edited_with_wpbakery = class_exists( 'Vc_Manager' ) && strpos( $post_content, '[vc_' ) !== false;
			}

			$this->page_builder = array(
				'elementor'  => (bool) $page_edited_with_elementor,
				'beaver'     => (bool) $page_edited_with_beaver,
				'wpbakery'   => (bool) $page_edited_with_wpbakery,
				'siteorigin' => (bool) $page_edited_with_so,
				'divi'       => (bool) $page_edited_with_divi,
			);
		}
	}

	/**
	 * Enqueue scripts/styles.
	 *
	 * @since  1.1.60
	 * @access public
	 * @return void
	 */
	public function enqueue() {
	}

	/**
	 * Add custom parameters to pass to the JS via JSON.
	 *
	 * @since  1.1.60
	 * @access public
	 * @return array
	 */
	public function json() {
		$json = parent::json();
		foreach ( $this->page_builder as $builder_name => $builder_value ) {
			if ( $builder_value === true ) {
				switch ( $builder_name ) {
					case 'elementor':
						$json['edit_link']['elementor'] = \Elementor\Utils::get_edit_link( $this->pid );
						break;
					case 'beaver':
						$json['edit_link']['beaver'] = FLBuilderModel::get_edit_url( $this->pid );
						break;
					case 'wpbakery':
						$json['edit_link']['wpbakery'] = Vc_Frontend_Editor::getInlineUrl( '', $this->pid );
						break;
					case 'siteorigin':
						$json['edit_link']['siteorigin'] = add_query_arg( 'so_live_editor', 1, get_edit_post_link( $this->pid ) );
						break;
					case 'divi':
						$json['edit_link']['divi'] = add_query_arg( 'et_fb', 1, get_permalink( $this->pid ) );
						break;
				}
			}
		}
		return $json;
	}

	/**
	 * Don't render the content via PHP.  This control is handled with a JS template.
	 *
	 * @since  1.1.60
	 * @access public
	 * @return void
	 */
	protected function render_content() {}

	/**
	 * Underscore JS template to handle the control's output.
	 *
	 * @since  1.1.60
	 * @access public
	 * @return void
	 */
	public function content_template() {
		?>

		<label>
			<# if ( data.label ) { #>
				<span class="customize-control-title">{{ data.label }}</span>
				<# } #>

					<# if ( data.description ) { #>
						<span class="description customize-control-description">{{ data.description }}</span>
						<# } #>

							<# if( data.edit_link ){ #>
								<# _.each(data.edit_link, function(v, k) { #>
									<!-- wp-playlist-caption class is added to not add customize changeset to this link -->
									<a href="{{{v}}}" class="wp-playlist-caption"><div id="{{k}}-editor-button" class="button button-primary">
											<# if( k === 'elementor') {#>
												<i class="eicon-elementor" aria-hidden="true"></i>
												<# } #>
													Edit with {{k}}
										</div></a>
									<# }) #>
										<# } #>

		</label>
		<?php
	}
}
controls/ui/customizer-tabs/class-hestia-customize-control-tabs.php000066600000005435151123453750021716 0ustar00<?php
/**
 * The tabs customize control extends the WP_Customize_Control class. This class allows
 * developers to create tabs and hide the sections' settings easily.
 *
 * @package    Hestia
 * @since      1.1.45
 * @author     Andrei Baicus <andrei@themeisle.com>
 * @copyright  Copyright (c) 2017, Themeisle
 * @link       http://themeisle.com/
 * @license    http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */


/**
 * Radio image customize control.
 *
 * @since  1.1.45
 * @access public
 */
class Hestia_Customize_Control_Tabs extends WP_Customize_Control {

	/**
	 * The type of customize control being rendered.
	 *
	 * @since 1.1.45
	 * @var   string
	 */
	public $type = 'interface-tabs';

	/**
	 * The tabs with keys of the controls that are under each tab.
	 *
	 * @since 1.1.45
	 * @var array
	 */
	public $tabs;

	/**
	 * Controls from tabs.
	 *
	 * @var array
	 */
	public $controls;


	/**
	 * Hestia_Customize_Control_Tabs constructor.
	 *
	 * @param WP_Customize_Manager $manager wp_customize manager.
	 * @param string               $id      control id.
	 * @param array                $args    public parameters for control.
	 */
	public function __construct( $manager, $id, $args = array() ) {
		parent::__construct( $manager, $id, $args );
	}

	/**
	 * Enqueue styles and scripts.
	 */
	public function enqueue() {
		wp_enqueue_style( 'hestia-tabs-control-style', get_template_directory_uri() . '/inc/customizer/controls/ui/customizer-tabs/style.css', null, HESTIA_VERSION );
		wp_enqueue_script( 'hestia-tabs-control-script', get_template_directory_uri() . '/inc/customizer/controls/ui/customizer-tabs/script.js', array( 'jquery' ), HESTIA_VERSION, true );
	}

	/**
	 * Add custom JSON parameters to use in the JS template.
	 *
	 * @return array
	 */
	public function json() {
		$json             = parent::json();
		$json['tabs']     = $this->tabs;
		$json['controls'] = $this->controls;
		return $json;
	}

	/**
	 * Underscore JS template to handle the control's output.
	 *
	 * @return void
	 */
	public function content_template() {
		?>
		<# if ( ! data.tabs ) { return; } #>

		<div class="hestia-tabs-control" id="">
		<# var i = 1;
			for( tab in data.tabs) { #>
				<#
				var allControlsInTabs = ''
				_.each( data.controls[tab], function( val, key ) {
					allControlsInTabs+= key + ' '
					if(val){
						var allvals = Object.keys(val).map(function(e) {
							return val[e]
						});
						allvals = _.uniq(_.flatten(allvals))
						allvals = allvals.join(' ')
						allControlsInTabs += allvals
					}
				});
				#>
			<div class="hestia-customizer-tab <# if( i === 1 ){#> active <#}#>" data-tab="{{tab}}">
				<label class="{{allControlsInTabs}}">
					<i class="fa fa-{{data.tabs[tab]['icon']}}"></i>
					{{data.tabs[tab]['label']}}
				</label>
			</div>
		<# i++;} #>
		</div>


		<?php
	}
}

controls/ui/customizer-tabs/script.js000066600000014345151123453750014042 0ustar00/**
 * Script for the customizer tabs control interactions.
 *
 * @since    1.1.43
 * @package Hestia
 *
 * @author    ThemeIsle
 */

/* global wp */


wp.customize.controlConstructor['interface-tabs'] = wp.customize.Control.extend({
	ready: function() {

        // Switch tab based on customizer partial edit links.
        wp.customize.previewer.bind(
            'tab-previewer-edit', function( data ) {
                jQuery( data.selector ).trigger( 'click' );
            }
        );

        wp.customize.previewer.bind(
            'focus-control',  function( data ) {
                /**
                 * This timeout is here because in firefox this happens before customizer animation of changing panels.
                 * After it change panels with the input focused, the customizer was moved to right 12px. We have to make sure
                 * that the customizer animation of changing panels in customizer is done before focusing the input.
                 */
                setTimeout( function(){
                    var control = wp.customize.control(data);
                    if( typeof control !== 'undefined'){
                        wp.customize.control(data).focus();
                    }
                } , 100 );
            }
        );

        wp.customize.previewer.bind(
			'focus-section',  function( data ) {
					/**
					  * This timeout is here because in firefox this happens before customizer animation of changing panels.
					  * After it change panels with the input focused, the customizer was moved to right 12px. We have to make sure
					  * that the customizer animation of changing panels in customizer is done before focusing the input.
					  */
						setTimeout( function(){
								wp.customize.section(data).focus();
							} , 100 );
				}
		);

        wp.customize.previewer.bind( 'ready', function () {
			var parts = window.location.search.substr(1).split('&');
			var $_GET = {};
			for (var i = 0; i < parts.length; i++) {
				var temp = parts[i].split('=');
				$_GET[decodeURIComponent(temp[0])] = decodeURIComponent(temp[1]);
			}

			if( typeof $_GET['autofocus[control]'] !== 'undefined' && $_GET['autofocus[control]'] !== ''){
                jQuery( 'li[id^="customize-control-widget"] ,#customize-control-sidebars_widgets-sidebar-big-title, #customize-control-sidebars_widgets-sidebar-top-bar, #customize-control-sidebars_widgets-subscribe-widgets' ).live(
                    'DOMNodeInserted', function () {
                        jQuery('.hestia-customizer-tab > label.' + $_GET['autofocus[control]']).trigger('click');
                    });
			}
        } );

        this.init();
		this.handleClick();
    },

	init: function () {
		var control = this;
		var section = control.section();

        wp.customize.bind('ready',function () {
			control.hideAllControls(section);
			var tab = Object.keys(control.params.controls)[0];
			var controlsToShow = control.params.controls[tab];
			var allControls = [];
			for (var controlName in controlsToShow ){
				if( controlsToShow.hasOwnProperty(controlName)) {
                    if (jQuery.isEmptyObject(controlsToShow[controlName]) === false &&
                        typeof wp.customize.control(controlName) !== 'undefined') {
                        var subTabValue = wp.customize.control(controlName).setting._value;
                        allControls = allControls.concat(controlsToShow[controlName][subTabValue]);
                    }
                    allControls.push(controlName);
                }
			}
            control.showControls(allControls, section);
			var once = 0;
			jQuery( 'li[id^="customize-control-widget"] ,#customize-control-sidebars_widgets-sidebar-big-title, #customize-control-sidebars_widgets-sidebar-top-bar, #customize-control-sidebars_widgets-subscribe-widgets' ).live(
				'DOMNodeInserted', function (e) {
					if ( once > 0 ){
						return false;
					}
					if( typeof e.currentTarget.previousSibling === 'undefined' ) {
						return false;
					}

					if( jQuery(e.currentTarget.previousSibling).hasClass( 'widget-rendered' ) ) {
						return false;
					}

					control.showControls(allControls, section);
					once = 1;
            });
        });

    },

	hideAllControls: function ( section ) {
        var controls = wp.customize.section(section).controls();
        var tabControl = this.id;
        for( var i in controls ){
			var controlId = controls[i].id;
			if( controlId === 'widgets' ){
                var sectionContainer = wp.customize.section(section).container;
                jQuery( sectionContainer ).children( 'li[class*="widget"]' ).css( 'display', 'none' );
			} else {
				if( controlId !== tabControl ){
					var selector = wp.customize.control(controlId).selector;
					jQuery(selector).hide();
				}
			}
		}
    },

    handleClick: function () {
		var control = this;
        var section = control.section();
        var container = control.container;
		jQuery(container).find('.hestia-customizer-tab').on( 'click', function () {
            jQuery( this ).parent().find('.hestia-customizer-tab').removeClass('active');
            jQuery( this ).addClass('active');
			control.hideAllControls(section);
			var tab = jQuery(this).data('tab');
			var controlsToShow = control.params.controls[tab];
			var allControls = [];
			for (var controlName in controlsToShow ){
				if( jQuery.isEmptyObject(controlsToShow[controlName]) === false &&
				    typeof wp.customize.control(controlName) !== 'undefined' ){
					var subTabValue = wp.customize.control(controlName).setting._value;
					allControls = allControls.concat(controlsToShow[controlName][subTabValue]);
				}
				allControls.push(controlName);
			}
			control.showControls(allControls, section);
        } );
    },

    showControls: function (controls, section) {
		for(var i in controls ){
			var controlName = controls[i];
			if( controlName === 'widgets' ) {
                var sectionContainer = wp.customize.section(section).container;
                jQuery( sectionContainer ).children( 'li[class*="widget"]' ).css( 'display', 'list-item' );
            } else {
				if( typeof wp.customize.control(controlName) !== 'undefined' ) {
                    var selector = wp.customize.control(controlName).selector;
                    jQuery(selector).show();
                }
			}
		}
    }
});controls/ui/customizer-tabs/style.css000066600000002250151123453750014042 0ustar00.customize-control-interface-tabs {
	display: list-item !important;
}

.hestia-tabs-control {
	border-bottom: 1px solid #ddd;
	width: calc(100% + 28px);
	margin: -15px 0 0 -12px;
	table-layout: fixed;
	display: table;
}

.hestia-tabs-control .hestia-customizer-tab {
	border-right: 1px solid #ddd;
	display: table-cell;
	text-align: center;
	width: 100%;
}

.hestia-tabs-control .hestia-customizer-tab:last-child {
	border-right: none;
}

.hestia-tabs-control .hestia-customizer-tab label{
	text-transform: capitalize;
	background: #fff;
	box-shadow: inset 0 0 0 0 #0085ba;
	transition: all .3s ease;
	display: block;
	width: 100%;
	padding: 10px 0;
	text-decoration: none;
	font-weight: 600;
	color: #333;
}

.hestia-tabs-control .hestia-customizer-tab label i {
	color: #333;
	margin-right: 4px;
}

.hestia-tabs-control .hestia-customizer-tab label:hover {
	color: #0085ba;
	background: #f3f3f5;
}

.hestia-tabs-control .hestia-customizer-tab label:hover i {
	color: #333;
}

.hestia-tabs-control .hestia-customizer-tab.active label{
	box-shadow: inset 0 -3px 0 0 #0085ba;
	color: #0085ba;
	background-color: #fff;
}

.hestia-tabs-control input[type="radio"] {
	display: none !important;
}
controls/ui/class-hestia-generic-notice-section.php000066600000005011151123453750016457 0ustar00<?php
/**
 * Customizer info main class.
 *
 * @package Hestia
 * @since Hestia 1.0
 */

/**
 * Pro customizer section.
 *
 * @since  1.0.0
 * @access public
 */
class Hestia_Generic_Notice_Section extends WP_Customize_Section {

	/**
	 * The type of customize section being rendered.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $type = 'customizer-notice';

	/**
	 * Label text to output.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $section_text = '';

	/**
	 * Plugin slug for which to create install button.
	 *
	 * @since  1.0.0
	 * @access public
	 * @var    string
	 */
	public $slug = '';

	/**
	 * Hide notice.
	 *
	 * @since  1.1.34
	 * @access public
	 * @var    string
	 */
	public $hide_notice = false;

	/**
	 * Screen reader text on dismiss button.
	 *
	 * @since  1.1.34
	 * @access public
	 * @var    string
	 */
	public $button_screenreader = '';

	/**
	 * Control options.
	 *
	 * Ex: redirect link after install
	 *
	 * @var array
	 */
	public $options = array();

	/**
	 * Enqueue function.
	 */
	public function enqueue() {
		Hestia_Plugin_Install_Helper::instance()->enqueue_scripts();
	}

	/**
	 * Add custom parameters to pass to the JS via JSON.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return array
	 */
	public function json() {
		$json                          = parent::json();
		$json['section_text']          = $this->section_text;
		$json['hide_notice']           = $this->hide_notice;
		$json['plugin_install_button'] = $this->create_plugin_install_button( $this->slug, $this->options );

		return $json;
	}

	/**
	 * Outputs the Underscore.js template.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	protected function render_template() {
		?>
		<# if ( !data.hide_notice ) { #>
		<li id="accordion-section-{{ data.id }}"
				class="hestia-notice accordion-section control-section control-section-{{ data.type }} cannot-expand">
			<button type="button" class="notice-dismiss" style="z-index: 1;"></button>
			<h4 class="accordion-section-title" style="padding-right: 36px">
				<# if ( data.section_text ) { #>
				{{{data.section_text}}}
				<# } #>
				<# if ( data.plugin_install_button ) { #>
				{{{data.plugin_install_button}}}
				<# } #>
			</h4>

		</li>
		<# } #>
		<?php
	}

	/**
	 * Check plugin state.
	 *
	 * @param string $slug plugin slug.
	 *
	 * @return bool
	 */
	public function create_plugin_install_button( $slug, $settings = array() ) {
		return Hestia_Plugin_Install_Helper::instance()->get_button_html( $slug, $settings );
	}
}
controls/ui/subscribe-info/class-hestia-subscribe-info.php000066600000010115151123453750017747 0ustar00<?php
/**
 * Customizer functionality for the Blog settings panel.
 *
 * @package Hestia
 * @since Hestia 1.1.10
 */

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return null;
}

/**
 * A custom text control for Subscribe info.
 *
 * @since Hestia 1.0
 */
class Hestia_Subscribe_Info extends WP_Customize_Control {

	/**
	 * Control id
	 *
	 * @var string $id Control id.
	 */
	public $id = '';

	/**
	 * Check plugin state.
	 *
	 * @var string $state Plugin state.
	 */
	private $state = '';

	/**
	 * Plugin you want to install;
	 *
	 * @var string $plugin Plugin slug.
	 */
	public $plugin = 'mailin';

	/**
	 * Plugin path.
	 *
	 * @var string $path Plugin path.
	 */
	public $path = 'mailin/sendinblue.php';

	/**
	 * Hestia_Subscribe_Info constructor.
	 *
	 * @param WP_Customize_Manager $manager Customizer manager.
	 * @param string               $id Control id.
	 * @param array                $args Argument.
	 */
	public function __construct( $manager, $id, $args = array() ) {
		parent::__construct( $manager, $id, $args );
		$this->state = $this->check_plugin_state();
		$this->id    = $id;
	}

	/**
	 * Check plugin state.
	 *
	 * @return string
	 */
	private function check_plugin_state() {
		if ( file_exists( ABSPATH . 'wp-content/plugins/' . $this->path ) ) {
			include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
			if ( is_plugin_active( $this->path ) ) {
				return $this->check_activation();
			}
			return 'activate';
		}
		return 'install';
	}

	/**
	 * This method check if user registered his account for SIB.
	 *
	 * @return string
	 */
	public function check_activation() {
		if ( ! class_exists( 'SIB_Manager' ) ) {
			return 'install';
		}
		if ( SIB_Manager::is_done_validation() == true ) {
			return 'configure';
		}
		return 'create_account';
	}

	/**
	 * Enqueue function
	 */
	public function enqueue() {
		if ( $this->state === 'activate' || $this->state === 'install' ) {
			Hestia_Plugin_Install_Helper::instance()->enqueue_scripts();
		}
	}

	/**
	 * Render content for the control.
	 *
	 * @since Hestia 1.0
	 */
	public function render_content() {

		$text           = '';
		$display_button = false;
		$sib_account    = false;

		if ( $this->state === 'install' || $this->state === 'activate' ) {
			$text           = esc_html__( 'Here is where you must add the "SendinBlue Newsletter" widget. But first, you will need to install SendinBlue plugin.', 'hestia' );
			$display_button = true;
			$sib_account    = false;
		}

		if ( $this->state === 'create_account' ) {
			$text = sprintf(
				/* translators: %s Path in plugin wrapped*/
				esc_html__( 'After installing the plugin, you need to navigate to %s and configure the plugin.', 'hestia' ),
				sprintf(
					/* translators: %s Path in plugin*/
						'<a target="_blank" href="' . admin_url( 'admin.php?page=sib_page_home' ) . '"><b>%s</b></a>',
					esc_html__( 'Sendinblue > Home', 'hestia' )
				)
			);
			$display_button = false;
			$sib_account    = true;
		}

		if ( $this->state === 'configure' ) {
			$text           = sprintf(
				esc_html__( 'Here is where you must add the "SendinBlue Newsletter" widget.', 'hestia' ) . ' %s',
				sprintf(
					'<a target="_blank" href="https://docs.themeisle.com/article/879-how-to-integrate-sendinblue-wordpress-plugin-to-your-website">%s</a>',
					esc_html__( 'Read full documentation', 'hestia' )
				)
			);
			$display_button = false;
			$sib_account    = false;
		}

		if ( ! empty( $text ) ) {
			echo wp_kses_post( $text );
		}

		if ( $display_button === true ) {
			echo $this->create_plugin_install_button( $this->plugin, array( 'redirect' => admin_url( 'customize.php' ) . '?autofocus[control]=' . $this->id ) );
		}

		if ( $sib_account === true ) {
			echo '<br/>';
			echo '<a target="_blank" href="http://bit.ly/sibcwp" class="button" style="margin-top: 8px">' . esc_html( 'Create SendinBlue Account', 'hestia-pro' ) . '</a>';
		}
	}


	/**
	 * Check plugin state.
	 *
	 * @param string $slug slug.
	 *
	 * @return bool
	 */
	public function create_plugin_install_button( $slug, $settings = array() ) {
		return Hestia_Plugin_Install_Helper::instance()->get_button_html( $slug, $settings );
	}
}
class-hestia-customizer-notices.php000066600000011527151123453750013521 0ustar00<?php
/**
 * The customizer notices manager.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Customizer_Notices
 */
class Hestia_Customizer_Notices extends Hestia_Register_Customizer_Controls {

	/**
	 * Initialize.
	 */
	public function init() {
		parent::init();
		add_action( 'wp_ajax_dismissed_notice_handler', array( $this, 'ajax_notice_handler' ) );
		add_action( 'wp_ajax_nopriv_dismissed_notice_handler', array( $this, 'ajax_notice_handler' ) );
		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_notices_handler' ), 0 );
	}

	/**
	 * AJAX handler to store the state of dismissible notices.
	 */
	final public function ajax_notice_handler() {
		$control_id = sanitize_text_field( wp_unslash( $_POST['control'] ) );
		if ( empty( $control_id ) ) {
			die();
		}
		update_option( 'dismissed-' . $control_id, true );
		die();
	}

	/**
	 * Enqueue the controls script.
	 */
	public function enqueue_notices_handler() {
		wp_register_script( 'hestia-customizer-notices-handler', trailingslashit( get_template_directory_uri() ) . 'assets/js/admin/customizer-notices-handler.js', array( 'customize-controls' ), HESTIA_VERSION );
		wp_localize_script(
			'hestia-customizer-notices-handler', 'dismissNotices', array(
				'ajaxurl' => admin_url( 'admin-ajax.php' ),
				'cacat'   => 'gigel',
			)
		);

		wp_enqueue_script( 'hestia-customizer-notices-handler' );
	}

	/**
	 * Add customizer controls.
	 */
	public function add_controls() {
		$this->register_types();
		$this->add_docs_link_section();
		$this->maybe_add_woo_notice();
		$this->maybe_add_main_notice();
	}

	/**
	 * Register customizer controls type.
	 */
	private function register_types() {
		$this->register_type( 'Hestia_Section_Docs', 'section' );
		$this->register_type( 'Hestia_Generic_Notice_Section', 'section' );
		$this->register_type( 'Hestia_Main_Notice_Section', 'section' );
	}

	/**
	 * Add docs link section.
	 */
	private function add_docs_link_section() {
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_docs_section',
				array(
					'theme_info_title' => esc_html__( 'Hestia', 'hestia' ),
					'label_url'        => esc_url( 'http://docs.themeisle.com/article/569-hestia-documentation' ),
					'label_text'       => esc_html__( 'Documentation', 'hestia' ),
				),
				'Hestia_Section_Docs'
			)
		);
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_control_to_enable_docs_section',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section' => 'hestia_docs_section',
					'type'    => 'hidden',
				)
			)
		);
	}

	/**
	 * Maybe add WooCommerce notice.
	 */
	private function maybe_add_woo_notice() {
		if ( class_exists( 'WooCommerce' ) ) {
			return;
		}
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_info_woocommerce',
				array(
					'section_text' =>
						sprintf(
							/* translators: %1$s is Plugin Name */
							esc_html__( 'To have access to a shop section please install and configure %1$s.', 'hestia' ),
							esc_html__( 'WooCommerce plugin', 'hestia' )
						),
					'slug'         => 'woocommerce',
					'panel'        => 'hestia_frontpage_sections',
					'priority'     => 451,
					'capability'   => 'install_plugins',
					'hide_notice'  => (bool) get_option( 'dismissed-hestia_info_woocommerce', false ),
					'options'      => array( 'redirect' => admin_url( 'customize.php' ) . '?autofocus[section]=hestia_shop' ),
				),
				'Hestia_Generic_Notice_Section'
			)
		);
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_control_to_enable_woo_recommendation',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section' => 'hestia_info_woocommerce',
					'type'    => 'hidden',
				)
			)
		);
	}

	/**
	 * Check for OBFX and add main notice if needed.
	 */
	private function maybe_add_main_notice() {
		if ( class_exists( 'Orbit_Fox' ) ) {
			return;
		}

		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_info_obfx',
				array(
					'slug'        => 'themeisle-companion',
					'priority'    => 0,
					'capability'  => 'install_plugins',
					'hide_notice' => (bool) get_option( 'dismissed-hestia_info_obfx', false ),
					'title'       => __( 'Recommended Plugins', 'hestia' ),
					'options'     => array( 'redirect' => admin_url( 'customize.php' ) ),
					/* translators: Orbit Fox Companion */
					'description' => sprintf( esc_html__( 'If you want to take full advantage of the options this theme has to offer, please install and activate %s.', 'hestia' ), sprintf( '<strong>%s</strong>', 'Orbit Fox Companion' ) ),
				),
				'Hestia_Main_Notice_Section'
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_control_to_enable_obfx_recommendation',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section' => 'hestia_info_obfx',
					'type'    => 'hidden',
				)
			)
		);
	}

}
front-page/class-hestia-about-controls.php000066600000010671151123453750014667 0ustar00<?php
/**
 * About controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_About_Controls
 */
class Hestia_About_Controls extends Hestia_Register_Customizer_Controls {
	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_about_section();
		$this->add_hiding_control();
		$this->add_content_control();
		$this->add_pagebuilder_button_control();
		$this->add_background_control();
	}

	/**
	 * Add the section.
	 */
	private function add_about_section() {
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_about',
				array(
					'title'          => esc_html__( 'About', 'hestia' ),
					'panel'          => 'hestia_frontpage_sections',
					'priority'       => apply_filters( 'hestia_section_priority', 15, 'hestia_about' ),
					'hiding_control' => 'hestia_about_hide',
				),
				'Hestia_Hiding_Section'
			)
		);
	}

	/**
	 * Add hiding control.
	 */
	private function add_hiding_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_about_hide',
				array(
					'sanitize_callback' => 'hestia_sanitize_checkbox',
					'default'           => false,
					'transport'         => $this->selective_refresh,
				),
				array(
					'type'     => 'checkbox',
					'label'    => esc_html__( 'Disable section', 'hestia' ),
					'section'  => 'hestia_about',
					'priority' => 1,
				)
			)
		);
	}

	/**
	 * Add about section content editor control.
	 */
	private function add_content_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_page_editor',
				array(
					'default'           => $this->get_about_content_default(),
					'sanitize_callback' => 'wp_kses_post',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'           => esc_html__( 'About Content', 'hestia' ),
					'section'         => 'hestia_about',
					'priority'        => 10,
					'needsync'        => true,
					'active_callback' => array( $this, 'should_display_content_editor' ),
				),
				'Hestia_Page_Editor',
				array(
					'selector'        => '.hestia-about-content',
					'settings'        => 'hestia_page_editor',
					'render_callback' => array( $this, 'about_content_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add the page builder button control.
	 */
	private function add_pagebuilder_button_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_elementor_edit',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'label'           => esc_html__( 'About Content', 'hestia' ),
					'section'         => 'hestia_about',
					'priority'        => 14,
					'active_callback' => 'hestia_edited_with_pagebuilder',
				),
				'Hestia_PageBuilder_Button'
			)
		);
	}

	/**
	 * Add the background image control.
	 */
	private function add_background_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_feature_thumbnail',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'default'           => get_template_directory_uri() . '/assets/img/contact.jpg',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'           => esc_html__( 'About background', 'hestia' ),
					'section'         => 'hestia_about',
					'priority'        => 15,
					'active_callback' => array( $this, 'is_static_page' ),
				),
				'WP_Customize_Image_Control'
			)
		);
	}

	/**
	 * Get default content for page editor control.
	 *
	 * @return string
	 */
	private function get_about_content_default() {
		$front_page_id = get_option( 'page_on_front' );
		if ( empty( $front_page_id ) ) {
			return '';
		}
		$content = get_post_field( 'post_content', $front_page_id );

		return $content;
	}

	/**
	 * Callback for About section content editor
	 *
	 * @return bool
	 */
	public function should_display_content_editor() {
		if ( 'page' === get_option( 'show_on_front' ) ) {
			return ! hestia_edited_with_pagebuilder();
		}

		return false;
	}

	/**
	 * About section content render callback.
	 */
	public function about_content_render_callback() {
		if ( have_posts() ) :
			while ( have_posts() ) :
				the_post();
				get_template_part( 'template-parts/content', 'frontpage' );
			endwhile;
		else : // I'm not sure it's possible to have no posts when this page is shown, but WTH
			get_template_part( 'template-parts/content', 'none' );
		endif;
	}

	/**
	 * Page editor control active callback function
	 *
	 * @return bool
	 */
	public function is_static_page() {
		return 'page' === get_option( 'show_on_front' );
	}
}
front-page/class-hestia-shop-controls.php000066600000003645151123453750014531 0ustar00<?php
/**
 * About controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_About_Controls
 */
class Hestia_Shop_Controls extends Hestia_Front_Page_Section_Controls_Abstract {

	/**
	 * Set the section data for generating the customizer basic settings
	 *
	 * @return array | null
	 */
	protected function set_section_data() {
		if ( ! class_exists( 'WooCommerce' ) ) {
			return null;
		}
		return array(
			'slug'     => 'shop',
			'title'    => esc_html__( 'Shop', 'hestia' ),
			'priority' => 20,
		);
	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		if ( ! class_exists( 'WooCommerce' ) ) {
			return;
		}
		$this->add_content_controls();
	}

	/**
	 * Add about section content editor control.
	 */
	private function add_content_controls() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_shop_items',
				array(
					'default'           => 4,
					'sanitize_callback' => 'absint',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Number of Items', 'hestia' ),
					'section'  => 'hestia_shop',
					'priority' => 15,
					'type'     => 'number',
				),
				null,
				array(
					'selector'            => '.hestia-shop .hestia-shop-content',
					'render_callback'     => array( $this, 'shop_content_render_callback' ),
					'container_inclusive' => true,
				)
			)
		);
	}

	/**
	 * Shop Content render callback
	 */
	public function shop_content_render_callback() {
		$shop_section = new Hestia_Shop_Section();
		$content      = $shop_section->shop_content();

		return $content;
	}

	/**
	 * Change necessary controls.
	 *
	 * @return void
	 */
	public function change_controls() {
		$this->change_customizer_object( 'setting', 'hestia_shop_title', 'default', esc_html__( 'Products', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_shop_subtitle', 'default', esc_html__( 'Change this subtitle in the Customizer', 'hestia' ) );
	}

}
front-page/class-hestia-contact-controls.php000066600000014367151123453750015216 0ustar00<?php
/**
 * Blog section controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Blog_Section_Controls
 */
class Hestia_Contact_Controls extends Hestia_Front_Page_Section_Controls_Abstract {

	/**
	 * Add section details
	 *
	 * @return array
	 */
	protected function set_section_data() {
		return array(
			'slug'     => 'contact',
			'title'    => esc_html__( 'Contact', 'hestia' ),
			'priority' => 65,
		);
	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_tabs();
		$this->add_background_control();
		$this->add_form_title_control();
		$this->add_contact_info();
		$this->add_contact_content();
		$this->add_contact_shortcode();
	}

	/**
	 * Add tabs control
	 */
	private function add_tabs() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_tabs',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section'  => 'hestia_contact',
					'priority' => 1,
					'tabs'     => array(
						'general' => array(
							'label' => esc_html__( 'General Settings', 'hestia' ),
							'icon'  => 'cogs',
						),
						'contact' => array(
							'label' => esc_html__( 'Contact Content', 'hestia' ),
							'icon'  => 'newspaper-o',
						),
					),
					'controls' => array(
						'general' => array(
							'hestia_contact_hide'       => array(),
							'hestia_contact_title'      => array(),
							'hestia_contact_subtitle'   => array(),
							'hestia_contact_background' => array(),
							'hestia_contact_area_title' => array(),
						),
						'contact' => array(
							'hestia_contact_info'        => array(),
							'hestia_contact_content_new' => array(),
							'hestia_contact_form_shortcode' => array(),
						),
					),
				),
				'Hestia_Customize_Control_Tabs'
			)
		);
	}

	/**
	 * Add control for the background image.
	 */
	private function add_background_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_background',
				array(
					'default'           => apply_filters( 'hestia_contact_background_default', get_template_directory_uri() . '/assets/img/contact.jpg' ),
					'sanitize_callback' => 'esc_url_raw',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Background Image', 'hestia' ),
					'section'  => 'hestia_contact',
					'priority' => 5,
				),
				'WP_Customize_Image_Control'
			)
		);
	}

	/**
	 * Add form title control.
	 */
	private function add_form_title_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_area_title', array(
					'default'           => esc_html__( 'Contact Us', 'hestia' ),
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Form Title', 'hestia' ),
					'section'  => 'hestia_contact',
					'priority' => 20,
				)
			)
		);
	}

	/**
	 * Add contact info.
	 */
	private function add_contact_info() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_info',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'label'      => esc_html__( 'Instructions', 'hestia' ),
					'section'    => 'hestia_contact',
					'capability' => 'install_plugins',
					'priority'   => 25,
				),
				'Hestia_Contact_Info'
			)
		);
	}

	/**
	 * Content control.
	 */
	private function add_contact_content() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_content_new',
				array(
					'default'           => wp_kses_post( $this->content_default() ),
					'sanitize_callback' => 'wp_kses_post',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'                      => esc_html__( 'Contact Content', 'hestia' ),
					'section'                    => 'hestia_contact',
					'priority'                   => 30,
					'include_admin_print_footer' => true,
				),
				'Hestia_Page_Editor',
				array(
					'selector'        => '.contactus .col-md-5 > div.hestia-description',
					'settings'        => 'hestia_contact_content_new',
					'render_callback' => array( $this, 'content_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add form shortcode control.
	 */
	private function add_contact_shortcode() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_contact_form_shortcode',
				array(
					'default'           => '[pirate_forms]',
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Shortcode', 'hestia' ),
					'section'  => 'hestia_contact',
					'priority' => 26,
				),
				null,
				array(
					'selector'        => '.contactus .card-contact .content',
					'settings'        => 'hestia_contact_form_shortcode',
					'render_callback' => array( $this, 'form_render_callback' ),
				)
			)
		);
	}

	/**
	 * Get the contact content control default.
	 *
	 * @return string
	 */
	private function content_default() {
		$contact_section = new Hestia_Contact_Section();
		return $contact_section->content_default();
	}

	/**
	 * Render callback function for contact section content selective refresh
	 *
	 * @since 1.1.31
	 * @access public
	 * @return string
	 */
	public function content_render_callback() {
		return get_theme_mod( 'hestia_contact_content_new' );
	}

	/**
	 * Render callback function for contact form selective refresh
	 *
	 * @since 1.1.51
	 * @access public
	 * @return void
	 */
	public function form_render_callback() {
		$hestia_contact_form_shortcode_default = '[pirate_forms]';
		$hestia_contact_form_shortcode         = get_theme_mod( 'hestia_contact_form_shortcode', $hestia_contact_form_shortcode_default );

		if ( $hestia_contact_form_shortcode === $hestia_contact_form_shortcode_default || empty( $hestia_contact_form_shortcode ) ) {
			echo do_shortcode( '[pirate_forms]' );
		} else {
			echo do_shortcode( wp_kses_post( $hestia_contact_form_shortcode ) );
		}
	}

	/**
	 * Change necessary controls.
	 *
	 * @return void
	 */
	public function change_controls() {
		$this->change_customizer_object( 'setting', 'hestia_contact_title', 'default', esc_html__( 'Get in Touch', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_contact_subtitle', 'default', esc_html__( 'Change this subtitle in the Customizer', 'hestia' ) );
	}
}
front-page/class-hestia-big-title-controls.php000066600000030036151123453750015432 0ustar00<?php
/**
 * Big title controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Big_Title_Controls
 */
class Hestia_Big_Title_Controls extends Hestia_Register_Customizer_Controls {

	/**
	 * Initialize the control. Add all the hooks necessary.
	 */
	public function init() {
		parent::init();
		add_filter( 'customizer_widgets_section_args', array( $this, 'move_widgets_section' ), 10, 3 );
	}

	/**
	 * Filter to move widgets section to Fronptage section panel.
	 *
	 * @param array  $section_args Sections args.
	 * @param string $section_id Section id.
	 * @param string $sidebar_id Sidebar id.
	 *
	 * @return mixed
	 */
	public function move_widgets_section( $section_args, $section_id, $sidebar_id ) {
		if ( $sidebar_id === 'sidebar-big-title' ) {
			$section_args['panel'] = 'hestia_frontpage_sections';
		}
		return $section_args;
	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_section_tabs();
		$this->add_general_controls();
		$this->add_background_image_control();
		$this->add_content_controls();
		$this->add_button_controls();
		$this->add_parallax_controls();
		$this->add_alignment_control();
	}

	/**
	 * Change controls.
	 */
	public function change_controls() {
		$this->maybe_add_defaults_for_big_title();
	}


	/**
	 * Add drop-down for header type.
	 */
	private function add_general_controls() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_slider_type',
				array(
					'sanitize_callback' => 'hestia_sanitize_big_title_type',
					'default'           => 'image',
				),
				array(
					'type'     => 'select',
					'priority' => -1,
					'section'  => 'sidebar-widgets-sidebar-big-title', // Add a default or your own section
					'label'    => esc_html__( 'Big Title Background', 'hestia' ),
					'choices'  => array(
						'image'    => esc_html__( 'Image', 'hestia' ),
						'parallax' => esc_html__( 'Parallax', 'hestia' ),
					),
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_widgets_title',
				array(
					'sanitize_callback' => 'wp_kses',
				),
				array(
					'label'    => esc_html__( 'Big Title Section', 'hestia' ) . ' ' . esc_html__( 'Sidebar', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => -1,
				),
				'Hestia_Customizer_Heading'
			)
		);

	}

	/**
	 * Add background control.
	 */
	public function add_background_image_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_background',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Image', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 10,
				),
				'WP_Customize_Image_Control',
				array(
					'selector'        => '.big-title-image',
					'settings'        => 'hestia_big_title_background',
					'render_callback' => array( $this, 'background_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add title subtitle.
	 */
	public function add_content_controls() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_title',
				array(
					'sanitize_callback' => 'wp_kses_post',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Title', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 20,
				),
				null,
				array(
					'selector'        => '.carousel .hestia-title',
					'settings'        => 'hestia_big_title_title',
					'render_callback' => array( $this, 'title_render_callback' ),
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_text',
				array(
					'sanitize_callback' => 'wp_kses_post',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Text', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 25,
				),
				null,
				array(
					'selector'        => '.carousel .sub-title',
					'settings'        => 'hestia_big_title_text',
					'render_callback' => array( $this, 'text_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add button controls.
	 */
	public function add_button_controls() {

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_button_text',
				array(
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Button text', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 30,
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_button_link',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Button URL', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 35,
				)
			)
		);

		$this->add_partial(
			new Hestia_Customizer_Partial(
				'hestia_big_title_button_text', array(
					'selector'        => '.carousel .buttons',
					'settings'        => 'hestia_big_title_button_text',
					'render_callback' => array( $this, 'button_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add alignment control.
	 */
	protected function add_alignment_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_slider_alignment',
				array(
					'default'           => 'center',
					'sanitize_callback' => 'hestia_sanitize_alignment_options',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Layout', 'hestia' ),
					'priority' => -2,
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'choices'  => array(
						'left'   => array(
							'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqBAMAAACsf7WzAAAAD1BMVEX////V1dUAhbo+yP/u9/pRM+FMAAAAZElEQVR42u3WsQ2AIBRFUd0AV3AFV3D/mSwsBI2BRIofPKchobjVK/7EQJZSit+az5/aq/WjVs99AQAjWxs8L4ZL0hqutTcoWt0OSa2orfdVaWl9b/XcqpbWvbXltLQCtwCA3AHhDKjAJvDMEwAAAABJRU5ErkJggg==',
						),
						'center' => array(
							'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqBAMAAACsf7WzAAAAD1BMVEX///8AhbrV1dU+yP/u9/q7NurVAAAAV0lEQVR42u3SsQ2AMAxFwYBYgA0QK7AC+89EQQOiIIoogn3XWHLxql8IZL1b+m+N5+ftaiVqfbkvACC8YW6iFbg17U0KCVQNTUvr0YK+bFdaWklaAPAXB4dWiADE72glAAAAAElFTkSuQmCC',
						),
						'right'  => array(
							'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqBAMAAACsf7WzAAAAD1BMVEX////V1dUAhbo+yP/u9/pRM+FMAAAAYElEQVR42u3SuQ2AMBBFQaAC3AIt0AL910RAAkICS1xrPJOstMGLfsOPpK0+fqtdPmdXq6LWnfsCAKJJe4+0hhxaVbWmHB9sVStCq7u8Ly2td7aqpXVsXNPSKrAFAOWbASNgr0b3Lh1kAAAAAElFTkSuQmCC',
						),
					),
				),
				'Hestia_Customize_Control_Radio_Image',
				array(
					'selector'        => '#carousel-hestia-generic',
					'settings'        => 'hestia_slider_alignment',
					'render_callback' => array( $this, 'alignment_render_callback' ),
				)
			)
		);
	}

	/**
	 * Add controls for parallax.
	 */
	private function add_parallax_controls() {

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_parallax_layer1',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'default'           => apply_filters( 'hestia_parallax_layer1_default', false ),
				),
				array(
					'label'    => esc_html__( 'First Layer', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 10,
				),
				'WP_Customize_Image_Control'
			)
		);
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_parallax_layer2',
				array(
					'sanitize_callback' => 'esc_url_raw',
					'default'           => apply_filters( 'hestia_parallax_layer2_default', false ),
				),
				array(
					'label'    => esc_html__( 'Second Layer', 'hestia' ),
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => 15,
				),
				'WP_Customize_Image_Control'
			)
		);
	}

	/**
	 * Add tabs control in hestia_big_title section.
	 */
	public function add_section_tabs() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_slider_tabs',
				array(
					'transport' => $this->selective_refresh,
				),
				array(
					'section'  => 'sidebar-widgets-sidebar-big-title',
					'priority' => -3,
					'tabs'     => array(
						'slider' => array(
							'label' => esc_html__( 'Big Title Section', 'hestia' ),
							'icon'  => 'picture-o',
						),
						'extra'  => array(
							'label' => esc_html__( 'Extra', 'hestia' ),
							'icon'  => 'user-plus',
						),
					),
					'controls' => array(
						'slider' => array(
							'hestia_slider_type' => array(
								'image'    => array(
									'hestia_big_title_background',
									'hestia_big_title_title',
									'hestia_big_title_text',
									'hestia_big_title_button_text',
									'hestia_big_title_button_link',
								),
								'parallax' => array(
									'hestia_parallax_layer1',
									'hestia_parallax_layer2',
									'hestia_big_title_title',
									'hestia_big_title_text',
									'hestia_big_title_button_text',
									'hestia_big_title_button_link',

								),
							),
						),
						'extra'  => array(
							'hestia_slider_alignment' => array(
								'left'   => array(
									'hestia_big_title_widgets_title',
									'widgets',
								),
								'center' => array(),
								'right'  => array(
									'hestia_big_title_widgets_title',
									'widgets',
								),
							),
						),
					),
				),
				'Hestia_Customize_Control_Tabs'
			)
		);
	}


	/**
	 * Maybe throw in some defaults.
	 */
	private function maybe_add_defaults_for_big_title() {
		$hestia_slider_content = get_theme_mod( 'hestia_slider_content' );
		if ( ! empty( $hestia_slider_content ) ) {
			return;
		}

		$this->change_customizer_object( 'setting', 'hestia_big_title_background', 'default', esc_url( apply_filters( 'hestia_big_title_background_default', get_template_directory_uri() . '/assets/img/slider2.jpg' ) ) );
		$this->change_customizer_object( 'setting', 'hestia_big_title_title', 'default', esc_html__( 'Change in the Customizer', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_big_title_text', 'default', esc_html__( 'Change in the Customizer', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_big_title_button_text', 'default', esc_html__( 'Change in the Customizer', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_big_title_button_link', 'default', esc_url( '#' ) );
	}

	/**
	 * Callback for title.
	 *
	 * @return string
	 */
	public function title_render_callback() {
		return get_theme_mod( 'hestia_big_title_title' );
	}

	/**
	 * Callback for subtitle.
	 *
	 * @return string
	 */
	public function text_render_callback() {
		return get_theme_mod( 'hestia_big_title_text' );
	}

	/**
	 * Callback for button.
	 *
	 * @return bool|string
	 */
	public function button_render_callback() {
		$button_text = get_theme_mod( 'hestia_big_title_button_text' );
		$button_link = get_theme_mod( 'hestia_big_title_button_link' );
		if ( empty( $button_text ) ) {
			return false;
		}
		if ( empty( $button_link ) ) {
			return false;
		}

		$output = '<a href="' . $button_link . '" title="' . $button_text . '" class="btn btn-primary btn-lg">' . $button_text . '</a>';

		return wp_kses_post( $output );
	}

	/**
	 * Alignment callback.
	 */
	public function alignment_render_callback() {
		$big_title_section_view = new Hestia_Big_Title_Section();
		$big_title_section_view->render_big_title_content();
	}

	/**
	 * Background callback.
	 */
	public function background_render_callback() {
		$hestia_parallax_layer1 = get_theme_mod( 'hestia_parallax_layer1' );
		$hestia_parallax_layer2 = get_theme_mod( 'hestia_parallax_layer2' );
		if ( empty( $hestia_parallax_layer1 ) || empty( $hestia_parallax_layer2 ) ) {
			$hestia_big_title_background = get_theme_mod( 'hestia_big_title_background' );
			echo '<style class="big-title-image-css">';
			echo '#carousel-hestia-generic .header-filter {';
			echo ! empty( $hestia_big_title_background ) ? 'background-image: url("' . esc_url( $hestia_big_title_background ) . '") !important;' : 'background-image: none !important;';
			echo '}';
			echo '</style>';
		}
	}

}
front-page/class-hestia-subscribe-controls.php000066600000007313151123453750015535 0ustar00<?php
/**
 * Subscribe controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Subscribe_Controls
 */
class Hestia_Subscribe_Controls extends Hestia_Front_Page_Section_Controls_Abstract {

	/**
	 * Add section details
	 *
	 * @return array
	 */
	protected function set_section_data() {
		return array(
			'slug'             => 'subscribe',
			'title'            => esc_html__( 'Subscribe', 'hestia' ),
			'priority'         => 55,
			'initially_hidden' => true,
			'section'          => 'sidebar-widgets-subscribe-widgets',
		);

	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_tabs();
		$this->add_info_control();
		$this->add_background_control();
	}

	/**
	 * Add section tabs/
	 */
	private function add_tabs() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_subscribe_tabs',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section'  => 'sidebar-widgets-subscribe-widgets',
					'tabs'     => array(
						'general'    => array(
							'label' => esc_html__( 'General Settings', 'hestia' ),
						),
						'sendinblue' => array(
							'label' => esc_html__( 'SendinBlue plugin', 'hestia' ),
						),
					),
					'controls' => array(
						'general'    => array(
							'hestia_subscribe_hide'       => array(),
							'hestia_subscribe_background' => array(),
							'hestia_subscribe_title'      => array(),
							'hestia_subscribe_subtitle'   => array(),
						),
						'sendinblue' => array(
							'hestia_subscribe_info' => array(),
							'widgets'               => array(),
						),

					),
				),
				'Hestia_Customize_Control_Tabs'
			)
		);
	}

	/**
	 * Add background control.
	 */
	private function add_background_control() {

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_subscribe_background',
				array(
					'default'           => get_template_directory_uri() . '/assets/img/about.jpg',
					'sanitize_callback' => 'esc_url_raw',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'    => esc_html__( 'Background Image', 'hestia' ),
					'section'  => 'sidebar-widgets-subscribe-widgets',
					'priority' => 10,
				),
				'WP_Customize_Image_Control'
			)
		);
	}

	/**
	 * Add the info control.
	 */
	private function add_info_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_subscribe_info',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'label'      => esc_html__( 'Instructions', 'hestia' ),
					'section'    => 'sidebar-widgets-subscribe-widgets',
					'capability' => 'install_plugins',
					'priority'   => 25,
				),
				'Hestia_Subscribe_Info'
			)
		);
	}

	/**
	 * Change any controls that may need change.
	 *
	 * @return void
	 */
	public function change_controls() {
		$this->change_customizer_object( 'section', 'sidebar-widgets-subscribe-widgets', 'panel', 'hestia_frontpage_sections' );
		$this->change_customizer_object( 'section', 'sidebar-widgets-subscribe-widgets', 'priority', apply_filters( 'hestia_section_priority', 55, 'sidebar-widgets-subscribe-widgets' ) );
		$this->change_customizer_object( 'setting', 'hestia_subscribe_title', 'default', esc_html__( 'Subscribe to our Newsletter', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_subscribe_subtitle', 'default', esc_html__( 'Change this subtitle in the Customizer', 'hestia' ) );
		$controls_to_move = array(
			'hestia_subscribe_subtitle',
			'hestia_subscribe_title',
			'hestia_subscribe_background',
			'hestia_subscribe_hide',
			'hestia_subscribe_info',
			'hestia_subscribe_tabs',
		);

		foreach ( $controls_to_move as $index => $control_id ) {
			$this->change_customizer_object( 'control', $control_id, 'priority', -$index );
		}
	}
}
front-page/class-hestia-blog-section-controls.php000066600000003454151123453750016143 0ustar00<?php
/**
 * Blog section controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Blog_Section_Controls
 */
class Hestia_Blog_Section_Controls extends Hestia_Front_Page_Section_Controls_Abstract {
	/**
	 * Implement set_section_data from parent.
	 * Add section details
	 *
	 * @return array
	 */
	protected function set_section_data() {
		return array(
			'slug'     => 'blog',
			'title'    => esc_html__( 'Blog', 'hestia' ),
			'priority' => 60,
		);
	}

	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->add_items_number_control();
	}

	/**
	 * Items number control.
	 */
	private function add_items_number_control() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_blog_items',
				array(
					'default'           => 3,
					'sanitize_callback' => 'absint',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'       => esc_html__( 'Number of Items', 'hestia' ),
					'section'     => 'hestia_blog',
					'priority'    => 15,
					'type'        => 'number',
					'input_attrs' => array(
						'min' => 1,
					),
				),
				null,
				array(
					'selector'        => '.hestia-blog-content',
					'settings'        => 'hestia_blog_items',
					'render_callback' => array( $this, 'blog_content_callback' ),
				)
			)
		);
	}

	/**
	 * Render callback function
	 */
	public function blog_content_callback() {
		$blog_section = new Hestia_Blog_Section();
		$blog_section->blog_content();
	}


	/**
	 * Change necessary controls.
	 *
	 * @return void
	 */
	public function change_controls() {
		$this->change_customizer_object( 'setting', 'hestia_blog_title', 'default', esc_html__( 'Blog', 'hestia' ) );
		$this->change_customizer_object( 'setting', 'hestia_blog_subtitle', 'default', esc_html__( 'Change this subtitle in the Customizer', 'hestia' ) );
	}

}
class-hestia-customizer-main.php000066600000006114151123453750012775 0ustar00<?php
/**
 * The main customizer manager.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Customizer_Main
 */
class Hestia_Customizer_Main extends Hestia_Register_Customizer_Controls {

	/**
	 * Add controls.
	 */
	public function add_controls() {
		$this->register_types();
		$this->add_main_panels();
		$this->maybe_add_partial_refresh_to_blog_description();
	}

	/**
	 * Register customizer controls type.
	 */
	private function register_types() {
		$this->register_type( 'Hestia_Hiding_Section', 'section' );
		$this->register_type( 'Hestia_Customizer_Range_Value_Control', 'control' );
		$this->register_type( 'Hestia_Customizer_Heading', 'control' );
		$this->register_type( 'Hestia_Select_Multiple', 'control' );
		$this->register_type( 'Hestia_PageBuilder_Button', 'control' );
		$this->register_type( 'Hestia_Customize_Control_Radio_Image', 'control' );
		$this->register_type( 'Hestia_Customize_Control_Tabs', 'control' );
	}

	/**
	 * Add main panels.
	 */
	private function add_main_panels() {
		$this->add_panel(
			new Hestia_Customizer_Panel(
				'hestia_appearance_settings',
				array(
					'priority' => 25,
					'title'    => esc_html__( 'Appearance Settings', 'hestia' ),
				)
			)
		);

		$this->add_panel(
			new Hestia_Customizer_Panel(
				'hestia_frontpage_sections',
				array(
					'priority' => 30,
					'title'    => esc_html__( 'Frontpage Sections', 'hestia' ),
				)
			)
		);

		$this->add_panel(
			new Hestia_Customizer_Panel(
				'hestia_blog_settings',
				array(
					'priority' => 45,
					'title'    => esc_html__( 'Blog Settings', 'hestia' ),
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_link_header_background',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'priority'     => 25,
					'section'      => 'background_image',
					'button_text'  => esc_html__( 'Header Background', 'hestia' ),
					'button_class' => 'focus-customizer-header-image',
					'icon_class'   => 'fa-image',
				),
				'Hestia_Button'
			)
		);
	}

	/**
	 * Add selective refresh to blog description if that's the case.
	 */
	private function maybe_add_partial_refresh_to_blog_description() {
		if ( ! 'posts' === get_option( 'show_on_front' ) ) {
			return;
		}
		$this->add_partial(
			new Hestia_Customizer_Partial(
				'blogdescription',
				array(
					'selector'        => '.home.blog .page-header .hestia-title',
					'render_callback' => array( $this, 'blog_description_callback' ),
				)
			)
		);
	}

	/**
	 * Change controls.
	 *
	 * @return void
	 */
	public function change_controls() {
		$this->change_customizer_object( 'section', 'header_image', 'panel', 'hestia_appearance_settings' );
		$this->change_customizer_object( 'section', 'header_image', 'description', __return_empty_string() );
		$this->change_customizer_object( 'section', 'background_image', 'panel', 'hestia_appearance_settings' );
		$this->change_customizer_object( 'setting', 'blogdescription', 'transport', $this->selective_refresh );
	}

	/**
	 * Blog description callback function
	 */
	public function blog_description_callback() {
		bloginfo( 'description' );
	}
}
general/class-hestia-color-controls.php000066600000002306151123453750014242 0ustar00<?php
/**
 * Customizer color controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Color_Controls
 */
class Hestia_Color_Controls extends Hestia_Register_Customizer_Controls {
	/**
	 * Add controls
	 */
	public function add_controls() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'accent_color',
				array(
					'default'           => apply_filters( 'hestia_accent_color_default', '#e91e63' ),
					'transport'         => $this->selective_refresh,
					'sanitize_callback' => 'hestia_sanitize_colors',
				),
				array(
					'label'    => esc_html__( 'Accent Color', 'hestia' ),
					'section'  => 'colors',
					'palette'  => false,
					'priority' => 10,
				),
				'Hestia_Customize_Alpha_Color_Control'
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_header_gradient_color',
				array(
					'default'           => apply_filters( 'hestia_header_gradient_default', '#a81d84' ),
					'transport'         => 'postMessage',
					'sanitize_callback' => 'hestia_sanitize_colors',
				),
				array(
					'label'    => esc_html__( 'Header Gradient', 'hestia' ),
					'section'  => 'header_image',
					'priority' => 30,
				),
				'WP_Customize_Color_Control'
			)
		);
	}
}
general/class-hestia-general-controls.php000066600000014026151123453750014543 0ustar00<?php
/**
 * Customizer general controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_General_Controls
 */
class Hestia_General_Controls extends Hestia_Register_Customizer_Controls {
	/**
	 * Initialize the controls.
	 */
	public function init() {
		parent::init();
		if ( is_rtl() ) {
			add_filter( 'hestia_layout_control_image_left', array( $this, 'rtl_layout_control_right_image' ) );
			add_filter( 'hestia_layout_control_image_right', array( $this, 'rtl_layout_control_left_image' ) );
		}
	}

	/**
	 * Add controls
	 */
	public function add_controls() {
		$this->add_general_settings_section();
		$this->add_general_settings_section();
		$this->add_page_sidebar_layout();
		$this->add_blog_sidebar_layout();
		$this->add_sharing_icons_toggle();
		$this->add_scrolltop_toggle();
		$this->add_boxed_layout_toggle();
	}

	/**
	 * Add General Settings Section
	 */
	private function add_general_settings_section() {
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_general',
				array(
					'title'    => esc_html__( 'General Settings', 'hestia' ),
					'panel'    => 'hestia_appearance_settings',
					'priority' => 20,
				)
			)
		);

	}

	/**
	 * Add page sidebar layout
	 */
	private function add_page_sidebar_layout() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_page_sidebar_layout',
				array(
					'sanitize_callback' => 'sanitize_key',
					'default'           => 'full-width',
				),
				array(
					'label'    => esc_html__( 'Page Sidebar Layout', 'hestia' ),
					'section'  => 'hestia_general',
					'priority' => 15,
					'choices'  => $this->get_layout_choices(),
				),
				'Hestia_Customize_Control_Radio_Image'
			)
		);
	}

	/**
	 * Add blog sidebar layout
	 */
	private function add_blog_sidebar_layout() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_blog_sidebar_layout', array(
					'default'           => $this->get_blog_layout_default(),
					'sanitize_callback' => 'sanitize_key',
				),
				array(
					'label'    => esc_html__( 'Blog Sidebar Layout', 'hestia' ),
					'section'  => 'hestia_general',
					'priority' => 20,
					'choices'  => $this->get_layout_choices(),
				),
				'Hestia_Customize_Control_Radio_Image'
			)
		);
	}

	/**
	 * Sharing icons control.
	 */
	private function add_sharing_icons_toggle() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_enable_sharing_icons', array(
					'default'           => true,
					'sanitize_callback' => 'hestia_sanitize_checkbox',
				),
				array(
					'label'    => esc_html__( 'Enable Sharing Icons', 'hestia' ),
					'section'  => 'hestia_general',
					'priority' => 30,
					'type'     => 'checkbox',
				)
			)
		);
	}

	/**
	 * Add scroll to top control.
	 */
	private function add_scrolltop_toggle() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_enable_scroll_to_top',
				array(
					'sanitize_callback' => 'hestia_sanitize_checkbox',
				),
				array(
					'label'    => esc_html__( 'Enable Scroll to Top', 'hestia' ),
					'section'  => 'hestia_general',
					'priority' => 40,
					'type'     => 'checkbox',
				)
			)
		);
	}

	/**
	 * ADd the boxed layout control.
	 */
	private function add_boxed_layout_toggle() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_general_layout',
				array(
					'default'           => 1,
					'sanitize_callback' => 'hestia_sanitize_checkbox',
					'transport'         => 'postMessage',
				),
				array(
					'label'       => esc_html__( 'Boxed Layout', 'hestia' ),
					'description' => esc_html__( 'If enabled, the theme will use a boxed layout.', 'hestia' ),
					'section'     => 'hestia_general',
					'priority'    => 50,
					'type'        => 'checkbox',
				)
			)
		);
	}

	/**
	 * Get layout choices for sidebar layout controls.
	 *
	 * @return array
	 */
	private function get_layout_choices() {
		return array(
			'full-width'    => array(
				'url'   => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAQMAAABknzrDAAAABlBMVEX////V1dXUdjOkAAAAPUlEQVRIx2NgGAUkAcb////Y/+d/+P8AdcQoc8vhH/X/5P+j2kG+GA3CCgrwi43aMWrHqB2jdowEO4YpAACyKSE0IzIuBgAAAABJRU5ErkJggg==',
				'label' => esc_html__( 'Full Width', 'hestia' ),
			),
			'sidebar-left'  => array(
				'url'   => apply_filters( 'hestia_layout_control_image_left', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAgMAAAAjP0ATAAAACVBMVEX///8+yP/V1dXG9YqxAAAAWElEQVR42mNgGAXDE4RCQMDAKONaBQINWqtWrWBatQDIaxg8ygYqQIAOYwC6bwHUmYNH2eBPSMhgBQXKRr0w6oVRL4x6YdQLo14Y9cKoF0a9QCO3jYLhBADvmFlNY69qsQAAAABJRU5ErkJggg==' ),
				'label' => esc_html__( 'Left Sidebar', 'hestia' ),
			),
			'sidebar-right' => array(
				'url'   => apply_filters( 'hestia_layout_control_image_right', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAgMAAAAjP0ATAAAACVBMVEX///8+yP/V1dXG9YqxAAAAWUlEQVR42mNgGAUjB4iGgkEIzZStAoEVTECiQWsVkLdiECkboAABOmwBF9BtUGcOImUDEiCkJCQU0ECBslEvjHph1AujXhj1wqgXRr0w6oVRLwyEF0bBUAUAz/FTNXm+R/MAAAAASUVORK5CYII=' ),
				'label' => esc_html__( 'Right Sidebar', 'hestia' ),
			),
		);
	}


	/**
	 * Change the right image.
	 *
	 * @return string
	 */
	public function rtl_layout_control_right_image() {
		return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAgMAAAAjP0ATAAAACVBMVEX///8+yP/V1dXG9YqxAAAAWUlEQVR42mNgGAUjB4iGgkEIzZStAoEVTECiQWsVkLdiECkboAABOmwBF9BtUGcOImUDEiCkJCQU0ECBslEvjHph1AujXhj1wqgXRr0w6oVRLwyEF0bBUAUAz/FTNXm+R/MAAAAASUVORK5CYII=';
	}

	/**
	 * Change the left image.
	 *
	 * @return string
	 */
	public function rtl_layout_control_left_image() {
		return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAgMAAAAjP0ATAAAACVBMVEX///8+yP/V1dXG9YqxAAAAWElEQVR42mNgGAXDE4RCQMDAKONaBQINWqtWrWBatQDIaxg8ygYqQIAOYwC6bwHUmYNH2eBPSMhgBQXKRr0w6oVRL4x6YdQLo14Y9cKoF0a9QCO3jYLhBADvmFlNY69qsQAAAABJRU5ErkJggg==';
	}

	/**
	 * Get default option for sidebar layout
	 *
	 * @return string
	 */
	private function get_blog_layout_default() {
		$sidebar_on_single_post = get_theme_mod( 'hestia_sidebar_on_single_post', false );
		$sidebar_on_index       = get_theme_mod( 'hestia_sidebar_on_index', false );

		return $sidebar_on_single_post && $sidebar_on_index ? 'full-width' : 'sidebar-right';
	}
}
general/class-hestia-header-controls.php000066600000022457151123453750014365 0ustar00<?php
/**
 * Handle Header Controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Header_Controls
 */
class Hestia_Header_Controls extends Hestia_Register_Customizer_Controls {

	/**
	 * Add the customizer controls.
	 */
	public function add_controls() {
		$this->register_type( 'Hestia_Customize_Control_Radio_Image', 'control' );
		$this->add_sections();

		$this->add_panel(
			new Hestia_Customizer_Panel(
				'hestia_header_options', array(
					'priority' => 35,
					'title'    => esc_html__( 'Header Options', 'hestia' ),
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_header_image_sitewide',
				array(
					'sanitize_callback' => 'hestia_sanitize_checkbox',
					'default'           => false,
				),
				array(
					'type'     => 'checkbox',
					'label'    => esc_html__( 'Enable Header Image Sitewide', 'hestia' ),
					'section'  => 'header_image',
					'priority' => 25,
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_top_bar_hide',
				array(
					'sanitize_callback' => 'hestia_sanitize_checkbox',
					'default'           => true,
				),
				array(
					'type'     => 'checkbox',
					'label'    => esc_html__( 'Disable section', 'hestia' ),
					'section'  => 'hestia_top_bar',
					'priority' => 1,
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_link_to_top_menu',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'priority'     => 25,
					'section'      => 'hestia_top_bar',
					'button_text'  => esc_html__( 'Very Top Bar', 'hestia' ) . ' ' . esc_html__( 'Menu', 'hestia' ),
					'button_class' => 'hestia-link-to-top-menu',
					'icon_class'   => 'fa-bars',
				),
				'Hestia_Button'
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_top_menu_hidden',
				array(
					'sanitize_callback' => 'sanitize_text_field',
					'transport'         => $this->selective_refresh,
				),
				array(
					'priority' => 25,
					'type'     => 'hidden',
					'section'  => 'menu_locations',
				),
				null,
				array(
					'selector'        => '.top-bar-nav',
					'settings'        => 'hestia_top_menu_hidden',
					'render_callback' => array( $this, 'top_bar_callback' ),
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_search_in_menu',
				array(
					'sanitize_callback' => 'hestia_sanitize_checkbox',
					'default'           => false,
				),
				array(
					'type'     => 'checkbox',
					'label'    => esc_html__( 'Enable Search in Menu', 'hestia' ),
					'section'  => 'hestia_navigation',
					'priority' => 5,
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_header_alignment',
				array(
					'default'           => 'left',
					'sanitize_callback' => 'hestia_sanitize_alignment_options',
				),
				array(
					'label'    => esc_html__( 'Layout', 'hestia' ),
					'priority' => 25,
					'section'  => 'hestia_navigation',
					'choices'  => array(
						'left'   => array(
							'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAgMAAAAjP0ATAAAADFBMVEX////V1dUAhbo+yP8aB7nsAAAARklEQVRYhWNgGEGA/z8EHKC+MqZVq1ah4xGtjOLgHQWjYBSMgmENREOxgoDhp2xkASIDYxgoGwUUACJDdlTZKBgFo2DAAAAZAflVkm2NtwAAAABJRU5ErkJggg==',
						),
						'center' => array(
							'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAgMAAAAjP0ATAAAADFBMVEX////V1dUAhbo+yP8aB7nsAAAARElEQVRYR2NgGKngPwT8GVU2BJQNb6C1atUCfHjEKRsFo2BEANFQrCBg+CkbWYDIwBgGykYBBYDIkB1VNgpGwSgYMAAAzIYr4wYj4sEAAAAASUVORK5CYII=',
						),
						'right'  => array(
							'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqBAMAAACsf7WzAAAAD1BMVEX////V1dXF7v8Ahbo+yP+vNfjRAAAAWUlEQVR42u3TsQ2AMAxFQRAswAaIFViB/WeKlI4KgUJMwl3j7lXfA3+xXVvfas3HmZaWVtw/1mrRjmnPnl6tDlsAEcblFq2PtuhLyS1oxbWgjpIL1dICgEYlsKfbvyzuWeMAAAAASUVORK5CYII=',
						),
					),
				),
				'Hestia_Customize_Control_Radio_Image'
			)
		);

		/**
		 * Customize control for header layout.
		 */
		$sidebar_choices = apply_filters(
			'hestia_header_layout_choices', array(
				'default'    => array(
					'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqBAMAAACsf7WzAAAAD1BMVEU+yP/////Y9P/G7//V1dUbjhlcAAAAW0lEQVR4Ae3SAQmAYAyE0V9NMDCBCQxh/0wKGGCAIJ7vC3DA28ZvkjRVo49vzVujoeYFbF15i32pu4CtlCTVc+Vu2VqPRi9ssWfPnj179uzZs2fPnj179uwzt07LZ+4ImOW7JwAAAABJRU5ErkJggg==',
				),
				'no-content' => array(
					'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqBAMAAACsf7WzAAAAElBMVEU+yP////88SFhjbXl1fonV1dUUDrn8AAAAXElEQVR4Ae3SMQ2AYAyEUSwAYOC3gAJE4N8KCztNKEPT9wm44eUmSZL0b3NeXbeWEaj41noEet/yCVs+cW7jqfjW12ztV6D8Lfbs2bNnz549e/bs2bNnz559060bqAJ8azq5sAYAAAAASUVORK5CYII=',
				),
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_header_layout',
				array(
					'sanitize_callback' => 'sanitize_key',
					'default'           => 'default',
				),
				array(
					'label'    => esc_html__( 'Layout', 'hestia' ),
					'section'  => 'header_image',
					'priority' => 10,
					'choices'  => $sidebar_choices,
				),
				'Hestia_Customize_Control_Radio_Image'
			)
		);

		$this->add_selective_refresh_to_header_items();
	}

	/**
	 * Change customizer controls.
	 */
	public function change_controls() {
		$this->move_header_image_section();
		$this->move_top_bar_controls();
		$this->move_controls_to_navigation_sidebar();
	}

	/**
	 * Move controls to nav sidebar.
	 */
	private function move_controls_to_navigation_sidebar() {
		$navigation_sidebar = $this->get_customizer_object( 'section', 'sidebar-widgets-header-sidebar' );
		if ( empty( $navigation_sidebar ) ) {
			return;
		}
		$navigation_sidebar->panel = 'hestia_header_options';
		$hestia_header_alignment   = $this->get_customizer_object( 'control', 'hestia_header_alignment' );
		if ( ! empty( $hestia_header_alignment ) ) {

			$hestia_header_alignment->section  = 'sidebar-widgets-header-sidebar';
			$hestia_header_alignment->priority = - 1;
		}
		$hestia_search_in_menu = $this->get_customizer_object( 'control', 'hestia_search_in_menu' );
		if ( ! empty( $hestia_search_in_menu ) ) {
			$hestia_search_in_menu->section  = 'sidebar-widgets-header-sidebar';
			$hestia_search_in_menu->priority = - 1;
		}
	}

	/**
	 * Add selective refresh to header logo and site name.
	 */
	private function add_selective_refresh_to_header_items() {
		$this->get_customizer_object( 'setting', 'blogname' )->transport = 'postMessage';

		$this->add_partial(
			new Hestia_Customizer_Partial(
				'blogname',
				array(
					'selector'        => '.navbar .navbar-brand p',
					'settings'        => array( 'blogname' ),
					'render_callback' => array( $this, 'blog_name_callback' ),
				)
			)
		);

		$this->add_partial(
			new Hestia_Customizer_Partial(
				'custom_logo',
				array(
					'selector'        => '.navbar-brand',
					'settings'        => 'custom_logo',
					'render_callback' => array( $this, 'logo_callback' ),
				)
			)
		);
	}

	/**
	 * Move header image controls.
	 */
	private function move_header_image_section() {

		$this->get_customizer_object( 'setting', 'custom_logo' )->transport = 'postMessage';

		$header_image_section = $this->get_customizer_object( 'section', 'header_image' );

		if ( ! empty( $header_image_section ) ) {
			$header_image_section->title    = esc_html__( 'Header Settings', 'hestia' );
			$header_image_section->panel    = 'hestia_header_options';
			$header_image_section->priority = 20;
		}

		$header_image_control = $this->get_customizer_object( 'control', 'header_image' );
		if ( ! empty( $header_image_control ) ) {
			$header_image_control->priority = 15;
		}

		$header_image_data_control = $this->get_customizer_object( 'control', 'header_image_data' );
		if ( ! empty( $header_image_data_control ) ) {
			$header_image_data_control->priority = 20;
		}
	}

	/**
	 * Move top bar controls.
	 */
	private function move_top_bar_controls() {
		$top_bar_sidebar = $this->get_customizer_object( 'section', 'sidebar-widgets-sidebar-top-bar' );
		if ( ! empty( $top_bar_sidebar ) ) {
			$top_bar_sidebar->panel = 'hestia_header_options';
			$controls_to_move       = array(
				'hestia_top_bar_hide',
				'hestia_link_to_top_menu',
			);
			foreach ( $controls_to_move as $control ) {
				$hestia_control = $this->get_customizer_object( 'control', $control );
				if ( ! empty( $hestia_control ) ) {
					$hestia_control->section  = 'sidebar-widgets-sidebar-top-bar';
					$hestia_control->priority = - 2;
				}
			}
		}
	}

	/**
	 * Add sections.
	 */
	private function add_sections() {
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_navigation',
				array(
					'title'    => esc_html__( 'Navigation', 'hestia' ),
					'panel'    => 'hestia_header_options',
					'priority' => 15,
				)
			)
		);

		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_top_bar',
				array(
					'title'    => esc_html__( 'Very Top Bar', 'hestia' ),
					'panel'    => 'hestia_header_options',
					'priority' => 10,
				)
			)
		);
	}

	/**
	 * Blog name callback function
	 *
	 * @return void
	 */
	public function blog_name_callback() {
		bloginfo( 'name' );
	}

	/**
	 * Custom logo callback function.
	 *
	 * @return string
	 */
	public function logo_callback() {
		if ( get_theme_mod( 'custom_logo' ) ) {
			$logo = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' );
			$logo = '<img src="' . esc_url( $logo[0] ) . '">';
		} else {
			$logo = '<p>' . get_bloginfo( 'name' ) . '</p>';
		}

		return $logo;
	}
}
general/class-hestia-blog-settings-controls.php000066600000003112151123453750015701 0ustar00<?php
/**
 * Customizer blog settings controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Blog_Settings_Controls
 */
class Hestia_Blog_Settings_Controls extends Hestia_Register_Customizer_Controls {

	/**
	 * Add controls
	 */
	public function add_controls() {
		$this->add_blog_settings_section();
		$this->add_featured_posts_category_dropdown();
	}

	/**
	 * Add blog settings section
	 */
	private function add_blog_settings_section() {
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_blog_layout',
				array(
					'title'    => apply_filters( 'hestia_blog_layout_control_label', esc_html__( 'Blog Settings', 'hestia' ) ),
					'priority' => 30,
				)
			)
		);
	}

	/**
	 * Add category dropdown control
	 */
	private function add_featured_posts_category_dropdown() {
		$options    = array(
			0 => ' -- ' . esc_html__( 'Disable section', 'hestia' ) . ' -- ',
		);
		$categories = get_categories();
		if ( ! empty( $categories ) ) {
			foreach ( $categories as $category ) {
				$cat_id             = $category->term_id;
				$cat_name           = $category->name;
				$options[ $cat_id ] = $cat_name;
			}
		}

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_featured_posts_category',
				array(
					'sanitize_callback' => 'hestia_sanitize_array',
					'default'           => apply_filters( 'hestia_featured_posts_category_default', 0 ),
				),
				array(
					'type'     => 'select',
					'section'  => 'hestia_blog_layout',
					'label'    => esc_html__( 'Featured Posts', 'hestia' ),
					'choices'  => $options,
					'priority' => 10,
				)
			)
		);
	}
}
general/class-hestia-typography-controls.php000066600000027032151123453750015335 0ustar00<?php
/**
 * Customizer typography controls.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Typography_Controls
 */
class Hestia_Typography_Controls extends Hestia_Register_Customizer_Controls {
	/**
	 * Initialize the scripts and anything needed.
	 */
	public function init() {
		parent::init();
		add_action( 'customize_preview_init', array( $this, 'enqueue_customizer_script' ) );
	}

	/**
	 * Add controls
	 */
	public function add_controls() {
		$this->add_typography_section();
		$this->add_section_ui_tabs();
		$this->add_font_family_selectors();
		$this->add_font_subsets_control();
		$this->add_section_ui_headings();
		$this->add_posts_pages_controls();
		$this->add_front_page_controls();
	}

	/**
	 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
	 *
	 * @since 1.1.38
	 */
	public function enqueue_customizer_script() {
		wp_enqueue_script( 'hestia_customizer_typography', get_template_directory_uri() . '/assets/js/admin/typography-customizer-preview.js', array( 'customize-preview' ), HESTIA_VERSION, true );
	}

	/**
	 * Add the customizer section.
	 */
	private function add_typography_section() {
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_typography', array(
					'title'    => esc_html__( 'Typography', 'hestia' ),
					'panel'    => 'hestia_appearance_settings',
					'priority' => 25,
				)
			)
		);
	}

	/**
	 * Add ui tabs
	 */
	private function add_section_ui_tabs() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_typography_tabs', array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section'  => 'hestia_typography',
					'priority' => 1,
					'tabs'     => array(
						'font_family' => array(
							'label' => esc_html__( 'font family', 'hestia' ),
							'icon'  => 'font',
						),
						'font_sizes'  => array(
							'label' => esc_html__( 'font size', 'hestia' ),
							'icon'  => 'text-height',
						),
					),
					'controls' => array(
						'font_family' => array(
							'hestia_headings_font' => array(),
							'hestia_body_font'     => array(),
							'hestia_font_subsets'  => array(),
						),
						'font_sizes'  => array(
							'hestia_posts_and_pages_title' => array(),
							'hestia_header_titles_fs'      => array(),
							'hestia_post_page_headings_fs' => array(),
							'hestia_post_page_content_fs'  => array(),

							'hestia_frontpage_sections_title' => array(),
							'hestia_big_title_fs'          => array(),
							'hestia_section_primary_headings_fs' => array(),
							'hestia_section_secondary_headings_fs' => array(),
							'hestia_section_content_fs'    => array(),

							'hestia_generic_title'         => array(),
							'hestia_menu_fs'               => array(),
						),
					),
				),
				'Hestia_Customize_Control_Tabs'
			)
		);
	}

	/**
	 *
	 * ---------------------------------
	 * 1.a. Headings font family control
	 * This control allows the user to choose a font family for all Headings used in the theme ( h1 - h6 )
	 * ---------------------------------
	 * 1.b. Body font family control
	 * This control allows the user to choose a font family for all elements in the body tag
	 * --------------------------------
	 */
	private function add_font_family_selectors() {

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_headings_font', array(
					'type'              => 'theme_mod',
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'label'    => esc_html__( 'Headings', 'hestia' ) . ' ' . esc_html__( 'font family', 'hestia' ),
					'section'  => 'hestia_typography',
					'priority' => 5,
					'type'     => 'select',
				),
				'Hestia_Font_Selector'
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_body_font',
				array(
					'type'              => 'theme_mod',
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'label'    => esc_html__( 'Body', 'hestia' ) . ' ' . esc_html__( 'font family', 'hestia' ),
					'section'  => 'hestia_typography',
					'priority' => 10,
					'type'     => 'select',
				),
				'Hestia_Font_Selector'
			)
		);
	}

	/**
	 * This control allows the user to choose a subset for the font family ( for e.g. lating, cyrillic etc )
	 */
	private function add_font_subsets_control() {

		/**
		 * Font Subsets control
		 */
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_font_subsets', array(
					'sanitize_callback' => 'hestia_sanitize_array',
					'default'           => array( 'latin' ),
				),
				array(
					'section'  => 'hestia_typography',
					'label'    => esc_html__( 'Font Subsets', 'hestia' ),
					'choices'  => array(
						'latin'        => 'latin',
						'latin-ext'    => 'latin-ext',
						'cyrillic'     => 'cyrillic',
						'cyrillic-ext' => 'cyrillic-ext',
						'greek'        => 'greek',
						'greek-ext'    => 'greek-ext',
						'vietnamese'   => 'vietnamese',
					),
					'priority' => 45,
				),
				'Hestia_Select_Multiple'
			)
		);
	}

	/**
	 * Add headings
	 */
	private function add_section_ui_headings() {
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_posts_and_pages_title',
				array(
					'sanitize_callback' => 'wp_kses',
				),
				array(
					'label'    => esc_html__( 'Posts & Pages', 'hestia' ),
					'section'  => 'hestia_typography',
					'priority' => 100,
				),
				'Hestia_Customizer_Heading'
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_frontpage_sections_title',
				array(
					'sanitize_callback' => 'wp_kses',
				),
				array(
					'label'    => esc_html__( 'Frontpage Sections', 'hestia' ),
					'section'  => 'hestia_typography',
					'priority' => 200,
				),
				'Hestia_Customizer_Heading'
			)
		);
	}

	/**
	 * Font size controls for Posts & Pages
	 */
	private function add_posts_pages_controls() {
		/**
		 * Title control [Posts & Pages]
		 * This control allows the user to choose a font size for the main titles
		 * that appear in the header for pages and posts.
		 *
		 * The values area between -25 and +25 px.
		 */
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_header_titles_fs', array(
					'sanitize_callback' => 'hestia_sanitize_range_value',
					'default'           => '0',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'       => esc_html__( 'Title', 'hestia' ),
					'section'     => 'hestia_typography',
					'type'        => 'range-value',
					'input_attr'  => array(
						'min'  => - 25,
						'max'  => 25,
						'step' => 1,
					),
					'priority'    => 110,
					'media_query' => true,
					'sum_type'    => true,
				),
				'Hestia_Customizer_Range_Value_Control'
			)
		);

		/**
		 * Headings control [Posts & Pages]
		 *
		 * This control allows the user to choose a font size for all headings
		 * ( h1 - h6 ) from pages and posts.
		 *
		 * The values area between -25 and +25 px.
		 */
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_post_page_headings_fs', array(
					'sanitize_callback' => 'hestia_sanitize_range_value',
					'default'           => 0,
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'      => esc_html__( 'Headings', 'hestia' ),
					'section'    => 'hestia_typography',
					'type'       => 'range-value',
					'input_attr' => array(
						'min'  => -25,
						'max'  => 25,
						'step' => 1,
					),
					'priority'   => 115,
					'sum_type'   => true,
				),
				'Hestia_Customizer_Range_Value_Control'
			)
		);

		/**
		 * Content control [Posts & Pages]
		 *
		 * This control allows the user to choose a font size for the main content
		 * area in pages and posts.
		 *
		 * The values area between -25 and +25 px.
		 */
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_post_page_content_fs',
				array(
					'sanitize_callback' => 'hestia_sanitize_range_value',
					'default'           => 0,
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'      => esc_html__( 'Content', 'hestia' ),
					'section'    => 'hestia_typography',
					'type'       => 'range-value',
					'input_attr' => array(
						'min'  => -25,
						'max'  => 25,
						'step' => 1,
					),
					'priority'   => 120,
					'sum_type'   => true,
				),
				'Hestia_Customizer_Range_Value_Control'
			)
		);
	}

	/**
	 * Font size controls for Front Page
	 */
	private function add_front_page_controls() {
		/**
		 * Big Title Section / Header Slider font size control. [Front Page Sections]
		 *
		 * This is changing the big title/slider titles, the
		 * subtitle and the button in the big title section.
		 *
		 * The values are between -25 and +25 px.
		 */
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_big_title_fs', array(
					'sanitize_callback' => 'hestia_sanitize_range_value',
					'default'           => '0',
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'      => apply_filters( 'hestia_big_title_fs_label', esc_html__( 'Big Title Section', 'hestia' ) ),
					'section'    => 'hestia_typography',
					'type'       => 'range-value',
					'input_attr' => array(
						'min'  => -25,
						'max'  => 25,
						'step' => 1,
					),
					'priority'   => 210,
					'sum_type'   => true,
				),
				'Hestia_Customizer_Range_Value_Control'
			)
		);

		/**
		 * Section Title [Front Page Sections]
		 *
		 * This control is changing sections titles and card titles
		 * The values are between -25 and +25 px.
		 */
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_section_primary_headings_fs',
				array(
					'sanitize_callback' => 'hestia_sanitize_range_value',
					'default'           => '0',
					'transport'         => 'postMessage',
				),
				array(
					'label'      => esc_html__( 'Section Title', 'hestia' ),
					'section'    => 'hestia_typography',
					'type'       => 'range-value',
					'input_attr' => array(
						'min'  => -25,
						'max'  => 25,
						'step' => 1,
					),
					'priority'   => 215,
					'sum_type'   => true,
				),
				'Hestia_Customizer_Range_Value_Control'
			)
		);

		/**
		 * Subtitles control [Front Page Sections]
		 *
		 * This control allows the user to choose a font size
		 * for all Subtitles on Front Page sections.
		 * The values area between -25 and +25 px.
		 */
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_section_secondary_headings_fs',
				array(
					'sanitize_callback' => 'hestia_sanitize_range_value',
					'default'           => 0,
					'transport'         => $this->selective_refresh,
				),
				array(
					'label'      => esc_html__( 'Section Subtitle', 'hestia' ),
					'section'    => 'hestia_typography',
					'type'       => 'range-value',
					'input_attr' => array(
						'min'  => -25,
						'max'  => 25,
						'step' => 1,
					),
					'priority'   => 220,
					'sum_type'   => true,
				),
				'Hestia_Customizer_Range_Value_Control'
			)
		);

		/**
		 * Content control [Front Page Sections]
		 *
		 * This control allows the user to choose a font size
		 * for the Main content for Frontpage Sections
		 * The values area between -25 and +25 px.
		 */
		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_section_content_fs',
				array(
					'sanitize_callback' => 'hestia_sanitize_range_value',
					'default'           => 0,
					'transport'         => 'postMessage',
				),
				array(
					'label'      => esc_html__( 'Content', 'hestia' ),
					'section'    => 'hestia_typography',
					'type'       => 'range-value',
					'input_attr' => array(
						'min'  => -25,
						'max'  => 25,
						'step' => 1,
					),
					'priority'   => 225,
					'sum_type'   => true,
				),
				'Hestia_Customizer_Range_Value_Control'
			)
		);
	}

}
general/class-hestia-upsell-manager.php000066600000010442151123453750014177 0ustar00<?php
/**
 * Upsell Manager
 *
 * @package Hestia
 */

/**
 * Class Hestia_Upsell_Manager
 */
class Hestia_Upsell_Manager extends Hestia_Register_Customizer_Controls {
	/**
	 * Add the controls.
	 */
	public function add_controls() {
		if ( ! $this->should_display_upsells() ) {
			return;
		}

		$this->register_type( 'Hestia_Section_Upsell', 'section' );
		$this->register_type( 'Hestia_Control_Upsell', 'control' );
		$this->add_main_upsell();
		$this->add_front_page_sections_upsells();
	}

	/**
	 * Change controls
	 */
	public function change_controls() {
		$this->change_customizer_object( 'section', 'hestia_front_page_sections_upsell_section', 'active_callback', '__return_true' );
	}

	/**
	 * Adds main
	 */
	private function add_main_upsell() {
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_upsell_main_section',
				array(
					'title'    => esc_html__( 'View PRO Features', 'hestia' ),
					'priority' => 0,
				)
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_upsell_main_control',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section'            => 'hestia_upsell_main_section',
					'priority'           => 100,
					'options'            => array(
						esc_html__( 'Header Slider', 'hestia' ),
						esc_html__( 'Fully Customizable Colors', 'hestia' ),
						esc_html__( 'Jetpack Portfolio', 'hestia' ),
						esc_html__( 'Pricing Plans Section', 'hestia' ),
						esc_html__( 'Section Reordering', 'hestia' ),
						esc_html__( 'Quality Support', 'hestia' ),
					),
					'explained_features' => array(
						esc_html__( 'You will be able to add more content to your site header with an awesome slider.', 'hestia' ),
						esc_html__( 'Change colors for the header overlay, header text and navbar.', 'hestia' ),
						esc_html__( 'Portfolio section with two possible layouts.', 'hestia' ),
						esc_html__( 'A fully customizable pricing plans section.', 'hestia' ),
						esc_html__( 'Drag and drop panels to change the order of sections.', 'hestia' ),
						esc_html__( 'The ability to reorganize your Frontpage Sections more easily and quickly.', 'hestia' ),
						esc_html__( '24/7 HelpDesk Professional Support', 'hestia' ),
					),
					'button_url'         => esc_url( apply_filters( 'hestia_upgrade_link_from_child_theme_filter', 'https://themeisle.com/themes/hestia-pro/upgrade/' ) ),
					'button_text'        => esc_html__( 'Get the PRO version!', 'hestia' ),
				),
				'Hestia_Control_Upsell'
			)
		);
	}

	/**
	 * Add upsell section under Front Page Sections panel.
	 */
	private function add_front_page_sections_upsells() {
		$this->add_section(
			new Hestia_Customizer_Section(
				'hestia_front_page_sections_upsell_section',
				array(
					'panel'              => 'hestia_frontpage_sections',
					'priority'           => 500,
					'options'            => array(
						esc_html__( 'Jetpack Portfolio', 'hestia' ),
						esc_html__( 'Pricing Plans Section', 'hestia' ),
						esc_html__( 'Section Reordering', 'hestia' ),
					),

					'button_url'         => esc_url( apply_filters( 'hestia_upgrade_link_from_child_theme_filter', 'https://themeisle.com/themes/hestia-pro/upgrade/' ) ),
					'button_text'        => esc_html__( 'Get the PRO version!', 'hestia' ),
					'explained_features' => array(
						esc_html__( 'Portfolio section with two possible layouts.', 'hestia' ),
						esc_html__( 'A fully customizable pricing plans section.', 'hestia' ),
						esc_html__( 'The ability to reorganize your Frontpage sections more easily and quickly.', 'hestia' ),
					),
				),
				'Hestia_Section_Upsell'
			)
		);

		$this->add_control(
			new Hestia_Customizer_Control(
				'hestia_control_to_enable_upsell_section',
				array(
					'sanitize_callback' => 'sanitize_text_field',
				),
				array(
					'section' => 'hestia_front_page_sections_upsell_section',
					'type'    => 'hidden',
				)
			)
		);
	}

	/**
	 * Check if should display upsell.
	 *
	 * @since 1.1.45
	 * @access public
	 * @return bool
	 */
	private function should_display_upsells() {
		$current_time    = time();
		$show_after      = 12 * HOUR_IN_SECONDS;
		$activation_time = get_option( 'hestia_time_activated' );

		if ( empty( $activation_time ) ) {
			return false;
		}

		if ( $current_time < $activation_time + $show_after ) {
			return false;
		}

		return true;
	}
}
class-hestia-customizer-panel.php000066600000001067151135133420013142 0ustar00<?php
/**
 * Customizer panel type enforcement
 *
 * @package Hestia
 */

/**
 * Class Hestia_Customizer_Panel
 */
class Hestia_Customizer_Panel {
	/**
	 * ID of panel
	 *
	 * @var string the control ID.
	 */
	public $id;

	/**
	 * Args for panel instance.
	 *
	 * @var array args passed into panel instance.
	 */
	public $args = array();

	/**
	 * Hestia_Customizer_Panel constructor.
	 *
	 * @param string $id the control id.
	 * @param array  $args the panel args.
	 */
	public function __construct( $id, $args ) {
		$this->id   = $id;
		$this->args = $args;
	}
}
class-hestia-customizer-control.php000066600000002515151135133420013522 0ustar00<?php
/**
 * Customizer control type enforcement.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Customizer_Control
 */
class Hestia_Customizer_Control {
	/**
	 * Control ID
	 *
	 * @var string the control ID.
	 */
	public $id;

	/**
	 * Setting arguments.
	 *
	 * @var array args passed into settings.
	 */
	public $setting_args = array();

	/**
	 * Control arguments.
	 *
	 * @var array args passed into controls.
	 */
	public $control_args = array();

	/**
	 * Custom control if applies.
	 *
	 * @var null|string
	 */
	public $custom_control = null;

	/**
	 * The Partials array
	 *
	 * @var null|array
	 */
	public $partial = null;

	/**
	 * Hestia_Customizer_Control constructor.
	 *
	 * @param string $id the control id.
	 * @param array  $setting_args the add_setting array.
	 * @param array  $control_args the add_control array.
	 * @param string $custom_control [optional] this should be added if the control is a custom control.
	 * @param array  $partial [optional] this should be added if the control is a selective refresh control..
	 */
	public function __construct( $id, $setting_args, $control_args, $custom_control = null, $partial = null ) {
		$this->id             = $id;
		$this->setting_args   = $setting_args;
		$this->control_args   = $control_args;
		$this->custom_control = $custom_control;
		$this->partial        = $partial;
	}
}
class-hestia-customizer-partial.php000066600000001221151135133420013467 0ustar00<?php
/**
 * Customizer partial type enforcing.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Customizer_Partial
 */
class Hestia_Customizer_Partial {
	/**
	 * ID of control that will be attached to. Also ID of the partial itself.
	 *
	 * @var string the control ID.
	 */
	public $control_id;

	/**
	 * Args for the partial.
	 *
	 * @var array args passed into partial.
	 */
	public $args = array();

	/**
	 * Hestia_Customizer_Partial constructor.
	 *
	 * @param string $control_id the control id.
	 * @param array  $args the partial args.
	 */
	public function __construct( $control_id, $args ) {
		$this->id   = $control_id;
		$this->args = $args;
	}
}
class-hestia-customizer-section.php000066600000001565151135133420013512 0ustar00<?php
/**
 * Customizer Section type Enforcing.
 *
 * @package Hestia
 */

/**
 * Class Hestia_Customizer_Section
 */
class Hestia_Customizer_Section {
	/**
	 * ID of section
	 *
	 * @var string the control ID.
	 */
	public $id;

	/**
	 * Args for section instance.
	 *
	 * @var array args passed into section.
	 */
	public $args = array();

	/**
	 * Custom section ( string of class name | null)
	 *
	 * @var null|string
	 */
	public $custom_section = null;

	/**
	 * Hestia_Customizer_Section constructor.
	 *
	 * @param string $id the control id.
	 * @param array  $args the add_section array.
	 * @param string $custom_section [optional] this should be added if the section is a custom section.
	 */
	public function __construct( $id, $args, $custom_section = null ) {
		$this->id             = $id;
		$this->args           = $args;
		$this->custom_section = $custom_section;
	}
}
text_mode_light.svg000066600000002142151136642150010453 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="150px" height="150px" viewBox="0 0 150 150" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>text_mode_light</title>
    <desc>Created with Sketch.</desc>
    <defs>
        <rect id="path-1" x="0" y="0" width="150" height="150" rx="6"></rect>
    </defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-230.000000, -416.000000)">
        <g id="text_mode_light" transform="translate(230.000000, 416.000000)">
            <g id="wrapper">
                <use fill="#0085BA" fill-rule="evenodd" xlink:href="#path-1"></use>
                <rect stroke="#0085BA" stroke-width="1" x="0.5" y="0.5" width="149" height="149" rx="6"></rect>
            </g>
            <text id="Text" font-family="AvenirNext-Medium, Avenir Next" font-size="48" font-weight="400" fill="#FFFFFF">
                <tspan x="30.476" y="86">Text</tspan>
            </text>
        </g>
    </g>
</svg>wc-layout-left-grid.svg000066600000013715151136642150011103 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
    <title>wc-layout-left-grid</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="wc-layout-left-grid" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <rect id="Wrapper" stroke="#0085BA" fill="#FFFFFF" fill-rule="nonzero" x="0.5" y="0.5" width="99" height="99"></rect>
        <g id="Image-1" transform="translate(7.000000, 8.000000)" fill-rule="nonzero">
            <rect id="Rectangle" fill="#0085BA" x="0" y="0" width="28" height="40"></rect>
            <path d="M17.2086808,17 L11.7917176,17 C11.3550743,17 11,17.3245641 11,17.7242912 L11,22.276523 C11,22.6757788 11.3550743,23 11.7917176,23 L17.2086573,23 C17.6453006,23 18,22.6757788 18,22.276523 L18,17.7242912 C18.0000234,17.3245641 17.645324,17 17.2086808,17 Z M15.5265709,18.0771593 C15.9488265,18.0771593 16.2912707,18.3903032 16.2912707,18.7763819 C16.2912707,19.1624606 15.9488031,19.4756045 15.5265709,19.4756045 C15.1041981,19.4756045 14.7618711,19.1624606 14.7618711,18.7763819 C14.7618711,18.3903032 15.1041981,18.0771593 15.5265709,18.0771593 Z M16.9603888,22.3308169 L14.4999414,22.3308169 L12.1491117,22.3308169 C11.9379136,22.3308169 11.8438551,22.1910967 11.9390618,22.0187229 L13.2514286,19.6419146 C13.3465181,19.4695623 13.5277459,19.4541783 13.6560863,19.6075256 L14.9757171,21.1844082 C15.1040575,21.3377769 15.3283779,21.3508254 15.4768469,21.2134192 L15.799678,20.9145023 C15.9480298,20.7770961 16.1666092,20.7941085 16.2876855,20.9522553 L17.1236438,22.044113 C17.2444858,22.2024954 17.171587,22.3308169 16.9603888,22.3308169 Z" id="Shape" fill-opacity="0.6" fill="#FFFFFF"></path>
        </g>
        <g id="Image-1-Copy-3" transform="translate(7.000000, 52.000000)" fill-rule="nonzero">
            <rect id="Rectangle" fill="#0085BA" x="0" y="0" width="28" height="41"></rect>
            <path d="M17.2086808,17 L11.7917176,17 C11.3550743,17 11,17.3245641 11,17.7242912 L11,22.276523 C11,22.6757788 11.3550743,23 11.7917176,23 L17.2086573,23 C17.6453006,23 18,22.6757788 18,22.276523 L18,17.7242912 C18.0000234,17.3245641 17.645324,17 17.2086808,17 Z M15.5265709,18.0771593 C15.9488265,18.0771593 16.2912707,18.3903032 16.2912707,18.7763819 C16.2912707,19.1624606 15.9488031,19.4756045 15.5265709,19.4756045 C15.1041981,19.4756045 14.7618711,19.1624606 14.7618711,18.7763819 C14.7618711,18.3903032 15.1041981,18.0771593 15.5265709,18.0771593 Z M16.9603888,22.3308169 L14.4999414,22.3308169 L12.1491117,22.3308169 C11.9379136,22.3308169 11.8438551,22.1910967 11.9390618,22.0187229 L13.2514286,19.6419146 C13.3465181,19.4695623 13.5277459,19.4541783 13.6560863,19.6075256 L14.9757171,21.1844082 C15.1040575,21.3377769 15.3283779,21.3508254 15.4768469,21.2134192 L15.799678,20.9145023 C15.9480298,20.7770961 16.1666092,20.7941085 16.2876855,20.9522553 L17.1236438,22.044113 C17.2444858,22.2024954 17.171587,22.3308169 16.9603888,22.3308169 Z" id="Shape" fill-opacity="0.6" fill="#FFFFFF"></path>
        </g>
        <g id="Image-1-Copy" transform="translate(38.000000, 8.000000)" fill-rule="nonzero">
            <rect id="Rectangle" fill="#0085BA" x="0" y="0" width="28" height="40"></rect>
            <path d="M17.2086808,17 L11.7917176,17 C11.3550743,17 11,17.3245641 11,17.7242912 L11,22.276523 C11,22.6757788 11.3550743,23 11.7917176,23 L17.2086573,23 C17.6453006,23 18,22.6757788 18,22.276523 L18,17.7242912 C18.0000234,17.3245641 17.645324,17 17.2086808,17 Z M15.5265709,18.0771593 C15.9488265,18.0771593 16.2912707,18.3903032 16.2912707,18.7763819 C16.2912707,19.1624606 15.9488031,19.4756045 15.5265709,19.4756045 C15.1041981,19.4756045 14.7618711,19.1624606 14.7618711,18.7763819 C14.7618711,18.3903032 15.1041981,18.0771593 15.5265709,18.0771593 Z M16.9603888,22.3308169 L14.4999414,22.3308169 L12.1491117,22.3308169 C11.9379136,22.3308169 11.8438551,22.1910967 11.9390618,22.0187229 L13.2514286,19.6419146 C13.3465181,19.4695623 13.5277459,19.4541783 13.6560863,19.6075256 L14.9757171,21.1844082 C15.1040575,21.3377769 15.3283779,21.3508254 15.4768469,21.2134192 L15.799678,20.9145023 C15.9480298,20.7770961 16.1666092,20.7941085 16.2876855,20.9522553 L17.1236438,22.044113 C17.2444858,22.2024954 17.171587,22.3308169 16.9603888,22.3308169 Z" id="Shape" fill-opacity="0.6" fill="#FFFFFF"></path>
        </g>
        <g id="Image-1-Copy-2" transform="translate(38.000000, 52.000000)" fill-rule="nonzero">
            <rect id="Rectangle" fill="#0085BA" x="0" y="0" width="28" height="41"></rect>
            <path d="M17.2086808,17 L11.7917176,17 C11.3550743,17 11,17.3245641 11,17.7242912 L11,22.276523 C11,22.6757788 11.3550743,23 11.7917176,23 L17.2086573,23 C17.6453006,23 18,22.6757788 18,22.276523 L18,17.7242912 C18.0000234,17.3245641 17.645324,17 17.2086808,17 Z M15.5265709,18.0771593 C15.9488265,18.0771593 16.2912707,18.3903032 16.2912707,18.7763819 C16.2912707,19.1624606 15.9488031,19.4756045 15.5265709,19.4756045 C15.1041981,19.4756045 14.7618711,19.1624606 14.7618711,18.7763819 C14.7618711,18.3903032 15.1041981,18.0771593 15.5265709,18.0771593 Z M16.9603888,22.3308169 L14.4999414,22.3308169 L12.1491117,22.3308169 C11.9379136,22.3308169 11.8438551,22.1910967 11.9390618,22.0187229 L13.2514286,19.6419146 C13.3465181,19.4695623 13.5277459,19.4541783 13.6560863,19.6075256 L14.9757171,21.1844082 C15.1040575,21.3377769 15.3283779,21.3508254 15.4768469,21.2134192 L15.799678,20.9145023 C15.9480298,20.7770961 16.1666092,20.7941085 16.2876855,20.9522553 L17.1236438,22.044113 C17.2444858,22.2024954 17.171587,22.3308169 16.9603888,22.3308169 Z" id="Shape" fill-opacity="0.6" fill="#FFFFFF"></path>
        </g>
        <rect id="Rectangle-6-Copy-2" fill="#D8D8D8" fill-rule="nonzero" x="70" y="8" width="24" height="26"></rect>
        <rect id="Rectangle-6-Copy-3" fill="#D8D8D8" fill-rule="nonzero" x="70" y="37" width="24" height="56"></rect>
    </g>
</svg>wc-layout-default.svg000066600000005500151136642150010643 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
    <title>wc-layout-default</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="wc-layout-default" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <rect id="Wrapper" stroke="#0085BA" fill="#FFFFFF" fill-rule="nonzero" x="0.5" y="0.5" width="99" height="99"></rect>
        <g id="Large-Slider" transform="translate(6.000000, 7.000000)" fill-rule="nonzero">
            <g id="Group">
                <rect id="Rectangle-2" fill="#0085BA" x="0" y="0" width="54" height="38"></rect>
                <g id="image_icon" transform="translate(23.000000, 15.000000)" fill="#FFFFFF" fill-opacity="0.6">
                    <path d="M7.98258957,0 L1.0179226,0 C0.456524141,0 0,0.445116434 0,0.993313699 L0,7.23637434 C0,7.78392515 0.456524141,8.22857143 1.0179226,8.22857143 L7.98255944,8.22857143 C8.5439579,8.22857143 9,7.78392515 9,7.23637434 L9,0.993313699 C9.00003013,0.445116434 8.54398803,0 7.98258957,0 Z M5.81987688,1.47724706 C6.36277697,1.47724706 6.80306231,1.90670155 6.80306231,2.43618089 C6.80306231,2.96566023 6.36274684,3.39511472 5.81987688,3.39511472 C5.27682615,3.39511472 4.83669145,2.96566023 4.83669145,2.43618089 C4.83669145,1.90670155 5.27682615,1.47724706 5.81987688,1.47724706 Z M7.66335709,7.31083467 L4.49992468,7.31083467 L1.47742938,7.31083467 C1.20588895,7.31083467 1.0849566,7.11921833 1.2073652,6.88282001 L2.89469385,3.62319723 C3.01695182,3.3868283 3.24995899,3.36573022 3.41496808,3.5760351 L5.1116363,5.7386169 C5.27664539,5.94895116 5.56505729,5.96684632 5.75594602,5.77840351 L6.17101453,5.36846033 C6.36175263,5.18001752 6.64278326,5.20334881 6.79845278,5.42023582 L7.87325636,6.91764065 C8.02862461,7.13485089 7.93489752,7.31083467 7.66335709,7.31083467 Z" id="Shape"></path>
                </g>
            </g>
            <circle id="Oval" fill-opacity="0.5" fill="#FFFFFF" cx="51" cy="20" r="2"></circle>
            <circle id="Oval-Copy" fill-opacity="0.5" fill="#FFFFFF" cx="4" cy="20" r="2"></circle>
        </g>
        <rect id="Rectangle-5" fill="#0085BA" fill-rule="nonzero" x="6" y="48" width="6" height="6" rx="0.5"></rect>
        <rect id="Rectangle-5-Copy" fill="#0085BA" fill-rule="nonzero" x="15" y="48" width="6" height="6" rx="0.5"></rect>
        <rect id="Rectangle-5-Copy-2" fill="#0085BA" fill-rule="nonzero" x="24" y="48" width="6" height="6" rx="0.5"></rect>
        <rect id="Rectangle-6" fill="#D8D8D8" fill-rule="nonzero" x="6" y="57" width="54" height="36"></rect>
        <rect id="Rectangle-6-Copy" fill="#D8D8D8" fill-rule="nonzero" x="64" y="7" width="30" height="86"></rect>
    </g>
</svg>wc-layout-top-medium.svg000066600000005753151136642150011311 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
    <title>wc-layout-top-medium</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="wc-layout-top-medium" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <rect id="Wrapper" stroke="#0085BA" fill="#FFFFFF" fill-rule="nonzero" x="0.5" y="0.5" width="99" height="99"></rect>
        <g id="Large-Slider" transform="translate(1.000000, 1.000000)" fill-rule="nonzero">
            <rect id="Rectangle" fill="#D8D8D8" x="0" y="0" width="98" height="53"></rect>
            <g id="Group" transform="translate(19.000000, 6.000000)">
                <rect id="Rectangle-2" fill="#0085BA" x="0" y="0" width="60" height="35"></rect>
                <g id="image_icon" transform="translate(25.000000, 13.000000)" fill="#FFFFFF" fill-opacity="0.6">
                    <path d="M8.86954397,0 L1.13102511,0 C0.507249045,0 0,0.486846099 0,1.08643686 L0,7.91478443 C0,8.51366813 0.507249045,9 1.13102511,9 L8.86951049,9 C9.49328656,9 10,8.51366813 10,7.91478443 L10,1.08643686 C10.0000335,0.486846099 9.49332003,0 8.86954397,0 Z M6.46652986,1.61573897 C7.06975218,1.61573897 7.55895812,2.08545482 7.55895812,2.66457285 C7.55895812,3.24369088 7.06971871,3.71340673 6.46652986,3.71340673 C5.86314017,3.71340673 5.37410161,3.24369088 5.37410161,2.66457285 C5.37410161,2.08545482 5.86314017,1.61573897 6.46652986,1.61573897 Z M8.51484121,7.99622542 L4.99991631,7.99622542 L1.6415882,7.99622542 C1.33987661,7.99622542 1.20550733,7.78664505 1.34151689,7.52808439 L3.2163265,3.96287197 C3.35216869,3.70434345 3.61106555,3.68126743 3.79440898,3.91128839 L5.67959589,6.27661223 C5.86293932,6.50666533 6.18339699,6.52623817 6.39549558,6.32012884 L6.85668281,5.87175348 C7.06861403,5.66564416 7.38087029,5.69116276 7.55383642,5.92838293 L8.74806263,7.56616946 C8.92069401,7.80374316 8.8165528,7.99622542 8.51484121,7.99622542 Z" id="Shape"></path>
                </g>
            </g>
            <circle id="Oval" fill-opacity="0.5" fill="#FFFFFF" cx="75" cy="23" r="2"></circle>
            <circle id="Oval-Copy" fill-opacity="0.5" fill="#FFFFFF" cx="23" cy="23" r="2"></circle>
        </g>
        <rect id="Rectangle-5" fill-opacity="0.8" fill="#FFFFFF" fill-rule="nonzero" x="38" y="45" width="6" height="6" rx="0.5"></rect>
        <rect id="Rectangle-5-Copy" fill-opacity="0.8" fill="#FFFFFF" fill-rule="nonzero" x="47" y="45" width="6" height="6" rx="0.5"></rect>
        <rect id="Rectangle-5-Copy-2" fill-opacity="0.8" fill="#FFFFFF" fill-rule="nonzero" x="56" y="45" width="6" height="6" rx="0.5"></rect>
        <rect id="Rectangle-6" fill="#D8D8D8" fill-rule="nonzero" x="7" y="60" width="48" height="33"></rect>
        <rect id="Rectangle-6-Copy" fill="#D8D8D8" fill-rule="nonzero" x="59" y="60" width="34" height="33"></rect>
    </g>
</svg>wc-layout-top-full.svg000066600000005346151136642150010771 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
    <title>wc-layout-top-full</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="wc-layout-top-full" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <rect id="Wrapper" stroke="#0085BA" fill="#FFFFFF" fill-rule="nonzero" x="0.5" y="0.5" width="99" height="99"></rect>
        <g id="Large-Slider" fill-rule="nonzero">
            <rect id="Rectangle" fill="#0085BA" x="0" y="0" width="100" height="50"></rect>
            <g id="image_icon" transform="translate(3.000000, 18.000000)" fill="#FFFFFF">
                <path d="M54.0782247,0 L40.9227427,0 C39.8623234,0 39,0.811410165 39,1.8107281 L39,13.1913074 C39,14.1894469 39.8623234,15 40.9227427,15 L54.0781678,15 C55.1385871,15 56,14.1894469 56,13.1913074 L56,1.8107281 C56.0000569,0.811410165 55.1386441,0 54.0782247,0 Z M49.9931008,2.69289829 C51.0185787,2.69289829 51.8502288,3.47575804 51.8502288,4.44095475 C51.8502288,5.40615146 51.0185218,6.18901122 49.9931008,6.18901122 C48.9673383,6.18901122 48.1359727,5.40615146 48.1359727,4.44095475 C48.1359727,3.47575804 48.9673383,2.69289829 49.9931008,2.69289829 Z M53.4752301,13.3270424 L47.4998577,13.3270424 L41.7906999,13.3270424 C41.2777902,13.3270424 41.0493625,12.9777418 41.2805787,12.5468073 L44.4677551,6.60478661 C44.6986868,6.17390575 45.1388114,6.13544572 45.4504953,6.51881399 L48.655313,10.4610204 C48.9669968,10.8444422 49.5117749,10.8770636 49.8723425,10.5335481 L50.6563608,9.78625581 C51.0166438,9.44274027 51.5474795,9.48527127 51.8415219,9.88063822 L53.8717065,12.6102824 C54.1651798,13.0062386 53.9881398,13.3270424 53.4752301,13.3270424 Z" id="Shape" fill-opacity="0.6"></path>
                <circle id="Oval" fill-opacity="0.5" cx="92" cy="6" r="2"></circle>
                <circle id="Oval-Copy" fill-opacity="0.5" cx="2" cy="6" r="2"></circle>
            </g>
        </g>
        <rect id="Rectangle-5" fill-opacity="0.8" fill="#FFFFFF" fill-rule="nonzero" x="73" y="42" width="6" height="6" rx="0.5"></rect>
        <rect id="Rectangle-5-Copy" fill-opacity="0.8" fill="#FFFFFF" fill-rule="nonzero" x="82" y="42" width="6" height="6" rx="0.5"></rect>
        <rect id="Rectangle-5-Copy-2" fill-opacity="0.8" fill="#FFFFFF" fill-rule="nonzero" x="91" y="42" width="6" height="6" rx="0.5"></rect>
        <rect id="Rectangle-6" fill="#D8D8D8" fill-rule="nonzero" x="7" y="56" width="48" height="37"></rect>
        <rect id="Rectangle-6-Copy" fill="#D8D8D8" fill-rule="nonzero" x="59" y="56" width="34" height="37"></rect>
    </g>
</svg>blog_classic_rounded.svg000066600000007362151136642150011451 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>blog_classic_rounded</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-400.000000, 0.000000)">
        <g id="Blog_Layouts">
            <g id="blog_classic_rounded" transform="translate(400.000000, 0.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Post-1" transform="translate(40.000000, 60.000000)" fill="#0085BA">
                    <g id="Rounded-Featured-Image">
                        <rect id="Rectangle-2" x="0" y="0" width="80" height="80" rx="40"></rect>
                    </g>
                    <g id="Group-Copy" transform="translate(100.000000, 20.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy" transform="translate(40.000000, 160.000000)" fill="#0085BA">
                    <g id="Rounded-Featured-Image">
                        <rect id="Rectangle-2" x="0" y="0" width="80" height="80" rx="40"></rect>
                    </g>
                    <g id="Group-Copy" transform="translate(100.000000, 20.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-2" transform="translate(40.000000, 260.000000)" fill="#0085BA">
                    <g id="Rounded-Featured-Image">
                        <rect id="Rectangle-2" x="0" y="0" width="80" height="80" rx="40"></rect>
                    </g>
                    <g id="Group-Copy" transform="translate(100.000000, 20.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>text_mode_dark.svg000066600000001601151136642150010264 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="150px" height="150px" viewBox="0 0 150 150" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>text_mode_dark</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-40.000000, -416.000000)">
        <g id="text_mode_dark" transform="translate(40.000000, 416.000000)">
            <rect id="wrapper" stroke="#0085BA" x="0.5" y="0.5" width="149" height="149" rx="6"></rect>
            <text id="Text" font-family="AvenirNext-Medium, Avenir Next" font-size="48" font-weight="400" fill="#222222">
                <tspan x="30.476" y="86">Text</tspan>
            </text>
        </g>
    </g>
</svg>blog_boxed.svg000066600000012412151136642150007401 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>blog_boxed</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-1200.000000, -400.000000)">
        <g id="Blog_Layouts">
            <g id="blog_boxed" transform="translate(1200.000000, 400.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Post-1" transform="translate(40.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="160" height="80"></rect>
                    </g>
                    <g id="Group-3" transform="translate(20.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="66" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-11" transform="translate(200.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="160" height="80"></rect>
                    </g>
                    <g id="Group-3" transform="translate(20.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="66" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-13" transform="translate(40.000000, 200.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="160" height="80"></rect>
                    </g>
                    <g id="Group-3" transform="translate(20.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="66" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-12" transform="translate(200.000000, 200.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="160" height="80"></rect>
                    </g>
                    <g id="Group-3" transform="translate(20.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="66" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="border" transform="translate(39.000000, 40.000000)" fill="#EEEEEE">
                    <rect id="Rectangle" x="1" y="80" width="2" height="80"></rect>
                    <rect id="Rectangle-Copy" x="161" y="0" width="1" height="318"></rect>
                    <rect id="Rectangle-Copy-2" x="319" y="80" width="2" height="80"></rect>
                    <rect id="Rectangle-Copy-5" x="0" y="240" width="2" height="80"></rect>
                    <rect id="Rectangle-Copy-3" x="319" y="240" width="2" height="80"></rect>
                    <rect id="Rectangle-2" x="1" y="318" width="320" height="2"></rect>
                </g>
            </g>
        </g>
    </g>
</svg>menu_style_1.svg000066600000002046151136642150007703 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>menu_style_1</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop-Copy" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(0.000000, -400.000000)">
        <g id="Nav-Style">
            <g id="menu_style_1" transform="translate(0.000000, 400.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <text id="MENU" font-family="Avenir-Heavy, Avenir" font-size="75" font-weight="600" letter-spacing="1.44230664" fill="#000000">
                    <tspan x="83.0528867" y="218">MENU</tspan>
                </text>
            </g>
        </g>
    </g>
</svg>menu_style_2.svg000066600000002231151136642150007700 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>menu_style_2</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop-Copy" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Nav-Style">
            <g id="menu_style_2">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Blue-Square" transform="translate(40.000000, 2.000000)" fill="#0085BA">
                    <rect id="Rectangle-2" x="0" y="0" width="320" height="398"></rect>
                </g>
                <text id="MENU" font-family="Avenir-Heavy, Avenir" font-size="75" font-weight="600" letter-spacing="1.44230664" fill="#FFFFFF">
                    <tspan x="83.0528867" y="219">MENU</tspan>
                </text>
            </g>
        </g>
    </g>
</svg>menu_style_5.svg000066600000002414151136642150007706 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>menu_style_5</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop-Copy" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-1200.000000, 0.000000)">
        <g id="Nav-Style">
            <g id="menu_style_5" transform="translate(1200.000000, 0.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <text id="MENU" font-family="Avenir-Heavy, Avenir" font-size="75" font-weight="600" letter-spacing="1.44230664" fill="#000000">
                    <tspan x="83.0528867" y="218">MENU</tspan>
                </text>
                <g id="Heading-Line" opacity="0.316802536" transform="translate(78.000000, 204.000000)" fill="#0085BA">
                    <rect id="Rectangle-3" x="0" y="0" width="240" height="29"></rect>
                </g>
            </g>
        </g>
    </g>
</svg>blog_column.svg000066600000005023151136642150007575 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>blog_column</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-800.000000, 0.000000)">
        <g id="Blog_Layouts">
            <g id="blog_column" transform="translate(800.000000, 0.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Post-1" transform="translate(40.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="220" height="80"></rect>
                    </g>
                    <g id="Heading-Line" transform="translate(0.000000, 100.000000)">
                        <rect id="Rectangle-3" x="0" y="0" width="110" height="4"></rect>
                    </g>
                    <g id="Heading-Line" transform="translate(0.000000, 118.000000)">
                        <rect id="Rectangle-3" x="0" y="0" width="220" height="4"></rect>
                    </g>
                    <g id="Heading-Line" transform="translate(0.000000, 136.000000)">
                        <rect id="Rectangle-3" x="0" y="0" width="220" height="4"></rect>
                    </g>
                </g>
                <g id="Post-1-Copy-8" transform="translate(40.000000, 220.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="220" height="80"></rect>
                    </g>
                    <g id="Heading-Line" transform="translate(0.000000, 100.000000)">
                        <rect id="Rectangle-3" x="0" y="0" width="110" height="4"></rect>
                    </g>
                    <g id="Heading-Line" transform="translate(0.000000, 118.000000)">
                        <rect id="Rectangle-3" x="0" y="0" width="220" height="4"></rect>
                    </g>
                    <g id="Heading-Line" transform="translate(0.000000, 136.000000)">
                        <rect id="Rectangle-3" x="0" y="0" width="220" height="4"></rect>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>blog_masonry.svg000066600000010656151136642150010000 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>blog_masonry</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-800.000000, -400.000000)">
        <g id="Blog_Layouts">
            <g id="blog_masonry" transform="translate(800.000000, 400.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Post-1" transform="translate(40.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="90" height="100"></rect>
                    </g>
                    <g id="Group-3" transform="translate(0.000000, 120.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="90" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="90" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Group-2" transform="translate(40.000000, 240.000000)" fill="#0085BA">
                    <g id="Blue-Square" transform="translate(115.000000, 60.000000)">
                        <rect id="Rectangle-2" x="0" y="0" width="90" height="100"></rect>
                    </g>
                    <rect id="Rectangle-6-Copy-2" x="0" y="0" width="90" height="160"></rect>
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="90" height="160"></rect>
                    </g>
                    <g id="Blue-Square" transform="translate(230.000000, 20.000000)">
                        <rect id="Rectangle-2" x="0" y="0" width="90" height="140"></rect>
                    </g>
                </g>
                <g id="Post-1-Copy-6" transform="translate(155.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="90" height="160"></rect>
                    </g>
                    <g id="Group-3-Copy" transform="translate(0.000000, 180.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="90" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="90" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-7" transform="translate(270.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="90" height="120"></rect>
                    </g>
                    <g id="Group-3-Copy-2" transform="translate(0.000000, 140.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="90" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="90" height="4"></rect>
                        </g>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>menu_style_4.svg000066600000002363151136642150007710 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>menu_style_4</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop-Copy" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-800.000000, 0.000000)">
        <g id="Nav-Style">
            <g id="menu_style_4" transform="translate(800.000000, 0.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Heading-Line" transform="translate(90.000000, 126.000000)" fill="#0085BA">
                    <rect id="Rectangle-3" x="0" y="0" width="222" height="5"></rect>
                </g>
                <text id="MENU" font-family="Avenir-Heavy, Avenir" font-size="75" font-weight="600" letter-spacing="1.44230664" fill="#000000">
                    <tspan x="84.0528867" y="218">MENU</tspan>
                </text>
            </g>
        </g>
    </g>
</svg>menu_style_3.svg000066600000002363151136642150007707 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>menu_style_3</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop-Copy" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-400.000000, 0.000000)">
        <g id="Nav-Style">
            <g id="menu_style_3" transform="translate(400.000000, 0.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Heading-Line" transform="translate(90.000000, 255.000000)" fill="#0085BA">
                    <rect id="Rectangle-3" x="0" y="0" width="222" height="5"></rect>
                </g>
                <text id="MENU" font-family="Avenir-Heavy, Avenir" font-size="75" font-weight="600" letter-spacing="1.44230664" fill="#000000">
                    <tspan x="83.0528867" y="219">MENU</tspan>
                </text>
            </g>
        </g>
    </g>
</svg>blog_lateral.svg000066600000007366151136642150007740 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>blog_lateral</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-1200.000000, 0.000000)">
        <g id="Blog_Layouts">
            <g id="blog_lateral" transform="translate(1200.000000, 0.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Post-1" transform="translate(40.000000, 60.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="100" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(120.000000, 20.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-3" transform="translate(40.000000, 160.000000)" fill="#0085BA">
                    <g id="Blue-Square" transform="translate(120.000000, 0.000000)">
                        <rect id="Rectangle-2" x="0" y="0" width="100" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(0.000000, 21.000000)">
                        <g id="Heading-Line" transform="translate(50.000000, 0.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 17.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 35.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-4" transform="translate(40.000000, 260.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="100" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(120.000000, 20.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>blog_2column.svg000066600000011153151136642150007660 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>blog_2column</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(0.000000, -400.000000)">
        <g id="Blog_Layouts">
            <g id="blog_2column" transform="translate(0.000000, 400.000000)">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Post-1" transform="translate(40.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="140" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(0.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="70" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="140" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="140" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-5" transform="translate(220.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="140" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(0.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="70" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="140" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="140" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-10" transform="translate(40.000000, 220.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="140" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(0.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="70" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="140" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="140" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-9" transform="translate(220.000000, 220.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="140" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(0.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="70" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="140" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="140" height="4"></rect>
                        </g>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>blog_timeline.svg000066600000014445151136642150010116 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>blog_timeline</title>
    <desc>Created with Sketch.</desc>
    <defs>
        <rect id="path-1" x="0" y="0" width="40" height="20" rx="2"></rect>
        <rect id="path-2" x="0" y="0" width="40" height="20" rx="2"></rect>
    </defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-400.000000, -400.000000)">
        <g id="Blog_Layouts">
            <g id="blog_timeline" transform="translate(400.000000, 400.000000)">
                <g id="Blue-Square" transform="translate(198.000000, 30.000000)" fill="#0085BA">
                    <rect id="Rectangle-2" x="0" y="0" width="4" height="340"></rect>
                </g>
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Timeline-month" transform="translate(180.000000, 40.000000)">
                    <g id="Timeline-Month">
                        <g id="Rectangle">
                            <use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
                            <rect stroke="#0085BA" stroke-width="2" x="1" y="1" width="38" height="18" rx="2"></rect>
                        </g>
                    </g>
                    <g id="Heading-Line" transform="translate(8.000000, 9.000000)" fill="#0085BA">
                        <rect id="Rectangle-3" x="0" y="0" width="24" height="2"></rect>
                    </g>
                </g>
                <g id="Timeline-month-Copy" transform="translate(180.000000, 220.000000)">
                    <g id="Timeline-Month">
                        <g id="Rectangle">
                            <use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-2"></use>
                            <rect stroke="#0085BA" stroke-width="2" x="1" y="1" width="38" height="18" rx="2"></rect>
                        </g>
                    </g>
                    <g id="Heading-Line" transform="translate(8.000000, 9.000000)" fill="#0085BA">
                        <rect id="Rectangle-3" x="0" y="0" width="24" height="2"></rect>
                    </g>
                </g>
                <g id="Post-1" transform="translate(40.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="120" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(0.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="60" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-5" transform="translate(240.000000, 40.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="120" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(0.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="60" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-10" transform="translate(40.000000, 220.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="120" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(0.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="60" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-9" transform="translate(240.000000, 220.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="120" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(0.000000, 100.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="60" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="120" height="4"></rect>
                        </g>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>blog_classic.svg000066600000007106151136642150007725 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
    <title>blog_classic</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Blog_Layouts">
            <g id="blog_classic">
                <g id="Square-Wrapper" stroke="#0085BA" stroke-width="2">
                    <rect id="Rectangle" x="1" y="1" width="398" height="398" rx="6"></rect>
                </g>
                <g id="Post-1" transform="translate(40.000000, 60.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="100" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(120.000000, 20.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-3" transform="translate(40.000000, 160.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="100" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(120.000000, 20.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                    </g>
                </g>
                <g id="Post-1-Copy-4" transform="translate(40.000000, 260.000000)" fill="#0085BA">
                    <g id="Blue-Square">
                        <rect id="Rectangle-2" x="0" y="0" width="100" height="80"></rect>
                    </g>
                    <g id="Group" transform="translate(120.000000, 20.000000)">
                        <g id="Heading-Line">
                            <rect id="Rectangle-3" x="0" y="0" width="50" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 18.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                        <g id="Heading-Line" transform="translate(0.000000, 36.000000)">
                            <rect id="Rectangle-3" x="0" y="0" width="100" height="4"></rect>
                        </g>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>class-hestia-child-compat-customizer.php000066600000004272151140354600014411 0ustar00<?php
/**
 * Customizer compatibility for Orfeo Child Theme
 *
 * @package Hestia
 */

/**
 * Class Hestia_Child_Compat_Customizer
 */
class Hestia_Child_Compat_Customizer extends Hestia_Register_Customizer_Controls {

	/**
	 * Run init only if Orfeo is installed
	 */
	public function init() {
		if ( wp_get_theme()->Name === 'Orfeo' || wp_get_theme()->Name === 'Orfeo Pro' ) {
			add_action( 'customize_register', array( $this, 'register_controls_callback' ), 100 );
		}
	}

	/**
	 * Implement abstract from parent.
	 */
	public function add_controls() {
	}

	/**
	 * Change controls from child-theme.
	 */
	public function change_controls() {
		$this->change_customizer_object( 'control', 'orfeo_big_title_second_button_text', 'section', 'sidebar-widgets-sidebar-big-title' );
		$this->change_customizer_object( 'control', 'orfeo_big_title_second_button_text', 'priority', 40 );
		$this->change_customizer_object( 'control', 'orfeo_big_title_second_button_link', 'section', 'sidebar-widgets-sidebar-big-title' );
		$this->change_customizer_object( 'control', 'orfeo_big_title_second_button_link', 'priority', 45 );
		$this->change_customizer_object(
			'control', 'hestia_slider_tabs', 'controls', array(
				'slider' => array(
					'hestia_slider_type' => array(
						'image'    => array(
							'hestia_big_title_background',
							'hestia_big_title_title',
							'hestia_big_title_text',
							'hestia_big_title_button_text',
							'hestia_big_title_button_link',
							'orfeo_big_title_second_button_text',
							'orfeo_big_title_second_button_link',
						),
						'parallax' => array(
							'hestia_parallax_layer1',
							'hestia_parallax_layer2',
							'hestia_big_title_title',
							'hestia_big_title_text',
							'hestia_big_title_button_text',
							'hestia_big_title_button_link',
							'orfeo_big_title_second_button_text',
							'orfeo_big_title_second_button_link',

						),
					),
				),
				'extra'  => array(
					'hestia_slider_alignment' => array(
						'left'   => array(
							'hestia_big_title_widgets_title',
							'widgets',
						),
						'center' => array(),
						'right'  => array(
							'hestia_big_title_widgets_title',
							'widgets',
						),
					),
				),
			)
		);

	}

}
class-customizer-auto-css.php000066600000061524151151110650012330 0ustar00<?php

class Customify_Customizer_Auto_CSS {

	static $_instance;
	public $fonts = array();
	public $custom_fonts = array();
	public $variants = array();
	public $subsets = array();

	static $code = null;
	static $font_url = null;
	/**
	 * CSS device query settings
	 *
	 * @var array
	 */
	public $media_queries = array(
		'all'     => '%s',
		'desktop' => '%s',
		'tablet'  => '@media screen and (max-width: 1024px) { %s }',
		'mobile'  => '@media screen and (max-width: 568px) { %s }',
	);

	/**
	 * CSS code for devices
	 *
	 * @var array
	 */
	private $css = array(
		'all'     => '',
		'desktop' => '',
		'tablet'  => '',
		'mobile'  => '',
	);

	/**
	 * Default shadow fields
	 *
	 * @var array
	 */
	private $box_shadow_fields = array(
		'color'  => null,
		'x'      => 0,
		'y'      => 0,
		'blur'   => 0,
		'spread' => 0,
		'inset'  => null,
	);

	/**
	 * Get intance.
	 *
	 * @return Customify_Customizer_Auto_CSS
	 */
	static function get_instance() {
		if ( is_null( self::$_instance ) ) {
			self::$_instance = new self();
			self::$code      = self::$_instance->auto_css();
		}

		return self::$_instance;
	}

	private function replace_value( $value, $format, $value_no_unit = null ) {
		$s = str_replace( '{{value}}', $value, $format );

		return str_replace( '{{value_no_unit}}', $value_no_unit, $s );
	}

	function setup_css_ruler( $value, $format ) {
		$value = wp_parse_args(
			$value,
			array(
				'unit'   => '',
				'top'    => null,
				'right'  => null,
				'bottom' => null,
				'left'   => null,
			)
		);

		if ( ! $value['unit'] ) {
			$value['unit'] = 'px';
		}

		$format = wp_parse_args(
			$format,
			array(
				'top'    => null,
				'right'  => null,
				'bottom' => null,
				'left'   => null,
			)
		);

		$code = array();
		foreach ( $format as $pos => $string ) {
			$v = $value[ $pos ];
			if ( $string ) {
				if ( ! is_null( $v ) && '' !== $v ) {
					$v            = $v . $value['unit'];
					$code[ $pos ] = $this->replace_value( $v, $string );
				}
			}
		}

		return join( "\n\t", $code );
	}

	function setup_shadow( $value, $format ) {

		if ( ! is_array( $value ) || ! $format ) {
			return '';
		}

		$p        = wp_parse_args( $value, $this->box_shadow_fields );
		$value    = Customify_Sanitize_Input::sanitize_color( $p['color'] );
		$color    = $value;
		$position = $p['inset'] ? 'inset' : '';
		if ( ! $color ) {
			return '';
		}
		if ( ! $p['blur'] ) {
			$p['blur'] = 0;
		}
		if ( ! $p['spread'] ) {
			$p['spread'] = 0;
		}
		if ( ! $p['x'] ) {
			$p['x'] = 0;
		}
		if ( ! $p['y'] ) {
			$p['y'] = 0;
		}

		$style = $p['x'] . 'px'
				 . ' ' . $p['y'] . 'px'
				 . ' ' . $p['blur'] . 'px'
				 . ' ' . $p['spread'] . 'px'
				 . ' ' . $color
				 . ' ' . $position
				 . ';';

		// offset-x | offset-y | blur-radius | spread-radius | color.
		// box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2);.
		return $this->replace_value( $style, $format );
	}

	function setup_slider( $value, $format ) {
		$value = wp_parse_args(
			$value,
			array(
				'unit'  => '',
				'value' => null,
			)
		);

		if ( ! $value['unit'] ) {
			$value['unit'] = 'px';
		}

		if ( $format ) {
			if ( ! is_null( $value['value'] ) && '' !== $value['value'] ) {
				$v = $value['value'] . $value['unit'];
				$c = $this->replace_value( $v, $format, $value['value'] );

				return $c;
			}
		}

		return false;
	}

	function setup_color( $value, $format ) {
		$value = Customify_Sanitize_Input::sanitize_color( $value );
		if ( $format ) {
			if ( ! is_null( $value ) && '' !== $value ) {
				return $this->replace_value( $value, $format );
			}
		}

		return false;
	}

	function setup_checkbox( $value, $format ) {
		if ( $format ) {
			if ( $value ) {
				return $format;
			}
		}

		return false;
	}

	function setup_image( $value, $format ) {
		$image = Customify()->get_media( $value );
		if ( $format ) {
			if ( $image ) {
				return $this->replace_value( $image, $format ) . '';
			}
		}

		return false;
	}

	function setup_text_align( $value, $format ) {
		$value = sanitize_text_field( $value );
		if ( $format ) {
			if ( ! is_null( $value ) && '' !== $value ) {
				return $this->replace_value( $value, $format ) . ';';
			}
		}

		return false;
	}

	function css_ruler( $field, $values = null, $no_selector = null ) {
		$code = $this->maybe_devices_setup( $field, 'setup_css_ruler', $values, $no_selector );

		return $code;
	}

	function slider( $field, $values = null, $no_selector = null ) {
		$code = $this->maybe_devices_setup( $field, 'setup_slider', $values, $no_selector );

		return $code;
	}

	function color( $field, $values = null, $no_selector = null ) {
		$code = $this->maybe_devices_setup( $field, 'setup_color', $values, $no_selector );

		return $code;
	}

	function shadow( $field, $values = null, $no_selector = null ) {
		$code = $this->maybe_devices_setup( $field, 'setup_shadow', $values, $no_selector );

		return $code;
	}

	function checkbox( $field, $values = null, $no_selector = null ) {
		return $this->maybe_devices_setup( $field, 'setup_checkbox', $values, $no_selector );
	}

	function image( $field, $values = null, $no_selector = null ) {
		$code = $this->maybe_devices_setup( $field, 'setup_image', $values, $no_selector );

		return $code;
	}

	function text_align( $field, $values = null, $no_selector = null ) {
		$code = $this->maybe_devices_setup( $field, 'setup_default', $values, $no_selector );

		return $code;
	}

	function _join( $lists, $codeList, &$selectorCSSAll = array(), &$selectorCSSDevices = array() ) { //phpcs:ignore
		if ( ! is_array( $selectorCSSAll ) ) {
			$selectorCSSAll = array();
		}

		if ( ! is_array( $selectorCSSDevices ) ) {
			$selectorCSSDevices = array();
		}

		foreach ( (array) $lists as $name => $f ) {

			if ( isset( $f['selector'] ) && $f['selector'] ) {
				if ( ! isset( $selectorCSSAll[ $f['selector'] ] ) ) {
					$selectorCSSAll[ $f['selector'] ] = '';
				}

				if ( isset( $codeList[ $name ] ) ) {

					if ( isset( $codeList[ $name ]['no_devices'] ) ) {
						if ( $codeList[ $name ]['no_devices'] ) {
							$selectorCSSAll[ $f['selector'] ] .= $codeList[ $name ]['no_devices'];
						}
					} else {

						if ( is_array( $codeList[ $name ] ) ) {
							foreach ( $codeList[ $name ] as $device => $code ) {
								if ( ! isset( $selectorCSSDevices[ $device ] ) ) {
									$selectorCSSDevices[ $device ] = array();
								}

								if ( ! isset( $selectorCSSDevices[ $device ][ $f['selector'] ] ) ) {
									$selectorCSSDevices[ $device ][ $f['selector'] ] = '';
								}

								if ( $code ) {
									$selectorCSSDevices[ $device ][ $f['selector'] ] .= $code;
								}
							}
						}
					}
				}
			}
		}

	}

	function setup_styling_fields( $fields, $list, $selectors, $type ) {
		$newList = array();
		if ( ! is_array( $selectors ) ) {
			$selectors = array();
		}
		if ( false === $fields ) {
			$newList = null;
		} else {

			if ( ! is_array( $fields ) ) {
				$fields = array();
			}

			$newfs = array();
			$i     = 0;
			foreach ( $list as $f ) {
				$key = $f['name'];
				if ( ! isset( $fields[ $key ] ) || $fields[ $key ] ) {
					$newfs[ $key ] = $f;
					if ( isset( $selectors[ $type . '_' . $key ] ) ) {
						$newfs[ $key ]['selector'] = $selectors[ $type . '_' . $key ];
					} else {
						$newfs[ $key ]['selector'] = $selectors[ $type ];
					}
					$i ++;
				}
			}
			$newList = $newfs;

			return $newList;
		}
	}

	function styling( $field, $values = null ) {
		$values = Customify()->get_setting( $field['name'], 'all' );

		$values = wp_parse_args(
			$values,
			array(
				'normal' => array(),
				'hover'  => array(),
			)
		);

		$new_fields = array();
		$selectors  = array();

		if ( is_string( $field['selector'] ) ) {
			$selectors['normal'] = $field['selector'];
			$selectors['hover']  = $field['selector'];
		} else {
			$selectors = wp_parse_args(
				$field['selector'],
				array(
					'normal' => array(),
					'hover'  => array(),
				)
			);
		}
		$tabs          = null;
		$normal_fields = - 1;
		$hover_fields  = - 1;
		if ( isset( $field['fields'] ) && is_array( $field['fields'] ) ) {
			if ( isset( $field['fields']['tabs'] ) ) {
				$tabs = $field['fields']['tabs'];
			}
			if ( isset( $field['fields']['normal_fields'] ) ) {
				$normal_fields = $field['fields']['normal_fields'];
			}
			if ( isset( $field['fields']['hover_fields'] ) ) {
				$hover_fields = $field['fields']['hover_fields'];
			}
		}

		$styling_config     = Customify()->customizer->get_styling_config();
		$selectorCSSAll     = array();
		$selectorCSSDevices = array();
		$listNormalFields   = $this->setup_styling_fields( $normal_fields, $styling_config['normal_fields'], $selectors, 'normal' );
		$listHoverFields    = $this->setup_styling_fields( $hover_fields, $styling_config['hover_fields'], $selectors, 'hover' );

		$listTabs = $styling_config['tabs'];

		if ( false === $tabs ) {
			$listTabs['hover'] = false;
		} elseif ( is_array( $tabs ) ) {
			$listTabs = $tabs;
		}

		// Do no use bg settings if no bg.
		if ( isset( $values['normal']['bg_image'] ) ) {
			$image = Customify()->get_media( $values['normal']['bg_image'] );
			if ( ! $image ) {
				unset( $values['normal']['bg_repeat'] );
				unset( $values['normal']['bg_cover'] );
				unset( $values['normal']['bg_position'] );
				unset( $values['normal']['bg_attachment'] );
			}
		}

		$normal_style = $this->loop_fields( $listNormalFields, $values['normal'], true, true );
		$hover_style  = $this->loop_fields( $listHoverFields, $values['hover'], true, true );

		$this->_join( $listNormalFields, $normal_style, $selectorCSSAll, $selectorCSSDevices );
		$this->_join( $listHoverFields, $hover_style, $selectorCSSAll, $selectorCSSDevices );

		foreach ( $selectorCSSAll as $s => $code ) {
			if ( trim( $code ) ) {
				$this->css['all'] .= "\r\n{$s}  {\r\n\t{$code}\r\n} \r\n";
			}
		}

		foreach ( Customify()->customizer->devices as $device ) {
			$css = '';
			if ( isset( $selectorCSSDevices[ $device ] ) ) {
				$deviceCode = $selectorCSSDevices[ $device ];
				foreach ( $deviceCode as $s => $c ) {
					if ( ! empty( $c ) ) {
						if ( is_string( $c ) && trim( $c ) ) {
							$css .= "\r\n{$s}  {\r\n\t{$c}\r\n} \r\n";
						} else {
							if ( ! is_array( $c ) ) {
								$c = array();
							}
							$c = array_map( 'trim', $c );
							$c = array_filter( $c );
							if ( ! empty( $c ) ) {
								$css .= "\r\n{$s}  {\r\n\t" . join( $c, "\n" ) . "\r\n} \r\n";
							}
						}
					}
				}
			}
			$this->css[ $device ] .= $css;
		}
	}

	function modal( $field, $values = null ) {

		$values = Customify()->get_setting( $field['name'], 'all' );
		if ( ! is_array( $values ) ) {
			$values = array();
		}
		if ( isset( $field['fields']['tabs'] ) ) {
			foreach ( $field['fields']['tabs'] as $key => $title ) {
				if ( isset( $field['fields'][ $key . '_fields' ] ) ) {
					$this->loop_fields( $field['fields'][ $key . '_fields' ], isset( $values[ $key ] ) ? $values[ $key ] : array() );
				}
			}
		}
	}

	function setup_default( $value, $format ) {
		if ( is_string( $value ) && $value ) {
			$value = sanitize_text_field( $value );
			if ( $format ) {
				return $this->replace_value( $value, $format );
			}
		}

		return false;
	}

	function maybe_devices_setup( $field, $call_back, $values = null, $no_selector = false ) {
		$code       = '';
		$code_array = array();
		$has_device = false;
		$format     = isset( $field['css_format'] ) ? $field['css_format'] : false;
		if ( isset( $field['device_settings'] ) && $field['device_settings'] ) {
			$has_device = true;
			foreach ( Customify()->customizer->devices as $device ) {
				$value = null;
				if ( is_null( $values ) ) {
					$value = Customify()->get_setting( $field['name'], $device );
				} else {
					if ( isset( $values[ $device ] ) ) {
						$value = $values[ $device ];
					}
				}
				$_c = false;
				if ( method_exists( $this, $call_back ) ) {
					$_c = call_user_func_array( array( $this, $call_back ), array( $value, $format ) );
				}
				if ( $_c ) {
					$code_array[ $device ] = $_c;
				}
			}
		} else {
			if ( is_null( $values ) ) {
				$values = Customify()->get_setting( $field['name'] );
			}
			if ( method_exists( $this, $call_back ) ) {
				$code = call_user_func_array( array( $this, $call_back ), array( $values, $format ) );
			}
			$code_array['no_devices'] = $code;

		}

		$code_array = apply_filters( 'customify/customizer/auto_css', $code_array, $field, $this );

		if ( empty( $code_array ) ) {
			return false;
		}

		$code_array = array_map( 'trim', $code_array );
		$code_array = array_filter( $code_array );

		$code = '';
		if ( $no_selector ) {
			return $code_array;
		} else {
			if ( $has_device ) {
				foreach ( Customify()->customizer->devices as $device ) {
					if ( isset( $code_array[ $device ] ) ) {
						$_c = $code_array[ $device ];
						if ( $_c && trim( $_c ) ) {
							if ( 'format' == $field['selector'] ) {
								$this->css[ $device ] .= "\r\n{$_c}\r\n";
							} else {
								$this->css[ $device ] .= "\r\n{$field['selector']} {\r\n\t{$_c}\r\n}\r\n";
							}
						}
					}
				}
			} else {
				if ( isset( $code_array['no_devices'] ) && $code_array['no_devices'] ) {
					if ( 'format' == $field['selector'] ) {
						$this->css['all'] .= "\r\n{$code_array['no_devices']}\r\n";
					} else {
						$this->css['all'] .= "\r\n{$field['selector']} {\r\n\t{$code_array['no_devices']}\r\n}\r\n";
					}
				}
			}
		}

		return $code;
	}

	function setup_font( $value ) {

		$value = wp_parse_args(
			$value,
			array(
				'font'    => null,
				'type'    => null,
				'variant' => null,
				'subsets' => null,
			)
		);

		if ( ! $value['font'] ) {
			return '';
		}

		if ( 'google' == $value['type'] ) {
			$this->fonts[ $value['font'] ] = $value['font'];
			if ( $value['variant'] ) {
				if ( ! isset( $this->variants[ $value['font'] ] ) ) {
					$this->variants[ $value['font'] ] = array();
					if ( ! is_array( $value['variant'] ) ) {
						$this->variants[ $value['font'] ] = array_merge( $this->variants[ $value['font'] ], array( $value['variant'] => $value['variant'] ) );
					} else {
						$this->variants[ $value['font'] ] = array_merge( $this->variants[ $value['font'] ], $value['variant'] );
					}
				}
			}

			if ( $value['subsets'] ) {
				$this->subsets = array_merge( $this->subsets, $value['subsets'] );
			}
		} else {
			$this->custom_fonts[ $value['font'] ] = $value['font'];
		}

		return "font-family: \"{$value['font']}\";";
	}


	function font( $field, $values = null ) {
		$code = '';
		if ( $field['device_settings'] ) {
			foreach ( Customify()->customizer->devices as $device ) {
				$value = null;
				if ( is_null( $values ) ) {
					$value = Customify()->get_setting( $field['name'], $device );
				} else {
					if ( isset( $values[ $device ] ) ) {
						$value = $values[ $device ];
					}
				}

				$_c = $this->setup_font( $value );
				if ( $_c ) {
					$this->css[ $device ] = "\r\n{$field['selector']} {\r\n\t{$_c}\r\n}\r\n";
					if ( 'desktop' == $device ) {
						$code .= "\r\n{$field['selector']} {\r\n\t{$_c}\r\n}";
					} else {
						$code .= "\r\n.{$device} {$field['selector']} {\r\n\t{$_c}\r\n}\r\n";
					}
				}
			}
		} else {
			if ( is_null( $values ) ) {
				$values = Customify()->get_setting( $field['name'] );
			}
			$code             = $this->setup_font( $values );
			$this->css['all'] .= "{$field['selector']} {\r\n\t{$code}\r\n}\r\n";
			$code             .= "{$field['selector']} {\r\n\t{$code}\r\n}\r\n";
		}

		return $code;
	}

	function setup_font_style( $value ) {
		$value = wp_parse_args(
			$value,
			array(
				'b' => null,
				'i' => null,
				'u' => null,
				's' => null,
				't' => null,
			)
		);
		$css   = array();
		if ( $value['b'] ) {
			$css['b'] = 'font-weight: bold;';
		}
		if ( $value['i'] ) {
			$css['i'] = 'font-style: italic;';
		}

		$decoration = array();
		if ( $value['u'] ) {
			$decoration['underline'] = 'underline';

		}

		if ( $value['s'] ) {
			$decoration['line-through'] = 'line-through';
		}

		if ( ! empty( $decoration ) ) {
			$css['d'] = 'text-decoration: ' . join( ' ', $decoration ) . ';';
		}

		if ( $value['t'] ) {
			$css['t'] = 'text-transform: uppercase;';
		}

		return join( "\r\n\t", $css );

	}

	function typography( $field ) {
		$values = Customify()->get_setting( $field['name'] );
		$values = wp_parse_args(
			$values,
			array(
				'font'            => null,
				'style'           => null,
				'font_size'       => null,
				'line_height'     => null,
				'letter_spacing'  => null,
				'font_type'       => null,
				'languages'       => null,
				'font_weight'     => null,
				'text_decoration' => null,
				'text_transform'  => null,
				'variant'         => null,
			)
		);
		$code   = array();

		$fields      = array();
		$devices_css = array();
		foreach ( Customify()->customizer->get_typo_fields() as $f ) {
			$fields[ $f['name'] ] = $f;
		}

		if ( isset( $fields['font'] ) ) {
			$code['font'] = $this->setup_font(
				array(
					'font'    => $values['font'],
					'type'    => $values['font_type'],
					'subsets' => $values['languages'],
					'variant' => $values['variant'],
				)
			);
		}

		if ( isset( $values['style'] ) && $values['style'] ) {

			if ( $values['style'] && 'default' !== $values['style'] ) {
				$code['style'] = 'font-style: ' . $values['style'] . ';';
			}
		}

		// Font Weight.
		if ( 'default' == $values['font_weight'] ) {
			$values['font_weight'] = '';
		}
		if ( isset( $fields['font_weight'] ) && $values['font_weight'] ) {
			if ( 'regular' == $values['font_weight'] ) {
				$values['font_weight'] = 'normal';
			}
			$code['font_weight'] = 'font-weight: ' . sanitize_text_field( $values['font_weight'] ) . ';';
		}

		// Text Decoration.
		if ( isset( $fields['text_decoration'] ) && $values['text_decoration'] ) {
			$code['text_decoration'] = 'text-decoration: ' . sanitize_text_field( $values['text_decoration'] ) . ';';
		}

		// Text Transform.
		if ( isset( $fields['text_transform'] ) && $values['text_transform'] ) {
			$code['text_transform'] = 'text-transform: ' . sanitize_text_field( $values['text_transform'] ) . ';';
		}

		if ( isset( $fields['font_size'] ) ) {
			$fields['font_size']['css_format'] = 'font-size: {{value}};';
			$font_size_css                     = $this->maybe_devices_setup( $fields['font_size'], 'setup_slider', $values['font_size'], true );
			if ( $font_size_css ) {
				if ( isset( $font_size_css['no_devices'] ) ) {
					$code['font_size'] = $font_size_css['no_devices'];
				} else {
					foreach ( $font_size_css as $device => $_c ) {
						if ( 'desktop' == $device ) {
							$code['font_size'] = $_c;
						} else {
							if ( ! isset( $devices_css[ $device ] ) ) {
								$devices_css[ $device ] = array();
							}
							$devices_css[ $device ]['font_size'] = $_c;
						}
					}
				}
			}
		}

		if ( isset( $fields['line_height'] ) ) {
			$fields['line_height']['css_format'] = 'line-height: {{value}};';
			$font_size_css                       = $this->maybe_devices_setup( $fields['line_height'], 'setup_slider', $values['line_height'], true );
			if ( $font_size_css ) {
				if ( isset( $font_size_css['no_devices'] ) ) {
					$code['line_height'] = $font_size_css['no_devices'];
				} else {
					foreach ( $font_size_css as $device => $_c ) {
						if ( 'desktop' == $device ) {
							$code['line_height'] = $_c;
						} else {
							if ( ! isset( $devices_css[ $device ] ) ) {
								$devices_css[ $device ] = array();
							}
							$devices_css[ $device ]['line_height'] = $_c;
						}
					}
				}
			}
		}

		if ( isset( $fields['letter_spacing'] ) ) {
			$fields['letter_spacing']['css_format'] = 'letter-spacing: {{value}};';
			$font_size_css                          = $this->maybe_devices_setup( $fields['letter_spacing'], 'setup_slider', $values['letter_spacing'], true );
			if ( $font_size_css ) {
				if ( isset( $font_size_css['no_devices'] ) && ! empty( $font_size_css['no_devices'] ) ) {
					$code['letter_spacing'] = $font_size_css['no_devices'];
				} else {
					foreach ( (array) $font_size_css as $device => $_c ) {
						if ( 'desktop' == $device ) {
							$code['letter_spacing'] = $_c;
						} else {
							if ( ! isset( $devices_css[ $device ] ) ) {
								$devices_css[ $device ] = array();
							}
							$devices_css[ $device ]['letter_spacing'] = $_c;
						}
					}
				}
			}
		}

		$devices_css = apply_filters( 'customify/customizer/auto_css', $devices_css, $field, $this );
		foreach ( $devices_css as $device => $els ) {
			if ( ! empty( $els ) ) {
				$this->css[ $device ] .= "{$field['selector']} {\r\n\t" . join( "\r\n\t", $els ) . "\r\n}";
			}
		}

		$code = array_filter( $code );
		if ( ! empty( $code ) ) {
			$this->css['all'] .= "{$field['selector']} {\r\n\t" . join( "\r\n\t", $code ) . "\r\n}";
		}

	}

	function get_google_fonts_url() {
		$url = '//fonts.googleapis.com/css?family=';
		$s   = '';
		if ( empty( $this->fonts ) ) {
			return false;
		}

		foreach ( $this->fonts as $font_name ) {
			if ( $s ) {
				$s .= '|';
			}
			$s .= str_replace( ' ', '+', $font_name );
			$v = array();
			if ( isset( $this->variants[ $font_name ] ) ) {
				foreach ( $this->variants[ $font_name ] as $_v ) {
					if ( 'regular' != $_v ) {
						switch ( $_v ) {
							case 'italic':
								$v[ $_v ] = '400i';
								break;
							default:
								$v[ $_v ] = str_replace( 'italic', 'i', $_v );
						}
					} else {
						$v[ $_v ] = '400';
					}
				}
			}

			if ( ! empty( $v ) ) {
				$s .= ':' . join( ',', $v );
			}
		}

		$url .= $s;

		if ( ! empty( $this->subsets ) ) {
			$url .= '&subset=' . join( ',', $this->subsets );
		}

		return $url;
	}

	function loop_fields( $fields, $values = null, $skip_if_val_null = false, $no_selector = false, $key_name = 'name' ) {
		$listcss = array();

		foreach ( (array) $fields as $field ) {
			$field = wp_parse_args(
				$field,
				array(
					'selector'   => null,
					'css_format' => null,
					'type'       => null,
				)
			);

			if ( ! $key_name ) {
				$key_name = 'name';
			}

			if ( isset( $field[ $key_name ] ) ) {

				$key = $field[ $key_name ];

				$v = isset( $values[ $field['name'] ] ) ? $values[ $field['name'] ] : null;
				if ( ! ( is_null( $v ) && $skip_if_val_null ) ) {
					if ( ( $field['selector'] && $field['css_format'] ) || 'modal' == $field['type'] ) {
						switch ( $field['type'] ) {
							case 'css_ruler':
								$listcss[ $key ] = $this->css_ruler( $field, $v, $no_selector );
								break;
							case 'slider':
								$listcss[ $key ] = $this->slider( $field, $v, $no_selector );
								break;
							case 'color':
								$listcss[ $key ] = $this->color( $field, $v, $no_selector );
								break;
							case 'shadow':
								$listcss[ $key ] = $this->shadow( $field, $v, $no_selector );
								break;
							case 'image':
								$listcss[ $key ] = $this->image( $field, $v, $no_selector );
								break;
							case 'checkbox':
								if ( 'html_class' !== $field['css_format'] ) {
									$listcss[ $key ] = $this->checkbox( $field, $v, $no_selector );
								}
								break;
							case 'text_align':
							case 'text_align_no_justify':
								$listcss[ $key ] = $this->text_align( $field, $v, $no_selector );
								break;
							case 'font':
								$this->font( $field, $v );
								break;
							case 'styling':
								$this->styling( $field, $v );
								break;
							case 'modal':
								$this->modal( $field, $v );
								break;
							default:
								switch ( $field['css_format'] ) {
									case 'typography':
										$this->typography( $field );
										break;
									case 'html_class':
										break;
									default:
										$listcss[ $key ] = $this->maybe_devices_setup( $field, 'setup_default', $v, $no_selector );

								}
						}
					}
				}
			} // End check field exists.
		} // end for each fields

		return $listcss;

	}

	function get_font_url() {
		return self::$font_url;
	}

	/**
	 * Remove space of css code.
	 *
	 * @since 1.0.0
	 * @since 0.2.6
	 *
	 * @param string $css
	 * @return tring
	 */
	function min_css( $css ) {

		if ( trim( $css ) == '' ) {
			return;
		}

		$css = str_replace( array( "\r\n", "\r", "\n", "\t" ), '', $css );
		return $css;

	}

	/**
	 * Render CSS content from array customize configs.
	 *
	 * @since 0.2.5
	 *
	 * @param array $fields
	 * @return string
	 */
	public function render_css( $fields = array() ) {
		$this->loop_fields( $fields );
		$css_code = '';
		$i        = 0;
		foreach ( $this->css as $device => $code ) {
			$new_line = '';
			if ( $i > 0 ) {
				$new_line = "\r\n/* CSS for {$device} */\r\n";
			}
			$css_code .= $new_line . sprintf( $this->media_queries[ $device ], $code ) . "\r\n";
			$i ++;
		}

		$css_code = apply_filters( 'customify/auto-css', $css_code, $this );
		return $css_code;
	}

	/**
	 * Auto render CSS code.
	 *
	 * @since 0.0.1
	 * @since 0.2.6
	 *
	 * @param boolean $partial
	 * @return string
	 */
	function auto_css( $partial = false ) {
		if ( ! is_null( self::$code ) ) {
			return self::$code;
		}
		$config_fields = Customify()->customizer->get_config();
		/**
		 * Render CSS from customize configs
		 *
		 * @since  0.2.6
		 */
		$css_code = $this->render_css( $config_fields );

		$url            = $this->get_google_fonts_url();
		self::$font_url = $url;
		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
			return $css_code;
		}

		return $this->min_css( $css_code );
	}
}

class-customify-section-pro.php000066600000004575151151110650012655 0ustar00<?php
if ( ! defined( 'ABSPATH' ) ) { // Prevent direct access.
	exit;
}

if ( class_exists( 'WP_Customize_Section' ) && ! class_exists( 'Customify_WP_Customize_Section_Pro' ) ) {

	class Customify_WP_Customize_Section_Pro extends WP_Customize_Section {
		/**
		 * The type of customize section being rendered.
		 *
		 * @since  1.0.0
		 * @access public
		 * @var    string
		 */
		public $type = 'customify-pro';
		/**
		 * Custom button text to output.
		 *
		 * @since  1.0.0
		 * @access public
		 * @var    string
		 */
		public $pro_text = '';
		/**
		 * Custom plus section URL.
		 *
		 * @since  1.0.0
		 * @access public
		 * @var    string
		 */
		public $pro_url = '';
		/**
		 * Custom section ID.
		 *
		 * @since  1.0.0
		 * @access public
		 * @var    string
		 */
		public $id = '';

		public $teaser = false;
		public $features = array();

		/**
		 * Add custom parameters to pass to the JS via JSON.
		 *
		 * @since  1.0.0
		 * @access public
		 * @return array
		 */
		public function json() {
			$json             = parent::json();
			$json['pro_text'] = $this->pro_text;
			$json['pro_url']  = $this->pro_url;
			$json['id']       = $this->id;
			$json['teaser']   = $this->teaser;
			$json['features'] = $this->features;

			return $json;
		}

		/**
		 * Outputs the Underscore.js template.
		 *
		 * @since  1.0.0
		 * @access public
		 * @return void
		 */
		protected function render_template() { ?>
			<# if (  data.teaser ) { #>
			<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
				<div class="customify-pro-teaser">
					<h3>{{{ data.title }}}</h3>
					<# if ( data.description ) { #>
					<p class="description">{{{ data.description }}}</p>
					<# } #>
					<# if ( 0 < data.features.length ) { #>
					<ul>
						<# _.each( data.features, function( feature, i ) { #>
						<li>{{{ feature }}}</li>
						<# }); #>
					</ul>
					<# } #>
					<a href="{{ data.pro_url }}" class="button button-secondary" target="_blank" rel="noopener"><?php echo esc_html_x( 'Learn More', 'Customify Pro upsell', 'customify' ); ?></a>
				</div>
			</li>
			<# } else { #>
			<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
				<h3><a href="{{ data.pro_url }}" target="_blank">{{{ data.pro_text }}}</a></h3>
			</li>
			<# }  #>
		<?php }
	}


}
class-customizer-fonts.php000066600000004014151151110650011712 0ustar00<?php

class Customify_Fonts {

	function __construct() {
		// Add ajax handle.
		add_action( 'wp_ajax_customify/customizer/ajax/fonts', array( $this, 'ajax_fonts' ) );
	}

	/**
	 * Ajax fonts
	 */
	function ajax_fonts() {
		$fonts = array(
			'normal' => array(
				'title' => __( 'Default Web Fonts', 'customify' ),
				'fonts' => $this->get_normal_fonts(),
			),
			'google' => array(
				'title' => __( 'Google Web Fonts', 'customify' ),
				'fonts' => $this->get_google_fonts(),
			),
		);

		wp_send_json_success( apply_filters( 'customify/list-fonts', $fonts ) );
	}

	/**
	 * Get Google WebFont fonts from json file
	 *
	 * @return array
	 */
	function get_google_fonts() {
		global $wp_filesystem;
		WP_Filesystem();
		$file = get_template_directory() . '/assets/fonts/google-fonts.json';
		if ( file_exists( $file ) ) {
			$file_contents = $wp_filesystem->get_contents( $file );

			return json_decode( $file_contents, true );
		}

		return array();
	}

	/**
	 * Default fonts
	 *
	 * @return array
	 */
	function get_normal_fonts() {
		$fonts = array(
			'Arial'       => array(
				'family'   => 'Arial',
				'category' => ' sans-serif',
			),
			'Baskerville' => array(
				'family'   => 'Baskerville',
				'category' => 'serif',
			),
			'Palatino'    => array(
				'family'   => 'Palatino',
				'category' => 'serif',
			),

			'Bodoni MT' => array(
				'family'   => 'Bodoni MT',
				'category' => 'serif',
			),

			'Georgia' => array(
				'family'   => 'Georgia',
				'category' => 'serif',
			),

			'Century Gothic' => array(
				'family'   => 'Century Gothic',
				'category' => 'sans-serif',
			),

			'Tahoma' => array(
				'family'   => 'Tahoma',
				'category' => 'sans-serif',
			),

			'Arial Narrow' => array(
				'family'   => 'Arial Narrow',
				'category' => ' sans-serif',
			),

			'Trebuchet MS' => array(
				'family'   => 'Trebuchet MS',
				'category' => ' sans-serif',
			),

			'Consolas' => array(
				'family'   => 'Consolas',
				'category' => ' sans-serif',
			),

		);

		return $fonts;
	}
}

new Customify_Fonts();
configs/config-default.php000066600000012764151151110650011606 0ustar00<?php
add_filter( 'customify/customize/settings-default', 'customify_layout_builder_config_default', 15, 2 );
/**
 * Default theme customize settings data.
 *
 * @param string $val
 * @param string $name
 *
 * @return mixed
 */
function customify_layout_builder_config_default( $val, $name ) {
	$defaults =
		array(
			// Start header builder layout version 1.
			'header_builder_panel'      => array(
				'desktop' =>
					array(
						'main' =>
							array(
								array(
									'x'      => '0',
									'y'      => '1',
									'width'  => '3',
									'height' => '1',
									'id'     => 'logo',
								),

								array(
									'x'      => '3',
									'y'      => '1',
									'width'  => '9',
									'height' => '1',
									'id'     => 'primary-menu',
								),
							),
					),
				'mobile'  =>
					array(
						'main'    =>
							array(

								array(
									'x'      => '0',
									'y'      => '1',
									'width'  => '5',
									'height' => '1',
									'id'     => 'logo',
								),

								array(
									'x'      => '9',
									'y'      => '1',
									'width'  => '3',
									'height' => '1',
									'id'     => 'nav-icon',
								),
							),
						'sidebar' =>
							array(

								array(
									'x'      => '0',
									'y'      => '1',
									'width'  => '1',
									'height' => '1',
									'id'     => 'html',
								),

								array(
									'x'      => '0',
									'y'      => '1',
									'width'  => '1',
									'height' => '1',
									'id'     => 'primary-menu',
								),
							),
					),
			), // End header builder layout version 1.
			'header_builder_version' => '',
			// Start header builder layout version 2.
			'header_builder_panel_v2' => array(
				'desktop' => array(
					'top' => array(
						'left' => array(
							array(
								'id' => 'html',
							),
						),
						'center' => array(),
						'right' => array(
							array(
								'id' => 'social-icons',
							),
						),
					),
					'main' => array(
						'left' => array(
							array(
								'id' => 'logo',
							),
							array(
								'id' => 'primary-menu',
							),
						),
						'center' => array(),
						'right' => array(
							array(
								'id' => 'search_icon',
							),
							array(
								'id' => 'nav-icon',
							),
							array(
								'id' => 'button',
							),
						),
					),
					'bottom' => array(
						'left' => array(),
						'center' => array(),
						'right' => array(),
					),
				),
				'mobile' => array(
					'top' => array(
						'left' => array(),
						'center' => array(),
						'right' => array(),
					),
					'main' => array(
						'left' => array(
							array(
								'id' => 'logo',
							),
						),
						'center' => array(),
						'right' => array(
							array(
								'id' => 'search_icon',
							),
							array(
								'id' => 'nav-icon',
							),
						),
					),
					'bottom' => array(
						'left'   => array(),
						'center' => array(),
						'right'  => array(),
					),
					'sidebar' => array(
						'sidebar' => array(
							array(
								'id' => 'html',
							),
							array(
								'id' => 'search_box',
							),
							array(
								'id' => 'primary-menu',
							),
							array(
								'id' => 'social-icons',
							),
							array(
								'id' => 'button',
							),
						),
					),
				),
			), // End header builder layout version 2.

			'header_top_height'         => array(
				'desktop' =>
					array(
						'unit'  => 'px',
						'value' => '33',
					),
				'tablet'  =>
					array(
						'unit'  => 'px',
						'value' => '',
					),
				'mobile'  =>
					array(
						'unit'  => 'px',
						'value' => '33',
					),
			),
			'header_main_height'        => array(
				'desktop' => array(
					'unit' => 'px',
					'value' => '90',
				),
				'tablet'  => array(
					'unit' => 'px',
					'value' => '',
				),
				'mobile'  => array(
					'unit' => 'px',
					'value' => '',
				),
			),
			'header_bottom_height'      => array(
				'desktop' => array(
					'unit' => 'px',
					'value' => '55',
				),
				'tablet'  => array(
					'unit' => 'px',
					'value' => '',
				),
				'mobile'  => array(
					'unit' => 'px',
					'value' => '',
				),
			),
			'header_sidebar_animate'    => 'menu_sidebar_dropdown',
			'header_nav-icon_align'     => array(
				'desktop' => 'right',
				'tablet'  => 'right',
				'mobile'  => 'right',
			),
			'header_primary-menu_align' => array(
				'desktop' => 'right',
				'tablet'  => '',
				'mobile'  => '',
			),
			'footer_builder_panel'      => array(
				'desktop' =>
					array(
						'main'   =>
							array(
								array(
									'x'      => '0',
									'y'      => '1',
									'width'  => '3',
									'height' => '1',
									'id'     => 'footer-1',
								),
								array(
									'x'      => '3',
									'y'      => '1',
									'width'  => '3',
									'height' => '1',
									'id'     => 'footer-2',
								),
								array(
									'x'      => '6',
									'y'      => '1',
									'width'  => '3',
									'height' => '1',
									'id'     => 'footer-3',
								),

								array(
									'x'      => '9',
									'y'      => '1',
									'width'  => '3',
									'height' => '1',
									'id'     => 'footer-4',
								),
							),
						'bottom' =>
							array(

								array(
									'x'      => '0',
									'y'      => '1',
									'width'  => '6',
									'height' => '1',
									'id'     => 'footer_copyright',
								),
							),
					),
			),
		);

	if ( ! $val && isset( $defaults[ $name ] ) ) {
		return $defaults[ $name ];
	}

	return $val;
}
configs/layouts.php000066600000016642151151110650010416 0ustar00<?php
if ( ! function_exists( 'customify_customizer_layouts_config' ) ) {
	/**
	 * Add layout settings.
	 *
	 * @since 0.0.1
	 * @since 0.2.6
	 *
	 * @param array $configs
	 * @return array
	 */
	function customify_customizer_layouts_config( $configs ) {
		$config = array(

			// Layout panel.
			array(
				'name'           => 'layout_panel',
				'type'           => 'panel',
				'priority'       => 18,
				'theme_supports' => '',
				'title'          => __( 'Layouts', 'customify' ),
			),

			// Global layout section.
			array(
				'name'           => 'global_layout_section',
				'type'           => 'section',
				'panel'          => 'layout_panel',
				'theme_supports' => '',
				'title'          => __( 'Global', 'customify' ),
			),
			array(
				'name'        => 'site_layout',
				'type'        => 'radio_group',
				'section'     => 'global_layout_section',
				'title'       => __( 'Site layout', 'customify' ),
				'description' => __( 'Select global site layout.', 'customify' ),
				'default'     => 'site-full-width',
				'css_format'  => 'html_class',
				'selector'    => 'body',
				'choices'     => array(
					'site-full-width' => __( 'Full Width', 'customify' ),
					'site-boxed'      => __( 'Boxed', 'customify' ),
					'site-framed'     => __( 'Framed', 'customify' ),
				),
			),

			array(
				'name'       => 'site_box_shadow',
				'type'       => 'radio_group',
				'section'    => 'global_layout_section',
				'title'      => __( 'Site boxed/framed shadow', 'customify' ),
				'choices'    => array(
					'box-shadow'    => __( 'Yes', 'customify' ),
					'no-box-shadow' => __( 'No', 'customify' ),
				),
				'default'    => 'box-shadow',
				'css_format' => 'html_class',
				'selector'   => '#page',
				'required'   => array(
					array( 'site_layout', '=', array( 'site-boxed', 'site-framed' ) ),
				),
			),

			array(
				'name'            => 'site_margin',
				'type'            => 'css_ruler',
				'section'         => 'global_layout_section',
				'title'           => __( 'Site framed margin', 'customify' ),
				'device_settings' => true,
				'fields_disabled' => array(
					'left'  => '',
					'right' => '',
				),
				'css_format'      => array(
					'top'    => 'margin-top: {{value}};',
					'bottom' => 'margin-bottom: {{value}};',
				),
				'selector'        => '.site-framed .site',
				'required'        => array(
					array( 'site_layout', '=', 'site-framed' ),
				),
			),
			/**
			 * @since 0.2.6 Change css_format and selector.
			 */
			array(
				'name'            => 'container_width',
				'type'            => 'slider',
				'device_settings' => false,
				'default'         => 1200,
				'min'             => 700,
				'step'            => 10,
				'max'             => 2000,
				'section'         => 'global_layout_section',
				'title'           => __( 'Container width', 'customify' ),
				'selector'        => 'format',
				'css_format'      => '.customify-container, .layout-contained, .site-framed .site, .site-boxed .site { max-width: {{value}}; } .main-layout-content .entry-content > .alignwide { width: calc( {{value}} - 4em ); max-width: 100vw;  }',
			),

			// Site content layout.
			array(
				'name'       => 'site_content_layout',
				'type'       => 'radio_group',
				'section'    => 'global_layout_section',
				'title'      => __( 'Site content layout', 'customify' ),
				'choices'    => array(
					'site-content-fullwidth' => __( 'Full width', 'customify' ),
					'site-content-boxed'     => __( 'Boxed', 'customify' ),
				),
				'default'    => 'site-content-boxed',
				'css_format' => 'html_class',
				'selector'   => '.site-content',
			),

			array(
				'name'            => 'site_content_padding',
				'type'            => 'css_ruler',
				'section'         => 'global_layout_section',
				'title'           => __( 'Site content padding', 'customify' ),
				'device_settings' => true,
				'fields_disabled' => array(
					'left'  => '',
					'right' => '',
				),
				'css_format'      => array(
					'top'    => 'padding-top: {{value}};',
					'bottom' => 'padding-bottom: {{value}};',
				),
				'selector'        => '#sidebar-secondary, #sidebar-primary, #main',
			),

			// Page layout.
			array(
				'name'           => 'sidebar_layout_section',
				'type'           => 'section',
				'panel'          => 'layout_panel',
				'theme_supports' => '',
				'title'          => __( 'Sidebars', 'customify' ),
			),
			// Global sidebar layout.
			array(
				'name'    => 'sidebar_layout',
				'type'    => 'select',
				'default' => 'content-sidebar',
				'section' => 'sidebar_layout_section',
				'title'   => __( 'Default Sidebar Layout', 'customify' ),
				'choices' => customify_get_config_sidebar_layouts(),
			),
			// Sidebar vertical border.
			array(
				'name'       => 'sidebar_vertical_border',
				'type'       => 'radio_group',
				'section'    => 'sidebar_layout_section',
				'title'      => __( 'Sidebar with vertical border', 'customify' ),
				'choices'    => array(
					'sidebar_vertical_border'    => __( 'Yes', 'customify' ),
					'no-sidebar_vertical_border' => __( 'No', 'customify' ),
				),
				'default'    => 'sidebar_vertical_border',
				'css_format' => 'html_class',
				'selector'   => 'body',
			),

			// Page sidebar layout.
			array(
				'name'    => 'page_sidebar_layout',
				'type'    => 'select',
				'default' => 'content-sidebar',
				'section' => 'sidebar_layout_section',
				'title'   => __( 'Pages', 'customify' ),
				'choices' => customify_get_config_sidebar_layouts(),
			),
			// Blog Posts sidebar layout.
			array(
				'name'    => 'posts_sidebar_layout',
				'type'    => 'select',
				'default' => 'content-sidebar',
				'section' => 'sidebar_layout_section',
				'title'   => __( 'Blog posts', 'customify' ),
				'choices' => customify_get_config_sidebar_layouts(),
			),
			// Blog Posts sidebar layout.
			array(
				'name'    => 'posts_archives_sidebar_layout',
				'type'    => 'select',
				'default' => 'content-sidebar',
				'section' => 'sidebar_layout_section',
				'title'   => __( 'Blog Archive Page', 'customify' ),
				'choices' => customify_get_config_sidebar_layouts(),
			),
			// Search.
			array(
				'name'    => 'search_sidebar_layout',
				'type'    => 'select',
				'default' => 'content-sidebar',
				'section' => 'sidebar_layout_section',
				'title'   => __( 'Search Page', 'customify' ),
				'choices' => customify_get_config_sidebar_layouts(),
			),
			// 404.
			array(
				'name'    => '404_sidebar_layout',
				'type'    => 'select',
				'default' => 'content',
				'section' => 'sidebar_layout_section',
				'title'   => __( '404 Page', 'customify' ),
				'choices' => customify_get_config_sidebar_layouts(),
			),
		);

		$post_types = Customify()->get_post_types( false );

		if ( count( $post_types ) ) {
			$config[] = array(
				'name'    => 'post_types_sidebar_h_tb',
				'type'    => 'heading',
				'section' => 'sidebar_layout_section',
				'title'   => __( 'Post Type Settings', 'customify' ),
			);

			foreach ( $post_types as $pt => $label ) {
				$config[] = array(
					'name'    => "{$pt}_sidebar_layout",
					'type'    => 'select',
					'default' => 'content',
					'section' => 'sidebar_layout_section',
					'title'   => sprintf( __( 'Single %s', 'customify' ), $label['singular_name'] ),
					'choices' => array_merge(
						array( 'default' => __( 'Default', 'customify' ) ),
						customify_get_config_sidebar_layouts()
					),
				);
			}
		}

		return array_merge( $configs, $config );
	}
}

add_filter( 'customify/customizer/config', 'customify_customizer_layouts_config' );
configs/search.php000066600000003700151151110650010152 0ustar00<?php
if ( ! function_exists( 'customify_customizer_search_config' ) ) {
	function customify_customizer_search_config( $configs = array() ) {

		$args = array(
			'name'     => __( 'Search Results', 'customify' ),
			'id'       => 'search_results',
			'selector' => '',
			'cb'       => '',
		);

		$top_panel     = 'blog_panel';
		$level_2_panel = 'section_' . $args['id'];

		$config = array(

			array(
				'name'  => $level_2_panel,
				'type'  => 'section',
				'panel' => $top_panel,
				'title' => $args['name'],
			),

			array(
				'name'            => $args['id'] . '_excerpt_type',
				'type'            => 'select',
				'section'         => $level_2_panel,
				'default'         => 'excerpt',
				'choices'         => array(
					'custom'   => __( 'Custom', 'customify' ),
					'excerpt'  => __( 'Use excerpt metabox', 'customify' ),
					'more_tag' => __( 'Strip excerpt by more tag', 'customify' ),
					'content'  => __( 'Full content', 'customify' ),
				),
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Excerpt Type', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_excerpt_length',
				'type'            => 'number',
				'section'         => $level_2_panel,
				'default'         => 150,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Excerpt Length', 'customify' ),
				'required'        => array( $args['id'] . '_excerpt_type', '=', 'custom' ),
			),
			array(
				'name'            => $args['id'] . '_excerpt_more',
				'type'            => 'text',
				'section'         => $level_2_panel,
				'default'         => '',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Excerpt More', 'customify' ),
			),

		);

		return array_merge( $configs, $config );

	}
}

add_filter( 'customify/customizer/config', 'customify_customizer_search_config' );
configs/footer/templates.php000066600000004651151151110650012207 0ustar00<?php

class Customify_Builder_Footer_Templates {
	public $id = 'footer_templates';

	function customize() {
		$section = 'footer_templates';
		$prefix  = 'footer_templates_';

		$id          = 'footer';
		$theme_name  = wp_get_theme()->get( 'Name' );
		$option_name = "{$theme_name}_{$id}_saved_templates";

		$saved_templates = get_option( $option_name );
		if ( ! is_array( $saved_templates ) ) {
			$saved_templates = array();
		}

		$saved_templates = array_reverse( $saved_templates );

		$n = count( $saved_templates );

		$html = '';
		$html .= '<span class="customize-control-title">' . __( 'Saved Templates', 'customify' ) . '</span>';
		$html .= '<ul class="list-saved-templates list-boxed ' . ( $n > 0 ? 'has-templates' : 'no-templates' ) . '">';
		if ( count( $saved_templates ) > 0 ) {
			foreach ( $saved_templates as $key => $tpl ) {
				$tpl = wp_parse_args(
					$tpl,
					array(
						'name' => '',
						'data' => '',
					)
				);
				if ( ! $tpl['name'] ) {
					$name = __( 'Untitled', 'customify' );
				} else {
					$name = $tpl['name'];
				}
				$html .= '<li class="saved_template li-boxed" data-control-id="' . esc_attr( $prefix . 'save' ) . '" data-id="' . esc_attr( $key ) . '" data-data="' . esc_attr( json_encode( $tpl['data'] ) ) . '">' . esc_html( $name ) . ' <a href="#" class="load-tpl">' . __( 'Load', 'customify' ) . '</a><a href="#" class="remove-tpl">' . __( 'Remove', 'customify' ) . '</a></li>'; // phpcs:ignore
			}
		}

		$html .= '<li class="no_template">' . __( 'No saved templates.', 'customify' ) . '</li>';

		$html .= '</ul>';
		$html .= '</div>';

		return array(
			array(
				'name'     => $section,
				'type'     => 'section',
				'panel'    => 'footer_settings',
				'priority' => 0,
				'title'    => __( 'Templates', 'customify' ),
			),

			array(
				'name'           => $prefix . 'save',
				'type'           => 'custom_html',
				'section'        => $section,
				'theme_supports' => '',
				'title'          => __( 'Save Template', 'customify' ),
				'description'    => '<div class="save-template-form"><input type="text" data-builder-id="footer" data-control-id="' . esc_attr( $prefix . 'save' ) . '" class="template-input-name change-by-js"><button class="button button-secondary save-builder-template" type="button">' . esc_html__( 'Save', 'customify' ) . '</button></div>' . $html,
			),
		);
	}
}

Customify_Customize_Layout_Builder()->register_item( 'footer', 'Customify_Builder_Footer_Templates' );
configs/footer/widgets.php000066600000013201151151110650011646 0ustar00<?php

class Customify_Builder_Item_Footer_Widget_1 {
	public $id = 'footer-1';

	function item() {
		return array(
			'name'    => __( 'Footer Sidebar 1', 'customify' ),
			'id'      => 'footer-1',
			'width'   => '3',
			'section' => 'sidebar-widgets-footer-1',
		);
	}

	function customize() {
		return customify_footer_layout_settings( 'footer-1', 'sidebar-widgets-footer-1' );
	}
}

class Customify_Builder_Item_Footer_Widget_2 { //phpcs:ignore
	public $id = 'footer-2';

	function item() {
		return array(
			'name'    => __( 'Footer Sidebar 2', 'customify' ),
			'id'      => 'footer-2',
			'width'   => '3',
			'section' => 'sidebar-widgets-footer-2',
		);
	}

	function customize() {
		return customify_footer_layout_settings( 'footer-2', 'sidebar-widgets-footer-2' );
	}
}

class Customify_Builder_Item_Footer_Widget_3 { //phpcs:ignore
	public $id = 'footer-3';

	function item() {
		return array(
			'name'    => __( 'Footer Sidebar 3', 'customify' ),
			'id'      => 'footer-3',
			'width'   => '3',
			'section' => 'sidebar-widgets-footer-3',
		);
	}

	function customize() {
		return customify_footer_layout_settings( 'footer-3', 'sidebar-widgets-footer-3' );
	}
}

class Customify_Builder_Item_Footer_Widget_4 { //phpcs:ignore
	public $id = 'footer-4';

	function item() {
		return array(
			'name'    => __( 'Footer Sidebar 4', 'customify' ),
			'id'      => 'footer-4',
			'width'   => '3',
			'section' => 'sidebar-widgets-footer-4',
		);
	}

	function customize() {
		return customify_footer_layout_settings( 'footer-4', 'sidebar-widgets-footer-4' );
	}
}

class Customify_Builder_Item_Footer_Widget_5 { //phpcs:ignore
	public $id = 'footer-5';

	function item() {
		return array(
			'name'    => __( 'Footer Sidebar 5', 'customify' ),
			'id'      => 'footer-5',
			'width'   => '3',
			'section' => 'sidebar-widgets-footer-5',
		);
	}

	function customize() {
		return customify_footer_layout_settings( 'footer-5', 'sidebar-widgets-footer-5' );
	}
}

class Customify_Builder_Item_Footer_Widget_6 { //phpcs:ignore
	public $id = 'footer-6';

	function item() {
		return array(
			'name'    => __( 'Footer Sidebar 6', 'customify' ),
			'id'      => 'footer-6',
			'width'   => '3',
			'section' => 'sidebar-widgets-footer-6',
		);
	}

	function customize() {
		return customify_footer_layout_settings( 'footer-6', 'sidebar-widgets-footer-6' );
	}
}


function customify_change_footer_widgets_location( $wp_customize ) {
	for ( $i = 1; $i <= 6; $i ++ ) {
		if ( $wp_customize->get_section( 'sidebar-widgets-footer-' . $i ) ) {
			$wp_customize->get_section( 'sidebar-widgets-footer-' . $i )->panel = 'footer_settings';
		}
	}

}

add_action( 'customize_register', 'customify_change_footer_widgets_location', 999 );

/**
 * Always show footer widgets for customize builder
 *
 * @param bool   $active
 * @param string $section
 *
 * @return bool
 */
function customify_customize_footer_widgets_show( $active, $section ) {
	if ( strpos( $section->id, 'widgets-footer-' ) ) {
		$active = true;
	}

	return $active;
}

add_filter( 'customize_section_active', 'customify_customize_footer_widgets_show', 15, 2 );


/**
 * Display Footer widget
 *
 * @param string $footer_id
 */
function customify_builder_footer_widget_item( $footer_id = 'footer-1' ) {
	$show = false;
	if ( is_active_sidebar( $footer_id ) ) {
		echo '<div class="widget-area">';
		dynamic_sidebar( $footer_id );
		$show = true;
		echo '</div>';
	}

	// Show admin notice.
	if ( ! $show ) {
		if ( current_user_can( 'edit_theme_options' ) ) {
			echo '<div class="widget-area">';
			$id = str_replace( 'footer-', '', $footer_id );
			the_widget(
				'WP_Widget_Text',
				array(
					'title'  => sprintf( __( 'Footer Widget %s', 'customify' ), $id ),
					'text'   => sprintf( // WPCS: XSS ok.
						/*Translators: 1: Admin URL2: Customize URL 3: Footer ID */
						__( '<p>Replace this widget content by going to <a href="%1$s"><strong>Appearance &rarr; Customize &rarr; Footer &rarr; Footer %2$s</strong></a> and adding widgets into this widget area.</p>', 'customify' ),
						esc_url( admin_url( 'customize.php?autofocus[section]=sidebar-widgets-footer-' . $id ) ),
						$id
					),
					'filter' => true,
					'visual' => true,
				),
				array(
					'before_widget' => '<section id="placeholder-widget-text" class="widget widget_text">',
					'after_widget'  => '</section>',
					'before_title'  => '<h4 class="widget-title">',
					'after_title'   => '</h4>',
				)
			);
			echo '</div>';
		}
	}

}

function customify_builder_footer_1_item() {
	customify_builder_footer_widget_item( 'footer-1' );
}

function customify_builder_footer_2_item() {
	customify_builder_footer_widget_item( 'footer-2' );
}

function customify_builder_footer_3_item() {
	customify_builder_footer_widget_item( 'footer-3' );
}

function customify_builder_footer_4_item() {
	customify_builder_footer_widget_item( 'footer-4' );
}

function customify_builder_footer_5_item() {
	customify_builder_footer_widget_item( 'footer-5' );
}

function customify_builder_footer_6_item() {
	customify_builder_footer_widget_item( 'footer-6' );
}

Customify_Customize_Layout_Builder()->register_item( 'footer', new Customify_Builder_Item_Footer_Widget_1() );
Customify_Customize_Layout_Builder()->register_item( 'footer', new Customify_Builder_Item_Footer_Widget_2() );
Customify_Customize_Layout_Builder()->register_item( 'footer', new Customify_Builder_Item_Footer_Widget_3() );
Customify_Customize_Layout_Builder()->register_item( 'footer', new Customify_Builder_Item_Footer_Widget_4() );
Customify_Customize_Layout_Builder()->register_item( 'footer', new Customify_Builder_Item_Footer_Widget_5() );
Customify_Customize_Layout_Builder()->register_item( 'footer', new Customify_Builder_Item_Footer_Widget_6() );
configs/footer/panel.php000066600000012036151151110650011304 0ustar00<?php

class Customify_Builder_Footer extends Customify_Customize_Builder_Panel {
	public $id = 'footer';

	function get_config() {
		return array(
			'id'         => $this->id,
			'title'      => __( 'Footer Builder', 'customify' ),
			'control_id' => 'footer_builder_panel',
			'panel'      => 'footer_settings',
			'section'    => 'footer_builder_panel',
			'devices'    => array(
				'desktop' => __( 'Footer Layout', 'customify' ),
			),
		);
	}

	function get_rows_config() {
		return array(
			'main'   => __( 'Footer Main', 'customify' ),
			'bottom' => __( 'Footer Bottom', 'customify' ),
		);
	}

	function customize() {
		$fn     = 'customify_customize_render_footer';
		$config = array(
			array(
				'name'     => 'footer_settings',
				'type'     => 'panel',
				'priority' => 98,
				'title'    => __( 'Footer', 'customify' ),
			),

			array(
				'name'  => 'footer_builder_panel',
				'type'  => 'section',
				'panel' => 'footer_settings',
				'title' => __( 'Footer Builder', 'customify' ),
			),

			array(
				'name'                => 'footer_builder_panel',
				'type'                => 'js_raw',
				'section'             => 'footer_builder_panel',
				'theme_supports'      => '',
				'title'               => __( 'Footer Builder', 'customify' ),
				'selector'            => '#site-footer',
				'render_callback'     => $fn,
				'container_inclusive' => true,
			),

		);

		return $config;
	}

	function row_config( $section = false, $section_name = false ) {

		if ( ! $section ) {
			$section = 'footer_top';
		}
		if ( ! $section_name ) {
			$section_name = __( 'Footer Top', 'customify' );
		}

		// Text skin.
		$color_mode = 'dark-mode';
		if ( 'footer_top' == $section ) {
			$color_mode = 'light-mode';
		}

		$selector           = '#cb-row--' . str_replace( '_', '-', $section );
		$skin_mode_selector = '.footer--row-inner.' . str_replace( '_', '-', $section ) . '-inner';

		$fn = 'customify_customize_render_footer';

		$config = array(
			array(
				'name'           => $section,
				'type'           => 'section',
				'panel'          => 'footer_settings',
				'theme_supports' => '',
				'title'          => $section_name,
			),

			array(
				'name'            => $section . '_layout',
				'type'            => 'select',
				'section'         => $section,
				'title'           => __( 'Layout', 'customify' ),
				'selector'        => $selector,
				'render_callback' => $fn,
				'css_format'      => 'html_class',
				'default'         => 'layout-full-contained',
				'choices'         => array(
					'layout-full-contained' => __( 'Full width - Contained', 'customify' ),
					'layout-fullwidth'      => __( 'Full Width', 'customify' ),
					'layout-contained'      => __( 'Contained', 'customify' ),
				),
			),

			array(
				'name'        => $section . '_noti_layout',
				'type'        => 'custom_html',
				'section'     => $section,
				'title'       => '',
				'description' => __( "Layout <code>Full width - Contained</code> and <code>Full Width</code> will not fit browser width because you've selected <a class='focus-control' data-id='site_layout' href='#'>Site Layout</a> as <code>Boxed</code> or <code>Framed</code>", 'customify' ),
				'required'    => array(
					array( 'site_layout', '=', array( 'site-boxed', 'site-framed' ) ),
				),
			),

			array(
				'name'       => $section . '_text_mode',
				'type'       => 'image_select',
				'section'    => $section,
				'selector'   => $skin_mode_selector,
				'css_format' => 'html_class',
				'title'      => __( 'Skin Mode', 'customify' ),
				'default'    => $color_mode,
				'choices'    => array(
					'dark-mode'  => array(
						'img'   => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/text_mode_light.svg',
						'label' => 'Dark',
					),
					'light-mode' => array(
						'img'   => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/text_mode_dark.svg',
						'label' => 'Light',
					),
				),
			),

			array(
				'name'       => "{$section}_background_color",
				'type'       => 'color',
				'section'    => $section,
				'title'      => __( 'Background Color', 'customify' ),
				'selector'   => "{$selector} .footer--row-inner",
				'css_format' => 'background-color: {{value}}',
			),
		);
		$config = apply_filters( 'customify/builder/' . $this->id . '/rows/section_configs', $config, $section, $section_name );
		return $config;
	}
}

function customify_footer_layout_settings( $item_id, $section ) {

	global $wp_customize;

	if ( is_object( $wp_customize ) ) {
		global $wp_registered_sidebars;
		$name = $section;
		if ( is_array( $wp_registered_sidebars ) ) {
			if ( isset( $wp_registered_sidebars[ $item_id ] ) ) {
				$name = $wp_registered_sidebars[ $item_id ]['name'];
			}
		}
		$wp_customize->add_section(
			$section,
			array(
				'title' => $name,
			)
		);
	}

	if ( function_exists( 'customify_header_layout_settings' ) ) {
		return customify_header_layout_settings( $item_id, $section, 'customify_customize_render_footer', 'footer_' );
	}

	return false;
}

Customify_Customize_Layout_Builder()->register_builder( 'footer', new Customify_Builder_Footer() );



configs/footer/social-icons.php000066600000001011151151110650012557 0ustar00<?php

class Customify_Builder_Footer_Item_Social_Icons extends Customify_Builder_Item_Social_Icons {
	public $id;
	public $section;
	public $class;
	public $selector;
	public $panel;

	function __construct() {
		$this->id      = 'footer-social-icons';
		$this->section = 'footer_social_icons';
		$this->class   = 'footer-social-icons';
		$this->panel   = 'footer_settings';
		parent::__construct();
	}
}

Customify_Customize_Layout_Builder()->register_item( 'footer', new Customify_Builder_Footer_Item_Social_Icons() );
configs/footer/copyright.php000066600000005211151151110650012212 0ustar00<?php

class Customify_Builder_Footer_Item_Copyright {
	public $id = 'footer_copyright';
	public $section = 'footer_copyright';
	public $name = 'footer_copyright';
	public $label = '';

	/**
	 * Optional construct
	 */
	function __construct() {
		$this->label = __( 'Copyright', 'customify' );
	}

	/**
	 * Register Builder item
	 *
	 * @return array
	 */
	function item() {
		return array(
			'name'    => __( 'Copyright', 'customify' ),
			'id'      => $this->id,
			'col'     => 0,
			'width'   => '6',
			'section' => $this->section, // Customizer section to focus when click settings.
		);
	}

	/**
	 * Optional, Register customize section and panel.
	 *
	 * @return array
	 */
	function customize() {
		$fn = array( $this, 'render' );

		$config = array(
			array(
				'name'  => $this->section,
				'type'  => 'section',
				'panel' => 'footer_settings',
				'title' => $this->label,
			),

			array(
				'name'            => $this->name,
				'type'            => 'textarea',
				'section'         => $this->section,
				'selector'        => '.builder-footer-copyright-item',
				'render_callback' => $fn,
				'theme_supports'  => '',
				'default'         => __( 'Copyright &copy; {current_year} {site_title} - Powered by {theme_author}.', 'customify' ),
				'title'           => __( 'Copyright Text', 'customify' ),
				'description'     => __( 'Arbitrary HTML code or shortcode. Available tags: {current_year}, {site_title}, {theme_author}', 'customify' ),
			),

			array(
				'name'       => $this->name . '_typography',
				'type'       => 'typography',
				'section'    => $this->section,
				'title'      => __( 'Copyright Text Typography', 'customify' ),
				'selector'   => '.builder-item--footer_copyright, .builder-item--footer_copyright p',
				'css_format' => 'typography',
				'default'    => array(),
			),
		);

		return array_merge( $config, customify_footer_layout_settings( $this->id, $this->section ) );
	}

	/**
	 * Optional. Render item content
	 */
	function render() {
		$tags = array(
			'current_year' => date_i18n( 'Y' ),
			'site_title'   => get_bloginfo( 'name' ),
			'theme_author' => sprintf( '<a href="https://pressmaximum.com/customify">%1$s</a>', 'Customify' ), // Brand name.
		);

		$content = Customify()->get_setting( $this->name );

		foreach ( $tags as $k => $v ) {
			$content = str_replace( '{' . $k . '}', $v, $content );
		}

		echo '<div class="builder-footer-copyright-item footer-copyright">';
		echo apply_filters( 'customify_the_content', wp_kses_post( balanceTags( $content, true ) ) ); // WPCS: XSS OK.
		echo '</div>';
	}
}

Customify_Customize_Layout_Builder()->register_item( 'footer', new Customify_Builder_Footer_Item_Copyright() );
configs/page-header.php000066600000075460151151110650011063 0ustar00<?php

class Customify_Page_Header {
	public $name = null;
	public $description = null;
	static $is_transparent = null;
	static $_instance = null;
	static $_settings = null;

	function __construct() {
		add_filter( 'customify/customizer/config', array( $this, 'config' ) );
		if ( ! is_admin() ) {
			add_action( 'customify_is_post_title_display', array( $this, 'display_page_title' ), 35 );
			add_action( 'customify/site-start', array( $this, 'render' ), 35 );
			add_action( 'wp', array( $this, 'wp' ), 85 );
		}
		self::$_instance = $this;
	}

	function wp() {
		$this->get_settings();
	}

	static function get_instance() {
		if ( is_null( self::$_instance ) ) {
			self::$_instance = new self();
		}

		return self::$_instance;
	}

	function config( $configs = array() ) {
		$section      = 'page_header';
		$name         = 'page_header';
		$choices      = array(
			'default'  => __( 'Default', 'customify' ),
			'cover'    => __( 'Cover', 'customify' ),
			'titlebar' => __( 'Titlebar', 'customify' ),
			'none'     => __( 'Hide', 'customify' ),
		);
		$render_cb_el = array( $this, 'render' );

		$display_fields = array(
			array(
				'name'        => 'page',
				'type'        => 'select',
				'label'       => __( 'Display on single page', 'customify' ),
				'description' => __( 'Apply when viewing single page', 'customify' ),
				'default'     => 'titlebar',
				'choices'     => $choices,
			),
			array(
				'name'        => 'post',
				'type'        => 'select',
				'label'       => __( 'Display on single post', 'customify' ),
				'description' => __( 'Apply when viewing single post', 'customify' ),
				'default'     => '',
				'choices'     => $choices,
			),

			array(
				'name'        => 'category',
				'type'        => 'select',
				'label'       => __( 'Display on categories', 'customify' ),
				'description' => __( 'Apply when viewing a category page', 'customify' ),
				'default'     => '',
				'choices'     => $choices,
			),
			array(
				'name'        => 'index',
				'type'        => 'select',
				'label'       => __( 'Display on index', 'customify' ),
				'description' => __( 'Apply when your homepage displays as latest posts', 'customify' ),
				'default'     => '',
				'choices'     => $choices,
			),
			array(
				'name'        => 'search',
				'type'        => 'select',
				'label'       => __( 'Display on search', 'customify' ),
				'description' => __( 'Apply when viewing search results page', 'customify' ),
				'default'     => '',
				'choices'     => $choices,
			),
			array(
				'name'        => 'archive',
				'type'        => 'select',
				'label'       => __( 'Display on archive', 'customify' ),
				'description' => __( 'Apply when viewing archive pages, e.g. Tag, Author, Date, Custom Post Type or Custom Taxonomy', 'customify' ),
				'default'     => '',
				'choices'     => $choices,
			),
			array(
				'name'        => 'page_404',
				'type'        => 'select',
				'label'       => __( 'Display on 404 page', 'customify' ),
				'description' => __( 'Apply when the page not found', 'customify' ),
				'default'     => '',
				'choices'     => $choices,
			),

		);

		$title_fields = array(
			array(
				'name'        => 'index',
				'type'        => 'text',
				'label'       => __( 'Title for index page', 'customify' ),
				'description' => __( 'Apply when your homepage displays as latest posts', 'customify' ),
				'default'     => '',
			),
			array(
				'name'        => 'post',
				'type'        => 'text',
				'label'       => __( 'Title for single post', 'customify' ),
				'description' => __( 'Apply when viewing single post', 'customify' ),
				'default'     => '',
			),
			array(
				'name'        => 'page_404',
				'type'        => 'text',
				'label'       => __( 'Title for 404 page', 'customify' ),
				'description' => __( 'Apply when the page not found', 'customify' ),
				'default'     => '',
			),
		);

		$tagline_fields = array(
			array(
				'name'        => 'index',
				'type'        => 'textarea',
				'label'       => __( 'Tagline for index page', 'customify' ),
				'description' => __( 'Apply when your homepage displays as latest posts', 'customify' ),
				'default'     => '',
			),
			array(
				'name'        => 'post',
				'type'        => 'textarea',
				'label'       => __( 'Tagline for single post', 'customify' ),
				'description' => __( 'Apply when viewing single post', 'customify' ),
				'default'     => '',
			),
			array(
				'name'        => 'page_404',
				'type'        => 'textarea',
				'label'       => __( 'Tagline for 404 page', 'customify' ),
				'description' => __( 'Apply when the page not found', 'customify' ),
				'default'     => '',
			),
		);

		$post_types = Customify()->get_post_types( false );
		if ( count( $post_types ) > 0 ) {
			foreach ( $post_types as $pt => $label ) {
				$display_fields[] = array(
					'name'        => $pt,
					'type'        => 'select',
					'label'       => sprintf( __( 'Display on %s page', 'customify' ), $label['singular_name'] ),
					'description' => sprintf( __( 'Apply when viewing single %s', 'customify' ), $label['singular_name'] ),
					'default'     => '',
					'choices'     => $choices,
				);

				$taxonomy_filter_args = [
					'show_in_nav_menus' => true,
				];

				$taxonomy_filter_args['object_type'] = [ $pt ];
				$taxonomies                          = get_taxonomies( $taxonomy_filter_args, 'objects' );
				$options                             = array();

				foreach ( $taxonomies as $taxonomy => $object ) {
					$options[ $taxonomy ] = $object->label;
					$display_fields[]     = array(
						'name'        => $taxonomy,
						'type'        => 'select',
						'label'       => sprintf( __( 'Display on %1$s %2$s', 'customify' ), $label['singular_name'], $object->labels->singular_name ),
						'description' => sprintf( __( 'Apply when viewing %1$s %2$s', 'customify' ), $label['singular_name'], $object->labels->singular_name ),
						'default'     => '',
						'choices'     => $choices,
					);
				}

				$title_fields[] = array(
					'name'        => $pt,
					'type'        => 'text',
					'label'       => sprintf( __( 'Title for %s', 'customify' ), $label['singular_name'] ),
					'description' => sprintf( __( 'Apply when viewing single %s', 'customify' ), $label['singular_name'] ),
					'default'     => '',
				);

				$tagline_fields[] = array(
					'name'        => $pt,
					'type'        => 'textarea',
					'label'       => sprintf( __( 'Tagline for %s', 'customify' ), $label['singular_name'] ),
					'description' => sprintf( __( 'Apply when viewing single %s', 'customify' ), $label['singular_name'] ),
					'default'     => '',
				);
			}
		}

		$config = array(
			array(
				'name'  => $section,
				'type'  => 'section',
				'panel' => 'layout_panel',
				'title' => __( 'Page Header', 'customify' ),
			),

			array(
				'name'       => $section . '_layout',
				'type'       => 'select',
				'section'    => $section,
				'title'      => __( 'Layout', 'customify' ),
				'selector'   => '.page-header--item',
				'css_format' => 'html_class',
				'default'    => '',
				'choices'    => array(
					''                      => __( 'Default', 'customify' ),
					'layout-full-contained' => __( 'Full width - Contained', 'customify' ),
					'layout-fullwidth'      => __( 'Full Width', 'customify' ),
					'layout-contained'      => __( 'Contained', 'customify' ),
				),
			),

			array(
				'name'    => "{$name}_display_h",
				'type'    => 'heading',
				'section' => $section,
				'title'   => __( 'Display Settings', 'customify' ),
			),

			array(
				'name'        => "{$name}_display",
				'type'        => 'modal',
				'section'     => $section,
				'label'       => __( 'Display', 'customify' ),
				'description' => __( 'Settings display for special pages.', 'customify' ),
				'default'     => array(
					'display' => array(
						'page'     => 'titlebar',
						'archive'  => 'titlebar',
						'category' => 'titlebar',
					),
				),
				'fields'      => array(
					'tabs'            => array(
						'display'  => __( 'Display', 'customify' ),
						'advanced' => __( 'Advanced', 'customify' ),
					),
					'display_fields'  => $display_fields,
					'advanced_fields' => array(
						array(
							'name'        => 'post_bg',
							'type'        => 'select',
							'label'       => __( 'Post Header Background Cover', 'customify' ),
							'description' => __( 'Apply when viewing single post and page header setting displays as cover.', 'customify' ),
							'default'     => '',
							'choices'     => array(
								'default'   => __( 'Default', 'customify' ),
								'blog_page' => __( 'Use featured image from blog page', 'customify' ),
								'featured'  => __( 'Use featured image of current post', 'customify' ),
							),
						),
						array(
							'name'    => 'post_title_tagline',
							'type'    => 'select',
							'label'   => __( 'Single Post Title & Tagline', 'customify' ),
							'default' => '',
							'choices' => array(
								'default'   => __( 'Default', 'customify' ),
								'blog_page' => __( 'Use title & tagline from blog page', 'customify' ),
								'current'   => __( 'Use title & tagline of current post', 'customify' ),
							),
						),
					),
				),
			),

			array(
				'name'            => "{$name}_title_tagline",
				'type'            => 'modal',
				'section'         => $section,
				'label'           => __( 'Title & Tagline', 'customify' ),
				'description'     => __( 'Title & tagline for special pages.', 'customify' ),
				'default'         => array(),
				'fields'          => array(
					'tabs'            => array(
						'titles'   => __( 'Title', 'customify' ),
						'taglines' => __( 'Tagline', 'customify' ),
					),
					'titles_fields'   => $title_fields,
					'taglines_fields' => $tagline_fields,
				),
				'selector'        => '#page-titlebar, #page-cover',
				'render_callback' => $render_cb_el,
			),

			array(
				'name'            => $name . '_show_archive_prefix',
				'type'            => 'checkbox',
				'section'         => $section,
				'title'           => __( 'Archive Prefix', 'customify' ),
				'description'     => __( 'Enable or disable archive prefix on category, date, tag page.', 'customify' ),
				'checkbox_label'  => __( 'Enable', 'customify' ),
				'default'         => 1,
				'selector'        => '#page-titlebar, #page-cover',
				'render_callback' => $render_cb_el,
			),

		);

		$configs = array_merge( $configs, $config );
		$configs = array_merge( $configs, $this->config_cover() );
		$configs = array_merge( $configs, $this->config_titlebar() );

		return $configs;
	}

	function config_titlebar() {

		$section      = 'page_header';
		$render_cb_el = array( $this, 'render' );
		$selector     = '#page-titlebar';
		$name         = 'titlebar';
		$config       = array(

			array(
				'name'    => "{$name}_styling_h_tb",
				'type'    => 'heading',
				'section' => 'page_header',
				'title'   => __( 'Titlebar Settings', 'customify' ),
			),

			array(
				'name'           => $name . '_show_title',
				'type'           => 'checkbox',
				'section'        => $section,
				'label'          => __( 'Show Title', 'customify' ),
				'description'    => __( 'Title is pull from post title, archive title.', 'customify' ),
				'checkbox_label' => __( 'Enable', 'customify' ),
				'default'        => 1,
			),

			array(
				'name'           => $name . '_show_tagline',
				'type'           => 'checkbox',
				'section'        => $section,
				'label'          => __( 'Show Tagline', 'customify' ),
				'description'    => __( 'Tagline is pull from post excerpt, archive description.', 'customify' ),
				'checkbox_label' => __( 'Enable', 'customify' ),
				'default'        => 1,
			),
			array(
				'name'            => "{$name}_align",
				'type'            => 'text_align_no_justify',
				'section'         => $section,
				'device_settings' => true,
				'selector'        => "$selector",
				'css_format'      => 'text-align: {{value}};',
				'title'           => __( 'Text Align', 'customify' ),
			),

		);

		$config = apply_filters( 'customify/titlebar/config', $config, $this );

		return $config;
	}

	function config_cover() {

		$section      = 'page_header';
		$render_cb_el = array( $this, 'render' );
		$selector     = '#page-cover';
		$name         = 'header_cover';
		$config       = array(

			array(
				'name'    => "{$name}_settings_h",
				'type'    => 'heading',
				'section' => $section,
				'title'   => __( 'Cover Settings', 'customify' ),
			),

			array(
				'name'           => $name . '_show_title',
				'type'           => 'checkbox',
				'section'        => $section,
				'label'          => __( 'Show Title', 'customify' ),
				'description'    => __( 'Title is pull from post title, archive title.', 'customify' ),
				'checkbox_label' => __( 'Enable', 'customify' ),
				'default'        => 1,
			),

			array(
				'name'           => $name . '_show_tagline',
				'type'           => 'checkbox',
				'section'        => $section,
				'label'          => __( 'Show Tagline', 'customify' ),
				'description'    => __( 'Tagline is pull from post excerpt, archive description.', 'customify' ),
				'checkbox_label' => __( 'Enable', 'customify' ),
				'default'        => 1,
			),

			array(
				'name'       => $name . '_bg',
				'type'       => 'modal',
				'section'    => $section,
				'title'      => __( 'Cover Background', 'customify' ),
				'selector'   => $selector,
				'css_format' => 'styling', // Styling.
				'default'    => array(
					'normal' => array(
						'bg_image' => array(
							'id'  => '',
							'url' => esc_url( get_template_directory_uri() ) . '/assets/images/default-cover.jpg',
						),
					),
				),
				'fields'     => array(
					'tabs'          => array(
						'normal' => '_',
					),
					'normal_fields' => array(
						array(
							'name'       => 'bg_image',
							'type'       => 'image',
							'label'      => __( 'Background Image', 'customify' ),
							'selector'   => "$selector",
							'css_format' => 'background-image: url("{{value}}");',
						),
						array(
							'name'       => 'bg_cover',
							'type'       => 'select',
							'choices'    => array(
								''        => __( 'Default', 'customify' ),
								'auto'    => __( 'Auto', 'customify' ),
								'cover'   => __( 'Cover', 'customify' ),
								'contain' => __( 'Contain', 'customify' ),
							),
							'required'   => array( 'bg_image', 'not_empty', '' ),
							'label'      => __( 'Size', 'customify' ),
							'class'      => 'field-half-left',
							'selector'   => "$selector",
							'css_format' => '-webkit-background-size: {{value}}; -moz-background-size: {{value}}; -o-background-size: {{value}}; background-size: {{value}};',
						),
						array(
							'name'       => 'bg_position',
							'type'       => 'select',
							'label'      => __( 'Position', 'customify' ),
							'required'   => array( 'bg_image', 'not_empty', '' ),
							'class'      => 'field-half-right',
							'choices'    => array(
								''              => __( 'Default', 'customify' ),
								'center'        => __( 'Center', 'customify' ),
								'top left'      => __( 'Top Left', 'customify' ),
								'top right'     => __( 'Top Right', 'customify' ),
								'top center'    => __( 'Top Center', 'customify' ),
								'bottom left'   => __( 'Bottom Left', 'customify' ),
								'bottom center' => __( 'Bottom Center', 'customify' ),
								'bottom right'  => __( 'Bottom Right', 'customify' ),
							),
							'selector'   => "$selector",
							'css_format' => 'background-position: {{value}};',
						),
						array(
							'name'       => 'bg_repeat',
							'type'       => 'select',
							'label'      => __( 'Repeat', 'customify' ),
							'class'      => 'field-half-left',
							'required'   => array(
								array( 'bg_image', 'not_empty', '' ),
							),
							'choices'    => array(
								'repeat'    => __( 'Default', 'customify' ),
								'no-repeat' => __( 'No repeat', 'customify' ),
								'repeat-x'  => __( 'Repeat horizontal', 'customify' ),
								'repeat-y'  => __( 'Repeat vertical', 'customify' ),
							),
							'selector'   => "$selector",
							'css_format' => 'background-repeat: {{value}};',
						),

						array(
							'name'       => 'bg_attachment',
							'type'       => 'select',
							'label'      => __( 'Attachment', 'customify' ),
							'class'      => 'field-half-right',
							'required'   => array(
								array( 'bg_image', 'not_empty', '' ),
							),
							'choices'    => array(
								''       => __( 'Default', 'customify' ),
								'scroll' => __( 'Scroll', 'customify' ),
								'fixed'  => __( 'Fixed', 'customify' ),
							),
							'selector'   => "$selector",
							'css_format' => 'background-attachment: {{value}};',
						),

						array(
							'name'            => 'overlay',
							'type'            => 'color',
							'section'         => $section,
							'class'           => 'customify--clear',
							'device_settings' => false,
							'selector'        => "$selector:before",
							'label'           => __( 'Cover Overlay', 'customify' ),
							'css_format'      => 'background-color: {{value}};',
						),

					),
					'hover_fields'  => false,
				),
			),

			array(
				'name'            => "{$name}_align",
				'type'            => 'text_align_no_justify',
				'section'         => $section,
				'device_settings' => true,
				'selector'        => "$selector",
				'css_format'      => 'text-align: {{value}};',
				'title'           => __( 'Cover Text Align', 'customify' ),
			),

			array(
				'name'            => "{$name}_height",
				'type'            => 'slider',
				'section'         => $section,
				'device_settings' => true,
				'max'             => 1000,
				'title'           => __( 'Cover Height', 'customify' ),
				'selector'        => "{$selector} .page-cover-inner",
				'css_format'      => 'min-height: {{value}};',
				'default'         => array(
					'desktop' => array(
						'value' => '300',
					),
					'tablet'  => array(
						'value' => '250',
					),
					'mobile'  => array(
						'value' => '200',
					),
				),
			),

			array(
				'name'            => "{$name}_align",
				'type'            => 'text_align_no_justify',
				'section'         => $section,
				'device_settings' => true,
				'selector'        => "$selector",
				'css_format'      => 'text-align: {{value}};',
				'title'           => __( 'Cover Text Align', 'customify' ),
			),

		);
		$config       = apply_filters( 'customify/cover/config', $config, $this );

		return $config;
	}

	function get_settings() {

		if ( ! is_null( self::$_settings ) ) {
			return self::$_settings;
		}

		$args = array(
			'_page'                      => 'index',
			'display'                    => 'default',
			'title'                      => '',
			'tagline'                    => '',
			'image'                      => '',
			'title_tag'                  => 'h1',
			'force_display_single_title' => '', // Show || or hide.
			'show_title'                 => false, // force show post title.
			'shortcode'                  => false, // force show post title.
			'cover_tagline'              => 1, // Display tagline in cover.
			'titlebar_tagline'           => 1, // Display tagline in titlbar.
		);
		$name = 'page_header';

		$display  = Customify()->get_setting_tab( $name . '_display', 'display' );
		$advanced = Customify()->get_setting_tab( $name . '_display', 'advanced' );

		$titles   = Customify()->get_setting_tab( $name . '_title_tagline', 'titles' );
		$taglines = Customify()->get_setting_tab( $name . '_title_tagline', 'taglines' );

		$args['cover_tagline']    = Customify()->get_setting( 'header_cover_show_tagline' );
		$args['titlebar_tagline'] = Customify()->get_setting( 'titlebar_show_tagline' );

		$display = wp_parse_args(
			$display,
			array(
				'index'       => '',
				'category'    => '',
				'search'      => '',
				'archive'     => '',
				'page'        => '',
				'post'        => '',
				'singular'    => '',
				'product'     => '',
				'product_cat' => '',
				'product_tag' => '',
				'page_404'    => '',
			)
		);

		$advanced = wp_parse_args(
			$advanced,
			array(
				'post_bg'            => '',
				'post_title_tagline' => '',
			)
		);

		$titles = wp_parse_args(
			$titles,
			array(
				'index'    => '',
				'post'     => '',
				'product'  => '',
				'page_404' => '',
			)
		);

		$taglines = wp_parse_args(
			$taglines,
			array(
				'index'    => '',
				'post'     => '',
				'product'  => '',
				'page_404' => '',
			)
		);

		$post_thumbnail_id = false;

		$post_id = 0;
		if ( is_front_page() && is_home() ) { // index page.
			// Default homepage.
			$args['display'] = $display['index'];
			$args['title']   = $titles['index'];
			$args['tagline'] = $taglines['index'];
			$args['_page']   = 'index';
		} elseif ( is_front_page() ) {
			// static homepage.
			$args['display'] = $display['page'];
			$post_id         = get_the_ID();
			$args['_page']   = 'page';
		} elseif ( is_home() ) {
			// blog page.
			$args['display'] = $display['page'];
			$post_id         = get_option( 'page_for_posts' );
			$args['_page']   = 'page';
		} elseif ( is_category() ) {
			// category.
			$args['display'] = $display['category'];
			$args['title']   = get_the_archive_title();
			$args['tagline'] = get_the_archive_description();
			$args['_page']   = 'category';
			$post_id         = 0;
		} elseif ( is_page() ) {
			// single page.
			$args['display'] = $display['page'];
			$post_id         = get_the_ID();
			$args['_page']   = 'page';
		} elseif ( is_singular( 'post' ) ) {
			// single post.
			$args['display']   = $display['post'];
			$args['title_tag'] = 'h2';

			// Setup single post bg for cover.
			if ( 'blog_page' == $advanced['post_bg'] ) {
				$post_id           = get_option( 'page_for_posts' );
				$post_thumbnail_id = get_post_thumbnail_id( $post_id );
			} elseif ( 'featured' == $advanced['post_bg'] ) {
				$post_thumbnail_id = get_post_thumbnail_id( get_the_ID() );
			} else {
				$post_id = get_option( 'page_for_posts' );
				if ( $post_id ) {
					$post_thumbnail_id = get_post_thumbnail_id( get_the_ID() );
				}
			}

			if ( 'none' != $args['display'] ) {
				if ( 'blog_page' == $advanced['post_title_tagline'] ) {
					$post_id                            = get_option( 'page_for_posts' );
					$args['force_display_single_title'] = 'show';
				} elseif ( 'current' == $advanced['post_title_tagline'] ) {
					$post_id = get_the_ID();
					if ( 'default' != $args['display'] ) {
						$args['force_display_single_title'] = 'hide';
					} else {
						$args['force_display_single_title'] = 'show';
					}
					$args['title_tag'] = 'h1';
				} else {
					$post_id                            = get_option( 'page_for_posts' );
					$args['force_display_single_title'] = 'show';
					if ( ! $post_id ) {
						$args['force_display_single_title'] = 'show';
						if ( $titles['post'] || $taglines['post'] ) {
							$args['title']   = $titles['post'];
							$args['tagline'] = $taglines['post'];
						}
					}
				}
			}

			$args['_page'] = 'post';
		} elseif ( is_singular() ) {
			// single custom post type.
			$post_id   = get_the_ID();
			$post_type = get_post_type();
			if ( isset( $display[ $post_type ] ) ) {
				$args['display'] = $display[ $post_type ];
				$args['_page']   = 'singular_' . $post_type;
			} elseif ( isset( $display['singular'] ) ) {
				$args['display'] = $display['singular'];
				$args['_page']   = 'singular';
			}
		} elseif ( is_404() ) {
			// page not found.
			$args['display'] = $display['page_404'];
			$args['_page']   = '404';
			$args['title']   = $titles['page_404'];
			$args['tagline'] = $taglines['page_404'];
			if ( ! $args['title'] ) {
				$args['title'] = __( "Oops! That page can't be found.", 'customify' );
			}
		} elseif ( is_search() ) {
			// Search result.
			$args['display'] = $display['search'];
			$args['title']   = sprintf( // WPCS: XSS ok.
				/* translators: 1: Search query name */
				__( 'Search Results for: %s', 'customify' ),
				'<span>' . get_search_query() . '</span>'
			);
			$args['tagline'] = '';
			$args['_page']   = 'search';
			$post_id         = 0;
		} elseif ( is_archive() ) {
			$args['display'] = $display['archive'];
			$args['title']   = get_the_archive_title();
			$args['tagline'] = get_the_archive_description();
			$args['_page']   = 'archive';
			$post_id         = 0;
		}

		if ( is_tax() ) {
			$queried_object = get_queried_object();
			if ( isset( $display[ $queried_object->taxonomy ] ) ) {
				$args['display'] = $display['product_tag'];
			}
			if ( isset( $titles[ $queried_object->taxonomy ] ) ) {
				$args['display'] = $titles[ $queried_object->taxonomy ];
			}
			if ( isset( $taglines[ $queried_object->taxonomy ] ) ) {
				$args['tagline'] = $taglines[ $queried_object->taxonomy ];
			}
			$args['_page'] = 'tax_' . $queried_object->taxonomy;
		}

		// WooCommerce Settings.
		if ( Customify()->is_woocommerce_active() ) {
			if ( is_product() ) {
				$post_id         = wc_get_page_id( 'shop' );
				$args['display'] = $display['product'];
				$args['title']   = $titles['product'];
				$args['tagline'] = $taglines['product'];
				$args['_page']   = 'product';
				if ( $args['title'] || $args['tagline'] ) {
					$post_id = 0;
				}
			} elseif ( is_product_category() ) {
				$post_id         = 0;
				$args['display'] = $display['product_cat'];
				$args['title']   = get_the_archive_title();
				$args['tagline'] = get_the_archive_description();
				$args['_page']   = 'product_cat';
			} elseif ( is_product_tag() ) {
				$post_id         = 0;
				$args['display'] = $display['product_tag'];
				$args['title']   = get_the_archive_title();
				$args['tagline'] = get_the_archive_description();
				$args['_page']   = 'product_tag';
			} elseif ( is_shop() && ! is_search() ) {
				$args['display'] = $display['page'];
				$post_id         = wc_get_page_id( 'shop' );
				$args['_page']   = 'shop';
				$args['tagline'] = '';
			}
		}

		if ( $post_id > 0 ) {
			$post = get_post( $post_id );
			if ( $post ) {
				$args['title'] = get_the_title( $post_id );
				if ( $post->post_excerpt ) {
					$args['tagline'] = get_the_excerpt( $post );
				}
				if ( ! $post_thumbnail_id ) {
					$post_thumbnail_id = get_post_thumbnail_id( $post_id );
				}
			}
		}

		if ( ! $args['image'] && $post_thumbnail_id ) {
			$_i = Customify()->get_media( $post_thumbnail_id );
			if ( $_i ) {
				$args['image'] = $_i;
			}
		}

		if ( Customify()->is_using_post() ) {
			$post_id = Customify()->get_current_post_id();

			// If Disable page title.
			$disable = get_post_meta( $post_id, '_customify_disable_page_title', true );
			if ( $disable ) {
				$args['force_display_single_title'] = 'hide';
			}

			// If has custom field custom title.
			$post_display = get_post_meta( $post_id, '_customify_page_header_display', true );
			if ( $post_display && 'default' != $post_display ) {
				if ( 'normal' == $post_display ) {
					$args['display'] = 'default';
				} else {
					$args['display'] = $post_display;
				}
			}

			// If has custom field custom title.
			$title = get_post_meta( $post_id, '_customify_page_header_title', true );
			if ( $title ) {
				$args['title'] = $title;
			}

			// If has custom field custom tagline.
			$tagline = trim( get_post_meta( $post_id, '_customify_page_header_tagline', true ) );
			if ( $tagline ) {
				$args['tagline'] = $tagline;
			}

			// If has custom field header media.
			$media = get_post_meta( $post_id, '_customify_page_header_image', true );
			if ( ! empty( $media ) ) {
				$image = Customify()->get_media( $media );
				if ( $image ) {
					$args['image'] = $image;
				}
			}

			// Has custom shortcode.
			$args['shortcode'] = trim( get_post_meta( $post_id, '_customify_page_header_shortcode', true ) );
			if ( $args['shortcode'] ) {
				$args['display'] = 'shortcode';
			}
		}

		if ( ! $args['display'] ) {
			$args['display'] = 'default';
		}

		self::$_settings = apply_filters( 'customify/page-header/get-settings', $args );

		return $args;
	}

	function display_page_title( $show ) {
		$args = $this->get_settings();
		if ( ! $args['display'] || 'default' == $args['display'] ) {
			$show = true;
		} elseif ( 'cover' == $args['display'] || 'titlebar' == $args['display'] || 'none' == $args['display'] ) {
			$show = false;
		}
		if ( 'hide' == $args['force_display_single_title'] ) {
			$show = false;
		} elseif ( 'show' == $args['force_display_single_title'] ) {
			$show = true;
		}

		return $show;
	}

	function render_cover( $args = array() ) {
		$args = $this->get_settings();
		extract( $args, EXTR_SKIP ); // phpcs:ignore

		$style = '';
		if ( $args['image'] ) {
			$style = ' style="background-image: url(\'' . esc_url( $args['image'] ) . '\')" ';
		}

		if ( ! $args['title_tag'] ) {
			$args['title_tag'] = 'h2';
		}

		$layout    = Customify()->get_setting_tab( 'page_header_layout' );
		$classes   = array( 'page-header--item page-cover' );
		$classes[] = $layout;

		?>
		<div id="page-cover" class="<?php echo esc_attr( join( ' ', $classes ) ); ?>"<?php echo $style; ?>>
			<div class="page-cover-inner customify-container">
				<?php
				do_action( 'customify/page-cover/before' );

				if ( Customify()->get_setting( 'header_cover_show_title' ) ) {
					if ( $args['title'] ) {
						// WPCS: XSS ok.
						echo '<' . $args['title_tag'] . ' class="page-cover-title">' . apply_filters( 'customify_the_title', wp_kses_post( $args['title'] ) ) . '</' . $args['title_tag'] . '>';
					}
				}
				if ( $args['cover_tagline'] ) {
					if ( $args['tagline'] ) {
						// WPCS: XSS ok.
						echo '<div class="page-cover-tagline-wrapper"><div class="page-cover-tagline">' . apply_filters( 'customify_the_title', wp_kses_post( $args['tagline'] ) ) . '</div></div>';
					}
				}

				do_action( 'customify/page-cover/after' );
				?>
			</div>
		</div>
		<?php
	}

	function render_titlebar( $args = array() ) {

		$classes   = array( 'page-header--item page-titlebar' );
		$layout    = Customify()->get_setting_tab( 'page_header_layout' );
		$classes[] = $layout;
		?>
		<div id="page-titlebar" class="<?php echo esc_attr( join( ' ', $classes ) ); ?>">
			<div class="page-titlebar-inner customify-container">
				<?php
				/**
				 * Hook titlebar before
				 */
				do_action( 'customify/titlebar/before' );

				// WPCS: XSS ok.
				if ( Customify()->get_setting( 'titlebar_show_title' ) ) {
					if ( $args['title'] ) {
						echo '<' . $args['title_tag'] . ' class="titlebar-title h4">' . apply_filters( 'customify_the_title', wp_kses_post( $args['title'] ) ) . '</' . $args['title_tag'] . '>';
					}
				}
				if ( $args['titlebar_tagline'] ) {
					if ( $args['tagline'] ) {
						// WPCS: XSS ok.
						echo '<div class="titlebar-tagline">' . apply_filters( 'customify_the_title', wp_kses_post( $args['tagline'] ) ) . '</div>';
					}
				}
				/**
				 * Hook titlebar after
				 */
				do_action( 'customify/titlebar/after' );
				?>
			</div>
		</div>
		<?php
	}

	function render() {
		$args = $this->get_settings();
		if ( 'none' == $args['display'] ) {
			return '';
		}

		switch ( $args['display'] ) {
			case 'cover':
				$this->render_cover( $args );
				break;
			case 'titlebar':
				$this->render_titlebar( $args );
				break;
			case 'shortcode':
				echo '<div class="page-header-shortcode">' . apply_filters( 'customify_the_content', $args['shortcode'] ) . '</div>';
				break;
		}

	}

}

Customify_Page_Header::get_instance();
configs/single-blog-post.php000066600000014071151151110650012075 0ustar00<?php
if ( ! function_exists( 'customify_customizer_single_blog_config' ) ) {
	function customify_customizer_single_blog_config( $configs = array() ) {

		$args = array(
			'name'     => __( 'Single Blog Post', 'customify' ),
			'id'       => 'single_blog_post',
			'selector' => '.entry.entry-single',
			'cb'       => 'customify_single_post',
		);

		$top_panel     = 'blog_panel';
		$level_2_panel = 'section_' . $args['id'];

		$config = array(
			array(
				'name'  => $level_2_panel,
				'type'  => 'section',
				'panel' => $top_panel,
				'title' => $args['name'],
			),

			array(
				'name'       => $args['id'] . '_content_width',
				'section'    => $level_2_panel,
				'type'       => 'slider',
				'max'        => 1200,
				'label'      => __( 'Content Max Width', 'customify' ),
				'selector'   => '.single-post .content-inner',
				'css_format' => 'max-width: {{value}};',
			),

			array(
				'name'             => $args['id'] . '_items',
				'section'          => $level_2_panel,
				'type'             => 'repeater',
				'title'            => __( 'Items Display', 'customify' ),
				'live_title_field' => 'title',
				'addable'          => false,
				'title_only'       => true,
				'selector'         => $args['selector'],
				'render_callback'  => $args['cb'],
				'default'          => array(
					array(
						'_visibility' => '',
						'_key'        => 'title',
						'title'       => __( 'Title', 'customify' ),
					),
					array(
						'_key'        => 'meta',
						'_visibility' => '',
						'title'       => __( 'Meta', 'customify' ),
					),
					array(
						'_key'        => 'thumbnail',
						'_visibility' => '',
						'title'       => __( 'Thumbnail', 'customify' ),
					),
					array(
						'_key'        => 'content',
						'_visibility' => '',
						'title'       => __( 'Content', 'customify' ),
					),
					array(
						'_key'        => 'categories',
						'_visibility' => 'hidden',
						'title'       => __( 'Categories', 'customify' ),
					),
					array(
						'_key'        => 'tags',
						'_visibility' => '',
						'title'       => __( 'Tags', 'customify' ),
					),
					array(
						'_key'        => 'author_bio',
						'_visibility' => 'hidden',
						'title'       => __( 'Author Biography', 'customify' ),
					),
					array(
						'_key'        => 'navigation',
						'_visibility' => '',
						'title'       => __( 'Post Navigation', 'customify' ),
					),

					array(
						'_key'        => 'related',
						'_visibility' => 'hidden',
						'title'       => __( 'Related Posts', 'customify' ),
					),

					array(
						'_key'        => 'comment_form',
						'_visibility' => '',
						'title'       => __( 'Comment Form', 'customify' ),
					),

				),
				'fields'           => array(
					array(
						'name' => '_key',
						'type' => 'hidden',
					),
					array(
						'name'  => 'title',
						'type'  => 'hidden',
						'label' => __( 'Title', 'customify' ),
					),
				),
			),

			array(
				'name'            => $args['id'] . '_thumbnail_size',
				'type'            => 'select',
				'section'         => $level_2_panel,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'default'         => 'large',
				'label'           => __( 'Thumbnail Size', 'customify' ),
				'choices'         => customify_get_all_image_sizes(),
			),

			array(
				'name'    => $level_2_panel . '_h_meta',
				'type'    => 'heading',
				'section' => $level_2_panel,
				'title'   => __( 'Meta Settings', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_meta_sep',
				'section'         => $level_2_panel,
				'type'            => 'text',
				'default'         => '',
				'label'           => __( 'Separator', 'customify' ),
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
			),

			array(
				'name'       => $args['id'] . '_meta_sep_width',
				'section'    => $level_2_panel . '_meta',
				'type'       => 'slider',
				'max'        => 20,
				'label'      => __( 'Separator Width', 'customify' ),
				'selector'   => $args['selector'] . ' .entry-meta .sep',
				'css_format' => 'margin-left: calc( {{value}} / 2 ); margin-right: calc( {{value}} / 2 );',
			),

			array(
				'name'             => $args['id'] . '_meta_config',
				'section'          => $level_2_panel,
				'type'             => 'repeater',
				'description'      => __( 'Drag to reorder the meta item.', 'customify' ),
				'live_title_field' => 'title',
				'limit'            => 4,
				'addable'          => false,
				'title_only'       => true,
				'selector'         => $args['selector'],
				'render_callback'  => $args['cb'],
				'default'          => array(
					array(
						'_key'  => 'author',
						'title' => __( 'Author', 'customify' ),
					),
					array(
						'_key'  => 'date',
						'title' => __( 'Date', 'customify' ),
					),
					array(
						'_key'  => 'categories',
						'title' => __( 'Categories', 'customify' ),
					),
					array(
						'_key'  => 'comment',
						'title' => __( 'Comment', 'customify' ),
					),

				),
				'fields'           => array(
					array(
						'name' => '_key',
						'type' => 'hidden',
					),
					array(
						'name'  => 'title',
						'type'  => 'hidden',
						'label' => __( 'Title', 'customify' ),
					),
				),
			),

			array(
				'name'            => $args['id'] . '_author_avatar',
				'type'            => 'checkbox',
				'section'         => $level_2_panel,
				'default'         => 0,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'checkbox_label'  => __( 'Show author avatar', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_avatar_size',
				'type'            => 'slider',
				'section'         => $level_2_panel,
				'default'         => 32,
				'max'             => 150,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Avatar Size', 'customify' ),
				'required'        => array( $args['id'] . '_author_avatar', '==', '1' ),
			),

		);

		return array_merge( $configs, $config );

	}
}

add_filter( 'customify/customizer/config', 'customify_customizer_single_blog_config' );

configs/header/search-box.php000066600000024740151151110650012177 0ustar00<?php

class Customify_Builder_Item_Search_Box {
	public $id = 'search_box';
	public $section = 'search_box';
	public $name = 'search_box';
	public $label = '';

	/**
	 * Optional construct
	 *
	 * Customify_Builder_Item_HTML constructor.
	 */
	function __construct() {
		$this->label = __( 'Search Box', 'customify' );
	}

	/**
	 * Register Builder item
	 *
	 * @return array
	 */
	function item() {
		return array(
			'name'    => $this->label,
			'id'      => $this->id,
			'col'     => 0,
			'width'   => '1',
			'section' => $this->section, // Customizer section to focus when click settings.
		);
	}

	/**
	 * Optional, Register customize section and panel.
	 *
	 * @return array
	 */
	function customize() {
		// Render callback function.
		$fn       = array( $this, 'render' );
		$selector = ".header-{$this->id}-item";

		$icon_postion_css = "$selector .search-submit{margin-left: {{value}};} $selector .woo_bootster_search .search-submit{margin-left: {{value}};} $selector .header-search-form button.search-submit{margin-left:{{value}};}";
		if ( is_rtl() ) {
			$icon_postion_css = ".rtl $selector .search-submit{margin-right: {{value}}; margin-left:auto;} .rtl $selector .woo_bootster_search .search-submit{margin-left: {{value}};margin-left:auto;} .rtl $selector .header-search-form button.search-submit{margin-left: {{value}};margin-left:auto;}";
		}

		$config   = array(
			array(
				'name'  => $this->section,
				'type'  => 'section',
				'panel' => 'header_settings',
				'title' => $this->label,
			),

			array(
				'name'            => $this->section . '_placeholder',
				'type'            => 'text',
				'section'         => $this->section,
				'selector'        => "$selector",
				'render_callback' => $fn,
				'label'           => __( 'Placeholder', 'customify' ),
				'default'         => __( 'Search ...', 'customify' ),
				'priority'        => 10,
			),

			array(
				'name'            => $this->section . '_width',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $this->section,
				'selector'        => "$selector .search-form-fields",
				'css_format'      => 'width: {{value}};',
				'label'           => __( 'Search Form Width', 'customify' ),
				'description'     => __( 'Note: The width can not greater than grid width.', 'customify' ),
				'priority'        => 15,
			),

			array(
				'name'            => $this->section . '_height',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $this->section,
				'min'             => 25,
				'step'            => 1,
				'max'             => 100,
				'selector'        => "$selector .search-form-fields, $selector .search-form-fields .search-field",
				'css_format'      => 'height: {{value}};',
				'label'           => __( 'Input Height', 'customify' ),
				'priority'        => 20,
			),

			array(
				'name'            => $this->section . '_icon_size',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $this->section,
				'min'             => 5,
				'step'            => 1,
				'max'             => 100,
				'selector'        => "$selector .search-submit svg,$selector .header-search-form button.search-submit svg",
				'css_format'      => 'height: {{value}}; width: {{value}};',
				'label'           => __( 'Icon Size', 'customify' ),
				'priority'        => 25,
			),

			array(
				'name'            => $this->section . '_icon_pos',
				'type'            => 'slider',
				'device_settings' => true,
				'default'         => array(
					'desktop' => array(
						'value' => - 40,
						'unit'  => 'px',
					),
					'tablet'  => array(
						'value' => - 40,
						'unit'  => 'px',
					),
					'mobile'  => array(
						'value' => - 40,
						'unit'  => 'px',
					),
				),
				'section'         => $this->section,
				'min'             => - 150,
				'step'            => 1,
				'max'             => 90,
				'selector'        => 'format',
				'css_format'      => $icon_postion_css,
				'label'           => __( 'Icon Position', 'customify' ),
				'priority'        => 30,
			),

			array(
				'name'        => $this->section . '_font_size',
				'type'        => 'typography',
				'section'     => $this->section,
				'selector'    => "$selector .search-form-fields",
				'css_format'  => 'typography',
				'label'       => __( 'Input Text Typography', 'customify' ),
				'description' => __( 'Typography for search input', 'customify' ),
				'priority'        => 35,
			),

			array(
				'name'        => $this->section . '_input_styling',
				'type'        => 'styling',
				'section'     => $this->section,
				'css_format'  => 'styling',
				'title'       => __( 'Input Styling', 'customify' ),
				'description' => __( 'Search input styling', 'customify' ),
				'selector'    => array(
					'normal'            => "{$selector} .search-form-fields",
					'hover'             => "{$selector} .search-form-fields",
					'normal_text_color' => "{$selector} .search-form-fields,
											{$selector} .search-form-fields input.search-field::placeholder,
											.dark-mode {$selector} .search-form-fields .search-field,
											.dark-mode {$selector} .search-form-fields .search-field::placeholder,
											.woo_bootster_search .dark-mode {$selector} .header-search-form .search-form-fields input.search-field,
											.woo_bootster_search .dark-mode {$selector} .header-search-form .search-form-fields input.search-field::placeholder,
											.woo_bootster_search .dark-mode {$selector} .header-search-form .search-form-fields .search_product_cats
											",
					'normal_bg_color' => ".dark-mode {$selector} .search-form-fields, {$selector} .search-form-fields",
					'normal_border_style' => ".dark-mode {$selector} .search-form-fields, {$selector} .search-form-fields",
					'normal_border_width' => ".dark-mode {$selector} .search-form-fields, {$selector} .search-form-fields",
					'normal_border_color' => ".dark-mode {$selector} .search-form-fields, {$selector} .search-form-fields",
					'normal_border_radius' => ".dark-mode {$selector} .search-form-fields, {$selector} .search-form-fields",
					'normal_box_shadow' => ".dark-mode {$selector} .search-form-fields, {$selector} .search-form-fields",
				),
				'default'     => array(
					'normal' => array(
						'border_style' => 'solid',
					),
				),
				'fields'      => array(
					'normal_fields' => array(
						'link_color'    => false, // disable for special field.
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'margin'        => false,
					),
					'hover_fields'  => array(
						'link_color'    => false,
						'padding'       => false,
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'border_radius' => false,
					), // disable hover tab and all fields inside.
				),
				'priority'        => 40,
			),

			array(
				'name'        => $this->section . '_icon_styling',
				'type'        => 'styling',
				'section'     => $this->section,
				'css_format'  => 'styling',
				'title'       => __( 'Icon Styling', 'customify' ),
				'description' => __( 'Search input styling', 'customify' ),
				'selector'    => array(
					'normal' => "{$selector} .header-search-form button.search-submit",
					'hover'  => "{$selector} .header-search-form button.search-submit",
					'normal_text_color' => ".dark-mode {$selector} .header-search-form button.search-submit",
				),
				'fields'      => array(
					'normal_fields' => array(
						'link_color'    => false, // disable for special field.
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'margin'        => false,
					),
					'hover_fields'  => array(
						'link_color'    => false,
						'padding'       => false,
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'border_radius' => false,
					), // disable hover tab and all fields inside.
				),
				'priority'        => 45,
			),

		);

		// Item Layout.
		return array_merge( $config, customify_header_layout_settings( $this->id, $this->section ) );
	}

	/**
	 * Optional. Render item content
	 */
	function render() {
		$form_extra_class = apply_filters( 'customify/builder_item/search-box/form_extra_class', array() );
		$placeholder = Customify()->get_setting( $this->section . '_placeholder' );
		$placeholder = sanitize_text_field( $placeholder );
		/**
		 * Hook: customify/builder_item/search-box/before_html
		 *
		 * @since 0.2.8
		 */
		do_action( 'customify/builder_item/search-box/before_html' );

		echo '<div class="header-' . esc_attr( $this->id ) . '-item item--' . esc_attr( $this->id ) . '">';
		?>
		<form role="search" class="header-search-form <?php echo esc_attr( implode( ' ', $form_extra_class ) ); ?>" action="<?php echo esc_url( home_url( '/' ) ); ?>">
			<div class="search-form-fields">
				<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'customify' ); ?></span>
				<?php
				/**
				 * Hook: customify/builder_item/search-box/html_content/before_input
				 *
				 * @since 0.2.8
				 */
				do_action( 'customify/builder_item/search-box/html_content/before_input' );
				?>

				<input type="search" class="search-field" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php echo get_search_query(); ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label', 'customify' ); ?>" />

				<?php
				/**
				 * Hook: customify/builder_item/search-box/html_content/after_input
				 *
				 * @since 0.2.8
				 */
				do_action( 'customify/builder_item/search-box/html_content/after_input' );
				?>
			</div>
			<button type="submit" class="search-submit">
				<svg aria-hidden="true" focusable="false" role="presentation" xmlns="http://www.w3.org/2000/svg" width="20" height="21" viewBox="0 0 20 21">
					<path fill="currentColor" fill-rule="evenodd" d="M12.514 14.906a8.264 8.264 0 0 1-4.322 1.21C3.668 16.116 0 12.513 0 8.07 0 3.626 3.668.023 8.192.023c4.525 0 8.193 3.603 8.193 8.047 0 2.033-.769 3.89-2.035 5.307l4.999 5.552-1.775 1.597-5.06-5.62zm-4.322-.843c3.37 0 6.102-2.684 6.102-5.993 0-3.31-2.732-5.994-6.102-5.994S2.09 4.76 2.09 8.07c0 3.31 2.732 5.993 6.102 5.993z"></path>
				</svg>
			</button>
		</form>
		<?php
		echo '</div>';

		/**
		 * Hook: customify/builder_item/search-box/after_html
		 *
		 * @since 0.2.8
		 */
		do_action( 'customify/builder_item/search-box/after_html' );
	}
}

Customify_Customize_Layout_Builder()->register_item( 'header', new Customify_Builder_Item_Search_Box() );
configs/header/search-icon.php000066600000027740151151110650012342 0ustar00<?php

class Customify_Builder_Item_Search_Icon {
	public $id = 'search_icon';
	public $section = 'search_icon';
	public $name = 'search_icon';
	public $label = '';

	/**
	 * Optional construct
	 *
	 * Customify_Builder_Item_HTML constructor.
	 */
	function __construct() {
		$this->label = __( 'Search Icon', 'customify' );
	}

	/**
	 * Register Builder item
	 *
	 * @return array
	 */
	function item() {
		return array(
			'name'    => $this->label,
			'id'      => $this->id,
			'col'     => 0,
			'width'   => '1',
			'section' => $this->section, // Customizer section to focus when click settings.
		);
	}

	/**
	 * Optional, Register customize section and panel.
	 *
	 * @return array
	 */
	function customize() {
		// Render callback function.
		$fn       = array( $this, 'render' );
		$selector = ".header-{$this->id}-item";
		$config   = array(
			array(
				'name'  => $this->section,
				'type'  => 'section',
				'panel' => 'header_settings',
				'title' => $this->label,
			),

			array(
				'name'            => $this->section . '_size',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $this->section,
				'min'             => 5,
				'step'            => 1,
				'max'             => 100,
				'selector'        => "$selector svg",
				'css_format'      => 'height: {{value}}; width: {{value}};',
				'label'           => __( 'Icon Size', 'customify' ),
			),

			array(
				'name'            => $this->section . '_padding',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $this->section,
				'min'             => 0,
				'step'            => 1,
				'max'             => 100,
				'selector'        => "$selector .search-icon",
				'css_format'      => 'padding: {{value}};',
				'label'           => __( 'Icon Padding', 'customify' ),
			),

			array(
				'name'        => $this->section . '_styling',
				'type'        => 'styling',
				'section'     => $this->section,
				'css_format'  => 'styling',
				'title'       => __( 'Icon Styling', 'customify' ),
				'description' => __( 'Search icon styling', 'customify' ),
				'selector'    => array(
					'normal'            => "{$selector} .search-icon",
					'hover'             => "{$selector} .search-icon:hover",
					'normal_box_shadow' => "{$selector} .search-icon",
					'normal_text_color' => "{$selector} .search-icon",
				),
				'fields'      => array(
					'normal_fields' => array(
						'link_color'    => false, // disable for special field.
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'padding'       => false,
						'margin'        => false,
					),
					'hover_fields'  => array(
						'link_color'    => false,
						'padding'       => false,
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_attachment' => false,
						'bg_repeat'     => false,
						'border_radius' => false,
					), // disable hover tab and all fields inside.
				),
			),

			array(
				'name'    => $this->section . '_modal_h',
				'type'    => 'heading',
				'section' => $this->section,
				'label'   => __( 'Modal Settings', 'customify' ),
			),

			array(
				'name'            => $this->section . '_placeholder',
				'type'            => 'text',
				'selector'        => "$selector",
				'render_callback' => $fn,
				'section'         => $this->section,
				'label'           => __( 'Placeholder', 'customify' ),
				'default'         => __( 'Search ...', 'customify' ),
			),

			array(
				'name'        => $this->section . '_form_styling',
				'type'        => 'styling',
				'section'     => $this->section,
				'css_format'  => 'styling',
				'title'       => __( 'Form Styling', 'customify' ),
				'description' => __( 'Form modal styling', 'customify' ),
				'selector'    => array(
					'normal'              => "{$selector} .header-search-modal",
					'normal_bg_color'     => "{$selector} .header-search-modal, {$selector} .header-search-modal:before",
					'normal_border_color' => "{$selector} .header-search-modal, {$selector} .header-search-modal:before",
				),
				'default'     => array(
					'normal' => array(
						'border_style' => 'solid',
					),
				),
				'fields'      => array(
					'normal_fields' => array(
						'text_color'    => false, // disable for special field.
						'link_color'    => false, // disable for special field.
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'margin'        => false,
					),
					'hover_fields'  => false,
				),
			),

			array(
				'name'            => $this->section . '_modal_height',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $this->section,
				'min'             => 25,
				'step'            => 1,
				'max'             => 100,
				'selector'        => "$selector .header-search-form .search-field",
				'css_format'      => 'height: {{value}};',
				'label'           => __( 'Input Height', 'customify' ),
			),

			array(
				'name'            => $this->section . '_modal_width',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $this->section,
				'selector'        => "$selector .header-search-modal",
				'css_format'      => 'width: {{value}};',
				'label'           => __( 'Search Modal Width', 'customify' ),
			),

			array(
				'name'        => $this->section . '_modal_font_size',
				'type'        => 'typography',
				'section'     => $this->section,
				'selector'    => "$selector .header-search-form .search-field",
				'css_format'  => 'typography',
				'label'       => __( 'Input Text Typography', 'customify' ),
				'description' => __( 'Typography for search input', 'customify' ),
			),

			array(
				'name'            => $this->section . '_modal_icon_size',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $this->section,
				'min'             => 5,
				'step'            => 1,
				'max'             => 100,
				'selector'        => "$selector .search-submit svg",
				'css_format'      => 'height: {{value}}; width: {{value}};',
				'label'           => __( 'Icon Size', 'customify' ),
			),

			array(
				'name'            => $this->section . '_modal_icon_pos',
				'type'            => 'slider',
				'device_settings' => true,
				'default'         => array(
					'desktop' => array(
						'value' => - 40,
						'unit'  => 'px',
					),
					'tablet'  => array(
						'value' => - 40,
						'unit'  => 'px',
					),
					'mobile'  => array(
						'value' => - 40,
						'unit'  => 'px',
					),
				),
				'section'         => $this->section,
				'min'             => - 150,
				'step'            => 1,
				'max'             => 90,
				'selector'        => "$selector .search-submit",
				'css_format'      => 'margin-left: {{value}}; ',
				'label'           => __( 'Icon Position', 'customify' ),
			),

			array(
				'name'        => $this->section . '_modal_input_styling',
				'type'        => 'styling',
				'section'     => $this->section,
				'css_format'  => 'styling',
				'title'       => __( 'Input Styling', 'customify' ),
				'description' => __( 'Search input styling', 'customify' ),
				'selector'    => array(
					'normal'            => "{$selector} .search-field",
					'hover'             => "{$selector} .search-field:focus",
					'normal_text_color' => "{$selector} .search-field, {$selector} input.search-field::placeholder",
				),
				'default'     => array(
					'normal' => array(
						'border_style' => 'solid',
					),
				),
				'fields'      => array(
					'normal_fields' => array(
						'link_color'    => false, // disable for special field.
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'margin'        => false,
					),
					'hover_fields'  => array(
						'link_color'    => false,
						'padding'       => false,
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'border_radius' => false,
					), // disable hover tab and all fields inside.
				),
			),

			array(
				'name'        => $this->section . '_modal_icon_styling',
				'type'        => 'styling',
				'section'     => $this->section,
				'css_format'  => 'styling',
				'title'       => __( 'Icon Styling', 'customify' ),
				'description' => __( 'Search input styling', 'customify' ),
				'selector'    => array(
					'normal' => "{$selector} .search-submit",
					'hover'  => "{$selector} .search-submit:hover",
				),
				'fields'      => array(
					'normal_fields' => array(
						'link_color'    => false, // disable for special field.
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'margin'        => false,
					),
					'hover_fields'  => array(
						'link_color'    => false,
						'padding'       => false,
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'border_radius' => false,
					), // disable hover tab and all fields inside.
				),
			),

		);

		// Item Layout.
		return array_merge( $config, customify_header_layout_settings( $this->id, $this->section ) );
	}

	/**
	 * Optional. Render item content
	 */
	function render() {

		$placeholder = Customify()->get_setting( $this->section . '_placeholder' );
		$placeholder = sanitize_text_field( $placeholder );

		echo '<div class="header-' . esc_attr( $this->id ) . '-item item--' . esc_attr( $this->id ) . '">';
		?>
		<a class="search-icon" href="#">
			<span class="ic-search">
				<svg aria-hidden="true" focusable="false" role="presentation" xmlns="http://www.w3.org/2000/svg" width="20" height="21" viewBox="0 0 20 21">
					<path fill="currentColor" fill-rule="evenodd" d="M12.514 14.906a8.264 8.264 0 0 1-4.322 1.21C3.668 16.116 0 12.513 0 8.07 0 3.626 3.668.023 8.192.023c4.525 0 8.193 3.603 8.193 8.047 0 2.033-.769 3.89-2.035 5.307l4.999 5.552-1.775 1.597-5.06-5.62zm-4.322-.843c3.37 0 6.102-2.684 6.102-5.993 0-3.31-2.732-5.994-6.102-5.994S2.09 4.76 2.09 8.07c0 3.31 2.732 5.993 6.102 5.993z"></path>
				</svg>
			</span>
			<span class="ic-close">
				<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="612px" height="612px" viewBox="0 0 612 612" fill="currentColor" style="enable-background:new 0 0 612 612;" xml:space="preserve"><g><g id="cross"><g><polygon points="612,36.004 576.521,0.603 306,270.608 35.478,0.603 0,36.004 270.522,306.011 0,575.997 35.478,611.397 306,341.411 576.521,611.397 612,575.997 341.459,306.011 " /></g></g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg>
			</span>
			<span class="arrow-down"></span>
		</a>
		<div class="header-search-modal-wrapper">
			<form role="search" class="header-search-modal header-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
				<label>
					<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'customify' ); ?></span>
					<input type="search" class="search-field" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php echo get_search_query(); ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label', 'customify' ); ?>" />
				</label>
				<button type="submit" class="search-submit">
					<svg aria-hidden="true" focusable="false" role="presentation" xmlns="http://www.w3.org/2000/svg" width="20" height="21" viewBox="0 0 20 21">
						<path fill="currentColor" fill-rule="evenodd" d="M12.514 14.906a8.264 8.264 0 0 1-4.322 1.21C3.668 16.116 0 12.513 0 8.07 0 3.626 3.668.023 8.192.023c4.525 0 8.193 3.603 8.193 8.047 0 2.033-.769 3.89-2.035 5.307l4.999 5.552-1.775 1.597-5.06-5.62zm-4.322-.843c3.37 0 6.102-2.684 6.102-5.993 0-3.31-2.732-5.994-6.102-5.994S2.09 4.76 2.09 8.07c0 3.31 2.732 5.993 6.102 5.993z"></path>
					</svg>
				</button>
			</form>
		</div>
		<?php
		echo '</div>';
	}
}

Customify_Customize_Layout_Builder()->register_item( 'header', new Customify_Builder_Item_Search_Icon() );
configs/header/social-icons.php000066600000026601151151110650012525 0ustar00<?php

class Customify_Builder_Item_Social_Icons {
	public $id = 'social-icons';
	public $section = 'header_social_icons';
	public $class = 'header-social-icons';
	public $selector = '';
	public $panel = 'header_settings';

	function __construct() {
		$this->selector = '.' . $this->class;
		add_filter( 'customify/icon_used', array( $this, 'used_icon' ) );
	}

	function used_icon( $list = array() ) {
		$list[ $this->id ] = 1;

		return $list;
	}

	function item() {
		return array(
			'name'    => __( 'Social Icons', 'customify' ),
			'id'      => $this->id,
			'col'     => 0,
			'width'   => '4',
			'section' => $this->section, // Customizer section to focus when click settings.
		);
	}

	function customize() {
		$section  = $this->section;
		$prefix   = $this->section;
		$fn       = array( $this, 'render' );
		$selector = "{$this->selector}.customify-builder-social-icons";
		$config   = array(
			array(
				'name'           => $section,
				'type'           => 'section',
				'panel'          => $this->panel,
				'theme_supports' => '',
				'title'          => __( 'Social Icons', 'customify' ),
			),

			array(
				'name'             => $prefix . '_items',
				'type'             => 'repeater',
				'section'          => $section,
				'selector'         => $this->selector,
				'render_callback'  => $fn,
				'title'            => __( 'Social Profiles', 'customify' ),
				'live_title_field' => 'title',
				'default'          => array(
					array(
						'title' => 'Facebook',
						'url'   => '#',
						'icon'  => array(
							'type' => 'font-awesome',
							'icon' => 'fa fa-facebook',
						),
					),
					array(
						'title' => 'Twitter',
						'url'   => '#',
						'icon'  => array(
							'type' => 'font-awesome',
							'icon' => 'fa fa-twitter',
						),
					),
					array(
						'title' => 'Youtube',
						'url'   => '#',
						'icon'  => array(
							'type' => 'font-awesome',
							'icon' => 'fa fa-youtube-play',
						),
					),
					array(
						'title' => 'Instagram',
						'url'   => '#',
						'icon'  => array(
							'type' => 'font-awesome',
							'icon' => 'fa fa-instagram',
						),
					),
					array(
						'title' => 'Pinterest',
						'url'   => '#',
						'icon'  => array(
							'type' => 'font-awesome',
							'icon' => 'fa fa-pinterest',
						),
					),
				),
				'fields'           => array(
					array(
						'name'  => 'title',
						'type'  => 'text',
						'label' => __( 'Title', 'customify' ),
					),
					array(
						'name'  => 'icon',
						'type'  => 'icon',
						'label' => __( 'Icon', 'customify' ),
					),

					array(
						'name'  => 'url',
						'type'  => 'text',
						'label' => __( 'URL', 'customify' ),
					),

				),
			),

			array(
				'name'            => $prefix . '_target',
				'type'            => 'checkbox',
				'section'         => $section,
				'selector'        => $this->selector,
				'render_callback' => $fn,
				'default'         => 1,
				'checkbox_label'  => __( 'Open link in a new tab.', 'customify' ),
			),
			array(
				'name'            => $prefix . '_nofollow',
				'type'            => 'checkbox',
				'section'         => $section,
				'render_callback' => $fn,
				'default'         => 1,
				'checkbox_label'  => __( 'Adding rel="nofollow" for social links.', 'customify' ),
			),

			array(
				'name'            => $prefix . '_size',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $section,
				'min'             => 10,
				'step'            => 1,
				'max'             => 100,
				'selector'        => 'format',
				'css_format'      => "$selector li a { font-size: {{value}}; }",
				'label'           => __( 'Size', 'customify' ),
			),

			array(
				'name'            => $prefix . '_padding',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $section,
				'min'             => .1,
				'step'            => .1,
				'max'             => 5,
				'selector'        => "$selector li a",
				'unit'            => 'em',
				'css_format'      => 'padding: {{value_no_unit}}em;',
				'label'           => __( 'Padding', 'customify' ),
			),

			array(
				'name'            => $prefix . '_spacing',
				'type'            => 'slider',
				'device_settings' => true,
				'section'         => $section,
				'min'             => 0,
				'max'             => 30,
				'selector'        => "$selector li",
				'css_format'      => 'margin-left: {{value}}; margin-right: {{value}};',
				'label'           => __( 'Icon Spacing', 'customify' ),
			),

			array(
				'name'            => $prefix . '_shape',
				'type'            => 'select',
				'section'         => $section,
				'selector'        => '.header-social-icons',
				'default'         => 'circle',
				'render_callback' => $fn,
				'title'           => __( 'Shape', 'customify' ),
				'choices'         => array(
					'rounded' => __( 'Rounded', 'customify' ),
					'square'  => __( 'Square', 'customify' ),
					'circle'  => __( 'Circle', 'customify' ),
					'none'    => __( 'None', 'customify' ),
				),
			),

			array(
				'name'            => $prefix . '_color_type',
				'type'            => 'select',
				'section'         => $section,
				'selector'        => $this->selector,
				'default'         => 'default',
				'render_callback' => $fn,
				'title'           => __( 'Color', 'customify' ),
				'choices'         => array(
					'default' => __( 'Official Color', 'customify' ),
					'custom'  => __( 'Custom', 'customify' ),
				),
			),

			array(
				'name'       => $prefix . '_custom_color',
				'type'       => 'modal',
				'section'    => $section,
				'selector'   => "{$this->selector} li a",
				'required'   => array( $prefix . '_color_type', '==', 'custom' ),
				'css_format' => 'styling',
				'title'      => __( 'Custom Color', 'customify' ),
				'fields'     => array(
					'tabs'           => array(
						'default' => __( 'Normal', 'customify' ),
						'hover'   => __( 'Hover', 'customify' ),
					),
					'default_fields' => array(
						array(
							'name'       => 'primary',
							'type'       => 'color',
							'label'      => __( 'Background Color', 'customify' ),
							'selector'   => "$selector.color-custom li a",
							'css_format' => 'background-color: {{value}};',
						),
						array(
							'name'       => 'secondary',
							'type'       => 'color',
							'label'      => __( 'Icon Color', 'customify' ),
							'selector'   => "$selector.color-custom li a",
							'css_format' => 'color: {{value}};',
						),
					),
					'hover_fields'   => array(
						array(
							'name'       => 'primary',
							'type'       => 'color',
							'label'      => __( 'Background Color', 'customify' ),
							'selector'   => "$selector.color-custom li a:hover",
							'css_format' => 'background-color: {{value}};',
						),
						array(
							'name'       => 'secondary',
							'type'       => 'color',
							'label'      => __( 'Icon Color', 'customify' ),
							'selector'   => "$selector.color-custom li a:hover",
							'css_format' => 'color: {{value}};',
						),
					),
				),
			),

			array(
				'name'        => $prefix . '_border',
				'type'        => 'modal',
				'section'     => $section,
				'selector'    => "{$this->selector} li a",
				'css_format'  => 'styling',
				'title'       => __( 'Border', 'customify' ),
				'description' => __( 'Border & border radius', 'customify' ),
				'fields'      => array(
					'tabs'           => array(
						'default' => '_',
					),
					'default_fields' => array(
						array(
							'name'       => 'border_style',
							'type'       => 'select',
							'class'      => 'clear',
							'label'      => __( 'Border Style', 'customify' ),
							'default'    => 'none',
							'choices'    => array(
								''       => __( 'Default', 'customify' ),
								'none'   => __( 'None', 'customify' ),
								'solid'  => __( 'Solid', 'customify' ),
								'dotted' => __( 'Dotted', 'customify' ),
								'dashed' => __( 'Dashed', 'customify' ),
								'double' => __( 'Double', 'customify' ),
								'ridge'  => __( 'Ridge', 'customify' ),
								'inset'  => __( 'Inset', 'customify' ),
								'outset' => __( 'Outset', 'customify' ),
							),
							'css_format' => 'border-style: {{value}};',
							'selector'   => "$selector li a",
						),

						array(
							'name'       => 'border_width',
							'type'       => 'css_ruler',
							'label'      => __( 'Border Width', 'customify' ),
							'required'   => array( 'border_style', '!=', 'none' ),
							'selector'   => "$selector li a",
							'css_format' => array(
								'top'    => 'border-top-width: {{value}};',
								'right'  => 'border-right-width: {{value}};',
								'bottom' => 'border-bottom-width: {{value}};',
								'left'   => 'border-left-width: {{value}};',
							),
						),
						array(
							'name'       => 'border_color',
							'type'       => 'color',
							'label'      => __( 'Border Color', 'customify' ),
							'required'   => array( 'border_style', '!=', 'none' ),
							'selector'   => "$selector li a",
							'css_format' => 'border-color: {{value}};',
						),

						array(
							'name'       => 'border_radius',
							'type'       => 'slider',
							'label'      => __( 'Border Radius', 'customify' ),
							'selector'   => "$selector li a",
							'css_format' => 'border-radius: {{value}};',
						),
					),
				),
			),

		);

		// Item Layout.
		return array_merge( $config, customify_header_layout_settings( $this->id, $section ) );
	}

	function render( $item_config = array() ) {

		$shape        = Customify()->get_setting( $this->section . '_shape', 'all' );
		$color_type   = Customify()->get_setting( $this->section . '_color_type' );
		$items        = Customify()->get_setting( $this->section . '_items' );
		$nofollow     = Customify()->get_setting( $this->section . '_nofollow' );
		$target_blank = Customify()->get_setting( $this->section . '_target' );

		$rel = '';
		if ( 1 == $nofollow ) {
			$rel = 'rel="nofollow" ';
		}

		$target = '_self';
		if ( 1 == $target_blank ) {
			$target = '_blank';
		}

		if ( ! empty( $items ) ) {
			$classes   = array();
			$classes[] = $this->class;
			$classes[] = 'customify-builder-social-icons';
			if ( $shape ) {
				$shape = ' shape-' . sanitize_text_field( $shape );
			}
			if ( $color_type ) {
				$classes[] = 'color-' . sanitize_text_field( $color_type );
			}

			echo '<ul class="' . esc_attr( join( ' ', $classes ) ) . '">';
			foreach ( (array) $items as $index => $item ) {
				$item = wp_parse_args(
					$item,
					array(
						'title'       => '',
						'icon'        => '',
						'url'         => '',
						'_visibility' => '',
					)
				);

				if ( 'hidden' !== $item['_visibility'] ) {
					echo '<li>';
					if ( ! $item['url'] ) {
						$item['url'] = '#';
					}

					$icon = wp_parse_args(
						$item['icon'],
						array(
							'type' => '',
							'icon' => '',
						)
					);

					if ( $item['url'] && $icon['icon'] ) {
						echo '<a class="social-' . str_replace(
							array( ' ', 'fa-fa' ),
							array(
								'-',
								'icon',
							),
							esc_attr( $icon['icon'] )
						) . $shape . '" ' . $rel . 'target="' . esc_attr( $target ) . '" href="' . esc_url( $item['url'] ) . '">';
					}

					if ( $icon['icon'] ) {
						echo '<i class="icon ' . esc_attr( $icon['icon'] ) . '" title="' . esc_attr( $item['title'] ) . '"></i>';
					}

					if ( $item['url'] ) {
						echo '</a>';
					}
					echo '</li>';
				}
			}

			echo '</ul>';
		}

	}

}

Customify_Customize_Layout_Builder()->register_item( 'header', new Customify_Builder_Item_Social_Icons() );
configs/header/templates.php000066600000004657151151110650012147 0ustar00<?php

class Customify_Builder_Header_Templates {
	public $id = 'header_templates';

	function customize() {
		$section = 'header_templates';
		$prefix  = 'header_templates_';

		$id          = 'header';
		$theme_name  = wp_get_theme()->get( 'Name' );
		$option_name = "{$theme_name}_{$id}_saved_templates";

		$saved_templates = get_option( $option_name );
		if ( ! is_array( $saved_templates ) ) {
			$saved_templates = array();
		}

		$saved_templates = array_reverse( $saved_templates );

		$n = count( $saved_templates );

		$html = '';
		$html .= '<span class="customize-control-title">' . __( 'Saved Templates', 'customify' ) . '</span>';
		$html .= '<ul class="list-saved-templates list-boxed ' . ( $n > 0 ? 'has-templates' : 'no-templates' ) . '">';
		if ( count( $saved_templates ) > 0 ) {
			foreach ( $saved_templates as $key => $tpl ) {
				$tpl = wp_parse_args(
					$tpl,
					array(
						'name' => '',
						'data' => '',
					)
				);
				if ( ! $tpl['name'] ) {
					$name = __( 'Untitled', 'customify' );
				} else {
					$name = $tpl['name'];
				}
				$html .= '<li class="saved_template li-boxed" data-control-id="' . esc_attr( $prefix . 'save' ) . '" data-id="' . esc_attr( $key ) . '" data-data="' . esc_attr( json_encode( $tpl['data'] ) ) . '">' . esc_html( $name ) . ' <a href="#" class="load-tpl">' . __( 'Load', 'customify' ) . '</a><a href="#" class="remove-tpl">' . __( 'Remove', 'customify' ) . '</a></li>'; // phpcs:ignore
			}
		}

		$html .= '<li class="no_template">' . __( 'No saved templates.', 'customify' ) . '</li>';

		$html .= '</ul>';
		$html .= '</div>';

		return array(
			array(
				'name'     => $section,
				'type'     => 'section',
				'panel'    => 'header_settings',
				'priority' => 299,
				'title'    => __( 'Templates', 'customify' ),
			),

			array(
				'name'           => $prefix . 'save',
				'type'           => 'custom_html',
				'section'        => $section,
				'theme_supports' => '',
				'title'          => __( 'Save Template', 'customify' ),
				'description'    => '<div class="save-template-form"><input type="text" data-builder-id="header" data-control-id="' . esc_attr( $prefix . 'save' ) . '" class="template-input-name change-by-js"><button class="button button-secondary save-builder-template" type="button">' . esc_html__( 'Save', 'customify' ) . '</button></div>' . $html,
			),
		);
	}
}

Customify_Customize_Layout_Builder()->register_item( 'header', new Customify_Builder_Header_Templates() );
configs/header/panel.php000066600000033736151151110650011250 0ustar00<?php

class Customify_Builder_Header extends Customify_Customize_Builder_Panel {
	public $id = 'header';

	/**
	 * Panel builder configs.
	 *
	 * @since 0.0.1
	 * @since 0.2.9
	 *
	 * @return array
	 */
	function get_config() {
		return array(
			'id'            => $this->id,
			'title'         => __( 'Header Builder', 'customify' ),
			'control_id'    => 'header_builder_panel', // Control ID for ver 1.
			'version_id'    => 'header_builder_version', // The control id where store version.
			'panel'         => 'header_settings',
			'section'       => 'header_builder_panel',
			// Versions support, can choice v1 or v2.
			'versions'      => array(
				'v1' => array(
					'control_id' => 'header_builder_panel',
					'label' => __( 'Version 1', 'customify' ),
				),
				'v2' => array(
					'control_id' => 'header_builder_panel_v2',
					'label' => __( 'Version 2', 'customify' ),
				),
			),
			'devices'       => array(
				'desktop'      => __( 'Desktop', 'customify' ),
				'mobile'       => __( 'Mobile/Tablet', 'customify' ),
			),
		);
	}

	function get_rows_config() {
		return array(
			'top'     => __( 'Header Top', 'customify' ),
			'main'    => __( 'Header Main', 'customify' ),
			'bottom'  => __( 'Header Bottom', 'customify' ),
			'sidebar' => __( 'Menu Sidebar', 'customify' ),
		);
	}

	function customize() {

		$fn     = 'customify_customize_render_header';
		$config = array(
			array(
				'name'     => 'header_settings',
				'type'     => 'panel',
				'priority' => 1,
				'title'    => __( 'Header', 'customify' ),
			),

			array(
				'name'  => 'header_builder_panel',
				'type'  => 'section',
				'panel' => 'header_settings',
				'title' => __( 'Header Builder', 'customify' ),
			),

			// Header Builder v1 store data key.
			array(
				'name'                => 'header_builder_panel',
				'type'                => 'js_raw',
				'section'             => 'header_builder_panel',
				'theme_supports'      => '',
				'title'               => __( 'Header Builder', 'customify' ),
				'selector'            => '#masthead',
				'render_callback'     => $fn,
				'container_inclusive' => true,
			),

			// Header Builder v2 store data key.
			array(
				'name'                => 'header_builder_panel_v2',
				'type'                => 'js_raw',
				'section'             => 'header_builder_panel',
				'theme_supports'      => '',
				'title'               => '',
				'selector'            => '#masthead',
				'render_callback'     => $fn,
				'container_inclusive' => true,
			),

			// Header Builder v2 store data key.
			array(
				'name'                => 'header_builder_version',
				'type'                => 'js_raw',
				'section'             => 'header_builder_panel',
				'theme_supports'      => '',
				'title'               => '',
				'selector'            => '#masthead',
				'sanitize_callback'   => 'sanitize_text_field',
				'render_callback'     => $fn,
				'container_inclusive' => true,
			),

		);

		return $config;
	}

	function row_config( $section = false, $section_name = false ) {

		if ( ! $section ) {
			$section = 'header_top';
		}
		if ( ! $section_name ) {
			$section_name = __( 'Header Top', 'customify' );
		}

		// Text skin.
		$color_mode = 'light-mode';
		if ( 'header_top' == $section ) {
			$color_mode = 'dark-mode';
		}

		$selector           = '.header--row.' . str_replace( '_', '-', $section );
		$skin_selector      = '.header--row.' . str_replace( '_', '-', $section );
		$skin_selector      = '.header--row:not(.header--transparent).' . str_replace( '_', '-', $section );
		$skin_mode_selector = '.header--row-inner.' . str_replace( '_', '-', $section ) . '-inner';

		$fn           = 'customify_customize_render_header';
		$selector_all = '#masthead';

		$config = array(
			array(
				'name'           => $section,
				'type'           => 'section',
				'panel'          => 'header_settings',
				'theme_supports' => '',
				'title'          => $section_name,
			),

			array(
				'name'            => $section . '_layout',
				'type'            => 'select',
				'section'         => $section,
				'title'           => __( 'Layout', 'customify' ),
				'selector'        => $selector,
				'css_format'      => 'html_class',
				'render_callback' => $fn,
				'default'         => 'layout-full-contained',
				'choices'         => array(
					'layout-full-contained' => __( 'Full width - Contained', 'customify' ),
					'layout-fullwidth'      => __( 'Full Width', 'customify' ),
					'layout-contained'      => __( 'Contained', 'customify' ),
				),
			),

			array(
				'name'        => $section . '_noti_layout',
				'type'        => 'custom_html',
				'section'     => $section,
				'title'       => '',
				'description' => __( "Layout <code>Full width - Contained</code> and <code>Full Width</code> will not fit browser width because you've selected <a class='focus-control' data-id='site_layout' href='#'>Site Layout</a> as <code>Boxed</code> or <code>Framed</code>", 'customify' ),
				'required'    => array(
					array( 'site_layout', '=', array( 'site-boxed', 'site-framed' ) ),
				),
			),

			array(
				'name'            => $section . '_height',
				'type'            => 'slider',
				'section'         => $section,
				'theme_supports'  => '',
				'device_settings' => true,
				'max'             => 250,
				'selector'        => $selector . " .customify-grid, $selector .style-full-height .primary-menu-ul > li > a",
				'css_format'      => 'min-height: {{value}};',
				'title'           => __( 'Height', 'customify' ),
			),

			array(
				'name'       => $section . '_text_mode',
				'type'       => 'image_select',
				'section'    => $section,
				'selector'   => $skin_mode_selector,
				'css_format' => 'html_class',
				'title'      => __( 'Skin Mode', 'customify' ),
				'default'    => $color_mode,
				'choices'    => array(
					'dark-mode'  => array(
						'img'   => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/text_mode_light.svg',
						'label' => 'Dark',
					),
					'light-mode' => array(
						'img'   => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/text_mode_dark.svg',
						'label' => 'Light',
					),
				),
			),

			array(
				'name'             => $section . '_styling',
				'type'             => 'styling',
				'section'          => $section,
				'title'            => __( 'Advanced Styling', 'customify' ),
				'description'      => sprintf( __( 'Advanced styling for %s', 'customify' ), $section_name ),
				'live_title_field' => 'title',
				'selector'         => array(
					'normal' => "{$skin_selector} .header--row-inner",
				),
				'css_format'       => 'styling',
				'fields'           => array(
					'normal_fields' => array(
						'text_color' => false,
						'link_color' => false,
						'padding'    => false,
						'margin'     => false,
					),
					'hover_fields'  => false,
				), // disable hover tab and all fields inside.
			),

		);

		return $config;

	}

	function row_sidebar_config( $section, $section_name ) {
		$selector = '#header-menu-sidebar-bg';

		$config = array(
			array(
				'name'           => $section,
				'type'           => 'section',
				'panel'          => 'header_settings',
				'theme_supports' => '',
				'title'          => $section_name,
			),

			array(
				'name'            => $section . '_animate',
				'type'            => 'select',
				'section'         => $section,
				'selector'        => 'body',
				'render_callback' => 'customify_customize_render_header',
				'css_format'      => 'html_class',
				'title'           => __( 'Display Type', 'customify' ),
				'default'         => 'menu_sidebar_slide_left',
				'choices'         => array(
					'menu_sidebar_slide_left'    => __( 'Slide From Left', 'customify' ),
					'menu_sidebar_slide_right'   => __( 'Slide From Right', 'customify' ),
					'menu_sidebar_slide_overlay' => __( 'Full-screen Overlay', 'customify' ),
					'menu_sidebar_dropdown'      => __( 'Toggle Dropdown', 'customify' ),
				),
			),

			array(
				'name'       => $section . '_skin_mode',
				'type'       => 'image_select',
				'section'    => $section,
				'selector'   => '#header-menu-sidebar, .close-sidebar-panel',
				'css_format' => 'html_class',
				'title'      => __( 'Skin Mode', 'customify' ),
				'default'    => 'dark-mode',
				'choices'    => array(
					'dark-mode'  => array(
						'img'   => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/text_mode_light.svg',
						'label' => 'Dark',
					),
					'light-mode' => array(
						'img'   => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/text_mode_dark.svg',
						'label' => 'Light',
					),
				),
			),

			array(
				'name'             => $section . '_styling',
				'type'             => 'styling',
				'section'          => $section,
				'title'            => __( 'Styling', 'customify' ),
				'description'      => sprintf( __( 'Advanced styling for %s', 'customify' ), $section_name ),
				'live_title_field' => 'title',
				'selector'         => array(
					'normal'               => $selector,
					'normal_link_color'    => "{$selector} .menu li a, {$selector} .item--html a, {$selector} .cart-item-link, {$selector} .nav-toggle-icon",
					'hover_link_color'     => "{$selector} .menu li a:hover, {$selector} .item--html a:hover, {$selector} .cart-item-link:hover, {$selector} li.open-sub .nav-toggle-icon",
					'normal_bg_color'      => '#header-menu-sidebar-bg:before',
					'normal_bg_image'      => '#header-menu-sidebar-bg:before',
					'normal_bg_attachment' => '#header-menu-sidebar-bg:before',
					'normal_bg_cover'      => '#header-menu-sidebar-bg:before',
					'normal_bg_repeat'     => '#header-menu-sidebar-bg:before',
					'normal_bg_position'   => '#header-menu-sidebar-bg:before',
					'normal_box_shadow'    => '#header-menu-sidebar',
				),
				'css_format'       => 'styling', // styling.
				'fields'           => array(
					'normal_fields' => array(
						'border_color'  => false,
						'border_radius' => false,
						'border_width'  => false,
						'border_style'  => false,
					),
					'hover_fields'  => array(
						'text_color'     => false,
						'padding'        => false,
						'bg_color'       => false,
						'bg_heading'     => false,
						'bg_cover'       => false,
						'bg_image'       => false,
						'bg_repeat'      => false,
						'border_heading' => false,
						'border_color'   => false,
						'border_radius'  => false,
						'border_width'   => false,
						'border_style'   => false,
						'box_shadow'     => false,
					), // disable hover tab and all fields inside.
				),
			),

			array(
				'name'           => $section . '_menu_no_duplicator',
				'type'           => 'checkbox',
				'section'        => $section,
				'selector'       => '.sub-menu .li-duplicator',
				'css_format'     => 'display:none !important;',
				'checkbox_label' => __( 'Do not copy parent menu to submenu.', 'customify' ),
				'default'        => 1,
			),

			array(
				'name'            => $section . '_align',
				'type'            => 'text_align_no_justify',
				'section'         => $section,
				'priority'        => 820,
				'device_settings' => true,
				'selector'        => '.header-menu-sidebar-inner',
				'css_format'      => 'text-align: {{value}};',
				'title'           => __( 'Align', 'customify' ),
			),

		);

		return $config;
	}

}

if ( ! function_exists( 'customify_header_layout_settings' ) ) {
	function customify_header_layout_settings( $item_id = '', $section = '', $cb = '', $name_prefix = 'header_' ) {

		if ( ! $cb ) {
			$cb = 'customify_customize_render_header';
		}

		$class    = '.header--row';
		$selector = '#masthead';
		if ( ! $name_prefix ) {
			$name_prefix = 'header_';
		} else {
			if ( strpos( $item_id, 'footer' ) !== false ) {
				$class       = '.footer--row';
				$name_prefix = 'footer_';
				$cb          = 'customify_customize_render_footer';
			}
		}

		$layout = array(
			array(
				'name'     => $name_prefix . $item_id . '_l_heading',
				'type'     => 'heading',
				'priority' => 800,
				'section'  => $section,
				'title'    => __( 'Item Layout', 'customify' ),
			),

			array(
				'name'            => $name_prefix . $item_id . '_margin',
				'type'            => 'css_ruler',
				'priority'        => 810,
				'section'         => $section,
				'device_settings' => true,
				'css_format'      => array(
					'top'    => 'margin-top: {{value}};',
					'right'  => 'margin-right: {{value}};',
					'bottom' => 'margin-bottom: {{value}};',
					'left'   => 'margin-left: {{value}};',
				),
				'selector'        => "{$class} .builder-item--{$item_id}, .builder-item.builder-item--group .item--inner.builder-item--{$item_id}",
				'label'           => __( 'Margin', 'customify' ),
			),

			/**
			 * Apply for version 1 only
			 *
			 * @since 0.2.9
			 */
			array(
				'name'            => $name_prefix . $item_id . '_align',
				'type'            => 'text_align_no_justify',
				'section'         => $section,
				'priority'        => 820,
				'device_settings' => true,
				'selector'        => "{$class} .builder-first--" . $item_id,
				'css_format'      => 'text-align: {{value}};',
				'title'           => __( 'Align', 'customify' ),
				'required' => array( 'header_builder_version', '!=', 'v2' ),
			),

			/**
			 * Apply for version 1 only
			 *
			 * @since 0.2.9
			 */
			array(
				'name'            => $name_prefix . $item_id . '_merge',
				'type'            => 'select',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $cb,
				'priority'        => 999,
				'device_settings' => true,
				'devices'         => array( 'desktop', 'mobile' ),
				'title'           => __( 'Merge Item', 'customify' ),
				'description'     => __( 'If you choose to merge this item, the alignment setting will inherit from the item you are merging.', 'customify' ),
				'choices'         => array(
					0      => __( 'No', 'customify' ),
					'prev' => __( 'Merge with left item', 'customify' ),
					'next' => __( 'Merge with right item', 'customify' ),
				),
				'required' => array( 'header_builder_version', '!=', 'v2' ),
			),
		);

		return $layout;
	}
}

Customify_Customize_Layout_Builder()->register_builder( 'header', new Customify_Builder_Header() );
configs/header/nav-icon.php000066600000010115151151110650011645 0ustar00<?php

class Customify_Builder_Item_Nav_Icon {
	public $id = 'nav-icon';
	public $section = 'header_menu_icon';

	function item() {
		return array(
			'name'    => __( 'Menu Icon', 'customify' ),
			'id'      => $this->id,
			'width'   => '3',
			'section' => $this->section, // Customizer section to focus when click settings.
		);
	}

	function customize() {
		$section  = $this->section;
		$fn       = array( $this, 'render' );
		$selector = '.menu-mobile-toggle';
		$config   = array(
			array(
				'name'           => $section,
				'type'           => 'section',
				'panel'          => 'header_settings',
				'theme_supports' => '',
				'title'          => __( 'Menu Icon', 'customify' ),
			),

			array(
				'name'            => 'nav_icon_text',
				'type'            => 'text',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $fn,
				'default'         => __( 'Menu', 'customify' ),
				'title'           => __( 'Label', 'customify' ),
			),

			array(
				'name'            => 'nav_icon_show_text',
				'type'            => 'checkbox',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $fn,
				'title'           => __( 'Label Settings', 'customify' ),
				'device_settings' => true,
				'default'         => array(
					'desktop' => 1,
					'tablet'  => 0,
					'mobile'  => 0,
				),
				'checkbox_label'  => __( 'Show Label', 'customify' ),
			),

			array(
				'name'            => 'nav_icon_size',
				'type'            => 'radio_group',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $fn,
				'title'           => __( 'Icon Size', 'customify' ),
				'default'         => array(
					'desktop' => 'medium',
					'tablet'  => 'medium',
					'mobile'  => 'medium',
				),
				'device_settings' => true,
				'choices'         => array(
					'small'  => __( 'Small', 'customify' ),
					'medium' => __( 'Medium', 'customify' ),
					'large'  => __( 'Large', 'customify' ),
				),
			),

			array(
				'name'       => 'nav_icon_item_color',
				'type'       => 'color',
				'section'    => $section,
				'title'      => __( 'Color', 'customify' ),
				'css_format' => 'color: {{value}};',
				'selector'   => ".header--row:not(.header--transparent) {$selector}",

			),

			array(
				'name'       => 'nav_icon_item_color_hover',
				'type'       => 'color',
				'section'    => $section,
				'css_format' => 'color: {{value}};',
				'selector'   => ".header--row:not(.header--transparent) {$selector}:hover",
				'title'      => __( 'Color Hover', 'customify' ),
			),
		);

		// Item Layout.
		return array_merge( $config, customify_header_layout_settings( $this->id, $section ) );
	}

	function render() {
		$label      = sanitize_text_field( Customify()->get_setting( 'nav_icon_text' ) );
		$show_label = Customify()->get_setting( 'nav_icon_show_text', 'all' );
		$style      = sanitize_text_field( Customify()->get_setting( 'nav_icon_style' ) );
		$sizes      = Customify()->get_setting( 'nav_icon_size', 'all' );

		$classes       = array( 'menu-mobile-toggle item-button' );
		$label_classes = array( 'nav-icon--label' );
		if ( is_array( $show_label ) ) {
			foreach ( $show_label as $d => $v ) {
				if ( $v ) { // phpcs:ignore

				} else {
					$label_classes[] = 'hide-on-' . $d;
				}
			}
		}

		if ( empty( $sizes ) ) {
			$sizes = 'is-size-' . $sizes;
		}

		if ( is_string( $sizes ) ) {
			$classes[] = $sizes;
		} else {
			foreach ( $sizes as $d => $s ) {
				if ( ! is_string( $s ) ) {
					$s = 'is-size-medium';
				}

				$classes[] = 'is-size-' . $d . '-' . $s;
			}
		}

		if ( $style ) {
			$classes[] = $style;
		}
		?>
		<a class="<?php echo esc_attr( join( ' ', $classes ) ); ?>">
			<span class="hamburger hamburger--squeeze">
				<span class="hamburger-box">
					<span class="hamburger-inner"></span>
				</span>
			</span>
			<?php
			if ( $show_label ) {
				echo '<span class="' . esc_attr( join( ' ', $label_classes ) ) . '">' . $label . '</span>';
			}
			?></a>
		<?php
	}

}

Customify_Customize_Layout_Builder()->register_item( 'header', new Customify_Builder_Item_Nav_Icon() );

configs/header/button.php000066600000011473151151110650011456 0ustar00<?php

class Customify_Builder_Item_Button {
	public $id = 'button';

	function __construct() {
		add_filter( 'customify/icon_used', array( $this, 'used_icon' ) );
	}

	function used_icon( $list = array() ) {
		$list[ $this->id ] = 1;

		return $list;
	}

	function item() {
		return array(
			'name'    => __( 'Button', 'customify' ),
			'id'      => 'button',
			'col'     => 0,
			'width'   => '4',
			'section' => 'header_button', // Customizer section to focus when click settings.
		);
	}

	function customize() {
		$section  = 'header_button';
		$prefix   = 'header_button';
		$fn       = array( $this, 'render' );
		$selector = 'a.item--' . $this->id;
		$config   = array(
			array(
				'name'  => $section,
				'type'  => 'section',
				'panel' => 'header_settings',
				'title' => __( 'Button', 'customify' ),
			),

			array(
				'name'            => $prefix . '_text',
				'type'            => 'text',
				'section'         => $section,
				'theme_supports'  => '',
				'selector'        => $selector,
				'render_callback' => $fn,
				'title'           => __( 'Text', 'customify' ),
				'default'         => __( 'Button', 'customify' ),
			),

			array(
				'name'            => $prefix . '_icon',
				'type'            => 'icon',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $fn,
				'theme_supports'  => '',
				'title'           => __( 'Icon', 'customify' ),
			),

			array(
				'name'            => $prefix . '_position',
				'type'            => 'radio_group',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $fn,
				'default'         => 'before',
				'title'           => __( 'Icon Position', 'customify' ),
				'choices'         => array(
					'before' => __( 'Before', 'customify' ),
					'after'  => __( 'After', 'customify' ),
				),
			),

			array(
				'name'            => $prefix . '_link',
				'type'            => 'text',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $fn,
				'title'           => __( 'Link', 'customify' ),
			),

			array(
				'name'            => $prefix . '_target',
				'type'            => 'checkbox',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $fn,
				'checkbox_label'  => __( 'Open link in a new tab.', 'customify' ),
			),

			array(
				'name'        => $prefix . '_typography',
				'type'        => 'typography',
				'section'     => $section,
				'title'       => __( 'Typography', 'customify' ),
				'description' => __( 'Advanced typography for button', 'customify' ),
				'selector'    => $selector,
				'css_format'  => 'typography',
				'default'     => array(),
			),

			array(
				'name'        => $prefix . '_styling',
				'type'        => 'styling',
				'section'     => $section,
				'title'       => __( 'Styling', 'customify' ),
				'description' => __( 'Advanced styling for button', 'customify' ),
				'selector'    => array(
					'normal' => $selector,
					'hover'  => $selector . ':hover',
				),
				'css_format'  => 'styling',
				'default'     => array(),
				'fields'      => array(
					'normal_fields' => array(
						'link_color'    => false, // disable for special field.
						'margin'        => false,
						'bg_image'      => false,
						'bg_cover'      => false,
						'bg_position'   => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
					),
					'hover_fields'  => array(
						'link_color' => false, // disable for special field.
					),
				),
			),

		);

		// Item Layout.
		return array_merge( $config, customify_header_layout_settings( $this->id, $section ) );
	}


	function render() {
		$text          = Customify()->get_setting( 'header_button_text' );
		$icon          = Customify()->get_setting( 'header_button_icon' );
		$new_window    = Customify()->get_setting( 'header_button_target' );
		$link          = Customify()->get_setting( 'header_button_link' );
		$icon_position = Customify()->get_setting( 'header_button_position' );
		$classes       = array( 'item--' . $this->id, 'customify-btn customify-builder-btn' );

		$icon = wp_parse_args(
			$icon,
			array(
				'type' => '',
				'icon' => '',
			)
		);

		$target = '';
		if ( 1 == $new_window ) {
			$target = ' target="_blank" ';
		}

		$icon_html = '';
		if ( $icon['icon'] ) {
			$icon_html = '<i class="' . esc_attr( $icon['icon'] ) . '"></i> ';
		}
		$classes[] = 'is-icon-' . $icon_position;
		if ( ! $text ) {
			$text = __( 'Button', 'customify' );
		}

		echo '<a' . $target . ' href="' . esc_url( $link ) . '" class="' . esc_attr( join( ' ', $classes ) ) . '">';
		if ( 'after' != $icon_position ) {
			echo $icon_html . esc_html( $text );
		} else {
			echo esc_html( $text ) . $icon_html;
		}
		echo '</a>';
	}
}

Customify_Customize_Layout_Builder()->register_item( 'header', new Customify_Builder_Item_Button() );


configs/header/menus.php000066600000026775151151110650011305 0ustar00<?php

class Customify_Builder_Item_Primary_Menu {
	public $id;
	public $label;
	public $prefix;
	public $selector;
	public $section;
	public $theme_location;

	/**
	 * Optional construct
	 *
	 * Customify_Builder_Item_HTML constructor.
	 */
	function __construct() {
		$this->id             = 'primary-menu';
		$this->label          = __( 'Primary Menu', 'customify' );
		$this->prefix         = 'primary_menu';
		$this->selector       = '.builder-item--' . $this->id . ' .nav-menu-desktop .primary-menu-ul';
		$this->section        = 'header_menu_primary';
		$this->theme_location = 'menu-1';
	}

	function item() {
		return array(
			'name'    => $this->label,
			'id'      => $this->id,
			'width'   => '6',
			'section' => $this->section, // Customizer section to focus when click settings.
		);
	}

	function customize() {
		$section = $this->section;
		$fn      = array( $this, 'render' );
		$config  = array(
			array(
				'name'           => $section,
				'type'           => 'section',
				'panel'          => 'header_settings',
				'theme_supports' => '',
				'title'          => $this->label,
				'description'    => sprintf( __( 'Assign <a href="#menu_locations"  class="focus-section">Menu Location</a> for %1$s', 'customify' ), $this->label ),
			),

			array(
				'name'            => $this->prefix . '_style',
				'type'            => 'image_select',
				'section'         => $section,
				'selector'        => '.builder-item--' . $this->id . " .{$this->id}",
				'render_callback' => $fn,
				'title'           => __( 'Menu Preset', 'customify' ),
				'default'         => 'style-plain',
				'css_format'      => 'html_class',
				'choices'         => array(
					'style-plain'         => array(
						'img' => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/menu_style_1.svg',
					),
					'style-full-height'   => array(
						'img' => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/menu_style_2.svg',
					),
					'style-border-bottom' => array(
						'img' => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/menu_style_3.svg',
					),
					'style-border-top'    => array(
						'img' => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/menu_style_4.svg',
					),
				),
			),

			array(
				'name'       => $this->prefix . '_style_border_h',
				'type'       => 'slider',
				'section'    => $section,
				'selector'   => 'format',
				'max'        => 20,
				'title'      => __( 'Border Height', 'customify' ),
				'css_format' => ".nav-menu-desktop.style-border-bottom .{$this->id}-ul > li > a .link-before:before, .nav-menu-desktop.style-border-top .{$this->id}-ul > li > a .link-before:before  { height: {{value}}; }",
				'required'   => array(
					$this->prefix . '_style',
					'in',
					array( 'style-border-bottom', 'style-border-top' ),
				),
			),

			array(
				'name'       => $this->prefix . '_style_border_pos',
				'type'       => 'slider',
				'section'    => $section,
				'selector'   => 'format',
				'min'        => - 50,
				'max'        => 50,
				'title'      => __( 'Border Position', 'customify' ),
				'css_format' => ".nav-menu-desktop.style-border-bottom .{$this->id}-ul > li > a .link-before:before { bottom: {{value}}; } .nav-menu-desktop.style-border-top .{$this->id}-ul > li > a .link-before:before { top: {{value}}; }",
				'required'   => array(
					$this->prefix . '_style',
					'in',
					array( 'style-border-bottom', 'style-border-top' ),
				),
			),

			array(
				'name'       => $this->prefix . '_style_border_color',
				'type'       => 'color',
				'section'    => $section,
				'selector'   => 'format',
				'title'      => __( 'Border Color', 'customify' ),
				'css_format' => ".nav-menu-desktop.style-border-bottom .{$this->id}-ul > li:hover > a .link-before:before, 
                .nav-menu-desktop.style-border-bottom .{$this->id}-ul > li.current-menu-item > a .link-before:before, 
                .nav-menu-desktop.style-border-bottom .{$this->id}-ul > li.current-menu-ancestor > a .link-before:before,
                .nav-menu-desktop.style-border-top .{$this->id}-ul > li:hover > a .link-before:before,
                .nav-menu-desktop.style-border-top .{$this->id}-ul > li.current-menu-item > a .link-before:before, 
                .nav-menu-desktop.style-border-top .{$this->id}-ul > li.current-menu-ancestor > a .link-before:before
                { background-color: {{value}}; }",
				'required'   => array(
					$this->prefix . '_style',
					'in',
					array( 'style-border-bottom', 'style-border-top' ),
				),
			),

			array(
				'name'           => $this->prefix . '__hide-arrow',
				'type'           => 'checkbox',
				'section'        => $section,
				'selector'       => '.builder-item--' . $this->id . " .{$this->id}",
				'checkbox_label' => __( 'Hide menu dropdown arrow', 'customify' ),
				'css_format'     => 'html_class',
			),

			array(
				'name'            => $this->prefix . '_arrow_size',
				'type'            => 'slider',
				'devices_setting' => true,
				'section'         => $section,
				'selector'        => 'format',
				'max'             => 20,
				'title'           => __( 'Arrow icon size', 'customify' ),
				'css_format'      => ".builder-item--{$this->id} .nav-icon-angle { width: {{value}}; height: {{value}}; }",
				'required'        => array( $this->prefix . '__hide-arrow', '!=', 1 ),
			),

			array(
				'name'    => $this->prefix . '_top_heading',
				'type'    => 'heading',
				'section' => $section,
				'title'   => __( 'Top Menu', 'customify' ),
			),

			array(
				'name'        => $this->prefix . '_item_styling',
				'type'        => 'styling',
				'section'     => $section,
				'title'       => __( 'Top Menu Items Styling', 'customify' ),
				'description' => __( 'Styling for top level menu items', 'customify' ),
				'selector'    => array(
					'normal'        => "{$this->selector} > li > a",
					'normal_margin' => "{$this->selector} > li",
					'hover'         => ".header--row:not(.header--transparent) {$this->selector} > li > a:hover, .header--row:not(.header--transparent) {$this->selector} > li.current-menu-item > a, .header--row:not(.header--transparent) {$this->selector} > li.current-menu-ancestor > a, .header--row:not(.header--transparent) {$this->selector} > li.current-menu-parent > a",
				),
				'css_format'  => 'styling',
				'fields'      => array(
					'tabs'          => array(
						'normal' => __( 'Normal', 'customify' ),
						'hover'  => __( 'Hover/Active', 'customify' ),
					),
					'normal_fields' => array(
						'link_color'    => false,
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'bg_position'   => false,
					),
					'hover_fields'  => array(
						'link_color'    => false,
						'bg_cover'      => false,
						'bg_image'      => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
						'bg_position'   => false,
					),
				),
			),

			array(
				'name'        => $this->prefix . '_typography',
				'type'        => 'typography',
				'section'     => $section,
				'title'       => __( 'Top Menu Items Typography', 'customify' ),
				'description' => __( 'Typography for menu', 'customify' ),
				'selector'    => "{$this->selector} > li > a,.builder-item-sidebar .primary-menu-sidebar .primary-menu-ul > li > a",
				'css_format'  => 'typography',
			),

		);

		if ( ! class_exists( 'Customify_Pro' ) ) {
			$config[] = array(
				'name'    => $this->prefix . '_submenu_heading',
				'type'    => 'heading',
				'section' => $section,
				'title'   => __( 'Submenu', 'customify' ),
			);
			$config[] = array(
				'name'        => $this->prefix . '_typography_submenu',
				'type'        => 'custom_html',
				'section'     => $section,
				'description' => sprintf( __( 'Submenu settings is a part of Advanced Header & Footer builder modules which only available in Customify Pro. <a target="_blank" href="https://pressmaximum.com/docs/customify/customify-pro-modules/advanced-header-footer-builder/">Learn more about it here</a>.', 'customify' ) ),
				'selector'    => "{$this->selector} .sub-menu li a",
			);
		}

		$config = apply_filters( 'customify/customize-menu-config-more', $config, $section, $this );

		// Item Layout.
		return array_merge( $config, customify_header_layout_settings( $this->id, $section ) );
	}

	function menu_fallback_cb() {
		$pages = get_pages(
			array(
				'child_of'     => 0,
				'sort_order'   => 'ASC',
				'sort_column'  => 'menu_order, post_title',
				'hierarchical' => 0,
				'parent'       => 0,
				'exclude_tree' => array(),
				'number'       => 10,
			)
		);

		echo '<ul class="' . $this->id . '-ul menu nav-menu menu--pages">';
		foreach ( (array) $pages as $p ) {
			$class = '';
			if ( is_page( $p ) ) {
				$class = 'current-menu-item';
			}

			echo '<li id="menu-item--__id__-__device__-' . esc_attr( $p->ID ) . '" class="menu-item menu-item-type--page  menu-item-' . esc_attr( $p->ID . ' ' . $class ) . '"><a href="' . esc_url( get_the_permalink( $p ) ) . '"><span class="link-before">' . apply_filters( '', $p->post_title ) . '</span></a></li>';
		}
		echo '</ul>';
	}

	/**
	 * @see Walker_Nav_Menu
	 */
	function render() {
		$style = sanitize_text_field( Customify()->get_setting( $this->prefix . '_style' ) );
		if ( $style ) {
			$style = sanitize_text_field( $style );
		}

		$hide_arrow = sanitize_text_field( Customify()->get_setting( $this->prefix . '__hide-arrow' ) );
		if ( $hide_arrow ) {
			$style .= ' hide-arrow-active';
		}

		$container_classes = $this->id . ' ' . $this->id . '-__id__ nav-menu-__device__ ' . $this->id . '-__device__' . ( $style ? ' ' . $style : '' );
		echo '<nav  id="site-navigation-__id__-__device__" class="site-navigation ' . $container_classes . '">';
		wp_nav_menu(
			array(
				'theme_location'  => $this->theme_location,
				'container'       => false,
				'container_id'    => false,
				'container_class' => false,
				'menu_id'         => false,
				'menu_class'      => $this->id . '-ul menu nav-menu',
				'fallback_cb'     => '',
				'link_before'     => '<span class="link-before">',
				'link_after'      => '</span>',
			)
		);

		echo '</nav>';

	}
}

/**
 * Change menu item ID
 *
 * @see Walker_Nav_Menu::start_el();
 *
 * @param string $string_id
 * @param object $item
 * @param object $args An object of wp_nav_menu() arguments.
 *
 * @return mixed
 */
function customify_change_nav_menu_item_id( $string_id, $item, $args ) {
	if ( 'menu-1' == $args->theme_location || 'menu-2' == $args->theme_location ) {
		$string_id = 'menu-item--__id__-__device__-' . $item->ID;
	}

	return $string_id;
}

add_filter( 'nav_menu_item_id', 'customify_change_nav_menu_item_id', 55, 3 );


/**
 * Add Nav icon to menu
 *
 * @param string $title
 * @param object $item
 * @param array  $args
 * @param int    $depth
 *
 * @return string
 */
function customify_add_icon_to_menu( $title, $item, $args, $depth ) {
	if ( in_array( 'menu-item-has-children', $item->classes ) ) { // phpcs:ignore
		$title .= '<span class="nav-icon-angle">&nbsp;</span>';

	}

	return $title;
}

add_filter( 'nav_menu_item_title', 'customify_add_icon_to_menu', 25, 4 );

/**
 * Add more sub menu classes
 *
 * @since 0.1.1
 * @see   Walker_Nav_Menu::start_lvl
 *
 * @param array $classes
 * @param array $args
 * @param int   $depth
 *
 * @return array
 */
function customify_add_sub_menu_classes( $classes, $args, $depth ) {
	$classes[] = 'sub-lv-' . $depth;

	return $classes;
}

add_filter( 'nav_menu_submenu_css_class', 'customify_add_sub_menu_classes', 35, 3 );

// Register header item.
Customify_Customize_Layout_Builder()->register_item( 'header', new Customify_Builder_Item_Primary_Menu() );
configs/header/html.php000066600000004737151151110650011114 0ustar00<?php

class Customify_Builder_Item_HTML {
	/**
	 * @var string Required
	 */
	public $id = 'html';
	/**
	 * @var string Optional
	 */
	public $section = 'header_html';
	/**
	 * @var string Optional
	 */
	public $name = 'header_html';
	/**
	 * @var string Optional
	 */
	public $label = '';
	public $priority = 200;
	public $panel = 'header_settings';

	/**
	 * Optional construct
	 *
	 * Customify_Builder_Item_HTML constructor.
	 */
	function __construct() {
		$this->label = __( 'HTML 1', 'customify' );
	}

	/**
	 * Register Builder item
	 *
	 * @return array
	 */
	function item() {
		return array(
			'name'    => $this->label,
			'id'      => $this->id,
			'col'     => 0,
			'width'   => '4',
			'section' => $this->section, // Customizer section to focus when click settings.
		);
	}

	/**
	 * Optional, Register customize section and panel.
	 *
	 * @return array
	 */
	function customize() {
		// Render callback function.
		$fn     = array( $this, 'render' );
		$config = array(
			array(
				'name'     => $this->section,
				'type'     => 'section',
				'panel'    => $this->panel,
				'priority' => $this->priority,
				'title'    => $this->label,
			),

			array(
				'name'            => $this->name,
				'type'            => 'textarea',
				'section'         => $this->section,
				'selector'        => '.builder-header-' . $this->id . '-item',
				'render_callback' => $fn,
				'theme_supports'  => '',
				'default'         => __( 'Add custom text here or remove it', 'customify' ),
				'title'           => __( 'HTML', 'customify' ),
				'description'     => __( 'Arbitrary HTML code.', 'customify' ),
			),

			array(
				'name'       => $this->name . '_typo',
				'type'       => 'typography',
				'section'    => $this->section,
				'selector'   => '.builder-header-' . $this->id . '-item.item--html p, .builder-header-' . $this->id . '-item.item--html',
				'css_format' => 'typography',
				'title'      => __( 'Typography Setting', 'customify' ),
			),

		);

		// Item Layout.
		return array_merge( $config, customify_header_layout_settings( $this->id, $this->section ) );
	}

	/**
	 * Optional. Render item content
	 */
	function render() {
		$content = Customify()->get_setting( $this->name );
		echo '<div class="builder-header-' . esc_attr( $this->id ) . '-item item--html">';
		echo apply_filters( 'customify_the_content', wp_kses_post( balanceTags( $content, true ) ) );
		echo '</div>';
	}
}

Customify_Customize_Layout_Builder()->register_item( 'header', new Customify_Builder_Item_HTML() );
configs/header/logo.php000066600000012310151151110650011072 0ustar00<?php

class Customify_Builder_Item_Logo {
	public $id = 'logo';

	function item() {
		return array(
			'name'    => __( 'Logo', 'customify' ),
			'id'      => 'logo',
			'width'   => '3',
			'section' => 'title_tagline', // Customizer section to focus when click settings.
		);
	}

	function customize( $wp_customize ) {
		$section      = 'title_tagline';
		$render_cb_el = array( $this, 'render' );
		$selector     = '.site-header .site-branding';
		$fn           = 'customify_customize_render_header';
		$config       = array(

			array(
				'name'            => 'logo_max_width',
				'type'            => 'slider',
				'section'         => $section,
				'default'         => array(),
				'max'             => 400,
				'priority'        => 8,
				'device_settings' => true,
				'title'           => __( 'Logo Max Width', 'customify' ),
				'selector'        => 'format',
				'css_format'      => "$selector img { max-width: {{value}}; } .site-header .cb-row--mobile .site-branding img { width: {{value}}; } ",
			),

			array(
				'name'            => 'header_logo_retina',
				'type'            => 'image',
				'section'         => $section,
				'device_settings' => false,
				'selector'        => $selector,
				'render_callback' => $render_cb_el,
				'priority'        => 9,
				'title'           => __( 'Logo Retina', 'customify' ),
			),

			array(
				'name'            => 'header_logo_name',
				'type'            => 'radio_group',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $render_cb_el,
				'title'           => __( 'Show Site Title', 'customify' ),
				'default'         => 'yes',
				'choices'         => array(
					'yes' => __( 'Yes', 'customify' ),
					'no'  => __( 'No', 'customify' ),
				),
			),

			array(
				'name'            => 'header_logo_desc',
				'type'            => 'radio_group',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $render_cb_el,
				'title'           => __( 'Show Site Tagline', 'customify' ),
				'default'         => 'no',
				'choices'         => array(
					'yes' => __( 'Yes', 'customify' ),
					'no'  => __( 'No', 'customify' ),
				),
			),

			array(
				'name'            => 'header_logo_pos',
				'type'            => 'radio_group',
				'section'         => $section,
				'selector'        => $selector,
				'render_callback' => $render_cb_el,
				'title'           => __( 'Logo Position', 'customify' ),
				'default'         => 'top',
				'choices'         => array(
					'top'    => __( 'Top', 'customify' ),
					'left'   => __( 'Left', 'customify' ),
					'right'  => __( 'Right', 'customify' ),
					'bottom' => __( 'Bottom', 'customify' ),
				),
			),

		);

		$config = apply_filters( 'customify/builder/header/logo-settings', $config, $this );

		// Item Layout.
		return array_merge( $config, customify_header_layout_settings( $this->id, $section ) );
	}

	function logo() {
		$custom_logo_id    = get_theme_mod( 'custom_logo' );
		$logo_image        = Customify()->get_media( $custom_logo_id, 'full' );
		$logo_retina       = Customify()->get_setting( 'header_logo_retina' );
		$logo_retina_image = Customify()->get_media( $logo_retina );

		if ( $logo_image ) {
			?>
			<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="logo-link" rel="home" itemprop="url">
				<img class="site-img-logo" src="<?php echo esc_url( $logo_image ); ?>" alt="<?php bloginfo( 'name' ); ?>"<?php if ( $logo_retina_image ) {
					?> srcset="<?php echo esc_url( $logo_retina_image ); ?> 2x"<?php } ?>>
				<?php do_action( 'customizer/after-logo-img' ); ?>
			</a>
			<?php
		}
	}

	/**
	 * Render Logo item
	 *
	 * @see get_custom_logo
	 */
	function render() {
		$show_name      = Customify()->get_setting( 'header_logo_name' );
		$show_desc      = Customify()->get_setting( 'header_logo_desc' );
		$image_position = Customify()->get_setting( 'header_logo_pos' );
		$logo_classes   = array( 'site-branding' );
		$logo_classes[] = 'logo-' . $image_position;
		$logo_classes   = apply_filters( 'customify/logo-classes', $logo_classes );
		$tag = is_customize_preview() ? 'h2' : '__site_device_tag__';
		?>
		<div class="<?php echo esc_attr( join( ' ', $logo_classes ) ); ?>">
			<?php

			$this->logo();
			if ( 'no' !== $show_name || 'no' !== $show_desc ) {
				echo '<div class="site-name-desc">';
				if ( 'no' !== $show_name ) {
					if ( is_front_page() && is_home() ) : ?>
						<<?php echo $tag; /* WPCS: xss ok. */ ?> class="site-title">
							<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
						</<?php echo $tag; /* WPCS: xss ok. */ ?>>
					<?php else : ?>
						<p class="site-title">
							<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
						</p>
						<?php
					endif;
				}

				if ( 'no' !== $show_desc ) {
					$description = get_bloginfo( 'description', 'display' );
					if ( $description || is_customize_preview() ) { ?>
						<p class="site-description text-uppercase text-xsmall"><?php echo $description; /* WPCS: xss ok. */ ?></p>
						<?php
					};
				}
				echo '</div>';
			}

			?>
		</div><!-- .site-branding -->
		<?php
	}
}

Customify_Customize_Layout_Builder()->register_item( 'header', new Customify_Builder_Item_Logo() );
configs/related-posts.php000066600000017033151151110650011477 0ustar00<?php
if ( ! function_exists( 'customify_customizer_single_related_posts_config' ) ) {
	function customify_customizer_single_related_posts_config( $configs = array() ) {

		$args = array(
			'name'     => __( 'Single Blog Post', 'customify' ),
			'id'       => 'single_blog_post',
			'selector' => '.entry.entry-single',
			'cb'       => 'customify_single_post',
		);

		$top_panel     = 'blog_panel';
		$level_2_panel = 'section_' . $args['id'];

		$config = array(

			array(
				'name'    => $level_2_panel . '_h_related',
				'type'    => 'heading',
				'section' => $level_2_panel,
				'title'   => __( 'Related Posts', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_related_title',
				'type'            => 'text',
				'section'         => $level_2_panel,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'default'         => __( 'Related Posts', 'customify' ),
				'label'           => __( 'Title', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_related_by',
				'type'            => 'select',
				'section'         => $level_2_panel,
				'default'         => 'tag',
				'max'             => 150,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Related posts by', 'customify' ),
				'choices'         => array(
					'cat' => __( 'By categories', 'customify' ),
					'tag' => __( 'By tags', 'customify' ),
				),
			),

			array(
				'name'            => $args['id'] . '_related_col',
				'type'            => 'select',
				'section'         => $level_2_panel,
				'default'         => array(
					'desktop' => 3,
					'tablet'  => 3,
					'mobile'  => 1,
				),
				'max'             => 150,
				'device_settings' => true,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Number columns to show', 'customify' ),
				'choices'         => array(
					1 => 1,
					2 => 2,
					3 => 3,
					4 => 4,
					5 => 5,
					6 => 6,
				),
			),

			array(
				'name'            => $args['id'] . '_related_number',
				'type'            => 'text',
				'section'         => $level_2_panel,
				'selector'        => $args['selector'],
				'default'         => 3,
				'render_callback' => $args['cb'],
				'label'           => __( 'Number posts to show', 'customify' ),
				'description'     => __( 'Enter 0 to disable related posts.', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_related_img_pos',
				'type'            => 'select',
				'section'         => $level_2_panel,
				'default'         => 'top',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Image Position', 'customify' ),
				'choices'         => array(
					'left'  => __( 'Left', 'customify' ),
					'right' => __( 'Right', 'customify' ),
					'top'   => __( 'Top', 'customify' ),
				),
			),

			array(
				'name'            => $args['id'] . '_related_thumbnail_size',
				'type'            => 'select',
				'section'         => $level_2_panel,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'default'         => 'medium',
				'label'           => __( 'Thumbnail Size', 'customify' ),
				'choices'         => customify_get_all_image_sizes(),
			),

			array(
				'name'            => $args['id'] . '_related_thumbnail_height',
				'type'            => 'slider',
				'section'         => $level_2_panel,
				'selector'        => 'format',
				'unit'            => '%',
				'max'             => '200',
				'default'         => '',
				'label'           => __( 'Custom Thumbnail Height', 'customify' ),
				'device_settings' => true,
				'devices'         => array( 'desktop', 'tablet' ),
				'css_format'      => '.related-post .related-thumbnail a { padding-top: {{value_no_unit}}%; } .related-post .related-thumbnail img { width: 100%;position: absolute; top: 0px; right: 0px; display: block; height: 100%; object-fit: cover; }',
			),

			array(
				'name'            => $args['id'] . '_related_thumbnail_width',
				'type'            => 'slider',
				'section'         => $level_2_panel,
				'selector'        => 'format',
				'unit'            => '%',
				'max'             => '100',
				'default'         => '',
				'label'           => __( 'Custom Thumbnail Width', 'customify' ),
				'device_settings' => true,
				'devices'         => array( 'desktop', 'tablet' ),
				'css_format'      => '.img-pos-left .related-thumbnail, .img-pos-right .related-thumbnail { flex-basis: {{value_no_unit}}%; } .img-pos-left .related-body, .img-pos-right .related-body { flex-basis: calc( 100% - {{value_no_unit}}% ); }',
				'required'        => array( $args['id'] . '_related_img_pos', 'in', array( 'left', 'right' ) ),
			),

			array(
				'name'            => $args['id'] . '_related_orderby',
				'type'            => 'select',
				'section'         => $level_2_panel,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Order by', 'customify' ),
				'default'         => 'date',
				'choices'         => array(
					'date'          => __( 'Date', 'customify' ),
					'title'         => __( 'Title', 'customify' ),
					'menu_order'    => __( 'Post order', 'customify' ),
					'rand'          => __( 'Random', 'customify' ),
					'comment_count' => __( 'Comment count', 'customify' ),
				),
			),

			array(
				'name'            => $args['id'] . '_related_order',
				'type'            => 'select',
				'section'         => $level_2_panel,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'default'         => 'desc',
				'label'           => __( 'Order', 'customify' ),
				'choices'         => array(
					'desc' => __( 'Desc', 'customify' ),
					'asc'  => __( 'Asc', 'customify' ),
				),
			),

			array(
				'name'             => $args['id'] . '_related_meta',
				'section'          => $level_2_panel,
				'type'             => 'repeater',
				'label'            => __( 'Related post meta', 'customify' ),
				'live_title_field' => 'title',
				'limit'            => 4,
				'addable'          => false,
				'title_only'       => true,
				'selector'         => $args['selector'],
				'render_callback'  => $args['cb'],
				'default'          => array(
					array(
						'_key'        => 'author',
						'title'       => __( 'Author', 'customify' ),
						'_visibility' => 'hidden',
					),
					array(
						'_key'  => 'date',
						'title' => __( 'Date', 'customify' ),
					),
					array(
						'_key'        => 'categories',
						'title'       => __( 'Categories', 'customify' ),
						'_visibility' => 'hidden',
					),
					array(
						'_key'        => 'comment',
						'title'       => __( 'Comment', 'customify' ),
						'_visibility' => 'hidden',
					),

				),
				'fields'           => array(
					array(
						'name' => '_key',
						'type' => 'hidden',
					),
					array(
						'name'  => 'title',
						'type'  => 'hidden',
						'label' => __( 'Title', 'customify' ),
					),
				),
			),

			array(
				'name'            => $args['id'] . '_related_excerpt_length',
				'type'            => 'text',
				'section'         => $level_2_panel,
				'selector'        => $args['selector'],
				'default'         => 0,
				'render_callback' => $args['cb'],
				'label'           => __( 'Excerpt length', 'customify' ),
				'description'     => __( 'Custom excerpt length. Enter 0 to hide the excerpt.', 'customify' ),
			),

		);

		return array_merge( $configs, $config );

	}
}

add_filter( 'customify/customizer/config', 'customify_customizer_single_related_posts_config', 399 );

configs/blogs.php000066600000036161151151110650010022 0ustar00<?php
if ( ! function_exists( 'customify_customizer_blog_config' ) ) {
	function customify_customizer_blog_config( $args = array() ) {

		$args          = wp_parse_args(
			$args,
			array(
				'name'     => __( 'Blog Posts', 'customify' ),
				'id'       => 'blog_post',
				'selector' => '#blog-posts',
				'cb'       => 'customify_blog_posts',
			)
		);
		$top_panel     = 'blog_panel';
		$level_2_panel = 'panel_' . $args['id'];

		$config = array(
			array(
				'name'  => $level_2_panel,
				'type'  => 'panel',
				'panel' => $top_panel,
				'title' => $args['name'],
			),

			array(
				'name'  => $level_2_panel . '_layout',
				'type'  => 'section',
				'panel' => $level_2_panel,
				'title' => __( 'Layout', 'customify' ),
			),

			array(
				'name'             => $args['id'] . '_layout',
				'type'             => 'image_select',
				'section'          => $level_2_panel . '_layout',
				'label'            => __( 'Layout', 'customify' ),
				'default'          => 'blog_column',
				'selector'         => $args['selector'],
				'render_callback'  => $args['cb'],
				'disabled_msg'     => __( 'This option is available in Customify Pro plugin only.', 'customify' ),
				'disabled_pro_msg' => __( 'Please activate module Blog Posts to use this layout.', 'customify' ),
				'choices'          => array(
					'blog_classic' => array(
						'img' => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/blog_classic.svg',
					),
					'blog_column'  => array(
						'img' => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/blog_column.svg',
					),
					'blog_masonry' => array(
						'img'     => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/blog_masonry.svg',
						'disable' => 1,
						'bubble'  => __( 'Pro', 'customify' ),
					),
					'blog_lateral' => array(
						'img'     => esc_url( get_template_directory_uri() ) . '/assets/images/customizer/blog_lateral.svg',
						'disable' => 1,
						'bubble'  => __( 'Pro', 'customify' ),
					),

				),
				'reset_controls'   => array(
					$args['id'] . '_media_ratio',
					$args['id'] . '_media_width',
				),
			),

			array(
				'name'    => $level_2_panel . '_layout_h1',
				'type'    => 'heading',
				'section' => $level_2_panel . '_layout',
				'title'   => __( 'Article Styling', 'customify' ),
			),

			array(
				'name'       => $args['id'] . '_a_item',
				'type'       => 'styling',
				'section'    => $level_2_panel . '_layout',
				'selector'   => array(
					'normal'        => "{$args['selector'] } .entry-inner",
					'hover'         => "{$args['selector'] } .entry-inner:hover",
					'normal_margin' => "{$args['selector'] } .entry-inner",
				),
				'css_format' => 'styling',
				'label'      => __( 'Article Wrapper', 'customify' ),
				'fields'     => array(
					'normal_fields' => array(
						'link_color'    => false, // disable for special field.
						'bg_image'      => false,
						'bg_cover'      => false,
						'bg_position'   => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
					),
					'hover_fields'  => array(
						'link_color' => false,
					),
				),
			),

			array(
				'name'  => $level_2_panel . '_media',
				'type'  => 'section',
				'panel' => $level_2_panel,
				'title' => __( 'Media', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_media_hide',
				'type'            => 'checkbox',
				'section'         => $level_2_panel . '_media',
				'checkbox_label'  => __( 'Hide Media', 'customify' ),
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
			),

			array(
				'name'            => $args['id'] . '_media_ratio',
				'type'            => 'slider',
				'section'         => $level_2_panel . '_media',
				'label'           => __( 'Media Ratio', 'customify' ),
				'selector'        => "{$args['selector']} .posts-layout .entry .entry-media",
				'css_format'      => 'padding-top: {{value_no_unit}}%;',
				'max'             => 200,
				'min'             => 0,
				'device_settings' => true,
				'unit'            => '%',
				'required'        => array( $args['id'] . '_media_hide', '!=', '1' ),
			),
			array(
				'name'            => $args['id'] . '_media_width',
				'type'            => 'slider',
				'section'         => $level_2_panel . '_media',
				'label'           => __( 'Media Width', 'customify' ),
				'device_settings' => true,
				'devices'         => array( 'desktop', 'tablet' ),
				'max'             => 100,
				'min'             => 20,
				'unit'            => '%',
				'selector'        => "{$args['selector']} .posts-layout .entry-media, {$args['selector']} .posts-layout.layout--blog_classic .entry-media",
				'css_format'      => 'flex-basis: {{value_no_unit}}%; width: {{value_no_unit}}%;',
				'required'        => array( $args['id'] . '_media_hide', '!=', '1' ),
			),

			array(
				'name'       => $args['id'] . '_media_radius',
				'type'       => 'slider',
				'section'    => $level_2_panel . '_media',
				'label'      => __( 'Media Radius', 'customify' ),
				'max'        => 100,
				'min'        => 0,
				'selector'   => "{$args['selector']} .posts-layout .entry-media",
				'css_format' => 'border-radius: {{value}};',
				'required'   => array( $args['id'] . '_media_hide', '!=', '1' ),
			),

			array(
				'name'            => $args['id'] . '_thumbnail_size',
				'type'            => 'select',
				'section'         => $level_2_panel . '_media',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'default'         => 'medium',
				'label'           => __( 'Thumbnail Size', 'customify' ),
				'choices'         => customify_get_all_image_sizes(),
				'required'        => array( $args['id'] . '_media_hide', '!=', '1' ),
			),
			array(
				'name'            => $args['id'] . '_hide_thumb_if_empty',
				'type'            => 'checkbox',
				'section'         => $level_2_panel . '_media',
				'default'         => '1',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'checkbox_label'  => __( 'Hide featured image if empty.', 'customify' ),
				'required'        => array( $args['id'] . '_media_hide', '!=', '1' ),
			),

			// Article Excerpt ---------------------------------------------------------------------------------.
			array(
				'name'  => $level_2_panel . '_excerpt',
				'type'  => 'section',
				'panel' => $level_2_panel,
				'title' => __( 'Excerpt', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_excerpt_type',
				'type'            => 'select',
				'section'         => $level_2_panel . '_excerpt',
				'default'         => 'custom',
				'choices'         => array(
					'custom'   => __( 'Custom', 'customify' ),
					'excerpt'  => __( 'Use excerpt metabox', 'customify' ),
					'more_tag' => __( 'Strip excerpt by more tag', 'customify' ),
					'content'  => __( 'Full content', 'customify' ),
				),
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Excerpt Type', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_excerpt_length',
				'type'            => 'number',
				'section'         => $level_2_panel . '_excerpt',
				'default'         => 25,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Excerpt Length', 'customify' ),
				'required'        => array( $args['id'] . '_excerpt_type', '=', 'custom' ),
			),
			array(
				'name'            => $args['id'] . '_excerpt_more',
				'type'            => 'text',
				'section'         => $level_2_panel . '_excerpt',
				'default'         => '',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Excerpt More', 'customify' ),
			),

			array(
				'name'  => $level_2_panel . '_meta',
				'type'  => 'section',
				'panel' => $level_2_panel,
				'title' => __( 'Metas', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_meta_sep',
				'section'         => $level_2_panel . '_meta',
				'type'            => 'text',
				'default'         => '',
				'label'           => __( 'Separator', 'customify' ),
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
			),

			array(
				'name'       => $args['id'] . '_meta_sep_width',
				'section'    => $level_2_panel . '_meta',
				'type'       => 'slider',
				'max'        => 20,
				'label'      => __( 'Separator Width', 'customify' ),
				'selector'   => $args['selector'] . ' .entry-meta .sep',
				'css_format' => 'margin-left: calc( {{value}} / 2 ); margin-right: calc( {{value}} / 2 );',
			),

			array(
				'name'             => $args['id'] . '_meta_config',
				'section'          => $level_2_panel . '_meta',
				'type'             => 'repeater',
				'description'      => __( 'Drag to reorder the meta item.', 'customify' ),
				'live_title_field' => 'title',
				'limit'            => 4,
				'addable'          => false,
				'title_only'       => true,
				'selector'         => $args['selector'],
				'render_callback'  => $args['cb'],
				'default'          => array(
					array(
						'_key'  => 'author',
						'title' => __( 'Author', 'customify' ),
					),
					array(
						'_key'  => 'date',
						'title' => __( 'Date', 'customify' ),
					),
					array(
						'_key'  => 'categories',
						'title' => __( 'Categories', 'customify' ),
					),
					array(
						'_key'  => 'comment',
						'title' => __( 'Comment', 'customify' ),
					),

				),
				'fields'           => array(
					array(
						'name' => '_key',
						'type' => 'hidden',
					),
					array(
						'name'  => 'title',
						'type'  => 'hidden',
						'label' => __( 'Title', 'customify' ),
					),
				),
			),

			array(
				'name'            => $args['id'] . '_author_avatar',
				'type'            => 'checkbox',
				'section'         => $level_2_panel . '_meta',
				'default'         => 0,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'checkbox_label'  => __( 'Show author avatar', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_avatar_size',
				'type'            => 'slider',
				'section'         => $level_2_panel . '_meta',
				'default'         => 32,
				'max'             => 150,
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Avatar Size', 'customify' ),
				'required'        => array( $args['id'] . '_author_avatar', '==', '1' ),
			),

			array(
				'name'  => $level_2_panel . '_readmore',
				'type'  => 'section',
				'panel' => $level_2_panel,
				'title' => __( 'Read More', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_more_display',
				'type'            => 'checkbox',
				'default'         => 1,
				'section'         => $level_2_panel . '_readmore',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'checkbox_label'  => __( 'Show Read More Button', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_more_text',
				'type'            => 'text',
				'section'         => $level_2_panel . '_readmore',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'label'           => __( 'Read More Text', 'customify' ),
				'required'        => array( $args['id'] . '_more_display', '==', '1' ),
			),
			array(
				'name'       => $args['id'] . '_more_typography',
				'type'       => 'typography',
				'css_format' => 'typography',
				'section'    => $level_2_panel . '_readmore',
				'selector'   => "{$args['selector'] } .entry-readmore a",
				'label'      => __( 'Typography', 'customify' ),
				'required'   => array( $args['id'] . '_more_display', '==', '1' ),
			),

			array(
				'name'       => $args['id'] . '_more_styling',
				'type'       => 'styling',
				'section'    => $level_2_panel . '_readmore',
				'selector'   => array(
					'normal'        => "{$args['selector'] } .entry-readmore a",
					'hover'         => "{$args['selector'] } .entry-readmore a:hover",
					'normal_margin' => "{$args['selector'] } .entry-readmore",
				),
				'css_format' => 'styling',
				'label'      => __( 'Styling', 'customify' ),
				'fields'     => array(
					'normal_fields' => array(
						'link_color'    => false, // Disable for special field.
						'bg_image'      => false,
						'bg_cover'      => false,
						'bg_position'   => false,
						'bg_repeat'     => false,
						'bg_attachment' => false,
					),
					'hover_fields'  => array(
						'link_color' => false, // Disable for special field.
					),
				),
				'required'   => array( $args['id'] . '_more_display', '==', '1' ),
			),

			array(
				'name'  => $level_2_panel . '_pagination',
				'type'  => 'section',
				'panel' => $level_2_panel,
				'title' => __( 'Pagination', 'customify' ),
			),

			array(
				'name'            => $args['id'] . '_pg_show_paging',
				'section'         => $level_2_panel . '_pagination',
				'type'            => 'checkbox',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'default'         => 1,
				'checkbox_label'  => __( 'Show Pagination', 'customify' ),
			),
			array(
				'name'            => $args['id'] . '_pg_show_nav',
				'section'         => $level_2_panel . '_pagination',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'type'            => 'checkbox',
				'default'         => 1,
				'checkbox_label'  => __( 'Show Next, Previous Label', 'customify' ),
				'required'        => array( $args['id'] . '_pg_show_paging', '==', '1' ),
			),
			array(
				'name'            => $args['id'] . '_pg_prev_text',
				'section'         => $level_2_panel . '_pagination',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'type'            => 'text',
				'label'           => __( 'Previous Label', 'customify' ),
				'required'        => array( $args['id'] . '_pg_show_paging', '==', '1' ),
			),
			array(
				'name'            => $args['id'] . '_pg_next_text',
				'section'         => $level_2_panel . '_pagination',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'type'            => 'text',
				'label'           => __( 'Next Label', 'customify' ),
				'required'        => array( $args['id'] . '_pg_show_paging', '==', '1' ),
			),

			array(
				'name'            => $args['id'] . '_pg_mid_size',
				'section'         => $level_2_panel . '_pagination',
				'selector'        => $args['selector'],
				'render_callback' => $args['cb'],
				'type'            => 'text',
				'default'         => 3,
				'label'           => __( 'How many numbers to either side of the current pages', 'customify' ),
				'required'        => array( $args['id'] . '_pg_show_paging', '==', '1' ),
			),

		);

		return $config;
	}
}


if ( ! function_exists( 'customify_customizer_blog_posts_config' ) ) {
	function customify_customizer_blog_posts_config( $configs ) {

		$config = array(
			array(
				'name'     => 'blog_panel',
				'type'     => 'panel',
				'priority' => 20,
				'title'    => __( 'Blog', 'customify' ),
			),
		);

		$blog   = customify_customizer_blog_config();
		$config = array_merge( $config, $blog );

		return array_merge( $configs, $config );
	}
}

add_filter( 'customify/customizer/config', 'customify_customizer_blog_posts_config' );
configs/compatibility.php000066600000001172151151110650011557 0ustar00<?php
if ( ! function_exists( 'customify_customizer_compatibility_config' ) ) {
	/**
	 * Add compatibility panel.
	 *
	 * @param array $configs List customize settings.
	 *
	 * @return array
	 */
	function customify_customizer_compatibility_config( $configs ) {

		$panel  = 'compatibility';
		$config = array(
			// Layout panel.
			array(
				'name'     => $panel . '_panel',
				'type'     => 'panel',
				'priority' => 100,
				'title'    => __( 'Compatibility', 'customify' ),
			),

		);

		return array_merge( $configs, $config );
	}
}

add_filter( 'customify/customizer/config', 'customify_customizer_compatibility_config' );
configs/typography.php000066600000011100151151110650011104 0ustar00<?php
if ( ! function_exists( 'customify_customizer_typography_config' ) ) {
	/**
	 * Add typograhy settings.
	 *
	 * @since 0.0.1
	 * @since 0.2.6
	 *
	 * @param array $configs
	 * @return array
	 */
	function customify_customizer_typography_config( $configs ) {

		$section = 'global_typography';

		$config = array(
			array(
				'name'     => 'typography_panel',
				'type'     => 'panel',
				'priority' => 22,
				'title'    => __( 'Typography', 'customify' ),
			),

			// Base.
			array(
				'name'  => "{$section}_base",
				'type'  => 'section',
				'panel' => 'typography_panel',
				'title' => __( 'Base', 'customify' ),
			),

			array(
				'name'        => "{$section}_base_p",
				'type'        => 'typography',
				'section'     => "{$section}_base",
				'title'       => __( 'Body & Paragraph', 'customify' ),
				'description' => __( 'Apply to body and paragraph text.', 'customify' ),
				'css_format'  => 'typography',
				'selector'    => 'body',
			),

			array(
				'name'        => "{$section}_base_heading",
				'type'        => 'typography',
				'section'     => "{$section}_base",
				'title'       => __( 'Heading', 'customify' ),
				'description' => __( 'Apply to all heading elements.', 'customify' ),
				'css_format'  => 'typography',
				'selector'    => 'h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6',
				'fields'      => array(
					'font_size'      => false,
					'line_height'    => false,
					'letter_spacing' => false,
				),
			),
			array(
				'name'        => "{$section}_base_widget_title",
				'type'        => 'typography',
				'section'     => "{$section}_base",
				'title'       => __( 'Widget Title', 'customify' ),
				'description' => __( 'Apply to all widget title in site content.', 'customify' ),
				'css_format'  => 'typography',
				'selector'    => '.site-content .widget-title',
			),

			// Site Title and Tagline.
			array(
				'name'  => "{$section}_site_tt",
				'type'  => 'section',
				'panel' => 'typography_panel',
				'title' => __( 'Site Title & Tagline', 'customify' ),
			),

			array(
				'name'       => "{$section}_site_tt_title",
				'type'       => 'typography',
				'section'    => "{$section}_site_tt",
				'title'      => __( 'Site Title', 'customify' ),
				'css_format' => 'typography',
				'selector'   => '.site-branding .site-title, .site-branding .site-title a',
			),

			array(
				'name'       => "{$section}_site_tt_desc",
				'type'       => 'typography',
				'section'    => "{$section}_site_tt",
				'title'      => __( 'Tagline', 'customify' ),
				'css_format' => 'typography',
				'selector'   => '.site-branding .site-description',
			),

			// Content.
			array(
				'name'  => "{$section}_content",
				'type'  => 'section',
				'panel' => 'typography_panel',
				'title' => __( 'Content', 'customify' ),
			),

			array(
				'name'       => "{$section}_heading_h1",
				'type'       => 'typography',
				'section'    => "{$section}_content",
				'title'      => __( 'Heading H1', 'customify' ),
				'css_format' => 'typography',
				'selector'   => '.entry-content h1, .wp-block h1, .entry-single .entry-title',
			),

			array(
				'name'       => "{$section}_heading_h2",
				'type'       => 'typography',
				'section'    => "{$section}_content",
				'title'      => __( 'Heading H2', 'customify' ),
				'css_format' => 'typography',
				'selector'   => '.entry-content h2, .wp-block h2',
			),

			array(
				'name'       => "{$section}_heading_h3",
				'type'       => 'typography',
				'section'    => "{$section}_content",
				'title'      => __( 'Heading H3', 'customify' ),
				'css_format' => 'typography',
				'selector'   => '.entry-content h3, .wp-block h3',
			),

			array(
				'name'       => "{$section}_heading_h4",
				'type'       => 'typography',
				'section'    => "{$section}_content",
				'title'      => __( 'Heading H4', 'customify' ),
				'css_format' => 'typography',
				'selector'   => '.entry-content h4, .wp-block h4',
			),

			array(
				'name'       => "{$section}_heading_h5",
				'type'       => 'typography',
				'section'    => "{$section}_content",
				'title'      => __( 'Heading H5', 'customify' ),
				'css_format' => 'typography',
				'selector'   => '.entry-content h5, .wp-block h5',
			),

			array(
				'name'       => "{$section}_heading_h6",
				'type'       => 'typography',
				'section'    => "{$section}_content",
				'title'      => __( 'Heading H6', 'customify' ),
				'css_format' => 'typography',
				'selector'   => '.entry-content h6, .wp-block h6',
			),

		);

		return array_merge( $configs, $config );
	}
}

add_filter( 'customify/customizer/config', 'customify_customizer_typography_config' );
configs/upsell.php000066600000004361151151110650010215 0ustar00<?php
if ( is_admin() || is_customize_preview() ) {

	add_filter( 'customify/customizer/config', 'customify_pro_upsell', 9999 );

	function customify_pro_upsell( $configs ) {

		if ( class_exists( 'Customify_Pro' ) ) {
			return $configs;
		}

		$configs[] = array(
			'name'          => 'customify-pro',
			'type'          => 'section',
			'section_class' => 'Customify_WP_Customize_Section_Pro',
			'priority'      => 0,
			'pro_text'      => __( 'Customify Pro modules available', 'customify' ),
			'pro_url'       => 'https://pressmaximum.com/customify/pro-upgrade/?utm_source=theme_dashboard&utm_medium=links&utm_campaign=customizer_top',
		);

		$configs[] = array(
			'name'          => 'header_settings_pro',
			'panel'         => 'header_settings',
			'type'          => 'section',
			'section_class' => 'Customify_WP_Customize_Section_Pro',
			'priority'      => 99999,
			'title'         => __( 'Header options in Customify Pro', 'customify' ),
			'teaser'        => true,
			'pro_url'       => 'https://pressmaximum.com/customify/pro-upgrade/?utm_source=theme_dashboard&utm_medium=links&utm_campaign=customizer_header_side',
			'features'      => array(
				__( 'Header Sticky', 'customify' ),
				__( 'Header Transparent', 'customify' ),
				__( 'More HTML Items', 'customify' ),
				__( 'Secondary Menu', 'customify' ),
				__( 'Icon Box', 'customify' ),
				__( 'Contact Info', 'customify' ),
				__( 'And more header settings', 'customify' ),
			),
		);

		$configs[] = array(
			'name'          => 'footer_settings_pro',
			'panel'         => 'footer_settings',
			'type'          => 'section',
			'priority'      => 99999,
			'section_class' => 'Customify_WP_Customize_Section_Pro',
			'title'         => __( 'More Footer options in Customify Pro', 'customify' ),
			'pro_url'       => 'https://pressmaximum.com/customify/pro-upgrade/?utm_source=theme_dashboard&utm_medium=links&utm_campaign=customizer_footer_side',
			'teaser'        => true,
			'features'      => array(
				__( 'Footer Top Row', 'customify' ),
				__( 'Horizontal Menu Item', 'customify' ),
				__( 'More HTML Items', 'customify' ),
				__( 'Icon Box Item', 'customify' ),
				__( 'Contact Info Item', 'customify' ),
				__( 'Payment Methods Item', 'customify' ),
			),
		);

		return $configs;
	}
}
configs/styling.php000066600000020213151151110650010374 0ustar00<?php
if ( ! function_exists( 'customify_customizer_styling_config' ) ) {
	function customify_customizer_styling_config( $configs ) {

		$section = 'global_styling';

		$config = array(

			// Styling panel.
			array(
				'name'     => 'styling_panel',
				'type'     => 'panel',
				'priority' => 22,
				'title'    => __( 'Styling', 'customify' ),
			),

			// Styling Global Section.
			array(
				'name'     => "{$section}",
				'type'     => 'section',
				'panel'    => 'styling_panel',
				'title'    => __( 'Global Colors', 'customify' ),
				'priority' => 10,
			),

			array(
				'name'    => "{$section}_color_theme_heading",
				'type'    => 'heading',
				'section' => $section,
				'title'   => __( 'Theme Colors', 'customify' ),
			),

			array(
				'name'        => "{$section}_color_primary",
				'type'        => 'color',
				'section'     => $section,
				'placeholder' => '#235787',
				'title'       => __( 'Primary Color', 'customify' ),
				'css_format'  => apply_filters(
					'customify/styling/primary-color',
					'
					.header-top .header--row-inner,
					.button,
					button,
					button.button,
					input[type="button"],
					input[type="reset"],
					input[type="submit"],
					.button:not(.components-button):not(.customize-partial-edit-shortcut-button), 
					input[type="button"]:not(.components-button):not(.customize-partial-edit-shortcut-button),
					input[type="reset"]:not(.components-button):not(.customize-partial-edit-shortcut-button), 
					input[type="submit"]:not(.components-button):not(.customize-partial-edit-shortcut-button),
					.pagination .nav-links > *:hover,
					.pagination .nav-links span,
					.nav-menu-desktop.style-full-height .primary-menu-ul > li.current-menu-item > a, 
					.nav-menu-desktop.style-full-height .primary-menu-ul > li.current-menu-ancestor > a,
					.nav-menu-desktop.style-full-height .primary-menu-ul > li > a:hover,
					.posts-layout .readmore-button:hover
					{
					    background-color: {{value}};
					}
					.posts-layout .readmore-button {
						color: {{value}};
					}
					.pagination .nav-links > *:hover,
					.pagination .nav-links span,
					.entry-single .tags-links a:hover, 
					.entry-single .cat-links a:hover,
					.posts-layout .readmore-button,
					.posts-layout .readmore-button:hover
					{
					    border-color: {{value}};
					}'
				),
				'selector'    => 'format',
			),

			array(
				'name'        => "{$section}_color_secondary",
				'type'        => 'color',
				'section'     => $section,
				'placeholder' => '#c3512f',
				'title'       => __( 'Secondary Color', 'customify' ),
				'css_format'  => apply_filters(
					'customify/styling/secondary-color',
					'
				
					.customify-builder-btn
					{
					    background-color: {{value}};
					}'
				),
				'selector'    => 'format',
			),

			array(
				'name'        => "{$section}_color_text",
				'type'        => 'color',
				'section'     => $section,
				'title'       => __( 'Text Color', 'customify' ),
				'placeholder' => '#686868',
				'css_format'  => apply_filters(
					'customify/styling/text-color',
					'
					body
					{
					    color: {{value}};
					}
					abbr, acronym {
					    border-bottom-color: {{value}};
					}'
				),
				'selector'    => 'format',
			),

			array(
				'name'        => "{$section}_color_link",
				'type'        => 'color',
				'section'     => $section,
				'title'       => __( 'Link Color', 'customify' ),
				'placeholder' => '#1e4b75',
				'css_format'  => apply_filters(
					'customify/styling/link-color',
					'
	                a   
	                {
	                    color: {{value}};
					}'
				),
				'selector'    => 'format',
			),

			array(
				'name'        => "{$section}_color_link_hover",
				'type'        => 'color',
				'section'     => $section,
				'title'       => __( 'Link Hover Color', 'customify' ),
				'placeholder' => '#111111',
				'css_format'  => apply_filters(
					'customify/styling/link-color-hover',
					'
a:hover, 
a:focus,
.link-meta:hover, .link-meta a:hover
{
    color: {{value}};
}'
				),
				'selector'    => 'format',
			),

			array(
				'name'        => "{$section}_color_border",
				'type'        => 'color',
				'section'     => $section,
				'title'       => __( 'Border Color', 'customify' ),
				'placeholder' => '#eaecee',
				'css_format'  => apply_filters(
					'customify/styling/color-border',
					'
h2 + h3, 
.comments-area h2 + .comments-title, 
.h2 + h3, 
.comments-area .h2 + .comments-title, 
.page-breadcrumb {
    border-top-color: {{value}};
}
blockquote,
.site-content .widget-area .menu li.current-menu-item > a:before
{
    border-left-color: {{value}};
}

@media screen and (min-width: 64em) {
    .comment-list .children li.comment {
        border-left-color: {{value}};
    }
    .comment-list .children li.comment:after {
        background-color: {{value}};
    }
}

.page-titlebar, .page-breadcrumb,
.posts-layout .entry-inner {
    border-bottom-color: {{value}};
}

.header-search-form .search-field,
.entry-content .page-links a,
.header-search-modal,
.pagination .nav-links > *,
.entry-footer .tags-links a, .entry-footer .cat-links a,
.search .content-area article,
.site-content .widget-area .menu li.current-menu-item > a,
.posts-layout .entry-inner,
.post-navigation .nav-links,
article.comment .comment-meta,
.widget-area .widget_pages li a, .widget-area .widget_categories li a, .widget-area .widget_archive li a, .widget-area .widget_meta li a, .widget-area .widget_nav_menu li a, .widget-area .widget_product_categories li a, .widget-area .widget_recent_entries li a, .widget-area .widget_rss li a,
.widget-area .widget_recent_comments li
{
    border-color: {{value}};
}

.header-search-modal::before {
    border-top-color: {{value}};
    border-left-color: {{value}};
}

@media screen and (min-width: 48em) {
    .content-sidebar.sidebar_vertical_border .content-area {
        border-right-color: {{value}};
    }
    .sidebar-content.sidebar_vertical_border .content-area {
        border-left-color: {{value}};
    }
    .sidebar-sidebar-content.sidebar_vertical_border .sidebar-primary {
        border-right-color: {{value}};
    }
    .sidebar-sidebar-content.sidebar_vertical_border .sidebar-secondary {
        border-right-color: {{value}};
    }
    .content-sidebar-sidebar.sidebar_vertical_border .sidebar-primary {
        border-left-color: {{value}};
    }
    .content-sidebar-sidebar.sidebar_vertical_border .sidebar-secondary {
        border-left-color: {{value}};
    }
    .sidebar-content-sidebar.sidebar_vertical_border .content-area {
        border-left-color: {{value}};
        border-right-color: {{value}};
    }
    .sidebar-content-sidebar.sidebar_vertical_border .content-area {
        border-left-color: {{value}};
        border-right-color: {{value}};
    }
}
'
				),
				'selector'    => 'format',
			),

			array(
				'name'        => "{$section}_color_meta",
				'type'        => 'color',
				'section'     => $section,
				'title'       => __( 'Meta Color', 'customify' ),
				'placeholder' => '#6d6d6d',
				'css_format'  => apply_filters(
					'customify/styling/color-meta',
					'
					article.comment .comment-post-author {
						background: {{value}};				
					}
					.pagination .nav-links > *,
					.link-meta, 
					.link-meta a,
					.color-meta,
					.entry-single .tags-links:before, 
					.entry-single .cats-links:before
					{
					    color: {{value}};
					}'
				),
				'selector'    => 'format',
			),

			array(
				'name'        => "{$section}_color_heading",
				'type'        => 'color',
				'section'     => $section,
				'title'       => __( 'Heading Color', 'customify' ),
				'placeholder' => '#2b2b2b',
				'css_format'  => apply_filters( 'customify/styling/color-heading', 'h1, h2, h3, h4, h5, h6 { color: {{value}};}' ),
				'selector'    => 'format',
			),

			array(
				'name'        => "{$section}_color_w_title",
				'type'        => 'color',
				'section'     => $section,
				'title'       => __( 'Widget Title Color', 'customify' ),
				'placeholder' => '#444444',
				'css_format'  => '.site-content .widget-title { color: {{value}};}',
				'selector'    => 'format',
			),

		);

		return array_merge( $configs, $config );
	}
}

add_filter( 'customify/customizer/config', 'customify_customizer_styling_config' );
configs/background.php000066600000004333151151110650011027 0ustar00<?php

class Customify_Advanced_Styling_Background {

	function __construct() {
		add_filter( 'customify/customizer/config', array( $this, 'config' ), 100 );
	}

	function config( $configs = array() ) {

		$config = array(

			array(
				'name'     => 'background',
				'type'     => 'section',
				'priority' => 15,
				'panel'    => 'styling_panel',
				'title'    => __( 'Background', 'customify' ),
			),

			array(
				'name'       => 'background',
				'type'       => 'styling',
				'section'    => 'background',
				'title'      => __( 'Site Background', 'customify' ),
				'selector'   => array(
					'normal' => 'body',
				),
				'css_format' => 'styling', // styling.
				'fields'     => array(
					'normal_fields' => array(
						'text_color'     => false,
						'link_color'     => false,
						'padding'        => false,
						'margin'         => false,
						'border_heading' => false,
						'border_width'   => false,
						'border_color'   => false,
						'border_radius'  => false,
						'box_shadow'     => false,
						'border_style'   => false,
					),
					'hover_fields'  => false,
				),
			),

			array(
				'name'     => 'site_content_styling',
				'type'     => 'section',
				'panel'    => 'styling_panel',
				'priority' => 20,
				'title'    => __( 'Site Content', 'customify' ),
			),

			array(
				'name'       => 'site_content_styling',
				'type'       => 'styling',
				'section'    => 'background',
				'title'      => __( 'Content Area Background', 'customify' ),
				'selector'   => array(
					'normal' => '.site-content .content-area',
				),
				'default'   => array(
					'normal' => array(
						'bg_color' => '#FFFFFF',
					),
				),
				'css_format' => 'styling', // styling.
				'fields'     => array(
					'normal_fields' => array(
						'text_color'     => false,
						'link_color'     => false,
						'padding'        => false,
						'margin'         => false,
						'border_heading' => false,
						'border_width'   => false,
						'border_color'   => false,
						'border_radius'  => false,
						'box_shadow'     => false,
						'border_style'   => false,
					),
					'hover_fields'  => false,
				),
			),

		);

		return array_merge( $configs, $config );

	}

}

new Customify_Advanced_Styling_Background();
class-customizer.php000066600000076306151151110650010600 0ustar00<?php
/**
 * Customify Theme Customizer
 *
 * @package customify
 */
class  Customify_Customizer {
	static $config;
	static $_instance;
	static $has_icon = false;
	static $has_font = false;
	public $devices = array( 'desktop', 'tablet', 'mobile' );
	private $selective_settings = array();

	function __construct() {

	}

	/**
	 * Main initial
	 */
	function init() {

		require_once get_template_directory() . '/inc/customizer/class-customizer-sanitize.php';
		require_once get_template_directory() . '/inc/customizer/class-customizer-auto-css.php';

		if ( is_admin() || is_customize_preview() ) {
			add_action( 'customize_register', array( $this, 'register' ), 666 );
			add_action( 'customize_preview_init', array( $this, 'preview_js' ) );
			add_action( 'wp_ajax_customify/customizer/ajax/get_icons', array( $this, 'get_icons' ) );

			require_once get_template_directory() . '/inc/customizer/class-customizer-fonts.php';
			require_once get_template_directory() . '/inc/customizer/class-customizer.php';
		}

		add_action( 'wp_ajax_customify__reset_section', array( 'Customify_Customizer', 'reset_customize_section' ) );
	}

	/**
	 * Instance.
	 *
	 * @return Customify_Customizer
	 */
	static function get_instance() {
		if ( is_null( self::$_instance ) ) {
			self::$_instance = new self();
		}

		return self::$_instance;
	}

	/**
	 * Reset Customize section
	 */
	static function reset_customize_section() {
		if ( ! current_user_can( 'customize' ) ) {
			wp_send_json_error();
		}

		$settings = isset( $_POST['settings'] ) ? wp_unslash( $_POST['settings'] ) : array(); // phpcs:ignore

		foreach ( $settings as $k ) {
			$k = sanitize_text_field( $k );
			remove_theme_mod( $k );
		}

		wp_send_json_success();
	}

	/**
	 * Reset Customize section
	 */
	function get_icons() {
		if ( ! current_user_can( 'customize' ) ) {
			wp_send_json_error();
		}

		require_once get_template_directory() . '/inc/customizer/class-customizer-icons.php';
		wp_send_json_success( Customify_Font_Icons::get_instance()->get_icons() );
		die();
	}

	/**
	 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
	 */
	function preview_js() {
		if ( is_customize_preview() ) {
			$suffix = Customify()->get_asset_suffix();

			wp_enqueue_script( 'customify-customizer-auto-css', esc_url( get_template_directory_uri() ) . '/assets/js/customizer/auto-css' . $suffix . '.js', array( 'customize-preview' ), '20151215', true );
			wp_enqueue_script(
				'customify-customizer',
				esc_url( get_template_directory_uri() ) . '/assets/js/customizer/customizer' . $suffix . '.js',
				array(
					'customize-preview',
					'customize-selective-refresh',
				),
				'20151215',
				true
			);
			wp_localize_script(
				'customify-customizer-auto-css',
				'Customify_Preview_Config',
				array(
					'fields'         => $this->get_config(),
					'devices'        => $this->devices,
					'typo_fields'    => $this->get_typo_fields(),
					'styling_config' => $this->get_styling_config(),
				)
			);
		}
	}

	/**
	 * Get all customizer settings/control that added via `customify/customizer/config` hook
	 *
	 *  Ensure you call this method after all config files loaded
	 *
	 * @param WP_Customize_Manager $wp_customize
	 *
	 * @return array
	 */
	static function get_config( $wp_customize = null ) {
		if ( is_null( self::$config ) ) {

			$_config = apply_filters( 'customify/customizer/config', array(), $wp_customize );
			$config  = array();
			foreach ( $_config as $f ) {

				$f = wp_parse_args(
					$f,
					array(

						'priority'    => null,
						'title'       => null,
						'label'       => null,
						'name'        => null,
						'type'        => null,
						'description' => null,
						'capability'  => null,
						'mod'         => null, // Can be theme_mod or option, default theme_mod.
						'settings'    => null,

						'active_callback'      => null, // For control.

						/**
						 * For settings
						 */
						'sanitize_callback'    => array( 'Customify_Sanitize_Input', 'sanitize_customizer_input' ),
						'sanitize_js_callback' => null,
						'theme_supports'       => null,
						'default'              => null,

						/**
						 * For selective refresh
						 */
						'selector'             => null,
						'render'               => null, // same render_callback.
						'render_callback'      => null,
						'css_format'           => null,

						'device'          => null,
						'device_settings' => null,

						'field_class' => null, // Custom class for control.
					)
				);

				if ( ! isset( $f['type'] ) ) {
					$f['type'] = null;
				}

				switch ( $f['type'] ) {
					case 'panel':
						$config[ 'panel|' . $f['name'] ] = $f;
						break;
					case 'section':
						$config[ 'section|' . $f['name'] ] = $f;
						break;
					default:
						if ( 'icon' == $f['type'] ) {
							self::$has_icon = true;
						}

						if ( 'font' == $f['type'] ) {
							self::$has_font = true;
						}

						if ( isset( $f['fields'] ) ) {
							if ( ! in_array( $f['type'], array( 'typography', 'styling', 'modal' ) ) ) { //phpcs:ignore
								$types = wp_list_pluck( $f['fields'], 'type' );
								if ( in_array( 'icon', $types ) ) { //phpcs:ignore
									self::$has_icon = true;
								}

								if ( in_array( 'font', $types ) ) { //phpcs:ignore
									self::$has_font = true;
								}
							}
						}

						$config[ 'setting|' . $f['name'] ] = $f;

				}
			}

			self::$config = $config;
		}

		return self::$config;
	}

	/**
	 * Check if has icon field;
	 *
	 * @return bool
	 */
	function has_icon() {
		return self::$has_icon;
	}

	/**
	 * Check if has font field;
	 *
	 * @return bool
	 */
	function has_font() {
		return self::$has_icon;
	}

	/**
	 *  Get Customizer setting.
	 *
	 * @param string      $name   Customize setting id.
	 * @param string      $device Device type for settings.
	 * @param string|bool $key    Value of this array key that you want to get.
	 *
	 * @return array|bool|string
	 */
	function get_setting( $name, $device = 'desktop', $key = false ) {
		$config    = self::get_config();
		$get_value = null;
		if ( isset( $config[ 'setting|' . $name ] ) ) {
			$default = isset( $config[ 'setting|' . $name ]['default'] ) ? $config[ 'setting|' . $name ]['default'] : false;
			$default = apply_filters( 'customify/customize/settings-default', $default, $name );

			if ( 'option' == $config[ 'setting|' . $name ]['mod'] ) {
				$value = get_option( $name, $default );
			} else {
				$value = get_theme_mod( $name, $default );
			}

			// Maybe need merge defined items with saved item for defined list.
			if (
				'repeater' == $config[ 'setting|' . $name ]['type']
				&& isset( $config[ 'setting|' . $name ]['addable'] )
				&& false == $config[ 'setting|' . $name ]['addable']
			) {
				$value = self::merge_items( $value, $default );
			}

			if ( ! $config[ 'setting|' . $name ]['device_settings'] ) {
				return $value;
			}
		} else {
			$value = get_theme_mod( $name, null );
		}

		if ( ! $key ) {
			if ( 'all' != $device ) {
				if ( is_array( $value ) && isset( $value[ $device ] ) ) {
					$get_value = $value[ $device ];
				} else {
					$get_value = $value;
				}
			} else {
				$get_value = $value;
			}
		} else {
			$value_by_key = isset( $value[ $key ] ) ? $value[ $key ] : false;
			if ( 'all' != $device && is_array( $value_by_key ) ) {
				if ( is_array( $value_by_key ) && isset( $value_by_key[ $device ] ) ) {
					$get_value = $value_by_key[ $device ];
				} else {
					$get_value = $value_by_key;
				}
			} else {
				$get_value = $value_by_key;
			}
		}

		return $get_value;
	}


	/**
	 * Merge 2 array width `_key` is key of each item
	 *
	 * @since 0.2.5
	 *
	 * @param array $destination
	 * @param array $new_array
	 *
	 * @return array
	 */
	public static function merge_items( $destination = array(), $new_array = array() ) {

		$keys     = array();
		$new_keys = array();

		foreach ( $destination as $item ) {
			if ( isset( $item['_key'] ) ) {
				$keys[ $item['_key'] ] = $item['_key'];
			}
		}

		if ( empty( $keys ) ) {
			return $destination;
		}

		// Add item if it not in saved list.
		foreach ( $new_array as $item ) {
			if ( isset( $item['_key'] ) ) {
				$new_keys[ $item['_key'] ] = $item['_key'];
				if ( ! isset( $keys[ $item['_key'] ] ) ) {
					$destination[] = $item;
				}
			}
		}

		// Remove the item not in the defined list.
		$new_destination = array();
		foreach ( $destination as $_dk => $item ) {
			if ( isset( $item['_key'] ) ) {
				if ( isset( $new_keys[ $item['_key'] ] ) ) {
					$new_destination[] = $item;
				}
			} else {
				$new_destination[] = $item;
			}
		}

		return $new_destination;
	}

	/**
	 * Get customizer setting data when the field type is `modal`
	 *
	 * @param string      $name Setting name.
	 * @param string|bool $tab  String tab name.
	 *
	 * @return array|bool
	 */
	function get_setting_tab( $name, $tab = null ) {
		$values = $this->get_setting( $name, 'all' );
		if ( ! $tab ) {
			return $values;
		}
		if ( is_array( $values ) && isset( $values[ $tab ] ) ) {
			return $values[ $tab ];
		}

		return false;
	}

	/**
	 * Get typography fields
	 *
	 * @return array
	 */
	function get_typo_fields() {
		$typo_fields = array(
			array(
				'name'    => 'font',
				'type'    => 'select',
				'label'   => __( 'Font Family', 'customify' ),
				'choices' => array(),
			),
			array(
				'name'    => 'font_weight',
				'type'    => 'select',
				'label'   => __( 'Font Weight', 'customify' ),
				'choices' => array(),
			),
			array(
				'name'  => 'languages',
				'type'  => 'checkboxes',
				'label' => __( 'Font Languages', 'customify' ),
			),
			array(
				'name'            => 'font_size',
				'type'            => 'slider',
				'label'           => __( 'Font Size', 'customify' ),
				'device_settings' => true,
				'min'             => 9,
				'max'             => 80,
				'step'            => 1,
			),
			array(
				'name'            => 'line_height',
				'type'            => 'slider',
				'label'           => __( 'Line Height', 'customify' ),
				'device_settings' => true,
				'min'             => 9,
				'max'             => 80,
				'step'            => 1,
			),
			array(
				'name'  => 'letter_spacing',
				'type'  => 'slider',
				'label' => __( 'Letter Spacing', 'customify' ),
				'min'   => - 10,
				'max'   => 10,
				'step'  => 0.1,
			),
			array(
				'name'    => 'style',
				'type'    => 'select',
				'label'   => __( 'Font Style', 'customify' ),
				'choices' => array(
					''        => __( 'Default', 'customify' ),
					'normal'  => __( 'Normal', 'customify' ),
					'italic'  => __( 'Italic', 'customify' ),
					'oblique' => __( 'Oblique', 'customify' ),
				),
			),
			array(
				'name'    => 'text_decoration',
				'type'    => 'select',
				'label'   => __( 'Text Decoration', 'customify' ),
				'choices' => array(
					''             => __( 'Default', 'customify' ),
					'underline'    => __( 'Underline', 'customify' ),
					'overline'     => __( 'Overline', 'customify' ),
					'line-through' => __( 'Line through', 'customify' ),
					'none'         => __( 'None', 'customify' ),
				),
			),
			array(
				'name'    => 'text_transform',
				'type'    => 'select',
				'label'   => __( 'Text Transform', 'customify' ),
				'choices' => array(
					''           => __( 'Default', 'customify' ),
					'uppercase'  => __( 'Uppercase', 'customify' ),
					'lowercase'  => __( 'Lowercase', 'customify' ),
					'capitalize' => __( 'Capitalize', 'customify' ),
					'none'       => __( 'None', 'customify' ),
				),
			),
		);

		return $typo_fields;
	}

	/**
	 * Get styling field
	 *
	 * @return array
	 */
	function get_styling_config() {
		$fields = array(
			'tabs'          => array(
				'normal' => __( 'Normal', 'customify' ),  // null or false to disable.
				'hover'  => __( 'Hover', 'customify' ), // null or false to disable.
			),
			'normal_fields' => array(
				array(
					'name'       => 'text_color',
					'type'       => 'color',
					'label'      => __( 'Color', 'customify' ),
					'css_format' => 'color: {{value}}; text-decoration-color: {{value}};',
				),
				array(
					'name'       => 'link_color',
					'type'       => 'color',
					'label'      => __( 'Link Color', 'customify' ),
					'css_format' => 'color: {{value}}; text-decoration-color: {{value}};',
				),

				array(
					'name'            => 'margin',
					'type'            => 'css_ruler',
					'device_settings' => true,
					'css_format'      => array(
						'top'    => 'margin-top: {{value}};',
						'right'  => 'margin-right: {{value}};',
						'bottom' => 'margin-bottom: {{value}};',
						'left'   => 'margin-left: {{value}};',
					),
					'label'           => __( 'Margin', 'customify' ),
				),

				array(
					'name'            => 'padding',
					'type'            => 'css_ruler',
					'device_settings' => true,
					'css_format'      => array(
						'top'    => 'padding-top: {{value}};',
						'right'  => 'padding-right: {{value}};',
						'bottom' => 'padding-bottom: {{value}};',
						'left'   => 'padding-left: {{value}};',
					),
					'label'           => __( 'Padding', 'customify' ),
				),

				array(
					'name'  => 'bg_heading',
					'type'  => 'heading',
					'label' => __( 'Background', 'customify' ),
				),

				array(
					'name'       => 'bg_color',
					'type'       => 'color',
					'label'      => __( 'Background Color', 'customify' ),
					'css_format' => 'background-color: {{value}};',
				),
				array(
					'name'       => 'bg_image',
					'type'       => 'image',
					'label'      => __( 'Background Image', 'customify' ),
					'css_format' => 'background-image: url("{{value}}");',
				),
				array(
					'name'       => 'bg_cover',
					'type'       => 'select',
					'choices'    => array(
						''        => __( 'Default', 'customify' ),
						'auto'    => __( 'Auto', 'customify' ),
						'cover'   => __( 'Cover', 'customify' ),
						'contain' => __( 'Contain', 'customify' ),
					),
					'required'   => array( 'bg_image', 'not_empty', '' ),
					'label'      => __( 'Size', 'customify' ),
					'class'      => 'field-half-left',
					'css_format' => '-webkit-background-size: {{value}}; -moz-background-size: {{value}}; -o-background-size: {{value}}; background-size: {{value}};',
				),
				array(
					'name'       => 'bg_position',
					'type'       => 'select',
					'label'      => __( 'Position', 'customify' ),
					'required'   => array( 'bg_image', 'not_empty', '' ),
					'class'      => 'field-half-right',
					'choices'    => array(
						''              => __( 'Default', 'customify' ),
						'center'        => __( 'Center', 'customify' ),
						'top left'      => __( 'Top Left', 'customify' ),
						'top right'     => __( 'Top Right', 'customify' ),
						'top center'    => __( 'Top Center', 'customify' ),
						'bottom left'   => __( 'Bottom Left', 'customify' ),
						'bottom center' => __( 'Bottom Center', 'customify' ),
						'bottom right'  => __( 'Bottom Right', 'customify' ),
					),
					'css_format' => 'background-position: {{value}};',
				),
				array(
					'name'       => 'bg_repeat',
					'type'       => 'select',
					'label'      => __( 'Repeat', 'customify' ),
					'class'      => 'field-half-left',
					'required'   => array(
						array( 'bg_image', 'not_empty', '' ),
					),
					'choices'    => array(
						'repeat'    => __( 'Default', 'customify' ),
						'no-repeat' => __( 'No repeat', 'customify' ),
						'repeat-x'  => __( 'Repeat horizontal', 'customify' ),
						'repeat-y'  => __( 'Repeat vertical', 'customify' ),
					),
					'css_format' => 'background-repeat: {{value}};',
				),

				array(
					'name'       => 'bg_attachment',
					'type'       => 'select',
					'label'      => __( 'Attachment', 'customify' ),
					'class'      => 'field-half-right',
					'required'   => array(
						array( 'bg_image', 'not_empty', '' ),
					),
					'choices'    => array(
						''       => __( 'Default', 'customify' ),
						'scroll' => __( 'Scroll', 'customify' ),
						'fixed'  => __( 'Fixed', 'customify' ),
					),
					'css_format' => 'background-attachment: {{value}};',
				),

				array(
					'name'  => 'border_heading',
					'type'  => 'heading',
					'label' => __( 'Border', 'customify' ),
				),

				array(
					'name'       => 'border_style',
					'type'       => 'select',
					'class'      => 'clear',
					'label'      => __( 'Border Style', 'customify' ),
					'default'    => '',
					'choices'    => array(
						''       => __( 'Default', 'customify' ),
						'none'   => __( 'None', 'customify' ),
						'solid'  => __( 'Solid', 'customify' ),
						'dotted' => __( 'Dotted', 'customify' ),
						'dashed' => __( 'Dashed', 'customify' ),
						'double' => __( 'Double', 'customify' ),
						'ridge'  => __( 'Ridge', 'customify' ),
						'inset'  => __( 'Inset', 'customify' ),
						'outset' => __( 'Outset', 'customify' ),
					),
					'css_format' => 'border-style: {{value}};',
				),

				array(
					'name'       => 'border_width',
					'type'       => 'css_ruler',
					'label'      => __( 'Border Width', 'customify' ),
					'required'   => array(
						array( 'border_style', '!=', 'none' ),
						array( 'border_style', '!=', '' ),
					),
					'css_format' => array(
						'top'    => 'border-top-width: {{value}};',
						'right'  => 'border-right-width: {{value}};',
						'bottom' => 'border-bottom-width: {{value}};',
						'left'   => 'border-left-width: {{value}};',
					),
				),
				array(
					'name'       => 'border_color',
					'type'       => 'color',
					'label'      => __( 'Border Color', 'customify' ),
					'required'   => array(
						array( 'border_style', '!=', 'none' ),
						array( 'border_style', '!=', '' ),
					),
					'css_format' => 'border-color: {{value}};',
				),

				array(
					'name'       => 'border_radius',
					'type'       => 'css_ruler',
					'label'      => __( 'Border Radius', 'customify' ),
					'css_format' => array(
						'top'    => 'border-top-left-radius: {{value}};',
						'right'  => 'border-top-right-radius: {{value}};',
						'bottom' => 'border-bottom-right-radius: {{value}};',
						'left'   => 'border-bottom-left-radius: {{value}};',
					),
				),

				array(
					'name'       => 'box_shadow',
					'type'       => 'shadow',
					'label'      => __( 'Box Shadow', 'customify' ),
					'css_format' => 'box-shadow: {{value}};',
				),

			),

			'hover_fields' => array(
				array(
					'name'       => 'text_color',
					'type'       => 'color',
					'label'      => __( 'Color', 'customify' ),
					'css_format' => 'color: {{value}}; text-decoration-color: {{value}};',
				),
				array(
					'name'       => 'link_color',
					'type'       => 'color',
					'label'      => __( 'Link Color', 'customify' ),
					'css_format' => 'color: {{value}}; text-decoration-color: {{value}};',
				),
				array(
					'name'  => 'bg_heading',
					'type'  => 'heading',
					'label' => __( 'Background', 'customify' ),
				),
				array(
					'name'       => 'bg_color',
					'type'       => 'color',
					'label'      => __( 'Background Color', 'customify' ),
					'css_format' => 'background-color: {{value}};',
				),
				array(
					'name'  => 'border_heading',
					'type'  => 'heading',
					'label' => __( 'Border', 'customify' ),
				),
				array(
					'name'       => 'border_style',
					'type'       => 'select',
					'label'      => __( 'Border Style', 'customify' ),
					'default'    => '',
					'choices'    => array(
						''       => __( 'Default', 'customify' ),
						'none'   => __( 'None', 'customify' ),
						'solid'  => __( 'Solid', 'customify' ),
						'dotted' => __( 'Dotted', 'customify' ),
						'dashed' => __( 'Dashed', 'customify' ),
						'double' => __( 'Double', 'customify' ),
						'ridge'  => __( 'Ridge', 'customify' ),
						'inset'  => __( 'Inset', 'customify' ),
						'outset' => __( 'Outset', 'customify' ),
					),
					'css_format' => 'border-style: {{value}};',
				),
				array(
					'name'       => 'border_width',
					'type'       => 'css_ruler',
					'label'      => __( 'Border Width', 'customify' ),
					'required'   => array( 'border_style', '!=', 'none' ),
					'css_format' => array(
						'top'    => 'border-top-width: {{value}};',
						'right'  => 'border-right-width: {{value}};',
						'bottom' => 'border-bottom-width: {{value}};',
						'left'   => 'border-left-width: {{value}};',
					),
				),
				array(
					'name'       => 'border_color',
					'type'       => 'color',
					'label'      => __( 'Border Color', 'customify' ),
					'required'   => array( 'border_style', '!=', 'none' ),
					'css_format' => 'border-color: {{value}};',
				),
				array(
					'name'       => 'border_radius',
					'type'       => 'css_ruler',
					'label'      => __( 'Border Radius', 'customify' ),
					'css_format' => array(
						'top'    => 'border-top-left-radius: {{value}};',
						'right'  => 'border-top-right-radius: {{value}};',
						'bottom' => 'border-bottom-right-radius: {{value}};',
						'left'   => 'border-bottom-left-radius: {{value}};',
					),
				),
				array(
					'name'       => 'box_shadow',
					'type'       => 'shadow',
					'label'      => __( 'Box Shadow', 'customify' ),
					'css_format' => 'box-shadow: {{value}};',
				),

			),

		);

		return apply_filters( 'customify/get_styling_config', $fields );
	}

	/**
	 * Setup icon args
	 *
	 * @param array $icon
	 *
	 * @return array
	 */
	function setup_icon( $icon ) {
		if ( ! is_array( $icon ) ) {
			$icon = array();
		}

		return wp_parse_args(
			$icon,
			array(
				'type' => '',
				'icon' => '',
			)
		);
	}

	/**
	 * Get customize setting data
	 *
	 * @param string $key Setting name.
	 *
	 * @return bool|mixed
	 */
	function get_field_setting( $key ) {
		$config = self::get_config();
		if ( isset( $config[ 'setting|' . $key ] ) ) {
			return $config[ 'setting|' . $key ];
		}

		return false;
	}

	/**
	 * Get Media url from data
	 *
	 * @param string/array $value   media data.
	 * @param null|string  $size WordPress image size name.
	 *
	 * @return string|false Media url or empty
	 */
	function get_media( $value, $size = null ) {

		if ( empty( $value ) ) {
			return false;
		}

		if ( ! $size ) {
			$size = 'full';
		}

		if ( is_numeric( $value ) ) {
			$image_attributes = wp_get_attachment_image_src( $value, $size );
			if ( $image_attributes ) {
				return $image_attributes[0];
			} else {
				return false;
			}
		} elseif ( is_string( $value ) ) {
			$img_id = attachment_url_to_postid( $value );
			if ( $img_id ) {
				$image_attributes = wp_get_attachment_image_src( $img_id, $size );
				if ( $image_attributes ) {
					return $image_attributes[0];
				} else {
					return false;
				}
			}

			return $value;
		} elseif ( is_array( $value ) ) {
			$value = wp_parse_args(
				$value,
				array(
					'id'   => '',
					'url'  => '',
					'mime' => '',
				)
			);

			if ( empty( $value['id'] ) && empty( $value['url'] ) ) {
				return false;
			}

			$url = '';

			if ( strpos( $value['mime'], 'image/' ) !== false ) {
				$image_attributes = wp_get_attachment_image_src( $value['id'], $size );
				if ( $image_attributes ) {
					$url = $image_attributes[0];
				}
			} else {
				$url = wp_get_attachment_url( $value['id'] );
			}

			if ( ! $url ) {
				$url = $value['url'];
				if ( $url ) {
					$img_id = attachment_url_to_postid( $url );
					if ( $img_id ) {
						return wp_get_attachment_url( $img_id );
					}
				}
			}

			return $url;
		}

		return false;
	}

	/**
	 * Load support controls
	 */
	function load_controls() {
		$fields = array(
			'base',
			'select',
			'font',
			'font_style',
			'text_align',
			'text_align_no_justify',
			'checkbox',
			'css_ruler',
			'shadow',
			'icon',
			'slider',
			'color',
			'textarea',
			'radio',

			'media',
			'image',
			'video',

			'text',
			'hidden',
			'heading',
			'typography',
			'modal',
			'styling',
			'hr',

			'repeater',

			'pro',
		);

		$fields = apply_filters( 'customify/customize/register-controls', $fields );

		foreach ( $fields as $k => $f ) {

			if ( is_numeric( $k ) ) {
				$field_type = $f;
				$file       = get_template_directory() . '/inc/customizer/controls/class-control-' . str_replace( '_', '-', $field_type ) . '.php';
			} else {
				$field_type = $k;
				$file       = $f;
			}

			if ( file_exists( $file ) ) {

				$control_class_name = 'Customify_Customizer_Control_';
				$tpl_type           = str_replace( '_', ' ', $field_type );
				$tpl_type           = str_replace( ' ', '_', ucfirst( $tpl_type ) );
				$control_class_name .= $tpl_type;
				require_once $file;

				if ( $control_class_name ) {
					if ( method_exists( $control_class_name, 'field_template' ) ) {
						add_action(
							'customize_controls_print_footer_scripts',
							array(
								$control_class_name,
								'field_template',
							)
						);
					}
				}
			}
		}

	}


	/**
	 * Register Customize Settings
	 *
	 * @param WP_Customize_Manager $wp_customize Customize manager.
	 */
	function register( $wp_customize ) {

		// Custom panel.
		require_once get_template_directory() . '/inc/customizer/class-customify-panel.php';
		// Load custom section.
		require_once get_template_directory() . '/inc/customizer/class-customify-section.php';

		// Load custom section pro.
		require_once get_template_directory() . '/inc/customizer/class-customify-section-pro.php';

		// Register new panel and section type.
		$wp_customize->register_panel_type( 'Customify_WP_Customize_Panel' );
		$wp_customize->register_section_type( 'Customify_WP_Customize_Section' );

		// Register section type.
		$wp_customize->register_section_type( 'Customify_WP_Customize_Section_Pro' );

		$this->load_controls();

		foreach ( self::get_config( $wp_customize ) as $args ) {
			switch ( $args['type'] ) {
				case 'panel':
					$name = $args['name'];
					unset( $args['name'] );
					if ( ! $args['title'] ) {
						$args['title'] = $args['label'];
					}
					if ( ! $name ) {
						$name = $args['title'];
					}
					unset( $args['name'] );
					unset( $args['type'] );
					$panel = new Customify_WP_Customize_Panel( $wp_customize, $name, $args );
					$wp_customize->add_panel( $panel );
					break;
				case 'section':
					$name = $args['name'];
					unset( $args['name'] );
					if ( ! $args['title'] ) {
						$args['title'] = $args['label'];
					}
					if ( ! $name ) {
						$name = $args['title'];
					}
					unset( $args['name'] );
					unset( $args['type'] );
					if ( isset( $args['section_class'] ) && class_exists( $args['section_class'] ) ) { // Allow custom class.
						$wp_customize->add_section( new $args['section_class']( $wp_customize, $name, $args ) );
					} else {
						$wp_customize->add_section( new Customify_WP_Customize_Section( $wp_customize, $name, $args ) );
					}

					break;
				default:
					switch ( $args['type'] ) {
						case 'image_select':
							$args['setting_type'] = 'radio';
							$args['field_class']  = 'custom-control-image_select' . ( $args['field_class'] ? ' ' . $args['field_class'] : '' );
							break;
						case 'radio_group':
							$args['setting_type'] = 'radio';
							$args['field_class']  = 'custom-control-radio_group' . ( $args['field_class'] ? ' ' . $args['field_class'] : '' );
							break;
						default:
							$args['setting_type'] = $args['type'];
					}

					$args['default_value']    = $args['default'];
					$settings_args            = array(
						'sanitize_callback'    => $args['sanitize_callback'],
						'sanitize_js_callback' => $args['sanitize_js_callback'],
						'theme_supports'       => $args['theme_supports'],
						'type'                 => $args['mod'],
					);
					$settings_args['default'] = apply_filters( 'customify/customize/settings-default', $args['default'], $args['name'] );

					$settings_args['transport'] = 'refresh';
					if ( ! $settings_args['sanitize_callback'] ) {
						$settings_args['sanitize_callback'] = array(
							'Customify_Sanitize_Input',
							'sanitize_customizer_input',
						);
					}

					foreach ( $settings_args as $k => $v ) {
						unset( $args[ $k ] );
					}

					unset( $args['mod'] );
					$name = $args['name'];
					unset( $args['name'] );

					unset( $args['type'] );
					if ( ! $args['label'] ) {
						$args['label'] = $args['title'];
					}

					$selective_refresh = null;
					if ( $args['selector'] && ( ( $args['render_callback'] || $args['render'] ) || $args['css_format'] ) ) {
						$selective_refresh = array(
							'selector'        => $args['selector'],
							'render_callback' => ( $args['render'] ) ? $args['render'] : $args['render_callback'],
						);

						if ( $args['css_format'] ) {
							$settings_args['transport'] = 'postMessage';
							$selective_refresh          = null;
						} else {
							$settings_args['transport'] = 'postMessage';
						}
					}
					unset( $args['default'] );

					$wp_customize->add_setting(
						$name,
						array_merge(
							array(
								'sanitize_callback' => array(
									'Customify_Sanitize_Input',
									'sanitize_customizer_input',
								),
							),
							$settings_args
						)
					);

					$control_class_name = 'Customify_Customizer_Control_';
					$tpl_type           = str_replace( '_', ' ', $args['setting_type'] );
					$tpl_type           = str_replace( ' ', '_', ucfirst( $tpl_type ) );
					$control_class_name .= $tpl_type;

					if ( 'js_raw' != $settings_args['type'] ) {
						if ( class_exists( $control_class_name ) ) {
							$wp_customize->add_control( new $control_class_name( $wp_customize, $name, $args ) );
						} else {
							$wp_customize->add_control( new Customify_Customizer_Control_Base( $wp_customize, $name, $args ) );
						}
					}

					if ( $selective_refresh ) {
						$s_id = $selective_refresh['render_callback'];
						if ( is_array( $s_id ) ) {
							if ( is_string( $s_id[0] ) ) {
								$__id = $s_id[0] . '__' . $s_id[1];
							} else {
								$__id = get_class( $s_id[0] ) . '__' . $s_id[1];
							}
						} else {
							$__id = $s_id;
						}
						if ( ! isset( $this->selective_settings[ $__id ] ) ) {
							$this->selective_settings[ $__id ] = array(
								'settings'            => array(),
								'selector'            => $selective_refresh['selector'],
								'container_inclusive' => ( strpos( $__id, 'Customify_Customizer_Auto_CSS' ) === false ) ? true : false,
								'render_callback'     => $s_id,
							);
						}

						$this->selective_settings[ $__id ]['settings'][] = $name;
					}

					break;
			}// end switch.
		} // End loop config.

		// Remove partial for default custom logo and add this by theme custom.
		$wp_customize->selective_refresh->remove_partial( 'custom_logo' );

		$wp_customize->get_section( 'title_tagline' )->panel        = 'header_settings';
		$wp_customize->get_section( 'title_tagline' )->title        = __( 'Logo & Site Identity', 'customify' );
		$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
		// Add selective refresh.
		$wp_customize->get_setting( 'custom_logo' )->transport     = 'postMessage';
		$wp_customize->get_setting( 'blogname' )->transport        = 'postMessage';
		$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';

		foreach ( $this->selective_settings as $cb => $settings ) {
			reset( $settings['settings'] );
			if ( 'Customify_Builder_Item_Logo__render' == $cb ) {
				$settings['settings'][] = 'custom_logo';
				$settings['settings'][] = 'blogname';
				$settings['settings'][] = 'blogdescription';
			}
			$settings = apply_filters( $cb, $settings );
			$wp_customize->selective_refresh->add_partial( $cb, $settings );
		}

		// For live CSS.
		$wp_customize->add_setting(
			'customify__css',
			array(
				'default'           => '',
				'transport'         => 'postMessage',
				'sanitize_callback' => array( 'Customify_Sanitize_Input', 'sanitize_css_code' ),
			)
		);

		do_action( 'customify/customize/register_completed', $this );
	}

}
class-customizer-icons.php000066600000054354151151110650011710 0ustar00<?php

class Customify_Font_Icons {
	static $_instance;
	static $_icons;
	static $enqueued;
	private $picked_types = array();

	static function get_instance() {
		if ( is_null( self::$_instance ) ) {
			self::$_instance = new self();
		}

		return self::$_instance;
	}

	/**
	 * Get support icons
	 *
	 * @return array
	 */
	function get_icons() {
		if ( is_null( self::$_icons ) ) {
			$icons        = array(
				'font-awesome' => array(
					'name'         => __( 'FontAwesome', 'customify' ),
					'icons'        => $this->get_font_awesome_icons(),
					'url'          => esc_url( get_template_directory_uri() ) . '/assets/fonts/font-awesome/css/font-awesome.min.css',
					'class_config' => 'fa __icon_name__', // __icon_name__ will replace by icon class name
				),
			);
			self::$_icons = apply_filters( 'customify/customizer/font_icons', $icons );
		}

		return self::$_icons;

	}

	function is_used() {
		if ( is_customize_preview() ) {
			return true;
		}
		$check = apply_filters( 'customify/load-icons', true );
		if ( is_null( $check ) ) {
			$builders = array( 'header_builder_panel', 'footer_builder_panel' );
			$list     = apply_filters( 'customify/icon_used', array() );

			foreach ( $builders as $setting_key ) {
				$data = Customify()->get_setting( $setting_key );
				if ( is_array( $data ) ) {
					foreach ( $data as $devices => $rows ) {
						foreach ( (array) $rows as $row_id => $items ) {
							foreach ( (array) $items as $item ) {
								if ( is_array( $item ) ) {
									if ( isset( $list[ $item['id'] ] ) && $list[ $item['id'] ] ) {
										return true;
									}
								}
							}
						}
					}
				}
			}
		}

		return $check;
	}

	function enqueue() {
		if ( $this->is_used() ) {
			if ( is_null( self::$enqueued ) ) {
				foreach ( $this->get_icons() as $icon_id => $icon ) {
					wp_dequeue_style( $icon_id );
					wp_enqueue_style( $icon_id, $icon['url'], array(), '5.0.0' );
				}
				self::$enqueued = true;
			}
		}
	}

	/**
	 * Get FontAwesome icons
	 *
	 * @return array
	 */
	function get_font_awesome_icons() {
		$icons = array(
			0   => 'fa-glass',
			1   => 'fa-music',
			2   => 'fa-search',
			3   => 'fa-envelope-o',
			4   => 'fa-heart',
			5   => 'fa-star',
			6   => 'fa-star-o',
			7   => 'fa-user',
			8   => 'fa-film',
			9   => 'fa-th-large',
			10  => 'fa-th',
			11  => 'fa-th-list',
			12  => 'fa-check',
			13  => 'fa-remove',
			14  => 'fa-close',
			15  => 'fa-times',
			16  => 'fa-search-plus',
			17  => 'fa-search-minus',
			18  => 'fa-power-off',
			19  => 'fa-signal',
			20  => 'fa-gear',
			21  => 'fa-cog',
			22  => 'fa-trash-o',
			23  => 'fa-home',
			24  => 'fa-file-o',
			25  => 'fa-clock-o',
			26  => 'fa-road',
			27  => 'fa-download',
			28  => 'fa-arrow-circle-o-down',
			29  => 'fa-arrow-circle-o-up',
			30  => 'fa-inbox',
			31  => 'fa-play-circle-o',
			32  => 'fa-rotate-right',
			33  => 'fa-repeat',
			34  => 'fa-refresh',
			35  => 'fa-list-alt',
			36  => 'fa-lock',
			37  => 'fa-flag',
			38  => 'fa-headphones',
			39  => 'fa-volume-off',
			40  => 'fa-volume-down',
			41  => 'fa-volume-up',
			42  => 'fa-qrcode',
			43  => 'fa-barcode',
			44  => 'fa-tag',
			45  => 'fa-tags',
			46  => 'fa-book',
			47  => 'fa-bookmark',
			48  => 'fa-print',
			49  => 'fa-camera',
			50  => 'fa-font',
			51  => 'fa-bold',
			52  => 'fa-italic',
			53  => 'fa-text-height',
			54  => 'fa-text-width',
			55  => 'fa-align-left',
			56  => 'fa-align-center',
			57  => 'fa-align-right',
			58  => 'fa-align-justify',
			59  => 'fa-list',
			60  => 'fa-dedent',
			61  => 'fa-outdent',
			62  => 'fa-indent',
			63  => 'fa-video-camera',
			64  => 'fa-photo',
			65  => 'fa-image',
			66  => 'fa-picture-o',
			67  => 'fa-pencil',
			68  => 'fa-map-marker',
			69  => 'fa-adjust',
			70  => 'fa-tint',
			71  => 'fa-edit',
			72  => 'fa-pencil-square-o',
			73  => 'fa-share-square-o',
			74  => 'fa-check-square-o',
			75  => 'fa-arrows',
			76  => 'fa-step-backward',
			77  => 'fa-fast-backward',
			78  => 'fa-backward',
			79  => 'fa-play',
			80  => 'fa-pause',
			81  => 'fa-stop',
			82  => 'fa-forward',
			83  => 'fa-fast-forward',
			84  => 'fa-step-forward',
			85  => 'fa-eject',
			86  => 'fa-chevron-left',
			87  => 'fa-chevron-right',
			88  => 'fa-plus-circle',
			89  => 'fa-minus-circle',
			90  => 'fa-times-circle',
			91  => 'fa-check-circle',
			92  => 'fa-question-circle',
			93  => 'fa-info-circle',
			94  => 'fa-crosshairs',
			95  => 'fa-times-circle-o',
			96  => 'fa-check-circle-o',
			97  => 'fa-ban',
			98  => 'fa-arrow-left',
			99  => 'fa-arrow-right',
			100 => 'fa-arrow-up',
			101 => 'fa-arrow-down',
			102 => 'fa-mail-forward',
			103 => 'fa-share',
			104 => 'fa-expand',
			105 => 'fa-compress',
			106 => 'fa-plus',
			107 => 'fa-minus',
			108 => 'fa-asterisk',
			109 => 'fa-exclamation-circle',
			110 => 'fa-gift',
			111 => 'fa-leaf',
			112 => 'fa-fire',
			113 => 'fa-eye',
			114 => 'fa-eye-slash',
			115 => 'fa-warning',
			116 => 'fa-exclamation-triangle',
			117 => 'fa-plane',
			118 => 'fa-calendar',
			119 => 'fa-random',
			120 => 'fa-comment',
			121 => 'fa-magnet',
			122 => 'fa-chevron-up',
			123 => 'fa-chevron-down',
			124 => 'fa-retweet',
			125 => 'fa-shopping-cart',
			126 => 'fa-folder',
			127 => 'fa-folder-open',
			128 => 'fa-arrows-v',
			129 => 'fa-arrows-h',
			130 => 'fa-bar-chart-o',
			131 => 'fa-bar-chart',
			132 => 'fa-twitter-square',
			133 => 'fa-facebook-square',
			134 => 'fa-camera-retro',
			135 => 'fa-key',
			136 => 'fa-gears',
			137 => 'fa-cogs',
			138 => 'fa-comments',
			139 => 'fa-thumbs-o-up',
			140 => 'fa-thumbs-o-down',
			141 => 'fa-star-half',
			142 => 'fa-heart-o',
			143 => 'fa-sign-out',
			144 => 'fa-linkedin-square',
			145 => 'fa-thumb-tack',
			146 => 'fa-external-link',
			147 => 'fa-sign-in',
			148 => 'fa-trophy',
			149 => 'fa-github-square',
			150 => 'fa-upload',
			151 => 'fa-lemon-o',
			152 => 'fa-phone',
			153 => 'fa-square-o',
			154 => 'fa-bookmark-o',
			155 => 'fa-phone-square',
			156 => 'fa-twitter',
			157 => 'fa-facebook-f',
			158 => 'fa-facebook',
			159 => 'fa-github',
			160 => 'fa-unlock',
			161 => 'fa-credit-card',
			162 => 'fa-feed',
			163 => 'fa-rss',
			164 => 'fa-hdd-o',
			165 => 'fa-bullhorn',
			166 => 'fa-bell',
			167 => 'fa-certificate',
			168 => 'fa-hand-o-right',
			169 => 'fa-hand-o-left',
			170 => 'fa-hand-o-up',
			171 => 'fa-hand-o-down',
			172 => 'fa-arrow-circle-left',
			173 => 'fa-arrow-circle-right',
			174 => 'fa-arrow-circle-up',
			175 => 'fa-arrow-circle-down',
			176 => 'fa-globe',
			177 => 'fa-wrench',
			178 => 'fa-tasks',
			179 => 'fa-filter',
			180 => 'fa-briefcase',
			181 => 'fa-arrows-alt',
			182 => 'fa-group',
			183 => 'fa-users',
			184 => 'fa-chain',
			185 => 'fa-link',
			186 => 'fa-cloud',
			187 => 'fa-flask',
			188 => 'fa-cut',
			189 => 'fa-scissors',
			190 => 'fa-copy',
			191 => 'fa-files-o',
			192 => 'fa-paperclip',
			193 => 'fa-save',
			194 => 'fa-floppy-o',
			195 => 'fa-square',
			196 => 'fa-navicon',
			197 => 'fa-reorder',
			198 => 'fa-bars',
			199 => 'fa-list-ul',
			200 => 'fa-list-ol',
			201 => 'fa-strikethrough',
			202 => 'fa-underline',
			203 => 'fa-table',
			204 => 'fa-magic',
			205 => 'fa-truck',
			206 => 'fa-pinterest',
			207 => 'fa-pinterest-square',
			208 => 'fa-google-plus-square',
			209 => 'fa-google-plus',
			210 => 'fa-money',
			211 => 'fa-caret-down',
			212 => 'fa-caret-up',
			213 => 'fa-caret-left',
			214 => 'fa-caret-right',
			215 => 'fa-columns',
			216 => 'fa-unsorted',
			217 => 'fa-sort',
			218 => 'fa-sort-down',
			219 => 'fa-sort-desc',
			220 => 'fa-sort-up',
			221 => 'fa-sort-asc',
			222 => 'fa-envelope',
			223 => 'fa-linkedin',
			224 => 'fa-rotate-left',
			225 => 'fa-undo',
			226 => 'fa-legal',
			227 => 'fa-gavel',
			228 => 'fa-dashboard',
			229 => 'fa-tachometer',
			230 => 'fa-comment-o',
			231 => 'fa-comments-o',
			232 => 'fa-flash',
			233 => 'fa-bolt',
			234 => 'fa-sitemap',
			235 => 'fa-umbrella',
			236 => 'fa-paste',
			237 => 'fa-clipboard',
			238 => 'fa-lightbulb-o',
			239 => 'fa-exchange',
			240 => 'fa-cloud-download',
			241 => 'fa-cloud-upload',
			242 => 'fa-user-md',
			243 => 'fa-stethoscope',
			244 => 'fa-suitcase',
			245 => 'fa-bell-o',
			246 => 'fa-coffee',
			247 => 'fa-cutlery',
			248 => 'fa-file-text-o',
			249 => 'fa-building-o',
			250 => 'fa-hospital-o',
			251 => 'fa-ambulance',
			252 => 'fa-medkit',
			253 => 'fa-fighter-jet',
			254 => 'fa-beer',
			255 => 'fa-h-square',
			256 => 'fa-plus-square',
			257 => 'fa-angle-double-left',
			258 => 'fa-angle-double-right',
			259 => 'fa-angle-double-up',
			260 => 'fa-angle-double-down',
			261 => 'fa-angle-left',
			262 => 'fa-angle-right',
			263 => 'fa-angle-up',
			264 => 'fa-angle-down',
			265 => 'fa-desktop',
			266 => 'fa-laptop',
			267 => 'fa-tablet',
			268 => 'fa-mobile-phone',
			269 => 'fa-mobile',
			270 => 'fa-circle-o',
			271 => 'fa-quote-left',
			272 => 'fa-quote-right',
			273 => 'fa-spinner',
			274 => 'fa-circle',
			275 => 'fa-mail-reply',
			276 => 'fa-reply',
			277 => 'fa-github-alt',
			278 => 'fa-folder-o',
			279 => 'fa-folder-open-o',
			280 => 'fa-smile-o',
			281 => 'fa-frown-o',
			282 => 'fa-meh-o',
			283 => 'fa-gamepad',
			284 => 'fa-keyboard-o',
			285 => 'fa-flag-o',
			286 => 'fa-flag-checkered',
			287 => 'fa-terminal',
			288 => 'fa-code',
			289 => 'fa-mail-reply-all',
			290 => 'fa-reply-all',
			291 => 'fa-star-half-empty',
			292 => 'fa-star-half-full',
			293 => 'fa-star-half-o',
			294 => 'fa-location-arrow',
			295 => 'fa-crop',
			296 => 'fa-code-fork',
			297 => 'fa-unlink',
			298 => 'fa-chain-broken',
			299 => 'fa-question',
			300 => 'fa-info',
			301 => 'fa-exclamation',
			302 => 'fa-superscript',
			303 => 'fa-subscript',
			304 => 'fa-eraser',
			305 => 'fa-puzzle-piece',
			306 => 'fa-microphone',
			307 => 'fa-microphone-slash',
			308 => 'fa-shield',
			309 => 'fa-calendar-o',
			310 => 'fa-fire-extinguisher',
			311 => 'fa-rocket',
			312 => 'fa-maxcdn',
			313 => 'fa-chevron-circle-left',
			314 => 'fa-chevron-circle-right',
			315 => 'fa-chevron-circle-up',
			316 => 'fa-chevron-circle-down',
			317 => 'fa-html5',
			318 => 'fa-css3',
			319 => 'fa-anchor',
			320 => 'fa-unlock-alt',
			321 => 'fa-bullseye',
			322 => 'fa-ellipsis-h',
			323 => 'fa-ellipsis-v',
			324 => 'fa-rss-square',
			325 => 'fa-play-circle',
			326 => 'fa-ticket',
			327 => 'fa-minus-square',
			328 => 'fa-minus-square-o',
			329 => 'fa-level-up',
			330 => 'fa-level-down',
			331 => 'fa-check-square',
			332 => 'fa-pencil-square',
			333 => 'fa-external-link-square',
			334 => 'fa-share-square',
			335 => 'fa-compass',
			336 => 'fa-toggle-down',
			337 => 'fa-caret-square-o-down',
			338 => 'fa-toggle-up',
			339 => 'fa-caret-square-o-up',
			340 => 'fa-toggle-right',
			341 => 'fa-caret-square-o-right',
			342 => 'fa-euro',
			343 => 'fa-eur',
			344 => 'fa-gbp',
			345 => 'fa-dollar',
			346 => 'fa-usd',
			347 => 'fa-rupee',
			348 => 'fa-inr',
			349 => 'fa-cny',
			350 => 'fa-rmb',
			351 => 'fa-yen',
			352 => 'fa-jpy',
			353 => 'fa-ruble',
			354 => 'fa-rouble',
			355 => 'fa-rub',
			356 => 'fa-won',
			357 => 'fa-krw',
			358 => 'fa-bitcoin',
			359 => 'fa-btc',
			360 => 'fa-file',
			361 => 'fa-file-text',
			362 => 'fa-sort-alpha-asc',
			363 => 'fa-sort-alpha-desc',
			364 => 'fa-sort-amount-asc',
			365 => 'fa-sort-amount-desc',
			366 => 'fa-sort-numeric-asc',
			367 => 'fa-sort-numeric-desc',
			368 => 'fa-thumbs-up',
			369 => 'fa-thumbs-down',
			370 => 'fa-youtube-square',
			371 => 'fa-youtube',
			372 => 'fa-xing',
			373 => 'fa-xing-square',
			374 => 'fa-youtube-play',
			375 => 'fa-dropbox',
			376 => 'fa-stack-overflow',
			377 => 'fa-instagram',
			378 => 'fa-flickr',
			379 => 'fa-adn',
			380 => 'fa-bitbucket',
			381 => 'fa-bitbucket-square',
			382 => 'fa-tumblr',
			383 => 'fa-tumblr-square',
			384 => 'fa-long-arrow-down',
			385 => 'fa-long-arrow-up',
			386 => 'fa-long-arrow-left',
			387 => 'fa-long-arrow-right',
			388 => 'fa-apple',
			389 => 'fa-windows',
			390 => 'fa-android',
			391 => 'fa-linux',
			392 => 'fa-dribbble',
			393 => 'fa-skype',
			394 => 'fa-foursquare',
			395 => 'fa-trello',
			396 => 'fa-female',
			397 => 'fa-male',
			398 => 'fa-gittip',
			399 => 'fa-gratipay',
			400 => 'fa-sun-o',
			401 => 'fa-moon-o',
			402 => 'fa-archive',
			403 => 'fa-bug',
			404 => 'fa-vk',
			405 => 'fa-weibo',
			406 => 'fa-renren',
			407 => 'fa-pagelines',
			408 => 'fa-stack-exchange',
			409 => 'fa-arrow-circle-o-right',
			410 => 'fa-arrow-circle-o-left',
			411 => 'fa-toggle-left',
			412 => 'fa-caret-square-o-left',
			413 => 'fa-dot-circle-o',
			414 => 'fa-wheelchair',
			415 => 'fa-vimeo-square',
			416 => 'fa-turkish-lira',
			417 => 'fa-try',
			418 => 'fa-plus-square-o',
			419 => 'fa-space-shuttle',
			420 => 'fa-slack',
			421 => 'fa-envelope-square',
			422 => 'fa-wordpress',
			423 => 'fa-openid',
			424 => 'fa-institution',
			425 => 'fa-bank',
			426 => 'fa-university',
			427 => 'fa-mortar-board',
			428 => 'fa-graduation-cap',
			429 => 'fa-yahoo',
			430 => 'fa-google',
			431 => 'fa-reddit',
			432 => 'fa-reddit-square',
			433 => 'fa-stumbleupon-circle',
			434 => 'fa-stumbleupon',
			435 => 'fa-delicious',
			436 => 'fa-digg',
			437 => 'fa-pied-piper-pp',
			438 => 'fa-pied-piper-alt',
			439 => 'fa-drupal',
			440 => 'fa-joomla',
			441 => 'fa-language',
			442 => 'fa-fax',
			443 => 'fa-building',
			444 => 'fa-child',
			445 => 'fa-paw',
			446 => 'fa-spoon',
			447 => 'fa-cube',
			448 => 'fa-cubes',
			449 => 'fa-behance',
			450 => 'fa-behance-square',
			451 => 'fa-steam',
			452 => 'fa-steam-square',
			453 => 'fa-recycle',
			454 => 'fa-automobile',
			455 => 'fa-car',
			456 => 'fa-cab',
			457 => 'fa-taxi',
			458 => 'fa-tree',
			459 => 'fa-spotify',
			460 => 'fa-deviantart',
			461 => 'fa-soundcloud',
			462 => 'fa-database',
			463 => 'fa-file-pdf-o',
			464 => 'fa-file-word-o',
			465 => 'fa-file-excel-o',
			466 => 'fa-file-powerpoint-o',
			467 => 'fa-file-photo-o',
			468 => 'fa-file-picture-o',
			469 => 'fa-file-image-o',
			470 => 'fa-file-zip-o',
			471 => 'fa-file-archive-o',
			472 => 'fa-file-sound-o',
			473 => 'fa-file-audio-o',
			474 => 'fa-file-movie-o',
			475 => 'fa-file-video-o',
			476 => 'fa-file-code-o',
			477 => 'fa-vine',
			478 => 'fa-codepen',
			479 => 'fa-jsfiddle',
			480 => 'fa-life-bouy',
			481 => 'fa-life-buoy',
			482 => 'fa-life-saver',
			483 => 'fa-support',
			484 => 'fa-life-ring',
			485 => 'fa-circle-o-notch',
			486 => 'fa-ra',
			487 => 'fa-resistance',
			488 => 'fa-rebel',
			489 => 'fa-ge',
			490 => 'fa-empire',
			491 => 'fa-git-square',
			492 => 'fa-git',
			493 => 'fa-y-combinator-square',
			494 => 'fa-yc-square',
			495 => 'fa-hacker-news',
			496 => 'fa-tencent-weibo',
			497 => 'fa-qq',
			498 => 'fa-wechat',
			499 => 'fa-weixin',
			500 => 'fa-send',
			501 => 'fa-paper-plane',
			502 => 'fa-send-o',
			503 => 'fa-paper-plane-o',
			504 => 'fa-history',
			505 => 'fa-circle-thin',
			506 => 'fa-header',
			507 => 'fa-paragraph',
			508 => 'fa-sliders',
			509 => 'fa-share-alt',
			510 => 'fa-share-alt-square',
			511 => 'fa-bomb',
			512 => 'fa-soccer-ball-o',
			513 => 'fa-futbol-o',
			514 => 'fa-tty',
			515 => 'fa-binoculars',
			516 => 'fa-plug',
			517 => 'fa-slideshare',
			518 => 'fa-twitch',
			519 => 'fa-yelp',
			520 => 'fa-newspaper-o',
			521 => 'fa-wifi',
			522 => 'fa-calculator',
			523 => 'fa-paypal',
			524 => 'fa-google-wallet',
			525 => 'fa-cc-visa',
			526 => 'fa-cc-mastercard',
			527 => 'fa-cc-discover',
			528 => 'fa-cc-amex',
			529 => 'fa-cc-paypal',
			530 => 'fa-cc-stripe',
			531 => 'fa-bell-slash',
			532 => 'fa-bell-slash-o',
			533 => 'fa-trash',
			534 => 'fa-copyright',
			535 => 'fa-at',
			536 => 'fa-eyedropper',
			537 => 'fa-paint-brush',
			538 => 'fa-birthday-cake',
			539 => 'fa-area-chart',
			540 => 'fa-pie-chart',
			541 => 'fa-line-chart',
			542 => 'fa-lastfm',
			543 => 'fa-lastfm-square',
			544 => 'fa-toggle-off',
			545 => 'fa-toggle-on',
			546 => 'fa-bicycle',
			547 => 'fa-bus',
			548 => 'fa-ioxhost',
			549 => 'fa-angellist',
			550 => 'fa-cc',
			551 => 'fa-shekel',
			552 => 'fa-sheqel',
			553 => 'fa-ils',
			554 => 'fa-meanpath',
			555 => 'fa-buysellads',
			556 => 'fa-connectdevelop',
			557 => 'fa-dashcube',
			558 => 'fa-forumbee',
			559 => 'fa-leanpub',
			560 => 'fa-sellsy',
			561 => 'fa-shirtsinbulk',
			562 => 'fa-simplybuilt',
			563 => 'fa-skyatlas',
			564 => 'fa-cart-plus',
			565 => 'fa-cart-arrow-down',
			566 => 'fa-diamond',
			567 => 'fa-ship',
			568 => 'fa-user-secret',
			569 => 'fa-motorcycle',
			570 => 'fa-street-view',
			571 => 'fa-heartbeat',
			572 => 'fa-venus',
			573 => 'fa-mars',
			574 => 'fa-mercury',
			575 => 'fa-intersex',
			576 => 'fa-transgender',
			577 => 'fa-transgender-alt',
			578 => 'fa-venus-double',
			579 => 'fa-mars-double',
			580 => 'fa-venus-mars',
			581 => 'fa-mars-stroke',
			582 => 'fa-mars-stroke-v',
			583 => 'fa-mars-stroke-h',
			584 => 'fa-neuter',
			585 => 'fa-genderless',
			586 => 'fa-facebook-official',
			587 => 'fa-pinterest-p',
			588 => 'fa-whatsapp',
			589 => 'fa-server',
			590 => 'fa-user-plus',
			591 => 'fa-user-times',
			592 => 'fa-hotel',
			593 => 'fa-bed',
			594 => 'fa-viacoin',
			595 => 'fa-train',
			596 => 'fa-subway',
			597 => 'fa-medium',
			598 => 'fa-yc',
			599 => 'fa-y-combinator',
			600 => 'fa-optin-monster',
			601 => 'fa-opencart',
			602 => 'fa-expeditedssl',
			603 => 'fa-battery-4',
			604 => 'fa-battery',
			605 => 'fa-battery-full',
			606 => 'fa-battery-3',
			607 => 'fa-battery-three-quarters',
			608 => 'fa-battery-2',
			609 => 'fa-battery-half',
			610 => 'fa-battery-1',
			611 => 'fa-battery-quarter',
			612 => 'fa-battery-0',
			613 => 'fa-battery-empty',
			614 => 'fa-mouse-pointer',
			615 => 'fa-i-cursor',
			616 => 'fa-object-group',
			617 => 'fa-object-ungroup',
			618 => 'fa-sticky-note',
			619 => 'fa-sticky-note-o',
			620 => 'fa-cc-jcb',
			621 => 'fa-cc-diners-club',
			622 => 'fa-clone',
			623 => 'fa-balance-scale',
			624 => 'fa-hourglass-o',
			625 => 'fa-hourglass-1',
			626 => 'fa-hourglass-start',
			627 => 'fa-hourglass-2',
			628 => 'fa-hourglass-half',
			629 => 'fa-hourglass-3',
			630 => 'fa-hourglass-end',
			631 => 'fa-hourglass',
			632 => 'fa-hand-grab-o',
			633 => 'fa-hand-rock-o',
			634 => 'fa-hand-stop-o',
			635 => 'fa-hand-paper-o',
			636 => 'fa-hand-scissors-o',
			637 => 'fa-hand-lizard-o',
			638 => 'fa-hand-spock-o',
			639 => 'fa-hand-pointer-o',
			640 => 'fa-hand-peace-o',
			641 => 'fa-trademark',
			642 => 'fa-registered',
			643 => 'fa-creative-commons',
			644 => 'fa-gg',
			645 => 'fa-gg-circle',
			646 => 'fa-tripadvisor',
			647 => 'fa-odnoklassniki',
			648 => 'fa-odnoklassniki-square',
			649 => 'fa-get-pocket',
			650 => 'fa-wikipedia-w',
			651 => 'fa-safari',
			652 => 'fa-chrome',
			653 => 'fa-firefox',
			654 => 'fa-opera',
			655 => 'fa-internet-explorer',
			656 => 'fa-tv',
			657 => 'fa-television',
			658 => 'fa-contao',
			659 => 'fa-500px',
			660 => 'fa-amazon',
			661 => 'fa-calendar-plus-o',
			662 => 'fa-calendar-minus-o',
			663 => 'fa-calendar-times-o',
			664 => 'fa-calendar-check-o',
			665 => 'fa-industry',
			666 => 'fa-map-pin',
			667 => 'fa-map-signs',
			668 => 'fa-map-o',
			669 => 'fa-map',
			670 => 'fa-commenting',
			671 => 'fa-commenting-o',
			672 => 'fa-houzz',
			673 => 'fa-vimeo',
			674 => 'fa-black-tie',
			675 => 'fa-fonticons',
			676 => 'fa-reddit-alien',
			677 => 'fa-edge',
			678 => 'fa-credit-card-alt',
			679 => 'fa-codiepie',
			680 => 'fa-modx',
			681 => 'fa-fort-awesome',
			682 => 'fa-usb',
			683 => 'fa-product-hunt',
			684 => 'fa-mixcloud',
			685 => 'fa-scribd',
			686 => 'fa-pause-circle',
			687 => 'fa-pause-circle-o',
			688 => 'fa-stop-circle',
			689 => 'fa-stop-circle-o',
			690 => 'fa-shopping-bag',
			691 => 'fa-shopping-basket',
			692 => 'fa-hashtag',
			693 => 'fa-bluetooth',
			694 => 'fa-bluetooth-b',
			695 => 'fa-percent',
			696 => 'fa-gitlab',
			697 => 'fa-wpbeginner',
			698 => 'fa-wpforms',
			699 => 'fa-envira',
			700 => 'fa-universal-access',
			701 => 'fa-wheelchair-alt',
			702 => 'fa-question-circle-o',
			703 => 'fa-blind',
			704 => 'fa-audio-description',
			705 => 'fa-volume-control-phone',
			706 => 'fa-braille',
			707 => 'fa-assistive-listening-systems',
			708 => 'fa-asl-interpreting',
			709 => 'fa-american-sign-language-interpreting',
			710 => 'fa-deafness',
			711 => 'fa-hard-of-hearing',
			712 => 'fa-deaf',
			713 => 'fa-glide',
			714 => 'fa-glide-g',
			715 => 'fa-signing',
			716 => 'fa-sign-language',
			717 => 'fa-low-vision',
			718 => 'fa-viadeo',
			719 => 'fa-viadeo-square',
			720 => 'fa-snapchat',
			721 => 'fa-snapchat-ghost',
			722 => 'fa-snapchat-square',
			723 => 'fa-pied-piper',
			724 => 'fa-first-order',
			725 => 'fa-yoast',
			726 => 'fa-themeisle',
			727 => 'fa-google-plus-circle',
			728 => 'fa-google-plus-official',
			729 => 'fa-fa',
			730 => 'fa-font-awesome',
			731 => 'fa-handshake-o',
			732 => 'fa-envelope-open',
			733 => 'fa-envelope-open-o',
			734 => 'fa-linode',
			735 => 'fa-address-book',
			736 => 'fa-address-book-o',
			737 => 'fa-vcard',
			738 => 'fa-address-card',
			739 => 'fa-vcard-o',
			740 => 'fa-address-card-o',
			741 => 'fa-user-circle',
			742 => 'fa-user-circle-o',
			743 => 'fa-user-o',
			744 => 'fa-id-badge',
			745 => 'fa-drivers-license',
			746 => 'fa-id-card',
			747 => 'fa-drivers-license-o',
			748 => 'fa-id-card-o',
			749 => 'fa-quora',
			750 => 'fa-free-code-camp',
			751 => 'fa-telegram',
			752 => 'fa-thermometer-4',
			753 => 'fa-thermometer',
			754 => 'fa-thermometer-full',
			755 => 'fa-thermometer-3',
			756 => 'fa-thermometer-three-quarters',
			757 => 'fa-thermometer-2',
			758 => 'fa-thermometer-half',
			759 => 'fa-thermometer-1',
			760 => 'fa-thermometer-quarter',
			761 => 'fa-thermometer-0',
			762 => 'fa-thermometer-empty',
			763 => 'fa-shower',
			764 => 'fa-bathtub',
			765 => 'fa-s15',
			766 => 'fa-bath',
			767 => 'fa-podcast',
			768 => 'fa-window-maximize',
			769 => 'fa-window-minimize',
			770 => 'fa-window-restore',
			771 => 'fa-times-rectangle',
			772 => 'fa-window-close',
			773 => 'fa-times-rectangle-o',
			774 => 'fa-window-close-o',
			775 => 'fa-bandcamp',
			776 => 'fa-grav',
			777 => 'fa-etsy',
			778 => 'fa-imdb',
			779 => 'fa-ravelry',
			780 => 'fa-eercast',
			781 => 'fa-microchip',
			782 => 'fa-snowflake-o',
			783 => 'fa-superpowers',
			784 => 'fa-wpexplorer',
			785 => 'fa-meetup',
		);

		return apply_filters( 'customify/customizer/font_icons/font_awesome_icons', $icons );
	}

}
class-customizer-sanitize.php000066600000027202151151110650012413 0ustar00<?php

class Customify_Sanitize_Input {

	private $control;
	private $setting;
	private $fonts = array();
	private $icons = array();
	private $skip_devices = false;

	function __construct( $control = null, $setting = null ) {
		if ( is_array( $control ) ) {
			$control = (object) $control;
		}
		if ( is_array( $setting ) ) {
			$setting = (object) $setting;
		}
		$this->control = $control;
		$this->setting = $setting;
	}

	/**
	 * Sanitize css code
	 *
	 * @param string $val
	 *
	 * @return string
	 */
	static function sanitize_css_code( $val ) {
		return wp_kses_post( $val );
	}

	/**
	 * Sanitize Customizer Input
	 *
	 * @param string $input
	 * @param object $setting
	 *
	 * @return array|mixed|null|object|string
	 */
	static function sanitize_customizer_input( $input, $setting ) {
		$input = wp_unslash( $input );
		if ( ! is_array( $input ) ) {
			$input = json_decode( urldecode_deep( $input ), true );
		}
		$control = $setting->manager->get_control( $setting->id );
		$s       = new Customify_Sanitize_Input( $control, $setting );
		$input   = $s->sanitize( $input );
		return $input;
	}

	/**
	 * Sanitize css ruler input
	 *
	 * @param array|string $value
	 *
	 * @return array
	 */
	private function sanitize_css_ruler( $value ) {
		$default             = array(
			'unit'   => 'px',
			'top'    => null,
			'right'  => null,
			'bottom' => null,
			'left'   => null,
			'link'   => 1,
		);
		$value               = wp_parse_args( $value, $default );
		$new_value           = array();
		$new_value['unit']   = sanitize_text_field( $value['unit'] );
		$new_value['top']    = sanitize_text_field( $value['top'] );
		$new_value['right']  = sanitize_text_field( $value['right'] );
		$new_value['bottom'] = sanitize_text_field( $value['bottom'] );
		$new_value['left']   = sanitize_text_field( $value['left'] );
		$new_value['link']   = $value['link'] ? 1 : null;

		return $new_value;
	}

	private function sanitize_slider( $value ) {
		$default            = array(
			'unit'  => 'px',
			'value' => null,
		);
		$value              = wp_parse_args( $value, $default );
		$new_value          = array();
		$new_value['unit']  = sanitize_text_field( $value['unit'] );
		$new_value['value'] = sanitize_text_field( $value['value'] );

		return $new_value;
	}

	private function sanitize_checkbox( $value ) {
		if ( 1 == $value || 'on' == $value ) {
			$value = 1;
		} else {
			$value = 0;
		}

		return $value;
	}

	/**
	 * Sanitize color
	 *
	 * Output can be rgba or hex color code
	 *
	 * @param string $color
	 *
	 * @return string
	 */
	static function sanitize_color( $color ) {
		if ( empty( $color ) || is_array( $color ) ) {
			return '';
		}

		// If string does not start with 'rgba', then treat as hex.
		// sanitize the hex color and finally convert hex to rgba.
		if ( false === strpos( $color, 'rgba' ) ) {
			return sanitize_hex_color( $color );
		}

		// By now we know the string is formatted as an rgba color so we need to further sanitize it.
		$color = str_replace( ' ', '', $color );
		sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha );

		return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')';
	}

	private function sanitize_media( $value ) {
		$value         = wp_parse_args(
			$value,
			array(
				'id'   => '',
				'url'  => '',
				'mime' => '',
			)
		);
		$value['id']   = sanitize_text_field( $value['id'] );
		$value['url']  = sanitize_text_field( $value['url'] );
		$value['mime'] = sanitize_text_field( $value['mime'] );

		return $value;
	}

	private function sanitize_icon( $value ) {
		$value                         = wp_parse_args(
			$value,
			array(
				'type' => '',
				'icon' => '',
			)
		);
		$value['type']                 = sanitize_text_field( $value['type'] );
		$value['icon']                 = sanitize_text_field( $value['icon'] );
		$this->icons[ $value['type'] ] = true;

		return $value;
	}

	private function sanitize_text_field_deep( $value, $html = false ) {
		if ( ! is_array( $value ) ) {
			$value = wp_kses_post( $value );
		} else {
			if ( is_array( $value ) ) {
				foreach ( $value as $k => $v ) {
					$value[ $k ] = $this->sanitize_text_field_deep( $v );
				}
			}
		}

		return $value;
	}

	private function sanitize_group( $value, $skip_device = false ) {

		if ( ! is_array( $value ) ) {
			$value = array();
		}
		foreach ( $this->control->fields as $field ) {
			if ( ! isset( $value[ $field['name'] ] ) ) {
				$value[ $field['name'] ] = '';
			}
			$_v                      = $value[ $field['name'] ];
			$_v                      = $this->sanitize( $_v, $field );
			$value[ $field['name'] ] = $_v;
		}

		return $value;
	}

	private function sanitize_repeater( $value ) {
		if ( ! is_array( $value ) ) {
			$value = array();
		}

		foreach ( $value as $k => $iv ) {
			foreach ( $this->control->fields as $field ) {

				if ( ! isset( $iv[ $field['name'] ] ) ) {
					$iv[ $field['name'] ] = '';
				}

				$_v                   = $iv[ $field['name'] ];
				$_v                   = $this->sanitize( $_v, $field );
				$iv[ $field['name'] ] = $_v;
			}

			$value[ $k ] = $iv;
		}

		return $value;
	}

	function sanitize( $value, $field = array() ) {

		$type            = null;
		$device_settings = false;
		if ( is_array( $field ) && ! empty( $field ) ) {
			if ( isset( $field['type'] ) ) {
				$type = $field['type'];
			} elseif ( isset( $field['setting_type'] ) ) {
				$type = $field['setting_type'];
			}

			if ( isset( $field['device_settings'] ) && $field['device_settings'] ) {
				$device_settings = true;
			}
		} else {
			$type            = $this->control->setting_type;
			$device_settings = $this->control->device_settings;
		}

		if ( 'js_raw' != $type ) {
			if ( ! $device_settings ) {
				// Fallback value when device_settings from tru to false.
				if ( is_array( $value ) && isset( $value['desktop'] ) ) {
					$value = $value['desktop'];
				}
			}
		}

		switch ( $type ) {
			case 'color':
				$has_device = false;
				if ( $device_settings && ! $this->skip_devices ) {
					if ( is_array( $value ) ) {
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device       = true;
								$value[ $device ] = $this->sanitize_color( $value[ $device ] );
							}
						}
					}
				}
				if ( ! $has_device ) {
					$value = $this->sanitize_color( $value );
				}
				break;
			case 'group':
				$has_device = false;
				if ( $device_settings ) {
					$this->skip_devices = true;
					if ( is_array( $value ) ) {
						$has_device = false;
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device       = true;
								$value[ $device ] = $this->sanitize_group( $value[ $device ] );
							}
						}
					}
					$this->skip_devices = false;
				}
				if ( ! $has_device ) {
					$value = $this->sanitize_group( $value );
				}
				break;
			case 'repeater':
				$has_device = false;
				if ( $device_settings && ! $this->skip_devices ) {
					if ( is_array( $value ) ) {
						$has_device = false;
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device       = true;
								$value[ $device ] = $this->sanitize_repeater( $value[ $device ] );
							}
						}
					}
				}
				if ( ! $has_device ) {
					$value = $this->sanitize_repeater( $value );
				}

				break;
			case 'media':
			case 'image':
			case 'attachment':
			case 'video':
			case 'autio':
				$has_device = false;
				if ( $device_settings && ! $this->skip_devices ) {
					if ( is_array( $value ) ) {
						$has_device = false;
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device       = true;
								$value[ $device ] = $this->sanitize_media( $value[ $device ] );
							}
						}
					}
				}
				if ( ! $has_device ) {
					$value = $this->sanitize_media( $value );
				}

				break;
			case 'select':
			case 'radio':
			case 'image_select':
			case 'radio_group':
				$default = null;
				$choices = array();
				if ( ! empty( $field ) ) {
					if ( isset( $field['default'] ) ) {
						$default = $field['default'];
					}

					if ( isset( $field['choices'] ) ) {
						$choices = $field['choices'];
					}
				} else {
					$default = $this->setting->default;
					$choices = $this->control->choices;
				}
				if ( ! is_array( $choices ) ) {
					$choices = array();
				}
				if ( ! $value ) {
					return '';
				}

				$has_device = false;
				if ( $device_settings && ! $this->skip_devices ) {
					if ( is_array( $value ) ) {
						$has_device = false;
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device = true;
								if ( ! isset( $choices[ (string) $value[ $device ] ] ) ) {
									if ( is_array( $default ) && isset( $default[ $device ] ) ) {
										$value[ $device ] = $default;
									} else {
										$value[ $device ] = $default;
									}
								}
							}
						}
					}
				}
				if ( ! $has_device ) {
					if ( is_array( $value ) || ! isset( $choices[ $value ] ) ) {
						$value = $default;
					}
				}

				break;
			case 'checkbox':
				$has_device = false;
				if ( $device_settings && ! $this->skip_devices ) {
					if ( is_array( $value ) ) {
						$has_device = false;
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device       = true;
								$value[ $device ] = $this->sanitize_checkbox( $value[ $device ] );
							}
						}
					}
				}
				if ( ! $has_device ) {
					$value = $this->sanitize_checkbox( $value );
				}

				break;
			case 'css_ruler':
				$has_device = false;
				if ( $device_settings && ! $this->skip_devices ) {
					if ( is_array( $value ) ) {
						$has_device = false;
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device       = true;
								$value[ $device ] = $this->sanitize_css_ruler( $value[ $device ] );
							}
						}
					}
				}
				if ( ! $has_device ) {
					$value = $this->sanitize_css_ruler( $value );
				}

				break;
			case 'slider':
				$has_device = false;
				if ( $device_settings && ! $this->skip_devices ) {
					if ( is_array( $value ) ) {
						$has_device = false;
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device       = true;
								$value[ $device ] = $this->sanitize_slider( $value[ $device ] );
							}
						}
					}
				}
				if ( ! $has_device ) {
					$value = $this->sanitize_slider( $value );
				}

				break;
			case 'icon':
				$has_device = false;
				if ( $device_settings && ! $this->skip_devices ) {
					if ( is_array( $value ) ) {
						$has_device = false;
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device       = true;
								$value[ $device ] = $this->sanitize_icon( $value[ $device ] );
							}
						}
					}
				}
				if ( ! $has_device ) {
					$value = $this->sanitize_icon( $value );
				}

				break;
			case 'js_raw':
				$value = $this->sanitize_text_field_deep( $value );
				break;
			case 'textarea':
				$value = wp_kses_post( $value );
				break;
			default:
				$has_device = false;
				if ( $device_settings && ! $this->skip_devices ) {
					if ( is_array( $value ) ) {
						$has_device = false;
						foreach ( Customify()->customizer->devices as $device ) {
							if ( isset( $value[ $device ] ) ) {
								$has_device       = true;
								$value[ $device ] = $this->sanitize_text_field_deep( $value[ $device ] );
							}
						}
					}
				}
				if ( ! $has_device ) {
					$value = $this->sanitize_text_field_deep( $value );
				}
		}

		return $value;
	}
}



class-customify-panel.php000066600000001373151151110650011503 0ustar00<?php

class Customify_WP_Customize_Panel extends WP_Customize_Panel {

	public $panel;
	public $type = 'customify_panel';

	/**
	 * Auto-expand a section in a panel when the panel is expanded when the panel only has the one section.
	 *
	 * @since 4.7.4
	 * @var bool
	 */
	public $auto_expand_sole_section = true;

	public function json() {

		$array = wp_array_slice_assoc(
			(array) $this,
			array(
				'id',
				'description',
				'priority',
				'type',
				'panel',
			)
		);
		$array['title']          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
		$array['content']        = $this->get_content();
		$array['active']         = $this->active();
		$array['instanceNumber'] = $this->instance_number;
		return $array;

	}

}
controls/class-control-media.php000066600000004256151151110650012767 0ustar00<?php
class Customify_Customizer_Control_Media extends Customify_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-media">';
		self::before_field();
		?>
		<#
		if ( ! _.isObject(field.value) ) {
			field.value = {};
		}
		var url = field.value.url;
		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner customify-media-type-{{ field.type }}">
			<div class="customify--media">
				<input type="hidden" class="attachment-id" value="{{ field.value.id }}" data-name="{{ field.name }}">
				<input type="hidden" class="attachment-url"  value="{{ field.value.url }}" data-name="{{ field.name }}-url">
				<input type="hidden" class="attachment-mime"  value="{{ field.value.mime }}" data-name="{{ field.name }}-mime">
				<div class="customify-image-preview <# if ( url ) { #> customify--has-file <# } #>" data-no-file-text="<?php esc_attr_e( 'No file selected', 'customify' ); ?>">
					<#

					if ( url ) {
						if ( url.indexOf('http://') > -1 || url.indexOf('https://') ){

						} else {
							url = Customify_Control_Args.home_url + url;
						}

						if ( ! field.value.mime || field.value.mime.indexOf('image/') > -1 ) {
							#>
							<img src="{{ url }}" alt="">
						<# } else if ( field.value.mime.indexOf('video/' ) > -1 ) { #>
							<video width="100%" height="" controls><source src="{{ url }}" type="{{ field.value.mime }}">Your browser does not support the video tag.</video>
						<# } else {
						var basename = url.replace(/^.*[\\\/]/, '');
						#>
							<a href="{{ url }}" class="attachment-file" target="_blank">{{ basename }}</a>
						<# }
					}
					#>
				</div>
				<button type="button" class="button customify--add <# if ( url ) { #> customify--hide <# } #>"><?php _e( 'Add', 'customify' ); ?></button>
				<button type="button" class="button customify--change <# if ( ! url ) { #> customify--hide <# } #>"><?php _e( 'Change', 'customify' ); ?></button>
				<button type="button" class="button customify--remove <# if ( ! url ) { #> customify--hide <# } #>"><?php _e( 'Remove', 'customify' ); ?></button>
			</div>
		</div>

		<?php
		self::after_field();
		echo '</script>';
	}
}
controls/class-control-hr.php000066600000000360151151110650012311 0ustar00<?php
class Customify_Customizer_Control_Hr extends Customify_Customizer_Control_Base {
	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-hr">
		<?php
		echo '<hr/>';
		?>
		</script>
		<?php
	}
}
controls/class-control-checkbox.php000066600000002334151151110650013471 0ustar00<?php
class Customify_Customizer_Control_Checkbox extends Customify_Customizer_Control_Base {

	static function before_field() {
		?>
		<#
		var required = '';
		if ( ! _.isUndefined( field.required ) ) {
			required = JSON.stringify( field.required  );
		}
		#>
		<div class="customify--field dadsa customify--field-{{ field.type }} {{ field.class }} customify--field-name-{{ field.original_name }}" data-required="{{ required }}" data-field-name="{{ field.name }}">
		<?php
	}


	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-checkbox">
		<?php
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<label>

				<span class="onoffswitch">
					<input type="checkbox" class="onoffswitch-checkbox customify-input" <# if ( field.value == 1 ){ #> checked="checked" <# } #> data-name="{{ field.name }}" value="1">
					<span class="onoffswitch-label">
						<span class="onoffswitch-inner"></span>
						<span class="onoffswitch-switch"></span>
					</span>
				</span>

				<span class="checkbox-field-text">
					{{{ field.checkbox_label }}}
				</span>
			</label>
		</div>
		<?php
		self::after_field();
		?>
		</script>
		<?php
	}
}
controls/class-control-base.php000066600000031353151151110650012620 0ustar00<?php

class Customify_Customizer_Control_Base extends WP_Customize_Control {
	/**
	 * The control type.
	 *
	 * @access public
	 * @var string
	 */
	public $type = 'customify';
	/**
	 * Data type
	 *
	 * @access public
	 * @var string
	 */
	public $option_type = 'theme_mod';

	public $setting_type = 'group';
	public $fields = array();
	public $choices = array();
	public $default = null;
	public $default_value = null;
	public $device = '';
	public $devices = null;
	public $checkbox_label = '';
	public $placeholder = '';
	public $reset_controls = array();
	public $limit;


	public $min = 0;
	public $max = 700;
	public $step = 1;
	public $unit = false;

	/**
	 * @var array For CSS Ruler.
	 */
	public $fields_disabled = array();

	public $limit_msg = '';
	public $live_title_field;
	public $addable = null;
	public $title_only = null;
	public $_settings;
	public $_selective_refresh;
	public $device_settings = false;
	public $no_setup = false;
	public $_pro = false;

	/**
	 * Provide the parent, comparison operator, and value which affects the field’s visibility.
	 *
	 * @var array
	 */
	public $required;

	public $field_class = '';
	public static $_js_template_added;
	public static $_args_loaded;

	/**
	 * Refresh the parameters passed to the JavaScript via JSON.
	 *
	 * @access public
	 */
	public function to_json() {
		parent::to_json();

		// Add something here.
		$value = $this->value();
		if ( 'group' == $this->setting_type ) {
			if ( ! is_array( $value ) ) {
				$value = array();
			}
			foreach ( $this->fields as $k => $f ) {
				if ( isset( $value[ $f['name'] ] ) ) {
					$this->fields[ $k ]['value'] = $value[ $f['name'] ];
				}
			}

			if ( ! is_array( $this->default ) ) {
				$this->default = array();
			}
		} elseif ( 'repeater' == $this->setting_type ) {
			if ( ! is_array( $value ) ) {
				$value = array();
			}
			if ( ! is_array( $this->default ) ) {
				$this->default = array();
			}
		}

		// Devices switcher settings = true;.
		$this->json['device_settings'] = $this->device_settings;
		if ( ! $this->device_settings && 'js_raw' != $this->setting_type ) {
			// Fallback value when device_settings from true to false.
			if ( is_array( $value ) && isset( $value['desktop'] ) ) {
				$value = $value['desktop'];
			}
		}

		if ( 'slider' == $this->setting_type ) {
			if ( ! $value || empty( $value ) ) {
				$value = $this->default_value;
			}
		}
		$this->json['value'] = $value;

		$this->json['_pro']           = class_exists( 'Customify_Pro' );
		$this->json['default']        = $this->default_value;
		$this->json['placeholder']    = $this->placeholder;
		$this->json['fields']         = $this->fields;
		$this->json['setting_type']   = $this->setting_type;
		$this->json['required']       = $this->required;
		$this->json['devices']        = $this->devices;
		$this->json['reset_controls'] = $this->reset_controls;

		if ( $this->no_setup ) {
			return;
		}

		$this->json['min']  = $this->min;
		$this->json['max']  = $this->max;
		$this->json['step'] = $this->step;
		$this->json['unit'] = $this->unit;
		if ( 'css_ruler' == $this->setting_type ) {
			// $disabled
			$this->json['fields_disabled'] = $this->fields_disabled;
		}

		if ( 'repeater' == $this->setting_type ) {
			$this->json['l10n']             = array(
				'untitled' => __( 'Untitled', 'customify' ),
			);
			$this->json['live_title_field'] = $this->live_title_field;
			$this->json['limit']            = $this->limit;
			$this->json['limit_msg']        = $this->limit_msg;
			$this->json['title_only']       = $this->title_only;
			if ( false === $this->addable ) {
				$this->json['addable'] = false;
				if ( empty( $this->json['value'] ) ) {
					$this->json['value'] = $this->default_value;
				}

				$this->json['value'] = $this->merge_items( $this->json['value'], $this->default_value );

			} else {
				$this->json['addable'] = true;
			}

			// Just make live title file translate able.
			if ( $this->title_only && $this->live_title_field ) {
				$new_array = array();
				foreach ( (array) $this->default_value as $f ) {
					if ( isset( $f['_key'] ) ) {
						if ( isset( $f[ $this->live_title_field ] ) ) {
							$new_array[ $f['_key'] ] = $f;
						}
					}
				}
				if ( ! empty( $new_array ) ) {
					$new_values = array();
					foreach ( (array) $this->json['value'] as $index => $f ) {
						if ( isset( $f['_key'] ) && $new_array[ $f['_key'] ] ) {
							$f[ $this->live_title_field ] = $new_array[ $f['_key'] ][ $this->live_title_field ];
							$new_values[ $f['_key'] ]     = $f;
						}
					}

					$new_values = array_merge( $new_array, $new_values );
					if ( ! empty( $new_values ) ) {
						$this->json['value'] = array_values( $new_values );
					}
				}
			}
		}

		if ( 'select' == $this->setting_type || 'radio' == $this->setting_type ) {
			$this->json['choices'] = $this->choices;
		}
		if ( 'checkbox' == $this->setting_type ) {
			$this->json['checkbox_label'] = $this->checkbox_label;
		}

	}

	/**
	 * Merge 2 array width `_key` is key of each item
	 *
	 * @since 0.2.5
	 *
	 * @param array $destination
	 * @param array $new_array
	 *
	 * @return array
	 */
	function merge_items( $destination = array(), $new_array = array() ) {
		return Customify_Customizer::merge_items( $destination, $new_array );
	}


	/**
	 * Enqueue control related scripts/styles.
	 *
	 * @access public
	 */
	public function enqueue() {
		wp_enqueue_media();
		if ( 'repeater' == $this->setting_type ) {
			wp_enqueue_script( 'jquery-ui-sortable' );
		}

		$suffix = Customify()->get_asset_suffix();
		wp_enqueue_style( 'wp-color-picker' );
		wp_enqueue_script( 'wp-color-picker' );
		wp_enqueue_script( 'jquery-ui-slider' );
		wp_enqueue_style( 'customify-customizer-control', esc_url( get_template_directory_uri() ) . '/assets/css/admin/customizer/customizer' . $suffix . '.css' ); // phpcs:ignore
		wp_enqueue_style( 'select2', esc_url( get_template_directory_uri() ) . '/assets/css/admin/select2' . $suffix . '.css' ); // phpcs:ignore
		wp_enqueue_script( 'customify-color-picker-alpha', esc_url( get_template_directory_uri() ) . '/assets/js/customizer/color-picker-alpha' . $suffix . '.js', array( 'wp-color-picker' ), false, true ); // phpcs:ignore
		wp_enqueue_script( 'select2', esc_url( get_template_directory_uri() ) . '/assets/js/select2' . $suffix . '.js', array( 'jquery' ), false, true ); // phpcs:ignore
		wp_enqueue_script( // phpcs:ignore
			'customify-customizer-control',
			esc_url( get_template_directory_uri() ) . '/assets/js/customizer/control' . $suffix . '.js',
			array(
				'jquery',
				'customize-base',
				'jquery-ui-core',
				'jquery-ui-sortable',
			),
			false,
			true
		);
		if ( is_null( self::$_args_loaded ) ) {

			$posts_page = get_option( 'page_for_posts' );
			if ( $posts_page ) {
				$blog_url = get_permalink( $posts_page );
			} else {
				$blog_url = home_url( '/' );
			}

			$query = new WP_Query(
				array(
					'post_type'      => 'post',
					'posts_per_page' => 1,
					'orderby'        => 'rand',
				)
			);

			$posts = $query->get_posts();
			$single_post_url = home_url( '/' );
			if ( count( $posts ) ) {
				$single_post_url = get_permalink( $posts[0] );
			}

			$args = array(
				'home_url'         => esc_url( home_url( '' ) ),
				'ajax'             => admin_url( 'admin-ajax.php' ),
				'is_rtl'           => is_rtl(),
				'theme_default'    => __( 'Theme Default', 'customify' ),
				'reset'            => __( 'Reset this section settings', 'customify' ),
				'untitled'         => __( 'Untitled', 'customify' ),
				'confirm_reset'    => __( 'Do you want to reset this section settings?', 'customify' ),
				'list_font_weight' => array(
					''       => __( 'Default', 'customify' ),
					'normal' => _x( 'Normal', 'customify-font-weight', 'customify' ),
					'bold'   => _x( 'Bold', 'customify-font-weight', 'customify' ),
				),
				'typo_fields'      => Customify()->customizer->get_typo_fields(),
				'styling_config'   => Customify()->customizer->get_styling_config(),
				'devices'          => Customify()->customizer->devices,
				// Auto redirect to url when section open.
				'section_urls'     => array(
					'section_single_blog_post' => $single_post_url,
					'section_search_results'   => home_url( '/?s=a' ), // search page.
				),
				// Auto redirect to url when section panel.
				'panel_urls'       => array(
					'panel_blog_post' => $blog_url,
				),
			);

			wp_localize_script( 'customify-customizer-control', 'Customify_Control_Args', apply_filters( 'Customify_Control_Args', $args ) ); // phpcs:ignore
			self::$_args_loaded = true;
		}
	}


	/**
	 * Renders the control wrapper and calls $this->render_content() for the internals.
	 */
	protected function render() {
		$id    = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id );
		$class = 'customize-control customize-control-' . $this->type . '-' . $this->setting_type;
		if ( $this->field_class ) {
			$class = sanitize_text_field( $this->field_class ) . ' ' . $class;
		}

		?>
		<li id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $class ); ?><?php echo ( $this->device ) ? '  customify--device-show customify--device-' . esc_attr( $this->device ) : ''; ?>">
		<?php $this->render_content(); ?>
		</li>
		<?php
	}


	/**
	 * Render the control's content.
	 * Allows the content to be overriden without having to rewrite the wrapper in $this->render().
	 *
	 * @access protected
	 */
	protected function render_content() {
		if ( 'js_raw' == $this->setting_type ) {
			return '';
		}

		if ( 'heading' == $this->setting_type ) {
			?>
			<div class="customify-control--heading">
				<label>
					<?php if ( ! empty( $this->label ) ) : ?>
						<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
					<?php endif; ?>
				</label>
			</div>
			<?php if ( ! empty( $this->description ) ) : ?>
				<span class="description customize-control-description"><?php echo wp_kses_post( $this->description ); ?></span>
			<?php endif; ?>
			<?php
			return '';
		}

		?>
		<div class="customify--settings-wrapper <?php echo ( $this->label || $this->description ) ? 'has-title-desc' : 'no-title-desc'; ?>">
			<?php if ( $this->label ) { ?>
				<div data-control="<?php echo esc_attr( $this->id ); ?>" class="customify-control-field-header customify-field-heading">
					<label>
						<?php if ( ! empty( $this->label ) ) : ?>
							<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
						<?php endif; ?>
					</label>
				</div>
			<?php } ?>
			<?php
			if ( 'custom_html' == $this->setting_type ) {
				?>
				<div class="custom_html"><?php
					echo $this->description;  // WPCS: XSS OK.
				?></div>
				<?php
			} else {
				?>
				<?php if ( ! empty( $this->description ) ) : ?>
					<span class="description customize-control-description"><?php echo wp_kses_post( $this->description ); ?></span>
				<?php endif; ?>
			<?php } ?>

			<?php if ( 'custom_html' != $this->setting_type ) { ?>
				<div class="customify--settings-fields<?php echo ( 'repeater' == $this->setting_type ) ? ' customify--repeater-items' : ''; ?>"></div>
				<?php if ( 'repeater' == $this->setting_type ) { ?>
					<div class="customify--repeater-actions">
						<a href="#" class="customify--repeater-reorder" data-text="<?php esc_attr_e( 'Reorder', 'customify' ); ?>" data-done="<?php _e( 'Done', 'customify' ); ?>"><?php _e( 'Reorder', 'customify' ); ?></a>
						<?php if ( false !== $this->addable ) { ?>
							<button type="button" class="button customify--repeater-add-new"><?php _e( 'Add an item', 'customify' ); ?></button>
						<?php } ?>
					</div>
				<?php } ?>
			<?php } ?>
		</div>
		<?php
	}

	static function before_field() {
		?>
		<#
		var required = '';
		if ( ! _.isUndefined( field.required ) ) {
		required = JSON.stringify( field.required  );
		}
		#>
		<div class="customify--field customify--field-{{ field.type }} {{ field.class }} customify--field-name-{{ field.original_name }}" data-required="{{ required }}" data-field-name="{{ field.name }}">
		<?php
	}

	static function after_field() {
		?>
		</div>
		<?php
	}

	static function field_header() {
		?>
		<# if ( field.label || field.description ) { #>
		<div class="customify-field-header">
			<# if ( field.label ) { #>
			<div class="customify-field-heading">
				<label class="customize-control-title">{{{ field.label }}}</label>
			</div>
			<# } #>
			<# if ( field.description ) { #>
			<p class="description">{{{ field.description }}}</p>
			<# } #>
		</div>
		<# } #>
		<?php
	}

	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-text">
			<?php
			self::before_field();
			?>
			<?php echo self::field_header(); ?>
			<div class="customify-field-settings-inner">
				<input type="{{ field.type }}" class="customify-input customify-only" placeholder="{{ field.placeholder }}" data-name="{{ field.name }}" value="{{ field.value }}">
			</div>
			<?php
			self::after_field();
			?>
		</script>
		<?php
	}


}
controls/class-control-image.php000066600000004263151151110650012770 0ustar00<?php
class Customify_Customizer_Control_Image extends Customify_Customizer_Control_Media {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-image">';
		self::before_field();
		?>
		<#
		if ( ! _.isObject(field.value) ) {
			field.value = {};
		}
		var url = field.value.url;
		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner customify-media-type-{{ field.type }}">
			<div class="customify--media">
				<input type="hidden" class="attachment-id" value="{{ field.value.id }}" data-name="{{ field.name }}">
				<input type="hidden" class="attachment-url"  value="{{ field.value.url }}" data-name="{{ field.name }}-url">
				<input type="hidden" class="attachment-mime"  value="{{ field.value.mime }}" data-name="{{ field.name }}-mime">
				<div class="customify-image-preview <# if ( url ) { #> customify--has-file <# } #>" data-no-file-text="<?php esc_attr_e( 'No file selected', 'customify' ); ?>">
					<#

					if ( url ) {
						if ( url.indexOf('http://') > -1 || url.indexOf('https://') >-1 ){

						} else {
							url = Customify_Control_Args.home_url + url;
						}

						if ( ! field.value.mime || field.value.mime.indexOf('image/') > -1 ) {
							#>
							<img src="{{ url }}" alt="">
						<# } else if ( field.value.mime.indexOf('video/' ) > -1 ) { #>
							<video width="100%" height="" controls><source src="{{ url }}" type="{{ field.value.mime }}">Your browser does not support the video tag.</video>
						<# } else {
						var basename = url.replace(/^.*[\\\/]/, '');
						#>
							<a href="{{ url }}" class="attachment-file" target="_blank">{{ basename }}</a>
						<# }
					}
					#>
				</div>
				<button type="button" class="button customify--add <# if ( url ) { #> customify--hide <# } #>"><?php _e( 'Add', 'customify' ); ?></button>
				<button type="button" class="button customify--change <# if ( ! url ) { #> customify--hide <# } #>"><?php _e( 'Change', 'customify' ); ?></button>
				<button type="button" class="button customify--remove <# if ( ! url ) { #> customify--hide <# } #>"><?php _e( 'Remove', 'customify' ); ?></button>
			</div>
		</div>

		<?php
		self::after_field();
		echo '</script>';
	}
}
controls/class-control-select.php000066600000001200151151110650013151 0ustar00<?php
class Customify_Customizer_Control_Select extends Customify_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-select">';
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<select class="customify-input" data-name="{{ field.name }}">
				<# _.each( field.choices, function( label, key ){  #>
					<option <# if ( field.value == key ){ #> selected="selected" <# } #> value="{{ key }}">{{ label }}</option>
				<# } ); #>
			</select>
		</div>
		<?php
		self::after_field();
		echo '</script>';
	}
}
controls/class-control-video.php000066600000004257151151110650013017 0ustar00<?php
class Customify_Customizer_Control_Video extends Customify_Customizer_Control_Media {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-video">';
		self::before_field();
		?>
		<#
		if ( ! _.isObject(field.value) ) {
			field.value = {};
		}
		var url = field.value.url;
		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner customify-media-type-{{ field.type }}">
			<div class="customify--media">
				<input type="hidden" class="attachment-id" value="{{ field.value.id }}" data-name="{{ field.name }}">
				<input type="hidden" class="attachment-url"  value="{{ field.value.url }}" data-name="{{ field.name }}-url">
				<input type="hidden" class="attachment-mime"  value="{{ field.value.mime }}" data-name="{{ field.name }}-mime">
				<div class="customify-image-preview <# if ( url ) { #> customify--has-file <# } #>" data-no-file-text="<?php esc_attr_e( 'No file selected', 'customify' ); ?>">
					<#

					if ( url ) {
						if ( url.indexOf('http://') > -1 || url.indexOf('https://') ){

						} else {
							url = Customify_Control_Args.home_url + url;
						}

						if ( ! field.value.mime || field.value.mime.indexOf('image/') > -1 ) {
							#>
							<img src="{{ url }}" alt="">
						<# } else if ( field.value.mime.indexOf('video/' ) > -1 ) { #>
							<video width="100%" height="" controls><source src="{{ url }}" type="{{ field.value.mime }}">Your browser does not support the video tag.</video>
						<# } else {
						var basename = url.replace(/^.*[\\\/]/, '');
						#>
							<a href="{{ url }}" class="attachment-file" target="_blank">{{ basename }}</a>
						<# }
					}
					#>
				</div>
				<button type="button" class="button customify--add <# if ( url ) { #> customify--hide <# } #>"><?php _e( 'Add', 'customify' ); ?></button>
				<button type="button" class="button customify--change <# if ( ! url ) { #> customify--hide <# } #>"><?php _e( 'Change', 'customify' ); ?></button>
				<button type="button" class="button customify--remove <# if ( ! url ) { #> customify--hide <# } #>"><?php _e( 'Remove', 'customify' ); ?></button>
			</div>
		</div>

		<?php
		self::after_field();
		echo '</script>';
	}
}
controls/class-control-font-style.php000066600000004137151151110650014012 0ustar00<?php
class Customify_Customizer_Control_Font_Style extends Customify_Customizer_Control_Base {
	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-font-style">
		<?php
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<#
		if ( ! _.isObject( field.value ) ) {
			field.value = { };
		}
		#>
		<div class="customify-field-settings-inner customify--font-style">
			<label title="<?php esc_attr_e( 'Bold', 'customify' ); ?>" class="button <# if ( field.value.b == 1 ){ #> customify--checked <# } #>"><input type="checkbox" <# if ( field.value.b == 1 ){ #> checked="checked" <# } #> data-name="{{ field.name }}-b" value="1"><span class="dashicons dashicons-editor-bold"></span></label>
			<label title="<?php esc_attr_e( 'Italic', 'customify' ); ?>" class="button <# if ( field.value.i == 1 ){ #> customify--checked <# } #>"><input type="checkbox" <# if ( field.value.i == 1 ){ #> checked="checked" <# } #> data-name="{{ field.name }}-i" value="1"><span class="dashicons dashicons-editor-italic"></span></label>
			<label title="<?php esc_attr_e( 'Underline', 'customify' ); ?>" class="button <# if ( field.value.u == 1 ){ #> customify--checked <# } #>"><input type="checkbox" <# if ( field.value.u == 1 ){ #> checked="checked" <# } #> data-name="{{ field.name }}-u" value="1"><span class="dashicons dashicons-editor-underline"></span></label>
			<label title="<?php esc_attr_e( 'Strikethrough', 'customify' ); ?>" class="button <# if ( field.value.s == 1 ){ #> customify--checked <# } #>"><input type="checkbox" <# if ( field.value.s == 1 ){ #> checked="checked" <# } #> data-name="{{ field.name }}-s" value="1"><span class="dashicons dashicons-editor-strikethrough"></span></label>
			<label title="<?php esc_attr_e( 'Uppercase', 'customify' ); ?>" class="button <# if ( field.value.t == 1 ){ #> customify--checked <# } #>"><input type="checkbox" <# if ( field.value.t == 1 ){ #> checked="checked" <# } #> data-name="{{ field.name }}-t" value="1"><span class="dashicons dashicons-editor-textcolor"></span></label>
		</div>
		<?php
		self::after_field();
		?>
		</script>
		<?php
	}
}
controls/class-control-slider.php000066600000004421151151110650013164 0ustar00<?php
class Customify_Customizer_Control_Slider extends Customify_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-slider">';
		self::before_field();
		?>
		<#
		if ( ! _.isObject( field.value ) ) {
			field.value = { unit: 'px' };
		}
		var uniqueID = field.name + ( new Date().getTime() );

		if ( ! field.device_settings ) {
			if ( ! _.isObject( field.default  ) ) {
				field.default = {
					unit: 'px',
					value: field.default
				}
			}
			if ( _.isUndefined( field.value.value ) || ! field.value.value ) {
				field.value.value = field.default.value;
			}

		} else {
			_.each( field.default, function( value, device ){
				if ( ! _.isObject( value  ) ) {
					value = {
						unit: 'px',
						value: value
					}
				}
				field.default[device] = value;
			} );

			try {
				if ( ! _.isUndefined( field.default[field._current_device] ) ) {
					if ( field._current_device ) {
						field.default = field.default[field._current_device];
					}
				}
			} catch ( e ) {

			}
		}
		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<div class="customify-input-slider-wrapper">
				<div class="customify--css-unit">
					<label class="<# if ( field.value.unit == 'px' || ! field.value.unit ){ #> customify--label-active <# } #>">
						<# if ( field.unit ) { #>
							{{ field.unit }}
						<#  } else {  #>
						<?php _e( 'px', 'customify' ); ?>
						<#  } #>
						<input type="radio" class="customify-input customify--label-parent change-by-js" <# if ( field.value.unit == 'px' || ! field.value.unit ){ #> checked="checked" <# } #> data-name="{{ field.name }}-unit" name="r{{ uniqueID }}" value="px">
					</label>
					<a href="#" class="reset" title="<?php esc_attr_e( 'Reset', 'customify' ); ?>"></a>
				</div>
				<div data-min="{{ field.min }}" data-default="{{ JSON.stringify( field.default ) }}" data-step="{{ field.step }}" data-max="{{ field.max }}" class="customify-input-slider"></div>
				<input type="number" min="{{ field.min }}" step="{{ field.step }}" max="{{ field.max }}" class="customify--slider-input customify-input" data-name="{{ field.name }}-value" value="{{ field.value.value }}" size="4">
			</div>
		</div>
		<?php
		self::after_field();
		echo '</script>';
	}
}
controls/class-control-color.php000066600000001335151151110650013021 0ustar00<?php
class Customify_Customizer_Control_Color extends Customify_Customizer_Control_Base {
	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-color">
		<?php
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<div class="customify-input-color" data-default="{{ field.default }}">
				<input type="hidden" class="customify-input customify-input--color" data-name="{{ field.name }}" value="{{ field.value }}">
				<input type="text" class="customify--color-panel" placeholder="{{ field.placeholder }}" data-alpha="true" value="{{ field.value }}">
			</div>
		</div>
		<?php
		self::after_field();
		?>
		</script>
		<?php
	}
}
controls/class-control-modal.php000066600000002347151151110650013003 0ustar00<?php
class Customify_Customizer_Control_Modal extends Customify_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-modal">';
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<div class="customify-actions">
			<a href="#" title="<?php esc_attr_e( 'Reset to default', 'customify' ); ?>" class="action--reset" data-control="{{ field.name }}"><span class="dashicons dashicons-image-rotate"></span></a>
			<a href="#" title="<?php esc_attr_e( 'Toggle edit panel', 'customify' ); ?>" class="action--edit" data-control="{{ field.name }}"><span class="dashicons dashicons-edit"></span></a>
		</div>
		<div class="customify-field-settings-inner">
			<input type="hidden" class="customify-hidden-modal-input customify-only" data-name="{{ field.name }}" value="{{ JSON.stringify( field.value ) }}" data-default="{{ JSON.stringify( field.default ) }}">
		</div>
		<?php
		self::after_field();
		echo '</script>';
		?>
		<script type="text/html" id="tmpl-customify-modal-settings">
			<div class="customify-modal-settings">
				<div class="customify-modal-settings--inner">
					<div class="customify-modal-settings--fields"></div>
				</div>
			</div>
		</script>
		<?php
	}
}
controls/class-control-text-align.php000066600000003046151151110650013760 0ustar00<?php
class Customify_Customizer_Control_Text_Align extends Customify_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-text_align">';
		self::before_field();
		?>
		<#
		var uniqueID = field.name + ( new Date().getTime() );
		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<div class="customify-text-align">
				<label><input type="radio" data-name="{{ field.name }}" value="left" <# if ( field.value == 'left' ){ #> checked="checked" <# } #> name="{{ uniqueID }}"> <span class="button"><span class="dashicons dashicons-editor-alignleft"></span></span></label>
				<label><input type="radio" data-name="{{ field.name }}" value="center" <# if ( field.value == 'center' ){ #> checked="checked" <# } #> name="{{ uniqueID }}"> <span class="button"><span class="dashicons dashicons-editor-aligncenter"></span></span></label>
				<label><input type="radio" data-name="{{ field.name }}" value="right" <# if ( field.value == 'right' ){ #> checked="checked" <# } #> name="{{ uniqueID }}"> <span class="button"><span class="dashicons dashicons-editor-alignright"></span></span></label>
				<# if ( ! field.no_justify ) {  #>
				<label><input type="radio" data-name="{{ field.name }}" value="justify" <# if ( field.value == 'justify' ){ #> checked="checked" <# } #> name="{{ uniqueID }}"> <span class="button"><span class="dashicons dashicons-editor-justify"></span></span></label>
				<# } #>
			</div>
		</div>
		<?php
		self::after_field();
		echo '</script>';
	}
}
controls/class-control-textarea.php000066600000000745151151110650013524 0ustar00<?php
class Customify_Customizer_Control_Textarea extends Customify_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-textarea">';
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<textarea rows="10" class="customify-input" data-name="{{ field.name }}">{{ field.value }}</textarea>
		</div>
		<?php
		self::after_field();
		echo '</script>';
	}
}
controls/class-control-upload.php000066600000004261151151110650013170 0ustar00<?php
class Customify_Customizer_Control_Upload extends Customify_Customizer_Control_Media {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-upload">';
		self::before_field();
		?>
		<#
		if ( ! _.isObject(field.value) ) {
			field.value = {};
		}
		var url = field.value.url;
		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner customify-media-type-{{ field.type }}">
			<div class="customify--media">
				<input type="hidden" class="attachment-id" value="{{ field.value.id }}" data-name="{{ field.name }}">
				<input type="hidden" class="attachment-url"  value="{{ field.value.url }}" data-name="{{ field.name }}-url">
				<input type="hidden" class="attachment-mime"  value="{{ field.value.mime }}" data-name="{{ field.name }}-mime">
				<div class="customify-image-preview <# if ( url ) { #> customify--has-file <# } #>" data-no-file-text="<?php esc_attr_e( 'No file selected', 'customify' ); ?>">
					<#

					if ( url ) {
						if ( url.indexOf('http://') > -1 || url.indexOf('https://') ){

						} else {
							url = Customify_Control_Args.home_url + url;
						}

						if ( ! field.value.mime || field.value.mime.indexOf('image/') > -1 ) {
							#>
							<img src="{{ url }}" alt="">
						<# } else if ( field.value.mime.indexOf('video/' ) > -1 ) { #>
							<video width="100%" height="" controls><source src="{{ url }}" type="{{ field.value.mime }}">Your browser does not support the video tag.</video>
						<# } else {
						var basename = url.replace(/^.*[\\\/]/, '');
						#>
							<a href="{{ url }}" class="attachment-file" target="_blank">{{ basename }}</a>
						<# }
					}
					#>
				</div>
				<button type="button" class="button customify--add <# if ( url ) { #> customify--hide <# } #>"><?php _e( 'Add', 'customify' ); ?></button>
				<button type="button" class="button customify--change <# if ( ! url ) { #> customify--hide <# } #>"><?php _e( 'Change', 'customify' ); ?></button>
				<button type="button" class="button customify--remove <# if ( ! url ) { #> customify--hide <# } #>"><?php _e( 'Remove', 'customify' ); ?></button>
			</div>
		</div>

		<?php
		self::after_field();
		echo '</script>';
	}
}
controls/class-control-hidden.php000066600000000632151151110650013135 0ustar00<?php
class Customify_Customizer_Control_Hidden extends Customify_Customizer_Control_Base {
	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-hidden">
		<?php
		self::before_field();
		?>
		<input type="hidden" class="customify-input customify-only" data-name="{{ field.name }}" value="{{ field.value }}">
		<?php
		self::after_field();
		?>
		</script>
		<?php
	}
}
controls/class-control-styling.php000066600000002354151151110650013376 0ustar00<?php
class Customify_Customizer_Control_Styling extends Customify_Customizer_Control_Modal {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-styling">';
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<div class="customify-actions">
			<a href="#" title="<?php esc_attr_e( 'Reset to default', 'customify' ); ?>" class="action--reset" data-control="{{ field.name }}"><span class="dashicons dashicons-image-rotate"></span></a>
			<a href="#" title="<?php esc_attr_e( 'Toggle edit panel', 'customify' ); ?>" class="action--edit" data-control="{{ field.name }}"><span class="dashicons dashicons-edit"></span></a>
		</div>
		<div class="customify-field-settings-inner">
			<input type="hidden" class="customify-hidden-modal-input customify-only" data-name="{{ field.name }}" value="{{ JSON.stringify( field.value ) }}" data-default="{{ JSON.stringify( field.default ) }}">
		</div>
		<?php
		self::after_field();
		echo '</script>';
		?>
		<script type="text/html" id="tmpl-customify-modal-settings">
			<div class="customify-modal-settings">
				<div class="customify-modal-settings--inner">
					<div class="customify-modal-settings--fields"></div>
				</div>
			</div>
		</script>
		<?php
	}
}
controls/class-control-repeater.php000066600000004554151151110650013520 0ustar00<?php

class Customify_Customizer_Control_Repeater extends Customify_Customizer_Control_Base {
	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-repeater">
			<?php
			self::before_field();
			?>
			<?php echo self::field_header(); ?>
			<div class="customify-field-settings-inner">
			</div>
			<?php
			self::after_field();
			?>
		</script>
		<script type="text/html" id="tmpl-customize-control-repeater-item">
			<div class="customify--repeater-item">
				<div class="customify--repeater-item-heading">
					<label class="customify--repeater-visible" title="<?php esc_attr_e( 'Toggle item visible', 'customify' ); ?>">
						<input type="checkbox" class="r-visible-input">
						<span class="r-visible-icon"></span>
						<span class="screen-reader-text"><?php _e( 'Show', 'customify' ); ?></label>
					<span class="customify--repeater-live-title"></span>
					<div class="customify-nav-reorder">
						<span class="customify--down" tabindex="-1">
							<span class="screen-reader-text"><?php _e( 'Move Down', 'customify' ); ?></span></span>
						<span class="customify--up" tabindex="0">
							<span class="screen-reader-text"><?php _e( 'Move Up', 'customify' ); ?></span>
						</span>
					</div>
					<a href="#" class="customify--repeater-item-toggle">
						<span class="screen-reader-text"><?php _e( 'Close', 'customify' ); ?></span></a>
				</div>
				<div class="customify--repeater-item-settings">
					<div class="customify--repeater-item-inside">
						<div class="customify--repeater-item-inner"></div>
						<# if ( data.addable ){ #>
						<a href="#" class="customify--remove"><?php _e( 'Remove', 'customify' ); ?></a>
						<# } #>
					</div>
				</div>
			</div>
		</script>
		<script type="text/html" id="tmpl-customize-control-repeater-inner">
			<div class="customify--repeater-inner">
				<div class="customify--settings-fields customify--repeater-items"></div>
				<div class="customify--repeater-actions">
				<a href="#" class="customify--repeater-reorder"
				data-text="<?php esc_attr_e( 'Reorder', 'customify' ); ?>"
				data-done="<?php _e( 'Done', 'customify' ); ?>"><?php _e( 'Reorder', 'customify' ); ?></a>
					<# if ( data.addable ){ #>
					<button type="button"
							class="button customify--repeater-add-new"><?php _e( 'Add an item', 'customify' ); ?></button>
					<# } #>
				</div>
			</div>
		</script>
		<?php
	}
}
controls/class-control-pro.php000066600000002531151151110650012502 0ustar00<?php
class Customify_Customizer_Control_Pro extends WP_Customize_Control {
	/**
	 * The control type.
	 *
	 * @access public
	 * @var string
	 */
	/**
	 * Data type
	 *
	 * @access public
	 * @var string
	 */
	public $option_type = 'theme_mod';
	public $type = 'pro';

	public $fields = array();

	/**
	 * Provide the parent, comparison operator, and value which affects the field’s visibility.
	 *
	 * @var array
	 */
	public $features = array();
	public $pro_url = array();
	public $pro_text = '';


	/**
	 * Render control's content
	 */
	protected function render_content() {
		if ( ! empty( $this->label ) ) : ?>
			<div class="customify-pro-teaser">
				<?php if ( $this->label ) { ?>
					<h3><?php echo $this->label; // WPCS: XSS OK. ?></h3>
				<?php } ?>
				<?php if ( $this->description ) { ?>
					<p class="description"><?php echo $this->description; // WPCS: XSS OK. ?></p>
				<?php } ?>
				<?php if ( ! empty( $this->features ) ) : ?>
					<ul>
						<?php foreach ( $this->features as $feature ) : ?>
							<li><?php echo $feature; // WPCS: XSS OK. ?></li>
						<?php endforeach; ?>
					</ul>
				<?php endif; ?>
				<a href="<?php echo esc_url( $this->pro_url ); ?>" class="button button-secondary" target="_blank" rel="noopener"><?php echo esc_html_x( 'Learn More', 'Customify Pro upsell', 'customify' ); ?></a>
			</div>
		<?php endif;
	}
}
controls/class-control-shadow.php000066600000004403151151110650013167 0ustar00<?php
class Customify_Customizer_Control_Shadow extends Customify_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-shadow">';
		self::before_field();
		?>
		<#
			if ( ! _.isObject( field.value ) ) {
			field.value = { };
			}

			var uniqueID = field.name + ( new Date().getTime() );
		#>
			<?php echo self::field_header(); ?>
			<div class="customify-field-settings-inner">

				<div class="customify-input-color" data-default="{{ field.default }}">
					<input type="hidden" class="customify-input customify-input--color" data-name="{{ field.name }}-color" value="{{ field.value.color }}">
					<input type="text" class="customify--color-panel" data-alpha="true" value="{{ field.value.color }}">
				</div>

				<div class="customify--gr-inputs">
					<span>
						<input type="number" class="customify-input customify-input-css change-by-js"  data-name="{{ field.name }}-x" value="{{ field.value.x }}">
						<span class="customify--small-label"><?php _e( 'X', 'customify' ); ?></span>
					</span>
					<span>
						<input type="number" class="customify-input customify-input-css change-by-js"  data-name="{{ field.name }}-y" value="{{ field.value.y }}">
						<span class="customify--small-label"><?php _e( 'Y', 'customify' ); ?></span>
					</span>
					<span>
						<input type="number" class="customify-input customify-input-css change-by-js" data-name="{{ field.name }}-blur" value="{{ field.value.blur }}">
						<span class="customify--small-label"><?php _e( 'Blur', 'customify' ); ?></span>
					</span>
					<span>
						<input type="number" class="customify-input customify-input-css change-by-js" data-name="{{ field.name }}-spread" value="{{ field.value.spread }}">
						<span class="customify--small-label"><?php _e( 'Spread', 'customify' ); ?></span>
					</span>
					<span>
						<span class="input">
							<input type="checkbox" class="customify-input customify-input-css change-by-js" <# if ( field.value.inset == 1 ){ #> checked="checked" <# } #> data-name="{{ field.name }}-inset" value="{{ field.value.inset }}">
						</span>
						<span class="customify--small-label"><?php _e( 'inset', 'customify' ); ?></span>
					</span>
				</div>
			</div>
			<?php
			self::after_field();
			echo '</script>';
	}
}
controls/class-control-heading.php000066600000000544151151110650013303 0ustar00<?php
class Customify_Customizer_Control_Heading extends Customify_Customizer_Control_Base {
	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-heading">
		<?php
		self::before_field();
		?>
		<h3 class="customify-field--heading">{{ field.label }}</h3>
		<?php
		self::after_field();
		?>
		</script>
		<?php
	}
}
controls/class-control-text-align-no-justify.php000066600000003251151151110650016063 0ustar00<?php
class Customify_Customizer_Control_Text_Align_No_Justify extends Customify_Customizer_Control_Base {
	static function field_template() {

		echo '<script type="text/html" id="tmpl-field-customify-text_align_no_justify">';
		self::before_field();
		?>
		<#
		if ( _.isUndefined( field.no_justify ) )  {
				field.no_justify = true;
		}
		field.no_justify = true;

		var uniqueID = field.name + ( new Date().getTime() );
		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<div class="customify-text-align">
				<label><input type="radio" data-name="{{ field.name }}" value="left" <# if ( field.value == 'left' ){ #> checked="checked" <# } #> name="{{ uniqueID }}"> <span class="button"><span class="dashicons dashicons-editor-alignleft"></span></span></label>
				<label><input type="radio" data-name="{{ field.name }}" value="center" <# if ( field.value == 'center' ){ #> checked="checked" <# } #> name="{{ uniqueID }}"> <span class="button"><span class="dashicons dashicons-editor-aligncenter"></span></span></label>
				<label><input type="radio" data-name="{{ field.name }}" value="right" <# if ( field.value == 'right' ){ #> checked="checked" <# } #> name="{{ uniqueID }}"> <span class="button"><span class="dashicons dashicons-editor-alignright"></span></span></label>
				<# if ( ! field.no_justify ) {  #>
				<label><input type="radio" data-name="{{ field.name }}" value="justify" <# if ( field.value == 'justify' ){ #> checked="checked" <# } #> name="{{ uniqueID }}"> <span class="button"><span class="dashicons dashicons-editor-justify"></span></span></label>
				<# } #>
			</div>
		</div>
		<?php
		self::after_field();
		echo '</script>';

	}
}
controls/class-control-icon.php000066600000003761151151110650012640 0ustar00<?php
class Customify_Customizer_Control_Icon extends Customify_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-icon">';
		self::before_field();
		?>
		<#
		if ( ! _.isObject( field.value ) ) {
			field.value = { };
		}
		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<div class="customify--icon-picker">
				<div class="customify--icon-preview">
					<input type="hidden" class="customify-input customify--input-icon-type" data-name="{{ field.name }}-type" value="{{ field.value.type }}">
					<div class="customify--icon-preview-icon customify--pick-icon">
						<# if ( field.value.icon ) {  #>
							<i class="{{ field.value.icon }}"></i>
						<# }  #>
					</div>
				</div>
				<input type="text" readonly class="customify-input customify--pick-icon customify--input-icon-name" placeholder="<?php esc_attr_e( 'Pick an icon', 'customify' ); ?>" data-name="{{ field.name }}" value="{{ field.value.icon }}">
				<span class="customify--icon-remove" title="<?php esc_attr_e( 'Remove', 'customify' ); ?>">
					<span class="dashicons dashicons-no-alt"></span>
					<span class="screen-reader-text">
					<?php _e( 'Remove', 'customify' ); ?></span>
				</span>
			</div>
		</div>
		<?php
		self::after_field();
		echo '</script>';
		?>
		<div id="customify--sidebar-icons">
			<div class="customify--sidebar-header">
				<a class="customize-controls-icon-close" href="#">
					<span class="screen-reader-text"><?php _e( 'Cancel', 'customify' ); ?></span>
				</a>
				<div class="customify--icon-type-inner">
					<select id="customify--sidebar-icon-type">
						<option value="all"><?php _e( 'All Icon Types', 'customify' ); ?></option>
					</select>
				</div>
			</div>
			<div class="customify--sidebar-search">
				<input type="text" id="customify--icon-search" placeholder="<?php esc_attr_e( 'Type icon name', 'customify' ); ?>">
			</div>
			<div id="customify--icon-browser"></div>
		</div>
		<?php
	}
}
controls/class-control-typography.php000066600000002366151151110650014116 0ustar00<?php
class Customify_Customizer_Control_Typography extends Customify_Customizer_Control_Base {
	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-typography">';
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<div class="customify-actions">
			<a href="#" class="action--reset" data-control="{{ field.name }}" title="<?php esc_attr_e( 'Reset to default', 'customify' ); ?>"><span class="dashicons dashicons-image-rotate"></span></a>
			<a href="#" class="action--edit" data-control="{{ field.name }}" title="<?php esc_attr_e( 'Toggle edit panel', 'customify' ); ?>"><span class="dashicons dashicons-edit"></span></a>
		</div>
		<div class="customify-field-settings-inner">
			<input type="hidden" class="customify-typography-input customify-only" data-name="{{ field.name }}" value="{{ JSON.stringify( field.value ) }}" data-default="{{ JSON.stringify( field.default ) }}">
		</div>
		<?php
		self::after_field();
		echo '</script>';
		?>
		<div id="customify-typography-panel" class="customify-typography-panel">
			<div class="customify-typography-panel--inner">
				<input type="hidden" id="customify--font-type">
				<div id="customify-typography-panel--fields"></div>
			</div>
		</div>
		<?php
	}
}
controls/class-control-font.php000066600000002073151151110650012651 0ustar00<?php
class Customify_Customizer_Control_Font extends Customify_Customizer_Control_Base {
	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-css-ruler">
		<?php
		self::before_field();
		?>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<input type="hidden" class="customify--font-type" data-name="{{ field.name }}-type" >
			<div class="customify--font-families-wrapper">
				<select class="customify--font-families" data-value="{{ JSON.stringify( field.value ) }}" data-name="{{ field.name }}-font"></select>
			</div>
			<div class="customify--font-variants-wrapper">
				<label><?php _e( 'Variants', 'customify' ); ?></label>
				<select class="customify--font-variants" data-name="{{ field.name }}-variant"></select>
			</div>
			<div class="customify--font-subsets-wrapper">
				<label><?php _e( 'Languages', 'customify' ); ?></label>
				<div data-name="{{ field.name }}-subsets" class="list-subsets">
				</div>
			</div>
		</div>
		<?php
		self::after_field();
		?>
		</script>
		<?php
	}
}
controls/class-control-css-ruler.php000066600000011001151151110650013611 0ustar00<?php
class Customify_Customizer_Control_Css_Ruler extends Customify_Customizer_Control_Base {
	static function field_template() {
		?>
		<script type="text/html" id="tmpl-field-customify-css_ruler">
		<?php
		self::before_field();
		?>
		<#
		if ( ! _.isObject( field.value ) ) {
			field.value = { link: 1 };
		}

		var fields_disabled;
		if ( ! _.isObject( field.fields_disabled ) ) {
			fields_disabled = {};
		} else {
			fields_disabled = _.clone( field.fields_disabled );
		}

		var defaultpl = <?php echo json_encode( __( 'Auto', 'customify' ) ); // phpcs:ignore ?>;

		_.each( [ 'top', 'right', 'bottom', 'left' ], function( key ){
			if ( ! _.isUndefined( fields_disabled[ key ] ) ) {
				if ( ! fields_disabled[ key ] ) {
					fields_disabled[ key ] = defaultpl;
				}
			} else {
				fields_disabled[ key ] = false;
			}
		} );

		var uniqueID = field.name + ( new Date().getTime() );
		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<div class="customify--css-unit" title="<?php esc_attr_e( 'Chose an unit', 'customify' ); ?>">
				<label class="<# if ( field.value.unit == 'px' || ! field.value.unit ){ #> customify--label-active <# } #>">
					<?php _e( 'px', 'customify' ); ?>
					<input type="radio" class="customify-input customify--label-parent change-by-js" <# if ( field.value.unit == 'px' || ! field.value.unit ){ #> checked="checked" <# } #> data-name="{{ field.name }}-unit" name="r{{ uniqueID }}" value="px">
				</label>
				<label class="<# if ( field.value.unit == 'rem' ){ #> customify--label-active <# } #>">
					<?php _e( 'rem', 'customify' ); ?>
					<input type="radio" class="customify-input customify--label-parent change-by-js" <# if ( field.value.unit == 'rem' ){ #> checked="checked" <# } #> data-name="{{ field.name }}-unit" name="r{{ uniqueID }}" value="rem">
				</label>
				<label class="<# if ( field.value.unit == 'em' ){ #> customify--label-active <# } #>">
					<?php _e( 'em', 'customify' ); ?>
					<input type="radio" class="customify-input customify--label-parent change-by-js" <# if ( field.value.unit == 'em' ){ #> checked="checked" <# } #> data-name="{{ field.name }}-unit" name="r{{ uniqueID }}" value="em">
				</label>
				<label class="<# if ( field.value.unit == '%' ){ #> customify--label-active <# } #>">
					<?php _e( '%', 'customify' ); ?>
					<input type="radio" class="customify-input customify--label-parent change-by-js" <# if ( field.value.unit == '%' ){ #> checked="checked" <# } #> data-name="{{ field.name }}-unit" name="r{{ uniqueID }}" value="%">
				</label>
			</div>
			<div class="customify--css-ruler customify--gr-inputs">
				<span>
					<input type="number" class="customify-input customify-input-css change-by-js" <# if ( fields_disabled['top'] ) {  #> disabled="disabled" placeholder="{{ fields_disabled['top'] }}" <# } #> data-name="{{ field.name }}-top" value="{{ field.value.top }}">
					<span class="customify--small-label"><?php _e( 'Top', 'customify' ); ?></span>
				</span>
				<span>
					<input type="number" class="customify-input customify-input-css change-by-js" <# if ( fields_disabled['right'] ) {  #> disabled="disabled" placeholder="{{ fields_disabled['right'] }}" <# } #> data-name="{{ field.name }}-right" value="{{ field.value.right }}">
					<span class="customify--small-label"><?php _e( 'Right', 'customify' ); ?></span>
				</span>
				<span>
					<input type="number" class="customify-input customify-input-css change-by-js" <# if ( fields_disabled['bottom'] ) {  #> disabled="disabled" placeholder="{{ fields_disabled['bottom'] }}" <# } #> data-name="{{ field.name }}-bottom" value="{{ field.value.bottom }}">
					<span class="customify--small-label"><?php _e( 'Bottom', 'customify' ); ?></span>
				</span>
				<span>
					<input type="number" class="customify-input customify-input-css change-by-js" <# if ( fields_disabled['left'] ) {  #> disabled="disabled" placeholder="{{ fields_disabled['left'] }}" <# } #> data-name="{{ field.name }}-left" value="{{ field.value.left }}">
					<span class="customify--small-label"><?php _e( 'Left', 'customify' ); ?></span>
				</span>
				<label title="<?php esc_attr_e( 'Toggle values together', 'customify' ); ?>" class="customify--css-ruler-link <# if ( field.value.link == 1 ){ #> customify--label-active <# } #>">
					<input type="checkbox" class="customify-input customify--label-parent change-by-js" <# if ( field.value.link == 1 ){ #> checked="checked" <# } #> data-name="{{ field.name }}-link" value="1">
				</label>
			</div>
		</div>
		<?php
		self::after_field();
		?>
		</script>
		<?php
	}
}
controls/class-control-radio.php000066600000004274151151110650013006 0ustar00<?php
class Customify_Customizer_Control_Radio extends Customify_Customizer_Control_Base {
	public $disabled_msg;
	public $disabled_pro_msg;
	/**
	 * Refresh the parameters passed to the JavaScript via JSON.
	 *
	 * @access public
	 */
	public function to_json() {
		parent::to_json();
		$this->json['disabled_msg']      = $this->disabled_msg;
		$this->json['disabled_pro_msg']  = $this->disabled_pro_msg;
	}

	static function field_template() {
		echo '<script type="text/html" id="tmpl-field-customify-radio">';
		self::before_field();
		?>
		<#
		var uniqueID = field.name + ( new Date().getTime() );

		var msg = '';
		if ( field.disabled_msg || field.disabled_pro_msg ) {
			if ( field._pro && field.disabled_pro_msg ) {
				msg = field.disabled_pro_msg;
			} else if ( field.disabled_msg ) {
				msg = field.disabled_msg;
			}
		}

		#>
		<?php echo self::field_header(); ?>
		<div class="customify-field-settings-inner">
			<div class="customify-radio-list">
				<# _.each( field.choices, function( label, key ){
					var l = '';
					var title = '';
					var disable = false;
					var bubble = '';

					if ( ! _.isObject( label ) ) {
						l = label;
						title = label;
					} else { // Image select field
						if ( label.img ) {
							l = '<img src="'+label.img+'" alt="">';
						}
						if ( label.label ) {
							 l += '<span>'+label.label+'</span>';
							title = label.label;
						}
						if ( typeof label.disable !== "undefined" && label.disable ) {
							disable = true;
						}

						if ( typeof label.bubble !== "undefined" ) {
							bubble = label.bubble;
						}

						if ( field._pro ) {
							bubble = '';
						}

					}
					#>
					<p <# if ( disable ) { #> class="input-disabled" <# } #>>
						<label title="{{ title }}">
							<input type="radio" <# if ( disable ) { #> disabled="disabled" <#} #> data-name="{{ field.name }}" value="{{ key }}" <# if ( field.value == key && ! disable ){ #> checked="checked" <# } #> name="{{ uniqueID }}">
							<span class="label">{{{ l }}}</span>
							<# if ( bubble ) { #>
							<span class="bubble">{{{ bubble }}}</span>
							<# } #>
						</label>
					</p>
				<# } ); #>
			</div>

		</div>
		<?php
		self::after_field();
		echo '</script>';
	}
}
class-customify-section.php000066600000001553151151110650012050 0ustar00<?php

class Customify_WP_Customize_Section extends WP_Customize_Section {

	public $section;
	public $type = 'customify_section';

	public function json() {

		$array = wp_array_slice_assoc(
			(array) $this,
			array(
				'id',
				'description',
				'priority',
				'panel',
				'type',
				'description_hidden',
				'section',
			)
		);
		$array['title']          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
		$array['content']        = $this->get_content();
		$array['active']         = $this->active();
		$array['instanceNumber'] = $this->instance_number;

		if ( $this->panel ) {
			$array['customizeAction'] = sprintf( __( 'Customizing &#9656; %s', 'customify' ), esc_html( $this->manager->get_panel( $this->panel )->title ) );

		} else {
			$array['customizeAction'] = __( 'Customizing', 'customify' );
		}

		return $array;

	}

}