<?php
namespace Claromentis\Search\UI;

$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array("_d706c160e45bf7434fff82a5976f" . "0e19" => base64_decode("YXJyYXlfa2V5cw=" . "="), "_78afaeaff5f" . "62c20b8d3a0a" . "16b0ace7b" => base64_decode("c2VhcmNoL3VpL2FkdmFuY" . "2VkX3NlYXJjaF9idXR0b2" . "4uaHRtbA=="), "par" . "ame" . "ter" . "s" => base64_decode("cGFyYW1ldGV" . "ycw=="), "_4d707fab93bebb00bbe69" . "e8159697c90" => base64_decode(""), "_b66252d7bbf3610" . "12a6531a8e3a7323" . "0" => base64_decode("YXJyYXl" . "fZGlmZg" . "=="), "_31767d7ad58e706dbf47b7a51a0" . "fe6c4" => base64_decode("Y291bnQ" . "="));
use Claromentis\Search\Application\AdvancedSearchButtonInterface;
use Claromentis\Search\Application\ApplicationInterface;
use Claromentis\Search\Config\Applications;
use Claromentis\Search\Parameters;
class AdvancedSearchButton extends \TemplaterComponentTmpl
{
    public function Show($attributes)
    {
        $sp = $attributes[$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["par" . "ame" . "ter" . "s"]];
        if (!$sp instanceof Parameters) {
            return $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_4d707fab93b" . "ebb00bbe69e8" . "159697c90"];
        }
        $apps_list = new Applications();
        $_f3e72c5e54a6dd0fb5c5005cd9574e42 = $apps_list->GetSelectedAll();
        $_17728688d370dbb69c53d9e641c4b0e0 = $sp->GetObjectTypesList();
        $_58ffdc5a290a75319499791b0ed95169 = $this->FindMatchingApp($_f3e72c5e54a6dd0fb5c5005cd9574e42, $_17728688d370dbb69c53d9e641c4b0e0);
        if ($_58ffdc5a290a75319499791b0ed95169) {
            
            
            $args = $_58ffdc5a290a75319499791b0ed95169->ShowAdvancedSearchButton($sp);
            $template = $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_78afaeaff5f62c" . "20b8d3a0a16b0ac" . "e7b"];
            return $this->CallTemplater($template, $args);
        }
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_4d707fab93bebb00bbe69e8" . "159697c90"];
    }
    protected function FindMatchingApp($_f3e72c5e54a6dd0fb5c5005cd9574e42, $_17728688d370dbb69c53d9e641c4b0e0)
    {
        foreach ($_f3e72c5e54a6dd0fb5c5005cd9574e42 as $_f44467aacb8a4520c7382769d24aa422) {
            
            
            if ($_f44467aacb8a4520c7382769d24aa422 instanceof AdvancedSearchButtonInterface) {
                $_4b7300c1f8c561c5e59b75b6ba8eeccf = $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_d706c160e45b" . "f7434fff82a59" . "76f0e19"]($_f44467aacb8a4520c7382769d24aa422->GetTypes());
                if ($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_31767d7ad58e706dbf47" . "b7a51a0fe6c4"]($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_b66252d7bbf" . "361012a6531a" . "8e3a73230"]($_17728688d370dbb69c53d9e641c4b0e0, $_4b7300c1f8c561c5e59b75b6ba8eeccf)) == 0) {
                    return $_f44467aacb8a4520c7382769d24aa422;
                }
            }
        }
        return null;
    }
}