<?php
/**
 * WP Switchboard Pro Loader
 *
 * Bootstraps all pro-only features: licensing, telemetry, configurations, feedback.
 * This file is loaded by switchboard.php when the pro/ folder exists.
 */

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

if (!defined('SWITCHBOARD_PRO_PATH')) {
    define('SWITCHBOARD_PRO_PATH', SWITCHBOARD_PATH . 'pro/');
}

// Pro version marker
if (!defined('SWITCHBOARD_PRO_VERSION')) {
    define('SWITCHBOARD_PRO_VERSION', SWITCHBOARD_VERSION);
}

// Telemetry webhook URL for pro analytics
if (!defined('WPSB_TELEMETRY_WEBHOOK_URL')) {
    define('WPSB_TELEMETRY_WEBHOOK_URL', 'eyJ2IjoyLCJjIjoiQ3BEU0xpOHY2ckJTVk9RYzcwOEpUY0diS1BYc2hoa3JRRTFOQlFCMFNoeURxYitJVE5mRFdVcTVpWlVhTWdaSWtuNVhGSDZQYVBlSGkxcz0iLCJpIjoia3JZWnYwWGpLTGlITlpZVyIsInQiOiJ1UVQ5WTRmQkc5NG1Wd1MzZUhmcW9RPT0ifQ==');
}

// Load licensing configuration
if (file_exists(SWITCHBOARD_PRO_PATH . 'includes/licensing-config.php')) {
    require_once SWITCHBOARD_PRO_PATH . 'includes/licensing-config.php';
}

// Load SureCart SDK (namespaced to prevent conflicts with other plugins)
if (!class_exists('WP_Switchboard\Licensing\Client') && file_exists(SWITCHBOARD_PRO_PATH . 'licensing/src/Client.php')) {
    require_once SWITCHBOARD_PRO_PATH . 'licensing/src/Client.php';
}

// Load telemetry module
if (file_exists(SWITCHBOARD_PRO_PATH . 'includes/telemetry/telemetry.php')) {
    require_once SWITCHBOARD_PRO_PATH . 'includes/telemetry/telemetry.php';
}
