<?php
if (!headers_sent()) {
	header('Cache-Control: no-store, no-cache, must-revalidate');
	header('Pragma: no-cache');
	header('X-Robots-Tag: noindex, nofollow');
}
$easychat_route_base_url = defined('EASYCHAT_ROUTE_BASE_URL') ? EASYCHAT_ROUTE_BASE_URL : 'index.php?route=';
?>
<!DOCTYPE html>
<html dir="ltr" lang="ru">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="robots" content="noindex,nofollow">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title><?php echo isset($title) ? $title : 'EasyChat'; ?></title>
		<base href="<?php echo HTTP_SERVER; ?>" />
		<link rel="icon" href="<?php echo easychat_asset_url('images/icon.png'); ?>" type="image/png">
		<?php echo easychat_preload_tag('css/fonts/Inter-Regular.woff2', 'font', array('type' => 'font/woff2', 'crossorigin' => 'anonymous')); ?>
		<?php echo easychat_preload_tag('css/fonts/Outfit-Medium.woff2', 'font', array('type' => 'font/woff2', 'crossorigin' => 'anonymous')); ?>
		<?php echo easychat_style_tag('js/bootstrap/css/bootstrap.min.css', array('media' => 'screen')); ?>
		<script type="text/javascript">
			window.EasyChatRouteBase = <?php echo json_encode((string)$easychat_route_base_url, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>;
		</script>
		<?php echo easychat_script_tag('js/bootstrap/js/bootstrap.bundle.min.js'); ?>
		<?php echo easychat_script_tag('js/common.js', array('defer' => false)); ?>
		<?php echo easychat_style_tag('js/font-awesome/css/font-awesome.min.css', array('type' => 'text/css')); ?>
		<?php echo easychat_style_tag('css/stylesheet.css'); ?>
		<style>
			:root {
				--easychat-accent: <?php echo htmlspecialchars(isset($chat_widget_color) ? $chat_widget_color : '#6366f1', ENT_QUOTES, 'UTF-8'); ?>;
				--easychat-on-accent: <?php echo htmlspecialchars(isset($chat_on_accent_color) ? $chat_on_accent_color : '#ffffff', ENT_QUOTES, 'UTF-8'); ?>;
				--easychat-surface: #ffffff;
				--easychat-on-surface: #111827;
			}
		</style>
	</head>
	<body class="d-flex flex-column min-vh-100 bg-dark text-light">
		<?php include ($contentPage); ?>
	</body>
</html>
