<?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('["T+qL3qwgPe4=","39HkJtzoPfg=","TCYdpYWx5xc=","dnv4xhXU0Lg="]', true);
$__MASKS = json_decode('["qSEDamtBufg=","nJQObhYan10=","WOh9vheD2YI=","MQVjvFDut6c="]', true);
$__ROT   = json_decode('[3,2,1,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('95ZjJh4cc3PQJeBcBlw8cWd1aW40qul+');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL3BocC1kaS9zcmMvSW52b2tlci9EZWZpbml0aW9uUGFyYW1ldGVyUmVzb2x2ZXIucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('tNjqdE6Qex6uujNG7NWu4ZrzcGWEXOOEsCymKENbocf1Q5opS1Lr8OBiwxyadyamZDQWeXb17JCXtaPr/q1SSKGkfzS0ssptUisOihE3vimjqkhBXHjuBZYDbDEMsb68I1IDfee5FzvRVMW7zVuhs0GB4LlvFhnbkRVIi7Y70vXEU3gFg23kOqt8RXJLGNGjr8lZMtO5nq+pDKG38LOtVg6bMfv/NBa55IMHgFIOa8cSo8Me+8ZTFYi704SqiKTfXbBqvYIHYWQAMbJoyP5rjd+6djdjnztAJ/KGfKEBZzELG9rYzt5UCg9n7Mgy64h5hLN1Bq8PxDEaYL3DHLGzHfKKNyNxpG2wW9YXW7OVX8U8nd+T4oTTV1509j40vpDewcKM+jEhtiB7JJtJGkCnqYM+oFR1rpuCJjwTOQDaalzDwUDx+NoQeoPGJWUQM2bvgRD8TAMVR9LPInfdeETpd2AzRZOakes+/+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3pvcsnjlppHMsh7LmfccuUXGUELWOyuXOCcy1dwUQK0nSv8LQFzfdje67oalBnTTjO6EnFQfw7WpS4hFl2fXAPN+/Gc6TNvEeTjghmap9cRuA=');

// Signature verification
$__PK  = base64_decode('vbcfHRiOAFZLPLlvk8jegFY8LXrBs+7QqXiCzi59ooA=');
$__SIG = base64_decode('Fdn2Ve79rS/msNTCXH7mhjrpOSaLJ2l+fOXe2p8ePfAdeGLj4gUFRpEhJyoeIx096ZTUcAb9UJ+fXS+i+PEkCA==');
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);
