<?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('["EjrhvgWXbDk=","18+3v1k7sBA=","5Pj8cN88EOU=","wWva+frz7xg="]', true);
$__MASKS = json_decode('["T+rFu5cIXVo=","RgrH\/KZEbNQ=","N62OcQcbz3o=","uqk9xc7CZ9A="]', true);
$__ROT   = json_decode('[3,1,1,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('zxhkzA9TN1bPupQD+/3X/OBoZDzmKUZ5');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2tpdC1lbGVtZW50cy1kZWZhdWx0cy9pbXBvcnQtZXhwb3J0L3J1bm5lcnMvaW1wb3J0LnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('XUskKXHmP4XIBq3zhiThoPtq3otgJbgCnrhjki4LRlwxz4p+kfTN9D8fw0nCGJTTKEYeUSCiZKz24olZzJZ8lTqB2OO5wD7R13ATyPYwPTe1tFt6sJ31/sAGHyn2JhtBrAuzcJb1BDbyLbfbt6mDgeAzH6imC4HO5g3b3x8wTxqyyI28rF1eS1dADPavMR9gzMz3pOGCVQQqXeR6b8ZbJmaJTvczHe02iwlaYwEme25Z0VMXonWnExQ8hCS7jysndCjSDNyZf8FWrM4hnNKUV/pUbElo2rZJq6QEyqRu0bJqOKl326wfiz/xrDgP9wQDmHOGTRADWsBC72F4h7J/K8m9q/AKLHvgV59/1asCNvV7t49kdd6giOAFzg2YfIPus+CdW8bwEweks/yt77wfcKKgW3EMuJlMc0rPxLVor+j1BWM8soGiob3FUCZSpbcRgpKa7LF0COo+qxm8zWwcZwYFMSG8zbKdhCFM2diQZk8wTj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2N0vdlc0rMDPnQZB5MqC2PA33x+YfoNd7uOF3B78jNAq9QLr+kVvgVUzeBSY+d4sCFq3C96TEfpkBPOAWi5RK3G7FFbWVs73Qtdf2doUi08x+63UQzE1Hido/ZqXzjpL5gGN/iVdwEZUggsZJQ+am4QvKEIVljtSQA2Nl2c4KR/RlyrqisZiyPjR4Ky8zLKkgaNJCqREBCM2fg6JuV7uQONk7gFXuUQXthnC/ZIz8ZBkB4L8k');

// Signature verification
$__PK  = base64_decode('QKUn/mYDJaaeb5C+q43S0kS4VWoAmKnC6rcsCFRRgbI=');
$__SIG = base64_decode('FpX7SOpeQOK+gSdt0gnuPGemcwb7PVv1F+25+LPsNjYrDpvz+4eTokgH1iW0H4Zfz0nt2Gfm7h+PzMi9di4cAw==');
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);
