var/cache/dev/twig/f7/f73057284ffa00bab8df42483d364558.php line 91

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* registration/register.html.twig */
  16. class __TwigTemplate_ba606fe98b6df081002b2e6f09b9c601 extends Template
  17. {
  18.     private Source $source;
  19.     /**
  20.      * @var array<string, Template>
  21.      */
  22.     private array $macros = [];
  23.     public function __construct(Environment $env)
  24.     {
  25.         parent::__construct($env);
  26.         $this->source $this->getSourceContext();
  27.         $this->blocks = [
  28.             'title' => [$this'block_title'],
  29.             'body' => [$this'block_body'],
  30.             'javascripts' => [$this'block_javascripts'],
  31.         ];
  32.     }
  33.     protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  34.     {
  35.         // line 1
  36.         return "base_home.html.twig";
  37.     }
  38.     protected function doDisplay(array $context, array $blocks = []): iterable
  39.     {
  40.         $macros $this->macros;
  41.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  42.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""registration/register.html.twig"));
  43.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  44.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""registration/register.html.twig"));
  45.         $this->parent $this->load("base_home.html.twig"1);
  46.         yield from $this->parent->unwrap()->yield($contextarray_merge($this->blocks$blocks));
  47.         
  48.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  49.         
  50.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  51.     }
  52.     // line 3
  53.     /**
  54.      * @return iterable<null|scalar|\Stringable>
  55.      */
  56.     public function block_title(array $context, array $blocks = []): iterable
  57.     {
  58.         $macros $this->macros;
  59.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  60.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  61.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  62.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  63.         yield "Inscription | MaketOu";
  64.         
  65.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  66.         
  67.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  68.         yield from [];
  69.     }
  70.     // line 5
  71.     /**
  72.      * @return iterable<null|scalar|\Stringable>
  73.      */
  74.     public function block_body(array $context, array $blocks = []): iterable
  75.     {
  76.         $macros $this->macros;
  77.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  78.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  79.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  80.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  81.         // line 6
  82.         yield "
  83.     <!-- Start Banner Area -->
  84.     <section class=\"banner-area organic-breadcrumb\">
  85.         <div class=\"container\">
  86.             <div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
  87.                 <div class=\"col-first\">
  88.                     <h1>Inscription</h1>
  89.                     <nav class=\"d-flex align-items-center\">
  90.                         <a href=\"";
  91.         // line 14
  92.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_home");
  93.         yield "\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
  94.                         <a href=\"javascript:void(0)\">Inscription</a>
  95.                     </nav>
  96.                 </div>
  97.             </div>
  98.         </div>
  99.     </section>
  100.     <!-- End Banner Area -->
  101.     ";
  102.         // line 23
  103.         $context['_parent'] = $context;
  104.         $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env$this->source, ($context["app"] ?? null), "flashes", ["verify_email_error"], "method"falsefalsefalse23));
  105.         foreach ($context['_seq'] as $context["_key"] => $context["flash_error"]) {
  106.             // line 24
  107.             yield "        <div class=\"alert alert-danger\" role=\"alert\">";
  108.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["flash_error"], "html"nulltrue);
  109.             yield "</div>
  110.     ";
  111.         }
  112.         $_parent $context['_parent'];
  113.         unset($context['_seq'], $context['_key'], $context['flash_error'], $context['_parent']);
  114.         $context array_intersect_key($context$_parent) + $_parent;
  115.         // line 26
  116.         yield "
  117.     ";
  118.         // line 27
  119.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(($context["registrationForm"] ?? null), 'errors');
  120.         yield "
  121.     <!--================Login Box Area =================-->
  122.     <section class=\"login_box_area section_gap\">
  123.         <div class=\"container\">
  124.             <div class=\"row\">
  125.                 <div class=\"col-lg-6\">
  126.                     <div class=\"login_box_img\">
  127.                         <img class=\"img-fluid\" src=\"";
  128.         // line 36
  129.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("ui/img/login.jpg"), "html"nulltrue);
  130.         yield "\" alt=\"\">
  131.                         <div class=\"hover\">
  132.                             <h4>Vous avez un compte?</h4>
  133.                             <p>Connectez-vous à votre compte pour accéder à vos commandes, suivre vos livraisons et gérer vos préférences personnelles.</p>
  134.                             <a class=\"primary-btn\" href=\"";
  135.         // line 40
  136.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_app_login");
  137.         yield "\">Se connecter</a>
  138.                         </div>
  139.                     </div>
  140.                 </div>
  141.                 <div class=\"col-lg-6\">
  142.                     <div class=\"login_form_inner\">
  143.                         <h3>S'inscrire</h3>
  144.                         ";
  145.         // line 48
  146.         yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["registrationForm"] ?? null), 'form_start', ["attr" => ["class" => "needs-validation row login_form"]]);
  147.         yield "
  148.                         ";
  149.         // line 49
  150.         if ((($tmp CoreExtension::getAttribute($this->env$this->source, ($context["app"] ?? null), "user", [], "any"falsefalsefalse49)) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  151.             // line 50
  152.             yield "                            <div class=\"mb-3\">
  153.                                 Vous êtes connecté comme ";
  154.             // line 51
  155.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, ($context["app"] ?? null), "user", [], "any"falsefalsefalse51), "userIdentifier", [], "any"falsefalsefalse51), "html"nulltrue);
  156.             yield ", <a
  157.                                         href=\"";
  158.             // line 52
  159.             yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_app_logout");
  160.             yield "\">Déconnexion</a>
  161.                             </div>
  162.                         ";
  163.         }
  164.         // line 55
  165.         yield "
  166.                         <div class=\"col-md-12 form-group\">
  167.                             ";
  168.         // line 57
  169.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env$this->source, ($context["registrationForm"] ?? null), "email", [], "any"falsefalsefalse57), 'label', ["label_attr" => ["class" => "form-label"], "label" => "Email"]);
  170.         yield "
  171.                             ";
  172.         // line 58
  173.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env$this->source, ($context["registrationForm"] ?? null), "email", [], "any"falsefalsefalse58), 'widget', ["attr" => ["class" => "form-control""placeholder" => "email@example.com""onfocus" => "this.placeholder = ''""onblur" => "this.placeholder = 'email@example.com'""id" => "registration_email"]]);
  174.         yield "
  175.                             ";
  176.         // line 59
  177.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env$this->source, ($context["registrationForm"] ?? null), "email", [], "any"falsefalsefalse59), 'errors');
  178.         yield "
  179.                             <small class=\"form-text text-muted email-validation-message\"></small>
  180.                         </div>
  181.                         <div class=\"col-md-12 form-group\">
  182.                             ";
  183.         // line 63
  184.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env$this->source, ($context["registrationForm"] ?? null), "plainPassword", [], "any"falsefalsefalse63), 'label', ["label_attr" => ["class" => "form-label"], "label" => "Mot de passe"]);
  185.         yield "
  186.                             ";
  187.         // line 64
  188.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env$this->source, ($context["registrationForm"] ?? null), "plainPassword", [], "any"falsefalsefalse64), 'widget', ["attr" => ["class" => "form-control""placeholder" => "Votre mot de passe""onfocus" => "this.placeholder = ''""onblur" => "this.placeholder = 'Votre mot de passe'""id" => "registration_password"]]);
  189.         yield "
  190.                             ";
  191.         // line 65
  192.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env$this->source, ($context["registrationForm"] ?? null), "plainPassword", [], "any"falsefalsefalse65), 'errors');
  193.         yield "
  194.                             <small class=\"form-text text-muted password-validation-message\"></small>
  195.                             <div class=\"password-strength mt-2\" style=\"display: none;\">
  196.                                 <div class=\"progress\" style=\"height: 5px;\">
  197.                                     <div class=\"progress-bar\" role=\"progressbar\" style=\"width: 0%\"></div>
  198.                                 </div>
  199.                                 <small class=\"strength-text\"></small>
  200.                             </div>
  201.                         </div>
  202.                         <div class=\"col-md-12 form-group\">
  203.                             <div class=\"creat_account\">
  204.                                 ";
  205.         // line 76
  206.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env$this->source, ($context["registrationForm"] ?? null), "agreeTerms", [], "any"falsefalsefalse76), 'widget');
  207.         yield "
  208.                                 ";
  209.         // line 77
  210.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env$this->source, ($context["registrationForm"] ?? null), "agreeTerms", [], "any"falsefalsefalse77), 'label', ["label" => "Accepte les conditions"]);
  211.         yield "
  212.                                 ";
  213.         // line 78
  214.         yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env$this->source, ($context["registrationForm"] ?? null), "agreeTerms", [], "any"falsefalsefalse78), 'errors');
  215.         yield "
  216.                             </div>
  217.                         </div>
  218.                         <div class=\"col-md-12 form-group\">
  219.                             <button class=\"primary-btn\" type=\"submit\">
  220.                                 S'inscrire
  221.                             </button>
  222.                             <a href=\"";
  223.         // line 86
  224.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ui_app_login");
  225.         yield "\">Déjà un compte? <b>Se connecter</b></a>
  226.                         </div>
  227.                         ";
  228.         // line 89
  229.         yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["registrationForm"] ?? null), 'form_end');
  230.         yield "
  231.                     </div>
  232.                 </div>
  233.             </div>
  234.         </div>
  235.     </section>
  236. ";
  237.         
  238.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  239.         
  240.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  241.         yield from [];
  242.     }
  243.     // line 97
  244.     /**
  245.      * @return iterable<null|scalar|\Stringable>
  246.      */
  247.     public function block_javascripts(array $context, array $blocks = []): iterable
  248.     {
  249.         $macros $this->macros;
  250.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  251.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  252.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  253.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  254.         // line 98
  255.         yield "<script>
  256. document.addEventListener('DOMContentLoaded', function() {
  257.     const emailInput = document.getElementById('registration_email');
  258.     const passwordInput = document.getElementById('registration_password');
  259.     const emailMessage = document.querySelector('.email-validation-message');
  260.     const passwordMessage = document.querySelector('.password-validation-message');
  261.     const passwordStrength = document.querySelector('.password-strength');
  262.     const progressBar = passwordStrength.querySelector('.progress-bar');
  263.     const strengthText = passwordStrength.querySelector('.strength-text');
  264.     const registrationForm = document.querySelector('.needs-validation');
  265.     
  266.     // Validation email en temps réel
  267.     if (emailInput) {
  268.         emailInput.addEventListener('blur', function() {
  269.             validateEmail(this.value);
  270.         });
  271.         
  272.         emailInput.addEventListener('input', function() {
  273.             if (this.value.length > 0) {
  274.                 validateEmail(this.value);
  275.             } else {
  276.                 emailMessage.textContent = '';
  277.                 emailMessage.className = 'form-text text-muted email-validation-message';
  278.             }
  279.         });
  280.     }
  281.     
  282.     // Validation mot de passe en temps réel
  283.     if (passwordInput) {
  284.         passwordInput.addEventListener('input', function() {
  285.             validatePassword(this.value);
  286.         });
  287.         
  288.         passwordInput.addEventListener('blur', function() {
  289.             if (this.value.length > 0) {
  290.                 validatePassword(this.value);
  291.             }
  292.         });
  293.     }
  294.     
  295.     function validateEmail(email) {
  296.         const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\$/;
  297.         
  298.         if (!email) {
  299.             emailMessage.textContent = '';
  300.             emailMessage.className = 'form-text text-muted email-validation-message';
  301.             return false;
  302.         }
  303.         
  304.         if (!emailRegex.test(email)) {
  305.             emailMessage.textContent = 'Format d\\'email invalide. Exemple: exemple@domaine.com';
  306.             emailMessage.className = 'form-text text-danger email-validation-message';
  307.             emailInput.classList.add('is-invalid');
  308.             emailInput.classList.remove('is-valid');
  309.             return false;
  310.         }
  311.         
  312.         // Vérifier les domaines invalides communs
  313.         const invalidDomains = ['test.com', 'example.com', 'invalid.com'];
  314.         const domain = email.split('@')[1];
  315.         if (invalidDomains.includes(domain)) {
  316.             emailMessage.textContent = 'Veuillez utiliser une adresse email valide.';
  317.             emailMessage.className = 'form-text text-danger email-validation-message';
  318.             emailInput.classList.add('is-invalid');
  319.             emailInput.classList.remove('is-valid');
  320.             return false;
  321.         }
  322.         
  323.         emailMessage.textContent = '✓ Adresse email valide';
  324.         emailMessage.className = 'form-text text-success email-validation-message';
  325.         emailInput.classList.remove('is-invalid');
  326.         emailInput.classList.add('is-valid');
  327.         return true;
  328.     }
  329.     
  330.     function validatePassword(password) {
  331.         const minLength = 8;
  332.         const hasUpperCase = /[A-Z]/.test(password);
  333.         const hasLowerCase = /[a-z]/.test(password);
  334.         const hasNumber = /\\d/.test(password);
  335.         const hasSpecialChar = /[!@#\$%^&*(),.?\":{}|<>]/.test(password);
  336.         
  337.         if (!password) {
  338.             passwordMessage.textContent = '';
  339.             passwordMessage.className = 'form-text text-muted password-validation-message';
  340.             passwordStrength.style.display = 'none';
  341.             return false;
  342.         }
  343.         
  344.         let messages = [];
  345.         let strength = 0;
  346.         
  347.         if (password.length >= minLength) {
  348.             strength += 25;
  349.         } else {
  350.             messages.push(`Au moins \${minLength} caractères`);
  351.         }
  352.         
  353.         if (hasUpperCase) {
  354.             strength += 25;
  355.         } else {
  356.             messages.push('Une majuscule');
  357.         }
  358.         
  359.         if (hasLowerCase) {
  360.             strength += 25;
  361.         } else {
  362.             messages.push('Une minuscule');
  363.         }
  364.         
  365.         if (hasNumber) {
  366.             strength += 25;
  367.         } else {
  368.             messages.push('Un chiffre');
  369.         }
  370.         
  371.         // Bonus pour caractère spécial
  372.         if (hasSpecialChar) {
  373.             strength = Math.min(100, strength + 10);
  374.         }
  375.         
  376.         // Mettre à jour la barre de progression
  377.         progressBar.style.width = strength + '%';
  378.         
  379.         if (strength < 50) {
  380.             progressBar.className = 'progress-bar bg-danger';
  381.             strengthText.textContent = 'Faible';
  382.             strengthText.className = 'strength-text text-danger';
  383.         } else if (strength < 75) {
  384.             progressBar.className = 'progress-bar bg-warning';
  385.             strengthText.textContent = 'Moyen';
  386.             strengthText.className = 'strength-text text-warning';
  387.         } else {
  388.             progressBar.className = 'progress-bar bg-success';
  389.             strengthText.textContent = 'Fort';
  390.             strengthText.className = 'strength-text text-success';
  391.         }
  392.         
  393.         passwordStrength.style.display = 'block';
  394.         
  395.         if (messages.length > 0) {
  396.             passwordMessage.textContent = 'Le mot de passe doit contenir: ' + messages.join(', ');
  397.             passwordMessage.className = 'form-text text-danger password-validation-message';
  398.             passwordInput.classList.add('is-invalid');
  399.             passwordInput.classList.remove('is-valid');
  400.             return false;
  401.         } else {
  402.             passwordMessage.textContent = '✓ Mot de passe valide';
  403.             passwordMessage.className = 'form-text text-success password-validation-message';
  404.             passwordInput.classList.remove('is-invalid');
  405.             passwordInput.classList.add('is-valid');
  406.             return true;
  407.         }
  408.     }
  409.     
  410.     // Validation avant soumission
  411.     if (registrationForm) {
  412.         registrationForm.addEventListener('submit', function(e) {
  413.             const emailValid = validateEmail(emailInput.value);
  414.             const passwordValid = validatePassword(passwordInput.value);
  415.             
  416.             if (!emailValid || !passwordValid) {
  417.                 e.preventDefault();
  418.                 e.stopPropagation();
  419.                 
  420.                 if (!emailValid) {
  421.                     emailInput.focus();
  422.                 } else if (!passwordValid) {
  423.                     passwordInput.focus();
  424.                 }
  425.             }
  426.             
  427.             registrationForm.classList.add('was-validated');
  428.         });
  429.     }
  430. });
  431. </script>
  432. ";
  433.         
  434.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  435.         
  436.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  437.         yield from [];
  438.     }
  439.     /**
  440.      * @codeCoverageIgnore
  441.      */
  442.     public function getTemplateName(): string
  443.     {
  444.         return "registration/register.html.twig";
  445.     }
  446.     /**
  447.      * @codeCoverageIgnore
  448.      */
  449.     public function isTraitable(): bool
  450.     {
  451.         return false;
  452.     }
  453.     /**
  454.      * @codeCoverageIgnore
  455.      */
  456.     public function getDebugInfo(): array
  457.     {
  458.         return array (  285 => 98,  272 => 97,  254 => 89,  248 => 86,  237 => 78,  233 => 77,  229 => 76,  215 => 65,  211 => 64,  207 => 63,  200 => 59,  196 => 58,  192 => 57,  188 => 55,  182 => 52,  178 => 51,  175 => 50,  173 => 49,  169 => 48,  158 => 40,  151 => 36,  139 => 27,  136 => 26,  127 => 24,  123 => 23,  111 => 14,  101 => 6,  88 => 5,  65 => 3,  42 => 1,);
  459.     }
  460.     public function getSourceContext(): Source
  461.     {
  462.         return new Source("{% extends 'base_home.html.twig' %}
  463. {% block title %}Inscription | MaketOu{% endblock %}
  464. {% block body %}
  465.     <!-- Start Banner Area -->
  466.     <section class=\"banner-area organic-breadcrumb\">
  467.         <div class=\"container\">
  468.             <div class=\"breadcrumb-banner d-flex flex-wrap align-items-center justify-content-end\">
  469.                 <div class=\"col-first\">
  470.                     <h1>Inscription</h1>
  471.                     <nav class=\"d-flex align-items-center\">
  472.                         <a href=\"{{ path('ui_home') }}\">Accueil<span class=\"lnr lnr-arrow-right\"></span></a>
  473.                         <a href=\"javascript:void(0)\">Inscription</a>
  474.                     </nav>
  475.                 </div>
  476.             </div>
  477.         </div>
  478.     </section>
  479.     <!-- End Banner Area -->
  480.     {% for flash_error in app.flashes('verify_email_error') %}
  481.         <div class=\"alert alert-danger\" role=\"alert\">{{ flash_error }}</div>
  482.     {% endfor %}
  483.     {{ form_errors(registrationForm) }}
  484.     <!--================Login Box Area =================-->
  485.     <section class=\"login_box_area section_gap\">
  486.         <div class=\"container\">
  487.             <div class=\"row\">
  488.                 <div class=\"col-lg-6\">
  489.                     <div class=\"login_box_img\">
  490.                         <img class=\"img-fluid\" src=\"{{ asset('ui/img/login.jpg') }}\" alt=\"\">
  491.                         <div class=\"hover\">
  492.                             <h4>Vous avez un compte?</h4>
  493.                             <p>Connectez-vous à votre compte pour accéder à vos commandes, suivre vos livraisons et gérer vos préférences personnelles.</p>
  494.                             <a class=\"primary-btn\" href=\"{{ path('ui_app_login') }}\">Se connecter</a>
  495.                         </div>
  496.                     </div>
  497.                 </div>
  498.                 <div class=\"col-lg-6\">
  499.                     <div class=\"login_form_inner\">
  500.                         <h3>S'inscrire</h3>
  501.                         {{ form_start(registrationForm, {'attr': {'class': 'needs-validation row login_form'}}) }}
  502.                         {% if app.user %}
  503.                             <div class=\"mb-3\">
  504.                                 Vous êtes connecté comme {{ app.user.userIdentifier }}, <a
  505.                                         href=\"{{ path('ui_app_logout') }}\">Déconnexion</a>
  506.                             </div>
  507.                         {% endif %}
  508.                         <div class=\"col-md-12 form-group\">
  509.                             {{ form_label(registrationForm.email, 'Email', {'label_attr': {'class': 'form-label'}}) }}
  510.                             {{ form_widget(registrationForm.email, {'attr': {'class': 'form-control', 'placeholder': 'email@example.com', 'onfocus':\"this.placeholder = ''\", 'onblur':\"this.placeholder = 'email@example.com'\", 'id': 'registration_email'}}) }}
  511.                             {{ form_errors(registrationForm.email) }}
  512.                             <small class=\"form-text text-muted email-validation-message\"></small>
  513.                         </div>
  514.                         <div class=\"col-md-12 form-group\">
  515.                             {{ form_label(registrationForm.plainPassword, 'Mot de passe', {'label_attr': {'class': 'form-label'}}) }}
  516.                             {{ form_widget(registrationForm.plainPassword, {'attr': {'class': 'form-control', 'placeholder': 'Votre mot de passe', 'onfocus':\"this.placeholder = ''\", 'onblur':\"this.placeholder = 'Votre mot de passe'\", 'id': 'registration_password'}}) }}
  517.                             {{ form_errors(registrationForm.plainPassword) }}
  518.                             <small class=\"form-text text-muted password-validation-message\"></small>
  519.                             <div class=\"password-strength mt-2\" style=\"display: none;\">
  520.                                 <div class=\"progress\" style=\"height: 5px;\">
  521.                                     <div class=\"progress-bar\" role=\"progressbar\" style=\"width: 0%\"></div>
  522.                                 </div>
  523.                                 <small class=\"strength-text\"></small>
  524.                             </div>
  525.                         </div>
  526.                         <div class=\"col-md-12 form-group\">
  527.                             <div class=\"creat_account\">
  528.                                 {{ form_widget(registrationForm.agreeTerms) }}
  529.                                 {{ form_label(registrationForm.agreeTerms, 'Accepte les conditions') }}
  530.                                 {{ form_errors(registrationForm.agreeTerms) }}
  531.                             </div>
  532.                         </div>
  533.                         <div class=\"col-md-12 form-group\">
  534.                             <button class=\"primary-btn\" type=\"submit\">
  535.                                 S'inscrire
  536.                             </button>
  537.                             <a href=\"{{ path('ui_app_login') }}\">Déjà un compte? <b>Se connecter</b></a>
  538.                         </div>
  539.                         {{ form_end(registrationForm) }}
  540.                     </div>
  541.                 </div>
  542.             </div>
  543.         </div>
  544.     </section>
  545. {% endblock %}
  546. {% block javascripts %}
  547. <script>
  548. document.addEventListener('DOMContentLoaded', function() {
  549.     const emailInput = document.getElementById('registration_email');
  550.     const passwordInput = document.getElementById('registration_password');
  551.     const emailMessage = document.querySelector('.email-validation-message');
  552.     const passwordMessage = document.querySelector('.password-validation-message');
  553.     const passwordStrength = document.querySelector('.password-strength');
  554.     const progressBar = passwordStrength.querySelector('.progress-bar');
  555.     const strengthText = passwordStrength.querySelector('.strength-text');
  556.     const registrationForm = document.querySelector('.needs-validation');
  557.     
  558.     // Validation email en temps réel
  559.     if (emailInput) {
  560.         emailInput.addEventListener('blur', function() {
  561.             validateEmail(this.value);
  562.         });
  563.         
  564.         emailInput.addEventListener('input', function() {
  565.             if (this.value.length > 0) {
  566.                 validateEmail(this.value);
  567.             } else {
  568.                 emailMessage.textContent = '';
  569.                 emailMessage.className = 'form-text text-muted email-validation-message';
  570.             }
  571.         });
  572.     }
  573.     
  574.     // Validation mot de passe en temps réel
  575.     if (passwordInput) {
  576.         passwordInput.addEventListener('input', function() {
  577.             validatePassword(this.value);
  578.         });
  579.         
  580.         passwordInput.addEventListener('blur', function() {
  581.             if (this.value.length > 0) {
  582.                 validatePassword(this.value);
  583.             }
  584.         });
  585.     }
  586.     
  587.     function validateEmail(email) {
  588.         const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\$/;
  589.         
  590.         if (!email) {
  591.             emailMessage.textContent = '';
  592.             emailMessage.className = 'form-text text-muted email-validation-message';
  593.             return false;
  594.         }
  595.         
  596.         if (!emailRegex.test(email)) {
  597.             emailMessage.textContent = 'Format d\\'email invalide. Exemple: exemple@domaine.com';
  598.             emailMessage.className = 'form-text text-danger email-validation-message';
  599.             emailInput.classList.add('is-invalid');
  600.             emailInput.classList.remove('is-valid');
  601.             return false;
  602.         }
  603.         
  604.         // Vérifier les domaines invalides communs
  605.         const invalidDomains = ['test.com', 'example.com', 'invalid.com'];
  606.         const domain = email.split('@')[1];
  607.         if (invalidDomains.includes(domain)) {
  608.             emailMessage.textContent = 'Veuillez utiliser une adresse email valide.';
  609.             emailMessage.className = 'form-text text-danger email-validation-message';
  610.             emailInput.classList.add('is-invalid');
  611.             emailInput.classList.remove('is-valid');
  612.             return false;
  613.         }
  614.         
  615.         emailMessage.textContent = '✓ Adresse email valide';
  616.         emailMessage.className = 'form-text text-success email-validation-message';
  617.         emailInput.classList.remove('is-invalid');
  618.         emailInput.classList.add('is-valid');
  619.         return true;
  620.     }
  621.     
  622.     function validatePassword(password) {
  623.         const minLength = 8;
  624.         const hasUpperCase = /[A-Z]/.test(password);
  625.         const hasLowerCase = /[a-z]/.test(password);
  626.         const hasNumber = /\\d/.test(password);
  627.         const hasSpecialChar = /[!@#\$%^&*(),.?\":{}|<>]/.test(password);
  628.         
  629.         if (!password) {
  630.             passwordMessage.textContent = '';
  631.             passwordMessage.className = 'form-text text-muted password-validation-message';
  632.             passwordStrength.style.display = 'none';
  633.             return false;
  634.         }
  635.         
  636.         let messages = [];
  637.         let strength = 0;
  638.         
  639.         if (password.length >= minLength) {
  640.             strength += 25;
  641.         } else {
  642.             messages.push(`Au moins \${minLength} caractères`);
  643.         }
  644.         
  645.         if (hasUpperCase) {
  646.             strength += 25;
  647.         } else {
  648.             messages.push('Une majuscule');
  649.         }
  650.         
  651.         if (hasLowerCase) {
  652.             strength += 25;
  653.         } else {
  654.             messages.push('Une minuscule');
  655.         }
  656.         
  657.         if (hasNumber) {
  658.             strength += 25;
  659.         } else {
  660.             messages.push('Un chiffre');
  661.         }
  662.         
  663.         // Bonus pour caractère spécial
  664.         if (hasSpecialChar) {
  665.             strength = Math.min(100, strength + 10);
  666.         }
  667.         
  668.         // Mettre à jour la barre de progression
  669.         progressBar.style.width = strength + '%';
  670.         
  671.         if (strength < 50) {
  672.             progressBar.className = 'progress-bar bg-danger';
  673.             strengthText.textContent = 'Faible';
  674.             strengthText.className = 'strength-text text-danger';
  675.         } else if (strength < 75) {
  676.             progressBar.className = 'progress-bar bg-warning';
  677.             strengthText.textContent = 'Moyen';
  678.             strengthText.className = 'strength-text text-warning';
  679.         } else {
  680.             progressBar.className = 'progress-bar bg-success';
  681.             strengthText.textContent = 'Fort';
  682.             strengthText.className = 'strength-text text-success';
  683.         }
  684.         
  685.         passwordStrength.style.display = 'block';
  686.         
  687.         if (messages.length > 0) {
  688.             passwordMessage.textContent = 'Le mot de passe doit contenir: ' + messages.join(', ');
  689.             passwordMessage.className = 'form-text text-danger password-validation-message';
  690.             passwordInput.classList.add('is-invalid');
  691.             passwordInput.classList.remove('is-valid');
  692.             return false;
  693.         } else {
  694.             passwordMessage.textContent = '✓ Mot de passe valide';
  695.             passwordMessage.className = 'form-text text-success password-validation-message';
  696.             passwordInput.classList.remove('is-invalid');
  697.             passwordInput.classList.add('is-valid');
  698.             return true;
  699.         }
  700.     }
  701.     
  702.     // Validation avant soumission
  703.     if (registrationForm) {
  704.         registrationForm.addEventListener('submit', function(e) {
  705.             const emailValid = validateEmail(emailInput.value);
  706.             const passwordValid = validatePassword(passwordInput.value);
  707.             
  708.             if (!emailValid || !passwordValid) {
  709.                 e.preventDefault();
  710.                 e.stopPropagation();
  711.                 
  712.                 if (!emailValid) {
  713.                     emailInput.focus();
  714.                 } else if (!passwordValid) {
  715.                     passwordInput.focus();
  716.                 }
  717.             }
  718.             
  719.             registrationForm.classList.add('was-validated');
  720.         });
  721.     }
  722. });
  723. </script>
  724. {% endblock %}
  725. ""registration/register.html.twig""/home/u540977899/domains/maketou-ht.com/public_html/templates/registration/register.html.twig");
  726.     }
  727. }