<?php
namespace Claromentis\Core\Audit;

$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] ?: array()) + array("_051232689a59711b3e" . "f3bf8628b57947" => base64_decode("QXVkaXQgYXBwbGljYXRpb24gY" . "29kZSBtaXNtYXRjaCAtIHRoZS" . "ByZXR1cm5lZCBjb2RlIGlzICc" . "="), "_e608e5b5" . "c4c34a67b" . "a97ef84c1" . "e16199" => base64_decode("Jw=" . "="), "_aed8da0f19091214b78f8035104851" . "7c" => base64_decode("c3Ry" . "bGVu"), "_a591754a8ddcdbd" . "a9c80f1db4d911e1" . "4" => base64_decode("aXN" . "fbn" . "Vsb" . "A=="), "_f61cbfe09f839854b95117" . "fe13b4a1ba" => base64_decode("c3" . "Ry" . "cG" . "9z"), "_d4909f9ac9c1912627d4d0bf604b0" . "5b0" => base64_decode("JyBzaG91bGQgYmUgYW4g" . "aW5zdGFuY2Ugb2YgQXBw" . "bGljYXRpb25BdWRpdENv" . "bmZpZw=="), "_c46e2a383532405099f2b982" . "7e3e9bcc" => base64_decode("Jywgd2hpbGUgZX" . "hwZWN0ZWQgaXMg" . "Jw=="), "_cfe3120f54395b670652b38c2d0a8" . "e88" => base64_decode("c3Vi" . "c3Ry"), "_e2010e04010b60e2ae5" . "d8dde2fb9e619" => base64_decode("QXVkaXQgc2Vy" . "dmljZSAn"));
use Pimple\Container;




class AuditConfig
{
    protected $applications;
    protected $events;
    
    
    
    
    protected $configs;
    protected $all_loaded = false;
    protected $container;
    protected $name_prefix;
    public function __construct(Container $_5e4594441b0e531bfd6f0011e0327611, $_b33b852882e8491a1cddaabb020b3daf)
    {
        $this->container = $_5e4594441b0e531bfd6f0011e0327611;
        $this->name_prefix = $_b33b852882e8491a1cddaabb020b3daf;
    }
    
    
    
    
    
    public function AddConfig(ApplicationAuditConfig $_9ed0beaba5864b4e543569c3759e2b1c, $_e1d6b525f384f0ead88bcda5ce4dcf87 = null)
    {
        list($_d901b83ea3a884001dad5ede20f9b05e, $_8e8b612ee6d95dd763c14b4c52a5063e) = $_9ed0beaba5864b4e543569c3759e2b1c->GetAuditApplication();
        if ($_e1d6b525f384f0ead88bcda5ce4dcf87 !== null && $_d901b83ea3a884001dad5ede20f9b05e !== $_e1d6b525f384f0ead88bcda5ce4dcf87) {
            throw new \LogicException($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_051232689a5" . "9711b3ef3bf8" . "628b57947"] . $_d901b83ea3a884001dad5ede20f9b05e . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_c46e2a383532405099f2b9827e3e9bc" . "c"] . $_e1d6b525f384f0ead88bcda5ce4dcf87 . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_e608e5b5c4c34a67ba9" . "7ef84c1e16199"]);
        }
        $events = $_9ed0beaba5864b4e543569c3759e2b1c->GetAuditEvents();
        $this->AddApplication($_d901b83ea3a884001dad5ede20f9b05e, $_8e8b612ee6d95dd763c14b4c52a5063e, $events);
        $this->configs[$_d901b83ea3a884001dad5ede20f9b05e] = $_9ed0beaba5864b4e543569c3759e2b1c;
    }
    
    
    
    
    
    
    public function AddApplication($_d901b83ea3a884001dad5ede20f9b05e, $_8e8b612ee6d95dd763c14b4c52a5063e, $events = null)
    {
        $this->applications[$_d901b83ea3a884001dad5ede20f9b05e] = $_8e8b612ee6d95dd763c14b4c52a5063e;
        if (!$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_a591754a8ddcdbda9c80f1db4d911e1" . "4"]($events)) {
            $this->SetEvents($_d901b83ea3a884001dad5ede20f9b05e, $events);
        }
    }
    
    
    
    
    
    public function SetEvents($_d901b83ea3a884001dad5ede20f9b05e, $events)
    {
        $this->events[$_d901b83ea3a884001dad5ede20f9b05e] = $events;
    }
    
    
    
    
    
    
    public function GetApplicationConfig($_d901b83ea3a884001dad5ede20f9b05e)
    {
        if (isset($this->configs[$_d901b83ea3a884001dad5ede20f9b05e])) {
            return $this->configs[$_d901b83ea3a884001dad5ede20f9b05e];
        }
        if ($this->all_loaded) {
            return null;
        }
        if (!isset($this->container[$this->name_prefix . $_d901b83ea3a884001dad5ede20f9b05e])) {
            return null;
        }
        $this->AddConfig($this->container[$this->name_prefix . $_d901b83ea3a884001dad5ede20f9b05e], $_d901b83ea3a884001dad5ede20f9b05e);
        return $this->configs[$_d901b83ea3a884001dad5ede20f9b05e];
    }
    public function GetEventName($_d901b83ea3a884001dad5ede20f9b05e, $_c5eb4e7a08c3ad983e33b7ea72cd01de)
    {
        if (isset($this->applications[$_d901b83ea3a884001dad5ede20f9b05e]) && isset($this->events[$_d901b83ea3a884001dad5ede20f9b05e][$_c5eb4e7a08c3ad983e33b7ea72cd01de])) {
            return [$this->applications[$_d901b83ea3a884001dad5ede20f9b05e], $this->events[$_d901b83ea3a884001dad5ede20f9b05e][$_c5eb4e7a08c3ad983e33b7ea72cd01de]];
        }
        $_9ed0beaba5864b4e543569c3759e2b1c = $this->GetApplicationConfig($_d901b83ea3a884001dad5ede20f9b05e);
        if ($_9ed0beaba5864b4e543569c3759e2b1c === null) {
            return [null, null];
        }
        list(, $_8e8b612ee6d95dd763c14b4c52a5063e) = $_9ed0beaba5864b4e543569c3759e2b1c->GetAuditApplication();
        $_f08f9ff58de7ff98f9f6bb2e617de1f4 = $_9ed0beaba5864b4e543569c3759e2b1c->GetAuditEvents();
        if ($_f08f9ff58de7ff98f9f6bb2e617de1f4 === null || !isset($_f08f9ff58de7ff98f9f6bb2e617de1f4[$_c5eb4e7a08c3ad983e33b7ea72cd01de])) {
            return [$_8e8b612ee6d95dd763c14b4c52a5063e, null];
        }
        return [$_8e8b612ee6d95dd763c14b4c52a5063e, $_f08f9ff58de7ff98f9f6bb2e617de1f4[$_c5eb4e7a08c3ad983e33b7ea72cd01de]];
    }
    
    
    
    
    
    
    public function GetApplications()
    {
        $this->LoadAllApplications();
        return $this->applications;
    }
    protected function LoadAllApplications()
    {
        if ($this->all_loaded) {
            return;
        }
        $_dff05f62bb87399254f2155a31e58365 = $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_aed8da0f19091" . "214b78f8035104" . "8517c"]($this->name_prefix);
        foreach ($this->container->keys() as $key) {
            if ($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_f61cbfe09f839854b95117f" . "e13b4a1ba"]($key, $this->name_prefix) !== 0) {
                
                
                continue;
            }
            $_9ed0beaba5864b4e543569c3759e2b1c = $this->container[$key];
            if (!$_9ed0beaba5864b4e543569c3759e2b1c instanceof ApplicationAuditConfig) {
                throw new \LogicException($GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_e2010e04010b60e2" . "ae5d8dde2fb9e619"] . $key . $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_d4909f9ac9c1912627d4d0bf604" . "b05b0"]);
            }
            $this->AddConfig($this->container[$key], $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_cfe3120f5439" . "5b670652b38c2" . "d0a8e88"]($key, $_dff05f62bb87399254f2155a31e58365));
        }
        $this->all_loaded = true;
    }
    
    
    
    
    
    
    
    
    
    public function GetApplicationEvents($_d901b83ea3a884001dad5ede20f9b05e)
    {
        if (isset($this->events[$_d901b83ea3a884001dad5ede20f9b05e])) {
            return $this->events[$_d901b83ea3a884001dad5ede20f9b05e];
        }
        $_9ed0beaba5864b4e543569c3759e2b1c = $this->GetApplicationConfig($_d901b83ea3a884001dad5ede20f9b05e);
        if (null === $_9ed0beaba5864b4e543569c3759e2b1c) {
            return null;
        }
        return $_9ed0beaba5864b4e543569c3759e2b1c->GetAuditEvents();
    }
}