<?php

/* AgentBundle:Ticket:view.html.twig */
class __TwigTemplate_9f55119b33148c204e73193e4defe1cf extends \Application\DeskPRO\Twig\Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        $context["flag"] = $this->env->loadTemplate("AgentBundle:Common:macro-flagname.html.twig");
        // line 2
        $context["agentui"] = $this->env->loadTemplate("AgentBundle:Common:agent-macros.html.twig");
        // line 3
        echo "<script>
pageMeta.fragmentClass = 'DeskPRO.Agent.PageFragment.Page.Ticket';
pageMeta.title         = ";
        // line 5
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_jsonencode_filter($this->getAttribute($_ticket_, "subject"));
        echo ";
pageMeta.ticket_id     = ";
        // line 6
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "id"), "html", null, true);
        echo ";
pageMeta.alert_id      = 'ticket-";
        // line 7
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "id"), "html", null, true);
        echo "';
pageMeta.url_fragment  = '";
        // line 8
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->urlFragment("agent_ticket_view", array("ticket_id" => $this->getAttribute($_ticket_, "id"))), "html", null, true);
        echo "';

pageMeta.labelsAutocompleteUrl        = '";
        // line 10
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ajax_labels_autocomplete", array("label_type" => "tickets")), "html", null, true);
        echo "';
pageMeta.labelsSaveUrl                = '";
        // line 11
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticket_ajax_labels_save", array("ticket_id" => $this->getAttribute($_ticket_, "id"))), "html", null, true);
        echo "';
pageMeta.getMacroUrl                  = '";
        // line 12
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticket_ajax_get_macro", array("ticket_id" => $this->getAttribute($_ticket_, "id"))), "html", null, true);
        echo "?macro_id=\$macro_id';
pageMeta.saveActionsUrl               = '";
        // line 13
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticket_ajax_save_actions", array("ticket_id" => $this->getAttribute($_ticket_, "id"))), "html", null, true);
        echo "';
pageMeta.deleteTicketUrl              = '";
        // line 14
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticketsearch_ajax_delete_tickets"), "html", null, true);
        echo "';
pageMeta.uploadAttachUrl              = '";
        // line 15
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_accept_upload"), "html", null, true);
        echo "';
pageMeta.getMessageQuoteUrl           = '";
        // line 16
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, strtr($this->env->getExtension('routing')->getPath("agent_ticket_message_ajax_getquote", array("ticket_id" => $this->getAttribute($_ticket_, "id"), "message_id" => "000")), array("000" => "{message_id}")), "html", null, true);
        echo "';
pageMeta.viewPersonUrl                = '";
        // line 17
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_people_view", array("person_id" => $this->getAttribute($this->getAttribute($_ticket_, "person"), "id"))), "html", null, true);
        echo "';
pageMeta.lastMessageId = ";
        // line 18
        if (isset($context["last_message_id"])) { $_last_message_id_ = $context["last_message_id"]; } else { $_last_message_id_ = null; }
        echo twig_escape_filter($this->env, ((array_key_exists("last_message_id", $context)) ? (_twig_default_filter($_last_message_id_, 0)) : (0)), "html", null, true);
        echo ";
pageMeta.lastLogId = ";
        // line 19
        if (isset($context["last_log_id"])) { $_last_log_id_ = $context["last_log_id"]; } else { $_last_log_id_ = null; }
        echo twig_escape_filter($this->env, ((array_key_exists("last_log_id", $context)) ? (_twig_default_filter($_last_log_id_, 0)) : (0)), "html", null, true);
        echo ";
pageMeta.ticket_reverse_order = ";
        // line 20
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_reverse_order"), "method")) {
            echo "true";
        } else {
            echo "false";
        }
        echo ";

pageMeta.dateFormat = '";
        // line 22
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->jqueryUiDateFormat($this->getAttribute($_app_, "getSetting", array(0 => "core.date_day"), "method")), "html", null, true);
        echo "';
pageMeta.last_activity = ";
        // line 23
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_ticket_, "getLastActivityDate", array(), "method"), "getTimestamp", array(), "method"), "html", null, true);
        echo ";

pageMeta.person_id    = ";
        // line 25
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_ticket_, "person"), "id"), "html", null, true);
        echo ";
pageMeta.person_email = ";
        // line 26
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_jsonencode_filter($this->getAttribute($this->getAttribute($_ticket_, "person"), "primary_email_address"));
        echo ";
pageMeta.person_name  = ";
        // line 27
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_jsonencode_filter($this->getAttribute($this->getAttribute($_ticket_, "person"), "display_name"));
        echo ";

pageMeta.ticket = ";
        // line 29
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo twig_jsonencode_filter($_ticket_api_);
        echo ";
pageMeta.api_data = ";
        // line 30
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_jsonencode_filter($this->getAttribute($_ticket_, "toApiData", array(), "method"));
        echo ";

pageMeta.ticket_perms = ";
        // line 32
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        echo twig_jsonencode_filter($_ticket_perms_);
        echo ";
";
        // line 33
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($_ticket_, "isLocked", array(0 => $this->getAttribute($_app_, "user")), "method")) {
            // line 34
            echo "\tpageMeta.isLocked = true;
";
        } else {
            // line 36
            echo "\tpageMeta.isLocked = false;
";
        }
        // line 38
        echo "pageMeta.unlockOnClose = ";
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        echo (($this->getAttribute($_app_, "getSetting", array(0 => "core_tickets.unlock_on_close"), "method")) ? ("true") : ("false"));
        echo ";

";
        // line 40
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($this->getAttribute($_ticket_, "person"), "organization")) {
            // line 41
            echo "\tpageMeta.viewOrgUrl = '";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_org_view", array("organization_id" => $this->getAttribute($this->getAttribute($this->getAttribute($_ticket_, "person"), "organization"), "id"))), "html", null, true);
            echo "';
";
        }
        // line 43
        echo "
";
        // line 44
        $context["baseId"] = $this->env->getExtension('deskpro_templating')->elUid();
        // line 45
        echo "pageMeta.baseId = '";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "';

pageMeta.isDeleted = ";
        // line 47
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_, "hidden_status") == "deleted")) {
            echo "true";
        } else {
            echo "false";
        }
        echo ";
pageMeta.isClosed = ";
        // line 48
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_, "status") == "closed")) {
            echo "true";
        } else {
            echo "false";
        }
        echo ";
pageMeta.isSpam = ";
        // line 49
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_, "hidden_status") == "spam")) {
            echo "true";
        } else {
            echo "false";
        }
        echo ";
";
        // line 51
        echo "pageMeta.auto_start_bill = ";
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($_app_, "getSetting", array(0 => "core_tickets.billing_auto_timer"), "method")) {
            echo "true";
        } else {
            echo "false";
        }
        echo ";
pageMeta.agents_with_perm = ";
        // line 52
        if (isset($context["agents_with_perm"])) { $_agents_with_perm_ = $context["agents_with_perm"]; } else { $_agents_with_perm_ = null; }
        echo twig_jsonencode_filter($_agents_with_perm_);
        echo ";

pageMeta.agentMap = ";
        // line 54
        if (isset($context["agent_map"])) { $_agent_map_ = $context["agent_map"]; } else { $_agent_map_ = null; }
        echo twig_jsonencode_filter($_agent_map_);
        echo ";
pageMeta.goNextOnReply = ";
        // line 55
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        echo (($this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_go_next_reply"), "method")) ? ("true") : ("false"));
        echo ";
pageMeta.lang = ";
        // line 56
        echo twig_jsonencode_filter(array("find_ticket" => $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.find_ticket"), "users_tickets" => $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.users_tickets"), "open_tickets" => $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.open_tickets"), "filter_results" => $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.filter_results"), "search" => $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.search")));
        // line 62
        echo ";
</script>
<div class=\"layout-content with-scrollbar page-ticket ";
        // line 64
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($_ticket_, "isLocked", array(0 => $this->getAttribute($_app_, "user")), "method")) {
            echo "locked";
        }
        echo " ";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, strtr($this->getAttribute($_ticket_, "status_code"), array("." => "_")), "html", null, true);
        echo " urgency-";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "urgency"), "html", null, true);
        echo "\">
<div class=\"scrollbar disable\"><div class=\"track\"><div class=\"thumb\"><div class=\"end\"></div></div></div></div>
<div class=\"scroll-viewport\"><div class=\"scroll-content\">

";
        // line 68
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        $context["locked_self"] = ($this->getAttribute($_ticket_, "locked_by_agent") && ($this->getAttribute($this->getAttribute($_ticket_, "locked_by_agent"), "id") == $this->getAttribute($this->getAttribute($_app_, "user"), "id")));
        // line 69
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($_ticket_, "is_locked")) {
            echo "<div class=\"locked-overlay\" id=\"";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_locked_overlay\"></div>";
        }
        // line 70
        echo "
<form class=\"value-form\" id=\"";
        // line 71
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_value_form\" style=\"display:none\">
\t<input type=\"hidden\" name=\"department_id\" class=\"department_id\" value=\"";
        // line 72
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "department", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "department", array(), "any", false, true), "id"), 0)) : (0)), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"agent_id\" class=\"agent_id\" value=\"";
        // line 73
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "agent", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "agent", array(), "any", false, true), "id"), 0)) : (0)), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"agent_team_id\" class=\"agent_team_id\" value=\"";
        // line 74
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "agent_team", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "agent_team", array(), "any", false, true), "id"), 0)) : (0)), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"product_id\" class=\"product_id\" value=\"";
        // line 75
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "product", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "product", array(), "any", false, true), "id"), 0)) : (0)), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"category_id\" class=\"category_id\" value=\"";
        // line 76
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "category", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "category", array(), "any", false, true), "id"), 0)) : (0)), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"workflow_id\" class=\"workflow_id\" value=\"";
        // line 77
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "workflow", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "workflow", array(), "any", false, true), "id"), 0)) : (0)), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"priority_id\" class=\"priority_id\" value=\"";
        // line 78
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "priority", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "priority", array(), "any", false, true), "id"), 0)) : (0)), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"language_id\" class=\"language_id\" value=\"";
        // line 79
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "language", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "language", array(), "any", false, true), "id"), $this->getAttribute($this->getAttribute($_app_, "languages"), "getDefaultId", array(), "method"))) : ($this->getAttribute($this->getAttribute($_app_, "languages"), "getDefaultId", array(), "method"))), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"is_hold\" class=\"is_hold\" value=\"";
        // line 80
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($_ticket_, "is_hold", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($_ticket_, "is_hold"), 0)) : (0)), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"status\" class=\"status\" value=\"";
        // line 81
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "status"), "html", null, true);
        echo "\" />
\t<input type=\"hidden\" name=\"hidden_status\" class=\"hidden_status\" value=\"";
        // line 82
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "hidden_status"), "html", null, true);
        echo "\" />
</form>

";
        // line 85
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_, "status") == "hidden")) {
            // line 86
            echo "\t";
            $this->env->loadTemplate("AgentBundle:Ticket:view-hidden-bar.html.twig")->display($context);
        }
        // line 88
        echo "
<header class=\"main-header\" id=\"";
        // line 89
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_page_header\">
\t<div id=\"";
        // line 90
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_locked_message\" ";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ((!$this->getAttribute($_ticket_, "locked_by_agent"))) {
            echo "style=\"display: none\"";
        }
        echo " ";
        if (isset($context["locked_self"])) { $_locked_self_ = $context["locked_self"]; } else { $_locked_self_ = null; }
        if ($_locked_self_) {
            echo "data-locked-self=\"1\"";
        }
        echo ">
\t\t<div class=\"locked-message\">
\t\t\t<button class=\"dp-btn\" id=\"";
        // line 92
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_unlock_ticket2\" style=\"float:right\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.unlock");
        echo "</button>
\t\t\t<div style=\"margin-right: 100px;\">
\t\t\t\t<div id=\"";
        // line 94
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_locked_message_self\" ";
        if (isset($context["locked_self"])) { $_locked_self_ = $context["locked_self"]; } else { $_locked_self_ = null; }
        if ((!$_locked_self_)) {
            echo "style=\"display: none\"";
        }
        echo ">
\t\t\t\t\t";
        // line 95
        if (isset($context["locked_self"])) { $_locked_self_ = $context["locked_self"]; } else { $_locked_self_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if (($_locked_self_ && $this->getAttribute($_app_, "getSetting", array(0 => "core_tickets.lock_on_view"), "method"))) {
            // line 96
            echo "\t\t\t\t\t\t";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.you_have_auto_lock");
            echo "
\t\t\t\t\t";
        } else {
            // line 98
            echo "\t\t\t\t\t\t";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.you_have_locked");
            echo "
\t\t\t\t\t";
        }
        // line 100
        echo "\t\t\t\t\t";
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($_app_, "getSetting", array(0 => "core_tickets.unlock_on_close"), "method")) {
            echo "<br/>";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.lock_auto_release");
        }
        // line 101
        echo "\t\t\t\t</div>
\t\t\t\t";
        // line 102
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["locked_self"])) { $_locked_self_ = $context["locked_self"]; } else { $_locked_self_ = null; }
        if (($this->getAttribute($_ticket_, "locked_by_agent") && (!$_locked_self_))) {
            // line 103
            echo "\t\t\t\t\t<div id=\"";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_locked_message_other\">
\t\t\t\t\t\t";
            // line 104
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.agent_has_lock", array("agent" => $this->getAttribute($this->getAttribute($_ticket_, "locked_by_agent"), "display_name")));
            echo "
\t\t\t\t\t</div>
\t\t\t\t";
        }
        // line 107
        echo "\t\t\t</div>
\t\t</div>
\t</div>
\t<div id=\"";
        // line 110
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_hold_message\" ";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ((!$this->getAttribute($_ticket_, "is_hold"))) {
            echo "style=\"display: none\"";
        }
        echo ">
\t\t<div class=\"hold-message\">
\t\t\t<button class=\"dp-btn set-hold unhold\" id=\"";
        // line 112
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_unhold_btn\" style=\"float:right\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.unhold_ticket");
        echo "</button>
\t\t\t<div style=\"margin-right: 100px;\">
\t\t\t\t";
        // line 114
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.currently_on_hold");
        echo "
\t\t\t</div>
\t\t</div>
\t</div>
\t<div class=\"row title first\">
\t\t<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td width=\"10\" nowrap=\"nowrap\">
\t\t\t<div class=\"id-number\" id=\"";
        // line 120
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_idref_switch\">
\t\t\t\t<span id=\"";
        // line 121
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_id_num\" title=\"Ticket ID\">
\t\t\t\t\t<span class=\"copy-btn-outer\"><span class=\"copy-btn\" data-clipboard-text=\"";
        // line 122
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "id"), "html", null, true);
        echo "\" title=\"";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.copy_to_clipboard");
        echo "\"><i class=\"icon-paste\"></i></span></span>
\t\t\t\t\t";
        // line 123
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.id");
        echo ": ";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "id"), "html", null, true);
        echo "
\t\t\t\t</span>
\t\t\t\t<span id=\"";
        // line 125
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_ref_num\" style=\"display: none;\" title=\"Ticket Reference\">
\t\t\t\t\t<span class=\"copy-btn-outer\"><span class=\"copy-btn\" data-clipboard-text=\"";
        // line 126
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "ref"), "html", null, true);
        echo "\" title=\"";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.copy_to_clipboard");
        echo "\"><i class=\"icon-paste\"></i></span></span>
\t\t\t\t\t";
        // line 127
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.id");
        echo ": ";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "ref"), "html", null, true);
        echo "
\t\t\t\t</span>
\t\t\t</div>
\t\t</td><td>
\t\t\t<h1>
\t\t\t\t<span id=\"";
        // line 132
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_showname\">";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "subject"), "html", null, true);
        echo "</span>
\t\t\t\t<span id=\"";
        // line 133
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_editname\" style=\"display: none\"><input type=\"text\" placeholder=\"Enter subject\" name=\"name\" value=\"";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "subject"), "html", null, true);
        echo "\" /></span>
\t\t\t\t<a id=\"";
        // line 134
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_editname_end\" class=\"edit-name-save clean-white\" style=\"display: none\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.done");
        echo "</a>
\t\t\t</h1>
\t\t</td></tr></table>
\t</div>
\t<div class=\"row author last\">
\t\t<div class=\"dp-btn-group dp-dropdown\">
\t\t\t<a id=\"";
        // line 140
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_profile_link\" class=\"dp-btn as-popover preload user-btn\" data-route=\"person:";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_people_view", array("person_id" => $this->getAttribute($_ticket_, "person_id"))), "html", null, true);
        echo "\">
\t\t\t\t<span class=\"text\" style=\"background-image: url(";
        // line 141
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_ticket_, "person"), "getPictureUrl", array(0 => 25), "method"), "html", null, true);
        echo ");\">
\t\t\t\t\t";
        // line 142
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_ticket_, "person"), "getNameWithTitle", array(), "method"), "html", null, true);
        echo "
\t\t\t\t\t<span class=\"email\" id=\"";
        // line 143
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_user_email_text\">(";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "person_email", array(), "any", false, true), "email", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "person_email", array(), "any", false, true), "email"), $this->getAttribute($_ticket_, "person_email_address"))) : ($this->getAttribute($_ticket_, "person_email_address"))), "html", null, true);
        echo ")</span>
\t\t\t\t</span>
\t\t\t</a>
\t\t\t";
        // line 146
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ((twig_length_filter($this->env, $this->getAttribute($this->getAttribute($_ticket_, "person"), "emails")) > 1)) {
            // line 147
            echo "\t\t\t\t<a class=\"dp-btn dp-dropdown-toggle\" style=\"padding: 7px;\" id=\"";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_user_email_menu_trigger\">
\t\t\t\t\t<span class=\"dp-caret dp-caret-down\"></span>
\t\t\t\t</a>
\t\t\t\t<div id=\"";
            // line 150
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_user_email_menu\" class=\"dp-menu\" style=\"display: none;\">
\t\t\t\t\t<section>
\t\t\t\t\t\t<div class=\"dp-menu-area\">
\t\t\t\t\t\t\t<label>";
            // line 153
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.change_user_ticket_email");
            echo "</label>
\t\t\t\t\t\t\t<ul>
\t\t\t\t\t\t\t\t";
            // line 155
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            $context['_parent'] = (array) $context;
            $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($_ticket_, "person"), "emails"));
            foreach ($context['_seq'] as $context["_key"] => $context["email"]) {
                // line 156
                echo "\t\t\t\t\t\t\t\t\t<li data-email-id=\"";
                if (isset($context["email"])) { $_email_ = $context["email"]; } else { $_email_ = null; }
                echo twig_escape_filter($this->env, $this->getAttribute($_email_, "id"), "html", null, true);
                echo "\">";
                if (isset($context["email"])) { $_email_ = $context["email"]; } else { $_email_ = null; }
                echo twig_escape_filter($this->env, $this->getAttribute($_email_, "email"), "html", null, true);
                echo "</li>
\t\t\t\t\t\t\t\t";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['email'], $context['_parent'], $context['loop']);
            $context = array_merge($_parent, array_intersect_key($context, $_parent));
            // line 158
            echo "\t\t\t\t\t\t\t</ul>
\t\t\t\t\t\t</div>
\t\t\t\t\t</section>
\t\t\t\t</div>
\t\t\t";
        }
        // line 163
        echo "\t\t</div>

\t\t";
        // line 165
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($this->getAttribute($_ticket_, "person"), "organization")) {
            // line 166
            echo "\t\t\t&nbsp;&nbsp;
\t\t\t<a id=\"";
            // line 167
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_org_link\" class=\"dp-btn as-popover\" data-route=\"page:";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_org_view", array("organization_id" => $this->getAttribute($this->getAttribute($this->getAttribute($_ticket_, "person"), "organization"), "id"))), "html", null, true);
            echo "\"><i class=\"icon-briefcase\"></i>
\t\t\t\t";
            // line 168
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_ticket_, "person"), "organization"), "html", null, true);
            echo "
\t\t\t\t";
            // line 169
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if ($this->getAttribute($this->getAttribute($_ticket_, "person"), "organization_position")) {
                echo "<span class=\"email\">(";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_ticket_, "person"), "organization_position"), "html", null, true);
                echo ")</span>";
            }
            // line 170
            echo "\t\t\t</a>
\t\t";
        }
        // line 172
        echo "
\t\t";
        // line 173
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if (isset($context["user_parts"])) { $_user_parts_ = $context["user_parts"]; } else { $_user_parts_ = null; }
        if (($this->getAttribute($_ticket_perms_, "modify_cc") && (!twig_length_filter($this->env, $_user_parts_)))) {
            // line 174
            echo "\t\t\t<a class=\"cc-btn cc-btn-main\" id=\"";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_cc_list_btn\"><i class=\"icon-envelope\"></i> <em>";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.add_cc");
            echo "</em></a>
\t\t";
        }
        // line 176
        echo "
\t\t";
        // line 177
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if (isset($context["user_parts"])) { $_user_parts_ = $context["user_parts"]; } else { $_user_parts_ = null; }
        if (($this->getAttribute($_ticket_perms_, "modify_cc") || twig_length_filter($this->env, $_user_parts_))) {
            // line 178
            echo "\t\t<div
\t\t\tid=\"";
            // line 179
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_cc_list\"
\t\t\tclass=\"cc-row ";
            // line 180
            if (isset($context["user_parts"])) { $_user_parts_ = $context["user_parts"]; } else { $_user_parts_ = null; }
            if (twig_length_filter($this->env, $_user_parts_)) {
                echo "cc-open";
            }
            echo "\"
\t\t\tdata-element-handler=\"DeskPRO.Agent.ElementHandler.TicketCcManage\"
\t\t\tdata-add-url=\"";
            // line 182
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticket_addpart", array("ticket_id" => $this->getAttribute($_ticket_, "id"))), "html", null, true);
            echo "\"
\t\t\tdata-delete-url=\"";
            // line 183
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticket_delpart", array("ticket_id" => $this->getAttribute($_ticket_, "id"))), "html", null, true);
            echo "\"
\t\t\tdata-replybox-container=\"#";
            // line 184
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_replybox_wrap\"
\t\t\t";
            // line 185
            if (isset($context["user_parts"])) { $_user_parts_ = $context["user_parts"]; } else { $_user_parts_ = null; }
            if ((!twig_length_filter($this->env, $_user_parts_))) {
                echo "style=\"display: none;\"";
            }
            // line 186
            echo "\t\t>
\t\t\t<ul class=\"cc-row-list\" id=\"";
            // line 187
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_cc_row_list\">
\t\t\t\t";
            // line 188
            if (isset($context["user_parts"])) { $_user_parts_ = $context["user_parts"]; } else { $_user_parts_ = null; }
            $context['_parent'] = (array) $context;
            $context['_seq'] = twig_ensure_traversable($_user_parts_);
            $context['loop'] = array(
              'parent' => $context['_parent'],
              'index0' => 0,
              'index'  => 1,
              'first'  => true,
            );
            if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
                $length = count($context['_seq']);
                $context['loop']['revindex0'] = $length - 1;
                $context['loop']['revindex'] = $length;
                $context['loop']['length'] = $length;
                $context['loop']['last'] = 1 === $length;
            }
            foreach ($context['_seq'] as $context["_key"] => $context["part"]) {
                // line 189
                echo "\t\t\t\t\t";
                if (isset($context["loop"])) { $_loop_ = $context["loop"]; } else { $_loop_ = null; }
                if (($this->getAttribute($_loop_, "index0") < 2)) {
                    // line 190
                    echo "\t\t\t\t\t\t";
                    if (isset($context["part"])) { $_part_ = $context["part"]; } else { $_part_ = null; }
                    if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
                    $this->env->loadTemplate("AgentBundle:Ticket:view-user-cc-row.html.twig")->display(array_merge($context, array("person" => $this->getAttribute($_part_, "person"), "ticket_perms" => $_ticket_perms_, "preload" => true)));
                    // line 191
                    echo "\t\t\t\t\t";
                } else {
                    // line 192
                    echo "\t\t\t\t\t\t";
                    if (isset($context["part"])) { $_part_ = $context["part"]; } else { $_part_ = null; }
                    if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
                    $this->env->loadTemplate("AgentBundle:Ticket:view-user-cc-row.html.twig")->display(array_merge($context, array("person" => $this->getAttribute($_part_, "person"), "ticket_perms" => $_ticket_perms_)));
                    // line 193
                    echo "\t\t\t\t\t";
                }
                // line 194
                echo "\t\t\t\t";
                ++$context['loop']['index0'];
                ++$context['loop']['index'];
                $context['loop']['first'] = false;
                if (isset($context['loop']['length'])) {
                    --$context['loop']['revindex0'];
                    --$context['loop']['revindex'];
                    $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                }
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['part'], $context['_parent'], $context['loop']);
            $context = array_merge($_parent, array_intersect_key($context, $_parent));
            // line 195
            echo "\t\t\t</ul>
\t\t\t<div class=\"cc-btn-holder\">
\t\t\t\t";
            // line 197
            if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
            if (isset($context["user_parts"])) { $_user_parts_ = $context["user_parts"]; } else { $_user_parts_ = null; }
            if (($this->getAttribute($_ticket_perms_, "modify_cc") && twig_length_filter($this->env, $_user_parts_))) {
                // line 198
                echo "\t\t\t\t\t<a class=\"cc-btn cc-btn-main\" id=\"";
                if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
                echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
                echo "_cc_list_btn\"><i class=\"icon-envelope\"></i> <em>";
                echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.add_cc");
                echo "</em></a>
\t\t\t\t";
            }
            // line 200
            echo "\t\t\t</div>

\t\t\t";
            // line 202
            if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
            if ($this->getAttribute($_ticket_perms_, "modify_cc")) {
                // line 203
                echo "\t\t\t\t<div class=\"cc-autocomplete addrow noedit-hide\" style=\"display: none; clear:left;\">
\t\t\t\t\t<input type=\"text\" class=\"user-part cc-people-search-trigger\" placeholder=\"";
                // line 204
                echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.choose_a_person");
                echo "\" />
\t\t\t\t\t<div class=\"person-search-box\" style=\"display: none\">
\t\t\t\t\t\t<section>
\t\t\t\t\t\t\t<ul class=\"results-list\">
\t\t\t\t\t\t\t</ul>
\t\t\t\t\t\t</section>
\t\t\t\t\t</div>
\t\t\t\t\t<span class=\"is-not-loading\">
\t\t\t\t\t\t<button class=\"clean-white small cc-saverow-trigger\">";
                // line 212
                echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.add");
                echo "</button>
\t\t\t\t\t</span>
\t\t\t\t\t<span class=\"is-loading\">";
                // line 214
                echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.saving");
                echo "</span>
\t\t\t\t</div>
\t\t\t";
            }
            // line 217
            echo "\t\t\t<div style=\"clear:left;\"></div>
\t\t\t<script type=\"text/x-deskpro-tmpl\" class=\"user-row-tpl\">
\t\t\t\t<li>
\t\t\t\t\t<a>
\t\t\t\t\t<span class=\"user-name\"></span>
\t\t\t\t\t<address>&lt;<span class=\"user-email\"></span>&gt;</address>
\t\t\t\t\t<div class=\"bound-fade\"></div>
\t\t\t\t</a></li>
\t\t\t</script>
\t\t</div>
\t\t";
        }
        // line 228
        echo "\t</div>
\t<div class=\"margin\"></div>
</header>

<nav class=\"header-nav\">
\t<ul>
\t\t<li title=\"";
        // line 234
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.department");
        echo "\">
\t\t\t";
        // line 235
        if (isset($context["blank_option"])) { $_blank_option_ = $context["blank_option"]; } else { $_blank_option_ = null; }
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        $this->env->loadTemplate("AgentBundle:Common:select-department.html.twig")->display(array_merge($context, array("name" => "department_id", "with_blank" => $_blank_option_, "blank_title" => $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.none"), "selected" => (($this->getAttribute($this->getAttribute($_ticket_, "department", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "department", array(), "any", false, true), "id"), 0)) : (0)), "id" => ($_baseId_ . "_department_id"), "add_attr" => "data-invisible-trigger=\"1\" style=\"visibility: hidden\" data-dropdown-css-class=\"ticket-header\"", "departments" => $this->getAttribute($this->getAttribute($_app_, "departments"), "getPersonDepartments", array(0 => $this->getAttribute($_app_, "user"), 1 => "tickets", 2 => array(0 => (($this->getAttribute($this->getAttribute($_ticket_, "department", array(), "any", false, true), "id", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "department", array(), "any", false, true), "id"), 0)) : (0))), 3 => "assign"), "method"))));
        // line 244
        echo "
\t\t\t<span id=\"";
        // line 245
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_department_txt\">";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($_ticket_, "department", array(), "any", false, true), "full_title", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($_ticket_, "department", array(), "any", false, true), "full_title"), $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.none"))) : ($this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.none"))), "html", null, true);
        echo "</span>

\t\t\t<span class=\"dp-caret\"></span>
\t\t</li>
\t\t<li title=\"";
        // line 249
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.status");
        echo "\">
\t\t\t<select name=\"status_code\" class=\"status_code\" id=\"";
        // line 250
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_status_code\" data-invisible-trigger=\"1\" style=\"display: none\" data-dropdown-css-class=\"ticket-header\" data-dropdown-nosearch=\"1\">
\t\t\t\t";
        // line 251
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_, "status") == "hidden")) {
            // line 252
            echo "\t\t\t\t\t<option value=\"\" selected=\"selected\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.hidden");
            echo "</option>
\t\t\t\t";
        }
        // line 254
        echo "\t\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ((($this->getAttribute($_ticket_, "status_code") == "awaiting_user") || $this->getAttribute($_ticket_perms_, "modify_set_awaiting_agent"))) {
            // line 255
            echo "\t\t\t\t\t<option value=\"awaiting_agent\" ";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (($this->getAttribute($_ticket_, "status_code") == "awaiting_agent")) {
                echo "selected=\"selected\"";
            }
            echo ">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.status_awaiting_agent");
            echo "</option>
\t\t\t\t";
        }
        // line 257
        echo "\t\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ((($this->getAttribute($_ticket_, "status_code") == "awaiting_user") || $this->getAttribute($_ticket_perms_, "modify_set_awaiting_user"))) {
            // line 258
            echo "\t\t\t\t\t<option value=\"awaiting_user\" ";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (($this->getAttribute($_ticket_, "status_code") == "awaiting_user")) {
                echo "selected=\"selected\"";
            }
            echo ">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.status_awaiting_user");
            echo "</option>
\t\t\t\t";
        }
        // line 260
        echo "\t\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ((($this->getAttribute($_ticket_, "status_code") == "resolved") || $this->getAttribute($_ticket_perms_, "modify_set_resolved"))) {
            // line 261
            echo "\t\t\t\t\t<option value=\"resolved\" ";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (($this->getAttribute($_ticket_, "status_code") == "resolved")) {
                echo "selected=\"selected\"";
            }
            echo ">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.status_resolved");
            echo "</option>
\t\t\t\t";
        }
        // line 263
        echo "\t\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_, "status_code") == "closed")) {
            // line 264
            echo "\t\t\t\t\t<option value=\"closed\" ";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (($this->getAttribute($_ticket_, "status_code") == "closed")) {
                echo "selected=\"selected\"";
            }
            echo ">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.status_closed");
            echo "</option>
\t\t\t\t";
        }
        // line 266
        echo "\t\t\t</select>

\t\t\t<span id=\"";
        // line 268
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_status_txt\" class=\"urgency-text\">
\t\t\t\t";
        // line 269
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, ("agent.tickets.status_" . strtr($this->getAttribute($_ticket_, "status_code"), array("." => "_"))));
        echo "
\t\t\t</span>

\t\t\t<span class=\"dp-caret\"></span>
\t\t</li>
\t\t<li title=\"";
        // line 274
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.urgency");
        echo "\" class=\"urgency-item\">
\t\t\t<select name=\"urgency\" class=\"urgency\" data-style-type=\"urgency\" id=\"";
        // line 275
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_urgency\" style=\"display: none\" data-invisible-trigger=\"1\" data-dropdown-css-class=\"ticket-header\" data-dropdown-nosearch=\"1\">
\t\t\t\t";
        // line 276
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable(range(1, 10));
        foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
            // line 277
            echo "\t\t\t\t\t<option value=\"";
            if (isset($context["i"])) { $_i_ = $context["i"]; } else { $_i_ = null; }
            echo twig_escape_filter($this->env, $_i_, "html", null, true);
            echo "\" ";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (isset($context["i"])) { $_i_ = $context["i"]; } else { $_i_ = null; }
            if (($this->getAttribute($_ticket_, "urgency") == $_i_)) {
                echo "selected=\"selected\"";
            }
            echo ">";
            if (isset($context["i"])) { $_i_ = $context["i"]; } else { $_i_ = null; }
            echo twig_escape_filter($this->env, $_i_, "html", null, true);
            echo "</option>
\t\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 279
        echo "\t\t\t</select>

\t\t\t<span id=\"";
        // line 281
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_urgency_txt\" class=\"urgency-value-";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "urgency"), "html", null, true);
        echo "\">";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "urgency"), "html", null, true);
        echo "</span>

\t\t\t<span class=\"dp-caret\"></span>
\t\t</li>
\t\t<li>
\t\t\t<input type=\"hidden\" id=\"";
        // line 286
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_flag_old\" value=\"";
        if (isset($context["ticket_flagged"])) { $_ticket_flagged_ = $context["ticket_flagged"]; } else { $_ticket_flagged_ = null; }
        echo twig_escape_filter($this->env, $_ticket_flagged_, "html", null, true);
        echo "\" />
\t\t\t<select name=\"flag\" class=\"flag\" id=\"";
        // line 287
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_flag\" class=\"dpe_select\" data-style-type=\"icons\" data-invisible-trigger=\"1\" data-dropdown-css-class=\"ticket-header\" data-dropdown-nosearch=\"1\">
\t\t\t\t<option
\t\t\t\t\tvalue=\"\"
\t\t\t\t\tdata-icon=\"";
        // line 290
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("images/agent/icons/flag-gray.png"), "html", null, true);
        echo "\"
\t\t\t\t>";
        // line 291
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.none");
        echo "</option>
\t\t\t\t";
        // line 292
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable(array(0 => "blue", 1 => "green", 2 => "orange", 3 => "pink", 4 => "purple", 5 => "red", 6 => "yellow"));
        foreach ($context['_seq'] as $context["_key"] => $context["color"]) {
            // line 293
            echo "\t\t\t\t\t<option
\t\t\t\t\t\tvalue=\"";
            // line 294
            if (isset($context["color"])) { $_color_ = $context["color"]; } else { $_color_ = null; }
            echo twig_escape_filter($this->env, $_color_, "html", null, true);
            echo "\"
\t\t\t\t\t\t";
            // line 295
            if (isset($context["ticket_flagged"])) { $_ticket_flagged_ = $context["ticket_flagged"]; } else { $_ticket_flagged_ = null; }
            if (isset($context["color"])) { $_color_ = $context["color"]; } else { $_color_ = null; }
            if (($_ticket_flagged_ == $_color_)) {
                echo "selected=\"selected\"";
            }
            // line 296
            echo "\t\t\t\t\t\tdata-icon=\"";
            if (isset($context["color"])) { $_color_ = $context["color"]; } else { $_color_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl((("images/agent/icons/flag-" . $_color_) . ".png")), "html", null, true);
            echo "\"
\t\t\t\t\t>";
            // line 297
            if (isset($context["flag"])) { $_flag_ = $context["flag"]; } else { $_flag_ = null; }
            if (isset($context["color"])) { $_color_ = $context["color"]; } else { $_color_ = null; }
            echo $_flag_->getflag_name($_color_);
            echo "</option>
\t\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['color'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 299
        echo "\t\t\t</select>

\t\t\t<i id=\"";
        // line 301
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_flagicon\" class=\"icon-flag flag-color-";
        if (isset($context["ticket_flagged"])) { $_ticket_flagged_ = $context["ticket_flagged"]; } else { $_ticket_flagged_ = null; }
        echo twig_escape_filter($this->env, ((array_key_exists("ticket_flagged", $context)) ? (_twig_default_filter($_ticket_flagged_, "none")) : ("none")), "html", null, true);
        echo "\" style=\"margin:0; padding: 0;\"></i>
\t\t\t<span id=\"";
        // line 302
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_flagtext\">";
        if (isset($context["ticket_flagged"])) { $_ticket_flagged_ = $context["ticket_flagged"]; } else { $_ticket_flagged_ = null; }
        if ($_ticket_flagged_) {
            if (isset($context["flag"])) { $_flag_ = $context["flag"]; } else { $_flag_ = null; }
            if (isset($context["ticket_flagged"])) { $_ticket_flagged_ = $context["ticket_flagged"]; } else { $_ticket_flagged_ = null; }
            echo $_flag_->getflag_name($_ticket_flagged_);
        }
        echo "</span>

\t\t\t<span class=\"dp-caret\"></span>
\t\t</li>
\t</ul>
</nav>

";
        // line 309
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgets($_baseId_, "ticket", "header", "below", $_ticket_api_);
        echo "
";
        // line 310
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgets($_baseId_, "ticket", "properties", "above", $_ticket_api_);
        echo "

<div class=\"header-profile-box\">
<div class=\"profile-box-container\">
\t<header id=\"";
        // line 314
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_properties_header\">
\t\t";
        // line 315
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ($this->getAttribute($_ticket_perms_, "modify_fields")) {
            // line 316
            echo "\t\t\t<div class=\"controls ";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
            if ($this->getAttribute($_ticket_, "isLocked", array(0 => $this->getAttribute($_app_, "user")), "method")) {
                echo "hide-locked";
            }
            echo "\" id=\"";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_field_edit_controls\">
\t\t\t\t<div class=\"is-not-loading\">
\t\t\t\t\t<span class=\"edit-gear\" id=\"";
            // line 318
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_field_edit_start\"></span>
\t\t\t\t\t<button class=\"cancel\" id=\"";
            // line 319
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_field_edit_cancel\" style=\"display: none\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.cancel");
            echo "</button>
\t\t\t\t\t<button class=\"save\" id=\"";
            // line 320
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_field_edit_save\" style=\"display: none\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.save");
            echo "</button>
\t\t\t\t</div>
\t\t\t\t<span class=\"is-loading\">";
            // line 322
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.saving");
            echo "</span>
\t\t\t</div>
\t\t";
        }
        // line 325
        echo "\t\t";
        ob_start();
        // line 326
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable($this->getAttribute($_ticket_, "ticket_slas"));
        foreach ($context['_seq'] as $context["_key"] => $context["ticket_sla"]) {
            echo "<span class=\"sla-pip ";
            if (isset($context["ticket_sla"])) { $_ticket_sla_ = $context["ticket_sla"]; } else { $_ticket_sla_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_ticket_sla_, "sla_status"), "html", null, true);
            echo "\" data-sla-id=\"";
            if (isset($context["ticket_sla"])) { $_ticket_sla_ = $context["ticket_sla"]; } else { $_ticket_sla_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_ticket_sla_, "sla_id"), "html", null, true);
            echo "\"></span>";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ticket_sla'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 327
        echo "\t\t";
        $context["sla_pips"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
        // line 328
        echo "\t\t";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["linked_tickets"])) { $_linked_tickets_ = $context["linked_tickets"]; } else { $_linked_tickets_ = null; }
        if (isset($context["tasks"])) { $_tasks_ = $context["tasks"]; } else { $_tasks_ = null; }
        if (isset($context["addable_slas"])) { $_addable_slas_ = $context["addable_slas"]; } else { $_addable_slas_ = null; }
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["sla_pips"])) { $_sla_pips_ = $context["sla_pips"]; } else { $_sla_pips_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgetTabsHeader($_baseId_, "ticket", "properties", array(($_baseId_ . "_fields_display_main_wrap") => $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.properties"), ($_baseId_ . "_linked_wrap") => (((((((("<i class=\"icon-link\"></i> " . $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.linked_tickets")) . " (<span id=\"") . $_baseId_) . "_linked_count\" data-count=\"") . $this->getAttribute($_linked_tickets_, "count")) . "\">") . $this->getAttribute($_linked_tickets_, "count")) . "</span>)"), ($_baseId_ . "_tasks_wrap") => ((((($this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.tasks") . " (<span id=\"") . $_baseId_) . "_task_count\">") . twig_length_filter($this->env, $_tasks_)) . "</span>)"), ($_baseId_ . "_sla_wrap") => (((((!twig_test_empty($_addable_slas_)) && $this->getAttribute($_ticket_perms_, "modify_slas")) || (!twig_test_empty($this->getAttribute($_ticket_, "ticket_slas"))))) ? ((($this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.slas") . " ") . $_sla_pips_)) : (false)), ($_baseId_ . "_billing_wrap") => (($this->getAttribute($_app_, "getSetting", array(0 => "core_tickets.enable_billing"), "method")) ? ($this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.billing")) : (false))));
        // line 334
        echo "
\t</header>
\t<section class=\"description-area\" style=\"padding:0\">
\t\t<div class=\"error-list ";
        // line 337
        if (isset($context["validator_errors"])) { $_validator_errors_ = $context["validator_errors"]; } else { $_validator_errors_ = null; }
        if ($_validator_errors_) {
            echo "on";
        }
        echo "\" id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_field_errors\" ";
        if (isset($context["validator_errors"])) { $_validator_errors_ = $context["validator_errors"]; } else { $_validator_errors_ = null; }
        if ((!$_validator_errors_)) {
            echo "style=\"display:none\"";
        }
        echo ">
\t\t\t<span class=\"title\">";
        // line 338
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.save_errors");
        echo ":</span>
\t\t\t<ul>
\t\t\t\t";
        // line 340
        if (isset($context["validator_errors"])) { $_validator_errors_ = $context["validator_errors"]; } else { $_validator_errors_ = null; }
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable($_validator_errors_);
        foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
            // line 341
            echo "\t\t\t\t\t<li>";
            if (isset($context["i"])) { $_i_ = $context["i"]; } else { $_i_ = null; }
            echo twig_escape_filter($this->env, $_i_, "html", null, true);
            echo "</li>
\t\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 343
        echo "\t\t\t</ul>
\t\t</div>
\t\t<article id=\"";
        // line 345
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_fields_display_main_wrap\" class=\"headerbox\" style=\"position: relative;\">
\t\t\t";
        // line 346
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($_ticket_, "isLocked", array(0 => $this->getAttribute($_app_, "user")), "method")) {
            echo "<div class=\"lock-overlay\"></div>";
        }
        // line 347
        echo "\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td style=\"padding-right: 5px;\">
\t\t\t\t\t<label class=\"field-label-title\">";
        // line 348
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.agent");
        echo "</label>
\t\t\t\t\t<select id=\"";
        // line 349
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_agent_sel\" class=\"dpe_select\" data-style-type=\"icons\" data-select-icon-size=\"22\">
\t\t\t\t\t\t";
        // line 350
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_perms_, "modify_assign_agent") || (!$this->getAttribute($_ticket_, "agent")))) {
            echo "<option ";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if ((!$this->getAttribute($this->getAttribute($_ticket_, "agent"), "id"))) {
                echo "selected=\"selected\"";
            }
            echo " value=\"0\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.unassigned");
            echo "</option>";
        }
        // line 351
        echo "\t\t\t\t\t\t";
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if (($this->getAttribute($_ticket_perms_, "modify_assign_self") || ($this->getAttribute($this->getAttribute($_ticket_, "agent"), "id") == $this->getAttribute($this->getAttribute($_app_, "user"), "id")))) {
            // line 352
            echo "\t\t\t\t\t\t\t<option ";
            if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (($this->getAttribute($this->getAttribute($_app_, "user"), "id") == $this->getAttribute($this->getAttribute($_ticket_, "agent"), "id"))) {
                echo "selected=\"selected\"";
            }
            echo " data-icon=\"";
            if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_app_, "user"), "getPictureUrl", array(0 => 20), "method"), "html", null, true);
            echo "\" value=\"";
            if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_app_, "user"), "id"), "html", null, true);
            echo "\">";
            if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_app_, "user"), "display_name"), "html", null, true);
            echo "</option>
\t\t\t\t\t\t";
        }
        // line 354
        echo "\t\t\t\t\t\t";
        if (isset($context["agents"])) { $_agents_ = $context["agents"]; } else { $_agents_ = null; }
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable($_agents_);
        foreach ($context['_seq'] as $context["_key"] => $context["agent"]) {
            // line 355
            echo "\t\t\t\t\t\t\t";
            if (isset($context["agent"])) { $_agent_ = $context["agent"]; } else { $_agent_ = null; }
            if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
            if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if ((($this->getAttribute($_agent_, "id") != $this->getAttribute($this->getAttribute($_app_, "user"), "id")) && ($this->getAttribute($_ticket_perms_, "modify_assign_agent") || ($this->getAttribute($this->getAttribute($_ticket_, "agent"), "id") == $this->getAttribute($_agent_, "id"))))) {
                // line 356
                echo "\t\t\t\t\t\t\t\t<option ";
                if (isset($context["agent"])) { $_agent_ = $context["agent"]; } else { $_agent_ = null; }
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                if (($this->getAttribute($_agent_, "id") == $this->getAttribute($this->getAttribute($_ticket_, "agent"), "id"))) {
                    echo "selected=\"selected\"";
                }
                echo " data-icon=\"";
                if (isset($context["agent"])) { $_agent_ = $context["agent"]; } else { $_agent_ = null; }
                echo twig_escape_filter($this->env, $this->getAttribute($_agent_, "getPictureUrl", array(0 => 20), "method"), "html", null, true);
                echo "\" value=\"";
                if (isset($context["agent"])) { $_agent_ = $context["agent"]; } else { $_agent_ = null; }
                echo twig_escape_filter($this->env, $this->getAttribute($_agent_, "id"), "html", null, true);
                echo "\">";
                if (isset($context["agent"])) { $_agent_ = $context["agent"]; } else { $_agent_ = null; }
                echo twig_escape_filter($this->env, $this->getAttribute($_agent_, "display_name"), "html", null, true);
                echo "</option>
\t\t\t\t\t\t\t";
            }
            // line 358
            echo "\t\t\t\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['agent'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 359
        echo "\t\t\t\t\t</select>
\t\t\t</td>
\t\t\t";
        // line 361
        if (isset($context["agent_teams"])) { $_agent_teams_ = $context["agent_teams"]; } else { $_agent_teams_ = null; }
        if (twig_length_filter($this->env, $_agent_teams_)) {
            // line 362
            echo "\t\t\t\t<td style=\"padding-right: 5px;\">
\t\t\t\t\t<label class=\"field-label-title\">";
            // line 363
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.team");
            echo "</label>
\t\t\t\t\t<select id=\"";
            // line 364
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_agent_team_sel\" class=\"dpe_select\" data-select-nogrouptitle=\"1\">
\t\t\t\t\t\t";
            // line 365
            if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (($this->getAttribute($_ticket_perms_, "modify_assign_team") || (!$this->getAttribute($_ticket_, "agent_team")))) {
                // line 366
                echo "\t\t\t\t\t\t\t<option value=\"0\" ";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                if ((!$this->getAttribute($_ticket_, "agent_team"))) {
                    echo "selected=\"selected\"";
                }
                echo ">";
                echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.none");
                echo "</option>
\t\t\t\t\t\t";
            }
            // line 368
            echo "
\t\t\t\t\t\t";
            // line 369
            if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
            if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (isset($context["team"])) { $_team_ = $context["team"]; } else { $_team_ = null; }
            if ((twig_length_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($_app_, "user"), "getAgent", array(), "method"), "getTeams", array(), "method")) && ($this->getAttribute($_ticket_perms_, "modify_assign_self") || ($this->getAttribute($this->getAttribute($_ticket_, "agent_team"), "id") == $this->getAttribute($_team_, "id"))))) {
                // line 370
                echo "\t\t\t\t\t\t<optgroup label=\"";
                echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.your_teams");
                echo "\">
\t\t\t\t\t\t\t";
                // line 371
                if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
                $context['_parent'] = (array) $context;
                $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($this->getAttribute($_app_, "user"), "getAgent", array(), "method"), "getTeams", array(), "method"));
                foreach ($context['_seq'] as $context["_key"] => $context["team"]) {
                    // line 372
                    echo "\t\t\t\t\t\t\t\t<option value=\"";
                    if (isset($context["team"])) { $_team_ = $context["team"]; } else { $_team_ = null; }
                    echo twig_escape_filter($this->env, $this->getAttribute($_team_, "id"), "html", null, true);
                    echo "\" ";
                    if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                    if (isset($context["team"])) { $_team_ = $context["team"]; } else { $_team_ = null; }
                    if (($this->getAttribute($this->getAttribute($_ticket_, "agent_team"), "id") == $this->getAttribute($_team_, "id"))) {
                        echo "selected=\"selected\"";
                    }
                    echo ">";
                    if (isset($context["team"])) { $_team_ = $context["team"]; } else { $_team_ = null; }
                    echo twig_escape_filter($this->env, $this->getAttribute($_team_, "name"), "html", null, true);
                    echo "</option>
\t\t\t\t\t\t\t";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['team'], $context['_parent'], $context['loop']);
                $context = array_merge($_parent, array_intersect_key($context, $_parent));
                // line 374
                echo "\t\t\t\t\t\t</optgroup>
\t\t\t\t\t\t";
            }
            // line 376
            echo "
\t\t\t\t\t\t";
            // line 377
            if (isset($context["agent_teams"])) { $_agent_teams_ = $context["agent_teams"]; } else { $_agent_teams_ = null; }
            $context['_parent'] = (array) $context;
            $context['_seq'] = twig_ensure_traversable($_agent_teams_);
            foreach ($context['_seq'] as $context["_key"] => $context["team"]) {
                // line 378
                echo "\t\t\t\t\t\t\t";
                if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                if (isset($context["team"])) { $_team_ = $context["team"]; } else { $_team_ = null; }
                if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
                if ((($this->getAttribute($_ticket_perms_, "modify_assign_team") || ($this->getAttribute($this->getAttribute($_ticket_, "agent_team"), "id") == $this->getAttribute($_team_, "id"))) && !twig_in_filter($this->getAttribute($_team_, "id"), $this->getAttribute($this->getAttribute($this->getAttribute($_app_, "user"), "getAgent", array(), "method"), "getTeamIds", array(), "method")))) {
                    // line 379
                    echo "\t\t\t\t\t\t\t\t<option value=\"";
                    if (isset($context["team"])) { $_team_ = $context["team"]; } else { $_team_ = null; }
                    echo twig_escape_filter($this->env, $this->getAttribute($_team_, "id"), "html", null, true);
                    echo "\" ";
                    if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                    if (isset($context["team"])) { $_team_ = $context["team"]; } else { $_team_ = null; }
                    if (($this->getAttribute($this->getAttribute($_ticket_, "agent_team"), "id") == $this->getAttribute($_team_, "id"))) {
                        echo "selected=\"selected\"";
                    }
                    echo ">";
                    if (isset($context["team"])) { $_team_ = $context["team"]; } else { $_team_ = null; }
                    echo twig_escape_filter($this->env, $this->getAttribute($_team_, "name"), "html", null, true);
                    echo "</option>
\t\t\t\t\t\t\t";
                }
                // line 381
                echo "\t\t\t\t\t\t";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['team'], $context['_parent'], $context['loop']);
            $context = array_merge($_parent, array_intersect_key($context, $_parent));
            // line 382
            echo "\t\t\t\t\t</select>
\t\t\t\t</td>
\t\t\t";
        }
        // line 385
        echo "\t\t\t<td width=\"100%\">
\t\t\t\t<label class=\"field-label-title\">";
        // line 386
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.followers");
        echo "</label>
\t\t\t\t<div class=\"followers-list\">
\t\t\t\t\t<ul id=\"";
        // line 388
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_followers_list\">
\t\t\t\t\t\t";
        // line 389
        if (isset($context["agent_parts"])) { $_agent_parts_ = $context["agent_parts"]; } else { $_agent_parts_ = null; }
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable($_agent_parts_);
        foreach ($context['_seq'] as $context["_key"] => $context["a"]) {
            // line 390
            echo "\t\t\t\t\t\t\t<li class=\"agent-";
            if (isset($context["a"])) { $_a_ = $context["a"]; } else { $_a_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_a_, "person"), "id"), "html", null, true);
            echo "\" data-agent-id=\"";
            if (isset($context["a"])) { $_a_ = $context["a"]; } else { $_a_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_a_, "person"), "id"), "html", null, true);
            echo "\"><a class=\"dp-btn dp-btn-small agent-link\" data-agent-id=\"";
            if (isset($context["a"])) { $_a_ = $context["a"]; } else { $_a_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_a_, "person"), "id"), "html", null, true);
            echo "\"><span class=\"text\" style=\"background-image: url(";
            if (isset($context["a"])) { $_a_ = $context["a"]; } else { $_a_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_a_, "person"), "getPictureUrl", array(0 => 15), "method"), "html", null, true);
            echo ")\">";
            if (isset($context["a"])) { $_a_ = $context["a"]; } else { $_a_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_a_, "person"), "display_name"), "html", null, true);
            echo "</span><span class=\"remove-row-trigger\"> <i class=\"icon-remove\"></i></span></a></li>
\t\t\t\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['a'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 392
        echo "\t\t\t\t\t</ul>
\t\t\t\t\t<div class=\"new-follower\" id=\"";
        // line 393
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_followers_sel_wrap\">
\t\t\t\t\t\t<select id=\"";
        // line 394
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_followers_sel\" class=\"dpe_select\" data-style-type=\"icons\" data-select-icon-size=\"22\">
\t\t\t\t\t\t\t<option value=\"0\">";
        // line 395
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.select_agent");
        echo "</option>
\t\t\t\t\t\t\t";
        // line 396
        if (isset($context["agents"])) { $_agents_ = $context["agents"]; } else { $_agents_ = null; }
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable($_agents_);
        foreach ($context['_seq'] as $context["_key"] => $context["agent"]) {
            // line 397
            echo "\t\t\t\t\t\t\t\t<option data-icon=\"";
            if (isset($context["agent"])) { $_agent_ = $context["agent"]; } else { $_agent_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_agent_, "getPictureUrl", array(0 => 20), "method"), "html", null, true);
            echo "\" value=\"";
            if (isset($context["agent"])) { $_agent_ = $context["agent"]; } else { $_agent_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_agent_, "id"), "html", null, true);
            echo "\" data-icon-small=\"";
            if (isset($context["agent"])) { $_agent_ = $context["agent"]; } else { $_agent_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_agent_, "getPictureUrl", array(0 => 15), "method"), "html", null, true);
            echo "\">";
            if (isset($context["agent"])) { $_agent_ = $context["agent"]; } else { $_agent_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_agent_, "display_name"), "html", null, true);
            echo "</option>
\t\t\t\t\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['agent'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 399
        echo "\t\t\t\t\t\t</select>
\t\t\t\t\t</div>
\t\t\t\t\t<a class=\"new-follower-btn\" id=\"";
        // line 401
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_add_follower_btn\">
\t\t\t\t\t\t<i class=\"icon-signin\"></i>
\t\t\t\t\t\t";
        // line 403
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.add_follower");
        echo "
\t\t\t\t\t</a>
\t\t\t\t</div>
\t\t\t</td></tr></table>
\t\t\t<div class=\"sep\">-</div>
\t\t\t<div id=\"";
        // line 408
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_field_holders\">
\t\t\t\t<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" class=\"field-holders-table\">
\t\t\t\t\t";
        // line 410
        $this->env->loadTemplate("AgentBundle:Ticket:view-page-display-holders.html.twig")->display($context);
        // line 411
        echo "\t\t\t\t\t";
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_perms_, "modify_labels") || twig_length_filter($this->env, $this->getAttribute($_ticket_, "labels")))) {
            // line 412
            echo "\t\t\t\t\t\t<tbody class=\"always-bottom\">
\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t<th width=\"80\" style=\"vertical-align: middle; border-bottom: none; padding-top: 0; padding-bottom: 0;\">";
            // line 414
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.labels");
            echo ":</th>
\t\t\t\t\t\t\t\t<td style=\"vertical-align: middle; border-bottom: none; padding-top: 0; padding-bottom: 0; padding-right: 0;\">
\t\t\t\t\t\t\t\t\t<div style=\"width: 98%\" id=\"";
            // line 416
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_labels_wrap\">
\t\t\t\t\t\t\t\t\t\t<input
\t\t\t\t\t\t\t\t\t\t\ttype=\"hidden\"
\t\t\t\t\t\t\t\t\t\t\tid=\"";
            // line 419
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_labels_input\"
\t\t\t\t\t\t\t\t\t\t\tclass=\"dpe_select dpe_select_noborder\"
\t\t\t\t\t\t\t\t\t\t\tdata-placeholder=\"Add a label\"
\t\t\t\t\t\t\t\t\t\t\tvalue=\"";
            // line 422
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            $context['_parent'] = (array) $context;
            $context['_seq'] = twig_ensure_traversable($this->getAttribute($_ticket_, "labels"));
            foreach ($context['_seq'] as $context["_key"] => $context["label"]) {
                if (isset($context["label"])) { $_label_ = $context["label"]; } else { $_label_ = null; }
                echo twig_escape_filter($this->env, $this->getAttribute($_label_, "label"), "html", null, true);
                echo ",";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['label'], $context['_parent'], $context['loop']);
            $context = array_merge($_parent, array_intersect_key($context, $_parent));
            echo "\"
\t\t\t\t\t\t\t\t\t\t/>
\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t</td>
\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t</tbody>
\t\t\t\t\t";
        }
        // line 429
        echo "\t\t\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ((($this->getAttribute($_ticket_, "linked_chat") && $this->getAttribute($_app_, "getSetting", array(0 => "core.apps_chat"), "method")) && $this->getAttribute($this->getAttribute($_app_, "user"), "hasPerm", array(0 => "agent_chat.use"), "method"))) {
            // line 430
            echo "\t\t\t\t\t\t<tbody>
\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t<th>
\t\t\t\t\t\t\t\t\t";
            // line 433
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.linked_chat");
            echo "
\t\t\t\t\t\t\t\t</th>
\t\t\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t\t\t<a data-route=\"page:";
            // line 436
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_userchat_view", array("conversation_id" => $this->getAttribute($this->getAttribute($_ticket_, "linked_chat"), "id"))), "html", null, true);
            echo "\">";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($_ticket_, "linked_chat"), "getSubjectLine", array(), "method"), "html", null, true);
            echo "</a>
\t\t\t\t\t\t\t\t</td>
\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t</tbody>
\t\t\t\t\t";
        }
        // line 441
        echo "\t\t\t\t</table>
\t\t\t</div>
\t\t</article>
\t\t<article id=\"";
        // line 444
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_linked_wrap\">
\t\t\t";
        // line 445
        $this->env->loadTemplate("AgentBundle:Ticket:linked-tickets.html.twig")->display($context);
        // line 446
        echo "\t\t</article>
\t\t<article id=\"";
        // line 447
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_tasks_wrap\">
\t\t\t";
        // line 448
        $this->env->loadTemplate("AgentBundle:Ticket:view-tasks.html.twig")->display($context);
        // line 449
        echo "\t\t</article>
\t\t";
        // line 450
        if (isset($context["addable_slas"])) { $_addable_slas_ = $context["addable_slas"]; } else { $_addable_slas_ = null; }
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ((((!twig_test_empty($_addable_slas_)) && $this->getAttribute($_ticket_perms_, "modify_slas")) || (!twig_test_empty($this->getAttribute($_ticket_, "ticket_slas"))))) {
            // line 451
            echo "\t\t\t<article id=\"";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_sla_wrap\">
\t\t\t\t";
            // line 452
            $this->env->loadTemplate("AgentBundle:Ticket:view-slas.html.twig")->display($context);
            // line 453
            echo "\t\t\t</article>
\t\t";
        }
        // line 455
        echo "\t\t";
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($_app_, "getSetting", array(0 => "core_tickets.enable_billing"), "method")) {
            // line 456
            echo "\t\t\t<article id=\"";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_billing_wrap\">
\t\t\t\t";
            // line 457
            $this->env->loadTemplate("AgentBundle:Ticket:view-billing.html.twig")->display($context);
            // line 458
            echo "\t\t\t</article>
\t\t";
        }
        // line 460
        echo "\t\t";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgetTabsBody($_baseId_, "ticket", "properties", "article", $_ticket_api_);
        echo "
\t</section>
</div>
</div>

<nav class=\"header-nav\">
\t<ul>
\t\t<li id=\"";
        // line 467
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_unlock_ticket\" ";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ((!$this->getAttribute($_ticket_, "hasLock", array(), "method"))) {
            echo "style=\"display: none\"";
        }
        echo ">
\t\t\t<i class=\"icon-unlock\"></i>
\t\t\t";
        // line 469
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.unlock");
        echo "
\t\t</li>
\t\t<li id=\"";
        // line 471
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_lock_ticket\" ";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($_ticket_, "hasLock", array(), "method")) {
            echo "style=\"display: none\"";
        }
        echo ">
\t\t\t<i class=\"icon-lock\"></i>
\t\t\t";
        // line 473
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.lock");
        echo "
\t\t</li>
\t\t";
        // line 475
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ($this->getAttribute($_ticket_perms_, "modify_merge")) {
            // line 476
            echo "\t\t\t<li class=\"merge-menu-trigger noedit-hide\">
\t\t\t\t<i class=\"icon-columns\"></i>
\t\t\t\t";
            // line 478
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.merge");
            echo "
\t\t\t\t<span class=\"dp-caret\"></span>
\t\t\t</li>
\t\t";
        }
        // line 482
        echo "\t\t<li id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_macros_menu_trigger\">
\t\t\t<i class=\"icon-tasks\"></i>
\t\t\t";
        // line 484
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.macros");
        echo "
\t\t\t<span class=\"dp-caret\"></span>
\t\t</li>
\t\t";
        // line 487
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ($this->getAttribute($_ticket_perms_, "delete")) {
            // line 488
            echo "\t\t\t";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if ((!twig_in_filter($this->getAttribute($_ticket_, "hidden_status"), array(0 => "deleted", 1 => "spam")))) {
                // line 489
                echo "\t\t\t\t<li id=\"";
                if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
                echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
                echo "_remove_menu_trigger\">
\t\t\t\t\t<i class=\"icon-trash\"></i>
\t\t\t\t\t";
                // line 491
                echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.remove");
                echo "
\t\t\t\t\t<span class=\"dp-caret\"></span>
\t\t\t\t</li>
\t\t\t";
            }
            // line 495
            echo "\t\t";
        }
        // line 496
        echo "\t\t<li id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_actions_menu_trigger\">
\t\t\t<i class=\"icon-edit\"></i>
\t\t\t";
        // line 498
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.actions");
        echo "
\t\t\t<span class=\"dp-caret\"></span>
\t\t</li>
\t</ul>
</nav>

<ul style=\"display:none\" id=\"";
        // line 504
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_remove_menu\">
\t<li data-action=\"spam\">";
        // line 505
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.set_as_spam");
        echo "</li>
\t<li data-action=\"delete\">";
        // line 506
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.delete_ticket");
        echo "</li>
\t";
        // line 507
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($this->getAttribute($_app_, "user"), "hasPerm", array(0 => "agent_people.delete"), "method")) {
            // line 508
            echo "\t\t";
            if (isset($context["person_object_counts"])) { $_person_object_counts_ = $context["person_object_counts"]; } else { $_person_object_counts_ = null; }
            if ((($this->getAttribute($_person_object_counts_, "tickets") > 1) || ($this->getAttribute($_person_object_counts_, "chats") > 0))) {
                // line 509
                echo "\t\t\t";
                if (isset($context["person_object_counts"])) { $_person_object_counts_ = $context["person_object_counts"]; } else { $_person_object_counts_ = null; }
                if (($this->getAttribute($_person_object_counts_, "tickets") > 1)) {
                    // line 510
                    echo "\t\t\t\t<li data-action=\"delete.ban\">";
                    if (isset($context["person_object_counts"])) { $_person_object_counts_ = $context["person_object_counts"]; } else { $_person_object_counts_ = null; }
                    echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.perm_del_user_and_other_tickets", array("ticket_count" => $this->getAttribute($_person_object_counts_, "tickets")));
                    echo "</li>
\t\t\t";
                } else {
                    // line 512
                    echo "\t\t\t\t<li data-action=\"delete.ban\">";
                    echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.perm_del_user_and_content");
                    echo "</li>
\t\t\t";
                }
                // line 514
                echo "\t\t";
            } else {
                // line 515
                echo "\t\t\t<li data-action=\"delete.ban\">";
                echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.perm_del_user_and_ticket");
                echo "</li>
\t\t";
            }
            // line 517
            echo "\t";
        }
        // line 518
        echo "</ul>

<ul style=\"display:none\" id=\"";
        // line 520
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_actions_menu\">
\t<li data-action=\"change-user\">";
        // line 521
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.change_user_btn");
        echo "</li>
\t<li style=\"";
        // line 522
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($_ticket_, "is_hold")) {
            echo "display: none;";
        }
        echo "\" id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_menu_set_hold\" data-action=\"set-hold\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.hold_btn");
        echo "</li>
\t<li style=\"";
        // line 523
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ((!$this->getAttribute($_ticket_, "is_hold"))) {
            echo "display: none;";
        }
        echo "\" id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_menu_unset_hold\" data-action=\"unset-hold\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.unhold_btn");
        echo "</li>
\t";
        // line 524
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ($this->getAttribute($_ticket_perms_, "modify_merge")) {
            echo "<li data-action=\"split\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.split_messages_into_ticket");
            echo "</li>";
        }
        // line 525
        echo "\t";
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($this->getAttribute($_app_, "user"), "hasPerm", array(0 => "agent_tickets.create"), "method")) {
            echo "<li data-action=\"linked_ticket\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.create_linked_ticket");
            echo "</li>";
        }
        // line 526
        echo "\t<li data-action=\"kb-pending\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.create_new_pending_article");
        echo "</li>
\t<li><a target=\"_blank\" href=\"";
        // line 527
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticket_view", array("ticket_id" => $this->getAttribute($_ticket_, "id"), "view_print" => 1, "_rt" => $this->env->getExtension('deskpro_templating')->securityToken("request_token", 10800))), "html", null, true);
        echo "\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.print");
        echo "</a></li>
\t<li><a target=\"_blank\" href=\"";
        // line 528
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticket_view", array("ticket_id" => $this->getAttribute($_ticket_, "id"), "pdf" => 1, "_rt" => $this->env->getExtension('deskpro_templating')->securityToken("request_token", 10800))), "html", null, true);
        echo "\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.download_pdf");
        echo "</a></li>
</ul>

<div class=\"pagecontent\">

";
        // line 533
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgets($_baseId_, "ticket", "properties", "below", $_ticket_api_);
        echo "
";
        // line 534
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgets($_baseId_, "ticket", "messages", "above", $_ticket_api_);
        echo "

";
        // line 536
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_reverse_order"), "method")) {
            // line 537
            echo "\t";
            if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
            if (($this->getAttribute($_ticket_perms_, "reply") || $this->getAttribute($_ticket_perms_, "modify_notes"))) {
                // line 538
                echo "\t<div style=\"position:relative;\" class=\"ticket_reverse_order\">
\t\t";
                // line 539
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
                if ($this->getAttribute($_ticket_, "isLocked", array(0 => $this->getAttribute($_app_, "user")), "method")) {
                    echo "<div class=\"lock-overlay\"></div>";
                }
                // line 540
                echo "\t\t<div id=\"";
                if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
                echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
                echo "_replybox_wrap\" class=\"replybox-wrap\">
\t\t\t";
                // line 541
                $this->env->loadTemplate("AgentBundle:Ticket:replybox.html.twig")->display($context);
                // line 542
                echo "\t\t</div>
\t</div>
\t";
            }
        }
        // line 546
        echo "
<div class=\"profile-box-container ticket-messages\">
\t<header>
\t\t";
        // line 549
        $context["messageTabs"] = $this->env->getExtension('deskpro_templating')->getWidgetsRaw("ticket", "messages", "tab");
        // line 550
        echo "\t\t<nav id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_messagebox_tabs\" data-element-handler=\"DeskPRO.ElementHandler.SimpleTabs\">
\t\t\t<ul>
\t\t\t\t<li data-list-type=\"messages\" class=\"on\" data-tab-for=\"#";
        // line 552
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_messages_wrap\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.messages");
        echo "</li>
\t\t\t\t<li class=\"logs\" data-list-type=\"log\" data-tab-for=\"#";
        // line 553
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_logs_wrap\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.full_log");
        echo "</li>
\t\t\t\t";
        // line 554
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ((($this->getAttribute($_app_, "getSetting", array(0 => "core.tickets.enable_feedback"), "method") && $this->getAttribute($_app_, "getSetting", array(0 => "core.tickets.feedback_agents_read"), "method")) && $this->getAttribute($_ticket_, "date_feedback_rating"))) {
            // line 555
            echo "\t\t\t\t\t<li data-list-type=\"feedback\" data-tab-for=\"#";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_messages_wrap\">
\t\t\t\t\t\t";
            // line 556
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.ticket_feedback");
            echo " <span class=\"feedback-rating feedback-";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "feedback_rating_type"), "html", null, true);
            echo "\">";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            if (($this->getAttribute($_ticket_, "feedback_rating") == 1)) {
                echo "☺";
            } elseif (($this->getAttribute($_ticket_, "feedback_rating") == (-1))) {
                echo "☹";
            } else {
                echo "&mdash;";
            }
            echo "</span>
\t\t\t\t\t</li>
\t\t\t\t";
        }
        // line 559
        echo "\t\t\t\t<li data-tab-for=\"#";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_times\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.dates_and_times");
        echo "</li>
\t\t\t";
        // line 560
        if (isset($context["messageTabs"])) { $_messageTabs_ = $context["messageTabs"]; } else { $_messageTabs_ = null; }
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable($_messageTabs_);
        foreach ($context['_seq'] as $context["_key"] => $context["widget"]) {
            // line 561
            echo "\t\t\t\t<li data-tab-for=\"#";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            if (isset($context["widget"])) { $_widget_ = $context["widget"]; } else { $_widget_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->getWidgetHtmlId($_baseId_, $_widget_), "html", null, true);
            echo "\">";
            if (isset($context["widget"])) { $_widget_ = $context["widget"]; } else { $_widget_ = null; }
            echo $this->getAttribute($_widget_, "title");
            echo "</li>
\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['widget'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 563
        echo "\t\t\t</ul>
\t\t</nav>
\t</header>
\t<section class=\"messages-wrap\" id=\"";
        // line 566
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_messages_wrap\" data-page=\"";
        if (isset($context["message_page"])) { $_message_page_ = $context["message_page"]; } else { $_message_page_ = null; }
        echo twig_escape_filter($this->env, $_message_page_, "html", null, true);
        echo "\" data-page-count=\"";
        if (isset($context["message_page_count"])) { $_message_page_count_ = $context["message_page_count"]; } else { $_message_page_count_ = null; }
        echo twig_escape_filter($this->env, $_message_page_count_, "html", null, true);
        echo "\">
\t\t<div class=\"message-page-prev\" ";
        // line 567
        if (isset($context["message_page"])) { $_message_page_ = $context["message_page"]; } else { $_message_page_ = null; }
        if (isset($context["message_page_count"])) { $_message_page_count_ = $context["message_page_count"]; } else { $_message_page_count_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ((($_message_page_ == $_message_page_count_) || $this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_reverse_order"), "method"))) {
            echo "style=\"display: none\"";
        }
        echo " id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_message_prev_page\">
\t\t\t<strong>";
        // line 568
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ((!$this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_reverse_order"), "method"))) {
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.view_older_messages");
        } else {
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.view_newer_messages");
        }
        echo "</strong>
\t\t</div>
\t\t";
        // line 570
        if (isset($context["active_drafts"])) { $_active_drafts_ = $context["active_drafts"]; } else { $_active_drafts_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if (($_active_drafts_ && $this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_reverse_order"), "method"))) {
            // line 571
            echo "\t\t\t";
            if (isset($context["active_drafts"])) { $_active_drafts_ = $context["active_drafts"]; } else { $_active_drafts_ = null; }
            $context['_parent'] = (array) $context;
            $context['_seq'] = twig_ensure_traversable($_active_drafts_);
            $context['loop'] = array(
              'parent' => $context['_parent'],
              'index0' => 0,
              'index'  => 1,
              'first'  => true,
            );
            if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
                $length = count($context['_seq']);
                $context['loop']['revindex0'] = $length - 1;
                $context['loop']['revindex'] = $length;
                $context['loop']['length'] = $length;
                $context['loop']['last'] = 1 === $length;
            }
            foreach ($context['_seq'] as $context["_key"] => $context["active_draft"]) {
                // line 572
                echo "\t\t\t\t";
                if (isset($context["active_draft"])) { $_active_draft_ = $context["active_draft"]; } else { $_active_draft_ = null; }
                if ($this->getAttribute($_active_draft_, "message_html")) {
                    // line 573
                    echo "\t\t\t\t\t";
                    if (isset($context["active_draft"])) { $_active_draft_ = $context["active_draft"]; } else { $_active_draft_ = null; }
                    $this->env->loadTemplate("AgentBundle:Ticket:ticket-message-draft.html.twig")->display(array_merge($context, array("draft" => $_active_draft_)));
                    // line 574
                    echo "\t\t\t\t";
                }
                // line 575
                echo "\t\t\t";
                ++$context['loop']['index0'];
                ++$context['loop']['index'];
                $context['loop']['first'] = false;
                if (isset($context['loop']['length'])) {
                    --$context['loop']['revindex0'];
                    --$context['loop']['revindex'];
                    $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                }
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['active_draft'], $context['_parent'], $context['loop']);
            $context = array_merge($_parent, array_intersect_key($context, $_parent));
            // line 576
            echo "\t\t";
        }
        // line 577
        echo "\t\t<div id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_message_page_wrap\">
\t\t\t";
        // line 578
        if (isset($context["ticket_messages_block"])) { $_ticket_messages_block_ = $context["ticket_messages_block"]; } else { $_ticket_messages_block_ = null; }
        echo $_ticket_messages_block_;
        echo "
\t\t</div>
\t\t";
        // line 580
        if (isset($context["active_drafts"])) { $_active_drafts_ = $context["active_drafts"]; } else { $_active_drafts_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if (($_active_drafts_ && (!$this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_reverse_order"), "method")))) {
            // line 581
            echo "\t\t\t";
            if (isset($context["active_drafts"])) { $_active_drafts_ = $context["active_drafts"]; } else { $_active_drafts_ = null; }
            $context['_parent'] = (array) $context;
            $context['_seq'] = twig_ensure_traversable($_active_drafts_);
            $context['loop'] = array(
              'parent' => $context['_parent'],
              'index0' => 0,
              'index'  => 1,
              'first'  => true,
            );
            if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
                $length = count($context['_seq']);
                $context['loop']['revindex0'] = $length - 1;
                $context['loop']['revindex'] = $length;
                $context['loop']['length'] = $length;
                $context['loop']['last'] = 1 === $length;
            }
            foreach ($context['_seq'] as $context["_key"] => $context["active_draft"]) {
                // line 582
                echo "\t\t\t\t";
                if (isset($context["active_draft"])) { $_active_draft_ = $context["active_draft"]; } else { $_active_draft_ = null; }
                if ($this->getAttribute($_active_draft_, "message_html")) {
                    // line 583
                    echo "\t\t\t\t\t";
                    if (isset($context["active_draft"])) { $_active_draft_ = $context["active_draft"]; } else { $_active_draft_ = null; }
                    $this->env->loadTemplate("AgentBundle:Ticket:ticket-message-draft.html.twig")->display(array_merge($context, array("draft" => $_active_draft_)));
                    // line 584
                    echo "\t\t\t\t";
                }
                // line 585
                echo "\t\t\t";
                ++$context['loop']['index0'];
                ++$context['loop']['index'];
                $context['loop']['first'] = false;
                if (isset($context['loop']['length'])) {
                    --$context['loop']['revindex0'];
                    --$context['loop']['revindex'];
                    $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                }
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['active_draft'], $context['_parent'], $context['loop']);
            $context = array_merge($_parent, array_intersect_key($context, $_parent));
            // line 586
            echo "\t\t";
        }
        // line 587
        echo "\t\t<div class=\"message-page-next\" ";
        if (isset($context["message_page"])) { $_message_page_ = $context["message_page"]; } else { $_message_page_ = null; }
        if (isset($context["message_page_count"])) { $_message_page_count_ = $context["message_page_count"]; } else { $_message_page_count_ = null; }
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ((($_message_page_ == $_message_page_count_) || (!$this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_reverse_order"), "method")))) {
            echo "style=\"display: none\"";
        }
        echo " id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_message_next_page\">
\t\t\t<strong>";
        // line 588
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_reverse_order"), "method")) {
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.view_older_messages");
        } else {
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.view_newer_messages");
        }
        echo "</strong>
\t\t</div>
\t</section>
\t<section id=\"";
        // line 591
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_logs_wrap\" style=\"margin: 0;padding: 0;\">
\t\t";
        // line 592
        if (isset($context["logs_block"])) { $_logs_block_ = $context["logs_block"]; } else { $_logs_block_ = null; }
        echo $_logs_block_;
        echo "
\t</section>
\t<section id=\"";
        // line 594
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_times\" style=\"display: none; padding: 0;\">
\t\t<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" class=\"field-holders-table th-ra\">
\t\t\t<tbody><tr>
\t\t\t\t<th width=\"200\">";
        // line 597
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.created");
        echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t<time class=\"timeago\" datetime=\"";
        // line 599
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_created"), "c", "UTC"), "html", null, true);
        echo "\"></time>
\t\t\t\t\t(";
        // line 600
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_created"), "fulltime"), "html", null, true);
        echo ")
\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        // line 603
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        $context["times_work_hours"] = ($this->getAttribute($this->getAttribute($_ticket_, "getWorkHoursSet", array(), "method"), "getActiveTime", array(), "method") != "all");
        // line 604
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ((($this->getAttribute($_ticket_, "status") == "awaiting_agent") && $this->getAttribute($_ticket_, "date_user_waiting"))) {
            // line 605
            echo "\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 606
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.current_user_waiting_time");
            echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t";
            // line 608
            if (isset($context["times_work_hours"])) { $_times_work_hours_ = $context["times_work_hours"]; } else { $_times_work_hours_ = null; }
            if ($_times_work_hours_) {
                // line 609
                echo "\t\t\t\t\t\t";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->timeLength($this->getAttribute($_ticket_, "current_user_waiting_work_time"), "hours"), "html", null, true);
                echo "
\t\t\t\t\t\t<span class=\"tipped small-light-icon\" title=\"Work hours only, real time: ";
                // line 610
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->timeLength($this->getAttribute($_ticket_, "current_user_waiting_time")), "html", null, true);
                echo "\"></span>
\t\t\t\t\t";
            } else {
                // line 612
                echo "\t\t\t\t\t\t<time class=\"timeago\" data-timeago-no-ago=\"1\" datetime=\"";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_user_waiting"), "c", "UTC"), "html", null, true);
                echo "\"></time>
\t\t\t\t\t";
            }
            // line 614
            echo "\t\t\t\t\t(";
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.since_time", array("time" => $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_user_waiting"), "fulltime")));
            echo ")
\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 618
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_, "real_total_user_waiting") && ($this->getAttribute($_ticket_, "real_total_user_waiting") > 0))) {
            // line 619
            echo "\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 620
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.total_user_waiting_time");
            echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t";
            // line 622
            if (isset($context["times_work_hours"])) { $_times_work_hours_ = $context["times_work_hours"]; } else { $_times_work_hours_ = null; }
            if ($_times_work_hours_) {
                // line 623
                echo "\t\t\t\t\t\t";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->timeLength($this->getAttribute($_ticket_, "total_user_waiting_work_time"), "hours"), "html", null, true);
                echo "
\t\t\t\t\t\t<span class=\"tipped small-light-icon\" title=\"Work hours only, real time: ";
                // line 624
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->timeLength($this->getAttribute($_ticket_, "real_total_user_waiting")), "html", null, true);
                echo "\"></span>
\t\t\t\t\t";
            } else {
                // line 626
                echo "\t\t\t\t\t\t<time class=\"timeago\" data-timeago-no-ago=\"1\" datetime=\"";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, (("- " . (($this->getAttribute($_ticket_, "real_total_user_waiting", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($_ticket_, "real_total_user_waiting"), "1")) : ("1"))) . " seconds"), "c", "UTC"), "html", null, true);
                echo "\"></time>
\t\t\t\t\t";
            }
            // line 628
            echo "\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 631
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if (($this->getAttribute($_ticket_, "total_to_first_reply") && ($this->getAttribute($_ticket_, "total_to_first_reply") > 0))) {
            // line 632
            echo "\t\t\t\t<tbody><tr>
\t\t\t\t\t<th>";
            // line 633
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.waiting_til_first_reply");
            echo ":</th>
\t\t\t\t\t<td>
\t\t\t\t\t\t";
            // line 635
            if (isset($context["times_work_hours"])) { $_times_work_hours_ = $context["times_work_hours"]; } else { $_times_work_hours_ = null; }
            if ($_times_work_hours_) {
                // line 636
                echo "\t\t\t\t\t\t\t";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->timeLength($this->getAttribute($_ticket_, "work_time_to_first_reply"), "hours"), "html", null, true);
                echo "
\t\t\t\t\t\t\t<span class=\"tipped small-light-icon\" title=\"Work hours only, real time: ";
                // line 637
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->timeLength($this->getAttribute($_ticket_, "total_to_first_reply")), "html", null, true);
                echo "\"></span>
\t\t\t\t\t\t";
            } else {
                // line 639
                echo "\t\t\t\t\t\t\t<time class=\"timeago\" data-timeago-no-ago=\"1\" datetime=\"";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_first_agent_reply"), "c", "UTC"), "html", null, true);
                echo "\"></time>
\t\t\t\t\t\t";
            }
            // line 641
            echo "\t\t\t\t\t</td>
\t\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 644
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ((($this->getAttribute($_ticket_, "status") == "awaiting_user") && $this->getAttribute($_ticket_, "date_agent_waiting"))) {
            // line 645
            echo "\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 646
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.current_agent_waiting_time");
            echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t<time class=\"timeago\" data-timeago-no-ago=\"1\" datetime=\"";
            // line 648
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_agent_waiting"), "c", "UTC"), "html", null, true);
            echo "\"></time>
\t\t\t\t\t(";
            // line 649
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.since_time", array("time" => $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_agent_waiting"), "fulltime")));
            echo ")
\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 653
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($_ticket_, "date_resolved")) {
            // line 654
            echo "\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 655
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.date_resolved");
            echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t<time class=\"timeago\" datetime=\"";
            // line 657
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_resolved"), "c", "UTC"), "html", null, true);
            echo "\"></time>
\t\t\t\t\t(";
            // line 658
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_resolved")), "html", null, true);
            echo ")
\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 662
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.time_til_resolve");
            echo "</th>:</th>
\t\t\t\t<td>
\t\t\t\t\t";
            // line 664
            if (isset($context["times_work_hours"])) { $_times_work_hours_ = $context["times_work_hours"]; } else { $_times_work_hours_ = null; }
            if ($_times_work_hours_) {
                // line 665
                echo "\t\t\t\t\t\t";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->timeLength($this->getAttribute($_ticket_, "work_time_until_resolution"), "hours"), "html", null, true);
                echo "
\t\t\t\t\t\t<span class=\"tipped small-light-icon\" title=\"Work hours only, real time: ";
                // line 666
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->timeLength($this->getAttribute($_ticket_, "time_until_resolution")), "html", null, true);
                echo "\"></span>
\t\t\t\t\t";
            } else {
                // line 668
                echo "\t\t\t\t\t\t<time class=\"timeago\" data-timeago-no-ago=\"1\" datetime=\"";
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, (("- " . (($this->getAttribute($_ticket_, "time_until_resolution", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($_ticket_, "time_until_resolution"), "1")) : ("1"))) . " seconds"), "c", "UTC"), "html", null, true);
                echo "\"></time>
\t\t\t\t\t";
            }
            // line 670
            echo "\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 673
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($_ticket_, "date_closed")) {
            // line 674
            echo "\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 675
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.date_archived");
            echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t<time class=\"timeago\" datetime=\"";
            // line 677
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_closed"), "c", "UTC"), "html", null, true);
            echo "\"></time>
\t\t\t\t\t(";
            // line 678
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_closed")), "html", null, true);
            echo ")
\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 682
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($_ticket_, "date_first_agent_assign")) {
            // line 683
            echo "\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 684
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.first_assignment");
            echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t<time class=\"timeago\" datetime=\"";
            // line 686
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_first_agent_assign"), "c", "UTC"), "html", null, true);
            echo "\"></time>
\t\t\t\t\t(";
            // line 687
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_first_agent_assign"), "fulltime"), "html", null, true);
            echo ")
\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 691
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($_ticket_, "date_first_agent_reply")) {
            // line 692
            echo "\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 693
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.first_agent_reply");
            echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t<time class=\"timeago\" datetime=\"";
            // line 695
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_first_agent_reply"), "c", "UTC"), "html", null, true);
            echo "\"></time>
\t\t\t\t\t(";
            // line 696
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_first_agent_reply"), "fulltime"), "html", null, true);
            echo ")
\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 700
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($_ticket_, "date_last_agent_reply")) {
            // line 701
            echo "\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 702
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.last_agent_reply");
            echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t<time class=\"timeago\" datetime=\"";
            // line 704
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_last_agent_reply"), "c", "UTC"), "html", null, true);
            echo "\"></time>
\t\t\t\t\t(";
            // line 705
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_last_agent_reply"), "fulltime"), "html", null, true);
            echo ")
\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 709
        echo "\t\t\t";
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        if ($this->getAttribute($_ticket_, "date_last_user_reply")) {
            // line 710
            echo "\t\t\t<tbody><tr>
\t\t\t\t<th>";
            // line 711
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.last_user_reply");
            echo ":</th>
\t\t\t\t<td>
\t\t\t\t\t<time class=\"timeago\" datetime=\"";
            // line 713
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_last_user_reply"), "c", "UTC"), "html", null, true);
            echo "\"></time>
\t\t\t\t\t(";
            // line 714
            if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
            echo twig_escape_filter($this->env, $this->env->getExtension('deskpro_templating')->userDate($context, $this->getAttribute($_ticket_, "date_last_user_reply"), "fulltime"), "html", null, true);
            echo ")
\t\t\t\t</td>
\t\t\t</tr></tbody>
\t\t\t";
        }
        // line 718
        echo "\t\t</table>
\t</section>
\t";
        // line 720
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgetTabsBody($_baseId_, "ticket", "messages", "section", "article", $_ticket_api_);
        echo "
</div>

";
        // line 723
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgets($_baseId_, "ticket", "messages", "below", $_ticket_api_);
        echo "
";
        // line 724
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgets($_baseId_, "ticket", "reply", "above", $_ticket_api_);
        echo "

";
        // line 726
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ((!$this->getAttribute($this->getAttribute($_app_, "user"), "getPref", array(0 => "agent.ticket_reverse_order"), "method"))) {
            // line 727
            echo "\t";
            if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
            if (($this->getAttribute($_ticket_perms_, "reply") || $this->getAttribute($_ticket_perms_, "modify_notes"))) {
                // line 728
                echo "\t<div style=\"position:relative;\">
\t\t";
                // line 729
                if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
                if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
                if ($this->getAttribute($_ticket_, "isLocked", array(0 => $this->getAttribute($_app_, "user")), "method")) {
                    echo "<div class=\"lock-overlay\"></div>";
                }
                // line 730
                echo "\t\t<div id=\"";
                if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
                echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
                echo "_replybox_wrap\" class=\"replybox-wrap\">
\t\t\t";
                // line 731
                $this->env->loadTemplate("AgentBundle:Ticket:replybox.html.twig")->display($context);
                // line 732
                echo "\t\t</div>
\t</div>
\t";
            }
        }
        // line 736
        echo "
";
        // line 737
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgets($_baseId_, "ticket", "reply", "below", $_ticket_api_);
        echo "
";
        // line 738
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgets($_baseId_, "ticket", "footer", "above", $_ticket_api_);
        echo "

";
        // line 741
        echo "<script type=\"text/x-deskpro-plain\" id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_fields_display_main_wrap_tpl\">
\t<table class=\"prop-table display-item\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
\t\t<tr>
\t\t\t<th class=\"prop-title display-title\"></th>
\t\t\t<td class=\"prop-val display-content\"></td>
\t\t</tr>
\t</table>
</script>
<script type=\"text/x-deskpro-plain\" id=\"";
        // line 749
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_fields_display_main_edit_tpl\">
\t<div class=\"fields-edit-container\">
\t\t<div class=\"fields-edit-rows\"></div>
\t\t<div class=\"controls\">
\t\t\t<div class=\"is-not-loading\">
\t\t\t\t<button class=\"clean-white save-trigger\">";
        // line 754
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.save");
        echo "</button>
\t\t\t\t<button class=\"clean-white close-trigger\">";
        // line 755
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.cancel");
        echo "</button>
\t\t\t</div>
\t\t\t<div class=\"is-loading\">
\t\t\t\t";
        // line 758
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.saving");
        echo "
\t\t\t</div>
\t\t</div>
\t</div>
</script>
<script type=\"text/x-deskpro-plain\" id=\"";
        // line 763
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_fields_display_main_edit_row_tpl\">
\t<table class=\"prop-table display-item\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
\t\t<tr>
\t\t\t<th class=\"display-title\"></th>
\t\t\t<td class=\"display-content\"></td>
\t\t</tr>
\t</table>
</script>

";
        // line 773
        echo "<script type=\"text/x-deskpro-plain\" class=\"tpl-fields-maintabs-tab\" id=\"";
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_fields_display_tabs_tab_tpl\">
\t<li class=\"tab-trigger {id} field-tab\" data-tab-for=\".{id}\" data-field-tab-id=\"{id}\">
\t\t<a>{title}</a>
\t</li>
</script>
<script type=\"text/x-deskpro-plain\" class=\"tpl-fields-maintabs-content\" id=\"";
        // line 778
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_fields_display_tabs_content_tpl\">
\t<div class=\"full-container-tabbed-contents tab-content field-tab-content {id}\">
\t</div>
</script>
<script type=\"text/x-deskpro-plain\" id=\"";
        // line 782
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_fields_display_tabs_wrap_tpl\">
\t<dl class=\"info-list display-item\">
\t\t<dt class=\"display-title\"></dt>
\t\t<dd class=\"display-content\"></dd>
\t</dl>
</script>

<ul class=\"ticket-message-edit-menu\" style=\"display:none\">
\t<li data-option-id=\"window\" data-url=\"";
        // line 790
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticket_message_window", array("ticket_id" => "00000", "message_id" => "11111", "_rt" => $this->env->getExtension('deskpro_templating')->securityToken("request_token", 10800))), "html", null, true);
        echo "\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.view_message_in_window");
        echo "</li>
\t<li data-option-id=\"quote\">";
        // line 791
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.quote");
        echo "</li>
\t<li class=\"forward-message\" data-option-id=\"fwd\">";
        // line 792
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.forward_message");
        echo "</li>
\t";
        // line 793
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ($this->getAttribute($_ticket_perms_, "modify_messages")) {
            echo "<li class=\"delete-link\" data-option-id=\"delete\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.delete_message");
            echo "</li>";
        }
        // line 794
        echo "\t";
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ($this->getAttribute($_ticket_perms_, "delete")) {
            echo "<li class=\"delete-attachments-link\" data-option-id=\"delete-attachments\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.delete_attach");
            echo "</li>";
        }
        // line 795
        echo "\t<li class=\"set-as-note\" data-option-id=\"setnote.note\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.set_as_note");
        echo "</li>
\t<li class=\"set-as-message\" data-option-id=\"setnote.message\">";
        // line 796
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.set_as_normal_message");
        echo "</li>
\t";
        // line 797
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ($this->getAttribute($_ticket_perms_, "modify_merge")) {
            echo "<li data-option-id=\"split\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.split_message_btn");
            echo "</li>";
        }
        // line 798
        echo "\t";
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($this->getAttribute($_app_, "user"), "hasPerm", array(0 => "agent_tickets.create"), "method")) {
            echo "<li data-option-id=\"linked_ticket\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.create_linked_ticket");
            echo "</li>";
        }
        // line 799
        echo "\t";
        if (isset($context["ticket_perms"])) { $_ticket_perms_ = $context["ticket_perms"]; } else { $_ticket_perms_ = null; }
        if ($this->getAttribute($_ticket_perms_, "modify_messages")) {
            echo "<li data-option-id=\"edit\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.edit");
            echo "</li>";
        }
        // line 800
        echo "\t";
        if (isset($context["app"])) { $_app_ = $context["app"]; } else { $_app_ = null; }
        if ($this->getAttribute($this->getAttribute($_app_, "user"), "can_admin")) {
            echo "<li data-option-id=\"debug\" data-url=\"";
            echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_ticket_download_debug_report", array("ticket_id" => "00000", "_rt" => $this->env->getExtension('deskpro_templating')->securityToken("request_token", 10800))), "html", null, true);
            echo "\">";
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.debug_file_download");
            echo "</li>";
        }
        // line 801
        echo "\t";
        // line 802
        echo "</ul>
<ul class=\"ticket-macros-menu\" style=\"display:none\" ";
        // line 803
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if ($_baseId_) {
            echo "id=\"";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_macros_menu\"";
        }
        echo ">
\t";
        // line 804
        if (isset($context["macros"])) { $_macros_ = $context["macros"]; } else { $_macros_ = null; }
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable($_macros_);
        foreach ($context['_seq'] as $context["_key"] => $context["macro"]) {
            // line 805
            echo "\t\t<li class=\"res-ticketmacro-";
            if (isset($context["macro"])) { $_macro_ = $context["macro"]; } else { $_macro_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_macro_, "id"), "html", null, true);
            echo "\" data-macro-id=\"";
            if (isset($context["macro"])) { $_macro_ = $context["macro"]; } else { $_macro_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_macro_, "id"), "html", null, true);
            echo "\"><span class=\"macro-title\">";
            if (isset($context["macro"])) { $_macro_ = $context["macro"]; } else { $_macro_ = null; }
            echo twig_escape_filter($this->env, $this->getAttribute($_macro_, "title"), "html", null, true);
            echo "</span></li>
\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['macro'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 807
        echo "\t<li class=\"open-settings-trigger\" style=\"background-color: #E4E4E4; border-top: 1px solid #C1C1C1;\"><i class=\"icon-cog\"></i> ";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.manage_macros");
        echo "</li>
</ul>

<div class=\"delete-ticket-overlay overlay\" style=\"display:none\">
\t<div class=\"overlay-title\">
\t\t<h4>";
        // line 812
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.delete");
        echo "</h4>
\t</div>

\t<div class=\"overlay-content\">
\t\t";
        // line 816
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.deleted_reason");
        echo ": <input type=\"text\" value=\"\" class=\"delete-reason\" style=\"width: 200px;\" />

\t\t";
        // line 818
        if (isset($context["person_object_counts"])) { $_person_object_counts_ = $context["person_object_counts"]; } else { $_person_object_counts_ = null; }
        if ((($this->getAttribute($_person_object_counts_, "tickets") > 1) || $this->getAttribute($_person_object_counts_, "chats"))) {
            // line 819
            echo "\t\t<div id=\"";
            if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
            echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
            echo "_delete_user_list\" style=\"display: none;\">
\t\t\t<br/>
\t\t\t";
            // line 821
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.people.other_user_content_being_deleted");
            echo "<br />
\t\t\t&bull; ";
            // line 822
            if (isset($context["person_object_counts"])) { $_person_object_counts_ = $context["person_object_counts"]; } else { $_person_object_counts_ = null; }
            echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.count_tickets", array("count" => $this->getAttribute($_person_object_counts_, "tickets")));
            echo "
\t\t\t";
            // line 823
            if (isset($context["person_object_counts"])) { $_person_object_counts_ = $context["person_object_counts"]; } else { $_person_object_counts_ = null; }
            if ($this->getAttribute($_person_object_counts_, "chats")) {
                echo "&bull; ";
                if (isset($context["person_object_counts"])) { $_person_object_counts_ = $context["person_object_counts"]; } else { $_person_object_counts_ = null; }
                echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.count_chat", array("count" => $this->getAttribute($_person_object_counts_, "chats")));
                echo "<br/>";
            }
            // line 824
            echo "\t\t</div>
\t\t";
        }
        // line 826
        echo "\t</div>

\t<div class=\"overlay-footer\">
\t\t<div class=\"loading-off\">
\t\t\t<button class=\"save-trigger clean-white\">";
        // line 830
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.delete");
        echo "</button>
\t\t</div>
\t\t<div class=\"loading-on\" style=\"display:none\">
\t\t\t<span>";
        // line 833
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.saving");
        echo "... <span class=\"flat-spinner\"></span></span>
\t\t</div>
\t</div>
</div>

<div class=\"delete-message-overlay overlay\" style=\"display:none\">
\t<div class=\"overlay-title\">
\t\t<h4>";
        // line 840
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.delete");
        echo "</h4>
\t</div>

\t<div class=\"overlay-content\">
\t\t";
        // line 844
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.delete_message_confirm");
        echo "
\t\t<div class=\"ticket-messages\"></div>
\t\t<input type=\"hidden\" class=\"message-id\" value=\"\" />
\t</div>

\t<div class=\"overlay-footer\">
\t\t<div class=\"loading-off\">
\t\t\t<button class=\"save-trigger clean-white\">";
        // line 851
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.delete");
        echo "</button>
\t\t</div>
\t\t<div class=\"loading-on\" style=\"display:none\">
\t\t\t<span>";
        // line 854
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.saving");
        echo "... <span class=\"flat-spinner\"></span></span>
\t\t</div>
\t</div>
</div>

<div class=\"macro-controls\" style=\"display: none;\">
\t<button class=\"clean-white save\" id=\"macro_apply_btn\">";
        // line 860
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.apply");
        echo "</button>
\t<button class=\"clean-white cancel\" id=\"macro_cancel_btn\">";
        // line 861
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.cancel");
        echo "</button>
</div>

<div class=\"confirm-macro-overlay\" id=\"";
        // line 864
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_confirm_macro_overlay\" style=\"width: 800px; height: 400px; display: none;\">
\t<div class=\"overlay-title\">
\t\t<h4>";
        // line 866
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.confirm");
        echo "</h4>
\t</div>
\t<div class=\"overlay-content\">
\t\t<ul class=\"actions-list\"></ul>
\t</div>
\t<div class=\"overlay-footer\">
\t\t<button class=\"clean-white\" id=\"";
        // line 872
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_apply_macro_btn\">";
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.apply");
        echo "</button>
\t</div>
</div>

<section id=\"";
        // line 876
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_message_edit_overlay\" style=\"display: none;\">
\t<div class=\"overlay-title\">
\t\t<span class=\"close-overlay close-trigger\"></span>
\t\t<h4>";
        // line 879
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.edit");
        echo "</h4>
\t</div>
\t<div class=\"overlay-content\">
\t\t<input type=\"hidden\" name=\"message_id\" class=\"message_id\" value=\"0\" />
\t\t<textarea rows=\"10\" cols=\"60\" style=\"width: 98%; height: 200px; color: #000; size: 10px; font-family: Monaco, Consolas, monospace;\" name=\"message_text\" class=\"message_text\"></textarea>
\t</div>
\t<div class=\"overlay-footer\">
\t\t<button class=\"clean-white save-text-trigger\">";
        // line 886
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.save");
        echo "</button>
\t\t<span class=\"flat-spinner save-text-loading\" style=\"display: none\"></span>
\t</div>
</section>

";
        // line 891
        $this->env->loadTemplate("AgentBundle:Ticket:custom-view-include.html.twig")->display($context);
        // line 892
        echo "
";
        // line 893
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        if (isset($context["ticket_api"])) { $_ticket_api_ = $context["ticket_api"]; } else { $_ticket_api_ = null; }
        echo $this->env->getExtension('deskpro_templating')->getWidgets($_baseId_, "ticket", "", "", $_ticket_api_);
        echo "

</div>

<div id=\"";
        // line 897
        if (isset($context["baseId"])) { $_baseId_ = $context["baseId"]; } else { $_baseId_ = null; }
        echo twig_escape_filter($this->env, $_baseId_, "html", null, true);
        echo "_pending_add\" style=\"display:none;\" data-save-url=\"";
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("agent_kb_newpending"), "html", null, true);
        echo "\">
\t<div class=\"mass-actions-overlay pending-article\" style=\"width: 550px; height: 400px;\">
\t\t<div class=\"overlay-title\">
\t\t\t<h4>";
        // line 900
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.create_new_pending_article");
        echo "</h4>
\t\t</div>
\t\t<div class=\"overlay-content\">
\t\t\t<div style=\"font-size: 12px; padding-bottom: 9px;\">";
        // line 903
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.pending_article_info");
        echo "</div>
\t\t\t<input type=\"hidden\" name=\"ticket_id\" value=\"";
        // line 904
        if (isset($context["ticket"])) { $_ticket_ = $context["ticket"]; } else { $_ticket_ = null; }
        echo twig_escape_filter($this->env, $this->getAttribute($_ticket_, "id"), "html", null, true);
        echo "\" />
\t\t\t<textarea name=\"comment\" placeholder=\"";
        // line 905
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.tickets.pending_article_desc");
        echo "\" style=\"width: 98%; height: 260px;\"></textarea>
\t\t</div>
\t\t<div class=\"overlay-footer\">
\t\t\t<div class=\"is-not-loading\">
\t\t\t\t<button class=\"save-new-trigger clean-white\">";
        // line 909
        echo $this->env->getExtension('deskpro_templating')->getPhrase($context, "agent.general.add");
        echo "</button>
\t\t\t</div>
\t\t\t<div class=\"is-loading\">
\t\t\t\t<i class=\"flat-spinner\"></i>
\t\t\t</div>
\t\t</div>
\t</div>
</div>

</div></div> ";
        // line 919
        echo "</div>";
    }

    public function getTemplateName()
    {
        return "AgentBundle:Ticket:view.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  3091 => 919,  3079 => 909,  3072 => 905,  3067 => 904,  3063 => 903,  3057 => 900,  3048 => 897,  3039 => 893,  3036 => 892,  3034 => 891,  3026 => 886,  3016 => 879,  3009 => 876,  2999 => 872,  2990 => 866,  2984 => 864,  2978 => 861,  2974 => 860,  2965 => 854,  2959 => 851,  2949 => 844,  2942 => 840,  2932 => 833,  2926 => 830,  2920 => 826,  2916 => 824,  2908 => 823,  2903 => 822,  2899 => 821,  2892 => 819,  2889 => 818,  2884 => 816,  2877 => 812,  2868 => 807,  2852 => 805,  2847 => 804,  2837 => 803,  2834 => 802,  2832 => 801,  2822 => 800,  2814 => 799,  2806 => 798,  2795 => 796,  2790 => 795,  2782 => 794,  2775 => 793,  2771 => 792,  2767 => 791,  2761 => 790,  2749 => 782,  2741 => 778,  2731 => 773,  2718 => 763,  2710 => 758,  2704 => 755,  2700 => 754,  2691 => 749,  2678 => 741,  2665 => 737,  2662 => 736,  2656 => 732,  2654 => 731,  2648 => 730,  2642 => 729,  2639 => 728,  2635 => 727,  2619 => 723,  2611 => 720,  2607 => 718,  2599 => 714,  2589 => 711,  2582 => 709,  2574 => 705,  2569 => 704,  2561 => 701,  2557 => 700,  2549 => 696,  2544 => 695,  2539 => 693,  2536 => 692,  2532 => 691,  2524 => 687,  2519 => 686,  2514 => 684,  2511 => 683,  2507 => 682,  2494 => 677,  2489 => 675,  2486 => 674,  2477 => 670,  2470 => 668,  2458 => 665,  2455 => 664,  2442 => 658,  2437 => 657,  2432 => 655,  2429 => 654,  2425 => 653,  2417 => 649,  2412 => 648,  2407 => 646,  2404 => 645,  2400 => 644,  2395 => 641,  2382 => 637,  2373 => 635,  2368 => 633,  2365 => 632,  2361 => 631,  2356 => 628,  2349 => 626,  2343 => 624,  2337 => 623,  2334 => 622,  2329 => 620,  2326 => 619,  2322 => 618,  2313 => 614,  2306 => 612,  2300 => 610,  2294 => 609,  2291 => 608,  2286 => 606,  2283 => 605,  2279 => 604,  2276 => 603,  2264 => 599,  2259 => 597,  2246 => 592,  2241 => 591,  2217 => 587,  2214 => 586,  2200 => 585,  2197 => 584,  2193 => 583,  2170 => 581,  2166 => 580,  2160 => 578,  2154 => 577,  2137 => 575,  2103 => 570,  2093 => 568,  2081 => 567,  2070 => 566,  2065 => 563,  2051 => 561,  2046 => 560,  2020 => 556,  2014 => 555,  2010 => 554,  2003 => 553,  1989 => 550,  1982 => 546,  1974 => 541,  1962 => 539,  1955 => 537,  1945 => 534,  1939 => 533,  1928 => 528,  1921 => 527,  1877 => 522,  1873 => 521,  1868 => 520,  1864 => 518,  1852 => 514,  1846 => 512,  1831 => 508,  1828 => 507,  1824 => 506,  1806 => 498,  1796 => 495,  1775 => 487,  1769 => 484,  1762 => 482,  1748 => 475,  1743 => 473,  1727 => 469,  1703 => 460,  1699 => 458,  1697 => 457,  1691 => 456,  1687 => 455,  1683 => 453,  1675 => 451,  1670 => 450,  1655 => 445,  1650 => 444,  1633 => 436,  1627 => 433,  1597 => 422,  1590 => 419,  1578 => 414,  1569 => 411,  1561 => 408,  1553 => 403,  1543 => 399,  1524 => 397,  1519 => 396,  1515 => 395,  1505 => 393,  1502 => 392,  1480 => 390,  1475 => 389,  1470 => 388,  1462 => 385,  1451 => 381,  1435 => 379,  1428 => 378,  1378 => 368,  1354 => 363,  1344 => 359,  1287 => 352,  1259 => 348,  1041 => 292,  1346 => 4,  1327 => 1,  1283 => 295,  1278 => 292,  1237 => 279,  1230 => 277,  961 => 207,  922 => 285,  1293 => 478,  1271 => 290,  1256 => 347,  1170 => 326,  1166 => 258,  1054 => 387,  943 => 355,  869 => 335,  1399 => 568,  1387 => 370,  1358 => 364,  1334 => 553,  1316 => 529,  1298 => 481,  1249 => 495,  1120 => 314,  1117 => 245,  1093 => 440,  1073 => 235,  1394 => 446,  1385 => 442,  1382 => 441,  1369 => 433,  1363 => 365,  1360 => 431,  1350 => 429,  1305 => 523,  1281 => 351,  1277 => 403,  1265 => 398,  1255 => 396,  1247 => 393,  1202 => 270,  1162 => 365,  1136 => 461,  1132 => 409,  1078 => 335,  1025 => 375,  750 => 228,  1183 => 452,  1105 => 309,  1097 => 341,  1064 => 314,  1048 => 294,  953 => 268,  907 => 258,  864 => 374,  1326 => 406,  1306 => 354,  1300 => 409,  1219 => 413,  1199 => 374,  1186 => 380,  1141 => 318,  1138 => 251,  1135 => 439,  1098 => 322,  1067 => 322,  1017 => 302,  968 => 360,  875 => 263,  846 => 188,  788 => 315,  805 => 263,  801 => 204,  842 => 263,  832 => 333,  1038 => 319,  932 => 297,  831 => 244,  837 => 239,  790 => 278,  733 => 230,  666 => 214,  919 => 284,  873 => 349,  824 => 267,  762 => 243,  713 => 225,  697 => 281,  2739 => 1153,  2735 => 1152,  2732 => 1151,  2725 => 1146,  2712 => 1144,  2707 => 1143,  2692 => 1131,  2688 => 1130,  2683 => 1127,  2680 => 1126,  2677 => 1125,  2671 => 738,  2658 => 1119,  2653 => 1118,  2645 => 1113,  2641 => 1112,  2636 => 1109,  2632 => 726,  2629 => 1107,  2626 => 1106,  2606 => 1089,  2602 => 1088,  2598 => 1087,  2594 => 713,  2590 => 1085,  2586 => 710,  2572 => 1073,  2568 => 1072,  2564 => 702,  2560 => 1070,  2556 => 1069,  2552 => 1068,  2537 => 1056,  2533 => 1055,  2529 => 1054,  2525 => 1053,  2521 => 1052,  2503 => 1040,  2499 => 678,  2495 => 1038,  2491 => 1037,  2487 => 1036,  2483 => 1035,  2469 => 1024,  2465 => 1023,  2461 => 1022,  2457 => 1021,  2453 => 1020,  2449 => 1019,  2426 => 999,  2422 => 998,  2418 => 997,  2414 => 996,  2410 => 995,  2406 => 994,  2392 => 983,  2388 => 639,  2384 => 981,  2380 => 980,  2376 => 636,  2372 => 978,  2358 => 967,  2354 => 966,  2350 => 965,  2346 => 964,  2342 => 963,  2338 => 962,  2324 => 951,  2320 => 950,  2316 => 949,  2312 => 948,  2308 => 947,  2304 => 946,  2295 => 939,  2282 => 937,  2277 => 936,  2269 => 600,  2265 => 930,  2260 => 927,  2256 => 926,  2253 => 925,  2230 => 588,  2220 => 899,  2216 => 898,  2211 => 896,  2208 => 895,  2198 => 893,  2194 => 892,  2189 => 582,  2184 => 889,  2177 => 885,  2173 => 884,  2164 => 877,  2151 => 576,  2146 => 874,  2143 => 873,  2141 => 864,  2134 => 574,  2130 => 573,  2122 => 853,  2120 => 852,  2113 => 848,  2105 => 846,  2096 => 839,  2083 => 837,  2078 => 836,  2073 => 834,  2067 => 830,  2062 => 828,  2058 => 827,  2054 => 826,  2050 => 825,  2045 => 824,  2038 => 559,  2034 => 821,  2022 => 814,  2009 => 812,  1999 => 809,  1993 => 805,  1988 => 803,  1984 => 802,  1980 => 801,  1976 => 542,  1971 => 799,  1968 => 540,  1964 => 797,  1960 => 796,  1954 => 793,  1946 => 788,  1942 => 787,  1938 => 786,  1932 => 782,  1927 => 780,  1919 => 778,  1915 => 777,  1911 => 776,  1906 => 775,  1903 => 774,  1899 => 773,  1895 => 772,  1886 => 768,  1883 => 764,  1871 => 759,  1866 => 756,  1863 => 755,  1842 => 752,  1825 => 749,  1818 => 748,  1815 => 504,  1800 => 743,  1793 => 741,  1772 => 729,  1761 => 721,  1757 => 720,  1751 => 476,  1740 => 709,  1719 => 697,  1715 => 696,  1686 => 673,  1676 => 669,  1665 => 448,  1661 => 660,  1645 => 441,  1638 => 649,  1630 => 645,  1625 => 642,  1622 => 430,  1598 => 637,  1577 => 634,  1558 => 629,  1549 => 627,  1546 => 626,  1535 => 618,  1531 => 617,  1514 => 606,  1510 => 394,  1504 => 602,  1493 => 594,  1483 => 590,  1464 => 580,  1458 => 577,  1443 => 568,  1437 => 565,  1426 => 557,  1405 => 545,  1401 => 544,  1395 => 541,  1390 => 538,  1381 => 369,  1373 => 531,  1348 => 361,  1343 => 3,  1335 => 515,  1321 => 510,  1318 => 304,  1299 => 297,  1294 => 407,  1282 => 496,  1269 => 506,  1260 => 397,  1240 => 417,  1221 => 338,  1216 => 378,  1210 => 272,  1206 => 337,  1193 => 467,  1189 => 433,  1155 => 468,  1077 => 433,  1049 => 419,  1022 => 303,  1010 => 299,  1006 => 404,  988 => 398,  969 => 294,  965 => 399,  929 => 296,  896 => 275,  866 => 278,  862 => 334,  854 => 244,  844 => 234,  776 => 232,  1713 => 683,  1700 => 681,  1685 => 674,  1662 => 670,  1643 => 669,  1640 => 668,  1631 => 663,  1618 => 661,  1613 => 660,  1608 => 639,  1605 => 656,  1602 => 655,  1589 => 645,  1586 => 644,  1583 => 416,  1554 => 613,  1547 => 401,  1521 => 602,  1508 => 600,  1499 => 598,  1491 => 593,  1482 => 587,  1472 => 582,  1468 => 581,  1465 => 386,  1457 => 382,  1445 => 566,  1422 => 556,  1416 => 374,  1410 => 548,  1397 => 372,  1392 => 371,  1386 => 541,  1377 => 532,  1370 => 530,  1357 => 528,  1352 => 554,  1341 => 428,  1314 => 510,  1311 => 402,  1275 => 493,  1248 => 284,  1238 => 488,  1225 => 476,  1220 => 275,  1209 => 466,  1182 => 475,  1159 => 450,  1154 => 254,  1130 => 438,  1125 => 315,  1101 => 240,  1087 => 302,  1074 => 315,  1056 => 326,  1046 => 386,  1043 => 225,  1030 => 376,  1027 => 412,  999 => 279,  893 => 196,  881 => 267,  877 => 251,  847 => 343,  825 => 350,  766 => 251,  724 => 237,  1083 => 237,  1039 => 315,  995 => 399,  984 => 350,  977 => 362,  941 => 324,  905 => 363,  857 => 245,  705 => 233,  1365 => 556,  1359 => 545,  1349 => 539,  1336 => 427,  1331 => 424,  1323 => 420,  1319 => 356,  1312 => 355,  1284 => 512,  1272 => 401,  1268 => 350,  1261 => 288,  1251 => 285,  1245 => 345,  1231 => 341,  1207 => 271,  1197 => 267,  1180 => 484,  1173 => 371,  1169 => 259,  1163 => 257,  1157 => 421,  1147 => 415,  1143 => 252,  1109 => 440,  1059 => 296,  1051 => 325,  1044 => 424,  1021 => 219,  1015 => 308,  1009 => 357,  987 => 404,  973 => 361,  911 => 298,  855 => 72,  827 => 184,  821 => 266,  691 => 219,  576 => 167,  453 => 168,  1234 => 450,  1224 => 414,  1214 => 412,  1195 => 478,  1190 => 328,  1187 => 327,  1185 => 432,  1177 => 569,  1148 => 253,  1128 => 316,  1122 => 248,  1108 => 376,  1037 => 291,  991 => 351,  921 => 293,  878 => 355,  836 => 228,  730 => 251,  648 => 253,  933 => 84,  914 => 133,  909 => 323,  833 => 284,  783 => 306,  755 => 303,  737 => 241,  685 => 218,  539 => 200,  635 => 249,  582 => 153,  577 => 238,  609 => 202,  593 => 199,  497 => 76,  20 => 1,  774 => 195,  747 => 298,  736 => 265,  524 => 133,  469 => 156,  437 => 149,  546 => 201,  532 => 134,  485 => 123,  479 => 157,  537 => 160,  457 => 199,  947 => 361,  936 => 390,  924 => 350,  917 => 369,  906 => 81,  872 => 250,  860 => 314,  851 => 265,  796 => 330,  767 => 201,  578 => 292,  519 => 80,  852 => 331,  814 => 319,  739 => 296,  722 => 188,  565 => 183,  559 => 183,  471 => 125,  1853 => 842,  1849 => 753,  1839 => 510,  1810 => 820,  1803 => 819,  1799 => 496,  1782 => 489,  1778 => 488,  1770 => 807,  1749 => 795,  1738 => 793,  1728 => 789,  1721 => 788,  1717 => 787,  1709 => 693,  1705 => 781,  1688 => 675,  1681 => 452,  1677 => 768,  1667 => 449,  1656 => 762,  1648 => 655,  1644 => 756,  1636 => 750,  1624 => 744,  1617 => 429,  1606 => 738,  1588 => 732,  1570 => 726,  1545 => 719,  1534 => 606,  1527 => 713,  1509 => 707,  1500 => 701,  1496 => 700,  1489 => 593,  1474 => 688,  1456 => 682,  1449 => 681,  1438 => 676,  1431 => 675,  1420 => 376,  1413 => 669,  1404 => 663,  1400 => 662,  1383 => 540,  1379 => 557,  1356 => 632,  1351 => 362,  1338 => 358,  1332 => 407,  1315 => 613,  1302 => 522,  1289 => 406,  1276 => 468,  1263 => 349,  1244 => 453,  1241 => 343,  1236 => 594,  1218 => 448,  1215 => 577,  1191 => 373,  1181 => 561,  1171 => 445,  1158 => 567,  1114 => 330,  1104 => 465,  1062 => 388,  1042 => 316,  1024 => 395,  1014 => 218,  1000 => 411,  990 => 297,  980 => 277,  970 => 402,  918 => 260,  888 => 80,  834 => 274,  817 => 214,  765 => 297,  746 => 170,  502 => 187,  287 => 101,  1144 => 463,  1139 => 356,  1133 => 358,  1131 => 250,  1127 => 357,  1124 => 455,  1113 => 433,  1110 => 243,  1103 => 444,  1092 => 336,  1086 => 238,  1063 => 232,  1060 => 231,  1055 => 230,  1035 => 314,  1019 => 330,  1003 => 281,  996 => 406,  981 => 257,  959 => 293,  952 => 464,  930 => 148,  908 => 344,  900 => 366,  880 => 252,  867 => 258,  859 => 294,  848 => 235,  839 => 275,  828 => 324,  809 => 179,  803 => 372,  797 => 260,  779 => 314,  769 => 252,  740 => 189,  729 => 191,  703 => 238,  693 => 297,  688 => 232,  671 => 176,  667 => 232,  630 => 167,  626 => 142,  567 => 162,  557 => 142,  512 => 137,  380 => 2,  734 => 307,  701 => 221,  680 => 205,  674 => 177,  659 => 217,  653 => 176,  613 => 158,  602 => 175,  589 => 154,  569 => 187,  542 => 156,  529 => 153,  487 => 148,  475 => 140,  454 => 120,  368 => 137,  717 => 187,  684 => 281,  656 => 215,  647 => 175,  637 => 210,  618 => 241,  597 => 260,  522 => 156,  501 => 147,  340 => 80,  201 => 51,  383 => 105,  374 => 92,  292 => 92,  631 => 208,  616 => 198,  605 => 193,  596 => 134,  561 => 126,  504 => 149,  498 => 126,  491 => 146,  388 => 98,  330 => 92,  445 => 163,  439 => 178,  433 => 183,  413 => 174,  316 => 87,  296 => 115,  370 => 105,  395 => 121,  294 => 82,  273 => 33,  220 => 67,  492 => 129,  468 => 120,  456 => 135,  377 => 121,  319 => 79,  262 => 80,  250 => 70,  5659 => 53,  5653 => 52,  5642 => 51,  5628 => 48,  5623 => 47,  5617 => 46,  5606 => 45,  5588 => 42,  5579 => 41,  5570 => 40,  5561 => 39,  5552 => 38,  5543 => 37,  5534 => 36,  5525 => 35,  5516 => 34,  5507 => 33,  5498 => 32,  5489 => 31,  5486 => 30,  5482 => 29,  5478 => 28,  5467 => 27,  5450 => 24,  5442 => 23,  5434 => 22,  5428 => 21,  5421 => 20,  5407 => 19,  5403 => 4677,  5358 => 4636,  5231 => 4513,  5166 => 4452,  5063 => 4352,  5024 => 4316,  5014 => 4309,  4973 => 4271,  4941 => 4242,  4892 => 4196,  4827 => 4135,  4812 => 4124,  4774 => 4090,  4759 => 4078,  4748 => 4070,  4734 => 4060,  4679 => 4009,  4629 => 3963,  4615 => 3953,  4573 => 3915,  4561 => 3906,  4475 => 3824,  4410 => 3763,  4382 => 3739,  4368 => 3729,  4361 => 3726,  4353 => 3722,  4346 => 3719,  4338 => 3715,  4331 => 3712,  4302 => 3687,  4280 => 3669,  4257 => 3650,  4248 => 3645,  4223 => 3624,  4211 => 3616,  4175 => 3584,  4066 => 3478,  4062 => 3477,  4040 => 3458,  4034 => 3455,  4021 => 3445,  4015 => 3442,  4009 => 3439,  3967 => 3400,  3960 => 3396,  3866 => 3305,  3810 => 3252,  3709 => 3154,  3696 => 3145,  3688 => 3140,  3659 => 3115,  3650 => 3110,  3553 => 3017,  3548 => 3016,  3543 => 3015,  3538 => 3014,  3533 => 3013,  3528 => 3012,  3523 => 3011,  3518 => 3010,  3513 => 3009,  3508 => 3008,  3503 => 3007,  3498 => 3006,  3493 => 3005,  3488 => 3004,  3483 => 3003,  3478 => 3002,  3470 => 2998,  3447 => 2978,  3423 => 2958,  3370 => 2909,  3234 => 2776,  3148 => 2694,  3130 => 2679,  3124 => 2676,  3040 => 2596,  2963 => 2522,  2861 => 2424,  2853 => 2420,  2820 => 2391,  2803 => 2377,  2799 => 797,  2794 => 2375,  2649 => 2234,  2625 => 724,  2517 => 1051,  2498 => 2092,  2482 => 673,  2472 => 2072,  2464 => 666,  2450 => 662,  2446 => 2055,  2436 => 2049,  2428 => 2045,  2378 => 1998,  2303 => 1926,  2293 => 1919,  2252 => 594,  2224 => 1856,  2176 => 1811,  2114 => 1753,  2107 => 571,  2102 => 1749,  2086 => 1737,  2079 => 1734,  1967 => 1637,  1826 => 1502,  1819 => 1498,  1732 => 471,  1723 => 1408,  1695 => 680,  1672 => 1363,  1664 => 1359,  1611 => 1310,  1601 => 638,  1533 => 1238,  1526 => 1235,  1518 => 1230,  1511 => 1227,  1454 => 572,  1439 => 1161,  1417 => 1143,  1409 => 1139,  1308 => 526,  1301 => 1037,  1252 => 999,  1243 => 283,  1223 => 978,  1212 => 494,  1167 => 325,  1161 => 322,  1145 => 923,  1140 => 462,  1106 => 900,  1100 => 897,  983 => 298,  975 => 295,  956 => 292,  939 => 354,  902 => 257,  894 => 364,  879 => 337,  757 => 193,  735 => 168,  727 => 293,  702 => 216,  678 => 178,  670 => 204,  600 => 156,  528 => 187,  476 => 213,  447 => 107,  243 => 75,  780 => 247,  758 => 229,  742 => 194,  700 => 232,  655 => 172,  652 => 214,  638 => 168,  620 => 163,  587 => 191,  579 => 132,  535 => 237,  523 => 82,  516 => 132,  494 => 142,  480 => 126,  441 => 114,  428 => 104,  351 => 84,  347 => 83,  402 => 98,  268 => 71,  430 => 136,  411 => 101,  322 => 88,  289 => 33,  284 => 86,  255 => 66,  1150 => 447,  1134 => 538,  1129 => 435,  1126 => 443,  1121 => 434,  1116 => 331,  1089 => 239,  1084 => 337,  1081 => 429,  1075 => 299,  1072 => 333,  1069 => 332,  1065 => 297,  1061 => 352,  1053 => 295,  1050 => 227,  1047 => 306,  1033 => 290,  1029 => 304,  1026 => 287,  1004 => 369,  997 => 454,  989 => 300,  985 => 296,  978 => 313,  966 => 375,  963 => 292,  960 => 466,  951 => 301,  948 => 356,  944 => 298,  931 => 202,  925 => 286,  916 => 290,  913 => 324,  904 => 198,  899 => 306,  891 => 255,  885 => 336,  882 => 194,  870 => 280,  865 => 191,  829 => 336,  823 => 217,  820 => 215,  811 => 319,  800 => 340,  793 => 266,  786 => 205,  773 => 202,  764 => 173,  761 => 311,  743 => 297,  725 => 250,  720 => 189,  686 => 180,  673 => 178,  662 => 174,  649 => 324,  636 => 145,  632 => 245,  612 => 203,  584 => 240,  562 => 143,  472 => 111,  442 => 116,  438 => 113,  386 => 152,  373 => 120,  304 => 108,  270 => 83,  265 => 68,  477 => 172,  455 => 152,  422 => 103,  407 => 120,  399 => 163,  375 => 148,  364 => 144,  358 => 90,  349 => 137,  338 => 42,  327 => 91,  298 => 91,  249 => 76,  194 => 81,  142 => 32,  344 => 95,  295 => 74,  290 => 73,  266 => 68,  357 => 101,  334 => 135,  300 => 75,  286 => 80,  282 => 103,  279 => 85,  269 => 69,  254 => 71,  128 => 27,  237 => 55,  165 => 53,  122 => 14,  798 => 203,  770 => 313,  759 => 307,  748 => 243,  731 => 294,  721 => 227,  718 => 235,  708 => 185,  696 => 236,  617 => 140,  607 => 137,  590 => 153,  563 => 212,  553 => 145,  550 => 157,  540 => 161,  533 => 182,  507 => 213,  500 => 135,  493 => 125,  489 => 178,  464 => 170,  458 => 121,  452 => 197,  449 => 196,  434 => 133,  424 => 108,  415 => 101,  382 => 94,  372 => 92,  361 => 100,  356 => 124,  339 => 96,  302 => 83,  285 => 72,  258 => 40,  123 => 34,  108 => 27,  418 => 102,  404 => 107,  389 => 114,  354 => 89,  325 => 115,  321 => 89,  276 => 100,  252 => 122,  206 => 36,  110 => 23,  240 => 74,  224 => 33,  217 => 40,  186 => 42,  170 => 41,  100 => 18,  67 => 14,  14 => 1,  1096 => 425,  1090 => 398,  1088 => 321,  1085 => 456,  1066 => 233,  1034 => 282,  1031 => 221,  1018 => 286,  1013 => 405,  1007 => 370,  1002 => 403,  993 => 213,  986 => 212,  982 => 211,  976 => 276,  971 => 275,  964 => 208,  949 => 266,  946 => 290,  940 => 384,  937 => 374,  928 => 287,  926 => 318,  915 => 282,  912 => 281,  903 => 343,  898 => 340,  892 => 339,  889 => 337,  887 => 302,  884 => 79,  876 => 274,  874 => 193,  871 => 378,  863 => 345,  861 => 274,  850 => 189,  840 => 186,  815 => 264,  812 => 212,  808 => 323,  804 => 314,  799 => 312,  791 => 200,  787 => 316,  785 => 262,  771 => 245,  754 => 222,  751 => 303,  728 => 167,  723 => 252,  715 => 250,  711 => 234,  709 => 185,  706 => 302,  698 => 182,  692 => 161,  689 => 181,  681 => 179,  677 => 288,  675 => 278,  663 => 213,  661 => 263,  650 => 213,  644 => 174,  641 => 220,  633 => 182,  629 => 266,  622 => 202,  586 => 175,  575 => 147,  571 => 187,  566 => 251,  554 => 158,  551 => 190,  541 => 144,  536 => 142,  531 => 139,  511 => 208,  509 => 150,  506 => 188,  488 => 200,  483 => 127,  465 => 110,  463 => 153,  460 => 152,  450 => 182,  427 => 60,  419 => 178,  371 => 101,  362 => 144,  353 => 89,  337 => 102,  333 => 44,  309 => 38,  303 => 81,  299 => 89,  291 => 81,  272 => 99,  261 => 75,  256 => 31,  239 => 29,  235 => 65,  228 => 79,  218 => 55,  213 => 14,  200 => 62,  198 => 48,  159 => 46,  149 => 35,  146 => 31,  131 => 31,  116 => 25,  79 => 16,  74 => 45,  71 => 15,  64 => 6,  858 => 272,  843 => 270,  838 => 326,  819 => 269,  816 => 213,  807 => 212,  794 => 177,  781 => 204,  778 => 197,  775 => 82,  753 => 171,  749 => 191,  744 => 190,  726 => 190,  716 => 226,  712 => 187,  707 => 283,  682 => 217,  669 => 268,  664 => 231,  651 => 170,  646 => 181,  642 => 147,  625 => 209,  614 => 139,  608 => 194,  604 => 201,  601 => 195,  598 => 157,  592 => 155,  585 => 222,  572 => 146,  568 => 176,  564 => 149,  556 => 146,  548 => 180,  544 => 140,  527 => 170,  525 => 138,  515 => 79,  513 => 154,  505 => 127,  486 => 145,  481 => 215,  473 => 121,  467 => 70,  461 => 137,  443 => 64,  435 => 107,  432 => 125,  429 => 124,  410 => 104,  397 => 136,  394 => 115,  379 => 102,  341 => 86,  335 => 95,  318 => 39,  315 => 78,  312 => 39,  306 => 113,  280 => 71,  267 => 70,  253 => 30,  234 => 89,  229 => 42,  223 => 59,  219 => 39,  202 => 82,  192 => 17,  51 => 10,  2159 => 821,  2155 => 820,  2152 => 819,  2149 => 818,  2145 => 817,  2142 => 816,  2139 => 815,  2136 => 814,  2132 => 813,  2129 => 812,  2126 => 572,  2123 => 810,  2117 => 809,  2109 => 847,  2104 => 802,  2101 => 801,  2087 => 799,  2080 => 798,  2077 => 797,  2063 => 795,  2056 => 794,  2053 => 1712,  2042 => 823,  2037 => 789,  2031 => 788,  2028 => 818,  2024 => 786,  2021 => 785,  2008 => 776,  2004 => 811,  2001 => 1668,  1996 => 552,  1994 => 770,  1987 => 549,  1983 => 765,  1979 => 764,  1972 => 761,  1969 => 760,  1966 => 759,  1961 => 756,  1959 => 538,  1952 => 536,  1948 => 750,  1944 => 749,  1937 => 746,  1933 => 1606,  1930 => 744,  1925 => 741,  1923 => 779,  1916 => 526,  1912 => 735,  1908 => 525,  1901 => 524,  1897 => 730,  1894 => 729,  1889 => 523,  1887 => 725,  1880 => 721,  1876 => 720,  1872 => 719,  1865 => 716,  1861 => 517,  1858 => 714,  1855 => 515,  1850 => 710,  1841 => 708,  1835 => 509,  1829 => 706,  1827 => 831,  1820 => 505,  1816 => 700,  1809 => 697,  1804 => 744,  1801 => 695,  1798 => 694,  1795 => 742,  1789 => 491,  1776 => 687,  1771 => 686,  1768 => 685,  1766 => 806,  1759 => 672,  1755 => 478,  1750 => 668,  1745 => 667,  1742 => 794,  1739 => 665,  1736 => 708,  1730 => 705,  1720 => 688,  1716 => 467,  1711 => 655,  1708 => 654,  1698 => 652,  1694 => 651,  1689 => 649,  1682 => 672,  1678 => 644,  1671 => 641,  1666 => 640,  1663 => 639,  1660 => 447,  1657 => 446,  1651 => 656,  1641 => 631,  1637 => 667,  1632 => 628,  1629 => 627,  1619 => 625,  1615 => 624,  1610 => 622,  1603 => 618,  1599 => 651,  1592 => 614,  1587 => 613,  1584 => 635,  1581 => 731,  1576 => 608,  1574 => 412,  1567 => 410,  1563 => 630,  1559 => 601,  1552 => 628,  1548 => 597,  1542 => 593,  1529 => 605,  1525 => 614,  1516 => 708,  1512 => 583,  1503 => 599,  1490 => 574,  1486 => 694,  1477 => 567,  1473 => 566,  1467 => 687,  1460 => 557,  1447 => 569,  1442 => 554,  1427 => 542,  1423 => 377,  1418 => 538,  1415 => 537,  1412 => 536,  1406 => 532,  1393 => 564,  1388 => 537,  1380 => 539,  1376 => 436,  1371 => 645,  1367 => 366,  1364 => 518,  1361 => 523,  1355 => 543,  1342 => 624,  1337 => 510,  1328 => 552,  1324 => 550,  1317 => 403,  1313 => 499,  1310 => 300,  1304 => 504,  1291 => 477,  1286 => 405,  1279 => 486,  1274 => 508,  1270 => 483,  1266 => 464,  1262 => 490,  1257 => 500,  1254 => 286,  1250 => 346,  1246 => 420,  1239 => 389,  1235 => 498,  1232 => 472,  1226 => 340,  1213 => 273,  1208 => 445,  1201 => 334,  1196 => 464,  1192 => 384,  1188 => 456,  1184 => 263,  1179 => 430,  1176 => 261,  1172 => 367,  1168 => 451,  1164 => 450,  1160 => 256,  1153 => 320,  1149 => 359,  1146 => 319,  1137 => 57,  1123 => 407,  1119 => 352,  1115 => 424,  1111 => 310,  1107 => 242,  1102 => 402,  1099 => 438,  1095 => 399,  1091 => 418,  1082 => 329,  1079 => 301,  1076 => 411,  1070 => 389,  1057 => 350,  1052 => 406,  1045 => 293,  1040 => 224,  1036 => 283,  1032 => 360,  1028 => 417,  1023 => 409,  1020 => 311,  1016 => 266,  1012 => 372,  1005 => 216,  1001 => 304,  998 => 365,  992 => 821,  979 => 400,  974 => 256,  967 => 274,  962 => 294,  958 => 269,  954 => 292,  950 => 441,  945 => 376,  942 => 460,  938 => 264,  934 => 263,  927 => 147,  923 => 261,  920 => 369,  910 => 365,  901 => 197,  897 => 273,  890 => 286,  886 => 254,  883 => 353,  868 => 249,  856 => 293,  853 => 341,  849 => 308,  845 => 339,  841 => 249,  835 => 268,  830 => 333,  826 => 282,  822 => 281,  818 => 265,  813 => 181,  810 => 344,  806 => 261,  802 => 178,  795 => 202,  792 => 317,  789 => 206,  784 => 236,  782 => 198,  777 => 275,  772 => 254,  768 => 228,  763 => 199,  760 => 194,  756 => 255,  752 => 192,  745 => 302,  741 => 301,  738 => 254,  732 => 192,  719 => 288,  714 => 186,  710 => 164,  704 => 184,  699 => 183,  695 => 228,  683 => 156,  679 => 155,  668 => 277,  665 => 151,  658 => 173,  645 => 187,  640 => 184,  634 => 206,  628 => 214,  623 => 179,  619 => 78,  615 => 178,  611 => 158,  603 => 136,  599 => 174,  595 => 155,  580 => 256,  573 => 166,  560 => 160,  549 => 123,  543 => 175,  526 => 170,  521 => 222,  518 => 194,  510 => 154,  503 => 133,  499 => 209,  496 => 202,  484 => 128,  474 => 71,  470 => 139,  451 => 112,  446 => 116,  431 => 110,  425 => 111,  416 => 168,  412 => 117,  408 => 100,  403 => 117,  400 => 122,  396 => 96,  392 => 95,  385 => 97,  381 => 150,  367 => 51,  363 => 100,  359 => 125,  355 => 132,  350 => 88,  346 => 86,  343 => 85,  328 => 93,  324 => 91,  313 => 81,  307 => 75,  301 => 119,  288 => 87,  283 => 88,  271 => 86,  257 => 48,  251 => 69,  238 => 93,  233 => 69,  195 => 47,  191 => 23,  187 => 56,  183 => 21,  130 => 28,  88 => 34,  76 => 14,  115 => 34,  95 => 20,  694 => 182,  690 => 211,  687 => 210,  676 => 179,  672 => 153,  660 => 203,  657 => 233,  654 => 275,  643 => 169,  639 => 209,  627 => 166,  624 => 165,  621 => 220,  610 => 236,  606 => 234,  594 => 180,  591 => 170,  588 => 271,  583 => 150,  581 => 206,  574 => 180,  570 => 129,  558 => 197,  555 => 125,  552 => 141,  547 => 188,  545 => 243,  538 => 174,  534 => 189,  530 => 213,  520 => 232,  517 => 210,  514 => 230,  508 => 117,  495 => 132,  490 => 129,  482 => 174,  478 => 122,  466 => 138,  462 => 142,  459 => 114,  448 => 120,  444 => 149,  440 => 110,  436 => 115,  426 => 172,  423 => 59,  420 => 141,  409 => 108,  405 => 218,  401 => 106,  391 => 159,  387 => 133,  384 => 112,  378 => 94,  365 => 93,  360 => 102,  348 => 50,  336 => 82,  332 => 40,  329 => 119,  323 => 116,  310 => 77,  305 => 76,  277 => 70,  274 => 94,  263 => 105,  259 => 79,  247 => 38,  244 => 62,  241 => 59,  222 => 76,  210 => 65,  207 => 49,  204 => 22,  184 => 55,  181 => 77,  167 => 40,  157 => 46,  96 => 22,  421 => 143,  417 => 110,  414 => 109,  406 => 139,  398 => 116,  393 => 53,  390 => 98,  376 => 108,  369 => 148,  366 => 90,  352 => 135,  345 => 99,  342 => 122,  331 => 81,  326 => 80,  320 => 79,  317 => 114,  314 => 86,  311 => 123,  308 => 111,  297 => 93,  293 => 34,  281 => 79,  278 => 71,  275 => 84,  264 => 69,  260 => 80,  248 => 64,  245 => 63,  242 => 56,  231 => 73,  227 => 61,  215 => 60,  212 => 26,  209 => 58,  197 => 61,  177 => 43,  171 => 49,  161 => 51,  132 => 29,  121 => 26,  105 => 22,  99 => 21,  81 => 43,  77 => 16,  180 => 44,  176 => 16,  156 => 36,  143 => 32,  139 => 16,  118 => 29,  189 => 47,  185 => 48,  173 => 43,  166 => 19,  152 => 34,  174 => 37,  164 => 33,  154 => 28,  150 => 32,  137 => 30,  133 => 28,  127 => 15,  107 => 43,  102 => 25,  83 => 20,  78 => 31,  53 => 15,  23 => 3,  42 => 8,  138 => 36,  134 => 30,  109 => 17,  103 => 19,  97 => 17,  94 => 37,  84 => 18,  75 => 16,  69 => 7,  66 => 19,  54 => 7,  44 => 11,  230 => 80,  226 => 52,  203 => 12,  193 => 67,  188 => 33,  182 => 45,  178 => 44,  168 => 52,  163 => 34,  160 => 38,  155 => 45,  148 => 33,  145 => 40,  140 => 30,  136 => 28,  125 => 47,  120 => 23,  113 => 28,  101 => 37,  92 => 11,  89 => 19,  85 => 18,  73 => 15,  62 => 13,  59 => 8,  56 => 8,  41 => 11,  126 => 27,  119 => 30,  111 => 28,  106 => 41,  98 => 63,  93 => 21,  86 => 18,  70 => 22,  60 => 9,  28 => 2,  36 => 5,  114 => 36,  104 => 20,  91 => 16,  80 => 17,  63 => 11,  58 => 17,  40 => 6,  34 => 4,  45 => 11,  61 => 17,  55 => 11,  48 => 10,  39 => 9,  35 => 4,  31 => 4,  26 => 4,  21 => 2,  46 => 9,  29 => 3,  57 => 12,  50 => 10,  47 => 9,  38 => 3,  33 => 6,  49 => 9,  32 => 6,  246 => 94,  236 => 63,  232 => 54,  225 => 63,  221 => 78,  216 => 51,  214 => 53,  211 => 64,  208 => 58,  205 => 57,  199 => 48,  196 => 50,  190 => 56,  179 => 54,  175 => 9,  172 => 70,  169 => 8,  162 => 48,  158 => 17,  153 => 69,  151 => 44,  147 => 3,  144 => 31,  141 => 35,  135 => 33,  129 => 34,  124 => 35,  117 => 26,  112 => 25,  90 => 19,  87 => 15,  82 => 12,  72 => 28,  68 => 13,  65 => 49,  52 => 11,  43 => 4,  37 => 7,  30 => 6,  27 => 5,  25 => 4,  24 => 2,  22 => 2,  19 => 1,);
    }
}
