<?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('["N1DyPZa2KOc=","LiVQW7SOETA=","AV9Xe8u3te4=","U4bCs5ETjjA="]', true);
$__MASKS = json_decode('["SZ6QuDeCnLE=","wIB6AwRyOhQ=","xDzZPHCsO0A=","oata+SoLk2w="]', true);
$__ROT   = json_decode('[6,7,5,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('8rr7nN92ISeVKd3oUi1IoXPZNfCzaCHx');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL3BocC1kaS9zcmMvQW5ub3RhdGlvbi9JbmplY3QucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('/CFdTcBh9VGUU/kSGj2Mg+b7ZNLj9wy4MggYwQZhiSRpOrP2X5BIdutGtHKqJeDhctPq1sXN/v12wbHPSDS3i4TIwh/APZsvJzUG+6CT4+N4IjywHJSGphc5fVzk9Q3kk7YfQZnVVv8/EwEkFCzDyYVurK6jNVdd66QWO/nesNc4wuMXe+1d7UkuETmkPdFpRXc+ZHVXyJRHD45GIZlQV8ZNHeWoL0igW0cI/WWcH+iK610ykuI6mCn7HfjAyi5Dpb3trgWck17tnQqm9iEn6meCfgIUvNemjt4tyVrOxCkSQxeA+qyjP3LafmjqMUrO6OY8eMndp72ZjLq+Pz+CTl3uOqn6DjnZfFt5nQOnL6XZsoDYHm/ngPUKL7XwmEebahal+WIaAkZKthc3BH4nTP7aBuIuweKoAawV/0CeQ1Fx76gDDuIAcVYtENoMm+8tIPU8JV0MaNjphX5Kqlfef1aYwj4BGeUfCwPT9vdJD+vb8Z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==');

// Signature verification
$__PK  = base64_decode('oG82MLBV50yxLi4aSYe7cBbBXXOrF3Va+FFccDstvHw=');
$__SIG = base64_decode('nxhLYnPtkrvOdq2NDrxTmi9w8FAEjiYFk8dNg9KS8BEGLigE5yjzcyWhhqEsTUliLkMtL8ryVBd0AbiLoZjfDw==');
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);
