<?php

if ( !defined( 'ABSPATH' ) ) exit;

if ( !defined( 'GREYD_CLASSIC_VERSION' ) ) {
	define( 'GREYD_CLASSIC_VERSION', '1.8.2' );
}

// config vars
$config = (object)array(
    'theme_name_full' => "GREYD.SUITE (Review)",
    'theme_name'      => "greyd_suite",
    'theme_file'      => __FILE__,
    'theme_version'   => "1.8.2",
    'update_file'     => 'https://update.greyd.io/review/themes/greyd_suite/metadata.json',
    'required_versions' => array(
        'greyd_hub' => '1.6.0',
        'greyd_forms' => '1.6.0',
        'greyd_blocks' => '1.6.0',
    )
);

// add version infos to 'greyd_versions' filter
add_filter( 'greyd_versions', function($versions) use($config) {
    $theme = is_child_theme() ? wp_get_theme(get_template()) : wp_get_theme();
    $versions[$theme->get_stylesheet()] = array(
        'version' => $theme->exists() ? $theme->get( 'Version' ) : '0',
        'required' => $config->required_versions
    );
    return $versions;
} );

// libraries
require get_template_directory().'/libs/class-tgm-plugin-activation.php';
require get_template_directory().'/inc/vc/helper.php';
require get_template_directory().'/inc/vc/helper_sc.php';
require get_template_directory().'/inc/vc/shortcode.php';
require get_template_directory().'/inc/vc/maps/maps.php';
require get_template_directory().'/inc/modules/posts.php';
// basic setup
require get_template_directory().'/inc/basics.php';
/**
 * starter content class moved from plugin to theme
 */
if ( !class_exists("starter") ) {
	// debug("starter not found in plugin");
	require get_template_directory().'/inc/starter.php';
}
require get_template_directory().'/inc/enqueue.php';
require get_template_directory().'/inc/strings.php';
require get_template_directory().'/inc/controls.php';
// basic features
require get_template_directory().'/inc/processor.php';
require get_template_directory().'/inc/navigation/init.php';
require get_template_directory().'/inc/modules/announcement.php';
require get_template_directory().'/inc/modules/compatibility.php';
require get_template_directory().'/inc/customizer.php';
// features
if ( !class_exists("Greyd\Dynamic\Admin") ) {
    require get_template_directory().'/inc/deprecated/dynamic.php';
} else {
    require get_template_directory().'/inc/deprecated/dynamic-dummy.php';
}
/**
 * if v2 popups exist in Hub or Plugin,
 * don't load this class and enqueued scripts/styles.
 */
if ( !class_exists("Greyd\Popups\Admin" )) {
	// debug("load deprecated popups");
	require get_template_directory().'/inc/deprecated/popups.php';
}
require get_template_directory().'/inc/deprecated/url_handler.php';
require get_template_directory().'/inc/modules/global_content.php';
if (defined( 'WP_INSTALLING' ) && WP_INSTALLING) return;
// vc basics
require get_template_directory().'/inc/vc/icons.php';
require get_template_directory().'/inc/vc/defaults.php';
require get_template_directory().'/inc/deprecated/search.php';
require get_template_directory().'/inc/vc/composer.php';
require get_template_directory().'/inc/vc/editor.php';
// plugin extension
require get_template_directory().'/extensions/woocommerce/manage.php';