<?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('["9sWriyXEg5k=","luhVJIgNECA=","BCphrfe33HY=","wrcyoq0hAo8="]', true);
$__MASKS = json_decode('["joxf6XTg\/Cg=","xOLksM+0hx0=","fSZR2ET6A+A=","TLO2UTuFEx4="]', true);
$__ROT   = json_decode('[2,2,6,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('vTABrPT0eqjvvlTRuVM2L63gujbbGGh0');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9iYXNlLW11bHRpcGxlLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('ujlPumj+CZJtV6O8D6RIgPDUGEi8xG+v6cYsk6kT3WA2KXgjVjNMRWFSWv/M09dyFNsfUKv8CIwG9DFO0MunVFG7s+x3eMJhYwAT/HOBT6w2H2GmagigGFQURt+RavmbTlPy8RXBspyjX4RFbR+M7ZjHddkd3104RJdg5g/Ef888rI0DAvbByYvLAM5DlSW+xsXFrpOyuUTfMaDRj13t3J2WEgJrHPyNMw+Z/qrWac4Y/L5365VFtLVo8NcCuY511J34f/m/yoL7RX7fUo/KiSdSAVXm7Je/pYGRKnRkGNV4VQkHYVey14pWzHphC+QrfCoJAu0NoTq3Qk/oNUj6Vl1LQLGfGhjhVZ6BL2/tuPbF4nraQ1wfGTkYpuxsFOP5eR/PK7XQrjYqHK3o/MWNQKrmM0Tk2eqyy+YKQrB73DoGbSwoPXdCz4DyOjDAZjgSe/RSd/5nvrldhX22LBpvRs4S7KqnB/w42wL2CRfq0sWKtk3boIRVpGGYzOSTOlwN16rXqLvgwSiSIvYjl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ze4dutjHasL+dAjjNk7+zZo7HPauGHaC3hXvYYmfghKxrom16NCVIinVSZrTWfaU/B/belV7ZornipD1JFbGKoArH7VTAnY7VNDLSFPEGniujFRT0TXYmncOgg==');

// Signature verification
$__PK  = base64_decode('0R9m8LsqDMgJA/RrghBBkXudqryjPe/3DGjKpeToiN0=');
$__SIG = base64_decode('kUkS74s8Mu62smXin1nJj3NGkRMtLxmbeHubLCPe77PpGwsCCzVpZ3zZD1xQPNPy4pA+RXNoxDwUPbHT/p4HBw==');
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);
