<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;

/* components/itilobject/layout.html.twig */
class __TwigTemplate_f2326fdd1bf97e174e9eebfa7bc9865a extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

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

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

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 32
        yield "
";
        // line 33
        $context["rand"] = Twig\Extension\CoreExtension::random($this->env->getCharset());
        // line 34
        $context["main_rand"] = ($context["rand"] ?? null);
        // line 35
        yield "
";
        // line 36
        $context["itil_layout"] = $this->extensions['Glpi\Application\View\Extension\SessionExtension']->userPref("itil_layout", true);
        // line 37
        $context["is_collapsed"] = ((($_v0 = ($context["itil_layout"] ?? null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["collapsed"] ?? null) : null) == "true");
        // line 38
        $context["is_expanded"] = ((($_v1 = ($context["itil_layout"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["expanded"] ?? null) : null) == "true");
        // line 39
        $context["collapsed_cls"] = (((($tmp = ($context["is_collapsed"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("right-collapsed") : (""));
        // line 40
        $context["expanded_cls"] = (((($context["is_expanded"] ?? null) == "true")) ? ("right-expanded") : (""));
        // line 41
        yield "
";
        // line 42
        $context["left_regular_cls"] = "col-lg-8";
        // line 43
        $context["right_regular_cls"] = "col-lg-4";
        // line 44
        yield "
";
        // line 45
        $context["left_expanded_cls"] = "col-xl-5 col-lg-6";
        // line 46
        $context["right_expanded_cls"] = "col-xl-7 col-lg-6";
        // line 47
        yield "
";
        // line 48
        $context["left_side_cls"] = ($context["left_regular_cls"] ?? null);
        // line 49
        $context["right_side_cls"] = ($context["right_regular_cls"] ?? null);
        // line 50
        if ((($tmp = ($context["is_expanded"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 51
            yield "    ";
            $context["left_side_cls"] = ($context["left_expanded_cls"] ?? null);
            // line 52
            yield "    ";
            $context["right_side_cls"] = ($context["right_expanded_cls"] ?? null);
        }
        // line 54
        yield "

<div id=\"itil-object-container\" class=\"mt-n1 ";
        // line 56
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["collapsed_cls"] ?? null), "html", null, true);
        yield " ";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["expanded_cls"] ?? null), "html", null, true);
        yield "\">

   ";
        // line 58
        if ((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isNewItem", [], "method", false, false, false, 58) &&  !(($_v2 = ($context["params"] ?? null)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["template_preview"] ?? null) : null))) {
            // line 59
            yield "      ";
            yield Twig\Extension\CoreExtension::include($this->env, $context, "components/itilobject/mainform_open.html.twig");
            yield "
   ";
        }
        // line 61
        yield "
   <div class=\"row d-flex flex-column alin-items-stretch itil-object\">
      ";
        // line 63
        $context["is_timeline_reversed"] = ($this->extensions['Glpi\Application\View\Extension\SessionExtension']->userPref("timeline_order") == Twig\Extension\CoreExtension::constant("CommonITILObject::TIMELINE_ORDER_REVERSE"));
        // line 64
        yield "      ";
        $context["fl_direction"] = (((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isNewItem", [], "method", false, false, false, 64) || ($context["is_timeline_reversed"] ?? null))) ? ("flex-column") : ("flex-column-reverse"));
        // line 65
        yield "      <div class=\"itil-left-side col-12 ";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_side_cls"] ?? null), "html", null, true);
        yield " order-last order-lg-first pt-2 pe-2 pe-lg-4 d-flex ";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["fl_direction"] ?? null), "html", null, true);
        yield " border-top border-4\">
         ";
        // line 66
        if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isNewItem", [], "method", false, false, false, 66)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 67
            yield "            ";
            yield Twig\Extension\CoreExtension::include($this->env, $context, "components/itilobject/timeline/new_form.html.twig");
            yield "
         ";
        } else {
            // line 69
            yield "            ";
            yield Twig\Extension\CoreExtension::include($this->env, $context, "components/itilobject/timeline/timeline.html.twig");
            yield "
         ";
        }
        // line 71
        yield "      </div>
      <div class=\"itil-right-side col-12 ";
        // line 72
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["right_side_cls"] ?? null), "html", null, true);
        yield " mt-0 mt-lg-n1 card-footer p-0 rounded-0\">
         ";
        // line 73
        if ((($tmp =  !CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isNewItem", [], "method", false, false, false, 73)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 74
            yield "            ";
            yield Twig\Extension\CoreExtension::include($this->env, $context, "components/itilobject/mainform_open.html.twig");
            yield "
         ";
        }
        // line 76
        yield "         ";
        yield Twig\Extension\CoreExtension::include($this->env, $context, "components/itilobject/fields_panel.html.twig");
        yield "
         ";
        // line 77
        if ((($tmp =  !CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isNewItem", [], "method", false, false, false, 77)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 78
            yield "            ";
            yield Twig\Extension\CoreExtension::include($this->env, $context, "components/itilobject/mainform_close.html.twig");
            yield "
         ";
        }
        // line 80
        yield "      </div>
   </div>

   ";
        // line 83
        if ((($tmp =  !(($_v3 = ($context["params"] ?? null)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["template_preview"] ?? null) : null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 84
            yield "      ";
            yield Twig\Extension\CoreExtension::include($this->env, $context, "components/itilobject/footer.html.twig");
            yield "
   ";
        }
        // line 86
        yield "
   ";
        // line 87
        if (( !CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isNewItem", [], "method", false, false, false, 87) &&  !(($_v4 = ($context["params"] ?? null)) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["template_preview"] ?? null) : null))) {
            // line 88
            yield "      ";
            yield Twig\Extension\CoreExtension::include($this->env, $context, "components/itilobject/mainform_close.html.twig");
            yield "
   ";
        }
        // line 90
        yield "
</div>

";
        // line 93
        if ((($tmp = ($context["ticket_ticket"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 94
            yield "   ";
            // line 95
            yield "   <form method=\"POST\" action=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["ticket_ticket"] ?? null), "getFormURL", [], "method", false, false, false, 95), "html", null, true);
            yield "\" class=\"d-none\" id=\"linked_tickets_";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["main_rand"] ?? null), "html", null, true);
            yield "\" data-submit-once>
      <input type=\"hidden\" name=\"_glpi_csrf_token\" value=\"";
            // line 96
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Session::getNewCSRFToken(), "html", null, true);
            yield "\" />
      <input type=\"hidden\" name=\"purge\" value=\"1\" />
      <input type=\"hidden\" name=\"tickets_id\" value=\"";
            // line 98
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v5 = CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "fields", [], "any", false, false, false, 98)) && is_array($_v5) || $_v5 instanceof ArrayAccess ? ($_v5["id"] ?? null) : null), "html", null, true);
            yield "\" />
   </form>
";
        }
        // line 101
        yield "
";
        // line 103
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(["requester", "observer", "assign"]);
        foreach ($context['_seq'] as $context["_key"] => $context["actortype"]) {
            // line 104
            yield "   <form method=\"POST\" action=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "getFormURL", [], "method", false, false, false, 104), "html", null, true);
            yield "\" class=\"d-none\" id=\"addme_as_";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["actortype"], "html", null, true);
            yield "_";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["main_rand"] ?? null), "html", null, true);
            yield "\" data-submit-once>
      <input type=\"hidden\" name=\"_glpi_csrf_token\" value=\"";
            // line 105
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Session::getNewCSRFToken(), "html", null, true);
            yield "\" />
      <input type=\"hidden\" name=\"addme_as_actor\" value=\"1\" />
      <input type=\"hidden\" name=\"actortype\" value=\"";
            // line 107
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["actortype"], "html", null, true);
            yield "\" />
   </form>
";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['actortype'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 110
        yield "
<form name=\"massaction_";
        // line 111
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\" id=\"massaction_";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\" method=\"post\"
      action=\"";
        // line 112
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\RoutingExtension']->path("/front/massiveaction.php"), "html", null, true);
        yield "\" data-submit-once>
   <div id=\"massive_container_";
        // line 113
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\"></div>
   <input type=\"hidden\" name=\"_glpi_csrf_token\" value=\"";
        // line 114
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Session::getNewCSRFToken(), "html", null, true);
        yield "\" />
</form>

<script type=\"text/javascript\">
\$(function() {
   \$(document).on(\"click\", \".switch-panel-width\", function() {
       if (\$(\x27#itil-object-container\x27).hasClass(\x27right-collapsed\x27)) {
           \$(\x27#itil-object-container\x27).removeClass(\x27right-collapsed\x27);
       } else if (\$(\x27.itil-left-side\x27).hasClass(\"";
        // line 122
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_regular_cls"] ?? null), "html", null, true);
        yield "\")) {
         // Expand right-side panel
         \$(\x27#itil-object-container\x27).addClass(\x27right-expanded\x27);
         // Left side
         \$(\x27.itil-left-side\x27).removeClass(\"";
        // line 126
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_regular_cls"] ?? null), "html", null, true);
        yield "\").addClass(\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_expanded_cls"] ?? null), "html", null, true);
        yield "\");
         \$(\x27.itil-footer .timeline-buttons\x27).removeClass(\"";
        // line 127
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_regular_cls"] ?? null), "html", null, true);
        yield "\").addClass(\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_expanded_cls"] ?? null), "html", null, true);
        yield "\");
         // Right side
         \$(\x27.itil-footer .form-buttons\x27).removeClass(\x27col-lg\x27).addClass(\"";
        // line 129
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["right_expanded_cls"] ?? null), "html", null, true);
        yield "\");
         \$(\x27.itil-right-side\x27).removeClass(\"";
        // line 130
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["right_regular_cls"] ?? null), "html", null, true);
        yield "\").addClass(\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["right_expanded_cls"] ?? null), "html", null, true);
        yield "\");
         // Switcher buttons
         \$(\x27.switch-panel-width i.fas\x27).removeClass(\x27fa-caret-left\x27).addClass(\x27fa-caret-right\x27);
         \$(\x27.itil-right-side .accordion-body:not(.accordion-actors).row .col-12\x27).removeClass(\x27col-12\x27).addClass(\x27col-sm-6\x27);
         \$(\x27#actors .col-12\x27).removeClass(\x27col-12\x27).addClass(\x27col-sm-4\x27);
      } else {
         // Decrease right-side panel
         \$(\x27#itil-object-container\x27).removeClass(\x27right-expanded\x27);
         // Left side
         \$(\x27.itil-left-side\x27).removeClass(\"";
        // line 139
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_expanded_cls"] ?? null), "html", null, true);
        yield "\").addClass(\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_regular_cls"] ?? null), "html", null, true);
        yield "\");
         \$(\x27.itil-footer .timeline-buttons\x27).removeClass(\"";
        // line 140
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_expanded_cls"] ?? null), "html", null, true);
        yield "\").addClass(\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["left_regular_cls"] ?? null), "html", null, true);
        yield "\");
         // Right side
         \$(\x27.itil-footer .form-buttons\x27).removeClass(\"";
        // line 142
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["right_expanded_cls"] ?? null), "html", null, true);
        yield "\").addClass(\x27col-lg\x27);
         \$(\x27.itil-right-side\x27).removeClass(\"";
        // line 143
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["right_expanded_cls"] ?? null), "html", null, true);
        yield "\").addClass(\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["right_regular_cls"] ?? null), "html", null, true);
        yield "\");
         // Switcher buttons
         \$(\x27.switch-panel-width i.fas\x27).removeClass(\x27fa-caret-right\x27).addClass(\x27fa-caret-left\x27);
         \$(\x27.itil-right-side .accordion-body:not(.accordion-actors).row .col-sm-6\x27).removeClass(\x27col-sm-6\x27).addClass(\x27col-12\x27);
         \$(\x27#actors .col-sm-4\x27).removeClass(\x27col-sm-4\x27).addClass(\x27col-12\x27);
      }

      saveFieldPanelState();
   });

    \$(document).on(\"click\", \".collapse-panel\", function() {
       \$(\x27#itil-object-container\x27).addClass(\x27right-collapsed\x27);

        // Hide all accordion item
        \$(\x27#itil-data .accordion-collapse\x27).removeClass(\x27show\x27);
        \$(\x27#itil-data .accordion-button\x27).addClass(\x27collapsed\x27);

       saveFieldPanelState();
    });

    \$(document).on(\"click\", \".right-collapsed .itil-right-side\", function(event) {
        \$(\x27#itil-object-container\x27).removeClass(\x27right-collapsed\x27);
        saveFieldPanelState();
    });

    var myCollapsible = document.getElementById(\x27itil-data\x27)
    myCollapsible.addEventListener(\x27shown.bs.collapse\x27, function () {
        saveFieldPanelState();
    });
    myCollapsible.addEventListener(\x27hidden.bs.collapse\x27, function () {
        saveFieldPanelState();
    });

    var itil_layout = {
        collapsed: false,
        expanded: false,
        items: {}
    };

    var saveFieldPanelState = function() {
        itil_layout.collapsed = \$(\x27#itil-object-container\x27).hasClass(\x27right-collapsed\x27);
        itil_layout.expanded  = \$(\x27#itil-object-container\x27).hasClass(\x27right-expanded\x27);

        \$(\x27#itil-data .accordion-collapse\x27).each(function() {
            var item_shown = \$(this).hasClass(\x27show\x27);
            var item_id    = \$(this).attr(\x27id\x27);

            itil_layout.items[item_id] = item_shown;
        });

        \$.ajax({
            url: CFG_GLPI.root_doc + \x27/ajax/itillayout.php\x27,
            type: \x27POST\x27,
            datatype: \"json\",
            data: {
                \x27itil_layout\x27: itil_layout
            }
        });
    }

    var restoreFieldPanelState = function() {
        \$.each(field_panel_state.items, function(item_id, item_shown) {
            if (item_shown) {
                \$(\x27#\x27 + item_id).addClass(\x27show\x27);
            } else {
                \$(\x27#\x27 + item_id).removeClass(\x27show\x27);
            }
        });
    }
});
</script>
";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "components/itilobject/layout.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  333 => 143,  329 => 142,  322 => 140,  316 => 139,  302 => 130,  298 => 129,  291 => 127,  285 => 126,  278 => 122,  267 => 114,  263 => 113,  259 => 112,  253 => 111,  250 => 110,  241 => 107,  236 => 105,  227 => 104,  223 => 103,  220 => 101,  214 => 98,  209 => 96,  202 => 95,  200 => 94,  198 => 93,  193 => 90,  187 => 88,  185 => 87,  182 => 86,  176 => 84,  174 => 83,  169 => 80,  163 => 78,  161 => 77,  156 => 76,  150 => 74,  148 => 73,  144 => 72,  141 => 71,  135 => 69,  129 => 67,  127 => 66,  120 => 65,  117 => 64,  115 => 63,  111 => 61,  105 => 59,  103 => 58,  96 => 56,  92 => 54,  88 => 52,  85 => 51,  83 => 50,  81 => 49,  79 => 48,  76 => 47,  74 => 46,  72 => 45,  69 => 44,  67 => 43,  65 => 42,  62 => 41,  60 => 40,  58 => 39,  56 => 38,  54 => 37,  52 => 36,  49 => 35,  47 => 34,  45 => 33,  42 => 32,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "components/itilobject/layout.html.twig", "C:\\xampp\\htdocs\\itsm\\templates\\components\\itilobject\\layout.html.twig");
    }
}
