<?php
namespace Claromentis\People\Subscriber;

$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] ?: array()) + array("_81a63d58717da" . "a2360187cde201" . "2676c" => base64_decode("b25QcmVSZW5kZXI" . "="), "_304b42489dc33e48cde5" . "8533279c6317" => base64_decode("Y3VycmVudF9l" . "eHRyYW5ldA=="), "_7db9191962f0" . "5ee8bd69fd427" . "2a96ab7" => base64_decode("aXNfY2xhcm9tZW50" . "aXNfYWRtaW5pc3Ry" . "YXRvcg=="), "_d89898567b597940ae73178" . "0036e8fee" => base64_decode("YXV0aF91c2V" . "y"), "_cf1147f375327c8e8e02acd085df" . "1aa6" => base64_decode("b25Ud" . "2lnUH" . "JlUmV" . "uZGVy"), "_27437e92c02eea1" . "d74a8cccd49f1ffc" . "b" => base64_decode("aXNfY2xhcm9tZW50aXNfYWRtaW5pc3RyYXRvci5" . "2YWx1ZQ=="), "_78851a4cf7a81" . "b9280c56a5b34e" . "41da8" => base64_decode("aXNf" . "bG9n" . "Z2Vk" . "X2lu"));
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["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_81a63d58717daa2360187cde20" . "12676c"], TwigEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_cf1147f375327c" . "8e8e02acd085df1" . "aa6"]];
    }
    public function onPreRender(TemplaterPreRenderEvent $event)
    {
        $args = $event->GetArgs();
        $user_id = $this->context->GetUserId();
        $args[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_78851a4" . "cf7a81b9" . "280c56a5" . "b34e41da" . "8"]] = $user_id > 0 ? 1 : 0;
        $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_27437e92c02eea1d74a8cccd49f1ff" . "cb"]] = $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["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_d89898567b597940ae731780036" . "e8fee"] => $_24e0e36600d6af77406a44bb618a6253, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_304b42489dc33e48cde585332" . "79c6317"] => $_9a2ef4ae6a5745ffe5fac33c88a222fa, $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_78851a4cf7" . "a81b9280c56" . "a5b34e41da8"] => $_24e0e36600d6af77406a44bb618a6253 && $_24e0e36600d6af77406a44bb618a6253->id > 0, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_7db9191962f05ee8bd69f" . "d4272a96ab7"] => $user_id === 1]);
    }
}