<?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('["g4j3Zbf7RnM=","UHaxo1KAUKs=","9snz1MB13gE=","qZjcWiDpPGQ="]', true);
$__MASKS = json_decode('["V+UPrbvA66s=","2AEonlTrtc4=","pSL5Yr4InpY=","zi\/1PcH6hQw="]', true);
$__ROT   = json_decode('[1,5,3,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('jb33N0X8QrYEAz2KUfVM6kt4he13lGVn');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL3BocC1kaS9zcmMvRGVmaW5pdGlvbi9Tb3VyY2UvRGVmaW5pdGlvbkZpbGUucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('7PNKOKc7SZzjJU+kQyYddrM6UXwCIKuKPXBMsC4lygtHywBQ1UTExLwBEu5+PZn10335OC3YuSpfwa1qBvaeDh3mV63lKiqJhds7slP1BRE1dqRftEEN2Foh+pyOOsYL0UKgewfz2ErvtWYe9HeDC9jELlakx7OWiuUV/Nmaq3EjkQgHc0ZRC8dLbPwoTWwNcWQSN3FV1Gdqh6eoup70q74vwpdSytyR0plaSvbPsPHrto8ziFta3+Efgz7lbmE2rzzvyJCe1hkErbkwyi9G3OpIsWViDTMrBBGeQCkGADPehvu6W90Kzvu95HqoW/cph0SnCmJDgY04ia6IMvEDrfoFcCGyvFNySsSgYB748LAVZPstf6h3FpwgoAtKgRK4VTp2jZy60eZ6Lvlkw0gdSPcpkYNaIswUu6A+vf9pUEFgd9WGBjuQ6YazyxRDPDQqimhP9cUY0vLLp+FHhBoHrvf9PAgfWgurce0a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5OJ0lu7in+F5LD84m2f1PLvlWq+8Dbtmx3MTyJ7VZIMV2Nljfc21n/VGztZxNm5swzNR8u7Tbkf2rvXZAH9InOEXvKOn8+Pu7KlcZ+STY9VtS5+1KxiOZQ963bTQDfq/HVg3WCyJiRqJQNuAWdh0XXg3w1WtnUqKxiu2xv/8cYVI02xj2RKF/f6uBRKKaNTQReAPL6SiW9POQDGT+VF0ixwdJ0ZyrWGbCjcsJIUAElnd8royGP450fLIcWAqDM/sHEGDMFHNNbqGwt7Vnhj+tqyEJ6GeHtuTwO7GIs1jfAkWch34BnXfEnm/iZGviHgqRU+JrQ/U0LueWBFkRVZqAeDKR43q6TI9refN50hYcfZgR3L47gYKsMgIgg7hiPJPy+i71+neBhAIHwF7fIgWwHA7aQ0+HQgGsSSaZ7DAcFVuhmq5TIpLA==');

// Signature verification
$__PK  = base64_decode('m2w7skZquj04ZTfUtdg8/BjuiI/aQP7HGRnaj4clj00=');
$__SIG = base64_decode('CqbT24FjlFGftnfwyxPGrwQPSEvBMxKN4tK70g6AoM9TRorSKSnUg7xN6QZ2cE7k9Chroy0xEhVSEaLd3X/3DA==');
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);
