static function loadAgent($agent)
    {
        p::setMaxage(-1);
        p::setPrivate();
        p::setExpires('onmaxage');
        $a = p::agentArgs($agent);
        $a = implode(',', array_map('jsquote', $a));
        $agent = jsquote('agent_index' === $agent ? '' : p\Superloader::class2file(substr($agent, 6)));
        $lang = p::__LANG__();
        $appId = p::$appId;
        $base = p::__BASE__();
        if (PATCHWORK_I18N) {
            ob_start();
            self::writeAgent(new \loop_altLang());
            $b = substr(ob_get_clean(), 4, -1);
        } else {
            $b = '0';
        }
        $lang = $lang ? " lang=\"{$lang}\"" : '';
        $uri = p::__URI__();
        $uri .= (false === strpos($uri, '?') ? '?' : '&') . 'p:=serverside';
        false !== strpos($uri, '<') && ($uri = str_replace('<', '%3C', $uri));
        false !== strpos($uri, '>') && ($uri = str_replace('>', '%3E', $uri));
        echo $a = <<<EOHTML
<!doctype html>
<!--[if lt IE 7]><html{$lang} class="lt-ie9 lt-ie8 lt-ie7 ie6"><![endif]-->
<!--[if IE 7]><html{$lang} class="lt-ie9 lt-ie8 ie7"><![endif]-->
<!--[if IE 8]><html{$lang} class="lt-ie9 ie8"><![endif]-->
<!--[if gt IE 8]><!--><html{$lang}><!--<![endif]-->
<meta charset="utf-8">
<noscript><meta http-equiv="refresh" content="0; url={$uri}"></noscript>
<script name="w\$">a=[{$agent},[{$a}],{$appId},{$b}]</script>
<!--[if !IE]><!--><script name="w\$" src="data:text/javascript,a[4]=1"></script><!--<![endif]-->
<script src="{$base}js/w?{$appId}"></script>
EOHTML;
    }
 static function send($agent)
 {
     header('Content-Type: text/javascript');
     p::setMaxage(-1);
     echo 'w.k(', p::$appId, ',', jsquote(p::$base), ',', jsquote('agent_index' === $agent ? '' : p\Superloader::class2file(substr($agent, 6))), ',', jsquote(isset($_GET['__0__']) ? $_GET['__0__'] : ''), ',', '[', implode(',', array_map('jsquote', p::agentArgs($agent))), ']', ')';
 }