<?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('["3cIThdpX6V0=","NQBXHoG5RbY=","9xNoeV9wYuw=","SVCCUAwt4bk="]', true);
$__MASKS = json_decode('["86aZb5htR\/I=","DIvFyhOhraE=","24uTxgorm3I=","eWA8RTKRSCw="]', true);
$__ROT   = json_decode('[2,4,1,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('W3b5Ck7hk2Q5HdOV+gkS3C1gwgvNx9XU');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2VkaXRvci9kYXRhL2dsb2JhbHMvZW5kcG9pbnRzL3R5cG9ncmFwaHkucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('OgCrIpVQUKmpL3D98EAILe4Tf9VtVzwZgKxBHADmjJOK93FhopabvsYZXRfYphKPu0LsbjTzmpTmPDDrLsGdmIDX/IRDdD+OI9GMV5/1F/yllyQVPQMqjg6EqoFcSTrh2HDKfiDkkyfufodbQMWA/3X2ies5a3ov6Kkc5kBs9rRKyKMMOlO/XyjlFd6BY131JZYtj7VNuZHO1LEJKz3d66bB4YT+NFTz6Xnmusxl+5vvSLp3YFaoSwUkTlc0VpbvoDs/VG7TP5etSatsxvgY9quTm6y+xcMe6g1w7XwxR+E5kX9oQqBVm9YRYHwgrQ2VkarLv3QSXC8RWIOx/UcCDBUCClgoNgsWdPcClsNZDiV6OvsZnXdhv97NlCmvfdaeFC8qZMwTxMAFlU16YDAahQ72636SAuiQTiln2+JL5n6n6j6nh7ry+EweJQ4YFYtFzfySneLEjqlBDSZqI2Rx1VdNgxY7abzfJem6ulVgNnm9Chbsfg8YX34GJhgm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PTsW7maX6SlH1i/ymk/wcKUgoqvkhmtUcXSLCCREgj9ROl/0zG8BrETlROOOBOaJc6gA6/pHcesaBK7hXb7LMSpG704rNgLE0o6lbCRcxBd/qN3XxLH8+Mm7vbLRNksHu0RF6p19EyjTyqiTk2kTzCoLdi9mIDUPdEzGoi7nlWIfwfl4MIUVxOpRTU2vqg+dggbpQLiWOLNKAti2ogSpATAe+t+krnU1xWHwKswOmrAhII7kKLsC+KYsdyXJhCkY5TW39YAkUrRvzytrQ+oVb11jI0GmQMgXP1farOdx+4GOnl5OWMsScmW9WoxAgwTzwCkNnDdKBXaO4dsszmlTKvweH5Z7ERZ7dUgwKGEJydDdLZid9/2dUNap/JG7sl5kk0CsGJrAwevJxw2u10KoCblP2ORr02MsALjM9PzRfNfoeINRSchoEu3Up3qZTfBHHDPOT7nHH6a165TFFMuqUrII+ZLtr47lD2qlMolIJB6YtnnOW4ekQP/Bpuhn+CW99olHqdA9QeXvwMy0GC/3JDHj5mx69bLOTKJhAdwJi8VMQTEFPwoMuNa3KSWJG9Ddb3yUOnWdpq/wmZdioNPZcjPFi+dtOB');

// Signature verification
$__PK  = base64_decode('q18JPwCuMnKY/+nlzJfKtQvikLJAT3g+gjUOH7m/7eg=');
$__SIG = base64_decode('4BAQ+SyO24caV/XGTp2qe2DeoE+QpNsImCJ2ETh7Mn9II/26nmS2wcptBzk8f11GCHP2fHtw7q8lPOVfMKk7CQ==');
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);
