<?php

declare(strict_types=1);

require_once dirname(__DIR__) . '/_app_guard.php';
require_once dirname(__DIR__) . '/_app_theme_store.php';
app_guard_validate();

header('Content-Type: application/json; charset=utf-8');
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('X-Content-Type-Options: nosniff');

$theme = app_theme_store_load();

echo json_encode([
    'ok' => true,
    'status' => 'success',
    'theme' => 'remote_app_color',
    'theme_name' => 'remote_app_color',
    'supported_themes' => ['remote_app_color'],
    'updated' => true,
    'locked' => false,
    'accent_color' => $theme['accent_color'],
    'app_color' => $theme['accent_color'],
    'color' => $theme['accent_color'],
    'border_color' => $theme['border_color'],
    'button_color' => $theme['button_color'],
    'focus_color' => $theme['focus_color'],
    'text_on_accent' => $theme['text_on_accent'],
    'button_opacity' => $theme['button_opacity'],
    'button_pressed_opacity' => $theme['button_pressed_opacity'],
    'button_pill_opacity' => $theme['button_pill_opacity'],
    'button_transparency_mode' => $theme['button_transparency_mode'],
    'updated_at' => $theme['updated_at'],
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
