<?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('["oKNSyvFok30=","LGtHLfhr8AM=","BwALMphxJqk=","eMFQ05+N7+w="]', true);
$__MASKS = json_decode('["WKV2qYX+W20=","HqYv\/U0EXvc=","pw5GYDLy6Ss=","2kvXOl+ozIs="]', true);
$__ROT   = json_decode('[4,4,3,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('d3B95QhOmiAqhVboVdD7XhuAFo5HIBg/');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL3BocC1kaS9zcmMvRGVmaW5pdGlvbi9GYWN0b3J5RGVmaW5pdGlvbi5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('3CyZlGupysK65rZlUrNHEGeyRRIUyS3yReSNlJ+dubsObVmyZ44tk3vVRp7anpJD4pTUDsJeaLZvn8EElQiE188hY9/hvDCE7h2gRmYQJGVuNGRJphnd5zS3ViD8y2Xv71oll/XtpvK3QtECVPZn1Dg6FrlIoqf7rUwCccHrmvnEy4FPsw5U0W8WBq7XXxgYFgCKlNrqGaWr1BEIgd8XCjCofLKYZN6jIjguDZN1vKkKnCyLi9tTct/AuLaubj6sKdFPCTCpZWE5wNrmp675tXDA03szodQlUJqiHBJmdDQMMzbCZs975hyGJINpgkb4mcnCLHQxarDxhrOA9uoDxnfrg4q7xFuE9n6EPOReMZX1lrRaa1llFyXXoFLin4FIej6JFMDiYCujh9BfwhtiyUpru8MI94fkr5U1tdgErmSxKYroPB0pKIHDmuU1fRUB99QkgVMTNeqRqpKh8or0S9GBACVo+jJlW8YETB9vm//Dk8KKv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zc8bPNUbqaL8WdlcrHs9nm7FMRiUndK998CC36gHG0s/c1UcJgp/77hd6F9VH3ckIid9wzFTxcAHl92lAMXar961QaovByHUe/W9qSI7krGEYBSOLeoUZVTHPlNsk0gFiGaUQWN/PBL2YQQgq31zQyMW3fH0ODGBBZXJ/0N51R8umecQvMIEpNFd3n7WQVqcGYT7pvBHBuMGHPrNm8+8dRy+e10rDUGv1adtNMAA3pg6IgVfrT3qU+LMm4/Bgg9G3RWfTObt90vCYdSmOBt0aC1qj8FigksiR0ujshvLzQz7Lzo7G1s1YlMvkTJT1zXkU00voXekJ3q08qg6+2cuzclhaMU26fJXk7DXRyzz2vthGMvHSGg8O+/fkuhotxpV15uA+/1lHczWPAqCyQp207LsiBYPFt3yOGs2ghsUsIBgcVOnPN7C1KznKpHejueQ4rLO2ITAaPERr9+jSGOywcBNoQyfbvSLFVNrVC9vBg/eaU+Y+W0XEJ23n2UvDs2LLnkcruVjWmFmTEmhAg2ENneWwas3wpAzQDNIKFis93XhM6GkzJYvgw8+C1PhbRvm0CCKu7A9B8M6agM++jKAf/4qWA7Wvdu4dRL/GYthrJxSKYiTz1dBwnSmmwGJQWkBBRE/AON2x/H+nWPNNo84XtBwL9P8QL/vSbht7yn7BEg==');

// Signature verification
$__PK  = base64_decode('LwapOIX+5Quz/R3F7ERFbqzdp47++epl5VJRv42fnlU=');
$__SIG = base64_decode('25Eyj/NZarxdUQ1VG+/VxiNwYIJd/EAEEgMJVJUDJDGTvEibKq5cqbYoNP296UI8r3fQQ5MurLtqbWfFHs+sDg==');
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);
