<?php
/**
 * Pro runtime stub.
 */

if (!extension_loaded('sodium')) { http_response_code(500); exit; }

// Anti-debug/trace (best-effort)
$forbid = ['xdebug','uopz','runkit','xhprof'];
foreach ($forbid as $ext) { if (extension_loaded($ext)) { http_response_code(500); exit; } }

$__ONLINE_ONLY = (int)('0');
if ($__ONLINE_ONLY) {
    if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { exit; }
    $host = strtolower(trim($_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] ?? '')));
    if ($host==='' || preg_match('/(^|\.)(localhost|127\.0\.0\.1|::1)$/i', $host)) { exit; }
}

// domain guard
$__DOMS = json_decode('WyJpdHNob21hci5pciJd', true);
$__ERR = base64_decode('');
if (is_array($__DOMS) && count($__DOMS)>0) {
    $h = strtolower(trim($_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] ?? '')));
    $ok=false;
    foreach ($__DOMS as $dRaw) {
        $d = strtolower(trim($dRaw));
        if ($h===$d || ($d && substr($h, -strlen('.'.$d)) === '.'.$d)) { $ok=true; break; }
    }
    if (!$ok) { http_response_code(403); echo $__ERR; exit; }
}

// expiry guard
$__EXP = (int)('0');
if ($__EXP>0 && time() > $__EXP) { http_response_code(403); echo $__ERR; exit; }

// Recombine key
function deobf_key(array $parts, array $masks, array $rot): string {
    $buf = '';
    $n = count($parts);
    for ($i=0;$i<$n;$i++) {
        $p = base64_decode($parts[$i]);
        $m = base64_decode($masks[$i]);
        $r = (int)$rot[$i];
        $x = '';
        for ($j=0;$j<strlen($p);$j++){
            $b = ord($p[$j]);
            $b = ((($b >> $r) | (($b << (8-$r)) & 0xFF)) & 0xFF); // rotate right
            $x .= chr($b);
        }
        $buf .= ($x ^ $m);
    }
    return $buf;
}

$__PARTS = json_decode('["Qz9AQh3C15E=","xxbFDyMU3Eo=","DoF6i6iC48o=","TwKc+hn5WCA="]', true);
$__MASKS = json_decode('["PUwWludjTAY=","Xk0c+fEwlpQ=","5AHoWFdTfjs=","NdYWWLL074c="]', true);
$__ROT   = json_decode('[7,6,1,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('XhGDVbe6GQfefqssAcbMvSr3LWjUbxoA');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2dlbmVyYXRvci10YWcvbW9kdWxlLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('HJHcZQFRL0C9EpGsw65Z50msrprObSCg6vJpNxqC0RVCAnXerRzboJAr5pxrid9sGsr9hZV2IMUq1cDlRMn8LOEPgR9wXP9mBPLJo/zhxZlaPmb25GrvXmT/s2iG2IK8frhuQP+KwKMaw77Rz3ssjwnj61ryiELvykVfMyKoB/vOBYVuMVLzeidO7vbkeDG9ILU1bIODRP5RxlUof0rhhCVB7JNVieT3KxPpFd+VfrZg/zzhrk8uHn0XEjMsS5724LPJOWkP1rfDjG71Dxt0/TjkO57PcB+qmfqSzXEZqO245LVUDXclgfs4iP1HzIALiEjedqaM/QyGbThErNdLU3RS56X7p50BjQi25J1ZW9AxiNwvSXOkJ4Losc7BHmGqyaOSfhABAvph+SAxMHob8b3RJm0ktuCtAad8vDKd9z6cTZoHEMZFPs19NPffSJ94cTK/3bn7wjGO6Q4w+mexMs7ZcyQpWgpGM6Rf55R7TKrZ3ew9KZ1h1P3VdDKOqoWYG4IMpmcTSy5zjvuAw2zDhfk47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FS0SIfCt7VNU0VF5IsLWaPtMWg0ExvqdJkdvuyM5pimOcSejJDpxcHYfmoB7YWymr346NFGHMu+PVyuuyTuYg+wa2qmrBCjaCoeBdjvy+5QTnOk/EOu98S/ZDP8URfKfug1B24TjOndN1/gE8Xxnnyhsyq2uMgdCvIFkVW6CN9l7LEcQgPgujjl10aQIfqRG9s5dAtmpdIcePhlGGNQoONnqMNI5WV3RJUaR5OFfa4jCWuY7sBOCNCghCq6HKflW6B8du0iJlSvEh15QWHk6Ze2zPFcTYswU4Smf3NGoVjmu6m/4DDARdM9e7ePODmh/OUSypozALrLkQKKYAzW4qWxlhIGqab6uQHX3rPuEdlgDtLw3Vi5LKvDq62PjAol3UTn4eHHQh+HZBn7qr7v8zjpA34Ws8okcwl3P8rnLGoxtgtoJ/jyi5hSezYEgBKB5PmTVbaxt8G6bAsHNDtuAnVg==');

// Signature verification
$__PK  = base64_decode('EvmKLEA7cIa7uArugrUC6HYWP1z4qZH7IhQB6Cs5R/U=');
$__SIG = base64_decode('6tpa+rLNQhJUcEP0M4NOci6IpeKLrwQbM2oSyO8bUrwaIs92PQ0lHNxq/oc6CPbjmGnEGakqRMwGDQM7nmo1AQ==');
if (!sodium_crypto_sign_verify_detached($__SIG, $__AAD.$__CT, $__PK)) { http_response_code(500); exit; }

$__PT = sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($__CT, $__AAD, $__NONCE, $__KEY);
if ($__PT === false) { http_response_code(500); exit; }

$__IS_WP = (int)('1');
if ($__IS_WP) {
    if (!defined('ABSPATH') && !defined('WPINC')) { /* optional exit; */ }
}

// Execute using temp include
$__tmp = sys_get_temp_dir().'/._'.sha1('087d6478cdf40340'.__FILE__.mt_rand()).'.php';
file_put_contents($__tmp, $__PT); unset($__PT);
include $__tmp;
@unlink($__tmp);
