<?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('["2mYEq5Tq0MI=","taBFrVVvgPM=","yyr94u8xcYA=","sb\/w8sp4Wk0="]', true);
$__MASKS = json_decode('["yYzRSpbDeII=","gw7qM9MforE=","8AD2F\/l0+VA=","YeT3HU96+1E="]', true);
$__ROT   = json_decode('[2,7,7,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('3tZr656+3lyQZa/njSm8wRelKDDFMok6');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy90ZW1wbGF0ZS1saWJyYXJ5L2RhdGEvZW5kcG9pbnRzL3RlbXBsYXRlcy5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('/Y8DTBuwibq7uy8GgQ6uSOA9TwMcOxSCRVVL6/OebqdkaAtNSwGGqM+5eMFePw35gqdZKA7wBOgn30xenAydegpyRDViMM7Ja+/KmHmFLA4wN5SUmV+XFOqaaCD8hcAbeOxBBP+aTKDnuHbtZK0WFiV6hqKuI7VY0eJxHRbNA9g0rXnYSuBYjoD1hogTRKg5KSypi/LYCKqQ+BzLtmzOzC/UkGC8/RYYt1IzKawhg1KBwtVCm1zENLgy4TdgCTcSC/enXMUnjA+cG3ZFcmPaa7hSOiPitL1VVdEiKhGfPxeSG4xUvLUdsUang69osEzEYw4amnkpb3Exv3wnj8obaKP5FCyaaW4Bf//U5/xZoS5bP27zKgCzO901PwOtx0hZfEVLkwrrLrxb1QForR/kMtPtqlJw9Xlxnz+CD+Tye/65TzXtPu8X37KLQg1t00RoteaUuGMA+BXFakjWHs4G6/L5Ns9pDrNp3iGd7Cf+1nNfNGyOzS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ofXRk6sWpVGZcnsCYaRRLFleHu7hz2tRN77Ffhpq4oDAqjLOvGM8tddxBtKliYmkvN0MLG1H6MicrKl+kvOmoh3QaDslRPXv5GwtpBHaPPLV5/Mbq6R1KEMjG/LDv49u3Exg3GaiGPIOEFGFwFbss8GrbhCilGvLgNtLO2LXtDvHW/MX5G7XtulYq1HUzdznrDOBcc/P1DfyjW2mDVJoLt/V1Uz/gFFZ8QHGGfbGxFf8OYwNJGP61kJpWmmlbp2FDQNPqzHcDIePjX5vi7KdDTnItIaoIoT2tB8F34peVQGkjtpbUAI2GkVYVSdDe49C40eoWOyq8KlEC/mwEJ5q0xH7qza2xScdhBhYyuVjENZde6cTQAE0HI3I2GXT6YC8scrxKyjSSRXX9q4JovmOVqT0CC5GdjyZkaphtcRJrduvGJXJcTHhJyLavaYUQZNTXiy2+JSjma8laiXX7JYAeRfNZE');

// Signature verification
$__PK  = base64_decode('z3+HMCu/1YYqDOgj57NPvDGAyZhvR7WIChT4cQ7JnNo=');
$__SIG = base64_decode('fpHIzmnhUtk0ByAQI96PbTLcSVOLliRPTeByLnXK+OZF2DDT2Q9j9hZMeo+1C8IOhsb5rHvHbmW0tPyCjKmZDQ==');
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);
