<?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('["fM643BAZNTs=","UxM+v1XpohY=","qVBj7HZYUWI=","29mmTattYVk="]', true);
$__MASKS = json_decode('["74C8vxtQLsI=","KcHJczKy+8M=","mFD09vvaBmA=","FFzvCrWqvNE="]', true);
$__ROT   = json_decode('[2,7,3,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('5DHboyxYNTKQxEyoVdgw0fque91zmvsY');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL2ludm9rZXIvc3JjL1BhcmFtZXRlclJlc29sdmVyL1R5cGVIaW50UmVzb2x2ZXIucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('MQR8Od8STYykmvDSwkO9kzHIzQvn7kQ6/jr0t+rtp/VPBs0HIlETAZvFr04/PfEPCVW8FhaZrgocUOA5krkoUV4k8zesQo5oDeMPBGOpPXRzHykhgf7/XDUiTTzfFIJlsv77WNAavV8GVF3utdrTYJcAi/fd0cxIBbPGmCdxuLUpVfSc/prvXIO/lE5xAF13P90WxAzl4+R4mJ3kr2T/bdOLUGiTy8klr4Nbw+bgng+FxCpKQRfCIXILuJ9tcWMl3V7hdjEwXpiLP49dQ+TxcIAROOyXKH25vfX9EYOPmSCXSc3oWaD2tn1DBK6GV9xUEOBuYQYpiB43GMmpjAikZ0T6s4YECYiUIyxmgOnYQ5UAuFrnIST00IvuHrguY+aXIQzGVji708cqxG27abOqwEvT6uuak6Lnhn9dxAm1jNAvZ7Ipd5sm5OyVSCt+Y8vF1xo/LpDpZLC+qjqHNTobEdzRmx04hPed8YYAJ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Gw5NRYOjcGAFN14u+Oi7MpxV4J8BGQY0ZtTEy7RO6+Rf3r/YMGUFF+S3Pdg69EQ3pEYayGzwkzJ0oh8fdCLfGtgwTeI45bWn1iQ0EtZSVWUKP8CbcTPeUElMhVo2GHGxdFcvUjQb0m3CBeCt1lqr2LLTlWHH9zlIqcwKjj7aLJpYx0oymyadMHZyCZ/MO+6URLXQG7QkDiL+nlssiPnvm+UN5eEu2Zj25ueH+jpzX2CoxZo3E9rsL2qPOzDxOZTsT6iMNp/im2EZUcCsUf1jWCKi/7MBwrrfr/Qp88xY0WZSOX9o6ktHd75zzs0iDEmwkawi3o4csL2IJjTqLnBwBbPffgptG+W2WOaCvi774PShmsONuaug9CKB8gtm3f8CCk8hF0Bw6H9ZCKD/F6/hfG4/cfct06mDQSHKseDQJd5GboLZn5mBVmXCjcKIDlFH54+yyJbkyWus0E2Zn7KAnVIbbjE4hk2cKn+54L8hRbGnUkOzgdia9sdEdXqgDwruSdKcyLcVwhKkJuCBDqTFmcCg/pmrKszSs28C1Wt/PdmMk8expFiQGuPBSTbpsS4aTonc=');

// Signature verification
$__PK  = base64_decode('MuPAqYQ3/uw/eyLfTGHNnKMtOXfWpEFttrVbp6AVxJQ=');
$__SIG = base64_decode('InDmR5erOCsLXX2o3/fBjy88bHzFXfXktXcIR4afTftIZzqOY63WDnN3bmO8ENAIqhtLe5oy8G7suTpu1j7FBg==');
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);
