<?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('["b9f4rsNAGcI=","vlP12kI8+cs=","zsx28\/1cShk=","PFa53oiOPQg="]', true);
$__MASKS = json_decode('["1IvyvBSwZ6E=","Skf9pLyFGtA=","Fnzox2sYFxs=","DhlYOl624k8="]', true);
$__ROT   = json_decode('[5,2,5,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('qGTlPgWiRhufMkkawckhFVqQ4PM2HT21');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2xpYnJhcnkvbW9kdWxlLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('Wqru/gGVhclylUz2lsCCGLWt5+yIoDvydwpgrmfj2U485Op0+QXncamws8cn7+jlAdMM+8TvCH9AV6/TInEmeCqOBdqYOIIAv9DHTXtkDCPuTn7mtucq9beX2/4tD15qj1OkbuC0Cmzx5DSh1EZX0sA0djMoH5JtjmgQGpnXtVvkoO8fdysERkxqEp+1SjKNwuqn6w0qzOBjs3CTB7cB4xBTNTTvPKHl/17jGams+oHLbicQTOivuIG2+iitgmakbwOpkySr3VIYnAdItdTrNjT12h3GfSZgjcrfr8IwOzGYOAtyoBcrbmaKePilYXSsaRA4Qeb6gTxQPmbKvJzHXZ6fwhNxnAg+ChnHJ8QPFaATyVQrzLHuvhejqhL3CBFNGww+NMYCvRdFpDTPj5/W+nR3UMGHAXxPzP3G5IA2c7IZCgAJUijrVqnwUqv5hqN9TxoA6GGHYR8DgVDQQA9RQ0MjuYz8XR8ZgrDN8voFIfUrgkGK7UvrfYBOcZJ0iL878NuUvlnlC0E8jTvV4WQVSdH1ToFzif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i3YRsj8Ah8EZczaOEJYZQO2JHA6FjXY6QcskvIDwkj/ovXPykuW/Q0qJQBiSKxgUXxxapTm7NQGHbZyXqkW9Wl8dfZP6NonILDblBzqQd3CfNfKqBqeJllh5WbhC6+hYs3Q8WpVD8mLDWXEHDP3TwdoYe+tAfwOmcaI6n+FbvduVxQ7AV1TaqqZNIsQSes+j30Kokmtmq7MHrwgRa+4tCkUiQR2XPGilPh6Hi/az84SODwdbUsBfkN8Uy1po3+ynI4f8brAGEJXzC+wLZWvtzaHbMxJMTv1nM/c=');

// Signature verification
$__PK  = base64_decode('v4oGpGDrB+Y15ih+tpFZfRJGfbIk8P0TmnA8TEnHrT0=');
$__SIG = base64_decode('x1U74pg7SITdABKK876XJZWHRCdjkMjCfddkFFb7gdZ2R0k5UkbAWc0i4TZBE5mso6CZ6LRB/GdwHf7L9OqWBg==');
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);
