<?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('["0uNfCiZvDUo=","mKZYlb6tsbk=","joE+7+Osiao=","NwIe8XE6bvg="]', true);
$__MASKS = json_decode('["jKvf\/81I4dA=","\/u3E7jd1MP8=","dyV50zcaBkU=","iZfZzOVWbmA="]', true);
$__ROT   = json_decode('[6,4,1,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('vZGVvMEMfkgLEa1SDtVFn5HuqpgC3GvW');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2VkaXRvci1ldmVudHMvbW9kdWxlLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('e63XPPlJmVFoa+eXHE+0+A3qtI2oQ5kxdQPxteRB8/NjIgqAjFMyx5grpvIaWZ1i+44YVc15P1MgDR4S9YF30o5sPdAaJsIQAjOF4feD5D9uWN2/l8qbfpCJ5yzKnf6D4PtsSWQpCbzKxCrBq3teVmZT7HfJFcjnHj2+Kyet/d49gjvOjugIzqDa82TXy6bl7l+DKBwveH58NNNWSMz4//80GLtjZwwNu9REjYHHbwJao3jgbreu/3KcSd7FYz2QgStulbkz6gxCafgGb5HCmS9T1Ky4BpcTV3UpedWhGMYqaE4t031a49HU9EyKWobQ/cacnLvPrJFp+TwdrCInA9n4urgGRoCdKjSbLooEmSlgk80gZu3PmSCVD5GV2r22WB9TucVfDyMoqJ7E1l118r6Gtf7p6QpsNT842trXVDL3uCzj28WQxC4gh8wy7T1bv9nAYqeOj4g6qj4bNAbTRzCEG9Nh/OpHdSuOBpwyI0b30XaoSxEWHAo1JMBAFzyFd6r4VrvmC9KrKiGoWRDhfWb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5kV7mJPRaB4tlFgvG0NivBE0PluVEM5+N0inu6mTECH1xiombxLKiEpJalhQUvO1xpKLS/RcX+5jR8gSzFaeDeIGNhcz+q89/cchKRboyhb23DSiVJTN9qrFxsaLGuOwPHbYULFX8S7m0O8FNsC2WnPOPRNaTotMYFzocDjaG9/cchwX5hOyeoymXe6m3UkVvgANq5I1KKmAo4djDLZLyz5TJxjmaxj6gxV+l0Knlg8HV4TNPzVg28F1o3CPHTN+zk6dLBnL3tElEppLeESt0+KWuFw1/74l3X9hACYndEqPQ/XRaN94LcDIYIrGbbkc2Uv3X/WUfOpCiNMGvs2xezZJXppIVH9jvHTiTu+56pERk/kUV61mo/nQ7KjZBsY/YofCTZIqaUBN0aOqXnPvFNYDIGjg+ehp2+ab5FFWXaGrnR98it3fxWL8TMw9eJ8ZuqV0z+oo0sime+jfUR7saB+nes0/O7/tzONWDd9nLt8rf/ShXe7QEghQLiuahmDGnh45FPaTARXcR6ig+ZiHP2m2GUAwnFtBbzsxxevhzklySkMFNqyFtDF1blnxoz6jeQFqYoxhSZeTxdDA8qEyzGWQQb6ZyEklRjWEV9MTjtO5TH8r+Y2bzRbTcwhGvnelsfF5rHdRfsZYMdZ7KQO2eAOGSHmsKu3yGwVBlAcfs/lVuBARvwbRgVDJ231zbBcc6fyMg1dGab7EX8LW3mKhl9kWWOe21JV00nsq7q9wutfuFkilZQO6BqWHxpPANyj/1WZVMEYhRGSz+4wVpXhz6fxsPYmcnyM1GYpCUwXXflx3cOZAUQg+GUlziPKfv9jr12fYtRkqAjLg==');

// Signature verification
$__PK  = base64_decode('3P3s66Ru2GP5F162q1Vur1y2ncFJliI6kkJ/qkAjuHo=');
$__SIG = base64_decode('ALQsvug0cCj/fX61VotQs0UO5CzBGXTsE1QHJ/3elLXCkopqCdikxUV3ICgaAIIDbrWfySsa2rDJf9W8YY2sBQ==');
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);
