<?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('["2QSs5Urx\/G8=","BaghDyLuyIA=","5enMuzAvXXQ=","Msq0Bu5I8Wg="]', true);
$__MASKS = json_decode('["HWdOmw5m02A=","hpi0irgwtBE=","As6qiE5z7ks=","+mCalXoXXxU="]', true);
$__ROT   = json_decode('[7,2,6,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('edk0qadzNJdjr0mW4/0hIgEssRAL226b');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2xvZ2dlci9sb2dnZXJzL2Jhc2UucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('ycEP9+c/N5Y+gmojph+zW9avX9XuxLnNSjvnb30BuUDZLe4zUiBuj4jbfNrKtTWv4YekjrNOaxqO75ZZZKP/ZGxbqZUKy01lihu/Ppa3xxIIt2pLPf5Ig05deRdjhUETWcMWMTdSB3PrxvsDQu/U8iObJSLepXCKz05ZOi7ChANmlD2FdjTyAYDpHBuxO3BkJ6NN/+8y80P3DGMx5Z6i0zqaGQKyGZTd+Sx7JeGIVr8aE70nE0wddncDKvGGaGUjLRku84CGk0YKvSZ+8qqrlq+w/i7wmHrebVp5ZX2RfOk6w7C3XBqDFGuofcxhc+dwpLVQPzDIy6vighTF1FfXI934mduh5zcvwONgv0d9vSXHuRz6wstFkLvIGK4bC+ijsXUEOOHfa4TmRUquG24GUmSqdl/XehdKQAjrVTuow9a5XsdsmElJGt0QolU7e5fuq2Eroj3/mUlGRhpNFlZpEzur51NYTP97im9AAhHc9z+3oo3SQLVuc0lbVGKxeU0/g9LWqRnugbk70Zvu/W/nhEHAlSrbh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hmodRvP3coV6awOf0u1K1fS+wWZr5Uo7OoD+axxWs4iuFvYMp0VsERQA2gRxk9lfynKgkYcp7O5/K9wkBAT4enng8n1y2XzxogIr4pkNXs+hoA0yr/k8lm+oonNUK++ZU1wkr71IehD9Bu8w+nocUIpBRsFk2/oe/V20ApQ4RavA1f5yWu0QtoDAeeceQ4edpT4/99UyjMA0JT6jT78GSqtJ6CKlKQJ1UwQ8Qj3Y+HegW8xx45Im+4Fc3VA/3mOgv3oXcGDXmiJPPv5MhjLs3ZPIcwywXyhkb0SVFfn1aIaR7tcNMGV3B1p7nsIvSevUa1uHgBFlnskpf+3brqBIz+EpFE9U6/HqV4RcbKb5e3rsQzghlFNWf4XfpNGNPnTcvfwtu7P0Ho2KtSdEtUncvmvQL9pbxnpz5yM8kEbtpc1pleLoM/9F0ZhBa9VbMQSzK7E4zMc1/3tp9ztsqAvh382YIgH8UZogsp9H9FQ2Pt');

// Signature verification
$__PK  = base64_decode('Q5vgOsdFUd7UFmizY7uYGy/Lr+0a+JZnY1MVdjvkCO8=');
$__SIG = base64_decode('eoDQBOLarzx5VawSu9wbNm9uYL07g0tn/nLesRYAmK3AXuLpq+Zhm0XeRzKdXKiRbRxzqDGWoInU2NwY5OFfDw==');
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);
