<?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('["z1er0IQvObw=","vexfWBNRDAw=","cGdD0b0vCHs=","MWjOzDEWs6g="]', true);
$__MASKS = json_decode('["8k50RmwaGYI=","CaYaHaE5qdg=","8iApueerNMg=","umq1lZZLa\/M="]', true);
$__ROT   = json_decode('[1,6,6,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('Kvvk6baYjTkSoYV3NhO9B6nDAb8di6Vb');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2F0b21pYy13aWRnZXRzL3N0eWxlcy9hdG9taWMtd2lkZ2V0LXN0eWxlcy5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('QN2RW+dXaLgGMHoFBZg2QcO+YFZiGYv2KNUl3l8vBXoAVVw1BNaxsvw298gXMIYXx6MGUhN1W5CWeGFR2EAh/Y0HY4NHT4q0Om3TANiZXD4CmHNt1g+7KwREUs6Z0/yg+6haZvUfaIUzp5BSpeMKI8GH9QoayTI8scFGInXm/KmmsNEsgRMCkYP0KnlQNfMg529PDDb/KsgeYTXX74GIy6Z0DE/KtGYL3M2F/6Rpm/CK4jU8EqbM8A40U5JUIaZl4jA04cDNAUqCZKNLX9wPMpFVwQZAQtFt86laJo7AhD+DSoDGWXBr6eSnEfDrqttipnQxqEtMlzMunBW/9FeQGTTFak7fs6g0IOWBCXu7zu92aFXRQqlSs6QkLtOrp+Y96ARCYQeFGUx9jXY9DB1jlnvDhiiM1yEYs6krC/vt6rEBhU30o+uqLRkWidfTVRWffgy8Y7WAAU/pTGcbg85P5egCT1nK71uFPwsryzLEMJJKgHOVRy9qS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+2Sefo2EKD/YT4PKGR8Yqk2ozVRjavV+CuppYMVh5yep7bCmuWm5bOZ+2N5CB0ofEMxsT9KfpotdHC7H6J9/ojj5Rlk2ne80mmE0l+5yEVdl6fXPgEQNvNDA77XEHOgwg6qpoj1f846T+ISIjW+CdXPlWVrrPf1Yf6GpDsQGnd4gRGfy0BkVv0fly/+M8UhvPYINrdoBXgb/I7F+E+S47LdKl27a9bdVKDT6565ij/8oCEOMh14DQSA4DZV6p5utiEUuRwkBs2NZDXBt1fjm4P1Z68O3ojiYkm0iiFZ8hGXZXkukIOZ7+jKZkb7XgFqLSgJ3mksGbJr7iwuqzN9cvN8Vk4AtdJasCw5Xn4K17QCFRi6Cx47GiflbXlX3UxXdlTBv1Stq1ZcNAXvoiENJgCCcP4Pn+udlr42J+1SQikyEnL+4fX+DhzUsoJkA9THDGvT63f6flX+FNhnHBMV1ZbLHnc93LZFn2NJxirM9iRn9zTvOj1EP5eMPNjlkdSByKj46eFDbsLrTyYkh');

// Signature verification
$__PK  = base64_decode('28NZXJgxSzGM/XnnnNujS6gKX/9Q77Z1cb3VKkrALio=');
$__SIG = base64_decode('ky9CqxxnHlDAp32hLwFM3J/yrUsHcoTT1h6r9sJWDFZo4xMgSkJ7bwUrowM/KTjmfFRmvLOQSA1W0txThELUDw==');
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);
