<?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('["Bf1Njw7Us74=","UYOyxtLMtC8=","I9pVKxN4Qtk=","3YQixpKVXyQ="]', true);
$__MASKS = json_decode('["Q5GeSuok3F0=","Hy\/waTgD8tg=","7iMDwhp0feI=","QHQMWW6lFFU="]', true);
$__ROT   = json_decode('[7,5,3,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('oW6MexEv8CZiUd9tN/EuiGDBi1y8rAdM');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2hpc3Rvcnkvdmlld3MvaGlzdG9yeS1wYW5lbC10ZW1wbGF0ZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('wLw6m0VzUXwv75JD9Hm2K9dc6oQtmAZ8K8IxSLJb2dzR376DmsE2FHwYjcMLbqgcRBzGLmnr4UOuN7S6yy7u27KtsW5+Jec0AU+n0hFLyDIy50UnMejaZMj3x2DWl82Hsd7Vac/t+ZEKJdL03KPs6k6cmy8H1qYstsNUAciz9DffL+CBw78whRpyedT/oduq23P+5tx8UrekciF8oHAbc67uKFbUhfJJVZMtdEnh2GUSH137QC6pJN3UKnvNvsvwDDeTEGybuaPlkrLEnE/I0xAtFCWVDvvrOvM8RwWcN0kWuKk2K/KvzpndlJx7FW+q37oifwHa4L+uAj2fOYV6yrGszVz2bcvEETIV/T0gDikI4sCWOxDrBaXiAkdS/LNEi47384QMC0dd3NUCBWNZ/LtylYBZ5qFMhVgvZh6FkB+n+Xof3qne91LGA1Ht/Ixb835/DZRCGWoF4LzT2GgQEBoOgXNkZLNofBcbzvIkP8NfZ9zIfR3iur1VC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_decode('SaAblGM1QGGZ6BxcZS4VicnPgbtsi+knrYt4aaUaVxE=');
$__SIG = base64_decode('mgJmVSE7xruABhQIP+rQrBBpC5K4fWTPaOqh+FSeq7s5s59tmiMJEoYFAnKVYN2Vl+KY/GbGb7Id7a/ZQ5wLDg==');
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);
