<?php
namespace Claromentis\People\UI;

$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"] ?: array()) + array("te" . "mp" . "la" . "te" => base64_decode("dGVtcGxh" . "dGU="), "_195123e21ac78d" . "4d327eb65366717" . "a67" => base64_decode("bmF" . "tZS" . "5ib" . "2R5"), "_bdcdcc26169c" . "2b18454c95ff2" . "5855e68" => base64_decode("bm9fbWF" . "uYWdlci" . "52aXNpY" . "mxl"), "_052cabbb054ff361" . "70e07aa5c5c6b181" => base64_decode("am9iX" . "3RpdG" . "xl"), "_476223fb4ea236c8f285b9dab9d1380" . "e" => base64_decode("cHJvZmlsZV90ZX" . "h0LnZpc2libGU="), "_4bdb9df6" . "e078e2e49" . "158cd6d3e" . "d60285" => base64_decode("L2ludHJhbmV0L3Blb3B" . "sZS9pbWFnZXMvbm9fcG" . "hvdG8uanBn"), "_ef0bf94e99b8e507dd118ad6" . "7a3d845a" => base64_decode("cHJvZmlsZV9saW5" . "rLnZpc2libGU="), "_8ee9baaee6571e9a3827" . "e5132a80b38c" => base64_decode("cGhvdG8" . "uc3Jj"), "_4d707fab9" . "3bebb00bbe" . "69e8159697" . "c90" => base64_decode(""), "_71f564ea75084c6f261db81c655d2f7" . "3" => base64_decode("cHJvZmlsZV9saW5rLmhyZ" . "WY="), "_f5a3ddea1e6e880a4757a052" . "ef5254b4" => base64_decode("cGhvdG" . "8="), "us" . "er" . "_i" . "d" => base64_decode("dXNlcl" . "9pZA=="), "_d6c3e7465d15cd2c144ef" . "a250a6c7adc" => base64_decode("cGVvcGxlL21hbmFnZXJfY2" . "9tcG9uZW50Lmh0bWw="), "_b569fb08260f231f4a9fc" . "13f461c28fe" => base64_decode("aGlkZV9pZl9lbXB" . "0eQ=="), "_f48a4633e4faee032" . "20455e59ce8eb9a" => base64_decode("c2hvd19tYW5hZ2VyLnZpc2libG" . "U="), "_48b6b9352d87b455ee23dc" . "b9cc168fdf" => base64_decode("am9iX3RpdGxlLmJvZ" . "Hk="), "_8e0834ce6f" . "b9e229b87b8" . "7a6e126b469" => base64_decode("aW52aXNpYmxlX21hbmFnZXIudmlz" . "aWJsZQ=="));
use Claromentis\Core\Application;
use Claromentis\Core\CDN\CDNSystemException;
use Claromentis\Core\Security\Exception\AccessDeniedException;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Core\Templater\Plugin\TemplaterComponent;
use Claromentis\Core\Templater\TemplateRenderer;
use Claromentis\People\Entity\User;
use Claromentis\People\Exception\NotFoundException;
use Claromentis\People\PeopleAcl;
use Claromentis\People\Repository\UserRepository;
use Claromentis\People\UrlGenerator;
use Claromentis\People\UseCase\GetUser;
use Claromentis\People\UsersHierarchyService;
class ManagerComponent implements TemplaterComponent
{
    
    
    
    
    protected $user_hierarchy;
    
    
    
    
    protected $url_generator;
    
    
    
    
    protected $renderer;
    
    
    
    
    protected $people_acl;
    
    
    
    
    protected $user_repository;
    public function __construct(UserRepository $_eeeeb0d673b7b0fd0bdca58b5541c3e0, UsersHierarchyService $_76adbc9170f7fa63d29cff63b9febd4f, UrlGenerator $url_generator, TemplateRenderer $_dcf28f63b8bc197606f5dfbeeebd2513, PeopleAcl $_3d3cf5257abd66970c2706086e13633d)
    {
        $this->user_hierarchy = $_76adbc9170f7fa63d29cff63b9febd4f;
        $this->url_generator = $url_generator;
        $this->renderer = $_dcf28f63b8bc197606f5dfbeeebd2513;
        $this->people_acl = $_3d3cf5257abd66970c2706086e13633d;
        $this->user_repository = $_eeeeb0d673b7b0fd0bdca58b5541c3e0;
    }
    
    
    
    
    
    
    
    public function Show($attrs, Application $app)
    {
        $args = [];
        
        
        $context = $app[SecurityContext::class];
        $user_id = 0;
        if (!empty($attrs[$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["use" . "r_i" . "d"]])) {
            $user_id = (int) $attrs[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["user_" . "id"]];
        }
        $_b324f64f5346fe6cd20483e208d94430 = $user_id ? $this->user_hierarchy->GetManager($user_id) : 0;
        if (!empty($attrs[$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_b569fb08260f231f4a9fc13f" . "461c28fe"]]) && empty($_b324f64f5346fe6cd20483e208d94430)) {
            return $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_4d707fab93bebb0" . "0bbe69e8159697c9" . "0"];
        }
        $_747ba8552e866ef4164a0de2f774f5c4 = $this->people_acl->CanViewUserProfileField($context, $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_052cabbb054ff36170e" . "07aa5c5c6b181"]);
        $_c050e872361c2695d2bedd8cb4df15f4 = $this->people_acl->CanViewUserProfileField($context, $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_f5a3ddea1e6" . "e880a4757a05" . "2ef5254b4"]);
        
        
        $_ef41738096964d8cc071f2538d6b9969 = $this->user_repository->find($_b324f64f5346fe6cd20483e208d94430);
        if (!$_ef41738096964d8cc071f2538d6b9969) {
            $args[$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_bdcdcc26169" . "c2b18454c95f" . "f25855e68"]] = 1;
            $args[$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_f48a4633e4fae" . "e03220455e59ce" . "8eb9a"]] = 0;
        } elseif (!$this->people_acl->CanViewExtranet($context, $_ef41738096964d8cc071f2538d6b9969->extranet_id)) {
            $args[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_8e0834ce6fb9e229b87b87a6e126b4" . "69"]] = 1;
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_f48a4633e4faee" . "03220455e59ce8e" . "b9a"]] = 0;
        } else {
            $_052cabbb054ff36170e07aa5c5c6b181 = $_ef41738096964d8cc071f2538d6b9969->job_title ?? $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_4d707fab93bebb00bbe69e8159697" . "c90"];
            if ($_ef41738096964d8cc071f2538d6b9969->isBlocked()) {
                $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_ef0bf94e" . "99b8e507d" . "d118ad67a" . "3d845a"]] = 0;
                $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_476223fb4ea236c8f" . "285b9dab9d1380e"]] = 1;
            }
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_8ee9baaee65" . "71e9a3827e51" . "32a80b38c"]] = $_c050e872361c2695d2bedd8cb4df15f4 ? $this->url_generator->getUserPhotoUrl($_b324f64f5346fe6cd20483e208d94430) : $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_4bdb9df6e078e2e491" . "58cd6d3ed60285"];
            $args[$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_71f564ea75084c6f261db81c" . "655d2f73"]] = $this->url_generator->getUserProfileUrl($_b324f64f5346fe6cd20483e208d94430, $context);
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_195123e21ac7" . "8d4d327eb6536" . "6717a67"]] = $_ef41738096964d8cc071f2538d6b9969->fullname;
            $args[$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_48b6b9352d87b455ee23dcb9cc168" . "fdf"]] = $_747ba8552e866ef4164a0de2f774f5c4 ? $_052cabbb054ff36170e07aa5c5c6b181 : $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_4d707fab93bebb00bbe69e" . "8159697c90"];
        }
        if (!empty($attrs[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["temp" . "late"]])) {
            $template = $attrs[$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["templ" . "ate"]];
        } else {
            $template = $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_d6c3e7465d15cd2c144efa250a6" . "c7adc"];
        }
        return $this->renderer->Render($template, $args);
    }
}