<?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;
use Twig\TemplateWrapper;

/* @UVDeskAutomation/PreparedResponse/createPreparedResponse.html.twig */
class __TwigTemplate_ebef99b803e109d5952ae7ec64b68b0a extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

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

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

        $this->blocks = [
            'title' => [$this, 'block_title'],
            'internalcss' => [$this, 'block_internalcss'],
            'pageContent' => [$this, 'block_pageContent'],
            'footer' => [$this, 'block_footer'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 1
        return "@UVDeskCoreFramework/Templates/layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->loadTemplate("@UVDeskCoreFramework/Templates/layout.html.twig", "@UVDeskAutomation/PreparedResponse/createPreparedResponse.html.twig", 1);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        yield " 
    ";
        // line 4
        if (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, false, false, 4), "get", ["id"], "method", false, false, false, 4)) {
            // line 5
            yield "        ";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Edit Prepared Response"), "html", null, true);
            yield "
    ";
        } else {
            // line 7
            yield "        ";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Add Prepared Response"), "html", null, true);
            yield "
    ";
        }
        yield from [];
    }

    // line 11
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_internalcss(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 12
        yield "    @media(max-width: 767px) {
        #company-workflow > .steps {
            display: none;
        }
    }

    @media(max-width: 579px) {
        #company-workflow > h3 {
            margin-right: 80px;
        }

        #company-workflow > h3 > a {
            position: absolute;
            top: 0px;
            right: 10px;
        }
    }

    .has-error button.btn {
        border-color: #cc5965;
    }
";
        yield from [];
    }

    // line 35
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_pageContent(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 36
        yield "    <style>
        .workflow-conditions-body .workflow-condition:first-child .uv-workflow-hr-plank {
            display: none;
        }
    </style>
    <!-- Inner Section -->
    <div class=\"uv-inner-section\">
        ";
        // line 44
        yield "\t\t";
        $context["asideTemplate"] = "Webkul\\UVDesk\\CoreFrameworkBundle\\Dashboard\\AsideTemplate";
        // line 45
        yield "\t\t";
        $context["asideSidebarReference"] = "Webkul\\UVDesk\\CoreFrameworkBundle\\UIComponents\\Dashboard\\Panel\\Sidebars\\Productivity";
        // line 46
        yield "
\t\t";
        // line 47
        yield CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["uvdesk_extensibles"] ?? null), "getRegisteredComponent", [($context["asideTemplate"] ?? null)], "method", false, false, false, 47), "renderSidebar", [($context["asideSidebarReference"] ?? null)], "method", false, false, false, 47);
        yield "

        <!-- View -->
        <div class=\"uv-view ";
        // line 50
        if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, false, false, 50), "cookies", [], "any", false, false, false, 50) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, false, false, 50), "cookies", [], "any", false, false, false, 50), "get", ["uv-asideView"], "method", false, false, false, 50))) {
            yield "uv-aside-view";
        }
        yield "\">
            <!-- Form -->
            ";
        // line 52
        if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, false, false, 52), "get", ["id"], "method", false, false, false, 52))) {
            // line 53
            yield "                <h1>";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Edit Prepared Response"), "html", null, true);
            yield "</h1>
                <form class=\"workflow-form\" name=\"form-workflow\" method=\"POST\" action=\"";
            // line 54
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("prepare_response_editaction", ["id" => CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, false, false, 54), "get", ["id"], "method", false, false, false, 54)]), "html", null, true);
            yield "\">
            ";
        } else {
            // line 56
            yield "                <h1>";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("New Prepared Response"), "html", null, true);
            yield "</h1>
                <form class=\"workflow-form\" name=\"form-workflow\" method=\"POST\" action=\"";
            // line 57
            yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("prepare_response_addaction");
            yield "\">
            ";
        }
        // line 59
        yield "                <!-- Prepared Response Description Section -->
                <div class=\"uv-element-block\">
                    <label class=\"uv-field-label\">";
        // line 61
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Name"), "html", null, true);
        yield "</label>
                    <div class=\"uv-field-block\">
                        <input name=\"name\" class=\"uv-field\" type=\"text\" value=\"";
        // line 63
        ((CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "name", [], "any", true, true, false, 63)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "name", [], "any", false, false, false, 63), "html", null, true)) : (yield ""));
        yield "\">
                        <p class=\"uv-field-message\">";
        // line 64
        if (CoreExtension::getAttribute($this->env, $this->source, ($context["error"] ?? null), "name", [], "any", true, true, false, 64)) {
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["error"] ?? null), "name", [], "any", false, false, false, 64), "html", null, true);
        }
        yield "</p>
                    </div>
                </div>

                <div class=\"uv-element-block\">
                    <label class=\"uv-field-label\">";
        // line 69
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Description"), "html", null, true);
        yield "</label>
                    <div class=\"uv-field-block\">
                        <textarea name=\"description\" class=\"uv-field\">";
        // line 71
        ((CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "description", [], "any", true, true, false, 71)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "description", [], "any", false, false, false, 71), "html", null, true)) : (yield ""));
        yield "</textarea>
                        <p class=\"uv-field-message\">";
        // line 72
        if (CoreExtension::getAttribute($this->env, $this->source, ($context["error"] ?? null), "description", [], "any", true, true, false, 72)) {
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["error"] ?? null), "description", [], "any", false, false, false, 72), "html", null, true);
        }
        yield "</p>
                    </div>
                </div>

                <div class=\"uv-element-block\">
                    <label class=\"uv-field-label\">";
        // line 77
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Prepared Response Status"), "html", null, true);
        yield "</label>
                    <div class=\"uv-element-block\">
                        <label>
                            <div class=\"uv-checkbox\">
                                <input name=\"status\" type=\"checkbox\" ";
        // line 81
        yield (((CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "status", [], "any", true, true, false, 81) && (CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "status", [], "any", false, false, false, 81) == "on"))) ? ("checked") : (""));
        yield ">
                                <span class=\"uv-checkbox-view\"></span>
                            </div>
                            <span class=\"uv-checkbox-label\">";
        // line 84
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Prepared Response is Active"), "html", null, true);
        yield "</span>
                        </label>
                    </div>
                </div>
                ";
        // line 88
        if (CoreExtension::getAttribute($this->env, $this->source, ($context["user_service"] ?? null), "isAccessAuthorized", ["ROLE_ADMIN"], "method", false, false, false, 88)) {
            // line 89
            yield "                    <div class=\"uv-hr\"></div>
                
                    <!-- Field -->
                    <div class=\"uv-element-block\">
                        <label class=\"uv-field-label\">";
            // line 93
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Groups"), "html", null, true);
            yield "</label>
                        <div class=\"uv-field-block\" id=\"group-filter\">
                            <input type=\"hidden\" name=\"tempGroups\" class=\"uv-field\" value=\"\" />
                            <input name=\"groups\" class=\"uv-field uv-dropdown-other preloaded\" type=\"text\" id=\"group-filter-input\" value=\"\">
                            <span class=\"uv-field-info\">";
            // line 97
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Share prepared response with user(s) in these group(s)"), "html", null, true);
            yield "</span>
                            <div class=\"uv-dropdown-list uv-bottom-left\">
                                <div class=\"uv-dropdown-container\">
                                    <label>";
            // line 100
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Filter With"), "html", null, true);
            yield "</label>
                                    <ul class=\"\">
                                        ";
            // line 102
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, ($context["user_service"] ?? null), "getSupportGroups", [], "method", false, false, false, 102));
            foreach ($context['_seq'] as $context["_key"] => $context["group"]) {
                // line 103
                yield "                                            <li data-id=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["group"], "id", [], "any", false, false, false, 103), "html", null, true);
                yield "\">
                                                ";
                // line 104
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["group"], "name", [], "any", false, false, false, 104), "html", null, true);
                yield "
                                            </li>
                                        ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['group'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 107
            yield "                                        <li class=\"uv-no-results\" style=\"display: none;\">
                                            ";
            // line 108
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("No result found"), "html", null, true);
            yield "
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class=\"uv-filtered-tags\">
                                ";
            // line 114
            if ((CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "groups", [], "any", true, true, false, 114) && CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "groups", [], "any", false, false, false, 114))) {
                // line 115
                yield "                                    ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "groups", [], "any", false, false, false, 115));
                foreach ($context['_seq'] as $context["_key"] => $context["group"]) {
                    // line 116
                    yield "                                        ";
                    if (CoreExtension::getAttribute($this->env, $this->source, $context["group"], "isActive", [], "any", false, false, false, 116)) {
                        // line 117
                        yield "                                            <a class=\"uv-btn-small default\" href=\"#\" data-id=\"";
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["group"], "id", [], "any", false, false, false, 117), "html", null, true);
                        yield "\">
                                                ";
                        // line 118
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["group"], "name", [], "any", false, false, false, 118), "html", null, true);
                        yield "
                                                <span class=\"uv-icon-remove\"></span>
                                            </a>
                                        ";
                    }
                    // line 122
                    yield "                                    ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_key'], $context['group'], $context['_parent']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 123
                yield "                                ";
            }
            // line 124
            yield "                            </div>
                        </div>
                    </div>
                    <!-- //Field -->

                    <!-- Field -->
                    <div class=\"uv-element-block\">
                        <label class=\"uv-field-label\">";
            // line 131
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Teams"), "html", null, true);
            yield "</label>
                        <div class=\"uv-field-block\" id=\"team-filter\">
                            <input type=\"hidden\" name=\"tempTeams\" class=\"uv-field\" value=\"\" />
                            <input class=\"uv-field uv-dropdown-other preloaded\" type=\"text\" id=\"team-filter-input\">
                            <span class=\"uv-field-info\">";
            // line 135
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Share prepared response with user(s) in these teams(s)"), "html", null, true);
            yield "</span>
                            <div class=\"uv-dropdown-list uv-bottom-left\">
                                <div class=\"uv-dropdown-container\">
                                    <label>";
            // line 138
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Filter With"), "html", null, true);
            yield "</label>
                                    <ul class=\"\">
                                        ";
            // line 140
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, ($context["user_service"] ?? null), "getSupportTeams", [], "method", false, false, false, 140));
            foreach ($context['_seq'] as $context["_key"] => $context["team"]) {
                // line 141
                yield "                                            <li data-id=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["team"], "id", [], "any", false, false, false, 141), "html", null, true);
                yield "\">
                                                ";
                // line 142
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["team"], "name", [], "any", false, false, false, 142), "html", null, true);
                yield "
                                            </li>
                                        ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['team'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 145
            yield "                                        <li class=\"uv-no-results\" style=\"display: none;\">
                                            ";
            // line 146
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("No result found"), "html", null, true);
            yield "
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class=\"uv-filtered-tags\">
                                ";
            // line 152
            if ((CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "teams", [], "any", true, true, false, 152) && CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "teams", [], "any", false, false, false, 152))) {
                // line 153
                yield "                                    ";
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, ($context["formData"] ?? null), "teams", [], "any", false, false, false, 153));
                foreach ($context['_seq'] as $context["_key"] => $context["team"]) {
                    // line 154
                    yield "                                        ";
                    if (CoreExtension::getAttribute($this->env, $this->source, $context["team"], "isActive", [], "any", false, false, false, 154)) {
                        // line 155
                        yield "                                            <a class=\"uv-btn-small default\" href=\"#\" data-id=\"";
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["team"], "id", [], "any", false, false, false, 155), "html", null, true);
                        yield "\">
                                                ";
                        // line 156
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["team"], "name", [], "any", false, false, false, 156), "html", null, true);
                        yield "
                                                <span class=\"uv-icon-remove\"></span>
                                            </a>
                                        ";
                    }
                    // line 160
                    yield "                                    ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_key'], $context['team'], $context['_parent']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 161
                yield "                                ";
            }
            // line 162
            yield "                            </div>
                        </div>
                    </div>
                    <!-- //Field --> 
                ";
        }
        // line 167
        yield "                <div class=\"uv-hr\"></div>
                <!-- // Prepared Response Description Section -->


                <!-- Prepared Response Actions Section -->
                <div id=\"actions\" class=\"uv-element-block uv-field-workflow\">
                    <label class=\"uv-field-label\">";
        // line 173
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Actions"), "html", null, true);
        yield "</label>
                    <span class=\"uv-field-info\">";
        // line 174
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("An action not only reduces the workload but also makes it quite easier for ticket automation"), "html", null, true);
        yield "</span>

                    <div class=\"workflow-action-body\"></div>
                    <div class=\"uv-workflow-buttons\">
                        <a class=\"uv-btn-tag btn-add\" href=\"#\">
                            <span class=\"uv-icon-add-dark\"></span> ";
        // line 179
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Add More"), "html", null, true);
        yield "
                        </a>
                    </div>
                </div>
                <!-- // Prepared Response Actions Section -->


                <!-- CTA -->
                ";
        // line 188
        yield "                <button type=\"submit\" name=\"submit\" class=\"uv-btn\" href=\"#\" ";
        if ((array_key_exists("forcedActions", $context) && ($context["forcedActions"] ?? null))) {
            yield "disabled=\"disabled\" date-toggle=\"tooltip\" title=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("You don't have premission to edit this Prepared response"), "html", null, true);
            yield " \" ";
        }
        yield " >";
        if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, false, false, 188), "get", ["id"], "method", false, false, false, 188))) {
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Save Prepared Response"), "html", null, true);
        } else {
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Add Prepared Response"), "html", null, true);
        }
        yield "</button>
                <!-- // CTA -->
            </form>
            <!-- Form -->
        </div>
        <!-- // View -->
    </div>
    <!-- // Inner Section -->
";
        yield from [];
    }

    // line 198
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_footer(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 199
        yield "    ";
        yield from $this->yieldParentBlock("footer", $context, $blocks);
        yield "

    <script type=\"text/javascript\">
        _.extend(Backbone.Validation.patterns, {
          stringPattern: /[a-z0-9]/i,
        });

        _.extend(Backbone.Validation.callbacks, {
            valid : function (view, attr, selector) {
                console.log(\$('[name=\"'+attr+'\"]').closest('.uv-field-block'));
                \$('[name=\"'+attr+'\"]').closest('.uv-field-block').find('.uv-field-message').html('').fadeOut(0);
            },
            invalid : function (view, attr, error, selector) {
                console.log(\$('[name=\"'+attr+'\"]').closest('.uv-field-block'));
                \$('[name=\"'+attr+'\"]').closest('.uv-field-block').find('.uv-field-message').html(error).fadeIn(0);
            }
        });

        if(typeof(sB) == 'undefined'){
          var sB = {};
        }

        sB.WorkflowCollection = Backbone.Collection.extend({
            baseUrl: \"";
        // line 222
        yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ajax_service_call");
        yield "\",
            fetchResult: function(dataMatch) {
            this.url = this.baseUrl;
            return this.fetch({ 'data' : {
                'service': 'email.service',
                'call': 'getEmailPlaceHolders',
                'options': { 'match': dataMatch },
            }});
        }});
        sB.workflowCollection = new sB.WorkflowCollection();

        sB.WorkflowModel = Backbone.Model.extend({
            validation: {
                name: {
                    required: true,
                    pattern: 'stringPattern',
                    msg: \"";
        // line 238
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Please enter a valid name."), "html", null, true);
        yield "\"
                },
            },
\t\t\t";
        // line 241
        if ( !(array_key_exists("forcedActions", $context) && ($context["forcedActions"] ?? null))) {
            // line 242
            yield "                validateSelect: function(value, attr, computedState) {
                    var currentSelectValue = \$('select[name=\"'+ attr + '\"]').prev().find('.selected').length;
                    if (!value) {
                        return \"";
            // line 245
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Please select a value."), "html", null, true);
            yield "\";
                    }
                },
                validateSelectMultiple: function(value, attr, computedState) {
                    var currentSelectValue = \$('[name=\"'+ attr + '\"]').length;
                    if (!value) {
                        return \"";
            // line 251
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Please select a value."), "html", null, true);
            yield "\";
                    }
                },
                validateSelectText: function(value, attr, computedState) {
                    if (!value) {
                        return \"";
            // line 256
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Please add a value."), "html", null, true);
            yield "\";
                    }
                }
\t\t\t";
        }
        // line 259
        yield "            
        });

        sB.WorkflowView = Backbone.View.extend({
            el: '.uv-view',
            initialize: function() {
                this.model = new sB.WorkflowModel();
                Backbone.Validation.bind(this);
                this.setAddedIds('#group-filter');
                this.setAddedIds('#team-filter');
            },
            events: {
                'submit form[name=\"form-workflow\"]': 'processWorlfow',
                'click .workflow-form .uv-dropdown-list li': 'addEntity',
                'click .workflow-form .uv-filtered-tags .uv-btn-small': 'removeEntity'                
            },
            processWorlfow: function(e) {
                this.model.set(this.\$el.find('form').serializeObject());

                var self = this;
                filterArray = ['name'];
                // Populate Filter Array - Events and Actions are required fields
                
                // Actions
                this.\$('.wfAction').each(function(key, value) {
                    filterArray.push(\$(value).attr('name'));
                    self.model.validation[\$(value).attr('name')] = 'validateSelect';
                });
                this.\$('.wfActionMultiple').each(function(key, value) {
                    filterArray.push(\$(value).attr('name'));
                    self.model.validation[\$(value).attr('name')] = 'validateSelectMultiple';
                });
                this.\$('.wfActionValue').each(function(key, value) {
                    if (\$(this).attr('name') == undefined) {
                        return;
                    }

                    filterArray.push(\$(value).attr('name'));
                    self.model.validation[\$(value).attr('name')] = 'validateSelectText';
                });

                if (this.validateData(filterArray)) {
                    return true;
                } else {
                    e.preventDefault();
                }
            },
            validateData: function(filterArray) {
                return this.model.isValid(filterArray);
            },
            updateActive: function(e){
                this.\$('div.step-info').each(function() {
                    \$(this).addClass('active');
                    if (\$(this).attr('data-href') == self.\$(e.target).attr('href'))
                        return false;
                });
            },
            addEntity: function(e) {
                currentElement = Backbone.\$(e.currentTarget);
                if(id = currentElement.attr(\"data-id\")) {
                    parent = currentElement.parents(\".uv-field-block\");
                    parent.find('input').val('')
                    parent.find(\"li:not(.uv-no-results)\").show();

                    if(!parent.find(\".uv-filtered-tags a[data-id='\" + id + \"']\").length) {
                        parent.find('.uv-filtered-tags').append(\"<a class='uv-btn-small default' href='#' data-id='\" + id + \"'>\"+currentElement.text()+\"<span class='uv-icon-remove'></span></a>\")
                        this.setAddedIds(\"#\" + parent.attr('id'))
                    }
                }
            },
            removeEntity: function(e) {
                var parent = Backbone.\$(e.currentTarget).parents(\".uv-field-block\")
                Backbone.\$(e.currentTarget).remove()
                this.setAddedIds(\"#\" + parent.attr('id'))
            },
            setAddedIds: function(selector) {
                var ids = [];
                \$(selector).find('.uv-filtered-tags .uv-btn-small').each(function() {
                    ids.push(\$(this).attr('data-id'))
                });

                \$(selector).find(\"input[type='hidden']\").val(ids.join(','))

                return ids;
            },            
        });
        sB.workflowView = new sB.WorkflowView();

        \$.fn.serializeObject = function () {
            \"use strict\";
            var a = {}, b = function (b, c) {
                var d = a[c.name];
                \"undefined\" != typeof d && d !== null ? \$.isArray(d) ? d.push(c.value) : a[c.name] = [d, c.value] : a[c.name] = c.value
            };
            return \$.each(this.serializeArray(), b), a
        };
    </script>
    
    ";
        // line 357
        yield Twig\Extension\CoreExtension::include($this->env, $context, "@UVDeskAutomation//PreparedResponse//actions.html.twig");
        yield "
";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "@UVDeskAutomation/PreparedResponse/createPreparedResponse.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  663 => 357,  563 => 259,  556 => 256,  548 => 251,  539 => 245,  534 => 242,  532 => 241,  526 => 238,  507 => 222,  480 => 199,  473 => 198,  448 => 188,  437 => 179,  429 => 174,  425 => 173,  417 => 167,  410 => 162,  407 => 161,  401 => 160,  394 => 156,  389 => 155,  386 => 154,  381 => 153,  379 => 152,  370 => 146,  367 => 145,  358 => 142,  353 => 141,  349 => 140,  344 => 138,  338 => 135,  331 => 131,  322 => 124,  319 => 123,  313 => 122,  306 => 118,  301 => 117,  298 => 116,  293 => 115,  291 => 114,  282 => 108,  279 => 107,  270 => 104,  265 => 103,  261 => 102,  256 => 100,  250 => 97,  243 => 93,  237 => 89,  235 => 88,  228 => 84,  222 => 81,  215 => 77,  205 => 72,  201 => 71,  196 => 69,  186 => 64,  182 => 63,  177 => 61,  173 => 59,  168 => 57,  163 => 56,  158 => 54,  153 => 53,  151 => 52,  144 => 50,  138 => 47,  135 => 46,  132 => 45,  129 => 44,  120 => 36,  113 => 35,  87 => 12,  80 => 11,  71 => 7,  65 => 5,  63 => 4,  54 => 3,  43 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "@UVDeskAutomation/PreparedResponse/createPreparedResponse.html.twig", "/home/bmdranzo/public_html/vendor/uvdesk/automation-bundle/Resources/views/PreparedResponse/createPreparedResponse.html.twig");
    }
}
