<?php

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

/* AkeneoPimEnrichmentBundle:Product:renderPdf.html.twig */
class __TwigTemplate_ccef7a7afa72b3614e4d92741f44cb539ea60b3ca983acd9cf89ef583d2e2712 extends \Twig\Template
{
    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = [
            'header' => [$this, 'block_header'],
            'images' => [$this, 'block_images'],
            'attribute_group' => [$this, 'block_attribute_group'],
            'attribute' => [$this, 'block_attribute'],
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        echo "<!DOCTYPE html>
<html>
    <head>
        <title>";
        // line 4
        echo twig_escape_filter($this->env, $this->getAttribute(($context["product"] ?? null), "identifier", []), "html", null, true);
        echo " - ";
        echo twig_escape_filter($this->env, twig_date_format_filter($this->env, ($context["renderingDate"] ?? null)), "html", null, true);
        echo "</title>
        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
        <style type=\"text/css\">
            ";
        // line 7
        if ((null != ($context["customFont"] ?? null))) {
            // line 8
            echo "                @font-face {
                    font-family: 'Custom font';
                    font-style: normal;
                    font-weight: 400;
                    src: url(";
            // line 12
            echo twig_escape_filter($this->env, ($context["customFont"] ?? null), "html", null, true);
            echo ") format('truetype');
                }
            ";
        }
        // line 15
        echo "
            * {
                font-family: 'Custom font', \"DejaVu Sans\", monospace;
                font-weight: 400 !important;
            }

            body {
                font-size: 14px;
            }

            .header {
                margin-bottom: 20px;
                width: 100%;
            }

            .header h1 {
                margin-bottom: 5px;
            }

            .header .rendering-date {
                font-size: 15px;
            }

            .images {
                width: 100%;
                overflow: hidden;
            }

            .images img {
                max-height: 100px;
                display: inline-block;
                margin-right: 20px;
                margin-bottom: 20px;
            }

            .attribute-groups h2 {
                width: 100%;
                background: #7887AB;
                color: white;
                padding: 2.5px 5px;
                font-size: 23px;
                text-transform: uppercase;
                margin: 0px;
            }

            .group {
                border: 1px solid #aaa;
                margin-bottom: 20px;
            }

            .attributes {
                clear:both;
                position:relative;
            }

            .left-column {
                position: absolute;
                left: 0;
                padding: 5px;
                width: 35%;
            }

            .right-column {
                margin-left: 35%;
                padding: 5px;
                width: 65%;
            }
        </style>
    </head>
    <body>
        <div class=\"header\">
            ";
        // line 86
        $this->displayBlock('header', $context, $blocks);
        // line 90
        echo "        </div>
        <div class=\"images\">
            ";
        // line 92
        $this->displayBlock('images', $context, $blocks);
        // line 97
        echo "        </div>
        <div class=\"attribute-groups\">
            ";
        // line 99
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["groupedAttributes"] ?? null));
        $context['loop'] = [
          '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["group"] => $context["attributes"]) {
            // line 100
            echo "                ";
            $this->displayBlock('attribute_group', $context, $blocks);
            // line 141
            echo "            ";
            ++$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['group'], $context['attributes'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 142
        echo "        </div>
    </body>
</html>
";
    }

    // line 86
    public function block_header($context, array $blocks = [])
    {
        // line 87
        echo "                <h1>";
        echo twig_escape_filter($this->env, $this->getAttribute(($context["product"] ?? null), "label", []), "html", null, true);
        echo " ";
        ((($this->getAttribute(($context["product"] ?? null), "identifier", []) != $this->getAttribute(($context["product"] ?? null), "label", []))) ? (print (twig_escape_filter($this->env, (("(" . $this->getAttribute(($context["product"] ?? null), "identifier", [])) . ")"), "html", null, true))) : (print ("")));
        echo "</h1>
                <span class=\"rendering-date\">";
        // line 88
        echo twig_escape_filter($this->env, twig_date_format_filter($this->env, ($context["renderingDate"] ?? null)), "html", null, true);
        echo "</span>
            ";
    }

    // line 92
    public function block_images($context, array $blocks = [])
    {
        // line 93
        echo "                ";
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["imagePaths"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["imagePath"]) {
            // line 94
            echo "                    <img src=\"media/cache/";
            echo twig_escape_filter($this->env, ($context["filter"] ?? null), "html", null, true);
            echo "/";
            echo twig_escape_filter($this->env, $context["imagePath"], "html", null, true);
            echo "\">
                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['imagePath'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 96
        echo "            ";
    }

    // line 100
    public function block_attribute_group($context, array $blocks = [])
    {
        // line 101
        echo "                    <div class=\"group\">
                        <h2>";
        // line 102
        echo twig_escape_filter($this->env, ($context["group"] ?? null), "html", null, true);
        echo "</h2>
                        ";
        // line 103
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["attributes"] ?? null));
        $context['loop'] = [
          '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["attribute"]) {
            // line 104
            echo "                            ";
            $this->displayBlock('attribute', $context, $blocks);
            // line 138
            echo "                        ";
            ++$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['attribute'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 139
        echo "                    </div>
                ";
    }

    // line 104
    public function block_attribute($context, array $blocks = [])
    {
        // line 105
        echo "                                ";
        $context["locale_attribute"] = ((($this->getAttribute(($context["attribute"] ?? null), "isLocalizable", []) || $this->getAttribute(($context["attribute"] ?? null), "isLocaleSpecific", []))) ? (($context["locale"] ?? null)) : (null));
        // line 106
        echo "                                ";
        $context["channel_attribute"] = (($this->getAttribute(($context["attribute"] ?? null), "isScopable", [])) ? (($context["scope"] ?? null)) : (null));
        // line 107
        echo "                                ";
        $context["content"] = $this->getAttribute(($context["product"] ?? null), "getValue", [0 => $this->getAttribute(($context["attribute"] ?? null), "code", []), 1 => ($context["locale_attribute"] ?? null), 2 => ($context["channel_attribute"] ?? null)], "method");
        // line 108
        echo "                                ";
        $context["manualHeight"] = true;
        // line 109
        echo "
                                ";
        // line 110
        if (((("pim_catalog_image" == $this->getAttribute(($context["attribute"] ?? null), "type", [])) && $this->getAttribute(($context["content"] ?? null), "data", [], "any", true, true)) &&  !(null === $this->getAttribute(($context["content"] ?? null), "data", [])))) {
            // line 111
            echo "                                    ";
            $context["content"] = $this->getAttribute($this->getAttribute(($context["content"] ?? null), "data", []), "originalFilename", []);
            // line 112
            echo "                                    ";
            $context["manualHeight"] = false;
            // line 113
            echo "                                ";
        } elseif (((("pim_catalog_simpleselect" == $this->getAttribute(($context["attribute"] ?? null), "type", [])) || ("pim_catalog_multiselect" == $this->getAttribute(($context["attribute"] ?? null), "type", []))) && twig_in_filter($this->getAttribute(($context["attribute"] ?? null), "code", []), twig_get_array_keys_filter(($context["optionLabels"] ?? null))))) {
            // line 114
            echo "                                    ";
            $context["content"] = $this->getAttribute(($context["optionLabels"] ?? null), $this->getAttribute(($context["attribute"] ?? null), "code", []), [], "array");
            // line 115
            echo "                                ";
        }
        // line 116
        echo "
                                ";
        // line 117
        if (((($context["content"] ?? null) != null) && (($context["manualHeight"] ?? null) == true))) {
            // line 118
            echo "                                    ";
            $context["manualHeight"] = (twig_length_filter($this->env, $this->getAttribute(($context["attribute"] ?? null), "label", [])) > (twig_length_filter($this->env, twig_trim_filter(($context["content"] ?? null))) / 3));
            // line 119
            echo "                                ";
        }
        // line 120
        echo "
                                <div class=\"attributes\"";
        // line 121
        if (($context["manualHeight"] ?? null)) {
            echo " style=\"height: ";
            echo twig_escape_filter($this->env, ((twig_round((twig_length_filter($this->env, $this->getAttribute(($context["attribute"] ?? null), "label", [])) / 30), 0, "ceil") * 18) + 10), "html", null, true);
            echo "px\"";
        }
        echo ">
                                    <div class=\"left-column\">
                                        ";
        // line 123
        echo twig_escape_filter($this->env, $this->getAttribute(($context["attribute"] ?? null), "label", []), "html", null, true);
        echo "
                                    </div>
                                    <div class=\"right-column\">
                                        ";
        // line 126
        if ((("pim_catalog_textarea" == $this->getAttribute(($context["attribute"] ?? null), "type", [])) && $this->getAttribute(($context["attribute"] ?? null), "isWysiwygEnabled", []))) {
            // line 127
            echo "                                            ";
            echo ($context["content"] ?? null);
            echo "
                                        ";
        } elseif (("pim_catalog_boolean" == $this->getAttribute(        // line 128
($context["attribute"] ?? null), "type", []))) {
            // line 129
            echo "                                            ";
            // line 130
            echo "                                            ";
            echo twig_escape_filter($this->env, $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans((($this->getAttribute(($context["content"] ?? null), "data", [])) ? ("Yes") : ("No")), [], null, ($context["locale"] ?? null)), "html", null, true);
            echo "
                                        ";
        } else {
            // line 132
            echo "                                            ";
            echo twig_escape_filter($this->env, ($context["content"] ?? null), "html", null, true);
            echo "
                                        ";
        }
        // line 134
        echo "                                        &nbsp;
                                    </div>
                                </div>
                            ";
    }

    public function getTemplateName()
    {
        return "AkeneoPimEnrichmentBundle:Product:renderPdf.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  362 => 134,  356 => 132,  350 => 130,  348 => 129,  346 => 128,  341 => 127,  339 => 126,  333 => 123,  324 => 121,  321 => 120,  318 => 119,  315 => 118,  313 => 117,  310 => 116,  307 => 115,  304 => 114,  301 => 113,  298 => 112,  295 => 111,  293 => 110,  290 => 109,  287 => 108,  284 => 107,  281 => 106,  278 => 105,  275 => 104,  270 => 139,  256 => 138,  253 => 104,  236 => 103,  232 => 102,  229 => 101,  226 => 100,  222 => 96,  211 => 94,  206 => 93,  203 => 92,  197 => 88,  190 => 87,  187 => 86,  180 => 142,  166 => 141,  163 => 100,  146 => 99,  142 => 97,  140 => 92,  136 => 90,  134 => 86,  61 => 15,  55 => 12,  49 => 8,  47 => 7,  39 => 4,  34 => 1,);
    }

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

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

    public function getSourceContext()
    {
        return new Source("", "AkeneoPimEnrichmentBundle:Product:renderPdf.html.twig", "/var/www/html/vendor/akeneo/pim-community-dev/src/Akeneo/Pim/Enrichment/Bundle/Resources/views/Product/renderPdf.html.twig");
    }
}
