<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* agent/agent_show.html.twig */
class __TwigTemplate_4f3d40fd23c9d1156ca58e553e6920c9c11ef4b725f8746dd9752a657aa3c651 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->blocks = [
            'body_class' => [$this, 'block_body_class'],
            'style_container' => [$this, 'block_style_container'],
            'title' => [$this, 'block_title'],
            'main' => [$this, 'block_main'],
            'javascripts' => [$this, 'block_javascripts'],
            'popup' => [$this, 'block_popup'],
        ];
    }

    protected function doGetParent(array $context)
    {
        // line 1
        return "admin/layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "agent/agent_show.html.twig"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "agent/agent_show.html.twig"));

        $this->parent = $this->loadTemplate("admin/layout.html.twig", "agent/agent_show.html.twig", 1);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

    }

    // line 3
    public function block_body_class($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body_class"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body_class"));

        // line 0
        yield "bg-white font-size-sm";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        return; yield '';
    }

    // line 4
    public function block_style_container($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "style_container"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "style_container"));

        yield "padding:0;";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        return; yield '';
    }

    // line 5
    public function block_title($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));

        yield " Agent : ";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 5, $this->source); })()), "nom", [], "any", false, false, false, 5), "html", null, true);
        yield "  - N°";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 5, $this->source); })()), "codeAgent", [], "any", false, false, false, 5)) ? (CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 5, $this->source); })()), "codeAgent", [], "any", false, false, false, 5)) : (CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 5, $this->source); })()), "id", [], "any", false, false, false, 5))), "html", null, true);
        yield " ";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        return; yield '';
    }

    // line 7
    public function block_main($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));

        // line 8
        yield "    ";
        $context["affectation"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 8, $this->source); })()), "getActiveUtilisateurAffectation", [], "any", false, false, false, 8);
        // line 9
        yield "    ";
        $context["my_lock"] = ((((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["lock"]) || array_key_exists("lock", $context) ? $context["lock"] : (function () { throw new RuntimeError('Variable "lock" does not exist.', 9, $this->source); })()), "utilisateur", [], "any", false, false, false, 9), CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 9, $this->source); })()), "user", [], "any", false, false, false, 9))) && (0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["lock"]) || array_key_exists("lock", $context) ? $context["lock"] : (function () { throw new RuntimeError('Variable "lock" does not exist.', 9, $this->source); })()), "getIdEntite", [], "any", false, false, false, 9), CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 9, $this->source); })()), "id", [], "any", false, false, false, 9))))) ? (true) : (false));
        // line 10
        yield "    ";
        $context["type_affichage"] = (((isset($context["my_lock"]) || array_key_exists("my_lock", $context) ? $context["my_lock"] : (function () { throw new RuntimeError('Variable "my_lock" does not exist.', 10, $this->source); })())) ? ("edit") : ("view"));
        // line 11
        yield "     <form id=\"form_agent_update\" method=\"post\" action=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("patch_agent", ["id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 11, $this->source); })()), "id", [], "any", false, false, false, 11)]), "html", null, true);
        yield "\" data-affichage=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["type_affichage"]) || array_key_exists("type_affichage", $context) ? $context["type_affichage"] : (function () { throw new RuntimeError('Variable "type_affichage" does not exist.', 11, $this->source); })()), "html", null, true);
        yield "\" data-turbo=\"true\" data-changed=\"false\"  style=\"height: 135px\">
         <input type=\"hidden\" name=\"process\" id=\"process_update\" value=\"\" form=\"form_agent_update\">
         <input type=\"hidden\" id=\"lock-id\" value=\"";
        // line 13
        (((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["lock"]) || array_key_exists("lock", $context) ? $context["lock"] : (function () { throw new RuntimeError('Variable "lock" does not exist.', 13, $this->source); })()), "utilisateur", [], "any", false, false, false, 13), CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 13, $this->source); })()), "user", [], "any", false, false, false, 13)))) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["lock"]) || array_key_exists("lock", $context) ? $context["lock"] : (function () { throw new RuntimeError('Variable "lock" does not exist.', 13, $this->source); })()), "id", [], "any", false, false, false, 13), "html", null, true)) : (yield ""));
        yield "\">
         <div class=\"d-flex position-fixed bg-white col-sm-12\" style=\"z-index: 1000;\">
        <div class=\"d-flex bg-primary  pt-2 ps-2 ms-1 me-1  \" style=\"flex-grow:1;\">
            <div style=\"margin-right:2rem;\">
                <div  class=\"mb-2 title-700\">Agent (";
        // line 17
        ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 17, $this->source); })()), "getSitesListe", [], "any", false, false, false, 17)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 17, $this->source); })()), "getSitesListe", [], "any", false, false, false, 17), "html", null, true)) : (yield "(Site)"));
        yield ")</div>
            </div>
            <div style=\"margin-right:2rem;\">
                <div class=\"input-group form-group pb-2 d-flex\">
                    <label class=\"white me-2  control-label align-self-center\" for=\"agent_nom\" style=\"width:48px;\">Nom</label>
                    <input type=\"text\" id=\"agent_nom\" name=\"agent_nom\" style=\"max-width:166px;\" class=\"form-control bg-white\" value=\"";
        // line 22
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 22, $this->source); })()), "nom", [], "any", false, false, false, 22), "html", null, true);
        yield "\" ";
        yield ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 22, $this->source); })()), "nom", [], "any", false, false, false, 22)) ? ("disabled") : (""));
        yield ">
                </div>
                <div class=\"input-group form-group d-flex\">
                    <label class=\"white me-2  control-label align-self-center\" for=\"agent_prenom\"  style=\"width:48px;\">Prénom</label>
                    <input type=\"text\" id=\"agent_prenom\" name=\"agent_prenom\" style=\"max-width:166px;\" class=\"form-control bg-white\" value=\"";
        // line 26
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 26, $this->source); })()), "prenom", [], "any", false, false, false, 26), "html", null, true);
        yield "\" ";
        yield ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 26, $this->source); })()), "prenom", [], "any", false, false, false, 26)) ? ("disabled") : (""));
        yield ">
                </div>
            </div>
            <div style=\"margin-right:1rem;\">
                <div  class=\"input-group form-group pb-2\">
                    <div class=\"d-flex\">
                        <i class=\"fa fa-lg fa-2x fa-home align-self-center\" style=\"margin-left: -0.2rem;  margin-right: 0.8rem;\"></i>
                        <div class=\"input-icons me-3\" style=\"width:733px\">
                            <button type=\"submit\" form=\"form_agent_adresse\" style=\"background: transparent;border: 0;right:0\">
                                <i class=\"fa fa-lg icon color-primary\"></i>
                            </button>
                            <input type=\"text\" id=\"agent_adresse_auto\" name=\"agent_adresse_auto\" data-disable-on-view=\"\" class=\"form-control bg-white input-field\" value=\"";
        // line 37
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 37, $this->source); })()), "adresse", [], "any", false, false, false, 37), "html", null, true);
        yield "\" >
                            <div class=\"adresse_auto_error\" style=\"display: none;height:30px;margin-bottom:0\"></div>
                            <input type=\"hidden\" name=\"code_postal\" form=\"form_agent_update\" value=\"\">
                            <input type=\"hidden\" name=\"ville\" form=\"form_agent_update\" value=\"\">
                            <input type=\"hidden\" name=\"adresse\" form=\"form_agent_update\" value=\"\">
                            <input type=\"hidden\" name=\"coordinates\" form=\"form_agent_update\" value=\"\">
                        </div>
                    </div>
                </div>
                <div class=\"d-flex align-items-end\">
                    <div class=\"icon-phone-rotary-agent white\" style=\"width: 45px;height:40px;margin-left: -0.4rem;\">";
        // line 47
        yield Twig\Extension\CoreExtension::source($this->env, ("@public_path" . $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/phone-rotary.svg")));
        yield "</div>
                    <div class=\"d-flex align-items-baseline flex-column me-2\">
                        <span class=\"me-1\">Perso</span>
                        <input  style=\"width:130px\" type=\"text\" data-disable-on-view=\"\" minlength=\"14\"  maxlength=\"14\" size=\"10\" name=\"tel_perso\" class=\"form-control input_tel\" value=\"";
        // line 50
        ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 50, $this->source); })()), "getTelPerso", [], "any", false, false, false, 50)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 50, $this->source); })()), "getTelPerso", [], "any", false, false, false, 50), "numero", [], "any", false, false, false, 50), "html", null, true)) : (yield ""));
        yield "\">
                    </div>
                    <div class=\"d-flex align-items-baseline flex-column me-2\">
                        <span class=\"me-1\">Pro</span>
                        <input  style=\"width:130px\" type=\"tel\" data-disable-on-view=\"\" minlength=\"10\"  maxlength=\"10\" size=\"10\" name=\"tel_pro\" class=\"form-control input_tel\" value=\"";
        // line 54
        ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 54, $this->source); })()), "getTelPro", [], "any", false, false, false, 54)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 54, $this->source); })()), "getTelPro", [], "any", false, false, false, 54), "numero", [], "any", false, false, false, 54), "html", null, true)) : (yield ""));
        yield "\">
                    </div>
                    <div class=\"d-flex align-items-baseline flex-column me-2\">
                        <span style=\"width:105px;\" class=\"me-1\"> Secteur</span>
                        <input type=\"text\"  style=\"width:130px\"  disabled name=\"tel_secteur\" class=\"form-control\" value=\"";
        // line 58
        ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 58, $this->source); })()), "agence", [], "any", false, false, false, 58)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 58, $this->source); })()), "agence", [], "any", false, false, false, 58), "numTel", [], "any", false, false, false, 58), "html", null, true)) : (yield ""));
        yield "\">
                    </div>
                    <div class=\"d-flex align-items-baseline flex-column\">
                        <span class=\"me-1\">Pôle</span>
                        <input type=\"text\" style=\"width:80px\"  disabled name=\"tel_pole\" class=\"form-control\" value=\"";
        // line 62
        ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 62, $this->source); })()), "getPole", [], "any", false, false, false, 62)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 62, $this->source); })()), "getPole", [], "any", false, false, false, 62), "numero", [], "any", false, false, false, 62), "html", null, true)) : (yield ""));
        yield "\">
                    </div>
                </div>
                <div class=\"my-2 d-flex align-items-center\">
                   <i class=\"fa fa-lg fa-envelope fa-2x \" aria-hidden=\"true\" style=\"width: 32px;\"></i>
                    <input  class=\"form-control\" type=\"email\" name=\"mail_perso\" data-disable-on-view=\"\" style=\"width:271px\" value=\"";
        // line 67
        ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 67, $this->source); })()), "getEmailPerso", [], "any", false, false, false, 67)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 67, $this->source); })()), "getEmailPerso", [], "any", false, false, false, 67), "email", [], "any", false, false, false, 67), "html", null, true)) : (yield ""));
        yield "\">
                </div>
            </div>
            <div class=\"px-2 color-primary h-100 d-flex flex-column align-items-center \" style=\"flex:1\">
                <div id=\"result-prog-quitter\" class=\"d-flex flex-column justify-content-center w-100 h-100\" style=\"margin-left: 6rem;\">
                    ";
        // line 72
        yield Twig\Extension\CoreExtension::include($this->env, $context, "agent/_boutons_prog_quitter.html.twig");
        yield "
                </div>
            </div>

        </div>
    </div>
     </form>

    <div class=\"tab-content bg-grey px-1 pb-3 pt-2 col-sm-12\" id=\"body-agent\">
        <div class=\"tab-pane fade show active d-flex\" id=\"agent-details\" role=\"tabpanel\" aria-labelledby=\"agent-1-tab\" style=\"position:relative\">
           <div class=\"d-flex justify-content-between flex-wrap flex-lg-row flex-md-column position-relative\" style=\"width: 1707px;\">
                <div class=\"d-flex bg-primary flex-column h-auto \" style=\"width: 1400px;\">
                    <div class=\"text-center py-1 \" style=\"color:white\">Informations Agent</div>
                    <div class=\"px-3 py-2 bg-white color-primary w-100 h-100 block-infos-container\">
";
        // line 87
        yield "                        ";
        $context["disabled"] = "disabled";
        // line 88
        yield "                        ";
        $context["type"] = "show";
        // line 89
        yield "                        ";
        $context["programmation"] = "non";
        // line 90
        yield "                        <div class=\"d-flex\">
                            <div style=\"width:60%\">
                                <div class=\"d-flex\">
                                    <div class=\"ms-2 me-5\" style=\"position:relative\">
                                        ";
        // line 94
        $context["photo"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 94, $this->source); })()), "photo", [], "any", false, false, false, 94);
        // line 95
        yield "                                        <img src=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((((isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 95, $this->source); })())) ? ((isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 95, $this->source); })())) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/image_default_agent.png"))), "html", null, true);
        yield "\" id=\"agent-photo\" data-defaultimage=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/image_default_agent.png"), "html", null, true);
        yield "\"  class=\"d-flex\"  width=\"105\" height=\"108\" style=\"margin:0 auto;\">
                                        <div class=\"d-flex mt-1 position-relative\"  style=\"width:93px;height: 20px;margin-left: 3px;\">
                                            <div id=\"upload-photo-agent\" data-disableonview=\"";
        // line 97
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["type_affichage"]) || array_key_exists("type_affichage", $context) ? $context["type_affichage"] : (function () { throw new RuntimeError('Variable "type_affichage" does not exist.', 97, $this->source); })()), "html", null, true);
        yield "\" style=\"width:93px;height: 20px;border: 1px solid #2C3E50\"></div>
                                        </div>
                                        <a  title=\"supprimer la photo\" data-confirm=\"1\" data-ajax=\"true\" data-js=\"\$('#photo_agent_64').val('');\$('#agent-photo').attr('src',\$('#agent-photo').data('defaultimage'));\$('#agent-photo-delete').hide();\" id=\"agent-photo-delete\" href=\"";
        // line 99
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("agent_delete_photo", ["id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 99, $this->source); })()), "id", [], "any", false, false, false, 99)]), "html", null, true);
        yield "\" class=\"";
        yield (((isset($context["photo"]) || array_key_exists("photo", $context) ? $context["photo"] : (function () { throw new RuntimeError('Variable "photo" does not exist.', 99, $this->source); })())) ? ("") : ("hide"));
        yield " color-vert mb-1\"  style=\"margin-left:4px; font-size:12px;text-decoration: none;position:absolute;right: -21px;bottom: -4px;\"><i class=\"fa fa-trash color-vert ";
        yield (((0 !== CoreExtension::compare((isset($context["type_affichage"]) || array_key_exists("type_affichage", $context) ? $context["type_affichage"] : (function () { throw new RuntimeError('Variable "type_affichage" does not exist.', 99, $this->source); })()), "edit"))) ? ("hide") : (""));
        yield "\"  style=\"font-size:15px; margin-right:13px\"></i></a>
                                        <input type=\"hidden\" name=\"photo_agent\" id=\"photo_agent_64\" form=\"form_agent_update\">
                                    </div>
                                    <div class=\"d-flex flex-column\">
                                        ";
        // line 103
        yield Twig\Extension\CoreExtension::include($this->env, $context, "agent/_affectation.html.twig");
        yield "
                                    </div>
                                </div>
                                ";
        // line 106
        if ( !CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 106, $this->source); })()), "isPlanning", [], "any", false, false, false, 106)) {
            // line 107
            yield "                                <div class=\"px-2 py-2 bg-white\" style=\"position:relative;\">
                                    <div class=\"d-flex \" style=\"position: absolute;top:inherit;right:0;\">
                                        <i id=\"add_agent_restriction\" data-disable-on-view=\"\" class=\"fa fa-lg fa-plus button-add custom-history bg-vert\" style=\"position:relative;border-color: #14a085;-webkit-text-stroke: 1px #14a085;top:inherit;right:inherit\"></i>
                                    </div>
                                    <div
                                            style=\"padding-right: 38px;\"
                                            class=\"grid\"
                                            data-style=\"tab\"
                                            data-disableonview=\"";
            // line 115
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["type_affichage"]) || array_key_exists("type_affichage", $context) ? $context["type_affichage"] : (function () { throw new RuntimeError('Variable "type_affichage" does not exist.', 115, $this->source); })()), "html", null, true);
            yield "\"
                                            id=\"agent-grid-restriction\"
                                            data-columns=\"";
            // line 117
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["restrictionsGrid"]) || array_key_exists("restrictionsGrid", $context) ? $context["restrictionsGrid"] : (function () { throw new RuntimeError('Variable "restrictionsGrid" does not exist.', 117, $this->source); })()), "columns", [], "any", false, false, false, 117)), "html", null, true);
            yield "\"
                                            data-getpath=\"";
            // line 118
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["restrictionsGrid"] ?? null), "get_path", [], "any", true, true, false, 118)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["restrictionsGrid"]) || array_key_exists("restrictionsGrid", $context) ? $context["restrictionsGrid"] : (function () { throw new RuntimeError('Variable "restrictionsGrid" does not exist.', 118, $this->source); })()), "get_path", [], "any", false, false, false, 118), "html", null, true)) : (yield ""));
            yield "\"
                                            data-createpath=\"";
            // line 119
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["restrictionsGrid"] ?? null), "create_path", [], "any", true, true, false, 119)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["restrictionsGrid"]) || array_key_exists("restrictionsGrid", $context) ? $context["restrictionsGrid"] : (function () { throw new RuntimeError('Variable "restrictionsGrid" does not exist.', 119, $this->source); })()), "create_path", [], "any", false, false, false, 119), "html", null, true)) : (yield ""));
            yield "\"
                                            data-editing=\"";
            // line 120
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["restrictionsGrid"] ?? null), "editing", [], "any", true, true, false, 120)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["restrictionsGrid"]) || array_key_exists("restrictionsGrid", $context) ? $context["restrictionsGrid"] : (function () { throw new RuntimeError('Variable "restrictionsGrid" does not exist.', 120, $this->source); })()), "editing", [], "any", false, false, false, 120)), "html", null, true)) : (yield ""));
            yield "\"
                                            data-deletepath=\"";
            // line 121
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["restrictionsGrid"] ?? null), "delete_path", [], "any", true, true, false, 121)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["restrictionsGrid"]) || array_key_exists("restrictionsGrid", $context) ? $context["restrictionsGrid"] : (function () { throw new RuntimeError('Variable "restrictionsGrid" does not exist.', 121, $this->source); })()), "delete_path", [], "any", false, false, false, 121), "html", null, true)) : (yield ""));
            yield "\"
                                            data-patchpath=\"";
            // line 122
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["restrictionsGrid"] ?? null), "patch_path", [], "any", true, true, false, 122)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["restrictionsGrid"]) || array_key_exists("restrictionsGrid", $context) ? $context["restrictionsGrid"] : (function () { throw new RuntimeError('Variable "restrictionsGrid" does not exist.', 122, $this->source); })()), "patch_path", [], "any", false, false, false, 122), "html", null, true)) : (yield ""));
            yield "\"
                                            data-searchpanel='{\"visible\":false}'
                                            data-pagination='{\"visible\":false}'
                                            data-toolbarinvisible=\"true\"
                                            data-oneditorpreparing_change_items='{\"field\":\"idtype_planification\", \"name\": \"idtype_planification\"}'
                                            data-disable-only-editing = \"";
            // line 127
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["restrictionsGrid"] ?? null), "disableOnlyEditing", [], "any", true, true, false, 127)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["restrictionsGrid"]) || array_key_exists("restrictionsGrid", $context) ? $context["restrictionsGrid"] : (function () { throw new RuntimeError('Variable "restrictionsGrid" does not exist.', 127, $this->source); })()), "disableOnlyEditing", [], "any", false, false, false, 127)), "html", null, true)) : (yield ""));
            yield "\"
                                            data-disable-only-adding = \"";
            // line 128
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["restrictionsGrid"] ?? null), "disableOnlyAdding", [], "any", true, true, false, 128)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["restrictionsGrid"]) || array_key_exists("restrictionsGrid", $context) ? $context["restrictionsGrid"] : (function () { throw new RuntimeError('Variable "restrictionsGrid" does not exist.', 128, $this->source); })()), "disableOnlyAdding", [], "any", false, false, false, 128)), "html", null, true)) : (yield ""));
            yield "\"
                                    >
                                    </div>
                                </div>
                                ";
        }
        // line 133
        yield "                            </div>
                            ";
        // line 134
        if ( !CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 134, $this->source); })()), "isPlanning", [], "any", false, false, false, 134)) {
            // line 135
            yield "                            <div style=\"width: 40%\">
                                <div class=\"d-flex bg-primary flex-column h-auto\" >
                                    <div class=\" bg-white w-100 h-100 block-infos-container\" style=\"border: none\">
                                        <div class=\"d-flex \" style=\"position: absolute;top:inherit;right:0;\">
                                            <i id=\"add_agent_qualification\" data-disable-on-view=\"\" class=\"fa fa-lg fa-plus button-add custom-history bg-vert\" style=\"position:relative;border-color: #14a085;-webkit-text-stroke: 1px #14a085;top:inherit;right:inherit\"></i>
                                            ";
            // line 141
            yield "                                        </div>
                                        <div
                                                class=\"grid\"
                                                data-style=\"tab\"
                                                id=\"agent-grid-qualification\"
                                                data-disableonview=\"";
            // line 146
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["type_affichage"]) || array_key_exists("type_affichage", $context) ? $context["type_affichage"] : (function () { throw new RuntimeError('Variable "type_affichage" does not exist.', 146, $this->source); })()), "html", null, true);
            yield "\"
                                                data-columns=\"";
            // line 147
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["qualificationsGrid"]) || array_key_exists("qualificationsGrid", $context) ? $context["qualificationsGrid"] : (function () { throw new RuntimeError('Variable "qualificationsGrid" does not exist.', 147, $this->source); })()), "columns", [], "any", false, false, false, 147)), "html", null, true);
            yield "\"
                                                data-getpath=\"";
            // line 148
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["qualificationsGrid"] ?? null), "get_path", [], "any", true, true, false, 148)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["qualificationsGrid"]) || array_key_exists("qualificationsGrid", $context) ? $context["qualificationsGrid"] : (function () { throw new RuntimeError('Variable "qualificationsGrid" does not exist.', 148, $this->source); })()), "get_path", [], "any", false, false, false, 148), "html", null, true)) : (yield ""));
            yield "\"
                                                data-createpath=\"";
            // line 149
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["qualificationsGrid"] ?? null), "create_path", [], "any", true, true, false, 149)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["qualificationsGrid"]) || array_key_exists("qualificationsGrid", $context) ? $context["qualificationsGrid"] : (function () { throw new RuntimeError('Variable "qualificationsGrid" does not exist.', 149, $this->source); })()), "create_path", [], "any", false, false, false, 149), "html", null, true)) : (yield ""));
            yield "\"
                                                data-editing=\"";
            // line 150
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["qualificationsGrid"] ?? null), "editing", [], "any", true, true, false, 150)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["qualificationsGrid"]) || array_key_exists("qualificationsGrid", $context) ? $context["qualificationsGrid"] : (function () { throw new RuntimeError('Variable "qualificationsGrid" does not exist.', 150, $this->source); })()), "editing", [], "any", false, false, false, 150)), "html", null, true)) : (yield ""));
            yield "\"
                                                data-deletepath=\"";
            // line 151
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["qualificationsGrid"] ?? null), "delete_path", [], "any", true, true, false, 151)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["qualificationsGrid"]) || array_key_exists("qualificationsGrid", $context) ? $context["qualificationsGrid"] : (function () { throw new RuntimeError('Variable "qualificationsGrid" does not exist.', 151, $this->source); })()), "delete_path", [], "any", false, false, false, 151), "html", null, true)) : (yield ""));
            yield "\"
                                                data-searchpanel='{\"visible\":false}'
                                                data-pagination='{\"visible\":false}'
                                                data-toolbarinvisible=\"true\"
                                                data-oneditorpreparing_change_items='{\"field\":\"code\", \"name\":\"libelle\"}'
                                        >

                                        </div>
                                    </div>
                                </div>
                            </div>
                            ";
        }
        // line 163
        yield "                        </div>
                    </div>
                </div>
               <div class=\"d-flex flex-column\" style=\"width: 302px;\">
                   <div class=\"d-flex bg-primary flex-column h-auto \" >
                       <div class=\"text-center py-1 \" style=\"color:white\">Commande magasin</div>
                       <div class=\"px-3 py-2 bg-white color-primary w-100 h-100 block-infos-container\">
                           <div class=\"mb-2 d-flex align-items-baseline  \">
                               <span style=\"width:80px;\" class=\"me-1\"> Agence</span>
                               <input type=\"text\"  disabled class=\"form-control\" value=\"";
        // line 172
        ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 172, $this->source); })()), "agence", [], "any", false, false, false, 172)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 172, $this->source); })()), "agence", [], "any", false, false, false, 172), "nom", [], "any", false, false, false, 172), "html", null, true)) : (yield ""));
        yield "\" style=\"width:170px\">
                           </div>
                           <div class=\"d-flex align-items-end\">
                               <span class=\"me-1\" style=\"width:82px;margin-left: -2.1px\">&nbsp;Code Agi</span>
                               <input type=\"text\" maxlength=\"9\" disabled class=\"form-control\" name=\"agi\" style=\"width:170px\" value=\"";
        // line 176
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 176, $this->source); })()), "codeClientAgi", [], "any", false, false, false, 176), "html", null, true);
        yield "\">
                           </div>
                       </div>
                   </div>
                   ";
        // line 180
        if ( !CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 180, $this->source); })()), "isPlanning", [], "any", false, false, false, 180)) {
            // line 181
            yield "                   <div class=\"d-flex bg-primary flex-column h-auto \">
                       <div class=\"text-center py-1 \" style=\"color:white\">Informations Secteur</div>
                       <div class=\"px-3 py-2 bg-white color-primary w-100 h-100 block-infos-container\">
                           <div class=\"mb-2 d-flex align-items-center\">
                               <label class=\"me-1\" style=\"width:120px;\">Agent principal</label>
                               ";
            // line 186
            if (CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 186, $this->source); })()), "getSecteurPrincipal", [], "any", false, false, false, 186)) {
                // line 187
                yield "                                   <input type=\"text\" disabled class=\"form-control\" style=\"width:150px;\" value=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 187, $this->source); })()), "getSecteurPrincipal", [], "any", false, false, false, 187), "html", null, true);
                yield "\">
                               ";
            } else {
                // line 189
                yield "                                   <span class=\"color-primary\">-</span>
                               ";
            }
            // line 191
            yield "                           </div>
                           <div class=\"d-flex  align-items-center\">
                               <label style=\"width: 120px;\" class=\"me-1\">Agent suppléant</label>
                               ";
            // line 194
            if (CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 194, $this->source); })()), "getSecteursSuppleant", [], "any", false, false, false, 194)) {
                // line 195
                yield "                                   ";
                $context["listeSecteursSec"] = Twig\Extension\CoreExtension::join(CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 195, $this->source); })()), "getSecteursSuppleant", [], "any", false, false, false, 195), ",");
                // line 196
                yield "                                   <input type=\"text\"  style=\"width:150px; margin-bottom:3px\"  disabled class=\"form-control\" value=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["listeSecteursSec"]) || array_key_exists("listeSecteursSec", $context) ? $context["listeSecteursSec"] : (function () { throw new RuntimeError('Variable "listeSecteursSec" does not exist.', 196, $this->source); })()), "html", null, true);
                yield "\">
                               ";
            } else {
                // line 198
                yield "                                   <span class=\"color-primary\">-</span>
                               ";
            }
            // line 200
            yield "                           </div>
                       </div>
                   </div>
                   ";
        }
        // line 204
        yield "               </div>
               ";
        // line 205
        if ( !CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 205, $this->source); })()), "isPlanning", [], "any", false, false, false, 205)) {
            // line 206
            yield "               <div style=\"width: 1710px;height:1px;\" class=\"bg-orange my-1\"></div>
               <div class=\"d-flex bg-primary flex-column h-auto \" style=\"width: 1703px;\">
                   <div class=\"text-center py-1 \" style=\"color:white\">Appareils</div>
                   <div class=\"px-2 py-2 bg-white\" style=\"position:relative;\">
                       <div class=\"d-flex \" style=\"position: absolute;top:inherit;right:0;\">
                           <i id=\"add_agent_appareil\" data-disable-on-view=\"\" class=\"fa fa-lg fa-plus button-add custom-history bg-vert\" style=\"position:relative;border-color: #14a085 ;-webkit-text-stroke: 1px #14a085;top:inherit;right:inherit\"></i>
                       </div>
                       <div
                               style=\"padding-right: 38px;\"
                               class=\"grid\"
                               data-style=\"tab\"
                               data-disableonview=\"";
            // line 217
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["type_affichage"]) || array_key_exists("type_affichage", $context) ? $context["type_affichage"] : (function () { throw new RuntimeError('Variable "type_affichage" does not exist.', 217, $this->source); })()), "html", null, true);
            yield "\"
                               id=\"agent-grid-appareil\"
                               data-columns=\"";
            // line 219
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["appareilsGrid"]) || array_key_exists("appareilsGrid", $context) ? $context["appareilsGrid"] : (function () { throw new RuntimeError('Variable "appareilsGrid" does not exist.', 219, $this->source); })()), "columns", [], "any", false, false, false, 219)), "html", null, true);
            yield "\"
                               data-getpath=\"";
            // line 220
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["appareilsGrid"] ?? null), "get_path", [], "any", true, true, false, 220)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["appareilsGrid"]) || array_key_exists("appareilsGrid", $context) ? $context["appareilsGrid"] : (function () { throw new RuntimeError('Variable "appareilsGrid" does not exist.', 220, $this->source); })()), "get_path", [], "any", false, false, false, 220), "html", null, true)) : (yield ""));
            yield "\"
                               data-createpath=\"";
            // line 221
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["appareilsGrid"] ?? null), "create_path", [], "any", true, true, false, 221)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["appareilsGrid"]) || array_key_exists("appareilsGrid", $context) ? $context["appareilsGrid"] : (function () { throw new RuntimeError('Variable "appareilsGrid" does not exist.', 221, $this->source); })()), "create_path", [], "any", false, false, false, 221), "html", null, true)) : (yield ""));
            yield "\"
                               data-editing=\"";
            // line 222
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["appareilsGrid"] ?? null), "editing", [], "any", true, true, false, 222)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["appareilsGrid"]) || array_key_exists("appareilsGrid", $context) ? $context["appareilsGrid"] : (function () { throw new RuntimeError('Variable "appareilsGrid" does not exist.', 222, $this->source); })()), "editing", [], "any", false, false, false, 222)), "html", null, true)) : (yield ""));
            yield "\"
                               data-deletepath=\"";
            // line 223
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["appareilsGrid"] ?? null), "delete_path", [], "any", true, true, false, 223)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["appareilsGrid"]) || array_key_exists("appareilsGrid", $context) ? $context["appareilsGrid"] : (function () { throw new RuntimeError('Variable "appareilsGrid" does not exist.', 223, $this->source); })()), "delete_path", [], "any", false, false, false, 223), "html", null, true)) : (yield ""));
            yield "\"
                               data-patchpath=\"";
            // line 224
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["appareilsGrid"] ?? null), "patch_path", [], "any", true, true, false, 224)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["appareilsGrid"]) || array_key_exists("appareilsGrid", $context) ? $context["appareilsGrid"] : (function () { throw new RuntimeError('Variable "appareilsGrid" does not exist.', 224, $this->source); })()), "patch_path", [], "any", false, false, false, 224), "html", null, true)) : (yield ""));
            yield "\"
                               data-searchpanel='{\"visible\":false}'
                               data-pagination='{\"visible\":false}'
                               data-toolbarinvisible=\"true\"
                               data-oneditorpreparing_change_items='{\"field\":\"id\", \"name\":\"appareil\"}'
                               data-disable-only-editing = \"";
            // line 229
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["appareilsGrid"] ?? null), "disableOnlyEditing", [], "any", true, true, false, 229)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["appareilsGrid"]) || array_key_exists("appareilsGrid", $context) ? $context["appareilsGrid"] : (function () { throw new RuntimeError('Variable "appareilsGrid" does not exist.', 229, $this->source); })()), "disableOnlyEditing", [], "any", false, false, false, 229)), "html", null, true)) : (yield ""));
            yield "\"
                               data-disable-only-adding = \"";
            // line 230
            ((CoreExtension::getAttribute($this->env, $this->source, ($context["appareilsGrid"] ?? null), "disableOnlyAdding", [], "any", true, true, false, 230)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(json_encode(CoreExtension::getAttribute($this->env, $this->source, (isset($context["appareilsGrid"]) || array_key_exists("appareilsGrid", $context) ? $context["appareilsGrid"] : (function () { throw new RuntimeError('Variable "appareilsGrid" does not exist.', 230, $this->source); })()), "disableOnlyAdding", [], "any", false, false, false, 230)), "html", null, true)) : (yield ""));
            yield "\"
                       >

                       </div>
                   </div>
               </div>
               ";
        }
        // line 237
        yield "               <div style=\"width: 1710px;height:1px;\" class=\"bg-orange my-1\"></div>
               <div class=\"d-flex bg-primary flex-column h-auto \" style=\"width: 1703px;\">
                   <div class=\"text-center py-1 \" style=\"color:white\">Formations</div>
                   <div class=\"px-2 py-2 bg-white\" style=\"position:relative;\">
                       <div class=\"text-center color-primary\"></i>en cours de développement</div>
                   </div>
               </div>
            </div>
            <div style=\"width:185px;margin-left:12px;\">
                <div class=\"d-flex  flex-column h-auto bloc_fiche_pref position-fixed\" style=\"width:185px\">
                    <div class=\"px-2 py-2  ";
        // line 247
        yield (((isset($context["my_lock"]) || array_key_exists("my_lock", $context) ? $context["my_lock"] : (function () { throw new RuntimeError('Variable "my_lock" does not exist.', 247, $this->source); })())) ? ("bg-white color-white") : ("bg-orange color-primary"));
        yield " w-100 h-100 block-infos-container d-flex flex-column align-items-center \">
                            <div id=\"form-actions-row\" class=\"d-flex flex-column justify-content-center\">
                                ";
        // line 249
        if ((isset($context["my_lock"]) || array_key_exists("my_lock", $context) ? $context["my_lock"] : (function () { throw new RuntimeError('Variable "my_lock" does not exist.', 249, $this->source); })())) {
            // line 250
            yield "                                    <button id=\"btn-save-agent\" class=\"btn btn-md btn-block btn-outline-success d-flex\" type=\"submit\" form=\"form_agent_update\" >
                                        <i class=\"fa fa-save me-3 align-self-center fa-lg\"></i>
                                        <span style=\"text-align: left\">Enregistrer et continuer l'édition</span>
                                    </button>
                                    <button id=\"btn-save-agent-close\" class=\"btn btn-md btn-block btn-outline-danger mt-2 d-flex\" onclick=\"\$('#process_update').val('close');\" type=\"submit\" form=\"form_agent_update\" >
                            <i class=\"fa fa-save me-3 align-self-center fa-lg\"></i>
                            <span style=\"text-align: left\">Enregistrer et fermer la fiche</span>
                            </button>
                            ";
        } elseif (        // line 258
array_key_exists("lock", $context)) {
            // line 259
            yield "                            <div class=\"text-center  color-white\" style=\"font-size: 12px;\">
                                <div class=\"pt-1\">Fiche agent en lecture seule</div>
                                <div>Modification par ";
            // line 261
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["lock"]) || array_key_exists("lock", $context) ? $context["lock"] : (function () { throw new RuntimeError('Variable "lock" does not exist.', 261, $this->source); })()), "getUtilisateur", [], "any", false, false, false, 261), "html", null, true);
            yield "</div>
                                <div class=\"pb-1\">";
            // line 262
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, (isset($context["lock"]) || array_key_exists("lock", $context) ? $context["lock"] : (function () { throw new RuntimeError('Variable "lock" does not exist.', 262, $this->source); })()), "getDateDebut", [], "any", false, false, false, 262), "d/m/Y H:i"), "html", null, true);
            yield "</div>
                            </div>

                            ";
        }
        // line 266
        yield "                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id=\"popup-quitter-entreprise\" style=\"display:none\" >
    <i  style=\"font-size: 0.9rem; display: block;color:#C00000;font-style: italic;font-weight: 600\">A renseigner uniquement si l'agent quitte définitivement l'entreprise : ne pas utiliser pour un changement de poste ou pour un arrêt de travail.</i>
    <div class=\"p-3\">
        <form  style=\"font-size: 1rem;\" class=\"form-ajax\" data-target-html=\"#result-prog-quitter\" data-js=\"\$('#close-popup-quitterentreprise').click();\" action=\"";
        // line 276
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("agent_quitter_entreprise", ["id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["agent"]) || array_key_exists("agent", $context) ? $context["agent"] : (function () { throw new RuntimeError('Variable "agent" does not exist.', 276, $this->source); })()), "id", [], "any", false, false, false, 276)]), "html", null, true);
        yield "\"  method=\"post\" >
            <div class=\"form-group mb-2 d-flex justify-content-center\">
                <label  class=\"col-form-label\" >Date de sortie de l'entreprise</label>
                <input type=\"date\" class=\"form-control-sm mx-2\" name=\"date_sortie\"  class=\"me-2\" required>
            </div>

            <div class=\"form-group d-flex justify-content-center mt-4\">
                <div class=\"form-actions-row\">
                    <button  class=\"btn btn-outline-danger btn-close-popup me-3\"  data-dxpopup-id=\"popup-quitter-entreprise\" id=\"close-popup-quitterentreprise\" type=\"button\" >Annuler</button>
                    <button  class=\"btn btn-outline-success\" type=\"submit\">Valider</button>
                </div>
            </div>
        </form>
    </div>
</div>

";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        return; yield '';
    }

    // line 294
    public function block_javascripts($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));

        // line 295
        yield "     <script>
         var page = '";
        // line 296
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((array_key_exists("page", $context)) ? (Twig\Extension\CoreExtension::default((isset($context["page"]) || array_key_exists("page", $context) ? $context["page"] : (function () { throw new RuntimeError('Variable "page" does not exist.', 296, $this->source); })()), null)) : (null)), "html", null, true);
        yield "';
     </script>

    ";
        // line 299
        yield from $this->yieldParentBlock("javascripts", $context, $blocks);
        yield "
     <script type=\"module\">
         \$('body').on('click', '#add_agent_qualification', function (e) {
             var datagridAgentQualification = \$('#agent-grid-qualification').dxDataGrid('instance');
             datagridAgentQualification.addRow();
         });
         \$('body').on('click', '#add_agent_appareil', function (e) {
             var datagridAgentAppareil = \$('#agent-grid-appareil').dxDataGrid('instance');
             datagridAgentAppareil.addRow();
         });
         \$('body').on('click', '#add_agent_restriction', function (e) {
             var datagridAgentRestriction = \$('#agent-grid-restriction').dxDataGrid('instance');
             datagridAgentRestriction.addRow();
         });
         \$('body').on('change', '#affectation_temps_travail', function(e) {
             if (\$(this).val() != \"100\") \$('#affectation_div_motif').removeClass('hide');
             else \$('#affectation_div_motif').addClass('hide');
         });
         \$(document).on('ready turbo:load', function() {
             \$('#affectation_type_profil option, ' +
                 '#affectation_utilisateur_planning option, ' +
                 '#affectation_motif option, ' +
                 '#affectation_temps_travail option, ' +
                 '#affectation_plannifiable option,' +
                 '#affectation_responsable option').each(function(e) {
                 if (this.hasAttribute('selected')) \$(this).prop('selected', true);
                else \$(this).prop('selected', false);
             });
             if (\$('#affectation_temps_travail option:selected').val() != \"100\") {
                 \$('#affectation_div_motif').removeClass('hide');
             }

             \$('input[name=agent_adresse_auto]').autocomplete({
                 source: function(request, response) {
                     \$.ajax({
                         method: \"GET\",
                         url: 'https://api-adresse.data.gouv.fr/search/?q=' + \$(\"input[name='agent_adresse_auto']\").val() + '&type=housenumber&autocomplete=1&limit10&lat&lon',
                         dataType: \"json\",
                         success: function(data){
                             response(\$.map(data.features, function (item) {
                                 var adresses = [];
                                 // Ici on est obligé d'ajouter les CP dans un array pour ne pas avoir plusieurs fois le même
                                 if (\$.inArray(item.properties.label, adresses) == -1 && item.properties.housenumber) {
                                     adresses.push(item.properties.label);
                                     console.log(item);
                                     return { label: item.properties.label,
                                         city: item.properties.city,
                                         postcode: item.properties.postcode,
                                         name: item.properties.name,
                                         coordinates: item.geometry.coordinates
                                     };
                                 }
                             }));
                         }
                     })
                 },
                 // On remplit aussi la ville
                 select: function(event, ui) {
                     \$(\"input[name='code_postal']\").val(ui.item.postcode);
                     \$(\"input[name='ville']\").val(ui.item.city);
                     \$(\"input[name='adresse']\").val(ui.item.name);
                     \$(\"input[name='coordinates']\").val(ui.item.coordinates);
                 }
             });


             \$('#upload-photo-agent').dxFileUploader({
                 multiple: false,
                 accept: \"image/*\",
                 uploadMode: \"instantly\",
                 uploadMethod: 'POST',
                 labelText : '',
                 visible: (\$('#upload-photo-agent').data('disableonview') == 'edit') ? true: false,
                 progress: 1,
                 showFileList: false,
                 selectButtonText: 'Nouvelle photo',
                 onUploaded: function (e) {
                     const fileReader = new FileReader();
                     fileReader.readAsDataURL(e.file);
                     fileReader.onload= () => {
                         \$('#agent-photo').attr('src', fileReader.result);
                         \$('#photo_agent_64').val(fileReader.result);
                         \$('#agent-photo-delete').removeClass('hide');
                         \$('#edit_agent_conctact').click();
                     }
                 },
                 onContentReady: function(e) {
                     if (e.element.find('.dx-fileuploader-button')) {
                         e.element.find(\".dx-fileuploader-button\").attr('data-disable-on-view', '').dxButton(\"instance\").option(\"icon\", \"fa fa-plus \");
                     }
                 },
                 onProgress: function(e) {
                     var percent = e.component.option(\"progress\");
                     \$('.progress').addClass('show').removeClass('hide');
                     \$(\".progress-bar\").css(\"width\", percent + \"%\").text(percent + \"%\");
                 },
                 onUploadStarted: function (e) {
                     if (!e.component.__uploadedFilesCount) {   //this is just a custom option that is not used by dxFileUploader
                         e.component.__uploadedFilesCount = 0;
                     }
                 },
                 onUploadError: function (e) {
                     let xhttp = e.request;
                     console.log(e.error.responseText);
                     if (xhttp.status === 400) {
                         e.message = e.error.responseText;
                     }
                     if (xhttp.readyState === 4 && xhttp.status === 0) {
                         e.message = \"Connection refused\";
                     }
                 }
             }).dxFileUploader(\"instance\");
         });
         \$('body').on('change', '#affectation_responsable', function(e) {
             var idUtilisateurPlanning = \$('#affectation_responsable option:selected').data('idgestionnaire');
            if (idUtilisateurPlanning) {
                \$('#affectation_utilisateur_planning').val(idUtilisateurPlanning);
            } else {
                \$('#affectation_utilisateur_planning').val('');
            }
         });

         const lockIdAgent = \$('#lock-id').val();

         function checkLockExpiration() {
             if (lockIdAgent) {
                 \$.ajax({
                     url: `/check_expiration_lock/\${lockIdAgent}`, // Modifie l'URL selon ta route Symfony
                     method: 'GET',
                     dataType: 'json',
                     success: function (response) {
                         if (response.expired) {
                             //afficher la popup du choix de fermer la fiche ou raffraichir la page client
                             // window.location.reload();
                             if( \$('#popup-lock-expired').is(':hidden') ){
                                 const popup_lock = \$('#popup-lock-expired').dxPopup({
                                     width: \"auto\",
                                     height:\"auto\",
                                     maxHeight: \"90vh\",
                                     container: \".dx-viewport\",
                                     showTitle: true,
                                     title: \"Inactivité\",
                                     visible: false,
                                     dragEnabled: true,
                                     dragOutsideBoundary: true,
                                     closeOnOutsideClick: false,
                                     showCloseButton: true,
                                     elementAttr: {
                                         class: \"nobutton dark_shadow\"
                                     },
                                     position: {
                                         at: \"center\",
                                         my: \"center\",
                                         collision : 'fit',
                                     },
                                 }).dxPopup('instance');

                                 \$('#popup-lock-expired').show();
                                 popup_lock.show();
                             }
                         }
                     },
                     error: function () {
                         console.error('Erreur lors de la vérification du lock.');
                     }
                 });
             } else {
                 console.log('pas de lock');
             }

         }
         setInterval(checkLockExpiration, 60000);



     </script>
 ";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        return; yield '';
    }

    // line 476
    public function block_popup($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "popup"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "popup"));

        // line 477
        yield "    ";
        yield Twig\Extension\CoreExtension::include($this->env, $context, "agent/_popup_lock_expired.html.twig");
        yield "
";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        return; yield '';
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName()
    {
        return "agent/agent_show.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable()
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  867 => 477,  857 => 476,  669 => 299,  663 => 296,  660 => 295,  650 => 294,  622 => 276,  610 => 266,  603 => 262,  599 => 261,  595 => 259,  593 => 258,  583 => 250,  581 => 249,  576 => 247,  564 => 237,  554 => 230,  550 => 229,  542 => 224,  538 => 223,  534 => 222,  530 => 221,  526 => 220,  522 => 219,  517 => 217,  504 => 206,  502 => 205,  499 => 204,  493 => 200,  489 => 198,  483 => 196,  480 => 195,  478 => 194,  473 => 191,  469 => 189,  463 => 187,  461 => 186,  454 => 181,  452 => 180,  445 => 176,  438 => 172,  427 => 163,  412 => 151,  408 => 150,  404 => 149,  400 => 148,  396 => 147,  392 => 146,  385 => 141,  378 => 135,  376 => 134,  373 => 133,  365 => 128,  361 => 127,  353 => 122,  349 => 121,  345 => 120,  341 => 119,  337 => 118,  333 => 117,  328 => 115,  318 => 107,  316 => 106,  310 => 103,  299 => 99,  294 => 97,  286 => 95,  284 => 94,  278 => 90,  275 => 89,  272 => 88,  269 => 87,  252 => 72,  244 => 67,  236 => 62,  229 => 58,  222 => 54,  215 => 50,  209 => 47,  196 => 37,  180 => 26,  171 => 22,  163 => 17,  156 => 13,  148 => 11,  145 => 10,  142 => 9,  139 => 8,  129 => 7,  105 => 5,  85 => 4,  74 => 0,  64 => 3,  41 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("{% extends 'admin/layout.html.twig' %}

{% block body_class 'bg-white font-size-sm' %}
{% block style_container %}padding:0;{% endblock %}
{% block title %} Agent : {{ agent.nom }}  - N°{{ agent.codeAgent ? agent.codeAgent : agent.id }} {% endblock %}

{% block main %}
    {% set affectation = agent.getActiveUtilisateurAffectation %}
    {% set my_lock = (lock.utilisateur == app.user and lock.getIdEntite == agent.id) ? true : false %}
    {% set type_affichage = my_lock ? 'edit' : 'view'  %}
     <form id=\"form_agent_update\" method=\"post\" action=\"{{ path('patch_agent', {id: agent.id}) }}\" data-affichage=\"{{ type_affichage }}\" data-turbo=\"true\" data-changed=\"false\"  style=\"height: 135px\">
         <input type=\"hidden\" name=\"process\" id=\"process_update\" value=\"\" form=\"form_agent_update\">
         <input type=\"hidden\" id=\"lock-id\" value=\"{{ lock.utilisateur == app.user ? lock.id : '' }}\">
         <div class=\"d-flex position-fixed bg-white col-sm-12\" style=\"z-index: 1000;\">
        <div class=\"d-flex bg-primary  pt-2 ps-2 ms-1 me-1  \" style=\"flex-grow:1;\">
            <div style=\"margin-right:2rem;\">
                <div  class=\"mb-2 title-700\">Agent ({{ agent.getSitesListe ? agent.getSitesListe : '(Site)' }})</div>
            </div>
            <div style=\"margin-right:2rem;\">
                <div class=\"input-group form-group pb-2 d-flex\">
                    <label class=\"white me-2  control-label align-self-center\" for=\"agent_nom\" style=\"width:48px;\">Nom</label>
                    <input type=\"text\" id=\"agent_nom\" name=\"agent_nom\" style=\"max-width:166px;\" class=\"form-control bg-white\" value=\"{{ agent.nom }}\" {{ agent.nom ? 'disabled' : '' }}>
                </div>
                <div class=\"input-group form-group d-flex\">
                    <label class=\"white me-2  control-label align-self-center\" for=\"agent_prenom\"  style=\"width:48px;\">Prénom</label>
                    <input type=\"text\" id=\"agent_prenom\" name=\"agent_prenom\" style=\"max-width:166px;\" class=\"form-control bg-white\" value=\"{{ agent.prenom }}\" {{ agent.prenom  ? 'disabled' : '' }}>
                </div>
            </div>
            <div style=\"margin-right:1rem;\">
                <div  class=\"input-group form-group pb-2\">
                    <div class=\"d-flex\">
                        <i class=\"fa fa-lg fa-2x fa-home align-self-center\" style=\"margin-left: -0.2rem;  margin-right: 0.8rem;\"></i>
                        <div class=\"input-icons me-3\" style=\"width:733px\">
                            <button type=\"submit\" form=\"form_agent_adresse\" style=\"background: transparent;border: 0;right:0\">
                                <i class=\"fa fa-lg icon color-primary\"></i>
                            </button>
                            <input type=\"text\" id=\"agent_adresse_auto\" name=\"agent_adresse_auto\" data-disable-on-view=\"\" class=\"form-control bg-white input-field\" value=\"{{ agent.adresse }}\" >
                            <div class=\"adresse_auto_error\" style=\"display: none;height:30px;margin-bottom:0\"></div>
                            <input type=\"hidden\" name=\"code_postal\" form=\"form_agent_update\" value=\"\">
                            <input type=\"hidden\" name=\"ville\" form=\"form_agent_update\" value=\"\">
                            <input type=\"hidden\" name=\"adresse\" form=\"form_agent_update\" value=\"\">
                            <input type=\"hidden\" name=\"coordinates\" form=\"form_agent_update\" value=\"\">
                        </div>
                    </div>
                </div>
                <div class=\"d-flex align-items-end\">
                    <div class=\"icon-phone-rotary-agent white\" style=\"width: 45px;height:40px;margin-left: -0.4rem;\">{{ source('@public_path'~asset('build/images/phone-rotary.svg')) }}</div>
                    <div class=\"d-flex align-items-baseline flex-column me-2\">
                        <span class=\"me-1\">Perso</span>
                        <input  style=\"width:130px\" type=\"text\" data-disable-on-view=\"\" minlength=\"14\"  maxlength=\"14\" size=\"10\" name=\"tel_perso\" class=\"form-control input_tel\" value=\"{{ agent.getTelPerso ? agent.getTelPerso.numero : '' }}\">
                    </div>
                    <div class=\"d-flex align-items-baseline flex-column me-2\">
                        <span class=\"me-1\">Pro</span>
                        <input  style=\"width:130px\" type=\"tel\" data-disable-on-view=\"\" minlength=\"10\"  maxlength=\"10\" size=\"10\" name=\"tel_pro\" class=\"form-control input_tel\" value=\"{{ agent.getTelPro ? agent.getTelPro.numero : '' }}\">
                    </div>
                    <div class=\"d-flex align-items-baseline flex-column me-2\">
                        <span style=\"width:105px;\" class=\"me-1\"> Secteur</span>
                        <input type=\"text\"  style=\"width:130px\"  disabled name=\"tel_secteur\" class=\"form-control\" value=\"{{ agent.agence ? agent.agence.numTel : '' }}\">
                    </div>
                    <div class=\"d-flex align-items-baseline flex-column\">
                        <span class=\"me-1\">Pôle</span>
                        <input type=\"text\" style=\"width:80px\"  disabled name=\"tel_pole\" class=\"form-control\" value=\"{{ agent.getPole ? agent.getPole.numero : '' }}\">
                    </div>
                </div>
                <div class=\"my-2 d-flex align-items-center\">
                   <i class=\"fa fa-lg fa-envelope fa-2x \" aria-hidden=\"true\" style=\"width: 32px;\"></i>
                    <input  class=\"form-control\" type=\"email\" name=\"mail_perso\" data-disable-on-view=\"\" style=\"width:271px\" value=\"{{ agent.getEmailPerso ? agent.getEmailPerso.email : '' }}\">
                </div>
            </div>
            <div class=\"px-2 color-primary h-100 d-flex flex-column align-items-center \" style=\"flex:1\">
                <div id=\"result-prog-quitter\" class=\"d-flex flex-column justify-content-center w-100 h-100\" style=\"margin-left: 6rem;\">
                    {{ include('agent/_boutons_prog_quitter.html.twig') }}
                </div>
            </div>

        </div>
    </div>
     </form>

    <div class=\"tab-content bg-grey px-1 pb-3 pt-2 col-sm-12\" id=\"body-agent\">
        <div class=\"tab-pane fade show active d-flex\" id=\"agent-details\" role=\"tabpanel\" aria-labelledby=\"agent-1-tab\" style=\"position:relative\">
           <div class=\"d-flex justify-content-between flex-wrap flex-lg-row flex-md-column position-relative\" style=\"width: 1707px;\">
                <div class=\"d-flex bg-primary flex-column h-auto \" style=\"width: 1400px;\">
                    <div class=\"text-center py-1 \" style=\"color:white\">Informations Agent</div>
                    <div class=\"px-3 py-2 bg-white color-primary w-100 h-100 block-infos-container\">
{#                       <i class=\"fa fa-lg fa-history custom-history\"></i>#}
                        {%  set disabled = 'disabled' %}
                        {%  set type = 'show' %}
                        {%  set programmation = 'non' %}
                        <div class=\"d-flex\">
                            <div style=\"width:60%\">
                                <div class=\"d-flex\">
                                    <div class=\"ms-2 me-5\" style=\"position:relative\">
                                        {% set photo = agent.photo %}
                                        <img src=\"{{ (photo) ? photo :  asset('build/images/image_default_agent.png') }}\" id=\"agent-photo\" data-defaultimage=\"{{ asset('build/images/image_default_agent.png') }}\"  class=\"d-flex\"  width=\"105\" height=\"108\" style=\"margin:0 auto;\">
                                        <div class=\"d-flex mt-1 position-relative\"  style=\"width:93px;height: 20px;margin-left: 3px;\">
                                            <div id=\"upload-photo-agent\" data-disableonview=\"{{ type_affichage }}\" style=\"width:93px;height: 20px;border: 1px solid #2C3E50\"></div>
                                        </div>
                                        <a  title=\"supprimer la photo\" data-confirm=\"1\" data-ajax=\"true\" data-js=\"\$('#photo_agent_64').val('');\$('#agent-photo').attr('src',\$('#agent-photo').data('defaultimage'));\$('#agent-photo-delete').hide();\" id=\"agent-photo-delete\" href=\"{{ path('agent_delete_photo', {'id': agent.id}) }}\" class=\"{{ photo ? '' : 'hide' }} color-vert mb-1\"  style=\"margin-left:4px; font-size:12px;text-decoration: none;position:absolute;right: -21px;bottom: -4px;\"><i class=\"fa fa-trash color-vert {{ type_affichage != 'edit' ? 'hide' : '' }}\"  style=\"font-size:15px; margin-right:13px\"></i></a>
                                        <input type=\"hidden\" name=\"photo_agent\" id=\"photo_agent_64\" form=\"form_agent_update\">
                                    </div>
                                    <div class=\"d-flex flex-column\">
                                        {{ include('agent/_affectation.html.twig') }}
                                    </div>
                                </div>
                                {% if not agent.isPlanning %}
                                <div class=\"px-2 py-2 bg-white\" style=\"position:relative;\">
                                    <div class=\"d-flex \" style=\"position: absolute;top:inherit;right:0;\">
                                        <i id=\"add_agent_restriction\" data-disable-on-view=\"\" class=\"fa fa-lg fa-plus button-add custom-history bg-vert\" style=\"position:relative;border-color: #14a085;-webkit-text-stroke: 1px #14a085;top:inherit;right:inherit\"></i>
                                    </div>
                                    <div
                                            style=\"padding-right: 38px;\"
                                            class=\"grid\"
                                            data-style=\"tab\"
                                            data-disableonview=\"{{ type_affichage }}\"
                                            id=\"agent-grid-restriction\"
                                            data-columns=\"{{ restrictionsGrid.columns|json_encode() }}\"
                                            data-getpath=\"{{ restrictionsGrid.get_path is defined  ? restrictionsGrid.get_path : '' }}\"
                                            data-createpath=\"{{ restrictionsGrid.create_path is defined  ? restrictionsGrid.create_path : '' }}\"
                                            data-editing=\"{{ restrictionsGrid.editing is defined  ? restrictionsGrid.editing|json_encode() : '' }}\"
                                            data-deletepath=\"{{ restrictionsGrid.delete_path is defined  ? restrictionsGrid.delete_path : '' }}\"
                                            data-patchpath=\"{{ restrictionsGrid.patch_path is defined  ? restrictionsGrid.patch_path : '' }}\"
                                            data-searchpanel='{\"visible\":false}'
                                            data-pagination='{\"visible\":false}'
                                            data-toolbarinvisible=\"true\"
                                            data-oneditorpreparing_change_items='{\"field\":\"idtype_planification\", \"name\": \"idtype_planification\"}'
                                            data-disable-only-editing = \"{{ restrictionsGrid.disableOnlyEditing is defined  ? restrictionsGrid.disableOnlyEditing|json_encode() : '' }}\"
                                            data-disable-only-adding = \"{{ restrictionsGrid.disableOnlyAdding is defined  ? restrictionsGrid.disableOnlyAdding|json_encode() : '' }}\"
                                    >
                                    </div>
                                </div>
                                {% endif %}
                            </div>
                            {% if not agent.isPlanning %}
                            <div style=\"width: 40%\">
                                <div class=\"d-flex bg-primary flex-column h-auto\" >
                                    <div class=\" bg-white w-100 h-100 block-infos-container\" style=\"border: none\">
                                        <div class=\"d-flex \" style=\"position: absolute;top:inherit;right:0;\">
                                            <i id=\"add_agent_qualification\" data-disable-on-view=\"\" class=\"fa fa-lg fa-plus button-add custom-history bg-vert\" style=\"position:relative;border-color: #14a085;-webkit-text-stroke: 1px #14a085;top:inherit;right:inherit\"></i>
                                            {#                            <i class=\"fa fa-lg fa-history custom-history\" style=\"position:relative;top:inherit;right:inherit\"></i>#}
                                        </div>
                                        <div
                                                class=\"grid\"
                                                data-style=\"tab\"
                                                id=\"agent-grid-qualification\"
                                                data-disableonview=\"{{ type_affichage }}\"
                                                data-columns=\"{{ qualificationsGrid.columns|json_encode() }}\"
                                                data-getpath=\"{{ qualificationsGrid.get_path is defined  ? qualificationsGrid.get_path : '' }}\"
                                                data-createpath=\"{{ qualificationsGrid.create_path is defined  ? qualificationsGrid.create_path : '' }}\"
                                                data-editing=\"{{ qualificationsGrid.editing is defined  ? qualificationsGrid.editing|json_encode() : '' }}\"
                                                data-deletepath=\"{{ qualificationsGrid.delete_path is defined  ? qualificationsGrid.delete_path : '' }}\"
                                                data-searchpanel='{\"visible\":false}'
                                                data-pagination='{\"visible\":false}'
                                                data-toolbarinvisible=\"true\"
                                                data-oneditorpreparing_change_items='{\"field\":\"code\", \"name\":\"libelle\"}'
                                        >

                                        </div>
                                    </div>
                                </div>
                            </div>
                            {% endif %}
                        </div>
                    </div>
                </div>
               <div class=\"d-flex flex-column\" style=\"width: 302px;\">
                   <div class=\"d-flex bg-primary flex-column h-auto \" >
                       <div class=\"text-center py-1 \" style=\"color:white\">Commande magasin</div>
                       <div class=\"px-3 py-2 bg-white color-primary w-100 h-100 block-infos-container\">
                           <div class=\"mb-2 d-flex align-items-baseline  \">
                               <span style=\"width:80px;\" class=\"me-1\"> Agence</span>
                               <input type=\"text\"  disabled class=\"form-control\" value=\"{{ agent.agence ? agent.agence.nom : '' }}\" style=\"width:170px\">
                           </div>
                           <div class=\"d-flex align-items-end\">
                               <span class=\"me-1\" style=\"width:82px;margin-left: -2.1px\">&nbsp;Code Agi</span>
                               <input type=\"text\" maxlength=\"9\" disabled class=\"form-control\" name=\"agi\" style=\"width:170px\" value=\"{{ agent.codeClientAgi }}\">
                           </div>
                       </div>
                   </div>
                   {% if not agent.isPlanning %}
                   <div class=\"d-flex bg-primary flex-column h-auto \">
                       <div class=\"text-center py-1 \" style=\"color:white\">Informations Secteur</div>
                       <div class=\"px-3 py-2 bg-white color-primary w-100 h-100 block-infos-container\">
                           <div class=\"mb-2 d-flex align-items-center\">
                               <label class=\"me-1\" style=\"width:120px;\">Agent principal</label>
                               {% if agent.getSecteurPrincipal %}
                                   <input type=\"text\" disabled class=\"form-control\" style=\"width:150px;\" value=\"{{ agent.getSecteurPrincipal  }}\">
                               {% else %}
                                   <span class=\"color-primary\">-</span>
                               {% endif %}
                           </div>
                           <div class=\"d-flex  align-items-center\">
                               <label style=\"width: 120px;\" class=\"me-1\">Agent suppléant</label>
                               {% if agent.getSecteursSuppleant %}
                                   {% set listeSecteursSec = agent.getSecteursSuppleant | join(',') %}
                                   <input type=\"text\"  style=\"width:150px; margin-bottom:3px\"  disabled class=\"form-control\" value=\"{{ listeSecteursSec }}\">
                               {% else %}
                                   <span class=\"color-primary\">-</span>
                               {% endif %}
                           </div>
                       </div>
                   </div>
                   {% endif %}
               </div>
               {% if not agent.isPlanning %}
               <div style=\"width: 1710px;height:1px;\" class=\"bg-orange my-1\"></div>
               <div class=\"d-flex bg-primary flex-column h-auto \" style=\"width: 1703px;\">
                   <div class=\"text-center py-1 \" style=\"color:white\">Appareils</div>
                   <div class=\"px-2 py-2 bg-white\" style=\"position:relative;\">
                       <div class=\"d-flex \" style=\"position: absolute;top:inherit;right:0;\">
                           <i id=\"add_agent_appareil\" data-disable-on-view=\"\" class=\"fa fa-lg fa-plus button-add custom-history bg-vert\" style=\"position:relative;border-color: #14a085 ;-webkit-text-stroke: 1px #14a085;top:inherit;right:inherit\"></i>
                       </div>
                       <div
                               style=\"padding-right: 38px;\"
                               class=\"grid\"
                               data-style=\"tab\"
                               data-disableonview=\"{{ type_affichage }}\"
                               id=\"agent-grid-appareil\"
                               data-columns=\"{{ appareilsGrid.columns|json_encode() }}\"
                               data-getpath=\"{{ appareilsGrid.get_path is defined  ? appareilsGrid.get_path : '' }}\"
                               data-createpath=\"{{ appareilsGrid.create_path is defined  ? appareilsGrid.create_path : '' }}\"
                               data-editing=\"{{ appareilsGrid.editing is defined  ? appareilsGrid.editing|json_encode() : '' }}\"
                               data-deletepath=\"{{ appareilsGrid.delete_path is defined  ? appareilsGrid.delete_path : '' }}\"
                               data-patchpath=\"{{ appareilsGrid.patch_path is defined  ? appareilsGrid.patch_path : '' }}\"
                               data-searchpanel='{\"visible\":false}'
                               data-pagination='{\"visible\":false}'
                               data-toolbarinvisible=\"true\"
                               data-oneditorpreparing_change_items='{\"field\":\"id\", \"name\":\"appareil\"}'
                               data-disable-only-editing = \"{{ appareilsGrid.disableOnlyEditing is defined  ? appareilsGrid.disableOnlyEditing|json_encode() : '' }}\"
                               data-disable-only-adding = \"{{ appareilsGrid.disableOnlyAdding is defined  ? appareilsGrid.disableOnlyAdding|json_encode() : '' }}\"
                       >

                       </div>
                   </div>
               </div>
               {% endif %}
               <div style=\"width: 1710px;height:1px;\" class=\"bg-orange my-1\"></div>
               <div class=\"d-flex bg-primary flex-column h-auto \" style=\"width: 1703px;\">
                   <div class=\"text-center py-1 \" style=\"color:white\">Formations</div>
                   <div class=\"px-2 py-2 bg-white\" style=\"position:relative;\">
                       <div class=\"text-center color-primary\"></i>en cours de développement</div>
                   </div>
               </div>
            </div>
            <div style=\"width:185px;margin-left:12px;\">
                <div class=\"d-flex  flex-column h-auto bloc_fiche_pref position-fixed\" style=\"width:185px\">
                    <div class=\"px-2 py-2  {{ my_lock ? 'bg-white color-white' : 'bg-orange color-primary' }} w-100 h-100 block-infos-container d-flex flex-column align-items-center \">
                            <div id=\"form-actions-row\" class=\"d-flex flex-column justify-content-center\">
                                {% if my_lock %}
                                    <button id=\"btn-save-agent\" class=\"btn btn-md btn-block btn-outline-success d-flex\" type=\"submit\" form=\"form_agent_update\" >
                                        <i class=\"fa fa-save me-3 align-self-center fa-lg\"></i>
                                        <span style=\"text-align: left\">Enregistrer et continuer l'édition</span>
                                    </button>
                                    <button id=\"btn-save-agent-close\" class=\"btn btn-md btn-block btn-outline-danger mt-2 d-flex\" onclick=\"\$('#process_update').val('close');\" type=\"submit\" form=\"form_agent_update\" >
                            <i class=\"fa fa-save me-3 align-self-center fa-lg\"></i>
                            <span style=\"text-align: left\">Enregistrer et fermer la fiche</span>
                            </button>
                            {% elseif lock is defined %}
                            <div class=\"text-center  color-white\" style=\"font-size: 12px;\">
                                <div class=\"pt-1\">Fiche agent en lecture seule</div>
                                <div>Modification par {{ lock.getUtilisateur }}</div>
                                <div class=\"pb-1\">{{ lock.getDateDebut|date('d/m/Y H:i') }}</div>
                            </div>

                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id=\"popup-quitter-entreprise\" style=\"display:none\" >
    <i  style=\"font-size: 0.9rem; display: block;color:#C00000;font-style: italic;font-weight: 600\">A renseigner uniquement si l'agent quitte définitivement l'entreprise : ne pas utiliser pour un changement de poste ou pour un arrêt de travail.</i>
    <div class=\"p-3\">
        <form  style=\"font-size: 1rem;\" class=\"form-ajax\" data-target-html=\"#result-prog-quitter\" data-js=\"\$('#close-popup-quitterentreprise').click();\" action=\"{{ path('agent_quitter_entreprise', {id: agent.id}) }}\"  method=\"post\" >
            <div class=\"form-group mb-2 d-flex justify-content-center\">
                <label  class=\"col-form-label\" >Date de sortie de l'entreprise</label>
                <input type=\"date\" class=\"form-control-sm mx-2\" name=\"date_sortie\"  class=\"me-2\" required>
            </div>

            <div class=\"form-group d-flex justify-content-center mt-4\">
                <div class=\"form-actions-row\">
                    <button  class=\"btn btn-outline-danger btn-close-popup me-3\"  data-dxpopup-id=\"popup-quitter-entreprise\" id=\"close-popup-quitterentreprise\" type=\"button\" >Annuler</button>
                    <button  class=\"btn btn-outline-success\" type=\"submit\">Valider</button>
                </div>
            </div>
        </form>
    </div>
</div>

{% endblock %}

 {% block javascripts %}
     <script>
         var page = '{{ page|default(null) }}';
     </script>

    {{ parent() }}
     <script type=\"module\">
         \$('body').on('click', '#add_agent_qualification', function (e) {
             var datagridAgentQualification = \$('#agent-grid-qualification').dxDataGrid('instance');
             datagridAgentQualification.addRow();
         });
         \$('body').on('click', '#add_agent_appareil', function (e) {
             var datagridAgentAppareil = \$('#agent-grid-appareil').dxDataGrid('instance');
             datagridAgentAppareil.addRow();
         });
         \$('body').on('click', '#add_agent_restriction', function (e) {
             var datagridAgentRestriction = \$('#agent-grid-restriction').dxDataGrid('instance');
             datagridAgentRestriction.addRow();
         });
         \$('body').on('change', '#affectation_temps_travail', function(e) {
             if (\$(this).val() != \"100\") \$('#affectation_div_motif').removeClass('hide');
             else \$('#affectation_div_motif').addClass('hide');
         });
         \$(document).on('ready turbo:load', function() {
             \$('#affectation_type_profil option, ' +
                 '#affectation_utilisateur_planning option, ' +
                 '#affectation_motif option, ' +
                 '#affectation_temps_travail option, ' +
                 '#affectation_plannifiable option,' +
                 '#affectation_responsable option').each(function(e) {
                 if (this.hasAttribute('selected')) \$(this).prop('selected', true);
                else \$(this).prop('selected', false);
             });
             if (\$('#affectation_temps_travail option:selected').val() != \"100\") {
                 \$('#affectation_div_motif').removeClass('hide');
             }

             \$('input[name=agent_adresse_auto]').autocomplete({
                 source: function(request, response) {
                     \$.ajax({
                         method: \"GET\",
                         url: 'https://api-adresse.data.gouv.fr/search/?q=' + \$(\"input[name='agent_adresse_auto']\").val() + '&type=housenumber&autocomplete=1&limit10&lat&lon',
                         dataType: \"json\",
                         success: function(data){
                             response(\$.map(data.features, function (item) {
                                 var adresses = [];
                                 // Ici on est obligé d'ajouter les CP dans un array pour ne pas avoir plusieurs fois le même
                                 if (\$.inArray(item.properties.label, adresses) == -1 && item.properties.housenumber) {
                                     adresses.push(item.properties.label);
                                     console.log(item);
                                     return { label: item.properties.label,
                                         city: item.properties.city,
                                         postcode: item.properties.postcode,
                                         name: item.properties.name,
                                         coordinates: item.geometry.coordinates
                                     };
                                 }
                             }));
                         }
                     })
                 },
                 // On remplit aussi la ville
                 select: function(event, ui) {
                     \$(\"input[name='code_postal']\").val(ui.item.postcode);
                     \$(\"input[name='ville']\").val(ui.item.city);
                     \$(\"input[name='adresse']\").val(ui.item.name);
                     \$(\"input[name='coordinates']\").val(ui.item.coordinates);
                 }
             });


             \$('#upload-photo-agent').dxFileUploader({
                 multiple: false,
                 accept: \"image/*\",
                 uploadMode: \"instantly\",
                 uploadMethod: 'POST',
                 labelText : '',
                 visible: (\$('#upload-photo-agent').data('disableonview') == 'edit') ? true: false,
                 progress: 1,
                 showFileList: false,
                 selectButtonText: 'Nouvelle photo',
                 onUploaded: function (e) {
                     const fileReader = new FileReader();
                     fileReader.readAsDataURL(e.file);
                     fileReader.onload= () => {
                         \$('#agent-photo').attr('src', fileReader.result);
                         \$('#photo_agent_64').val(fileReader.result);
                         \$('#agent-photo-delete').removeClass('hide');
                         \$('#edit_agent_conctact').click();
                     }
                 },
                 onContentReady: function(e) {
                     if (e.element.find('.dx-fileuploader-button')) {
                         e.element.find(\".dx-fileuploader-button\").attr('data-disable-on-view', '').dxButton(\"instance\").option(\"icon\", \"fa fa-plus \");
                     }
                 },
                 onProgress: function(e) {
                     var percent = e.component.option(\"progress\");
                     \$('.progress').addClass('show').removeClass('hide');
                     \$(\".progress-bar\").css(\"width\", percent + \"%\").text(percent + \"%\");
                 },
                 onUploadStarted: function (e) {
                     if (!e.component.__uploadedFilesCount) {   //this is just a custom option that is not used by dxFileUploader
                         e.component.__uploadedFilesCount = 0;
                     }
                 },
                 onUploadError: function (e) {
                     let xhttp = e.request;
                     console.log(e.error.responseText);
                     if (xhttp.status === 400) {
                         e.message = e.error.responseText;
                     }
                     if (xhttp.readyState === 4 && xhttp.status === 0) {
                         e.message = \"Connection refused\";
                     }
                 }
             }).dxFileUploader(\"instance\");
         });
         \$('body').on('change', '#affectation_responsable', function(e) {
             var idUtilisateurPlanning = \$('#affectation_responsable option:selected').data('idgestionnaire');
            if (idUtilisateurPlanning) {
                \$('#affectation_utilisateur_planning').val(idUtilisateurPlanning);
            } else {
                \$('#affectation_utilisateur_planning').val('');
            }
         });

         const lockIdAgent = \$('#lock-id').val();

         function checkLockExpiration() {
             if (lockIdAgent) {
                 \$.ajax({
                     url: `/check_expiration_lock/\${lockIdAgent}`, // Modifie l'URL selon ta route Symfony
                     method: 'GET',
                     dataType: 'json',
                     success: function (response) {
                         if (response.expired) {
                             //afficher la popup du choix de fermer la fiche ou raffraichir la page client
                             // window.location.reload();
                             if( \$('#popup-lock-expired').is(':hidden') ){
                                 const popup_lock = \$('#popup-lock-expired').dxPopup({
                                     width: \"auto\",
                                     height:\"auto\",
                                     maxHeight: \"90vh\",
                                     container: \".dx-viewport\",
                                     showTitle: true,
                                     title: \"Inactivité\",
                                     visible: false,
                                     dragEnabled: true,
                                     dragOutsideBoundary: true,
                                     closeOnOutsideClick: false,
                                     showCloseButton: true,
                                     elementAttr: {
                                         class: \"nobutton dark_shadow\"
                                     },
                                     position: {
                                         at: \"center\",
                                         my: \"center\",
                                         collision : 'fit',
                                     },
                                 }).dxPopup('instance');

                                 \$('#popup-lock-expired').show();
                                 popup_lock.show();
                             }
                         }
                     },
                     error: function () {
                         console.error('Erreur lors de la vérification du lock.');
                     }
                 });
             } else {
                 console.log('pas de lock');
             }

         }
         setInterval(checkLockExpiration, 60000);



     </script>
 {% endblock %}
{% block popup %}
    {{ include('agent/_popup_lock_expired.html.twig') }}
{% endblock %}", "agent/agent_show.html.twig", "/builds/dev/refonte_sav/templates/agent/agent_show.html.twig");
    }
}
