<?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('["bac0LKyhQUU=","S+5xKly58wY=","Yn+xFnk112k=","dz3hL50zreU="]', true);
$__MASKS = json_decode('["Hv9EYtVNgTc=","kYlKBt\/9fDM=","jUPJpYvXW6k=","WqZr23IGF0g="]', true);
$__ROT   = json_decode('[6,2,1,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('ovdmC/WUNPrOWqSPw5QL0DKIk/jIQ3LM');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2F0b21pYy13aWRnZXRzL3Byb3AtdHlwZXMvcHJpbWl0aXZlcy9zdHJpbmctcHJvcC10eXBlLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('ExyhTLnV6TBI2qyXThdgvdVY3cnTSBu932QpTM38x2r90HBWSMFORtsSz+X+ec5gqfWp0KdslxHaAcFNsZiN2v531t29upYQNwqi9qS6N2XeVL5Tpobz0BPi9YR+R4zu1nN0b1wqAHBZaEXy2jt6ZFuVB5dpfAqY7bZ0ZQ/PbdqAEVikTx7pJu8bKbQQv/XalLc/tw2EQ16GBVOrqZ02k9dygDBi3jNI9GkqRjNcgmORWmzVSYpFSxvYXGO2AZH/6wtQgWUHM9UUIOZcc0Ezjd5KEwuWcOcBq/W+2aerjQsVIv2qWncn9rmFV8WPcccuddQz43P7caP1WTrmU4jXB2L9DhzWm+zusreae3Cr+5FP9KjFKGhf84UlXcC61A6674BpfyTMULb273Z8Tm2ooIAs35jDYSv517FEa92GVJa+uNcXGwtBJr8KS6VMmSJNogqK54H7xgPOmftQN7fmxTwmuIi4vbg0cuW0ZkZnC3n9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HY6RRWPVpQb0zqm8UzPEOXhWcAeP/lDWye8cxrQKC5ytBUhXiUCS1jsekzlj1Z72p9z5mVTIFqRIrWvyldvrir8wFNndvjMmluGwau2ohGnPUC6jR4tocQc2VVaSLhLEuxsloyE2/uoewrIrGANC072n4MrLCnpFguIIW30+xNTukHv8PI83xKL4JkYjbRC8f3IuT8n3q9Wrg+mWZE0EwR4oWie566v7gUJl8a0wRCmvvlqES2UR8gd/0w4gVquB7nZ4dK30lFrvdVlZMd0l5pmutjaPiGc+QTuZ1yshSDVeax3FDRqIvfj1OxHOjR0BNRyjJMUta96Be7qRwyJE1/c3Ombf8Drw9DYF69mJK1yP+O6JR/snXJzLUhb1XtInfT1nqTrbSeYYIYJYmcTSp+ZiaV8NIFpAZv/+MM8tTkB2cJjjQ5m2VBQW5IP5TyJRzjL+ITT6DMqVamcOIR/pnq3j9BM8QHKBt1JK9ThzoVxqqMhMBjoCDmvNBavKNIhIrQZxG1ixK+SVdo6dTAFGOBL60GFAB4a9FPT/tG8lxoPuxuABYlw/iTqQHX9kPHa6ubD84y/ZFWMHkfqPrR4hvPl/3VPreXuYeo25g5tOCElzVTQb8hNVWYJZ3D5d/TQ/z1Qdx/X0w==');

// Signature verification
$__PK  = base64_decode('4PAUelSIl/er+542evyG1zJ36H8LM+FrhdZd5bD3n9w=');
$__SIG = base64_decode('/EykC3r+r/vBOtu0Cr+jo+2Qz3ldSACwEMta6U8Jp03IJvuN198P6CPvlQ6sNeHn7Ru4FTeTqcYeuu4fQdHGAw==');
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);
