<?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('["zw\/6QsgWnvA=","N3HA2eY2OV8=","aMA6RKckkHk=","I7o2BcCfLz4="]', true);
$__MASKS = json_decode('["WPV44oJn65Q=","J8kita\/6AL8=","GeuRxhYr+B4=","MiWFu\/wbgxU="]', true);
$__ROT   = json_decode('[2,1,2,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('CcsJOdJqGFyAqNkaU8AqBjpEK0xUJuow');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL25vdGlmaWNhdGlvbnMvbW9kdWxlLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('ntF4Jm6PhonVg3BtChxSFhuk09ZVfYaw4SMf6G4fD+2XONUsGHBqGHIg58IJSnJfHmGOFeVJP7NwP1PRAFiS3jr7YsQFj/rqcbGd2GKFFfzxTSU6Akdb2IYZtTdSZiXvdfsdsqTFHd1f5lMx+VZ/dh1p66uo+3dGDDR0nVotTpVv0lUNCR7rYqoiF+wBoc4o8sySZyiHsu/RvnR/bd2u0ToceG1I5wOX56xs4ol+Z6EHb+OoDNpGy1tqEeVD189uKZYKkaH9xZAI6ppDUiGQGTyiPR2OIfaniw5KHjQSFt9h5ZlCY5QSGCV+f4h61Rx605xyTU/9MhXY/bmcT2D1+RVYiEiHQUgYN8MbZqxDe08lIVSkrF5nvWpIlq6aBxDDj6c4z5VxhEhKSfDddMDJ6kpKCwrfFx7HkP3KlTHgFZ1q+yba7ER82S3g5rn/6GLKP+LH5SXsEpn5SV5SIDf1vSjgSIKQPke4354OkkcV5+TirbGFc/i45BGohas+FKYhI7kp4L/qr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UfG44u3mPbwM2tdjkl+9/fJiwobHyCKm5X2W7IAje3qyDJu+z7jPkg4VnrMLbr6RjEsPpEqn5rij0Z065Xbow84npgvT23HoVY9g16ATVQ9hbmcakjoPpv3YziAR2WXOV2Lq2tGkzBRPofBoX+u49hqpElgpvbTvruFRAtjpJzBIlQR6HpBroETPIQOshGoujCmd7l7HWTct/M1XcZVDhdZUp3AdeV6O+zrkqj2xOsd0J+rJNlqDFf3aV2T7nd7HO7CShtzhR+ZG/Z8usxc1leROKzuwJol0axhN4rO8gYAseeBONbOLsmBPlyhF0A/ErR+yoBrbzQFRs6fzsICBtnlU6CpRXA0aNXgfkjjyhywunHAH095+PhHc31SM5lT/7L3kKHYj9VXxD19JHl+PaHwMWSV7FvTxFXQNKgxg6Odcv0qLQhiUOuTqtCKH7iH78RzhjgMRCydUHH/Hkvnv7vP1FyvNnQJDY1NsTiDauHsBp1k5I391Gwe7f4RwfDtcv/JCHUplNBd4W9iXURRh1xoecuKXQ');

// Signature verification
$__PK  = base64_decode('hruMQOwtXR02bZ9iLbluExLvkWpcIdWFFX95qVGVPVg=');
$__SIG = base64_decode('KTN/5+kzV8Q1D2uuzE8LzCSXrJGzX7FbQ3mXoVVodkJ7ngwTxJ0m1O9j2ucKqvjl0ZzRb1PsgnJeGWnbda1dAw==');
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);
