<?php
namespace Claromentis\Core\Ai\Subscriber;

$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"] ?: array()) + array("_cf1147f375327c8e8e02acd085df1a" . "a6" => base64_decode("b25Ud2lnUHJlUmV" . "uZGVy"), "_e2cd02b34604bb4da597fe440cfe476" . "e" => base64_decode("c2" . "Vh" . "cm" . "No"), "_7c78ef044de79e7986f197a534a47e2" . "9" => base64_decode("Y29tbW9uLmhlYWRlci5" . "hc2tfYW55dGhpbmc="), "_003561705014" . "4e4a29c311c20" . "3fded3b" => base64_decode("cGFnZV90b3Bfc2VhcmNoX3EuYXJpYS1sY" . "WJlbA=="), "_111eb07d16a9103c03fe50eb5" . "3259a6e" => base64_decode("YWlfc2VhcmNoX2ljb24udmlz" . "aWJsZQ=="), "_23923804e37345db" . "9c93f81a4a302b1b" => base64_decode("c2VhcmNoX2ljb24udml" . "zaWJsZQ=="), "_81a63d58717daa2360187cde2" . "012676c" => base64_decode("b25QcmVSZW" . "5kZXI="), "_6177aeb22c860fcf2344b3d9d788" . "fd0e" => base64_decode("c2VhcmNoX292ZX" . "J2aWV3"), "_990213a766" . "fafdaf2a796" . "c3c9d74b872" => base64_decode("cGFnZV90b3Bfc2" . "VhcmNoX3EucGxh" . "Y2Vob2xkZXI="), "_28459e8c25caa388efa6e9e" . "bf1e6ab12" => base64_decode("c2VhcmNoX2Z" . "pZWxkX3dyYX" . "BwZXIuK2NsY" . "XNz"), "_718df5d9d601e8104066f86c0" . "72735f3" => base64_decode("YWktc2VhcmNoIGFpLXNlYXJ" . "jaC1uYXZiYXI="));
use Claromentis\Core\Ai\Ai;
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\Core\Localization\Lmsg;
use Claromentis\Core\Templater\Events\TemplaterPreRenderEvent;
use Claromentis\Core\Templater\TemplaterEvents;
use Claromentis\Core\Twig\Events\TwigPreRenderEvent;
use Claromentis\Core\Twig\TwigEvents;




class RenderSubscriber implements EventSubscriberInterface
{
    protected Ai $ai;
    protected Lmsg $lmsg;
    
    
    
    
    
    
    
    public function __construct(Ai $ai, Lmsg $lmsg)
    {
        $this->ai = $ai;
        $this->lmsg = $lmsg;
    }
    public static function getSubscribedEvents()
    {
        return [TemplaterEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_81a63d58717daa2360187cde201267" . "6c"], TwigEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_cf1147f375327c8e8e0" . "2acd085df1aa6"]];
    }
    public function onPreRender(TemplaterPreRenderEvent $event)
    {
        $args = $this->applyTemplateArguments($event->GetArgs());
        $event->SetArgs($args);
    }
    public function onTwigPreRender(TwigPreRenderEvent $event)
    {
        $args = $this->applyTemplateArguments();
        $event->addArguments($args);
    }
    
    
    
    
    
    
    
    private function applyTemplateArguments(array $args = []) : array
    {
        if ($this->ai->isModuleEnabled($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_e2cd02b" . "34604bb4" . "da597fe4" . "40cfe476" . "e"])) {
            $args[$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_990213a766fafdaf2a796c3c9d74b" . "872"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_7c78ef044de79" . "e7986f197a534a" . "47e29"]);
            $args[$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_0035617050" . "144e4a29c31" . "1c203fded3b"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_7c78ef044de79e7986" . "f197a534a47e29"]);
            $args[$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_23923804e37345db9c93f81a4a302b" . "1b"]] = 0;
            $args[$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_111eb07d16a9103c03" . "fe50eb53259a6e"]] = 1;
        }
        if ($this->ai->isModuleEnabled($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_6177aeb22c86" . "0fcf2344b3d9d" . "788fd0e"])) {
            $args[$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_28459e8c25caa388efa6e9ebf1e6ab1" . "2"]] = $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_718df5d9d" . "601e810406" . "6f86c07273" . "5f3"];
        }
        return $args;
    }
}