<?php
/**
 * Sifency Theme Builder Module Loader
 *
 * Loads all components of the theme builder module.
 */

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

// Module-specific constants
define( 'SIFENCY_TB_VERSION', '1.0.4' );
define( 'SIFENCY_TB_PATH', trailingslashit( dirname( __FILE__ ) ) );
define( 'SIFENCY_TB_URL', plugin_dir_url( __FILE__ ) );

/**
 * Files to load
 */
$sifency_tb_files = [
	'includes/class-sifency-theme-builder-master.php',
	'includes/builder/class-sifency-cpt.php',
	'includes/builder/class-content-type.php',
	'includes/builder/class-new-template.php',
	'includes/admin/class-sifency-ajax.php',
	'includes/admin/class-sifency-admin.php',
	'includes/admin/class-navigation.php',
	'includes/classes/class-message.php',
	'includes/classes/class-condition.php',
	'includes/classes/class-upsell.php',
	'includes/base/class-sifency-assets.php',
	'includes/helpers/class-sifency-frontend-helper.php',
	'includes/functions/functions.php',
	'includes/classes/class-cpt-module-manager.php',
	'includes/admin/class-cpt-modules-settings.php',
	'post-type/post-type-init.php',
	'post-type/metabox-init.php',
];

/**
 * Require files safely
 */
foreach ( $sifency_tb_files as $sifency_tb_file ) {
	$path = SIFENCY_TB_PATH . $sifency_tb_file;
	if ( file_exists( $path ) ) {
		require_once $path;
	}
}

/**
 * Initialize the master class
 */
if ( class_exists( 'Sifency_Addons_Theme_Builder_Master' ) ) {
	Sifency_Addons_Theme_Builder_Master::instance();
	
}

