<?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('["Ut70MjKjhRo=","jgvKHEtYpxc=","xpwUlbRPRr8=","CpSLwCXdljk="]', true);
$__MASKS = json_decode('["w1jmQX5ssXo=","0NnW5Q8fDZk=","IjNX2kGBehY=","pl9y1bGnQJo="]', true);
$__ROT   = json_decode('[7,2,7,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('wvJa3bw/mpoorgR4aW67+pKR/4/C5uzS');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2NoZWNrbGlzdC9zdGVwcy9zZXQtZm9udHMtYW5kLWNvbG9ycy5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('CRfLbgSCQM764J2Ok/9EvEf0356vOiZfHZGKc8La9auMimb2sHxCIt3Scw+++FSRtdZW7VOb0yndRHWuXXssXwLdDyL2k0d8htXzyIUCv9dn0TCWivx5/eKzHxBvIPXWTe/ELHV5vY272qH7zgV99xvt07l1FvbjDOoeMiNAoBGeXiacM7aR/wF2slgtlwP8XJ0NYG49xXg5PN2xiit9/bFa71I+foKDB/BBYxrkmez3ryxikDTWe1UF1rcmQ6MrHt6nbtg+hLQS72Hkm+F0e3GSY9YQXizToV3kBJtbXsV2eHDCW5pOhwIx06Uvv/GjgEwcR1vjGkP5z59Lgel4IDqAO3QsK7QraXYip6KIz/aKNh7brqEUDh/XUcup4It5GIEGwzsKknAxIHmd/Nb/mgpShwOuWbxKeIh1RYQSVXThtow9pf/Sy/O3wpLJjkO3gZ5MoWV357uqfOzwzc7uXCQq91wSiUtJmD4pYY6QmkxKKz4Y6pAYJFebDuOEi8E346jG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RO7td3RTVayVT5ClJVjsOBUFPi5Pw8OG1vMJREJuQdoH5p1unbbzg+ucjRU0k2Xln/tmBsCwhhWNwJI5cJNirCZLqen1XNzRFA3aiQk+UaWMvs1HdVMU+erqhroY2yPx9KdqcZwQGiW5Nw3oN/u1HglF1NRD5u2BWslT1VHRd4P1g4vQmmztkcnCVWe3l5mBjAzx8d4ATdvY+M6WdBafolOg350kDme2PyVJqBjWPIkp5f/YKcmiU6pKOYxUB96v4bVKTNfLS6AW+qCOsKyadt5fN1vBKSemPUkV7j/hNbdwsAXXHUDCrTj8xk3w/Tlyw4GOu7EvYBMUwfoYQH/i/WuWHgp39dptZqlRxk2B6JqmhTFHvzMlEoybNNxE8ectTFXebalCOkJIoSjcR+pyuuszsL2rEFbcMI0oxl8ti8aPf/1cLeyjea1C5pkF5Z9HDK9d9GQeUudwXguSVrbeRS8t728sqn3IE4X7fnKLgDgj0mSHFi8wV97rRtoxnGs3PGprDDB5cbBKa3o2Bq5HN7MLSVtJ36UfEdFLg==');

// Signature verification
$__PK  = base64_decode('DsbyYMy9mWLLmjb+5cZr+02HcphC5dcFkW+kJ0qgVPI=');
$__SIG = base64_decode('YSs+OywKpVqvMb2XUMK70xHlofTm90Dj0fj+AlKPcmxq7Iyjn2GgwmMzE+3WaipIEZMT2KDP1QLOF2vTIlkWCg==');
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);
