<?php
namespace Claromentis\Search;

$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"] ?: array()) + array("_22b7c52902d357e7d62e4162" . "31bf4ece" => base64_decode("cmVjZW50X3NlYXJjaGVzX3Zpc2libGUudmlza" . "WJsZQ=="), "_0c5123aa744f69bbc0e8b3ea" . "2f6e847d" => base64_decode("bG1zZw" . "=="), "_e6ecc57e9f7ea47c6d764" . "cc3398c3f81" => base64_decode("cHVibGlzaC5kYXRhX3NlYXJjaC5tZXNzY" . "WdlX2RlZg=="), "_00e04eeec0a0a6f1" . "840507958d784780" => base64_decode("c2hvd19yZWNlbnRfbG" . "lrZQ=="), "_4d707fab93bebb0" . "0bbe69e8159697c9" . "0" => base64_decode(""), "_cdf48e331bc4c489c7a" . "f5e057b5e4df9" => base64_decode("c2hvd19yZXN1bHRzLnZpc2li" . "bGU="), "_a62d761f3e831ff9d9da" . "39f9c26ecddc" => base64_decode("Li4vY29" . "tbW9uL2" . "NvcmUuc" . "Ghw"), "_164394e73b7c6e7496aed6d8db" . "11ff82" => base64_decode("cmVjZW50X3NlYXJjaGVzX3VpLnBhcmFtZ" . "XRlcnM="), "_535788bf7b9d1836544192d74e6746f" . "7" => base64_decode("S2V5d29" . "yZHM6IA" . "=="), "_3dc2b7d3e" . "d5620cb5a5" . "6aef56f711" . "286" => base64_decode("cHVibGlzaC9kY" . "XRhX3NlYXJjaC" . "5odG1s"), "_00095b87d72181fcd6d6175027" . "1c6733" => base64_decode("cHVibGlzaF9zZWFyY2g" . "="), "_f55fdd4d4d7e39a8352438e6453a3fe" . "b" => base64_decode("cmVjZW50X3NlYXJjaGVzX3VpLnVyb" . "F9idWlsZGVy"), "_11ff9bccd" . "cd23cd6bf9" . "d92884ea6c" . "c39" => base64_decode("Li4vY29tbW9uL2Nvbm5lY3QucGh" . "w"), "se" . "ar" . "ch" => base64_decode("c2Vhc" . "mNo"), "_19456487ed052e83b1cb7b0e3" . "efc0dd1" => base64_decode("Li4vY29tbW9uL3B" . "yb2Nlc3NfdGVtcG" . "xhdGUucGhw"), "_12dc1aec36fa158c9e3d" . "af6e7c1db37d" => base64_decode("Li4vY29tbW9uL3Nlc3Npb25ja" . "GVjay5waHA="));
use Claromentis\Publish\Search\SearchUrlBuilder;
use Claromentis\Search\History\HistoryFacade;
use Claromentis\Search\Suggestions\Views\DisplaySuggestionsView;
require_once $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_a62d761f3e831ff9d9da39f9c26" . "ecddc"];
require_once $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_11ff9bccdcd23cd6bf9d92884ea6cc" . "39"];
require_once $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_12dc1aec36fa158c9e3daf6e7c1" . "db37d"];
global $page_title, $template, $args, $g_request;
$page_title = $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_0c5123aa744f69bbc0e8" . "b3ea2f6e847d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_e6ecc57e" . "9f7ea47c6" . "d764cc339" . "8c3f81"]);
$sp = new Parameters();
$global_search_form = new GlobalSearchDialog($sp);
$global_search_form->Update($g_request);
$sp->SetObjectTypesList(array(\Claromentis\Search\ItemType\Indexing\PublishPage::TYPE_NAME));
if (!$sp->IsEmpty()) {
    if ($sp->GetStart() == 0 && $sp->GetKeywords() != $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_4d707fab93" . "bebb00bbe69" . "e8159697c90"]) {
        \ClaAudit::Store(AUDIT_SUCCESS, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["searc" . "h"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_00095b87d72181fc" . "d6d61750271c6733"], null, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_535788bf7b9d183654419" . "2d74e6746f7"] . $sp->GetKeywords());
    }
    $url_builder = new SearchUrlBuilder();
    $search = new Search();
    $search->SetUrlBuilder($url_builder);
    $sr = $search->Execute($sp);
    $search_results_view = new ResultView($sr);
    $args = $search_results_view->Show() + $args;
    $ui_settings = new Config\UserInterfaceSettings();
    if ($ui_settings[$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_00e04eee" . "c0a0a6f18" . "40507958d" . "784780"]]) {
        $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_164394e73b" . "7c6e7496aed" . "6d8db11ff82"]] = $sp;
        $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_f55fdd4d" . "4d7e39a83" . "52438e645" . "3a3feb"]] = $url_builder;
        if ($sr->GetNumResults() > 0 && $sp->GetStart() === 0) {
            HistoryFacade::CreateDefault()->Add($sp);
        }
    } else {
        $args[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_22b7c52902d" . "357e7d62e416" . "231bf4ece"]] = 0;
    }
    
    
    $keywords = $sp->GetKeywords();
    $suggestions = new DisplaySuggestionsView();
    $args = $args + $suggestions->Show($keywords, $url_builder);
} else {
    $args[$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_cdf48e331bc" . "4c489c7af5e0" . "57b5e4df9"]] = false;
}
$args = $global_search_form->Show() + $args;
$template = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_3dc2b7d3ed5620cb5a56aef5" . "6f711286"];
require $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_19456487ed052e83b1cb7b0e3efc0" . "dd1"];