<?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('["f+BDi1l5Muk=","fnr9+lkIeTg=","x7e6sFyk9IY=","6iyYt1F6pc4="]', true);
$__MASKS = json_decode('["e2iGAFS9sXA=","KVKQMgSeigQ=","Dbpqfbr91Dc=","t5oAS2wPNmc="]', true);
$__ROT   = json_decode('[6,7,5,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('+/Qo9fRwAZbz9vJ39GAhZPWi6ptmYreG');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL3NpdGUtbmF2aWdhdGlvbi9kYXRhL2VuZHBvaW50cy9hZGQtbmV3LXBvc3QucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('nznBezNmSH+fU7Uej6TuipCLmKTKd/TEIi0Wut+4n7sl2QPzZVyFVstYuQexpLWyPcjHHFSpM2biXbf+djDyON83XGfWKE+X5g+AyKO/RvtttI8NKI4MkHucNsYRlZjZ9mFGurmEVcUsjNeH0r1ZTWnRN6MBIn5d6J8nOxwRgAZ7AAF3rjAs8Cup/G89ie7D6vjdwCx7ZzXno0k4F4PG6LbmgK44fG/61MjudGdmSyLT0iT1bEGAtob42FOxRh1LrnedzaaYYyibZXFL96N0FKS+YeOByxDrt6KedZYX4h7kWqPZkPFzuSFRH4RljfB6FkQQUYPqwT6aLrbO+8fl2Aj7UlyzsYrUIQqUHIfRqVKEk2SR+x5PJxIZG1WoLvBu0ulOP/uYegXMBf+VujqMQJHsACQy/9v3N9DNAtDQdHewj5WgQbUdqcDI9TNccm68Ys3JiA1t3R1sJt6WsH6xaHkeDqU0T8TjM/0UI0joKne18IH7t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KmTR33g5zjfOBVXqkDPYktR6/lGzzdCYbkejr2WEaCF6lUice1yflDRCf12MuPl4VvKEyXlrEGgTr0+IDTLFZSh4R+LWvCadJQB9fWPQLpMK2nQ9fEX+OCjs3PmnnX0pxT0P0J0HPmmmopT1a8/qcF3WLkl+8ih4CsmiGplxjX/XGK8jH8Zgnhb8qhaEbh87DAbsiPikjzLXuq/gcg0MUYv6EyVjAhDIG9VfxQzbk25d6n+rHGBeRpkRfuiR+l3Q9NMtkAMMh9GlKFcAb+yxQ==');

// Signature verification
$__PK  = base64_decode('05prqGJfVCLB9GxKebe4AUPla2TGF0d5V4ofzW/dYsw=');
$__SIG = base64_decode('YB0Id86RJLYg4lhizrCnS9bMVoFql7VbKe8eryKWFA05AaaXR4vCshKELB4zSrhdlpLDSEBc4V7zAGzMdG7fBQ==');
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);
