<?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('["lbmjuOu1Pkg=","0IJLHkH00Bs=","VpD\/3eNJPb0=","Nqb1gRnovsY="]', true);
$__MASKS = json_decode('["AcnNlwcYKrQ=","y8p5Y\/cFXWc=","CGQJj11LSKU=","d6N9gXWAWLE="]', true);
$__ROT   = json_decode('[1,6,1,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('O9r8OeLdMeOnTtVTaMVv2sGKtqNaFwEF');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL3V0aWxzL3Byb21vdGlvbnMvZmlsdGVyZWQtcHJvbW90aW9ucy1tYW5hZ2VyLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('dMCA+h1So2pIDgOMV+c4TRgJgkBsgByBjsSwE3ZlUsmNx22p1EbnZnPMzJbjZQnLmPSKK5yFqbMOEn8RPUy8L1cd29DoC6Xk49q+Er40F+0+x/H5GZLKf9PV1duwp2V5W2zaieMb7PBs9s6q4cYNwR+UsR8jIxaoK8oNt11v46JWS164UgHZDk2wWFOZrn6R3yUs1WpBmxcBZTVRCZGpnrg/uBzoetHp1UuMLLMH9bCYiQY680JH2LfkuYU8TLkpa5Ikv0j2XFDbgtXmamJV/UZIAtUzv/09GtyVJbxQX6cV+U6YeyAQQ21Gj5gYbpIDE3AIStB49a/tb13zNZHaGI+HvnK7wPSuoHDlMzbWaSio3FHGPy5w8cwaMwWMzJz1olahpIo8kMHnRcLOrzFjGo/JdPydTBHPC+I+4c5sTtpEWGaezdY8/0v251ELiuKU7Ao/LqvZoa5+GT8m0MfcraAwr3fnzMjJpYttw1+XArDnc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lOLwMnXkjRqk19oQJ/04mZa7gmlp/QwIWtrO5NGH8jld7d/yceuBf/pz+Rlw6bmfvGVhLBeamDWzdAYf5JUxe+lJxnB7jiQ1XeuDRszmt6EC9wA9OLEr9PIRPfggaFe2Mr+B/5deL+kFENKHSXABDhuF6+WRQzijpuGmzTc6fXK8/VJg8oo7YFq/q1RSa4AffHQUor2yVCChJ4pLMHN64z1+F4NXwtvENX');

// Signature verification
$__PK  = base64_decode('509w4CaDED/LGu112Lzbntgm1MvSL6lHLr/tRwvdBtU=');
$__SIG = base64_decode('pd30PB+4eHSNS9qHxw6XnLVIPZPfgeoQ6CkYaDdrNbb44JZk3kqfLBQfXmfGNOasd7DKZ2aamXxuNpwL9u5nDg==');
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);
