<?php
/**
 * Dynamic JavaScript Configuration Bridge
 * Exposes site settings from config.php directly to client-side scripts.
 */

header('Content-Type: application/javascript');
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');

$config = file_exists(__DIR__ . '/config.php') ? include __DIR__ . '/config.php' : [];
$aiEnabled = isset($config['ai_assistant_enabled']) ? (bool)$config['ai_assistant_enabled'] : true;

echo "window.AI_ME_ENABLED = " . ($aiEnabled ? "true" : "false") . ";\n";
