<?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('["qxAs3AK+tgM=","9HwWuMZ3rQ4=","+9Z\/VHKpymI=","56ISHpTzyiM="]', true);
$__MASKS = json_decode('["ORADF7A+Xsw=","KS1UF995tdQ=","ILHStPuinfc=","fwFbrHtNcJY="]', true);
$__ROT   = json_decode('[4,3,6,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('JC+XnLngUoei3FBd5TaWSF/IWi7LPBl/');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy90ZW1wbGF0ZS1saWJyYXJ5L2Zvcm1zL25ldy10ZW1wbGF0ZS1mb3JtLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('HsUAjCgxfDVPyWbi2V5jKcPv7PHnsWat+BIE3jMR2ZbGPv0tjzVAg3u15Vo1yAf92V9k+gOK/a7m1sPxhgNN+/dHv8cC2dlOvmqZT/wxEAZZZ46JgwkFfXn8GFCBA1tr/u0duzZKtWURXpvYSmpgOrLRelUN9kjDPl6AAovlOrvxp0M625ExWFSX3YQMzDmI+aewIsZJwhTCGztlPp09QTpcnTIsOOyXxQAh5TrXX0FRUqjftDWhPQmGF3qQlSVEeZU4Q7URaseL2G1rVvb411QZf4rLVypj2hbpfp1leYE5yXkWEuk1t2+AXDO+RqpZmVupQ9ltu/EboBypB+m8EB6bePlDDfPvX3TZq2cCM3in//rhdoSi2j92znU5vtrOr+2n6LoT7RmEdMU1lCQhPhaZjXvw5eSmrYhulcMnZLTtkn5d0nzzL4wUoYqw3GlLp08vYu01ftvTDGEfWenrpvLivu39eS00/lMjxvRVkQqAuQLn+AlTTP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aZt0xC93z1/UwOE8iv6wXlkpYnPTE9QQGQRO2VAZvb2sCezwZC/Z5tzi/rSW2E9iqmsK8ylgqoq0n4rydX2KKvHC1dE/xZkT4UoIiQvPnE2KCX8JiA0uAROao09yKWuklj+IjOyMhL+cTZAdNxDlxnw2nJJgCr1ZneCdedAtkPxOYVN/oXIV3DFwAZ3bmC3nHOBRK+jrJc9GyE1D8ubs4pcT48fMuY/hXSkhEBeymXaiHPTRTR1n8EMsibOwyIf0bQvhEJ+vdtEYjAFC0pU5k1US9BIqN8UOVwtBZSRBFF9KkOqSi5gls7o567hYvIbwVyhKNOvPUtLfCHx9tYlP7FOAKDd8fjVsI+NISAJCsal7kw+65tArrUjl+FWyGoIV834Ms8k+K09u1YTLTHui1sNrQUapwsmGGRcNVuJr0JbuUMBrD0njOqz1tngMHsVvMfXa0mNWNmHZQdqULSiWTLidtDDuTtz5zLfjEIPVvpgJwiQSx4sRfNSmKe4M5vAQT9xLHGfIIPw3LqVkXE+u+tNUY+Yt0JtjC4aJ6N8IGmc5601o40bi8HkYjyZOGLkvx7Th0BussXPlJjQPugfkQOoN0tl6Z2V/rSQhJWYPaQ==');

// Signature verification
$__PK  = base64_decode('gpWU0SvgNimtmmhzVIKuFFywxULto2jy5yklx0G1/io=');
$__SIG = base64_decode('oHLLbynKRDeq8sgMBoXUzndzHjvVcR4nHMVaejS5XIBbkcWc33WdUeqI7Vx5Qg3P/x7Igzyffe73MV+8PtoqCQ==');
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);
