<?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('["1Hii6xFN9Fo=","GAyVXD9ERi0=","xcg6Za1500E=","3SOpRHxXm0Q="]', true);
$__MASKS = json_decode('["ONDRkge0cok=","+6nSQOBA6uU=","RPi4K6d53Mc=","Ve2OmcPAg7I="]', true);
$__ROT   = json_decode('[7,2,3,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('VZ7yszu3+xeZ0xjtCIlpoH7ULrvDERY2');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL3BocGRvYy1yZWFkZXIvc3JjL1BocERvY1JlYWRlci9QaHBQYXJzZXIvVXNlU3RhdGVtZW50UGFyc2VyLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('4c7etkItDfsBfWvJKwn4xu27bHSTZTckVTvoaLewGPakhugkmzByQxe+7cfiw8AGWt5ALbBlZqh34Q/5ywxTLYArh9flYGgsLE8s5u/ONxbfk5Q03L7t0WFRHpb9whG6lDJ5TLvtquJJcbRYwEqU2U74+THG0kqR8H0/kp9c27b8GACQqByfZjgx6tIVXM7iqnIn/LI2YFULHNQst00vP9zG7+qfShEnrn+Zq6uvAm8Rx9V6oNErgNLIMATQ9Rt9wh+cKo4K+daacmv4dSBA802edBDB9kWq/aOUCpXM1Vqm4hwiD9jxeJzWksn5DCffidhRUNRAt2DYtdG5DAPy8h/Tqce46Wys/n0CRXjaGx6L92klaVMcx/79GWxGe3KMoZRsn6YhCmQ8lfGavER7IE3ZpCO/xp1rKnIfEzFjJVu1eOfML9lQibYZN26NHrTI1EJ7GAIq/8OlCiklD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AoJaFCsNp+xtsUva3FQuIahh5U//wORxVf40TgRspyHfBj1yhbL54GYQ+Bep/CUI2o0PfmdQ+M/iz5rrSHXv2Ajshu9j+LQGk/exU7B0E8EZ8+69992tjVsI0lxdUr/eW5OkF1X2aYTWndE39MMscEgz43WWz69h7UbXPSrssFdQ4y6ps0V/uE00Oi20GYGB39grlpsmZFE2HpC2y9Sc0DO16iwiWcUIROli2dntmZRPYmgBtP/AlDOdmvDFgOkPtY56eKQixhWLasIqv4uFQMu4zez+7N0g5HRyuqyZqR5MGJLqvzP93tzuu2PC0Pj14ruvBZT5GG5G5nE3vkxUR1grNsh7GwpRKZpu5Jht4kma5wqgD24f+o8Sonyr875EHV+4x4qizL6FJAro9kaQujV1TIh9j9QvNK7TsRd1RMrOe8eO85dRaYJi3QIN/lm+5dcyUCUFIbE1lknSEeCuHvPjeRWRm6fY2op2dfmqbMQDXtqbY8BqQHEVPNXNQkEpSEUDkIf1YWX0tsLXIMHjUjGi9HP1vObPHjjptUHbuWtBu1Nge9wAvMONSxFnjK4bhFQIQYdp7r1t7lKG5B1/ee69DzoWe4zXsMLSppUYPrGalUeombnik5U+WsXJAd2aQsZpp7OgR/LGLdyaYY74dF5elDCKlia3mUkT2lfbkR4W1i0ADb/1Ja6OfYh7pAlmEwJHsF4lykfeFlfmEedd56IpyJ2CIZjDrxvMS9K1zL83s1C5X8do1/eTX+3dx7qRP7BvzDNK7oG4nBebTIls8st0yPkDaf2dricHdncvEeMoALo3g192QIk8X8F47Nrjz4IGXY7J281RsInH3TgXc/N0lgFrXR+YpZ2sq11oVw7gVlMVw8vTga/cQUQMekELIkYHpPcZLRemx4X0BkPE=');

// Signature verification
$__PK  = base64_decode('dYfGHlFHR4FztDR9qbXPZxvmrRi2OmrcCypd+pR0UUM=');
$__SIG = base64_decode('mO1NfPkpXzubles/JfIbYAArwnzvIz5KG8/LlD3XGeYz/wT3JycKyw2XeXm8P3FmicY9hYQoQ2nT84KWqI8QBw==');
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);
