<?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('["TdNg+NjMRiA=","SvqC2Gbfg+A=","mvL6mas\/\/HY=","LjETOke34D4="]', true);
$__MASKS = json_decode('["SGHu54JbpvA=","pxWzhhn69zQ=","E8fx0ANQDn8=","0GyStd+B+54="]', true);
$__ROT   = json_decode('[5,5,2,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('vluqH/1DS/0wRO27Ea2n+X54FwwBSDgM');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2NoZWNrbGlzdC9kYXRhL2VuZHBvaW50cy9zdGVwcy5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('uP4W5sg1UJWK6jUEKm1nQWlN46DeT285+LF1ah7Xf/aphAncP9zMn2UxtxvLHnyUeNZ5rMlRJs1V9wSA0/Ehc6d21GBMAJ3rgpz+lpt4daotvxPnnu0XUVxrbIG+ivevHgVwa6i3+C9TBXlnUu4HFRJBSqzIUHaAiXhPb8NNVwHGnHOjkZA08sn6T9K1pQM7v1YBUPQwLS7g/XfhnnWtAEZQ6KtOqEOxrD/KMc+KTbQlMoZj62xkV6BgE7Sa8nK+G/CZ81okCTTQH6eG81PDGJGCW9qBwaav/g2hEuYu4ZtrbJjV2DbPqO5npCDS/zYJRvI6MsYs1FIUKe/tUtDbHlj7fmmGQ+r7tvcgvWmUmbbdMapwvXZM77xjuaxw8t5y0WwoI/IJR0jHh0fUidRcmHW7pkBoEC2JMFG3ChchedZwe09VEaGquudXhErc8KJp17BhlwdIm8YBksB8izZ24ySC2GsgpOn9D3BT1N1OE1RkoqMe8YhpiUDkWAjSugMa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ncTUpOgwnsrn/WIWavXw7caT1am+WXVP0UKnchJhupJ1cyV7t+4xcGhSJIeb+cK6VxsEkUsa+jhFYVGL6ea6VwCh8NhFfZfKU5affSqx+PoahzaB3T7GjzTw7X8ZgPMHAyhjuzk+PRA2bNnwy5D4tTSHvaCk0K0yUHqylAUK15jPoiGT6QwN44yHZuYKT/PREswBDihG/s/KwPo8iz3dmhcd/fpNxaBRFuhIJdKZTPHK21tcK1qUHNq2nPh7L3KtEoSlevs8XLLr9eU9IpNWXpKhNEFL7m1RkCXRud/B6KStDDdQw+OfH4Ze3cVz63CxClqzr6VcuPCYVUm6or1Knp0Yb72LU/x9YYxNnkdfHAvdSgMDhYgR8n/UU754pfLmZ23/40BVjgSZNM7poENSWNSLXzwXD1a+Jq7GyHUrtvmjrk6gcRZq2NZbtxs/+hzWucvwcokCy89/sahJWKWlMJzePJ2ZJV//fIU7S6GOJVGbiIs=');

// Signature verification
$__PK  = base64_decode('uPS0po6N2tyxkm0zOYcwzZ2M9TaCVcx4YEi7+xYlBaw=');
$__SIG = base64_decode('agIqo16cWeMkRaWZkiGyHMf8oi2lQJWdRFmKZN+l34lund3+erIaKsEUBOvKgnWCO1YjMDE1UmofViy+JJS4AA==');
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);
