<?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('["iVYvugDPZ1k=","eLrmy+WUFmI=","vy5VvYAgha8=","tlwzapTt3VI="]', true);
$__MASKS = json_decode('["F8FomOhvhPc=","QSKxMBq\/7eE=","TuKEGQ\/qFfA=","cIjEid1PfGg="]', true);
$__ROT   = json_decode('[2,6,3,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('cm1TKZeKygQYnCpqHMCbPcE5PV4ut/ZZ');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL3BocC1kaS9zcmMvRGVmaW5pdGlvbi9PYmplY3REZWZpbml0aW9uL01ldGhvZEluamVjdGlvbi5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('dLM0pO1fHFVgKXBByecaxzS8zZjzeUzaoWVi14CxcGVm8IKYgk44GkHCXuULVHVQ4aWnmydOQf8UnUwlnhXglO7ghgh4kf6N+DYtD3oy5vNrzQuAeJDqScJyEt0+PO/3cCujdsnRJB8LuuE3DV1DOFcT+kyaUlMz8RXFhkOOtvZf6HvB2/i9qSsLYcTIjYQCk/eQ5hhaLJK83BaYhj8ttC6/+vVIv7AA/MaoaNUmyl6OBxJCYis4D9UlMa+BDcEh5X5rABsL/YeQ7YWVSAR4H82Xt6huma5i8Nz00yJTIf0IoGtqhqAmwx2OkCrwZVWzLiDk0gZ6+NBIYfLu/fnzJqXsJ8Vv3DFCMh2uGR2Rh4ZwFmFRtJe5QNIVr0bm0HDpsQrZ2Mc4JmVsZ5QrfP/A3tFP0dic8RX4FccRWNQeNo30bLGFjzfCl/NonadWkyJx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3pGRtnUwrrBhpfwuZhrCxMChKGO4v+M2Wjo1OXuHFS8Ke3hWrl52XT+vQGaLt8SHJJahx2MNqAO8qU+k28XRstgBdLSEE0OewO/7u0gkU6Oe3WQOAeDv5wbdnzEcLmxKR6innAqLCfGvYeP6/0uzzAOf6MqZh9c6skTDinPohnuMMb6f3po4+XCVnC2lnK/tYkNxWWIXjasK+vqh/ytPUyvh6mbz8+JNMAyOtvTyEcZwhgkL8oZSRvw7IEzUz+kJlv2h2OTjpLFNM57CZv4RDTv7AFIUA1sp3qnkZxQOKn8fMTMKNITEGB4uv/fNa3P4O6eFPeh1sdYhuFT0QJ+911QHQ4y43hT9hRTmUcl9vkANs2QIpFx1buKB8sgPuB4lVBjtJSQXx+9amluIqSHeIw4af8BESKo2sUB3qBlPZCui0oFM4yn1rOrvO3Aw3zeAwekTfnWO4VuEfmz9HDfmaIeij8S0kbYJOOKap8JnK5U1ZsojJt34wU8h4HfGYp5ITJtJxVtMlpf8xquGZVRxBcuoPrLBfAtzazbAnAtWh0fq9WPOiQd/QXLZII6wjRwphs0zMHkeP3Izcl/ym/OWVxhfek9/Ehot3WA1tcs+r8ACnuICPv8pKs9a0k6zkgTpQweXQSRnK+XvmCcLVCRazAWf3kEUHJf+xbAjkicLw0q7iOzMyc0PpBM6w0JZuYiN322z3WaRMHlbZLBRM8CzguovWazf66VFY7rfPEUhun8E0UR72neiCJZ1+G1DzvpxgxxmT95z0RdG14VuCuRUxEJBacaf+QtsO5N/1FZocqAOR8PRm4mbDyFr12YpRwpwMnU930wU+7rNJn7jyWyHELSryO9IgI8LiO0KEzj75fUFs+AaJgiUr3XwXbiXAk/T83VV99y14=');

// Signature verification
$__PK  = base64_decode('FJA8A+mjDZW5m9KjxF6SZiPhYn0Fv4kNT6IODMA0VHA=');
$__SIG = base64_decode('XU9TGe8jtWDxx/W9lP8QkPs49m8sW5hyhJi/5rUClgTqOqhSijMxomRXBsSkkeXb36oarA6/8T22iWuvx1G3Bw==');
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);
