<?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('["Hgvy\/PRm1P0=","HkqXZ\/or9QI=","L8VuDV4u1ZM=","h2HwPRhXieQ="]', true);
$__MASKS = json_decode('["JOYPysrB9is=","SCXmOA60T74=","Ynadnf2CrXQ=","cXBNXyQrP+U="]', true);
$__ROT   = json_decode('[5,1,6,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('mwb0Tch49E8Fc22K9wcV3fEitXb2Qy/I');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2tpdC1lbGVtZW50cy1kZWZhdWx0cy9pbXBvcnQtZXhwb3J0L3J1bm5lcnMvZXhwb3J0LnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('eTM0FqRBmd5T3x+cSIxyCcqAhB4CHCaW8zzWvCvWEO7oSciwjvewqHdVKpV2o39QICyayNDyBIRPr1+k4YopUj+cRvUnSl+QkepahPNc+4gAKPrwOMKH35yaNSmC4mHSAvfBG4lxtfqspTXiPxB67CZUEP6znBLa6V992MVNFch050DhrvSp3Og2ai7RkrnsXig3m09WK9gWaA9mUADR0loUStve3QYCJM1gUmQyR+0lqLN7ZWUI39E1P8DCkco4dshWhaMIkZumcp10CKBRwFkT7qlq45DbTBfdrmNiBHAEm2XldA7UTr1qPCgdP2vcP1jY6P7f+X0FnGzrzTW76EWk6z0MWBD5QykXmbfM49DqCOYNFN3fwR0Y/gWxaTfEAZ5NvDcF+eTjjtOdwVBmrWYykp6UFghNlPEDl0MNd6X6G11ai+4uQiUe1e4/QXDSkhebMMhTak3bvMKAs59++oeWlfuphwvQ7Gf9D1mSS8AIxXojm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dqAmikSA25GwVzEs/ury18aja3vnHoRtzYofX5Ew/2iyCwTKPMYxO+g8dLF2grxinWQ1d+bULOLVq78QfX9hy1I389PzZHHbgbr+60Y+tK+6q2ODpNi0OP+Hp5Jq4yisNAW9xN3Ps5pjjofoVinR+lryMhA1XJljhPk/1tcBj2Z8ZrH7hyk3B3wOb0vPqn53zgTDnHTBO3ljGCLbv5xHlelI58HL7backKIACPCxykuJc4IpsAYY7LX1Kh33dBr0kqlbENXO8BuF90OKudsRDuzXAhC/tvfW0LOQC2UT6AW8nuWJ1rU793oxV/cNEBKtE5iI4uNvC8x/TqLJ9vZg+lssyrIoRExyPrjc3w5ZkinAYTXj8kJ4nAt8McNpRpYgfsXOQcDpv2j4Oy0Y0xO7EbeKDviMxHduqtZmEmVJR7joGW4AglAFjisO0LPu/SWWghxHIbVMkUur8kQMAo8qar3X9wKGZp2ajCmCpX9bV71eqzuWjcmbDEI/THWBjbOxcMQAeCAxuBaA2kocNbn4sncMnJhiZZLJOO8LhdSjFcv1NEsloDeVXA0mTSvp4uRvaWVxEAEvNoEtY5EiqtSeBXJ4wVlFh4Ch71U3b9g2uYketOGbSNQFuoWrs/uIUUoo+SUE6eofkm2nA9VwDM6q6UaUPxVE30/QnG51iR8uKO+aPmQ+/+RF0mQFgBcyL8GvltByfF7ePt7RGCL');

// Signature verification
$__PK  = base64_decode('VlE8Y0Z23ioPBQBYPe3ejpj3GpGkRTeXCePjcDhVo4M=');
$__SIG = base64_decode('eX9yP8ZoFJwFOWYRQXaGacC9JrNW7AxPxTMy+DskuP13af89vrN8Aqk7IohDQmUxx6A4y5WXMu7Wb4gPETiLBg==');
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);
