<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
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;

/* tool/ajax/ags/prepareResults.html.twig */
class __TwigTemplate_e8da24659756724da162257e53cf48053341a6856c737da9925a12e27a13c007 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "tool/ajax/ags/prepareResults.html.twig"));

        // line 1
        echo "<div class=\"form-row\">
    <div class=\"col col col-md-10\">
        <input type=\"text\" id=\"agsResultUser-";
        // line 3
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 3, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\" class=\"form-control\" placeholder=\"User\" aria-describedby=\"agsResultUserHelp\">
        <small id=\"agsResultUserHelp\" class=\"form-text text-muted\">User identifier filter</small>
    </div>
    <div class=\"col col col-md-2\">
        <input type=\"number\" id=\"agsResultLimit-";
        // line 7
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 7, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\" class=\"form-control\" placeholder=\"Limit\" aria-describedby=\"agsResultLimitHelp\">
        <small id=\"agsResultLimitHelp\" class=\"form-text text-muted\">Limit to return</small>
    </div>
</div>
<br/>
<div class=\"form-row float-right\">
    <div class=\"col col col-md-12\">
        <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">
            <button id=\"agsResultLoad-";
        // line 15
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 15, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\" class=\"btn-info btn\">
                <i id=\"agsResultCall-";
        // line 16
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 16, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\" class=\"fas fa-poll-h\"></i>&nbsp;Get results
            </button>
            <button id=\"agsResultReset-";
        // line 18
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 18, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\" class=\"btn-secondary btn\">
                <i class=\"fas fa-undo\"></i>&nbsp;Reset
            </button>
        </div>
    </div>
</div>
<br/>
<div id=\"agsLineItemResultZone-";
        // line 25
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 25, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\"></div>
<script>
    \$(\"#agsResultLoad-";
        // line 27
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 27, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").click(function (event) {
        \$.ajax({
            url: \"";
        // line 29
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("tool_ajax_service_ags_list_results", ["lineItemIdentifier" => $this->extensions['App\Twig\AppExtension']->base64UrlEncode(twig_get_attribute($this->env, $this->source, (isset($context["lineItem"]) || array_key_exists("lineItem", $context) ? $context["lineItem"] : (function () { throw new RuntimeError('Variable "lineItem" does not exist.', 29, $this->source); })()), "identifier", [], "any", false, false, false, 29))]), "html", null, true);
        echo "\",
            method: \"GET\",
            data: {
                registration: \"";
        // line 32
        echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["registration"]) || array_key_exists("registration", $context) ? $context["registration"] : (function () { throw new RuntimeError('Variable "registration" does not exist.', 32, $this->source); })()), "identifier", [], "any", false, false, false, 32), "html", null, true);
        echo "\",
                user: \$(\"#agsResultUser-";
        // line 33
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 33, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").val(),
                limit: \$(\"#agsResultLimit-";
        // line 34
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 34, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").val(),
                mode: \"";
        // line 35
        echo twig_escape_filter($this->env, (isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 35, $this->source); })()), "html", null, true);
        echo "\",
                scopes: \"";
        // line 36
        echo twig_escape_filter($this->env, (isset($context["scopes"]) || array_key_exists("scopes", $context) ? $context["scopes"] : (function () { throw new RuntimeError('Variable "scopes" does not exist.', 36, $this->source); })()), "html", null, true);
        echo "\"
            },
            beforeSend: function(result){
                \$(\"#agsResultCall-";
        // line 39
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 39, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").removeClass(\"fa-poll-h\");
                \$(\"#agsResultCall-";
        // line 40
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 40, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").addClass(\"fa-spinner fa-spin\");
            },
            success: function(result){
                \$(\"#agsResultCall-";
        // line 43
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 43, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").removeClass(\"fa-spinner fa-spin\");
                \$(\"#agsResultCall-";
        // line 44
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 44, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").addClass(\"fa-poll-h\");
                \$(\"#agsLineItemResultZone-";
        // line 45
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 45, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").html(result);
            },
            error: function(result){
                \$(\"#agsResultCall-";
        // line 48
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 48, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").removeClass(\"fa-spinner fa-spin\");
                \$(\"#agsResultCall-";
        // line 49
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 49, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").addClass(\"fa-sign-in-alt\");
                \$(\"#agsLineItemResultZone-";
        // line 50
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 50, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").html(
                    '<br/>' +
                    '<hr/>' +
                    '<div class=\"alert alert-danger\" role=\"alert\">'+
                    '<i class=\"fas fa-exclamation-circle\"></i>&nbsp;Error ' +
                    result.responseJSON.code +
                    ': ' +
                    result.responseJSON.message +
                    '</div>'
                );
            }
        });
    });

    \$(\"#agsResultReset-";
        // line 64
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 64, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").click(function(){
        \$(\"#agsLineItemResultZone-";
        // line 65
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 65, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").html(\"\");
        \$(\"#agsResultUser-";
        // line 66
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 66, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").val(\"\");
        \$(\"#agsResultLimit-";
        // line 67
        echo twig_escape_filter($this->env, ((array_key_exists("mode", $context)) ? (_twig_default_filter((isset($context["mode"]) || array_key_exists("mode", $context) ? $context["mode"] : (function () { throw new RuntimeError('Variable "mode" does not exist.', 67, $this->source); })()), "line-item-container")) : ("line-item-container")), "html", null, true);
        echo "\").val(\"\");
    });
</script>";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

    }

    public function getTemplateName()
    {
        return "tool/ajax/ags/prepareResults.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  180 => 67,  176 => 66,  172 => 65,  168 => 64,  151 => 50,  147 => 49,  143 => 48,  137 => 45,  133 => 44,  129 => 43,  123 => 40,  119 => 39,  113 => 36,  109 => 35,  105 => 34,  101 => 33,  97 => 32,  91 => 29,  86 => 27,  81 => 25,  71 => 18,  66 => 16,  62 => 15,  51 => 7,  44 => 3,  40 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("<div class=\"form-row\">
    <div class=\"col col col-md-10\">
        <input type=\"text\" id=\"agsResultUser-{{ mode|default('line-item-container') }}\" class=\"form-control\" placeholder=\"User\" aria-describedby=\"agsResultUserHelp\">
        <small id=\"agsResultUserHelp\" class=\"form-text text-muted\">User identifier filter</small>
    </div>
    <div class=\"col col col-md-2\">
        <input type=\"number\" id=\"agsResultLimit-{{ mode|default('line-item-container') }}\" class=\"form-control\" placeholder=\"Limit\" aria-describedby=\"agsResultLimitHelp\">
        <small id=\"agsResultLimitHelp\" class=\"form-text text-muted\">Limit to return</small>
    </div>
</div>
<br/>
<div class=\"form-row float-right\">
    <div class=\"col col col-md-12\">
        <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">
            <button id=\"agsResultLoad-{{ mode|default('line-item-container') }}\" class=\"btn-info btn\">
                <i id=\"agsResultCall-{{ mode|default('line-item-container') }}\" class=\"fas fa-poll-h\"></i>&nbsp;Get results
            </button>
            <button id=\"agsResultReset-{{ mode|default('line-item-container') }}\" class=\"btn-secondary btn\">
                <i class=\"fas fa-undo\"></i>&nbsp;Reset
            </button>
        </div>
    </div>
</div>
<br/>
<div id=\"agsLineItemResultZone-{{ mode|default('line-item-container') }}\"></div>
<script>
    \$(\"#agsResultLoad-{{ mode|default('line-item-container') }}\").click(function (event) {
        \$.ajax({
            url: \"{{ path('tool_ajax_service_ags_list_results', {'lineItemIdentifier': lineItem.identifier|base64_url_encode}) }}\",
            method: \"GET\",
            data: {
                registration: \"{{ registration.identifier }}\",
                user: \$(\"#agsResultUser-{{ mode|default('line-item-container') }}\").val(),
                limit: \$(\"#agsResultLimit-{{ mode|default('line-item-container') }}\").val(),
                mode: \"{{ mode }}\",
                scopes: \"{{ scopes }}\"
            },
            beforeSend: function(result){
                \$(\"#agsResultCall-{{ mode|default('line-item-container') }}\").removeClass(\"fa-poll-h\");
                \$(\"#agsResultCall-{{ mode|default('line-item-container') }}\").addClass(\"fa-spinner fa-spin\");
            },
            success: function(result){
                \$(\"#agsResultCall-{{ mode|default('line-item-container') }}\").removeClass(\"fa-spinner fa-spin\");
                \$(\"#agsResultCall-{{ mode|default('line-item-container') }}\").addClass(\"fa-poll-h\");
                \$(\"#agsLineItemResultZone-{{ mode|default('line-item-container') }}\").html(result);
            },
            error: function(result){
                \$(\"#agsResultCall-{{ mode|default('line-item-container') }}\").removeClass(\"fa-spinner fa-spin\");
                \$(\"#agsResultCall-{{ mode|default('line-item-container') }}\").addClass(\"fa-sign-in-alt\");
                \$(\"#agsLineItemResultZone-{{ mode|default('line-item-container') }}\").html(
                    '<br/>' +
                    '<hr/>' +
                    '<div class=\"alert alert-danger\" role=\"alert\">'+
                    '<i class=\"fas fa-exclamation-circle\"></i>&nbsp;Error ' +
                    result.responseJSON.code +
                    ': ' +
                    result.responseJSON.message +
                    '</div>'
                );
            }
        });
    });

    \$(\"#agsResultReset-{{ mode|default('line-item-container') }}\").click(function(){
        \$(\"#agsLineItemResultZone-{{ mode|default('line-item-container') }}\").html(\"\");
        \$(\"#agsResultUser-{{ mode|default('line-item-container') }}\").val(\"\");
        \$(\"#agsResultLimit-{{ mode|default('line-item-container') }}\").val(\"\");
    });
</script>", "tool/ajax/ags/prepareResults.html.twig", "C:\\wamp64\\www\\devkit-lti1p3-master-tool\\templates\\tool\\ajax\\ags\\prepareResults.html.twig");
    }
}
