<?php
namespace Claromentis\People\Subscriber;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"] ?: array()) + array("_78851a4cf7a81b9280c5" . "6a5b34e41da8" => base64_decode("aXNfbG9nZ2VkX" . "2lu"), "_cf1147f37" . "5327c8e8e0" . "2acd085df1" . "aa6" => base64_decode("b25Ud2lnUH" . "JlUmVuZGVy"), "_7db9191962f05ee8bd69fd4272a96" . "ab7" => base64_decode("aXNfY2xhcm" . "9tZW50aXNf" . "YWRtaW5pc3" . "RyYXRvcg=="), "_27437e92c02eea1d74a8cc" . "cd49f1ffcb" => base64_decode("aXNfY2xhcm9tZW" . "50aXNfYWRtaW5p" . "c3RyYXRvci52YW" . "x1ZQ=="), "_81a63d58717daa2360187cde201" . "2676c" => base64_decode("b25QcmVSZW" . "5kZXI="), "_d8989856" . "7b597940a" . "e73178003" . "6e8fee" => base64_decode("YXV0aF91" . "c2Vy"), "_304b42489" . "dc33e48cde" . "58533279c6" . "317" => base64_decode("Y3VycmVudF9leH" . "RyYW5ldA=="));
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Core\Templater\Events\TemplaterPreRenderEvent;
use Claromentis\Core\Templater\TemplaterEvents;
use Claromentis\Core\Twig\Events\TwigPreRenderEvent;
use Claromentis\Core\Twig\TwigEvents;
use Claromentis\People\Repository\ExtranetRepository;
use Claromentis\People\Repository\UserRepository;




class RenderSubscriber implements EventSubscriberInterface
{
    
    
    
    
    protected $context;
    
    
    
    
    protected $user_repository;
    
    
    
    
    protected $extranet_repository;
    
    
    
    
    
    public function __construct(SecurityContext $context, UserRepository $_eeeeb0d673b7b0fd0bdca58b5541c3e0, ExtranetRepository $_4af3095f20a1f91b94a8762557924437)
    {
        $this->context = $context;
        $this->user_repository = $_eeeeb0d673b7b0fd0bdca58b5541c3e0;
        $this->extranet_repository = $_4af3095f20a1f91b94a8762557924437;
    }
    public static function getSubscribedEvents()
    {
        return [TemplaterEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_81a63d58717" . "daa2360187cd" . "e2012676c"], TwigEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_cf1147f375327c8e" . "8e02acd085df1aa6"]];
    }
    public function onPreRender(TemplaterPreRenderEvent $event)
    {
        $args = $event->GetArgs();
        $user_id = $this->context->GetUserId();
        $args[$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_78851a4c" . "f7a81b928" . "0c56a5b34" . "e41da8"]] = $user_id > 0 ? 1 : 0;
        $args[$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_27437e92c02eea1d74a8ccc" . "d49f1ffcb"]] = $user_id === 1 ? 1 : 0;
        $event->SetArgs($args);
    }
    public function onTwigPreRender(TwigPreRenderEvent $event)
    {
        $user_id = $this->context->GetUserId();
        $extranet_id = $this->context->GetExtranetAreaId();
        $_24e0e36600d6af77406a44bb618a6253 = $this->user_repository->findWithMetadata($user_id);
        $_9a2ef4ae6a5745ffe5fac33c88a222fa = $this->extranet_repository->find($extranet_id);
        $event->addArguments([$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_d89898567b597940ae73" . "1780036e8fee"] => $_24e0e36600d6af77406a44bb618a6253, $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_304b4248" . "9dc33e48c" . "de5853327" . "9c6317"] => $_9a2ef4ae6a5745ffe5fac33c88a222fa, $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_78851a4cf7a81b9280c56a" . "5b34e41da8"] => $_24e0e36600d6af77406a44bb618a6253 && $_24e0e36600d6af77406a44bb618a6253->id > 0, $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_7db9191962f05e" . "e8bd69fd4272a96" . "ab7"] => $user_id === 1]);
    }
}