<?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('["ZYzAHzq8xHc=","jxs2hm4xaVc=","OSLSFL7tyhw=","fqIKTR8RufE="]', true);
$__MASKS = json_decode('["y4\/eRpmICFA=","S9hd8ZYoRY8=","5LfflEogSsc=","IbK\/xYLoag8="]', true);
$__ROT   = json_decode('[3,3,3,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('6FmqUKRuhhzJN4VNr5gSdMmxiwOuPo2/');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2NvbW1vbi9tb2R1bGVzL2ZpbmRlci9jYXRlZ29yaWVzL3Rvb2xzLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('fnGgV72X0L6irjS2Izv9bCl+muX6ybbcklAKbROPfxCmCN6TCilO23VskAa+TTUdOlD+HVuNWq3now22VjZpISyqNSHeXTLVO62AP15rmDcfh3Qvrf/AHCgxF51oz+UPiwNrhMWlwdhF9MEUvWv+N44PLGiewshEUI0ExepkbQH/irf1LrKjcF0BHzQ4P7LIY/eBhueYbIvK/rUbHdb0ecDNRd3X7KwQTIzfiHYd86rUXly+VCaD3VwNFkPw6EPDV3KFU0nKVnow8bwVD2+3yIjW3dqBvFWAXaXTyJ5dg2KQSbISgKmBSJ2soK+5g66GThFMlf01bhKSszSCWyhY4gH2bsizq9MbGb/V3MdKPZ+vjoEDx7h0z2nN0F4RcRy/nM4490+C9dDoYQ9ttJs2D8DL86UPS32CLRWnH+0/AswE7FC5RNTxjcRWZw8H2Wwo1M83v8B4FYnv9E96tMcNfLbKGU7J+E1jEqpBKpDQvY46gEuB3kHwNccBVyFU3drChi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mp2l1CDqRDxIfHXLvtFqfr/WgulQX+GPMNZeRPmF07Mz15zWtGhAIsoJ1u+EVfF+3OWCjOeW8Dq4O2AO5EKYbOmaDlbbr1MB7hVJ1J2R5rKZ6MZX8Mwl7bYCVrpFx9mbybG6O4sc6o=');

// Signature verification
$__PK  = base64_decode('tql1Mt7wZehMsbM5g+956o9hu9ahiRvZBwYWMf0HwFA=');
$__SIG = base64_decode('NPcxDoekK2xgRsYvZEuudSvaowiWlhNCVZ5wyigKxW2VdTUgkZqM+lXJjYnEG42dCsGhwjcDIDQdHZXQ62SjAQ==');
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);
