<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
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;

/* PvRecaptchaBundle:Form:recaptcha_widget.html.twig */
class __TwigTemplate_e6be613c9dd3cad21b9614b3532554e7f7e9f6cda5b2ff219840737afc2c6783 extends \Twig\Template
{
    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = [
            'pv_recaptcha_widget' => [$this, 'block_pv_recaptcha_widget'],
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        $this->displayBlock('pv_recaptcha_widget', $context, $blocks);
    }

    public function block_pv_recaptcha_widget($context, array $blocks = [])
    {
        // line 2
        echo "    ";
        ob_start(function () { return ''; });
        // line 3
        echo "        ";
        if (( !($context["captcha_invisible"] ?? null) && (($context["label"] ?? null) == false))) {
            // line 4
            echo "            <p>";
            echo twig_escape_filter($this->env, $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("recaptcha.widget-label", [], "PvRecaptchaBundle"), "html", null, true);
            echo "</p>
        ";
        }
        // line 6
        echo "
        ";
        // line 7
        if (($context["captcha_invisible"] ?? null)) {
            // line 8
            echo "            <div class=\"g-recaptcha\"
                 data-sitekey=\"";
            // line 9
            echo twig_escape_filter($this->env, ($context["public_key"] ?? null), "html", null, true);
            echo "\"
                 data-size=\"invisible\"
                 data-callback=\"formSubmit\">
            </div>

            <script type=\"text/javascript\">
                \$('#";
            // line 15
            echo twig_escape_filter($this->env, ($context["form_id"] ?? null), "html", null, true);
            echo "').submit(function (event) {
                    event.preventDefault();
                    grecaptcha.reset();
                    grecaptcha.execute();
                });

                function formSubmit(response) {
                    document.getElementById('";
            // line 22
            echo twig_escape_filter($this->env, ($context["form_id"] ?? null), "html", null, true);
            echo "').submit();
                }
            </script>
        ";
        } else {
            // line 26
            echo "            <div class=\"g-recaptcha\" data-sitekey=\"";
            echo twig_escape_filter($this->env, ($context["public_key"] ?? null), "html", null, true);
            echo "\"></div>
        ";
        }
        // line 28
        echo "
        <script src=\"";
        // line 29
        echo twig_escape_filter($this->env, ($context["js_api_url"] ?? null), "html", null, true);
        echo "?lang=";
        echo twig_escape_filter($this->env, ($context["lang"] ?? null), "html", null, true);
        echo "\" async defer></script>
    ";
        echo trim(preg_replace('/>\s+</', '><', ob_get_clean()));
    }

    public function getTemplateName()
    {
        return "PvRecaptchaBundle:Form:recaptcha_widget.html.twig";
    }

    public function getDebugInfo()
    {
        return array (  92 => 29,  89 => 28,  83 => 26,  76 => 22,  66 => 15,  57 => 9,  54 => 8,  52 => 7,  49 => 6,  43 => 4,  40 => 3,  37 => 2,  31 => 1,);
    }

    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
    public function getSource()
    {
        @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);

        return $this->getSourceContext()->getCode();
    }

    public function getSourceContext()
    {
        return new Source("", "PvRecaptchaBundle:Form:recaptcha_widget.html.twig", "/var/www/html/vendor/pierre-vassoilles/recaptcha-bundle/Pv/RecaptchaBundle/Resources/views/Form/recaptcha_widget.html.twig");
    }
}
