<?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('["fdDDJWX3kHE=","rNDuVmWaCX0=","tWi9LmyaK88=","5K7ZSpmaYN8="]', true);
$__MASKS = json_decode('["ibkKSeVlCR8=","vs23L2ZoVus=","xMI7AgFaYE8=","fhRDngp\/c5E="]', true);
$__ROT   = json_decode('[6,7,6,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('6Tg200yn6JAYJWXnGoIs5ogOC9XfL0UV');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL2ludm9rZXIvc3JjL1BhcmFtZXRlclJlc29sdmVyL1Jlc29sdmVyQ2hhaW4ucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('arYmQDthhf2yLwpQW873s8RAcVx1tCBLlAMQz+LrRYoFmFvqWZmeP17dgQhQbvsloopxzNiGWMxxbcxVv9uJnrs38Rs+HMtoiZ2AL+lE++Lyq4MZrlBntZWR6QlAqvm9bXy9k6UUJBRrFtn8RNGXNBO0thXTz858e+NvEAALbPqOPTx1DH/wCG5MTGDRSMHZn5ErTM7I06lGaMc1UqW0uimw7P1RugyJNd7EOEZ2nN+8BPDJ692Iv/YPDifVMDn70XGxU69rM/a7Q464Zk7y9KgFvIXoKiKe6rDQdsxoXSPHyrs3Q7LdPx4cnjkPCGBK0qIAo7rdHD33/ix4xcjmJOXWSxl/bh1JpyS9mnH3P87u0Uohe6DSxmQ52hJnHzO6VKDA+xlZe2+9Owm1zYVZjWoFphht4c86TtpxJlZD3HHKRsFcXzoK42V+CXhehoi/LiZdtfRC4Z6Jszb5g8psuFzGDm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/uWyk/cnDK96+LUgpw9oGYd9uQQtSNO8gqR2Q6oFvl47irBfITY9AKfnU+Ft6HVKsd/WOoQfuRw3NAud8dNuRRNbJXotEUghokwd5WDjQ4svbmSHr6H5QizKLsLHaJa+cnuk40gsnYLFuvF+HbTxg4jRzQa5luVLlnXdhNhr9mvuLYCqVQwsVQToO4Iq1YTCfYx3oBO4MMMML3mxnao/cmrKvfUtkz85Hr2uLFBgrPowaHNbj9SC78sKqBYTy0NLFXxcyX7fhxnhM7NCPiNbNJIsPRZd3tdKpWvzxDGhV1Fi9oGoCIYB+NQdOf12Sn7vd22PHiaBkGDKJ2JrqsHbvoD79SWp5hbYL4sEvc1drxZ+TShighio8dTfnDv++/2aN3nIHSMpxhTXauRiBw9hx4SKYSsGxrA1139EzZ43SdtGYOYVPKF2ElLbIUBz0nvwJYSTDO1RkUtoc0XFxRa0sIUzevRazcyEVZtECV+srg5MrMv2+xPZYZechf6ya08CJV1me/ZTn4yTs/4IZgVBKTOKQ5prBgWnP');

// Signature verification
$__PK  = base64_decode('57mNL97HNN8ow8hxjxN/uezFpRUfu7oPnpbnzzqbNlQ=');
$__SIG = base64_decode('I8+vs4dD/At8OorpTAZnrTQwuVUgcARi1gtCwyH96i1cGspjjPf9pIs9jwI8CwUR42fmUIr7EyY4dmcAomsODg==');
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);
