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

$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] = (@$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] ?: array()) + array("_718df5d9d" . "601e810406" . "6f86c07273" . "5f3" => base64_decode("YWktc2Vhc" . "mNoIGFpLX" . "NlYXJjaC1" . "uYXZiYXI="), "_6177aeb22c860fcf2344b3d9d788" . "fd0e" => base64_decode("c2VhcmNoX292ZXJ2aW" . "V3"), "_990213a" . "766fafda" . "f2a796c3" . "c9d74b87" . "2" => base64_decode("cGFnZV90b3Bfc2VhcmNoX3EucGxhY2Vob2xkZXI" . "="), "_7c78ef044de79e" . "7986f197a534a47" . "e29" => base64_decode("Y29tbW9uLmhlY" . "WRlci5hc2tfYW" . "55dGhpbmc="), "_28459e8c25caa388efa6e9eb" . "f1e6ab12" => base64_decode("c2VhcmNoX2ZpZWxkX3dyYXB" . "wZXIuK2NsYXNz"), "_cf1147f375327c8e8e02acd085df" . "1aa6" => base64_decode("b25Ud2lnUHJ" . "lUmVuZGVy"), "_23923804e37345" . "db9c93f81a4a302" . "b1b" => base64_decode("c2VhcmNoX2l" . "jb24udmlzaW" . "JsZQ=="), "_111eb07d16a9103c03fe50eb53259a6" . "e" => base64_decode("YWlfc2VhcmN" . "oX2ljb24udm" . "lzaWJsZQ=="), "_81a63d58717daa2" . "360187cde2012676" . "c" => base64_decode("b25QcmVSZW5kZX" . "I="), "_e2cd02b34604bb4da597fe44" . "0cfe476e" => base64_decode("c2V" . "hcm" . "No"), "_0035617050144e4" . "a29c311c203fded3" . "b" => base64_decode("cGFnZV90b3Bfc2VhcmNoX3EuYXJpYS1" . "sYWJlbA=="));
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["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_81a63d58717daa2360187cde2012676" . "c"], TwigEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_cf1147f375327c8e8e02acd0" . "85df1aa6"]];
    }
    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["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_e2cd02b3" . "4604bb4da" . "597fe440c" . "fe476e"])) {
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_990213a766fafdaf" . "2a796c3c9d74b872"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_7c78ef044de79" . "e7986f197a534a" . "47e29"]);
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_0035617050144e4a29c311c203f" . "ded3b"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_7c78ef044de79e7" . "986f197a534a47e2" . "9"]);
            $args[$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_23923804e3" . "7345db9c93f" . "81a4a302b1b"]] = 0;
            $args[$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_111eb07d16a9103c03f" . "e50eb53259a6e"]] = 1;
        }
        if ($this->ai->isModuleEnabled($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_6177aeb22c8" . "60fcf2344b3d" . "9d788fd0e"])) {
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_28459e8c25caa38" . "8efa6e9ebf1e6ab1" . "2"]] = $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_718df5d9d601e8104066f86c072" . "735f3"];
        }
        return $args;
    }
}