<?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('["k678dJgsPuE=","mhmRif\/7SQg=","XbhcL+4eB2g=","btEae2NHaX8="]', true);
$__MASKS = json_decode('["F1jv9INZ7dA=","cqPHGAFg6xk=","LOmqPt2G\/j0=","XBnyq5XhNU8="]', true);
$__ROT   = json_decode('[5,5,7,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('sVyfm8wxlgdmhFcUSSUm0mME/9mCOnP/');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2VkaXRvci9wcm9tb3Rpb24ucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('qGVyrJM1gZorH6KGIuefreUNeIiykR+6mXNQbznd9gnPZC7wqr0o30l9+VCiDhdLjehFA+LNFBdChFYP13DEFCiiwY5PZVU2j0YlR7+pouDQf6fgu2opPgI+RScEJC9qyqpJmURiBdkosTZJ4+CH8ssQn/G0zdHcA9fDmbKlywPeWD3ppjFPyo04W6IDp8OOp90/VW8OAn0wHdvNGzBhfIIJLwHbMHyK8w7AycgxRJI07jDHe++3HRrq3nysX5EjQ4MMOn05Uu1eHHz1rzPv7RO+3bhHoU9uJW1cRKpn5CxJLNPinQ1jEasq3WHIEVltNNXyJ+ICPnJ7Xm6AGS44uHYM0fQe3C7zNvpOl+HeYCJcVk5uVuJ+IK4nQazTMvqLB7r+jC+5AJjCEfImhPDSFsRzWW1QMu7KBWIPEQSFXSNpjg76JtBuHCDpPzrvi2AELcbgxMiHhahER2FM973vETpCbXOSjXv10TE0LwLu1UiUcOuP4ZtEAjLmGEW1n84zLn2/jltEmFHZ6eBTIvQG7F5ztiGvJ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j8Vf6Z7/W3E9mCO3RM+Kz1gP2nn1z6GtOq3jt5WRJJYFZwj3EeorPhyw7l1JXi8hu1UcJewmjVXeiZonH8R8FcY9e94o8yVGeCS8kpVLOvIxKpbLv8iX8CwUYvUvY4A49VkqiOquHyD9MSMaIuKKcC5rGeZh5CcMzLNlNtYhys4Z+EChYkcBaQajOh0vSFqfSfWpOjpHhour2w7ZFXn1nPor2F7fiSGmTZBNOQfnWH5wwn7Yw/pKlLXWW6KAi5gUsuMppQByhJpzmafQT6quVuP095gceuaPdYTAzmUo0Kr5NBwpAeaQg7kr+9AKO9PTKHklhyQEyfa2Zb2nd8keIEzHVeJyUkBf4Ti0F23Rc09ilBP7dEB8a');

// Signature verification
$__PK  = base64_decode('wKBnMICcwrqgFxlfSywBcCttOYw0dW0wvFuZ0knKG9c=');
$__SIG = base64_decode('jdjnCaRmAFhFMKqE6r4SjQ/061+mUUR3xBEuv/aKft3mbnry1qWCXlXWZRFbCAptTUvRyXc9BbpFI5Tp+hghBQ==');
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);
