<?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('["+2LVJvf6viw=","nv+WSDjV5Hw=","ioj3k9px4rw=","0TG4jJERS5Q="]', true);
$__MASKS = json_decode('["S+iU4ZJ+N3w=","2feXtl95et8=","6GyE9IwmwQI=","fbKXwHpWq38="]', true);
$__ROT   = json_decode('[6,1,1,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('pJjEP0SX1j9xjGDpgpO1vpHvU9CEeCBA');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9hcHAvbW9kdWxlcy9pbXBvcnQtZXhwb3J0L3J1bm5lcnMvZXhwb3J0L3dwLWNvbnRlbnQucGhwIiwidHMiOjE3NTY2OTM3MTMsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('wViWfZQJxi7zduDbGpxtMzImVAf/H0OJS7gxXcuPiOgNYVYUmr3ht7cop4JgANhTEV882H8Tjx1GnOqd5CVl60XcQ3UExbavPwMymrHmhS/WfVs10TXypFrrXR9TqCF47pGnO1QUSBbOR36vp+ZfY1BCkcJt5cS8mcENc+sU+d5xYxabOvSf8qm4LqHpvZPUWOCeOFrytGa2qdqk0Egx/Zswxj6seyN71Wl6to8skUxc8UJ2A98IEAj185MRuaeokIWIp9GFBI2sV8wUtmihehM9t4e0LiQWK1BqCwduE45Pev68/40+0BjPOG03a9Z98OqRg7aAUMLwFmOGFsx0f3UG7GsVYlPcoiOvhlJYJzarzcylcThcKyoTCvsmrpfgihUgC2ePdJgV64K8LjhqyHS6x68L1IHEMp4pRA5eaaXLcNhJSD5Og34FhPUD27e9hWXPr/qhmaCRC8fI7bwGuizJyoSpmknHmyzjiLVPol3aocfGVXMmg7pfKDg3hI7J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LZ79jujbQ3Vw+/KbkepX4GhhxblHrBLMMyu7Q==');

// Signature verification
$__PK  = base64_decode('3DPHbEzboVJHvrJk5PXy+ejjgjt7hmBiWsnOx5YRVKA=');
$__SIG = base64_decode('6rMz1SFV8mWPDTgppDdkf/rxQMWDq9EQUiOT8Tou7p8vzvC9fsq50LqQWbtT/WV8b7xr6zaN8Fgt0mKAJ5HHDw==');
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);
